aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2009-06-15 09:50:49 -0400
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 09:50:49 -0400
commit722f2a6c87f34ee0fd0130a8cf45f81e0705594a (patch)
tree50b054df34d2731eb0ba0cf1a6c27e43e7eed428 /arch
parent7a0aeb14e18ad59394bd9bbc6e57fb345819e748 (diff)
parent45e3e1935e2857c54783291107d33323b3ef33c8 (diff)
Merge commit 'linus/master' into HEAD
Conflicts: MAINTAINERS Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/atomic.h2
-rw-r--r--arch/alpha/include/asm/bitsperlong.h8
-rw-r--r--arch/alpha/include/asm/page.h2
-rw-r--r--arch/alpha/include/asm/signal.h2
-rw-r--r--arch/alpha/include/asm/suspend.h6
-rw-r--r--arch/alpha/include/asm/types.h3
-rw-r--r--arch/alpha/mm/extable.c21
-rw-r--r--arch/arm/Kconfig250
-rw-r--r--arch/arm/Makefile124
-rw-r--r--arch/arm/boot/compressed/Makefile5
-rw-r--r--arch/arm/boot/compressed/head.S6
-rw-r--r--arch/arm/common/Kconfig12
-rw-r--r--arch/arm/common/Makefile1
-rw-r--r--arch/arm/common/clkdev.c18
-rw-r--r--arch/arm/common/sharpsl_pm.c859
-rw-r--r--arch/arm/common/vic.c221
-rw-r--r--arch/arm/configs/cm_x300_defconfig329
-rw-r--r--arch/arm/configs/davinci_all_defconfig21
-rw-r--r--arch/arm/configs/ep93xx_defconfig853
-rw-r--r--arch/arm/configs/kirkwood_defconfig5
-rw-r--r--arch/arm/configs/magician_defconfig5
-rw-r--r--arch/arm/configs/mx21_defconfig1170
-rw-r--r--arch/arm/configs/omap3_evm_defconfig1528
-rw-r--r--arch/arm/configs/omap_4430sdp_defconfig866
-rw-r--r--arch/arm/configs/omap_zoom2_defconfig1211
-rw-r--r--arch/arm/configs/orion5x_defconfig3
-rw-r--r--arch/arm/configs/rx51_defconfig2
-rw-r--r--arch/arm/configs/stmp378x_defconfig1141
-rw-r--r--arch/arm/configs/stmp37xx_defconfig1002
-rw-r--r--arch/arm/configs/u300_defconfig1115
-rw-r--r--arch/arm/configs/w90p910_defconfig423
-rw-r--r--arch/arm/include/asm/atomic.h2
-rw-r--r--arch/arm/include/asm/bitsperlong.h1
-rw-r--r--arch/arm/include/asm/cacheflush.h8
-rw-r--r--arch/arm/include/asm/cputype.h25
-rw-r--r--arch/arm/include/asm/hardware/arm_twd.h21
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h2
-rw-r--r--arch/arm/include/asm/hardware/pl080.h138
-rw-r--r--arch/arm/include/asm/hardware/vic.h2
-rw-r--r--arch/arm/include/asm/localtimer.h63
-rw-r--r--arch/arm/include/asm/mach/map.h8
-rw-r--r--arch/arm/include/asm/mman.h2
-rw-r--r--arch/arm/include/asm/page.h2
-rw-r--r--arch/arm/include/asm/pgtable.h2
-rw-r--r--arch/arm/include/asm/processor.h1
-rw-r--r--arch/arm/include/asm/ptrace.h17
-rw-r--r--arch/arm/include/asm/signal.h2
-rw-r--r--arch/arm/include/asm/sizes.h1
-rw-r--r--arch/arm/include/asm/smp.h42
-rw-r--r--arch/arm/include/asm/smp_scu.h7
-rw-r--r--arch/arm/include/asm/smp_twd.h12
-rw-r--r--arch/arm/include/asm/suspend.h4
-rw-r--r--arch/arm/include/asm/tlbflush.h26
-rw-r--r--arch/arm/include/asm/uaccess.h2
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/entry-armv.S3
-rw-r--r--arch/arm/kernel/entry-common.S3
-rw-r--r--arch/arm/kernel/process.c2
-rw-r--r--arch/arm/kernel/signal.c8
-rw-r--r--arch/arm/kernel/smp.c131
-rw-r--r--arch/arm/kernel/smp_scu.c48
-rw-r--r--arch/arm/kernel/smp_twd.c175
-rw-r--r--arch/arm/kernel/vmlinux.lds.S2
-rw-r--r--arch/arm/lib/Makefile3
-rw-r--r--arch/arm/lib/clear_user.S3
-rw-r--r--arch/arm/lib/copy_to_user.S3
-rw-r--r--arch/arm/lib/uaccess_with_memcpy.c228
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c6
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c9
-rw-r--r--arch/arm/mach-at91/clock.c151
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pmc.h26
-rw-r--r--arch/arm/mach-davinci/Kconfig43
-rw-r--r--arch/arm/mach-davinci/Makefile13
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c298
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c296
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c68
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c262
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c189
-rw-r--r--arch/arm/mach-davinci/clock.c10
-rw-r--r--arch/arm/mach-davinci/clock.h4
-rw-r--r--arch/arm/mach-davinci/common.c108
-rw-r--r--arch/arm/mach-davinci/cp_intc.c161
-rw-r--r--arch/arm/mach-davinci/devices.c211
-rw-r--r--arch/arm/mach-davinci/dm355.c730
-rw-r--r--arch/arm/mach-davinci/dm644x.c204
-rw-r--r--arch/arm/mach-davinci/dm646x.c636
-rw-r--r--arch/arm/mach-davinci/gpio.c63
-rw-r--r--arch/arm/mach-davinci/id.c116
-rw-r--r--arch/arm/mach-davinci/include/mach/board-dm6446evm.h20
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h55
-rw-r--r--arch/arm/mach-davinci/include/mach/cp_intc.h57
-rw-r--r--arch/arm/mach-davinci/include/mach/cputype.h29
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S31
-rw-r--r--arch/arm/mach-davinci/include/mach/dm355.h22
-rw-r--r--arch/arm/mach-davinci/include/mach/dm644x.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/dm646x.h26
-rw-r--r--arch/arm/mach-davinci/include/mach/edma.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/emac.h36
-rw-r--r--arch/arm/mach-davinci/include/mach/entry-macro.S25
-rw-r--r--arch/arm/mach-davinci/include/mach/gpio.h14
-rw-r--r--arch/arm/mach-davinci/include/mach/irqs.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/memory.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/mmc.h33
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h16
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h8
-rw-r--r--arch/arm/mach-davinci/include/mach/serial.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/sram.h27
-rw-r--r--arch/arm/mach-davinci/include/mach/time.h35
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h19
-rw-r--r--arch/arm/mach-davinci/io.c38
-rw-r--r--arch/arm/mach-davinci/irq.c217
-rw-r--r--arch/arm/mach-davinci/mux.c24
-rw-r--r--arch/arm/mach-davinci/psc.c32
-rw-r--r--arch/arm/mach-davinci/serial.c74
-rw-r--r--arch/arm/mach-davinci/sram.c74
-rw-r--r--arch/arm/mach-davinci/time.c247
-rw-r--r--arch/arm/mach-ep93xx/Kconfig82
-rw-r--r--arch/arm/mach-ep93xx/Makefile8
-rw-r--r--arch/arm/mach-ep93xx/Makefile.boot7
-rw-r--r--arch/arm/mach-ep93xx/clock.c58
-rw-r--r--arch/arm/mach-ep93xx/core.c27
-rw-r--r--arch/arm/mach-ep93xx/edb9302.c68
-rw-r--r--arch/arm/mach-ep93xx/edb9302a.c68
-rw-r--r--arch/arm/mach-ep93xx/edb9307.c68
-rw-r--r--arch/arm/mach-ep93xx/edb9307a.c80
-rw-r--r--arch/arm/mach-ep93xx/edb9312.c69
-rw-r--r--arch/arm/mach-ep93xx/edb9315.c68
-rw-r--r--arch/arm/mach-ep93xx/edb9315a.c68
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c217
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h20
-rw-r--r--arch/arm/mach-ep93xx/include/mach/memory.h6
-rw-r--r--arch/arm/mach-imx/Kconfig11
-rw-r--r--arch/arm/mach-imx/Makefile18
-rw-r--r--arch/arm/mach-imx/Makefile.boot2
-rw-r--r--arch/arm/mach-imx/clock.c210
-rw-r--r--arch/arm/mach-imx/cpufreq.c315
-rw-r--r--arch/arm/mach-imx/dma.c597
-rw-r--r--arch/arm/mach-imx/generic.c271
-rw-r--r--arch/arm/mach-imx/generic.h16
-rw-r--r--arch/arm/mach-imx/include/mach/debug-macro.S34
-rw-r--r--arch/arm/mach-imx/include/mach/dma.h56
-rw-r--r--arch/arm/mach-imx/include/mach/entry-macro.S32
-rw-r--r--arch/arm/mach-imx/include/mach/gpio.h106
-rw-r--r--arch/arm/mach-imx/include/mach/hardware.h91
-rw-r--r--arch/arm/mach-imx/include/mach/imx-dma.h98
-rw-r--r--arch/arm/mach-imx/include/mach/imx-regs.h376
-rw-r--r--arch/arm/mach-imx/include/mach/imx-uart.h12
-rw-r--r--arch/arm/mach-imx/include/mach/irqs.h121
-rw-r--r--arch/arm/mach-imx/include/mach/mmc.h15
-rw-r--r--arch/arm/mach-imx/include/mach/mx1ads.h36
-rw-r--r--arch/arm/mach-imx/include/mach/spi_imx.h72
-rw-r--r--arch/arm/mach-imx/include/mach/uncompress.h71
-rw-r--r--arch/arm/mach-imx/irq.c311
-rw-r--r--arch/arm/mach-imx/leds-mx1ads.c53
-rw-r--r--arch/arm/mach-imx/leds.c31
-rw-r--r--arch/arm/mach-imx/leds.h9
-rw-r--r--arch/arm/mach-imx/mx1ads.c180
-rw-r--r--arch/arm/mach-imx/time.c220
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig6
-rw-r--r--arch/arm/mach-ixp4xx/Makefile1
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c507
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/cpu.h7
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/qmgr.h69
-rw-r--r--arch/arm/mach-ixp4xx/ixp4xx_npe.c9
-rw-r--r--arch/arm/mach-ixp4xx/ixp4xx_qmgr.c135
-rw-r--r--arch/arm/mach-kirkwood/Kconfig6
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/addr-map.c14
-rw-r--r--arch/arm/mach-kirkwood/common.c159
-rw-r--r--arch/arm/mach-kirkwood/common.h4
-rw-r--r--arch/arm/mach-kirkwood/cpuidle.c96
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c31
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h21
-rw-r--r--arch/arm/mach-kirkwood/include/mach/io.h25
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h18
-rw-r--r--arch/arm/mach-kirkwood/mpp.c3
-rw-r--r--arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c173
-rw-r--r--arch/arm/mach-kirkwood/pcie.c4
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c31
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c32
-rw-r--r--arch/arm/mach-mmp/include/mach/irqs.h1
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa168.h27
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa910.h8
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h44
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h44
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-apbc.h14
-rw-r--r--arch/arm/mach-mmp/pxa168.c18
-rw-r--r--arch/arm/mach-mmp/pxa910.c18
-rw-r--r--arch/arm/mach-mv78xx0/irq.c3
-rw-r--r--arch/arm/mach-mx1/generic.c5
-rw-r--r--arch/arm/mach-mx1/mx1ads.c92
-rw-r--r--arch/arm/mach-mx1/scb9328.c2
-rw-r--r--arch/arm/mach-mx2/Kconfig21
-rw-r--r--arch/arm/mach-mx2/Makefile4
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c77
-rw-r--r--arch/arm/mach-mx2/generic.c12
-rw-r--r--arch/arm/mach-mx2/mx21ads.c286
-rw-r--r--arch/arm/mach-mx2/mx27ads.c315
-rw-r--r--arch/arm/mach-mx2/mx27lite.c95
-rw-r--r--arch/arm/mach-mx2/mx27pdk.c95
-rw-r--r--arch/arm/mach-mx2/pcm038.c195
-rw-r--r--arch/arm/mach-mx2/pcm970-baseboard.c123
-rw-r--r--arch/arm/mach-mx3/Kconfig34
-rw-r--r--arch/arm/mach-mx3/Makefile4
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c295
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c38
-rw-r--r--arch/arm/mach-mx3/clock.c17
-rw-r--r--arch/arm/mach-mx3/devices.c66
-rw-r--r--arch/arm/mach-mx3/devices.h4
-rw-r--r--arch/arm/mach-mx3/iomux.c25
-rw-r--r--arch/arm/mach-mx3/mm.c11
-rw-r--r--arch/arm/mach-mx3/mx31ads.c4
-rw-r--r--arch/arm/mach-mx3/mx31lilly-db.c216
-rw-r--r--arch/arm/mach-mx3/mx31lilly.c155
-rw-r--r--arch/arm/mach-mx3/mx31lite.c74
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c123
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c128
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c117
-rw-r--r--arch/arm/mach-mx3/mx31pdk.c200
-rw-r--r--arch/arm/mach-mx3/mx35pdk.c104
-rw-r--r--arch/arm/mach-mx3/pcm037.c282
-rw-r--r--arch/arm/mach-mx3/pcm043.c252
-rw-r--r--arch/arm/mach-mx3/qong.c2
-rw-r--r--arch/arm/mach-netx/generic.c2
-rw-r--r--arch/arm/mach-omap1/Kconfig1
-rw-r--r--arch/arm/mach-omap1/Makefile4
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c13
-rw-r--r--arch/arm/mach-omap1/clock.c2
-rw-r--r--arch/arm/mach-omap1/pm.c11
-rw-r--r--arch/arm/mach-omap1/pm.h (renamed from arch/arm/plat-omap/include/mach/pm.h)85
-rw-r--r--arch/arm/mach-omap1/serial.c3
-rw-r--r--arch/arm/mach-omap1/sleep.S2
-rw-r--r--arch/arm/mach-omap2/Kconfig14
-rw-r--r--arch/arm/mach-omap2/Makefile39
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c114
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c87
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c94
-rw-r--r--arch/arm/mach-omap2/board-ldp.c219
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c108
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c329
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c197
-rw-r--r--arch/arm/mach-omap2/board-overo.c79
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c232
-rw-r--r--arch/arm/mach-omap2/board-zoom-debugboard.c160
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c110
-rw-r--r--arch/arm/mach-omap2/clock.c18
-rw-r--r--arch/arm/mach-omap2/clock24xx.c23
-rw-r--r--arch/arm/mach-omap2/clock24xx.h11
-rw-r--r--arch/arm/mach-omap2/clock34xx.c23
-rw-r--r--arch/arm/mach-omap2/clock34xx.h35
-rw-r--r--arch/arm/mach-omap2/clockdomains.h2
-rw-r--r--arch/arm/mach-omap2/cm-regbits-34xx.h14
-rw-r--r--arch/arm/mach-omap2/cm.h6
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c330
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.c189
-rw-r--r--arch/arm/mach-omap2/gpmc.c6
-rw-r--r--arch/arm/mach-omap2/id.c8
-rw-r--r--arch/arm/mach-omap2/io.c52
-rw-r--r--arch/arm/mach-omap2/iommu2.c323
-rw-r--r--arch/arm/mach-omap2/irq.c18
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c280
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.h3
-rw-r--r--arch/arm/mach-omap2/omap-headsmp.S46
-rw-r--r--arch/arm/mach-omap2/omap-smp.c178
-rw-r--r--arch/arm/mach-omap2/omap3-iommu.c105
-rw-r--r--arch/arm/mach-omap2/pm-debug.c152
-rw-r--r--arch/arm/mach-omap2/pm.c111
-rw-r--r--arch/arm/mach-omap2/pm.h38
-rw-r--r--arch/arm/mach-omap2/pm24xx.c549
-rw-r--r--arch/arm/mach-omap2/pm34xx.c710
-rw-r--r--arch/arm/mach-omap2/prcm-common.h2
-rw-r--r--arch/arm/mach-omap2/prm.h207
-rw-r--r--arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h55
-rw-r--r--arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h54
-rw-r--r--arch/arm/mach-omap2/sdrc.c24
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c5
-rw-r--r--arch/arm/mach-omap2/serial.c465
-rw-r--r--arch/arm/mach-omap2/sleep24xx.S1
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S436
-rw-r--r--arch/arm/mach-omap2/sram242x.S10
-rw-r--r--arch/arm/mach-omap2/sram243x.S10
-rw-r--r--arch/arm/mach-omap2/sram34xx.S129
-rw-r--r--arch/arm/mach-omap2/timer-gp.c13
-rw-r--r--arch/arm/mach-omap2/timer-mpu.c34
-rw-r--r--arch/arm/mach-omap2/usb-musb.c21
-rw-r--r--arch/arm/mach-orion5x/addr-map.c14
-rw-r--r--arch/arm/mach-orion5x/common.c42
-rw-r--r--arch/arm/mach-orion5x/common.h2
-rw-r--r--arch/arm/mach-orion5x/include/mach/bridge-regs.h4
-rw-r--r--arch/arm/mach-orion5x/include/mach/orion5x.h6
-rw-r--r--arch/arm/mach-orion5x/include/mach/system.h2
-rw-r--r--arch/arm/mach-orion5x/mpp.c3
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c4
-rw-r--r--arch/arm/mach-orion5x/ts78xx-fpga.h1
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c58
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c16
-rw-r--r--arch/arm/mach-pxa/Kconfig25
-rw-r--r--arch/arm/mach-pxa/Makefile3
-rw-r--r--arch/arm/mach-pxa/clock.c17
-rw-r--r--arch/arm/mach-pxa/cm-x270.c4
-rw-r--r--arch/arm/mach-pxa/cm-x300.c55
-rw-r--r--arch/arm/mach-pxa/corgi.c47
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c3
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa2xx.c104
-rw-r--r--arch/arm/mach-pxa/csb726.c20
-rw-r--r--arch/arm/mach-pxa/devices.c4
-rw-r--r--arch/arm/mach-pxa/em-x270.c173
-rw-r--r--arch/arm/mach-pxa/ezx.c177
-rw-r--r--arch/arm/mach-pxa/hx4700.c851
-rw-r--r--arch/arm/mach-pxa/imote2.c52
-rw-r--r--arch/arm/mach-pxa/include/mach/hx4700.h131
-rw-r--r--arch/arm/mach-pxa/include/mach/irqs.h18
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa320.h14
-rw-r--r--arch/arm/mach-pxa/include/mach/palmld.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/pm.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa27x.h3
-rw-r--r--arch/arm/mach-pxa/include/mach/sharpsl_pm.h (renamed from arch/arm/include/asm/hardware/sharpsl_pm.h)8
-rw-r--r--arch/arm/mach-pxa/include/mach/uncompress.h3
-rw-r--r--arch/arm/mach-pxa/littleton.c82
-rw-r--r--arch/arm/mach-pxa/magician.c14
-rw-r--r--arch/arm/mach-pxa/mainstone.c2
-rw-r--r--arch/arm/mach-pxa/mioa701.c4
-rw-r--r--arch/arm/mach-pxa/palmld.c42
-rw-r--r--arch/arm/mach-pxa/palmt5.c46
-rw-r--r--arch/arm/mach-pxa/palmte2.c32
-rw-r--r--arch/arm/mach-pxa/palmtx.c45
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c2
-rw-r--r--arch/arm/mach-pxa/pm.c4
-rw-r--r--arch/arm/mach-pxa/poodle.c17
-rw-r--r--arch/arm/mach-pxa/pxa27x.c21
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c4
-rw-r--r--arch/arm/mach-pxa/saar.c2
-rw-r--r--arch/arm/mach-pxa/sharpsl.h4
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c863
-rw-r--r--arch/arm/mach-pxa/spitz.c78
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c3
-rw-r--r--arch/arm/mach-pxa/stargate2.c796
-rw-r--r--arch/arm/mach-pxa/tosa.c2
-rw-r--r--arch/arm/mach-pxa/trizeps4.c2
-rw-r--r--arch/arm/mach-pxa/viper.c2
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c2
-rw-r--r--arch/arm/mach-realview/Kconfig17
-rw-r--r--arch/arm/mach-realview/Makefile4
-rw-r--r--arch/arm/mach-realview/core.c10
-rw-r--r--arch/arm/mach-realview/core.h3
-rw-r--r--arch/arm/mach-realview/include/mach/board-eb.h105
-rw-r--r--arch/arm/mach-realview/include/mach/board-pb1176.h80
-rw-r--r--arch/arm/mach-realview/include/mach/board-pb11mp.h101
-rw-r--r--arch/arm/mach-realview/include/mach/board-pba8.h77
-rw-r--r--arch/arm/mach-realview/include/mach/board-pbx.h108
-rw-r--r--arch/arm/mach-realview/include/mach/debug-macro.S3
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-eb.h129
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pb1176.h99
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pb11mp.h122
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pba8.h98
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pbx.h115
-rw-r--r--arch/arm/mach-realview/include/mach/irqs.h9
-rw-r--r--arch/arm/mach-realview/include/mach/scu.h13
-rw-r--r--arch/arm/mach-realview/include/mach/uncompress.h3
-rw-r--r--arch/arm/mach-realview/localtimer.c188
-rw-r--r--arch/arm/mach-realview/platsmp.c53
-rw-r--r--arch/arm/mach-realview/realview_eb.c1
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c23
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c1
-rw-r--r--arch/arm/mach-realview/realview_pbx.c335
-rw-r--r--arch/arm/mach-s3c2400/gpio.c6
-rw-r--r--arch/arm/mach-s3c2410/Kconfig8
-rw-r--r--arch/arm/mach-s3c2410/dma.c4
-rw-r--r--arch/arm/mach-s3c2410/gpio.c6
-rw-r--r--arch/arm/mach-s3c2410/h1940-bluetooth.c26
-rw-r--r--arch/arm/mach-s3c2410/include/mach/dma.h265
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-core.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-fns.h103
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-nrs.h70
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/hardware.h95
-rw-r--r--arch/arm/mach-s3c2410/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-gpio.h333
-rw-r--r--arch/arm/mach-s3c2410/include/mach/system-reset.h36
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c10
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c51
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c19
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c11
-rw-r--r--arch/arm/mach-s3c2410/pm.c5
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c32
-rw-r--r--arch/arm/mach-s3c2412/Kconfig3
-rw-r--r--arch/arm/mach-s3c2412/dma.c3
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c43
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c9
-rw-r--r--arch/arm/mach-s3c2440/Kconfig5
-rw-r--r--arch/arm/mach-s3c2440/dma.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-nexcoder.c17
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c9
-rw-r--r--arch/arm/mach-s3c2443/dma.c3
-rw-r--r--arch/arm/mach-s3c6400/Kconfig25
-rw-r--r--arch/arm/mach-s3c6400/Makefile10
-rw-r--r--arch/arm/mach-s3c6400/include/mach/dma.h59
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h6
-rw-r--r--arch/arm/mach-s3c6400/include/mach/regs-clock.h16
-rw-r--r--arch/arm/mach-s3c6400/include/mach/system.h8
-rw-r--r--arch/arm/mach-s3c6400/mach-smdk6400.c96
-rw-r--r--arch/arm/mach-s3c6400/s3c6400.c89
-rw-r--r--arch/arm/mach-s3c6400/setup-sdhci.c63
-rw-r--r--arch/arm/mach-s3c6410/Kconfig37
-rw-r--r--arch/arm/mach-s3c6410/Makefile4
-rw-r--r--arch/arm/mach-s3c6410/cpu.c3
-rw-r--r--arch/arm/mach-s3c6410/mach-anw6410.c245
-rw-r--r--arch/arm/mach-s3c6410/mach-ncp.c107
-rw-r--r--arch/arm/mach-s3c6410/mach-smdk6410.c198
-rw-r--r--arch/arm/mach-s3c6410/setup-sdhci.c34
-rw-r--r--arch/arm/mach-sa1100/collie_pm.c296
-rw-r--r--arch/arm/mach-sa1100/jornada720_ssp.c4
-rw-r--r--arch/arm/mach-stmp378x/Makefile2
-rw-r--r--arch/arm/mach-stmp378x/Makefile.boot3
-rw-r--r--arch/arm/mach-stmp378x/include/mach/entry-macro.S35
-rw-r--r--arch/arm/mach-stmp378x/include/mach/irqs.h95
-rw-r--r--arch/arm/mach-stmp378x/include/mach/pins.h151
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-apbh.h101
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-apbx.h119
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-audioin.h63
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-audioout.h104
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-bch.h56
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h88
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-dcp.h87
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-digctl.h38
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-dram.h27
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-dri.h45
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ecc8.h39
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-emi.h25
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-gpmi.h78
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-i2c.h55
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-icoll.h45
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ir.h (renamed from arch/arm/mach-imx/include/mach/timex.h)17
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-lcdif.h195
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-lradc.h99
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ocotp.h40
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h90
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-power.h63
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-pwm.h53
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-pxp.h140
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-rtc.h59
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-saif.h (renamed from arch/arm/mach-imx/include/mach/vmalloc.h)9
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-spdif.h49
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ssp.h102
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-sydma.h23
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-timrot.h68
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-tvenc.h67
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-uartapp.h87
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h268
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h40
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-usbphy.h37
-rw-r--r--arch/arm/mach-stmp378x/stmp378x.c299
-rw-r--r--arch/arm/mach-stmp378x/stmp378x.h25
-rw-r--r--arch/arm/mach-stmp378x/stmp378x_devb.c334
-rw-r--r--arch/arm/mach-stmp37xx/Makefile2
-rw-r--r--arch/arm/mach-stmp37xx/Makefile.boot3
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/entry-macro.S37
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/irqs.h99
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/pins.h147
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-apbh.h97
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-apbx.h113
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-audioin.h61
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-audioout.h111
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h72
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-digctl.h24
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h37
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h63
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-i2c.h55
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-icoll.h43
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h89
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-lradc.h97
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h88
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-power.h56
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-pwm.h51
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-rtc.h57
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-ssp.h101
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-timrot.h49
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h85
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h268
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h (renamed from arch/arm/mach-imx/include/mach/io.h)18
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h (renamed from arch/arm/mach-imx/include/mach/memory.h)16
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h37
-rw-r--r--arch/arm/mach-stmp37xx/stmp37xx.c219
-rw-r--r--arch/arm/mach-stmp37xx/stmp37xx.h24
-rw-r--r--arch/arm/mach-stmp37xx/stmp37xx_devb.c101
-rw-r--r--arch/arm/mach-u300/Kconfig105
-rw-r--r--arch/arm/mach-u300/Makefile11
-rw-r--r--arch/arm/mach-u300/Makefile.boot15
-rw-r--r--arch/arm/mach-u300/clock.c1487
-rw-r--r--arch/arm/mach-u300/clock.h53
-rw-r--r--arch/arm/mach-u300/core.c649
-rw-r--r--arch/arm/mach-u300/gpio.c703
-rw-r--r--arch/arm/mach-u300/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-u300/include/mach/debug-macro.S22
-rw-r--r--arch/arm/mach-u300/include/mach/entry-macro.S40
-rw-r--r--arch/arm/mach-u300/include/mach/gpio.h290
-rw-r--r--arch/arm/mach-u300/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-u300/include/mach/io.h20
-rw-r--r--arch/arm/mach-u300/include/mach/irqs.h114
-rw-r--r--arch/arm/mach-u300/include/mach/memory.h42
-rw-r--r--arch/arm/mach-u300/include/mach/platform.h19
-rw-r--r--arch/arm/mach-u300/include/mach/syscon.h644
-rw-r--r--arch/arm/mach-u300/include/mach/system.h42
-rw-r--r--arch/arm/mach-u300/include/mach/timex.h17
-rw-r--r--arch/arm/mach-u300/include/mach/u300-regs.h187
-rw-r--r--arch/arm/mach-u300/include/mach/uncompress.h (renamed from arch/arm/mach-imx/include/mach/system.h)38
-rw-r--r--arch/arm/mach-u300/include/mach/vmalloc.h12
-rw-r--r--arch/arm/mach-u300/mmc.c216
-rw-r--r--arch/arm/mach-u300/mmc.h18
-rw-r--r--arch/arm/mach-u300/padmux.c58
-rw-r--r--arch/arm/mach-u300/padmux.h19
-rw-r--r--arch/arm/mach-u300/timer.c422
-rw-r--r--arch/arm/mach-u300/u300.c55
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mach-w90x900/Makefile2
-rw-r--r--arch/arm/mach-w90x900/clock.c77
-rw-r--r--arch/arm/mach-w90x900/clock.h36
-rw-r--r--arch/arm/mach-w90x900/cpu.h2
-rw-r--r--arch/arm/mach-w90x900/gpio.c154
-rw-r--r--arch/arm/mach-w90x900/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-w90x900/include/mach/gpio.h34
-rw-r--r--arch/arm/mach-w90x900/include/mach/irqs.h49
-rw-r--r--arch/arm/mach-w90x900/include/mach/map.h101
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-clock.h31
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-usb.h35
-rw-r--r--arch/arm/mach-w90x900/mach-w90p910evb.c164
-rw-r--r--arch/arm/mach-w90x900/mfp-w90p910.c116
-rw-r--r--arch/arm/mach-w90x900/w90p910.c53
-rw-r--r--arch/arm/mm/Kconfig23
-rw-r--r--arch/arm/mm/abort-ev6.S3
-rw-r--r--arch/arm/mm/ioremap.c6
-rw-r--r--arch/arm/mm/mmu.c15
-rw-r--r--arch/arm/mm/proc-v6.S3
-rw-r--r--arch/arm/mm/proc-v7.S59
-rw-r--r--arch/arm/mm/tlb-v7.S17
-rw-r--r--arch/arm/oprofile/op_model_mpcore.c1
-rw-r--r--arch/arm/plat-mxc/Kconfig7
-rw-r--r--arch/arm/plat-mxc/Makefile1
-rw-r--r--arch/arm/plat-mxc/gpio.c49
-rw-r--r--arch/arm/plat-mxc/include/mach/board-armadillo5x0.h22
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx21ads.h58
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27lite.h19
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27pdk.h19
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lilly.h46
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lite.h22
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31moboard.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31pdk.h47
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx35pdk.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/board-pcm037.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-pcm038.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-pcm043.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/board-qong.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S18
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h1
-rw-r--r--arch/arm/plat-mxc/include/mach/imx-uart.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/imxfb.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h36
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx35.h1267
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h121
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc_timer.h158
-rw-r--r--arch/arm/plat-mxc/include/mach/usb.h2
-rw-r--r--arch/arm/plat-mxc/iomux-v3.c98
-rw-r--r--arch/arm/plat-mxc/irq.c79
-rw-r--r--arch/arm/plat-mxc/pwm.c144
-rw-r--r--arch/arm/plat-mxc/time.c155
-rw-r--r--arch/arm/plat-omap/Kconfig19
-rw-r--r--arch/arm/plat-omap/Makefile1
-rw-r--r--arch/arm/plat-omap/clock.c37
-rw-r--r--arch/arm/plat-omap/common.c114
-rw-r--r--arch/arm/plat-omap/devices.c2
-rw-r--r--arch/arm/plat-omap/dma.c102
-rw-r--r--arch/arm/plat-omap/dmtimer.c73
-rw-r--r--arch/arm/plat-omap/gpio.c134
-rw-r--r--arch/arm/plat-omap/i2c.c2
-rw-r--r--arch/arm/plat-omap/include/mach/clock.h10
-rw-r--r--arch/arm/plat-omap/include/mach/common.h3
-rw-r--r--arch/arm/plat-omap/include/mach/control.h20
-rw-r--r--arch/arm/plat-omap/include/mach/cpu.h21
-rw-r--r--arch/arm/plat-omap/include/mach/debug-macro.S2
-rw-r--r--arch/arm/plat-omap/include/mach/dma.h4
-rw-r--r--arch/arm/plat-omap/include/mach/entry-macro.S83
-rw-r--r--arch/arm/plat-omap/include/mach/gpmc-smc91x.h42
-rw-r--r--arch/arm/plat-omap/include/mach/hardware.h1
-rw-r--r--arch/arm/plat-omap/include/mach/hwa742.h4
-rw-r--r--arch/arm/plat-omap/include/mach/io.h37
-rw-r--r--arch/arm/plat-omap/include/mach/iommu.h168
-rw-r--r--arch/arm/plat-omap/include/mach/iommu2.h96
-rw-r--r--arch/arm/plat-omap/include/mach/iovmm.h94
-rw-r--r--arch/arm/plat-omap/include/mach/irqs.h92
-rw-r--r--arch/arm/plat-omap/include/mach/keypad.h4
-rw-r--r--arch/arm/plat-omap/include/mach/memory.h3
-rw-r--r--arch/arm/plat-omap/include/mach/omap24xx.h18
-rw-r--r--arch/arm/plat-omap/include/mach/omap34xx.h13
-rw-r--r--arch/arm/plat-omap/include/mach/omap44xx.h46
-rw-r--r--arch/arm/plat-omap/include/mach/onenand.h22
-rw-r--r--arch/arm/plat-omap/include/mach/serial.h25
-rw-r--r--arch/arm/plat-omap/include/mach/smp.h51
-rw-r--r--arch/arm/plat-omap/include/mach/sram.h6
-rw-r--r--arch/arm/plat-omap/include/mach/usb.h6
-rw-r--r--arch/arm/plat-omap/include/mach/vmalloc.h2
-rw-r--r--arch/arm/plat-omap/io.c29
-rw-r--r--arch/arm/plat-omap/iommu.c996
-rw-r--r--arch/arm/plat-omap/iopgtable.h72
-rw-r--r--arch/arm/plat-omap/iovmm.c896
-rw-r--r--arch/arm/plat-omap/mcbsp.c30
-rw-r--r--arch/arm/plat-omap/mux.c3
-rw-r--r--arch/arm/plat-omap/sram.c66
-rw-r--r--arch/arm/plat-orion/gpio.c194
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h17
-rw-r--r--arch/arm/plat-orion/include/plat/orion_wdt.h (renamed from arch/arm/plat-orion/include/plat/orion5x_wdt.h)8
-rw-r--r--arch/arm/plat-orion/time.c59
-rw-r--r--arch/arm/plat-pxa/Makefile2
-rw-r--r--arch/arm/plat-pxa/include/plat/i2c.h (renamed from arch/arm/mach-pxa/include/mach/i2c.h)0
-rw-r--r--arch/arm/plat-pxa/pwm.c (renamed from arch/arm/mach-pxa/pwm.c)119
-rw-r--r--arch/arm/plat-s3c/Kconfig26
-rw-r--r--arch/arm/plat-s3c/Makefile7
-rw-r--r--arch/arm/plat-s3c/dev-usb-hsotg.c41
-rw-r--r--arch/arm/plat-s3c/dev-usb.c50
-rw-r--r--arch/arm/plat-s3c/dma.c86
-rw-r--r--arch/arm/plat-s3c/gpio.c11
-rw-r--r--arch/arm/plat-s3c/include/plat/adc.h10
-rw-r--r--arch/arm/plat-s3c/include/plat/clock.h1
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu.h3
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h1
-rw-r--r--arch/arm/plat-s3c/include/plat/dma-core.h22
-rw-r--r--arch/arm/plat-s3c/include/plat/dma.h127
-rw-r--r--arch/arm/plat-s3c/include/plat/gpio-core.h30
-rw-r--r--arch/arm/plat-s3c/include/plat/pm.h15
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-serial.h5
-rw-r--r--arch/arm/plat-s3c/include/plat/sdhci.h50
-rw-r--r--arch/arm/plat-s3c/include/plat/udc-hs.h29
-rw-r--r--arch/arm/plat-s3c/include/plat/watchdog-reset.h49
-rw-r--r--arch/arm/plat-s3c/pm-gpio.c380
-rw-r--r--arch/arm/plat-s3c/pm.c19
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig1
-rw-r--r--arch/arm/plat-s3c24xx/adc.c11
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c25
-rw-r--r--arch/arm/plat-s3c24xx/devs.c30
-rw-r--r--arch/arm/plat-s3c24xx/dma.c151
-rw-r--r--arch/arm/plat-s3c24xx/gpio.c34
-rw-r--r--arch/arm/plat-s3c24xx/gpiolib.c50
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/dma-plat.h (renamed from arch/arm/plat-s3c24xx/include/plat/dma.h)12
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/map.h1
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/pm-core.h5
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/regs-dma.h145
-rw-r--r--arch/arm/plat-s3c24xx/pm.c222
-rw-r--r--arch/arm/plat-s3c24xx/setup-i2c.c5
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c20
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c20
-rw-r--r--arch/arm/plat-s3c64xx/Kconfig10
-rw-r--r--arch/arm/plat-s3c64xx/Makefile11
-rw-r--r--arch/arm/plat-s3c64xx/clock.c19
-rw-r--r--arch/arm/plat-s3c64xx/cpu.c32
-rw-r--r--arch/arm/plat-s3c64xx/dma.c722
-rw-r--r--arch/arm/plat-s3c64xx/gpiolib.c10
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/dma-plat.h70
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/irqs.h1
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/pm-core.h98
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-clock.h1
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/s3c6400.h3
-rw-r--r--arch/arm/plat-s3c64xx/irq-eint.c3
-rw-r--r--arch/arm/plat-s3c64xx/irq-pm.c111
-rw-r--r--arch/arm/plat-s3c64xx/irq.c9
-rw-r--r--arch/arm/plat-s3c64xx/pm.c175
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-clock.c106
-rw-r--r--arch/arm/plat-s3c64xx/setup-sdhci-gpio.c55
-rw-r--r--arch/arm/plat-s3c64xx/sleep.S144
-rw-r--r--arch/arm/plat-stmp3xxx/Kconfig37
-rw-r--r--arch/arm/plat-stmp3xxx/Makefile5
-rw-r--r--arch/arm/plat-stmp3xxx/clock.c1135
-rw-r--r--arch/arm/plat-stmp3xxx/clock.h61
-rw-r--r--arch/arm/plat-stmp3xxx/core.c128
-rw-r--r--arch/arm/plat-stmp3xxx/devices.c389
-rw-r--r--arch/arm/plat-stmp3xxx/dma.c463
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/clkdev.h18
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/cputype.h33
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/debug-macro.S42
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/dma.h153
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/gpio.h28
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/gpmi.h12
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/hardware.h32
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/io.h25
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/memory.h22
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/mmc.h14
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/pinmux.h157
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/pins.h30
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/platform.h68
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h54
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/system.h49
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/timex.h20
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/uncompress.h53
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/vmalloc.h12
-rw-r--r--arch/arm/plat-stmp3xxx/irq.c51
-rw-r--r--arch/arm/plat-stmp3xxx/pinmux.c552
-rw-r--r--arch/arm/plat-stmp3xxx/timer.c189
-rw-r--r--arch/arm/vfp/vfphw.S4
-rw-r--r--arch/arm/vfp/vfpmodule.c2
-rw-r--r--arch/avr32/boards/atngw100/Kconfig27
-rw-r--r--arch/avr32/boards/atngw100/Kconfig_mrmt80
-rw-r--r--arch/avr32/boards/atngw100/Makefile1
-rw-r--r--arch/avr32/boards/atngw100/mrmt.c373
-rw-r--r--arch/avr32/boards/atngw100/setup.c5
-rw-r--r--arch/avr32/boards/merisc/setup.c7
-rw-r--r--arch/avr32/boards/mimc200/setup.c29
-rw-r--r--arch/avr32/configs/atngw100_mrmt_defconfig1363
-rw-r--r--arch/avr32/include/asm/atomic.h2
-rw-r--r--arch/avr32/include/asm/bitsperlong.h1
-rw-r--r--arch/avr32/include/asm/hw_irq.h2
-rw-r--r--arch/avr32/include/asm/mman.h2
-rw-r--r--arch/avr32/include/asm/signal.h2
-rw-r--r--arch/avr32/include/asm/termios.h2
-rw-r--r--arch/avr32/kernel/module.c2
-rw-r--r--arch/avr32/kernel/traps.c11
-rw-r--r--arch/avr32/mach-at32ap/include/mach/board.h2
-rw-r--r--arch/blackfin/Kconfig86
-rw-r--r--arch/blackfin/Kconfig.debug13
-rw-r--r--arch/blackfin/configs/BF518F-EZBRD_defconfig101
-rw-r--r--arch/blackfin/configs/BF526-EZBRD_defconfig219
-rw-r--r--arch/blackfin/configs/BF527-EZKIT_defconfig211
-rw-r--r--arch/blackfin/configs/BF533-EZKIT_defconfig103
-rw-r--r--arch/blackfin/configs/BF533-STAMP_defconfig105
-rw-r--r--arch/blackfin/configs/BF537-STAMP_defconfig109
-rw-r--r--arch/blackfin/configs/BF538-EZKIT_defconfig106
-rw-r--r--arch/blackfin/configs/BF548-EZKIT_defconfig253
-rw-r--r--arch/blackfin/configs/BF561-EZKIT_defconfig116
-rw-r--r--arch/blackfin/configs/BlackStamp_defconfig4
-rw-r--r--arch/blackfin/configs/CM-BF527_defconfig29
-rw-r--r--arch/blackfin/configs/CM-BF533_defconfig12
-rw-r--r--arch/blackfin/configs/CM-BF537E_defconfig499
-rw-r--r--arch/blackfin/configs/CM-BF537U_defconfig12
-rw-r--r--arch/blackfin/configs/CM-BF548_defconfig12
-rw-r--r--arch/blackfin/configs/CM-BF561_defconfig12
-rw-r--r--arch/blackfin/configs/H8606_defconfig8
-rw-r--r--arch/blackfin/configs/IP0X_defconfig8
-rw-r--r--arch/blackfin/configs/PNAV-10_defconfig39
-rw-r--r--arch/blackfin/configs/SRV1_defconfig4
-rw-r--r--arch/blackfin/configs/TCM-BF537_defconfig27
-rw-r--r--arch/blackfin/include/asm/atomic.h2
-rw-r--r--arch/blackfin/include/asm/bitsperlong.h1
-rw-r--r--arch/blackfin/include/asm/cacheflush.h40
-rw-r--r--arch/blackfin/include/asm/cplb.h35
-rw-r--r--arch/blackfin/include/asm/dma.h10
-rw-r--r--arch/blackfin/include/asm/elf.h84
-rw-r--r--arch/blackfin/include/asm/entry.h92
-rw-r--r--arch/blackfin/include/asm/gptimers.h43
-rw-r--r--arch/blackfin/include/asm/io.h29
-rw-r--r--arch/blackfin/include/asm/ipipe.h4
-rw-r--r--arch/blackfin/include/asm/page.h2
-rw-r--r--arch/blackfin/include/asm/pda.h2
-rw-r--r--arch/blackfin/include/asm/processor.h4
-rw-r--r--arch/blackfin/include/asm/signal.h2
-rw-r--r--arch/blackfin/include/asm/time.h1
-rw-r--r--arch/blackfin/include/asm/uaccess.h32
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c86
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c18
-rw-r--r--arch/blackfin/kernel/bfin_ksyms.c1
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cacheinit.c9
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinit.c2
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cacheinit.c9
-rw-r--r--arch/blackfin/kernel/early_printk.c16
-rw-r--r--arch/blackfin/kernel/gptimers.c30
-rw-r--r--arch/blackfin/kernel/ipipe.c9
-rw-r--r--arch/blackfin/kernel/irqchip.c2
-rw-r--r--arch/blackfin/kernel/kgdb.c60
-rw-r--r--arch/blackfin/kernel/module.c22
-rw-r--r--arch/blackfin/kernel/process.c3
-rw-r--r--arch/blackfin/kernel/setup.c79
-rw-r--r--arch/blackfin/kernel/sys_bfin.c5
-rw-r--r--arch/blackfin/kernel/time-ts.c222
-rw-r--r--arch/blackfin/kernel/time.c53
-rw-r--r--arch/blackfin/kernel/traps.c52
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S5
-rw-r--r--arch/blackfin/mach-bf518/Kconfig1
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c19
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h35
-rw-r--r--arch/blackfin/mach-bf518/include/mach/portmux.h6
-rw-r--r--arch/blackfin/mach-bf527/Kconfig1
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c10
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c10
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c28
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h168
-rw-r--r--arch/blackfin/mach-bf533/Kconfig1
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c4
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c4
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c4
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c6
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h88
-rw-r--r--arch/blackfin/mach-bf537/Kconfig1
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537.c4
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c8
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c69
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c4
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h84
-rw-r--r--arch/blackfin/mach-bf538/Kconfig1
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h60
-rw-r--r--arch/blackfin/mach-bf538/include/mach/blackfin.h19
-rw-r--r--arch/blackfin/mach-bf538/include/mach/cdefBF538.h65
-rw-r--r--arch/blackfin/mach-bf538/include/mach/defBF539.h56
-rw-r--r--arch/blackfin/mach-bf548/Kconfig8
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c85
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h44
-rw-r--r--arch/blackfin/mach-bf548/include/mach/portmux.h64
-rw-r--r--arch/blackfin/mach-bf561/Kconfig16
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c4
-rw-r--r--arch/blackfin/mach-bf561/coreb.c396
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h25
-rw-r--r--arch/blackfin/mach-bf561/include/mach/cdefBF561.h29
-rw-r--r--arch/blackfin/mach-bf561/include/mach/defBF561.h56
-rw-r--r--arch/blackfin/mach-bf561/smp.c4
-rw-r--r--arch/blackfin/mach-common/arch_checks.c7
-rw-r--r--arch/blackfin/mach-common/cache.S46
-rw-r--r--arch/blackfin/mach-common/clocks-init.c1
-rw-r--r--arch/blackfin/mach-common/cpufreq.c3
-rw-r--r--arch/blackfin/mach-common/entry.S76
-rw-r--r--arch/blackfin/mach-common/head.S34
-rw-r--r--arch/blackfin/mach-common/interrupt.S27
-rw-r--r--arch/blackfin/mach-common/ints-priority.c50
-rw-r--r--arch/blackfin/mach-common/smp.c12
-rw-r--r--arch/blackfin/mm/blackfin_sram.h1
-rw-r--r--arch/blackfin/mm/init.c33
-rw-r--r--arch/blackfin/mm/isram-driver.c2
-rw-r--r--arch/blackfin/mm/sram-alloc.c21
-rw-r--r--arch/cris/include/asm/atomic.h2
-rw-r--r--arch/cris/include/asm/bitsperlong.h1
-rw-r--r--arch/cris/include/asm/mman.h2
-rw-r--r--arch/cris/include/asm/page.h2
-rw-r--r--arch/cris/include/asm/signal.h2
-rw-r--r--arch/cris/kernel/module.c2
-rw-r--r--arch/frv/include/asm/atomic.h2
-rw-r--r--arch/frv/include/asm/bitsperlong.h1
-rw-r--r--arch/frv/include/asm/mman.h2
-rw-r--r--arch/frv/include/asm/page.h2
-rw-r--r--arch/frv/include/asm/pci.h13
-rw-r--r--arch/frv/include/asm/signal.h123
-rw-r--r--arch/frv/include/asm/termios.h2
-rw-r--r--arch/frv/kernel/module.c2
-rw-r--r--arch/h8300/include/asm/atomic.h2
-rw-r--r--arch/h8300/include/asm/bitsperlong.h1
-rw-r--r--arch/h8300/include/asm/mman.h2
-rw-r--r--arch/h8300/include/asm/page.h2
-rw-r--r--arch/h8300/include/asm/signal.h2
-rw-r--r--arch/h8300/kernel/module.c2
-rw-r--r--arch/ia64/include/asm/atomic.h2
-rw-r--r--arch/ia64/include/asm/bitsperlong.h8
-rw-r--r--arch/ia64/include/asm/mman.h2
-rw-r--r--arch/ia64/include/asm/signal.h2
-rw-r--r--arch/ia64/include/asm/suspend.h1
-rw-r--r--arch/ia64/include/asm/types.h7
-rw-r--r--arch/ia64/mm/extable.c26
-rw-r--r--arch/m32r/include/asm/atomic.h2
-rw-r--r--arch/m32r/include/asm/bitsperlong.h1
-rw-r--r--arch/m32r/include/asm/mman.h2
-rw-r--r--arch/m32r/include/asm/page.h2
-rw-r--r--arch/m32r/include/asm/pci.h2
-rw-r--r--arch/m32r/include/asm/signal.h2
-rw-r--r--arch/m32r/kernel/module.c2
-rw-r--r--arch/m68k/include/asm/atomic_mm.h2
-rw-r--r--arch/m68k/include/asm/atomic_no.h2
-rw-r--r--arch/m68k/include/asm/bitsperlong.h1
-rw-r--r--arch/m68k/include/asm/mman.h2
-rw-r--r--arch/m68k/include/asm/page_mm.h2
-rw-r--r--arch/m68k/include/asm/page_no.h2
-rw-r--r--arch/m68k/include/asm/signal.h2
-rw-r--r--arch/m68k/include/asm/suspend.h6
-rw-r--r--arch/m68k/kernel/module.c2
-rw-r--r--arch/m68knommu/kernel/module.c2
-rw-r--r--arch/microblaze/Kconfig121
-rw-r--r--arch/microblaze/Makefile6
-rw-r--r--arch/microblaze/boot/Makefile2
-rw-r--r--arch/microblaze/configs/mmu_defconfig798
-rw-r--r--arch/microblaze/include/asm/Kbuild25
-rw-r--r--arch/microblaze/include/asm/atomic.h2
-rw-r--r--arch/microblaze/include/asm/bitsperlong.h1
-rw-r--r--arch/microblaze/include/asm/cacheflush.h20
-rw-r--r--arch/microblaze/include/asm/checksum.h14
-rw-r--r--arch/microblaze/include/asm/current.h8
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h130
-rw-r--r--arch/microblaze/include/asm/dma.h5
-rw-r--r--arch/microblaze/include/asm/elf.h93
-rw-r--r--arch/microblaze/include/asm/entry.h37
-rw-r--r--arch/microblaze/include/asm/exceptions.h24
-rw-r--r--arch/microblaze/include/asm/flat.h1
-rw-r--r--arch/microblaze/include/asm/gpio.h6
-rw-r--r--arch/microblaze/include/asm/io.h31
-rw-r--r--arch/microblaze/include/asm/mmu.h104
-rw-r--r--arch/microblaze/include/asm/mmu_context.h26
-rw-r--r--arch/microblaze/include/asm/mmu_context_mm.h140
-rw-r--r--arch/microblaze/include/asm/mmu_context_no.h23
-rw-r--r--arch/microblaze/include/asm/page.h168
-rw-r--r--arch/microblaze/include/asm/pgalloc.h191
-rw-r--r--arch/microblaze/include/asm/pgtable.h538
-rw-r--r--arch/microblaze/include/asm/posix_types.h2
-rw-r--r--arch/microblaze/include/asm/processor.h95
-rw-r--r--arch/microblaze/include/asm/ptrace.h1
-rw-r--r--arch/microblaze/include/asm/registers.h21
-rw-r--r--arch/microblaze/include/asm/sections.h3
-rw-r--r--arch/microblaze/include/asm/segment.h20
-rw-r--r--arch/microblaze/include/asm/setup.h10
-rw-r--r--arch/microblaze/include/asm/signal.h2
-rw-r--r--arch/microblaze/include/asm/stat.h77
-rw-r--r--arch/microblaze/include/asm/string.h2
-rw-r--r--arch/microblaze/include/asm/syscalls.h3
-rw-r--r--arch/microblaze/include/asm/termios.h2
-rw-r--r--arch/microblaze/include/asm/thread_info.h20
-rw-r--r--arch/microblaze/include/asm/tlb.h8
-rw-r--r--arch/microblaze/include/asm/tlbflush.h48
-rw-r--r--arch/microblaze/include/asm/uaccess.h305
-rw-r--r--arch/microblaze/include/asm/unaligned.h3
-rw-r--r--arch/microblaze/kernel/Makefile1
-rw-r--r--arch/microblaze/kernel/asm-offsets.c21
-rw-r--r--arch/microblaze/kernel/early_printk.c3
-rw-r--r--arch/microblaze/kernel/entry-nommu.S2
-rw-r--r--arch/microblaze/kernel/entry.S1116
-rw-r--r--arch/microblaze/kernel/exceptions.c45
-rw-r--r--arch/microblaze/kernel/head.S190
-rw-r--r--arch/microblaze/kernel/hw_exception_handler.S746
-rw-r--r--arch/microblaze/kernel/microblaze_ksyms.c2
-rw-r--r--arch/microblaze/kernel/misc.S120
-rw-r--r--arch/microblaze/kernel/process.c59
-rw-r--r--arch/microblaze/kernel/prom.c7
-rw-r--r--arch/microblaze/kernel/setup.c62
-rw-r--r--arch/microblaze/kernel/signal.c109
-rw-r--r--arch/microblaze/kernel/syscall_table.S6
-rw-r--r--arch/microblaze/kernel/traps.c42
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S5
-rw-r--r--arch/microblaze/lib/Makefile3
-rw-r--r--arch/microblaze/lib/checksum.c31
-rw-r--r--arch/microblaze/lib/memcpy.c5
-rw-r--r--arch/microblaze/lib/uaccess_old.S135
-rw-r--r--arch/microblaze/mm/Makefile2
-rw-r--r--arch/microblaze/mm/fault.c304
-rw-r--r--arch/microblaze/mm/init.c169
-rw-r--r--arch/microblaze/mm/mmu_context.c70
-rw-r--r--arch/microblaze/mm/pgtable.c286
-rw-r--r--arch/mips/include/asm/atomic.h2
-rw-r--r--arch/mips/include/asm/bitsperlong.h8
-rw-r--r--arch/mips/include/asm/page.h2
-rw-r--r--arch/mips/include/asm/signal.h2
-rw-r--r--arch/mips/include/asm/suspend.h6
-rw-r--r--arch/mips/include/asm/types.h3
-rw-r--r--arch/mips/kernel/module.c2
-rw-r--r--arch/mn10300/include/asm/atomic.h2
-rw-r--r--arch/mn10300/include/asm/bitsperlong.h1
-rw-r--r--arch/mn10300/include/asm/mman.h2
-rw-r--r--arch/mn10300/include/asm/ptrace.h5
-rw-r--r--arch/mn10300/include/asm/setup.h3
-rw-r--r--arch/mn10300/include/asm/signal.h2
-rw-r--r--arch/mn10300/kernel/module.c2
-rw-r--r--arch/parisc/include/asm/atomic.h2
-rw-r--r--arch/parisc/include/asm/bitsperlong.h20
-rw-r--r--arch/parisc/include/asm/page.h2
-rw-r--r--arch/parisc/include/asm/types.h8
-rw-r--r--arch/parisc/include/asm/uaccess.h2
-rw-r--r--arch/parisc/kernel/module.c2
-rw-r--r--arch/powerpc/include/asm/atomic.h2
-rw-r--r--arch/powerpc/include/asm/bitsperlong.h12
-rw-r--r--arch/powerpc/include/asm/mman.h2
-rw-r--r--arch/powerpc/include/asm/mpc52xx_psc.h11
-rw-r--r--arch/powerpc/include/asm/page_32.h2
-rw-r--r--arch/powerpc/include/asm/page_64.h2
-rw-r--r--arch/powerpc/include/asm/signal.h2
-rw-r--r--arch/powerpc/include/asm/termios.h2
-rw-r--r--arch/powerpc/include/asm/types.h9
-rw-r--r--arch/powerpc/kernel/module.c2
-rw-r--r--arch/powerpc/kernel/power7-pmu.c12
-rw-r--r--arch/powerpc/mm/slb.c2
-rw-r--r--arch/s390/Kconfig23
-rw-r--r--arch/s390/include/asm/atomic.h2
-rw-r--r--arch/s390/include/asm/bitsperlong.h13
-rw-r--r--arch/s390/include/asm/compat.h19
-rw-r--r--arch/s390/include/asm/cpu.h32
-rw-r--r--arch/s390/include/asm/cputime.h19
-rw-r--r--arch/s390/include/asm/ftrace.h21
-rw-r--r--arch/s390/include/asm/lowcore.h9
-rw-r--r--arch/s390/include/asm/mman.h2
-rw-r--r--arch/s390/include/asm/page.h2
-rw-r--r--arch/s390/include/asm/pgtable.h7
-rw-r--r--arch/s390/include/asm/seccomp.h16
-rw-r--r--arch/s390/include/asm/signal.h2
-rw-r--r--arch/s390/include/asm/spinlock.h19
-rw-r--r--arch/s390/include/asm/suspend.h5
-rw-r--r--arch/s390/include/asm/syscall.h1
-rw-r--r--arch/s390/include/asm/termios.h2
-rw-r--r--arch/s390/include/asm/thread_info.h12
-rw-r--r--arch/s390/include/asm/types.h6
-rw-r--r--arch/s390/include/asm/uaccess.h16
-rw-r--r--arch/s390/include/asm/unistd.h4
-rw-r--r--arch/s390/kernel/Makefile7
-rw-r--r--arch/s390/kernel/compat_wrapper.S17
-rw-r--r--arch/s390/kernel/early.c4
-rw-r--r--arch/s390/kernel/entry.S7
-rw-r--r--arch/s390/kernel/entry64.S7
-rw-r--r--arch/s390/kernel/ftrace.c260
-rw-r--r--arch/s390/kernel/head.S67
-rw-r--r--arch/s390/kernel/kprobes.c31
-rw-r--r--arch/s390/kernel/mcount.S212
-rw-r--r--arch/s390/kernel/module.c2
-rw-r--r--arch/s390/kernel/nmi.c2
-rw-r--r--arch/s390/kernel/process.c3
-rw-r--r--arch/s390/kernel/ptrace.c23
-rw-r--r--arch/s390/kernel/s390_ext.c5
-rw-r--r--arch/s390/kernel/sclp.S327
-rw-r--r--arch/s390/kernel/setup.c2
-rw-r--r--arch/s390/kernel/signal.c3
-rw-r--r--arch/s390/kernel/smp.c3
-rw-r--r--arch/s390/kernel/syscalls.S2
-rw-r--r--arch/s390/kernel/time.c9
-rw-r--r--arch/s390/kernel/vdso.c19
-rw-r--r--arch/s390/kernel/vmlinux.lds.S1
-rw-r--r--arch/s390/kernel/vtime.c2
-rw-r--r--arch/s390/kvm/kvm-s390.c2
-rw-r--r--arch/s390/lib/spinlock.c40
-rw-r--r--arch/s390/mm/Makefile2
-rw-r--r--arch/s390/mm/fault.c3
-rw-r--r--arch/s390/mm/maccess.c61
-rw-r--r--arch/s390/mm/mmap.c11
-rw-r--r--arch/s390/mm/pgtable.c16
-rw-r--r--arch/sh/include/asm/atomic.h2
-rw-r--r--arch/sh/include/asm/bitsperlong.h1
-rw-r--r--arch/sh/include/asm/mman.h2
-rw-r--r--arch/sh/include/asm/page.h2
-rw-r--r--arch/sh/include/asm/signal.h2
-rw-r--r--arch/sh/kernel/module.c2
-rw-r--r--arch/sparc/include/asm/atomic_32.h2
-rw-r--r--arch/sparc/include/asm/atomic_64.h2
-rw-r--r--arch/sparc/include/asm/bitsperlong.h13
-rw-r--r--arch/sparc/include/asm/mman.h2
-rw-r--r--arch/sparc/include/asm/page_32.h2
-rw-r--r--arch/sparc/include/asm/page_64.h2
-rw-r--r--arch/sparc/include/asm/signal.h2
-rw-r--r--arch/sparc/include/asm/types.h4
-rw-r--r--arch/sparc/include/asm/uaccess_32.h3
-rw-r--r--arch/sparc/include/asm/uaccess_64.h2
-rw-r--r--arch/sparc/kernel/module.c2
-rw-r--r--arch/sparc/mm/extable.c29
-rw-r--r--arch/um/include/asm/page.h2
-rw-r--r--arch/um/include/asm/pgtable.h7
-rw-r--r--arch/um/include/asm/suspend.h4
-rw-r--r--arch/um/sys-i386/Makefile2
-rw-r--r--arch/um/sys-x86_64/Makefile4
-rw-r--r--arch/um/sys-x86_64/um_module.c21
-rw-r--r--arch/x86/Kconfig45
-rw-r--r--arch/x86/crypto/Makefile2
-rw-r--r--arch/x86/crypto/aesni-intel_glue.c267
-rw-r--r--arch/x86/crypto/fpu.c166
-rw-r--r--arch/x86/include/asm/atomic_32.h2
-rw-r--r--arch/x86/include/asm/atomic_64.h2
-rw-r--r--arch/x86/include/asm/bitsperlong.h13
-rw-r--r--arch/x86/include/asm/entry_arch.h11
-rw-r--r--arch/x86/include/asm/hardirq.h2
-rw-r--r--arch/x86/include/asm/hw_irq.h2
-rw-r--r--arch/x86/include/asm/irq_vectors.h17
-rw-r--r--arch/x86/include/asm/lguest.h7
-rw-r--r--arch/x86/include/asm/lguest_hcall.h15
-rw-r--r--arch/x86/include/asm/mce.h88
-rw-r--r--arch/x86/include/asm/mman.h2
-rw-r--r--arch/x86/include/asm/msr-index.h7
-rw-r--r--arch/x86/include/asm/page.h2
-rw-r--r--arch/x86/include/asm/pgtable_32_types.h4
-rw-r--r--arch/x86/include/asm/signal.h2
-rw-r--r--arch/x86/include/asm/tlbflush.h2
-rw-r--r--arch/x86/include/asm/types.h6
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/acpi/sleep.c2
-rw-r--r--arch/x86/kernel/apic/apic.c4
-rw-r--r--arch/x86/kernel/apic/nmi.c2
-rw-r--r--arch/x86/kernel/apm_32.c14
-rw-r--r--arch/x86/kernel/asm-offsets_32.c1
-rw-r--r--arch/x86/kernel/cpu/mcheck/Makefile10
-rw-r--r--arch/x86/kernel/cpu/mcheck/k7.c42
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-inject.c127
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h15
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-severity.c218
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c1964
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.h26
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_32.c76
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_64.c1188
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd_64.c203
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel.c74
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel_64.c65
-rw-r--r--arch/x86/kernel/cpu/mcheck/non-fatal.c57
-rw-r--r--arch/x86/kernel/cpu/mcheck/p4.c86
-rw-r--r--arch/x86/kernel/cpu/mcheck/p5.c48
-rw-r--r--arch/x86/kernel/cpu/mcheck/p6.c26
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c73
-rw-r--r--arch/x86/kernel/cpu/mcheck/threshold.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/winchip.c17
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c7
-rw-r--r--arch/x86/kernel/entry_64.S11
-rw-r--r--arch/x86/kernel/irq.c19
-rw-r--r--arch/x86/kernel/irqinit.c3
-rw-r--r--arch/x86/kernel/module.c (renamed from arch/x86/kernel/module_64.c)82
-rw-r--r--arch/x86/kernel/module_32.c152
-rw-r--r--arch/x86/kernel/setup.c15
-rw-r--r--arch/x86/kernel/signal.c6
-rw-r--r--arch/x86/kernel/smp.c28
-rw-r--r--arch/x86/kernel/smpboot.c2
-rw-r--r--arch/x86/kernel/traps.c6
-rw-r--r--arch/x86/kernel/vmlinux.lds.S2
-rw-r--r--arch/x86/lguest/Kconfig1
-rw-r--r--arch/x86/lguest/boot.c158
-rw-r--r--arch/x86/lguest/i386_head.S60
-rw-r--r--arch/x86/mm/init_32.c10
-rw-r--r--arch/x86/power/Makefile2
-rw-r--r--arch/x86/power/cpu.c (renamed from arch/x86/power/cpu_64.c)165
-rw-r--r--arch/x86/power/cpu_32.c148
-rw-r--r--arch/xtensa/include/asm/atomic.h2
-rw-r--r--arch/xtensa/include/asm/bitsperlong.h1
-rw-r--r--arch/xtensa/include/asm/page.h2
-rw-r--r--arch/xtensa/kernel/module.c2
1120 files changed, 71300 insertions, 16484 deletions
diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
index 62b363584b2b..610dff44d94b 100644
--- a/arch/alpha/include/asm/atomic.h
+++ b/arch/alpha/include/asm/atomic.h
@@ -256,5 +256,5 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
256#define smp_mb__before_atomic_inc() smp_mb() 256#define smp_mb__before_atomic_inc() smp_mb()
257#define smp_mb__after_atomic_inc() smp_mb() 257#define smp_mb__after_atomic_inc() smp_mb()
258 258
259#include <asm-generic/atomic.h> 259#include <asm-generic/atomic-long.h>
260#endif /* _ALPHA_ATOMIC_H */ 260#endif /* _ALPHA_ATOMIC_H */
diff --git a/arch/alpha/include/asm/bitsperlong.h b/arch/alpha/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..ad57f7868203
--- /dev/null
+++ b/arch/alpha/include/asm/bitsperlong.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_ALPHA_BITSPERLONG_H
2#define __ASM_ALPHA_BITSPERLONG_H
3
4#define __BITS_PER_LONG 64
5
6#include <asm-generic/bitsperlong.h>
7
8#endif /* __ASM_ALPHA_BITSPERLONG_H */
diff --git a/arch/alpha/include/asm/page.h b/arch/alpha/include/asm/page.h
index 0995f9d13417..07af062544fb 100644
--- a/arch/alpha/include/asm/page.h
+++ b/arch/alpha/include/asm/page.h
@@ -93,6 +93,6 @@ typedef struct page *pgtable_t;
93 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 93 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
94 94
95#include <asm-generic/memory_model.h> 95#include <asm-generic/memory_model.h>
96#include <asm-generic/page.h> 96#include <asm-generic/getorder.h>
97 97
98#endif /* _ALPHA_PAGE_H */ 98#endif /* _ALPHA_PAGE_H */
diff --git a/arch/alpha/include/asm/signal.h b/arch/alpha/include/asm/signal.h
index 13c2305d35ef..a9388300abb1 100644
--- a/arch/alpha/include/asm/signal.h
+++ b/arch/alpha/include/asm/signal.h
@@ -111,7 +111,7 @@ typedef unsigned long sigset_t;
111#define SIG_UNBLOCK 2 /* for unblocking signals */ 111#define SIG_UNBLOCK 2 /* for unblocking signals */
112#define SIG_SETMASK 3 /* for setting the signal mask */ 112#define SIG_SETMASK 3 /* for setting the signal mask */
113 113
114#include <asm-generic/signal.h> 114#include <asm-generic/signal-defs.h>
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117struct osf_sigaction { 117struct osf_sigaction {
diff --git a/arch/alpha/include/asm/suspend.h b/arch/alpha/include/asm/suspend.h
deleted file mode 100644
index c7042d575851..000000000000
--- a/arch/alpha/include/asm/suspend.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ALPHA_SUSPEND_H
2#define __ALPHA_SUSPEND_H
3
4/* Dummy include. */
5
6#endif /* __ALPHA_SUSPEND_H */
diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h
index f072f344497e..bd621ecd1eb3 100644
--- a/arch/alpha/include/asm/types.h
+++ b/arch/alpha/include/asm/types.h
@@ -25,9 +25,6 @@ typedef unsigned int umode_t;
25 * These aren't exported outside the kernel to avoid name space clashes 25 * These aren't exported outside the kernel to avoid name space clashes
26 */ 26 */
27#ifdef __KERNEL__ 27#ifdef __KERNEL__
28
29#define BITS_PER_LONG 64
30
31#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
32 29
33typedef u64 dma_addr_t; 30typedef u64 dma_addr_t;
diff --git a/arch/alpha/mm/extable.c b/arch/alpha/mm/extable.c
index 62dc379d301a..813c9b63c0e1 100644
--- a/arch/alpha/mm/extable.c
+++ b/arch/alpha/mm/extable.c
@@ -48,6 +48,27 @@ void sort_extable(struct exception_table_entry *start,
48 cmp_ex, swap_ex); 48 cmp_ex, swap_ex);
49} 49}
50 50
51#ifdef CONFIG_MODULES
52/*
53 * Any entry referring to the module init will be at the beginning or
54 * the end.
55 */
56void trim_init_extable(struct module *m)
57{
58 /*trim the beginning*/
59 while (m->num_exentries &&
60 within_module_init(ex_to_addr(&m->extable[0]), m)) {
61 m->extable++;
62 m->num_exentries--;
63 }
64 /*trim the end*/
65 while (m->num_exentries &&
66 within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]),
67 m))
68 m->num_exentries--;
69}
70#endif /* CONFIG_MODULES */
71
51const struct exception_table_entry * 72const struct exception_table_entry *
52search_extable(const struct exception_table_entry *first, 73search_extable(const struct exception_table_entry *first,
53 const struct exception_table_entry *last, 74 const struct exception_table_entry *last,
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9d02cdb15b23..29475101a7b3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -34,15 +34,12 @@ config SYS_SUPPORTS_APM_EMULATION
34 34
35config GENERIC_GPIO 35config GENERIC_GPIO
36 bool 36 bool
37 default n
38 37
39config GENERIC_TIME 38config GENERIC_TIME
40 bool 39 bool
41 default n
42 40
43config GENERIC_CLOCKEVENTS 41config GENERIC_CLOCKEVENTS
44 bool 42 bool
45 default n
46 43
47config GENERIC_CLOCKEVENTS_BROADCAST 44config GENERIC_CLOCKEVENTS_BROADCAST
48 bool 45 bool
@@ -55,7 +52,6 @@ config MMU
55 52
56config NO_IOPORT 53config NO_IOPORT
57 bool 54 bool
58 default n
59 55
60config EISA 56config EISA
61 bool 57 bool
@@ -126,11 +122,9 @@ config RWSEM_XCHGADD_ALGORITHM
126 122
127config ARCH_HAS_ILOG2_U32 123config ARCH_HAS_ILOG2_U32
128 bool 124 bool
129 default n
130 125
131config ARCH_HAS_ILOG2_U64 126config ARCH_HAS_ILOG2_U64
132 bool 127 bool
133 default n
134 128
135config GENERIC_HWEIGHT 129config GENERIC_HWEIGHT
136 bool 130 bool
@@ -253,6 +247,14 @@ config ARCH_CLPS711X
253 help 247 help
254 Support for Cirrus Logic 711x/721x based boards. 248 Support for Cirrus Logic 711x/721x based boards.
255 249
250config ARCH_GEMINI
251 bool "Cortina Systems Gemini"
252 select CPU_FA526
253 select GENERIC_GPIO
254 select ARCH_REQUIRE_GPIOLIB
255 help
256 Support for the Cortina Systems Gemini family SoCs
257
256config ARCH_EBSA110 258config ARCH_EBSA110
257 bool "EBSA-110" 259 bool "EBSA-110"
258 select CPU_SA110 260 select CPU_SA110
@@ -277,14 +279,6 @@ config ARCH_EP93XX
277 help 279 help
278 This enables support for the Cirrus EP93xx series of CPUs. 280 This enables support for the Cirrus EP93xx series of CPUs.
279 281
280config ARCH_GEMINI
281 bool "Cortina Systems Gemini"
282 select CPU_FA526
283 select GENERIC_GPIO
284 select ARCH_REQUIRE_GPIOLIB
285 help
286 Support for the Cortina Systems Gemini family SoCs
287
288config ARCH_FOOTBRIDGE 282config ARCH_FOOTBRIDGE
289 bool "FootBridge" 283 bool "FootBridge"
290 select CPU_SA110 284 select CPU_SA110
@@ -293,6 +287,30 @@ config ARCH_FOOTBRIDGE
293 Support for systems based on the DC21285 companion chip 287 Support for systems based on the DC21285 companion chip
294 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 288 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
295 289
290config ARCH_MXC
291 bool "Freescale MXC/iMX-based"
292 select GENERIC_TIME
293 select GENERIC_CLOCKEVENTS
294 select ARCH_MTD_XIP
295 select GENERIC_GPIO
296 select ARCH_REQUIRE_GPIOLIB
297 select HAVE_CLK
298 help
299 Support for Freescale MXC/iMX-based family of processors
300
301config ARCH_STMP3XXX
302 bool "Freescale STMP3xxx"
303 select CPU_ARM926T
304 select HAVE_CLK
305 select COMMON_CLKDEV
306 select ARCH_REQUIRE_GPIOLIB
307 select GENERIC_TIME
308 select GENERIC_CLOCKEVENTS
309 select GENERIC_GPIO
310 select USB_ARCH_HAS_EHCI
311 help
312 Support for systems based on the Freescale 3xxx CPUs.
313
296config ARCH_NETX 314config ARCH_NETX
297 bool "Hilscher NetX based" 315 bool "Hilscher NetX based"
298 select CPU_ARM926T 316 select CPU_ARM926T
@@ -309,15 +327,6 @@ config ARCH_H720X
309 help 327 help
310 This enables support for systems based on the Hynix HMS720x 328 This enables support for systems based on the Hynix HMS720x
311 329
312config ARCH_IMX
313 bool "IMX"
314 select CPU_ARM920T
315 select GENERIC_GPIO
316 select GENERIC_TIME
317 select GENERIC_CLOCKEVENTS
318 help
319 Support for Motorola's i.MX family of processors (MX1, MXL).
320
321config ARCH_IOP13XX 330config ARCH_IOP13XX
322 bool "IOP13xx-based" 331 bool "IOP13xx-based"
323 depends on MMU 332 depends on MMU
@@ -398,6 +407,7 @@ config ARCH_KIRKWOOD
398 select CPU_FEROCEON 407 select CPU_FEROCEON
399 select PCI 408 select PCI
400 select GENERIC_GPIO 409 select GENERIC_GPIO
410 select ARCH_REQUIRE_GPIOLIB
401 select GENERIC_TIME 411 select GENERIC_TIME
402 select GENERIC_CLOCKEVENTS 412 select GENERIC_CLOCKEVENTS
403 select PLAT_ORION 413 select PLAT_ORION
@@ -405,28 +415,6 @@ config ARCH_KIRKWOOD
405 Support for the following Marvell Kirkwood series SoCs: 415 Support for the following Marvell Kirkwood series SoCs:
406 88F6180, 88F6192 and 88F6281. 416 88F6180, 88F6192 and 88F6281.
407 417
408config ARCH_KS8695
409 bool "Micrel/Kendin KS8695"
410 select CPU_ARM922T
411 select GENERIC_GPIO
412 select ARCH_REQUIRE_GPIOLIB
413 help
414 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
415 System-on-Chip devices.
416
417config ARCH_NS9XXX
418 bool "NetSilicon NS9xxx"
419 select CPU_ARM926T
420 select GENERIC_GPIO
421 select GENERIC_TIME
422 select GENERIC_CLOCKEVENTS
423 select HAVE_CLK
424 help
425 Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
426 System.
427
428 <http://www.digi.com/products/microprocessors/index.jsp>
429
430config ARCH_LOKI 418config ARCH_LOKI
431 bool "Marvell Loki (88RC8480)" 419 bool "Marvell Loki (88RC8480)"
432 select CPU_FEROCEON 420 select CPU_FEROCEON
@@ -441,6 +429,7 @@ config ARCH_MV78XX0
441 select CPU_FEROCEON 429 select CPU_FEROCEON
442 select PCI 430 select PCI
443 select GENERIC_GPIO 431 select GENERIC_GPIO
432 select ARCH_REQUIRE_GPIOLIB
444 select GENERIC_TIME 433 select GENERIC_TIME
445 select GENERIC_CLOCKEVENTS 434 select GENERIC_CLOCKEVENTS
446 select PLAT_ORION 435 select PLAT_ORION
@@ -448,23 +437,13 @@ config ARCH_MV78XX0
448 Support for the following Marvell MV78xx0 series SoCs: 437 Support for the following Marvell MV78xx0 series SoCs:
449 MV781x0, MV782x0. 438 MV781x0, MV782x0.
450 439
451config ARCH_MXC
452 bool "Freescale MXC/iMX-based"
453 select GENERIC_TIME
454 select GENERIC_CLOCKEVENTS
455 select ARCH_MTD_XIP
456 select GENERIC_GPIO
457 select ARCH_REQUIRE_GPIOLIB
458 select HAVE_CLK
459 help
460 Support for Freescale MXC/iMX-based family of processors
461
462config ARCH_ORION5X 440config ARCH_ORION5X
463 bool "Marvell Orion" 441 bool "Marvell Orion"
464 depends on MMU 442 depends on MMU
465 select CPU_FEROCEON 443 select CPU_FEROCEON
466 select PCI 444 select PCI
467 select GENERIC_GPIO 445 select GENERIC_GPIO
446 select ARCH_REQUIRE_GPIOLIB
468 select GENERIC_TIME 447 select GENERIC_TIME
469 select GENERIC_CLOCKEVENTS 448 select GENERIC_CLOCKEVENTS
470 select PLAT_ORION 449 select PLAT_ORION
@@ -473,6 +452,52 @@ config ARCH_ORION5X
473 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182), 452 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
474 Orion-2 (5281), Orion-1-90 (6183). 453 Orion-2 (5281), Orion-1-90 (6183).
475 454
455config ARCH_MMP
456 bool "Marvell PXA168/910"
457 depends on MMU
458 select GENERIC_GPIO
459 select ARCH_REQUIRE_GPIOLIB
460 select HAVE_CLK
461 select COMMON_CLKDEV
462 select GENERIC_TIME
463 select GENERIC_CLOCKEVENTS
464 select TICK_ONESHOT
465 select PLAT_PXA
466 help
467 Support for Marvell's PXA168/910 processor line.
468
469config ARCH_KS8695
470 bool "Micrel/Kendin KS8695"
471 select CPU_ARM922T
472 select GENERIC_GPIO
473 select ARCH_REQUIRE_GPIOLIB
474 help
475 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
476 System-on-Chip devices.
477
478config ARCH_NS9XXX
479 bool "NetSilicon NS9xxx"
480 select CPU_ARM926T
481 select GENERIC_GPIO
482 select GENERIC_TIME
483 select GENERIC_CLOCKEVENTS
484 select HAVE_CLK
485 help
486 Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
487 System.
488
489 <http://www.digi.com/products/microprocessors/index.jsp>
490
491config ARCH_W90X900
492 bool "Nuvoton W90X900 CPU"
493 select CPU_ARM926T
494 select ARCH_REQUIRE_GPIOLIB
495 select GENERIC_GPIO
496 select COMMON_CLKDEV
497 help
498 Support for Nuvoton (Winbond logic dept.) ARM9 processor,You
499 can login www.mcuos.com or www.nuvoton.com to know more.
500
476config ARCH_PNX4008 501config ARCH_PNX4008
477 bool "Philips Nexperia PNX4008 Mobile" 502 bool "Philips Nexperia PNX4008 Mobile"
478 select CPU_ARM926T 503 select CPU_ARM926T
@@ -495,19 +520,16 @@ config ARCH_PXA
495 help 520 help
496 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 521 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
497 522
498config ARCH_MMP 523config ARCH_MSM
499 bool "Marvell PXA168/910" 524 bool "Qualcomm MSM"
500 depends on MMU 525 select CPU_V6
501 select GENERIC_GPIO
502 select ARCH_REQUIRE_GPIOLIB
503 select HAVE_CLK
504 select COMMON_CLKDEV
505 select GENERIC_TIME 526 select GENERIC_TIME
506 select GENERIC_CLOCKEVENTS 527 select GENERIC_CLOCKEVENTS
507 select TICK_ONESHOT
508 select PLAT_PXA
509 help 528 help
510 Support for Marvell's PXA168/910 processor line. 529 Support for Qualcomm MSM7K based systems. This runs on the ARM11
530 apps processor of the MSM7K and depends on a shared memory
531 interface to the ARM9 modem processor which runs the baseband stack
532 and controls some vital subsystems (clock and power control, etc).
511 533
512config ARCH_RPC 534config ARCH_RPC
513 bool "RiscPC" 535 bool "RiscPC"
@@ -576,6 +598,20 @@ config ARCH_LH7A40X
576 core with a wide array of integrated devices for 598 core with a wide array of integrated devices for
577 hand-held and low-power applications. 599 hand-held and low-power applications.
578 600
601config ARCH_U300
602 bool "ST-Ericsson U300 Series"
603 depends on MMU
604 select CPU_ARM926T
605 select ARM_AMBA
606 select ARM_VIC
607 select GENERIC_TIME
608 select GENERIC_CLOCKEVENTS
609 select HAVE_CLK
610 select COMMON_CLKDEV
611 select GENERIC_GPIO
612 help
613 Support for ST-Ericsson U300 series mobile platforms.
614
579config ARCH_DAVINCI 615config ARCH_DAVINCI
580 bool "TI DaVinci" 616 bool "TI DaVinci"
581 select CPU_ARM926T 617 select CPU_ARM926T
@@ -587,6 +623,7 @@ config ARCH_DAVINCI
587 select ZONE_DMA 623 select ZONE_DMA
588 select HAVE_IDE 624 select HAVE_IDE
589 select COMMON_CLKDEV 625 select COMMON_CLKDEV
626 select GENERIC_ALLOCATOR
590 help 627 help
591 Support for TI's DaVinci platform. 628 Support for TI's DaVinci platform.
592 629
@@ -600,24 +637,6 @@ config ARCH_OMAP
600 help 637 help
601 Support for TI's OMAP platform (OMAP1 and OMAP2). 638 Support for TI's OMAP platform (OMAP1 and OMAP2).
602 639
603config ARCH_MSM
604 bool "Qualcomm MSM"
605 select CPU_V6
606 select GENERIC_TIME
607 select GENERIC_CLOCKEVENTS
608 help
609 Support for Qualcomm MSM7K based systems. This runs on the ARM11
610 apps processor of the MSM7K and depends on a shared memory
611 interface to the ARM9 modem processor which runs the baseband stack
612 and controls some vital subsystems (clock and power control, etc).
613
614config ARCH_W90X900
615 bool "Nuvoton W90X900 CPU"
616 select CPU_ARM926T
617 help
618 Support for Nuvoton (Winbond logic dept.) ARM9 processor,You
619 can login www.mcuos.com or www.nuvoton.com to know more.
620
621endchoice 640endchoice
622 641
623source "arch/arm/mach-clps711x/Kconfig" 642source "arch/arm/mach-clps711x/Kconfig"
@@ -681,9 +700,9 @@ source "arch/arm/mach-s3c6400/Kconfig"
681source "arch/arm/mach-s3c6410/Kconfig" 700source "arch/arm/mach-s3c6410/Kconfig"
682endif 701endif
683 702
684source "arch/arm/mach-lh7a40x/Kconfig" 703source "arch/arm/plat-stmp3xxx/Kconfig"
685 704
686source "arch/arm/mach-imx/Kconfig" 705source "arch/arm/mach-lh7a40x/Kconfig"
687 706
688source "arch/arm/mach-h720x/Kconfig" 707source "arch/arm/mach-h720x/Kconfig"
689 708
@@ -707,6 +726,8 @@ source "arch/arm/mach-ks8695/Kconfig"
707 726
708source "arch/arm/mach-msm/Kconfig" 727source "arch/arm/mach-msm/Kconfig"
709 728
729source "arch/arm/mach-u300/Kconfig"
730
710source "arch/arm/mach-w90x900/Kconfig" 731source "arch/arm/mach-w90x900/Kconfig"
711 732
712# Definitions to make life easier 733# Definitions to make life easier
@@ -859,8 +880,11 @@ source "kernel/time/Kconfig"
859 880
860config SMP 881config SMP
861 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 882 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
862 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP) 883 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\
884 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4)
885 depends on GENERIC_CLOCKEVENTS
863 select USE_GENERIC_SMP_HELPERS 886 select USE_GENERIC_SMP_HELPERS
887 select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4)
864 help 888 help
865 This enables support for systems with more than one CPU. If you have 889 This enables support for systems with more than one CPU. If you have
866 a system with only one CPU, like most personal computers, say N. If 890 a system with only one CPU, like most personal computers, say N. If
@@ -878,6 +902,18 @@ config SMP
878 902
879 If you don't know what to do here, say N. 903 If you don't know what to do here, say N.
880 904
905config HAVE_ARM_SCU
906 bool
907 depends on SMP
908 help
909 This option enables support for the ARM system coherency unit
910
911config HAVE_ARM_TWD
912 bool
913 depends on SMP
914 help
915 This options enables support for the ARM timer and watchdog unit
916
881choice 917choice
882 prompt "Memory split" 918 prompt "Memory split"
883 default VMSPLIT_3G 919 default VMSPLIT_3G
@@ -916,8 +952,10 @@ config HOTPLUG_CPU
916 952
917config LOCAL_TIMERS 953config LOCAL_TIMERS
918 bool "Use local timer interrupts" 954 bool "Use local timer interrupts"
919 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || REALVIEW_EB_A9MP) 955 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
956 REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4)
920 default y 957 default y
958 select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4)
921 help 959 help
922 Enable support for local timers on SMP platforms, rather then the 960 Enable support for local timers on SMP platforms, rather then the
923 legacy IPI broadcast method. Local timers allows the system 961 legacy IPI broadcast method. Local timers allows the system
@@ -979,7 +1017,6 @@ config OABI_COMPAT
979 1017
980config ARCH_HAS_HOLES_MEMORYMODEL 1018config ARCH_HAS_HOLES_MEMORYMODEL
981 bool 1019 bool
982 default n
983 1020
984# Discontigmem is deprecated 1021# Discontigmem is deprecated
985config ARCH_DISCONTIGMEM_ENABLE 1022config ARCH_DISCONTIGMEM_ENABLE
@@ -1022,12 +1059,12 @@ source "mm/Kconfig"
1022config LEDS 1059config LEDS
1023 bool "Timer and CPU usage LEDs" 1060 bool "Timer and CPU usage LEDs"
1024 depends on ARCH_CDB89712 || ARCH_EBSA110 || \ 1061 depends on ARCH_CDB89712 || ARCH_EBSA110 || \
1025 ARCH_EBSA285 || ARCH_IMX || ARCH_INTEGRATOR || \ 1062 ARCH_EBSA285 || ARCH_INTEGRATOR || \
1026 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \ 1063 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
1027 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \ 1064 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
1028 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \ 1065 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
1029 ARCH_AT91 || ARCH_DAVINCI || \ 1066 ARCH_AT91 || ARCH_DAVINCI || \
1030 ARCH_KS8695 || MACH_RD88F5182 1067 ARCH_KS8695 || MACH_RD88F5182 || ARCH_REALVIEW
1031 help 1068 help
1032 If you say Y here, the LEDs on your machine will be used 1069 If you say Y here, the LEDs on your machine will be used
1033 to provide useful information about your current system status. 1070 to provide useful information about your current system status.
@@ -1085,6 +1122,22 @@ config ALIGNMENT_TRAP
1085 correct operation of some network protocols. With an IP-only 1122 correct operation of some network protocols. With an IP-only
1086 configuration it is safe to say N, otherwise say Y. 1123 configuration it is safe to say N, otherwise say Y.
1087 1124
1125config UACCESS_WITH_MEMCPY
1126 bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)"
1127 depends on MMU && EXPERIMENTAL
1128 default y if CPU_FEROCEON
1129 help
1130 Implement faster copy_to_user and clear_user methods for CPU
1131 cores where a 8-word STM instruction give significantly higher
1132 memory write throughput than a sequence of individual 32bit stores.
1133
1134 A possible side effect is a slight increase in scheduling latency
1135 between threads sharing the same address space if they invoke
1136 such copy operations with large buffers.
1137
1138 However, if the CPU data cache is using a write-allocate mode,
1139 this option is unlikely to provide any performance gain.
1140
1088endmenu 1141endmenu
1089 1142
1090menu "Boot options" 1143menu "Boot options"
@@ -1188,7 +1241,7 @@ endmenu
1188 1241
1189menu "CPU Power Management" 1242menu "CPU Power Management"
1190 1243
1191if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA) 1244if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_PXA)
1192 1245
1193source "drivers/cpufreq/Kconfig" 1246source "drivers/cpufreq/Kconfig"
1194 1247
@@ -1213,14 +1266,11 @@ config CPU_FREQ_INTEGRATOR
1213 1266
1214 If in doubt, say Y. 1267 If in doubt, say Y.
1215 1268
1216config CPU_FREQ_IMX 1269config CPU_FREQ_PXA
1217 tristate "CPUfreq driver for i.MX CPUs" 1270 bool
1218 depends on ARCH_IMX && CPU_FREQ 1271 depends on CPU_FREQ && ARCH_PXA && PXA25x
1219 default n 1272 default y
1220 help 1273 select CPU_FREQ_DEFAULT_GOV_USERSPACE
1221 This enables the CPUfreq driver for i.MX CPUs.
1222
1223 If in doubt, say N.
1224 1274
1225endif 1275endif
1226 1276
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e84729bf13d4..c877d6df23d1 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -11,6 +11,9 @@
11# Copyright (C) 1995-2001 by Russell King 11# Copyright (C) 1995-2001 by Russell King
12 12
13LDFLAGS_vmlinux :=-p --no-undefined -X 13LDFLAGS_vmlinux :=-p --no-undefined -X
14ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
15LDFLAGS_vmlinux += --be8
16endif
14CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) 17CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
15OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S 18OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
16GZFLAGS :=-9 19GZFLAGS :=-9
@@ -99,64 +102,73 @@ CHECKFLAGS += -D__arm__
99#Default value 102#Default value
100head-y := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o 103head-y := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o
101textofs-y := 0x00008000 104textofs-y := 0x00008000
102 105textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000
103 machine-$(CONFIG_ARCH_RPC) := rpc
104 machine-$(CONFIG_ARCH_EBSA110) := ebsa110
105 machine-$(CONFIG_FOOTBRIDGE) := footbridge
106 machine-$(CONFIG_ARCH_SHARK) := shark
107 machine-$(CONFIG_ARCH_SA1100) := sa1100
108ifeq ($(CONFIG_ARCH_SA1100),y)
109# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory 106# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
110 textofs-$(CONFIG_SA1111) := 0x00208000 107ifeq ($(CONFIG_ARCH_SA1100),y)
108textofs-$(CONFIG_SA1111) := 0x00208000
111endif 109endif
112 machine-$(CONFIG_ARCH_PXA) := pxa 110
113 machine-$(CONFIG_ARCH_MMP) := mmp 111# Machine directory name. This list is sorted alphanumerically
114 plat-$(CONFIG_PLAT_PXA) := pxa 112# by CONFIG_* macro name.
115 machine-$(CONFIG_ARCH_L7200) := l7200 113machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
116 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator 114machine-$(CONFIG_ARCH_AT91) := at91
117 machine-$(CONFIG_ARCH_GEMINI) := gemini 115machine-$(CONFIG_ARCH_CLPS711X) := clps711x
118 textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000 116machine-$(CONFIG_ARCH_DAVINCI) := davinci
119 machine-$(CONFIG_ARCH_CLPS711X) := clps711x 117machine-$(CONFIG_ARCH_EBSA110) := ebsa110
120 machine-$(CONFIG_ARCH_IOP32X) := iop32x 118machine-$(CONFIG_ARCH_EP93XX) := ep93xx
121 machine-$(CONFIG_ARCH_IOP33X) := iop33x 119machine-$(CONFIG_ARCH_GEMINI) := gemini
122 machine-$(CONFIG_ARCH_IOP13XX) := iop13xx 120machine-$(CONFIG_ARCH_H720X) := h720x
123 plat-$(CONFIG_PLAT_IOP) := iop 121machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
124 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 122machine-$(CONFIG_ARCH_IOP13XX) := iop13xx
125 machine-$(CONFIG_ARCH_IXP2000) := ixp2000 123machine-$(CONFIG_ARCH_IOP32X) := iop32x
126 machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx 124machine-$(CONFIG_ARCH_IOP33X) := iop33x
127 machine-$(CONFIG_ARCH_OMAP1) := omap1 125machine-$(CONFIG_ARCH_IXP2000) := ixp2000
128 machine-$(CONFIG_ARCH_OMAP2) := omap2 126machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
129 machine-$(CONFIG_ARCH_OMAP3) := omap2 127machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
130 plat-$(CONFIG_ARCH_OMAP) := omap 128machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood
131 machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 129machine-$(CONFIG_ARCH_KS8695) := ks8695
132 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 130machine-$(CONFIG_ARCH_L7200) := l7200
133 plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c 131machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
134 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 132machine-$(CONFIG_ARCH_LOKI) := loki
135 plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c 133machine-$(CONFIG_ARCH_MMP) := mmp
136 machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x 134machine-$(CONFIG_ARCH_MSM) := msm
137 machine-$(CONFIG_ARCH_VERSATILE) := versatile 135machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
138 machine-$(CONFIG_ARCH_IMX) := imx 136machine-$(CONFIG_ARCH_MX1) := mx1
139 machine-$(CONFIG_ARCH_H720X) := h720x 137machine-$(CONFIG_ARCH_MX2) := mx2
140 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 138machine-$(CONFIG_ARCH_MX3) := mx3
141 machine-$(CONFIG_ARCH_REALVIEW) := realview 139machine-$(CONFIG_ARCH_NETX) := netx
142 machine-$(CONFIG_ARCH_AT91) := at91 140machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx
143 machine-$(CONFIG_ARCH_EP93XX) := ep93xx 141machine-$(CONFIG_ARCH_OMAP1) := omap1
144 machine-$(CONFIG_ARCH_PNX4008) := pnx4008 142machine-$(CONFIG_ARCH_OMAP2) := omap2
145 machine-$(CONFIG_ARCH_NETX) := netx 143machine-$(CONFIG_ARCH_OMAP3) := omap2
146 machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx 144machine-$(CONFIG_ARCH_OMAP4) := omap2
147 machine-$(CONFIG_ARCH_DAVINCI) := davinci 145machine-$(CONFIG_ARCH_ORION5X) := orion5x
148 machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood 146machine-$(CONFIG_ARCH_PNX4008) := pnx4008
149 machine-$(CONFIG_ARCH_KS8695) := ks8695 147machine-$(CONFIG_ARCH_PXA) := pxa
150 plat-$(CONFIG_ARCH_MXC) := mxc 148machine-$(CONFIG_ARCH_REALVIEW) := realview
151 machine-$(CONFIG_ARCH_MX2) := mx2 149machine-$(CONFIG_ARCH_RPC) := rpc
152 machine-$(CONFIG_ARCH_MX3) := mx3 150machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443
153 machine-$(CONFIG_ARCH_MX1) := mx1 151machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
154 machine-$(CONFIG_ARCH_ORION5X) := orion5x 152machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410
155 plat-$(CONFIG_PLAT_ORION) := orion 153machine-$(CONFIG_ARCH_SA1100) := sa1100
156 machine-$(CONFIG_ARCH_MSM) := msm 154machine-$(CONFIG_ARCH_SHARK) := shark
157 machine-$(CONFIG_ARCH_LOKI) := loki 155machine-$(CONFIG_ARCH_STMP378X) := stmp378x
158 machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 156machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx
159 machine-$(CONFIG_ARCH_W90X900) := w90x900 157machine-$(CONFIG_ARCH_U300) := u300
158machine-$(CONFIG_ARCH_VERSATILE) := versatile
159machine-$(CONFIG_ARCH_W90X900) := w90x900
160machine-$(CONFIG_FOOTBRIDGE) := footbridge
161
162# Platform directory name. This list is sorted alphanumerically
163# by CONFIG_* macro name.
164plat-$(CONFIG_ARCH_MXC) := mxc
165plat-$(CONFIG_ARCH_OMAP) := omap
166plat-$(CONFIG_PLAT_IOP) := iop
167plat-$(CONFIG_PLAT_ORION) := orion
168plat-$(CONFIG_PLAT_PXA) := pxa
169plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c
170plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c
171plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
160 172
161ifeq ($(CONFIG_ARCH_EBSA110),y) 173ifeq ($(CONFIG_ARCH_EBSA110),y)
162# This is what happens if you forget the IOCS16 line. 174# This is what happens if you forget the IOCS16 line.
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index fbe5eef1f6c9..ce39dc540085 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -40,7 +40,7 @@ ifeq ($(CONFIG_PXA_SHARPSL),y)
40OBJS += head-sharpsl.o 40OBJS += head-sharpsl.o
41endif 41endif
42 42
43ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) 43ifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
44ifeq ($(CONFIG_CPU_CP15),y) 44ifeq ($(CONFIG_CPU_CP15),y)
45OBJS += big-endian.o 45OBJS += big-endian.o
46else 46else
@@ -78,6 +78,9 @@ EXTRA_AFLAGS := -Wa,-march=all
78# linker symbols. We only define initrd_phys and params_phys if the 78# linker symbols. We only define initrd_phys and params_phys if the
79# machine class defined the corresponding makefile variable. 79# machine class defined the corresponding makefile variable.
80LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR) 80LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
81ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
82LDFLAGS_vmlinux += --be8
83endif
81ifneq ($(INITRD_PHYS),) 84ifneq ($(INITRD_PHYS),)
82LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS) 85LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
83endif 86endif
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index b371fba1b954..01d49be3b2ca 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -438,6 +438,9 @@ __armv4_mmu_cache_on:
438 mrc p15, 0, r0, c1, c0, 0 @ read control reg 438 mrc p15, 0, r0, c1, c0, 0 @ read control reg
439 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement 439 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
440 orr r0, r0, #0x0030 440 orr r0, r0, #0x0030
441#ifdef CONFIG_CPU_ENDIAN_BE8
442 orr r0, r0, #1 << 25 @ big-endian page tables
443#endif
441 bl __common_mmu_cache_on 444 bl __common_mmu_cache_on
442 mov r0, #0 445 mov r0, #0
443 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs 446 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
@@ -455,6 +458,9 @@ __armv7_mmu_cache_on:
455 mrc p15, 0, r0, c1, c0, 0 @ read control reg 458 mrc p15, 0, r0, c1, c0, 0 @ read control reg
456 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement 459 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
457 orr r0, r0, #0x003c @ write buffer 460 orr r0, r0, #0x003c @ write buffer
461#ifdef CONFIG_CPU_ENDIAN_BE8
462 orr r0, r0, #1 << 25 @ big-endian page tables
463#endif
458 orrne r0, r0, #1 @ MMU enabled 464 orrne r0, r0, #1 @ MMU enabled
459 movne r1, #-1 465 movne r1, #-1
460 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer 466 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index a2cd9beaf37d..4efbb9df0444 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -4,6 +4,14 @@ config ARM_GIC
4config ARM_VIC 4config ARM_VIC
5 bool 5 bool
6 6
7config ARM_VIC_NR
8 int
9 default 2
10 depends on ARM_VIC
11 help
12 The maximum number of VICs available in the system, for
13 power management.
14
7config ICST525 15config ICST525
8 bool 16 bool
9 17
@@ -27,10 +35,6 @@ config SHARP_LOCOMO
27config SHARP_PARAM 35config SHARP_PARAM
28 bool 36 bool
29 37
30config SHARPSL_PM
31 bool
32 select APM_EMULATION
33
34config SHARP_SCOOP 38config SHARP_SCOOP
35 bool 39 bool
36 40
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index 7cb7961d81cb..76be7ff2a7ca 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -12,7 +12,6 @@ obj-$(CONFIG_DMABOUNCE) += dmabounce.o
12obj-$(CONFIG_TIMER_ACORN) += time-acorn.o 12obj-$(CONFIG_TIMER_ACORN) += time-acorn.o
13obj-$(CONFIG_SHARP_LOCOMO) += locomo.o 13obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
14obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o 14obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
15obj-$(CONFIG_SHARPSL_PM) += sharpsl_pm.o
16obj-$(CONFIG_SHARP_SCOOP) += scoop.o 15obj-$(CONFIG_SHARP_SCOOP) += scoop.o
17obj-$(CONFIG_ARCH_IXP2000) += uengine.o 16obj-$(CONFIG_ARCH_IXP2000) += uengine.o
18obj-$(CONFIG_ARCH_IXP23XX) += uengine.o 17obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
index 5589444ff437..f37afd9422f3 100644
--- a/arch/arm/common/clkdev.c
+++ b/arch/arm/common/clkdev.c
@@ -135,6 +135,24 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
135} 135}
136EXPORT_SYMBOL(clkdev_alloc); 136EXPORT_SYMBOL(clkdev_alloc);
137 137
138int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
139 struct device *dev)
140{
141 struct clk *r = clk_get(dev, id);
142 struct clk_lookup *l;
143
144 if (IS_ERR(r))
145 return PTR_ERR(r);
146
147 l = clkdev_alloc(r, alias, alias_dev_name);
148 clk_put(r);
149 if (!l)
150 return -ENODEV;
151 clkdev_add(l);
152 return 0;
153}
154EXPORT_SYMBOL(clk_add_alias);
155
138/* 156/*
139 * clkdev_drop - remove a clock dynamically allocated 157 * clkdev_drop - remove a clock dynamically allocated
140 */ 158 */
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
deleted file mode 100644
index 140f1d721d50..000000000000
--- a/arch/arm/common/sharpsl_pm.c
+++ /dev/null
@@ -1,859 +0,0 @@
1/*
2 * Battery and Power Management code for the Sharp SL-C7xx and SL-Cxx00
3 * series of PDAs
4 *
5 * Copyright (c) 2004-2005 Richard Purdie
6 *
7 * Based on code written by Sharp for 2.4 kernels
8 *
9 * This program 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 */
14
15#undef DEBUG
16
17#include <linux/module.h>
18#include <linux/timer.h>
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/apm_bios.h>
22#include <linux/delay.h>
23#include <linux/interrupt.h>
24#include <linux/platform_device.h>
25#include <linux/leds.h>
26#include <linux/apm-emulation.h>
27#include <linux/suspend.h>
28
29#include <mach/hardware.h>
30#include <asm/irq.h>
31#include <mach/pm.h>
32#include <mach/pxa2xx-regs.h>
33#include <mach/regs-rtc.h>
34#include <mach/sharpsl.h>
35#include <asm/hardware/sharpsl_pm.h>
36
37/*
38 * Constants
39 */
40#define SHARPSL_CHARGE_ON_TIME_INTERVAL (msecs_to_jiffies(1*60*1000)) /* 1 min */
41#define SHARPSL_CHARGE_FINISH_TIME (msecs_to_jiffies(10*60*1000)) /* 10 min */
42#define SHARPSL_BATCHK_TIME (msecs_to_jiffies(15*1000)) /* 15 sec */
43#define SHARPSL_BATCHK_TIME_SUSPEND (60*10) /* 10 min */
44
45#define SHARPSL_WAIT_CO_TIME 15 /* 15 sec */
46#define SHARPSL_WAIT_DISCHARGE_ON 100 /* 100 msec */
47#define SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP 10 /* 10 msec */
48#define SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT 10 /* 10 msec */
49#define SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN 10 /* 10 msec */
50#define SHARPSL_CHARGE_WAIT_TIME 15 /* 15 msec */
51#define SHARPSL_CHARGE_CO_CHECK_TIME 5 /* 5 msec */
52#define SHARPSL_CHARGE_RETRY_CNT 1 /* eqv. 10 min */
53
54/*
55 * Prototypes
56 */
57#ifdef CONFIG_PM
58static int sharpsl_off_charge_battery(void);
59static int sharpsl_check_battery_voltage(void);
60static int sharpsl_fatal_check(void);
61#endif
62static int sharpsl_check_battery_temp(void);
63static int sharpsl_ac_check(void);
64static int sharpsl_average_value(int ad);
65static void sharpsl_average_clear(void);
66static void sharpsl_charge_toggle(struct work_struct *private_);
67static void sharpsl_battery_thread(struct work_struct *private_);
68
69
70/*
71 * Variables
72 */
73struct sharpsl_pm_status sharpsl_pm;
74DECLARE_DELAYED_WORK(toggle_charger, sharpsl_charge_toggle);
75DECLARE_DELAYED_WORK(sharpsl_bat, sharpsl_battery_thread);
76DEFINE_LED_TRIGGER(sharpsl_charge_led_trigger);
77
78
79static int get_percentage(int voltage)
80{
81 int i = sharpsl_pm.machinfo->bat_levels - 1;
82 int bl_status = sharpsl_pm.machinfo->backlight_get_status ? sharpsl_pm.machinfo->backlight_get_status() : 0;
83 struct battery_thresh *thresh;
84
85 if (sharpsl_pm.charge_mode == CHRG_ON)
86 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_acin_bl : sharpsl_pm.machinfo->bat_levels_acin;
87 else
88 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_noac_bl : sharpsl_pm.machinfo->bat_levels_noac;
89
90 while (i > 0 && (voltage > thresh[i].voltage))
91 i--;
92
93 return thresh[i].percentage;
94}
95
96static int get_apm_status(int voltage)
97{
98 int low_thresh, high_thresh;
99
100 if (sharpsl_pm.charge_mode == CHRG_ON) {
101 high_thresh = sharpsl_pm.machinfo->status_high_acin;
102 low_thresh = sharpsl_pm.machinfo->status_low_acin;
103 } else {
104 high_thresh = sharpsl_pm.machinfo->status_high_noac;
105 low_thresh = sharpsl_pm.machinfo->status_low_noac;
106 }
107
108 if (voltage >= high_thresh)
109 return APM_BATTERY_STATUS_HIGH;
110 if (voltage >= low_thresh)
111 return APM_BATTERY_STATUS_LOW;
112 return APM_BATTERY_STATUS_CRITICAL;
113}
114
115void sharpsl_battery_kick(void)
116{
117 schedule_delayed_work(&sharpsl_bat, msecs_to_jiffies(125));
118}
119EXPORT_SYMBOL(sharpsl_battery_kick);
120
121
122static void sharpsl_battery_thread(struct work_struct *private_)
123{
124 int voltage, percent, apm_status, i = 0;
125
126 if (!sharpsl_pm.machinfo)
127 return;
128
129 sharpsl_pm.battstat.ac_status = (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN) ? APM_AC_ONLINE : APM_AC_OFFLINE);
130
131 /* Corgi cannot confirm when battery fully charged so periodically kick! */
132 if (!sharpsl_pm.machinfo->batfull_irq && (sharpsl_pm.charge_mode == CHRG_ON)
133 && time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_ON_TIME_INTERVAL))
134 schedule_delayed_work(&toggle_charger, 0);
135
136 while(1) {
137 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
138
139 if (voltage > 0) break;
140 if (i++ > 5) {
141 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
142 dev_warn(sharpsl_pm.dev, "Warning: Cannot read main battery!\n");
143 break;
144 }
145 }
146
147 voltage = sharpsl_average_value(voltage);
148 apm_status = get_apm_status(voltage);
149 percent = get_percentage(voltage);
150
151 /* At low battery voltages, the voltage has a tendency to start
152 creeping back up so we try to avoid this here */
153 if ((sharpsl_pm.battstat.ac_status == APM_AC_ONLINE) || (apm_status == APM_BATTERY_STATUS_HIGH) || percent <= sharpsl_pm.battstat.mainbat_percent) {
154 sharpsl_pm.battstat.mainbat_voltage = voltage;
155 sharpsl_pm.battstat.mainbat_status = apm_status;
156 sharpsl_pm.battstat.mainbat_percent = percent;
157 }
158
159 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
160 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
161
162#ifdef CONFIG_BACKLIGHT_CORGI
163 /* If battery is low. limit backlight intensity to save power. */
164 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
165 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) ||
166 (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) {
167 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) {
168 sharpsl_pm.machinfo->backlight_limit(1);
169 sharpsl_pm.flags |= SHARPSL_BL_LIMIT;
170 }
171 } else if (sharpsl_pm.flags & SHARPSL_BL_LIMIT) {
172 sharpsl_pm.machinfo->backlight_limit(0);
173 sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT;
174 }
175#endif
176
177 /* Suspend if critical battery level */
178 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
179 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL)
180 && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) {
181 sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
182 dev_err(sharpsl_pm.dev, "Fatal Off\n");
183 apm_queue_event(APM_CRITICAL_SUSPEND);
184 }
185
186 schedule_delayed_work(&sharpsl_bat, SHARPSL_BATCHK_TIME);
187}
188
189void sharpsl_pm_led(int val)
190{
191 if (val == SHARPSL_LED_ERROR) {
192 dev_err(sharpsl_pm.dev, "Charging Error!\n");
193 } else if (val == SHARPSL_LED_ON) {
194 dev_dbg(sharpsl_pm.dev, "Charge LED On\n");
195 led_trigger_event(sharpsl_charge_led_trigger, LED_FULL);
196 } else {
197 dev_dbg(sharpsl_pm.dev, "Charge LED Off\n");
198 led_trigger_event(sharpsl_charge_led_trigger, LED_OFF);
199 }
200}
201
202static void sharpsl_charge_on(void)
203{
204 dev_dbg(sharpsl_pm.dev, "Turning Charger On\n");
205
206 sharpsl_pm.full_count = 0;
207 sharpsl_pm.charge_mode = CHRG_ON;
208 schedule_delayed_work(&toggle_charger, msecs_to_jiffies(250));
209 schedule_delayed_work(&sharpsl_bat, msecs_to_jiffies(500));
210}
211
212static void sharpsl_charge_off(void)
213{
214 dev_dbg(sharpsl_pm.dev, "Turning Charger Off\n");
215
216 sharpsl_pm.machinfo->charge(0);
217 sharpsl_pm_led(SHARPSL_LED_OFF);
218 sharpsl_pm.charge_mode = CHRG_OFF;
219
220 schedule_delayed_work(&sharpsl_bat, 0);
221}
222
223static void sharpsl_charge_error(void)
224{
225 sharpsl_pm_led(SHARPSL_LED_ERROR);
226 sharpsl_pm.machinfo->charge(0);
227 sharpsl_pm.charge_mode = CHRG_ERROR;
228}
229
230static void sharpsl_charge_toggle(struct work_struct *private_)
231{
232 dev_dbg(sharpsl_pm.dev, "Toogling Charger at time: %lx\n", jiffies);
233
234 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
235 sharpsl_charge_off();
236 return;
237 } else if ((sharpsl_check_battery_temp() < 0) || (sharpsl_ac_check() < 0)) {
238 sharpsl_charge_error();
239 return;
240 }
241
242 sharpsl_pm_led(SHARPSL_LED_ON);
243 sharpsl_pm.machinfo->charge(0);
244 mdelay(SHARPSL_CHARGE_WAIT_TIME);
245 sharpsl_pm.machinfo->charge(1);
246
247 sharpsl_pm.charge_start_time = jiffies;
248}
249
250static void sharpsl_ac_timer(unsigned long data)
251{
252 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
253
254 dev_dbg(sharpsl_pm.dev, "AC Status: %d\n",acin);
255
256 sharpsl_average_clear();
257 if (acin && (sharpsl_pm.charge_mode != CHRG_ON))
258 sharpsl_charge_on();
259 else if (sharpsl_pm.charge_mode == CHRG_ON)
260 sharpsl_charge_off();
261
262 schedule_delayed_work(&sharpsl_bat, 0);
263}
264
265
266irqreturn_t sharpsl_ac_isr(int irq, void *dev_id)
267{
268 /* Delay the event slightly to debounce */
269 /* Must be a smaller delay than the chrg_full_isr below */
270 mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250));
271
272 return IRQ_HANDLED;
273}
274
275static void sharpsl_chrg_full_timer(unsigned long data)
276{
277 dev_dbg(sharpsl_pm.dev, "Charge Full at time: %lx\n", jiffies);
278
279 sharpsl_pm.full_count++;
280
281 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
282 dev_dbg(sharpsl_pm.dev, "Charge Full: AC removed - stop charging!\n");
283 if (sharpsl_pm.charge_mode == CHRG_ON)
284 sharpsl_charge_off();
285 } else if (sharpsl_pm.full_count < 2) {
286 dev_dbg(sharpsl_pm.dev, "Charge Full: Count too low\n");
287 schedule_delayed_work(&toggle_charger, 0);
288 } else if (time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_FINISH_TIME)) {
289 dev_dbg(sharpsl_pm.dev, "Charge Full: Interrupt generated too slowly - retry.\n");
290 schedule_delayed_work(&toggle_charger, 0);
291 } else {
292 sharpsl_charge_off();
293 sharpsl_pm.charge_mode = CHRG_DONE;
294 dev_dbg(sharpsl_pm.dev, "Charge Full: Charging Finished\n");
295 }
296}
297
298/* Charging Finished Interrupt (Not present on Corgi) */
299/* Can trigger at the same time as an AC status change so
300 delay until after that has been processed */
301irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id)
302{
303 if (sharpsl_pm.flags & SHARPSL_SUSPENDED)
304 return IRQ_HANDLED;
305
306 /* delay until after any ac interrupt */
307 mod_timer(&sharpsl_pm.chrg_full_timer, jiffies + msecs_to_jiffies(500));
308
309 return IRQ_HANDLED;
310}
311
312irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id)
313{
314 int is_fatal = 0;
315
316 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) {
317 dev_err(sharpsl_pm.dev, "Battery now Unlocked! Suspending.\n");
318 is_fatal = 1;
319 }
320
321 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL)) {
322 dev_err(sharpsl_pm.dev, "Fatal Batt Error! Suspending.\n");
323 is_fatal = 1;
324 }
325
326 if (!(sharpsl_pm.flags & SHARPSL_APM_QUEUED) && is_fatal) {
327 sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
328 apm_queue_event(APM_CRITICAL_SUSPEND);
329 }
330
331 return IRQ_HANDLED;
332}
333
334/*
335 * Maintain an average of the last 10 readings
336 */
337#define SHARPSL_CNV_VALUE_NUM 10
338static int sharpsl_ad_index;
339
340static void sharpsl_average_clear(void)
341{
342 sharpsl_ad_index = 0;
343}
344
345static int sharpsl_average_value(int ad)
346{
347 int i, ad_val = 0;
348 static int sharpsl_ad[SHARPSL_CNV_VALUE_NUM+1];
349
350 if (sharpsl_pm.battstat.mainbat_status != APM_BATTERY_STATUS_HIGH) {
351 sharpsl_ad_index = 0;
352 return ad;
353 }
354
355 sharpsl_ad[sharpsl_ad_index] = ad;
356 sharpsl_ad_index++;
357 if (sharpsl_ad_index >= SHARPSL_CNV_VALUE_NUM) {
358 for (i=0; i < (SHARPSL_CNV_VALUE_NUM-1); i++)
359 sharpsl_ad[i] = sharpsl_ad[i+1];
360 sharpsl_ad_index = SHARPSL_CNV_VALUE_NUM - 1;
361 }
362 for (i=0; i < sharpsl_ad_index; i++)
363 ad_val += sharpsl_ad[i];
364
365 return (ad_val / sharpsl_ad_index);
366}
367
368/*
369 * Take an array of 5 integers, remove the maximum and minimum values
370 * and return the average.
371 */
372static int get_select_val(int *val)
373{
374 int i, j, k, temp, sum = 0;
375
376 /* Find MAX val */
377 temp = val[0];
378 j=0;
379 for (i=1; i<5; i++) {
380 if (temp < val[i]) {
381 temp = val[i];
382 j = i;
383 }
384 }
385
386 /* Find MIN val */
387 temp = val[4];
388 k=4;
389 for (i=3; i>=0; i--) {
390 if (temp > val[i]) {
391 temp = val[i];
392 k = i;
393 }
394 }
395
396 for (i=0; i<5; i++)
397 if (i != j && i != k )
398 sum += val[i];
399
400 dev_dbg(sharpsl_pm.dev, "Average: %d from values: %d, %d, %d, %d, %d\n", sum/3, val[0], val[1], val[2], val[3], val[4]);
401
402 return (sum/3);
403}
404
405static int sharpsl_check_battery_temp(void)
406{
407 int val, i, buff[5];
408
409 /* Check battery temperature */
410 for (i=0; i<5; i++) {
411 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
412 sharpsl_pm.machinfo->measure_temp(1);
413 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
414 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_TEMP);
415 sharpsl_pm.machinfo->measure_temp(0);
416 }
417
418 val = get_select_val(buff);
419
420 dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
421 if (val > sharpsl_pm.machinfo->charge_on_temp) {
422 printk(KERN_WARNING "Not charging: temperature out of limits.\n");
423 return -1;
424 }
425
426 return 0;
427}
428
429#ifdef CONFIG_PM
430static int sharpsl_check_battery_voltage(void)
431{
432 int val, i, buff[5];
433
434 /* disable charge, enable discharge */
435 sharpsl_pm.machinfo->charge(0);
436 sharpsl_pm.machinfo->discharge(1);
437 mdelay(SHARPSL_WAIT_DISCHARGE_ON);
438
439 if (sharpsl_pm.machinfo->discharge1)
440 sharpsl_pm.machinfo->discharge1(1);
441
442 /* Check battery voltage */
443 for (i=0; i<5; i++) {
444 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
445 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
446 }
447
448 if (sharpsl_pm.machinfo->discharge1)
449 sharpsl_pm.machinfo->discharge1(0);
450
451 sharpsl_pm.machinfo->discharge(0);
452
453 val = get_select_val(buff);
454 dev_dbg(sharpsl_pm.dev, "Battery Voltage: %d\n", val);
455
456 if (val < sharpsl_pm.machinfo->charge_on_volt)
457 return -1;
458
459 return 0;
460}
461#endif
462
463static int sharpsl_ac_check(void)
464{
465 int temp, i, buff[5];
466
467 for (i=0; i<5; i++) {
468 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT);
469 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN);
470 }
471
472 temp = get_select_val(buff);
473 dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n",temp);
474
475 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) {
476 dev_err(sharpsl_pm.dev, "Error: AC check failed.\n");
477 return -1;
478 }
479
480 return 0;
481}
482
483#ifdef CONFIG_PM
484static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state)
485{
486 sharpsl_pm.flags |= SHARPSL_SUSPENDED;
487 flush_scheduled_work();
488
489 if (sharpsl_pm.charge_mode == CHRG_ON)
490 sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG;
491 else
492 sharpsl_pm.flags &= ~SHARPSL_DO_OFFLINE_CHRG;
493
494 return 0;
495}
496
497static int sharpsl_pm_resume(struct platform_device *pdev)
498{
499 /* Clear the reset source indicators as they break the bootloader upon reboot */
500 RCSR = 0x0f;
501 sharpsl_average_clear();
502 sharpsl_pm.flags &= ~SHARPSL_APM_QUEUED;
503 sharpsl_pm.flags &= ~SHARPSL_SUSPENDED;
504
505 return 0;
506}
507
508static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
509{
510 dev_dbg(sharpsl_pm.dev, "Time is: %08x\n",RCNR);
511
512 dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n",sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG);
513 /* not charging and AC-IN! */
514
515 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) {
516 dev_dbg(sharpsl_pm.dev, "Activating Offline Charger...\n");
517 sharpsl_pm.charge_mode = CHRG_OFF;
518 sharpsl_pm.flags &= ~SHARPSL_DO_OFFLINE_CHRG;
519 sharpsl_off_charge_battery();
520 }
521
522 sharpsl_pm.machinfo->presuspend();
523
524 PEDR = 0xffffffff; /* clear it */
525
526 sharpsl_pm.flags &= ~SHARPSL_ALARM_ACTIVE;
527 if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) {
528 RTSR &= RTSR_ALE;
529 RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND;
530 dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n",RTAR);
531 sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE;
532 } else if (alarm_enable) {
533 RTSR &= RTSR_ALE;
534 RTAR = alarm_time;
535 dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n",RTAR);
536 } else {
537 dev_dbg(sharpsl_pm.dev, "No alarms set.\n");
538 }
539
540 pxa_pm_enter(state);
541
542 sharpsl_pm.machinfo->postsuspend();
543
544 dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n",PEDR);
545}
546
547static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
548{
549 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable) )
550 {
551 if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) {
552 dev_dbg(sharpsl_pm.dev, "No user triggered wakeup events and not charging. Strange. Suspend.\n");
553 corgi_goto_sleep(alarm_time, alarm_enable, state);
554 return 1;
555 }
556 if(sharpsl_off_charge_battery()) {
557 dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
558 corgi_goto_sleep(alarm_time, alarm_enable, state);
559 return 1;
560 }
561 dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n");
562 }
563
564 if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || (sharpsl_fatal_check() < 0) )
565 {
566 dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n");
567 corgi_goto_sleep(alarm_time, alarm_enable, state);
568 return 1;
569 }
570
571 return 0;
572}
573
574static int corgi_pxa_pm_enter(suspend_state_t state)
575{
576 unsigned long alarm_time = RTAR;
577 unsigned int alarm_status = ((RTSR & RTSR_ALE) != 0);
578
579 dev_dbg(sharpsl_pm.dev, "SharpSL suspending for first time.\n");
580
581 corgi_goto_sleep(alarm_time, alarm_status, state);
582
583 while (corgi_enter_suspend(alarm_time,alarm_status,state))
584 {}
585
586 if (sharpsl_pm.machinfo->earlyresume)
587 sharpsl_pm.machinfo->earlyresume();
588
589 dev_dbg(sharpsl_pm.dev, "SharpSL resuming...\n");
590
591 return 0;
592}
593
594/*
595 * Check for fatal battery errors
596 * Fatal returns -1
597 */
598static int sharpsl_fatal_check(void)
599{
600 int buff[5], temp, i, acin;
601
602 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check entered\n");
603
604 /* Check AC-Adapter */
605 acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
606
607 if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) {
608 sharpsl_pm.machinfo->charge(0);
609 udelay(100);
610 sharpsl_pm.machinfo->discharge(1); /* enable discharge */
611 mdelay(SHARPSL_WAIT_DISCHARGE_ON);
612 }
613
614 if (sharpsl_pm.machinfo->discharge1)
615 sharpsl_pm.machinfo->discharge1(1);
616
617 /* Check battery : check inserting battery ? */
618 for (i=0; i<5; i++) {
619 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
620 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
621 }
622
623 if (sharpsl_pm.machinfo->discharge1)
624 sharpsl_pm.machinfo->discharge1(0);
625
626 if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) {
627 udelay(100);
628 sharpsl_pm.machinfo->charge(1);
629 sharpsl_pm.machinfo->discharge(0);
630 }
631
632 temp = get_select_val(buff);
633 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT));
634
635 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) ||
636 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt)))
637 return -1;
638 return 0;
639}
640
641static int sharpsl_off_charge_error(void)
642{
643 dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n");
644 sharpsl_pm.machinfo->charge(0);
645 sharpsl_pm_led(SHARPSL_LED_ERROR);
646 sharpsl_pm.charge_mode = CHRG_ERROR;
647 return 1;
648}
649
650/*
651 * Charging Control while suspended
652 * Return 1 - go straight to sleep
653 * Return 0 - sleep or wakeup depending on other factors
654 */
655static int sharpsl_off_charge_battery(void)
656{
657 int time;
658
659 dev_dbg(sharpsl_pm.dev, "Charge Mode: %d\n", sharpsl_pm.charge_mode);
660
661 if (sharpsl_pm.charge_mode == CHRG_OFF) {
662 dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 1\n");
663
664 /* AC Check */
665 if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery_temp() < 0))
666 return sharpsl_off_charge_error();
667
668 /* Start Charging */
669 sharpsl_pm_led(SHARPSL_LED_ON);
670 sharpsl_pm.machinfo->charge(0);
671 mdelay(SHARPSL_CHARGE_WAIT_TIME);
672 sharpsl_pm.machinfo->charge(1);
673
674 sharpsl_pm.charge_mode = CHRG_ON;
675 sharpsl_pm.full_count = 0;
676
677 return 1;
678 } else if (sharpsl_pm.charge_mode != CHRG_ON) {
679 return 1;
680 }
681
682 if (sharpsl_pm.full_count == 0) {
683 int time;
684
685 dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 2\n");
686
687 if ((sharpsl_check_battery_temp() < 0) || (sharpsl_check_battery_voltage() < 0))
688 return sharpsl_off_charge_error();
689
690 sharpsl_pm.machinfo->charge(0);
691 mdelay(SHARPSL_CHARGE_WAIT_TIME);
692 sharpsl_pm.machinfo->charge(1);
693 sharpsl_pm.charge_mode = CHRG_ON;
694
695 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
696
697 time = RCNR;
698 while(1) {
699 /* Check if any wakeup event had occurred */
700 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
701 return 0;
702 /* Check for timeout */
703 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME)
704 return 1;
705 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
706 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occurred. Retrying to check\n");
707 sharpsl_pm.full_count++;
708 sharpsl_pm.machinfo->charge(0);
709 mdelay(SHARPSL_CHARGE_WAIT_TIME);
710 sharpsl_pm.machinfo->charge(1);
711 return 1;
712 }
713 }
714 }
715
716 dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 3\n");
717
718 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
719
720 time = RCNR;
721 while(1) {
722 /* Check if any wakeup event had occurred */
723 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
724 return 0;
725 /* Check for timeout */
726 if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) {
727 if (sharpsl_pm.full_count > SHARPSL_CHARGE_RETRY_CNT) {
728 dev_dbg(sharpsl_pm.dev, "Offline Charger: Not charged sufficiently. Retrying.\n");
729 sharpsl_pm.full_count = 0;
730 }
731 sharpsl_pm.full_count++;
732 return 1;
733 }
734 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
735 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charging complete.\n");
736 sharpsl_pm_led(SHARPSL_LED_OFF);
737 sharpsl_pm.machinfo->charge(0);
738 sharpsl_pm.charge_mode = CHRG_DONE;
739 return 1;
740 }
741 }
742}
743#else
744#define sharpsl_pm_suspend NULL
745#define sharpsl_pm_resume NULL
746#endif
747
748static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf)
749{
750 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_percent);
751}
752
753static ssize_t battery_voltage_show(struct device *dev, struct device_attribute *attr, char *buf)
754{
755 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_voltage);
756}
757
758static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL);
759static DEVICE_ATTR(battery_voltage, 0444, battery_voltage_show, NULL);
760
761extern void (*apm_get_power_status)(struct apm_power_info *);
762
763static void sharpsl_apm_get_power_status(struct apm_power_info *info)
764{
765 info->ac_line_status = sharpsl_pm.battstat.ac_status;
766
767 if (sharpsl_pm.charge_mode == CHRG_ON)
768 info->battery_status = APM_BATTERY_STATUS_CHARGING;
769 else
770 info->battery_status = sharpsl_pm.battstat.mainbat_status;
771
772 info->battery_flag = (1 << info->battery_status);
773 info->battery_life = sharpsl_pm.battstat.mainbat_percent;
774}
775
776#ifdef CONFIG_PM
777static struct platform_suspend_ops sharpsl_pm_ops = {
778 .enter = corgi_pxa_pm_enter,
779 .valid = suspend_valid_only_mem,
780};
781#endif
782
783static int __init sharpsl_pm_probe(struct platform_device *pdev)
784{
785 int ret;
786
787 if (!pdev->dev.platform_data)
788 return -EINVAL;
789
790 sharpsl_pm.dev = &pdev->dev;
791 sharpsl_pm.machinfo = pdev->dev.platform_data;
792 sharpsl_pm.charge_mode = CHRG_OFF;
793 sharpsl_pm.flags = 0;
794
795 init_timer(&sharpsl_pm.ac_timer);
796 sharpsl_pm.ac_timer.function = sharpsl_ac_timer;
797
798 init_timer(&sharpsl_pm.chrg_full_timer);
799 sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer;
800
801 led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger);
802
803 sharpsl_pm.machinfo->init();
804
805 ret = device_create_file(&pdev->dev, &dev_attr_battery_percentage);
806 ret |= device_create_file(&pdev->dev, &dev_attr_battery_voltage);
807 if (ret != 0)
808 dev_warn(&pdev->dev, "Failed to register attributes (%d)\n", ret);
809
810 apm_get_power_status = sharpsl_apm_get_power_status;
811
812#ifdef CONFIG_PM
813 suspend_set_ops(&sharpsl_pm_ops);
814#endif
815
816 mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250));
817
818 return 0;
819}
820
821static int sharpsl_pm_remove(struct platform_device *pdev)
822{
823 suspend_set_ops(NULL);
824
825 device_remove_file(&pdev->dev, &dev_attr_battery_percentage);
826 device_remove_file(&pdev->dev, &dev_attr_battery_voltage);
827
828 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
829
830 sharpsl_pm.machinfo->exit();
831
832 del_timer_sync(&sharpsl_pm.chrg_full_timer);
833 del_timer_sync(&sharpsl_pm.ac_timer);
834
835 return 0;
836}
837
838static struct platform_driver sharpsl_pm_driver = {
839 .probe = sharpsl_pm_probe,
840 .remove = sharpsl_pm_remove,
841 .suspend = sharpsl_pm_suspend,
842 .resume = sharpsl_pm_resume,
843 .driver = {
844 .name = "sharpsl-pm",
845 },
846};
847
848static int __devinit sharpsl_pm_init(void)
849{
850 return platform_driver_register(&sharpsl_pm_driver);
851}
852
853static void sharpsl_pm_exit(void)
854{
855 platform_driver_unregister(&sharpsl_pm_driver);
856}
857
858late_initcall(sharpsl_pm_init);
859module_exit(sharpsl_pm_exit);
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index b2a781d9ce05..887c6eb3a18a 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
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 25
25#include <asm/mach/irq.h> 26#include <asm/mach/irq.h>
26#include <asm/hardware/vic.h> 27#include <asm/hardware/vic.h>
@@ -39,11 +40,219 @@ static void vic_unmask_irq(unsigned int irq)
39 writel(1 << irq, base + VIC_INT_ENABLE); 40 writel(1 << irq, base + VIC_INT_ENABLE);
40} 41}
41 42
43/**
44 * vic_init2 - common initialisation code
45 * @base: Base of the VIC.
46 *
47 * Common initialisation code for registeration
48 * and resume.
49*/
50static void vic_init2(void __iomem *base)
51{
52 int i;
53
54 for (i = 0; i < 16; i++) {
55 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
56 writel(VIC_VECT_CNTL_ENABLE | i, reg);
57 }
58
59 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
60}
61
62#if defined(CONFIG_PM)
63/**
64 * struct vic_device - VIC PM device
65 * @sysdev: The system device which is registered.
66 * @irq: The IRQ number for the base of the VIC.
67 * @base: The register base for the VIC.
68 * @resume_sources: A bitmask of interrupts for resume.
69 * @resume_irqs: The IRQs enabled for resume.
70 * @int_select: Save for VIC_INT_SELECT.
71 * @int_enable: Save for VIC_INT_ENABLE.
72 * @soft_int: Save for VIC_INT_SOFT.
73 * @protect: Save for VIC_PROTECT.
74 */
75struct vic_device {
76 struct sys_device sysdev;
77
78 void __iomem *base;
79 int irq;
80 u32 resume_sources;
81 u32 resume_irqs;
82 u32 int_select;
83 u32 int_enable;
84 u32 soft_int;
85 u32 protect;
86};
87
88/* we cannot allocate memory when VICs are initially registered */
89static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
90
91static inline struct vic_device *to_vic(struct sys_device *sys)
92{
93 return container_of(sys, struct vic_device, sysdev);
94}
95
96static int vic_id;
97
98static int vic_class_resume(struct sys_device *dev)
99{
100 struct vic_device *vic = to_vic(dev);
101 void __iomem *base = vic->base;
102
103 printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base);
104
105 /* re-initialise static settings */
106 vic_init2(base);
107
108 writel(vic->int_select, base + VIC_INT_SELECT);
109 writel(vic->protect, base + VIC_PROTECT);
110
111 /* set the enabled ints and then clear the non-enabled */
112 writel(vic->int_enable, base + VIC_INT_ENABLE);
113 writel(~vic->int_enable, base + VIC_INT_ENABLE_CLEAR);
114
115 /* and the same for the soft-int register */
116
117 writel(vic->soft_int, base + VIC_INT_SOFT);
118 writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR);
119
120 return 0;
121}
122
123static int vic_class_suspend(struct sys_device *dev, pm_message_t state)
124{
125 struct vic_device *vic = to_vic(dev);
126 void __iomem *base = vic->base;
127
128 printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base);
129
130 vic->int_select = readl(base + VIC_INT_SELECT);
131 vic->int_enable = readl(base + VIC_INT_ENABLE);
132 vic->soft_int = readl(base + VIC_INT_SOFT);
133 vic->protect = readl(base + VIC_PROTECT);
134
135 /* set the interrupts (if any) that are used for
136 * resuming the system */
137
138 writel(vic->resume_irqs, base + VIC_INT_ENABLE);
139 writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR);
140
141 return 0;
142}
143
144struct sysdev_class vic_class = {
145 .name = "vic",
146 .suspend = vic_class_suspend,
147 .resume = vic_class_resume,
148};
149
150/**
151 * vic_pm_register - Register a VIC for later power management control
152 * @base: The base address of the VIC.
153 * @irq: The base IRQ for the VIC.
154 * @resume_sources: bitmask of interrupts allowed for resume sources.
155 *
156 * Register the VIC with the system device tree so that it can be notified
157 * of suspend and resume requests and ensure that the correct actions are
158 * taken to re-instate the settings on resume.
159 */
160static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)
161{
162 struct vic_device *v;
163
164 if (vic_id >= ARRAY_SIZE(vic_devices))
165 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
166 else {
167 v = &vic_devices[vic_id];
168 v->base = base;
169 v->resume_sources = resume_sources;
170 v->irq = irq;
171 vic_id++;
172 }
173}
174
175/**
176 * vic_pm_init - initicall to register VIC pm
177 *
178 * This is called via late_initcall() to register
179 * the resources for the VICs due to the early
180 * nature of the VIC's registration.
181*/
182static int __init vic_pm_init(void)
183{
184 struct vic_device *dev = vic_devices;
185 int err;
186 int id;
187
188 if (vic_id == 0)
189 return 0;
190
191 err = sysdev_class_register(&vic_class);
192 if (err) {
193 printk(KERN_ERR "%s: cannot register class\n", __func__);
194 return err;
195 }
196
197 for (id = 0; id < vic_id; id++, dev++) {
198 dev->sysdev.id = id;
199 dev->sysdev.cls = &vic_class;
200
201 err = sysdev_register(&dev->sysdev);
202 if (err) {
203 printk(KERN_ERR "%s: failed to register device\n",
204 __func__);
205 return err;
206 }
207 }
208
209 return 0;
210}
211
212late_initcall(vic_pm_init);
213
214static struct vic_device *vic_from_irq(unsigned int irq)
215{
216 struct vic_device *v = vic_devices;
217 unsigned int base_irq = irq & ~31;
218 int id;
219
220 for (id = 0; id < vic_id; id++, v++) {
221 if (v->irq == base_irq)
222 return v;
223 }
224
225 return NULL;
226}
227
228static int vic_set_wake(unsigned int irq, unsigned int on)
229{
230 struct vic_device *v = vic_from_irq(irq);
231 unsigned int off = irq & 31;
232
233 if (!v)
234 return -EINVAL;
235
236 if (on)
237 v->resume_irqs |= 1 << off;
238 else
239 v->resume_irqs &= ~(1 << off);
240
241 return 0;
242}
243
244#else
245static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
246
247#define vic_set_wake NULL
248#endif /* CONFIG_PM */
249
42static struct irq_chip vic_chip = { 250static struct irq_chip vic_chip = {
43 .name = "VIC", 251 .name = "VIC",
44 .ack = vic_mask_irq, 252 .ack = vic_mask_irq,
45 .mask = vic_mask_irq, 253 .mask = vic_mask_irq,
46 .unmask = vic_unmask_irq, 254 .unmask = vic_unmask_irq,
255 .set_wake = vic_set_wake,
47}; 256};
48 257
49/** 258/**
@@ -51,9 +260,10 @@ static struct irq_chip vic_chip = {
51 * @base: iomem base address 260 * @base: iomem base address
52 * @irq_start: starting interrupt number, must be muliple of 32 261 * @irq_start: starting interrupt number, must be muliple of 32
53 * @vic_sources: bitmask of interrupt sources to allow 262 * @vic_sources: bitmask of interrupt sources to allow
263 * @resume_sources: bitmask of interrupt sources to allow for resume
54 */ 264 */
55void __init vic_init(void __iomem *base, unsigned int irq_start, 265void __init vic_init(void __iomem *base, unsigned int irq_start,
56 u32 vic_sources) 266 u32 vic_sources, u32 resume_sources)
57{ 267{
58 unsigned int i; 268 unsigned int i;
59 269
@@ -77,12 +287,7 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
77 writel(value, base + VIC_PL190_VECT_ADDR); 287 writel(value, base + VIC_PL190_VECT_ADDR);
78 } 288 }
79 289
80 for (i = 0; i < 16; i++) { 290 vic_init2(base);
81 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
82 writel(VIC_VECT_CNTL_ENABLE | i, reg);
83 }
84
85 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
86 291
87 for (i = 0; i < 32; i++) { 292 for (i = 0; i < 32; i++) {
88 if (vic_sources & (1 << i)) { 293 if (vic_sources & (1 << i)) {
@@ -94,4 +299,6 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
94 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 299 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
95 } 300 }
96 } 301 }
302
303 vic_pm_register(base, irq_start, resume_sources);
97} 304}
diff --git a/arch/arm/configs/cm_x300_defconfig b/arch/arm/configs/cm_x300_defconfig
index 227da0843ead..d18d21bb41e4 100644
--- a/arch/arm/configs/cm_x300_defconfig
+++ b/arch/arm/configs/cm_x300_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.27-rc3 3# Linux kernel version: 2.6.30-rc8
4# Tue Aug 19 11:26:54 2008 4# Thu Jun 4 09:53:21 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -22,8 +22,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_ARCH_MTD_XIP=y 25CONFIG_ARCH_MTD_XIP=y
28CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
29CONFIG_VECTORS_BASE=0xffff0000 27CONFIG_VECTORS_BASE=0xffff0000
@@ -44,15 +42,24 @@ CONFIG_SYSVIPC_SYSCTL=y
44# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
45# CONFIG_TASKSTATS is not set 43# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set 44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
47CONFIG_IKCONFIG=y 54CONFIG_IKCONFIG=y
48CONFIG_IKCONFIG_PROC=y 55CONFIG_IKCONFIG_PROC=y
49CONFIG_LOG_BUF_SHIFT=18 56CONFIG_LOG_BUF_SHIFT=18
50# CONFIG_CGROUPS is not set
51CONFIG_GROUP_SCHED=y 57CONFIG_GROUP_SCHED=y
52CONFIG_FAIR_GROUP_SCHED=y 58CONFIG_FAIR_GROUP_SCHED=y
53# CONFIG_RT_GROUP_SCHED is not set 59# CONFIG_RT_GROUP_SCHED is not set
54CONFIG_USER_SCHED=y 60CONFIG_USER_SCHED=y
55# CONFIG_CGROUP_SCHED is not set 61# CONFIG_CGROUP_SCHED is not set
62# CONFIG_CGROUPS is not set
56CONFIG_SYSFS_DEPRECATED=y 63CONFIG_SYSFS_DEPRECATED=y
57CONFIG_SYSFS_DEPRECATED_V2=y 64CONFIG_SYSFS_DEPRECATED_V2=y
58# CONFIG_RELAY is not set 65# CONFIG_RELAY is not set
@@ -61,31 +68,37 @@ CONFIG_NAMESPACES=y
61# CONFIG_IPC_NS is not set 68# CONFIG_IPC_NS is not set
62# CONFIG_USER_NS is not set 69# CONFIG_USER_NS is not set
63# CONFIG_PID_NS is not set 70# CONFIG_PID_NS is not set
71# CONFIG_NET_NS is not set
64CONFIG_BLK_DEV_INITRD=y 72CONFIG_BLK_DEV_INITRD=y
65CONFIG_INITRAMFS_SOURCE="" 73CONFIG_INITRAMFS_SOURCE=""
74CONFIG_RD_GZIP=y
75CONFIG_RD_BZIP2=y
76CONFIG_RD_LZMA=y
66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
67CONFIG_SYSCTL=y 78CONFIG_SYSCTL=y
79CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set 80# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y 81CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y 82CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y 83CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set 84# CONFIG_KALLSYMS_ALL is not set
73# CONFIG_KALLSYMS_EXTRA_PASS is not set 85# CONFIG_KALLSYMS_EXTRA_PASS is not set
86# CONFIG_STRIP_ASM_SYMS is not set
74CONFIG_HOTPLUG=y 87CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y 88CONFIG_PRINTK=y
76CONFIG_BUG=y 89CONFIG_BUG=y
77CONFIG_ELF_CORE=y 90CONFIG_ELF_CORE=y
78CONFIG_COMPAT_BRK=y
79CONFIG_BASE_FULL=y 91CONFIG_BASE_FULL=y
80CONFIG_FUTEX=y 92CONFIG_FUTEX=y
81CONFIG_ANON_INODES=y
82CONFIG_EPOLL=y 93CONFIG_EPOLL=y
83CONFIG_SIGNALFD=y 94CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y 95CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y 96CONFIG_EVENTFD=y
86CONFIG_SHMEM=y 97CONFIG_SHMEM=y
98CONFIG_AIO=y
87CONFIG_VM_EVENT_COUNTERS=y 99CONFIG_VM_EVENT_COUNTERS=y
88CONFIG_SLUB_DEBUG=y 100CONFIG_SLUB_DEBUG=y
101CONFIG_COMPAT_BRK=y
89# CONFIG_SLAB is not set 102# CONFIG_SLAB is not set
90CONFIG_SLUB=y 103CONFIG_SLUB=y
91# CONFIG_SLOB is not set 104# CONFIG_SLOB is not set
@@ -93,19 +106,13 @@ CONFIG_SLUB=y
93# CONFIG_MARKERS is not set 106# CONFIG_MARKERS is not set
94CONFIG_HAVE_OPROFILE=y 107CONFIG_HAVE_OPROFILE=y
95# CONFIG_KPROBES is not set 108# CONFIG_KPROBES is not set
96# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
97# CONFIG_HAVE_IOREMAP_PROT is not set
98CONFIG_HAVE_KPROBES=y 109CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y 110CONFIG_HAVE_KRETPROBES=y
100# CONFIG_HAVE_ARCH_TRACEHOOK is not set
101# CONFIG_HAVE_DMA_ATTRS is not set
102# CONFIG_USE_GENERIC_SMP_HELPERS is not set
103CONFIG_HAVE_CLK=y 111CONFIG_HAVE_CLK=y
104CONFIG_PROC_PAGE_MONITOR=y 112# CONFIG_SLOW_WORK is not set
105CONFIG_HAVE_GENERIC_DMA_COHERENT=y 113CONFIG_HAVE_GENERIC_DMA_COHERENT=y
106CONFIG_SLABINFO=y 114CONFIG_SLABINFO=y
107CONFIG_RT_MUTEXES=y 115CONFIG_RT_MUTEXES=y
108# CONFIG_TINY_SHMEM is not set
109CONFIG_BASE_SMALL=0 116CONFIG_BASE_SMALL=0
110CONFIG_MODULES=y 117CONFIG_MODULES=y
111# CONFIG_MODULE_FORCE_LOAD is not set 118# CONFIG_MODULE_FORCE_LOAD is not set
@@ -113,11 +120,8 @@ CONFIG_MODULE_UNLOAD=y
113# CONFIG_MODULE_FORCE_UNLOAD is not set 120# CONFIG_MODULE_FORCE_UNLOAD is not set
114# CONFIG_MODVERSIONS is not set 121# CONFIG_MODVERSIONS is not set
115# CONFIG_MODULE_SRCVERSION_ALL is not set 122# CONFIG_MODULE_SRCVERSION_ALL is not set
116CONFIG_KMOD=y
117CONFIG_BLOCK=y 123CONFIG_BLOCK=y
118# CONFIG_LBD is not set 124# CONFIG_LBD is not set
119# CONFIG_BLK_DEV_IO_TRACE is not set
120# CONFIG_LSF is not set
121# CONFIG_BLK_DEV_BSG is not set 125# CONFIG_BLK_DEV_BSG is not set
122# CONFIG_BLK_DEV_INTEGRITY is not set 126# CONFIG_BLK_DEV_INTEGRITY is not set
123 127
@@ -133,7 +137,7 @@ CONFIG_IOSCHED_CFQ=y
133CONFIG_DEFAULT_CFQ=y 137CONFIG_DEFAULT_CFQ=y
134# CONFIG_DEFAULT_NOOP is not set 138# CONFIG_DEFAULT_NOOP is not set
135CONFIG_DEFAULT_IOSCHED="cfq" 139CONFIG_DEFAULT_IOSCHED="cfq"
136CONFIG_CLASSIC_RCU=y 140CONFIG_FREEZER=y
137 141
138# 142#
139# System Type 143# System Type
@@ -143,10 +147,10 @@ CONFIG_CLASSIC_RCU=y
143# CONFIG_ARCH_REALVIEW is not set 147# CONFIG_ARCH_REALVIEW is not set
144# CONFIG_ARCH_VERSATILE is not set 148# CONFIG_ARCH_VERSATILE is not set
145# CONFIG_ARCH_AT91 is not set 149# CONFIG_ARCH_AT91 is not set
146# CONFIG_ARCH_CLPS7500 is not set
147# CONFIG_ARCH_CLPS711X is not set 150# CONFIG_ARCH_CLPS711X is not set
148# CONFIG_ARCH_EBSA110 is not set 151# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set 152# CONFIG_ARCH_EP93XX is not set
153# CONFIG_ARCH_GEMINI is not set
150# CONFIG_ARCH_FOOTBRIDGE is not set 154# CONFIG_ARCH_FOOTBRIDGE is not set
151# CONFIG_ARCH_NETX is not set 155# CONFIG_ARCH_NETX is not set
152# CONFIG_ARCH_H720X is not set 156# CONFIG_ARCH_H720X is not set
@@ -167,14 +171,17 @@ CONFIG_CLASSIC_RCU=y
167# CONFIG_ARCH_ORION5X is not set 171# CONFIG_ARCH_ORION5X is not set
168# CONFIG_ARCH_PNX4008 is not set 172# CONFIG_ARCH_PNX4008 is not set
169CONFIG_ARCH_PXA=y 173CONFIG_ARCH_PXA=y
174# CONFIG_ARCH_MMP is not set
170# CONFIG_ARCH_RPC is not set 175# CONFIG_ARCH_RPC is not set
171# CONFIG_ARCH_SA1100 is not set 176# CONFIG_ARCH_SA1100 is not set
172# CONFIG_ARCH_S3C2410 is not set 177# CONFIG_ARCH_S3C2410 is not set
178# CONFIG_ARCH_S3C64XX is not set
173# CONFIG_ARCH_SHARK is not set 179# CONFIG_ARCH_SHARK is not set
174# CONFIG_ARCH_LH7A40X is not set 180# CONFIG_ARCH_LH7A40X is not set
175# CONFIG_ARCH_DAVINCI is not set 181# CONFIG_ARCH_DAVINCI is not set
176# CONFIG_ARCH_OMAP is not set 182# CONFIG_ARCH_OMAP is not set
177# CONFIG_ARCH_MSM7X00A is not set 183# CONFIG_ARCH_MSM is not set
184# CONFIG_ARCH_W90X900 is not set
178 185
179# 186#
180# Intel PXA2xx/PXA3xx Implementations 187# Intel PXA2xx/PXA3xx Implementations
@@ -187,16 +194,24 @@ CONFIG_CPU_PXA300=y
187# CONFIG_CPU_PXA310 is not set 194# CONFIG_CPU_PXA310 is not set
188# CONFIG_CPU_PXA320 is not set 195# CONFIG_CPU_PXA320 is not set
189# CONFIG_CPU_PXA930 is not set 196# CONFIG_CPU_PXA930 is not set
197# CONFIG_CPU_PXA935 is not set
190# CONFIG_ARCH_GUMSTIX is not set 198# CONFIG_ARCH_GUMSTIX is not set
199# CONFIG_MACH_INTELMOTE2 is not set
191# CONFIG_ARCH_LUBBOCK is not set 200# CONFIG_ARCH_LUBBOCK is not set
192# CONFIG_MACH_LOGICPD_PXA270 is not set 201# CONFIG_MACH_LOGICPD_PXA270 is not set
193# CONFIG_MACH_MAINSTONE is not set 202# CONFIG_MACH_MAINSTONE is not set
203# CONFIG_MACH_MP900C is not set
194# CONFIG_ARCH_PXA_IDP is not set 204# CONFIG_ARCH_PXA_IDP is not set
195# CONFIG_PXA_SHARPSL is not set 205# CONFIG_PXA_SHARPSL is not set
206# CONFIG_ARCH_VIPER is not set
196# CONFIG_ARCH_PXA_ESERIES is not set 207# CONFIG_ARCH_PXA_ESERIES is not set
197# CONFIG_MACH_TRIZEPS4 is not set 208# CONFIG_TRIZEPS_PXA is not set
209# CONFIG_MACH_H5000 is not set
198# CONFIG_MACH_EM_X270 is not set 210# CONFIG_MACH_EM_X270 is not set
211# CONFIG_MACH_EXEDA is not set
199# CONFIG_MACH_COLIBRI is not set 212# CONFIG_MACH_COLIBRI is not set
213# CONFIG_MACH_COLIBRI300 is not set
214# CONFIG_MACH_COLIBRI320 is not set
200# CONFIG_MACH_ZYLONITE is not set 215# CONFIG_MACH_ZYLONITE is not set
201# CONFIG_MACH_LITTLETON is not set 216# CONFIG_MACH_LITTLETON is not set
202# CONFIG_MACH_TAVOREVB is not set 217# CONFIG_MACH_TAVOREVB is not set
@@ -204,19 +219,15 @@ CONFIG_CPU_PXA300=y
204# CONFIG_MACH_ARMCORE is not set 219# CONFIG_MACH_ARMCORE is not set
205CONFIG_MACH_CM_X300=y 220CONFIG_MACH_CM_X300=y
206# CONFIG_MACH_MAGICIAN is not set 221# CONFIG_MACH_MAGICIAN is not set
222# CONFIG_MACH_HIMALAYA is not set
223# CONFIG_MACH_MIOA701 is not set
207# CONFIG_MACH_PCM027 is not set 224# CONFIG_MACH_PCM027 is not set
208# CONFIG_ARCH_PXA_PALM is not set 225# CONFIG_ARCH_PXA_PALM is not set
226# CONFIG_MACH_CSB726 is not set
209# CONFIG_PXA_EZX is not set 227# CONFIG_PXA_EZX is not set
210CONFIG_PXA3xx=y 228CONFIG_PXA3xx=y
211# CONFIG_PXA_PWM is not set 229# CONFIG_PXA_PWM is not set
212 230CONFIG_PLAT_PXA=y
213#
214# Boot options
215#
216
217#
218# Power management
219#
220 231
221# 232#
222# Processor Type 233# Processor Type
@@ -241,6 +252,7 @@ CONFIG_IO_36=y
241CONFIG_OUTER_CACHE=y 252CONFIG_OUTER_CACHE=y
242CONFIG_CACHE_XSC3L2=y 253CONFIG_CACHE_XSC3L2=y
243CONFIG_IWMMXT=y 254CONFIG_IWMMXT=y
255CONFIG_COMMON_CLKDEV=y
244 256
245# 257#
246# Bus support 258# Bus support
@@ -256,25 +268,33 @@ CONFIG_TICK_ONESHOT=y
256CONFIG_NO_HZ=y 268CONFIG_NO_HZ=y
257# CONFIG_HIGH_RES_TIMERS is not set 269# CONFIG_HIGH_RES_TIMERS is not set
258CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 270CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
271CONFIG_VMSPLIT_3G=y
272# CONFIG_VMSPLIT_2G is not set
273# CONFIG_VMSPLIT_1G is not set
274CONFIG_PAGE_OFFSET=0xC0000000
259# CONFIG_PREEMPT is not set 275# CONFIG_PREEMPT is not set
260CONFIG_HZ=100 276CONFIG_HZ=100
261CONFIG_AEABI=y 277CONFIG_AEABI=y
262CONFIG_OABI_COMPAT=y 278CONFIG_OABI_COMPAT=y
263# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 279# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
280# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
281# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
282CONFIG_HIGHMEM=y
264CONFIG_SELECT_MEMORY_MODEL=y 283CONFIG_SELECT_MEMORY_MODEL=y
265CONFIG_FLATMEM_MANUAL=y 284CONFIG_FLATMEM_MANUAL=y
266# CONFIG_DISCONTIGMEM_MANUAL is not set 285# CONFIG_DISCONTIGMEM_MANUAL is not set
267# CONFIG_SPARSEMEM_MANUAL is not set 286# CONFIG_SPARSEMEM_MANUAL is not set
268CONFIG_FLATMEM=y 287CONFIG_FLATMEM=y
269CONFIG_FLAT_NODE_MEM_MAP=y 288CONFIG_FLAT_NODE_MEM_MAP=y
270# CONFIG_SPARSEMEM_STATIC is not set
271# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
272CONFIG_PAGEFLAGS_EXTENDED=y 289CONFIG_PAGEFLAGS_EXTENDED=y
273CONFIG_SPLIT_PTLOCK_CPUS=4096 290CONFIG_SPLIT_PTLOCK_CPUS=4096
274# CONFIG_RESOURCES_64BIT is not set 291# CONFIG_PHYS_ADDR_T_64BIT is not set
275CONFIG_ZONE_DMA_FLAG=1 292CONFIG_ZONE_DMA_FLAG=0
276CONFIG_BOUNCE=y 293CONFIG_BOUNCE=y
277CONFIG_VIRT_TO_BUS=y 294CONFIG_VIRT_TO_BUS=y
295CONFIG_UNEVICTABLE_LRU=y
296CONFIG_HAVE_MLOCK=y
297CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278CONFIG_ALIGNMENT_TRAP=y 298CONFIG_ALIGNMENT_TRAP=y
279 299
280# 300#
@@ -287,7 +307,7 @@ CONFIG_CMDLINE="root=/dev/mtdblock5 rootfstype=jffs2 console=ttyS2,38400"
287# CONFIG_KEXEC is not set 307# CONFIG_KEXEC is not set
288 308
289# 309#
290# CPU Frequency scaling 310# CPU Power Management
291# 311#
292CONFIG_CPU_FREQ=y 312CONFIG_CPU_FREQ=y
293CONFIG_CPU_FREQ_TABLE=y 313CONFIG_CPU_FREQ_TABLE=y
@@ -304,6 +324,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
304CONFIG_CPU_FREQ_GOV_USERSPACE=y 324CONFIG_CPU_FREQ_GOV_USERSPACE=y
305# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 325# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
306# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set 326# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
327# CONFIG_CPU_IDLE is not set
307 328
308# 329#
309# Floating point emulation 330# Floating point emulation
@@ -320,6 +341,8 @@ CONFIG_FPE_NWFPE=y
320# Userspace binary formats 341# Userspace binary formats
321# 342#
322CONFIG_BINFMT_ELF=y 343CONFIG_BINFMT_ELF=y
344# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
345CONFIG_HAVE_AOUT=y
323# CONFIG_BINFMT_AOUT is not set 346# CONFIG_BINFMT_AOUT is not set
324# CONFIG_BINFMT_MISC is not set 347# CONFIG_BINFMT_MISC is not set
325 348
@@ -376,6 +399,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
376# CONFIG_TIPC is not set 399# CONFIG_TIPC is not set
377# CONFIG_ATM is not set 400# CONFIG_ATM is not set
378# CONFIG_BRIDGE is not set 401# CONFIG_BRIDGE is not set
402# CONFIG_NET_DSA is not set
379# CONFIG_VLAN_8021Q is not set 403# CONFIG_VLAN_8021Q is not set
380# CONFIG_DECNET is not set 404# CONFIG_DECNET is not set
381# CONFIG_LLC2 is not set 405# CONFIG_LLC2 is not set
@@ -385,7 +409,9 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
385# CONFIG_LAPB is not set 409# CONFIG_LAPB is not set
386# CONFIG_ECONET is not set 410# CONFIG_ECONET is not set
387# CONFIG_WAN_ROUTER is not set 411# CONFIG_WAN_ROUTER is not set
412# CONFIG_PHONET is not set
388# CONFIG_NET_SCHED is not set 413# CONFIG_NET_SCHED is not set
414# CONFIG_DCB is not set
389 415
390# 416#
391# Network testing 417# Network testing
@@ -407,8 +433,7 @@ CONFIG_BT_HIDP=m
407# 433#
408# Bluetooth device drivers 434# Bluetooth device drivers
409# 435#
410CONFIG_BT_HCIUSB=m 436# CONFIG_BT_HCIBTUSB is not set
411CONFIG_BT_HCIUSB_SCO=y
412# CONFIG_BT_HCIBTSDIO is not set 437# CONFIG_BT_HCIBTSDIO is not set
413# CONFIG_BT_HCIUART is not set 438# CONFIG_BT_HCIUART is not set
414# CONFIG_BT_HCIBCM203X is not set 439# CONFIG_BT_HCIBCM203X is not set
@@ -416,19 +441,15 @@ CONFIG_BT_HCIUSB_SCO=y
416# CONFIG_BT_HCIBFUSB is not set 441# CONFIG_BT_HCIBFUSB is not set
417# CONFIG_BT_HCIVHCI is not set 442# CONFIG_BT_HCIVHCI is not set
418# CONFIG_AF_RXRPC is not set 443# CONFIG_AF_RXRPC is not set
419 444CONFIG_WIRELESS=y
420#
421# Wireless
422#
423# CONFIG_CFG80211 is not set 445# CONFIG_CFG80211 is not set
446# CONFIG_WIRELESS_OLD_REGULATORY is not set
424CONFIG_WIRELESS_EXT=y 447CONFIG_WIRELESS_EXT=y
425CONFIG_WIRELESS_EXT_SYSFS=y 448CONFIG_WIRELESS_EXT_SYSFS=y
449CONFIG_LIB80211=m
450# CONFIG_LIB80211_DEBUG is not set
426# CONFIG_MAC80211 is not set 451# CONFIG_MAC80211 is not set
427CONFIG_IEEE80211=m 452# CONFIG_WIMAX is not set
428# CONFIG_IEEE80211_DEBUG is not set
429CONFIG_IEEE80211_CRYPT_WEP=m
430CONFIG_IEEE80211_CRYPT_CCMP=m
431CONFIG_IEEE80211_CRYPT_TKIP=m
432# CONFIG_RFKILL is not set 453# CONFIG_RFKILL is not set
433# CONFIG_NET_9P is not set 454# CONFIG_NET_9P is not set
434 455
@@ -453,6 +474,7 @@ CONFIG_MTD=y
453# CONFIG_MTD_DEBUG is not set 474# CONFIG_MTD_DEBUG is not set
454# CONFIG_MTD_CONCAT is not set 475# CONFIG_MTD_CONCAT is not set
455CONFIG_MTD_PARTITIONS=y 476CONFIG_MTD_PARTITIONS=y
477# CONFIG_MTD_TESTS is not set
456# CONFIG_MTD_REDBOOT_PARTS is not set 478# CONFIG_MTD_REDBOOT_PARTS is not set
457# CONFIG_MTD_CMDLINE_PARTS is not set 479# CONFIG_MTD_CMDLINE_PARTS is not set
458# CONFIG_MTD_AFS_PARTS is not set 480# CONFIG_MTD_AFS_PARTS is not set
@@ -494,7 +516,6 @@ CONFIG_MTD_CFI_I2=y
494# Mapping drivers for chip access 516# Mapping drivers for chip access
495# 517#
496# CONFIG_MTD_COMPLEX_MAPPINGS is not set 518# CONFIG_MTD_COMPLEX_MAPPINGS is not set
497# CONFIG_MTD_SHARP_SL is not set
498# CONFIG_MTD_PLATRAM is not set 519# CONFIG_MTD_PLATRAM is not set
499 520
500# 521#
@@ -516,16 +537,23 @@ CONFIG_MTD_NAND=y
516# CONFIG_MTD_NAND_ECC_SMC is not set 537# CONFIG_MTD_NAND_ECC_SMC is not set
517# CONFIG_MTD_NAND_MUSEUM_IDS is not set 538# CONFIG_MTD_NAND_MUSEUM_IDS is not set
518# CONFIG_MTD_NAND_H1900 is not set 539# CONFIG_MTD_NAND_H1900 is not set
540# CONFIG_MTD_NAND_GPIO is not set
519CONFIG_MTD_NAND_IDS=y 541CONFIG_MTD_NAND_IDS=y
520# CONFIG_MTD_NAND_DISKONCHIP is not set 542# CONFIG_MTD_NAND_DISKONCHIP is not set
521# CONFIG_MTD_NAND_SHARPSL is not set 543# CONFIG_MTD_NAND_SHARPSL is not set
522CONFIG_MTD_NAND_PXA3xx=y 544CONFIG_MTD_NAND_PXA3xx=y
545# CONFIG_MTD_NAND_PXA3xx_BUILTIN is not set
523# CONFIG_MTD_NAND_NANDSIM is not set 546# CONFIG_MTD_NAND_NANDSIM is not set
524# CONFIG_MTD_NAND_PLATFORM is not set 547# CONFIG_MTD_NAND_PLATFORM is not set
525# CONFIG_MTD_ALAUDA is not set 548# CONFIG_MTD_ALAUDA is not set
526# CONFIG_MTD_ONENAND is not set 549# CONFIG_MTD_ONENAND is not set
527 550
528# 551#
552# LPDDR flash memory drivers
553#
554# CONFIG_MTD_LPDDR is not set
555
556#
529# UBI - Unsorted block images 557# UBI - Unsorted block images
530# 558#
531# CONFIG_MTD_UBI is not set 559# CONFIG_MTD_UBI is not set
@@ -585,11 +613,15 @@ CONFIG_SCSI_WAIT_SCAN=m
585# CONFIG_SCSI_SRP_ATTRS is not set 613# CONFIG_SCSI_SRP_ATTRS is not set
586CONFIG_SCSI_LOWLEVEL=y 614CONFIG_SCSI_LOWLEVEL=y
587# CONFIG_ISCSI_TCP is not set 615# CONFIG_ISCSI_TCP is not set
616# CONFIG_LIBFC is not set
617# CONFIG_LIBFCOE is not set
588# CONFIG_SCSI_DEBUG is not set 618# CONFIG_SCSI_DEBUG is not set
589# CONFIG_SCSI_DH is not set 619# CONFIG_SCSI_DH is not set
620# CONFIG_SCSI_OSD_INITIATOR is not set
590# CONFIG_ATA is not set 621# CONFIG_ATA is not set
591# CONFIG_MD is not set 622# CONFIG_MD is not set
592CONFIG_NETDEVICES=y 623CONFIG_NETDEVICES=y
624CONFIG_COMPAT_NET_DEV_OPS=y
593# CONFIG_DUMMY is not set 625# CONFIG_DUMMY is not set
594# CONFIG_BONDING is not set 626# CONFIG_BONDING is not set
595# CONFIG_MACVLAN is not set 627# CONFIG_MACVLAN is not set
@@ -604,11 +636,17 @@ CONFIG_MII=y
604CONFIG_DM9000=y 636CONFIG_DM9000=y
605CONFIG_DM9000_DEBUGLEVEL=0 637CONFIG_DM9000_DEBUGLEVEL=0
606CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y 638CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y
639# CONFIG_ETHOC is not set
607# CONFIG_SMC911X is not set 640# CONFIG_SMC911X is not set
641# CONFIG_SMSC911X is not set
642# CONFIG_DNET is not set
608# CONFIG_IBM_NEW_EMAC_ZMII is not set 643# CONFIG_IBM_NEW_EMAC_ZMII is not set
609# CONFIG_IBM_NEW_EMAC_RGMII is not set 644# CONFIG_IBM_NEW_EMAC_RGMII is not set
610# CONFIG_IBM_NEW_EMAC_TAH is not set 645# CONFIG_IBM_NEW_EMAC_TAH is not set
611# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 646# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
647# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
648# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
649# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
612# CONFIG_B44 is not set 650# CONFIG_B44 is not set
613# CONFIG_NETDEV_1000 is not set 651# CONFIG_NETDEV_1000 is not set
614# CONFIG_NETDEV_10000 is not set 652# CONFIG_NETDEV_10000 is not set
@@ -624,10 +662,13 @@ CONFIG_LIBERTAS_SDIO=m
624# CONFIG_LIBERTAS_DEBUG is not set 662# CONFIG_LIBERTAS_DEBUG is not set
625# CONFIG_USB_ZD1201 is not set 663# CONFIG_USB_ZD1201 is not set
626# CONFIG_USB_NET_RNDIS_WLAN is not set 664# CONFIG_USB_NET_RNDIS_WLAN is not set
627# CONFIG_IWLWIFI_LEDS is not set
628# CONFIG_HOSTAP is not set 665# CONFIG_HOSTAP is not set
629 666
630# 667#
668# Enable WiMAX (Networking options) to see the WiMAX drivers
669#
670
671#
631# USB Network Adapters 672# USB Network Adapters
632# 673#
633# CONFIG_USB_CATC is not set 674# CONFIG_USB_CATC is not set
@@ -677,18 +718,21 @@ CONFIG_KEYBOARD_PXA27x=m
677# CONFIG_INPUT_JOYSTICK is not set 718# CONFIG_INPUT_JOYSTICK is not set
678# CONFIG_INPUT_TABLET is not set 719# CONFIG_INPUT_TABLET is not set
679CONFIG_INPUT_TOUCHSCREEN=y 720CONFIG_INPUT_TOUCHSCREEN=y
721# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
722# CONFIG_TOUCHSCREEN_AD7879 is not set
680# CONFIG_TOUCHSCREEN_FUJITSU is not set 723# CONFIG_TOUCHSCREEN_FUJITSU is not set
681# CONFIG_TOUCHSCREEN_GUNZE is not set 724# CONFIG_TOUCHSCREEN_GUNZE is not set
682# CONFIG_TOUCHSCREEN_ELO is not set 725# CONFIG_TOUCHSCREEN_ELO is not set
726# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
683# CONFIG_TOUCHSCREEN_MTOUCH is not set 727# CONFIG_TOUCHSCREEN_MTOUCH is not set
684# CONFIG_TOUCHSCREEN_INEXIO is not set 728# CONFIG_TOUCHSCREEN_INEXIO is not set
685# CONFIG_TOUCHSCREEN_MK712 is not set 729# CONFIG_TOUCHSCREEN_MK712 is not set
686# CONFIG_TOUCHSCREEN_PENMOUNT is not set 730# CONFIG_TOUCHSCREEN_PENMOUNT is not set
687# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 731# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
688# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 732# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
689# CONFIG_TOUCHSCREEN_UCB1400 is not set
690# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 733# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
691# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 734# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
735# CONFIG_TOUCHSCREEN_TSC2007 is not set
692# CONFIG_INPUT_MISC is not set 736# CONFIG_INPUT_MISC is not set
693 737
694# 738#
@@ -721,10 +765,10 @@ CONFIG_SERIAL_PXA_CONSOLE=y
721CONFIG_SERIAL_CORE=y 765CONFIG_SERIAL_CORE=y
722CONFIG_SERIAL_CORE_CONSOLE=y 766CONFIG_SERIAL_CORE_CONSOLE=y
723CONFIG_UNIX98_PTYS=y 767CONFIG_UNIX98_PTYS=y
768# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
724# CONFIG_LEGACY_PTYS is not set 769# CONFIG_LEGACY_PTYS is not set
725# CONFIG_IPMI_HANDLER is not set 770# CONFIG_IPMI_HANDLER is not set
726# CONFIG_HW_RANDOM is not set 771# CONFIG_HW_RANDOM is not set
727# CONFIG_NVRAM is not set
728# CONFIG_R3964 is not set 772# CONFIG_R3964 is not set
729# CONFIG_RAW_DRIVER is not set 773# CONFIG_RAW_DRIVER is not set
730# CONFIG_TCG_TPM is not set 774# CONFIG_TCG_TPM is not set
@@ -763,12 +807,8 @@ CONFIG_I2C_PXA=y
763# Miscellaneous I2C Chip support 807# Miscellaneous I2C Chip support
764# 808#
765# CONFIG_DS1682 is not set 809# CONFIG_DS1682 is not set
766# CONFIG_EEPROM_AT24 is not set
767# CONFIG_EEPROM_LEGACY is not set
768# CONFIG_SENSORS_PCF8574 is not set 810# CONFIG_SENSORS_PCF8574 is not set
769# CONFIG_PCF8575 is not set 811# CONFIG_PCF8575 is not set
770# CONFIG_SENSORS_PCF8591 is not set
771# CONFIG_TPS65010 is not set
772# CONFIG_SENSORS_MAX6875 is not set 812# CONFIG_SENSORS_MAX6875 is not set
773# CONFIG_SENSORS_TSL2550 is not set 813# CONFIG_SENSORS_TSL2550 is not set
774# CONFIG_I2C_DEBUG_CORE is not set 814# CONFIG_I2C_DEBUG_CORE is not set
@@ -782,6 +822,10 @@ CONFIG_GPIOLIB=y
782# CONFIG_GPIO_SYSFS is not set 822# CONFIG_GPIO_SYSFS is not set
783 823
784# 824#
825# Memory mapped GPIO expanders:
826#
827
828#
785# I2C GPIO expanders: 829# I2C GPIO expanders:
786# 830#
787# CONFIG_GPIO_MAX732X is not set 831# CONFIG_GPIO_MAX732X is not set
@@ -798,12 +842,14 @@ CONFIG_GPIO_PCA953X=y
798# CONFIG_W1 is not set 842# CONFIG_W1 is not set
799# CONFIG_POWER_SUPPLY is not set 843# CONFIG_POWER_SUPPLY is not set
800# CONFIG_HWMON is not set 844# CONFIG_HWMON is not set
845# CONFIG_THERMAL is not set
846# CONFIG_THERMAL_HWMON is not set
801# CONFIG_WATCHDOG is not set 847# CONFIG_WATCHDOG is not set
848CONFIG_SSB_POSSIBLE=y
802 849
803# 850#
804# Sonics Silicon Backplane 851# Sonics Silicon Backplane
805# 852#
806CONFIG_SSB_POSSIBLE=y
807# CONFIG_SSB is not set 853# CONFIG_SSB is not set
808 854
809# 855#
@@ -811,12 +857,19 @@ CONFIG_SSB_POSSIBLE=y
811# 857#
812# CONFIG_MFD_CORE is not set 858# CONFIG_MFD_CORE is not set
813# CONFIG_MFD_SM501 is not set 859# CONFIG_MFD_SM501 is not set
860# CONFIG_MFD_ASIC3 is not set
814# CONFIG_HTC_EGPIO is not set 861# CONFIG_HTC_EGPIO is not set
815# CONFIG_HTC_PASIC3 is not set 862# CONFIG_HTC_PASIC3 is not set
863# CONFIG_TPS65010 is not set
864# CONFIG_TWL4030_CORE is not set
816# CONFIG_MFD_TMIO is not set 865# CONFIG_MFD_TMIO is not set
817# CONFIG_MFD_T7L66XB is not set 866# CONFIG_MFD_T7L66XB is not set
818# CONFIG_MFD_TC6387XB is not set 867# CONFIG_MFD_TC6387XB is not set
819# CONFIG_MFD_TC6393XB is not set 868# CONFIG_MFD_TC6393XB is not set
869# CONFIG_PMIC_DA903X is not set
870# CONFIG_MFD_WM8400 is not set
871# CONFIG_MFD_WM8350_I2C is not set
872# CONFIG_MFD_PCF50633 is not set
820 873
821# 874#
822# Multimedia devices 875# Multimedia devices
@@ -842,6 +895,7 @@ CONFIG_SSB_POSSIBLE=y
842CONFIG_FB=y 895CONFIG_FB=y
843# CONFIG_FIRMWARE_EDID is not set 896# CONFIG_FIRMWARE_EDID is not set
844# CONFIG_FB_DDC is not set 897# CONFIG_FB_DDC is not set
898# CONFIG_FB_BOOT_VESA_SUPPORT is not set
845CONFIG_FB_CFB_FILLRECT=y 899CONFIG_FB_CFB_FILLRECT=y
846CONFIG_FB_CFB_COPYAREA=y 900CONFIG_FB_CFB_COPYAREA=y
847CONFIG_FB_CFB_IMAGEBLIT=y 901CONFIG_FB_CFB_IMAGEBLIT=y
@@ -862,12 +916,15 @@ CONFIG_FB_CFB_IMAGEBLIT=y
862# 916#
863# CONFIG_FB_S1D13XXX is not set 917# CONFIG_FB_S1D13XXX is not set
864CONFIG_FB_PXA=y 918CONFIG_FB_PXA=y
919# CONFIG_FB_PXA_OVERLAY is not set
865# CONFIG_FB_PXA_SMARTPANEL is not set 920# CONFIG_FB_PXA_SMARTPANEL is not set
866# CONFIG_FB_PXA_PARAMETERS is not set 921# CONFIG_FB_PXA_PARAMETERS is not set
867# CONFIG_FB_MBX is not set 922# CONFIG_FB_MBX is not set
868# CONFIG_FB_W100 is not set 923# CONFIG_FB_W100 is not set
869# CONFIG_FB_AM200EPD is not set
870# CONFIG_FB_VIRTUAL is not set 924# CONFIG_FB_VIRTUAL is not set
925# CONFIG_FB_METRONOME is not set
926# CONFIG_FB_MB862XX is not set
927# CONFIG_FB_BROADSHEET is not set
871# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 928# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
872 929
873# 930#
@@ -899,9 +956,11 @@ CONFIG_LOGO_LINUX_MONO=y
899CONFIG_LOGO_LINUX_VGA16=y 956CONFIG_LOGO_LINUX_VGA16=y
900CONFIG_LOGO_LINUX_CLUT224=y 957CONFIG_LOGO_LINUX_CLUT224=y
901CONFIG_SOUND=m 958CONFIG_SOUND=m
959# CONFIG_SOUND_OSS_CORE is not set
902CONFIG_SND=m 960CONFIG_SND=m
903CONFIG_SND_TIMER=m 961CONFIG_SND_TIMER=m
904CONFIG_SND_PCM=m 962CONFIG_SND_PCM=m
963CONFIG_SND_JACK=y
905# CONFIG_SND_SEQUENCER is not set 964# CONFIG_SND_SEQUENCER is not set
906# CONFIG_SND_MIXER_OSS is not set 965# CONFIG_SND_MIXER_OSS is not set
907# CONFIG_SND_PCM_OSS is not set 966# CONFIG_SND_PCM_OSS is not set
@@ -916,12 +975,15 @@ CONFIG_SND_DRIVERS=y
916# CONFIG_SND_SERIAL_U16550 is not set 975# CONFIG_SND_SERIAL_U16550 is not set
917# CONFIG_SND_MPU401 is not set 976# CONFIG_SND_MPU401 is not set
918CONFIG_SND_ARM=y 977CONFIG_SND_ARM=y
978CONFIG_SND_PXA2XX_LIB=m
919# CONFIG_SND_PXA2XX_AC97 is not set 979# CONFIG_SND_PXA2XX_AC97 is not set
920CONFIG_SND_USB=y 980CONFIG_SND_USB=y
921# CONFIG_SND_USB_AUDIO is not set 981# CONFIG_SND_USB_AUDIO is not set
922# CONFIG_SND_USB_CAIAQ is not set 982# CONFIG_SND_USB_CAIAQ is not set
923CONFIG_SND_SOC=m 983CONFIG_SND_SOC=m
924CONFIG_SND_PXA2XX_SOC=m 984CONFIG_SND_PXA2XX_SOC=m
985CONFIG_SND_SOC_I2C_AND_SPI=m
986# CONFIG_SND_SOC_ALL_CODECS is not set
925# CONFIG_SOUND_PRIME is not set 987# CONFIG_SOUND_PRIME is not set
926CONFIG_HID_SUPPORT=y 988CONFIG_HID_SUPPORT=y
927CONFIG_HID=y 989CONFIG_HID=y
@@ -932,9 +994,39 @@ CONFIG_HID_DEBUG=y
932# USB Input Devices 994# USB Input Devices
933# 995#
934CONFIG_USB_HID=y 996CONFIG_USB_HID=y
935# CONFIG_USB_HIDINPUT_POWERBOOK is not set 997# CONFIG_HID_PID is not set
936# CONFIG_HID_FF is not set
937# CONFIG_USB_HIDDEV is not set 998# CONFIG_USB_HIDDEV is not set
999
1000#
1001# Special HID drivers
1002#
1003CONFIG_HID_A4TECH=y
1004CONFIG_HID_APPLE=y
1005CONFIG_HID_BELKIN=y
1006CONFIG_HID_CHERRY=y
1007CONFIG_HID_CHICONY=y
1008CONFIG_HID_CYPRESS=y
1009# CONFIG_DRAGONRISE_FF is not set
1010CONFIG_HID_EZKEY=y
1011CONFIG_HID_KYE=y
1012CONFIG_HID_GYRATION=y
1013CONFIG_HID_KENSINGTON=y
1014CONFIG_HID_LOGITECH=y
1015# CONFIG_LOGITECH_FF is not set
1016# CONFIG_LOGIRUMBLEPAD2_FF is not set
1017CONFIG_HID_MICROSOFT=y
1018CONFIG_HID_MONTEREY=y
1019CONFIG_HID_NTRIG=y
1020CONFIG_HID_PANTHERLORD=y
1021# CONFIG_PANTHERLORD_FF is not set
1022CONFIG_HID_PETALYNX=y
1023CONFIG_HID_SAMSUNG=y
1024CONFIG_HID_SONY=y
1025CONFIG_HID_SUNPLUS=y
1026# CONFIG_GREENASIA_FF is not set
1027CONFIG_HID_TOPSEED=y
1028# CONFIG_THRUSTMASTER_FF is not set
1029# CONFIG_ZEROPLUS_FF is not set
938CONFIG_USB_SUPPORT=y 1030CONFIG_USB_SUPPORT=y
939CONFIG_USB_ARCH_HAS_HCD=y 1031CONFIG_USB_ARCH_HAS_HCD=y
940CONFIG_USB_ARCH_HAS_OHCI=y 1032CONFIG_USB_ARCH_HAS_OHCI=y
@@ -952,11 +1044,14 @@ CONFIG_USB_DEVICEFS=y
952# CONFIG_USB_SUSPEND is not set 1044# CONFIG_USB_SUSPEND is not set
953# CONFIG_USB_OTG is not set 1045# CONFIG_USB_OTG is not set
954CONFIG_USB_MON=y 1046CONFIG_USB_MON=y
1047# CONFIG_USB_WUSB is not set
1048# CONFIG_USB_WUSB_CBAF is not set
955 1049
956# 1050#
957# USB Host Controller Drivers 1051# USB Host Controller Drivers
958# 1052#
959# CONFIG_USB_C67X00_HCD is not set 1053# CONFIG_USB_C67X00_HCD is not set
1054# CONFIG_USB_OXU210HP_HCD is not set
960# CONFIG_USB_ISP116X_HCD is not set 1055# CONFIG_USB_ISP116X_HCD is not set
961# CONFIG_USB_ISP1760_HCD is not set 1056# CONFIG_USB_ISP1760_HCD is not set
962CONFIG_USB_OHCI_HCD=y 1057CONFIG_USB_OHCI_HCD=y
@@ -965,6 +1060,7 @@ CONFIG_USB_OHCI_HCD=y
965CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1060CONFIG_USB_OHCI_LITTLE_ENDIAN=y
966# CONFIG_USB_SL811_HCD is not set 1061# CONFIG_USB_SL811_HCD is not set
967# CONFIG_USB_R8A66597_HCD is not set 1062# CONFIG_USB_R8A66597_HCD is not set
1063# CONFIG_USB_HWA_HCD is not set
968# CONFIG_USB_MUSB_HDRC is not set 1064# CONFIG_USB_MUSB_HDRC is not set
969 1065
970# 1066#
@@ -973,20 +1069,20 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
973# CONFIG_USB_ACM is not set 1069# CONFIG_USB_ACM is not set
974# CONFIG_USB_PRINTER is not set 1070# CONFIG_USB_PRINTER is not set
975# CONFIG_USB_WDM is not set 1071# CONFIG_USB_WDM is not set
1072# CONFIG_USB_TMC is not set
976 1073
977# 1074#
978# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1075# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
979# 1076#
980 1077
981# 1078#
982# may also be needed; see USB_STORAGE Help for more information 1079# also be needed; see USB_STORAGE Help for more info
983# 1080#
984CONFIG_USB_STORAGE=y 1081CONFIG_USB_STORAGE=y
985# CONFIG_USB_STORAGE_DEBUG is not set 1082# CONFIG_USB_STORAGE_DEBUG is not set
986# CONFIG_USB_STORAGE_DATAFAB is not set 1083# CONFIG_USB_STORAGE_DATAFAB is not set
987# CONFIG_USB_STORAGE_FREECOM is not set 1084# CONFIG_USB_STORAGE_FREECOM is not set
988# CONFIG_USB_STORAGE_ISD200 is not set 1085# CONFIG_USB_STORAGE_ISD200 is not set
989# CONFIG_USB_STORAGE_DPCM is not set
990# CONFIG_USB_STORAGE_USBAT is not set 1086# CONFIG_USB_STORAGE_USBAT is not set
991# CONFIG_USB_STORAGE_SDDR09 is not set 1087# CONFIG_USB_STORAGE_SDDR09 is not set
992# CONFIG_USB_STORAGE_SDDR55 is not set 1088# CONFIG_USB_STORAGE_SDDR55 is not set
@@ -994,7 +1090,6 @@ CONFIG_USB_STORAGE=y
994# CONFIG_USB_STORAGE_ALAUDA is not set 1090# CONFIG_USB_STORAGE_ALAUDA is not set
995# CONFIG_USB_STORAGE_ONETOUCH is not set 1091# CONFIG_USB_STORAGE_ONETOUCH is not set
996# CONFIG_USB_STORAGE_KARMA is not set 1092# CONFIG_USB_STORAGE_KARMA is not set
997# CONFIG_USB_STORAGE_SIERRA is not set
998# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set 1093# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
999# CONFIG_USB_LIBUSUAL is not set 1094# CONFIG_USB_LIBUSUAL is not set
1000 1095
@@ -1015,6 +1110,7 @@ CONFIG_USB_STORAGE=y
1015# CONFIG_USB_EMI62 is not set 1110# CONFIG_USB_EMI62 is not set
1016# CONFIG_USB_EMI26 is not set 1111# CONFIG_USB_EMI26 is not set
1017# CONFIG_USB_ADUTUX is not set 1112# CONFIG_USB_ADUTUX is not set
1113# CONFIG_USB_SEVSEG is not set
1018# CONFIG_USB_RIO500 is not set 1114# CONFIG_USB_RIO500 is not set
1019# CONFIG_USB_LEGOTOWER is not set 1115# CONFIG_USB_LEGOTOWER is not set
1020# CONFIG_USB_LCD is not set 1116# CONFIG_USB_LCD is not set
@@ -1022,7 +1118,6 @@ CONFIG_USB_STORAGE=y
1022# CONFIG_USB_LED is not set 1118# CONFIG_USB_LED is not set
1023# CONFIG_USB_CYPRESS_CY7C63 is not set 1119# CONFIG_USB_CYPRESS_CY7C63 is not set
1024# CONFIG_USB_CYTHERM is not set 1120# CONFIG_USB_CYTHERM is not set
1025# CONFIG_USB_PHIDGET is not set
1026# CONFIG_USB_IDMOUSE is not set 1121# CONFIG_USB_IDMOUSE is not set
1027# CONFIG_USB_FTDI_ELAN is not set 1122# CONFIG_USB_FTDI_ELAN is not set
1028# CONFIG_USB_APPLEDISPLAY is not set 1123# CONFIG_USB_APPLEDISPLAY is not set
@@ -1031,13 +1126,20 @@ CONFIG_USB_STORAGE=y
1031# CONFIG_USB_IOWARRIOR is not set 1126# CONFIG_USB_IOWARRIOR is not set
1032# CONFIG_USB_TEST is not set 1127# CONFIG_USB_TEST is not set
1033# CONFIG_USB_ISIGHTFW is not set 1128# CONFIG_USB_ISIGHTFW is not set
1129# CONFIG_USB_VST is not set
1034# CONFIG_USB_GADGET is not set 1130# CONFIG_USB_GADGET is not set
1131
1132#
1133# OTG and related infrastructure
1134#
1135# CONFIG_USB_GPIO_VBUS is not set
1136# CONFIG_NOP_USB_XCEIV is not set
1035CONFIG_MMC=m 1137CONFIG_MMC=m
1036# CONFIG_MMC_DEBUG is not set 1138# CONFIG_MMC_DEBUG is not set
1037# CONFIG_MMC_UNSAFE_RESUME is not set 1139# CONFIG_MMC_UNSAFE_RESUME is not set
1038 1140
1039# 1141#
1040# MMC/SD Card Drivers 1142# MMC/SD/SDIO Card Drivers
1041# 1143#
1042CONFIG_MMC_BLOCK=m 1144CONFIG_MMC_BLOCK=m
1043CONFIG_MMC_BLOCK_BOUNCE=y 1145CONFIG_MMC_BLOCK_BOUNCE=y
@@ -1045,10 +1147,12 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1045# CONFIG_MMC_TEST is not set 1147# CONFIG_MMC_TEST is not set
1046 1148
1047# 1149#
1048# MMC/SD Host Controller Drivers 1150# MMC/SD/SDIO Host Controller Drivers
1049# 1151#
1050CONFIG_MMC_PXA=m 1152CONFIG_MMC_PXA=m
1051# CONFIG_MMC_SDHCI is not set 1153# CONFIG_MMC_SDHCI is not set
1154# CONFIG_MEMSTICK is not set
1155# CONFIG_ACCESSIBILITY is not set
1052CONFIG_NEW_LEDS=y 1156CONFIG_NEW_LEDS=y
1053CONFIG_LEDS_CLASS=y 1157CONFIG_LEDS_CLASS=y
1054 1158
@@ -1057,7 +1161,10 @@ CONFIG_LEDS_CLASS=y
1057# 1161#
1058# CONFIG_LEDS_PCA9532 is not set 1162# CONFIG_LEDS_PCA9532 is not set
1059CONFIG_LEDS_GPIO=y 1163CONFIG_LEDS_GPIO=y
1164CONFIG_LEDS_GPIO_PLATFORM=y
1165# CONFIG_LEDS_LP5521 is not set
1060# CONFIG_LEDS_PCA955X is not set 1166# CONFIG_LEDS_PCA955X is not set
1167# CONFIG_LEDS_BD2802 is not set
1061 1168
1062# 1169#
1063# LED Triggers 1170# LED Triggers
@@ -1065,7 +1172,13 @@ CONFIG_LEDS_GPIO=y
1065CONFIG_LEDS_TRIGGERS=y 1172CONFIG_LEDS_TRIGGERS=y
1066# CONFIG_LEDS_TRIGGER_TIMER is not set 1173# CONFIG_LEDS_TRIGGER_TIMER is not set
1067CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1174CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1175# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1176# CONFIG_LEDS_TRIGGER_GPIO is not set
1068# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 1177# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1178
1179#
1180# iptables trigger is under Netfilter config (LED target)
1181#
1069CONFIG_RTC_LIB=y 1182CONFIG_RTC_LIB=y
1070CONFIG_RTC_CLASS=y 1183CONFIG_RTC_CLASS=y
1071CONFIG_RTC_HCTOSYS=y 1184CONFIG_RTC_HCTOSYS=y
@@ -1096,6 +1209,7 @@ CONFIG_RTC_INTF_DEV=y
1096# CONFIG_RTC_DRV_M41T80 is not set 1209# CONFIG_RTC_DRV_M41T80 is not set
1097# CONFIG_RTC_DRV_S35390A is not set 1210# CONFIG_RTC_DRV_S35390A is not set
1098# CONFIG_RTC_DRV_FM3130 is not set 1211# CONFIG_RTC_DRV_FM3130 is not set
1212# CONFIG_RTC_DRV_RX8581 is not set
1099 1213
1100# 1214#
1101# SPI RTC drivers 1215# SPI RTC drivers
@@ -1105,28 +1219,27 @@ CONFIG_RTC_INTF_DEV=y
1105# Platform RTC drivers 1219# Platform RTC drivers
1106# 1220#
1107# CONFIG_RTC_DRV_CMOS is not set 1221# CONFIG_RTC_DRV_CMOS is not set
1222# CONFIG_RTC_DRV_DS1286 is not set
1108# CONFIG_RTC_DRV_DS1511 is not set 1223# CONFIG_RTC_DRV_DS1511 is not set
1109# CONFIG_RTC_DRV_DS1553 is not set 1224# CONFIG_RTC_DRV_DS1553 is not set
1110# CONFIG_RTC_DRV_DS1742 is not set 1225# CONFIG_RTC_DRV_DS1742 is not set
1111# CONFIG_RTC_DRV_STK17TA8 is not set 1226# CONFIG_RTC_DRV_STK17TA8 is not set
1112# CONFIG_RTC_DRV_M48T86 is not set 1227# CONFIG_RTC_DRV_M48T86 is not set
1228# CONFIG_RTC_DRV_M48T35 is not set
1113# CONFIG_RTC_DRV_M48T59 is not set 1229# CONFIG_RTC_DRV_M48T59 is not set
1114# CONFIG_RTC_DRV_V3020 is not set 1230# CONFIG_RTC_DRV_BQ4802 is not set
1231CONFIG_RTC_DRV_V3020=y
1115 1232
1116# 1233#
1117# on-CPU RTC drivers 1234# on-CPU RTC drivers
1118# 1235#
1119CONFIG_RTC_DRV_SA1100=y 1236CONFIG_RTC_DRV_SA1100=y
1237# CONFIG_RTC_DRV_PXA is not set
1120# CONFIG_DMADEVICES is not set 1238# CONFIG_DMADEVICES is not set
1121 1239# CONFIG_AUXDISPLAY is not set
1122#
1123# Voltage and Current regulators
1124#
1125# CONFIG_REGULATOR is not set 1240# CONFIG_REGULATOR is not set
1126# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1127# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1128# CONFIG_REGULATOR_BQ24022 is not set
1129# CONFIG_UIO is not set 1241# CONFIG_UIO is not set
1242# CONFIG_STAGING is not set
1130 1243
1131# 1244#
1132# File systems 1245# File systems
@@ -1135,15 +1248,18 @@ CONFIG_EXT2_FS=y
1135# CONFIG_EXT2_FS_XATTR is not set 1248# CONFIG_EXT2_FS_XATTR is not set
1136# CONFIG_EXT2_FS_XIP is not set 1249# CONFIG_EXT2_FS_XIP is not set
1137CONFIG_EXT3_FS=y 1250CONFIG_EXT3_FS=y
1251# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1138# CONFIG_EXT3_FS_XATTR is not set 1252# CONFIG_EXT3_FS_XATTR is not set
1139# CONFIG_EXT4DEV_FS is not set 1253# CONFIG_EXT4_FS is not set
1140CONFIG_JBD=y 1254CONFIG_JBD=y
1141# CONFIG_JBD_DEBUG is not set 1255# CONFIG_JBD_DEBUG is not set
1142# CONFIG_REISERFS_FS is not set 1256# CONFIG_REISERFS_FS is not set
1143# CONFIG_JFS_FS is not set 1257# CONFIG_JFS_FS is not set
1144CONFIG_FS_POSIX_ACL=y 1258CONFIG_FS_POSIX_ACL=y
1259CONFIG_FILE_LOCKING=y
1145# CONFIG_XFS_FS is not set 1260# CONFIG_XFS_FS is not set
1146# CONFIG_OCFS2_FS is not set 1261# CONFIG_OCFS2_FS is not set
1262# CONFIG_BTRFS_FS is not set
1147CONFIG_DNOTIFY=y 1263CONFIG_DNOTIFY=y
1148CONFIG_INOTIFY=y 1264CONFIG_INOTIFY=y
1149CONFIG_INOTIFY_USER=y 1265CONFIG_INOTIFY_USER=y
@@ -1153,6 +1269,11 @@ CONFIG_INOTIFY_USER=y
1153# CONFIG_FUSE_FS is not set 1269# CONFIG_FUSE_FS is not set
1154 1270
1155# 1271#
1272# Caches
1273#
1274# CONFIG_FSCACHE is not set
1275
1276#
1156# CD-ROM/DVD Filesystems 1277# CD-ROM/DVD Filesystems
1157# 1278#
1158# CONFIG_ISO9660_FS is not set 1279# CONFIG_ISO9660_FS is not set
@@ -1173,15 +1294,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1173# 1294#
1174CONFIG_PROC_FS=y 1295CONFIG_PROC_FS=y
1175CONFIG_PROC_SYSCTL=y 1296CONFIG_PROC_SYSCTL=y
1297CONFIG_PROC_PAGE_MONITOR=y
1176CONFIG_SYSFS=y 1298CONFIG_SYSFS=y
1177CONFIG_TMPFS=y 1299CONFIG_TMPFS=y
1178# CONFIG_TMPFS_POSIX_ACL is not set 1300# CONFIG_TMPFS_POSIX_ACL is not set
1179# CONFIG_HUGETLB_PAGE is not set 1301# CONFIG_HUGETLB_PAGE is not set
1180# CONFIG_CONFIGFS_FS is not set 1302# CONFIG_CONFIGFS_FS is not set
1181 1303CONFIG_MISC_FILESYSTEMS=y
1182#
1183# Miscellaneous filesystems
1184#
1185# CONFIG_ADFS_FS is not set 1304# CONFIG_ADFS_FS is not set
1186# CONFIG_AFFS_FS is not set 1305# CONFIG_AFFS_FS is not set
1187# CONFIG_HFS_FS is not set 1306# CONFIG_HFS_FS is not set
@@ -1201,6 +1320,7 @@ CONFIG_JFFS2_ZLIB=y
1201CONFIG_JFFS2_RTIME=y 1320CONFIG_JFFS2_RTIME=y
1202# CONFIG_JFFS2_RUBIN is not set 1321# CONFIG_JFFS2_RUBIN is not set
1203# CONFIG_CRAMFS is not set 1322# CONFIG_CRAMFS is not set
1323# CONFIG_SQUASHFS is not set
1204# CONFIG_VXFS_FS is not set 1324# CONFIG_VXFS_FS is not set
1205# CONFIG_MINIX_FS is not set 1325# CONFIG_MINIX_FS is not set
1206# CONFIG_OMFS_FS is not set 1326# CONFIG_OMFS_FS is not set
@@ -1209,6 +1329,7 @@ CONFIG_JFFS2_RTIME=y
1209# CONFIG_ROMFS_FS is not set 1329# CONFIG_ROMFS_FS is not set
1210# CONFIG_SYSV_FS is not set 1330# CONFIG_SYSV_FS is not set
1211# CONFIG_UFS_FS is not set 1331# CONFIG_UFS_FS is not set
1332# CONFIG_NILFS2_FS is not set
1212CONFIG_NETWORK_FILESYSTEMS=y 1333CONFIG_NETWORK_FILESYSTEMS=y
1213CONFIG_NFS_FS=y 1334CONFIG_NFS_FS=y
1214CONFIG_NFS_V3=y 1335CONFIG_NFS_V3=y
@@ -1313,6 +1434,7 @@ CONFIG_DEBUG_FS=y
1313CONFIG_DEBUG_KERNEL=y 1434CONFIG_DEBUG_KERNEL=y
1314# CONFIG_DEBUG_SHIRQ is not set 1435# CONFIG_DEBUG_SHIRQ is not set
1315# CONFIG_DETECT_SOFTLOCKUP is not set 1436# CONFIG_DETECT_SOFTLOCKUP is not set
1437# CONFIG_DETECT_HUNG_TASK is not set
1316# CONFIG_SCHED_DEBUG is not set 1438# CONFIG_SCHED_DEBUG is not set
1317# CONFIG_SCHEDSTATS is not set 1439# CONFIG_SCHEDSTATS is not set
1318# CONFIG_TIMER_STATS is not set 1440# CONFIG_TIMER_STATS is not set
@@ -1329,6 +1451,7 @@ CONFIG_DEBUG_KERNEL=y
1329# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1451# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1330# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1452# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1331# CONFIG_DEBUG_KOBJECT is not set 1453# CONFIG_DEBUG_KOBJECT is not set
1454# CONFIG_DEBUG_HIGHMEM is not set
1332CONFIG_DEBUG_BUGVERBOSE=y 1455CONFIG_DEBUG_BUGVERBOSE=y
1333# CONFIG_DEBUG_INFO is not set 1456# CONFIG_DEBUG_INFO is not set
1334# CONFIG_DEBUG_VM is not set 1457# CONFIG_DEBUG_VM is not set
@@ -1336,22 +1459,38 @@ CONFIG_DEBUG_BUGVERBOSE=y
1336CONFIG_DEBUG_MEMORY_INIT=y 1459CONFIG_DEBUG_MEMORY_INIT=y
1337# CONFIG_DEBUG_LIST is not set 1460# CONFIG_DEBUG_LIST is not set
1338# CONFIG_DEBUG_SG is not set 1461# CONFIG_DEBUG_SG is not set
1339CONFIG_FRAME_POINTER=y 1462# CONFIG_DEBUG_NOTIFIERS is not set
1340# CONFIG_BOOT_PRINTK_DELAY is not set 1463# CONFIG_BOOT_PRINTK_DELAY is not set
1341# CONFIG_RCU_TORTURE_TEST is not set 1464# CONFIG_RCU_TORTURE_TEST is not set
1465# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1342# CONFIG_BACKTRACE_SELF_TEST is not set 1466# CONFIG_BACKTRACE_SELF_TEST is not set
1467# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1343# CONFIG_FAULT_INJECTION is not set 1468# CONFIG_FAULT_INJECTION is not set
1344# CONFIG_LATENCYTOP is not set 1469# CONFIG_LATENCYTOP is not set
1345CONFIG_SYSCTL_SYSCALL_CHECK=y 1470CONFIG_SYSCTL_SYSCALL_CHECK=y
1346CONFIG_HAVE_FTRACE=y 1471# CONFIG_PAGE_POISONING is not set
1347CONFIG_HAVE_DYNAMIC_FTRACE=y 1472CONFIG_HAVE_FUNCTION_TRACER=y
1348# CONFIG_FTRACE is not set 1473CONFIG_TRACING_SUPPORT=y
1474
1475#
1476# Tracers
1477#
1478# CONFIG_FUNCTION_TRACER is not set
1349# CONFIG_IRQSOFF_TRACER is not set 1479# CONFIG_IRQSOFF_TRACER is not set
1350# CONFIG_SCHED_TRACER is not set 1480# CONFIG_SCHED_TRACER is not set
1351# CONFIG_CONTEXT_SWITCH_TRACER is not set 1481# CONFIG_CONTEXT_SWITCH_TRACER is not set
1482# CONFIG_EVENT_TRACER is not set
1483# CONFIG_BOOT_TRACER is not set
1484# CONFIG_TRACE_BRANCH_PROFILING is not set
1485# CONFIG_STACK_TRACER is not set
1486# CONFIG_KMEMTRACE is not set
1487# CONFIG_WORKQUEUE_TRACER is not set
1488# CONFIG_BLK_DEV_IO_TRACE is not set
1489# CONFIG_DYNAMIC_DEBUG is not set
1352# CONFIG_SAMPLES is not set 1490# CONFIG_SAMPLES is not set
1353CONFIG_HAVE_ARCH_KGDB=y 1491CONFIG_HAVE_ARCH_KGDB=y
1354# CONFIG_KGDB is not set 1492# CONFIG_KGDB is not set
1493CONFIG_ARM_UNWIND=y
1355CONFIG_DEBUG_USER=y 1494CONFIG_DEBUG_USER=y
1356# CONFIG_DEBUG_ERRORS is not set 1495# CONFIG_DEBUG_ERRORS is not set
1357# CONFIG_DEBUG_STACK_USAGE is not set 1496# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1363,17 +1502,28 @@ CONFIG_DEBUG_LL=y
1363# 1502#
1364# CONFIG_KEYS is not set 1503# CONFIG_KEYS is not set
1365# CONFIG_SECURITY is not set 1504# CONFIG_SECURITY is not set
1505# CONFIG_SECURITYFS is not set
1366# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1506# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1367CONFIG_CRYPTO=y 1507CONFIG_CRYPTO=y
1368 1508
1369# 1509#
1370# Crypto core or helper 1510# Crypto core or helper
1371# 1511#
1512# CONFIG_CRYPTO_FIPS is not set
1372CONFIG_CRYPTO_ALGAPI=y 1513CONFIG_CRYPTO_ALGAPI=y
1514CONFIG_CRYPTO_ALGAPI2=y
1515CONFIG_CRYPTO_AEAD2=y
1373CONFIG_CRYPTO_BLKCIPHER=y 1516CONFIG_CRYPTO_BLKCIPHER=y
1517CONFIG_CRYPTO_BLKCIPHER2=y
1518CONFIG_CRYPTO_HASH=y
1519CONFIG_CRYPTO_HASH2=y
1520CONFIG_CRYPTO_RNG2=y
1521CONFIG_CRYPTO_PCOMP=y
1374CONFIG_CRYPTO_MANAGER=y 1522CONFIG_CRYPTO_MANAGER=y
1523CONFIG_CRYPTO_MANAGER2=y
1375# CONFIG_CRYPTO_GF128MUL is not set 1524# CONFIG_CRYPTO_GF128MUL is not set
1376# CONFIG_CRYPTO_NULL is not set 1525# CONFIG_CRYPTO_NULL is not set
1526CONFIG_CRYPTO_WORKQUEUE=y
1377# CONFIG_CRYPTO_CRYPTD is not set 1527# CONFIG_CRYPTO_CRYPTD is not set
1378# CONFIG_CRYPTO_AUTHENC is not set 1528# CONFIG_CRYPTO_AUTHENC is not set
1379# CONFIG_CRYPTO_TEST is not set 1529# CONFIG_CRYPTO_TEST is not set
@@ -1442,15 +1592,21 @@ CONFIG_CRYPTO_DES=y
1442# Compression 1592# Compression
1443# 1593#
1444# CONFIG_CRYPTO_DEFLATE is not set 1594# CONFIG_CRYPTO_DEFLATE is not set
1595# CONFIG_CRYPTO_ZLIB is not set
1445# CONFIG_CRYPTO_LZO is not set 1596# CONFIG_CRYPTO_LZO is not set
1597
1598#
1599# Random Number Generation
1600#
1601# CONFIG_CRYPTO_ANSI_CPRNG is not set
1446# CONFIG_CRYPTO_HW is not set 1602# CONFIG_CRYPTO_HW is not set
1603# CONFIG_BINARY_PRINTF is not set
1447 1604
1448# 1605#
1449# Library routines 1606# Library routines
1450# 1607#
1451CONFIG_BITREVERSE=y 1608CONFIG_BITREVERSE=y
1452# CONFIG_GENERIC_FIND_FIRST_BIT is not set 1609CONFIG_GENERIC_FIND_LAST_BIT=y
1453# CONFIG_GENERIC_FIND_NEXT_BIT is not set
1454# CONFIG_CRC_CCITT is not set 1610# CONFIG_CRC_CCITT is not set
1455# CONFIG_CRC16 is not set 1611# CONFIG_CRC16 is not set
1456CONFIG_CRC_T10DIF=y 1612CONFIG_CRC_T10DIF=y
@@ -1460,7 +1616,10 @@ CONFIG_CRC32=y
1460# CONFIG_LIBCRC32C is not set 1616# CONFIG_LIBCRC32C is not set
1461CONFIG_ZLIB_INFLATE=y 1617CONFIG_ZLIB_INFLATE=y
1462CONFIG_ZLIB_DEFLATE=y 1618CONFIG_ZLIB_DEFLATE=y
1463CONFIG_PLIST=y 1619CONFIG_DECOMPRESS_GZIP=y
1620CONFIG_DECOMPRESS_BZIP2=y
1621CONFIG_DECOMPRESS_LZMA=y
1464CONFIG_HAS_IOMEM=y 1622CONFIG_HAS_IOMEM=y
1465CONFIG_HAS_IOPORT=y 1623CONFIG_HAS_IOPORT=y
1466CONFIG_HAS_DMA=y 1624CONFIG_HAS_DMA=y
1625CONFIG_NLATTR=y
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index eb2738b5be5f..ac18662f38cc 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc2 3# Linux kernel version: 2.6.30-rc7
4# Wed Apr 15 08:16:53 2009 4# Tue May 26 07:24:28 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -179,6 +179,7 @@ CONFIG_ARCH_DAVINCI=y
179# CONFIG_ARCH_OMAP is not set 179# CONFIG_ARCH_OMAP is not set
180# CONFIG_ARCH_MSM is not set 180# CONFIG_ARCH_MSM is not set
181# CONFIG_ARCH_W90X900 is not set 181# CONFIG_ARCH_W90X900 is not set
182CONFIG_AINTC=y
182 183
183# 184#
184# TI DaVinci Implementations 185# TI DaVinci Implementations
@@ -188,11 +189,17 @@ CONFIG_ARCH_DAVINCI=y
188# DaVinci Core Type 189# DaVinci Core Type
189# 190#
190CONFIG_ARCH_DAVINCI_DM644x=y 191CONFIG_ARCH_DAVINCI_DM644x=y
192CONFIG_ARCH_DAVINCI_DM355=y
193CONFIG_ARCH_DAVINCI_DM646x=y
191 194
192# 195#
193# DaVinci Board Type 196# DaVinci Board Type
194# 197#
195CONFIG_MACH_DAVINCI_EVM=y 198CONFIG_MACH_DAVINCI_EVM=y
199CONFIG_MACH_SFFSDR=y
200CONFIG_MACH_DAVINCI_DM355_EVM=y
201CONFIG_MACH_DM355_LEOPARD=y
202CONFIG_MACH_DAVINCI_DM6467_EVM=y
196CONFIG_DAVINCI_MUX=y 203CONFIG_DAVINCI_MUX=y
197CONFIG_DAVINCI_MUX_DEBUG=y 204CONFIG_DAVINCI_MUX_DEBUG=y
198CONFIG_DAVINCI_MUX_WARNINGS=y 205CONFIG_DAVINCI_MUX_WARNINGS=y
@@ -245,7 +252,7 @@ CONFIG_PREEMPT=y
245CONFIG_HZ=100 252CONFIG_HZ=100
246CONFIG_AEABI=y 253CONFIG_AEABI=y
247# CONFIG_OABI_COMPAT is not set 254# CONFIG_OABI_COMPAT is not set
248CONFIG_ARCH_FLATMEM_HAS_HOLES=y 255# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
249# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 256# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
250# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 257# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
251# CONFIG_HIGHMEM is not set 258# CONFIG_HIGHMEM is not set
@@ -661,7 +668,10 @@ CONFIG_NET_ETHERNET=y
661CONFIG_MII=y 668CONFIG_MII=y
662# CONFIG_AX88796 is not set 669# CONFIG_AX88796 is not set
663# CONFIG_SMC91X is not set 670# CONFIG_SMC91X is not set
664# CONFIG_DM9000 is not set 671CONFIG_TI_DAVINCI_EMAC=y
672CONFIG_DM9000=y
673CONFIG_DM9000_DEBUGLEVEL=4
674# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set
665# CONFIG_ETHOC is not set 675# CONFIG_ETHOC is not set
666# CONFIG_SMC911X is not set 676# CONFIG_SMC911X is not set
667# CONFIG_SMSC911X is not set 677# CONFIG_SMSC911X is not set
@@ -963,6 +973,7 @@ CONFIG_SSB_POSSIBLE=y
963# CONFIG_MFD_CORE is not set 973# CONFIG_MFD_CORE is not set
964# CONFIG_MFD_SM501 is not set 974# CONFIG_MFD_SM501 is not set
965# CONFIG_MFD_ASIC3 is not set 975# CONFIG_MFD_ASIC3 is not set
976# CONFIG_MFD_DM355EVM_MSP is not set
966# CONFIG_HTC_EGPIO is not set 977# CONFIG_HTC_EGPIO is not set
967# CONFIG_HTC_PASIC3 is not set 978# CONFIG_HTC_PASIC3 is not set
968# CONFIG_TPS65010 is not set 979# CONFIG_TPS65010 is not set
@@ -1317,6 +1328,7 @@ CONFIG_MMC_BLOCK=m
1317# MMC/SD/SDIO Host Controller Drivers 1328# MMC/SD/SDIO Host Controller Drivers
1318# 1329#
1319# CONFIG_MMC_SDHCI is not set 1330# CONFIG_MMC_SDHCI is not set
1331# CONFIG_MMC_DAVINCI is not set
1320# CONFIG_MEMSTICK is not set 1332# CONFIG_MEMSTICK is not set
1321# CONFIG_ACCESSIBILITY is not set 1333# CONFIG_ACCESSIBILITY is not set
1322CONFIG_NEW_LEDS=y 1334CONFIG_NEW_LEDS=y
@@ -1778,6 +1790,7 @@ CONFIG_CRC32=y
1778CONFIG_ZLIB_INFLATE=y 1790CONFIG_ZLIB_INFLATE=y
1779CONFIG_ZLIB_DEFLATE=m 1791CONFIG_ZLIB_DEFLATE=m
1780CONFIG_DECOMPRESS_GZIP=y 1792CONFIG_DECOMPRESS_GZIP=y
1793CONFIG_GENERIC_ALLOCATOR=y
1781CONFIG_HAS_IOMEM=y 1794CONFIG_HAS_IOMEM=y
1782CONFIG_HAS_IOPORT=y 1795CONFIG_HAS_IOPORT=y
1783CONFIG_HAS_DMA=y 1796CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/ep93xx_defconfig b/arch/arm/configs/ep93xx_defconfig
index 3f89d5f25bce..3fb083b81b0a 100644
--- a/arch/arm/configs/ep93xx_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -1,12 +1,19 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20-rc1 3# Linux kernel version: 2.6.30-rc3
4# Sat Dec 16 06:05:24 2006 4# Tue May 19 12:26:49 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
7# CONFIG_GENERIC_TIME is not set 9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
8CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
9CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
10CONFIG_TRACE_IRQFLAGS_SUPPORT=y 17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
11CONFIG_HARDIRQS_SW_RESEND=y 18CONFIG_HARDIRQS_SW_RESEND=y
12CONFIG_GENERIC_IRQ_PROBE=y 19CONFIG_GENERIC_IRQ_PROBE=y
@@ -15,42 +22,54 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
15# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
16CONFIG_GENERIC_HWEIGHT=y 23CONFIG_GENERIC_HWEIGHT=y
17CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
18CONFIG_VECTORS_BASE=0xffff0000 26CONFIG_VECTORS_BASE=0xffff0000
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20 28
21# 29#
22# Code maturity level options 30# General setup
23# 31#
24CONFIG_EXPERIMENTAL=y 32CONFIG_EXPERIMENTAL=y
25CONFIG_BROKEN_ON_SMP=y 33CONFIG_BROKEN_ON_SMP=y
26CONFIG_INIT_ENV_ARG_LIMIT=32 34CONFIG_INIT_ENV_ARG_LIMIT=32
27
28#
29# General setup
30#
31CONFIG_LOCALVERSION="" 35CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y 36CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y 37CONFIG_SWAP=y
34CONFIG_SYSVIPC=y 38CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set 39CONFIG_SYSVIPC_SYSCTL=y
36# CONFIG_POSIX_MQUEUE is not set 40# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set 41# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set 42# CONFIG_TASKSTATS is not set
39# CONFIG_UTS_NS is not set
40# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
44
45#
46# RCU Subsystem
47#
48CONFIG_CLASSIC_RCU=y
49# CONFIG_TREE_RCU is not set
50# CONFIG_PREEMPT_RCU is not set
51# CONFIG_TREE_RCU_TRACE is not set
52# CONFIG_PREEMPT_RCU_TRACE is not set
41CONFIG_IKCONFIG=y 53CONFIG_IKCONFIG=y
42CONFIG_IKCONFIG_PROC=y 54CONFIG_IKCONFIG_PROC=y
55CONFIG_LOG_BUF_SHIFT=14
56# CONFIG_GROUP_SCHED is not set
57# CONFIG_CGROUPS is not set
43CONFIG_SYSFS_DEPRECATED=y 58CONFIG_SYSFS_DEPRECATED=y
59CONFIG_SYSFS_DEPRECATED_V2=y
44# CONFIG_RELAY is not set 60# CONFIG_RELAY is not set
45CONFIG_INITRAMFS_SOURCE="" 61# CONFIG_NAMESPACES is not set
62# CONFIG_BLK_DEV_INITRD is not set
46CONFIG_CC_OPTIMIZE_FOR_SIZE=y 63CONFIG_CC_OPTIMIZE_FOR_SIZE=y
47CONFIG_SYSCTL=y 64CONFIG_SYSCTL=y
65CONFIG_ANON_INODES=y
48CONFIG_EMBEDDED=y 66CONFIG_EMBEDDED=y
49CONFIG_UID16=y 67CONFIG_UID16=y
50CONFIG_SYSCTL_SYSCALL=y 68CONFIG_SYSCTL_SYSCALL=y
51CONFIG_KALLSYMS=y 69CONFIG_KALLSYMS=y
52# CONFIG_KALLSYMS_ALL is not set 70# CONFIG_KALLSYMS_ALL is not set
53# CONFIG_KALLSYMS_EXTRA_PASS is not set 71# CONFIG_KALLSYMS_EXTRA_PASS is not set
72# CONFIG_STRIP_ASM_SYMS is not set
54CONFIG_HOTPLUG=y 73CONFIG_HOTPLUG=y
55CONFIG_PRINTK=y 74CONFIG_PRINTK=y
56CONFIG_BUG=y 75CONFIG_BUG=y
@@ -58,31 +77,38 @@ CONFIG_ELF_CORE=y
58CONFIG_BASE_FULL=y 77CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 78CONFIG_FUTEX=y
60CONFIG_EPOLL=y 79CONFIG_EPOLL=y
80CONFIG_SIGNALFD=y
81CONFIG_TIMERFD=y
82CONFIG_EVENTFD=y
61CONFIG_SHMEM=y 83CONFIG_SHMEM=y
62CONFIG_SLAB=y 84CONFIG_AIO=y
63CONFIG_VM_EVENT_COUNTERS=y 85CONFIG_VM_EVENT_COUNTERS=y
86CONFIG_COMPAT_BRK=y
87CONFIG_SLAB=y
88# CONFIG_SLUB is not set
89# CONFIG_SLOB is not set
90# CONFIG_PROFILING is not set
91# CONFIG_MARKERS is not set
92CONFIG_HAVE_OPROFILE=y
93# CONFIG_KPROBES is not set
94CONFIG_HAVE_KPROBES=y
95CONFIG_HAVE_KRETPROBES=y
96CONFIG_HAVE_CLK=y
97# CONFIG_SLOW_WORK is not set
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y
64CONFIG_RT_MUTEXES=y 100CONFIG_RT_MUTEXES=y
65# CONFIG_TINY_SHMEM is not set
66CONFIG_BASE_SMALL=0 101CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y 102CONFIG_MODULES=y
103# CONFIG_MODULE_FORCE_LOAD is not set
73CONFIG_MODULE_UNLOAD=y 104CONFIG_MODULE_UNLOAD=y
74CONFIG_MODULE_FORCE_UNLOAD=y 105CONFIG_MODULE_FORCE_UNLOAD=y
75# CONFIG_MODVERSIONS is not set 106# CONFIG_MODVERSIONS is not set
76# CONFIG_MODULE_SRCVERSION_ALL is not set 107# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y 108CONFIG_BLOCK=y
83# CONFIG_LBD is not set 109# CONFIG_LBD is not set
84# CONFIG_BLK_DEV_IO_TRACE is not set 110# CONFIG_BLK_DEV_BSG is not set
85# CONFIG_LSF is not set 111# CONFIG_BLK_DEV_INTEGRITY is not set
86 112
87# 113#
88# IO Schedulers 114# IO Schedulers
@@ -96,6 +122,7 @@ CONFIG_DEFAULT_DEADLINE=y
96# CONFIG_DEFAULT_CFQ is not set 122# CONFIG_DEFAULT_CFQ is not set
97# CONFIG_DEFAULT_NOOP is not set 123# CONFIG_DEFAULT_NOOP is not set
98CONFIG_DEFAULT_IOSCHED="deadline" 124CONFIG_DEFAULT_IOSCHED="deadline"
125# CONFIG_FREEZER is not set
99 126
100# 127#
101# System Type 128# System Type
@@ -105,29 +132,40 @@ CONFIG_DEFAULT_IOSCHED="deadline"
105# CONFIG_ARCH_REALVIEW is not set 132# CONFIG_ARCH_REALVIEW is not set
106# CONFIG_ARCH_VERSATILE is not set 133# CONFIG_ARCH_VERSATILE is not set
107# CONFIG_ARCH_AT91 is not set 134# CONFIG_ARCH_AT91 is not set
108# CONFIG_ARCH_CLPS7500 is not set
109# CONFIG_ARCH_CLPS711X is not set 135# CONFIG_ARCH_CLPS711X is not set
110# CONFIG_ARCH_CO285 is not set 136# CONFIG_ARCH_GEMINI is not set
111# CONFIG_ARCH_EBSA110 is not set 137# CONFIG_ARCH_EBSA110 is not set
112CONFIG_ARCH_EP93XX=y 138CONFIG_ARCH_EP93XX=y
113# CONFIG_ARCH_FOOTBRIDGE is not set 139# CONFIG_ARCH_FOOTBRIDGE is not set
140# CONFIG_ARCH_MXC is not set
114# CONFIG_ARCH_NETX is not set 141# CONFIG_ARCH_NETX is not set
115# CONFIG_ARCH_H720X is not set 142# CONFIG_ARCH_H720X is not set
116# CONFIG_ARCH_IMX is not set 143# CONFIG_ARCH_IMX is not set
144# CONFIG_ARCH_IOP13XX is not set
117# CONFIG_ARCH_IOP32X is not set 145# CONFIG_ARCH_IOP32X is not set
118# CONFIG_ARCH_IOP33X is not set 146# CONFIG_ARCH_IOP33X is not set
119# CONFIG_ARCH_IOP13XX is not set
120# CONFIG_ARCH_IXP4XX is not set
121# CONFIG_ARCH_IXP2000 is not set
122# CONFIG_ARCH_IXP23XX is not set 147# CONFIG_ARCH_IXP23XX is not set
148# CONFIG_ARCH_IXP2000 is not set
149# CONFIG_ARCH_IXP4XX is not set
123# CONFIG_ARCH_L7200 is not set 150# CONFIG_ARCH_L7200 is not set
151# CONFIG_ARCH_KIRKWOOD is not set
152# CONFIG_ARCH_LOKI is not set
153# CONFIG_ARCH_MV78XX0 is not set
154# CONFIG_ARCH_ORION5X is not set
155# CONFIG_ARCH_MMP is not set
156# CONFIG_ARCH_KS8695 is not set
157# CONFIG_ARCH_NS9XXX is not set
158# CONFIG_ARCH_W90X900 is not set
124# CONFIG_ARCH_PNX4008 is not set 159# CONFIG_ARCH_PNX4008 is not set
125# CONFIG_ARCH_PXA is not set 160# CONFIG_ARCH_PXA is not set
161# CONFIG_ARCH_MSM is not set
126# CONFIG_ARCH_RPC is not set 162# CONFIG_ARCH_RPC is not set
127# CONFIG_ARCH_SA1100 is not set 163# CONFIG_ARCH_SA1100 is not set
128# CONFIG_ARCH_S3C2410 is not set 164# CONFIG_ARCH_S3C2410 is not set
165# CONFIG_ARCH_S3C64XX is not set
129# CONFIG_ARCH_SHARK is not set 166# CONFIG_ARCH_SHARK is not set
130# CONFIG_ARCH_LH7A40X is not set 167# CONFIG_ARCH_LH7A40X is not set
168# CONFIG_ARCH_DAVINCI is not set
131# CONFIG_ARCH_OMAP is not set 169# CONFIG_ARCH_OMAP is not set
132 170
133# 171#
@@ -138,14 +176,24 @@ CONFIG_CRUNCH=y
138# 176#
139# EP93xx Platforms 177# EP93xx Platforms
140# 178#
179# CONFIG_EP93XX_SDCE0_PHYS_OFFSET is not set
180CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET=y
141CONFIG_MACH_ADSSPHERE=y 181CONFIG_MACH_ADSSPHERE=y
182CONFIG_MACH_EDB93XX=y
183CONFIG_MACH_EDB9301=y
142CONFIG_MACH_EDB9302=y 184CONFIG_MACH_EDB9302=y
143CONFIG_MACH_EDB9302A=y 185CONFIG_MACH_EDB9307=y
144CONFIG_MACH_EDB9312=y 186CONFIG_MACH_EDB9312=y
145CONFIG_MACH_EDB9315=y 187CONFIG_MACH_EDB9315=y
146CONFIG_MACH_EDB9315A=y
147CONFIG_MACH_GESBC9312=y 188CONFIG_MACH_GESBC9312=y
189CONFIG_MACH_MICRO9=y
190CONFIG_MACH_MICRO9H=y
191CONFIG_MACH_MICRO9M=y
192CONFIG_MACH_MICRO9L=y
148CONFIG_MACH_TS72XX=y 193CONFIG_MACH_TS72XX=y
194CONFIG_EP93XX_EARLY_UART1=y
195# CONFIG_EP93XX_EARLY_UART2 is not set
196# CONFIG_EP93XX_EARLY_UART3 is not set
149 197
150# 198#
151# Processor Type 199# Processor Type
@@ -154,6 +202,7 @@ CONFIG_CPU_32=y
154CONFIG_CPU_ARM920T=y 202CONFIG_CPU_ARM920T=y
155CONFIG_CPU_32v4T=y 203CONFIG_CPU_32v4T=y
156CONFIG_CPU_ABRT_EV4T=y 204CONFIG_CPU_ABRT_EV4T=y
205CONFIG_CPU_PABRT_NOIFAR=y
157CONFIG_CPU_CACHE_V4WT=y 206CONFIG_CPU_CACHE_V4WT=y
158CONFIG_CPU_CACHE_VIVT=y 207CONFIG_CPU_CACHE_VIVT=y
159CONFIG_CPU_COPY_V4WB=y 208CONFIG_CPU_COPY_V4WB=y
@@ -168,34 +217,47 @@ CONFIG_ARM_THUMB=y
168# CONFIG_CPU_ICACHE_DISABLE is not set 217# CONFIG_CPU_ICACHE_DISABLE is not set
169# CONFIG_CPU_DCACHE_DISABLE is not set 218# CONFIG_CPU_DCACHE_DISABLE is not set
170# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 219# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
220# CONFIG_OUTER_CACHE is not set
171CONFIG_ARM_VIC=y 221CONFIG_ARM_VIC=y
222CONFIG_COMMON_CLKDEV=y
172 223
173# 224#
174# Bus support 225# Bus support
175# 226#
176CONFIG_ARM_AMBA=y 227CONFIG_ARM_AMBA=y
177 228# CONFIG_PCI_SYSCALL is not set
178# 229# CONFIG_ARCH_SUPPORTS_MSI is not set
179# PCCARD (PCMCIA/CardBus) support
180#
181# CONFIG_PCCARD is not set 230# CONFIG_PCCARD is not set
182 231
183# 232#
184# Kernel Features 233# Kernel Features
185# 234#
235CONFIG_VMSPLIT_3G=y
236# CONFIG_VMSPLIT_2G is not set
237# CONFIG_VMSPLIT_1G is not set
238CONFIG_PAGE_OFFSET=0xC0000000
186# CONFIG_PREEMPT is not set 239# CONFIG_PREEMPT is not set
187CONFIG_HZ=100 240CONFIG_HZ=100
188# CONFIG_AEABI is not set 241CONFIG_AEABI=y
189# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 242CONFIG_OABI_COMPAT=y
243CONFIG_ARCH_FLATMEM_HAS_HOLES=y
244# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
245# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
246# CONFIG_HIGHMEM is not set
190CONFIG_SELECT_MEMORY_MODEL=y 247CONFIG_SELECT_MEMORY_MODEL=y
191CONFIG_FLATMEM_MANUAL=y 248CONFIG_FLATMEM_MANUAL=y
192# CONFIG_DISCONTIGMEM_MANUAL is not set 249# CONFIG_DISCONTIGMEM_MANUAL is not set
193# CONFIG_SPARSEMEM_MANUAL is not set 250# CONFIG_SPARSEMEM_MANUAL is not set
194CONFIG_FLATMEM=y 251CONFIG_FLATMEM=y
195CONFIG_FLAT_NODE_MEM_MAP=y 252CONFIG_FLAT_NODE_MEM_MAP=y
196# CONFIG_SPARSEMEM_STATIC is not set 253CONFIG_PAGEFLAGS_EXTENDED=y
197CONFIG_SPLIT_PTLOCK_CPUS=4096 254CONFIG_SPLIT_PTLOCK_CPUS=4096
198# CONFIG_RESOURCES_64BIT is not set 255# CONFIG_PHYS_ADDR_T_64BIT is not set
256CONFIG_ZONE_DMA_FLAG=0
257CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
199CONFIG_ALIGNMENT_TRAP=y 261CONFIG_ALIGNMENT_TRAP=y
200 262
201# 263#
@@ -205,6 +267,12 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
205CONFIG_ZBOOT_ROM_BSS=0x0 267CONFIG_ZBOOT_ROM_BSS=0x0
206CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/nfs ip=bootp" 268CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/nfs ip=bootp"
207# CONFIG_XIP_KERNEL is not set 269# CONFIG_XIP_KERNEL is not set
270# CONFIG_KEXEC is not set
271
272#
273# CPU Power Management
274#
275# CONFIG_CPU_IDLE is not set
208 276
209# 277#
210# Floating point emulation 278# Floating point emulation
@@ -221,32 +289,31 @@ CONFIG_FPE_NWFPE_XP=y
221# Userspace binary formats 289# Userspace binary formats
222# 290#
223CONFIG_BINFMT_ELF=y 291CONFIG_BINFMT_ELF=y
292# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
293CONFIG_HAVE_AOUT=y
224# CONFIG_BINFMT_AOUT is not set 294# CONFIG_BINFMT_AOUT is not set
225# CONFIG_BINFMT_MISC is not set 295# CONFIG_BINFMT_MISC is not set
226# CONFIG_ARTHUR is not set
227 296
228# 297#
229# Power management options 298# Power management options
230# 299#
231# CONFIG_PM is not set 300# CONFIG_PM is not set
232# CONFIG_APM is not set 301CONFIG_ARCH_SUSPEND_POSSIBLE=y
233
234#
235# Networking
236#
237CONFIG_NET=y 302CONFIG_NET=y
238 303
239# 304#
240# Networking options 305# Networking options
241# 306#
242# CONFIG_NETDEBUG is not set
243CONFIG_PACKET=y 307CONFIG_PACKET=y
244CONFIG_PACKET_MMAP=y 308CONFIG_PACKET_MMAP=y
245CONFIG_UNIX=y 309CONFIG_UNIX=y
246CONFIG_XFRM=y 310CONFIG_XFRM=y
247# CONFIG_XFRM_USER is not set 311# CONFIG_XFRM_USER is not set
248# CONFIG_XFRM_SUB_POLICY is not set 312# CONFIG_XFRM_SUB_POLICY is not set
313# CONFIG_XFRM_MIGRATE is not set
314# CONFIG_XFRM_STATISTICS is not set
249CONFIG_NET_KEY=y 315CONFIG_NET_KEY=y
316# CONFIG_NET_KEY_MIGRATE is not set
250CONFIG_INET=y 317CONFIG_INET=y
251# CONFIG_IP_MULTICAST is not set 318# CONFIG_IP_MULTICAST is not set
252# CONFIG_IP_ADVANCED_ROUTER is not set 319# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -267,6 +334,7 @@ CONFIG_SYN_COOKIES=y
267CONFIG_INET_XFRM_MODE_TRANSPORT=y 334CONFIG_INET_XFRM_MODE_TRANSPORT=y
268CONFIG_INET_XFRM_MODE_TUNNEL=y 335CONFIG_INET_XFRM_MODE_TUNNEL=y
269CONFIG_INET_XFRM_MODE_BEET=y 336CONFIG_INET_XFRM_MODE_BEET=y
337# CONFIG_INET_LRO is not set
270CONFIG_INET_DIAG=y 338CONFIG_INET_DIAG=y
271CONFIG_INET_TCP_DIAG=y 339CONFIG_INET_TCP_DIAG=y
272# CONFIG_TCP_CONG_ADVANCED is not set 340# CONFIG_TCP_CONG_ADVANCED is not set
@@ -276,6 +344,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
276CONFIG_IPV6=y 344CONFIG_IPV6=y
277# CONFIG_IPV6_PRIVACY is not set 345# CONFIG_IPV6_PRIVACY is not set
278# CONFIG_IPV6_ROUTER_PREF is not set 346# CONFIG_IPV6_ROUTER_PREF is not set
347# CONFIG_IPV6_OPTIMISTIC_DAD is not set
279# CONFIG_INET6_AH is not set 348# CONFIG_INET6_AH is not set
280# CONFIG_INET6_ESP is not set 349# CONFIG_INET6_ESP is not set
281# CONFIG_INET6_IPCOMP is not set 350# CONFIG_INET6_IPCOMP is not set
@@ -289,25 +358,15 @@ CONFIG_IPV6=y
289# CONFIG_IPV6_SIT is not set 358# CONFIG_IPV6_SIT is not set
290# CONFIG_IPV6_TUNNEL is not set 359# CONFIG_IPV6_TUNNEL is not set
291# CONFIG_IPV6_MULTIPLE_TABLES is not set 360# CONFIG_IPV6_MULTIPLE_TABLES is not set
361# CONFIG_IPV6_MROUTE is not set
292# CONFIG_NETWORK_SECMARK is not set 362# CONFIG_NETWORK_SECMARK is not set
293# CONFIG_NETFILTER is not set 363# CONFIG_NETFILTER is not set
294
295#
296# DCCP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_DCCP is not set 364# CONFIG_IP_DCCP is not set
299
300#
301# SCTP Configuration (EXPERIMENTAL)
302#
303# CONFIG_IP_SCTP is not set 365# CONFIG_IP_SCTP is not set
304
305#
306# TIPC Configuration (EXPERIMENTAL)
307#
308# CONFIG_TIPC is not set 366# CONFIG_TIPC is not set
309# CONFIG_ATM is not set 367# CONFIG_ATM is not set
310# CONFIG_BRIDGE is not set 368# CONFIG_BRIDGE is not set
369# CONFIG_NET_DSA is not set
311# CONFIG_VLAN_8021Q is not set 370# CONFIG_VLAN_8021Q is not set
312# CONFIG_DECNET is not set 371# CONFIG_DECNET is not set
313# CONFIG_LLC2 is not set 372# CONFIG_LLC2 is not set
@@ -317,20 +376,28 @@ CONFIG_IPV6=y
317# CONFIG_LAPB is not set 376# CONFIG_LAPB is not set
318# CONFIG_ECONET is not set 377# CONFIG_ECONET is not set
319# CONFIG_WAN_ROUTER is not set 378# CONFIG_WAN_ROUTER is not set
320 379# CONFIG_PHONET is not set
321#
322# QoS and/or fair queueing
323#
324# CONFIG_NET_SCHED is not set 380# CONFIG_NET_SCHED is not set
381# CONFIG_DCB is not set
325 382
326# 383#
327# Network testing 384# Network testing
328# 385#
329# CONFIG_NET_PKTGEN is not set 386# CONFIG_NET_PKTGEN is not set
330# CONFIG_HAMRADIO is not set 387# CONFIG_HAMRADIO is not set
388# CONFIG_CAN is not set
331# CONFIG_IRDA is not set 389# CONFIG_IRDA is not set
332# CONFIG_BT is not set 390# CONFIG_BT is not set
333# CONFIG_IEEE80211 is not set 391# CONFIG_AF_RXRPC is not set
392CONFIG_WIRELESS=y
393# CONFIG_CFG80211 is not set
394# CONFIG_WIRELESS_OLD_REGULATORY is not set
395# CONFIG_WIRELESS_EXT is not set
396# CONFIG_LIB80211 is not set
397# CONFIG_MAC80211 is not set
398# CONFIG_WIMAX is not set
399# CONFIG_RFKILL is not set
400# CONFIG_NET_9P is not set
334 401
335# 402#
336# Device Drivers 403# Device Drivers
@@ -339,41 +406,39 @@ CONFIG_IPV6=y
339# 406#
340# Generic Driver Options 407# Generic Driver Options
341# 408#
409CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
342CONFIG_STANDALONE=y 410CONFIG_STANDALONE=y
343CONFIG_PREVENT_FIRMWARE_BUILD=y 411CONFIG_PREVENT_FIRMWARE_BUILD=y
344# CONFIG_FW_LOADER is not set 412# CONFIG_FW_LOADER is not set
345# CONFIG_DEBUG_DRIVER is not set 413# CONFIG_DEBUG_DRIVER is not set
414# CONFIG_DEBUG_DEVRES is not set
346# CONFIG_SYS_HYPERVISOR is not set 415# CONFIG_SYS_HYPERVISOR is not set
347
348#
349# Connector - unified userspace <-> kernelspace linker
350#
351# CONFIG_CONNECTOR is not set 416# CONFIG_CONNECTOR is not set
352
353#
354# Memory Technology Devices (MTD)
355#
356CONFIG_MTD=y 417CONFIG_MTD=y
357# CONFIG_MTD_DEBUG is not set 418# CONFIG_MTD_DEBUG is not set
358CONFIG_MTD_CONCAT=y 419CONFIG_MTD_CONCAT=y
359CONFIG_MTD_PARTITIONS=y 420CONFIG_MTD_PARTITIONS=y
421# CONFIG_MTD_TESTS is not set
360CONFIG_MTD_REDBOOT_PARTS=y 422CONFIG_MTD_REDBOOT_PARTS=y
361CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 423CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
362# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set 424# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
363# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set 425# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
364CONFIG_MTD_CMDLINE_PARTS=y 426CONFIG_MTD_CMDLINE_PARTS=y
365# CONFIG_MTD_AFS_PARTS is not set 427# CONFIG_MTD_AFS_PARTS is not set
428# CONFIG_MTD_AR7_PARTS is not set
366 429
367# 430#
368# User Modules And Translation Layers 431# User Modules And Translation Layers
369# 432#
370CONFIG_MTD_CHAR=y 433CONFIG_MTD_CHAR=y
434CONFIG_MTD_BLKDEVS=y
371CONFIG_MTD_BLOCK=y 435CONFIG_MTD_BLOCK=y
372# CONFIG_FTL is not set 436# CONFIG_FTL is not set
373# CONFIG_NFTL is not set 437# CONFIG_NFTL is not set
374# CONFIG_INFTL is not set 438# CONFIG_INFTL is not set
375# CONFIG_RFD_FTL is not set 439# CONFIG_RFD_FTL is not set
376# CONFIG_SSFDC is not set 440# CONFIG_SSFDC is not set
441# CONFIG_MTD_OOPS is not set
377 442
378# 443#
379# RAM/ROM/Flash chip drivers 444# RAM/ROM/Flash chip drivers
@@ -404,16 +469,13 @@ CONFIG_MTD_CFI_UTIL=y
404# CONFIG_MTD_RAM is not set 469# CONFIG_MTD_RAM is not set
405CONFIG_MTD_ROM=y 470CONFIG_MTD_ROM=y
406# CONFIG_MTD_ABSENT is not set 471# CONFIG_MTD_ABSENT is not set
407# CONFIG_MTD_OBSOLETE_CHIPS is not set
408 472
409# 473#
410# Mapping drivers for chip access 474# Mapping drivers for chip access
411# 475#
412# CONFIG_MTD_COMPLEX_MAPPINGS is not set 476# CONFIG_MTD_COMPLEX_MAPPINGS is not set
413CONFIG_MTD_PHYSMAP=y 477CONFIG_MTD_PHYSMAP=y
414CONFIG_MTD_PHYSMAP_START=0x0 478# CONFIG_MTD_PHYSMAP_COMPAT is not set
415CONFIG_MTD_PHYSMAP_LEN=0x0
416CONFIG_MTD_PHYSMAP_BANKWIDTH=1
417# CONFIG_MTD_ARM_INTEGRATOR is not set 479# CONFIG_MTD_ARM_INTEGRATOR is not set
418# CONFIG_MTD_PLATRAM is not set 480# CONFIG_MTD_PLATRAM is not set
419 481
@@ -431,49 +493,58 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
431# CONFIG_MTD_DOC2000 is not set 493# CONFIG_MTD_DOC2000 is not set
432# CONFIG_MTD_DOC2001 is not set 494# CONFIG_MTD_DOC2001 is not set
433# CONFIG_MTD_DOC2001PLUS is not set 495# CONFIG_MTD_DOC2001PLUS is not set
434
435#
436# NAND Flash Device Drivers
437#
438CONFIG_MTD_NAND=y 496CONFIG_MTD_NAND=y
439CONFIG_MTD_NAND_VERIFY_WRITE=y 497CONFIG_MTD_NAND_VERIFY_WRITE=y
440# CONFIG_MTD_NAND_ECC_SMC is not set 498# CONFIG_MTD_NAND_ECC_SMC is not set
441CONFIG_MTD_NAND_TS7250=y 499# CONFIG_MTD_NAND_MUSEUM_IDS is not set
500# CONFIG_MTD_NAND_GPIO is not set
501# CONFIG_MTD_NAND_TS7250 is not set
442CONFIG_MTD_NAND_IDS=y 502CONFIG_MTD_NAND_IDS=y
443# CONFIG_MTD_NAND_DISKONCHIP is not set 503# CONFIG_MTD_NAND_DISKONCHIP is not set
444# CONFIG_MTD_NAND_NANDSIM is not set 504# CONFIG_MTD_NAND_NANDSIM is not set
445 505# CONFIG_MTD_NAND_PLATFORM is not set
446# 506# CONFIG_MTD_ALAUDA is not set
447# OneNAND Flash Device Drivers
448#
449# CONFIG_MTD_ONENAND is not set 507# CONFIG_MTD_ONENAND is not set
450 508
451# 509#
452# Parallel port support 510# LPDDR flash memory drivers
453#
454# CONFIG_PARPORT is not set
455
456#
457# Plug and Play support
458# 511#
512# CONFIG_MTD_LPDDR is not set
459 513
460# 514#
461# Block devices 515# UBI - Unsorted block images
462# 516#
517# CONFIG_MTD_UBI is not set
518# CONFIG_PARPORT is not set
519CONFIG_BLK_DEV=y
463# CONFIG_BLK_DEV_COW_COMMON is not set 520# CONFIG_BLK_DEV_COW_COMMON is not set
464# CONFIG_BLK_DEV_LOOP is not set 521# CONFIG_BLK_DEV_LOOP is not set
465CONFIG_BLK_DEV_NBD=y 522CONFIG_BLK_DEV_NBD=y
466# CONFIG_BLK_DEV_UB is not set 523# CONFIG_BLK_DEV_UB is not set
467# CONFIG_BLK_DEV_RAM is not set 524# CONFIG_BLK_DEV_RAM is not set
468# CONFIG_BLK_DEV_INITRD is not set
469# CONFIG_CDROM_PKTCDVD is not set 525# CONFIG_CDROM_PKTCDVD is not set
470# CONFIG_ATA_OVER_ETH is not set 526# CONFIG_ATA_OVER_ETH is not set
527CONFIG_MISC_DEVICES=y
528# CONFIG_ICS932S401 is not set
529# CONFIG_ENCLOSURE_SERVICES is not set
530# CONFIG_ISL29003 is not set
531# CONFIG_C2PORT is not set
532
533#
534# EEPROM support
535#
536# CONFIG_EEPROM_AT24 is not set
537CONFIG_EEPROM_LEGACY=y
538# CONFIG_EEPROM_93CX6 is not set
539CONFIG_HAVE_IDE=y
540# CONFIG_IDE is not set
471 541
472# 542#
473# SCSI device support 543# SCSI device support
474# 544#
475# CONFIG_RAID_ATTRS is not set 545# CONFIG_RAID_ATTRS is not set
476CONFIG_SCSI=y 546CONFIG_SCSI=y
547CONFIG_SCSI_DMA=y
477# CONFIG_SCSI_TGT is not set 548# CONFIG_SCSI_TGT is not set
478# CONFIG_SCSI_NETLINK is not set 549# CONFIG_SCSI_NETLINK is not set
479# CONFIG_SCSI_PROC_FS is not set 550# CONFIG_SCSI_PROC_FS is not set
@@ -495,6 +566,7 @@ CONFIG_BLK_DEV_SD=y
495# CONFIG_SCSI_CONSTANTS is not set 566# CONFIG_SCSI_CONSTANTS is not set
496# CONFIG_SCSI_LOGGING is not set 567# CONFIG_SCSI_LOGGING is not set
497# CONFIG_SCSI_SCAN_ASYNC is not set 568# CONFIG_SCSI_SCAN_ASYNC is not set
569CONFIG_SCSI_WAIT_SCAN=m
498 570
499# 571#
500# SCSI Transports 572# SCSI Transports
@@ -502,92 +574,71 @@ CONFIG_BLK_DEV_SD=y
502# CONFIG_SCSI_SPI_ATTRS is not set 574# CONFIG_SCSI_SPI_ATTRS is not set
503# CONFIG_SCSI_FC_ATTRS is not set 575# CONFIG_SCSI_FC_ATTRS is not set
504# CONFIG_SCSI_ISCSI_ATTRS is not set 576# CONFIG_SCSI_ISCSI_ATTRS is not set
505# CONFIG_SCSI_SAS_ATTRS is not set
506# CONFIG_SCSI_SAS_LIBSAS is not set 577# CONFIG_SCSI_SAS_LIBSAS is not set
507 578# CONFIG_SCSI_SRP_ATTRS is not set
508# 579CONFIG_SCSI_LOWLEVEL=y
509# SCSI low-level drivers
510#
511# CONFIG_ISCSI_TCP is not set 580# CONFIG_ISCSI_TCP is not set
581# CONFIG_LIBFC is not set
582# CONFIG_LIBFCOE is not set
512# CONFIG_SCSI_DEBUG is not set 583# CONFIG_SCSI_DEBUG is not set
513 584# CONFIG_SCSI_DH is not set
514# 585# CONFIG_SCSI_OSD_INITIATOR is not set
515# Serial ATA (prod) and Parallel ATA (experimental) drivers
516#
517# CONFIG_ATA is not set 586# CONFIG_ATA is not set
518
519#
520# Multi-device support (RAID and LVM)
521#
522# CONFIG_MD is not set 587# CONFIG_MD is not set
523
524#
525# Fusion MPT device support
526#
527# CONFIG_FUSION is not set
528
529#
530# IEEE 1394 (FireWire) support
531#
532
533#
534# I2O device support
535#
536
537#
538# Network device support
539#
540CONFIG_NETDEVICES=y 588CONFIG_NETDEVICES=y
589CONFIG_COMPAT_NET_DEV_OPS=y
541# CONFIG_DUMMY is not set 590# CONFIG_DUMMY is not set
542# CONFIG_BONDING is not set 591# CONFIG_BONDING is not set
592# CONFIG_MACVLAN is not set
543# CONFIG_EQUALIZER is not set 593# CONFIG_EQUALIZER is not set
544# CONFIG_TUN is not set 594# CONFIG_TUN is not set
545 595# CONFIG_VETH is not set
546#
547# PHY device support
548#
549# CONFIG_PHYLIB is not set 596# CONFIG_PHYLIB is not set
550
551#
552# Ethernet (10 or 100Mbit)
553#
554CONFIG_NET_ETHERNET=y 597CONFIG_NET_ETHERNET=y
555CONFIG_MII=y 598CONFIG_MII=y
556CONFIG_EP93XX_ETH=y 599CONFIG_EP93XX_ETH=y
600# CONFIG_AX88796 is not set
557# CONFIG_SMC91X is not set 601# CONFIG_SMC91X is not set
558# CONFIG_DM9000 is not set 602# CONFIG_DM9000 is not set
603# CONFIG_ETHOC is not set
604# CONFIG_SMC911X is not set
605# CONFIG_SMSC911X is not set
606# CONFIG_DNET is not set
607# CONFIG_IBM_NEW_EMAC_ZMII is not set
608# CONFIG_IBM_NEW_EMAC_RGMII is not set
609# CONFIG_IBM_NEW_EMAC_TAH is not set
610# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
611# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
612# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
613# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
614# CONFIG_B44 is not set
615CONFIG_NETDEV_1000=y
616CONFIG_NETDEV_10000=y
559 617
560# 618#
561# Ethernet (1000 Mbit) 619# Wireless LAN
562#
563
564#
565# Ethernet (10000 Mbit)
566#
567
568#
569# Token Ring devices
570# 620#
621# CONFIG_WLAN_PRE80211 is not set
622# CONFIG_WLAN_80211 is not set
571 623
572# 624#
573# Wireless LAN (non-hamradio) 625# Enable WiMAX (Networking options) to see the WiMAX drivers
574# 626#
575# CONFIG_NET_RADIO is not set
576 627
577# 628#
578# Wan interfaces 629# USB Network Adapters
579# 630#
631# CONFIG_USB_CATC is not set
632# CONFIG_USB_KAWETH is not set
633# CONFIG_USB_PEGASUS is not set
634CONFIG_USB_RTL8150=y
635# CONFIG_USB_USBNET is not set
580# CONFIG_WAN is not set 636# CONFIG_WAN is not set
581# CONFIG_PPP is not set 637# CONFIG_PPP is not set
582# CONFIG_SLIP is not set 638# CONFIG_SLIP is not set
583# CONFIG_SHAPER is not set
584# CONFIG_NETCONSOLE is not set 639# CONFIG_NETCONSOLE is not set
585# CONFIG_NETPOLL is not set 640# CONFIG_NETPOLL is not set
586# CONFIG_NET_POLL_CONTROLLER is not set 641# CONFIG_NET_POLL_CONTROLLER is not set
587
588#
589# ISDN subsystem
590#
591# CONFIG_ISDN is not set 642# CONFIG_ISDN is not set
592 643
593# 644#
@@ -605,6 +656,7 @@ CONFIG_EP93XX_ETH=y
605# Character devices 656# Character devices
606# 657#
607# CONFIG_VT is not set 658# CONFIG_VT is not set
659CONFIG_DEVKMEM=y
608# CONFIG_SERIAL_NONSTANDARD is not set 660# CONFIG_SERIAL_NONSTANDARD is not set
609 661
610# 662#
@@ -621,104 +673,101 @@ CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
621CONFIG_SERIAL_CORE=y 673CONFIG_SERIAL_CORE=y
622CONFIG_SERIAL_CORE_CONSOLE=y 674CONFIG_SERIAL_CORE_CONSOLE=y
623CONFIG_UNIX98_PTYS=y 675CONFIG_UNIX98_PTYS=y
676# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
624# CONFIG_LEGACY_PTYS is not set 677# CONFIG_LEGACY_PTYS is not set
625
626#
627# IPMI
628#
629# CONFIG_IPMI_HANDLER is not set 678# CONFIG_IPMI_HANDLER is not set
630
631#
632# Watchdog Cards
633#
634CONFIG_WATCHDOG=y
635# CONFIG_WATCHDOG_NOWAYOUT is not set
636
637#
638# Watchdog Device Drivers
639#
640# CONFIG_SOFT_WATCHDOG is not set
641CONFIG_EP93XX_WATCHDOG=y
642
643#
644# USB-based Watchdog Cards
645#
646# CONFIG_USBPCWATCHDOG is not set
647# CONFIG_HW_RANDOM is not set 679# CONFIG_HW_RANDOM is not set
648# CONFIG_NVRAM is not set
649# CONFIG_DTLK is not set
650# CONFIG_R3964 is not set 680# CONFIG_R3964 is not set
651# CONFIG_RAW_DRIVER is not set 681# CONFIG_RAW_DRIVER is not set
682# CONFIG_TCG_TPM is not set
683CONFIG_I2C=y
684CONFIG_I2C_BOARDINFO=y
685CONFIG_I2C_CHARDEV=y
686CONFIG_I2C_HELPER_AUTO=y
652 687
653# 688#
654# TPM devices 689# I2C Hardware Bus support
655# 690#
656# CONFIG_TCG_TPM is not set
657 691
658# 692#
659# I2C support 693# I2C system bus drivers (mostly embedded / system-on-chip)
660# 694#
661CONFIG_I2C=y 695# CONFIG_I2C_GPIO is not set
662CONFIG_I2C_CHARDEV=y 696# CONFIG_I2C_OCORES is not set
697# CONFIG_I2C_SIMTEC is not set
663 698
664# 699#
665# I2C Algorithms 700# External I2C/SMBus adapter drivers
666# 701#
667CONFIG_I2C_ALGOBIT=y 702# CONFIG_I2C_PARPORT_LIGHT is not set
668# CONFIG_I2C_ALGOPCF is not set 703# CONFIG_I2C_TAOS_EVM is not set
669# CONFIG_I2C_ALGOPCA is not set 704# CONFIG_I2C_TINY_USB is not set
670 705
671# 706#
672# I2C Hardware Bus support 707# Other I2C/SMBus bus drivers
673# 708#
674# CONFIG_I2C_OCORES is not set 709# CONFIG_I2C_PCA_PLATFORM is not set
675# CONFIG_I2C_PARPORT_LIGHT is not set
676# CONFIG_I2C_STUB is not set 710# CONFIG_I2C_STUB is not set
677# CONFIG_I2C_PCA_ISA is not set
678 711
679# 712#
680# Miscellaneous I2C Chip support 713# Miscellaneous I2C Chip support
681# 714#
682# CONFIG_SENSORS_DS1337 is not set 715# CONFIG_DS1682 is not set
683# CONFIG_SENSORS_DS1374 is not set
684CONFIG_EEPROM_LEGACY=y
685# CONFIG_SENSORS_PCF8574 is not set 716# CONFIG_SENSORS_PCF8574 is not set
717# CONFIG_PCF8575 is not set
686# CONFIG_SENSORS_PCA9539 is not set 718# CONFIG_SENSORS_PCA9539 is not set
687# CONFIG_SENSORS_PCF8591 is not set
688# CONFIG_SENSORS_MAX6875 is not set 719# CONFIG_SENSORS_MAX6875 is not set
720# CONFIG_SENSORS_TSL2550 is not set
689CONFIG_I2C_DEBUG_CORE=y 721CONFIG_I2C_DEBUG_CORE=y
690CONFIG_I2C_DEBUG_ALGO=y 722CONFIG_I2C_DEBUG_ALGO=y
691CONFIG_I2C_DEBUG_BUS=y 723CONFIG_I2C_DEBUG_BUS=y
692CONFIG_I2C_DEBUG_CHIP=y 724CONFIG_I2C_DEBUG_CHIP=y
725# CONFIG_SPI is not set
726CONFIG_ARCH_REQUIRE_GPIOLIB=y
727CONFIG_GPIOLIB=y
728# CONFIG_DEBUG_GPIO is not set
729# CONFIG_GPIO_SYSFS is not set
693 730
694# 731#
695# SPI support 732# Memory mapped GPIO expanders:
696# 733#
697# CONFIG_SPI is not set
698# CONFIG_SPI_MASTER is not set
699 734
700# 735#
701# Dallas's 1-wire bus 736# I2C GPIO expanders:
702# 737#
703# CONFIG_W1 is not set 738# CONFIG_GPIO_MAX732X is not set
739# CONFIG_GPIO_PCA953X is not set
740# CONFIG_GPIO_PCF857X is not set
704 741
705# 742#
706# Hardware Monitoring support 743# PCI GPIO expanders:
707# 744#
745
746#
747# SPI GPIO expanders:
748#
749# CONFIG_W1 is not set
750# CONFIG_POWER_SUPPLY is not set
708CONFIG_HWMON=y 751CONFIG_HWMON=y
709# CONFIG_HWMON_VID is not set 752# CONFIG_HWMON_VID is not set
710# CONFIG_SENSORS_ABITUGURU is not set 753# CONFIG_SENSORS_AD7414 is not set
754# CONFIG_SENSORS_AD7418 is not set
711# CONFIG_SENSORS_ADM1021 is not set 755# CONFIG_SENSORS_ADM1021 is not set
712# CONFIG_SENSORS_ADM1025 is not set 756# CONFIG_SENSORS_ADM1025 is not set
713# CONFIG_SENSORS_ADM1026 is not set 757# CONFIG_SENSORS_ADM1026 is not set
758# CONFIG_SENSORS_ADM1029 is not set
714# CONFIG_SENSORS_ADM1031 is not set 759# CONFIG_SENSORS_ADM1031 is not set
715# CONFIG_SENSORS_ADM9240 is not set 760# CONFIG_SENSORS_ADM9240 is not set
716# CONFIG_SENSORS_ASB100 is not set 761# CONFIG_SENSORS_ADT7462 is not set
762# CONFIG_SENSORS_ADT7470 is not set
763# CONFIG_SENSORS_ADT7473 is not set
764# CONFIG_SENSORS_ADT7475 is not set
717# CONFIG_SENSORS_ATXP1 is not set 765# CONFIG_SENSORS_ATXP1 is not set
718# CONFIG_SENSORS_DS1621 is not set 766# CONFIG_SENSORS_DS1621 is not set
719# CONFIG_SENSORS_F71805F is not set 767# CONFIG_SENSORS_F71805F is not set
720# CONFIG_SENSORS_FSCHER is not set 768# CONFIG_SENSORS_F71882FG is not set
721# CONFIG_SENSORS_FSCPOS is not set 769# CONFIG_SENSORS_F75375S is not set
770# CONFIG_SENSORS_G760A is not set
722# CONFIG_SENSORS_GL518SM is not set 771# CONFIG_SENSORS_GL518SM is not set
723# CONFIG_SENSORS_GL520SM is not set 772# CONFIG_SENSORS_GL520SM is not set
724# CONFIG_SENSORS_IT87 is not set 773# CONFIG_SENSORS_IT87 is not set
@@ -732,158 +781,188 @@ CONFIG_HWMON=y
732# CONFIG_SENSORS_LM87 is not set 781# CONFIG_SENSORS_LM87 is not set
733# CONFIG_SENSORS_LM90 is not set 782# CONFIG_SENSORS_LM90 is not set
734# CONFIG_SENSORS_LM92 is not set 783# CONFIG_SENSORS_LM92 is not set
784# CONFIG_SENSORS_LM93 is not set
785# CONFIG_SENSORS_LTC4215 is not set
786# CONFIG_SENSORS_LTC4245 is not set
787# CONFIG_SENSORS_LM95241 is not set
735# CONFIG_SENSORS_MAX1619 is not set 788# CONFIG_SENSORS_MAX1619 is not set
789# CONFIG_SENSORS_MAX6650 is not set
736# CONFIG_SENSORS_PC87360 is not set 790# CONFIG_SENSORS_PC87360 is not set
737# CONFIG_SENSORS_PC87427 is not set 791# CONFIG_SENSORS_PC87427 is not set
792# CONFIG_SENSORS_PCF8591 is not set
793# CONFIG_SENSORS_SHT15 is not set
794# CONFIG_SENSORS_DME1737 is not set
738# CONFIG_SENSORS_SMSC47M1 is not set 795# CONFIG_SENSORS_SMSC47M1 is not set
739# CONFIG_SENSORS_SMSC47M192 is not set 796# CONFIG_SENSORS_SMSC47M192 is not set
740# CONFIG_SENSORS_SMSC47B397 is not set 797# CONFIG_SENSORS_SMSC47B397 is not set
798# CONFIG_SENSORS_ADS7828 is not set
799# CONFIG_SENSORS_THMC50 is not set
741# CONFIG_SENSORS_VT1211 is not set 800# CONFIG_SENSORS_VT1211 is not set
742# CONFIG_SENSORS_W83781D is not set 801# CONFIG_SENSORS_W83781D is not set
743# CONFIG_SENSORS_W83791D is not set 802# CONFIG_SENSORS_W83791D is not set
744# CONFIG_SENSORS_W83792D is not set 803# CONFIG_SENSORS_W83792D is not set
745# CONFIG_SENSORS_W83793 is not set 804# CONFIG_SENSORS_W83793 is not set
746# CONFIG_SENSORS_W83L785TS is not set 805# CONFIG_SENSORS_W83L785TS is not set
806# CONFIG_SENSORS_W83L786NG is not set
747# CONFIG_SENSORS_W83627HF is not set 807# CONFIG_SENSORS_W83627HF is not set
748# CONFIG_SENSORS_W83627EHF is not set 808# CONFIG_SENSORS_W83627EHF is not set
749# CONFIG_HWMON_DEBUG_CHIP is not set 809# CONFIG_HWMON_DEBUG_CHIP is not set
810# CONFIG_THERMAL is not set
811# CONFIG_THERMAL_HWMON is not set
812CONFIG_WATCHDOG=y
813# CONFIG_WATCHDOG_NOWAYOUT is not set
750 814
751# 815#
752# Misc devices 816# Watchdog Device Drivers
753# 817#
754# CONFIG_TIFM_CORE is not set 818# CONFIG_SOFT_WATCHDOG is not set
819CONFIG_EP93XX_WATCHDOG=y
755 820
756# 821#
757# LED devices 822# USB-based Watchdog Cards
758# 823#
759# CONFIG_NEW_LEDS is not set 824# CONFIG_USBPCWATCHDOG is not set
825CONFIG_SSB_POSSIBLE=y
760 826
761# 827#
762# LED drivers 828# Sonics Silicon Backplane
763# 829#
830# CONFIG_SSB is not set
764 831
765# 832#
766# LED Triggers 833# Multifunction device drivers
767# 834#
835# CONFIG_MFD_CORE is not set
836# CONFIG_MFD_SM501 is not set
837# CONFIG_MFD_ASIC3 is not set
838# CONFIG_HTC_EGPIO is not set
839# CONFIG_HTC_PASIC3 is not set
840# CONFIG_TPS65010 is not set
841# CONFIG_TWL4030_CORE is not set
842# CONFIG_MFD_TMIO is not set
843# CONFIG_MFD_T7L66XB is not set
844# CONFIG_MFD_TC6387XB is not set
845# CONFIG_MFD_TC6393XB is not set
846# CONFIG_PMIC_DA903X is not set
847# CONFIG_MFD_WM8400 is not set
848# CONFIG_MFD_WM8350_I2C is not set
849# CONFIG_MFD_PCF50633 is not set
768 850
769# 851#
770# Multimedia devices 852# Multimedia devices
771# 853#
854
855#
856# Multimedia core support
857#
772# CONFIG_VIDEO_DEV is not set 858# CONFIG_VIDEO_DEV is not set
859# CONFIG_DVB_CORE is not set
860# CONFIG_VIDEO_MEDIA is not set
773 861
774# 862#
775# Digital Video Broadcasting Devices 863# Multimedia drivers
776# 864#
777# CONFIG_DVB is not set 865# CONFIG_DAB is not set
778# CONFIG_USB_DABUSB is not set
779 866
780# 867#
781# Graphics support 868# Graphics support
782# 869#
783# CONFIG_FIRMWARE_EDID is not set 870# CONFIG_VGASTATE is not set
871# CONFIG_VIDEO_OUTPUT_CONTROL is not set
784# CONFIG_FB is not set 872# CONFIG_FB is not set
785# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 873# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
786 874
787# 875#
788# Sound 876# Display device support
789# 877#
878# CONFIG_DISPLAY_SUPPORT is not set
790# CONFIG_SOUND is not set 879# CONFIG_SOUND is not set
791 880CONFIG_USB_SUPPORT=y
792#
793# USB support
794#
795CONFIG_USB_ARCH_HAS_HCD=y 881CONFIG_USB_ARCH_HAS_HCD=y
796CONFIG_USB_ARCH_HAS_OHCI=y 882CONFIG_USB_ARCH_HAS_OHCI=y
797# CONFIG_USB_ARCH_HAS_EHCI is not set 883# CONFIG_USB_ARCH_HAS_EHCI is not set
798CONFIG_USB=y 884CONFIG_USB=y
799CONFIG_USB_DEBUG=y 885CONFIG_USB_DEBUG=y
886# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
800 887
801# 888#
802# Miscellaneous USB options 889# Miscellaneous USB options
803# 890#
804CONFIG_USB_DEVICEFS=y 891CONFIG_USB_DEVICEFS=y
805# CONFIG_USB_BANDWIDTH is not set 892CONFIG_USB_DEVICE_CLASS=y
806CONFIG_USB_DYNAMIC_MINORS=y 893CONFIG_USB_DYNAMIC_MINORS=y
807# CONFIG_USB_MULTITHREAD_PROBE is not set
808# CONFIG_USB_OTG is not set 894# CONFIG_USB_OTG is not set
895# CONFIG_USB_OTG_WHITELIST is not set
896# CONFIG_USB_OTG_BLACKLIST_HUB is not set
897# CONFIG_USB_MON is not set
898# CONFIG_USB_WUSB is not set
899# CONFIG_USB_WUSB_CBAF is not set
809 900
810# 901#
811# USB Host Controller Drivers 902# USB Host Controller Drivers
812# 903#
904# CONFIG_USB_C67X00_HCD is not set
905# CONFIG_USB_OXU210HP_HCD is not set
813# CONFIG_USB_ISP116X_HCD is not set 906# CONFIG_USB_ISP116X_HCD is not set
907# CONFIG_USB_ISP1760_HCD is not set
814CONFIG_USB_OHCI_HCD=y 908CONFIG_USB_OHCI_HCD=y
815# CONFIG_USB_OHCI_BIG_ENDIAN is not set 909# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
910# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
816CONFIG_USB_OHCI_LITTLE_ENDIAN=y 911CONFIG_USB_OHCI_LITTLE_ENDIAN=y
817# CONFIG_USB_SL811_HCD is not set 912# CONFIG_USB_SL811_HCD is not set
913# CONFIG_USB_R8A66597_HCD is not set
914# CONFIG_USB_HWA_HCD is not set
915# CONFIG_USB_MUSB_HDRC is not set
818 916
819# 917#
820# USB Device Class drivers 918# USB Device Class drivers
821# 919#
822# CONFIG_USB_ACM is not set 920# CONFIG_USB_ACM is not set
823# CONFIG_USB_PRINTER is not set 921# CONFIG_USB_PRINTER is not set
922# CONFIG_USB_WDM is not set
923# CONFIG_USB_TMC is not set
824 924
825# 925#
826# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 926# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
827# 927#
828 928
829# 929#
830# may also be needed; see USB_STORAGE Help for more information 930# also be needed; see USB_STORAGE Help for more info
831# 931#
832CONFIG_USB_STORAGE=y 932CONFIG_USB_STORAGE=y
833# CONFIG_USB_STORAGE_DEBUG is not set 933# CONFIG_USB_STORAGE_DEBUG is not set
834# CONFIG_USB_STORAGE_DATAFAB is not set 934# CONFIG_USB_STORAGE_DATAFAB is not set
835# CONFIG_USB_STORAGE_FREECOM is not set 935# CONFIG_USB_STORAGE_FREECOM is not set
836# CONFIG_USB_STORAGE_DPCM is not set 936# CONFIG_USB_STORAGE_ISD200 is not set
837# CONFIG_USB_STORAGE_USBAT is not set 937# CONFIG_USB_STORAGE_USBAT is not set
838# CONFIG_USB_STORAGE_SDDR09 is not set 938# CONFIG_USB_STORAGE_SDDR09 is not set
839# CONFIG_USB_STORAGE_SDDR55 is not set 939# CONFIG_USB_STORAGE_SDDR55 is not set
840# CONFIG_USB_STORAGE_JUMPSHOT is not set 940# CONFIG_USB_STORAGE_JUMPSHOT is not set
841# CONFIG_USB_STORAGE_ALAUDA is not set 941# CONFIG_USB_STORAGE_ALAUDA is not set
842# CONFIG_USB_STORAGE_KARMA is not set 942# CONFIG_USB_STORAGE_KARMA is not set
943# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
843# CONFIG_USB_LIBUSUAL is not set 944# CONFIG_USB_LIBUSUAL is not set
844 945
845# 946#
846# USB Input Devices
847#
848
849#
850# USB HID Boot Protocol drivers
851#
852
853#
854# USB Imaging devices 947# USB Imaging devices
855# 948#
856# CONFIG_USB_MDC800 is not set 949# CONFIG_USB_MDC800 is not set
857# CONFIG_USB_MICROTEK is not set 950# CONFIG_USB_MICROTEK is not set
858 951
859# 952#
860# USB Network Adapters
861#
862# CONFIG_USB_CATC is not set
863# CONFIG_USB_KAWETH is not set
864# CONFIG_USB_PEGASUS is not set
865CONFIG_USB_RTL8150=y
866# CONFIG_USB_USBNET_MII is not set
867# CONFIG_USB_USBNET is not set
868# CONFIG_USB_MON is not set
869
870#
871# USB port drivers 953# USB port drivers
872# 954#
873
874#
875# USB Serial Converter support
876#
877CONFIG_USB_SERIAL=y 955CONFIG_USB_SERIAL=y
878CONFIG_USB_SERIAL_CONSOLE=y 956CONFIG_USB_SERIAL_CONSOLE=y
957# CONFIG_USB_EZUSB is not set
879# CONFIG_USB_SERIAL_GENERIC is not set 958# CONFIG_USB_SERIAL_GENERIC is not set
880# CONFIG_USB_SERIAL_AIRCABLE is not set 959# CONFIG_USB_SERIAL_AIRCABLE is not set
881# CONFIG_USB_SERIAL_AIRPRIME is not set
882# CONFIG_USB_SERIAL_ARK3116 is not set 960# CONFIG_USB_SERIAL_ARK3116 is not set
883# CONFIG_USB_SERIAL_BELKIN is not set 961# CONFIG_USB_SERIAL_BELKIN is not set
962# CONFIG_USB_SERIAL_CH341 is not set
884# CONFIG_USB_SERIAL_WHITEHEAT is not set 963# CONFIG_USB_SERIAL_WHITEHEAT is not set
885# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 964# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
886# CONFIG_USB_SERIAL_CP2101 is not set 965# CONFIG_USB_SERIAL_CP210X is not set
887# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 966# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
888# CONFIG_USB_SERIAL_EMPEG is not set 967# CONFIG_USB_SERIAL_EMPEG is not set
889# CONFIG_USB_SERIAL_FTDI_SIO is not set 968# CONFIG_USB_SERIAL_FTDI_SIO is not set
@@ -895,6 +974,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
895# CONFIG_USB_SERIAL_EDGEPORT_TI is not set 974# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
896# CONFIG_USB_SERIAL_GARMIN is not set 975# CONFIG_USB_SERIAL_GARMIN is not set
897# CONFIG_USB_SERIAL_IPW is not set 976# CONFIG_USB_SERIAL_IPW is not set
977# CONFIG_USB_SERIAL_IUU is not set
898# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set 978# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
899# CONFIG_USB_SERIAL_KEYSPAN is not set 979# CONFIG_USB_SERIAL_KEYSPAN is not set
900# CONFIG_USB_SERIAL_KLSI is not set 980# CONFIG_USB_SERIAL_KLSI is not set
@@ -902,16 +982,23 @@ CONFIG_USB_SERIAL_CONSOLE=y
902# CONFIG_USB_SERIAL_MCT_U232 is not set 982# CONFIG_USB_SERIAL_MCT_U232 is not set
903# CONFIG_USB_SERIAL_MOS7720 is not set 983# CONFIG_USB_SERIAL_MOS7720 is not set
904# CONFIG_USB_SERIAL_MOS7840 is not set 984# CONFIG_USB_SERIAL_MOS7840 is not set
985# CONFIG_USB_SERIAL_MOTOROLA is not set
905# CONFIG_USB_SERIAL_NAVMAN is not set 986# CONFIG_USB_SERIAL_NAVMAN is not set
906CONFIG_USB_SERIAL_PL2303=y 987CONFIG_USB_SERIAL_PL2303=y
988# CONFIG_USB_SERIAL_OTI6858 is not set
989# CONFIG_USB_SERIAL_QUALCOMM is not set
990# CONFIG_USB_SERIAL_SPCP8X5 is not set
907# CONFIG_USB_SERIAL_HP4X is not set 991# CONFIG_USB_SERIAL_HP4X is not set
908# CONFIG_USB_SERIAL_SAFE is not set 992# CONFIG_USB_SERIAL_SAFE is not set
993# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
909# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set 994# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
995# CONFIG_USB_SERIAL_SYMBOL is not set
910# CONFIG_USB_SERIAL_TI is not set 996# CONFIG_USB_SERIAL_TI is not set
911# CONFIG_USB_SERIAL_CYBERJACK is not set 997# CONFIG_USB_SERIAL_CYBERJACK is not set
912# CONFIG_USB_SERIAL_XIRCOM is not set 998# CONFIG_USB_SERIAL_XIRCOM is not set
913# CONFIG_USB_SERIAL_OPTION is not set 999# CONFIG_USB_SERIAL_OPTION is not set
914# CONFIG_USB_SERIAL_OMNINET is not set 1000# CONFIG_USB_SERIAL_OMNINET is not set
1001# CONFIG_USB_SERIAL_OPTICON is not set
915# CONFIG_USB_SERIAL_DEBUG is not set 1002# CONFIG_USB_SERIAL_DEBUG is not set
916 1003
917# 1004#
@@ -920,38 +1007,34 @@ CONFIG_USB_SERIAL_PL2303=y
920# CONFIG_USB_EMI62 is not set 1007# CONFIG_USB_EMI62 is not set
921# CONFIG_USB_EMI26 is not set 1008# CONFIG_USB_EMI26 is not set
922# CONFIG_USB_ADUTUX is not set 1009# CONFIG_USB_ADUTUX is not set
923# CONFIG_USB_AUERSWALD is not set 1010# CONFIG_USB_SEVSEG is not set
924# CONFIG_USB_RIO500 is not set 1011# CONFIG_USB_RIO500 is not set
925# CONFIG_USB_LEGOTOWER is not set 1012# CONFIG_USB_LEGOTOWER is not set
926# CONFIG_USB_LCD is not set 1013# CONFIG_USB_LCD is not set
1014# CONFIG_USB_BERRY_CHARGE is not set
927# CONFIG_USB_LED is not set 1015# CONFIG_USB_LED is not set
928# CONFIG_USB_CYPRESS_CY7C63 is not set 1016# CONFIG_USB_CYPRESS_CY7C63 is not set
929# CONFIG_USB_CYTHERM is not set 1017# CONFIG_USB_CYTHERM is not set
930# CONFIG_USB_PHIDGET is not set
931# CONFIG_USB_IDMOUSE is not set 1018# CONFIG_USB_IDMOUSE is not set
932# CONFIG_USB_FTDI_ELAN is not set 1019# CONFIG_USB_FTDI_ELAN is not set
933# CONFIG_USB_APPLEDISPLAY is not set 1020# CONFIG_USB_APPLEDISPLAY is not set
934# CONFIG_USB_LD is not set 1021# CONFIG_USB_LD is not set
935# CONFIG_USB_TRANCEVIBRATOR is not set 1022# CONFIG_USB_TRANCEVIBRATOR is not set
1023# CONFIG_USB_IOWARRIOR is not set
936# CONFIG_USB_TEST is not set 1024# CONFIG_USB_TEST is not set
937 1025# CONFIG_USB_ISIGHTFW is not set
938# 1026# CONFIG_USB_VST is not set
939# USB DSL modem support
940#
941
942#
943# USB Gadget Support
944#
945# CONFIG_USB_GADGET is not set 1027# CONFIG_USB_GADGET is not set
946 1028
947# 1029#
948# MMC/SD Card support 1030# OTG and related infrastructure
949# 1031#
1032# CONFIG_USB_GPIO_VBUS is not set
1033# CONFIG_NOP_USB_XCEIV is not set
950# CONFIG_MMC is not set 1034# CONFIG_MMC is not set
951 1035# CONFIG_MEMSTICK is not set
952# 1036# CONFIG_ACCESSIBILITY is not set
953# Real Time Clock 1037# CONFIG_NEW_LEDS is not set
954#
955CONFIG_RTC_LIB=y 1038CONFIG_RTC_LIB=y
956CONFIG_RTC_CLASS=y 1039CONFIG_RTC_CLASS=y
957CONFIG_RTC_HCTOSYS=y 1040CONFIG_RTC_HCTOSYS=y
@@ -965,24 +1048,55 @@ CONFIG_RTC_INTF_SYSFS=y
965CONFIG_RTC_INTF_PROC=y 1048CONFIG_RTC_INTF_PROC=y
966CONFIG_RTC_INTF_DEV=y 1049CONFIG_RTC_INTF_DEV=y
967# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 1050# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1051# CONFIG_RTC_DRV_TEST is not set
968 1052
969# 1053#
970# RTC drivers 1054# I2C RTC drivers
971# 1055#
972# CONFIG_RTC_DRV_X1205 is not set
973CONFIG_RTC_DRV_DS1307=y 1056CONFIG_RTC_DRV_DS1307=y
974# CONFIG_RTC_DRV_DS1553 is not set 1057# CONFIG_RTC_DRV_DS1374 is not set
975# CONFIG_RTC_DRV_ISL1208 is not set
976# CONFIG_RTC_DRV_DS1672 is not set 1058# CONFIG_RTC_DRV_DS1672 is not set
977# CONFIG_RTC_DRV_DS1742 is not set 1059# CONFIG_RTC_DRV_MAX6900 is not set
1060# CONFIG_RTC_DRV_RS5C372 is not set
1061# CONFIG_RTC_DRV_ISL1208 is not set
1062# CONFIG_RTC_DRV_X1205 is not set
978# CONFIG_RTC_DRV_PCF8563 is not set 1063# CONFIG_RTC_DRV_PCF8563 is not set
979# CONFIG_RTC_DRV_PCF8583 is not set 1064# CONFIG_RTC_DRV_PCF8583 is not set
980# CONFIG_RTC_DRV_RS5C372 is not set 1065# CONFIG_RTC_DRV_M41T80 is not set
1066# CONFIG_RTC_DRV_S35390A is not set
1067# CONFIG_RTC_DRV_FM3130 is not set
1068# CONFIG_RTC_DRV_RX8581 is not set
1069
1070#
1071# SPI RTC drivers
1072#
1073
1074#
1075# Platform RTC drivers
1076#
1077# CONFIG_RTC_DRV_CMOS is not set
1078# CONFIG_RTC_DRV_DS1286 is not set
1079# CONFIG_RTC_DRV_DS1511 is not set
1080# CONFIG_RTC_DRV_DS1553 is not set
1081# CONFIG_RTC_DRV_DS1742 is not set
1082# CONFIG_RTC_DRV_STK17TA8 is not set
981CONFIG_RTC_DRV_M48T86=y 1083CONFIG_RTC_DRV_M48T86=y
1084# CONFIG_RTC_DRV_M48T35 is not set
1085# CONFIG_RTC_DRV_M48T59 is not set
1086# CONFIG_RTC_DRV_BQ4802 is not set
1087# CONFIG_RTC_DRV_V3020 is not set
1088
1089#
1090# on-CPU RTC drivers
1091#
982CONFIG_RTC_DRV_EP93XX=y 1092CONFIG_RTC_DRV_EP93XX=y
1093# CONFIG_RTC_DRV_PL030 is not set
983# CONFIG_RTC_DRV_PL031 is not set 1094# CONFIG_RTC_DRV_PL031 is not set
984# CONFIG_RTC_DRV_TEST is not set 1095# CONFIG_DMADEVICES is not set
985# CONFIG_RTC_DRV_V3020 is not set 1096# CONFIG_AUXDISPLAY is not set
1097# CONFIG_REGULATOR is not set
1098# CONFIG_UIO is not set
1099# CONFIG_STAGING is not set
986 1100
987# 1101#
988# File systems 1102# File systems
@@ -991,27 +1105,31 @@ CONFIG_EXT2_FS=y
991# CONFIG_EXT2_FS_XATTR is not set 1105# CONFIG_EXT2_FS_XATTR is not set
992# CONFIG_EXT2_FS_XIP is not set 1106# CONFIG_EXT2_FS_XIP is not set
993CONFIG_EXT3_FS=y 1107CONFIG_EXT3_FS=y
1108# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
994# CONFIG_EXT3_FS_XATTR is not set 1109# CONFIG_EXT3_FS_XATTR is not set
995# CONFIG_EXT4DEV_FS is not set 1110# CONFIG_EXT4_FS is not set
996CONFIG_JBD=y 1111CONFIG_JBD=y
997# CONFIG_JBD_DEBUG is not set
998# CONFIG_REISERFS_FS is not set 1112# CONFIG_REISERFS_FS is not set
999# CONFIG_JFS_FS is not set 1113# CONFIG_JFS_FS is not set
1000# CONFIG_FS_POSIX_ACL is not set 1114# CONFIG_FS_POSIX_ACL is not set
1115CONFIG_FILE_LOCKING=y
1001# CONFIG_XFS_FS is not set 1116# CONFIG_XFS_FS is not set
1002# CONFIG_GFS2_FS is not set
1003# CONFIG_OCFS2_FS is not set 1117# CONFIG_OCFS2_FS is not set
1004# CONFIG_MINIX_FS is not set 1118# CONFIG_BTRFS_FS is not set
1005# CONFIG_ROMFS_FS is not set 1119CONFIG_DNOTIFY=y
1006CONFIG_INOTIFY=y 1120CONFIG_INOTIFY=y
1007CONFIG_INOTIFY_USER=y 1121CONFIG_INOTIFY_USER=y
1008# CONFIG_QUOTA is not set 1122# CONFIG_QUOTA is not set
1009CONFIG_DNOTIFY=y
1010# CONFIG_AUTOFS_FS is not set 1123# CONFIG_AUTOFS_FS is not set
1011# CONFIG_AUTOFS4_FS is not set 1124# CONFIG_AUTOFS4_FS is not set
1012# CONFIG_FUSE_FS is not set 1125# CONFIG_FUSE_FS is not set
1013 1126
1014# 1127#
1128# Caches
1129#
1130# CONFIG_FSCACHE is not set
1131
1132#
1015# CD-ROM/DVD Filesystems 1133# CD-ROM/DVD Filesystems
1016# 1134#
1017# CONFIG_ISO9660_FS is not set 1135# CONFIG_ISO9660_FS is not set
@@ -1032,16 +1150,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1032# 1150#
1033CONFIG_PROC_FS=y 1151CONFIG_PROC_FS=y
1034CONFIG_PROC_SYSCTL=y 1152CONFIG_PROC_SYSCTL=y
1153CONFIG_PROC_PAGE_MONITOR=y
1035CONFIG_SYSFS=y 1154CONFIG_SYSFS=y
1036CONFIG_TMPFS=y 1155CONFIG_TMPFS=y
1037# CONFIG_TMPFS_POSIX_ACL is not set 1156# CONFIG_TMPFS_POSIX_ACL is not set
1038# CONFIG_HUGETLB_PAGE is not set 1157# CONFIG_HUGETLB_PAGE is not set
1039CONFIG_RAMFS=y
1040# CONFIG_CONFIGFS_FS is not set 1158# CONFIG_CONFIGFS_FS is not set
1041 1159CONFIG_MISC_FILESYSTEMS=y
1042#
1043# Miscellaneous filesystems
1044#
1045# CONFIG_ADFS_FS is not set 1160# CONFIG_ADFS_FS is not set
1046# CONFIG_AFFS_FS is not set 1161# CONFIG_AFFS_FS is not set
1047# CONFIG_HFS_FS is not set 1162# CONFIG_HFS_FS is not set
@@ -1049,33 +1164,35 @@ CONFIG_RAMFS=y
1049# CONFIG_BEFS_FS is not set 1164# CONFIG_BEFS_FS is not set
1050# CONFIG_BFS_FS is not set 1165# CONFIG_BFS_FS is not set
1051# CONFIG_EFS_FS is not set 1166# CONFIG_EFS_FS is not set
1052# CONFIG_JFFS_FS is not set
1053CONFIG_JFFS2_FS=y 1167CONFIG_JFFS2_FS=y
1054CONFIG_JFFS2_FS_DEBUG=0 1168CONFIG_JFFS2_FS_DEBUG=0
1055CONFIG_JFFS2_FS_WRITEBUFFER=y 1169CONFIG_JFFS2_FS_WRITEBUFFER=y
1170# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1056# CONFIG_JFFS2_SUMMARY is not set 1171# CONFIG_JFFS2_SUMMARY is not set
1057# CONFIG_JFFS2_FS_XATTR is not set 1172# CONFIG_JFFS2_FS_XATTR is not set
1058# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 1173# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1059CONFIG_JFFS2_ZLIB=y 1174CONFIG_JFFS2_ZLIB=y
1175# CONFIG_JFFS2_LZO is not set
1060CONFIG_JFFS2_RTIME=y 1176CONFIG_JFFS2_RTIME=y
1061# CONFIG_JFFS2_RUBIN is not set 1177# CONFIG_JFFS2_RUBIN is not set
1062# CONFIG_CRAMFS is not set 1178# CONFIG_CRAMFS is not set
1179# CONFIG_SQUASHFS is not set
1063# CONFIG_VXFS_FS is not set 1180# CONFIG_VXFS_FS is not set
1181# CONFIG_MINIX_FS is not set
1182# CONFIG_OMFS_FS is not set
1064# CONFIG_HPFS_FS is not set 1183# CONFIG_HPFS_FS is not set
1065# CONFIG_QNX4FS_FS is not set 1184# CONFIG_QNX4FS_FS is not set
1185# CONFIG_ROMFS_FS is not set
1066# CONFIG_SYSV_FS is not set 1186# CONFIG_SYSV_FS is not set
1067# CONFIG_UFS_FS is not set 1187# CONFIG_UFS_FS is not set
1068 1188# CONFIG_NILFS2_FS is not set
1069# 1189CONFIG_NETWORK_FILESYSTEMS=y
1070# Network File Systems
1071#
1072CONFIG_NFS_FS=y 1190CONFIG_NFS_FS=y
1073CONFIG_NFS_V3=y 1191CONFIG_NFS_V3=y
1074# CONFIG_NFS_V3_ACL is not set 1192# CONFIG_NFS_V3_ACL is not set
1075# CONFIG_NFS_V4 is not set 1193# CONFIG_NFS_V4 is not set
1076# CONFIG_NFS_DIRECTIO is not set
1077# CONFIG_NFSD is not set
1078CONFIG_ROOT_NFS=y 1194CONFIG_ROOT_NFS=y
1195# CONFIG_NFSD is not set
1079CONFIG_LOCKD=y 1196CONFIG_LOCKD=y
1080CONFIG_LOCKD_V4=y 1197CONFIG_LOCKD_V4=y
1081CONFIG_NFS_COMMON=y 1198CONFIG_NFS_COMMON=y
@@ -1087,7 +1204,6 @@ CONFIG_SUNRPC=y
1087# CONFIG_NCP_FS is not set 1204# CONFIG_NCP_FS is not set
1088# CONFIG_CODA_FS is not set 1205# CONFIG_CODA_FS is not set
1089# CONFIG_AFS_FS is not set 1206# CONFIG_AFS_FS is not set
1090# CONFIG_9P_FS is not set
1091 1207
1092# 1208#
1093# Partition Types 1209# Partition Types
@@ -1109,10 +1225,7 @@ CONFIG_MSDOS_PARTITION=y
1109# CONFIG_SUN_PARTITION is not set 1225# CONFIG_SUN_PARTITION is not set
1110# CONFIG_KARMA_PARTITION is not set 1226# CONFIG_KARMA_PARTITION is not set
1111# CONFIG_EFI_PARTITION is not set 1227# CONFIG_EFI_PARTITION is not set
1112 1228# CONFIG_SYSV68_PARTITION is not set
1113#
1114# Native Language Support
1115#
1116CONFIG_NLS=y 1229CONFIG_NLS=y
1117CONFIG_NLS_DEFAULT="iso8859-1" 1230CONFIG_NLS_DEFAULT="iso8859-1"
1118CONFIG_NLS_CODEPAGE_437=y 1231CONFIG_NLS_CODEPAGE_437=y
@@ -1153,49 +1266,83 @@ CONFIG_NLS_ISO8859_1=y
1153# CONFIG_NLS_KOI8_R is not set 1266# CONFIG_NLS_KOI8_R is not set
1154# CONFIG_NLS_KOI8_U is not set 1267# CONFIG_NLS_KOI8_U is not set
1155# CONFIG_NLS_UTF8 is not set 1268# CONFIG_NLS_UTF8 is not set
1156
1157#
1158# Distributed Lock Manager
1159#
1160# CONFIG_DLM is not set 1269# CONFIG_DLM is not set
1161 1270
1162# 1271#
1163# Profiling support
1164#
1165# CONFIG_PROFILING is not set
1166
1167#
1168# Kernel hacking 1272# Kernel hacking
1169# 1273#
1170# CONFIG_PRINTK_TIME is not set 1274# CONFIG_PRINTK_TIME is not set
1275CONFIG_ENABLE_WARN_DEPRECATED=y
1171CONFIG_ENABLE_MUST_CHECK=y 1276CONFIG_ENABLE_MUST_CHECK=y
1277CONFIG_FRAME_WARN=1024
1172CONFIG_MAGIC_SYSRQ=y 1278CONFIG_MAGIC_SYSRQ=y
1173# CONFIG_UNUSED_SYMBOLS is not set 1279# CONFIG_UNUSED_SYMBOLS is not set
1174# CONFIG_DEBUG_FS is not set 1280# CONFIG_DEBUG_FS is not set
1175# CONFIG_HEADERS_CHECK is not set 1281# CONFIG_HEADERS_CHECK is not set
1176CONFIG_DEBUG_KERNEL=y 1282CONFIG_DEBUG_KERNEL=y
1177CONFIG_LOG_BUF_SHIFT=14 1283# CONFIG_DEBUG_SHIRQ is not set
1178CONFIG_DETECT_SOFTLOCKUP=y 1284CONFIG_DETECT_SOFTLOCKUP=y
1285# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1286CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1287CONFIG_DETECT_HUNG_TASK=y
1288# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1289CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1290CONFIG_SCHED_DEBUG=y
1179# CONFIG_SCHEDSTATS is not set 1291# CONFIG_SCHEDSTATS is not set
1292# CONFIG_TIMER_STATS is not set
1293# CONFIG_DEBUG_OBJECTS is not set
1180CONFIG_DEBUG_SLAB=y 1294CONFIG_DEBUG_SLAB=y
1181# CONFIG_DEBUG_SLAB_LEAK is not set 1295# CONFIG_DEBUG_SLAB_LEAK is not set
1182# CONFIG_DEBUG_RT_MUTEXES is not set 1296# CONFIG_DEBUG_RT_MUTEXES is not set
1183# CONFIG_RT_MUTEX_TESTER is not set 1297# CONFIG_RT_MUTEX_TESTER is not set
1184CONFIG_DEBUG_SPINLOCK=y 1298CONFIG_DEBUG_SPINLOCK=y
1185CONFIG_DEBUG_MUTEXES=y 1299CONFIG_DEBUG_MUTEXES=y
1186# CONFIG_DEBUG_RWSEMS is not set 1300# CONFIG_DEBUG_LOCK_ALLOC is not set
1301# CONFIG_PROVE_LOCKING is not set
1302# CONFIG_LOCK_STAT is not set
1187# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1303# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1188# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1304# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1189# CONFIG_DEBUG_KOBJECT is not set 1305# CONFIG_DEBUG_KOBJECT is not set
1190CONFIG_DEBUG_BUGVERBOSE=y 1306CONFIG_DEBUG_BUGVERBOSE=y
1191# CONFIG_DEBUG_INFO is not set 1307# CONFIG_DEBUG_INFO is not set
1192# CONFIG_DEBUG_VM is not set 1308# CONFIG_DEBUG_VM is not set
1309# CONFIG_DEBUG_WRITECOUNT is not set
1310# CONFIG_DEBUG_MEMORY_INIT is not set
1193# CONFIG_DEBUG_LIST is not set 1311# CONFIG_DEBUG_LIST is not set
1194CONFIG_FRAME_POINTER=y 1312# CONFIG_DEBUG_SG is not set
1195CONFIG_FORCED_INLINING=y 1313# CONFIG_DEBUG_NOTIFIERS is not set
1314# CONFIG_BOOT_PRINTK_DELAY is not set
1196# CONFIG_RCU_TORTURE_TEST is not set 1315# CONFIG_RCU_TORTURE_TEST is not set
1316# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1317# CONFIG_BACKTRACE_SELF_TEST is not set
1318# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1319# CONFIG_FAULT_INJECTION is not set
1320# CONFIG_LATENCYTOP is not set
1321# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1322# CONFIG_PAGE_POISONING is not set
1323CONFIG_HAVE_FUNCTION_TRACER=y
1324CONFIG_TRACING_SUPPORT=y
1325
1326#
1327# Tracers
1328#
1329# CONFIG_FUNCTION_TRACER is not set
1330# CONFIG_SCHED_TRACER is not set
1331# CONFIG_CONTEXT_SWITCH_TRACER is not set
1332# CONFIG_EVENT_TRACER is not set
1333# CONFIG_BOOT_TRACER is not set
1334# CONFIG_TRACE_BRANCH_PROFILING is not set
1335# CONFIG_STACK_TRACER is not set
1336# CONFIG_KMEMTRACE is not set
1337# CONFIG_WORKQUEUE_TRACER is not set
1338# CONFIG_BLK_DEV_IO_TRACE is not set
1339# CONFIG_SAMPLES is not set
1340CONFIG_HAVE_ARCH_KGDB=y
1341# CONFIG_KGDB is not set
1342CONFIG_ARM_UNWIND=y
1197CONFIG_DEBUG_USER=y 1343CONFIG_DEBUG_USER=y
1198CONFIG_DEBUG_ERRORS=y 1344CONFIG_DEBUG_ERRORS=y
1345# CONFIG_DEBUG_STACK_USAGE is not set
1199CONFIG_DEBUG_LL=y 1346CONFIG_DEBUG_LL=y
1200# CONFIG_DEBUG_ICEDCC is not set 1347# CONFIG_DEBUG_ICEDCC is not set
1201 1348
@@ -1204,21 +1351,115 @@ CONFIG_DEBUG_LL=y
1204# 1351#
1205# CONFIG_KEYS is not set 1352# CONFIG_KEYS is not set
1206# CONFIG_SECURITY is not set 1353# CONFIG_SECURITY is not set
1354# CONFIG_SECURITYFS is not set
1355# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1356CONFIG_CRYPTO=y
1357
1358#
1359# Crypto core or helper
1360#
1361# CONFIG_CRYPTO_FIPS is not set
1362CONFIG_CRYPTO_ALGAPI=y
1363CONFIG_CRYPTO_ALGAPI2=y
1364CONFIG_CRYPTO_HASH=y
1365CONFIG_CRYPTO_HASH2=y
1366# CONFIG_CRYPTO_MANAGER is not set
1367# CONFIG_CRYPTO_MANAGER2 is not set
1368# CONFIG_CRYPTO_GF128MUL is not set
1369# CONFIG_CRYPTO_NULL is not set
1370# CONFIG_CRYPTO_CRYPTD is not set
1371# CONFIG_CRYPTO_AUTHENC is not set
1372# CONFIG_CRYPTO_TEST is not set
1373
1374#
1375# Authenticated Encryption with Associated Data
1376#
1377# CONFIG_CRYPTO_CCM is not set
1378# CONFIG_CRYPTO_GCM is not set
1379# CONFIG_CRYPTO_SEQIV is not set
1380
1381#
1382# Block modes
1383#
1384# CONFIG_CRYPTO_CBC is not set
1385# CONFIG_CRYPTO_CTR is not set
1386# CONFIG_CRYPTO_CTS is not set
1387# CONFIG_CRYPTO_ECB is not set
1388# CONFIG_CRYPTO_LRW is not set
1389# CONFIG_CRYPTO_PCBC is not set
1390# CONFIG_CRYPTO_XTS is not set
1391
1392#
1393# Hash modes
1394#
1395# CONFIG_CRYPTO_HMAC is not set
1396# CONFIG_CRYPTO_XCBC is not set
1397
1398#
1399# Digest
1400#
1401CONFIG_CRYPTO_CRC32C=y
1402# CONFIG_CRYPTO_MD4 is not set
1403# CONFIG_CRYPTO_MD5 is not set
1404# CONFIG_CRYPTO_MICHAEL_MIC is not set
1405# CONFIG_CRYPTO_RMD128 is not set
1406# CONFIG_CRYPTO_RMD160 is not set
1407# CONFIG_CRYPTO_RMD256 is not set
1408# CONFIG_CRYPTO_RMD320 is not set
1409# CONFIG_CRYPTO_SHA1 is not set
1410# CONFIG_CRYPTO_SHA256 is not set
1411# CONFIG_CRYPTO_SHA512 is not set
1412# CONFIG_CRYPTO_TGR192 is not set
1413# CONFIG_CRYPTO_WP512 is not set
1414
1415#
1416# Ciphers
1417#
1418# CONFIG_CRYPTO_AES is not set
1419# CONFIG_CRYPTO_ANUBIS is not set
1420# CONFIG_CRYPTO_ARC4 is not set
1421# CONFIG_CRYPTO_BLOWFISH is not set
1422# CONFIG_CRYPTO_CAMELLIA is not set
1423# CONFIG_CRYPTO_CAST5 is not set
1424# CONFIG_CRYPTO_CAST6 is not set
1425# CONFIG_CRYPTO_DES is not set
1426# CONFIG_CRYPTO_FCRYPT is not set
1427# CONFIG_CRYPTO_KHAZAD is not set
1428# CONFIG_CRYPTO_SALSA20 is not set
1429# CONFIG_CRYPTO_SEED is not set
1430# CONFIG_CRYPTO_SERPENT is not set
1431# CONFIG_CRYPTO_TEA is not set
1432# CONFIG_CRYPTO_TWOFISH is not set
1433
1434#
1435# Compression
1436#
1437# CONFIG_CRYPTO_DEFLATE is not set
1438# CONFIG_CRYPTO_ZLIB is not set
1439# CONFIG_CRYPTO_LZO is not set
1207 1440
1208# 1441#
1209# Cryptographic options 1442# Random Number Generation
1210# 1443#
1211# CONFIG_CRYPTO is not set 1444# CONFIG_CRYPTO_ANSI_CPRNG is not set
1445CONFIG_CRYPTO_HW=y
1446# CONFIG_BINARY_PRINTF is not set
1212 1447
1213# 1448#
1214# Library routines 1449# Library routines
1215# 1450#
1216CONFIG_BITREVERSE=y 1451CONFIG_BITREVERSE=y
1452CONFIG_GENERIC_FIND_LAST_BIT=y
1217# CONFIG_CRC_CCITT is not set 1453# CONFIG_CRC_CCITT is not set
1218# CONFIG_CRC16 is not set 1454# CONFIG_CRC16 is not set
1455# CONFIG_CRC_T10DIF is not set
1456# CONFIG_CRC_ITU_T is not set
1219CONFIG_CRC32=y 1457CONFIG_CRC32=y
1458# CONFIG_CRC7 is not set
1220CONFIG_LIBCRC32C=y 1459CONFIG_LIBCRC32C=y
1221CONFIG_ZLIB_INFLATE=y 1460CONFIG_ZLIB_INFLATE=y
1222CONFIG_ZLIB_DEFLATE=y 1461CONFIG_ZLIB_DEFLATE=y
1223CONFIG_PLIST=y 1462CONFIG_HAS_IOMEM=y
1224CONFIG_IOMAP_COPY=y 1463CONFIG_HAS_IOPORT=y
1464CONFIG_HAS_DMA=y
1465CONFIG_NLATTR=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index dcf8153a947d..0a1abb978d7e 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -182,6 +182,7 @@ CONFIG_ARCH_KIRKWOOD=y
182CONFIG_MACH_DB88F6281_BP=y 182CONFIG_MACH_DB88F6281_BP=y
183CONFIG_MACH_RD88F6192_NAS=y 183CONFIG_MACH_RD88F6192_NAS=y
184CONFIG_MACH_RD88F6281=y 184CONFIG_MACH_RD88F6281=y
185CONFIG_MACH_MV88F6281GTW_GE=y
185CONFIG_MACH_SHEEVAPLUG=y 186CONFIG_MACH_SHEEVAPLUG=y
186CONFIG_MACH_TS219=y 187CONFIG_MACH_TS219=y
187CONFIG_PLAT_ORION=y 188CONFIG_PLAT_ORION=y
@@ -270,7 +271,9 @@ CONFIG_CMDLINE=""
270# 271#
271# CPU Power Management 272# CPU Power Management
272# 273#
273# CONFIG_CPU_IDLE is not set 274CONFIG_CPU_IDLE=y
275CONFIG_CPU_IDLE_GOV_LADDER=y
276CONFIG_CPU_IDLE_GOV_MENU=y
274 277
275# 278#
276# Floating point emulation 279# Floating point emulation
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
index f56837f69ca7..957fd5fa27ca 100644
--- a/arch/arm/configs/magician_defconfig
+++ b/arch/arm/configs/magician_defconfig
@@ -190,6 +190,7 @@ CONFIG_ARCH_PXA=y
190# CONFIG_MACH_SAAR is not set 190# CONFIG_MACH_SAAR is not set
191# CONFIG_MACH_ARMCORE is not set 191# CONFIG_MACH_ARMCORE is not set
192# CONFIG_MACH_CM_X300 is not set 192# CONFIG_MACH_CM_X300 is not set
193CONFIG_MACH_H4700=y
193CONFIG_MACH_MAGICIAN=y 194CONFIG_MACH_MAGICIAN=y
194# CONFIG_MACH_MIOA701 is not set 195# CONFIG_MACH_MIOA701 is not set
195# CONFIG_MACH_PCM027 is not set 196# CONFIG_MACH_PCM027 is not set
@@ -828,7 +829,7 @@ CONFIG_SSB_POSSIBLE=y
828# 829#
829# CONFIG_MFD_CORE is not set 830# CONFIG_MFD_CORE is not set
830# CONFIG_MFD_SM501 is not set 831# CONFIG_MFD_SM501 is not set
831# CONFIG_MFD_ASIC3 is not set 832CONFIG_MFD_ASIC3=y
832CONFIG_HTC_EGPIO=y 833CONFIG_HTC_EGPIO=y
833CONFIG_HTC_PASIC3=y 834CONFIG_HTC_PASIC3=y
834# CONFIG_TPS65010 is not set 835# CONFIG_TPS65010 is not set
@@ -891,7 +892,7 @@ CONFIG_FB_PXA_OVERLAY=y
891# CONFIG_FB_PXA_SMARTPANEL is not set 892# CONFIG_FB_PXA_SMARTPANEL is not set
892# CONFIG_FB_PXA_PARAMETERS is not set 893# CONFIG_FB_PXA_PARAMETERS is not set
893# CONFIG_FB_MBX is not set 894# CONFIG_FB_MBX is not set
894# CONFIG_FB_W100 is not set 895CONFIG_FB_W100=y
895# CONFIG_FB_VIRTUAL is not set 896# CONFIG_FB_VIRTUAL is not set
896# CONFIG_FB_METRONOME is not set 897# CONFIG_FB_METRONOME is not set
897# CONFIG_FB_MB862XX is not set 898# CONFIG_FB_MB862XX is not set
diff --git a/arch/arm/configs/mx21_defconfig b/arch/arm/configs/mx21_defconfig
new file mode 100644
index 000000000000..4b04290d8e81
--- /dev/null
+++ b/arch/arm/configs/mx21_defconfig
@@ -0,0 +1,1170 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc1
4# Tue Apr 14 16:58:09 2009
5#
6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y
8CONFIG_SYS_SUPPORTS_APM_EMULATION=y
9CONFIG_GENERIC_GPIO=y
10CONFIG_GENERIC_TIME=y
11CONFIG_GENERIC_CLOCKEVENTS=y
12CONFIG_MMU=y
13# CONFIG_NO_IOPORT is not set
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_STACKTRACE_SUPPORT=y
16CONFIG_HAVE_LATENCYTOP_SUPPORT=y
17CONFIG_LOCKDEP_SUPPORT=y
18CONFIG_TRACE_IRQFLAGS_SUPPORT=y
19CONFIG_HARDIRQS_SW_RESEND=y
20CONFIG_GENERIC_IRQ_PROBE=y
21CONFIG_RWSEM_GENERIC_SPINLOCK=y
22# CONFIG_ARCH_HAS_ILOG2_U32 is not set
23# CONFIG_ARCH_HAS_ILOG2_U64 is not set
24CONFIG_GENERIC_HWEIGHT=y
25CONFIG_GENERIC_CALIBRATE_DELAY=y
26CONFIG_ARCH_MTD_XIP=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
30
31#
32# General setup
33#
34CONFIG_EXPERIMENTAL=y
35CONFIG_BROKEN_ON_SMP=y
36CONFIG_LOCK_KERNEL=y
37CONFIG_INIT_ENV_ARG_LIMIT=32
38CONFIG_LOCALVERSION=""
39CONFIG_LOCALVERSION_AUTO=y
40# CONFIG_SWAP is not set
41CONFIG_SYSVIPC=y
42CONFIG_SYSVIPC_SYSCTL=y
43# CONFIG_POSIX_MQUEUE is not set
44# CONFIG_BSD_PROCESS_ACCT is not set
45# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56# CONFIG_IKCONFIG is not set
57CONFIG_LOG_BUF_SHIFT=14
58# CONFIG_GROUP_SCHED is not set
59# CONFIG_CGROUPS is not set
60CONFIG_SYSFS_DEPRECATED=y
61CONFIG_SYSFS_DEPRECATED_V2=y
62# CONFIG_RELAY is not set
63# CONFIG_NAMESPACES is not set
64# CONFIG_BLK_DEV_INITRD is not set
65# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68CONFIG_EMBEDDED=y
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72CONFIG_KALLSYMS_EXTRA_PASS=y
73CONFIG_HOTPLUG=y
74CONFIG_PRINTK=y
75CONFIG_BUG=y
76CONFIG_ELF_CORE=y
77CONFIG_BASE_FULL=y
78CONFIG_FUTEX=y
79CONFIG_EPOLL=y
80CONFIG_SIGNALFD=y
81CONFIG_TIMERFD=y
82CONFIG_EVENTFD=y
83CONFIG_SHMEM=y
84CONFIG_AIO=y
85CONFIG_VM_EVENT_COUNTERS=y
86CONFIG_COMPAT_BRK=y
87CONFIG_SLAB=y
88# CONFIG_SLUB is not set
89# CONFIG_SLOB is not set
90# CONFIG_PROFILING is not set
91# CONFIG_MARKERS is not set
92CONFIG_HAVE_OPROFILE=y
93# CONFIG_KPROBES is not set
94CONFIG_HAVE_KPROBES=y
95CONFIG_HAVE_KRETPROBES=y
96# CONFIG_SLOW_WORK is not set
97CONFIG_HAVE_GENERIC_DMA_COHERENT=y
98CONFIG_SLABINFO=y
99CONFIG_RT_MUTEXES=y
100CONFIG_BASE_SMALL=0
101CONFIG_MODULES=y
102# CONFIG_MODULE_FORCE_LOAD is not set
103CONFIG_MODULE_UNLOAD=y
104# CONFIG_MODULE_FORCE_UNLOAD is not set
105# CONFIG_MODVERSIONS is not set
106# CONFIG_MODULE_SRCVERSION_ALL is not set
107CONFIG_BLOCK=y
108# CONFIG_LBD is not set
109# CONFIG_BLK_DEV_BSG is not set
110# CONFIG_BLK_DEV_INTEGRITY is not set
111
112#
113# IO Schedulers
114#
115CONFIG_IOSCHED_NOOP=y
116# CONFIG_IOSCHED_AS is not set
117# CONFIG_IOSCHED_DEADLINE is not set
118# CONFIG_IOSCHED_CFQ is not set
119# CONFIG_DEFAULT_AS is not set
120# CONFIG_DEFAULT_DEADLINE is not set
121# CONFIG_DEFAULT_CFQ is not set
122CONFIG_DEFAULT_NOOP=y
123CONFIG_DEFAULT_IOSCHED="noop"
124# CONFIG_FREEZER is not set
125
126#
127# System Type
128#
129# CONFIG_ARCH_AAEC2000 is not set
130# CONFIG_ARCH_INTEGRATOR is not set
131# CONFIG_ARCH_REALVIEW is not set
132# CONFIG_ARCH_VERSATILE is not set
133# CONFIG_ARCH_AT91 is not set
134# CONFIG_ARCH_CLPS711X is not set
135# CONFIG_ARCH_EBSA110 is not set
136# CONFIG_ARCH_EP93XX is not set
137# CONFIG_ARCH_GEMINI is not set
138# CONFIG_ARCH_FOOTBRIDGE is not set
139# CONFIG_ARCH_NETX is not set
140# CONFIG_ARCH_H720X is not set
141# CONFIG_ARCH_IOP13XX is not set
142# CONFIG_ARCH_IOP32X is not set
143# CONFIG_ARCH_IOP33X is not set
144# CONFIG_ARCH_IXP23XX is not set
145# CONFIG_ARCH_IXP2000 is not set
146# CONFIG_ARCH_IXP4XX is not set
147# CONFIG_ARCH_L7200 is not set
148# CONFIG_ARCH_KIRKWOOD is not set
149# CONFIG_ARCH_KS8695 is not set
150# CONFIG_ARCH_NS9XXX is not set
151# CONFIG_ARCH_LOKI is not set
152# CONFIG_ARCH_MV78XX0 is not set
153CONFIG_ARCH_MXC=y
154# CONFIG_ARCH_ORION5X is not set
155# CONFIG_ARCH_PNX4008 is not set
156# CONFIG_ARCH_PXA is not set
157# CONFIG_ARCH_MMP is not set
158# CONFIG_ARCH_RPC is not set
159# CONFIG_ARCH_SA1100 is not set
160# CONFIG_ARCH_S3C2410 is not set
161# CONFIG_ARCH_S3C64XX is not set
162# CONFIG_ARCH_SHARK is not set
163# CONFIG_ARCH_LH7A40X is not set
164# CONFIG_ARCH_DAVINCI is not set
165# CONFIG_ARCH_OMAP is not set
166# CONFIG_ARCH_MSM is not set
167# CONFIG_ARCH_W90X900 is not set
168
169#
170# Freescale MXC Implementations
171#
172# CONFIG_ARCH_MX1 is not set
173CONFIG_ARCH_MX2=y
174# CONFIG_ARCH_MX3 is not set
175CONFIG_MACH_MX21=y
176# CONFIG_MACH_MX27 is not set
177
178#
179# MX2 platforms:
180#
181CONFIG_MACH_MX21ADS=y
182# CONFIG_MXC_IRQ_PRIOR is not set
183CONFIG_MXC_PWM=y
184
185#
186# Processor Type
187#
188CONFIG_CPU_32=y
189CONFIG_CPU_ARM926T=y
190CONFIG_CPU_32v5=y
191CONFIG_CPU_ABRT_EV5TJ=y
192CONFIG_CPU_PABRT_NOIFAR=y
193CONFIG_CPU_CACHE_VIVT=y
194CONFIG_CPU_COPY_V4WB=y
195CONFIG_CPU_TLB_V4WBI=y
196CONFIG_CPU_CP15=y
197CONFIG_CPU_CP15_MMU=y
198
199#
200# Processor Features
201#
202CONFIG_ARM_THUMB=y
203# CONFIG_CPU_ICACHE_DISABLE is not set
204# CONFIG_CPU_DCACHE_DISABLE is not set
205# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
206# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
207# CONFIG_OUTER_CACHE is not set
208CONFIG_COMMON_CLKDEV=y
209
210#
211# Bus support
212#
213# CONFIG_PCI_SYSCALL is not set
214# CONFIG_ARCH_SUPPORTS_MSI is not set
215# CONFIG_PCCARD is not set
216
217#
218# Kernel Features
219#
220CONFIG_TICK_ONESHOT=y
221CONFIG_NO_HZ=y
222CONFIG_HIGH_RES_TIMERS=y
223CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
224CONFIG_VMSPLIT_3G=y
225# CONFIG_VMSPLIT_2G is not set
226# CONFIG_VMSPLIT_1G is not set
227CONFIG_PAGE_OFFSET=0xC0000000
228CONFIG_PREEMPT=y
229CONFIG_HZ=100
230CONFIG_AEABI=y
231CONFIG_OABI_COMPAT=y
232CONFIG_ARCH_FLATMEM_HAS_HOLES=y
233# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
234# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
235# CONFIG_HIGHMEM is not set
236CONFIG_SELECT_MEMORY_MODEL=y
237CONFIG_FLATMEM_MANUAL=y
238# CONFIG_DISCONTIGMEM_MANUAL is not set
239# CONFIG_SPARSEMEM_MANUAL is not set
240CONFIG_FLATMEM=y
241CONFIG_FLAT_NODE_MEM_MAP=y
242CONFIG_PAGEFLAGS_EXTENDED=y
243CONFIG_SPLIT_PTLOCK_CPUS=4096
244# CONFIG_PHYS_ADDR_T_64BIT is not set
245CONFIG_ZONE_DMA_FLAG=0
246CONFIG_VIRT_TO_BUS=y
247CONFIG_UNEVICTABLE_LRU=y
248CONFIG_HAVE_MLOCK=y
249CONFIG_HAVE_MLOCKED_PAGE_BIT=y
250CONFIG_ALIGNMENT_TRAP=y
251
252#
253# Boot options
254#
255CONFIG_ZBOOT_ROM_TEXT=0x0
256CONFIG_ZBOOT_ROM_BSS=0x0
257CONFIG_CMDLINE=""
258# CONFIG_XIP_KERNEL is not set
259# CONFIG_KEXEC is not set
260
261#
262# CPU Power Management
263#
264# CONFIG_CPU_IDLE is not set
265
266#
267# Floating point emulation
268#
269
270#
271# At least one emulation must be selected
272#
273# CONFIG_FPE_NWFPE is not set
274# CONFIG_FPE_FASTFPE is not set
275# CONFIG_VFP is not set
276
277#
278# Userspace binary formats
279#
280CONFIG_BINFMT_ELF=y
281# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
282CONFIG_HAVE_AOUT=y
283# CONFIG_BINFMT_AOUT is not set
284# CONFIG_BINFMT_MISC is not set
285
286#
287# Power management options
288#
289# CONFIG_PM is not set
290CONFIG_ARCH_SUSPEND_POSSIBLE=y
291CONFIG_NET=y
292
293#
294# Networking options
295#
296# CONFIG_PACKET is not set
297# CONFIG_UNIX is not set
298CONFIG_XFRM=y
299# CONFIG_XFRM_USER is not set
300# CONFIG_XFRM_SUB_POLICY is not set
301# CONFIG_XFRM_MIGRATE is not set
302# CONFIG_XFRM_STATISTICS is not set
303# CONFIG_NET_KEY is not set
304CONFIG_INET=y
305# CONFIG_IP_MULTICAST is not set
306# CONFIG_IP_ADVANCED_ROUTER is not set
307CONFIG_IP_FIB_HASH=y
308CONFIG_IP_PNP=y
309CONFIG_IP_PNP_DHCP=y
310CONFIG_IP_PNP_BOOTP=y
311# CONFIG_IP_PNP_RARP is not set
312# CONFIG_NET_IPIP is not set
313# CONFIG_NET_IPGRE is not set
314# CONFIG_ARPD is not set
315# CONFIG_SYN_COOKIES is not set
316# CONFIG_INET_AH is not set
317# CONFIG_INET_ESP is not set
318# CONFIG_INET_IPCOMP is not set
319# CONFIG_INET_XFRM_TUNNEL is not set
320# CONFIG_INET_TUNNEL is not set
321CONFIG_INET_XFRM_MODE_TRANSPORT=y
322# CONFIG_INET_XFRM_MODE_TUNNEL is not set
323# CONFIG_INET_XFRM_MODE_BEET is not set
324# CONFIG_INET_LRO is not set
325# CONFIG_INET_DIAG is not set
326# CONFIG_TCP_CONG_ADVANCED is not set
327CONFIG_TCP_CONG_CUBIC=y
328CONFIG_DEFAULT_TCP_CONG="cubic"
329# CONFIG_TCP_MD5SIG is not set
330# CONFIG_IPV6 is not set
331# CONFIG_NETWORK_SECMARK is not set
332# CONFIG_NETFILTER is not set
333# CONFIG_IP_DCCP is not set
334# CONFIG_IP_SCTP is not set
335# CONFIG_TIPC is not set
336# CONFIG_ATM is not set
337# CONFIG_BRIDGE is not set
338# CONFIG_NET_DSA is not set
339# CONFIG_VLAN_8021Q is not set
340# CONFIG_DECNET is not set
341# CONFIG_LLC2 is not set
342# CONFIG_IPX is not set
343# CONFIG_ATALK is not set
344# CONFIG_X25 is not set
345# CONFIG_LAPB is not set
346# CONFIG_ECONET is not set
347# CONFIG_WAN_ROUTER is not set
348# CONFIG_PHONET is not set
349# CONFIG_NET_SCHED is not set
350# CONFIG_DCB is not set
351
352#
353# Network testing
354#
355# CONFIG_NET_PKTGEN is not set
356# CONFIG_HAMRADIO is not set
357# CONFIG_CAN is not set
358# CONFIG_IRDA is not set
359# CONFIG_BT is not set
360# CONFIG_AF_RXRPC is not set
361CONFIG_WIRELESS=y
362# CONFIG_CFG80211 is not set
363# CONFIG_WIRELESS_OLD_REGULATORY is not set
364# CONFIG_WIRELESS_EXT is not set
365# CONFIG_LIB80211 is not set
366# CONFIG_MAC80211 is not set
367# CONFIG_WIMAX is not set
368# CONFIG_RFKILL is not set
369# CONFIG_NET_9P is not set
370
371#
372# Device Drivers
373#
374
375#
376# Generic Driver Options
377#
378CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
379CONFIG_STANDALONE=y
380CONFIG_PREVENT_FIRMWARE_BUILD=y
381# CONFIG_FW_LOADER is not set
382# CONFIG_SYS_HYPERVISOR is not set
383# CONFIG_CONNECTOR is not set
384CONFIG_MTD=y
385CONFIG_MTD_DEBUG=y
386CONFIG_MTD_DEBUG_VERBOSE=3
387# CONFIG_MTD_CONCAT is not set
388CONFIG_MTD_PARTITIONS=y
389# CONFIG_MTD_TESTS is not set
390CONFIG_MTD_REDBOOT_PARTS=y
391CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
392# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
393# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
394CONFIG_MTD_CMDLINE_PARTS=y
395# CONFIG_MTD_AFS_PARTS is not set
396# CONFIG_MTD_AR7_PARTS is not set
397
398#
399# User Modules And Translation Layers
400#
401CONFIG_MTD_CHAR=y
402CONFIG_MTD_BLKDEVS=y
403CONFIG_MTD_BLOCK=y
404# CONFIG_FTL is not set
405# CONFIG_NFTL is not set
406# CONFIG_INFTL is not set
407# CONFIG_RFD_FTL is not set
408# CONFIG_SSFDC is not set
409# CONFIG_MTD_OOPS is not set
410
411#
412# RAM/ROM/Flash chip drivers
413#
414CONFIG_MTD_CFI=y
415# CONFIG_MTD_JEDECPROBE is not set
416CONFIG_MTD_GEN_PROBE=y
417CONFIG_MTD_CFI_ADV_OPTIONS=y
418CONFIG_MTD_CFI_NOSWAP=y
419# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
420# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
421CONFIG_MTD_CFI_GEOMETRY=y
422# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
423CONFIG_MTD_MAP_BANK_WIDTH_2=y
424CONFIG_MTD_MAP_BANK_WIDTH_4=y
425# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
426# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
427# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
428CONFIG_MTD_CFI_I1=y
429CONFIG_MTD_CFI_I2=y
430# CONFIG_MTD_CFI_I4 is not set
431# CONFIG_MTD_CFI_I8 is not set
432# CONFIG_MTD_OTP is not set
433# CONFIG_MTD_CFI_INTELEXT is not set
434CONFIG_MTD_CFI_AMDSTD=y
435# CONFIG_MTD_CFI_STAA is not set
436CONFIG_MTD_CFI_UTIL=y
437# CONFIG_MTD_RAM is not set
438# CONFIG_MTD_ROM is not set
439# CONFIG_MTD_ABSENT is not set
440# CONFIG_MTD_XIP is not set
441
442#
443# Mapping drivers for chip access
444#
445# CONFIG_MTD_COMPLEX_MAPPINGS is not set
446CONFIG_MTD_PHYSMAP=y
447# CONFIG_MTD_PHYSMAP_COMPAT is not set
448# CONFIG_MTD_ARM_INTEGRATOR is not set
449# CONFIG_MTD_PLATRAM is not set
450
451#
452# Self-contained MTD device drivers
453#
454# CONFIG_MTD_DATAFLASH is not set
455# CONFIG_MTD_M25P80 is not set
456# CONFIG_MTD_SLRAM is not set
457# CONFIG_MTD_PHRAM is not set
458# CONFIG_MTD_MTDRAM is not set
459# CONFIG_MTD_BLOCK2MTD is not set
460
461#
462# Disk-On-Chip Device Drivers
463#
464# CONFIG_MTD_DOC2000 is not set
465# CONFIG_MTD_DOC2001 is not set
466# CONFIG_MTD_DOC2001PLUS is not set
467CONFIG_MTD_NAND=y
468# CONFIG_MTD_NAND_VERIFY_WRITE is not set
469# CONFIG_MTD_NAND_ECC_SMC is not set
470# CONFIG_MTD_NAND_MUSEUM_IDS is not set
471# CONFIG_MTD_NAND_GPIO is not set
472CONFIG_MTD_NAND_IDS=y
473# CONFIG_MTD_NAND_DISKONCHIP is not set
474# CONFIG_MTD_NAND_NANDSIM is not set
475# CONFIG_MTD_NAND_PLATFORM is not set
476CONFIG_MTD_NAND_MXC=y
477# CONFIG_MTD_ONENAND is not set
478
479#
480# LPDDR flash memory drivers
481#
482# CONFIG_MTD_LPDDR is not set
483
484#
485# UBI - Unsorted block images
486#
487# CONFIG_MTD_UBI is not set
488# CONFIG_PARPORT is not set
489CONFIG_BLK_DEV=y
490# CONFIG_BLK_DEV_COW_COMMON is not set
491# CONFIG_BLK_DEV_LOOP is not set
492# CONFIG_BLK_DEV_NBD is not set
493# CONFIG_BLK_DEV_RAM is not set
494# CONFIG_CDROM_PKTCDVD is not set
495# CONFIG_ATA_OVER_ETH is not set
496CONFIG_MISC_DEVICES=y
497# CONFIG_ICS932S401 is not set
498# CONFIG_ENCLOSURE_SERVICES is not set
499# CONFIG_ISL29003 is not set
500# CONFIG_C2PORT is not set
501
502#
503# EEPROM support
504#
505# CONFIG_EEPROM_AT24 is not set
506# CONFIG_EEPROM_AT25 is not set
507# CONFIG_EEPROM_LEGACY is not set
508# CONFIG_EEPROM_93CX6 is not set
509CONFIG_HAVE_IDE=y
510# CONFIG_IDE is not set
511
512#
513# SCSI device support
514#
515# CONFIG_RAID_ATTRS is not set
516# CONFIG_SCSI is not set
517# CONFIG_SCSI_DMA is not set
518# CONFIG_SCSI_NETLINK is not set
519# CONFIG_ATA is not set
520# CONFIG_MD is not set
521CONFIG_NETDEVICES=y
522CONFIG_COMPAT_NET_DEV_OPS=y
523# CONFIG_DUMMY is not set
524# CONFIG_BONDING is not set
525# CONFIG_MACVLAN is not set
526# CONFIG_EQUALIZER is not set
527# CONFIG_TUN is not set
528# CONFIG_VETH is not set
529# CONFIG_PHYLIB is not set
530CONFIG_NET_ETHERNET=y
531CONFIG_MII=y
532# CONFIG_AX88796 is not set
533# CONFIG_SMC91X is not set
534# CONFIG_DM9000 is not set
535# CONFIG_ENC28J60 is not set
536# CONFIG_ETHOC is not set
537# CONFIG_SMC911X is not set
538# CONFIG_SMSC911X is not set
539# CONFIG_DNET is not set
540# CONFIG_IBM_NEW_EMAC_ZMII is not set
541# CONFIG_IBM_NEW_EMAC_RGMII is not set
542# CONFIG_IBM_NEW_EMAC_TAH is not set
543# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
544# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
545# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
546# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
547# CONFIG_B44 is not set
548CONFIG_CS89x0=y
549CONFIG_CS89x0_NONISA_IRQ=y
550# CONFIG_NETDEV_1000 is not set
551# CONFIG_NETDEV_10000 is not set
552
553#
554# Wireless LAN
555#
556# CONFIG_WLAN_PRE80211 is not set
557# CONFIG_WLAN_80211 is not set
558
559#
560# Enable WiMAX (Networking options) to see the WiMAX drivers
561#
562# CONFIG_WAN is not set
563# CONFIG_PPP is not set
564# CONFIG_SLIP is not set
565# CONFIG_NETCONSOLE is not set
566# CONFIG_NETPOLL is not set
567# CONFIG_NET_POLL_CONTROLLER is not set
568# CONFIG_ISDN is not set
569
570#
571# Input device support
572#
573CONFIG_INPUT=y
574# CONFIG_INPUT_FF_MEMLESS is not set
575# CONFIG_INPUT_POLLDEV is not set
576
577#
578# Userland interfaces
579#
580# CONFIG_INPUT_MOUSEDEV is not set
581# CONFIG_INPUT_JOYDEV is not set
582CONFIG_INPUT_EVDEV=y
583# CONFIG_INPUT_EVBUG is not set
584
585#
586# Input Device Drivers
587#
588# CONFIG_INPUT_KEYBOARD is not set
589# CONFIG_INPUT_MOUSE is not set
590# CONFIG_INPUT_JOYSTICK is not set
591# CONFIG_INPUT_TABLET is not set
592CONFIG_INPUT_TOUCHSCREEN=y
593# CONFIG_TOUCHSCREEN_ADS7846 is not set
594# CONFIG_TOUCHSCREEN_FUJITSU is not set
595# CONFIG_TOUCHSCREEN_GUNZE is not set
596# CONFIG_TOUCHSCREEN_ELO is not set
597# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
598# CONFIG_TOUCHSCREEN_MTOUCH is not set
599# CONFIG_TOUCHSCREEN_INEXIO is not set
600# CONFIG_TOUCHSCREEN_MK712 is not set
601# CONFIG_TOUCHSCREEN_PENMOUNT is not set
602# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
603# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
604# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
605# CONFIG_TOUCHSCREEN_TSC2007 is not set
606# CONFIG_INPUT_MISC is not set
607
608#
609# Hardware I/O ports
610#
611# CONFIG_SERIO is not set
612# CONFIG_GAMEPORT is not set
613
614#
615# Character devices
616#
617CONFIG_VT=y
618# CONFIG_CONSOLE_TRANSLATIONS is not set
619CONFIG_VT_CONSOLE=y
620CONFIG_HW_CONSOLE=y
621# CONFIG_VT_HW_CONSOLE_BINDING is not set
622CONFIG_DEVKMEM=y
623# CONFIG_SERIAL_NONSTANDARD is not set
624
625#
626# Serial drivers
627#
628CONFIG_SERIAL_8250=y
629CONFIG_SERIAL_8250_CONSOLE=y
630CONFIG_SERIAL_8250_NR_UARTS=1
631CONFIG_SERIAL_8250_RUNTIME_UARTS=1
632# CONFIG_SERIAL_8250_EXTENDED is not set
633
634#
635# Non-8250 serial port support
636#
637# CONFIG_SERIAL_MAX3100 is not set
638CONFIG_SERIAL_IMX=y
639CONFIG_SERIAL_IMX_CONSOLE=y
640CONFIG_SERIAL_CORE=y
641CONFIG_SERIAL_CORE_CONSOLE=y
642CONFIG_UNIX98_PTYS=y
643# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
644# CONFIG_LEGACY_PTYS is not set
645# CONFIG_IPMI_HANDLER is not set
646# CONFIG_HW_RANDOM is not set
647# CONFIG_R3964 is not set
648# CONFIG_RAW_DRIVER is not set
649# CONFIG_TCG_TPM is not set
650CONFIG_I2C=y
651CONFIG_I2C_BOARDINFO=y
652CONFIG_I2C_CHARDEV=y
653CONFIG_I2C_HELPER_AUTO=y
654
655#
656# I2C Hardware Bus support
657#
658
659#
660# I2C system bus drivers (mostly embedded / system-on-chip)
661#
662# CONFIG_I2C_GPIO is not set
663CONFIG_I2C_IMX=y
664# CONFIG_I2C_OCORES is not set
665# CONFIG_I2C_SIMTEC is not set
666
667#
668# External I2C/SMBus adapter drivers
669#
670# CONFIG_I2C_PARPORT_LIGHT is not set
671# CONFIG_I2C_TAOS_EVM is not set
672
673#
674# Other I2C/SMBus bus drivers
675#
676# CONFIG_I2C_PCA_PLATFORM is not set
677# CONFIG_I2C_STUB is not set
678
679#
680# Miscellaneous I2C Chip support
681#
682# CONFIG_DS1682 is not set
683# CONFIG_SENSORS_PCF8574 is not set
684# CONFIG_PCF8575 is not set
685# CONFIG_SENSORS_PCA9539 is not set
686# CONFIG_SENSORS_MAX6875 is not set
687# CONFIG_SENSORS_TSL2550 is not set
688# CONFIG_I2C_DEBUG_CORE is not set
689# CONFIG_I2C_DEBUG_ALGO is not set
690# CONFIG_I2C_DEBUG_BUS is not set
691# CONFIG_I2C_DEBUG_CHIP is not set
692CONFIG_SPI=y
693CONFIG_SPI_MASTER=y
694
695#
696# SPI Master Controller Drivers
697#
698# CONFIG_SPI_BITBANG is not set
699# CONFIG_SPI_GPIO is not set
700
701#
702# SPI Protocol Masters
703#
704# CONFIG_SPI_SPIDEV is not set
705# CONFIG_SPI_TLE62X0 is not set
706CONFIG_ARCH_REQUIRE_GPIOLIB=y
707CONFIG_GPIOLIB=y
708# CONFIG_GPIO_SYSFS is not set
709
710#
711# Memory mapped GPIO expanders:
712#
713
714#
715# I2C GPIO expanders:
716#
717# CONFIG_GPIO_MAX732X is not set
718# CONFIG_GPIO_PCA953X is not set
719# CONFIG_GPIO_PCF857X is not set
720
721#
722# PCI GPIO expanders:
723#
724
725#
726# SPI GPIO expanders:
727#
728# CONFIG_GPIO_MAX7301 is not set
729# CONFIG_GPIO_MCP23S08 is not set
730# CONFIG_W1 is not set
731# CONFIG_POWER_SUPPLY is not set
732# CONFIG_HWMON is not set
733# CONFIG_THERMAL is not set
734# CONFIG_THERMAL_HWMON is not set
735# CONFIG_WATCHDOG is not set
736CONFIG_SSB_POSSIBLE=y
737
738#
739# Sonics Silicon Backplane
740#
741# CONFIG_SSB is not set
742
743#
744# Multifunction device drivers
745#
746# CONFIG_MFD_CORE is not set
747# CONFIG_MFD_SM501 is not set
748# CONFIG_MFD_ASIC3 is not set
749# CONFIG_HTC_EGPIO is not set
750# CONFIG_HTC_PASIC3 is not set
751# CONFIG_TPS65010 is not set
752# CONFIG_TWL4030_CORE is not set
753# CONFIG_MFD_TMIO is not set
754# CONFIG_MFD_TC6393XB is not set
755# CONFIG_PMIC_DA903X is not set
756# CONFIG_MFD_WM8400 is not set
757# CONFIG_MFD_WM8350_I2C is not set
758# CONFIG_MFD_PCF50633 is not set
759
760#
761# Multimedia devices
762#
763
764#
765# Multimedia core support
766#
767# CONFIG_VIDEO_DEV is not set
768# CONFIG_DVB_CORE is not set
769# CONFIG_VIDEO_MEDIA is not set
770
771#
772# Multimedia drivers
773#
774# CONFIG_DAB is not set
775
776#
777# Graphics support
778#
779# CONFIG_VGASTATE is not set
780# CONFIG_VIDEO_OUTPUT_CONTROL is not set
781CONFIG_FB=y
782# CONFIG_FIRMWARE_EDID is not set
783# CONFIG_FB_DDC is not set
784# CONFIG_FB_BOOT_VESA_SUPPORT is not set
785CONFIG_FB_CFB_FILLRECT=y
786CONFIG_FB_CFB_COPYAREA=y
787CONFIG_FB_CFB_IMAGEBLIT=y
788# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
789# CONFIG_FB_SYS_FILLRECT is not set
790# CONFIG_FB_SYS_COPYAREA is not set
791# CONFIG_FB_SYS_IMAGEBLIT is not set
792# CONFIG_FB_FOREIGN_ENDIAN is not set
793# CONFIG_FB_SYS_FOPS is not set
794# CONFIG_FB_SVGALIB is not set
795# CONFIG_FB_MACMODES is not set
796# CONFIG_FB_BACKLIGHT is not set
797# CONFIG_FB_MODE_HELPERS is not set
798# CONFIG_FB_TILEBLITTING is not set
799
800#
801# Frame buffer hardware drivers
802#
803CONFIG_FB_IMX=y
804# CONFIG_FB_S1D13XXX is not set
805# CONFIG_FB_VIRTUAL is not set
806# CONFIG_FB_METRONOME is not set
807# CONFIG_FB_MB862XX is not set
808# CONFIG_FB_BROADSHEET is not set
809# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
810
811#
812# Display device support
813#
814# CONFIG_DISPLAY_SUPPORT is not set
815
816#
817# Console display driver support
818#
819# CONFIG_VGA_CONSOLE is not set
820CONFIG_DUMMY_CONSOLE=y
821CONFIG_FRAMEBUFFER_CONSOLE=y
822# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
823# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
824CONFIG_FONTS=y
825CONFIG_FONT_8x8=y
826# CONFIG_FONT_8x16 is not set
827# CONFIG_FONT_6x11 is not set
828# CONFIG_FONT_7x14 is not set
829# CONFIG_FONT_PEARL_8x8 is not set
830# CONFIG_FONT_ACORN_8x8 is not set
831# CONFIG_FONT_MINI_4x6 is not set
832# CONFIG_FONT_SUN8x16 is not set
833# CONFIG_FONT_SUN12x22 is not set
834# CONFIG_FONT_10x18 is not set
835CONFIG_LOGO=y
836CONFIG_LOGO_LINUX_MONO=y
837CONFIG_LOGO_LINUX_VGA16=y
838CONFIG_LOGO_LINUX_CLUT224=y
839# CONFIG_SOUND is not set
840# CONFIG_HID_SUPPORT is not set
841# CONFIG_USB_SUPPORT is not set
842CONFIG_MMC=y
843# CONFIG_MMC_DEBUG is not set
844# CONFIG_MMC_UNSAFE_RESUME is not set
845
846#
847# MMC/SD/SDIO Card Drivers
848#
849CONFIG_MMC_BLOCK=y
850CONFIG_MMC_BLOCK_BOUNCE=y
851# CONFIG_SDIO_UART is not set
852# CONFIG_MMC_TEST is not set
853
854#
855# MMC/SD/SDIO Host Controller Drivers
856#
857# CONFIG_MMC_SDHCI is not set
858CONFIG_MMC_MXC=y
859# CONFIG_MMC_SPI is not set
860# CONFIG_MEMSTICK is not set
861# CONFIG_ACCESSIBILITY is not set
862# CONFIG_NEW_LEDS is not set
863CONFIG_RTC_LIB=y
864# CONFIG_RTC_CLASS is not set
865# CONFIG_DMADEVICES is not set
866# CONFIG_AUXDISPLAY is not set
867# CONFIG_REGULATOR is not set
868# CONFIG_UIO is not set
869# CONFIG_STAGING is not set
870
871#
872# File systems
873#
874# CONFIG_EXT2_FS is not set
875# CONFIG_EXT3_FS is not set
876# CONFIG_EXT4_FS is not set
877# CONFIG_REISERFS_FS is not set
878# CONFIG_JFS_FS is not set
879# CONFIG_FS_POSIX_ACL is not set
880CONFIG_FILE_LOCKING=y
881# CONFIG_XFS_FS is not set
882# CONFIG_OCFS2_FS is not set
883# CONFIG_BTRFS_FS is not set
884# CONFIG_DNOTIFY is not set
885# CONFIG_INOTIFY is not set
886# CONFIG_QUOTA is not set
887# CONFIG_AUTOFS_FS is not set
888# CONFIG_AUTOFS4_FS is not set
889# CONFIG_FUSE_FS is not set
890
891#
892# Caches
893#
894# CONFIG_FSCACHE is not set
895
896#
897# CD-ROM/DVD Filesystems
898#
899# CONFIG_ISO9660_FS is not set
900# CONFIG_UDF_FS is not set
901
902#
903# DOS/FAT/NT Filesystems
904#
905CONFIG_FAT_FS=y
906CONFIG_MSDOS_FS=y
907# CONFIG_VFAT_FS is not set
908CONFIG_FAT_DEFAULT_CODEPAGE=437
909# CONFIG_NTFS_FS is not set
910
911#
912# Pseudo filesystems
913#
914CONFIG_PROC_FS=y
915CONFIG_PROC_SYSCTL=y
916CONFIG_PROC_PAGE_MONITOR=y
917CONFIG_SYSFS=y
918CONFIG_TMPFS=y
919# CONFIG_TMPFS_POSIX_ACL is not set
920# CONFIG_HUGETLB_PAGE is not set
921# CONFIG_CONFIGFS_FS is not set
922CONFIG_MISC_FILESYSTEMS=y
923# CONFIG_ADFS_FS is not set
924# CONFIG_AFFS_FS is not set
925# CONFIG_HFS_FS is not set
926# CONFIG_HFSPLUS_FS is not set
927# CONFIG_BEFS_FS is not set
928# CONFIG_BFS_FS is not set
929# CONFIG_EFS_FS is not set
930CONFIG_JFFS2_FS=y
931CONFIG_JFFS2_FS_DEBUG=0
932CONFIG_JFFS2_FS_WRITEBUFFER=y
933# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
934# CONFIG_JFFS2_SUMMARY is not set
935# CONFIG_JFFS2_FS_XATTR is not set
936# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
937CONFIG_JFFS2_ZLIB=y
938# CONFIG_JFFS2_LZO is not set
939CONFIG_JFFS2_RTIME=y
940# CONFIG_JFFS2_RUBIN is not set
941# CONFIG_CRAMFS is not set
942# CONFIG_SQUASHFS is not set
943# CONFIG_VXFS_FS is not set
944# CONFIG_MINIX_FS is not set
945# CONFIG_OMFS_FS is not set
946# CONFIG_HPFS_FS is not set
947# CONFIG_QNX4FS_FS is not set
948# CONFIG_ROMFS_FS is not set
949# CONFIG_SYSV_FS is not set
950# CONFIG_UFS_FS is not set
951# CONFIG_NILFS2_FS is not set
952CONFIG_NETWORK_FILESYSTEMS=y
953CONFIG_NFS_FS=y
954CONFIG_NFS_V3=y
955# CONFIG_NFS_V3_ACL is not set
956# CONFIG_NFS_V4 is not set
957CONFIG_ROOT_NFS=y
958# CONFIG_NFSD is not set
959CONFIG_LOCKD=y
960CONFIG_LOCKD_V4=y
961CONFIG_NFS_COMMON=y
962CONFIG_SUNRPC=y
963# CONFIG_RPCSEC_GSS_KRB5 is not set
964# CONFIG_RPCSEC_GSS_SPKM3 is not set
965# CONFIG_SMB_FS is not set
966# CONFIG_CIFS is not set
967# CONFIG_NCP_FS is not set
968# CONFIG_CODA_FS is not set
969# CONFIG_AFS_FS is not set
970
971#
972# Partition Types
973#
974# CONFIG_PARTITION_ADVANCED is not set
975CONFIG_MSDOS_PARTITION=y
976CONFIG_NLS=y
977CONFIG_NLS_DEFAULT="iso8859-1"
978# CONFIG_NLS_CODEPAGE_437 is not set
979# CONFIG_NLS_CODEPAGE_737 is not set
980# CONFIG_NLS_CODEPAGE_775 is not set
981# CONFIG_NLS_CODEPAGE_850 is not set
982# CONFIG_NLS_CODEPAGE_852 is not set
983# CONFIG_NLS_CODEPAGE_855 is not set
984# CONFIG_NLS_CODEPAGE_857 is not set
985# CONFIG_NLS_CODEPAGE_860 is not set
986# CONFIG_NLS_CODEPAGE_861 is not set
987# CONFIG_NLS_CODEPAGE_862 is not set
988# CONFIG_NLS_CODEPAGE_863 is not set
989# CONFIG_NLS_CODEPAGE_864 is not set
990# CONFIG_NLS_CODEPAGE_865 is not set
991# CONFIG_NLS_CODEPAGE_866 is not set
992# CONFIG_NLS_CODEPAGE_869 is not set
993# CONFIG_NLS_CODEPAGE_936 is not set
994# CONFIG_NLS_CODEPAGE_950 is not set
995# CONFIG_NLS_CODEPAGE_932 is not set
996# CONFIG_NLS_CODEPAGE_949 is not set
997# CONFIG_NLS_CODEPAGE_874 is not set
998# CONFIG_NLS_ISO8859_8 is not set
999# CONFIG_NLS_CODEPAGE_1250 is not set
1000# CONFIG_NLS_CODEPAGE_1251 is not set
1001# CONFIG_NLS_ASCII is not set
1002# CONFIG_NLS_ISO8859_1 is not set
1003# CONFIG_NLS_ISO8859_2 is not set
1004# CONFIG_NLS_ISO8859_3 is not set
1005# CONFIG_NLS_ISO8859_4 is not set
1006# CONFIG_NLS_ISO8859_5 is not set
1007# CONFIG_NLS_ISO8859_6 is not set
1008# CONFIG_NLS_ISO8859_7 is not set
1009# CONFIG_NLS_ISO8859_9 is not set
1010# CONFIG_NLS_ISO8859_13 is not set
1011# CONFIG_NLS_ISO8859_14 is not set
1012# CONFIG_NLS_ISO8859_15 is not set
1013# CONFIG_NLS_KOI8_R is not set
1014# CONFIG_NLS_KOI8_U is not set
1015# CONFIG_NLS_UTF8 is not set
1016# CONFIG_DLM is not set
1017
1018#
1019# Kernel hacking
1020#
1021# CONFIG_PRINTK_TIME is not set
1022CONFIG_ENABLE_WARN_DEPRECATED=y
1023CONFIG_ENABLE_MUST_CHECK=y
1024CONFIG_FRAME_WARN=1024
1025# CONFIG_MAGIC_SYSRQ is not set
1026# CONFIG_UNUSED_SYMBOLS is not set
1027# CONFIG_DEBUG_FS is not set
1028# CONFIG_HEADERS_CHECK is not set
1029# CONFIG_DEBUG_KERNEL is not set
1030# CONFIG_DEBUG_BUGVERBOSE is not set
1031# CONFIG_DEBUG_MEMORY_INIT is not set
1032# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1033# CONFIG_LATENCYTOP is not set
1034CONFIG_SYSCTL_SYSCALL_CHECK=y
1035CONFIG_HAVE_FUNCTION_TRACER=y
1036CONFIG_TRACING_SUPPORT=y
1037
1038#
1039# Tracers
1040#
1041# CONFIG_FUNCTION_TRACER is not set
1042# CONFIG_IRQSOFF_TRACER is not set
1043# CONFIG_PREEMPT_TRACER is not set
1044# CONFIG_SCHED_TRACER is not set
1045# CONFIG_CONTEXT_SWITCH_TRACER is not set
1046# CONFIG_EVENT_TRACER is not set
1047# CONFIG_BOOT_TRACER is not set
1048# CONFIG_TRACE_BRANCH_PROFILING is not set
1049# CONFIG_STACK_TRACER is not set
1050# CONFIG_KMEMTRACE is not set
1051# CONFIG_WORKQUEUE_TRACER is not set
1052# CONFIG_BLK_DEV_IO_TRACE is not set
1053# CONFIG_SAMPLES is not set
1054CONFIG_HAVE_ARCH_KGDB=y
1055CONFIG_ARM_UNWIND=y
1056# CONFIG_DEBUG_USER is not set
1057
1058#
1059# Security options
1060#
1061# CONFIG_KEYS is not set
1062# CONFIG_SECURITY is not set
1063# CONFIG_SECURITYFS is not set
1064# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1065CONFIG_CRYPTO=y
1066
1067#
1068# Crypto core or helper
1069#
1070# CONFIG_CRYPTO_FIPS is not set
1071# CONFIG_CRYPTO_MANAGER is not set
1072# CONFIG_CRYPTO_MANAGER2 is not set
1073# CONFIG_CRYPTO_GF128MUL is not set
1074# CONFIG_CRYPTO_NULL is not set
1075# CONFIG_CRYPTO_CRYPTD is not set
1076# CONFIG_CRYPTO_AUTHENC is not set
1077# CONFIG_CRYPTO_TEST is not set
1078
1079#
1080# Authenticated Encryption with Associated Data
1081#
1082# CONFIG_CRYPTO_CCM is not set
1083# CONFIG_CRYPTO_GCM is not set
1084# CONFIG_CRYPTO_SEQIV is not set
1085
1086#
1087# Block modes
1088#
1089# CONFIG_CRYPTO_CBC is not set
1090# CONFIG_CRYPTO_CTR is not set
1091# CONFIG_CRYPTO_CTS is not set
1092# CONFIG_CRYPTO_ECB is not set
1093# CONFIG_CRYPTO_LRW is not set
1094# CONFIG_CRYPTO_PCBC is not set
1095# CONFIG_CRYPTO_XTS is not set
1096
1097#
1098# Hash modes
1099#
1100# CONFIG_CRYPTO_HMAC is not set
1101# CONFIG_CRYPTO_XCBC is not set
1102
1103#
1104# Digest
1105#
1106# CONFIG_CRYPTO_CRC32C is not set
1107# CONFIG_CRYPTO_MD4 is not set
1108# CONFIG_CRYPTO_MD5 is not set
1109# CONFIG_CRYPTO_MICHAEL_MIC is not set
1110# CONFIG_CRYPTO_RMD128 is not set
1111# CONFIG_CRYPTO_RMD160 is not set
1112# CONFIG_CRYPTO_RMD256 is not set
1113# CONFIG_CRYPTO_RMD320 is not set
1114# CONFIG_CRYPTO_SHA1 is not set
1115# CONFIG_CRYPTO_SHA256 is not set
1116# CONFIG_CRYPTO_SHA512 is not set
1117# CONFIG_CRYPTO_TGR192 is not set
1118# CONFIG_CRYPTO_WP512 is not set
1119
1120#
1121# Ciphers
1122#
1123# CONFIG_CRYPTO_AES is not set
1124# CONFIG_CRYPTO_ANUBIS is not set
1125# CONFIG_CRYPTO_ARC4 is not set
1126# CONFIG_CRYPTO_BLOWFISH is not set
1127# CONFIG_CRYPTO_CAMELLIA is not set
1128# CONFIG_CRYPTO_CAST5 is not set
1129# CONFIG_CRYPTO_CAST6 is not set
1130# CONFIG_CRYPTO_DES is not set
1131# CONFIG_CRYPTO_FCRYPT is not set
1132# CONFIG_CRYPTO_KHAZAD is not set
1133# CONFIG_CRYPTO_SALSA20 is not set
1134# CONFIG_CRYPTO_SEED is not set
1135# CONFIG_CRYPTO_SERPENT is not set
1136# CONFIG_CRYPTO_TEA is not set
1137# CONFIG_CRYPTO_TWOFISH is not set
1138
1139#
1140# Compression
1141#
1142# CONFIG_CRYPTO_DEFLATE is not set
1143# CONFIG_CRYPTO_ZLIB is not set
1144# CONFIG_CRYPTO_LZO is not set
1145
1146#
1147# Random Number Generation
1148#
1149# CONFIG_CRYPTO_ANSI_CPRNG is not set
1150CONFIG_CRYPTO_HW=y
1151# CONFIG_BINARY_PRINTF is not set
1152
1153#
1154# Library routines
1155#
1156CONFIG_BITREVERSE=y
1157CONFIG_GENERIC_FIND_LAST_BIT=y
1158# CONFIG_CRC_CCITT is not set
1159# CONFIG_CRC16 is not set
1160# CONFIG_CRC_T10DIF is not set
1161# CONFIG_CRC_ITU_T is not set
1162CONFIG_CRC32=y
1163# CONFIG_CRC7 is not set
1164# CONFIG_LIBCRC32C is not set
1165CONFIG_ZLIB_INFLATE=y
1166CONFIG_ZLIB_DEFLATE=y
1167CONFIG_HAS_IOMEM=y
1168CONFIG_HAS_IOPORT=y
1169CONFIG_HAS_DMA=y
1170CONFIG_NLATTR=y
diff --git a/arch/arm/configs/omap3_evm_defconfig b/arch/arm/configs/omap3_evm_defconfig
new file mode 100644
index 000000000000..28be17fbc157
--- /dev/null
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -0,0 +1,1528 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc5
4# Mon May 18 14:01:52 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION=""
36CONFIG_LOCALVERSION_AUTO=y
37CONFIG_SWAP=y
38CONFIG_SYSVIPC=y
39CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_POSIX_MQUEUE is not set
41CONFIG_BSD_PROCESS_ACCT=y
42# CONFIG_BSD_PROCESS_ACCT_V3 is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=14
56CONFIG_GROUP_SCHED=y
57CONFIG_FAIR_GROUP_SCHED=y
58# CONFIG_RT_GROUP_SCHED is not set
59CONFIG_USER_SCHED=y
60# CONFIG_CGROUP_SCHED is not set
61# CONFIG_CGROUPS is not set
62CONFIG_SYSFS_DEPRECATED=y
63CONFIG_SYSFS_DEPRECATED_V2=y
64# CONFIG_RELAY is not set
65# CONFIG_NAMESPACES is not set
66CONFIG_BLK_DEV_INITRD=y
67CONFIG_INITRAMFS_SOURCE=""
68CONFIG_RD_GZIP=y
69# CONFIG_RD_BZIP2 is not set
70# CONFIG_RD_LZMA is not set
71CONFIG_CC_OPTIMIZE_FOR_SIZE=y
72CONFIG_SYSCTL=y
73CONFIG_ANON_INODES=y
74CONFIG_EMBEDDED=y
75CONFIG_UID16=y
76# CONFIG_SYSCTL_SYSCALL is not set
77CONFIG_KALLSYMS=y
78# CONFIG_KALLSYMS_ALL is not set
79CONFIG_KALLSYMS_EXTRA_PASS=y
80# CONFIG_STRIP_ASM_SYMS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_EPOLL=y
88CONFIG_SIGNALFD=y
89CONFIG_TIMERFD=y
90CONFIG_EVENTFD=y
91CONFIG_SHMEM=y
92CONFIG_AIO=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_COMPAT_BRK=y
95CONFIG_SLAB=y
96# CONFIG_SLUB is not set
97# CONFIG_SLOB is not set
98# CONFIG_PROFILING is not set
99# CONFIG_MARKERS is not set
100CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y
103CONFIG_HAVE_KRETPROBES=y
104CONFIG_HAVE_CLK=y
105# CONFIG_SLOW_WORK is not set
106CONFIG_HAVE_GENERIC_DMA_COHERENT=y
107CONFIG_SLABINFO=y
108CONFIG_RT_MUTEXES=y
109CONFIG_BASE_SMALL=0
110CONFIG_MODULES=y
111# CONFIG_MODULE_FORCE_LOAD is not set
112CONFIG_MODULE_UNLOAD=y
113# CONFIG_MODULE_FORCE_UNLOAD is not set
114CONFIG_MODVERSIONS=y
115CONFIG_MODULE_SRCVERSION_ALL=y
116CONFIG_BLOCK=y
117# CONFIG_LBD is not set
118# CONFIG_BLK_DEV_BSG is not set
119# CONFIG_BLK_DEV_INTEGRITY is not set
120
121#
122# IO Schedulers
123#
124CONFIG_IOSCHED_NOOP=y
125CONFIG_IOSCHED_AS=y
126CONFIG_IOSCHED_DEADLINE=y
127CONFIG_IOSCHED_CFQ=y
128CONFIG_DEFAULT_AS=y
129# CONFIG_DEFAULT_DEADLINE is not set
130# CONFIG_DEFAULT_CFQ is not set
131# CONFIG_DEFAULT_NOOP is not set
132CONFIG_DEFAULT_IOSCHED="anticipatory"
133CONFIG_FREEZER=y
134
135#
136# System Type
137#
138# CONFIG_ARCH_AAEC2000 is not set
139# CONFIG_ARCH_INTEGRATOR is not set
140# CONFIG_ARCH_REALVIEW is not set
141# CONFIG_ARCH_VERSATILE is not set
142# CONFIG_ARCH_AT91 is not set
143# CONFIG_ARCH_CLPS711X is not set
144# CONFIG_ARCH_EBSA110 is not set
145# CONFIG_ARCH_EP93XX is not set
146# CONFIG_ARCH_GEMINI is not set
147# CONFIG_ARCH_FOOTBRIDGE is not set
148# CONFIG_ARCH_NETX is not set
149# CONFIG_ARCH_H720X is not set
150# CONFIG_ARCH_IMX is not set
151# CONFIG_ARCH_IOP13XX is not set
152# CONFIG_ARCH_IOP32X is not set
153# CONFIG_ARCH_IOP33X is not set
154# CONFIG_ARCH_IXP23XX is not set
155# CONFIG_ARCH_IXP2000 is not set
156# CONFIG_ARCH_IXP4XX is not set
157# CONFIG_ARCH_L7200 is not set
158# CONFIG_ARCH_KIRKWOOD is not set
159# CONFIG_ARCH_KS8695 is not set
160# CONFIG_ARCH_NS9XXX is not set
161# CONFIG_ARCH_LOKI is not set
162# CONFIG_ARCH_MV78XX0 is not set
163# CONFIG_ARCH_MXC is not set
164# CONFIG_ARCH_ORION5X is not set
165# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_RPC is not set
169# CONFIG_ARCH_SA1100 is not set
170# CONFIG_ARCH_S3C2410 is not set
171# CONFIG_ARCH_S3C64XX is not set
172# CONFIG_ARCH_SHARK is not set
173# CONFIG_ARCH_LH7A40X is not set
174# CONFIG_ARCH_DAVINCI is not set
175CONFIG_ARCH_OMAP=y
176# CONFIG_ARCH_MSM is not set
177# CONFIG_ARCH_W90X900 is not set
178
179#
180# TI OMAP Implementations
181#
182CONFIG_ARCH_OMAP_OTG=y
183# CONFIG_ARCH_OMAP1 is not set
184# CONFIG_ARCH_OMAP2 is not set
185CONFIG_ARCH_OMAP3=y
186
187#
188# OMAP Feature Selections
189#
190# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
191# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
192CONFIG_OMAP_RESET_CLOCKS=y
193CONFIG_OMAP_MUX=y
194# CONFIG_OMAP_MUX_DEBUG is not set
195CONFIG_OMAP_MUX_WARNINGS=y
196# CONFIG_OMAP_MCBSP is not set
197# CONFIG_OMAP_MBOX_FWK is not set
198# CONFIG_OMAP_MPU_TIMER is not set
199CONFIG_OMAP_32K_TIMER=y
200CONFIG_OMAP_32K_TIMER_HZ=128
201CONFIG_OMAP_DM_TIMER=y
202CONFIG_OMAP_LL_DEBUG_UART1=y
203# CONFIG_OMAP_LL_DEBUG_UART2 is not set
204# CONFIG_OMAP_LL_DEBUG_UART3 is not set
205CONFIG_OMAP_SERIAL_WAKE=y
206CONFIG_ARCH_OMAP34XX=y
207CONFIG_ARCH_OMAP3430=y
208
209#
210# OMAP Board Type
211#
212# CONFIG_MACH_OMAP3_BEAGLE is not set
213# CONFIG_MACH_OMAP_LDP is not set
214# CONFIG_MACH_OVERO is not set
215CONFIG_MACH_OMAP3EVM=y
216# CONFIG_MACH_OMAP3_PANDORA is not set
217# CONFIG_MACH_OMAP_3430SDP is not set
218# CONFIG_MACH_NOKIA_RX51 is not set
219
220#
221# Processor Type
222#
223CONFIG_CPU_32=y
224CONFIG_CPU_32v6K=y
225CONFIG_CPU_V7=y
226CONFIG_CPU_32v7=y
227CONFIG_CPU_ABRT_EV7=y
228CONFIG_CPU_PABRT_IFAR=y
229CONFIG_CPU_CACHE_V7=y
230CONFIG_CPU_CACHE_VIPT=y
231CONFIG_CPU_COPY_V6=y
232CONFIG_CPU_TLB_V7=y
233CONFIG_CPU_HAS_ASID=y
234CONFIG_CPU_CP15=y
235CONFIG_CPU_CP15_MMU=y
236
237#
238# Processor Features
239#
240CONFIG_ARM_THUMB=y
241# CONFIG_ARM_THUMBEE is not set
242# CONFIG_CPU_ICACHE_DISABLE is not set
243# CONFIG_CPU_DCACHE_DISABLE is not set
244# CONFIG_CPU_BPREDICT_DISABLE is not set
245CONFIG_HAS_TLS_REG=y
246# CONFIG_OUTER_CACHE is not set
247# CONFIG_ARM_ERRATA_430973 is not set
248# CONFIG_ARM_ERRATA_458693 is not set
249# CONFIG_ARM_ERRATA_460075 is not set
250CONFIG_COMMON_CLKDEV=y
251
252#
253# Bus support
254#
255# CONFIG_PCI_SYSCALL is not set
256# CONFIG_ARCH_SUPPORTS_MSI is not set
257# CONFIG_PCCARD is not set
258
259#
260# Kernel Features
261#
262CONFIG_TICK_ONESHOT=y
263CONFIG_NO_HZ=y
264CONFIG_HIGH_RES_TIMERS=y
265CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
266CONFIG_VMSPLIT_3G=y
267# CONFIG_VMSPLIT_2G is not set
268# CONFIG_VMSPLIT_1G is not set
269CONFIG_PAGE_OFFSET=0xC0000000
270# CONFIG_PREEMPT is not set
271CONFIG_HZ=128
272CONFIG_AEABI=y
273CONFIG_OABI_COMPAT=y
274CONFIG_ARCH_FLATMEM_HAS_HOLES=y
275# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
276# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
277# CONFIG_HIGHMEM is not set
278CONFIG_SELECT_MEMORY_MODEL=y
279CONFIG_FLATMEM_MANUAL=y
280# CONFIG_DISCONTIGMEM_MANUAL is not set
281# CONFIG_SPARSEMEM_MANUAL is not set
282CONFIG_FLATMEM=y
283CONFIG_FLAT_NODE_MEM_MAP=y
284CONFIG_PAGEFLAGS_EXTENDED=y
285CONFIG_SPLIT_PTLOCK_CPUS=4
286# CONFIG_PHYS_ADDR_T_64BIT is not set
287CONFIG_ZONE_DMA_FLAG=0
288CONFIG_VIRT_TO_BUS=y
289CONFIG_UNEVICTABLE_LRU=y
290CONFIG_HAVE_MLOCK=y
291CONFIG_HAVE_MLOCKED_PAGE_BIT=y
292# CONFIG_LEDS is not set
293CONFIG_ALIGNMENT_TRAP=y
294
295#
296# Boot options
297#
298CONFIG_ZBOOT_ROM_TEXT=0x0
299CONFIG_ZBOOT_ROM_BSS=0x0
300CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
301# CONFIG_XIP_KERNEL is not set
302# CONFIG_KEXEC is not set
303
304#
305# CPU Power Management
306#
307# CONFIG_CPU_FREQ is not set
308# CONFIG_CPU_IDLE is not set
309
310#
311# Floating point emulation
312#
313
314#
315# At least one emulation must be selected
316#
317CONFIG_FPE_NWFPE=y
318# CONFIG_FPE_NWFPE_XP is not set
319# CONFIG_FPE_FASTFPE is not set
320CONFIG_VFP=y
321CONFIG_VFPv3=y
322CONFIG_NEON=y
323
324#
325# Userspace binary formats
326#
327CONFIG_BINFMT_ELF=y
328# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
329CONFIG_HAVE_AOUT=y
330# CONFIG_BINFMT_AOUT is not set
331CONFIG_BINFMT_MISC=y
332
333#
334# Power management options
335#
336CONFIG_PM=y
337# CONFIG_PM_DEBUG is not set
338CONFIG_PM_SLEEP=y
339CONFIG_SUSPEND=y
340CONFIG_SUSPEND_FREEZER=y
341# CONFIG_APM_EMULATION is not set
342CONFIG_ARCH_SUSPEND_POSSIBLE=y
343CONFIG_NET=y
344
345#
346# Networking options
347#
348CONFIG_PACKET=y
349# CONFIG_PACKET_MMAP is not set
350CONFIG_UNIX=y
351CONFIG_XFRM=y
352# CONFIG_XFRM_USER is not set
353# CONFIG_XFRM_SUB_POLICY is not set
354# CONFIG_XFRM_MIGRATE is not set
355# CONFIG_XFRM_STATISTICS is not set
356CONFIG_NET_KEY=y
357# CONFIG_NET_KEY_MIGRATE is not set
358CONFIG_INET=y
359# CONFIG_IP_MULTICAST is not set
360# CONFIG_IP_ADVANCED_ROUTER is not set
361CONFIG_IP_FIB_HASH=y
362CONFIG_IP_PNP=y
363CONFIG_IP_PNP_DHCP=y
364CONFIG_IP_PNP_BOOTP=y
365CONFIG_IP_PNP_RARP=y
366# CONFIG_NET_IPIP is not set
367# CONFIG_NET_IPGRE is not set
368# CONFIG_ARPD is not set
369# CONFIG_SYN_COOKIES is not set
370# CONFIG_INET_AH is not set
371# CONFIG_INET_ESP is not set
372# CONFIG_INET_IPCOMP is not set
373# CONFIG_INET_XFRM_TUNNEL is not set
374# CONFIG_INET_TUNNEL is not set
375CONFIG_INET_XFRM_MODE_TRANSPORT=y
376CONFIG_INET_XFRM_MODE_TUNNEL=y
377CONFIG_INET_XFRM_MODE_BEET=y
378# CONFIG_INET_LRO is not set
379CONFIG_INET_DIAG=y
380CONFIG_INET_TCP_DIAG=y
381# CONFIG_TCP_CONG_ADVANCED is not set
382CONFIG_TCP_CONG_CUBIC=y
383CONFIG_DEFAULT_TCP_CONG="cubic"
384# CONFIG_TCP_MD5SIG is not set
385# CONFIG_IPV6 is not set
386# CONFIG_NETWORK_SECMARK is not set
387# CONFIG_NETFILTER is not set
388# CONFIG_IP_DCCP is not set
389# CONFIG_IP_SCTP is not set
390# CONFIG_TIPC is not set
391# CONFIG_ATM is not set
392# CONFIG_BRIDGE is not set
393# CONFIG_NET_DSA is not set
394# CONFIG_VLAN_8021Q is not set
395# CONFIG_DECNET is not set
396# CONFIG_LLC2 is not set
397# CONFIG_IPX is not set
398# CONFIG_ATALK is not set
399# CONFIG_X25 is not set
400# CONFIG_LAPB is not set
401# CONFIG_ECONET is not set
402# CONFIG_WAN_ROUTER is not set
403# CONFIG_PHONET is not set
404# CONFIG_NET_SCHED is not set
405# CONFIG_DCB is not set
406
407#
408# Network testing
409#
410# CONFIG_NET_PKTGEN is not set
411# CONFIG_HAMRADIO is not set
412# CONFIG_CAN is not set
413# CONFIG_IRDA is not set
414# CONFIG_BT is not set
415# CONFIG_AF_RXRPC is not set
416CONFIG_WIRELESS=y
417# CONFIG_CFG80211 is not set
418# CONFIG_WIRELESS_OLD_REGULATORY is not set
419# CONFIG_WIRELESS_EXT is not set
420# CONFIG_LIB80211 is not set
421# CONFIG_MAC80211 is not set
422# CONFIG_WIMAX is not set
423# CONFIG_RFKILL is not set
424# CONFIG_NET_9P is not set
425
426#
427# Device Drivers
428#
429
430#
431# Generic Driver Options
432#
433CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
434CONFIG_STANDALONE=y
435CONFIG_PREVENT_FIRMWARE_BUILD=y
436# CONFIG_FW_LOADER is not set
437# CONFIG_DEBUG_DRIVER is not set
438# CONFIG_DEBUG_DEVRES is not set
439# CONFIG_SYS_HYPERVISOR is not set
440# CONFIG_CONNECTOR is not set
441CONFIG_MTD=y
442# CONFIG_MTD_DEBUG is not set
443CONFIG_MTD_CONCAT=y
444CONFIG_MTD_PARTITIONS=y
445# CONFIG_MTD_TESTS is not set
446# CONFIG_MTD_REDBOOT_PARTS is not set
447CONFIG_MTD_CMDLINE_PARTS=y
448# CONFIG_MTD_AFS_PARTS is not set
449# CONFIG_MTD_AR7_PARTS is not set
450
451#
452# User Modules And Translation Layers
453#
454CONFIG_MTD_CHAR=y
455CONFIG_MTD_BLKDEVS=y
456CONFIG_MTD_BLOCK=y
457# CONFIG_FTL is not set
458# CONFIG_NFTL is not set
459# CONFIG_INFTL is not set
460# CONFIG_RFD_FTL is not set
461# CONFIG_SSFDC is not set
462# CONFIG_MTD_OOPS is not set
463
464#
465# RAM/ROM/Flash chip drivers
466#
467CONFIG_MTD_CFI=y
468# CONFIG_MTD_JEDECPROBE is not set
469CONFIG_MTD_GEN_PROBE=y
470# CONFIG_MTD_CFI_ADV_OPTIONS is not set
471CONFIG_MTD_MAP_BANK_WIDTH_1=y
472CONFIG_MTD_MAP_BANK_WIDTH_2=y
473CONFIG_MTD_MAP_BANK_WIDTH_4=y
474# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
475# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
476# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
477CONFIG_MTD_CFI_I1=y
478CONFIG_MTD_CFI_I2=y
479# CONFIG_MTD_CFI_I4 is not set
480# CONFIG_MTD_CFI_I8 is not set
481CONFIG_MTD_CFI_INTELEXT=y
482# CONFIG_MTD_CFI_AMDSTD is not set
483# CONFIG_MTD_CFI_STAA is not set
484CONFIG_MTD_CFI_UTIL=y
485# CONFIG_MTD_RAM is not set
486# CONFIG_MTD_ROM is not set
487# CONFIG_MTD_ABSENT is not set
488
489#
490# Mapping drivers for chip access
491#
492# CONFIG_MTD_COMPLEX_MAPPINGS is not set
493# CONFIG_MTD_PHYSMAP is not set
494# CONFIG_MTD_ARM_INTEGRATOR is not set
495# CONFIG_MTD_OMAP_NOR is not set
496# CONFIG_MTD_PLATRAM is not set
497
498#
499# Self-contained MTD device drivers
500#
501# CONFIG_MTD_DATAFLASH is not set
502# CONFIG_MTD_M25P80 is not set
503# CONFIG_MTD_SLRAM is not set
504# CONFIG_MTD_PHRAM is not set
505# CONFIG_MTD_MTDRAM is not set
506# CONFIG_MTD_BLOCK2MTD is not set
507
508#
509# Disk-On-Chip Device Drivers
510#
511# CONFIG_MTD_DOC2000 is not set
512# CONFIG_MTD_DOC2001 is not set
513# CONFIG_MTD_DOC2001PLUS is not set
514CONFIG_MTD_NAND=y
515# CONFIG_MTD_NAND_VERIFY_WRITE is not set
516# CONFIG_MTD_NAND_ECC_SMC is not set
517# CONFIG_MTD_NAND_MUSEUM_IDS is not set
518# CONFIG_MTD_NAND_GPIO is not set
519CONFIG_MTD_NAND_IDS=y
520# CONFIG_MTD_NAND_DISKONCHIP is not set
521# CONFIG_MTD_NAND_NANDSIM is not set
522# CONFIG_MTD_NAND_PLATFORM is not set
523# CONFIG_MTD_ALAUDA is not set
524CONFIG_MTD_ONENAND=y
525CONFIG_MTD_ONENAND_VERIFY_WRITE=y
526# CONFIG_MTD_ONENAND_GENERIC is not set
527CONFIG_MTD_ONENAND_OMAP2=y
528# CONFIG_MTD_ONENAND_OTP is not set
529# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
530# CONFIG_MTD_ONENAND_SIM is not set
531
532#
533# LPDDR flash memory drivers
534#
535# CONFIG_MTD_LPDDR is not set
536
537#
538# UBI - Unsorted block images
539#
540# CONFIG_MTD_UBI is not set
541# CONFIG_PARPORT is not set
542CONFIG_BLK_DEV=y
543# CONFIG_BLK_DEV_COW_COMMON is not set
544CONFIG_BLK_DEV_LOOP=y
545# CONFIG_BLK_DEV_CRYPTOLOOP is not set
546# CONFIG_BLK_DEV_NBD is not set
547# CONFIG_BLK_DEV_UB is not set
548CONFIG_BLK_DEV_RAM=y
549CONFIG_BLK_DEV_RAM_COUNT=16
550CONFIG_BLK_DEV_RAM_SIZE=16384
551# CONFIG_BLK_DEV_XIP is not set
552# CONFIG_CDROM_PKTCDVD is not set
553# CONFIG_ATA_OVER_ETH is not set
554# CONFIG_MISC_DEVICES is not set
555CONFIG_HAVE_IDE=y
556# CONFIG_IDE is not set
557
558#
559# SCSI device support
560#
561# CONFIG_RAID_ATTRS is not set
562CONFIG_SCSI=y
563CONFIG_SCSI_DMA=y
564# CONFIG_SCSI_TGT is not set
565# CONFIG_SCSI_NETLINK is not set
566CONFIG_SCSI_PROC_FS=y
567
568#
569# SCSI support type (disk, tape, CD-ROM)
570#
571CONFIG_BLK_DEV_SD=y
572# CONFIG_CHR_DEV_ST is not set
573# CONFIG_CHR_DEV_OSST is not set
574# CONFIG_BLK_DEV_SR is not set
575# CONFIG_CHR_DEV_SG is not set
576# CONFIG_CHR_DEV_SCH is not set
577
578#
579# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
580#
581# CONFIG_SCSI_MULTI_LUN is not set
582# CONFIG_SCSI_CONSTANTS is not set
583# CONFIG_SCSI_LOGGING is not set
584# CONFIG_SCSI_SCAN_ASYNC is not set
585CONFIG_SCSI_WAIT_SCAN=m
586
587#
588# SCSI Transports
589#
590# CONFIG_SCSI_SPI_ATTRS is not set
591# CONFIG_SCSI_FC_ATTRS is not set
592# CONFIG_SCSI_ISCSI_ATTRS is not set
593# CONFIG_SCSI_SAS_LIBSAS is not set
594# CONFIG_SCSI_SRP_ATTRS is not set
595CONFIG_SCSI_LOWLEVEL=y
596# CONFIG_ISCSI_TCP is not set
597# CONFIG_LIBFC is not set
598# CONFIG_LIBFCOE is not set
599# CONFIG_SCSI_DEBUG is not set
600# CONFIG_SCSI_DH is not set
601# CONFIG_SCSI_OSD_INITIATOR is not set
602# CONFIG_ATA is not set
603# CONFIG_MD is not set
604CONFIG_NETDEVICES=y
605CONFIG_COMPAT_NET_DEV_OPS=y
606# CONFIG_DUMMY is not set
607# CONFIG_BONDING is not set
608# CONFIG_MACVLAN is not set
609# CONFIG_EQUALIZER is not set
610# CONFIG_TUN is not set
611# CONFIG_VETH is not set
612# CONFIG_PHYLIB is not set
613CONFIG_NET_ETHERNET=y
614CONFIG_MII=y
615# CONFIG_AX88796 is not set
616# CONFIG_SMC91X is not set
617# CONFIG_DM9000 is not set
618# CONFIG_ENC28J60 is not set
619# CONFIG_ETHOC is not set
620CONFIG_SMC911X=y
621# CONFIG_SMSC911X is not set
622# CONFIG_DNET is not set
623# CONFIG_IBM_NEW_EMAC_ZMII is not set
624# CONFIG_IBM_NEW_EMAC_RGMII is not set
625# CONFIG_IBM_NEW_EMAC_TAH is not set
626# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
627# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
628# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
629# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
630# CONFIG_B44 is not set
631# CONFIG_NETDEV_1000 is not set
632# CONFIG_NETDEV_10000 is not set
633
634#
635# Wireless LAN
636#
637# CONFIG_WLAN_PRE80211 is not set
638# CONFIG_WLAN_80211 is not set
639
640#
641# Enable WiMAX (Networking options) to see the WiMAX drivers
642#
643
644#
645# USB Network Adapters
646#
647# CONFIG_USB_CATC is not set
648# CONFIG_USB_KAWETH is not set
649# CONFIG_USB_PEGASUS is not set
650# CONFIG_USB_RTL8150 is not set
651# CONFIG_USB_USBNET is not set
652# CONFIG_WAN is not set
653# CONFIG_PPP is not set
654# CONFIG_SLIP is not set
655# CONFIG_NETCONSOLE is not set
656# CONFIG_NETPOLL is not set
657# CONFIG_NET_POLL_CONTROLLER is not set
658# CONFIG_ISDN is not set
659
660#
661# Input device support
662#
663CONFIG_INPUT=y
664# CONFIG_INPUT_FF_MEMLESS is not set
665# CONFIG_INPUT_POLLDEV is not set
666
667#
668# Userland interfaces
669#
670# CONFIG_INPUT_MOUSEDEV is not set
671# CONFIG_INPUT_JOYDEV is not set
672CONFIG_INPUT_EVDEV=y
673# CONFIG_INPUT_EVBUG is not set
674
675#
676# Input Device Drivers
677#
678CONFIG_INPUT_KEYBOARD=y
679# CONFIG_KEYBOARD_ATKBD is not set
680# CONFIG_KEYBOARD_SUNKBD is not set
681# CONFIG_KEYBOARD_LKKBD is not set
682# CONFIG_KEYBOARD_XTKBD is not set
683# CONFIG_KEYBOARD_NEWTON is not set
684# CONFIG_KEYBOARD_STOWAWAY is not set
685# CONFIG_KEYBOARD_GPIO is not set
686# CONFIG_INPUT_MOUSE is not set
687# CONFIG_INPUT_JOYSTICK is not set
688# CONFIG_INPUT_TABLET is not set
689CONFIG_INPUT_TOUCHSCREEN=y
690CONFIG_TOUCHSCREEN_ADS7846=y
691# CONFIG_TOUCHSCREEN_AD7877 is not set
692# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
693# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
694# CONFIG_TOUCHSCREEN_AD7879 is not set
695# CONFIG_TOUCHSCREEN_FUJITSU is not set
696# CONFIG_TOUCHSCREEN_GUNZE is not set
697# CONFIG_TOUCHSCREEN_ELO is not set
698# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
699# CONFIG_TOUCHSCREEN_MTOUCH is not set
700# CONFIG_TOUCHSCREEN_INEXIO is not set
701# CONFIG_TOUCHSCREEN_MK712 is not set
702# CONFIG_TOUCHSCREEN_PENMOUNT is not set
703# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
704# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
705# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
706# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
707# CONFIG_TOUCHSCREEN_TSC2007 is not set
708# CONFIG_INPUT_MISC is not set
709
710#
711# Hardware I/O ports
712#
713# CONFIG_SERIO is not set
714# CONFIG_GAMEPORT is not set
715
716#
717# Character devices
718#
719CONFIG_VT=y
720CONFIG_CONSOLE_TRANSLATIONS=y
721CONFIG_VT_CONSOLE=y
722CONFIG_HW_CONSOLE=y
723# CONFIG_VT_HW_CONSOLE_BINDING is not set
724CONFIG_DEVKMEM=y
725# CONFIG_SERIAL_NONSTANDARD is not set
726
727#
728# Serial drivers
729#
730CONFIG_SERIAL_8250=y
731CONFIG_SERIAL_8250_CONSOLE=y
732CONFIG_SERIAL_8250_NR_UARTS=32
733CONFIG_SERIAL_8250_RUNTIME_UARTS=4
734CONFIG_SERIAL_8250_EXTENDED=y
735CONFIG_SERIAL_8250_MANY_PORTS=y
736CONFIG_SERIAL_8250_SHARE_IRQ=y
737CONFIG_SERIAL_8250_DETECT_IRQ=y
738CONFIG_SERIAL_8250_RSA=y
739
740#
741# Non-8250 serial port support
742#
743# CONFIG_SERIAL_MAX3100 is not set
744CONFIG_SERIAL_CORE=y
745CONFIG_SERIAL_CORE_CONSOLE=y
746CONFIG_UNIX98_PTYS=y
747# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
748# CONFIG_LEGACY_PTYS is not set
749# CONFIG_IPMI_HANDLER is not set
750CONFIG_HW_RANDOM=y
751# CONFIG_HW_RANDOM_TIMERIOMEM is not set
752# CONFIG_R3964 is not set
753# CONFIG_RAW_DRIVER is not set
754# CONFIG_TCG_TPM is not set
755CONFIG_I2C=y
756CONFIG_I2C_BOARDINFO=y
757CONFIG_I2C_CHARDEV=y
758CONFIG_I2C_HELPER_AUTO=y
759
760#
761# I2C Hardware Bus support
762#
763
764#
765# I2C system bus drivers (mostly embedded / system-on-chip)
766#
767# CONFIG_I2C_GPIO is not set
768# CONFIG_I2C_OCORES is not set
769CONFIG_I2C_OMAP=y
770# CONFIG_I2C_SIMTEC is not set
771
772#
773# External I2C/SMBus adapter drivers
774#
775# CONFIG_I2C_PARPORT_LIGHT is not set
776# CONFIG_I2C_TAOS_EVM is not set
777# CONFIG_I2C_TINY_USB is not set
778
779#
780# Other I2C/SMBus bus drivers
781#
782# CONFIG_I2C_PCA_PLATFORM is not set
783# CONFIG_I2C_STUB is not set
784
785#
786# Miscellaneous I2C Chip support
787#
788# CONFIG_DS1682 is not set
789# CONFIG_SENSORS_PCF8574 is not set
790# CONFIG_PCF8575 is not set
791# CONFIG_SENSORS_PCA9539 is not set
792# CONFIG_SENSORS_MAX6875 is not set
793# CONFIG_SENSORS_TSL2550 is not set
794# CONFIG_I2C_DEBUG_CORE is not set
795# CONFIG_I2C_DEBUG_ALGO is not set
796# CONFIG_I2C_DEBUG_BUS is not set
797# CONFIG_I2C_DEBUG_CHIP is not set
798CONFIG_SPI=y
799# CONFIG_SPI_DEBUG is not set
800CONFIG_SPI_MASTER=y
801
802#
803# SPI Master Controller Drivers
804#
805# CONFIG_SPI_BITBANG is not set
806# CONFIG_SPI_GPIO is not set
807CONFIG_SPI_OMAP24XX=y
808
809#
810# SPI Protocol Masters
811#
812# CONFIG_SPI_SPIDEV is not set
813# CONFIG_SPI_TLE62X0 is not set
814CONFIG_ARCH_REQUIRE_GPIOLIB=y
815CONFIG_GPIOLIB=y
816# CONFIG_DEBUG_GPIO is not set
817# CONFIG_GPIO_SYSFS is not set
818
819#
820# Memory mapped GPIO expanders:
821#
822
823#
824# I2C GPIO expanders:
825#
826# CONFIG_GPIO_MAX732X is not set
827# CONFIG_GPIO_PCA953X is not set
828# CONFIG_GPIO_PCF857X is not set
829CONFIG_GPIO_TWL4030=y
830
831#
832# PCI GPIO expanders:
833#
834
835#
836# SPI GPIO expanders:
837#
838# CONFIG_GPIO_MAX7301 is not set
839# CONFIG_GPIO_MCP23S08 is not set
840# CONFIG_W1 is not set
841# CONFIG_POWER_SUPPLY is not set
842# CONFIG_HWMON is not set
843# CONFIG_THERMAL is not set
844# CONFIG_THERMAL_HWMON is not set
845CONFIG_WATCHDOG=y
846CONFIG_WATCHDOG_NOWAYOUT=y
847
848#
849# Watchdog Device Drivers
850#
851# CONFIG_SOFT_WATCHDOG is not set
852CONFIG_OMAP_WATCHDOG=y
853
854#
855# USB-based Watchdog Cards
856#
857# CONFIG_USBPCWATCHDOG is not set
858CONFIG_SSB_POSSIBLE=y
859
860#
861# Sonics Silicon Backplane
862#
863# CONFIG_SSB is not set
864
865#
866# Multifunction device drivers
867#
868# CONFIG_MFD_CORE is not set
869# CONFIG_MFD_SM501 is not set
870# CONFIG_MFD_ASIC3 is not set
871# CONFIG_HTC_EGPIO is not set
872# CONFIG_HTC_PASIC3 is not set
873# CONFIG_TPS65010 is not set
874CONFIG_TWL4030_CORE=y
875# CONFIG_MFD_TMIO is not set
876# CONFIG_MFD_T7L66XB is not set
877# CONFIG_MFD_TC6387XB is not set
878# CONFIG_MFD_TC6393XB is not set
879# CONFIG_PMIC_DA903X is not set
880# CONFIG_MFD_WM8400 is not set
881# CONFIG_MFD_WM8350_I2C is not set
882# CONFIG_MFD_PCF50633 is not set
883
884#
885# Multimedia devices
886#
887
888#
889# Multimedia core support
890#
891# CONFIG_VIDEO_DEV is not set
892# CONFIG_DVB_CORE is not set
893# CONFIG_VIDEO_MEDIA is not set
894
895#
896# Multimedia drivers
897#
898CONFIG_DAB=y
899# CONFIG_USB_DABUSB is not set
900
901#
902# Graphics support
903#
904# CONFIG_VGASTATE is not set
905CONFIG_VIDEO_OUTPUT_CONTROL=m
906# CONFIG_FB is not set
907# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
908
909#
910# Display device support
911#
912# CONFIG_DISPLAY_SUPPORT is not set
913
914#
915# Console display driver support
916#
917# CONFIG_VGA_CONSOLE is not set
918CONFIG_DUMMY_CONSOLE=y
919# CONFIG_SOUND is not set
920CONFIG_HID_SUPPORT=y
921CONFIG_HID=y
922# CONFIG_HID_DEBUG is not set
923# CONFIG_HIDRAW is not set
924
925#
926# USB Input Devices
927#
928CONFIG_USB_HID=y
929# CONFIG_HID_PID is not set
930# CONFIG_USB_HIDDEV is not set
931
932#
933# Special HID drivers
934#
935# CONFIG_HID_A4TECH is not set
936# CONFIG_HID_APPLE is not set
937# CONFIG_HID_BELKIN is not set
938# CONFIG_HID_CHERRY is not set
939# CONFIG_HID_CHICONY is not set
940# CONFIG_HID_CYPRESS is not set
941# CONFIG_DRAGONRISE_FF is not set
942# CONFIG_HID_EZKEY is not set
943# CONFIG_HID_KYE is not set
944# CONFIG_HID_GYRATION is not set
945# CONFIG_HID_KENSINGTON is not set
946# CONFIG_HID_LOGITECH is not set
947# CONFIG_HID_MICROSOFT is not set
948# CONFIG_HID_MONTEREY is not set
949# CONFIG_HID_NTRIG is not set
950# CONFIG_HID_PANTHERLORD is not set
951# CONFIG_HID_PETALYNX is not set
952# CONFIG_HID_SAMSUNG is not set
953# CONFIG_HID_SONY is not set
954# CONFIG_HID_SUNPLUS is not set
955# CONFIG_GREENASIA_FF is not set
956# CONFIG_HID_TOPSEED is not set
957# CONFIG_THRUSTMASTER_FF is not set
958# CONFIG_ZEROPLUS_FF is not set
959CONFIG_USB_SUPPORT=y
960CONFIG_USB_ARCH_HAS_HCD=y
961CONFIG_USB_ARCH_HAS_OHCI=y
962# CONFIG_USB_ARCH_HAS_EHCI is not set
963CONFIG_USB=y
964# CONFIG_USB_DEBUG is not set
965CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
966
967#
968# Miscellaneous USB options
969#
970CONFIG_USB_DEVICEFS=y
971# CONFIG_USB_DEVICE_CLASS is not set
972# CONFIG_USB_DYNAMIC_MINORS is not set
973CONFIG_USB_SUSPEND=y
974CONFIG_USB_OTG=y
975# CONFIG_USB_OTG_WHITELIST is not set
976# CONFIG_USB_OTG_BLACKLIST_HUB is not set
977CONFIG_USB_MON=y
978# CONFIG_USB_WUSB is not set
979# CONFIG_USB_WUSB_CBAF is not set
980
981#
982# USB Host Controller Drivers
983#
984# CONFIG_USB_C67X00_HCD is not set
985# CONFIG_USB_OXU210HP_HCD is not set
986# CONFIG_USB_ISP116X_HCD is not set
987# CONFIG_USB_ISP1760_HCD is not set
988# CONFIG_USB_OHCI_HCD is not set
989# CONFIG_USB_SL811_HCD is not set
990# CONFIG_USB_R8A66597_HCD is not set
991# CONFIG_USB_HWA_HCD is not set
992CONFIG_USB_MUSB_HDRC=y
993CONFIG_USB_MUSB_SOC=y
994
995#
996# OMAP 343x high speed USB support
997#
998# CONFIG_USB_MUSB_HOST is not set
999# CONFIG_USB_MUSB_PERIPHERAL is not set
1000CONFIG_USB_MUSB_OTG=y
1001CONFIG_USB_GADGET_MUSB_HDRC=y
1002CONFIG_USB_MUSB_HDRC_HCD=y
1003# CONFIG_MUSB_PIO_ONLY is not set
1004CONFIG_USB_INVENTRA_DMA=y
1005# CONFIG_USB_TI_CPPI_DMA is not set
1006# CONFIG_USB_MUSB_DEBUG is not set
1007
1008#
1009# USB Device Class drivers
1010#
1011# CONFIG_USB_ACM is not set
1012# CONFIG_USB_PRINTER is not set
1013# CONFIG_USB_WDM is not set
1014# CONFIG_USB_TMC is not set
1015
1016#
1017# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1018#
1019
1020#
1021# also be needed; see USB_STORAGE Help for more info
1022#
1023CONFIG_USB_STORAGE=y
1024# CONFIG_USB_STORAGE_DEBUG is not set
1025# CONFIG_USB_STORAGE_DATAFAB is not set
1026# CONFIG_USB_STORAGE_FREECOM is not set
1027# CONFIG_USB_STORAGE_ISD200 is not set
1028# CONFIG_USB_STORAGE_USBAT is not set
1029# CONFIG_USB_STORAGE_SDDR09 is not set
1030# CONFIG_USB_STORAGE_SDDR55 is not set
1031# CONFIG_USB_STORAGE_JUMPSHOT is not set
1032# CONFIG_USB_STORAGE_ALAUDA is not set
1033# CONFIG_USB_STORAGE_ONETOUCH is not set
1034# CONFIG_USB_STORAGE_KARMA is not set
1035# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1036# CONFIG_USB_LIBUSUAL is not set
1037
1038#
1039# USB Imaging devices
1040#
1041# CONFIG_USB_MDC800 is not set
1042# CONFIG_USB_MICROTEK is not set
1043
1044#
1045# USB port drivers
1046#
1047# CONFIG_USB_SERIAL is not set
1048
1049#
1050# USB Miscellaneous drivers
1051#
1052# CONFIG_USB_EMI62 is not set
1053# CONFIG_USB_EMI26 is not set
1054# CONFIG_USB_ADUTUX is not set
1055# CONFIG_USB_SEVSEG is not set
1056# CONFIG_USB_RIO500 is not set
1057# CONFIG_USB_LEGOTOWER is not set
1058# CONFIG_USB_LCD is not set
1059# CONFIG_USB_BERRY_CHARGE is not set
1060# CONFIG_USB_LED is not set
1061# CONFIG_USB_CYPRESS_CY7C63 is not set
1062# CONFIG_USB_CYTHERM is not set
1063# CONFIG_USB_IDMOUSE is not set
1064# CONFIG_USB_FTDI_ELAN is not set
1065# CONFIG_USB_APPLEDISPLAY is not set
1066# CONFIG_USB_LD is not set
1067# CONFIG_USB_TRANCEVIBRATOR is not set
1068# CONFIG_USB_IOWARRIOR is not set
1069CONFIG_USB_TEST=y
1070# CONFIG_USB_ISIGHTFW is not set
1071# CONFIG_USB_VST is not set
1072CONFIG_USB_GADGET=y
1073# CONFIG_USB_GADGET_DEBUG is not set
1074# CONFIG_USB_GADGET_DEBUG_FILES is not set
1075CONFIG_USB_GADGET_VBUS_DRAW=2
1076CONFIG_USB_GADGET_SELECTED=y
1077# CONFIG_USB_GADGET_AT91 is not set
1078# CONFIG_USB_GADGET_ATMEL_USBA is not set
1079# CONFIG_USB_GADGET_FSL_USB2 is not set
1080# CONFIG_USB_GADGET_LH7A40X is not set
1081# CONFIG_USB_GADGET_OMAP is not set
1082# CONFIG_USB_GADGET_PXA25X is not set
1083# CONFIG_USB_GADGET_PXA27X is not set
1084# CONFIG_USB_GADGET_S3C2410 is not set
1085# CONFIG_USB_GADGET_IMX is not set
1086# CONFIG_USB_GADGET_M66592 is not set
1087# CONFIG_USB_GADGET_AMD5536UDC is not set
1088# CONFIG_USB_GADGET_FSL_QE is not set
1089# CONFIG_USB_GADGET_CI13XXX is not set
1090# CONFIG_USB_GADGET_NET2280 is not set
1091# CONFIG_USB_GADGET_GOKU is not set
1092# CONFIG_USB_GADGET_DUMMY_HCD is not set
1093CONFIG_USB_GADGET_DUALSPEED=y
1094CONFIG_USB_ZERO=m
1095# CONFIG_USB_ZERO_HNPTEST is not set
1096# CONFIG_USB_ETH is not set
1097# CONFIG_USB_GADGETFS is not set
1098# CONFIG_USB_FILE_STORAGE is not set
1099# CONFIG_USB_G_SERIAL is not set
1100# CONFIG_USB_MIDI_GADGET is not set
1101# CONFIG_USB_G_PRINTER is not set
1102# CONFIG_USB_CDC_COMPOSITE is not set
1103
1104#
1105# OTG and related infrastructure
1106#
1107CONFIG_USB_OTG_UTILS=y
1108# CONFIG_USB_GPIO_VBUS is not set
1109# CONFIG_ISP1301_OMAP is not set
1110CONFIG_TWL4030_USB=y
1111# CONFIG_NOP_USB_XCEIV is not set
1112CONFIG_MMC=y
1113# CONFIG_MMC_DEBUG is not set
1114# CONFIG_MMC_UNSAFE_RESUME is not set
1115
1116#
1117# MMC/SD/SDIO Card Drivers
1118#
1119CONFIG_MMC_BLOCK=y
1120CONFIG_MMC_BLOCK_BOUNCE=y
1121# CONFIG_SDIO_UART is not set
1122# CONFIG_MMC_TEST is not set
1123
1124#
1125# MMC/SD/SDIO Host Controller Drivers
1126#
1127# CONFIG_MMC_SDHCI is not set
1128# CONFIG_MMC_OMAP is not set
1129CONFIG_MMC_OMAP_HS=m
1130# CONFIG_MMC_SPI is not set
1131# CONFIG_MEMSTICK is not set
1132# CONFIG_ACCESSIBILITY is not set
1133# CONFIG_NEW_LEDS is not set
1134CONFIG_RTC_LIB=y
1135# CONFIG_RTC_CLASS is not set
1136# CONFIG_DMADEVICES is not set
1137# CONFIG_AUXDISPLAY is not set
1138CONFIG_REGULATOR=y
1139# CONFIG_REGULATOR_DEBUG is not set
1140# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1141# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1142# CONFIG_REGULATOR_BQ24022 is not set
1143CONFIG_REGULATOR_TWL4030=y
1144# CONFIG_UIO is not set
1145# CONFIG_STAGING is not set
1146
1147#
1148# File systems
1149#
1150CONFIG_EXT2_FS=y
1151# CONFIG_EXT2_FS_XATTR is not set
1152# CONFIG_EXT2_FS_XIP is not set
1153CONFIG_EXT3_FS=y
1154# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1155# CONFIG_EXT3_FS_XATTR is not set
1156# CONFIG_EXT4_FS is not set
1157CONFIG_JBD=y
1158# CONFIG_REISERFS_FS is not set
1159# CONFIG_JFS_FS is not set
1160# CONFIG_FS_POSIX_ACL is not set
1161CONFIG_FILE_LOCKING=y
1162# CONFIG_XFS_FS is not set
1163# CONFIG_OCFS2_FS is not set
1164# CONFIG_BTRFS_FS is not set
1165CONFIG_DNOTIFY=y
1166CONFIG_INOTIFY=y
1167CONFIG_INOTIFY_USER=y
1168CONFIG_QUOTA=y
1169# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1170CONFIG_PRINT_QUOTA_WARNING=y
1171CONFIG_QUOTA_TREE=y
1172# CONFIG_QFMT_V1 is not set
1173CONFIG_QFMT_V2=y
1174CONFIG_QUOTACTL=y
1175# CONFIG_AUTOFS_FS is not set
1176# CONFIG_AUTOFS4_FS is not set
1177# CONFIG_FUSE_FS is not set
1178
1179#
1180# Caches
1181#
1182# CONFIG_FSCACHE is not set
1183
1184#
1185# CD-ROM/DVD Filesystems
1186#
1187# CONFIG_ISO9660_FS is not set
1188# CONFIG_UDF_FS is not set
1189
1190#
1191# DOS/FAT/NT Filesystems
1192#
1193CONFIG_FAT_FS=y
1194CONFIG_MSDOS_FS=y
1195CONFIG_VFAT_FS=y
1196CONFIG_FAT_DEFAULT_CODEPAGE=437
1197CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1198# CONFIG_NTFS_FS is not set
1199
1200#
1201# Pseudo filesystems
1202#
1203CONFIG_PROC_FS=y
1204CONFIG_PROC_SYSCTL=y
1205CONFIG_PROC_PAGE_MONITOR=y
1206CONFIG_SYSFS=y
1207CONFIG_TMPFS=y
1208# CONFIG_TMPFS_POSIX_ACL is not set
1209# CONFIG_HUGETLB_PAGE is not set
1210# CONFIG_CONFIGFS_FS is not set
1211CONFIG_MISC_FILESYSTEMS=y
1212# CONFIG_ADFS_FS is not set
1213# CONFIG_AFFS_FS is not set
1214# CONFIG_HFS_FS is not set
1215# CONFIG_HFSPLUS_FS is not set
1216# CONFIG_BEFS_FS is not set
1217# CONFIG_BFS_FS is not set
1218# CONFIG_EFS_FS is not set
1219CONFIG_JFFS2_FS=y
1220CONFIG_JFFS2_FS_DEBUG=0
1221CONFIG_JFFS2_FS_WRITEBUFFER=y
1222# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1223# CONFIG_JFFS2_SUMMARY is not set
1224# CONFIG_JFFS2_FS_XATTR is not set
1225CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1226CONFIG_JFFS2_ZLIB=y
1227# CONFIG_JFFS2_LZO is not set
1228CONFIG_JFFS2_RTIME=y
1229# CONFIG_JFFS2_RUBIN is not set
1230# CONFIG_JFFS2_CMODE_NONE is not set
1231CONFIG_JFFS2_CMODE_PRIORITY=y
1232# CONFIG_JFFS2_CMODE_SIZE is not set
1233# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1234# CONFIG_CRAMFS is not set
1235# CONFIG_SQUASHFS is not set
1236# CONFIG_VXFS_FS is not set
1237# CONFIG_MINIX_FS is not set
1238# CONFIG_OMFS_FS is not set
1239# CONFIG_HPFS_FS is not set
1240# CONFIG_QNX4FS_FS is not set
1241# CONFIG_ROMFS_FS is not set
1242# CONFIG_SYSV_FS is not set
1243# CONFIG_UFS_FS is not set
1244# CONFIG_NILFS2_FS is not set
1245CONFIG_NETWORK_FILESYSTEMS=y
1246CONFIG_NFS_FS=y
1247CONFIG_NFS_V3=y
1248# CONFIG_NFS_V3_ACL is not set
1249CONFIG_NFS_V4=y
1250CONFIG_ROOT_NFS=y
1251# CONFIG_NFSD is not set
1252CONFIG_LOCKD=y
1253CONFIG_LOCKD_V4=y
1254CONFIG_NFS_COMMON=y
1255CONFIG_SUNRPC=y
1256CONFIG_SUNRPC_GSS=y
1257CONFIG_RPCSEC_GSS_KRB5=y
1258# CONFIG_RPCSEC_GSS_SPKM3 is not set
1259# CONFIG_SMB_FS is not set
1260# CONFIG_CIFS is not set
1261# CONFIG_NCP_FS is not set
1262# CONFIG_CODA_FS is not set
1263# CONFIG_AFS_FS is not set
1264
1265#
1266# Partition Types
1267#
1268CONFIG_PARTITION_ADVANCED=y
1269# CONFIG_ACORN_PARTITION is not set
1270# CONFIG_OSF_PARTITION is not set
1271# CONFIG_AMIGA_PARTITION is not set
1272# CONFIG_ATARI_PARTITION is not set
1273# CONFIG_MAC_PARTITION is not set
1274CONFIG_MSDOS_PARTITION=y
1275# CONFIG_BSD_DISKLABEL is not set
1276# CONFIG_MINIX_SUBPARTITION is not set
1277# CONFIG_SOLARIS_X86_PARTITION is not set
1278# CONFIG_UNIXWARE_DISKLABEL is not set
1279# CONFIG_LDM_PARTITION is not set
1280# CONFIG_SGI_PARTITION is not set
1281# CONFIG_ULTRIX_PARTITION is not set
1282# CONFIG_SUN_PARTITION is not set
1283# CONFIG_KARMA_PARTITION is not set
1284# CONFIG_EFI_PARTITION is not set
1285# CONFIG_SYSV68_PARTITION is not set
1286CONFIG_NLS=y
1287CONFIG_NLS_DEFAULT="iso8859-1"
1288CONFIG_NLS_CODEPAGE_437=y
1289# CONFIG_NLS_CODEPAGE_737 is not set
1290# CONFIG_NLS_CODEPAGE_775 is not set
1291# CONFIG_NLS_CODEPAGE_850 is not set
1292# CONFIG_NLS_CODEPAGE_852 is not set
1293# CONFIG_NLS_CODEPAGE_855 is not set
1294# CONFIG_NLS_CODEPAGE_857 is not set
1295# CONFIG_NLS_CODEPAGE_860 is not set
1296# CONFIG_NLS_CODEPAGE_861 is not set
1297# CONFIG_NLS_CODEPAGE_862 is not set
1298# CONFIG_NLS_CODEPAGE_863 is not set
1299# CONFIG_NLS_CODEPAGE_864 is not set
1300# CONFIG_NLS_CODEPAGE_865 is not set
1301# CONFIG_NLS_CODEPAGE_866 is not set
1302# CONFIG_NLS_CODEPAGE_869 is not set
1303# CONFIG_NLS_CODEPAGE_936 is not set
1304# CONFIG_NLS_CODEPAGE_950 is not set
1305# CONFIG_NLS_CODEPAGE_932 is not set
1306# CONFIG_NLS_CODEPAGE_949 is not set
1307# CONFIG_NLS_CODEPAGE_874 is not set
1308# CONFIG_NLS_ISO8859_8 is not set
1309# CONFIG_NLS_CODEPAGE_1250 is not set
1310# CONFIG_NLS_CODEPAGE_1251 is not set
1311# CONFIG_NLS_ASCII is not set
1312CONFIG_NLS_ISO8859_1=y
1313# CONFIG_NLS_ISO8859_2 is not set
1314# CONFIG_NLS_ISO8859_3 is not set
1315# CONFIG_NLS_ISO8859_4 is not set
1316# CONFIG_NLS_ISO8859_5 is not set
1317# CONFIG_NLS_ISO8859_6 is not set
1318# CONFIG_NLS_ISO8859_7 is not set
1319# CONFIG_NLS_ISO8859_9 is not set
1320# CONFIG_NLS_ISO8859_13 is not set
1321# CONFIG_NLS_ISO8859_14 is not set
1322# CONFIG_NLS_ISO8859_15 is not set
1323# CONFIG_NLS_KOI8_R is not set
1324# CONFIG_NLS_KOI8_U is not set
1325# CONFIG_NLS_UTF8 is not set
1326# CONFIG_DLM is not set
1327
1328#
1329# Kernel hacking
1330#
1331# CONFIG_PRINTK_TIME is not set
1332CONFIG_ENABLE_WARN_DEPRECATED=y
1333CONFIG_ENABLE_MUST_CHECK=y
1334CONFIG_FRAME_WARN=1024
1335CONFIG_MAGIC_SYSRQ=y
1336# CONFIG_UNUSED_SYMBOLS is not set
1337# CONFIG_DEBUG_FS is not set
1338# CONFIG_HEADERS_CHECK is not set
1339CONFIG_DEBUG_KERNEL=y
1340# CONFIG_DEBUG_SHIRQ is not set
1341CONFIG_DETECT_SOFTLOCKUP=y
1342# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1343CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1344CONFIG_DETECT_HUNG_TASK=y
1345# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1346CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1347# CONFIG_SCHED_DEBUG is not set
1348# CONFIG_SCHEDSTATS is not set
1349# CONFIG_TIMER_STATS is not set
1350# CONFIG_DEBUG_OBJECTS is not set
1351# CONFIG_DEBUG_SLAB is not set
1352# CONFIG_DEBUG_RT_MUTEXES is not set
1353# CONFIG_RT_MUTEX_TESTER is not set
1354# CONFIG_DEBUG_SPINLOCK is not set
1355CONFIG_DEBUG_MUTEXES=y
1356# CONFIG_DEBUG_LOCK_ALLOC is not set
1357# CONFIG_PROVE_LOCKING is not set
1358# CONFIG_LOCK_STAT is not set
1359# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1360# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1361# CONFIG_DEBUG_KOBJECT is not set
1362# CONFIG_DEBUG_BUGVERBOSE is not set
1363CONFIG_DEBUG_INFO=y
1364# CONFIG_DEBUG_VM is not set
1365# CONFIG_DEBUG_WRITECOUNT is not set
1366# CONFIG_DEBUG_MEMORY_INIT is not set
1367# CONFIG_DEBUG_LIST is not set
1368# CONFIG_DEBUG_SG is not set
1369# CONFIG_DEBUG_NOTIFIERS is not set
1370# CONFIG_BOOT_PRINTK_DELAY is not set
1371# CONFIG_RCU_TORTURE_TEST is not set
1372# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1373# CONFIG_BACKTRACE_SELF_TEST is not set
1374# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1375# CONFIG_FAULT_INJECTION is not set
1376# CONFIG_LATENCYTOP is not set
1377# CONFIG_PAGE_POISONING is not set
1378CONFIG_HAVE_FUNCTION_TRACER=y
1379CONFIG_TRACING_SUPPORT=y
1380
1381#
1382# Tracers
1383#
1384# CONFIG_FUNCTION_TRACER is not set
1385# CONFIG_IRQSOFF_TRACER is not set
1386# CONFIG_SCHED_TRACER is not set
1387# CONFIG_CONTEXT_SWITCH_TRACER is not set
1388# CONFIG_EVENT_TRACER is not set
1389# CONFIG_BOOT_TRACER is not set
1390# CONFIG_TRACE_BRANCH_PROFILING is not set
1391# CONFIG_STACK_TRACER is not set
1392# CONFIG_KMEMTRACE is not set
1393# CONFIG_WORKQUEUE_TRACER is not set
1394# CONFIG_BLK_DEV_IO_TRACE is not set
1395# CONFIG_SAMPLES is not set
1396CONFIG_HAVE_ARCH_KGDB=y
1397# CONFIG_KGDB is not set
1398CONFIG_ARM_UNWIND=y
1399# CONFIG_DEBUG_USER is not set
1400# CONFIG_DEBUG_ERRORS is not set
1401# CONFIG_DEBUG_STACK_USAGE is not set
1402CONFIG_DEBUG_LL=y
1403# CONFIG_DEBUG_ICEDCC is not set
1404
1405#
1406# Security options
1407#
1408# CONFIG_KEYS is not set
1409# CONFIG_SECURITY is not set
1410# CONFIG_SECURITYFS is not set
1411# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1412CONFIG_CRYPTO=y
1413
1414#
1415# Crypto core or helper
1416#
1417# CONFIG_CRYPTO_FIPS is not set
1418CONFIG_CRYPTO_ALGAPI=y
1419CONFIG_CRYPTO_ALGAPI2=y
1420CONFIG_CRYPTO_AEAD2=y
1421CONFIG_CRYPTO_BLKCIPHER=y
1422CONFIG_CRYPTO_BLKCIPHER2=y
1423CONFIG_CRYPTO_HASH=y
1424CONFIG_CRYPTO_HASH2=y
1425CONFIG_CRYPTO_RNG2=y
1426CONFIG_CRYPTO_PCOMP=y
1427CONFIG_CRYPTO_MANAGER=y
1428CONFIG_CRYPTO_MANAGER2=y
1429# CONFIG_CRYPTO_GF128MUL is not set
1430# CONFIG_CRYPTO_NULL is not set
1431CONFIG_CRYPTO_WORKQUEUE=y
1432# CONFIG_CRYPTO_CRYPTD is not set
1433# CONFIG_CRYPTO_AUTHENC is not set
1434# CONFIG_CRYPTO_TEST is not set
1435
1436#
1437# Authenticated Encryption with Associated Data
1438#
1439# CONFIG_CRYPTO_CCM is not set
1440# CONFIG_CRYPTO_GCM is not set
1441# CONFIG_CRYPTO_SEQIV is not set
1442
1443#
1444# Block modes
1445#
1446CONFIG_CRYPTO_CBC=y
1447# CONFIG_CRYPTO_CTR is not set
1448# CONFIG_CRYPTO_CTS is not set
1449CONFIG_CRYPTO_ECB=m
1450# CONFIG_CRYPTO_LRW is not set
1451CONFIG_CRYPTO_PCBC=m
1452# CONFIG_CRYPTO_XTS is not set
1453
1454#
1455# Hash modes
1456#
1457# CONFIG_CRYPTO_HMAC is not set
1458# CONFIG_CRYPTO_XCBC is not set
1459
1460#
1461# Digest
1462#
1463CONFIG_CRYPTO_CRC32C=y
1464# CONFIG_CRYPTO_MD4 is not set
1465CONFIG_CRYPTO_MD5=y
1466# CONFIG_CRYPTO_MICHAEL_MIC is not set
1467# CONFIG_CRYPTO_RMD128 is not set
1468# CONFIG_CRYPTO_RMD160 is not set
1469# CONFIG_CRYPTO_RMD256 is not set
1470# CONFIG_CRYPTO_RMD320 is not set
1471# CONFIG_CRYPTO_SHA1 is not set
1472# CONFIG_CRYPTO_SHA256 is not set
1473# CONFIG_CRYPTO_SHA512 is not set
1474# CONFIG_CRYPTO_TGR192 is not set
1475# CONFIG_CRYPTO_WP512 is not set
1476
1477#
1478# Ciphers
1479#
1480# CONFIG_CRYPTO_AES is not set
1481# CONFIG_CRYPTO_ANUBIS is not set
1482# CONFIG_CRYPTO_ARC4 is not set
1483# CONFIG_CRYPTO_BLOWFISH is not set
1484# CONFIG_CRYPTO_CAMELLIA is not set
1485# CONFIG_CRYPTO_CAST5 is not set
1486# CONFIG_CRYPTO_CAST6 is not set
1487CONFIG_CRYPTO_DES=y
1488# CONFIG_CRYPTO_FCRYPT is not set
1489# CONFIG_CRYPTO_KHAZAD is not set
1490# CONFIG_CRYPTO_SALSA20 is not set
1491# CONFIG_CRYPTO_SEED is not set
1492# CONFIG_CRYPTO_SERPENT is not set
1493# CONFIG_CRYPTO_TEA is not set
1494# CONFIG_CRYPTO_TWOFISH is not set
1495
1496#
1497# Compression
1498#
1499# CONFIG_CRYPTO_DEFLATE is not set
1500# CONFIG_CRYPTO_ZLIB is not set
1501# CONFIG_CRYPTO_LZO is not set
1502
1503#
1504# Random Number Generation
1505#
1506# CONFIG_CRYPTO_ANSI_CPRNG is not set
1507CONFIG_CRYPTO_HW=y
1508# CONFIG_BINARY_PRINTF is not set
1509
1510#
1511# Library routines
1512#
1513CONFIG_BITREVERSE=y
1514CONFIG_GENERIC_FIND_LAST_BIT=y
1515CONFIG_CRC_CCITT=y
1516# CONFIG_CRC16 is not set
1517# CONFIG_CRC_T10DIF is not set
1518# CONFIG_CRC_ITU_T is not set
1519CONFIG_CRC32=y
1520# CONFIG_CRC7 is not set
1521CONFIG_LIBCRC32C=y
1522CONFIG_ZLIB_INFLATE=y
1523CONFIG_ZLIB_DEFLATE=y
1524CONFIG_DECOMPRESS_GZIP=y
1525CONFIG_HAS_IOMEM=y
1526CONFIG_HAS_IOPORT=y
1527CONFIG_HAS_DMA=y
1528CONFIG_NLATTR=y
diff --git a/arch/arm/configs/omap_4430sdp_defconfig b/arch/arm/configs/omap_4430sdp_defconfig
new file mode 100644
index 000000000000..23e43ea4efa1
--- /dev/null
+++ b/arch/arm/configs/omap_4430sdp_defconfig
@@ -0,0 +1,866 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc7
4# Tue Jun 9 12:36:23 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12CONFIG_GENERIC_HARDIRQS=y
13CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_LOCK_KERNEL=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y
34CONFIG_SYSVIPC=y
35CONFIG_SYSVIPC_SYSCTL=y
36CONFIG_BSD_PROCESS_ACCT=y
37# CONFIG_BSD_PROCESS_ACCT_V3 is not set
38
39#
40# RCU Subsystem
41#
42CONFIG_CLASSIC_RCU=y
43# CONFIG_TREE_RCU is not set
44# CONFIG_PREEMPT_RCU is not set
45# CONFIG_TREE_RCU_TRACE is not set
46# CONFIG_PREEMPT_RCU_TRACE is not set
47# CONFIG_IKCONFIG is not set
48CONFIG_LOG_BUF_SHIFT=14
49CONFIG_GROUP_SCHED=y
50CONFIG_FAIR_GROUP_SCHED=y
51# CONFIG_RT_GROUP_SCHED is not set
52CONFIG_USER_SCHED=y
53# CONFIG_CGROUP_SCHED is not set
54# CONFIG_CGROUPS is not set
55CONFIG_SYSFS_DEPRECATED=y
56CONFIG_SYSFS_DEPRECATED_V2=y
57# CONFIG_RELAY is not set
58# CONFIG_NAMESPACES is not set
59CONFIG_BLK_DEV_INITRD=y
60CONFIG_INITRAMFS_SOURCE=""
61CONFIG_RD_GZIP=y
62# CONFIG_RD_BZIP2 is not set
63# CONFIG_RD_LZMA is not set
64CONFIG_CC_OPTIMIZE_FOR_SIZE=y
65CONFIG_SYSCTL=y
66CONFIG_ANON_INODES=y
67CONFIG_EMBEDDED=y
68CONFIG_UID16=y
69# CONFIG_SYSCTL_SYSCALL is not set
70CONFIG_KALLSYMS=y
71# CONFIG_KALLSYMS_ALL is not set
72# CONFIG_KALLSYMS_EXTRA_PASS is not set
73# CONFIG_STRIP_ASM_SYMS is not set
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77# CONFIG_ELF_CORE is not set
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86CONFIG_VM_EVENT_COUNTERS=y
87CONFIG_SLUB_DEBUG=y
88CONFIG_COMPAT_BRK=y
89# CONFIG_SLAB is not set
90CONFIG_SLUB=y
91# CONFIG_SLOB is not set
92# CONFIG_PROFILING is not set
93# CONFIG_MARKERS is not set
94CONFIG_HAVE_OPROFILE=y
95# CONFIG_KPROBES is not set
96CONFIG_HAVE_KPROBES=y
97CONFIG_HAVE_KRETPROBES=y
98CONFIG_USE_GENERIC_SMP_HELPERS=y
99CONFIG_HAVE_CLK=y
100# CONFIG_SLOW_WORK is not set
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y
103CONFIG_RT_MUTEXES=y
104CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y
106# CONFIG_MODULE_FORCE_LOAD is not set
107CONFIG_MODULE_UNLOAD=y
108# CONFIG_MODULE_FORCE_UNLOAD is not set
109CONFIG_MODVERSIONS=y
110CONFIG_MODULE_SRCVERSION_ALL=y
111CONFIG_STOP_MACHINE=y
112CONFIG_BLOCK=y
113# CONFIG_LBD is not set
114# CONFIG_BLK_DEV_BSG is not set
115# CONFIG_BLK_DEV_INTEGRITY is not set
116
117#
118# IO Schedulers
119#
120CONFIG_IOSCHED_NOOP=y
121CONFIG_IOSCHED_AS=y
122CONFIG_IOSCHED_DEADLINE=y
123CONFIG_IOSCHED_CFQ=y
124CONFIG_DEFAULT_AS=y
125# CONFIG_DEFAULT_DEADLINE is not set
126# CONFIG_DEFAULT_CFQ is not set
127# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="anticipatory"
129# CONFIG_FREEZER is not set
130
131#
132# System Type
133#
134# CONFIG_ARCH_AAEC2000 is not set
135# CONFIG_ARCH_INTEGRATOR is not set
136# CONFIG_ARCH_REALVIEW is not set
137# CONFIG_ARCH_VERSATILE is not set
138# CONFIG_ARCH_AT91 is not set
139# CONFIG_ARCH_CLPS711X is not set
140# CONFIG_ARCH_GEMINI is not set
141# CONFIG_ARCH_EBSA110 is not set
142# CONFIG_ARCH_EP93XX is not set
143# CONFIG_ARCH_FOOTBRIDGE is not set
144# CONFIG_ARCH_MXC is not set
145# CONFIG_ARCH_NETX is not set
146# CONFIG_ARCH_H720X is not set
147# CONFIG_ARCH_IOP13XX is not set
148# CONFIG_ARCH_IOP32X is not set
149# CONFIG_ARCH_IOP33X is not set
150# CONFIG_ARCH_IXP23XX is not set
151# CONFIG_ARCH_IXP2000 is not set
152# CONFIG_ARCH_IXP4XX is not set
153# CONFIG_ARCH_L7200 is not set
154# CONFIG_ARCH_KIRKWOOD is not set
155# CONFIG_ARCH_LOKI is not set
156# CONFIG_ARCH_MV78XX0 is not set
157# CONFIG_ARCH_ORION5X is not set
158# CONFIG_ARCH_MMP is not set
159# CONFIG_ARCH_KS8695 is not set
160# CONFIG_ARCH_NS9XXX is not set
161# CONFIG_ARCH_W90X900 is not set
162# CONFIG_ARCH_PNX4008 is not set
163# CONFIG_ARCH_PXA is not set
164# CONFIG_ARCH_MSM is not set
165# CONFIG_ARCH_RPC is not set
166# CONFIG_ARCH_SA1100 is not set
167# CONFIG_ARCH_S3C2410 is not set
168# CONFIG_ARCH_S3C64XX is not set
169# CONFIG_ARCH_SHARK is not set
170# CONFIG_ARCH_LH7A40X is not set
171# CONFIG_ARCH_DAVINCI is not set
172CONFIG_ARCH_OMAP=y
173
174#
175# TI OMAP Implementations
176#
177# CONFIG_ARCH_OMAP1 is not set
178# CONFIG_ARCH_OMAP2 is not set
179# CONFIG_ARCH_OMAP3 is not set
180CONFIG_ARCH_OMAP4=y
181
182#
183# OMAP Feature Selections
184#
185# CONFIG_OMAP_RESET_CLOCKS is not set
186# CONFIG_OMAP_MUX is not set
187# CONFIG_OMAP_MCBSP is not set
188# CONFIG_OMAP_MBOX_FWK is not set
189# CONFIG_OMAP_MPU_TIMER is not set
190CONFIG_OMAP_32K_TIMER=y
191CONFIG_OMAP_32K_TIMER_HZ=128
192CONFIG_OMAP_DM_TIMER=y
193CONFIG_OMAP_LL_DEBUG_UART1=y
194# CONFIG_OMAP_LL_DEBUG_UART2 is not set
195# CONFIG_OMAP_LL_DEBUG_UART3 is not set
196
197#
198# OMAP Board Type
199#
200CONFIG_MACH_OMAP_4430SDP=y
201
202#
203# Processor Type
204#
205CONFIG_CPU_32=y
206CONFIG_CPU_32v6K=y
207CONFIG_CPU_V7=y
208CONFIG_CPU_32v7=y
209CONFIG_CPU_ABRT_EV7=y
210CONFIG_CPU_PABRT_IFAR=y
211CONFIG_CPU_CACHE_V7=y
212CONFIG_CPU_CACHE_VIPT=y
213CONFIG_CPU_COPY_V6=y
214CONFIG_CPU_TLB_V7=y
215CONFIG_CPU_HAS_ASID=y
216CONFIG_CPU_CP15=y
217CONFIG_CPU_CP15_MMU=y
218
219#
220# Processor Features
221#
222# CONFIG_ARM_THUMB is not set
223# CONFIG_ARM_THUMBEE is not set
224# CONFIG_CPU_ICACHE_DISABLE is not set
225CONFIG_CPU_DCACHE_DISABLE=y
226# CONFIG_CPU_BPREDICT_DISABLE is not set
227CONFIG_HAS_TLS_REG=y
228# CONFIG_ARM_ERRATA_430973 is not set
229# CONFIG_ARM_ERRATA_458693 is not set
230# CONFIG_ARM_ERRATA_460075 is not set
231CONFIG_ARM_GIC=y
232
233#
234# Bus support
235#
236# CONFIG_PCI_SYSCALL is not set
237# CONFIG_ARCH_SUPPORTS_MSI is not set
238# CONFIG_PCCARD is not set
239
240#
241# Kernel Features
242#
243# CONFIG_NO_HZ is not set
244# CONFIG_HIGH_RES_TIMERS is not set
245CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
246CONFIG_SMP=y
247CONFIG_HAVE_ARM_SCU=y
248CONFIG_HAVE_ARM_TWD=y
249CONFIG_VMSPLIT_3G=y
250# CONFIG_VMSPLIT_2G is not set
251# CONFIG_VMSPLIT_1G is not set
252CONFIG_PAGE_OFFSET=0xC0000000
253CONFIG_NR_CPUS=2
254# CONFIG_HOTPLUG_CPU is not set
255CONFIG_LOCAL_TIMERS=y
256# CONFIG_PREEMPT is not set
257CONFIG_HZ=128
258CONFIG_AEABI=y
259# CONFIG_OABI_COMPAT is not set
260# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
261# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
262# CONFIG_HIGHMEM is not set
263CONFIG_SELECT_MEMORY_MODEL=y
264CONFIG_FLATMEM_MANUAL=y
265# CONFIG_DISCONTIGMEM_MANUAL is not set
266# CONFIG_SPARSEMEM_MANUAL is not set
267CONFIG_FLATMEM=y
268CONFIG_FLAT_NODE_MEM_MAP=y
269CONFIG_PAGEFLAGS_EXTENDED=y
270CONFIG_SPLIT_PTLOCK_CPUS=4
271# CONFIG_PHYS_ADDR_T_64BIT is not set
272CONFIG_ZONE_DMA_FLAG=0
273CONFIG_VIRT_TO_BUS=y
274# CONFIG_UNEVICTABLE_LRU is not set
275CONFIG_HAVE_MLOCK=y
276# CONFIG_LEDS is not set
277CONFIG_ALIGNMENT_TRAP=y
278
279#
280# Boot options
281#
282CONFIG_ZBOOT_ROM_TEXT=0x0
283CONFIG_ZBOOT_ROM_BSS=0x0
284CONFIG_CMDLINE="root=/dev/ram0 rw mem=128M console=ttyS0,115200n8 initrd=0x81600000,20M ramdisk_size=20480"
285# CONFIG_XIP_KERNEL is not set
286# CONFIG_KEXEC is not set
287
288#
289# CPU Power Management
290#
291# CONFIG_CPU_FREQ is not set
292# CONFIG_CPU_IDLE is not set
293
294#
295# Floating point emulation
296#
297
298#
299# At least one emulation must be selected
300#
301CONFIG_VFP=y
302CONFIG_VFPv3=y
303# CONFIG_NEON is not set
304
305#
306# Userspace binary formats
307#
308CONFIG_BINFMT_ELF=y
309CONFIG_HAVE_AOUT=y
310# CONFIG_BINFMT_AOUT is not set
311CONFIG_BINFMT_MISC=y
312
313#
314# Power management options
315#
316# CONFIG_PM is not set
317CONFIG_ARCH_SUSPEND_POSSIBLE=y
318# CONFIG_NET is not set
319
320#
321# Device Drivers
322#
323
324#
325# Generic Driver Options
326#
327CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
328CONFIG_STANDALONE=y
329CONFIG_PREVENT_FIRMWARE_BUILD=y
330# CONFIG_FW_LOADER is not set
331# CONFIG_DEBUG_DRIVER is not set
332# CONFIG_DEBUG_DEVRES is not set
333# CONFIG_SYS_HYPERVISOR is not set
334# CONFIG_MTD is not set
335# CONFIG_PARPORT is not set
336CONFIG_BLK_DEV=y
337# CONFIG_BLK_DEV_COW_COMMON is not set
338CONFIG_BLK_DEV_LOOP=y
339# CONFIG_BLK_DEV_CRYPTOLOOP is not set
340CONFIG_BLK_DEV_RAM=y
341CONFIG_BLK_DEV_RAM_COUNT=16
342CONFIG_BLK_DEV_RAM_SIZE=16384
343# CONFIG_BLK_DEV_XIP is not set
344# CONFIG_CDROM_PKTCDVD is not set
345# CONFIG_MISC_DEVICES is not set
346CONFIG_HAVE_IDE=y
347# CONFIG_IDE is not set
348
349#
350# SCSI device support
351#
352# CONFIG_RAID_ATTRS is not set
353# CONFIG_SCSI is not set
354# CONFIG_SCSI_DMA is not set
355# CONFIG_SCSI_NETLINK is not set
356# CONFIG_ATA is not set
357# CONFIG_MD is not set
358
359#
360# Input device support
361#
362CONFIG_INPUT=y
363# CONFIG_INPUT_FF_MEMLESS is not set
364# CONFIG_INPUT_POLLDEV is not set
365
366#
367# Userland interfaces
368#
369# CONFIG_INPUT_MOUSEDEV is not set
370# CONFIG_INPUT_JOYDEV is not set
371CONFIG_INPUT_EVDEV=y
372# CONFIG_INPUT_EVBUG is not set
373
374#
375# Input Device Drivers
376#
377# CONFIG_INPUT_KEYBOARD is not set
378# CONFIG_INPUT_MOUSE is not set
379# CONFIG_INPUT_JOYSTICK is not set
380# CONFIG_INPUT_TABLET is not set
381# CONFIG_INPUT_TOUCHSCREEN is not set
382# CONFIG_INPUT_MISC is not set
383
384#
385# Hardware I/O ports
386#
387# CONFIG_SERIO is not set
388# CONFIG_GAMEPORT is not set
389
390#
391# Character devices
392#
393CONFIG_VT=y
394CONFIG_CONSOLE_TRANSLATIONS=y
395CONFIG_VT_CONSOLE=y
396CONFIG_HW_CONSOLE=y
397# CONFIG_VT_HW_CONSOLE_BINDING is not set
398CONFIG_DEVKMEM=y
399# CONFIG_SERIAL_NONSTANDARD is not set
400
401#
402# Serial drivers
403#
404CONFIG_SERIAL_8250=y
405CONFIG_SERIAL_8250_CONSOLE=y
406CONFIG_SERIAL_8250_NR_UARTS=32
407CONFIG_SERIAL_8250_RUNTIME_UARTS=4
408CONFIG_SERIAL_8250_EXTENDED=y
409CONFIG_SERIAL_8250_MANY_PORTS=y
410CONFIG_SERIAL_8250_SHARE_IRQ=y
411CONFIG_SERIAL_8250_DETECT_IRQ=y
412CONFIG_SERIAL_8250_RSA=y
413
414#
415# Non-8250 serial port support
416#
417CONFIG_SERIAL_CORE=y
418CONFIG_SERIAL_CORE_CONSOLE=y
419CONFIG_UNIX98_PTYS=y
420# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
421# CONFIG_LEGACY_PTYS is not set
422# CONFIG_IPMI_HANDLER is not set
423CONFIG_HW_RANDOM=y
424# CONFIG_HW_RANDOM_TIMERIOMEM is not set
425# CONFIG_R3964 is not set
426# CONFIG_RAW_DRIVER is not set
427# CONFIG_TCG_TPM is not set
428# CONFIG_I2C is not set
429# CONFIG_SPI is not set
430CONFIG_ARCH_REQUIRE_GPIOLIB=y
431CONFIG_GPIOLIB=y
432# CONFIG_DEBUG_GPIO is not set
433# CONFIG_GPIO_SYSFS is not set
434
435#
436# Memory mapped GPIO expanders:
437#
438
439#
440# I2C GPIO expanders:
441#
442
443#
444# PCI GPIO expanders:
445#
446
447#
448# SPI GPIO expanders:
449#
450# CONFIG_W1 is not set
451# CONFIG_POWER_SUPPLY is not set
452# CONFIG_HWMON is not set
453# CONFIG_THERMAL is not set
454# CONFIG_THERMAL_HWMON is not set
455# CONFIG_WATCHDOG is not set
456CONFIG_SSB_POSSIBLE=y
457
458#
459# Sonics Silicon Backplane
460#
461# CONFIG_SSB is not set
462
463#
464# Multifunction device drivers
465#
466# CONFIG_MFD_CORE is not set
467# CONFIG_MFD_SM501 is not set
468# CONFIG_MFD_ASIC3 is not set
469# CONFIG_HTC_EGPIO is not set
470# CONFIG_HTC_PASIC3 is not set
471# CONFIG_MFD_TMIO is not set
472# CONFIG_MFD_T7L66XB is not set
473# CONFIG_MFD_TC6387XB is not set
474# CONFIG_MFD_TC6393XB is not set
475
476#
477# Multimedia devices
478#
479
480#
481# Multimedia core support
482#
483# CONFIG_VIDEO_DEV is not set
484# CONFIG_VIDEO_MEDIA is not set
485
486#
487# Multimedia drivers
488#
489CONFIG_DAB=y
490
491#
492# Graphics support
493#
494# CONFIG_VGASTATE is not set
495# CONFIG_VIDEO_OUTPUT_CONTROL is not set
496# CONFIG_FB is not set
497# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
498
499#
500# Display device support
501#
502# CONFIG_DISPLAY_SUPPORT is not set
503
504#
505# Console display driver support
506#
507# CONFIG_VGA_CONSOLE is not set
508CONFIG_DUMMY_CONSOLE=y
509# CONFIG_SOUND is not set
510# CONFIG_HID_SUPPORT is not set
511# CONFIG_USB_SUPPORT is not set
512# CONFIG_MMC is not set
513# CONFIG_MEMSTICK is not set
514# CONFIG_ACCESSIBILITY is not set
515# CONFIG_NEW_LEDS is not set
516CONFIG_RTC_LIB=y
517# CONFIG_RTC_CLASS is not set
518# CONFIG_DMADEVICES is not set
519# CONFIG_AUXDISPLAY is not set
520# CONFIG_REGULATOR is not set
521# CONFIG_UIO is not set
522# CONFIG_STAGING is not set
523
524#
525# File systems
526#
527CONFIG_EXT2_FS=y
528# CONFIG_EXT2_FS_XATTR is not set
529# CONFIG_EXT2_FS_XIP is not set
530CONFIG_EXT3_FS=y
531# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
532# CONFIG_EXT3_FS_XATTR is not set
533# CONFIG_EXT4_FS is not set
534CONFIG_JBD=y
535# CONFIG_REISERFS_FS is not set
536# CONFIG_JFS_FS is not set
537# CONFIG_FS_POSIX_ACL is not set
538CONFIG_FILE_LOCKING=y
539# CONFIG_XFS_FS is not set
540# CONFIG_BTRFS_FS is not set
541CONFIG_DNOTIFY=y
542CONFIG_INOTIFY=y
543CONFIG_INOTIFY_USER=y
544CONFIG_QUOTA=y
545CONFIG_PRINT_QUOTA_WARNING=y
546CONFIG_QUOTA_TREE=y
547# CONFIG_QFMT_V1 is not set
548CONFIG_QFMT_V2=y
549CONFIG_QUOTACTL=y
550# CONFIG_AUTOFS_FS is not set
551# CONFIG_AUTOFS4_FS is not set
552# CONFIG_FUSE_FS is not set
553
554#
555# Caches
556#
557# CONFIG_FSCACHE is not set
558
559#
560# CD-ROM/DVD Filesystems
561#
562# CONFIG_ISO9660_FS is not set
563# CONFIG_UDF_FS is not set
564
565#
566# DOS/FAT/NT Filesystems
567#
568CONFIG_FAT_FS=y
569CONFIG_MSDOS_FS=y
570CONFIG_VFAT_FS=y
571CONFIG_FAT_DEFAULT_CODEPAGE=437
572CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
573# CONFIG_NTFS_FS is not set
574
575#
576# Pseudo filesystems
577#
578CONFIG_PROC_FS=y
579CONFIG_PROC_SYSCTL=y
580CONFIG_PROC_PAGE_MONITOR=y
581CONFIG_SYSFS=y
582CONFIG_TMPFS=y
583# CONFIG_TMPFS_POSIX_ACL is not set
584# CONFIG_HUGETLB_PAGE is not set
585# CONFIG_CONFIGFS_FS is not set
586CONFIG_MISC_FILESYSTEMS=y
587# CONFIG_ADFS_FS is not set
588# CONFIG_AFFS_FS is not set
589# CONFIG_HFS_FS is not set
590# CONFIG_HFSPLUS_FS is not set
591# CONFIG_BEFS_FS is not set
592# CONFIG_BFS_FS is not set
593# CONFIG_EFS_FS is not set
594# CONFIG_CRAMFS is not set
595# CONFIG_SQUASHFS is not set
596# CONFIG_VXFS_FS is not set
597# CONFIG_MINIX_FS is not set
598# CONFIG_OMFS_FS is not set
599# CONFIG_HPFS_FS is not set
600# CONFIG_QNX4FS_FS is not set
601# CONFIG_ROMFS_FS is not set
602# CONFIG_SYSV_FS is not set
603# CONFIG_UFS_FS is not set
604# CONFIG_NILFS2_FS is not set
605
606#
607# Partition Types
608#
609CONFIG_PARTITION_ADVANCED=y
610# CONFIG_ACORN_PARTITION is not set
611# CONFIG_OSF_PARTITION is not set
612# CONFIG_AMIGA_PARTITION is not set
613# CONFIG_ATARI_PARTITION is not set
614# CONFIG_MAC_PARTITION is not set
615CONFIG_MSDOS_PARTITION=y
616# CONFIG_BSD_DISKLABEL is not set
617# CONFIG_MINIX_SUBPARTITION is not set
618# CONFIG_SOLARIS_X86_PARTITION is not set
619# CONFIG_UNIXWARE_DISKLABEL is not set
620# CONFIG_LDM_PARTITION is not set
621# CONFIG_SGI_PARTITION is not set
622# CONFIG_ULTRIX_PARTITION is not set
623# CONFIG_SUN_PARTITION is not set
624# CONFIG_KARMA_PARTITION is not set
625# CONFIG_EFI_PARTITION is not set
626# CONFIG_SYSV68_PARTITION is not set
627CONFIG_NLS=y
628CONFIG_NLS_DEFAULT="iso8859-1"
629CONFIG_NLS_CODEPAGE_437=y
630# CONFIG_NLS_CODEPAGE_737 is not set
631# CONFIG_NLS_CODEPAGE_775 is not set
632# CONFIG_NLS_CODEPAGE_850 is not set
633# CONFIG_NLS_CODEPAGE_852 is not set
634# CONFIG_NLS_CODEPAGE_855 is not set
635# CONFIG_NLS_CODEPAGE_857 is not set
636# CONFIG_NLS_CODEPAGE_860 is not set
637# CONFIG_NLS_CODEPAGE_861 is not set
638# CONFIG_NLS_CODEPAGE_862 is not set
639# CONFIG_NLS_CODEPAGE_863 is not set
640# CONFIG_NLS_CODEPAGE_864 is not set
641# CONFIG_NLS_CODEPAGE_865 is not set
642# CONFIG_NLS_CODEPAGE_866 is not set
643# CONFIG_NLS_CODEPAGE_869 is not set
644# CONFIG_NLS_CODEPAGE_936 is not set
645# CONFIG_NLS_CODEPAGE_950 is not set
646# CONFIG_NLS_CODEPAGE_932 is not set
647# CONFIG_NLS_CODEPAGE_949 is not set
648# CONFIG_NLS_CODEPAGE_874 is not set
649# CONFIG_NLS_ISO8859_8 is not set
650# CONFIG_NLS_CODEPAGE_1250 is not set
651# CONFIG_NLS_CODEPAGE_1251 is not set
652# CONFIG_NLS_ASCII is not set
653CONFIG_NLS_ISO8859_1=y
654# CONFIG_NLS_ISO8859_2 is not set
655# CONFIG_NLS_ISO8859_3 is not set
656# CONFIG_NLS_ISO8859_4 is not set
657# CONFIG_NLS_ISO8859_5 is not set
658# CONFIG_NLS_ISO8859_6 is not set
659# CONFIG_NLS_ISO8859_7 is not set
660# CONFIG_NLS_ISO8859_9 is not set
661# CONFIG_NLS_ISO8859_13 is not set
662# CONFIG_NLS_ISO8859_14 is not set
663# CONFIG_NLS_ISO8859_15 is not set
664# CONFIG_NLS_KOI8_R is not set
665# CONFIG_NLS_KOI8_U is not set
666# CONFIG_NLS_UTF8 is not set
667
668#
669# Kernel hacking
670#
671# CONFIG_PRINTK_TIME is not set
672# CONFIG_ENABLE_WARN_DEPRECATED is not set
673# CONFIG_ENABLE_MUST_CHECK is not set
674CONFIG_FRAME_WARN=1024
675CONFIG_MAGIC_SYSRQ=y
676# CONFIG_UNUSED_SYMBOLS is not set
677# CONFIG_DEBUG_FS is not set
678# CONFIG_HEADERS_CHECK is not set
679CONFIG_DEBUG_KERNEL=y
680# CONFIG_DEBUG_SHIRQ is not set
681CONFIG_DETECT_SOFTLOCKUP=y
682# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
683CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
684CONFIG_DETECT_HUNG_TASK=y
685# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
686CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
687CONFIG_SCHED_DEBUG=y
688# CONFIG_SCHEDSTATS is not set
689# CONFIG_TIMER_STATS is not set
690# CONFIG_DEBUG_OBJECTS is not set
691# CONFIG_SLUB_DEBUG_ON is not set
692# CONFIG_SLUB_STATS is not set
693# CONFIG_DEBUG_RT_MUTEXES is not set
694# CONFIG_RT_MUTEX_TESTER is not set
695# CONFIG_DEBUG_SPINLOCK is not set
696# CONFIG_DEBUG_MUTEXES is not set
697# CONFIG_DEBUG_LOCK_ALLOC is not set
698# CONFIG_PROVE_LOCKING is not set
699# CONFIG_LOCK_STAT is not set
700# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
701# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
702# CONFIG_DEBUG_KOBJECT is not set
703# CONFIG_DEBUG_BUGVERBOSE is not set
704CONFIG_DEBUG_INFO=y
705# CONFIG_DEBUG_VM is not set
706# CONFIG_DEBUG_WRITECOUNT is not set
707# CONFIG_DEBUG_MEMORY_INIT is not set
708# CONFIG_DEBUG_LIST is not set
709# CONFIG_DEBUG_SG is not set
710# CONFIG_DEBUG_NOTIFIERS is not set
711CONFIG_FRAME_POINTER=y
712# CONFIG_BOOT_PRINTK_DELAY is not set
713# CONFIG_RCU_TORTURE_TEST is not set
714# CONFIG_RCU_CPU_STALL_DETECTOR is not set
715# CONFIG_BACKTRACE_SELF_TEST is not set
716# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
717# CONFIG_FAULT_INJECTION is not set
718# CONFIG_PAGE_POISONING is not set
719CONFIG_HAVE_FUNCTION_TRACER=y
720CONFIG_TRACING_SUPPORT=y
721
722#
723# Tracers
724#
725# CONFIG_FUNCTION_TRACER is not set
726# CONFIG_IRQSOFF_TRACER is not set
727# CONFIG_SCHED_TRACER is not set
728# CONFIG_CONTEXT_SWITCH_TRACER is not set
729# CONFIG_EVENT_TRACER is not set
730# CONFIG_BOOT_TRACER is not set
731# CONFIG_TRACE_BRANCH_PROFILING is not set
732# CONFIG_STACK_TRACER is not set
733# CONFIG_KMEMTRACE is not set
734# CONFIG_WORKQUEUE_TRACER is not set
735# CONFIG_BLK_DEV_IO_TRACE is not set
736# CONFIG_SAMPLES is not set
737CONFIG_HAVE_ARCH_KGDB=y
738# CONFIG_KGDB is not set
739# CONFIG_ARM_UNWIND is not set
740# CONFIG_DEBUG_USER is not set
741# CONFIG_DEBUG_ERRORS is not set
742# CONFIG_DEBUG_STACK_USAGE is not set
743# CONFIG_DEBUG_LL is not set
744
745#
746# Security options
747#
748# CONFIG_KEYS is not set
749# CONFIG_SECURITY is not set
750# CONFIG_SECURITYFS is not set
751# CONFIG_SECURITY_FILE_CAPABILITIES is not set
752CONFIG_CRYPTO=y
753
754#
755# Crypto core or helper
756#
757# CONFIG_CRYPTO_FIPS is not set
758CONFIG_CRYPTO_ALGAPI=y
759CONFIG_CRYPTO_ALGAPI2=y
760CONFIG_CRYPTO_AEAD2=y
761CONFIG_CRYPTO_BLKCIPHER=y
762CONFIG_CRYPTO_BLKCIPHER2=y
763CONFIG_CRYPTO_HASH=y
764CONFIG_CRYPTO_HASH2=y
765CONFIG_CRYPTO_RNG2=y
766CONFIG_CRYPTO_PCOMP=y
767CONFIG_CRYPTO_MANAGER=y
768CONFIG_CRYPTO_MANAGER2=y
769# CONFIG_CRYPTO_GF128MUL is not set
770# CONFIG_CRYPTO_NULL is not set
771CONFIG_CRYPTO_WORKQUEUE=y
772# CONFIG_CRYPTO_CRYPTD is not set
773# CONFIG_CRYPTO_AUTHENC is not set
774# CONFIG_CRYPTO_TEST is not set
775
776#
777# Authenticated Encryption with Associated Data
778#
779# CONFIG_CRYPTO_CCM is not set
780# CONFIG_CRYPTO_GCM is not set
781# CONFIG_CRYPTO_SEQIV is not set
782
783#
784# Block modes
785#
786CONFIG_CRYPTO_CBC=y
787# CONFIG_CRYPTO_CTR is not set
788# CONFIG_CRYPTO_CTS is not set
789CONFIG_CRYPTO_ECB=m
790# CONFIG_CRYPTO_LRW is not set
791CONFIG_CRYPTO_PCBC=m
792# CONFIG_CRYPTO_XTS is not set
793
794#
795# Hash modes
796#
797# CONFIG_CRYPTO_HMAC is not set
798# CONFIG_CRYPTO_XCBC is not set
799
800#
801# Digest
802#
803CONFIG_CRYPTO_CRC32C=y
804# CONFIG_CRYPTO_MD4 is not set
805CONFIG_CRYPTO_MD5=y
806# CONFIG_CRYPTO_MICHAEL_MIC is not set
807# CONFIG_CRYPTO_RMD128 is not set
808# CONFIG_CRYPTO_RMD160 is not set
809# CONFIG_CRYPTO_RMD256 is not set
810# CONFIG_CRYPTO_RMD320 is not set
811# CONFIG_CRYPTO_SHA1 is not set
812# CONFIG_CRYPTO_SHA256 is not set
813# CONFIG_CRYPTO_SHA512 is not set
814# CONFIG_CRYPTO_TGR192 is not set
815# CONFIG_CRYPTO_WP512 is not set
816
817#
818# Ciphers
819#
820# CONFIG_CRYPTO_AES is not set
821# CONFIG_CRYPTO_ANUBIS is not set
822# CONFIG_CRYPTO_ARC4 is not set
823# CONFIG_CRYPTO_BLOWFISH is not set
824# CONFIG_CRYPTO_CAMELLIA is not set
825# CONFIG_CRYPTO_CAST5 is not set
826# CONFIG_CRYPTO_CAST6 is not set
827CONFIG_CRYPTO_DES=y
828# CONFIG_CRYPTO_FCRYPT is not set
829# CONFIG_CRYPTO_KHAZAD is not set
830# CONFIG_CRYPTO_SALSA20 is not set
831# CONFIG_CRYPTO_SEED is not set
832# CONFIG_CRYPTO_SERPENT is not set
833# CONFIG_CRYPTO_TEA is not set
834# CONFIG_CRYPTO_TWOFISH is not set
835
836#
837# Compression
838#
839# CONFIG_CRYPTO_DEFLATE is not set
840# CONFIG_CRYPTO_ZLIB is not set
841# CONFIG_CRYPTO_LZO is not set
842
843#
844# Random Number Generation
845#
846# CONFIG_CRYPTO_ANSI_CPRNG is not set
847CONFIG_CRYPTO_HW=y
848# CONFIG_BINARY_PRINTF is not set
849
850#
851# Library routines
852#
853CONFIG_BITREVERSE=y
854CONFIG_GENERIC_FIND_LAST_BIT=y
855CONFIG_CRC_CCITT=y
856# CONFIG_CRC16 is not set
857CONFIG_CRC_T10DIF=y
858# CONFIG_CRC_ITU_T is not set
859CONFIG_CRC32=y
860# CONFIG_CRC7 is not set
861CONFIG_LIBCRC32C=y
862CONFIG_ZLIB_INFLATE=y
863CONFIG_DECOMPRESS_GZIP=y
864CONFIG_HAS_IOMEM=y
865CONFIG_HAS_IOPORT=y
866CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/omap_zoom2_defconfig b/arch/arm/configs/omap_zoom2_defconfig
new file mode 100644
index 000000000000..213fe9c5eaae
--- /dev/null
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -0,0 +1,1211 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27-rc5
4# Fri Oct 10 11:49:41 2008
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
30
31#
32# General setup
33#
34CONFIG_EXPERIMENTAL=y
35CONFIG_BROKEN_ON_SMP=y
36CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION=""
38CONFIG_LOCALVERSION_AUTO=y
39CONFIG_SWAP=y
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_BSD_PROCESS_ACCT=y
43# CONFIG_BSD_PROCESS_ACCT_V3 is not set
44# CONFIG_IKCONFIG is not set
45CONFIG_LOG_BUF_SHIFT=14
46# CONFIG_CGROUPS is not set
47CONFIG_GROUP_SCHED=y
48CONFIG_FAIR_GROUP_SCHED=y
49# CONFIG_RT_GROUP_SCHED is not set
50CONFIG_USER_SCHED=y
51# CONFIG_CGROUP_SCHED is not set
52CONFIG_SYSFS_DEPRECATED=y
53CONFIG_SYSFS_DEPRECATED_V2=y
54# CONFIG_RELAY is not set
55# CONFIG_NAMESPACES is not set
56CONFIG_BLK_DEV_INITRD=y
57CONFIG_INITRAMFS_SOURCE=""
58CONFIG_CC_OPTIMIZE_FOR_SIZE=y
59CONFIG_SYSCTL=y
60CONFIG_EMBEDDED=y
61CONFIG_UID16=y
62# CONFIG_SYSCTL_SYSCALL is not set
63CONFIG_KALLSYMS=y
64# CONFIG_KALLSYMS_ALL is not set
65CONFIG_KALLSYMS_EXTRA_PASS=y
66CONFIG_HOTPLUG=y
67CONFIG_PRINTK=y
68CONFIG_BUG=y
69CONFIG_ELF_CORE=y
70CONFIG_COMPAT_BRK=y
71CONFIG_BASE_FULL=y
72CONFIG_FUTEX=y
73CONFIG_ANON_INODES=y
74CONFIG_EPOLL=y
75CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y
78CONFIG_SHMEM=y
79CONFIG_VM_EVENT_COUNTERS=y
80CONFIG_SLAB=y
81# CONFIG_SLUB is not set
82# CONFIG_SLOB is not set
83# CONFIG_PROFILING is not set
84# CONFIG_MARKERS is not set
85CONFIG_HAVE_OPROFILE=y
86# CONFIG_KPROBES is not set
87# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
88# CONFIG_HAVE_IOREMAP_PROT is not set
89CONFIG_HAVE_KPROBES=y
90CONFIG_HAVE_KRETPROBES=y
91# CONFIG_HAVE_ARCH_TRACEHOOK is not set
92# CONFIG_HAVE_DMA_ATTRS is not set
93# CONFIG_USE_GENERIC_SMP_HELPERS is not set
94CONFIG_HAVE_CLK=y
95CONFIG_PROC_PAGE_MONITOR=y
96CONFIG_HAVE_GENERIC_DMA_COHERENT=y
97CONFIG_SLABINFO=y
98CONFIG_RT_MUTEXES=y
99# CONFIG_TINY_SHMEM is not set
100CONFIG_BASE_SMALL=0
101CONFIG_MODULES=y
102# CONFIG_MODULE_FORCE_LOAD is not set
103CONFIG_MODULE_UNLOAD=y
104# CONFIG_MODULE_FORCE_UNLOAD is not set
105CONFIG_MODVERSIONS=y
106CONFIG_MODULE_SRCVERSION_ALL=y
107CONFIG_KMOD=y
108CONFIG_BLOCK=y
109# CONFIG_LBD is not set
110# CONFIG_BLK_DEV_IO_TRACE is not set
111# CONFIG_LSF is not set
112# CONFIG_BLK_DEV_BSG is not set
113# CONFIG_BLK_DEV_INTEGRITY is not set
114
115#
116# IO Schedulers
117#
118CONFIG_IOSCHED_NOOP=y
119CONFIG_IOSCHED_AS=y
120CONFIG_IOSCHED_DEADLINE=y
121CONFIG_IOSCHED_CFQ=y
122CONFIG_DEFAULT_AS=y
123# CONFIG_DEFAULT_DEADLINE is not set
124# CONFIG_DEFAULT_CFQ is not set
125# CONFIG_DEFAULT_NOOP is not set
126CONFIG_DEFAULT_IOSCHED="anticipatory"
127CONFIG_CLASSIC_RCU=y
128
129#
130# System Type
131#
132# CONFIG_ARCH_AAEC2000 is not set
133# CONFIG_ARCH_INTEGRATOR is not set
134# CONFIG_ARCH_REALVIEW is not set
135# CONFIG_ARCH_VERSATILE is not set
136# CONFIG_ARCH_AT91 is not set
137# CONFIG_ARCH_CLPS7500 is not set
138# CONFIG_ARCH_CLPS711X is not set
139# CONFIG_ARCH_EBSA110 is not set
140# CONFIG_ARCH_EP93XX is not set
141# CONFIG_ARCH_FOOTBRIDGE is not set
142# CONFIG_ARCH_NETX is not set
143# CONFIG_ARCH_H720X is not set
144# CONFIG_ARCH_IMX is not set
145# CONFIG_ARCH_IOP13XX is not set
146# CONFIG_ARCH_IOP32X is not set
147# CONFIG_ARCH_IOP33X is not set
148# CONFIG_ARCH_IXP23XX is not set
149# CONFIG_ARCH_IXP2000 is not set
150# CONFIG_ARCH_IXP4XX is not set
151# CONFIG_ARCH_L7200 is not set
152# CONFIG_ARCH_KIRKWOOD is not set
153# CONFIG_ARCH_KS8695 is not set
154# CONFIG_ARCH_NS9XXX is not set
155# CONFIG_ARCH_LOKI is not set
156# CONFIG_ARCH_MV78XX0 is not set
157# CONFIG_ARCH_MXC is not set
158# CONFIG_ARCH_ORION5X is not set
159# CONFIG_ARCH_PNX4008 is not set
160# CONFIG_ARCH_PXA is not set
161# CONFIG_ARCH_RPC is not set
162# CONFIG_ARCH_SA1100 is not set
163# CONFIG_ARCH_S3C2410 is not set
164# CONFIG_ARCH_SHARK is not set
165# CONFIG_ARCH_LH7A40X is not set
166# CONFIG_ARCH_DAVINCI is not set
167CONFIG_ARCH_OMAP=y
168# CONFIG_ARCH_MSM7X00A is not set
169
170#
171# TI OMAP Implementations
172#
173CONFIG_ARCH_OMAP_OTG=y
174# CONFIG_ARCH_OMAP1 is not set
175# CONFIG_ARCH_OMAP2 is not set
176CONFIG_ARCH_OMAP3=y
177
178#
179# OMAP Feature Selections
180#
181# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
182# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
183# CONFIG_OMAP_RESET_CLOCKS is not set
184CONFIG_OMAP_MUX=y
185CONFIG_OMAP_MUX_DEBUG=y
186CONFIG_OMAP_MUX_WARNINGS=y
187CONFIG_OMAP_MCBSP=y
188# CONFIG_OMAP_MPU_TIMER is not set
189CONFIG_OMAP_32K_TIMER=y
190CONFIG_OMAP_32K_TIMER_HZ=128
191CONFIG_OMAP_DM_TIMER=y
192# CONFIG_OMAP_LL_DEBUG_UART1 is not set
193# CONFIG_OMAP_LL_DEBUG_UART2 is not set
194CONFIG_OMAP_LL_DEBUG_UART3=y
195CONFIG_OMAP_SERIAL_WAKE=y
196CONFIG_ARCH_OMAP34XX=y
197CONFIG_ARCH_OMAP3430=y
198
199#
200# OMAP Board Type
201#
202# CONFIG_MACH_OMAP3_BEAGLE is not set
203# CONFIG_MACH_OMAP_LDP is not set
204CONFIG_MACH_OMAP_ZOOM2=y
205# CONFIG_MACH_OVERO is not set
206
207#
208# Boot options
209#
210
211#
212# Power management
213#
214
215#
216# Processor Type
217#
218CONFIG_CPU_32=y
219CONFIG_CPU_32v6K=y
220CONFIG_CPU_V7=y
221CONFIG_CPU_32v7=y
222CONFIG_CPU_ABRT_EV7=y
223CONFIG_CPU_PABRT_IFAR=y
224CONFIG_CPU_CACHE_V7=y
225CONFIG_CPU_CACHE_VIPT=y
226CONFIG_CPU_COPY_V6=y
227CONFIG_CPU_TLB_V7=y
228CONFIG_CPU_HAS_ASID=y
229CONFIG_CPU_CP15=y
230CONFIG_CPU_CP15_MMU=y
231
232#
233# Processor Features
234#
235CONFIG_ARM_THUMB=y
236# CONFIG_ARM_THUMBEE is not set
237# CONFIG_CPU_ICACHE_DISABLE is not set
238# CONFIG_CPU_DCACHE_DISABLE is not set
239# CONFIG_CPU_BPREDICT_DISABLE is not set
240CONFIG_HAS_TLS_REG=y
241# CONFIG_OUTER_CACHE is not set
242
243#
244# Bus support
245#
246# CONFIG_PCI_SYSCALL is not set
247# CONFIG_ARCH_SUPPORTS_MSI is not set
248# CONFIG_PCCARD is not set
249
250#
251# Kernel Features
252#
253CONFIG_TICK_ONESHOT=y
254CONFIG_NO_HZ=y
255CONFIG_HIGH_RES_TIMERS=y
256CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
257# CONFIG_PREEMPT is not set
258CONFIG_HZ=128
259CONFIG_AEABI=y
260CONFIG_OABI_COMPAT=y
261CONFIG_ARCH_FLATMEM_HAS_HOLES=y
262# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
263CONFIG_SELECT_MEMORY_MODEL=y
264CONFIG_FLATMEM_MANUAL=y
265# CONFIG_DISCONTIGMEM_MANUAL is not set
266# CONFIG_SPARSEMEM_MANUAL is not set
267CONFIG_FLATMEM=y
268CONFIG_FLAT_NODE_MEM_MAP=y
269# CONFIG_SPARSEMEM_STATIC is not set
270# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
271CONFIG_PAGEFLAGS_EXTENDED=y
272CONFIG_SPLIT_PTLOCK_CPUS=4
273# CONFIG_RESOURCES_64BIT is not set
274CONFIG_ZONE_DMA_FLAG=1
275CONFIG_BOUNCE=y
276CONFIG_VIRT_TO_BUS=y
277# CONFIG_LEDS is not set
278CONFIG_ALIGNMENT_TRAP=y
279
280#
281# Boot options
282#
283CONFIG_ZBOOT_ROM_TEXT=0x0
284CONFIG_ZBOOT_ROM_BSS=0x0
285CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
286# CONFIG_XIP_KERNEL is not set
287# CONFIG_KEXEC is not set
288
289#
290# CPU Frequency scaling
291#
292# CONFIG_CPU_FREQ is not set
293
294#
295# Floating point emulation
296#
297
298#
299# At least one emulation must be selected
300#
301CONFIG_FPE_NWFPE=y
302# CONFIG_FPE_NWFPE_XP is not set
303# CONFIG_FPE_FASTFPE is not set
304CONFIG_VFP=y
305CONFIG_VFPv3=y
306# CONFIG_NEON is not set
307
308#
309# Userspace binary formats
310#
311CONFIG_BINFMT_ELF=y
312# CONFIG_BINFMT_AOUT is not set
313CONFIG_BINFMT_MISC=y
314
315#
316# Power management options
317#
318# CONFIG_PM is not set
319CONFIG_ARCH_SUSPEND_POSSIBLE=y
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326# CONFIG_PACKET_MMAP is not set
327CONFIG_UNIX=y
328CONFIG_XFRM=y
329CONFIG_XFRM_USER=y
330# CONFIG_XFRM_SUB_POLICY is not set
331CONFIG_XFRM_MIGRATE=y
332# CONFIG_XFRM_STATISTICS is not set
333CONFIG_NET_KEY=y
334CONFIG_NET_KEY_MIGRATE=y
335CONFIG_INET=y
336CONFIG_IP_MULTICAST=y
337# CONFIG_IP_ADVANCED_ROUTER is not set
338CONFIG_IP_FIB_HASH=y
339CONFIG_IP_PNP=y
340CONFIG_IP_PNP_DHCP=y
341CONFIG_IP_PNP_BOOTP=y
342CONFIG_IP_PNP_RARP=y
343# CONFIG_NET_IPIP is not set
344# CONFIG_NET_IPGRE is not set
345# CONFIG_IP_MROUTE is not set
346# CONFIG_ARPD is not set
347# CONFIG_SYN_COOKIES is not set
348# CONFIG_INET_AH is not set
349# CONFIG_INET_ESP is not set
350# CONFIG_INET_IPCOMP is not set
351# CONFIG_INET_XFRM_TUNNEL is not set
352# CONFIG_INET_TUNNEL is not set
353CONFIG_INET_XFRM_MODE_TRANSPORT=y
354CONFIG_INET_XFRM_MODE_TUNNEL=y
355CONFIG_INET_XFRM_MODE_BEET=y
356# CONFIG_INET_LRO is not set
357CONFIG_INET_DIAG=y
358CONFIG_INET_TCP_DIAG=y
359# CONFIG_TCP_CONG_ADVANCED is not set
360CONFIG_TCP_CONG_CUBIC=y
361CONFIG_DEFAULT_TCP_CONG="cubic"
362# CONFIG_TCP_MD5SIG is not set
363# CONFIG_IPV6 is not set
364# CONFIG_NETWORK_SECMARK is not set
365# CONFIG_NETFILTER is not set
366# CONFIG_IP_DCCP is not set
367# CONFIG_IP_SCTP is not set
368# CONFIG_TIPC is not set
369# CONFIG_ATM is not set
370# CONFIG_BRIDGE is not set
371# CONFIG_NET_DSA is not set
372# CONFIG_VLAN_8021Q is not set
373# CONFIG_DECNET is not set
374# CONFIG_LLC2 is not set
375# CONFIG_IPX is not set
376# CONFIG_ATALK is not set
377# CONFIG_X25 is not set
378# CONFIG_LAPB is not set
379# CONFIG_ECONET is not set
380# CONFIG_WAN_ROUTER is not set
381# CONFIG_NET_SCHED is not set
382
383#
384# Network testing
385#
386# CONFIG_NET_PKTGEN is not set
387# CONFIG_HAMRADIO is not set
388# CONFIG_CAN is not set
389# CONFIG_IRDA is not set
390# CONFIG_BT is not set
391# CONFIG_AF_RXRPC is not set
392# CONFIG_PHONET is not set
393# CONFIG_WIRELESS is not set
394# CONFIG_RFKILL is not set
395# CONFIG_NET_9P is not set
396
397#
398# Device Drivers
399#
400
401#
402# Generic Driver Options
403#
404CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
405CONFIG_STANDALONE=y
406CONFIG_PREVENT_FIRMWARE_BUILD=y
407# CONFIG_FW_LOADER is not set
408# CONFIG_DEBUG_DRIVER is not set
409# CONFIG_DEBUG_DEVRES is not set
410# CONFIG_SYS_HYPERVISOR is not set
411CONFIG_CONNECTOR=y
412CONFIG_PROC_EVENTS=y
413# CONFIG_MTD is not set
414# CONFIG_PARPORT is not set
415CONFIG_BLK_DEV=y
416# CONFIG_BLK_DEV_COW_COMMON is not set
417CONFIG_BLK_DEV_LOOP=y
418# CONFIG_BLK_DEV_CRYPTOLOOP is not set
419CONFIG_BLK_DEV_RAM=y
420CONFIG_BLK_DEV_RAM_COUNT=16
421CONFIG_BLK_DEV_RAM_SIZE=16384
422# CONFIG_BLK_DEV_XIP is not set
423# CONFIG_CDROM_PKTCDVD is not set
424CONFIG_MISC_DEVICES=y
425# CONFIG_EEPROM_93CX6 is not set
426# CONFIG_ENCLOSURE_SERVICES is not set
427CONFIG_HAVE_IDE=y
428# CONFIG_IDE is not set
429
430#
431# SCSI device support
432#
433# CONFIG_RAID_ATTRS is not set
434CONFIG_SCSI=y
435CONFIG_SCSI_DMA=y
436# CONFIG_SCSI_TGT is not set
437# CONFIG_SCSI_NETLINK is not set
438CONFIG_SCSI_PROC_FS=y
439
440#
441# SCSI support type (disk, tape, CD-ROM)
442#
443CONFIG_BLK_DEV_SD=y
444# CONFIG_CHR_DEV_ST is not set
445# CONFIG_CHR_DEV_OSST is not set
446# CONFIG_BLK_DEV_SR is not set
447# CONFIG_CHR_DEV_SG is not set
448# CONFIG_CHR_DEV_SCH is not set
449
450#
451# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
452#
453# CONFIG_SCSI_MULTI_LUN is not set
454# CONFIG_SCSI_CONSTANTS is not set
455# CONFIG_SCSI_LOGGING is not set
456# CONFIG_SCSI_SCAN_ASYNC is not set
457CONFIG_SCSI_WAIT_SCAN=m
458
459#
460# SCSI Transports
461#
462# CONFIG_SCSI_SPI_ATTRS is not set
463# CONFIG_SCSI_FC_ATTRS is not set
464# CONFIG_SCSI_SAS_LIBSAS is not set
465# CONFIG_SCSI_SRP_ATTRS is not set
466CONFIG_SCSI_LOWLEVEL=y
467# CONFIG_SCSI_DEBUG is not set
468# CONFIG_SCSI_DH is not set
469# CONFIG_ATA is not set
470# CONFIG_MD is not set
471CONFIG_NETDEVICES=y
472# CONFIG_DUMMY is not set
473# CONFIG_BONDING is not set
474# CONFIG_MACVLAN is not set
475# CONFIG_EQUALIZER is not set
476# CONFIG_TUN is not set
477# CONFIG_VETH is not set
478CONFIG_PHYLIB=y
479
480#
481# MII PHY device drivers
482#
483# CONFIG_MARVELL_PHY is not set
484# CONFIG_DAVICOM_PHY is not set
485# CONFIG_QSEMI_PHY is not set
486# CONFIG_LXT_PHY is not set
487# CONFIG_CICADA_PHY is not set
488# CONFIG_VITESSE_PHY is not set
489CONFIG_SMSC_PHY=y
490# CONFIG_BROADCOM_PHY is not set
491# CONFIG_ICPLUS_PHY is not set
492# CONFIG_REALTEK_PHY is not set
493# CONFIG_NATIONAL_PHY is not set
494# CONFIG_STE10XP is not set
495# CONFIG_LSI_ET1011C_PHY is not set
496# CONFIG_FIXED_PHY is not set
497# CONFIG_MDIO_BITBANG is not set
498CONFIG_NET_ETHERNET=y
499CONFIG_MII=y
500# CONFIG_AX88796 is not set
501# CONFIG_SMC91X is not set
502# CONFIG_DM9000 is not set
503# CONFIG_ENC28J60 is not set
504# CONFIG_SMC911X is not set
505CONFIG_SMSC911X=y
506# CONFIG_IBM_NEW_EMAC_ZMII is not set
507# CONFIG_IBM_NEW_EMAC_RGMII is not set
508# CONFIG_IBM_NEW_EMAC_TAH is not set
509# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
510# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
511# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
512# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
513# CONFIG_B44 is not set
514CONFIG_NETDEV_1000=y
515CONFIG_NETDEV_10000=y
516
517#
518# Wireless LAN
519#
520# CONFIG_WLAN_PRE80211 is not set
521# CONFIG_WLAN_80211 is not set
522# CONFIG_IWLWIFI_LEDS is not set
523
524#
525# USB Network Adapters
526#
527# CONFIG_USB_CATC is not set
528# CONFIG_USB_KAWETH is not set
529# CONFIG_USB_PEGASUS is not set
530# CONFIG_USB_RTL8150 is not set
531# CONFIG_USB_USBNET is not set
532# CONFIG_WAN is not set
533# CONFIG_PPP is not set
534# CONFIG_SLIP is not set
535# CONFIG_NETCONSOLE is not set
536# CONFIG_NETPOLL is not set
537# CONFIG_NET_POLL_CONTROLLER is not set
538# CONFIG_ISDN is not set
539
540#
541# Input device support
542#
543CONFIG_INPUT=y
544# CONFIG_INPUT_FF_MEMLESS is not set
545# CONFIG_INPUT_POLLDEV is not set
546
547#
548# Userland interfaces
549#
550# CONFIG_INPUT_MOUSEDEV is not set
551# CONFIG_INPUT_JOYDEV is not set
552CONFIG_INPUT_EVDEV=y
553# CONFIG_INPUT_EVBUG is not set
554
555#
556# Input Device Drivers
557#
558# CONFIG_INPUT_KEYBOARD is not set
559# CONFIG_INPUT_MOUSE is not set
560# CONFIG_INPUT_JOYSTICK is not set
561# CONFIG_INPUT_TABLET is not set
562CONFIG_INPUT_TOUCHSCREEN=y
563CONFIG_TOUCHSCREEN_ADS7846=y
564# CONFIG_TOUCHSCREEN_FUJITSU is not set
565# CONFIG_TOUCHSCREEN_GUNZE is not set
566# CONFIG_TOUCHSCREEN_ELO is not set
567# CONFIG_TOUCHSCREEN_MTOUCH is not set
568# CONFIG_TOUCHSCREEN_INEXIO is not set
569# CONFIG_TOUCHSCREEN_MK712 is not set
570# CONFIG_TOUCHSCREEN_PENMOUNT is not set
571# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
572# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
573# CONFIG_TOUCHSCREEN_UCB1400 is not set
574# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
575# CONFIG_INPUT_MISC is not set
576
577#
578# Hardware I/O ports
579#
580# CONFIG_SERIO is not set
581# CONFIG_GAMEPORT is not set
582
583#
584# Character devices
585#
586CONFIG_VT=y
587CONFIG_CONSOLE_TRANSLATIONS=y
588CONFIG_VT_CONSOLE=y
589CONFIG_HW_CONSOLE=y
590# CONFIG_VT_HW_CONSOLE_BINDING is not set
591CONFIG_DEVKMEM=y
592# CONFIG_SERIAL_NONSTANDARD is not set
593
594#
595# Serial drivers
596#
597CONFIG_SERIAL_8250=y
598CONFIG_SERIAL_8250_CONSOLE=y
599CONFIG_SERIAL_8250_NR_UARTS=32
600CONFIG_SERIAL_8250_RUNTIME_UARTS=4
601CONFIG_SERIAL_8250_EXTENDED=y
602CONFIG_SERIAL_8250_MANY_PORTS=y
603CONFIG_SERIAL_8250_SHARE_IRQ=y
604CONFIG_SERIAL_8250_DETECT_IRQ=y
605CONFIG_SERIAL_8250_RSA=y
606
607#
608# Non-8250 serial port support
609#
610CONFIG_SERIAL_CORE=y
611CONFIG_SERIAL_CORE_CONSOLE=y
612CONFIG_UNIX98_PTYS=y
613# CONFIG_LEGACY_PTYS is not set
614# CONFIG_IPMI_HANDLER is not set
615CONFIG_HW_RANDOM=y
616# CONFIG_NVRAM is not set
617# CONFIG_R3964 is not set
618# CONFIG_RAW_DRIVER is not set
619# CONFIG_TCG_TPM is not set
620CONFIG_I2C=y
621CONFIG_I2C_BOARDINFO=y
622CONFIG_I2C_CHARDEV=y
623CONFIG_I2C_HELPER_AUTO=y
624
625#
626# I2C Hardware Bus support
627#
628
629#
630# I2C system bus drivers (mostly embedded / system-on-chip)
631#
632# CONFIG_I2C_GPIO is not set
633# CONFIG_I2C_OCORES is not set
634CONFIG_I2C_OMAP=y
635# CONFIG_I2C_SIMTEC is not set
636
637#
638# External I2C/SMBus adapter drivers
639#
640# CONFIG_I2C_PARPORT_LIGHT is not set
641# CONFIG_I2C_TAOS_EVM is not set
642
643#
644# Other I2C/SMBus bus drivers
645#
646# CONFIG_I2C_PCA_PLATFORM is not set
647# CONFIG_I2C_STUB is not set
648
649#
650# Miscellaneous I2C Chip support
651#
652# CONFIG_DS1682 is not set
653# CONFIG_EEPROM_AT24 is not set
654# CONFIG_EEPROM_LEGACY is not set
655# CONFIG_SENSORS_PCF8574 is not set
656# CONFIG_PCF8575 is not set
657# CONFIG_SENSORS_PCA9539 is not set
658# CONFIG_SENSORS_PCF8591 is not set
659# CONFIG_ISP1301_OMAP is not set
660# CONFIG_TPS65010 is not set
661# CONFIG_SENSORS_MAX6875 is not set
662# CONFIG_SENSORS_TSL2550 is not set
663# CONFIG_I2C_DEBUG_CORE is not set
664# CONFIG_I2C_DEBUG_ALGO is not set
665# CONFIG_I2C_DEBUG_BUS is not set
666# CONFIG_I2C_DEBUG_CHIP is not set
667CONFIG_SPI=y
668# CONFIG_SPI_DEBUG is not set
669CONFIG_SPI_MASTER=y
670
671#
672# SPI Master Controller Drivers
673#
674# CONFIG_SPI_BITBANG is not set
675CONFIG_SPI_OMAP24XX=y
676
677#
678# SPI Protocol Masters
679#
680# CONFIG_EEPROM_AT25 is not set
681# CONFIG_SPI_SPIDEV is not set
682# CONFIG_SPI_TLE62X0 is not set
683CONFIG_ARCH_REQUIRE_GPIOLIB=y
684CONFIG_GPIOLIB=y
685# CONFIG_DEBUG_GPIO is not set
686# CONFIG_GPIO_SYSFS is not set
687
688#
689# I2C GPIO expanders:
690#
691# CONFIG_GPIO_MAX732X is not set
692# CONFIG_GPIO_PCA953X is not set
693# CONFIG_GPIO_PCF857X is not set
694
695#
696# PCI GPIO expanders:
697#
698
699#
700# SPI GPIO expanders:
701#
702# CONFIG_GPIO_MAX7301 is not set
703# CONFIG_GPIO_MCP23S08 is not set
704CONFIG_W1=y
705
706#
707# 1-wire Bus Masters
708#
709# CONFIG_W1_MASTER_DS2482 is not set
710# CONFIG_W1_MASTER_DS1WM is not set
711# CONFIG_W1_MASTER_GPIO is not set
712
713#
714# 1-wire Slaves
715#
716# CONFIG_W1_SLAVE_THERM is not set
717# CONFIG_W1_SLAVE_SMEM is not set
718# CONFIG_W1_SLAVE_DS2433 is not set
719# CONFIG_W1_SLAVE_DS2760 is not set
720CONFIG_POWER_SUPPLY=y
721# CONFIG_POWER_SUPPLY_DEBUG is not set
722# CONFIG_PDA_POWER is not set
723# CONFIG_BATTERY_DS2760 is not set
724# CONFIG_HWMON is not set
725CONFIG_WATCHDOG=y
726CONFIG_WATCHDOG_NOWAYOUT=y
727
728#
729# Watchdog Device Drivers
730#
731# CONFIG_SOFT_WATCHDOG is not set
732
733#
734# Sonics Silicon Backplane
735#
736CONFIG_SSB_POSSIBLE=y
737# CONFIG_SSB is not set
738
739#
740# Multifunction device drivers
741#
742# CONFIG_MFD_CORE is not set
743# CONFIG_MFD_SM501 is not set
744# CONFIG_HTC_EGPIO is not set
745# CONFIG_HTC_PASIC3 is not set
746# CONFIG_MFD_TMIO is not set
747# CONFIG_MFD_T7L66XB is not set
748# CONFIG_MFD_TC6387XB is not set
749# CONFIG_MFD_TC6393XB is not set
750
751#
752# Multimedia devices
753#
754
755#
756# Multimedia core support
757#
758# CONFIG_VIDEO_DEV is not set
759# CONFIG_VIDEO_MEDIA is not set
760
761#
762# Multimedia drivers
763#
764CONFIG_DAB=y
765
766#
767# Graphics support
768#
769# CONFIG_VGASTATE is not set
770CONFIG_VIDEO_OUTPUT_CONTROL=m
771# CONFIG_FB is not set
772# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
773
774#
775# Display device support
776#
777# CONFIG_DISPLAY_SUPPORT is not set
778
779#
780# Console display driver support
781#
782# CONFIG_VGA_CONSOLE is not set
783CONFIG_DUMMY_CONSOLE=y
784CONFIG_SOUND=y
785CONFIG_SND=y
786# CONFIG_SND_SEQUENCER is not set
787# CONFIG_SND_MIXER_OSS is not set
788# CONFIG_SND_PCM_OSS is not set
789# CONFIG_SND_DYNAMIC_MINORS is not set
790CONFIG_SND_SUPPORT_OLD_API=y
791CONFIG_SND_VERBOSE_PROCFS=y
792# CONFIG_SND_VERBOSE_PRINTK is not set
793# CONFIG_SND_DEBUG is not set
794CONFIG_SND_DRIVERS=y
795# CONFIG_SND_DUMMY is not set
796# CONFIG_SND_MTPAV is not set
797# CONFIG_SND_SERIAL_U16550 is not set
798# CONFIG_SND_MPU401 is not set
799CONFIG_SND_ARM=y
800CONFIG_SND_SPI=y
801# CONFIG_SND_SOC is not set
802# CONFIG_SOUND_PRIME is not set
803CONFIG_HID_SUPPORT=y
804CONFIG_HID=y
805# CONFIG_HID_DEBUG is not set
806# CONFIG_HIDRAW is not set
807# CONFIG_USB_SUPPORT is not set
808CONFIG_MMC=y
809# CONFIG_MMC_DEBUG is not set
810# CONFIG_MMC_UNSAFE_RESUME is not set
811
812#
813# MMC/SD Card Drivers
814#
815CONFIG_MMC_BLOCK=y
816CONFIG_MMC_BLOCK_BOUNCE=y
817# CONFIG_SDIO_UART is not set
818# CONFIG_MMC_TEST is not set
819
820#
821# MMC/SD Host Controller Drivers
822#
823# CONFIG_MMC_SDHCI is not set
824# CONFIG_MMC_OMAP is not set
825# CONFIG_MMC_SPI is not set
826# CONFIG_NEW_LEDS is not set
827CONFIG_RTC_LIB=y
828CONFIG_RTC_CLASS=y
829CONFIG_RTC_HCTOSYS=y
830CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
831# CONFIG_RTC_DEBUG is not set
832
833#
834# RTC interfaces
835#
836CONFIG_RTC_INTF_SYSFS=y
837CONFIG_RTC_INTF_PROC=y
838CONFIG_RTC_INTF_DEV=y
839# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
840# CONFIG_RTC_DRV_TEST is not set
841
842#
843# I2C RTC drivers
844#
845# CONFIG_RTC_DRV_DS1307 is not set
846# CONFIG_RTC_DRV_DS1374 is not set
847# CONFIG_RTC_DRV_DS1672 is not set
848# CONFIG_RTC_DRV_MAX6900 is not set
849# CONFIG_RTC_DRV_RS5C372 is not set
850# CONFIG_RTC_DRV_ISL1208 is not set
851# CONFIG_RTC_DRV_X1205 is not set
852# CONFIG_RTC_DRV_PCF8563 is not set
853# CONFIG_RTC_DRV_PCF8583 is not set
854# CONFIG_RTC_DRV_M41T80 is not set
855# CONFIG_RTC_DRV_S35390A is not set
856# CONFIG_RTC_DRV_FM3130 is not set
857
858#
859# SPI RTC drivers
860#
861# CONFIG_RTC_DRV_M41T94 is not set
862# CONFIG_RTC_DRV_DS1305 is not set
863# CONFIG_RTC_DRV_MAX6902 is not set
864# CONFIG_RTC_DRV_R9701 is not set
865# CONFIG_RTC_DRV_RS5C348 is not set
866
867#
868# Platform RTC drivers
869#
870# CONFIG_RTC_DRV_CMOS is not set
871# CONFIG_RTC_DRV_DS1511 is not set
872# CONFIG_RTC_DRV_DS1553 is not set
873# CONFIG_RTC_DRV_DS1742 is not set
874# CONFIG_RTC_DRV_STK17TA8 is not set
875# CONFIG_RTC_DRV_M48T86 is not set
876# CONFIG_RTC_DRV_M48T59 is not set
877# CONFIG_RTC_DRV_V3020 is not set
878
879#
880# on-CPU RTC drivers
881#
882# CONFIG_DMADEVICES is not set
883
884#
885# Voltage and Current regulators
886#
887# CONFIG_REGULATOR is not set
888# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
889# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
890# CONFIG_REGULATOR_BQ24022 is not set
891# CONFIG_UIO is not set
892
893#
894# File systems
895#
896CONFIG_EXT2_FS=y
897# CONFIG_EXT2_FS_XATTR is not set
898# CONFIG_EXT2_FS_XIP is not set
899CONFIG_EXT3_FS=y
900# CONFIG_EXT3_FS_XATTR is not set
901# CONFIG_EXT4DEV_FS is not set
902CONFIG_JBD=y
903# CONFIG_REISERFS_FS is not set
904# CONFIG_JFS_FS is not set
905# CONFIG_FS_POSIX_ACL is not set
906# CONFIG_XFS_FS is not set
907CONFIG_DNOTIFY=y
908CONFIG_INOTIFY=y
909CONFIG_INOTIFY_USER=y
910CONFIG_QUOTA=y
911CONFIG_PRINT_QUOTA_WARNING=y
912# CONFIG_QFMT_V1 is not set
913CONFIG_QFMT_V2=y
914CONFIG_QUOTACTL=y
915# CONFIG_AUTOFS_FS is not set
916# CONFIG_AUTOFS4_FS is not set
917# CONFIG_FUSE_FS is not set
918
919#
920# CD-ROM/DVD Filesystems
921#
922# CONFIG_ISO9660_FS is not set
923# CONFIG_UDF_FS is not set
924
925#
926# DOS/FAT/NT Filesystems
927#
928CONFIG_FAT_FS=y
929CONFIG_MSDOS_FS=y
930CONFIG_VFAT_FS=y
931CONFIG_FAT_DEFAULT_CODEPAGE=437
932CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
933# CONFIG_NTFS_FS is not set
934
935#
936# Pseudo filesystems
937#
938CONFIG_PROC_FS=y
939CONFIG_PROC_SYSCTL=y
940CONFIG_SYSFS=y
941CONFIG_TMPFS=y
942# CONFIG_TMPFS_POSIX_ACL is not set
943# CONFIG_HUGETLB_PAGE is not set
944# CONFIG_CONFIGFS_FS is not set
945
946#
947# Miscellaneous filesystems
948#
949# CONFIG_ADFS_FS is not set
950# CONFIG_AFFS_FS is not set
951# CONFIG_HFS_FS is not set
952# CONFIG_HFSPLUS_FS is not set
953# CONFIG_BEFS_FS is not set
954# CONFIG_BFS_FS is not set
955# CONFIG_EFS_FS is not set
956# CONFIG_CRAMFS is not set
957# CONFIG_VXFS_FS is not set
958# CONFIG_MINIX_FS is not set
959# CONFIG_OMFS_FS is not set
960# CONFIG_HPFS_FS is not set
961# CONFIG_QNX4FS_FS is not set
962# CONFIG_ROMFS_FS is not set
963# CONFIG_SYSV_FS is not set
964# CONFIG_UFS_FS is not set
965CONFIG_NETWORK_FILESYSTEMS=y
966CONFIG_NFS_FS=y
967CONFIG_NFS_V3=y
968CONFIG_NFS_V3_ACL=y
969CONFIG_NFS_V4=y
970CONFIG_ROOT_NFS=y
971# CONFIG_NFSD is not set
972CONFIG_LOCKD=y
973CONFIG_LOCKD_V4=y
974CONFIG_NFS_ACL_SUPPORT=y
975CONFIG_NFS_COMMON=y
976CONFIG_SUNRPC=y
977CONFIG_SUNRPC_GSS=y
978# CONFIG_SUNRPC_REGISTER_V4 is not set
979CONFIG_RPCSEC_GSS_KRB5=y
980# CONFIG_RPCSEC_GSS_SPKM3 is not set
981# CONFIG_SMB_FS is not set
982# CONFIG_CIFS is not set
983# CONFIG_NCP_FS is not set
984# CONFIG_CODA_FS is not set
985# CONFIG_AFS_FS is not set
986
987#
988# Partition Types
989#
990CONFIG_PARTITION_ADVANCED=y
991# CONFIG_ACORN_PARTITION is not set
992# CONFIG_OSF_PARTITION is not set
993# CONFIG_AMIGA_PARTITION is not set
994# CONFIG_ATARI_PARTITION is not set
995# CONFIG_MAC_PARTITION is not set
996CONFIG_MSDOS_PARTITION=y
997# CONFIG_BSD_DISKLABEL is not set
998# CONFIG_MINIX_SUBPARTITION is not set
999# CONFIG_SOLARIS_X86_PARTITION is not set
1000# CONFIG_UNIXWARE_DISKLABEL is not set
1001# CONFIG_LDM_PARTITION is not set
1002# CONFIG_SGI_PARTITION is not set
1003# CONFIG_ULTRIX_PARTITION is not set
1004# CONFIG_SUN_PARTITION is not set
1005# CONFIG_KARMA_PARTITION is not set
1006# CONFIG_EFI_PARTITION is not set
1007# CONFIG_SYSV68_PARTITION is not set
1008CONFIG_NLS=y
1009CONFIG_NLS_DEFAULT="iso8859-1"
1010CONFIG_NLS_CODEPAGE_437=y
1011# CONFIG_NLS_CODEPAGE_737 is not set
1012# CONFIG_NLS_CODEPAGE_775 is not set
1013# CONFIG_NLS_CODEPAGE_850 is not set
1014# CONFIG_NLS_CODEPAGE_852 is not set
1015# CONFIG_NLS_CODEPAGE_855 is not set
1016# CONFIG_NLS_CODEPAGE_857 is not set
1017# CONFIG_NLS_CODEPAGE_860 is not set
1018# CONFIG_NLS_CODEPAGE_861 is not set
1019# CONFIG_NLS_CODEPAGE_862 is not set
1020# CONFIG_NLS_CODEPAGE_863 is not set
1021# CONFIG_NLS_CODEPAGE_864 is not set
1022# CONFIG_NLS_CODEPAGE_865 is not set
1023# CONFIG_NLS_CODEPAGE_866 is not set
1024# CONFIG_NLS_CODEPAGE_869 is not set
1025# CONFIG_NLS_CODEPAGE_936 is not set
1026# CONFIG_NLS_CODEPAGE_950 is not set
1027# CONFIG_NLS_CODEPAGE_932 is not set
1028# CONFIG_NLS_CODEPAGE_949 is not set
1029# CONFIG_NLS_CODEPAGE_874 is not set
1030# CONFIG_NLS_ISO8859_8 is not set
1031# CONFIG_NLS_CODEPAGE_1250 is not set
1032# CONFIG_NLS_CODEPAGE_1251 is not set
1033# CONFIG_NLS_ASCII is not set
1034CONFIG_NLS_ISO8859_1=y
1035# CONFIG_NLS_ISO8859_2 is not set
1036# CONFIG_NLS_ISO8859_3 is not set
1037# CONFIG_NLS_ISO8859_4 is not set
1038# CONFIG_NLS_ISO8859_5 is not set
1039# CONFIG_NLS_ISO8859_6 is not set
1040# CONFIG_NLS_ISO8859_7 is not set
1041# CONFIG_NLS_ISO8859_9 is not set
1042# CONFIG_NLS_ISO8859_13 is not set
1043# CONFIG_NLS_ISO8859_14 is not set
1044# CONFIG_NLS_ISO8859_15 is not set
1045# CONFIG_NLS_KOI8_R is not set
1046# CONFIG_NLS_KOI8_U is not set
1047# CONFIG_NLS_UTF8 is not set
1048
1049#
1050# Kernel hacking
1051#
1052# CONFIG_PRINTK_TIME is not set
1053CONFIG_ENABLE_WARN_DEPRECATED=y
1054CONFIG_ENABLE_MUST_CHECK=y
1055CONFIG_FRAME_WARN=1024
1056CONFIG_MAGIC_SYSRQ=y
1057# CONFIG_UNUSED_SYMBOLS is not set
1058# CONFIG_DEBUG_FS is not set
1059# CONFIG_HEADERS_CHECK is not set
1060CONFIG_DEBUG_KERNEL=y
1061# CONFIG_DEBUG_SHIRQ is not set
1062CONFIG_DETECT_SOFTLOCKUP=y
1063# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1064CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1065CONFIG_SCHED_DEBUG=y
1066# CONFIG_SCHEDSTATS is not set
1067# CONFIG_TIMER_STATS is not set
1068# CONFIG_DEBUG_OBJECTS is not set
1069# CONFIG_DEBUG_SLAB is not set
1070# CONFIG_DEBUG_RT_MUTEXES is not set
1071# CONFIG_RT_MUTEX_TESTER is not set
1072# CONFIG_DEBUG_SPINLOCK is not set
1073CONFIG_DEBUG_MUTEXES=y
1074# CONFIG_DEBUG_LOCK_ALLOC is not set
1075# CONFIG_PROVE_LOCKING is not set
1076# CONFIG_LOCK_STAT is not set
1077# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1078# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1079# CONFIG_DEBUG_KOBJECT is not set
1080# CONFIG_DEBUG_BUGVERBOSE is not set
1081CONFIG_DEBUG_INFO=y
1082# CONFIG_DEBUG_VM is not set
1083# CONFIG_DEBUG_WRITECOUNT is not set
1084# CONFIG_DEBUG_MEMORY_INIT is not set
1085# CONFIG_DEBUG_LIST is not set
1086# CONFIG_DEBUG_SG is not set
1087CONFIG_FRAME_POINTER=y
1088# CONFIG_BOOT_PRINTK_DELAY is not set
1089# CONFIG_RCU_TORTURE_TEST is not set
1090# CONFIG_BACKTRACE_SELF_TEST is not set
1091# CONFIG_FAULT_INJECTION is not set
1092# CONFIG_LATENCYTOP is not set
1093CONFIG_HAVE_FTRACE=y
1094CONFIG_HAVE_DYNAMIC_FTRACE=y
1095# CONFIG_FTRACE is not set
1096# CONFIG_IRQSOFF_TRACER is not set
1097# CONFIG_SCHED_TRACER is not set
1098# CONFIG_CONTEXT_SWITCH_TRACER is not set
1099# CONFIG_SAMPLES is not set
1100CONFIG_HAVE_ARCH_KGDB=y
1101# CONFIG_KGDB is not set
1102# CONFIG_DEBUG_USER is not set
1103# CONFIG_DEBUG_ERRORS is not set
1104# CONFIG_DEBUG_STACK_USAGE is not set
1105CONFIG_DEBUG_LL=y
1106# CONFIG_DEBUG_ICEDCC is not set
1107
1108#
1109# Security options
1110#
1111# CONFIG_KEYS is not set
1112# CONFIG_SECURITY is not set
1113# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1114CONFIG_CRYPTO=y
1115
1116#
1117# Crypto core or helper
1118#
1119CONFIG_CRYPTO_ALGAPI=y
1120CONFIG_CRYPTO_BLKCIPHER=y
1121CONFIG_CRYPTO_MANAGER=y
1122# CONFIG_CRYPTO_GF128MUL is not set
1123# CONFIG_CRYPTO_NULL is not set
1124# CONFIG_CRYPTO_CRYPTD is not set
1125# CONFIG_CRYPTO_AUTHENC is not set
1126# CONFIG_CRYPTO_TEST is not set
1127
1128#
1129# Authenticated Encryption with Associated Data
1130#
1131# CONFIG_CRYPTO_CCM is not set
1132# CONFIG_CRYPTO_GCM is not set
1133# CONFIG_CRYPTO_SEQIV is not set
1134
1135#
1136# Block modes
1137#
1138CONFIG_CRYPTO_CBC=y
1139# CONFIG_CRYPTO_CTR is not set
1140# CONFIG_CRYPTO_CTS is not set
1141CONFIG_CRYPTO_ECB=m
1142# CONFIG_CRYPTO_LRW is not set
1143CONFIG_CRYPTO_PCBC=m
1144# CONFIG_CRYPTO_XTS is not set
1145
1146#
1147# Hash modes
1148#
1149# CONFIG_CRYPTO_HMAC is not set
1150# CONFIG_CRYPTO_XCBC is not set
1151
1152#
1153# Digest
1154#
1155# CONFIG_CRYPTO_CRC32C is not set
1156# CONFIG_CRYPTO_MD4 is not set
1157CONFIG_CRYPTO_MD5=y
1158# CONFIG_CRYPTO_MICHAEL_MIC is not set
1159# CONFIG_CRYPTO_RMD128 is not set
1160# CONFIG_CRYPTO_RMD160 is not set
1161# CONFIG_CRYPTO_RMD256 is not set
1162# CONFIG_CRYPTO_RMD320 is not set
1163# CONFIG_CRYPTO_SHA1 is not set
1164# CONFIG_CRYPTO_SHA256 is not set
1165# CONFIG_CRYPTO_SHA512 is not set
1166# CONFIG_CRYPTO_TGR192 is not set
1167# CONFIG_CRYPTO_WP512 is not set
1168
1169#
1170# Ciphers
1171#
1172# CONFIG_CRYPTO_AES is not set
1173# CONFIG_CRYPTO_ANUBIS is not set
1174# CONFIG_CRYPTO_ARC4 is not set
1175# CONFIG_CRYPTO_BLOWFISH is not set
1176# CONFIG_CRYPTO_CAMELLIA is not set
1177# CONFIG_CRYPTO_CAST5 is not set
1178# CONFIG_CRYPTO_CAST6 is not set
1179CONFIG_CRYPTO_DES=y
1180# CONFIG_CRYPTO_FCRYPT is not set
1181# CONFIG_CRYPTO_KHAZAD is not set
1182# CONFIG_CRYPTO_SALSA20 is not set
1183# CONFIG_CRYPTO_SEED is not set
1184# CONFIG_CRYPTO_SERPENT is not set
1185# CONFIG_CRYPTO_TEA is not set
1186# CONFIG_CRYPTO_TWOFISH is not set
1187
1188#
1189# Compression
1190#
1191# CONFIG_CRYPTO_DEFLATE is not set
1192# CONFIG_CRYPTO_LZO is not set
1193CONFIG_CRYPTO_HW=y
1194
1195#
1196# Library routines
1197#
1198CONFIG_BITREVERSE=y
1199# CONFIG_GENERIC_FIND_FIRST_BIT is not set
1200# CONFIG_GENERIC_FIND_NEXT_BIT is not set
1201CONFIG_CRC_CCITT=y
1202# CONFIG_CRC16 is not set
1203CONFIG_CRC_T10DIF=y
1204# CONFIG_CRC_ITU_T is not set
1205CONFIG_CRC32=y
1206# CONFIG_CRC7 is not set
1207CONFIG_LIBCRC32C=y
1208CONFIG_PLIST=y
1209CONFIG_HAS_IOMEM=y
1210CONFIG_HAS_IOPORT=y
1211CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index 5b98f7645119..9e2385293ecb 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -903,7 +903,8 @@ CONFIG_UNIX98_PTYS=y
903CONFIG_LEGACY_PTYS=y 903CONFIG_LEGACY_PTYS=y
904CONFIG_LEGACY_PTY_COUNT=16 904CONFIG_LEGACY_PTY_COUNT=16
905# CONFIG_IPMI_HANDLER is not set 905# CONFIG_IPMI_HANDLER is not set
906# CONFIG_HW_RANDOM is not set 906CONFIG_HW_RANDOM=m
907CONFIG_HW_RANDOM_TIMERIOMEM=m
907# CONFIG_R3964 is not set 908# CONFIG_R3964 is not set
908# CONFIG_APPLICOM is not set 909# CONFIG_APPLICOM is not set
909# CONFIG_RAW_DRIVER is not set 910# CONFIG_RAW_DRIVER is not set
diff --git a/arch/arm/configs/rx51_defconfig b/arch/arm/configs/rx51_defconfig
index 593102da8cd7..eb2cb31825c0 100644
--- a/arch/arm/configs/rx51_defconfig
+++ b/arch/arm/configs/rx51_defconfig
@@ -282,7 +282,7 @@ CONFIG_ALIGNMENT_TRAP=y
282# 282#
283CONFIG_ZBOOT_ROM_TEXT=0x0 283CONFIG_ZBOOT_ROM_TEXT=0x0
284CONFIG_ZBOOT_ROM_BSS=0x0 284CONFIG_ZBOOT_ROM_BSS=0x0
285CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs rw console=ttyMTD5" 285CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs rootflags=bulk_read,no_chk_data_crc rw console=ttyMTD,log console=tty0"
286# CONFIG_XIP_KERNEL is not set 286# CONFIG_XIP_KERNEL is not set
287# CONFIG_KEXEC is not set 287# CONFIG_KEXEC is not set
288 288
diff --git a/arch/arm/configs/stmp378x_defconfig b/arch/arm/configs/stmp378x_defconfig
new file mode 100644
index 000000000000..44461f197a17
--- /dev/null
+++ b/arch/arm/configs/stmp378x_defconfig
@@ -0,0 +1,1141 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc2
4# Thu Apr 23 02:44:13 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION="-default"
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41CONFIG_POSIX_MQUEUE=y
42CONFIG_POSIX_MQUEUE_SYSCTL=y
43CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT_V3 is not set
45# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56# CONFIG_IKCONFIG is not set
57CONFIG_LOG_BUF_SHIFT=17
58# CONFIG_GROUP_SCHED is not set
59# CONFIG_CGROUPS is not set
60CONFIG_SYSFS_DEPRECATED=y
61CONFIG_SYSFS_DEPRECATED_V2=y
62CONFIG_RELAY=y
63# CONFIG_NAMESPACES is not set
64CONFIG_BLK_DEV_INITRD=y
65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_INITRAMFS_ROOT_UID=0
67CONFIG_INITRAMFS_ROOT_GID=0
68CONFIG_RD_GZIP=y
69# CONFIG_RD_BZIP2 is not set
70# CONFIG_RD_LZMA is not set
71# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
72CONFIG_INITRAMFS_COMPRESSION_GZIP=y
73# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
74# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
75CONFIG_CC_OPTIMIZE_FOR_SIZE=y
76CONFIG_SYSCTL=y
77CONFIG_ANON_INODES=y
78CONFIG_EMBEDDED=y
79CONFIG_UID16=y
80CONFIG_SYSCTL_SYSCALL=y
81CONFIG_KALLSYMS=y
82CONFIG_KALLSYMS_ALL=y
83# CONFIG_KALLSYMS_EXTRA_PASS is not set
84CONFIG_STRIP_ASM_SYMS=y
85CONFIG_HOTPLUG=y
86CONFIG_PRINTK=y
87CONFIG_BUG=y
88CONFIG_ELF_CORE=y
89CONFIG_BASE_FULL=y
90CONFIG_FUTEX=y
91CONFIG_EPOLL=y
92CONFIG_SIGNALFD=y
93CONFIG_TIMERFD=y
94CONFIG_EVENTFD=y
95CONFIG_SHMEM=y
96CONFIG_AIO=y
97CONFIG_VM_EVENT_COUNTERS=y
98CONFIG_COMPAT_BRK=y
99CONFIG_SLAB=y
100# CONFIG_SLUB is not set
101# CONFIG_SLOB is not set
102# CONFIG_PROFILING is not set
103CONFIG_TRACEPOINTS=y
104CONFIG_MARKERS=y
105CONFIG_HAVE_OPROFILE=y
106# CONFIG_KPROBES is not set
107CONFIG_HAVE_KPROBES=y
108CONFIG_HAVE_KRETPROBES=y
109CONFIG_HAVE_CLK=y
110# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y
113CONFIG_RT_MUTEXES=y
114CONFIG_BASE_SMALL=0
115CONFIG_MODULES=y
116# CONFIG_MODULE_FORCE_LOAD is not set
117CONFIG_MODULE_UNLOAD=y
118CONFIG_MODULE_FORCE_UNLOAD=y
119CONFIG_MODVERSIONS=y
120CONFIG_MODULE_SRCVERSION_ALL=y
121CONFIG_BLOCK=y
122CONFIG_LBD=y
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
125
126#
127# IO Schedulers
128#
129CONFIG_IOSCHED_NOOP=y
130CONFIG_IOSCHED_AS=y
131CONFIG_IOSCHED_DEADLINE=y
132CONFIG_IOSCHED_CFQ=y
133# CONFIG_DEFAULT_AS is not set
134# CONFIG_DEFAULT_DEADLINE is not set
135CONFIG_DEFAULT_CFQ=y
136# CONFIG_DEFAULT_NOOP is not set
137CONFIG_DEFAULT_IOSCHED="cfq"
138# CONFIG_FREEZER is not set
139
140#
141# System Type
142#
143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147# CONFIG_ARCH_AT91 is not set
148# CONFIG_ARCH_CLPS711X is not set
149# CONFIG_ARCH_EBSA110 is not set
150# CONFIG_ARCH_EP93XX is not set
151# CONFIG_ARCH_GEMINI is not set
152# CONFIG_ARCH_FOOTBRIDGE is not set
153# CONFIG_ARCH_NETX is not set
154# CONFIG_ARCH_H720X is not set
155# CONFIG_ARCH_IMX is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_KS8695 is not set
165# CONFIG_ARCH_NS9XXX is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_MXC is not set
169# CONFIG_ARCH_ORION5X is not set
170# CONFIG_ARCH_PNX4008 is not set
171# CONFIG_ARCH_PXA is not set
172# CONFIG_ARCH_MMP is not set
173# CONFIG_ARCH_RPC is not set
174# CONFIG_ARCH_SA1100 is not set
175# CONFIG_ARCH_S3C2410 is not set
176# CONFIG_ARCH_S3C64XX is not set
177# CONFIG_ARCH_SHARK is not set
178# CONFIG_ARCH_LH7A40X is not set
179# CONFIG_ARCH_DAVINCI is not set
180# CONFIG_ARCH_OMAP is not set
181# CONFIG_ARCH_MSM is not set
182# CONFIG_ARCH_W90X900 is not set
183CONFIG_ARCH_STMP3XXX=y
184
185#
186# Freescale STMP3xxx implementations
187#
188# CONFIG_ARCH_STMP37XX is not set
189CONFIG_ARCH_STMP378X=y
190# CONFIG_MACH_STMP37XX is not set
191CONFIG_MACH_STMP378X=y
192
193#
194# Processor Type
195#
196CONFIG_CPU_32=y
197CONFIG_CPU_ARM926T=y
198CONFIG_CPU_32v5=y
199CONFIG_CPU_ABRT_EV5TJ=y
200CONFIG_CPU_PABRT_NOIFAR=y
201CONFIG_CPU_CACHE_VIVT=y
202CONFIG_CPU_COPY_V4WB=y
203CONFIG_CPU_TLB_V4WBI=y
204CONFIG_CPU_CP15=y
205CONFIG_CPU_CP15_MMU=y
206
207#
208# Processor Features
209#
210CONFIG_ARM_THUMB=y
211# CONFIG_CPU_ICACHE_DISABLE is not set
212# CONFIG_CPU_DCACHE_DISABLE is not set
213# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
214# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
215# CONFIG_OUTER_CACHE is not set
216CONFIG_COMMON_CLKDEV=y
217
218#
219# Bus support
220#
221# CONFIG_PCI_SYSCALL is not set
222# CONFIG_ARCH_SUPPORTS_MSI is not set
223# CONFIG_PCCARD is not set
224
225#
226# Kernel Features
227#
228CONFIG_TICK_ONESHOT=y
229CONFIG_NO_HZ=y
230CONFIG_HIGH_RES_TIMERS=y
231CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
232CONFIG_VMSPLIT_3G=y
233# CONFIG_VMSPLIT_2G is not set
234# CONFIG_VMSPLIT_1G is not set
235CONFIG_PAGE_OFFSET=0xC0000000
236CONFIG_PREEMPT=y
237CONFIG_HZ=100
238CONFIG_AEABI=y
239CONFIG_OABI_COMPAT=y
240CONFIG_ARCH_FLATMEM_HAS_HOLES=y
241# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
242# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
243CONFIG_HIGHMEM=y
244CONFIG_SELECT_MEMORY_MODEL=y
245CONFIG_FLATMEM_MANUAL=y
246# CONFIG_DISCONTIGMEM_MANUAL is not set
247# CONFIG_SPARSEMEM_MANUAL is not set
248CONFIG_FLATMEM=y
249CONFIG_FLAT_NODE_MEM_MAP=y
250CONFIG_PAGEFLAGS_EXTENDED=y
251CONFIG_SPLIT_PTLOCK_CPUS=4096
252# CONFIG_PHYS_ADDR_T_64BIT is not set
253CONFIG_ZONE_DMA_FLAG=0
254CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y
256CONFIG_UNEVICTABLE_LRU=y
257CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y
259CONFIG_ALIGNMENT_TRAP=y
260
261#
262# Boot options
263#
264CONFIG_ZBOOT_ROM_TEXT=0x0
265CONFIG_ZBOOT_ROM_BSS=0x0
266CONFIG_CMDLINE="console=ttySDBG0,115200 mem=32M"
267# CONFIG_XIP_KERNEL is not set
268# CONFIG_KEXEC is not set
269
270#
271# CPU Power Management
272#
273# CONFIG_CPU_IDLE is not set
274
275#
276# Floating point emulation
277#
278
279#
280# At least one emulation must be selected
281#
282# CONFIG_FPE_NWFPE is not set
283# CONFIG_FPE_FASTFPE is not set
284# CONFIG_VFP is not set
285
286#
287# Userspace binary formats
288#
289CONFIG_BINFMT_ELF=y
290# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
291CONFIG_HAVE_AOUT=y
292# CONFIG_BINFMT_AOUT is not set
293# CONFIG_BINFMT_MISC is not set
294
295#
296# Power management options
297#
298# CONFIG_PM is not set
299CONFIG_ARCH_SUSPEND_POSSIBLE=y
300CONFIG_NET=y
301
302#
303# Networking options
304#
305CONFIG_PACKET=y
306CONFIG_PACKET_MMAP=y
307CONFIG_UNIX=y
308CONFIG_XFRM=y
309# CONFIG_XFRM_USER is not set
310# CONFIG_XFRM_SUB_POLICY is not set
311# CONFIG_XFRM_MIGRATE is not set
312# CONFIG_XFRM_STATISTICS is not set
313# CONFIG_NET_KEY is not set
314CONFIG_INET=y
315CONFIG_IP_MULTICAST=y
316CONFIG_IP_ADVANCED_ROUTER=y
317CONFIG_ASK_IP_FIB_HASH=y
318# CONFIG_IP_FIB_TRIE is not set
319CONFIG_IP_FIB_HASH=y
320CONFIG_IP_MULTIPLE_TABLES=y
321CONFIG_IP_ROUTE_MULTIPATH=y
322CONFIG_IP_ROUTE_VERBOSE=y
323CONFIG_IP_PNP=y
324CONFIG_IP_PNP_DHCP=y
325CONFIG_IP_PNP_BOOTP=y
326# CONFIG_IP_PNP_RARP is not set
327# CONFIG_NET_IPIP is not set
328# CONFIG_NET_IPGRE is not set
329CONFIG_IP_MROUTE=y
330CONFIG_IP_PIMSM_V1=y
331CONFIG_IP_PIMSM_V2=y
332# CONFIG_ARPD is not set
333CONFIG_SYN_COOKIES=y
334# CONFIG_INET_AH is not set
335# CONFIG_INET_ESP is not set
336# CONFIG_INET_IPCOMP is not set
337# CONFIG_INET_XFRM_TUNNEL is not set
338# CONFIG_INET_TUNNEL is not set
339CONFIG_INET_XFRM_MODE_TRANSPORT=y
340CONFIG_INET_XFRM_MODE_TUNNEL=y
341CONFIG_INET_XFRM_MODE_BEET=y
342# CONFIG_INET_LRO is not set
343CONFIG_INET_DIAG=y
344CONFIG_INET_TCP_DIAG=y
345# CONFIG_TCP_CONG_ADVANCED is not set
346CONFIG_TCP_CONG_CUBIC=y
347CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_TCP_MD5SIG is not set
349# CONFIG_IPV6 is not set
350# CONFIG_NETLABEL is not set
351# CONFIG_NETWORK_SECMARK is not set
352# CONFIG_NETFILTER is not set
353# CONFIG_IP_DCCP is not set
354# CONFIG_IP_SCTP is not set
355# CONFIG_TIPC is not set
356# CONFIG_ATM is not set
357# CONFIG_BRIDGE is not set
358# CONFIG_NET_DSA is not set
359# CONFIG_VLAN_8021Q is not set
360# CONFIG_DECNET is not set
361# CONFIG_LLC2 is not set
362# CONFIG_IPX is not set
363# CONFIG_ATALK is not set
364# CONFIG_X25 is not set
365# CONFIG_LAPB is not set
366# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set
369CONFIG_NET_SCHED=y
370
371#
372# Queueing/Scheduling
373#
374# CONFIG_NET_SCH_CBQ is not set
375# CONFIG_NET_SCH_HTB is not set
376# CONFIG_NET_SCH_HFSC is not set
377# CONFIG_NET_SCH_PRIO is not set
378# CONFIG_NET_SCH_MULTIQ is not set
379# CONFIG_NET_SCH_RED is not set
380# CONFIG_NET_SCH_SFQ is not set
381# CONFIG_NET_SCH_TEQL is not set
382# CONFIG_NET_SCH_TBF is not set
383# CONFIG_NET_SCH_GRED is not set
384# CONFIG_NET_SCH_DSMARK is not set
385# CONFIG_NET_SCH_NETEM is not set
386# CONFIG_NET_SCH_DRR is not set
387
388#
389# Classification
390#
391# CONFIG_NET_CLS_BASIC is not set
392# CONFIG_NET_CLS_TCINDEX is not set
393# CONFIG_NET_CLS_ROUTE4 is not set
394# CONFIG_NET_CLS_FW is not set
395# CONFIG_NET_CLS_U32 is not set
396# CONFIG_NET_CLS_RSVP is not set
397# CONFIG_NET_CLS_RSVP6 is not set
398# CONFIG_NET_CLS_FLOW is not set
399# CONFIG_NET_EMATCH is not set
400# CONFIG_NET_CLS_ACT is not set
401CONFIG_NET_SCH_FIFO=y
402# CONFIG_DCB is not set
403
404#
405# Network testing
406#
407# CONFIG_NET_PKTGEN is not set
408# CONFIG_NET_DROP_MONITOR is not set
409# CONFIG_HAMRADIO is not set
410# CONFIG_CAN is not set
411# CONFIG_IRDA is not set
412# CONFIG_BT is not set
413# CONFIG_AF_RXRPC is not set
414CONFIG_FIB_RULES=y
415# CONFIG_WIRELESS is not set
416# CONFIG_WIMAX is not set
417# CONFIG_RFKILL is not set
418# CONFIG_NET_9P is not set
419
420#
421# Device Drivers
422#
423
424#
425# Generic Driver Options
426#
427CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
428# CONFIG_STANDALONE is not set
429CONFIG_PREVENT_FIRMWARE_BUILD=y
430CONFIG_FW_LOADER=y
431CONFIG_FIRMWARE_IN_KERNEL=y
432CONFIG_EXTRA_FIRMWARE=""
433# CONFIG_DEBUG_DRIVER is not set
434# CONFIG_DEBUG_DEVRES is not set
435# CONFIG_SYS_HYPERVISOR is not set
436# CONFIG_CONNECTOR is not set
437CONFIG_MTD=y
438# CONFIG_MTD_DEBUG is not set
439# CONFIG_MTD_CONCAT is not set
440# CONFIG_MTD_PARTITIONS is not set
441# CONFIG_MTD_TESTS is not set
442
443#
444# User Modules And Translation Layers
445#
446CONFIG_MTD_CHAR=y
447# CONFIG_MTD_BLKDEVS is not set
448# CONFIG_MTD_BLOCK is not set
449# CONFIG_MTD_BLOCK_RO is not set
450# CONFIG_FTL is not set
451# CONFIG_NFTL is not set
452# CONFIG_INFTL is not set
453# CONFIG_RFD_FTL is not set
454# CONFIG_SSFDC is not set
455# CONFIG_MTD_OOPS is not set
456
457#
458# RAM/ROM/Flash chip drivers
459#
460# CONFIG_MTD_CFI is not set
461# CONFIG_MTD_JEDECPROBE is not set
462CONFIG_MTD_MAP_BANK_WIDTH_1=y
463CONFIG_MTD_MAP_BANK_WIDTH_2=y
464CONFIG_MTD_MAP_BANK_WIDTH_4=y
465# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
466# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
467# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
468CONFIG_MTD_CFI_I1=y
469CONFIG_MTD_CFI_I2=y
470# CONFIG_MTD_CFI_I4 is not set
471# CONFIG_MTD_CFI_I8 is not set
472# CONFIG_MTD_RAM is not set
473# CONFIG_MTD_ROM is not set
474# CONFIG_MTD_ABSENT is not set
475
476#
477# Mapping drivers for chip access
478#
479# CONFIG_MTD_COMPLEX_MAPPINGS is not set
480# CONFIG_MTD_PLATRAM is not set
481
482#
483# Self-contained MTD device drivers
484#
485# CONFIG_MTD_SLRAM is not set
486# CONFIG_MTD_PHRAM is not set
487# CONFIG_MTD_MTDRAM is not set
488# CONFIG_MTD_BLOCK2MTD is not set
489
490#
491# Disk-On-Chip Device Drivers
492#
493# CONFIG_MTD_DOC2000 is not set
494# CONFIG_MTD_DOC2001 is not set
495# CONFIG_MTD_DOC2001PLUS is not set
496CONFIG_MTD_NAND=y
497# CONFIG_MTD_NAND_VERIFY_WRITE is not set
498# CONFIG_MTD_NAND_ECC_SMC is not set
499# CONFIG_MTD_NAND_MUSEUM_IDS is not set
500# CONFIG_MTD_NAND_GPIO is not set
501CONFIG_MTD_NAND_IDS=y
502# CONFIG_MTD_NAND_DISKONCHIP is not set
503# CONFIG_MTD_NAND_PLATFORM is not set
504# CONFIG_MTD_ONENAND is not set
505
506#
507# LPDDR flash memory drivers
508#
509# CONFIG_MTD_LPDDR is not set
510
511#
512# UBI - Unsorted block images
513#
514CONFIG_MTD_UBI=y
515CONFIG_MTD_UBI_WL_THRESHOLD=4096
516CONFIG_MTD_UBI_BEB_RESERVE=1
517CONFIG_MTD_UBI_GLUEBI=y
518
519#
520# UBI debugging options
521#
522# CONFIG_MTD_UBI_DEBUG is not set
523# CONFIG_PARPORT is not set
524CONFIG_BLK_DEV=y
525# CONFIG_BLK_DEV_COW_COMMON is not set
526CONFIG_BLK_DEV_LOOP=y
527CONFIG_BLK_DEV_CRYPTOLOOP=y
528# CONFIG_BLK_DEV_NBD is not set
529CONFIG_BLK_DEV_RAM=y
530CONFIG_BLK_DEV_RAM_COUNT=4
531CONFIG_BLK_DEV_RAM_SIZE=6144
532# CONFIG_BLK_DEV_XIP is not set
533# CONFIG_CDROM_PKTCDVD is not set
534# CONFIG_ATA_OVER_ETH 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
559#
560# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
561#
562# CONFIG_SCSI_MULTI_LUN is not set
563# CONFIG_SCSI_CONSTANTS is not set
564# CONFIG_SCSI_LOGGING is not set
565# CONFIG_SCSI_SCAN_ASYNC is not set
566CONFIG_SCSI_WAIT_SCAN=m
567
568#
569# SCSI Transports
570#
571# CONFIG_SCSI_SPI_ATTRS is not set
572# CONFIG_SCSI_FC_ATTRS is not set
573# CONFIG_SCSI_ISCSI_ATTRS is not set
574# CONFIG_SCSI_SAS_LIBSAS is not set
575# CONFIG_SCSI_SRP_ATTRS is not set
576# CONFIG_SCSI_LOWLEVEL is not set
577# CONFIG_SCSI_DH is not set
578# CONFIG_SCSI_OSD_INITIATOR is not set
579# CONFIG_ATA is not set
580# CONFIG_MD is not set
581# CONFIG_NETDEVICES is not set
582# CONFIG_ISDN is not set
583
584#
585# Input device support
586#
587CONFIG_INPUT=y
588# CONFIG_INPUT_FF_MEMLESS is not set
589CONFIG_INPUT_POLLDEV=y
590
591#
592# Userland interfaces
593#
594CONFIG_INPUT_MOUSEDEV=y
595CONFIG_INPUT_MOUSEDEV_PSAUX=y
596CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
597CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
598# CONFIG_INPUT_JOYDEV is not set
599CONFIG_INPUT_EVDEV=y
600# CONFIG_INPUT_EVBUG is not set
601
602#
603# Input Device Drivers
604#
605CONFIG_INPUT_KEYBOARD=y
606# CONFIG_KEYBOARD_ATKBD is not set
607# CONFIG_KEYBOARD_SUNKBD is not set
608# CONFIG_KEYBOARD_LKKBD is not set
609# CONFIG_KEYBOARD_XTKBD is not set
610# CONFIG_KEYBOARD_NEWTON is not set
611# CONFIG_KEYBOARD_STOWAWAY is not set
612# CONFIG_KEYBOARD_GPIO is not set
613# CONFIG_INPUT_MOUSE is not set
614# CONFIG_INPUT_JOYSTICK is not set
615# CONFIG_INPUT_TABLET is not set
616CONFIG_INPUT_TOUCHSCREEN=y
617# CONFIG_TOUCHSCREEN_AD7879 is not set
618# CONFIG_TOUCHSCREEN_FUJITSU is not set
619# CONFIG_TOUCHSCREEN_GUNZE is not set
620# CONFIG_TOUCHSCREEN_ELO is not set
621# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
622# CONFIG_TOUCHSCREEN_MTOUCH is not set
623# CONFIG_TOUCHSCREEN_INEXIO is not set
624# CONFIG_TOUCHSCREEN_MK712 is not set
625# CONFIG_TOUCHSCREEN_PENMOUNT is not set
626# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
627# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
628# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
629CONFIG_INPUT_MISC=y
630# CONFIG_INPUT_UINPUT is not set
631# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
632
633#
634# Hardware I/O ports
635#
636CONFIG_SERIO=y
637# CONFIG_SERIO_SERPORT is not set
638# CONFIG_SERIO_LIBPS2 is not set
639# CONFIG_SERIO_RAW is not set
640# CONFIG_GAMEPORT is not set
641
642#
643# Character devices
644#
645CONFIG_VT=y
646CONFIG_CONSOLE_TRANSLATIONS=y
647CONFIG_VT_CONSOLE=y
648CONFIG_HW_CONSOLE=y
649CONFIG_VT_HW_CONSOLE_BINDING=y
650CONFIG_DEVKMEM=y
651# CONFIG_SERIAL_NONSTANDARD is not set
652
653#
654# Serial drivers
655#
656# CONFIG_SERIAL_8250 is not set
657
658#
659# Non-8250 serial port support
660#
661CONFIG_UNIX98_PTYS=y
662# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
663# CONFIG_LEGACY_PTYS is not set
664# CONFIG_IPMI_HANDLER is not set
665CONFIG_HW_RANDOM=y
666# CONFIG_HW_RANDOM_TIMERIOMEM is not set
667# CONFIG_R3964 is not set
668# CONFIG_RAW_DRIVER is not set
669# CONFIG_TCG_TPM is not set
670# CONFIG_I2C is not set
671# CONFIG_SPI is not set
672CONFIG_ARCH_REQUIRE_GPIOLIB=y
673CONFIG_GPIOLIB=y
674CONFIG_DEBUG_GPIO=y
675CONFIG_GPIO_SYSFS=y
676
677#
678# Memory mapped GPIO expanders:
679#
680
681#
682# I2C GPIO expanders:
683#
684
685#
686# PCI GPIO expanders:
687#
688
689#
690# SPI GPIO expanders:
691#
692# CONFIG_W1 is not set
693# CONFIG_POWER_SUPPLY is not set
694# CONFIG_HWMON is not set
695# CONFIG_THERMAL is not set
696# CONFIG_THERMAL_HWMON is not set
697# CONFIG_WATCHDOG is not set
698CONFIG_SSB_POSSIBLE=y
699
700#
701# Sonics Silicon Backplane
702#
703# CONFIG_SSB is not set
704
705#
706# Multifunction device drivers
707#
708# CONFIG_MFD_CORE is not set
709# CONFIG_MFD_SM501 is not set
710# CONFIG_MFD_ASIC3 is not set
711# CONFIG_HTC_EGPIO is not set
712# CONFIG_HTC_PASIC3 is not set
713# CONFIG_MFD_TMIO is not set
714# CONFIG_MFD_T7L66XB is not set
715# CONFIG_MFD_TC6387XB is not set
716# CONFIG_MFD_TC6393XB is not set
717
718#
719# Multimedia devices
720#
721
722#
723# Multimedia core support
724#
725CONFIG_VIDEO_DEV=y
726CONFIG_VIDEO_V4L2_COMMON=y
727# CONFIG_VIDEO_ALLOW_V4L1 is not set
728# CONFIG_VIDEO_V4L1_COMPAT is not set
729# CONFIG_DVB_CORE is not set
730CONFIG_VIDEO_MEDIA=y
731
732#
733# Multimedia drivers
734#
735# CONFIG_MEDIA_ATTACH is not set
736CONFIG_VIDEO_V4L2=y
737CONFIG_VIDEO_CAPTURE_DRIVERS=y
738# CONFIG_VIDEO_ADV_DEBUG is not set
739# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
740# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
741
742#
743# Encoders/decoders and other helper chips
744#
745
746#
747# Audio decoders
748#
749
750#
751# RDS decoders
752#
753
754#
755# Video decoders
756#
757
758#
759# Video and audio decoders
760#
761
762#
763# MPEG video encoders
764#
765# CONFIG_VIDEO_CX2341X is not set
766
767#
768# Video encoders
769#
770
771#
772# Video improvement chips
773#
774# CONFIG_VIDEO_VIVI is not set
775# CONFIG_SOC_CAMERA is not set
776# CONFIG_RADIO_ADAPTERS is not set
777# CONFIG_DAB is not set
778
779#
780# Graphics support
781#
782# CONFIG_VGASTATE is not set
783# CONFIG_VIDEO_OUTPUT_CONTROL is not set
784CONFIG_FB=y
785# CONFIG_FIRMWARE_EDID is not set
786# CONFIG_FB_DDC is not set
787# CONFIG_FB_BOOT_VESA_SUPPORT is not set
788# CONFIG_FB_CFB_FILLRECT is not set
789# CONFIG_FB_CFB_COPYAREA is not set
790# CONFIG_FB_CFB_IMAGEBLIT is not set
791# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
792# CONFIG_FB_SYS_FILLRECT is not set
793# CONFIG_FB_SYS_COPYAREA is not set
794# CONFIG_FB_SYS_IMAGEBLIT is not set
795# CONFIG_FB_FOREIGN_ENDIAN is not set
796# CONFIG_FB_SYS_FOPS is not set
797# CONFIG_FB_SVGALIB is not set
798# CONFIG_FB_MACMODES is not set
799# CONFIG_FB_BACKLIGHT is not set
800# CONFIG_FB_MODE_HELPERS is not set
801# CONFIG_FB_TILEBLITTING is not set
802
803#
804# Frame buffer hardware drivers
805#
806# CONFIG_FB_S1D13XXX is not set
807# CONFIG_FB_VIRTUAL is not set
808# CONFIG_FB_METRONOME is not set
809# CONFIG_FB_MB862XX is not set
810# CONFIG_FB_BROADSHEET is not set
811CONFIG_BACKLIGHT_LCD_SUPPORT=y
812CONFIG_LCD_CLASS_DEVICE=y
813# CONFIG_LCD_ILI9320 is not set
814# CONFIG_LCD_PLATFORM is not set
815CONFIG_BACKLIGHT_CLASS_DEVICE=y
816CONFIG_BACKLIGHT_GENERIC=y
817
818#
819# Display device support
820#
821# CONFIG_DISPLAY_SUPPORT is not set
822
823#
824# Console display driver support
825#
826# CONFIG_VGA_CONSOLE is not set
827CONFIG_DUMMY_CONSOLE=y
828CONFIG_FRAMEBUFFER_CONSOLE=y
829# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
830# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
831# CONFIG_FONTS is not set
832CONFIG_FONT_8x8=y
833CONFIG_FONT_8x16=y
834CONFIG_LOGO=y
835CONFIG_LOGO_LINUX_MONO=y
836CONFIG_LOGO_LINUX_VGA16=y
837CONFIG_LOGO_LINUX_CLUT224=y
838# CONFIG_SOUND is not set
839# CONFIG_HID_SUPPORT is not set
840# CONFIG_USB_SUPPORT is not set
841CONFIG_USB_ARCH_HAS_EHCI=y
842# CONFIG_MMC is not set
843# CONFIG_MEMSTICK is not set
844# CONFIG_ACCESSIBILITY is not set
845# CONFIG_NEW_LEDS is not set
846CONFIG_RTC_LIB=y
847# CONFIG_RTC_CLASS is not set
848# CONFIG_DMADEVICES is not set
849# CONFIG_AUXDISPLAY is not set
850# CONFIG_REGULATOR is not set
851# CONFIG_UIO is not set
852# CONFIG_STAGING is not set
853
854#
855# File systems
856#
857# CONFIG_EXT2_FS is not set
858# CONFIG_EXT3_FS is not set
859# CONFIG_EXT4_FS is not set
860# CONFIG_REISERFS_FS is not set
861# CONFIG_JFS_FS is not set
862# CONFIG_FS_POSIX_ACL is not set
863CONFIG_FILE_LOCKING=y
864# CONFIG_XFS_FS is not set
865# CONFIG_GFS2_FS is not set
866# CONFIG_OCFS2_FS is not set
867# CONFIG_BTRFS_FS is not set
868# CONFIG_DNOTIFY is not set
869# CONFIG_INOTIFY is not set
870# CONFIG_QUOTA is not set
871# CONFIG_AUTOFS_FS is not set
872# CONFIG_AUTOFS4_FS is not set
873# CONFIG_FUSE_FS is not set
874
875#
876# Caches
877#
878# CONFIG_FSCACHE is not set
879
880#
881# CD-ROM/DVD Filesystems
882#
883# CONFIG_ISO9660_FS is not set
884# CONFIG_UDF_FS is not set
885
886#
887# DOS/FAT/NT Filesystems
888#
889# CONFIG_MSDOS_FS is not set
890# CONFIG_VFAT_FS is not set
891# CONFIG_NTFS_FS is not set
892
893#
894# Pseudo filesystems
895#
896CONFIG_PROC_FS=y
897CONFIG_PROC_SYSCTL=y
898CONFIG_PROC_PAGE_MONITOR=y
899CONFIG_SYSFS=y
900CONFIG_TMPFS=y
901# CONFIG_TMPFS_POSIX_ACL is not set
902# CONFIG_HUGETLB_PAGE is not set
903CONFIG_CONFIGFS_FS=m
904# CONFIG_MISC_FILESYSTEMS is not set
905# CONFIG_NETWORK_FILESYSTEMS is not set
906
907#
908# Partition Types
909#
910# CONFIG_PARTITION_ADVANCED is not set
911CONFIG_MSDOS_PARTITION=y
912# CONFIG_NLS is not set
913# CONFIG_DLM is not set
914
915#
916# Kernel hacking
917#
918# CONFIG_PRINTK_TIME is not set
919CONFIG_ENABLE_WARN_DEPRECATED=y
920# CONFIG_ENABLE_MUST_CHECK is not set
921CONFIG_FRAME_WARN=1024
922# CONFIG_MAGIC_SYSRQ is not set
923# CONFIG_UNUSED_SYMBOLS is not set
924CONFIG_DEBUG_FS=y
925# CONFIG_HEADERS_CHECK is not set
926CONFIG_DEBUG_KERNEL=y
927CONFIG_DEBUG_SHIRQ=y
928CONFIG_DETECT_SOFTLOCKUP=y
929# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
930CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
931CONFIG_DETECT_HUNG_TASK=y
932# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
933CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
934# CONFIG_SCHED_DEBUG is not set
935# CONFIG_SCHEDSTATS is not set
936# CONFIG_TIMER_STATS is not set
937CONFIG_DEBUG_OBJECTS=y
938CONFIG_DEBUG_OBJECTS_SELFTEST=y
939CONFIG_DEBUG_OBJECTS_FREE=y
940CONFIG_DEBUG_OBJECTS_TIMERS=y
941CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
942CONFIG_DEBUG_SLAB=y
943CONFIG_DEBUG_SLAB_LEAK=y
944CONFIG_DEBUG_PREEMPT=y
945CONFIG_DEBUG_RT_MUTEXES=y
946CONFIG_DEBUG_PI_LIST=y
947# CONFIG_RT_MUTEX_TESTER is not set
948CONFIG_DEBUG_SPINLOCK=y
949CONFIG_DEBUG_MUTEXES=y
950CONFIG_DEBUG_LOCK_ALLOC=y
951CONFIG_PROVE_LOCKING=y
952CONFIG_LOCKDEP=y
953# CONFIG_LOCK_STAT is not set
954# CONFIG_DEBUG_LOCKDEP is not set
955CONFIG_TRACE_IRQFLAGS=y
956CONFIG_DEBUG_SPINLOCK_SLEEP=y
957# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
958CONFIG_STACKTRACE=y
959CONFIG_DEBUG_KOBJECT=y
960# CONFIG_DEBUG_HIGHMEM is not set
961# CONFIG_DEBUG_BUGVERBOSE is not set
962CONFIG_DEBUG_INFO=y
963# CONFIG_DEBUG_VM is not set
964# CONFIG_DEBUG_WRITECOUNT is not set
965# CONFIG_DEBUG_MEMORY_INIT is not set
966# CONFIG_DEBUG_LIST is not set
967# CONFIG_DEBUG_SG is not set
968# CONFIG_DEBUG_NOTIFIERS is not set
969CONFIG_FRAME_POINTER=y
970# CONFIG_BOOT_PRINTK_DELAY is not set
971# CONFIG_RCU_TORTURE_TEST is not set
972# CONFIG_RCU_CPU_STALL_DETECTOR is not set
973# CONFIG_BACKTRACE_SELF_TEST is not set
974# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
975# CONFIG_FAULT_INJECTION is not set
976# CONFIG_LATENCYTOP is not set
977CONFIG_SYSCTL_SYSCALL_CHECK=y
978# CONFIG_PAGE_POISONING is not set
979CONFIG_NOP_TRACER=y
980CONFIG_HAVE_FUNCTION_TRACER=y
981CONFIG_RING_BUFFER=y
982CONFIG_TRACING=y
983CONFIG_TRACING_SUPPORT=y
984
985#
986# Tracers
987#
988CONFIG_FUNCTION_TRACER=y
989# CONFIG_IRQSOFF_TRACER is not set
990# CONFIG_PREEMPT_TRACER is not set
991# CONFIG_SCHED_TRACER is not set
992CONFIG_CONTEXT_SWITCH_TRACER=y
993# CONFIG_EVENT_TRACER is not set
994CONFIG_BOOT_TRACER=y
995# CONFIG_TRACE_BRANCH_PROFILING is not set
996CONFIG_STACK_TRACER=y
997# CONFIG_KMEMTRACE is not set
998# CONFIG_WORKQUEUE_TRACER is not set
999CONFIG_BLK_DEV_IO_TRACE=y
1000# CONFIG_FTRACE_STARTUP_TEST is not set
1001# CONFIG_DYNAMIC_DEBUG is not set
1002# CONFIG_SAMPLES is not set
1003CONFIG_HAVE_ARCH_KGDB=y
1004# CONFIG_KGDB is not set
1005CONFIG_ARM_UNWIND=y
1006# CONFIG_DEBUG_USER is not set
1007# CONFIG_DEBUG_ERRORS is not set
1008# CONFIG_DEBUG_STACK_USAGE is not set
1009# CONFIG_DEBUG_LL is not set
1010
1011#
1012# Security options
1013#
1014CONFIG_KEYS=y
1015CONFIG_KEYS_DEBUG_PROC_KEYS=y
1016CONFIG_SECURITY=y
1017# CONFIG_SECURITYFS is not set
1018# CONFIG_SECURITY_NETWORK is not set
1019# CONFIG_SECURITY_PATH is not set
1020# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1021CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1022# CONFIG_SECURITY_TOMOYO is not set
1023CONFIG_CRYPTO=y
1024
1025#
1026# Crypto core or helper
1027#
1028# CONFIG_CRYPTO_FIPS is not set
1029CONFIG_CRYPTO_ALGAPI=y
1030CONFIG_CRYPTO_ALGAPI2=y
1031CONFIG_CRYPTO_AEAD2=y
1032CONFIG_CRYPTO_BLKCIPHER=y
1033CONFIG_CRYPTO_BLKCIPHER2=y
1034CONFIG_CRYPTO_HASH=y
1035CONFIG_CRYPTO_HASH2=y
1036CONFIG_CRYPTO_RNG2=y
1037CONFIG_CRYPTO_PCOMP=y
1038CONFIG_CRYPTO_MANAGER=y
1039CONFIG_CRYPTO_MANAGER2=y
1040# CONFIG_CRYPTO_GF128MUL is not set
1041# CONFIG_CRYPTO_NULL is not set
1042CONFIG_CRYPTO_WORKQUEUE=y
1043# CONFIG_CRYPTO_CRYPTD is not set
1044# CONFIG_CRYPTO_AUTHENC is not set
1045CONFIG_CRYPTO_TEST=m
1046
1047#
1048# Authenticated Encryption with Associated Data
1049#
1050# CONFIG_CRYPTO_CCM is not set
1051# CONFIG_CRYPTO_GCM is not set
1052# CONFIG_CRYPTO_SEQIV is not set
1053
1054#
1055# Block modes
1056#
1057CONFIG_CRYPTO_CBC=y
1058# CONFIG_CRYPTO_CTR is not set
1059# CONFIG_CRYPTO_CTS is not set
1060CONFIG_CRYPTO_ECB=y
1061# CONFIG_CRYPTO_LRW is not set
1062# CONFIG_CRYPTO_PCBC is not set
1063# CONFIG_CRYPTO_XTS is not set
1064
1065#
1066# Hash modes
1067#
1068CONFIG_CRYPTO_HMAC=y
1069# CONFIG_CRYPTO_XCBC is not set
1070
1071#
1072# Digest
1073#
1074# CONFIG_CRYPTO_CRC32C is not set
1075# CONFIG_CRYPTO_MD4 is not set
1076CONFIG_CRYPTO_MD5=y
1077# CONFIG_CRYPTO_MICHAEL_MIC is not set
1078# CONFIG_CRYPTO_RMD128 is not set
1079# CONFIG_CRYPTO_RMD160 is not set
1080# CONFIG_CRYPTO_RMD256 is not set
1081# CONFIG_CRYPTO_RMD320 is not set
1082CONFIG_CRYPTO_SHA1=m
1083# CONFIG_CRYPTO_SHA256 is not set
1084# CONFIG_CRYPTO_SHA512 is not set
1085# CONFIG_CRYPTO_TGR192 is not set
1086# CONFIG_CRYPTO_WP512 is not set
1087
1088#
1089# Ciphers
1090#
1091CONFIG_CRYPTO_AES=m
1092# CONFIG_CRYPTO_ANUBIS is not set
1093# CONFIG_CRYPTO_ARC4 is not set
1094# CONFIG_CRYPTO_BLOWFISH is not set
1095# CONFIG_CRYPTO_CAMELLIA is not set
1096# CONFIG_CRYPTO_CAST5 is not set
1097# CONFIG_CRYPTO_CAST6 is not set
1098CONFIG_CRYPTO_DES=y
1099# CONFIG_CRYPTO_FCRYPT is not set
1100# CONFIG_CRYPTO_KHAZAD is not set
1101# CONFIG_CRYPTO_SALSA20 is not set
1102# CONFIG_CRYPTO_SEED is not set
1103# CONFIG_CRYPTO_SERPENT is not set
1104# CONFIG_CRYPTO_TEA is not set
1105# CONFIG_CRYPTO_TWOFISH is not set
1106
1107#
1108# Compression
1109#
1110CONFIG_CRYPTO_DEFLATE=y
1111# CONFIG_CRYPTO_ZLIB is not set
1112CONFIG_CRYPTO_LZO=y
1113
1114#
1115# Random Number Generation
1116#
1117# CONFIG_CRYPTO_ANSI_CPRNG is not set
1118CONFIG_CRYPTO_HW=y
1119CONFIG_BINARY_PRINTF=y
1120
1121#
1122# Library routines
1123#
1124CONFIG_BITREVERSE=y
1125CONFIG_GENERIC_FIND_LAST_BIT=y
1126CONFIG_CRC_CCITT=m
1127CONFIG_CRC16=y
1128# CONFIG_CRC_T10DIF is not set
1129# CONFIG_CRC_ITU_T is not set
1130CONFIG_CRC32=y
1131# CONFIG_CRC7 is not set
1132# CONFIG_LIBCRC32C is not set
1133CONFIG_ZLIB_INFLATE=y
1134CONFIG_ZLIB_DEFLATE=y
1135CONFIG_LZO_COMPRESS=y
1136CONFIG_LZO_DECOMPRESS=y
1137CONFIG_DECOMPRESS_GZIP=y
1138CONFIG_HAS_IOMEM=y
1139CONFIG_HAS_IOPORT=y
1140CONFIG_HAS_DMA=y
1141CONFIG_NLATTR=y
diff --git a/arch/arm/configs/stmp37xx_defconfig b/arch/arm/configs/stmp37xx_defconfig
new file mode 100644
index 000000000000..401279d531d5
--- /dev/null
+++ b/arch/arm/configs/stmp37xx_defconfig
@@ -0,0 +1,1002 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29.1
4# Mon Apr 20 04:41:26 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION="-default"
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41CONFIG_POSIX_MQUEUE=y
42CONFIG_BSD_PROCESS_ACCT=y
43# CONFIG_BSD_PROCESS_ACCT_V3 is not set
44# CONFIG_TASKSTATS is not set
45# CONFIG_AUDIT is not set
46
47#
48# RCU Subsystem
49#
50CONFIG_CLASSIC_RCU=y
51# CONFIG_TREE_RCU is not set
52# CONFIG_PREEMPT_RCU is not set
53# CONFIG_TREE_RCU_TRACE is not set
54# CONFIG_PREEMPT_RCU_TRACE is not set
55# CONFIG_IKCONFIG is not set
56CONFIG_LOG_BUF_SHIFT=17
57# CONFIG_GROUP_SCHED is not set
58# CONFIG_CGROUPS is not set
59CONFIG_SYSFS_DEPRECATED=y
60CONFIG_SYSFS_DEPRECATED_V2=y
61CONFIG_RELAY=y
62# CONFIG_NAMESPACES is not set
63CONFIG_BLK_DEV_INITRD=y
64CONFIG_INITRAMFS_SOURCE=""
65CONFIG_INITRAMFS_ROOT_UID=0
66CONFIG_INITRAMFS_ROOT_GID=0
67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
68CONFIG_SYSCTL=y
69CONFIG_ANON_INODES=y
70CONFIG_EMBEDDED=y
71CONFIG_UID16=y
72CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y
74# CONFIG_KALLSYMS_ALL is not set
75# CONFIG_KALLSYMS_EXTRA_PASS is not set
76CONFIG_HOTPLUG=y
77CONFIG_PRINTK=y
78CONFIG_BUG=y
79CONFIG_ELF_CORE=y
80CONFIG_BASE_FULL=y
81CONFIG_FUTEX=y
82CONFIG_EPOLL=y
83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y
86CONFIG_SHMEM=y
87CONFIG_AIO=y
88CONFIG_VM_EVENT_COUNTERS=y
89CONFIG_COMPAT_BRK=y
90CONFIG_SLAB=y
91# CONFIG_SLUB is not set
92# CONFIG_SLOB is not set
93# CONFIG_PROFILING is not set
94CONFIG_TRACEPOINTS=y
95CONFIG_MARKERS=y
96CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y
103CONFIG_RT_MUTEXES=y
104CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y
106# CONFIG_MODULE_FORCE_LOAD is not set
107CONFIG_MODULE_UNLOAD=y
108CONFIG_MODULE_FORCE_UNLOAD=y
109CONFIG_MODVERSIONS=y
110CONFIG_MODULE_SRCVERSION_ALL=y
111CONFIG_BLOCK=y
112CONFIG_LBD=y
113CONFIG_BLK_DEV_IO_TRACE=y
114# CONFIG_BLK_DEV_BSG is not set
115# CONFIG_BLK_DEV_INTEGRITY is not set
116
117#
118# IO Schedulers
119#
120CONFIG_IOSCHED_NOOP=y
121CONFIG_IOSCHED_AS=y
122CONFIG_IOSCHED_DEADLINE=y
123CONFIG_IOSCHED_CFQ=y
124# CONFIG_DEFAULT_AS is not set
125# CONFIG_DEFAULT_DEADLINE is not set
126CONFIG_DEFAULT_CFQ=y
127# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="cfq"
129# CONFIG_FREEZER is not set
130
131#
132# System Type
133#
134# CONFIG_ARCH_AAEC2000 is not set
135# CONFIG_ARCH_INTEGRATOR is not set
136# CONFIG_ARCH_REALVIEW is not set
137# CONFIG_ARCH_VERSATILE is not set
138# CONFIG_ARCH_AT91 is not set
139# CONFIG_ARCH_CLPS711X is not set
140# CONFIG_ARCH_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set
143# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set
149# CONFIG_ARCH_IXP23XX is not set
150# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set
160# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_RPC is not set
163# CONFIG_ARCH_SA1100 is not set
164# CONFIG_ARCH_S3C2410 is not set
165# CONFIG_ARCH_S3C64XX is not set
166# CONFIG_ARCH_SHARK is not set
167# CONFIG_ARCH_LH7A40X is not set
168# CONFIG_ARCH_DAVINCI is not set
169# CONFIG_ARCH_OMAP is not set
170# CONFIG_ARCH_MSM is not set
171# CONFIG_ARCH_W90X900 is not set
172CONFIG_ARCH_STMP3XXX=y
173
174#
175# Freescale STMP3xxx implementations
176#
177CONFIG_ARCH_STMP37XX=y
178# CONFIG_ARCH_STMP378X is not set
179CONFIG_MACH_STMP37XX=y
180# CONFIG_MACH_STMP378X is not set
181
182#
183# Processor Type
184#
185CONFIG_CPU_32=y
186CONFIG_CPU_ARM926T=y
187CONFIG_CPU_32v5=y
188CONFIG_CPU_ABRT_EV5TJ=y
189CONFIG_CPU_PABRT_NOIFAR=y
190CONFIG_CPU_CACHE_VIVT=y
191CONFIG_CPU_COPY_V4WB=y
192CONFIG_CPU_TLB_V4WBI=y
193CONFIG_CPU_CP15=y
194CONFIG_CPU_CP15_MMU=y
195
196#
197# Processor Features
198#
199CONFIG_ARM_THUMB=y
200# CONFIG_CPU_ICACHE_DISABLE is not set
201# CONFIG_CPU_DCACHE_DISABLE is not set
202# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
203# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
204# CONFIG_OUTER_CACHE is not set
205CONFIG_COMMON_CLKDEV=y
206
207#
208# Bus support
209#
210# CONFIG_PCI_SYSCALL is not set
211# CONFIG_ARCH_SUPPORTS_MSI is not set
212# CONFIG_PCCARD is not set
213
214#
215# Kernel Features
216#
217CONFIG_TICK_ONESHOT=y
218CONFIG_NO_HZ=y
219CONFIG_HIGH_RES_TIMERS=y
220CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
221CONFIG_VMSPLIT_3G=y
222# CONFIG_VMSPLIT_2G is not set
223# CONFIG_VMSPLIT_1G is not set
224CONFIG_PAGE_OFFSET=0xC0000000
225CONFIG_PREEMPT=y
226CONFIG_HZ=100
227CONFIG_AEABI=y
228CONFIG_OABI_COMPAT=y
229CONFIG_ARCH_FLATMEM_HAS_HOLES=y
230# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
231# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
232CONFIG_SELECT_MEMORY_MODEL=y
233CONFIG_FLATMEM_MANUAL=y
234# CONFIG_DISCONTIGMEM_MANUAL is not set
235# CONFIG_SPARSEMEM_MANUAL is not set
236CONFIG_FLATMEM=y
237CONFIG_FLAT_NODE_MEM_MAP=y
238CONFIG_PAGEFLAGS_EXTENDED=y
239CONFIG_SPLIT_PTLOCK_CPUS=4096
240# CONFIG_PHYS_ADDR_T_64BIT is not set
241CONFIG_ZONE_DMA_FLAG=0
242CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y
244CONFIG_ALIGNMENT_TRAP=y
245
246#
247# Boot options
248#
249CONFIG_ZBOOT_ROM_TEXT=0x0
250CONFIG_ZBOOT_ROM_BSS=0x0
251CONFIG_CMDLINE="console=ttySDBG0,115200 mem=32M lcd_panel=lms350 rdinit=/bin/sh ignore_loglevel"
252# CONFIG_XIP_KERNEL is not set
253# CONFIG_KEXEC is not set
254
255#
256# CPU Power Management
257#
258# CONFIG_CPU_IDLE is not set
259
260#
261# Floating point emulation
262#
263
264#
265# At least one emulation must be selected
266#
267# CONFIG_FPE_NWFPE is not set
268# CONFIG_FPE_FASTFPE is not set
269# CONFIG_VFP is not set
270
271#
272# Userspace binary formats
273#
274CONFIG_BINFMT_ELF=y
275# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
276CONFIG_HAVE_AOUT=y
277# CONFIG_BINFMT_AOUT is not set
278# CONFIG_BINFMT_MISC is not set
279
280#
281# Power management options
282#
283# CONFIG_PM is not set
284CONFIG_ARCH_SUSPEND_POSSIBLE=y
285CONFIG_NET=y
286
287#
288# Networking options
289#
290CONFIG_COMPAT_NET_DEV_OPS=y
291CONFIG_PACKET=y
292CONFIG_PACKET_MMAP=y
293CONFIG_UNIX=y
294CONFIG_XFRM=y
295# CONFIG_XFRM_USER is not set
296# CONFIG_XFRM_SUB_POLICY is not set
297# CONFIG_XFRM_MIGRATE is not set
298# CONFIG_XFRM_STATISTICS is not set
299# CONFIG_NET_KEY is not set
300CONFIG_INET=y
301CONFIG_IP_MULTICAST=y
302CONFIG_IP_ADVANCED_ROUTER=y
303CONFIG_ASK_IP_FIB_HASH=y
304# CONFIG_IP_FIB_TRIE is not set
305CONFIG_IP_FIB_HASH=y
306CONFIG_IP_MULTIPLE_TABLES=y
307CONFIG_IP_ROUTE_MULTIPATH=y
308CONFIG_IP_ROUTE_VERBOSE=y
309CONFIG_IP_PNP=y
310CONFIG_IP_PNP_DHCP=y
311CONFIG_IP_PNP_BOOTP=y
312# CONFIG_IP_PNP_RARP is not set
313# CONFIG_NET_IPIP is not set
314# CONFIG_NET_IPGRE is not set
315CONFIG_IP_MROUTE=y
316CONFIG_IP_PIMSM_V1=y
317CONFIG_IP_PIMSM_V2=y
318# CONFIG_ARPD is not set
319CONFIG_SYN_COOKIES=y
320# CONFIG_INET_AH is not set
321# CONFIG_INET_ESP is not set
322# CONFIG_INET_IPCOMP is not set
323# CONFIG_INET_XFRM_TUNNEL is not set
324# CONFIG_INET_TUNNEL is not set
325CONFIG_INET_XFRM_MODE_TRANSPORT=y
326CONFIG_INET_XFRM_MODE_TUNNEL=y
327CONFIG_INET_XFRM_MODE_BEET=y
328# CONFIG_INET_LRO is not set
329CONFIG_INET_DIAG=y
330CONFIG_INET_TCP_DIAG=y
331# CONFIG_TCP_CONG_ADVANCED is not set
332CONFIG_TCP_CONG_CUBIC=y
333CONFIG_DEFAULT_TCP_CONG="cubic"
334# CONFIG_TCP_MD5SIG is not set
335# CONFIG_IPV6 is not set
336# CONFIG_NETLABEL is not set
337# CONFIG_NETWORK_SECMARK is not set
338# CONFIG_NETFILTER is not set
339# CONFIG_IP_DCCP is not set
340# CONFIG_IP_SCTP is not set
341# CONFIG_TIPC is not set
342# CONFIG_ATM is not set
343# CONFIG_BRIDGE is not set
344# CONFIG_NET_DSA is not set
345# CONFIG_VLAN_8021Q is not set
346# CONFIG_DECNET is not set
347# CONFIG_LLC2 is not set
348# CONFIG_IPX is not set
349# CONFIG_ATALK is not set
350# CONFIG_X25 is not set
351# CONFIG_LAPB is not set
352# CONFIG_ECONET is not set
353# CONFIG_WAN_ROUTER is not set
354CONFIG_NET_SCHED=y
355
356#
357# Queueing/Scheduling
358#
359# CONFIG_NET_SCH_CBQ is not set
360# CONFIG_NET_SCH_HTB is not set
361# CONFIG_NET_SCH_HFSC is not set
362# CONFIG_NET_SCH_PRIO is not set
363# CONFIG_NET_SCH_MULTIQ is not set
364# CONFIG_NET_SCH_RED is not set
365# CONFIG_NET_SCH_SFQ is not set
366# CONFIG_NET_SCH_TEQL is not set
367# CONFIG_NET_SCH_TBF is not set
368# CONFIG_NET_SCH_GRED is not set
369# CONFIG_NET_SCH_DSMARK is not set
370# CONFIG_NET_SCH_NETEM is not set
371# CONFIG_NET_SCH_DRR is not set
372
373#
374# Classification
375#
376# CONFIG_NET_CLS_BASIC is not set
377# CONFIG_NET_CLS_TCINDEX is not set
378# CONFIG_NET_CLS_ROUTE4 is not set
379# CONFIG_NET_CLS_FW is not set
380# CONFIG_NET_CLS_U32 is not set
381# CONFIG_NET_CLS_RSVP is not set
382# CONFIG_NET_CLS_RSVP6 is not set
383# CONFIG_NET_CLS_FLOW is not set
384# CONFIG_NET_EMATCH is not set
385# CONFIG_NET_CLS_ACT is not set
386CONFIG_NET_SCH_FIFO=y
387# CONFIG_DCB is not set
388
389#
390# Network testing
391#
392# CONFIG_NET_PKTGEN is not set
393# CONFIG_HAMRADIO is not set
394# CONFIG_CAN is not set
395# CONFIG_IRDA is not set
396# CONFIG_BT is not set
397# CONFIG_AF_RXRPC is not set
398# CONFIG_PHONET is not set
399CONFIG_FIB_RULES=y
400# CONFIG_WIRELESS is not set
401# CONFIG_WIMAX is not set
402# CONFIG_RFKILL is not set
403# CONFIG_NET_9P is not set
404
405#
406# Device Drivers
407#
408
409#
410# Generic Driver Options
411#
412CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
413# CONFIG_STANDALONE is not set
414CONFIG_PREVENT_FIRMWARE_BUILD=y
415CONFIG_FW_LOADER=y
416CONFIG_FIRMWARE_IN_KERNEL=y
417CONFIG_EXTRA_FIRMWARE=""
418# CONFIG_DEBUG_DRIVER is not set
419# CONFIG_DEBUG_DEVRES is not set
420# CONFIG_SYS_HYPERVISOR is not set
421# CONFIG_CONNECTOR is not set
422# CONFIG_MTD is not set
423# CONFIG_PARPORT is not set
424CONFIG_BLK_DEV=y
425# CONFIG_BLK_DEV_COW_COMMON is not set
426CONFIG_BLK_DEV_LOOP=y
427CONFIG_BLK_DEV_CRYPTOLOOP=y
428# CONFIG_BLK_DEV_NBD is not set
429CONFIG_BLK_DEV_RAM=y
430CONFIG_BLK_DEV_RAM_COUNT=4
431CONFIG_BLK_DEV_RAM_SIZE=6144
432# CONFIG_BLK_DEV_XIP is not set
433# CONFIG_CDROM_PKTCDVD is not set
434# CONFIG_ATA_OVER_ETH is not set
435# CONFIG_MISC_DEVICES is not set
436CONFIG_HAVE_IDE=y
437# CONFIG_IDE is not set
438
439#
440# SCSI device support
441#
442# CONFIG_RAID_ATTRS is not set
443CONFIG_SCSI=y
444CONFIG_SCSI_DMA=y
445# CONFIG_SCSI_TGT is not set
446# CONFIG_SCSI_NETLINK is not set
447CONFIG_SCSI_PROC_FS=y
448
449#
450# SCSI support type (disk, tape, CD-ROM)
451#
452CONFIG_BLK_DEV_SD=y
453# CONFIG_CHR_DEV_ST is not set
454# CONFIG_CHR_DEV_OSST is not set
455# CONFIG_BLK_DEV_SR is not set
456CONFIG_CHR_DEV_SG=y
457# CONFIG_CHR_DEV_SCH is not set
458
459#
460# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
461#
462# CONFIG_SCSI_MULTI_LUN is not set
463# CONFIG_SCSI_CONSTANTS is not set
464# CONFIG_SCSI_LOGGING is not set
465# CONFIG_SCSI_SCAN_ASYNC is not set
466CONFIG_SCSI_WAIT_SCAN=m
467
468#
469# SCSI Transports
470#
471# CONFIG_SCSI_SPI_ATTRS is not set
472# CONFIG_SCSI_FC_ATTRS is not set
473# CONFIG_SCSI_ISCSI_ATTRS is not set
474# CONFIG_SCSI_SAS_LIBSAS is not set
475# CONFIG_SCSI_SRP_ATTRS is not set
476# CONFIG_SCSI_LOWLEVEL is not set
477# CONFIG_SCSI_DH is not set
478# CONFIG_ATA is not set
479# CONFIG_MD is not set
480# CONFIG_NETDEVICES is not set
481# CONFIG_ISDN is not set
482
483#
484# Input device support
485#
486CONFIG_INPUT=y
487# CONFIG_INPUT_FF_MEMLESS is not set
488CONFIG_INPUT_POLLDEV=y
489
490#
491# Userland interfaces
492#
493CONFIG_INPUT_MOUSEDEV=y
494CONFIG_INPUT_MOUSEDEV_PSAUX=y
495CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
496CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
497# CONFIG_INPUT_JOYDEV is not set
498CONFIG_INPUT_EVDEV=y
499# CONFIG_INPUT_EVBUG is not set
500
501#
502# Input Device Drivers
503#
504CONFIG_INPUT_KEYBOARD=y
505# CONFIG_KEYBOARD_ATKBD is not set
506# CONFIG_KEYBOARD_SUNKBD is not set
507# CONFIG_KEYBOARD_LKKBD is not set
508# CONFIG_KEYBOARD_XTKBD is not set
509# CONFIG_KEYBOARD_NEWTON is not set
510# CONFIG_KEYBOARD_STOWAWAY is not set
511# CONFIG_KEYBOARD_GPIO is not set
512# CONFIG_INPUT_MOUSE is not set
513# CONFIG_INPUT_JOYSTICK is not set
514# CONFIG_INPUT_TABLET is not set
515CONFIG_INPUT_TOUCHSCREEN=y
516# CONFIG_TOUCHSCREEN_FUJITSU is not set
517# CONFIG_TOUCHSCREEN_GUNZE is not set
518# CONFIG_TOUCHSCREEN_ELO is not set
519# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
520# CONFIG_TOUCHSCREEN_MTOUCH is not set
521# CONFIG_TOUCHSCREEN_INEXIO is not set
522# CONFIG_TOUCHSCREEN_MK712 is not set
523# CONFIG_TOUCHSCREEN_PENMOUNT is not set
524# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
525# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
526# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
527CONFIG_INPUT_MISC=y
528# CONFIG_INPUT_UINPUT is not set
529
530#
531# Hardware I/O ports
532#
533CONFIG_SERIO=y
534# CONFIG_SERIO_SERPORT is not set
535# CONFIG_SERIO_LIBPS2 is not set
536# CONFIG_SERIO_RAW is not set
537# CONFIG_GAMEPORT is not set
538
539#
540# Character devices
541#
542CONFIG_VT=y
543CONFIG_CONSOLE_TRANSLATIONS=y
544CONFIG_VT_CONSOLE=y
545CONFIG_HW_CONSOLE=y
546CONFIG_VT_HW_CONSOLE_BINDING=y
547CONFIG_DEVKMEM=y
548# CONFIG_SERIAL_NONSTANDARD is not set
549
550#
551# Serial drivers
552#
553# CONFIG_SERIAL_8250 is not set
554
555#
556# Non-8250 serial port support
557#
558# CONFIG_SERIAL_STMP_DBG is not set
559CONFIG_UNIX98_PTYS=y
560# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
561# CONFIG_LEGACY_PTYS is not set
562# CONFIG_IPMI_HANDLER is not set
563CONFIG_HW_RANDOM=y
564# CONFIG_R3964 is not set
565# CONFIG_RAW_DRIVER is not set
566# CONFIG_TCG_TPM is not set
567# CONFIG_I2C is not set
568# CONFIG_SPI is not set
569CONFIG_ARCH_REQUIRE_GPIOLIB=y
570CONFIG_GPIOLIB=y
571CONFIG_DEBUG_GPIO=y
572CONFIG_GPIO_SYSFS=y
573
574#
575# Memory mapped GPIO expanders:
576#
577
578#
579# I2C GPIO expanders:
580#
581
582#
583# PCI GPIO expanders:
584#
585
586#
587# SPI GPIO expanders:
588#
589# CONFIG_W1 is not set
590# CONFIG_POWER_SUPPLY is not set
591# CONFIG_HWMON is not set
592# CONFIG_THERMAL is not set
593# CONFIG_THERMAL_HWMON is not set
594# CONFIG_WATCHDOG is not set
595CONFIG_SSB_POSSIBLE=y
596
597#
598# Sonics Silicon Backplane
599#
600# CONFIG_SSB is not set
601
602#
603# Multifunction device drivers
604#
605# CONFIG_MFD_CORE is not set
606# CONFIG_MFD_SM501 is not set
607# CONFIG_MFD_ASIC3 is not set
608# CONFIG_HTC_EGPIO is not set
609# CONFIG_HTC_PASIC3 is not set
610# CONFIG_MFD_TMIO is not set
611# CONFIG_MFD_T7L66XB is not set
612# CONFIG_MFD_TC6387XB is not set
613# CONFIG_MFD_TC6393XB is not set
614
615#
616# Multimedia devices
617#
618
619#
620# Multimedia core support
621#
622CONFIG_VIDEO_DEV=y
623CONFIG_VIDEO_V4L2_COMMON=y
624# CONFIG_VIDEO_ALLOW_V4L1 is not set
625# CONFIG_VIDEO_V4L1_COMPAT is not set
626# CONFIG_DVB_CORE is not set
627CONFIG_VIDEO_MEDIA=y
628
629#
630# Multimedia drivers
631#
632# CONFIG_MEDIA_ATTACH is not set
633CONFIG_VIDEO_V4L2=y
634CONFIG_VIDEO_CAPTURE_DRIVERS=y
635# CONFIG_VIDEO_ADV_DEBUG is not set
636# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
637# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
638
639#
640# Encoders/decoders and other helper chips
641#
642
643#
644# Audio decoders
645#
646
647#
648# Video decoders
649#
650
651#
652# Video and audio decoders
653#
654
655#
656# MPEG video encoders
657#
658# CONFIG_VIDEO_CX2341X is not set
659
660#
661# Video encoders
662#
663
664#
665# Video improvement chips
666#
667# CONFIG_VIDEO_VIVI is not set
668# CONFIG_SOC_CAMERA is not set
669# CONFIG_RADIO_ADAPTERS is not set
670# CONFIG_DAB is not set
671
672#
673# Graphics support
674#
675# CONFIG_VGASTATE is not set
676# CONFIG_VIDEO_OUTPUT_CONTROL is not set
677CONFIG_FB=y
678# CONFIG_FIRMWARE_EDID is not set
679# CONFIG_FB_DDC is not set
680# CONFIG_FB_BOOT_VESA_SUPPORT is not set
681# CONFIG_FB_CFB_FILLRECT is not set
682# CONFIG_FB_CFB_COPYAREA is not set
683# CONFIG_FB_CFB_IMAGEBLIT is not set
684# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
685# CONFIG_FB_SYS_FILLRECT is not set
686# CONFIG_FB_SYS_COPYAREA is not set
687# CONFIG_FB_SYS_IMAGEBLIT is not set
688# CONFIG_FB_FOREIGN_ENDIAN is not set
689# CONFIG_FB_SYS_FOPS is not set
690# CONFIG_FB_SVGALIB is not set
691# CONFIG_FB_MACMODES is not set
692# CONFIG_FB_BACKLIGHT is not set
693# CONFIG_FB_MODE_HELPERS is not set
694# CONFIG_FB_TILEBLITTING is not set
695
696#
697# Frame buffer hardware drivers
698#
699# CONFIG_FB_S1D13XXX is not set
700# CONFIG_FB_VIRTUAL is not set
701# CONFIG_FB_METRONOME is not set
702# CONFIG_FB_MB862XX is not set
703CONFIG_BACKLIGHT_LCD_SUPPORT=y
704CONFIG_LCD_CLASS_DEVICE=y
705# CONFIG_LCD_ILI9320 is not set
706# CONFIG_LCD_PLATFORM is not set
707CONFIG_BACKLIGHT_CLASS_DEVICE=y
708CONFIG_BACKLIGHT_GENERIC=y
709
710#
711# Display device support
712#
713# CONFIG_DISPLAY_SUPPORT is not set
714
715#
716# Console display driver support
717#
718# CONFIG_VGA_CONSOLE is not set
719CONFIG_DUMMY_CONSOLE=y
720CONFIG_FRAMEBUFFER_CONSOLE=y
721# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
722# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
723# CONFIG_FONTS is not set
724CONFIG_FONT_8x8=y
725CONFIG_FONT_8x16=y
726CONFIG_LOGO=y
727CONFIG_LOGO_LINUX_MONO=y
728CONFIG_LOGO_LINUX_VGA16=y
729CONFIG_LOGO_LINUX_CLUT224=y
730# CONFIG_SOUND is not set
731# CONFIG_HID_SUPPORT is not set
732# CONFIG_USB_SUPPORT is not set
733CONFIG_USB_ARCH_HAS_EHCI=y
734# CONFIG_MMC is not set
735# CONFIG_MEMSTICK is not set
736# CONFIG_ACCESSIBILITY is not set
737# CONFIG_NEW_LEDS is not set
738CONFIG_RTC_LIB=y
739# CONFIG_RTC_CLASS is not set
740# CONFIG_DMADEVICES is not set
741# CONFIG_REGULATOR is not set
742# CONFIG_UIO is not set
743# CONFIG_STAGING is not set
744
745#
746# File systems
747#
748# CONFIG_EXT2_FS is not set
749# CONFIG_EXT3_FS is not set
750# CONFIG_EXT4_FS is not set
751# CONFIG_REISERFS_FS is not set
752# CONFIG_JFS_FS is not set
753# CONFIG_FS_POSIX_ACL is not set
754CONFIG_FILE_LOCKING=y
755# CONFIG_XFS_FS is not set
756# CONFIG_GFS2_FS is not set
757# CONFIG_OCFS2_FS is not set
758# CONFIG_BTRFS_FS is not set
759# CONFIG_DNOTIFY is not set
760# CONFIG_INOTIFY is not set
761# CONFIG_QUOTA is not set
762# CONFIG_AUTOFS_FS is not set
763# CONFIG_AUTOFS4_FS is not set
764# CONFIG_FUSE_FS is not set
765
766#
767# CD-ROM/DVD Filesystems
768#
769# CONFIG_ISO9660_FS is not set
770# CONFIG_UDF_FS is not set
771
772#
773# DOS/FAT/NT Filesystems
774#
775# CONFIG_MSDOS_FS is not set
776# CONFIG_VFAT_FS is not set
777# CONFIG_NTFS_FS is not set
778
779#
780# Pseudo filesystems
781#
782CONFIG_PROC_FS=y
783CONFIG_PROC_SYSCTL=y
784CONFIG_PROC_PAGE_MONITOR=y
785CONFIG_SYSFS=y
786CONFIG_TMPFS=y
787# CONFIG_TMPFS_POSIX_ACL is not set
788# CONFIG_HUGETLB_PAGE is not set
789CONFIG_CONFIGFS_FS=m
790# CONFIG_MISC_FILESYSTEMS is not set
791# CONFIG_NETWORK_FILESYSTEMS is not set
792
793#
794# Partition Types
795#
796# CONFIG_PARTITION_ADVANCED is not set
797CONFIG_MSDOS_PARTITION=y
798# CONFIG_NLS is not set
799# CONFIG_DLM is not set
800
801#
802# Kernel hacking
803#
804# CONFIG_PRINTK_TIME is not set
805CONFIG_ENABLE_WARN_DEPRECATED=y
806# CONFIG_ENABLE_MUST_CHECK is not set
807CONFIG_FRAME_WARN=1024
808# CONFIG_MAGIC_SYSRQ is not set
809# CONFIG_UNUSED_SYMBOLS is not set
810CONFIG_DEBUG_FS=y
811# CONFIG_HEADERS_CHECK is not set
812CONFIG_DEBUG_SECTION_MISMATCH=y
813CONFIG_DEBUG_KERNEL=y
814# CONFIG_DEBUG_SHIRQ is not set
815CONFIG_DETECT_SOFTLOCKUP=y
816# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
817CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
818CONFIG_SCHED_DEBUG=y
819# CONFIG_SCHEDSTATS is not set
820# CONFIG_TIMER_STATS is not set
821# CONFIG_DEBUG_OBJECTS is not set
822# CONFIG_DEBUG_SLAB is not set
823CONFIG_DEBUG_PREEMPT=y
824# CONFIG_DEBUG_RT_MUTEXES is not set
825# CONFIG_RT_MUTEX_TESTER is not set
826# CONFIG_DEBUG_SPINLOCK is not set
827# CONFIG_DEBUG_MUTEXES is not set
828# CONFIG_DEBUG_LOCK_ALLOC is not set
829# CONFIG_PROVE_LOCKING is not set
830# CONFIG_LOCK_STAT is not set
831# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
832# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
833CONFIG_STACKTRACE=y
834# CONFIG_DEBUG_KOBJECT is not set
835# CONFIG_DEBUG_BUGVERBOSE is not set
836# CONFIG_DEBUG_INFO is not set
837# CONFIG_DEBUG_VM is not set
838# CONFIG_DEBUG_WRITECOUNT is not set
839# CONFIG_DEBUG_MEMORY_INIT is not set
840# CONFIG_DEBUG_LIST is not set
841# CONFIG_DEBUG_SG is not set
842# CONFIG_DEBUG_NOTIFIERS is not set
843CONFIG_FRAME_POINTER=y
844# CONFIG_BOOT_PRINTK_DELAY is not set
845# CONFIG_RCU_TORTURE_TEST is not set
846# CONFIG_RCU_CPU_STALL_DETECTOR is not set
847# CONFIG_BACKTRACE_SELF_TEST is not set
848# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
849# CONFIG_FAULT_INJECTION is not set
850# CONFIG_LATENCYTOP is not set
851CONFIG_SYSCTL_SYSCALL_CHECK=y
852CONFIG_NOP_TRACER=y
853CONFIG_HAVE_FUNCTION_TRACER=y
854CONFIG_RING_BUFFER=y
855CONFIG_TRACING=y
856
857#
858# Tracers
859#
860CONFIG_FUNCTION_TRACER=y
861# CONFIG_IRQSOFF_TRACER is not set
862# CONFIG_PREEMPT_TRACER is not set
863# CONFIG_SCHED_TRACER is not set
864CONFIG_CONTEXT_SWITCH_TRACER=y
865CONFIG_BOOT_TRACER=y
866# CONFIG_TRACE_BRANCH_PROFILING is not set
867CONFIG_STACK_TRACER=y
868# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
869# CONFIG_SAMPLES is not set
870CONFIG_HAVE_ARCH_KGDB=y
871# CONFIG_KGDB is not set
872# CONFIG_DEBUG_USER is not set
873# CONFIG_DEBUG_ERRORS is not set
874# CONFIG_DEBUG_STACK_USAGE is not set
875CONFIG_DEBUG_LL=y
876# CONFIG_DEBUG_ICEDCC is not set
877
878#
879# Security options
880#
881CONFIG_KEYS=y
882CONFIG_KEYS_DEBUG_PROC_KEYS=y
883CONFIG_SECURITY=y
884# CONFIG_SECURITYFS is not set
885# CONFIG_SECURITY_NETWORK is not set
886# CONFIG_SECURITY_PATH is not set
887# CONFIG_SECURITY_FILE_CAPABILITIES is not set
888CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
889CONFIG_CRYPTO=y
890
891#
892# Crypto core or helper
893#
894# CONFIG_CRYPTO_FIPS is not set
895CONFIG_CRYPTO_ALGAPI=y
896CONFIG_CRYPTO_ALGAPI2=y
897CONFIG_CRYPTO_AEAD2=y
898CONFIG_CRYPTO_BLKCIPHER=y
899CONFIG_CRYPTO_BLKCIPHER2=y
900CONFIG_CRYPTO_HASH=y
901CONFIG_CRYPTO_HASH2=y
902CONFIG_CRYPTO_RNG2=y
903CONFIG_CRYPTO_MANAGER=y
904CONFIG_CRYPTO_MANAGER2=y
905# CONFIG_CRYPTO_GF128MUL is not set
906# CONFIG_CRYPTO_NULL is not set
907# CONFIG_CRYPTO_CRYPTD is not set
908# CONFIG_CRYPTO_AUTHENC is not set
909CONFIG_CRYPTO_TEST=m
910
911#
912# Authenticated Encryption with Associated Data
913#
914# CONFIG_CRYPTO_CCM is not set
915# CONFIG_CRYPTO_GCM is not set
916# CONFIG_CRYPTO_SEQIV is not set
917
918#
919# Block modes
920#
921CONFIG_CRYPTO_CBC=y
922# CONFIG_CRYPTO_CTR is not set
923# CONFIG_CRYPTO_CTS is not set
924CONFIG_CRYPTO_ECB=y
925# CONFIG_CRYPTO_LRW is not set
926# CONFIG_CRYPTO_PCBC is not set
927# CONFIG_CRYPTO_XTS is not set
928
929#
930# Hash modes
931#
932CONFIG_CRYPTO_HMAC=y
933# CONFIG_CRYPTO_XCBC is not set
934
935#
936# Digest
937#
938# CONFIG_CRYPTO_CRC32C is not set
939# CONFIG_CRYPTO_MD4 is not set
940CONFIG_CRYPTO_MD5=y
941# CONFIG_CRYPTO_MICHAEL_MIC is not set
942# CONFIG_CRYPTO_RMD128 is not set
943# CONFIG_CRYPTO_RMD160 is not set
944# CONFIG_CRYPTO_RMD256 is not set
945# CONFIG_CRYPTO_RMD320 is not set
946CONFIG_CRYPTO_SHA1=m
947# CONFIG_CRYPTO_SHA256 is not set
948# CONFIG_CRYPTO_SHA512 is not set
949# CONFIG_CRYPTO_TGR192 is not set
950# CONFIG_CRYPTO_WP512 is not set
951
952#
953# Ciphers
954#
955CONFIG_CRYPTO_AES=m
956# CONFIG_CRYPTO_ANUBIS is not set
957# CONFIG_CRYPTO_ARC4 is not set
958# CONFIG_CRYPTO_BLOWFISH is not set
959# CONFIG_CRYPTO_CAMELLIA is not set
960# CONFIG_CRYPTO_CAST5 is not set
961# CONFIG_CRYPTO_CAST6 is not set
962CONFIG_CRYPTO_DES=y
963# CONFIG_CRYPTO_FCRYPT is not set
964# CONFIG_CRYPTO_KHAZAD is not set
965# CONFIG_CRYPTO_SALSA20 is not set
966# CONFIG_CRYPTO_SEED is not set
967# CONFIG_CRYPTO_SERPENT is not set
968# CONFIG_CRYPTO_TEA is not set
969# CONFIG_CRYPTO_TWOFISH is not set
970
971#
972# Compression
973#
974CONFIG_CRYPTO_DEFLATE=y
975CONFIG_CRYPTO_LZO=y
976
977#
978# Random Number Generation
979#
980# CONFIG_CRYPTO_ANSI_CPRNG is not set
981CONFIG_CRYPTO_HW=y
982
983#
984# Library routines
985#
986CONFIG_BITREVERSE=y
987CONFIG_GENERIC_FIND_LAST_BIT=y
988CONFIG_CRC_CCITT=m
989CONFIG_CRC16=y
990# CONFIG_CRC_T10DIF is not set
991# CONFIG_CRC_ITU_T is not set
992CONFIG_CRC32=y
993# CONFIG_CRC7 is not set
994# CONFIG_LIBCRC32C is not set
995CONFIG_ZLIB_INFLATE=y
996CONFIG_ZLIB_DEFLATE=y
997CONFIG_LZO_COMPRESS=y
998CONFIG_LZO_DECOMPRESS=y
999CONFIG_PLIST=y
1000CONFIG_HAS_IOMEM=y
1001CONFIG_HAS_IOPORT=y
1002CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig
new file mode 100644
index 000000000000..2d827e121147
--- /dev/null
+++ b/arch/arm/configs/u300_defconfig
@@ -0,0 +1,1115 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc6
4# Mon Jun 1 09:18:22 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37# CONFIG_LOCALVERSION_AUTO is not set
38# CONFIG_SWAP is not set
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set
42# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=14
56# CONFIG_GROUP_SCHED is not set
57# CONFIG_CGROUPS is not set
58# CONFIG_SYSFS_DEPRECATED_V2 is not set
59# CONFIG_RELAY is not set
60# CONFIG_NAMESPACES is not set
61# CONFIG_BLK_DEV_INITRD is not set
62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
63CONFIG_SYSCTL=y
64CONFIG_ANON_INODES=y
65CONFIG_EMBEDDED=y
66CONFIG_UID16=y
67CONFIG_SYSCTL_SYSCALL=y
68CONFIG_KALLSYMS=y
69# CONFIG_KALLSYMS_ALL is not set
70# CONFIG_KALLSYMS_EXTRA_PASS is not set
71# CONFIG_STRIP_ASM_SYMS is not set
72CONFIG_HOTPLUG=y
73CONFIG_PRINTK=y
74CONFIG_BUG=y
75CONFIG_ELF_CORE=y
76CONFIG_BASE_FULL=y
77CONFIG_FUTEX=y
78CONFIG_EPOLL=y
79CONFIG_SIGNALFD=y
80CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y
82CONFIG_SHMEM=y
83# CONFIG_AIO is not set
84# CONFIG_VM_EVENT_COUNTERS is not set
85CONFIG_SLUB_DEBUG=y
86CONFIG_COMPAT_BRK=y
87# CONFIG_SLAB is not set
88CONFIG_SLUB=y
89# CONFIG_SLOB is not set
90# CONFIG_PROFILING is not set
91# CONFIG_MARKERS is not set
92CONFIG_HAVE_OPROFILE=y
93# CONFIG_KPROBES is not set
94CONFIG_HAVE_KPROBES=y
95CONFIG_HAVE_KRETPROBES=y
96CONFIG_HAVE_CLK=y
97# CONFIG_SLOW_WORK is not set
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y
100CONFIG_RT_MUTEXES=y
101CONFIG_BASE_SMALL=0
102CONFIG_MODULES=y
103# CONFIG_MODULE_FORCE_LOAD is not set
104CONFIG_MODULE_UNLOAD=y
105# CONFIG_MODULE_FORCE_UNLOAD is not set
106# CONFIG_MODVERSIONS is not set
107# CONFIG_MODULE_SRCVERSION_ALL is not set
108CONFIG_BLOCK=y
109# CONFIG_LBD is not set
110# CONFIG_BLK_DEV_BSG is not set
111# CONFIG_BLK_DEV_INTEGRITY is not set
112
113#
114# IO Schedulers
115#
116CONFIG_IOSCHED_NOOP=y
117# CONFIG_IOSCHED_AS is not set
118CONFIG_IOSCHED_DEADLINE=y
119# CONFIG_IOSCHED_CFQ is not set
120# CONFIG_DEFAULT_AS is not set
121CONFIG_DEFAULT_DEADLINE=y
122# CONFIG_DEFAULT_CFQ is not set
123# CONFIG_DEFAULT_NOOP is not set
124CONFIG_DEFAULT_IOSCHED="deadline"
125# CONFIG_FREEZER is not set
126
127#
128# System Type
129#
130# CONFIG_ARCH_AAEC2000 is not set
131# CONFIG_ARCH_INTEGRATOR is not set
132# CONFIG_ARCH_REALVIEW is not set
133# CONFIG_ARCH_VERSATILE is not set
134# CONFIG_ARCH_AT91 is not set
135# CONFIG_ARCH_CLPS711X is not set
136# CONFIG_ARCH_GEMINI is not set
137# CONFIG_ARCH_EBSA110 is not set
138# CONFIG_ARCH_EP93XX is not set
139# CONFIG_ARCH_FOOTBRIDGE is not set
140# CONFIG_ARCH_MXC is not set
141# CONFIG_ARCH_NETX is not set
142# CONFIG_ARCH_H720X is not set
143# CONFIG_ARCH_IMX is not set
144# CONFIG_ARCH_IOP13XX is not set
145# CONFIG_ARCH_IOP32X is not set
146# CONFIG_ARCH_IOP33X is not set
147# CONFIG_ARCH_IXP23XX is not set
148# CONFIG_ARCH_IXP2000 is not set
149# CONFIG_ARCH_IXP4XX is not set
150# CONFIG_ARCH_L7200 is not set
151# CONFIG_ARCH_KIRKWOOD is not set
152# CONFIG_ARCH_LOKI is not set
153# CONFIG_ARCH_MV78XX0 is not set
154# CONFIG_ARCH_ORION5X is not set
155# CONFIG_ARCH_MMP is not set
156# CONFIG_ARCH_KS8695 is not set
157# CONFIG_ARCH_NS9XXX is not set
158# CONFIG_ARCH_W90X900 is not set
159# CONFIG_ARCH_PNX4008 is not set
160# CONFIG_ARCH_PXA is not set
161# CONFIG_ARCH_MSM is not set
162# CONFIG_ARCH_RPC is not set
163# CONFIG_ARCH_SA1100 is not set
164# CONFIG_ARCH_S3C2410 is not set
165# CONFIG_ARCH_S3C64XX is not set
166# CONFIG_ARCH_SHARK is not set
167# CONFIG_ARCH_LH7A40X is not set
168CONFIG_ARCH_U300=y
169# CONFIG_ARCH_DAVINCI is not set
170# CONFIG_ARCH_OMAP is not set
171
172#
173# ST-Ericsson AB U300/U330/U335/U365 Platform
174#
175
176#
177# ST-Ericsson Mobile Platform Products
178#
179CONFIG_MACH_U300=y
180
181#
182# ST-Ericsson U300/U330/U335/U365 Feature Selections
183#
184# CONFIG_MACH_U300_BS2X is not set
185# CONFIG_MACH_U300_BS330 is not set
186CONFIG_MACH_U300_BS335=y
187# CONFIG_MACH_U300_BS365 is not set
188# CONFIG_MACH_U300_SINGLE_RAM is not set
189CONFIG_MACH_U300_DUAL_RAM=y
190CONFIG_U300_DEBUG=y
191# CONFIG_MACH_U300_SEMI_IS_SHARED is not set
192
193#
194# All the settings below must match the bootloader's settings
195#
196
197#
198# Processor Type
199#
200CONFIG_CPU_32=y
201CONFIG_CPU_ARM926T=y
202CONFIG_CPU_32v5=y
203CONFIG_CPU_ABRT_EV5TJ=y
204CONFIG_CPU_PABRT_NOIFAR=y
205CONFIG_CPU_CACHE_VIVT=y
206CONFIG_CPU_COPY_V4WB=y
207CONFIG_CPU_TLB_V4WBI=y
208CONFIG_CPU_CP15=y
209CONFIG_CPU_CP15_MMU=y
210
211#
212# Processor Features
213#
214CONFIG_ARM_THUMB=y
215# CONFIG_CPU_ICACHE_DISABLE is not set
216# CONFIG_CPU_DCACHE_DISABLE is not set
217# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
218# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
219# CONFIG_OUTER_CACHE is not set
220CONFIG_ARM_VIC=y
221CONFIG_COMMON_CLKDEV=y
222
223#
224# Bus support
225#
226CONFIG_ARM_AMBA=y
227# CONFIG_PCI_SYSCALL is not set
228# CONFIG_ARCH_SUPPORTS_MSI is not set
229# CONFIG_PCCARD is not set
230
231#
232# Kernel Features
233#
234CONFIG_TICK_ONESHOT=y
235CONFIG_NO_HZ=y
236CONFIG_HIGH_RES_TIMERS=y
237CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
238CONFIG_VMSPLIT_3G=y
239# CONFIG_VMSPLIT_2G is not set
240# CONFIG_VMSPLIT_1G is not set
241CONFIG_PAGE_OFFSET=0xC0000000
242CONFIG_PREEMPT=y
243CONFIG_HZ=100
244CONFIG_AEABI=y
245CONFIG_OABI_COMPAT=y
246CONFIG_ARCH_FLATMEM_HAS_HOLES=y
247# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
248# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
249# CONFIG_HIGHMEM is not set
250CONFIG_SELECT_MEMORY_MODEL=y
251CONFIG_FLATMEM_MANUAL=y
252# CONFIG_DISCONTIGMEM_MANUAL is not set
253# CONFIG_SPARSEMEM_MANUAL is not set
254CONFIG_FLATMEM=y
255CONFIG_FLAT_NODE_MEM_MAP=y
256CONFIG_PAGEFLAGS_EXTENDED=y
257CONFIG_SPLIT_PTLOCK_CPUS=4096
258# CONFIG_PHYS_ADDR_T_64BIT is not set
259CONFIG_ZONE_DMA_FLAG=0
260CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y
264CONFIG_ALIGNMENT_TRAP=y
265
266#
267# Boot options
268#
269CONFIG_ZBOOT_ROM_TEXT=0x0
270CONFIG_ZBOOT_ROM_BSS=0x0
271CONFIG_CMDLINE="root=/dev/mtdblock2 rw rootfstype=yaffs2 console=ttyAMA0,115200n8 ab3100.force=0,0x48 mtdparts=u300nand:128k@0x0(bootrecords)ro,8064k@128k(free)ro,253952k@8192k(platform) lpj=515072"
272# CONFIG_XIP_KERNEL is not set
273# CONFIG_KEXEC is not set
274
275#
276# CPU Power Management
277#
278CONFIG_CPU_IDLE=y
279CONFIG_CPU_IDLE_GOV_LADDER=y
280CONFIG_CPU_IDLE_GOV_MENU=y
281
282#
283# Floating point emulation
284#
285
286#
287# At least one emulation must be selected
288#
289CONFIG_FPE_NWFPE=y
290# CONFIG_FPE_NWFPE_XP is not set
291# CONFIG_FPE_FASTFPE is not set
292# CONFIG_VFP is not set
293
294#
295# Userspace binary formats
296#
297CONFIG_BINFMT_ELF=y
298# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
299CONFIG_HAVE_AOUT=y
300# CONFIG_BINFMT_AOUT is not set
301# CONFIG_BINFMT_MISC is not set
302
303#
304# Power management options
305#
306CONFIG_PM=y
307# CONFIG_PM_DEBUG is not set
308# CONFIG_SUSPEND is not set
309# CONFIG_APM_EMULATION is not set
310CONFIG_ARCH_SUSPEND_POSSIBLE=y
311CONFIG_NET=y
312
313#
314# Networking options
315#
316CONFIG_PACKET=y
317# CONFIG_PACKET_MMAP is not set
318CONFIG_UNIX=y
319# CONFIG_NET_KEY is not set
320CONFIG_INET=y
321# CONFIG_IP_MULTICAST is not set
322# CONFIG_IP_ADVANCED_ROUTER is not set
323CONFIG_IP_FIB_HASH=y
324# CONFIG_IP_PNP is not set
325# CONFIG_NET_IPIP is not set
326# CONFIG_NET_IPGRE is not set
327# CONFIG_ARPD is not set
328# CONFIG_SYN_COOKIES is not set
329# CONFIG_INET_AH is not set
330# CONFIG_INET_ESP is not set
331# CONFIG_INET_IPCOMP is not set
332# CONFIG_INET_XFRM_TUNNEL is not set
333# CONFIG_INET_TUNNEL is not set
334# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
335# CONFIG_INET_XFRM_MODE_TUNNEL is not set
336# CONFIG_INET_XFRM_MODE_BEET is not set
337# CONFIG_INET_LRO is not set
338# CONFIG_INET_DIAG is not set
339# CONFIG_TCP_CONG_ADVANCED is not set
340CONFIG_TCP_CONG_CUBIC=y
341CONFIG_DEFAULT_TCP_CONG="cubic"
342# CONFIG_TCP_MD5SIG is not set
343# CONFIG_IPV6 is not set
344# CONFIG_NETWORK_SECMARK is not set
345# CONFIG_NETFILTER is not set
346# CONFIG_IP_DCCP is not set
347# CONFIG_IP_SCTP is not set
348# CONFIG_TIPC is not set
349# CONFIG_ATM is not set
350# CONFIG_BRIDGE is not set
351# CONFIG_NET_DSA is not set
352# CONFIG_VLAN_8021Q is not set
353# CONFIG_DECNET is not set
354# CONFIG_LLC2 is not set
355# CONFIG_IPX is not set
356# CONFIG_ATALK is not set
357# CONFIG_X25 is not set
358# CONFIG_LAPB is not set
359# CONFIG_ECONET is not set
360# CONFIG_WAN_ROUTER is not set
361# CONFIG_PHONET is not set
362# CONFIG_NET_SCHED is not set
363# CONFIG_DCB is not set
364
365#
366# Network testing
367#
368# CONFIG_NET_PKTGEN is not set
369# CONFIG_HAMRADIO is not set
370# CONFIG_CAN is not set
371# CONFIG_IRDA is not set
372# CONFIG_BT is not set
373# CONFIG_AF_RXRPC is not set
374# CONFIG_WIRELESS is not set
375# CONFIG_WIMAX is not set
376# CONFIG_RFKILL is not set
377# CONFIG_NET_9P is not set
378
379#
380# Device Drivers
381#
382
383#
384# Generic Driver Options
385#
386CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
387CONFIG_STANDALONE=y
388# CONFIG_PREVENT_FIRMWARE_BUILD is not set
389CONFIG_FW_LOADER=y
390CONFIG_FIRMWARE_IN_KERNEL=y
391CONFIG_EXTRA_FIRMWARE=""
392# CONFIG_DEBUG_DRIVER is not set
393# CONFIG_DEBUG_DEVRES is not set
394# CONFIG_SYS_HYPERVISOR is not set
395# CONFIG_CONNECTOR is not set
396CONFIG_MTD=y
397# CONFIG_MTD_DEBUG is not set
398# CONFIG_MTD_CONCAT is not set
399CONFIG_MTD_PARTITIONS=y
400# CONFIG_MTD_TESTS is not set
401# CONFIG_MTD_REDBOOT_PARTS is not set
402CONFIG_MTD_CMDLINE_PARTS=y
403# CONFIG_MTD_AFS_PARTS is not set
404# CONFIG_MTD_AR7_PARTS is not set
405
406#
407# User Modules And Translation Layers
408#
409CONFIG_MTD_CHAR=y
410CONFIG_MTD_BLKDEVS=y
411CONFIG_MTD_BLOCK=y
412# CONFIG_FTL is not set
413# CONFIG_NFTL is not set
414# CONFIG_INFTL is not set
415# CONFIG_RFD_FTL is not set
416# CONFIG_SSFDC is not set
417# CONFIG_MTD_OOPS is not set
418
419#
420# RAM/ROM/Flash chip drivers
421#
422# CONFIG_MTD_CFI is not set
423# CONFIG_MTD_JEDECPROBE is not set
424CONFIG_MTD_MAP_BANK_WIDTH_1=y
425CONFIG_MTD_MAP_BANK_WIDTH_2=y
426CONFIG_MTD_MAP_BANK_WIDTH_4=y
427# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
428# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
429# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
430CONFIG_MTD_CFI_I1=y
431CONFIG_MTD_CFI_I2=y
432# CONFIG_MTD_CFI_I4 is not set
433# CONFIG_MTD_CFI_I8 is not set
434# CONFIG_MTD_RAM is not set
435# CONFIG_MTD_ROM is not set
436# CONFIG_MTD_ABSENT is not set
437
438#
439# Mapping drivers for chip access
440#
441# CONFIG_MTD_COMPLEX_MAPPINGS is not set
442# CONFIG_MTD_PLATRAM is not set
443
444#
445# Self-contained MTD device drivers
446#
447# CONFIG_MTD_DATAFLASH is not set
448# CONFIG_MTD_M25P80 is not set
449# CONFIG_MTD_SLRAM is not set
450# CONFIG_MTD_PHRAM is not set
451# CONFIG_MTD_MTDRAM is not set
452# CONFIG_MTD_BLOCK2MTD is not set
453
454#
455# Disk-On-Chip Device Drivers
456#
457# CONFIG_MTD_DOC2000 is not set
458# CONFIG_MTD_DOC2001 is not set
459# CONFIG_MTD_DOC2001PLUS is not set
460CONFIG_MTD_NAND=y
461# CONFIG_MTD_NAND_VERIFY_WRITE is not set
462CONFIG_MTD_NAND_ECC_SMC=y
463# CONFIG_MTD_NAND_MUSEUM_IDS is not set
464# CONFIG_MTD_NAND_GPIO is not set
465CONFIG_MTD_NAND_IDS=y
466# CONFIG_MTD_NAND_DISKONCHIP is not set
467# CONFIG_MTD_NAND_NANDSIM is not set
468# CONFIG_MTD_NAND_PLATFORM is not set
469# CONFIG_MTD_ONENAND is not set
470
471#
472# LPDDR flash memory drivers
473#
474# CONFIG_MTD_LPDDR is not set
475
476#
477# UBI - Unsorted block images
478#
479# CONFIG_MTD_UBI is not set
480# CONFIG_PARPORT is not set
481CONFIG_BLK_DEV=y
482# CONFIG_BLK_DEV_COW_COMMON is not set
483# CONFIG_BLK_DEV_LOOP is not set
484# CONFIG_BLK_DEV_NBD is not set
485# CONFIG_BLK_DEV_RAM is not set
486# CONFIG_CDROM_PKTCDVD is not set
487# CONFIG_ATA_OVER_ETH is not set
488CONFIG_MISC_DEVICES=y
489# CONFIG_ICS932S401 is not set
490# CONFIG_ENCLOSURE_SERVICES is not set
491# CONFIG_ISL29003 is not set
492# CONFIG_C2PORT is not set
493
494#
495# EEPROM support
496#
497# CONFIG_EEPROM_AT24 is not set
498# CONFIG_EEPROM_AT25 is not set
499# CONFIG_EEPROM_LEGACY is not set
500# CONFIG_EEPROM_93CX6 is not set
501CONFIG_HAVE_IDE=y
502# CONFIG_IDE is not set
503
504#
505# SCSI device support
506#
507# CONFIG_RAID_ATTRS is not set
508# CONFIG_SCSI is not set
509# CONFIG_SCSI_DMA is not set
510# CONFIG_SCSI_NETLINK is not set
511# CONFIG_ATA is not set
512# CONFIG_MD is not set
513# CONFIG_NETDEVICES is not set
514# CONFIG_ISDN is not set
515
516#
517# Input device support
518#
519CONFIG_INPUT=y
520# CONFIG_INPUT_FF_MEMLESS is not set
521# CONFIG_INPUT_POLLDEV is not set
522
523#
524# Userland interfaces
525#
526# CONFIG_INPUT_MOUSEDEV is not set
527# CONFIG_INPUT_JOYDEV is not set
528CONFIG_INPUT_EVDEV=y
529# CONFIG_INPUT_EVBUG is not set
530
531#
532# Input Device Drivers
533#
534CONFIG_INPUT_KEYBOARD=y
535# CONFIG_KEYBOARD_ATKBD is not set
536# CONFIG_KEYBOARD_SUNKBD is not set
537# CONFIG_KEYBOARD_LKKBD is not set
538# CONFIG_KEYBOARD_XTKBD is not set
539# CONFIG_KEYBOARD_NEWTON is not set
540# CONFIG_KEYBOARD_STOWAWAY is not set
541# CONFIG_KEYBOARD_GPIO is not set
542# CONFIG_INPUT_MOUSE is not set
543# CONFIG_INPUT_JOYSTICK is not set
544# CONFIG_INPUT_TABLET is not set
545# CONFIG_INPUT_TOUCHSCREEN is not set
546# CONFIG_INPUT_MISC is not set
547
548#
549# Hardware I/O ports
550#
551# CONFIG_SERIO is not set
552# CONFIG_GAMEPORT is not set
553
554#
555# Character devices
556#
557CONFIG_VT=y
558CONFIG_CONSOLE_TRANSLATIONS=y
559CONFIG_VT_CONSOLE=y
560CONFIG_HW_CONSOLE=y
561# CONFIG_VT_HW_CONSOLE_BINDING is not set
562CONFIG_DEVKMEM=y
563# CONFIG_SERIAL_NONSTANDARD is not set
564
565#
566# Serial drivers
567#
568# CONFIG_SERIAL_8250 is not set
569
570#
571# Non-8250 serial port support
572#
573# CONFIG_SERIAL_AMBA_PL010 is not set
574CONFIG_SERIAL_AMBA_PL011=y
575CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
576# CONFIG_SERIAL_MAX3100 is not set
577CONFIG_SERIAL_CORE=y
578CONFIG_SERIAL_CORE_CONSOLE=y
579CONFIG_UNIX98_PTYS=y
580# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
581CONFIG_LEGACY_PTYS=y
582CONFIG_LEGACY_PTY_COUNT=16
583# CONFIG_IPMI_HANDLER is not set
584# CONFIG_HW_RANDOM is not set
585# CONFIG_R3964 is not set
586# CONFIG_RAW_DRIVER is not set
587# CONFIG_TCG_TPM is not set
588CONFIG_I2C=y
589CONFIG_I2C_BOARDINFO=y
590# CONFIG_I2C_CHARDEV is not set
591CONFIG_I2C_HELPER_AUTO=y
592
593#
594# I2C Hardware Bus support
595#
596
597#
598# I2C system bus drivers (mostly embedded / system-on-chip)
599#
600# CONFIG_I2C_GPIO is not set
601# CONFIG_I2C_OCORES is not set
602# CONFIG_I2C_SIMTEC is not set
603
604#
605# External I2C/SMBus adapter drivers
606#
607# CONFIG_I2C_PARPORT_LIGHT is not set
608# CONFIG_I2C_TAOS_EVM is not set
609
610#
611# Other I2C/SMBus bus drivers
612#
613# CONFIG_I2C_PCA_PLATFORM is not set
614# CONFIG_I2C_STUB is not set
615
616#
617# Miscellaneous I2C Chip support
618#
619# CONFIG_DS1682 is not set
620# CONFIG_SENSORS_PCF8574 is not set
621# CONFIG_PCF8575 is not set
622# CONFIG_SENSORS_PCA9539 is not set
623# CONFIG_SENSORS_MAX6875 is not set
624# CONFIG_SENSORS_TSL2550 is not set
625# CONFIG_I2C_DEBUG_CORE is not set
626# CONFIG_I2C_DEBUG_ALGO is not set
627# CONFIG_I2C_DEBUG_BUS is not set
628# CONFIG_I2C_DEBUG_CHIP is not set
629CONFIG_SPI=y
630# CONFIG_SPI_DEBUG is not set
631CONFIG_SPI_MASTER=y
632
633#
634# SPI Master Controller Drivers
635#
636# CONFIG_SPI_BITBANG is not set
637# CONFIG_SPI_GPIO is not set
638
639#
640# SPI Protocol Masters
641#
642# CONFIG_SPI_SPIDEV is not set
643# CONFIG_SPI_TLE62X0 is not set
644# CONFIG_W1 is not set
645CONFIG_POWER_SUPPLY=y
646# CONFIG_POWER_SUPPLY_DEBUG is not set
647# CONFIG_PDA_POWER is not set
648# CONFIG_BATTERY_DS2760 is not set
649# CONFIG_BATTERY_BQ27x00 is not set
650# CONFIG_HWMON is not set
651# CONFIG_THERMAL is not set
652# CONFIG_THERMAL_HWMON is not set
653CONFIG_WATCHDOG=y
654# CONFIG_WATCHDOG_NOWAYOUT is not set
655
656#
657# Watchdog Device Drivers
658#
659# CONFIG_SOFT_WATCHDOG is not set
660CONFIG_SSB_POSSIBLE=y
661
662#
663# Sonics Silicon Backplane
664#
665# CONFIG_SSB is not set
666
667#
668# Multifunction device drivers
669#
670# CONFIG_MFD_CORE is not set
671# CONFIG_MFD_SM501 is not set
672# CONFIG_HTC_PASIC3 is not set
673# CONFIG_TWL4030_CORE is not set
674# CONFIG_MFD_TMIO is not set
675# CONFIG_MFD_T7L66XB is not set
676# CONFIG_MFD_TC6387XB is not set
677# CONFIG_PMIC_DA903X is not set
678# CONFIG_MFD_WM8400 is not set
679# CONFIG_MFD_WM8350_I2C is not set
680# CONFIG_MFD_PCF50633 is not set
681
682#
683# Multimedia devices
684#
685
686#
687# Multimedia core support
688#
689# CONFIG_VIDEO_DEV is not set
690# CONFIG_DVB_CORE is not set
691# CONFIG_VIDEO_MEDIA is not set
692
693#
694# Multimedia drivers
695#
696# CONFIG_DAB is not set
697
698#
699# Graphics support
700#
701# CONFIG_VGASTATE is not set
702# CONFIG_VIDEO_OUTPUT_CONTROL is not set
703CONFIG_FB=y
704# CONFIG_FIRMWARE_EDID is not set
705# CONFIG_FB_DDC is not set
706# CONFIG_FB_BOOT_VESA_SUPPORT is not set
707# CONFIG_FB_CFB_FILLRECT is not set
708# CONFIG_FB_CFB_COPYAREA is not set
709# CONFIG_FB_CFB_IMAGEBLIT is not set
710# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
711# CONFIG_FB_SYS_FILLRECT is not set
712# CONFIG_FB_SYS_COPYAREA is not set
713# CONFIG_FB_SYS_IMAGEBLIT is not set
714# CONFIG_FB_FOREIGN_ENDIAN is not set
715# CONFIG_FB_SYS_FOPS is not set
716# CONFIG_FB_SVGALIB is not set
717# CONFIG_FB_MACMODES is not set
718# CONFIG_FB_BACKLIGHT is not set
719# CONFIG_FB_MODE_HELPERS is not set
720# CONFIG_FB_TILEBLITTING is not set
721
722#
723# Frame buffer hardware drivers
724#
725# CONFIG_FB_ARMCLCD is not set
726# CONFIG_FB_S1D13XXX is not set
727# CONFIG_FB_VIRTUAL is not set
728# CONFIG_FB_METRONOME is not set
729# CONFIG_FB_MB862XX is not set
730# CONFIG_FB_BROADSHEET is not set
731CONFIG_BACKLIGHT_LCD_SUPPORT=y
732# CONFIG_LCD_CLASS_DEVICE is not set
733CONFIG_BACKLIGHT_CLASS_DEVICE=y
734CONFIG_BACKLIGHT_GENERIC=y
735
736#
737# Display device support
738#
739# CONFIG_DISPLAY_SUPPORT is not set
740
741#
742# Console display driver support
743#
744# CONFIG_VGA_CONSOLE is not set
745CONFIG_DUMMY_CONSOLE=y
746# CONFIG_FRAMEBUFFER_CONSOLE is not set
747# CONFIG_LOGO is not set
748CONFIG_SOUND=y
749# CONFIG_SOUND_OSS_CORE is not set
750CONFIG_SND=y
751CONFIG_SND_TIMER=y
752CONFIG_SND_PCM=y
753CONFIG_SND_JACK=y
754# CONFIG_SND_SEQUENCER is not set
755# CONFIG_SND_MIXER_OSS is not set
756# CONFIG_SND_PCM_OSS is not set
757# CONFIG_SND_HRTIMER is not set
758# CONFIG_SND_DYNAMIC_MINORS is not set
759# CONFIG_SND_SUPPORT_OLD_API is not set
760# CONFIG_SND_VERBOSE_PROCFS is not set
761# CONFIG_SND_VERBOSE_PRINTK is not set
762# CONFIG_SND_DEBUG is not set
763# CONFIG_SND_DRIVERS is not set
764# CONFIG_SND_ARM is not set
765# CONFIG_SND_SPI is not set
766CONFIG_SND_SOC=y
767CONFIG_SND_SOC_I2C_AND_SPI=y
768# CONFIG_SND_SOC_ALL_CODECS is not set
769# CONFIG_SOUND_PRIME is not set
770# CONFIG_HID_SUPPORT is not set
771# CONFIG_USB_SUPPORT is not set
772CONFIG_MMC=y
773# CONFIG_MMC_DEBUG is not set
774# CONFIG_MMC_UNSAFE_RESUME is not set
775
776#
777# MMC/SD/SDIO Card Drivers
778#
779CONFIG_MMC_BLOCK=y
780CONFIG_MMC_BLOCK_BOUNCE=y
781# CONFIG_SDIO_UART is not set
782# CONFIG_MMC_TEST is not set
783
784#
785# MMC/SD/SDIO Host Controller Drivers
786#
787CONFIG_MMC_ARMMMCI=y
788# CONFIG_MMC_SDHCI is not set
789# CONFIG_MMC_SPI is not set
790# CONFIG_MEMSTICK is not set
791# CONFIG_ACCESSIBILITY is not set
792CONFIG_NEW_LEDS=y
793CONFIG_LEDS_CLASS=y
794
795#
796# LED drivers
797#
798# CONFIG_LEDS_PCA9532 is not set
799# CONFIG_LEDS_GPIO is not set
800# CONFIG_LEDS_LP5521 is not set
801# CONFIG_LEDS_PCA955X is not set
802# CONFIG_LEDS_DAC124S085 is not set
803# CONFIG_LEDS_BD2802 is not set
804
805#
806# LED Triggers
807#
808CONFIG_LEDS_TRIGGERS=y
809# CONFIG_LEDS_TRIGGER_TIMER is not set
810# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
811CONFIG_LEDS_TRIGGER_BACKLIGHT=y
812# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
813
814#
815# iptables trigger is under Netfilter config (LED target)
816#
817CONFIG_RTC_LIB=y
818CONFIG_RTC_CLASS=y
819CONFIG_RTC_HCTOSYS=y
820CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
821# CONFIG_RTC_DEBUG is not set
822
823#
824# RTC interfaces
825#
826CONFIG_RTC_INTF_SYSFS=y
827CONFIG_RTC_INTF_PROC=y
828CONFIG_RTC_INTF_DEV=y
829# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
830# CONFIG_RTC_DRV_TEST is not set
831
832#
833# I2C RTC drivers
834#
835# CONFIG_RTC_DRV_DS1307 is not set
836# CONFIG_RTC_DRV_DS1374 is not set
837# CONFIG_RTC_DRV_DS1672 is not set
838# CONFIG_RTC_DRV_MAX6900 is not set
839# CONFIG_RTC_DRV_RS5C372 is not set
840# CONFIG_RTC_DRV_ISL1208 is not set
841# CONFIG_RTC_DRV_X1205 is not set
842# CONFIG_RTC_DRV_PCF8563 is not set
843# CONFIG_RTC_DRV_PCF8583 is not set
844# CONFIG_RTC_DRV_M41T80 is not set
845# CONFIG_RTC_DRV_S35390A is not set
846# CONFIG_RTC_DRV_FM3130 is not set
847# CONFIG_RTC_DRV_RX8581 is not set
848
849#
850# SPI RTC drivers
851#
852# CONFIG_RTC_DRV_M41T94 is not set
853# CONFIG_RTC_DRV_DS1305 is not set
854# CONFIG_RTC_DRV_DS1390 is not set
855# CONFIG_RTC_DRV_MAX6902 is not set
856# CONFIG_RTC_DRV_R9701 is not set
857# CONFIG_RTC_DRV_RS5C348 is not set
858# CONFIG_RTC_DRV_DS3234 is not set
859
860#
861# Platform RTC drivers
862#
863# CONFIG_RTC_DRV_CMOS is not set
864# CONFIG_RTC_DRV_DS1286 is not set
865# CONFIG_RTC_DRV_DS1511 is not set
866# CONFIG_RTC_DRV_DS1553 is not set
867# CONFIG_RTC_DRV_DS1742 is not set
868# CONFIG_RTC_DRV_STK17TA8 is not set
869# CONFIG_RTC_DRV_M48T86 is not set
870# CONFIG_RTC_DRV_M48T35 is not set
871# CONFIG_RTC_DRV_M48T59 is not set
872# CONFIG_RTC_DRV_BQ4802 is not set
873# CONFIG_RTC_DRV_V3020 is not set
874
875#
876# on-CPU RTC drivers
877#
878# CONFIG_RTC_DRV_PL030 is not set
879# CONFIG_RTC_DRV_PL031 is not set
880CONFIG_DMADEVICES=y
881
882#
883# DMA Devices
884#
885# CONFIG_AUXDISPLAY is not set
886CONFIG_REGULATOR=y
887# CONFIG_REGULATOR_DEBUG is not set
888# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
889# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
890# CONFIG_REGULATOR_BQ24022 is not set
891# CONFIG_UIO is not set
892# CONFIG_STAGING is not set
893
894#
895# File systems
896#
897# CONFIG_EXT2_FS is not set
898# CONFIG_EXT3_FS is not set
899# CONFIG_EXT4_FS is not set
900# CONFIG_REISERFS_FS is not set
901# CONFIG_JFS_FS is not set
902# CONFIG_FS_POSIX_ACL is not set
903CONFIG_FILE_LOCKING=y
904# CONFIG_XFS_FS is not set
905# CONFIG_OCFS2_FS is not set
906# CONFIG_BTRFS_FS is not set
907# CONFIG_DNOTIFY is not set
908# CONFIG_INOTIFY is not set
909# CONFIG_QUOTA is not set
910# CONFIG_AUTOFS_FS is not set
911# CONFIG_AUTOFS4_FS is not set
912CONFIG_FUSE_FS=y
913
914#
915# Caches
916#
917# CONFIG_FSCACHE is not set
918
919#
920# CD-ROM/DVD Filesystems
921#
922# CONFIG_ISO9660_FS is not set
923# CONFIG_UDF_FS is not set
924
925#
926# DOS/FAT/NT Filesystems
927#
928CONFIG_FAT_FS=y
929# CONFIG_MSDOS_FS is not set
930CONFIG_VFAT_FS=y
931CONFIG_FAT_DEFAULT_CODEPAGE=437
932CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
933# CONFIG_NTFS_FS is not set
934
935#
936# Pseudo filesystems
937#
938CONFIG_PROC_FS=y
939CONFIG_PROC_SYSCTL=y
940CONFIG_PROC_PAGE_MONITOR=y
941CONFIG_SYSFS=y
942CONFIG_TMPFS=y
943# CONFIG_TMPFS_POSIX_ACL is not set
944# CONFIG_HUGETLB_PAGE is not set
945# CONFIG_CONFIGFS_FS is not set
946CONFIG_MISC_FILESYSTEMS=y
947# CONFIG_ADFS_FS is not set
948# CONFIG_AFFS_FS is not set
949# CONFIG_HFS_FS is not set
950# CONFIG_HFSPLUS_FS is not set
951# CONFIG_BEFS_FS is not set
952# CONFIG_BFS_FS is not set
953# CONFIG_EFS_FS is not set
954# CONFIG_JFFS2_FS is not set
955# CONFIG_CRAMFS is not set
956# CONFIG_SQUASHFS is not set
957# CONFIG_VXFS_FS is not set
958# CONFIG_MINIX_FS is not set
959# CONFIG_OMFS_FS is not set
960# CONFIG_HPFS_FS is not set
961# CONFIG_QNX4FS_FS is not set
962# CONFIG_ROMFS_FS is not set
963# CONFIG_SYSV_FS is not set
964# CONFIG_UFS_FS is not set
965# CONFIG_NILFS2_FS is not set
966# CONFIG_NETWORK_FILESYSTEMS is not set
967
968#
969# Partition Types
970#
971# CONFIG_PARTITION_ADVANCED is not set
972CONFIG_MSDOS_PARTITION=y
973CONFIG_NLS=y
974CONFIG_NLS_DEFAULT="iso8859-1"
975# CONFIG_NLS_CODEPAGE_437 is not set
976# CONFIG_NLS_CODEPAGE_737 is not set
977# CONFIG_NLS_CODEPAGE_775 is not set
978# CONFIG_NLS_CODEPAGE_850 is not set
979# CONFIG_NLS_CODEPAGE_852 is not set
980# CONFIG_NLS_CODEPAGE_855 is not set
981# CONFIG_NLS_CODEPAGE_857 is not set
982# CONFIG_NLS_CODEPAGE_860 is not set
983# CONFIG_NLS_CODEPAGE_861 is not set
984# CONFIG_NLS_CODEPAGE_862 is not set
985# CONFIG_NLS_CODEPAGE_863 is not set
986# CONFIG_NLS_CODEPAGE_864 is not set
987# CONFIG_NLS_CODEPAGE_865 is not set
988# CONFIG_NLS_CODEPAGE_866 is not set
989# CONFIG_NLS_CODEPAGE_869 is not set
990# CONFIG_NLS_CODEPAGE_936 is not set
991# CONFIG_NLS_CODEPAGE_950 is not set
992# CONFIG_NLS_CODEPAGE_932 is not set
993# CONFIG_NLS_CODEPAGE_949 is not set
994# CONFIG_NLS_CODEPAGE_874 is not set
995# CONFIG_NLS_ISO8859_8 is not set
996# CONFIG_NLS_CODEPAGE_1250 is not set
997# CONFIG_NLS_CODEPAGE_1251 is not set
998# CONFIG_NLS_ASCII is not set
999CONFIG_NLS_ISO8859_1=y
1000# CONFIG_NLS_ISO8859_2 is not set
1001# CONFIG_NLS_ISO8859_3 is not set
1002# CONFIG_NLS_ISO8859_4 is not set
1003# CONFIG_NLS_ISO8859_5 is not set
1004# CONFIG_NLS_ISO8859_6 is not set
1005# CONFIG_NLS_ISO8859_7 is not set
1006# CONFIG_NLS_ISO8859_9 is not set
1007# CONFIG_NLS_ISO8859_13 is not set
1008# CONFIG_NLS_ISO8859_14 is not set
1009# CONFIG_NLS_ISO8859_15 is not set
1010# CONFIG_NLS_KOI8_R is not set
1011# CONFIG_NLS_KOI8_U is not set
1012# CONFIG_NLS_UTF8 is not set
1013# CONFIG_DLM is not set
1014
1015#
1016# Kernel hacking
1017#
1018CONFIG_PRINTK_TIME=y
1019CONFIG_ENABLE_WARN_DEPRECATED=y
1020CONFIG_ENABLE_MUST_CHECK=y
1021CONFIG_FRAME_WARN=1024
1022# CONFIG_MAGIC_SYSRQ is not set
1023# CONFIG_UNUSED_SYMBOLS is not set
1024# CONFIG_DEBUG_FS is not set
1025# CONFIG_HEADERS_CHECK is not set
1026CONFIG_DEBUG_KERNEL=y
1027# CONFIG_DEBUG_SHIRQ is not set
1028# CONFIG_DETECT_SOFTLOCKUP is not set
1029# CONFIG_DETECT_HUNG_TASK is not set
1030# CONFIG_SCHED_DEBUG is not set
1031# CONFIG_SCHEDSTATS is not set
1032CONFIG_TIMER_STATS=y
1033# CONFIG_DEBUG_OBJECTS is not set
1034# CONFIG_SLUB_DEBUG_ON is not set
1035# CONFIG_SLUB_STATS is not set
1036# CONFIG_DEBUG_PREEMPT is not set
1037# CONFIG_DEBUG_RT_MUTEXES is not set
1038# CONFIG_RT_MUTEX_TESTER is not set
1039# CONFIG_DEBUG_SPINLOCK is not set
1040# CONFIG_DEBUG_MUTEXES is not set
1041# CONFIG_DEBUG_LOCK_ALLOC is not set
1042# CONFIG_PROVE_LOCKING is not set
1043# CONFIG_LOCK_STAT is not set
1044# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1045# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1046# CONFIG_DEBUG_KOBJECT is not set
1047CONFIG_DEBUG_BUGVERBOSE=y
1048CONFIG_DEBUG_INFO=y
1049# CONFIG_DEBUG_VM is not set
1050# CONFIG_DEBUG_WRITECOUNT is not set
1051# CONFIG_DEBUG_MEMORY_INIT is not set
1052# CONFIG_DEBUG_LIST is not set
1053# CONFIG_DEBUG_SG is not set
1054# CONFIG_DEBUG_NOTIFIERS is not set
1055# CONFIG_BOOT_PRINTK_DELAY is not set
1056# CONFIG_RCU_TORTURE_TEST is not set
1057# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1058# CONFIG_BACKTRACE_SELF_TEST is not set
1059# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1060# CONFIG_FAULT_INJECTION is not set
1061# CONFIG_LATENCYTOP is not set
1062# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1063# CONFIG_PAGE_POISONING is not set
1064CONFIG_HAVE_FUNCTION_TRACER=y
1065CONFIG_TRACING_SUPPORT=y
1066
1067#
1068# Tracers
1069#
1070# CONFIG_FUNCTION_TRACER is not set
1071# CONFIG_IRQSOFF_TRACER is not set
1072# CONFIG_PREEMPT_TRACER is not set
1073# CONFIG_SCHED_TRACER is not set
1074# CONFIG_CONTEXT_SWITCH_TRACER is not set
1075# CONFIG_EVENT_TRACER is not set
1076# CONFIG_BOOT_TRACER is not set
1077# CONFIG_TRACE_BRANCH_PROFILING is not set
1078# CONFIG_STACK_TRACER is not set
1079# CONFIG_KMEMTRACE is not set
1080# CONFIG_WORKQUEUE_TRACER is not set
1081# CONFIG_BLK_DEV_IO_TRACE is not set
1082# CONFIG_SAMPLES is not set
1083CONFIG_HAVE_ARCH_KGDB=y
1084# CONFIG_KGDB is not set
1085CONFIG_ARM_UNWIND=y
1086# CONFIG_DEBUG_USER is not set
1087# CONFIG_DEBUG_ERRORS is not set
1088# CONFIG_DEBUG_STACK_USAGE is not set
1089# CONFIG_DEBUG_LL is not set
1090
1091#
1092# Security options
1093#
1094# CONFIG_KEYS is not set
1095# CONFIG_SECURITY is not set
1096# CONFIG_SECURITYFS is not set
1097# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1098# CONFIG_CRYPTO is not set
1099# CONFIG_BINARY_PRINTF is not set
1100
1101#
1102# Library routines
1103#
1104CONFIG_GENERIC_FIND_LAST_BIT=y
1105# CONFIG_CRC_CCITT is not set
1106# CONFIG_CRC16 is not set
1107# CONFIG_CRC_T10DIF is not set
1108# CONFIG_CRC_ITU_T is not set
1109# CONFIG_CRC32 is not set
1110# CONFIG_CRC7 is not set
1111# CONFIG_LIBCRC32C is not set
1112CONFIG_HAS_IOMEM=y
1113CONFIG_HAS_IOPORT=y
1114CONFIG_HAS_DMA=y
1115CONFIG_NLATTR=y
diff --git a/arch/arm/configs/w90p910_defconfig b/arch/arm/configs/w90p910_defconfig
index 56bda7c6d670..5245655a0ad3 100644
--- a/arch/arm/configs/w90p910_defconfig
+++ b/arch/arm/configs/w90p910_defconfig
@@ -1,11 +1,11 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27-rc8-git8 3# Linux kernel version: 2.6.30
4# Sat Nov 15 10:05:00 2008 4# Wed Jun 10 22:09:25 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set 8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set 9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set 10# CONFIG_GENERIC_CLOCKEVENTS is not set
11CONFIG_MMU=y 11CONFIG_MMU=y
@@ -22,8 +22,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000 26CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -42,10 +40,19 @@ CONFIG_SYSVIPC=y
42CONFIG_SYSVIPC_SYSCTL=y 40CONFIG_SYSVIPC_SYSCTL=y
43CONFIG_BSD_PROCESS_ACCT=y 41CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT_V3 is not set 42# CONFIG_BSD_PROCESS_ACCT_V3 is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_CLASSIC_RCU=y
48# CONFIG_TREE_RCU is not set
49# CONFIG_PREEMPT_RCU is not set
50# CONFIG_TREE_RCU_TRACE is not set
51# CONFIG_PREEMPT_RCU_TRACE is not set
45# CONFIG_IKCONFIG is not set 52# CONFIG_IKCONFIG is not set
46CONFIG_LOG_BUF_SHIFT=17 53CONFIG_LOG_BUF_SHIFT=17
47# CONFIG_CGROUPS is not set
48# CONFIG_GROUP_SCHED is not set 54# CONFIG_GROUP_SCHED is not set
55# CONFIG_CGROUPS is not set
49CONFIG_SYSFS_DEPRECATED=y 56CONFIG_SYSFS_DEPRECATED=y
50CONFIG_SYSFS_DEPRECATED_V2=y 57CONFIG_SYSFS_DEPRECATED_V2=y
51CONFIG_RELAY=y 58CONFIG_RELAY=y
@@ -56,52 +63,53 @@ CONFIG_USER_NS=y
56# CONFIG_PID_NS is not set 63# CONFIG_PID_NS is not set
57CONFIG_BLK_DEV_INITRD=y 64CONFIG_BLK_DEV_INITRD=y
58CONFIG_INITRAMFS_SOURCE="" 65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_RD_GZIP=y
67CONFIG_RD_BZIP2=y
68CONFIG_RD_LZMA=y
69# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
70# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
71# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
72# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 73CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_SYSCTL=y 74CONFIG_SYSCTL=y
75CONFIG_ANON_INODES=y
61# CONFIG_EMBEDDED is not set 76# CONFIG_EMBEDDED is not set
62CONFIG_UID16=y 77CONFIG_UID16=y
63CONFIG_SYSCTL_SYSCALL=y 78CONFIG_SYSCTL_SYSCALL=y
64CONFIG_KALLSYMS=y 79CONFIG_KALLSYMS=y
65CONFIG_KALLSYMS_EXTRA_PASS=y 80CONFIG_KALLSYMS_EXTRA_PASS=y
81# CONFIG_STRIP_ASM_SYMS is not set
66CONFIG_HOTPLUG=y 82CONFIG_HOTPLUG=y
67CONFIG_PRINTK=y 83CONFIG_PRINTK=y
68CONFIG_BUG=y 84CONFIG_BUG=y
69CONFIG_ELF_CORE=y 85CONFIG_ELF_CORE=y
70CONFIG_COMPAT_BRK=y
71CONFIG_BASE_FULL=y 86CONFIG_BASE_FULL=y
72CONFIG_FUTEX=y 87CONFIG_FUTEX=y
73CONFIG_ANON_INODES=y
74CONFIG_EPOLL=y 88CONFIG_EPOLL=y
75CONFIG_SIGNALFD=y 89CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y 90CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y 91CONFIG_EVENTFD=y
78CONFIG_SHMEM=y 92CONFIG_SHMEM=y
93CONFIG_AIO=y
79CONFIG_VM_EVENT_COUNTERS=y 94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_COMPAT_BRK=y
80CONFIG_SLAB=y 96CONFIG_SLAB=y
81# CONFIG_SLUB is not set 97# CONFIG_SLUB is not set
82# CONFIG_SLOB is not set 98# CONFIG_SLOB is not set
83# CONFIG_PROFILING is not set 99# CONFIG_PROFILING is not set
100CONFIG_TRACEPOINTS=y
84# CONFIG_MARKERS is not set 101# CONFIG_MARKERS is not set
85CONFIG_HAVE_OPROFILE=y 102CONFIG_HAVE_OPROFILE=y
86# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
87# CONFIG_HAVE_IOREMAP_PROT is not set
88CONFIG_HAVE_KPROBES=y 103CONFIG_HAVE_KPROBES=y
89CONFIG_HAVE_KRETPROBES=y 104CONFIG_HAVE_KRETPROBES=y
90# CONFIG_HAVE_ARCH_TRACEHOOK is not set 105# CONFIG_SLOW_WORK is not set
91# CONFIG_HAVE_DMA_ATTRS is not set
92# CONFIG_USE_GENERIC_SMP_HELPERS is not set
93# CONFIG_HAVE_CLK is not set
94CONFIG_PROC_PAGE_MONITOR=y
95CONFIG_HAVE_GENERIC_DMA_COHERENT=y 106CONFIG_HAVE_GENERIC_DMA_COHERENT=y
96CONFIG_SLABINFO=y 107CONFIG_SLABINFO=y
97CONFIG_RT_MUTEXES=y 108CONFIG_RT_MUTEXES=y
98# CONFIG_TINY_SHMEM is not set
99CONFIG_BASE_SMALL=0 109CONFIG_BASE_SMALL=0
100# CONFIG_MODULES is not set 110# CONFIG_MODULES is not set
101CONFIG_BLOCK=y 111CONFIG_BLOCK=y
102CONFIG_LBD=y 112CONFIG_LBD=y
103CONFIG_BLK_DEV_IO_TRACE=y
104CONFIG_LSF=y
105CONFIG_BLK_DEV_BSG=y 113CONFIG_BLK_DEV_BSG=y
106# CONFIG_BLK_DEV_INTEGRITY is not set 114# CONFIG_BLK_DEV_INTEGRITY is not set
107 115
@@ -117,7 +125,7 @@ CONFIG_IOSCHED_CFQ=y
117CONFIG_DEFAULT_CFQ=y 125CONFIG_DEFAULT_CFQ=y
118# CONFIG_DEFAULT_NOOP is not set 126# CONFIG_DEFAULT_NOOP is not set
119CONFIG_DEFAULT_IOSCHED="cfq" 127CONFIG_DEFAULT_IOSCHED="cfq"
120CONFIG_CLASSIC_RCU=y 128# CONFIG_FREEZER is not set
121 129
122# 130#
123# System Type 131# System Type
@@ -127,10 +135,10 @@ CONFIG_CLASSIC_RCU=y
127# CONFIG_ARCH_REALVIEW is not set 135# CONFIG_ARCH_REALVIEW is not set
128# CONFIG_ARCH_VERSATILE is not set 136# CONFIG_ARCH_VERSATILE is not set
129# CONFIG_ARCH_AT91 is not set 137# CONFIG_ARCH_AT91 is not set
130# CONFIG_ARCH_CLPS7500 is not set
131# CONFIG_ARCH_CLPS711X is not set 138# CONFIG_ARCH_CLPS711X is not set
132# CONFIG_ARCH_EBSA110 is not set 139# CONFIG_ARCH_EBSA110 is not set
133# CONFIG_ARCH_EP93XX is not set 140# CONFIG_ARCH_EP93XX is not set
141# CONFIG_ARCH_GEMINI is not set
134# CONFIG_ARCH_FOOTBRIDGE is not set 142# CONFIG_ARCH_FOOTBRIDGE is not set
135# CONFIG_ARCH_NETX is not set 143# CONFIG_ARCH_NETX is not set
136# CONFIG_ARCH_H720X is not set 144# CONFIG_ARCH_H720X is not set
@@ -151,23 +159,17 @@ CONFIG_CLASSIC_RCU=y
151# CONFIG_ARCH_ORION5X is not set 159# CONFIG_ARCH_ORION5X is not set
152# CONFIG_ARCH_PNX4008 is not set 160# CONFIG_ARCH_PNX4008 is not set
153# CONFIG_ARCH_PXA is not set 161# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_MMP is not set
154# CONFIG_ARCH_RPC is not set 163# CONFIG_ARCH_RPC is not set
155# CONFIG_ARCH_SA1100 is not set 164# CONFIG_ARCH_SA1100 is not set
156# CONFIG_ARCH_S3C2410 is not set 165# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set
157# CONFIG_ARCH_SHARK is not set 167# CONFIG_ARCH_SHARK is not set
158# CONFIG_ARCH_LH7A40X is not set 168# CONFIG_ARCH_LH7A40X is not set
159# CONFIG_ARCH_DAVINCI is not set 169# CONFIG_ARCH_DAVINCI is not set
160# CONFIG_ARCH_OMAP is not set 170# CONFIG_ARCH_OMAP is not set
161# CONFIG_ARCH_MSM7X00A is not set 171# CONFIG_ARCH_MSM is not set
162CONFIG_ARCH_W90X900=y 172CONFIG_ARCH_W90X900=y
163
164#
165# Boot options
166#
167
168#
169# Power management
170#
171CONFIG_CPU_W90P910=y 173CONFIG_CPU_W90P910=y
172 174
173# 175#
@@ -198,6 +200,7 @@ CONFIG_ARM_THUMB=y
198# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 200# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
199# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 201# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
200# CONFIG_OUTER_CACHE is not set 202# CONFIG_OUTER_CACHE is not set
203CONFIG_COMMON_CLKDEV=y
201 204
202# 205#
203# Bus support 206# Bus support
@@ -209,27 +212,32 @@ CONFIG_ARM_THUMB=y
209# 212#
210# Kernel Features 213# Kernel Features
211# 214#
212# CONFIG_TICK_ONESHOT is not set 215CONFIG_VMSPLIT_3G=y
216# CONFIG_VMSPLIT_2G is not set
217# CONFIG_VMSPLIT_1G is not set
218CONFIG_PAGE_OFFSET=0xC0000000
213CONFIG_PREEMPT=y 219CONFIG_PREEMPT=y
214CONFIG_HZ=100 220CONFIG_HZ=100
215CONFIG_AEABI=y 221CONFIG_AEABI=y
216CONFIG_OABI_COMPAT=y 222CONFIG_OABI_COMPAT=y
217CONFIG_ARCH_FLATMEM_HAS_HOLES=y 223# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
218# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 224# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
225# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
226# CONFIG_HIGHMEM is not set
219CONFIG_SELECT_MEMORY_MODEL=y 227CONFIG_SELECT_MEMORY_MODEL=y
220CONFIG_FLATMEM_MANUAL=y 228CONFIG_FLATMEM_MANUAL=y
221# CONFIG_DISCONTIGMEM_MANUAL is not set 229# CONFIG_DISCONTIGMEM_MANUAL is not set
222# CONFIG_SPARSEMEM_MANUAL is not set 230# CONFIG_SPARSEMEM_MANUAL is not set
223CONFIG_FLATMEM=y 231CONFIG_FLATMEM=y
224CONFIG_FLAT_NODE_MEM_MAP=y 232CONFIG_FLAT_NODE_MEM_MAP=y
225# CONFIG_SPARSEMEM_STATIC is not set
226# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
227CONFIG_PAGEFLAGS_EXTENDED=y 233CONFIG_PAGEFLAGS_EXTENDED=y
228CONFIG_SPLIT_PTLOCK_CPUS=4096 234CONFIG_SPLIT_PTLOCK_CPUS=4096
229# CONFIG_RESOURCES_64BIT is not set 235# CONFIG_PHYS_ADDR_T_64BIT is not set
230CONFIG_ZONE_DMA_FLAG=1 236CONFIG_ZONE_DMA_FLAG=0
231CONFIG_BOUNCE=y
232CONFIG_VIRT_TO_BUS=y 237CONFIG_VIRT_TO_BUS=y
238CONFIG_UNEVICTABLE_LRU=y
239CONFIG_HAVE_MLOCK=y
240CONFIG_HAVE_MLOCKED_PAGE_BIT=y
233CONFIG_ALIGNMENT_TRAP=y 241CONFIG_ALIGNMENT_TRAP=y
234 242
235# 243#
@@ -237,12 +245,17 @@ CONFIG_ALIGNMENT_TRAP=y
237# 245#
238CONFIG_ZBOOT_ROM_TEXT=0 246CONFIG_ZBOOT_ROM_TEXT=0
239CONFIG_ZBOOT_ROM_BSS=0 247CONFIG_ZBOOT_ROM_BSS=0
240CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 initrd=0xa00000,4000000 mem=64M" 248CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
241# CONFIG_XIP_KERNEL is not set 249# CONFIG_XIP_KERNEL is not set
242CONFIG_KEXEC=y 250CONFIG_KEXEC=y
243CONFIG_ATAGS_PROC=y 251CONFIG_ATAGS_PROC=y
244 252
245# 253#
254# CPU Power Management
255#
256# CONFIG_CPU_IDLE is not set
257
258#
246# Floating point emulation 259# Floating point emulation
247# 260#
248 261
@@ -258,6 +271,8 @@ CONFIG_FPE_NWFPE=y
258# Userspace binary formats 271# Userspace binary formats
259# 272#
260CONFIG_BINFMT_ELF=y 273CONFIG_BINFMT_ELF=y
274# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
275CONFIG_HAVE_AOUT=y
261# CONFIG_BINFMT_AOUT is not set 276# CONFIG_BINFMT_AOUT is not set
262# CONFIG_BINFMT_MISC is not set 277# CONFIG_BINFMT_MISC is not set
263 278
@@ -282,11 +297,93 @@ CONFIG_FW_LOADER=y
282CONFIG_FIRMWARE_IN_KERNEL=y 297CONFIG_FIRMWARE_IN_KERNEL=y
283CONFIG_EXTRA_FIRMWARE="" 298CONFIG_EXTRA_FIRMWARE=""
284# CONFIG_SYS_HYPERVISOR is not set 299# CONFIG_SYS_HYPERVISOR is not set
285# CONFIG_MTD is not set 300CONFIG_MTD=y
301# CONFIG_MTD_DEBUG is not set
302CONFIG_MTD_CONCAT=y
303CONFIG_MTD_PARTITIONS=y
304# CONFIG_MTD_REDBOOT_PARTS is not set
305# CONFIG_MTD_CMDLINE_PARTS is not set
306# CONFIG_MTD_AFS_PARTS is not set
307# CONFIG_MTD_AR7_PARTS is not set
308
309#
310# User Modules And Translation Layers
311#
312CONFIG_MTD_CHAR=y
313CONFIG_MTD_BLKDEVS=y
314CONFIG_MTD_BLOCK=y
315# CONFIG_FTL is not set
316# CONFIG_NFTL is not set
317# CONFIG_INFTL is not set
318# CONFIG_RFD_FTL is not set
319# CONFIG_SSFDC is not set
320# CONFIG_MTD_OOPS is not set
321
322#
323# RAM/ROM/Flash chip drivers
324#
325CONFIG_MTD_CFI=y
326# CONFIG_MTD_JEDECPROBE is not set
327CONFIG_MTD_GEN_PROBE=y
328# CONFIG_MTD_CFI_ADV_OPTIONS is not set
329CONFIG_MTD_MAP_BANK_WIDTH_1=y
330CONFIG_MTD_MAP_BANK_WIDTH_2=y
331CONFIG_MTD_MAP_BANK_WIDTH_4=y
332# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
333# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
334# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
335CONFIG_MTD_CFI_I1=y
336CONFIG_MTD_CFI_I2=y
337# CONFIG_MTD_CFI_I4 is not set
338# CONFIG_MTD_CFI_I8 is not set
339# CONFIG_MTD_CFI_INTELEXT is not set
340CONFIG_MTD_CFI_AMDSTD=y
341# CONFIG_MTD_CFI_STAA is not set
342CONFIG_MTD_CFI_UTIL=y
343# CONFIG_MTD_RAM is not set
344# CONFIG_MTD_ROM is not set
345# CONFIG_MTD_ABSENT is not set
346
347#
348# Mapping drivers for chip access
349#
350# CONFIG_MTD_COMPLEX_MAPPINGS is not set
351CONFIG_MTD_PHYSMAP=y
352# CONFIG_MTD_PHYSMAP_COMPAT is not set
353# CONFIG_MTD_ARM_INTEGRATOR is not set
354# CONFIG_MTD_PLATRAM is not set
355
356#
357# Self-contained MTD device drivers
358#
359# CONFIG_MTD_SLRAM is not set
360# CONFIG_MTD_PHRAM is not set
361# CONFIG_MTD_MTDRAM is not set
362# CONFIG_MTD_BLOCK2MTD is not set
363
364#
365# Disk-On-Chip Device Drivers
366#
367# CONFIG_MTD_DOC2000 is not set
368# CONFIG_MTD_DOC2001 is not set
369# CONFIG_MTD_DOC2001PLUS is not set
370# CONFIG_MTD_NAND is not set
371# CONFIG_MTD_ONENAND is not set
372
373#
374# LPDDR flash memory drivers
375#
376# CONFIG_MTD_LPDDR is not set
377
378#
379# UBI - Unsorted block images
380#
381# CONFIG_MTD_UBI is not set
286# CONFIG_PARPORT is not set 382# CONFIG_PARPORT is not set
287CONFIG_BLK_DEV=y 383CONFIG_BLK_DEV=y
288# CONFIG_BLK_DEV_COW_COMMON is not set 384# CONFIG_BLK_DEV_COW_COMMON is not set
289# CONFIG_BLK_DEV_LOOP is not set 385# CONFIG_BLK_DEV_LOOP is not set
386# CONFIG_BLK_DEV_UB is not set
290CONFIG_BLK_DEV_RAM=y 387CONFIG_BLK_DEV_RAM=y
291CONFIG_BLK_DEV_RAM_COUNT=16 388CONFIG_BLK_DEV_RAM_COUNT=16
292CONFIG_BLK_DEV_RAM_SIZE=16384 389CONFIG_BLK_DEV_RAM_SIZE=16384
@@ -300,9 +397,41 @@ CONFIG_HAVE_IDE=y
300# SCSI device support 397# SCSI device support
301# 398#
302# CONFIG_RAID_ATTRS is not set 399# CONFIG_RAID_ATTRS is not set
303# CONFIG_SCSI is not set 400CONFIG_SCSI=y
304# CONFIG_SCSI_DMA is not set 401CONFIG_SCSI_DMA=y
402# CONFIG_SCSI_TGT is not set
305# CONFIG_SCSI_NETLINK is not set 403# CONFIG_SCSI_NETLINK is not set
404# CONFIG_SCSI_PROC_FS is not set
405
406#
407# SCSI support type (disk, tape, CD-ROM)
408#
409CONFIG_BLK_DEV_SD=y
410# CONFIG_CHR_DEV_ST is not set
411# CONFIG_CHR_DEV_OSST is not set
412# CONFIG_BLK_DEV_SR is not set
413# CONFIG_CHR_DEV_SG is not set
414# CONFIG_CHR_DEV_SCH is not set
415
416#
417# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
418#
419# CONFIG_SCSI_MULTI_LUN is not set
420# CONFIG_SCSI_CONSTANTS is not set
421# CONFIG_SCSI_LOGGING is not set
422# CONFIG_SCSI_SCAN_ASYNC is not set
423
424#
425# SCSI Transports
426#
427# CONFIG_SCSI_SPI_ATTRS is not set
428# CONFIG_SCSI_FC_ATTRS is not set
429# CONFIG_SCSI_SAS_ATTRS is not set
430# CONFIG_SCSI_SAS_LIBSAS is not set
431# CONFIG_SCSI_SRP_ATTRS is not set
432# CONFIG_SCSI_LOWLEVEL is not set
433# CONFIG_SCSI_DH is not set
434# CONFIG_SCSI_OSD_INITIATOR is not set
306# CONFIG_ATA is not set 435# CONFIG_ATA is not set
307# CONFIG_MD is not set 436# CONFIG_MD is not set
308 437
@@ -354,38 +483,57 @@ CONFIG_HW_CONSOLE=y
354# 483#
355# Serial drivers 484# Serial drivers
356# 485#
357# CONFIG_SERIAL_8250 is not set 486CONFIG_SERIAL_8250=y
487CONFIG_SERIAL_8250_CONSOLE=y
488CONFIG_SERIAL_8250_NR_UARTS=1
489CONFIG_SERIAL_8250_RUNTIME_UARTS=1
490# CONFIG_SERIAL_8250_EXTENDED is not set
358 491
359# 492#
360# Non-8250 serial port support 493# Non-8250 serial port support
361# 494#
362CONFIG_SERIAL_W90X900=y
363# CONFIG_SERIAL_W90X900_PORT1 is not set
364# CONFIG_SERIAL_W90X900_PORT2 is not set
365# CONFIG_SERIAL_W90X900_PORT3 is not set
366# CONFIG_SERIAL_W90X900_PORT4 is not set
367CONFIG_SERIAL_W90X900_CONSOLE=y
368CONFIG_SERIAL_CORE=y 495CONFIG_SERIAL_CORE=y
369CONFIG_SERIAL_CORE_CONSOLE=y 496CONFIG_SERIAL_CORE_CONSOLE=y
370CONFIG_UNIX98_PTYS=y 497CONFIG_UNIX98_PTYS=y
498# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
371# CONFIG_LEGACY_PTYS is not set 499# CONFIG_LEGACY_PTYS is not set
372# CONFIG_IPMI_HANDLER is not set 500# CONFIG_IPMI_HANDLER is not set
373# CONFIG_HW_RANDOM is not set 501# CONFIG_HW_RANDOM is not set
374# CONFIG_NVRAM is not set
375# CONFIG_R3964 is not set 502# CONFIG_R3964 is not set
376# CONFIG_RAW_DRIVER is not set 503# CONFIG_RAW_DRIVER is not set
377# CONFIG_TCG_TPM is not set 504# CONFIG_TCG_TPM is not set
378# CONFIG_I2C is not set 505# CONFIG_I2C is not set
379# CONFIG_SPI is not set 506# CONFIG_SPI is not set
507CONFIG_ARCH_REQUIRE_GPIOLIB=y
508CONFIG_GPIOLIB=y
509# CONFIG_GPIO_SYSFS is not set
510
511#
512# Memory mapped GPIO expanders:
513#
514
515#
516# I2C GPIO expanders:
517#
518
519#
520# PCI GPIO expanders:
521#
522
523#
524# SPI GPIO expanders:
525#
380# CONFIG_W1 is not set 526# CONFIG_W1 is not set
381# CONFIG_POWER_SUPPLY is not set 527# CONFIG_POWER_SUPPLY is not set
382# CONFIG_HWMON is not set 528# CONFIG_HWMON is not set
529# CONFIG_THERMAL is not set
530# CONFIG_THERMAL_HWMON is not set
383# CONFIG_WATCHDOG is not set 531# CONFIG_WATCHDOG is not set
532CONFIG_SSB_POSSIBLE=y
384 533
385# 534#
386# Sonics Silicon Backplane 535# Sonics Silicon Backplane
387# 536#
388CONFIG_SSB_POSSIBLE=y
389# CONFIG_SSB is not set 537# CONFIG_SSB is not set
390 538
391# 539#
@@ -393,10 +541,11 @@ CONFIG_SSB_POSSIBLE=y
393# 541#
394# CONFIG_MFD_CORE is not set 542# CONFIG_MFD_CORE is not set
395# CONFIG_MFD_SM501 is not set 543# CONFIG_MFD_SM501 is not set
544# CONFIG_MFD_ASIC3 is not set
545# CONFIG_HTC_EGPIO is not set
396# CONFIG_HTC_PASIC3 is not set 546# CONFIG_HTC_PASIC3 is not set
397# CONFIG_MFD_TMIO is not set 547# CONFIG_MFD_TMIO is not set
398# CONFIG_MFD_T7L66XB is not set 548# CONFIG_MFD_TC6393XB is not set
399# CONFIG_MFD_TC6387XB is not set
400 549
401# 550#
402# Multimedia devices 551# Multimedia devices
@@ -433,33 +582,131 @@ CONFIG_SSB_POSSIBLE=y
433CONFIG_DUMMY_CONSOLE=y 582CONFIG_DUMMY_CONSOLE=y
434# CONFIG_SOUND is not set 583# CONFIG_SOUND is not set
435# CONFIG_HID_SUPPORT is not set 584# CONFIG_HID_SUPPORT is not set
436# CONFIG_USB_SUPPORT is not set 585CONFIG_USB_SUPPORT=y
586CONFIG_USB_ARCH_HAS_HCD=y
587# CONFIG_USB_ARCH_HAS_OHCI is not set
588# CONFIG_USB_ARCH_HAS_EHCI is not set
589CONFIG_USB=y
590# CONFIG_USB_DEBUG is not set
591# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
592
593#
594# Miscellaneous USB options
595#
596# CONFIG_USB_DEVICEFS is not set
597CONFIG_USB_DEVICE_CLASS=y
598# CONFIG_USB_DYNAMIC_MINORS is not set
599# CONFIG_USB_OTG is not set
600CONFIG_USB_MON=y
601# CONFIG_USB_WUSB is not set
602# CONFIG_USB_WUSB_CBAF is not set
603
604#
605# USB Host Controller Drivers
606#
607# CONFIG_USB_C67X00_HCD is not set
608# CONFIG_USB_OXU210HP_HCD is not set
609# CONFIG_USB_ISP116X_HCD is not set
610# CONFIG_USB_ISP1760_HCD is not set
611# CONFIG_USB_SL811_HCD is not set
612# CONFIG_USB_R8A66597_HCD is not set
613# CONFIG_USB_HWA_HCD is not set
614
615#
616# USB Device Class drivers
617#
618# CONFIG_USB_ACM is not set
619# CONFIG_USB_PRINTER is not set
620# CONFIG_USB_WDM is not set
621# CONFIG_USB_TMC is not set
622
623#
624# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
625#
626
627#
628# also be needed; see USB_STORAGE Help for more info
629#
630CONFIG_USB_STORAGE=y
631# CONFIG_USB_STORAGE_DEBUG is not set
632# CONFIG_USB_STORAGE_DATAFAB is not set
633# CONFIG_USB_STORAGE_FREECOM is not set
634# CONFIG_USB_STORAGE_ISD200 is not set
635# CONFIG_USB_STORAGE_USBAT is not set
636# CONFIG_USB_STORAGE_SDDR09 is not set
637# CONFIG_USB_STORAGE_SDDR55 is not set
638# CONFIG_USB_STORAGE_JUMPSHOT is not set
639# CONFIG_USB_STORAGE_ALAUDA is not set
640# CONFIG_USB_STORAGE_ONETOUCH is not set
641# CONFIG_USB_STORAGE_KARMA is not set
642# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
643# CONFIG_USB_LIBUSUAL is not set
644
645#
646# USB Imaging devices
647#
648# CONFIG_USB_MDC800 is not set
649# CONFIG_USB_MICROTEK is not set
650
651#
652# USB port drivers
653#
654# CONFIG_USB_SERIAL is not set
655
656#
657# USB Miscellaneous drivers
658#
659# CONFIG_USB_EMI62 is not set
660# CONFIG_USB_EMI26 is not set
661# CONFIG_USB_ADUTUX is not set
662# CONFIG_USB_SEVSEG is not set
663# CONFIG_USB_RIO500 is not set
664# CONFIG_USB_LEGOTOWER is not set
665# CONFIG_USB_LCD is not set
666# CONFIG_USB_BERRY_CHARGE is not set
667# CONFIG_USB_LED is not set
668# CONFIG_USB_CYPRESS_CY7C63 is not set
669# CONFIG_USB_CYTHERM is not set
670# CONFIG_USB_IDMOUSE is not set
671# CONFIG_USB_FTDI_ELAN is not set
672# CONFIG_USB_APPLEDISPLAY is not set
673# CONFIG_USB_LD is not set
674# CONFIG_USB_TRANCEVIBRATOR is not set
675# CONFIG_USB_IOWARRIOR is not set
676# CONFIG_USB_ISIGHTFW is not set
677# CONFIG_USB_VST is not set
678# CONFIG_USB_GADGET is not set
679
680#
681# OTG and related infrastructure
682#
683# CONFIG_USB_GPIO_VBUS is not set
684# CONFIG_NOP_USB_XCEIV is not set
437# CONFIG_MMC is not set 685# CONFIG_MMC is not set
686# CONFIG_MEMSTICK is not set
687# CONFIG_ACCESSIBILITY is not set
438# CONFIG_NEW_LEDS is not set 688# CONFIG_NEW_LEDS is not set
439CONFIG_RTC_LIB=y 689CONFIG_RTC_LIB=y
440# CONFIG_RTC_CLASS is not set 690# CONFIG_RTC_CLASS is not set
441# CONFIG_DMADEVICES is not set 691# CONFIG_DMADEVICES is not set
442 692# CONFIG_AUXDISPLAY is not set
443#
444# Voltage and Current regulators
445#
446# CONFIG_REGULATOR is not set 693# CONFIG_REGULATOR is not set
447# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
448# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
449# CONFIG_REGULATOR_BQ24022 is not set
450# CONFIG_UIO is not set 694# CONFIG_UIO is not set
695# CONFIG_STAGING is not set
451 696
452# 697#
453# File systems 698# File systems
454# 699#
455# CONFIG_EXT2_FS is not set 700# CONFIG_EXT2_FS is not set
456# CONFIG_EXT3_FS is not set 701# CONFIG_EXT3_FS is not set
457# CONFIG_EXT4DEV_FS is not set 702# CONFIG_EXT4_FS is not set
458# CONFIG_REISERFS_FS is not set 703# CONFIG_REISERFS_FS is not set
459# CONFIG_JFS_FS is not set 704# CONFIG_JFS_FS is not set
460CONFIG_FS_POSIX_ACL=y 705CONFIG_FS_POSIX_ACL=y
706CONFIG_FILE_LOCKING=y
461# CONFIG_XFS_FS is not set 707# CONFIG_XFS_FS is not set
462# CONFIG_GFS2_FS is not set 708# CONFIG_GFS2_FS is not set
709# CONFIG_BTRFS_FS is not set
463# CONFIG_DNOTIFY is not set 710# CONFIG_DNOTIFY is not set
464# CONFIG_INOTIFY is not set 711# CONFIG_INOTIFY is not set
465# CONFIG_QUOTA is not set 712# CONFIG_QUOTA is not set
@@ -469,6 +716,11 @@ CONFIG_FS_POSIX_ACL=y
469CONFIG_GENERIC_ACL=y 716CONFIG_GENERIC_ACL=y
470 717
471# 718#
719# Caches
720#
721# CONFIG_FSCACHE is not set
722
723#
472# CD-ROM/DVD Filesystems 724# CD-ROM/DVD Filesystems
473# 725#
474# CONFIG_ISO9660_FS is not set 726# CONFIG_ISO9660_FS is not set
@@ -486,15 +738,13 @@ CONFIG_GENERIC_ACL=y
486# 738#
487CONFIG_PROC_FS=y 739CONFIG_PROC_FS=y
488CONFIG_PROC_SYSCTL=y 740CONFIG_PROC_SYSCTL=y
741CONFIG_PROC_PAGE_MONITOR=y
489CONFIG_SYSFS=y 742CONFIG_SYSFS=y
490CONFIG_TMPFS=y 743CONFIG_TMPFS=y
491CONFIG_TMPFS_POSIX_ACL=y 744CONFIG_TMPFS_POSIX_ACL=y
492# CONFIG_HUGETLB_PAGE is not set 745# CONFIG_HUGETLB_PAGE is not set
493# CONFIG_CONFIGFS_FS is not set 746# CONFIG_CONFIGFS_FS is not set
494 747CONFIG_MISC_FILESYSTEMS=y
495#
496# Miscellaneous filesystems
497#
498# CONFIG_ADFS_FS is not set 748# CONFIG_ADFS_FS is not set
499# CONFIG_AFFS_FS is not set 749# CONFIG_AFFS_FS is not set
500# CONFIG_HFS_FS is not set 750# CONFIG_HFS_FS is not set
@@ -502,15 +752,22 @@ CONFIG_TMPFS_POSIX_ACL=y
502# CONFIG_BEFS_FS is not set 752# CONFIG_BEFS_FS is not set
503# CONFIG_BFS_FS is not set 753# CONFIG_BFS_FS is not set
504# CONFIG_EFS_FS is not set 754# CONFIG_EFS_FS is not set
755# CONFIG_JFFS2_FS is not set
505# CONFIG_CRAMFS is not set 756# CONFIG_CRAMFS is not set
757# CONFIG_SQUASHFS is not set
506# CONFIG_VXFS_FS is not set 758# CONFIG_VXFS_FS is not set
507# CONFIG_MINIX_FS is not set 759# CONFIG_MINIX_FS is not set
508# CONFIG_OMFS_FS is not set 760# CONFIG_OMFS_FS is not set
509# CONFIG_HPFS_FS is not set 761# CONFIG_HPFS_FS is not set
510# CONFIG_QNX4FS_FS is not set 762# CONFIG_QNX4FS_FS is not set
511CONFIG_ROMFS_FS=y 763CONFIG_ROMFS_FS=y
764CONFIG_ROMFS_BACKED_BY_BLOCK=y
765# CONFIG_ROMFS_BACKED_BY_MTD is not set
766# CONFIG_ROMFS_BACKED_BY_BOTH is not set
767CONFIG_ROMFS_ON_BLOCK=y
512# CONFIG_SYSV_FS is not set 768# CONFIG_SYSV_FS is not set
513# CONFIG_UFS_FS is not set 769# CONFIG_UFS_FS is not set
770# CONFIG_NILFS2_FS is not set
514 771
515# 772#
516# Partition Types 773# Partition Types
@@ -586,18 +843,36 @@ CONFIG_FRAME_WARN=1024
586CONFIG_DEBUG_FS=y 843CONFIG_DEBUG_FS=y
587# CONFIG_HEADERS_CHECK is not set 844# CONFIG_HEADERS_CHECK is not set
588# CONFIG_DEBUG_KERNEL is not set 845# CONFIG_DEBUG_KERNEL is not set
846CONFIG_STACKTRACE=y
589CONFIG_DEBUG_BUGVERBOSE=y 847CONFIG_DEBUG_BUGVERBOSE=y
590CONFIG_DEBUG_MEMORY_INIT=y 848CONFIG_DEBUG_MEMORY_INIT=y
591CONFIG_FRAME_POINTER=y 849# CONFIG_RCU_CPU_STALL_DETECTOR is not set
592# CONFIG_LATENCYTOP is not set 850# CONFIG_LATENCYTOP is not set
593# CONFIG_SYSCTL_SYSCALL_CHECK is not set 851# CONFIG_SYSCTL_SYSCALL_CHECK is not set
594CONFIG_HAVE_FTRACE=y 852CONFIG_NOP_TRACER=y
595CONFIG_HAVE_DYNAMIC_FTRACE=y 853CONFIG_HAVE_FUNCTION_TRACER=y
596# CONFIG_FTRACE is not set 854CONFIG_RING_BUFFER=y
855CONFIG_TRACING=y
856CONFIG_TRACING_SUPPORT=y
857
858#
859# Tracers
860#
861# CONFIG_FUNCTION_TRACER is not set
597# CONFIG_SCHED_TRACER is not set 862# CONFIG_SCHED_TRACER is not set
598# CONFIG_CONTEXT_SWITCH_TRACER is not set 863# CONFIG_CONTEXT_SWITCH_TRACER is not set
864# CONFIG_EVENT_TRACER is not set
865# CONFIG_BOOT_TRACER is not set
866# CONFIG_TRACE_BRANCH_PROFILING is not set
867# CONFIG_STACK_TRACER is not set
868# CONFIG_KMEMTRACE is not set
869# CONFIG_WORKQUEUE_TRACER is not set
870CONFIG_BLK_DEV_IO_TRACE=y
871# CONFIG_FTRACE_STARTUP_TEST is not set
872# CONFIG_DYNAMIC_DEBUG is not set
599# CONFIG_SAMPLES is not set 873# CONFIG_SAMPLES is not set
600CONFIG_HAVE_ARCH_KGDB=y 874CONFIG_HAVE_ARCH_KGDB=y
875CONFIG_ARM_UNWIND=y
601# CONFIG_DEBUG_USER is not set 876# CONFIG_DEBUG_USER is not set
602 877
603# 878#
@@ -605,14 +880,15 @@ CONFIG_HAVE_ARCH_KGDB=y
605# 880#
606# CONFIG_KEYS is not set 881# CONFIG_KEYS is not set
607# CONFIG_SECURITY is not set 882# CONFIG_SECURITY is not set
883# CONFIG_SECURITYFS is not set
608# CONFIG_SECURITY_FILE_CAPABILITIES is not set 884# CONFIG_SECURITY_FILE_CAPABILITIES is not set
609# CONFIG_CRYPTO is not set 885# CONFIG_CRYPTO is not set
886CONFIG_BINARY_PRINTF=y
610 887
611# 888#
612# Library routines 889# Library routines
613# 890#
614# CONFIG_GENERIC_FIND_FIRST_BIT is not set 891CONFIG_GENERIC_FIND_LAST_BIT=y
615# CONFIG_GENERIC_FIND_NEXT_BIT is not set
616# CONFIG_CRC_CCITT is not set 892# CONFIG_CRC_CCITT is not set
617# CONFIG_CRC16 is not set 893# CONFIG_CRC16 is not set
618# CONFIG_CRC_T10DIF is not set 894# CONFIG_CRC_T10DIF is not set
@@ -620,7 +896,10 @@ CONFIG_HAVE_ARCH_KGDB=y
620# CONFIG_CRC32 is not set 896# CONFIG_CRC32 is not set
621# CONFIG_CRC7 is not set 897# CONFIG_CRC7 is not set
622# CONFIG_LIBCRC32C is not set 898# CONFIG_LIBCRC32C is not set
623CONFIG_PLIST=y 899CONFIG_ZLIB_INFLATE=y
900CONFIG_DECOMPRESS_GZIP=y
901CONFIG_DECOMPRESS_BZIP2=y
902CONFIG_DECOMPRESS_LZMA=y
624CONFIG_HAS_IOMEM=y 903CONFIG_HAS_IOMEM=y
625CONFIG_HAS_IOPORT=y 904CONFIG_HAS_IOPORT=y
626CONFIG_HAS_DMA=y 905CONFIG_HAS_DMA=y
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 16b52f397983..9e07fe507029 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -249,6 +249,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
249#define smp_mb__before_atomic_inc() smp_mb() 249#define smp_mb__before_atomic_inc() smp_mb()
250#define smp_mb__after_atomic_inc() smp_mb() 250#define smp_mb__after_atomic_inc() smp_mb()
251 251
252#include <asm-generic/atomic.h> 252#include <asm-generic/atomic-long.h>
253#endif 253#endif
254#endif 254#endif
diff --git a/arch/arm/include/asm/bitsperlong.h b/arch/arm/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/arm/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index bb7d695f3900..1a711ea8418b 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -429,6 +429,14 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
429 __flush_anon_page(vma, page, vmaddr); 429 __flush_anon_page(vma, page, vmaddr);
430} 430}
431 431
432#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
433static inline void flush_kernel_dcache_page(struct page *page)
434{
435 /* highmem pages are always flushed upon kunmap already */
436 if ((cache_is_vivt() || cache_is_vipt_aliasing()) && !PageHighMem(page))
437 __cpuc_flush_dcache_page(page_address(page));
438}
439
432#define flush_dcache_mmap_lock(mapping) \ 440#define flush_dcache_mmap_lock(mapping) \
433 spin_lock_irq(&(mapping)->tree_lock) 441 spin_lock_irq(&(mapping)->tree_lock)
434#define flush_dcache_mmap_unlock(mapping) \ 442#define flush_dcache_mmap_unlock(mapping) \
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index 7b9d27e749b8..b3e656c6fb78 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -8,6 +8,21 @@
8#define CPUID_TCM 2 8#define CPUID_TCM 2
9#define CPUID_TLBTYPE 3 9#define CPUID_TLBTYPE 3
10 10
11#define CPUID_EXT_PFR0 "c1, 0"
12#define CPUID_EXT_PFR1 "c1, 1"
13#define CPUID_EXT_DFR0 "c1, 2"
14#define CPUID_EXT_AFR0 "c1, 3"
15#define CPUID_EXT_MMFR0 "c1, 4"
16#define CPUID_EXT_MMFR1 "c1, 5"
17#define CPUID_EXT_MMFR2 "c1, 6"
18#define CPUID_EXT_MMFR3 "c1, 7"
19#define CPUID_EXT_ISAR0 "c2, 0"
20#define CPUID_EXT_ISAR1 "c2, 1"
21#define CPUID_EXT_ISAR2 "c2, 2"
22#define CPUID_EXT_ISAR3 "c2, 3"
23#define CPUID_EXT_ISAR4 "c2, 4"
24#define CPUID_EXT_ISAR5 "c2, 5"
25
11#ifdef CONFIG_CPU_CP15 26#ifdef CONFIG_CPU_CP15
12#define read_cpuid(reg) \ 27#define read_cpuid(reg) \
13 ({ \ 28 ({ \
@@ -18,9 +33,19 @@
18 : "cc"); \ 33 : "cc"); \
19 __val; \ 34 __val; \
20 }) 35 })
36#define read_cpuid_ext(ext_reg) \
37 ({ \
38 unsigned int __val; \
39 asm("mrc p15, 0, %0, c0, " ext_reg \
40 : "=r" (__val) \
41 : \
42 : "cc"); \
43 __val; \
44 })
21#else 45#else
22extern unsigned int processor_id; 46extern unsigned int processor_id;
23#define read_cpuid(reg) (processor_id) 47#define read_cpuid(reg) (processor_id)
48#define read_cpuid_ext(reg) 0
24#endif 49#endif
25 50
26/* 51/*
diff --git a/arch/arm/include/asm/hardware/arm_twd.h b/arch/arm/include/asm/hardware/arm_twd.h
deleted file mode 100644
index e521b70713c8..000000000000
--- a/arch/arm/include/asm/hardware/arm_twd.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __ASM_HARDWARE_TWD_H
2#define __ASM_HARDWARE_TWD_H
3
4#define TWD_TIMER_LOAD 0x00
5#define TWD_TIMER_COUNTER 0x04
6#define TWD_TIMER_CONTROL 0x08
7#define TWD_TIMER_INTSTAT 0x0C
8
9#define TWD_WDOG_LOAD 0x20
10#define TWD_WDOG_COUNTER 0x24
11#define TWD_WDOG_CONTROL 0x28
12#define TWD_WDOG_INTSTAT 0x2C
13#define TWD_WDOG_RESETSTAT 0x30
14#define TWD_WDOG_DISABLE 0x34
15
16#define TWD_TIMER_CONTROL_ENABLE (1 << 0)
17#define TWD_TIMER_CONTROL_ONESHOT (0 << 1)
18#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
19#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
20
21#endif
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 64f2252a25cd..cdb9022716fd 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -24,6 +24,8 @@
24#define L2X0_CACHE_TYPE 0x004 24#define L2X0_CACHE_TYPE 0x004
25#define L2X0_CTRL 0x100 25#define L2X0_CTRL 0x100
26#define L2X0_AUX_CTRL 0x104 26#define L2X0_AUX_CTRL 0x104
27#define L2X0_TAG_LATENCY_CTRL 0x108
28#define L2X0_DATA_LATENCY_CTRL 0x10C
27#define L2X0_EVENT_CNT_CTRL 0x200 29#define L2X0_EVENT_CNT_CTRL 0x200
28#define L2X0_EVENT_CNT1_CFG 0x204 30#define L2X0_EVENT_CNT1_CFG 0x204
29#define L2X0_EVENT_CNT0_CFG 0x208 31#define L2X0_EVENT_CNT0_CFG 0x208
diff --git a/arch/arm/include/asm/hardware/pl080.h b/arch/arm/include/asm/hardware/pl080.h
new file mode 100644
index 000000000000..6a6c66be7f65
--- /dev/null
+++ b/arch/arm/include/asm/hardware/pl080.h
@@ -0,0 +1,138 @@
1/* arch/arm/include/asm/hardware/pl080.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * ARM PrimeCell PL080 DMA controller
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15/* Note, there are some Samsung updates to this controller block which
16 * make it not entierly compatible with the PL080 specification from
17 * ARM. When in doubt, check the Samsung documentation first.
18 *
19 * The Samsung defines are PL080S, and add an extra controll register,
20 * the ability to move more than 2^11 counts of data and some extra
21 * OneNAND features.
22*/
23
24#define PL080_INT_STATUS (0x00)
25#define PL080_TC_STATUS (0x04)
26#define PL080_TC_CLEAR (0x08)
27#define PL080_ERR_STATUS (0x0C)
28#define PL080_ERR_CLEAR (0x10)
29#define PL080_RAW_TC_STATUS (0x14)
30#define PL080_RAW_ERR_STATUS (0x18)
31#define PL080_EN_CHAN (0x1c)
32#define PL080_SOFT_BREQ (0x20)
33#define PL080_SOFT_SREQ (0x24)
34#define PL080_SOFT_LBREQ (0x28)
35#define PL080_SOFT_LSREQ (0x2C)
36
37#define PL080_CONFIG (0x30)
38#define PL080_CONFIG_M2_BE (1 << 2)
39#define PL080_CONFIG_M1_BE (1 << 1)
40#define PL080_CONFIG_ENABLE (1 << 0)
41
42#define PL080_SYNC (0x34)
43
44/* Per channel configuration registers */
45
46#define PL008_Cx_STRIDE (0x20)
47#define PL080_Cx_BASE(x) ((0x100 + (x * 0x20)))
48#define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20)))
49#define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20)))
50#define PL080_Cx_LLI(x) ((0x108 + (x * 0x20)))
51#define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20)))
52#define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20)))
53#define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20)))
54#define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20)))
55
56#define PL080_CH_SRC_ADDR (0x00)
57#define PL080_CH_DST_ADDR (0x04)
58#define PL080_CH_LLI (0x08)
59#define PL080_CH_CONTROL (0x0C)
60#define PL080_CH_CONFIG (0x10)
61#define PL080S_CH_CONTROL2 (0x10)
62#define PL080S_CH_CONFIG (0x14)
63
64#define PL080_LLI_ADDR_MASK (0x3fffffff << 2)
65#define PL080_LLI_ADDR_SHIFT (2)
66#define PL080_LLI_LM_AHB2 (1 << 0)
67
68#define PL080_CONTROL_TC_IRQ_EN (1 << 31)
69#define PL080_CONTROL_PROT_MASK (0x7 << 28)
70#define PL080_CONTROL_PROT_SHIFT (28)
71#define PL080_CONTROL_PROT_SYS (1 << 28)
72#define PL080_CONTROL_DST_INCR (1 << 27)
73#define PL080_CONTROL_SRC_INCR (1 << 26)
74#define PL080_CONTROL_DST_AHB2 (1 << 25)
75#define PL080_CONTROL_SRC_AHB2 (1 << 24)
76#define PL080_CONTROL_DWIDTH_MASK (0x7 << 21)
77#define PL080_CONTROL_DWIDTH_SHIFT (21)
78#define PL080_CONTROL_SWIDTH_MASK (0x7 << 18)
79#define PL080_CONTROL_SWIDTH_SHIFT (18)
80#define PL080_CONTROL_DB_SIZE_MASK (0x7 << 15)
81#define PL080_CONTROL_DB_SIZE_SHIFT (15)
82#define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12)
83#define PL080_CONTROL_SB_SIZE_SHIFT (12)
84#define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0)
85#define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0)
86
87#define PL080_BSIZE_1 (0x0)
88#define PL080_BSIZE_4 (0x1)
89#define PL080_BSIZE_8 (0x2)
90#define PL080_BSIZE_16 (0x3)
91#define PL080_BSIZE_32 (0x4)
92#define PL080_BSIZE_64 (0x5)
93#define PL080_BSIZE_128 (0x6)
94#define PL080_BSIZE_256 (0x7)
95
96#define PL080_WIDTH_8BIT (0x0)
97#define PL080_WIDTH_16BIT (0x1)
98#define PL080_WIDTH_32BIT (0x2)
99
100#define PL080_CONFIG_HALT (1 << 18)
101#define PL080_CONFIG_ACTIVE (1 << 17) /* RO */
102#define PL080_CONFIG_LOCK (1 << 16)
103#define PL080_CONFIG_TC_IRQ_MASK (1 << 15)
104#define PL080_CONFIG_ERR_IRQ_MASK (1 << 14)
105#define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11)
106#define PL080_CONFIG_FLOW_CONTROL_SHIFT (11)
107#define PL080_CONFIG_DST_SEL_MASK (0xf << 6)
108#define PL080_CONFIG_DST_SEL_SHIFT (6)
109#define PL080_CONFIG_SRC_SEL_MASK (0xf << 1)
110#define PL080_CONFIG_SRC_SEL_SHIFT (1)
111#define PL080_CONFIG_ENABLE (1 << 0)
112
113#define PL080_FLOW_MEM2MEM (0x0)
114#define PL080_FLOW_MEM2PER (0x1)
115#define PL080_FLOW_PER2MEM (0x2)
116#define PL080_FLOW_SRC2DST (0x3)
117#define PL080_FLOW_SRC2DST_DST (0x4)
118#define PL080_FLOW_MEM2PER_PER (0x5)
119#define PL080_FLOW_PER2MEM_PER (0x6)
120#define PL080_FLOW_SRC2DST_SRC (0x7)
121
122/* DMA linked list chain structure */
123
124struct pl080_lli {
125 u32 src_addr;
126 u32 dst_addr;
127 u32 next_lli;
128 u32 control0;
129};
130
131struct pl080s_lli {
132 u32 src_addr;
133 u32 dst_addr;
134 u32 next_lli;
135 u32 control0;
136 u32 control1;
137};
138
diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h
index f87328d4a180..5d72550a8097 100644
--- a/arch/arm/include/asm/hardware/vic.h
+++ b/arch/arm/include/asm/hardware/vic.h
@@ -41,7 +41,7 @@
41#define VIC_PL192_VECT_ADDR 0xF00 41#define VIC_PL192_VECT_ADDR 0xF00
42 42
43#ifndef __ASSEMBLY__ 43#ifndef __ASSEMBLY__
44void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources); 44void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
45#endif 45#endif
46 46
47#endif 47#endif
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
new file mode 100644
index 000000000000..50c7e7cfd670
--- /dev/null
+++ b/arch/arm/include/asm/localtimer.h
@@ -0,0 +1,63 @@
1/*
2 * arch/arm/include/asm/localtimer.h
3 *
4 * Copyright (C) 2004-2005 ARM Ltd.
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARM_LOCALTIMER_H
11#define __ASM_ARM_LOCALTIMER_H
12
13struct clock_event_device;
14
15/*
16 * Setup a per-cpu timer, whether it be a local timer or dummy broadcast
17 */
18void percpu_timer_setup(void);
19
20/*
21 * Called from assembly, this is the local timer IRQ handler
22 */
23asmlinkage void do_local_timer(struct pt_regs *);
24
25
26#ifdef CONFIG_LOCAL_TIMERS
27
28#ifdef CONFIG_HAVE_ARM_TWD
29
30#include "smp_twd.h"
31
32#define local_timer_ack() twd_timer_ack()
33#define local_timer_stop() twd_timer_stop()
34
35#else
36
37/*
38 * Platform provides this to acknowledge a local timer IRQ.
39 * Returns true if the local timer IRQ is to be processed.
40 */
41int local_timer_ack(void);
42
43/*
44 * Stop a local timer interrupt.
45 */
46void local_timer_stop(void);
47
48#endif
49
50/*
51 * Setup a local timer interrupt for a CPU.
52 */
53void local_timer_setup(struct clock_event_device *);
54
55#else
56
57static inline void local_timer_stop(void)
58{
59}
60
61#endif
62
63#endif
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 58cf91f38e6f..742c2aaeb020 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -30,6 +30,14 @@ struct map_desc {
30 30
31#ifdef CONFIG_MMU 31#ifdef CONFIG_MMU
32extern void iotable_init(struct map_desc *, int); 32extern void iotable_init(struct map_desc *, int);
33
34struct mem_type;
35extern const struct mem_type *get_mem_type(unsigned int type);
36/*
37 * external interface to remap single page with appropriate type
38 */
39extern int ioremap_page(unsigned long virt, unsigned long phys,
40 const struct mem_type *mtype);
33#else 41#else
34#define iotable_init(map,num) do { } while (0) 42#define iotable_init(map,num) do { } while (0)
35#endif 43#endif
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index 54570d2e95b7..fc26976d8e3a 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __ARM_MMAN_H__ 1#ifndef __ARM_MMAN_H__
2#define __ARM_MMAN_H__ 2#define __ARM_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index 7b522770f29d..be962c1349c4 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -202,6 +202,6 @@ typedef struct page *pgtable_t;
202 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \ 202 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
203 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 203 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
204 204
205#include <asm-generic/page.h> 205#include <asm-generic/getorder.h>
206 206
207#endif 207#endif
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 110295c5461d..1cd2d6416bda 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -342,7 +342,7 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
342 return __va(ptr); 342 return __va(ptr);
343} 343}
344 344
345#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd))) 345#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd)))
346 346
347/* 347/*
348 * Conversion functions: convert a page and protection to a page entry, 348 * Conversion functions: convert a page and protection to a page entry,
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index 1845892260e7..6a89567ffc5b 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -71,6 +71,7 @@ struct thread_struct {
71 regs->ARM_cpsr = USR26_MODE; \ 71 regs->ARM_cpsr = USR26_MODE; \
72 if (elf_hwcap & HWCAP_THUMB && pc & 1) \ 72 if (elf_hwcap & HWCAP_THUMB && pc & 1) \
73 regs->ARM_cpsr |= PSR_T_BIT; \ 73 regs->ARM_cpsr |= PSR_T_BIT; \
74 regs->ARM_cpsr |= PSR_ENDSTATE; \
74 regs->ARM_pc = pc & ~1; /* pc */ \ 75 regs->ARM_pc = pc & ~1; /* pc */ \
75 regs->ARM_sp = sp; /* sp */ \ 76 regs->ARM_sp = sp; /* sp */ \
76 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ 77 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 236a06b9b7ce..67b833c9b6b9 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -50,6 +50,7 @@
50#define PSR_F_BIT 0x00000040 50#define PSR_F_BIT 0x00000040
51#define PSR_I_BIT 0x00000080 51#define PSR_I_BIT 0x00000080
52#define PSR_A_BIT 0x00000100 52#define PSR_A_BIT 0x00000100
53#define PSR_E_BIT 0x00000200
53#define PSR_J_BIT 0x01000000 54#define PSR_J_BIT 0x01000000
54#define PSR_Q_BIT 0x08000000 55#define PSR_Q_BIT 0x08000000
55#define PSR_V_BIT 0x10000000 56#define PSR_V_BIT 0x10000000
@@ -65,6 +66,22 @@
65#define PSR_x 0x0000ff00 /* Extension */ 66#define PSR_x 0x0000ff00 /* Extension */
66#define PSR_c 0x000000ff /* Control */ 67#define PSR_c 0x000000ff /* Control */
67 68
69/*
70 * ARMv7 groups of APSR bits
71 */
72#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
73#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
74#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
75
76/*
77 * Default endianness state
78 */
79#ifdef CONFIG_CPU_ENDIAN_BE8
80#define PSR_ENDSTATE PSR_E_BIT
81#else
82#define PSR_ENDSTATE 0
83#endif
84
68#ifndef __ASSEMBLY__ 85#ifndef __ASSEMBLY__
69 86
70/* 87/*
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
index d0fb487aba4f..43ba0fb1c8ad 100644
--- a/arch/arm/include/asm/signal.h
+++ b/arch/arm/include/asm/signal.h
@@ -111,7 +111,7 @@ typedef unsigned long sigset_t;
111#define MINSIGSTKSZ 2048 111#define MINSIGSTKSZ 2048
112#define SIGSTKSZ 8192 112#define SIGSTKSZ 8192
113 113
114#include <asm-generic/signal.h> 114#include <asm-generic/signal-defs.h>
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117struct old_sigaction { 117struct old_sigaction {
diff --git a/arch/arm/include/asm/sizes.h b/arch/arm/include/asm/sizes.h
index ada93a8fc2ef..4fc1565e4f93 100644
--- a/arch/arm/include/asm/sizes.h
+++ b/arch/arm/include/asm/sizes.h
@@ -29,6 +29,7 @@
29#define SZ_512 0x00000200 29#define SZ_512 0x00000200
30 30
31#define SZ_1K 0x00000400 31#define SZ_1K 0x00000400
32#define SZ_2K 0x00000800
32#define SZ_4K 0x00001000 33#define SZ_4K 0x00001000
33#define SZ_8K 0x00002000 34#define SZ_8K 0x00002000
34#define SZ_16K 0x00004000 35#define SZ_16K 0x00004000
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 5995935338e1..a06e735b262a 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -41,7 +41,7 @@ extern void show_ipi_list(struct seq_file *p);
41asmlinkage void do_IPI(struct pt_regs *regs); 41asmlinkage void do_IPI(struct pt_regs *regs);
42 42
43/* 43/*
44 * Setup the SMP cpu_possible_map 44 * Setup the set of possible CPUs (via set_cpu_possible)
45 */ 45 */
46extern void smp_init_cpus(void); 46extern void smp_init_cpus(void);
47 47
@@ -56,11 +56,6 @@ extern void smp_store_cpu_info(unsigned int cpuid);
56extern void smp_cross_call(const struct cpumask *mask); 56extern void smp_cross_call(const struct cpumask *mask);
57 57
58/* 58/*
59 * Broadcast a clock event to other CPUs.
60 */
61extern void smp_timer_broadcast(const struct cpumask *mask);
62
63/*
64 * Boot a secondary CPU, and assign it the specified idle task. 59 * Boot a secondary CPU, and assign it the specified idle task.
65 * This also gives us the initial stack to use for this CPU. 60 * This also gives us the initial stack to use for this CPU.
66 */ 61 */
@@ -101,43 +96,8 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
101#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask 96#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
102 97
103/* 98/*
104 * Local timer interrupt handling function (can be IPI'ed).
105 */
106extern void local_timer_interrupt(void);
107
108#ifdef CONFIG_LOCAL_TIMERS
109
110/*
111 * Stop a local timer interrupt.
112 */
113extern void local_timer_stop(void);
114
115/*
116 * Platform provides this to acknowledge a local timer IRQ
117 */
118extern int local_timer_ack(void);
119
120#else
121
122static inline void local_timer_stop(void)
123{
124}
125
126#endif
127
128/*
129 * Setup a local timer interrupt for a CPU.
130 */
131extern void local_timer_setup(void);
132
133/*
134 * show local interrupt info 99 * show local interrupt info
135 */ 100 */
136extern void show_local_irqs(struct seq_file *); 101extern void show_local_irqs(struct seq_file *);
137 102
138/*
139 * Called from assembly, this is the local timer IRQ handler
140 */
141asmlinkage void do_local_timer(struct pt_regs *);
142
143#endif /* ifndef __ASM_ARM_SMP_H */ 103#endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
new file mode 100644
index 000000000000..2376835015d6
--- /dev/null
+++ b/arch/arm/include/asm/smp_scu.h
@@ -0,0 +1,7 @@
1#ifndef __ASMARM_ARCH_SCU_H
2#define __ASMARM_ARCH_SCU_H
3
4unsigned int scu_get_core_count(void __iomem *);
5void scu_enable(void __iomem *);
6
7#endif
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
new file mode 100644
index 000000000000..7be0978b2625
--- /dev/null
+++ b/arch/arm/include/asm/smp_twd.h
@@ -0,0 +1,12 @@
1#ifndef __ASMARM_SMP_TWD_H
2#define __ASMARM_SMP_TWD_H
3
4struct clock_event_device;
5
6extern void __iomem *twd_base;
7
8void twd_timer_stop(void);
9int twd_timer_ack(void);
10void twd_timer_setup(struct clock_event_device *);
11
12#endif
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
deleted file mode 100644
index cf0d0bdee74d..000000000000
--- a/arch/arm/include/asm/suspend.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef _ASMARM_SUSPEND_H
2#define _ASMARM_SUSPEND_H
3
4#endif
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index a62218013c78..c964f3fc3bc5 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -40,6 +40,12 @@
40#define TLB_V6_I_ASID (1 << 18) 40#define TLB_V6_I_ASID (1 << 18)
41 41
42#define TLB_BTB (1 << 28) 42#define TLB_BTB (1 << 28)
43
44/* Unified Inner Shareable TLB operations (ARMv7 MP extensions) */
45#define TLB_V7_UIS_PAGE (1 << 19)
46#define TLB_V7_UIS_FULL (1 << 20)
47#define TLB_V7_UIS_ASID (1 << 21)
48
43#define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */ 49#define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */
44#define TLB_DCLEAN (1 << 30) 50#define TLB_DCLEAN (1 << 30)
45#define TLB_WB (1 << 31) 51#define TLB_WB (1 << 31)
@@ -176,9 +182,17 @@
176# define v6wbi_always_flags (-1UL) 182# define v6wbi_always_flags (-1UL)
177#endif 183#endif
178 184
185#ifdef CONFIG_SMP
186#define v7wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BTB | \
187 TLB_V7_UIS_FULL | TLB_V7_UIS_PAGE | TLB_V7_UIS_ASID)
188#else
189#define v7wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BTB | \
190 TLB_V6_U_FULL | TLB_V6_U_PAGE | TLB_V6_U_ASID)
191#endif
192
179#ifdef CONFIG_CPU_TLB_V7 193#ifdef CONFIG_CPU_TLB_V7
180# define v7wbi_possible_flags v6wbi_tlb_flags 194# define v7wbi_possible_flags v7wbi_tlb_flags
181# define v7wbi_always_flags v6wbi_tlb_flags 195# define v7wbi_always_flags v7wbi_tlb_flags
182# ifdef _TLB 196# ifdef _TLB
183# define MULTI_TLB 1 197# define MULTI_TLB 1
184# else 198# else
@@ -316,6 +330,8 @@ static inline void local_flush_tlb_all(void)
316 asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc"); 330 asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
317 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) 331 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
318 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); 332 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
333 if (tlb_flag(TLB_V7_UIS_FULL))
334 asm("mcr p15, 0, %0, c8, c3, 0" : : "r" (zero) : "cc");
319 335
320 if (tlb_flag(TLB_BTB)) { 336 if (tlb_flag(TLB_BTB)) {
321 /* flush the branch target cache */ 337 /* flush the branch target cache */
@@ -351,6 +367,8 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
351 asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc"); 367 asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc");
352 if (tlb_flag(TLB_V6_I_ASID)) 368 if (tlb_flag(TLB_V6_I_ASID))
353 asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc"); 369 asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
370 if (tlb_flag(TLB_V7_UIS_ASID))
371 asm("mcr p15, 0, %0, c8, c3, 2" : : "r" (asid) : "cc");
354 372
355 if (tlb_flag(TLB_BTB)) { 373 if (tlb_flag(TLB_BTB)) {
356 /* flush the branch target cache */ 374 /* flush the branch target cache */
@@ -389,6 +407,8 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
389 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc"); 407 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
390 if (tlb_flag(TLB_V6_I_PAGE)) 408 if (tlb_flag(TLB_V6_I_PAGE))
391 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc"); 409 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
410 if (tlb_flag(TLB_V7_UIS_PAGE))
411 asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (uaddr) : "cc");
392 412
393 if (tlb_flag(TLB_BTB)) { 413 if (tlb_flag(TLB_BTB)) {
394 /* flush the branch target cache */ 414 /* flush the branch target cache */
@@ -424,6 +444,8 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
424 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc"); 444 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
425 if (tlb_flag(TLB_V6_I_PAGE)) 445 if (tlb_flag(TLB_V6_I_PAGE))
426 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc"); 446 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
447 if (tlb_flag(TLB_V7_UIS_PAGE))
448 asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (kaddr) : "cc");
427 449
428 if (tlb_flag(TLB_BTB)) { 450 if (tlb_flag(TLB_BTB)) {
429 /* flush the branch target cache */ 451 /* flush the branch target cache */
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 7897464e0c24..0da9bc9b3b1d 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -386,7 +386,9 @@ do { \
386#ifdef CONFIG_MMU 386#ifdef CONFIG_MMU
387extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n); 387extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
388extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n); 388extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
389extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n);
389extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); 390extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
391extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n);
390#else 392#else
391#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) 393#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0)
392#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) 394#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0)
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 11a5197a221f..ff89d0b3abc5 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -22,6 +22,8 @@ obj-$(CONFIG_ARTHUR) += arthur.o
22obj-$(CONFIG_ISA_DMA) += dma-isa.o 22obj-$(CONFIG_ISA_DMA) += dma-isa.o
23obj-$(CONFIG_PCI) += bios32.o isa.o 23obj-$(CONFIG_PCI) += bios32.o isa.o
24obj-$(CONFIG_SMP) += smp.o 24obj-$(CONFIG_SMP) += smp.o
25obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
26obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o
25obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 27obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
26obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 28obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
27obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o 29obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 83b1da6b7baa..fc8af43c5000 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -482,6 +482,9 @@ __und_usr:
482 subeq r4, r2, #4 @ ARM instr at LR - 4 482 subeq r4, r2, #4 @ ARM instr at LR - 4
483 subne r4, r2, #2 @ Thumb instr at LR - 2 483 subne r4, r2, #2 @ Thumb instr at LR - 2
4841: ldreqt r0, [r4] 4841: ldreqt r0, [r4]
485#ifdef CONFIG_CPU_ENDIAN_BE8
486 reveq r0, r0 @ little endian instruction
487#endif
485 beq call_fpe 488 beq call_fpe
486 @ Thumb instruction 489 @ Thumb instruction
487#if __LINUX_ARM_ARCH__ >= 7 490#if __LINUX_ARM_ARCH__ >= 7
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index b55cb0331809..366e5097a41a 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -210,6 +210,9 @@ ENTRY(vector_swi)
210 A710( teq ip, #0x0f000000 ) 210 A710( teq ip, #0x0f000000 )
211 A710( bne .Larm710bug ) 211 A710( bne .Larm710bug )
212#endif 212#endif
213#ifdef CONFIG_CPU_ENDIAN_BE8
214 rev r10, r10 @ little endian instruction
215#endif
213 216
214#elif defined(CONFIG_AEABI) 217#elif defined(CONFIG_AEABI)
215 218
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index c3265a2e7cd4..1585423699ee 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -365,7 +365,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
365 regs.ARM_r2 = (unsigned long)fn; 365 regs.ARM_r2 = (unsigned long)fn;
366 regs.ARM_r3 = (unsigned long)do_exit; 366 regs.ARM_r3 = (unsigned long)do_exit;
367 regs.ARM_pc = (unsigned long)kernel_thread_helper; 367 regs.ARM_pc = (unsigned long)kernel_thread_helper;
368 regs.ARM_cpsr = SVC_MODE; 368 regs.ARM_cpsr = SVC_MODE | PSR_ENDSTATE;
369 369
370 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 370 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
371} 371}
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 80b8b5c7e07a..442b87476f97 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -426,9 +426,13 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
426 */ 426 */
427 thumb = handler & 1; 427 thumb = handler & 1;
428 428
429 if (thumb) 429 if (thumb) {
430 cpsr |= PSR_T_BIT; 430 cpsr |= PSR_T_BIT;
431 else 431#if __LINUX_ARM_ARCH__ >= 7
432 /* clear the If-Then Thumb-2 execution state */
433 cpsr &= ~PSR_IT_MASK;
434#endif
435 } else
432 cpsr &= ~PSR_T_BIT; 436 cpsr &= ~PSR_T_BIT;
433 } 437 }
434#endif 438#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 6014dfd22af4..de885fd256c5 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -22,16 +22,20 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/seq_file.h> 23#include <linux/seq_file.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/percpu.h>
26#include <linux/clockchips.h>
25 27
26#include <asm/atomic.h> 28#include <asm/atomic.h>
27#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
28#include <asm/cpu.h> 30#include <asm/cpu.h>
31#include <asm/cputype.h>
29#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
30#include <asm/pgtable.h> 33#include <asm/pgtable.h>
31#include <asm/pgalloc.h> 34#include <asm/pgalloc.h>
32#include <asm/processor.h> 35#include <asm/processor.h>
33#include <asm/tlbflush.h> 36#include <asm/tlbflush.h>
34#include <asm/ptrace.h> 37#include <asm/ptrace.h>
38#include <asm/localtimer.h>
35 39
36/* 40/*
37 * as from 2.5, kernels no longer have an init_tasks structure 41 * as from 2.5, kernels no longer have an init_tasks structure
@@ -163,7 +167,7 @@ int __cpuexit __cpu_disable(void)
163 * Take this CPU offline. Once we clear this, we can't return, 167 * Take this CPU offline. Once we clear this, we can't return,
164 * and we must not schedule until we're ready to give up the cpu. 168 * and we must not schedule until we're ready to give up the cpu.
165 */ 169 */
166 cpu_clear(cpu, cpu_online_map); 170 set_cpu_online(cpu, false);
167 171
168 /* 172 /*
169 * OK - migrate IRQs away from this CPU 173 * OK - migrate IRQs away from this CPU
@@ -274,9 +278,9 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
274 local_fiq_enable(); 278 local_fiq_enable();
275 279
276 /* 280 /*
277 * Setup local timer for this CPU. 281 * Setup the percpu timer for this CPU.
278 */ 282 */
279 local_timer_setup(); 283 percpu_timer_setup();
280 284
281 calibrate_delay(); 285 calibrate_delay();
282 286
@@ -285,7 +289,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
285 /* 289 /*
286 * OK, now it's safe to let the boot CPU continue 290 * OK, now it's safe to let the boot CPU continue
287 */ 291 */
288 cpu_set(cpu, cpu_online_map); 292 set_cpu_online(cpu, true);
289 293
290 /* 294 /*
291 * OK, it's off to the idle thread for us 295 * OK, it's off to the idle thread for us
@@ -383,10 +387,16 @@ void show_local_irqs(struct seq_file *p)
383 seq_putc(p, '\n'); 387 seq_putc(p, '\n');
384} 388}
385 389
390/*
391 * Timer (local or broadcast) support
392 */
393static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
394
386static void ipi_timer(void) 395static void ipi_timer(void)
387{ 396{
397 struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
388 irq_enter(); 398 irq_enter();
389 local_timer_interrupt(); 399 evt->event_handler(evt);
390 irq_exit(); 400 irq_exit();
391} 401}
392 402
@@ -405,6 +415,42 @@ asmlinkage void __exception do_local_timer(struct pt_regs *regs)
405} 415}
406#endif 416#endif
407 417
418#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
419static void smp_timer_broadcast(const struct cpumask *mask)
420{
421 send_ipi_message(mask, IPI_TIMER);
422}
423
424static void broadcast_timer_set_mode(enum clock_event_mode mode,
425 struct clock_event_device *evt)
426{
427}
428
429static void local_timer_setup(struct clock_event_device *evt)
430{
431 evt->name = "dummy_timer";
432 evt->features = CLOCK_EVT_FEAT_ONESHOT |
433 CLOCK_EVT_FEAT_PERIODIC |
434 CLOCK_EVT_FEAT_DUMMY;
435 evt->rating = 400;
436 evt->mult = 1;
437 evt->set_mode = broadcast_timer_set_mode;
438 evt->broadcast = smp_timer_broadcast;
439
440 clockevents_register_device(evt);
441}
442#endif
443
444void __cpuinit percpu_timer_setup(void)
445{
446 unsigned int cpu = smp_processor_id();
447 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
448
449 evt->cpumask = cpumask_of(cpu);
450
451 local_timer_setup(evt);
452}
453
408static DEFINE_SPINLOCK(stop_lock); 454static DEFINE_SPINLOCK(stop_lock);
409 455
410/* 456/*
@@ -417,7 +463,7 @@ static void ipi_cpu_stop(unsigned int cpu)
417 dump_stack(); 463 dump_stack();
418 spin_unlock(&stop_lock); 464 spin_unlock(&stop_lock);
419 465
420 cpu_clear(cpu, cpu_online_map); 466 set_cpu_online(cpu, false);
421 467
422 local_fiq_disable(); 468 local_fiq_disable();
423 local_irq_disable(); 469 local_irq_disable();
@@ -501,11 +547,6 @@ void smp_send_reschedule(int cpu)
501 send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); 547 send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE);
502} 548}
503 549
504void smp_timer_broadcast(const struct cpumask *mask)
505{
506 send_ipi_message(mask, IPI_TIMER);
507}
508
509void smp_send_stop(void) 550void smp_send_stop(void)
510{ 551{
511 cpumask_t mask = cpu_online_map; 552 cpumask_t mask = cpu_online_map;
@@ -545,6 +586,12 @@ struct tlb_args {
545 unsigned long ta_end; 586 unsigned long ta_end;
546}; 587};
547 588
589/* all SMP configurations have the extended CPUID registers */
590static inline int tlb_ops_need_broadcast(void)
591{
592 return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2;
593}
594
548static inline void ipi_flush_tlb_all(void *ignored) 595static inline void ipi_flush_tlb_all(void *ignored)
549{ 596{
550 local_flush_tlb_all(); 597 local_flush_tlb_all();
@@ -587,51 +634,61 @@ static inline void ipi_flush_tlb_kernel_range(void *arg)
587 634
588void flush_tlb_all(void) 635void flush_tlb_all(void)
589{ 636{
590 on_each_cpu(ipi_flush_tlb_all, NULL, 1); 637 if (tlb_ops_need_broadcast())
638 on_each_cpu(ipi_flush_tlb_all, NULL, 1);
639 else
640 local_flush_tlb_all();
591} 641}
592 642
593void flush_tlb_mm(struct mm_struct *mm) 643void flush_tlb_mm(struct mm_struct *mm)
594{ 644{
595 on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, &mm->cpu_vm_mask); 645 if (tlb_ops_need_broadcast())
646 on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, &mm->cpu_vm_mask);
647 else
648 local_flush_tlb_mm(mm);
596} 649}
597 650
598void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) 651void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
599{ 652{
600 struct tlb_args ta; 653 if (tlb_ops_need_broadcast()) {
601 654 struct tlb_args ta;
602 ta.ta_vma = vma; 655 ta.ta_vma = vma;
603 ta.ta_start = uaddr; 656 ta.ta_start = uaddr;
604 657 on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, &vma->vm_mm->cpu_vm_mask);
605 on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, &vma->vm_mm->cpu_vm_mask); 658 } else
659 local_flush_tlb_page(vma, uaddr);
606} 660}
607 661
608void flush_tlb_kernel_page(unsigned long kaddr) 662void flush_tlb_kernel_page(unsigned long kaddr)
609{ 663{
610 struct tlb_args ta; 664 if (tlb_ops_need_broadcast()) {
611 665 struct tlb_args ta;
612 ta.ta_start = kaddr; 666 ta.ta_start = kaddr;
613 667 on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1);
614 on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); 668 } else
669 local_flush_tlb_kernel_page(kaddr);
615} 670}
616 671
617void flush_tlb_range(struct vm_area_struct *vma, 672void flush_tlb_range(struct vm_area_struct *vma,
618 unsigned long start, unsigned long end) 673 unsigned long start, unsigned long end)
619{ 674{
620 struct tlb_args ta; 675 if (tlb_ops_need_broadcast()) {
621 676 struct tlb_args ta;
622 ta.ta_vma = vma; 677 ta.ta_vma = vma;
623 ta.ta_start = start; 678 ta.ta_start = start;
624 ta.ta_end = end; 679 ta.ta_end = end;
625 680 on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, &vma->vm_mm->cpu_vm_mask);
626 on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, &vma->vm_mm->cpu_vm_mask); 681 } else
682 local_flush_tlb_range(vma, start, end);
627} 683}
628 684
629void flush_tlb_kernel_range(unsigned long start, unsigned long end) 685void flush_tlb_kernel_range(unsigned long start, unsigned long end)
630{ 686{
631 struct tlb_args ta; 687 if (tlb_ops_need_broadcast()) {
632 688 struct tlb_args ta;
633 ta.ta_start = start; 689 ta.ta_start = start;
634 ta.ta_end = end; 690 ta.ta_end = end;
635 691 on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1);
636 on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); 692 } else
693 local_flush_tlb_kernel_range(start, end);
637} 694}
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
new file mode 100644
index 000000000000..d3831f616ee9
--- /dev/null
+++ b/arch/arm/kernel/smp_scu.c
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/kernel/smp_scu.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/io.h>
13
14#include <asm/smp_scu.h>
15#include <asm/cacheflush.h>
16
17#define SCU_CTRL 0x00
18#define SCU_CONFIG 0x04
19#define SCU_CPU_STATUS 0x08
20#define SCU_INVALIDATE 0x0c
21#define SCU_FPGA_REVISION 0x10
22
23/*
24 * Get the number of CPU cores from the SCU configuration
25 */
26unsigned int __init scu_get_core_count(void __iomem *scu_base)
27{
28 unsigned int ncores = __raw_readl(scu_base + SCU_CONFIG);
29 return (ncores & 0x03) + 1;
30}
31
32/*
33 * Enable the SCU
34 */
35void __init scu_enable(void __iomem *scu_base)
36{
37 u32 scu_ctrl;
38
39 scu_ctrl = __raw_readl(scu_base + SCU_CTRL);
40 scu_ctrl |= 1;
41 __raw_writel(scu_ctrl, scu_base + SCU_CTRL);
42
43 /*
44 * Ensure that the data accessed by CPU0 before the SCU was
45 * initialised is visible to the other CPUs.
46 */
47 flush_cache_all();
48}
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
new file mode 100644
index 000000000000..d8c88c633c6f
--- /dev/null
+++ b/arch/arm/kernel/smp_twd.c
@@ -0,0 +1,175 @@
1/*
2 * linux/arch/arm/kernel/smp_twd.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/smp.h>
16#include <linux/jiffies.h>
17#include <linux/clockchips.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include <asm/smp_twd.h>
22#include <asm/hardware/gic.h>
23
24#define TWD_TIMER_LOAD 0x00
25#define TWD_TIMER_COUNTER 0x04
26#define TWD_TIMER_CONTROL 0x08
27#define TWD_TIMER_INTSTAT 0x0C
28
29#define TWD_WDOG_LOAD 0x20
30#define TWD_WDOG_COUNTER 0x24
31#define TWD_WDOG_CONTROL 0x28
32#define TWD_WDOG_INTSTAT 0x2C
33#define TWD_WDOG_RESETSTAT 0x30
34#define TWD_WDOG_DISABLE 0x34
35
36#define TWD_TIMER_CONTROL_ENABLE (1 << 0)
37#define TWD_TIMER_CONTROL_ONESHOT (0 << 1)
38#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
39#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
40
41/* set up by the platform code */
42void __iomem *twd_base;
43
44static unsigned long twd_timer_rate;
45
46static void twd_set_mode(enum clock_event_mode mode,
47 struct clock_event_device *clk)
48{
49 unsigned long ctrl;
50
51 switch (mode) {
52 case CLOCK_EVT_MODE_PERIODIC:
53 /* timer load already set up */
54 ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE
55 | TWD_TIMER_CONTROL_PERIODIC;
56 break;
57 case CLOCK_EVT_MODE_ONESHOT:
58 /* period set, and timer enabled in 'next_event' hook */
59 ctrl = TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT;
60 break;
61 case CLOCK_EVT_MODE_UNUSED:
62 case CLOCK_EVT_MODE_SHUTDOWN:
63 default:
64 ctrl = 0;
65 }
66
67 __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
68}
69
70static int twd_set_next_event(unsigned long evt,
71 struct clock_event_device *unused)
72{
73 unsigned long ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL);
74
75 ctrl |= TWD_TIMER_CONTROL_ENABLE;
76
77 __raw_writel(evt, twd_base + TWD_TIMER_COUNTER);
78 __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
79
80 return 0;
81}
82
83/*
84 * local_timer_ack: checks for a local timer interrupt.
85 *
86 * If a local timer interrupt has occurred, acknowledge and return 1.
87 * Otherwise, return 0.
88 */
89int twd_timer_ack(void)
90{
91 if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) {
92 __raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
93 return 1;
94 }
95
96 return 0;
97}
98
99static void __cpuinit twd_calibrate_rate(void)
100{
101 unsigned long load, count;
102 u64 waitjiffies;
103
104 /*
105 * If this is the first time round, we need to work out how fast
106 * the timer ticks
107 */
108 if (twd_timer_rate == 0) {
109 printk(KERN_INFO "Calibrating local timer... ");
110
111 /* Wait for a tick to start */
112 waitjiffies = get_jiffies_64() + 1;
113
114 while (get_jiffies_64() < waitjiffies)
115 udelay(10);
116
117 /* OK, now the tick has started, let's get the timer going */
118 waitjiffies += 5;
119
120 /* enable, no interrupt or reload */
121 __raw_writel(0x1, twd_base + TWD_TIMER_CONTROL);
122
123 /* maximum value */
124 __raw_writel(0xFFFFFFFFU, twd_base + TWD_TIMER_COUNTER);
125
126 while (get_jiffies_64() < waitjiffies)
127 udelay(10);
128
129 count = __raw_readl(twd_base + TWD_TIMER_COUNTER);
130
131 twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
132
133 printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
134 (twd_timer_rate / 100000) % 100);
135 }
136
137 load = twd_timer_rate / HZ;
138
139 __raw_writel(load, twd_base + TWD_TIMER_LOAD);
140}
141
142/*
143 * Setup the local clock events for a CPU.
144 */
145void __cpuinit twd_timer_setup(struct clock_event_device *clk)
146{
147 unsigned long flags;
148
149 twd_calibrate_rate();
150
151 clk->name = "local_timer";
152 clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
153 clk->rating = 350;
154 clk->set_mode = twd_set_mode;
155 clk->set_next_event = twd_set_next_event;
156 clk->shift = 20;
157 clk->mult = div_sc(twd_timer_rate, NSEC_PER_SEC, clk->shift);
158 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
159 clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
160
161 /* Make sure our local interrupt controller has this enabled */
162 local_irq_save(flags);
163 get_irq_chip(clk->irq)->unmask(clk->irq);
164 local_irq_restore(flags);
165
166 clockevents_register_device(clk);
167}
168
169/*
170 * take a local timer down
171 */
172void __cpuexit twd_timer_stop(void)
173{
174 __raw_writel(0, twd_base + TWD_TIMER_CONTROL);
175}
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index c90f27250ead..6c0779792546 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -141,6 +141,7 @@ SECTIONS
141 141
142 .data : AT(__data_loc) { 142 .data : AT(__data_loc) {
143 _data = .; /* address in memory */ 143 _data = .; /* address in memory */
144 _sdata = .;
144 145
145 /* 146 /*
146 * first, the init task union, aligned 147 * first, the init task union, aligned
@@ -192,6 +193,7 @@ SECTIONS
192 __bss_start = .; /* BSS */ 193 __bss_start = .; /* BSS */
193 *(.bss) 194 *(.bss)
194 *(COMMON) 195 *(COMMON)
196 __bss_stop = .;
195 _end = .; 197 _end = .;
196 } 198 }
197 /* Stabs debugging sections. */ 199 /* Stabs debugging sections. */
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 866f84a586ff..030ba7219f48 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -29,6 +29,9 @@ else
29endif 29endif
30endif 30endif
31 31
32# using lib_ here won't override already available weak symbols
33obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o
34
32lib-$(CONFIG_MMU) += $(mmu-y) 35lib-$(CONFIG_MMU) += $(mmu-y)
33 36
34ifeq ($(CONFIG_CPU_32v3),y) 37ifeq ($(CONFIG_CPU_32v3),y)
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
index 4d6bc71231f3..844f56785ebc 100644
--- a/arch/arm/lib/clear_user.S
+++ b/arch/arm/lib/clear_user.S
@@ -18,7 +18,8 @@
18 * : sz - number of bytes to clear 18 * : sz - number of bytes to clear
19 * Returns : number of bytes NOT cleared 19 * Returns : number of bytes NOT cleared
20 */ 20 */
21ENTRY(__clear_user) 21ENTRY(__clear_user_std)
22WEAK(__clear_user)
22 stmfd sp!, {r1, lr} 23 stmfd sp!, {r1, lr}
23 mov r2, #0 24 mov r2, #0
24 cmp r1, #4 25 cmp r1, #4
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
index 22f968bbdffd..878820f0a320 100644
--- a/arch/arm/lib/copy_to_user.S
+++ b/arch/arm/lib/copy_to_user.S
@@ -86,7 +86,8 @@
86 86
87 .text 87 .text
88 88
89ENTRY(__copy_to_user) 89ENTRY(__copy_to_user_std)
90WEAK(__copy_to_user)
90 91
91#include "copy_template.S" 92#include "copy_template.S"
92 93
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
new file mode 100644
index 000000000000..6b967ffb6552
--- /dev/null
+++ b/arch/arm/lib/uaccess_with_memcpy.c
@@ -0,0 +1,228 @@
1/*
2 * linux/arch/arm/lib/uaccess_with_memcpy.c
3 *
4 * Written by: Lennert Buytenhek and Nicolas Pitre
5 * Copyright (C) 2009 Marvell Semiconductor
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/ctype.h>
14#include <linux/uaccess.h>
15#include <linux/rwsem.h>
16#include <linux/mm.h>
17#include <linux/sched.h>
18#include <linux/hardirq.h> /* for in_atomic() */
19#include <asm/current.h>
20#include <asm/page.h>
21
22static int
23pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
24{
25 unsigned long addr = (unsigned long)_addr;
26 pgd_t *pgd;
27 pmd_t *pmd;
28 pte_t *pte;
29 spinlock_t *ptl;
30
31 pgd = pgd_offset(current->mm, addr);
32 if (unlikely(pgd_none(*pgd) || pgd_bad(*pgd)))
33 return 0;
34
35 pmd = pmd_offset(pgd, addr);
36 if (unlikely(pmd_none(*pmd) || pmd_bad(*pmd)))
37 return 0;
38
39 pte = pte_offset_map_lock(current->mm, pmd, addr, &ptl);
40 if (unlikely(!pte_present(*pte) || !pte_young(*pte) ||
41 !pte_write(*pte) || !pte_dirty(*pte))) {
42 pte_unmap_unlock(pte, ptl);
43 return 0;
44 }
45
46 *ptep = pte;
47 *ptlp = ptl;
48
49 return 1;
50}
51
52static unsigned long noinline
53__copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
54{
55 int atomic;
56
57 if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
58 memcpy((void *)to, from, n);
59 return 0;
60 }
61
62 /* the mmap semaphore is taken only if not in an atomic context */
63 atomic = in_atomic();
64
65 if (!atomic)
66 down_read(&current->mm->mmap_sem);
67 while (n) {
68 pte_t *pte;
69 spinlock_t *ptl;
70 int tocopy;
71
72 while (!pin_page_for_write(to, &pte, &ptl)) {
73 if (!atomic)
74 up_read(&current->mm->mmap_sem);
75 if (__put_user(0, (char __user *)to))
76 goto out;
77 if (!atomic)
78 down_read(&current->mm->mmap_sem);
79 }
80
81 tocopy = (~(unsigned long)to & ~PAGE_MASK) + 1;
82 if (tocopy > n)
83 tocopy = n;
84
85 memcpy((void *)to, from, tocopy);
86 to += tocopy;
87 from += tocopy;
88 n -= tocopy;
89
90 pte_unmap_unlock(pte, ptl);
91 }
92 if (!atomic)
93 up_read(&current->mm->mmap_sem);
94
95out:
96 return n;
97}
98
99unsigned long
100__copy_to_user(void __user *to, const void *from, unsigned long n)
101{
102 /*
103 * This test is stubbed out of the main function above to keep
104 * the overhead for small copies low by avoiding a large
105 * register dump on the stack just to reload them right away.
106 * With frame pointer disabled, tail call optimization kicks in
107 * as well making this test almost invisible.
108 */
109 if (n < 64)
110 return __copy_to_user_std(to, from, n);
111 return __copy_to_user_memcpy(to, from, n);
112}
113
114static unsigned long noinline
115__clear_user_memset(void __user *addr, unsigned long n)
116{
117 if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
118 memset((void *)addr, 0, n);
119 return 0;
120 }
121
122 down_read(&current->mm->mmap_sem);
123 while (n) {
124 pte_t *pte;
125 spinlock_t *ptl;
126 int tocopy;
127
128 while (!pin_page_for_write(addr, &pte, &ptl)) {
129 up_read(&current->mm->mmap_sem);
130 if (__put_user(0, (char __user *)addr))
131 goto out;
132 down_read(&current->mm->mmap_sem);
133 }
134
135 tocopy = (~(unsigned long)addr & ~PAGE_MASK) + 1;
136 if (tocopy > n)
137 tocopy = n;
138
139 memset((void *)addr, 0, tocopy);
140 addr += tocopy;
141 n -= tocopy;
142
143 pte_unmap_unlock(pte, ptl);
144 }
145 up_read(&current->mm->mmap_sem);
146
147out:
148 return n;
149}
150
151unsigned long __clear_user(void __user *addr, unsigned long n)
152{
153 /* See rational for this in __copy_to_user() above. */
154 if (n < 64)
155 return __clear_user_std(addr, n);
156 return __clear_user_memset(addr, n);
157}
158
159#if 0
160
161/*
162 * This code is disabled by default, but kept around in case the chosen
163 * thresholds need to be revalidated. Some overhead (small but still)
164 * would be implied by a runtime determined variable threshold, and
165 * so far the measurement on concerned targets didn't show a worthwhile
166 * variation.
167 *
168 * Note that a fairly precise sched_clock() implementation is needed
169 * for results to make some sense.
170 */
171
172#include <linux/vmalloc.h>
173
174static int __init test_size_treshold(void)
175{
176 struct page *src_page, *dst_page;
177 void *user_ptr, *kernel_ptr;
178 unsigned long long t0, t1, t2;
179 int size, ret;
180
181 ret = -ENOMEM;
182 src_page = alloc_page(GFP_KERNEL);
183 if (!src_page)
184 goto no_src;
185 dst_page = alloc_page(GFP_KERNEL);
186 if (!dst_page)
187 goto no_dst;
188 kernel_ptr = page_address(src_page);
189 user_ptr = vmap(&dst_page, 1, VM_IOREMAP, __pgprot(__P010));
190 if (!user_ptr)
191 goto no_vmap;
192
193 /* warm up the src page dcache */
194 ret = __copy_to_user_memcpy(user_ptr, kernel_ptr, PAGE_SIZE);
195
196 for (size = PAGE_SIZE; size >= 4; size /= 2) {
197 t0 = sched_clock();
198 ret |= __copy_to_user_memcpy(user_ptr, kernel_ptr, size);
199 t1 = sched_clock();
200 ret |= __copy_to_user_std(user_ptr, kernel_ptr, size);
201 t2 = sched_clock();
202 printk("copy_to_user: %d %llu %llu\n", size, t1 - t0, t2 - t1);
203 }
204
205 for (size = PAGE_SIZE; size >= 4; size /= 2) {
206 t0 = sched_clock();
207 ret |= __clear_user_memset(user_ptr, size);
208 t1 = sched_clock();
209 ret |= __clear_user_std(user_ptr, size);
210 t2 = sched_clock();
211 printk("clear_user: %d %llu %llu\n", size, t1 - t0, t2 - t1);
212 }
213
214 if (ret)
215 ret = -EFAULT;
216
217 vunmap(user_ptr);
218no_vmap:
219 put_page(dst_page);
220no_dst:
221 put_page(src_page);
222no_src:
223 return ret;
224}
225
226subsys_initcall(test_size_treshold);
227
228#endif
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index e263fda3e2d1..970fd6b6753e 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -156,6 +156,8 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
156 * MCI (SD/MMC) 156 * MCI (SD/MMC)
157 */ 157 */
158static struct at91_mmc_data __initdata afeb9260_mmc_data = { 158static struct at91_mmc_data __initdata afeb9260_mmc_data = {
159 .det_pin = AT91_PIN_PC9,
160 .wp_pin = AT91_PIN_PC4,
159 .slot_b = 1, 161 .slot_b = 1,
160 .wire4 = 1, 162 .wire4 = 1,
161}; 163};
@@ -164,6 +166,8 @@ static struct at91_mmc_data __initdata afeb9260_mmc_data = {
164 166
165static struct i2c_board_info __initdata afeb9260_i2c_devices[] = { 167static struct i2c_board_info __initdata afeb9260_i2c_devices[] = {
166 { 168 {
169 I2C_BOARD_INFO("tlv320aic23", 0x1a),
170 }, {
167 I2C_BOARD_INFO("fm3130", 0x68), 171 I2C_BOARD_INFO("fm3130", 0x68),
168 }, { 172 }, {
169 I2C_BOARD_INFO("24c64", 0x50), 173 I2C_BOARD_INFO("24c64", 0x50),
@@ -196,6 +200,8 @@ static void __init afeb9260_board_init(void)
196 /* I2C */ 200 /* I2C */
197 at91_add_device_i2c(afeb9260_i2c_devices, 201 at91_add_device_i2c(afeb9260_i2c_devices,
198 ARRAY_SIZE(afeb9260_i2c_devices)); 202 ARRAY_SIZE(afeb9260_i2c_devices));
203 /* Audio */
204 at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
199} 205}
200 206
201MACHINE_START(AFEB9260, "Custom afeb9260 board") 207MACHINE_START(AFEB9260, "Custom afeb9260 board")
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 438efbb17482..cc270beadd5d 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -218,6 +218,13 @@ static struct gpio_led ek_leds[] = {
218 } 218 }
219}; 219};
220 220
221static struct i2c_board_info __initdata ek_i2c_devices[] = {
222 {
223 I2C_BOARD_INFO("24c512", 0x50),
224 },
225};
226
227
221static void __init ek_board_init(void) 228static void __init ek_board_init(void)
222{ 229{
223 /* Serial */ 230 /* Serial */
@@ -235,7 +242,7 @@ static void __init ek_board_init(void)
235 /* MMC */ 242 /* MMC */
236 at91_add_device_mmc(0, &ek_mmc_data); 243 at91_add_device_mmc(0, &ek_mmc_data);
237 /* I2C */ 244 /* I2C */
238 at91_add_device_i2c(NULL, 0); 245 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
239 /* LEDs */ 246 /* LEDs */
240 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 247 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
241 /* PCK0 provides MCLK to the WM8731 */ 248 /* PCK0 provides MCLK to the WM8731 */
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index e4345106ee57..bac578fe0d3d 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -43,6 +43,25 @@
43#define clk_is_sys(x) ((x)->type & CLK_TYPE_SYSTEM) 43#define clk_is_sys(x) ((x)->type & CLK_TYPE_SYSTEM)
44 44
45 45
46/*
47 * Chips have some kind of clocks : group them by functionality
48 */
49#define cpu_has_utmi() ( cpu_is_at91cap9() \
50 || cpu_is_at91sam9rl())
51
52#define cpu_has_800M_plla() (cpu_is_at91sam9g20())
53
54#define cpu_has_pllb() (!cpu_is_at91sam9rl())
55
56#define cpu_has_upll() (0)
57
58/* USB host HS & FS */
59#define cpu_has_uhp() (!cpu_is_at91sam9rl())
60
61/* USB device FS only */
62#define cpu_has_udpfs() (!cpu_is_at91sam9rl())
63
64
46static LIST_HEAD(clocks); 65static LIST_HEAD(clocks);
47static DEFINE_SPINLOCK(clk_lock); 66static DEFINE_SPINLOCK(clk_lock);
48 67
@@ -140,7 +159,7 @@ static struct clk utmi_clk = {
140}; 159};
141static struct clk uhpck = { 160static struct clk uhpck = {
142 .name = "uhpck", 161 .name = "uhpck",
143 .parent = &pllb, 162 /*.parent = ... we choose parent at runtime */
144 .mode = pmc_sys_mode, 163 .mode = pmc_sys_mode,
145}; 164};
146 165
@@ -173,7 +192,11 @@ static struct clk __init *at91_css_to_clk(unsigned long css)
173 case AT91_PMC_CSS_PLLA: 192 case AT91_PMC_CSS_PLLA:
174 return &plla; 193 return &plla;
175 case AT91_PMC_CSS_PLLB: 194 case AT91_PMC_CSS_PLLB:
176 return &pllb; 195 if (cpu_has_upll())
196 /* CSS_PLLB == CSS_UPLL */
197 return &utmi_clk;
198 else if (cpu_has_pllb())
199 return &pllb;
177 } 200 }
178 201
179 return NULL; 202 return NULL;
@@ -322,7 +345,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
322 u32 pckr; 345 u32 pckr;
323 346
324 pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); 347 pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
325 pckr &= AT91_PMC_CSS_PLLB; /* clock selection */ 348 pckr &= AT91_PMC_CSS; /* clock selection */
326 pckr |= prescale << 2; 349 pckr |= prescale << 2;
327 at91_sys_write(AT91_PMC_PCKR(clk->id), pckr); 350 at91_sys_write(AT91_PMC_PCKR(clk->id), pckr);
328 clk->rate_hz = actual; 351 clk->rate_hz = actual;
@@ -361,7 +384,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
361} 384}
362EXPORT_SYMBOL(clk_set_parent); 385EXPORT_SYMBOL(clk_set_parent);
363 386
364/* establish PCK0..PCK3 parentage and rate */ 387/* establish PCK0..PCKN parentage and rate */
365static void __init init_programmable_clock(struct clk *clk) 388static void __init init_programmable_clock(struct clk *clk)
366{ 389{
367 struct clk *parent; 390 struct clk *parent;
@@ -389,11 +412,13 @@ static int at91_clk_show(struct seq_file *s, void *unused)
389 seq_printf(s, "MOR = %8x\n", at91_sys_read(AT91_CKGR_MOR)); 412 seq_printf(s, "MOR = %8x\n", at91_sys_read(AT91_CKGR_MOR));
390 seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR)); 413 seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR));
391 seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR)); 414 seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR));
392 if (!cpu_is_at91sam9rl()) 415 if (cpu_has_pllb())
393 seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR)); 416 seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR));
394 if (cpu_is_at91cap9() || cpu_is_at91sam9rl()) 417 if (cpu_has_utmi())
395 seq_printf(s, "UCKR = %8x\n", uckr = at91_sys_read(AT91_CKGR_UCKR)); 418 seq_printf(s, "UCKR = %8x\n", uckr = at91_sys_read(AT91_CKGR_UCKR));
396 seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR)); 419 seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR));
420 if (cpu_has_upll())
421 seq_printf(s, "USB = %8x\n", at91_sys_read(AT91_PMC_USB));
397 seq_printf(s, "SR = %8x\n", sr = at91_sys_read(AT91_PMC_SR)); 422 seq_printf(s, "SR = %8x\n", sr = at91_sys_read(AT91_PMC_SR));
398 423
399 seq_printf(s, "\n"); 424 seq_printf(s, "\n");
@@ -554,16 +579,60 @@ static struct clk *const standard_pmc_clocks[] __initdata = {
554 &clk32k, 579 &clk32k,
555 &main_clk, 580 &main_clk,
556 &plla, 581 &plla,
557 &pllb,
558
559 /* PLLB children (USB) */
560 &udpck,
561 &uhpck,
562 582
563 /* MCK */ 583 /* MCK */
564 &mck 584 &mck
565}; 585};
566 586
587/* PLLB generated USB full speed clock init */
588static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
589{
590 /*
591 * USB clock init: choose 48 MHz PLLB value,
592 * disable 48MHz clock during usb peripheral suspend.
593 *
594 * REVISIT: assumes MCK doesn't derive from PLLB!
595 */
596 uhpck.parent = &pllb;
597
598 at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M;
599 pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
600 if (cpu_is_at91rm9200()) {
601 uhpck.pmc_mask = AT91RM9200_PMC_UHP;
602 udpck.pmc_mask = AT91RM9200_PMC_UDP;
603 at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
604 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) {
605 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
606 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
607 } else if (cpu_is_at91cap9()) {
608 uhpck.pmc_mask = AT91CAP9_PMC_UHP;
609 }
610 at91_sys_write(AT91_CKGR_PLLBR, 0);
611
612 udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
613 uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
614}
615
616/* UPLL generated USB full speed clock init */
617static void __init at91_upll_usbfs_clock_init(unsigned long main_clock)
618{
619 /*
620 * USB clock init: choose 480 MHz from UPLL,
621 */
622 unsigned int usbr = AT91_PMC_USBS_UPLL;
623
624 /* Setup divider by 10 to reach 48 MHz */
625 usbr |= ((10 - 1) << 8) & AT91_PMC_OHCIUSBDIV;
626
627 at91_sys_write(AT91_PMC_USB, usbr);
628
629 /* Now set uhpck values */
630 uhpck.parent = &utmi_clk;
631 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
632 uhpck.rate_hz = utmi_clk.parent->rate_hz;
633 uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8);
634}
635
567int __init at91_clock_init(unsigned long main_clock) 636int __init at91_clock_init(unsigned long main_clock)
568{ 637{
569 unsigned tmp, freq, mckr; 638 unsigned tmp, freq, mckr;
@@ -585,43 +654,37 @@ int __init at91_clock_init(unsigned long main_clock)
585 654
586 /* report if PLLA is more than mildly overclocked */ 655 /* report if PLLA is more than mildly overclocked */
587 plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR)); 656 plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR));
588 if ((!cpu_is_at91sam9g20() && plla.rate_hz > 209000000) 657 if ((!cpu_has_800M_plla() && plla.rate_hz > 209000000)
589 || (cpu_is_at91sam9g20() && plla.rate_hz > 800000000)) 658 || (cpu_has_800M_plla() && plla.rate_hz > 800000000))
590 pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); 659 pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000);
591 660
592 /* 661
593 * USB clock init: choose 48 MHz PLLB value, 662 if (cpu_has_upll() && !cpu_has_pllb()) {
594 * disable 48MHz clock during usb peripheral suspend. 663 /* setup UTMI clock as the fourth primary clock
595 * 664 * (instead of pllb) */
596 * REVISIT: assumes MCK doesn't derive from PLLB! 665 utmi_clk.type |= CLK_TYPE_PRIMARY;
597 */ 666 utmi_clk.id = 3;
598 at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M;
599 pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
600 if (cpu_is_at91rm9200()) {
601 uhpck.pmc_mask = AT91RM9200_PMC_UHP;
602 udpck.pmc_mask = AT91RM9200_PMC_UDP;
603 at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
604 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) {
605 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
606 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
607 } else if (cpu_is_at91cap9()) {
608 uhpck.pmc_mask = AT91CAP9_PMC_UHP;
609 } 667 }
610 at91_sys_write(AT91_CKGR_PLLBR, 0);
611 668
612 udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
613 uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
614 669
615 /* 670 /*
616 * USB HS clock init 671 * USB HS clock init
617 */ 672 */
618 if (cpu_is_at91cap9() || cpu_is_at91sam9rl()) { 673 if (cpu_has_utmi())
619 /* 674 /*
620 * multiplier is hard-wired to 40 675 * multiplier is hard-wired to 40
621 * (obtain the USB High Speed 480 MHz when input is 12 MHz) 676 * (obtain the USB High Speed 480 MHz when input is 12 MHz)
622 */ 677 */
623 utmi_clk.rate_hz = 40 * utmi_clk.parent->rate_hz; 678 utmi_clk.rate_hz = 40 * utmi_clk.parent->rate_hz;
624 } 679
680 /*
681 * USB FS clock init
682 */
683 if (cpu_has_pllb())
684 at91_pllb_usbfs_clock_init(main_clock);
685 if (cpu_has_upll())
686 /* assumes that we choose UPLL for USB and not PLLA */
687 at91_upll_usbfs_clock_init(main_clock);
625 688
626 /* 689 /*
627 * MCK and CPU derive from one of those primary clocks. 690 * MCK and CPU derive from one of those primary clocks.
@@ -631,21 +694,31 @@ int __init at91_clock_init(unsigned long main_clock)
631 mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS); 694 mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS);
632 freq = mck.parent->rate_hz; 695 freq = mck.parent->rate_hz;
633 freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); /* prescale */ 696 freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); /* prescale */
634 if (cpu_is_at91rm9200()) 697 if (cpu_is_at91rm9200()) {
635 mck.rate_hz = freq / (1 + ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ 698 mck.rate_hz = freq / (1 + ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */
636 else if (cpu_is_at91sam9g20()) { 699 } else if (cpu_is_at91sam9g20()) {
637 mck.rate_hz = (mckr & AT91_PMC_MDIV) ? 700 mck.rate_hz = (mckr & AT91_PMC_MDIV) ?
638 freq / ((mckr & AT91_PMC_MDIV) >> 7) : freq; /* mdiv ; (x >> 7) = ((x >> 8) * 2) */ 701 freq / ((mckr & AT91_PMC_MDIV) >> 7) : freq; /* mdiv ; (x >> 7) = ((x >> 8) * 2) */
639 if (mckr & AT91_PMC_PDIV) 702 if (mckr & AT91_PMC_PDIV)
640 freq /= 2; /* processor clock division */ 703 freq /= 2; /* processor clock division */
641 } else 704 } else {
642 mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ 705 mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */
706 }
643 707
644 /* Register the PMC's standard clocks */ 708 /* Register the PMC's standard clocks */
645 for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) 709 for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
646 list_add_tail(&standard_pmc_clocks[i]->node, &clocks); 710 list_add_tail(&standard_pmc_clocks[i]->node, &clocks);
647 711
648 if (cpu_is_at91cap9() || cpu_is_at91sam9rl()) 712 if (cpu_has_pllb())
713 list_add_tail(&pllb.node, &clocks);
714
715 if (cpu_has_uhp())
716 list_add_tail(&uhpck.node, &clocks);
717
718 if (cpu_has_udpfs())
719 list_add_tail(&udpck.node, &clocks);
720
721 if (cpu_has_utmi())
649 list_add_tail(&utmi_clk.node, &clocks); 722 list_add_tail(&utmi_clk.node, &clocks);
650 723
651 /* MCK and CPU clock are "always on" */ 724 /* MCK and CPU clock are "always on" */
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
index 9561e33b8a9a..64589eaaaee8 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
@@ -23,7 +23,7 @@
23#define AT91_PMC_PCK (1 << 0) /* Processor Clock */ 23#define AT91_PMC_PCK (1 << 0) /* Processor Clock */
24#define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ 24#define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */
25#define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ 25#define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
26#define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock [AT91CAP9 revC only] */ 26#define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock [CAP9 revC & some SAM9 only] */
27#define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ 27#define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */
28#define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ 28#define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */
29#define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */ 29#define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */
@@ -39,11 +39,11 @@
39#define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ 39#define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */
40#define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ 40#define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */
41 41
42#define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [SAM9RL, CAP9] */ 42#define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9, CAP9] */
43#define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ 43#define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */
44#define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ 44#define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */
45#define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ 45#define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */
46#define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI PLL Start-up Time */ 46#define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */
47 47
48#define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */ 48#define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */
49#define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ 49#define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */
@@ -72,6 +72,7 @@
72#define AT91_PMC_CSS_MAIN (1 << 0) 72#define AT91_PMC_CSS_MAIN (1 << 0)
73#define AT91_PMC_CSS_PLLA (2 << 0) 73#define AT91_PMC_CSS_PLLA (2 << 0)
74#define AT91_PMC_CSS_PLLB (3 << 0) 74#define AT91_PMC_CSS_PLLB (3 << 0)
75#define AT91_PMC_CSS_UPLL (3 << 0) /* [some SAM9 only] */
75#define AT91_PMC_PRES (7 << 2) /* Master Clock Prescaler */ 76#define AT91_PMC_PRES (7 << 2) /* Master Clock Prescaler */
76#define AT91_PMC_PRES_1 (0 << 2) 77#define AT91_PMC_PRES_1 (0 << 2)
77#define AT91_PMC_PRES_2 (1 << 2) 78#define AT91_PMC_PRES_2 (1 << 2)
@@ -88,12 +89,25 @@
88#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */ 89#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */
89#define AT91SAM9_PMC_MDIV_2 (1 << 8) 90#define AT91SAM9_PMC_MDIV_2 (1 << 8)
90#define AT91SAM9_PMC_MDIV_4 (2 << 8) 91#define AT91SAM9_PMC_MDIV_4 (2 << 8)
91#define AT91SAM9_PMC_MDIV_6 (3 << 8) 92#define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */
93#define AT91SAM9_PMC_MDIV_3 (3 << 8) /* [some SAM9 only] */
92#define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */ 94#define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */
93#define AT91_PMC_PDIV_1 (0 << 12) 95#define AT91_PMC_PDIV_1 (0 << 12)
94#define AT91_PMC_PDIV_2 (1 << 12) 96#define AT91_PMC_PDIV_2 (1 << 12)
97#define AT91_PMC_PLLADIV2 (1 << 12) /* PLLA divisor by 2 [some SAM9 only] */
98#define AT91_PMC_PLLADIV2_OFF (0 << 12)
99#define AT91_PMC_PLLADIV2_ON (1 << 12)
95 100
96#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */ 101#define AT91_PMC_USB (AT91_PMC + 0x38) /* USB Clock Register [some SAM9 only] */
102#define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */
103#define AT91_PMC_USBS_PLLA (0 << 0)
104#define AT91_PMC_USBS_UPLL (1 << 0)
105#define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */
106
107#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */
108#define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */
109#define AT91_PMC_CSSMCK_CSS (0 << 8)
110#define AT91_PMC_CSSMCK_MCK (1 << 8)
97 111
98#define AT91_PMC_IER (AT91_PMC + 0x60) /* Interrupt Enable Register */ 112#define AT91_PMC_IER (AT91_PMC + 0x60) /* Interrupt Enable Register */
99#define AT91_PMC_IDR (AT91_PMC + 0x64) /* Interrupt Disable Register */ 113#define AT91_PMC_IDR (AT91_PMC + 0x64) /* Interrupt Disable Register */
@@ -102,7 +116,7 @@
102#define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ 116#define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */
103#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ 117#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */
104#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ 118#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */
105#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [AT91CAP9 only] */ 119#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9, AT91CAP9 only] */
106#define AT91_PMC_OSCSEL (1 << 7) /* Slow Clock Oscillator [AT91CAP9 revC only] */ 120#define AT91_PMC_OSCSEL (1 << 7) /* Slow Clock Oscillator [AT91CAP9 revC only] */
107#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ 121#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */
108#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ 122#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index a9c78bc72b84..be747f5c6cd8 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -1,11 +1,26 @@
1if ARCH_DAVINCI 1if ARCH_DAVINCI
2 2
3config AINTC
4 bool
5
6config CP_INTC
7 bool
8
3menu "TI DaVinci Implementations" 9menu "TI DaVinci Implementations"
4 10
5comment "DaVinci Core Type" 11comment "DaVinci Core Type"
6 12
7config ARCH_DAVINCI_DM644x 13config ARCH_DAVINCI_DM644x
8 bool "DaVinci 644x based system" 14 bool "DaVinci 644x based system"
15 select AINTC
16
17config ARCH_DAVINCI_DM355
18 bool "DaVinci 355 based system"
19 select AINTC
20
21config ARCH_DAVINCI_DM646x
22 bool "DaVinci 646x based system"
23 select AINTC
9 24
10comment "DaVinci Board Type" 25comment "DaVinci Board Type"
11 26
@@ -17,6 +32,34 @@ config MACH_DAVINCI_EVM
17 Configure this option to specify the whether the board used 32 Configure this option to specify the whether the board used
18 for development is a DM644x EVM 33 for development is a DM644x EVM
19 34
35config MACH_SFFSDR
36 bool "Lyrtech SFFSDR"
37 depends on ARCH_DAVINCI_DM644x
38 help
39 Say Y here to select the Lyrtech Small Form Factor
40 Software Defined Radio (SFFSDR) board.
41
42config MACH_DAVINCI_DM355_EVM
43 bool "TI DM355 EVM"
44 depends on ARCH_DAVINCI_DM355
45 help
46 Configure this option to specify the whether the board used
47 for development is a DM355 EVM
48
49config MACH_DM355_LEOPARD
50 bool "DM355 Leopard board"
51 depends on ARCH_DAVINCI_DM355
52 help
53 Configure this option to specify the whether the board used
54 for development is a DM355 Leopard board.
55
56config MACH_DAVINCI_DM6467_EVM
57 bool "TI DM6467 EVM"
58 depends on ARCH_DAVINCI_DM646x
59 help
60 Configure this option to specify the whether the board used
61 for development is a DM6467 EVM
62
20 63
21config DAVINCI_MUX 64config DAVINCI_MUX
22 bool "DAVINCI multiplexing support" 65 bool "DAVINCI multiplexing support"
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 1674661942f3..059ab78084ba 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -4,13 +4,22 @@
4# 4#
5 5
6# Common objects 6# Common objects
7obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \ 7obj-y := time.o clock.o serial.o io.o psc.o \
8 gpio.o devices.o dma.o usb.o 8 gpio.o devices.o dma.o usb.o common.o sram.o
9 9
10obj-$(CONFIG_DAVINCI_MUX) += mux.o 10obj-$(CONFIG_DAVINCI_MUX) += mux.o
11 11
12# Chip specific 12# Chip specific
13obj-$(CONFIG_ARCH_DAVINCI_DM644x) += dm644x.o 13obj-$(CONFIG_ARCH_DAVINCI_DM644x) += dm644x.o
14obj-$(CONFIG_ARCH_DAVINCI_DM355) += dm355.o
15obj-$(CONFIG_ARCH_DAVINCI_DM646x) += dm646x.o
16
17obj-$(CONFIG_AINTC) += irq.o
18obj-$(CONFIG_CP_INTC) += cp_intc.o
14 19
15# Board specific 20# Board specific
16obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o 21obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o
22obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o
23obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o
24obj-$(CONFIG_MACH_DM355_LEOPARD) += board-dm355-leopard.o
25obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
new file mode 100644
index 000000000000..5ac2f565d860
--- /dev/null
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -0,0 +1,298 @@
1/*
2 * TI DaVinci EVM board support
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/dma-mapping.h>
15#include <linux/platform_device.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h>
18#include <linux/mtd/nand.h>
19#include <linux/i2c.h>
20#include <linux/io.h>
21#include <linux/gpio.h>
22#include <linux/clk.h>
23#include <linux/spi/spi.h>
24#include <linux/spi/eeprom.h>
25
26#include <asm/setup.h>
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/flash.h>
31
32#include <mach/hardware.h>
33#include <mach/dm355.h>
34#include <mach/psc.h>
35#include <mach/common.h>
36#include <mach/i2c.h>
37#include <mach/serial.h>
38#include <mach/nand.h>
39#include <mach/mmc.h>
40#include <mach/common.h>
41
42#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
43#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
44
45/* NOTE: this is geared for the standard config, with a socketed
46 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
47 * swap chips, maybe with a different block size, partitioning may
48 * need to be changed.
49 */
50#define NAND_BLOCK_SIZE SZ_128K
51
52static struct mtd_partition davinci_nand_partitions[] = {
53 {
54 /* UBL (a few copies) plus U-Boot */
55 .name = "bootloader",
56 .offset = 0,
57 .size = 15 * NAND_BLOCK_SIZE,
58 .mask_flags = MTD_WRITEABLE, /* force read-only */
59 }, {
60 /* U-Boot environment */
61 .name = "params",
62 .offset = MTDPART_OFS_APPEND,
63 .size = 1 * NAND_BLOCK_SIZE,
64 .mask_flags = 0,
65 }, {
66 .name = "kernel",
67 .offset = MTDPART_OFS_APPEND,
68 .size = SZ_4M,
69 .mask_flags = 0,
70 }, {
71 .name = "filesystem1",
72 .offset = MTDPART_OFS_APPEND,
73 .size = SZ_512M,
74 .mask_flags = 0,
75 }, {
76 .name = "filesystem2",
77 .offset = MTDPART_OFS_APPEND,
78 .size = MTDPART_SIZ_FULL,
79 .mask_flags = 0,
80 }
81 /* two blocks with bad block table (and mirror) at the end */
82};
83
84static struct davinci_nand_pdata davinci_nand_data = {
85 .mask_chipsel = BIT(14),
86 .parts = davinci_nand_partitions,
87 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
88 .ecc_mode = NAND_ECC_HW_SYNDROME,
89 .options = NAND_USE_FLASH_BBT,
90};
91
92static struct resource davinci_nand_resources[] = {
93 {
94 .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
95 .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
96 .flags = IORESOURCE_MEM,
97 }, {
98 .start = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
99 .end = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
100 .flags = IORESOURCE_MEM,
101 },
102};
103
104static struct platform_device davinci_nand_device = {
105 .name = "davinci_nand",
106 .id = 0,
107
108 .num_resources = ARRAY_SIZE(davinci_nand_resources),
109 .resource = davinci_nand_resources,
110
111 .dev = {
112 .platform_data = &davinci_nand_data,
113 },
114};
115
116static struct davinci_i2c_platform_data i2c_pdata = {
117 .bus_freq = 400 /* kHz */,
118 .bus_delay = 0 /* usec */,
119};
120
121static int dm355evm_mmc_gpios = -EINVAL;
122
123static void dm355evm_mmcsd_gpios(unsigned gpio)
124{
125 gpio_request(gpio + 0, "mmc0_ro");
126 gpio_request(gpio + 1, "mmc0_cd");
127 gpio_request(gpio + 2, "mmc1_ro");
128 gpio_request(gpio + 3, "mmc1_cd");
129
130 /* we "know" these are input-only so we don't
131 * need to call gpio_direction_input()
132 */
133
134 dm355evm_mmc_gpios = gpio;
135}
136
137static struct i2c_board_info dm355evm_i2c_info[] = {
138 { I2C_BOARD_INFO("dm355evm_msp", 0x25),
139 .platform_data = dm355evm_mmcsd_gpios,
140 /* plus irq */ },
141 /* { I2C_BOARD_INFO("tlv320aic3x", 0x1b), }, */
142 /* { I2C_BOARD_INFO("tvp5146", 0x5d), }, */
143};
144
145static void __init evm_init_i2c(void)
146{
147 davinci_init_i2c(&i2c_pdata);
148
149 gpio_request(5, "dm355evm_msp");
150 gpio_direction_input(5);
151 dm355evm_i2c_info[0].irq = gpio_to_irq(5);
152
153 i2c_register_board_info(1, dm355evm_i2c_info,
154 ARRAY_SIZE(dm355evm_i2c_info));
155}
156
157static struct resource dm355evm_dm9000_rsrc[] = {
158 {
159 /* addr */
160 .start = 0x04014000,
161 .end = 0x04014001,
162 .flags = IORESOURCE_MEM,
163 }, {
164 /* data */
165 .start = 0x04014002,
166 .end = 0x04014003,
167 .flags = IORESOURCE_MEM,
168 }, {
169 .flags = IORESOURCE_IRQ
170 | IORESOURCE_IRQ_HIGHEDGE /* rising (active high) */,
171 },
172};
173
174static struct platform_device dm355evm_dm9000 = {
175 .name = "dm9000",
176 .id = -1,
177 .resource = dm355evm_dm9000_rsrc,
178 .num_resources = ARRAY_SIZE(dm355evm_dm9000_rsrc),
179};
180
181static struct platform_device *davinci_evm_devices[] __initdata = {
182 &dm355evm_dm9000,
183 &davinci_nand_device,
184};
185
186static struct davinci_uart_config uart_config __initdata = {
187 .enabled_uarts = (1 << 0),
188};
189
190static void __init dm355_evm_map_io(void)
191{
192 dm355_init();
193}
194
195static int dm355evm_mmc_get_cd(int module)
196{
197 if (!gpio_is_valid(dm355evm_mmc_gpios))
198 return -ENXIO;
199 /* low == card present */
200 return !gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 1);
201}
202
203static int dm355evm_mmc_get_ro(int module)
204{
205 if (!gpio_is_valid(dm355evm_mmc_gpios))
206 return -ENXIO;
207 /* high == card's write protect switch active */
208 return gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 0);
209}
210
211static struct davinci_mmc_config dm355evm_mmc_config = {
212 .get_cd = dm355evm_mmc_get_cd,
213 .get_ro = dm355evm_mmc_get_ro,
214 .wires = 4,
215 .max_freq = 50000000,
216 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
217 .version = MMC_CTLR_VERSION_1,
218};
219
220/* Don't connect anything to J10 unless you're only using USB host
221 * mode *and* have to do so with some kind of gender-bender. If
222 * you have proper Mini-B or Mini-A cables (or Mini-A adapters)
223 * the ID pin won't need any help.
224 */
225#ifdef CONFIG_USB_MUSB_PERIPHERAL
226#define USB_ID_VALUE 0 /* ID pulled high; *should* float */
227#else
228#define USB_ID_VALUE 1 /* ID pulled low */
229#endif
230
231static struct spi_eeprom at25640a = {
232 .byte_len = SZ_64K / 8,
233 .name = "at25640a",
234 .page_size = 32,
235 .flags = EE_ADDR2,
236};
237
238static struct spi_board_info dm355_evm_spi_info[] __initconst = {
239 {
240 .modalias = "at25",
241 .platform_data = &at25640a,
242 .max_speed_hz = 10 * 1000 * 1000, /* at 3v3 */
243 .bus_num = 0,
244 .chip_select = 0,
245 .mode = SPI_MODE_0,
246 },
247};
248
249static __init void dm355_evm_init(void)
250{
251 struct clk *aemif;
252
253 gpio_request(1, "dm9000");
254 gpio_direction_input(1);
255 dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1);
256
257 aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
258 if (IS_ERR(aemif))
259 WARN("%s: unable to get AEMIF clock\n", __func__);
260 else
261 clk_enable(aemif);
262
263 platform_add_devices(davinci_evm_devices,
264 ARRAY_SIZE(davinci_evm_devices));
265 evm_init_i2c();
266 davinci_serial_init(&uart_config);
267
268 /* NOTE: NAND flash timings set by the UBL are slower than
269 * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
270 * but could be 0x0400008c for about 25% faster page reads.
271 */
272
273 gpio_request(2, "usb_id_toggle");
274 gpio_direction_output(2, USB_ID_VALUE);
275 /* irlml6401 switches over 1A in under 8 msec */
276 setup_usb(500, 8);
277
278 davinci_setup_mmc(0, &dm355evm_mmc_config);
279 davinci_setup_mmc(1, &dm355evm_mmc_config);
280
281 dm355_init_spi0(BIT(0), dm355_evm_spi_info,
282 ARRAY_SIZE(dm355_evm_spi_info));
283}
284
285static __init void dm355_evm_irq_init(void)
286{
287 davinci_irq_init();
288}
289
290MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
291 .phys_io = IO_PHYS,
292 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
293 .boot_params = (0x80000100),
294 .map_io = dm355_evm_map_io,
295 .init_irq = dm355_evm_irq_init,
296 .timer = &davinci_timer,
297 .init_machine = dm355_evm_init,
298MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
new file mode 100644
index 000000000000..28c9008df4f4
--- /dev/null
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -0,0 +1,296 @@
1/*
2 * DM355 leopard board support
3 *
4 * Based on board-dm355-evm.c
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 any
8 * warranty of any kind, whether express or implied.
9 */
10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <linux/init.h>
13#include <linux/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/mtd/mtd.h>
16#include <linux/mtd/partitions.h>
17#include <linux/mtd/nand.h>
18#include <linux/i2c.h>
19#include <linux/io.h>
20#include <linux/gpio.h>
21#include <linux/clk.h>
22#include <linux/spi/spi.h>
23#include <linux/spi/eeprom.h>
24
25#include <asm/setup.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/flash.h>
30
31#include <mach/hardware.h>
32#include <mach/dm355.h>
33#include <mach/psc.h>
34#include <mach/common.h>
35#include <mach/i2c.h>
36#include <mach/serial.h>
37#include <mach/nand.h>
38#include <mach/mmc.h>
39#include <mach/common.h>
40
41#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
42#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
43
44/* NOTE: this is geared for the standard config, with a socketed
45 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
46 * swap chips, maybe with a different block size, partitioning may
47 * need to be changed.
48 */
49#define NAND_BLOCK_SIZE SZ_128K
50
51static struct mtd_partition davinci_nand_partitions[] = {
52 {
53 /* UBL (a few copies) plus U-Boot */
54 .name = "bootloader",
55 .offset = 0,
56 .size = 15 * NAND_BLOCK_SIZE,
57 .mask_flags = MTD_WRITEABLE, /* force read-only */
58 }, {
59 /* U-Boot environment */
60 .name = "params",
61 .offset = MTDPART_OFS_APPEND,
62 .size = 1 * NAND_BLOCK_SIZE,
63 .mask_flags = 0,
64 }, {
65 .name = "kernel",
66 .offset = MTDPART_OFS_APPEND,
67 .size = SZ_4M,
68 .mask_flags = 0,
69 }, {
70 .name = "filesystem1",
71 .offset = MTDPART_OFS_APPEND,
72 .size = SZ_512M,
73 .mask_flags = 0,
74 }, {
75 .name = "filesystem2",
76 .offset = MTDPART_OFS_APPEND,
77 .size = MTDPART_SIZ_FULL,
78 .mask_flags = 0,
79 }
80 /* two blocks with bad block table (and mirror) at the end */
81};
82
83static struct davinci_nand_pdata davinci_nand_data = {
84 .mask_chipsel = BIT(14),
85 .parts = davinci_nand_partitions,
86 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
87 .ecc_mode = NAND_ECC_HW_SYNDROME,
88 .options = NAND_USE_FLASH_BBT,
89};
90
91static struct resource davinci_nand_resources[] = {
92 {
93 .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
94 .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
95 .flags = IORESOURCE_MEM,
96 }, {
97 .start = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
98 .end = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
99 .flags = IORESOURCE_MEM,
100 },
101};
102
103static struct platform_device davinci_nand_device = {
104 .name = "davinci_nand",
105 .id = 0,
106
107 .num_resources = ARRAY_SIZE(davinci_nand_resources),
108 .resource = davinci_nand_resources,
109
110 .dev = {
111 .platform_data = &davinci_nand_data,
112 },
113};
114
115static struct davinci_i2c_platform_data i2c_pdata = {
116 .bus_freq = 400 /* kHz */,
117 .bus_delay = 0 /* usec */,
118};
119
120static int leopard_mmc_gpio = -EINVAL;
121
122static void dm355leopard_mmcsd_gpios(unsigned gpio)
123{
124 gpio_request(gpio + 0, "mmc0_ro");
125 gpio_request(gpio + 1, "mmc0_cd");
126 gpio_request(gpio + 2, "mmc1_ro");
127 gpio_request(gpio + 3, "mmc1_cd");
128
129 /* we "know" these are input-only so we don't
130 * need to call gpio_direction_input()
131 */
132
133 leopard_mmc_gpio = gpio;
134}
135
136static struct i2c_board_info dm355leopard_i2c_info[] = {
137 { I2C_BOARD_INFO("dm355leopard_msp", 0x25),
138 .platform_data = dm355leopard_mmcsd_gpios,
139 /* plus irq */ },
140 /* { I2C_BOARD_INFO("tlv320aic3x", 0x1b), }, */
141 /* { I2C_BOARD_INFO("tvp5146", 0x5d), }, */
142};
143
144static void __init leopard_init_i2c(void)
145{
146 davinci_init_i2c(&i2c_pdata);
147
148 gpio_request(5, "dm355leopard_msp");
149 gpio_direction_input(5);
150 dm355leopard_i2c_info[0].irq = gpio_to_irq(5);
151
152 i2c_register_board_info(1, dm355leopard_i2c_info,
153 ARRAY_SIZE(dm355leopard_i2c_info));
154}
155
156static struct resource dm355leopard_dm9000_rsrc[] = {
157 {
158 /* addr */
159 .start = 0x04000000,
160 .end = 0x04000001,
161 .flags = IORESOURCE_MEM,
162 }, {
163 /* data */
164 .start = 0x04000016,
165 .end = 0x04000017,
166 .flags = IORESOURCE_MEM,
167 }, {
168 .flags = IORESOURCE_IRQ
169 | IORESOURCE_IRQ_HIGHEDGE /* rising (active high) */,
170 },
171};
172
173static struct platform_device dm355leopard_dm9000 = {
174 .name = "dm9000",
175 .id = -1,
176 .resource = dm355leopard_dm9000_rsrc,
177 .num_resources = ARRAY_SIZE(dm355leopard_dm9000_rsrc),
178};
179
180static struct platform_device *davinci_leopard_devices[] __initdata = {
181 &dm355leopard_dm9000,
182 &davinci_nand_device,
183};
184
185static struct davinci_uart_config uart_config __initdata = {
186 .enabled_uarts = (1 << 0),
187};
188
189static void __init dm355_leopard_map_io(void)
190{
191 dm355_init();
192}
193
194static int dm355leopard_mmc_get_cd(int module)
195{
196 if (!gpio_is_valid(leopard_mmc_gpio))
197 return -ENXIO;
198 /* low == card present */
199 return !gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 1);
200}
201
202static int dm355leopard_mmc_get_ro(int module)
203{
204 if (!gpio_is_valid(leopard_mmc_gpio))
205 return -ENXIO;
206 /* high == card's write protect switch active */
207 return gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 0);
208}
209
210static struct davinci_mmc_config dm355leopard_mmc_config = {
211 .get_cd = dm355leopard_mmc_get_cd,
212 .get_ro = dm355leopard_mmc_get_ro,
213 .wires = 4,
214 .max_freq = 50000000,
215 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
216};
217
218/* Don't connect anything to J10 unless you're only using USB host
219 * mode *and* have to do so with some kind of gender-bender. If
220 * you have proper Mini-B or Mini-A cables (or Mini-A adapters)
221 * the ID pin won't need any help.
222 */
223#ifdef CONFIG_USB_MUSB_PERIPHERAL
224#define USB_ID_VALUE 0 /* ID pulled high; *should* float */
225#else
226#define USB_ID_VALUE 1 /* ID pulled low */
227#endif
228
229static struct spi_eeprom at25640a = {
230 .byte_len = SZ_64K / 8,
231 .name = "at25640a",
232 .page_size = 32,
233 .flags = EE_ADDR2,
234};
235
236static struct spi_board_info dm355_leopard_spi_info[] __initconst = {
237 {
238 .modalias = "at25",
239 .platform_data = &at25640a,
240 .max_speed_hz = 10 * 1000 * 1000, /* at 3v3 */
241 .bus_num = 0,
242 .chip_select = 0,
243 .mode = SPI_MODE_0,
244 },
245};
246
247static __init void dm355_leopard_init(void)
248{
249 struct clk *aemif;
250
251 gpio_request(9, "dm9000");
252 gpio_direction_input(9);
253 dm355leopard_dm9000_rsrc[2].start = gpio_to_irq(9);
254
255 aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
256 if (IS_ERR(aemif))
257 WARN("%s: unable to get AEMIF clock\n", __func__);
258 else
259 clk_enable(aemif);
260
261 platform_add_devices(davinci_leopard_devices,
262 ARRAY_SIZE(davinci_leopard_devices));
263 leopard_init_i2c();
264 davinci_serial_init(&uart_config);
265
266 /* NOTE: NAND flash timings set by the UBL are slower than
267 * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
268 * but could be 0x0400008c for about 25% faster page reads.
269 */
270
271 gpio_request(2, "usb_id_toggle");
272 gpio_direction_output(2, USB_ID_VALUE);
273 /* irlml6401 switches over 1A in under 8 msec */
274 setup_usb(500, 8);
275
276 davinci_setup_mmc(0, &dm355leopard_mmc_config);
277 davinci_setup_mmc(1, &dm355leopard_mmc_config);
278
279 dm355_init_spi0(BIT(0), dm355_leopard_spi_info,
280 ARRAY_SIZE(dm355_leopard_spi_info));
281}
282
283static __init void dm355_leopard_irq_init(void)
284{
285 davinci_irq_init();
286}
287
288MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
289 .phys_io = IO_PHYS,
290 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
291 .boot_params = (0x80000100),
292 .map_io = dm355_leopard_map_io,
293 .init_irq = dm355_leopard_irq_init,
294 .timer = &davinci_timer,
295 .init_machine = dm355_leopard_init,
296MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index b2e7f9c63bc5..d9d40450bdc5 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -16,12 +16,11 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/memory.h> 18#include <linux/memory.h>
19#include <linux/etherdevice.h>
20 19
21#include <linux/i2c.h> 20#include <linux/i2c.h>
22#include <linux/i2c/pcf857x.h> 21#include <linux/i2c/pcf857x.h>
23#include <linux/i2c/at24.h> 22#include <linux/i2c/at24.h>
24 23#include <linux/etherdevice.h>
25#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
26#include <linux/mtd/nand.h> 25#include <linux/mtd/nand.h>
27#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
@@ -44,6 +43,9 @@
44#include <mach/mux.h> 43#include <mach/mux.h>
45#include <mach/psc.h> 44#include <mach/psc.h>
46#include <mach/nand.h> 45#include <mach/nand.h>
46#include <mach/mmc.h>
47#include <mach/emac.h>
48#include <mach/common.h>
47 49
48#define DM644X_EVM_PHY_MASK (0x2) 50#define DM644X_EVM_PHY_MASK (0x2)
49#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 51#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
@@ -436,45 +438,15 @@ static struct pcf857x_platform_data pcf_data_u35 = {
436 * - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL) 438 * - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL)
437 * - ... newer boards may have more 439 * - ... newer boards may have more
438 */ 440 */
439static struct memory_accessor *at24_mem_acc;
440
441static void at24_setup(struct memory_accessor *mem_acc, void *context)
442{
443 DECLARE_MAC_BUF(mac_str);
444 char mac_addr[6];
445
446 at24_mem_acc = mem_acc;
447
448 /* Read MAC addr from EEPROM */
449 if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, 6) == 6) {
450 printk(KERN_INFO "Read MAC addr from EEPROM: %s\n",
451 print_mac(mac_str, mac_addr));
452 }
453}
454 441
455static struct at24_platform_data eeprom_info = { 442static struct at24_platform_data eeprom_info = {
456 .byte_len = (256*1024) / 8, 443 .byte_len = (256*1024) / 8,
457 .page_size = 64, 444 .page_size = 64,
458 .flags = AT24_FLAG_ADDR16, 445 .flags = AT24_FLAG_ADDR16,
459 .setup = at24_setup, 446 .setup = davinci_get_mac_addr,
447 .context = (void *)0x7f00,
460}; 448};
461 449
462int dm6446evm_eeprom_read(void *buf, off_t off, size_t count)
463{
464 if (at24_mem_acc)
465 return at24_mem_acc->read(at24_mem_acc, buf, off, count);
466 return -ENODEV;
467}
468EXPORT_SYMBOL(dm6446evm_eeprom_read);
469
470int dm6446evm_eeprom_write(void *buf, off_t off, size_t count)
471{
472 if (at24_mem_acc)
473 return at24_mem_acc->write(at24_mem_acc, buf, off, count);
474 return -ENODEV;
475}
476EXPORT_SYMBOL(dm6446evm_eeprom_write);
477
478/* 450/*
479 * MSP430 supports RTC, card detection, input from IR remote, and 451 * MSP430 supports RTC, card detection, input from IR remote, and
480 * a bit more. It triggers interrupts on GPIO(7) from pressing 452 * a bit more. It triggers interrupts on GPIO(7) from pressing
@@ -545,6 +517,27 @@ static int dm6444evm_msp430_get_pins(void)
545 return (buf[3] << 8) | buf[2]; 517 return (buf[3] << 8) | buf[2];
546} 518}
547 519
520static int dm6444evm_mmc_get_cd(int module)
521{
522 int status = dm6444evm_msp430_get_pins();
523
524 return (status < 0) ? status : !(status & BIT(1));
525}
526
527static int dm6444evm_mmc_get_ro(int module)
528{
529 int status = dm6444evm_msp430_get_pins();
530
531 return (status < 0) ? status : status & BIT(6 + 8);
532}
533
534static struct davinci_mmc_config dm6446evm_mmc_config = {
535 .get_cd = dm6444evm_mmc_get_cd,
536 .get_ro = dm6444evm_mmc_get_ro,
537 .wires = 4,
538 .version = MMC_CTLR_VERSION_1
539};
540
548static struct i2c_board_info __initdata i2c_info[] = { 541static struct i2c_board_info __initdata i2c_info[] = {
549 { 542 {
550 I2C_BOARD_INFO("dm6446evm_msp", 0x23), 543 I2C_BOARD_INFO("dm6446evm_msp", 0x23),
@@ -598,7 +591,6 @@ static struct davinci_uart_config uart_config __initdata = {
598static void __init 591static void __init
599davinci_evm_map_io(void) 592davinci_evm_map_io(void)
600{ 593{
601 davinci_map_common_io();
602 dm644x_init(); 594 dm644x_init();
603} 595}
604 596
@@ -639,6 +631,7 @@ static int davinci_phy_fixup(struct phy_device *phydev)
639static __init void davinci_evm_init(void) 631static __init void davinci_evm_init(void)
640{ 632{
641 struct clk *aemif_clk; 633 struct clk *aemif_clk;
634 struct davinci_soc_info *soc_info = &davinci_soc_info;
642 635
643 aemif_clk = clk_get(NULL, "aemif"); 636 aemif_clk = clk_get(NULL, "aemif");
644 clk_enable(aemif_clk); 637 clk_enable(aemif_clk);
@@ -671,8 +664,13 @@ static __init void davinci_evm_init(void)
671 ARRAY_SIZE(davinci_evm_devices)); 664 ARRAY_SIZE(davinci_evm_devices));
672 evm_init_i2c(); 665 evm_init_i2c();
673 666
667 davinci_setup_mmc(0, &dm6446evm_mmc_config);
668
674 davinci_serial_init(&uart_config); 669 davinci_serial_init(&uart_config);
675 670
671 soc_info->emac_pdata->phy_mask = DM644X_EVM_PHY_MASK;
672 soc_info->emac_pdata->mdio_max_freq = DM644X_EVM_MDIO_FREQUENCY;
673
676 /* Register the fixup for PHY on DaVinci */ 674 /* Register the fixup for PHY on DaVinci */
677 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK, 675 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
678 davinci_phy_fixup); 676 davinci_phy_fixup);
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
new file mode 100644
index 000000000000..e17de6352624
--- /dev/null
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -0,0 +1,262 @@
1/*
2 * TI DaVinci DM646X EVM board
3 *
4 * Derived from: arch/arm/mach-davinci/board-evm.c
5 * Copyright (C) 2006 Texas Instruments.
6 *
7 * (C) 2007-2008, MontaVista Software, Inc.
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 *
13 */
14
15/**************************************************************************
16 * Included Files
17 **************************************************************************/
18
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/init.h>
22#include <linux/fs.h>
23#include <linux/major.h>
24#include <linux/root_dev.h>
25#include <linux/dma-mapping.h>
26#include <linux/serial.h>
27#include <linux/serial_8250.h>
28#include <linux/leds.h>
29#include <linux/gpio.h>
30#include <linux/io.h>
31#include <linux/platform_device.h>
32#include <linux/i2c.h>
33#include <linux/i2c/at24.h>
34#include <linux/i2c/pcf857x.h>
35#include <linux/etherdevice.h>
36
37#include <asm/setup.h>
38#include <asm/mach-types.h>
39#include <asm/mach/arch.h>
40#include <asm/mach/map.h>
41#include <asm/mach/flash.h>
42
43#include <mach/dm646x.h>
44#include <mach/common.h>
45#include <mach/psc.h>
46#include <mach/serial.h>
47#include <mach/i2c.h>
48#include <mach/mmc.h>
49#include <mach/emac.h>
50#include <mach/common.h>
51
52#define DM646X_EVM_PHY_MASK (0x2)
53#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
54
55static struct davinci_uart_config uart_config __initdata = {
56 .enabled_uarts = (1 << 0),
57};
58
59/* LEDS */
60
61static struct gpio_led evm_leds[] = {
62 { .name = "DS1", .active_low = 1, },
63 { .name = "DS2", .active_low = 1, },
64 { .name = "DS3", .active_low = 1, },
65 { .name = "DS4", .active_low = 1, },
66};
67
68static __initconst struct gpio_led_platform_data evm_led_data = {
69 .num_leds = ARRAY_SIZE(evm_leds),
70 .leds = evm_leds,
71};
72
73static struct platform_device *evm_led_dev;
74
75static int evm_led_setup(struct i2c_client *client, int gpio,
76 unsigned int ngpio, void *c)
77{
78 struct gpio_led *leds = evm_leds;
79 int status;
80
81 while (ngpio--) {
82 leds->gpio = gpio++;
83 leds++;
84 };
85
86 evm_led_dev = platform_device_alloc("leds-gpio", 0);
87 platform_device_add_data(evm_led_dev, &evm_led_data,
88 sizeof(evm_led_data));
89
90 evm_led_dev->dev.parent = &client->dev;
91 status = platform_device_add(evm_led_dev);
92 if (status < 0) {
93 platform_device_put(evm_led_dev);
94 evm_led_dev = NULL;
95 }
96 return status;
97}
98
99static int evm_led_teardown(struct i2c_client *client, int gpio,
100 unsigned ngpio, void *c)
101{
102 if (evm_led_dev) {
103 platform_device_unregister(evm_led_dev);
104 evm_led_dev = NULL;
105 }
106 return 0;
107}
108
109static int evm_sw_gpio[4] = { -EINVAL, -EINVAL, -EINVAL, -EINVAL };
110
111static int evm_sw_setup(struct i2c_client *client, int gpio,
112 unsigned ngpio, void *c)
113{
114 int status;
115 int i;
116 char label[10];
117
118 for (i = 0; i < 4; ++i) {
119 snprintf(label, 10, "user_sw%d", i);
120 status = gpio_request(gpio, label);
121 if (status)
122 goto out_free;
123 evm_sw_gpio[i] = gpio++;
124
125 status = gpio_direction_input(evm_sw_gpio[i]);
126 if (status) {
127 gpio_free(evm_sw_gpio[i]);
128 evm_sw_gpio[i] = -EINVAL;
129 goto out_free;
130 }
131
132 status = gpio_export(evm_sw_gpio[i], 0);
133 if (status) {
134 gpio_free(evm_sw_gpio[i]);
135 evm_sw_gpio[i] = -EINVAL;
136 goto out_free;
137 }
138 }
139 return status;
140out_free:
141 for (i = 0; i < 4; ++i) {
142 if (evm_sw_gpio[i] != -EINVAL) {
143 gpio_free(evm_sw_gpio[i]);
144 evm_sw_gpio[i] = -EINVAL;
145 }
146 }
147 return status;
148}
149
150static int evm_sw_teardown(struct i2c_client *client, int gpio,
151 unsigned ngpio, void *c)
152{
153 int i;
154
155 for (i = 0; i < 4; ++i) {
156 if (evm_sw_gpio[i] != -EINVAL) {
157 gpio_unexport(evm_sw_gpio[i]);
158 gpio_free(evm_sw_gpio[i]);
159 evm_sw_gpio[i] = -EINVAL;
160 }
161 }
162 return 0;
163}
164
165static int evm_pcf_setup(struct i2c_client *client, int gpio,
166 unsigned int ngpio, void *c)
167{
168 int status;
169
170 if (ngpio < 8)
171 return -EINVAL;
172
173 status = evm_sw_setup(client, gpio, 4, c);
174 if (status)
175 return status;
176
177 return evm_led_setup(client, gpio+4, 4, c);
178}
179
180static int evm_pcf_teardown(struct i2c_client *client, int gpio,
181 unsigned int ngpio, void *c)
182{
183 BUG_ON(ngpio < 8);
184
185 evm_sw_teardown(client, gpio, 4, c);
186 evm_led_teardown(client, gpio+4, 4, c);
187
188 return 0;
189}
190
191static struct pcf857x_platform_data pcf_data = {
192 .gpio_base = DAVINCI_N_GPIO+1,
193 .setup = evm_pcf_setup,
194 .teardown = evm_pcf_teardown,
195};
196
197/* Most of this EEPROM is unused, but U-Boot uses some data:
198 * - 0x7f00, 6 bytes Ethernet Address
199 * - ... newer boards may have more
200 */
201
202static struct at24_platform_data eeprom_info = {
203 .byte_len = (256*1024) / 8,
204 .page_size = 64,
205 .flags = AT24_FLAG_ADDR16,
206 .setup = davinci_get_mac_addr,
207 .context = (void *)0x7f00,
208};
209
210static struct i2c_board_info __initdata i2c_info[] = {
211 {
212 I2C_BOARD_INFO("24c256", 0x50),
213 .platform_data = &eeprom_info,
214 },
215 {
216 I2C_BOARD_INFO("pcf8574a", 0x38),
217 .platform_data = &pcf_data,
218 },
219};
220
221static struct davinci_i2c_platform_data i2c_pdata = {
222 .bus_freq = 100 /* kHz */,
223 .bus_delay = 0 /* usec */,
224};
225
226static void __init evm_init_i2c(void)
227{
228 davinci_init_i2c(&i2c_pdata);
229 i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
230}
231
232static void __init davinci_map_io(void)
233{
234 dm646x_init();
235}
236
237static __init void evm_init(void)
238{
239 struct davinci_soc_info *soc_info = &davinci_soc_info;
240
241 evm_init_i2c();
242 davinci_serial_init(&uart_config);
243
244 soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK;
245 soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
246}
247
248static __init void davinci_dm646x_evm_irq_init(void)
249{
250 davinci_irq_init();
251}
252
253MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
254 .phys_io = IO_PHYS,
255 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
256 .boot_params = (0x80000100),
257 .map_io = davinci_map_io,
258 .init_irq = davinci_dm646x_evm_irq_init,
259 .timer = &davinci_timer,
260 .init_machine = evm_init,
261MACHINE_END
262
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
new file mode 100644
index 000000000000..748a8e48541e
--- /dev/null
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -0,0 +1,189 @@
1/*
2 * Lyrtech SFFSDR board support.
3 *
4 * Copyright (C) 2008 Philip Balister, OpenSDR <philip@opensdr.com>
5 * Copyright (C) 2008 Lyrtech <www.lyrtech.com>
6 *
7 * Based on DV-EVM platform, original copyright follows:
8 *
9 * Copyright (C) 2007 MontaVista Software, Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#include <linux/kernel.h>
27#include <linux/module.h>
28#include <linux/init.h>
29#include <linux/dma-mapping.h>
30#include <linux/platform_device.h>
31#include <linux/gpio.h>
32
33#include <linux/i2c.h>
34#include <linux/i2c/at24.h>
35#include <linux/etherdevice.h>
36#include <linux/mtd/mtd.h>
37#include <linux/mtd/nand.h>
38#include <linux/mtd/partitions.h>
39#include <linux/mtd/physmap.h>
40#include <linux/io.h>
41
42#include <asm/setup.h>
43#include <asm/mach-types.h>
44
45#include <asm/mach/arch.h>
46#include <asm/mach/map.h>
47#include <asm/mach/flash.h>
48
49#include <mach/dm644x.h>
50#include <mach/common.h>
51#include <mach/i2c.h>
52#include <mach/serial.h>
53#include <mach/psc.h>
54#include <mach/mux.h>
55#include <mach/common.h>
56
57#define SFFSDR_PHY_MASK (0x2)
58#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
59
60#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e00000
61#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
62
63struct mtd_partition davinci_sffsdr_nandflash_partition[] = {
64 /* U-Boot Environment: Block 0
65 * UBL: Block 1
66 * U-Boot: Blocks 6-7 (256 kb)
67 * Integrity Kernel: Blocks 8-31 (3 Mb)
68 * Integrity Data: Blocks 100-END
69 */
70 {
71 .name = "Linux Kernel",
72 .offset = 32 * SZ_128K,
73 .size = 16 * SZ_128K, /* 2 Mb */
74 .mask_flags = MTD_WRITEABLE, /* Force read-only */
75 },
76 {
77 .name = "Linux ROOT",
78 .offset = MTDPART_OFS_APPEND,
79 .size = 256 * SZ_128K, /* 32 Mb */
80 .mask_flags = 0, /* R/W */
81 },
82};
83
84static struct flash_platform_data davinci_sffsdr_nandflash_data = {
85 .parts = davinci_sffsdr_nandflash_partition,
86 .nr_parts = ARRAY_SIZE(davinci_sffsdr_nandflash_partition),
87};
88
89static struct resource davinci_sffsdr_nandflash_resource[] = {
90 {
91 .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
92 .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
93 .flags = IORESOURCE_MEM,
94 }, {
95 .start = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
96 .end = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
97 .flags = IORESOURCE_MEM,
98 },
99};
100
101static struct platform_device davinci_sffsdr_nandflash_device = {
102 .name = "davinci_nand", /* Name of driver */
103 .id = 0,
104 .dev = {
105 .platform_data = &davinci_sffsdr_nandflash_data,
106 },
107 .num_resources = ARRAY_SIZE(davinci_sffsdr_nandflash_resource),
108 .resource = davinci_sffsdr_nandflash_resource,
109};
110
111static struct emac_platform_data sffsdr_emac_pdata = {
112 .phy_mask = SFFSDR_PHY_MASK,
113 .mdio_max_freq = SFFSDR_MDIO_FREQUENCY,
114};
115
116static struct at24_platform_data eeprom_info = {
117 .byte_len = (64*1024) / 8,
118 .page_size = 32,
119 .flags = AT24_FLAG_ADDR16,
120};
121
122static struct i2c_board_info __initdata i2c_info[] = {
123 {
124 I2C_BOARD_INFO("24lc64", 0x50),
125 .platform_data = &eeprom_info,
126 },
127 /* Other I2C devices:
128 * MSP430, addr 0x23 (not used)
129 * PCA9543, addr 0x70 (setup done by U-Boot)
130 * ADS7828, addr 0x48 (ADC for voltage monitoring.)
131 */
132};
133
134static struct davinci_i2c_platform_data i2c_pdata = {
135 .bus_freq = 20 /* kHz */,
136 .bus_delay = 100 /* usec */,
137};
138
139static void __init sffsdr_init_i2c(void)
140{
141 davinci_init_i2c(&i2c_pdata);
142 i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
143}
144
145static struct platform_device *davinci_sffsdr_devices[] __initdata = {
146 &davinci_sffsdr_nandflash_device,
147};
148
149static struct davinci_uart_config uart_config __initdata = {
150 .enabled_uarts = (1 << 0),
151};
152
153static void __init davinci_sffsdr_map_io(void)
154{
155 dm644x_init();
156}
157
158static __init void davinci_sffsdr_init(void)
159{
160 struct davinci_soc_info *soc_info = &davinci_soc_info;
161
162 platform_add_devices(davinci_sffsdr_devices,
163 ARRAY_SIZE(davinci_sffsdr_devices));
164 sffsdr_init_i2c();
165 davinci_serial_init(&uart_config);
166 soc_info->emac_pdata->phy_mask = SFFSDR_PHY_MASK;
167 soc_info->emac_pdata->mdio_max_freq = SFFSDR_MDIO_FREQUENCY;
168 setup_usb(0, 0); /* We support only peripheral mode. */
169
170 /* mux VLYNQ pins */
171 davinci_cfg_reg(DM644X_VLYNQEN);
172 davinci_cfg_reg(DM644X_VLYNQWD);
173}
174
175static __init void davinci_sffsdr_irq_init(void)
176{
177 davinci_irq_init();
178}
179
180MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
181 /* Maintainer: Hugo Villeneuve hugo.villeneuve@lyrtech.com */
182 .phys_io = IO_PHYS,
183 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
184 .boot_params = (DAVINCI_DDR_BASE + 0x100),
185 .map_io = davinci_sffsdr_map_io,
186 .init_irq = davinci_sffsdr_irq_init,
187 .timer = &davinci_timer,
188 .init_machine = davinci_sffsdr_init,
189MACHINE_END
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index f0baaa15a57e..39bf321d70a2 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -42,7 +42,8 @@ static void __clk_enable(struct clk *clk)
42 if (clk->parent) 42 if (clk->parent)
43 __clk_enable(clk->parent); 43 __clk_enable(clk->parent);
44 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) 44 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
45 davinci_psc_config(psc_domain(clk), clk->lpsc, 1); 45 davinci_psc_config(psc_domain(clk), clk->psc_ctlr,
46 clk->lpsc, 1);
46} 47}
47 48
48static void __clk_disable(struct clk *clk) 49static void __clk_disable(struct clk *clk)
@@ -50,7 +51,8 @@ static void __clk_disable(struct clk *clk)
50 if (WARN_ON(clk->usecount == 0)) 51 if (WARN_ON(clk->usecount == 0))
51 return; 52 return;
52 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL)) 53 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL))
53 davinci_psc_config(psc_domain(clk), clk->lpsc, 0); 54 davinci_psc_config(psc_domain(clk), clk->psc_ctlr,
55 clk->lpsc, 0);
54 if (clk->parent) 56 if (clk->parent)
55 __clk_disable(clk->parent); 57 __clk_disable(clk->parent);
56} 58}
@@ -164,11 +166,11 @@ static int __init clk_disable_unused(void)
164 continue; 166 continue;
165 167
166 /* ignore if in Disabled or SwRstDisable states */ 168 /* ignore if in Disabled or SwRstDisable states */
167 if (!davinci_psc_is_clk_active(ck->lpsc)) 169 if (!davinci_psc_is_clk_active(ck->psc_ctlr, ck->lpsc))
168 continue; 170 continue;
169 171
170 pr_info("Clocks: disable unused %s\n", ck->name); 172 pr_info("Clocks: disable unused %s\n", ck->name);
171 davinci_psc_config(psc_domain(ck), ck->lpsc, 0); 173 davinci_psc_config(psc_domain(ck), ck->psc_ctlr, ck->lpsc, 0);
172 } 174 }
173 spin_unlock_irq(&clockfw_lock); 175 spin_unlock_irq(&clockfw_lock);
174 176
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 35736ec202f8..27233cb4a2fb 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -67,6 +67,7 @@ struct clk {
67 u8 usecount; 67 u8 usecount;
68 u8 flags; 68 u8 flags;
69 u8 lpsc; 69 u8 lpsc;
70 u8 psc_ctlr;
70 struct clk *parent; 71 struct clk *parent;
71 struct pll_data *pll_data; 72 struct pll_data *pll_data;
72 u32 div_reg; 73 u32 div_reg;
@@ -93,4 +94,7 @@ struct davinci_clk {
93 } 94 }
94 95
95int davinci_clk_init(struct davinci_clk *clocks); 96int davinci_clk_init(struct davinci_clk *clocks);
97
98extern struct platform_device davinci_wdt_device;
99
96#endif 100#endif
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
new file mode 100644
index 000000000000..61ede19c6b54
--- /dev/null
+++ b/arch/arm/mach-davinci/common.c
@@ -0,0 +1,108 @@
1/*
2 * Code commons to all DaVinci SoCs.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2009 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#include <linux/module.h>
12#include <linux/io.h>
13#include <linux/etherdevice.h>
14
15#include <asm/tlb.h>
16#include <asm/mach/map.h>
17
18#include <mach/common.h>
19#include <mach/cputype.h>
20#include <mach/emac.h>
21
22#include "clock.h"
23
24struct davinci_soc_info davinci_soc_info;
25EXPORT_SYMBOL(davinci_soc_info);
26
27void __iomem *davinci_intc_base;
28int davinci_intc_type;
29
30void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context)
31{
32 char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
33 off_t offset = (off_t)context;
34
35 /* Read MAC addr from EEPROM */
36 if (mem_acc->read(mem_acc, mac_addr, offset, ETH_ALEN) == ETH_ALEN)
37 pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
38}
39
40static struct davinci_id * __init davinci_get_id(u32 jtag_id)
41{
42 int i;
43 struct davinci_id *dip;
44 u8 variant = (jtag_id & 0xf0000000) >> 28;
45 u16 part_no = (jtag_id & 0x0ffff000) >> 12;
46
47 for (i = 0, dip = davinci_soc_info.ids; i < davinci_soc_info.ids_num;
48 i++, dip++)
49 /* Don't care about the manufacturer right now */
50 if ((dip->part_no == part_no) && (dip->variant == variant))
51 return dip;
52
53 return NULL;
54}
55
56void __init davinci_common_init(struct davinci_soc_info *soc_info)
57{
58 int ret;
59 struct davinci_id *dip;
60
61 if (!soc_info) {
62 ret = -EINVAL;
63 goto err;
64 }
65
66 memcpy(&davinci_soc_info, soc_info, sizeof(struct davinci_soc_info));
67
68 if (davinci_soc_info.io_desc && (davinci_soc_info.io_desc_num > 0))
69 iotable_init(davinci_soc_info.io_desc,
70 davinci_soc_info.io_desc_num);
71
72 /*
73 * Normally devicemaps_init() would flush caches and tlb after
74 * mdesc->map_io(), but we must also do it here because of the CPU
75 * revision check below.
76 */
77 local_flush_tlb_all();
78 flush_cache_all();
79
80 /*
81 * We want to check CPU revision early for cpu_is_xxxx() macros.
82 * IO space mapping must be initialized before we can do that.
83 */
84 davinci_soc_info.jtag_id = __raw_readl(davinci_soc_info.jtag_id_base);
85
86 dip = davinci_get_id(davinci_soc_info.jtag_id);
87 if (!dip) {
88 ret = -EINVAL;
89 goto err;
90 }
91
92 davinci_soc_info.cpu_id = dip->cpu_id;
93 pr_info("DaVinci %s variant 0x%x\n", dip->name, dip->variant);
94
95 if (davinci_soc_info.cpu_clks) {
96 ret = davinci_clk_init(davinci_soc_info.cpu_clks);
97
98 if (ret != 0)
99 goto err;
100 }
101
102 davinci_intc_base = davinci_soc_info.intc_base;
103 davinci_intc_type = davinci_soc_info.intc_type;
104 return;
105
106err:
107 pr_err("davinci_common_init: SoC Initialization failed\n");
108}
diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
new file mode 100644
index 000000000000..96c8e97a7deb
--- /dev/null
+++ b/arch/arm/mach-davinci/cp_intc.c
@@ -0,0 +1,161 @@
1/*
2 * TI Common Platform Interrupt Controller (cp_intc) driver
3 *
4 * Author: Steve Chen <schen@mvista.com>
5 * Copyright (C) 2008-2009, MontaVista Software, Inc. <source@mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#include <linux/init.h>
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/kernel.h>
16#include <linux/irq.h>
17#include <linux/io.h>
18
19#include <mach/cp_intc.h>
20
21static void __iomem *cp_intc_base;
22
23static inline unsigned int cp_intc_read(unsigned offset)
24{
25 return __raw_readl(cp_intc_base + offset);
26}
27
28static inline void cp_intc_write(unsigned long value, unsigned offset)
29{
30 __raw_writel(value, cp_intc_base + offset);
31}
32
33static void cp_intc_ack_irq(unsigned int irq)
34{
35 cp_intc_write(irq, CP_INTC_SYS_STAT_IDX_CLR);
36}
37
38/* Disable interrupt */
39static void cp_intc_mask_irq(unsigned int irq)
40{
41 /* XXX don't know why we need to disable nIRQ here... */
42 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR);
43 cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_CLR);
44 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET);
45}
46
47/* Enable interrupt */
48static void cp_intc_unmask_irq(unsigned int irq)
49{
50 cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_SET);
51}
52
53static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type)
54{
55 unsigned reg = BIT_WORD(irq);
56 unsigned mask = BIT_MASK(irq);
57 unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg));
58 unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg));
59
60 switch (flow_type) {
61 case IRQ_TYPE_EDGE_RISING:
62 polarity |= mask;
63 type |= mask;
64 break;
65 case IRQ_TYPE_EDGE_FALLING:
66 polarity &= ~mask;
67 type |= mask;
68 break;
69 case IRQ_TYPE_LEVEL_HIGH:
70 polarity |= mask;
71 type &= ~mask;
72 break;
73 case IRQ_TYPE_LEVEL_LOW:
74 polarity &= ~mask;
75 type &= ~mask;
76 break;
77 default:
78 return -EINVAL;
79 }
80
81 cp_intc_write(polarity, CP_INTC_SYS_POLARITY(reg));
82 cp_intc_write(type, CP_INTC_SYS_TYPE(reg));
83
84 return 0;
85}
86
87static struct irq_chip cp_intc_irq_chip = {
88 .name = "cp_intc",
89 .ack = cp_intc_ack_irq,
90 .mask = cp_intc_mask_irq,
91 .unmask = cp_intc_unmask_irq,
92 .set_type = cp_intc_set_irq_type,
93};
94
95void __init cp_intc_init(void __iomem *base, unsigned short num_irq,
96 u8 *irq_prio)
97{
98 unsigned num_reg = BITS_TO_LONGS(num_irq);
99 int i;
100
101 cp_intc_base = base;
102
103 cp_intc_write(0, CP_INTC_GLOBAL_ENABLE);
104
105 /* Disable all host interrupts */
106 cp_intc_write(0, CP_INTC_HOST_ENABLE(0));
107
108 /* Disable system interrupts */
109 for (i = 0; i < num_reg; i++)
110 cp_intc_write(~0, CP_INTC_SYS_ENABLE_CLR(i));
111
112 /* Set to normal mode, no nesting, no priority hold */
113 cp_intc_write(0, CP_INTC_CTRL);
114 cp_intc_write(0, CP_INTC_HOST_CTRL);
115
116 /* Clear system interrupt status */
117 for (i = 0; i < num_reg; i++)
118 cp_intc_write(~0, CP_INTC_SYS_STAT_CLR(i));
119
120 /* Enable nIRQ (what about nFIQ?) */
121 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET);
122
123 /*
124 * Priority is determined by host channel: lower channel number has
125 * higher priority i.e. channel 0 has highest priority and channel 31
126 * had the lowest priority.
127 */
128 num_reg = (num_irq + 3) >> 2; /* 4 channels per register */
129 if (irq_prio) {
130 unsigned j, k;
131 u32 val;
132
133 for (k = i = 0; i < num_reg; i++) {
134 for (val = j = 0; j < 4; j++, k++) {
135 val >>= 8;
136 if (k < num_irq)
137 val |= irq_prio[k] << 24;
138 }
139
140 cp_intc_write(val, CP_INTC_CHAN_MAP(i));
141 }
142 } else {
143 /*
144 * Default everything to channel 15 if priority not specified.
145 * Note that channel 0-1 are mapped to nFIQ and channels 2-31
146 * are mapped to nIRQ.
147 */
148 for (i = 0; i < num_reg; i++)
149 cp_intc_write(0x0f0f0f0f, CP_INTC_CHAN_MAP(i));
150 }
151
152 /* Set up genirq dispatching for cp_intc */
153 for (i = 0; i < num_irq; i++) {
154 set_irq_chip(i, &cp_intc_irq_chip);
155 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
156 set_irq_handler(i, handle_edge_irq);
157 }
158
159 /* Enable global interrupt */
160 cp_intc_write(1, CP_INTC_GLOBAL_ENABLE);
161}
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index a31370b93dd2..de16f347566a 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -23,8 +23,14 @@
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24#include <mach/cputype.h> 24#include <mach/cputype.h>
25#include <mach/mux.h> 25#include <mach/mux.h>
26#include <mach/edma.h>
27#include <mach/mmc.h>
28#include <mach/time.h>
26 29
27#define DAVINCI_I2C_BASE 0x01C21000 30#define DAVINCI_I2C_BASE 0x01C21000
31#define DAVINCI_MMCSD0_BASE 0x01E10000
32#define DM355_MMCSD0_BASE 0x01E11000
33#define DM355_MMCSD1_BASE 0x01E00000
28 34
29static struct resource i2c_resources[] = { 35static struct resource i2c_resources[] = {
30 { 36 {
@@ -54,3 +60,208 @@ void __init davinci_init_i2c(struct davinci_i2c_platform_data *pdata)
54 (void) platform_device_register(&davinci_i2c_device); 60 (void) platform_device_register(&davinci_i2c_device);
55} 61}
56 62
63#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE)
64
65static u64 mmcsd0_dma_mask = DMA_BIT_MASK(32);
66
67static struct resource mmcsd0_resources[] = {
68 {
69 /* different on dm355 */
70 .start = DAVINCI_MMCSD0_BASE,
71 .end = DAVINCI_MMCSD0_BASE + SZ_4K - 1,
72 .flags = IORESOURCE_MEM,
73 },
74 /* IRQs: MMC/SD, then SDIO */
75 {
76 .start = IRQ_MMCINT,
77 .flags = IORESOURCE_IRQ,
78 }, {
79 /* different on dm355 */
80 .start = IRQ_SDIOINT,
81 .flags = IORESOURCE_IRQ,
82 },
83 /* DMA channels: RX, then TX */
84 {
85 .start = DAVINCI_DMA_MMCRXEVT,
86 .flags = IORESOURCE_DMA,
87 }, {
88 .start = DAVINCI_DMA_MMCTXEVT,
89 .flags = IORESOURCE_DMA,
90 },
91};
92
93static struct platform_device davinci_mmcsd0_device = {
94 .name = "davinci_mmc",
95 .id = 0,
96 .dev = {
97 .dma_mask = &mmcsd0_dma_mask,
98 .coherent_dma_mask = DMA_BIT_MASK(32),
99 },
100 .num_resources = ARRAY_SIZE(mmcsd0_resources),
101 .resource = mmcsd0_resources,
102};
103
104static u64 mmcsd1_dma_mask = DMA_BIT_MASK(32);
105
106static struct resource mmcsd1_resources[] = {
107 {
108 .start = DM355_MMCSD1_BASE,
109 .end = DM355_MMCSD1_BASE + SZ_4K - 1,
110 .flags = IORESOURCE_MEM,
111 },
112 /* IRQs: MMC/SD, then SDIO */
113 {
114 .start = IRQ_DM355_MMCINT1,
115 .flags = IORESOURCE_IRQ,
116 }, {
117 .start = IRQ_DM355_SDIOINT1,
118 .flags = IORESOURCE_IRQ,
119 },
120 /* DMA channels: RX, then TX */
121 {
122 .start = 30, /* rx */
123 .flags = IORESOURCE_DMA,
124 }, {
125 .start = 31, /* tx */
126 .flags = IORESOURCE_DMA,
127 },
128};
129
130static struct platform_device davinci_mmcsd1_device = {
131 .name = "davinci_mmc",
132 .id = 1,
133 .dev = {
134 .dma_mask = &mmcsd1_dma_mask,
135 .coherent_dma_mask = DMA_BIT_MASK(32),
136 },
137 .num_resources = ARRAY_SIZE(mmcsd1_resources),
138 .resource = mmcsd1_resources,
139};
140
141
142void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
143{
144 struct platform_device *pdev = NULL;
145
146 if (WARN_ON(cpu_is_davinci_dm646x()))
147 return;
148
149 /* REVISIT: update PINMUX, ARM_IRQMUX, and EDMA_EVTMUX here too;
150 * for example if MMCSD1 is used for SDIO, maybe DAT2 is unused.
151 *
152 * FIXME dm6441 (no MMC/SD), dm357 (one), and dm335 (two) are
153 * not handled right here ...
154 */
155 switch (module) {
156 case 1:
157 if (!cpu_is_davinci_dm355())
158 break;
159
160 /* REVISIT we may not need all these pins if e.g. this
161 * is a hard-wired SDIO device...
162 */
163 davinci_cfg_reg(DM355_SD1_CMD);
164 davinci_cfg_reg(DM355_SD1_CLK);
165 davinci_cfg_reg(DM355_SD1_DATA0);
166 davinci_cfg_reg(DM355_SD1_DATA1);
167 davinci_cfg_reg(DM355_SD1_DATA2);
168 davinci_cfg_reg(DM355_SD1_DATA3);
169
170 pdev = &davinci_mmcsd1_device;
171 break;
172 case 0:
173 if (cpu_is_davinci_dm355()) {
174 mmcsd0_resources[0].start = DM355_MMCSD0_BASE;
175 mmcsd0_resources[0].end = DM355_MMCSD0_BASE + SZ_4K - 1;
176 mmcsd0_resources[2].start = IRQ_DM355_SDIOINT0;
177
178 /* expose all 6 MMC0 signals: CLK, CMD, DATA[0..3] */
179 davinci_cfg_reg(DM355_MMCSD0);
180
181 /* enable RX EDMA */
182 davinci_cfg_reg(DM355_EVT26_MMC0_RX);
183 }
184
185 else if (cpu_is_davinci_dm644x()) {
186 /* REVISIT: should this be in board-init code? */
187 void __iomem *base =
188 IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
189
190 /* Power-on 3.3V IO cells */
191 __raw_writel(0, base + DM64XX_VDD3P3V_PWDN);
192 /*Set up the pull regiter for MMC */
193 davinci_cfg_reg(DM644X_MSTK);
194 }
195
196 pdev = &davinci_mmcsd0_device;
197 break;
198 }
199
200 if (WARN_ON(!pdev))
201 return;
202
203 pdev->dev.platform_data = config;
204 platform_device_register(pdev);
205}
206
207#else
208
209void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
210{
211}
212
213#endif
214
215/*-------------------------------------------------------------------------*/
216
217static struct resource wdt_resources[] = {
218 {
219 .flags = IORESOURCE_MEM,
220 },
221};
222
223struct platform_device davinci_wdt_device = {
224 .name = "watchdog",
225 .id = -1,
226 .num_resources = ARRAY_SIZE(wdt_resources),
227 .resource = wdt_resources,
228};
229
230static void davinci_init_wdt(void)
231{
232 struct davinci_soc_info *soc_info = &davinci_soc_info;
233
234 wdt_resources[0].start = (resource_size_t)soc_info->wdt_base;
235 wdt_resources[0].end = (resource_size_t)soc_info->wdt_base + SZ_1K - 1;
236
237 platform_device_register(&davinci_wdt_device);
238}
239
240/*-------------------------------------------------------------------------*/
241
242struct davinci_timer_instance davinci_timer_instance[2] = {
243 {
244 .base = IO_ADDRESS(DAVINCI_TIMER0_BASE),
245 .bottom_irq = IRQ_TINT0_TINT12,
246 .top_irq = IRQ_TINT0_TINT34,
247 },
248 {
249 .base = IO_ADDRESS(DAVINCI_TIMER1_BASE),
250 .bottom_irq = IRQ_TINT1_TINT12,
251 .top_irq = IRQ_TINT1_TINT34,
252 },
253};
254
255/*-------------------------------------------------------------------------*/
256
257static int __init davinci_init_devices(void)
258{
259 /* please keep these calls, and their implementations above,
260 * in alphabetical order so they're easier to sort through.
261 */
262 davinci_init_wdt();
263
264 return 0;
265}
266arch_initcall(davinci_init_devices);
267
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
new file mode 100644
index 000000000000..baaaf328de2e
--- /dev/null
+++ b/arch/arm/mach-davinci/dm355.c
@@ -0,0 +1,730 @@
1/*
2 * TI DaVinci DM355 chip specific setup
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/clk.h>
14#include <linux/serial_8250.h>
15#include <linux/platform_device.h>
16#include <linux/dma-mapping.h>
17#include <linux/gpio.h>
18
19#include <linux/spi/spi.h>
20
21#include <asm/mach/map.h>
22
23#include <mach/dm355.h>
24#include <mach/clock.h>
25#include <mach/cputype.h>
26#include <mach/edma.h>
27#include <mach/psc.h>
28#include <mach/mux.h>
29#include <mach/irqs.h>
30#include <mach/time.h>
31#include <mach/serial.h>
32#include <mach/common.h>
33
34#include "clock.h"
35#include "mux.h"
36
37#define DM355_UART2_BASE (IO_PHYS + 0x206000)
38
39/*
40 * Device specific clocks
41 */
42#define DM355_REF_FREQ 24000000 /* 24 or 36 MHz */
43
44static struct pll_data pll1_data = {
45 .num = 1,
46 .phys_base = DAVINCI_PLL1_BASE,
47 .flags = PLL_HAS_PREDIV | PLL_HAS_POSTDIV,
48};
49
50static struct pll_data pll2_data = {
51 .num = 2,
52 .phys_base = DAVINCI_PLL2_BASE,
53 .flags = PLL_HAS_PREDIV,
54};
55
56static struct clk ref_clk = {
57 .name = "ref_clk",
58 /* FIXME -- crystal rate is board-specific */
59 .rate = DM355_REF_FREQ,
60};
61
62static struct clk pll1_clk = {
63 .name = "pll1",
64 .parent = &ref_clk,
65 .flags = CLK_PLL,
66 .pll_data = &pll1_data,
67};
68
69static struct clk pll1_aux_clk = {
70 .name = "pll1_aux_clk",
71 .parent = &pll1_clk,
72 .flags = CLK_PLL | PRE_PLL,
73};
74
75static struct clk pll1_sysclk1 = {
76 .name = "pll1_sysclk1",
77 .parent = &pll1_clk,
78 .flags = CLK_PLL,
79 .div_reg = PLLDIV1,
80};
81
82static struct clk pll1_sysclk2 = {
83 .name = "pll1_sysclk2",
84 .parent = &pll1_clk,
85 .flags = CLK_PLL,
86 .div_reg = PLLDIV2,
87};
88
89static struct clk pll1_sysclk3 = {
90 .name = "pll1_sysclk3",
91 .parent = &pll1_clk,
92 .flags = CLK_PLL,
93 .div_reg = PLLDIV3,
94};
95
96static struct clk pll1_sysclk4 = {
97 .name = "pll1_sysclk4",
98 .parent = &pll1_clk,
99 .flags = CLK_PLL,
100 .div_reg = PLLDIV4,
101};
102
103static struct clk pll1_sysclkbp = {
104 .name = "pll1_sysclkbp",
105 .parent = &pll1_clk,
106 .flags = CLK_PLL | PRE_PLL,
107 .div_reg = BPDIV
108};
109
110static struct clk vpss_dac_clk = {
111 .name = "vpss_dac",
112 .parent = &pll1_sysclk3,
113 .lpsc = DM355_LPSC_VPSS_DAC,
114};
115
116static struct clk vpss_master_clk = {
117 .name = "vpss_master",
118 .parent = &pll1_sysclk4,
119 .lpsc = DAVINCI_LPSC_VPSSMSTR,
120 .flags = CLK_PSC,
121};
122
123static struct clk vpss_slave_clk = {
124 .name = "vpss_slave",
125 .parent = &pll1_sysclk4,
126 .lpsc = DAVINCI_LPSC_VPSSSLV,
127};
128
129
130static struct clk clkout1_clk = {
131 .name = "clkout1",
132 .parent = &pll1_aux_clk,
133 /* NOTE: clkout1 can be externally gated by muxing GPIO-18 */
134};
135
136static struct clk clkout2_clk = {
137 .name = "clkout2",
138 .parent = &pll1_sysclkbp,
139};
140
141static struct clk pll2_clk = {
142 .name = "pll2",
143 .parent = &ref_clk,
144 .flags = CLK_PLL,
145 .pll_data = &pll2_data,
146};
147
148static struct clk pll2_sysclk1 = {
149 .name = "pll2_sysclk1",
150 .parent = &pll2_clk,
151 .flags = CLK_PLL,
152 .div_reg = PLLDIV1,
153};
154
155static struct clk pll2_sysclkbp = {
156 .name = "pll2_sysclkbp",
157 .parent = &pll2_clk,
158 .flags = CLK_PLL | PRE_PLL,
159 .div_reg = BPDIV
160};
161
162static struct clk clkout3_clk = {
163 .name = "clkout3",
164 .parent = &pll2_sysclkbp,
165 /* NOTE: clkout3 can be externally gated by muxing GPIO-16 */
166};
167
168static struct clk arm_clk = {
169 .name = "arm_clk",
170 .parent = &pll1_sysclk1,
171 .lpsc = DAVINCI_LPSC_ARM,
172 .flags = ALWAYS_ENABLED,
173};
174
175/*
176 * NOT LISTED below, and not touched by Linux
177 * - in SyncReset state by default
178 * .lpsc = DAVINCI_LPSC_TPCC,
179 * .lpsc = DAVINCI_LPSC_TPTC0,
180 * .lpsc = DAVINCI_LPSC_TPTC1,
181 * .lpsc = DAVINCI_LPSC_DDR_EMIF, .parent = &sysclk2_clk,
182 * .lpsc = DAVINCI_LPSC_MEMSTICK,
183 * - in Enabled state by default
184 * .lpsc = DAVINCI_LPSC_SYSTEM_SUBSYS,
185 * .lpsc = DAVINCI_LPSC_SCR2, // "bus"
186 * .lpsc = DAVINCI_LPSC_SCR3, // "bus"
187 * .lpsc = DAVINCI_LPSC_SCR4, // "bus"
188 * .lpsc = DAVINCI_LPSC_CROSSBAR, // "emulation"
189 * .lpsc = DAVINCI_LPSC_CFG27, // "test"
190 * .lpsc = DAVINCI_LPSC_CFG3, // "test"
191 * .lpsc = DAVINCI_LPSC_CFG5, // "test"
192 */
193
194static struct clk mjcp_clk = {
195 .name = "mjcp",
196 .parent = &pll1_sysclk1,
197 .lpsc = DAVINCI_LPSC_IMCOP,
198};
199
200static struct clk uart0_clk = {
201 .name = "uart0",
202 .parent = &pll1_aux_clk,
203 .lpsc = DAVINCI_LPSC_UART0,
204};
205
206static struct clk uart1_clk = {
207 .name = "uart1",
208 .parent = &pll1_aux_clk,
209 .lpsc = DAVINCI_LPSC_UART1,
210};
211
212static struct clk uart2_clk = {
213 .name = "uart2",
214 .parent = &pll1_sysclk2,
215 .lpsc = DAVINCI_LPSC_UART2,
216};
217
218static struct clk i2c_clk = {
219 .name = "i2c",
220 .parent = &pll1_aux_clk,
221 .lpsc = DAVINCI_LPSC_I2C,
222};
223
224static struct clk asp0_clk = {
225 .name = "asp0",
226 .parent = &pll1_sysclk2,
227 .lpsc = DAVINCI_LPSC_McBSP,
228};
229
230static struct clk asp1_clk = {
231 .name = "asp1",
232 .parent = &pll1_sysclk2,
233 .lpsc = DM355_LPSC_McBSP1,
234};
235
236static struct clk mmcsd0_clk = {
237 .name = "mmcsd0",
238 .parent = &pll1_sysclk2,
239 .lpsc = DAVINCI_LPSC_MMC_SD,
240};
241
242static struct clk mmcsd1_clk = {
243 .name = "mmcsd1",
244 .parent = &pll1_sysclk2,
245 .lpsc = DM355_LPSC_MMC_SD1,
246};
247
248static struct clk spi0_clk = {
249 .name = "spi0",
250 .parent = &pll1_sysclk2,
251 .lpsc = DAVINCI_LPSC_SPI,
252};
253
254static struct clk spi1_clk = {
255 .name = "spi1",
256 .parent = &pll1_sysclk2,
257 .lpsc = DM355_LPSC_SPI1,
258};
259
260static struct clk spi2_clk = {
261 .name = "spi2",
262 .parent = &pll1_sysclk2,
263 .lpsc = DM355_LPSC_SPI2,
264};
265
266static struct clk gpio_clk = {
267 .name = "gpio",
268 .parent = &pll1_sysclk2,
269 .lpsc = DAVINCI_LPSC_GPIO,
270};
271
272static struct clk aemif_clk = {
273 .name = "aemif",
274 .parent = &pll1_sysclk2,
275 .lpsc = DAVINCI_LPSC_AEMIF,
276};
277
278static struct clk pwm0_clk = {
279 .name = "pwm0",
280 .parent = &pll1_aux_clk,
281 .lpsc = DAVINCI_LPSC_PWM0,
282};
283
284static struct clk pwm1_clk = {
285 .name = "pwm1",
286 .parent = &pll1_aux_clk,
287 .lpsc = DAVINCI_LPSC_PWM1,
288};
289
290static struct clk pwm2_clk = {
291 .name = "pwm2",
292 .parent = &pll1_aux_clk,
293 .lpsc = DAVINCI_LPSC_PWM2,
294};
295
296static struct clk pwm3_clk = {
297 .name = "pwm3",
298 .parent = &pll1_aux_clk,
299 .lpsc = DM355_LPSC_PWM3,
300};
301
302static struct clk timer0_clk = {
303 .name = "timer0",
304 .parent = &pll1_aux_clk,
305 .lpsc = DAVINCI_LPSC_TIMER0,
306};
307
308static struct clk timer1_clk = {
309 .name = "timer1",
310 .parent = &pll1_aux_clk,
311 .lpsc = DAVINCI_LPSC_TIMER1,
312};
313
314static struct clk timer2_clk = {
315 .name = "timer2",
316 .parent = &pll1_aux_clk,
317 .lpsc = DAVINCI_LPSC_TIMER2,
318 .usecount = 1, /* REVISIT: why cant' this be disabled? */
319};
320
321static struct clk timer3_clk = {
322 .name = "timer3",
323 .parent = &pll1_aux_clk,
324 .lpsc = DM355_LPSC_TIMER3,
325};
326
327static struct clk rto_clk = {
328 .name = "rto",
329 .parent = &pll1_aux_clk,
330 .lpsc = DM355_LPSC_RTO,
331};
332
333static struct clk usb_clk = {
334 .name = "usb",
335 .parent = &pll1_sysclk2,
336 .lpsc = DAVINCI_LPSC_USB,
337};
338
339static struct davinci_clk dm355_clks[] = {
340 CLK(NULL, "ref", &ref_clk),
341 CLK(NULL, "pll1", &pll1_clk),
342 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1),
343 CLK(NULL, "pll1_sysclk2", &pll1_sysclk2),
344 CLK(NULL, "pll1_sysclk3", &pll1_sysclk3),
345 CLK(NULL, "pll1_sysclk4", &pll1_sysclk4),
346 CLK(NULL, "pll1_aux", &pll1_aux_clk),
347 CLK(NULL, "pll1_sysclkbp", &pll1_sysclkbp),
348 CLK(NULL, "vpss_dac", &vpss_dac_clk),
349 CLK(NULL, "vpss_master", &vpss_master_clk),
350 CLK(NULL, "vpss_slave", &vpss_slave_clk),
351 CLK(NULL, "clkout1", &clkout1_clk),
352 CLK(NULL, "clkout2", &clkout2_clk),
353 CLK(NULL, "pll2", &pll2_clk),
354 CLK(NULL, "pll2_sysclk1", &pll2_sysclk1),
355 CLK(NULL, "pll2_sysclkbp", &pll2_sysclkbp),
356 CLK(NULL, "clkout3", &clkout3_clk),
357 CLK(NULL, "arm", &arm_clk),
358 CLK(NULL, "mjcp", &mjcp_clk),
359 CLK(NULL, "uart0", &uart0_clk),
360 CLK(NULL, "uart1", &uart1_clk),
361 CLK(NULL, "uart2", &uart2_clk),
362 CLK("i2c_davinci.1", NULL, &i2c_clk),
363 CLK("soc-audio.0", NULL, &asp0_clk),
364 CLK("soc-audio.1", NULL, &asp1_clk),
365 CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
366 CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
367 CLK(NULL, "spi0", &spi0_clk),
368 CLK(NULL, "spi1", &spi1_clk),
369 CLK(NULL, "spi2", &spi2_clk),
370 CLK(NULL, "gpio", &gpio_clk),
371 CLK(NULL, "aemif", &aemif_clk),
372 CLK(NULL, "pwm0", &pwm0_clk),
373 CLK(NULL, "pwm1", &pwm1_clk),
374 CLK(NULL, "pwm2", &pwm2_clk),
375 CLK(NULL, "pwm3", &pwm3_clk),
376 CLK(NULL, "timer0", &timer0_clk),
377 CLK(NULL, "timer1", &timer1_clk),
378 CLK("watchdog", NULL, &timer2_clk),
379 CLK(NULL, "timer3", &timer3_clk),
380 CLK(NULL, "rto", &rto_clk),
381 CLK(NULL, "usb", &usb_clk),
382 CLK(NULL, NULL, NULL),
383};
384
385/*----------------------------------------------------------------------*/
386
387static u64 dm355_spi0_dma_mask = DMA_BIT_MASK(32);
388
389static struct resource dm355_spi0_resources[] = {
390 {
391 .start = 0x01c66000,
392 .end = 0x01c667ff,
393 .flags = IORESOURCE_MEM,
394 },
395 {
396 .start = IRQ_DM355_SPINT0_1,
397 .flags = IORESOURCE_IRQ,
398 },
399 /* Not yet used, so not included:
400 * IORESOURCE_IRQ:
401 * - IRQ_DM355_SPINT0_0
402 * IORESOURCE_DMA:
403 * - DAVINCI_DMA_SPI_SPIX
404 * - DAVINCI_DMA_SPI_SPIR
405 */
406};
407
408static struct platform_device dm355_spi0_device = {
409 .name = "spi_davinci",
410 .id = 0,
411 .dev = {
412 .dma_mask = &dm355_spi0_dma_mask,
413 .coherent_dma_mask = DMA_BIT_MASK(32),
414 },
415 .num_resources = ARRAY_SIZE(dm355_spi0_resources),
416 .resource = dm355_spi0_resources,
417};
418
419void __init dm355_init_spi0(unsigned chipselect_mask,
420 struct spi_board_info *info, unsigned len)
421{
422 /* for now, assume we need MISO */
423 davinci_cfg_reg(DM355_SPI0_SDI);
424
425 /* not all slaves will be wired up */
426 if (chipselect_mask & BIT(0))
427 davinci_cfg_reg(DM355_SPI0_SDENA0);
428 if (chipselect_mask & BIT(1))
429 davinci_cfg_reg(DM355_SPI0_SDENA1);
430
431 spi_register_board_info(info, len);
432
433 platform_device_register(&dm355_spi0_device);
434}
435
436/*----------------------------------------------------------------------*/
437
438#define PINMUX0 0x00
439#define PINMUX1 0x04
440#define PINMUX2 0x08
441#define PINMUX3 0x0c
442#define PINMUX4 0x10
443#define INTMUX 0x18
444#define EVTMUX 0x1c
445
446/*
447 * Device specific mux setup
448 *
449 * soc description mux mode mode mux dbg
450 * reg offset mask mode
451 */
452static const struct mux_config dm355_pins[] = {
453#ifdef CONFIG_DAVINCI_MUX
454MUX_CFG(DM355, MMCSD0, 4, 2, 1, 0, false)
455
456MUX_CFG(DM355, SD1_CLK, 3, 6, 1, 1, false)
457MUX_CFG(DM355, SD1_CMD, 3, 7, 1, 1, false)
458MUX_CFG(DM355, SD1_DATA3, 3, 8, 3, 1, false)
459MUX_CFG(DM355, SD1_DATA2, 3, 10, 3, 1, false)
460MUX_CFG(DM355, SD1_DATA1, 3, 12, 3, 1, false)
461MUX_CFG(DM355, SD1_DATA0, 3, 14, 3, 1, false)
462
463MUX_CFG(DM355, I2C_SDA, 3, 19, 1, 1, false)
464MUX_CFG(DM355, I2C_SCL, 3, 20, 1, 1, false)
465
466MUX_CFG(DM355, MCBSP0_BDX, 3, 0, 1, 1, false)
467MUX_CFG(DM355, MCBSP0_X, 3, 1, 1, 1, false)
468MUX_CFG(DM355, MCBSP0_BFSX, 3, 2, 1, 1, false)
469MUX_CFG(DM355, MCBSP0_BDR, 3, 3, 1, 1, false)
470MUX_CFG(DM355, MCBSP0_R, 3, 4, 1, 1, false)
471MUX_CFG(DM355, MCBSP0_BFSR, 3, 5, 1, 1, false)
472
473MUX_CFG(DM355, SPI0_SDI, 4, 1, 1, 0, false)
474MUX_CFG(DM355, SPI0_SDENA0, 4, 0, 1, 0, false)
475MUX_CFG(DM355, SPI0_SDENA1, 3, 28, 1, 1, false)
476
477INT_CFG(DM355, INT_EDMA_CC, 2, 1, 1, false)
478INT_CFG(DM355, INT_EDMA_TC0_ERR, 3, 1, 1, false)
479INT_CFG(DM355, INT_EDMA_TC1_ERR, 4, 1, 1, false)
480
481EVT_CFG(DM355, EVT8_ASP1_TX, 0, 1, 0, false)
482EVT_CFG(DM355, EVT9_ASP1_RX, 1, 1, 0, false)
483EVT_CFG(DM355, EVT26_MMC0_RX, 2, 1, 0, false)
484#endif
485};
486
487static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
488 [IRQ_DM355_CCDC_VDINT0] = 2,
489 [IRQ_DM355_CCDC_VDINT1] = 6,
490 [IRQ_DM355_CCDC_VDINT2] = 6,
491 [IRQ_DM355_IPIPE_HST] = 6,
492 [IRQ_DM355_H3AINT] = 6,
493 [IRQ_DM355_IPIPE_SDR] = 6,
494 [IRQ_DM355_IPIPEIFINT] = 6,
495 [IRQ_DM355_OSDINT] = 7,
496 [IRQ_DM355_VENCINT] = 6,
497 [IRQ_ASQINT] = 6,
498 [IRQ_IMXINT] = 6,
499 [IRQ_USBINT] = 4,
500 [IRQ_DM355_RTOINT] = 4,
501 [IRQ_DM355_UARTINT2] = 7,
502 [IRQ_DM355_TINT6] = 7,
503 [IRQ_CCINT0] = 5, /* dma */
504 [IRQ_CCERRINT] = 5, /* dma */
505 [IRQ_TCERRINT0] = 5, /* dma */
506 [IRQ_TCERRINT] = 5, /* dma */
507 [IRQ_DM355_SPINT2_1] = 7,
508 [IRQ_DM355_TINT7] = 4,
509 [IRQ_DM355_SDIOINT0] = 7,
510 [IRQ_MBXINT] = 7,
511 [IRQ_MBRINT] = 7,
512 [IRQ_MMCINT] = 7,
513 [IRQ_DM355_MMCINT1] = 7,
514 [IRQ_DM355_PWMINT3] = 7,
515 [IRQ_DDRINT] = 7,
516 [IRQ_AEMIFINT] = 7,
517 [IRQ_DM355_SDIOINT1] = 4,
518 [IRQ_TINT0_TINT12] = 2, /* clockevent */
519 [IRQ_TINT0_TINT34] = 2, /* clocksource */
520 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
521 [IRQ_TINT1_TINT34] = 7, /* system tick */
522 [IRQ_PWMINT0] = 7,
523 [IRQ_PWMINT1] = 7,
524 [IRQ_PWMINT2] = 7,
525 [IRQ_I2C] = 3,
526 [IRQ_UARTINT0] = 3,
527 [IRQ_UARTINT1] = 3,
528 [IRQ_DM355_SPINT0_0] = 3,
529 [IRQ_DM355_SPINT0_1] = 3,
530 [IRQ_DM355_GPIO0] = 3,
531 [IRQ_DM355_GPIO1] = 7,
532 [IRQ_DM355_GPIO2] = 4,
533 [IRQ_DM355_GPIO3] = 4,
534 [IRQ_DM355_GPIO4] = 7,
535 [IRQ_DM355_GPIO5] = 7,
536 [IRQ_DM355_GPIO6] = 7,
537 [IRQ_DM355_GPIO7] = 7,
538 [IRQ_DM355_GPIO8] = 7,
539 [IRQ_DM355_GPIO9] = 7,
540 [IRQ_DM355_GPIOBNK0] = 7,
541 [IRQ_DM355_GPIOBNK1] = 7,
542 [IRQ_DM355_GPIOBNK2] = 7,
543 [IRQ_DM355_GPIOBNK3] = 7,
544 [IRQ_DM355_GPIOBNK4] = 7,
545 [IRQ_DM355_GPIOBNK5] = 7,
546 [IRQ_DM355_GPIOBNK6] = 7,
547 [IRQ_COMMTX] = 7,
548 [IRQ_COMMRX] = 7,
549 [IRQ_EMUINT] = 7,
550};
551
552/*----------------------------------------------------------------------*/
553
554static const s8 dma_chan_dm355_no_event[] = {
555 12, 13, 24, 56, 57,
556 58, 59, 60, 61, 62,
557 63,
558 -1
559};
560
561static struct edma_soc_info dm355_edma_info = {
562 .n_channel = 64,
563 .n_region = 4,
564 .n_slot = 128,
565 .n_tc = 2,
566 .noevent = dma_chan_dm355_no_event,
567};
568
569static struct resource edma_resources[] = {
570 {
571 .name = "edma_cc",
572 .start = 0x01c00000,
573 .end = 0x01c00000 + SZ_64K - 1,
574 .flags = IORESOURCE_MEM,
575 },
576 {
577 .name = "edma_tc0",
578 .start = 0x01c10000,
579 .end = 0x01c10000 + SZ_1K - 1,
580 .flags = IORESOURCE_MEM,
581 },
582 {
583 .name = "edma_tc1",
584 .start = 0x01c10400,
585 .end = 0x01c10400 + SZ_1K - 1,
586 .flags = IORESOURCE_MEM,
587 },
588 {
589 .start = IRQ_CCINT0,
590 .flags = IORESOURCE_IRQ,
591 },
592 {
593 .start = IRQ_CCERRINT,
594 .flags = IORESOURCE_IRQ,
595 },
596 /* not using (or muxing) TC*_ERR */
597};
598
599static struct platform_device dm355_edma_device = {
600 .name = "edma",
601 .id = -1,
602 .dev.platform_data = &dm355_edma_info,
603 .num_resources = ARRAY_SIZE(edma_resources),
604 .resource = edma_resources,
605};
606
607/*----------------------------------------------------------------------*/
608
609static struct map_desc dm355_io_desc[] = {
610 {
611 .virtual = IO_VIRT,
612 .pfn = __phys_to_pfn(IO_PHYS),
613 .length = IO_SIZE,
614 .type = MT_DEVICE
615 },
616 {
617 .virtual = SRAM_VIRT,
618 .pfn = __phys_to_pfn(0x00010000),
619 .length = SZ_32K,
620 /* MT_MEMORY_NONCACHED requires supersection alignment */
621 .type = MT_DEVICE,
622 },
623};
624
625/* Contents of JTAG ID register used to identify exact cpu type */
626static struct davinci_id dm355_ids[] = {
627 {
628 .variant = 0x0,
629 .part_no = 0xb73b,
630 .manufacturer = 0x00f,
631 .cpu_id = DAVINCI_CPU_ID_DM355,
632 .name = "dm355",
633 },
634};
635
636static void __iomem *dm355_psc_bases[] = {
637 IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE),
638};
639
640/*
641 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers
642 * T0_TOP: Timer 0, top : clocksource for generic timekeeping
643 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
644 * T1_TOP: Timer 1, top : <unused>
645 */
646struct davinci_timer_info dm355_timer_info = {
647 .timers = davinci_timer_instance,
648 .clockevent_id = T0_BOT,
649 .clocksource_id = T0_TOP,
650};
651
652static struct plat_serial8250_port dm355_serial_platform_data[] = {
653 {
654 .mapbase = DAVINCI_UART0_BASE,
655 .irq = IRQ_UARTINT0,
656 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
657 UPF_IOREMAP,
658 .iotype = UPIO_MEM,
659 .regshift = 2,
660 },
661 {
662 .mapbase = DAVINCI_UART1_BASE,
663 .irq = IRQ_UARTINT1,
664 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
665 UPF_IOREMAP,
666 .iotype = UPIO_MEM,
667 .regshift = 2,
668 },
669 {
670 .mapbase = DM355_UART2_BASE,
671 .irq = IRQ_DM355_UARTINT2,
672 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
673 UPF_IOREMAP,
674 .iotype = UPIO_MEM,
675 .regshift = 2,
676 },
677 {
678 .flags = 0
679 },
680};
681
682static struct platform_device dm355_serial_device = {
683 .name = "serial8250",
684 .id = PLAT8250_DEV_PLATFORM,
685 .dev = {
686 .platform_data = dm355_serial_platform_data,
687 },
688};
689
690static struct davinci_soc_info davinci_soc_info_dm355 = {
691 .io_desc = dm355_io_desc,
692 .io_desc_num = ARRAY_SIZE(dm355_io_desc),
693 .jtag_id_base = IO_ADDRESS(0x01c40028),
694 .ids = dm355_ids,
695 .ids_num = ARRAY_SIZE(dm355_ids),
696 .cpu_clks = dm355_clks,
697 .psc_bases = dm355_psc_bases,
698 .psc_bases_num = ARRAY_SIZE(dm355_psc_bases),
699 .pinmux_base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE),
700 .pinmux_pins = dm355_pins,
701 .pinmux_pins_num = ARRAY_SIZE(dm355_pins),
702 .intc_base = IO_ADDRESS(DAVINCI_ARM_INTC_BASE),
703 .intc_type = DAVINCI_INTC_TYPE_AINTC,
704 .intc_irq_prios = dm355_default_priorities,
705 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
706 .timer_info = &dm355_timer_info,
707 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
708 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
709 .gpio_num = 104,
710 .gpio_irq = IRQ_DM355_GPIOBNK0,
711 .serial_dev = &dm355_serial_device,
712 .sram_dma = 0x00010000,
713 .sram_len = SZ_32K,
714};
715
716void __init dm355_init(void)
717{
718 davinci_common_init(&davinci_soc_info_dm355);
719}
720
721static int __init dm355_init_devices(void)
722{
723 if (!cpu_is_davinci_dm355())
724 return 0;
725
726 davinci_cfg_reg(DM355_INT_EDMA_CC);
727 platform_device_register(&dm355_edma_device);
728 return 0;
729}
730postcore_initcall(dm355_init_devices);
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index d428ef192eac..fb5449b3c97b 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -11,7 +11,11 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/serial_8250.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/gpio.h>
17
18#include <asm/mach/map.h>
15 19
16#include <mach/dm644x.h> 20#include <mach/dm644x.h>
17#include <mach/clock.h> 21#include <mach/clock.h>
@@ -20,6 +24,9 @@
20#include <mach/irqs.h> 24#include <mach/irqs.h>
21#include <mach/psc.h> 25#include <mach/psc.h>
22#include <mach/mux.h> 26#include <mach/mux.h>
27#include <mach/time.h>
28#include <mach/serial.h>
29#include <mach/common.h>
23 30
24#include "clock.h" 31#include "clock.h"
25#include "mux.h" 32#include "mux.h"
@@ -312,7 +319,14 @@ struct davinci_clk dm644x_clks[] = {
312 CLK(NULL, NULL, NULL), 319 CLK(NULL, NULL, NULL),
313}; 320};
314 321
315#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE) 322static struct emac_platform_data dm644x_emac_pdata = {
323 .ctrl_reg_offset = DM644X_EMAC_CNTRL_OFFSET,
324 .ctrl_mod_reg_offset = DM644X_EMAC_CNTRL_MOD_OFFSET,
325 .ctrl_ram_offset = DM644X_EMAC_CNTRL_RAM_OFFSET,
326 .mdio_reg_offset = DM644X_EMAC_MDIO_OFFSET,
327 .ctrl_ram_size = DM644X_EMAC_CNTRL_RAM_SIZE,
328 .version = EMAC_VERSION_1,
329};
316 330
317static struct resource dm644x_emac_resources[] = { 331static struct resource dm644x_emac_resources[] = {
318 { 332 {
@@ -330,11 +344,15 @@ static struct resource dm644x_emac_resources[] = {
330static struct platform_device dm644x_emac_device = { 344static struct platform_device dm644x_emac_device = {
331 .name = "davinci_emac", 345 .name = "davinci_emac",
332 .id = 1, 346 .id = 1,
347 .dev = {
348 .platform_data = &dm644x_emac_pdata,
349 },
333 .num_resources = ARRAY_SIZE(dm644x_emac_resources), 350 .num_resources = ARRAY_SIZE(dm644x_emac_resources),
334 .resource = dm644x_emac_resources, 351 .resource = dm644x_emac_resources,
335}; 352};
336 353
337#endif 354#define PINMUX0 0x00
355#define PINMUX1 0x04
338 356
339/* 357/*
340 * Device specific mux setup 358 * Device specific mux setup
@@ -343,6 +361,7 @@ static struct platform_device dm644x_emac_device = {
343 * reg offset mask mode 361 * reg offset mask mode
344 */ 362 */
345static const struct mux_config dm644x_pins[] = { 363static const struct mux_config dm644x_pins[] = {
364#ifdef CONFIG_DAVINCI_MUX
346MUX_CFG(DM644X, HDIREN, 0, 16, 1, 1, true) 365MUX_CFG(DM644X, HDIREN, 0, 16, 1, 1, true)
347MUX_CFG(DM644X, ATAEN, 0, 17, 1, 1, true) 366MUX_CFG(DM644X, ATAEN, 0, 17, 1, 1, true)
348MUX_CFG(DM644X, ATAEN_DISABLE, 0, 17, 1, 0, true) 367MUX_CFG(DM644X, ATAEN_DISABLE, 0, 17, 1, 0, true)
@@ -383,8 +402,76 @@ MUX_CFG(DM644X, RGB666, 0, 22, 1, 1, true)
383 402
384MUX_CFG(DM644X, LOEEN, 0, 24, 1, 1, true) 403MUX_CFG(DM644X, LOEEN, 0, 24, 1, 1, true)
385MUX_CFG(DM644X, LFLDEN, 0, 25, 1, 1, false) 404MUX_CFG(DM644X, LFLDEN, 0, 25, 1, 1, false)
405#endif
386}; 406};
387 407
408/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
409static u8 dm644x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
410 [IRQ_VDINT0] = 2,
411 [IRQ_VDINT1] = 6,
412 [IRQ_VDINT2] = 6,
413 [IRQ_HISTINT] = 6,
414 [IRQ_H3AINT] = 6,
415 [IRQ_PRVUINT] = 6,
416 [IRQ_RSZINT] = 6,
417 [7] = 7,
418 [IRQ_VENCINT] = 6,
419 [IRQ_ASQINT] = 6,
420 [IRQ_IMXINT] = 6,
421 [IRQ_VLCDINT] = 6,
422 [IRQ_USBINT] = 4,
423 [IRQ_EMACINT] = 4,
424 [14] = 7,
425 [15] = 7,
426 [IRQ_CCINT0] = 5, /* dma */
427 [IRQ_CCERRINT] = 5, /* dma */
428 [IRQ_TCERRINT0] = 5, /* dma */
429 [IRQ_TCERRINT] = 5, /* dma */
430 [IRQ_PSCIN] = 7,
431 [21] = 7,
432 [IRQ_IDE] = 4,
433 [23] = 7,
434 [IRQ_MBXINT] = 7,
435 [IRQ_MBRINT] = 7,
436 [IRQ_MMCINT] = 7,
437 [IRQ_SDIOINT] = 7,
438 [28] = 7,
439 [IRQ_DDRINT] = 7,
440 [IRQ_AEMIFINT] = 7,
441 [IRQ_VLQINT] = 4,
442 [IRQ_TINT0_TINT12] = 2, /* clockevent */
443 [IRQ_TINT0_TINT34] = 2, /* clocksource */
444 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
445 [IRQ_TINT1_TINT34] = 7, /* system tick */
446 [IRQ_PWMINT0] = 7,
447 [IRQ_PWMINT1] = 7,
448 [IRQ_PWMINT2] = 7,
449 [IRQ_I2C] = 3,
450 [IRQ_UARTINT0] = 3,
451 [IRQ_UARTINT1] = 3,
452 [IRQ_UARTINT2] = 3,
453 [IRQ_SPINT0] = 3,
454 [IRQ_SPINT1] = 3,
455 [45] = 7,
456 [IRQ_DSP2ARM0] = 4,
457 [IRQ_DSP2ARM1] = 4,
458 [IRQ_GPIO0] = 7,
459 [IRQ_GPIO1] = 7,
460 [IRQ_GPIO2] = 7,
461 [IRQ_GPIO3] = 7,
462 [IRQ_GPIO4] = 7,
463 [IRQ_GPIO5] = 7,
464 [IRQ_GPIO6] = 7,
465 [IRQ_GPIO7] = 7,
466 [IRQ_GPIOBNK0] = 7,
467 [IRQ_GPIOBNK1] = 7,
468 [IRQ_GPIOBNK2] = 7,
469 [IRQ_GPIOBNK3] = 7,
470 [IRQ_GPIOBNK4] = 7,
471 [IRQ_COMMTX] = 7,
472 [IRQ_COMMRX] = 7,
473 [IRQ_EMUINT] = 7,
474};
388 475
389/*----------------------------------------------------------------------*/ 476/*----------------------------------------------------------------------*/
390 477
@@ -444,10 +531,118 @@ static struct platform_device dm644x_edma_device = {
444}; 531};
445 532
446/*----------------------------------------------------------------------*/ 533/*----------------------------------------------------------------------*/
534
535static struct map_desc dm644x_io_desc[] = {
536 {
537 .virtual = IO_VIRT,
538 .pfn = __phys_to_pfn(IO_PHYS),
539 .length = IO_SIZE,
540 .type = MT_DEVICE
541 },
542 {
543 .virtual = SRAM_VIRT,
544 .pfn = __phys_to_pfn(0x00008000),
545 .length = SZ_16K,
546 /* MT_MEMORY_NONCACHED requires supersection alignment */
547 .type = MT_DEVICE,
548 },
549};
550
551/* Contents of JTAG ID register used to identify exact cpu type */
552static struct davinci_id dm644x_ids[] = {
553 {
554 .variant = 0x0,
555 .part_no = 0xb700,
556 .manufacturer = 0x017,
557 .cpu_id = DAVINCI_CPU_ID_DM6446,
558 .name = "dm6446",
559 },
560};
561
562static void __iomem *dm644x_psc_bases[] = {
563 IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE),
564};
565
566/*
567 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers
568 * T0_TOP: Timer 0, top : clocksource for generic timekeeping
569 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
570 * T1_TOP: Timer 1, top : <unused>
571 */
572struct davinci_timer_info dm644x_timer_info = {
573 .timers = davinci_timer_instance,
574 .clockevent_id = T0_BOT,
575 .clocksource_id = T0_TOP,
576};
577
578static struct plat_serial8250_port dm644x_serial_platform_data[] = {
579 {
580 .mapbase = DAVINCI_UART0_BASE,
581 .irq = IRQ_UARTINT0,
582 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
583 UPF_IOREMAP,
584 .iotype = UPIO_MEM,
585 .regshift = 2,
586 },
587 {
588 .mapbase = DAVINCI_UART1_BASE,
589 .irq = IRQ_UARTINT1,
590 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
591 UPF_IOREMAP,
592 .iotype = UPIO_MEM,
593 .regshift = 2,
594 },
595 {
596 .mapbase = DAVINCI_UART2_BASE,
597 .irq = IRQ_UARTINT2,
598 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
599 UPF_IOREMAP,
600 .iotype = UPIO_MEM,
601 .regshift = 2,
602 },
603 {
604 .flags = 0
605 },
606};
607
608static struct platform_device dm644x_serial_device = {
609 .name = "serial8250",
610 .id = PLAT8250_DEV_PLATFORM,
611 .dev = {
612 .platform_data = dm644x_serial_platform_data,
613 },
614};
615
616static struct davinci_soc_info davinci_soc_info_dm644x = {
617 .io_desc = dm644x_io_desc,
618 .io_desc_num = ARRAY_SIZE(dm644x_io_desc),
619 .jtag_id_base = IO_ADDRESS(0x01c40028),
620 .ids = dm644x_ids,
621 .ids_num = ARRAY_SIZE(dm644x_ids),
622 .cpu_clks = dm644x_clks,
623 .psc_bases = dm644x_psc_bases,
624 .psc_bases_num = ARRAY_SIZE(dm644x_psc_bases),
625 .pinmux_base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE),
626 .pinmux_pins = dm644x_pins,
627 .pinmux_pins_num = ARRAY_SIZE(dm644x_pins),
628 .intc_base = IO_ADDRESS(DAVINCI_ARM_INTC_BASE),
629 .intc_type = DAVINCI_INTC_TYPE_AINTC,
630 .intc_irq_prios = dm644x_default_priorities,
631 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
632 .timer_info = &dm644x_timer_info,
633 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
634 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
635 .gpio_num = 71,
636 .gpio_irq = IRQ_GPIOBNK0,
637 .serial_dev = &dm644x_serial_device,
638 .emac_pdata = &dm644x_emac_pdata,
639 .sram_dma = 0x00008000,
640 .sram_len = SZ_16K,
641};
642
447void __init dm644x_init(void) 643void __init dm644x_init(void)
448{ 644{
449 davinci_clk_init(dm644x_clks); 645 davinci_common_init(&davinci_soc_info_dm644x);
450 davinci_mux_register(dm644x_pins, ARRAY_SIZE(dm644x_pins));
451} 646}
452 647
453static int __init dm644x_init_devices(void) 648static int __init dm644x_init_devices(void)
@@ -456,6 +651,7 @@ static int __init dm644x_init_devices(void)
456 return 0; 651 return 0;
457 652
458 platform_device_register(&dm644x_edma_device); 653 platform_device_register(&dm644x_edma_device);
654 platform_device_register(&dm644x_emac_device);
459 return 0; 655 return 0;
460} 656}
461postcore_initcall(dm644x_init_devices); 657postcore_initcall(dm644x_init_devices);
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
new file mode 100644
index 000000000000..334f0711e0f5
--- /dev/null
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -0,0 +1,636 @@
1/*
2 * TI DaVinci DM644x chip specific setup
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/clk.h>
14#include <linux/serial_8250.h>
15#include <linux/platform_device.h>
16#include <linux/gpio.h>
17
18#include <asm/mach/map.h>
19
20#include <mach/dm646x.h>
21#include <mach/clock.h>
22#include <mach/cputype.h>
23#include <mach/edma.h>
24#include <mach/irqs.h>
25#include <mach/psc.h>
26#include <mach/mux.h>
27#include <mach/time.h>
28#include <mach/serial.h>
29#include <mach/common.h>
30
31#include "clock.h"
32#include "mux.h"
33
34/*
35 * Device specific clocks
36 */
37#define DM646X_REF_FREQ 27000000
38#define DM646X_AUX_FREQ 24000000
39
40static struct pll_data pll1_data = {
41 .num = 1,
42 .phys_base = DAVINCI_PLL1_BASE,
43};
44
45static struct pll_data pll2_data = {
46 .num = 2,
47 .phys_base = DAVINCI_PLL2_BASE,
48};
49
50static struct clk ref_clk = {
51 .name = "ref_clk",
52 .rate = DM646X_REF_FREQ,
53};
54
55static struct clk aux_clkin = {
56 .name = "aux_clkin",
57 .rate = DM646X_AUX_FREQ,
58};
59
60static struct clk pll1_clk = {
61 .name = "pll1",
62 .parent = &ref_clk,
63 .pll_data = &pll1_data,
64 .flags = CLK_PLL,
65};
66
67static struct clk pll1_sysclk1 = {
68 .name = "pll1_sysclk1",
69 .parent = &pll1_clk,
70 .flags = CLK_PLL,
71 .div_reg = PLLDIV1,
72};
73
74static struct clk pll1_sysclk2 = {
75 .name = "pll1_sysclk2",
76 .parent = &pll1_clk,
77 .flags = CLK_PLL,
78 .div_reg = PLLDIV2,
79};
80
81static struct clk pll1_sysclk3 = {
82 .name = "pll1_sysclk3",
83 .parent = &pll1_clk,
84 .flags = CLK_PLL,
85 .div_reg = PLLDIV3,
86};
87
88static struct clk pll1_sysclk4 = {
89 .name = "pll1_sysclk4",
90 .parent = &pll1_clk,
91 .flags = CLK_PLL,
92 .div_reg = PLLDIV4,
93};
94
95static struct clk pll1_sysclk5 = {
96 .name = "pll1_sysclk5",
97 .parent = &pll1_clk,
98 .flags = CLK_PLL,
99 .div_reg = PLLDIV5,
100};
101
102static struct clk pll1_sysclk6 = {
103 .name = "pll1_sysclk6",
104 .parent = &pll1_clk,
105 .flags = CLK_PLL,
106 .div_reg = PLLDIV6,
107};
108
109static struct clk pll1_sysclk8 = {
110 .name = "pll1_sysclk8",
111 .parent = &pll1_clk,
112 .flags = CLK_PLL,
113 .div_reg = PLLDIV8,
114};
115
116static struct clk pll1_sysclk9 = {
117 .name = "pll1_sysclk9",
118 .parent = &pll1_clk,
119 .flags = CLK_PLL,
120 .div_reg = PLLDIV9,
121};
122
123static struct clk pll1_sysclkbp = {
124 .name = "pll1_sysclkbp",
125 .parent = &pll1_clk,
126 .flags = CLK_PLL | PRE_PLL,
127 .div_reg = BPDIV,
128};
129
130static struct clk pll1_aux_clk = {
131 .name = "pll1_aux_clk",
132 .parent = &pll1_clk,
133 .flags = CLK_PLL | PRE_PLL,
134};
135
136static struct clk pll2_clk = {
137 .name = "pll2_clk",
138 .parent = &ref_clk,
139 .pll_data = &pll2_data,
140 .flags = CLK_PLL,
141};
142
143static struct clk pll2_sysclk1 = {
144 .name = "pll2_sysclk1",
145 .parent = &pll2_clk,
146 .flags = CLK_PLL,
147 .div_reg = PLLDIV1,
148};
149
150static struct clk dsp_clk = {
151 .name = "dsp",
152 .parent = &pll1_sysclk1,
153 .lpsc = DM646X_LPSC_C64X_CPU,
154 .flags = PSC_DSP,
155 .usecount = 1, /* REVISIT how to disable? */
156};
157
158static struct clk arm_clk = {
159 .name = "arm",
160 .parent = &pll1_sysclk2,
161 .lpsc = DM646X_LPSC_ARM,
162 .flags = ALWAYS_ENABLED,
163};
164
165static struct clk uart0_clk = {
166 .name = "uart0",
167 .parent = &aux_clkin,
168 .lpsc = DM646X_LPSC_UART0,
169};
170
171static struct clk uart1_clk = {
172 .name = "uart1",
173 .parent = &aux_clkin,
174 .lpsc = DM646X_LPSC_UART1,
175};
176
177static struct clk uart2_clk = {
178 .name = "uart2",
179 .parent = &aux_clkin,
180 .lpsc = DM646X_LPSC_UART2,
181};
182
183static struct clk i2c_clk = {
184 .name = "I2CCLK",
185 .parent = &pll1_sysclk3,
186 .lpsc = DM646X_LPSC_I2C,
187};
188
189static struct clk gpio_clk = {
190 .name = "gpio",
191 .parent = &pll1_sysclk3,
192 .lpsc = DM646X_LPSC_GPIO,
193};
194
195static struct clk aemif_clk = {
196 .name = "aemif",
197 .parent = &pll1_sysclk3,
198 .lpsc = DM646X_LPSC_AEMIF,
199 .flags = ALWAYS_ENABLED,
200};
201
202static struct clk emac_clk = {
203 .name = "emac",
204 .parent = &pll1_sysclk3,
205 .lpsc = DM646X_LPSC_EMAC,
206};
207
208static struct clk pwm0_clk = {
209 .name = "pwm0",
210 .parent = &pll1_sysclk3,
211 .lpsc = DM646X_LPSC_PWM0,
212 .usecount = 1, /* REVIST: disabling hangs system */
213};
214
215static struct clk pwm1_clk = {
216 .name = "pwm1",
217 .parent = &pll1_sysclk3,
218 .lpsc = DM646X_LPSC_PWM1,
219 .usecount = 1, /* REVIST: disabling hangs system */
220};
221
222static struct clk timer0_clk = {
223 .name = "timer0",
224 .parent = &pll1_sysclk3,
225 .lpsc = DM646X_LPSC_TIMER0,
226};
227
228static struct clk timer1_clk = {
229 .name = "timer1",
230 .parent = &pll1_sysclk3,
231 .lpsc = DM646X_LPSC_TIMER1,
232};
233
234static struct clk timer2_clk = {
235 .name = "timer2",
236 .parent = &pll1_sysclk3,
237 .flags = ALWAYS_ENABLED, /* no LPSC, always enabled; c.f. spruep9a */
238};
239
240static struct clk vpif0_clk = {
241 .name = "vpif0",
242 .parent = &ref_clk,
243 .lpsc = DM646X_LPSC_VPSSMSTR,
244 .flags = ALWAYS_ENABLED,
245};
246
247static struct clk vpif1_clk = {
248 .name = "vpif1",
249 .parent = &ref_clk,
250 .lpsc = DM646X_LPSC_VPSSSLV,
251 .flags = ALWAYS_ENABLED,
252};
253
254struct davinci_clk dm646x_clks[] = {
255 CLK(NULL, "ref", &ref_clk),
256 CLK(NULL, "aux", &aux_clkin),
257 CLK(NULL, "pll1", &pll1_clk),
258 CLK(NULL, "pll1_sysclk", &pll1_sysclk1),
259 CLK(NULL, "pll1_sysclk", &pll1_sysclk2),
260 CLK(NULL, "pll1_sysclk", &pll1_sysclk3),
261 CLK(NULL, "pll1_sysclk", &pll1_sysclk4),
262 CLK(NULL, "pll1_sysclk", &pll1_sysclk5),
263 CLK(NULL, "pll1_sysclk", &pll1_sysclk6),
264 CLK(NULL, "pll1_sysclk", &pll1_sysclk8),
265 CLK(NULL, "pll1_sysclk", &pll1_sysclk9),
266 CLK(NULL, "pll1_sysclk", &pll1_sysclkbp),
267 CLK(NULL, "pll1_aux", &pll1_aux_clk),
268 CLK(NULL, "pll2", &pll2_clk),
269 CLK(NULL, "pll2_sysclk1", &pll2_sysclk1),
270 CLK(NULL, "dsp", &dsp_clk),
271 CLK(NULL, "arm", &arm_clk),
272 CLK(NULL, "uart0", &uart0_clk),
273 CLK(NULL, "uart1", &uart1_clk),
274 CLK(NULL, "uart2", &uart2_clk),
275 CLK("i2c_davinci.1", NULL, &i2c_clk),
276 CLK(NULL, "gpio", &gpio_clk),
277 CLK(NULL, "aemif", &aemif_clk),
278 CLK("davinci_emac.1", NULL, &emac_clk),
279 CLK(NULL, "pwm0", &pwm0_clk),
280 CLK(NULL, "pwm1", &pwm1_clk),
281 CLK(NULL, "timer0", &timer0_clk),
282 CLK(NULL, "timer1", &timer1_clk),
283 CLK("watchdog", NULL, &timer2_clk),
284 CLK(NULL, "vpif0", &vpif0_clk),
285 CLK(NULL, "vpif1", &vpif1_clk),
286 CLK(NULL, NULL, NULL),
287};
288
289static struct emac_platform_data dm646x_emac_pdata = {
290 .ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET,
291 .ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET,
292 .ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET,
293 .mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET,
294 .ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE,
295 .version = EMAC_VERSION_2,
296};
297
298static struct resource dm646x_emac_resources[] = {
299 {
300 .start = DM646X_EMAC_BASE,
301 .end = DM646X_EMAC_BASE + 0x47ff,
302 .flags = IORESOURCE_MEM,
303 },
304 {
305 .start = IRQ_DM646X_EMACRXTHINT,
306 .end = IRQ_DM646X_EMACRXTHINT,
307 .flags = IORESOURCE_IRQ,
308 },
309 {
310 .start = IRQ_DM646X_EMACRXINT,
311 .end = IRQ_DM646X_EMACRXINT,
312 .flags = IORESOURCE_IRQ,
313 },
314 {
315 .start = IRQ_DM646X_EMACTXINT,
316 .end = IRQ_DM646X_EMACTXINT,
317 .flags = IORESOURCE_IRQ,
318 },
319 {
320 .start = IRQ_DM646X_EMACMISCINT,
321 .end = IRQ_DM646X_EMACMISCINT,
322 .flags = IORESOURCE_IRQ,
323 },
324};
325
326static struct platform_device dm646x_emac_device = {
327 .name = "davinci_emac",
328 .id = 1,
329 .dev = {
330 .platform_data = &dm646x_emac_pdata,
331 },
332 .num_resources = ARRAY_SIZE(dm646x_emac_resources),
333 .resource = dm646x_emac_resources,
334};
335
336#define PINMUX0 0x00
337#define PINMUX1 0x04
338
339/*
340 * Device specific mux setup
341 *
342 * soc description mux mode mode mux dbg
343 * reg offset mask mode
344 */
345static const struct mux_config dm646x_pins[] = {
346#ifdef CONFIG_DAVINCI_MUX
347MUX_CFG(DM646X, ATAEN, 0, 0, 1, 1, true)
348
349MUX_CFG(DM646X, AUDCK1, 0, 29, 1, 0, false)
350
351MUX_CFG(DM646X, AUDCK0, 0, 28, 1, 0, false)
352
353MUX_CFG(DM646X, CRGMUX, 0, 24, 7, 5, true)
354
355MUX_CFG(DM646X, STSOMUX_DISABLE, 0, 22, 3, 0, true)
356
357MUX_CFG(DM646X, STSIMUX_DISABLE, 0, 20, 3, 0, true)
358
359MUX_CFG(DM646X, PTSOMUX_DISABLE, 0, 18, 3, 0, true)
360
361MUX_CFG(DM646X, PTSIMUX_DISABLE, 0, 16, 3, 0, true)
362
363MUX_CFG(DM646X, STSOMUX, 0, 22, 3, 2, true)
364
365MUX_CFG(DM646X, STSIMUX, 0, 20, 3, 2, true)
366
367MUX_CFG(DM646X, PTSOMUX_PARALLEL, 0, 18, 3, 2, true)
368
369MUX_CFG(DM646X, PTSIMUX_PARALLEL, 0, 16, 3, 2, true)
370
371MUX_CFG(DM646X, PTSOMUX_SERIAL, 0, 18, 3, 3, true)
372
373MUX_CFG(DM646X, PTSIMUX_SERIAL, 0, 16, 3, 3, true)
374#endif
375};
376
377static u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
378 [IRQ_DM646X_VP_VERTINT0] = 7,
379 [IRQ_DM646X_VP_VERTINT1] = 7,
380 [IRQ_DM646X_VP_VERTINT2] = 7,
381 [IRQ_DM646X_VP_VERTINT3] = 7,
382 [IRQ_DM646X_VP_ERRINT] = 7,
383 [IRQ_DM646X_RESERVED_1] = 7,
384 [IRQ_DM646X_RESERVED_2] = 7,
385 [IRQ_DM646X_WDINT] = 7,
386 [IRQ_DM646X_CRGENINT0] = 7,
387 [IRQ_DM646X_CRGENINT1] = 7,
388 [IRQ_DM646X_TSIFINT0] = 7,
389 [IRQ_DM646X_TSIFINT1] = 7,
390 [IRQ_DM646X_VDCEINT] = 7,
391 [IRQ_DM646X_USBINT] = 7,
392 [IRQ_DM646X_USBDMAINT] = 7,
393 [IRQ_DM646X_PCIINT] = 7,
394 [IRQ_CCINT0] = 7, /* dma */
395 [IRQ_CCERRINT] = 7, /* dma */
396 [IRQ_TCERRINT0] = 7, /* dma */
397 [IRQ_TCERRINT] = 7, /* dma */
398 [IRQ_DM646X_TCERRINT2] = 7,
399 [IRQ_DM646X_TCERRINT3] = 7,
400 [IRQ_DM646X_IDE] = 7,
401 [IRQ_DM646X_HPIINT] = 7,
402 [IRQ_DM646X_EMACRXTHINT] = 7,
403 [IRQ_DM646X_EMACRXINT] = 7,
404 [IRQ_DM646X_EMACTXINT] = 7,
405 [IRQ_DM646X_EMACMISCINT] = 7,
406 [IRQ_DM646X_MCASP0TXINT] = 7,
407 [IRQ_DM646X_MCASP0RXINT] = 7,
408 [IRQ_AEMIFINT] = 7,
409 [IRQ_DM646X_RESERVED_3] = 7,
410 [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */
411 [IRQ_TINT0_TINT34] = 7, /* clocksource */
412 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
413 [IRQ_TINT1_TINT34] = 7, /* system tick */
414 [IRQ_PWMINT0] = 7,
415 [IRQ_PWMINT1] = 7,
416 [IRQ_DM646X_VLQINT] = 7,
417 [IRQ_I2C] = 7,
418 [IRQ_UARTINT0] = 7,
419 [IRQ_UARTINT1] = 7,
420 [IRQ_DM646X_UARTINT2] = 7,
421 [IRQ_DM646X_SPINT0] = 7,
422 [IRQ_DM646X_SPINT1] = 7,
423 [IRQ_DM646X_DSP2ARMINT] = 7,
424 [IRQ_DM646X_RESERVED_4] = 7,
425 [IRQ_DM646X_PSCINT] = 7,
426 [IRQ_DM646X_GPIO0] = 7,
427 [IRQ_DM646X_GPIO1] = 7,
428 [IRQ_DM646X_GPIO2] = 7,
429 [IRQ_DM646X_GPIO3] = 7,
430 [IRQ_DM646X_GPIO4] = 7,
431 [IRQ_DM646X_GPIO5] = 7,
432 [IRQ_DM646X_GPIO6] = 7,
433 [IRQ_DM646X_GPIO7] = 7,
434 [IRQ_DM646X_GPIOBNK0] = 7,
435 [IRQ_DM646X_GPIOBNK1] = 7,
436 [IRQ_DM646X_GPIOBNK2] = 7,
437 [IRQ_DM646X_DDRINT] = 7,
438 [IRQ_DM646X_AEMIFINT] = 7,
439 [IRQ_COMMTX] = 7,
440 [IRQ_COMMRX] = 7,
441 [IRQ_EMUINT] = 7,
442};
443
444/*----------------------------------------------------------------------*/
445
446static const s8 dma_chan_dm646x_no_event[] = {
447 0, 1, 2, 3, 13,
448 14, 15, 24, 25, 26,
449 27, 30, 31, 54, 55,
450 56,
451 -1
452};
453
454static struct edma_soc_info dm646x_edma_info = {
455 .n_channel = 64,
456 .n_region = 6, /* 0-1, 4-7 */
457 .n_slot = 512,
458 .n_tc = 4,
459 .noevent = dma_chan_dm646x_no_event,
460};
461
462static struct resource edma_resources[] = {
463 {
464 .name = "edma_cc",
465 .start = 0x01c00000,
466 .end = 0x01c00000 + SZ_64K - 1,
467 .flags = IORESOURCE_MEM,
468 },
469 {
470 .name = "edma_tc0",
471 .start = 0x01c10000,
472 .end = 0x01c10000 + SZ_1K - 1,
473 .flags = IORESOURCE_MEM,
474 },
475 {
476 .name = "edma_tc1",
477 .start = 0x01c10400,
478 .end = 0x01c10400 + SZ_1K - 1,
479 .flags = IORESOURCE_MEM,
480 },
481 {
482 .name = "edma_tc2",
483 .start = 0x01c10800,
484 .end = 0x01c10800 + SZ_1K - 1,
485 .flags = IORESOURCE_MEM,
486 },
487 {
488 .name = "edma_tc3",
489 .start = 0x01c10c00,
490 .end = 0x01c10c00 + SZ_1K - 1,
491 .flags = IORESOURCE_MEM,
492 },
493 {
494 .start = IRQ_CCINT0,
495 .flags = IORESOURCE_IRQ,
496 },
497 {
498 .start = IRQ_CCERRINT,
499 .flags = IORESOURCE_IRQ,
500 },
501 /* not using TC*_ERR */
502};
503
504static struct platform_device dm646x_edma_device = {
505 .name = "edma",
506 .id = -1,
507 .dev.platform_data = &dm646x_edma_info,
508 .num_resources = ARRAY_SIZE(edma_resources),
509 .resource = edma_resources,
510};
511
512/*----------------------------------------------------------------------*/
513
514static struct map_desc dm646x_io_desc[] = {
515 {
516 .virtual = IO_VIRT,
517 .pfn = __phys_to_pfn(IO_PHYS),
518 .length = IO_SIZE,
519 .type = MT_DEVICE
520 },
521 {
522 .virtual = SRAM_VIRT,
523 .pfn = __phys_to_pfn(0x00010000),
524 .length = SZ_32K,
525 /* MT_MEMORY_NONCACHED requires supersection alignment */
526 .type = MT_DEVICE,
527 },
528};
529
530/* Contents of JTAG ID register used to identify exact cpu type */
531static struct davinci_id dm646x_ids[] = {
532 {
533 .variant = 0x0,
534 .part_no = 0xb770,
535 .manufacturer = 0x017,
536 .cpu_id = DAVINCI_CPU_ID_DM6467,
537 .name = "dm6467",
538 },
539};
540
541static void __iomem *dm646x_psc_bases[] = {
542 IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE),
543};
544
545/*
546 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers
547 * T0_TOP: Timer 0, top : clocksource for generic timekeeping
548 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
549 * T1_TOP: Timer 1, top : <unused>
550 */
551struct davinci_timer_info dm646x_timer_info = {
552 .timers = davinci_timer_instance,
553 .clockevent_id = T0_BOT,
554 .clocksource_id = T0_TOP,
555};
556
557static struct plat_serial8250_port dm646x_serial_platform_data[] = {
558 {
559 .mapbase = DAVINCI_UART0_BASE,
560 .irq = IRQ_UARTINT0,
561 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
562 UPF_IOREMAP,
563 .iotype = UPIO_MEM32,
564 .regshift = 2,
565 },
566 {
567 .mapbase = DAVINCI_UART1_BASE,
568 .irq = IRQ_UARTINT1,
569 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
570 UPF_IOREMAP,
571 .iotype = UPIO_MEM32,
572 .regshift = 2,
573 },
574 {
575 .mapbase = DAVINCI_UART2_BASE,
576 .irq = IRQ_DM646X_UARTINT2,
577 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
578 UPF_IOREMAP,
579 .iotype = UPIO_MEM32,
580 .regshift = 2,
581 },
582 {
583 .flags = 0
584 },
585};
586
587static struct platform_device dm646x_serial_device = {
588 .name = "serial8250",
589 .id = PLAT8250_DEV_PLATFORM,
590 .dev = {
591 .platform_data = dm646x_serial_platform_data,
592 },
593};
594
595static struct davinci_soc_info davinci_soc_info_dm646x = {
596 .io_desc = dm646x_io_desc,
597 .io_desc_num = ARRAY_SIZE(dm646x_io_desc),
598 .jtag_id_base = IO_ADDRESS(0x01c40028),
599 .ids = dm646x_ids,
600 .ids_num = ARRAY_SIZE(dm646x_ids),
601 .cpu_clks = dm646x_clks,
602 .psc_bases = dm646x_psc_bases,
603 .psc_bases_num = ARRAY_SIZE(dm646x_psc_bases),
604 .pinmux_base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE),
605 .pinmux_pins = dm646x_pins,
606 .pinmux_pins_num = ARRAY_SIZE(dm646x_pins),
607 .intc_base = IO_ADDRESS(DAVINCI_ARM_INTC_BASE),
608 .intc_type = DAVINCI_INTC_TYPE_AINTC,
609 .intc_irq_prios = dm646x_default_priorities,
610 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
611 .timer_info = &dm646x_timer_info,
612 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
613 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
614 .gpio_num = 43, /* Only 33 usable */
615 .gpio_irq = IRQ_DM646X_GPIOBNK0,
616 .serial_dev = &dm646x_serial_device,
617 .emac_pdata = &dm646x_emac_pdata,
618 .sram_dma = 0x10010000,
619 .sram_len = SZ_32K,
620};
621
622void __init dm646x_init(void)
623{
624 davinci_common_init(&davinci_soc_info_dm646x);
625}
626
627static int __init dm646x_init_devices(void)
628{
629 if (!cpu_is_davinci_dm646x())
630 return 0;
631
632 platform_device_register(&dm646x_edma_device);
633 platform_device_register(&dm646x_emac_device);
634 return 0;
635}
636postcore_initcall(dm646x_init_devices);
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c
index 1aba41c6351e..1b6532159c58 100644
--- a/arch/arm/mach-davinci/gpio.c
+++ b/arch/arm/mach-davinci/gpio.c
@@ -23,6 +23,7 @@
23#include <mach/cputype.h> 23#include <mach/cputype.h>
24#include <mach/irqs.h> 24#include <mach/irqs.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/common.h>
26#include <mach/gpio.h> 27#include <mach/gpio.h>
27 28
28#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
@@ -37,14 +38,13 @@ struct davinci_gpio {
37 38
38static struct davinci_gpio chips[DIV_ROUND_UP(DAVINCI_N_GPIO, 32)]; 39static struct davinci_gpio chips[DIV_ROUND_UP(DAVINCI_N_GPIO, 32)];
39 40
40static unsigned __initdata ngpio;
41
42/* create a non-inlined version */ 41/* create a non-inlined version */
43static struct gpio_controller __iomem * __init gpio2controller(unsigned gpio) 42static struct gpio_controller __iomem * __init gpio2controller(unsigned gpio)
44{ 43{
45 return __gpio_to_controller(gpio); 44 return __gpio_to_controller(gpio);
46} 45}
47 46
47static int __init davinci_gpio_irq_setup(void);
48 48
49/*--------------------------------------------------------------------------*/ 49/*--------------------------------------------------------------------------*/
50 50
@@ -115,23 +115,16 @@ davinci_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
115static int __init davinci_gpio_setup(void) 115static int __init davinci_gpio_setup(void)
116{ 116{
117 int i, base; 117 int i, base;
118 unsigned ngpio;
119 struct davinci_soc_info *soc_info = &davinci_soc_info;
118 120
119 /* The gpio banks conceptually expose a segmented bitmap, 121 /*
122 * The gpio banks conceptually expose a segmented bitmap,
120 * and "ngpio" is one more than the largest zero-based 123 * and "ngpio" is one more than the largest zero-based
121 * bit index that's valid. 124 * bit index that's valid.
122 */ 125 */
123 if (cpu_is_davinci_dm355()) { /* or dm335() */ 126 ngpio = soc_info->gpio_num;
124 ngpio = 104; 127 if (ngpio == 0) {
125 } else if (cpu_is_davinci_dm644x()) { /* or dm337() */
126 ngpio = 71;
127 } else if (cpu_is_davinci_dm646x()) {
128 /* NOTE: each bank has several "reserved" bits,
129 * unusable as GPIOs. Only 33 of the GPIO numbers
130 * are usable, and we're not rejecting the others.
131 */
132 ngpio = 43;
133 } else {
134 /* if cpu_is_davinci_dm643x() ngpio = 111 */
135 pr_err("GPIO setup: how many GPIOs?\n"); 128 pr_err("GPIO setup: how many GPIOs?\n");
136 return -EINVAL; 129 return -EINVAL;
137 } 130 }
@@ -157,6 +150,7 @@ static int __init davinci_gpio_setup(void)
157 gpiochip_add(&chips[i].chip); 150 gpiochip_add(&chips[i].chip);
158 } 151 }
159 152
153 davinci_gpio_irq_setup();
160 return 0; 154 return 0;
161} 155}
162pure_initcall(davinci_gpio_setup); 156pure_initcall(davinci_gpio_setup);
@@ -187,10 +181,15 @@ static void gpio_irq_enable(unsigned irq)
187{ 181{
188 struct gpio_controller *__iomem g = get_irq_chip_data(irq); 182 struct gpio_controller *__iomem g = get_irq_chip_data(irq);
189 u32 mask = __gpio_mask(irq_to_gpio(irq)); 183 u32 mask = __gpio_mask(irq_to_gpio(irq));
184 unsigned status = irq_desc[irq].status;
185
186 status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING;
187 if (!status)
188 status = IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING;
190 189
191 if (irq_desc[irq].status & IRQ_TYPE_EDGE_FALLING) 190 if (status & IRQ_TYPE_EDGE_FALLING)
192 __raw_writel(mask, &g->set_falling); 191 __raw_writel(mask, &g->set_falling);
193 if (irq_desc[irq].status & IRQ_TYPE_EDGE_RISING) 192 if (status & IRQ_TYPE_EDGE_RISING)
194 __raw_writel(mask, &g->set_rising); 193 __raw_writel(mask, &g->set_rising);
195} 194}
196 195
@@ -205,10 +204,13 @@ static int gpio_irq_type(unsigned irq, unsigned trigger)
205 irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; 204 irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
206 irq_desc[irq].status |= trigger; 205 irq_desc[irq].status |= trigger;
207 206
208 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING) 207 /* don't enable the IRQ if it's currently disabled */
209 ? &g->set_falling : &g->clr_falling); 208 if (irq_desc[irq].depth == 0) {
210 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING) 209 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING)
211 ? &g->set_rising : &g->clr_rising); 210 ? &g->set_falling : &g->clr_falling);
211 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING)
212 ? &g->set_rising : &g->clr_rising);
213 }
212 return 0; 214 return 0;
213} 215}
214 216
@@ -230,6 +232,7 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc)
230 mask <<= 16; 232 mask <<= 16;
231 233
232 /* temporarily mask (level sensitive) parent IRQ */ 234 /* temporarily mask (level sensitive) parent IRQ */
235 desc->chip->mask(irq);
233 desc->chip->ack(irq); 236 desc->chip->ack(irq);
234 while (1) { 237 while (1) {
235 u32 status; 238 u32 status;
@@ -268,17 +271,15 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc)
268static int __init davinci_gpio_irq_setup(void) 271static int __init davinci_gpio_irq_setup(void)
269{ 272{
270 unsigned gpio, irq, bank; 273 unsigned gpio, irq, bank;
271 unsigned bank_irq;
272 struct clk *clk; 274 struct clk *clk;
273 u32 binten = 0; 275 u32 binten = 0;
276 unsigned ngpio, bank_irq;
277 struct davinci_soc_info *soc_info = &davinci_soc_info;
278
279 ngpio = soc_info->gpio_num;
274 280
275 if (cpu_is_davinci_dm355()) { /* or dm335() */ 281 bank_irq = soc_info->gpio_irq;
276 bank_irq = IRQ_DM355_GPIOBNK0; 282 if (bank_irq == 0) {
277 } else if (cpu_is_davinci_dm644x()) {
278 bank_irq = IRQ_GPIOBNK0;
279 } else if (cpu_is_davinci_dm646x()) {
280 bank_irq = IRQ_DM646X_GPIOBNK0;
281 } else {
282 printk(KERN_ERR "Don't know first GPIO bank IRQ.\n"); 283 printk(KERN_ERR "Don't know first GPIO bank IRQ.\n");
283 return -EINVAL; 284 return -EINVAL;
284 } 285 }
@@ -318,11 +319,9 @@ static int __init davinci_gpio_irq_setup(void)
318 /* BINTEN -- per-bank interrupt enable. genirq would also let these 319 /* BINTEN -- per-bank interrupt enable. genirq would also let these
319 * bits be set/cleared dynamically. 320 * bits be set/cleared dynamically.
320 */ 321 */
321 __raw_writel(binten, (void *__iomem) 322 __raw_writel(binten, soc_info->gpio_base + 0x08);
322 IO_ADDRESS(DAVINCI_GPIO_BASE + 0x08));
323 323
324 printk(KERN_INFO "DaVinci: %d gpio irqs\n", irq - gpio_to_irq(0)); 324 printk(KERN_INFO "DaVinci: %d gpio irqs\n", irq - gpio_to_irq(0));
325 325
326 return 0; 326 return 0;
327} 327}
328arch_initcall(davinci_gpio_irq_setup);
diff --git a/arch/arm/mach-davinci/id.c b/arch/arm/mach-davinci/id.c
deleted file mode 100644
index 018b994cd794..000000000000
--- a/arch/arm/mach-davinci/id.c
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * Davinci CPU identification code
3 *
4 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
5 *
6 * Derived from OMAP1 CPU identification code.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17
18#define JTAG_ID_BASE IO_ADDRESS(0x01c40028)
19
20static unsigned int davinci_revision;
21
22struct davinci_id {
23 u8 variant; /* JTAG ID bits 31:28 */
24 u16 part_no; /* JTAG ID bits 27:12 */
25 u32 manufacturer; /* JTAG ID bits 11:1 */
26 u32 type; /* Cpu id bits [31:8], cpu class bits [7:0] */
27};
28
29/* Register values to detect the DaVinci version */
30static struct davinci_id davinci_ids[] __initdata = {
31 {
32 /* DM6446 */
33 .part_no = 0xb700,
34 .variant = 0x0,
35 .manufacturer = 0x017,
36 .type = 0x64460000,
37 },
38 {
39 /* DM646X */
40 .part_no = 0xb770,
41 .variant = 0x0,
42 .manufacturer = 0x017,
43 .type = 0x64670000,
44 },
45 {
46 /* DM355 */
47 .part_no = 0xb73b,
48 .variant = 0x0,
49 .manufacturer = 0x00f,
50 .type = 0x03550000,
51 },
52};
53
54/*
55 * Get Device Part No. from JTAG ID register
56 */
57static u16 __init davinci_get_part_no(void)
58{
59 u32 dev_id, part_no;
60
61 dev_id = __raw_readl(JTAG_ID_BASE);
62
63 part_no = ((dev_id >> 12) & 0xffff);
64
65 return part_no;
66}
67
68/*
69 * Get Device Revision from JTAG ID register
70 */
71static u8 __init davinci_get_variant(void)
72{
73 u32 variant;
74
75 variant = __raw_readl(JTAG_ID_BASE);
76
77 variant = (variant >> 28) & 0xf;
78
79 return variant;
80}
81
82unsigned int davinci_rev(void)
83{
84 return davinci_revision >> 16;
85}
86EXPORT_SYMBOL(davinci_rev);
87
88void __init davinci_check_revision(void)
89{
90 int i;
91 u16 part_no;
92 u8 variant;
93
94 part_no = davinci_get_part_no();
95 variant = davinci_get_variant();
96
97 /* First check only the major version in a safe way */
98 for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) {
99 if (part_no == (davinci_ids[i].part_no)) {
100 davinci_revision = davinci_ids[i].type;
101 break;
102 }
103 }
104
105 /* Check if we can find the dev revision */
106 for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) {
107 if (part_no == davinci_ids[i].part_no &&
108 variant == davinci_ids[i].variant) {
109 davinci_revision = davinci_ids[i].type;
110 break;
111 }
112 }
113
114 printk(KERN_INFO "DaVinci DM%04x variant 0x%x\n",
115 davinci_rev(), variant);
116}
diff --git a/arch/arm/mach-davinci/include/mach/board-dm6446evm.h b/arch/arm/mach-davinci/include/mach/board-dm6446evm.h
deleted file mode 100644
index 3216f21c1238..000000000000
--- a/arch/arm/mach-davinci/include/mach/board-dm6446evm.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * DaVinci DM6446 EVM board specific headers
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or ifndef.
10 */
11
12#ifndef _MACH_DAVINCI_DM6446EVM_H
13#define _MACH_DAVINCI_DM6446EVM_H
14
15#include <linux/types.h>
16
17int dm6446evm_eeprom_read(char *buf, off_t off, size_t count);
18int dm6446evm_eeprom_write(char *buf, off_t off, size_t count);
19
20#endif
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 191770976250..a1f03b606d8f 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -17,7 +17,8 @@ struct sys_timer;
17extern struct sys_timer davinci_timer; 17extern struct sys_timer davinci_timer;
18 18
19extern void davinci_irq_init(void); 19extern void davinci_irq_init(void);
20extern void davinci_map_common_io(void); 20extern void __iomem *davinci_intc_base;
21extern int davinci_intc_type;
21 22
22/* parameters describe VBUS sourcing for host mode */ 23/* parameters describe VBUS sourcing for host mode */
23extern void setup_usb(unsigned mA, unsigned potpgt_msec); 24extern void setup_usb(unsigned mA, unsigned potpgt_msec);
@@ -25,4 +26,56 @@ extern void setup_usb(unsigned mA, unsigned potpgt_msec);
25/* parameters describe VBUS sourcing for host mode */ 26/* parameters describe VBUS sourcing for host mode */
26extern void setup_usb(unsigned mA, unsigned potpgt_msec); 27extern void setup_usb(unsigned mA, unsigned potpgt_msec);
27 28
29struct davinci_timer_instance {
30 void __iomem *base;
31 u32 bottom_irq;
32 u32 top_irq;
33 unsigned long cmp_off;
34 unsigned int cmp_irq;
35};
36
37struct davinci_timer_info {
38 struct davinci_timer_instance *timers;
39 unsigned int clockevent_id;
40 unsigned int clocksource_id;
41};
42
43/* SoC specific init support */
44struct davinci_soc_info {
45 struct map_desc *io_desc;
46 unsigned long io_desc_num;
47 u32 cpu_id;
48 u32 jtag_id;
49 void __iomem *jtag_id_base;
50 struct davinci_id *ids;
51 unsigned long ids_num;
52 struct davinci_clk *cpu_clks;
53 void __iomem **psc_bases;
54 unsigned long psc_bases_num;
55 void __iomem *pinmux_base;
56 const struct mux_config *pinmux_pins;
57 unsigned long pinmux_pins_num;
58 void __iomem *intc_base;
59 int intc_type;
60 u8 *intc_irq_prios;
61 unsigned long intc_irq_num;
62 struct davinci_timer_info *timer_info;
63 void __iomem *wdt_base;
64 void __iomem *gpio_base;
65 unsigned gpio_num;
66 unsigned gpio_irq;
67 struct platform_device *serial_dev;
68 struct emac_platform_data *emac_pdata;
69 dma_addr_t sram_dma;
70 unsigned sram_len;
71};
72
73extern struct davinci_soc_info davinci_soc_info;
74
75extern void davinci_common_init(struct davinci_soc_info *soc_info);
76
77/* standard place to map on-chip SRAMs; they *may* support DMA */
78#define SRAM_VIRT 0xfffe0000
79#define SRAM_SIZE SZ_128K
80
28#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ 81#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
diff --git a/arch/arm/mach-davinci/include/mach/cp_intc.h b/arch/arm/mach-davinci/include/mach/cp_intc.h
new file mode 100644
index 000000000000..c4d27eec8064
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/cp_intc.h
@@ -0,0 +1,57 @@
1/*
2 * TI Common Platform Interrupt Controller (cp_intc) definitions
3 *
4 * Author: Steve Chen <schen@mvista.com>
5 * Copyright (C) 2008-2009, MontaVista Software, Inc. <source@mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11#ifndef __ASM_HARDWARE_CP_INTC_H
12#define __ASM_HARDWARE_CP_INTC_H
13
14#define CP_INTC_REV 0x00
15#define CP_INTC_CTRL 0x04
16#define CP_INTC_HOST_CTRL 0x0C
17#define CP_INTC_GLOBAL_ENABLE 0x10
18#define CP_INTC_GLOBAL_NESTING_LEVEL 0x1C
19#define CP_INTC_SYS_STAT_IDX_SET 0x20
20#define CP_INTC_SYS_STAT_IDX_CLR 0x24
21#define CP_INTC_SYS_ENABLE_IDX_SET 0x28
22#define CP_INTC_SYS_ENABLE_IDX_CLR 0x2C
23#define CP_INTC_GLOBAL_WAKEUP_ENABLE 0x30
24#define CP_INTC_HOST_ENABLE_IDX_SET 0x34
25#define CP_INTC_HOST_ENABLE_IDX_CLR 0x38
26#define CP_INTC_PACING_PRESCALE 0x40
27#define CP_INTC_VECTOR_BASE 0x50
28#define CP_INTC_VECTOR_SIZE 0x54
29#define CP_INTC_VECTOR_NULL 0x58
30#define CP_INTC_PRIO_IDX 0x80
31#define CP_INTC_PRIO_VECTOR 0x84
32#define CP_INTC_SECURE_ENABLE 0x90
33#define CP_INTC_SECURE_PRIO_IDX 0x94
34#define CP_INTC_PACING_PARAM(n) (0x0100 + (n << 4))
35#define CP_INTC_PACING_DEC(n) (0x0104 + (n << 4))
36#define CP_INTC_PACING_MAP(n) (0x0108 + (n << 4))
37#define CP_INTC_SYS_RAW_STAT(n) (0x0200 + (n << 2))
38#define CP_INTC_SYS_STAT_CLR(n) (0x0280 + (n << 2))
39#define CP_INTC_SYS_ENABLE_SET(n) (0x0300 + (n << 2))
40#define CP_INTC_SYS_ENABLE_CLR(n) (0x0380 + (n << 2))
41#define CP_INTC_CHAN_MAP(n) (0x0400 + (n << 2))
42#define CP_INTC_HOST_MAP(n) (0x0800 + (n << 2))
43#define CP_INTC_HOST_PRIO_IDX(n) (0x0900 + (n << 2))
44#define CP_INTC_SYS_POLARITY(n) (0x0D00 + (n << 2))
45#define CP_INTC_SYS_TYPE(n) (0x0D80 + (n << 2))
46#define CP_INTC_WAKEUP_ENABLE(n) (0x0E00 + (n << 2))
47#define CP_INTC_DEBUG_SELECT(n) (0x0F00 + (n << 2))
48#define CP_INTC_SYS_SECURE_ENABLE(n) (0x1000 + (n << 2))
49#define CP_INTC_HOST_NESTING_LEVEL(n) (0x1100 + (n << 2))
50#define CP_INTC_HOST_ENABLE(n) (0x1500 + (n << 2))
51#define CP_INTC_HOST_PRIO_VECTOR(n) (0x1600 + (n << 2))
52#define CP_INTC_VECTOR_ADDR(n) (0x2000 + (n << 2))
53
54void __init cp_intc_init(void __iomem *base, unsigned short num_irq,
55 u8 *irq_prio);
56
57#endif /* __ASM_HARDWARE_CP_INTC_H */
diff --git a/arch/arm/mach-davinci/include/mach/cputype.h b/arch/arm/mach-davinci/include/mach/cputype.h
index 27cfb1b3a662..d12a5ed2959a 100644
--- a/arch/arm/mach-davinci/include/mach/cputype.h
+++ b/arch/arm/mach-davinci/include/mach/cputype.h
@@ -16,17 +16,30 @@
16#ifndef _ASM_ARCH_CPU_H 16#ifndef _ASM_ARCH_CPU_H
17#define _ASM_ARCH_CPU_H 17#define _ASM_ARCH_CPU_H
18 18
19extern unsigned int davinci_rev(void); 19#include <mach/common.h>
20 20
21#define IS_DAVINCI_CPU(type, id) \ 21struct davinci_id {
22static inline int is_davinci_dm ##type(void) \ 22 u8 variant; /* JTAG ID bits 31:28 */
23{ \ 23 u16 part_no; /* JTAG ID bits 27:12 */
24 return (davinci_rev() == (id)) ? 1 : 0; \ 24 u16 manufacturer; /* JTAG ID bits 11:1 */
25 u32 cpu_id;
26 char *name;
27};
28
29/* Can use lower 16 bits of cpu id for a variant when required */
30#define DAVINCI_CPU_ID_DM6446 0x64460000
31#define DAVINCI_CPU_ID_DM6467 0x64670000
32#define DAVINCI_CPU_ID_DM355 0x03550000
33
34#define IS_DAVINCI_CPU(type, id) \
35static inline int is_davinci_ ##type(void) \
36{ \
37 return (davinci_soc_info.cpu_id == (id)); \
25} 38}
26 39
27IS_DAVINCI_CPU(644x, 0x6446) 40IS_DAVINCI_CPU(dm644x, DAVINCI_CPU_ID_DM6446)
28IS_DAVINCI_CPU(646x, 0x6467) 41IS_DAVINCI_CPU(dm646x, DAVINCI_CPU_ID_DM6467)
29IS_DAVINCI_CPU(355, 0x355) 42IS_DAVINCI_CPU(dm355, DAVINCI_CPU_ID_DM355)
30 43
31#ifdef CONFIG_ARCH_DAVINCI_DM644x 44#ifdef CONFIG_ARCH_DAVINCI_DM644x
32#define cpu_is_davinci_dm644x() is_davinci_dm644x() 45#define cpu_is_davinci_dm644x() is_davinci_dm644x()
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S
index e6c0f0d5d062..de3fc2182b47 100644
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ b/arch/arm/mach-davinci/include/mach/debug-macro.S
@@ -9,6 +9,16 @@
9 * or implied. 9 * or implied.
10 */ 10 */
11 11
12/* Modifications
13 * Jan 2009 Chaithrika U S Added senduart, busyuart, waituart
14 * macros, based on debug-8250.S file
15 * but using 32-bit accesses required for
16 * some davinci devices.
17 */
18
19#include <linux/serial_reg.h>
20#define UART_SHIFT 2
21
12 .macro addruart, rx 22 .macro addruart, rx
13 mrc p15, 0, \rx, c1, c0 23 mrc p15, 0, \rx, c1, c0
14 tst \rx, #1 @ MMU enabled? 24 tst \rx, #1 @ MMU enabled?
@@ -17,5 +27,22 @@
17 orr \rx, \rx, #0x00c20000 @ UART 0 27 orr \rx, \rx, #0x00c20000 @ UART 0
18 .endm 28 .endm
19 29
20#define UART_SHIFT 2 30 .macro senduart,rd,rx
21#include <asm/hardware/debug-8250.S> 31 str \rd, [\rx, #UART_TX << UART_SHIFT]
32 .endm
33
34 .macro busyuart,rd,rx
351002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
36 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
37 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
38 bne 1002b
39 .endm
40
41 .macro waituart,rd,rx
42#ifdef FLOW_CONTROL
431001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
44 tst \rd, #UART_MSR_CTS
45 beq 1001b
46#endif
47 .endm
48
diff --git a/arch/arm/mach-davinci/include/mach/dm355.h b/arch/arm/mach-davinci/include/mach/dm355.h
new file mode 100644
index 000000000000..54903b72438e
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/dm355.h
@@ -0,0 +1,22 @@
1/*
2 * Chip specific defines for DM355 SoC
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_DM355_H
12#define __ASM_ARCH_DM355_H
13
14#include <mach/hardware.h>
15
16struct spi_board_info;
17
18void __init dm355_init(void);
19void dm355_init_spi0(unsigned chipselect_mask,
20 struct spi_board_info *info, unsigned len);
21
22#endif /* __ASM_ARCH_DM355_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h b/arch/arm/mach-davinci/include/mach/dm644x.h
index 3dcb9f4e58b4..15d42b92a8c9 100644
--- a/arch/arm/mach-davinci/include/mach/dm644x.h
+++ b/arch/arm/mach-davinci/include/mach/dm644x.h
@@ -24,6 +24,7 @@
24 24
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/emac.h>
27 28
28#define DM644X_EMAC_BASE (0x01C80000) 29#define DM644X_EMAC_BASE (0x01C80000)
29#define DM644X_EMAC_CNTRL_OFFSET (0x0000) 30#define DM644X_EMAC_CNTRL_OFFSET (0x0000)
diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h
new file mode 100644
index 000000000000..1fc764c8646e
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/dm646x.h
@@ -0,0 +1,26 @@
1/*
2 * Chip specific defines for DM646x SoC
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_DM646X_H
12#define __ASM_ARCH_DM646X_H
13
14#include <mach/hardware.h>
15#include <mach/emac.h>
16
17#define DM646X_EMAC_BASE (0x01C80000)
18#define DM646X_EMAC_CNTRL_OFFSET (0x0000)
19#define DM646X_EMAC_CNTRL_MOD_OFFSET (0x1000)
20#define DM646X_EMAC_CNTRL_RAM_OFFSET (0x2000)
21#define DM646X_EMAC_MDIO_OFFSET (0x4000)
22#define DM646X_EMAC_CNTRL_RAM_SIZE (0x2000)
23
24void __init dm646x_init(void);
25
26#endif /* __ASM_ARCH_DM646X_H */
diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h
index f6fc5396dafc..24a379239d7f 100644
--- a/arch/arm/mach-davinci/include/mach/edma.h
+++ b/arch/arm/mach-davinci/include/mach/edma.h
@@ -208,10 +208,6 @@ void edma_clear_event(unsigned channel);
208void edma_pause(unsigned channel); 208void edma_pause(unsigned channel);
209void edma_resume(unsigned channel); 209void edma_resume(unsigned channel);
210 210
211/* UNRELATED TO DMA */
212int davinci_alloc_iram(unsigned size);
213void davinci_free_iram(unsigned addr, unsigned size);
214
215/* platform_data for EDMA driver */ 211/* platform_data for EDMA driver */
216struct edma_soc_info { 212struct edma_soc_info {
217 213
diff --git a/arch/arm/mach-davinci/include/mach/emac.h b/arch/arm/mach-davinci/include/mach/emac.h
new file mode 100644
index 000000000000..beff4fb7c845
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/emac.h
@@ -0,0 +1,36 @@
1/*
2 * TI DaVinci EMAC platform support
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef _MACH_DAVINCI_EMAC_H
12#define _MACH_DAVINCI_EMAC_H
13
14#include <linux/if_ether.h>
15#include <linux/memory.h>
16
17struct emac_platform_data {
18 char mac_addr[ETH_ALEN];
19 u32 ctrl_reg_offset;
20 u32 ctrl_mod_reg_offset;
21 u32 ctrl_ram_offset;
22 u32 mdio_reg_offset;
23 u32 ctrl_ram_size;
24 u32 phy_mask;
25 u32 mdio_max_freq;
26 u8 rmii_en;
27 u8 version;
28};
29
30enum {
31 EMAC_VERSION_1, /* DM644x */
32 EMAC_VERSION_2, /* DM646x */
33};
34
35void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context);
36#endif
diff --git a/arch/arm/mach-davinci/include/mach/entry-macro.S b/arch/arm/mach-davinci/include/mach/entry-macro.S
index 039b84f933b3..fbdebc7cb409 100644
--- a/arch/arm/mach-davinci/include/mach/entry-macro.S
+++ b/arch/arm/mach-davinci/include/mach/entry-macro.S
@@ -15,17 +15,36 @@
15 .endm 15 .endm
16 16
17 .macro get_irqnr_preamble, base, tmp 17 .macro get_irqnr_preamble, base, tmp
18 ldr \base, =IO_ADDRESS(DAVINCI_ARM_INTC_BASE) 18 ldr \base, =davinci_intc_base
19 ldr \base, [\base]
19 .endm 20 .endm
20 21
21 .macro arch_ret_to_user, tmp1, tmp2 22 .macro arch_ret_to_user, tmp1, tmp2
22 .endm 23 .endm
23 24
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
26#if defined(CONFIG_AINTC) && defined(CONFIG_CP_INTC)
27 ldr \tmp, =davinci_intc_type
28 ldr \tmp, [\tmp]
29 cmp \tmp, #DAVINCI_INTC_TYPE_CP_INTC
30 beq 1001f
31#endif
32#if defined(CONFIG_AINTC)
25 ldr \tmp, [\base, #0x14] 33 ldr \tmp, [\base, #0x14]
26 mov \tmp, \tmp, lsr #2 34 movs \tmp, \tmp, lsr #2
27 sub \irqnr, \tmp, #1 35 sub \irqnr, \tmp, #1
28 cmp \tmp, #0 36 b 1002f
37#endif
38#if defined(CONFIG_CP_INTC)
391001: ldr \irqnr, [\base, #0x80] /* get irq number */
40 and \irqnr, \irqnr, #0xff /* irq is in bits 0-9 */
41 mov \tmp, \irqnr, lsr #3
42 and \tmp, \tmp, #0xfc
43 add \tmp, \tmp, #0x280 /* get the register offset */
44 ldr \irqstat, [\base, \tmp] /* get the intc status */
45 cmp \irqstat, #0x0
46#endif
471002:
29 .endm 48 .endm
30 49
31 .macro irq_prio_table 50 .macro irq_prio_table
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index efe3281364e6..ae0745568316 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -17,6 +17,7 @@
17#include <asm-generic/gpio.h> 17#include <asm-generic/gpio.h>
18 18
19#include <mach/irqs.h> 19#include <mach/irqs.h>
20#include <mach/common.h>
20 21
21#define DAVINCI_GPIO_BASE 0x01C67000 22#define DAVINCI_GPIO_BASE 0x01C67000
22 23
@@ -67,15 +68,16 @@ static inline struct gpio_controller *__iomem
67__gpio_to_controller(unsigned gpio) 68__gpio_to_controller(unsigned gpio)
68{ 69{
69 void *__iomem ptr; 70 void *__iomem ptr;
71 void __iomem *base = davinci_soc_info.gpio_base;
70 72
71 if (gpio < 32 * 1) 73 if (gpio < 32 * 1)
72 ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x10); 74 ptr = base + 0x10;
73 else if (gpio < 32 * 2) 75 else if (gpio < 32 * 2)
74 ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x38); 76 ptr = base + 0x38;
75 else if (gpio < 32 * 3) 77 else if (gpio < 32 * 3)
76 ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x60); 78 ptr = base + 0x60;
77 else if (gpio < 32 * 4) 79 else if (gpio < 32 * 4)
78 ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x88); 80 ptr = base + 0x88;
79 else 81 else
80 ptr = NULL; 82 ptr = NULL;
81 return ptr; 83 return ptr;
@@ -142,13 +144,13 @@ static inline int gpio_to_irq(unsigned gpio)
142{ 144{
143 if (gpio >= DAVINCI_N_GPIO) 145 if (gpio >= DAVINCI_N_GPIO)
144 return -EINVAL; 146 return -EINVAL;
145 return DAVINCI_N_AINTC_IRQ + gpio; 147 return davinci_soc_info.intc_irq_num + gpio;
146} 148}
147 149
148static inline int irq_to_gpio(unsigned irq) 150static inline int irq_to_gpio(unsigned irq)
149{ 151{
150 /* caller guarantees gpio_to_irq() succeeded */ 152 /* caller guarantees gpio_to_irq() succeeded */
151 return irq - DAVINCI_N_AINTC_IRQ; 153 return irq - davinci_soc_info.intc_irq_num;
152} 154}
153 155
154#endif /* __DAVINCI_GPIO_H */ 156#endif /* __DAVINCI_GPIO_H */
diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h
index 18066074c995..bc5d6aaa69a3 100644
--- a/arch/arm/mach-davinci/include/mach/irqs.h
+++ b/arch/arm/mach-davinci/include/mach/irqs.h
@@ -30,6 +30,9 @@
30/* Base address */ 30/* Base address */
31#define DAVINCI_ARM_INTC_BASE 0x01C48000 31#define DAVINCI_ARM_INTC_BASE 0x01C48000
32 32
33#define DAVINCI_INTC_TYPE_AINTC 0
34#define DAVINCI_INTC_TYPE_CP_INTC 1
35
33/* Interrupt lines */ 36/* Interrupt lines */
34#define IRQ_VDINT0 0 37#define IRQ_VDINT0 0
35#define IRQ_VDINT1 1 38#define IRQ_VDINT1 1
diff --git a/arch/arm/mach-davinci/include/mach/memory.h b/arch/arm/mach-davinci/include/mach/memory.h
index 86c25c7f3ce3..c712c7cdf38f 100644
--- a/arch/arm/mach-davinci/include/mach/memory.h
+++ b/arch/arm/mach-davinci/include/mach/memory.h
@@ -21,7 +21,6 @@
21 * Definitions 21 * Definitions
22 **************************************************************************/ 22 **************************************************************************/
23#define DAVINCI_DDR_BASE 0x80000000 23#define DAVINCI_DDR_BASE 0x80000000
24#define DAVINCI_IRAM_BASE 0x00008000 /* ARM Internal RAM */
25 24
26#define PHYS_OFFSET DAVINCI_DDR_BASE 25#define PHYS_OFFSET DAVINCI_DDR_BASE
27 26
diff --git a/arch/arm/mach-davinci/include/mach/mmc.h b/arch/arm/mach-davinci/include/mach/mmc.h
new file mode 100644
index 000000000000..5a85e24f3673
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/mmc.h
@@ -0,0 +1,33 @@
1/*
2 * Board-specific MMC configuration
3 */
4
5#ifndef _DAVINCI_MMC_H
6#define _DAVINCI_MMC_H
7
8#include <linux/types.h>
9#include <linux/mmc/host.h>
10
11struct davinci_mmc_config {
12 /* get_cd()/get_wp() may sleep */
13 int (*get_cd)(int module);
14 int (*get_ro)(int module);
15 /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */
16 u8 wires;
17
18 u32 max_freq;
19
20 /* any additional host capabilities: OR'd in to mmc->f_caps */
21 u32 caps;
22
23 /* Version of the MMC/SD controller */
24 u8 version;
25};
26void davinci_setup_mmc(int module, struct davinci_mmc_config *config);
27
28enum {
29 MMC_CTLR_VERSION_1 = 0, /* DM644x and DM355 */
30 MMC_CTLR_VERSION_2, /* DA830 */
31};
32
33#endif
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index bae22cb3e27b..27378458542f 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -19,16 +19,6 @@
19#ifndef __INC_MACH_MUX_H 19#ifndef __INC_MACH_MUX_H
20#define __INC_MACH_MUX_H 20#define __INC_MACH_MUX_H
21 21
22/* System module registers */
23#define PINMUX0 0x00
24#define PINMUX1 0x04
25/* dm355 only */
26#define PINMUX2 0x08
27#define PINMUX3 0x0c
28#define PINMUX4 0x10
29#define INTMUX 0x18
30#define EVTMUX 0x1c
31
32struct mux_config { 22struct mux_config {
33 const char *name; 23 const char *name;
34 const char *mux_reg_name; 24 const char *mux_reg_name;
@@ -168,15 +158,9 @@ enum davinci_dm355_index {
168 158
169#ifdef CONFIG_DAVINCI_MUX 159#ifdef CONFIG_DAVINCI_MUX
170/* setup pin muxing */ 160/* setup pin muxing */
171extern void davinci_mux_init(void);
172extern int davinci_mux_register(const struct mux_config *pins,
173 unsigned long size);
174extern int davinci_cfg_reg(unsigned long reg_cfg); 161extern int davinci_cfg_reg(unsigned long reg_cfg);
175#else 162#else
176/* boot loader does it all (no warnings from CONFIG_DAVINCI_MUX_WARNINGS) */ 163/* boot loader does it all (no warnings from CONFIG_DAVINCI_MUX_WARNINGS) */
177static inline void davinci_mux_init(void) {}
178static inline int davinci_mux_register(const struct mux_config *pins,
179 unsigned long size) { return 0; }
180static inline int davinci_cfg_reg(unsigned long reg_cfg) { return 0; } 164static inline int davinci_cfg_reg(unsigned long reg_cfg) { return 0; }
181#endif 165#endif
182 166
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 55a90d419fac..ab8a2586d1cc 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -27,6 +27,8 @@
27#ifndef __ASM_ARCH_PSC_H 27#ifndef __ASM_ARCH_PSC_H
28#define __ASM_ARCH_PSC_H 28#define __ASM_ARCH_PSC_H
29 29
30#define DAVINCI_PWR_SLEEP_CNTRL_BASE 0x01C41000
31
30/* Power and Sleep Controller (PSC) Domains */ 32/* Power and Sleep Controller (PSC) Domains */
31#define DAVINCI_GPSC_ARMDOMAIN 0 33#define DAVINCI_GPSC_ARMDOMAIN 0
32#define DAVINCI_GPSC_DSPDOMAIN 1 34#define DAVINCI_GPSC_DSPDOMAIN 1
@@ -116,8 +118,8 @@
116#define DM646X_LPSC_TIMER1 35 118#define DM646X_LPSC_TIMER1 35
117#define DM646X_LPSC_ARM_INTC 45 119#define DM646X_LPSC_ARM_INTC 45
118 120
119extern int davinci_psc_is_clk_active(unsigned int id); 121extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id);
120extern void davinci_psc_config(unsigned int domain, unsigned int id, 122extern void davinci_psc_config(unsigned int domain, unsigned int ctlr,
121 char enable); 123 unsigned int id, char enable);
122 124
123#endif /* __ASM_ARCH_PSC_H */ 125#endif /* __ASM_ARCH_PSC_H */
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h
index 632847d74a1c..794fa5cf93c1 100644
--- a/arch/arm/mach-davinci/include/mach/serial.h
+++ b/arch/arm/mach-davinci/include/mach/serial.h
@@ -18,8 +18,6 @@
18#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) 18#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
19#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) 19#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
20 20
21#define DM355_UART2_BASE (IO_PHYS + 0x206000)
22
23/* DaVinci UART register offsets */ 21/* DaVinci UART register offsets */
24#define UART_DAVINCI_PWREMU 0x0c 22#define UART_DAVINCI_PWREMU 0x0c
25#define UART_DM646X_SCR 0x10 23#define UART_DM646X_SCR 0x10
@@ -30,6 +28,6 @@ struct davinci_uart_config {
30 unsigned int enabled_uarts; 28 unsigned int enabled_uarts;
31}; 29};
32 30
33extern void davinci_serial_init(struct davinci_uart_config *); 31extern int davinci_serial_init(struct davinci_uart_config *);
34 32
35#endif /* __ASM_ARCH_SERIAL_H */ 33#endif /* __ASM_ARCH_SERIAL_H */
diff --git a/arch/arm/mach-davinci/include/mach/sram.h b/arch/arm/mach-davinci/include/mach/sram.h
new file mode 100644
index 000000000000..111f7cc71e07
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/sram.h
@@ -0,0 +1,27 @@
1/*
2 * mach/sram.h - DaVinci simple SRAM allocator
3 *
4 * Copyright (C) 2009 David Brownell
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __MACH_SRAM_H
11#define __MACH_SRAM_H
12
13/* ARBITRARY: SRAM allocations are multiples of this 2^N size */
14#define SRAM_GRANULARITY 512
15
16/*
17 * SRAM allocations return a CPU virtual address, or NULL on error.
18 * If a DMA address is requested and the SRAM supports DMA, its
19 * mapped address is also returned.
20 *
21 * Errors include SRAM memory not being available, and requesting
22 * DMA mapped SRAM on systems which don't allow that.
23 */
24extern void *sram_alloc(size_t len, dma_addr_t *dma);
25extern void sram_free(void *addr, size_t len);
26
27#endif /* __MACH_SRAM_H */
diff --git a/arch/arm/mach-davinci/include/mach/time.h b/arch/arm/mach-davinci/include/mach/time.h
new file mode 100644
index 000000000000..1c971d8d8ba8
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/time.h
@@ -0,0 +1,35 @@
1/*
2 * Local header file for DaVinci time code.
3 *
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ARCH_ARM_MACH_DAVINCI_TIME_H
12#define __ARCH_ARM_MACH_DAVINCI_TIME_H
13
14#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
15#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
16#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
17
18enum {
19 T0_BOT,
20 T0_TOP,
21 T1_BOT,
22 T1_TOP,
23 NUM_TIMERS
24};
25
26#define IS_TIMER1(id) (id & 0x2)
27#define IS_TIMER0(id) (!IS_TIMER1(id))
28#define IS_TIMER_TOP(id) ((id & 0x1))
29#define IS_TIMER_BOT(id) (!IS_TIMER_TOP(id))
30
31#define ID_TO_TIMER(id) (IS_TIMER1(id) != 0)
32
33extern struct davinci_timer_instance davinci_timer_instance[];
34
35#endif /* __ARCH_ARM_MACH_DAVINCI_TIME_H */
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 8c165def37b6..1e27475f9a23 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -13,11 +13,24 @@
13#include <linux/serial_reg.h> 13#include <linux/serial_reg.h>
14#include <mach/serial.h> 14#include <mach/serial.h>
15 15
16#include <asm/mach-types.h>
17
18extern unsigned int __machine_arch_type;
19
20static u32 *uart;
21
22static u32 *get_uart_base(void)
23{
24 /* Add logic here for new platforms, using __macine_arch_type */
25 return (u32 *)DAVINCI_UART0_BASE;
26}
27
16/* PORT_16C550A, in polled non-fifo mode */ 28/* PORT_16C550A, in polled non-fifo mode */
17 29
18static void putc(char c) 30static void putc(char c)
19{ 31{
20 volatile u32 *uart = (volatile void *) DAVINCI_UART0_BASE; 32 if (!uart)
33 uart = get_uart_base();
21 34
22 while (!(uart[UART_LSR] & UART_LSR_THRE)) 35 while (!(uart[UART_LSR] & UART_LSR_THRE))
23 barrier(); 36 barrier();
@@ -26,7 +39,9 @@ static void putc(char c)
26 39
27static inline void flush(void) 40static inline void flush(void)
28{ 41{
29 volatile u32 *uart = (volatile void *) DAVINCI_UART0_BASE; 42 if (!uart)
43 uart = get_uart_base();
44
30 while (!(uart[UART_LSR] & UART_LSR_THRE)) 45 while (!(uart[UART_LSR] & UART_LSR_THRE))
31 barrier(); 46 barrier();
32} 47}
diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c
index a548abb513e2..49912b48b1b0 100644
--- a/arch/arm/mach-davinci/io.c
+++ b/arch/arm/mach-davinci/io.c
@@ -9,47 +9,9 @@
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/io.h> 12#include <linux/io.h>
15 13
16#include <asm/tlb.h> 14#include <asm/tlb.h>
17#include <asm/memory.h>
18
19#include <asm/mach/map.h>
20#include <mach/clock.h>
21
22extern void davinci_check_revision(void);
23
24/*
25 * The machine specific code may provide the extra mapping besides the
26 * default mapping provided here.
27 */
28static struct map_desc davinci_io_desc[] __initdata = {
29 {
30 .virtual = IO_VIRT,
31 .pfn = __phys_to_pfn(IO_PHYS),
32 .length = IO_SIZE,
33 .type = MT_DEVICE
34 },
35};
36
37void __init davinci_map_common_io(void)
38{
39 iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc));
40
41 /* Normally devicemaps_init() would flush caches and tlb after
42 * mdesc->map_io(), but we must also do it here because of the CPU
43 * revision check below.
44 */
45 local_flush_tlb_all();
46 flush_cache_all();
47
48 /* We want to check CPU revision early for cpu_is_xxxx() macros.
49 * IO space mapping must be initialized before we can do that.
50 */
51 davinci_check_revision();
52}
53 15
54#define BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz))) 16#define BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
55#define XLATE(p, pst, vst) ((void __iomem *)((p) - (pst) + (vst))) 17#define XLATE(p, pst, vst) ((void __iomem *)((p) - (pst) + (vst)))
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c
index 5a324c90e291..af92ffee8471 100644
--- a/arch/arm/mach-davinci/irq.c
+++ b/arch/arm/mach-davinci/irq.c
@@ -26,6 +26,7 @@
26 26
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/cputype.h> 28#include <mach/cputype.h>
29#include <mach/common.h>
29#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
30 31
31#define IRQ_BIT(irq) ((irq) & 0x1f) 32#define IRQ_BIT(irq) ((irq) & 0x1f)
@@ -41,18 +42,14 @@
41#define IRQ_INTPRI0_REG_OFFSET 0x0030 42#define IRQ_INTPRI0_REG_OFFSET 0x0030
42#define IRQ_INTPRI7_REG_OFFSET 0x004C 43#define IRQ_INTPRI7_REG_OFFSET 0x004C
43 44
44const u8 *davinci_def_priorities;
45
46#define INTC_BASE IO_ADDRESS(DAVINCI_ARM_INTC_BASE)
47
48static inline unsigned int davinci_irq_readl(int offset) 45static inline unsigned int davinci_irq_readl(int offset)
49{ 46{
50 return __raw_readl(INTC_BASE + offset); 47 return __raw_readl(davinci_intc_base + offset);
51} 48}
52 49
53static inline void davinci_irq_writel(unsigned long value, int offset) 50static inline void davinci_irq_writel(unsigned long value, int offset)
54{ 51{
55 __raw_writel(value, INTC_BASE + offset); 52 __raw_writel(value, davinci_intc_base + offset);
56} 53}
57 54
58/* Disable interrupt */ 55/* Disable interrupt */
@@ -113,217 +110,11 @@ static struct irq_chip davinci_irq_chip_0 = {
113 .unmask = davinci_unmask_irq, 110 .unmask = davinci_unmask_irq,
114}; 111};
115 112
116/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
117static const u8 dm644x_default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = {
118 [IRQ_VDINT0] = 2,
119 [IRQ_VDINT1] = 6,
120 [IRQ_VDINT2] = 6,
121 [IRQ_HISTINT] = 6,
122 [IRQ_H3AINT] = 6,
123 [IRQ_PRVUINT] = 6,
124 [IRQ_RSZINT] = 6,
125 [7] = 7,
126 [IRQ_VENCINT] = 6,
127 [IRQ_ASQINT] = 6,
128 [IRQ_IMXINT] = 6,
129 [IRQ_VLCDINT] = 6,
130 [IRQ_USBINT] = 4,
131 [IRQ_EMACINT] = 4,
132 [14] = 7,
133 [15] = 7,
134 [IRQ_CCINT0] = 5, /* dma */
135 [IRQ_CCERRINT] = 5, /* dma */
136 [IRQ_TCERRINT0] = 5, /* dma */
137 [IRQ_TCERRINT] = 5, /* dma */
138 [IRQ_PSCIN] = 7,
139 [21] = 7,
140 [IRQ_IDE] = 4,
141 [23] = 7,
142 [IRQ_MBXINT] = 7,
143 [IRQ_MBRINT] = 7,
144 [IRQ_MMCINT] = 7,
145 [IRQ_SDIOINT] = 7,
146 [28] = 7,
147 [IRQ_DDRINT] = 7,
148 [IRQ_AEMIFINT] = 7,
149 [IRQ_VLQINT] = 4,
150 [IRQ_TINT0_TINT12] = 2, /* clockevent */
151 [IRQ_TINT0_TINT34] = 2, /* clocksource */
152 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
153 [IRQ_TINT1_TINT34] = 7, /* system tick */
154 [IRQ_PWMINT0] = 7,
155 [IRQ_PWMINT1] = 7,
156 [IRQ_PWMINT2] = 7,
157 [IRQ_I2C] = 3,
158 [IRQ_UARTINT0] = 3,
159 [IRQ_UARTINT1] = 3,
160 [IRQ_UARTINT2] = 3,
161 [IRQ_SPINT0] = 3,
162 [IRQ_SPINT1] = 3,
163 [45] = 7,
164 [IRQ_DSP2ARM0] = 4,
165 [IRQ_DSP2ARM1] = 4,
166 [IRQ_GPIO0] = 7,
167 [IRQ_GPIO1] = 7,
168 [IRQ_GPIO2] = 7,
169 [IRQ_GPIO3] = 7,
170 [IRQ_GPIO4] = 7,
171 [IRQ_GPIO5] = 7,
172 [IRQ_GPIO6] = 7,
173 [IRQ_GPIO7] = 7,
174 [IRQ_GPIOBNK0] = 7,
175 [IRQ_GPIOBNK1] = 7,
176 [IRQ_GPIOBNK2] = 7,
177 [IRQ_GPIOBNK3] = 7,
178 [IRQ_GPIOBNK4] = 7,
179 [IRQ_COMMTX] = 7,
180 [IRQ_COMMRX] = 7,
181 [IRQ_EMUINT] = 7,
182};
183
184static const u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
185 [IRQ_DM646X_VP_VERTINT0] = 7,
186 [IRQ_DM646X_VP_VERTINT1] = 7,
187 [IRQ_DM646X_VP_VERTINT2] = 7,
188 [IRQ_DM646X_VP_VERTINT3] = 7,
189 [IRQ_DM646X_VP_ERRINT] = 7,
190 [IRQ_DM646X_RESERVED_1] = 7,
191 [IRQ_DM646X_RESERVED_2] = 7,
192 [IRQ_DM646X_WDINT] = 7,
193 [IRQ_DM646X_CRGENINT0] = 7,
194 [IRQ_DM646X_CRGENINT1] = 7,
195 [IRQ_DM646X_TSIFINT0] = 7,
196 [IRQ_DM646X_TSIFINT1] = 7,
197 [IRQ_DM646X_VDCEINT] = 7,
198 [IRQ_DM646X_USBINT] = 7,
199 [IRQ_DM646X_USBDMAINT] = 7,
200 [IRQ_DM646X_PCIINT] = 7,
201 [IRQ_CCINT0] = 7, /* dma */
202 [IRQ_CCERRINT] = 7, /* dma */
203 [IRQ_TCERRINT0] = 7, /* dma */
204 [IRQ_TCERRINT] = 7, /* dma */
205 [IRQ_DM646X_TCERRINT2] = 7,
206 [IRQ_DM646X_TCERRINT3] = 7,
207 [IRQ_DM646X_IDE] = 7,
208 [IRQ_DM646X_HPIINT] = 7,
209 [IRQ_DM646X_EMACRXTHINT] = 7,
210 [IRQ_DM646X_EMACRXINT] = 7,
211 [IRQ_DM646X_EMACTXINT] = 7,
212 [IRQ_DM646X_EMACMISCINT] = 7,
213 [IRQ_DM646X_MCASP0TXINT] = 7,
214 [IRQ_DM646X_MCASP0RXINT] = 7,
215 [IRQ_AEMIFINT] = 7,
216 [IRQ_DM646X_RESERVED_3] = 7,
217 [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */
218 [IRQ_TINT0_TINT34] = 7, /* clocksource */
219 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
220 [IRQ_TINT1_TINT34] = 7, /* system tick */
221 [IRQ_PWMINT0] = 7,
222 [IRQ_PWMINT1] = 7,
223 [IRQ_DM646X_VLQINT] = 7,
224 [IRQ_I2C] = 7,
225 [IRQ_UARTINT0] = 7,
226 [IRQ_UARTINT1] = 7,
227 [IRQ_DM646X_UARTINT2] = 7,
228 [IRQ_DM646X_SPINT0] = 7,
229 [IRQ_DM646X_SPINT1] = 7,
230 [IRQ_DM646X_DSP2ARMINT] = 7,
231 [IRQ_DM646X_RESERVED_4] = 7,
232 [IRQ_DM646X_PSCINT] = 7,
233 [IRQ_DM646X_GPIO0] = 7,
234 [IRQ_DM646X_GPIO1] = 7,
235 [IRQ_DM646X_GPIO2] = 7,
236 [IRQ_DM646X_GPIO3] = 7,
237 [IRQ_DM646X_GPIO4] = 7,
238 [IRQ_DM646X_GPIO5] = 7,
239 [IRQ_DM646X_GPIO6] = 7,
240 [IRQ_DM646X_GPIO7] = 7,
241 [IRQ_DM646X_GPIOBNK0] = 7,
242 [IRQ_DM646X_GPIOBNK1] = 7,
243 [IRQ_DM646X_GPIOBNK2] = 7,
244 [IRQ_DM646X_DDRINT] = 7,
245 [IRQ_DM646X_AEMIFINT] = 7,
246 [IRQ_COMMTX] = 7,
247 [IRQ_COMMRX] = 7,
248 [IRQ_EMUINT] = 7,
249};
250
251static const u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
252 [IRQ_DM355_CCDC_VDINT0] = 2,
253 [IRQ_DM355_CCDC_VDINT1] = 6,
254 [IRQ_DM355_CCDC_VDINT2] = 6,
255 [IRQ_DM355_IPIPE_HST] = 6,
256 [IRQ_DM355_H3AINT] = 6,
257 [IRQ_DM355_IPIPE_SDR] = 6,
258 [IRQ_DM355_IPIPEIFINT] = 6,
259 [IRQ_DM355_OSDINT] = 7,
260 [IRQ_DM355_VENCINT] = 6,
261 [IRQ_ASQINT] = 6,
262 [IRQ_IMXINT] = 6,
263 [IRQ_USBINT] = 4,
264 [IRQ_DM355_RTOINT] = 4,
265 [IRQ_DM355_UARTINT2] = 7,
266 [IRQ_DM355_TINT6] = 7,
267 [IRQ_CCINT0] = 5, /* dma */
268 [IRQ_CCERRINT] = 5, /* dma */
269 [IRQ_TCERRINT0] = 5, /* dma */
270 [IRQ_TCERRINT] = 5, /* dma */
271 [IRQ_DM355_SPINT2_1] = 7,
272 [IRQ_DM355_TINT7] = 4,
273 [IRQ_DM355_SDIOINT0] = 7,
274 [IRQ_MBXINT] = 7,
275 [IRQ_MBRINT] = 7,
276 [IRQ_MMCINT] = 7,
277 [IRQ_DM355_MMCINT1] = 7,
278 [IRQ_DM355_PWMINT3] = 7,
279 [IRQ_DDRINT] = 7,
280 [IRQ_AEMIFINT] = 7,
281 [IRQ_DM355_SDIOINT1] = 4,
282 [IRQ_TINT0_TINT12] = 2, /* clockevent */
283 [IRQ_TINT0_TINT34] = 2, /* clocksource */
284 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
285 [IRQ_TINT1_TINT34] = 7, /* system tick */
286 [IRQ_PWMINT0] = 7,
287 [IRQ_PWMINT1] = 7,
288 [IRQ_PWMINT2] = 7,
289 [IRQ_I2C] = 3,
290 [IRQ_UARTINT0] = 3,
291 [IRQ_UARTINT1] = 3,
292 [IRQ_DM355_SPINT0_0] = 3,
293 [IRQ_DM355_SPINT0_1] = 3,
294 [IRQ_DM355_GPIO0] = 3,
295 [IRQ_DM355_GPIO1] = 7,
296 [IRQ_DM355_GPIO2] = 4,
297 [IRQ_DM355_GPIO3] = 4,
298 [IRQ_DM355_GPIO4] = 7,
299 [IRQ_DM355_GPIO5] = 7,
300 [IRQ_DM355_GPIO6] = 7,
301 [IRQ_DM355_GPIO7] = 7,
302 [IRQ_DM355_GPIO8] = 7,
303 [IRQ_DM355_GPIO9] = 7,
304 [IRQ_DM355_GPIOBNK0] = 7,
305 [IRQ_DM355_GPIOBNK1] = 7,
306 [IRQ_DM355_GPIOBNK2] = 7,
307 [IRQ_DM355_GPIOBNK3] = 7,
308 [IRQ_DM355_GPIOBNK4] = 7,
309 [IRQ_DM355_GPIOBNK5] = 7,
310 [IRQ_DM355_GPIOBNK6] = 7,
311 [IRQ_COMMTX] = 7,
312 [IRQ_COMMRX] = 7,
313 [IRQ_EMUINT] = 7,
314};
315
316/* ARM Interrupt Controller Initialization */ 113/* ARM Interrupt Controller Initialization */
317void __init davinci_irq_init(void) 114void __init davinci_irq_init(void)
318{ 115{
319 unsigned i; 116 unsigned i;
320 117 const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios;
321 if (cpu_is_davinci_dm644x())
322 davinci_def_priorities = dm644x_default_priorities;
323 else if (cpu_is_davinci_dm646x())
324 davinci_def_priorities = dm646x_default_priorities;
325 else if (cpu_is_davinci_dm355())
326 davinci_def_priorities = dm355_default_priorities;
327 118
328 /* Clear all interrupt requests */ 119 /* Clear all interrupt requests */
329 davinci_irq_writel(~0x0, FIQ_REG0_OFFSET); 120 davinci_irq_writel(~0x0, FIQ_REG0_OFFSET);
diff --git a/arch/arm/mach-davinci/mux.c b/arch/arm/mach-davinci/mux.c
index bbba0b247a44..d310f579aa85 100644
--- a/arch/arm/mach-davinci/mux.c
+++ b/arch/arm/mach-davinci/mux.c
@@ -21,18 +21,7 @@
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/mux.h> 23#include <mach/mux.h>
24 24#include <mach/common.h>
25static const struct mux_config *mux_table;
26static unsigned long pin_table_sz;
27
28int __init davinci_mux_register(const struct mux_config *pins,
29 unsigned long size)
30{
31 mux_table = pins;
32 pin_table_sz = size;
33
34 return 0;
35}
36 25
37/* 26/*
38 * Sets the DAVINCI MUX register based on the table 27 * Sets the DAVINCI MUX register based on the table
@@ -40,23 +29,24 @@ int __init davinci_mux_register(const struct mux_config *pins,
40int __init_or_module davinci_cfg_reg(const unsigned long index) 29int __init_or_module davinci_cfg_reg(const unsigned long index)
41{ 30{
42 static DEFINE_SPINLOCK(mux_spin_lock); 31 static DEFINE_SPINLOCK(mux_spin_lock);
43 void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE); 32 struct davinci_soc_info *soc_info = &davinci_soc_info;
33 void __iomem *base = soc_info->pinmux_base;
44 unsigned long flags; 34 unsigned long flags;
45 const struct mux_config *cfg; 35 const struct mux_config *cfg;
46 unsigned int reg_orig = 0, reg = 0; 36 unsigned int reg_orig = 0, reg = 0;
47 unsigned int mask, warn = 0; 37 unsigned int mask, warn = 0;
48 38
49 if (!mux_table) 39 if (!soc_info->pinmux_pins)
50 BUG(); 40 BUG();
51 41
52 if (index >= pin_table_sz) { 42 if (index >= soc_info->pinmux_pins_num) {
53 printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n", 43 printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
54 index, pin_table_sz); 44 index, soc_info->pinmux_pins_num);
55 dump_stack(); 45 dump_stack();
56 return -ENODEV; 46 return -ENODEV;
57 } 47 }
58 48
59 cfg = &mux_table[index]; 49 cfg = &soc_info->pinmux_pins[index];
60 50
61 if (cfg->name == NULL) { 51 if (cfg->name == NULL) {
62 printk(KERN_ERR "No entry for the specified index\n"); 52 printk(KERN_ERR "No entry for the specified index\n");
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c
index 84171abf5f7b..a78b657e916e 100644
--- a/arch/arm/mach-davinci/psc.c
+++ b/arch/arm/mach-davinci/psc.c
@@ -28,8 +28,6 @@
28#include <mach/psc.h> 28#include <mach/psc.h>
29#include <mach/mux.h> 29#include <mach/mux.h>
30 30
31#define DAVINCI_PWR_SLEEP_CNTRL_BASE 0x01C41000
32
33/* PSC register offsets */ 31/* PSC register offsets */
34#define EPCPR 0x070 32#define EPCPR 0x070
35#define PTCMD 0x120 33#define PTCMD 0x120
@@ -42,22 +40,42 @@
42#define MDSTAT_STATE_MASK 0x1f 40#define MDSTAT_STATE_MASK 0x1f
43 41
44/* Return nonzero iff the domain's clock is active */ 42/* Return nonzero iff the domain's clock is active */
45int __init davinci_psc_is_clk_active(unsigned int id) 43int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
46{ 44{
47 void __iomem *psc_base = IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE); 45 void __iomem *psc_base;
48 u32 mdstat = __raw_readl(psc_base + MDSTAT + 4 * id); 46 u32 mdstat;
47 struct davinci_soc_info *soc_info = &davinci_soc_info;
48
49 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
50 pr_warning("PSC: Bad psc data: 0x%x[%d]\n",
51 (int)soc_info->psc_bases, ctlr);
52 return 0;
53 }
54
55 psc_base = soc_info->psc_bases[ctlr];
56 mdstat = __raw_readl(psc_base + MDSTAT + 4 * id);
49 57
50 /* if clocked, state can be "Enable" or "SyncReset" */ 58 /* if clocked, state can be "Enable" or "SyncReset" */
51 return mdstat & BIT(12); 59 return mdstat & BIT(12);
52} 60}
53 61
54/* Enable or disable a PSC domain */ 62/* Enable or disable a PSC domain */
55void davinci_psc_config(unsigned int domain, unsigned int id, char enable) 63void davinci_psc_config(unsigned int domain, unsigned int ctlr,
64 unsigned int id, char enable)
56{ 65{
57 u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl; 66 u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl;
58 void __iomem *psc_base = IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE); 67 void __iomem *psc_base;
68 struct davinci_soc_info *soc_info = &davinci_soc_info;
59 u32 next_state = enable ? 0x3 : 0x2; /* 0x3 enables, 0x2 disables */ 69 u32 next_state = enable ? 0x3 : 0x2; /* 0x3 enables, 0x2 disables */
60 70
71 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
72 pr_warning("PSC: Bad psc data: 0x%x[%d]\n",
73 (int)soc_info->psc_bases, ctlr);
74 return;
75 }
76
77 psc_base = soc_info->psc_bases[ctlr];
78
61 mdctl = __raw_readl(psc_base + MDCTL + 4 * id); 79 mdctl = __raw_readl(psc_base + MDCTL + 4 * id);
62 mdctl &= ~MDSTAT_STATE_MASK; 80 mdctl &= ~MDSTAT_STATE_MASK;
63 mdctl |= next_state; 81 mdctl |= next_state;
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index 695075796522..c530c7333d0a 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -33,6 +33,8 @@
33#include <mach/serial.h> 33#include <mach/serial.h>
34#include <mach/irqs.h> 34#include <mach/irqs.h>
35#include <mach/cputype.h> 35#include <mach/cputype.h>
36#include <mach/common.h>
37
36#include "clock.h" 38#include "clock.h"
37 39
38static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, 40static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
@@ -49,44 +51,6 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
49 __raw_writel(value, IO_ADDRESS(p->mapbase) + offset); 51 __raw_writel(value, IO_ADDRESS(p->mapbase) + offset);
50} 52}
51 53
52static struct plat_serial8250_port serial_platform_data[] = {
53 {
54 .mapbase = DAVINCI_UART0_BASE,
55 .irq = IRQ_UARTINT0,
56 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
57 UPF_IOREMAP,
58 .iotype = UPIO_MEM,
59 .regshift = 2,
60 },
61 {
62 .mapbase = DAVINCI_UART1_BASE,
63 .irq = IRQ_UARTINT1,
64 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
65 UPF_IOREMAP,
66 .iotype = UPIO_MEM,
67 .regshift = 2,
68 },
69 {
70 .mapbase = DAVINCI_UART2_BASE,
71 .irq = IRQ_UARTINT2,
72 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
73 UPF_IOREMAP,
74 .iotype = UPIO_MEM,
75 .regshift = 2,
76 },
77 {
78 .flags = 0
79 },
80};
81
82static struct platform_device serial_device = {
83 .name = "serial8250",
84 .id = PLAT8250_DEV_PLATFORM,
85 .dev = {
86 .platform_data = serial_platform_data,
87 },
88};
89
90static void __init davinci_serial_reset(struct plat_serial8250_port *p) 54static void __init davinci_serial_reset(struct plat_serial8250_port *p)
91{ 55{
92 unsigned int pwremu = 0; 56 unsigned int pwremu = 0;
@@ -106,35 +70,22 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
106 UART_DM646X_SCR_TX_WATERMARK); 70 UART_DM646X_SCR_TX_WATERMARK);
107} 71}
108 72
109void __init davinci_serial_init(struct davinci_uart_config *info) 73int __init davinci_serial_init(struct davinci_uart_config *info)
110{ 74{
111 int i; 75 int i;
112 char name[16]; 76 char name[16];
113 struct clk *uart_clk; 77 struct clk *uart_clk;
114 struct device *dev = &serial_device.dev; 78 struct davinci_soc_info *soc_info = &davinci_soc_info;
79 struct device *dev = &soc_info->serial_dev->dev;
80 struct plat_serial8250_port *p = dev->platform_data;
115 81
116 /* 82 /*
117 * Make sure the serial ports are muxed on at this point. 83 * Make sure the serial ports are muxed on at this point.
118 * You have to mux them off in device drivers later on 84 * You have to mux them off in device drivers later on if not needed.
119 * if not needed.
120 */ 85 */
121 for (i = 0; i < DAVINCI_MAX_NR_UARTS; i++) { 86 for (i = 0; i < DAVINCI_MAX_NR_UARTS; i++, p++) {
122 struct plat_serial8250_port *p = serial_platform_data + i; 87 if (!(info->enabled_uarts & (1 << i)))
123
124 if (!(info->enabled_uarts & (1 << i))) {
125 p->flags = 0;
126 continue; 88 continue;
127 }
128
129 if (cpu_is_davinci_dm646x())
130 p->iotype = UPIO_MEM32;
131
132 if (cpu_is_davinci_dm355()) {
133 if (i == 2) {
134 p->mapbase = (unsigned long)DM355_UART2_BASE;
135 p->irq = IRQ_DM355_UARTINT2;
136 }
137 }
138 89
139 sprintf(name, "uart%d", i); 90 sprintf(name, "uart%d", i);
140 uart_clk = clk_get(dev, name); 91 uart_clk = clk_get(dev, name);
@@ -147,11 +98,6 @@ void __init davinci_serial_init(struct davinci_uart_config *info)
147 davinci_serial_reset(p); 98 davinci_serial_reset(p);
148 } 99 }
149 } 100 }
150}
151 101
152static int __init davinci_init(void) 102 return platform_device_register(soc_info->serial_dev);
153{
154 return platform_device_register(&serial_device);
155} 103}
156
157arch_initcall(davinci_init);
diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c
new file mode 100644
index 000000000000..db54b2a66b4d
--- /dev/null
+++ b/arch/arm/mach-davinci/sram.c
@@ -0,0 +1,74 @@
1/*
2 * mach-davinci/sram.c - DaVinci simple SRAM allocator
3 *
4 * Copyright (C) 2009 David Brownell
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; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/genalloc.h>
15
16#include <mach/common.h>
17#include <mach/memory.h>
18#include <mach/sram.h>
19
20
21static struct gen_pool *sram_pool;
22
23void *sram_alloc(size_t len, dma_addr_t *dma)
24{
25 unsigned long vaddr;
26 dma_addr_t dma_base = davinci_soc_info.sram_dma;
27
28 if (dma)
29 *dma = 0;
30 if (!sram_pool || (dma && !dma_base))
31 return NULL;
32
33 vaddr = gen_pool_alloc(sram_pool, len);
34 if (!vaddr)
35 return NULL;
36
37 if (dma)
38 *dma = dma_base + (vaddr - SRAM_VIRT);
39 return (void *)vaddr;
40
41}
42EXPORT_SYMBOL(sram_alloc);
43
44void sram_free(void *addr, size_t len)
45{
46 gen_pool_free(sram_pool, (unsigned long) addr, len);
47}
48EXPORT_SYMBOL(sram_free);
49
50
51/*
52 * REVISIT This supports CPU and DMA access to/from SRAM, but it
53 * doesn't (yet?) support some other notable uses of SRAM: as TCM
54 * for data and/or instructions; and holding code needed to enter
55 * and exit suspend states (while DRAM can't be used).
56 */
57static int __init sram_init(void)
58{
59 unsigned len = davinci_soc_info.sram_len;
60 int status = 0;
61
62 if (len) {
63 len = min(len, SRAM_SIZE);
64 sram_pool = gen_pool_create(ilog2(SRAM_GRANULARITY), -1);
65 if (!sram_pool)
66 status = -ENOMEM;
67 }
68 if (sram_pool)
69 status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1);
70 WARN_ON(status < 0);
71 return status;
72}
73core_initcall(sram_init);
74
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 494e01bff5c3..0884ca57bfb0 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -19,6 +19,7 @@
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/platform_device.h>
22 23
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <asm/system.h> 25#include <asm/system.h>
@@ -28,52 +29,41 @@
28#include <asm/errno.h> 29#include <asm/errno.h>
29#include <mach/io.h> 30#include <mach/io.h>
30#include <mach/cputype.h> 31#include <mach/cputype.h>
32#include <mach/time.h>
31#include "clock.h" 33#include "clock.h"
32 34
33static struct clock_event_device clockevent_davinci; 35static struct clock_event_device clockevent_davinci;
34static unsigned int davinci_clock_tick_rate; 36static unsigned int davinci_clock_tick_rate;
35 37
36#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
37#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
38#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
39
40enum {
41 T0_BOT = 0, T0_TOP, T1_BOT, T1_TOP, NUM_TIMERS,
42};
43
44#define IS_TIMER1(id) (id & 0x2)
45#define IS_TIMER0(id) (!IS_TIMER1(id))
46#define IS_TIMER_TOP(id) ((id & 0x1))
47#define IS_TIMER_BOT(id) (!IS_TIMER_TOP(id))
48
49static int timer_irqs[NUM_TIMERS] = {
50 IRQ_TINT0_TINT12,
51 IRQ_TINT0_TINT34,
52 IRQ_TINT1_TINT12,
53 IRQ_TINT1_TINT34,
54};
55
56/* 38/*
57 * This driver configures the 2 64-bit count-up timers as 4 independent 39 * This driver configures the 2 64-bit count-up timers as 4 independent
58 * 32-bit count-up timers used as follows: 40 * 32-bit count-up timers used as follows:
59 *
60 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers
61 * T0_TOP: Timer 0, top : clocksource for generic timekeeping
62 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
63 * T1_TOP: Timer 1, top : <unused>
64 */ 41 */
65#define TID_CLOCKEVENT T0_BOT 42
66#define TID_CLOCKSOURCE T0_TOP 43enum {
44 TID_CLOCKEVENT,
45 TID_CLOCKSOURCE,
46};
67 47
68/* Timer register offsets */ 48/* Timer register offsets */
69#define PID12 0x0 49#define PID12 0x0
70#define TIM12 0x10 50#define TIM12 0x10
71#define TIM34 0x14 51#define TIM34 0x14
72#define PRD12 0x18 52#define PRD12 0x18
73#define PRD34 0x1c 53#define PRD34 0x1c
74#define TCR 0x20 54#define TCR 0x20
75#define TGCR 0x24 55#define TGCR 0x24
76#define WDTCR 0x28 56#define WDTCR 0x28
57
58/* Offsets of the 8 compare registers */
59#define CMP12_0 0x60
60#define CMP12_1 0x64
61#define CMP12_2 0x68
62#define CMP12_3 0x6c
63#define CMP12_4 0x70
64#define CMP12_5 0x74
65#define CMP12_6 0x78
66#define CMP12_7 0x7c
77 67
78/* Timer register bitfields */ 68/* Timer register bitfields */
79#define TCR_ENAMODE_DISABLE 0x0 69#define TCR_ENAMODE_DISABLE 0x0
@@ -105,6 +95,7 @@ struct timer_s {
105 unsigned int id; 95 unsigned int id;
106 unsigned long period; 96 unsigned long period;
107 unsigned long opts; 97 unsigned long opts;
98 unsigned long flags;
108 void __iomem *base; 99 void __iomem *base;
109 unsigned long tim_off; 100 unsigned long tim_off;
110 unsigned long prd_off; 101 unsigned long prd_off;
@@ -114,30 +105,58 @@ struct timer_s {
114static struct timer_s timers[]; 105static struct timer_s timers[];
115 106
116/* values for 'opts' field of struct timer_s */ 107/* values for 'opts' field of struct timer_s */
117#define TIMER_OPTS_DISABLED 0x00 108#define TIMER_OPTS_DISABLED 0x01
118#define TIMER_OPTS_ONESHOT 0x01 109#define TIMER_OPTS_ONESHOT 0x02
119#define TIMER_OPTS_PERIODIC 0x02 110#define TIMER_OPTS_PERIODIC 0x04
111#define TIMER_OPTS_STATE_MASK 0x07
112
113#define TIMER_OPTS_USE_COMPARE 0x80000000
114#define USING_COMPARE(t) ((t)->opts & TIMER_OPTS_USE_COMPARE)
115
116static char *id_to_name[] = {
117 [T0_BOT] = "timer0_0",
118 [T0_TOP] = "timer0_1",
119 [T1_BOT] = "timer1_0",
120 [T1_TOP] = "timer1_1",
121};
120 122
121static int timer32_config(struct timer_s *t) 123static int timer32_config(struct timer_s *t)
122{ 124{
123 u32 tcr = __raw_readl(t->base + TCR); 125 u32 tcr;
124 126 struct davinci_soc_info *soc_info = &davinci_soc_info;
125 /* disable timer */ 127
126 tcr &= ~(TCR_ENAMODE_MASK << t->enamode_shift); 128 if (USING_COMPARE(t)) {
127 __raw_writel(tcr, t->base + TCR); 129 struct davinci_timer_instance *dtip =
128 130 soc_info->timer_info->timers;
129 /* reset counter to zero, set new period */ 131 int event_timer = ID_TO_TIMER(timers[TID_CLOCKEVENT].id);
130 __raw_writel(0, t->base + t->tim_off); 132
131 __raw_writel(t->period, t->base + t->prd_off); 133 /*
132 134 * Next interrupt should be the current time reg value plus
133 /* Set enable mode */ 135 * the new period (using 32-bit unsigned addition/wrapping
134 if (t->opts & TIMER_OPTS_ONESHOT) { 136 * to 0 on overflow). This assumes that the clocksource
135 tcr |= TCR_ENAMODE_ONESHOT << t->enamode_shift; 137 * is setup to count to 2^32-1 before wrapping around to 0.
136 } else if (t->opts & TIMER_OPTS_PERIODIC) { 138 */
137 tcr |= TCR_ENAMODE_PERIODIC << t->enamode_shift; 139 __raw_writel(__raw_readl(t->base + t->tim_off) + t->period,
140 t->base + dtip[event_timer].cmp_off);
141 } else {
142 tcr = __raw_readl(t->base + TCR);
143
144 /* disable timer */
145 tcr &= ~(TCR_ENAMODE_MASK << t->enamode_shift);
146 __raw_writel(tcr, t->base + TCR);
147
148 /* reset counter to zero, set new period */
149 __raw_writel(0, t->base + t->tim_off);
150 __raw_writel(t->period, t->base + t->prd_off);
151
152 /* Set enable mode */
153 if (t->opts & TIMER_OPTS_ONESHOT)
154 tcr |= TCR_ENAMODE_ONESHOT << t->enamode_shift;
155 else if (t->opts & TIMER_OPTS_PERIODIC)
156 tcr |= TCR_ENAMODE_PERIODIC << t->enamode_shift;
157
158 __raw_writel(tcr, t->base + TCR);
138 } 159 }
139
140 __raw_writel(tcr, t->base + TCR);
141 return 0; 160 return 0;
142} 161}
143 162
@@ -182,13 +201,14 @@ static struct timer_s timers[] = {
182 201
183static void __init timer_init(void) 202static void __init timer_init(void)
184{ 203{
185 u32 phys_bases[] = {DAVINCI_TIMER0_BASE, DAVINCI_TIMER1_BASE}; 204 struct davinci_soc_info *soc_info = &davinci_soc_info;
205 struct davinci_timer_instance *dtip = soc_info->timer_info->timers;
186 int i; 206 int i;
187 207
188 /* Global init of each 64-bit timer as a whole */ 208 /* Global init of each 64-bit timer as a whole */
189 for(i=0; i<2; i++) { 209 for(i=0; i<2; i++) {
190 u32 tgcr; 210 u32 tgcr;
191 void __iomem *base = IO_ADDRESS(phys_bases[i]); 211 void __iomem *base = dtip[i].base;
192 212
193 /* Disabled, Internal clock source */ 213 /* Disabled, Internal clock source */
194 __raw_writel(0, base + TCR); 214 __raw_writel(0, base + TCR);
@@ -214,33 +234,33 @@ static void __init timer_init(void)
214 /* Init of each timer as a 32-bit timer */ 234 /* Init of each timer as a 32-bit timer */
215 for (i=0; i< ARRAY_SIZE(timers); i++) { 235 for (i=0; i< ARRAY_SIZE(timers); i++) {
216 struct timer_s *t = &timers[i]; 236 struct timer_s *t = &timers[i];
217 u32 phys_base; 237 int timer = ID_TO_TIMER(t->id);
218 238 u32 irq;
219 if (t->name) { 239
220 t->id = i; 240 t->base = dtip[timer].base;
221 phys_base = (IS_TIMER1(t->id) ? 241
222 DAVINCI_TIMER1_BASE : DAVINCI_TIMER0_BASE); 242 if (IS_TIMER_BOT(t->id)) {
223 t->base = IO_ADDRESS(phys_base); 243 t->enamode_shift = 6;
224 244 t->tim_off = TIM12;
225 if (IS_TIMER_BOT(t->id)) { 245 t->prd_off = PRD12;
226 t->enamode_shift = 6; 246 irq = dtip[timer].bottom_irq;
227 t->tim_off = TIM12; 247 } else {
228 t->prd_off = PRD12; 248 t->enamode_shift = 22;
229 } else { 249 t->tim_off = TIM34;
230 t->enamode_shift = 22; 250 t->prd_off = PRD34;
231 t->tim_off = TIM34; 251 irq = dtip[timer].top_irq;
232 t->prd_off = PRD34; 252 }
233 } 253
234 254 /* Register interrupt */
235 /* Register interrupt */ 255 t->irqaction.name = t->name;
236 t->irqaction.name = t->name; 256 t->irqaction.dev_id = (void *)t;
237 t->irqaction.dev_id = (void *)t; 257
238 if (t->irqaction.handler != NULL) { 258 if (t->irqaction.handler != NULL) {
239 setup_irq(timer_irqs[t->id], &t->irqaction); 259 irq = USING_COMPARE(t) ? dtip[i].cmp_irq : irq;
240 } 260 setup_irq(irq, &t->irqaction);
241
242 timer32_config(&timers[i]);
243 } 261 }
262
263 timer32_config(&timers[i]);
244 } 264 }
245} 265}
246 266
@@ -255,7 +275,6 @@ static cycle_t read_cycles(struct clocksource *cs)
255} 275}
256 276
257static struct clocksource clocksource_davinci = { 277static struct clocksource clocksource_davinci = {
258 .name = "timer0_1",
259 .rating = 300, 278 .rating = 300,
260 .read = read_cycles, 279 .read = read_cycles,
261 .mask = CLOCKSOURCE_MASK(32), 280 .mask = CLOCKSOURCE_MASK(32),
@@ -284,15 +303,18 @@ static void davinci_set_mode(enum clock_event_mode mode,
284 switch (mode) { 303 switch (mode) {
285 case CLOCK_EVT_MODE_PERIODIC: 304 case CLOCK_EVT_MODE_PERIODIC:
286 t->period = davinci_clock_tick_rate / (HZ); 305 t->period = davinci_clock_tick_rate / (HZ);
287 t->opts = TIMER_OPTS_PERIODIC; 306 t->opts &= ~TIMER_OPTS_STATE_MASK;
307 t->opts |= TIMER_OPTS_PERIODIC;
288 timer32_config(t); 308 timer32_config(t);
289 break; 309 break;
290 case CLOCK_EVT_MODE_ONESHOT: 310 case CLOCK_EVT_MODE_ONESHOT:
291 t->opts = TIMER_OPTS_ONESHOT; 311 t->opts &= ~TIMER_OPTS_STATE_MASK;
312 t->opts |= TIMER_OPTS_ONESHOT;
292 break; 313 break;
293 case CLOCK_EVT_MODE_UNUSED: 314 case CLOCK_EVT_MODE_UNUSED:
294 case CLOCK_EVT_MODE_SHUTDOWN: 315 case CLOCK_EVT_MODE_SHUTDOWN:
295 t->opts = TIMER_OPTS_DISABLED; 316 t->opts &= ~TIMER_OPTS_STATE_MASK;
317 t->opts |= TIMER_OPTS_DISABLED;
296 break; 318 break;
297 case CLOCK_EVT_MODE_RESUME: 319 case CLOCK_EVT_MODE_RESUME:
298 break; 320 break;
@@ -300,7 +322,6 @@ static void davinci_set_mode(enum clock_event_mode mode,
300} 322}
301 323
302static struct clock_event_device clockevent_davinci = { 324static struct clock_event_device clockevent_davinci = {
303 .name = "timer0_0",
304 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 325 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
305 .shift = 32, 326 .shift = 32,
306 .set_next_event = davinci_set_next_event, 327 .set_next_event = davinci_set_next_event,
@@ -311,10 +332,42 @@ static struct clock_event_device clockevent_davinci = {
311static void __init davinci_timer_init(void) 332static void __init davinci_timer_init(void)
312{ 333{
313 struct clk *timer_clk; 334 struct clk *timer_clk;
314 335 struct davinci_soc_info *soc_info = &davinci_soc_info;
336 unsigned int clockevent_id;
337 unsigned int clocksource_id;
315 static char err[] __initdata = KERN_ERR 338 static char err[] __initdata = KERN_ERR
316 "%s: can't register clocksource!\n"; 339 "%s: can't register clocksource!\n";
317 340
341 clockevent_id = soc_info->timer_info->clockevent_id;
342 clocksource_id = soc_info->timer_info->clocksource_id;
343
344 timers[TID_CLOCKEVENT].id = clockevent_id;
345 timers[TID_CLOCKSOURCE].id = clocksource_id;
346
347 /*
348 * If using same timer for both clock events & clocksource,
349 * a compare register must be used to generate an event interrupt.
350 * This is equivalent to a oneshot timer only (not periodic).
351 */
352 if (clockevent_id == clocksource_id) {
353 struct davinci_timer_instance *dtip =
354 soc_info->timer_info->timers;
355 int event_timer = ID_TO_TIMER(clockevent_id);
356
357 /* Only bottom timers can use compare regs */
358 if (IS_TIMER_TOP(clockevent_id))
359 pr_warning("davinci_timer_init: Invalid use"
360 " of system timers. Results unpredictable.\n");
361 else if ((dtip[event_timer].cmp_off == 0)
362 || (dtip[event_timer].cmp_irq == 0))
363 pr_warning("davinci_timer_init: Invalid timer instance"
364 " setup. Results unpredictable.\n");
365 else {
366 timers[TID_CLOCKEVENT].opts |= TIMER_OPTS_USE_COMPARE;
367 clockevent_davinci.features = CLOCK_EVT_FEAT_ONESHOT;
368 }
369 }
370
318 /* init timer hw */ 371 /* init timer hw */
319 timer_init(); 372 timer_init();
320 373
@@ -325,6 +378,7 @@ static void __init davinci_timer_init(void)
325 davinci_clock_tick_rate = clk_get_rate(timer_clk); 378 davinci_clock_tick_rate = clk_get_rate(timer_clk);
326 379
327 /* setup clocksource */ 380 /* setup clocksource */
381 clocksource_davinci.name = id_to_name[clocksource_id];
328 clocksource_davinci.mult = 382 clocksource_davinci.mult =
329 clocksource_khz2mult(davinci_clock_tick_rate/1000, 383 clocksource_khz2mult(davinci_clock_tick_rate/1000,
330 clocksource_davinci.shift); 384 clocksource_davinci.shift);
@@ -332,12 +386,12 @@ static void __init davinci_timer_init(void)
332 printk(err, clocksource_davinci.name); 386 printk(err, clocksource_davinci.name);
333 387
334 /* setup clockevent */ 388 /* setup clockevent */
389 clockevent_davinci.name = id_to_name[timers[TID_CLOCKEVENT].id];
335 clockevent_davinci.mult = div_sc(davinci_clock_tick_rate, NSEC_PER_SEC, 390 clockevent_davinci.mult = div_sc(davinci_clock_tick_rate, NSEC_PER_SEC,
336 clockevent_davinci.shift); 391 clockevent_davinci.shift);
337 clockevent_davinci.max_delta_ns = 392 clockevent_davinci.max_delta_ns =
338 clockevent_delta2ns(0xfffffffe, &clockevent_davinci); 393 clockevent_delta2ns(0xfffffffe, &clockevent_davinci);
339 clockevent_davinci.min_delta_ns = 394 clockevent_davinci.min_delta_ns = 50000; /* 50 usec */
340 clockevent_delta2ns(1, &clockevent_davinci);
341 395
342 clockevent_davinci.cpumask = cpumask_of(0); 396 clockevent_davinci.cpumask = cpumask_of(0);
343 clockevents_register_device(&clockevent_davinci); 397 clockevents_register_device(&clockevent_davinci);
@@ -349,15 +403,14 @@ struct sys_timer davinci_timer = {
349 403
350 404
351/* reset board using watchdog timer */ 405/* reset board using watchdog timer */
352void davinci_watchdog_reset(void) { 406void davinci_watchdog_reset(void)
407{
353 u32 tgcr, wdtcr; 408 u32 tgcr, wdtcr;
354 void __iomem *base = IO_ADDRESS(DAVINCI_WDOG_BASE); 409 struct davinci_soc_info *soc_info = &davinci_soc_info;
355 struct device dev; 410 void __iomem *base = soc_info->wdt_base;
356 struct clk *wd_clk; 411 struct clk *wd_clk;
357 char *name = "watchdog";
358 412
359 dev_set_name(&dev, name); 413 wd_clk = clk_get(&davinci_wdt_device.dev, NULL);
360 wd_clk = clk_get(&dev, NULL);
361 if (WARN_ON(IS_ERR(wd_clk))) 414 if (WARN_ON(IS_ERR(wd_clk)))
362 return; 415 return;
363 clk_enable(wd_clk); 416 clk_enable(wd_clk);
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 56bddcef6905..d7291c682a64 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -9,87 +9,135 @@ config CRUNCH
9 9
10comment "EP93xx Platforms" 10comment "EP93xx Platforms"
11 11
12choice
13 prompt "EP93xx first SDRAM bank selection"
14 default EP93XX_SDCE3_SYNC_PHYS_OFFSET
15
16config EP93XX_SDCE3_SYNC_PHYS_OFFSET
17 bool "0x00000000 - SDCE3/SyncBoot"
18 help
19 Select this option if you want support for EP93xx boards with the
20 first SDRAM bank at 0x00000000
21
22config EP93XX_SDCE0_PHYS_OFFSET
23 bool "0xc0000000 - SDCEO"
24 help
25 Select this option if you want support for EP93xx boards with the
26 first SDRAM bank at 0xc0000000
27
28endchoice
29
12config MACH_ADSSPHERE 30config MACH_ADSSPHERE
13 bool "Support ADS Sphere" 31 bool "Support ADS Sphere"
32 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
14 help 33 help
15 Say 'Y' here if you want your kernel to support the ADS 34 Say 'Y' here if you want your kernel to support the ADS
16 Sphere board. 35 Sphere board.
17 36
37config MACH_EDB93XX
38 bool
39
40config MACH_EDB9301
41 bool "Support Cirrus Logic EDB9301"
42 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
43 select MACH_EDB93XX
44 help
45 Say 'Y' here if you want your kernel to support the Cirrus
46 Logic EDB9301 Evaluation Board.
47
18config MACH_EDB9302 48config MACH_EDB9302
19 bool "Support Cirrus Logic EDB9302" 49 bool "Support Cirrus Logic EDB9302"
50 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
51 select MACH_EDB93XX
20 help 52 help
21 Say 'Y' here if you want your kernel to support the Cirrus 53 Say 'Y' here if you want your kernel to support the Cirrus
22 Logic EDB9302 Evaluation Board. 54 Logic EDB9302 Evaluation Board.
23 55
24config MACH_EDB9302A 56config MACH_EDB9302A
25 bool "Support Cirrus Logic EDB9302A" 57 bool "Support Cirrus Logic EDB9302A"
58 depends on EP93XX_SDCE0_PHYS_OFFSET
59 select MACH_EDB93XX
26 help 60 help
27 Say 'Y' here if you want your kernel to support the Cirrus 61 Say 'Y' here if you want your kernel to support the Cirrus
28 Logic EDB9302A Evaluation Board. 62 Logic EDB9302A Evaluation Board.
29 63
30config MACH_EDB9307 64config MACH_EDB9307
31 bool "Support Cirrus Logic EDB9307" 65 bool "Support Cirrus Logic EDB9307"
66 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
67 select MACH_EDB93XX
32 help 68 help
33 Say 'Y' here if you want your kernel to support the Cirrus 69 Say 'Y' here if you want your kernel to support the Cirrus
34 Logic EDB9307 Evaluation Board. 70 Logic EDB9307 Evaluation Board.
35 71
36config MACH_EDB9307A 72config MACH_EDB9307A
37 bool "Support Cirrus Logic EDB9307A" 73 bool "Support Cirrus Logic EDB9307A"
74 depends on EP93XX_SDCE0_PHYS_OFFSET
75 select MACH_EDB93XX
38 help 76 help
39 Say 'Y' here if you want your kernel to support the Cirrus 77 Say 'Y' here if you want your kernel to support the Cirrus
40 Logic EDB9307A Evaluation Board. 78 Logic EDB9307A Evaluation Board.
41 79
42config MACH_EDB9312 80config MACH_EDB9312
43 bool "Support Cirrus Logic EDB9312" 81 bool "Support Cirrus Logic EDB9312"
82 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
83 select MACH_EDB93XX
44 help 84 help
45 Say 'Y' here if you want your kernel to support the Cirrus 85 Say 'Y' here if you want your kernel to support the Cirrus
46 Logic EDB9312 Evaluation Board. 86 Logic EDB9312 Evaluation Board.
47 87
48config MACH_EDB9315 88config MACH_EDB9315
49 bool "Support Cirrus Logic EDB9315" 89 bool "Support Cirrus Logic EDB9315"
90 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
91 select MACH_EDB93XX
50 help 92 help
51 Say 'Y' here if you want your kernel to support the Cirrus 93 Say 'Y' here if you want your kernel to support the Cirrus
52 Logic EDB9315 Evaluation Board. 94 Logic EDB9315 Evaluation Board.
53 95
54config MACH_EDB9315A 96config MACH_EDB9315A
55 bool "Support Cirrus Logic EDB9315A" 97 bool "Support Cirrus Logic EDB9315A"
98 depends on EP93XX_SDCE0_PHYS_OFFSET
99 select MACH_EDB93XX
56 help 100 help
57 Say 'Y' here if you want your kernel to support the Cirrus 101 Say 'Y' here if you want your kernel to support the Cirrus
58 Logic EDB9315A Evaluation Board. 102 Logic EDB9315A Evaluation Board.
59 103
60config MACH_GESBC9312 104config MACH_GESBC9312
105 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
61 bool "Support Glomation GESBC-9312-sx" 106 bool "Support Glomation GESBC-9312-sx"
62 help 107 help
63 Say 'Y' here if you want your kernel to support the Glomation 108 Say 'Y' here if you want your kernel to support the Glomation
64 GESBC-9312-sx board. 109 GESBC-9312-sx board.
65 110
66config MACH_MICRO9 111config MACH_MICRO9
67 bool 112 bool
68 default n
69 113
70config MACH_MICRO9H 114config MACH_MICRO9H
71 bool "Support Contec Hypercontrol Micro9-H" 115 bool "Support Contec Hypercontrol Micro9-H"
72 select MACH_MICRO9 116 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
73 help 117 select MACH_MICRO9
74 Say 'Y' here if you want your kernel to support the 118 help
75 Contec Hypercontrol Micro9-H board. 119 Say 'Y' here if you want your kernel to support the
120 Contec Hypercontrol Micro9-H board.
76 121
77config MACH_MICRO9M 122config MACH_MICRO9M
78 bool "Support Contec Hypercontrol Micro9-M" 123 bool "Support Contec Hypercontrol Micro9-M"
79 select MACH_MICRO9 124 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
80 help 125 select MACH_MICRO9
81 Say 'Y' here if you want your kernel to support the 126 help
82 Contec Hypercontrol Micro9-M board. 127 Say 'Y' here if you want your kernel to support the
128 Contec Hypercontrol Micro9-M board.
83 129
84config MACH_MICRO9L 130config MACH_MICRO9L
85 bool "Support Contec Hypercontrol Micro9-L" 131 bool "Support Contec Hypercontrol Micro9-L"
86 select MACH_MICRO9 132 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
87 help 133 select MACH_MICRO9
88 Say 'Y' here if you want your kernel to support the 134 help
89 Contec Hypercontrol Micro9-L board. 135 Say 'Y' here if you want your kernel to support the
136 Contec Hypercontrol Micro9-L board.
90 137
91config MACH_TS72XX 138config MACH_TS72XX
92 bool "Support Technologic Systems TS-72xx SBC" 139 bool "Support Technologic Systems TS-72xx SBC"
140 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
93 help 141 help
94 Say 'Y' here if you want your kernel to support the 142 Say 'Y' here if you want your kernel to support the
95 Technologic Systems TS-72xx board. 143 Technologic Systems TS-72xx board.
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index 9522e205b73f..eae6199a9891 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -7,13 +7,7 @@ obj-n :=
7obj- := 7obj- :=
8 8
9obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o 9obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o
10obj-$(CONFIG_MACH_EDB9302) += edb9302.o 10obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o
11obj-$(CONFIG_MACH_EDB9302A) += edb9302a.o
12obj-$(CONFIG_MACH_EDB9307) += edb9307.o
13obj-$(CONFIG_MACH_EDB9307A) += edb9307a.o
14obj-$(CONFIG_MACH_EDB9312) += edb9312.o
15obj-$(CONFIG_MACH_EDB9315) += edb9315.o
16obj-$(CONFIG_MACH_EDB9315A) += edb9315a.o
17obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o 11obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
18obj-$(CONFIG_MACH_MICRO9) += micro9.o 12obj-$(CONFIG_MACH_MICRO9) += micro9.o
19obj-$(CONFIG_MACH_TS72XX) += ts72xx.o 13obj-$(CONFIG_MACH_TS72XX) += ts72xx.o
diff --git a/arch/arm/mach-ep93xx/Makefile.boot b/arch/arm/mach-ep93xx/Makefile.boot
index d5561ad15bad..27a085a8f12a 100644
--- a/arch/arm/mach-ep93xx/Makefile.boot
+++ b/arch/arm/mach-ep93xx/Makefile.boot
@@ -1,2 +1,5 @@
1 zreladdr-y := 0x00008000 1 zreladdr-$(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET) := 0x00008000
2params_phys-y := 0x00000100 2params_phys-$(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET) := 0x00000100
3
4 zreladdr-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET) := 0xc0008000
5params_phys-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET) := 0xc0000100
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index b2eede5531c8..6c4c1633ed12 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -72,58 +72,58 @@ static struct clk clk_h;
72static struct clk clk_p; 72static struct clk clk_p;
73static struct clk clk_pll2; 73static struct clk clk_pll2;
74static struct clk clk_usb_host = { 74static struct clk clk_usb_host = {
75 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 75 .enable_reg = EP93XX_SYSCON_PWRCNT,
76 .enable_mask = EP93XX_SYSCON_CLOCK_USH_EN, 76 .enable_mask = EP93XX_SYSCON_PWRCNT_USH_EN,
77}; 77};
78 78
79/* DMA Clocks */ 79/* DMA Clocks */
80static struct clk clk_m2p0 = { 80static struct clk clk_m2p0 = {
81 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 81 .enable_reg = EP93XX_SYSCON_PWRCNT,
82 .enable_mask = 0x00020000, 82 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P0,
83}; 83};
84static struct clk clk_m2p1 = { 84static struct clk clk_m2p1 = {
85 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 85 .enable_reg = EP93XX_SYSCON_PWRCNT,
86 .enable_mask = 0x00010000, 86 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P1,
87}; 87};
88static struct clk clk_m2p2 = { 88static struct clk clk_m2p2 = {
89 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 89 .enable_reg = EP93XX_SYSCON_PWRCNT,
90 .enable_mask = 0x00080000, 90 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P2,
91}; 91};
92static struct clk clk_m2p3 = { 92static struct clk clk_m2p3 = {
93 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 93 .enable_reg = EP93XX_SYSCON_PWRCNT,
94 .enable_mask = 0x00040000, 94 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P3,
95}; 95};
96static struct clk clk_m2p4 = { 96static struct clk clk_m2p4 = {
97 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 97 .enable_reg = EP93XX_SYSCON_PWRCNT,
98 .enable_mask = 0x00200000, 98 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P4,
99}; 99};
100static struct clk clk_m2p5 = { 100static struct clk clk_m2p5 = {
101 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 101 .enable_reg = EP93XX_SYSCON_PWRCNT,
102 .enable_mask = 0x00100000, 102 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P5,
103}; 103};
104static struct clk clk_m2p6 = { 104static struct clk clk_m2p6 = {
105 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 105 .enable_reg = EP93XX_SYSCON_PWRCNT,
106 .enable_mask = 0x00800000, 106 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P6,
107}; 107};
108static struct clk clk_m2p7 = { 108static struct clk clk_m2p7 = {
109 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 109 .enable_reg = EP93XX_SYSCON_PWRCNT,
110 .enable_mask = 0x00400000, 110 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P7,
111}; 111};
112static struct clk clk_m2p8 = { 112static struct clk clk_m2p8 = {
113 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 113 .enable_reg = EP93XX_SYSCON_PWRCNT,
114 .enable_mask = 0x02000000, 114 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P8,
115}; 115};
116static struct clk clk_m2p9 = { 116static struct clk clk_m2p9 = {
117 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 117 .enable_reg = EP93XX_SYSCON_PWRCNT,
118 .enable_mask = 0x01000000, 118 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2P9,
119}; 119};
120static struct clk clk_m2m0 = { 120static struct clk clk_m2m0 = {
121 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 121 .enable_reg = EP93XX_SYSCON_PWRCNT,
122 .enable_mask = 0x04000000, 122 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2M0,
123}; 123};
124static struct clk clk_m2m1 = { 124static struct clk clk_m2m1 = {
125 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, 125 .enable_reg = EP93XX_SYSCON_PWRCNT,
126 .enable_mask = 0x08000000, 126 .enable_mask = EP93XX_SYSCON_PWRCNT_DMA_M2M1,
127}; 127};
128 128
129#define INIT_CK(dev,con,ck) \ 129#define INIT_CK(dev,con,ck) \
@@ -138,7 +138,7 @@ static struct clk_lookup clocks[] = {
138 INIT_CK(NULL, "hclk", &clk_h), 138 INIT_CK(NULL, "hclk", &clk_h),
139 INIT_CK(NULL, "pclk", &clk_p), 139 INIT_CK(NULL, "pclk", &clk_p),
140 INIT_CK(NULL, "pll2", &clk_pll2), 140 INIT_CK(NULL, "pll2", &clk_pll2),
141 INIT_CK(NULL, "usb_host", &clk_usb_host), 141 INIT_CK("ep93xx-ohci", NULL, &clk_usb_host),
142 INIT_CK(NULL, "m2p0", &clk_m2p0), 142 INIT_CK(NULL, "m2p0", &clk_m2p0),
143 INIT_CK(NULL, "m2p1", &clk_m2p1), 143 INIT_CK(NULL, "m2p1", &clk_m2p1),
144 INIT_CK(NULL, "m2p2", &clk_m2p2), 144 INIT_CK(NULL, "m2p2", &clk_m2p2),
@@ -186,8 +186,8 @@ static unsigned long get_uart_rate(struct clk *clk)
186{ 186{
187 u32 value; 187 u32 value;
188 188
189 value = __raw_readl(EP93XX_SYSCON_CLOCK_CONTROL); 189 value = __raw_readl(EP93XX_SYSCON_PWRCNT);
190 if (value & EP93XX_SYSCON_CLOCK_UARTBAUD) 190 if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
191 return EP93XX_EXT_CLK_RATE; 191 return EP93XX_EXT_CLK_RATE;
192 else 192 else
193 return EP93XX_EXT_CLK_RATE / 2; 193 return EP93XX_EXT_CLK_RATE / 2;
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index ae24486f858a..204dc5cbd0b8 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -155,7 +155,7 @@ static unsigned char gpio_int_unmasked[3];
155static unsigned char gpio_int_enabled[3]; 155static unsigned char gpio_int_enabled[3];
156static unsigned char gpio_int_type1[3]; 156static unsigned char gpio_int_type1[3];
157static unsigned char gpio_int_type2[3]; 157static unsigned char gpio_int_type2[3];
158static unsigned char gpio_int_debouce[3]; 158static unsigned char gpio_int_debounce[3];
159 159
160/* Port ordering is: A B F */ 160/* Port ordering is: A B F */
161static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; 161static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
@@ -192,11 +192,11 @@ void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
192 int port_mask = 1 << (line & 7); 192 int port_mask = 1 << (line & 7);
193 193
194 if (enable) 194 if (enable)
195 gpio_int_debouce[port] |= port_mask; 195 gpio_int_debounce[port] |= port_mask;
196 else 196 else
197 gpio_int_debouce[port] &= ~port_mask; 197 gpio_int_debounce[port] &= ~port_mask;
198 198
199 __raw_writeb(gpio_int_debouce[port], 199 __raw_writeb(gpio_int_debounce[port],
200 EP93XX_GPIO_REG(int_debounce_register_offset[port])); 200 EP93XX_GPIO_REG(int_debounce_register_offset[port]));
201} 201}
202EXPORT_SYMBOL(ep93xx_gpio_int_debounce); 202EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
@@ -362,8 +362,8 @@ void __init ep93xx_init_irq(void)
362{ 362{
363 int gpio_irq; 363 int gpio_irq;
364 364
365 vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK); 365 vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0);
366 vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK); 366 vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0);
367 367
368 for (gpio_irq = gpio_to_irq(0); 368 for (gpio_irq = gpio_to_irq(0);
369 gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) { 369 gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
@@ -450,10 +450,19 @@ static struct amba_device uart3_device = {
450}; 450};
451 451
452 452
453static struct resource ep93xx_rtc_resource[] = {
454 {
455 .start = EP93XX_RTC_PHYS_BASE,
456 .end = EP93XX_RTC_PHYS_BASE + 0x10c - 1,
457 .flags = IORESOURCE_MEM,
458 },
459};
460
453static struct platform_device ep93xx_rtc_device = { 461static struct platform_device ep93xx_rtc_device = {
454 .name = "ep93xx-rtc", 462 .name = "ep93xx-rtc",
455 .id = -1, 463 .id = -1,
456 .num_resources = 0, 464 .num_resources = ARRAY_SIZE(ep93xx_rtc_resource),
465 .resource = ep93xx_rtc_resource,
457}; 466};
458 467
459 468
diff --git a/arch/arm/mach-ep93xx/edb9302.c b/arch/arm/mach-ep93xx/edb9302.c
deleted file mode 100644
index 8bf8d7c78f1a..000000000000
--- a/arch/arm/mach-ep93xx/edb9302.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9302.c
3 * Cirrus Logic EDB9302 support.
4 *
5 * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mm.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mtd/physmap.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <mach/hardware.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27static struct physmap_flash_data edb9302_flash_data = {
28 .width = 2,
29};
30
31static struct resource edb9302_flash_resource = {
32 .start = EP93XX_CS6_PHYS_BASE,
33 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9302_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9302_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9302_flash_resource,
45};
46
47static struct ep93xx_eth_data edb9302_eth_data = {
48 .phy_id = 1,
49};
50
51static void __init edb9302_init_machine(void)
52{
53 ep93xx_init_devices();
54 platform_device_register(&edb9302_flash);
55
56 ep93xx_register_eth(&edb9302_eth_data, 1);
57}
58
59MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
60 /* Maintainer: George Kashperko <george@chas.com.ua> */
61 .phys_io = EP93XX_APB_PHYS_BASE,
62 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
63 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
64 .map_io = ep93xx_map_io,
65 .init_irq = ep93xx_init_irq,
66 .timer = &ep93xx_timer,
67 .init_machine = edb9302_init_machine,
68MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9302a.c b/arch/arm/mach-ep93xx/edb9302a.c
deleted file mode 100644
index a352c57c7b46..000000000000
--- a/arch/arm/mach-ep93xx/edb9302a.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9302a.c
3 * Cirrus Logic EDB9302A support.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mm.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mtd/physmap.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <mach/hardware.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27static struct physmap_flash_data edb9302a_flash_data = {
28 .width = 2,
29};
30
31static struct resource edb9302a_flash_resource = {
32 .start = EP93XX_CS6_PHYS_BASE,
33 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9302a_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9302a_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9302a_flash_resource,
45};
46
47static struct ep93xx_eth_data edb9302a_eth_data = {
48 .phy_id = 1,
49};
50
51static void __init edb9302a_init_machine(void)
52{
53 ep93xx_init_devices();
54 platform_device_register(&edb9302a_flash);
55
56 ep93xx_register_eth(&edb9302a_eth_data, 1);
57}
58
59MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
60 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
61 .phys_io = EP93XX_APB_PHYS_BASE,
62 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
63 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
64 .map_io = ep93xx_map_io,
65 .init_irq = ep93xx_init_irq,
66 .timer = &ep93xx_timer,
67 .init_machine = edb9302a_init_machine,
68MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9307.c b/arch/arm/mach-ep93xx/edb9307.c
deleted file mode 100644
index 5ab22f63a4eb..000000000000
--- a/arch/arm/mach-ep93xx/edb9307.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9307.c
3 * Cirrus Logic EDB9307 support.
4 *
5 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mm.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mtd/physmap.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <mach/hardware.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27static struct physmap_flash_data edb9307_flash_data = {
28 .width = 4,
29};
30
31static struct resource edb9307_flash_resource = {
32 .start = EP93XX_CS6_PHYS_BASE,
33 .end = EP93XX_CS6_PHYS_BASE + SZ_32M - 1,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9307_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9307_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9307_flash_resource,
45};
46
47static struct ep93xx_eth_data edb9307_eth_data = {
48 .phy_id = 1,
49};
50
51static void __init edb9307_init_machine(void)
52{
53 ep93xx_init_devices();
54 platform_device_register(&edb9307_flash);
55
56 ep93xx_register_eth(&edb9307_eth_data, 1);
57}
58
59MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
60 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
61 .phys_io = EP93XX_APB_PHYS_BASE,
62 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
63 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
64 .map_io = ep93xx_map_io,
65 .init_irq = ep93xx_init_irq,
66 .timer = &ep93xx_timer,
67 .init_machine = edb9307_init_machine,
68MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9307a.c b/arch/arm/mach-ep93xx/edb9307a.c
deleted file mode 100644
index 6171167d3315..000000000000
--- a/arch/arm/mach-ep93xx/edb9307a.c
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9307a.c
3 * Cirrus Logic EDB9307A support.
4 *
5 * Copyright (C) 2008 H Hartley Sweeten <hsweeten@visionengravers.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mm.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mtd/physmap.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <mach/hardware.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27static struct physmap_flash_data edb9307a_flash_data = {
28 .width = 2,
29};
30
31static struct resource edb9307a_flash_resource = {
32 .start = EP93XX_CS6_PHYS_BASE,
33 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9307a_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9307a_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9307a_flash_resource,
45};
46
47static struct ep93xx_eth_data edb9307a_eth_data = {
48 .phy_id = 1,
49};
50
51static struct i2c_board_info __initdata edb9307a_i2c_data[] = {
52 {
53 /* On-board battery backed RTC */
54 I2C_BOARD_INFO("isl1208", 0x6f),
55 },
56 /*
57 * The I2C signals are also routed to the Expansion Connector (J4)
58 */
59};
60
61static void __init edb9307a_init_machine(void)
62{
63 ep93xx_init_devices();
64 platform_device_register(&edb9307a_flash);
65
66 ep93xx_register_eth(&edb9307a_eth_data, 1);
67
68 ep93xx_init_i2c(edb9307a_i2c_data, ARRAY_SIZE(edb9307a_i2c_data));
69}
70
71MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
72 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
73 .phys_io = EP93XX_APB_PHYS_BASE,
74 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
75 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
76 .map_io = ep93xx_map_io,
77 .init_irq = ep93xx_init_irq,
78 .timer = &ep93xx_timer,
79 .init_machine = edb9307a_init_machine,
80MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9312.c b/arch/arm/mach-ep93xx/edb9312.c
deleted file mode 100644
index d7179f66d804..000000000000
--- a/arch/arm/mach-ep93xx/edb9312.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9312.c
3 * Cirrus Logic EDB9312 support.
4 *
5 * Copyright (C) 2006 Infosys Technologies Limited
6 * Toufeeq Hussain <toufeeq_hussain@infosys.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/mm.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/ioport.h>
20#include <linux/mtd/physmap.h>
21#include <linux/platform_device.h>
22#include <linux/io.h>
23#include <linux/i2c.h>
24#include <mach/hardware.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28static struct physmap_flash_data edb9312_flash_data = {
29 .width = 4,
30};
31
32static struct resource edb9312_flash_resource = {
33 .start = EP93XX_CS6_PHYS_BASE,
34 .end = EP93XX_CS6_PHYS_BASE + SZ_32M - 1,
35 .flags = IORESOURCE_MEM,
36};
37
38static struct platform_device edb9312_flash = {
39 .name = "physmap-flash",
40 .id = 0,
41 .dev = {
42 .platform_data = &edb9312_flash_data,
43 },
44 .num_resources = 1,
45 .resource = &edb9312_flash_resource,
46};
47
48static struct ep93xx_eth_data edb9312_eth_data = {
49 .phy_id = 1,
50};
51
52static void __init edb9312_init_machine(void)
53{
54 ep93xx_init_devices();
55 platform_device_register(&edb9312_flash);
56
57 ep93xx_register_eth(&edb9312_eth_data, 1);
58}
59
60MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
61 /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
62 .phys_io = EP93XX_APB_PHYS_BASE,
63 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
64 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
65 .map_io = ep93xx_map_io,
66 .init_irq = ep93xx_init_irq,
67 .timer = &ep93xx_timer,
68 .init_machine = edb9312_init_machine,
69MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9315.c b/arch/arm/mach-ep93xx/edb9315.c
deleted file mode 100644
index 025af6eaca10..000000000000
--- a/arch/arm/mach-ep93xx/edb9315.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9315.c
3 * Cirrus Logic EDB9315 support.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mm.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mtd/physmap.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <mach/hardware.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27static struct physmap_flash_data edb9315_flash_data = {
28 .width = 4,
29};
30
31static struct resource edb9315_flash_resource = {
32 .start = EP93XX_CS6_PHYS_BASE,
33 .end = EP93XX_CS6_PHYS_BASE + SZ_32M - 1,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9315_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9315_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9315_flash_resource,
45};
46
47static struct ep93xx_eth_data edb9315_eth_data = {
48 .phy_id = 1,
49};
50
51static void __init edb9315_init_machine(void)
52{
53 ep93xx_init_devices();
54 platform_device_register(&edb9315_flash);
55
56 ep93xx_register_eth(&edb9315_eth_data, 1);
57}
58
59MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
60 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
61 .phys_io = EP93XX_APB_PHYS_BASE,
62 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
63 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
64 .map_io = ep93xx_map_io,
65 .init_irq = ep93xx_init_irq,
66 .timer = &ep93xx_timer,
67 .init_machine = edb9315_init_machine,
68MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9315a.c b/arch/arm/mach-ep93xx/edb9315a.c
deleted file mode 100644
index 4c9cc8a39f5c..000000000000
--- a/arch/arm/mach-ep93xx/edb9315a.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/edb9315a.c
3 * Cirrus Logic EDB9315A support.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mm.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mtd/physmap.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <mach/hardware.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27static struct physmap_flash_data edb9315a_flash_data = {
28 .width = 2,
29};
30
31static struct resource edb9315a_flash_resource = {
32 .start = EP93XX_CS6_PHYS_BASE,
33 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9315a_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9315a_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9315a_flash_resource,
45};
46
47static struct ep93xx_eth_data edb9315a_eth_data = {
48 .phy_id = 1,
49};
50
51static void __init edb9315a_init_machine(void)
52{
53 ep93xx_init_devices();
54 platform_device_register(&edb9315a_flash);
55
56 ep93xx_register_eth(&edb9315a_eth_data, 1);
57}
58
59MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
60 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
61 .phys_io = EP93XX_APB_PHYS_BASE,
62 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
63 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
64 .map_io = ep93xx_map_io,
65 .init_irq = ep93xx_init_irq,
66 .timer = &ep93xx_timer,
67 .init_machine = edb9315a_init_machine,
68MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
new file mode 100644
index 000000000000..e9e45b92457e
--- /dev/null
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -0,0 +1,217 @@
1/*
2 * arch/arm/mach-ep93xx/edb93xx.c
3 * Cirrus Logic EDB93xx Development Board support.
4 *
5 * EDB93XX, EDB9301, EDB9307A
6 * Copyright (C) 2008-2009 H Hartley Sweeten <hsweeten@visionengravers.com>
7 *
8 * EDB9302
9 * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
10 *
11 * EDB9302A, EDB9315, EDB9315A
12 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
13 *
14 * EDB9307
15 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
16 *
17 * EDB9312
18 * Copyright (C) 2006 Infosys Technologies Limited
19 * Toufeeq Hussain <toufeeq_hussain@infosys.com>
20 *
21 * This program is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or (at
24 * your option) any later version.
25 */
26
27#include <linux/kernel.h>
28#include <linux/init.h>
29#include <linux/mm.h>
30#include <linux/sched.h>
31#include <linux/interrupt.h>
32#include <linux/ioport.h>
33#include <linux/mtd/physmap.h>
34#include <linux/platform_device.h>
35#include <linux/io.h>
36#include <linux/i2c.h>
37#include <mach/hardware.h>
38#include <asm/mach-types.h>
39#include <asm/mach/arch.h>
40
41static struct physmap_flash_data edb93xx_flash_data;
42
43static struct resource edb93xx_flash_resource = {
44 .flags = IORESOURCE_MEM,
45};
46
47static struct platform_device edb93xx_flash = {
48 .name = "physmap-flash",
49 .id = 0,
50 .dev = {
51 .platform_data = &edb93xx_flash_data,
52 },
53 .num_resources = 1,
54 .resource = &edb93xx_flash_resource,
55};
56
57static void __init __edb93xx_register_flash(unsigned int width,
58 resource_size_t start, resource_size_t size)
59{
60 edb93xx_flash_data.width = width;
61 edb93xx_flash_resource.start = start;
62 edb93xx_flash_resource.end = start + size - 1;
63
64 platform_device_register(&edb93xx_flash);
65}
66
67static void __init edb93xx_register_flash(void)
68{
69 if (machine_is_edb9307() || machine_is_edb9312() ||
70 machine_is_edb9315()) {
71 __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
72 } else {
73 __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
74 }
75}
76
77static struct ep93xx_eth_data edb93xx_eth_data = {
78 .phy_id = 1,
79};
80
81static struct i2c_board_info __initdata edb93xxa_i2c_data[] = {
82 {
83 I2C_BOARD_INFO("isl1208", 0x6f),
84 },
85};
86
87static struct i2c_board_info __initdata edb93xx_i2c_data[] = {
88 {
89 I2C_BOARD_INFO("ds1337", 0x68),
90 },
91};
92
93static void __init edb93xx_register_i2c(void)
94{
95 if (machine_is_edb9302a() || machine_is_edb9307a() ||
96 machine_is_edb9315a()) {
97 ep93xx_register_i2c(edb93xxa_i2c_data,
98 ARRAY_SIZE(edb93xxa_i2c_data));
99 } else if (machine_is_edb9307() || machine_is_edb9312() ||
100 machine_is_edb9315()) {
101 ep93xx_register_i2c(edb93xx_i2c_data,
102 ARRAY_SIZE(edb93xx_i2c_data));
103 }
104}
105
106static void __init edb93xx_init_machine(void)
107{
108 ep93xx_init_devices();
109 edb93xx_register_flash();
110 ep93xx_register_eth(&edb93xx_eth_data, 1);
111 edb93xx_register_i2c();
112}
113
114
115#ifdef CONFIG_MACH_EDB9301
116MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
117 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
118 .phys_io = EP93XX_APB_PHYS_BASE,
119 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
120 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
121 .map_io = ep93xx_map_io,
122 .init_irq = ep93xx_init_irq,
123 .timer = &ep93xx_timer,
124 .init_machine = edb93xx_init_machine,
125MACHINE_END
126#endif
127
128#ifdef CONFIG_MACH_EDB9302
129MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
130 /* Maintainer: George Kashperko <george@chas.com.ua> */
131 .phys_io = EP93XX_APB_PHYS_BASE,
132 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
133 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
134 .map_io = ep93xx_map_io,
135 .init_irq = ep93xx_init_irq,
136 .timer = &ep93xx_timer,
137 .init_machine = edb93xx_init_machine,
138MACHINE_END
139#endif
140
141#ifdef CONFIG_MACH_EDB9302A
142MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
143 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
144 .phys_io = EP93XX_APB_PHYS_BASE,
145 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
146 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
147 .map_io = ep93xx_map_io,
148 .init_irq = ep93xx_init_irq,
149 .timer = &ep93xx_timer,
150 .init_machine = edb93xx_init_machine,
151MACHINE_END
152#endif
153
154#ifdef CONFIG_MACH_EDB9307
155MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
156 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
157 .phys_io = EP93XX_APB_PHYS_BASE,
158 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
159 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
160 .map_io = ep93xx_map_io,
161 .init_irq = ep93xx_init_irq,
162 .timer = &ep93xx_timer,
163 .init_machine = edb93xx_init_machine,
164MACHINE_END
165#endif
166
167#ifdef CONFIG_MACH_EDB9307A
168MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
169 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
170 .phys_io = EP93XX_APB_PHYS_BASE,
171 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
172 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
173 .map_io = ep93xx_map_io,
174 .init_irq = ep93xx_init_irq,
175 .timer = &ep93xx_timer,
176 .init_machine = edb93xx_init_machine,
177MACHINE_END
178#endif
179
180#ifdef CONFIG_MACH_EDB9312
181MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
182 /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
183 .phys_io = EP93XX_APB_PHYS_BASE,
184 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
185 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
186 .map_io = ep93xx_map_io,
187 .init_irq = ep93xx_init_irq,
188 .timer = &ep93xx_timer,
189 .init_machine = edb93xx_init_machine,
190MACHINE_END
191#endif
192
193#ifdef CONFIG_MACH_EDB9315
194MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
195 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
196 .phys_io = EP93XX_APB_PHYS_BASE,
197 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
198 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
199 .map_io = ep93xx_map_io,
200 .init_irq = ep93xx_init_irq,
201 .timer = &ep93xx_timer,
202 .init_machine = edb93xx_init_machine,
203MACHINE_END
204#endif
205
206#ifdef CONFIG_MACH_EDB9315A
207MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
208 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
209 .phys_io = EP93XX_APB_PHYS_BASE,
210 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
211 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
212 .map_io = ep93xx_map_io,
213 .init_irq = ep93xx_init_irq,
214 .timer = &ep93xx_timer,
215 .init_machine = edb93xx_init_machine,
216MACHINE_END
217#endif
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index 1732de7629a5..967c079180db 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -147,13 +147,27 @@
147#define EP93XX_PWM_BASE (EP93XX_APB_VIRT_BASE + 0x00110000) 147#define EP93XX_PWM_BASE (EP93XX_APB_VIRT_BASE + 0x00110000)
148 148
149#define EP93XX_RTC_BASE (EP93XX_APB_VIRT_BASE + 0x00120000) 149#define EP93XX_RTC_BASE (EP93XX_APB_VIRT_BASE + 0x00120000)
150#define EP93XX_RTC_PHYS_BASE (EP93XX_APB_PHYS_BASE + 0x00120000)
150 151
151#define EP93XX_SYSCON_BASE (EP93XX_APB_VIRT_BASE + 0x00130000) 152#define EP93XX_SYSCON_BASE (EP93XX_APB_VIRT_BASE + 0x00130000)
152#define EP93XX_SYSCON_REG(x) (EP93XX_SYSCON_BASE + (x)) 153#define EP93XX_SYSCON_REG(x) (EP93XX_SYSCON_BASE + (x))
153#define EP93XX_SYSCON_POWER_STATE EP93XX_SYSCON_REG(0x00) 154#define EP93XX_SYSCON_POWER_STATE EP93XX_SYSCON_REG(0x00)
154#define EP93XX_SYSCON_CLOCK_CONTROL EP93XX_SYSCON_REG(0x04) 155#define EP93XX_SYSCON_PWRCNT EP93XX_SYSCON_REG(0x04)
155#define EP93XX_SYSCON_CLOCK_UARTBAUD 0x20000000 156#define EP93XX_SYSCON_PWRCNT_FIR_EN (1<<31)
156#define EP93XX_SYSCON_CLOCK_USH_EN 0x10000000 157#define EP93XX_SYSCON_PWRCNT_UARTBAUD (1<<29)
158#define EP93XX_SYSCON_PWRCNT_USH_EN (1<<28)
159#define EP93XX_SYSCON_PWRCNT_DMA_M2M1 (1<<27)
160#define EP93XX_SYSCON_PWRCNT_DMA_M2M0 (1<<26)
161#define EP93XX_SYSCON_PWRCNT_DMA_M2P8 (1<<25)
162#define EP93XX_SYSCON_PWRCNT_DMA_M2P9 (1<<24)
163#define EP93XX_SYSCON_PWRCNT_DMA_M2P6 (1<<23)
164#define EP93XX_SYSCON_PWRCNT_DMA_M2P7 (1<<22)
165#define EP93XX_SYSCON_PWRCNT_DMA_M2P4 (1<<21)
166#define EP93XX_SYSCON_PWRCNT_DMA_M2P5 (1<<20)
167#define EP93XX_SYSCON_PWRCNT_DMA_M2P2 (1<<19)
168#define EP93XX_SYSCON_PWRCNT_DMA_M2P3 (1<<18)
169#define EP93XX_SYSCON_PWRCNT_DMA_M2P0 (1<<17)
170#define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16)
157#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) 171#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08)
158#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) 172#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c)
159#define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20) 173#define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20)
diff --git a/arch/arm/mach-ep93xx/include/mach/memory.h b/arch/arm/mach-ep93xx/include/mach/memory.h
index 5c80c3c8158d..925b12ea0990 100644
--- a/arch/arm/mach-ep93xx/include/mach/memory.h
+++ b/arch/arm/mach-ep93xx/include/mach/memory.h
@@ -5,6 +5,12 @@
5#ifndef __ASM_ARCH_MEMORY_H 5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#if defined(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET)
8#define PHYS_OFFSET UL(0x00000000) 9#define PHYS_OFFSET UL(0x00000000)
10#elif defined(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)
11#define PHYS_OFFSET UL(0xc0000000)
12#else
13#error "Kconfig bug: No EP93xx PHYS_OFFSET set"
14#endif
9 15
10#endif 16#endif
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
deleted file mode 100644
index cddd194ac6eb..000000000000
--- a/arch/arm/mach-imx/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
1menu "IMX Implementations"
2 depends on ARCH_IMX
3
4config ARCH_MX1ADS
5 bool "mx1ads"
6 depends on ARCH_IMX
7 select ISA
8 help
9 Say Y here if you are using the Motorola MX1ADS board
10
11endmenu
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
deleted file mode 100644
index b047c7e795a9..000000000000
--- a/arch/arm/mach-imx/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y += irq.o time.o dma.o generic.o clock.o
8
9obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
10
11# Specific board support
12obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o
13
14# Support for blinky lights
15led-y := leds.o
16
17obj-$(CONFIG_LEDS) += $(led-y)
18led-$(CONFIG_ARCH_MX1ADS) += leds-mx1ads.o
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot
deleted file mode 100644
index fd72ce5b8081..000000000000
--- a/arch/arm/mach-imx/Makefile.boot
+++ /dev/null
@@ -1,2 +0,0 @@
1 zreladdr-$(CONFIG_ARCH_MX1ADS) := 0x08008000
2
diff --git a/arch/arm/mach-imx/clock.c b/arch/arm/mach-imx/clock.c
deleted file mode 100644
index cf332aeb942e..000000000000
--- a/arch/arm/mach-imx/clock.c
+++ /dev/null
@@ -1,210 +0,0 @@
1/*
2 * Copyright (C) 2008 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/kernel.h>
20#include <linux/device.h>
21#include <linux/list.h>
22#include <linux/math64.h>
23#include <linux/err.h>
24#include <linux/io.h>
25
26#include <mach/hardware.h>
27
28/*
29 * Very simple approach: We can't disable clocks, so we do
30 * not need refcounting
31 */
32
33struct clk {
34 struct list_head node;
35 const char *name;
36 unsigned long (*get_rate)(void);
37};
38
39/*
40 * get the system pll clock in Hz
41 *
42 * mfi + mfn / (mfd +1)
43 * f = 2 * f_ref * --------------------
44 * pd + 1
45 */
46static unsigned long imx_decode_pll(unsigned int pll, u32 f_ref)
47{
48 unsigned long long ll;
49 unsigned long quot;
50
51 u32 mfi = (pll >> 10) & 0xf;
52 u32 mfn = pll & 0x3ff;
53 u32 mfd = (pll >> 16) & 0x3ff;
54 u32 pd = (pll >> 26) & 0xf;
55
56 mfi = mfi <= 5 ? 5 : mfi;
57
58 ll = 2 * (unsigned long long)f_ref *
59 ((mfi << 16) + (mfn << 16) / (mfd + 1));
60 quot = (pd + 1) * (1 << 16);
61 ll += quot / 2;
62 do_div(ll, quot);
63 return (unsigned long)ll;
64}
65
66static unsigned long imx_get_system_clk(void)
67{
68 u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512);
69
70 return imx_decode_pll(SPCTL0, f_ref);
71}
72
73static unsigned long imx_get_mcu_clk(void)
74{
75 return imx_decode_pll(MPCTL0, CLK32 * 512);
76}
77
78/*
79 * get peripheral clock 1 ( UART[12], Timer[12], PWM )
80 */
81static unsigned long imx_get_perclk1(void)
82{
83 return imx_get_system_clk() / (((PCDR) & 0xf)+1);
84}
85
86/*
87 * get peripheral clock 2 ( LCD, SD, SPI[12] )
88 */
89static unsigned long imx_get_perclk2(void)
90{
91 return imx_get_system_clk() / (((PCDR>>4) & 0xf)+1);
92}
93
94/*
95 * get peripheral clock 3 ( SSI )
96 */
97static unsigned long imx_get_perclk3(void)
98{
99 return imx_get_system_clk() / (((PCDR>>16) & 0x7f)+1);
100}
101
102/*
103 * get hclk ( SDRAM, CSI, Memory Stick, I2C, DMA )
104 */
105static unsigned long imx_get_hclk(void)
106{
107 return imx_get_system_clk() / (((CSCR>>10) & 0xf)+1);
108}
109
110static struct clk clk_system_clk = {
111 .name = "system_clk",
112 .get_rate = imx_get_system_clk,
113};
114
115static struct clk clk_hclk = {
116 .name = "hclk",
117 .get_rate = imx_get_hclk,
118};
119
120static struct clk clk_mcu_clk = {
121 .name = "mcu_clk",
122 .get_rate = imx_get_mcu_clk,
123};
124
125static struct clk clk_perclk1 = {
126 .name = "perclk1",
127 .get_rate = imx_get_perclk1,
128};
129
130static struct clk clk_uart_clk = {
131 .name = "uart_clk",
132 .get_rate = imx_get_perclk1,
133};
134
135static struct clk clk_perclk2 = {
136 .name = "perclk2",
137 .get_rate = imx_get_perclk2,
138};
139
140static struct clk clk_perclk3 = {
141 .name = "perclk3",
142 .get_rate = imx_get_perclk3,
143};
144
145static struct clk *clks[] = {
146 &clk_perclk1,
147 &clk_perclk2,
148 &clk_perclk3,
149 &clk_system_clk,
150 &clk_hclk,
151 &clk_mcu_clk,
152 &clk_uart_clk,
153};
154
155static LIST_HEAD(clocks);
156static DEFINE_MUTEX(clocks_mutex);
157
158struct clk *clk_get(struct device *dev, const char *id)
159{
160 struct clk *p, *clk = ERR_PTR(-ENOENT);
161
162 mutex_lock(&clocks_mutex);
163 list_for_each_entry(p, &clocks, node) {
164 if (!strcmp(p->name, id)) {
165 clk = p;
166 goto found;
167 }
168 }
169
170found:
171 mutex_unlock(&clocks_mutex);
172
173 return clk;
174}
175EXPORT_SYMBOL(clk_get);
176
177void clk_put(struct clk *clk)
178{
179}
180EXPORT_SYMBOL(clk_put);
181
182int clk_enable(struct clk *clk)
183{
184 return 0;
185}
186EXPORT_SYMBOL(clk_enable);
187
188void clk_disable(struct clk *clk)
189{
190}
191EXPORT_SYMBOL(clk_disable);
192
193unsigned long clk_get_rate(struct clk *clk)
194{
195 return clk->get_rate();
196}
197EXPORT_SYMBOL(clk_get_rate);
198
199int imx_clocks_init(void)
200{
201 int i;
202
203 mutex_lock(&clocks_mutex);
204 for (i = 0; i < ARRAY_SIZE(clks); i++)
205 list_add(&clks[i]->node, &clocks);
206 mutex_unlock(&clocks_mutex);
207
208 return 0;
209}
210
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
deleted file mode 100644
index 434b4ca0af67..000000000000
--- a/arch/arm/mach-imx/cpufreq.c
+++ /dev/null
@@ -1,315 +0,0 @@
1/*
2 * cpu.c: clock scaling for the iMX
3 *
4 * Copyright (C) 2000 2001, The Delft University of Technology
5 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
6 * Copyright (C) 2006 Inky Lung <ilung@cwlinux.com>
7 * Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
8 *
9 * Based on SA1100 version written by:
10 * - Johan Pouwelse (J.A.Pouwelse@its.tudelft.nl): initial version
11 * - Erik Mouw (J.A.K.Mouw@its.tudelft.nl):
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 */
28
29/*#define DEBUG*/
30
31#include <linux/kernel.h>
32#include <linux/types.h>
33#include <linux/init.h>
34#include <linux/cpufreq.h>
35#include <linux/clk.h>
36#include <linux/err.h>
37#include <asm/system.h>
38
39#include <mach/hardware.h>
40
41#include "generic.h"
42
43#ifndef __val2mfld
44#define __val2mfld(mask,val) (((mask)&~((mask)<<1))*(val)&(mask))
45#endif
46#ifndef __mfld2val
47#define __mfld2val(mask,val) (((val)&(mask))/((mask)&~((mask)<<1)))
48#endif
49
50#define CR_920T_CLOCK_MODE 0xC0000000
51#define CR_920T_FASTBUS_MODE 0x00000000
52#define CR_920T_ASYNC_MODE 0xC0000000
53
54static u32 mpctl0_at_boot;
55static u32 bclk_div_at_boot;
56
57static struct clk *system_clk, *mcu_clk;
58
59static void imx_set_async_mode(void)
60{
61 adjust_cr(CR_920T_CLOCK_MODE, CR_920T_ASYNC_MODE);
62}
63
64static void imx_set_fastbus_mode(void)
65{
66 adjust_cr(CR_920T_CLOCK_MODE, CR_920T_FASTBUS_MODE);
67}
68
69static void imx_set_mpctl0(u32 mpctl0)
70{
71 unsigned long flags;
72
73 if (mpctl0 == 0) {
74 local_irq_save(flags);
75 CSCR &= ~CSCR_MPEN;
76 local_irq_restore(flags);
77 return;
78 }
79
80 local_irq_save(flags);
81 MPCTL0 = mpctl0;
82 CSCR |= CSCR_MPEN;
83 local_irq_restore(flags);
84}
85
86/**
87 * imx_compute_mpctl - compute new PLL parameters
88 * @new_mpctl: pointer to location assigned by new PLL control register value
89 * @cur_mpctl: current PLL control register parameters
90 * @f_ref: reference source frequency Hz
91 * @freq: required frequency in Hz
92 * @relation: is one of %CPUFREQ_RELATION_L (supremum)
93 * and %CPUFREQ_RELATION_H (infimum)
94 */
95long imx_compute_mpctl(u32 *new_mpctl, u32 cur_mpctl, u32 f_ref, unsigned long freq, int relation)
96{
97 u32 mfi;
98 u32 mfn;
99 u32 mfd;
100 u32 pd;
101 unsigned long long ll;
102 long l;
103 long quot;
104
105 /* Fdppl=2*Fref*(MFI+MFN/(MFD+1))/(PD+1) */
106 /* PD=<0,15>, MFD=<1,1023>, MFI=<5,15> MFN=<0,1022> */
107
108 if (cur_mpctl) {
109 mfd = ((cur_mpctl >> 16) & 0x3ff) + 1;
110 pd = ((cur_mpctl >> 26) & 0xf) + 1;
111 } else {
112 pd=2; mfd=313;
113 }
114
115 /* pd=2; mfd=313; mfi=8; mfn=183; */
116 /* (MFI+MFN/(MFD)) = Fdppl / (2*Fref) * (PD); */
117
118 quot = (f_ref + (1 << 9)) >> 10;
119 l = (freq * pd + quot) / (2 * quot);
120 mfi = l >> 10;
121 mfn = ((l & ((1 << 10) - 1)) * mfd + (1 << 9)) >> 10;
122
123 mfd -= 1;
124 pd -= 1;
125
126 *new_mpctl = ((mfi & 0xf) << 10) | (mfn & 0x3ff) | ((mfd & 0x3ff) << 16)
127 | ((pd & 0xf) << 26);
128
129 ll = 2 * (unsigned long long)f_ref * ( (mfi<<16) + (mfn<<16) / (mfd+1) );
130 quot = (pd+1) * (1<<16);
131 ll += quot / 2;
132 do_div(ll, quot);
133 freq = ll;
134
135 pr_debug(KERN_DEBUG "imx: new PLL parameters pd=%d mfd=%d mfi=%d mfn=%d, freq=%ld\n",
136 pd, mfd, mfi, mfn, freq);
137
138 return freq;
139}
140
141
142static int imx_verify_speed(struct cpufreq_policy *policy)
143{
144 if (policy->cpu != 0)
145 return -EINVAL;
146
147 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
148
149 return 0;
150}
151
152static unsigned int imx_get_speed(unsigned int cpu)
153{
154 unsigned int freq;
155 unsigned int cr;
156 unsigned int cscr;
157 unsigned int bclk_div;
158
159 if (cpu)
160 return 0;
161
162 cscr = CSCR;
163 bclk_div = __mfld2val(CSCR_BCLK_DIV, cscr) + 1;
164 cr = get_cr();
165
166 if((cr & CR_920T_CLOCK_MODE) == CR_920T_FASTBUS_MODE) {
167 freq = clk_get_rate(system_clk);
168 freq = (freq + bclk_div/2) / bclk_div;
169 } else {
170 freq = clk_get_rate(mcu_clk);
171 if (cscr & CSCR_MPU_PRESC)
172 freq /= 2;
173 }
174
175 freq = (freq + 500) / 1000;
176
177 return freq;
178}
179
180static int imx_set_target(struct cpufreq_policy *policy,
181 unsigned int target_freq,
182 unsigned int relation)
183{
184 struct cpufreq_freqs freqs;
185 u32 mpctl0 = 0;
186 u32 cscr;
187 unsigned long flags;
188 long freq;
189 long sysclk;
190 unsigned int bclk_div = bclk_div_at_boot;
191
192 /*
193 * Some governors do not respects CPU and policy lower limits
194 * which leads to bad things (division by zero etc), ensure
195 * that such things do not happen.
196 */
197 if(target_freq < policy->cpuinfo.min_freq)
198 target_freq = policy->cpuinfo.min_freq;
199
200 if(target_freq < policy->min)
201 target_freq = policy->min;
202
203 freq = target_freq * 1000;
204
205 pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n",
206 freq, mpctl0_at_boot);
207
208 sysclk = clk_get_rate(system_clk);
209
210 if (freq > sysclk / bclk_div_at_boot + 1000000) {
211 freq = imx_compute_mpctl(&mpctl0, mpctl0_at_boot, CLK32 * 512, freq, relation);
212 if (freq < 0) {
213 printk(KERN_WARNING "imx: target frequency %ld Hz cannot be set\n", freq);
214 return -EINVAL;
215 }
216 } else {
217 if(freq + 1000 < sysclk) {
218 if (relation == CPUFREQ_RELATION_L)
219 bclk_div = (sysclk - 1000) / freq;
220 else
221 bclk_div = (sysclk + freq + 1000) / freq;
222
223 if(bclk_div > 16)
224 bclk_div = 16;
225 if(bclk_div < bclk_div_at_boot)
226 bclk_div = bclk_div_at_boot;
227 }
228 freq = (sysclk + bclk_div / 2) / bclk_div;
229 }
230
231 freqs.old = imx_get_speed(0);
232 freqs.new = (freq + 500) / 1000;
233 freqs.cpu = 0;
234 freqs.flags = 0;
235
236 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
237
238 local_irq_save(flags);
239
240 imx_set_fastbus_mode();
241
242 imx_set_mpctl0(mpctl0);
243
244 cscr = CSCR;
245 cscr &= ~CSCR_BCLK_DIV;
246 cscr |= __val2mfld(CSCR_BCLK_DIV, bclk_div - 1);
247 CSCR = cscr;
248
249 if(mpctl0) {
250 CSCR |= CSCR_MPLL_RESTART;
251
252 /* Wait until MPLL is stabilized */
253 while( CSCR & CSCR_MPLL_RESTART );
254
255 imx_set_async_mode();
256 }
257
258 local_irq_restore(flags);
259
260 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
261
262 pr_debug(KERN_INFO "imx: set frequency %ld Hz, running from %s\n",
263 freq, mpctl0? "MPLL": "SPLL");
264
265 return 0;
266}
267
268static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy)
269{
270 printk(KERN_INFO "i.MX cpu freq change driver v1.0\n");
271
272 if (policy->cpu != 0)
273 return -EINVAL;
274
275 policy->cur = policy->min = policy->max = imx_get_speed(0);
276 policy->cpuinfo.min_freq = 8000;
277 policy->cpuinfo.max_freq = 200000;
278 /* Manual states, that PLL stabilizes in two CLK32 periods */
279 policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32;
280 return 0;
281}
282
283static struct cpufreq_driver imx_driver = {
284 .flags = CPUFREQ_STICKY,
285 .verify = imx_verify_speed,
286 .target = imx_set_target,
287 .get = imx_get_speed,
288 .init = imx_cpufreq_driver_init,
289 .name = "imx",
290};
291
292static int __init imx_cpufreq_init(void)
293{
294 bclk_div_at_boot = __mfld2val(CSCR_BCLK_DIV, CSCR) + 1;
295 mpctl0_at_boot = 0;
296
297 system_clk = clk_get(NULL, "system_clk");
298 if (IS_ERR(system_clk))
299 return PTR_ERR(system_clk);
300
301 mcu_clk = clk_get(NULL, "mcu_clk");
302 if (IS_ERR(mcu_clk)) {
303 clk_put(system_clk);
304 return PTR_ERR(mcu_clk);
305 }
306
307 if((CSCR & CSCR_MPEN) &&
308 ((get_cr() & CR_920T_CLOCK_MODE) != CR_920T_FASTBUS_MODE))
309 mpctl0_at_boot = MPCTL0;
310
311 return cpufreq_register_driver(&imx_driver);
312}
313
314arch_initcall(imx_cpufreq_init);
315
diff --git a/arch/arm/mach-imx/dma.c b/arch/arm/mach-imx/dma.c
deleted file mode 100644
index 1536583eece0..000000000000
--- a/arch/arm/mach-imx/dma.c
+++ /dev/null
@@ -1,597 +0,0 @@
1/*
2 * linux/arch/arm/mach-imx/dma.c
3 *
4 * imx DMA registration and IRQ dispatching
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 2004-03-03 Sascha Hauer <sascha@saschahauer.de>
11 * initial version heavily inspired by
12 * linux/arch/arm/mach-pxa/dma.c
13 *
14 * 2005-04-17 Pavel Pisa <pisa@cmp.felk.cvut.cz>
15 * Changed to support scatter gather DMA
16 * by taking Russell's code from RiscPC
17 *
18 * 2006-05-31 Pavel Pisa <pisa@cmp.felk.cvut.cz>
19 * Corrected error handling code.
20 *
21 */
22
23#undef DEBUG
24
25#include <linux/module.h>
26#include <linux/init.h>
27#include <linux/kernel.h>
28#include <linux/interrupt.h>
29#include <linux/errno.h>
30
31#include <asm/scatterlist.h>
32#include <asm/system.h>
33#include <asm/irq.h>
34#include <mach/hardware.h>
35#include <mach/dma.h>
36#include <mach/imx-dma.h>
37
38struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
39
40/*
41 * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation
42 * @dma_ch: i.MX DMA channel number
43 * @lastcount: number of bytes transferred during last transfer
44 *
45 * Functions prepares DMA controller for next sg data chunk transfer.
46 * The @lastcount argument informs function about number of bytes transferred
47 * during last block. Zero value can be used for @lastcount to setup DMA
48 * for the first chunk.
49 */
50static inline int imx_dma_sg_next(imx_dmach_t dma_ch, unsigned int lastcount)
51{
52 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
53 unsigned int nextcount;
54 unsigned int nextaddr;
55
56 if (!imxdma->name) {
57 printk(KERN_CRIT "%s: called for not allocated channel %d\n",
58 __func__, dma_ch);
59 return 0;
60 }
61
62 imxdma->resbytes -= lastcount;
63
64 if (!imxdma->sg) {
65 pr_debug("imxdma%d: no sg data\n", dma_ch);
66 return 0;
67 }
68
69 imxdma->sgbc += lastcount;
70 if ((imxdma->sgbc >= imxdma->sg->length) || !imxdma->resbytes) {
71 if ((imxdma->sgcount <= 1) || !imxdma->resbytes) {
72 pr_debug("imxdma%d: sg transfer limit reached\n",
73 dma_ch);
74 imxdma->sgcount=0;
75 imxdma->sg = NULL;
76 return 0;
77 } else {
78 imxdma->sgcount--;
79 imxdma->sg++;
80 imxdma->sgbc = 0;
81 }
82 }
83 nextcount = imxdma->sg->length - imxdma->sgbc;
84 nextaddr = imxdma->sg->dma_address + imxdma->sgbc;
85
86 if(imxdma->resbytes < nextcount)
87 nextcount = imxdma->resbytes;
88
89 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
90 DAR(dma_ch) = nextaddr;
91 else
92 SAR(dma_ch) = nextaddr;
93
94 CNTR(dma_ch) = nextcount;
95 pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, size 0x%08x\n",
96 dma_ch, DAR(dma_ch), SAR(dma_ch), CNTR(dma_ch));
97
98 return nextcount;
99}
100
101/*
102 * imx_dma_setup_sg_base - scatter-gather DMA emulation
103 * @dma_ch: i.MX DMA channel number
104 * @sg: pointer to the scatter-gather list/vector
105 * @sgcount: scatter-gather list hungs count
106 *
107 * Functions sets up i.MX DMA state for emulated scatter-gather transfer
108 * and sets up channel registers to be ready for the first chunk
109 */
110static int
111imx_dma_setup_sg_base(imx_dmach_t dma_ch,
112 struct scatterlist *sg, unsigned int sgcount)
113{
114 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
115
116 imxdma->sg = sg;
117 imxdma->sgcount = sgcount;
118 imxdma->sgbc = 0;
119 return imx_dma_sg_next(dma_ch, 0);
120}
121
122/**
123 * imx_dma_setup_single - setup i.MX DMA channel for linear memory to/from device transfer
124 * @dma_ch: i.MX DMA channel number
125 * @dma_address: the DMA/physical memory address of the linear data block
126 * to transfer
127 * @dma_length: length of the data block in bytes
128 * @dev_addr: physical device port address
129 * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
130 * or %DMA_MODE_WRITE from memory to the device
131 *
132 * The function setups DMA channel source and destination addresses for transfer
133 * specified by provided parameters. The scatter-gather emulation is disabled,
134 * because linear data block
135 * form the physical address range is transferred.
136 * Return value: if incorrect parameters are provided -%EINVAL.
137 * Zero indicates success.
138 */
139int
140imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
141 unsigned int dma_length, unsigned int dev_addr,
142 unsigned int dmamode)
143{
144 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
145
146 imxdma->sg = NULL;
147 imxdma->sgcount = 0;
148 imxdma->dma_mode = dmamode;
149 imxdma->resbytes = dma_length;
150
151 if (!dma_address) {
152 printk(KERN_ERR "imxdma%d: imx_dma_setup_single null address\n",
153 dma_ch);
154 return -EINVAL;
155 }
156
157 if (!dma_length) {
158 printk(KERN_ERR "imxdma%d: imx_dma_setup_single zero length\n",
159 dma_ch);
160 return -EINVAL;
161 }
162
163 if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) {
164 pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for read\n",
165 dma_ch, (unsigned int)dma_address, dma_length,
166 dev_addr);
167 SAR(dma_ch) = dev_addr;
168 DAR(dma_ch) = (unsigned int)dma_address;
169 } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
170 pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for write\n",
171 dma_ch, (unsigned int)dma_address, dma_length,
172 dev_addr);
173 SAR(dma_ch) = (unsigned int)dma_address;
174 DAR(dma_ch) = dev_addr;
175 } else {
176 printk(KERN_ERR "imxdma%d: imx_dma_setup_single bad dmamode\n",
177 dma_ch);
178 return -EINVAL;
179 }
180
181 CNTR(dma_ch) = dma_length;
182
183 return 0;
184}
185
186/**
187 * imx_dma_setup_sg - setup i.MX DMA channel SG list to/from device transfer
188 * @dma_ch: i.MX DMA channel number
189 * @sg: pointer to the scatter-gather list/vector
190 * @sgcount: scatter-gather list hungs count
191 * @dma_length: total length of the transfer request in bytes
192 * @dev_addr: physical device port address
193 * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
194 * or %DMA_MODE_WRITE from memory to the device
195 *
196 * The function sets up DMA channel state and registers to be ready for transfer
197 * specified by provided parameters. The scatter-gather emulation is set up
198 * according to the parameters.
199 *
200 * The full preparation of the transfer requires setup of more register
201 * by the caller before imx_dma_enable() can be called.
202 *
203 * %BLR(dma_ch) holds transfer burst length in bytes, 0 means 64 bytes
204 *
205 * %RSSR(dma_ch) has to be set to the DMA request line source %DMA_REQ_xxx
206 *
207 * %CCR(dma_ch) has to specify transfer parameters, the next settings is typical
208 * for linear or simple scatter-gather transfers if %DMA_MODE_READ is specified
209 *
210 * %CCR_DMOD_LINEAR | %CCR_DSIZ_32 | %CCR_SMOD_FIFO | %CCR_SSIZ_x
211 *
212 * The typical setup for %DMA_MODE_WRITE is specified by next options combination
213 *
214 * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x
215 *
216 * Be careful here and do not mistakenly mix source and target device
217 * port sizes constants, they are really different:
218 * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32,
219 * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32
220 *
221 * Return value: if incorrect parameters are provided -%EINVAL.
222 * Zero indicates success.
223 */
224int
225imx_dma_setup_sg(imx_dmach_t dma_ch,
226 struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
227 unsigned int dev_addr, unsigned int dmamode)
228{
229 int res;
230 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
231
232 imxdma->sg = NULL;
233 imxdma->sgcount = 0;
234 imxdma->dma_mode = dmamode;
235 imxdma->resbytes = dma_length;
236
237 if (!sg || !sgcount) {
238 printk(KERN_ERR "imxdma%d: imx_dma_setup_sg epty sg list\n",
239 dma_ch);
240 return -EINVAL;
241 }
242
243 if (!sg->length) {
244 printk(KERN_ERR "imxdma%d: imx_dma_setup_sg zero length\n",
245 dma_ch);
246 return -EINVAL;
247 }
248
249 if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) {
250 pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for read\n",
251 dma_ch, sg, sgcount, dma_length, dev_addr);
252 SAR(dma_ch) = dev_addr;
253 } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
254 pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for write\n",
255 dma_ch, sg, sgcount, dma_length, dev_addr);
256 DAR(dma_ch) = dev_addr;
257 } else {
258 printk(KERN_ERR "imxdma%d: imx_dma_setup_sg bad dmamode\n",
259 dma_ch);
260 return -EINVAL;
261 }
262
263 res = imx_dma_setup_sg_base(dma_ch, sg, sgcount);
264 if (res <= 0) {
265 printk(KERN_ERR "imxdma%d: no sg chunk ready\n", dma_ch);
266 return -EINVAL;
267 }
268
269 return 0;
270}
271
272/**
273 * imx_dma_setup_handlers - setup i.MX DMA channel end and error notification handlers
274 * @dma_ch: i.MX DMA channel number
275 * @irq_handler: the pointer to the function called if the transfer
276 * ends successfully
277 * @err_handler: the pointer to the function called if the premature
278 * end caused by error occurs
279 * @data: user specified value to be passed to the handlers
280 */
281int
282imx_dma_setup_handlers(imx_dmach_t dma_ch,
283 void (*irq_handler) (int, void *),
284 void (*err_handler) (int, void *, int),
285 void *data)
286{
287 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
288 unsigned long flags;
289
290 if (!imxdma->name) {
291 printk(KERN_CRIT "%s: called for not allocated channel %d\n",
292 __func__, dma_ch);
293 return -ENODEV;
294 }
295
296 local_irq_save(flags);
297 DISR = (1 << dma_ch);
298 imxdma->irq_handler = irq_handler;
299 imxdma->err_handler = err_handler;
300 imxdma->data = data;
301 local_irq_restore(flags);
302 return 0;
303}
304
305/**
306 * imx_dma_enable - function to start i.MX DMA channel operation
307 * @dma_ch: i.MX DMA channel number
308 *
309 * The channel has to be allocated by driver through imx_dma_request()
310 * or imx_dma_request_by_prio() function.
311 * The transfer parameters has to be set to the channel registers through
312 * call of the imx_dma_setup_single() or imx_dma_setup_sg() function
313 * and registers %BLR(dma_ch), %RSSR(dma_ch) and %CCR(dma_ch) has to
314 * be set prior this function call by the channel user.
315 */
316void imx_dma_enable(imx_dmach_t dma_ch)
317{
318 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
319 unsigned long flags;
320
321 pr_debug("imxdma%d: imx_dma_enable\n", dma_ch);
322
323 if (!imxdma->name) {
324 printk(KERN_CRIT "%s: called for not allocated channel %d\n",
325 __func__, dma_ch);
326 return;
327 }
328
329 local_irq_save(flags);
330 DISR = (1 << dma_ch);
331 DIMR &= ~(1 << dma_ch);
332 CCR(dma_ch) |= CCR_CEN;
333 local_irq_restore(flags);
334}
335
336/**
337 * imx_dma_disable - stop, finish i.MX DMA channel operatin
338 * @dma_ch: i.MX DMA channel number
339 */
340void imx_dma_disable(imx_dmach_t dma_ch)
341{
342 unsigned long flags;
343
344 pr_debug("imxdma%d: imx_dma_disable\n", dma_ch);
345
346 local_irq_save(flags);
347 DIMR |= (1 << dma_ch);
348 CCR(dma_ch) &= ~CCR_CEN;
349 DISR = (1 << dma_ch);
350 local_irq_restore(flags);
351}
352
353/**
354 * imx_dma_request - request/allocate specified channel number
355 * @dma_ch: i.MX DMA channel number
356 * @name: the driver/caller own non-%NULL identification
357 */
358int imx_dma_request(imx_dmach_t dma_ch, const char *name)
359{
360 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
361 unsigned long flags;
362
363 /* basic sanity checks */
364 if (!name)
365 return -EINVAL;
366
367 if (dma_ch >= IMX_DMA_CHANNELS) {
368 printk(KERN_CRIT "%s: called for non-existed channel %d\n",
369 __func__, dma_ch);
370 return -EINVAL;
371 }
372
373 local_irq_save(flags);
374 if (imxdma->name) {
375 local_irq_restore(flags);
376 return -ENODEV;
377 }
378
379 imxdma->name = name;
380 imxdma->irq_handler = NULL;
381 imxdma->err_handler = NULL;
382 imxdma->data = NULL;
383 imxdma->sg = NULL;
384 local_irq_restore(flags);
385 return 0;
386}
387
388/**
389 * imx_dma_free - release previously acquired channel
390 * @dma_ch: i.MX DMA channel number
391 */
392void imx_dma_free(imx_dmach_t dma_ch)
393{
394 unsigned long flags;
395 struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
396
397 if (!imxdma->name) {
398 printk(KERN_CRIT
399 "%s: trying to free channel %d which is already freed\n",
400 __func__, dma_ch);
401 return;
402 }
403
404 local_irq_save(flags);
405 /* Disable interrupts */
406 DIMR |= (1 << dma_ch);
407 CCR(dma_ch) &= ~CCR_CEN;
408 imxdma->name = NULL;
409 local_irq_restore(flags);
410}
411
412/**
413 * imx_dma_request_by_prio - find and request some of free channels best suiting requested priority
414 * @name: the driver/caller own non-%NULL identification
415 * @prio: one of the hardware distinguished priority level:
416 * %DMA_PRIO_HIGH, %DMA_PRIO_MEDIUM, %DMA_PRIO_LOW
417 *
418 * This function tries to find free channel in the specified priority group
419 * if the priority cannot be achieved it tries to look for free channel
420 * in the higher and then even lower priority groups.
421 *
422 * Return value: If there is no free channel to allocate, -%ENODEV is returned.
423 * On successful allocation channel is returned.
424 */
425imx_dmach_t imx_dma_request_by_prio(const char *name, imx_dma_prio prio)
426{
427 int i;
428 int best;
429
430 switch (prio) {
431 case (DMA_PRIO_HIGH):
432 best = 8;
433 break;
434 case (DMA_PRIO_MEDIUM):
435 best = 4;
436 break;
437 case (DMA_PRIO_LOW):
438 default:
439 best = 0;
440 break;
441 }
442
443 for (i = best; i < IMX_DMA_CHANNELS; i++) {
444 if (!imx_dma_request(i, name)) {
445 return i;
446 }
447 }
448
449 for (i = best - 1; i >= 0; i--) {
450 if (!imx_dma_request(i, name)) {
451 return i;
452 }
453 }
454
455 printk(KERN_ERR "%s: no free DMA channel found\n", __func__);
456
457 return -ENODEV;
458}
459
460static irqreturn_t dma_err_handler(int irq, void *dev_id)
461{
462 int i, disr = DISR;
463 struct imx_dma_channel *channel;
464 unsigned int err_mask = DBTOSR | DRTOSR | DSESR | DBOSR;
465 int errcode;
466
467 DISR = disr & err_mask;
468 for (i = 0; i < IMX_DMA_CHANNELS; i++) {
469 if(!(err_mask & (1 << i)))
470 continue;
471 channel = &imx_dma_channels[i];
472 errcode = 0;
473
474 if (DBTOSR & (1 << i)) {
475 DBTOSR = (1 << i);
476 errcode |= IMX_DMA_ERR_BURST;
477 }
478 if (DRTOSR & (1 << i)) {
479 DRTOSR = (1 << i);
480 errcode |= IMX_DMA_ERR_REQUEST;
481 }
482 if (DSESR & (1 << i)) {
483 DSESR = (1 << i);
484 errcode |= IMX_DMA_ERR_TRANSFER;
485 }
486 if (DBOSR & (1 << i)) {
487 DBOSR = (1 << i);
488 errcode |= IMX_DMA_ERR_BUFFER;
489 }
490
491 /*
492 * The cleaning of @sg field would be questionable
493 * there, because its value can help to compute
494 * remaining/transferred bytes count in the handler
495 */
496 /*imx_dma_channels[i].sg = NULL;*/
497
498 if (channel->name && channel->err_handler) {
499 channel->err_handler(i, channel->data, errcode);
500 continue;
501 }
502
503 imx_dma_channels[i].sg = NULL;
504
505 printk(KERN_WARNING
506 "DMA timeout on channel %d (%s) -%s%s%s%s\n",
507 i, channel->name,
508 errcode&IMX_DMA_ERR_BURST? " burst":"",
509 errcode&IMX_DMA_ERR_REQUEST? " request":"",
510 errcode&IMX_DMA_ERR_TRANSFER? " transfer":"",
511 errcode&IMX_DMA_ERR_BUFFER? " buffer":"");
512 }
513 return IRQ_HANDLED;
514}
515
516static irqreturn_t dma_irq_handler(int irq, void *dev_id)
517{
518 int i, disr = DISR;
519
520 pr_debug("imxdma: dma_irq_handler called, disr=0x%08x\n",
521 disr);
522
523 DISR = disr;
524 for (i = 0; i < IMX_DMA_CHANNELS; i++) {
525 if (disr & (1 << i)) {
526 struct imx_dma_channel *channel = &imx_dma_channels[i];
527 if (channel->name) {
528 if (imx_dma_sg_next(i, CNTR(i))) {
529 CCR(i) &= ~CCR_CEN;
530 mb();
531 CCR(i) |= CCR_CEN;
532 } else {
533 if (channel->irq_handler)
534 channel->irq_handler(i,
535 channel->data);
536 }
537 } else {
538 /*
539 * IRQ for an unregistered DMA channel:
540 * let's clear the interrupts and disable it.
541 */
542 printk(KERN_WARNING
543 "spurious IRQ for DMA channel %d\n", i);
544 }
545 }
546 }
547 return IRQ_HANDLED;
548}
549
550static int __init imx_dma_init(void)
551{
552 int ret;
553 int i;
554
555 /* reset DMA module */
556 DCR = DCR_DRST;
557
558 ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL);
559 if (ret) {
560 printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n");
561 return ret;
562 }
563
564 ret = request_irq(DMA_ERR, dma_err_handler, 0, "DMA", NULL);
565 if (ret) {
566 printk(KERN_CRIT "Wow! Can't register ERRIRQ for DMA\n");
567 free_irq(DMA_INT, NULL);
568 }
569
570 /* enable DMA module */
571 DCR = DCR_DEN;
572
573 /* clear all interrupts */
574 DISR = (1 << IMX_DMA_CHANNELS) - 1;
575
576 /* enable interrupts */
577 DIMR = (1 << IMX_DMA_CHANNELS) - 1;
578
579 for (i = 0; i < IMX_DMA_CHANNELS; i++) {
580 imx_dma_channels[i].sg = NULL;
581 imx_dma_channels[i].dma_num = i;
582 }
583
584 return ret;
585}
586
587arch_initcall(imx_dma_init);
588
589EXPORT_SYMBOL(imx_dma_setup_single);
590EXPORT_SYMBOL(imx_dma_setup_sg);
591EXPORT_SYMBOL(imx_dma_setup_handlers);
592EXPORT_SYMBOL(imx_dma_enable);
593EXPORT_SYMBOL(imx_dma_disable);
594EXPORT_SYMBOL(imx_dma_request);
595EXPORT_SYMBOL(imx_dma_free);
596EXPORT_SYMBOL(imx_dma_request_by_prio);
597EXPORT_SYMBOL(imx_dma_channels);
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
deleted file mode 100644
index 05f1739ee127..000000000000
--- a/arch/arm/mach-imx/generic.c
+++ /dev/null
@@ -1,271 +0,0 @@
1/*
2 * arch/arm/mach-imx/generic.c
3 *
4 * author: Sascha Hauer
5 * Created: april 20th, 2004
6 * Copyright: Synertronixx GmbH
7 *
8 * Common code for i.MX machines
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25#include <linux/platform_device.h>
26#include <linux/init.h>
27#include <linux/kernel.h>
28#include <linux/module.h>
29#include <linux/string.h>
30
31#include <asm/errno.h>
32#include <mach/hardware.h>
33#include <mach/imx-regs.h>
34
35#include <asm/mach/map.h>
36#include <mach/mmc.h>
37#include <mach/gpio.h>
38
39unsigned long imx_gpio_alloc_map[(GPIO_PORT_MAX + 1) * 32 / BITS_PER_LONG];
40
41void imx_gpio_mode(int gpio_mode)
42{
43 unsigned int pin = gpio_mode & GPIO_PIN_MASK;
44 unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
45 unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT;
46 unsigned int tmp;
47
48 /* Pullup enable */
49 if(gpio_mode & GPIO_PUEN)
50 PUEN(port) |= (1<<pin);
51 else
52 PUEN(port) &= ~(1<<pin);
53
54 /* Data direction */
55 if(gpio_mode & GPIO_OUT)
56 DDIR(port) |= 1<<pin;
57 else
58 DDIR(port) &= ~(1<<pin);
59
60 /* Primary / alternate function */
61 if(gpio_mode & GPIO_AF)
62 GPR(port) |= (1<<pin);
63 else
64 GPR(port) &= ~(1<<pin);
65
66 /* use as gpio? */
67 if(gpio_mode & GPIO_GIUS)
68 GIUS(port) |= (1<<pin);
69 else
70 GIUS(port) &= ~(1<<pin);
71
72 /* Output / input configuration */
73 /* FIXME: I'm not very sure about OCR and ICONF, someone
74 * should have a look over it
75 */
76 if(pin<16) {
77 tmp = OCR1(port);
78 tmp &= ~( 3<<(pin*2));
79 tmp |= (ocr << (pin*2));
80 OCR1(port) = tmp;
81
82 ICONFA1(port) &= ~( 3<<(pin*2));
83 ICONFA1(port) |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2);
84 ICONFB1(port) &= ~( 3<<(pin*2));
85 ICONFB1(port) |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << (pin * 2);
86 } else {
87 tmp = OCR2(port);
88 tmp &= ~( 3<<((pin-16)*2));
89 tmp |= (ocr << ((pin-16)*2));
90 OCR2(port) = tmp;
91
92 ICONFA2(port) &= ~( 3<<((pin-16)*2));
93 ICONFA2(port) |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << ((pin-16) * 2);
94 ICONFB2(port) &= ~( 3<<((pin-16)*2));
95 ICONFB2(port) |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << ((pin-16) * 2);
96 }
97}
98
99EXPORT_SYMBOL(imx_gpio_mode);
100
101int imx_gpio_request(unsigned gpio, const char *label)
102{
103 if(gpio >= (GPIO_PORT_MAX + 1) * 32) {
104 printk(KERN_ERR "imx_gpio: Attempt to request nonexistent GPIO %d for \"%s\"\n",
105 gpio, label ? label : "?");
106 return -EINVAL;
107 }
108
109 if(test_and_set_bit(gpio, imx_gpio_alloc_map)) {
110 printk(KERN_ERR "imx_gpio: GPIO %d already used. Allocation for \"%s\" failed\n",
111 gpio, label ? label : "?");
112 return -EBUSY;
113 }
114
115 return 0;
116}
117
118EXPORT_SYMBOL(imx_gpio_request);
119
120void imx_gpio_free(unsigned gpio)
121{
122 if(gpio >= (GPIO_PORT_MAX + 1) * 32)
123 return;
124
125 clear_bit(gpio, imx_gpio_alloc_map);
126}
127
128EXPORT_SYMBOL(imx_gpio_free);
129
130int imx_gpio_direction_input(unsigned gpio)
131{
132 imx_gpio_mode(gpio | GPIO_IN | GPIO_GIUS | GPIO_DR);
133 return 0;
134}
135
136EXPORT_SYMBOL(imx_gpio_direction_input);
137
138int imx_gpio_direction_output(unsigned gpio, int value)
139{
140 imx_gpio_set_value(gpio, value);
141 imx_gpio_mode(gpio | GPIO_OUT | GPIO_GIUS | GPIO_DR);
142 return 0;
143}
144
145EXPORT_SYMBOL(imx_gpio_direction_output);
146
147int imx_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
148 int alloc_mode, const char *label)
149{
150 const int *p = pin_list;
151 int i;
152 unsigned gpio;
153 unsigned mode;
154
155 for (i = 0; i < count; i++) {
156 gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
157 mode = *p & ~(GPIO_PIN_MASK | GPIO_PORT_MASK);
158
159 if (gpio >= (GPIO_PORT_MAX + 1) * 32)
160 goto setup_error;
161
162 if (alloc_mode & IMX_GPIO_ALLOC_MODE_RELEASE)
163 imx_gpio_free(gpio);
164 else if (!(alloc_mode & IMX_GPIO_ALLOC_MODE_NO_ALLOC))
165 if (imx_gpio_request(gpio, label))
166 if (!(alloc_mode & IMX_GPIO_ALLOC_MODE_TRY_ALLOC))
167 goto setup_error;
168
169 if (!(alloc_mode & (IMX_GPIO_ALLOC_MODE_ALLOC_ONLY |
170 IMX_GPIO_ALLOC_MODE_RELEASE)))
171 imx_gpio_mode(gpio | mode);
172
173 p++;
174 }
175 return 0;
176
177setup_error:
178 if(alloc_mode & (IMX_GPIO_ALLOC_MODE_NO_ALLOC |
179 IMX_GPIO_ALLOC_MODE_TRY_ALLOC))
180 return -EINVAL;
181
182 while (p != pin_list) {
183 p--;
184 gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
185 imx_gpio_free(gpio);
186 }
187
188 return -EINVAL;
189}
190
191EXPORT_SYMBOL(imx_gpio_setup_multiple_pins);
192
193void __imx_gpio_set_value(unsigned gpio, int value)
194{
195 imx_gpio_set_value_inline(gpio, value);
196}
197
198EXPORT_SYMBOL(__imx_gpio_set_value);
199
200int imx_gpio_to_irq(unsigned gpio)
201{
202 return IRQ_GPIOA(0) + gpio;
203}
204
205EXPORT_SYMBOL(imx_gpio_to_irq);
206
207int imx_irq_to_gpio(unsigned irq)
208{
209 if (irq < IRQ_GPIOA(0))
210 return -EINVAL;
211 return irq - IRQ_GPIOA(0);
212}
213
214EXPORT_SYMBOL(imx_irq_to_gpio);
215
216static struct resource imx_mmc_resources[] = {
217 [0] = {
218 .start = 0x00214000,
219 .end = 0x002140FF,
220 .flags = IORESOURCE_MEM,
221 },
222 [1] = {
223 .start = (SDHC_INT),
224 .end = (SDHC_INT),
225 .flags = IORESOURCE_IRQ,
226 },
227};
228
229static u64 imxmmmc_dmamask = 0xffffffffUL;
230
231static struct platform_device imx_mmc_device = {
232 .name = "imx-mmc",
233 .id = 0,
234 .dev = {
235 .dma_mask = &imxmmmc_dmamask,
236 .coherent_dma_mask = 0xffffffff,
237 },
238 .num_resources = ARRAY_SIZE(imx_mmc_resources),
239 .resource = imx_mmc_resources,
240};
241
242void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
243{
244 imx_mmc_device.dev.platform_data = info;
245}
246
247static struct platform_device *devices[] __initdata = {
248 &imx_mmc_device,
249};
250
251static struct map_desc imx_io_desc[] __initdata = {
252 {
253 .virtual = IMX_IO_BASE,
254 .pfn = __phys_to_pfn(IMX_IO_PHYS),
255 .length = IMX_IO_SIZE,
256 .type = MT_DEVICE
257 }
258};
259
260void __init
261imx_map_io(void)
262{
263 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
264}
265
266static int __init imx_init(void)
267{
268 return platform_add_devices(devices, ARRAY_SIZE(devices));
269}
270
271subsys_initcall(imx_init);
diff --git a/arch/arm/mach-imx/generic.h b/arch/arm/mach-imx/generic.h
deleted file mode 100644
index e91003e4bef3..000000000000
--- a/arch/arm/mach-imx/generic.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * linux/arch/arm/mach-imx/generic.h
3 *
4 * Author: Sascha Hauer <sascha@saschahauer.de>
5 * Copyright: Synertronixx GmbH
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12extern void __init imx_map_io(void);
13extern void __init imx_init_irq(void);
14
15struct sys_timer;
16extern struct sys_timer imx_timer;
diff --git a/arch/arm/mach-imx/include/mach/debug-macro.S b/arch/arm/mach-imx/include/mach/debug-macro.S
deleted file mode 100644
index 87802bbfe633..000000000000
--- a/arch/arm/mach-imx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,34 +0,0 @@
1/* arch/arm/mach-imx/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x00000000 @ physical
18 movne \rx, #0xe0000000 @ virtual
19 orreq \rx, \rx, #0x00200000 @ physical
20 orr \rx, \rx, #0x00006000 @ UART1 offset
21 .endm
22
23 .macro senduart,rd,rx
24 str \rd, [\rx, #0x40] @ TXDATA
25 .endm
26
27 .macro waituart,rd,rx
28 .endm
29
30 .macro busyuart,rd,rx
311002: ldr \rd, [\rx, #0x98] @ SR2
32 tst \rd, #1 << 3 @ TXDC
33 beq 1002b @ wait until transmit done
34 .endm
diff --git a/arch/arm/mach-imx/include/mach/dma.h b/arch/arm/mach-imx/include/mach/dma.h
deleted file mode 100644
index 621ff2c730f2..000000000000
--- a/arch/arm/mach-imx/include/mach/dma.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * linux/include/asm-arm/imxads/dma.h
3 *
4 * Copyright (C) 1997,1998 Russell King
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H
23
24typedef enum {
25 DMA_PRIO_HIGH = 0,
26 DMA_PRIO_MEDIUM = 1,
27 DMA_PRIO_LOW = 2
28} imx_dma_prio;
29
30#define DMA_REQ_UART3_T 2
31#define DMA_REQ_UART3_R 3
32#define DMA_REQ_SSI2_T 4
33#define DMA_REQ_SSI2_R 5
34#define DMA_REQ_CSI_STAT 6
35#define DMA_REQ_CSI_R 7
36#define DMA_REQ_MSHC 8
37#define DMA_REQ_DSPA_DCT_DOUT 9
38#define DMA_REQ_DSPA_DCT_DIN 10
39#define DMA_REQ_DSPA_MAC 11
40#define DMA_REQ_EXT 12
41#define DMA_REQ_SDHC 13
42#define DMA_REQ_SPI1_R 14
43#define DMA_REQ_SPI1_T 15
44#define DMA_REQ_SSI_T 16
45#define DMA_REQ_SSI_R 17
46#define DMA_REQ_ASP_DAC 18
47#define DMA_REQ_ASP_ADC 19
48#define DMA_REQ_USP_EP(x) (20+(x))
49#define DMA_REQ_SPI2_R 26
50#define DMA_REQ_SPI2_T 27
51#define DMA_REQ_UART2_T 28
52#define DMA_REQ_UART2_R 29
53#define DMA_REQ_UART1_T 30
54#define DMA_REQ_UART1_R 31
55
56#endif /* _ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-imx/include/mach/entry-macro.S b/arch/arm/mach-imx/include/mach/entry-macro.S
deleted file mode 100644
index e4db679f7766..000000000000
--- a/arch/arm/mach-imx/include/mach/entry-macro.S
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * arch/arm/mach-imx/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for iMX-based platforms
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 any
8 * warranty of any kind, whether express or implied.
9 */
10#include <mach/hardware.h>
11
12 .macro disable_fiq
13 .endm
14
15 .macro get_irqnr_preamble, base, tmp
16 .endm
17
18 .macro arch_ret_to_user, tmp1, tmp2
19 .endm
20
21#define AITC_NIVECSR 0x40
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23 ldr \base, =IO_ADDRESS(IMX_AITC_BASE)
24 @ Load offset & priority of the highest priority
25 @ interrupt pending.
26 ldr \irqstat, [\base, #AITC_NIVECSR]
27 @ Shift off the priority leaving the offset or
28 @ "interrupt number", use arithmetic shift to
29 @ transform illegal source (0xffff) as -1
30 mov \irqnr, \irqstat, asr #16
31 adds \tmp, \irqnr, #1
32 .endm
diff --git a/arch/arm/mach-imx/include/mach/gpio.h b/arch/arm/mach-imx/include/mach/gpio.h
deleted file mode 100644
index 6c2942f82922..000000000000
--- a/arch/arm/mach-imx/include/mach/gpio.h
+++ /dev/null
@@ -1,106 +0,0 @@
1#ifndef _IMX_GPIO_H
2
3#include <linux/kernel.h>
4#include <mach/hardware.h>
5#include <mach/imx-regs.h>
6
7#define IMX_GPIO_ALLOC_MODE_NORMAL 0
8#define IMX_GPIO_ALLOC_MODE_NO_ALLOC 1
9#define IMX_GPIO_ALLOC_MODE_TRY_ALLOC 2
10#define IMX_GPIO_ALLOC_MODE_ALLOC_ONLY 4
11#define IMX_GPIO_ALLOC_MODE_RELEASE 8
12
13extern int imx_gpio_request(unsigned gpio, const char *label);
14
15extern void imx_gpio_free(unsigned gpio);
16
17extern int imx_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
18 int alloc_mode, const char *label);
19
20extern int imx_gpio_direction_input(unsigned gpio);
21
22extern int imx_gpio_direction_output(unsigned gpio, int value);
23
24extern void __imx_gpio_set_value(unsigned gpio, int value);
25
26static inline int imx_gpio_get_value(unsigned gpio)
27{
28 return SSR(gpio >> GPIO_PORT_SHIFT) & (1 << (gpio & GPIO_PIN_MASK));
29}
30
31static inline void imx_gpio_set_value_inline(unsigned gpio, int value)
32{
33 unsigned long flags;
34
35 raw_local_irq_save(flags);
36 if(value)
37 DR(gpio >> GPIO_PORT_SHIFT) |= (1 << (gpio & GPIO_PIN_MASK));
38 else
39 DR(gpio >> GPIO_PORT_SHIFT) &= ~(1 << (gpio & GPIO_PIN_MASK));
40 raw_local_irq_restore(flags);
41}
42
43static inline void imx_gpio_set_value(unsigned gpio, int value)
44{
45 if(__builtin_constant_p(gpio))
46 imx_gpio_set_value_inline(gpio, value);
47 else
48 __imx_gpio_set_value(gpio, value);
49}
50
51extern int imx_gpio_to_irq(unsigned gpio);
52
53extern int imx_irq_to_gpio(unsigned irq);
54
55/*-------------------------------------------------------------------------*/
56
57/* Wrappers for "new style" GPIO calls. These calls i.MX specific versions
58 * to allow future extension of GPIO logic.
59 */
60
61static inline int gpio_request(unsigned gpio, const char *label)
62{
63 return imx_gpio_request(gpio, label);
64}
65
66static inline void gpio_free(unsigned gpio)
67{
68 might_sleep();
69
70 imx_gpio_free(gpio);
71}
72
73static inline int gpio_direction_input(unsigned gpio)
74{
75 return imx_gpio_direction_input(gpio);
76}
77
78static inline int gpio_direction_output(unsigned gpio, int value)
79{
80 return imx_gpio_direction_output(gpio, value);
81}
82
83static inline int gpio_get_value(unsigned gpio)
84{
85 return imx_gpio_get_value(gpio);
86}
87
88static inline void gpio_set_value(unsigned gpio, int value)
89{
90 imx_gpio_set_value(gpio, value);
91}
92
93#include <asm-generic/gpio.h> /* cansleep wrappers */
94
95static inline int gpio_to_irq(unsigned gpio)
96{
97 return imx_gpio_to_irq(gpio);
98}
99
100static inline int irq_to_gpio(unsigned irq)
101{
102 return imx_irq_to_gpio(irq);
103}
104
105
106#endif
diff --git a/arch/arm/mach-imx/include/mach/hardware.h b/arch/arm/mach-imx/include/mach/hardware.h
deleted file mode 100644
index c73e9e724c75..000000000000
--- a/arch/arm/mach-imx/include/mach/hardware.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * arch/arm/mach-imx/include/mach/hardware.h
3 *
4 * Copyright (C) 1999 ARM Limited.
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_HARDWARE_H
21#define __ASM_ARCH_HARDWARE_H
22
23#include <asm/sizes.h>
24#include "imx-regs.h"
25
26#ifndef __ASSEMBLY__
27# define __REG(x) (*((volatile u32 *)IO_ADDRESS(x)))
28
29# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
30#endif
31
32/*
33 * Memory map
34 */
35
36#define IMX_IO_PHYS 0x00200000
37#define IMX_IO_SIZE 0x00100000
38#define IMX_IO_BASE 0xe0000000
39
40#define IMX_CS0_PHYS 0x10000000
41#define IMX_CS0_SIZE 0x02000000
42#define IMX_CS0_VIRT 0xe8000000
43
44#define IMX_CS1_PHYS 0x12000000
45#define IMX_CS1_SIZE 0x01000000
46#define IMX_CS1_VIRT 0xea000000
47
48#define IMX_CS2_PHYS 0x13000000
49#define IMX_CS2_SIZE 0x01000000
50#define IMX_CS2_VIRT 0xeb000000
51
52#define IMX_CS3_PHYS 0x14000000
53#define IMX_CS3_SIZE 0x01000000
54#define IMX_CS3_VIRT 0xec000000
55
56#define IMX_CS4_PHYS 0x15000000
57#define IMX_CS4_SIZE 0x01000000
58#define IMX_CS4_VIRT 0xed000000
59
60#define IMX_CS5_PHYS 0x16000000
61#define IMX_CS5_SIZE 0x01000000
62#define IMX_CS5_VIRT 0xee000000
63
64#define IMX_FB_VIRT 0xF1000000
65#define IMX_FB_SIZE (256*1024)
66
67/* macro to get at IO space when running virtually */
68#define IO_ADDRESS(x) ((x) | IMX_IO_BASE)
69
70#ifndef __ASSEMBLY__
71/*
72 * Handy routine to set GPIO functions
73 */
74extern void imx_gpio_mode( int gpio_mode );
75
76#endif
77
78#define MAXIRQNUM 62
79#define MAXFIQNUM 62
80#define MAXSWINUM 62
81
82/*
83 * Use SDRAM for memory
84 */
85#define MEM_SIZE 0x01000000
86
87#ifdef CONFIG_ARCH_MX1ADS
88#include "mx1ads.h"
89#endif
90
91#endif
diff --git a/arch/arm/mach-imx/include/mach/imx-dma.h b/arch/arm/mach-imx/include/mach/imx-dma.h
deleted file mode 100644
index bbe54df7f0de..000000000000
--- a/arch/arm/mach-imx/include/mach/imx-dma.h
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * linux/include/asm-arm/imxads/dma.h
3 *
4 * Copyright (C) 1997,1998 Russell King
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <mach/dma.h>
22
23#ifndef __ASM_ARCH_IMX_DMA_H
24#define __ASM_ARCH_IMX_DMA_H
25
26#define IMX_DMA_CHANNELS 11
27
28/*
29 * struct imx_dma_channel - i.MX specific DMA extension
30 * @name: name specified by DMA client
31 * @irq_handler: client callback for end of transfer
32 * @err_handler: client callback for error condition
33 * @data: clients context data for callbacks
34 * @dma_mode: direction of the transfer %DMA_MODE_READ or %DMA_MODE_WRITE
35 * @sg: pointer to the actual read/written chunk for scatter-gather emulation
36 * @sgbc: counter of processed bytes in the actual read/written chunk
37 * @resbytes: total residual number of bytes to transfer
38 * (it can be lower or same as sum of SG mapped chunk sizes)
39 * @sgcount: number of chunks to be read/written
40 *
41 * Structure is used for IMX DMA processing. It would be probably good
42 * @struct dma_struct in the future for external interfacing and use
43 * @struct imx_dma_channel only as extension to it.
44 */
45
46struct imx_dma_channel {
47 const char *name;
48 void (*irq_handler) (int, void *);
49 void (*err_handler) (int, void *, int errcode);
50 void *data;
51 unsigned int dma_mode;
52 struct scatterlist *sg;
53 unsigned int sgbc;
54 unsigned int sgcount;
55 unsigned int resbytes;
56 int dma_num;
57};
58
59extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
60
61#define IMX_DMA_ERR_BURST 1
62#define IMX_DMA_ERR_REQUEST 2
63#define IMX_DMA_ERR_TRANSFER 4
64#define IMX_DMA_ERR_BUFFER 8
65
66/* The type to distinguish channel numbers parameter from ordinal int type */
67typedef int imx_dmach_t;
68
69#define DMA_MODE_READ 0
70#define DMA_MODE_WRITE 1
71#define DMA_MODE_MASK 1
72
73int
74imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
75 unsigned int dma_length, unsigned int dev_addr, unsigned int dmamode);
76
77int
78imx_dma_setup_sg(imx_dmach_t dma_ch,
79 struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
80 unsigned int dev_addr, unsigned int dmamode);
81
82int
83imx_dma_setup_handlers(imx_dmach_t dma_ch,
84 void (*irq_handler) (int, void *),
85 void (*err_handler) (int, void *, int), void *data);
86
87void imx_dma_enable(imx_dmach_t dma_ch);
88
89void imx_dma_disable(imx_dmach_t dma_ch);
90
91int imx_dma_request(imx_dmach_t dma_ch, const char *name);
92
93void imx_dma_free(imx_dmach_t dma_ch);
94
95imx_dmach_t imx_dma_request_by_prio(const char *name, imx_dma_prio prio);
96
97
98#endif /* _ASM_ARCH_IMX_DMA_H */
diff --git a/arch/arm/mach-imx/include/mach/imx-regs.h b/arch/arm/mach-imx/include/mach/imx-regs.h
deleted file mode 100644
index 490297fc0e38..000000000000
--- a/arch/arm/mach-imx/include/mach/imx-regs.h
+++ /dev/null
@@ -1,376 +0,0 @@
1#ifndef _IMX_REGS_H
2#define _IMX_REGS_H
3/* ------------------------------------------------------------------------
4 * Motorola IMX system registers
5 * ------------------------------------------------------------------------
6 *
7 */
8
9/*
10 * Register BASEs, based on OFFSETs
11 *
12 */
13#define IMX_AIPI1_BASE (0x00000 + IMX_IO_BASE)
14#define IMX_WDT_BASE (0x01000 + IMX_IO_BASE)
15#define IMX_TIM1_BASE (0x02000 + IMX_IO_BASE)
16#define IMX_TIM2_BASE (0x03000 + IMX_IO_BASE)
17#define IMX_RTC_BASE (0x04000 + IMX_IO_BASE)
18#define IMX_LCDC_BASE (0x05000 + IMX_IO_BASE)
19#define IMX_UART1_BASE (0x06000 + IMX_IO_BASE)
20#define IMX_UART2_BASE (0x07000 + IMX_IO_BASE)
21#define IMX_PWM_BASE (0x08000 + IMX_IO_BASE)
22#define IMX_DMAC_BASE (0x09000 + IMX_IO_BASE)
23#define IMX_AIPI2_BASE (0x10000 + IMX_IO_BASE)
24#define IMX_SIM_BASE (0x11000 + IMX_IO_BASE)
25#define IMX_USBD_BASE (0x12000 + IMX_IO_BASE)
26#define IMX_SPI1_BASE (0x13000 + IMX_IO_BASE)
27#define IMX_MMC_BASE (0x14000 + IMX_IO_BASE)
28#define IMX_ASP_BASE (0x15000 + IMX_IO_BASE)
29#define IMX_BTA_BASE (0x16000 + IMX_IO_BASE)
30#define IMX_I2C_BASE (0x17000 + IMX_IO_BASE)
31#define IMX_SSI_BASE (0x18000 + IMX_IO_BASE)
32#define IMX_SPI2_BASE (0x19000 + IMX_IO_BASE)
33#define IMX_MSHC_BASE (0x1A000 + IMX_IO_BASE)
34#define IMX_PLL_BASE (0x1B000 + IMX_IO_BASE)
35#define IMX_GPIO_BASE (0x1C000 + IMX_IO_BASE)
36#define IMX_EIM_BASE (0x20000 + IMX_IO_BASE)
37#define IMX_SDRAMC_BASE (0x21000 + IMX_IO_BASE)
38#define IMX_MMA_BASE (0x22000 + IMX_IO_BASE)
39#define IMX_AITC_BASE (0x23000 + IMX_IO_BASE)
40#define IMX_CSI_BASE (0x24000 + IMX_IO_BASE)
41
42/* PLL registers */
43#define CSCR __REG(IMX_PLL_BASE) /* Clock Source Control Register */
44#define CSCR_SPLL_RESTART (1<<22)
45#define CSCR_MPLL_RESTART (1<<21)
46#define CSCR_SYSTEM_SEL (1<<16)
47#define CSCR_BCLK_DIV (0xf<<10)
48#define CSCR_MPU_PRESC (1<<15)
49#define CSCR_SPEN (1<<1)
50#define CSCR_MPEN (1<<0)
51
52#define MPCTL0 __REG(IMX_PLL_BASE + 0x4) /* MCU PLL Control Register 0 */
53#define MPCTL1 __REG(IMX_PLL_BASE + 0x8) /* MCU PLL and System Clock Register 1 */
54#define SPCTL0 __REG(IMX_PLL_BASE + 0xc) /* System PLL Control Register 0 */
55#define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */
56#define PCDR __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Divider Register */
57
58/*
59 * GPIO Module and I/O Multiplexer
60 * x = 0..3 for reg_A, reg_B, reg_C, reg_D
61 */
62#define DDIR(x) __REG2(IMX_GPIO_BASE + 0x00, ((x) & 3) << 8)
63#define OCR1(x) __REG2(IMX_GPIO_BASE + 0x04, ((x) & 3) << 8)
64#define OCR2(x) __REG2(IMX_GPIO_BASE + 0x08, ((x) & 3) << 8)
65#define ICONFA1(x) __REG2(IMX_GPIO_BASE + 0x0c, ((x) & 3) << 8)
66#define ICONFA2(x) __REG2(IMX_GPIO_BASE + 0x10, ((x) & 3) << 8)
67#define ICONFB1(x) __REG2(IMX_GPIO_BASE + 0x14, ((x) & 3) << 8)
68#define ICONFB2(x) __REG2(IMX_GPIO_BASE + 0x18, ((x) & 3) << 8)
69#define DR(x) __REG2(IMX_GPIO_BASE + 0x1c, ((x) & 3) << 8)
70#define GIUS(x) __REG2(IMX_GPIO_BASE + 0x20, ((x) & 3) << 8)
71#define SSR(x) __REG2(IMX_GPIO_BASE + 0x24, ((x) & 3) << 8)
72#define ICR1(x) __REG2(IMX_GPIO_BASE + 0x28, ((x) & 3) << 8)
73#define ICR2(x) __REG2(IMX_GPIO_BASE + 0x2c, ((x) & 3) << 8)
74#define IMR(x) __REG2(IMX_GPIO_BASE + 0x30, ((x) & 3) << 8)
75#define ISR(x) __REG2(IMX_GPIO_BASE + 0x34, ((x) & 3) << 8)
76#define GPR(x) __REG2(IMX_GPIO_BASE + 0x38, ((x) & 3) << 8)
77#define SWR(x) __REG2(IMX_GPIO_BASE + 0x3c, ((x) & 3) << 8)
78#define PUEN(x) __REG2(IMX_GPIO_BASE + 0x40, ((x) & 3) << 8)
79
80#define GPIO_PORT_MAX 3
81
82#define GPIO_PIN_MASK 0x1f
83#define GPIO_PORT_MASK (0x3 << 5)
84
85#define GPIO_PORT_SHIFT 5
86#define GPIO_PORTA (0<<5)
87#define GPIO_PORTB (1<<5)
88#define GPIO_PORTC (2<<5)
89#define GPIO_PORTD (3<<5)
90
91#define GPIO_OUT (1<<7)
92#define GPIO_IN (0<<7)
93#define GPIO_PUEN (1<<8)
94
95#define GPIO_PF (0<<9)
96#define GPIO_AF (1<<9)
97
98#define GPIO_OCR_SHIFT 10
99#define GPIO_OCR_MASK (3<<10)
100#define GPIO_AIN (0<<10)
101#define GPIO_BIN (1<<10)
102#define GPIO_CIN (2<<10)
103#define GPIO_DR (3<<10)
104
105#define GPIO_AOUT_SHIFT 12
106#define GPIO_AOUT_MASK (3<<12)
107#define GPIO_AOUT (0<<12)
108#define GPIO_AOUT_ISR (1<<12)
109#define GPIO_AOUT_0 (2<<12)
110#define GPIO_AOUT_1 (3<<12)
111
112#define GPIO_BOUT_SHIFT 14
113#define GPIO_BOUT_MASK (3<<14)
114#define GPIO_BOUT (0<<14)
115#define GPIO_BOUT_ISR (1<<14)
116#define GPIO_BOUT_0 (2<<14)
117#define GPIO_BOUT_1 (3<<14)
118
119#define GPIO_GIUS (1<<16)
120
121/* assignements for GPIO alternate/primary functions */
122
123/* FIXME: This list is not completed. The correct directions are
124 * missing on some (many) pins
125 */
126#define PA0_AIN_SPI2_CLK ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 0 )
127#define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 )
128#define PA1_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTA | GPIO_IN | 1 )
129#define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 )
130#define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 )
131#define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 )
132#define PA4_PF_CSI_D0 ( GPIO_PORTA | GPIO_PF | 4 )
133#define PA5_PF_CSI_D1 ( GPIO_PORTA | GPIO_PF | 5 )
134#define PA6_PF_CSI_D2 ( GPIO_PORTA | GPIO_PF | 6 )
135#define PA7_PF_CSI_D3 ( GPIO_PORTA | GPIO_PF | 7 )
136#define PA8_PF_CSI_D4 ( GPIO_PORTA | GPIO_PF | 8 )
137#define PA9_PF_CSI_D5 ( GPIO_PORTA | GPIO_PF | 9 )
138#define PA10_PF_CSI_D6 ( GPIO_PORTA | GPIO_PF | 10 )
139#define PA11_PF_CSI_D7 ( GPIO_PORTA | GPIO_PF | 11 )
140#define PA12_PF_CSI_VSYNC ( GPIO_PORTA | GPIO_PF | 12 )
141#define PA13_PF_CSI_HSYNC ( GPIO_PORTA | GPIO_PF | 13 )
142#define PA14_PF_CSI_PIXCLK ( GPIO_PORTA | GPIO_PF | 14 )
143#define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 )
144#define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 )
145#define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 )
146#define PA17_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 17 )
147#define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 )
148#define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 )
149#define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 )
150#define PA21_PF_A0 ( GPIO_PORTA | GPIO_PF | 21 )
151#define PA22_PF_CS4 ( GPIO_PORTA | GPIO_PF | 22 )
152#define PA23_PF_CS5 ( GPIO_PORTA | GPIO_PF | 23 )
153#define PA24_PF_A16 ( GPIO_PORTA | GPIO_PF | 24 )
154#define PA24_AF_ETMTRACEPKT0 ( GPIO_PORTA | GPIO_AF | 24 )
155#define PA25_PF_A17 ( GPIO_PORTA | GPIO_PF | 25 )
156#define PA25_AF_ETMTRACEPKT1 ( GPIO_PORTA | GPIO_AF | 25 )
157#define PA26_PF_A18 ( GPIO_PORTA | GPIO_PF | 26 )
158#define PA26_AF_ETMTRACEPKT2 ( GPIO_PORTA | GPIO_AF | 26 )
159#define PA27_PF_A19 ( GPIO_PORTA | GPIO_PF | 27 )
160#define PA27_AF_ETMTRACEPKT3 ( GPIO_PORTA | GPIO_AF | 27 )
161#define PA28_PF_A20 ( GPIO_PORTA | GPIO_PF | 28 )
162#define PA28_AF_ETMPIPESTAT0 ( GPIO_PORTA | GPIO_AF | 28 )
163#define PA29_PF_A21 ( GPIO_PORTA | GPIO_PF | 29 )
164#define PA29_AF_ETMPIPESTAT1 ( GPIO_PORTA | GPIO_AF | 29 )
165#define PA30_PF_A22 ( GPIO_PORTA | GPIO_PF | 30 )
166#define PA30_AF_ETMPIPESTAT2 ( GPIO_PORTA | GPIO_AF | 30 )
167#define PA31_PF_A23 ( GPIO_PORTA | GPIO_PF | 31 )
168#define PA31_AF_ETMTRACECLK ( GPIO_PORTA | GPIO_AF | 31 )
169#define PB8_PF_SD_DAT0 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8 )
170#define PB8_AF_MS_PIO ( GPIO_PORTB | GPIO_AF | 8 )
171#define PB9_PF_SD_DAT1 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9 )
172#define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
173#define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
174#define PB10_AF_MS_SCLKI ( GPIO_PORTB | GPIO_AF | 10 )
175#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | 11 )
176#define PB11_AF_MS_SDIO ( GPIO_PORTB | GPIO_AF | 11 )
177#define PB12_PF_SD_CLK ( GPIO_PORTB | GPIO_PF | 12 )
178#define PB12_AF_MS_SCLK0 ( GPIO_PORTB | GPIO_AF | 12 )
179#define PB13_PF_SD_CMD ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13 )
180#define PB13_AF_MS_BS ( GPIO_PORTB | GPIO_AF | 13 )
181#define PB14_AF_SSI_RXFS ( GPIO_PORTB | GPIO_AF | 14 )
182#define PB15_AF_SSI_RXCLK ( GPIO_PORTB | GPIO_AF | 15 )
183#define PB16_AF_SSI_RXDAT ( GPIO_PORTB | GPIO_IN | GPIO_AF | 16 )
184#define PB17_AF_SSI_TXDAT ( GPIO_PORTB | GPIO_OUT | GPIO_AF | 17 )
185#define PB18_AF_SSI_TXFS ( GPIO_PORTB | GPIO_AF | 18 )
186#define PB19_AF_SSI_TXCLK ( GPIO_PORTB | GPIO_AF | 19 )
187#define PB20_PF_USBD_AFE ( GPIO_PORTB | GPIO_PF | 20 )
188#define PB21_PF_USBD_OE ( GPIO_PORTB | GPIO_PF | 21 )
189#define PB22_PFUSBD_RCV ( GPIO_PORTB | GPIO_PF | 22 )
190#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
191#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
192#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
193#define PB26_PF_USBD_VPO ( GPIO_PORTB | GPIO_PF | 26 )
194#define PB27_PF_USBD_VMO ( GPIO_PORTB | GPIO_PF | 27 )
195#define PB28_PF_UART2_CTS ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 28 )
196#define PB29_PF_UART2_RTS ( GPIO_PORTB | GPIO_IN | GPIO_PF | 29 )
197#define PB30_PF_UART2_TXD ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 30 )
198#define PB31_PF_UART2_RXD ( GPIO_PORTB | GPIO_IN | GPIO_PF | 31 )
199#define PC3_PF_SSI_RXFS ( GPIO_PORTC | GPIO_PF | 3 )
200#define PC4_PF_SSI_RXCLK ( GPIO_PORTC | GPIO_PF | 4 )
201#define PC5_PF_SSI_RXDAT ( GPIO_PORTC | GPIO_IN | GPIO_PF | 5 )
202#define PC6_PF_SSI_TXDAT ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 6 )
203#define PC7_PF_SSI_TXFS ( GPIO_PORTC | GPIO_PF | 7 )
204#define PC8_PF_SSI_TXCLK ( GPIO_PORTC | GPIO_PF | 8 )
205#define PC9_PF_UART1_CTS ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 9 )
206#define PC10_PF_UART1_RTS ( GPIO_PORTC | GPIO_IN | GPIO_PF | 10 )
207#define PC11_PF_UART1_TXD ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 11 )
208#define PC12_PF_UART1_RXD ( GPIO_PORTC | GPIO_IN | GPIO_PF | 12 )
209#define PC13_PF_SPI1_SPI_RDY ( GPIO_PORTC | GPIO_PF | 13 )
210#define PC14_PF_SPI1_SCLK ( GPIO_PORTC | GPIO_PF | 14 )
211#define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 )
212#define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 )
213#define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 )
214#define PC24_BIN_UART3_RI ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24 )
215#define PC25_BIN_UART3_DSR ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25 )
216#define PC26_AOUT_UART3_DTR ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 26 )
217#define PC27_BIN_UART3_DCD ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27 )
218#define PC28_BIN_UART3_CTS ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28 )
219#define PC29_AOUT_UART3_RTS ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 29 )
220#define PC30_BIN_UART3_TX ( GPIO_GIUS | GPIO_PORTC | GPIO_BIN | 30 )
221#define PC31_AOUT_UART3_RX ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 31)
222#define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 )
223#define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 )
224#define PD7_AF_UART2_DTR ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | GPIO_AF | 7 )
225#define PD7_AIN_SPI2_SCLK ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 7 )
226#define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 )
227#define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 )
228#define PD8_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 8 )
229#define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 )
230#define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 )
231#define PD9_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | 9 )
232#define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 )
233#define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 )
234#define PD10_AIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_OUT | 10 )
235#define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 )
236#define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 )
237#define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 )
238#define PD14_PF_FLM_VSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 14 )
239#define PD15_PF_LD0 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 15 )
240#define PD16_PF_LD1 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 16 )
241#define PD17_PF_LD2 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 17 )
242#define PD18_PF_LD3 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 18 )
243#define PD19_PF_LD4 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 19 )
244#define PD20_PF_LD5 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 20 )
245#define PD21_PF_LD6 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 21 )
246#define PD22_PF_LD7 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 22 )
247#define PD23_PF_LD8 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 23 )
248#define PD24_PF_LD9 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 24 )
249#define PD25_PF_LD10 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 25 )
250#define PD26_PF_LD11 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 26 )
251#define PD27_PF_LD12 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 27 )
252#define PD28_PF_LD13 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 28 )
253#define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 )
254#define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 )
255#define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 )
256#define PD31_BIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_BIN | 31 )
257
258/*
259 * PWM controller
260 */
261#define PWMC __REG(IMX_PWM_BASE + 0x00) /* PWM Control Register */
262#define PWMS __REG(IMX_PWM_BASE + 0x04) /* PWM Sample Register */
263#define PWMP __REG(IMX_PWM_BASE + 0x08) /* PWM Period Register */
264#define PWMCNT __REG(IMX_PWM_BASE + 0x0C) /* PWM Counter Register */
265
266#define PWMC_HCTR (0x01<<18) /* Halfword FIFO Data Swapping */
267#define PWMC_BCTR (0x01<<17) /* Byte FIFO Data Swapping */
268#define PWMC_SWR (0x01<<16) /* Software Reset */
269#define PWMC_CLKSRC (0x01<<15) /* Clock Source */
270#define PWMC_PRESCALER(x) (((x-1) & 0x7F) << 8) /* PRESCALER */
271#define PWMC_IRQ (0x01<< 7) /* Interrupt Request */
272#define PWMC_IRQEN (0x01<< 6) /* Interrupt Request Enable */
273#define PWMC_FIFOAV (0x01<< 5) /* FIFO Available */
274#define PWMC_EN (0x01<< 4) /* Enables/Disables the PWM */
275#define PWMC_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */
276#define PWMC_CLKSEL(x) (((x) & 0x03) << 0) /* Clock Selection */
277
278#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */
279#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */
280#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */
281
282/*
283 * DMA Controller
284 */
285#define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */
286#define DISR __REG(IMX_DMAC_BASE +0x04) /* DMA Interrupt status Register */
287#define DIMR __REG(IMX_DMAC_BASE +0x08) /* DMA Interrupt mask Register */
288#define DBTOSR __REG(IMX_DMAC_BASE +0x0c) /* DMA Burst timeout status Register */
289#define DRTOSR __REG(IMX_DMAC_BASE +0x10) /* DMA Request timeout Register */
290#define DSESR __REG(IMX_DMAC_BASE +0x14) /* DMA Transfer Error Status Register */
291#define DBOSR __REG(IMX_DMAC_BASE +0x18) /* DMA Buffer overflow status Register */
292#define DBTOCR __REG(IMX_DMAC_BASE +0x1c) /* DMA Burst timeout control Register */
293#define WSRA __REG(IMX_DMAC_BASE +0x40) /* W-Size Register A */
294#define XSRA __REG(IMX_DMAC_BASE +0x44) /* X-Size Register A */
295#define YSRA __REG(IMX_DMAC_BASE +0x48) /* Y-Size Register A */
296#define WSRB __REG(IMX_DMAC_BASE +0x4c) /* W-Size Register B */
297#define XSRB __REG(IMX_DMAC_BASE +0x50) /* X-Size Register B */
298#define YSRB __REG(IMX_DMAC_BASE +0x54) /* Y-Size Register B */
299#define SAR(x) __REG2( IMX_DMAC_BASE + 0x80, (x) << 6) /* Source Address Registers */
300#define DAR(x) __REG2( IMX_DMAC_BASE + 0x84, (x) << 6) /* Destination Address Registers */
301#define CNTR(x) __REG2( IMX_DMAC_BASE + 0x88, (x) << 6) /* Count Registers */
302#define CCR(x) __REG2( IMX_DMAC_BASE + 0x8c, (x) << 6) /* Control Registers */
303#define RSSR(x) __REG2( IMX_DMAC_BASE + 0x90, (x) << 6) /* Request source select Registers */
304#define BLR(x) __REG2( IMX_DMAC_BASE + 0x94, (x) << 6) /* Burst length Registers */
305#define RTOR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Request timeout Registers */
306#define BUCR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Bus Utilization Registers */
307
308#define DCR_DRST (1<<1)
309#define DCR_DEN (1<<0)
310#define DBTOCR_EN (1<<15)
311#define DBTOCR_CNT(x) ((x) & 0x7fff )
312#define CNTR_CNT(x) ((x) & 0xffffff )
313#define CCR_DMOD_LINEAR ( 0x0 << 12 )
314#define CCR_DMOD_2D ( 0x1 << 12 )
315#define CCR_DMOD_FIFO ( 0x2 << 12 )
316#define CCR_DMOD_EOBFIFO ( 0x3 << 12 )
317#define CCR_SMOD_LINEAR ( 0x0 << 10 )
318#define CCR_SMOD_2D ( 0x1 << 10 )
319#define CCR_SMOD_FIFO ( 0x2 << 10 )
320#define CCR_SMOD_EOBFIFO ( 0x3 << 10 )
321#define CCR_MDIR_DEC (1<<9)
322#define CCR_MSEL_B (1<<8)
323#define CCR_DSIZ_32 ( 0x0 << 6 )
324#define CCR_DSIZ_8 ( 0x1 << 6 )
325#define CCR_DSIZ_16 ( 0x2 << 6 )
326#define CCR_SSIZ_32 ( 0x0 << 4 )
327#define CCR_SSIZ_8 ( 0x1 << 4 )
328#define CCR_SSIZ_16 ( 0x2 << 4 )
329#define CCR_REN (1<<3)
330#define CCR_RPT (1<<2)
331#define CCR_FRC (1<<1)
332#define CCR_CEN (1<<0)
333#define RTOR_EN (1<<15)
334#define RTOR_CLK (1<<14)
335#define RTOR_PSC (1<<13)
336
337/*
338 * Interrupt controller
339 */
340
341#define IMX_INTCNTL __REG(IMX_AITC_BASE+0x00)
342#define INTCNTL_FIAD (1<<19)
343#define INTCNTL_NIAD (1<<20)
344
345#define IMX_NIMASK __REG(IMX_AITC_BASE+0x04)
346#define IMX_INTENNUM __REG(IMX_AITC_BASE+0x08)
347#define IMX_INTDISNUM __REG(IMX_AITC_BASE+0x0c)
348#define IMX_INTENABLEH __REG(IMX_AITC_BASE+0x10)
349#define IMX_INTENABLEL __REG(IMX_AITC_BASE+0x14)
350
351/*
352 * General purpose timers
353 */
354#define IMX_TCTL(x) __REG( 0x00 + (x))
355#define TCTL_SWR (1<<15)
356#define TCTL_FRR (1<<8)
357#define TCTL_CAP_RIS (1<<6)
358#define TCTL_CAP_FAL (2<<6)
359#define TCTL_CAP_RIS_FAL (3<<6)
360#define TCTL_OM (1<<5)
361#define TCTL_IRQEN (1<<4)
362#define TCTL_CLK_PCLK1 (1<<1)
363#define TCTL_CLK_PCLK1_16 (2<<1)
364#define TCTL_CLK_TIN (3<<1)
365#define TCTL_CLK_32 (4<<1)
366#define TCTL_TEN (1<<0)
367
368#define IMX_TPRER(x) __REG( 0x04 + (x))
369#define IMX_TCMP(x) __REG( 0x08 + (x))
370#define IMX_TCR(x) __REG( 0x0C + (x))
371#define IMX_TCN(x) __REG( 0x10 + (x))
372#define IMX_TSTAT(x) __REG( 0x14 + (x))
373#define TSTAT_CAPT (1<<1)
374#define TSTAT_COMP (1<<0)
375
376#endif // _IMX_REGS_H
diff --git a/arch/arm/mach-imx/include/mach/imx-uart.h b/arch/arm/mach-imx/include/mach/imx-uart.h
deleted file mode 100644
index d54eb1d48026..000000000000
--- a/arch/arm/mach-imx/include/mach/imx-uart.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef ASMARM_ARCH_UART_H
2#define ASMARM_ARCH_UART_H
3
4#define IMXUART_HAVE_RTSCTS (1<<0)
5
6struct imxuart_platform_data {
7 int (*init)(struct platform_device *pdev);
8 void (*exit)(struct platform_device *pdev);
9 unsigned int flags;
10};
11
12#endif
diff --git a/arch/arm/mach-imx/include/mach/irqs.h b/arch/arm/mach-imx/include/mach/irqs.h
deleted file mode 100644
index 67812c5ac1f9..000000000000
--- a/arch/arm/mach-imx/include/mach/irqs.h
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2 * arch/arm/mach-imxads/include/mach/irqs.h
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef __ARM_IRQS_H__
23#define __ARM_IRQS_H__
24
25/* Use the imx definitions */
26#include <mach/hardware.h>
27
28/*
29 * IMX Interrupt numbers
30 *
31 */
32#define INT_SOFTINT 0
33#define CSI_INT 6
34#define DSPA_MAC_INT 7
35#define DSPA_INT 8
36#define COMP_INT 9
37#define MSHC_XINT 10
38#define GPIO_INT_PORTA 11
39#define GPIO_INT_PORTB 12
40#define GPIO_INT_PORTC 13
41#define LCDC_INT 14
42#define SIM_INT 15
43#define SIM_DATA_INT 16
44#define RTC_INT 17
45#define RTC_SAMINT 18
46#define UART2_MINT_PFERR 19
47#define UART2_MINT_RTS 20
48#define UART2_MINT_DTR 21
49#define UART2_MINT_UARTC 22
50#define UART2_MINT_TX 23
51#define UART2_MINT_RX 24
52#define UART1_MINT_PFERR 25
53#define UART1_MINT_RTS 26
54#define UART1_MINT_DTR 27
55#define UART1_MINT_UARTC 28
56#define UART1_MINT_TX 29
57#define UART1_MINT_RX 30
58#define VOICE_DAC_INT 31
59#define VOICE_ADC_INT 32
60#define PEN_DATA_INT 33
61#define PWM_INT 34
62#define SDHC_INT 35
63#define I2C_INT 39
64#define CSPI_INT 41
65#define SSI_TX_INT 42
66#define SSI_TX_ERR_INT 43
67#define SSI_RX_INT 44
68#define SSI_RX_ERR_INT 45
69#define TOUCH_INT 46
70#define USBD_INT0 47
71#define USBD_INT1 48
72#define USBD_INT2 49
73#define USBD_INT3 50
74#define USBD_INT4 51
75#define USBD_INT5 52
76#define USBD_INT6 53
77#define BTSYS_INT 55
78#define BTTIM_INT 56
79#define BTWUI_INT 57
80#define TIM2_INT 58
81#define TIM1_INT 59
82#define DMA_ERR 60
83#define DMA_INT 61
84#define GPIO_INT_PORTD 62
85
86#define IMX_IRQS (64)
87
88/* note: the IMX has four gpio ports (A-D), but only
89 * the following pins are connected to the outside
90 * world:
91 *
92 * PORT A: bits 0-31
93 * PORT B: bits 8-31
94 * PORT C: bits 3-17
95 * PORT D: bits 6-31
96 *
97 * We map these interrupts straight on. As a result we have
98 * several holes in the interrupt mapping. We do this for two
99 * reasons:
100 * - mapping the interrupts without holes would get
101 * far more complicated
102 * - Motorola could well decide to bring some processor
103 * with more pins connected
104 */
105
106#define IRQ_GPIOA(x) (IMX_IRQS + x)
107#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
108#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
109#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
110
111/* decode irq number to use with IMR(x), ISR(x) and friends */
112#define IRQ_TO_REG(irq) ((irq - IMX_IRQS) >> 5)
113
114/* all normal IRQs can be FIQs */
115#define FIQ_START 0
116/* switch betwean IRQ and FIQ */
117extern int imx_set_irq_fiq(unsigned int irq, unsigned int type);
118
119#define NR_IRQS (IRQ_GPIOD(32) + 1)
120#define IRQ_GPIO(x)
121#endif
diff --git a/arch/arm/mach-imx/include/mach/mmc.h b/arch/arm/mach-imx/include/mach/mmc.h
deleted file mode 100644
index 4712f354dcca..000000000000
--- a/arch/arm/mach-imx/include/mach/mmc.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/host.h>
5
6struct device;
7
8struct imxmmc_platform_data {
9 int (*card_present)(struct device *);
10 int (*get_ro)(struct device *);
11};
12
13extern void imx_set_mmc_info(struct imxmmc_platform_data *info);
14
15#endif
diff --git a/arch/arm/mach-imx/include/mach/mx1ads.h b/arch/arm/mach-imx/include/mach/mx1ads.h
deleted file mode 100644
index def05d510eb3..000000000000
--- a/arch/arm/mach-imx/include/mach/mx1ads.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * arch/arm/mach-imx/include/mach/mx1ads.h
3 *
4 * Copyright (C) 2004 Robert Schwebel, Pengutronix
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef __ASM_ARCH_MX1ADS_H
23#define __ASM_ARCH_MX1ADS_H
24
25/* ------------------------------------------------------------------------ */
26/* Memory Map for the M9328MX1ADS (MX1ADS) Board */
27/* ------------------------------------------------------------------------ */
28
29#define MX1ADS_FLASH_PHYS 0x10000000
30#define MX1ADS_FLASH_SIZE (16*1024*1024)
31
32#define IMX_FB_PHYS (0x0C000000 - 0x40000)
33
34#define CLK32 32000
35
36#endif /* __ASM_ARCH_MX1ADS_H */
diff --git a/arch/arm/mach-imx/include/mach/spi_imx.h b/arch/arm/mach-imx/include/mach/spi_imx.h
deleted file mode 100644
index 4186430feecf..000000000000
--- a/arch/arm/mach-imx/include/mach/spi_imx.h
+++ /dev/null
@@ -1,72 +0,0 @@
1/*
2 * arch/arm/mach-imx/include/mach/spi_imx.h
3 *
4 * Copyright (C) 2006 SWAPP
5 * Andrea Paterniani <a.paterniani@swapp-eng.it>
6 *
7 * Initial version inspired by:
8 * linux-2.6.17-rc3-mm1/arch/arm/mach-pxa/include/mach/pxa2xx_spi.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#ifndef SPI_IMX_H_
26#define SPI_IMX_H_
27
28
29/*-------------------------------------------------------------------------*/
30/**
31 * struct spi_imx_master - device.platform_data for SPI controller devices.
32 * @num_chipselect: chipselects are used to distinguish individual
33 * SPI slaves, and are numbered from zero to num_chipselects - 1.
34 * each slave has a chipselect signal, but it's common that not
35 * every chipselect is connected to a slave.
36 * @enable_dma: if true enables DMA driven transfers.
37*/
38struct spi_imx_master {
39 u8 num_chipselect;
40 u8 enable_dma:1;
41};
42/*-------------------------------------------------------------------------*/
43
44
45/*-------------------------------------------------------------------------*/
46/**
47 * struct spi_imx_chip - spi_board_info.controller_data for SPI
48 * slave devices, copied to spi_device.controller_data.
49 * @enable_loopback : used for test purpouse to internally connect RX and TX
50 * sections.
51 * @enable_dma : enables dma transfer (provided that controller driver has
52 * dma enabled too).
53 * @ins_ss_pulse : enable /SS pulse insertion between SPI burst.
54 * @bclk_wait : number of bclk waits between each bits_per_word SPI burst.
55 * @cs_control : function pointer to board-specific function to assert/deassert
56 * I/O port to control HW generation of devices chip-select.
57*/
58struct spi_imx_chip {
59 u8 enable_loopback:1;
60 u8 enable_dma:1;
61 u8 ins_ss_pulse:1;
62 u16 bclk_wait:15;
63 void (*cs_control)(u32 control);
64};
65
66/* Chip-select state */
67#define SPI_CS_ASSERT (1 << 0)
68#define SPI_CS_DEASSERT (1 << 1)
69/*-------------------------------------------------------------------------*/
70
71
72#endif /* SPI_IMX_H_*/
diff --git a/arch/arm/mach-imx/include/mach/uncompress.h b/arch/arm/mach-imx/include/mach/uncompress.h
deleted file mode 100644
index 70523e67a8f6..000000000000
--- a/arch/arm/mach-imx/include/mach/uncompress.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * arch/arm/mach-imxads/include/mach/uncompress.h
3 *
4 *
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) Shane Nay (shane@minirl.com)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
25
26#define UART1_BASE 0x206000
27#define UART2_BASE 0x207000
28#define USR2 0x98
29#define USR2_TXFE (1<<14)
30#define TXR 0x40
31#define UCR1 0x80
32#define UCR1_UARTEN 1
33
34/*
35 * The following code assumes the serial port has already been
36 * initialized by the bootloader. We search for the first enabled
37 * port in the most probable order. If you didn't setup a port in
38 * your bootloader then nothing will appear (which might be desired).
39 *
40 * This does not append a newline
41 */
42static void putc(int c)
43{
44 unsigned long serial_port;
45
46 do {
47 serial_port = UART1_BASE;
48 if ( UART(UCR1) & UCR1_UARTEN )
49 break;
50 serial_port = UART2_BASE;
51 if ( UART(UCR1) & UCR1_UARTEN )
52 break;
53 return;
54 } while(0);
55
56 while (!(UART(USR2) & USR2_TXFE))
57 barrier();
58
59 UART(TXR) = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * nothing to do
68 */
69#define arch_decomp_setup()
70
71#define arch_decomp_wdog()
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
deleted file mode 100644
index 531b95deadc0..000000000000
--- a/arch/arm/mach-imx/irq.c
+++ /dev/null
@@ -1,311 +0,0 @@
1/*
2 * linux/arch/arm/mach-imx/irq.c
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * 03/03/2004 Sascha Hauer <sascha@saschahauer.de>
22 * Copied from the motorola bsp package and added gpio demux
23 * interrupt handler
24 */
25
26#include <linux/init.h>
27#include <linux/list.h>
28#include <linux/timer.h>
29#include <linux/io.h>
30
31#include <mach/hardware.h>
32#include <asm/irq.h>
33
34#include <asm/mach/irq.h>
35
36/*
37 *
38 * We simply use the ENABLE DISABLE registers inside of the IMX
39 * to turn on/off specific interrupts.
40 *
41 */
42
43#define INTCNTL_OFF 0x00
44#define NIMASK_OFF 0x04
45#define INTENNUM_OFF 0x08
46#define INTDISNUM_OFF 0x0C
47#define INTENABLEH_OFF 0x10
48#define INTENABLEL_OFF 0x14
49#define INTTYPEH_OFF 0x18
50#define INTTYPEL_OFF 0x1C
51#define NIPRIORITY_OFF(x) (0x20+4*(7-(x)))
52#define NIVECSR_OFF 0x40
53#define FIVECSR_OFF 0x44
54#define INTSRCH_OFF 0x48
55#define INTSRCL_OFF 0x4C
56#define INTFRCH_OFF 0x50
57#define INTFRCL_OFF 0x54
58#define NIPNDH_OFF 0x58
59#define NIPNDL_OFF 0x5C
60#define FIPNDH_OFF 0x60
61#define FIPNDL_OFF 0x64
62
63#define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE)
64#define IMX_AITC_INTCNTL (VA_AITC_BASE + INTCNTL_OFF)
65#define IMX_AITC_NIMASK (VA_AITC_BASE + NIMASK_OFF)
66#define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF)
67#define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF)
68#define IMX_AITC_INTENABLEH (VA_AITC_BASE + INTENABLEH_OFF)
69#define IMX_AITC_INTENABLEL (VA_AITC_BASE + INTENABLEL_OFF)
70#define IMX_AITC_INTTYPEH (VA_AITC_BASE + INTTYPEH_OFF)
71#define IMX_AITC_INTTYPEL (VA_AITC_BASE + INTTYPEL_OFF)
72#define IMX_AITC_NIPRIORITY(x) (VA_AITC_BASE + NIPRIORITY_OFF(x))
73#define IMX_AITC_NIVECSR (VA_AITC_BASE + NIVECSR_OFF)
74#define IMX_AITC_FIVECSR (VA_AITC_BASE + FIVECSR_OFF)
75#define IMX_AITC_INTSRCH (VA_AITC_BASE + INTSRCH_OFF)
76#define IMX_AITC_INTSRCL (VA_AITC_BASE + INTSRCL_OFF)
77#define IMX_AITC_INTFRCH (VA_AITC_BASE + INTFRCH_OFF)
78#define IMX_AITC_INTFRCL (VA_AITC_BASE + INTFRCL_OFF)
79#define IMX_AITC_NIPNDH (VA_AITC_BASE + NIPNDH_OFF)
80#define IMX_AITC_NIPNDL (VA_AITC_BASE + NIPNDL_OFF)
81#define IMX_AITC_FIPNDH (VA_AITC_BASE + FIPNDH_OFF)
82#define IMX_AITC_FIPNDL (VA_AITC_BASE + FIPNDL_OFF)
83
84#if 0
85#define DEBUG_IRQ(fmt...) printk(fmt)
86#else
87#define DEBUG_IRQ(fmt...) do { } while (0)
88#endif
89
90static void
91imx_mask_irq(unsigned int irq)
92{
93 __raw_writel(irq, IMX_AITC_INTDISNUM);
94}
95
96static void
97imx_unmask_irq(unsigned int irq)
98{
99 __raw_writel(irq, IMX_AITC_INTENNUM);
100}
101
102#ifdef CONFIG_FIQ
103int imx_set_irq_fiq(unsigned int irq, unsigned int type)
104{
105 unsigned int irqt;
106
107 if (irq >= IMX_IRQS)
108 return -EINVAL;
109
110 if (irq < IMX_IRQS / 2) {
111 irqt = __raw_readl(IMX_AITC_INTTYPEL) & ~(1 << irq);
112 __raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEL);
113 } else {
114 irq -= IMX_IRQS / 2;
115 irqt = __raw_readl(IMX_AITC_INTTYPEH) & ~(1 << irq);
116 __raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEH);
117 }
118
119 return 0;
120}
121EXPORT_SYMBOL(imx_set_irq_fiq);
122#endif /* CONFIG_FIQ */
123
124static int
125imx_gpio_irq_type(unsigned int _irq, unsigned int type)
126{
127 unsigned int irq_type = 0, irq, reg, bit;
128
129 irq = _irq - IRQ_GPIOA(0);
130 reg = irq >> 5;
131 bit = 1 << (irq % 32);
132
133 if (type == IRQ_TYPE_PROBE) {
134 /* Don't mess with enabled GPIOs using preconfigured edges or
135 GPIOs set to alternate function during probe */
136 /* TODO: support probe */
137// if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx]) &
138// GPIO_bit(gpio))
139// return 0;
140// if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
141// return 0;
142// type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
143 }
144
145 GIUS(reg) |= bit;
146 DDIR(reg) &= ~(bit);
147
148 DEBUG_IRQ("setting type of irq %d to ", _irq);
149
150 if (type & IRQ_TYPE_EDGE_RISING) {
151 DEBUG_IRQ("rising edges\n");
152 irq_type = 0x0;
153 }
154 if (type & IRQ_TYPE_EDGE_FALLING) {
155 DEBUG_IRQ("falling edges\n");
156 irq_type = 0x1;
157 }
158 if (type & IRQ_TYPE_LEVEL_LOW) {
159 DEBUG_IRQ("low level\n");
160 irq_type = 0x3;
161 }
162 if (type & IRQ_TYPE_LEVEL_HIGH) {
163 DEBUG_IRQ("high level\n");
164 irq_type = 0x2;
165 }
166
167 if (irq % 32 < 16) {
168 ICR1(reg) = (ICR1(reg) & ~(0x3 << ((irq % 16) * 2))) |
169 (irq_type << ((irq % 16) * 2));
170 } else {
171 ICR2(reg) = (ICR2(reg) & ~(0x3 << ((irq % 16) * 2))) |
172 (irq_type << ((irq % 16) * 2));
173 }
174
175 return 0;
176
177}
178
179static void
180imx_gpio_ack_irq(unsigned int irq)
181{
182 DEBUG_IRQ("%s: irq %d\n", __func__, irq);
183 ISR(IRQ_TO_REG(irq)) = 1 << ((irq - IRQ_GPIOA(0)) % 32);
184}
185
186static void
187imx_gpio_mask_irq(unsigned int irq)
188{
189 DEBUG_IRQ("%s: irq %d\n", __func__, irq);
190 IMR(IRQ_TO_REG(irq)) &= ~( 1 << ((irq - IRQ_GPIOA(0)) % 32));
191}
192
193static void
194imx_gpio_unmask_irq(unsigned int irq)
195{
196 DEBUG_IRQ("%s: irq %d\n", __func__, irq);
197 IMR(IRQ_TO_REG(irq)) |= 1 << ((irq - IRQ_GPIOA(0)) % 32);
198}
199
200static void
201imx_gpio_handler(unsigned int mask, unsigned int irq,
202 struct irq_desc *desc)
203{
204 while (mask) {
205 if (mask & 1) {
206 DEBUG_IRQ("handling irq %d\n", irq);
207 generic_handle_irq(irq);
208 }
209 irq++;
210 mask >>= 1;
211 }
212}
213
214static void
215imx_gpioa_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
216{
217 unsigned int mask, irq;
218
219 mask = ISR(0);
220 irq = IRQ_GPIOA(0);
221 imx_gpio_handler(mask, irq, desc);
222}
223
224static void
225imx_gpiob_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
226{
227 unsigned int mask, irq;
228
229 mask = ISR(1);
230 irq = IRQ_GPIOB(0);
231 imx_gpio_handler(mask, irq, desc);
232}
233
234static void
235imx_gpioc_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
236{
237 unsigned int mask, irq;
238
239 mask = ISR(2);
240 irq = IRQ_GPIOC(0);
241 imx_gpio_handler(mask, irq, desc);
242}
243
244static void
245imx_gpiod_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
246{
247 unsigned int mask, irq;
248
249 mask = ISR(3);
250 irq = IRQ_GPIOD(0);
251 imx_gpio_handler(mask, irq, desc);
252}
253
254static struct irq_chip imx_internal_chip = {
255 .name = "MPU",
256 .ack = imx_mask_irq,
257 .mask = imx_mask_irq,
258 .unmask = imx_unmask_irq,
259};
260
261static struct irq_chip imx_gpio_chip = {
262 .name = "GPIO",
263 .ack = imx_gpio_ack_irq,
264 .mask = imx_gpio_mask_irq,
265 .unmask = imx_gpio_unmask_irq,
266 .set_type = imx_gpio_irq_type,
267};
268
269void __init
270imx_init_irq(void)
271{
272 unsigned int irq;
273
274 DEBUG_IRQ("Initializing imx interrupts\n");
275
276 /* Disable all interrupts initially. */
277 /* Do not rely on the bootloader. */
278 __raw_writel(0, IMX_AITC_INTENABLEH);
279 __raw_writel(0, IMX_AITC_INTENABLEL);
280
281 /* Mask all GPIO interrupts as well */
282 IMR(0) = 0;
283 IMR(1) = 0;
284 IMR(2) = 0;
285 IMR(3) = 0;
286
287 for (irq = 0; irq < IMX_IRQS; irq++) {
288 set_irq_chip(irq, &imx_internal_chip);
289 set_irq_handler(irq, handle_level_irq);
290 set_irq_flags(irq, IRQF_VALID);
291 }
292
293 for (irq = IRQ_GPIOA(0); irq < IRQ_GPIOD(32); irq++) {
294 set_irq_chip(irq, &imx_gpio_chip);
295 set_irq_handler(irq, handle_edge_irq);
296 set_irq_flags(irq, IRQF_VALID);
297 }
298
299 set_irq_chained_handler(GPIO_INT_PORTA, imx_gpioa_demux_handler);
300 set_irq_chained_handler(GPIO_INT_PORTB, imx_gpiob_demux_handler);
301 set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler);
302 set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler);
303
304 /* Release masking of interrupts according to priority */
305 __raw_writel(-1, IMX_AITC_NIMASK);
306
307#ifdef CONFIG_FIQ
308 /* Initialize FIQ */
309 init_FIQ();
310#endif
311}
diff --git a/arch/arm/mach-imx/leds-mx1ads.c b/arch/arm/mach-imx/leds-mx1ads.c
deleted file mode 100644
index 1d48f2762cbc..000000000000
--- a/arch/arm/mach-imx/leds-mx1ads.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * linux/arch/arm/mach-imx/leds-mx1ads.c
3 *
4 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
5 *
6 * Original (leds-footbridge.c) by Russell King
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17#include <mach/hardware.h>
18#include <asm/system.h>
19#include <asm/leds.h>
20#include "leds.h"
21
22/*
23 * The MX1ADS Board has only one usable LED,
24 * so select only the timer led or the
25 * cpu usage led
26 */
27void
28mx1ads_leds_event(led_event_t ledevt)
29{
30 unsigned long flags;
31
32 local_irq_save(flags);
33
34 switch (ledevt) {
35#ifdef CONFIG_LEDS_CPU
36 case led_idle_start:
37 DR(0) &= ~(1<<2);
38 break;
39
40 case led_idle_end:
41 DR(0) |= 1<<2;
42 break;
43#endif
44
45#ifdef CONFIG_LEDS_TIMER
46 case led_timer:
47 DR(0) ^= 1<<2;
48#endif
49 default:
50 break;
51 }
52 local_irq_restore(flags);
53}
diff --git a/arch/arm/mach-imx/leds.c b/arch/arm/mach-imx/leds.c
deleted file mode 100644
index cf30803e019b..000000000000
--- a/arch/arm/mach-imx/leds.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * linux/arch/arm/mach-imx/leds.c
3 *
4 * Copyright (C) 2004 Sascha Hauer <sascha@saschahauer.de>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15
16#include <asm/leds.h>
17#include <asm/mach-types.h>
18
19#include "leds.h"
20
21static int __init
22leds_init(void)
23{
24 if (machine_is_mx1ads()) {
25 leds_event = mx1ads_leds_event;
26 }
27
28 return 0;
29}
30
31__initcall(leds_init);
diff --git a/arch/arm/mach-imx/leds.h b/arch/arm/mach-imx/leds.h
deleted file mode 100644
index 49dc1c1da338..000000000000
--- a/arch/arm/mach-imx/leds.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-imx/leds.h
3 *
4 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
5 *
6 * blinky lights for IMX-based systems
7 *
8 */
9extern void mx1ads_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
deleted file mode 100644
index 87fa1ff43b0b..000000000000
--- a/arch/arm/mach-imx/mx1ads.c
+++ /dev/null
@@ -1,180 +0,0 @@
1/*
2 * arch/arm/mach-imx/mx1ads.c
3 *
4 * Initially based on:
5 * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
6 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
7 *
8 * 2004 (c) MontaVista Software, Inc.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <linux/device.h>
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <asm/system.h>
19#include <mach/hardware.h>
20#include <asm/irq.h>
21#include <asm/pgtable.h>
22#include <asm/page.h>
23
24#include <asm/mach/map.h>
25#include <asm/mach-types.h>
26
27#include <asm/mach/arch.h>
28#include <mach/mmc.h>
29#include <mach/imx-uart.h>
30#include <linux/interrupt.h>
31#include "generic.h"
32
33static struct resource cs89x0_resources[] = {
34 [0] = {
35 .start = IMX_CS4_PHYS + 0x300,
36 .end = IMX_CS4_PHYS + 0x300 + 16,
37 .flags = IORESOURCE_MEM,
38 },
39 [1] = {
40 .start = IRQ_GPIOC(17),
41 .end = IRQ_GPIOC(17),
42 .flags = IORESOURCE_IRQ,
43 },
44};
45
46static struct platform_device cs89x0_device = {
47 .name = "cirrus-cs89x0",
48 .num_resources = ARRAY_SIZE(cs89x0_resources),
49 .resource = cs89x0_resources,
50};
51
52static struct imxuart_platform_data uart_pdata = {
53 .flags = IMXUART_HAVE_RTSCTS,
54};
55
56static struct resource imx_uart1_resources[] = {
57 [0] = {
58 .start = 0x00206000,
59 .end = 0x002060FF,
60 .flags = IORESOURCE_MEM,
61 },
62 [1] = {
63 .start = (UART1_MINT_RX),
64 .end = (UART1_MINT_RX),
65 .flags = IORESOURCE_IRQ,
66 },
67 [2] = {
68 .start = (UART1_MINT_TX),
69 .end = (UART1_MINT_TX),
70 .flags = IORESOURCE_IRQ,
71 },
72 [3] = {
73 .start = UART1_MINT_RTS,
74 .end = UART1_MINT_RTS,
75 .flags = IORESOURCE_IRQ,
76 },
77};
78
79static struct platform_device imx_uart1_device = {
80 .name = "imx-uart",
81 .id = 0,
82 .num_resources = ARRAY_SIZE(imx_uart1_resources),
83 .resource = imx_uart1_resources,
84 .dev = {
85 .platform_data = &uart_pdata,
86 }
87};
88
89static struct resource imx_uart2_resources[] = {
90 [0] = {
91 .start = 0x00207000,
92 .end = 0x002070FF,
93 .flags = IORESOURCE_MEM,
94 },
95 [1] = {
96 .start = (UART2_MINT_RX),
97 .end = (UART2_MINT_RX),
98 .flags = IORESOURCE_IRQ,
99 },
100 [2] = {
101 .start = (UART2_MINT_TX),
102 .end = (UART2_MINT_TX),
103 .flags = IORESOURCE_IRQ,
104 },
105 [3] = {
106 .start = UART2_MINT_RTS,
107 .end = UART2_MINT_RTS,
108 .flags = IORESOURCE_IRQ,
109 },
110};
111
112static struct platform_device imx_uart2_device = {
113 .name = "imx-uart",
114 .id = 1,
115 .num_resources = ARRAY_SIZE(imx_uart2_resources),
116 .resource = imx_uart2_resources,
117 .dev = {
118 .platform_data = &uart_pdata,
119 }
120};
121
122static struct platform_device *devices[] __initdata = {
123 &cs89x0_device,
124 &imx_uart1_device,
125 &imx_uart2_device,
126};
127
128#if defined(CONFIG_MMC_IMX) || defined(CONFIG_MMC_IMX_MODULE)
129static int mx1ads_mmc_card_present(struct device *dev)
130{
131 /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
132 return (SSR(1) & (1 << 20) ? 0 : 1);
133}
134
135static struct imxmmc_platform_data mx1ads_mmc_info = {
136 .card_present = mx1ads_mmc_card_present,
137};
138#endif
139
140static void __init
141mx1ads_init(void)
142{
143#ifdef CONFIG_LEDS
144 imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
145#endif
146#if defined(CONFIG_MMC_IMX) || defined(CONFIG_MMC_IMX_MODULE)
147 /* SD/MMC card detect */
148 imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
149 imx_set_mmc_info(&mx1ads_mmc_info);
150#endif
151
152 imx_gpio_mode(PC9_PF_UART1_CTS);
153 imx_gpio_mode(PC10_PF_UART1_RTS);
154 imx_gpio_mode(PC11_PF_UART1_TXD);
155 imx_gpio_mode(PC12_PF_UART1_RXD);
156
157 imx_gpio_mode(PB28_PF_UART2_CTS);
158 imx_gpio_mode(PB29_PF_UART2_RTS);
159 imx_gpio_mode(PB30_PF_UART2_TXD);
160 imx_gpio_mode(PB31_PF_UART2_RXD);
161
162 platform_add_devices(devices, ARRAY_SIZE(devices));
163}
164
165static void __init
166mx1ads_map_io(void)
167{
168 imx_map_io();
169}
170
171MACHINE_START(MX1ADS, "Motorola MX1ADS")
172 /* Maintainer: Sascha Hauer, Pengutronix */
173 .phys_io = 0x00200000,
174 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
175 .boot_params = 0x08000100,
176 .map_io = mx1ads_map_io,
177 .init_irq = imx_init_irq,
178 .timer = &imx_timer,
179 .init_machine = mx1ads_init,
180MACHINE_END
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
deleted file mode 100644
index 5aef18b599e5..000000000000
--- a/arch/arm/mach-imx/time.c
+++ /dev/null
@@ -1,220 +0,0 @@
1/*
2 * linux/arch/arm/mach-imx/time.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions
5 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
6 * Copyright (C) 2006-2007 Pavel Pisa (ppisa@pikron.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/init.h>
15#include <linux/interrupt.h>
16#include <linux/irq.h>
17#include <linux/time.h>
18#include <linux/clocksource.h>
19#include <linux/clockchips.h>
20#include <linux/clk.h>
21#include <linux/io.h>
22
23#include <mach/hardware.h>
24#include <asm/leds.h>
25#include <asm/irq.h>
26#include <asm/mach/time.h>
27
28/* Use timer 1 as system timer */
29#define TIMER_BASE IMX_TIM1_BASE
30
31static struct clock_event_device clockevent_imx;
32static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
33
34/*
35 * IRQ handler for the timer
36 */
37static irqreturn_t
38imx_timer_interrupt(int irq, void *dev_id)
39{
40 struct clock_event_device *evt = &clockevent_imx;
41 uint32_t tstat;
42 irqreturn_t ret = IRQ_NONE;
43
44 /* clear the interrupt */
45 tstat = IMX_TSTAT(TIMER_BASE);
46 IMX_TSTAT(TIMER_BASE) = 0;
47
48 if (tstat & TSTAT_COMP) {
49 evt->event_handler(evt);
50 ret = IRQ_HANDLED;
51 }
52
53 return ret;
54}
55
56static struct irqaction imx_timer_irq = {
57 .name = "i.MX Timer Tick",
58 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
59 .handler = imx_timer_interrupt,
60};
61
62/*
63 * Set up timer hardware into expected mode and state.
64 */
65static void __init imx_timer_hardware_init(void)
66{
67 /*
68 * Initialise to a known state (all timers off, and timing reset)
69 */
70 IMX_TCTL(TIMER_BASE) = 0;
71 IMX_TPRER(TIMER_BASE) = 0;
72
73 IMX_TCTL(TIMER_BASE) = TCTL_FRR | TCTL_CLK_PCLK1 | TCTL_TEN;
74}
75
76cycle_t imx_get_cycles(struct clocksource *cs)
77{
78 return IMX_TCN(TIMER_BASE);
79}
80
81static struct clocksource clocksource_imx = {
82 .name = "imx_timer1",
83 .rating = 200,
84 .read = imx_get_cycles,
85 .mask = 0xFFFFFFFF,
86 .shift = 20,
87 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
88};
89
90static int __init imx_clocksource_init(unsigned long rate)
91{
92 clocksource_imx.mult =
93 clocksource_hz2mult(rate, clocksource_imx.shift);
94 clocksource_register(&clocksource_imx);
95
96 return 0;
97}
98
99static int imx_set_next_event(unsigned long evt,
100 struct clock_event_device *unused)
101{
102 unsigned long tcmp;
103
104 tcmp = IMX_TCN(TIMER_BASE) + evt;
105 IMX_TCMP(TIMER_BASE) = tcmp;
106
107 return (int32_t)(tcmp - IMX_TCN(TIMER_BASE)) < 0 ? -ETIME : 0;
108}
109
110#ifdef DEBUG
111static const char *clock_event_mode_label[]={
112 [CLOCK_EVT_MODE_PERIODIC] = "CLOCK_EVT_MODE_PERIODIC",
113 [CLOCK_EVT_MODE_ONESHOT] = "CLOCK_EVT_MODE_ONESHOT",
114 [CLOCK_EVT_MODE_SHUTDOWN] = "CLOCK_EVT_MODE_SHUTDOWN",
115 [CLOCK_EVT_MODE_UNUSED] = "CLOCK_EVT_MODE_UNUSED"
116};
117#endif /*DEBUG*/
118
119static void imx_set_mode(enum clock_event_mode mode, struct clock_event_device *evt)
120{
121 unsigned long flags;
122
123 /*
124 * The timer interrupt generation is disabled at least
125 * for enough time to call imx_set_next_event()
126 */
127 local_irq_save(flags);
128 /* Disable interrupt in GPT module */
129 IMX_TCTL(TIMER_BASE) &= ~TCTL_IRQEN;
130 if (mode != clockevent_mode) {
131 /* Set event time into far-far future */
132 IMX_TCMP(TIMER_BASE) = IMX_TCN(TIMER_BASE) - 3;
133 /* Clear pending interrupt */
134 IMX_TSTAT(TIMER_BASE) &= ~TSTAT_COMP;
135 }
136
137#ifdef DEBUG
138 printk(KERN_INFO "imx_set_mode: changing mode from %s to %s\n",
139 clock_event_mode_label[clockevent_mode], clock_event_mode_label[mode]);
140#endif /*DEBUG*/
141
142 /* Remember timer mode */
143 clockevent_mode = mode;
144 local_irq_restore(flags);
145
146 switch (mode) {
147 case CLOCK_EVT_MODE_PERIODIC:
148 printk(KERN_ERR "imx_set_mode: Periodic mode is not supported for i.MX\n");
149 break;
150 case CLOCK_EVT_MODE_ONESHOT:
151 /*
152 * Do not put overhead of interrupt enable/disable into
153 * imx_set_next_event(), the core has about 4 minutes
154 * to call imx_set_next_event() or shutdown clock after
155 * mode switching
156 */
157 local_irq_save(flags);
158 IMX_TCTL(TIMER_BASE) |= TCTL_IRQEN;
159 local_irq_restore(flags);
160 break;
161 case CLOCK_EVT_MODE_SHUTDOWN:
162 case CLOCK_EVT_MODE_UNUSED:
163 case CLOCK_EVT_MODE_RESUME:
164 /* Left event sources disabled, no more interrupts appears */
165 break;
166 }
167}
168
169static struct clock_event_device clockevent_imx = {
170 .name = "imx_timer1",
171 .features = CLOCK_EVT_FEAT_ONESHOT,
172 .shift = 32,
173 .set_mode = imx_set_mode,
174 .set_next_event = imx_set_next_event,
175 .rating = 200,
176};
177
178static int __init imx_clockevent_init(unsigned long rate)
179{
180 clockevent_imx.mult = div_sc(rate, NSEC_PER_SEC,
181 clockevent_imx.shift);
182 clockevent_imx.max_delta_ns =
183 clockevent_delta2ns(0xfffffffe, &clockevent_imx);
184 clockevent_imx.min_delta_ns =
185 clockevent_delta2ns(0xf, &clockevent_imx);
186
187 clockevent_imx.cpumask = cpumask_of(0);
188
189 clockevents_register_device(&clockevent_imx);
190
191 return 0;
192}
193
194extern int imx_clocks_init(void);
195
196static void __init imx_timer_init(void)
197{
198 struct clk *clk;
199 unsigned long rate;
200
201 imx_clocks_init();
202
203 clk = clk_get(NULL, "perclk1");
204 clk_enable(clk);
205 rate = clk_get_rate(clk);
206
207 imx_timer_hardware_init();
208 imx_clocksource_init(rate);
209
210 imx_clockevent_init(rate);
211
212 /*
213 * Make irqs happen for the system timer
214 */
215 setup_irq(TIM1_INT, &imx_timer_irq);
216}
217
218struct sys_timer imx_timer = {
219 .init = imx_timer_init,
220};
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 2c5a02b8520e..264f4d59f898 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -78,6 +78,12 @@ config MACH_IXDP465
78 IXDP465 Development Platform (Also known as BMP). 78 IXDP465 Development Platform (Also known as BMP).
79 For more information on this platform, see <file:Documentation/arm/IXP4xx>. 79 For more information on this platform, see <file:Documentation/arm/IXP4xx>.
80 80
81config MACH_GORAMO_MLR
82 bool "GORAMO Multi Link Router"
83 help
84 Say 'Y' here if you want your kernel to support GORAMO
85 MultiLink router.
86
81config MACH_KIXRP435 87config MACH_KIXRP435
82 bool "KIXRP435" 88 bool "KIXRP435"
83 help 89 help
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile
index 2e6bbf927a74..47d1f60d23fa 100644
--- a/arch/arm/mach-ixp4xx/Makefile
+++ b/arch/arm/mach-ixp4xx/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o
30obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o 30obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
31obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o 31obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
32obj-$(CONFIG_MACH_FSG) += fsg-setup.o 32obj-$(CONFIG_MACH_FSG) += fsg-setup.o
33obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o
33 34
34obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o 35obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
35obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o 36obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
new file mode 100644
index 000000000000..a733b8ff3cec
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -0,0 +1,507 @@
1/*
2 * Goramo MultiLink router platform code
3 * Copyright (C) 2006-2009 Krzysztof Halasa <khc@pm.waw.pl>
4 */
5
6#include <linux/delay.h>
7#include <linux/hdlc.h>
8#include <linux/i2c-gpio.h>
9#include <linux/io.h>
10#include <linux/irq.h>
11#include <linux/kernel.h>
12#include <linux/pci.h>
13#include <linux/serial_8250.h>
14#include <asm/mach-types.h>
15#include <asm/system.h>
16#include <asm/mach/arch.h>
17#include <asm/mach/flash.h>
18#include <asm/mach/pci.h>
19
20#define xgpio_irq(n) (IRQ_IXP4XX_GPIO ## n)
21#define gpio_irq(n) xgpio_irq(n)
22
23#define SLOT_ETHA 0x0B /* IDSEL = AD21 */
24#define SLOT_ETHB 0x0C /* IDSEL = AD20 */
25#define SLOT_MPCI 0x0D /* IDSEL = AD19 */
26#define SLOT_NEC 0x0E /* IDSEL = AD18 */
27
28#define IRQ_ETHA IRQ_IXP4XX_GPIO4
29#define IRQ_ETHB IRQ_IXP4XX_GPIO5
30#define IRQ_NEC IRQ_IXP4XX_GPIO3
31#define IRQ_MPCI IRQ_IXP4XX_GPIO12
32
33/* GPIO lines */
34#define GPIO_SCL 0
35#define GPIO_SDA 1
36#define GPIO_STR 2
37#define GPIO_HSS0_DCD_N 6
38#define GPIO_HSS1_DCD_N 7
39#define GPIO_HSS0_CTS_N 10
40#define GPIO_HSS1_CTS_N 11
41#define GPIO_HSS1_RTS_N 13
42#define GPIO_HSS0_RTS_N 14
43
44/* Control outputs from 74HC4094 */
45#define CONTROL_HSS0_CLK_INT 0
46#define CONTROL_HSS1_CLK_INT 1
47#define CONTROL_HSS0_DTR_N 2
48#define CONTROL_HSS1_DTR_N 3
49#define CONTROL_EXT 4
50#define CONTROL_AUTO_RESET 5
51#define CONTROL_PCI_RESET_N 6
52#define CONTROL_EEPROM_WC_N 7
53
54/* offsets from start of flash ROM = 0x50000000 */
55#define CFG_ETH0_ADDRESS 0x40 /* 6 bytes */
56#define CFG_ETH1_ADDRESS 0x46 /* 6 bytes */
57#define CFG_REV 0x4C /* u32 */
58#define CFG_SDRAM_SIZE 0x50 /* u32 */
59#define CFG_SDRAM_CONF 0x54 /* u32 */
60#define CFG_SDRAM_MODE 0x58 /* u32 */
61#define CFG_SDRAM_REFRESH 0x5C /* u32 */
62
63#define CFG_HW_BITS 0x60 /* u32 */
64#define CFG_HW_USB_PORTS 0x00000007 /* 0 = no NEC chip, 1-5 = ports # */
65#define CFG_HW_HAS_PCI_SLOT 0x00000008
66#define CFG_HW_HAS_ETH0 0x00000010
67#define CFG_HW_HAS_ETH1 0x00000020
68#define CFG_HW_HAS_HSS0 0x00000040
69#define CFG_HW_HAS_HSS1 0x00000080
70#define CFG_HW_HAS_UART0 0x00000100
71#define CFG_HW_HAS_UART1 0x00000200
72#define CFG_HW_HAS_EEPROM 0x00000400
73
74#define FLASH_CMD_READ_ARRAY 0xFF
75#define FLASH_CMD_READ_ID 0x90
76#define FLASH_SER_OFF 0x102 /* 0x81 in 16-bit mode */
77
78static u32 hw_bits = 0xFFFFFFFD; /* assume all hardware present */;
79static u8 control_value;
80
81static void set_scl(u8 value)
82{
83 gpio_line_set(GPIO_SCL, !!value);
84 udelay(3);
85}
86
87static void set_sda(u8 value)
88{
89 gpio_line_set(GPIO_SDA, !!value);
90 udelay(3);
91}
92
93static void set_str(u8 value)
94{
95 gpio_line_set(GPIO_STR, !!value);
96 udelay(3);
97}
98
99static inline void set_control(int line, int value)
100{
101 if (value)
102 control_value |= (1 << line);
103 else
104 control_value &= ~(1 << line);
105}
106
107
108static void output_control(void)
109{
110 int i;
111
112 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT);
113 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT);
114
115 for (i = 0; i < 8; i++) {
116 set_scl(0);
117 set_sda(control_value & (0x80 >> i)); /* MSB first */
118 set_scl(1); /* active edge */
119 }
120
121 set_str(1);
122 set_str(0);
123
124 set_scl(0);
125 set_sda(1); /* Be ready for START */
126 set_scl(1);
127}
128
129
130static void (*set_carrier_cb_tab[2])(void *pdev, int carrier);
131
132static int hss_set_clock(int port, unsigned int clock_type)
133{
134 int ctrl_int = port ? CONTROL_HSS1_CLK_INT : CONTROL_HSS0_CLK_INT;
135
136 switch (clock_type) {
137 case CLOCK_DEFAULT:
138 case CLOCK_EXT:
139 set_control(ctrl_int, 0);
140 output_control();
141 return CLOCK_EXT;
142
143 case CLOCK_INT:
144 set_control(ctrl_int, 1);
145 output_control();
146 return CLOCK_INT;
147
148 default:
149 return -EINVAL;
150 }
151}
152
153static irqreturn_t hss_dcd_irq(int irq, void *pdev)
154{
155 int i, port = (irq == gpio_irq(GPIO_HSS1_DCD_N));
156 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i);
157 set_carrier_cb_tab[port](pdev, !i);
158 return IRQ_HANDLED;
159}
160
161
162static int hss_open(int port, void *pdev,
163 void (*set_carrier_cb)(void *pdev, int carrier))
164{
165 int i, irq;
166
167 if (!port)
168 irq = gpio_irq(GPIO_HSS0_DCD_N);
169 else
170 irq = gpio_irq(GPIO_HSS1_DCD_N);
171
172 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i);
173 set_carrier_cb(pdev, !i);
174
175 set_carrier_cb_tab[!!port] = set_carrier_cb;
176
177 if ((i = request_irq(irq, hss_dcd_irq, 0, "IXP4xx HSS", pdev)) != 0) {
178 printk(KERN_ERR "ixp4xx_hss: failed to request IRQ%i (%i)\n",
179 irq, i);
180 return i;
181 }
182
183 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0);
184 output_control();
185 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0);
186 return 0;
187}
188
189static void hss_close(int port, void *pdev)
190{
191 free_irq(port ? gpio_irq(GPIO_HSS1_DCD_N) : gpio_irq(GPIO_HSS0_DCD_N),
192 pdev);
193 set_carrier_cb_tab[!!port] = NULL; /* catch bugs */
194
195 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1);
196 output_control();
197 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1);
198}
199
200
201/* Flash memory */
202static struct flash_platform_data flash_data = {
203 .map_name = "cfi_probe",
204 .width = 2,
205};
206
207static struct resource flash_resource = {
208 .flags = IORESOURCE_MEM,
209};
210
211static struct platform_device device_flash = {
212 .name = "IXP4XX-Flash",
213 .id = 0,
214 .dev = { .platform_data = &flash_data },
215 .num_resources = 1,
216 .resource = &flash_resource,
217};
218
219
220/* I^2C interface */
221static struct i2c_gpio_platform_data i2c_data = {
222 .sda_pin = GPIO_SDA,
223 .scl_pin = GPIO_SCL,
224};
225
226static struct platform_device device_i2c = {
227 .name = "i2c-gpio",
228 .id = 0,
229 .dev = { .platform_data = &i2c_data },
230};
231
232
233/* IXP425 2 UART ports */
234static struct resource uart_resources[] = {
235 {
236 .start = IXP4XX_UART1_BASE_PHYS,
237 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
238 .flags = IORESOURCE_MEM,
239 },
240 {
241 .start = IXP4XX_UART2_BASE_PHYS,
242 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
243 .flags = IORESOURCE_MEM,
244 }
245};
246
247static struct plat_serial8250_port uart_data[] = {
248 {
249 .mapbase = IXP4XX_UART1_BASE_PHYS,
250 .membase = (char __iomem *)IXP4XX_UART1_BASE_VIRT +
251 REG_OFFSET,
252 .irq = IRQ_IXP4XX_UART1,
253 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
254 .iotype = UPIO_MEM,
255 .regshift = 2,
256 .uartclk = IXP4XX_UART_XTAL,
257 },
258 {
259 .mapbase = IXP4XX_UART2_BASE_PHYS,
260 .membase = (char __iomem *)IXP4XX_UART2_BASE_VIRT +
261 REG_OFFSET,
262 .irq = IRQ_IXP4XX_UART2,
263 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
264 .iotype = UPIO_MEM,
265 .regshift = 2,
266 .uartclk = IXP4XX_UART_XTAL,
267 },
268 { },
269};
270
271static struct platform_device device_uarts = {
272 .name = "serial8250",
273 .id = PLAT8250_DEV_PLATFORM,
274 .dev.platform_data = uart_data,
275 .num_resources = 2,
276 .resource = uart_resources,
277};
278
279
280/* Built-in 10/100 Ethernet MAC interfaces */
281static struct eth_plat_info eth_plat[] = {
282 {
283 .phy = 0,
284 .rxq = 3,
285 .txreadyq = 32,
286 }, {
287 .phy = 1,
288 .rxq = 4,
289 .txreadyq = 33,
290 }
291};
292
293static struct platform_device device_eth_tab[] = {
294 {
295 .name = "ixp4xx_eth",
296 .id = IXP4XX_ETH_NPEB,
297 .dev.platform_data = eth_plat,
298 }, {
299 .name = "ixp4xx_eth",
300 .id = IXP4XX_ETH_NPEC,
301 .dev.platform_data = eth_plat + 1,
302 }
303};
304
305
306/* IXP425 2 synchronous serial ports */
307static struct hss_plat_info hss_plat[] = {
308 {
309 .set_clock = hss_set_clock,
310 .open = hss_open,
311 .close = hss_close,
312 .txreadyq = 34,
313 }, {
314 .set_clock = hss_set_clock,
315 .open = hss_open,
316 .close = hss_close,
317 .txreadyq = 35,
318 }
319};
320
321static struct platform_device device_hss_tab[] = {
322 {
323 .name = "ixp4xx_hss",
324 .id = 0,
325 .dev.platform_data = hss_plat,
326 }, {
327 .name = "ixp4xx_hss",
328 .id = 1,
329 .dev.platform_data = hss_plat + 1,
330 }
331};
332
333
334static struct platform_device *device_tab[6] __initdata = {
335 &device_flash, /* index 0 */
336};
337
338static inline u8 __init flash_readb(u8 __iomem *flash, u32 addr)
339{
340#ifdef __ARMEB__
341 return __raw_readb(flash + addr);
342#else
343 return __raw_readb(flash + (addr ^ 3));
344#endif
345}
346
347static inline u16 __init flash_readw(u8 __iomem *flash, u32 addr)
348{
349#ifdef __ARMEB__
350 return __raw_readw(flash + addr);
351#else
352 return __raw_readw(flash + (addr ^ 2));
353#endif
354}
355
356static void __init gmlr_init(void)
357{
358 u8 __iomem *flash;
359 int i, devices = 1; /* flash */
360
361 ixp4xx_sys_init();
362
363 if ((flash = ioremap(IXP4XX_EXP_BUS_BASE_PHYS, 0x80)) == NULL)
364 printk(KERN_ERR "goramo-mlr: unable to access system"
365 " configuration data\n");
366 else {
367 system_rev = __raw_readl(flash + CFG_REV);
368 hw_bits = __raw_readl(flash + CFG_HW_BITS);
369
370 for (i = 0; i < ETH_ALEN; i++) {
371 eth_plat[0].hwaddr[i] =
372 flash_readb(flash, CFG_ETH0_ADDRESS + i);
373 eth_plat[1].hwaddr[i] =
374 flash_readb(flash, CFG_ETH1_ADDRESS + i);
375 }
376
377 __raw_writew(FLASH_CMD_READ_ID, flash);
378 system_serial_high = flash_readw(flash, FLASH_SER_OFF);
379 system_serial_high <<= 16;
380 system_serial_high |= flash_readw(flash, FLASH_SER_OFF + 2);
381 system_serial_low = flash_readw(flash, FLASH_SER_OFF + 4);
382 system_serial_low <<= 16;
383 system_serial_low |= flash_readw(flash, FLASH_SER_OFF + 6);
384 __raw_writew(FLASH_CMD_READ_ARRAY, flash);
385
386 iounmap(flash);
387 }
388
389 switch (hw_bits & (CFG_HW_HAS_UART0 | CFG_HW_HAS_UART1)) {
390 case CFG_HW_HAS_UART0:
391 memset(&uart_data[1], 0, sizeof(uart_data[1]));
392 device_uarts.num_resources = 1;
393 break;
394
395 case CFG_HW_HAS_UART1:
396 device_uarts.dev.platform_data = &uart_data[1];
397 device_uarts.resource = &uart_resources[1];
398 device_uarts.num_resources = 1;
399 break;
400 }
401 if (hw_bits & (CFG_HW_HAS_UART0 | CFG_HW_HAS_UART1))
402 device_tab[devices++] = &device_uarts; /* max index 1 */
403
404 if (hw_bits & CFG_HW_HAS_ETH0)
405 device_tab[devices++] = &device_eth_tab[0]; /* max index 2 */
406 if (hw_bits & CFG_HW_HAS_ETH1)
407 device_tab[devices++] = &device_eth_tab[1]; /* max index 3 */
408
409 if (hw_bits & CFG_HW_HAS_HSS0)
410 device_tab[devices++] = &device_hss_tab[0]; /* max index 4 */
411 if (hw_bits & CFG_HW_HAS_HSS1)
412 device_tab[devices++] = &device_hss_tab[1]; /* max index 5 */
413
414 if (hw_bits & CFG_HW_HAS_EEPROM)
415 device_tab[devices++] = &device_i2c; /* max index 6 */
416
417 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT);
418 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT);
419 gpio_line_config(GPIO_STR, IXP4XX_GPIO_OUT);
420 gpio_line_config(GPIO_HSS0_RTS_N, IXP4XX_GPIO_OUT);
421 gpio_line_config(GPIO_HSS1_RTS_N, IXP4XX_GPIO_OUT);
422 gpio_line_config(GPIO_HSS0_DCD_N, IXP4XX_GPIO_IN);
423 gpio_line_config(GPIO_HSS1_DCD_N, IXP4XX_GPIO_IN);
424 set_irq_type(gpio_irq(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH);
425 set_irq_type(gpio_irq(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH);
426
427 set_control(CONTROL_HSS0_DTR_N, 1);
428 set_control(CONTROL_HSS1_DTR_N, 1);
429 set_control(CONTROL_EEPROM_WC_N, 1);
430 set_control(CONTROL_PCI_RESET_N, 1);
431 output_control();
432
433 msleep(1); /* Wait for PCI devices to initialize */
434
435 flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
436 flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
437
438 platform_add_devices(device_tab, devices);
439}
440
441
442#ifdef CONFIG_PCI
443static void __init gmlr_pci_preinit(void)
444{
445 set_irq_type(IRQ_ETHA, IRQ_TYPE_LEVEL_LOW);
446 set_irq_type(IRQ_ETHB, IRQ_TYPE_LEVEL_LOW);
447 set_irq_type(IRQ_NEC, IRQ_TYPE_LEVEL_LOW);
448 set_irq_type(IRQ_MPCI, IRQ_TYPE_LEVEL_LOW);
449 ixp4xx_pci_preinit();
450}
451
452static void __init gmlr_pci_postinit(void)
453{
454 if ((hw_bits & CFG_HW_USB_PORTS) >= 2 &&
455 (hw_bits & CFG_HW_USB_PORTS) < 5) {
456 /* need to adjust number of USB ports on NEC chip */
457 u32 value, addr = BIT(32 - SLOT_NEC) | 0xE0;
458 if (!ixp4xx_pci_read(addr, NP_CMD_CONFIGREAD, &value)) {
459 value &= ~7;
460 value |= (hw_bits & CFG_HW_USB_PORTS);
461 ixp4xx_pci_write(addr, NP_CMD_CONFIGWRITE, value);
462 }
463 }
464}
465
466static int __init gmlr_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
467{
468 switch(slot) {
469 case SLOT_ETHA: return IRQ_ETHA;
470 case SLOT_ETHB: return IRQ_ETHB;
471 case SLOT_NEC: return IRQ_NEC;
472 default: return IRQ_MPCI;
473 }
474}
475
476static struct hw_pci gmlr_hw_pci __initdata = {
477 .nr_controllers = 1,
478 .preinit = gmlr_pci_preinit,
479 .postinit = gmlr_pci_postinit,
480 .swizzle = pci_std_swizzle,
481 .setup = ixp4xx_setup,
482 .scan = ixp4xx_scan_bus,
483 .map_irq = gmlr_map_irq,
484};
485
486static int __init gmlr_pci_init(void)
487{
488 if (machine_is_goramo_mlr() &&
489 (hw_bits & (CFG_HW_USB_PORTS | CFG_HW_HAS_PCI_SLOT)))
490 pci_common_init(&gmlr_hw_pci);
491 return 0;
492}
493
494subsys_initcall(gmlr_pci_init);
495#endif /* CONFIG_PCI */
496
497
498MACHINE_START(GORAMO_MLR, "MultiLink")
499 /* Maintainer: Krzysztof Halasa */
500 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
501 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
502 .map_io = ixp4xx_map_io,
503 .init_irq = ixp4xx_init_irq,
504 .timer = &ixp4xx_timer,
505 .boot_params = 0x0100,
506 .init_machine = gmlr_init,
507MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/include/mach/cpu.h b/arch/arm/mach-ixp4xx/include/mach/cpu.h
index def7773be67c..b2ef65db0e91 100644
--- a/arch/arm/mach-ixp4xx/include/mach/cpu.h
+++ b/arch/arm/mach-ixp4xx/include/mach/cpu.h
@@ -26,6 +26,8 @@
26#define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */ 26#define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */
27#define IXP46X_PROCESSOR_ID_MASK 0xfffffff0 27#define IXP46X_PROCESSOR_ID_MASK 0xfffffff0
28 28
29#define cpu_is_ixp42x_rev_a0() ((read_cpuid_id() & (IXP42X_PROCESSOR_ID_MASK | 0xF)) == \
30 IXP42X_PROCESSOR_ID_VALUE)
29#define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \ 31#define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \
30 IXP42X_PROCESSOR_ID_VALUE) 32 IXP42X_PROCESSOR_ID_VALUE)
31#define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \ 33#define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \
@@ -35,8 +37,11 @@
35 37
36static inline u32 ixp4xx_read_feature_bits(void) 38static inline u32 ixp4xx_read_feature_bits(void)
37{ 39{
38 unsigned int val = ~*IXP4XX_EXP_CFG2; 40 u32 val = ~*IXP4XX_EXP_CFG2;
39 41
42 if (cpu_is_ixp42x_rev_a0())
43 return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP |
44 IXP4XX_FEATURE_AES);
40 if (cpu_is_ixp42x()) 45 if (cpu_is_ixp42x())
41 return val & IXP42X_FEATURE_MASK; 46 return val & IXP42X_FEATURE_MASK;
42 if (cpu_is_ixp43x()) 47 if (cpu_is_ixp43x())
diff --git a/arch/arm/mach-ixp4xx/include/mach/qmgr.h b/arch/arm/mach-ixp4xx/include/mach/qmgr.h
index 0cbe6ceb67c5..9e7cad2d54cb 100644
--- a/arch/arm/mach-ixp4xx/include/mach/qmgr.h
+++ b/arch/arm/mach-ixp4xx/include/mach/qmgr.h
@@ -15,7 +15,7 @@
15#define DEBUG_QMGR 0 15#define DEBUG_QMGR 0
16 16
17#define HALF_QUEUES 32 17#define HALF_QUEUES 32
18#define QUEUES 64 /* only 32 lower queues currently supported */ 18#define QUEUES 64
19#define MAX_QUEUE_LENGTH 4 /* in dwords */ 19#define MAX_QUEUE_LENGTH 4 /* in dwords */
20 20
21#define QUEUE_STAT1_EMPTY 1 /* queue status bits */ 21#define QUEUE_STAT1_EMPTY 1 /* queue status bits */
@@ -110,48 +110,95 @@ static inline u32 qmgr_get_entry(unsigned int queue)
110 return val; 110 return val;
111} 111}
112 112
113static inline int qmgr_get_stat1(unsigned int queue) 113static inline int __qmgr_get_stat1(unsigned int queue)
114{ 114{
115 extern struct qmgr_regs __iomem *qmgr_regs; 115 extern struct qmgr_regs __iomem *qmgr_regs;
116 return (__raw_readl(&qmgr_regs->stat1[queue >> 3]) 116 return (__raw_readl(&qmgr_regs->stat1[queue >> 3])
117 >> ((queue & 7) << 2)) & 0xF; 117 >> ((queue & 7) << 2)) & 0xF;
118} 118}
119 119
120static inline int qmgr_get_stat2(unsigned int queue) 120static inline int __qmgr_get_stat2(unsigned int queue)
121{ 121{
122 extern struct qmgr_regs __iomem *qmgr_regs; 122 extern struct qmgr_regs __iomem *qmgr_regs;
123 BUG_ON(queue >= HALF_QUEUES);
123 return (__raw_readl(&qmgr_regs->stat2[queue >> 4]) 124 return (__raw_readl(&qmgr_regs->stat2[queue >> 4])
124 >> ((queue & 0xF) << 1)) & 0x3; 125 >> ((queue & 0xF) << 1)) & 0x3;
125} 126}
126 127
128/**
129 * qmgr_stat_empty() - checks if a hardware queue is empty
130 * @queue: queue number
131 *
132 * Returns non-zero value if the queue is empty.
133 */
127static inline int qmgr_stat_empty(unsigned int queue) 134static inline int qmgr_stat_empty(unsigned int queue)
128{ 135{
129 return !!(qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY); 136 BUG_ON(queue >= HALF_QUEUES);
137 return __qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY;
130} 138}
131 139
132static inline int qmgr_stat_nearly_empty(unsigned int queue) 140/**
141 * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark
142 * @queue: queue number
143 *
144 * Returns non-zero value if the queue is below low watermark.
145 */
146static inline int qmgr_stat_below_low_watermark(unsigned int queue)
133{ 147{
134 return !!(qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY); 148 extern struct qmgr_regs __iomem *qmgr_regs;
149 if (queue >= HALF_QUEUES)
150 return (__raw_readl(&qmgr_regs->statne_h) >>
151 (queue - HALF_QUEUES)) & 0x01;
152 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY;
135} 153}
136 154
137static inline int qmgr_stat_nearly_full(unsigned int queue) 155/**
156 * qmgr_stat_above_high_watermark() - checks if a queue is above high watermark
157 * @queue: queue number
158 *
159 * Returns non-zero value if the queue is above high watermark
160 */
161static inline int qmgr_stat_above_high_watermark(unsigned int queue)
138{ 162{
139 return !!(qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL); 163 BUG_ON(queue >= HALF_QUEUES);
164 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL;
140} 165}
141 166
167/**
168 * qmgr_stat_full() - checks if a hardware queue is full
169 * @queue: queue number
170 *
171 * Returns non-zero value if the queue is full.
172 */
142static inline int qmgr_stat_full(unsigned int queue) 173static inline int qmgr_stat_full(unsigned int queue)
143{ 174{
144 return !!(qmgr_get_stat1(queue) & QUEUE_STAT1_FULL); 175 extern struct qmgr_regs __iomem *qmgr_regs;
176 if (queue >= HALF_QUEUES)
177 return (__raw_readl(&qmgr_regs->statf_h) >>
178 (queue - HALF_QUEUES)) & 0x01;
179 return __qmgr_get_stat1(queue) & QUEUE_STAT1_FULL;
145} 180}
146 181
182/**
183 * qmgr_stat_underflow() - checks if a hardware queue experienced underflow
184 * @queue: queue number
185 *
186 * Returns non-zero value if the queue experienced underflow.
187 */
147static inline int qmgr_stat_underflow(unsigned int queue) 188static inline int qmgr_stat_underflow(unsigned int queue)
148{ 189{
149 return !!(qmgr_get_stat2(queue) & QUEUE_STAT2_UNDERFLOW); 190 return __qmgr_get_stat2(queue) & QUEUE_STAT2_UNDERFLOW;
150} 191}
151 192
193/**
194 * qmgr_stat_overflow() - checks if a hardware queue experienced overflow
195 * @queue: queue number
196 *
197 * Returns non-zero value if the queue experienced overflow.
198 */
152static inline int qmgr_stat_overflow(unsigned int queue) 199static inline int qmgr_stat_overflow(unsigned int queue)
153{ 200{
154 return !!(qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW); 201 return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW;
155} 202}
156 203
157#endif 204#endif
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_npe.c b/arch/arm/mach-ixp4xx/ixp4xx_npe.c
index 7bb8e778e4b6..47ac69c7ec78 100644
--- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c
+++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c
@@ -386,15 +386,6 @@ static int npe_reset(struct npe *npe)
386 /* reset the NPE */ 386 /* reset the NPE */
387 ixp4xx_write_feature_bits(val & 387 ixp4xx_write_feature_bits(val &
388 ~(IXP4XX_FEATURE_RESET_NPEA << npe->id)); 388 ~(IXP4XX_FEATURE_RESET_NPEA << npe->id));
389 for (i = 0; i < MAX_RETRIES; i++) {
390 if (!(ixp4xx_read_feature_bits() &
391 (IXP4XX_FEATURE_RESET_NPEA << npe->id)))
392 break; /* reset completed */
393 udelay(1);
394 }
395 if (i == MAX_RETRIES)
396 return -ETIMEDOUT;
397
398 /* deassert reset */ 389 /* deassert reset */
399 ixp4xx_write_feature_bits(val | 390 ixp4xx_write_feature_bits(val |
400 (IXP4XX_FEATURE_RESET_NPEA << npe->id)); 391 (IXP4XX_FEATURE_RESET_NPEA << npe->id));
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
index bfddc73d0a20..bfdbe4b5a3cc 100644
--- a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
+++ b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
@@ -18,8 +18,8 @@ struct qmgr_regs __iomem *qmgr_regs;
18static struct resource *mem_res; 18static struct resource *mem_res;
19static spinlock_t qmgr_lock; 19static spinlock_t qmgr_lock;
20static u32 used_sram_bitmap[4]; /* 128 16-dword pages */ 20static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
21static void (*irq_handlers[HALF_QUEUES])(void *pdev); 21static void (*irq_handlers[QUEUES])(void *pdev);
22static void *irq_pdevs[HALF_QUEUES]; 22static void *irq_pdevs[QUEUES];
23 23
24#if DEBUG_QMGR 24#if DEBUG_QMGR
25char qmgr_queue_descs[QUEUES][32]; 25char qmgr_queue_descs[QUEUES][32];
@@ -28,51 +28,112 @@ char qmgr_queue_descs[QUEUES][32];
28void qmgr_set_irq(unsigned int queue, int src, 28void qmgr_set_irq(unsigned int queue, int src,
29 void (*handler)(void *pdev), void *pdev) 29 void (*handler)(void *pdev), void *pdev)
30{ 30{
31 u32 __iomem *reg = &qmgr_regs->irqsrc[queue / 8]; /* 8 queues / u32 */
32 int bit = (queue % 8) * 4; /* 3 bits + 1 reserved bit per queue */
33 unsigned long flags; 31 unsigned long flags;
34 32
35 src &= 7;
36 spin_lock_irqsave(&qmgr_lock, flags); 33 spin_lock_irqsave(&qmgr_lock, flags);
37 __raw_writel((__raw_readl(reg) & ~(7 << bit)) | (src << bit), reg); 34 if (queue < HALF_QUEUES) {
35 u32 __iomem *reg;
36 int bit;
37 BUG_ON(src > QUEUE_IRQ_SRC_NOT_FULL);
38 reg = &qmgr_regs->irqsrc[queue >> 3]; /* 8 queues per u32 */
39 bit = (queue % 8) * 4; /* 3 bits + 1 reserved bit per queue */
40 __raw_writel((__raw_readl(reg) & ~(7 << bit)) | (src << bit),
41 reg);
42 } else
43 /* IRQ source for queues 32-63 is fixed */
44 BUG_ON(src != QUEUE_IRQ_SRC_NOT_NEARLY_EMPTY);
45
38 irq_handlers[queue] = handler; 46 irq_handlers[queue] = handler;
39 irq_pdevs[queue] = pdev; 47 irq_pdevs[queue] = pdev;
40 spin_unlock_irqrestore(&qmgr_lock, flags); 48 spin_unlock_irqrestore(&qmgr_lock, flags);
41} 49}
42 50
43 51
44static irqreturn_t qmgr_irq1(int irq, void *pdev) 52static irqreturn_t qmgr_irq1_a0(int irq, void *pdev)
45{ 53{
46 int i; 54 int i, ret = 0;
47 u32 val = __raw_readl(&qmgr_regs->irqstat[0]); 55 u32 en_bitmap, src, stat;
48 __raw_writel(val, &qmgr_regs->irqstat[0]); /* ACK */ 56
49 57 /* ACK - it may clear any bits so don't rely on it */
50 for (i = 0; i < HALF_QUEUES; i++) 58 __raw_writel(0xFFFFFFFF, &qmgr_regs->irqstat[0]);
51 if (val & (1 << i)) 59
60 en_bitmap = qmgr_regs->irqen[0];
61 while (en_bitmap) {
62 i = __fls(en_bitmap); /* number of the last "low" queue */
63 en_bitmap &= ~BIT(i);
64 src = qmgr_regs->irqsrc[i >> 3];
65 stat = qmgr_regs->stat1[i >> 3];
66 if (src & 4) /* the IRQ condition is inverted */
67 stat = ~stat;
68 if (stat & BIT(src & 3)) {
52 irq_handlers[i](irq_pdevs[i]); 69 irq_handlers[i](irq_pdevs[i]);
70 ret = IRQ_HANDLED;
71 }
72 }
73 return ret;
74}
75
76
77static irqreturn_t qmgr_irq2_a0(int irq, void *pdev)
78{
79 int i, ret = 0;
80 u32 req_bitmap;
81
82 /* ACK - it may clear any bits so don't rely on it */
83 __raw_writel(0xFFFFFFFF, &qmgr_regs->irqstat[1]);
84
85 req_bitmap = qmgr_regs->irqen[1] & qmgr_regs->statne_h;
86 while (req_bitmap) {
87 i = __fls(req_bitmap); /* number of the last "high" queue */
88 req_bitmap &= ~BIT(i);
89 irq_handlers[HALF_QUEUES + i](irq_pdevs[HALF_QUEUES + i]);
90 ret = IRQ_HANDLED;
91 }
92 return ret;
93}
53 94
54 return val ? IRQ_HANDLED : 0; 95
96static irqreturn_t qmgr_irq(int irq, void *pdev)
97{
98 int i, half = (irq == IRQ_IXP4XX_QM1 ? 0 : 1);
99 u32 req_bitmap = __raw_readl(&qmgr_regs->irqstat[half]);
100
101 if (!req_bitmap)
102 return 0;
103 __raw_writel(req_bitmap, &qmgr_regs->irqstat[half]); /* ACK */
104
105 while (req_bitmap) {
106 i = __fls(req_bitmap); /* number of the last queue */
107 req_bitmap &= ~BIT(i);
108 i += half * HALF_QUEUES;
109 irq_handlers[i](irq_pdevs[i]);
110 }
111 return IRQ_HANDLED;
55} 112}
56 113
57 114
58void qmgr_enable_irq(unsigned int queue) 115void qmgr_enable_irq(unsigned int queue)
59{ 116{
60 unsigned long flags; 117 unsigned long flags;
118 int half = queue / 32;
119 u32 mask = 1 << (queue & (HALF_QUEUES - 1));
61 120
62 spin_lock_irqsave(&qmgr_lock, flags); 121 spin_lock_irqsave(&qmgr_lock, flags);
63 __raw_writel(__raw_readl(&qmgr_regs->irqen[0]) | (1 << queue), 122 __raw_writel(__raw_readl(&qmgr_regs->irqen[half]) | mask,
64 &qmgr_regs->irqen[0]); 123 &qmgr_regs->irqen[half]);
65 spin_unlock_irqrestore(&qmgr_lock, flags); 124 spin_unlock_irqrestore(&qmgr_lock, flags);
66} 125}
67 126
68void qmgr_disable_irq(unsigned int queue) 127void qmgr_disable_irq(unsigned int queue)
69{ 128{
70 unsigned long flags; 129 unsigned long flags;
130 int half = queue / 32;
131 u32 mask = 1 << (queue & (HALF_QUEUES - 1));
71 132
72 spin_lock_irqsave(&qmgr_lock, flags); 133 spin_lock_irqsave(&qmgr_lock, flags);
73 __raw_writel(__raw_readl(&qmgr_regs->irqen[0]) & ~(1 << queue), 134 __raw_writel(__raw_readl(&qmgr_regs->irqen[half]) & ~mask,
74 &qmgr_regs->irqen[0]); 135 &qmgr_regs->irqen[half]);
75 __raw_writel(1 << queue, &qmgr_regs->irqstat[0]); /* clear */ 136 __raw_writel(mask, &qmgr_regs->irqstat[half]); /* clear */
76 spin_unlock_irqrestore(&qmgr_lock, flags); 137 spin_unlock_irqrestore(&qmgr_lock, flags);
77} 138}
78 139
@@ -98,8 +159,7 @@ int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
98 u32 cfg, addr = 0, mask[4]; /* in 16-dwords */ 159 u32 cfg, addr = 0, mask[4]; /* in 16-dwords */
99 int err; 160 int err;
100 161
101 if (queue >= HALF_QUEUES) 162 BUG_ON(queue >= QUEUES);
102 return -ERANGE;
103 163
104 if ((nearly_empty_watermark | nearly_full_watermark) & ~7) 164 if ((nearly_empty_watermark | nearly_full_watermark) & ~7)
105 return -EINVAL; 165 return -EINVAL;
@@ -180,7 +240,7 @@ void qmgr_release_queue(unsigned int queue)
180{ 240{
181 u32 cfg, addr, mask[4]; 241 u32 cfg, addr, mask[4];
182 242
183 BUG_ON(queue >= HALF_QUEUES); /* not in valid range */ 243 BUG_ON(queue >= QUEUES); /* not in valid range */
184 244
185 spin_lock_irq(&qmgr_lock); 245 spin_lock_irq(&qmgr_lock);
186 cfg = __raw_readl(&qmgr_regs->sram[queue]); 246 cfg = __raw_readl(&qmgr_regs->sram[queue]);
@@ -224,6 +284,8 @@ void qmgr_release_queue(unsigned int queue)
224static int qmgr_init(void) 284static int qmgr_init(void)
225{ 285{
226 int i, err; 286 int i, err;
287 irq_handler_t handler1, handler2;
288
227 mem_res = request_mem_region(IXP4XX_QMGR_BASE_PHYS, 289 mem_res = request_mem_region(IXP4XX_QMGR_BASE_PHYS,
228 IXP4XX_QMGR_REGION_SIZE, 290 IXP4XX_QMGR_REGION_SIZE,
229 "IXP4xx Queue Manager"); 291 "IXP4xx Queue Manager");
@@ -247,23 +309,42 @@ static int qmgr_init(void)
247 __raw_writel(0, &qmgr_regs->irqen[i]); 309 __raw_writel(0, &qmgr_regs->irqen[i]);
248 } 310 }
249 311
312 __raw_writel(0xFFFFFFFF, &qmgr_regs->statne_h);
313 __raw_writel(0, &qmgr_regs->statf_h);
314
250 for (i = 0; i < QUEUES; i++) 315 for (i = 0; i < QUEUES; i++)
251 __raw_writel(0, &qmgr_regs->sram[i]); 316 __raw_writel(0, &qmgr_regs->sram[i]);
252 317
253 err = request_irq(IRQ_IXP4XX_QM1, qmgr_irq1, 0, 318 if (cpu_is_ixp42x_rev_a0()) {
254 "IXP4xx Queue Manager", NULL); 319 handler1 = qmgr_irq1_a0;
320 handler2 = qmgr_irq2_a0;
321 } else
322 handler1 = handler2 = qmgr_irq;
323
324 err = request_irq(IRQ_IXP4XX_QM1, handler1, 0, "IXP4xx Queue Manager",
325 NULL);
255 if (err) { 326 if (err) {
256 printk(KERN_ERR "qmgr: failed to request IRQ%i\n", 327 printk(KERN_ERR "qmgr: failed to request IRQ%i (%i)\n",
257 IRQ_IXP4XX_QM1); 328 IRQ_IXP4XX_QM1, err);
258 goto error_irq; 329 goto error_irq;
259 } 330 }
260 331
332 err = request_irq(IRQ_IXP4XX_QM2, handler2, 0, "IXP4xx Queue Manager",
333 NULL);
334 if (err) {
335 printk(KERN_ERR "qmgr: failed to request IRQ%i (%i)\n",
336 IRQ_IXP4XX_QM2, err);
337 goto error_irq2;
338 }
339
261 used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */ 340 used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */
262 spin_lock_init(&qmgr_lock); 341 spin_lock_init(&qmgr_lock);
263 342
264 printk(KERN_INFO "IXP4xx Queue Manager initialized.\n"); 343 printk(KERN_INFO "IXP4xx Queue Manager initialized.\n");
265 return 0; 344 return 0;
266 345
346error_irq2:
347 free_irq(IRQ_IXP4XX_QM1, NULL);
267error_irq: 348error_irq:
268 iounmap(qmgr_regs); 349 iounmap(qmgr_regs);
269error_map: 350error_map:
@@ -274,7 +355,9 @@ error_map:
274static void qmgr_remove(void) 355static void qmgr_remove(void)
275{ 356{
276 free_irq(IRQ_IXP4XX_QM1, NULL); 357 free_irq(IRQ_IXP4XX_QM1, NULL);
358 free_irq(IRQ_IXP4XX_QM2, NULL);
277 synchronize_irq(IRQ_IXP4XX_QM1); 359 synchronize_irq(IRQ_IXP4XX_QM1);
360 synchronize_irq(IRQ_IXP4XX_QM2);
278 iounmap(qmgr_regs); 361 iounmap(qmgr_regs);
279 release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE); 362 release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
280} 363}
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index b5421cccd7e1..25100f7acf4c 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -20,6 +20,12 @@ config MACH_RD88F6281
20 Say 'Y' here if you want your kernel to support the 20 Say 'Y' here if you want your kernel to support the
21 Marvell RD-88F6281 Reference Board. 21 Marvell RD-88F6281 Reference Board.
22 22
23config MACH_MV88F6281GTW_GE
24 bool "Marvell 88F6281 GTW GE Board"
25 help
26 Say 'Y' here if you want your kernel to support the
27 Marvell 88F6281 GTW GE Board.
28
23config MACH_SHEEVAPLUG 29config MACH_SHEEVAPLUG
24 bool "Marvell SheevaPlug Reference Board" 30 bool "Marvell SheevaPlug Reference Board"
25 help 31 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 8f03c9b9bdd9..9dd680e964d6 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -3,5 +3,8 @@ obj-y += common.o addr-map.o irq.o pcie.o mpp.o
3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o 3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o 4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o 5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
6obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
7obj-$(CONFIG_MACH_TS219) += ts219-setup.o 8obj-$(CONFIG_MACH_TS219) += ts219-setup.o
9
10obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c
index 5db4f0bbe5ee..1da5d1c18ecb 100644
--- a/arch/arm/mach-kirkwood/addr-map.c
+++ b/arch/arm/mach-kirkwood/addr-map.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#define TARGET_DDR 0 21#define TARGET_DDR 0
22#define TARGET_DEV_BUS 1 22#define TARGET_DEV_BUS 1
23#define TARGET_SRAM 3
23#define TARGET_PCIE 4 24#define TARGET_PCIE 4
24#define ATTR_DEV_SPI_ROM 0x1e 25#define ATTR_DEV_SPI_ROM 0x1e
25#define ATTR_DEV_BOOT 0x1d 26#define ATTR_DEV_BOOT 0x1d
@@ -30,6 +31,7 @@
30#define ATTR_DEV_CS0 0x3e 31#define ATTR_DEV_CS0 0x3e
31#define ATTR_PCIE_IO 0xe0 32#define ATTR_PCIE_IO 0xe0
32#define ATTR_PCIE_MEM 0xe8 33#define ATTR_PCIE_MEM 0xe8
34#define ATTR_SRAM 0x01
33 35
34/* 36/*
35 * Helpers to get DDR bank info 37 * Helpers to get DDR bank info
@@ -48,7 +50,6 @@
48 50
49 51
50struct mbus_dram_target_info kirkwood_mbus_dram_info; 52struct mbus_dram_target_info kirkwood_mbus_dram_info;
51static int __initdata win_alloc_count;
52 53
53static int __init cpu_win_can_remap(int win) 54static int __init cpu_win_can_remap(int win)
54{ 55{
@@ -112,7 +113,11 @@ void __init kirkwood_setup_cpu_mbus(void)
112 setup_cpu_win(2, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE, 113 setup_cpu_win(2, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE,
113 TARGET_DEV_BUS, ATTR_DEV_NAND, -1); 114 TARGET_DEV_BUS, ATTR_DEV_NAND, -1);
114 115
115 win_alloc_count = 3; 116 /*
117 * Setup window for SRAM.
118 */
119 setup_cpu_win(3, KIRKWOOD_SRAM_PHYS_BASE, KIRKWOOD_SRAM_SIZE,
120 TARGET_SRAM, ATTR_SRAM, -1);
116 121
117 /* 122 /*
118 * Setup MBUS dram target info. 123 * Setup MBUS dram target info.
@@ -140,8 +145,3 @@ void __init kirkwood_setup_cpu_mbus(void)
140 } 145 }
141 kirkwood_mbus_dram_info.num_cs = cs; 146 kirkwood_mbus_dram_info.num_cs = cs;
142} 147}
143
144void __init kirkwood_setup_sram_win(u32 base, u32 size)
145{
146 setup_cpu_win(win_alloc_count++, base, size, 0x03, 0x00, -1);
147}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index be1ca28fed3f..0f6919838011 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -16,6 +16,7 @@
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/mv643xx_i2c.h> 17#include <linux/mv643xx_i2c.h>
18#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
19#include <linux/mtd/nand.h>
19#include <linux/spi/orion_spi.h> 20#include <linux/spi/orion_spi.h>
20#include <net/dsa.h> 21#include <net/dsa.h>
21#include <asm/page.h> 22#include <asm/page.h>
@@ -29,6 +30,7 @@
29#include <plat/mvsdio.h> 30#include <plat/mvsdio.h>
30#include <plat/mv_xor.h> 31#include <plat/mv_xor.h>
31#include <plat/orion_nand.h> 32#include <plat/orion_nand.h>
33#include <plat/orion_wdt.h>
32#include <plat/time.h> 34#include <plat/time.h>
33#include "common.h" 35#include "common.h"
34 36
@@ -54,6 +56,13 @@ void __init kirkwood_map_io(void)
54 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc)); 56 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
55} 57}
56 58
59/*
60 * Default clock control bits. Any bit _not_ set in this variable
61 * will be cleared from the hardware after platform devices have been
62 * registered. Some reserved bits must be set to 1.
63 */
64unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED;
65
57 66
58/***************************************************************************** 67/*****************************************************************************
59 * EHCI 68 * EHCI
@@ -95,6 +104,7 @@ static struct platform_device kirkwood_ehci = {
95 104
96void __init kirkwood_ehci_init(void) 105void __init kirkwood_ehci_init(void)
97{ 106{
107 kirkwood_clk_ctrl |= CGC_USB0;
98 platform_device_register(&kirkwood_ehci); 108 platform_device_register(&kirkwood_ehci);
99} 109}
100 110
@@ -151,6 +161,7 @@ static struct platform_device kirkwood_ge00 = {
151 161
152void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) 162void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
153{ 163{
164 kirkwood_clk_ctrl |= CGC_GE0;
154 eth_data->shared = &kirkwood_ge00_shared; 165 eth_data->shared = &kirkwood_ge00_shared;
155 kirkwood_ge00.dev.platform_data = eth_data; 166 kirkwood_ge00.dev.platform_data = eth_data;
156 167
@@ -212,6 +223,7 @@ static struct platform_device kirkwood_ge01 = {
212 223
213void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data) 224void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data)
214{ 225{
226 kirkwood_clk_ctrl |= CGC_GE1;
215 eth_data->shared = &kirkwood_ge01_shared; 227 eth_data->shared = &kirkwood_ge01_shared;
216 kirkwood_ge01.dev.platform_data = eth_data; 228 kirkwood_ge01.dev.platform_data = eth_data;
217 229
@@ -258,6 +270,43 @@ void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
258 270
259 271
260/***************************************************************************** 272/*****************************************************************************
273 * NAND flash
274 ****************************************************************************/
275static struct resource kirkwood_nand_resource = {
276 .flags = IORESOURCE_MEM,
277 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
278 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
279 KIRKWOOD_NAND_MEM_SIZE - 1,
280};
281
282static struct orion_nand_data kirkwood_nand_data = {
283 .cle = 0,
284 .ale = 1,
285 .width = 8,
286};
287
288static struct platform_device kirkwood_nand_flash = {
289 .name = "orion_nand",
290 .id = -1,
291 .dev = {
292 .platform_data = &kirkwood_nand_data,
293 },
294 .resource = &kirkwood_nand_resource,
295 .num_resources = 1,
296};
297
298void __init kirkwood_nand_init(struct mtd_partition *parts, int nr_parts,
299 int chip_delay)
300{
301 kirkwood_clk_ctrl |= CGC_RUNIT;
302 kirkwood_nand_data.parts = parts;
303 kirkwood_nand_data.nr_parts = nr_parts;
304 kirkwood_nand_data.chip_delay = chip_delay;
305 platform_device_register(&kirkwood_nand_flash);
306}
307
308
309/*****************************************************************************
261 * SoC RTC 310 * SoC RTC
262 ****************************************************************************/ 311 ****************************************************************************/
263static struct resource kirkwood_rtc_resource = { 312static struct resource kirkwood_rtc_resource = {
@@ -301,6 +350,9 @@ static struct platform_device kirkwood_sata = {
301 350
302void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) 351void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
303{ 352{
353 kirkwood_clk_ctrl |= CGC_SATA0;
354 if (sata_data->n_ports > 1)
355 kirkwood_clk_ctrl |= CGC_SATA1;
304 sata_data->dram = &kirkwood_mbus_dram_info; 356 sata_data->dram = &kirkwood_mbus_dram_info;
305 kirkwood_sata.dev.platform_data = sata_data; 357 kirkwood_sata.dev.platform_data = sata_data;
306 platform_device_register(&kirkwood_sata); 358 platform_device_register(&kirkwood_sata);
@@ -346,6 +398,7 @@ void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
346 else 398 else
347 mvsdio_data->clock = 200000000; 399 mvsdio_data->clock = 200000000;
348 mvsdio_data->dram = &kirkwood_mbus_dram_info; 400 mvsdio_data->dram = &kirkwood_mbus_dram_info;
401 kirkwood_clk_ctrl |= CGC_SDIO;
349 kirkwood_sdio.dev.platform_data = mvsdio_data; 402 kirkwood_sdio.dev.platform_data = mvsdio_data;
350 platform_device_register(&kirkwood_sdio); 403 platform_device_register(&kirkwood_sdio);
351} 404}
@@ -377,6 +430,7 @@ static struct platform_device kirkwood_spi = {
377 430
378void __init kirkwood_spi_init() 431void __init kirkwood_spi_init()
379{ 432{
433 kirkwood_clk_ctrl |= CGC_RUNIT;
380 platform_device_register(&kirkwood_spi); 434 platform_device_register(&kirkwood_spi);
381} 435}
382 436
@@ -507,6 +561,43 @@ void __init kirkwood_uart1_init(void)
507 561
508 562
509/***************************************************************************** 563/*****************************************************************************
564 * Cryptographic Engines and Security Accelerator (CESA)
565 ****************************************************************************/
566
567static struct resource kirkwood_crypto_res[] = {
568 {
569 .name = "regs",
570 .start = CRYPTO_PHYS_BASE,
571 .end = CRYPTO_PHYS_BASE + 0xffff,
572 .flags = IORESOURCE_MEM,
573 }, {
574 .name = "sram",
575 .start = KIRKWOOD_SRAM_PHYS_BASE,
576 .end = KIRKWOOD_SRAM_PHYS_BASE + KIRKWOOD_SRAM_SIZE - 1,
577 .flags = IORESOURCE_MEM,
578 }, {
579 .name = "crypto interrupt",
580 .start = IRQ_KIRKWOOD_CRYPTO,
581 .end = IRQ_KIRKWOOD_CRYPTO,
582 .flags = IORESOURCE_IRQ,
583 },
584};
585
586static struct platform_device kirkwood_crypto_device = {
587 .name = "mv_crypto",
588 .id = -1,
589 .num_resources = ARRAY_SIZE(kirkwood_crypto_res),
590 .resource = kirkwood_crypto_res,
591};
592
593void __init kirkwood_crypto_init(void)
594{
595 kirkwood_clk_ctrl |= CGC_CRYPTO;
596 platform_device_register(&kirkwood_crypto_device);
597}
598
599
600/*****************************************************************************
510 * XOR 601 * XOR
511 ****************************************************************************/ 602 ****************************************************************************/
512static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = { 603static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = {
@@ -597,6 +688,7 @@ static struct platform_device kirkwood_xor01_channel = {
597 688
598static void __init kirkwood_xor0_init(void) 689static void __init kirkwood_xor0_init(void)
599{ 690{
691 kirkwood_clk_ctrl |= CGC_XOR0;
600 platform_device_register(&kirkwood_xor0_shared); 692 platform_device_register(&kirkwood_xor0_shared);
601 693
602 /* 694 /*
@@ -695,6 +787,7 @@ static struct platform_device kirkwood_xor11_channel = {
695 787
696static void __init kirkwood_xor1_init(void) 788static void __init kirkwood_xor1_init(void)
697{ 789{
790 kirkwood_clk_ctrl |= CGC_XOR1;
698 platform_device_register(&kirkwood_xor1_shared); 791 platform_device_register(&kirkwood_xor1_shared);
699 792
700 /* 793 /*
@@ -713,6 +806,29 @@ static void __init kirkwood_xor1_init(void)
713 806
714 807
715/***************************************************************************** 808/*****************************************************************************
809 * Watchdog
810 ****************************************************************************/
811static struct orion_wdt_platform_data kirkwood_wdt_data = {
812 .tclk = 0,
813};
814
815static struct platform_device kirkwood_wdt_device = {
816 .name = "orion_wdt",
817 .id = -1,
818 .dev = {
819 .platform_data = &kirkwood_wdt_data,
820 },
821 .num_resources = 0,
822};
823
824static void __init kirkwood_wdt_init(void)
825{
826 kirkwood_wdt_data.tclk = kirkwood_tclk;
827 platform_device_register(&kirkwood_wdt_device);
828}
829
830
831/*****************************************************************************
716 * Time handling 832 * Time handling
717 ****************************************************************************/ 833 ****************************************************************************/
718int kirkwood_tclk; 834int kirkwood_tclk;
@@ -804,6 +920,49 @@ void __init kirkwood_init(void)
804 920
805 /* internal devices that every board has */ 921 /* internal devices that every board has */
806 kirkwood_rtc_init(); 922 kirkwood_rtc_init();
923 kirkwood_wdt_init();
807 kirkwood_xor0_init(); 924 kirkwood_xor0_init();
808 kirkwood_xor1_init(); 925 kirkwood_xor1_init();
926 kirkwood_crypto_init();
927}
928
929static int __init kirkwood_clock_gate(void)
930{
931 unsigned int curr = readl(CLOCK_GATING_CTRL);
932
933 printk(KERN_DEBUG "Gating clock of unused units\n");
934 printk(KERN_DEBUG "before: 0x%08x\n", curr);
935
936 /* Make sure those units are accessible */
937 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0, CLOCK_GATING_CTRL);
938
939 /* For SATA: first shutdown the phy */
940 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
941 /* Disable PLL and IVREF */
942 writel(readl(SATA0_PHY_MODE_2) & ~0xf, SATA0_PHY_MODE_2);
943 /* Disable PHY */
944 writel(readl(SATA0_IF_CTRL) | 0x200, SATA0_IF_CTRL);
945 }
946 if (!(kirkwood_clk_ctrl & CGC_SATA1)) {
947 /* Disable PLL and IVREF */
948 writel(readl(SATA1_PHY_MODE_2) & ~0xf, SATA1_PHY_MODE_2);
949 /* Disable PHY */
950 writel(readl(SATA1_IF_CTRL) | 0x200, SATA1_IF_CTRL);
951 }
952
953 /* For PCIe: first shutdown the phy */
954 if (!(kirkwood_clk_ctrl & CGC_PEX0)) {
955 writel(readl(PCIE_LINK_CTRL) | 0x10, PCIE_LINK_CTRL);
956 while (1)
957 if (readl(PCIE_STATUS) & 0x1)
958 break;
959 writel(readl(PCIE_LINK_CTRL) & ~0x10, PCIE_LINK_CTRL);
960 }
961
962 /* Now gate clock the required units */
963 writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
964 printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
965
966 return 0;
809} 967}
968late_initcall(kirkwood_clock_gate);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 6ee88406f381..d7de43464358 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -15,6 +15,7 @@ struct dsa_platform_data;
15struct mv643xx_eth_platform_data; 15struct mv643xx_eth_platform_data;
16struct mv_sata_platform_data; 16struct mv_sata_platform_data;
17struct mvsdio_platform_data; 17struct mvsdio_platform_data;
18struct mtd_partition;
18 19
19/* 20/*
20 * Basic Kirkwood init functions used early by machine-setup. 21 * Basic Kirkwood init functions used early by machine-setup.
@@ -25,7 +26,6 @@ void kirkwood_init_irq(void);
25 26
26extern struct mbus_dram_target_info kirkwood_mbus_dram_info; 27extern struct mbus_dram_target_info kirkwood_mbus_dram_info;
27void kirkwood_setup_cpu_mbus(void); 28void kirkwood_setup_cpu_mbus(void);
28void kirkwood_setup_sram_win(u32 base, u32 size);
29 29
30void kirkwood_pcie_id(u32 *dev, u32 *rev); 30void kirkwood_pcie_id(u32 *dev, u32 *rev);
31 31
@@ -40,9 +40,11 @@ void kirkwood_spi_init(void);
40void kirkwood_i2c_init(void); 40void kirkwood_i2c_init(void);
41void kirkwood_uart0_init(void); 41void kirkwood_uart0_init(void);
42void kirkwood_uart1_init(void); 42void kirkwood_uart1_init(void);
43void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
43 44
44extern int kirkwood_tclk; 45extern int kirkwood_tclk;
45extern struct sys_timer kirkwood_timer; 46extern struct sys_timer kirkwood_timer;
46 47
48#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
47 49
48#endif 50#endif
diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
new file mode 100644
index 000000000000..f68d33f1f396
--- /dev/null
+++ b/arch/arm/mach-kirkwood/cpuidle.c
@@ -0,0 +1,96 @@
1/*
2 * arch/arm/mach-kirkwood/cpuidle.c
3 *
4 * CPU idle Marvell Kirkwood SoCs
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 any
8 * warranty of any kind, whether express or implied.
9 *
10 * The cpu idle uses wait-for-interrupt and DDR self refresh in order
11 * to implement two idle states -
12 * #1 wait-for-interrupt
13 * #2 wait-for-interrupt and DDR self refresh
14 */
15
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/cpuidle.h>
20#include <linux/io.h>
21#include <asm/proc-fns.h>
22#include <mach/kirkwood.h>
23
24#define KIRKWOOD_MAX_STATES 2
25
26static struct cpuidle_driver kirkwood_idle_driver = {
27 .name = "kirkwood_idle",
28 .owner = THIS_MODULE,
29};
30
31static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
32
33/* Actual code that puts the SoC in different idle states */
34static int kirkwood_enter_idle(struct cpuidle_device *dev,
35 struct cpuidle_state *state)
36{
37 struct timeval before, after;
38 int idle_time;
39
40 local_irq_disable();
41 do_gettimeofday(&before);
42 if (state == &dev->states[0])
43 /* Wait for interrupt state */
44 cpu_do_idle();
45 else if (state == &dev->states[1]) {
46 /*
47 * Following write will put DDR in self refresh.
48 * Note that we have 256 cycles before DDR puts it
49 * self in self-refresh, so the wait-for-interrupt
50 * call afterwards won't get the DDR from self refresh
51 * mode.
52 */
53 writel(0x7, DDR_OPERATION_BASE);
54 cpu_do_idle();
55 }
56 do_gettimeofday(&after);
57 local_irq_enable();
58 idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
59 (after.tv_usec - before.tv_usec);
60 return idle_time;
61}
62
63/* Initialize CPU idle by registering the idle states */
64static int kirkwood_init_cpuidle(void)
65{
66 struct cpuidle_device *device;
67
68 cpuidle_register_driver(&kirkwood_idle_driver);
69
70 device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
71 device->state_count = KIRKWOOD_MAX_STATES;
72
73 /* Wait for interrupt state */
74 device->states[0].enter = kirkwood_enter_idle;
75 device->states[0].exit_latency = 1;
76 device->states[0].target_residency = 10000;
77 device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
78 strcpy(device->states[0].name, "WFI");
79 strcpy(device->states[0].desc, "Wait for interrupt");
80
81 /* Wait for interrupt and DDR self refresh state */
82 device->states[1].enter = kirkwood_enter_idle;
83 device->states[1].exit_latency = 10;
84 device->states[1].target_residency = 10000;
85 device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
86 strcpy(device->states[1].name, "DDR SR");
87 strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
88
89 if (cpuidle_register_device(device)) {
90 printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n");
91 return -EIO;
92 }
93 return 0;
94}
95
96device_initcall(kirkwood_init_cpuidle);
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index 5505d5837752..39bdf4bcace9 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -11,14 +11,12 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
18#include <asm/mach-types.h> 17#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
20#include <mach/kirkwood.h> 19#include <mach/kirkwood.h>
21#include <plat/orion_nand.h>
22#include <plat/mvsdio.h> 20#include <plat/mvsdio.h>
23#include "common.h" 21#include "common.h"
24#include "mpp.h" 22#include "mpp.h"
@@ -39,32 +37,6 @@ static struct mtd_partition db88f6281_nand_parts[] = {
39 }, 37 },
40}; 38};
41 39
42static struct resource db88f6281_nand_resource = {
43 .flags = IORESOURCE_MEM,
44 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
45 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
46 KIRKWOOD_NAND_MEM_SIZE - 1,
47};
48
49static struct orion_nand_data db88f6281_nand_data = {
50 .parts = db88f6281_nand_parts,
51 .nr_parts = ARRAY_SIZE(db88f6281_nand_parts),
52 .cle = 0,
53 .ale = 1,
54 .width = 8,
55 .chip_delay = 25,
56};
57
58static struct platform_device db88f6281_nand_flash = {
59 .name = "orion_nand",
60 .id = -1,
61 .dev = {
62 .platform_data = &db88f6281_nand_data,
63 },
64 .resource = &db88f6281_nand_resource,
65 .num_resources = 1,
66};
67
68static struct mv643xx_eth_platform_data db88f6281_ge00_data = { 40static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
69 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 41 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
70}; 42};
@@ -92,13 +64,12 @@ static void __init db88f6281_init(void)
92 kirkwood_init(); 64 kirkwood_init();
93 kirkwood_mpp_conf(db88f6281_mpp_config); 65 kirkwood_mpp_conf(db88f6281_mpp_config);
94 66
67 kirkwood_nand_init(ARRAY_AND_SIZE(db88f6281_nand_parts), 25);
95 kirkwood_ehci_init(); 68 kirkwood_ehci_init();
96 kirkwood_ge00_init(&db88f6281_ge00_data); 69 kirkwood_ge00_init(&db88f6281_ge00_data);
97 kirkwood_sata_init(&db88f6281_sata_data); 70 kirkwood_sata_init(&db88f6281_sata_data);
98 kirkwood_uart0_init(); 71 kirkwood_uart0_init();
99 kirkwood_sdio_init(&db88f6281_mvsdio_data); 72 kirkwood_sdio_init(&db88f6281_mvsdio_data);
100
101 platform_device_register(&db88f6281_nand_flash);
102} 73}
103 74
104static int __init db88f6281_pci_init(void) 75static int __init db88f6281_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 4f7029f521cc..9e80d9232c83 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -17,12 +17,15 @@
17#define CPU_RESET 0x00000002 17#define CPU_RESET 0x00000002
18 18
19#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108) 19#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108)
20#define WDT_RESET_OUT_EN 0x00000002
20#define SOFT_RESET_OUT_EN 0x00000004 21#define SOFT_RESET_OUT_EN 0x00000004
21 22
22#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 23#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
23#define SOFT_RESET 0x00000001 24#define SOFT_RESET 0x00000001
24 25
25#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110) 26#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
27#define WDT_INT_REQ 0x0008
28
26#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114) 29#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
27#define BRIDGE_INT_TIMER0 0x0002 30#define BRIDGE_INT_TIMER0 0x0002
28#define BRIDGE_INT_TIMER1 0x0004 31#define BRIDGE_INT_TIMER1 0x0004
@@ -39,4 +42,22 @@
39#define L2_CONFIG_REG (BRIDGE_VIRT_BASE | 0x0128) 42#define L2_CONFIG_REG (BRIDGE_VIRT_BASE | 0x0128)
40#define L2_WRITETHROUGH 0x00000010 43#define L2_WRITETHROUGH 0x00000010
41 44
45#define CLOCK_GATING_CTRL (BRIDGE_VIRT_BASE | 0x11c)
46#define CGC_GE0 (1 << 0)
47#define CGC_PEX0 (1 << 2)
48#define CGC_USB0 (1 << 3)
49#define CGC_SDIO (1 << 4)
50#define CGC_TSU (1 << 5)
51#define CGC_DUNIT (1 << 6)
52#define CGC_RUNIT (1 << 7)
53#define CGC_XOR0 (1 << 8)
54#define CGC_AUDIO (1 << 9)
55#define CGC_SATA0 (1 << 14)
56#define CGC_SATA1 (1 << 15)
57#define CGC_XOR1 (1 << 16)
58#define CGC_CRYPTO (1 << 17)
59#define CGC_GE1 (1 << 19)
60#define CGC_TDM (1 << 20)
61#define CGC_RESERVED ((1 << 18) | (0x6 << 21))
62
42#endif 63#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
index be07be0ef522..a643a846d5fb 100644
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ b/arch/arm/mach-kirkwood/include/mach/io.h
@@ -19,6 +19,31 @@ static inline void __iomem *__io(unsigned long addr)
19 + KIRKWOOD_PCIE_IO_VIRT_BASE); 19 + KIRKWOOD_PCIE_IO_VIRT_BASE);
20} 20}
21 21
22static inline void __iomem *
23__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
24{
25 void __iomem *retval;
26 unsigned long offs = paddr - KIRKWOOD_REGS_PHYS_BASE;
27 if (mtype == MT_DEVICE && size && offs < KIRKWOOD_REGS_SIZE &&
28 size <= KIRKWOOD_REGS_SIZE && offs + size <= KIRKWOOD_REGS_SIZE) {
29 retval = (void __iomem *)KIRKWOOD_REGS_VIRT_BASE + offs;
30 } else {
31 retval = __arm_ioremap(paddr, size, mtype);
32 }
33
34 return retval;
35}
36
37static inline void
38__arch_iounmap(void __iomem *addr)
39{
40 if (addr < (void __iomem *)KIRKWOOD_REGS_VIRT_BASE ||
41 addr >= (void __iomem *)(KIRKWOOD_REGS_VIRT_BASE + KIRKWOOD_REGS_SIZE))
42 __iounmap(addr);
43}
44
45#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m)
46#define __arch_iounmap(a) __arch_iounmap(a)
22#define __io(a) __io(a) 47#define __io(a) __io(a)
23#define __mem_pci(a) (a) 48#define __mem_pci(a) (a)
24 49
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index b3e13958821d..07af858814a0 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -20,16 +20,18 @@
20 * f1000000 on-chip peripheral registers 20 * f1000000 on-chip peripheral registers
21 * f2000000 PCIe I/O space 21 * f2000000 PCIe I/O space
22 * f3000000 NAND controller address window 22 * f3000000 NAND controller address window
23 * f4000000 Security Accelerator SRAM
23 * 24 *
24 * virt phys size 25 * virt phys size
25 * fee00000 f1000000 1M on-chip peripheral registers 26 * fee00000 f1000000 1M on-chip peripheral registers
26 * fef00000 f2000000 1M PCIe I/O space 27 * fef00000 f2000000 1M PCIe I/O space
27 */ 28 */
28 29
30#define KIRKWOOD_SRAM_PHYS_BASE 0xf4000000
31#define KIRKWOOD_SRAM_SIZE SZ_2K
32
29#define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf3000000 33#define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf3000000
30#define KIRKWOOD_NAND_MEM_SIZE SZ_64K /* 1K is sufficient, but 64K 34#define KIRKWOOD_NAND_MEM_SIZE SZ_1K
31 * is the minimal window size
32 */
33 35
34#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 36#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
35#define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfef00000 37#define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfef00000
@@ -48,6 +50,7 @@
48 */ 50 */
49#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000) 51#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000)
50#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE | 0x1500) 52#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE | 0x1500)
53#define DDR_OPERATION_BASE (DDR_VIRT_BASE | 0x1418)
51 54
52#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x10000) 55#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x10000)
53#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000) 56#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000)
@@ -63,7 +66,11 @@
63 66
64#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000) 67#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000)
65 68
69#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x30000)
70
66#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000) 71#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000)
72#define PCIE_LINK_CTRL (PCIE_VIRT_BASE | 0x70)
73#define PCIE_STATUS (PCIE_VIRT_BASE | 0x1a04)
67 74
68#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000) 75#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000)
69 76
@@ -80,6 +87,11 @@
80#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000) 87#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000)
81 88
82#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) 89#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000)
90#define SATA_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x80000)
91#define SATA0_IF_CTRL (SATA_VIRT_BASE | 0x2050)
92#define SATA0_PHY_MODE_2 (SATA_VIRT_BASE | 0x2330)
93#define SATA1_IF_CTRL (SATA_VIRT_BASE | 0x4050)
94#define SATA1_PHY_MODE_2 (SATA_VIRT_BASE | 0x4330)
83 95
84#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000) 96#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000)
85 97
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c
index 63c44934391a..a5900f64e38c 100644
--- a/arch/arm/mach-kirkwood/mpp.c
+++ b/arch/arm/mach-kirkwood/mpp.c
@@ -48,6 +48,9 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
48 if (!variant_mask) 48 if (!variant_mask)
49 return; 49 return;
50 50
51 /* Initialize gpiolib. */
52 orion_gpio_init();
53
51 printk(KERN_DEBUG "initial MPP regs:"); 54 printk(KERN_DEBUG "initial MPP regs:");
52 for (i = 0; i < MPP_NR_REGS; i++) { 55 for (i = 0; i < MPP_NR_REGS; i++) {
53 mpp_ctrl[i] = readl(MPP_CTRL(i)); 56 mpp_ctrl[i] = readl(MPP_CTRL(i));
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
new file mode 100644
index 000000000000..0358f45766cb
--- /dev/null
+++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
@@ -0,0 +1,173 @@
1/*
2 * arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
3 *
4 * Marvell 88F6281 GTW GE Board Setup
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 any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/timer.h>
18#include <linux/mv643xx_eth.h>
19#include <linux/ethtool.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/input.h>
23#include <linux/gpio_keys.h>
24#include <linux/spi/flash.h>
25#include <linux/spi/spi.h>
26#include <linux/spi/orion_spi.h>
27#include <net/dsa.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/pci.h>
31#include <mach/kirkwood.h>
32#include "common.h"
33#include "mpp.h"
34
35static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
36 .phy_addr = MV643XX_ETH_PHY_NONE,
37 .speed = SPEED_1000,
38 .duplex = DUPLEX_FULL,
39};
40
41static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
42 .port_names[0] = "lan1",
43 .port_names[1] = "lan2",
44 .port_names[2] = "lan3",
45 .port_names[3] = "lan4",
46 .port_names[4] = "wan",
47 .port_names[5] = "cpu",
48};
49
50static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
51 .nr_chips = 1,
52 .chip = &mv88f6281gtw_ge_switch_chip_data,
53};
54
55static const struct flash_platform_data mv88f6281gtw_ge_spi_slave_data = {
56 .type = "mx25l12805d",
57};
58
59static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = {
60 {
61 .modalias = "m25p80",
62 .platform_data = &mv88f6281gtw_ge_spi_slave_data,
63 .irq = -1,
64 .max_speed_hz = 50000000,
65 .bus_num = 0,
66 .chip_select = 0,
67 },
68};
69
70static struct gpio_keys_button mv88f6281gtw_ge_button_pins[] = {
71 {
72 .code = KEY_RESTART,
73 .gpio = 47,
74 .desc = "SWR Button",
75 .active_low = 1,
76 }, {
77 .code = KEY_F1,
78 .gpio = 46,
79 .desc = "WPS Button(F1)",
80 .active_low = 1,
81 },
82};
83
84static struct gpio_keys_platform_data mv88f6281gtw_ge_button_data = {
85 .buttons = mv88f6281gtw_ge_button_pins,
86 .nbuttons = ARRAY_SIZE(mv88f6281gtw_ge_button_pins),
87};
88
89static struct platform_device mv88f6281gtw_ge_buttons = {
90 .name = "gpio-keys",
91 .id = -1,
92 .num_resources = 0,
93 .dev = {
94 .platform_data = &mv88f6281gtw_ge_button_data,
95 },
96};
97
98static struct gpio_led mv88f6281gtw_ge_led_pins[] = {
99 {
100 .name = "gtw:green:Status",
101 .gpio = 20,
102 .active_low = 0,
103 }, {
104 .name = "gtw:red:Status",
105 .gpio = 21,
106 .active_low = 0,
107 }, {
108 .name = "gtw:green:USB",
109 .gpio = 12,
110 .active_low = 0,
111 },
112};
113
114static struct gpio_led_platform_data mv88f6281gtw_ge_led_data = {
115 .leds = mv88f6281gtw_ge_led_pins,
116 .num_leds = ARRAY_SIZE(mv88f6281gtw_ge_led_pins),
117};
118
119static struct platform_device mv88f6281gtw_ge_leds = {
120 .name = "leds-gpio",
121 .id = -1,
122 .dev = {
123 .platform_data = &mv88f6281gtw_ge_led_data,
124 },
125};
126
127static unsigned int mv88f6281gtw_ge_mpp_config[] __initdata = {
128 MPP12_GPO, /* Status#_USB pin */
129 MPP20_GPIO, /* Status#_GLED pin */
130 MPP21_GPIO, /* Status#_RLED pin */
131 MPP46_GPIO, /* WPS_Switch pin */
132 MPP47_GPIO, /* SW_Init pin */
133 0
134};
135
136static void __init mv88f6281gtw_ge_init(void)
137{
138 /*
139 * Basic setup. Needs to be called early.
140 */
141 kirkwood_init();
142 kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config);
143
144 kirkwood_ehci_init();
145 kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
146 kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
147 spi_register_board_info(mv88f6281gtw_ge_spi_slave_info,
148 ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info));
149 kirkwood_spi_init();
150 kirkwood_uart0_init();
151 platform_device_register(&mv88f6281gtw_ge_leds);
152 platform_device_register(&mv88f6281gtw_ge_buttons);
153}
154
155static int __init mv88f6281gtw_ge_pci_init(void)
156{
157 if (machine_is_mv88f6281gtw_ge())
158 kirkwood_pcie_init();
159
160 return 0;
161}
162subsys_initcall(mv88f6281gtw_ge_pci_init);
163
164MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
165 /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
166 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
167 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
168 .boot_params = 0x00000100,
169 .init_machine = mv88f6281gtw_ge_init,
170 .map_io = kirkwood_map_io,
171 .init_irq = kirkwood_init_irq,
172 .timer = &kirkwood_timer,
173MACHINE_END
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 73fccacd1a73..d90b9aae308d 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -14,6 +14,7 @@
14#include <asm/irq.h> 14#include <asm/irq.h>
15#include <asm/mach/pci.h> 15#include <asm/mach/pci.h>
16#include <plat/pcie.h> 16#include <plat/pcie.h>
17#include <mach/bridge-regs.h>
17#include "common.h" 18#include "common.h"
18 19
19 20
@@ -95,6 +96,7 @@ static struct pci_ops pcie_ops = {
95static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) 96static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
96{ 97{
97 struct resource *res; 98 struct resource *res;
99 extern unsigned int kirkwood_clk_ctrl;
98 100
99 /* 101 /*
100 * Generic PCIe unit setup. 102 * Generic PCIe unit setup.
@@ -133,6 +135,8 @@ static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
133 sys->resource[2] = NULL; 135 sys->resource[2] = NULL;
134 sys->io_offset = 0; 136 sys->io_offset = 0;
135 137
138 kirkwood_clk_ctrl |= CGC_PEX0;
139
136 return 1; 140 return 1;
137} 141}
138 142
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index 2f0e4ef3db0f..8bf4153d0840 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -11,8 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h> 14#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
18#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 31e996d65fc4..31708ddbc83e 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/mtd/nand.h>
16#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
17#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
18#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
@@ -22,7 +21,6 @@
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23#include <mach/kirkwood.h> 22#include <mach/kirkwood.h>
24#include <plat/mvsdio.h> 23#include <plat/mvsdio.h>
25#include <plat/orion_nand.h>
26#include "common.h" 24#include "common.h"
27#include "mpp.h" 25#include "mpp.h"
28 26
@@ -42,32 +40,6 @@ static struct mtd_partition rd88f6281_nand_parts[] = {
42 }, 40 },
43}; 41};
44 42
45static struct resource rd88f6281_nand_resource = {
46 .flags = IORESOURCE_MEM,
47 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
48 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
49 KIRKWOOD_NAND_MEM_SIZE - 1,
50};
51
52static struct orion_nand_data rd88f6281_nand_data = {
53 .parts = rd88f6281_nand_parts,
54 .nr_parts = ARRAY_SIZE(rd88f6281_nand_parts),
55 .cle = 0,
56 .ale = 1,
57 .width = 8,
58 .chip_delay = 25,
59};
60
61static struct platform_device rd88f6281_nand_flash = {
62 .name = "orion_nand",
63 .id = -1,
64 .dev = {
65 .platform_data = &rd88f6281_nand_data,
66 },
67 .resource = &rd88f6281_nand_resource,
68 .num_resources = 1,
69};
70
71static struct mv643xx_eth_platform_data rd88f6281_ge00_data = { 43static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
72 .phy_addr = MV643XX_ETH_PHY_NONE, 44 .phy_addr = MV643XX_ETH_PHY_NONE,
73 .speed = SPEED_1000, 45 .speed = SPEED_1000,
@@ -114,6 +86,7 @@ static void __init rd88f6281_init(void)
114 kirkwood_init(); 86 kirkwood_init();
115 kirkwood_mpp_conf(rd88f6281_mpp_config); 87 kirkwood_mpp_conf(rd88f6281_mpp_config);
116 88
89 kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
117 kirkwood_ehci_init(); 90 kirkwood_ehci_init();
118 91
119 kirkwood_ge00_init(&rd88f6281_ge00_data); 92 kirkwood_ge00_init(&rd88f6281_ge00_data);
@@ -129,8 +102,6 @@ static void __init rd88f6281_init(void)
129 kirkwood_sata_init(&rd88f6281_sata_data); 102 kirkwood_sata_init(&rd88f6281_sata_data);
130 kirkwood_sdio_init(&rd88f6281_mvsdio_data); 103 kirkwood_sdio_init(&rd88f6281_mvsdio_data);
131 kirkwood_uart0_init(); 104 kirkwood_uart0_init();
132
133 platform_device_register(&rd88f6281_nand_flash);
134} 105}
135 106
136static int __init rd88f6281_pci_init(void) 107static int __init rd88f6281_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index 831e4a56cae1..c7319eeac8bb 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
16#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
17#include <linux/gpio.h> 16#include <linux/gpio.h>
@@ -20,7 +19,6 @@
20#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
21#include <mach/kirkwood.h> 20#include <mach/kirkwood.h>
22#include <plat/mvsdio.h> 21#include <plat/mvsdio.h>
23#include <plat/orion_nand.h>
24#include "common.h" 22#include "common.h"
25#include "mpp.h" 23#include "mpp.h"
26 24
@@ -40,38 +38,12 @@ static struct mtd_partition sheevaplug_nand_parts[] = {
40 }, 38 },
41}; 39};
42 40
43static struct resource sheevaplug_nand_resource = {
44 .flags = IORESOURCE_MEM,
45 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
46 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
47 KIRKWOOD_NAND_MEM_SIZE - 1,
48};
49
50static struct orion_nand_data sheevaplug_nand_data = {
51 .parts = sheevaplug_nand_parts,
52 .nr_parts = ARRAY_SIZE(sheevaplug_nand_parts),
53 .cle = 0,
54 .ale = 1,
55 .width = 8,
56 .chip_delay = 25,
57};
58
59static struct platform_device sheevaplug_nand_flash = {
60 .name = "orion_nand",
61 .id = -1,
62 .dev = {
63 .platform_data = &sheevaplug_nand_data,
64 },
65 .resource = &sheevaplug_nand_resource,
66 .num_resources = 1,
67};
68
69static struct mv643xx_eth_platform_data sheevaplug_ge00_data = { 41static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
70 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 42 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
71}; 43};
72 44
73static struct mvsdio_platform_data sheevaplug_mvsdio_data = { 45static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
74 // unfortunately the CD signal has not been connected */ 46 /* unfortunately the CD signal has not been connected */
75}; 47};
76 48
77static struct gpio_led sheevaplug_led_pins[] = { 49static struct gpio_led sheevaplug_led_pins[] = {
@@ -111,6 +83,7 @@ static void __init sheevaplug_init(void)
111 kirkwood_mpp_conf(sheevaplug_mpp_config); 83 kirkwood_mpp_conf(sheevaplug_mpp_config);
112 84
113 kirkwood_uart0_init(); 85 kirkwood_uart0_init();
86 kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
114 87
115 if (gpio_request(29, "USB Power Enable") != 0 || 88 if (gpio_request(29, "USB Power Enable") != 0 ||
116 gpio_direction_output(29, 1) != 0) 89 gpio_direction_output(29, 1) != 0)
@@ -120,7 +93,6 @@ static void __init sheevaplug_init(void)
120 kirkwood_ge00_init(&sheevaplug_ge00_data); 93 kirkwood_ge00_init(&sheevaplug_ge00_data);
121 kirkwood_sdio_init(&sheevaplug_mvsdio_data); 94 kirkwood_sdio_init(&sheevaplug_mvsdio_data);
122 95
123 platform_device_register(&sheevaplug_nand_flash);
124 platform_device_register(&sheevaplug_leds); 96 platform_device_register(&sheevaplug_leds);
125} 97}
126 98
diff --git a/arch/arm/mach-mmp/include/mach/irqs.h b/arch/arm/mach-mmp/include/mach/irqs.h
index e83e45ebf7a4..16295cfd5e29 100644
--- a/arch/arm/mach-mmp/include/mach/irqs.h
+++ b/arch/arm/mach-mmp/include/mach/irqs.h
@@ -52,6 +52,7 @@
52/* 52/*
53 * Interrupt numbers for PXA910 53 * Interrupt numbers for PXA910
54 */ 54 */
55#define IRQ_PXA910_NONE (-1)
55#define IRQ_PXA910_AIRQ 0 56#define IRQ_PXA910_AIRQ 0
56#define IRQ_PXA910_SSP3 1 57#define IRQ_PXA910_SSP3 1
57#define IRQ_PXA910_SSP2 2 58#define IRQ_PXA910_SSP2 2
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
index 2e914649b9e4..3b216bf41e7f 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
@@ -253,6 +253,10 @@
253#define GPIO58_LCD_PCLK_WR MFP_CFG(GPIO58, AF1) 253#define GPIO58_LCD_PCLK_WR MFP_CFG(GPIO58, AF1)
254#define GPIO85_LCD_VSYNC MFP_CFG(GPIO85, AF1) 254#define GPIO85_LCD_VSYNC MFP_CFG(GPIO85, AF1)
255 255
256/* I2C */
257#define GPIO105_CI2C_SDA MFP_CFG(GPIO105, AF1)
258#define GPIO106_CI2C_SCL MFP_CFG(GPIO106, AF1)
259
256/* I2S */ 260/* I2S */
257#define GPIO113_I2S_MCLK MFP_CFG(GPIO113,AF6) 261#define GPIO113_I2S_MCLK MFP_CFG(GPIO113,AF6)
258#define GPIO114_I2S_FRM MFP_CFG(GPIO114,AF1) 262#define GPIO114_I2S_FRM MFP_CFG(GPIO114,AF1)
@@ -260,4 +264,27 @@
260#define GPIO116_I2S_RXD MFP_CFG(GPIO116,AF2) 264#define GPIO116_I2S_RXD MFP_CFG(GPIO116,AF2)
261#define GPIO117_I2S_TXD MFP_CFG(GPIO117,AF2) 265#define GPIO117_I2S_TXD MFP_CFG(GPIO117,AF2)
262 266
267/* PWM */
268#define GPIO96_PWM3_OUT MFP_CFG(GPIO96, AF1)
269#define GPIO97_PWM2_OUT MFP_CFG(GPIO97, AF1)
270#define GPIO98_PWM1_OUT MFP_CFG(GPIO98, AF1)
271#define GPIO104_PWM4_OUT MFP_CFG(GPIO104, AF1)
272#define GPIO106_PWM2_OUT MFP_CFG(GPIO106, AF2)
273#define GPIO74_PWM4_OUT MFP_CFG(GPIO74, AF2)
274#define GPIO75_PWM3_OUT MFP_CFG(GPIO75, AF2)
275#define GPIO76_PWM2_OUT MFP_CFG(GPIO76, AF2)
276#define GPIO77_PWM1_OUT MFP_CFG(GPIO77, AF2)
277#define GPIO82_PWM4_OUT MFP_CFG(GPIO82, AF2)
278#define GPIO83_PWM3_OUT MFP_CFG(GPIO83, AF2)
279#define GPIO84_PWM2_OUT MFP_CFG(GPIO84, AF2)
280#define GPIO85_PWM1_OUT MFP_CFG(GPIO85, AF2)
281#define GPIO84_PWM1_OUT MFP_CFG(GPIO84, AF4)
282#define GPIO122_PWM3_OUT MFP_CFG(GPIO122, AF3)
283#define GPIO123_PWM1_OUT MFP_CFG(GPIO123, AF1)
284#define GPIO124_PWM2_OUT MFP_CFG(GPIO124, AF1)
285#define GPIO125_PWM3_OUT MFP_CFG(GPIO125, AF1)
286#define GPIO126_PWM4_OUT MFP_CFG(GPIO126, AF1)
287#define GPIO86_PWM1_OUT MFP_CFG(GPIO86, AF2)
288#define GPIO86_PWM2_OUT MFP_CFG(GPIO86, AF3)
289
263#endif /* __ASM_MACH_MFP_PXA168_H */ 290#endif /* __ASM_MACH_MFP_PXA168_H */
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
index d97de36c50ad..bf1189ff9a34 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
@@ -159,4 +159,12 @@
159#define MMC1_CD_MMC1_CD MFP_CFG_DRV(MMC1_CD, AF0, MEDIUM) 159#define MMC1_CD_MMC1_CD MFP_CFG_DRV(MMC1_CD, AF0, MEDIUM)
160#define MMC1_WP_MMC1_WP MFP_CFG_DRV(MMC1_WP, AF0, MEDIUM) 160#define MMC1_WP_MMC1_WP MFP_CFG_DRV(MMC1_WP, AF0, MEDIUM)
161 161
162/* PWM */
163#define GPIO27 PWM3 AF2 MFP_CFG(GPIO27, AF2)
164#define GPIO51_PWM2_OUT MFP_CFG(GPIO51, AF2)
165#define GPIO117_PWM1_OUT MFP_CFG(GPIO117, AF2)
166#define GPIO118_PWM2_OUT MFP_CFG(GPIO118, AF2)
167#define GPIO119_PWM3_OUT MFP_CFG(GPIO119, AF2)
168#define GPIO120_PWM4_OUT MFP_CFG(GPIO120, AF2)
169
162#endif /* __ASM_MACH MFP_PXA910_H */ 170#endif /* __ASM_MACH MFP_PXA910_H */
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index ef0a8a2076e9..6bf1f0eefcd1 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -1,10 +1,18 @@
1#ifndef __ASM_MACH_PXA168_H 1#ifndef __ASM_MACH_PXA168_H
2#define __ASM_MACH_PXA168_H 2#define __ASM_MACH_PXA168_H
3 3
4#include <linux/i2c.h>
4#include <mach/devices.h> 5#include <mach/devices.h>
6#include <plat/i2c.h>
5 7
6extern struct pxa_device_desc pxa168_device_uart1; 8extern struct pxa_device_desc pxa168_device_uart1;
7extern struct pxa_device_desc pxa168_device_uart2; 9extern struct pxa_device_desc pxa168_device_uart2;
10extern struct pxa_device_desc pxa168_device_twsi0;
11extern struct pxa_device_desc pxa168_device_twsi1;
12extern struct pxa_device_desc pxa168_device_pwm1;
13extern struct pxa_device_desc pxa168_device_pwm2;
14extern struct pxa_device_desc pxa168_device_pwm3;
15extern struct pxa_device_desc pxa168_device_pwm4;
8 16
9static inline int pxa168_add_uart(int id) 17static inline int pxa168_add_uart(int id)
10{ 18{
@@ -20,4 +28,40 @@ static inline int pxa168_add_uart(int id)
20 28
21 return pxa_register_device(d, NULL, 0); 29 return pxa_register_device(d, NULL, 0);
22} 30}
31
32static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
33 struct i2c_board_info *info, unsigned size)
34{
35 struct pxa_device_desc *d = NULL;
36 int ret;
37
38 switch (id) {
39 case 0: d = &pxa168_device_twsi0; break;
40 case 1: d = &pxa168_device_twsi1; break;
41 default:
42 return -EINVAL;
43 }
44
45 ret = i2c_register_board_info(id, info, size);
46 if (ret)
47 return ret;
48
49 return pxa_register_device(d, data, sizeof(*data));
50}
51
52static inline int pxa168_add_pwm(int id)
53{
54 struct pxa_device_desc *d = NULL;
55
56 switch (id) {
57 case 1: d = &pxa168_device_pwm1; break;
58 case 2: d = &pxa168_device_pwm2; break;
59 case 3: d = &pxa168_device_pwm3; break;
60 case 4: d = &pxa168_device_pwm4; break;
61 default:
62 return -EINVAL;
63 }
64
65 return pxa_register_device(d, NULL, 0);
66}
23#endif /* __ASM_MACH_PXA168_H */ 67#endif /* __ASM_MACH_PXA168_H */
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index b7aeaf574c36..6ae1ed7a0a9f 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -1,10 +1,18 @@
1#ifndef __ASM_MACH_PXA910_H 1#ifndef __ASM_MACH_PXA910_H
2#define __ASM_MACH_PXA910_H 2#define __ASM_MACH_PXA910_H
3 3
4#include <linux/i2c.h>
4#include <mach/devices.h> 5#include <mach/devices.h>
6#include <plat/i2c.h>
5 7
6extern struct pxa_device_desc pxa910_device_uart1; 8extern struct pxa_device_desc pxa910_device_uart1;
7extern struct pxa_device_desc pxa910_device_uart2; 9extern struct pxa_device_desc pxa910_device_uart2;
10extern struct pxa_device_desc pxa910_device_twsi0;
11extern struct pxa_device_desc pxa910_device_twsi1;
12extern struct pxa_device_desc pxa910_device_pwm1;
13extern struct pxa_device_desc pxa910_device_pwm2;
14extern struct pxa_device_desc pxa910_device_pwm3;
15extern struct pxa_device_desc pxa910_device_pwm4;
8 16
9static inline int pxa910_add_uart(int id) 17static inline int pxa910_add_uart(int id)
10{ 18{
@@ -20,4 +28,40 @@ static inline int pxa910_add_uart(int id)
20 28
21 return pxa_register_device(d, NULL, 0); 29 return pxa_register_device(d, NULL, 0);
22} 30}
31
32static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
33 struct i2c_board_info *info, unsigned size)
34{
35 struct pxa_device_desc *d = NULL;
36 int ret;
37
38 switch (id) {
39 case 0: d = &pxa910_device_twsi0; break;
40 case 1: d = &pxa910_device_twsi1; break;
41 default:
42 return -EINVAL;
43 }
44
45 ret = i2c_register_board_info(id, info, size);
46 if (ret)
47 return ret;
48
49 return pxa_register_device(d, data, sizeof(*data));
50}
51
52static inline int pxa910_add_pwm(int id)
53{
54 struct pxa_device_desc *d = NULL;
55
56 switch (id) {
57 case 1: d = &pxa910_device_pwm1; break;
58 case 2: d = &pxa910_device_pwm2; break;
59 case 3: d = &pxa910_device_pwm3; break;
60 case 4: d = &pxa910_device_pwm4; break;
61 default:
62 return -EINVAL;
63 }
64
65 return pxa_register_device(d, NULL, 0);
66}
23#endif /* __ASM_MACH_PXA910_H */ 67#endif /* __ASM_MACH_PXA910_H */
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h
index c6b8c9dc2026..98ccbee4bd0c 100644
--- a/arch/arm/mach-mmp/include/mach/regs-apbc.h
+++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h
@@ -22,8 +22,10 @@
22#define APBC_PXA168_UART1 APBC_REG(0x000) 22#define APBC_PXA168_UART1 APBC_REG(0x000)
23#define APBC_PXA168_UART2 APBC_REG(0x004) 23#define APBC_PXA168_UART2 APBC_REG(0x004)
24#define APBC_PXA168_GPIO APBC_REG(0x008) 24#define APBC_PXA168_GPIO APBC_REG(0x008)
25#define APBC_PXA168_PWM0 APBC_REG(0x00c) 25#define APBC_PXA168_PWM1 APBC_REG(0x00c)
26#define APBC_PXA168_PWM1 APBC_REG(0x010) 26#define APBC_PXA168_PWM2 APBC_REG(0x010)
27#define APBC_PXA168_PWM3 APBC_REG(0x014)
28#define APBC_PXA168_PWM4 APBC_REG(0x018)
27#define APBC_PXA168_SSP1 APBC_REG(0x01c) 29#define APBC_PXA168_SSP1 APBC_REG(0x01c)
28#define APBC_PXA168_SSP2 APBC_REG(0x020) 30#define APBC_PXA168_SSP2 APBC_REG(0x020)
29#define APBC_PXA168_RTC APBC_REG(0x028) 31#define APBC_PXA168_RTC APBC_REG(0x028)
@@ -48,10 +50,10 @@
48#define APBC_PXA910_UART0 APBC_REG(0x000) 50#define APBC_PXA910_UART0 APBC_REG(0x000)
49#define APBC_PXA910_UART1 APBC_REG(0x004) 51#define APBC_PXA910_UART1 APBC_REG(0x004)
50#define APBC_PXA910_GPIO APBC_REG(0x008) 52#define APBC_PXA910_GPIO APBC_REG(0x008)
51#define APBC_PXA910_PWM0 APBC_REG(0x00c) 53#define APBC_PXA910_PWM1 APBC_REG(0x00c)
52#define APBC_PXA910_PWM1 APBC_REG(0x010) 54#define APBC_PXA910_PWM2 APBC_REG(0x010)
53#define APBC_PXA910_PWM2 APBC_REG(0x014) 55#define APBC_PXA910_PWM3 APBC_REG(0x014)
54#define APBC_PXA910_PWM3 APBC_REG(0x018) 56#define APBC_PXA910_PWM4 APBC_REG(0x018)
55#define APBC_PXA910_SSP1 APBC_REG(0x01c) 57#define APBC_PXA910_SSP1 APBC_REG(0x01c)
56#define APBC_PXA910_SSP2 APBC_REG(0x020) 58#define APBC_PXA910_SSP2 APBC_REG(0x020)
57#define APBC_PXA910_IPC APBC_REG(0x024) 59#define APBC_PXA910_IPC APBC_REG(0x024)
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index ae924468658c..71b1ae338753 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -65,11 +65,23 @@ void __init pxa168_init_irq(void)
65/* APB peripheral clocks */ 65/* APB peripheral clocks */
66static APBC_CLK(uart1, PXA168_UART1, 1, 14745600); 66static APBC_CLK(uart1, PXA168_UART1, 1, 14745600);
67static APBC_CLK(uart2, PXA168_UART2, 1, 14745600); 67static APBC_CLK(uart2, PXA168_UART2, 1, 14745600);
68static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
69static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
70static APBC_CLK(pwm1, PXA168_PWM1, 1, 13000000);
71static APBC_CLK(pwm2, PXA168_PWM2, 1, 13000000);
72static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000);
73static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000);
68 74
69/* device and clock bindings */ 75/* device and clock bindings */
70static struct clk_lookup pxa168_clkregs[] = { 76static struct clk_lookup pxa168_clkregs[] = {
71 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), 77 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
72 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), 78 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
79 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
80 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
81 INIT_CLKREG(&clk_pwm1, "pxa168-pwm.0", NULL),
82 INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL),
83 INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL),
84 INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL),
73}; 85};
74 86
75static int __init pxa168_init(void) 87static int __init pxa168_init(void)
@@ -109,3 +121,9 @@ struct sys_timer pxa168_timer = {
109/* on-chip devices */ 121/* on-chip devices */
110PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22); 122PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22);
111PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24); 123PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24);
124PXA168_DEVICE(twsi0, "pxa2xx-i2c", 0, TWSI0, 0xd4011000, 0x28);
125PXA168_DEVICE(twsi1, "pxa2xx-i2c", 1, TWSI1, 0xd4025000, 0x28);
126PXA168_DEVICE(pwm1, "pxa168-pwm", 0, NONE, 0xd401a000, 0x10);
127PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE, 0xd401a400, 0x10);
128PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10);
129PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10);
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 453f8f7758bf..5882ca6b49fb 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -103,11 +103,23 @@ void __init pxa910_init_irq(void)
103/* APB peripheral clocks */ 103/* APB peripheral clocks */
104static APBC_CLK(uart1, PXA910_UART0, 1, 14745600); 104static APBC_CLK(uart1, PXA910_UART0, 1, 14745600);
105static APBC_CLK(uart2, PXA910_UART1, 1, 14745600); 105static APBC_CLK(uart2, PXA910_UART1, 1, 14745600);
106static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
107static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
108static APBC_CLK(pwm1, PXA910_PWM1, 1, 13000000);
109static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000);
110static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000);
111static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000);
106 112
107/* device and clock bindings */ 113/* device and clock bindings */
108static struct clk_lookup pxa910_clkregs[] = { 114static struct clk_lookup pxa910_clkregs[] = {
109 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), 115 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
110 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), 116 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
117 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
118 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
119 INIT_CLKREG(&clk_pwm1, "pxa910-pwm.0", NULL),
120 INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL),
121 INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
122 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
111}; 123};
112 124
113static int __init pxa910_init(void) 125static int __init pxa910_init(void)
@@ -156,3 +168,9 @@ struct sys_timer pxa910_timer = {
156 */ 168 */
157PXA910_DEVICE(uart1, "pxa2xx-uart", 0, UART2, 0xd4017000, 0x30, 21, 22); 169PXA910_DEVICE(uart1, "pxa2xx-uart", 0, UART2, 0xd4017000, 0x30, 21, 22);
158PXA910_DEVICE(uart2, "pxa2xx-uart", 1, UART3, 0xd4018000, 0x30, 23, 24); 170PXA910_DEVICE(uart2, "pxa2xx-uart", 1, UART3, 0xd4018000, 0x30, 23, 24);
171PXA910_DEVICE(twsi0, "pxa2xx-i2c", 0, TWSI0, 0xd4011000, 0x28);
172PXA910_DEVICE(twsi1, "pxa2xx-i2c", 1, TWSI1, 0xd4025000, 0x28);
173PXA910_DEVICE(pwm1, "pxa910-pwm", 0, NONE, 0xd401a000, 0x10);
174PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10);
175PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
176PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c
index f289b0ea7dcf..22b4ff893b3c 100644
--- a/arch/arm/mach-mv78xx0/irq.c
+++ b/arch/arm/mach-mv78xx0/irq.c
@@ -28,6 +28,9 @@ void __init mv78xx0_init_irq(void)
28{ 28{
29 int i; 29 int i;
30 30
31 /* Initialize gpiolib. */
32 orion_gpio_init();
33
31 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 34 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
32 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 35 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
33 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF)); 36 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF));
diff --git a/arch/arm/mach-mx1/generic.c b/arch/arm/mach-mx1/generic.c
index 0dec6f300ffc..7622c9b38c97 100644
--- a/arch/arm/mach-mx1/generic.c
+++ b/arch/arm/mach-mx1/generic.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <mach/common.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30 31
31static struct map_desc imx_io_desc[] __initdata = { 32static struct map_desc imx_io_desc[] __initdata = {
@@ -37,7 +38,9 @@ static struct map_desc imx_io_desc[] __initdata = {
37 } 38 }
38}; 39};
39 40
40void __init mxc_map_io(void) 41void __init mx1_map_io(void)
41{ 42{
43 mxc_set_cpu_type(MXC_CPU_MX1);
44
42 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc)); 45 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
43} 46}
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c
index e54057fb855b..e5b0c0a83c3b 100644
--- a/arch/arm/mach-mx1/mx1ads.c
+++ b/arch/arm/mach-mx1/mx1ads.c
@@ -12,77 +12,56 @@
12 * warranty of any kind, whether express or implied. 12 * warranty of any kind, whether express or implied.
13 */ 13 */
14 14
15#include <linux/kernel.h> 15#include <linux/i2c.h>
16#include <linux/i2c/pcf857x.h>
16#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/kernel.h>
17#include <linux/platform_device.h> 19#include <linux/platform_device.h>
18#include <linux/mtd/physmap.h> 20#include <linux/mtd/physmap.h>
19#include <linux/i2c.h>
20#include <linux/i2c/pcf857x.h>
21 21
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/time.h> 24#include <asm/mach/time.h>
25 25
26#include <mach/irqs.h>
27#include <mach/hardware.h>
28#include <mach/common.h> 26#include <mach/common.h>
29#include <mach/imx-uart.h> 27#include <mach/hardware.h>
30#include <mach/irqs.h>
31#include <mach/i2c.h> 28#include <mach/i2c.h>
29#include <mach/imx-uart.h>
32#include <mach/iomux.h> 30#include <mach/iomux.h>
31#include <mach/irqs.h>
32
33#include "devices.h" 33#include "devices.h"
34 34
35/* 35static int mx1ads_pins[] = {
36 * UARTs platform data 36 /* UART1 */
37 */
38static int mxc_uart1_pins[] = {
39 PC9_PF_UART1_CTS, 37 PC9_PF_UART1_CTS,
40 PC10_PF_UART1_RTS, 38 PC10_PF_UART1_RTS,
41 PC11_PF_UART1_TXD, 39 PC11_PF_UART1_TXD,
42 PC12_PF_UART1_RXD, 40 PC12_PF_UART1_RXD,
43}; 41 /* UART2 */
44
45static int uart1_mxc_init(struct platform_device *pdev)
46{
47 return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
48 ARRAY_SIZE(mxc_uart1_pins), "UART1");
49}
50
51static int uart1_mxc_exit(struct platform_device *pdev)
52{
53 mxc_gpio_release_multiple_pins(mxc_uart1_pins,
54 ARRAY_SIZE(mxc_uart1_pins));
55 return 0;
56}
57
58static int mxc_uart2_pins[] = {
59 PB28_PF_UART2_CTS, 42 PB28_PF_UART2_CTS,
60 PB29_PF_UART2_RTS, 43 PB29_PF_UART2_RTS,
61 PB30_PF_UART2_TXD, 44 PB30_PF_UART2_TXD,
62 PB31_PF_UART2_RXD, 45 PB31_PF_UART2_RXD,
46 /* I2C */
47 PA15_PF_I2C_SDA,
48 PA16_PF_I2C_SCL,
49 /* SPI */
50 PC13_PF_SPI1_SPI_RDY,
51 PC14_PF_SPI1_SCLK,
52 PC15_PF_SPI1_SS,
53 PC16_PF_SPI1_MISO,
54 PC17_PF_SPI1_MOSI,
63}; 55};
64 56
65static int uart2_mxc_init(struct platform_device *pdev) 57/*
66{ 58 * UARTs platform data
67 return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, 59 */
68 ARRAY_SIZE(mxc_uart2_pins), "UART2");
69}
70
71static int uart2_mxc_exit(struct platform_device *pdev)
72{
73 mxc_gpio_release_multiple_pins(mxc_uart2_pins,
74 ARRAY_SIZE(mxc_uart2_pins));
75 return 0;
76}
77 60
78static struct imxuart_platform_data uart_pdata[] = { 61static struct imxuart_platform_data uart_pdata[] = {
79 { 62 {
80 .init = uart1_mxc_init,
81 .exit = uart1_mxc_exit,
82 .flags = IMXUART_HAVE_RTSCTS, 63 .flags = IMXUART_HAVE_RTSCTS,
83 }, { 64 }, {
84 .init = uart2_mxc_init,
85 .exit = uart2_mxc_exit,
86 .flags = IMXUART_HAVE_RTSCTS, 65 .flags = IMXUART_HAVE_RTSCTS,
87 }, 66 },
88}; 67};
@@ -111,24 +90,6 @@ static struct platform_device flash_device = {
111/* 90/*
112 * I2C 91 * I2C
113 */ 92 */
114
115static int i2c_pins[] = {
116 PA15_PF_I2C_SDA,
117 PA16_PF_I2C_SCL,
118};
119
120static int i2c_init(struct device *dev)
121{
122 return mxc_gpio_setup_multiple_pins(i2c_pins,
123 ARRAY_SIZE(i2c_pins), "I2C");
124}
125
126static void i2c_exit(struct device *dev)
127{
128 mxc_gpio_release_multiple_pins(i2c_pins,
129 ARRAY_SIZE(i2c_pins));
130}
131
132static struct pcf857x_platform_data pcf857x_data[] = { 93static struct pcf857x_platform_data pcf857x_data[] = {
133 { 94 {
134 .gpio_base = 4 * 32, 95 .gpio_base = 4 * 32,
@@ -139,8 +100,6 @@ static struct pcf857x_platform_data pcf857x_data[] = {
139 100
140static struct imxi2c_platform_data mx1ads_i2c_data = { 101static struct imxi2c_platform_data mx1ads_i2c_data = {
141 .bitrate = 100000, 102 .bitrate = 100000,
142 .init = i2c_init,
143 .exit = i2c_exit,
144}; 103};
145 104
146static struct i2c_board_info mx1ads_i2c_devices[] = { 105static struct i2c_board_info mx1ads_i2c_devices[] = {
@@ -160,6 +119,9 @@ static struct i2c_board_info mx1ads_i2c_devices[] = {
160 */ 119 */
161static void __init mx1ads_init(void) 120static void __init mx1ads_init(void)
162{ 121{
122 mxc_gpio_setup_multiple_pins(mx1ads_pins,
123 ARRAY_SIZE(mx1ads_pins), "mx1ads");
124
163 /* UART */ 125 /* UART */
164 mxc_register_device(&imx_uart1_device, &uart_pdata[0]); 126 mxc_register_device(&imx_uart1_device, &uart_pdata[0]);
165 mxc_register_device(&imx_uart2_device, &uart_pdata[1]); 127 mxc_register_device(&imx_uart2_device, &uart_pdata[1]);
@@ -188,7 +150,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
188 .phys_io = IMX_IO_PHYS, 150 .phys_io = IMX_IO_PHYS,
189 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, 151 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
190 .boot_params = PHYS_OFFSET + 0x100, 152 .boot_params = PHYS_OFFSET + 0x100,
191 .map_io = mxc_map_io, 153 .map_io = mx1_map_io,
192 .init_irq = mxc_init_irq, 154 .init_irq = mxc_init_irq,
193 .timer = &mx1ads_timer, 155 .timer = &mx1ads_timer,
194 .init_machine = mx1ads_init, 156 .init_machine = mx1ads_init,
@@ -198,7 +160,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS")
198 .phys_io = IMX_IO_PHYS, 160 .phys_io = IMX_IO_PHYS,
199 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, 161 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
200 .boot_params = PHYS_OFFSET + 0x100, 162 .boot_params = PHYS_OFFSET + 0x100,
201 .map_io = mxc_map_io, 163 .map_io = mx1_map_io,
202 .init_irq = mxc_init_irq, 164 .init_irq = mxc_init_irq,
203 .timer = &mx1ads_timer, 165 .timer = &mx1ads_timer,
204 .init_machine = mx1ads_init, 166 .init_machine = mx1ads_init,
diff --git a/arch/arm/mach-mx1/scb9328.c b/arch/arm/mach-mx1/scb9328.c
index 0e71f3fa28bf..20e0b5bcdffc 100644
--- a/arch/arm/mach-mx1/scb9328.c
+++ b/arch/arm/mach-mx1/scb9328.c
@@ -153,7 +153,7 @@ MACHINE_START(SCB9328, "Synertronixx scb9328")
153 .phys_io = 0x00200000, 153 .phys_io = 0x00200000,
154 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, 154 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
155 .boot_params = 0x08000100, 155 .boot_params = 0x08000100,
156 .map_io = mxc_map_io, 156 .map_io = mx1_map_io,
157 .init_irq = mxc_init_irq, 157 .init_irq = mxc_init_irq,
158 .timer = &scb9328_timer, 158 .timer = &scb9328_timer,
159 .init_machine = scb9328_init, 159 .init_machine = scb9328_init,
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index 42a788842f49..c77da586b71d 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -18,6 +18,13 @@ endchoice
18 18
19comment "MX2 platforms:" 19comment "MX2 platforms:"
20 20
21config MACH_MX21ADS
22 bool "MX21ADS platform"
23 depends on MACH_MX21
24 help
25 Include support for MX21ADS platform. This includes specific
26 configurations for the board and its peripherals.
27
21config MACH_MX27ADS 28config MACH_MX27ADS
22 bool "MX27ADS platform" 29 bool "MX27ADS platform"
23 depends on MACH_MX27 30 depends on MACH_MX27
@@ -46,4 +53,18 @@ config MACH_PCM970_BASEBOARD
46 53
47endchoice 54endchoice
48 55
56config MACH_MX27_3DS
57 bool "MX27PDK platform"
58 depends on MACH_MX27
59 help
60 Include support for MX27PDK platform. This includes specific
61 configurations for the board and its peripherals.
62
63config MACH_MX27LITE
64 bool "LogicPD MX27 LITEKIT platform"
65 depends on MACH_MX27
66 help
67 Include support for MX27 LITEKIT platform. This includes specific
68 configurations for the board and its peripherals.
69
49endif 70endif
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index 950649a91540..b9b1cca4e9bc 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -11,6 +11,10 @@ obj-$(CONFIG_MACH_MX21) += clock_imx21.o
11obj-$(CONFIG_MACH_MX27) += cpu_imx27.o 11obj-$(CONFIG_MACH_MX27) += cpu_imx27.o
12obj-$(CONFIG_MACH_MX27) += clock_imx27.o 12obj-$(CONFIG_MACH_MX27) += clock_imx27.o
13 13
14obj-$(CONFIG_MACH_MX21ADS) += mx21ads.o
14obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o 15obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o
15obj-$(CONFIG_MACH_PCM038) += pcm038.o 16obj-$(CONFIG_MACH_PCM038) += pcm038.o
16obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o 17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
18obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o
19obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o
20
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index e4b08ca804ea..0850fb88ec15 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -48,6 +48,25 @@ static void _clk_disable(struct clk *clk)
48 __raw_writel(reg, clk->enable_reg); 48 __raw_writel(reg, clk->enable_reg);
49} 49}
50 50
51static unsigned long _clk_generic_round_rate(struct clk *clk,
52 unsigned long rate,
53 u32 max_divisor)
54{
55 u32 div;
56 unsigned long parent_rate;
57
58 parent_rate = clk_get_rate(clk->parent);
59
60 div = parent_rate / rate;
61 if (parent_rate % rate)
62 div++;
63
64 if (div > max_divisor)
65 div = max_divisor;
66
67 return parent_rate / div;
68}
69
51static int _clk_spll_enable(struct clk *clk) 70static int _clk_spll_enable(struct clk *clk)
52{ 71{
53 u32 reg; 72 u32 reg;
@@ -78,19 +97,7 @@ static void _clk_spll_disable(struct clk *clk)
78static unsigned long _clk_perclkx_round_rate(struct clk *clk, 97static unsigned long _clk_perclkx_round_rate(struct clk *clk,
79 unsigned long rate) 98 unsigned long rate)
80{ 99{
81 u32 div; 100 return _clk_generic_round_rate(clk, rate, 64);
82 unsigned long parent_rate;
83
84 parent_rate = clk_get_rate(clk->parent);
85
86 div = parent_rate / rate;
87 if (parent_rate % rate)
88 div++;
89
90 if (div > 64)
91 div = 64;
92
93 return parent_rate / div;
94} 101}
95 102
96static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) 103static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate)
@@ -130,6 +137,32 @@ static unsigned long _clk_usb_recalc(struct clk *clk)
130 return parent_rate / (usb_pdf + 1U); 137 return parent_rate / (usb_pdf + 1U);
131} 138}
132 139
140static unsigned long _clk_usb_round_rate(struct clk *clk,
141 unsigned long rate)
142{
143 return _clk_generic_round_rate(clk, rate, 8);
144}
145
146static int _clk_usb_set_rate(struct clk *clk, unsigned long rate)
147{
148 u32 reg;
149 u32 div;
150 unsigned long parent_rate;
151
152 parent_rate = clk_get_rate(clk->parent);
153
154 div = parent_rate / rate;
155 if (div > 8 || div < 1 || ((parent_rate / div) != rate))
156 return -EINVAL;
157 div--;
158
159 reg = CSCR() & ~CCM_CSCR_USB_MASK;
160 reg |= div << CCM_CSCR_USB_OFFSET;
161 __raw_writel(reg, CCM_CSCR);
162
163 return 0;
164}
165
133static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf) 166static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf)
134{ 167{
135 unsigned long parent_rate; 168 unsigned long parent_rate;
@@ -595,11 +628,14 @@ static struct clk csi_clk[] = {
595static struct clk usb_clk[] = { 628static struct clk usb_clk[] = {
596 { 629 {
597 .parent = &spll_clk, 630 .parent = &spll_clk,
631 .secondary = &usb_clk[1],
598 .get_rate = _clk_usb_recalc, 632 .get_rate = _clk_usb_recalc,
599 .enable = _clk_enable, 633 .enable = _clk_enable,
600 .enable_reg = CCM_PCCR_USBOTG_REG, 634 .enable_reg = CCM_PCCR_USBOTG_REG,
601 .enable_shift = CCM_PCCR_USBOTG_OFFSET, 635 .enable_shift = CCM_PCCR_USBOTG_OFFSET,
602 .disable = _clk_disable, 636 .disable = _clk_disable,
637 .round_rate = _clk_usb_round_rate,
638 .set_rate = _clk_usb_set_rate,
603 }, { 639 }, {
604 .parent = &hclk_clk, 640 .parent = &hclk_clk,
605 .enable = _clk_enable, 641 .enable = _clk_enable,
@@ -768,18 +804,7 @@ static struct clk rtc_clk = {
768 804
769static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) 805static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate)
770{ 806{
771 u32 div; 807 return _clk_generic_round_rate(clk, rate, 8);
772 unsigned long parent_rate;
773
774 parent_rate = clk_get_rate(clk->parent);
775 div = parent_rate / rate;
776 if (parent_rate % rate)
777 div++;
778
779 if (div > 8)
780 div = 8;
781
782 return parent_rate / div;
783} 808}
784 809
785static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) 810static int _clk_clko_set_rate(struct clk *clk, unsigned long rate)
@@ -921,7 +946,7 @@ static struct clk_lookup lookups[] = {
921 _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2]) 946 _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2])
922 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) 947 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0])
923 _REGISTER_CLOCK(NULL, "csi", csi_clk[0]) 948 _REGISTER_CLOCK(NULL, "csi", csi_clk[0])
924 _REGISTER_CLOCK(NULL, "usb", usb_clk[0]) 949 _REGISTER_CLOCK("imx21-hcd.0", NULL, usb_clk[0])
925 _REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0]) 950 _REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0])
926 _REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1]) 951 _REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1])
927 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 952 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
diff --git a/arch/arm/mach-mx2/generic.c b/arch/arm/mach-mx2/generic.c
index bd51dd04948e..169372f69d8f 100644
--- a/arch/arm/mach-mx2/generic.c
+++ b/arch/arm/mach-mx2/generic.c
@@ -69,7 +69,17 @@ static struct map_desc mxc_io_desc[] __initdata = {
69 * system startup to create static physical to virtual 69 * system startup to create static physical to virtual
70 * memory map for the IO modules. 70 * memory map for the IO modules.
71 */ 71 */
72void __init mxc_map_io(void) 72void __init mx21_map_io(void)
73{ 73{
74 mxc_set_cpu_type(MXC_CPU_MX21);
75
74 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 76 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
75} 77}
78
79void __init mx27_map_io(void)
80{
81 mxc_set_cpu_type(MXC_CPU_MX27);
82
83 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
84}
85
diff --git a/arch/arm/mach-mx2/mx21ads.c b/arch/arm/mach-mx2/mx21ads.c
new file mode 100644
index 000000000000..a5ee461cb405
--- /dev/null
+++ b/arch/arm/mach-mx2/mx21ads.c
@@ -0,0 +1,286 @@
1/*
2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/platform_device.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/physmap.h>
24#include <linux/gpio.h>
25#include <mach/common.h>
26#include <mach/hardware.h>
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/time.h>
30#include <asm/mach/map.h>
31#include <mach/imx-uart.h>
32#include <mach/imxfb.h>
33#include <mach/iomux.h>
34#include <mach/mxc_nand.h>
35#include <mach/mmc.h>
36#include <mach/board-mx21ads.h>
37
38#include "devices.h"
39
40static unsigned int mx21ads_pins[] = {
41
42 /* CS8900A */
43 (GPIO_PORTE | GPIO_GPIO | GPIO_IN | 11),
44
45 /* UART1 */
46 PE12_PF_UART1_TXD,
47 PE13_PF_UART1_RXD,
48 PE14_PF_UART1_CTS,
49 PE15_PF_UART1_RTS,
50
51 /* UART3 (IrDA) - only TXD and RXD */
52 PE8_PF_UART3_TXD,
53 PE9_PF_UART3_RXD,
54
55 /* UART4 */
56 PB26_AF_UART4_RTS,
57 PB28_AF_UART4_TXD,
58 PB29_AF_UART4_CTS,
59 PB31_AF_UART4_RXD,
60
61 /* LCDC */
62 PA5_PF_LSCLK,
63 PA6_PF_LD0,
64 PA7_PF_LD1,
65 PA8_PF_LD2,
66 PA9_PF_LD3,
67 PA10_PF_LD4,
68 PA11_PF_LD5,
69 PA12_PF_LD6,
70 PA13_PF_LD7,
71 PA14_PF_LD8,
72 PA15_PF_LD9,
73 PA16_PF_LD10,
74 PA17_PF_LD11,
75 PA18_PF_LD12,
76 PA19_PF_LD13,
77 PA20_PF_LD14,
78 PA21_PF_LD15,
79 PA22_PF_LD16,
80 PA24_PF_REV, /* Sharp panel dedicated signal */
81 PA25_PF_CLS, /* Sharp panel dedicated signal */
82 PA26_PF_PS, /* Sharp panel dedicated signal */
83 PA27_PF_SPL_SPR, /* Sharp panel dedicated signal */
84 PA28_PF_HSYNC,
85 PA29_PF_VSYNC,
86 PA30_PF_CONTRAST,
87 PA31_PF_OE_ACD,
88
89 /* MMC/SDHC */
90 PE18_PF_SD1_D0,
91 PE19_PF_SD1_D1,
92 PE20_PF_SD1_D2,
93 PE21_PF_SD1_D3,
94 PE22_PF_SD1_CMD,
95 PE23_PF_SD1_CLK,
96
97 /* NFC */
98 PF0_PF_NRFB,
99 PF1_PF_NFCE,
100 PF2_PF_NFWP,
101 PF3_PF_NFCLE,
102 PF4_PF_NFALE,
103 PF5_PF_NFRE,
104 PF6_PF_NFWE,
105 PF7_PF_NFIO0,
106 PF8_PF_NFIO1,
107 PF9_PF_NFIO2,
108 PF10_PF_NFIO3,
109 PF11_PF_NFIO4,
110 PF12_PF_NFIO5,
111 PF13_PF_NFIO6,
112 PF14_PF_NFIO7,
113};
114
115/* ADS's NOR flash: 2x AM29BDS128HE9VKI on 32-bit bus */
116static struct physmap_flash_data mx21ads_flash_data = {
117 .width = 4,
118};
119
120static struct resource mx21ads_flash_resource = {
121 .start = CS0_BASE_ADDR,
122 .end = CS0_BASE_ADDR + 0x02000000 - 1,
123 .flags = IORESOURCE_MEM,
124};
125
126static struct platform_device mx21ads_nor_mtd_device = {
127 .name = "physmap-flash",
128 .id = 0,
129 .dev = {
130 .platform_data = &mx21ads_flash_data,
131 },
132 .num_resources = 1,
133 .resource = &mx21ads_flash_resource,
134};
135
136static struct imxuart_platform_data uart_pdata = {
137 .flags = IMXUART_HAVE_RTSCTS,
138};
139
140static struct imxuart_platform_data uart_norts_pdata = {
141};
142
143
144static int mx21ads_fb_init(struct platform_device *pdev)
145{
146 u16 tmp;
147
148 tmp = __raw_readw(MX21ADS_IO_REG);
149 tmp |= MX21ADS_IO_LCDON;
150 __raw_writew(tmp, MX21ADS_IO_REG);
151 return 0;
152}
153
154static void mx21ads_fb_exit(struct platform_device *pdev)
155{
156 u16 tmp;
157
158 tmp = __raw_readw(MX21ADS_IO_REG);
159 tmp &= ~MX21ADS_IO_LCDON;
160 __raw_writew(tmp, MX21ADS_IO_REG);
161}
162
163/*
164 * Connected is a portrait Sharp-QVGA display
165 * of type: LQ035Q7DB02
166 */
167static struct imx_fb_platform_data mx21ads_fb_data = {
168 .pixclock = 188679, /* in ps */
169 .xres = 240,
170 .yres = 320,
171
172 .bpp = 16,
173 .hsync_len = 2,
174 .left_margin = 6,
175 .right_margin = 16,
176
177 .vsync_len = 1,
178 .upper_margin = 8,
179 .lower_margin = 10,
180 .fixed_screen_cpu = 0,
181
182 .pcr = 0xFB108BC7,
183 .pwmr = 0x00A901ff,
184 .lscr1 = 0x00120300,
185 .dmacr = 0x00020008,
186
187 .init = mx21ads_fb_init,
188 .exit = mx21ads_fb_exit,
189};
190
191static int mx21ads_sdhc_get_ro(struct device *dev)
192{
193 return (__raw_readw(MX21ADS_IO_REG) & MX21ADS_IO_SD_WP) ? 1 : 0;
194}
195
196static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq,
197 void *data)
198{
199 int ret;
200
201 ret = request_irq(IRQ_GPIOD(25), detect_irq,
202 IRQF_TRIGGER_FALLING, "mmc-detect", data);
203 if (ret)
204 goto out;
205 return 0;
206out:
207 return ret;
208}
209
210static void mx21ads_sdhc_exit(struct device *dev, void *data)
211{
212 free_irq(IRQ_GPIOD(25), data);
213}
214
215static struct imxmmc_platform_data mx21ads_sdhc_pdata = {
216 .ocr_avail = MMC_VDD_29_30 | MMC_VDD_30_31, /* 3.0V */
217 .get_ro = mx21ads_sdhc_get_ro,
218 .init = mx21ads_sdhc_init,
219 .exit = mx21ads_sdhc_exit,
220};
221
222static struct mxc_nand_platform_data mx21ads_nand_board_info = {
223 .width = 1,
224 .hw_ecc = 1,
225};
226
227static struct map_desc mx21ads_io_desc[] __initdata = {
228 /*
229 * Memory-mapped I/O on MX21ADS Base board:
230 * - CS8900A Ethernet controller
231 * - ST16C2552CJ UART
232 * - CPU and Base board version
233 * - Base board I/O register
234 */
235 {
236 .virtual = MX21ADS_MMIO_BASE_ADDR,
237 .pfn = __phys_to_pfn(CS1_BASE_ADDR),
238 .length = MX21ADS_MMIO_SIZE,
239 .type = MT_DEVICE,
240 },
241};
242
243static void __init mx21ads_map_io(void)
244{
245 mx21_map_io();
246 iotable_init(mx21ads_io_desc, ARRAY_SIZE(mx21ads_io_desc));
247}
248
249static struct platform_device *platform_devices[] __initdata = {
250 &mx21ads_nor_mtd_device,
251};
252
253static void __init mx21ads_board_init(void)
254{
255 mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins),
256 "mx21ads");
257
258 mxc_register_device(&mxc_uart_device0, &uart_pdata);
259 mxc_register_device(&mxc_uart_device2, &uart_norts_pdata);
260 mxc_register_device(&mxc_uart_device3, &uart_pdata);
261 mxc_register_device(&mxc_fb_device, &mx21ads_fb_data);
262 mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata);
263 mxc_register_device(&mxc_nand_device, &mx21ads_nand_board_info);
264
265 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
266}
267
268static void __init mx21ads_timer_init(void)
269{
270 mx21_clocks_init(32768, 26000000);
271}
272
273static struct sys_timer mx21ads_timer = {
274 .init = mx21ads_timer_init,
275};
276
277MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
278 /* maintainer: Freescale Semiconductor, Inc. */
279 .phys_io = AIPI_BASE_ADDR,
280 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
281 .boot_params = PHYS_OFFSET + 0x100,
282 .map_io = mx21ads_map_io,
283 .init_irq = mxc_init_irq,
284 .init_machine = mx21ads_board_init,
285 .timer = &mx21ads_timer,
286MACHINE_END
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c
index 4a3b097adc12..02daddac6995 100644
--- a/arch/arm/mach-mx2/mx27ads.c
+++ b/arch/arm/mach-mx2/mx27ads.c
@@ -23,6 +23,8 @@
23#include <linux/mtd/map.h> 23#include <linux/mtd/map.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/i2c.h>
27#include <linux/irq.h>
26#include <mach/common.h> 28#include <mach/common.h>
27#include <mach/hardware.h> 29#include <mach/hardware.h>
28#include <asm/mach-types.h> 30#include <asm/mach-types.h>
@@ -33,9 +35,117 @@
33#include <mach/imx-uart.h> 35#include <mach/imx-uart.h>
34#include <mach/iomux.h> 36#include <mach/iomux.h>
35#include <mach/board-mx27ads.h> 37#include <mach/board-mx27ads.h>
38#include <mach/mxc_nand.h>
39#include <mach/i2c.h>
40#include <mach/imxfb.h>
41#include <mach/mmc.h>
36 42
37#include "devices.h" 43#include "devices.h"
38 44
45static unsigned int mx27ads_pins[] = {
46 /* UART0 */
47 PE12_PF_UART1_TXD,
48 PE13_PF_UART1_RXD,
49 PE14_PF_UART1_CTS,
50 PE15_PF_UART1_RTS,
51 /* UART1 */
52 PE3_PF_UART2_CTS,
53 PE4_PF_UART2_RTS,
54 PE6_PF_UART2_TXD,
55 PE7_PF_UART2_RXD,
56 /* UART2 */
57 PE8_PF_UART3_TXD,
58 PE9_PF_UART3_RXD,
59 PE10_PF_UART3_CTS,
60 PE11_PF_UART3_RTS,
61 /* UART3 */
62 PB26_AF_UART4_RTS,
63 PB28_AF_UART4_TXD,
64 PB29_AF_UART4_CTS,
65 PB31_AF_UART4_RXD,
66 /* UART4 */
67 PB18_AF_UART5_TXD,
68 PB19_AF_UART5_RXD,
69 PB20_AF_UART5_CTS,
70 PB21_AF_UART5_RTS,
71 /* UART5 */
72 PB10_AF_UART6_TXD,
73 PB12_AF_UART6_CTS,
74 PB11_AF_UART6_RXD,
75 PB13_AF_UART6_RTS,
76 /* FEC */
77 PD0_AIN_FEC_TXD0,
78 PD1_AIN_FEC_TXD1,
79 PD2_AIN_FEC_TXD2,
80 PD3_AIN_FEC_TXD3,
81 PD4_AOUT_FEC_RX_ER,
82 PD5_AOUT_FEC_RXD1,
83 PD6_AOUT_FEC_RXD2,
84 PD7_AOUT_FEC_RXD3,
85 PD8_AF_FEC_MDIO,
86 PD9_AIN_FEC_MDC,
87 PD10_AOUT_FEC_CRS,
88 PD11_AOUT_FEC_TX_CLK,
89 PD12_AOUT_FEC_RXD0,
90 PD13_AOUT_FEC_RX_DV,
91 PD14_AOUT_FEC_RX_CLK,
92 PD15_AOUT_FEC_COL,
93 PD16_AIN_FEC_TX_ER,
94 PF23_AIN_FEC_TX_EN,
95 /* I2C2 */
96 PC5_PF_I2C2_SDA,
97 PC6_PF_I2C2_SCL,
98 /* FB */
99 PA5_PF_LSCLK,
100 PA6_PF_LD0,
101 PA7_PF_LD1,
102 PA8_PF_LD2,
103 PA9_PF_LD3,
104 PA10_PF_LD4,
105 PA11_PF_LD5,
106 PA12_PF_LD6,
107 PA13_PF_LD7,
108 PA14_PF_LD8,
109 PA15_PF_LD9,
110 PA16_PF_LD10,
111 PA17_PF_LD11,
112 PA18_PF_LD12,
113 PA19_PF_LD13,
114 PA20_PF_LD14,
115 PA21_PF_LD15,
116 PA22_PF_LD16,
117 PA23_PF_LD17,
118 PA24_PF_REV,
119 PA25_PF_CLS,
120 PA26_PF_PS,
121 PA27_PF_SPL_SPR,
122 PA28_PF_HSYNC,
123 PA29_PF_VSYNC,
124 PA30_PF_CONTRAST,
125 PA31_PF_OE_ACD,
126 /* OWIRE */
127 PE16_AF_OWIRE,
128 /* SDHC1*/
129 PE18_PF_SD1_D0,
130 PE19_PF_SD1_D1,
131 PE20_PF_SD1_D2,
132 PE21_PF_SD1_D3,
133 PE22_PF_SD1_CMD,
134 PE23_PF_SD1_CLK,
135 /* SDHC2*/
136 PB4_PF_SD2_D0,
137 PB5_PF_SD2_D1,
138 PB6_PF_SD2_D2,
139 PB7_PF_SD2_D3,
140 PB8_PF_SD2_CMD,
141 PB9_PF_SD2_CLK,
142};
143
144static struct mxc_nand_platform_data mx27ads_nand_board_info = {
145 .width = 1,
146 .hw_ecc = 1,
147};
148
39/* ADS's NOR flash */ 149/* ADS's NOR flash */
40static struct physmap_flash_data mx27ads_flash_data = { 150static struct physmap_flash_data mx27ads_flash_data = {
41 .width = 2, 151 .width = 2,
@@ -58,189 +168,113 @@ static struct platform_device mx27ads_nor_mtd_device = {
58 .resource = &mx27ads_flash_resource, 168 .resource = &mx27ads_flash_resource,
59}; 169};
60 170
61static int mxc_uart0_pins[] = { 171static struct imxi2c_platform_data mx27ads_i2c_data = {
62 PE12_PF_UART1_TXD, 172 .bitrate = 100000,
63 PE13_PF_UART1_RXD,
64 PE14_PF_UART1_CTS,
65 PE15_PF_UART1_RTS
66}; 173};
67 174
68static int uart_mxc_port0_init(struct platform_device *pdev) 175static struct i2c_board_info mx27ads_i2c_devices[] = {
69{
70 return mxc_gpio_setup_multiple_pins(mxc_uart0_pins,
71 ARRAY_SIZE(mxc_uart0_pins), "UART0");
72}
73
74static int uart_mxc_port0_exit(struct platform_device *pdev)
75{
76 mxc_gpio_release_multiple_pins(mxc_uart0_pins,
77 ARRAY_SIZE(mxc_uart0_pins));
78 return 0;
79}
80
81static int mxc_uart1_pins[] = {
82 PE3_PF_UART2_CTS,
83 PE4_PF_UART2_RTS,
84 PE6_PF_UART2_TXD,
85 PE7_PF_UART2_RXD
86}; 176};
87 177
88static int uart_mxc_port1_init(struct platform_device *pdev) 178void lcd_power(int on)
89{ 179{
90 return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, 180 if (on)
91 ARRAY_SIZE(mxc_uart1_pins), "UART1"); 181 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG);
182 else
183 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
92} 184}
93 185
94static int uart_mxc_port1_exit(struct platform_device *pdev) 186static struct imx_fb_platform_data mx27ads_fb_data = {
95{ 187 .pixclock = 188679,
96 mxc_gpio_release_multiple_pins(mxc_uart1_pins, 188 .xres = 240,
97 ARRAY_SIZE(mxc_uart1_pins)); 189 .yres = 320,
98 return 0; 190
99} 191 .bpp = 16,
100 192 .hsync_len = 1,
101static int mxc_uart2_pins[] = { 193 .left_margin = 9,
102 PE8_PF_UART3_TXD, 194 .right_margin = 16,
103 PE9_PF_UART3_RXD, 195
104 PE10_PF_UART3_CTS, 196 .vsync_len = 1,
105 PE11_PF_UART3_RTS 197 .upper_margin = 7,
198 .lower_margin = 9,
199 .fixed_screen_cpu = 0,
200
201 /*
202 * - HSYNC active high
203 * - VSYNC active high
204 * - clk notenabled while idle
205 * - clock inverted
206 * - data not inverted
207 * - data enable low active
208 * - enable sharp mode
209 */
210 .pcr = 0xFB008BC0,
211 .pwmr = 0x00A903FF,
212 .lscr1 = 0x00120300,
213 .dmacr = 0x00020010,
214
215 .lcd_power = lcd_power,
106}; 216};
107 217
108static int uart_mxc_port2_init(struct platform_device *pdev) 218static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
219 void *data)
109{ 220{
110 return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, 221 return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING,
111 ARRAY_SIZE(mxc_uart2_pins), "UART2"); 222 "sdhc1-card-detect", data);
112} 223}
113 224
114static int uart_mxc_port2_exit(struct platform_device *pdev) 225static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
226 void *data)
115{ 227{
116 mxc_gpio_release_multiple_pins(mxc_uart2_pins, 228 return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING,
117 ARRAY_SIZE(mxc_uart2_pins)); 229 "sdhc2-card-detect", data);
118 return 0;
119} 230}
120 231
121static int mxc_uart3_pins[] = { 232static void mx27ads_sdhc1_exit(struct device *dev, void *data)
122 PB26_AF_UART4_RTS,
123 PB28_AF_UART4_TXD,
124 PB29_AF_UART4_CTS,
125 PB31_AF_UART4_RXD
126};
127
128static int uart_mxc_port3_init(struct platform_device *pdev)
129{ 233{
130 return mxc_gpio_setup_multiple_pins(mxc_uart3_pins, 234 free_irq(IRQ_GPIOE(21), data);
131 ARRAY_SIZE(mxc_uart3_pins), "UART3");
132} 235}
133 236
134static int uart_mxc_port3_exit(struct platform_device *pdev) 237static void mx27ads_sdhc2_exit(struct device *dev, void *data)
135{ 238{
136 mxc_gpio_release_multiple_pins(mxc_uart3_pins, 239 free_irq(IRQ_GPIOB(7), data);
137 ARRAY_SIZE(mxc_uart3_pins));
138 return 0;
139} 240}
140 241
141static int mxc_uart4_pins[] = { 242static struct imxmmc_platform_data sdhc1_pdata = {
142 PB18_AF_UART5_TXD, 243 .init = mx27ads_sdhc1_init,
143 PB19_AF_UART5_RXD, 244 .exit = mx27ads_sdhc1_exit,
144 PB20_AF_UART5_CTS,
145 PB21_AF_UART5_RTS
146}; 245};
147 246
148static int uart_mxc_port4_init(struct platform_device *pdev) 247static struct imxmmc_platform_data sdhc2_pdata = {
149{ 248 .init = mx27ads_sdhc2_init,
150 return mxc_gpio_setup_multiple_pins(mxc_uart4_pins, 249 .exit = mx27ads_sdhc2_exit,
151 ARRAY_SIZE(mxc_uart4_pins), "UART4");
152}
153
154static int uart_mxc_port4_exit(struct platform_device *pdev)
155{
156 mxc_gpio_release_multiple_pins(mxc_uart4_pins,
157 ARRAY_SIZE(mxc_uart4_pins));
158 return 0;
159}
160
161static int mxc_uart5_pins[] = {
162 PB10_AF_UART6_TXD,
163 PB12_AF_UART6_CTS,
164 PB11_AF_UART6_RXD,
165 PB13_AF_UART6_RTS
166}; 250};
167 251
168static int uart_mxc_port5_init(struct platform_device *pdev)
169{
170 return mxc_gpio_setup_multiple_pins(mxc_uart5_pins,
171 ARRAY_SIZE(mxc_uart5_pins), "UART5");
172}
173
174static int uart_mxc_port5_exit(struct platform_device *pdev)
175{
176 mxc_gpio_release_multiple_pins(mxc_uart5_pins,
177 ARRAY_SIZE(mxc_uart5_pins));
178 return 0;
179}
180
181static struct platform_device *platform_devices[] __initdata = { 252static struct platform_device *platform_devices[] __initdata = {
182 &mx27ads_nor_mtd_device, 253 &mx27ads_nor_mtd_device,
183 &mxc_fec_device, 254 &mxc_fec_device,
255 &mxc_w1_master_device,
184}; 256};
185 257
186static int mxc_fec_pins[] = {
187 PD0_AIN_FEC_TXD0,
188 PD1_AIN_FEC_TXD1,
189 PD2_AIN_FEC_TXD2,
190 PD3_AIN_FEC_TXD3,
191 PD4_AOUT_FEC_RX_ER,
192 PD5_AOUT_FEC_RXD1,
193 PD6_AOUT_FEC_RXD2,
194 PD7_AOUT_FEC_RXD3,
195 PD8_AF_FEC_MDIO,
196 PD9_AIN_FEC_MDC,
197 PD10_AOUT_FEC_CRS,
198 PD11_AOUT_FEC_TX_CLK,
199 PD12_AOUT_FEC_RXD0,
200 PD13_AOUT_FEC_RX_DV,
201 PD14_AOUT_FEC_RX_CLK,
202 PD15_AOUT_FEC_COL,
203 PD16_AIN_FEC_TX_ER,
204 PF23_AIN_FEC_TX_EN
205};
206
207static void gpio_fec_active(void)
208{
209 mxc_gpio_setup_multiple_pins(mxc_fec_pins,
210 ARRAY_SIZE(mxc_fec_pins), "FEC");
211}
212
213static struct imxuart_platform_data uart_pdata[] = { 258static struct imxuart_platform_data uart_pdata[] = {
214 { 259 {
215 .init = uart_mxc_port0_init,
216 .exit = uart_mxc_port0_exit,
217 .flags = IMXUART_HAVE_RTSCTS, 260 .flags = IMXUART_HAVE_RTSCTS,
218 }, { 261 }, {
219 .init = uart_mxc_port1_init,
220 .exit = uart_mxc_port1_exit,
221 .flags = IMXUART_HAVE_RTSCTS, 262 .flags = IMXUART_HAVE_RTSCTS,
222 }, { 263 }, {
223 .init = uart_mxc_port2_init,
224 .exit = uart_mxc_port2_exit,
225 .flags = IMXUART_HAVE_RTSCTS, 264 .flags = IMXUART_HAVE_RTSCTS,
226 }, { 265 }, {
227 .init = uart_mxc_port3_init,
228 .exit = uart_mxc_port3_exit,
229 .flags = IMXUART_HAVE_RTSCTS, 266 .flags = IMXUART_HAVE_RTSCTS,
230 }, { 267 }, {
231 .init = uart_mxc_port4_init,
232 .exit = uart_mxc_port4_exit,
233 .flags = IMXUART_HAVE_RTSCTS, 268 .flags = IMXUART_HAVE_RTSCTS,
234 }, { 269 }, {
235 .init = uart_mxc_port5_init,
236 .exit = uart_mxc_port5_exit,
237 .flags = IMXUART_HAVE_RTSCTS, 270 .flags = IMXUART_HAVE_RTSCTS,
238 }, 271 },
239}; 272};
240 273
241static void __init mx27ads_board_init(void) 274static void __init mx27ads_board_init(void)
242{ 275{
243 gpio_fec_active(); 276 mxc_gpio_setup_multiple_pins(mx27ads_pins, ARRAY_SIZE(mx27ads_pins),
277 "mx27ads");
244 278
245 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); 279 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
246 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); 280 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
@@ -248,6 +282,15 @@ static void __init mx27ads_board_init(void)
248 mxc_register_device(&mxc_uart_device3, &uart_pdata[3]); 282 mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
249 mxc_register_device(&mxc_uart_device4, &uart_pdata[4]); 283 mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
250 mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); 284 mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
285 mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info);
286
287 /* only the i2c master 1 is used on this CPU card */
288 i2c_register_board_info(1, mx27ads_i2c_devices,
289 ARRAY_SIZE(mx27ads_i2c_devices));
290 mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data);
291 mxc_register_device(&mxc_fb_device, &mx27ads_fb_data);
292 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
293 mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata);
251 294
252 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 295 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
253} 296}
@@ -277,7 +320,7 @@ static struct map_desc mx27ads_io_desc[] __initdata = {
277 320
278static void __init mx27ads_map_io(void) 321static void __init mx27ads_map_io(void)
279{ 322{
280 mxc_map_io(); 323 mx27_map_io();
281 iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc)); 324 iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc));
282} 325}
283 326
diff --git a/arch/arm/mach-mx2/mx27lite.c b/arch/arm/mach-mx2/mx27lite.c
new file mode 100644
index 000000000000..3ae11cb8c04b
--- /dev/null
+++ b/arch/arm/mach-mx2/mx27lite.c
@@ -0,0 +1,95 @@
1/*
2 * Copyright 2007 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
3 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
4 * Copyright 2009 Daniel Schaeffer (daniel.schaeffer@timesys.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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/time.h>
26#include <asm/mach/map.h>
27#include <mach/hardware.h>
28#include <mach/common.h>
29#include <mach/imx-uart.h>
30#include <mach/iomux.h>
31#include <mach/board-mx27lite.h>
32
33#include "devices.h"
34
35static unsigned int mx27lite_pins[] = {
36 /* UART1 */
37 PE12_PF_UART1_TXD,
38 PE13_PF_UART1_RXD,
39 PE14_PF_UART1_CTS,
40 PE15_PF_UART1_RTS,
41 /* FEC */
42 PD0_AIN_FEC_TXD0,
43 PD1_AIN_FEC_TXD1,
44 PD2_AIN_FEC_TXD2,
45 PD3_AIN_FEC_TXD3,
46 PD4_AOUT_FEC_RX_ER,
47 PD5_AOUT_FEC_RXD1,
48 PD6_AOUT_FEC_RXD2,
49 PD7_AOUT_FEC_RXD3,
50 PD8_AF_FEC_MDIO,
51 PD9_AIN_FEC_MDC,
52 PD10_AOUT_FEC_CRS,
53 PD11_AOUT_FEC_TX_CLK,
54 PD12_AOUT_FEC_RXD0,
55 PD13_AOUT_FEC_RX_DV,
56 PD14_AOUT_FEC_RX_CLK,
57 PD15_AOUT_FEC_COL,
58 PD16_AIN_FEC_TX_ER,
59 PF23_AIN_FEC_TX_EN,
60};
61
62static struct imxuart_platform_data uart_pdata = {
63 .flags = IMXUART_HAVE_RTSCTS,
64};
65
66static struct platform_device *platform_devices[] __initdata = {
67 &mxc_fec_device,
68};
69
70static void __init mx27lite_init(void)
71{
72 mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins),
73 "imx27lite");
74 mxc_register_device(&mxc_uart_device0, &uart_pdata);
75 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
76}
77
78static void __init mx27lite_timer_init(void)
79{
80 mx27_clocks_init(26000000);
81}
82
83static struct sys_timer mx27lite_timer = {
84 .init = mx27lite_timer_init,
85};
86
87MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
88 .phys_io = AIPI_BASE_ADDR,
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io,
92 .init_irq = mxc_init_irq,
93 .init_machine = mx27lite_init,
94 .timer = &mx27lite_timer,
95MACHINE_END
diff --git a/arch/arm/mach-mx2/mx27pdk.c b/arch/arm/mach-mx2/mx27pdk.c
new file mode 100644
index 000000000000..1d9238c7a6c3
--- /dev/null
+++ b/arch/arm/mach-mx2/mx27pdk.c
@@ -0,0 +1,95 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * Author: Fabio Estevam <fabio.estevam@freescale.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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/time.h>
26#include <mach/hardware.h>
27#include <mach/common.h>
28#include <mach/imx-uart.h>
29#include <mach/iomux.h>
30#include <mach/board-mx27pdk.h>
31
32#include "devices.h"
33
34static unsigned int mx27pdk_pins[] = {
35 /* UART1 */
36 PE12_PF_UART1_TXD,
37 PE13_PF_UART1_RXD,
38 PE14_PF_UART1_CTS,
39 PE15_PF_UART1_RTS,
40 /* FEC */
41 PD0_AIN_FEC_TXD0,
42 PD1_AIN_FEC_TXD1,
43 PD2_AIN_FEC_TXD2,
44 PD3_AIN_FEC_TXD3,
45 PD4_AOUT_FEC_RX_ER,
46 PD5_AOUT_FEC_RXD1,
47 PD6_AOUT_FEC_RXD2,
48 PD7_AOUT_FEC_RXD3,
49 PD8_AF_FEC_MDIO,
50 PD9_AIN_FEC_MDC,
51 PD10_AOUT_FEC_CRS,
52 PD11_AOUT_FEC_TX_CLK,
53 PD12_AOUT_FEC_RXD0,
54 PD13_AOUT_FEC_RX_DV,
55 PD14_AOUT_FEC_RX_CLK,
56 PD15_AOUT_FEC_COL,
57 PD16_AIN_FEC_TX_ER,
58 PF23_AIN_FEC_TX_EN,
59};
60
61static struct imxuart_platform_data uart_pdata = {
62 .flags = IMXUART_HAVE_RTSCTS,
63};
64
65static struct platform_device *platform_devices[] __initdata = {
66 &mxc_fec_device,
67};
68
69static void __init mx27pdk_init(void)
70{
71 mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins),
72 "mx27pdk");
73 mxc_register_device(&mxc_uart_device0, &uart_pdata);
74 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
75}
76
77static void __init mx27pdk_timer_init(void)
78{
79 mx27_clocks_init(26000000);
80}
81
82static struct sys_timer mx27pdk_timer = {
83 .init = mx27pdk_timer_init,
84};
85
86MACHINE_START(MX27_3DS, "Freescale MX27PDK")
87 /* maintainer: Freescale Semiconductor, Inc. */
88 .phys_io = AIPI_BASE_ADDR,
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io,
92 .init_irq = mxc_init_irq,
93 .init_machine = mx27pdk_init,
94 .timer = &mx27pdk_timer,
95MACHINE_END
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c
index aa4eaa61d1b5..a4628d004343 100644
--- a/arch/arm/mach-mx2/pcm038.c
+++ b/arch/arm/mach-mx2/pcm038.c
@@ -17,28 +17,84 @@
17 * MA 02110-1301, USA. 17 * MA 02110-1301, USA.
18 */ 18 */
19 19
20#include <linux/platform_device.h>
21#include <linux/mtd/physmap.h>
22#include <linux/mtd/plat-ram.h>
23#include <linux/io.h>
24#include <linux/i2c.h> 20#include <linux/i2c.h>
25#include <linux/i2c/at24.h> 21#include <linux/i2c/at24.h>
22#include <linux/io.h>
23#include <linux/mtd/plat-ram.h>
24#include <linux/mtd/physmap.h>
25#include <linux/platform_device.h>
26 26
27#include <asm/mach/arch.h>
28#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/time.h>
30
31#include <mach/board-pcm038.h>
29#include <mach/common.h> 32#include <mach/common.h>
30#include <mach/hardware.h> 33#include <mach/hardware.h>
31#include <mach/iomux.h>
32#ifdef CONFIG_I2C_IMX
33#include <mach/i2c.h> 34#include <mach/i2c.h>
34#endif 35#include <mach/iomux.h>
35#include <asm/mach/time.h>
36#include <mach/imx-uart.h> 36#include <mach/imx-uart.h>
37#include <mach/board-pcm038.h>
38#include <mach/mxc_nand.h> 37#include <mach/mxc_nand.h>
39 38
40#include "devices.h" 39#include "devices.h"
41 40
41static int pcm038_pins[] = {
42 /* UART1 */
43 PE12_PF_UART1_TXD,
44 PE13_PF_UART1_RXD,
45 PE14_PF_UART1_CTS,
46 PE15_PF_UART1_RTS,
47 /* UART2 */
48 PE3_PF_UART2_CTS,
49 PE4_PF_UART2_RTS,
50 PE6_PF_UART2_TXD,
51 PE7_PF_UART2_RXD,
52 /* UART3 */
53 PE8_PF_UART3_TXD,
54 PE9_PF_UART3_RXD,
55 PE10_PF_UART3_CTS,
56 PE11_PF_UART3_RTS,
57 /* FEC */
58 PD0_AIN_FEC_TXD0,
59 PD1_AIN_FEC_TXD1,
60 PD2_AIN_FEC_TXD2,
61 PD3_AIN_FEC_TXD3,
62 PD4_AOUT_FEC_RX_ER,
63 PD5_AOUT_FEC_RXD1,
64 PD6_AOUT_FEC_RXD2,
65 PD7_AOUT_FEC_RXD3,
66 PD8_AF_FEC_MDIO,
67 PD9_AIN_FEC_MDC,
68 PD10_AOUT_FEC_CRS,
69 PD11_AOUT_FEC_TX_CLK,
70 PD12_AOUT_FEC_RXD0,
71 PD13_AOUT_FEC_RX_DV,
72 PD14_AOUT_FEC_RX_CLK,
73 PD15_AOUT_FEC_COL,
74 PD16_AIN_FEC_TX_ER,
75 PF23_AIN_FEC_TX_EN,
76 /* I2C2 */
77 PC5_PF_I2C2_SDA,
78 PC6_PF_I2C2_SCL,
79 /* SPI1 */
80 PD25_PF_CSPI1_RDY,
81 PD27_PF_CSPI1_SS1,
82 PD28_PF_CSPI1_SS0,
83 PD29_PF_CSPI1_SCLK,
84 PD30_PF_CSPI1_MISO,
85 PD31_PF_CSPI1_MOSI,
86 /* SSI1 */
87 PC20_PF_SSI1_FS,
88 PC21_PF_SSI1_RXD,
89 PC22_PF_SSI1_TXD,
90 PC23_PF_SSI1_CLK,
91 /* SSI4 */
92 PC16_PF_SSI4_FS,
93 PC17_PF_SSI4_RXD,
94 PC18_PF_SSI4_TXD,
95 PC19_PF_SSI4_CLK,
96};
97
42/* 98/*
43 * Phytec's PCM038 comes with 2MiB battery buffered SRAM, 99 * Phytec's PCM038 comes with 2MiB battery buffered SRAM,
44 * 16 bit width 100 * 16 bit width
@@ -88,107 +144,16 @@ static struct platform_device pcm038_nor_mtd_device = {
88 .resource = &pcm038_flash_resource, 144 .resource = &pcm038_flash_resource,
89}; 145};
90 146
91static int mxc_uart0_pins[] = {
92 PE12_PF_UART1_TXD,
93 PE13_PF_UART1_RXD,
94 PE14_PF_UART1_CTS,
95 PE15_PF_UART1_RTS
96};
97
98static int uart_mxc_port0_init(struct platform_device *pdev)
99{
100 return mxc_gpio_setup_multiple_pins(mxc_uart0_pins,
101 ARRAY_SIZE(mxc_uart0_pins), "UART0");
102}
103
104static int uart_mxc_port0_exit(struct platform_device *pdev)
105{
106 mxc_gpio_release_multiple_pins(mxc_uart0_pins,
107 ARRAY_SIZE(mxc_uart0_pins));
108 return 0;
109}
110
111static int mxc_uart1_pins[] = {
112 PE3_PF_UART2_CTS,
113 PE4_PF_UART2_RTS,
114 PE6_PF_UART2_TXD,
115 PE7_PF_UART2_RXD
116};
117
118static int uart_mxc_port1_init(struct platform_device *pdev)
119{
120 return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
121 ARRAY_SIZE(mxc_uart1_pins), "UART1");
122}
123
124static int uart_mxc_port1_exit(struct platform_device *pdev)
125{
126 mxc_gpio_release_multiple_pins(mxc_uart1_pins,
127 ARRAY_SIZE(mxc_uart1_pins));
128 return 0;
129}
130
131static int mxc_uart2_pins[] = { PE8_PF_UART3_TXD,
132 PE9_PF_UART3_RXD,
133 PE10_PF_UART3_CTS,
134 PE11_PF_UART3_RTS };
135
136static int uart_mxc_port2_init(struct platform_device *pdev)
137{
138 return mxc_gpio_setup_multiple_pins(mxc_uart2_pins,
139 ARRAY_SIZE(mxc_uart2_pins), "UART2");
140}
141
142static int uart_mxc_port2_exit(struct platform_device *pdev)
143{
144 mxc_gpio_release_multiple_pins(mxc_uart2_pins,
145 ARRAY_SIZE(mxc_uart2_pins));
146 return 0;
147}
148
149static struct imxuart_platform_data uart_pdata[] = { 147static struct imxuart_platform_data uart_pdata[] = {
150 { 148 {
151 .init = uart_mxc_port0_init,
152 .exit = uart_mxc_port0_exit,
153 .flags = IMXUART_HAVE_RTSCTS, 149 .flags = IMXUART_HAVE_RTSCTS,
154 }, { 150 }, {
155 .init = uart_mxc_port1_init,
156 .exit = uart_mxc_port1_exit,
157 .flags = IMXUART_HAVE_RTSCTS, 151 .flags = IMXUART_HAVE_RTSCTS,
158 }, { 152 }, {
159 .init = uart_mxc_port2_init,
160 .exit = uart_mxc_port2_exit,
161 .flags = IMXUART_HAVE_RTSCTS, 153 .flags = IMXUART_HAVE_RTSCTS,
162 }, 154 },
163}; 155};
164 156
165static int mxc_fec_pins[] = {
166 PD0_AIN_FEC_TXD0,
167 PD1_AIN_FEC_TXD1,
168 PD2_AIN_FEC_TXD2,
169 PD3_AIN_FEC_TXD3,
170 PD4_AOUT_FEC_RX_ER,
171 PD5_AOUT_FEC_RXD1,
172 PD6_AOUT_FEC_RXD2,
173 PD7_AOUT_FEC_RXD3,
174 PD8_AF_FEC_MDIO,
175 PD9_AIN_FEC_MDC,
176 PD10_AOUT_FEC_CRS,
177 PD11_AOUT_FEC_TX_CLK,
178 PD12_AOUT_FEC_RXD0,
179 PD13_AOUT_FEC_RX_DV,
180 PD14_AOUT_FEC_RX_CLK,
181 PD15_AOUT_FEC_COL,
182 PD16_AIN_FEC_TX_ER,
183 PF23_AIN_FEC_TX_EN
184};
185
186static void gpio_fec_active(void)
187{
188 mxc_gpio_setup_multiple_pins(mxc_fec_pins,
189 ARRAY_SIZE(mxc_fec_pins), "FEC");
190}
191
192static struct mxc_nand_platform_data pcm038_nand_board_info = { 157static struct mxc_nand_platform_data pcm038_nand_board_info = {
193 .width = 1, 158 .width = 1,
194 .hw_ecc = 1, 159 .hw_ecc = 1,
@@ -210,27 +175,8 @@ static void __init pcm038_init_sram(void)
210 __raw_writel(0x22220a00, CSCR_A(1)); 175 __raw_writel(0x22220a00, CSCR_A(1));
211} 176}
212 177
213#ifdef CONFIG_I2C_IMX
214static int mxc_i2c1_pins[] = {
215 PC5_PF_I2C2_SDA,
216 PC6_PF_I2C2_SCL
217};
218
219static int pcm038_i2c_1_init(struct device *dev)
220{
221 return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins),
222 "I2C1");
223}
224
225static void pcm038_i2c_1_exit(struct device *dev)
226{
227 mxc_gpio_release_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins));
228}
229
230static struct imxi2c_platform_data pcm038_i2c_1_data = { 178static struct imxi2c_platform_data pcm038_i2c_1_data = {
231 .bitrate = 100000, 179 .bitrate = 100000,
232 .init = pcm038_i2c_1_init,
233 .exit = pcm038_i2c_1_exit,
234}; 180};
235 181
236static struct at24_platform_data board_eeprom = { 182static struct at24_platform_data board_eeprom = {
@@ -253,11 +199,12 @@ static struct i2c_board_info pcm038_i2c_devices[] = {
253 .type = "lm75" 199 .type = "lm75"
254 } 200 }
255}; 201};
256#endif
257 202
258static void __init pcm038_init(void) 203static void __init pcm038_init(void)
259{ 204{
260 gpio_fec_active(); 205 mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins),
206 "PCM038");
207
261 pcm038_init_sram(); 208 pcm038_init_sram();
262 209
263 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); 210 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
@@ -267,13 +214,11 @@ static void __init pcm038_init(void)
267 mxc_gpio_mode(PE16_AF_OWIRE); 214 mxc_gpio_mode(PE16_AF_OWIRE);
268 mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); 215 mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info);
269 216
270#ifdef CONFIG_I2C_IMX
271 /* only the i2c master 1 is used on this CPU card */ 217 /* only the i2c master 1 is used on this CPU card */
272 i2c_register_board_info(1, pcm038_i2c_devices, 218 i2c_register_board_info(1, pcm038_i2c_devices,
273 ARRAY_SIZE(pcm038_i2c_devices)); 219 ARRAY_SIZE(pcm038_i2c_devices));
274 220
275 mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data); 221 mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data);
276#endif
277 222
278 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 223 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
279 224
@@ -295,7 +240,7 @@ MACHINE_START(PCM038, "phyCORE-i.MX27")
295 .phys_io = AIPI_BASE_ADDR, 240 .phys_io = AIPI_BASE_ADDR,
296 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 241 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
297 .boot_params = PHYS_OFFSET + 0x100, 242 .boot_params = PHYS_OFFSET + 0x100,
298 .map_io = mxc_map_io, 243 .map_io = mx27_map_io,
299 .init_irq = mxc_init_irq, 244 .init_irq = mxc_init_irq,
300 .init_machine = pcm038_init, 245 .init_machine = pcm038_init,
301 .timer = &pcm038_timer, 246 .timer = &pcm038_timer,
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c
index bf4e520bc1bc..6a3acaf57dd4 100644
--- a/arch/arm/mach-mx2/pcm970-baseboard.c
+++ b/arch/arm/mach-mx2/pcm970-baseboard.c
@@ -16,71 +16,107 @@
16 * MA 02110-1301, USA. 16 * MA 02110-1301, USA.
17 */ 17 */
18 18
19#include <linux/platform_device.h>
20#include <linux/gpio.h> 19#include <linux/gpio.h>
21#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/platform_device.h>
22 22
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24 24
25#include <mach/hardware.h>
26#include <mach/common.h> 25#include <mach/common.h>
27#include <mach/mmc.h>
28#include <mach/imxfb.h>
29#include <mach/iomux.h> 26#include <mach/iomux.h>
27#include <mach/imxfb.h>
28#include <mach/hardware.h>
29#include <mach/mmc.h>
30 30
31#include "devices.h" 31#include "devices.h"
32 32
33static int pcm970_sdhc2_get_ro(struct device *dev) 33static int pcm970_pins[] = {
34{ 34 /* SDHC */
35 return gpio_get_value(GPIO_PORTC + 28);
36}
37
38static int pcm970_sdhc2_pins[] = {
39 PB4_PF_SD2_D0, 35 PB4_PF_SD2_D0,
40 PB5_PF_SD2_D1, 36 PB5_PF_SD2_D1,
41 PB6_PF_SD2_D2, 37 PB6_PF_SD2_D2,
42 PB7_PF_SD2_D3, 38 PB7_PF_SD2_D3,
43 PB8_PF_SD2_CMD, 39 PB8_PF_SD2_CMD,
44 PB9_PF_SD2_CLK, 40 PB9_PF_SD2_CLK,
41 GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN, /* card detect */
42 /* display */
43 PA5_PF_LSCLK,
44 PA6_PF_LD0,
45 PA7_PF_LD1,
46 PA8_PF_LD2,
47 PA9_PF_LD3,
48 PA10_PF_LD4,
49 PA11_PF_LD5,
50 PA12_PF_LD6,
51 PA13_PF_LD7,
52 PA14_PF_LD8,
53 PA15_PF_LD9,
54 PA16_PF_LD10,
55 PA17_PF_LD11,
56 PA18_PF_LD12,
57 PA19_PF_LD13,
58 PA20_PF_LD14,
59 PA21_PF_LD15,
60 PA22_PF_LD16,
61 PA23_PF_LD17,
62 PA24_PF_REV,
63 PA25_PF_CLS,
64 PA26_PF_PS,
65 PA27_PF_SPL_SPR,
66 PA28_PF_HSYNC,
67 PA29_PF_VSYNC,
68 PA30_PF_CONTRAST,
69 PA31_PF_OE_ACD,
70 /*
71 * it seems the data line misses a pullup, so we must enable
72 * the internal pullup as a local workaround
73 */
74 PD17_PF_I2C_DATA | GPIO_PUEN,
75 PD18_PF_I2C_CLK,
76 /* Camera */
77 PB10_PF_CSI_D0,
78 PB11_PF_CSI_D1,
79 PB12_PF_CSI_D2,
80 PB13_PF_CSI_D3,
81 PB14_PF_CSI_D4,
82 PB15_PF_CSI_MCLK,
83 PB16_PF_CSI_PIXCLK,
84 PB17_PF_CSI_D5,
85 PB18_PF_CSI_D6,
86 PB19_PF_CSI_D7,
87 PB20_PF_CSI_VSYNC,
88 PB21_PF_CSI_HSYNC,
45}; 89};
46 90
91static int pcm970_sdhc2_get_ro(struct device *dev)
92{
93 return gpio_get_value(GPIO_PORTC + 28);
94}
95
47static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void *data) 96static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void *data)
48{ 97{
49 int ret; 98 int ret;
50 99
51 ret = mxc_gpio_setup_multiple_pins(pcm970_sdhc2_pins, 100 ret = request_irq(IRQ_GPIOC(29), detect_irq, IRQF_TRIGGER_FALLING,
52 ARRAY_SIZE(pcm970_sdhc2_pins), "sdhc2");
53 if(ret)
54 return ret;
55
56 ret = request_irq(IRQ_GPIOC(29), detect_irq, 0,
57 "imx-mmc-detect", data); 101 "imx-mmc-detect", data);
58 if (ret) 102 if (ret)
59 goto out_release_gpio; 103 return ret;
60
61 set_irq_type(IRQ_GPIOC(29), IRQF_TRIGGER_FALLING);
62 104
63 ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); 105 ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro");
64 if (ret) 106 if (ret) {
65 goto out_release_gpio; 107 free_irq(IRQ_GPIOC(29), data);
108 return ret;
109 }
66 110
67 mxc_gpio_mode((GPIO_PORTC | 28) | GPIO_GPIO | GPIO_IN);
68 gpio_direction_input(GPIO_PORTC + 28); 111 gpio_direction_input(GPIO_PORTC + 28);
69 112
70 return 0; 113 return 0;
71
72out_release_gpio:
73 mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins,
74 ARRAY_SIZE(pcm970_sdhc2_pins));
75 return ret;
76} 114}
77 115
78static void pcm970_sdhc2_exit(struct device *dev, void *data) 116static void pcm970_sdhc2_exit(struct device *dev, void *data)
79{ 117{
80 free_irq(IRQ_GPIOC(29), data); 118 free_irq(IRQ_GPIOC(29), data);
81 gpio_free(GPIO_PORTC + 28); 119 gpio_free(GPIO_PORTC + 28);
82 mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins,
83 ARRAY_SIZE(pcm970_sdhc2_pins));
84} 120}
85 121
86static struct imxmmc_platform_data sdhc_pdata = { 122static struct imxmmc_platform_data sdhc_pdata = {
@@ -89,29 +125,6 @@ static struct imxmmc_platform_data sdhc_pdata = {
89 .exit = pcm970_sdhc2_exit, 125 .exit = pcm970_sdhc2_exit,
90}; 126};
91 127
92static int mxc_fb_pins[] = {
93 PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2,
94 PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6,
95 PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10,
96 PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14,
97 PA21_PF_LD15, PA22_PF_LD16, PA23_PF_LD17, PA24_PF_REV,
98 PA25_PF_CLS, PA26_PF_PS, PA27_PF_SPL_SPR, PA28_PF_HSYNC,
99 PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD
100};
101
102static int pcm038_fb_init(struct platform_device *pdev)
103{
104 return mxc_gpio_setup_multiple_pins(mxc_fb_pins,
105 ARRAY_SIZE(mxc_fb_pins), "FB");
106}
107
108static int pcm038_fb_exit(struct platform_device *pdev)
109{
110 mxc_gpio_release_multiple_pins(mxc_fb_pins, ARRAY_SIZE(mxc_fb_pins));
111
112 return 0;
113}
114
115/* 128/*
116 * Connected is a portrait Sharp-QVGA display 129 * Connected is a portrait Sharp-QVGA display
117 * of type: LQ035Q7DH06 130 * of type: LQ035Q7DH06
@@ -144,9 +157,6 @@ static struct imx_fb_platform_data pcm038_fb_data = {
144 .pwmr = 0x00A903FF, 157 .pwmr = 0x00A903FF,
145 .lscr1 = 0x00120300, 158 .lscr1 = 0x00120300,
146 .dmacr = 0x00020010, 159 .dmacr = 0x00020010,
147
148 .init = pcm038_fb_init,
149 .exit = pcm038_fb_exit,
150}; 160};
151 161
152/* 162/*
@@ -157,6 +167,9 @@ static struct imx_fb_platform_data pcm038_fb_data = {
157 */ 167 */
158void __init pcm970_baseboard_init(void) 168void __init pcm970_baseboard_init(void)
159{ 169{
170 mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins),
171 "PCM970");
172
160 mxc_register_device(&mxc_fb_device, &pcm038_fb_data); 173 mxc_register_device(&mxc_fb_device, &pcm038_fb_data);
161 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); 174 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
162} 175}
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 194b8428bba4..17a21a291e2f 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -1,10 +1,12 @@
1if ARCH_MX3 1if ARCH_MX3
2 2
3config ARCH_MX31 3config ARCH_MX31
4 select ARCH_HAS_RNGA
4 bool 5 bool
5 6
6config ARCH_MX35 7config ARCH_MX35
7 bool 8 bool
9 select ARCH_MXC_IOMUX_V3
8 10
9comment "MX3 platforms:" 11comment "MX3 platforms:"
10 12
@@ -37,7 +39,6 @@ config MACH_PCM037
37config MACH_MX31LITE 39config MACH_MX31LITE
38 bool "Support MX31 LITEKIT (LogicPD)" 40 bool "Support MX31 LITEKIT (LogicPD)"
39 select ARCH_MX31 41 select ARCH_MX31
40 default n
41 help 42 help
42 Include support for MX31 LITEKIT platform. This includes specific 43 Include support for MX31 LITEKIT platform. This includes specific
43 configurations for the board and its peripherals. 44 configurations for the board and its peripherals.
@@ -45,7 +46,6 @@ config MACH_MX31LITE
45config MACH_MX31_3DS 46config MACH_MX31_3DS
46 bool "Support MX31PDK (3DS)" 47 bool "Support MX31PDK (3DS)"
47 select ARCH_MX31 48 select ARCH_MX31
48 default n
49 help 49 help
50 Include support for MX31PDK (3DS) platform. This includes specific 50 Include support for MX31PDK (3DS) platform. This includes specific
51 configurations for the board and its peripherals. 51 configurations for the board and its peripherals.
@@ -53,17 +53,43 @@ config MACH_MX31_3DS
53config MACH_MX31MOBOARD 53config MACH_MX31MOBOARD
54 bool "Support mx31moboard platforms (EPFL Mobots group)" 54 bool "Support mx31moboard platforms (EPFL Mobots group)"
55 select ARCH_MX31 55 select ARCH_MX31
56 default n
57 help 56 help
58 Include support for mx31moboard platform. This includes specific 57 Include support for mx31moboard platform. This includes specific
59 configurations for the board and its peripherals. 58 configurations for the board and its peripherals.
60 59
60config MACH_MX31LILLY
61 bool "Support MX31 LILLY-1131 platforms (INCO startec)"
62 select ARCH_MX31
63 help
64 Include support for mx31 based LILLY1131 modules. This includes
65 specific configurations for the board and its peripherals.
66
61config MACH_QONG 67config MACH_QONG
62 bool "Support Dave/DENX QongEVB-LITE platform" 68 bool "Support Dave/DENX QongEVB-LITE platform"
63 select ARCH_MX31 69 select ARCH_MX31
64 default n
65 help 70 help
66 Include support for Dave/DENX QongEVB-LITE platform. This includes 71 Include support for Dave/DENX QongEVB-LITE platform. This includes
67 specific configurations for the board and its peripherals. 72 specific configurations for the board and its peripherals.
68 73
74config MACH_PCM043
75 bool "Support Phytec pcm043 (i.MX35) platforms"
76 select ARCH_MX35
77 help
78 Include support for Phytec pcm043 platform. This includes
79 specific configurations for the board and its peripherals.
80
81config MACH_ARMADILLO5X0
82 bool "Support Atmark Armadillo-500 Development Base Board"
83 select ARCH_MX31
84 help
85 Include support for Atmark Armadillo-500 platform. This includes
86 specific configurations for the board and its peripherals.
87
88config MACH_MX35_3DS
89 bool "Support MX35PDK platform"
90 select ARCH_MX35
91 default n
92 help
93 Include support for MX35PDK platform. This includes specific
94 configurations for the board and its peripherals.
69endif 95endif
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 272c8a953b30..0322696bd11a 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -8,9 +8,13 @@ obj-y := mm.o devices.o
8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o 8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o
9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o 9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
11obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
12obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
13obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 14obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
14obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \ 15obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
15 mx31moboard-marxbot.o 16 mx31moboard-marxbot.o
16obj-$(CONFIG_MACH_QONG) += qong.o 17obj-$(CONFIG_MACH_QONG) += qong.o
18obj-$(CONFIG_MACH_PCM043) += pcm043.o
19obj-$(CONFIG_MACH_ARMADILLO5X0) += armadillo5x0.o
20obj-$(CONFIG_MACH_MX35_3DS) += mx35pdk.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
new file mode 100644
index 000000000000..541181090b37
--- /dev/null
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -0,0 +1,295 @@
1/*
2 * armadillo5x0.c
3 *
4 * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
5 * updates in http://alberdroid.blogspot.com/
6 *
7 * Based on Atmark Techno, Inc. armadillo 500 BSP 2008
8 * Based on mx31ads.c and pcm037.c Great Work!
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 * MA 02110-1301, USA.
24 */
25
26#include <linux/types.h>
27#include <linux/init.h>
28#include <linux/clk.h>
29#include <linux/platform_device.h>
30#include <linux/gpio.h>
31#include <linux/smsc911x.h>
32#include <linux/interrupt.h>
33#include <linux/irq.h>
34
35#include <mach/hardware.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/time.h>
39#include <asm/memory.h>
40#include <asm/mach/map.h>
41
42#include <mach/common.h>
43#include <mach/imx-uart.h>
44#include <mach/iomux-mx3.h>
45#include <mach/board-armadillo5x0.h>
46#include <mach/mmc.h>
47#include <mach/ipu.h>
48#include <mach/mx3fb.h>
49
50#include "devices.h"
51
52static int armadillo5x0_pins[] = {
53 /* UART1 */
54 MX31_PIN_CTS1__CTS1,
55 MX31_PIN_RTS1__RTS1,
56 MX31_PIN_TXD1__TXD1,
57 MX31_PIN_RXD1__RXD1,
58 /* UART2 */
59 MX31_PIN_CTS2__CTS2,
60 MX31_PIN_RTS2__RTS2,
61 MX31_PIN_TXD2__TXD2,
62 MX31_PIN_RXD2__RXD2,
63 /* LAN9118_IRQ */
64 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO),
65 /* SDHC1 */
66 MX31_PIN_SD1_DATA3__SD1_DATA3,
67 MX31_PIN_SD1_DATA2__SD1_DATA2,
68 MX31_PIN_SD1_DATA1__SD1_DATA1,
69 MX31_PIN_SD1_DATA0__SD1_DATA0,
70 MX31_PIN_SD1_CLK__SD1_CLK,
71 MX31_PIN_SD1_CMD__SD1_CMD,
72 /* Framebuffer */
73 MX31_PIN_LD0__LD0,
74 MX31_PIN_LD1__LD1,
75 MX31_PIN_LD2__LD2,
76 MX31_PIN_LD3__LD3,
77 MX31_PIN_LD4__LD4,
78 MX31_PIN_LD5__LD5,
79 MX31_PIN_LD6__LD6,
80 MX31_PIN_LD7__LD7,
81 MX31_PIN_LD8__LD8,
82 MX31_PIN_LD9__LD9,
83 MX31_PIN_LD10__LD10,
84 MX31_PIN_LD11__LD11,
85 MX31_PIN_LD12__LD12,
86 MX31_PIN_LD13__LD13,
87 MX31_PIN_LD14__LD14,
88 MX31_PIN_LD15__LD15,
89 MX31_PIN_LD16__LD16,
90 MX31_PIN_LD17__LD17,
91 MX31_PIN_VSYNC3__VSYNC3,
92 MX31_PIN_HSYNC__HSYNC,
93 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0,
95 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
96
97};
98
99/*
100 * FB support
101 */
102static const struct fb_videomode fb_modedb[] = {
103 { /* 640x480 @ 60 Hz */
104 .name = "CRT-VGA",
105 .refresh = 60,
106 .xres = 640,
107 .yres = 480,
108 .pixclock = 39721,
109 .left_margin = 35,
110 .right_margin = 115,
111 .upper_margin = 43,
112 .lower_margin = 1,
113 .hsync_len = 10,
114 .vsync_len = 1,
115 .sync = FB_SYNC_OE_ACT_HIGH,
116 .vmode = FB_VMODE_NONINTERLACED,
117 .flag = 0,
118 }, {/* 800x600 @ 56 Hz */
119 .name = "CRT-SVGA",
120 .refresh = 56,
121 .xres = 800,
122 .yres = 600,
123 .pixclock = 30000,
124 .left_margin = 30,
125 .right_margin = 108,
126 .upper_margin = 13,
127 .lower_margin = 10,
128 .hsync_len = 10,
129 .vsync_len = 1,
130 .sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_HOR_HIGH_ACT |
131 FB_SYNC_VERT_HIGH_ACT,
132 .vmode = FB_VMODE_NONINTERLACED,
133 .flag = 0,
134 },
135};
136
137static struct ipu_platform_data mx3_ipu_data = {
138 .irq_base = MXC_IPU_IRQ_START,
139};
140
141static struct mx3fb_platform_data mx3fb_pdata = {
142 .dma_dev = &mx3_ipu.dev,
143 .name = "CRT-VGA",
144 .mode = fb_modedb,
145 .num_modes = ARRAY_SIZE(fb_modedb),
146};
147
148/*
149 * SDHC 1
150 * MMC support
151 */
152static int armadillo5x0_sdhc1_get_ro(struct device *dev)
153{
154 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B));
155}
156
157static int armadillo5x0_sdhc1_init(struct device *dev,
158 irq_handler_t detect_irq, void *data)
159{
160 int ret;
161 int gpio_det, gpio_wp;
162
163 gpio_det = IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK);
164 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B);
165
166 ret = gpio_request(gpio_det, "sdhc-card-detect");
167 if (ret)
168 return ret;
169
170 gpio_direction_input(gpio_det);
171
172 ret = gpio_request(gpio_wp, "sdhc-write-protect");
173 if (ret)
174 goto err_gpio_free;
175
176 gpio_direction_input(gpio_wp);
177
178 /* When supported the trigger type have to be BOTH */
179 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq,
180 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
181 "sdhc-detect", data);
182
183 if (ret)
184 goto err_gpio_free_2;
185
186 return 0;
187
188err_gpio_free_2:
189 gpio_free(gpio_wp);
190
191err_gpio_free:
192 gpio_free(gpio_det);
193
194 return ret;
195
196}
197
198static void armadillo5x0_sdhc1_exit(struct device *dev, void *data)
199{
200 free_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), data);
201 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK));
202 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B));
203}
204
205static struct imxmmc_platform_data sdhc_pdata = {
206 .get_ro = armadillo5x0_sdhc1_get_ro,
207 .init = armadillo5x0_sdhc1_init,
208 .exit = armadillo5x0_sdhc1_exit,
209};
210
211/*
212 * SMSC 9118
213 * Network support
214 */
215static struct resource armadillo5x0_smc911x_resources[] = {
216 {
217 .start = CS3_BASE_ADDR,
218 .end = CS3_BASE_ADDR + SZ_32M - 1,
219 .flags = IORESOURCE_MEM,
220 }, {
221 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
222 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
223 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
224 },
225};
226
227static struct smsc911x_platform_config smsc911x_info = {
228 .flags = SMSC911X_USE_32BIT,
229 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
230 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
231};
232
233static struct platform_device armadillo5x0_smc911x_device = {
234 .name = "smsc911x",
235 .id = -1,
236 .num_resources = ARRAY_SIZE(armadillo5x0_smc911x_resources),
237 .resource = armadillo5x0_smc911x_resources,
238 .dev = {
239 .platform_data = &smsc911x_info,
240 },
241};
242
243/* UART device data */
244static struct imxuart_platform_data uart_pdata = {
245 .flags = IMXUART_HAVE_RTSCTS,
246};
247
248static struct platform_device *devices[] __initdata = {
249 &armadillo5x0_smc911x_device,
250};
251
252/*
253 * Perform board specific initializations
254 */
255static void __init armadillo5x0_init(void)
256{
257 mxc_iomux_setup_multiple_pins(armadillo5x0_pins,
258 ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0");
259
260 platform_add_devices(devices, ARRAY_SIZE(devices));
261
262 /* Register UART */
263 mxc_register_device(&mxc_uart_device0, &uart_pdata);
264 mxc_register_device(&mxc_uart_device1, &uart_pdata);
265
266 /* SMSC9118 IRQ pin */
267 gpio_direction_input(MX31_PIN_GPIO1_0);
268
269 /* Register SDHC */
270 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
271
272 /* Register FB */
273 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
274 mxc_register_device(&mx3_fb, &mx3fb_pdata);
275}
276
277static void __init armadillo5x0_timer_init(void)
278{
279 mx31_clocks_init(26000000);
280}
281
282static struct sys_timer armadillo5x0_timer = {
283 .init = armadillo5x0_timer_init,
284};
285
286MACHINE_START(ARMADILLO5X0, "Armadillo-500")
287 /* Maintainer: Alberto Panizzo */
288 .phys_io = AIPS1_BASE_ADDR,
289 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
290 .boot_params = PHYS_OFFSET + 0x00000100,
291 .map_io = mx31_map_io,
292 .init_irq = mxc_init_irq,
293 .timer = &armadillo5x0_timer,
294 .init_machine = armadillo5x0_init,
295MACHINE_END
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 3c1e06f56dd6..577ee83d1f60 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -147,34 +147,16 @@ static struct arm_ahb_div clk_consumer[] = {
147 { .arm = 0, .ahb = 0, .sel = 0}, 147 { .arm = 0, .ahb = 0, .sel = 0},
148}; 148};
149 149
150static struct arm_ahb_div clk_automotive[] = {
151 { .arm = 1, .ahb = 3, .sel = 0},
152 { .arm = 1, .ahb = 2, .sel = 1},
153 { .arm = 2, .ahb = 1, .sel = 1},
154 { .arm = 0, .ahb = 0, .sel = 0},
155 { .arm = 1, .ahb = 6, .sel = 0},
156 { .arm = 1, .ahb = 4, .sel = 1},
157 { .arm = 2, .ahb = 2, .sel = 1},
158 { .arm = 0, .ahb = 0, .sel = 0},
159};
160
161static unsigned long get_rate_arm(void) 150static unsigned long get_rate_arm(void)
162{ 151{
163 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); 152 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
164 struct arm_ahb_div *aad; 153 struct arm_ahb_div *aad;
165 unsigned long fref = get_rate_mpll(); 154 unsigned long fref = get_rate_mpll();
166 155
167 if (pdr0 & 1) { 156 aad = &clk_consumer[(pdr0 >> 16) & 0xf];
168 /* consumer path */ 157 if (aad->sel)
169 aad = &clk_consumer[(pdr0 >> 16) & 0xf]; 158 fref = fref * 2 / 3;
170 if (aad->sel) 159
171 fref = fref * 2 / 3;
172 } else {
173 /* auto path */
174 aad = &clk_automotive[(pdr0 >> 9) & 0x7];
175 if (aad->sel)
176 fref = fref * 3 / 4;
177 }
178 return fref / aad->arm; 160 return fref / aad->arm;
179} 161}
180 162
@@ -184,12 +166,7 @@ static unsigned long get_rate_ahb(struct clk *clk)
184 struct arm_ahb_div *aad; 166 struct arm_ahb_div *aad;
185 unsigned long fref = get_rate_mpll(); 167 unsigned long fref = get_rate_mpll();
186 168
187 if (pdr0 & 1) 169 aad = &clk_consumer[(pdr0 >> 16) & 0xf];
188 /* consumer path */
189 aad = &clk_consumer[(pdr0 >> 16) & 0xf];
190 else
191 /* auto path */
192 aad = &clk_automotive[(pdr0 >> 9) & 0x7];
193 170
194 return fref / aad->ahb; 171 return fref / aad->ahb;
195} 172}
@@ -430,7 +407,8 @@ static struct clk_lookup lookups[] = {
430 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 407 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
431 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk) 408 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk)
432 _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) 409 _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk)
433 _REGISTER_CLOCK(NULL, "ipu", ipu_clk) 410 _REGISTER_CLOCK("ipu-core", NULL, ipu_clk)
411 _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk)
434 _REGISTER_CLOCK(NULL, "kpp", kpp_clk) 412 _REGISTER_CLOCK(NULL, "kpp", kpp_clk)
435 _REGISTER_CLOCK(NULL, "mlb", mlb_clk) 413 _REGISTER_CLOCK(NULL, "mlb", mlb_clk)
436 _REGISTER_CLOCK(NULL, "mshc", mshc_clk) 414 _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
@@ -462,8 +440,6 @@ int __init mx35_clocks_init()
462 int i; 440 int i;
463 unsigned int ll = 0; 441 unsigned int ll = 0;
464 442
465 mxc_set_cpu_type(MXC_CPU_MX35);
466
467#ifdef CONFIG_DEBUG_LL_CONSOLE 443#ifdef CONFIG_DEBUG_LL_CONSOLE
468 ll = (3 << 16); 444 ll = (3 << 16);
469#endif 445#endif
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index a68fcf981edf..8b14239724c9 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -483,7 +483,7 @@ DEFINE_CLOCK(i2c3_clk, 2, MXC_CCM_CGR0, 30, NULL, NULL, &perclk_clk);
483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk); 483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk);
484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk); 484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk);
485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk); 485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk);
486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &ahb_clk); 486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &serial_pll_clk);
487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk); 487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk);
488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk); 488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk);
489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk); 489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk);
@@ -566,13 +566,18 @@ int __init mx31_clocks_init(unsigned long fref)
566 u32 reg; 566 u32 reg;
567 int i; 567 int i;
568 568
569 mxc_set_cpu_type(MXC_CPU_MX31);
570
571 ckih_rate = fref; 569 ckih_rate = fref;
572 570
573 for (i = 0; i < ARRAY_SIZE(lookups); i++) 571 for (i = 0; i < ARRAY_SIZE(lookups); i++)
574 clkdev_add(&lookups[i]); 572 clkdev_add(&lookups[i]);
575 573
574 /* change the csi_clk parent if necessary */
575 reg = __raw_readl(MXC_CCM_CCMR);
576 if (!(reg & MXC_CCM_CCMR_CSCS))
577 if (clk_set_parent(&csi_clk, &usb_pll_clk))
578 pr_err("%s: error changing csi_clk parent\n", __func__);
579
580
576 /* Turn off all possible clocks */ 581 /* Turn off all possible clocks */
577 __raw_writel((3 << 4), MXC_CCM_CGR0); 582 __raw_writel((3 << 4), MXC_CCM_CGR0);
578 __raw_writel(0, MXC_CCM_CGR1); 583 __raw_writel(0, MXC_CCM_CGR1);
@@ -581,6 +586,12 @@ int __init mx31_clocks_init(unsigned long fref)
581 MX32, but still required to be set */ 586 MX32, but still required to be set */
582 MXC_CCM_CGR2); 587 MXC_CCM_CGR2);
583 588
589 /*
590 * Before turning off usb_pll make sure ipg_per_clk is generated
591 * by ipg_clk and not usb_pll.
592 */
593 __raw_writel(__raw_readl(MXC_CCM_CCMR) | (1 << 24), MXC_CCM_CCMR);
594
584 usb_pll_disable(&usb_pll_clk); 595 usb_pll_disable(&usb_pll_clk);
585 596
586 pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk)); 597 pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk));
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 380be0c9b213..d927eddcad46 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -17,13 +17,17 @@
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20#include <linux/dma-mapping.h>
20#include <linux/module.h> 21#include <linux/module.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/serial.h> 23#include <linux/serial.h>
23#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/dma-mapping.h>
24#include <mach/hardware.h> 26#include <mach/hardware.h>
25#include <mach/irqs.h> 27#include <mach/irqs.h>
28#include <mach/common.h>
26#include <mach/imx-uart.h> 29#include <mach/imx-uart.h>
30#include <mach/mx3_camera.h>
27 31
28#include "devices.h" 32#include "devices.h"
29 33
@@ -283,6 +287,21 @@ struct platform_device mxcsdhc_device1 = {
283 .num_resources = ARRAY_SIZE(mxcsdhc1_resources), 287 .num_resources = ARRAY_SIZE(mxcsdhc1_resources),
284 .resource = mxcsdhc1_resources, 288 .resource = mxcsdhc1_resources,
285}; 289};
290
291static struct resource rnga_resources[] = {
292 {
293 .start = RNGA_BASE_ADDR,
294 .end = RNGA_BASE_ADDR + 0x28,
295 .flags = IORESOURCE_MEM,
296 },
297};
298
299struct platform_device mxc_rnga_device = {
300 .name = "mxc_rnga",
301 .id = -1,
302 .num_resources = 1,
303 .resource = rnga_resources,
304};
286#endif /* CONFIG_ARCH_MX31 */ 305#endif /* CONFIG_ARCH_MX31 */
287 306
288/* i.MX31 Image Processing Unit */ 307/* i.MX31 Image Processing Unit */
@@ -329,10 +348,54 @@ struct platform_device mx3_fb = {
329 .num_resources = ARRAY_SIZE(fb_resources), 348 .num_resources = ARRAY_SIZE(fb_resources),
330 .resource = fb_resources, 349 .resource = fb_resources,
331 .dev = { 350 .dev = {
332 .coherent_dma_mask = 0xffffffff, 351 .coherent_dma_mask = DMA_BIT_MASK(32),
333 }, 352 },
334}; 353};
335 354
355static struct resource camera_resources[] = {
356 {
357 .start = IPU_CTRL_BASE_ADDR + 0x60,
358 .end = IPU_CTRL_BASE_ADDR + 0x87,
359 .flags = IORESOURCE_MEM,
360 },
361};
362
363struct platform_device mx3_camera = {
364 .name = "mx3-camera",
365 .id = 0,
366 .num_resources = ARRAY_SIZE(camera_resources),
367 .resource = camera_resources,
368 .dev = {
369 .coherent_dma_mask = DMA_BIT_MASK(32),
370 },
371};
372
373static struct resource otg_resources[] = {
374 {
375 .start = OTG_BASE_ADDR,
376 .end = OTG_BASE_ADDR + 0x1ff,
377 .flags = IORESOURCE_MEM,
378 }, {
379 .start = MXC_INT_USB3,
380 .end = MXC_INT_USB3,
381 .flags = IORESOURCE_IRQ,
382 },
383};
384
385static u64 otg_dmamask = DMA_BIT_MASK(32);
386
387/* OTG gadget device */
388struct platform_device mxc_otg_udc_device = {
389 .name = "fsl-usb2-udc",
390 .id = -1,
391 .dev = {
392 .dma_mask = &otg_dmamask,
393 .coherent_dma_mask = DMA_BIT_MASK(32),
394 },
395 .resource = otg_resources,
396 .num_resources = ARRAY_SIZE(otg_resources),
397};
398
336#ifdef CONFIG_ARCH_MX35 399#ifdef CONFIG_ARCH_MX35
337static struct resource mxc_fec_resources[] = { 400static struct resource mxc_fec_resources[] = {
338 { 401 {
@@ -359,6 +422,7 @@ static int mx3_devices_init(void)
359 if (cpu_is_mx31()) { 422 if (cpu_is_mx31()) {
360 mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR; 423 mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR;
361 mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff; 424 mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff;
425 mxc_register_device(&mxc_rnga_device, NULL);
362 } 426 }
363 if (cpu_is_mx35()) { 427 if (cpu_is_mx35()) {
364 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; 428 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 88c04b296fab..ffd494ddd4ac 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -11,6 +11,10 @@ extern struct platform_device mxc_i2c_device1;
11extern struct platform_device mxc_i2c_device2; 11extern struct platform_device mxc_i2c_device2;
12extern struct platform_device mx3_ipu; 12extern struct platform_device mx3_ipu;
13extern struct platform_device mx3_fb; 13extern struct platform_device mx3_fb;
14extern struct platform_device mx3_camera;
14extern struct platform_device mxc_fec_device; 15extern struct platform_device mxc_fec_device;
15extern struct platform_device mxcsdhc_device0; 16extern struct platform_device mxcsdhc_device0;
16extern struct platform_device mxcsdhc_device1; 17extern struct platform_device mxcsdhc_device1;
18extern struct platform_device mxc_otg_udc_device;
19extern struct platform_device mxc_rnga_device;
20
diff --git a/arch/arm/mach-mx3/iomux.c b/arch/arm/mach-mx3/iomux.c
index 40ffc5a664d9..c66ccbcdc11b 100644
--- a/arch/arm/mach-mx3/iomux.c
+++ b/arch/arm/mach-mx3/iomux.c
@@ -21,7 +21,6 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/gpio.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <mach/hardware.h> 25#include <mach/hardware.h>
27#include <mach/gpio.h> 26#include <mach/gpio.h>
@@ -94,15 +93,13 @@ void mxc_iomux_set_pad(enum iomux_pins pin, u32 config)
94EXPORT_SYMBOL(mxc_iomux_set_pad); 93EXPORT_SYMBOL(mxc_iomux_set_pad);
95 94
96/* 95/*
97 * setups a single pin: 96 * allocs a single pin:
98 * - reserves the pin so that it is not claimed by another driver 97 * - reserves the pin so that it is not claimed by another driver
99 * - setups the iomux according to the configuration 98 * - setups the iomux according to the configuration
100 * - if the pin is configured as a GPIO, we claim it through kernel gpiolib
101 */ 99 */
102int mxc_iomux_setup_pin(const unsigned int pin, const char *label) 100int mxc_iomux_alloc_pin(const unsigned int pin, const char *label)
103{ 101{
104 unsigned pad = pin & IOMUX_PADNUM_MASK; 102 unsigned pad = pin & IOMUX_PADNUM_MASK;
105 unsigned gpio;
106 103
107 if (pad >= (PIN_MAX + 1)) { 104 if (pad >= (PIN_MAX + 1)) {
108 printk(KERN_ERR "mxc_iomux: Attempt to request nonexistant pin %u for \"%s\"\n", 105 printk(KERN_ERR "mxc_iomux: Attempt to request nonexistant pin %u for \"%s\"\n",
@@ -113,19 +110,13 @@ int mxc_iomux_setup_pin(const unsigned int pin, const char *label)
113 if (test_and_set_bit(pad, mxc_pin_alloc_map)) { 110 if (test_and_set_bit(pad, mxc_pin_alloc_map)) {
114 printk(KERN_ERR "mxc_iomux: pin %u already used. Allocation for \"%s\" failed\n", 111 printk(KERN_ERR "mxc_iomux: pin %u already used. Allocation for \"%s\" failed\n",
115 pad, label ? label : "?"); 112 pad, label ? label : "?");
116 return -EINVAL; 113 return -EBUSY;
117 } 114 }
118 mxc_iomux_mode(pin); 115 mxc_iomux_mode(pin);
119 116
120 /* if we have a gpio, we can allocate it */
121 gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT;
122 if (gpio < (GPIO_PORT_MAX + 1) * 32)
123 if (gpio_request(gpio, label))
124 return -EINVAL;
125
126 return 0; 117 return 0;
127} 118}
128EXPORT_SYMBOL(mxc_iomux_setup_pin); 119EXPORT_SYMBOL(mxc_iomux_alloc_pin);
129 120
130int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, 121int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
131 const char *label) 122 const char *label)
@@ -135,7 +126,8 @@ int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
135 int ret = -EINVAL; 126 int ret = -EINVAL;
136 127
137 for (i = 0; i < count; i++) { 128 for (i = 0; i < count; i++) {
138 if (mxc_iomux_setup_pin(*p, label)) 129 ret = mxc_iomux_alloc_pin(*p, label);
130 if (ret)
139 goto setup_error; 131 goto setup_error;
140 p++; 132 p++;
141 } 133 }
@@ -150,14 +142,9 @@ EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins);
150void mxc_iomux_release_pin(const unsigned int pin) 142void mxc_iomux_release_pin(const unsigned int pin)
151{ 143{
152 unsigned pad = pin & IOMUX_PADNUM_MASK; 144 unsigned pad = pin & IOMUX_PADNUM_MASK;
153 unsigned gpio;
154 145
155 if (pad < (PIN_MAX + 1)) 146 if (pad < (PIN_MAX + 1))
156 clear_bit(pad, mxc_pin_alloc_map); 147 clear_bit(pad, mxc_pin_alloc_map);
157
158 gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT;
159 if (gpio < (GPIO_PORT_MAX + 1) * 32)
160 gpio_free(gpio);
161} 148}
162EXPORT_SYMBOL(mxc_iomux_release_pin); 149EXPORT_SYMBOL(mxc_iomux_release_pin);
163 150
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
index 9e1459cb4b74..1f5fdd456cb9 100644
--- a/arch/arm/mach-mx3/mm.c
+++ b/arch/arm/mach-mx3/mm.c
@@ -72,8 +72,17 @@ static struct map_desc mxc_io_desc[] __initdata = {
72 * system startup to create static physical to virtual memory mappings 72 * system startup to create static physical to virtual memory mappings
73 * for the IO modules. 73 * for the IO modules.
74 */ 74 */
75void __init mxc_map_io(void) 75void __init mx31_map_io(void)
76{ 76{
77 mxc_set_cpu_type(MXC_CPU_MX31);
78
79 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
80}
81
82void __init mx35_map_io(void)
83{
84 mxc_set_cpu_type(MXC_CPU_MX35);
85
77 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 86 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
78} 87}
79 88
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c
index a6d6efefa6aa..30e2767a78ae 100644
--- a/arch/arm/mach-mx3/mx31ads.c
+++ b/arch/arm/mach-mx3/mx31ads.c
@@ -187,7 +187,7 @@ static void __init mx31ads_init_expio(void)
187 /* 187 /*
188 * Configure INT line as GPIO input 188 * Configure INT line as GPIO input
189 */ 189 */
190 mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO), "expio"); 190 mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO), "expio");
191 191
192 /* disable the interrupt and clear the status */ 192 /* disable the interrupt and clear the status */
193 __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG); 193 __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG);
@@ -511,7 +511,7 @@ static struct map_desc mx31ads_io_desc[] __initdata = {
511 */ 511 */
512static void __init mx31ads_map_io(void) 512static void __init mx31ads_map_io(void)
513{ 513{
514 mxc_map_io(); 514 mx31_map_io();
515 iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc)); 515 iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
516} 516}
517 517
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
new file mode 100644
index 000000000000..3b3a78f49c23
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -0,0 +1,216 @@
1/*
2 * LILLY-1131 development board support
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * based on code for other MX31 boards,
7 *
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/kernel.h>
28#include <linux/types.h>
29#include <linux/init.h>
30#include <linux/gpio.h>
31#include <linux/platform_device.h>
32
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35#include <asm/mach/map.h>
36
37#include <mach/hardware.h>
38#include <mach/common.h>
39#include <mach/imx-uart.h>
40#include <mach/iomux-mx3.h>
41#include <mach/board-mx31lilly.h>
42#include <mach/mmc.h>
43#include <mach/mx3fb.h>
44#include <mach/ipu.h>
45
46#include "devices.h"
47
48/*
49 * This file contains board-specific initialization routines for the
50 * LILLY-1131 development board. If you design an own baseboard for the
51 * module, use this file as base for support code.
52 */
53
54static unsigned int lilly_db_board_pins[] __initdata = {
55 MX31_PIN_CTS1__CTS1,
56 MX31_PIN_RTS1__RTS1,
57 MX31_PIN_TXD1__TXD1,
58 MX31_PIN_RXD1__RXD1,
59 MX31_PIN_CTS2__CTS2,
60 MX31_PIN_RTS2__RTS2,
61 MX31_PIN_TXD2__TXD2,
62 MX31_PIN_RXD2__RXD2,
63 MX31_PIN_CSPI3_MOSI__RXD3,
64 MX31_PIN_CSPI3_MISO__TXD3,
65 MX31_PIN_CSPI3_SCLK__RTS3,
66 MX31_PIN_CSPI3_SPI_RDY__CTS3,
67 MX31_PIN_SD1_DATA3__SD1_DATA3,
68 MX31_PIN_SD1_DATA2__SD1_DATA2,
69 MX31_PIN_SD1_DATA1__SD1_DATA1,
70 MX31_PIN_SD1_DATA0__SD1_DATA0,
71 MX31_PIN_SD1_CLK__SD1_CLK,
72 MX31_PIN_SD1_CMD__SD1_CMD,
73 MX31_PIN_LD0__LD0,
74 MX31_PIN_LD1__LD1,
75 MX31_PIN_LD2__LD2,
76 MX31_PIN_LD3__LD3,
77 MX31_PIN_LD4__LD4,
78 MX31_PIN_LD5__LD5,
79 MX31_PIN_LD6__LD6,
80 MX31_PIN_LD7__LD7,
81 MX31_PIN_LD8__LD8,
82 MX31_PIN_LD9__LD9,
83 MX31_PIN_LD10__LD10,
84 MX31_PIN_LD11__LD11,
85 MX31_PIN_LD12__LD12,
86 MX31_PIN_LD13__LD13,
87 MX31_PIN_LD14__LD14,
88 MX31_PIN_LD15__LD15,
89 MX31_PIN_LD16__LD16,
90 MX31_PIN_LD17__LD17,
91 MX31_PIN_VSYNC3__VSYNC3,
92 MX31_PIN_HSYNC__HSYNC,
93 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0,
95 MX31_PIN_CONTRAST__CONTRAST,
96};
97
98/* UART */
99static struct imxuart_platform_data uart_pdata __initdata = {
100 .flags = IMXUART_HAVE_RTSCTS,
101};
102
103/* MMC support */
104
105static int mxc_mmc1_get_ro(struct device *dev)
106{
107 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_LCS0));
108}
109
110static int gpio_det, gpio_wp;
111
112static int mxc_mmc1_init(struct device *dev,
113 irq_handler_t detect_irq, void *data)
114{
115 int ret;
116
117 gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1);
118 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0);
119
120 ret = gpio_request(gpio_det, "MMC detect");
121 if (ret)
122 return ret;
123
124 ret = gpio_request(gpio_wp, "MMC w/p");
125 if (ret)
126 goto exit_free_det;
127
128 gpio_direction_input(gpio_det);
129 gpio_direction_input(gpio_wp);
130
131 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), detect_irq,
132 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
133 "MMC detect", data);
134 if (ret)
135 goto exit_free_wp;
136
137 return 0;
138
139exit_free_wp:
140 gpio_free(gpio_wp);
141
142exit_free_det:
143 gpio_free(gpio_det);
144
145 return ret;
146}
147
148static void mxc_mmc1_exit(struct device *dev, void *data)
149{
150 gpio_free(gpio_det);
151 gpio_free(gpio_wp);
152 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data);
153}
154
155static struct imxmmc_platform_data mmc_pdata = {
156 .get_ro = mxc_mmc1_get_ro,
157 .init = mxc_mmc1_init,
158 .exit = mxc_mmc1_exit,
159};
160
161/* Framebuffer support */
162static struct ipu_platform_data ipu_data __initdata = {
163 .irq_base = MXC_IPU_IRQ_START,
164};
165
166static const struct fb_videomode fb_modedb = {
167 /* 640x480 TFT panel (IPS-056T) */
168 .name = "CRT-VGA",
169 .refresh = 64,
170 .xres = 640,
171 .yres = 480,
172 .pixclock = 30000,
173 .left_margin = 200,
174 .right_margin = 2,
175 .upper_margin = 2,
176 .lower_margin = 2,
177 .hsync_len = 3,
178 .vsync_len = 1,
179 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
180 .vmode = FB_VMODE_NONINTERLACED,
181 .flag = 0,
182};
183
184static struct mx3fb_platform_data fb_pdata __initdata = {
185 .dma_dev = &mx3_ipu.dev,
186 .name = "CRT-VGA",
187 .mode = &fb_modedb,
188 .num_modes = 1,
189};
190
191#define LCD_VCC_EN_GPIO (7)
192
193static void __init mx31lilly_init_fb(void)
194{
195 if (gpio_request(LCD_VCC_EN_GPIO, "LCD enable") != 0) {
196 printk(KERN_WARNING "unable to request LCD_VCC_EN pin.\n");
197 return;
198 }
199
200 mxc_register_device(&mx3_ipu, &ipu_data);
201 mxc_register_device(&mx3_fb, &fb_pdata);
202 gpio_direction_output(LCD_VCC_EN_GPIO, 1);
203}
204
205void __init mx31lilly_db_init(void)
206{
207 mxc_iomux_setup_multiple_pins(lilly_db_board_pins,
208 ARRAY_SIZE(lilly_db_board_pins),
209 "development board pins");
210 mxc_register_device(&mxc_uart_device0, &uart_pdata);
211 mxc_register_device(&mxc_uart_device1, &uart_pdata);
212 mxc_register_device(&mxc_uart_device2, &uart_pdata);
213 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
214 mx31lilly_init_fb();
215}
216
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
new file mode 100644
index 000000000000..6ab2f163cb95
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -0,0 +1,155 @@
1/*
2 * LILLY-1131 module support
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * based on code for other MX31 boards,
7 *
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/types.h>
28#include <linux/init.h>
29#include <linux/clk.h>
30#include <linux/platform_device.h>
31#include <linux/interrupt.h>
32#include <linux/smsc911x.h>
33#include <linux/mtd/physmap.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/time.h>
38#include <asm/mach/map.h>
39
40#include <mach/hardware.h>
41#include <mach/common.h>
42#include <mach/iomux-mx3.h>
43#include <mach/board-mx31lilly.h>
44
45#include "devices.h"
46
47/*
48 * This file contains module-specific initialization routines for LILLY-1131.
49 * Initialization of peripherals found on the baseboard is implemented in the
50 * appropriate baseboard support code.
51 */
52
53/* SMSC ethernet support */
54
55static struct resource smsc91x_resources[] = {
56 {
57 .start = CS4_BASE_ADDR,
58 .end = CS4_BASE_ADDR + 0xffff,
59 .flags = IORESOURCE_MEM,
60 },
61 {
62 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
63 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
64 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
65 }
66};
67
68static struct smsc911x_platform_config smsc911x_config = {
69 .phy_interface = PHY_INTERFACE_MODE_MII,
70 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
71 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
72 .flags = SMSC911X_USE_32BIT |
73 SMSC911X_SAVE_MAC_ADDRESS |
74 SMSC911X_FORCE_INTERNAL_PHY,
75};
76
77static struct platform_device smsc91x_device = {
78 .name = "smsc911x",
79 .id = -1,
80 .num_resources = ARRAY_SIZE(smsc91x_resources),
81 .resource = smsc91x_resources,
82 .dev = {
83 .platform_data = &smsc911x_config,
84 }
85};
86
87/* NOR flash */
88static struct physmap_flash_data nor_flash_data = {
89 .width = 2,
90};
91
92static struct resource nor_flash_resource = {
93 .start = 0xa0000000,
94 .end = 0xa1ffffff,
95 .flags = IORESOURCE_MEM,
96};
97
98static struct platform_device physmap_flash_device = {
99 .name = "physmap-flash",
100 .id = 0,
101 .dev = {
102 .platform_data = &nor_flash_data,
103 },
104 .resource = &nor_flash_resource,
105 .num_resources = 1,
106};
107
108static struct platform_device *devices[] __initdata = {
109 &smsc91x_device,
110 &physmap_flash_device,
111 &mxc_i2c_device1,
112};
113
114static int mx31lilly_baseboard;
115core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444);
116
117static void __init mx31lilly_board_init(void)
118{
119 switch (mx31lilly_baseboard) {
120 case MX31LILLY_NOBOARD:
121 break;
122 case MX31LILLY_DB:
123 mx31lilly_db_init();
124 break;
125 default:
126 printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n",
127 mx31lilly_baseboard);
128 }
129
130 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
131 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__SCL, "I2C SCL");
132 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__SDA, "I2C SDA");
133
134 platform_add_devices(devices, ARRAY_SIZE(devices));
135}
136
137static void __init mx31lilly_timer_init(void)
138{
139 mx31_clocks_init(26000000);
140}
141
142static struct sys_timer mx31lilly_timer = {
143 .init = mx31lilly_timer_init,
144};
145
146MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
147 .phys_io = AIPS1_BASE_ADDR,
148 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
149 .boot_params = PHYS_OFFSET + 0x100,
150 .map_io = mx31_map_io,
151 .init_irq = mxc_init_irq,
152 .init_machine = mx31lilly_board_init,
153 .timer = &mx31lilly_timer,
154MACHINE_END
155
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c
index 894d98cd9941..86fe70fa3e13 100644
--- a/arch/arm/mach-mx3/mx31lite.c
+++ b/arch/arm/mach-mx3/mx31lite.c
@@ -22,6 +22,9 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/memory.h> 24#include <linux/memory.h>
25#include <linux/platform_device.h>
26#include <linux/gpio.h>
27#include <linux/smsc911x.h>
25 28
26#include <mach/hardware.h> 29#include <mach/hardware.h>
27#include <asm/mach-types.h> 30#include <asm/mach-types.h>
@@ -32,11 +35,64 @@
32#include <asm/page.h> 35#include <asm/page.h>
33#include <asm/setup.h> 36#include <asm/setup.h>
34#include <mach/board-mx31lite.h> 37#include <mach/board-mx31lite.h>
38#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h>
40#include <mach/irqs.h>
41#include <mach/mxc_nand.h>
42#include "devices.h"
35 43
36/* 44/*
37 * This file contains the board-specific initialization routines. 45 * This file contains the board-specific initialization routines.
38 */ 46 */
39 47
48static unsigned int mx31lite_pins[] = {
49 /* UART1 */
50 MX31_PIN_CTS1__CTS1,
51 MX31_PIN_RTS1__RTS1,
52 MX31_PIN_TXD1__TXD1,
53 MX31_PIN_RXD1__RXD1,
54 /* LAN9117 IRQ pin */
55 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO),
56};
57
58static struct imxuart_platform_data uart_pdata = {
59 .flags = IMXUART_HAVE_RTSCTS,
60};
61
62static struct mxc_nand_platform_data mx31lite_nand_board_info = {
63 .width = 1,
64 .hw_ecc = 1,
65};
66
67static struct smsc911x_platform_config smsc911x_config = {
68 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
69 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
70 .flags = SMSC911X_USE_16BIT,
71};
72
73static struct resource smsc911x_resources[] = {
74 [0] = {
75 .start = CS4_BASE_ADDR,
76 .end = CS4_BASE_ADDR + 0x100,
77 .flags = IORESOURCE_MEM,
78 },
79 [1] = {
80 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6),
81 .end = IOMUX_TO_IRQ(MX31_PIN_SFS6),
82 .flags = IORESOURCE_IRQ,
83 },
84};
85
86static struct platform_device smsc911x_device = {
87 .name = "smsc911x",
88 .id = -1,
89 .num_resources = ARRAY_SIZE(smsc911x_resources),
90 .resource = smsc911x_resources,
91 .dev = {
92 .platform_data = &smsc911x_config,
93 },
94};
95
40/* 96/*
41 * This structure defines the MX31 memory map. 97 * This structure defines the MX31 memory map.
42 */ 98 */
@@ -59,7 +115,7 @@ static struct map_desc mx31lite_io_desc[] __initdata = {
59 */ 115 */
60void __init mx31lite_map_io(void) 116void __init mx31lite_map_io(void)
61{ 117{
62 mxc_map_io(); 118 mx31_map_io();
63 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc)); 119 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
64} 120}
65 121
@@ -68,6 +124,22 @@ void __init mx31lite_map_io(void)
68 */ 124 */
69static void __init mxc_board_init(void) 125static void __init mxc_board_init(void)
70{ 126{
127 int ret;
128
129 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
130 "mx31lite");
131
132 mxc_register_device(&mxc_uart_device0, &uart_pdata);
133 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info);
134
135 /* SMSC9117 IRQ pin */
136 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
137 if (ret)
138 pr_warning("could not get LAN irq gpio\n");
139 else {
140 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6));
141 platform_device_register(&smsc911x_device);
142 }
71} 143}
72 144
73static void __init mx31lite_timer_init(void) 145static void __init mx31lite_timer_init(void)
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index d080b4add79c..4704405165a1 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -16,33 +16,142 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/types.h> 19#include <linux/fsl_devices.h>
20#include <linux/gpio.h>
20#include <linux/init.h> 21#include <linux/init.h>
21 22#include <linux/interrupt.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/types.h>
23 25
24#include <mach/hardware.h>
25#include <mach/common.h> 26#include <mach/common.h>
26#include <mach/imx-uart.h> 27#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h> 28#include <mach/iomux-mx3.h>
29#include <mach/hardware.h>
30#include <mach/mmc.h>
28 31
29#include "devices.h" 32#include "devices.h"
30 33
34static unsigned int devboard_pins[] = {
35 /* UART1 */
36 MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2,
37 MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2,
38 /* SDHC2 */
39 MX31_PIN_PC_PWRON__SD2_DATA3, MX31_PIN_PC_VS1__SD2_DATA2,
40 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
41 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
42 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
43 /* USB OTG */
44 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
45 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
46 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
47 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
48 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
49 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
50 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
51 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
52 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
53 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
54 MX31_PIN_USB_OC__GPIO1_30,
55};
56
31static struct imxuart_platform_data uart_pdata = { 57static struct imxuart_platform_data uart_pdata = {
32 .flags = IMXUART_HAVE_RTSCTS, 58 .flags = IMXUART_HAVE_RTSCTS,
33}; 59};
34 60
35static int mxc_uart1_pins[] = { 61#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
36 MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2, 62#define SDHC2_WP IOMUX_TO_GPIO(MX31_PIN_ATA_DIOW)
37 MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2, 63
64static int devboard_sdhc2_get_ro(struct device *dev)
65{
66 return gpio_get_value(SDHC2_WP);
67}
68
69static int devboard_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
70 void *data)
71{
72 int ret;
73
74 ret = gpio_request(SDHC2_CD, "sdhc-detect");
75 if (ret)
76 return ret;
77
78 gpio_direction_input(SDHC2_CD);
79
80 ret = gpio_request(SDHC2_WP, "sdhc-wp");
81 if (ret)
82 goto err_gpio_free;
83 gpio_direction_input(SDHC2_WP);
84
85 ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
86 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
87 "sdhc2-card-detect", data);
88 if (ret)
89 goto err_gpio_free_2;
90
91 return 0;
92
93err_gpio_free_2:
94 gpio_free(SDHC2_WP);
95err_gpio_free:
96 gpio_free(SDHC2_CD);
97
98 return ret;
99}
100
101static void devboard_sdhc2_exit(struct device *dev, void *data)
102{
103 free_irq(gpio_to_irq(SDHC2_CD), data);
104 gpio_free(SDHC2_WP);
105 gpio_free(SDHC2_CD);
106}
107
108static struct imxmmc_platform_data sdhc2_pdata = {
109 .get_ro = devboard_sdhc2_get_ro,
110 .init = devboard_sdhc2_init,
111 .exit = devboard_sdhc2_exit,
112};
113
114static struct fsl_usb2_platform_data usb_pdata = {
115 .operating_mode = FSL_USB2_DR_DEVICE,
116 .phy_mode = FSL_USB2_PHY_ULPI,
38}; 117};
39 118
119#define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST)
120#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
121
122static void devboard_usbotg_init(void)
123{
124 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG);
125 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG);
126 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG);
127 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG);
128 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG);
129 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG);
130 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG);
131 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG);
132 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG);
133 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG);
134 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG);
135 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG);
136
137 gpio_request(OTG_EN_B, "usb-udc-en");
138 gpio_direction_output(OTG_EN_B, 0);
139}
140
40/* 141/*
41 * system init for baseboard usage. Will be called by mx31moboard init. 142 * system init for baseboard usage. Will be called by mx31moboard init.
42 */ 143 */
43void __init mx31moboard_devboard_init(void) 144void __init mx31moboard_devboard_init(void)
44{ 145{
45 printk(KERN_INFO "Initializing mx31devboard peripherals\n"); 146 printk(KERN_INFO "Initializing mx31devboard peripherals\n");
46 mxc_iomux_setup_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins), "uart1"); 147
148 mxc_iomux_setup_multiple_pins(devboard_pins, ARRAY_SIZE(devboard_pins),
149 "devboard");
150
47 mxc_register_device(&mxc_uart_device1, &uart_pdata); 151 mxc_register_device(&mxc_uart_device1, &uart_pdata);
152
153 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
154
155 devboard_usbotg_init();
156 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
48} 157}
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 9ef9566823fb..641c3d6153ae 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -16,22 +16,144 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/types.h> 19#include <linux/fsl_devices.h>
20#include <linux/gpio.h>
20#include <linux/init.h> 21#include <linux/init.h>
21 22#include <linux/interrupt.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/types.h>
23 25
24#include <mach/hardware.h>
25#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/hardware.h>
26#include <mach/imx-uart.h> 28#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h> 29#include <mach/iomux-mx3.h>
30#include <mach/mmc.h>
28 31
29#include "devices.h" 32#include "devices.h"
30 33
34static unsigned int marxbot_pins[] = {
35 /* SDHC2 */
36 MX31_PIN_PC_PWRON__SD2_DATA3, MX31_PIN_PC_VS1__SD2_DATA2,
37 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
38 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
39 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
40 /* CSI */
41 MX31_PIN_CSI_D4__CSI_D4, MX31_PIN_CSI_D5__CSI_D5,
42 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
43 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
44 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
45 MX31_PIN_CSI_D12__CSI_D12, MX31_PIN_CSI_D13__CSI_D13,
46 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
47 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
48 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
49 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
50 MX31_PIN_TXD2__GPIO1_28,
51 /* USB OTG */
52 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
53 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
54 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
55 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
56 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
57 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
58 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
59 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
60 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
61 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
62 MX31_PIN_USB_OC__GPIO1_30,
63};
64
65#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
66#define SDHC2_WP IOMUX_TO_GPIO(MX31_PIN_ATA_DIOW)
67
68static int marxbot_sdhc2_get_ro(struct device *dev)
69{
70 return gpio_get_value(SDHC2_WP);
71}
72
73static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
74 void *data)
75{
76 int ret;
77
78 ret = gpio_request(SDHC2_CD, "sdhc-detect");
79 if (ret)
80 return ret;
81
82 gpio_direction_input(SDHC2_CD);
83
84 ret = gpio_request(SDHC2_WP, "sdhc-wp");
85 if (ret)
86 goto err_gpio_free;
87 gpio_direction_input(SDHC2_WP);
88
89 ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
90 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
91 "sdhc2-card-detect", data);
92 if (ret)
93 goto err_gpio_free_2;
94
95 return 0;
96
97err_gpio_free_2:
98 gpio_free(SDHC2_WP);
99err_gpio_free:
100 gpio_free(SDHC2_CD);
101
102 return ret;
103}
104
105static void marxbot_sdhc2_exit(struct device *dev, void *data)
106{
107 free_irq(gpio_to_irq(SDHC2_CD), data);
108 gpio_free(SDHC2_WP);
109 gpio_free(SDHC2_CD);
110}
111
112static struct imxmmc_platform_data sdhc2_pdata = {
113 .get_ro = marxbot_sdhc2_get_ro,
114 .init = marxbot_sdhc2_init,
115 .exit = marxbot_sdhc2_exit,
116};
117
118static struct fsl_usb2_platform_data usb_pdata = {
119 .operating_mode = FSL_USB2_DR_DEVICE,
120 .phy_mode = FSL_USB2_PHY_ULPI,
121};
122
123#define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST)
124#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
125
126static void marxbot_usbotg_init(void)
127{
128 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG);
129 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG);
130 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG);
131 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG);
132 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG);
133 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG);
134 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG);
135 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG);
136 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG);
137 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG);
138 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG);
139 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG);
140
141 gpio_request(OTG_EN_B, "usb-udc-en");
142 gpio_direction_output(OTG_EN_B, 0);
143}
144
31/* 145/*
32 * system init for baseboard usage. Will be called by mx31moboard init. 146 * system init for baseboard usage. Will be called by mx31moboard init.
33 */ 147 */
34void __init mx31moboard_marxbot_init(void) 148void __init mx31moboard_marxbot_init(void)
35{ 149{
36 printk(KERN_INFO "Initializing mx31marxbot peripherals\n"); 150 printk(KERN_INFO "Initializing mx31marxbot peripherals\n");
151
152 mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins),
153 "marxbot");
154
155 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
156
157 marxbot_usbotg_init();
158 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
37} 159}
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index 34c2a1b99d4f..a17f2e411609 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -16,26 +16,47 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/types.h> 19#include <linux/gpio.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21#include <linux/interrupt.h>
22#include <linux/platform_device.h> 22#include <linux/memory.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/memory.h> 25#include <linux/platform_device.h>
26#include <linux/types.h>
26 27
27#include <mach/hardware.h>
28#include <asm/mach-types.h> 28#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/time.h> 30#include <asm/mach/time.h>
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32#include <mach/board-mx31moboard.h>
32#include <mach/common.h> 33#include <mach/common.h>
34#include <mach/hardware.h>
33#include <mach/imx-uart.h> 35#include <mach/imx-uart.h>
34#include <mach/iomux-mx3.h> 36#include <mach/iomux-mx3.h>
35#include <mach/board-mx31moboard.h> 37#include <mach/i2c.h>
38#include <mach/mmc.h>
36 39
37#include "devices.h" 40#include "devices.h"
38 41
42static unsigned int moboard_pins[] = {
43 /* UART0 */
44 MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1,
45 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
46 /* UART4 */
47 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
48 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
49 /* I2C0 */
50 MX31_PIN_I2C_DAT__I2C1_SDA, MX31_PIN_I2C_CLK__I2C1_SCL,
51 /* I2C1 */
52 MX31_PIN_DCD_DTE1__I2C2_SDA, MX31_PIN_RI_DTE1__I2C2_SCL,
53 /* SDHC1 */
54 MX31_PIN_SD1_DATA3__SD1_DATA3, MX31_PIN_SD1_DATA2__SD1_DATA2,
55 MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0,
56 MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD,
57 MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27,
58};
59
39static struct physmap_flash_data mx31moboard_flash_data = { 60static struct physmap_flash_data mx31moboard_flash_data = {
40 .width = 2, 61 .width = 2,
41}; 62};
@@ -60,17 +81,69 @@ static struct imxuart_platform_data uart_pdata = {
60 .flags = IMXUART_HAVE_RTSCTS, 81 .flags = IMXUART_HAVE_RTSCTS,
61}; 82};
62 83
63static struct platform_device *devices[] __initdata = { 84static struct imxi2c_platform_data moboard_i2c0_pdata = {
64 &mx31moboard_flash, 85 .bitrate = 400000,
65}; 86};
66 87
67static int mxc_uart0_pins[] = { 88static struct imxi2c_platform_data moboard_i2c1_pdata = {
68 MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1, 89 .bitrate = 100000,
69 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
70}; 90};
71static int mxc_uart4_pins[] = { 91
72 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5, 92#define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0)
73 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5, 93#define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1)
94
95static int moboard_sdhc1_get_ro(struct device *dev)
96{
97 return gpio_get_value(SDHC1_WP);
98}
99
100static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
101 void *data)
102{
103 int ret;
104
105 ret = gpio_request(SDHC1_CD, "sdhc-detect");
106 if (ret)
107 return ret;
108
109 gpio_direction_input(SDHC1_CD);
110
111 ret = gpio_request(SDHC1_WP, "sdhc-wp");
112 if (ret)
113 goto err_gpio_free;
114 gpio_direction_input(SDHC1_WP);
115
116 ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq,
117 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
118 "sdhc1-card-detect", data);
119 if (ret)
120 goto err_gpio_free_2;
121
122 return 0;
123
124err_gpio_free_2:
125 gpio_free(SDHC1_WP);
126err_gpio_free:
127 gpio_free(SDHC1_CD);
128
129 return ret;
130}
131
132static void moboard_sdhc1_exit(struct device *dev, void *data)
133{
134 free_irq(gpio_to_irq(SDHC1_CD), data);
135 gpio_free(SDHC1_WP);
136 gpio_free(SDHC1_CD);
137}
138
139static struct imxmmc_platform_data sdhc1_pdata = {
140 .get_ro = moboard_sdhc1_get_ro,
141 .init = moboard_sdhc1_init,
142 .exit = moboard_sdhc1_exit,
143};
144
145static struct platform_device *devices[] __initdata = {
146 &mx31moboard_flash,
74}; 147};
75 148
76static int mx31moboard_baseboard; 149static int mx31moboard_baseboard;
@@ -81,14 +154,19 @@ core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
81 */ 154 */
82static void __init mxc_board_init(void) 155static void __init mxc_board_init(void)
83{ 156{
157 mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins),
158 "moboard");
159
84 platform_add_devices(devices, ARRAY_SIZE(devices)); 160 platform_add_devices(devices, ARRAY_SIZE(devices));
85 161
86 mxc_iomux_setup_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins), "uart0");
87 mxc_register_device(&mxc_uart_device0, &uart_pdata); 162 mxc_register_device(&mxc_uart_device0, &uart_pdata);
88
89 mxc_iomux_setup_multiple_pins(mxc_uart4_pins, ARRAY_SIZE(mxc_uart4_pins), "uart4");
90 mxc_register_device(&mxc_uart_device4, &uart_pdata); 163 mxc_register_device(&mxc_uart_device4, &uart_pdata);
91 164
165 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
166 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
167
168 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata);
169
92 switch (mx31moboard_baseboard) { 170 switch (mx31moboard_baseboard) {
93 case MX31NOBOARD: 171 case MX31NOBOARD:
94 break; 172 break;
@@ -99,7 +177,8 @@ static void __init mxc_board_init(void)
99 mx31moboard_marxbot_init(); 177 mx31moboard_marxbot_init();
100 break; 178 break;
101 default: 179 default:
102 printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n", mx31moboard_baseboard); 180 printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n",
181 mx31moboard_baseboard);
103 } 182 }
104} 183}
105 184
@@ -117,7 +196,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
117 .phys_io = AIPS1_BASE_ADDR, 196 .phys_io = AIPS1_BASE_ADDR,
118 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 197 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
119 .boot_params = PHYS_OFFSET + 0x100, 198 .boot_params = PHYS_OFFSET + 0x100,
120 .map_io = mxc_map_io, 199 .map_io = mx31_map_io,
121 .init_irq = mxc_init_irq, 200 .init_irq = mxc_init_irq,
122 .init_machine = mxc_board_init, 201 .init_machine = mxc_board_init,
123 .timer = &mx31moboard_timer, 202 .timer = &mx31moboard_timer,
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
index bc63f1785691..c19838d2e369 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -20,6 +20,9 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/gpio.h>
24#include <linux/smsc911x.h>
25#include <linux/platform_device.h>
23 26
24#include <mach/hardware.h> 27#include <mach/hardware.h>
25#include <asm/mach-types.h> 28#include <asm/mach-types.h>
@@ -41,21 +44,192 @@
41 * @ingroup System 44 * @ingroup System
42 */ 45 */
43 46
47static int mx31pdk_pins[] = {
48 /* UART1 */
49 MX31_PIN_CTS1__CTS1,
50 MX31_PIN_RTS1__RTS1,
51 MX31_PIN_TXD1__TXD1,
52 MX31_PIN_RXD1__RXD1,
53 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO),
54};
55
44static struct imxuart_platform_data uart_pdata = { 56static struct imxuart_platform_data uart_pdata = {
45 .flags = IMXUART_HAVE_RTSCTS, 57 .flags = IMXUART_HAVE_RTSCTS,
46}; 58};
47 59
48static int uart_pins[] = { 60/*
49 MX31_PIN_CTS1__CTS1, 61 * Support for the SMSC9217 on the Debug board.
50 MX31_PIN_RTS1__RTS1, 62 */
51 MX31_PIN_TXD1__TXD1, 63
52 MX31_PIN_RXD1__RXD1 64static struct smsc911x_platform_config smsc911x_config = {
65 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
66 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
67 .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
68 .phy_interface = PHY_INTERFACE_MODE_MII,
69};
70
71static struct resource smsc911x_resources[] = {
72 {
73 .start = LAN9217_BASE_ADDR,
74 .end = LAN9217_BASE_ADDR + 0xff,
75 .flags = IORESOURCE_MEM,
76 }, {
77 .start = EXPIO_INT_ENET,
78 .end = EXPIO_INT_ENET,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
83static struct platform_device smsc911x_device = {
84 .name = "smsc911x",
85 .id = -1,
86 .num_resources = ARRAY_SIZE(smsc911x_resources),
87 .resource = smsc911x_resources,
88 .dev = {
89 .platform_data = &smsc911x_config,
90 },
53}; 91};
54 92
55static inline void mxc_init_imx_uart(void) 93/*
94 * Routines for the CPLD on the debug board. It contains a CPLD handling
95 * LEDs, switches, interrupts for Ethernet.
96 */
97
98static void mx31pdk_expio_irq_handler(uint32_t irq, struct irq_desc *desc)
56{ 99{
57 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); 100 uint32_t imr_val;
58 mxc_register_device(&mxc_uart_device0, &uart_pdata); 101 uint32_t int_valid;
102 uint32_t expio_irq;
103
104 imr_val = __raw_readw(CPLD_INT_MASK_REG);
105 int_valid = __raw_readw(CPLD_INT_STATUS_REG) & ~imr_val;
106
107 expio_irq = MXC_EXP_IO_BASE;
108 for (; int_valid != 0; int_valid >>= 1, expio_irq++) {
109 if ((int_valid & 1) == 0)
110 continue;
111 generic_handle_irq(expio_irq);
112 }
113}
114
115/*
116 * Disable an expio pin's interrupt by setting the bit in the imr.
117 * @param irq an expio virtual irq number
118 */
119static void expio_mask_irq(uint32_t irq)
120{
121 uint16_t reg;
122 uint32_t expio = MXC_IRQ_TO_EXPIO(irq);
123
124 /* mask the interrupt */
125 reg = __raw_readw(CPLD_INT_MASK_REG);
126 reg |= 1 << expio;
127 __raw_writew(reg, CPLD_INT_MASK_REG);
128}
129
130/*
131 * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr.
132 * @param irq an expanded io virtual irq number
133 */
134static void expio_ack_irq(uint32_t irq)
135{
136 uint32_t expio = MXC_IRQ_TO_EXPIO(irq);
137
138 /* clear the interrupt status */
139 __raw_writew(1 << expio, CPLD_INT_RESET_REG);
140 __raw_writew(0, CPLD_INT_RESET_REG);
141 /* mask the interrupt */
142 expio_mask_irq(irq);
143}
144
145/*
146 * Enable a expio pin's interrupt by clearing the bit in the imr.
147 * @param irq a expio virtual irq number
148 */
149static void expio_unmask_irq(uint32_t irq)
150{
151 uint16_t reg;
152 uint32_t expio = MXC_IRQ_TO_EXPIO(irq);
153
154 /* unmask the interrupt */
155 reg = __raw_readw(CPLD_INT_MASK_REG);
156 reg &= ~(1 << expio);
157 __raw_writew(reg, CPLD_INT_MASK_REG);
158}
159
160static struct irq_chip expio_irq_chip = {
161 .ack = expio_ack_irq,
162 .mask = expio_mask_irq,
163 .unmask = expio_unmask_irq,
164};
165
166static int __init mx31pdk_init_expio(void)
167{
168 int i;
169 int ret;
170
171 /* Check if there's a debug board connected */
172 if ((__raw_readw(CPLD_MAGIC_NUMBER1_REG) != 0xAAAA) ||
173 (__raw_readw(CPLD_MAGIC_NUMBER2_REG) != 0x5555) ||
174 (__raw_readw(CPLD_MAGIC_NUMBER3_REG) != 0xCAFE)) {
175 /* No Debug board found */
176 return -ENODEV;
177 }
178
179 pr_info("i.MX31PDK Debug board detected, rev = 0x%04X\n",
180 __raw_readw(CPLD_CODE_VER_REG));
181
182 /*
183 * Configure INT line as GPIO input
184 */
185 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "sms9217-irq");
186 if (ret)
187 pr_warning("could not get LAN irq gpio\n");
188 else
189 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
190
191 /* Disable the interrupts and clear the status */
192 __raw_writew(0, CPLD_INT_MASK_REG);
193 __raw_writew(0xFFFF, CPLD_INT_RESET_REG);
194 __raw_writew(0, CPLD_INT_RESET_REG);
195 __raw_writew(0x1F, CPLD_INT_MASK_REG);
196 for (i = MXC_EXP_IO_BASE;
197 i < (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES);
198 i++) {
199 set_irq_chip(i, &expio_irq_chip);
200 set_irq_handler(i, handle_level_irq);
201 set_irq_flags(i, IRQF_VALID);
202 }
203 set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_LOW);
204 set_irq_chained_handler(EXPIO_PARENT_INT, mx31pdk_expio_irq_handler);
205
206 return 0;
207}
208
209/*
210 * This structure defines the MX31 memory map.
211 */
212static struct map_desc mx31pdk_io_desc[] __initdata = {
213 {
214 .virtual = SPBA0_BASE_ADDR_VIRT,
215 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
216 .length = SPBA0_SIZE,
217 .type = MT_DEVICE_NONSHARED,
218 }, {
219 .virtual = CS5_BASE_ADDR_VIRT,
220 .pfn = __phys_to_pfn(CS5_BASE_ADDR),
221 .length = CS5_SIZE,
222 .type = MT_DEVICE,
223 },
224};
225
226/*
227 * Set up static virtual mappings.
228 */
229static void __init mx31pdk_map_io(void)
230{
231 mx31_map_io();
232 iotable_init(mx31pdk_io_desc, ARRAY_SIZE(mx31pdk_io_desc));
59} 233}
60 234
61/*! 235/*!
@@ -63,7 +237,13 @@ static inline void mxc_init_imx_uart(void)
63 */ 237 */
64static void __init mxc_board_init(void) 238static void __init mxc_board_init(void)
65{ 239{
66 mxc_init_imx_uart(); 240 mxc_iomux_setup_multiple_pins(mx31pdk_pins, ARRAY_SIZE(mx31pdk_pins),
241 "mx31pdk");
242
243 mxc_register_device(&mxc_uart_device0, &uart_pdata);
244
245 if (!mx31pdk_init_expio())
246 platform_device_register(&smsc911x_device);
67} 247}
68 248
69static void __init mx31pdk_timer_init(void) 249static void __init mx31pdk_timer_init(void)
@@ -84,7 +264,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
84 .phys_io = AIPS1_BASE_ADDR, 264 .phys_io = AIPS1_BASE_ADDR,
85 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 265 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
86 .boot_params = PHYS_OFFSET + 0x100, 266 .boot_params = PHYS_OFFSET + 0x100,
87 .map_io = mxc_map_io, 267 .map_io = mx31pdk_map_io,
88 .init_irq = mxc_init_irq, 268 .init_irq = mxc_init_irq,
89 .init_machine = mxc_board_init, 269 .init_machine = mxc_board_init,
90 .timer = &mx31pdk_timer, 270 .timer = &mx31pdk_timer,
diff --git a/arch/arm/mach-mx3/mx35pdk.c b/arch/arm/mach-mx3/mx35pdk.c
new file mode 100644
index 000000000000..6d15374414b9
--- /dev/null
+++ b/arch/arm/mach-mx3/mx35pdk.c
@@ -0,0 +1,104 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * Author: Fabio Estevam <fabio.estevam@freescale.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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/types.h>
22#include <linux/init.h>
23#include <linux/platform_device.h>
24#include <linux/memory.h>
25#include <linux/gpio.h>
26
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/time.h>
30#include <asm/mach/map.h>
31
32#include <mach/hardware.h>
33#include <mach/common.h>
34#include <mach/imx-uart.h>
35#include <mach/iomux-mx35.h>
36
37#include "devices.h"
38
39static struct imxuart_platform_data uart_pdata = {
40 .flags = IMXUART_HAVE_RTSCTS,
41};
42
43static struct platform_device *devices[] __initdata = {
44 &mxc_fec_device,
45};
46
47static struct pad_desc mx35pdk_pads[] = {
48 /* UART1 */
49 MX35_PAD_CTS1__UART1_CTS,
50 MX35_PAD_RTS1__UART1_RTS,
51 MX35_PAD_TXD1__UART1_TXD_MUX,
52 MX35_PAD_RXD1__UART1_RXD_MUX,
53 /* FEC */
54 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
55 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
56 MX35_PAD_FEC_RX_DV__FEC_RX_DV,
57 MX35_PAD_FEC_COL__FEC_COL,
58 MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
59 MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
60 MX35_PAD_FEC_TX_EN__FEC_TX_EN,
61 MX35_PAD_FEC_MDC__FEC_MDC,
62 MX35_PAD_FEC_MDIO__FEC_MDIO,
63 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
64 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
65 MX35_PAD_FEC_CRS__FEC_CRS,
66 MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
67 MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
68 MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
69 MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
70 MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
71 MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
72};
73
74/*
75 * Board specific initialization.
76 */
77static void __init mxc_board_init(void)
78{
79 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
80
81 platform_add_devices(devices, ARRAY_SIZE(devices));
82
83 mxc_register_device(&mxc_uart_device0, &uart_pdata);
84}
85
86static void __init mx35pdk_timer_init(void)
87{
88 mx35_clocks_init();
89}
90
91struct sys_timer mx35pdk_timer = {
92 .init = mx35pdk_timer_init,
93};
94
95MACHINE_START(MX35_3DS, "Freescale MX35PDK")
96 /* Maintainer: Freescale Semiconductor, Inc */
97 .phys_io = AIPS1_BASE_ADDR,
98 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
99 .boot_params = PHYS_OFFSET + 0x100,
100 .map_io = mx35_map_io,
101 .init_irq = mxc_init_irq,
102 .init_machine = mxc_board_init,
103 .timer = &mx35pdk_timer,
104MACHINE_END
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index b5227d837b2f..c6f61a1f06c8 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -28,6 +28,10 @@
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/i2c.h> 29#include <linux/i2c.h>
30#include <linux/i2c/at24.h> 30#include <linux/i2c/at24.h>
31#include <linux/delay.h>
32#include <linux/spi/spi.h>
33#include <linux/irq.h>
34#include <linux/fsl_devices.h>
31 35
32#include <mach/hardware.h> 36#include <mach/hardware.h>
33#include <asm/mach-types.h> 37#include <asm/mach-types.h>
@@ -37,7 +41,9 @@
37#include <mach/common.h> 41#include <mach/common.h>
38#include <mach/imx-uart.h> 42#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h> 43#include <mach/iomux-mx3.h>
44#include <mach/ipu.h>
40#include <mach/board-pcm037.h> 45#include <mach/board-pcm037.h>
46#include <mach/mx3fb.h>
41#include <mach/mxc_nand.h> 47#include <mach/mxc_nand.h>
42#include <mach/mmc.h> 48#include <mach/mmc.h>
43#ifdef CONFIG_I2C_IMX 49#ifdef CONFIG_I2C_IMX
@@ -46,6 +52,76 @@
46 52
47#include "devices.h" 53#include "devices.h"
48 54
55static unsigned int pcm037_pins[] = {
56 /* I2C */
57 MX31_PIN_CSPI2_MOSI__SCL,
58 MX31_PIN_CSPI2_MISO__SDA,
59 /* SDHC1 */
60 MX31_PIN_SD1_DATA3__SD1_DATA3,
61 MX31_PIN_SD1_DATA2__SD1_DATA2,
62 MX31_PIN_SD1_DATA1__SD1_DATA1,
63 MX31_PIN_SD1_DATA0__SD1_DATA0,
64 MX31_PIN_SD1_CLK__SD1_CLK,
65 MX31_PIN_SD1_CMD__SD1_CMD,
66 IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO), /* card detect */
67 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO), /* write protect */
68 /* SPI1 */
69 MX31_PIN_CSPI1_MOSI__MOSI,
70 MX31_PIN_CSPI1_MISO__MISO,
71 MX31_PIN_CSPI1_SCLK__SCLK,
72 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
73 MX31_PIN_CSPI1_SS0__SS0,
74 MX31_PIN_CSPI1_SS1__SS1,
75 MX31_PIN_CSPI1_SS2__SS2,
76 /* UART1 */
77 MX31_PIN_CTS1__CTS1,
78 MX31_PIN_RTS1__RTS1,
79 MX31_PIN_TXD1__TXD1,
80 MX31_PIN_RXD1__RXD1,
81 /* UART2 */
82 MX31_PIN_TXD2__TXD2,
83 MX31_PIN_RXD2__RXD2,
84 MX31_PIN_CTS2__CTS2,
85 MX31_PIN_RTS2__RTS2,
86 /* UART3 */
87 MX31_PIN_CSPI3_MOSI__RXD3,
88 MX31_PIN_CSPI3_MISO__TXD3,
89 MX31_PIN_CSPI3_SCLK__RTS3,
90 MX31_PIN_CSPI3_SPI_RDY__CTS3,
91 /* LAN9217 irq pin */
92 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO),
93 /* Onewire */
94 MX31_PIN_BATT_LINE__OWIRE,
95 /* Framebuffer */
96 MX31_PIN_LD0__LD0,
97 MX31_PIN_LD1__LD1,
98 MX31_PIN_LD2__LD2,
99 MX31_PIN_LD3__LD3,
100 MX31_PIN_LD4__LD4,
101 MX31_PIN_LD5__LD5,
102 MX31_PIN_LD6__LD6,
103 MX31_PIN_LD7__LD7,
104 MX31_PIN_LD8__LD8,
105 MX31_PIN_LD9__LD9,
106 MX31_PIN_LD10__LD10,
107 MX31_PIN_LD11__LD11,
108 MX31_PIN_LD12__LD12,
109 MX31_PIN_LD13__LD13,
110 MX31_PIN_LD14__LD14,
111 MX31_PIN_LD15__LD15,
112 MX31_PIN_LD16__LD16,
113 MX31_PIN_LD17__LD17,
114 MX31_PIN_VSYNC3__VSYNC3,
115 MX31_PIN_HSYNC__HSYNC,
116 MX31_PIN_FPSHIFT__FPSHIFT,
117 MX31_PIN_DRDY0__DRDY0,
118 MX31_PIN_D3_REV__D3_REV,
119 MX31_PIN_CONTRAST__CONTRAST,
120 MX31_PIN_D3_SPL__D3_SPL,
121 MX31_PIN_D3_CLS__D3_CLS,
122 MX31_PIN_LCS0__GPI03_23,
123};
124
49static struct physmap_flash_data pcm037_flash_data = { 125static struct physmap_flash_data pcm037_flash_data = {
50 .width = 2, 126 .width = 2,
51}; 127};
@@ -56,6 +132,54 @@ static struct resource pcm037_flash_resource = {
56 .flags = IORESOURCE_MEM, 132 .flags = IORESOURCE_MEM,
57}; 133};
58 134
135static int usbotg_pins[] = {
136 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
137 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
138 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
139 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
140 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
141 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
142 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
143 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
144 MX31_PIN_USBOTG_CLK__USBOTG_CLK,
145 MX31_PIN_USBOTG_DIR__USBOTG_DIR,
146 MX31_PIN_USBOTG_NXT__USBOTG_NXT,
147 MX31_PIN_USBOTG_STP__USBOTG_STP,
148};
149
150/* USB OTG HS port */
151static int __init gpio_usbotg_hs_activate(void)
152{
153 int ret = mxc_iomux_setup_multiple_pins(usbotg_pins,
154 ARRAY_SIZE(usbotg_pins), "usbotg");
155
156 if (ret < 0) {
157 printk(KERN_ERR "Cannot set up OTG pins\n");
158 return ret;
159 }
160
161 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
162 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
163 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
164 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
165 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
166 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
167 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
168 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
169 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
170 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
171 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
172 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
173
174 return 0;
175}
176
177/* OTG config */
178static struct fsl_usb2_platform_data usb_pdata = {
179 .operating_mode = FSL_USB2_DR_DEVICE,
180 .phy_mode = FSL_USB2_PHY_ULPI,
181};
182
59static struct platform_device pcm037_flash = { 183static struct platform_device pcm037_flash = {
60 .name = "physmap-flash", 184 .name = "physmap-flash",
61 .id = 0, 185 .id = 0,
@@ -127,26 +251,8 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
127}; 251};
128 252
129#ifdef CONFIG_I2C_IMX 253#ifdef CONFIG_I2C_IMX
130static int i2c_1_pins[] = {
131 MX31_PIN_CSPI2_MOSI__SCL,
132 MX31_PIN_CSPI2_MISO__SDA,
133};
134
135static int pcm037_i2c_1_init(struct device *dev)
136{
137 return mxc_iomux_setup_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins),
138 "i2c-1");
139}
140
141static void pcm037_i2c_1_exit(struct device *dev)
142{
143 mxc_iomux_release_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins));
144}
145
146static struct imxi2c_platform_data pcm037_i2c_1_data = { 254static struct imxi2c_platform_data pcm037_i2c_1_data = {
147 .bitrate = 100000, 255 .bitrate = 100000,
148 .init = pcm037_i2c_1_init,
149 .exit = pcm037_i2c_1_exit,
150}; 256};
151 257
152static struct at24_platform_data board_eeprom = { 258static struct at24_platform_data board_eeprom = {
@@ -166,48 +272,119 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
166}; 272};
167#endif 273#endif
168 274
169static int sdhc1_pins[] = { 275/* Not connected by default */
170 MX31_PIN_SD1_DATA3__SD1_DATA3, 276#ifdef PCM970_SDHC_RW_SWITCH
171 MX31_PIN_SD1_DATA2__SD1_DATA2, 277static int pcm970_sdhc1_get_ro(struct device *dev)
172 MX31_PIN_SD1_DATA1__SD1_DATA1, 278{
173 MX31_PIN_SD1_DATA0__SD1_DATA0, 279 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_SFS6));
174 MX31_PIN_SD1_CLK__SD1_CLK, 280}
175 MX31_PIN_SD1_CMD__SD1_CMD, 281#endif
176}; 282
283#define SDHC1_GPIO_WP IOMUX_TO_GPIO(MX31_PIN_SFS6)
284#define SDHC1_GPIO_DET IOMUX_TO_GPIO(MX31_PIN_SCK6)
177 285
178static int pcm970_sdhc1_init(struct device *dev, irq_handler_t h, void *data) 286static int pcm970_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
287 void *data)
179{ 288{
180 return mxc_iomux_setup_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins), 289 int ret;
181 "sdhc-1"); 290
291 ret = gpio_request(SDHC1_GPIO_DET, "sdhc-detect");
292 if (ret)
293 return ret;
294
295 gpio_direction_input(SDHC1_GPIO_DET);
296
297#ifdef PCM970_SDHC_RW_SWITCH
298 ret = gpio_request(SDHC1_GPIO_WP, "sdhc-wp");
299 if (ret)
300 goto err_gpio_free;
301 gpio_direction_input(SDHC1_GPIO_WP);
302#endif
303
304 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq,
305 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
306 "sdhc-detect", data);
307 if (ret)
308 goto err_gpio_free_2;
309
310 return 0;
311
312err_gpio_free_2:
313#ifdef PCM970_SDHC_RW_SWITCH
314 gpio_free(SDHC1_GPIO_WP);
315err_gpio_free:
316#endif
317 gpio_free(SDHC1_GPIO_DET);
318
319 return ret;
182} 320}
183 321
184static void pcm970_sdhc1_exit(struct device *dev, void *data) 322static void pcm970_sdhc1_exit(struct device *dev, void *data)
185{ 323{
186 mxc_iomux_release_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins)); 324 free_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), data);
325 gpio_free(SDHC1_GPIO_DET);
326 gpio_free(SDHC1_GPIO_WP);
187} 327}
188 328
189/* No card and rw detection at the moment */
190static struct imxmmc_platform_data sdhc_pdata = { 329static struct imxmmc_platform_data sdhc_pdata = {
330#ifdef PCM970_SDHC_RW_SWITCH
331 .get_ro = pcm970_sdhc1_get_ro,
332#endif
191 .init = pcm970_sdhc1_init, 333 .init = pcm970_sdhc1_init,
192 .exit = pcm970_sdhc1_exit, 334 .exit = pcm970_sdhc1_exit,
193}; 335};
194 336
195static struct platform_device *devices[] __initdata = { 337static struct platform_device *devices[] __initdata = {
196 &pcm037_flash, 338 &pcm037_flash,
197 &pcm037_eth,
198 &pcm037_sram_device, 339 &pcm037_sram_device,
199}; 340};
200 341
201static int uart0_pins[] = { 342static struct ipu_platform_data mx3_ipu_data = {
202 MX31_PIN_CTS1__CTS1, 343 .irq_base = MXC_IPU_IRQ_START,
203 MX31_PIN_RTS1__RTS1,
204 MX31_PIN_TXD1__TXD1,
205 MX31_PIN_RXD1__RXD1
206}; 344};
207 345
208static int uart2_pins[] = { 346static const struct fb_videomode fb_modedb[] = {
209 MX31_PIN_CSPI3_MOSI__RXD3, 347 {
210 MX31_PIN_CSPI3_MISO__TXD3 348 /* 240x320 @ 60 Hz Sharp */
349 .name = "Sharp-LQ035Q7DH06-QVGA",
350 .refresh = 60,
351 .xres = 240,
352 .yres = 320,
353 .pixclock = 185925,
354 .left_margin = 9,
355 .right_margin = 16,
356 .upper_margin = 7,
357 .lower_margin = 9,
358 .hsync_len = 1,
359 .vsync_len = 1,
360 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE |
361 FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN,
362 .vmode = FB_VMODE_NONINTERLACED,
363 .flag = 0,
364 }, {
365 /* 240x320 @ 60 Hz */
366 .name = "TX090",
367 .refresh = 60,
368 .xres = 240,
369 .yres = 320,
370 .pixclock = 38255,
371 .left_margin = 144,
372 .right_margin = 0,
373 .upper_margin = 7,
374 .lower_margin = 40,
375 .hsync_len = 96,
376 .vsync_len = 1,
377 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
378 .vmode = FB_VMODE_NONINTERLACED,
379 .flag = 0,
380 },
381};
382
383static struct mx3fb_platform_data mx3fb_pdata = {
384 .dma_dev = &mx3_ipu.dev,
385 .name = "Sharp-LQ035Q7DH06-QVGA",
386 .mode = fb_modedb,
387 .num_modes = ARRAY_SIZE(fb_modedb),
211}; 388};
212 389
213/* 390/*
@@ -215,21 +392,28 @@ static int uart2_pins[] = {
215 */ 392 */
216static void __init mxc_board_init(void) 393static void __init mxc_board_init(void)
217{ 394{
395 int ret;
396
397 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
398 "pcm037");
399
218 platform_add_devices(devices, ARRAY_SIZE(devices)); 400 platform_add_devices(devices, ARRAY_SIZE(devices));
219 401
220 mxc_iomux_setup_multiple_pins(uart0_pins, ARRAY_SIZE(uart0_pins), "uart-0");
221 mxc_register_device(&mxc_uart_device0, &uart_pdata); 402 mxc_register_device(&mxc_uart_device0, &uart_pdata);
222 403 mxc_register_device(&mxc_uart_device1, &uart_pdata);
223 mxc_iomux_setup_multiple_pins(uart2_pins, ARRAY_SIZE(uart2_pins), "uart-2");
224 mxc_register_device(&mxc_uart_device2, &uart_pdata); 404 mxc_register_device(&mxc_uart_device2, &uart_pdata);
225 405
226 mxc_iomux_setup_pin(MX31_PIN_BATT_LINE__OWIRE, "batt-0wire");
227 mxc_register_device(&mxc_w1_master_device, NULL); 406 mxc_register_device(&mxc_w1_master_device, NULL);
228 407
229 /* LAN9217 IRQ pin */ 408 /* LAN9217 IRQ pin */
230 if (!mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO), 409 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq");
231 "pcm037-eth")) 410 if (ret)
411 pr_warning("could not get LAN irq gpio\n");
412 else {
232 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); 413 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
414 platform_device_register(&pcm037_eth);
415 }
416
233 417
234#ifdef CONFIG_I2C_IMX 418#ifdef CONFIG_I2C_IMX
235 i2c_register_board_info(1, pcm037_i2c_devices, 419 i2c_register_board_info(1, pcm037_i2c_devices,
@@ -239,6 +423,10 @@ static void __init mxc_board_init(void)
239#endif 423#endif
240 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 424 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
241 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); 425 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
426 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
427 mxc_register_device(&mx3_fb, &mx3fb_pdata);
428 if (!gpio_usbotg_hs_activate())
429 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
242} 430}
243 431
244static void __init pcm037_timer_init(void) 432static void __init pcm037_timer_init(void)
@@ -255,7 +443,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
255 .phys_io = AIPS1_BASE_ADDR, 443 .phys_io = AIPS1_BASE_ADDR,
256 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 444 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
257 .boot_params = PHYS_OFFSET + 0x100, 445 .boot_params = PHYS_OFFSET + 0x100,
258 .map_io = mxc_map_io, 446 .map_io = mx31_map_io,
259 .init_irq = mxc_init_irq, 447 .init_irq = mxc_init_irq,
260 .init_machine = mxc_board_init, 448 .init_machine = mxc_board_init,
261 .timer = &pcm037_timer, 449 .timer = &pcm037_timer,
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c
new file mode 100644
index 000000000000..8d27c324abf2
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm043.c
@@ -0,0 +1,252 @@
1/*
2 * Copyright (C) 2009 Sascha Hauer, Pengutronix
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/types.h>
20#include <linux/init.h>
21
22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h>
24#include <linux/mtd/plat-ram.h>
25#include <linux/memory.h>
26#include <linux/gpio.h>
27#include <linux/smc911x.h>
28#include <linux/interrupt.h>
29#include <linux/i2c.h>
30#include <linux/i2c/at24.h>
31
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/time.h>
35#include <asm/mach/map.h>
36
37#include <mach/hardware.h>
38#include <mach/common.h>
39#include <mach/imx-uart.h>
40#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
41#include <mach/i2c.h>
42#endif
43#include <mach/iomux-mx35.h>
44#include <mach/ipu.h>
45#include <mach/mx3fb.h>
46
47#include "devices.h"
48
49static const struct fb_videomode fb_modedb[] = {
50 {
51 /* 240x320 @ 60 Hz */
52 .name = "Sharp-LQ035Q7",
53 .refresh = 60,
54 .xres = 240,
55 .yres = 320,
56 .pixclock = 185925,
57 .left_margin = 9,
58 .right_margin = 16,
59 .upper_margin = 7,
60 .lower_margin = 9,
61 .hsync_len = 1,
62 .vsync_len = 1,
63 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE | FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN,
64 .vmode = FB_VMODE_NONINTERLACED,
65 .flag = 0,
66 }, {
67 /* 240x320 @ 60 Hz */
68 .name = "TX090",
69 .refresh = 60,
70 .xres = 240,
71 .yres = 320,
72 .pixclock = 38255,
73 .left_margin = 144,
74 .right_margin = 0,
75 .upper_margin = 7,
76 .lower_margin = 40,
77 .hsync_len = 96,
78 .vsync_len = 1,
79 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
80 .vmode = FB_VMODE_NONINTERLACED,
81 .flag = 0,
82 },
83};
84
85static struct ipu_platform_data mx3_ipu_data = {
86 .irq_base = MXC_IPU_IRQ_START,
87};
88
89static struct mx3fb_platform_data mx3fb_pdata = {
90 .dma_dev = &mx3_ipu.dev,
91 .name = "Sharp-LQ035Q7",
92 .mode = fb_modedb,
93 .num_modes = ARRAY_SIZE(fb_modedb),
94};
95
96static struct physmap_flash_data pcm043_flash_data = {
97 .width = 2,
98};
99
100static struct resource pcm043_flash_resource = {
101 .start = 0xa0000000,
102 .end = 0xa1ffffff,
103 .flags = IORESOURCE_MEM,
104};
105
106static struct platform_device pcm043_flash = {
107 .name = "physmap-flash",
108 .id = 0,
109 .dev = {
110 .platform_data = &pcm043_flash_data,
111 },
112 .resource = &pcm043_flash_resource,
113 .num_resources = 1,
114};
115
116static struct imxuart_platform_data uart_pdata = {
117 .flags = IMXUART_HAVE_RTSCTS,
118};
119
120#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
121static struct imxi2c_platform_data pcm043_i2c_1_data = {
122 .bitrate = 50000,
123};
124
125static struct at24_platform_data board_eeprom = {
126 .byte_len = 4096,
127 .page_size = 32,
128 .flags = AT24_FLAG_ADDR16,
129};
130
131static struct i2c_board_info pcm043_i2c_devices[] = {
132 {
133 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
134 .platform_data = &board_eeprom,
135 }, {
136 I2C_BOARD_INFO("rtc-pcf8563", 0x51),
137 .type = "pcf8563",
138 }
139};
140#endif
141
142static struct platform_device *devices[] __initdata = {
143 &pcm043_flash,
144 &mxc_fec_device,
145};
146
147static struct pad_desc pcm043_pads[] = {
148 /* UART1 */
149 MX35_PAD_CTS1__UART1_CTS,
150 MX35_PAD_RTS1__UART1_RTS,
151 MX35_PAD_TXD1__UART1_TXD_MUX,
152 MX35_PAD_RXD1__UART1_RXD_MUX,
153 /* UART2 */
154 MX35_PAD_CTS2__UART2_CTS,
155 MX35_PAD_RTS2__UART2_RTS,
156 MX35_PAD_TXD2__UART2_TXD_MUX,
157 MX35_PAD_RXD2__UART2_RXD_MUX,
158 /* FEC */
159 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
160 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
161 MX35_PAD_FEC_RX_DV__FEC_RX_DV,
162 MX35_PAD_FEC_COL__FEC_COL,
163 MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
164 MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
165 MX35_PAD_FEC_TX_EN__FEC_TX_EN,
166 MX35_PAD_FEC_MDC__FEC_MDC,
167 MX35_PAD_FEC_MDIO__FEC_MDIO,
168 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
169 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
170 MX35_PAD_FEC_CRS__FEC_CRS,
171 MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
172 MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
173 MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
174 MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
175 MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
176 MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
177 /* I2C1 */
178 MX35_PAD_I2C1_CLK__I2C1_SCL,
179 MX35_PAD_I2C1_DAT__I2C1_SDA,
180 /* Display */
181 MX35_PAD_LD0__IPU_DISPB_DAT_0,
182 MX35_PAD_LD1__IPU_DISPB_DAT_1,
183 MX35_PAD_LD2__IPU_DISPB_DAT_2,
184 MX35_PAD_LD3__IPU_DISPB_DAT_3,
185 MX35_PAD_LD4__IPU_DISPB_DAT_4,
186 MX35_PAD_LD5__IPU_DISPB_DAT_5,
187 MX35_PAD_LD6__IPU_DISPB_DAT_6,
188 MX35_PAD_LD7__IPU_DISPB_DAT_7,
189 MX35_PAD_LD8__IPU_DISPB_DAT_8,
190 MX35_PAD_LD9__IPU_DISPB_DAT_9,
191 MX35_PAD_LD10__IPU_DISPB_DAT_10,
192 MX35_PAD_LD11__IPU_DISPB_DAT_11,
193 MX35_PAD_LD12__IPU_DISPB_DAT_12,
194 MX35_PAD_LD13__IPU_DISPB_DAT_13,
195 MX35_PAD_LD14__IPU_DISPB_DAT_14,
196 MX35_PAD_LD15__IPU_DISPB_DAT_15,
197 MX35_PAD_LD16__IPU_DISPB_DAT_16,
198 MX35_PAD_LD17__IPU_DISPB_DAT_17,
199 MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC,
200 MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
201 MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
202 MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
203 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
204 MX35_PAD_D3_REV__IPU_DISPB_D3_REV,
205 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
206 MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL
207};
208
209/*
210 * Board specific initialization.
211 */
212static void __init mxc_board_init(void)
213{
214 mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
215
216 platform_add_devices(devices, ARRAY_SIZE(devices));
217
218 mxc_register_device(&mxc_uart_device0, &uart_pdata);
219
220 mxc_register_device(&mxc_uart_device1, &uart_pdata);
221
222#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
223 i2c_register_board_info(0, pcm043_i2c_devices,
224 ARRAY_SIZE(pcm043_i2c_devices));
225
226 mxc_register_device(&mxc_i2c_device0, &pcm043_i2c_1_data);
227#endif
228
229 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
230 mxc_register_device(&mx3_fb, &mx3fb_pdata);
231}
232
233static void __init pcm043_timer_init(void)
234{
235 mx35_clocks_init();
236}
237
238struct sys_timer pcm043_timer = {
239 .init = pcm043_timer_init,
240};
241
242MACHINE_START(PCM043, "Phytec Phycore pcm043")
243 /* Maintainer: Pengutronix */
244 .phys_io = AIPS1_BASE_ADDR,
245 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
246 .boot_params = PHYS_OFFSET + 0x100,
247 .map_io = mx35_map_io,
248 .init_irq = mxc_init_irq,
249 .init_machine = mxc_board_init,
250 .timer = &pcm043_timer,
251MACHINE_END
252
diff --git a/arch/arm/mach-mx3/qong.c b/arch/arm/mach-mx3/qong.c
index 5a01e48fd8f1..82b31c4ab11f 100644
--- a/arch/arm/mach-mx3/qong.c
+++ b/arch/arm/mach-mx3/qong.c
@@ -279,7 +279,7 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
279 .phys_io = AIPS1_BASE_ADDR, 279 .phys_io = AIPS1_BASE_ADDR,
280 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 280 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
281 .boot_params = PHYS_OFFSET + 0x100, 281 .boot_params = PHYS_OFFSET + 0x100,
282 .map_io = mxc_map_io, 282 .map_io = mx31_map_io,
283 .init_irq = mxc_init_irq, 283 .init_irq = mxc_init_irq,
284 .init_machine = mxc_board_init, 284 .init_machine = mxc_board_init,
285 .timer = &qong_timer, 285 .timer = &qong_timer,
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index 79df60c20e70..43da8bb4926b 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -168,7 +168,7 @@ void __init netx_init_irq(void)
168{ 168{
169 int irq; 169 int irq;
170 170
171 vic_init(__io(io_p2v(NETX_PA_VIC)), 0, ~0); 171 vic_init(__io(io_p2v(NETX_PA_VIC)), 0, ~0, 0);
172 172
173 for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) { 173 for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) {
174 set_irq_chip(irq, &netx_hif_chip); 174 set_irq_chip(irq, &netx_hif_chip);
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index cd8de89c5fad..55ecc01ea206 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -46,7 +46,6 @@ config MACH_OMAP_H2
46config MACH_OMAP_H3 46config MACH_OMAP_H3
47 bool "TI H3 Support" 47 bool "TI H3 Support"
48 depends on ARCH_OMAP1 && ARCH_OMAP16XX 48 depends on ARCH_OMAP1 && ARCH_OMAP16XX
49# select GPIOEXPANDER_OMAP
50 help 49 help
51 TI OMAP 1710 H3 board support. Say Y here if you have such 50 TI OMAP 1710 H3 board support. Say Y here if you have such
52 a board. 51 a board.
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 1bda8f5d7546..6867cd3ad0b4 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -13,6 +13,10 @@ obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o
13# Power Management 13# Power Management
14obj-$(CONFIG_PM) += pm.o sleep.o 14obj-$(CONFIG_PM) += pm.o sleep.o
15 15
16# DSP
17obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
18mailbox_mach-objs := mailbox.o
19
16led-y := leds.o 20led-y := leds.o
17 21
18# Specific board support 22# Specific board support
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index d1ed1365319e..e70fc7c66bbb 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -33,8 +33,11 @@
33#include <mach/common.h> 33#include <mach/common.h>
34#include <mach/dsp_common.h> 34#include <mach/dsp_common.h>
35#include <mach/omapfb.h> 35#include <mach/omapfb.h>
36#include <mach/hwa742.h>
36#include <mach/lcd_mipid.h> 37#include <mach/lcd_mipid.h>
37#include <mach/mmc.h> 38#include <mach/mmc.h>
39#include <mach/usb.h>
40#include <mach/clock.h>
38 41
39#define ADS7846_PENDOWN_GPIO 15 42#define ADS7846_PENDOWN_GPIO 15
40 43
@@ -162,6 +165,15 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
162 }, 165 },
163}; 166};
164 167
168static struct hwa742_platform_data nokia770_hwa742_platform_data = {
169 .te_connected = 1,
170};
171
172static void hwa742_dev_init(void)
173{
174 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
175 omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
176}
165 177
166/* assume no Mini-AB port */ 178/* assume no Mini-AB port */
167 179
@@ -370,6 +382,7 @@ static void __init omap_nokia770_init(void)
370 omap_serial_init(); 382 omap_serial_init();
371 omap_register_i2c_bus(1, 100, NULL, 0); 383 omap_register_i2c_bus(1, 100, NULL, 0);
372 omap_dsp_init(); 384 omap_dsp_init();
385 hwa742_dev_init();
373 ads7846_dev_init(); 386 ads7846_dev_init();
374 mipid_dev_init(); 387 mipid_dev_init();
375 omap_usb_init(&nokia770_usb_config); 388 omap_usb_init(&nokia770_usb_config);
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 336e51dc6127..436eed22801b 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -776,7 +776,7 @@ int __init omap1_clk_init(void)
776 arm_idlect1_mask = ~0; 776 arm_idlect1_mask = ~0;
777 777
778 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++) 778 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
779 clk_init_one(c->lk.clk); 779 clk_preinit(c->lk.clk);
780 780
781 cpu_mask = 0; 781 cpu_mask = 0;
782 if (cpu_is_omap16xx()) 782 if (cpu_is_omap16xx())
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 9774c1f5311e..5218943c91c0 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -53,11 +53,12 @@
53#include <mach/clock.h> 53#include <mach/clock.h>
54#include <mach/sram.h> 54#include <mach/sram.h>
55#include <mach/tc.h> 55#include <mach/tc.h>
56#include <mach/pm.h>
57#include <mach/mux.h> 56#include <mach/mux.h>
58#include <mach/dma.h> 57#include <mach/dma.h>
59#include <mach/dmtimer.h> 58#include <mach/dmtimer.h>
60 59
60#include "pm.h"
61
61static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 62static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
62static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; 63static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
63static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; 64static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE];
@@ -101,7 +102,7 @@ static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;
101 * going idle we continue to do idle even if we get 102 * going idle we continue to do idle even if we get
102 * a clock tick interrupt . . 103 * a clock tick interrupt . .
103 */ 104 */
104void omap_pm_idle(void) 105void omap1_pm_idle(void)
105{ 106{
106 extern __u32 arm_idlect1_mask; 107 extern __u32 arm_idlect1_mask;
107 __u32 use_idlect1 = arm_idlect1_mask; 108 __u32 use_idlect1 = arm_idlect1_mask;
@@ -222,7 +223,7 @@ static void omap_pm_wakeup_setup(void)
222#define EN_APICK 6 /* ARM_IDLECT2 */ 223#define EN_APICK 6 /* ARM_IDLECT2 */
223#define DSP_EN 1 /* ARM_RSTCT1 */ 224#define DSP_EN 1 /* ARM_RSTCT1 */
224 225
225void omap_pm_suspend(void) 226void omap1_pm_suspend(void)
226{ 227{
227 unsigned long arg0 = 0, arg1 = 0; 228 unsigned long arg0 = 0, arg1 = 0;
228 229
@@ -610,7 +611,7 @@ static int omap_pm_enter(suspend_state_t state)
610 { 611 {
611 case PM_SUSPEND_STANDBY: 612 case PM_SUSPEND_STANDBY:
612 case PM_SUSPEND_MEM: 613 case PM_SUSPEND_MEM:
613 omap_pm_suspend(); 614 omap1_pm_suspend();
614 break; 615 break;
615 default: 616 default:
616 return -EINVAL; 617 return -EINVAL;
@@ -683,7 +684,7 @@ static int __init omap_pm_init(void)
683 return -ENODEV; 684 return -ENODEV;
684 } 685 }
685 686
686 pm_idle = omap_pm_idle; 687 pm_idle = omap1_pm_idle;
687 688
688 if (cpu_is_omap730()) 689 if (cpu_is_omap730())
689 setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); 690 setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq);
diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/mach-omap1/pm.h
index ce6ee7927537..9ed5e2c1de4d 100644
--- a/arch/arm/plat-omap/include/mach/pm.h
+++ b/arch/arm/mach-omap1/pm.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/pm.h 2 * arch/arm/mach-omap1/pm.h
3 * 3 *
4 * Header file for OMAP Power Management Routines 4 * Header file for OMAP1 Power Management Routines
5 * 5 *
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc.
7 * support@mvista.com 7 * support@mvista.com
@@ -31,8 +31,8 @@
31 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */ 32 */
33 33
34#ifndef __ASM_ARCH_OMAP_PM_H 34#ifndef __ARCH_ARM_MACH_OMAP1_PM_H
35#define __ASM_ARCH_OMAP_PM_H 35#define __ARCH_ARM_MACH_OMAP1_PM_H
36 36
37/* 37/*
38 * ---------------------------------------------------------------------------- 38 * ----------------------------------------------------------------------------
@@ -106,8 +106,7 @@
106 106
107#if !defined(CONFIG_ARCH_OMAP730) && \ 107#if !defined(CONFIG_ARCH_OMAP730) && \
108 !defined(CONFIG_ARCH_OMAP15XX) && \ 108 !defined(CONFIG_ARCH_OMAP15XX) && \
109 !defined(CONFIG_ARCH_OMAP16XX) && \ 109 !defined(CONFIG_ARCH_OMAP16XX)
110 !defined(CONFIG_ARCH_OMAP24XX)
111#warning "Power management for this processor not implemented yet" 110#warning "Power management for this processor not implemented yet"
112#endif 111#endif
113 112
@@ -115,29 +114,27 @@
115 114
116#include <linux/clk.h> 115#include <linux/clk.h>
117 116
117extern struct kset power_subsys;
118
118extern void prevent_idle_sleep(void); 119extern void prevent_idle_sleep(void);
119extern void allow_idle_sleep(void); 120extern void allow_idle_sleep(void);
120 121
121extern void omap_pm_idle(void); 122extern void omap1_pm_idle(void);
122extern void omap_pm_suspend(void); 123extern void omap1_pm_suspend(void);
124
123extern void omap730_cpu_suspend(unsigned short, unsigned short); 125extern void omap730_cpu_suspend(unsigned short, unsigned short);
124extern void omap1510_cpu_suspend(unsigned short, unsigned short); 126extern void omap1510_cpu_suspend(unsigned short, unsigned short);
125extern void omap1610_cpu_suspend(unsigned short, unsigned short); 127extern void omap1610_cpu_suspend(unsigned short, unsigned short);
126extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
127 void __iomem *sdrc_power);
128extern void omap730_idle_loop_suspend(void); 128extern void omap730_idle_loop_suspend(void);
129extern void omap1510_idle_loop_suspend(void); 129extern void omap1510_idle_loop_suspend(void);
130extern void omap1610_idle_loop_suspend(void); 130extern void omap1610_idle_loop_suspend(void);
131extern void omap24xx_idle_loop_suspend(void);
132 131
133extern unsigned int omap730_cpu_suspend_sz; 132extern unsigned int omap730_cpu_suspend_sz;
134extern unsigned int omap1510_cpu_suspend_sz; 133extern unsigned int omap1510_cpu_suspend_sz;
135extern unsigned int omap1610_cpu_suspend_sz; 134extern unsigned int omap1610_cpu_suspend_sz;
136extern unsigned int omap24xx_cpu_suspend_sz;
137extern unsigned int omap730_idle_loop_suspend_sz; 135extern unsigned int omap730_idle_loop_suspend_sz;
138extern unsigned int omap1510_idle_loop_suspend_sz; 136extern unsigned int omap1510_idle_loop_suspend_sz;
139extern unsigned int omap1610_idle_loop_suspend_sz; 137extern unsigned int omap1610_idle_loop_suspend_sz;
140extern unsigned int omap24xx_idle_loop_suspend_sz;
141 138
142#ifdef CONFIG_OMAP_SERIAL_WAKE 139#ifdef CONFIG_OMAP_SERIAL_WAKE
143extern void omap_serial_wake_trigger(int enable); 140extern void omap_serial_wake_trigger(int enable);
@@ -170,10 +167,6 @@ extern void omap_serial_wake_trigger(int enable);
170#define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) 167#define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x))
171#define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] 168#define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]
172 169
173#define OMAP24XX_SAVE(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] = x
174#define OMAP24XX_RESTORE(x) x = omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x]
175#define OMAP24XX_SHOW(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x]
176
177/* 170/*
178 * List of global OMAP registers to preserve. 171 * List of global OMAP registers to preserve.
179 * More ones like CP and general purpose register values are preserved 172 * More ones like CP and general purpose register values are preserved
@@ -283,63 +276,5 @@ enum mpui1610_save_state {
283#endif 276#endif
284}; 277};
285 278
286enum omap24xx_save_state {
287 OMAP24XX_SLEEP_SAVE_START = 0,
288 OMAP24XX_SLEEP_SAVE_INTC_MIR0,
289 OMAP24XX_SLEEP_SAVE_INTC_MIR1,
290 OMAP24XX_SLEEP_SAVE_INTC_MIR2,
291
292 OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MPU,
293 OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_CORE,
294 OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_GFX,
295 OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_DSP,
296 OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MDM,
297
298 OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MPU,
299 OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_CORE,
300 OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_GFX,
301 OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_DSP,
302 OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MDM,
303
304 OMAP24XX_SLEEP_SAVE_CM_IDLEST1_CORE,
305 OMAP24XX_SLEEP_SAVE_CM_IDLEST2_CORE,
306 OMAP24XX_SLEEP_SAVE_CM_IDLEST3_CORE,
307 OMAP24XX_SLEEP_SAVE_CM_IDLEST4_CORE,
308 OMAP24XX_SLEEP_SAVE_CM_IDLEST_GFX,
309 OMAP24XX_SLEEP_SAVE_CM_IDLEST_WKUP,
310 OMAP24XX_SLEEP_SAVE_CM_IDLEST_CKGEN,
311 OMAP24XX_SLEEP_SAVE_CM_IDLEST_DSP,
312 OMAP24XX_SLEEP_SAVE_CM_IDLEST_MDM,
313
314 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE1_CORE,
315 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE2_CORE,
316 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE3_CORE,
317 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE4_CORE,
318 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_WKUP,
319 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_PLL,
320 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_DSP,
321 OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_MDM,
322
323 OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE,
324 OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE,
325 OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE,
326 OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE,
327 OMAP24XX_SLEEP_SAVE_CM_ICLKEN3_CORE,
328 OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE,
329 OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1,
330 OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1,
331 OMAP24XX_SLEEP_SAVE_GPIO3_IRQENABLE1,
332 OMAP24XX_SLEEP_SAVE_GPIO4_IRQENABLE1,
333 OMAP24XX_SLEEP_SAVE_GPIO3_OE,
334 OMAP24XX_SLEEP_SAVE_GPIO4_OE,
335 OMAP24XX_SLEEP_SAVE_GPIO3_RISINGDETECT,
336 OMAP24XX_SLEEP_SAVE_GPIO3_FALLINGDETECT,
337 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SPI1_NCS2,
338 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_MCBSP1_DX,
339 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SSI1_FLAG_TX,
340 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SYS_NIRQW0,
341 OMAP24XX_SLEEP_SAVE_SIZE
342};
343
344#endif /* ASSEMBLER */ 279#endif /* ASSEMBLER */
345#endif /* __ASM_ARCH_OMAP_PM_H */ 280#endif /* __ASM_ARCH_OMAP_PM_H */
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 842090b148f1..f754cee4f3c3 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -26,9 +26,6 @@
26#include <mach/mux.h> 26#include <mach/mux.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/fpga.h> 28#include <mach/fpga.h>
29#ifdef CONFIG_PM
30#include <mach/pm.h>
31#endif
32 29
33static struct clk * uart1_ck; 30static struct clk * uart1_ck;
34static struct clk * uart2_ck; 31static struct clk * uart2_ck;
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
index f3eac932092d..22e8568339b0 100644
--- a/arch/arm/mach-omap1/sleep.S
+++ b/arch/arm/mach-omap1/sleep.S
@@ -35,7 +35,7 @@
35#include <linux/linkage.h> 35#include <linux/linkage.h>
36#include <asm/assembler.h> 36#include <asm/assembler.h>
37#include <mach/io.h> 37#include <mach/io.h>
38#include <mach/pm.h> 38#include "pm.h"
39 39
40 .text 40 .text
41 41
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 64ab386a65c7..a755eb5e2361 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -25,7 +25,7 @@ config ARCH_OMAP3430
25 select ARCH_OMAP_OTG 25 select ARCH_OMAP_OTG
26 26
27comment "OMAP Board Type" 27comment "OMAP Board Type"
28 depends on ARCH_OMAP2 || ARCH_OMAP3 28 depends on ARCH_OMAP2 || ARCH_OMAP3 || ARCH_OMAP4
29 29
30config MACH_OMAP_GENERIC 30config MACH_OMAP_GENERIC
31 bool "Generic OMAP board" 31 bool "Generic OMAP board"
@@ -56,6 +56,10 @@ config MACH_OVERO
56 bool "Gumstix Overo board" 56 bool "Gumstix Overo board"
57 depends on ARCH_OMAP3 && ARCH_OMAP34XX 57 depends on ARCH_OMAP3 && ARCH_OMAP34XX
58 58
59config MACH_OMAP3EVM
60 bool "OMAP 3530 EVM board"
61 depends on ARCH_OMAP3 && ARCH_OMAP34XX
62
59config MACH_OMAP3_PANDORA 63config MACH_OMAP3_PANDORA
60 bool "OMAP3 Pandora" 64 bool "OMAP3 Pandora"
61 depends on ARCH_OMAP3 && ARCH_OMAP34XX 65 depends on ARCH_OMAP3 && ARCH_OMAP34XX
@@ -67,3 +71,11 @@ config MACH_OMAP_3430SDP
67config MACH_NOKIA_RX51 71config MACH_NOKIA_RX51
68 bool "Nokia RX-51 board" 72 bool "Nokia RX-51 board"
69 depends on ARCH_OMAP3 && ARCH_OMAP34XX 73 depends on ARCH_OMAP3 && ARCH_OMAP34XX
74
75config MACH_OMAP_ZOOM2
76 bool "OMAP3 Zoom2 board"
77 depends on ARCH_OMAP3 && ARCH_OMAP34XX
78
79config MACH_OMAP_4430SDP
80 bool "OMAP 4430 SDP board"
81 depends on ARCH_OMAP4
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index c49d9bfa3abd..735bae5b0dec 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -3,12 +3,21 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := irq.o id.o io.o sdrc.o control.o prcm.o clock.o mux.o \ 6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o
7 devices.o serial.o gpmc.o timer-gp.o powerdomain.o \ 7
8 clockdomain.o 8omap-2-3-common = irq.o sdrc.o
9prcm-common = prcm.o powerdomain.o
10clock-common = clock.o clockdomain.o
11
12obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(clock-common)
13obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(clock-common)
9 14
10obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 15obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
11 16
17# SMP support ONLY available for OMAP4
18obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o
19obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o
20
12# Functions loaded to SRAM 21# Functions loaded to SRAM
13obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o 22obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o
14obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o 23obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o
@@ -20,14 +29,21 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
20 29
21# Power Management 30# Power Management
22ifeq ($(CONFIG_PM),y) 31ifeq ($(CONFIG_PM),y)
23obj-y += pm.o 32obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
24obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o 33obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o
34obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o
35obj-$(CONFIG_PM_DEBUG) += pm-debug.o
25endif 36endif
26 37
27# Clock framework 38# Clock framework
28obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o 39obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o
29obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o 40obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o
30 41
42iommu-y += iommu2.o
43iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o
44
45obj-$(CONFIG_OMAP_IOMMU) += $(iommu-y)
46
31# Specific board support 47# Specific board support
32obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 48obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
33obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 49obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
@@ -40,6 +56,8 @@ obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \
40 mmc-twl4030.o 56 mmc-twl4030.o
41obj-$(CONFIG_MACH_OVERO) += board-overo.o \ 57obj-$(CONFIG_MACH_OVERO) += board-overo.o \
42 mmc-twl4030.o 58 mmc-twl4030.o
59obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \
60 mmc-twl4030.o
43obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ 61obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \
44 mmc-twl4030.o 62 mmc-twl4030.o
45obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ 63obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
@@ -48,8 +66,17 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
48obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 66obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
49 board-rx51-peripherals.o \ 67 board-rx51-peripherals.o \
50 mmc-twl4030.o 68 mmc-twl4030.o
69obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \
70 mmc-twl4030.o \
71 board-zoom-debugboard.o
72
73obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
51 74
52# Platform specific device init code 75# Platform specific device init code
53ifeq ($(CONFIG_USB_MUSB_SOC),y)
54obj-y += usb-musb.o 76obj-y += usb-musb.o
55endif 77
78onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o
79obj-y += $(onenand-m) $(onenand-y)
80
81smc91x-$(CONFIG_SMC91X) := gpmc-smc91x.o
82obj-y += $(smc91x-m) $(smc91x-y)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 22143651037e..9c3fdcdf76c3 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -36,14 +36,12 @@
36#include <mach/common.h> 36#include <mach/common.h>
37#include <mach/gpmc.h> 37#include <mach/gpmc.h>
38#include <mach/usb.h> 38#include <mach/usb.h>
39#include <mach/gpmc-smc91x.h>
39 40
40#include "mmc-twl4030.h" 41#include "mmc-twl4030.h"
41 42
42#define SDP2430_CS0_BASE 0x04000000 43#define SDP2430_CS0_BASE 0x04000000
43#define SDP2430_FLASH_CS 0 44#define SECONDARY_LCD_GPIO 147
44#define SDP2430_SMC91X_CS 5
45
46#define SDP2430_ETHR_GPIO_IRQ 149
47 45
48static struct mtd_partition sdp2430_partitions[] = { 46static struct mtd_partition sdp2430_partitions[] = {
49 /* bootloader (U-Boot, etc) in first sector */ 47 /* bootloader (U-Boot, etc) in first sector */
@@ -99,100 +97,53 @@ static struct platform_device sdp2430_flash_device = {
99 .resource = &sdp2430_flash_resource, 97 .resource = &sdp2430_flash_resource,
100}; 98};
101 99
102static struct resource sdp2430_smc91x_resources[] = { 100static struct platform_device sdp2430_lcd_device = {
103 [0] = { 101 .name = "sdp2430_lcd",
104 .start = SDP2430_CS0_BASE,
105 .end = SDP2430_CS0_BASE + SZ_64M - 1,
106 .flags = IORESOURCE_MEM,
107 },
108 [1] = {
109 .start = OMAP_GPIO_IRQ(SDP2430_ETHR_GPIO_IRQ),
110 .end = OMAP_GPIO_IRQ(SDP2430_ETHR_GPIO_IRQ),
111 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
112 },
113};
114
115static struct platform_device sdp2430_smc91x_device = {
116 .name = "smc91x",
117 .id = -1, 102 .id = -1,
118 .num_resources = ARRAY_SIZE(sdp2430_smc91x_resources),
119 .resource = sdp2430_smc91x_resources,
120}; 103};
121 104
122static struct platform_device *sdp2430_devices[] __initdata = { 105static struct platform_device *sdp2430_devices[] __initdata = {
123 &sdp2430_smc91x_device,
124 &sdp2430_flash_device, 106 &sdp2430_flash_device,
107 &sdp2430_lcd_device,
125}; 108};
126 109
127static inline void __init sdp2430_init_smc91x(void) 110static struct omap_lcd_config sdp2430_lcd_config __initdata = {
128{ 111 .ctrl_name = "internal",
129 int eth_cs; 112};
130 unsigned long cs_mem_base;
131 unsigned int rate;
132 struct clk *gpmc_fck;
133 113
134 eth_cs = SDP2430_SMC91X_CS; 114#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)
135 115
136 gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */ 116static struct omap_smc91x_platform_data board_smc91x_data = {
137 if (IS_ERR(gpmc_fck)) { 117 .cs = 5,
138 WARN_ON(1); 118 .gpio_irq = 149,
139 return; 119 .flags = GPMC_MUX_ADD_DATA | GPMC_TIMINGS_SMC91C96 |
140 } 120 IORESOURCE_IRQ_LOWLEVEL,
141 121
142 clk_enable(gpmc_fck); 122};
143 rate = clk_get_rate(gpmc_fck);
144
145 /* Make sure CS1 timings are correct, for 2430 always muxed */
146 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
147
148 if (rate >= 160000000) {
149 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
150 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
151 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
152 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
153 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
154 } else if (rate >= 130000000) {
155 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
156 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
157 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
158 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
159 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
160 } else { /* rate = 100000000 */
161 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
162 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
163 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
164 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
165 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
166 }
167 123
168 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { 124static void __init board_smc91x_init(void)
169 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); 125{
170 goto out; 126 if (omap_rev() > OMAP3430_REV_ES1_0)
171 } 127 board_smc91x_data.gpio_irq = 6;
128 else
129 board_smc91x_data.gpio_irq = 29;
172 130
173 sdp2430_smc91x_resources[0].start = cs_mem_base + 0x300; 131 gpmc_smc91x_init(&board_smc91x_data);
174 sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f; 132}
175 udelay(100);
176 133
177 if (gpio_request(SDP2430_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { 134#else
178 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
179 SDP2430_ETHR_GPIO_IRQ);
180 gpmc_cs_free(eth_cs);
181 goto out;
182 }
183 gpio_direction_input(SDP2430_ETHR_GPIO_IRQ);
184 135
185out: 136static inline void board_smc91x_init(void)
186 clk_disable(gpmc_fck); 137{
187 clk_put(gpmc_fck);
188} 138}
189 139
140#endif
141
190static void __init omap_2430sdp_init_irq(void) 142static void __init omap_2430sdp_init_irq(void)
191{ 143{
192 omap2_init_common_hw(NULL); 144 omap2_init_common_hw(NULL);
193 omap_init_irq(); 145 omap_init_irq();
194 omap_gpio_init(); 146 omap_gpio_init();
195 sdp2430_init_smc91x();
196} 147}
197 148
198static struct omap_uart_config sdp2430_uart_config __initdata = { 149static struct omap_uart_config sdp2430_uart_config __initdata = {
@@ -201,6 +152,7 @@ static struct omap_uart_config sdp2430_uart_config __initdata = {
201 152
202static struct omap_board_config_kernel sdp2430_config[] = { 153static struct omap_board_config_kernel sdp2430_config[] = {
203 {OMAP_TAG_UART, &sdp2430_uart_config}, 154 {OMAP_TAG_UART, &sdp2430_uart_config},
155 {OMAP_TAG_LCD, &sdp2430_lcd_config},
204}; 156};
205 157
206 158
@@ -248,6 +200,8 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
248 200
249static void __init omap_2430sdp_init(void) 201static void __init omap_2430sdp_init(void)
250{ 202{
203 int ret;
204
251 omap2430_i2c_init(); 205 omap2430_i2c_init();
252 206
253 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); 207 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
@@ -256,6 +210,12 @@ static void __init omap_2430sdp_init(void)
256 omap_serial_init(); 210 omap_serial_init();
257 twl4030_mmc_init(mmc); 211 twl4030_mmc_init(mmc);
258 usb_musb_init(); 212 usb_musb_init();
213 board_smc91x_init();
214
215 /* Turn off secondary LCD backlight */
216 ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
217 if (ret == 0)
218 gpio_direction_output(SECONDARY_LCD_GPIO, 0);
259} 219}
260 220
261static void __init omap_2430sdp_map_io(void) 221static void __init omap_2430sdp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index ed9274972122..496a90e4ea7a 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -39,15 +39,13 @@
39 39
40#include <mach/control.h> 40#include <mach/control.h>
41#include <mach/keypad.h> 41#include <mach/keypad.h>
42#include <mach/gpmc-smc91x.h>
42 43
44#include "sdram-qimonda-hyb18m512160af-6.h"
43#include "mmc-twl4030.h" 45#include "mmc-twl4030.h"
44 46
45#define CONFIG_DISABLE_HFCLK 1 47#define CONFIG_DISABLE_HFCLK 1
46 48
47#define SDP3430_ETHR_GPIO_IRQ_SDPV1 29
48#define SDP3430_ETHR_GPIO_IRQ_SDPV2 6
49#define SDP3430_SMC91X_CS 3
50
51#define SDP3430_TS_GPIO_IRQ_SDPV1 3 49#define SDP3430_TS_GPIO_IRQ_SDPV1 3
52#define SDP3430_TS_GPIO_IRQ_SDPV2 2 50#define SDP3430_TS_GPIO_IRQ_SDPV2 2
53 51
@@ -56,24 +54,6 @@
56 54
57#define TWL4030_MSECURE_GPIO 22 55#define TWL4030_MSECURE_GPIO 22
58 56
59static struct resource sdp3430_smc91x_resources[] = {
60 [0] = {
61 .flags = IORESOURCE_MEM,
62 },
63 [1] = {
64 .start = 0,
65 .end = 0,
66 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
67 },
68};
69
70static struct platform_device sdp3430_smc91x_device = {
71 .name = "smc91x",
72 .id = -1,
73 .num_resources = ARRAY_SIZE(sdp3430_smc91x_resources),
74 .resource = sdp3430_smc91x_resources,
75};
76
77static int sdp3430_keymap[] = { 57static int sdp3430_keymap[] = {
78 KEY(0, 0, KEY_LEFT), 58 KEY(0, 0, KEY_LEFT),
79 KEY(0, 1, KEY_RIGHT), 59 KEY(0, 1, KEY_RIGHT),
@@ -184,48 +164,14 @@ static struct regulator_consumer_supply sdp3430_vdvi_supply = {
184}; 164};
185 165
186static struct platform_device *sdp3430_devices[] __initdata = { 166static struct platform_device *sdp3430_devices[] __initdata = {
187 &sdp3430_smc91x_device,
188 &sdp3430_lcd_device, 167 &sdp3430_lcd_device,
189}; 168};
190 169
191static inline void __init sdp3430_init_smc91x(void)
192{
193 int eth_cs;
194 unsigned long cs_mem_base;
195 int eth_gpio = 0;
196
197 eth_cs = SDP3430_SMC91X_CS;
198
199 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
200 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
201 return;
202 }
203
204 sdp3430_smc91x_resources[0].start = cs_mem_base + 0x300;
205 sdp3430_smc91x_resources[0].end = cs_mem_base + 0x30f;
206 udelay(100);
207
208 if (omap_rev() > OMAP3430_REV_ES1_0)
209 eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV2;
210 else
211 eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV1;
212
213 sdp3430_smc91x_resources[1].start = gpio_to_irq(eth_gpio);
214
215 if (gpio_request(eth_gpio, "SMC91x irq") < 0) {
216 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
217 eth_gpio);
218 return;
219 }
220 gpio_direction_input(eth_gpio);
221}
222
223static void __init omap_3430sdp_init_irq(void) 170static void __init omap_3430sdp_init_irq(void)
224{ 171{
225 omap2_init_common_hw(NULL); 172 omap2_init_common_hw(hyb18m512160af6_sdrc_params);
226 omap_init_irq(); 173 omap_init_irq();
227 omap_gpio_init(); 174 omap_gpio_init();
228 sdp3430_init_smc91x();
229} 175}
230 176
231static struct omap_uart_config sdp3430_uart_config __initdata = { 177static struct omap_uart_config sdp3430_uart_config __initdata = {
@@ -506,6 +452,32 @@ static int __init omap3430_i2c_init(void)
506 return 0; 452 return 0;
507} 453}
508 454
455#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
456
457static struct omap_smc91x_platform_data board_smc91x_data = {
458 .cs = 3,
459 .flags = GPMC_MUX_ADD_DATA | GPMC_TIMINGS_SMC91C96 |
460 IORESOURCE_IRQ_LOWLEVEL,
461};
462
463static void __init board_smc91x_init(void)
464{
465 if (omap_rev() > OMAP3430_REV_ES1_0)
466 board_smc91x_data.gpio_irq = 6;
467 else
468 board_smc91x_data.gpio_irq = 29;
469
470 gpmc_smc91x_init(&board_smc91x_data);
471}
472
473#else
474
475static inline void board_smc91x_init(void)
476{
477}
478
479#endif
480
509static void __init omap_3430sdp_init(void) 481static void __init omap_3430sdp_init(void)
510{ 482{
511 omap3430_i2c_init(); 483 omap3430_i2c_init();
@@ -522,6 +494,7 @@ static void __init omap_3430sdp_init(void)
522 ads7846_dev_init(); 494 ads7846_dev_init();
523 omap_serial_init(); 495 omap_serial_init();
524 usb_musb_init(); 496 usb_musb_init();
497 board_smc91x_init();
525} 498}
526 499
527static void __init omap_3430sdp_map_io(void) 500static void __init omap_3430sdp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
new file mode 100644
index 000000000000..57e477bd89c6
--- /dev/null
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -0,0 +1,94 @@
1/*
2 * Board support file for OMAP4430 SDP.
3 *
4 * Copyright (C) 2009 Texas Instruments
5 *
6 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
7 *
8 * Based on mach-omap2/board-3430sdp.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19#include <linux/gpio.h>
20
21#include <mach/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25
26#include <mach/board.h>
27#include <mach/common.h>
28#include <mach/control.h>
29#include <mach/timer-gp.h>
30#include <asm/hardware/gic.h>
31
32static struct platform_device sdp4430_lcd_device = {
33 .name = "sdp4430_lcd",
34 .id = -1,
35};
36
37static struct platform_device *sdp4430_devices[] __initdata = {
38 &sdp4430_lcd_device,
39};
40
41static struct omap_uart_config sdp4430_uart_config __initdata = {
42 .enabled_uarts = (1 << 0) | (1 << 1) | (1 << 2),
43};
44
45static struct omap_lcd_config sdp4430_lcd_config __initdata = {
46 .ctrl_name = "internal",
47};
48
49static struct omap_board_config_kernel sdp4430_config[] __initdata = {
50 { OMAP_TAG_UART, &sdp4430_uart_config },
51 { OMAP_TAG_LCD, &sdp4430_lcd_config },
52};
53
54static void __init gic_init_irq(void)
55{
56 gic_dist_init(0, IO_ADDRESS(OMAP44XX_GIC_DIST_BASE), 29);
57 gic_cpu_init(0, IO_ADDRESS(OMAP44XX_GIC_CPU_BASE));
58}
59
60static void __init omap_4430sdp_init_irq(void)
61{
62 omap2_init_common_hw(NULL);
63#ifdef CONFIG_OMAP_32K_TIMER
64 omap2_gp_clockevent_set_gptimer(1);
65#endif
66 gic_init_irq();
67 omap_gpio_init();
68}
69
70
71static void __init omap_4430sdp_init(void)
72{
73 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
74 omap_board_config = sdp4430_config;
75 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
76 omap_serial_init();
77}
78
79static void __init omap_4430sdp_map_io(void)
80{
81 omap2_set_globals_443x();
82 omap2_map_common_io();
83}
84
85MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
86 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
87 .phys_io = 0x48000000,
88 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
89 .boot_params = 0x80000100,
90 .map_io = omap_4430sdp_map_io,
91 .init_irq = omap_4430sdp_init_irq,
92 .init_machine = omap_4430sdp_init,
93 .timer = &omap_timer,
94MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index da57b0fcda14..d8bc0a7dcb8d 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -16,11 +16,13 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/input.h> 18#include <linux/input.h>
19#include <linux/gpio_keys.h>
19#include <linux/workqueue.h> 20#include <linux/workqueue.h>
20#include <linux/err.h> 21#include <linux/err.h>
21#include <linux/clk.h> 22#include <linux/clk.h>
22#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
23#include <linux/spi/ads7846.h> 24#include <linux/spi/ads7846.h>
25#include <linux/regulator/machine.h>
24#include <linux/i2c/twl4030.h> 26#include <linux/i2c/twl4030.h>
25#include <linux/io.h> 27#include <linux/io.h>
26#include <linux/smsc911x.h> 28#include <linux/smsc911x.h>
@@ -39,6 +41,7 @@
39#include <asm/delay.h> 41#include <asm/delay.h>
40#include <mach/control.h> 42#include <mach/control.h>
41#include <mach/usb.h> 43#include <mach/usb.h>
44#include <mach/keypad.h>
42 45
43#include "mmc-twl4030.h" 46#include "mmc-twl4030.h"
44 47
@@ -77,8 +80,163 @@ static struct platform_device ldp_smsc911x_device = {
77 }, 80 },
78}; 81};
79 82
80static struct platform_device *ldp_devices[] __initdata = { 83static int ldp_twl4030_keymap[] = {
81 &ldp_smsc911x_device, 84 KEY(0, 0, KEY_1),
85 KEY(1, 0, KEY_2),
86 KEY(2, 0, KEY_3),
87 KEY(0, 1, KEY_4),
88 KEY(1, 1, KEY_5),
89 KEY(2, 1, KEY_6),
90 KEY(3, 1, KEY_F5),
91 KEY(0, 2, KEY_7),
92 KEY(1, 2, KEY_8),
93 KEY(2, 2, KEY_9),
94 KEY(3, 2, KEY_F6),
95 KEY(0, 3, KEY_F7),
96 KEY(1, 3, KEY_0),
97 KEY(2, 3, KEY_F8),
98 PERSISTENT_KEY(4, 5),
99 KEY(4, 4, KEY_VOLUMEUP),
100 KEY(5, 5, KEY_VOLUMEDOWN),
101 0
102};
103
104static struct twl4030_keypad_data ldp_kp_twl4030_data = {
105 .rows = 6,
106 .cols = 6,
107 .keymap = ldp_twl4030_keymap,
108 .keymapsize = ARRAY_SIZE(ldp_twl4030_keymap),
109 .rep = 1,
110};
111
112static struct gpio_keys_button ldp_gpio_keys_buttons[] = {
113 [0] = {
114 .code = KEY_ENTER,
115 .gpio = 101,
116 .desc = "enter sw",
117 .active_low = 1,
118 .debounce_interval = 30,
119 },
120 [1] = {
121 .code = KEY_F1,
122 .gpio = 102,
123 .desc = "func 1",
124 .active_low = 1,
125 .debounce_interval = 30,
126 },
127 [2] = {
128 .code = KEY_F2,
129 .gpio = 103,
130 .desc = "func 2",
131 .active_low = 1,
132 .debounce_interval = 30,
133 },
134 [3] = {
135 .code = KEY_F3,
136 .gpio = 104,
137 .desc = "func 3",
138 .active_low = 1,
139 .debounce_interval = 30,
140 },
141 [4] = {
142 .code = KEY_F4,
143 .gpio = 105,
144 .desc = "func 4",
145 .active_low = 1,
146 .debounce_interval = 30,
147 },
148 [5] = {
149 .code = KEY_LEFT,
150 .gpio = 106,
151 .desc = "left sw",
152 .active_low = 1,
153 .debounce_interval = 30,
154 },
155 [6] = {
156 .code = KEY_RIGHT,
157 .gpio = 107,
158 .desc = "right sw",
159 .active_low = 1,
160 .debounce_interval = 30,
161 },
162 [7] = {
163 .code = KEY_UP,
164 .gpio = 108,
165 .desc = "up sw",
166 .active_low = 1,
167 .debounce_interval = 30,
168 },
169 [8] = {
170 .code = KEY_DOWN,
171 .gpio = 109,
172 .desc = "down sw",
173 .active_low = 1,
174 .debounce_interval = 30,
175 },
176};
177
178static struct gpio_keys_platform_data ldp_gpio_keys = {
179 .buttons = ldp_gpio_keys_buttons,
180 .nbuttons = ARRAY_SIZE(ldp_gpio_keys_buttons),
181 .rep = 1,
182};
183
184static struct platform_device ldp_gpio_keys_device = {
185 .name = "gpio-keys",
186 .id = -1,
187 .dev = {
188 .platform_data = &ldp_gpio_keys,
189 },
190};
191
192static int ts_gpio;
193
194/**
195 * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
196 *
197 * @return - void. If request gpio fails then Flag KERN_ERR.
198 */
199static void ads7846_dev_init(void)
200{
201 if (gpio_request(ts_gpio, "ads7846 irq") < 0) {
202 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
203 return;
204 }
205
206 gpio_direction_input(ts_gpio);
207 omap_set_gpio_debounce(ts_gpio, 1);
208 omap_set_gpio_debounce_time(ts_gpio, 0xa);
209}
210
211static int ads7846_get_pendown_state(void)
212{
213 return !gpio_get_value(ts_gpio);
214}
215
216static struct ads7846_platform_data tsc2046_config __initdata = {
217 .get_pendown_state = ads7846_get_pendown_state,
218 .keep_vref_on = 1,
219};
220
221static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
222 .turbo_mode = 0,
223 .single_channel = 1, /* 0: slave, 1: master */
224};
225
226static struct spi_board_info ldp_spi_board_info[] __initdata = {
227 [0] = {
228 /*
229 * TSC2046 operates at a max freqency of 2MHz, so
230 * operate slightly below at 1.5MHz
231 */
232 .modalias = "ads7846",
233 .bus_num = 1,
234 .chip_select = 0,
235 .max_speed_hz = 1500000,
236 .controller_data = &tsc2046_mcspi_config,
237 .irq = 0,
238 .platform_data = &tsc2046_config,
239 },
82}; 240};
83 241
84static inline void __init ldp_init_smsc911x(void) 242static inline void __init ldp_init_smsc911x(void)
@@ -122,8 +280,22 @@ static struct omap_uart_config ldp_uart_config __initdata = {
122 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 280 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
123}; 281};
124 282
283static struct platform_device ldp_lcd_device = {
284 .name = "ldp_lcd",
285 .id = -1,
286};
287
288static struct omap_lcd_config ldp_lcd_config __initdata = {
289 .ctrl_name = "internal",
290};
291
125static struct omap_board_config_kernel ldp_config[] __initdata = { 292static struct omap_board_config_kernel ldp_config[] __initdata = {
126 { OMAP_TAG_UART, &ldp_uart_config }, 293 { OMAP_TAG_UART, &ldp_uart_config },
294 { OMAP_TAG_LCD, &ldp_lcd_config },
295};
296
297static struct twl4030_usb_data ldp_usb_data = {
298 .usb_mode = T2_USB_MODE_ULPI,
127}; 299};
128 300
129static struct twl4030_gpio_platform_data ldp_gpio_data = { 301static struct twl4030_gpio_platform_data ldp_gpio_data = {
@@ -132,12 +304,39 @@ static struct twl4030_gpio_platform_data ldp_gpio_data = {
132 .irq_end = TWL4030_GPIO_IRQ_END, 304 .irq_end = TWL4030_GPIO_IRQ_END,
133}; 305};
134 306
307static struct twl4030_madc_platform_data ldp_madc_data = {
308 .irq_line = 1,
309};
310
311static struct regulator_consumer_supply ldp_vmmc1_supply = {
312 .supply = "vmmc",
313};
314
315/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
316static struct regulator_init_data ldp_vmmc1 = {
317 .constraints = {
318 .min_uV = 1850000,
319 .max_uV = 3150000,
320 .valid_modes_mask = REGULATOR_MODE_NORMAL
321 | REGULATOR_MODE_STANDBY,
322 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
323 | REGULATOR_CHANGE_MODE
324 | REGULATOR_CHANGE_STATUS,
325 },
326 .num_consumer_supplies = 1,
327 .consumer_supplies = &ldp_vmmc1_supply,
328};
329
135static struct twl4030_platform_data ldp_twldata = { 330static struct twl4030_platform_data ldp_twldata = {
136 .irq_base = TWL4030_IRQ_BASE, 331 .irq_base = TWL4030_IRQ_BASE,
137 .irq_end = TWL4030_IRQ_END, 332 .irq_end = TWL4030_IRQ_END,
138 333
139 /* platform_data for children goes here */ 334 /* platform_data for children goes here */
335 .madc = &ldp_madc_data,
336 .usb = &ldp_usb_data,
337 .vmmc1 = &ldp_vmmc1,
140 .gpio = &ldp_gpio_data, 338 .gpio = &ldp_gpio_data,
339 .keypad = &ldp_kp_twl4030_data,
141}; 340};
142 341
143static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = { 342static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
@@ -168,15 +367,29 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
168 {} /* Terminator */ 367 {} /* Terminator */
169}; 368};
170 369
370static struct platform_device *ldp_devices[] __initdata = {
371 &ldp_smsc911x_device,
372 &ldp_lcd_device,
373 &ldp_gpio_keys_device,
374};
375
171static void __init omap_ldp_init(void) 376static void __init omap_ldp_init(void)
172{ 377{
173 omap_i2c_init(); 378 omap_i2c_init();
174 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 379 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
175 omap_board_config = ldp_config; 380 omap_board_config = ldp_config;
176 omap_board_config_size = ARRAY_SIZE(ldp_config); 381 omap_board_config_size = ARRAY_SIZE(ldp_config);
382 ts_gpio = 54;
383 ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
384 spi_register_board_info(ldp_spi_board_info,
385 ARRAY_SIZE(ldp_spi_board_info));
386 ads7846_dev_init();
177 omap_serial_init(); 387 omap_serial_init();
178 twl4030_mmc_init(mmc);
179 usb_musb_init(); 388 usb_musb_init();
389
390 twl4030_mmc_init(mmc);
391 /* link regulators to MMC adapters */
392 ldp_vmmc1_supply.dev = mmc[0].dev;
180} 393}
181 394
182static void __init omap_ldp_map_io(void) 395static void __init omap_ldp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 3a7a29d1f9a7..991ac9c38032 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -28,6 +28,7 @@
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/mtd/nand.h> 29#include <linux/mtd/nand.h>
30 30
31#include <linux/regulator/machine.h>
31#include <linux/i2c/twl4030.h> 32#include <linux/i2c/twl4030.h>
32 33
33#include <mach/hardware.h> 34#include <mach/hardware.h>
@@ -105,6 +106,8 @@ static struct platform_device omap3beagle_nand_device = {
105 .resource = &omap3beagle_nand_resource, 106 .resource = &omap3beagle_nand_resource,
106}; 107};
107 108
109#include "sdram-micron-mt46h32m32lf-6.h"
110
108static struct omap_uart_config omap3_beagle_uart_config __initdata = { 111static struct omap_uart_config omap3_beagle_uart_config __initdata = {
109 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 112 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
110}; 113};
@@ -118,6 +121,23 @@ static struct twl4030_hsmmc_info mmc[] = {
118 {} /* Terminator */ 121 {} /* Terminator */
119}; 122};
120 123
124static struct platform_device omap3_beagle_lcd_device = {
125 .name = "omap3beagle_lcd",
126 .id = -1,
127};
128
129static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
130 .ctrl_name = "internal",
131};
132
133static struct regulator_consumer_supply beagle_vmmc1_supply = {
134 .supply = "vmmc",
135};
136
137static struct regulator_consumer_supply beagle_vsim_supply = {
138 .supply = "vmmc_aux",
139};
140
121static struct gpio_led gpio_leds[]; 141static struct gpio_led gpio_leds[];
122 142
123static int beagle_twl_gpio_setup(struct device *dev, 143static int beagle_twl_gpio_setup(struct device *dev,
@@ -128,6 +148,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
128 mmc[0].gpio_cd = gpio + 0; 148 mmc[0].gpio_cd = gpio + 0;
129 twl4030_mmc_init(mmc); 149 twl4030_mmc_init(mmc);
130 150
151 /* link regulators to MMC adapters */
152 beagle_vmmc1_supply.dev = mmc[0].dev;
153 beagle_vsim_supply.dev = mmc[0].dev;
154
131 /* REVISIT: need ehci-omap hooks for external VBUS 155 /* REVISIT: need ehci-omap hooks for external VBUS
132 * power switch and overcurrent detect 156 * power switch and overcurrent detect
133 */ 157 */
@@ -156,12 +180,85 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
156 .setup = beagle_twl_gpio_setup, 180 .setup = beagle_twl_gpio_setup,
157}; 181};
158 182
183static struct regulator_consumer_supply beagle_vdac_supply = {
184 .supply = "vdac",
185 .dev = &omap3_beagle_lcd_device.dev,
186};
187
188static struct regulator_consumer_supply beagle_vdvi_supply = {
189 .supply = "vdvi",
190 .dev = &omap3_beagle_lcd_device.dev,
191};
192
193/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
194static struct regulator_init_data beagle_vmmc1 = {
195 .constraints = {
196 .min_uV = 1850000,
197 .max_uV = 3150000,
198 .valid_modes_mask = REGULATOR_MODE_NORMAL
199 | REGULATOR_MODE_STANDBY,
200 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
201 | REGULATOR_CHANGE_MODE
202 | REGULATOR_CHANGE_STATUS,
203 },
204 .num_consumer_supplies = 1,
205 .consumer_supplies = &beagle_vmmc1_supply,
206};
207
208/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
209static struct regulator_init_data beagle_vsim = {
210 .constraints = {
211 .min_uV = 1800000,
212 .max_uV = 3000000,
213 .valid_modes_mask = REGULATOR_MODE_NORMAL
214 | REGULATOR_MODE_STANDBY,
215 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
216 | REGULATOR_CHANGE_MODE
217 | REGULATOR_CHANGE_STATUS,
218 },
219 .num_consumer_supplies = 1,
220 .consumer_supplies = &beagle_vsim_supply,
221};
222
223/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
224static struct regulator_init_data beagle_vdac = {
225 .constraints = {
226 .min_uV = 1800000,
227 .max_uV = 1800000,
228 .valid_modes_mask = REGULATOR_MODE_NORMAL
229 | REGULATOR_MODE_STANDBY,
230 .valid_ops_mask = REGULATOR_CHANGE_MODE
231 | REGULATOR_CHANGE_STATUS,
232 },
233 .num_consumer_supplies = 1,
234 .consumer_supplies = &beagle_vdac_supply,
235};
236
237/* VPLL2 for digital video outputs */
238static struct regulator_init_data beagle_vpll2 = {
239 .constraints = {
240 .name = "VDVI",
241 .min_uV = 1800000,
242 .max_uV = 1800000,
243 .valid_modes_mask = REGULATOR_MODE_NORMAL
244 | REGULATOR_MODE_STANDBY,
245 .valid_ops_mask = REGULATOR_CHANGE_MODE
246 | REGULATOR_CHANGE_STATUS,
247 },
248 .num_consumer_supplies = 1,
249 .consumer_supplies = &beagle_vdvi_supply,
250};
251
159static struct twl4030_platform_data beagle_twldata = { 252static struct twl4030_platform_data beagle_twldata = {
160 .irq_base = TWL4030_IRQ_BASE, 253 .irq_base = TWL4030_IRQ_BASE,
161 .irq_end = TWL4030_IRQ_END, 254 .irq_end = TWL4030_IRQ_END,
162 255
163 /* platform_data for children goes here */ 256 /* platform_data for children goes here */
164 .gpio = &beagle_gpio_data, 257 .gpio = &beagle_gpio_data,
258 .vmmc1 = &beagle_vmmc1,
259 .vsim = &beagle_vsim,
260 .vdac = &beagle_vdac,
261 .vpll2 = &beagle_vpll2,
165}; 262};
166 263
167static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { 264static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
@@ -185,7 +282,7 @@ static int __init omap3_beagle_i2c_init(void)
185 282
186static void __init omap3_beagle_init_irq(void) 283static void __init omap3_beagle_init_irq(void)
187{ 284{
188 omap2_init_common_hw(NULL); 285 omap2_init_common_hw(mt46h32m32lf6_sdrc_params);
189 omap_init_irq(); 286 omap_init_irq();
190#ifdef CONFIG_OMAP_32K_TIMER 287#ifdef CONFIG_OMAP_32K_TIMER
191 omap2_gp_clockevent_set_gptimer(12); 288 omap2_gp_clockevent_set_gptimer(12);
@@ -193,15 +290,6 @@ static void __init omap3_beagle_init_irq(void)
193 omap_gpio_init(); 290 omap_gpio_init();
194} 291}
195 292
196static struct platform_device omap3_beagle_lcd_device = {
197 .name = "omap3beagle_lcd",
198 .id = -1,
199};
200
201static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
202 .ctrl_name = "internal",
203};
204
205static struct gpio_led gpio_leds[] = { 293static struct gpio_led gpio_leds[] = {
206 { 294 {
207 .name = "beagleboard::usr0", 295 .name = "beagleboard::usr0",
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
new file mode 100644
index 000000000000..d3cc145814d0
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -0,0 +1,329 @@
1/*
2 * linux/arch/arm/mach-omap2/board-omap3evm.c
3 *
4 * Copyright (C) 2008 Texas Instruments
5 *
6 * Modified from mach-omap2/board-3430sdp.c
7 *
8 * Initial code: Syed Mohammed Khasim
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/delay.h>
19#include <linux/err.h>
20#include <linux/clk.h>
21#include <linux/gpio.h>
22#include <linux/input.h>
23#include <linux/leds.h>
24
25#include <linux/spi/spi.h>
26#include <linux/spi/ads7846.h>
27#include <linux/i2c/twl4030.h>
28
29#include <mach/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33
34#include <mach/board.h>
35#include <mach/mux.h>
36#include <mach/usb.h>
37#include <mach/common.h>
38#include <mach/mcspi.h>
39#include <mach/keypad.h>
40
41#include "sdram-micron-mt46h32m32lf-6.h"
42#include "mmc-twl4030.h"
43
44#define OMAP3_EVM_TS_GPIO 175
45
46#define OMAP3EVM_ETHR_START 0x2c000000
47#define OMAP3EVM_ETHR_SIZE 1024
48#define OMAP3EVM_ETHR_GPIO_IRQ 176
49#define OMAP3EVM_SMC911X_CS 5
50
51static struct resource omap3evm_smc911x_resources[] = {
52 [0] = {
53 .start = OMAP3EVM_ETHR_START,
54 .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
55 .flags = IORESOURCE_MEM,
56 },
57 [1] = {
58 .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
59 .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
60 .flags = IORESOURCE_IRQ,
61 },
62};
63
64static struct platform_device omap3evm_smc911x_device = {
65 .name = "smc911x",
66 .id = -1,
67 .num_resources = ARRAY_SIZE(omap3evm_smc911x_resources),
68 .resource = &omap3evm_smc911x_resources[0],
69};
70
71static inline void __init omap3evm_init_smc911x(void)
72{
73 int eth_cs;
74 struct clk *l3ck;
75 unsigned int rate;
76
77 eth_cs = OMAP3EVM_SMC911X_CS;
78
79 l3ck = clk_get(NULL, "l3_ck");
80 if (IS_ERR(l3ck))
81 rate = 100000000;
82 else
83 rate = clk_get_rate(l3ck);
84
85 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMC911x irq") < 0) {
86 printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
87 OMAP3EVM_ETHR_GPIO_IRQ);
88 return;
89 }
90
91 gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
92}
93
94static struct omap_uart_config omap3_evm_uart_config __initdata = {
95 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
96};
97
98static struct twl4030_hsmmc_info mmc[] = {
99 {
100 .mmc = 1,
101 .wires = 4,
102 .gpio_cd = -EINVAL,
103 .gpio_wp = 63,
104 },
105 {} /* Terminator */
106};
107
108static struct gpio_led gpio_leds[] = {
109 {
110 .name = "omap3evm::ledb",
111 /* normally not visible (board underside) */
112 .default_trigger = "default-on",
113 .gpio = -EINVAL, /* gets replaced */
114 .active_low = true,
115 },
116};
117
118static struct gpio_led_platform_data gpio_led_info = {
119 .leds = gpio_leds,
120 .num_leds = ARRAY_SIZE(gpio_leds),
121};
122
123static struct platform_device leds_gpio = {
124 .name = "leds-gpio",
125 .id = -1,
126 .dev = {
127 .platform_data = &gpio_led_info,
128 },
129};
130
131
132static int omap3evm_twl_gpio_setup(struct device *dev,
133 unsigned gpio, unsigned ngpio)
134{
135 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
136 omap_cfg_reg(L8_34XX_GPIO63);
137 mmc[0].gpio_cd = gpio + 0;
138 twl4030_mmc_init(mmc);
139
140 /*
141 * Most GPIOs are for USB OTG. Some are mostly sent to
142 * the P2 connector; notably LEDA for the LCD backlight.
143 */
144
145 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
146 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
147
148 platform_device_register(&leds_gpio);
149
150 return 0;
151}
152
153static struct twl4030_gpio_platform_data omap3evm_gpio_data = {
154 .gpio_base = OMAP_MAX_GPIO_LINES,
155 .irq_base = TWL4030_GPIO_IRQ_BASE,
156 .irq_end = TWL4030_GPIO_IRQ_END,
157 .use_leds = true,
158 .setup = omap3evm_twl_gpio_setup,
159};
160
161static struct twl4030_usb_data omap3evm_usb_data = {
162 .usb_mode = T2_USB_MODE_ULPI,
163};
164
165static int omap3evm_keymap[] = {
166 KEY(0, 0, KEY_LEFT),
167 KEY(0, 1, KEY_RIGHT),
168 KEY(0, 2, KEY_A),
169 KEY(0, 3, KEY_B),
170 KEY(1, 0, KEY_DOWN),
171 KEY(1, 1, KEY_UP),
172 KEY(1, 2, KEY_E),
173 KEY(1, 3, KEY_F),
174 KEY(2, 0, KEY_ENTER),
175 KEY(2, 1, KEY_I),
176 KEY(2, 2, KEY_J),
177 KEY(2, 3, KEY_K),
178 KEY(3, 0, KEY_M),
179 KEY(3, 1, KEY_N),
180 KEY(3, 2, KEY_O),
181 KEY(3, 3, KEY_P)
182};
183
184static struct twl4030_keypad_data omap3evm_kp_data = {
185 .rows = 4,
186 .cols = 4,
187 .keymap = omap3evm_keymap,
188 .keymapsize = ARRAY_SIZE(omap3evm_keymap),
189 .rep = 1,
190};
191
192static struct twl4030_madc_platform_data omap3evm_madc_data = {
193 .irq_line = 1,
194};
195
196static struct twl4030_platform_data omap3evm_twldata = {
197 .irq_base = TWL4030_IRQ_BASE,
198 .irq_end = TWL4030_IRQ_END,
199
200 /* platform_data for children goes here */
201 .keypad = &omap3evm_kp_data,
202 .madc = &omap3evm_madc_data,
203 .usb = &omap3evm_usb_data,
204 .gpio = &omap3evm_gpio_data,
205};
206
207static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
208 {
209 I2C_BOARD_INFO("twl4030", 0x48),
210 .flags = I2C_CLIENT_WAKE,
211 .irq = INT_34XX_SYS_NIRQ,
212 .platform_data = &omap3evm_twldata,
213 },
214};
215
216static int __init omap3_evm_i2c_init(void)
217{
218 omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo,
219 ARRAY_SIZE(omap3evm_i2c_boardinfo));
220 omap_register_i2c_bus(2, 400, NULL, 0);
221 omap_register_i2c_bus(3, 400, NULL, 0);
222 return 0;
223}
224
225static struct platform_device omap3_evm_lcd_device = {
226 .name = "omap3evm_lcd",
227 .id = -1,
228};
229
230static struct omap_lcd_config omap3_evm_lcd_config __initdata = {
231 .ctrl_name = "internal",
232};
233
234static void ads7846_dev_init(void)
235{
236 if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
237 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
238
239 gpio_direction_input(OMAP3_EVM_TS_GPIO);
240
241 omap_set_gpio_debounce(OMAP3_EVM_TS_GPIO, 1);
242 omap_set_gpio_debounce_time(OMAP3_EVM_TS_GPIO, 0xa);
243}
244
245static int ads7846_get_pendown_state(void)
246{
247 return !gpio_get_value(OMAP3_EVM_TS_GPIO);
248}
249
250struct ads7846_platform_data ads7846_config = {
251 .x_max = 0x0fff,
252 .y_max = 0x0fff,
253 .x_plate_ohms = 180,
254 .pressure_max = 255,
255 .debounce_max = 10,
256 .debounce_tol = 3,
257 .debounce_rep = 1,
258 .get_pendown_state = ads7846_get_pendown_state,
259 .keep_vref_on = 1,
260 .settle_delay_usecs = 150,
261};
262
263static struct omap2_mcspi_device_config ads7846_mcspi_config = {
264 .turbo_mode = 0,
265 .single_channel = 1, /* 0: slave, 1: master */
266};
267
268struct spi_board_info omap3evm_spi_board_info[] = {
269 [0] = {
270 .modalias = "ads7846",
271 .bus_num = 1,
272 .chip_select = 0,
273 .max_speed_hz = 1500000,
274 .controller_data = &ads7846_mcspi_config,
275 .irq = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO),
276 .platform_data = &ads7846_config,
277 },
278};
279
280static void __init omap3_evm_init_irq(void)
281{
282 omap2_init_common_hw(mt46h32m32lf6_sdrc_params);
283 omap_init_irq();
284 omap_gpio_init();
285 omap3evm_init_smc911x();
286}
287
288static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
289 { OMAP_TAG_UART, &omap3_evm_uart_config },
290 { OMAP_TAG_LCD, &omap3_evm_lcd_config },
291};
292
293static struct platform_device *omap3_evm_devices[] __initdata = {
294 &omap3_evm_lcd_device,
295 &omap3evm_smc911x_device,
296};
297
298static void __init omap3_evm_init(void)
299{
300 omap3_evm_i2c_init();
301
302 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
303 omap_board_config = omap3_evm_config;
304 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
305
306 spi_register_board_info(omap3evm_spi_board_info,
307 ARRAY_SIZE(omap3evm_spi_board_info));
308
309 omap_serial_init();
310 usb_musb_init();
311 ads7846_dev_init();
312}
313
314static void __init omap3_evm_map_io(void)
315{
316 omap2_set_globals_343x();
317 omap2_map_common_io();
318}
319
320MACHINE_START(OMAP3EVM, "OMAP3 EVM")
321 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */
322 .phys_io = 0x48000000,
323 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
324 .boot_params = 0x80000100,
325 .map_io = omap3_evm_map_io,
326 .init_irq = omap3_evm_init_irq,
327 .init_machine = omap3_evm_init,
328 .timer = &omap_timer,
329MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 402f09c6cf10..e32aa23ce962 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -23,7 +23,11 @@
23 23
24#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
25#include <linux/spi/ads7846.h> 25#include <linux/spi/ads7846.h>
26#include <linux/regulator/machine.h>
26#include <linux/i2c/twl4030.h> 27#include <linux/i2c/twl4030.h>
28#include <linux/leds.h>
29#include <linux/input.h>
30#include <linux/gpio_keys.h>
27 31
28#include <asm/mach-types.h> 32#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -35,11 +39,154 @@
35#include <mach/hardware.h> 39#include <mach/hardware.h>
36#include <mach/mcspi.h> 40#include <mach/mcspi.h>
37#include <mach/usb.h> 41#include <mach/usb.h>
42#include <mach/keypad.h>
38 43
44#include "sdram-micron-mt46h32m32lf-6.h"
39#include "mmc-twl4030.h" 45#include "mmc-twl4030.h"
40 46
41#define OMAP3_PANDORA_TS_GPIO 94 47#define OMAP3_PANDORA_TS_GPIO 94
42 48
49/* hardware debounce: (value + 1) * 31us */
50#define GPIO_DEBOUNCE_TIME 127
51
52static struct gpio_led pandora_gpio_leds[] = {
53 {
54 .name = "pandora::sd1",
55 .default_trigger = "mmc0",
56 .gpio = 128,
57 }, {
58 .name = "pandora::sd2",
59 .default_trigger = "mmc1",
60 .gpio = 129,
61 }, {
62 .name = "pandora::bluetooth",
63 .gpio = 158,
64 }, {
65 .name = "pandora::wifi",
66 .gpio = 159,
67 },
68};
69
70static struct gpio_led_platform_data pandora_gpio_led_data = {
71 .leds = pandora_gpio_leds,
72 .num_leds = ARRAY_SIZE(pandora_gpio_leds),
73};
74
75static struct platform_device pandora_leds_gpio = {
76 .name = "leds-gpio",
77 .id = -1,
78 .dev = {
79 .platform_data = &pandora_gpio_led_data,
80 },
81};
82
83#define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \
84{ \
85 .gpio = gpio_num, \
86 .type = ev_type, \
87 .code = ev_code, \
88 .active_low = act_low, \
89 .desc = "btn " descr, \
90}
91
92#define GPIO_BUTTON_LOW(gpio_num, event_code, description) \
93 GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description)
94
95static struct gpio_keys_button pandora_gpio_keys[] = {
96 GPIO_BUTTON_LOW(110, KEY_UP, "up"),
97 GPIO_BUTTON_LOW(103, KEY_DOWN, "down"),
98 GPIO_BUTTON_LOW(96, KEY_LEFT, "left"),
99 GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"),
100 GPIO_BUTTON_LOW(111, BTN_A, "a"),
101 GPIO_BUTTON_LOW(106, BTN_B, "b"),
102 GPIO_BUTTON_LOW(109, BTN_X, "x"),
103 GPIO_BUTTON_LOW(101, BTN_Y, "y"),
104 GPIO_BUTTON_LOW(102, BTN_TL, "l"),
105 GPIO_BUTTON_LOW(97, BTN_TL2, "l2"),
106 GPIO_BUTTON_LOW(105, BTN_TR, "r"),
107 GPIO_BUTTON_LOW(107, BTN_TR2, "r2"),
108 GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"),
109 GPIO_BUTTON_LOW(99, KEY_MENU, "menu"),
110 GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"),
111 GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"),
112 GPIO_BUTTON(108, EV_SW, SW_LID, 1, "lid"),
113};
114
115static struct gpio_keys_platform_data pandora_gpio_key_info = {
116 .buttons = pandora_gpio_keys,
117 .nbuttons = ARRAY_SIZE(pandora_gpio_keys),
118};
119
120static struct platform_device pandora_keys_gpio = {
121 .name = "gpio-keys",
122 .id = -1,
123 .dev = {
124 .platform_data = &pandora_gpio_key_info,
125 },
126};
127
128static void __init pandora_keys_gpio_init(void)
129{
130 /* set debounce time for GPIO banks 4 and 6 */
131 omap_set_gpio_debounce_time(32 * 3, GPIO_DEBOUNCE_TIME);
132 omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME);
133}
134
135static int pandora_keypad_map[] = {
136 /* col, row, code */
137 KEY(0, 0, KEY_9),
138 KEY(0, 1, KEY_0),
139 KEY(0, 2, KEY_BACKSPACE),
140 KEY(0, 3, KEY_O),
141 KEY(0, 4, KEY_P),
142 KEY(0, 5, KEY_K),
143 KEY(0, 6, KEY_L),
144 KEY(0, 7, KEY_ENTER),
145 KEY(1, 0, KEY_8),
146 KEY(1, 1, KEY_7),
147 KEY(1, 2, KEY_6),
148 KEY(1, 3, KEY_5),
149 KEY(1, 4, KEY_4),
150 KEY(1, 5, KEY_3),
151 KEY(1, 6, KEY_2),
152 KEY(1, 7, KEY_1),
153 KEY(2, 0, KEY_I),
154 KEY(2, 1, KEY_U),
155 KEY(2, 2, KEY_Y),
156 KEY(2, 3, KEY_T),
157 KEY(2, 4, KEY_R),
158 KEY(2, 5, KEY_E),
159 KEY(2, 6, KEY_W),
160 KEY(2, 7, KEY_Q),
161 KEY(3, 0, KEY_J),
162 KEY(3, 1, KEY_H),
163 KEY(3, 2, KEY_G),
164 KEY(3, 3, KEY_F),
165 KEY(3, 4, KEY_D),
166 KEY(3, 5, KEY_S),
167 KEY(3, 6, KEY_A),
168 KEY(3, 7, KEY_LEFTSHIFT),
169 KEY(4, 0, KEY_N),
170 KEY(4, 1, KEY_B),
171 KEY(4, 2, KEY_V),
172 KEY(4, 3, KEY_C),
173 KEY(4, 4, KEY_X),
174 KEY(4, 5, KEY_Z),
175 KEY(4, 6, KEY_DOT),
176 KEY(4, 7, KEY_COMMA),
177 KEY(5, 0, KEY_M),
178 KEY(5, 1, KEY_SPACE),
179 KEY(5, 2, KEY_FN),
180};
181
182static struct twl4030_keypad_data pandora_kp_data = {
183 .rows = 8,
184 .cols = 6,
185 .keymap = pandora_keypad_map,
186 .keymapsize = ARRAY_SIZE(pandora_keypad_map),
187 .rep = 1,
188};
189
43static struct twl4030_hsmmc_info omap3pandora_mmc[] = { 190static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
44 { 191 {
45 .mmc = 1, 192 .mmc = 1,
@@ -69,6 +216,14 @@ static struct omap_uart_config omap3pandora_uart_config __initdata = {
69 .enabled_uarts = (1 << 2), /* UART3 */ 216 .enabled_uarts = (1 << 2), /* UART3 */
70}; 217};
71 218
219static struct regulator_consumer_supply pandora_vmmc1_supply = {
220 .supply = "vmmc",
221};
222
223static struct regulator_consumer_supply pandora_vmmc2_supply = {
224 .supply = "vmmc",
225};
226
72static int omap3pandora_twl_gpio_setup(struct device *dev, 227static int omap3pandora_twl_gpio_setup(struct device *dev,
73 unsigned gpio, unsigned ngpio) 228 unsigned gpio, unsigned ngpio)
74{ 229{
@@ -77,6 +232,10 @@ static int omap3pandora_twl_gpio_setup(struct device *dev,
77 omap3pandora_mmc[1].gpio_cd = gpio + 1; 232 omap3pandora_mmc[1].gpio_cd = gpio + 1;
78 twl4030_mmc_init(omap3pandora_mmc); 233 twl4030_mmc_init(omap3pandora_mmc);
79 234
235 /* link regulators to MMC adapters */
236 pandora_vmmc1_supply.dev = omap3pandora_mmc[0].dev;
237 pandora_vmmc2_supply.dev = omap3pandora_mmc[1].dev;
238
80 return 0; 239 return 0;
81} 240}
82 241
@@ -87,6 +246,36 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
87 .setup = omap3pandora_twl_gpio_setup, 246 .setup = omap3pandora_twl_gpio_setup,
88}; 247};
89 248
249/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
250static struct regulator_init_data pandora_vmmc1 = {
251 .constraints = {
252 .min_uV = 1850000,
253 .max_uV = 3150000,
254 .valid_modes_mask = REGULATOR_MODE_NORMAL
255 | REGULATOR_MODE_STANDBY,
256 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
257 | REGULATOR_CHANGE_MODE
258 | REGULATOR_CHANGE_STATUS,
259 },
260 .num_consumer_supplies = 1,
261 .consumer_supplies = &pandora_vmmc1_supply,
262};
263
264/* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */
265static struct regulator_init_data pandora_vmmc2 = {
266 .constraints = {
267 .min_uV = 1850000,
268 .max_uV = 3150000,
269 .valid_modes_mask = REGULATOR_MODE_NORMAL
270 | REGULATOR_MODE_STANDBY,
271 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
272 | REGULATOR_CHANGE_MODE
273 | REGULATOR_CHANGE_STATUS,
274 },
275 .num_consumer_supplies = 1,
276 .consumer_supplies = &pandora_vmmc2_supply,
277};
278
90static struct twl4030_usb_data omap3pandora_usb_data = { 279static struct twl4030_usb_data omap3pandora_usb_data = {
91 .usb_mode = T2_USB_MODE_ULPI, 280 .usb_mode = T2_USB_MODE_ULPI,
92}; 281};
@@ -96,6 +285,9 @@ static struct twl4030_platform_data omap3pandora_twldata = {
96 .irq_end = TWL4030_IRQ_END, 285 .irq_end = TWL4030_IRQ_END,
97 .gpio = &omap3pandora_gpio_data, 286 .gpio = &omap3pandora_gpio_data,
98 .usb = &omap3pandora_usb_data, 287 .usb = &omap3pandora_usb_data,
288 .vmmc1 = &pandora_vmmc1,
289 .vmmc2 = &pandora_vmmc2,
290 .keypad = &pandora_kp_data,
99}; 291};
100 292
101static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = { 293static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {
@@ -118,7 +310,7 @@ static int __init omap3pandora_i2c_init(void)
118 310
119static void __init omap3pandora_init_irq(void) 311static void __init omap3pandora_init_irq(void)
120{ 312{
121 omap2_init_common_hw(NULL); 313 omap2_init_common_hw(mt46h32m32lf6_sdrc_params);
122 omap_init_irq(); 314 omap_init_irq();
123 omap_gpio_init(); 315 omap_gpio_init();
124} 316}
@@ -188,6 +380,8 @@ static struct omap_board_config_kernel omap3pandora_config[] __initdata = {
188 380
189static struct platform_device *omap3pandora_devices[] __initdata = { 381static struct platform_device *omap3pandora_devices[] __initdata = {
190 &omap3pandora_lcd_device, 382 &omap3pandora_lcd_device,
383 &pandora_leds_gpio,
384 &pandora_keys_gpio,
191}; 385};
192 386
193static void __init omap3pandora_init(void) 387static void __init omap3pandora_init(void)
@@ -201,6 +395,7 @@ static void __init omap3pandora_init(void)
201 spi_register_board_info(omap3pandora_spi_board_info, 395 spi_register_board_info(omap3pandora_spi_board_info,
202 ARRAY_SIZE(omap3pandora_spi_board_info)); 396 ARRAY_SIZE(omap3pandora_spi_board_info));
203 omap3pandora_ads7846_init(); 397 omap3pandora_ads7846_init();
398 pandora_keys_gpio_init();
204 usb_musb_init(); 399 usb_musb_init();
205} 400}
206 401
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b1f23bea863f..dff5528fbfb5 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -27,6 +27,7 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/i2c/twl4030.h> 29#include <linux/i2c/twl4030.h>
30#include <linux/regulator/machine.h>
30 31
31#include <linux/mtd/mtd.h> 32#include <linux/mtd/mtd.h>
32#include <linux/mtd/nand.h> 33#include <linux/mtd/nand.h>
@@ -45,6 +46,7 @@
45#include <mach/nand.h> 46#include <mach/nand.h>
46#include <mach/usb.h> 47#include <mach/usb.h>
47 48
49#include "sdram-micron-mt46h32m32lf-6.h"
48#include "mmc-twl4030.h" 50#include "mmc-twl4030.h"
49 51
50#define OVERO_GPIO_BT_XGATE 15 52#define OVERO_GPIO_BT_XGATE 15
@@ -271,21 +273,76 @@ static struct omap_uart_config overo_uart_config __initdata = {
271 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 273 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
272}; 274};
273 275
276static struct twl4030_hsmmc_info mmc[] = {
277 {
278 .mmc = 1,
279 .wires = 4,
280 .gpio_cd = -EINVAL,
281 .gpio_wp = -EINVAL,
282 },
283 {
284 .mmc = 2,
285 .wires = 4,
286 .gpio_cd = -EINVAL,
287 .gpio_wp = -EINVAL,
288 .transceiver = true,
289 .ocr_mask = 0x00100000, /* 3.3V */
290 },
291 {} /* Terminator */
292};
293
294static struct regulator_consumer_supply overo_vmmc1_supply = {
295 .supply = "vmmc",
296};
297
298static int overo_twl_gpio_setup(struct device *dev,
299 unsigned gpio, unsigned ngpio)
300{
301 twl4030_mmc_init(mmc);
302
303 overo_vmmc1_supply.dev = mmc[0].dev;
304
305 return 0;
306}
307
274static struct twl4030_gpio_platform_data overo_gpio_data = { 308static struct twl4030_gpio_platform_data overo_gpio_data = {
275 .gpio_base = OMAP_MAX_GPIO_LINES, 309 .gpio_base = OMAP_MAX_GPIO_LINES,
276 .irq_base = TWL4030_GPIO_IRQ_BASE, 310 .irq_base = TWL4030_GPIO_IRQ_BASE,
277 .irq_end = TWL4030_GPIO_IRQ_END, 311 .irq_end = TWL4030_GPIO_IRQ_END,
312 .setup = overo_twl_gpio_setup,
313};
314
315static struct twl4030_usb_data overo_usb_data = {
316 .usb_mode = T2_USB_MODE_ULPI,
317};
318
319static struct regulator_init_data overo_vmmc1 = {
320 .constraints = {
321 .min_uV = 1850000,
322 .max_uV = 3150000,
323 .valid_modes_mask = REGULATOR_MODE_NORMAL
324 | REGULATOR_MODE_STANDBY,
325 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
326 | REGULATOR_CHANGE_MODE
327 | REGULATOR_CHANGE_STATUS,
328 },
329 .num_consumer_supplies = 1,
330 .consumer_supplies = &overo_vmmc1_supply,
278}; 331};
279 332
333/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
334
280static struct twl4030_platform_data overo_twldata = { 335static struct twl4030_platform_data overo_twldata = {
281 .irq_base = TWL4030_IRQ_BASE, 336 .irq_base = TWL4030_IRQ_BASE,
282 .irq_end = TWL4030_IRQ_END, 337 .irq_end = TWL4030_IRQ_END,
283 .gpio = &overo_gpio_data, 338 .gpio = &overo_gpio_data,
339 .usb = &overo_usb_data,
340 .vmmc1 = &overo_vmmc1,
284}; 341};
285 342
286static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { 343static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
287 { 344 {
288 I2C_BOARD_INFO("twl4030", 0x48), 345 I2C_BOARD_INFO("tps65950", 0x48),
289 .flags = I2C_CLIENT_WAKE, 346 .flags = I2C_CLIENT_WAKE,
290 .irq = INT_34XX_SYS_NIRQ, 347 .irq = INT_34XX_SYS_NIRQ,
291 .platform_data = &overo_twldata, 348 .platform_data = &overo_twldata,
@@ -303,7 +360,7 @@ static int __init overo_i2c_init(void)
303 360
304static void __init overo_init_irq(void) 361static void __init overo_init_irq(void)
305{ 362{
306 omap2_init_common_hw(NULL); 363 omap2_init_common_hw(mt46h32m32lf6_sdrc_params);
307 omap_init_irq(); 364 omap_init_irq();
308 omap_gpio_init(); 365 omap_gpio_init();
309} 366}
@@ -326,23 +383,6 @@ static struct platform_device *overo_devices[] __initdata = {
326 &overo_lcd_device, 383 &overo_lcd_device,
327}; 384};
328 385
329static struct twl4030_hsmmc_info mmc[] __initdata = {
330 {
331 .mmc = 1,
332 .wires = 4,
333 .gpio_cd = -EINVAL,
334 .gpio_wp = -EINVAL,
335 },
336 {
337 .mmc = 2,
338 .wires = 4,
339 .gpio_cd = -EINVAL,
340 .gpio_wp = -EINVAL,
341 .transceiver = true,
342 },
343 {} /* Terminator */
344};
345
346static void __init overo_init(void) 386static void __init overo_init(void)
347{ 387{
348 overo_i2c_init(); 388 overo_i2c_init();
@@ -350,7 +390,6 @@ static void __init overo_init(void)
350 omap_board_config = overo_config; 390 omap_board_config = overo_config;
351 omap_board_config_size = ARRAY_SIZE(overo_config); 391 omap_board_config_size = ARRAY_SIZE(overo_config);
352 omap_serial_init(); 392 omap_serial_init();
353 twl4030_mmc_init(mmc);
354 overo_flash_init(); 393 overo_flash_init();
355 usb_musb_init(); 394 usb_musb_init();
356 overo_ads7846_init(); 395 overo_ads7846_init();
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index a7381729645c..da93b86234ed 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -27,30 +27,13 @@
27#include <mach/dma.h> 27#include <mach/dma.h>
28#include <mach/gpmc.h> 28#include <mach/gpmc.h>
29#include <mach/keypad.h> 29#include <mach/keypad.h>
30#include <mach/onenand.h>
31#include <mach/gpmc-smc91x.h>
30 32
31#include "mmc-twl4030.h" 33#include "mmc-twl4030.h"
32 34
33 35#define SYSTEM_REV_B_USES_VAUX3 0x1699
34#define SMC91X_CS 1 36#define SYSTEM_REV_S_USES_VAUX3 0x8
35#define SMC91X_GPIO_IRQ 54
36#define SMC91X_GPIO_RESET 164
37#define SMC91X_GPIO_PWRDWN 86
38
39static struct resource rx51_smc91x_resources[] = {
40 [0] = {
41 .flags = IORESOURCE_MEM,
42 },
43 [1] = {
44 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
45 },
46};
47
48static struct platform_device rx51_smc91x_device = {
49 .name = "smc91x",
50 .id = -1,
51 .num_resources = ARRAY_SIZE(rx51_smc91x_resources),
52 .resource = rx51_smc91x_resources,
53};
54 37
55static int rx51_keymap[] = { 38static int rx51_keymap[] = {
56 KEY(0, 0, KEY_Q), 39 KEY(0, 0, KEY_Q),
@@ -107,98 +90,6 @@ static struct twl4030_keypad_data rx51_kp_data = {
107 .rep = 1, 90 .rep = 1,
108}; 91};
109 92
110static struct platform_device *rx51_peripherals_devices[] = {
111 &rx51_smc91x_device,
112};
113
114/*
115 * Timings are taken from smsc-lan91c96-ms.pdf
116 */
117static int smc91x_init_gpmc(int cs)
118{
119 struct gpmc_timings t;
120 const int t2_r = 45; /* t2 in Figure 12.10 */
121 const int t2_w = 30; /* t2 in Figure 12.11 */
122 const int t3 = 15; /* t3 in Figure 12.10 */
123 const int t5_r = 0; /* t5 in Figure 12.10 */
124 const int t6_r = 45; /* t6 in Figure 12.10 */
125 const int t6_w = 0; /* t6 in Figure 12.11 */
126 const int t7_w = 15; /* t7 in Figure 12.11 */
127 const int t15 = 12; /* t15 in Figure 12.2 */
128 const int t20 = 185; /* t20 in Figure 12.2 */
129
130 memset(&t, 0, sizeof(t));
131
132 t.cs_on = t15;
133 t.cs_rd_off = t3 + t2_r + t5_r; /* Figure 12.10 */
134 t.cs_wr_off = t3 + t2_w + t6_w; /* Figure 12.11 */
135 t.adv_on = t3; /* Figure 12.10 */
136 t.adv_rd_off = t3 + t2_r; /* Figure 12.10 */
137 t.adv_wr_off = t3 + t2_w; /* Figure 12.11 */
138 t.oe_off = t3 + t2_r + t5_r; /* Figure 12.10 */
139 t.oe_on = t.oe_off - t6_r; /* Figure 12.10 */
140 t.we_off = t3 + t2_w + t6_w; /* Figure 12.11 */
141 t.we_on = t.we_off - t7_w; /* Figure 12.11 */
142 t.rd_cycle = t20; /* Figure 12.2 */
143 t.wr_cycle = t20; /* Figure 12.4 */
144 t.access = t3 + t2_r + t5_r; /* Figure 12.10 */
145 t.wr_access = t3 + t2_w + t6_w; /* Figure 12.11 */
146
147 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, GPMC_CONFIG1_DEVICESIZE_16);
148
149 return gpmc_cs_set_timings(cs, &t);
150}
151
152static void __init rx51_init_smc91x(void)
153{
154 unsigned long cs_mem_base;
155 int ret;
156
157 omap_cfg_reg(U8_34XX_GPIO54_DOWN);
158 omap_cfg_reg(G25_34XX_GPIO86_OUT);
159 omap_cfg_reg(H19_34XX_GPIO164_OUT);
160
161 if (gpmc_cs_request(SMC91X_CS, SZ_16M, &cs_mem_base) < 0) {
162 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
163 return;
164 }
165
166 rx51_smc91x_resources[0].start = cs_mem_base + 0x300;
167 rx51_smc91x_resources[0].end = cs_mem_base + 0x30f;
168
169 smc91x_init_gpmc(SMC91X_CS);
170
171 if (gpio_request(SMC91X_GPIO_IRQ, "SMC91X irq") < 0)
172 goto free1;
173
174 gpio_direction_input(SMC91X_GPIO_IRQ);
175 rx51_smc91x_resources[1].start = gpio_to_irq(SMC91X_GPIO_IRQ);
176
177 ret = gpio_request(SMC91X_GPIO_PWRDWN, "SMC91X powerdown");
178 if (ret)
179 goto free2;
180 gpio_direction_output(SMC91X_GPIO_PWRDWN, 0);
181
182 ret = gpio_request(SMC91X_GPIO_RESET, "SMC91X reset");
183 if (ret)
184 goto free3;
185 gpio_direction_output(SMC91X_GPIO_RESET, 0);
186 gpio_set_value(SMC91X_GPIO_RESET, 1);
187 msleep(100);
188 gpio_set_value(SMC91X_GPIO_RESET, 0);
189
190 return;
191
192free3:
193 gpio_free(SMC91X_GPIO_PWRDWN);
194free2:
195 gpio_free(SMC91X_GPIO_IRQ);
196free1:
197 gpmc_cs_free(SMC91X_CS);
198
199 printk(KERN_ERR "Could not initialize smc91x\n");
200}
201
202static struct twl4030_madc_platform_data rx51_madc_data = { 93static struct twl4030_madc_platform_data rx51_madc_data = {
203 .irq_line = 1, 94 .irq_line = 1,
204}; 95};
@@ -259,7 +150,7 @@ static struct regulator_init_data rx51_vaux2 = {
259}; 150};
260 151
261/* VAUX3 - adds more power to VIO_18 rail */ 152/* VAUX3 - adds more power to VIO_18 rail */
262static struct regulator_init_data rx51_vaux3 = { 153static struct regulator_init_data rx51_vaux3_cam = {
263 .constraints = { 154 .constraints = {
264 .name = "VCAM_DIG_18", 155 .name = "VCAM_DIG_18",
265 .min_uV = 1800000, 156 .min_uV = 1800000,
@@ -272,6 +163,22 @@ static struct regulator_init_data rx51_vaux3 = {
272 }, 163 },
273}; 164};
274 165
166static struct regulator_init_data rx51_vaux3_mmc = {
167 .constraints = {
168 .name = "VMMC2_30",
169 .min_uV = 2800000,
170 .max_uV = 3000000,
171 .apply_uV = true,
172 .valid_modes_mask = REGULATOR_MODE_NORMAL
173 | REGULATOR_MODE_STANDBY,
174 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
175 | REGULATOR_CHANGE_MODE
176 | REGULATOR_CHANGE_STATUS,
177 },
178 .num_consumer_supplies = 1,
179 .consumer_supplies = &rx51_vmmc2_supply,
180};
181
275static struct regulator_init_data rx51_vaux4 = { 182static struct regulator_init_data rx51_vaux4 = {
276 .constraints = { 183 .constraints = {
277 .name = "VCAM_ANA_28", 184 .name = "VCAM_ANA_28",
@@ -382,10 +289,8 @@ static struct twl4030_platform_data rx51_twldata = {
382 289
383 .vaux1 = &rx51_vaux1, 290 .vaux1 = &rx51_vaux1,
384 .vaux2 = &rx51_vaux2, 291 .vaux2 = &rx51_vaux2,
385 .vaux3 = &rx51_vaux3,
386 .vaux4 = &rx51_vaux4, 292 .vaux4 = &rx51_vaux4,
387 .vmmc1 = &rx51_vmmc1, 293 .vmmc1 = &rx51_vmmc1,
388 .vmmc2 = &rx51_vmmc2,
389 .vsim = &rx51_vsim, 294 .vsim = &rx51_vsim,
390 .vdac = &rx51_vdac, 295 .vdac = &rx51_vdac,
391}; 296};
@@ -401,6 +306,13 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
401 306
402static int __init rx51_i2c_init(void) 307static int __init rx51_i2c_init(void)
403{ 308{
309 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
310 system_rev >= SYSTEM_REV_B_USES_VAUX3)
311 rx51_twldata.vaux3 = &rx51_vaux3_mmc;
312 else {
313 rx51_twldata.vaux3 = &rx51_vaux3_cam;
314 rx51_twldata.vmmc2 = &rx51_vmmc2;
315 }
404 omap_register_i2c_bus(1, 2600, rx51_peripherals_i2c_board_info_1, 316 omap_register_i2c_bus(1, 2600, rx51_peripherals_i2c_board_info_1,
405 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1)); 317 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
406 omap_register_i2c_bus(2, 100, NULL, 0); 318 omap_register_i2c_bus(2, 100, NULL, 0);
@@ -408,12 +320,94 @@ static int __init rx51_i2c_init(void)
408 return 0; 320 return 0;
409} 321}
410 322
323#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
324 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
325
326static struct mtd_partition onenand_partitions[] = {
327 {
328 .name = "bootloader",
329 .offset = 0,
330 .size = 0x20000,
331 .mask_flags = MTD_WRITEABLE, /* Force read-only */
332 },
333 {
334 .name = "config",
335 .offset = MTDPART_OFS_APPEND,
336 .size = 0x60000,
337 },
338 {
339 .name = "log",
340 .offset = MTDPART_OFS_APPEND,
341 .size = 0x40000,
342 },
343 {
344 .name = "kernel",
345 .offset = MTDPART_OFS_APPEND,
346 .size = 0x200000,
347 },
348 {
349 .name = "initfs",
350 .offset = MTDPART_OFS_APPEND,
351 .size = 0x200000,
352 },
353 {
354 .name = "rootfs",
355 .offset = MTDPART_OFS_APPEND,
356 .size = MTDPART_SIZ_FULL,
357 },
358};
359
360static struct omap_onenand_platform_data board_onenand_data = {
361 .cs = 0,
362 .gpio_irq = 65,
363 .parts = onenand_partitions,
364 .nr_parts = ARRAY_SIZE(onenand_partitions),
365};
366
367static void __init board_onenand_init(void)
368{
369 gpmc_onenand_init(&board_onenand_data);
370}
371
372#else
373
374static inline void board_onenand_init(void)
375{
376}
377
378#endif
379
380#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
381
382static struct omap_smc91x_platform_data board_smc91x_data = {
383 .cs = 1,
384 .gpio_irq = 54,
385 .gpio_pwrdwn = 86,
386 .gpio_reset = 164,
387 .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_HIGHLEVEL,
388};
389
390static void __init board_smc91x_init(void)
391{
392 omap_cfg_reg(U8_34XX_GPIO54_DOWN);
393 omap_cfg_reg(G25_34XX_GPIO86_OUT);
394 omap_cfg_reg(H19_34XX_GPIO164_OUT);
395
396 gpmc_smc91x_init(&board_smc91x_data);
397}
398
399#else
400
401static inline void board_smc91x_init(void)
402{
403}
404
405#endif
411 406
412void __init rx51_peripherals_init(void) 407void __init rx51_peripherals_init(void)
413{ 408{
414 platform_add_devices(rx51_peripherals_devices,
415 ARRAY_SIZE(rx51_peripherals_devices));
416 rx51_i2c_init(); 409 rx51_i2c_init();
417 rx51_init_smc91x(); 410 board_onenand_init();
411 board_smc91x_init();
418} 412}
419 413
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
new file mode 100644
index 000000000000..bac5c4321ff7
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -0,0 +1,160 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 * Mikkel Christensen <mlc@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/gpio.h>
13#include <linux/serial_8250.h>
14#include <linux/smsc911x.h>
15
16#include <mach/gpmc.h>
17
18#define ZOOM2_SMSC911X_CS 7
19#define ZOOM2_SMSC911X_GPIO 158
20#define ZOOM2_QUADUART_CS 3
21#define ZOOM2_QUADUART_GPIO 102
22#define QUART_CLK 1843200
23#define DEBUG_BASE 0x08000000
24#define ZOOM2_ETHR_START DEBUG_BASE
25
26static struct resource zoom2_smsc911x_resources[] = {
27 [0] = {
28 .start = ZOOM2_ETHR_START,
29 .end = ZOOM2_ETHR_START + SZ_4K,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
34 },
35};
36
37static struct smsc911x_platform_config zoom2_smsc911x_config = {
38 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
39 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
40 .flags = SMSC911X_USE_32BIT,
41 .phy_interface = PHY_INTERFACE_MODE_MII,
42};
43
44static struct platform_device zoom2_smsc911x_device = {
45 .name = "smsc911x",
46 .id = -1,
47 .num_resources = ARRAY_SIZE(zoom2_smsc911x_resources),
48 .resource = zoom2_smsc911x_resources,
49 .dev = {
50 .platform_data = &zoom2_smsc911x_config,
51 },
52};
53
54static inline void __init zoom2_init_smsc911x(void)
55{
56 int eth_cs;
57 unsigned long cs_mem_base;
58 int eth_gpio = 0;
59
60 eth_cs = ZOOM2_SMSC911X_CS;
61
62 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
63 printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
64 return;
65 }
66
67 zoom2_smsc911x_resources[0].start = cs_mem_base + 0x0;
68 zoom2_smsc911x_resources[0].end = cs_mem_base + 0xff;
69
70 eth_gpio = ZOOM2_SMSC911X_GPIO;
71
72 zoom2_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
73
74 if (gpio_request(eth_gpio, "smsc911x irq") < 0) {
75 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
76 eth_gpio);
77 return;
78 }
79 gpio_direction_input(eth_gpio);
80}
81
82static struct plat_serial8250_port serial_platform_data[] = {
83 {
84 .mapbase = 0x10000000,
85 .irq = OMAP_GPIO_IRQ(102),
86 .flags = UPF_BOOT_AUTOCONF|UPF_IOREMAP|UPF_SHARE_IRQ,
87 .iotype = UPIO_MEM,
88 .regshift = 1,
89 .uartclk = QUART_CLK,
90 }, {
91 .flags = 0
92 }
93};
94
95static struct platform_device zoom2_debugboard_serial_device = {
96 .name = "serial8250",
97 .id = PLAT8250_DEV_PLATFORM1,
98 .dev = {
99 .platform_data = serial_platform_data,
100 },
101};
102
103static inline void __init zoom2_init_quaduart(void)
104{
105 int quart_cs;
106 unsigned long cs_mem_base;
107 int quart_gpio = 0;
108
109 quart_cs = ZOOM2_QUADUART_CS;
110
111 if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) {
112 printk(KERN_ERR "Failed to request GPMC mem"
113 "for Quad UART(TL16CP754C)\n");
114 return;
115 }
116
117 quart_gpio = ZOOM2_QUADUART_GPIO;
118
119 if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) {
120 printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n",
121 quart_gpio);
122 return;
123 }
124 gpio_direction_input(quart_gpio);
125}
126
127static inline int omap_zoom2_debugboard_detect(void)
128{
129 int debug_board_detect = 0;
130
131 debug_board_detect = ZOOM2_SMSC911X_GPIO;
132
133 if (gpio_request(debug_board_detect, "Zoom2 debug board detect") < 0) {
134 printk(KERN_ERR "Failed to request GPIO%d for Zoom2 debug"
135 "board detect\n", debug_board_detect);
136 return 0;
137 }
138 gpio_direction_input(debug_board_detect);
139
140 if (!gpio_get_value(debug_board_detect)) {
141 gpio_free(debug_board_detect);
142 return 0;
143 }
144 return 1;
145}
146
147static struct platform_device *zoom2_devices[] __initdata = {
148 &zoom2_smsc911x_device,
149 &zoom2_debugboard_serial_device,
150};
151
152int __init omap_zoom2_debugboard_init(void)
153{
154 if (!omap_zoom2_debugboard_detect())
155 return 0;
156
157 zoom2_init_smsc911x();
158 zoom2_init_quaduart();
159 return platform_add_devices(zoom2_devices, ARRAY_SIZE(zoom2_devices));
160}
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
new file mode 100644
index 000000000000..bcc0f7632dea
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -0,0 +1,110 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 * Mikkel Christensen <mlc@ti.com>
4 *
5 * Modified from mach-omap2/board-ldp.c
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/gpio.h>
16#include <linux/i2c/twl4030.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20
21#include <mach/common.h>
22#include <mach/usb.h>
23
24#include "mmc-twl4030.h"
25
26static void __init omap_zoom2_init_irq(void)
27{
28 omap2_init_common_hw(NULL);
29 omap_init_irq();
30 omap_gpio_init();
31}
32
33static struct omap_uart_config zoom2_uart_config __initdata = {
34 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
35};
36
37static struct omap_board_config_kernel zoom2_config[] __initdata = {
38 { OMAP_TAG_UART, &zoom2_uart_config },
39};
40
41static struct twl4030_gpio_platform_data zoom2_gpio_data = {
42 .gpio_base = OMAP_MAX_GPIO_LINES,
43 .irq_base = TWL4030_GPIO_IRQ_BASE,
44 .irq_end = TWL4030_GPIO_IRQ_END,
45};
46
47static struct twl4030_platform_data zoom2_twldata = {
48 .irq_base = TWL4030_IRQ_BASE,
49 .irq_end = TWL4030_IRQ_END,
50
51 /* platform_data for children goes here */
52 .gpio = &zoom2_gpio_data,
53};
54
55static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = {
56 {
57 I2C_BOARD_INFO("twl4030", 0x48),
58 .flags = I2C_CLIENT_WAKE,
59 .irq = INT_34XX_SYS_NIRQ,
60 .platform_data = &zoom2_twldata,
61 },
62};
63
64static int __init omap_i2c_init(void)
65{
66 omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo,
67 ARRAY_SIZE(zoom2_i2c_boardinfo));
68 omap_register_i2c_bus(2, 400, NULL, 0);
69 omap_register_i2c_bus(3, 400, NULL, 0);
70 return 0;
71}
72
73static struct twl4030_hsmmc_info mmc[] __initdata = {
74 {
75 .mmc = 1,
76 .wires = 4,
77 .gpio_cd = -EINVAL,
78 .gpio_wp = -EINVAL,
79 },
80 {} /* Terminator */
81};
82
83extern int __init omap_zoom2_debugboard_init(void);
84
85static void __init omap_zoom2_init(void)
86{
87 omap_i2c_init();
88 omap_board_config = zoom2_config;
89 omap_board_config_size = ARRAY_SIZE(zoom2_config);
90 omap_serial_init();
91 omap_zoom2_debugboard_init();
92 twl4030_mmc_init(mmc);
93 usb_musb_init();
94}
95
96static void __init omap_zoom2_map_io(void)
97{
98 omap2_set_globals_343x();
99 omap2_map_common_io();
100}
101
102MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
103 .phys_io = 0x48000000,
104 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
105 .boot_params = 0x80000100,
106 .map_io = omap_zoom2_map_io,
107 .init_irq = omap_zoom2_init_irq,
108 .init_machine = omap_zoom2_init,
109 .timer = &omap_timer,
110MACHINE_END
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 4247a1534411..ba528f85749c 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -91,9 +91,9 @@ static void _omap2xxx_clk_commit(struct clk *clk)
91 return; 91 return;
92 92
93 prm_write_mod_reg(OMAP24XX_VALID_CONFIG, OMAP24XX_GR_MOD, 93 prm_write_mod_reg(OMAP24XX_VALID_CONFIG, OMAP24XX_GR_MOD,
94 OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET); 94 OMAP2_PRCM_CLKCFG_CTRL_OFFSET);
95 /* OCP barrier */ 95 /* OCP barrier */
96 prm_read_mod_reg(OMAP24XX_GR_MOD, OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET); 96 prm_read_mod_reg(OMAP24XX_GR_MOD, OMAP2_PRCM_CLKCFG_CTRL_OFFSET);
97} 97}
98 98
99/* 99/*
@@ -547,8 +547,8 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
547 const struct clksel_rate *clkr; 547 const struct clksel_rate *clkr;
548 u32 last_div = 0; 548 u32 last_div = 0;
549 549
550 printk(KERN_INFO "clock: clksel_round_rate_div: %s target_rate %ld\n", 550 pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n",
551 clk->name, target_rate); 551 clk->name, target_rate);
552 552
553 *new_div = 1; 553 *new_div = 1;
554 554
@@ -562,7 +562,7 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
562 562
563 /* Sanity check */ 563 /* Sanity check */
564 if (clkr->div <= last_div) 564 if (clkr->div <= last_div)
565 printk(KERN_ERR "clock: clksel_rate table not sorted " 565 pr_err("clock: clksel_rate table not sorted "
566 "for clock %s", clk->name); 566 "for clock %s", clk->name);
567 567
568 last_div = clkr->div; 568 last_div = clkr->div;
@@ -574,7 +574,7 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
574 } 574 }
575 575
576 if (!clkr->div) { 576 if (!clkr->div) {
577 printk(KERN_ERR "clock: Could not find divisor for target " 577 pr_err("clock: Could not find divisor for target "
578 "rate %ld for clock %s parent %s\n", target_rate, 578 "rate %ld for clock %s parent %s\n", target_rate,
579 clk->name, clk->parent->name); 579 clk->name, clk->parent->name);
580 return ~0; 580 return ~0;
@@ -582,8 +582,8 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
582 582
583 *new_div = clkr->div; 583 *new_div = clkr->div;
584 584
585 printk(KERN_INFO "clock: new_div = %d, new_rate = %ld\n", *new_div, 585 pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div,
586 (clk->parent->rate / clkr->div)); 586 (clk->parent->rate / clkr->div));
587 587
588 return (clk->parent->rate / clkr->div); 588 return (clk->parent->rate / clkr->div);
589} 589}
@@ -1035,7 +1035,7 @@ void omap2_clk_disable_unused(struct clk *clk)
1035 if ((regval32 & (1 << clk->enable_bit)) == v) 1035 if ((regval32 & (1 << clk->enable_bit)) == v)
1036 return; 1036 return;
1037 1037
1038 printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name); 1038 printk(KERN_DEBUG "Disabling unused clock \"%s\"\n", clk->name);
1039 if (cpu_is_omap34xx()) { 1039 if (cpu_is_omap34xx()) {
1040 omap2_clk_enable(clk); 1040 omap2_clk_enable(clk);
1041 omap2_clk_disable(clk); 1041 omap2_clk_disable(clk);
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index e4cef333e291..44de0271fc2f 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -233,6 +233,8 @@ static struct prcm_config *curr_prcm_set;
233static struct clk *vclk; 233static struct clk *vclk;
234static struct clk *sclk; 234static struct clk *sclk;
235 235
236static void __iomem *prcm_clksrc_ctrl;
237
236/*------------------------------------------------------------------------- 238/*-------------------------------------------------------------------------
237 * Omap24xx specific clock functions 239 * Omap24xx specific clock functions
238 *-------------------------------------------------------------------------*/ 240 *-------------------------------------------------------------------------*/
@@ -269,10 +271,9 @@ static int omap2_enable_osc_ck(struct clk *clk)
269{ 271{
270 u32 pcc; 272 u32 pcc;
271 273
272 pcc = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL); 274 pcc = __raw_readl(prcm_clksrc_ctrl);
273 275
274 __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, 276 __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl);
275 OMAP24XX_PRCM_CLKSRC_CTRL);
276 277
277 return 0; 278 return 0;
278} 279}
@@ -281,10 +282,9 @@ static void omap2_disable_osc_ck(struct clk *clk)
281{ 282{
282 u32 pcc; 283 u32 pcc;
283 284
284 pcc = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL); 285 pcc = __raw_readl(prcm_clksrc_ctrl);
285 286
286 __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, 287 __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl);
287 OMAP24XX_PRCM_CLKSRC_CTRL);
288} 288}
289 289
290static const struct clkops clkops_oscck = { 290static const struct clkops clkops_oscck = {
@@ -654,7 +654,7 @@ static u32 omap2_get_sysclkdiv(void)
654{ 654{
655 u32 div; 655 u32 div;
656 656
657 div = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL); 657 div = __raw_readl(prcm_clksrc_ctrl);
658 div &= OMAP_SYSCLKDIV_MASK; 658 div &= OMAP_SYSCLKDIV_MASK;
659 div >>= OMAP_SYSCLKDIV_SHIFT; 659 div >>= OMAP_SYSCLKDIV_SHIFT;
660 660
@@ -714,15 +714,18 @@ int __init omap2_clk_init(void)
714 struct omap_clk *c; 714 struct omap_clk *c;
715 u32 clkrate; 715 u32 clkrate;
716 716
717 if (cpu_is_omap242x()) 717 if (cpu_is_omap242x()) {
718 prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL;
718 cpu_mask = RATE_IN_242X; 719 cpu_mask = RATE_IN_242X;
719 else if (cpu_is_omap2430()) 720 } else if (cpu_is_omap2430()) {
721 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
720 cpu_mask = RATE_IN_243X; 722 cpu_mask = RATE_IN_243X;
723 }
721 724
722 clk_init(&omap2_clk_functions); 725 clk_init(&omap2_clk_functions);
723 726
724 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) 727 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
725 clk_init_one(c->lk.clk); 728 clk_preinit(c->lk.clk);
726 729
727 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); 730 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
728 propagate_rate(&osc_ck); 731 propagate_rate(&osc_ck);
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index 88c5acb40fcf..458f00cdcbea 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -24,6 +24,17 @@
24#include "cm-regbits-24xx.h" 24#include "cm-regbits-24xx.h"
25#include "sdrc.h" 25#include "sdrc.h"
26 26
27/* REVISIT: These should be set dynamically for CONFIG_MULTI_OMAP2 */
28#ifdef CONFIG_ARCH_OMAP2420
29#define OMAP_CM_REGADDR OMAP2420_CM_REGADDR
30#define OMAP24XX_PRCM_CLKOUT_CTRL OMAP2420_PRCM_CLKOUT_CTRL
31#define OMAP24XX_PRCM_CLKEMUL_CTRL OMAP2420_PRCM_CLKEMUL_CTRL
32#else
33#define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
34#define OMAP24XX_PRCM_CLKOUT_CTRL OMAP2430_PRCM_CLKOUT_CTRL
35#define OMAP24XX_PRCM_CLKEMUL_CTRL OMAP2430_PRCM_CLKEMUL_CTRL
36#endif
37
27static unsigned long omap2_table_mpu_recalc(struct clk *clk); 38static unsigned long omap2_table_mpu_recalc(struct clk *clk);
28static int omap2_select_table_rate(struct clk *clk, unsigned long rate); 39static int omap2_select_table_rate(struct clk *clk, unsigned long rate);
29static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); 40static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate);
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index ba05aa42bd8e..9e43fe5209d3 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -129,6 +129,9 @@ static struct omap_clk omap34xx_clks[] = {
129 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2), 129 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2),
130 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2), 130 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2),
131 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), 131 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1),
132 CLK(NULL, "modem_fck", &modem_fck, CK_343X),
133 CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X),
134 CLK(NULL, "mad2d_ick", &mad2d_ick, CK_343X),
132 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X), 135 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X),
133 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X), 136 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X),
134 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2), 137 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2),
@@ -281,6 +284,8 @@ static struct omap_clk omap34xx_clks[] = {
281 284
282#define MAX_DPLL_WAIT_TRIES 1000000 285#define MAX_DPLL_WAIT_TRIES 1000000
283 286
287#define MIN_SDRC_DLL_LOCK_FREQ 83000000
288
284/** 289/**
285 * omap3_dpll_recalc - recalculate DPLL rate 290 * omap3_dpll_recalc - recalculate DPLL rate
286 * @clk: DPLL struct clk 291 * @clk: DPLL struct clk
@@ -703,6 +708,7 @@ static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate)
703static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) 708static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
704{ 709{
705 u32 new_div = 0; 710 u32 new_div = 0;
711 u32 unlock_dll = 0;
706 unsigned long validrate, sdrcrate; 712 unsigned long validrate, sdrcrate;
707 struct omap_sdrc_params *sp; 713 struct omap_sdrc_params *sp;
708 714
@@ -729,17 +735,22 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
729 if (!sp) 735 if (!sp)
730 return -EINVAL; 736 return -EINVAL;
731 737
732 pr_info("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, 738 if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) {
733 validrate); 739 pr_debug("clock: will unlock SDRC DLL\n");
734 pr_info("clock: SDRC timing params used: %08x %08x %08x\n", 740 unlock_dll = 1;
735 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); 741 }
742
743 pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate,
744 validrate);
745 pr_debug("clock: SDRC timing params used: %08x %08x %08x\n",
746 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb);
736 747
737 /* REVISIT: SRAM code doesn't support other M2 divisors yet */ 748 /* REVISIT: SRAM code doesn't support other M2 divisors yet */
738 WARN_ON(new_div != 1 && new_div != 2); 749 WARN_ON(new_div != 1 && new_div != 2);
739 750
740 /* REVISIT: Add SDRC_MR changing to this code also */ 751 /* REVISIT: Add SDRC_MR changing to this code also */
741 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, 752 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla,
742 sp->actim_ctrlb, new_div); 753 sp->actim_ctrlb, new_div, unlock_dll);
743 754
744 return 0; 755 return 0;
745} 756}
@@ -956,7 +967,7 @@ int __init omap2_clk_init(void)
956 clk_init(&omap2_clk_functions); 967 clk_init(&omap2_clk_functions);
957 968
958 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) 969 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++)
959 clk_init_one(c->lk.clk); 970 clk_preinit(c->lk.clk);
960 971
961 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) 972 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++)
962 if (c->cpu & cpu_clkflg) { 973 if (c->cpu & cpu_clkflg) {
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 017a30e9aa1d..e433aec4efdd 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -27,6 +27,8 @@
27#include "prm.h" 27#include "prm.h"
28#include "prm-regbits-34xx.h" 28#include "prm-regbits-34xx.h"
29 29
30#define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR
31
30static unsigned long omap3_dpll_recalc(struct clk *clk); 32static unsigned long omap3_dpll_recalc(struct clk *clk);
31static unsigned long omap3_clkoutx2_recalc(struct clk *clk); 33static unsigned long omap3_clkoutx2_recalc(struct clk *clk);
32static void omap3_dpll_allow_idle(struct clk *clk); 34static void omap3_dpll_allow_idle(struct clk *clk);
@@ -1228,6 +1230,37 @@ static struct clk d2d_26m_fck = {
1228 .recalc = &followparent_recalc, 1230 .recalc = &followparent_recalc,
1229}; 1231};
1230 1232
1233static struct clk modem_fck = {
1234 .name = "modem_fck",
1235 .ops = &clkops_omap2_dflt_wait,
1236 .parent = &sys_ck,
1237 .init = &omap2_init_clk_clkdm,
1238 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1239 .enable_bit = OMAP3430_EN_MODEM_SHIFT,
1240 .clkdm_name = "d2d_clkdm",
1241 .recalc = &followparent_recalc,
1242};
1243
1244static struct clk sad2d_ick = {
1245 .name = "sad2d_ick",
1246 .ops = &clkops_omap2_dflt_wait,
1247 .parent = &l3_ick,
1248 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1249 .enable_bit = OMAP3430_EN_SAD2D_SHIFT,
1250 .clkdm_name = "d2d_clkdm",
1251 .recalc = &followparent_recalc,
1252};
1253
1254static struct clk mad2d_ick = {
1255 .name = "mad2d_ick",
1256 .ops = &clkops_omap2_dflt_wait,
1257 .parent = &l3_ick,
1258 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1259 .enable_bit = OMAP3430_EN_MAD2D_SHIFT,
1260 .clkdm_name = "d2d_clkdm",
1261 .recalc = &followparent_recalc,
1262};
1263
1231static const struct clksel omap343x_gpt_clksel[] = { 1264static const struct clksel omap343x_gpt_clksel[] = {
1232 { .parent = &omap_32k_fck, .rates = gpt_32k_rates }, 1265 { .parent = &omap_32k_fck, .rates = gpt_32k_rates },
1233 { .parent = &sys_ck, .rates = gpt_sys_rates }, 1266 { .parent = &sys_ck, .rates = gpt_sys_rates },
@@ -1945,8 +1978,6 @@ static struct clk usb_l4_ick = {
1945 .recalc = &omap2_clksel_recalc, 1978 .recalc = &omap2_clksel_recalc,
1946}; 1979};
1947 1980
1948/* XXX MDM_INTC_ICK, SAD2D_ICK ?? */
1949
1950/* SECURITY_L4_ICK2 based clocks */ 1981/* SECURITY_L4_ICK2 based clocks */
1951 1982
1952static struct clk security_l4_ick2 = { 1983static struct clk security_l4_ick2 = {
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
index 281d5da19188..fe319ae4ca0a 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -195,7 +195,7 @@ static struct clockdomain sgx_clkdm = {
195static struct clockdomain d2d_clkdm = { 195static struct clockdomain d2d_clkdm = {
196 .name = "d2d_clkdm", 196 .name = "d2d_clkdm",
197 .pwrdm = { .name = "core_pwrdm" }, 197 .pwrdm = { .name = "core_pwrdm" },
198 .flags = CLKDM_CAN_HWSUP, 198 .flags = CLKDM_CAN_HWSUP_SWSUP,
199 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, 199 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
201}; 201};
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 6f3f5a36aae6..6923deb98a28 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -145,6 +145,8 @@
145#define OMAP3430_CLKACTIVITY_MPU_MASK (1 << 0) 145#define OMAP3430_CLKACTIVITY_MPU_MASK (1 << 0)
146 146
147/* CM_FCLKEN1_CORE specific bits */ 147/* CM_FCLKEN1_CORE specific bits */
148#define OMAP3430_EN_MODEM (1 << 31)
149#define OMAP3430_EN_MODEM_SHIFT 31
148 150
149/* CM_ICLKEN1_CORE specific bits */ 151/* CM_ICLKEN1_CORE specific bits */
150#define OMAP3430_EN_ICR (1 << 29) 152#define OMAP3430_EN_ICR (1 << 29)
@@ -161,6 +163,8 @@
161#define OMAP3430_EN_MAILBOXES_SHIFT 7 163#define OMAP3430_EN_MAILBOXES_SHIFT 7
162#define OMAP3430_EN_OMAPCTRL (1 << 6) 164#define OMAP3430_EN_OMAPCTRL (1 << 6)
163#define OMAP3430_EN_OMAPCTRL_SHIFT 6 165#define OMAP3430_EN_OMAPCTRL_SHIFT 6
166#define OMAP3430_EN_SAD2D (1 << 3)
167#define OMAP3430_EN_SAD2D_SHIFT 3
164#define OMAP3430_EN_SDRC (1 << 1) 168#define OMAP3430_EN_SDRC (1 << 1)
165#define OMAP3430_EN_SDRC_SHIFT 1 169#define OMAP3430_EN_SDRC_SHIFT 1
166 170
@@ -176,6 +180,10 @@
176#define OMAP3430_EN_DES1 (1 << 0) 180#define OMAP3430_EN_DES1 (1 << 0)
177#define OMAP3430_EN_DES1_SHIFT 0 181#define OMAP3430_EN_DES1_SHIFT 0
178 182
183/* CM_ICLKEN3_CORE */
184#define OMAP3430_EN_MAD2D_SHIFT 3
185#define OMAP3430_EN_MAD2D (1 << 3)
186
179/* CM_FCLKEN3_CORE specific bits */ 187/* CM_FCLKEN3_CORE specific bits */
180#define OMAP3430ES2_EN_TS_SHIFT 1 188#define OMAP3430ES2_EN_TS_SHIFT 1
181#define OMAP3430ES2_EN_TS_MASK (1 << 1) 189#define OMAP3430ES2_EN_TS_MASK (1 << 1)
@@ -231,6 +239,8 @@
231#define OMAP3430ES2_ST_CPEFUSE_MASK (1 << 0) 239#define OMAP3430ES2_ST_CPEFUSE_MASK (1 << 0)
232 240
233/* CM_AUTOIDLE1_CORE */ 241/* CM_AUTOIDLE1_CORE */
242#define OMAP3430_AUTO_MODEM (1 << 31)
243#define OMAP3430_AUTO_MODEM_SHIFT 31
234#define OMAP3430ES2_AUTO_MMC3 (1 << 30) 244#define OMAP3430ES2_AUTO_MMC3 (1 << 30)
235#define OMAP3430ES2_AUTO_MMC3_SHIFT 30 245#define OMAP3430ES2_AUTO_MMC3_SHIFT 30
236#define OMAP3430ES2_AUTO_ICR (1 << 29) 246#define OMAP3430ES2_AUTO_ICR (1 << 29)
@@ -287,6 +297,8 @@
287#define OMAP3430_AUTO_HSOTGUSB_SHIFT 4 297#define OMAP3430_AUTO_HSOTGUSB_SHIFT 4
288#define OMAP3430ES1_AUTO_D2D (1 << 3) 298#define OMAP3430ES1_AUTO_D2D (1 << 3)
289#define OMAP3430ES1_AUTO_D2D_SHIFT 3 299#define OMAP3430ES1_AUTO_D2D_SHIFT 3
300#define OMAP3430_AUTO_SAD2D (1 << 3)
301#define OMAP3430_AUTO_SAD2D_SHIFT 3
290#define OMAP3430_AUTO_SSI (1 << 0) 302#define OMAP3430_AUTO_SSI (1 << 0)
291#define OMAP3430_AUTO_SSI_SHIFT 0 303#define OMAP3430_AUTO_SSI_SHIFT 0
292 304
@@ -308,6 +320,8 @@
308#define OMAP3430ES2_AUTO_USBTLL (1 << 2) 320#define OMAP3430ES2_AUTO_USBTLL (1 << 2)
309#define OMAP3430ES2_AUTO_USBTLL_SHIFT 2 321#define OMAP3430ES2_AUTO_USBTLL_SHIFT 2
310#define OMAP3430ES2_AUTO_USBTLL_MASK (1 << 2) 322#define OMAP3430ES2_AUTO_USBTLL_MASK (1 << 2)
323#define OMAP3430_AUTO_MAD2D_SHIFT 3
324#define OMAP3430_AUTO_MAD2D (1 << 3)
311 325
312/* CM_CLKSEL_CORE */ 326/* CM_CLKSEL_CORE */
313#define OMAP3430_CLKSEL_SSI_SHIFT 8 327#define OMAP3430_CLKSEL_SSI_SHIFT 8
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index 65fdf78c91e1..1d3c93bf86d3 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -16,17 +16,12 @@
16 16
17#include "prcm-common.h" 17#include "prcm-common.h"
18 18
19#ifndef __ASSEMBLER__
20#define OMAP_CM_REGADDR(module, reg) \
21 IO_ADDRESS(OMAP2_CM_BASE + (module) + (reg))
22#else
23#define OMAP2420_CM_REGADDR(module, reg) \ 19#define OMAP2420_CM_REGADDR(module, reg) \
24 IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg)) 20 IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
25#define OMAP2430_CM_REGADDR(module, reg) \ 21#define OMAP2430_CM_REGADDR(module, reg) \
26 IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg)) 22 IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
27#define OMAP34XX_CM_REGADDR(module, reg) \ 23#define OMAP34XX_CM_REGADDR(module, reg) \
28 IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg)) 24 IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
29#endif
30 25
31/* 26/*
32 * Architecture-specific global CM registers 27 * Architecture-specific global CM registers
@@ -38,6 +33,7 @@
38#define OMAP3430_CM_SYSCONFIG OMAP_CM_REGADDR(OCP_MOD, 0x0010) 33#define OMAP3430_CM_SYSCONFIG OMAP_CM_REGADDR(OCP_MOD, 0x0010)
39#define OMAP3430_CM_POLCTRL OMAP_CM_REGADDR(OCP_MOD, 0x009c) 34#define OMAP3430_CM_POLCTRL OMAP_CM_REGADDR(OCP_MOD, 0x009c)
40 35
36#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
41#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070) 37#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
42 38
43/* 39/*
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
new file mode 100644
index 000000000000..2fd22f9c5f0e
--- /dev/null
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -0,0 +1,330 @@
1/*
2 * linux/arch/arm/mach-omap2/gpmc-onenand.c
3 *
4 * Copyright (C) 2006 - 2009 Nokia Corporation
5 * Contacts: Juha Yrjola
6 * Tony Lindgren
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/mtd/onenand_regs.h>
16#include <linux/io.h>
17
18#include <asm/mach/flash.h>
19
20#include <mach/onenand.h>
21#include <mach/board.h>
22#include <mach/gpmc.h>
23
24static struct omap_onenand_platform_data *gpmc_onenand_data;
25
26static struct platform_device gpmc_onenand_device = {
27 .name = "omap2-onenand",
28 .id = -1,
29};
30
31static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
32{
33 struct gpmc_timings t;
34
35 const int t_cer = 15;
36 const int t_avdp = 12;
37 const int t_aavdh = 7;
38 const int t_ce = 76;
39 const int t_aa = 76;
40 const int t_oe = 20;
41 const int t_cez = 20; /* max of t_cez, t_oez */
42 const int t_ds = 30;
43 const int t_wpl = 40;
44 const int t_wph = 30;
45
46 memset(&t, 0, sizeof(t));
47 t.sync_clk = 0;
48 t.cs_on = 0;
49 t.adv_on = 0;
50
51 /* Read */
52 t.adv_rd_off = gpmc_round_ns_to_ticks(max_t(int, t_avdp, t_cer));
53 t.oe_on = t.adv_rd_off + gpmc_round_ns_to_ticks(t_aavdh);
54 t.access = t.adv_on + gpmc_round_ns_to_ticks(t_aa);
55 t.access = max_t(int, t.access, t.cs_on + gpmc_round_ns_to_ticks(t_ce));
56 t.access = max_t(int, t.access, t.oe_on + gpmc_round_ns_to_ticks(t_oe));
57 t.oe_off = t.access + gpmc_round_ns_to_ticks(1);
58 t.cs_rd_off = t.oe_off;
59 t.rd_cycle = t.cs_rd_off + gpmc_round_ns_to_ticks(t_cez);
60
61 /* Write */
62 t.adv_wr_off = t.adv_rd_off;
63 t.we_on = t.oe_on;
64 if (cpu_is_omap34xx()) {
65 t.wr_data_mux_bus = t.we_on;
66 t.wr_access = t.we_on + gpmc_round_ns_to_ticks(t_ds);
67 }
68 t.we_off = t.we_on + gpmc_round_ns_to_ticks(t_wpl);
69 t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph);
70 t.wr_cycle = t.cs_wr_off + gpmc_round_ns_to_ticks(t_cez);
71
72 /* Configure GPMC for asynchronous read */
73 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
74 GPMC_CONFIG1_DEVICESIZE_16 |
75 GPMC_CONFIG1_MUXADDDATA);
76
77 return gpmc_cs_set_timings(cs, &t);
78}
79
80static void set_onenand_cfg(void __iomem *onenand_base, int latency,
81 int sync_read, int sync_write, int hf)
82{
83 u32 reg;
84
85 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
86 reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9));
87 reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) |
88 ONENAND_SYS_CFG1_BL_16;
89 if (sync_read)
90 reg |= ONENAND_SYS_CFG1_SYNC_READ;
91 else
92 reg &= ~ONENAND_SYS_CFG1_SYNC_READ;
93 if (sync_write)
94 reg |= ONENAND_SYS_CFG1_SYNC_WRITE;
95 else
96 reg &= ~ONENAND_SYS_CFG1_SYNC_WRITE;
97 if (hf)
98 reg |= ONENAND_SYS_CFG1_HF;
99 else
100 reg &= ~ONENAND_SYS_CFG1_HF;
101 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
102}
103
104static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
105 void __iomem *onenand_base,
106 int freq)
107{
108 struct gpmc_timings t;
109 const int t_cer = 15;
110 const int t_avdp = 12;
111 const int t_cez = 20; /* max of t_cez, t_oez */
112 const int t_ds = 30;
113 const int t_wpl = 40;
114 const int t_wph = 30;
115 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
116 int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
117 int first_time = 0, hf = 0, sync_read = 0, sync_write = 0;
118 int err, ticks_cez;
119 int cs = cfg->cs;
120 u32 reg;
121
122 if (cfg->flags & ONENAND_SYNC_READ) {
123 sync_read = 1;
124 } else if (cfg->flags & ONENAND_SYNC_READWRITE) {
125 sync_read = 1;
126 sync_write = 1;
127 }
128
129 if (!freq) {
130 /* Very first call freq is not known */
131 err = omap2_onenand_set_async_mode(cs, onenand_base);
132 if (err)
133 return err;
134 reg = readw(onenand_base + ONENAND_REG_VERSION_ID);
135 switch ((reg >> 4) & 0xf) {
136 case 0:
137 freq = 40;
138 break;
139 case 1:
140 freq = 54;
141 break;
142 case 2:
143 freq = 66;
144 break;
145 case 3:
146 freq = 83;
147 break;
148 case 4:
149 freq = 104;
150 break;
151 default:
152 freq = 54;
153 break;
154 }
155 first_time = 1;
156 }
157
158 switch (freq) {
159 case 83:
160 min_gpmc_clk_period = 12; /* 83 MHz */
161 t_ces = 5;
162 t_avds = 4;
163 t_avdh = 2;
164 t_ach = 6;
165 t_aavdh = 6;
166 t_rdyo = 9;
167 break;
168 case 66:
169 min_gpmc_clk_period = 15; /* 66 MHz */
170 t_ces = 6;
171 t_avds = 5;
172 t_avdh = 2;
173 t_ach = 6;
174 t_aavdh = 6;
175 t_rdyo = 11;
176 break;
177 default:
178 min_gpmc_clk_period = 18; /* 54 MHz */
179 t_ces = 7;
180 t_avds = 7;
181 t_avdh = 7;
182 t_ach = 9;
183 t_aavdh = 7;
184 t_rdyo = 15;
185 sync_write = 0;
186 break;
187 }
188
189 tick_ns = gpmc_ticks_to_ns(1);
190 div = gpmc_cs_calc_divider(cs, min_gpmc_clk_period);
191 gpmc_clk_ns = gpmc_ticks_to_ns(div);
192 if (gpmc_clk_ns < 15) /* >66Mhz */
193 hf = 1;
194 if (hf)
195 latency = 6;
196 else if (gpmc_clk_ns >= 25) /* 40 MHz*/
197 latency = 3;
198 else
199 latency = 4;
200
201 if (first_time)
202 set_onenand_cfg(onenand_base, latency,
203 sync_read, sync_write, hf);
204
205 if (div == 1) {
206 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2);
207 reg |= (1 << 7);
208 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG2, reg);
209 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG3);
210 reg |= (1 << 7);
211 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG3, reg);
212 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG4);
213 reg |= (1 << 7);
214 reg |= (1 << 23);
215 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG4, reg);
216 } else {
217 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2);
218 reg &= ~(1 << 7);
219 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG2, reg);
220 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG3);
221 reg &= ~(1 << 7);
222 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG3, reg);
223 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG4);
224 reg &= ~(1 << 7);
225 reg &= ~(1 << 23);
226 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG4, reg);
227 }
228
229 /* Set synchronous read timings */
230 memset(&t, 0, sizeof(t));
231 t.sync_clk = min_gpmc_clk_period;
232 t.cs_on = 0;
233 t.adv_on = 0;
234 fclk_offset_ns = gpmc_round_ns_to_ticks(max_t(int, t_ces, t_avds));
235 fclk_offset = gpmc_ns_to_ticks(fclk_offset_ns);
236 t.page_burst_access = gpmc_clk_ns;
237
238 /* Read */
239 t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh));
240 t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach));
241 t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div);
242 t.oe_off = t.access + gpmc_round_ns_to_ticks(1);
243 t.cs_rd_off = t.oe_off;
244 ticks_cez = ((gpmc_ns_to_ticks(t_cez) + div - 1) / div) * div;
245 t.rd_cycle = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div +
246 ticks_cez);
247
248 /* Write */
249 if (sync_write) {
250 t.adv_wr_off = t.adv_rd_off;
251 t.we_on = 0;
252 t.we_off = t.cs_rd_off;
253 t.cs_wr_off = t.cs_rd_off;
254 t.wr_cycle = t.rd_cycle;
255 if (cpu_is_omap34xx()) {
256 t.wr_data_mux_bus = gpmc_ticks_to_ns(fclk_offset +
257 gpmc_ns_to_ticks(min_gpmc_clk_period +
258 t_rdyo));
259 t.wr_access = t.access;
260 }
261 } else {
262 t.adv_wr_off = gpmc_round_ns_to_ticks(max_t(int,
263 t_avdp, t_cer));
264 t.we_on = t.adv_wr_off + gpmc_round_ns_to_ticks(t_aavdh);
265 t.we_off = t.we_on + gpmc_round_ns_to_ticks(t_wpl);
266 t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph);
267 t.wr_cycle = t.cs_wr_off + gpmc_round_ns_to_ticks(t_cez);
268 if (cpu_is_omap34xx()) {
269 t.wr_data_mux_bus = t.we_on;
270 t.wr_access = t.we_on + gpmc_round_ns_to_ticks(t_ds);
271 }
272 }
273
274 /* Configure GPMC for synchronous read */
275 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
276 GPMC_CONFIG1_WRAPBURST_SUPP |
277 GPMC_CONFIG1_READMULTIPLE_SUPP |
278 (sync_read ? GPMC_CONFIG1_READTYPE_SYNC : 0) |
279 (sync_write ? GPMC_CONFIG1_WRITEMULTIPLE_SUPP : 0) |
280 (sync_write ? GPMC_CONFIG1_WRITETYPE_SYNC : 0) |
281 GPMC_CONFIG1_CLKACTIVATIONTIME(fclk_offset) |
282 GPMC_CONFIG1_PAGE_LEN(2) |
283 (cpu_is_omap34xx() ? 0 :
284 (GPMC_CONFIG1_WAIT_READ_MON |
285 GPMC_CONFIG1_WAIT_PIN_SEL(0))) |
286 GPMC_CONFIG1_DEVICESIZE_16 |
287 GPMC_CONFIG1_DEVICETYPE_NOR |
288 GPMC_CONFIG1_MUXADDDATA);
289
290 err = gpmc_cs_set_timings(cs, &t);
291 if (err)
292 return err;
293
294 set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf);
295
296 return 0;
297}
298
299static int gpmc_onenand_setup(void __iomem *onenand_base, int freq)
300{
301 struct device *dev = &gpmc_onenand_device.dev;
302
303 /* Set sync timings in GPMC */
304 if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base,
305 freq) < 0) {
306 dev_err(dev, "Unable to set synchronous mode\n");
307 return -EINVAL;
308 }
309
310 return 0;
311}
312
313void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
314{
315 gpmc_onenand_data = _onenand_data;
316 gpmc_onenand_data->onenand_setup = gpmc_onenand_setup;
317 gpmc_onenand_device.dev.platform_data = gpmc_onenand_data;
318
319 if (cpu_is_omap24xx() &&
320 (gpmc_onenand_data->flags & ONENAND_SYNC_READWRITE)) {
321 printk(KERN_ERR "Onenand using only SYNC_READ on 24xx\n");
322 gpmc_onenand_data->flags &= ~ONENAND_SYNC_READWRITE;
323 gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
324 }
325
326 if (platform_device_register(&gpmc_onenand_device) < 0) {
327 printk(KERN_ERR "Unable to register OneNAND device\n");
328 return;
329 }
330}
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
new file mode 100644
index 000000000000..df99d31d8b64
--- /dev/null
+++ b/arch/arm/mach-omap2/gpmc-smc91x.c
@@ -0,0 +1,189 @@
1/*
2 * linux/arch/arm/mach-omap2/gpmc-smc91x.c
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Contact: Tony Lindgren
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
14#include <linux/gpio.h>
15#include <linux/delay.h>
16#include <linux/interrupt.h>
17#include <linux/io.h>
18#include <linux/smc91x.h>
19
20#include <mach/board.h>
21#include <mach/gpmc.h>
22#include <mach/gpmc-smc91x.h>
23
24static struct omap_smc91x_platform_data *gpmc_cfg;
25
26static struct resource gpmc_smc91x_resources[] = {
27 [0] = {
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .flags = IORESOURCE_IRQ,
32 },
33};
34
35static struct smc91x_platdata gpmc_smc91x_info = {
36 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_IO_SHIFT_0,
37};
38
39static struct platform_device gpmc_smc91x_device = {
40 .name = "smc91x",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(gpmc_smc91x_resources),
43 .resource = gpmc_smc91x_resources,
44 .dev = {
45 .platform_data = &gpmc_smc91x_info,
46 },
47};
48
49/*
50 * Set the gpmc timings for smc91c96. The timings are taken
51 * from the data sheet available at:
52 * http://www.smsc.com/main/catalog/lan91c96.html
53 * REVISIT: Level shifters can add at least to the access latency.
54 */
55static int smc91c96_gpmc_retime(void)
56{
57 struct gpmc_timings t;
58 const int t3 = 10; /* Figure 12.2 read and 12.4 write */
59 const int t4_r = 20; /* Figure 12.2 read */
60 const int t4_w = 5; /* Figure 12.4 write */
61 const int t5 = 25; /* Figure 12.2 read */
62 const int t6 = 15; /* Figure 12.2 read */
63 const int t7 = 5; /* Figure 12.4 write */
64 const int t8 = 5; /* Figure 12.4 write */
65 const int t20 = 185; /* Figure 12.2 read and 12.4 write */
66 u32 l;
67
68 memset(&t, 0, sizeof(t));
69
70 /* Read timings */
71 t.cs_on = 0;
72 t.adv_on = t.cs_on;
73 t.oe_on = t.adv_on + t3;
74 t.access = t.oe_on + t5;
75 t.oe_off = t.access;
76 t.adv_rd_off = t.oe_off + max(t4_r, t6);
77 t.cs_rd_off = t.oe_off;
78 t.rd_cycle = t20 - t.oe_on;
79
80 /* Write timings */
81 t.we_on = t.adv_on + t3;
82
83 if (cpu_is_omap34xx() && (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)) {
84 t.wr_data_mux_bus = t.we_on;
85 t.we_off = t.wr_data_mux_bus + t7;
86 } else
87 t.we_off = t.we_on + t7;
88 if (cpu_is_omap34xx())
89 t.wr_access = t.we_off;
90 t.adv_wr_off = t.we_off + max(t4_w, t8);
91 t.cs_wr_off = t.we_off + t4_w;
92 t.wr_cycle = t20 - t.we_on;
93
94 l = GPMC_CONFIG1_DEVICESIZE_16;
95 if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
96 l |= GPMC_CONFIG1_MUXADDDATA;
97 if (gpmc_cfg->flags & GPMC_READ_MON)
98 l |= GPMC_CONFIG1_WAIT_READ_MON;
99 if (gpmc_cfg->flags & GPMC_WRITE_MON)
100 l |= GPMC_CONFIG1_WAIT_WRITE_MON;
101 if (gpmc_cfg->wait_pin)
102 l |= GPMC_CONFIG1_WAIT_PIN_SEL(gpmc_cfg->wait_pin);
103 gpmc_cs_write_reg(gpmc_cfg->cs, GPMC_CS_CONFIG1, l);
104
105 /*
106 * FIXME: Calculate the address and data bus muxed timings.
107 * Note that at least adv_rd_off needs to be changed according
108 * to omap3430 TRM Figure 11-11. Are the sdp boards using the
109 * FPGA in between smc91x and omap as the timings are different
110 * from above?
111 */
112 if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
113 return 0;
114
115 return gpmc_cs_set_timings(gpmc_cfg->cs, &t);
116}
117
118/*
119 * Initialize smc91x device connected to the GPMC. Note that we
120 * assume that pin multiplexing is done in the board-*.c file,
121 * or in the bootloader.
122 */
123void __init gpmc_smc91x_init(struct omap_smc91x_platform_data *board_data)
124{
125 unsigned long cs_mem_base;
126 int ret;
127
128 gpmc_cfg = board_data;
129
130 if (gpmc_cfg->flags & GPMC_TIMINGS_SMC91C96)
131 gpmc_cfg->retime = smc91c96_gpmc_retime;
132
133 if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) {
134 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
135 return;
136 }
137
138 gpmc_smc91x_resources[0].start = cs_mem_base + 0x300;
139 gpmc_smc91x_resources[0].end = cs_mem_base + 0x30f;
140 gpmc_smc91x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK);
141
142 if (gpmc_cfg->retime) {
143 ret = gpmc_cfg->retime();
144 if (ret != 0)
145 goto free1;
146 }
147
148 if (gpio_request(gpmc_cfg->gpio_irq, "SMC91X irq") < 0)
149 goto free1;
150
151 gpio_direction_input(gpmc_cfg->gpio_irq);
152 gpmc_smc91x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq);
153
154 if (gpmc_cfg->gpio_pwrdwn) {
155 ret = gpio_request(gpmc_cfg->gpio_pwrdwn, "SMC91X powerdown");
156 if (ret)
157 goto free2;
158 gpio_direction_output(gpmc_cfg->gpio_pwrdwn, 0);
159 }
160
161 if (gpmc_cfg->gpio_reset) {
162 ret = gpio_request(gpmc_cfg->gpio_reset, "SMC91X reset");
163 if (ret)
164 goto free3;
165
166 gpio_direction_output(gpmc_cfg->gpio_reset, 0);
167 gpio_set_value(gpmc_cfg->gpio_reset, 1);
168 msleep(100);
169 gpio_set_value(gpmc_cfg->gpio_reset, 0);
170 }
171
172 if (platform_device_register(&gpmc_smc91x_device) < 0) {
173 printk(KERN_ERR "Unable to register smc91x device\n");
174 gpio_free(gpmc_cfg->gpio_reset);
175 goto free3;
176 }
177
178 return;
179
180free3:
181 if (gpmc_cfg->gpio_pwrdwn)
182 gpio_free(gpmc_cfg->gpio_pwrdwn);
183free2:
184 gpio_free(gpmc_cfg->gpio_irq);
185free1:
186 gpmc_cs_free(gpmc_cfg->cs);
187
188 printk(KERN_ERR "Could not initialize smc91x\n");
189}
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 2249049c1d5a..f91934b2b092 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -5,6 +5,9 @@
5 * 5 *
6 * Author: Juha Yrjola 6 * Author: Juha Yrjola
7 * 7 *
8 * Copyright (C) 2009 Texas Instruments
9 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
10 *
8 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
@@ -424,6 +427,9 @@ void __init gpmc_init(void)
424 } else if (cpu_is_omap34xx()) { 427 } else if (cpu_is_omap34xx()) {
425 ck = "gpmc_fck"; 428 ck = "gpmc_fck";
426 l = OMAP34XX_GPMC_BASE; 429 l = OMAP34XX_GPMC_BASE;
430 } else if (cpu_is_omap44xx()) {
431 ck = "gpmc_fck";
432 l = OMAP44XX_GPMC_BASE;
427 } 433 }
428 434
429 gpmc_l3_clk = clk_get(NULL, ck); 435 gpmc_l3_clk = clk_get(NULL, ck);
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 34b5914e0f8b..458990e20c60 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -6,6 +6,9 @@
6 * Copyright (C) 2005 Nokia Corporation 6 * Copyright (C) 2005 Nokia Corporation
7 * Written by Tony Lindgren <tony@atomide.com> 7 * Written by Tony Lindgren <tony@atomide.com>
8 * 8 *
9 * Copyright (C) 2009 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
9 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
@@ -200,7 +203,10 @@ void __init omap2_check_revision(void)
200 omap24xx_check_revision(); 203 omap24xx_check_revision();
201 else if (cpu_is_omap34xx()) 204 else if (cpu_is_omap34xx())
202 omap34xx_check_revision(); 205 omap34xx_check_revision();
203 else 206 else if (cpu_is_omap44xx()) {
207 printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n");
208 return;
209 } else
204 pr_err("OMAP revision unknown, please fix!\n"); 210 pr_err("OMAP revision unknown, please fix!\n");
205 211
206 /* 212 /*
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 916fcd3a2328..32afd9448216 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -4,12 +4,14 @@
4 * OMAP2 I/O mapping code 4 * OMAP2 I/O mapping code
5 * 5 *
6 * Copyright (C) 2005 Nokia Corporation 6 * Copyright (C) 2005 Nokia Corporation
7 * Copyright (C) 2007 Texas Instruments 7 * Copyright (C) 2007-2009 Texas Instruments
8 * 8 *
9 * Author: 9 * Author:
10 * Juha Yrjola <juha.yrjola@nokia.com> 10 * Juha Yrjola <juha.yrjola@nokia.com>
11 * Syed Khasim <x0khasim@ti.com> 11 * Syed Khasim <x0khasim@ti.com>
12 * 12 *
13 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
14 *
13 * This program is free software; you can redistribute it and/or modify 15 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as 16 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation. 17 * published by the Free Software Foundation.
@@ -30,6 +32,7 @@
30#include <mach/sdrc.h> 32#include <mach/sdrc.h>
31#include <mach/gpmc.h> 33#include <mach/gpmc.h>
32 34
35#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdev is ready */
33#include "clock.h" 36#include "clock.h"
34 37
35#include <mach/powerdomain.h> 38#include <mach/powerdomain.h>
@@ -38,7 +41,7 @@
38 41
39#include <mach/clockdomain.h> 42#include <mach/clockdomain.h>
40#include "clockdomains.h" 43#include "clockdomains.h"
41 44#endif
42/* 45/*
43 * The machine specific code may provide the extra mapping besides the 46 * The machine specific code may provide the extra mapping besides the
44 * default mapping provided here. 47 * default mapping provided here.
@@ -166,6 +169,46 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
166 }, 169 },
167}; 170};
168#endif 171#endif
172#ifdef CONFIG_ARCH_OMAP4
173static struct map_desc omap44xx_io_desc[] __initdata = {
174 {
175 .virtual = L3_44XX_VIRT,
176 .pfn = __phys_to_pfn(L3_44XX_PHYS),
177 .length = L3_44XX_SIZE,
178 .type = MT_DEVICE,
179 },
180 {
181 .virtual = L4_44XX_VIRT,
182 .pfn = __phys_to_pfn(L4_44XX_PHYS),
183 .length = L4_44XX_SIZE,
184 .type = MT_DEVICE,
185 },
186 {
187 .virtual = L4_WK_44XX_VIRT,
188 .pfn = __phys_to_pfn(L4_WK_44XX_PHYS),
189 .length = L4_WK_44XX_SIZE,
190 .type = MT_DEVICE,
191 },
192 {
193 .virtual = OMAP44XX_GPMC_VIRT,
194 .pfn = __phys_to_pfn(OMAP44XX_GPMC_PHYS),
195 .length = OMAP44XX_GPMC_SIZE,
196 .type = MT_DEVICE,
197 },
198 {
199 .virtual = L4_PER_44XX_VIRT,
200 .pfn = __phys_to_pfn(L4_PER_44XX_PHYS),
201 .length = L4_PER_44XX_SIZE,
202 .type = MT_DEVICE,
203 },
204 {
205 .virtual = L4_EMU_44XX_VIRT,
206 .pfn = __phys_to_pfn(L4_EMU_44XX_PHYS),
207 .length = L4_EMU_44XX_SIZE,
208 .type = MT_DEVICE,
209 },
210};
211#endif
169 212
170void __init omap2_map_common_io(void) 213void __init omap2_map_common_io(void)
171{ 214{
@@ -183,6 +226,9 @@ void __init omap2_map_common_io(void)
183 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); 226 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
184#endif 227#endif
185 228
229#if defined(CONFIG_ARCH_OMAP4)
230 iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
231#endif
186 /* Normally devicemaps_init() would flush caches and tlb after 232 /* Normally devicemaps_init() would flush caches and tlb after
187 * mdesc->map_io(), but we must also do it here because of the CPU 233 * mdesc->map_io(), but we must also do it here because of the CPU
188 * revision check below. 234 * revision check below.
@@ -198,9 +244,11 @@ void __init omap2_map_common_io(void)
198void __init omap2_init_common_hw(struct omap_sdrc_params *sp) 244void __init omap2_init_common_hw(struct omap_sdrc_params *sp)
199{ 245{
200 omap2_mux_init(); 246 omap2_mux_init();
247#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
201 pwrdm_init(powerdomains_omap); 248 pwrdm_init(powerdomains_omap);
202 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); 249 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
203 omap2_clk_init(); 250 omap2_clk_init();
204 omap2_sdrc_init(sp); 251 omap2_sdrc_init(sp);
252#endif
205 gpmc_init(); 253 gpmc_init();
206} 254}
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
new file mode 100644
index 000000000000..015f22a53ead
--- /dev/null
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -0,0 +1,323 @@
1/*
2 * omap iommu: omap2/3 architecture specific functions
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
7 * Paul Mundt and Toshihiro Kobayashi
8 *
9 * This program 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
14#include <linux/err.h>
15#include <linux/device.h>
16#include <linux/jiffies.h>
17#include <linux/module.h>
18#include <linux/stringify.h>
19
20#include <mach/iommu.h>
21
22/*
23 * omap2 architecture specific register bit definitions
24 */
25#define IOMMU_ARCH_VERSION 0x00000011
26
27/* SYSCONF */
28#define MMU_SYS_IDLE_SHIFT 3
29#define MMU_SYS_IDLE_FORCE (0 << MMU_SYS_IDLE_SHIFT)
30#define MMU_SYS_IDLE_NONE (1 << MMU_SYS_IDLE_SHIFT)
31#define MMU_SYS_IDLE_SMART (2 << MMU_SYS_IDLE_SHIFT)
32#define MMU_SYS_IDLE_MASK (3 << MMU_SYS_IDLE_SHIFT)
33
34#define MMU_SYS_SOFTRESET (1 << 1)
35#define MMU_SYS_AUTOIDLE 1
36
37/* SYSSTATUS */
38#define MMU_SYS_RESETDONE 1
39
40/* IRQSTATUS & IRQENABLE */
41#define MMU_IRQ_MULTIHITFAULT (1 << 4)
42#define MMU_IRQ_TABLEWALKFAULT (1 << 3)
43#define MMU_IRQ_EMUMISS (1 << 2)
44#define MMU_IRQ_TRANSLATIONFAULT (1 << 1)
45#define MMU_IRQ_TLBMISS (1 << 0)
46#define MMU_IRQ_MASK \
47 (MMU_IRQ_MULTIHITFAULT | MMU_IRQ_TABLEWALKFAULT | MMU_IRQ_EMUMISS | \
48 MMU_IRQ_TRANSLATIONFAULT)
49
50/* MMU_CNTL */
51#define MMU_CNTL_SHIFT 1
52#define MMU_CNTL_MASK (7 << MMU_CNTL_SHIFT)
53#define MMU_CNTL_EML_TLB (1 << 3)
54#define MMU_CNTL_TWL_EN (1 << 2)
55#define MMU_CNTL_MMU_EN (1 << 1)
56
57#define get_cam_va_mask(pgsz) \
58 (((pgsz) == MMU_CAM_PGSZ_16M) ? 0xff000000 : \
59 ((pgsz) == MMU_CAM_PGSZ_1M) ? 0xfff00000 : \
60 ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \
61 ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0)
62
63static int omap2_iommu_enable(struct iommu *obj)
64{
65 u32 l, pa;
66 unsigned long timeout;
67
68 if (!obj->iopgd || !IS_ALIGNED((u32)obj->iopgd, SZ_16K))
69 return -EINVAL;
70
71 pa = virt_to_phys(obj->iopgd);
72 if (!IS_ALIGNED(pa, SZ_16K))
73 return -EINVAL;
74
75 iommu_write_reg(obj, MMU_SYS_SOFTRESET, MMU_SYSCONFIG);
76
77 timeout = jiffies + msecs_to_jiffies(20);
78 do {
79 l = iommu_read_reg(obj, MMU_SYSSTATUS);
80 if (l & MMU_SYS_RESETDONE)
81 break;
82 } while (time_after(jiffies, timeout));
83
84 if (!(l & MMU_SYS_RESETDONE)) {
85 dev_err(obj->dev, "can't take mmu out of reset\n");
86 return -ENODEV;
87 }
88
89 l = iommu_read_reg(obj, MMU_REVISION);
90 dev_info(obj->dev, "%s: version %d.%d\n", obj->name,
91 (l >> 4) & 0xf, l & 0xf);
92
93 l = iommu_read_reg(obj, MMU_SYSCONFIG);
94 l &= ~MMU_SYS_IDLE_MASK;
95 l |= (MMU_SYS_IDLE_SMART | MMU_SYS_AUTOIDLE);
96 iommu_write_reg(obj, l, MMU_SYSCONFIG);
97
98 iommu_write_reg(obj, MMU_IRQ_MASK, MMU_IRQENABLE);
99 iommu_write_reg(obj, pa, MMU_TTB);
100
101 l = iommu_read_reg(obj, MMU_CNTL);
102 l &= ~MMU_CNTL_MASK;
103 l |= (MMU_CNTL_MMU_EN | MMU_CNTL_TWL_EN);
104 iommu_write_reg(obj, l, MMU_CNTL);
105
106 return 0;
107}
108
109static void omap2_iommu_disable(struct iommu *obj)
110{
111 u32 l = iommu_read_reg(obj, MMU_CNTL);
112
113 l &= ~MMU_CNTL_MASK;
114 iommu_write_reg(obj, l, MMU_CNTL);
115 iommu_write_reg(obj, MMU_SYS_IDLE_FORCE, MMU_SYSCONFIG);
116
117 dev_dbg(obj->dev, "%s is shutting down\n", obj->name);
118}
119
120static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)
121{
122 int i;
123 u32 stat, da;
124 const char *err_msg[] = {
125 "tlb miss",
126 "translation fault",
127 "emulation miss",
128 "table walk fault",
129 "multi hit fault",
130 };
131
132 stat = iommu_read_reg(obj, MMU_IRQSTATUS);
133 stat &= MMU_IRQ_MASK;
134 if (!stat)
135 return 0;
136
137 da = iommu_read_reg(obj, MMU_FAULT_AD);
138 *ra = da;
139
140 dev_err(obj->dev, "%s:\tda:%08x ", __func__, da);
141
142 for (i = 0; i < ARRAY_SIZE(err_msg); i++) {
143 if (stat & (1 << i))
144 printk("%s ", err_msg[i]);
145 }
146 printk("\n");
147
148 iommu_write_reg(obj, stat, MMU_IRQSTATUS);
149 return stat;
150}
151
152static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr)
153{
154 cr->cam = iommu_read_reg(obj, MMU_READ_CAM);
155 cr->ram = iommu_read_reg(obj, MMU_READ_RAM);
156}
157
158static void omap2_tlb_load_cr(struct iommu *obj, struct cr_regs *cr)
159{
160 iommu_write_reg(obj, cr->cam | MMU_CAM_V, MMU_CAM);
161 iommu_write_reg(obj, cr->ram, MMU_RAM);
162}
163
164static u32 omap2_cr_to_virt(struct cr_regs *cr)
165{
166 u32 page_size = cr->cam & MMU_CAM_PGSZ_MASK;
167 u32 mask = get_cam_va_mask(cr->cam & page_size);
168
169 return cr->cam & mask;
170}
171
172static struct cr_regs *omap2_alloc_cr(struct iommu *obj, struct iotlb_entry *e)
173{
174 struct cr_regs *cr;
175
176 if (e->da & ~(get_cam_va_mask(e->pgsz))) {
177 dev_err(obj->dev, "%s:\twrong alignment: %08x\n", __func__,
178 e->da);
179 return ERR_PTR(-EINVAL);
180 }
181
182 cr = kmalloc(sizeof(*cr), GFP_KERNEL);
183 if (!cr)
184 return ERR_PTR(-ENOMEM);
185
186 cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz;
187 cr->ram = e->pa | e->endian | e->elsz | e->mixed;
188
189 return cr;
190}
191
192static inline int omap2_cr_valid(struct cr_regs *cr)
193{
194 return cr->cam & MMU_CAM_V;
195}
196
197static u32 omap2_get_pte_attr(struct iotlb_entry *e)
198{
199 u32 attr;
200
201 attr = e->mixed << 5;
202 attr |= e->endian;
203 attr |= e->elsz >> 3;
204 attr <<= ((e->pgsz & MMU_CAM_PGSZ_4K) ? 0 : 6);
205
206 return attr;
207}
208
209static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf)
210{
211 char *p = buf;
212
213 /* FIXME: Need more detail analysis of cam/ram */
214 p += sprintf(p, "%08x %08x\n", cr->cam, cr->ram);
215
216 return p - buf;
217}
218
219#define pr_reg(name) \
220 p += sprintf(p, "%20s: %08x\n", \
221 __stringify(name), iommu_read_reg(obj, MMU_##name));
222
223static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf)
224{
225 char *p = buf;
226
227 pr_reg(REVISION);
228 pr_reg(SYSCONFIG);
229 pr_reg(SYSSTATUS);
230 pr_reg(IRQSTATUS);
231 pr_reg(IRQENABLE);
232 pr_reg(WALKING_ST);
233 pr_reg(CNTL);
234 pr_reg(FAULT_AD);
235 pr_reg(TTB);
236 pr_reg(LOCK);
237 pr_reg(LD_TLB);
238 pr_reg(CAM);
239 pr_reg(RAM);
240 pr_reg(GFLUSH);
241 pr_reg(FLUSH_ENTRY);
242 pr_reg(READ_CAM);
243 pr_reg(READ_RAM);
244 pr_reg(EMU_FAULT_AD);
245
246 return p - buf;
247}
248
249static void omap2_iommu_save_ctx(struct iommu *obj)
250{
251 int i;
252 u32 *p = obj->ctx;
253
254 for (i = 0; i < (MMU_REG_SIZE / sizeof(u32)); i++) {
255 p[i] = iommu_read_reg(obj, i * sizeof(u32));
256 dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
257 }
258
259 BUG_ON(p[0] != IOMMU_ARCH_VERSION);
260}
261
262static void omap2_iommu_restore_ctx(struct iommu *obj)
263{
264 int i;
265 u32 *p = obj->ctx;
266
267 for (i = 0; i < (MMU_REG_SIZE / sizeof(u32)); i++) {
268 iommu_write_reg(obj, p[i], i * sizeof(u32));
269 dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
270 }
271
272 BUG_ON(p[0] != IOMMU_ARCH_VERSION);
273}
274
275static void omap2_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
276{
277 e->da = cr->cam & MMU_CAM_VATAG_MASK;
278 e->pa = cr->ram & MMU_RAM_PADDR_MASK;
279 e->valid = cr->cam & MMU_CAM_V;
280 e->pgsz = cr->cam & MMU_CAM_PGSZ_MASK;
281 e->endian = cr->ram & MMU_RAM_ENDIAN_MASK;
282 e->elsz = cr->ram & MMU_RAM_ELSZ_MASK;
283 e->mixed = cr->ram & MMU_RAM_MIXED;
284}
285
286static const struct iommu_functions omap2_iommu_ops = {
287 .version = IOMMU_ARCH_VERSION,
288
289 .enable = omap2_iommu_enable,
290 .disable = omap2_iommu_disable,
291 .fault_isr = omap2_iommu_fault_isr,
292
293 .tlb_read_cr = omap2_tlb_read_cr,
294 .tlb_load_cr = omap2_tlb_load_cr,
295
296 .cr_to_e = omap2_cr_to_e,
297 .cr_to_virt = omap2_cr_to_virt,
298 .alloc_cr = omap2_alloc_cr,
299 .cr_valid = omap2_cr_valid,
300 .dump_cr = omap2_dump_cr,
301
302 .get_pte_attr = omap2_get_pte_attr,
303
304 .save_ctx = omap2_iommu_save_ctx,
305 .restore_ctx = omap2_iommu_restore_ctx,
306 .dump_ctx = omap2_iommu_dump_ctx,
307};
308
309static int __init omap2_iommu_init(void)
310{
311 return install_iommu_arch(&omap2_iommu_ops);
312}
313module_init(omap2_iommu_init);
314
315static void __exit omap2_iommu_exit(void)
316{
317 uninstall_iommu_arch(&omap2_iommu_ops);
318}
319module_exit(omap2_iommu_exit);
320
321MODULE_AUTHOR("Hiroshi DOYU, Paul Mundt and Toshihiro Kobayashi");
322MODULE_DESCRIPTION("omap iommu: omap2/3 architecture specific functions");
323MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 998c5c45587e..b82863887f10 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -28,7 +28,6 @@
28#define INTC_MIR_CLEAR0 0x0088 28#define INTC_MIR_CLEAR0 0x0088
29#define INTC_MIR_SET0 0x008c 29#define INTC_MIR_SET0 0x008c
30#define INTC_PENDING_IRQ0 0x0098 30#define INTC_PENDING_IRQ0 0x0098
31
32/* Number of IRQ state bits in each MIR register */ 31/* Number of IRQ state bits in each MIR register */
33#define IRQ_BITS_PER_REG 32 32#define IRQ_BITS_PER_REG 32
34 33
@@ -134,7 +133,6 @@ static struct irq_chip omap_irq_chip = {
134 .ack = omap_mask_ack_irq, 133 .ack = omap_mask_ack_irq,
135 .mask = omap_mask_irq, 134 .mask = omap_mask_irq,
136 .unmask = omap_unmask_irq, 135 .unmask = omap_unmask_irq,
137 .disable = omap_mask_irq,
138}; 136};
139 137
140static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank) 138static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
@@ -157,6 +155,22 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
157 intc_bank_write_reg(1 << 0, bank, INTC_SYSCONFIG); 155 intc_bank_write_reg(1 << 0, bank, INTC_SYSCONFIG);
158} 156}
159 157
158int omap_irq_pending(void)
159{
160 int i;
161
162 for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
163 struct omap_irq_bank *bank = irq_banks + i;
164 int irq;
165
166 for (irq = 0; irq < bank->nr_irqs; irq += 32)
167 if (intc_bank_read_reg(bank, INTC_PENDING_IRQ0 +
168 ((irq >> 5) << 5)))
169 return 1;
170 }
171 return 0;
172}
173
160void __init omap_init_irq(void) 174void __init omap_init_irq(void)
161{ 175{
162 unsigned long nr_of_irqs = 0; 176 unsigned long nr_of_irqs = 0;
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index dc40b3e72206..9756a878fd90 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -16,8 +16,8 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/i2c/twl4030.h> 19#include <linux/mmc/host.h>
20#include <linux/regulator/machine.h> 20#include <linux/regulator/consumer.h>
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/control.h> 23#include <mach/control.h>
@@ -26,31 +26,9 @@
26 26
27#include "mmc-twl4030.h" 27#include "mmc-twl4030.h"
28 28
29#if defined(CONFIG_TWL4030_CORE) && \
30 (defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE))
31 29
32#define LDO_CLR 0x00 30#if defined(CONFIG_REGULATOR) && \
33#define VSEL_S2_CLR 0x40 31 (defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE))
34
35#define VMMC1_DEV_GRP 0x27
36#define VMMC1_CLR 0x00
37#define VMMC1_315V 0x03
38#define VMMC1_300V 0x02
39#define VMMC1_285V 0x01
40#define VMMC1_185V 0x00
41#define VMMC1_DEDICATED 0x2A
42
43#define VMMC2_DEV_GRP 0x2B
44#define VMMC2_CLR 0x40
45#define VMMC2_315V 0x0c
46#define VMMC2_300V 0x0b
47#define VMMC2_285V 0x0a
48#define VMMC2_280V 0x09
49#define VMMC2_260V 0x08
50#define VMMC2_185V 0x06
51#define VMMC2_DEDICATED 0x2E
52
53#define VMMC_DEV_GRP_P1 0x20
54 32
55static u16 control_pbias_offset; 33static u16 control_pbias_offset;
56static u16 control_devconf1_offset; 34static u16 control_devconf1_offset;
@@ -59,19 +37,16 @@ static u16 control_devconf1_offset;
59 37
60static struct twl_mmc_controller { 38static struct twl_mmc_controller {
61 struct omap_mmc_platform_data *mmc; 39 struct omap_mmc_platform_data *mmc;
62 u8 twl_vmmc_dev_grp; 40 /* Vcc == configured supply
63 u8 twl_mmc_dedicated; 41 * Vcc_alt == optional
64 char name[HSMMC_NAME_LEN + 1]; 42 * - MMC1, supply for DAT4..DAT7
65} hsmmc[OMAP34XX_NR_MMC] = { 43 * - MMC2/MMC2, external level shifter voltage supply, for
66 { 44 * chip (SDIO, eMMC, etc) or transceiver (MMC2 only)
67 .twl_vmmc_dev_grp = VMMC1_DEV_GRP, 45 */
68 .twl_mmc_dedicated = VMMC1_DEDICATED, 46 struct regulator *vcc;
69 }, 47 struct regulator *vcc_aux;
70 { 48 char name[HSMMC_NAME_LEN + 1];
71 .twl_vmmc_dev_grp = VMMC2_DEV_GRP, 49} hsmmc[OMAP34XX_NR_MMC];
72 .twl_mmc_dedicated = VMMC2_DEDICATED,
73 },
74};
75 50
76static int twl_mmc_card_detect(int irq) 51static int twl_mmc_card_detect(int irq)
77{ 52{
@@ -117,16 +92,60 @@ static int twl_mmc_late_init(struct device *dev)
117 int ret = 0; 92 int ret = 0;
118 int i; 93 int i;
119 94
120 ret = gpio_request(mmc->slots[0].switch_pin, "mmc_cd"); 95 /* MMC/SD/SDIO doesn't require a card detect switch */
121 if (ret) 96 if (gpio_is_valid(mmc->slots[0].switch_pin)) {
122 goto done; 97 ret = gpio_request(mmc->slots[0].switch_pin, "mmc_cd");
123 ret = gpio_direction_input(mmc->slots[0].switch_pin); 98 if (ret)
124 if (ret) 99 goto done;
125 goto err; 100 ret = gpio_direction_input(mmc->slots[0].switch_pin);
101 if (ret)
102 goto err;
103 }
126 104
105 /* require at least main regulator */
127 for (i = 0; i < ARRAY_SIZE(hsmmc); i++) { 106 for (i = 0; i < ARRAY_SIZE(hsmmc); i++) {
128 if (hsmmc[i].name == mmc->slots[0].name) { 107 if (hsmmc[i].name == mmc->slots[0].name) {
108 struct regulator *reg;
109
129 hsmmc[i].mmc = mmc; 110 hsmmc[i].mmc = mmc;
111
112 reg = regulator_get(dev, "vmmc");
113 if (IS_ERR(reg)) {
114 dev_dbg(dev, "vmmc regulator missing\n");
115 /* HACK: until fixed.c regulator is usable,
116 * we don't require a main regulator
117 * for MMC2 or MMC3
118 */
119 if (i != 0)
120 break;
121 ret = PTR_ERR(reg);
122 goto err;
123 }
124 hsmmc[i].vcc = reg;
125 mmc->slots[0].ocr_mask = mmc_regulator_get_ocrmask(reg);
126
127 /* allow an aux regulator */
128 reg = regulator_get(dev, "vmmc_aux");
129 hsmmc[i].vcc_aux = IS_ERR(reg) ? NULL : reg;
130
131 /* UGLY HACK: workaround regulator framework bugs.
132 * When the bootloader leaves a supply active, it's
133 * initialized with zero usecount ... and we can't
134 * disable it without first enabling it. Until the
135 * framework is fixed, we need a workaround like this
136 * (which is safe for MMC, but not in general).
137 */
138 if (regulator_is_enabled(hsmmc[i].vcc) > 0) {
139 regulator_enable(hsmmc[i].vcc);
140 regulator_disable(hsmmc[i].vcc);
141 }
142 if (hsmmc[i].vcc_aux) {
143 if (regulator_is_enabled(reg) > 0) {
144 regulator_enable(reg);
145 regulator_disable(reg);
146 }
147 }
148
130 break; 149 break;
131 } 150 }
132 } 151 }
@@ -173,96 +192,6 @@ static int twl_mmc_resume(struct device *dev, int slot)
173#define twl_mmc_resume NULL 192#define twl_mmc_resume NULL
174#endif 193#endif
175 194
176/*
177 * Sets the MMC voltage in twl4030
178 */
179
180#define MMC1_OCR (MMC_VDD_165_195 \
181 |MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32)
182#define MMC2_OCR (MMC_VDD_165_195 \
183 |MMC_VDD_25_26|MMC_VDD_26_27|MMC_VDD_27_28 \
184 |MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32)
185
186static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
187{
188 int ret;
189 u8 vmmc = 0, dev_grp_val;
190
191 if (!vdd)
192 goto doit;
193
194 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) {
195 /* VMMC1: max 220 mA. And for 8-bit mode,
196 * VSIM: max 50 mA
197 */
198 switch (1 << vdd) {
199 case MMC_VDD_165_195:
200 vmmc = VMMC1_185V;
201 /* and VSIM_180V */
202 break;
203 case MMC_VDD_28_29:
204 vmmc = VMMC1_285V;
205 /* and VSIM_280V */
206 break;
207 case MMC_VDD_29_30:
208 case MMC_VDD_30_31:
209 vmmc = VMMC1_300V;
210 /* and VSIM_300V */
211 break;
212 case MMC_VDD_31_32:
213 vmmc = VMMC1_315V;
214 /* error if VSIM needed */
215 break;
216 default:
217 return -EINVAL;
218 }
219 } else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) {
220 /* VMMC2: max 100 mA */
221 switch (1 << vdd) {
222 case MMC_VDD_165_195:
223 vmmc = VMMC2_185V;
224 break;
225 case MMC_VDD_25_26:
226 case MMC_VDD_26_27:
227 vmmc = VMMC2_260V;
228 break;
229 case MMC_VDD_27_28:
230 vmmc = VMMC2_280V;
231 break;
232 case MMC_VDD_28_29:
233 vmmc = VMMC2_285V;
234 break;
235 case MMC_VDD_29_30:
236 case MMC_VDD_30_31:
237 vmmc = VMMC2_300V;
238 break;
239 case MMC_VDD_31_32:
240 vmmc = VMMC2_315V;
241 break;
242 default:
243 return -EINVAL;
244 }
245 } else {
246 return -EINVAL;
247 }
248
249doit:
250 if (vdd)
251 dev_grp_val = VMMC_DEV_GRP_P1; /* Power up */
252 else
253 dev_grp_val = LDO_CLR; /* Power down */
254
255 ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
256 dev_grp_val, c->twl_vmmc_dev_grp);
257 if (ret || !vdd)
258 return ret;
259
260 ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
261 vmmc, c->twl_mmc_dedicated);
262
263 return ret;
264}
265
266static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, 195static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
267 int vdd) 196 int vdd)
268{ 197{
@@ -273,11 +202,13 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
273 202
274 /* 203 /*
275 * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the 204 * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
276 * card using the same TWL VMMC1 supply (hsmmc[0]); OMAP has both 205 * card with Vcc regulator (from twl4030 or whatever). OMAP has both
277 * 1.8V and 3.0V modes, controlled by the PBIAS register. 206 * 1.8V and 3.0V modes, controlled by the PBIAS register.
278 * 207 *
279 * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which 208 * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
280 * is most naturally TWL VSIM; those pins also use PBIAS. 209 * is most naturally TWL VSIM; those pins also use PBIAS.
210 *
211 * FIXME handle VMMC1A as needed ...
281 */ 212 */
282 if (power_on) { 213 if (power_on) {
283 if (cpu_is_omap2430()) { 214 if (cpu_is_omap2430()) {
@@ -300,7 +231,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
300 reg &= ~OMAP2_PBIASLITEPWRDNZ0; 231 reg &= ~OMAP2_PBIASLITEPWRDNZ0;
301 omap_ctrl_writel(reg, control_pbias_offset); 232 omap_ctrl_writel(reg, control_pbias_offset);
302 233
303 ret = twl_mmc_set_voltage(c, vdd); 234 ret = mmc_regulator_set_ocr(c->vcc, vdd);
304 235
305 /* 100ms delay required for PBIAS configuration */ 236 /* 100ms delay required for PBIAS configuration */
306 msleep(100); 237 msleep(100);
@@ -316,7 +247,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
316 reg &= ~OMAP2_PBIASLITEPWRDNZ0; 247 reg &= ~OMAP2_PBIASLITEPWRDNZ0;
317 omap_ctrl_writel(reg, control_pbias_offset); 248 omap_ctrl_writel(reg, control_pbias_offset);
318 249
319 ret = twl_mmc_set_voltage(c, 0); 250 ret = mmc_regulator_set_ocr(c->vcc, 0);
320 251
321 /* 100ms delay required for PBIAS configuration */ 252 /* 100ms delay required for PBIAS configuration */
322 msleep(100); 253 msleep(100);
@@ -329,19 +260,33 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
329 return ret; 260 return ret;
330} 261}
331 262
332static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd) 263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd)
333{ 264{
334 int ret; 265 int ret = 0;
335 struct twl_mmc_controller *c = &hsmmc[1]; 266 struct twl_mmc_controller *c = &hsmmc[1];
336 struct omap_mmc_platform_data *mmc = dev->platform_data; 267 struct omap_mmc_platform_data *mmc = dev->platform_data;
337 268
269 /* If we don't see a Vcc regulator, assume it's a fixed
270 * voltage always-on regulator.
271 */
272 if (!c->vcc)
273 return 0;
274
338 /* 275 /*
339 * Assume TWL VMMC2 (hsmmc[1]) is used only to power the card ... OMAP 276 * Assume Vcc regulator is used only to power the card ... OMAP
340 * VDDS is used to power the pins, optionally with a transceiver to 277 * VDDS is used to power the pins, optionally with a transceiver to
341 * support cards using voltages other than VDDS (1.8V nominal). When a 278 * support cards using voltages other than VDDS (1.8V nominal). When a
342 * transceiver is used, DAT3..7 are muxed as transceiver control pins. 279 * transceiver is used, DAT3..7 are muxed as transceiver control pins.
280 *
281 * In some cases this regulator won't support enable/disable;
282 * e.g. it's a fixed rail for a WLAN chip.
283 *
284 * In other cases vcc_aux switches interface power. Example, for
285 * eMMC cards it represents VccQ. Sometimes transceivers or SDIO
286 * chips/cards need an interface voltage rail too.
343 */ 287 */
344 if (power_on) { 288 if (power_on) {
289 /* only MMC2 supports a CLKIN */
345 if (mmc->slots[0].internal_clock) { 290 if (mmc->slots[0].internal_clock) {
346 u32 reg; 291 u32 reg;
347 292
@@ -349,24 +294,23 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
349 reg |= OMAP2_MMCSDIO2ADPCLKISEL; 294 reg |= OMAP2_MMCSDIO2ADPCLKISEL;
350 omap_ctrl_writel(reg, control_devconf1_offset); 295 omap_ctrl_writel(reg, control_devconf1_offset);
351 } 296 }
352 ret = twl_mmc_set_voltage(c, vdd); 297 ret = mmc_regulator_set_ocr(c->vcc, vdd);
298 /* enable interface voltage rail, if needed */
299 if (ret == 0 && c->vcc_aux) {
300 ret = regulator_enable(c->vcc_aux);
301 if (ret < 0)
302 ret = mmc_regulator_set_ocr(c->vcc, 0);
303 }
353 } else { 304 } else {
354 ret = twl_mmc_set_voltage(c, 0); 305 if (c->vcc_aux && (ret = regulator_is_enabled(c->vcc_aux)) > 0)
306 ret = regulator_disable(c->vcc_aux);
307 if (ret == 0)
308 ret = mmc_regulator_set_ocr(c->vcc, 0);
355 } 309 }
356 310
357 return ret; 311 return ret;
358} 312}
359 313
360static int twl_mmc3_set_power(struct device *dev, int slot, int power_on,
361 int vdd)
362{
363 /*
364 * Assume MMC3 has self-powered device connected, for example on-board
365 * chip with external power source.
366 */
367 return 0;
368}
369
370static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; 314static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
371 315
372void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) 316void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
@@ -412,10 +356,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
412 mmc->slots[0].wires = c->wires; 356 mmc->slots[0].wires = c->wires;
413 mmc->slots[0].internal_clock = !c->ext_clock; 357 mmc->slots[0].internal_clock = !c->ext_clock;
414 mmc->dma_mask = 0xffffffff; 358 mmc->dma_mask = 0xffffffff;
359 mmc->init = twl_mmc_late_init;
415 360
416 /* note: twl4030 card detect GPIOs normally switch VMMCx ... */ 361 /* note: twl4030 card detect GPIOs can disable VMMCx ... */
417 if (gpio_is_valid(c->gpio_cd)) { 362 if (gpio_is_valid(c->gpio_cd)) {
418 mmc->init = twl_mmc_late_init;
419 mmc->cleanup = twl_mmc_cleanup; 363 mmc->cleanup = twl_mmc_cleanup;
420 mmc->suspend = twl_mmc_suspend; 364 mmc->suspend = twl_mmc_suspend;
421 mmc->resume = twl_mmc_resume; 365 mmc->resume = twl_mmc_resume;
@@ -439,26 +383,28 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
439 } else 383 } else
440 mmc->slots[0].gpio_wp = -EINVAL; 384 mmc->slots[0].gpio_wp = -EINVAL;
441 385
442 /* NOTE: we assume OMAP's MMC1 and MMC2 use 386 /* NOTE: MMC slots should have a Vcc regulator set up.
443 * the TWL4030's VMMC1 and VMMC2, respectively; 387 * This may be from a TWL4030-family chip, another
444 * and that MMC3 device has it's own power source. 388 * controllable regulator, or a fixed supply.
389 *
390 * temporary HACK: ocr_mask instead of fixed supply
445 */ 391 */
392 mmc->slots[0].ocr_mask = c->ocr_mask;
446 393
447 switch (c->mmc) { 394 switch (c->mmc) {
448 case 1: 395 case 1:
396 /* on-chip level shifting via PBIAS0/PBIAS1 */
449 mmc->slots[0].set_power = twl_mmc1_set_power; 397 mmc->slots[0].set_power = twl_mmc1_set_power;
450 mmc->slots[0].ocr_mask = MMC1_OCR;
451 break; 398 break;
452 case 2: 399 case 2:
453 mmc->slots[0].set_power = twl_mmc2_set_power; 400 if (c->ext_clock)
454 if (c->transceiver) 401 c->transceiver = 1;
455 mmc->slots[0].ocr_mask = MMC2_OCR; 402 if (c->transceiver && c->wires > 4)
456 else 403 c->wires = 4;
457 mmc->slots[0].ocr_mask = MMC_VDD_165_195; 404 /* FALLTHROUGH */
458 break;
459 case 3: 405 case 3:
460 mmc->slots[0].set_power = twl_mmc3_set_power; 406 /* off-chip level shifting, or none */
461 mmc->slots[0].ocr_mask = MMC_VDD_165_195; 407 mmc->slots[0].set_power = twl_mmc23_set_power;
462 break; 408 break;
463 default: 409 default:
464 pr_err("MMC%d configuration not supported!\n", c->mmc); 410 pr_err("MMC%d configuration not supported!\n", c->mmc);
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index ea59e8624290..3807c45c9a6c 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -16,9 +16,10 @@ struct twl4030_hsmmc_info {
16 int gpio_wp; /* or -EINVAL */ 16 int gpio_wp; /* or -EINVAL */
17 char *name; /* or NULL for default */ 17 char *name; /* or NULL for default */
18 struct device *dev; /* returned: pointer to mmc adapter */ 18 struct device *dev; /* returned: pointer to mmc adapter */
19 int ocr_mask; /* temporary HACK */
19}; 20};
20 21
21#if defined(CONFIG_TWL4030_CORE) && \ 22#if defined(CONFIG_REGULATOR) && \
22 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ 23 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
23 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)) 24 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE))
24 25
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S
new file mode 100644
index 000000000000..4afadba09477
--- /dev/null
+++ b/arch/arm/mach-omap2/omap-headsmp.S
@@ -0,0 +1,46 @@
1/*
2 * Secondary CPU startup routine source file.
3 *
4 * Copyright (C) 2009 Texas Instruments, Inc.
5 *
6 * Author:
7 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * Interface functions needed for the SMP. This file is based on arm
10 * realview smp platform.
11 * Copyright (c) 2003 ARM Limited.
12 *
13 * This program is free software,you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18#include <linux/linkage.h>
19#include <linux/init.h>
20
21/* Physical address needed since MMU not enabled yet on secondary core */
22#define OMAP4_AUX_CORE_BOOT1_PA 0x48281804
23
24 __INIT
25
26/*
27 * OMAP4 specific entry point for secondary CPU to jump from ROM
28 * code. This routine also provides a holding flag into which
29 * secondary core is held until we're ready for it to initialise.
30 * The primary core will update the this flag using a hardware
31 * register AuxCoreBoot1.
32 */
33ENTRY(omap_secondary_startup)
34 mrc p15, 0, r0, c0, c0, 5
35 and r0, r0, #0x0f
36hold: ldr r1, =OMAP4_AUX_CORE_BOOT1_PA @ read from AuxCoreBoot1
37 ldr r2, [r1]
38 cmp r2, r0
39 bne hold
40
41 /*
42 * we've been released from the cpu_release,secondary_stack
43 * should now contain the SVC stack for this core
44 */
45 b secondary_startup
46
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
new file mode 100644
index 000000000000..8fe8d230f21b
--- /dev/null
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -0,0 +1,178 @@
1/*
2 * OMAP4 SMP source file. It contains platform specific fucntions
3 * needed for the linux smp kernel.
4 *
5 * Copyright (C) 2009 Texas Instruments, Inc.
6 *
7 * Author:
8 * Santosh Shilimkar <santosh.shilimkar@ti.com>
9 *
10 * Platform file needed for the OMAP4 SMP. This file is based on arm
11 * realview smp platform.
12 * * Copyright (c) 2002 ARM Limited.
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 version 2 as
16 * published by the Free Software Foundation.
17 */
18#include <linux/init.h>
19#include <linux/device.h>
20#include <linux/jiffies.h>
21#include <linux/smp.h>
22#include <linux/io.h>
23
24#include <asm/localtimer.h>
25#include <asm/smp_scu.h>
26#include <mach/hardware.h>
27
28/* Registers used for communicating startup information */
29#define OMAP4_AUXCOREBOOT_REG0 (OMAP44XX_VA_WKUPGEN_BASE + 0x800)
30#define OMAP4_AUXCOREBOOT_REG1 (OMAP44XX_VA_WKUPGEN_BASE + 0x804)
31
32/* SCU base address */
33static void __iomem *scu_base = OMAP44XX_VA_SCU_BASE;
34
35/*
36 * Use SCU config register to count number of cores
37 */
38static inline unsigned int get_core_count(void)
39{
40 if (scu_base)
41 return scu_get_core_count(scu_base);
42 return 1;
43}
44
45static DEFINE_SPINLOCK(boot_lock);
46
47void __cpuinit platform_secondary_init(unsigned int cpu)
48{
49 trace_hardirqs_off();
50
51 /*
52 * If any interrupts are already enabled for the primary
53 * core (e.g. timer irq), then they will not have been enabled
54 * for us: do so
55 */
56
57 gic_cpu_init(0, IO_ADDRESS(OMAP44XX_GIC_CPU_BASE));
58
59 /*
60 * Synchronise with the boot thread.
61 */
62 spin_lock(&boot_lock);
63 spin_unlock(&boot_lock);
64}
65
66int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
67{
68 unsigned long timeout;
69
70 /*
71 * Set synchronisation state between this boot processor
72 * and the secondary one
73 */
74 spin_lock(&boot_lock);
75
76 /*
77 * Update the AuxCoreBoot1 with boot state for secondary core.
78 * omap_secondary_startup() routine will hold the secondary core till
79 * the AuxCoreBoot1 register is updated with cpu state
80 * A barrier is added to ensure that write buffer is drained
81 */
82 __raw_writel(cpu, OMAP4_AUXCOREBOOT_REG1);
83 smp_wmb();
84
85 timeout = jiffies + (1 * HZ);
86 while (time_before(jiffies, timeout))
87 ;
88
89 /*
90 * Now the secondary core is starting up let it run its
91 * calibrations, then wait for it to finish
92 */
93 spin_unlock(&boot_lock);
94
95 return 0;
96}
97
98static void __init wakeup_secondary(void)
99{
100 /*
101 * Write the address of secondary startup routine into the
102 * AuxCoreBoot0 where ROM code will jump and start executing
103 * on secondary core once out of WFE
104 * A barrier is added to ensure that write buffer is drained
105 */
106 __raw_writel(virt_to_phys(omap_secondary_startup), \
107 OMAP4_AUXCOREBOOT_REG0);
108 smp_wmb();
109
110 /*
111 * Send a 'sev' to wake the secondary core from WFE.
112 */
113 set_event();
114 mb();
115}
116
117/*
118 * Initialise the CPU possible map early - this describes the CPUs
119 * which may be present or become present in the system.
120 */
121void __init smp_init_cpus(void)
122{
123 unsigned int i, ncores = get_core_count();
124
125 for (i = 0; i < ncores; i++)
126 set_cpu_possible(i, true);
127}
128
129void __init smp_prepare_cpus(unsigned int max_cpus)
130{
131 unsigned int ncores = get_core_count();
132 unsigned int cpu = smp_processor_id();
133 int i;
134
135 /* sanity check */
136 if (ncores == 0) {
137 printk(KERN_ERR
138 "OMAP4: strange core count of 0? Default to 1\n");
139 ncores = 1;
140 }
141
142 if (ncores > NR_CPUS) {
143 printk(KERN_WARNING
144 "OMAP4: no. of cores (%d) greater than configured "
145 "maximum of %d - clipping\n",
146 ncores, NR_CPUS);
147 ncores = NR_CPUS;
148 }
149 smp_store_cpu_info(cpu);
150
151 /*
152 * are we trying to boot more cores than exist?
153 */
154 if (max_cpus > ncores)
155 max_cpus = ncores;
156
157 /*
158 * Initialise the present map, which describes the set of CPUs
159 * actually populated at the present time.
160 */
161 for (i = 0; i < max_cpus; i++)
162 set_cpu_present(i, true);
163
164 if (max_cpus > 1) {
165 /*
166 * Enable the local timer or broadcast device for the
167 * boot CPU, but only if we have more than one CPU.
168 */
169 percpu_timer_setup();
170
171 /*
172 * Initialise the SCU and wake up the secondary core using
173 * wakeup_secondary().
174 */
175 scu_enable(scu_base);
176 wakeup_secondary();
177 }
178}
diff --git a/arch/arm/mach-omap2/omap3-iommu.c b/arch/arm/mach-omap2/omap3-iommu.c
new file mode 100644
index 000000000000..194189c746c2
--- /dev/null
+++ b/arch/arm/mach-omap2/omap3-iommu.c
@@ -0,0 +1,105 @@
1/*
2 * omap iommu: omap3 device registration
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/platform_device.h>
14
15#include <mach/iommu.h>
16
17#define OMAP3_MMU1_BASE 0x480bd400
18#define OMAP3_MMU2_BASE 0x5d000000
19#define OMAP3_MMU1_IRQ 24
20#define OMAP3_MMU2_IRQ 28
21
22
23static unsigned long iommu_base[] __initdata = {
24 OMAP3_MMU1_BASE,
25 OMAP3_MMU2_BASE,
26};
27
28static int iommu_irq[] __initdata = {
29 OMAP3_MMU1_IRQ,
30 OMAP3_MMU2_IRQ,
31};
32
33static const struct iommu_platform_data omap3_iommu_pdata[] __initconst = {
34 {
35 .name = "isp",
36 .nr_tlb_entries = 8,
37 .clk_name = "cam_ick",
38 },
39#if defined(CONFIG_MPU_BRIDGE_IOMMU)
40 {
41 .name = "iva2",
42 .nr_tlb_entries = 32,
43 .clk_name = "iva2_ck",
44 },
45#endif
46};
47#define NR_IOMMU_DEVICES ARRAY_SIZE(omap3_iommu_pdata)
48
49static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES];
50
51static int __init omap3_iommu_init(void)
52{
53 int i, err;
54
55 for (i = 0; i < NR_IOMMU_DEVICES; i++) {
56 struct platform_device *pdev;
57 struct resource res[2];
58
59 pdev = platform_device_alloc("omap-iommu", i);
60 if (!pdev) {
61 err = -ENOMEM;
62 goto err_out;
63 }
64
65 memset(res, 0, sizeof(res));
66 res[0].start = iommu_base[i];
67 res[0].end = iommu_base[i] + MMU_REG_SIZE - 1;
68 res[0].flags = IORESOURCE_MEM;
69 res[1].start = res[1].end = iommu_irq[i];
70 res[1].flags = IORESOURCE_IRQ;
71
72 err = platform_device_add_resources(pdev, res,
73 ARRAY_SIZE(res));
74 if (err)
75 goto err_out;
76 err = platform_device_add_data(pdev, &omap3_iommu_pdata[i],
77 sizeof(omap3_iommu_pdata[0]));
78 if (err)
79 goto err_out;
80 err = platform_device_add(pdev);
81 if (err)
82 goto err_out;
83 omap3_iommu_pdev[i] = pdev;
84 }
85 return 0;
86
87err_out:
88 while (i--)
89 platform_device_put(omap3_iommu_pdev[i]);
90 return err;
91}
92module_init(omap3_iommu_init);
93
94static void __exit omap3_iommu_exit(void)
95{
96 int i;
97
98 for (i = 0; i < NR_IOMMU_DEVICES; i++)
99 platform_device_unregister(omap3_iommu_pdev[i]);
100}
101module_exit(omap3_iommu_exit);
102
103MODULE_AUTHOR("Hiroshi DOYU");
104MODULE_DESCRIPTION("omap iommu: omap3 device registration");
105MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
new file mode 100644
index 000000000000..6cc375a275be
--- /dev/null
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -0,0 +1,152 @@
1/*
2 * OMAP Power Management debug routines
3 *
4 * Copyright (C) 2005 Texas Instruments, Inc.
5 * Copyright (C) 2006-2008 Nokia Corporation
6 *
7 * Written by:
8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Tony Lindgren
10 * Juha Yrjola
11 * Amit Kucheria <amit.kucheria@nokia.com>
12 * Igor Stoppa <igor.stoppa@nokia.com>
13 * Jouni Hogander
14 *
15 * Based on pm.c for omap2
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#include <linux/kernel.h>
23#include <linux/timer.h>
24#include <linux/clk.h>
25#include <linux/err.h>
26#include <linux/io.h>
27
28#include <mach/clock.h>
29#include <mach/board.h>
30
31#include "prm.h"
32#include "cm.h"
33#include "pm.h"
34
35int omap2_pm_debug;
36
37#define DUMP_PRM_MOD_REG(mod, reg) \
38 regs[reg_count].name = #mod "." #reg; \
39 regs[reg_count++].val = prm_read_mod_reg(mod, reg)
40#define DUMP_CM_MOD_REG(mod, reg) \
41 regs[reg_count].name = #mod "." #reg; \
42 regs[reg_count++].val = cm_read_mod_reg(mod, reg)
43#define DUMP_PRM_REG(reg) \
44 regs[reg_count].name = #reg; \
45 regs[reg_count++].val = __raw_readl(reg)
46#define DUMP_CM_REG(reg) \
47 regs[reg_count].name = #reg; \
48 regs[reg_count++].val = __raw_readl(reg)
49#define DUMP_INTC_REG(reg, off) \
50 regs[reg_count].name = #reg; \
51 regs[reg_count++].val = __raw_readl(IO_ADDRESS(0x480fe000 + (off)))
52
53void omap2_pm_dump(int mode, int resume, unsigned int us)
54{
55 struct reg {
56 const char *name;
57 u32 val;
58 } regs[32];
59 int reg_count = 0, i;
60 const char *s1 = NULL, *s2 = NULL;
61
62 if (!resume) {
63#if 0
64 /* MPU */
65 DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET);
66 DUMP_CM_MOD_REG(MPU_MOD, CM_CLKSTCTRL);
67 DUMP_PRM_MOD_REG(MPU_MOD, PM_PWSTCTRL);
68 DUMP_PRM_MOD_REG(MPU_MOD, PM_PWSTST);
69 DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP);
70#endif
71#if 0
72 /* INTC */
73 DUMP_INTC_REG(INTC_MIR0, 0x0084);
74 DUMP_INTC_REG(INTC_MIR1, 0x00a4);
75 DUMP_INTC_REG(INTC_MIR2, 0x00c4);
76#endif
77#if 0
78 DUMP_CM_MOD_REG(CORE_MOD, CM_FCLKEN1);
79 if (cpu_is_omap24xx()) {
80 DUMP_CM_MOD_REG(CORE_MOD, OMAP24XX_CM_FCLKEN2);
81 DUMP_PRM_MOD_REG(OMAP24XX_GR_MOD,
82 OMAP2_PRCM_CLKEMUL_CTRL_OFFSET);
83 DUMP_PRM_MOD_REG(OMAP24XX_GR_MOD,
84 OMAP2_PRCM_CLKSRC_CTRL_OFFSET);
85 }
86 DUMP_CM_MOD_REG(WKUP_MOD, CM_FCLKEN);
87 DUMP_CM_MOD_REG(CORE_MOD, CM_ICLKEN1);
88 DUMP_CM_MOD_REG(CORE_MOD, CM_ICLKEN2);
89 DUMP_CM_MOD_REG(WKUP_MOD, CM_ICLKEN);
90 DUMP_CM_MOD_REG(PLL_MOD, CM_CLKEN);
91 DUMP_CM_MOD_REG(PLL_MOD, CM_AUTOIDLE);
92 DUMP_PRM_MOD_REG(CORE_MOD, PM_PWSTST);
93#endif
94#if 0
95 /* DSP */
96 if (cpu_is_omap24xx()) {
97 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_FCLKEN);
98 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_ICLKEN);
99 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_IDLEST);
100 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE);
101 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL);
102 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSTCTRL);
103 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, RM_RSTCTRL);
104 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, RM_RSTST);
105 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, PM_PWSTCTRL);
106 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, PM_PWSTST);
107 }
108#endif
109 } else {
110 DUMP_PRM_MOD_REG(CORE_MOD, PM_WKST1);
111 if (cpu_is_omap24xx())
112 DUMP_PRM_MOD_REG(CORE_MOD, OMAP24XX_PM_WKST2);
113 DUMP_PRM_MOD_REG(WKUP_MOD, PM_WKST);
114 DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
115#if 1
116 DUMP_INTC_REG(INTC_PENDING_IRQ0, 0x0098);
117 DUMP_INTC_REG(INTC_PENDING_IRQ1, 0x00b8);
118 DUMP_INTC_REG(INTC_PENDING_IRQ2, 0x00d8);
119#endif
120 }
121
122 switch (mode) {
123 case 0:
124 s1 = "full";
125 s2 = "retention";
126 break;
127 case 1:
128 s1 = "MPU";
129 s2 = "retention";
130 break;
131 case 2:
132 s1 = "MPU";
133 s2 = "idle";
134 break;
135 }
136
137 if (!resume)
138#ifdef CONFIG_NO_HZ
139 printk(KERN_INFO
140 "--- Going to %s %s (next timer after %u ms)\n", s1, s2,
141 jiffies_to_msecs(get_next_timer_interrupt(jiffies) -
142 jiffies));
143#else
144 printk(KERN_INFO "--- Going to %s %s\n", s1, s2);
145#endif
146 else
147 printk(KERN_INFO "--- Woke up (slept for %u.%03u ms)\n",
148 us / 1000, us % 1000);
149
150 for (i = 0; i < reg_count; i++)
151 printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val);
152}
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
deleted file mode 100644
index ea8ceaed09cb..000000000000
--- a/arch/arm/mach-omap2/pm.c
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap2/pm.c
3 *
4 * OMAP2 Power Management Routines
5 *
6 * Copyright (C) 2006 Nokia Corporation
7 * Tony Lindgren <tony@atomide.com>
8 *
9 * Copyright (C) 2005 Texas Instruments, Inc.
10 * Richard Woodruff <r-woodruff2@ti.com>
11 *
12 * Based on pm.c for omap1
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 version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/suspend.h>
20#include <linux/sched.h>
21#include <linux/proc_fs.h>
22#include <linux/interrupt.h>
23#include <linux/sysfs.h>
24#include <linux/module.h>
25#include <linux/delay.h>
26#include <linux/clk.h>
27#include <linux/io.h>
28
29#include <asm/irq.h>
30#include <asm/atomic.h>
31#include <asm/mach/time.h>
32#include <asm/mach/irq.h>
33
34#include <mach/irqs.h>
35#include <mach/clock.h>
36#include <mach/sram.h>
37#include <mach/pm.h>
38
39static struct clk *vclk;
40static void (*omap2_sram_idle)(void);
41static void (*omap2_sram_suspend)(int dllctrl, int cpu_rev);
42static void (*saved_idle)(void);
43
44extern void __init pmdomain_init(void);
45extern void pmdomain_set_autoidle(void);
46
47static unsigned int omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_SIZE];
48
49void omap2_pm_idle(void)
50{
51 local_irq_disable();
52 local_fiq_disable();
53 if (need_resched()) {
54 local_fiq_enable();
55 local_irq_enable();
56 return;
57 }
58
59 omap2_sram_idle();
60 local_fiq_enable();
61 local_irq_enable();
62}
63
64static int omap2_pm_prepare(void)
65{
66 /* We cannot sleep in idle until we have resumed */
67 saved_idle = pm_idle;
68 pm_idle = NULL;
69 return 0;
70}
71
72static int omap2_pm_suspend(void)
73{
74 return 0;
75}
76
77static int omap2_pm_enter(suspend_state_t state)
78{
79 int ret = 0;
80
81 switch (state)
82 {
83 case PM_SUSPEND_STANDBY:
84 case PM_SUSPEND_MEM:
85 ret = omap2_pm_suspend();
86 break;
87 default:
88 ret = -EINVAL;
89 }
90
91 return ret;
92}
93
94static void omap2_pm_finish(void)
95{
96 pm_idle = saved_idle;
97}
98
99static struct platform_suspend_ops omap_pm_ops = {
100 .prepare = omap2_pm_prepare,
101 .enter = omap2_pm_enter,
102 .finish = omap2_pm_finish,
103 .valid = suspend_valid_only_mem,
104};
105
106static int __init omap2_pm_init(void)
107{
108 return 0;
109}
110
111__initcall(omap2_pm_init);
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
new file mode 100644
index 000000000000..f7b3baf76678
--- /dev/null
+++ b/arch/arm/mach-omap2/pm.h
@@ -0,0 +1,38 @@
1/*
2 * OMAP2/3 Power Management Routines
3 *
4 * Copyright (C) 2008 Nokia Corporation
5 * Jouni Hogander
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H
12#define __ARCH_ARM_MACH_OMAP2_PM_H
13
14extern int omap2_pm_init(void);
15extern int omap3_pm_init(void);
16
17#ifdef CONFIG_PM_DEBUG
18extern void omap2_pm_dump(int mode, int resume, unsigned int us);
19extern int omap2_pm_debug;
20#else
21#define omap2_pm_dump(mode, resume, us) do {} while (0);
22#define omap2_pm_debug 0
23#endif /* CONFIG_PM_DEBUG */
24
25extern void omap24xx_idle_loop_suspend(void);
26
27extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
28 void __iomem *sdrc_power);
29extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
30extern void save_secure_ram_context(u32 *addr);
31
32extern unsigned int omap24xx_idle_loop_suspend_sz;
33extern unsigned int omap34xx_suspend_sz;
34extern unsigned int save_secure_ram_context_sz;
35extern unsigned int omap24xx_cpu_suspend_sz;
36extern unsigned int omap34xx_cpu_suspend_sz;
37
38#endif
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
new file mode 100644
index 000000000000..db1025562fb0
--- /dev/null
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -0,0 +1,549 @@
1/*
2 * OMAP2 Power Management Routines
3 *
4 * Copyright (C) 2005 Texas Instruments, Inc.
5 * Copyright (C) 2006-2008 Nokia Corporation
6 *
7 * Written by:
8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Tony Lindgren
10 * Juha Yrjola
11 * Amit Kucheria <amit.kucheria@nokia.com>
12 * Igor Stoppa <igor.stoppa@nokia.com>
13 *
14 * Based on pm.c for omap1
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20
21#include <linux/suspend.h>
22#include <linux/sched.h>
23#include <linux/proc_fs.h>
24#include <linux/interrupt.h>
25#include <linux/sysfs.h>
26#include <linux/module.h>
27#include <linux/delay.h>
28#include <linux/clk.h>
29#include <linux/io.h>
30#include <linux/irq.h>
31#include <linux/time.h>
32#include <linux/gpio.h>
33
34#include <asm/mach/time.h>
35#include <asm/mach/irq.h>
36#include <asm/mach-types.h>
37
38#include <mach/irqs.h>
39#include <mach/clock.h>
40#include <mach/sram.h>
41#include <mach/control.h>
42#include <mach/mux.h>
43#include <mach/dma.h>
44#include <mach/board.h>
45
46#include "prm.h"
47#include "prm-regbits-24xx.h"
48#include "cm.h"
49#include "cm-regbits-24xx.h"
50#include "sdrc.h"
51#include "pm.h"
52
53#include <mach/powerdomain.h>
54#include <mach/clockdomain.h>
55
56static void (*omap2_sram_idle)(void);
57static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
58 void __iomem *sdrc_power);
59
60static struct powerdomain *mpu_pwrdm;
61static struct powerdomain *core_pwrdm;
62
63static struct clockdomain *dsp_clkdm;
64static struct clockdomain *gfx_clkdm;
65
66static struct clk *osc_ck, *emul_ck;
67
68static int omap2_fclks_active(void)
69{
70 u32 f1, f2;
71
72 f1 = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
73 f2 = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
74
75 /* Ignore UART clocks. These are handled by UART core (serial.c) */
76 f1 &= ~(OMAP24XX_EN_UART1 | OMAP24XX_EN_UART2);
77 f2 &= ~OMAP24XX_EN_UART3;
78
79 if (f1 | f2)
80 return 1;
81 return 0;
82}
83
84static void omap2_enter_full_retention(void)
85{
86 u32 l;
87 struct timespec ts_preidle, ts_postidle, ts_idle;
88
89 /* There is 1 reference hold for all children of the oscillator
90 * clock, the following will remove it. If no one else uses the
91 * oscillator itself it will be disabled if/when we enter retention
92 * mode.
93 */
94 clk_disable(osc_ck);
95
96 /* Clear old wake-up events */
97 /* REVISIT: These write to reserved bits? */
98 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
99 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
100 prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
101
102 /*
103 * Set MPU powerdomain's next power state to RETENTION;
104 * preserve logic state during retention
105 */
106 pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET);
107 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET);
108
109 /* Workaround to kill USB */
110 l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL;
111 omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0);
112
113 omap2_gpio_prepare_for_retention();
114
115 if (omap2_pm_debug) {
116 omap2_pm_dump(0, 0, 0);
117 getnstimeofday(&ts_preidle);
118 }
119
120 /* One last check for pending IRQs to avoid extra latency due
121 * to sleeping unnecessarily. */
122 if (omap_irq_pending())
123 goto no_sleep;
124
125 omap_uart_prepare_idle(0);
126 omap_uart_prepare_idle(1);
127 omap_uart_prepare_idle(2);
128
129 /* Jump to SRAM suspend code */
130 omap2_sram_suspend(sdrc_read_reg(SDRC_DLLA_CTRL),
131 OMAP_SDRC_REGADDR(SDRC_DLLA_CTRL),
132 OMAP_SDRC_REGADDR(SDRC_POWER));
133
134 omap_uart_resume_idle(2);
135 omap_uart_resume_idle(1);
136 omap_uart_resume_idle(0);
137
138no_sleep:
139 if (omap2_pm_debug) {
140 unsigned long long tmp;
141
142 getnstimeofday(&ts_postidle);
143 ts_idle = timespec_sub(ts_postidle, ts_preidle);
144 tmp = timespec_to_ns(&ts_idle) * NSEC_PER_USEC;
145 omap2_pm_dump(0, 1, tmp);
146 }
147 omap2_gpio_resume_after_retention();
148
149 clk_enable(osc_ck);
150
151 /* clear CORE wake-up events */
152 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
153 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
154
155 /* wakeup domain events - bit 1: GPT1, bit5 GPIO */
156 prm_clear_mod_reg_bits(0x4 | 0x1, WKUP_MOD, PM_WKST);
157
158 /* MPU domain wake events */
159 l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
160 if (l & 0x01)
161 prm_write_mod_reg(0x01, OCP_MOD,
162 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
163 if (l & 0x20)
164 prm_write_mod_reg(0x20, OCP_MOD,
165 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
166
167 /* Mask future PRCM-to-MPU interrupts */
168 prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
169}
170
171static int omap2_i2c_active(void)
172{
173 u32 l;
174
175 l = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
176 return l & (OMAP2420_EN_I2C2 | OMAP2420_EN_I2C1);
177}
178
179static int sti_console_enabled;
180
181static int omap2_allow_mpu_retention(void)
182{
183 u32 l;
184
185 /* Check for MMC, UART2, UART1, McSPI2, McSPI1 and DSS1. */
186 l = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
187 if (l & (OMAP2420_EN_MMC | OMAP24XX_EN_UART2 |
188 OMAP24XX_EN_UART1 | OMAP24XX_EN_MCSPI2 |
189 OMAP24XX_EN_MCSPI1 | OMAP24XX_EN_DSS1))
190 return 0;
191 /* Check for UART3. */
192 l = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
193 if (l & OMAP24XX_EN_UART3)
194 return 0;
195 if (sti_console_enabled)
196 return 0;
197
198 return 1;
199}
200
201static void omap2_enter_mpu_retention(void)
202{
203 int only_idle = 0;
204 struct timespec ts_preidle, ts_postidle, ts_idle;
205
206 /* Putting MPU into the WFI state while a transfer is active
207 * seems to cause the I2C block to timeout. Why? Good question. */
208 if (omap2_i2c_active())
209 return;
210
211 /* The peripherals seem not to be able to wake up the MPU when
212 * it is in retention mode. */
213 if (omap2_allow_mpu_retention()) {
214 /* REVISIT: These write to reserved bits? */
215 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
216 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
217 prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
218
219 /* Try to enter MPU retention */
220 prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) |
221 OMAP_LOGICRETSTATE,
222 MPU_MOD, PM_PWSTCTRL);
223 } else {
224 /* Block MPU retention */
225
226 prm_write_mod_reg(OMAP_LOGICRETSTATE, MPU_MOD, PM_PWSTCTRL);
227 only_idle = 1;
228 }
229
230 if (omap2_pm_debug) {
231 omap2_pm_dump(only_idle ? 2 : 1, 0, 0);
232 getnstimeofday(&ts_preidle);
233 }
234
235 omap2_sram_idle();
236
237 if (omap2_pm_debug) {
238 unsigned long long tmp;
239
240 getnstimeofday(&ts_postidle);
241 ts_idle = timespec_sub(ts_postidle, ts_preidle);
242 tmp = timespec_to_ns(&ts_idle) * NSEC_PER_USEC;
243 omap2_pm_dump(only_idle ? 2 : 1, 1, tmp);
244 }
245}
246
247static int omap2_can_sleep(void)
248{
249 if (omap2_fclks_active())
250 return 0;
251 if (osc_ck->usecount > 1)
252 return 0;
253 if (omap_dma_running())
254 return 0;
255
256 return 1;
257}
258
259static void omap2_pm_idle(void)
260{
261 local_irq_disable();
262 local_fiq_disable();
263
264 if (!omap2_can_sleep()) {
265 if (omap_irq_pending())
266 goto out;
267 omap2_enter_mpu_retention();
268 goto out;
269 }
270
271 if (omap_irq_pending())
272 goto out;
273
274 omap2_enter_full_retention();
275
276out:
277 local_fiq_enable();
278 local_irq_enable();
279}
280
281static int omap2_pm_prepare(void)
282{
283 /* We cannot sleep in idle until we have resumed */
284 disable_hlt();
285 return 0;
286}
287
288static int omap2_pm_suspend(void)
289{
290 u32 wken_wkup, mir1;
291
292 wken_wkup = prm_read_mod_reg(WKUP_MOD, PM_WKEN);
293 prm_write_mod_reg(wken_wkup & ~OMAP24XX_EN_GPT1, WKUP_MOD, PM_WKEN);
294
295 /* Mask GPT1 */
296 mir1 = omap_readl(0x480fe0a4);
297 omap_writel(1 << 5, 0x480fe0ac);
298
299 omap_uart_prepare_suspend();
300 omap2_enter_full_retention();
301
302 omap_writel(mir1, 0x480fe0a4);
303 prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN);
304
305 return 0;
306}
307
308static int omap2_pm_enter(suspend_state_t state)
309{
310 int ret = 0;
311
312 switch (state) {
313 case PM_SUSPEND_STANDBY:
314 case PM_SUSPEND_MEM:
315 ret = omap2_pm_suspend();
316 break;
317 default:
318 ret = -EINVAL;
319 }
320
321 return ret;
322}
323
324static void omap2_pm_finish(void)
325{
326 enable_hlt();
327}
328
329static struct platform_suspend_ops omap_pm_ops = {
330 .prepare = omap2_pm_prepare,
331 .enter = omap2_pm_enter,
332 .finish = omap2_pm_finish,
333 .valid = suspend_valid_only_mem,
334};
335
336static int _pm_clkdm_enable_hwsup(struct clockdomain *clkdm)
337{
338 omap2_clkdm_allow_idle(clkdm);
339 return 0;
340}
341
342static void __init prcm_setup_regs(void)
343{
344 int i, num_mem_banks;
345 struct powerdomain *pwrdm;
346
347 /* Enable autoidle */
348 prm_write_mod_reg(OMAP24XX_AUTOIDLE, OCP_MOD,
349 OMAP2_PRCM_SYSCONFIG_OFFSET);
350
351 /* Set all domain wakeup dependencies */
352 prm_write_mod_reg(OMAP_EN_WKUP_MASK, MPU_MOD, PM_WKDEP);
353 prm_write_mod_reg(0, OMAP24XX_DSP_MOD, PM_WKDEP);
354 prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
355 prm_write_mod_reg(0, CORE_MOD, PM_WKDEP);
356 if (cpu_is_omap2430())
357 prm_write_mod_reg(0, OMAP2430_MDM_MOD, PM_WKDEP);
358
359 /*
360 * Set CORE powerdomain memory banks to retain their contents
361 * during RETENTION
362 */
363 num_mem_banks = pwrdm_get_mem_bank_count(core_pwrdm);
364 for (i = 0; i < num_mem_banks; i++)
365 pwrdm_set_mem_retst(core_pwrdm, i, PWRDM_POWER_RET);
366
367 /* Set CORE powerdomain's next power state to RETENTION */
368 pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_RET);
369
370 /*
371 * Set MPU powerdomain's next power state to RETENTION;
372 * preserve logic state during retention
373 */
374 pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET);
375 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET);
376
377 /* Force-power down DSP, GFX powerdomains */
378
379 pwrdm = clkdm_get_pwrdm(dsp_clkdm);
380 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
381 omap2_clkdm_sleep(dsp_clkdm);
382
383 pwrdm = clkdm_get_pwrdm(gfx_clkdm);
384 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
385 omap2_clkdm_sleep(gfx_clkdm);
386
387 /* Enable clockdomain hardware-supervised control for all clkdms */
388 clkdm_for_each(_pm_clkdm_enable_hwsup);
389
390 /* Enable clock autoidle for all domains */
391 cm_write_mod_reg(OMAP24XX_AUTO_CAM |
392 OMAP24XX_AUTO_MAILBOXES |
393 OMAP24XX_AUTO_WDT4 |
394 OMAP2420_AUTO_WDT3 |
395 OMAP24XX_AUTO_MSPRO |
396 OMAP2420_AUTO_MMC |
397 OMAP24XX_AUTO_FAC |
398 OMAP2420_AUTO_EAC |
399 OMAP24XX_AUTO_HDQ |
400 OMAP24XX_AUTO_UART2 |
401 OMAP24XX_AUTO_UART1 |
402 OMAP24XX_AUTO_I2C2 |
403 OMAP24XX_AUTO_I2C1 |
404 OMAP24XX_AUTO_MCSPI2 |
405 OMAP24XX_AUTO_MCSPI1 |
406 OMAP24XX_AUTO_MCBSP2 |
407 OMAP24XX_AUTO_MCBSP1 |
408 OMAP24XX_AUTO_GPT12 |
409 OMAP24XX_AUTO_GPT11 |
410 OMAP24XX_AUTO_GPT10 |
411 OMAP24XX_AUTO_GPT9 |
412 OMAP24XX_AUTO_GPT8 |
413 OMAP24XX_AUTO_GPT7 |
414 OMAP24XX_AUTO_GPT6 |
415 OMAP24XX_AUTO_GPT5 |
416 OMAP24XX_AUTO_GPT4 |
417 OMAP24XX_AUTO_GPT3 |
418 OMAP24XX_AUTO_GPT2 |
419 OMAP2420_AUTO_VLYNQ |
420 OMAP24XX_AUTO_DSS,
421 CORE_MOD, CM_AUTOIDLE1);
422 cm_write_mod_reg(OMAP24XX_AUTO_UART3 |
423 OMAP24XX_AUTO_SSI |
424 OMAP24XX_AUTO_USB,
425 CORE_MOD, CM_AUTOIDLE2);
426 cm_write_mod_reg(OMAP24XX_AUTO_SDRC |
427 OMAP24XX_AUTO_GPMC |
428 OMAP24XX_AUTO_SDMA,
429 CORE_MOD, CM_AUTOIDLE3);
430 cm_write_mod_reg(OMAP24XX_AUTO_PKA |
431 OMAP24XX_AUTO_AES |
432 OMAP24XX_AUTO_RNG |
433 OMAP24XX_AUTO_SHA |
434 OMAP24XX_AUTO_DES,
435 CORE_MOD, OMAP24XX_CM_AUTOIDLE4);
436
437 cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI, OMAP24XX_DSP_MOD, CM_AUTOIDLE);
438
439 /* Put DPLL and both APLLs into autoidle mode */
440 cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) |
441 (0x03 << OMAP24XX_AUTO_96M_SHIFT) |
442 (0x03 << OMAP24XX_AUTO_54M_SHIFT),
443 PLL_MOD, CM_AUTOIDLE);
444
445 cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL |
446 OMAP24XX_AUTO_WDT1 |
447 OMAP24XX_AUTO_MPU_WDT |
448 OMAP24XX_AUTO_GPIOS |
449 OMAP24XX_AUTO_32KSYNC |
450 OMAP24XX_AUTO_GPT1,
451 WKUP_MOD, CM_AUTOIDLE);
452
453 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk
454 * stabilisation */
455 prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
456 OMAP2_PRCM_CLKSSETUP_OFFSET);
457
458 /* Configure automatic voltage transition */
459 prm_write_mod_reg(2 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
460 OMAP2_PRCM_VOLTSETUP_OFFSET);
461 prm_write_mod_reg(OMAP24XX_AUTO_EXTVOLT |
462 (0x1 << OMAP24XX_SETOFF_LEVEL_SHIFT) |
463 OMAP24XX_MEMRETCTRL |
464 (0x1 << OMAP24XX_SETRET_LEVEL_SHIFT) |
465 (0x0 << OMAP24XX_VOLT_LEVEL_SHIFT),
466 OMAP24XX_GR_MOD, OMAP2_PRCM_VOLTCTRL_OFFSET);
467
468 /* Enable wake-up events */
469 prm_write_mod_reg(OMAP24XX_EN_GPIOS | OMAP24XX_EN_GPT1,
470 WKUP_MOD, PM_WKEN);
471}
472
473int __init omap2_pm_init(void)
474{
475 u32 l;
476
477 if (!cpu_is_omap24xx())
478 return -ENODEV;
479
480 printk(KERN_INFO "Power Management for OMAP2 initializing\n");
481 l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET);
482 printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
483
484 /* Look up important powerdomains, clockdomains */
485
486 mpu_pwrdm = pwrdm_lookup("mpu_pwrdm");
487 if (!mpu_pwrdm)
488 pr_err("PM: mpu_pwrdm not found\n");
489
490 core_pwrdm = pwrdm_lookup("core_pwrdm");
491 if (!core_pwrdm)
492 pr_err("PM: core_pwrdm not found\n");
493
494 dsp_clkdm = clkdm_lookup("dsp_clkdm");
495 if (!dsp_clkdm)
496 pr_err("PM: mpu_clkdm not found\n");
497
498 gfx_clkdm = clkdm_lookup("gfx_clkdm");
499 if (!gfx_clkdm)
500 pr_err("PM: gfx_clkdm not found\n");
501
502
503 osc_ck = clk_get(NULL, "osc_ck");
504 if (IS_ERR(osc_ck)) {
505 printk(KERN_ERR "could not get osc_ck\n");
506 return -ENODEV;
507 }
508
509 if (cpu_is_omap242x()) {
510 emul_ck = clk_get(NULL, "emul_ck");
511 if (IS_ERR(emul_ck)) {
512 printk(KERN_ERR "could not get emul_ck\n");
513 clk_put(osc_ck);
514 return -ENODEV;
515 }
516 }
517
518 prcm_setup_regs();
519
520 /* Hack to prevent MPU retention when STI console is enabled. */
521 {
522 const struct omap_sti_console_config *sti;
523
524 sti = omap_get_config(OMAP_TAG_STI_CONSOLE,
525 struct omap_sti_console_config);
526 if (sti != NULL && sti->enable)
527 sti_console_enabled = 1;
528 }
529
530 /*
531 * We copy the assembler sleep/wakeup routines to SRAM.
532 * These routines need to be in SRAM as that's the only
533 * memory the MPU can see when it wakes up.
534 */
535 if (cpu_is_omap24xx()) {
536 omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
537 omap24xx_idle_loop_suspend_sz);
538
539 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
540 omap24xx_cpu_suspend_sz);
541 }
542
543 suspend_set_ops(&omap_pm_ops);
544 pm_idle = omap2_pm_idle;
545
546 return 0;
547}
548
549late_initcall(omap2_pm_init);
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
new file mode 100644
index 000000000000..841d4c5ed8be
--- /dev/null
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -0,0 +1,710 @@
1/*
2 * OMAP3 Power Management Routines
3 *
4 * Copyright (C) 2006-2008 Nokia Corporation
5 * Tony Lindgren <tony@atomide.com>
6 * Jouni Hogander
7 *
8 * Copyright (C) 2005 Texas Instruments, Inc.
9 * Richard Woodruff <r-woodruff2@ti.com>
10 *
11 * Based on pm.c for omap1
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18#include <linux/pm.h>
19#include <linux/suspend.h>
20#include <linux/interrupt.h>
21#include <linux/module.h>
22#include <linux/list.h>
23#include <linux/err.h>
24#include <linux/gpio.h>
25
26#include <mach/sram.h>
27#include <mach/clockdomain.h>
28#include <mach/powerdomain.h>
29#include <mach/control.h>
30#include <mach/serial.h>
31
32#include "cm.h"
33#include "cm-regbits-34xx.h"
34#include "prm-regbits-34xx.h"
35
36#include "prm.h"
37#include "pm.h"
38
39struct power_state {
40 struct powerdomain *pwrdm;
41 u32 next_state;
42 u32 saved_state;
43 struct list_head node;
44};
45
46static LIST_HEAD(pwrst_list);
47
48static void (*_omap_sram_idle)(u32 *addr, int save_state);
49
50static struct powerdomain *mpu_pwrdm;
51
52/* PRCM Interrupt Handler for wakeups */
53static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
54{
55 u32 wkst, irqstatus_mpu;
56 u32 fclk, iclk;
57
58 /* WKUP */
59 wkst = prm_read_mod_reg(WKUP_MOD, PM_WKST);
60 if (wkst) {
61 iclk = cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
62 fclk = cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
63 cm_set_mod_reg_bits(wkst, WKUP_MOD, CM_ICLKEN);
64 cm_set_mod_reg_bits(wkst, WKUP_MOD, CM_FCLKEN);
65 prm_write_mod_reg(wkst, WKUP_MOD, PM_WKST);
66 while (prm_read_mod_reg(WKUP_MOD, PM_WKST))
67 cpu_relax();
68 cm_write_mod_reg(iclk, WKUP_MOD, CM_ICLKEN);
69 cm_write_mod_reg(fclk, WKUP_MOD, CM_FCLKEN);
70 }
71
72 /* CORE */
73 wkst = prm_read_mod_reg(CORE_MOD, PM_WKST1);
74 if (wkst) {
75 iclk = cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
76 fclk = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
77 cm_set_mod_reg_bits(wkst, CORE_MOD, CM_ICLKEN1);
78 cm_set_mod_reg_bits(wkst, CORE_MOD, CM_FCLKEN1);
79 prm_write_mod_reg(wkst, CORE_MOD, PM_WKST1);
80 while (prm_read_mod_reg(CORE_MOD, PM_WKST1))
81 cpu_relax();
82 cm_write_mod_reg(iclk, CORE_MOD, CM_ICLKEN1);
83 cm_write_mod_reg(fclk, CORE_MOD, CM_FCLKEN1);
84 }
85 wkst = prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_WKST3);
86 if (wkst) {
87 iclk = cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
88 fclk = cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
89 cm_set_mod_reg_bits(wkst, CORE_MOD, CM_ICLKEN3);
90 cm_set_mod_reg_bits(wkst, CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
91 prm_write_mod_reg(wkst, CORE_MOD, OMAP3430ES2_PM_WKST3);
92 while (prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_WKST3))
93 cpu_relax();
94 cm_write_mod_reg(iclk, CORE_MOD, CM_ICLKEN3);
95 cm_write_mod_reg(fclk, CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
96 }
97
98 /* PER */
99 wkst = prm_read_mod_reg(OMAP3430_PER_MOD, PM_WKST);
100 if (wkst) {
101 iclk = cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
102 fclk = cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
103 cm_set_mod_reg_bits(wkst, OMAP3430_PER_MOD, CM_ICLKEN);
104 cm_set_mod_reg_bits(wkst, OMAP3430_PER_MOD, CM_FCLKEN);
105 prm_write_mod_reg(wkst, OMAP3430_PER_MOD, PM_WKST);
106 while (prm_read_mod_reg(OMAP3430_PER_MOD, PM_WKST))
107 cpu_relax();
108 cm_write_mod_reg(iclk, OMAP3430_PER_MOD, CM_ICLKEN);
109 cm_write_mod_reg(fclk, OMAP3430_PER_MOD, CM_FCLKEN);
110 }
111
112 if (omap_rev() > OMAP3430_REV_ES1_0) {
113 /* USBHOST */
114 wkst = prm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, PM_WKST);
115 if (wkst) {
116 iclk = cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
117 CM_ICLKEN);
118 fclk = cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
119 CM_FCLKEN);
120 cm_set_mod_reg_bits(wkst, OMAP3430ES2_USBHOST_MOD,
121 CM_ICLKEN);
122 cm_set_mod_reg_bits(wkst, OMAP3430ES2_USBHOST_MOD,
123 CM_FCLKEN);
124 prm_write_mod_reg(wkst, OMAP3430ES2_USBHOST_MOD,
125 PM_WKST);
126 while (prm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
127 PM_WKST))
128 cpu_relax();
129 cm_write_mod_reg(iclk, OMAP3430ES2_USBHOST_MOD,
130 CM_ICLKEN);
131 cm_write_mod_reg(fclk, OMAP3430ES2_USBHOST_MOD,
132 CM_FCLKEN);
133 }
134 }
135
136 irqstatus_mpu = prm_read_mod_reg(OCP_MOD,
137 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
138 prm_write_mod_reg(irqstatus_mpu, OCP_MOD,
139 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
140
141 while (prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET))
142 cpu_relax();
143
144 return IRQ_HANDLED;
145}
146
147static void omap_sram_idle(void)
148{
149 /* Variable to tell what needs to be saved and restored
150 * in omap_sram_idle*/
151 /* save_state = 0 => Nothing to save and restored */
152 /* save_state = 1 => Only L1 and logic lost */
153 /* save_state = 2 => Only L2 lost */
154 /* save_state = 3 => L1, L2 and logic lost */
155 int save_state = 0, mpu_next_state;
156
157 if (!_omap_sram_idle)
158 return;
159
160 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
161 switch (mpu_next_state) {
162 case PWRDM_POWER_RET:
163 /* No need to save context */
164 save_state = 0;
165 break;
166 default:
167 /* Invalid state */
168 printk(KERN_ERR "Invalid mpu state in sram_idle\n");
169 return;
170 }
171 omap2_gpio_prepare_for_retention();
172 omap_uart_prepare_idle(0);
173 omap_uart_prepare_idle(1);
174 omap_uart_prepare_idle(2);
175
176 _omap_sram_idle(NULL, save_state);
177 cpu_init();
178
179 omap_uart_resume_idle(2);
180 omap_uart_resume_idle(1);
181 omap_uart_resume_idle(0);
182 omap2_gpio_resume_after_retention();
183}
184
185/*
186 * Check if functional clocks are enabled before entering
187 * sleep. This function could be behind CONFIG_PM_DEBUG
188 * when all drivers are configuring their sysconfig registers
189 * properly and using their clocks properly.
190 */
191static int omap3_fclks_active(void)
192{
193 u32 fck_core1 = 0, fck_core3 = 0, fck_sgx = 0, fck_dss = 0,
194 fck_cam = 0, fck_per = 0, fck_usbhost = 0;
195
196 fck_core1 = cm_read_mod_reg(CORE_MOD,
197 CM_FCLKEN1);
198 if (omap_rev() > OMAP3430_REV_ES1_0) {
199 fck_core3 = cm_read_mod_reg(CORE_MOD,
200 OMAP3430ES2_CM_FCLKEN3);
201 fck_sgx = cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
202 CM_FCLKEN);
203 fck_usbhost = cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
204 CM_FCLKEN);
205 } else
206 fck_sgx = cm_read_mod_reg(GFX_MOD,
207 OMAP3430ES2_CM_FCLKEN3);
208 fck_dss = cm_read_mod_reg(OMAP3430_DSS_MOD,
209 CM_FCLKEN);
210 fck_cam = cm_read_mod_reg(OMAP3430_CAM_MOD,
211 CM_FCLKEN);
212 fck_per = cm_read_mod_reg(OMAP3430_PER_MOD,
213 CM_FCLKEN);
214
215 /* Ignore UART clocks. These are handled by UART core (serial.c) */
216 fck_core1 &= ~(OMAP3430_EN_UART1 | OMAP3430_EN_UART2);
217 fck_per &= ~OMAP3430_EN_UART3;
218
219 if (fck_core1 | fck_core3 | fck_sgx | fck_dss |
220 fck_cam | fck_per | fck_usbhost)
221 return 1;
222 return 0;
223}
224
225static int omap3_can_sleep(void)
226{
227 if (!omap_uart_can_sleep())
228 return 0;
229 if (omap3_fclks_active())
230 return 0;
231 return 1;
232}
233
234/* This sets pwrdm state (other than mpu & core. Currently only ON &
235 * RET are supported. Function is assuming that clkdm doesn't have
236 * hw_sup mode enabled. */
237static int set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
238{
239 u32 cur_state;
240 int sleep_switch = 0;
241 int ret = 0;
242
243 if (pwrdm == NULL || IS_ERR(pwrdm))
244 return -EINVAL;
245
246 while (!(pwrdm->pwrsts & (1 << state))) {
247 if (state == PWRDM_POWER_OFF)
248 return ret;
249 state--;
250 }
251
252 cur_state = pwrdm_read_next_pwrst(pwrdm);
253 if (cur_state == state)
254 return ret;
255
256 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) {
257 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
258 sleep_switch = 1;
259 pwrdm_wait_transition(pwrdm);
260 }
261
262 ret = pwrdm_set_next_pwrst(pwrdm, state);
263 if (ret) {
264 printk(KERN_ERR "Unable to set state of powerdomain: %s\n",
265 pwrdm->name);
266 goto err;
267 }
268
269 if (sleep_switch) {
270 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
271 pwrdm_wait_transition(pwrdm);
272 }
273
274err:
275 return ret;
276}
277
278static void omap3_pm_idle(void)
279{
280 local_irq_disable();
281 local_fiq_disable();
282
283 if (!omap3_can_sleep())
284 goto out;
285
286 if (omap_irq_pending())
287 goto out;
288
289 omap_sram_idle();
290
291out:
292 local_fiq_enable();
293 local_irq_enable();
294}
295
296static int omap3_pm_prepare(void)
297{
298 disable_hlt();
299 return 0;
300}
301
302static int omap3_pm_suspend(void)
303{
304 struct power_state *pwrst;
305 int state, ret = 0;
306
307 /* Read current next_pwrsts */
308 list_for_each_entry(pwrst, &pwrst_list, node)
309 pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm);
310 /* Set ones wanted by suspend */
311 list_for_each_entry(pwrst, &pwrst_list, node) {
312 if (set_pwrdm_state(pwrst->pwrdm, pwrst->next_state))
313 goto restore;
314 if (pwrdm_clear_all_prev_pwrst(pwrst->pwrdm))
315 goto restore;
316 }
317
318 omap_uart_prepare_suspend();
319 omap_sram_idle();
320
321restore:
322 /* Restore next_pwrsts */
323 list_for_each_entry(pwrst, &pwrst_list, node) {
324 set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
325 state = pwrdm_read_prev_pwrst(pwrst->pwrdm);
326 if (state > pwrst->next_state) {
327 printk(KERN_INFO "Powerdomain (%s) didn't enter "
328 "target state %d\n",
329 pwrst->pwrdm->name, pwrst->next_state);
330 ret = -1;
331 }
332 }
333 if (ret)
334 printk(KERN_ERR "Could not enter target state in pm_suspend\n");
335 else
336 printk(KERN_INFO "Successfully put all powerdomains "
337 "to target state\n");
338
339 return ret;
340}
341
342static int omap3_pm_enter(suspend_state_t state)
343{
344 int ret = 0;
345
346 switch (state) {
347 case PM_SUSPEND_STANDBY:
348 case PM_SUSPEND_MEM:
349 ret = omap3_pm_suspend();
350 break;
351 default:
352 ret = -EINVAL;
353 }
354
355 return ret;
356}
357
358static void omap3_pm_finish(void)
359{
360 enable_hlt();
361}
362
363static struct platform_suspend_ops omap_pm_ops = {
364 .prepare = omap3_pm_prepare,
365 .enter = omap3_pm_enter,
366 .finish = omap3_pm_finish,
367 .valid = suspend_valid_only_mem,
368};
369
370
371/**
372 * omap3_iva_idle(): ensure IVA is in idle so it can be put into
373 * retention
374 *
375 * In cases where IVA2 is activated by bootcode, it may prevent
376 * full-chip retention or off-mode because it is not idle. This
377 * function forces the IVA2 into idle state so it can go
378 * into retention/off and thus allow full-chip retention/off.
379 *
380 **/
381static void __init omap3_iva_idle(void)
382{
383 /* ensure IVA2 clock is disabled */
384 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
385
386 /* if no clock activity, nothing else to do */
387 if (!(cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) &
388 OMAP3430_CLKACTIVITY_IVA2_MASK))
389 return;
390
391 /* Reset IVA2 */
392 prm_write_mod_reg(OMAP3430_RST1_IVA2 |
393 OMAP3430_RST2_IVA2 |
394 OMAP3430_RST3_IVA2,
395 OMAP3430_IVA2_MOD, RM_RSTCTRL);
396
397 /* Enable IVA2 clock */
398 cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2,
399 OMAP3430_IVA2_MOD, CM_FCLKEN);
400
401 /* Set IVA2 boot mode to 'idle' */
402 omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE,
403 OMAP343X_CONTROL_IVA2_BOOTMOD);
404
405 /* Un-reset IVA2 */
406 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, RM_RSTCTRL);
407
408 /* Disable IVA2 clock */
409 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
410
411 /* Reset IVA2 */
412 prm_write_mod_reg(OMAP3430_RST1_IVA2 |
413 OMAP3430_RST2_IVA2 |
414 OMAP3430_RST3_IVA2,
415 OMAP3430_IVA2_MOD, RM_RSTCTRL);
416}
417
418static void __init omap3_d2d_idle(void)
419{
420 u16 mask, padconf;
421
422 /* In a stand alone OMAP3430 where there is not a stacked
423 * modem for the D2D Idle Ack and D2D MStandby must be pulled
424 * high. S CONTROL_PADCONF_SAD2D_IDLEACK and
425 * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up. */
426 mask = (1 << 4) | (1 << 3); /* pull-up, enabled */
427 padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY);
428 padconf |= mask;
429 omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY);
430
431 padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK);
432 padconf |= mask;
433 omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
434
435 /* reset modem */
436 prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON |
437 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST,
438 CORE_MOD, RM_RSTCTRL);
439 prm_write_mod_reg(0, CORE_MOD, RM_RSTCTRL);
440}
441
442static void __init prcm_setup_regs(void)
443{
444 /* XXX Reset all wkdeps. This should be done when initializing
445 * powerdomains */
446 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
447 prm_write_mod_reg(0, MPU_MOD, PM_WKDEP);
448 prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP);
449 prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP);
450 prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP);
451 prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP);
452 if (omap_rev() > OMAP3430_REV_ES1_0) {
453 prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP);
454 prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
455 } else
456 prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
457
458 /*
459 * Enable interface clock autoidle for all modules.
460 * Note that in the long run this should be done by clockfw
461 */
462 cm_write_mod_reg(
463 OMAP3430_AUTO_MODEM |
464 OMAP3430ES2_AUTO_MMC3 |
465 OMAP3430ES2_AUTO_ICR |
466 OMAP3430_AUTO_AES2 |
467 OMAP3430_AUTO_SHA12 |
468 OMAP3430_AUTO_DES2 |
469 OMAP3430_AUTO_MMC2 |
470 OMAP3430_AUTO_MMC1 |
471 OMAP3430_AUTO_MSPRO |
472 OMAP3430_AUTO_HDQ |
473 OMAP3430_AUTO_MCSPI4 |
474 OMAP3430_AUTO_MCSPI3 |
475 OMAP3430_AUTO_MCSPI2 |
476 OMAP3430_AUTO_MCSPI1 |
477 OMAP3430_AUTO_I2C3 |
478 OMAP3430_AUTO_I2C2 |
479 OMAP3430_AUTO_I2C1 |
480 OMAP3430_AUTO_UART2 |
481 OMAP3430_AUTO_UART1 |
482 OMAP3430_AUTO_GPT11 |
483 OMAP3430_AUTO_GPT10 |
484 OMAP3430_AUTO_MCBSP5 |
485 OMAP3430_AUTO_MCBSP1 |
486 OMAP3430ES1_AUTO_FAC | /* This is es1 only */
487 OMAP3430_AUTO_MAILBOXES |
488 OMAP3430_AUTO_OMAPCTRL |
489 OMAP3430ES1_AUTO_FSHOSTUSB |
490 OMAP3430_AUTO_HSOTGUSB |
491 OMAP3430_AUTO_SAD2D |
492 OMAP3430_AUTO_SSI,
493 CORE_MOD, CM_AUTOIDLE1);
494
495 cm_write_mod_reg(
496 OMAP3430_AUTO_PKA |
497 OMAP3430_AUTO_AES1 |
498 OMAP3430_AUTO_RNG |
499 OMAP3430_AUTO_SHA11 |
500 OMAP3430_AUTO_DES1,
501 CORE_MOD, CM_AUTOIDLE2);
502
503 if (omap_rev() > OMAP3430_REV_ES1_0) {
504 cm_write_mod_reg(
505 OMAP3430_AUTO_MAD2D |
506 OMAP3430ES2_AUTO_USBTLL,
507 CORE_MOD, CM_AUTOIDLE3);
508 }
509
510 cm_write_mod_reg(
511 OMAP3430_AUTO_WDT2 |
512 OMAP3430_AUTO_WDT1 |
513 OMAP3430_AUTO_GPIO1 |
514 OMAP3430_AUTO_32KSYNC |
515 OMAP3430_AUTO_GPT12 |
516 OMAP3430_AUTO_GPT1 ,
517 WKUP_MOD, CM_AUTOIDLE);
518
519 cm_write_mod_reg(
520 OMAP3430_AUTO_DSS,
521 OMAP3430_DSS_MOD,
522 CM_AUTOIDLE);
523
524 cm_write_mod_reg(
525 OMAP3430_AUTO_CAM,
526 OMAP3430_CAM_MOD,
527 CM_AUTOIDLE);
528
529 cm_write_mod_reg(
530 OMAP3430_AUTO_GPIO6 |
531 OMAP3430_AUTO_GPIO5 |
532 OMAP3430_AUTO_GPIO4 |
533 OMAP3430_AUTO_GPIO3 |
534 OMAP3430_AUTO_GPIO2 |
535 OMAP3430_AUTO_WDT3 |
536 OMAP3430_AUTO_UART3 |
537 OMAP3430_AUTO_GPT9 |
538 OMAP3430_AUTO_GPT8 |
539 OMAP3430_AUTO_GPT7 |
540 OMAP3430_AUTO_GPT6 |
541 OMAP3430_AUTO_GPT5 |
542 OMAP3430_AUTO_GPT4 |
543 OMAP3430_AUTO_GPT3 |
544 OMAP3430_AUTO_GPT2 |
545 OMAP3430_AUTO_MCBSP4 |
546 OMAP3430_AUTO_MCBSP3 |
547 OMAP3430_AUTO_MCBSP2,
548 OMAP3430_PER_MOD,
549 CM_AUTOIDLE);
550
551 if (omap_rev() > OMAP3430_REV_ES1_0) {
552 cm_write_mod_reg(
553 OMAP3430ES2_AUTO_USBHOST,
554 OMAP3430ES2_USBHOST_MOD,
555 CM_AUTOIDLE);
556 }
557
558 /*
559 * Set all plls to autoidle. This is needed until autoidle is
560 * enabled by clockfw
561 */
562 cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT,
563 OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
564 cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT,
565 MPU_MOD,
566 CM_AUTOIDLE2);
567 cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) |
568 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT),
569 PLL_MOD,
570 CM_AUTOIDLE);
571 cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT,
572 PLL_MOD,
573 CM_AUTOIDLE2);
574
575 /*
576 * Enable control of expternal oscillator through
577 * sys_clkreq. In the long run clock framework should
578 * take care of this.
579 */
580 prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK,
581 1 << OMAP_AUTOEXTCLKMODE_SHIFT,
582 OMAP3430_GR_MOD,
583 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
584
585 /* setup wakup source */
586 prm_write_mod_reg(OMAP3430_EN_IO | OMAP3430_EN_GPIO1 |
587 OMAP3430_EN_GPT1 | OMAP3430_EN_GPT12,
588 WKUP_MOD, PM_WKEN);
589 /* No need to write EN_IO, that is always enabled */
590 prm_write_mod_reg(OMAP3430_EN_GPIO1 | OMAP3430_EN_GPT1 |
591 OMAP3430_EN_GPT12,
592 WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
593 /* For some reason IO doesn't generate wakeup event even if
594 * it is selected to mpu wakeup goup */
595 prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN,
596 OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
597
598 /* Don't attach IVA interrupts */
599 prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
600 prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
601 prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
602 prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
603
604 /* Clear any pending 'reset' flags */
605 prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST);
606 prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST);
607 prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST);
608 prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST);
609 prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST);
610 prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST);
611 prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST);
612
613 /* Clear any pending PRCM interrupts */
614 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
615
616 omap3_iva_idle();
617 omap3_d2d_idle();
618}
619
620static int __init pwrdms_setup(struct powerdomain *pwrdm)
621{
622 struct power_state *pwrst;
623
624 if (!pwrdm->pwrsts)
625 return 0;
626
627 pwrst = kmalloc(sizeof(struct power_state), GFP_KERNEL);
628 if (!pwrst)
629 return -ENOMEM;
630 pwrst->pwrdm = pwrdm;
631 pwrst->next_state = PWRDM_POWER_RET;
632 list_add(&pwrst->node, &pwrst_list);
633
634 if (pwrdm_has_hdwr_sar(pwrdm))
635 pwrdm_enable_hdwr_sar(pwrdm);
636
637 return set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
638}
639
640/*
641 * Enable hw supervised mode for all clockdomains if it's
642 * supported. Initiate sleep transition for other clockdomains, if
643 * they are not used
644 */
645static int __init clkdms_setup(struct clockdomain *clkdm)
646{
647 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
648 omap2_clkdm_allow_idle(clkdm);
649 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
650 atomic_read(&clkdm->usecount) == 0)
651 omap2_clkdm_sleep(clkdm);
652 return 0;
653}
654
655int __init omap3_pm_init(void)
656{
657 struct power_state *pwrst, *tmp;
658 int ret;
659
660 if (!cpu_is_omap34xx())
661 return -ENODEV;
662
663 printk(KERN_ERR "Power Management for TI OMAP3.\n");
664
665 /* XXX prcm_setup_regs needs to be before enabling hw
666 * supervised mode for powerdomains */
667 prcm_setup_regs();
668
669 ret = request_irq(INT_34XX_PRCM_MPU_IRQ,
670 (irq_handler_t)prcm_interrupt_handler,
671 IRQF_DISABLED, "prcm", NULL);
672 if (ret) {
673 printk(KERN_ERR "request_irq failed to register for 0x%x\n",
674 INT_34XX_PRCM_MPU_IRQ);
675 goto err1;
676 }
677
678 ret = pwrdm_for_each(pwrdms_setup);
679 if (ret) {
680 printk(KERN_ERR "Failed to setup powerdomains\n");
681 goto err2;
682 }
683
684 (void) clkdm_for_each(clkdms_setup);
685
686 mpu_pwrdm = pwrdm_lookup("mpu_pwrdm");
687 if (mpu_pwrdm == NULL) {
688 printk(KERN_ERR "Failed to get mpu_pwrdm\n");
689 goto err2;
690 }
691
692 _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
693 omap34xx_cpu_suspend_sz);
694
695 suspend_set_ops(&omap_pm_ops);
696
697 pm_idle = omap3_pm_idle;
698
699err1:
700 return ret;
701err2:
702 free_irq(INT_34XX_PRCM_MPU_IRQ, NULL);
703 list_for_each_entry_safe(pwrst, tmp, &pwrst_list, node) {
704 list_del(&pwrst->node);
705 kfree(pwrst);
706 }
707 return ret;
708}
709
710late_initcall(omap3_pm_init);
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 812d50ee495d..cb1ae84e0925 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -276,6 +276,8 @@
276/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ 276/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
277#define OMAP3430_EN_GPIO1 (1 << 3) 277#define OMAP3430_EN_GPIO1 (1 << 3)
278#define OMAP3430_EN_GPIO1_SHIFT 3 278#define OMAP3430_EN_GPIO1_SHIFT 3
279#define OMAP3430_EN_GPT12 (1 << 1)
280#define OMAP3430_EN_GPT12_SHIFT 1
279#define OMAP3430_EN_GPT1 (1 << 0) 281#define OMAP3430_EN_GPT1 (1 << 0)
280#define OMAP3430_EN_GPT1_SHIFT 0 282#define OMAP3430_EN_GPT1_SHIFT 0
281 283
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 826d326b8062..9937e2814696 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -16,17 +16,12 @@
16 16
17#include "prcm-common.h" 17#include "prcm-common.h"
18 18
19#ifndef __ASSEMBLER__
20#define OMAP_PRM_REGADDR(module, reg) \
21 IO_ADDRESS(OMAP2_PRM_BASE + (module) + (reg))
22#else
23#define OMAP2420_PRM_REGADDR(module, reg) \ 19#define OMAP2420_PRM_REGADDR(module, reg) \
24 IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg)) 20 IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
25#define OMAP2430_PRM_REGADDR(module, reg) \ 21#define OMAP2430_PRM_REGADDR(module, reg) \
26 IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg)) 22 IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
27#define OMAP34XX_PRM_REGADDR(module, reg) \ 23#define OMAP34XX_PRM_REGADDR(module, reg) \
28 IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg)) 24 IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
29#endif
30 25
31/* 26/*
32 * Architecture-specific global PRM registers 27 * Architecture-specific global PRM registers
@@ -38,80 +33,132 @@
38 * 33 *
39 */ 34 */
40 35
41/* Global 24xx registers in GR_MOD (Same as OCP_MOD for 24xx) */ 36#define OMAP2_PRCM_REVISION_OFFSET 0x0000
42#define OMAP24XX_PRCM_VOLTCTRL_OFFSET 0x0050 37#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
43#define OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET 0x0080 38#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
44 39#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
45/* 242x GR_MOD registers, use these only for assembly code */ 40
46#define OMAP242X_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OMAP24XX_GR_MOD, \ 41#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
47 OMAP24XX_PRCM_VOLTCTRL_OFFSET) 42#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
48#define OMAP242X_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OMAP24XX_GR_MOD, \ 43#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
49 OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET) 44#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
50 45
51/* 243x GR_MOD registers, use these only for assembly code */ 46#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
52#define OMAP243X_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OMAP24XX_GR_MOD, \ 47#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
53 OMAP24XX_PRCM_VOLTCTRL_OFFSET) 48#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
54#define OMAP243X_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OMAP24XX_GR_MOD, \ 49#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
55 OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET) 50#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
56 51#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
57/* These will disappear */ 52#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
58#define OMAP24XX_PRCM_REVISION OMAP_PRM_REGADDR(OCP_MOD, 0x0000) 53#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
59#define OMAP24XX_PRCM_SYSCONFIG OMAP_PRM_REGADDR(OCP_MOD, 0x0010) 54#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
60 55#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
61#define OMAP24XX_PRCM_IRQSTATUS_MPU OMAP_PRM_REGADDR(OCP_MOD, 0x0018) 56#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
62#define OMAP24XX_PRCM_IRQENABLE_MPU OMAP_PRM_REGADDR(OCP_MOD, 0x001c) 57#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
63 58#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
64#define OMAP24XX_PRCM_VOLTST OMAP_PRM_REGADDR(OCP_MOD, 0x0054) 59#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
65#define OMAP24XX_PRCM_CLKSRC_CTRL OMAP_PRM_REGADDR(OCP_MOD, 0x0060) 60#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
66#define OMAP24XX_PRCM_CLKOUT_CTRL OMAP_PRM_REGADDR(OCP_MOD, 0x0070) 61#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
67#define OMAP24XX_PRCM_CLKEMUL_CTRL OMAP_PRM_REGADDR(OCP_MOD, 0x0078) 62#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
68#define OMAP24XX_PRCM_CLKCFG_CTRL OMAP_PRM_REGADDR(OCP_MOD, 0x0080) 63#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
69#define OMAP24XX_PRCM_CLKCFG_STATUS OMAP_PRM_REGADDR(OCP_MOD, 0x0084) 64#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
70#define OMAP24XX_PRCM_VOLTSETUP OMAP_PRM_REGADDR(OCP_MOD, 0x0090) 65#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
71#define OMAP24XX_PRCM_CLKSSETUP OMAP_PRM_REGADDR(OCP_MOD, 0x0094) 66
72#define OMAP24XX_PRCM_POLCTRL OMAP_PRM_REGADDR(OCP_MOD, 0x0098) 67#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
73 68#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
74#define OMAP3430_PRM_REVISION OMAP_PRM_REGADDR(OCP_MOD, 0x0004) 69
75#define OMAP3430_PRM_SYSCONFIG OMAP_PRM_REGADDR(OCP_MOD, 0x0014) 70#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
76 71#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
77#define OMAP3430_PRM_IRQSTATUS_MPU OMAP_PRM_REGADDR(OCP_MOD, 0x0018) 72
78#define OMAP3430_PRM_IRQENABLE_MPU OMAP_PRM_REGADDR(OCP_MOD, 0x001c) 73#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
79 74#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
80 75#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
81#define OMAP3430_PRM_VC_SMPS_SA OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020) 76#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
82#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024) 77#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
83#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028) 78#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
84#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c) 79#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
85#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030) 80#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
86#define OMAP3430_PRM_VC_CH_CONF OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034) 81#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
87#define OMAP3430_PRM_VC_I2C_CFG OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038) 82#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
88#define OMAP3430_PRM_VC_BYPASS_VAL OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c) 83
89#define OMAP3430_PRM_RSTCTRL OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050) 84#define OMAP3_PRM_REVISION_OFFSET 0x0004
90#define OMAP3430_PRM_RSTTIME OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054) 85#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
91#define OMAP3430_PRM_RSTST OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058) 86#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
92#define OMAP3430_PRM_VOLTCTRL OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060) 87#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
93#define OMAP3430_PRM_SRAM_PCHARGE OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064) 88
94#define OMAP3430_PRM_CLKSRC_CTRL OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070) 89#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
95#define OMAP3430_PRM_VOLTSETUP1 OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090) 90#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
96#define OMAP3430_PRM_VOLTOFFSET OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094) 91#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
97#define OMAP3430_PRM_CLKSETUP OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098) 92#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
98#define OMAP3430_PRM_POLCTRL OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c) 93
99#define OMAP3430_PRM_VOLTSETUP2 OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0) 94
100#define OMAP3430_PRM_VP1_CONFIG OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0) 95#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
101#define OMAP3430_PRM_VP1_VSTEPMIN OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4) 96#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
102#define OMAP3430_PRM_VP1_VSTEPMAX OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8) 97#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
103#define OMAP3430_PRM_VP1_VLIMITTO OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc) 98#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
104#define OMAP3430_PRM_VP1_VOLTAGE OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0) 99#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
105#define OMAP3430_PRM_VP1_STATUS OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4) 100#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
106#define OMAP3430_PRM_VP2_CONFIG OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0) 101#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
107#define OMAP3430_PRM_VP2_VSTEPMIN OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4) 102#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
108#define OMAP3430_PRM_VP2_VSTEPMAX OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8) 103#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
109#define OMAP3430_PRM_VP2_VLIMITTO OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc) 104#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
110#define OMAP3430_PRM_VP2_VOLTAGE OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0) 105#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
111#define OMAP3430_PRM_VP2_STATUS OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4) 106#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
112 107#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
113#define OMAP3430_PRM_CLKSEL OMAP_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040) 108#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
114#define OMAP3430_PRM_CLKOUT_CTRL OMAP_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070) 109#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
110#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
111#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
112#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
113#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
114#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
115#define OMAP3_PRM_RSTST_OFFSET 0x0058
116#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
117#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
118#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
119#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
120#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
121#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
122#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
123#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
124#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
125#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
126#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
127#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
128#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
129#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
130#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
131#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
132#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
133#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
134#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
135#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
136#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
137#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
138#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
139#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
140#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
141#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
142#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
143#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
144#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
145#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
146#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
147#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
148#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
149#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
150#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
151#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
152#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
153#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
154#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
155#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
156#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
157
158#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
159#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
160#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
161#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
115 162
116/* 163/*
117 * Module specific PRM registers from PRM_BASE + domain offset 164 * Module specific PRM registers from PRM_BASE + domain offset
@@ -156,9 +203,11 @@
156 203
157#define OMAP3430_PM_MPUGRPSEL 0x00a4 204#define OMAP3430_PM_MPUGRPSEL 0x00a4
158#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL 205#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
206#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
159 207
160#define OMAP3430_PM_IVAGRPSEL 0x00a8 208#define OMAP3430_PM_IVAGRPSEL 0x00a8
161#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL 209#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
210#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
162 211
163#define OMAP3430_PM_PREPWSTST 0x00e8 212#define OMAP3430_PM_PREPWSTST 0x00e8
164 213
diff --git a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
new file mode 100644
index 000000000000..02e1c2d4705f
--- /dev/null
+++ b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
@@ -0,0 +1,55 @@
1/*
2 * SDRC register values for the Micron MT46H32M32LF-6
3 *
4 * Copyright (C) 2008 Texas Instruments, Inc.
5 * Copyright (C) 2008-2009 Nokia Corporation
6 *
7 * Paul Walmsley
8 *
9 * This program 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
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
16
17#include <mach/sdrc.h>
18
19/* Micron MT46H32M32LF-6 */
20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */
21static struct omap_sdrc_params mt46h32m32lf6_sdrc_params[] = {
22 [0] = {
23 .rate = 166000000,
24 .actim_ctrla = 0x9a9db4c6,
25 .actim_ctrlb = 0x00011217,
26 .rfr_ctrl = 0x0004dc01,
27 .mr = 0x00000032,
28 },
29 [1] = {
30 .rate = 165941176,
31 .actim_ctrla = 0x9a9db4c6,
32 .actim_ctrlb = 0x00011217,
33 .rfr_ctrl = 0x0004dc01,
34 .mr = 0x00000032,
35 },
36 [2] = {
37 .rate = 83000000,
38 .actim_ctrla = 0x51512283,
39 .actim_ctrlb = 0x0001120c,
40 .rfr_ctrl = 0x00025501,
41 .mr = 0x00000032,
42 },
43 [3] = {
44 .rate = 82970588,
45 .actim_ctrla = 0x51512283,
46 .actim_ctrlb = 0x0001120c,
47 .rfr_ctrl = 0x00025501,
48 .mr = 0x00000032,
49 },
50 [4] = {
51 .rate = 0
52 },
53};
54
55#endif
diff --git a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
new file mode 100644
index 000000000000..3751d293cb1f
--- /dev/null
+++ b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
@@ -0,0 +1,54 @@
1/*
2 * SDRC register values for the Qimonda HYB18M512160AF-6
3 *
4 * Copyright (C) 2008-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2009 Nokia Corporation
6 *
7 * Paul Walmsley
8 *
9 * This program 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
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
16
17#include <mach/sdrc.h>
18
19/* Qimonda HYB18M512160AF-6 */
20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = {
21 [0] = {
22 .rate = 166000000,
23 .actim_ctrla = 0x629db4c6,
24 .actim_ctrlb = 0x00012214,
25 .rfr_ctrl = 0x0004dc01,
26 .mr = 0x00000032,
27 },
28 [1] = {
29 .rate = 165941176,
30 .actim_ctrla = 0x629db4c6,
31 .actim_ctrlb = 0x00012214,
32 .rfr_ctrl = 0x0004dc01,
33 .mr = 0x00000032,
34 },
35 [2] = {
36 .rate = 83000000,
37 .actim_ctrla = 0x31512283,
38 .actim_ctrlb = 0x0001220a,
39 .rfr_ctrl = 0x00025501,
40 .mr = 0x00000022,
41 },
42 [3] = {
43 .rate = 82970588,
44 .actim_ctrla = 0x31512283,
45 .actim_ctrlb = 0x0001220a,
46 .rfr_ctrl = 0x00025501,
47 .mr = 0x00000022,
48 },
49 [4] = {
50 .rate = 0
51 },
52};
53
54#endif
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 2a30060cb4b7..2045441e8385 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -37,6 +37,10 @@ static struct omap_sdrc_params *sdrc_init_params;
37void __iomem *omap2_sdrc_base; 37void __iomem *omap2_sdrc_base;
38void __iomem *omap2_sms_base; 38void __iomem *omap2_sms_base;
39 39
40/* SDRC_POWER register bits */
41#define SDRC_POWER_EXTCLKDIS_SHIFT 3
42#define SDRC_POWER_PWDENA_SHIFT 2
43#define SDRC_POWER_PAGEPOLICY_SHIFT 0
40 44
41/** 45/**
42 * omap2_sdrc_get_params - return SDRC register values for a given clock rate 46 * omap2_sdrc_get_params - return SDRC register values for a given clock rate
@@ -56,9 +60,12 @@ struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r)
56{ 60{
57 struct omap_sdrc_params *sp; 61 struct omap_sdrc_params *sp;
58 62
63 if (!sdrc_init_params)
64 return NULL;
65
59 sp = sdrc_init_params; 66 sp = sdrc_init_params;
60 67
61 while (sp->rate != r) 68 while (sp->rate && sp->rate != r)
62 sp++; 69 sp++;
63 70
64 if (!sp->rate) 71 if (!sp->rate)
@@ -74,7 +81,14 @@ void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals)
74 omap2_sms_base = omap2_globals->sms; 81 omap2_sms_base = omap2_globals->sms;
75} 82}
76 83
77/* turn on smart idle modes for SDRAM scheduler and controller */ 84/**
85 * omap2_sdrc_init - initialize SMS, SDRC devices on boot
86 * @sp: pointer to a null-terminated list of struct omap_sdrc_params
87 *
88 * Turn on smart idle modes for SDRAM scheduler and controller.
89 * Program a known-good configuration for the SDRC to deal with buggy
90 * bootloaders.
91 */
78void __init omap2_sdrc_init(struct omap_sdrc_params *sp) 92void __init omap2_sdrc_init(struct omap_sdrc_params *sp)
79{ 93{
80 u32 l; 94 u32 l;
@@ -90,4 +104,10 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sp)
90 sdrc_write_reg(l, SDRC_SYSCONFIG); 104 sdrc_write_reg(l, SDRC_SYSCONFIG);
91 105
92 sdrc_init_params = sp; 106 sdrc_init_params = sp;
107
108 /* XXX Enable SRFRONIDLEREQ here also? */
109 l = (1 << SDRC_POWER_EXTCLKDIS_SHIFT) |
110 (1 << SDRC_POWER_PWDENA_SHIFT) |
111 (1 << SDRC_POWER_PAGEPOLICY_SHIFT);
112 sdrc_write_reg(l, SDRC_POWER);
93} 113}
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 0afdad5ae9fb..feaec7eaf6bd 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -99,7 +99,10 @@ u32 omap2xxx_sdrc_reprogram(u32 level, u32 force)
99 m_type = omap2xxx_sdrc_get_type(); 99 m_type = omap2xxx_sdrc_get_type();
100 100
101 local_irq_save(flags); 101 local_irq_save(flags);
102 __raw_writel(0xffff, OMAP24XX_PRCM_VOLTSETUP); 102 if (cpu_is_omap2420())
103 __raw_writel(0xffff, OMAP2420_PRCM_VOLTSETUP);
104 else
105 __raw_writel(0xffff, OMAP2430_PRCM_VOLTSETUP);
103 omap2_sram_reprogram_sdrc(level, dll_ctrl, m_type); 106 omap2_sram_reprogram_sdrc(level, dll_ctrl, m_type);
104 curr_perf_level = level; 107 curr_perf_level = level;
105 local_irq_restore(flags); 108 local_irq_restore(flags);
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 4dcf39c285b9..b094c15bfe47 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -6,8 +6,13 @@
6 * Copyright (C) 2005-2008 Nokia Corporation 6 * Copyright (C) 2005-2008 Nokia Corporation
7 * Author: Paul Mundt <paul.mundt@nokia.com> 7 * Author: Paul Mundt <paul.mundt@nokia.com>
8 * 8 *
9 * Major rework for PM support by Kevin Hilman
10 *
9 * Based off of arch/arm/mach-omap/omap1/serial.c 11 * Based off of arch/arm/mach-omap/omap1/serial.c
10 * 12 *
13 * Copyright (C) 2009 Texas Instruments
14 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com
15 *
11 * This file is subject to the terms and conditions of the GNU General Public 16 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive 17 * License. See the file "COPYING" in the main directory of this archive
13 * for more details. 18 * for more details.
@@ -21,9 +26,50 @@
21 26
22#include <mach/common.h> 27#include <mach/common.h>
23#include <mach/board.h> 28#include <mach/board.h>
29#include <mach/clock.h>
30#include <mach/control.h>
31
32#include "prm.h"
33#include "pm.h"
34#include "prm-regbits-34xx.h"
35
36#define UART_OMAP_WER 0x17 /* Wake-up enable register */
37
38#define DEFAULT_TIMEOUT (5 * HZ)
24 39
25static struct clk *uart_ick[OMAP_MAX_NR_PORTS]; 40struct omap_uart_state {
26static struct clk *uart_fck[OMAP_MAX_NR_PORTS]; 41 int num;
42 int can_sleep;
43 struct timer_list timer;
44 u32 timeout;
45
46 void __iomem *wk_st;
47 void __iomem *wk_en;
48 u32 wk_mask;
49 u32 padconf;
50
51 struct clk *ick;
52 struct clk *fck;
53 int clocked;
54
55 struct plat_serial8250_port *p;
56 struct list_head node;
57
58#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
59 int context_valid;
60
61 /* Registers to be saved/restored for OFF-mode */
62 u16 dll;
63 u16 dlh;
64 u16 ier;
65 u16 sysc;
66 u16 scr;
67 u16 wer;
68#endif
69};
70
71static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS];
72static LIST_HEAD(uart_list);
27 73
28static struct plat_serial8250_port serial_platform_data[] = { 74static struct plat_serial8250_port serial_platform_data[] = {
29 { 75 {
@@ -74,33 +120,369 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
74 * properly. Note that the TX watermark initialization may not be needed 120 * properly. Note that the TX watermark initialization may not be needed
75 * once the 8250.c watermark handling code is merged. 121 * once the 8250.c watermark handling code is merged.
76 */ 122 */
77static inline void __init omap_serial_reset(struct plat_serial8250_port *p) 123static inline void __init omap_uart_reset(struct omap_uart_state *uart)
78{ 124{
125 struct plat_serial8250_port *p = uart->p;
126
79 serial_write_reg(p, UART_OMAP_MDR1, 0x07); 127 serial_write_reg(p, UART_OMAP_MDR1, 0x07);
80 serial_write_reg(p, UART_OMAP_SCR, 0x08); 128 serial_write_reg(p, UART_OMAP_SCR, 0x08);
81 serial_write_reg(p, UART_OMAP_MDR1, 0x00); 129 serial_write_reg(p, UART_OMAP_MDR1, 0x00);
82 serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0)); 130 serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
83} 131}
84 132
85void omap_serial_enable_clocks(int enable) 133#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
134
135static int enable_off_mode; /* to be removed by full off-mode patches */
136
137static void omap_uart_save_context(struct omap_uart_state *uart)
86{ 138{
87 int i; 139 u16 lcr = 0;
88 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 140 struct plat_serial8250_port *p = uart->p;
89 if (uart_ick[i] && uart_fck[i]) { 141
90 if (enable) { 142 if (!enable_off_mode)
91 clk_enable(uart_ick[i]); 143 return;
92 clk_enable(uart_fck[i]); 144
93 } else { 145 lcr = serial_read_reg(p, UART_LCR);
94 clk_disable(uart_ick[i]); 146 serial_write_reg(p, UART_LCR, 0xBF);
95 clk_disable(uart_fck[i]); 147 uart->dll = serial_read_reg(p, UART_DLL);
148 uart->dlh = serial_read_reg(p, UART_DLM);
149 serial_write_reg(p, UART_LCR, lcr);
150 uart->ier = serial_read_reg(p, UART_IER);
151 uart->sysc = serial_read_reg(p, UART_OMAP_SYSC);
152 uart->scr = serial_read_reg(p, UART_OMAP_SCR);
153 uart->wer = serial_read_reg(p, UART_OMAP_WER);
154
155 uart->context_valid = 1;
156}
157
158static void omap_uart_restore_context(struct omap_uart_state *uart)
159{
160 u16 efr = 0;
161 struct plat_serial8250_port *p = uart->p;
162
163 if (!enable_off_mode)
164 return;
165
166 if (!uart->context_valid)
167 return;
168
169 uart->context_valid = 0;
170
171 serial_write_reg(p, UART_OMAP_MDR1, 0x7);
172 serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */
173 efr = serial_read_reg(p, UART_EFR);
174 serial_write_reg(p, UART_EFR, UART_EFR_ECB);
175 serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */
176 serial_write_reg(p, UART_IER, 0x0);
177 serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */
178 serial_write_reg(p, UART_DLL, uart->dll);
179 serial_write_reg(p, UART_DLM, uart->dlh);
180 serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */
181 serial_write_reg(p, UART_IER, uart->ier);
182 serial_write_reg(p, UART_FCR, 0xA1);
183 serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */
184 serial_write_reg(p, UART_EFR, efr);
185 serial_write_reg(p, UART_LCR, UART_LCR_WLEN8);
186 serial_write_reg(p, UART_OMAP_SCR, uart->scr);
187 serial_write_reg(p, UART_OMAP_WER, uart->wer);
188 serial_write_reg(p, UART_OMAP_SYSC, uart->sysc);
189 serial_write_reg(p, UART_OMAP_MDR1, 0x00); /* UART 16x mode */
190}
191#else
192static inline void omap_uart_save_context(struct omap_uart_state *uart) {}
193static inline void omap_uart_restore_context(struct omap_uart_state *uart) {}
194#endif /* CONFIG_PM && CONFIG_ARCH_OMAP3 */
195
196static inline void omap_uart_enable_clocks(struct omap_uart_state *uart)
197{
198 if (uart->clocked)
199 return;
200
201 clk_enable(uart->ick);
202 clk_enable(uart->fck);
203 uart->clocked = 1;
204 omap_uart_restore_context(uart);
205}
206
207#ifdef CONFIG_PM
208
209static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
210{
211 if (!uart->clocked)
212 return;
213
214 omap_uart_save_context(uart);
215 uart->clocked = 0;
216 clk_disable(uart->ick);
217 clk_disable(uart->fck);
218}
219
220static void omap_uart_smart_idle_enable(struct omap_uart_state *uart,
221 int enable)
222{
223 struct plat_serial8250_port *p = uart->p;
224 u16 sysc;
225
226 sysc = serial_read_reg(p, UART_OMAP_SYSC) & 0x7;
227 if (enable)
228 sysc |= 0x2 << 3;
229 else
230 sysc |= 0x1 << 3;
231
232 serial_write_reg(p, UART_OMAP_SYSC, sysc);
233}
234
235static void omap_uart_block_sleep(struct omap_uart_state *uart)
236{
237 omap_uart_enable_clocks(uart);
238
239 omap_uart_smart_idle_enable(uart, 0);
240 uart->can_sleep = 0;
241 if (uart->timeout)
242 mod_timer(&uart->timer, jiffies + uart->timeout);
243 else
244 del_timer(&uart->timer);
245}
246
247static void omap_uart_allow_sleep(struct omap_uart_state *uart)
248{
249 if (!uart->clocked)
250 return;
251
252 omap_uart_smart_idle_enable(uart, 1);
253 uart->can_sleep = 1;
254 del_timer(&uart->timer);
255}
256
257static void omap_uart_idle_timer(unsigned long data)
258{
259 struct omap_uart_state *uart = (struct omap_uart_state *)data;
260
261 omap_uart_allow_sleep(uart);
262}
263
264void omap_uart_prepare_idle(int num)
265{
266 struct omap_uart_state *uart;
267
268 list_for_each_entry(uart, &uart_list, node) {
269 if (num == uart->num && uart->can_sleep) {
270 omap_uart_disable_clocks(uart);
271 return;
272 }
273 }
274}
275
276void omap_uart_resume_idle(int num)
277{
278 struct omap_uart_state *uart;
279
280 list_for_each_entry(uart, &uart_list, node) {
281 if (num == uart->num) {
282 omap_uart_enable_clocks(uart);
283
284 /* Check for IO pad wakeup */
285 if (cpu_is_omap34xx() && uart->padconf) {
286 u16 p = omap_ctrl_readw(uart->padconf);
287
288 if (p & OMAP3_PADCONF_WAKEUPEVENT0)
289 omap_uart_block_sleep(uart);
96 } 290 }
291
292 /* Check for normal UART wakeup */
293 if (__raw_readl(uart->wk_st) & uart->wk_mask)
294 omap_uart_block_sleep(uart);
295
296 return;
97 } 297 }
98 } 298 }
99} 299}
100 300
301void omap_uart_prepare_suspend(void)
302{
303 struct omap_uart_state *uart;
304
305 list_for_each_entry(uart, &uart_list, node) {
306 omap_uart_allow_sleep(uart);
307 }
308}
309
310int omap_uart_can_sleep(void)
311{
312 struct omap_uart_state *uart;
313 int can_sleep = 1;
314
315 list_for_each_entry(uart, &uart_list, node) {
316 if (!uart->clocked)
317 continue;
318
319 if (!uart->can_sleep) {
320 can_sleep = 0;
321 continue;
322 }
323
324 /* This UART can now safely sleep. */
325 omap_uart_allow_sleep(uart);
326 }
327
328 return can_sleep;
329}
330
331/**
332 * omap_uart_interrupt()
333 *
334 * This handler is used only to detect that *any* UART interrupt has
335 * occurred. It does _nothing_ to handle the interrupt. Rather,
336 * any UART interrupt will trigger the inactivity timer so the
337 * UART will not idle or sleep for its timeout period.
338 *
339 **/
340static irqreturn_t omap_uart_interrupt(int irq, void *dev_id)
341{
342 struct omap_uart_state *uart = dev_id;
343
344 omap_uart_block_sleep(uart);
345
346 return IRQ_NONE;
347}
348
349static u32 sleep_timeout = DEFAULT_TIMEOUT;
350
351static void omap_uart_idle_init(struct omap_uart_state *uart)
352{
353 u32 v;
354 struct plat_serial8250_port *p = uart->p;
355 int ret;
356
357 uart->can_sleep = 0;
358 uart->timeout = sleep_timeout;
359 setup_timer(&uart->timer, omap_uart_idle_timer,
360 (unsigned long) uart);
361 mod_timer(&uart->timer, jiffies + uart->timeout);
362 omap_uart_smart_idle_enable(uart, 0);
363
364 if (cpu_is_omap34xx()) {
365 u32 mod = (uart->num == 2) ? OMAP3430_PER_MOD : CORE_MOD;
366 u32 wk_mask = 0;
367 u32 padconf = 0;
368
369 uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
370 uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
371 switch (uart->num) {
372 case 0:
373 wk_mask = OMAP3430_ST_UART1_MASK;
374 padconf = 0x182;
375 break;
376 case 1:
377 wk_mask = OMAP3430_ST_UART2_MASK;
378 padconf = 0x17a;
379 break;
380 case 2:
381 wk_mask = OMAP3430_ST_UART3_MASK;
382 padconf = 0x19e;
383 break;
384 }
385 uart->wk_mask = wk_mask;
386 uart->padconf = padconf;
387 } else if (cpu_is_omap24xx()) {
388 u32 wk_mask = 0;
389
390 if (cpu_is_omap2430()) {
391 uart->wk_en = OMAP2430_PRM_REGADDR(CORE_MOD, PM_WKEN1);
392 uart->wk_st = OMAP2430_PRM_REGADDR(CORE_MOD, PM_WKST1);
393 } else if (cpu_is_omap2420()) {
394 uart->wk_en = OMAP2420_PRM_REGADDR(CORE_MOD, PM_WKEN1);
395 uart->wk_st = OMAP2420_PRM_REGADDR(CORE_MOD, PM_WKST1);
396 }
397 switch (uart->num) {
398 case 0:
399 wk_mask = OMAP24XX_ST_UART1_MASK;
400 break;
401 case 1:
402 wk_mask = OMAP24XX_ST_UART2_MASK;
403 break;
404 case 2:
405 wk_mask = OMAP24XX_ST_UART3_MASK;
406 break;
407 }
408 uart->wk_mask = wk_mask;
409 } else {
410 uart->wk_en = 0;
411 uart->wk_st = 0;
412 uart->wk_mask = 0;
413 uart->padconf = 0;
414 }
415
416 /* Set wake-enable bit */
417 if (uart->wk_en && uart->wk_mask) {
418 v = __raw_readl(uart->wk_en);
419 v |= uart->wk_mask;
420 __raw_writel(v, uart->wk_en);
421 }
422
423 /* Ensure IOPAD wake-enables are set */
424 if (cpu_is_omap34xx() && uart->padconf) {
425 u16 v;
426
427 v = omap_ctrl_readw(uart->padconf);
428 v |= OMAP3_PADCONF_WAKEUPENABLE0;
429 omap_ctrl_writew(v, uart->padconf);
430 }
431
432 p->flags |= UPF_SHARE_IRQ;
433 ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED,
434 "serial idle", (void *)uart);
435 WARN_ON(ret);
436}
437
438static ssize_t sleep_timeout_show(struct kobject *kobj,
439 struct kobj_attribute *attr,
440 char *buf)
441{
442 return sprintf(buf, "%u\n", sleep_timeout / HZ);
443}
444
445static ssize_t sleep_timeout_store(struct kobject *kobj,
446 struct kobj_attribute *attr,
447 const char *buf, size_t n)
448{
449 struct omap_uart_state *uart;
450 unsigned int value;
451
452 if (sscanf(buf, "%u", &value) != 1) {
453 printk(KERN_ERR "sleep_timeout_store: Invalid value\n");
454 return -EINVAL;
455 }
456 sleep_timeout = value * HZ;
457 list_for_each_entry(uart, &uart_list, node) {
458 uart->timeout = sleep_timeout;
459 if (uart->timeout)
460 mod_timer(&uart->timer, jiffies + uart->timeout);
461 else
462 /* A zero value means disable timeout feature */
463 omap_uart_block_sleep(uart);
464 }
465 return n;
466}
467
468static struct kobj_attribute sleep_timeout_attr =
469 __ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store);
470
471#else
472static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
473#endif /* CONFIG_PM */
474
475static struct platform_device serial_device = {
476 .name = "serial8250",
477 .id = PLAT8250_DEV_PLATFORM,
478 .dev = {
479 .platform_data = serial_platform_data,
480 },
481};
482
101void __init omap_serial_init(void) 483void __init omap_serial_init(void)
102{ 484{
103 int i; 485 int i, err;
104 const struct omap_uart_config *info; 486 const struct omap_uart_config *info;
105 char name[16]; 487 char name[16];
106 488
@@ -114,9 +496,14 @@ void __init omap_serial_init(void)
114 496
115 if (info == NULL) 497 if (info == NULL)
116 return; 498 return;
499 if (cpu_is_omap44xx()) {
500 for (i = 0; i < OMAP_MAX_NR_PORTS; i++)
501 serial_platform_data[i].irq += 32;
502 }
117 503
118 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 504 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
119 struct plat_serial8250_port *p = serial_platform_data + i; 505 struct plat_serial8250_port *p = serial_platform_data + i;
506 struct omap_uart_state *uart = &omap_uart[i];
120 507
121 if (!(info->enabled_uarts & (1 << i))) { 508 if (!(info->enabled_uarts & (1 << i))) {
122 p->membase = NULL; 509 p->membase = NULL;
@@ -125,35 +512,39 @@ void __init omap_serial_init(void)
125 } 512 }
126 513
127 sprintf(name, "uart%d_ick", i+1); 514 sprintf(name, "uart%d_ick", i+1);
128 uart_ick[i] = clk_get(NULL, name); 515 uart->ick = clk_get(NULL, name);
129 if (IS_ERR(uart_ick[i])) { 516 if (IS_ERR(uart->ick)) {
130 printk(KERN_ERR "Could not get uart%d_ick\n", i+1); 517 printk(KERN_ERR "Could not get uart%d_ick\n", i+1);
131 uart_ick[i] = NULL; 518 uart->ick = NULL;
132 } else 519 }
133 clk_enable(uart_ick[i]);
134 520
135 sprintf(name, "uart%d_fck", i+1); 521 sprintf(name, "uart%d_fck", i+1);
136 uart_fck[i] = clk_get(NULL, name); 522 uart->fck = clk_get(NULL, name);
137 if (IS_ERR(uart_fck[i])) { 523 if (IS_ERR(uart->fck)) {
138 printk(KERN_ERR "Could not get uart%d_fck\n", i+1); 524 printk(KERN_ERR "Could not get uart%d_fck\n", i+1);
139 uart_fck[i] = NULL; 525 uart->fck = NULL;
140 } else 526 }
141 clk_enable(uart_fck[i]);
142 527
143 omap_serial_reset(p); 528 if (!uart->ick || !uart->fck)
529 continue;
530
531 uart->num = i;
532 p->private_data = uart;
533 uart->p = p;
534 list_add(&uart->node, &uart_list);
535
536 omap_uart_enable_clocks(uart);
537 omap_uart_reset(uart);
538 omap_uart_idle_init(uart);
144 } 539 }
145}
146 540
147static struct platform_device serial_device = { 541 err = platform_device_register(&serial_device);
148 .name = "serial8250", 542
149 .id = PLAT8250_DEV_PLATFORM, 543#ifdef CONFIG_PM
150 .dev = { 544 if (!err)
151 .platform_data = serial_platform_data, 545 err = sysfs_create_file(&serial_device.dev.kobj,
152 }, 546 &sleep_timeout_attr.attr);
153}; 547#endif
154 548
155static int __init omap_init(void)
156{
157 return platform_device_register(&serial_device);
158} 549}
159arch_initcall(omap_init); 550
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
index bf9e96105e11..130aadbfa083 100644
--- a/arch/arm/mach-omap2/sleep24xx.S
+++ b/arch/arm/mach-omap2/sleep24xx.S
@@ -28,7 +28,6 @@
28#include <linux/linkage.h> 28#include <linux/linkage.h>
29#include <asm/assembler.h> 29#include <asm/assembler.h>
30#include <mach/io.h> 30#include <mach/io.h>
31#include <mach/pm.h>
32 31
33#include <mach/omap24xx.h> 32#include <mach/omap24xx.h>
34 33
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
new file mode 100644
index 000000000000..e5e2553e79a6
--- /dev/null
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -0,0 +1,436 @@
1/*
2 * linux/arch/arm/mach-omap2/sleep.S
3 *
4 * (C) Copyright 2007
5 * Texas Instruments
6 * Karthik Dasu <karthik-dp@ti.com>
7 *
8 * (C) Copyright 2004
9 * Texas Instruments, <www.ti.com>
10 * Richard Woodruff <r-woodruff2@ti.com>
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 as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * MA 02111-1307 USA
26 */
27#include <linux/linkage.h>
28#include <asm/assembler.h>
29#include <mach/io.h>
30#include <mach/control.h>
31
32#include "prm.h"
33#include "sdrc.h"
34
35#define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \
36 OMAP3430_PM_PREPWSTST)
37#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \
38 OMAP3430_PM_PREPWSTST)
39#define PM_PWSTCTRL_MPU_P OMAP34XX_PRM_REGADDR(MPU_MOD, PM_PWSTCTRL)
40#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is
41 * available */
42#define SCRATCHPAD_BASE_P OMAP343X_CTRL_REGADDR(\
43 OMAP343X_CONTROL_MEM_WKUP +\
44 SCRATCHPAD_MEM_OFFS)
45#define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER)
46
47 .text
48/* Function call to get the restore pointer for resume from OFF */
49ENTRY(get_restore_pointer)
50 stmfd sp!, {lr} @ save registers on stack
51 adr r0, restore
52 ldmfd sp!, {pc} @ restore regs and return
53ENTRY(get_restore_pointer_sz)
54 .word . - get_restore_pointer_sz
55/*
56 * Forces OMAP into idle state
57 *
58 * omap34xx_suspend() - This bit of code just executes the WFI
59 * for normal idles.
60 *
61 * Note: This code get's copied to internal SRAM at boot. When the OMAP
62 * wakes up it continues execution at the point it went to sleep.
63 */
64ENTRY(omap34xx_cpu_suspend)
65 stmfd sp!, {r0-r12, lr} @ save registers on stack
66loop:
67 /*b loop*/ @Enable to debug by stepping through code
68 /* r0 contains restore pointer in sdram */
69 /* r1 contains information about saving context */
70 ldr r4, sdrc_power @ read the SDRC_POWER register
71 ldr r5, [r4] @ read the contents of SDRC_POWER
72 orr r5, r5, #0x40 @ enable self refresh on idle req
73 str r5, [r4] @ write back to SDRC_POWER register
74
75 cmp r1, #0x0
76 /* If context save is required, do that and execute wfi */
77 bne save_context_wfi
78 /* Data memory barrier and Data sync barrier */
79 mov r1, #0
80 mcr p15, 0, r1, c7, c10, 4
81 mcr p15, 0, r1, c7, c10, 5
82
83 wfi @ wait for interrupt
84
85 nop
86 nop
87 nop
88 nop
89 nop
90 nop
91 nop
92 nop
93 nop
94 nop
95 bl i_dll_wait
96
97 ldmfd sp!, {r0-r12, pc} @ restore regs and return
98restore:
99 /* b restore*/ @ Enable to debug restore code
100 /* Check what was the reason for mpu reset and store the reason in r9*/
101 /* 1 - Only L1 and logic lost */
102 /* 2 - Only L2 lost - In this case, we wont be here */
103 /* 3 - Both L1 and L2 lost */
104 ldr r1, pm_pwstctrl_mpu
105 ldr r2, [r1]
106 and r2, r2, #0x3
107 cmp r2, #0x0 @ Check if target power state was OFF or RET
108 moveq r9, #0x3 @ MPU OFF => L1 and L2 lost
109 movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation
110 bne logic_l1_restore
111 /* Execute smi to invalidate L2 cache */
112 mov r12, #0x1 @ set up to invalide L2
113smi: .word 0xE1600070 @ Call SMI monitor (smieq)
114logic_l1_restore:
115 mov r1, #0
116 /* Invalidate all instruction caches to PoU
117 * and flush branch target cache */
118 mcr p15, 0, r1, c7, c5, 0
119
120 ldr r4, scratchpad_base
121 ldr r3, [r4,#0xBC]
122 ldmia r3!, {r4-r6}
123 mov sp, r4
124 msr spsr_cxsf, r5
125 mov lr, r6
126
127 ldmia r3!, {r4-r9}
128 /* Coprocessor access Control Register */
129 mcr p15, 0, r4, c1, c0, 2
130
131 /* TTBR0 */
132 MCR p15, 0, r5, c2, c0, 0
133 /* TTBR1 */
134 MCR p15, 0, r6, c2, c0, 1
135 /* Translation table base control register */
136 MCR p15, 0, r7, c2, c0, 2
137 /*domain access Control Register */
138 MCR p15, 0, r8, c3, c0, 0
139 /* data fault status Register */
140 MCR p15, 0, r9, c5, c0, 0
141
142 ldmia r3!,{r4-r8}
143 /* instruction fault status Register */
144 MCR p15, 0, r4, c5, c0, 1
145 /*Data Auxiliary Fault Status Register */
146 MCR p15, 0, r5, c5, c1, 0
147 /*Instruction Auxiliary Fault Status Register*/
148 MCR p15, 0, r6, c5, c1, 1
149 /*Data Fault Address Register */
150 MCR p15, 0, r7, c6, c0, 0
151 /*Instruction Fault Address Register*/
152 MCR p15, 0, r8, c6, c0, 2
153 ldmia r3!,{r4-r7}
154
155 /* user r/w thread and process ID */
156 MCR p15, 0, r4, c13, c0, 2
157 /* user ro thread and process ID */
158 MCR p15, 0, r5, c13, c0, 3
159 /*Privileged only thread and process ID */
160 MCR p15, 0, r6, c13, c0, 4
161 /* cache size selection */
162 MCR p15, 2, r7, c0, c0, 0
163 ldmia r3!,{r4-r8}
164 /* Data TLB lockdown registers */
165 MCR p15, 0, r4, c10, c0, 0
166 /* Instruction TLB lockdown registers */
167 MCR p15, 0, r5, c10, c0, 1
168 /* Secure or Nonsecure Vector Base Address */
169 MCR p15, 0, r6, c12, c0, 0
170 /* FCSE PID */
171 MCR p15, 0, r7, c13, c0, 0
172 /* Context PID */
173 MCR p15, 0, r8, c13, c0, 1
174
175 ldmia r3!,{r4-r5}
176 /* primary memory remap register */
177 MCR p15, 0, r4, c10, c2, 0
178 /*normal memory remap register */
179 MCR p15, 0, r5, c10, c2, 1
180
181 /* Restore cpsr */
182 ldmia r3!,{r4} /*load CPSR from SDRAM*/
183 msr cpsr, r4 /*store cpsr */
184
185 /* Enabling MMU here */
186 mrc p15, 0, r7, c2, c0, 2 /* Read TTBRControl */
187 /* Extract N (0:2) bits and decide whether to use TTBR0 or TTBR1*/
188 and r7, #0x7
189 cmp r7, #0x0
190 beq usettbr0
191ttbr_error:
192 /* More work needs to be done to support N[0:2] value other than 0
193 * So looping here so that the error can be detected
194 */
195 b ttbr_error
196usettbr0:
197 mrc p15, 0, r2, c2, c0, 0
198 ldr r5, ttbrbit_mask
199 and r2, r5
200 mov r4, pc
201 ldr r5, table_index_mask
202 and r4, r5 /* r4 = 31 to 20 bits of pc */
203 /* Extract the value to be written to table entry */
204 ldr r1, table_entry
205 add r1, r1, r4 /* r1 has value to be written to table entry*/
206 /* Getting the address of table entry to modify */
207 lsr r4, #18
208 add r2, r4 /* r2 has the location which needs to be modified */
209 /* Storing previous entry of location being modified */
210 ldr r5, scratchpad_base
211 ldr r4, [r2]
212 str r4, [r5, #0xC0]
213 /* Modify the table entry */
214 str r1, [r2]
215 /* Storing address of entry being modified
216 * - will be restored after enabling MMU */
217 ldr r5, scratchpad_base
218 str r2, [r5, #0xC4]
219
220 mov r0, #0
221 mcr p15, 0, r0, c7, c5, 4 @ Flush prefetch buffer
222 mcr p15, 0, r0, c7, c5, 6 @ Invalidate branch predictor array
223 mcr p15, 0, r0, c8, c5, 0 @ Invalidate instruction TLB
224 mcr p15, 0, r0, c8, c6, 0 @ Invalidate data TLB
225 /* Restore control register but dont enable caches here*/
226 /* Caches will be enabled after restoring MMU table entry */
227 ldmia r3!, {r4}
228 /* Store previous value of control register in scratchpad */
229 str r4, [r5, #0xC8]
230 ldr r2, cache_pred_disable_mask
231 and r4, r2
232 mcr p15, 0, r4, c1, c0, 0
233
234 ldmfd sp!, {r0-r12, pc} @ restore regs and return
235save_context_wfi:
236 /*b save_context_wfi*/ @ enable to debug save code
237 mov r8, r0 /* Store SDRAM address in r8 */
238 /* Check what that target sleep state is:stored in r1*/
239 /* 1 - Only L1 and logic lost */
240 /* 2 - Only L2 lost */
241 /* 3 - Both L1 and L2 lost */
242 cmp r1, #0x2 /* Only L2 lost */
243 beq clean_l2
244 cmp r1, #0x1 /* L2 retained */
245 /* r9 stores whether to clean L2 or not*/
246 moveq r9, #0x0 /* Dont Clean L2 */
247 movne r9, #0x1 /* Clean L2 */
248l1_logic_lost:
249 /* Store sp and spsr to SDRAM */
250 mov r4, sp
251 mrs r5, spsr
252 mov r6, lr
253 stmia r8!, {r4-r6}
254 /* Save all ARM registers */
255 /* Coprocessor access control register */
256 mrc p15, 0, r6, c1, c0, 2
257 stmia r8!, {r6}
258 /* TTBR0, TTBR1 and Translation table base control */
259 mrc p15, 0, r4, c2, c0, 0
260 mrc p15, 0, r5, c2, c0, 1
261 mrc p15, 0, r6, c2, c0, 2
262 stmia r8!, {r4-r6}
263 /* Domain access control register, data fault status register,
264 and instruction fault status register */
265 mrc p15, 0, r4, c3, c0, 0
266 mrc p15, 0, r5, c5, c0, 0
267 mrc p15, 0, r6, c5, c0, 1
268 stmia r8!, {r4-r6}
269 /* Data aux fault status register, instruction aux fault status,
270 datat fault address register and instruction fault address register*/
271 mrc p15, 0, r4, c5, c1, 0
272 mrc p15, 0, r5, c5, c1, 1
273 mrc p15, 0, r6, c6, c0, 0
274 mrc p15, 0, r7, c6, c0, 2
275 stmia r8!, {r4-r7}
276 /* user r/w thread and process ID, user r/o thread and process ID,
277 priv only thread and process ID, cache size selection */
278 mrc p15, 0, r4, c13, c0, 2
279 mrc p15, 0, r5, c13, c0, 3
280 mrc p15, 0, r6, c13, c0, 4
281 mrc p15, 2, r7, c0, c0, 0
282 stmia r8!, {r4-r7}
283 /* Data TLB lockdown, instruction TLB lockdown registers */
284 mrc p15, 0, r5, c10, c0, 0
285 mrc p15, 0, r6, c10, c0, 1
286 stmia r8!, {r5-r6}
287 /* Secure or non secure vector base address, FCSE PID, Context PID*/
288 mrc p15, 0, r4, c12, c0, 0
289 mrc p15, 0, r5, c13, c0, 0
290 mrc p15, 0, r6, c13, c0, 1
291 stmia r8!, {r4-r6}
292 /* Primary remap, normal remap registers */
293 mrc p15, 0, r4, c10, c2, 0
294 mrc p15, 0, r5, c10, c2, 1
295 stmia r8!,{r4-r5}
296
297 /* Store current cpsr*/
298 mrs r2, cpsr
299 stmia r8!, {r2}
300
301 mrc p15, 0, r4, c1, c0, 0
302 /* save control register */
303 stmia r8!, {r4}
304clean_caches:
305 /* Clean Data or unified cache to POU*/
306 /* How to invalidate only L1 cache???? - #FIX_ME# */
307 /* mcr p15, 0, r11, c7, c11, 1 */
308 cmp r9, #1 /* Check whether L2 inval is required or not*/
309 bne skip_l2_inval
310clean_l2:
311 /* read clidr */
312 mrc p15, 1, r0, c0, c0, 1
313 /* extract loc from clidr */
314 ands r3, r0, #0x7000000
315 /* left align loc bit field */
316 mov r3, r3, lsr #23
317 /* if loc is 0, then no need to clean */
318 beq finished
319 /* start clean at cache level 0 */
320 mov r10, #0
321loop1:
322 /* work out 3x current cache level */
323 add r2, r10, r10, lsr #1
324 /* extract cache type bits from clidr*/
325 mov r1, r0, lsr r2
326 /* mask of the bits for current cache only */
327 and r1, r1, #7
328 /* see what cache we have at this level */
329 cmp r1, #2
330 /* skip if no cache, or just i-cache */
331 blt skip
332 /* select current cache level in cssr */
333 mcr p15, 2, r10, c0, c0, 0
334 /* isb to sych the new cssr&csidr */
335 isb
336 /* read the new csidr */
337 mrc p15, 1, r1, c0, c0, 0
338 /* extract the length of the cache lines */
339 and r2, r1, #7
340 /* add 4 (line length offset) */
341 add r2, r2, #4
342 ldr r4, assoc_mask
343 /* find maximum number on the way size */
344 ands r4, r4, r1, lsr #3
345 /* find bit position of way size increment */
346 clz r5, r4
347 ldr r7, numset_mask
348 /* extract max number of the index size*/
349 ands r7, r7, r1, lsr #13
350loop2:
351 mov r9, r4
352 /* create working copy of max way size*/
353loop3:
354 /* factor way and cache number into r11 */
355 orr r11, r10, r9, lsl r5
356 /* factor index number into r11 */
357 orr r11, r11, r7, lsl r2
358 /*clean & invalidate by set/way */
359 mcr p15, 0, r11, c7, c10, 2
360 /* decrement the way*/
361 subs r9, r9, #1
362 bge loop3
363 /*decrement the index */
364 subs r7, r7, #1
365 bge loop2
366skip:
367 add r10, r10, #2
368 /* increment cache number */
369 cmp r3, r10
370 bgt loop1
371finished:
372 /*swith back to cache level 0 */
373 mov r10, #0
374 /* select current cache level in cssr */
375 mcr p15, 2, r10, c0, c0, 0
376 isb
377skip_l2_inval:
378 /* Data memory barrier and Data sync barrier */
379 mov r1, #0
380 mcr p15, 0, r1, c7, c10, 4
381 mcr p15, 0, r1, c7, c10, 5
382
383 wfi @ wait for interrupt
384 nop
385 nop
386 nop
387 nop
388 nop
389 nop
390 nop
391 nop
392 nop
393 nop
394 bl i_dll_wait
395 /* restore regs and return */
396 ldmfd sp!, {r0-r12, pc}
397
398i_dll_wait:
399 ldr r4, clk_stabilize_delay
400
401i_dll_delay:
402 subs r4, r4, #0x1
403 bne i_dll_delay
404 ldr r4, sdrc_power
405 ldr r5, [r4]
406 bic r5, r5, #0x40
407 str r5, [r4]
408 bx lr
409pm_prepwstst_core:
410 .word PM_PREPWSTST_CORE_V
411pm_prepwstst_mpu:
412 .word PM_PREPWSTST_MPU_V
413pm_pwstctrl_mpu:
414 .word PM_PWSTCTRL_MPU_P
415scratchpad_base:
416 .word SCRATCHPAD_BASE_P
417sdrc_power:
418 .word SDRC_POWER_V
419context_mem:
420 .word 0x803E3E14
421clk_stabilize_delay:
422 .word 0x000001FF
423assoc_mask:
424 .word 0x3ff
425numset_mask:
426 .word 0x7fff
427ttbrbit_mask:
428 .word 0xFFFFC000
429table_index_mask:
430 .word 0xFFF00000
431table_entry:
432 .word 0x00000C02
433cache_pred_disable_mask:
434 .word 0xFFFFE7FB
435ENTRY(omap34xx_cpu_suspend_sz)
436 .word . - omap34xx_cpu_suspend
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index af4bd3490227..bb299851116d 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -124,11 +124,11 @@ omap242x_sdi_cm_clksel2_pll:
124omap242x_sdi_sdrc_dlla_ctrl: 124omap242x_sdi_sdrc_dlla_ctrl:
125 .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL) 125 .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL)
126omap242x_sdi_prcm_voltctrl: 126omap242x_sdi_prcm_voltctrl:
127 .word OMAP242X_PRCM_VOLTCTRL 127 .word OMAP2420_PRCM_VOLTCTRL
128prcm_mask_val: 128prcm_mask_val:
129 .word 0xFFFF3FFC 129 .word 0xFFFF3FFC
130omap242x_sdi_timer_32ksynct_cr: 130omap242x_sdi_timer_32ksynct_cr:
131 .word IO_ADDRESS(OMAP2_32KSYNCT_BASE + 0x010) 131 .word IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010)
132ENTRY(omap242x_sram_ddr_init_sz) 132ENTRY(omap242x_sram_ddr_init_sz)
133 .word . - omap242x_sram_ddr_init 133 .word . - omap242x_sram_ddr_init
134 134
@@ -220,11 +220,11 @@ omap242x_srs_sdrc_dlla_ctrl:
220omap242x_srs_sdrc_rfr_ctrl: 220omap242x_srs_sdrc_rfr_ctrl:
221 .word OMAP242X_SDRC_REGADDR(SDRC_RFR_CTRL_0) 221 .word OMAP242X_SDRC_REGADDR(SDRC_RFR_CTRL_0)
222omap242x_srs_prcm_voltctrl: 222omap242x_srs_prcm_voltctrl:
223 .word OMAP242X_PRCM_VOLTCTRL 223 .word OMAP2420_PRCM_VOLTCTRL
224ddr_prcm_mask_val: 224ddr_prcm_mask_val:
225 .word 0xFFFF3FFC 225 .word 0xFFFF3FFC
226omap242x_srs_timer_32ksynct: 226omap242x_srs_timer_32ksynct:
227 .word IO_ADDRESS(OMAP2_32KSYNCT_BASE + 0x010) 227 .word IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010)
228 228
229ENTRY(omap242x_sram_reprogram_sdrc_sz) 229ENTRY(omap242x_sram_reprogram_sdrc_sz)
230 .word . - omap242x_sram_reprogram_sdrc 230 .word . - omap242x_sram_reprogram_sdrc
@@ -305,7 +305,7 @@ wait_dll_lock:
305 ldmfd sp!, {r0-r12, pc} @ restore regs and return 305 ldmfd sp!, {r0-r12, pc} @ restore regs and return
306 306
307omap242x_ssp_set_config: 307omap242x_ssp_set_config:
308 .word OMAP242X_PRCM_CLKCFG_CTRL 308 .word OMAP2420_PRCM_CLKCFG_CTRL
309omap242x_ssp_pll_ctl: 309omap242x_ssp_pll_ctl:
310 .word OMAP2420_CM_REGADDR(PLL_MOD, CM_CLKEN) 310 .word OMAP2420_CM_REGADDR(PLL_MOD, CM_CLKEN)
311omap242x_ssp_pll_stat: 311omap242x_ssp_pll_stat:
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index 84363e269e8c..9955abcaeb31 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -124,11 +124,11 @@ omap243x_sdi_cm_clksel2_pll:
124omap243x_sdi_sdrc_dlla_ctrl: 124omap243x_sdi_sdrc_dlla_ctrl:
125 .word OMAP243X_SDRC_REGADDR(SDRC_DLLA_CTRL) 125 .word OMAP243X_SDRC_REGADDR(SDRC_DLLA_CTRL)
126omap243x_sdi_prcm_voltctrl: 126omap243x_sdi_prcm_voltctrl:
127 .word OMAP243X_PRCM_VOLTCTRL 127 .word OMAP2430_PRCM_VOLTCTRL
128prcm_mask_val: 128prcm_mask_val:
129 .word 0xFFFF3FFC 129 .word 0xFFFF3FFC
130omap243x_sdi_timer_32ksynct_cr: 130omap243x_sdi_timer_32ksynct_cr:
131 .word IO_ADDRESS(OMAP2_32KSYNCT_BASE + 0x010) 131 .word IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x010)
132ENTRY(omap243x_sram_ddr_init_sz) 132ENTRY(omap243x_sram_ddr_init_sz)
133 .word . - omap243x_sram_ddr_init 133 .word . - omap243x_sram_ddr_init
134 134
@@ -220,11 +220,11 @@ omap243x_srs_sdrc_dlla_ctrl:
220omap243x_srs_sdrc_rfr_ctrl: 220omap243x_srs_sdrc_rfr_ctrl:
221 .word OMAP243X_SDRC_REGADDR(SDRC_RFR_CTRL_0) 221 .word OMAP243X_SDRC_REGADDR(SDRC_RFR_CTRL_0)
222omap243x_srs_prcm_voltctrl: 222omap243x_srs_prcm_voltctrl:
223 .word OMAP243X_PRCM_VOLTCTRL 223 .word OMAP2430_PRCM_VOLTCTRL
224ddr_prcm_mask_val: 224ddr_prcm_mask_val:
225 .word 0xFFFF3FFC 225 .word 0xFFFF3FFC
226omap243x_srs_timer_32ksynct: 226omap243x_srs_timer_32ksynct:
227 .word IO_ADDRESS(OMAP2_32KSYNCT_BASE + 0x010) 227 .word IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x010)
228 228
229ENTRY(omap243x_sram_reprogram_sdrc_sz) 229ENTRY(omap243x_sram_reprogram_sdrc_sz)
230 .word . - omap243x_sram_reprogram_sdrc 230 .word . - omap243x_sram_reprogram_sdrc
@@ -305,7 +305,7 @@ wait_dll_lock:
305 ldmfd sp!, {r0-r12, pc} @ restore regs and return 305 ldmfd sp!, {r0-r12, pc} @ restore regs and return
306 306
307omap243x_ssp_set_config: 307omap243x_ssp_set_config:
308 .word OMAP243X_PRCM_CLKCFG_CTRL 308 .word OMAP2430_PRCM_CLKCFG_CTRL
309omap243x_ssp_pll_ctl: 309omap243x_ssp_pll_ctl:
310 .word OMAP2430_CM_REGADDR(PLL_MOD, CM_CLKEN) 310 .word OMAP2430_CM_REGADDR(PLL_MOD, CM_CLKEN)
311omap243x_ssp_pll_stat: 311omap243x_ssp_pll_stat:
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 2c7146136342..c080c82521e1 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -40,69 +40,74 @@
40/* 40/*
41 * Change frequency of core dpll 41 * Change frequency of core dpll
42 * r0 = sdrc_rfr_ctrl r1 = sdrc_actim_ctrla r2 = sdrc_actim_ctrlb r3 = M2 42 * r0 = sdrc_rfr_ctrl r1 = sdrc_actim_ctrla r2 = sdrc_actim_ctrlb r3 = M2
43 * r4 = Unlock SDRC DLL? (1 = yes, 0 = no) -- only unlock DLL for
44 * SDRC rates < 83MHz
43 */ 45 */
44ENTRY(omap3_sram_configure_core_dpll) 46ENTRY(omap3_sram_configure_core_dpll)
45 stmfd sp!, {r1-r12, lr} @ store regs to stack 47 stmfd sp!, {r1-r12, lr} @ store regs to stack
48 ldr r4, [sp, #52] @ pull extra args off the stack
49 dsb @ flush buffered writes to interconnect
46 cmp r3, #0x2 50 cmp r3, #0x2
47 blne configure_sdrc 51 blne configure_sdrc
48 cmp r3, #0x2 52 cmp r4, #0x1
53 bleq unlock_dll
49 blne lock_dll 54 blne lock_dll
50 cmp r3, #0x1
51 blne unlock_dll
52 bl sdram_in_selfrefresh @ put the SDRAM in self refresh 55 bl sdram_in_selfrefresh @ put the SDRAM in self refresh
53 bl configure_core_dpll 56 bl configure_core_dpll
54 bl enable_sdrc 57 bl enable_sdrc
55 cmp r3, #0x1 58 cmp r4, #0x1
56 blne wait_dll_unlock 59 bleq wait_dll_unlock
57 cmp r3, #0x2
58 blne wait_dll_lock 60 blne wait_dll_lock
59 cmp r3, #0x1 61 cmp r3, #0x1
60 blne configure_sdrc 62 blne configure_sdrc
63 isb @ prevent speculative exec past here
61 mov r0, #0 @ return value 64 mov r0, #0 @ return value
62 ldmfd sp!, {r1-r12, pc} @ restore regs and return 65 ldmfd sp!, {r1-r12, pc} @ restore regs and return
63unlock_dll: 66unlock_dll:
64 ldr r4, omap3_sdrc_dlla_ctrl 67 ldr r11, omap3_sdrc_dlla_ctrl
65 ldr r5, [r4] 68 ldr r12, [r11]
66 orr r5, r5, #0x4 69 orr r12, r12, #0x4
67 str r5, [r4] 70 str r12, [r11] @ (no OCP barrier needed)
68 bx lr 71 bx lr
69lock_dll: 72lock_dll:
70 ldr r4, omap3_sdrc_dlla_ctrl 73 ldr r11, omap3_sdrc_dlla_ctrl
71 ldr r5, [r4] 74 ldr r12, [r11]
72 bic r5, r5, #0x4 75 bic r12, r12, #0x4
73 str r5, [r4] 76 str r12, [r11] @ (no OCP barrier needed)
74 bx lr 77 bx lr
75sdram_in_selfrefresh: 78sdram_in_selfrefresh:
76 mov r5, #0x0 @ Move 0 to R5 79 ldr r11, omap3_sdrc_power @ read the SDRC_POWER register
77 mcr p15, 0, r5, c7, c10, 5 @ memory barrier 80 ldr r12, [r11] @ read the contents of SDRC_POWER
78 ldr r4, omap3_sdrc_power @ read the SDRC_POWER register 81 mov r9, r12 @ keep a copy of SDRC_POWER bits
79 ldr r5, [r4] @ read the contents of SDRC_POWER 82 orr r12, r12, #0x40 @ enable self refresh on idle req
80 orr r5, r5, #0x40 @ enable self refresh on idle req 83 bic r12, r12, #0x4 @ clear PWDENA
81 str r5, [r4] @ write back to SDRC_POWER register 84 str r12, [r11] @ write back to SDRC_POWER register
82 ldr r4, omap3_cm_iclken1_core @ read the CM_ICLKEN1_CORE reg 85 ldr r12, [r11] @ posted-write barrier for SDRC
83 ldr r5, [r4] 86 ldr r11, omap3_cm_iclken1_core @ read the CM_ICLKEN1_CORE reg
84 bic r5, r5, #0x2 @ disable iclk bit for SRDC 87 ldr r12, [r11]
85 str r5, [r4] 88 bic r12, r12, #0x2 @ disable iclk bit for SDRC
89 str r12, [r11]
86wait_sdrc_idle: 90wait_sdrc_idle:
87 ldr r4, omap3_cm_idlest1_core 91 ldr r11, omap3_cm_idlest1_core
88 ldr r5, [r4] 92 ldr r12, [r11]
89 and r5, r5, #0x2 @ check for SDRC idle 93 and r12, r12, #0x2 @ check for SDRC idle
90 cmp r5, #2 94 cmp r12, #2
91 bne wait_sdrc_idle 95 bne wait_sdrc_idle
92 bx lr 96 bx lr
93configure_core_dpll: 97configure_core_dpll:
94 ldr r4, omap3_cm_clksel1_pll 98 ldr r11, omap3_cm_clksel1_pll
95 ldr r5, [r4] 99 ldr r12, [r11]
96 ldr r6, core_m2_mask_val @ modify m2 for core dpll 100 ldr r10, core_m2_mask_val @ modify m2 for core dpll
97 and r5, r5, r6 101 and r12, r12, r10
98 orr r5, r5, r3, lsl #0x1B @ r3 contains the M2 val 102 orr r12, r12, r3, lsl #0x1B @ r3 contains the M2 val
99 str r5, [r4] 103 str r12, [r11]
100 mov r5, #0x800 @ wait for the clock to stabilise 104 ldr r12, [r11] @ posted-write barrier for CM
105 mov r12, #0x800 @ wait for the clock to stabilise
101 cmp r3, #2 106 cmp r3, #2
102 bne wait_clk_stable 107 bne wait_clk_stable
103 bx lr 108 bx lr
104wait_clk_stable: 109wait_clk_stable:
105 subs r5, r5, #1 110 subs r12, r12, #1
106 bne wait_clk_stable 111 bne wait_clk_stable
107 nop 112 nop
108 nop 113 nop
@@ -116,42 +121,42 @@ wait_clk_stable:
116 nop 121 nop
117 bx lr 122 bx lr
118enable_sdrc: 123enable_sdrc:
119 ldr r4, omap3_cm_iclken1_core 124 ldr r11, omap3_cm_iclken1_core
120 ldr r5, [r4] 125 ldr r12, [r11]
121 orr r5, r5, #0x2 @ enable iclk bit for SDRC 126 orr r12, r12, #0x2 @ enable iclk bit for SDRC
122 str r5, [r4] 127 str r12, [r11]
123wait_sdrc_idle1: 128wait_sdrc_idle1:
124 ldr r4, omap3_cm_idlest1_core 129 ldr r11, omap3_cm_idlest1_core
125 ldr r5, [r4] 130 ldr r12, [r11]
126 and r5, r5, #0x2 131 and r12, r12, #0x2
127 cmp r5, #0 132 cmp r12, #0
128 bne wait_sdrc_idle1 133 bne wait_sdrc_idle1
129 ldr r4, omap3_sdrc_power 134restore_sdrc_power_val:
130 ldr r5, [r4] 135 ldr r11, omap3_sdrc_power
131 bic r5, r5, #0x40 136 str r9, [r11] @ restore SDRC_POWER, no barrier needed
132 str r5, [r4]
133 bx lr 137 bx lr
134wait_dll_lock: 138wait_dll_lock:
135 ldr r4, omap3_sdrc_dlla_status 139 ldr r11, omap3_sdrc_dlla_status
136 ldr r5, [r4] 140 ldr r12, [r11]
137 and r5, r5, #0x4 141 and r12, r12, #0x4
138 cmp r5, #0x4 142 cmp r12, #0x4
139 bne wait_dll_lock 143 bne wait_dll_lock
140 bx lr 144 bx lr
141wait_dll_unlock: 145wait_dll_unlock:
142 ldr r4, omap3_sdrc_dlla_status 146 ldr r11, omap3_sdrc_dlla_status
143 ldr r5, [r4] 147 ldr r12, [r11]
144 and r5, r5, #0x4 148 and r12, r12, #0x4
145 cmp r5, #0x0 149 cmp r12, #0x0
146 bne wait_dll_unlock 150 bne wait_dll_unlock
147 bx lr 151 bx lr
148configure_sdrc: 152configure_sdrc:
149 ldr r4, omap3_sdrc_rfr_ctrl 153 ldr r11, omap3_sdrc_rfr_ctrl
150 str r0, [r4] 154 str r0, [r11]
151 ldr r4, omap3_sdrc_actim_ctrla 155 ldr r11, omap3_sdrc_actim_ctrla
152 str r1, [r4] 156 str r1, [r11]
153 ldr r4, omap3_sdrc_actim_ctrlb 157 ldr r11, omap3_sdrc_actim_ctrlb
154 str r2, [r4] 158 str r2, [r11]
159 ldr r2, [r11] @ posted-write barrier for SDRC
155 bx lr 160 bx lr
156 161
157omap3_sdrc_power: 162omap3_sdrc_power:
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index f36aba12090e..97eeeebcb066 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -17,9 +17,10 @@
17 * 17 *
18 * Some parts based off of TI's 24xx code: 18 * Some parts based off of TI's 24xx code:
19 * 19 *
20 * Copyright (C) 2004 Texas Instruments, Inc. 20 * Copyright (C) 2004-2009 Texas Instruments, Inc.
21 * 21 *
22 * Roughly modelled after the OMAP1 MPU timer code. 22 * Roughly modelled after the OMAP1 MPU timer code.
23 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
23 * 24 *
24 * This file is subject to the terms and conditions of the GNU General Public 25 * This file is subject to the terms and conditions of the GNU General Public
25 * License. See the file "COPYING" in the main directory of this archive 26 * License. See the file "COPYING" in the main directory of this archive
@@ -37,6 +38,7 @@
37 38
38#include <asm/mach/time.h> 39#include <asm/mach/time.h>
39#include <mach/dmtimer.h> 40#include <mach/dmtimer.h>
41#include <asm/localtimer.h>
40 42
41/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 43/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
42#define MAX_GPTIMER_ID 12 44#define MAX_GPTIMER_ID 12
@@ -82,7 +84,8 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
82 case CLOCK_EVT_MODE_PERIODIC: 84 case CLOCK_EVT_MODE_PERIODIC:
83 period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ; 85 period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
84 period -= 1; 86 period -= 1;
85 87 if (cpu_is_omap44xx())
88 period = 0xff; /* FIXME: */
86 omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period); 89 omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period);
87 break; 90 break;
88 case CLOCK_EVT_MODE_ONESHOT: 91 case CLOCK_EVT_MODE_ONESHOT:
@@ -145,6 +148,9 @@ static void __init omap2_gp_clockevent_init(void)
145 "timer-gp: omap_dm_timer_set_source() failed\n"); 148 "timer-gp: omap_dm_timer_set_source() failed\n");
146 149
147 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); 150 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer));
151 if (cpu_is_omap44xx())
152 /* Assuming 32kHz clk is driving GPT1 */
153 tick_rate = 32768; /* FIXME: */
148 154
149 pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n", 155 pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n",
150 gptimer_id, tick_rate); 156 gptimer_id, tick_rate);
@@ -224,6 +230,9 @@ static void __init omap2_gp_clocksource_init(void)
224 230
225static void __init omap2_gp_timer_init(void) 231static void __init omap2_gp_timer_init(void)
226{ 232{
233#ifdef CONFIG_LOCAL_TIMERS
234 twd_base = IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE);
235#endif
227 omap_dm_timer_init(); 236 omap_dm_timer_init();
228 237
229 omap2_gp_clockevent_init(); 238 omap2_gp_clockevent_init();
diff --git a/arch/arm/mach-omap2/timer-mpu.c b/arch/arm/mach-omap2/timer-mpu.c
new file mode 100644
index 000000000000..c1a650a9910f
--- /dev/null
+++ b/arch/arm/mach-omap2/timer-mpu.c
@@ -0,0 +1,34 @@
1/*
2 * The MPU local timer source file. In OMAP4, both cortex-a9 cores have
3 * own timer in it's MPU domain. These timers will be driving the
4 * linux kernel SMP tick framework when active. These timers are not
5 * part of the wake up domain.
6 *
7 * Copyright (C) 2009 Texas Instruments, Inc.
8 *
9 * Author:
10 * Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
12 * This file is based on arm realview smp platform file.
13 * Copyright (C) 2002 ARM Ltd.
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 version 2 as
17 * published by the Free Software Foundation.
18 */
19#include <linux/init.h>
20#include <linux/smp.h>
21#include <linux/clockchips.h>
22#include <asm/irq.h>
23#include <asm/smp_twd.h>
24#include <asm/localtimer.h>
25
26/*
27 * Setup the local clock events for a CPU.
28 */
29void __cpuinit local_timer_setup(struct clock_event_device *evt)
30{
31 evt->irq = INT_44XX_LOCALTIMER_IRQ;
32 twd_timer_setup(evt);
33}
34
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 34a56a136efd..d85296dc896c 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -28,10 +28,20 @@
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/pm.h>
32#include <mach/mux.h> 31#include <mach/mux.h>
33#include <mach/usb.h> 32#include <mach/usb.h>
34 33
34#define OTG_SYSCONFIG (OMAP34XX_HSUSB_OTG_BASE + 0x404)
35
36static void __init usb_musb_pm_init(void)
37{
38 /* Ensure force-idle mode for OTG controller */
39 if (cpu_is_omap34xx())
40 omap_writel(0, OTG_SYSCONFIG);
41}
42
43#ifdef CONFIG_USB_MUSB_SOC
44
35static struct resource musb_resources[] = { 45static struct resource musb_resources[] = {
36 [0] = { /* start and end set dynamically */ 46 [0] = { /* start and end set dynamically */
37 .flags = IORESOURCE_MEM, 47 .flags = IORESOURCE_MEM,
@@ -184,4 +194,13 @@ void __init usb_musb_init(void)
184 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); 194 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
185 return; 195 return;
186 } 196 }
197
198 usb_musb_pm_init();
199}
200
201#else
202void __init usb_musb_init(void)
203{
204 usb_musb_pm_init();
187} 205}
206#endif /* CONFIG_USB_MUSB_SOC */
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
index c14d12137276..6f3f77d031d0 100644
--- a/arch/arm/mach-orion5x/addr-map.c
+++ b/arch/arm/mach-orion5x/addr-map.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/errno.h>
17#include <mach/hardware.h> 18#include <mach/hardware.h>
18#include "common.h" 19#include "common.h"
19 20
@@ -44,6 +45,7 @@
44#define TARGET_DEV_BUS 1 45#define TARGET_DEV_BUS 1
45#define TARGET_PCI 3 46#define TARGET_PCI 3
46#define TARGET_PCIE 4 47#define TARGET_PCIE 4
48#define TARGET_SRAM 9
47#define ATTR_PCIE_MEM 0x59 49#define ATTR_PCIE_MEM 0x59
48#define ATTR_PCIE_IO 0x51 50#define ATTR_PCIE_IO 0x51
49#define ATTR_PCIE_WA 0x79 51#define ATTR_PCIE_WA 0x79
@@ -53,6 +55,7 @@
53#define ATTR_DEV_CS1 0x1d 55#define ATTR_DEV_CS1 0x1d
54#define ATTR_DEV_CS2 0x1b 56#define ATTR_DEV_CS2 0x1b
55#define ATTR_DEV_BOOT 0xf 57#define ATTR_DEV_BOOT 0xf
58#define ATTR_SRAM 0x0
56 59
57/* 60/*
58 * Helpers to get DDR bank info 61 * Helpers to get DDR bank info
@@ -87,13 +90,13 @@ static int __init orion5x_cpu_win_can_remap(int win)
87 return 0; 90 return 0;
88} 91}
89 92
90static void __init setup_cpu_win(int win, u32 base, u32 size, 93static int __init setup_cpu_win(int win, u32 base, u32 size,
91 u8 target, u8 attr, int remap) 94 u8 target, u8 attr, int remap)
92{ 95{
93 if (win >= 8) { 96 if (win >= 8) {
94 printk(KERN_ERR "setup_cpu_win: trying to allocate " 97 printk(KERN_ERR "setup_cpu_win: trying to allocate "
95 "window %d\n", win); 98 "window %d\n", win);
96 return; 99 return -ENOSPC;
97 } 100 }
98 101
99 writel(base & 0xffff0000, CPU_WIN_BASE(win)); 102 writel(base & 0xffff0000, CPU_WIN_BASE(win));
@@ -107,6 +110,7 @@ static void __init setup_cpu_win(int win, u32 base, u32 size,
107 writel(remap & 0xffff0000, CPU_WIN_REMAP_LO(win)); 110 writel(remap & 0xffff0000, CPU_WIN_REMAP_LO(win));
108 writel(0, CPU_WIN_REMAP_HI(win)); 111 writel(0, CPU_WIN_REMAP_HI(win));
109 } 112 }
113 return 0;
110} 114}
111 115
112void __init orion5x_setup_cpu_mbus_bridge(void) 116void __init orion5x_setup_cpu_mbus_bridge(void)
@@ -193,3 +197,9 @@ void __init orion5x_setup_pcie_wa_win(u32 base, u32 size)
193 setup_cpu_win(win_alloc_count++, base, size, 197 setup_cpu_win(win_alloc_count++, base, size,
194 TARGET_PCIE, ATTR_PCIE_WA, -1); 198 TARGET_PCIE, ATTR_PCIE_WA, -1);
195} 199}
200
201int __init orion5x_setup_sram_win(void)
202{
203 return setup_cpu_win(win_alloc_count, ORION5X_SRAM_PHYS_BASE,
204 ORION5X_SRAM_SIZE, TARGET_SRAM, ATTR_SRAM, -1);
205}
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index b1c7778d9f96..eafcc49009ea 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -31,7 +31,7 @@
31#include <plat/ehci-orion.h> 31#include <plat/ehci-orion.h>
32#include <plat/mv_xor.h> 32#include <plat/mv_xor.h>
33#include <plat/orion_nand.h> 33#include <plat/orion_nand.h>
34#include <plat/orion5x_wdt.h> 34#include <plat/orion_wdt.h>
35#include <plat/time.h> 35#include <plat/time.h>
36#include "common.h" 36#include "common.h"
37 37
@@ -536,16 +536,52 @@ void __init orion5x_xor_init(void)
536 platform_device_register(&orion5x_xor1_channel); 536 platform_device_register(&orion5x_xor1_channel);
537} 537}
538 538
539static struct resource orion5x_crypto_res[] = {
540 {
541 .name = "regs",
542 .start = ORION5X_CRYPTO_PHYS_BASE,
543 .end = ORION5X_CRYPTO_PHYS_BASE + 0xffff,
544 .flags = IORESOURCE_MEM,
545 }, {
546 .name = "sram",
547 .start = ORION5X_SRAM_PHYS_BASE,
548 .end = ORION5X_SRAM_PHYS_BASE + SZ_8K - 1,
549 .flags = IORESOURCE_MEM,
550 }, {
551 .name = "crypto interrupt",
552 .start = IRQ_ORION5X_CESA,
553 .end = IRQ_ORION5X_CESA,
554 .flags = IORESOURCE_IRQ,
555 },
556};
557
558static struct platform_device orion5x_crypto_device = {
559 .name = "mv_crypto",
560 .id = -1,
561 .num_resources = ARRAY_SIZE(orion5x_crypto_res),
562 .resource = orion5x_crypto_res,
563};
564
565int __init orion5x_crypto_init(void)
566{
567 int ret;
568
569 ret = orion5x_setup_sram_win();
570 if (ret)
571 return ret;
572
573 return platform_device_register(&orion5x_crypto_device);
574}
539 575
540/***************************************************************************** 576/*****************************************************************************
541 * Watchdog 577 * Watchdog
542 ****************************************************************************/ 578 ****************************************************************************/
543static struct orion5x_wdt_platform_data orion5x_wdt_data = { 579static struct orion_wdt_platform_data orion5x_wdt_data = {
544 .tclk = 0, 580 .tclk = 0,
545}; 581};
546 582
547static struct platform_device orion5x_wdt_device = { 583static struct platform_device orion5x_wdt_device = {
548 .name = "orion5x_wdt", 584 .name = "orion_wdt",
549 .id = -1, 585 .id = -1,
550 .dev = { 586 .dev = {
551 .platform_data = &orion5x_wdt_data, 587 .platform_data = &orion5x_wdt_data,
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 798b9a5e3da9..de483e83edd7 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -26,6 +26,7 @@ void orion5x_setup_dev0_win(u32 base, u32 size);
26void orion5x_setup_dev1_win(u32 base, u32 size); 26void orion5x_setup_dev1_win(u32 base, u32 size);
27void orion5x_setup_dev2_win(u32 base, u32 size); 27void orion5x_setup_dev2_win(u32 base, u32 size);
28void orion5x_setup_pcie_wa_win(u32 base, u32 size); 28void orion5x_setup_pcie_wa_win(u32 base, u32 size);
29int orion5x_setup_sram_win(void);
29 30
30void orion5x_ehci0_init(void); 31void orion5x_ehci0_init(void);
31void orion5x_ehci1_init(void); 32void orion5x_ehci1_init(void);
@@ -37,6 +38,7 @@ void orion5x_spi_init(void);
37void orion5x_uart0_init(void); 38void orion5x_uart0_init(void);
38void orion5x_uart1_init(void); 39void orion5x_uart1_init(void);
39void orion5x_xor_init(void); 40void orion5x_xor_init(void);
41int orion5x_crypto_init(void);
40 42
41/* 43/*
42 * PCIe/PCI functions. 44 * PCIe/PCI functions.
diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
index be896e59d3e7..5c9744cd8ef6 100644
--- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
+++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
@@ -17,8 +17,8 @@
17 17
18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE | 0x104) 18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE | 0x104)
19 19
20#define CPU_RESET_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x108) 20#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x108)
21#define WDT_RESET 0x0002 21#define WDT_RESET_OUT_EN 0x0002
22 22
23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c) 23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c)
24 24
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h
index 377a773ae53f..2d8766570531 100644
--- a/arch/arm/mach-orion5x/include/mach/orion5x.h
+++ b/arch/arm/mach-orion5x/include/mach/orion5x.h
@@ -24,6 +24,7 @@
24 * f1000000 on-chip peripheral registers 24 * f1000000 on-chip peripheral registers
25 * f2000000 PCIe I/O space 25 * f2000000 PCIe I/O space
26 * f2100000 PCI I/O space 26 * f2100000 PCI I/O space
27 * f2200000 SRAM dedicated for the crypto unit
27 * f4000000 device bus mappings (boot) 28 * f4000000 device bus mappings (boot)
28 * fa000000 device bus mappings (cs0) 29 * fa000000 device bus mappings (cs0)
29 * fa800000 device bus mappings (cs2) 30 * fa800000 device bus mappings (cs2)
@@ -49,6 +50,9 @@
49#define ORION5X_PCI_IO_BUS_BASE 0x00100000 50#define ORION5X_PCI_IO_BUS_BASE 0x00100000
50#define ORION5X_PCI_IO_SIZE SZ_1M 51#define ORION5X_PCI_IO_SIZE SZ_1M
51 52
53#define ORION5X_SRAM_PHYS_BASE (0xf2200000)
54#define ORION5X_SRAM_SIZE SZ_8K
55
52/* Relevant only for Orion-1/Orion-NAS */ 56/* Relevant only for Orion-1/Orion-NAS */
53#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000 57#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000
54#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000 58#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000
@@ -94,6 +98,8 @@
94#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000) 98#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000)
95#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000) 99#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000)
96 100
101#define ORION5X_CRYPTO_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x90000)
102
97#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000) 103#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000)
98#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000) 104#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000)
99 105
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h
index e912490fff23..60e734c10458 100644
--- a/arch/arm/mach-orion5x/include/mach/system.h
+++ b/arch/arm/mach-orion5x/include/mach/system.h
@@ -23,7 +23,7 @@ static inline void arch_reset(char mode, const char *cmd)
23 /* 23 /*
24 * Enable and issue soft reset 24 * Enable and issue soft reset
25 */ 25 */
26 orion5x_setbits(CPU_RESET_MASK, (1 << 2)); 26 orion5x_setbits(RSTOUTn_MASK, (1 << 2));
27 orion5x_setbits(CPU_SOFT_RESET, 1); 27 orion5x_setbits(CPU_SOFT_RESET, 1);
28} 28}
29 29
diff --git a/arch/arm/mach-orion5x/mpp.c b/arch/arm/mach-orion5x/mpp.c
index e23a3f91d6c6..bc4c3b9aaf83 100644
--- a/arch/arm/mach-orion5x/mpp.c
+++ b/arch/arm/mach-orion5x/mpp.c
@@ -124,6 +124,9 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
124 u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL); 124 u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL);
125 u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL); 125 u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL);
126 126
127 /* Initialize gpiolib. */
128 orion_gpio_init();
129
127 while (mode->mpp >= 0) { 130 while (mode->mpp >= 0) {
128 u32 *reg; 131 u32 *reg;
129 int num_type; 132 int num_type;
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 41e6d5033d54..61c086b66723 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -181,9 +181,9 @@ static void mss2_power_off(void)
181 /* 181 /*
182 * Enable and issue soft reset 182 * Enable and issue soft reset
183 */ 183 */
184 reg = readl(CPU_RESET_MASK); 184 reg = readl(RSTOUTn_MASK);
185 reg |= 1 << 2; 185 reg |= 1 << 2;
186 writel(reg, CPU_RESET_MASK); 186 writel(reg, RSTOUTn_MASK);
187 187
188 reg = readl(CPU_SOFT_RESET); 188 reg = readl(CPU_SOFT_RESET);
189 reg |= 1; 189 reg |= 1;
diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h
index 0f9cdf458952..37b3d4875291 100644
--- a/arch/arm/mach-orion5x/ts78xx-fpga.h
+++ b/arch/arm/mach-orion5x/ts78xx-fpga.h
@@ -25,6 +25,7 @@ struct fpga_devices {
25 /* Technologic Systems */ 25 /* Technologic Systems */
26 struct fpga_device ts_rtc; 26 struct fpga_device ts_rtc;
27 struct fpga_device ts_nand; 27 struct fpga_device ts_nand;
28 struct fpga_device ts_rng;
28}; 29};
29 30
30struct ts78xx_fpga_data { 31struct ts78xx_fpga_data {
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index 9a6b397f972d..5041d1bc26b1 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -17,6 +17,7 @@
17#include <linux/m48t86.h> 17#include <linux/m48t86.h>
18#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#include <linux/timeriomem-rng.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <asm/mach/map.h> 23#include <asm/mach/map.h>
@@ -270,12 +271,57 @@ static void ts78xx_ts_nand_unload(void)
270} 271}
271 272
272/***************************************************************************** 273/*****************************************************************************
274 * HW RNG
275 ****************************************************************************/
276#define TS_RNG_DATA (TS78XX_FPGA_REGS_PHYS_BASE | 0x044)
277
278static struct resource ts78xx_ts_rng_resource = {
279 .flags = IORESOURCE_MEM,
280 .start = TS_RNG_DATA,
281 .end = TS_RNG_DATA + 4 - 1,
282};
283
284static struct timeriomem_rng_data ts78xx_ts_rng_data = {
285 .period = 1000000, /* one second */
286};
287
288static struct platform_device ts78xx_ts_rng_device = {
289 .name = "timeriomem_rng",
290 .id = -1,
291 .dev = {
292 .platform_data = &ts78xx_ts_rng_data,
293 },
294 .resource = &ts78xx_ts_rng_resource,
295 .num_resources = 1,
296};
297
298static int ts78xx_ts_rng_load(void)
299{
300 int rc;
301
302 if (ts78xx_fpga.supports.ts_rng.init == 0) {
303 rc = platform_device_register(&ts78xx_ts_rng_device);
304 if (!rc)
305 ts78xx_fpga.supports.ts_rng.init = 1;
306 } else
307 rc = platform_device_add(&ts78xx_ts_rng_device);
308
309 return rc;
310};
311
312static void ts78xx_ts_rng_unload(void)
313{
314 platform_device_del(&ts78xx_ts_rng_device);
315}
316
317/*****************************************************************************
273 * FPGA 'hotplug' support code 318 * FPGA 'hotplug' support code
274 ****************************************************************************/ 319 ****************************************************************************/
275static void ts78xx_fpga_devices_zero_init(void) 320static void ts78xx_fpga_devices_zero_init(void)
276{ 321{
277 ts78xx_fpga.supports.ts_rtc.init = 0; 322 ts78xx_fpga.supports.ts_rtc.init = 0;
278 ts78xx_fpga.supports.ts_nand.init = 0; 323 ts78xx_fpga.supports.ts_nand.init = 0;
324 ts78xx_fpga.supports.ts_rng.init = 0;
279} 325}
280 326
281static void ts78xx_fpga_supports(void) 327static void ts78xx_fpga_supports(void)
@@ -289,10 +335,12 @@ static void ts78xx_fpga_supports(void)
289 case TS7800_REV_5: 335 case TS7800_REV_5:
290 ts78xx_fpga.supports.ts_rtc.present = 1; 336 ts78xx_fpga.supports.ts_rtc.present = 1;
291 ts78xx_fpga.supports.ts_nand.present = 1; 337 ts78xx_fpga.supports.ts_nand.present = 1;
338 ts78xx_fpga.supports.ts_rng.present = 1;
292 break; 339 break;
293 default: 340 default:
294 ts78xx_fpga.supports.ts_rtc.present = 0; 341 ts78xx_fpga.supports.ts_rtc.present = 0;
295 ts78xx_fpga.supports.ts_nand.present = 0; 342 ts78xx_fpga.supports.ts_nand.present = 0;
343 ts78xx_fpga.supports.ts_rng.present = 0;
296 } 344 }
297} 345}
298 346
@@ -316,6 +364,14 @@ static int ts78xx_fpga_load_devices(void)
316 } 364 }
317 ret |= tmp; 365 ret |= tmp;
318 } 366 }
367 if (ts78xx_fpga.supports.ts_rng.present == 1) {
368 tmp = ts78xx_ts_rng_load();
369 if (tmp) {
370 printk(KERN_INFO "TS-78xx: RNG not registered\n");
371 ts78xx_fpga.supports.ts_rng.present = 0;
372 }
373 ret |= tmp;
374 }
319 375
320 return ret; 376 return ret;
321} 377}
@@ -328,6 +384,8 @@ static int ts78xx_fpga_unload_devices(void)
328 ts78xx_ts_rtc_unload(); 384 ts78xx_ts_rtc_unload();
329 if (ts78xx_fpga.supports.ts_nand.present == 1) 385 if (ts78xx_fpga.supports.ts_nand.present == 1)
330 ts78xx_ts_nand_unload(); 386 ts78xx_ts_nand_unload();
387 if (ts78xx_fpga.supports.ts_rng.present == 1)
388 ts78xx_ts_rng_unload();
331 389
332 return ret; 390 return ret;
333} 391}
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 7ddc22c2bb54..69208217b220 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -15,6 +15,7 @@
15#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/ethtool.h> 17#include <linux/ethtool.h>
18#include <net/dsa.h>
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/gpio.h> 20#include <asm/gpio.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
@@ -97,6 +98,20 @@ static struct mv643xx_eth_platform_data wnr854t_eth_data = {
97 .duplex = DUPLEX_FULL, 98 .duplex = DUPLEX_FULL,
98}; 99};
99 100
101static struct dsa_chip_data wnr854t_switch_chip_data = {
102 .port_names[0] = "lan3",
103 .port_names[1] = "lan4",
104 .port_names[2] = "wan",
105 .port_names[3] = "cpu",
106 .port_names[5] = "lan1",
107 .port_names[7] = "lan2",
108};
109
110static struct dsa_platform_data wnr854t_switch_plat_data = {
111 .nr_chips = 1,
112 .chip = &wnr854t_switch_chip_data,
113};
114
100static void __init wnr854t_init(void) 115static void __init wnr854t_init(void)
101{ 116{
102 /* 117 /*
@@ -110,6 +125,7 @@ static void __init wnr854t_init(void)
110 * Configure peripherals. 125 * Configure peripherals.
111 */ 126 */
112 orion5x_eth_init(&wnr854t_eth_data); 127 orion5x_eth_init(&wnr854t_eth_data);
128 orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
113 orion5x_uart0_init(); 129 orion5x_uart0_init();
114 130
115 orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE, 131 orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE,
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 17d3fbd368a3..f4533f8ff4e8 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -51,6 +51,12 @@ config MACH_INTELMOTE2
51 select IWMMXT 51 select IWMMXT
52 select PXA_HAVE_BOARD_IRQS 52 select PXA_HAVE_BOARD_IRQS
53 53
54config MACH_STARGATE2
55 bool "Intel Stargate 2 Platform"
56 select PXA27x
57 select IWMMXT
58 select PXA_HAVE_BOARD_IRQS
59
54config ARCH_LUBBOCK 60config ARCH_LUBBOCK
55 bool "Intel DBPXA250 Development Platform" 61 bool "Intel DBPXA250 Development Platform"
56 select PXA25x 62 select PXA25x
@@ -88,6 +94,10 @@ config PXA_SHARPSL
88 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa) 94 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
89 handheld computer. 95 handheld computer.
90 96
97config SHARPSL_PM
98 bool
99 select APM_EMULATION
100
91config CORGI_SSP_DEPRECATED 101config CORGI_SSP_DEPRECATED
92 bool 102 bool
93 select PXA_SSP 103 select PXA_SSP
@@ -280,6 +290,7 @@ config MACH_ZYLONITE
280 select PXA3xx 290 select PXA3xx
281 select PXA_SSP 291 select PXA_SSP
282 select HAVE_PWM 292 select HAVE_PWM
293 select PXA_HAVE_BOARD_IRQS
283 294
284config MACH_LITTLETON 295config MACH_LITTLETON
285 bool "PXA3xx Form Factor Platform (aka Littleton)" 296 bool "PXA3xx Form Factor Platform (aka Littleton)"
@@ -308,6 +319,14 @@ config MACH_CM_X300
308 select PXA3xx 319 select PXA3xx
309 select CPU_PXA300 320 select CPU_PXA300
310 321
322config MACH_H4700
323 bool "HP iPAQ hx4700"
324 select PXA27x
325 select IWMMXT
326 select PXA_SSP
327 select HAVE_PWM
328 select PXA_HAVE_BOARD_IRQS
329
311config MACH_MAGICIAN 330config MACH_MAGICIAN
312 bool "Enable HTC Magician Support" 331 bool "Enable HTC Magician Support"
313 select PXA27x 332 select PXA27x
@@ -505,12 +524,6 @@ config PXA_SSP
505 help 524 help
506 Enable support for PXA2xx SSP ports 525 Enable support for PXA2xx SSP ports
507 526
508config PXA_PWM
509 tristate
510 default BACKLIGHT_PWM
511 help
512 Enable support for PXA2xx/PXA3xx PWM controllers
513
514config TOSA_BT 527config TOSA_BT
515 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" 528 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
516 depends on MACH_TOSA 529 depends on MACH_TOSA
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 682dbf4e14b0..d18ffef44b8c 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -15,7 +15,6 @@ endif
15 15
16# Generic drivers that other drivers may depend upon 16# Generic drivers that other drivers may depend upon
17obj-$(CONFIG_PXA_SSP) += ssp.o 17obj-$(CONFIG_PXA_SSP) += ssp.o
18obj-$(CONFIG_PXA_PWM) += pwm.o
19 18
20# SoC-specific code 19# SoC-specific code
21obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o 20obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o
@@ -47,6 +46,7 @@ obj-$(CONFIG_MACH_PCM027) += pcm027.o
47obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o 46obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
48obj-$(CONFIG_MACH_TOSA) += tosa.o 47obj-$(CONFIG_MACH_TOSA) += tosa.o
49obj-$(CONFIG_MACH_EM_X270) += em-x270.o 48obj-$(CONFIG_MACH_EM_X270) += em-x270.o
49obj-$(CONFIG_MACH_H4700) += hx4700.o
50obj-$(CONFIG_MACH_MAGICIAN) += magician.o 50obj-$(CONFIG_MACH_MAGICIAN) += magician.o
51obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o 51obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o
52obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o 52obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o
@@ -78,6 +78,7 @@ obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
78obj-$(CONFIG_PXA_EZX) += ezx.o 78obj-$(CONFIG_PXA_EZX) += ezx.o
79 79
80obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o 80obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
81obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
81obj-$(CONFIG_MACH_CSB726) += csb726.o 82obj-$(CONFIG_MACH_CSB726) += csb726.o
82obj-$(CONFIG_CSB726_CSB701) += csb701.o 83obj-$(CONFIG_CSB726_CSB701) += csb701.o
83 84
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index db52d2c4791d..49ae38292310 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -86,20 +86,3 @@ void clks_register(struct clk_lookup *clks, size_t num)
86 for (i = 0; i < num; i++) 86 for (i = 0; i < num; i++)
87 clkdev_add(&clks[i]); 87 clkdev_add(&clks[i]);
88} 88}
89
90int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
91 struct device *dev)
92{
93 struct clk *r = clk_get(dev, id);
94 struct clk_lookup *l;
95
96 if (!r)
97 return -ENODEV;
98
99 l = clkdev_alloc(r, alias, alias_dev_name);
100 clk_put(r);
101 if (!l)
102 return -ENODEV;
103 clkdev_add(l);
104 return 0;
105}
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index 34576ba5f5fd..1d2cec25391d 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -335,6 +335,10 @@ void __init cmx270_init(void)
335{ 335{
336 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config)); 336 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config));
337 337
338#ifdef CONFIG_PM
339 pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
340#endif
341
338 cmx270_init_rtc(); 342 cmx270_init_rtc();
339 cmx270_init_mmc(); 343 cmx270_init_mmc();
340 cmx270_init_ohci(); 344 cmx270_init_ohci();
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index a9f48b1cb54a..465da26591bd 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -21,18 +21,20 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/dm9000.h> 22#include <linux/dm9000.h>
23#include <linux/leds.h> 23#include <linux/leds.h>
24#include <linux/rtc-v3020.h>
24 25
25#include <linux/i2c.h> 26#include <linux/i2c.h>
26#include <linux/i2c/pca953x.h> 27#include <linux/i2c/pca953x.h>
27 28
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/setup.h>
30 32
31#include <mach/pxa300.h> 33#include <mach/pxa300.h>
32#include <mach/pxafb.h> 34#include <mach/pxafb.h>
33#include <mach/mmc.h> 35#include <mach/mmc.h>
34#include <mach/ohci.h> 36#include <mach/ohci.h>
35#include <mach/i2c.h> 37#include <plat/i2c.h>
36#include <mach/pxa3xx_nand.h> 38#include <mach/pxa3xx_nand.h>
37 39
38#include <asm/mach/map.h> 40#include <asm/mach/map.h>
@@ -46,6 +48,11 @@
46 48
47#define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ) 49#define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ)
48 50
51#define GPIO95_RTC_CS (95)
52#define GPIO96_RTC_WR (96)
53#define GPIO97_RTC_RD (97)
54#define GPIO98_RTC_IO (98)
55
49static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { 56static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
50 /* LCD */ 57 /* LCD */
51 GPIO54_LCD_LDD_0, 58 GPIO54_LCD_LDD_0,
@@ -135,6 +142,12 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
135 GPIO85_GPIO, /* MMC WP */ 142 GPIO85_GPIO, /* MMC WP */
136 GPIO99_GPIO, /* Ethernet IRQ */ 143 GPIO99_GPIO, /* Ethernet IRQ */
137 144
145 /* RTC GPIOs */
146 GPIO95_GPIO, /* RTC CS */
147 GPIO96_GPIO, /* RTC WR */
148 GPIO97_GPIO, /* RTC RD */
149 GPIO98_GPIO, /* RTC IO */
150
138 /* Standard I2C */ 151 /* Standard I2C */
139 GPIO21_I2C_SCL, 152 GPIO21_I2C_SCL,
140 GPIO22_I2C_SDA, 153 GPIO22_I2C_SDA,
@@ -265,6 +278,7 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
265 278
266static struct pxa3xx_nand_platform_data cm_x300_nand_info = { 279static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
267 .enable_arbiter = 1, 280 .enable_arbiter = 1,
281 .keep_config = 1,
268 .parts = cm_x300_nand_partitions, 282 .parts = cm_x300_nand_partitions,
269 .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions), 283 .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions),
270}; 284};
@@ -441,6 +455,31 @@ static void __init cm_x300_init_i2c(void)
441static inline void cm_x300_init_i2c(void) {} 455static inline void cm_x300_init_i2c(void) {}
442#endif 456#endif
443 457
458#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
459struct v3020_platform_data cm_x300_v3020_pdata = {
460 .use_gpio = 1,
461 .gpio_cs = GPIO95_RTC_CS,
462 .gpio_wr = GPIO96_RTC_WR,
463 .gpio_rd = GPIO97_RTC_RD,
464 .gpio_io = GPIO98_RTC_IO,
465};
466
467static struct platform_device cm_x300_rtc_device = {
468 .name = "v3020",
469 .id = -1,
470 .dev = {
471 .platform_data = &cm_x300_v3020_pdata,
472 }
473};
474
475static void __init cm_x300_init_rtc(void)
476{
477 platform_device_register(&cm_x300_rtc_device);
478}
479#else
480static inline void cm_x300_init_rtc(void) {}
481#endif
482
444static void __init cm_x300_init(void) 483static void __init cm_x300_init(void)
445{ 484{
446 /* board-processor specific GPIO initialization */ 485 /* board-processor specific GPIO initialization */
@@ -453,6 +492,19 @@ static void __init cm_x300_init(void)
453 cm_x300_init_nand(); 492 cm_x300_init_nand();
454 cm_x300_init_leds(); 493 cm_x300_init_leds();
455 cm_x300_init_i2c(); 494 cm_x300_init_i2c();
495 cm_x300_init_rtc();
496}
497
498static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,
499 char **cmdline, struct meminfo *mi)
500{
501 mi->nr_banks = 2;
502 mi->bank[0].start = 0xa0000000;
503 mi->bank[0].node = 0;
504 mi->bank[0].size = (64*1024*1024);
505 mi->bank[1].start = 0xc0000000;
506 mi->bank[1].node = 0;
507 mi->bank[1].size = (64*1024*1024);
456} 508}
457 509
458MACHINE_START(CM_X300, "CM-X300 module") 510MACHINE_START(CM_X300, "CM-X300 module")
@@ -463,4 +515,5 @@ MACHINE_START(CM_X300, "CM-X300 module")
463 .init_irq = pxa3xx_init_irq, 515 .init_irq = pxa3xx_init_irq,
464 .timer = &pxa_timer, 516 .timer = &pxa_timer,
465 .init_machine = cm_x300_init, 517 .init_machine = cm_x300_init,
518 .fixup = cm_x300_fixup,
466MACHINE_END 519MACHINE_END
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 930e364ccde9..962dda2e154a 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -42,7 +42,7 @@
42#include <asm/mach/irq.h> 42#include <asm/mach/irq.h>
43 43
44#include <mach/pxa25x.h> 44#include <mach/pxa25x.h>
45#include <mach/i2c.h> 45#include <plat/i2c.h>
46#include <mach/irda.h> 46#include <mach/irda.h>
47#include <mach/mmc.h> 47#include <mach/mmc.h>
48#include <mach/udc.h> 48#include <mach/udc.h>
@@ -445,13 +445,8 @@ static struct ads7846_platform_data corgi_ads7846_info = {
445 .wait_for_sync = corgi_wait_for_hsync, 445 .wait_for_sync = corgi_wait_for_hsync,
446}; 446};
447 447
448static void corgi_ads7846_cs(u32 command)
449{
450 gpio_set_value(CORGI_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT));
451}
452
453static struct pxa2xx_spi_chip corgi_ads7846_chip = { 448static struct pxa2xx_spi_chip corgi_ads7846_chip = {
454 .cs_control = corgi_ads7846_cs, 449 .gpio_cs = CORGI_GPIO_ADS7846_CS,
455}; 450};
456 451
457static void corgi_bl_kick_battery(void) 452static void corgi_bl_kick_battery(void)
@@ -475,22 +470,12 @@ static struct corgi_lcd_platform_data corgi_lcdcon_info = {
475 .kick_battery = corgi_bl_kick_battery, 470 .kick_battery = corgi_bl_kick_battery,
476}; 471};
477 472
478static void corgi_lcdcon_cs(u32 command)
479{
480 gpio_set_value(CORGI_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT));
481}
482
483static struct pxa2xx_spi_chip corgi_lcdcon_chip = { 473static struct pxa2xx_spi_chip corgi_lcdcon_chip = {
484 .cs_control = corgi_lcdcon_cs, 474 .gpio_cs = CORGI_GPIO_LCDCON_CS,
485}; 475};
486 476
487static void corgi_max1111_cs(u32 command)
488{
489 gpio_set_value(CORGI_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT));
490}
491
492static struct pxa2xx_spi_chip corgi_max1111_chip = { 477static struct pxa2xx_spi_chip corgi_max1111_chip = {
493 .cs_control = corgi_max1111_cs, 478 .gpio_cs = CORGI_GPIO_MAX1111_CS,
494}; 479};
495 480
496static struct spi_board_info corgi_spi_devices[] = { 481static struct spi_board_info corgi_spi_devices[] = {
@@ -520,32 +505,8 @@ static struct spi_board_info corgi_spi_devices[] = {
520 505
521static void __init corgi_init_spi(void) 506static void __init corgi_init_spi(void)
522{ 507{
523 int err;
524
525 err = gpio_request(CORGI_GPIO_ADS7846_CS, "ADS7846_CS");
526 if (err)
527 return;
528
529 err = gpio_request(CORGI_GPIO_LCDCON_CS, "LCDCON_CS");
530 if (err)
531 goto err_free_1;
532
533 err = gpio_request(CORGI_GPIO_MAX1111_CS, "MAX1111_CS");
534 if (err)
535 goto err_free_2;
536
537 gpio_direction_output(CORGI_GPIO_ADS7846_CS, 1);
538 gpio_direction_output(CORGI_GPIO_LCDCON_CS, 1);
539 gpio_direction_output(CORGI_GPIO_MAX1111_CS, 1);
540
541 pxa2xx_set_spi_info(1, &corgi_spi_info); 508 pxa2xx_set_spi_info(1, &corgi_spi_info);
542 spi_register_board_info(ARRAY_AND_SIZE(corgi_spi_devices)); 509 spi_register_board_info(ARRAY_AND_SIZE(corgi_spi_devices));
543 return;
544
545err_free_2:
546 gpio_free(CORGI_GPIO_LCDCON_CS);
547err_free_1:
548 gpio_free(CORGI_GPIO_ADS7846_CS);
549} 510}
550#else 511#else
551static inline void corgi_init_spi(void) {} 512static inline void corgi_init_spi(void) {}
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index 7f04b3a761d1..a093282fe4db 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -41,7 +41,6 @@ static void corgi_charger_init(void)
41 pxa_gpio_mode(CORGI_GPIO_CHRG_ON | GPIO_OUT); 41 pxa_gpio_mode(CORGI_GPIO_CHRG_ON | GPIO_OUT);
42 pxa_gpio_mode(CORGI_GPIO_CHRG_UKN | GPIO_OUT); 42 pxa_gpio_mode(CORGI_GPIO_CHRG_UKN | GPIO_OUT);
43 pxa_gpio_mode(CORGI_GPIO_KEY_INT | GPIO_IN); 43 pxa_gpio_mode(CORGI_GPIO_KEY_INT | GPIO_IN);
44 sharpsl_pm_pxa_init();
45} 44}
46 45
47static void corgi_measure_temp(int on) 46static void corgi_measure_temp(int on)
@@ -191,7 +190,7 @@ unsigned long corgipm_read_devdata(int type)
191 190
192static struct sharpsl_charger_machinfo corgi_pm_machinfo = { 191static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
193 .init = corgi_charger_init, 192 .init = corgi_charger_init,
194 .exit = sharpsl_pm_pxa_remove, 193 .exit = NULL,
195 .gpio_batlock = CORGI_GPIO_BAT_COVER, 194 .gpio_batlock = CORGI_GPIO_BAT_COVER,
196 .gpio_acin = CORGI_GPIO_AC_IN, 195 .gpio_acin = CORGI_GPIO_AC_IN,
197 .gpio_batfull = CORGI_GPIO_CHRG_FULL, 196 .gpio_batfull = CORGI_GPIO_CHRG_FULL,
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 083a1d851d49..3a8ee2272add 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -36,6 +36,8 @@
36#include <linux/sched.h> 36#include <linux/sched.h>
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/cpufreq.h> 38#include <linux/cpufreq.h>
39#include <linux/err.h>
40#include <linux/regulator/consumer.h>
39 41
40#include <mach/pxa2xx-regs.h> 42#include <mach/pxa2xx-regs.h>
41 43
@@ -47,6 +49,8 @@ MODULE_PARM_DESC(freq_debug, "Set the debug messages to on=1/off=0");
47#define freq_debug 0 49#define freq_debug 0
48#endif 50#endif
49 51
52static struct regulator *vcc_core;
53
50static unsigned int pxa27x_maxfreq; 54static unsigned int pxa27x_maxfreq;
51module_param(pxa27x_maxfreq, uint, 0); 55module_param(pxa27x_maxfreq, uint, 0);
52MODULE_PARM_DESC(pxa27x_maxfreq, "Set the pxa27x maxfreq in MHz" 56MODULE_PARM_DESC(pxa27x_maxfreq, "Set the pxa27x maxfreq in MHz"
@@ -58,6 +62,8 @@ typedef struct {
58 unsigned int cccr; 62 unsigned int cccr;
59 unsigned int div2; 63 unsigned int div2;
60 unsigned int cclkcfg; 64 unsigned int cclkcfg;
65 int vmin;
66 int vmax;
61} pxa_freqs_t; 67} pxa_freqs_t;
62 68
63/* Define the refresh period in mSec for the SDRAM and the number of rows */ 69/* Define the refresh period in mSec for the SDRAM and the number of rows */
@@ -82,24 +88,24 @@ static unsigned int sdram_rows;
82 88
83static pxa_freqs_t pxa255_run_freqs[] = 89static pxa_freqs_t pxa255_run_freqs[] =
84{ 90{
85 /* CPU MEMBUS CCCR DIV2 CCLKCFG run turbo PXbus SDRAM */ 91 /* CPU MEMBUS CCCR DIV2 CCLKCFG run turbo PXbus SDRAM */
86 { 99500, 99500, 0x121, 1, CCLKCFG}, /* 99, 99, 50, 50 */ 92 { 99500, 99500, 0x121, 1, CCLKCFG, -1, -1}, /* 99, 99, 50, 50 */
87 {132700, 132700, 0x123, 1, CCLKCFG}, /* 133, 133, 66, 66 */ 93 {132700, 132700, 0x123, 1, CCLKCFG, -1, -1}, /* 133, 133, 66, 66 */
88 {199100, 99500, 0x141, 0, CCLKCFG}, /* 199, 199, 99, 99 */ 94 {199100, 99500, 0x141, 0, CCLKCFG, -1, -1}, /* 199, 199, 99, 99 */
89 {265400, 132700, 0x143, 1, CCLKCFG}, /* 265, 265, 133, 66 */ 95 {265400, 132700, 0x143, 1, CCLKCFG, -1, -1}, /* 265, 265, 133, 66 */
90 {331800, 165900, 0x145, 1, CCLKCFG}, /* 331, 331, 166, 83 */ 96 {331800, 165900, 0x145, 1, CCLKCFG, -1, -1}, /* 331, 331, 166, 83 */
91 {398100, 99500, 0x161, 0, CCLKCFG}, /* 398, 398, 196, 99 */ 97 {398100, 99500, 0x161, 0, CCLKCFG, -1, -1}, /* 398, 398, 196, 99 */
92}; 98};
93 99
94/* Use the turbo mode frequencies for the CPUFREQ_POLICY_POWERSAVE policy */ 100/* Use the turbo mode frequencies for the CPUFREQ_POLICY_POWERSAVE policy */
95static pxa_freqs_t pxa255_turbo_freqs[] = 101static pxa_freqs_t pxa255_turbo_freqs[] =
96{ 102{
97 /* CPU MEMBUS CCCR DIV2 CCLKCFG run turbo PXbus SDRAM */ 103 /* CPU MEMBUS CCCR DIV2 CCLKCFG run turbo PXbus SDRAM */
98 { 99500, 99500, 0x121, 1, CCLKCFG}, /* 99, 99, 50, 50 */ 104 { 99500, 99500, 0x121, 1, CCLKCFG, -1, -1}, /* 99, 99, 50, 50 */
99 {199100, 99500, 0x221, 0, CCLKCFG}, /* 99, 199, 50, 99 */ 105 {199100, 99500, 0x221, 0, CCLKCFG, -1, -1}, /* 99, 199, 50, 99 */
100 {298500, 99500, 0x321, 0, CCLKCFG}, /* 99, 287, 50, 99 */ 106 {298500, 99500, 0x321, 0, CCLKCFG, -1, -1}, /* 99, 287, 50, 99 */
101 {298600, 99500, 0x1c1, 0, CCLKCFG}, /* 199, 287, 99, 99 */ 107 {298600, 99500, 0x1c1, 0, CCLKCFG, -1, -1}, /* 199, 287, 99, 99 */
102 {398100, 99500, 0x241, 0, CCLKCFG}, /* 199, 398, 99, 99 */ 108 {398100, 99500, 0x241, 0, CCLKCFG, -1, -1}, /* 199, 398, 99, 99 */
103}; 109};
104 110
105#define NUM_PXA25x_RUN_FREQS ARRAY_SIZE(pxa255_run_freqs) 111#define NUM_PXA25x_RUN_FREQS ARRAY_SIZE(pxa255_run_freqs)
@@ -148,13 +154,13 @@ MODULE_PARM_DESC(pxa255_turbo_table, "Selects the frequency table (0 = run table
148 ((T) ? CCLKCFG_TURBO : 0)) 154 ((T) ? CCLKCFG_TURBO : 0))
149 155
150static pxa_freqs_t pxa27x_freqs[] = { 156static pxa_freqs_t pxa27x_freqs[] = {
151 {104000, 104000, PXA27x_CCCR(1, 8, 2), 0, CCLKCFG2(1, 0, 1)}, 157 {104000, 104000, PXA27x_CCCR(1, 8, 2), 0, CCLKCFG2(1, 0, 1), 900000, 1705000 },
152 {156000, 104000, PXA27x_CCCR(1, 8, 6), 0, CCLKCFG2(1, 1, 1)}, 158 {156000, 104000, PXA27x_CCCR(1, 8, 6), 0, CCLKCFG2(1, 1, 1), 1000000, 1705000 },
153 {208000, 208000, PXA27x_CCCR(0, 16, 2), 1, CCLKCFG2(0, 0, 1)}, 159 {208000, 208000, PXA27x_CCCR(0, 16, 2), 1, CCLKCFG2(0, 0, 1), 1180000, 1705000 },
154 {312000, 208000, PXA27x_CCCR(1, 16, 3), 1, CCLKCFG2(1, 0, 1)}, 160 {312000, 208000, PXA27x_CCCR(1, 16, 3), 1, CCLKCFG2(1, 0, 1), 1250000, 1705000 },
155 {416000, 208000, PXA27x_CCCR(1, 16, 4), 1, CCLKCFG2(1, 0, 1)}, 161 {416000, 208000, PXA27x_CCCR(1, 16, 4), 1, CCLKCFG2(1, 0, 1), 1350000, 1705000 },
156 {520000, 208000, PXA27x_CCCR(1, 16, 5), 1, CCLKCFG2(1, 0, 1)}, 162 {520000, 208000, PXA27x_CCCR(1, 16, 5), 1, CCLKCFG2(1, 0, 1), 1450000, 1705000 },
157 {624000, 208000, PXA27x_CCCR(1, 16, 6), 1, CCLKCFG2(1, 0, 1)} 163 {624000, 208000, PXA27x_CCCR(1, 16, 6), 1, CCLKCFG2(1, 0, 1), 1550000, 1705000 }
158}; 164};
159 165
160#define NUM_PXA27x_FREQS ARRAY_SIZE(pxa27x_freqs) 166#define NUM_PXA27x_FREQS ARRAY_SIZE(pxa27x_freqs)
@@ -163,6 +169,47 @@ static struct cpufreq_frequency_table
163 169
164extern unsigned get_clk_frequency_khz(int info); 170extern unsigned get_clk_frequency_khz(int info);
165 171
172#ifdef CONFIG_REGULATOR
173
174static int pxa_cpufreq_change_voltage(pxa_freqs_t *pxa_freq)
175{
176 int ret = 0;
177 int vmin, vmax;
178
179 if (!cpu_is_pxa27x())
180 return 0;
181
182 vmin = pxa_freq->vmin;
183 vmax = pxa_freq->vmax;
184 if ((vmin == -1) || (vmax == -1))
185 return 0;
186
187 ret = regulator_set_voltage(vcc_core, vmin, vmax);
188 if (ret)
189 pr_err("cpufreq: Failed to set vcc_core in [%dmV..%dmV]\n",
190 vmin, vmax);
191 return ret;
192}
193
194static __init void pxa_cpufreq_init_voltages(void)
195{
196 vcc_core = regulator_get(NULL, "vcc_core");
197 if (IS_ERR(vcc_core)) {
198 pr_info("cpufreq: Didn't find vcc_core regulator\n");
199 vcc_core = NULL;
200 } else {
201 pr_info("cpufreq: Found vcc_core regulator\n");
202 }
203}
204#else
205static int pxa_cpufreq_change_voltage(pxa_freqs_t *pxa_freq)
206{
207 return 0;
208}
209
210static __init void pxa_cpufreq_init_voltages(void) { }
211#endif
212
166static void find_freq_tables(struct cpufreq_frequency_table **freq_table, 213static void find_freq_tables(struct cpufreq_frequency_table **freq_table,
167 pxa_freqs_t **pxa_freqs) 214 pxa_freqs_t **pxa_freqs)
168{ 215{
@@ -251,6 +298,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
251 unsigned long flags; 298 unsigned long flags;
252 unsigned int new_freq_cpu, new_freq_mem; 299 unsigned int new_freq_cpu, new_freq_mem;
253 unsigned int unused, preset_mdrefr, postset_mdrefr, cclkcfg; 300 unsigned int unused, preset_mdrefr, postset_mdrefr, cclkcfg;
301 int ret = 0;
254 302
255 /* Get the current policy */ 303 /* Get the current policy */
256 find_freq_tables(&pxa_freqs_table, &pxa_freq_settings); 304 find_freq_tables(&pxa_freqs_table, &pxa_freq_settings);
@@ -273,6 +321,10 @@ static int pxa_set_target(struct cpufreq_policy *policy,
273 freqs.new / 1000, (pxa_freq_settings[idx].div2) ? 321 freqs.new / 1000, (pxa_freq_settings[idx].div2) ?
274 (new_freq_mem / 2000) : (new_freq_mem / 1000)); 322 (new_freq_mem / 2000) : (new_freq_mem / 1000));
275 323
324 if (vcc_core && freqs.new > freqs.old)
325 ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]);
326 if (ret)
327 return ret;
276 /* 328 /*
277 * Tell everyone what we're about to do... 329 * Tell everyone what we're about to do...
278 * you should add a notify client with any platform specific 330 * you should add a notify client with any platform specific
@@ -335,6 +387,18 @@ static int pxa_set_target(struct cpufreq_policy *policy,
335 */ 387 */
336 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 388 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
337 389
390 /*
391 * Even if voltage setting fails, we don't report it, as the frequency
392 * change succeeded. The voltage reduction is not a critical failure,
393 * only power savings will suffer from this.
394 *
395 * Note: if the voltage change fails, and a return value is returned, a
396 * bug is triggered (seems a deadlock). Should anybody find out where,
397 * the "return 0" should become a "return ret".
398 */
399 if (vcc_core && freqs.new < freqs.old)
400 ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]);
401
338 return 0; 402 return 0;
339} 403}
340 404
@@ -349,6 +413,8 @@ static __init int pxa_cpufreq_init(struct cpufreq_policy *policy)
349 if (cpu_is_pxa27x()) 413 if (cpu_is_pxa27x())
350 pxa27x_guess_max_freq(); 414 pxa27x_guess_max_freq();
351 415
416 pxa_cpufreq_init_voltages();
417
352 init_sdram_rows(); 418 init_sdram_rows();
353 419
354 /* set default policy and cpuinfo */ 420 /* set default policy and cpuinfo */
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 2b289f83a61a..7d3e1b46e550 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -16,15 +16,17 @@
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
17#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
18#include <linux/sm501.h> 18#include <linux/sm501.h>
19#include <linux/smsc911x.h>
19 20
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <mach/csb726.h> 23#include <mach/csb726.h>
23#include <mach/mfp-pxa27x.h> 24#include <mach/mfp-pxa27x.h>
24#include <mach/i2c.h> 25#include <plat/i2c.h>
25#include <mach/mmc.h> 26#include <mach/mmc.h>
26#include <mach/ohci.h> 27#include <mach/ohci.h>
27#include <mach/pxa2xx-regs.h> 28#include <mach/pxa2xx-regs.h>
29#include <mach/audio.h>
28 30
29#include "generic.h" 31#include "generic.h"
30#include "devices.h" 32#include "devices.h"
@@ -275,15 +277,26 @@ static struct resource csb726_lan_resources[] = {
275 { 277 {
276 .start = CSB726_IRQ_LAN, 278 .start = CSB726_IRQ_LAN,
277 .end = CSB726_IRQ_LAN, 279 .end = CSB726_IRQ_LAN,
278 .flags = IORESOURCE_IRQ, 280 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
279 }, 281 },
280}; 282};
281 283
284struct smsc911x_platform_config csb726_lan_config = {
285 .irq_type = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
286 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
287 .flags = SMSC911X_USE_32BIT,
288 .phy_interface = PHY_INTERFACE_MODE_MII,
289};
290
291
282static struct platform_device csb726_lan = { 292static struct platform_device csb726_lan = {
283 .name = "smc911x", 293 .name = "smsc911x",
284 .id = -1, 294 .id = -1,
285 .num_resources = ARRAY_SIZE(csb726_lan_resources), 295 .num_resources = ARRAY_SIZE(csb726_lan_resources),
286 .resource = csb726_lan_resources, 296 .resource = csb726_lan_resources,
297 .dev = {
298 .platform_data = &csb726_lan_config,
299 },
287}; 300};
288 301
289static struct platform_device *devices[] __initdata = { 302static struct platform_device *devices[] __initdata = {
@@ -303,6 +316,7 @@ static void __init csb726_init(void)
303 pxa27x_set_i2c_power_info(NULL); 316 pxa27x_set_i2c_power_info(NULL);
304 pxa_set_mci_info(&csb726_mci); 317 pxa_set_mci_info(&csb726_mci);
305 pxa_set_ohci_info(&csb726_ohci_platform_data); 318 pxa_set_ohci_info(&csb726_ohci_platform_data);
319 pxa_set_ac97_info(NULL);
306 320
307 platform_add_devices(devices, ARRAY_SIZE(devices)); 321 platform_add_devices(devices, ARRAY_SIZE(devices));
308} 322}
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 29970f703f3c..ecc08f360b68 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -8,7 +8,7 @@
8#include <mach/pxafb.h> 8#include <mach/pxafb.h>
9#include <mach/mmc.h> 9#include <mach/mmc.h>
10#include <mach/irda.h> 10#include <mach/irda.h>
11#include <mach/i2c.h> 11#include <plat/i2c.h>
12#include <mach/ohci.h> 12#include <mach/ohci.h>
13#include <mach/pxa27x_keypad.h> 13#include <mach/pxa27x_keypad.h>
14#include <mach/pxa2xx_spi.h> 14#include <mach/pxa2xx_spi.h>
@@ -290,7 +290,7 @@ static struct resource pxa3xx_resources_i2c_power[] = {
290}; 290};
291 291
292struct platform_device pxa3xx_device_i2c_power = { 292struct platform_device pxa3xx_device_i2c_power = {
293 .name = "pxa2xx-i2c", 293 .name = "pxa3xx-pwri2c",
294 .id = 1, 294 .id = 1,
295 .resource = pxa3xx_resources_i2c_power, 295 .resource = pxa3xx_resources_i2c_power,
296 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), 296 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index bc0f73fbd4ca..243e0802b5f4 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -28,6 +28,8 @@
28#include <linux/spi/libertas_spi.h> 28#include <linux/spi/libertas_spi.h>
29#include <linux/power_supply.h> 29#include <linux/power_supply.h>
30#include <linux/apm-emulation.h> 30#include <linux/apm-emulation.h>
31#include <linux/i2c.h>
32#include <linux/i2c/pca953x.h>
31 33
32#include <media/soc_camera.h> 34#include <media/soc_camera.h>
33 35
@@ -41,7 +43,7 @@
41#include <mach/ohci.h> 43#include <mach/ohci.h>
42#include <mach/mmc.h> 44#include <mach/mmc.h>
43#include <mach/pxa27x_keypad.h> 45#include <mach/pxa27x_keypad.h>
44#include <mach/i2c.h> 46#include <plat/i2c.h>
45#include <mach/camera.h> 47#include <mach/camera.h>
46#include <mach/pxa2xx_spi.h> 48#include <mach/pxa2xx_spi.h>
47 49
@@ -52,23 +54,31 @@
52#define GPIO13_MMC_CD (13) 54#define GPIO13_MMC_CD (13)
53#define GPIO95_MMC_WP (95) 55#define GPIO95_MMC_WP (95)
54#define GPIO56_NAND_RB (56) 56#define GPIO56_NAND_RB (56)
57#define GPIO93_CAM_RESET (93)
58#define GPIO16_USB_HUB_RESET (16)
55 59
56/* eXeda specific GPIOs */ 60/* eXeda specific GPIOs */
57#define GPIO114_MMC_CD (114) 61#define GPIO114_MMC_CD (114)
58#define GPIO20_NAND_RB (20) 62#define GPIO20_NAND_RB (20)
59#define GPIO38_SD_PWEN (38) 63#define GPIO38_SD_PWEN (38)
64#define GPIO37_WLAN_RST (37)
65#define GPIO95_TOUCHPAD_INT (95)
66#define GPIO130_CAM_RESET (130)
67#define GPIO10_USB_HUB_RESET (10)
60 68
61/* common GPIOs */ 69/* common GPIOs */
62#define GPIO11_NAND_CS (11) 70#define GPIO11_NAND_CS (11)
63#define GPIO93_CAM_RESET (93)
64#define GPIO41_ETHIRQ (41) 71#define GPIO41_ETHIRQ (41)
65#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) 72#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ)
66#define GPIO115_WLAN_PWEN (115) 73#define GPIO115_WLAN_PWEN (115)
67#define GPIO19_WLAN_STRAP (19) 74#define GPIO19_WLAN_STRAP (19)
75#define GPIO9_USB_VBUS_EN (9)
68 76
69static int mmc_cd; 77static int mmc_cd;
70static int nand_rb; 78static int nand_rb;
71static int dm9000_flags; 79static int dm9000_flags;
80static int cam_reset;
81static int usb_hub_reset;
72 82
73static unsigned long common_pin_config[] = { 83static unsigned long common_pin_config[] = {
74 /* AC'97 */ 84 /* AC'97 */
@@ -180,7 +190,6 @@ static unsigned long common_pin_config[] = {
180 190
181 /* power controls */ 191 /* power controls */
182 GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */ 192 GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */
183 GPIO93_GPIO | MFP_LPM_DRIVE_LOW, /* Camera reset */
184 GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */ 193 GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */
185 194
186 /* NAND controls */ 195 /* NAND controls */
@@ -191,14 +200,18 @@ static unsigned long common_pin_config[] = {
191}; 200};
192 201
193static unsigned long em_x270_pin_config[] = { 202static unsigned long em_x270_pin_config[] = {
194 GPIO13_GPIO, /* MMC card detect */ 203 GPIO13_GPIO, /* MMC card detect */
195 GPIO56_GPIO, /* NAND Ready/Busy */ 204 GPIO16_GPIO, /* USB hub reset */
196 GPIO95_GPIO, /* MMC Write protect */ 205 GPIO56_GPIO, /* NAND Ready/Busy */
206 GPIO93_GPIO | MFP_LPM_DRIVE_LOW, /* Camera reset */
207 GPIO95_GPIO, /* MMC Write protect */
197}; 208};
198 209
199static unsigned long exeda_pin_config[] = { 210static unsigned long exeda_pin_config[] = {
211 GPIO10_GPIO, /* USB hub reset */
200 GPIO20_GPIO, /* NAND Ready/Busy */ 212 GPIO20_GPIO, /* NAND Ready/Busy */
201 GPIO38_GPIO | MFP_LPM_DRIVE_LOW, /* SD slot power */ 213 GPIO38_GPIO | MFP_LPM_DRIVE_LOW, /* SD slot power */
214 GPIO95_GPIO, /* touchpad IRQ */
202 GPIO114_GPIO, /* MMC card detect */ 215 GPIO114_GPIO, /* MMC card detect */
203}; 216};
204 217
@@ -464,18 +477,79 @@ static inline void em_x270_init_nor(void) {}
464 477
465/* PXA27x OHCI controller setup */ 478/* PXA27x OHCI controller setup */
466#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 479#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
480static struct regulator *em_x270_usb_ldo;
481
482static int em_x270_usb_hub_init(void)
483{
484 int err;
485
486 em_x270_usb_ldo = regulator_get(NULL, "vcc usb");
487 if (IS_ERR(em_x270_usb_ldo))
488 return PTR_ERR(em_x270_usb_ldo);
489
490 err = gpio_request(GPIO9_USB_VBUS_EN, "vbus en");
491 if (err)
492 goto err_free_usb_ldo;
493
494 err = gpio_request(usb_hub_reset, "hub rst");
495 if (err)
496 goto err_free_vbus_gpio;
497
498 /* USB Hub power-on and reset */
499 gpio_direction_output(usb_hub_reset, 0);
500 regulator_enable(em_x270_usb_ldo);
501 gpio_set_value(usb_hub_reset, 1);
502 gpio_set_value(usb_hub_reset, 0);
503 regulator_disable(em_x270_usb_ldo);
504 regulator_enable(em_x270_usb_ldo);
505 gpio_set_value(usb_hub_reset, 1);
506
507 /* enable VBUS */
508 gpio_direction_output(GPIO9_USB_VBUS_EN, 1);
509
510 return 0;
511
512err_free_vbus_gpio:
513 gpio_free(GPIO9_USB_VBUS_EN);
514err_free_usb_ldo:
515 regulator_put(em_x270_usb_ldo);
516
517 return err;
518}
519
467static int em_x270_ohci_init(struct device *dev) 520static int em_x270_ohci_init(struct device *dev)
468{ 521{
522 int err;
523
524 /* we don't want to entirely disable USB if the HUB init failed */
525 err = em_x270_usb_hub_init();
526 if (err)
527 pr_err("USB Hub initialization failed: %d\n", err);
528
469 /* enable port 2 transiever */ 529 /* enable port 2 transiever */
470 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE; 530 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE;
471 531
472 return 0; 532 return 0;
473} 533}
474 534
535static void em_x270_ohci_exit(struct device *dev)
536{
537 gpio_free(usb_hub_reset);
538 gpio_free(GPIO9_USB_VBUS_EN);
539
540 if (!IS_ERR(em_x270_usb_ldo)) {
541 if (regulator_is_enabled(em_x270_usb_ldo))
542 regulator_disable(em_x270_usb_ldo);
543
544 regulator_put(em_x270_usb_ldo);
545 }
546}
547
475static struct pxaohci_platform_data em_x270_ohci_platform_data = { 548static struct pxaohci_platform_data em_x270_ohci_platform_data = {
476 .port_mode = PMM_PERPORT_MODE, 549 .port_mode = PMM_PERPORT_MODE,
477 .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW, 550 .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW,
478 .init = em_x270_ohci_init, 551 .init = em_x270_ohci_init,
552 .exit = em_x270_ohci_exit,
479}; 553};
480 554
481static void __init em_x270_init_ohci(void) 555static void __init em_x270_init_ohci(void)
@@ -677,26 +751,52 @@ static int em_x270_libertas_setup(struct spi_device *spi)
677 if (err) 751 if (err)
678 return err; 752 return err;
679 753
754 err = gpio_request(GPIO19_WLAN_STRAP, "WLAN STRAP");
755 if (err)
756 goto err_free_pwen;
757
758 if (machine_is_exeda()) {
759 err = gpio_request(GPIO37_WLAN_RST, "WLAN RST");
760 if (err)
761 goto err_free_strap;
762
763 gpio_direction_output(GPIO37_WLAN_RST, 1);
764 msleep(100);
765 }
766
680 gpio_direction_output(GPIO19_WLAN_STRAP, 1); 767 gpio_direction_output(GPIO19_WLAN_STRAP, 1);
681 mdelay(100); 768 msleep(100);
682 769
683 pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config)); 770 pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config));
684 771
685 gpio_direction_output(GPIO115_WLAN_PWEN, 0); 772 gpio_direction_output(GPIO115_WLAN_PWEN, 0);
686 mdelay(100); 773 msleep(100);
687 gpio_set_value(GPIO115_WLAN_PWEN, 1); 774 gpio_set_value(GPIO115_WLAN_PWEN, 1);
688 mdelay(100); 775 msleep(100);
689 776
690 spi->bits_per_word = 16; 777 spi->bits_per_word = 16;
691 spi_setup(spi); 778 spi_setup(spi);
692 779
693 return 0; 780 return 0;
781
782err_free_strap:
783 gpio_free(GPIO19_WLAN_STRAP);
784err_free_pwen:
785 gpio_free(GPIO115_WLAN_PWEN);
786
787 return err;
694} 788}
695 789
696static int em_x270_libertas_teardown(struct spi_device *spi) 790static int em_x270_libertas_teardown(struct spi_device *spi)
697{ 791{
698 gpio_set_value(GPIO115_WLAN_PWEN, 0); 792 gpio_set_value(GPIO115_WLAN_PWEN, 0);
699 gpio_free(GPIO115_WLAN_PWEN); 793 gpio_free(GPIO115_WLAN_PWEN);
794 gpio_free(GPIO19_WLAN_STRAP);
795
796 if (machine_is_exeda()) {
797 gpio_set_value(GPIO37_WLAN_RST, 0);
798 gpio_free(GPIO37_WLAN_RST);
799 }
700 800
701 return 0; 801 return 0;
702} 802}
@@ -863,26 +963,26 @@ static int em_x270_sensor_init(struct device *dev)
863{ 963{
864 int ret; 964 int ret;
865 965
866 ret = gpio_request(GPIO93_CAM_RESET, "camera reset"); 966 ret = gpio_request(cam_reset, "camera reset");
867 if (ret) 967 if (ret)
868 return ret; 968 return ret;
869 969
870 gpio_direction_output(GPIO93_CAM_RESET, 0); 970 gpio_direction_output(cam_reset, 0);
871 971
872 em_x270_camera_ldo = regulator_get(NULL, "vcc cam"); 972 em_x270_camera_ldo = regulator_get(NULL, "vcc cam");
873 if (em_x270_camera_ldo == NULL) { 973 if (em_x270_camera_ldo == NULL) {
874 gpio_free(GPIO93_CAM_RESET); 974 gpio_free(cam_reset);
875 return -ENODEV; 975 return -ENODEV;
876 } 976 }
877 977
878 ret = regulator_enable(em_x270_camera_ldo); 978 ret = regulator_enable(em_x270_camera_ldo);
879 if (ret) { 979 if (ret) {
880 regulator_put(em_x270_camera_ldo); 980 regulator_put(em_x270_camera_ldo);
881 gpio_free(GPIO93_CAM_RESET); 981 gpio_free(cam_reset);
882 return ret; 982 return ret;
883 } 983 }
884 984
885 gpio_set_value(GPIO93_CAM_RESET, 1); 985 gpio_set_value(cam_reset, 1);
886 986
887 return 0; 987 return 0;
888} 988}
@@ -902,7 +1002,7 @@ static int em_x270_sensor_power(struct device *dev, int on)
902 if (on == is_on) 1002 if (on == is_on)
903 return 0; 1003 return 0;
904 1004
905 gpio_set_value(GPIO93_CAM_RESET, !on); 1005 gpio_set_value(cam_reset, !on);
906 1006
907 if (on) 1007 if (on)
908 ret = regulator_enable(em_x270_camera_ldo); 1008 ret = regulator_enable(em_x270_camera_ldo);
@@ -912,7 +1012,7 @@ static int em_x270_sensor_power(struct device *dev, int on)
912 if (ret) 1012 if (ret)
913 return ret; 1013 return ret;
914 1014
915 gpio_set_value(GPIO93_CAM_RESET, on); 1015 gpio_set_value(cam_reset, on);
916 1016
917 return 0; 1017 return 0;
918} 1018}
@@ -929,13 +1029,8 @@ static struct i2c_board_info em_x270_i2c_cam_info[] = {
929 }, 1029 },
930}; 1030};
931 1031
932static struct i2c_pxa_platform_data em_x270_i2c_info = {
933 .fast_mode = 1,
934};
935
936static void __init em_x270_init_camera(void) 1032static void __init em_x270_init_camera(void)
937{ 1033{
938 pxa_set_i2c_info(&em_x270_i2c_info);
939 i2c_register_board_info(0, ARRAY_AND_SIZE(em_x270_i2c_cam_info)); 1034 i2c_register_board_info(0, ARRAY_AND_SIZE(em_x270_i2c_cam_info));
940 pxa_set_camera_info(&em_x270_camera_platform_data); 1035 pxa_set_camera_info(&em_x270_camera_platform_data);
941} 1036}
@@ -985,7 +1080,7 @@ struct led_info em_x270_led_info = {
985}; 1080};
986 1081
987struct power_supply_info em_x270_psy_info = { 1082struct power_supply_info em_x270_psy_info = {
988 .name = "LP555597P6H-FPS", 1083 .name = "battery",
989 .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, 1084 .technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
990 .voltage_max_design = 4200000, 1085 .voltage_max_design = 4200000,
991 .voltage_min_design = 3000000, 1086 .voltage_min_design = 3000000,
@@ -1069,6 +1164,29 @@ static void __init em_x270_init_da9030(void)
1069 i2c_register_board_info(1, &em_x270_i2c_pmic_info, 1); 1164 i2c_register_board_info(1, &em_x270_i2c_pmic_info, 1);
1070} 1165}
1071 1166
1167static struct pca953x_platform_data exeda_gpio_ext_pdata = {
1168 .gpio_base = 128,
1169};
1170
1171static struct i2c_board_info exeda_i2c_info[] = {
1172 {
1173 I2C_BOARD_INFO("pca9555", 0x21),
1174 .platform_data = &exeda_gpio_ext_pdata,
1175 },
1176};
1177
1178static struct i2c_pxa_platform_data em_x270_i2c_info = {
1179 .fast_mode = 1,
1180};
1181
1182static void __init em_x270_init_i2c(void)
1183{
1184 pxa_set_i2c_info(&em_x270_i2c_info);
1185
1186 if (machine_is_exeda())
1187 i2c_register_board_info(0, ARRAY_AND_SIZE(exeda_i2c_info));
1188}
1189
1072static void __init em_x270_module_init(void) 1190static void __init em_x270_module_init(void)
1073{ 1191{
1074 pr_info("%s\n", __func__); 1192 pr_info("%s\n", __func__);
@@ -1077,6 +1195,8 @@ static void __init em_x270_module_init(void)
1077 mmc_cd = GPIO13_MMC_CD; 1195 mmc_cd = GPIO13_MMC_CD;
1078 nand_rb = GPIO56_NAND_RB; 1196 nand_rb = GPIO56_NAND_RB;
1079 dm9000_flags = DM9000_PLATF_32BITONLY; 1197 dm9000_flags = DM9000_PLATF_32BITONLY;
1198 cam_reset = GPIO93_CAM_RESET;
1199 usb_hub_reset = GPIO16_USB_HUB_RESET;
1080} 1200}
1081 1201
1082static void __init em_x270_exeda_init(void) 1202static void __init em_x270_exeda_init(void)
@@ -1087,12 +1207,18 @@ static void __init em_x270_exeda_init(void)
1087 mmc_cd = GPIO114_MMC_CD; 1207 mmc_cd = GPIO114_MMC_CD;
1088 nand_rb = GPIO20_NAND_RB; 1208 nand_rb = GPIO20_NAND_RB;
1089 dm9000_flags = DM9000_PLATF_16BITONLY; 1209 dm9000_flags = DM9000_PLATF_16BITONLY;
1210 cam_reset = GPIO130_CAM_RESET;
1211 usb_hub_reset = GPIO10_USB_HUB_RESET;
1090} 1212}
1091 1213
1092static void __init em_x270_init(void) 1214static void __init em_x270_init(void)
1093{ 1215{
1094 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config)); 1216 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config));
1095 1217
1218#ifdef CONFIG_PM
1219 pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
1220#endif
1221
1096 if (machine_is_em_x270()) 1222 if (machine_is_em_x270())
1097 em_x270_module_init(); 1223 em_x270_module_init();
1098 else if (machine_is_exeda()) 1224 else if (machine_is_exeda())
@@ -1111,8 +1237,9 @@ static void __init em_x270_init(void)
1111 em_x270_init_keypad(); 1237 em_x270_init_keypad();
1112 em_x270_init_gpio_keys(); 1238 em_x270_init_gpio_keys();
1113 em_x270_init_ac97(); 1239 em_x270_init_ac97();
1114 em_x270_init_camera();
1115 em_x270_init_spi(); 1240 em_x270_init_spi();
1241 em_x270_init_i2c();
1242 em_x270_init_camera();
1116} 1243}
1117 1244
1118MACHINE_START(EM_X270, "Compulab EM-X270") 1245MACHINE_START(EM_X270, "Compulab EM-X270")
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 7db966dc29ce..588b265e5755 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,6 +17,7 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/pwm_backlight.h> 18#include <linux/pwm_backlight.h>
19#include <linux/input.h> 19#include <linux/input.h>
20#include <linux/gpio_keys.h>
20 21
21#include <asm/setup.h> 22#include <asm/setup.h>
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
@@ -25,13 +26,19 @@
25#include <mach/pxa27x.h> 26#include <mach/pxa27x.h>
26#include <mach/pxafb.h> 27#include <mach/pxafb.h>
27#include <mach/ohci.h> 28#include <mach/ohci.h>
28#include <mach/i2c.h> 29#include <plat/i2c.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/pxa27x_keypad.h> 31#include <mach/pxa27x_keypad.h>
31 32
32#include "devices.h" 33#include "devices.h"
33#include "generic.h" 34#include "generic.h"
34 35
36#define GPIO12_A780_FLIP_LID 12
37#define GPIO15_A1200_FLIP_LID 15
38#define GPIO15_A910_FLIP_LID 15
39#define GPIO12_E680_LOCK_SWITCH 12
40#define GPIO15_E6_LOCK_SWITCH 15
41
35static struct platform_pwm_backlight_data ezx_backlight_data = { 42static struct platform_pwm_backlight_data ezx_backlight_data = {
36 .pwm_id = 0, 43 .pwm_id = 0,
37 .max_brightness = 1023, 44 .max_brightness = 1023,
@@ -88,7 +95,7 @@ static struct pxafb_mach_info ezx_fb_info_2 = {
88 .lcd_conn = LCD_COLOR_TFT_18BPP, 95 .lcd_conn = LCD_COLOR_TFT_18BPP,
89}; 96};
90 97
91static struct platform_device *devices[] __initdata = { 98static struct platform_device *ezx_devices[] __initdata = {
92 &ezx_backlight_device, 99 &ezx_backlight_device,
93}; 100};
94 101
@@ -651,6 +658,35 @@ static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
651#endif /* CONFIG_MACH_EZX_E2 */ 658#endif /* CONFIG_MACH_EZX_E2 */
652 659
653#ifdef CONFIG_MACH_EZX_A780 660#ifdef CONFIG_MACH_EZX_A780
661/* gpio_keys */
662static struct gpio_keys_button a780_buttons[] = {
663 [0] = {
664 .code = SW_LID,
665 .gpio = GPIO12_A780_FLIP_LID,
666 .active_low = 0,
667 .desc = "A780 flip lid",
668 .type = EV_SW,
669 .wakeup = 1,
670 },
671};
672
673static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
674 .buttons = a780_buttons,
675 .nbuttons = ARRAY_SIZE(a780_buttons),
676};
677
678static struct platform_device a780_gpio_keys = {
679 .name = "gpio-keys",
680 .id = -1,
681 .dev = {
682 .platform_data = &a780_gpio_keys_platform_data,
683 },
684};
685
686static struct platform_device *a780_devices[] __initdata = {
687 &a780_gpio_keys,
688};
689
654static void __init a780_init(void) 690static void __init a780_init(void)
655{ 691{
656 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 692 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
@@ -663,7 +699,8 @@ static void __init a780_init(void)
663 699
664 pxa_set_keypad_info(&a780_keypad_platform_data); 700 pxa_set_keypad_info(&a780_keypad_platform_data);
665 701
666 platform_add_devices(devices, ARRAY_SIZE(devices)); 702 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
703 platform_add_devices(ARRAY_AND_SIZE(a780_devices));
667} 704}
668 705
669MACHINE_START(EZX_A780, "Motorola EZX A780") 706MACHINE_START(EZX_A780, "Motorola EZX A780")
@@ -678,10 +715,39 @@ MACHINE_END
678#endif 715#endif
679 716
680#ifdef CONFIG_MACH_EZX_E680 717#ifdef CONFIG_MACH_EZX_E680
718/* gpio_keys */
719static struct gpio_keys_button e680_buttons[] = {
720 [0] = {
721 .code = KEY_SCREENLOCK,
722 .gpio = GPIO12_E680_LOCK_SWITCH,
723 .active_low = 0,
724 .desc = "E680 lock switch",
725 .type = EV_KEY,
726 .wakeup = 1,
727 },
728};
729
730static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
731 .buttons = e680_buttons,
732 .nbuttons = ARRAY_SIZE(e680_buttons),
733};
734
735static struct platform_device e680_gpio_keys = {
736 .name = "gpio-keys",
737 .id = -1,
738 .dev = {
739 .platform_data = &e680_gpio_keys_platform_data,
740 },
741};
742
681static struct i2c_board_info __initdata e680_i2c_board_info[] = { 743static struct i2c_board_info __initdata e680_i2c_board_info[] = {
682 { I2C_BOARD_INFO("tea5767", 0x81) }, 744 { I2C_BOARD_INFO("tea5767", 0x81) },
683}; 745};
684 746
747static struct platform_device *e680_devices[] __initdata = {
748 &e680_gpio_keys,
749};
750
685static void __init e680_init(void) 751static void __init e680_init(void)
686{ 752{
687 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 753 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
@@ -695,7 +761,8 @@ static void __init e680_init(void)
695 761
696 pxa_set_keypad_info(&e680_keypad_platform_data); 762 pxa_set_keypad_info(&e680_keypad_platform_data);
697 763
698 platform_add_devices(devices, ARRAY_SIZE(devices)); 764 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
765 platform_add_devices(ARRAY_AND_SIZE(e680_devices));
699} 766}
700 767
701MACHINE_START(EZX_E680, "Motorola EZX E680") 768MACHINE_START(EZX_E680, "Motorola EZX E680")
@@ -710,10 +777,39 @@ MACHINE_END
710#endif 777#endif
711 778
712#ifdef CONFIG_MACH_EZX_A1200 779#ifdef CONFIG_MACH_EZX_A1200
780/* gpio_keys */
781static struct gpio_keys_button a1200_buttons[] = {
782 [0] = {
783 .code = SW_LID,
784 .gpio = GPIO15_A1200_FLIP_LID,
785 .active_low = 0,
786 .desc = "A1200 flip lid",
787 .type = EV_SW,
788 .wakeup = 1,
789 },
790};
791
792static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
793 .buttons = a1200_buttons,
794 .nbuttons = ARRAY_SIZE(a1200_buttons),
795};
796
797static struct platform_device a1200_gpio_keys = {
798 .name = "gpio-keys",
799 .id = -1,
800 .dev = {
801 .platform_data = &a1200_gpio_keys_platform_data,
802 },
803};
804
713static struct i2c_board_info __initdata a1200_i2c_board_info[] = { 805static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
714 { I2C_BOARD_INFO("tea5767", 0x81) }, 806 { I2C_BOARD_INFO("tea5767", 0x81) },
715}; 807};
716 808
809static struct platform_device *a1200_devices[] __initdata = {
810 &a1200_gpio_keys,
811};
812
717static void __init a1200_init(void) 813static void __init a1200_init(void)
718{ 814{
719 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 815 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
@@ -727,7 +823,8 @@ static void __init a1200_init(void)
727 823
728 pxa_set_keypad_info(&a1200_keypad_platform_data); 824 pxa_set_keypad_info(&a1200_keypad_platform_data);
729 825
730 platform_add_devices(devices, ARRAY_SIZE(devices)); 826 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
827 platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
731} 828}
732 829
733MACHINE_START(EZX_A1200, "Motorola EZX A1200") 830MACHINE_START(EZX_A1200, "Motorola EZX A1200")
@@ -742,6 +839,35 @@ MACHINE_END
742#endif 839#endif
743 840
744#ifdef CONFIG_MACH_EZX_A910 841#ifdef CONFIG_MACH_EZX_A910
842/* gpio_keys */
843static struct gpio_keys_button a910_buttons[] = {
844 [0] = {
845 .code = SW_LID,
846 .gpio = GPIO15_A910_FLIP_LID,
847 .active_low = 0,
848 .desc = "A910 flip lid",
849 .type = EV_SW,
850 .wakeup = 1,
851 },
852};
853
854static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
855 .buttons = a910_buttons,
856 .nbuttons = ARRAY_SIZE(a910_buttons),
857};
858
859static struct platform_device a910_gpio_keys = {
860 .name = "gpio-keys",
861 .id = -1,
862 .dev = {
863 .platform_data = &a910_gpio_keys_platform_data,
864 },
865};
866
867static struct platform_device *a910_devices[] __initdata = {
868 &a910_gpio_keys,
869};
870
745static void __init a910_init(void) 871static void __init a910_init(void)
746{ 872{
747 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 873 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
@@ -754,7 +880,8 @@ static void __init a910_init(void)
754 880
755 pxa_set_keypad_info(&a910_keypad_platform_data); 881 pxa_set_keypad_info(&a910_keypad_platform_data);
756 882
757 platform_add_devices(devices, ARRAY_SIZE(devices)); 883 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
884 platform_add_devices(ARRAY_AND_SIZE(a910_devices));
758} 885}
759 886
760MACHINE_START(EZX_A910, "Motorola EZX A910") 887MACHINE_START(EZX_A910, "Motorola EZX A910")
@@ -769,10 +896,39 @@ MACHINE_END
769#endif 896#endif
770 897
771#ifdef CONFIG_MACH_EZX_E6 898#ifdef CONFIG_MACH_EZX_E6
899/* gpio_keys */
900static struct gpio_keys_button e6_buttons[] = {
901 [0] = {
902 .code = KEY_SCREENLOCK,
903 .gpio = GPIO15_E6_LOCK_SWITCH,
904 .active_low = 0,
905 .desc = "E6 lock switch",
906 .type = EV_KEY,
907 .wakeup = 1,
908 },
909};
910
911static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
912 .buttons = e6_buttons,
913 .nbuttons = ARRAY_SIZE(e6_buttons),
914};
915
916static struct platform_device e6_gpio_keys = {
917 .name = "gpio-keys",
918 .id = -1,
919 .dev = {
920 .platform_data = &e6_gpio_keys_platform_data,
921 },
922};
923
772static struct i2c_board_info __initdata e6_i2c_board_info[] = { 924static struct i2c_board_info __initdata e6_i2c_board_info[] = {
773 { I2C_BOARD_INFO("tea5767", 0x81) }, 925 { I2C_BOARD_INFO("tea5767", 0x81) },
774}; 926};
775 927
928static struct platform_device *e6_devices[] __initdata = {
929 &e6_gpio_keys,
930};
931
776static void __init e6_init(void) 932static void __init e6_init(void)
777{ 933{
778 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 934 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
@@ -786,7 +942,8 @@ static void __init e6_init(void)
786 942
787 pxa_set_keypad_info(&e6_keypad_platform_data); 943 pxa_set_keypad_info(&e6_keypad_platform_data);
788 944
789 platform_add_devices(devices, ARRAY_SIZE(devices)); 945 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
946 platform_add_devices(ARRAY_AND_SIZE(e6_devices));
790} 947}
791 948
792MACHINE_START(EZX_E6, "Motorola EZX E6") 949MACHINE_START(EZX_E6, "Motorola EZX E6")
@@ -805,6 +962,9 @@ static struct i2c_board_info __initdata e2_i2c_board_info[] = {
805 { I2C_BOARD_INFO("tea5767", 0x81) }, 962 { I2C_BOARD_INFO("tea5767", 0x81) },
806}; 963};
807 964
965static struct platform_device *e2_devices[] __initdata = {
966};
967
808static void __init e2_init(void) 968static void __init e2_init(void)
809{ 969{
810 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 970 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
@@ -818,7 +978,8 @@ static void __init e2_init(void)
818 978
819 pxa_set_keypad_info(&e2_keypad_platform_data); 979 pxa_set_keypad_info(&e2_keypad_platform_data);
820 980
821 platform_add_devices(devices, ARRAY_SIZE(devices)); 981 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
982 platform_add_devices(ARRAY_AND_SIZE(e2_devices));
822} 983}
823 984
824MACHINE_START(EZX_E2, "Motorola EZX E2") 985MACHINE_START(EZX_E2, "Motorola EZX E2")
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
new file mode 100644
index 000000000000..7fff467e84fc
--- /dev/null
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -0,0 +1,851 @@
1/*
2 * Support for HP iPAQ hx4700 PDAs.
3 *
4 * Copyright (c) 2008-2009 Philipp Zabel
5 *
6 * Based on code:
7 * Copyright (c) 2004 Hewlett-Packard Company.
8 * Copyright (c) 2005 SDG Systems, LLC
9 * Copyright (c) 2006 Anton Vorontsov <cbou@mail.ru>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/platform_device.h>
20#include <linux/delay.h>
21#include <linux/fb.h>
22#include <linux/gpio.h>
23#include <linux/gpio_keys.h>
24#include <linux/input.h>
25#include <linux/lcd.h>
26#include <linux/mfd/htc-egpio.h>
27#include <linux/mfd/asic3.h>
28#include <linux/mtd/physmap.h>
29#include <linux/pda_power.h>
30#include <linux/pwm_backlight.h>
31#include <linux/regulator/bq24022.h>
32#include <linux/regulator/machine.h>
33#include <linux/spi/ads7846.h>
34#include <linux/spi/spi.h>
35#include <linux/usb/gpio_vbus.h>
36
37#include <mach/hardware.h>
38#include <asm/mach-types.h>
39#include <asm/mach/arch.h>
40
41#include <mach/pxa27x.h>
42#include <mach/hx4700.h>
43#include <plat/i2c.h>
44#include <mach/irda.h>
45#include <mach/pxa2xx_spi.h>
46
47#include <video/w100fb.h>
48
49#include "devices.h"
50#include "generic.h"
51
52/* Physical address space information */
53
54#define ATI_W3220_PHYS PXA_CS2_PHYS /* ATI Imageon 3220 Graphics */
55#define ASIC3_PHYS PXA_CS3_PHYS
56#define ASIC3_SD_PHYS (PXA_CS3_PHYS + 0x02000000)
57
58static unsigned long hx4700_pin_config[] __initdata = {
59
60 /* SDRAM and Static Memory I/O Signals */
61 GPIO20_nSDCS_2,
62 GPIO21_nSDCS_3,
63 GPIO15_nCS_1,
64 GPIO78_nCS_2, /* W3220 */
65 GPIO79_nCS_3, /* ASIC3 */
66 GPIO80_nCS_4,
67 GPIO33_nCS_5, /* EGPIO, WLAN */
68
69 /* PC CARD */
70 GPIO48_nPOE,
71 GPIO49_nPWE,
72 GPIO50_nPIOR,
73 GPIO51_nPIOW,
74 GPIO54_nPCE_2,
75 GPIO55_nPREG,
76 GPIO56_nPWAIT,
77 GPIO57_nIOIS16,
78 GPIO85_nPCE_1,
79 GPIO104_PSKTSEL,
80
81 /* I2C */
82 GPIO117_I2C_SCL,
83 GPIO118_I2C_SDA,
84
85 /* FFUART (RS-232) */
86 GPIO34_FFUART_RXD,
87 GPIO35_FFUART_CTS,
88 GPIO36_FFUART_DCD,
89 GPIO37_FFUART_DSR,
90 GPIO38_FFUART_RI,
91 GPIO39_FFUART_TXD,
92 GPIO40_FFUART_DTR,
93 GPIO41_FFUART_RTS,
94
95 /* BTUART */
96 GPIO42_BTUART_RXD,
97 GPIO43_BTUART_TXD,
98 GPIO44_BTUART_CTS,
99 GPIO45_BTUART_RTS,
100
101 /* PWM 1 (Backlight) */
102 GPIO17_PWM1_OUT,
103
104 /* I2S */
105 GPIO28_I2S_BITCLK_OUT,
106 GPIO29_I2S_SDATA_IN,
107 GPIO30_I2S_SDATA_OUT,
108 GPIO31_I2S_SYNC,
109 GPIO113_I2S_SYSCLK,
110
111 /* SSP 1 (NavPoint) */
112 GPIO23_SSP1_SCLK,
113 GPIO24_SSP1_SFRM,
114 GPIO25_SSP1_TXD,
115 GPIO26_SSP1_RXD,
116
117 /* SSP 2 (TSC2046) */
118 GPIO19_SSP2_SCLK,
119 GPIO86_SSP2_RXD,
120 GPIO87_SSP2_TXD,
121 GPIO88_GPIO,
122
123 /* HX4700 specific input GPIOs */
124 GPIO12_GPIO, /* ASIC3_IRQ */
125 GPIO13_GPIO, /* W3220_IRQ */
126 GPIO14_GPIO, /* nWLAN_IRQ */
127
128 GPIO10_GPIO, /* GSM_IRQ */
129 GPIO13_GPIO, /* CPLD_IRQ */
130 GPIO107_GPIO, /* DS1WM_IRQ */
131 GPIO108_GPIO, /* GSM_READY */
132 GPIO58_GPIO, /* TSC2046_nPENIRQ */
133 GPIO66_GPIO, /* nSDIO_IRQ */
134};
135
136#define HX4700_GPIO_IN(num, _desc) \
137 { .gpio = (num), .dir = 0, .desc = (_desc) }
138#define HX4700_GPIO_OUT(num, _init, _desc) \
139 { .gpio = (num), .dir = 1, .init = (_init), .desc = (_desc) }
140struct gpio_ress {
141 unsigned gpio : 8;
142 unsigned dir : 1;
143 unsigned init : 1;
144 char *desc;
145};
146
147static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
148{
149 int i, rc = 0;
150 int gpio;
151 int dir;
152
153 for (i = 0; (!rc) && (i < size); i++) {
154 gpio = gpios[i].gpio;
155 dir = gpios[i].dir;
156 rc = gpio_request(gpio, gpios[i].desc);
157 if (rc) {
158 pr_err("Error requesting GPIO %d(%s) : %d\n",
159 gpio, gpios[i].desc, rc);
160 continue;
161 }
162 if (dir)
163 gpio_direction_output(gpio, gpios[i].init);
164 else
165 gpio_direction_input(gpio);
166 }
167 while ((rc) && (--i >= 0))
168 gpio_free(gpios[i].gpio);
169 return rc;
170}
171
172/*
173 * IRDA
174 */
175
176static void irda_transceiver_mode(struct device *dev, int mode)
177{
178 gpio_set_value(GPIO105_HX4700_nIR_ON, mode & IR_OFF);
179}
180
181static struct pxaficp_platform_data ficp_info = {
182 .transceiver_cap = IR_SIRMODE | IR_OFF,
183 .transceiver_mode = irda_transceiver_mode,
184};
185
186/*
187 * GPIO Keys
188 */
189
190#define INIT_KEY(_code, _gpio, _active_low, _desc) \
191 { \
192 .code = KEY_##_code, \
193 .gpio = _gpio, \
194 .active_low = _active_low, \
195 .desc = _desc, \
196 .type = EV_KEY, \
197 .wakeup = 1, \
198 }
199
200static struct gpio_keys_button gpio_keys_buttons[] = {
201 INIT_KEY(POWER, GPIO0_HX4700_nKEY_POWER, 1, "Power button"),
202 INIT_KEY(MAIL, GPIO94_HX4700_KEY_MAIL, 0, "Mail button"),
203 INIT_KEY(ADDRESSBOOK, GPIO99_HX4700_KEY_CONTACTS,0, "Contacts button"),
204 INIT_KEY(RECORD, GPIOD6_nKEY_RECORD, 1, "Record button"),
205 INIT_KEY(CALENDAR, GPIOD1_nKEY_CALENDAR, 1, "Calendar button"),
206 INIT_KEY(HOMEPAGE, GPIOD3_nKEY_HOME, 1, "Home button"),
207};
208
209static struct gpio_keys_platform_data gpio_keys_data = {
210 .buttons = gpio_keys_buttons,
211 .nbuttons = ARRAY_SIZE(gpio_keys_buttons),
212};
213
214static struct platform_device gpio_keys = {
215 .name = "gpio-keys",
216 .dev = {
217 .platform_data = &gpio_keys_data,
218 },
219 .id = -1,
220};
221
222/*
223 * ASIC3
224 */
225
226static u16 asic3_gpio_config[] = {
227 /* ASIC3 GPIO banks A and B along with some of C and D
228 implement the buffering for the CF slot. */
229 ASIC3_CONFIG_GPIO(0, 1, 1, 0),
230 ASIC3_CONFIG_GPIO(1, 1, 1, 0),
231 ASIC3_CONFIG_GPIO(2, 1, 1, 0),
232 ASIC3_CONFIG_GPIO(3, 1, 1, 0),
233 ASIC3_CONFIG_GPIO(4, 1, 1, 0),
234 ASIC3_CONFIG_GPIO(5, 1, 1, 0),
235 ASIC3_CONFIG_GPIO(6, 1, 1, 0),
236 ASIC3_CONFIG_GPIO(7, 1, 1, 0),
237 ASIC3_CONFIG_GPIO(8, 1, 1, 0),
238 ASIC3_CONFIG_GPIO(9, 1, 1, 0),
239 ASIC3_CONFIG_GPIO(10, 1, 1, 0),
240 ASIC3_CONFIG_GPIO(11, 1, 1, 0),
241 ASIC3_CONFIG_GPIO(12, 1, 1, 0),
242 ASIC3_CONFIG_GPIO(13, 1, 1, 0),
243 ASIC3_CONFIG_GPIO(14, 1, 1, 0),
244 ASIC3_CONFIG_GPIO(15, 1, 1, 0),
245
246 ASIC3_CONFIG_GPIO(16, 1, 1, 0),
247 ASIC3_CONFIG_GPIO(17, 1, 1, 0),
248 ASIC3_CONFIG_GPIO(18, 1, 1, 0),
249 ASIC3_CONFIG_GPIO(19, 1, 1, 0),
250 ASIC3_CONFIG_GPIO(20, 1, 1, 0),
251 ASIC3_CONFIG_GPIO(21, 1, 1, 0),
252 ASIC3_CONFIG_GPIO(22, 1, 1, 0),
253 ASIC3_CONFIG_GPIO(23, 1, 1, 0),
254 ASIC3_CONFIG_GPIO(24, 1, 1, 0),
255 ASIC3_CONFIG_GPIO(25, 1, 1, 0),
256 ASIC3_CONFIG_GPIO(26, 1, 1, 0),
257 ASIC3_CONFIG_GPIO(27, 1, 1, 0),
258 ASIC3_CONFIG_GPIO(28, 1, 1, 0),
259 ASIC3_CONFIG_GPIO(29, 1, 1, 0),
260 ASIC3_CONFIG_GPIO(30, 1, 1, 0),
261 ASIC3_CONFIG_GPIO(31, 1, 1, 0),
262
263 /* GPIOC - CF, LEDs, SD */
264 ASIC3_GPIOC0_LED0, /* red */
265 ASIC3_GPIOC1_LED1, /* green */
266 ASIC3_GPIOC2_LED2, /* blue */
267 ASIC3_GPIOC4_CF_nCD,
268 ASIC3_GPIOC5_nCIOW,
269 ASIC3_GPIOC6_nCIOR,
270 ASIC3_GPIOC7_nPCE_1,
271 ASIC3_GPIOC8_nPCE_2,
272 ASIC3_GPIOC9_nPOE,
273 ASIC3_GPIOC10_nPWE,
274 ASIC3_GPIOC11_PSKTSEL,
275 ASIC3_GPIOC12_nPREG,
276 ASIC3_GPIOC13_nPWAIT,
277 ASIC3_GPIOC14_nPIOIS16,
278 ASIC3_GPIOC15_nPIOR,
279
280 /* GPIOD: input GPIOs, CF */
281 ASIC3_GPIOD11_nCIOIS16,
282 ASIC3_GPIOD12_nCWAIT,
283 ASIC3_GPIOD15_nPIOW,
284};
285
286static struct resource asic3_resources[] = {
287 /* GPIO part */
288 [0] = {
289 .start = ASIC3_PHYS,
290 .end = ASIC3_PHYS + ASIC3_MAP_SIZE_16BIT - 1,
291 .flags = IORESOURCE_MEM,
292 },
293 [1] = {
294 .start = gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
295 .end = gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
296 .flags = IORESOURCE_IRQ,
297 },
298 /* SD part */
299 [2] = {
300 .start = ASIC3_SD_PHYS,
301 .end = ASIC3_SD_PHYS + ASIC3_MAP_SIZE_16BIT - 1,
302 .flags = IORESOURCE_MEM,
303 },
304 [3] = {
305 .start = gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
306 .end = gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
307 .flags = IORESOURCE_IRQ,
308 },
309};
310
311static struct asic3_platform_data asic3_platform_data = {
312 .gpio_config = asic3_gpio_config,
313 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config),
314 .irq_base = IRQ_BOARD_START,
315 .gpio_base = HX4700_ASIC3_GPIO_BASE,
316};
317
318static struct platform_device asic3 = {
319 .name = "asic3",
320 .id = -1,
321 .resource = asic3_resources,
322 .num_resources = ARRAY_SIZE(asic3_resources),
323 .dev = {
324 .platform_data = &asic3_platform_data,
325 },
326};
327
328/*
329 * EGPIO
330 */
331
332static struct resource egpio_resources[] = {
333 [0] = {
334 .start = PXA_CS5_PHYS,
335 .end = PXA_CS5_PHYS + 0x4 - 1,
336 .flags = IORESOURCE_MEM,
337 },
338};
339
340static struct htc_egpio_chip egpio_chips[] = {
341 [0] = {
342 .reg_start = 0,
343 .gpio_base = HX4700_EGPIO_BASE,
344 .num_gpios = 8,
345 .direction = HTC_EGPIO_OUTPUT,
346 },
347};
348
349static struct htc_egpio_platform_data egpio_info = {
350 .reg_width = 16,
351 .bus_width = 16,
352 .chip = egpio_chips,
353 .num_chips = ARRAY_SIZE(egpio_chips),
354};
355
356static struct platform_device egpio = {
357 .name = "htc-egpio",
358 .id = -1,
359 .resource = egpio_resources,
360 .num_resources = ARRAY_SIZE(egpio_resources),
361 .dev = {
362 .platform_data = &egpio_info,
363 },
364};
365
366/*
367 * LCD - Sony display connected to ATI Imageon w3220
368 */
369
370static int lcd_power;
371
372static void sony_lcd_init(void)
373{
374 gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
375 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
376 gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 0);
377 gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 0);
378 gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
379 mdelay(10);
380 gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
381 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
382 mdelay(20);
383
384 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1);
385 mdelay(5);
386 gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1);
387
388 /* FIXME: init w3220 registers here */
389
390 mdelay(5);
391 gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 1);
392 mdelay(10);
393 gpio_set_value(GPIO62_HX4700_LCD_nRESET, 1);
394 mdelay(10);
395 gpio_set_value(GPIO59_HX4700_LCD_PC1, 1);
396 mdelay(10);
397 gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 1);
398}
399
400static void sony_lcd_off(void)
401{
402 gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
403 gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
404 mdelay(10);
405 gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 0);
406 mdelay(10);
407 gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 0);
408 mdelay(10);
409 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
410}
411
412static int hx4700_lcd_set_power(struct lcd_device *ldev, int level)
413{
414 switch (level) {
415 case FB_BLANK_UNBLANK:
416 sony_lcd_init();
417 break;
418 case FB_BLANK_NORMAL:
419 case FB_BLANK_VSYNC_SUSPEND:
420 case FB_BLANK_HSYNC_SUSPEND:
421 case FB_BLANK_POWERDOWN:
422 sony_lcd_off();
423 break;
424 }
425 lcd_power = level;
426 return 0;
427}
428
429static int hx4700_lcd_get_power(struct lcd_device *lm)
430{
431 return lcd_power;
432}
433
434static struct lcd_ops hx4700_lcd_ops = {
435 .get_power = hx4700_lcd_get_power,
436 .set_power = hx4700_lcd_set_power,
437};
438
439static struct lcd_device *hx4700_lcd_device;
440
441#ifdef CONFIG_PM
442static void w3220_lcd_suspend(struct w100fb_par *wfb)
443{
444 sony_lcd_off();
445}
446
447static void w3220_lcd_resume(struct w100fb_par *wfb)
448{
449 sony_lcd_init();
450}
451#else
452#define w3220_lcd_resume NULL
453#define w3220_lcd_suspend NULL
454#endif
455
456static struct w100_tg_info w3220_tg_info = {
457 .suspend = w3220_lcd_suspend,
458 .resume = w3220_lcd_resume,
459};
460
461/* W3220_VGA QVGA */
462static struct w100_gen_regs w3220_regs = {
463 .lcd_format = 0x00000003,
464 .lcdd_cntl1 = 0x00000000,
465 .lcdd_cntl2 = 0x0003ffff,
466 .genlcd_cntl1 = 0x00abf003, /* 0x00fff003 */
467 .genlcd_cntl2 = 0x00000003,
468 .genlcd_cntl3 = 0x000102aa,
469};
470
471static struct w100_mode w3220_modes[] = {
472{
473 .xres = 480,
474 .yres = 640,
475 .left_margin = 15,
476 .right_margin = 16,
477 .upper_margin = 8,
478 .lower_margin = 7,
479 .crtc_ss = 0x00000000,
480 .crtc_ls = 0xa1ff01f9, /* 0x21ff01f9 */
481 .crtc_gs = 0xc0000000, /* 0x40000000 */
482 .crtc_vpos_gs = 0x0000028f,
483 .crtc_ps1_active = 0x00000000, /* 0x41060010 */
484 .crtc_rev = 0,
485 .crtc_dclk = 0x80000000,
486 .crtc_gclk = 0x040a0104,
487 .crtc_goe = 0,
488 .pll_freq = 95,
489 .pixclk_divider = 4,
490 .pixclk_divider_rotated = 4,
491 .pixclk_src = CLK_SRC_PLL,
492 .sysclk_divider = 0,
493 .sysclk_src = CLK_SRC_PLL,
494},
495{
496 .xres = 240,
497 .yres = 320,
498 .left_margin = 9,
499 .right_margin = 8,
500 .upper_margin = 5,
501 .lower_margin = 4,
502 .crtc_ss = 0x80150014,
503 .crtc_ls = 0xa0fb00f7,
504 .crtc_gs = 0xc0080007,
505 .crtc_vpos_gs = 0x00080007,
506 .crtc_rev = 0x0000000a,
507 .crtc_dclk = 0x81700030,
508 .crtc_gclk = 0x8015010f,
509 .crtc_goe = 0x00000000,
510 .pll_freq = 95,
511 .pixclk_divider = 4,
512 .pixclk_divider_rotated = 4,
513 .pixclk_src = CLK_SRC_PLL,
514 .sysclk_divider = 0,
515 .sysclk_src = CLK_SRC_PLL,
516},
517};
518
519struct w100_mem_info w3220_mem_info = {
520 .ext_cntl = 0x09640011,
521 .sdram_mode_reg = 0x00600021,
522 .ext_timing_cntl = 0x1a001545, /* 0x15001545 */
523 .io_cntl = 0x7ddd7333,
524 .size = 0x1fffff,
525};
526
527struct w100_bm_mem_info w3220_bm_mem_info = {
528 .ext_mem_bw = 0x50413e01,
529 .offset = 0,
530 .ext_timing_ctl = 0x00043f7f,
531 .ext_cntl = 0x00000010,
532 .mode_reg = 0x00250000,
533 .io_cntl = 0x0fff0000,
534 .config = 0x08301480,
535};
536
537static struct w100_gpio_regs w3220_gpio_info = {
538 .init_data1 = 0xdfe00100, /* GPIO_DATA */
539 .gpio_dir1 = 0xffff0000, /* GPIO_CNTL1 */
540 .gpio_oe1 = 0x00000000, /* GPIO_CNTL2 */
541 .init_data2 = 0x00000000, /* GPIO_DATA2 */
542 .gpio_dir2 = 0x00000000, /* GPIO_CNTL3 */
543 .gpio_oe2 = 0x00000000, /* GPIO_CNTL4 */
544};
545
546static struct w100fb_mach_info w3220_info = {
547 .tg = &w3220_tg_info,
548 .mem = &w3220_mem_info,
549 .bm_mem = &w3220_bm_mem_info,
550 .gpio = &w3220_gpio_info,
551 .regs = &w3220_regs,
552 .modelist = w3220_modes,
553 .num_modes = 2,
554 .xtal_freq = 16000000,
555};
556
557static struct resource w3220_resources[] = {
558 [0] = {
559 .start = ATI_W3220_PHYS,
560 .end = ATI_W3220_PHYS + 0x00ffffff,
561 .flags = IORESOURCE_MEM,
562 },
563};
564
565static struct platform_device w3220 = {
566 .name = "w100fb",
567 .id = -1,
568 .dev = {
569 .platform_data = &w3220_info,
570 },
571 .num_resources = ARRAY_SIZE(w3220_resources),
572 .resource = w3220_resources,
573};
574
575/*
576 * Backlight
577 */
578
579static struct platform_pwm_backlight_data backlight_data = {
580 .pwm_id = 1,
581 .max_brightness = 200,
582 .dft_brightness = 100,
583 .pwm_period_ns = 30923,
584};
585
586static struct platform_device backlight = {
587 .name = "pwm-backlight",
588 .id = -1,
589 .dev = {
590 .parent = &pxa27x_device_pwm1.dev,
591 .platform_data = &backlight_data,
592 },
593};
594
595/*
596 * USB "Transceiver"
597 */
598
599static struct gpio_vbus_mach_info gpio_vbus_info = {
600 .gpio_pullup = GPIO76_HX4700_USBC_PUEN,
601 .gpio_vbus = GPIOD14_nUSBC_DETECT,
602 .gpio_vbus_inverted = 1,
603};
604
605static struct platform_device gpio_vbus = {
606 .name = "gpio-vbus",
607 .id = -1,
608 .dev = {
609 .platform_data = &gpio_vbus_info,
610 },
611};
612
613/*
614 * Touchscreen - TSC2046 connected to SSP2
615 */
616
617static const struct ads7846_platform_data tsc2046_info = {
618 .model = 7846,
619 .vref_delay_usecs = 100,
620 .pressure_max = 512,
621 .debounce_max = 10,
622 .debounce_tol = 3,
623 .debounce_rep = 1,
624 .gpio_pendown = GPIO58_HX4700_TSC2046_nPENIRQ,
625};
626
627static struct pxa2xx_spi_chip tsc2046_chip = {
628 .tx_threshold = 1,
629 .rx_threshold = 2,
630 .timeout = 64,
631 .gpio_cs = GPIO88_HX4700_TSC2046_CS,
632};
633
634static struct spi_board_info tsc2046_board_info[] __initdata = {
635 {
636 .modalias = "ads7846",
637 .bus_num = 2,
638 .max_speed_hz = 2600000, /* 100 kHz sample rate */
639 .irq = gpio_to_irq(GPIO58_HX4700_TSC2046_nPENIRQ),
640 .platform_data = &tsc2046_info,
641 .controller_data = &tsc2046_chip,
642 },
643};
644
645static struct pxa2xx_spi_master pxa_ssp2_master_info = {
646 .num_chipselect = 1,
647 .clock_enable = CKEN_SSP2,
648 .enable_dma = 1,
649};
650
651/*
652 * External power
653 */
654
655static int power_supply_init(struct device *dev)
656{
657 return gpio_request(GPIOD9_nAC_IN, "AC charger detect");
658}
659
660static int hx4700_is_ac_online(void)
661{
662 return !gpio_get_value(GPIOD9_nAC_IN);
663}
664
665static void power_supply_exit(struct device *dev)
666{
667 gpio_free(GPIOD9_nAC_IN);
668}
669
670static char *hx4700_supplicants[] = {
671 "ds2760-battery.0", "backup-battery"
672};
673
674static struct pda_power_pdata power_supply_info = {
675 .init = power_supply_init,
676 .is_ac_online = hx4700_is_ac_online,
677 .exit = power_supply_exit,
678 .supplied_to = hx4700_supplicants,
679 .num_supplicants = ARRAY_SIZE(hx4700_supplicants),
680};
681
682static struct resource power_supply_resources[] = {
683 [0] = {
684 .name = "ac",
685 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
686 IORESOURCE_IRQ_LOWEDGE,
687 .start = gpio_to_irq(GPIOD9_nAC_IN),
688 .end = gpio_to_irq(GPIOD9_nAC_IN),
689 },
690 [1] = {
691 .name = "usb",
692 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
693 IORESOURCE_IRQ_LOWEDGE,
694 .start = gpio_to_irq(GPIOD14_nUSBC_DETECT),
695 .end = gpio_to_irq(GPIOD14_nUSBC_DETECT),
696 },
697};
698
699static struct platform_device power_supply = {
700 .name = "pda-power",
701 .id = -1,
702 .dev = {
703 .platform_data = &power_supply_info,
704 },
705 .resource = power_supply_resources,
706 .num_resources = ARRAY_SIZE(power_supply_resources),
707};
708
709/*
710 * Battery charger
711 */
712
713static struct regulator_consumer_supply bq24022_consumers[] = {
714 {
715 .dev = &gpio_vbus.dev,
716 .supply = "vbus_draw",
717 },
718 {
719 .dev = &power_supply.dev,
720 .supply = "ac_draw",
721 },
722};
723
724static struct regulator_init_data bq24022_init_data = {
725 .constraints = {
726 .max_uA = 500000,
727 .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
728 },
729 .num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
730 .consumer_supplies = bq24022_consumers,
731};
732
733static struct bq24022_mach_info bq24022_info = {
734 .gpio_nce = GPIO72_HX4700_BQ24022_nCHARGE_EN,
735 .gpio_iset2 = GPIO96_HX4700_BQ24022_ISET2,
736 .init_data = &bq24022_init_data,
737};
738
739static struct platform_device bq24022 = {
740 .name = "bq24022",
741 .id = -1,
742 .dev = {
743 .platform_data = &bq24022_info,
744 },
745};
746
747/*
748 * StrataFlash
749 */
750
751static void hx4700_set_vpp(struct map_info *map, int vpp)
752{
753 gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
754}
755
756static struct resource strataflash_resource = {
757 .start = PXA_CS0_PHYS,
758 .end = PXA_CS0_PHYS + SZ_128M - 1,
759 .flags = IORESOURCE_MEM,
760};
761
762static struct physmap_flash_data strataflash_data = {
763 .width = 4,
764 .set_vpp = hx4700_set_vpp,
765};
766
767static struct platform_device strataflash = {
768 .name = "physmap-flash",
769 .id = -1,
770 .resource = &strataflash_resource,
771 .num_resources = 1,
772 .dev = {
773 .platform_data = &strataflash_data,
774 },
775};
776
777/*
778 * PCMCIA
779 */
780
781static struct platform_device pcmcia = {
782 .name = "hx4700-pcmcia",
783 .dev = {
784 .parent = &asic3.dev,
785 },
786};
787
788/*
789 * Platform devices
790 */
791
792static struct platform_device *devices[] __initdata = {
793 &asic3,
794 &gpio_keys,
795 &backlight,
796 &w3220,
797 &egpio,
798 &bq24022,
799 &gpio_vbus,
800 &power_supply,
801 &strataflash,
802 &pcmcia,
803};
804
805static struct gpio_ress global_gpios[] = {
806 HX4700_GPIO_IN(GPIO12_HX4700_ASIC3_IRQ, "ASIC3_IRQ"),
807 HX4700_GPIO_IN(GPIO13_HX4700_W3220_IRQ, "W3220_IRQ"),
808 HX4700_GPIO_IN(GPIO14_HX4700_nWLAN_IRQ, "WLAN_IRQ"),
809 HX4700_GPIO_OUT(GPIO59_HX4700_LCD_PC1, 1, "LCD_PC1"),
810 HX4700_GPIO_OUT(GPIO62_HX4700_LCD_nRESET, 1, "LCD_RESET"),
811 HX4700_GPIO_OUT(GPIO70_HX4700_LCD_SLIN1, 1, "LCD_SLIN1"),
812 HX4700_GPIO_OUT(GPIO84_HX4700_LCD_SQN, 1, "LCD_SQN"),
813 HX4700_GPIO_OUT(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1, "LCD_LVDD"),
814 HX4700_GPIO_OUT(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1, "LCD_AVDD"),
815 HX4700_GPIO_OUT(GPIO32_HX4700_RS232_ON, 1, "RS232_ON"),
816 HX4700_GPIO_OUT(GPIO71_HX4700_ASIC3_nRESET, 1, "ASIC3_nRESET"),
817 HX4700_GPIO_OUT(GPIO82_HX4700_EUART_RESET, 1, "EUART_RESET"),
818 HX4700_GPIO_OUT(GPIO105_HX4700_nIR_ON, 1, "nIR_EN"),
819};
820
821static void __init hx4700_init(void)
822{
823 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
824 hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
825
826 platform_add_devices(devices, ARRAY_SIZE(devices));
827
828 pxa_set_ficp_info(&ficp_info);
829 pxa27x_set_i2c_power_info(NULL);
830 pxa_set_i2c_info(NULL);
831 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
832 spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
833
834 hx4700_lcd_device = lcd_device_register("w100fb", NULL,
835 (void *)&w3220_info, &hx4700_lcd_ops);
836
837 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0);
838 mdelay(10);
839 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1);
840 mdelay(10);
841}
842
843MACHINE_START(H4700, "HP iPAQ HX4700")
844 .phys_io = 0x40000000,
845 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
846 .boot_params = 0xa0000100,
847 .map_io = pxa_map_io,
848 .init_irq = pxa27x_init_irq,
849 .init_machine = hx4700_init,
850 .timer = &pxa_timer,
851MACHINE_END
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
index 2b27336c29f1..961807dc6467 100644
--- a/arch/arm/mach-pxa/imote2.c
+++ b/arch/arm/mach-pxa/imote2.c
@@ -22,6 +22,7 @@
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/mfd/da903x.h> 24#include <linux/mfd/da903x.h>
25#include <linux/sht15.h>
25 26
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -29,7 +30,7 @@
29#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
30 31
31#include <mach/pxa27x.h> 32#include <mach/pxa27x.h>
32#include <mach/i2c.h> 33#include <plat/i2c.h>
33#include <mach/udc.h> 34#include <mach/udc.h>
34#include <mach/mmc.h> 35#include <mach/mmc.h>
35#include <mach/pxa2xx_spi.h> 36#include <mach/pxa2xx_spi.h>
@@ -102,6 +103,10 @@ static unsigned long imote2_pin_config[] __initdata = {
102 GPIO96_GPIO, /* accelerometer interrupt */ 103 GPIO96_GPIO, /* accelerometer interrupt */
103 GPIO99_GPIO, /* ADC interrupt */ 104 GPIO99_GPIO, /* ADC interrupt */
104 105
106 /* SHT15 */
107 GPIO100_GPIO,
108 GPIO98_GPIO,
109
105 /* Connector pins specified as gpios */ 110 /* Connector pins specified as gpios */
106 GPIO94_GPIO, /* large basic connector pin 14 */ 111 GPIO94_GPIO, /* large basic connector pin 14 */
107 GPIO10_GPIO, /* large basic connector pin 23 */ 112 GPIO10_GPIO, /* large basic connector pin 23 */
@@ -112,6 +117,26 @@ static unsigned long imote2_pin_config[] __initdata = {
112 GPIO105_GPIO, /* blue led */ 117 GPIO105_GPIO, /* blue led */
113}; 118};
114 119
120static struct sht15_platform_data platform_data_sht15 = {
121 .gpio_data = 100,
122 .gpio_sck = 98,
123};
124
125static struct platform_device sht15 = {
126 .name = "sht15",
127 .id = -1,
128 .dev = {
129 .platform_data = &platform_data_sht15,
130 },
131};
132
133static struct regulator_consumer_supply imote2_sensor_3_con[] = {
134 {
135 .dev = &sht15.dev,
136 .supply = "vcc",
137 },
138};
139
115static struct gpio_led imote2_led_pins[] = { 140static struct gpio_led imote2_led_pins[] = {
116 { 141 {
117 .name = "imote2:red", 142 .name = "imote2:red",
@@ -257,6 +282,8 @@ static struct regulator_init_data imote2_ldo_init_data[] = {
257 .min_uV = 2800000, 282 .min_uV = 2800000,
258 .max_uV = 3000000, 283 .max_uV = 3000000,
259 }, 284 },
285 .num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con),
286 .consumer_supplies = imote2_sensor_3_con,
260 }, 287 },
261 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/ 288 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/
262 .constraints = { 289 .constraints = {
@@ -432,6 +459,9 @@ static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
432 .type = "tmp175", 459 .type = "tmp175",
433 .addr = 0x4A, 460 .addr = 0x4A,
434 .irq = IRQ_GPIO(96), 461 .irq = IRQ_GPIO(96),
462 }, { /* IMB400 Multimedia board */
463 .type = "wm8940",
464 .addr = 0x1A,
435 }, 465 },
436}; 466};
437 467
@@ -456,25 +486,12 @@ static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
456 .num_chipselect = 1, 486 .num_chipselect = 1,
457}; 487};
458 488
459/* Patch posted by Eric Miao <eric.miao@marvell.com> will remove
460 * the need for these functions.
461 */
462static void spi1control(u32 command)
463{
464 gpio_set_value(24, command & PXA2XX_CS_ASSERT ? 0 : 1);
465};
466
467static void spi3control(u32 command)
468{
469 gpio_set_value(39, command & PXA2XX_CS_ASSERT ? 0 : 1);
470};
471
472static struct pxa2xx_spi_chip staccel_chip_info = { 489static struct pxa2xx_spi_chip staccel_chip_info = {
473 .tx_threshold = 8, 490 .tx_threshold = 8,
474 .rx_threshold = 8, 491 .rx_threshold = 8,
475 .dma_burst_size = 8, 492 .dma_burst_size = 8,
476 .timeout = 235, 493 .timeout = 235,
477 .cs_control = spi1control, 494 .gpio_cs = 24,
478}; 495};
479 496
480static struct pxa2xx_spi_chip cc2420_info = { 497static struct pxa2xx_spi_chip cc2420_info = {
@@ -482,7 +499,7 @@ static struct pxa2xx_spi_chip cc2420_info = {
482 .rx_threshold = 8, 499 .rx_threshold = 8,
483 .dma_burst_size = 8, 500 .dma_burst_size = 8,
484 .timeout = 235, 501 .timeout = 235,
485 .cs_control = spi3control, 502 .gpio_cs = 39,
486}; 503};
487 504
488static struct spi_board_info spi_board_info[] __initdata = { 505static struct spi_board_info spi_board_info[] __initdata = {
@@ -521,6 +538,7 @@ static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
521static struct platform_device *imote2_devices[] = { 538static struct platform_device *imote2_devices[] = {
522 &imote2_flash_device, 539 &imote2_flash_device,
523 &imote2_leds, 540 &imote2_leds,
541 &sht15,
524}; 542};
525 543
526static struct i2c_pxa_platform_data i2c_pwr_pdata = { 544static struct i2c_pxa_platform_data i2c_pwr_pdata = {
@@ -538,8 +556,6 @@ static void __init imote2_init(void)
538 /* SPI chip select directions - all other directions should 556 /* SPI chip select directions - all other directions should
539 * be handled by drivers.*/ 557 * be handled by drivers.*/
540 gpio_direction_output(37, 0); 558 gpio_direction_output(37, 0);
541 gpio_direction_output(24, 0);
542 gpio_direction_output(39, 0);
543 559
544 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices)); 560 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
545 561
diff --git a/arch/arm/mach-pxa/include/mach/hx4700.h b/arch/arm/mach-pxa/include/mach/hx4700.h
new file mode 100644
index 000000000000..9eaeed1f87f1
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/hx4700.h
@@ -0,0 +1,131 @@
1/*
2 * GPIO and IRQ definitions for HP iPAQ hx4700
3 *
4 * Copyright (c) 2008 Philipp Zabel
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef _HX4700_H_
13#define _HX4700_H_
14
15#include <linux/gpio.h>
16#include <linux/mfd/asic3.h>
17
18#define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO
19#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
20
21/*
22 * PXA GPIOs
23 */
24
25#define GPIO0_HX4700_nKEY_POWER 0
26#define GPIO12_HX4700_ASIC3_IRQ 12
27#define GPIO13_HX4700_W3220_IRQ 13
28#define GPIO14_HX4700_nWLAN_IRQ 14
29#define GPIO18_HX4700_RDY 18
30#define GPIO22_HX4700_LCD_RL 22
31#define GPIO27_HX4700_CODEC_ON 27
32#define GPIO32_HX4700_RS232_ON 32
33#define GPIO52_HX4700_CPU_nBATT_FAULT 52
34#define GPIO58_HX4700_TSC2046_nPENIRQ 58
35#define GPIO59_HX4700_LCD_PC1 59
36#define GPIO60_HX4700_CF_RNB 60
37#define GPIO61_HX4700_W3220_nRESET 61
38#define GPIO62_HX4700_LCD_nRESET 62
39#define GPIO63_HX4700_CPU_SS_nRESET 63
40#define GPIO65_HX4700_TSC2046_PEN_PU 65
41#define GPIO66_HX4700_ASIC3_nSDIO_IRQ 66
42#define GPIO67_HX4700_EUART_PS 67
43#define GPIO70_HX4700_LCD_SLIN1 70
44#define GPIO71_HX4700_ASIC3_nRESET 71
45#define GPIO72_HX4700_BQ24022_nCHARGE_EN 72
46#define GPIO73_HX4700_LCD_UD_1 73
47#define GPIO75_HX4700_EARPHONE_nDET 75
48#define GPIO76_HX4700_USBC_PUEN 76
49#define GPIO81_HX4700_CPU_GP_nRESET 81
50#define GPIO82_HX4700_EUART_RESET 82
51#define GPIO83_HX4700_WLAN_nRESET 83
52#define GPIO84_HX4700_LCD_SQN 84
53#define GPIO85_HX4700_nPCE1 85
54#define GPIO88_HX4700_TSC2046_CS 88
55#define GPIO91_HX4700_FLASH_VPEN 91
56#define GPIO92_HX4700_HP_DRIVER 92
57#define GPIO93_HX4700_EUART_INT 93
58#define GPIO94_HX4700_KEY_MAIL 94
59#define GPIO95_HX4700_BATT_OFF 95
60#define GPIO96_HX4700_BQ24022_ISET2 96
61#define GPIO97_HX4700_nBL_DETECT 97
62#define GPIO99_HX4700_KEY_CONTACTS 99
63#define GPIO100_HX4700_AUTO_SENSE 100 /* BL auto brightness */
64#define GPIO102_HX4700_SYNAPTICS_POWER_ON 102
65#define GPIO103_HX4700_SYNAPTICS_INT 103
66#define GPIO105_HX4700_nIR_ON 105
67#define GPIO106_HX4700_CPU_BT_nRESET 106
68#define GPIO107_HX4700_SPK_nSD 107
69#define GPIO109_HX4700_CODEC_nPDN 109
70#define GPIO110_HX4700_LCD_LVDD_3V3_ON 110
71#define GPIO111_HX4700_LCD_AVDD_3V3_ON 111
72#define GPIO112_HX4700_LCD_N2V7_7V3_ON 112
73#define GPIO114_HX4700_CF_RESET 114
74#define GPIO116_HX4700_CPU_HW_nRESET 116
75
76/*
77 * ASIC3 GPIOs
78 */
79
80#define GPIOC_BASE (HX4700_ASIC3_GPIO_BASE + 32)
81#define GPIOD_BASE (HX4700_ASIC3_GPIO_BASE + 48)
82
83#define GPIOC0_LED_RED (GPIOC_BASE + 0)
84#define GPIOC1_LED_GREEN (GPIOC_BASE + 1)
85#define GPIOC2_LED_BLUE (GPIOC_BASE + 2)
86#define GPIOC3_nSD_CS (GPIOC_BASE + 3)
87#define GPIOC4_CF_nCD (GPIOC_BASE + 4) /* Input */
88#define GPIOC5_nCIOW (GPIOC_BASE + 5) /* Output, to CF */
89#define GPIOC6_nCIOR (GPIOC_BASE + 6) /* Output, to CF */
90#define GPIOC7_nPCE1 (GPIOC_BASE + 7) /* Input, from CPU */
91#define GPIOC8_nPCE2 (GPIOC_BASE + 8) /* Input, from CPU */
92#define GPIOC9_nPOE (GPIOC_BASE + 9) /* Input, from CPU */
93#define GPIOC10_CF_nPWE (GPIOC_BASE + 10) /* Input */
94#define GPIOC11_PSKTSEL (GPIOC_BASE + 11) /* Input, from CPU */
95#define GPIOC12_nPREG (GPIOC_BASE + 12) /* Input, from CPU */
96#define GPIOC13_nPWAIT (GPIOC_BASE + 13) /* Output, to CPU */
97#define GPIOC14_nPIOIS16 (GPIOC_BASE + 14) /* Output, to CPU */
98#define GPIOC15_nPIOR (GPIOC_BASE + 15) /* Input, from CPU */
99
100#define GPIOD0_CPU_SS_INT (GPIOD_BASE + 0) /* Input */
101#define GPIOD1_nKEY_CALENDAR (GPIOD_BASE + 1)
102#define GPIOD2_BLUETOOTH_WAKEUP (GPIOD_BASE + 2)
103#define GPIOD3_nKEY_HOME (GPIOD_BASE + 3)
104#define GPIOD4_CF_nCD (GPIOD_BASE + 4) /* Input, from CF */
105#define GPIOD5_nPIO (GPIOD_BASE + 5) /* Input */
106#define GPIOD6_nKEY_RECORD (GPIOD_BASE + 6)
107#define GPIOD7_nSDIO_DETECT (GPIOD_BASE + 7)
108#define GPIOD8_COM_DCD (GPIOD_BASE + 8) /* Input */
109#define GPIOD9_nAC_IN (GPIOD_BASE + 9)
110#define GPIOD10_nSDIO_IRQ (GPIOD_BASE + 10) /* Input */
111#define GPIOD11_nCIOIS16 (GPIOD_BASE + 11) /* Input, from CF */
112#define GPIOD12_nCWAIT (GPIOD_BASE + 12) /* Input, from CF */
113#define GPIOD13_CF_RNB (GPIOD_BASE + 13) /* Input */
114#define GPIOD14_nUSBC_DETECT (GPIOD_BASE + 14)
115#define GPIOD15_nPIOW (GPIOD_BASE + 15) /* Input, from CPU */
116
117/*
118 * EGPIOs
119 */
120
121#define EGPIO0_VCC_3V3_EN (HX4700_EGPIO_BASE + 0) /* WLAN support chip */
122#define EGPIO1_WL_VREG_EN (HX4700_EGPIO_BASE + 1) /* WLAN power */
123#define EGPIO2_VCC_2V1_WL_EN (HX4700_EGPIO_BASE + 2) /* unused */
124#define EGPIO3_SS_PWR_ON (HX4700_EGPIO_BASE + 3) /* smart slot power */
125#define EGPIO4_CF_3V3_ON (HX4700_EGPIO_BASE + 4) /* CF 3.3V enable */
126#define EGPIO5_BT_3V3_ON (HX4700_EGPIO_BASE + 5) /* BT 3.3V enable */
127#define EGPIO6_WL1V8_EN (HX4700_EGPIO_BASE + 6) /* WLAN 1.8V enable */
128#define EGPIO7_VCC_3V3_WL_EN (HX4700_EGPIO_BASE + 7) /* WLAN 3.3V enable */
129#define EGPIO8_USB_3V3_ON (HX4700_EGPIO_BASE + 8) /* unused */
130
131#endif /* _HX4700_H_ */
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index 32bb4a2eb7f1..6a1d95993342 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -91,13 +91,23 @@
91#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) 91#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
92 92
93/* 93/*
94 * The next 16 interrupts are for board specific purposes. Since 94 * The following interrupts are for board specific purposes. Since
95 * the kernel can only run on one machine at a time, we can re-use 95 * the kernel can only run on one machine at a time, we can re-use
96 * these. If you need more, increase IRQ_BOARD_END, but keep it 96 * these. There will be 16 IRQs by default. If it is not enough,
97 * within sensible limits. 97 * IRQ_BOARD_END is allowed be customized for each board, but keep
98 * the numbers within sensible limits and in descending order, so
99 * when multiple config options are selected, the maximum will be
100 * used.
98 */ 101 */
99#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM) 102#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM)
103
104#if defined(CONFIG_MACH_H4700)
105#define IRQ_BOARD_END (IRQ_BOARD_START + 70)
106#elif defined(CONFIG_MACH_ZYLONITE)
107#define IRQ_BOARD_END (IRQ_BOARD_START + 32)
108#else
100#define IRQ_BOARD_END (IRQ_BOARD_START + 16) 109#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
110#endif
101 111
102#define IRQ_SA1111_START (IRQ_BOARD_END) 112#define IRQ_SA1111_START (IRQ_BOARD_END)
103#define IRQ_GPAIN0 (IRQ_BOARD_END + 0) 113#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
@@ -188,8 +198,6 @@
188#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) 198#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
189#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS) 199#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
190#define NR_IRQS (IRQ_BOARD_END) 200#define NR_IRQS (IRQ_BOARD_END)
191#elif defined(CONFIG_MACH_ZYLONITE)
192#define NR_IRQS (IRQ_BOARD_START + 32)
193#else 201#else
194#define NR_IRQS (IRQ_BOARD_START) 202#define NR_IRQS (IRQ_BOARD_START)
195#endif 203#endif
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa320.h b/arch/arm/mach-pxa/include/mach/mfp-pxa320.h
index 07897e61d05a..3ce4682eabb6 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa320.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa320.h
@@ -283,6 +283,9 @@
283#define GPIO41_UART1_TXD MFP_CFG_LPM(GPIO41, AF4, FLOAT) 283#define GPIO41_UART1_TXD MFP_CFG_LPM(GPIO41, AF4, FLOAT)
284#define GPIO42_UART1_RXD MFP_CFG_LPM(GPIO42, AF4, FLOAT) 284#define GPIO42_UART1_RXD MFP_CFG_LPM(GPIO42, AF4, FLOAT)
285#define GPIO42_UART1_TXD MFP_CFG_LPM(GPIO42, AF2, FLOAT) 285#define GPIO42_UART1_TXD MFP_CFG_LPM(GPIO42, AF2, FLOAT)
286#define GPIO75_UART1_RXD MFP_CFG_LPM(GPIO75, AF1, FLOAT)
287#define GPIO76_UART1_RXD MFP_CFG_LPM(GPIO76, AF3, FLOAT)
288#define GPIO76_UART1_TXD MFP_CFG_LPM(GPIO76, AF1, FLOAT)
286#define GPIO97_UART1_RXD MFP_CFG_LPM(GPIO97, AF1, FLOAT) 289#define GPIO97_UART1_RXD MFP_CFG_LPM(GPIO97, AF1, FLOAT)
287#define GPIO97_UART1_TXD MFP_CFG_LPM(GPIO97, AF6, FLOAT) 290#define GPIO97_UART1_TXD MFP_CFG_LPM(GPIO97, AF6, FLOAT)
288#define GPIO98_UART1_RXD MFP_CFG_LPM(GPIO98, AF6, FLOAT) 291#define GPIO98_UART1_RXD MFP_CFG_LPM(GPIO98, AF6, FLOAT)
@@ -291,6 +294,9 @@
291#define GPIO43_UART1_RTS MFP_CFG_LPM(GPIO43, AF4, FLOAT) 294#define GPIO43_UART1_RTS MFP_CFG_LPM(GPIO43, AF4, FLOAT)
292#define GPIO48_UART1_CTS MFP_CFG_LPM(GPIO48, AF4, FLOAT) 295#define GPIO48_UART1_CTS MFP_CFG_LPM(GPIO48, AF4, FLOAT)
293#define GPIO48_UART1_RTS MFP_CFG_LPM(GPIO48, AF2, FLOAT) 296#define GPIO48_UART1_RTS MFP_CFG_LPM(GPIO48, AF2, FLOAT)
297#define GPIO77_UART1_CTS MFP_CFG_LPM(GPIO77, AF1, FLOAT)
298#define GPIO82_UART1_RTS MFP_CFG_LPM(GPIO82, AF1, FLOAT)
299#define GPIO82_UART1_CTS MFP_CFG_LPM(GPIO82, AF3, FLOAT)
294#define GPIO99_UART1_CTS MFP_CFG_LPM(GPIO99, AF1, FLOAT) 300#define GPIO99_UART1_CTS MFP_CFG_LPM(GPIO99, AF1, FLOAT)
295#define GPIO99_UART1_RTS MFP_CFG_LPM(GPIO99, AF6, FLOAT) 301#define GPIO99_UART1_RTS MFP_CFG_LPM(GPIO99, AF6, FLOAT)
296#define GPIO104_UART1_CTS MFP_CFG_LPM(GPIO104, AF6, FLOAT) 302#define GPIO104_UART1_CTS MFP_CFG_LPM(GPIO104, AF6, FLOAT)
@@ -299,13 +305,18 @@
299#define GPIO45_UART1_DSR MFP_CFG_LPM(GPIO45, AF2, FLOAT) 305#define GPIO45_UART1_DSR MFP_CFG_LPM(GPIO45, AF2, FLOAT)
300#define GPIO47_UART1_DTR MFP_CFG_LPM(GPIO47, AF2, FLOAT) 306#define GPIO47_UART1_DTR MFP_CFG_LPM(GPIO47, AF2, FLOAT)
301#define GPIO47_UART1_DSR MFP_CFG_LPM(GPIO47, AF4, FLOAT) 307#define GPIO47_UART1_DSR MFP_CFG_LPM(GPIO47, AF4, FLOAT)
308#define GPIO79_UART1_DSR MFP_CFG_LPM(GPIO79, AF1, FLOAT)
309#define GPIO81_UART1_DTR MFP_CFG_LPM(GPIO81, AF1, FLOAT)
310#define GPIO81_UART1_DSR MFP_CFG_LPM(GPIO81, AF3, FLOAT)
302#define GPIO101_UART1_DTR MFP_CFG_LPM(GPIO101, AF6, FLOAT) 311#define GPIO101_UART1_DTR MFP_CFG_LPM(GPIO101, AF6, FLOAT)
303#define GPIO101_UART1_DSR MFP_CFG_LPM(GPIO101, AF1, FLOAT) 312#define GPIO101_UART1_DSR MFP_CFG_LPM(GPIO101, AF1, FLOAT)
304#define GPIO103_UART1_DTR MFP_CFG_LPM(GPIO103, AF1, FLOAT) 313#define GPIO103_UART1_DTR MFP_CFG_LPM(GPIO103, AF1, FLOAT)
305#define GPIO103_UART1_DSR MFP_CFG_LPM(GPIO103, AF6, FLOAT) 314#define GPIO103_UART1_DSR MFP_CFG_LPM(GPIO103, AF6, FLOAT)
306#define GPIO44_UART1_DCD MFP_CFG_LPM(GPIO44, AF2, FLOAT) 315#define GPIO44_UART1_DCD MFP_CFG_LPM(GPIO44, AF2, FLOAT)
316#define GPIO78_UART1_DCD MFP_CFG_LPM(GPIO78, AF1, FLOAT)
307#define GPIO100_UART1_DCD MFP_CFG_LPM(GPIO100, AF1, FLOAT) 317#define GPIO100_UART1_DCD MFP_CFG_LPM(GPIO100, AF1, FLOAT)
308#define GPIO46_UART1_RI MFP_CFG_LPM(GPIO46, AF2, FLOAT) 318#define GPIO46_UART1_RI MFP_CFG_LPM(GPIO46, AF2, FLOAT)
319#define GPIO80_UART1_RI MFP_CFG_LPM(GPIO80, AF1, FLOAT)
309#define GPIO102_UART1_RI MFP_CFG_LPM(GPIO102, AF1, FLOAT) 320#define GPIO102_UART1_RI MFP_CFG_LPM(GPIO102, AF1, FLOAT)
310 321
311/* UART2 */ 322/* UART2 */
@@ -438,6 +449,9 @@
438 449
439#define GPIO2_RDY MFP_CFG(GPIO2, AF1) 450#define GPIO2_RDY MFP_CFG(GPIO2, AF1)
440#define GPIO5_NPIOR MFP_CFG(GPIO5, AF3) 451#define GPIO5_NPIOR MFP_CFG(GPIO5, AF3)
452#define GPIO6_NPIOW MFP_CFG(GPIO6, AF3)
453#define GPIO7_NPIOS16 MFP_CFG(GPIO7, AF3)
454#define GPIO8_NPWAIT MFP_CFG(GPIO8, AF3)
441 455
442#define GPIO11_PWM0_OUT MFP_CFG(GPIO11, AF1) 456#define GPIO11_PWM0_OUT MFP_CFG(GPIO11, AF1)
443#define GPIO12_PWM1_OUT MFP_CFG(GPIO12, AF1) 457#define GPIO12_PWM1_OUT MFP_CFG(GPIO12, AF1)
diff --git a/arch/arm/mach-pxa/include/mach/palmld.h b/arch/arm/mach-pxa/include/mach/palmld.h
index fb13c82ad6dc..8721b8010221 100644
--- a/arch/arm/mach-pxa/include/mach/palmld.h
+++ b/arch/arm/mach-pxa/include/mach/palmld.h
@@ -56,7 +56,6 @@
56#define GPIO_NR_PALMLD_LED_AMBER 94 56#define GPIO_NR_PALMLD_LED_AMBER 94
57 57
58/* IDE */ 58/* IDE */
59#define GPIO_NR_PALMLD_IDE_IRQ 95
60#define GPIO_NR_PALMLD_IDE_RESET 98 59#define GPIO_NR_PALMLD_IDE_RESET 98
61#define GPIO_NR_PALMLD_IDE_PWEN 115 60#define GPIO_NR_PALMLD_IDE_PWEN 115
62 61
diff --git a/arch/arm/mach-pxa/include/mach/pm.h b/arch/arm/mach-pxa/include/mach/pm.h
index a6eeef8a075f..fd8360c6839d 100644
--- a/arch/arm/mach-pxa/include/mach/pm.h
+++ b/arch/arm/mach-pxa/include/mach/pm.h
@@ -27,6 +27,8 @@ extern void pxa27x_cpu_suspend(unsigned int);
27extern void pxa_cpu_resume(void); 27extern void pxa_cpu_resume(void);
28 28
29extern int pxa_pm_enter(suspend_state_t state); 29extern int pxa_pm_enter(suspend_state_t state);
30extern int pxa_pm_prepare(void);
31extern void pxa_pm_finish(void);
30 32
31/* NOTE: this is for PM debugging on Lubbock, it's really a big 33/* NOTE: this is for PM debugging on Lubbock, it's really a big
32 * ugly, but let's keep the crap minimum here, instead of direct 34 * ugly, but let's keep the crap minimum here, instead of direct
diff --git a/arch/arm/mach-pxa/include/mach/pxa27x.h b/arch/arm/mach-pxa/include/mach/pxa27x.h
index 6876e16c2970..0b702693f458 100644
--- a/arch/arm/mach-pxa/include/mach/pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/pxa27x.h
@@ -16,4 +16,7 @@
16#define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */ 16#define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */
17#define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ 17#define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */
18#define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ 18#define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */
19
20extern int __init pxa27x_set_pwrmode(unsigned int mode);
21
19#endif /* __MACH_PXA27x_H */ 22#endif /* __MACH_PXA27x_H */
diff --git a/arch/arm/include/asm/hardware/sharpsl_pm.h b/arch/arm/mach-pxa/include/mach/sharpsl_pm.h
index 2d00db22b981..1920dc6b05dc 100644
--- a/arch/arm/include/asm/hardware/sharpsl_pm.h
+++ b/arch/arm/mach-pxa/include/mach/sharpsl_pm.h
@@ -8,8 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 */ 10 */
11 11#ifndef _MACH_SHARPSL_PM
12#include <linux/interrupt.h> 12#define _MACH_SHARPSL_PM
13 13
14struct sharpsl_charger_machinfo { 14struct sharpsl_charger_machinfo {
15 void (*init)(void); 15 void (*init)(void);
@@ -100,7 +100,5 @@ extern struct sharpsl_pm_status sharpsl_pm;
100 100
101void sharpsl_battery_kick(void); 101void sharpsl_battery_kick(void);
102void sharpsl_pm_led(int val); 102void sharpsl_pm_led(int val);
103irqreturn_t sharpsl_ac_isr(int irq, void *dev_id);
104irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id);
105irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id);
106 103
104#endif
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 5706cea95d11..b54749413e96 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -36,7 +36,8 @@ static inline void flush(void)
36static inline void arch_decomp_setup(void) 36static inline void arch_decomp_setup(void)
37{ 37{
38 if (machine_is_littleton() || machine_is_intelmote2() 38 if (machine_is_littleton() || machine_is_intelmote2()
39 || machine_is_csb726()) 39 || machine_is_csb726() || machine_is_stargate2()
40 || machine_is_cm_x300())
40 UART = STUART; 41 UART = STUART;
41} 42}
42 43
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index c872b9feb4d4..55b3788fd1ae 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -42,14 +42,17 @@
42#include <mach/pxa300.h> 42#include <mach/pxa300.h>
43#include <mach/pxafb.h> 43#include <mach/pxafb.h>
44#include <mach/ssp.h> 44#include <mach/ssp.h>
45#include <mach/mmc.h>
45#include <mach/pxa2xx_spi.h> 46#include <mach/pxa2xx_spi.h>
46#include <mach/i2c.h> 47#include <plat/i2c.h>
47#include <mach/pxa27x_keypad.h> 48#include <mach/pxa27x_keypad.h>
48#include <mach/pxa3xx_nand.h> 49#include <mach/pxa3xx_nand.h>
49#include <mach/littleton.h> 50#include <mach/littleton.h>
50 51
51#include "generic.h" 52#include "generic.h"
52 53
54#define GPIO_MMC1_CARD_DETECT mfp_to_gpio(MFP_PIN_GPIO15)
55
53/* Littleton MFP configurations */ 56/* Littleton MFP configurations */
54static mfp_cfg_t littleton_mfp_cfg[] __initdata = { 57static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
55 /* LCD */ 58 /* LCD */
@@ -98,6 +101,15 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
98 GPIO123_KP_MKOUT_2, 101 GPIO123_KP_MKOUT_2,
99 GPIO124_KP_MKOUT_3, 102 GPIO124_KP_MKOUT_3,
100 GPIO125_KP_MKOUT_4, 103 GPIO125_KP_MKOUT_4,
104
105 /* MMC1 */
106 GPIO3_MMC1_DAT0,
107 GPIO4_MMC1_DAT1,
108 GPIO5_MMC1_DAT2,
109 GPIO6_MMC1_DAT3,
110 GPIO7_MMC1_CLK,
111 GPIO8_MMC1_CMD,
112 GPIO15_GPIO, /* card detect */
101}; 113};
102 114
103static struct resource smc91x_resources[] = { 115static struct resource smc91x_resources[] = {
@@ -179,15 +191,10 @@ static struct pxa2xx_spi_master littleton_spi_info = {
179 .num_chipselect = 1, 191 .num_chipselect = 1,
180}; 192};
181 193
182static void littleton_tdo24m_cs(u32 cmd)
183{
184 gpio_set_value(LITTLETON_GPIO_LCD_CS, !(cmd == PXA2XX_CS_ASSERT));
185}
186
187static struct pxa2xx_spi_chip littleton_tdo24m_chip = { 194static struct pxa2xx_spi_chip littleton_tdo24m_chip = {
188 .rx_threshold = 1, 195 .rx_threshold = 1,
189 .tx_threshold = 1, 196 .tx_threshold = 1,
190 .cs_control = littleton_tdo24m_cs, 197 .gpio_cs = LITTLETON_GPIO_LCD_CS,
191}; 198};
192 199
193static struct spi_board_info littleton_spi_devices[] __initdata = { 200static struct spi_board_info littleton_spi_devices[] __initdata = {
@@ -202,16 +209,6 @@ static struct spi_board_info littleton_spi_devices[] __initdata = {
202 209
203static void __init littleton_init_spi(void) 210static void __init littleton_init_spi(void)
204{ 211{
205 int err;
206
207 err = gpio_request(LITTLETON_GPIO_LCD_CS, "LCD_CS");
208 if (err) {
209 pr_warning("failed to request GPIO for LCS CS\n");
210 return;
211 }
212
213 gpio_direction_output(LITTLETON_GPIO_LCD_CS, 1);
214
215 pxa2xx_set_spi_info(2, &littleton_spi_info); 212 pxa2xx_set_spi_info(2, &littleton_spi_info);
216 spi_register_board_info(ARRAY_AND_SIZE(littleton_spi_devices)); 213 spi_register_board_info(ARRAY_AND_SIZE(littleton_spi_devices));
217} 214}
@@ -267,6 +264,56 @@ static void __init littleton_init_keypad(void)
267static inline void littleton_init_keypad(void) {} 264static inline void littleton_init_keypad(void) {}
268#endif 265#endif
269 266
267#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
268static int littleton_mci_init(struct device *dev,
269 irq_handler_t littleton_detect_int, void *data)
270{
271 int err, gpio_cd = GPIO_MMC1_CARD_DETECT;
272
273 err = gpio_request(gpio_cd, "mmc card detect");
274 if (err)
275 goto err_request_cd;
276
277 gpio_direction_input(gpio_cd);
278
279 err = request_irq(gpio_to_irq(gpio_cd), littleton_detect_int,
280 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
281 "mmc card detect", data);
282 if (err) {
283 dev_err(dev, "failed to request card detect IRQ\n");
284 goto err_request_irq;
285 }
286 return 0;
287
288err_request_irq:
289 gpio_free(gpio_cd);
290err_request_cd:
291 return err;
292}
293
294static void littleton_mci_exit(struct device *dev, void *data)
295{
296 int gpio_cd = GPIO_MMC1_CARD_DETECT;
297
298 free_irq(gpio_to_irq(gpio_cd), data);
299 gpio_free(gpio_cd);
300}
301
302static struct pxamci_platform_data littleton_mci_platform_data = {
303 .detect_delay = 20,
304 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
305 .init = littleton_mci_init,
306 .exit = littleton_mci_exit,
307};
308
309static void __init littleton_init_mmc(void)
310{
311 pxa_set_mci_info(&littleton_mci_platform_data);
312}
313#else
314static inline void littleton_init_mmc(void) {}
315#endif
316
270#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 317#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
271static struct mtd_partition littleton_nand_partitions[] = { 318static struct mtd_partition littleton_nand_partitions[] = {
272 [0] = { 319 [0] = {
@@ -407,6 +454,7 @@ static void __init littleton_init(void)
407 454
408 littleton_init_spi(); 455 littleton_init_spi();
409 littleton_init_i2c(); 456 littleton_init_i2c();
457 littleton_init_mmc();
410 littleton_init_lcd(); 458 littleton_init_lcd();
411 littleton_init_keypad(); 459 littleton_init_keypad();
412 littleton_init_nand(); 460 littleton_init_nand();
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index c899bbd94dc0..ca39669cffc5 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -36,7 +36,7 @@
36#include <mach/pxa27x.h> 36#include <mach/pxa27x.h>
37#include <mach/magician.h> 37#include <mach/magician.h>
38#include <mach/pxafb.h> 38#include <mach/pxafb.h>
39#include <mach/i2c.h> 39#include <plat/i2c.h>
40#include <mach/mmc.h> 40#include <mach/mmc.h>
41#include <mach/irda.h> 41#include <mach/irda.h>
42#include <mach/ohci.h> 42#include <mach/ohci.h>
@@ -745,6 +745,14 @@ static struct platform_device strataflash = {
745}; 745};
746 746
747/* 747/*
748 * I2C
749 */
750
751static struct i2c_pxa_platform_data i2c_info = {
752 .fast_mode = 1,
753};
754
755/*
748 * Platform devices 756 * Platform devices
749 */ 757 */
750 758
@@ -771,7 +779,7 @@ static void __init magician_init(void)
771 779
772 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config)); 780 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config));
773 781
774 platform_add_devices(devices, ARRAY_SIZE(devices)); 782 platform_add_devices(ARRAY_AND_SIZE(devices));
775 783
776 err = gpio_request(GPIO83_MAGICIAN_nIR_EN, "nIR_EN"); 784 err = gpio_request(GPIO83_MAGICIAN_nIR_EN, "nIR_EN");
777 if (!err) { 785 if (!err) {
@@ -779,7 +787,7 @@ static void __init magician_init(void)
779 pxa_set_ficp_info(&magician_ficp_info); 787 pxa_set_ficp_info(&magician_ficp_info);
780 } 788 }
781 pxa27x_set_i2c_power_info(NULL); 789 pxa27x_set_i2c_power_info(NULL);
782 pxa_set_i2c_info(NULL); 790 pxa_set_i2c_info(&i2c_info);
783 pxa_set_mci_info(&magician_mci_info); 791 pxa_set_mci_info(&magician_mci_info);
784 pxa_set_ohci_info(&magician_ohci_info); 792 pxa_set_ohci_info(&magician_ohci_info);
785 793
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index a6c8429e975f..f4dabf0273ca 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -46,7 +46,7 @@
46#include <mach/mainstone.h> 46#include <mach/mainstone.h>
47#include <mach/audio.h> 47#include <mach/audio.h>
48#include <mach/pxafb.h> 48#include <mach/pxafb.h>
49#include <mach/i2c.h> 49#include <plat/i2c.h>
50#include <mach/mmc.h> 50#include <mach/mmc.h>
51#include <mach/irda.h> 51#include <mach/irda.h>
52#include <mach/ohci.h> 52#include <mach/ohci.h>
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index ff8052ce0a05..4dc8c2ec40a9 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -48,7 +48,7 @@
48#include <mach/mmc.h> 48#include <mach/mmc.h>
49#include <mach/udc.h> 49#include <mach/udc.h>
50#include <mach/pxa27x-udc.h> 50#include <mach/pxa27x-udc.h>
51#include <mach/i2c.h> 51#include <plat/i2c.h>
52#include <mach/camera.h> 52#include <mach/camera.h>
53#include <mach/audio.h> 53#include <mach/audio.h>
54#include <media/soc_camera.h> 54#include <media/soc_camera.h>
@@ -798,7 +798,7 @@ static void mioa701_restart(char c, const char *cmd)
798 arm_machine_restart('s', cmd); 798 arm_machine_restart('s', cmd);
799} 799}
800 800
801struct gpio_ress global_gpios[] = { 801static struct gpio_ress global_gpios[] = {
802 MIO_GPIO_OUT(GPIO9_CHARGE_EN, 1, "Charger enable"), 802 MIO_GPIO_OUT(GPIO9_CHARGE_EN, 1, "Charger enable"),
803 MIO_GPIO_OUT(GPIO18_POWEROFF, 0, "Power Off"), 803 MIO_GPIO_OUT(GPIO18_POWEROFF, 0, "Power Off"),
804 MIO_GPIO_OUT(GPIO87_LCD_POWER, 0, "LCD Power") 804 MIO_GPIO_OUT(GPIO87_LCD_POWER, 0, "LCD Power")
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 471a853e548b..ed70f281dd09 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -129,7 +129,7 @@ static unsigned long palmld_pin_config[] __initdata = {
129 GPIO81_GPIO, /* wifi reset */ 129 GPIO81_GPIO, /* wifi reset */
130 130
131 /* HDD */ 131 /* HDD */
132 GPIO95_GPIO, /* HDD irq */ 132 GPIO98_GPIO, /* HDD reset */
133 GPIO115_GPIO, /* HDD power */ 133 GPIO115_GPIO, /* HDD power */
134 134
135 /* MISC */ 135 /* MISC */
@@ -496,6 +496,14 @@ static struct platform_device palmld_asoc = {
496}; 496};
497 497
498/****************************************************************************** 498/******************************************************************************
499 * HDD
500 ******************************************************************************/
501static struct platform_device palmld_hdd = {
502 .name = "pata_palmld",
503 .id = -1,
504};
505
506/******************************************************************************
499 * Framebuffer 507 * Framebuffer
500 ******************************************************************************/ 508 ******************************************************************************/
501static struct pxafb_mode_info palmld_lcd_modes[] = { 509static struct pxafb_mode_info palmld_lcd_modes[] = {
@@ -524,30 +532,18 @@ static struct pxafb_mach_info palmld_lcd_screen = {
524/****************************************************************************** 532/******************************************************************************
525 * Power management - standby 533 * Power management - standby
526 ******************************************************************************/ 534 ******************************************************************************/
527#ifdef CONFIG_PM 535static void __init palmld_pm_init(void)
528static u32 *addr __initdata;
529static u32 resume[3] __initdata = {
530 0xe3a00101, /* mov r0, #0x40000000 */
531 0xe380060f, /* orr r0, r0, #0x00f00000 */
532 0xe590f008, /* ldr pc, [r0, #0x08] */
533};
534
535static int __init palmld_pm_init(void)
536{ 536{
537 int i; 537 static u32 resume[] = {
538 538 0xe3a00101, /* mov r0, #0x40000000 */
539 /* this is where the bootloader jumps */ 539 0xe380060f, /* orr r0, r0, #0x00f00000 */
540 addr = phys_to_virt(PALMLD_STR_BASE); 540 0xe590f008, /* ldr pc, [r0, #0x08] */
541 541 };
542 for (i = 0; i < 3; i++) 542
543 addr[i] = resume[i]; 543 /* copy the bootloader */
544 544 memcpy(phys_to_virt(PALMLD_STR_BASE), resume, sizeof(resume));
545 return 0;
546} 545}
547 546
548device_initcall(palmld_pm_init);
549#endif
550
551/****************************************************************************** 547/******************************************************************************
552 * Machine init 548 * Machine init
553 ******************************************************************************/ 549 ******************************************************************************/
@@ -559,6 +555,7 @@ static struct platform_device *devices[] __initdata = {
559 &palmld_leds, 555 &palmld_leds,
560 &power_supply, 556 &power_supply,
561 &palmld_asoc, 557 &palmld_asoc,
558 &palmld_hdd,
562}; 559};
563 560
564static struct map_desc palmld_io_desc[] __initdata = { 561static struct map_desc palmld_io_desc[] __initdata = {
@@ -586,6 +583,7 @@ static void __init palmld_init(void)
586{ 583{
587 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config)); 584 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
588 585
586 palmld_pm_init();
589 set_pxa_fb_info(&palmld_lcd_screen); 587 set_pxa_fb_info(&palmld_lcd_screen);
590 pxa_set_mci_info(&palmld_mci_platform_data); 588 pxa_set_mci_info(&palmld_mci_platform_data);
591 pxa_set_ac97_info(&palmld_ac97_pdata); 589 pxa_set_ac97_info(&palmld_ac97_pdata);
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 05bf979b78a6..aae64a12a734 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -26,6 +26,7 @@
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/wm97xx_batt.h> 27#include <linux/wm97xx_batt.h>
28#include <linux/power_supply.h> 28#include <linux/power_supply.h>
29#include <linux/usb/gpio_vbus.h>
29 30
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
@@ -343,11 +344,18 @@ static struct pxaficp_platform_data palmt5_ficp_platform_data = {
343/****************************************************************************** 344/******************************************************************************
344 * UDC 345 * UDC
345 ******************************************************************************/ 346 ******************************************************************************/
346static struct pxa2xx_udc_mach_info palmt5_udc_info __initdata = { 347static struct gpio_vbus_mach_info palmt5_udc_info = {
347 .gpio_vbus = GPIO_NR_PALMT5_USB_DETECT_N, 348 .gpio_vbus = GPIO_NR_PALMT5_USB_DETECT_N,
348 .gpio_vbus_inverted = 1, 349 .gpio_vbus_inverted = 1,
349 .gpio_pullup = GPIO_NR_PALMT5_USB_PULLUP, 350 .gpio_pullup = GPIO_NR_PALMT5_USB_PULLUP,
350 .gpio_pullup_inverted = 0, 351};
352
353static struct platform_device palmt5_gpio_vbus = {
354 .name = "gpio-vbus",
355 .id = -1,
356 .dev = {
357 .platform_data = &palmt5_udc_info,
358 },
351}; 359};
352 360
353/****************************************************************************** 361/******************************************************************************
@@ -466,30 +474,18 @@ static struct pxafb_mach_info palmt5_lcd_screen = {
466/****************************************************************************** 474/******************************************************************************
467 * Power management - standby 475 * Power management - standby
468 ******************************************************************************/ 476 ******************************************************************************/
469#ifdef CONFIG_PM 477static void __init palmt5_pm_init(void)
470static u32 *addr __initdata;
471static u32 resume[3] __initdata = {
472 0xe3a00101, /* mov r0, #0x40000000 */
473 0xe380060f, /* orr r0, r0, #0x00f00000 */
474 0xe590f008, /* ldr pc, [r0, #0x08] */
475};
476
477static int __init palmt5_pm_init(void)
478{ 478{
479 int i; 479 static u32 resume[] = {
480 480 0xe3a00101, /* mov r0, #0x40000000 */
481 /* this is where the bootloader jumps */ 481 0xe380060f, /* orr r0, r0, #0x00f00000 */
482 addr = phys_to_virt(PALMT5_STR_BASE); 482 0xe590f008, /* ldr pc, [r0, #0x08] */
483 483 };
484 for (i = 0; i < 3; i++) 484
485 addr[i] = resume[i]; 485 /* copy the bootloader */
486 486 memcpy(phys_to_virt(PALMT5_STR_BASE), resume, sizeof(resume));
487 return 0;
488} 487}
489 488
490device_initcall(palmt5_pm_init);
491#endif
492
493/****************************************************************************** 489/******************************************************************************
494 * Machine init 490 * Machine init
495 ******************************************************************************/ 491 ******************************************************************************/
@@ -500,6 +496,7 @@ static struct platform_device *devices[] __initdata = {
500 &palmt5_backlight, 496 &palmt5_backlight,
501 &power_supply, 497 &power_supply,
502 &palmt5_asoc, 498 &palmt5_asoc,
499 &palmt5_gpio_vbus,
503}; 500};
504 501
505/* setup udc GPIOs initial state */ 502/* setup udc GPIOs initial state */
@@ -515,14 +512,15 @@ static void __init palmt5_init(void)
515{ 512{
516 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config)); 513 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
517 514
515 palmt5_pm_init();
518 set_pxa_fb_info(&palmt5_lcd_screen); 516 set_pxa_fb_info(&palmt5_lcd_screen);
519 pxa_set_mci_info(&palmt5_mci_platform_data); 517 pxa_set_mci_info(&palmt5_mci_platform_data);
520 palmt5_udc_init(); 518 palmt5_udc_init();
521 pxa_set_ac97_info(&palmt5_ac97_pdata); 519 pxa_set_ac97_info(&palmt5_ac97_pdata);
522 pxa_set_udc_info(&palmt5_udc_info);
523 pxa_set_ficp_info(&palmt5_ficp_platform_data); 520 pxa_set_ficp_info(&palmt5_ficp_platform_data);
524 pxa_set_keypad_info(&palmt5_keypad_platform_data); 521 pxa_set_keypad_info(&palmt5_keypad_platform_data);
525 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 522 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
523
526 platform_add_devices(devices, ARRAY_SIZE(devices)); 524 platform_add_devices(devices, ARRAY_SIZE(devices));
527} 525}
528 526
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 43fcf2e86887..d823b09801df 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -25,6 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/wm97xx_batt.h> 26#include <linux/wm97xx_batt.h>
27#include <linux/power_supply.h> 27#include <linux/power_supply.h>
28#include <linux/usb/gpio_vbus.h>
28 29
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -37,6 +38,7 @@
37#include <mach/mfp-pxa25x.h> 38#include <mach/mfp-pxa25x.h>
38#include <mach/irda.h> 39#include <mach/irda.h>
39#include <mach/udc.h> 40#include <mach/udc.h>
41#include <mach/palmasoc.h>
40 42
41#include "generic.h" 43#include "generic.h"
42#include "devices.h" 44#include "devices.h"
@@ -107,6 +109,7 @@ static unsigned long palmte2_pin_config[] __initdata = {
107 GPIO1_RST, /* reset */ 109 GPIO1_RST, /* reset */
108 GPIO4_GPIO, /* Hotsync button */ 110 GPIO4_GPIO, /* Hotsync button */
109 GPIO9_GPIO, /* power detect */ 111 GPIO9_GPIO, /* power detect */
112 GPIO15_GPIO, /* earphone detect */
110 GPIO37_GPIO, /* LCD power */ 113 GPIO37_GPIO, /* LCD power */
111 GPIO56_GPIO, /* Backlight power */ 114 GPIO56_GPIO, /* Backlight power */
112}; 115};
@@ -318,11 +321,18 @@ static struct pxaficp_platform_data palmte2_ficp_platform_data = {
318/****************************************************************************** 321/******************************************************************************
319 * UDC 322 * UDC
320 ******************************************************************************/ 323 ******************************************************************************/
321static struct pxa2xx_udc_mach_info palmte2_udc_info __initdata = { 324static struct gpio_vbus_mach_info palmte2_udc_info = {
322 .gpio_vbus = GPIO_NR_PALMTE2_USB_DETECT_N, 325 .gpio_vbus = GPIO_NR_PALMTE2_USB_DETECT_N,
323 .gpio_vbus_inverted = 1, 326 .gpio_vbus_inverted = 1,
324 .gpio_pullup = GPIO_NR_PALMTE2_USB_PULLUP, 327 .gpio_pullup = GPIO_NR_PALMTE2_USB_PULLUP,
325 .gpio_pullup_inverted = 0, 328};
329
330static struct platform_device palmte2_gpio_vbus = {
331 .name = "gpio-vbus",
332 .id = -1,
333 .dev = {
334 .platform_data = &palmte2_udc_info,
335 },
326}; 336};
327 337
328/****************************************************************************** 338/******************************************************************************
@@ -395,6 +405,21 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
395}; 405};
396 406
397/****************************************************************************** 407/******************************************************************************
408 * aSoC audio
409 ******************************************************************************/
410static struct palm27x_asoc_info palmte2_asoc_pdata = {
411 .jack_gpio = GPIO_NR_PALMTE2_EARPHONE_DETECT,
412};
413
414static struct platform_device palmte2_asoc = {
415 .name = "palm27x-asoc",
416 .id = -1,
417 .dev = {
418 .platform_data = &palmte2_asoc_pdata,
419 },
420};
421
422/******************************************************************************
398 * Framebuffer 423 * Framebuffer
399 ******************************************************************************/ 424 ******************************************************************************/
400static struct pxafb_mode_info palmte2_lcd_modes[] = { 425static struct pxafb_mode_info palmte2_lcd_modes[] = {
@@ -429,6 +454,8 @@ static struct platform_device *devices[] __initdata = {
429#endif 454#endif
430 &palmte2_backlight, 455 &palmte2_backlight,
431 &power_supply, 456 &power_supply,
457 &palmte2_asoc,
458 &palmte2_gpio_vbus,
432}; 459};
433 460
434/* setup udc GPIOs initial state */ 461/* setup udc GPIOs initial state */
@@ -447,7 +474,6 @@ static void __init palmte2_init(void)
447 set_pxa_fb_info(&palmte2_lcd_screen); 474 set_pxa_fb_info(&palmte2_lcd_screen);
448 pxa_set_mci_info(&palmte2_mci_platform_data); 475 pxa_set_mci_info(&palmte2_mci_platform_data);
449 palmte2_udc_init(); 476 palmte2_udc_init();
450 pxa_set_udc_info(&palmte2_udc_info);
451 pxa_set_ac97_info(NULL); 477 pxa_set_ac97_info(NULL);
452 pxa_set_ficp_info(&palmte2_ficp_platform_data); 478 pxa_set_ficp_info(&palmte2_ficp_platform_data);
453 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 479 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index e99a893c58a7..6c15d84bde53 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -27,6 +27,7 @@
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/wm97xx_batt.h> 28#include <linux/wm97xx_batt.h>
29#include <linux/power_supply.h> 29#include <linux/power_supply.h>
30#include <linux/usb/gpio_vbus.h>
30 31
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -359,11 +360,18 @@ static struct pxaficp_platform_data palmtx_ficp_platform_data = {
359/****************************************************************************** 360/******************************************************************************
360 * UDC 361 * UDC
361 ******************************************************************************/ 362 ******************************************************************************/
362static struct pxa2xx_udc_mach_info palmtx_udc_info __initdata = { 363static struct gpio_vbus_mach_info palmtx_udc_info = {
363 .gpio_vbus = GPIO_NR_PALMTX_USB_DETECT_N, 364 .gpio_vbus = GPIO_NR_PALMTX_USB_DETECT_N,
364 .gpio_vbus_inverted = 1, 365 .gpio_vbus_inverted = 1,
365 .gpio_pullup = GPIO_NR_PALMTX_USB_PULLUP, 366 .gpio_pullup = GPIO_NR_PALMTX_USB_PULLUP,
366 .gpio_pullup_inverted = 0, 367};
368
369static struct platform_device palmtx_gpio_vbus = {
370 .name = "gpio-vbus",
371 .id = -1,
372 .dev = {
373 .platform_data = &palmtx_udc_info,
374 },
367}; 375};
368 376
369/****************************************************************************** 377/******************************************************************************
@@ -483,30 +491,18 @@ static struct pxafb_mach_info palmtx_lcd_screen = {
483/****************************************************************************** 491/******************************************************************************
484 * Power management - standby 492 * Power management - standby
485 ******************************************************************************/ 493 ******************************************************************************/
486#ifdef CONFIG_PM 494static void __init palmtx_pm_init(void)
487static u32 *addr __initdata;
488static u32 resume[3] __initdata = {
489 0xe3a00101, /* mov r0, #0x40000000 */
490 0xe380060f, /* orr r0, r0, #0x00f00000 */
491 0xe590f008, /* ldr pc, [r0, #0x08] */
492};
493
494static int __init palmtx_pm_init(void)
495{ 495{
496 int i; 496 static u32 resume[] = {
497 497 0xe3a00101, /* mov r0, #0x40000000 */
498 /* this is where the bootloader jumps */ 498 0xe380060f, /* orr r0, r0, #0x00f00000 */
499 addr = phys_to_virt(PALMTX_STR_BASE); 499 0xe590f008, /* ldr pc, [r0, #0x08] */
500 500 };
501 for (i = 0; i < 3; i++) 501
502 addr[i] = resume[i]; 502 /* copy the bootloader */
503 503 memcpy(phys_to_virt(PALMTX_STR_BASE), resume, sizeof(resume));
504 return 0;
505} 504}
506 505
507device_initcall(palmtx_pm_init);
508#endif
509
510/****************************************************************************** 506/******************************************************************************
511 * Machine init 507 * Machine init
512 ******************************************************************************/ 508 ******************************************************************************/
@@ -517,6 +513,7 @@ static struct platform_device *devices[] __initdata = {
517 &palmtx_backlight, 513 &palmtx_backlight,
518 &power_supply, 514 &power_supply,
519 &palmtx_asoc, 515 &palmtx_asoc,
516 &palmtx_gpio_vbus,
520}; 517};
521 518
522static struct map_desc palmtx_io_desc[] __initdata = { 519static struct map_desc palmtx_io_desc[] __initdata = {
@@ -548,11 +545,11 @@ static void __init palmtx_init(void)
548{ 545{
549 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config)); 546 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));
550 547
548 palmtx_pm_init();
551 set_pxa_fb_info(&palmtx_lcd_screen); 549 set_pxa_fb_info(&palmtx_lcd_screen);
552 pxa_set_mci_info(&palmtx_mci_platform_data); 550 pxa_set_mci_info(&palmtx_mci_platform_data);
553 palmtx_udc_init(); 551 palmtx_udc_init();
554 pxa_set_ac97_info(&palmtx_ac97_pdata); 552 pxa_set_ac97_info(&palmtx_ac97_pdata);
555 pxa_set_udc_info(&palmtx_udc_info);
556 pxa_set_ficp_info(&palmtx_ficp_platform_data); 553 pxa_set_ficp_info(&palmtx_ficp_platform_data);
557 pxa_set_keypad_info(&palmtx_keypad_platform_data); 554 pxa_set_keypad_info(&palmtx_keypad_platform_data);
558 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 555 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 6c12b5a3132f..095521e9ee24 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -28,7 +28,7 @@
28#include <media/soc_camera.h> 28#include <media/soc_camera.h>
29 29
30#include <asm/gpio.h> 30#include <asm/gpio.h>
31#include <mach/i2c.h> 31#include <plat/i2c.h>
32#include <mach/camera.h> 32#include <mach/camera.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <mach/pxa27x.h> 34#include <mach/pxa27x.h>
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 884b174c8ead..7693355ee637 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -79,7 +79,7 @@ static int pxa_pm_valid(suspend_state_t state)
79 return -EINVAL; 79 return -EINVAL;
80} 80}
81 81
82static int pxa_pm_prepare(void) 82int pxa_pm_prepare(void)
83{ 83{
84 int ret = 0; 84 int ret = 0;
85 85
@@ -89,7 +89,7 @@ static int pxa_pm_prepare(void)
89 return ret; 89 return ret;
90} 90}
91 91
92static void pxa_pm_finish(void) 92void pxa_pm_finish(void)
93{ 93{
94 if (pxa_cpu_pm_fns && pxa_cpu_pm_fns->finish) 94 if (pxa_cpu_pm_fns && pxa_cpu_pm_fns->finish)
95 pxa_cpu_pm_fns->finish(); 95 pxa_cpu_pm_fns->finish();
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 036bbde4d221..ac431ed10399 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -39,7 +39,7 @@
39#include <mach/pxa25x.h> 39#include <mach/pxa25x.h>
40#include <mach/mmc.h> 40#include <mach/mmc.h>
41#include <mach/udc.h> 41#include <mach/udc.h>
42#include <mach/i2c.h> 42#include <plat/i2c.h>
43#include <mach/irda.h> 43#include <mach/irda.h>
44#include <mach/poodle.h> 44#include <mach/poodle.h>
45#include <mach/pxafb.h> 45#include <mach/pxafb.h>
@@ -214,13 +214,8 @@ static struct ads7846_platform_data poodle_ads7846_info = {
214 .gpio_pendown = POODLE_GPIO_TP_INT, 214 .gpio_pendown = POODLE_GPIO_TP_INT,
215}; 215};
216 216
217static void ads7846_cs(u32 command)
218{
219 gpio_set_value(POODLE_GPIO_TP_CS, !(command == PXA2XX_CS_ASSERT));
220}
221
222static struct pxa2xx_spi_chip poodle_ads7846_chip = { 217static struct pxa2xx_spi_chip poodle_ads7846_chip = {
223 .cs_control = ads7846_cs, 218 .gpio_cs = POODLE_GPIO_TP_CS,
224}; 219};
225 220
226static struct spi_board_info poodle_spi_devices[] = { 221static struct spi_board_info poodle_spi_devices[] = {
@@ -236,14 +231,6 @@ static struct spi_board_info poodle_spi_devices[] = {
236 231
237static void __init poodle_init_spi(void) 232static void __init poodle_init_spi(void)
238{ 233{
239 int err;
240
241 err = gpio_request(POODLE_GPIO_TP_CS, "ADS7846_CS");
242 if (err)
243 return;
244
245 gpio_direction_output(POODLE_GPIO_TP_CS, 1);
246
247 pxa2xx_set_spi_info(1, &poodle_spi_info); 234 pxa2xx_set_spi_info(1, &poodle_spi_info);
248 spi_register_board_info(ARRAY_AND_SIZE(poodle_spi_devices)); 235 spi_register_board_info(ARRAY_AND_SIZE(poodle_spi_devices));
249} 236}
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index a425ec71e657..ec68cc16b4e3 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -27,7 +27,7 @@
27#include <mach/ohci.h> 27#include <mach/ohci.h>
28#include <mach/pm.h> 28#include <mach/pm.h>
29#include <mach/dma.h> 29#include <mach/dma.h>
30#include <mach/i2c.h> 30#include <plat/i2c.h>
31 31
32#include "generic.h" 32#include "generic.h"
33#include "devices.h" 33#include "devices.h"
@@ -204,6 +204,23 @@ static struct clk_lookup pxa27x_clkregs[] = {
204#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] 204#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
205 205
206/* 206/*
207 * allow platforms to override default PWRMODE setting used for PM_SUSPEND_MEM
208 */
209static unsigned int pwrmode = PWRMODE_SLEEP;
210
211int __init pxa27x_set_pwrmode(unsigned int mode)
212{
213 switch (mode) {
214 case PWRMODE_SLEEP:
215 case PWRMODE_DEEPSLEEP:
216 pwrmode = mode;
217 return 0;
218 }
219
220 return -EINVAL;
221}
222
223/*
207 * List of global PXA peripheral registers to preserve. 224 * List of global PXA peripheral registers to preserve.
208 * More ones like CP and general purpose register values are preserved 225 * More ones like CP and general purpose register values are preserved
209 * with the stack pointer in sleep.S. 226 * with the stack pointer in sleep.S.
@@ -254,7 +271,7 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
254 pxa_cpu_standby(); 271 pxa_cpu_standby();
255 break; 272 break;
256 case PM_SUSPEND_MEM: 273 case PM_SUSPEND_MEM:
257 pxa27x_cpu_suspend(PWRMODE_SLEEP); 274 pxa27x_cpu_suspend(pwrmode);
258 break; 275 break;
259 } 276 }
260} 277}
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index b02d4544dc95..6f678d93bf4e 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -30,7 +30,7 @@
30#include <mach/pm.h> 30#include <mach/pm.h>
31#include <mach/dma.h> 31#include <mach/dma.h>
32#include <mach/ssp.h> 32#include <mach/ssp.h>
33#include <mach/i2c.h> 33#include <plat/i2c.h>
34 34
35#include "generic.h" 35#include "generic.h"
36#include "devices.h" 36#include "devices.h"
@@ -552,7 +552,7 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
552} 552}
553 553
554static struct platform_device *devices[] __initdata = { 554static struct platform_device *devices[] __initdata = {
555/* &pxa_device_udc, The UDC driver is PXA25x only */ 555 &pxa27x_device_udc,
556 &pxa_device_ffuart, 556 &pxa_device_ffuart,
557 &pxa_device_btuart, 557 &pxa_device_btuart,
558 &pxa_device_stuart, 558 &pxa_device_stuart,
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index ff8239991430..8241a63ea589 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -27,7 +27,7 @@
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28 28
29#include <mach/pxa930.h> 29#include <mach/pxa930.h>
30#include <mach/i2c.h> 30#include <plat/i2c.h>
31#include <mach/pxafb.h> 31#include <mach/pxafb.h>
32 32
33#include "devices.h" 33#include "devices.h"
diff --git a/arch/arm/mach-pxa/sharpsl.h b/arch/arm/mach-pxa/sharpsl.h
index 047909a76651..55259f4756c8 100644
--- a/arch/arm/mach-pxa/sharpsl.h
+++ b/arch/arm/mach-pxa/sharpsl.h
@@ -7,7 +7,7 @@
7 * 7 *
8 */ 8 */
9 9
10#include <asm/hardware/sharpsl_pm.h> 10#include <mach/sharpsl_pm.h>
11 11
12/* 12/*
13 * SharpSL SSP Driver 13 * SharpSL SSP Driver
@@ -44,8 +44,6 @@ void corgi_lcdtg_hw_init(int mode);
44 44
45extern struct battery_thresh spitz_battery_levels_acin[]; 45extern struct battery_thresh spitz_battery_levels_acin[];
46extern struct battery_thresh spitz_battery_levels_noac[]; 46extern struct battery_thresh spitz_battery_levels_noac[];
47void sharpsl_pm_pxa_init(void);
48void sharpsl_pm_pxa_remove(void);
49int sharpsl_pm_pxa_read_max1111(int channel); 47int sharpsl_pm_pxa_read_max1111(int channel);
50 48
51 49
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 16b4ec67e3b6..2546c066cd6e 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -15,20 +15,69 @@
15#undef DEBUG 15#undef DEBUG
16 16
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/init.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/interrupt.h> 19#include <linux/interrupt.h>
21#include <linux/irq.h>
22#include <linux/platform_device.h> 20#include <linux/platform_device.h>
23#include <linux/apm-emulation.h> 21#include <linux/apm-emulation.h>
22#include <linux/timer.h>
23#include <linux/delay.h>
24#include <linux/leds.h>
25#include <linux/suspend.h>
26#include <linux/gpio.h>
24 27
25#include <mach/hardware.h>
26#include <asm/mach-types.h> 28#include <asm/mach-types.h>
27#include <mach/pm.h> 29#include <mach/pm.h>
30#include <mach/pxa2xx-regs.h>
28#include <mach/pxa2xx-gpio.h> 31#include <mach/pxa2xx-gpio.h>
32#include <mach/regs-rtc.h>
29#include <mach/sharpsl.h> 33#include <mach/sharpsl.h>
34#include <mach/sharpsl_pm.h>
35
30#include "sharpsl.h" 36#include "sharpsl.h"
31 37
38/*
39 * Constants
40 */
41#define SHARPSL_CHARGE_ON_TIME_INTERVAL (msecs_to_jiffies(1*60*1000)) /* 1 min */
42#define SHARPSL_CHARGE_FINISH_TIME (msecs_to_jiffies(10*60*1000)) /* 10 min */
43#define SHARPSL_BATCHK_TIME (msecs_to_jiffies(15*1000)) /* 15 sec */
44#define SHARPSL_BATCHK_TIME_SUSPEND (60*10) /* 10 min */
45
46#define SHARPSL_WAIT_CO_TIME 15 /* 15 sec */
47#define SHARPSL_WAIT_DISCHARGE_ON 100 /* 100 msec */
48#define SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP 10 /* 10 msec */
49#define SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT 10 /* 10 msec */
50#define SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN 10 /* 10 msec */
51#define SHARPSL_CHARGE_WAIT_TIME 15 /* 15 msec */
52#define SHARPSL_CHARGE_CO_CHECK_TIME 5 /* 5 msec */
53#define SHARPSL_CHARGE_RETRY_CNT 1 /* eqv. 10 min */
54
55/*
56 * Prototypes
57 */
58#ifdef CONFIG_PM
59static int sharpsl_off_charge_battery(void);
60static int sharpsl_check_battery_voltage(void);
61static int sharpsl_fatal_check(void);
62#endif
63static int sharpsl_check_battery_temp(void);
64static int sharpsl_ac_check(void);
65static int sharpsl_average_value(int ad);
66static void sharpsl_average_clear(void);
67static void sharpsl_charge_toggle(struct work_struct *private_);
68static void sharpsl_battery_thread(struct work_struct *private_);
69
70
71/*
72 * Variables
73 */
74struct sharpsl_pm_status sharpsl_pm;
75static DECLARE_DELAYED_WORK(toggle_charger, sharpsl_charge_toggle);
76static DECLARE_DELAYED_WORK(sharpsl_bat, sharpsl_battery_thread);
77DEFINE_LED_TRIGGER(sharpsl_charge_led_trigger);
78
79
80
32struct battery_thresh spitz_battery_levels_acin[] = { 81struct battery_thresh spitz_battery_levels_acin[] = {
33 { 213, 100}, 82 { 213, 100},
34 { 212, 98}, 83 { 212, 98},
@@ -144,42 +193,789 @@ int sharpsl_pm_pxa_read_max1111(int channel)
144#endif 193#endif
145} 194}
146 195
147void sharpsl_pm_pxa_init(void) 196static int get_percentage(int voltage)
197{
198 int i = sharpsl_pm.machinfo->bat_levels - 1;
199 int bl_status = sharpsl_pm.machinfo->backlight_get_status ? sharpsl_pm.machinfo->backlight_get_status() : 0;
200 struct battery_thresh *thresh;
201
202 if (sharpsl_pm.charge_mode == CHRG_ON)
203 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_acin_bl : sharpsl_pm.machinfo->bat_levels_acin;
204 else
205 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_noac_bl : sharpsl_pm.machinfo->bat_levels_noac;
206
207 while (i > 0 && (voltage > thresh[i].voltage))
208 i--;
209
210 return thresh[i].percentage;
211}
212
213static int get_apm_status(int voltage)
214{
215 int low_thresh, high_thresh;
216
217 if (sharpsl_pm.charge_mode == CHRG_ON) {
218 high_thresh = sharpsl_pm.machinfo->status_high_acin;
219 low_thresh = sharpsl_pm.machinfo->status_low_acin;
220 } else {
221 high_thresh = sharpsl_pm.machinfo->status_high_noac;
222 low_thresh = sharpsl_pm.machinfo->status_low_noac;
223 }
224
225 if (voltage >= high_thresh)
226 return APM_BATTERY_STATUS_HIGH;
227 if (voltage >= low_thresh)
228 return APM_BATTERY_STATUS_LOW;
229 return APM_BATTERY_STATUS_CRITICAL;
230}
231
232void sharpsl_battery_kick(void)
233{
234 schedule_delayed_work(&sharpsl_bat, msecs_to_jiffies(125));
235}
236EXPORT_SYMBOL(sharpsl_battery_kick);
237
238
239static void sharpsl_battery_thread(struct work_struct *private_)
240{
241 int voltage, percent, apm_status, i = 0;
242
243 if (!sharpsl_pm.machinfo)
244 return;
245
246 sharpsl_pm.battstat.ac_status = (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN) ? APM_AC_ONLINE : APM_AC_OFFLINE);
247
248 /* Corgi cannot confirm when battery fully charged so periodically kick! */
249 if (!sharpsl_pm.machinfo->batfull_irq && (sharpsl_pm.charge_mode == CHRG_ON)
250 && time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_ON_TIME_INTERVAL))
251 schedule_delayed_work(&toggle_charger, 0);
252
253 while(1) {
254 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
255
256 if (voltage > 0) break;
257 if (i++ > 5) {
258 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
259 dev_warn(sharpsl_pm.dev, "Warning: Cannot read main battery!\n");
260 break;
261 }
262 }
263
264 voltage = sharpsl_average_value(voltage);
265 apm_status = get_apm_status(voltage);
266 percent = get_percentage(voltage);
267
268 /* At low battery voltages, the voltage has a tendency to start
269 creeping back up so we try to avoid this here */
270 if ((sharpsl_pm.battstat.ac_status == APM_AC_ONLINE) || (apm_status == APM_BATTERY_STATUS_HIGH) || percent <= sharpsl_pm.battstat.mainbat_percent) {
271 sharpsl_pm.battstat.mainbat_voltage = voltage;
272 sharpsl_pm.battstat.mainbat_status = apm_status;
273 sharpsl_pm.battstat.mainbat_percent = percent;
274 }
275
276 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
277 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
278
279#ifdef CONFIG_BACKLIGHT_CORGI
280 /* If battery is low. limit backlight intensity to save power. */
281 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
282 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) ||
283 (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) {
284 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) {
285 sharpsl_pm.machinfo->backlight_limit(1);
286 sharpsl_pm.flags |= SHARPSL_BL_LIMIT;
287 }
288 } else if (sharpsl_pm.flags & SHARPSL_BL_LIMIT) {
289 sharpsl_pm.machinfo->backlight_limit(0);
290 sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT;
291 }
292#endif
293
294 /* Suspend if critical battery level */
295 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
296 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL)
297 && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) {
298 sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
299 dev_err(sharpsl_pm.dev, "Fatal Off\n");
300 apm_queue_event(APM_CRITICAL_SUSPEND);
301 }
302
303 schedule_delayed_work(&sharpsl_bat, SHARPSL_BATCHK_TIME);
304}
305
306void sharpsl_pm_led(int val)
307{
308 if (val == SHARPSL_LED_ERROR) {
309 dev_err(sharpsl_pm.dev, "Charging Error!\n");
310 } else if (val == SHARPSL_LED_ON) {
311 dev_dbg(sharpsl_pm.dev, "Charge LED On\n");
312 led_trigger_event(sharpsl_charge_led_trigger, LED_FULL);
313 } else {
314 dev_dbg(sharpsl_pm.dev, "Charge LED Off\n");
315 led_trigger_event(sharpsl_charge_led_trigger, LED_OFF);
316 }
317}
318
319static void sharpsl_charge_on(void)
320{
321 dev_dbg(sharpsl_pm.dev, "Turning Charger On\n");
322
323 sharpsl_pm.full_count = 0;
324 sharpsl_pm.charge_mode = CHRG_ON;
325 schedule_delayed_work(&toggle_charger, msecs_to_jiffies(250));
326 schedule_delayed_work(&sharpsl_bat, msecs_to_jiffies(500));
327}
328
329static void sharpsl_charge_off(void)
330{
331 dev_dbg(sharpsl_pm.dev, "Turning Charger Off\n");
332
333 sharpsl_pm.machinfo->charge(0);
334 sharpsl_pm_led(SHARPSL_LED_OFF);
335 sharpsl_pm.charge_mode = CHRG_OFF;
336
337 schedule_delayed_work(&sharpsl_bat, 0);
338}
339
340static void sharpsl_charge_error(void)
148{ 341{
149 pxa_gpio_mode(sharpsl_pm.machinfo->gpio_acin | GPIO_IN); 342 sharpsl_pm_led(SHARPSL_LED_ERROR);
150 pxa_gpio_mode(sharpsl_pm.machinfo->gpio_batfull | GPIO_IN); 343 sharpsl_pm.machinfo->charge(0);
151 pxa_gpio_mode(sharpsl_pm.machinfo->gpio_batlock | GPIO_IN); 344 sharpsl_pm.charge_mode = CHRG_ERROR;
345}
346
347static void sharpsl_charge_toggle(struct work_struct *private_)
348{
349 dev_dbg(sharpsl_pm.dev, "Toogling Charger at time: %lx\n", jiffies);
350
351 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
352 sharpsl_charge_off();
353 return;
354 } else if ((sharpsl_check_battery_temp() < 0) || (sharpsl_ac_check() < 0)) {
355 sharpsl_charge_error();
356 return;
357 }
358
359 sharpsl_pm_led(SHARPSL_LED_ON);
360 sharpsl_pm.machinfo->charge(0);
361 mdelay(SHARPSL_CHARGE_WAIT_TIME);
362 sharpsl_pm.machinfo->charge(1);
363
364 sharpsl_pm.charge_start_time = jiffies;
365}
366
367static void sharpsl_ac_timer(unsigned long data)
368{
369 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
370
371 dev_dbg(sharpsl_pm.dev, "AC Status: %d\n",acin);
372
373 sharpsl_average_clear();
374 if (acin && (sharpsl_pm.charge_mode != CHRG_ON))
375 sharpsl_charge_on();
376 else if (sharpsl_pm.charge_mode == CHRG_ON)
377 sharpsl_charge_off();
378
379 schedule_delayed_work(&sharpsl_bat, 0);
380}
381
382
383static irqreturn_t sharpsl_ac_isr(int irq, void *dev_id)
384{
385 /* Delay the event slightly to debounce */
386 /* Must be a smaller delay than the chrg_full_isr below */
387 mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250));
388
389 return IRQ_HANDLED;
390}
391
392static void sharpsl_chrg_full_timer(unsigned long data)
393{
394 dev_dbg(sharpsl_pm.dev, "Charge Full at time: %lx\n", jiffies);
395
396 sharpsl_pm.full_count++;
397
398 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
399 dev_dbg(sharpsl_pm.dev, "Charge Full: AC removed - stop charging!\n");
400 if (sharpsl_pm.charge_mode == CHRG_ON)
401 sharpsl_charge_off();
402 } else if (sharpsl_pm.full_count < 2) {
403 dev_dbg(sharpsl_pm.dev, "Charge Full: Count too low\n");
404 schedule_delayed_work(&toggle_charger, 0);
405 } else if (time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_FINISH_TIME)) {
406 dev_dbg(sharpsl_pm.dev, "Charge Full: Interrupt generated too slowly - retry.\n");
407 schedule_delayed_work(&toggle_charger, 0);
408 } else {
409 sharpsl_charge_off();
410 sharpsl_pm.charge_mode = CHRG_DONE;
411 dev_dbg(sharpsl_pm.dev, "Charge Full: Charging Finished\n");
412 }
413}
414
415/* Charging Finished Interrupt (Not present on Corgi) */
416/* Can trigger at the same time as an AC status change so
417 delay until after that has been processed */
418static irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id)
419{
420 if (sharpsl_pm.flags & SHARPSL_SUSPENDED)
421 return IRQ_HANDLED;
422
423 /* delay until after any ac interrupt */
424 mod_timer(&sharpsl_pm.chrg_full_timer, jiffies + msecs_to_jiffies(500));
425
426 return IRQ_HANDLED;
427}
428
429static irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id)
430{
431 int is_fatal = 0;
432
433 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) {
434 dev_err(sharpsl_pm.dev, "Battery now Unlocked! Suspending.\n");
435 is_fatal = 1;
436 }
437
438 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL)) {
439 dev_err(sharpsl_pm.dev, "Fatal Batt Error! Suspending.\n");
440 is_fatal = 1;
441 }
442
443 if (!(sharpsl_pm.flags & SHARPSL_APM_QUEUED) && is_fatal) {
444 sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
445 apm_queue_event(APM_CRITICAL_SUSPEND);
446 }
447
448 return IRQ_HANDLED;
449}
450
451/*
452 * Maintain an average of the last 10 readings
453 */
454#define SHARPSL_CNV_VALUE_NUM 10
455static int sharpsl_ad_index;
456
457static void sharpsl_average_clear(void)
458{
459 sharpsl_ad_index = 0;
460}
461
462static int sharpsl_average_value(int ad)
463{
464 int i, ad_val = 0;
465 static int sharpsl_ad[SHARPSL_CNV_VALUE_NUM+1];
466
467 if (sharpsl_pm.battstat.mainbat_status != APM_BATTERY_STATUS_HIGH) {
468 sharpsl_ad_index = 0;
469 return ad;
470 }
471
472 sharpsl_ad[sharpsl_ad_index] = ad;
473 sharpsl_ad_index++;
474 if (sharpsl_ad_index >= SHARPSL_CNV_VALUE_NUM) {
475 for (i=0; i < (SHARPSL_CNV_VALUE_NUM-1); i++)
476 sharpsl_ad[i] = sharpsl_ad[i+1];
477 sharpsl_ad_index = SHARPSL_CNV_VALUE_NUM - 1;
478 }
479 for (i=0; i < sharpsl_ad_index; i++)
480 ad_val += sharpsl_ad[i];
481
482 return (ad_val / sharpsl_ad_index);
483}
484
485/*
486 * Take an array of 5 integers, remove the maximum and minimum values
487 * and return the average.
488 */
489static int get_select_val(int *val)
490{
491 int i, j, k, temp, sum = 0;
492
493 /* Find MAX val */
494 temp = val[0];
495 j=0;
496 for (i=1; i<5; i++) {
497 if (temp < val[i]) {
498 temp = val[i];
499 j = i;
500 }
501 }
502
503 /* Find MIN val */
504 temp = val[4];
505 k=4;
506 for (i=3; i>=0; i--) {
507 if (temp > val[i]) {
508 temp = val[i];
509 k = i;
510 }
511 }
512
513 for (i=0; i<5; i++)
514 if (i != j && i != k )
515 sum += val[i];
516
517 dev_dbg(sharpsl_pm.dev, "Average: %d from values: %d, %d, %d, %d, %d\n", sum/3, val[0], val[1], val[2], val[3], val[4]);
518
519 return (sum/3);
520}
521
522static int sharpsl_check_battery_temp(void)
523{
524 int val, i, buff[5];
525
526 /* Check battery temperature */
527 for (i=0; i<5; i++) {
528 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
529 sharpsl_pm.machinfo->measure_temp(1);
530 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
531 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_TEMP);
532 sharpsl_pm.machinfo->measure_temp(0);
533 }
534
535 val = get_select_val(buff);
536
537 dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
538 if (val > sharpsl_pm.machinfo->charge_on_temp) {
539 printk(KERN_WARNING "Not charging: temperature out of limits.\n");
540 return -1;
541 }
542
543 return 0;
544}
545
546#ifdef CONFIG_PM
547static int sharpsl_check_battery_voltage(void)
548{
549 int val, i, buff[5];
550
551 /* disable charge, enable discharge */
552 sharpsl_pm.machinfo->charge(0);
553 sharpsl_pm.machinfo->discharge(1);
554 mdelay(SHARPSL_WAIT_DISCHARGE_ON);
555
556 if (sharpsl_pm.machinfo->discharge1)
557 sharpsl_pm.machinfo->discharge1(1);
558
559 /* Check battery voltage */
560 for (i=0; i<5; i++) {
561 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
562 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
563 }
564
565 if (sharpsl_pm.machinfo->discharge1)
566 sharpsl_pm.machinfo->discharge1(0);
567
568 sharpsl_pm.machinfo->discharge(0);
569
570 val = get_select_val(buff);
571 dev_dbg(sharpsl_pm.dev, "Battery Voltage: %d\n", val);
572
573 if (val < sharpsl_pm.machinfo->charge_on_volt)
574 return -1;
575
576 return 0;
577}
578#endif
579
580static int sharpsl_ac_check(void)
581{
582 int temp, i, buff[5];
583
584 for (i=0; i<5; i++) {
585 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT);
586 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN);
587 }
588
589 temp = get_select_val(buff);
590 dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n",temp);
591
592 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) {
593 dev_err(sharpsl_pm.dev, "Error: AC check failed.\n");
594 return -1;
595 }
596
597 return 0;
598}
599
600#ifdef CONFIG_PM
601static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state)
602{
603 sharpsl_pm.flags |= SHARPSL_SUSPENDED;
604 flush_scheduled_work();
605
606 if (sharpsl_pm.charge_mode == CHRG_ON)
607 sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG;
608 else
609 sharpsl_pm.flags &= ~SHARPSL_DO_OFFLINE_CHRG;
610
611 return 0;
612}
613
614static int sharpsl_pm_resume(struct platform_device *pdev)
615{
616 /* Clear the reset source indicators as they break the bootloader upon reboot */
617 RCSR = 0x0f;
618 sharpsl_average_clear();
619 sharpsl_pm.flags &= ~SHARPSL_APM_QUEUED;
620 sharpsl_pm.flags &= ~SHARPSL_SUSPENDED;
621
622 return 0;
623}
624
625static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
626{
627 dev_dbg(sharpsl_pm.dev, "Time is: %08x\n",RCNR);
628
629 dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n",sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG);
630 /* not charging and AC-IN! */
631
632 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) {
633 dev_dbg(sharpsl_pm.dev, "Activating Offline Charger...\n");
634 sharpsl_pm.charge_mode = CHRG_OFF;
635 sharpsl_pm.flags &= ~SHARPSL_DO_OFFLINE_CHRG;
636 sharpsl_off_charge_battery();
637 }
638
639 sharpsl_pm.machinfo->presuspend();
640
641 PEDR = 0xffffffff; /* clear it */
642
643 sharpsl_pm.flags &= ~SHARPSL_ALARM_ACTIVE;
644 if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) {
645 RTSR &= RTSR_ALE;
646 RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND;
647 dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n",RTAR);
648 sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE;
649 } else if (alarm_enable) {
650 RTSR &= RTSR_ALE;
651 RTAR = alarm_time;
652 dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n",RTAR);
653 } else {
654 dev_dbg(sharpsl_pm.dev, "No alarms set.\n");
655 }
656
657 pxa_pm_enter(state);
658
659 sharpsl_pm.machinfo->postsuspend();
660
661 dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n",PEDR);
662}
663
664static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
665{
666 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable) )
667 {
668 if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) {
669 dev_dbg(sharpsl_pm.dev, "No user triggered wakeup events and not charging. Strange. Suspend.\n");
670 corgi_goto_sleep(alarm_time, alarm_enable, state);
671 return 1;
672 }
673 if(sharpsl_off_charge_battery()) {
674 dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
675 corgi_goto_sleep(alarm_time, alarm_enable, state);
676 return 1;
677 }
678 dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n");
679 }
680
681 if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || (sharpsl_fatal_check() < 0) )
682 {
683 dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n");
684 corgi_goto_sleep(alarm_time, alarm_enable, state);
685 return 1;
686 }
687
688 return 0;
689}
690
691static int corgi_pxa_pm_enter(suspend_state_t state)
692{
693 unsigned long alarm_time = RTAR;
694 unsigned int alarm_status = ((RTSR & RTSR_ALE) != 0);
695
696 dev_dbg(sharpsl_pm.dev, "SharpSL suspending for first time.\n");
697
698 corgi_goto_sleep(alarm_time, alarm_status, state);
699
700 while (corgi_enter_suspend(alarm_time,alarm_status,state))
701 {}
702
703 if (sharpsl_pm.machinfo->earlyresume)
704 sharpsl_pm.machinfo->earlyresume();
705
706 dev_dbg(sharpsl_pm.dev, "SharpSL resuming...\n");
707
708 return 0;
709}
710
711/*
712 * Check for fatal battery errors
713 * Fatal returns -1
714 */
715static int sharpsl_fatal_check(void)
716{
717 int buff[5], temp, i, acin;
718
719 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check entered\n");
720
721 /* Check AC-Adapter */
722 acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
723
724 if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) {
725 sharpsl_pm.machinfo->charge(0);
726 udelay(100);
727 sharpsl_pm.machinfo->discharge(1); /* enable discharge */
728 mdelay(SHARPSL_WAIT_DISCHARGE_ON);
729 }
730
731 if (sharpsl_pm.machinfo->discharge1)
732 sharpsl_pm.machinfo->discharge1(1);
733
734 /* Check battery : check inserting battery ? */
735 for (i=0; i<5; i++) {
736 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
737 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
738 }
739
740 if (sharpsl_pm.machinfo->discharge1)
741 sharpsl_pm.machinfo->discharge1(0);
742
743 if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) {
744 udelay(100);
745 sharpsl_pm.machinfo->charge(1);
746 sharpsl_pm.machinfo->discharge(0);
747 }
748
749 temp = get_select_val(buff);
750 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT));
751
752 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) ||
753 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt)))
754 return -1;
755 return 0;
756}
757
758static int sharpsl_off_charge_error(void)
759{
760 dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n");
761 sharpsl_pm.machinfo->charge(0);
762 sharpsl_pm_led(SHARPSL_LED_ERROR);
763 sharpsl_pm.charge_mode = CHRG_ERROR;
764 return 1;
765}
766
767/*
768 * Charging Control while suspended
769 * Return 1 - go straight to sleep
770 * Return 0 - sleep or wakeup depending on other factors
771 */
772static int sharpsl_off_charge_battery(void)
773{
774 int time;
775
776 dev_dbg(sharpsl_pm.dev, "Charge Mode: %d\n", sharpsl_pm.charge_mode);
777
778 if (sharpsl_pm.charge_mode == CHRG_OFF) {
779 dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 1\n");
780
781 /* AC Check */
782 if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery_temp() < 0))
783 return sharpsl_off_charge_error();
784
785 /* Start Charging */
786 sharpsl_pm_led(SHARPSL_LED_ON);
787 sharpsl_pm.machinfo->charge(0);
788 mdelay(SHARPSL_CHARGE_WAIT_TIME);
789 sharpsl_pm.machinfo->charge(1);
790
791 sharpsl_pm.charge_mode = CHRG_ON;
792 sharpsl_pm.full_count = 0;
793
794 return 1;
795 } else if (sharpsl_pm.charge_mode != CHRG_ON) {
796 return 1;
797 }
798
799 if (sharpsl_pm.full_count == 0) {
800 int time;
801
802 dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 2\n");
803
804 if ((sharpsl_check_battery_temp() < 0) || (sharpsl_check_battery_voltage() < 0))
805 return sharpsl_off_charge_error();
806
807 sharpsl_pm.machinfo->charge(0);
808 mdelay(SHARPSL_CHARGE_WAIT_TIME);
809 sharpsl_pm.machinfo->charge(1);
810 sharpsl_pm.charge_mode = CHRG_ON;
811
812 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
813
814 time = RCNR;
815 while(1) {
816 /* Check if any wakeup event had occurred */
817 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
818 return 0;
819 /* Check for timeout */
820 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME)
821 return 1;
822 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
823 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occurred. Retrying to check\n");
824 sharpsl_pm.full_count++;
825 sharpsl_pm.machinfo->charge(0);
826 mdelay(SHARPSL_CHARGE_WAIT_TIME);
827 sharpsl_pm.machinfo->charge(1);
828 return 1;
829 }
830 }
831 }
832
833 dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 3\n");
834
835 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
836
837 time = RCNR;
838 while(1) {
839 /* Check if any wakeup event had occurred */
840 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
841 return 0;
842 /* Check for timeout */
843 if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) {
844 if (sharpsl_pm.full_count > SHARPSL_CHARGE_RETRY_CNT) {
845 dev_dbg(sharpsl_pm.dev, "Offline Charger: Not charged sufficiently. Retrying.\n");
846 sharpsl_pm.full_count = 0;
847 }
848 sharpsl_pm.full_count++;
849 return 1;
850 }
851 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
852 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charging complete.\n");
853 sharpsl_pm_led(SHARPSL_LED_OFF);
854 sharpsl_pm.machinfo->charge(0);
855 sharpsl_pm.charge_mode = CHRG_DONE;
856 return 1;
857 }
858 }
859}
860#else
861#define sharpsl_pm_suspend NULL
862#define sharpsl_pm_resume NULL
863#endif
864
865static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf)
866{
867 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_percent);
868}
869
870static ssize_t battery_voltage_show(struct device *dev, struct device_attribute *attr, char *buf)
871{
872 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_voltage);
873}
874
875static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL);
876static DEVICE_ATTR(battery_voltage, 0444, battery_voltage_show, NULL);
877
878extern void (*apm_get_power_status)(struct apm_power_info *);
879
880static void sharpsl_apm_get_power_status(struct apm_power_info *info)
881{
882 info->ac_line_status = sharpsl_pm.battstat.ac_status;
883
884 if (sharpsl_pm.charge_mode == CHRG_ON)
885 info->battery_status = APM_BATTERY_STATUS_CHARGING;
886 else
887 info->battery_status = sharpsl_pm.battstat.mainbat_status;
888
889 info->battery_flag = (1 << info->battery_status);
890 info->battery_life = sharpsl_pm.battstat.mainbat_percent;
891}
892
893#ifdef CONFIG_PM
894static struct platform_suspend_ops sharpsl_pm_ops = {
895 .prepare = pxa_pm_prepare,
896 .finish = pxa_pm_finish,
897 .enter = corgi_pxa_pm_enter,
898 .valid = suspend_valid_only_mem,
899};
900#endif
901
902static int __init sharpsl_pm_probe(struct platform_device *pdev)
903{
904 int ret;
905
906 if (!pdev->dev.platform_data)
907 return -EINVAL;
908
909 sharpsl_pm.dev = &pdev->dev;
910 sharpsl_pm.machinfo = pdev->dev.platform_data;
911 sharpsl_pm.charge_mode = CHRG_OFF;
912 sharpsl_pm.flags = 0;
913
914 init_timer(&sharpsl_pm.ac_timer);
915 sharpsl_pm.ac_timer.function = sharpsl_ac_timer;
916
917 init_timer(&sharpsl_pm.chrg_full_timer);
918 sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer;
919
920 led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger);
921
922 sharpsl_pm.machinfo->init();
923
924 gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN");
925 gpio_direction_input(sharpsl_pm.machinfo->gpio_acin);
926 gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full");
927 gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull);
928 gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock");
929 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
152 930
153 /* Register interrupt handlers */ 931 /* Register interrupt handlers */
154 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED, "AC Input Detect", sharpsl_ac_isr)) { 932 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
155 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin)); 933 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin));
156 } 934 }
157 else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin),IRQ_TYPE_EDGE_BOTH);
158 935
159 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED, "Battery Cover", sharpsl_fatal_isr)) { 936 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
160 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock)); 937 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock));
161 } 938 }
162 else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock),IRQ_TYPE_EDGE_FALLING);
163 939
164 if (sharpsl_pm.machinfo->gpio_fatal) { 940 if (sharpsl_pm.machinfo->gpio_fatal) {
165 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED, "Fatal Battery", sharpsl_fatal_isr)) { 941 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
166 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal)); 942 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal));
167 } 943 }
168 else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQ_TYPE_EDGE_FALLING);
169 } 944 }
170 945
171 if (sharpsl_pm.machinfo->batfull_irq) 946 if (sharpsl_pm.machinfo->batfull_irq)
172 { 947 {
173 /* Register interrupt handler. */ 948 /* Register interrupt handler. */
174 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED, "CO", sharpsl_chrg_full_isr)) { 949 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
175 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull)); 950 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull));
176 } 951 }
177 else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull),IRQ_TYPE_EDGE_RISING);
178 } 952 }
953
954 ret = device_create_file(&pdev->dev, &dev_attr_battery_percentage);
955 ret |= device_create_file(&pdev->dev, &dev_attr_battery_voltage);
956 if (ret != 0)
957 dev_warn(&pdev->dev, "Failed to register attributes (%d)\n", ret);
958
959 apm_get_power_status = sharpsl_apm_get_power_status;
960
961#ifdef CONFIG_PM
962 suspend_set_ops(&sharpsl_pm_ops);
963#endif
964
965 mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250));
966
967 return 0;
179} 968}
180 969
181void sharpsl_pm_pxa_remove(void) 970static int sharpsl_pm_remove(struct platform_device *pdev)
182{ 971{
972 suspend_set_ops(NULL);
973
974 device_remove_file(&pdev->dev, &dev_attr_battery_percentage);
975 device_remove_file(&pdev->dev, &dev_attr_battery_voltage);
976
977 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
978
183 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); 979 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
184 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr); 980 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
185 981
@@ -188,4 +984,39 @@ void sharpsl_pm_pxa_remove(void)
188 984
189 if (sharpsl_pm.machinfo->batfull_irq) 985 if (sharpsl_pm.machinfo->batfull_irq)
190 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); 986 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
987
988 gpio_free(sharpsl_pm.machinfo->gpio_batlock);
989 gpio_free(sharpsl_pm.machinfo->gpio_batfull);
990 gpio_free(sharpsl_pm.machinfo->gpio_acin);
991
992 if (sharpsl_pm.machinfo->exit)
993 sharpsl_pm.machinfo->exit();
994
995 del_timer_sync(&sharpsl_pm.chrg_full_timer);
996 del_timer_sync(&sharpsl_pm.ac_timer);
997
998 return 0;
191} 999}
1000
1001static struct platform_driver sharpsl_pm_driver = {
1002 .probe = sharpsl_pm_probe,
1003 .remove = sharpsl_pm_remove,
1004 .suspend = sharpsl_pm_suspend,
1005 .resume = sharpsl_pm_resume,
1006 .driver = {
1007 .name = "sharpsl-pm",
1008 },
1009};
1010
1011static int __devinit sharpsl_pm_init(void)
1012{
1013 return platform_driver_register(&sharpsl_pm_driver);
1014}
1015
1016static void sharpsl_pm_exit(void)
1017{
1018 platform_driver_unregister(&sharpsl_pm_driver);
1019}
1020
1021late_initcall(sharpsl_pm_init);
1022module_exit(sharpsl_pm_exit);
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 5a45fe340a10..dda310fe71c8 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -13,19 +13,11 @@
13 */ 13 */
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
18#include <linux/delay.h> 17#include <linux/delay.h>
19#include <linux/major.h>
20#include <linux/fs.h>
21#include <linux/interrupt.h>
22#include <linux/gpio.h> 18#include <linux/gpio.h>
23#include <linux/leds.h> 19#include <linux/leds.h>
24#include <linux/mmc/host.h>
25#include <linux/mtd/physmap.h> 20#include <linux/mtd/physmap.h>
26#include <linux/pm.h>
27#include <linux/backlight.h>
28#include <linux/io.h>
29#include <linux/i2c.h> 21#include <linux/i2c.h>
30#include <linux/i2c/pca953x.h> 22#include <linux/i2c/pca953x.h>
31#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
@@ -34,31 +26,22 @@
34#include <linux/mtd/sharpsl.h> 26#include <linux/mtd/sharpsl.h>
35 27
36#include <asm/setup.h> 28#include <asm/setup.h>
37#include <asm/memory.h>
38#include <asm/mach-types.h> 29#include <asm/mach-types.h>
39#include <mach/hardware.h>
40#include <asm/irq.h>
41#include <asm/system.h>
42
43#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
44#include <asm/mach/map.h> 31#include <asm/mach/sharpsl_param.h>
45#include <asm/mach/irq.h> 32#include <asm/hardware/scoop.h>
33
46 34
47#include <mach/pxa27x.h> 35#include <mach/pxa27x.h>
48#include <mach/pxa27x-udc.h> 36#include <mach/pxa27x-udc.h>
49#include <mach/reset.h> 37#include <mach/reset.h>
50#include <mach/i2c.h> 38#include <plat/i2c.h>
51#include <mach/irda.h> 39#include <mach/irda.h>
52#include <mach/mmc.h> 40#include <mach/mmc.h>
53#include <mach/ohci.h> 41#include <mach/ohci.h>
54#include <mach/udc.h>
55#include <mach/pxafb.h> 42#include <mach/pxafb.h>
56#include <mach/pxa2xx_spi.h> 43#include <mach/pxa2xx_spi.h>
57#include <mach/spitz.h> 44#include <mach/spitz.h>
58#include <mach/sharpsl.h>
59
60#include <asm/mach/sharpsl_param.h>
61#include <asm/hardware/scoop.h>
62 45
63#include "generic.h" 46#include "generic.h"
64#include "devices.h" 47#include "devices.h"
@@ -317,13 +300,8 @@ static struct ads7846_platform_data spitz_ads7846_info = {
317 .wait_for_sync = spitz_wait_for_hsync, 300 .wait_for_sync = spitz_wait_for_hsync,
318}; 301};
319 302
320static void spitz_ads7846_cs(u32 command)
321{
322 gpio_set_value(SPITZ_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT));
323}
324
325static struct pxa2xx_spi_chip spitz_ads7846_chip = { 303static struct pxa2xx_spi_chip spitz_ads7846_chip = {
326 .cs_control = spitz_ads7846_cs, 304 .gpio_cs = SPITZ_GPIO_ADS7846_CS,
327}; 305};
328 306
329static void spitz_bl_kick_battery(void) 307static void spitz_bl_kick_battery(void)
@@ -347,22 +325,12 @@ static struct corgi_lcd_platform_data spitz_lcdcon_info = {
347 .kick_battery = spitz_bl_kick_battery, 325 .kick_battery = spitz_bl_kick_battery,
348}; 326};
349 327
350static void spitz_lcdcon_cs(u32 command)
351{
352 gpio_set_value(SPITZ_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT));
353}
354
355static struct pxa2xx_spi_chip spitz_lcdcon_chip = { 328static struct pxa2xx_spi_chip spitz_lcdcon_chip = {
356 .cs_control = spitz_lcdcon_cs, 329 .gpio_cs = SPITZ_GPIO_LCDCON_CS,
357}; 330};
358 331
359static void spitz_max1111_cs(u32 command)
360{
361 gpio_set_value(SPITZ_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT));
362}
363
364static struct pxa2xx_spi_chip spitz_max1111_chip = { 332static struct pxa2xx_spi_chip spitz_max1111_chip = {
365 .cs_control = spitz_max1111_cs, 333 .gpio_cs = SPITZ_GPIO_MAX1111_CS,
366}; 334};
367 335
368static struct spi_board_info spitz_spi_devices[] = { 336static struct spi_board_info spitz_spi_devices[] = {
@@ -392,30 +360,6 @@ static struct spi_board_info spitz_spi_devices[] = {
392 360
393static void __init spitz_init_spi(void) 361static void __init spitz_init_spi(void)
394{ 362{
395 int err;
396
397 err = gpio_request(SPITZ_GPIO_ADS7846_CS, "ADS7846_CS");
398 if (err)
399 return;
400
401 err = gpio_request(SPITZ_GPIO_LCDCON_CS, "LCDCON_CS");
402 if (err)
403 goto err_free_1;
404
405 err = gpio_request(SPITZ_GPIO_MAX1111_CS, "MAX1111_CS");
406 if (err)
407 goto err_free_2;
408
409 err = gpio_direction_output(SPITZ_GPIO_ADS7846_CS, 1);
410 if (err)
411 goto err_free_3;
412 err = gpio_direction_output(SPITZ_GPIO_LCDCON_CS, 1);
413 if (err)
414 goto err_free_3;
415 err = gpio_direction_output(SPITZ_GPIO_MAX1111_CS, 1);
416 if (err)
417 goto err_free_3;
418
419 if (machine_is_akita()) { 363 if (machine_is_akita()) {
420 spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; 364 spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT;
421 spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; 365 spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON;
@@ -423,14 +367,6 @@ static void __init spitz_init_spi(void)
423 367
424 pxa2xx_set_spi_info(2, &spitz_spi_info); 368 pxa2xx_set_spi_info(2, &spitz_spi_info);
425 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); 369 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
426 return;
427
428err_free_3:
429 gpio_free(SPITZ_GPIO_MAX1111_CS);
430err_free_2:
431 gpio_free(SPITZ_GPIO_LCDCON_CS);
432err_free_1:
433 gpio_free(SPITZ_GPIO_ADS7846_CS);
434} 370}
435#else 371#else
436static inline void spitz_init_spi(void) {} 372static inline void spitz_init_spi(void) {}
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 2e4490562c9e..724ffb030317 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -41,7 +41,6 @@ static void spitz_charger_init(void)
41{ 41{
42 pxa_gpio_mode(SPITZ_GPIO_KEY_INT | GPIO_IN); 42 pxa_gpio_mode(SPITZ_GPIO_KEY_INT | GPIO_IN);
43 pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN); 43 pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN);
44 sharpsl_pm_pxa_init();
45} 44}
46 45
47static void spitz_measure_temp(int on) 46static void spitz_measure_temp(int on)
@@ -182,7 +181,7 @@ unsigned long spitzpm_read_devdata(int type)
182 181
183struct sharpsl_charger_machinfo spitz_pm_machinfo = { 182struct sharpsl_charger_machinfo spitz_pm_machinfo = {
184 .init = spitz_charger_init, 183 .init = spitz_charger_init,
185 .exit = sharpsl_pm_pxa_remove, 184 .exit = NULL,
186 .gpio_batlock = SPITZ_GPIO_BAT_COVER, 185 .gpio_batlock = SPITZ_GPIO_BAT_COVER,
187 .gpio_acin = SPITZ_GPIO_AC_IN, 186 .gpio_acin = SPITZ_GPIO_AC_IN,
188 .gpio_batfull = SPITZ_GPIO_CHRG_FULL, 187 .gpio_batfull = SPITZ_GPIO_CHRG_FULL,
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
new file mode 100644
index 000000000000..3b205b69f3fb
--- /dev/null
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -0,0 +1,796 @@
1/*
2 * linux/arch/arm/mach-pxa/stargate2.c
3 *
4 * Author: Ed C. Epp
5 * Created: Nov 05, 2002
6 * Copyright: Intel Corp.
7 *
8 * Modified 2009: Jonathan Cameron <jic23@cam.ac.uk>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/interrupt.h>
18#include <linux/sched.h>
19#include <linux/bitops.h>
20#include <linux/fb.h>
21#include <linux/delay.h>
22#include <linux/platform_device.h>
23#include <linux/regulator/machine.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/plat-ram.h>
26#include <linux/mtd/partitions.h>
27
28#include <linux/i2c/pcf857x.h>
29#include <linux/i2c/at24.h>
30#include <linux/smc91x.h>
31#include <linux/gpio.h>
32
33#include <asm/types.h>
34#include <asm/setup.h>
35#include <asm/memory.h>
36#include <asm/mach-types.h>
37#include <asm/irq.h>
38
39#include <asm/mach/arch.h>
40#include <asm/mach/map.h>
41#include <asm/mach/irq.h>
42#include <asm/mach/flash.h>
43
44#include <mach/pxa27x.h>
45#include <plat/i2c.h>
46#include <mach/mmc.h>
47#include <mach/udc.h>
48#include <mach/pxa2xx_spi.h>
49#include <mach/pxa27x-udc.h>
50
51#include <linux/spi/spi.h>
52#include <linux/mfd/da903x.h>
53#include <linux/sht15.h>
54
55#include "devices.h"
56#include "generic.h"
57
58/* Bluetooth */
59#define SG2_BT_RESET 81
60
61/* SD */
62#define SG2_GPIO_nSD_DETECT 90
63#define SG2_SD_POWER_ENABLE 89
64
65static unsigned long stargate2_pin_config[] __initdata = {
66
67 GPIO15_nCS_1, /* SRAM */
68 /* SMC91x */
69 GPIO80_nCS_4,
70 GPIO40_GPIO, /*cable detect?*/
71 /* Device Identification for wakeup*/
72 GPIO102_GPIO,
73
74 /* Button */
75 GPIO91_GPIO | WAKEUP_ON_LEVEL_HIGH,
76
77 /* DA9030 */
78 GPIO1_GPIO,
79
80 /* Compact Flash */
81 GPIO79_PSKTSEL,
82 GPIO48_nPOE,
83 GPIO49_nPWE,
84 GPIO50_nPIOR,
85 GPIO51_nPIOW,
86 GPIO85_nPCE_1,
87 GPIO54_nPCE_2,
88 GPIO55_nPREG,
89 GPIO56_nPWAIT,
90 GPIO57_nIOIS16,
91 GPIO120_GPIO, /* Buff ctrl */
92 GPIO108_GPIO, /* Power ctrl */
93 GPIO82_GPIO, /* Reset */
94 GPIO53_GPIO, /* SG2_S0_GPIO_DETECT */
95
96 /* MMC */
97 GPIO32_MMC_CLK,
98 GPIO112_MMC_CMD,
99 GPIO92_MMC_DAT_0,
100 GPIO109_MMC_DAT_1,
101 GPIO110_MMC_DAT_2,
102 GPIO111_MMC_DAT_3,
103 GPIO90_GPIO, /* nSD detect */
104 GPIO89_GPIO, /* SD_POWER_ENABLE */
105
106 /* Bluetooth */
107 GPIO81_GPIO, /* reset */
108
109 /* cc2420 802.15.4 radio */
110 GPIO22_GPIO, /* CC_RSTN (out)*/
111 GPIO114_GPIO, /* CC_FIFO (in) */
112 GPIO116_GPIO, /* CC_CCA (in) */
113 GPIO0_GPIO, /* CC_FIFOP (in) */
114 GPIO16_GPIO, /* CCSFD (in) */
115 GPIO39_GPIO, /* CSn (out) */
116
117 /* I2C */
118 GPIO117_I2C_SCL,
119 GPIO118_I2C_SDA,
120
121 /* SSP 3 - 802.15.4 radio */
122 GPIO39_GPIO, /* chip select */
123 GPIO34_SSP3_SCLK,
124 GPIO35_SSP3_TXD,
125 GPIO41_SSP3_RXD,
126
127 /* SSP 2 */
128 GPIO11_SSP2_RXD,
129 GPIO38_SSP2_TXD,
130 GPIO36_SSP2_SCLK,
131 GPIO37_GPIO, /* chip select */
132
133 /* SSP 1 */
134 GPIO26_SSP1_RXD,
135 GPIO25_SSP1_TXD,
136 GPIO23_SSP1_SCLK,
137 GPIO24_GPIO, /* chip select */
138
139 /* BTUART */
140 GPIO42_BTUART_RXD,
141 GPIO43_BTUART_TXD,
142 GPIO44_BTUART_CTS,
143 GPIO45_BTUART_RTS,
144
145 /* STUART */
146 GPIO46_STUART_RXD,
147 GPIO47_STUART_TXD,
148
149 /* Basic sensor board */
150 GPIO96_GPIO, /* accelerometer interrupt */
151 GPIO99_GPIO, /* ADC interrupt */
152
153 /* Connector pins specified as gpios */
154 GPIO94_GPIO, /* large basic connector pin 14 */
155 GPIO10_GPIO, /* large basic connector pin 23 */
156
157 /* SHT15 */
158 GPIO100_GPIO,
159 GPIO98_GPIO,
160};
161
162/**
163 * stargate2_reset_bluetooth() reset the bluecore to ensure consistent state
164 **/
165static int stargate2_reset_bluetooth(void)
166{
167 int err;
168 err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET");
169 if (err) {
170 printk(KERN_ERR "Could not get gpio for bluetooth reset \n");
171 return err;
172 }
173 gpio_direction_output(SG2_BT_RESET, 1);
174 mdelay(5);
175 /* now reset it - 5 msec minimum */
176 gpio_set_value(SG2_BT_RESET, 0);
177 mdelay(10);
178 gpio_set_value(SG2_BT_RESET, 1);
179 gpio_free(SG2_BT_RESET);
180 return 0;
181}
182
183static struct led_info stargate2_leds[] = {
184 {
185 .name = "sg2:red",
186 .flags = DA9030_LED_RATE_ON,
187 }, {
188 .name = "sg2:blue",
189 .flags = DA9030_LED_RATE_ON,
190 }, {
191 .name = "sg2:green",
192 .flags = DA9030_LED_RATE_ON,
193 },
194};
195
196static struct sht15_platform_data platform_data_sht15 = {
197 .gpio_data = 100,
198 .gpio_sck = 98,
199};
200
201static struct platform_device sht15 = {
202 .name = "sht15",
203 .id = -1,
204 .dev = {
205 .platform_data = &platform_data_sht15,
206 },
207};
208
209static struct regulator_consumer_supply stargate2_sensor_3_con[] = {
210 {
211 .dev = &sht15.dev,
212 .supply = "vcc",
213 },
214};
215
216enum stargate2_ldos{
217 vcc_vref,
218 vcc_cc2420,
219 /* a mote connector? */
220 vcc_mica,
221 /* the CSR bluecore chip */
222 vcc_bt,
223 /* The two voltages available to sensor boards */
224 vcc_sensor_1_8,
225 vcc_sensor_3,
226 /* directly connected to the pxa27x */
227 vcc_sram_ext,
228 vcc_pxa_pll,
229 vcc_pxa_usim, /* Reference voltage for certain gpios */
230 vcc_pxa_mem,
231 vcc_pxa_flash,
232 vcc_pxa_core, /*Dc-Dc buck not yet supported */
233 vcc_lcd,
234 vcc_bb,
235 vcc_bbio, /*not sure!*/
236 vcc_io, /* cc2420 802.15.4 radio and pxa vcc_io ?*/
237};
238
239/* The values of the various regulator constraints are obviously dependent
240 * on exactly what is wired to each ldo. Unfortunately this information is
241 * not generally available. More information has been requested from Xbow.
242 */
243static struct regulator_init_data stargate2_ldo_init_data[] = {
244 [vcc_bbio] = {
245 .constraints = { /* board default 1.8V */
246 .name = "vcc_bbio",
247 .min_uV = 1800000,
248 .max_uV = 1800000,
249 },
250 },
251 [vcc_bb] = {
252 .constraints = { /* board default 2.8V */
253 .name = "vcc_bb",
254 .min_uV = 2700000,
255 .max_uV = 3000000,
256 },
257 },
258 [vcc_pxa_flash] = {
259 .constraints = {/* default is 1.8V */
260 .name = "vcc_pxa_flash",
261 .min_uV = 1800000,
262 .max_uV = 1800000,
263 },
264 },
265 [vcc_cc2420] = { /* also vcc_io */
266 .constraints = {
267 /* board default is 2.8V */
268 .name = "vcc_cc2420",
269 .min_uV = 2700000,
270 .max_uV = 3300000,
271 },
272 },
273 [vcc_vref] = { /* Reference for what? */
274 .constraints = { /* default 1.8V */
275 .name = "vcc_vref",
276 .min_uV = 1800000,
277 .max_uV = 1800000,
278 },
279 },
280 [vcc_sram_ext] = {
281 .constraints = { /* default 2.8V */
282 .name = "vcc_sram_ext",
283 .min_uV = 2800000,
284 .max_uV = 2800000,
285 },
286 },
287 [vcc_mica] = {
288 .constraints = { /* default 2.8V */
289 .name = "vcc_mica",
290 .min_uV = 2800000,
291 .max_uV = 2800000,
292 },
293 },
294 [vcc_bt] = {
295 .constraints = { /* default 2.8V */
296 .name = "vcc_bt",
297 .min_uV = 2800000,
298 .max_uV = 2800000,
299 },
300 },
301 [vcc_lcd] = {
302 .constraints = { /* default 2.8V */
303 .name = "vcc_lcd",
304 .min_uV = 2700000,
305 .max_uV = 3300000,
306 },
307 },
308 [vcc_io] = { /* Same or higher than everything
309 * bar vccbat and vccusb */
310 .constraints = { /* default 2.8V */
311 .name = "vcc_io",
312 .min_uV = 2692000,
313 .max_uV = 3300000,
314 },
315 },
316 [vcc_sensor_1_8] = {
317 .constraints = { /* default 1.8V */
318 .name = "vcc_sensor_1_8",
319 .min_uV = 1800000,
320 .max_uV = 1800000,
321 },
322 },
323 [vcc_sensor_3] = { /* curiously default 2.8V */
324 .constraints = {
325 .name = "vcc_sensor_3",
326 .min_uV = 2800000,
327 .max_uV = 3000000,
328 },
329 .num_consumer_supplies = ARRAY_SIZE(stargate2_sensor_3_con),
330 .consumer_supplies = stargate2_sensor_3_con,
331 },
332 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/
333 .constraints = {
334 .name = "vcc_pxa_pll",
335 .min_uV = 1170000,
336 .max_uV = 1430000,
337 },
338 },
339 [vcc_pxa_usim] = {
340 .constraints = { /* default 1.8V */
341 .name = "vcc_pxa_usim",
342 .min_uV = 1710000,
343 .max_uV = 2160000,
344 },
345 },
346 [vcc_pxa_mem] = {
347 .constraints = { /* default 1.8V */
348 .name = "vcc_pxa_mem",
349 .min_uV = 1800000,
350 .max_uV = 1800000,
351 },
352 },
353};
354
355static struct da903x_subdev_info stargate2_da9030_subdevs[] = {
356 {
357 .name = "da903x-led",
358 .id = DA9030_ID_LED_2,
359 .platform_data = &stargate2_leds[0],
360 }, {
361 .name = "da903x-led",
362 .id = DA9030_ID_LED_3,
363 .platform_data = &stargate2_leds[2],
364 }, {
365 .name = "da903x-led",
366 .id = DA9030_ID_LED_4,
367 .platform_data = &stargate2_leds[1],
368 }, {
369 .name = "da903x-regulator",
370 .id = DA9030_ID_LDO2,
371 .platform_data = &stargate2_ldo_init_data[vcc_bbio],
372 }, {
373 .name = "da903x-regulator",
374 .id = DA9030_ID_LDO3,
375 .platform_data = &stargate2_ldo_init_data[vcc_bb],
376 }, {
377 .name = "da903x-regulator",
378 .id = DA9030_ID_LDO4,
379 .platform_data = &stargate2_ldo_init_data[vcc_pxa_flash],
380 }, {
381 .name = "da903x-regulator",
382 .id = DA9030_ID_LDO5,
383 .platform_data = &stargate2_ldo_init_data[vcc_cc2420],
384 }, {
385 .name = "da903x-regulator",
386 .id = DA9030_ID_LDO6,
387 .platform_data = &stargate2_ldo_init_data[vcc_vref],
388 }, {
389 .name = "da903x-regulator",
390 .id = DA9030_ID_LDO7,
391 .platform_data = &stargate2_ldo_init_data[vcc_sram_ext],
392 }, {
393 .name = "da903x-regulator",
394 .id = DA9030_ID_LDO8,
395 .platform_data = &stargate2_ldo_init_data[vcc_mica],
396 }, {
397 .name = "da903x-regulator",
398 .id = DA9030_ID_LDO9,
399 .platform_data = &stargate2_ldo_init_data[vcc_bt],
400 }, {
401 .name = "da903x-regulator",
402 .id = DA9030_ID_LDO10,
403 .platform_data = &stargate2_ldo_init_data[vcc_sensor_1_8],
404 }, {
405 .name = "da903x-regulator",
406 .id = DA9030_ID_LDO11,
407 .platform_data = &stargate2_ldo_init_data[vcc_sensor_3],
408 }, {
409 .name = "da903x-regulator",
410 .id = DA9030_ID_LDO12,
411 .platform_data = &stargate2_ldo_init_data[vcc_lcd],
412 }, {
413 .name = "da903x-regulator",
414 .id = DA9030_ID_LDO15,
415 .platform_data = &stargate2_ldo_init_data[vcc_pxa_pll],
416 }, {
417 .name = "da903x-regulator",
418 .id = DA9030_ID_LDO17,
419 .platform_data = &stargate2_ldo_init_data[vcc_pxa_usim],
420 }, {
421 .name = "da903x-regulator", /*pxa vcc i/o and cc2420 vcc i/o */
422 .id = DA9030_ID_LDO18,
423 .platform_data = &stargate2_ldo_init_data[vcc_io],
424 }, {
425 .name = "da903x-regulator",
426 .id = DA9030_ID_LDO19,
427 .platform_data = &stargate2_ldo_init_data[vcc_pxa_mem],
428 },
429};
430
431static struct da903x_platform_data stargate2_da9030_pdata = {
432 .num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs),
433 .subdevs = stargate2_da9030_subdevs,
434};
435
436static struct resource smc91x_resources[] = {
437 [0] = {
438 .name = "smc91x-regs",
439 .start = (PXA_CS4_PHYS + 0x300),
440 .end = (PXA_CS4_PHYS + 0xfffff),
441 .flags = IORESOURCE_MEM,
442 },
443 [1] = {
444 .start = IRQ_GPIO(40),
445 .end = IRQ_GPIO(40),
446 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
447 }
448};
449
450static struct smc91x_platdata stargate2_smc91x_info = {
451 .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT
452 | SMC91X_NOWAIT | SMC91X_USE_DMA,
453};
454
455static struct platform_device smc91x_device = {
456 .name = "smc91x",
457 .id = -1,
458 .num_resources = ARRAY_SIZE(smc91x_resources),
459 .resource = smc91x_resources,
460 .dev = {
461 .platform_data = &stargate2_smc91x_info,
462 },
463};
464
465
466
467static struct pxamci_platform_data stargate2_mci_platform_data;
468
469/*
470 * The card detect interrupt isn't debounced so we delay it by 250ms
471 * to give the card a chance to fully insert / eject.
472 */
473static int stargate2_mci_init(struct device *dev,
474 irq_handler_t stargate2_detect_int,
475 void *data)
476{
477 int err;
478
479 err = gpio_request(SG2_SD_POWER_ENABLE, "SG2_sd_power_enable");
480 if (err) {
481 printk(KERN_ERR "Can't get the gpio for SD power control");
482 goto return_err;
483 }
484 gpio_direction_output(SG2_SD_POWER_ENABLE, 0);
485
486 err = gpio_request(SG2_GPIO_nSD_DETECT, "SG2_sd_detect");
487 if (err) {
488 printk(KERN_ERR "Can't get the sd detect gpio");
489 goto free_power_en;
490 }
491 gpio_direction_input(SG2_GPIO_nSD_DETECT);
492 /* Delay to allow for full insertion */
493 stargate2_mci_platform_data.detect_delay = msecs_to_jiffies(250);
494
495 err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT),
496 stargate2_detect_int,
497 IRQ_TYPE_EDGE_BOTH,
498 "MMC card detect",
499 data);
500 if (err) {
501 printk(KERN_ERR "can't request MMC card detect IRQ\n");
502 goto free_nsd_detect;
503 }
504 return 0;
505
506 free_nsd_detect:
507 gpio_free(SG2_GPIO_nSD_DETECT);
508 free_power_en:
509 gpio_free(SG2_SD_POWER_ENABLE);
510 return_err:
511 return err;
512}
513
514/**
515 * stargate2_mci_setpower() - set state of mmc power supply
516 *
517 * Very simple control. Either it is on or off and is controlled by
518 * a gpio pin */
519static void stargate2_mci_setpower(struct device *dev, unsigned int vdd)
520{
521 gpio_set_value(SG2_SD_POWER_ENABLE, !!vdd);
522}
523
524static void stargate2_mci_exit(struct device *dev, void *data)
525{
526 free_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), data);
527 gpio_free(SG2_SD_POWER_ENABLE);
528 gpio_free(SG2_GPIO_nSD_DETECT);
529}
530
531static struct pxamci_platform_data stargate2_mci_platform_data = {
532 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
533 .init = stargate2_mci_init,
534 .setpower = stargate2_mci_setpower,
535 .exit = stargate2_mci_exit,
536};
537
538static struct mtd_partition stargate2flash_partitions[] = {
539 {
540 .name = "Bootloader",
541 .size = 0x00040000,
542 .offset = 0,
543 .mask_flags = 0,
544 }, {
545 .name = "Kernel",
546 .size = 0x00200000,
547 .offset = 0x00040000,
548 .mask_flags = 0
549 }, {
550 .name = "Filesystem",
551 .size = 0x01DC0000,
552 .offset = 0x00240000,
553 .mask_flags = 0
554 },
555};
556
557static struct resource flash_resources = {
558 .start = PXA_CS0_PHYS,
559 .end = PXA_CS0_PHYS + SZ_32M - 1,
560 .flags = IORESOURCE_MEM,
561};
562
563static struct flash_platform_data stargate2_flash_data = {
564 .map_name = "cfi_probe",
565 .parts = stargate2flash_partitions,
566 .nr_parts = ARRAY_SIZE(stargate2flash_partitions),
567 .name = "PXA27xOnChipROM",
568 .width = 2,
569};
570
571static struct platform_device stargate2_flash_device = {
572 .name = "pxa2xx-flash",
573 .id = 0,
574 .dev = {
575 .platform_data = &stargate2_flash_data,
576 },
577 .resource = &flash_resources,
578 .num_resources = 1,
579};
580
581/*
582 * SRAM - The Stargate 2 has 32MB of SRAM.
583 *
584 * Here it is made available as an MTD. This will then
585 * typically have a cifs filesystem created on it to provide
586 * fast temporary storage.
587 */
588static struct resource sram_resources = {
589 .start = PXA_CS1_PHYS,
590 .end = PXA_CS1_PHYS + SZ_32M-1,
591 .flags = IORESOURCE_MEM,
592};
593
594static struct platdata_mtd_ram stargate2_sram_pdata = {
595 .mapname = "Stargate2 SRAM",
596 .bankwidth = 2,
597};
598
599static struct platform_device stargate2_sram = {
600 .name = "mtd-ram",
601 .id = 0,
602 .resource = &sram_resources,
603 .num_resources = 1,
604 .dev = {
605 .platform_data = &stargate2_sram_pdata,
606 },
607};
608
609static struct pcf857x_platform_data platform_data_pcf857x = {
610 .gpio_base = 128,
611 .n_latch = 0,
612 .setup = NULL,
613 .teardown = NULL,
614 .context = NULL,
615};
616
617static struct at24_platform_data pca9500_eeprom_pdata = {
618 .byte_len = 256,
619 .page_size = 4,
620};
621
622
623static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
624 /* Techically this a pca9500 - but it's compatible with the 8574
625 * for gpio expansion and the 24c02 for eeprom access.
626 */
627 {
628 .type = "pcf8574",
629 .addr = 0x27,
630 .platform_data = &platform_data_pcf857x,
631 }, {
632 .type = "24c02",
633 .addr = 0x57,
634 .platform_data = &pca9500_eeprom_pdata,
635 }, {
636 .type = "max1238",
637 .addr = 0x35,
638 }, { /* ITS400 Sensor board only */
639 .type = "max1363",
640 .addr = 0x34,
641 /* Through a nand gate - Also beware, on V2 sensor board the
642 * pull up resistors are missing.
643 */
644 .irq = IRQ_GPIO(99),
645 }, { /* ITS400 Sensor board only */
646 .type = "tsl2561",
647 .addr = 0x49,
648 /* Through a nand gate - Also beware, on V2 sensor board the
649 * pull up resistors are missing.
650 */
651 .irq = IRQ_GPIO(99),
652 }, { /* ITS400 Sensor board only */
653 .type = "tmp175",
654 .addr = 0x4A,
655 .irq = IRQ_GPIO(96),
656 },
657};
658
659static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
660 {
661 .type = "da9030",
662 .addr = 0x49,
663 .platform_data = &stargate2_da9030_pdata,
664 .irq = gpio_to_irq(1),
665 },
666};
667
668static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
669 .num_chipselect = 1,
670};
671
672static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
673 .num_chipselect = 1,
674};
675
676static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
677 .num_chipselect = 1,
678};
679
680/* An upcoming kernel change will scrap SFRM usage so these
681 * drivers have been moved to use gpio's via cs_control */
682static struct pxa2xx_spi_chip staccel_chip_info = {
683 .tx_threshold = 8,
684 .rx_threshold = 8,
685 .dma_burst_size = 8,
686 .timeout = 235,
687 .gpio_cs = 24,
688};
689
690static struct pxa2xx_spi_chip cc2420_info = {
691 .tx_threshold = 8,
692 .rx_threshold = 8,
693 .dma_burst_size = 8,
694 .timeout = 235,
695 .gpio_cs = 39,
696};
697
698static struct spi_board_info spi_board_info[] __initdata = {
699 {
700 .modalias = "lis3l02dq",
701 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
702 .bus_num = 1,
703 .chip_select = 0,
704 .controller_data = &staccel_chip_info,
705 .irq = IRQ_GPIO(96),
706 }, {
707 .modalias = "cc2420",
708 .max_speed_hz = 6500000,
709 .bus_num = 3,
710 .chip_select = 0,
711 .controller_data = &cc2420_info,
712 },
713};
714
715static void sg2_udc_command(int cmd)
716{
717 switch (cmd) {
718 case PXA2XX_UDC_CMD_CONNECT:
719 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
720 break;
721 case PXA2XX_UDC_CMD_DISCONNECT:
722 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
723 break;
724 }
725}
726
727/* Board doesn't support cable detection - so always lie and say
728 * something is there.
729 */
730static int sg2_udc_detect(void)
731{
732 return 1;
733}
734
735static struct pxa2xx_udc_mach_info stargate2_udc_info __initdata = {
736 .udc_is_connected = sg2_udc_detect,
737 .udc_command = sg2_udc_command,
738};
739
740static struct platform_device *stargate2_devices[] = {
741 &stargate2_flash_device,
742 &stargate2_sram,
743 &smc91x_device,
744 &sht15,
745};
746
747static struct i2c_pxa_platform_data i2c_pwr_pdata = {
748 .fast_mode = 1,
749};
750
751static struct i2c_pxa_platform_data i2c_pdata = {
752 .fast_mode = 1,
753};
754
755static void __init stargate2_init(void)
756{
757 /* This is probably a board specific hack as this must be set
758 prior to connecting the MFP stuff up. */
759 MECR &= ~MECR_NOS;
760
761 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
762
763 /* spi chip selects */
764 gpio_direction_output(37, 0);
765 gpio_direction_output(24, 0);
766 gpio_direction_output(39, 0);
767
768 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices));
769
770 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
771 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
772 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
773 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
774
775 i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info));
776 i2c_register_board_info(1,
777 ARRAY_AND_SIZE(stargate2_pwr_i2c_board_info));
778 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
779 pxa_set_i2c_info(&i2c_pdata);
780
781 pxa_set_mci_info(&stargate2_mci_platform_data);
782
783 pxa_set_udc_info(&stargate2_udc_info);
784
785 stargate2_reset_bluetooth();
786}
787
788MACHINE_START(STARGATE2, "Stargate 2")
789 .phys_io = 0x40000000,
790 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
791 .map_io = pxa_map_io,
792 .init_irq = pxa27x_init_irq,
793 .timer = &pxa_timer,
794 .init_machine = stargate2_init,
795 .boot_params = 0xA0000100,
796MACHINE_END
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index a0bd46ef5d30..168267a5dfb3 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -40,7 +40,7 @@
40#include <mach/pxa25x.h> 40#include <mach/pxa25x.h>
41#include <mach/reset.h> 41#include <mach/reset.h>
42#include <mach/irda.h> 42#include <mach/irda.h>
43#include <mach/i2c.h> 43#include <plat/i2c.h>
44#include <mach/mmc.h> 44#include <mach/mmc.h>
45#include <mach/udc.h> 45#include <mach/udc.h>
46#include <mach/tosa_bt.h> 46#include <mach/tosa_bt.h>
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index f79c9cb70ae4..825f540176d2 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -47,7 +47,7 @@
47#include <mach/mmc.h> 47#include <mach/mmc.h>
48#include <mach/irda.h> 48#include <mach/irda.h>
49#include <mach/ohci.h> 49#include <mach/ohci.h>
50#include <mach/i2c.h> 50#include <plat/i2c.h>
51 51
52#include "generic.h" 52#include "generic.h"
53#include "devices.h" 53#include "devices.h"
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index dd031cc41847..d33c232b686c 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -45,7 +45,7 @@
45#include <mach/pxa25x.h> 45#include <mach/pxa25x.h>
46#include <mach/audio.h> 46#include <mach/audio.h>
47#include <mach/pxafb.h> 47#include <mach/pxafb.h>
48#include <mach/i2c.h> 48#include <plat/i2c.h>
49#include <mach/regs-uart.h> 49#include <mach/regs-uart.h>
50#include <mach/viper.h> 50#include <mach/viper.h>
51 51
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index c256c57642c0..cefd1c0a854a 100644
--- a/arch/arm/mach-pxa/zylonite_pxa300.c
+++ b/arch/arm/mach-pxa/zylonite_pxa300.c
@@ -21,7 +21,7 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22 22
23#include <mach/pxa300.h> 23#include <mach/pxa300.h>
24#include <mach/i2c.h> 24#include <plat/i2c.h>
25#include <mach/zylonite.h> 25#include <mach/zylonite.h>
26 26
27#include "generic.h" 27#include "generic.h"
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index b6ec10627776..d4cfa2145386 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -24,7 +24,6 @@ config REALVIEW_EB_ARM11MP
24config REALVIEW_EB_ARM11MP_REVB 24config REALVIEW_EB_ARM11MP_REVB
25 bool "Support ARM11MPCore RevB tile" 25 bool "Support ARM11MPCore RevB tile"
26 depends on REALVIEW_EB_ARM11MP 26 depends on REALVIEW_EB_ARM11MP
27 default n
28 help 27 help
29 Enable support for the ARM11MPCore RevB tile on the Realview 28 Enable support for the ARM11MPCore RevB tile on the Realview
30 platform. Since there are device address differences, a 29 platform. Since there are device address differences, a
@@ -48,6 +47,15 @@ config MACH_REALVIEW_PB1176
48 help 47 help
49 Include support for the ARM(R) RealView ARM1176 Platform Baseboard. 48 Include support for the ARM(R) RealView ARM1176 Platform Baseboard.
50 49
50config REALVIEW_PB1176_SECURE_FLASH
51 bool "Allow access to the secure flash memory block"
52 depends on MACH_REALVIEW_PB1176
53 default n
54 help
55 Select this option if Linux will only run in secure mode on the
56 RealView PB1176 platform and access to the secure flash memory
57 block (64MB @ 0x3c000000) is required.
58
51config MACH_REALVIEW_PBA8 59config MACH_REALVIEW_PBA8
52 bool "Support RealView/PB-A8 platform" 60 bool "Support RealView/PB-A8 platform"
53 select CPU_V7 61 select CPU_V7
@@ -58,6 +66,13 @@ config MACH_REALVIEW_PBA8
58 PB-A8 is a platform with an on-board Cortex-A8 and has support for 66 PB-A8 is a platform with an on-board Cortex-A8 and has support for
59 PCI-E and Compact Flash. 67 PCI-E and Compact Flash.
60 68
69config MACH_REALVIEW_PBX
70 bool "Support RealView/PBX platform"
71 select ARM_GIC
72 select HAVE_PATA_PLATFORM
73 help
74 Include support for the ARM(R) RealView PBX platform.
75
61config REALVIEW_HIGH_PHYS_OFFSET 76config REALVIEW_HIGH_PHYS_OFFSET
62 bool "High physical base address for the RealView platform" 77 bool "High physical base address for the RealView platform"
63 depends on !MACH_REALVIEW_PB1176 78 depends on !MACH_REALVIEW_PB1176
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index 7bea8ffc4b59..e704edb733c0 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -7,5 +7,7 @@ obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o
7obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o 7obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o
8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o 8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o
9obj-$(CONFIG_MACH_REALVIEW_PBA8) += realview_pba8.o 9obj-$(CONFIG_MACH_REALVIEW_PBA8) += realview_pba8.o
10obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o 10obj-$(CONFIG_MACH_REALVIEW_PBX) += realview_pbx.o
11obj-$(CONFIG_SMP) += platsmp.o headsmp.o
11obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 12obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
13obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 076acbc50706..9ea9c05093cd 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -48,6 +48,9 @@
48 48
49#include <asm/hardware/gic.h> 49#include <asm/hardware/gic.h>
50 50
51#include <mach/platform.h>
52#include <mach/irqs.h>
53
51#include "core.h" 54#include "core.h"
52#include "clock.h" 55#include "clock.h"
53 56
@@ -578,21 +581,22 @@ void realview_leds_event(led_event_t ledevt)
578{ 581{
579 unsigned long flags; 582 unsigned long flags;
580 u32 val; 583 u32 val;
584 u32 led = 1 << smp_processor_id();
581 585
582 local_irq_save(flags); 586 local_irq_save(flags);
583 val = readl(VA_LEDS_BASE); 587 val = readl(VA_LEDS_BASE);
584 588
585 switch (ledevt) { 589 switch (ledevt) {
586 case led_idle_start: 590 case led_idle_start:
587 val = val & ~REALVIEW_SYS_LED0; 591 val = val & ~led;
588 break; 592 break;
589 593
590 case led_idle_end: 594 case led_idle_end:
591 val = val | REALVIEW_SYS_LED0; 595 val = val | led;
592 break; 596 break;
593 597
594 case led_timer: 598 case led_timer:
595 val = val ^ REALVIEW_SYS_LED1; 599 val = val ^ REALVIEW_SYS_LED7;
596 break; 600 break;
597 601
598 case led_halted: 602 case led_halted:
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 21c08637683b..59a337ba4be7 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -51,9 +51,6 @@ extern struct mmc_platform_data realview_mmc0_plat_data;
51extern struct mmc_platform_data realview_mmc1_plat_data; 51extern struct mmc_platform_data realview_mmc1_plat_data;
52extern struct clcd_board clcd_plat_data; 52extern struct clcd_board clcd_plat_data;
53extern void __iomem *gic_cpu_base_addr; 53extern void __iomem *gic_cpu_base_addr;
54#ifdef CONFIG_LOCAL_TIMERS
55extern void __iomem *twd_base;
56#endif
57extern void __iomem *timer0_va_base; 54extern void __iomem *timer0_va_base;
58extern void __iomem *timer1_va_base; 55extern void __iomem *timer1_va_base;
59extern void __iomem *timer2_va_base; 56extern void __iomem *timer2_va_base;
diff --git a/arch/arm/mach-realview/include/mach/board-eb.h b/arch/arm/mach-realview/include/mach/board-eb.h
index 268d7701fa9b..794a8d91a6a6 100644
--- a/arch/arm/mach-realview/include/mach/board-eb.h
+++ b/arch/arm/mach-realview/include/mach/board-eb.h
@@ -62,111 +62,6 @@
62#define REALVIEW_EB11MP_SYS_PLD_CTRL1 0x74 /* Register offset for MPCore sysctl */ 62#define REALVIEW_EB11MP_SYS_PLD_CTRL1 0x74 /* Register offset for MPCore sysctl */
63#endif 63#endif
64 64
65#define IRQ_EB_GIC_START 32
66
67/*
68 * RealView EB interrupt sources
69 */
70#define IRQ_EB_WDOG (IRQ_EB_GIC_START + 0) /* Watchdog timer */
71#define IRQ_EB_SOFT (IRQ_EB_GIC_START + 1) /* Software interrupt */
72#define IRQ_EB_COMMRx (IRQ_EB_GIC_START + 2) /* Debug Comm Rx interrupt */
73#define IRQ_EB_COMMTx (IRQ_EB_GIC_START + 3) /* Debug Comm Tx interrupt */
74#define IRQ_EB_TIMER0_1 (IRQ_EB_GIC_START + 4) /* Timer 0 and 1 */
75#define IRQ_EB_TIMER2_3 (IRQ_EB_GIC_START + 5) /* Timer 2 and 3 */
76#define IRQ_EB_GPIO0 (IRQ_EB_GIC_START + 6) /* GPIO 0 */
77#define IRQ_EB_GPIO1 (IRQ_EB_GIC_START + 7) /* GPIO 1 */
78#define IRQ_EB_GPIO2 (IRQ_EB_GIC_START + 8) /* GPIO 2 */
79 /* 9 reserved */
80#define IRQ_EB_RTC (IRQ_EB_GIC_START + 10) /* Real Time Clock */
81#define IRQ_EB_SSP (IRQ_EB_GIC_START + 11) /* Synchronous Serial Port */
82#define IRQ_EB_UART0 (IRQ_EB_GIC_START + 12) /* UART 0 on development chip */
83#define IRQ_EB_UART1 (IRQ_EB_GIC_START + 13) /* UART 1 on development chip */
84#define IRQ_EB_UART2 (IRQ_EB_GIC_START + 14) /* UART 2 on development chip */
85#define IRQ_EB_UART3 (IRQ_EB_GIC_START + 15) /* UART 3 on development chip */
86#define IRQ_EB_SCI (IRQ_EB_GIC_START + 16) /* Smart Card Interface */
87#define IRQ_EB_MMCI0A (IRQ_EB_GIC_START + 17) /* Multimedia Card 0A */
88#define IRQ_EB_MMCI0B (IRQ_EB_GIC_START + 18) /* Multimedia Card 0B */
89#define IRQ_EB_AACI (IRQ_EB_GIC_START + 19) /* Audio Codec */
90#define IRQ_EB_KMI0 (IRQ_EB_GIC_START + 20) /* Keyboard/Mouse port 0 */
91#define IRQ_EB_KMI1 (IRQ_EB_GIC_START + 21) /* Keyboard/Mouse port 1 */
92#define IRQ_EB_CHARLCD (IRQ_EB_GIC_START + 22) /* Character LCD */
93#define IRQ_EB_CLCD (IRQ_EB_GIC_START + 23) /* CLCD controller */
94#define IRQ_EB_DMA (IRQ_EB_GIC_START + 24) /* DMA controller */
95#define IRQ_EB_PWRFAIL (IRQ_EB_GIC_START + 25) /* Power failure */
96#define IRQ_EB_PISMO (IRQ_EB_GIC_START + 26) /* PISMO interface */
97#define IRQ_EB_DoC (IRQ_EB_GIC_START + 27) /* Disk on Chip memory controller */
98#define IRQ_EB_ETH (IRQ_EB_GIC_START + 28) /* Ethernet controller */
99#define IRQ_EB_USB (IRQ_EB_GIC_START + 29) /* USB controller */
100#define IRQ_EB_TSPEN (IRQ_EB_GIC_START + 30) /* Touchscreen pen */
101#define IRQ_EB_TSKPAD (IRQ_EB_GIC_START + 31) /* Touchscreen keypad */
102
103/*
104 * RealView EB + ARM11MPCore interrupt sources (primary GIC on the core tile)
105 */
106#define IRQ_EB11MP_AACI (IRQ_EB_GIC_START + 0)
107#define IRQ_EB11MP_TIMER0_1 (IRQ_EB_GIC_START + 1)
108#define IRQ_EB11MP_TIMER2_3 (IRQ_EB_GIC_START + 2)
109#define IRQ_EB11MP_USB (IRQ_EB_GIC_START + 3)
110#define IRQ_EB11MP_UART0 (IRQ_EB_GIC_START + 4)
111#define IRQ_EB11MP_UART1 (IRQ_EB_GIC_START + 5)
112#define IRQ_EB11MP_RTC (IRQ_EB_GIC_START + 6)
113#define IRQ_EB11MP_KMI0 (IRQ_EB_GIC_START + 7)
114#define IRQ_EB11MP_KMI1 (IRQ_EB_GIC_START + 8)
115#define IRQ_EB11MP_ETH (IRQ_EB_GIC_START + 9)
116#define IRQ_EB11MP_EB_IRQ1 (IRQ_EB_GIC_START + 10) /* main GIC */
117#define IRQ_EB11MP_EB_IRQ2 (IRQ_EB_GIC_START + 11) /* tile GIC */
118#define IRQ_EB11MP_EB_FIQ1 (IRQ_EB_GIC_START + 12) /* main GIC */
119#define IRQ_EB11MP_EB_FIQ2 (IRQ_EB_GIC_START + 13) /* tile GIC */
120#define IRQ_EB11MP_MMCI0A (IRQ_EB_GIC_START + 14)
121#define IRQ_EB11MP_MMCI0B (IRQ_EB_GIC_START + 15)
122
123#define IRQ_EB11MP_PMU_CPU0 (IRQ_EB_GIC_START + 17)
124#define IRQ_EB11MP_PMU_CPU1 (IRQ_EB_GIC_START + 18)
125#define IRQ_EB11MP_PMU_CPU2 (IRQ_EB_GIC_START + 19)
126#define IRQ_EB11MP_PMU_CPU3 (IRQ_EB_GIC_START + 20)
127#define IRQ_EB11MP_PMU_SCU0 (IRQ_EB_GIC_START + 21)
128#define IRQ_EB11MP_PMU_SCU1 (IRQ_EB_GIC_START + 22)
129#define IRQ_EB11MP_PMU_SCU2 (IRQ_EB_GIC_START + 23)
130#define IRQ_EB11MP_PMU_SCU3 (IRQ_EB_GIC_START + 24)
131#define IRQ_EB11MP_PMU_SCU4 (IRQ_EB_GIC_START + 25)
132#define IRQ_EB11MP_PMU_SCU5 (IRQ_EB_GIC_START + 26)
133#define IRQ_EB11MP_PMU_SCU6 (IRQ_EB_GIC_START + 27)
134#define IRQ_EB11MP_PMU_SCU7 (IRQ_EB_GIC_START + 28)
135
136#define IRQ_EB11MP_L220_EVENT (IRQ_EB_GIC_START + 29)
137#define IRQ_EB11MP_L220_SLAVE (IRQ_EB_GIC_START + 30)
138#define IRQ_EB11MP_L220_DECODE (IRQ_EB_GIC_START + 31)
139
140#define IRQ_EB11MP_UART2 -1
141#define IRQ_EB11MP_UART3 -1
142#define IRQ_EB11MP_CLCD -1
143#define IRQ_EB11MP_DMA -1
144#define IRQ_EB11MP_WDOG -1
145#define IRQ_EB11MP_GPIO0 -1
146#define IRQ_EB11MP_GPIO1 -1
147#define IRQ_EB11MP_GPIO2 -1
148#define IRQ_EB11MP_SCI -1
149#define IRQ_EB11MP_SSP -1
150
151#define NR_GIC_EB11MP 2
152
153/*
154 * Only define NR_IRQS if less than NR_IRQS_EB
155 */
156#define NR_IRQS_EB (IRQ_EB_GIC_START + 96)
157
158#if defined(CONFIG_MACH_REALVIEW_EB) \
159 && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB))
160#undef NR_IRQS
161#define NR_IRQS NR_IRQS_EB
162#endif
163
164#if defined(CONFIG_REALVIEW_EB_ARM11MP) || defined(CONFIG_REALVIEW_EB_A9MP) \
165 && (!defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_EB11MP))
166#undef MAX_GIC_NR
167#define MAX_GIC_NR NR_GIC_EB11MP
168#endif
169
170/* 65/*
171 * Core tile identification (REALVIEW_SYS_PROCID) 66 * Core tile identification (REALVIEW_SYS_PROCID)
172 */ 67 */
diff --git a/arch/arm/mach-realview/include/mach/board-pb1176.h b/arch/arm/mach-realview/include/mach/board-pb1176.h
index 858eea7b1adc..98f8e7eeacc2 100644
--- a/arch/arm/mach-realview/include/mach/board-pb1176.h
+++ b/arch/arm/mach-realview/include/mach/board-pb1176.h
@@ -32,6 +32,8 @@
32#define REALVIEW_PB1176_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */ 32#define REALVIEW_PB1176_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */
33#define REALVIEW_PB1176_FLASH_BASE 0x30000000 33#define REALVIEW_PB1176_FLASH_BASE 0x30000000
34#define REALVIEW_PB1176_FLASH_SIZE SZ_64M 34#define REALVIEW_PB1176_FLASH_SIZE SZ_64M
35#define REALVIEW_PB1176_SEC_FLASH_BASE 0x3C000000 /* Secure flash */
36#define REALVIEW_PB1176_SEC_FLASH_SIZE SZ_64M
35 37
36#define REALVIEW_PB1176_TIMER0_1_BASE 0x10104000 /* Timer 0 and 1 */ 38#define REALVIEW_PB1176_TIMER0_1_BASE 0x10104000 /* Timer 0 and 1 */
37#define REALVIEW_PB1176_TIMER2_3_BASE 0x10105000 /* Timer 2 and 3 */ 39#define REALVIEW_PB1176_TIMER2_3_BASE 0x10105000 /* Timer 2 and 3 */
@@ -71,82 +73,4 @@
71#define REALVIEW_PB1176_GIC_DIST_BASE 0x10041000 /* GIC distributor, on FPGA */ 73#define REALVIEW_PB1176_GIC_DIST_BASE 0x10041000 /* GIC distributor, on FPGA */
72#define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */ 74#define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */
73 75
74/*
75 * Irqs
76 */
77#define IRQ_DC1176_GIC_START 32
78#define IRQ_PB1176_GIC_START 64
79
80/*
81 * ARM1176 DevChip interrupt sources (primary GIC)
82 */
83#define IRQ_DC1176_WATCHDOG (IRQ_DC1176_GIC_START + 0) /* Watchdog timer */
84#define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */
85#define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */
86#define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */
87#define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */
88#define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */
89#define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */
90#define IRQ_DC1176_APC (IRQ_DC1176_GIC_START + 11)
91#define IRQ_DC1176_IEC (IRQ_DC1176_GIC_START + 12)
92#define IRQ_DC1176_L2CC (IRQ_DC1176_GIC_START + 13)
93#define IRQ_DC1176_RTC (IRQ_DC1176_GIC_START + 14)
94#define IRQ_DC1176_CLCD (IRQ_DC1176_GIC_START + 15) /* CLCD controller */
95#define IRQ_DC1176_UART0 (IRQ_DC1176_GIC_START + 18) /* UART 0 on development chip */
96#define IRQ_DC1176_UART1 (IRQ_DC1176_GIC_START + 19) /* UART 1 on development chip */
97#define IRQ_DC1176_UART2 (IRQ_DC1176_GIC_START + 20) /* UART 2 on development chip */
98#define IRQ_DC1176_UART3 (IRQ_DC1176_GIC_START + 21) /* UART 3 on development chip */
99
100#define IRQ_DC1176_PB_IRQ2 (IRQ_DC1176_GIC_START + 30) /* tile GIC */
101#define IRQ_DC1176_PB_IRQ1 (IRQ_DC1176_GIC_START + 31) /* main GIC */
102
103/*
104 * RealView PB1176 interrupt sources (secondary GIC)
105 */
106#define IRQ_PB1176_MMCI0A (IRQ_PB1176_GIC_START + 1) /* Multimedia Card 0A */
107#define IRQ_PB1176_MMCI0B (IRQ_PB1176_GIC_START + 2) /* Multimedia Card 0A */
108#define IRQ_PB1176_KMI0 (IRQ_PB1176_GIC_START + 3) /* Keyboard/Mouse port 0 */
109#define IRQ_PB1176_KMI1 (IRQ_PB1176_GIC_START + 4) /* Keyboard/Mouse port 1 */
110#define IRQ_PB1176_SCI (IRQ_PB1176_GIC_START + 5)
111#define IRQ_PB1176_UART4 (IRQ_PB1176_GIC_START + 6) /* UART 4 on baseboard */
112#define IRQ_PB1176_CHARLCD (IRQ_PB1176_GIC_START + 7) /* Character LCD */
113#define IRQ_PB1176_GPIO1 (IRQ_PB1176_GIC_START + 8)
114#define IRQ_PB1176_GPIO2 (IRQ_PB1176_GIC_START + 9)
115#define IRQ_PB1176_ETH (IRQ_PB1176_GIC_START + 10) /* Ethernet controller */
116#define IRQ_PB1176_USB (IRQ_PB1176_GIC_START + 11) /* USB controller */
117
118#define IRQ_PB1176_PISMO (IRQ_PB1176_GIC_START + 16)
119
120#define IRQ_PB1176_AACI (IRQ_PB1176_GIC_START + 19) /* Audio Codec */
121
122#define IRQ_PB1176_TIMER0_1 (IRQ_PB1176_GIC_START + 22)
123#define IRQ_PB1176_TIMER2_3 (IRQ_PB1176_GIC_START + 23)
124#define IRQ_PB1176_DMAC (IRQ_PB1176_GIC_START + 24) /* DMA controller */
125#define IRQ_PB1176_RTC (IRQ_PB1176_GIC_START + 25) /* Real Time Clock */
126
127#define IRQ_PB1176_GPIO0 -1
128#define IRQ_PB1176_SSP -1
129#define IRQ_PB1176_SCTL -1
130
131#define NR_GIC_PB1176 2
132
133/*
134 * Only define NR_IRQS if less than NR_IRQS_PB1176
135 */
136#define NR_IRQS_PB1176 (IRQ_DC1176_GIC_START + 96)
137
138#if defined(CONFIG_MACH_REALVIEW_PB1176)
139
140#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB1176)
141#undef NR_IRQS
142#define NR_IRQS NR_IRQS_PB1176
143#endif
144
145#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB1176)
146#undef MAX_GIC_NR
147#define MAX_GIC_NR NR_GIC_PB1176
148#endif
149
150#endif /* CONFIG_MACH_REALVIEW_PB1176 */
151
152#endif /* __ASM_ARCH_BOARD_PB1176_H */ 76#endif /* __ASM_ARCH_BOARD_PB1176_H */
diff --git a/arch/arm/mach-realview/include/mach/board-pb11mp.h b/arch/arm/mach-realview/include/mach/board-pb11mp.h
index 53ea0e7a1267..f0d68e0fea01 100644
--- a/arch/arm/mach-realview/include/mach/board-pb11mp.h
+++ b/arch/arm/mach-realview/include/mach/board-pb11mp.h
@@ -81,105 +81,4 @@
81#define REALVIEW_TC11MP_GIC_DIST_BASE 0x1F001000 /* Test chip interrupt controller distributor */ 81#define REALVIEW_TC11MP_GIC_DIST_BASE 0x1F001000 /* Test chip interrupt controller distributor */
82#define REALVIEW_TC11MP_L220_BASE 0x1F002000 /* L220 registers */ 82#define REALVIEW_TC11MP_L220_BASE 0x1F002000 /* L220 registers */
83 83
84/*
85 * Irqs
86 */
87#define IRQ_TC11MP_GIC_START 32
88#define IRQ_PB11MP_GIC_START 64
89
90/*
91 * ARM11MPCore test chip interrupt sources (primary GIC on the test chip)
92 */
93#define IRQ_TC11MP_AACI (IRQ_TC11MP_GIC_START + 0)
94#define IRQ_TC11MP_TIMER0_1 (IRQ_TC11MP_GIC_START + 1)
95#define IRQ_TC11MP_TIMER2_3 (IRQ_TC11MP_GIC_START + 2)
96#define IRQ_TC11MP_USB (IRQ_TC11MP_GIC_START + 3)
97#define IRQ_TC11MP_UART0 (IRQ_TC11MP_GIC_START + 4)
98#define IRQ_TC11MP_UART1 (IRQ_TC11MP_GIC_START + 5)
99#define IRQ_TC11MP_RTC (IRQ_TC11MP_GIC_START + 6)
100#define IRQ_TC11MP_KMI0 (IRQ_TC11MP_GIC_START + 7)
101#define IRQ_TC11MP_KMI1 (IRQ_TC11MP_GIC_START + 8)
102#define IRQ_TC11MP_ETH (IRQ_TC11MP_GIC_START + 9)
103#define IRQ_TC11MP_PB_IRQ1 (IRQ_TC11MP_GIC_START + 10) /* main GIC */
104#define IRQ_TC11MP_PB_IRQ2 (IRQ_TC11MP_GIC_START + 11) /* tile GIC */
105#define IRQ_TC11MP_PB_FIQ1 (IRQ_TC11MP_GIC_START + 12) /* main GIC */
106#define IRQ_TC11MP_PB_FIQ2 (IRQ_TC11MP_GIC_START + 13) /* tile GIC */
107#define IRQ_TC11MP_MMCI0A (IRQ_TC11MP_GIC_START + 14)
108#define IRQ_TC11MP_MMCI0B (IRQ_TC11MP_GIC_START + 15)
109
110#define IRQ_TC11MP_PMU_CPU0 (IRQ_TC11MP_GIC_START + 17)
111#define IRQ_TC11MP_PMU_CPU1 (IRQ_TC11MP_GIC_START + 18)
112#define IRQ_TC11MP_PMU_CPU2 (IRQ_TC11MP_GIC_START + 19)
113#define IRQ_TC11MP_PMU_CPU3 (IRQ_TC11MP_GIC_START + 20)
114#define IRQ_TC11MP_PMU_SCU0 (IRQ_TC11MP_GIC_START + 21)
115#define IRQ_TC11MP_PMU_SCU1 (IRQ_TC11MP_GIC_START + 22)
116#define IRQ_TC11MP_PMU_SCU2 (IRQ_TC11MP_GIC_START + 23)
117#define IRQ_TC11MP_PMU_SCU3 (IRQ_TC11MP_GIC_START + 24)
118#define IRQ_TC11MP_PMU_SCU4 (IRQ_TC11MP_GIC_START + 25)
119#define IRQ_TC11MP_PMU_SCU5 (IRQ_TC11MP_GIC_START + 26)
120#define IRQ_TC11MP_PMU_SCU6 (IRQ_TC11MP_GIC_START + 27)
121#define IRQ_TC11MP_PMU_SCU7 (IRQ_TC11MP_GIC_START + 28)
122
123#define IRQ_TC11MP_L220_EVENT (IRQ_TC11MP_GIC_START + 29)
124#define IRQ_TC11MP_L220_SLAVE (IRQ_TC11MP_GIC_START + 30)
125#define IRQ_TC11MP_L220_DECODE (IRQ_TC11MP_GIC_START + 31)
126
127/*
128 * RealView PB11MPCore GIC interrupt sources (secondary GIC on the board)
129 */
130#define IRQ_PB11MP_WATCHDOG (IRQ_PB11MP_GIC_START + 0) /* Watchdog timer */
131#define IRQ_PB11MP_SOFT (IRQ_PB11MP_GIC_START + 1) /* Software interrupt */
132#define IRQ_PB11MP_COMMRx (IRQ_PB11MP_GIC_START + 2) /* Debug Comm Rx interrupt */
133#define IRQ_PB11MP_COMMTx (IRQ_PB11MP_GIC_START + 3) /* Debug Comm Tx interrupt */
134#define IRQ_PB11MP_GPIO0 (IRQ_PB11MP_GIC_START + 6) /* GPIO 0 */
135#define IRQ_PB11MP_GPIO1 (IRQ_PB11MP_GIC_START + 7) /* GPIO 1 */
136#define IRQ_PB11MP_GPIO2 (IRQ_PB11MP_GIC_START + 8) /* GPIO 2 */
137 /* 9 reserved */
138#define IRQ_PB11MP_RTC_GIC1 (IRQ_PB11MP_GIC_START + 10) /* Real Time Clock */
139#define IRQ_PB11MP_SSP (IRQ_PB11MP_GIC_START + 11) /* Synchronous Serial Port */
140#define IRQ_PB11MP_UART0_GIC1 (IRQ_PB11MP_GIC_START + 12) /* UART 0 on development chip */
141#define IRQ_PB11MP_UART1_GIC1 (IRQ_PB11MP_GIC_START + 13) /* UART 1 on development chip */
142#define IRQ_PB11MP_UART2 (IRQ_PB11MP_GIC_START + 14) /* UART 2 on development chip */
143#define IRQ_PB11MP_UART3 (IRQ_PB11MP_GIC_START + 15) /* UART 3 on development chip */
144#define IRQ_PB11MP_SCI (IRQ_PB11MP_GIC_START + 16) /* Smart Card Interface */
145#define IRQ_PB11MP_MMCI0A_GIC1 (IRQ_PB11MP_GIC_START + 17) /* Multimedia Card 0A */
146#define IRQ_PB11MP_MMCI0B_GIC1 (IRQ_PB11MP_GIC_START + 18) /* Multimedia Card 0B */
147#define IRQ_PB11MP_AACI_GIC1 (IRQ_PB11MP_GIC_START + 19) /* Audio Codec */
148#define IRQ_PB11MP_KMI0_GIC1 (IRQ_PB11MP_GIC_START + 20) /* Keyboard/Mouse port 0 */
149#define IRQ_PB11MP_KMI1_GIC1 (IRQ_PB11MP_GIC_START + 21) /* Keyboard/Mouse port 1 */
150#define IRQ_PB11MP_CHARLCD (IRQ_PB11MP_GIC_START + 22) /* Character LCD */
151#define IRQ_PB11MP_CLCD (IRQ_PB11MP_GIC_START + 23) /* CLCD controller */
152#define IRQ_PB11MP_DMAC (IRQ_PB11MP_GIC_START + 24) /* DMA controller */
153#define IRQ_PB11MP_PWRFAIL (IRQ_PB11MP_GIC_START + 25) /* Power failure */
154#define IRQ_PB11MP_PISMO (IRQ_PB11MP_GIC_START + 26) /* PISMO interface */
155#define IRQ_PB11MP_DoC (IRQ_PB11MP_GIC_START + 27) /* Disk on Chip memory controller */
156#define IRQ_PB11MP_ETH_GIC1 (IRQ_PB11MP_GIC_START + 28) /* Ethernet controller */
157#define IRQ_PB11MP_USB_GIC1 (IRQ_PB11MP_GIC_START + 29) /* USB controller */
158#define IRQ_PB11MP_TSPEN (IRQ_PB11MP_GIC_START + 30) /* Touchscreen pen */
159#define IRQ_PB11MP_TSKPAD (IRQ_PB11MP_GIC_START + 31) /* Touchscreen keypad */
160
161#define IRQ_PB11MP_SMC -1
162#define IRQ_PB11MP_SCTL -1
163
164#define NR_GIC_PB11MP 2
165
166/*
167 * Only define NR_IRQS if less than NR_IRQS_PB11MP
168 */
169#define NR_IRQS_PB11MP (IRQ_TC11MP_GIC_START + 96)
170
171#if defined(CONFIG_MACH_REALVIEW_PB11MP)
172
173#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB11MP)
174#undef NR_IRQS
175#define NR_IRQS NR_IRQS_PB11MP
176#endif
177
178#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB11MP)
179#undef MAX_GIC_NR
180#define MAX_GIC_NR NR_GIC_PB11MP
181#endif
182
183#endif /* CONFIG_MACH_REALVIEW_PB11MP */
184
185#endif /* __ASM_ARCH_BOARD_PB11MP_H */ 84#endif /* __ASM_ARCH_BOARD_PB11MP_H */
diff --git a/arch/arm/mach-realview/include/mach/board-pba8.h b/arch/arm/mach-realview/include/mach/board-pba8.h
index 307f97b16e5b..4dfc67a4f45f 100644
--- a/arch/arm/mach-realview/include/mach/board-pba8.h
+++ b/arch/arm/mach-realview/include/mach/board-pba8.h
@@ -70,81 +70,4 @@
70#define REALVIEW_PBA8_PCI_IO_SIZE 0x1000 /* 4 Kb */ 70#define REALVIEW_PBA8_PCI_IO_SIZE 0x1000 /* 4 Kb */
71#define REALVIEW_PBA8_PCI_MEM_SIZE 0x20000000 /* 512 MB */ 71#define REALVIEW_PBA8_PCI_MEM_SIZE 0x20000000 /* 512 MB */
72 72
73/*
74 * Irqs
75 */
76#define IRQ_PBA8_GIC_START 32
77
78/* L220
79#define IRQ_PBA8_L220_EVENT (IRQ_PBA8_GIC_START + 29)
80#define IRQ_PBA8_L220_SLAVE (IRQ_PBA8_GIC_START + 30)
81#define IRQ_PBA8_L220_DECODE (IRQ_PBA8_GIC_START + 31)
82*/
83
84/*
85 * PB-A8 on-board gic irq sources
86 */
87#define IRQ_PBA8_WATCHDOG (IRQ_PBA8_GIC_START + 0) /* Watchdog timer */
88#define IRQ_PBA8_SOFT (IRQ_PBA8_GIC_START + 1) /* Software interrupt */
89#define IRQ_PBA8_COMMRx (IRQ_PBA8_GIC_START + 2) /* Debug Comm Rx interrupt */
90#define IRQ_PBA8_COMMTx (IRQ_PBA8_GIC_START + 3) /* Debug Comm Tx interrupt */
91#define IRQ_PBA8_TIMER0_1 (IRQ_PBA8_GIC_START + 4) /* Timer 0/1 (default timer) */
92#define IRQ_PBA8_TIMER2_3 (IRQ_PBA8_GIC_START + 5) /* Timer 2/3 */
93#define IRQ_PBA8_GPIO0 (IRQ_PBA8_GIC_START + 6) /* GPIO 0 */
94#define IRQ_PBA8_GPIO1 (IRQ_PBA8_GIC_START + 7) /* GPIO 1 */
95#define IRQ_PBA8_GPIO2 (IRQ_PBA8_GIC_START + 8) /* GPIO 2 */
96 /* 9 reserved */
97#define IRQ_PBA8_RTC (IRQ_PBA8_GIC_START + 10) /* Real Time Clock */
98#define IRQ_PBA8_SSP (IRQ_PBA8_GIC_START + 11) /* Synchronous Serial Port */
99#define IRQ_PBA8_UART0 (IRQ_PBA8_GIC_START + 12) /* UART 0 on development chip */
100#define IRQ_PBA8_UART1 (IRQ_PBA8_GIC_START + 13) /* UART 1 on development chip */
101#define IRQ_PBA8_UART2 (IRQ_PBA8_GIC_START + 14) /* UART 2 on development chip */
102#define IRQ_PBA8_UART3 (IRQ_PBA8_GIC_START + 15) /* UART 3 on development chip */
103#define IRQ_PBA8_SCI (IRQ_PBA8_GIC_START + 16) /* Smart Card Interface */
104#define IRQ_PBA8_MMCI0A (IRQ_PBA8_GIC_START + 17) /* Multimedia Card 0A */
105#define IRQ_PBA8_MMCI0B (IRQ_PBA8_GIC_START + 18) /* Multimedia Card 0B */
106#define IRQ_PBA8_AACI (IRQ_PBA8_GIC_START + 19) /* Audio Codec */
107#define IRQ_PBA8_KMI0 (IRQ_PBA8_GIC_START + 20) /* Keyboard/Mouse port 0 */
108#define IRQ_PBA8_KMI1 (IRQ_PBA8_GIC_START + 21) /* Keyboard/Mouse port 1 */
109#define IRQ_PBA8_CHARLCD (IRQ_PBA8_GIC_START + 22) /* Character LCD */
110#define IRQ_PBA8_CLCD (IRQ_PBA8_GIC_START + 23) /* CLCD controller */
111#define IRQ_PBA8_DMAC (IRQ_PBA8_GIC_START + 24) /* DMA controller */
112#define IRQ_PBA8_PWRFAIL (IRQ_PBA8_GIC_START + 25) /* Power failure */
113#define IRQ_PBA8_PISMO (IRQ_PBA8_GIC_START + 26) /* PISMO interface */
114#define IRQ_PBA8_DoC (IRQ_PBA8_GIC_START + 27) /* Disk on Chip memory controller */
115#define IRQ_PBA8_ETH (IRQ_PBA8_GIC_START + 28) /* Ethernet controller */
116#define IRQ_PBA8_USB (IRQ_PBA8_GIC_START + 29) /* USB controller */
117#define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */
118#define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */
119
120/* ... */
121#define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50)
122#define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51)
123#define IRQ_PBA8_PCI2 (IRQ_PBA8_GIC_START + 52)
124#define IRQ_PBA8_PCI3 (IRQ_PBA8_GIC_START + 53)
125
126#define IRQ_PBA8_SMC -1
127#define IRQ_PBA8_SCTL -1
128
129#define NR_GIC_PBA8 1
130
131/*
132 * Only define NR_IRQS if less than NR_IRQS_PBA8
133 */
134#define NR_IRQS_PBA8 (IRQ_PBA8_GIC_START + 64)
135
136#if defined(CONFIG_MACH_REALVIEW_PBA8)
137
138#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PBA8)
139#undef NR_IRQS
140#define NR_IRQS NR_IRQS_PBA8
141#endif
142
143#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PBA8)
144#undef MAX_GIC_NR
145#define MAX_GIC_NR NR_GIC_PBA8
146#endif
147
148#endif /* CONFIG_MACH_REALVIEW_PBA8 */
149
150#endif /* __ASM_ARCH_BOARD_PBA8_H */ 73#endif /* __ASM_ARCH_BOARD_PBA8_H */
diff --git a/arch/arm/mach-realview/include/mach/board-pbx.h b/arch/arm/mach-realview/include/mach/board-pbx.h
new file mode 100644
index 000000000000..848bfff6d8f1
--- /dev/null
+++ b/arch/arm/mach-realview/include/mach/board-pbx.h
@@ -0,0 +1,108 @@
1/*
2 * arch/arm/mach-realview/include/mach/board-pbx.h
3 *
4 * Copyright (C) 2009 ARM Limited
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_BOARD_PBX_H
21#define __ASM_ARCH_BOARD_PBX_H
22
23#include <mach/platform.h>
24
25/*
26 * Peripheral addresses
27 */
28#define REALVIEW_PBX_UART0_BASE 0x10009000 /* UART 0 */
29#define REALVIEW_PBX_UART1_BASE 0x1000A000 /* UART 1 */
30#define REALVIEW_PBX_UART2_BASE 0x1000B000 /* UART 2 */
31#define REALVIEW_PBX_UART3_BASE 0x1000C000 /* UART 3 */
32#define REALVIEW_PBX_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
33#define REALVIEW_PBX_WATCHDOG0_BASE 0x1000F000 /* Watchdog 0 */
34#define REALVIEW_PBX_WATCHDOG_BASE 0x10010000 /* watchdog interface */
35#define REALVIEW_PBX_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
36#define REALVIEW_PBX_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
37#define REALVIEW_PBX_GPIO0_BASE 0x10013000 /* GPIO port 0 */
38#define REALVIEW_PBX_RTC_BASE 0x10017000 /* Real Time Clock */
39#define REALVIEW_PBX_TIMER4_5_BASE 0x10018000 /* Timer 4/5 */
40#define REALVIEW_PBX_TIMER6_7_BASE 0x10019000 /* Timer 6/7 */
41#define REALVIEW_PBX_SCTL_BASE 0x1001A000 /* System Controller */
42#define REALVIEW_PBX_CLCD_BASE 0x10020000 /* CLCD */
43#define REALVIEW_PBX_ONB_SRAM_BASE 0x10060000 /* On-board SRAM */
44#define REALVIEW_PBX_DMC_BASE 0x100E0000 /* DMC configuration */
45#define REALVIEW_PBX_SMC_BASE 0x100E1000 /* SMC configuration */
46#define REALVIEW_PBX_CAN_BASE 0x100E2000 /* CAN bus */
47#define REALVIEW_PBX_GIC_CPU_BASE 0x1E000000 /* Generic interrupt controller CPU interface */
48#define REALVIEW_PBX_FLASH0_BASE 0x40000000
49#define REALVIEW_PBX_FLASH0_SIZE SZ_64M
50#define REALVIEW_PBX_FLASH1_BASE 0x44000000
51#define REALVIEW_PBX_FLASH1_SIZE SZ_64M
52#define REALVIEW_PBX_ETH_BASE 0x4E000000 /* Ethernet */
53#define REALVIEW_PBX_USB_BASE 0x4F000000 /* USB */
54#define REALVIEW_PBX_GIC_DIST_BASE 0x1E001000 /* Generic interrupt controller distributor */
55#define REALVIEW_PBX_LT_BASE 0xC0000000 /* Logic Tile expansion */
56#define REALVIEW_PBX_SDRAM6_BASE 0x70000000 /* SDRAM bank 6 256MB */
57#define REALVIEW_PBX_SDRAM7_BASE 0x80000000 /* SDRAM bank 7 256MB */
58
59/*
60 * Tile-specific addresses
61 */
62#define REALVIEW_PBX_TILE_SCU_BASE 0x1F000000 /* SCU registers */
63#define REALVIEW_PBX_TILE_GIC_CPU_BASE 0x1F000100 /* Private Generic interrupt controller CPU interface */
64#define REALVIEW_PBX_TILE_TWD_BASE 0x1F000600
65#define REALVIEW_PBX_TILE_TWD_PERCPU_BASE 0x1F000700
66#define REALVIEW_PBX_TILE_TWD_SIZE 0x00000100
67#define REALVIEW_PBX_TILE_GIC_DIST_BASE 0x1F001000 /* Private Generic interrupt controller distributor */
68#define REALVIEW_PBX_TILE_L220_BASE 0x1F002000 /* L220 registers */
69
70#define REALVIEW_PBX_SYS_PLD_CTRL1 0x74
71
72/*
73 * PBX PCI regions
74 */
75#define REALVIEW_PBX_PCI_BASE 0x90040000 /* PCI-X Unit base */
76#define REALVIEW_PBX_PCI_IO_BASE 0x90050000 /* IO Region on AHB */
77#define REALVIEW_PBX_PCI_MEM_BASE 0xA0000000 /* MEM Region on AHB */
78
79#define REALVIEW_PBX_PCI_BASE_SIZE 0x10000 /* 16 Kb */
80#define REALVIEW_PBX_PCI_IO_SIZE 0x1000 /* 4 Kb */
81#define REALVIEW_PBX_PCI_MEM_SIZE 0x20000000 /* 512 MB */
82
83/*
84 * Core tile identification (REALVIEW_SYS_PROCID)
85 */
86#define REALVIEW_PBX_PROC_MASK 0xFF000000
87#define REALVIEW_PBX_PROC_ARM7TDMI 0x00000000
88#define REALVIEW_PBX_PROC_ARM9 0x02000000
89#define REALVIEW_PBX_PROC_ARM11 0x04000000
90#define REALVIEW_PBX_PROC_ARM11MP 0x06000000
91#define REALVIEW_PBX_PROC_A9MP 0x0C000000
92#define REALVIEW_PBX_PROC_A8 0x0E000000
93
94#define check_pbx_proc(proc_type) \
95 ((readl(__io_address(REALVIEW_SYS_PROCID)) & REALVIEW_PBX_PROC_MASK) \
96 == proc_type)
97
98#ifdef CONFIG_MACH_REALVIEW_PBX
99#define core_tile_pbx11mp() check_pbx_proc(REALVIEW_PBX_PROC_ARM11MP)
100#define core_tile_pbxa9mp() check_pbx_proc(REALVIEW_PBX_PROC_A9MP)
101#define core_tile_pbxa8() check_pbx_proc(REALVIEW_PBX_PROC_A8)
102#else
103#define core_tile_pbx11mp() 0
104#define core_tile_pbxa9mp() 0
105#define core_tile_pbxa8() 0
106#endif
107
108#endif /* __ASM_ARCH_BOARD_PBX_H */
diff --git a/arch/arm/mach-realview/include/mach/debug-macro.S b/arch/arm/mach-realview/include/mach/debug-macro.S
index 92dbcb9e1792..932d8af18062 100644
--- a/arch/arm/mach-realview/include/mach/debug-macro.S
+++ b/arch/arm/mach-realview/include/mach/debug-macro.S
@@ -12,7 +12,8 @@
12 12
13#if defined(CONFIG_MACH_REALVIEW_EB) || \ 13#if defined(CONFIG_MACH_REALVIEW_EB) || \
14 defined(CONFIG_MACH_REALVIEW_PB11MP) || \ 14 defined(CONFIG_MACH_REALVIEW_PB11MP) || \
15 defined(CONFIG_MACH_REALVIEW_PBA8) 15 defined(CONFIG_MACH_REALVIEW_PBA8) || \
16 defined(CONFIG_MACH_REALVIEW_PBX)
16#ifndef DEBUG_LL_UART_OFFSET 17#ifndef DEBUG_LL_UART_OFFSET
17#define DEBUG_LL_UART_OFFSET 0x00009000 18#define DEBUG_LL_UART_OFFSET 0x00009000
18#elif DEBUG_LL_UART_OFFSET != 0x00009000 19#elif DEBUG_LL_UART_OFFSET != 0x00009000
diff --git a/arch/arm/mach-realview/include/mach/irqs-eb.h b/arch/arm/mach-realview/include/mach/irqs-eb.h
new file mode 100644
index 000000000000..204d5378f309
--- /dev/null
+++ b/arch/arm/mach-realview/include/mach/irqs-eb.h
@@ -0,0 +1,129 @@
1/*
2 * arch/arm/mach-realview/include/mach/irqs-eb.h
3 *
4 * Copyright (C) 2007 ARM Limited
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __MACH_IRQS_EB_H
22#define __MACH_IRQS_EB_H
23
24#define IRQ_EB_GIC_START 32
25
26/*
27 * RealView EB interrupt sources
28 */
29#define IRQ_EB_WDOG (IRQ_EB_GIC_START + 0) /* Watchdog timer */
30#define IRQ_EB_SOFT (IRQ_EB_GIC_START + 1) /* Software interrupt */
31#define IRQ_EB_COMMRx (IRQ_EB_GIC_START + 2) /* Debug Comm Rx interrupt */
32#define IRQ_EB_COMMTx (IRQ_EB_GIC_START + 3) /* Debug Comm Tx interrupt */
33#define IRQ_EB_TIMER0_1 (IRQ_EB_GIC_START + 4) /* Timer 0 and 1 */
34#define IRQ_EB_TIMER2_3 (IRQ_EB_GIC_START + 5) /* Timer 2 and 3 */
35#define IRQ_EB_GPIO0 (IRQ_EB_GIC_START + 6) /* GPIO 0 */
36#define IRQ_EB_GPIO1 (IRQ_EB_GIC_START + 7) /* GPIO 1 */
37#define IRQ_EB_GPIO2 (IRQ_EB_GIC_START + 8) /* GPIO 2 */
38 /* 9 reserved */
39#define IRQ_EB_RTC (IRQ_EB_GIC_START + 10) /* Real Time Clock */
40#define IRQ_EB_SSP (IRQ_EB_GIC_START + 11) /* Synchronous Serial Port */
41#define IRQ_EB_UART0 (IRQ_EB_GIC_START + 12) /* UART 0 on development chip */
42#define IRQ_EB_UART1 (IRQ_EB_GIC_START + 13) /* UART 1 on development chip */
43#define IRQ_EB_UART2 (IRQ_EB_GIC_START + 14) /* UART 2 on development chip */
44#define IRQ_EB_UART3 (IRQ_EB_GIC_START + 15) /* UART 3 on development chip */
45#define IRQ_EB_SCI (IRQ_EB_GIC_START + 16) /* Smart Card Interface */
46#define IRQ_EB_MMCI0A (IRQ_EB_GIC_START + 17) /* Multimedia Card 0A */
47#define IRQ_EB_MMCI0B (IRQ_EB_GIC_START + 18) /* Multimedia Card 0B */
48#define IRQ_EB_AACI (IRQ_EB_GIC_START + 19) /* Audio Codec */
49#define IRQ_EB_KMI0 (IRQ_EB_GIC_START + 20) /* Keyboard/Mouse port 0 */
50#define IRQ_EB_KMI1 (IRQ_EB_GIC_START + 21) /* Keyboard/Mouse port 1 */
51#define IRQ_EB_CHARLCD (IRQ_EB_GIC_START + 22) /* Character LCD */
52#define IRQ_EB_CLCD (IRQ_EB_GIC_START + 23) /* CLCD controller */
53#define IRQ_EB_DMA (IRQ_EB_GIC_START + 24) /* DMA controller */
54#define IRQ_EB_PWRFAIL (IRQ_EB_GIC_START + 25) /* Power failure */
55#define IRQ_EB_PISMO (IRQ_EB_GIC_START + 26) /* PISMO interface */
56#define IRQ_EB_DoC (IRQ_EB_GIC_START + 27) /* Disk on Chip memory controller */
57#define IRQ_EB_ETH (IRQ_EB_GIC_START + 28) /* Ethernet controller */
58#define IRQ_EB_USB (IRQ_EB_GIC_START + 29) /* USB controller */
59#define IRQ_EB_TSPEN (IRQ_EB_GIC_START + 30) /* Touchscreen pen */
60#define IRQ_EB_TSKPAD (IRQ_EB_GIC_START + 31) /* Touchscreen keypad */
61
62/*
63 * RealView EB + ARM11MPCore interrupt sources (primary GIC on the core tile)
64 */
65#define IRQ_EB11MP_AACI (IRQ_EB_GIC_START + 0)
66#define IRQ_EB11MP_TIMER0_1 (IRQ_EB_GIC_START + 1)
67#define IRQ_EB11MP_TIMER2_3 (IRQ_EB_GIC_START + 2)
68#define IRQ_EB11MP_USB (IRQ_EB_GIC_START + 3)
69#define IRQ_EB11MP_UART0 (IRQ_EB_GIC_START + 4)
70#define IRQ_EB11MP_UART1 (IRQ_EB_GIC_START + 5)
71#define IRQ_EB11MP_RTC (IRQ_EB_GIC_START + 6)
72#define IRQ_EB11MP_KMI0 (IRQ_EB_GIC_START + 7)
73#define IRQ_EB11MP_KMI1 (IRQ_EB_GIC_START + 8)
74#define IRQ_EB11MP_ETH (IRQ_EB_GIC_START + 9)
75#define IRQ_EB11MP_EB_IRQ1 (IRQ_EB_GIC_START + 10) /* main GIC */
76#define IRQ_EB11MP_EB_IRQ2 (IRQ_EB_GIC_START + 11) /* tile GIC */
77#define IRQ_EB11MP_EB_FIQ1 (IRQ_EB_GIC_START + 12) /* main GIC */
78#define IRQ_EB11MP_EB_FIQ2 (IRQ_EB_GIC_START + 13) /* tile GIC */
79#define IRQ_EB11MP_MMCI0A (IRQ_EB_GIC_START + 14)
80#define IRQ_EB11MP_MMCI0B (IRQ_EB_GIC_START + 15)
81
82#define IRQ_EB11MP_PMU_CPU0 (IRQ_EB_GIC_START + 17)
83#define IRQ_EB11MP_PMU_CPU1 (IRQ_EB_GIC_START + 18)
84#define IRQ_EB11MP_PMU_CPU2 (IRQ_EB_GIC_START + 19)
85#define IRQ_EB11MP_PMU_CPU3 (IRQ_EB_GIC_START + 20)
86#define IRQ_EB11MP_PMU_SCU0 (IRQ_EB_GIC_START + 21)
87#define IRQ_EB11MP_PMU_SCU1 (IRQ_EB_GIC_START + 22)
88#define IRQ_EB11MP_PMU_SCU2 (IRQ_EB_GIC_START + 23)
89#define IRQ_EB11MP_PMU_SCU3 (IRQ_EB_GIC_START + 24)
90#define IRQ_EB11MP_PMU_SCU4 (IRQ_EB_GIC_START + 25)
91#define IRQ_EB11MP_PMU_SCU5 (IRQ_EB_GIC_START + 26)
92#define IRQ_EB11MP_PMU_SCU6 (IRQ_EB_GIC_START + 27)
93#define IRQ_EB11MP_PMU_SCU7 (IRQ_EB_GIC_START + 28)
94
95#define IRQ_EB11MP_L220_EVENT (IRQ_EB_GIC_START + 29)
96#define IRQ_EB11MP_L220_SLAVE (IRQ_EB_GIC_START + 30)
97#define IRQ_EB11MP_L220_DECODE (IRQ_EB_GIC_START + 31)
98
99#define IRQ_EB11MP_UART2 -1
100#define IRQ_EB11MP_UART3 -1
101#define IRQ_EB11MP_CLCD -1
102#define IRQ_EB11MP_DMA -1
103#define IRQ_EB11MP_WDOG -1
104#define IRQ_EB11MP_GPIO0 -1
105#define IRQ_EB11MP_GPIO1 -1
106#define IRQ_EB11MP_GPIO2 -1
107#define IRQ_EB11MP_SCI -1
108#define IRQ_EB11MP_SSP -1
109
110#define NR_GIC_EB11MP 2
111
112/*
113 * Only define NR_IRQS if less than NR_IRQS_EB
114 */
115#define NR_IRQS_EB (IRQ_EB_GIC_START + 96)
116
117#if defined(CONFIG_MACH_REALVIEW_EB) \
118 && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB))
119#undef NR_IRQS
120#define NR_IRQS NR_IRQS_EB
121#endif
122
123#if defined(CONFIG_REALVIEW_EB_ARM11MP) || defined(CONFIG_REALVIEW_EB_A9MP) \
124 && (!defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_EB11MP))
125#undef MAX_GIC_NR
126#define MAX_GIC_NR NR_GIC_EB11MP
127#endif
128
129#endif /* __MACH_IRQS_EB_H */
diff --git a/arch/arm/mach-realview/include/mach/irqs-pb1176.h b/arch/arm/mach-realview/include/mach/irqs-pb1176.h
new file mode 100644
index 000000000000..2410d4f8ddd3
--- /dev/null
+++ b/arch/arm/mach-realview/include/mach/irqs-pb1176.h
@@ -0,0 +1,99 @@
1/*
2 * arch/arm/mach-realview/include/mach/irqs-pb1176.h
3 *
4 * Copyright (C) 2008 ARM Limited
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __MACH_IRQS_PB1176_H
22#define __MACH_IRQS_PB1176_H
23
24#define IRQ_DC1176_GIC_START 32
25#define IRQ_PB1176_GIC_START 64
26
27/*
28 * ARM1176 DevChip interrupt sources (primary GIC)
29 */
30#define IRQ_DC1176_WATCHDOG (IRQ_DC1176_GIC_START + 0) /* Watchdog timer */
31#define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */
32#define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */
33#define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */
34#define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */
35#define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */
36#define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */
37#define IRQ_DC1176_APC (IRQ_DC1176_GIC_START + 11)
38#define IRQ_DC1176_IEC (IRQ_DC1176_GIC_START + 12)
39#define IRQ_DC1176_L2CC (IRQ_DC1176_GIC_START + 13)
40#define IRQ_DC1176_RTC (IRQ_DC1176_GIC_START + 14)
41#define IRQ_DC1176_CLCD (IRQ_DC1176_GIC_START + 15) /* CLCD controller */
42#define IRQ_DC1176_UART0 (IRQ_DC1176_GIC_START + 18) /* UART 0 on development chip */
43#define IRQ_DC1176_UART1 (IRQ_DC1176_GIC_START + 19) /* UART 1 on development chip */
44#define IRQ_DC1176_UART2 (IRQ_DC1176_GIC_START + 20) /* UART 2 on development chip */
45#define IRQ_DC1176_UART3 (IRQ_DC1176_GIC_START + 21) /* UART 3 on development chip */
46
47#define IRQ_DC1176_PB_IRQ2 (IRQ_DC1176_GIC_START + 30) /* tile GIC */
48#define IRQ_DC1176_PB_IRQ1 (IRQ_DC1176_GIC_START + 31) /* main GIC */
49
50/*
51 * RealView PB1176 interrupt sources (secondary GIC)
52 */
53#define IRQ_PB1176_MMCI0A (IRQ_PB1176_GIC_START + 1) /* Multimedia Card 0A */
54#define IRQ_PB1176_MMCI0B (IRQ_PB1176_GIC_START + 2) /* Multimedia Card 0A */
55#define IRQ_PB1176_KMI0 (IRQ_PB1176_GIC_START + 3) /* Keyboard/Mouse port 0 */
56#define IRQ_PB1176_KMI1 (IRQ_PB1176_GIC_START + 4) /* Keyboard/Mouse port 1 */
57#define IRQ_PB1176_SCI (IRQ_PB1176_GIC_START + 5)
58#define IRQ_PB1176_UART4 (IRQ_PB1176_GIC_START + 6) /* UART 4 on baseboard */
59#define IRQ_PB1176_CHARLCD (IRQ_PB1176_GIC_START + 7) /* Character LCD */
60#define IRQ_PB1176_GPIO1 (IRQ_PB1176_GIC_START + 8)
61#define IRQ_PB1176_GPIO2 (IRQ_PB1176_GIC_START + 9)
62#define IRQ_PB1176_ETH (IRQ_PB1176_GIC_START + 10) /* Ethernet controller */
63#define IRQ_PB1176_USB (IRQ_PB1176_GIC_START + 11) /* USB controller */
64
65#define IRQ_PB1176_PISMO (IRQ_PB1176_GIC_START + 16)
66
67#define IRQ_PB1176_AACI (IRQ_PB1176_GIC_START + 19) /* Audio Codec */
68
69#define IRQ_PB1176_TIMER0_1 (IRQ_PB1176_GIC_START + 22)
70#define IRQ_PB1176_TIMER2_3 (IRQ_PB1176_GIC_START + 23)
71#define IRQ_PB1176_DMAC (IRQ_PB1176_GIC_START + 24) /* DMA controller */
72#define IRQ_PB1176_RTC (IRQ_PB1176_GIC_START + 25) /* Real Time Clock */
73
74#define IRQ_PB1176_GPIO0 -1
75#define IRQ_PB1176_SSP -1
76#define IRQ_PB1176_SCTL -1
77
78#define NR_GIC_PB1176 2
79
80/*
81 * Only define NR_IRQS if less than NR_IRQS_PB1176
82 */
83#define NR_IRQS_PB1176 (IRQ_DC1176_GIC_START + 96)
84
85#if defined(CONFIG_MACH_REALVIEW_PB1176)
86
87#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB1176)
88#undef NR_IRQS
89#define NR_IRQS NR_IRQS_PB1176
90#endif
91
92#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB1176)
93#undef MAX_GIC_NR
94#define MAX_GIC_NR NR_GIC_PB1176
95#endif
96
97#endif /* CONFIG_MACH_REALVIEW_PB1176 */
98
99#endif /* __MACH_IRQS_PB1176_H */
diff --git a/arch/arm/mach-realview/include/mach/irqs-pb11mp.h b/arch/arm/mach-realview/include/mach/irqs-pb11mp.h
new file mode 100644
index 000000000000..34e255add21e
--- /dev/null
+++ b/arch/arm/mach-realview/include/mach/irqs-pb11mp.h
@@ -0,0 +1,122 @@
1/*
2 * arch/arm/mach-realview/include/mach/irqs-pb11mp.h
3 *
4 * Copyright (C) 2008 ARM Limited
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __MACH_IRQS_PB11MP_H
22#define __MACH_IRQS_PB11MP_H
23
24#define IRQ_TC11MP_GIC_START 32
25#define IRQ_PB11MP_GIC_START 64
26
27/*
28 * ARM11MPCore test chip interrupt sources (primary GIC on the test chip)
29 */
30#define IRQ_TC11MP_AACI (IRQ_TC11MP_GIC_START + 0)
31#define IRQ_TC11MP_TIMER0_1 (IRQ_TC11MP_GIC_START + 1)
32#define IRQ_TC11MP_TIMER2_3 (IRQ_TC11MP_GIC_START + 2)
33#define IRQ_TC11MP_USB (IRQ_TC11MP_GIC_START + 3)
34#define IRQ_TC11MP_UART0 (IRQ_TC11MP_GIC_START + 4)
35#define IRQ_TC11MP_UART1 (IRQ_TC11MP_GIC_START + 5)
36#define IRQ_TC11MP_RTC (IRQ_TC11MP_GIC_START + 6)
37#define IRQ_TC11MP_KMI0 (IRQ_TC11MP_GIC_START + 7)
38#define IRQ_TC11MP_KMI1 (IRQ_TC11MP_GIC_START + 8)
39#define IRQ_TC11MP_ETH (IRQ_TC11MP_GIC_START + 9)
40#define IRQ_TC11MP_PB_IRQ1 (IRQ_TC11MP_GIC_START + 10) /* main GIC */
41#define IRQ_TC11MP_PB_IRQ2 (IRQ_TC11MP_GIC_START + 11) /* tile GIC */
42#define IRQ_TC11MP_PB_FIQ1 (IRQ_TC11MP_GIC_START + 12) /* main GIC */
43#define IRQ_TC11MP_PB_FIQ2 (IRQ_TC11MP_GIC_START + 13) /* tile GIC */
44#define IRQ_TC11MP_MMCI0A (IRQ_TC11MP_GIC_START + 14)
45#define IRQ_TC11MP_MMCI0B (IRQ_TC11MP_GIC_START + 15)
46
47#define IRQ_TC11MP_PMU_CPU0 (IRQ_TC11MP_GIC_START + 17)
48#define IRQ_TC11MP_PMU_CPU1 (IRQ_TC11MP_GIC_START + 18)
49#define IRQ_TC11MP_PMU_CPU2 (IRQ_TC11MP_GIC_START + 19)
50#define IRQ_TC11MP_PMU_CPU3 (IRQ_TC11MP_GIC_START + 20)
51#define IRQ_TC11MP_PMU_SCU0 (IRQ_TC11MP_GIC_START + 21)
52#define IRQ_TC11MP_PMU_SCU1 (IRQ_TC11MP_GIC_START + 22)
53#define IRQ_TC11MP_PMU_SCU2 (IRQ_TC11MP_GIC_START + 23)
54#define IRQ_TC11MP_PMU_SCU3 (IRQ_TC11MP_GIC_START + 24)
55#define IRQ_TC11MP_PMU_SCU4 (IRQ_TC11MP_GIC_START + 25)
56#define IRQ_TC11MP_PMU_SCU5 (IRQ_TC11MP_GIC_START + 26)
57#define IRQ_TC11MP_PMU_SCU6 (IRQ_TC11MP_GIC_START + 27)
58#define IRQ_TC11MP_PMU_SCU7 (IRQ_TC11MP_GIC_START + 28)
59
60#define IRQ_TC11MP_L220_EVENT (IRQ_TC11MP_GIC_START + 29)
61#define IRQ_TC11MP_L220_SLAVE (IRQ_TC11MP_GIC_START + 30)
62#define IRQ_TC11MP_L220_DECODE (IRQ_TC11MP_GIC_START + 31)
63
64/*
65 * RealView PB11MPCore GIC interrupt sources (secondary GIC on the board)
66 */
67#define IRQ_PB11MP_WATCHDOG (IRQ_PB11MP_GIC_START + 0) /* Watchdog timer */
68#define IRQ_PB11MP_SOFT (IRQ_PB11MP_GIC_START + 1) /* Software interrupt */
69#define IRQ_PB11MP_COMMRx (IRQ_PB11MP_GIC_START + 2) /* Debug Comm Rx interrupt */
70#define IRQ_PB11MP_COMMTx (IRQ_PB11MP_GIC_START + 3) /* Debug Comm Tx interrupt */
71#define IRQ_PB11MP_GPIO0 (IRQ_PB11MP_GIC_START + 6) /* GPIO 0 */
72#define IRQ_PB11MP_GPIO1 (IRQ_PB11MP_GIC_START + 7) /* GPIO 1 */
73#define IRQ_PB11MP_GPIO2 (IRQ_PB11MP_GIC_START + 8) /* GPIO 2 */
74 /* 9 reserved */
75#define IRQ_PB11MP_RTC_GIC1 (IRQ_PB11MP_GIC_START + 10) /* Real Time Clock */
76#define IRQ_PB11MP_SSP (IRQ_PB11MP_GIC_START + 11) /* Synchronous Serial Port */
77#define IRQ_PB11MP_UART0_GIC1 (IRQ_PB11MP_GIC_START + 12) /* UART 0 on development chip */
78#define IRQ_PB11MP_UART1_GIC1 (IRQ_PB11MP_GIC_START + 13) /* UART 1 on development chip */
79#define IRQ_PB11MP_UART2 (IRQ_PB11MP_GIC_START + 14) /* UART 2 on development chip */
80#define IRQ_PB11MP_UART3 (IRQ_PB11MP_GIC_START + 15) /* UART 3 on development chip */
81#define IRQ_PB11MP_SCI (IRQ_PB11MP_GIC_START + 16) /* Smart Card Interface */
82#define IRQ_PB11MP_MMCI0A_GIC1 (IRQ_PB11MP_GIC_START + 17) /* Multimedia Card 0A */
83#define IRQ_PB11MP_MMCI0B_GIC1 (IRQ_PB11MP_GIC_START + 18) /* Multimedia Card 0B */
84#define IRQ_PB11MP_AACI_GIC1 (IRQ_PB11MP_GIC_START + 19) /* Audio Codec */
85#define IRQ_PB11MP_KMI0_GIC1 (IRQ_PB11MP_GIC_START + 20) /* Keyboard/Mouse port 0 */
86#define IRQ_PB11MP_KMI1_GIC1 (IRQ_PB11MP_GIC_START + 21) /* Keyboard/Mouse port 1 */
87#define IRQ_PB11MP_CHARLCD (IRQ_PB11MP_GIC_START + 22) /* Character LCD */
88#define IRQ_PB11MP_CLCD (IRQ_PB11MP_GIC_START + 23) /* CLCD controller */
89#define IRQ_PB11MP_DMAC (IRQ_PB11MP_GIC_START + 24) /* DMA controller */
90#define IRQ_PB11MP_PWRFAIL (IRQ_PB11MP_GIC_START + 25) /* Power failure */
91#define IRQ_PB11MP_PISMO (IRQ_PB11MP_GIC_START + 26) /* PISMO interface */
92#define IRQ_PB11MP_DoC (IRQ_PB11MP_GIC_START + 27) /* Disk on Chip memory controller */
93#define IRQ_PB11MP_ETH_GIC1 (IRQ_PB11MP_GIC_START + 28) /* Ethernet controller */
94#define IRQ_PB11MP_USB_GIC1 (IRQ_PB11MP_GIC_START + 29) /* USB controller */
95#define IRQ_PB11MP_TSPEN (IRQ_PB11MP_GIC_START + 30) /* Touchscreen pen */
96#define IRQ_PB11MP_TSKPAD (IRQ_PB11MP_GIC_START + 31) /* Touchscreen keypad */
97
98#define IRQ_PB11MP_SMC -1
99#define IRQ_PB11MP_SCTL -1
100
101#define NR_GIC_PB11MP 2
102
103/*
104 * Only define NR_IRQS if less than NR_IRQS_PB11MP
105 */
106#define NR_IRQS_PB11MP (IRQ_TC11MP_GIC_START + 96)
107
108#if defined(CONFIG_MACH_REALVIEW_PB11MP)
109
110#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB11MP)
111#undef NR_IRQS
112#define NR_IRQS NR_IRQS_PB11MP
113#endif
114
115#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB11MP)
116#undef MAX_GIC_NR
117#define MAX_GIC_NR NR_GIC_PB11MP
118#endif
119
120#endif /* CONFIG_MACH_REALVIEW_PB11MP */
121
122#endif /* __MACH_IRQS_PB11MP_H */
diff --git a/arch/arm/mach-realview/include/mach/irqs-pba8.h b/arch/arm/mach-realview/include/mach/irqs-pba8.h
new file mode 100644
index 000000000000..86792a9f2ab6
--- /dev/null
+++ b/arch/arm/mach-realview/include/mach/irqs-pba8.h
@@ -0,0 +1,98 @@
1/*
2 * arch/arm/mach-realview/include/mach/irqs-pba8.h
3 *
4 * Copyright (C) 2008 ARM Limited
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __MACH_IRQS_PBA8_H
22#define __MACH_IRQS_PBA8_H
23
24#define IRQ_PBA8_GIC_START 32
25
26/* L220
27#define IRQ_PBA8_L220_EVENT (IRQ_PBA8_GIC_START + 29)
28#define IRQ_PBA8_L220_SLAVE (IRQ_PBA8_GIC_START + 30)
29#define IRQ_PBA8_L220_DECODE (IRQ_PBA8_GIC_START + 31)
30*/
31
32/*
33 * PB-A8 on-board gic irq sources
34 */
35#define IRQ_PBA8_WATCHDOG (IRQ_PBA8_GIC_START + 0) /* Watchdog timer */
36#define IRQ_PBA8_SOFT (IRQ_PBA8_GIC_START + 1) /* Software interrupt */
37#define IRQ_PBA8_COMMRx (IRQ_PBA8_GIC_START + 2) /* Debug Comm Rx interrupt */
38#define IRQ_PBA8_COMMTx (IRQ_PBA8_GIC_START + 3) /* Debug Comm Tx interrupt */
39#define IRQ_PBA8_TIMER0_1 (IRQ_PBA8_GIC_START + 4) /* Timer 0/1 (default timer) */
40#define IRQ_PBA8_TIMER2_3 (IRQ_PBA8_GIC_START + 5) /* Timer 2/3 */
41#define IRQ_PBA8_GPIO0 (IRQ_PBA8_GIC_START + 6) /* GPIO 0 */
42#define IRQ_PBA8_GPIO1 (IRQ_PBA8_GIC_START + 7) /* GPIO 1 */
43#define IRQ_PBA8_GPIO2 (IRQ_PBA8_GIC_START + 8) /* GPIO 2 */
44 /* 9 reserved */
45#define IRQ_PBA8_RTC (IRQ_PBA8_GIC_START + 10) /* Real Time Clock */
46#define IRQ_PBA8_SSP (IRQ_PBA8_GIC_START + 11) /* Synchronous Serial Port */
47#define IRQ_PBA8_UART0 (IRQ_PBA8_GIC_START + 12) /* UART 0 on development chip */
48#define IRQ_PBA8_UART1 (IRQ_PBA8_GIC_START + 13) /* UART 1 on development chip */
49#define IRQ_PBA8_UART2 (IRQ_PBA8_GIC_START + 14) /* UART 2 on development chip */
50#define IRQ_PBA8_UART3 (IRQ_PBA8_GIC_START + 15) /* UART 3 on development chip */
51#define IRQ_PBA8_SCI (IRQ_PBA8_GIC_START + 16) /* Smart Card Interface */
52#define IRQ_PBA8_MMCI0A (IRQ_PBA8_GIC_START + 17) /* Multimedia Card 0A */
53#define IRQ_PBA8_MMCI0B (IRQ_PBA8_GIC_START + 18) /* Multimedia Card 0B */
54#define IRQ_PBA8_AACI (IRQ_PBA8_GIC_START + 19) /* Audio Codec */
55#define IRQ_PBA8_KMI0 (IRQ_PBA8_GIC_START + 20) /* Keyboard/Mouse port 0 */
56#define IRQ_PBA8_KMI1 (IRQ_PBA8_GIC_START + 21) /* Keyboard/Mouse port 1 */
57#define IRQ_PBA8_CHARLCD (IRQ_PBA8_GIC_START + 22) /* Character LCD */
58#define IRQ_PBA8_CLCD (IRQ_PBA8_GIC_START + 23) /* CLCD controller */
59#define IRQ_PBA8_DMAC (IRQ_PBA8_GIC_START + 24) /* DMA controller */
60#define IRQ_PBA8_PWRFAIL (IRQ_PBA8_GIC_START + 25) /* Power failure */
61#define IRQ_PBA8_PISMO (IRQ_PBA8_GIC_START + 26) /* PISMO interface */
62#define IRQ_PBA8_DoC (IRQ_PBA8_GIC_START + 27) /* Disk on Chip memory controller */
63#define IRQ_PBA8_ETH (IRQ_PBA8_GIC_START + 28) /* Ethernet controller */
64#define IRQ_PBA8_USB (IRQ_PBA8_GIC_START + 29) /* USB controller */
65#define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */
66#define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */
67
68/* ... */
69#define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50)
70#define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51)
71#define IRQ_PBA8_PCI2 (IRQ_PBA8_GIC_START + 52)
72#define IRQ_PBA8_PCI3 (IRQ_PBA8_GIC_START + 53)
73
74#define IRQ_PBA8_SMC -1
75#define IRQ_PBA8_SCTL -1
76
77#define NR_GIC_PBA8 1
78
79/*
80 * Only define NR_IRQS if less than NR_IRQS_PBA8
81 */
82#define NR_IRQS_PBA8 (IRQ_PBA8_GIC_START + 64)
83
84#if defined(CONFIG_MACH_REALVIEW_PBA8)
85
86#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PBA8)
87#undef NR_IRQS
88#define NR_IRQS NR_IRQS_PBA8
89#endif
90
91#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PBA8)
92#undef MAX_GIC_NR
93#define MAX_GIC_NR NR_GIC_PBA8
94#endif
95
96#endif /* CONFIG_MACH_REALVIEW_PBA8 */
97
98#endif /* __MACH_IRQS_PBA8_H */
diff --git a/arch/arm/mach-realview/include/mach/irqs-pbx.h b/arch/arm/mach-realview/include/mach/irqs-pbx.h
new file mode 100644
index 000000000000..deaad4302b17
--- /dev/null
+++ b/arch/arm/mach-realview/include/mach/irqs-pbx.h
@@ -0,0 +1,115 @@
1/*
2 * arch/arm/mach-realview/include/mach/irqs-pbx.h
3 *
4 * Copyright (C) 2009 ARM Limited
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __MACH_IRQS_PBX_H
21#define __MACH_IRQS_PBX_H
22
23#define IRQ_PBX_GIC_START 32
24
25/* L220
26#define IRQ_PBX_L220_EVENT (IRQ_PBX_GIC_START + 29)
27#define IRQ_PBX_L220_SLAVE (IRQ_PBX_GIC_START + 30)
28#define IRQ_PBX_L220_DECODE (IRQ_PBX_GIC_START + 31)
29*/
30
31/*
32 * PBX on-board gic irq sources
33 */
34#define IRQ_PBX_WATCHDOG (IRQ_PBX_GIC_START + 0) /* Watchdog timer */
35#define IRQ_PBX_SOFT (IRQ_PBX_GIC_START + 1) /* Software interrupt */
36#define IRQ_PBX_COMMRx (IRQ_PBX_GIC_START + 2) /* Debug Comm Rx interrupt */
37#define IRQ_PBX_COMMTx (IRQ_PBX_GIC_START + 3) /* Debug Comm Tx interrupt */
38#define IRQ_PBX_TIMER0_1 (IRQ_PBX_GIC_START + 4) /* Timer 0/1 (default timer) */
39#define IRQ_PBX_TIMER2_3 (IRQ_PBX_GIC_START + 5) /* Timer 2/3 */
40#define IRQ_PBX_GPIO0 (IRQ_PBX_GIC_START + 6) /* GPIO 0 */
41#define IRQ_PBX_GPIO1 (IRQ_PBX_GIC_START + 7) /* GPIO 1 */
42#define IRQ_PBX_GPIO2 (IRQ_PBX_GIC_START + 8) /* GPIO 2 */
43 /* 9 reserved */
44#define IRQ_PBX_RTC (IRQ_PBX_GIC_START + 10) /* Real Time Clock */
45#define IRQ_PBX_SSP (IRQ_PBX_GIC_START + 11) /* Synchronous Serial Port */
46#define IRQ_PBX_UART0 (IRQ_PBX_GIC_START + 12) /* UART 0 on development chip */
47#define IRQ_PBX_UART1 (IRQ_PBX_GIC_START + 13) /* UART 1 on development chip */
48#define IRQ_PBX_UART2 (IRQ_PBX_GIC_START + 14) /* UART 2 on development chip */
49#define IRQ_PBX_UART3 (IRQ_PBX_GIC_START + 15) /* UART 3 on development chip */
50#define IRQ_PBX_SCI (IRQ_PBX_GIC_START + 16) /* Smart Card Interface */
51#define IRQ_PBX_MMCI0A (IRQ_PBX_GIC_START + 17) /* Multimedia Card 0A */
52#define IRQ_PBX_MMCI0B (IRQ_PBX_GIC_START + 18) /* Multimedia Card 0B */
53#define IRQ_PBX_AACI (IRQ_PBX_GIC_START + 19) /* Audio Codec */
54#define IRQ_PBX_KMI0 (IRQ_PBX_GIC_START + 20) /* Keyboard/Mouse port 0 */
55#define IRQ_PBX_KMI1 (IRQ_PBX_GIC_START + 21) /* Keyboard/Mouse port 1 */
56#define IRQ_PBX_CHARLCD (IRQ_PBX_GIC_START + 22) /* Character LCD */
57#define IRQ_PBX_CLCD (IRQ_PBX_GIC_START + 23) /* CLCD controller */
58#define IRQ_PBX_DMAC (IRQ_PBX_GIC_START + 24) /* DMA controller */
59#define IRQ_PBX_PWRFAIL (IRQ_PBX_GIC_START + 25) /* Power failure */
60#define IRQ_PBX_PISMO (IRQ_PBX_GIC_START + 26) /* PISMO interface */
61#define IRQ_PBX_DoC (IRQ_PBX_GIC_START + 27) /* Disk on Chip memory controller */
62#define IRQ_PBX_ETH (IRQ_PBX_GIC_START + 28) /* Ethernet controller */
63#define IRQ_PBX_USB (IRQ_PBX_GIC_START + 29) /* USB controller */
64#define IRQ_PBX_TSPEN (IRQ_PBX_GIC_START + 30) /* Touchscreen pen */
65#define IRQ_PBX_TSKPAD (IRQ_PBX_GIC_START + 31) /* Touchscreen keypad */
66
67#define IRQ_PBX_PMU_SCU0 (IRQ_PBX_GIC_START + 32) /* SCU PMU Interrupts (11mp) */
68#define IRQ_PBX_PMU_SCU1 (IRQ_PBX_GIC_START + 33)
69#define IRQ_PBX_PMU_SCU2 (IRQ_PBX_GIC_START + 34)
70#define IRQ_PBX_PMU_SCU3 (IRQ_PBX_GIC_START + 35)
71#define IRQ_PBX_PMU_SCU4 (IRQ_PBX_GIC_START + 36)
72#define IRQ_PBX_PMU_SCU5 (IRQ_PBX_GIC_START + 37)
73#define IRQ_PBX_PMU_SCU6 (IRQ_PBX_GIC_START + 38)
74#define IRQ_PBX_PMU_SCU7 (IRQ_PBX_GIC_START + 39)
75
76#define IRQ_PBX_WATCHDOG1 (IRQ_PBX_GIC_START + 40) /* Watchdog1 timer */
77#define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */
78#define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */
79/* ... */
80#define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */
81#define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 45)
82#define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 46)
83#define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 47)
84
85/* ... */
86#define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50)
87#define IRQ_PBX_PCI1 (IRQ_PBX_GIC_START + 51)
88#define IRQ_PBX_PCI2 (IRQ_PBX_GIC_START + 52)
89#define IRQ_PBX_PCI3 (IRQ_PBX_GIC_START + 53)
90
91#define IRQ_PBX_SMC -1
92#define IRQ_PBX_SCTL -1
93
94#define NR_GIC_PBX 1
95
96/*
97 * Only define NR_IRQS if less than NR_IRQS_PBX
98 */
99#define NR_IRQS_PBX (IRQ_PBX_GIC_START + 96)
100
101#if defined(CONFIG_MACH_REALVIEW_PBX)
102
103#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PBX)
104#undef NR_IRQS
105#define NR_IRQS NR_IRQS_PBX
106#endif
107
108#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PBX)
109#undef MAX_GIC_NR
110#define MAX_GIC_NR NR_GIC_PBX
111#endif
112
113#endif /* CONFIG_MACH_REALVIEW_PBX */
114
115#endif /* __MACH_IRQS_PBX_H */
diff --git a/arch/arm/mach-realview/include/mach/irqs.h b/arch/arm/mach-realview/include/mach/irqs.h
index fe5cb987aa21..78854f2fa323 100644
--- a/arch/arm/mach-realview/include/mach/irqs.h
+++ b/arch/arm/mach-realview/include/mach/irqs.h
@@ -22,10 +22,11 @@
22#ifndef __ASM_ARCH_IRQS_H 22#ifndef __ASM_ARCH_IRQS_H
23#define __ASM_ARCH_IRQS_H 23#define __ASM_ARCH_IRQS_H
24 24
25#include <mach/board-eb.h> 25#include <mach/irqs-eb.h>
26#include <mach/board-pb11mp.h> 26#include <mach/irqs-pb11mp.h>
27#include <mach/board-pb1176.h> 27#include <mach/irqs-pb1176.h>
28#include <mach/board-pba8.h> 28#include <mach/irqs-pba8.h>
29#include <mach/irqs-pbx.h>
29 30
30#define IRQ_LOCALTIMER 29 31#define IRQ_LOCALTIMER 29
31#define IRQ_LOCALWDOG 30 32#define IRQ_LOCALWDOG 30
diff --git a/arch/arm/mach-realview/include/mach/scu.h b/arch/arm/mach-realview/include/mach/scu.h
deleted file mode 100644
index d55802d645af..000000000000
--- a/arch/arm/mach-realview/include/mach/scu.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASMARM_ARCH_SCU_H
2#define __ASMARM_ARCH_SCU_H
3
4/*
5 * SCU registers
6 */
7#define SCU_CTRL 0x00
8#define SCU_CONFIG 0x04
9#define SCU_CPU_STATUS 0x08
10#define SCU_INVALIDATE 0x0c
11#define SCU_FPGA_REVISION 0x10
12
13#endif
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index 415d634d52ab..83050378ffd2 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -24,6 +24,7 @@
24#include <mach/board-pb11mp.h> 24#include <mach/board-pb11mp.h>
25#include <mach/board-pb1176.h> 25#include <mach/board-pb1176.h>
26#include <mach/board-pba8.h> 26#include <mach/board-pba8.h>
27#include <mach/board-pbx.h>
27 28
28#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) 29#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
29#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) 30#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c))
@@ -43,6 +44,8 @@ static inline unsigned long get_uart_base(void)
43 return REALVIEW_PB1176_UART0_BASE; 44 return REALVIEW_PB1176_UART0_BASE;
44 else if (machine_is_realview_pba8()) 45 else if (machine_is_realview_pba8())
45 return REALVIEW_PBA8_UART0_BASE; 46 return REALVIEW_PBA8_UART0_BASE;
47 else if (machine_is_realview_pbx())
48 return REALVIEW_PBX_UART0_BASE;
46 else 49 else
47 return 0; 50 return 0;
48} 51}
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
index 1c01d13460f0..60b4e111f459 100644
--- a/arch/arm/mach-realview/localtimer.c
+++ b/arch/arm/mach-realview/localtimer.c
@@ -9,196 +9,18 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/smp.h> 12#include <linux/smp.h>
16#include <linux/jiffies.h>
17#include <linux/percpu.h>
18#include <linux/clockchips.h> 13#include <linux/clockchips.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21 14
22#include <asm/hardware/arm_twd.h>
23#include <asm/hardware/gic.h>
24#include <mach/hardware.h>
25#include <asm/irq.h> 15#include <asm/irq.h>
26 16#include <asm/smp_twd.h>
27static DEFINE_PER_CPU(struct clock_event_device, local_clockevent); 17#include <asm/localtimer.h>
28
29/*
30 * Used on SMP for either the local timer or IPI_TIMER
31 */
32void local_timer_interrupt(void)
33{
34 struct clock_event_device *clk = &__get_cpu_var(local_clockevent);
35
36 clk->event_handler(clk);
37}
38
39#ifdef CONFIG_LOCAL_TIMERS
40
41/* set up by the platform code */
42void __iomem *twd_base;
43
44static unsigned long mpcore_timer_rate;
45
46static void local_timer_set_mode(enum clock_event_mode mode,
47 struct clock_event_device *clk)
48{
49 unsigned long ctrl;
50
51 switch(mode) {
52 case CLOCK_EVT_MODE_PERIODIC:
53 /* timer load already set up */
54 ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE
55 | TWD_TIMER_CONTROL_PERIODIC;
56 break;
57 case CLOCK_EVT_MODE_ONESHOT:
58 /* period set, and timer enabled in 'next_event' hook */
59 ctrl = TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT;
60 break;
61 case CLOCK_EVT_MODE_UNUSED:
62 case CLOCK_EVT_MODE_SHUTDOWN:
63 default:
64 ctrl = 0;
65 }
66
67 __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
68}
69
70static int local_timer_set_next_event(unsigned long evt,
71 struct clock_event_device *unused)
72{
73 unsigned long ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL);
74
75 __raw_writel(evt, twd_base + TWD_TIMER_COUNTER);
76 __raw_writel(ctrl | TWD_TIMER_CONTROL_ENABLE, twd_base + TWD_TIMER_CONTROL);
77
78 return 0;
79}
80
81/*
82 * local_timer_ack: checks for a local timer interrupt.
83 *
84 * If a local timer interrupt has occurred, acknowledge and return 1.
85 * Otherwise, return 0.
86 */
87int local_timer_ack(void)
88{
89 if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) {
90 __raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
91 return 1;
92 }
93
94 return 0;
95}
96
97static void __cpuinit twd_calibrate_rate(void)
98{
99 unsigned long load, count;
100 u64 waitjiffies;
101
102 /*
103 * If this is the first time round, we need to work out how fast
104 * the timer ticks
105 */
106 if (mpcore_timer_rate == 0) {
107 printk("Calibrating local timer... ");
108
109 /* Wait for a tick to start */
110 waitjiffies = get_jiffies_64() + 1;
111
112 while (get_jiffies_64() < waitjiffies)
113 udelay(10);
114
115 /* OK, now the tick has started, let's get the timer going */
116 waitjiffies += 5;
117
118 /* enable, no interrupt or reload */
119 __raw_writel(0x1, twd_base + TWD_TIMER_CONTROL);
120
121 /* maximum value */
122 __raw_writel(0xFFFFFFFFU, twd_base + TWD_TIMER_COUNTER);
123
124 while (get_jiffies_64() < waitjiffies)
125 udelay(10);
126
127 count = __raw_readl(twd_base + TWD_TIMER_COUNTER);
128
129 mpcore_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
130
131 printk("%lu.%02luMHz.\n", mpcore_timer_rate / 1000000,
132 (mpcore_timer_rate / 100000) % 100);
133 }
134
135 load = mpcore_timer_rate / HZ;
136
137 __raw_writel(load, twd_base + TWD_TIMER_LOAD);
138}
139 18
140/* 19/*
141 * Setup the local clock events for a CPU. 20 * Setup the local clock events for a CPU.
142 */ 21 */
143void __cpuinit local_timer_setup(void) 22void __cpuinit local_timer_setup(struct clock_event_device *evt)
144{
145 unsigned int cpu = smp_processor_id();
146 struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
147 unsigned long flags;
148
149 twd_calibrate_rate();
150
151 clk->name = "local_timer";
152 clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
153 clk->rating = 350;
154 clk->set_mode = local_timer_set_mode;
155 clk->set_next_event = local_timer_set_next_event;
156 clk->irq = IRQ_LOCALTIMER;
157 clk->cpumask = cpumask_of(cpu);
158 clk->shift = 20;
159 clk->mult = div_sc(mpcore_timer_rate, NSEC_PER_SEC, clk->shift);
160 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
161 clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
162
163 /* Make sure our local interrupt controller has this enabled */
164 local_irq_save(flags);
165 get_irq_chip(IRQ_LOCALTIMER)->unmask(IRQ_LOCALTIMER);
166 local_irq_restore(flags);
167
168 clockevents_register_device(clk);
169}
170
171/*
172 * take a local timer down
173 */
174void __cpuexit local_timer_stop(void)
175{ 23{
176 __raw_writel(0, twd_base + TWD_TIMER_CONTROL); 24 evt->irq = IRQ_LOCALTIMER;
25 twd_timer_setup(evt);
177} 26}
178
179#else /* CONFIG_LOCAL_TIMERS */
180
181static void dummy_timer_set_mode(enum clock_event_mode mode,
182 struct clock_event_device *clk)
183{
184}
185
186void __cpuinit local_timer_setup(void)
187{
188 unsigned int cpu = smp_processor_id();
189 struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
190
191 clk->name = "dummy_timer";
192 clk->features = CLOCK_EVT_FEAT_ONESHOT |
193 CLOCK_EVT_FEAT_PERIODIC |
194 CLOCK_EVT_FEAT_DUMMY;
195 clk->rating = 400;
196 clk->mult = 1;
197 clk->set_mode = dummy_timer_set_mode;
198 clk->broadcast = smp_timer_broadcast;
199 clk->cpumask = cpumask_of(cpu);
200
201 clockevents_register_device(clk);
202}
203
204#endif /* !CONFIG_LOCAL_TIMERS */
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 30a9c68591f6..ac0e83f1cc3a 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -19,10 +19,12 @@
19#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/localtimer.h>
22 23
23#include <mach/board-eb.h> 24#include <mach/board-eb.h>
24#include <mach/board-pb11mp.h> 25#include <mach/board-pb11mp.h>
25#include <mach/scu.h> 26#include <mach/board-pbx.h>
27#include <asm/smp_scu.h>
26 28
27#include "core.h" 29#include "core.h"
28 30
@@ -40,35 +42,19 @@ static void __iomem *scu_base_addr(void)
40 return __io_address(REALVIEW_EB11MP_SCU_BASE); 42 return __io_address(REALVIEW_EB11MP_SCU_BASE);
41 else if (machine_is_realview_pb11mp()) 43 else if (machine_is_realview_pb11mp())
42 return __io_address(REALVIEW_TC11MP_SCU_BASE); 44 return __io_address(REALVIEW_TC11MP_SCU_BASE);
45 else if (machine_is_realview_pbx() &&
46 (core_tile_pbx11mp() || core_tile_pbxa9mp()))
47 return __io_address(REALVIEW_PBX_TILE_SCU_BASE);
43 else 48 else
44 return (void __iomem *)0; 49 return (void __iomem *)0;
45} 50}
46 51
47static unsigned int __init get_core_count(void) 52static inline unsigned int get_core_count(void)
48{ 53{
49 unsigned int ncores;
50 void __iomem *scu_base = scu_base_addr(); 54 void __iomem *scu_base = scu_base_addr();
51 55 if (scu_base)
52 if (scu_base) { 56 return scu_get_core_count(scu_base);
53 ncores = __raw_readl(scu_base + SCU_CONFIG); 57 return 1;
54 ncores = (ncores & 0x03) + 1;
55 } else
56 ncores = 1;
57
58 return ncores;
59}
60
61/*
62 * Setup the SCU
63 */
64static void scu_enable(void)
65{
66 u32 scu_ctrl;
67 void __iomem *scu_base = scu_base_addr();
68
69 scu_ctrl = __raw_readl(scu_base + SCU_CTRL);
70 scu_ctrl |= 1;
71 __raw_writel(scu_ctrl, scu_base + SCU_CTRL);
72} 58}
73 59
74static DEFINE_SPINLOCK(boot_lock); 60static DEFINE_SPINLOCK(boot_lock);
@@ -184,7 +170,7 @@ void __init smp_init_cpus(void)
184 unsigned int i, ncores = get_core_count(); 170 unsigned int i, ncores = get_core_count();
185 171
186 for (i = 0; i < ncores; i++) 172 for (i = 0; i < ncores; i++)
187 cpu_set(i, cpu_possible_map); 173 set_cpu_possible(i, true);
188} 174}
189 175
190void __init smp_prepare_cpus(unsigned int max_cpus) 176void __init smp_prepare_cpus(unsigned int max_cpus)
@@ -217,19 +203,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
217 if (max_cpus > ncores) 203 if (max_cpus > ncores)
218 max_cpus = ncores; 204 max_cpus = ncores;
219 205
220#if defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
221 /*
222 * Enable the local timer or broadcast device for the boot CPU.
223 */
224 local_timer_setup();
225#endif
226
227 /* 206 /*
228 * Initialise the present map, which describes the set of CPUs 207 * Initialise the present map, which describes the set of CPUs
229 * actually populated at the present time. 208 * actually populated at the present time.
230 */ 209 */
231 for (i = 0; i < max_cpus; i++) 210 for (i = 0; i < max_cpus; i++)
232 cpu_set(i, cpu_present_map); 211 set_cpu_present(i, true);
233 212
234 /* 213 /*
235 * Initialise the SCU if there are more than one CPU and let 214 * Initialise the SCU if there are more than one CPU and let
@@ -239,7 +218,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
239 * WFI 218 * WFI
240 */ 219 */
241 if (max_cpus > 1) { 220 if (max_cpus > 1) {
242 scu_enable(); 221 /*
222 * Enable the local timer or broadcast device for the
223 * boot CPU, but only if we have more than one CPU.
224 */
225 percpu_timer_setup();
226
227 scu_enable(scu_base_addr());
243 poke_milo(); 228 poke_milo();
244 } 229 }
245} 230}
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index c20fbef122b3..8dfa44e08a94 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -32,6 +32,7 @@
32#include <asm/hardware/gic.h> 32#include <asm/hardware/gic.h>
33#include <asm/hardware/icst307.h> 33#include <asm/hardware/icst307.h>
34#include <asm/hardware/cache-l2x0.h> 34#include <asm/hardware/cache-l2x0.h>
35#include <asm/localtimer.h>
35 36
36#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 38#include <asm/mach/map.h>
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index a64b84a7a3df..25efe71a67c7 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -203,11 +203,23 @@ static struct amba_device *amba_devs[] __initdata = {
203/* 203/*
204 * RealView PB1176 platform devices 204 * RealView PB1176 platform devices
205 */ 205 */
206static struct resource realview_pb1176_flash_resource = { 206static struct resource realview_pb1176_flash_resources[] = {
207 .start = REALVIEW_PB1176_FLASH_BASE, 207 [0] = {
208 .end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1, 208 .start = REALVIEW_PB1176_FLASH_BASE,
209 .flags = IORESOURCE_MEM, 209 .end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = REALVIEW_PB1176_SEC_FLASH_BASE,
214 .end = REALVIEW_PB1176_SEC_FLASH_BASE + REALVIEW_PB1176_SEC_FLASH_SIZE - 1,
215 .flags = IORESOURCE_MEM,
216 },
210}; 217};
218#ifdef CONFIG_REALVIEW_PB1176_SECURE_FLASH
219#define PB1176_FLASH_BLOCKS 2
220#else
221#define PB1176_FLASH_BLOCKS 1
222#endif
211 223
212static struct resource realview_pb1176_smsc911x_resources[] = { 224static struct resource realview_pb1176_smsc911x_resources[] = {
213 [0] = { 225 [0] = {
@@ -271,7 +283,8 @@ static void __init realview_pb1176_init(void)
271 l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff); 283 l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff);
272#endif 284#endif
273 285
274 realview_flash_register(&realview_pb1176_flash_resource, 1); 286 realview_flash_register(realview_pb1176_flash_resources,
287 PB1176_FLASH_BLOCKS);
275 realview_eth_register(NULL, realview_pb1176_smsc911x_resources); 288 realview_eth_register(NULL, realview_pb1176_smsc911x_resources);
276 platform_device_register(&realview_i2c_device); 289 platform_device_register(&realview_i2c_device);
277 realview_usb_register(realview_pb1176_isp1761_resources); 290 realview_usb_register(realview_pb1176_isp1761_resources);
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index ea1e60eca359..dc4b16943907 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -32,6 +32,7 @@
32#include <asm/hardware/gic.h> 32#include <asm/hardware/gic.h>
33#include <asm/hardware/icst307.h> 33#include <asm/hardware/icst307.h>
34#include <asm/hardware/cache-l2x0.h> 34#include <asm/hardware/cache-l2x0.h>
35#include <asm/localtimer.h>
35 36
36#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
37#include <asm/mach/flash.h> 38#include <asm/mach/flash.h>
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
new file mode 100644
index 000000000000..1fe294d0bf9d
--- /dev/null
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -0,0 +1,335 @@
1/*
2 * arch/arm/mach-realview/realview_pbx.c
3 *
4 * Copyright (C) 2009 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/sysdev.h>
24#include <linux/amba/bus.h>
25#include <linux/io.h>
26
27#include <asm/irq.h>
28#include <asm/leds.h>
29#include <asm/mach-types.h>
30#include <asm/hardware/gic.h>
31#include <asm/hardware/cache-l2x0.h>
32
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/mach/mmc.h>
36#include <asm/mach/time.h>
37
38#include <mach/hardware.h>
39#include <mach/board-pbx.h>
40#include <mach/irqs.h>
41
42#include "core.h"
43
44static struct map_desc realview_pbx_io_desc[] __initdata = {
45 {
46 .virtual = IO_ADDRESS(REALVIEW_SYS_BASE),
47 .pfn = __phys_to_pfn(REALVIEW_SYS_BASE),
48 .length = SZ_4K,
49 .type = MT_DEVICE,
50 }, {
51 .virtual = IO_ADDRESS(REALVIEW_PBX_GIC_CPU_BASE),
52 .pfn = __phys_to_pfn(REALVIEW_PBX_GIC_CPU_BASE),
53 .length = SZ_4K,
54 .type = MT_DEVICE,
55 }, {
56 .virtual = IO_ADDRESS(REALVIEW_PBX_GIC_DIST_BASE),
57 .pfn = __phys_to_pfn(REALVIEW_PBX_GIC_DIST_BASE),
58 .length = SZ_4K,
59 .type = MT_DEVICE,
60 }, {
61 .virtual = IO_ADDRESS(REALVIEW_SCTL_BASE),
62 .pfn = __phys_to_pfn(REALVIEW_SCTL_BASE),
63 .length = SZ_4K,
64 .type = MT_DEVICE,
65 }, {
66 .virtual = IO_ADDRESS(REALVIEW_PBX_TIMER0_1_BASE),
67 .pfn = __phys_to_pfn(REALVIEW_PBX_TIMER0_1_BASE),
68 .length = SZ_4K,
69 .type = MT_DEVICE,
70 }, {
71 .virtual = IO_ADDRESS(REALVIEW_PBX_TIMER2_3_BASE),
72 .pfn = __phys_to_pfn(REALVIEW_PBX_TIMER2_3_BASE),
73 .length = SZ_4K,
74 .type = MT_DEVICE,
75 },
76#ifdef CONFIG_PCI
77 {
78 .virtual = PCIX_UNIT_BASE,
79 .pfn = __phys_to_pfn(REALVIEW_PBX_PCI_BASE),
80 .length = REALVIEW_PBX_PCI_BASE_SIZE,
81 .type = MT_DEVICE,
82 },
83#endif
84#ifdef CONFIG_DEBUG_LL
85 {
86 .virtual = IO_ADDRESS(REALVIEW_PBX_UART0_BASE),
87 .pfn = __phys_to_pfn(REALVIEW_PBX_UART0_BASE),
88 .length = SZ_4K,
89 .type = MT_DEVICE,
90 },
91#endif
92};
93
94static struct map_desc realview_local_io_desc[] __initdata = {
95 {
96 .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_GIC_CPU_BASE),
97 .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_GIC_CPU_BASE),
98 .length = SZ_4K,
99 .type = MT_DEVICE,
100 }, {
101 .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_GIC_DIST_BASE),
102 .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_GIC_DIST_BASE),
103 .length = SZ_4K,
104 .type = MT_DEVICE,
105 }, {
106 .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_L220_BASE),
107 .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_L220_BASE),
108 .length = SZ_8K,
109 .type = MT_DEVICE,
110 }
111};
112
113static void __init realview_pbx_map_io(void)
114{
115 iotable_init(realview_pbx_io_desc, ARRAY_SIZE(realview_pbx_io_desc));
116 if (core_tile_pbx11mp() || core_tile_pbxa9mp())
117 iotable_init(realview_local_io_desc, ARRAY_SIZE(realview_local_io_desc));
118}
119
120/*
121 * RealView PBXCore AMBA devices
122 */
123
124#define GPIO2_IRQ { IRQ_PBX_GPIO2, NO_IRQ }
125#define GPIO2_DMA { 0, 0 }
126#define GPIO3_IRQ { IRQ_PBX_GPIO3, NO_IRQ }
127#define GPIO3_DMA { 0, 0 }
128#define AACI_IRQ { IRQ_PBX_AACI, NO_IRQ }
129#define AACI_DMA { 0x80, 0x81 }
130#define MMCI0_IRQ { IRQ_PBX_MMCI0A, IRQ_PBX_MMCI0B }
131#define MMCI0_DMA { 0x84, 0 }
132#define KMI0_IRQ { IRQ_PBX_KMI0, NO_IRQ }
133#define KMI0_DMA { 0, 0 }
134#define KMI1_IRQ { IRQ_PBX_KMI1, NO_IRQ }
135#define KMI1_DMA { 0, 0 }
136#define PBX_SMC_IRQ { NO_IRQ, NO_IRQ }
137#define PBX_SMC_DMA { 0, 0 }
138#define MPMC_IRQ { NO_IRQ, NO_IRQ }
139#define MPMC_DMA { 0, 0 }
140#define PBX_CLCD_IRQ { IRQ_PBX_CLCD, NO_IRQ }
141#define PBX_CLCD_DMA { 0, 0 }
142#define DMAC_IRQ { IRQ_PBX_DMAC, NO_IRQ }
143#define DMAC_DMA { 0, 0 }
144#define SCTL_IRQ { NO_IRQ, NO_IRQ }
145#define SCTL_DMA { 0, 0 }
146#define PBX_WATCHDOG_IRQ { IRQ_PBX_WATCHDOG, NO_IRQ }
147#define PBX_WATCHDOG_DMA { 0, 0 }
148#define PBX_GPIO0_IRQ { IRQ_PBX_GPIO0, NO_IRQ }
149#define PBX_GPIO0_DMA { 0, 0 }
150#define GPIO1_IRQ { IRQ_PBX_GPIO1, NO_IRQ }
151#define GPIO1_DMA { 0, 0 }
152#define PBX_RTC_IRQ { IRQ_PBX_RTC, NO_IRQ }
153#define PBX_RTC_DMA { 0, 0 }
154#define SCI_IRQ { IRQ_PBX_SCI, NO_IRQ }
155#define SCI_DMA { 7, 6 }
156#define PBX_UART0_IRQ { IRQ_PBX_UART0, NO_IRQ }
157#define PBX_UART0_DMA { 15, 14 }
158#define PBX_UART1_IRQ { IRQ_PBX_UART1, NO_IRQ }
159#define PBX_UART1_DMA { 13, 12 }
160#define PBX_UART2_IRQ { IRQ_PBX_UART2, NO_IRQ }
161#define PBX_UART2_DMA { 11, 10 }
162#define PBX_UART3_IRQ { IRQ_PBX_UART3, NO_IRQ }
163#define PBX_UART3_DMA { 0x86, 0x87 }
164#define PBX_SSP_IRQ { IRQ_PBX_SSP, NO_IRQ }
165#define PBX_SSP_DMA { 9, 8 }
166
167/* FPGA Primecells */
168AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);
169AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data);
170AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL);
171AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL);
172AMBA_DEVICE(uart3, "fpga:09", PBX_UART3, NULL);
173
174/* DevChip Primecells */
175AMBA_DEVICE(smc, "dev:00", PBX_SMC, NULL);
176AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL);
177AMBA_DEVICE(wdog, "dev:e1", PBX_WATCHDOG, NULL);
178AMBA_DEVICE(gpio0, "dev:e4", PBX_GPIO0, NULL);
179AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL);
180AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL);
181AMBA_DEVICE(rtc, "dev:e8", PBX_RTC, NULL);
182AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);
183AMBA_DEVICE(uart0, "dev:f1", PBX_UART0, NULL);
184AMBA_DEVICE(uart1, "dev:f2", PBX_UART1, NULL);
185AMBA_DEVICE(uart2, "dev:f3", PBX_UART2, NULL);
186AMBA_DEVICE(ssp0, "dev:f4", PBX_SSP, NULL);
187
188/* Primecells on the NEC ISSP chip */
189AMBA_DEVICE(clcd, "issp:20", PBX_CLCD, &clcd_plat_data);
190AMBA_DEVICE(dmac, "issp:30", DMAC, NULL);
191
192static struct amba_device *amba_devs[] __initdata = {
193 &dmac_device,
194 &uart0_device,
195 &uart1_device,
196 &uart2_device,
197 &uart3_device,
198 &smc_device,
199 &clcd_device,
200 &sctl_device,
201 &wdog_device,
202 &gpio0_device,
203 &gpio1_device,
204 &gpio2_device,
205 &rtc_device,
206 &sci0_device,
207 &ssp0_device,
208 &aaci_device,
209 &mmc0_device,
210 &kmi0_device,
211 &kmi1_device,
212};
213
214/*
215 * RealView PB-X platform devices
216 */
217static struct resource realview_pbx_flash_resources[] = {
218 [0] = {
219 .start = REALVIEW_PBX_FLASH0_BASE,
220 .end = REALVIEW_PBX_FLASH0_BASE + REALVIEW_PBX_FLASH0_SIZE - 1,
221 .flags = IORESOURCE_MEM,
222 },
223 [1] = {
224 .start = REALVIEW_PBX_FLASH1_BASE,
225 .end = REALVIEW_PBX_FLASH1_BASE + REALVIEW_PBX_FLASH1_SIZE - 1,
226 .flags = IORESOURCE_MEM,
227 },
228};
229
230static struct resource realview_pbx_smsc911x_resources[] = {
231 [0] = {
232 .start = REALVIEW_PBX_ETH_BASE,
233 .end = REALVIEW_PBX_ETH_BASE + SZ_64K - 1,
234 .flags = IORESOURCE_MEM,
235 },
236 [1] = {
237 .start = IRQ_PBX_ETH,
238 .end = IRQ_PBX_ETH,
239 .flags = IORESOURCE_IRQ,
240 },
241};
242
243static struct resource realview_pbx_isp1761_resources[] = {
244 [0] = {
245 .start = REALVIEW_PBX_USB_BASE,
246 .end = REALVIEW_PBX_USB_BASE + SZ_128K - 1,
247 .flags = IORESOURCE_MEM,
248 },
249 [1] = {
250 .start = IRQ_PBX_USB,
251 .end = IRQ_PBX_USB,
252 .flags = IORESOURCE_IRQ,
253 },
254};
255
256static void __init gic_init_irq(void)
257{
258 /* ARM PBX on-board GIC */
259 if (core_tile_pbx11mp() || core_tile_pbxa9mp()) {
260 gic_cpu_base_addr = __io_address(REALVIEW_PBX_TILE_GIC_CPU_BASE);
261 gic_dist_init(0, __io_address(REALVIEW_PBX_TILE_GIC_DIST_BASE),
262 29);
263 gic_cpu_init(0, __io_address(REALVIEW_PBX_TILE_GIC_CPU_BASE));
264 } else {
265 gic_cpu_base_addr = __io_address(REALVIEW_PBX_GIC_CPU_BASE);
266 gic_dist_init(0, __io_address(REALVIEW_PBX_GIC_DIST_BASE),
267 IRQ_PBX_GIC_START);
268 gic_cpu_init(0, __io_address(REALVIEW_PBX_GIC_CPU_BASE));
269 }
270}
271
272static void __init realview_pbx_timer_init(void)
273{
274 timer0_va_base = __io_address(REALVIEW_PBX_TIMER0_1_BASE);
275 timer1_va_base = __io_address(REALVIEW_PBX_TIMER0_1_BASE) + 0x20;
276 timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE);
277 timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20;
278
279#ifdef CONFIG_LOCAL_TIMERS
280 if (core_tile_pbx11mp() || core_tile_pbxa9mp())
281 twd_base = __io_address(REALVIEW_PBX_TILE_TWD_BASE);
282#endif
283 realview_timer_init(IRQ_PBX_TIMER0_1);
284}
285
286static struct sys_timer realview_pbx_timer = {
287 .init = realview_pbx_timer_init,
288};
289
290static void __init realview_pbx_init(void)
291{
292 int i;
293
294#ifdef CONFIG_CACHE_L2X0
295 if (core_tile_pbxa9mp()) {
296 void __iomem *l2x0_base =
297 __io_address(REALVIEW_PBX_TILE_L220_BASE);
298
299 /* set RAM latencies to 1 cycle for eASIC */
300 writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL);
301 writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL);
302
303 /* 16KB way size, 8-way associativity, parity disabled
304 * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */
305 l2x0_init(l2x0_base, 0x02520000, 0xc0000fff);
306 }
307#endif
308
309 realview_flash_register(realview_pbx_flash_resources,
310 ARRAY_SIZE(realview_pbx_flash_resources));
311 realview_eth_register(NULL, realview_pbx_smsc911x_resources);
312 platform_device_register(&realview_i2c_device);
313 platform_device_register(&realview_cf_device);
314 realview_usb_register(realview_pbx_isp1761_resources);
315
316 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
317 struct amba_device *d = amba_devs[i];
318 amba_device_register(d, &iomem_resource);
319 }
320
321#ifdef CONFIG_LEDS
322 leds_event = realview_leds_event;
323#endif
324}
325
326MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
327 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
328 .phys_io = REALVIEW_PBX_UART0_BASE,
329 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc,
330 .boot_params = PHYS_OFFSET + 0x00000100,
331 .map_io = realview_pbx_map_io,
332 .init_irq = gic_init_irq,
333 .timer = &realview_pbx_timer,
334 .init_machine = realview_pbx_init,
335MACHINE_END
diff --git a/arch/arm/mach-s3c2400/gpio.c b/arch/arm/mach-s3c2400/gpio.c
index 7a7ed4174c8c..6c68e78f3595 100644
--- a/arch/arm/mach-s3c2400/gpio.c
+++ b/arch/arm/mach-s3c2400/gpio.c
@@ -33,10 +33,10 @@
33 33
34int s3c2400_gpio_getirq(unsigned int pin) 34int s3c2400_gpio_getirq(unsigned int pin)
35{ 35{
36 if (pin < S3C2410_GPE0 || pin > S3C2400_GPE7_EINT7) 36 if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE(7))
37 return -1; /* not valid interrupts */ 37 return -EINVAL; /* not valid interrupts */
38 38
39 return (pin - S3C2410_GPE0) + IRQ_EINT0; 39 return (pin - S3C2410_GPE(0)) + IRQ_EINT0;
40} 40}
41 41
42EXPORT_SYMBOL(s3c2400_gpio_getirq); 42EXPORT_SYMBOL(s3c2400_gpio_getirq);
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 63a30d1dd425..41bb65d5b91f 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -59,6 +59,7 @@ config ARCH_H1940
59 bool "IPAQ H1940" 59 bool "IPAQ H1940"
60 select CPU_S3C2410 60 select CPU_S3C2410
61 select PM_H1940 if PM 61 select PM_H1940 if PM
62 select S3C_DEV_USB_HOST
62 help 63 help
63 Say Y here if you are using the HP IPAQ H1940 64 Say Y here if you are using the HP IPAQ H1940
64 65
@@ -70,6 +71,7 @@ config PM_H1940
70config MACH_N30 71config MACH_N30
71 bool "Acer N30 family" 72 bool "Acer N30 family"
72 select CPU_S3C2410 73 select CPU_S3C2410
74 select S3C_DEV_USB_HOST
73 help 75 help
74 Say Y here if you want suppt for the Acer N30, Acer N35, 76 Say Y here if you want suppt for the Acer N30, Acer N35,
75 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. 77 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
@@ -82,6 +84,7 @@ config ARCH_BAST
82 select MACH_BAST_IDE 84 select MACH_BAST_IDE
83 select S3C24XX_DCLK 85 select S3C24XX_DCLK
84 select ISA 86 select ISA
87 select S3C_DEV_USB_HOST
85 help 88 help
86 Say Y here if you are using the Simtec Electronics EB2410ITX 89 Say Y here if you are using the Simtec Electronics EB2410ITX
87 development board (also known as BAST) 90 development board (also known as BAST)
@@ -89,6 +92,7 @@ config ARCH_BAST
89config MACH_OTOM 92config MACH_OTOM
90 bool "NexVision OTOM Board" 93 bool "NexVision OTOM Board"
91 select CPU_S3C2410 94 select CPU_S3C2410
95 select S3C_DEV_USB_HOST
92 help 96 help
93 Say Y here if you are using the Nex Vision OTOM board 97 Say Y here if you are using the Nex Vision OTOM board
94 98
@@ -96,6 +100,7 @@ config MACH_AML_M5900
96 bool "AML M5900 Series" 100 bool "AML M5900 Series"
97 select CPU_S3C2410 101 select CPU_S3C2410
98 select PM_SIMTEC if PM 102 select PM_SIMTEC if PM
103 select S3C_DEV_USB_HOST
99 help 104 help
100 Say Y here if you are using the American Microsystems M5900 Series 105 Say Y here if you are using the American Microsystems M5900 Series
101 <http://www.amltd.com> 106 <http://www.amltd.com>
@@ -111,6 +116,7 @@ config BAST_PC104_IRQ
111config MACH_TCT_HAMMER 116config MACH_TCT_HAMMER
112 bool "TCT Hammer Board" 117 bool "TCT Hammer Board"
113 select CPU_S3C2410 118 select CPU_S3C2410
119 select S3C_DEV_USB_HOST
114 help 120 help
115 Say Y here if you are using the TinCanTools Hammer Board 121 Say Y here if you are using the TinCanTools Hammer Board
116 <http://www.tincantools.com> 122 <http://www.tincantools.com>
@@ -122,12 +128,14 @@ config MACH_VR1000
122 select SIMTEC_NOR 128 select SIMTEC_NOR
123 select MACH_BAST_IDE 129 select MACH_BAST_IDE
124 select CPU_S3C2410 130 select CPU_S3C2410
131 select S3C_DEV_USB_HOST
125 help 132 help
126 Say Y here if you are using the Thorcom VR1000 board. 133 Say Y here if you are using the Thorcom VR1000 board.
127 134
128config MACH_QT2410 135config MACH_QT2410
129 bool "QT2410" 136 bool "QT2410"
130 select CPU_S3C2410 137 select CPU_S3C2410
138 select S3C_DEV_USB_HOST
131 help 139 help
132 Say Y here if you are using the Armzone QT2410 140 Say Y here if you are using the Armzone QT2410
133 141
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index 440c014e24b3..dbf96e60d992 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -17,14 +17,16 @@
17#include <linux/sysdev.h> 17#include <linux/sysdev.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19 19
20#include <mach/map.h>
20#include <mach/dma.h> 21#include <mach/dma.h>
21 22
22#include <plat/cpu.h> 23#include <plat/cpu.h>
23#include <plat/dma.h> 24#include <plat/dma-plat.h>
24 25
25#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
26#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
27#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h>
28#include <mach/regs-mem.h> 30#include <mach/regs-mem.h>
29#include <mach/regs-lcd.h> 31#include <mach/regs-lcd.h>
30#include <mach/regs-sdi.h> 32#include <mach/regs-sdi.h>
diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c
index 36a3132f39e7..7974afca297c 100644
--- a/arch/arm/mach-s3c2410/gpio.c
+++ b/arch/arm/mach-s3c2410/gpio.c
@@ -39,12 +39,12 @@ int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
39 unsigned long flags; 39 unsigned long flags;
40 unsigned long val; 40 unsigned long val;
41 41
42 if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15) 42 if (pin < S3C2410_GPG(8) || pin > S3C2410_GPG(15))
43 return -1; 43 return -EINVAL;
44 44
45 config &= 0xff; 45 config &= 0xff;
46 46
47 pin -= S3C2410_GPG8; 47 pin -= S3C2410_GPG(8);
48 reg += pin & ~3; 48 reg += pin & ~3;
49 49
50 local_irq_save(flags); 50 local_irq_save(flags);
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index 5a6bc56f186b..5aabf117cbb0 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -16,6 +16,8 @@
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18#include <linux/leds.h> 18#include <linux/leds.h>
19#include <linux/gpio.h>
20
19#include <mach/regs-gpio.h> 21#include <mach/regs-gpio.h>
20#include <mach/hardware.h> 22#include <mach/hardware.h>
21#include <mach/h1940-latch.h> 23#include <mach/h1940-latch.h>
@@ -41,9 +43,9 @@ static void h1940bt_enable(int on)
41 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); 43 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER);
42 /* Reset the chip */ 44 /* Reset the chip */
43 mdelay(10); 45 mdelay(10);
44 s3c2410_gpio_setpin(S3C2410_GPH1, 1); 46 s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
45 mdelay(10); 47 mdelay(10);
46 s3c2410_gpio_setpin(S3C2410_GPH1, 0); 48 s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
47 49
48 state = 1; 50 state = 1;
49 } 51 }
@@ -52,9 +54,9 @@ static void h1940bt_enable(int on)
52 led_trigger_event(bt_led_trigger, 0); 54 led_trigger_event(bt_led_trigger, 0);
53#endif 55#endif
54 56
55 s3c2410_gpio_setpin(S3C2410_GPH1, 1); 57 s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
56 mdelay(10); 58 mdelay(10);
57 s3c2410_gpio_setpin(S3C2410_GPH1, 0); 59 s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
58 mdelay(10); 60 mdelay(10);
59 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); 61 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0);
60 62
@@ -87,14 +89,14 @@ static DEVICE_ATTR(enable, 0644,
87static int __init h1940bt_probe(struct platform_device *pdev) 89static int __init h1940bt_probe(struct platform_device *pdev)
88{ 90{
89 /* Configures BT serial port GPIOs */ 91 /* Configures BT serial port GPIOs */
90 s3c2410_gpio_cfgpin(S3C2410_GPH0, S3C2410_GPH0_nCTS0); 92 s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0);
91 s3c2410_gpio_pullup(S3C2410_GPH0, 1); 93 s3c2410_gpio_pullup(S3C2410_GPH(0), 1);
92 s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPH1_OUTP); 94 s3c2410_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT);
93 s3c2410_gpio_pullup(S3C2410_GPH1, 1); 95 s3c2410_gpio_pullup(S3C2410_GPH(1), 1);
94 s3c2410_gpio_cfgpin(S3C2410_GPH2, S3C2410_GPH2_TXD0); 96 s3c2410_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0);
95 s3c2410_gpio_pullup(S3C2410_GPH2, 1); 97 s3c2410_gpio_pullup(S3C2410_GPH(2), 1);
96 s3c2410_gpio_cfgpin(S3C2410_GPH3, S3C2410_GPH3_RXD0); 98 s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0);
97 s3c2410_gpio_pullup(S3C2410_GPH3, 1); 99 s3c2410_gpio_pullup(S3C2410_GPH(3), 1);
98 100
99#ifdef CONFIG_LEDS_H1940 101#ifdef CONFIG_LEDS_H1940
100 led_trigger_register_simple("h1940-bluetooth", &bt_led_trigger); 102 led_trigger_register_simple("h1940-bluetooth", &bt_led_trigger);
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h
index 13358ce2128c..c3a2629e0ded 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -3,7 +3,7 @@
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003,2004,2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C241XX DMA support 6 * Samsung S3C24XX DMA support
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -13,8 +13,8 @@
13#ifndef __ASM_ARCH_DMA_H 13#ifndef __ASM_ARCH_DMA_H
14#define __ASM_ARCH_DMA_H __FILE__ 14#define __ASM_ARCH_DMA_H __FILE__
15 15
16#include <plat/dma.h>
16#include <linux/sysdev.h> 17#include <linux/sysdev.h>
17#include <mach/hardware.h>
18 18
19#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ 19#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */
20 20
@@ -55,9 +55,9 @@ enum dma_ch {
55 55
56/* we have 4 dma channels */ 56/* we have 4 dma channels */
57#ifndef CONFIG_CPU_S3C2443 57#ifndef CONFIG_CPU_S3C2443
58#define S3C2410_DMA_CHANNELS (4) 58#define S3C_DMA_CHANNELS (4)
59#else 59#else
60#define S3C2410_DMA_CHANNELS (6) 60#define S3C_DMA_CHANNELS (6)
61#endif 61#endif
62 62
63/* types */ 63/* types */
@@ -68,7 +68,6 @@ enum s3c2410_dma_state {
68 S3C2410_DMA_PAUSED 68 S3C2410_DMA_PAUSED
69}; 69};
70 70
71
72/* enum s3c2410_dma_loadst 71/* enum s3c2410_dma_loadst
73 * 72 *
74 * This represents the state of the DMA engine, wrt to the loaded / running 73 * This represents the state of the DMA engine, wrt to the loaded / running
@@ -104,32 +103,6 @@ enum s3c2410_dma_loadst {
104 S3C2410_DMALOAD_1LOADED_1RUNNING, 103 S3C2410_DMALOAD_1LOADED_1RUNNING,
105}; 104};
106 105
107enum s3c2410_dma_buffresult {
108 S3C2410_RES_OK,
109 S3C2410_RES_ERR,
110 S3C2410_RES_ABORT
111};
112
113enum s3c2410_dmasrc {
114 S3C2410_DMASRC_HW, /* source is memory */
115 S3C2410_DMASRC_MEM /* source is hardware */
116};
117
118/* enum s3c2410_chan_op
119 *
120 * operation codes passed to the DMA code by the user, and also used
121 * to inform the current channel owner of any changes to the system state
122*/
123
124enum s3c2410_chan_op {
125 S3C2410_DMAOP_START,
126 S3C2410_DMAOP_STOP,
127 S3C2410_DMAOP_PAUSE,
128 S3C2410_DMAOP_RESUME,
129 S3C2410_DMAOP_FLUSH,
130 S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */
131 S3C2410_DMAOP_STARTED, /* indicate channel started */
132};
133 106
134/* flags */ 107/* flags */
135 108
@@ -139,17 +112,14 @@ enum s3c2410_chan_op {
139 112
140/* dma buffer */ 113/* dma buffer */
141 114
142struct s3c2410_dma_client { 115struct s3c2410_dma_buf;
143 char *name;
144};
145 116
146/* s3c2410_dma_buf_s 117/* s3c2410_dma_buf
147 * 118 *
148 * internally used buffer structure to describe a queued or running 119 * internally used buffer structure to describe a queued or running
149 * buffer. 120 * buffer.
150*/ 121*/
151 122
152struct s3c2410_dma_buf;
153struct s3c2410_dma_buf { 123struct s3c2410_dma_buf {
154 struct s3c2410_dma_buf *next; 124 struct s3c2410_dma_buf *next;
155 int magic; /* magic */ 125 int magic; /* magic */
@@ -161,20 +131,6 @@ struct s3c2410_dma_buf {
161 131
162/* [1] is this updated for both recv/send modes? */ 132/* [1] is this updated for both recv/send modes? */
163 133
164struct s3c2410_dma_chan;
165
166/* s3c2410_dma_cbfn_t
167 *
168 * buffer callback routine type
169*/
170
171typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *,
172 void *buf, int size,
173 enum s3c2410_dma_buffresult result);
174
175typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *,
176 enum s3c2410_chan_op );
177
178struct s3c2410_dma_stats { 134struct s3c2410_dma_stats {
179 unsigned long loads; 135 unsigned long loads;
180 unsigned long timeout_longest; 136 unsigned long timeout_longest;
@@ -206,10 +162,10 @@ struct s3c2410_dma_chan {
206 162
207 /* channel configuration */ 163 /* channel configuration */
208 enum s3c2410_dmasrc source; 164 enum s3c2410_dmasrc source;
165 enum dma_ch req_ch;
209 unsigned long dev_addr; 166 unsigned long dev_addr;
210 unsigned long load_timeout; 167 unsigned long load_timeout;
211 unsigned int flags; /* channel flags */ 168 unsigned int flags; /* channel flags */
212 unsigned int hw_cfg; /* last hw config */
213 169
214 struct s3c24xx_dma_map *map; /* channel hw maps */ 170 struct s3c24xx_dma_map *map; /* channel hw maps */
215 171
@@ -236,213 +192,6 @@ struct s3c2410_dma_chan {
236 struct sys_device dev; 192 struct sys_device dev;
237}; 193};
238 194
239/* the currently allocated channel information */
240extern struct s3c2410_dma_chan s3c2410_chans[];
241
242/* note, we don't really use dma_device_t at the moment */
243typedef unsigned long dma_device_t; 195typedef unsigned long dma_device_t;
244 196
245/* functions --------------------------------------------------------------- */
246
247/* s3c2410_dma_request
248 *
249 * request a dma channel exclusivley
250*/
251
252extern int s3c2410_dma_request(unsigned int channel,
253 struct s3c2410_dma_client *, void *dev);
254
255
256/* s3c2410_dma_ctrl
257 *
258 * change the state of the dma channel
259*/
260
261extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op);
262
263/* s3c2410_dma_setflags
264 *
265 * set the channel's flags to a given state
266*/
267
268extern int s3c2410_dma_setflags(unsigned int channel,
269 unsigned int flags);
270
271/* s3c2410_dma_free
272 *
273 * free the dma channel (will also abort any outstanding operations)
274*/
275
276extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *);
277
278/* s3c2410_dma_enqueue
279 *
280 * place the given buffer onto the queue of operations for the channel.
281 * The buffer must be allocated from dma coherent memory, or the Dcache/WB
282 * drained before the buffer is given to the DMA system.
283*/
284
285extern int s3c2410_dma_enqueue(unsigned int channel, void *id,
286 dma_addr_t data, int size);
287
288/* s3c2410_dma_config
289 *
290 * configure the dma channel
291*/
292
293extern int s3c2410_dma_config(unsigned int channel, int xferunit, int dcon);
294
295/* s3c2410_dma_devconfig
296 *
297 * configure the device we're talking to
298*/
299
300extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source,
301 int hwcfg, unsigned long devaddr);
302
303/* s3c2410_dma_getposition
304 *
305 * get the position that the dma transfer is currently at
306*/
307
308extern int s3c2410_dma_getposition(unsigned int channel,
309 dma_addr_t *src, dma_addr_t *dest);
310
311extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn);
312extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn);
313
314/* DMA Register definitions */
315
316#define S3C2410_DMA_DISRC (0x00)
317#define S3C2410_DMA_DISRCC (0x04)
318#define S3C2410_DMA_DIDST (0x08)
319#define S3C2410_DMA_DIDSTC (0x0C)
320#define S3C2410_DMA_DCON (0x10)
321#define S3C2410_DMA_DSTAT (0x14)
322#define S3C2410_DMA_DCSRC (0x18)
323#define S3C2410_DMA_DCDST (0x1C)
324#define S3C2410_DMA_DMASKTRIG (0x20)
325#define S3C2412_DMA_DMAREQSEL (0x24)
326#define S3C2443_DMA_DMAREQSEL (0x24)
327
328#define S3C2410_DISRCC_INC (1<<0)
329#define S3C2410_DISRCC_APB (1<<1)
330
331#define S3C2410_DMASKTRIG_STOP (1<<2)
332#define S3C2410_DMASKTRIG_ON (1<<1)
333#define S3C2410_DMASKTRIG_SWTRIG (1<<0)
334
335#define S3C2410_DCON_DEMAND (0<<31)
336#define S3C2410_DCON_HANDSHAKE (1<<31)
337#define S3C2410_DCON_SYNC_PCLK (0<<30)
338#define S3C2410_DCON_SYNC_HCLK (1<<30)
339
340#define S3C2410_DCON_INTREQ (1<<29)
341
342#define S3C2410_DCON_CH0_XDREQ0 (0<<24)
343#define S3C2410_DCON_CH0_UART0 (1<<24)
344#define S3C2410_DCON_CH0_SDI (2<<24)
345#define S3C2410_DCON_CH0_TIMER (3<<24)
346#define S3C2410_DCON_CH0_USBEP1 (4<<24)
347
348#define S3C2410_DCON_CH1_XDREQ1 (0<<24)
349#define S3C2410_DCON_CH1_UART1 (1<<24)
350#define S3C2410_DCON_CH1_I2SSDI (2<<24)
351#define S3C2410_DCON_CH1_SPI (3<<24)
352#define S3C2410_DCON_CH1_USBEP2 (4<<24)
353
354#define S3C2410_DCON_CH2_I2SSDO (0<<24)
355#define S3C2410_DCON_CH2_I2SSDI (1<<24)
356#define S3C2410_DCON_CH2_SDI (2<<24)
357#define S3C2410_DCON_CH2_TIMER (3<<24)
358#define S3C2410_DCON_CH2_USBEP3 (4<<24)
359
360#define S3C2410_DCON_CH3_UART2 (0<<24)
361#define S3C2410_DCON_CH3_SDI (1<<24)
362#define S3C2410_DCON_CH3_SPI (2<<24)
363#define S3C2410_DCON_CH3_TIMER (3<<24)
364#define S3C2410_DCON_CH3_USBEP4 (4<<24)
365
366#define S3C2410_DCON_SRCSHIFT (24)
367#define S3C2410_DCON_SRCMASK (7<<24)
368
369#define S3C2410_DCON_BYTE (0<<20)
370#define S3C2410_DCON_HALFWORD (1<<20)
371#define S3C2410_DCON_WORD (2<<20)
372
373#define S3C2410_DCON_AUTORELOAD (0<<22)
374#define S3C2410_DCON_NORELOAD (1<<22)
375#define S3C2410_DCON_HWTRIG (1<<23)
376
377#ifdef CONFIG_CPU_S3C2440
378#define S3C2440_DIDSTC_CHKINT (1<<2)
379
380#define S3C2440_DCON_CH0_I2SSDO (5<<24)
381#define S3C2440_DCON_CH0_PCMIN (6<<24)
382
383#define S3C2440_DCON_CH1_PCMOUT (5<<24)
384#define S3C2440_DCON_CH1_SDI (6<<24)
385
386#define S3C2440_DCON_CH2_PCMIN (5<<24)
387#define S3C2440_DCON_CH2_MICIN (6<<24)
388
389#define S3C2440_DCON_CH3_MICIN (5<<24)
390#define S3C2440_DCON_CH3_PCMOUT (6<<24)
391#endif
392
393#ifdef CONFIG_CPU_S3C2412
394
395#define S3C2412_DMAREQSEL_SRC(x) ((x)<<1)
396
397#define S3C2412_DMAREQSEL_HW (1)
398
399#define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0)
400#define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1)
401#define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2)
402#define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3)
403#define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4)
404#define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5)
405#define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9)
406#define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10)
407#define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13)
408#define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14)
409#define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15)
410#define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16)
411#define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17)
412#define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18)
413#define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19)
414#define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20)
415#define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21)
416#define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22)
417#define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23)
418#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24)
419
420#endif
421
422#define S3C2443_DMAREQSEL_SRC(x) ((x)<<1)
423
424#define S3C2443_DMAREQSEL_HW (1)
425
426#define S3C2443_DMAREQSEL_SPI0TX S3C2443_DMAREQSEL_SRC(0)
427#define S3C2443_DMAREQSEL_SPI0RX S3C2443_DMAREQSEL_SRC(1)
428#define S3C2443_DMAREQSEL_SPI1TX S3C2443_DMAREQSEL_SRC(2)
429#define S3C2443_DMAREQSEL_SPI1RX S3C2443_DMAREQSEL_SRC(3)
430#define S3C2443_DMAREQSEL_I2STX S3C2443_DMAREQSEL_SRC(4)
431#define S3C2443_DMAREQSEL_I2SRX S3C2443_DMAREQSEL_SRC(5)
432#define S3C2443_DMAREQSEL_TIMER S3C2443_DMAREQSEL_SRC(9)
433#define S3C2443_DMAREQSEL_SDI S3C2443_DMAREQSEL_SRC(10)
434#define S3C2443_DMAREQSEL_XDREQ0 S3C2443_DMAREQSEL_SRC(17)
435#define S3C2443_DMAREQSEL_XDREQ1 S3C2443_DMAREQSEL_SRC(18)
436#define S3C2443_DMAREQSEL_UART0_0 S3C2443_DMAREQSEL_SRC(19)
437#define S3C2443_DMAREQSEL_UART0_1 S3C2443_DMAREQSEL_SRC(20)
438#define S3C2443_DMAREQSEL_UART1_0 S3C2443_DMAREQSEL_SRC(21)
439#define S3C2443_DMAREQSEL_UART1_1 S3C2443_DMAREQSEL_SRC(22)
440#define S3C2443_DMAREQSEL_UART2_0 S3C2443_DMAREQSEL_SRC(23)
441#define S3C2443_DMAREQSEL_UART2_1 S3C2443_DMAREQSEL_SRC(24)
442#define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25)
443#define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26)
444#define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27)
445#define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28)
446#define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29)
447
448#endif /* __ASM_ARCH_DMA_H */ 197#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index 6c9fbb99ef14..8fe192081d3a 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -24,7 +24,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
24{ 24{
25 struct s3c_gpio_chip *chip; 25 struct s3c_gpio_chip *chip;
26 26
27 if (pin > S3C2410_GPG10) 27 if (pin > S3C2410_GPG(10))
28 return NULL; 28 return NULL;
29 29
30 chip = &s3c24xx_gpios[pin/32]; 30 chip = &s3c24xx_gpios[pin/32];
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
new file mode 100644
index 000000000000..801dff13858d
--- /dev/null
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
@@ -0,0 +1,103 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h
2 *
3 * Copyright (c) 2003,2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - hardware
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* These functions are in the to-be-removed category and it is strongly
14 * encouraged not to use these in new code. They will be marked deprecated
15 * very soon.
16 *
17 * Most of the functionality can be either replaced by the gpiocfg calls
18 * for the s3c platform or by the generic GPIOlib API.
19*/
20
21/* external functions for GPIO support
22 *
23 * These allow various different clients to access the same GPIO
24 * registers without conflicting. If your driver only owns the entire
25 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
26*/
27
28/* s3c2410_gpio_cfgpin
29 *
30 * set the configuration of the given pin to the value passed.
31 *
32 * eg:
33 * s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0);
34 * s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1);
35*/
36
37extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
38
39extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
40
41/* s3c2410_gpio_getirq
42 *
43 * turn the given pin number into the corresponding IRQ number
44 *
45 * returns:
46 * < 0 = no interrupt for this pin
47 * >=0 = interrupt number for the pin
48*/
49
50extern int s3c2410_gpio_getirq(unsigned int pin);
51
52#ifdef CONFIG_CPU_S3C2400
53
54extern int s3c2400_gpio_getirq(unsigned int pin);
55
56#endif /* CONFIG_CPU_S3C2400 */
57
58/* s3c2410_gpio_irqfilter
59 *
60 * set the irq filtering on the given pin
61 *
62 * on = 0 => disable filtering
63 * 1 => enable filtering
64 *
65 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
66 * width of filter (0 through 63)
67 *
68 *
69*/
70
71extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
72 unsigned int config);
73
74/* s3c2410_gpio_pullup
75 *
76 * configure the pull-up control on the given pin
77 *
78 * to = 1 => disable the pull-up
79 * 0 => enable the pull-up
80 *
81 * eg;
82 *
83 * s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
84 * s3c2410_gpio_pullup(S3C2410_GPE(8), 0);
85*/
86
87extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
88
89/* s3c2410_gpio_getpull
90 *
91 * Read the state of the pull-up on a given pin
92 *
93 * return:
94 * < 0 => error code
95 * 0 => enabled
96 * 1 => disabled
97*/
98
99extern int s3c2410_gpio_getpull(unsigned int pin);
100
101extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
102
103extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
index ce1ec69806a1..2edbb9c88ab3 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
@@ -11,6 +11,9 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#ifndef __MACH_GPIONRS_H
15#define __MACH_GPIONRS_H
16
14#define S3C2410_GPIONO(bank,offset) ((bank) + (offset)) 17#define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
15 18
16#define S3C2410_GPIO_BANKA (32*0) 19#define S3C2410_GPIO_BANKA (32*0)
@@ -21,3 +24,70 @@
21#define S3C2410_GPIO_BANKF (32*5) 24#define S3C2410_GPIO_BANKF (32*5)
22#define S3C2410_GPIO_BANKG (32*6) 25#define S3C2410_GPIO_BANKG (32*6)
23#define S3C2410_GPIO_BANKH (32*7) 26#define S3C2410_GPIO_BANKH (32*7)
27
28/* GPIO bank sizes */
29#define S3C2410_GPIO_A_NR (32)
30#define S3C2410_GPIO_B_NR (32)
31#define S3C2410_GPIO_C_NR (32)
32#define S3C2410_GPIO_D_NR (32)
33#define S3C2410_GPIO_E_NR (32)
34#define S3C2410_GPIO_F_NR (32)
35#define S3C2410_GPIO_G_NR (32)
36#define S3C2410_GPIO_H_NR (32)
37
38#if CONFIG_S3C_GPIO_SPACE != 0
39#error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment
40#endif
41
42#define S3C2410_GPIO_NEXT(__gpio) \
43 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 0)
44
45#ifndef __ASSEMBLY__
46
47enum s3c_gpio_number {
48 S3C2410_GPIO_A_START = 0,
49 S3C2410_GPIO_B_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_A),
50 S3C2410_GPIO_C_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_B),
51 S3C2410_GPIO_D_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_C),
52 S3C2410_GPIO_E_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_D),
53 S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
54 S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
55 S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
56};
57
58#endif /* __ASSEMBLY__ */
59
60/* S3C2410 GPIO number definitions. */
61
62#define S3C2410_GPA(_nr) (S3C2410_GPIO_A_START + (_nr))
63#define S3C2410_GPB(_nr) (S3C2410_GPIO_B_START + (_nr))
64#define S3C2410_GPC(_nr) (S3C2410_GPIO_C_START + (_nr))
65#define S3C2410_GPD(_nr) (S3C2410_GPIO_D_START + (_nr))
66#define S3C2410_GPE(_nr) (S3C2410_GPIO_E_START + (_nr))
67#define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr))
68#define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr))
69#define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr))
70
71/* compatibility until drivers can be modified */
72
73#define S3C2410_GPA0 S3C2410_GPA(0)
74#define S3C2410_GPA1 S3C2410_GPA(1)
75#define S3C2410_GPA3 S3C2410_GPA(3)
76#define S3C2410_GPA7 S3C2410_GPA(7)
77
78#define S3C2410_GPE0 S3C2410_GPE(0)
79#define S3C2410_GPE1 S3C2410_GPE(1)
80#define S3C2410_GPE2 S3C2410_GPE(2)
81#define S3C2410_GPE3 S3C2410_GPE(3)
82#define S3C2410_GPE4 S3C2410_GPE(4)
83#define S3C2410_GPE5 S3C2410_GPE(5)
84#define S3C2410_GPE6 S3C2410_GPE(6)
85#define S3C2410_GPE7 S3C2410_GPE(7)
86#define S3C2410_GPE8 S3C2410_GPE(8)
87#define S3C2410_GPE9 S3C2410_GPE(9)
88#define S3C2410_GPE10 S3C2410_GPE(10)
89
90#define S3C2410_GPH10 S3C2410_GPH(10)
91
92#endif /* __MACH_GPIONRS_H */
93
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 51a88cf9526b..15f0b3e7ce69 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -24,5 +24,6 @@
24 24
25#include <asm-generic/gpio.h> 25#include <asm-generic/gpio.h>
26#include <mach/gpio-nrs.h> 26#include <mach/gpio-nrs.h>
27#include <mach/gpio-fns.h>
27 28
28#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32) 29#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32)
diff --git a/arch/arm/mach-s3c2410/include/mach/hardware.h b/arch/arm/mach-s3c2410/include/mach/hardware.h
index 74d5a1a4024c..aef5631eac58 100644
--- a/arch/arm/mach-s3c2410/include/mach/hardware.h
+++ b/arch/arm/mach-s3c2410/include/mach/hardware.h
@@ -15,101 +15,6 @@
15 15
16#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
17 17
18/* external functions for GPIO support
19 *
20 * These allow various different clients to access the same GPIO
21 * registers without conflicting. If your driver only owns the entire
22 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
23*/
24
25/* s3c2410_gpio_cfgpin
26 *
27 * set the configuration of the given pin to the value passed.
28 *
29 * eg:
30 * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
31 * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
32*/
33
34extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
35
36extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
37
38/* s3c2410_gpio_getirq
39 *
40 * turn the given pin number into the corresponding IRQ number
41 *
42 * returns:
43 * < 0 = no interrupt for this pin
44 * >=0 = interrupt number for the pin
45*/
46
47extern int s3c2410_gpio_getirq(unsigned int pin);
48
49/* s3c2410_gpio_irq2pin
50 *
51 * turn the given irq number into the corresponding GPIO number
52 *
53 * returns:
54 * < 0 = no pin
55 * >=0 = gpio pin number
56*/
57
58extern int s3c2410_gpio_irq2pin(unsigned int irq);
59
60#ifdef CONFIG_CPU_S3C2400
61
62extern int s3c2400_gpio_getirq(unsigned int pin);
63
64#endif /* CONFIG_CPU_S3C2400 */
65
66/* s3c2410_gpio_irqfilter
67 *
68 * set the irq filtering on the given pin
69 *
70 * on = 0 => disable filtering
71 * 1 => enable filtering
72 *
73 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
74 * width of filter (0 through 63)
75 *
76 *
77*/
78
79extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
80 unsigned int config);
81
82/* s3c2410_gpio_pullup
83 *
84 * configure the pull-up control on the given pin
85 *
86 * to = 1 => disable the pull-up
87 * 0 => enable the pull-up
88 *
89 * eg;
90 *
91 * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
92 * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
93*/
94
95extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
96
97/* s3c2410_gpio_getpull
98 *
99 * Read the state of the pull-up on a given pin
100 *
101 * return:
102 * < 0 => error code
103 * 0 => enabled
104 * 1 => disabled
105*/
106
107extern int s3c2410_gpio_getpull(unsigned int pin);
108
109extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
110
111extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
112
113extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg); 18extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
114 19
115#ifdef CONFIG_CPU_S3C2440 20#ifdef CONFIG_CPU_S3C2440
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index 255fdfeaf957..e99b212cb1ca 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -84,7 +84,6 @@
84 84
85#define S3C24XX_PA_IRQ S3C2410_PA_IRQ 85#define S3C24XX_PA_IRQ S3C2410_PA_IRQ
86#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL 86#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL
87#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST
88#define S3C24XX_PA_DMA S3C2410_PA_DMA 87#define S3C24XX_PA_DMA S3C2410_PA_DMA
89#define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR 88#define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR
90#define S3C24XX_PA_LCD S3C2410_PA_LCD 89#define S3C24XX_PA_LCD S3C2410_PA_LCD
@@ -102,6 +101,7 @@
102 101
103#define S3C_PA_IIC S3C2410_PA_IIC 102#define S3C_PA_IIC S3C2410_PA_IIC
104#define S3C_PA_UART S3C24XX_PA_UART 103#define S3C_PA_UART S3C24XX_PA_UART
104#define S3C_PA_USBHOST S3C2410_PA_USBHOST
105#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 105#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC
106 106
107#endif /* __ASM_ARCH_MAP_H */ 107#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
index 35a03df473fc..b278d0c45ccf 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
@@ -69,104 +69,58 @@
69#define S3C2400_GPACON S3C2410_GPIOREG(0x00) 69#define S3C2400_GPACON S3C2410_GPIOREG(0x00)
70#define S3C2400_GPADAT S3C2410_GPIOREG(0x04) 70#define S3C2400_GPADAT S3C2410_GPIOREG(0x04)
71 71
72#define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0)
73#define S3C2410_GPA0_OUT (0<<0)
74#define S3C2410_GPA0_ADDR0 (1<<0) 72#define S3C2410_GPA0_ADDR0 (1<<0)
75 73
76#define S3C2410_GPA1 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 1)
77#define S3C2410_GPA1_OUT (0<<1)
78#define S3C2410_GPA1_ADDR16 (1<<1) 74#define S3C2410_GPA1_ADDR16 (1<<1)
79 75
80#define S3C2410_GPA2 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 2)
81#define S3C2410_GPA2_OUT (0<<2)
82#define S3C2410_GPA2_ADDR17 (1<<2) 76#define S3C2410_GPA2_ADDR17 (1<<2)
83 77
84#define S3C2410_GPA3 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 3)
85#define S3C2410_GPA3_OUT (0<<3)
86#define S3C2410_GPA3_ADDR18 (1<<3) 78#define S3C2410_GPA3_ADDR18 (1<<3)
87 79
88#define S3C2410_GPA4 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 4)
89#define S3C2410_GPA4_OUT (0<<4)
90#define S3C2410_GPA4_ADDR19 (1<<4) 80#define S3C2410_GPA4_ADDR19 (1<<4)
91 81
92#define S3C2410_GPA5 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 5)
93#define S3C2410_GPA5_OUT (0<<5)
94#define S3C2410_GPA5_ADDR20 (1<<5) 82#define S3C2410_GPA5_ADDR20 (1<<5)
95 83
96#define S3C2410_GPA6 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 6)
97#define S3C2410_GPA6_OUT (0<<6)
98#define S3C2410_GPA6_ADDR21 (1<<6) 84#define S3C2410_GPA6_ADDR21 (1<<6)
99 85
100#define S3C2410_GPA7 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 7)
101#define S3C2410_GPA7_OUT (0<<7)
102#define S3C2410_GPA7_ADDR22 (1<<7) 86#define S3C2410_GPA7_ADDR22 (1<<7)
103 87
104#define S3C2410_GPA8 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 8)
105#define S3C2410_GPA8_OUT (0<<8)
106#define S3C2410_GPA8_ADDR23 (1<<8) 88#define S3C2410_GPA8_ADDR23 (1<<8)
107 89
108#define S3C2410_GPA9 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 9)
109#define S3C2410_GPA9_OUT (0<<9)
110#define S3C2410_GPA9_ADDR24 (1<<9) 90#define S3C2410_GPA9_ADDR24 (1<<9)
111 91
112#define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10)
113#define S3C2410_GPA10_OUT (0<<10)
114#define S3C2410_GPA10_ADDR25 (1<<10) 92#define S3C2410_GPA10_ADDR25 (1<<10)
115#define S3C2400_GPA10_SCKE (1<<10) 93#define S3C2400_GPA10_SCKE (1<<10)
116 94
117#define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11)
118#define S3C2410_GPA11_OUT (0<<11)
119#define S3C2410_GPA11_ADDR26 (1<<11) 95#define S3C2410_GPA11_ADDR26 (1<<11)
120#define S3C2400_GPA11_nCAS0 (1<<11) 96#define S3C2400_GPA11_nCAS0 (1<<11)
121 97
122#define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12)
123#define S3C2410_GPA12_OUT (0<<12)
124#define S3C2410_GPA12_nGCS1 (1<<12) 98#define S3C2410_GPA12_nGCS1 (1<<12)
125#define S3C2400_GPA12_nCAS1 (1<<12) 99#define S3C2400_GPA12_nCAS1 (1<<12)
126 100
127#define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13)
128#define S3C2410_GPA13_OUT (0<<13)
129#define S3C2410_GPA13_nGCS2 (1<<13) 101#define S3C2410_GPA13_nGCS2 (1<<13)
130#define S3C2400_GPA13_nGCS1 (1<<13) 102#define S3C2400_GPA13_nGCS1 (1<<13)
131 103
132#define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14)
133#define S3C2410_GPA14_OUT (0<<14)
134#define S3C2410_GPA14_nGCS3 (1<<14) 104#define S3C2410_GPA14_nGCS3 (1<<14)
135#define S3C2400_GPA14_nGCS2 (1<<14) 105#define S3C2400_GPA14_nGCS2 (1<<14)
136 106
137#define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15)
138#define S3C2410_GPA15_OUT (0<<15)
139#define S3C2410_GPA15_nGCS4 (1<<15) 107#define S3C2410_GPA15_nGCS4 (1<<15)
140#define S3C2400_GPA15_nGCS3 (1<<15) 108#define S3C2400_GPA15_nGCS3 (1<<15)
141 109
142#define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16)
143#define S3C2410_GPA16_OUT (0<<16)
144#define S3C2410_GPA16_nGCS5 (1<<16) 110#define S3C2410_GPA16_nGCS5 (1<<16)
145#define S3C2400_GPA16_nGCS4 (1<<16) 111#define S3C2400_GPA16_nGCS4 (1<<16)
146 112
147#define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17)
148#define S3C2410_GPA17_OUT (0<<17)
149#define S3C2410_GPA17_CLE (1<<17) 113#define S3C2410_GPA17_CLE (1<<17)
150#define S3C2400_GPA17_nGCS5 (1<<17) 114#define S3C2400_GPA17_nGCS5 (1<<17)
151 115
152#define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18)
153#define S3C2410_GPA18_OUT (0<<18)
154#define S3C2410_GPA18_ALE (1<<18) 116#define S3C2410_GPA18_ALE (1<<18)
155 117
156#define S3C2410_GPA19 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 19)
157#define S3C2410_GPA19_OUT (0<<19)
158#define S3C2410_GPA19_nFWE (1<<19) 118#define S3C2410_GPA19_nFWE (1<<19)
159 119
160#define S3C2410_GPA20 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 20)
161#define S3C2410_GPA20_OUT (0<<20)
162#define S3C2410_GPA20_nFRE (1<<20) 120#define S3C2410_GPA20_nFRE (1<<20)
163 121
164#define S3C2410_GPA21 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 21)
165#define S3C2410_GPA21_OUT (0<<21)
166#define S3C2410_GPA21_nRSTOUT (1<<21) 122#define S3C2410_GPA21_nRSTOUT (1<<21)
167 123
168#define S3C2410_GPA22 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 22)
169#define S3C2410_GPA22_OUT (0<<22)
170#define S3C2410_GPA22_nFCE (1<<22) 124#define S3C2410_GPA22_nFCE (1<<22)
171 125
172/* 0x08 and 0x0c are reserved on S3C2410 */ 126/* 0x08 and 0x0c are reserved on S3C2410 */
@@ -194,107 +148,69 @@
194 148
195/* no i/o pin in port b can have value 3 (unless it is a s3c2443) ! */ 149/* no i/o pin in port b can have value 3 (unless it is a s3c2443) ! */
196 150
197#define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0)
198#define S3C2410_GPB0_INP (0x00 << 0)
199#define S3C2410_GPB0_OUTP (0x01 << 0)
200#define S3C2410_GPB0_TOUT0 (0x02 << 0) 151#define S3C2410_GPB0_TOUT0 (0x02 << 0)
201#define S3C2400_GPB0_DATA16 (0x02 << 0) 152#define S3C2400_GPB0_DATA16 (0x02 << 0)
202 153
203#define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1)
204#define S3C2410_GPB1_INP (0x00 << 2)
205#define S3C2410_GPB1_OUTP (0x01 << 2)
206#define S3C2410_GPB1_TOUT1 (0x02 << 2) 154#define S3C2410_GPB1_TOUT1 (0x02 << 2)
207#define S3C2400_GPB1_DATA17 (0x02 << 2) 155#define S3C2400_GPB1_DATA17 (0x02 << 2)
208 156
209#define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2)
210#define S3C2410_GPB2_INP (0x00 << 4)
211#define S3C2410_GPB2_OUTP (0x01 << 4)
212#define S3C2410_GPB2_TOUT2 (0x02 << 4) 157#define S3C2410_GPB2_TOUT2 (0x02 << 4)
213#define S3C2400_GPB2_DATA18 (0x02 << 4) 158#define S3C2400_GPB2_DATA18 (0x02 << 4)
214#define S3C2400_GPB2_TCLK1 (0x03 << 4) 159#define S3C2400_GPB2_TCLK1 (0x03 << 4)
215 160
216#define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3)
217#define S3C2410_GPB3_INP (0x00 << 6)
218#define S3C2410_GPB3_OUTP (0x01 << 6)
219#define S3C2410_GPB3_TOUT3 (0x02 << 6) 161#define S3C2410_GPB3_TOUT3 (0x02 << 6)
220#define S3C2400_GPB3_DATA19 (0x02 << 6) 162#define S3C2400_GPB3_DATA19 (0x02 << 6)
221#define S3C2400_GPB3_TXD1 (0x03 << 6) 163#define S3C2400_GPB3_TXD1 (0x03 << 6)
222 164
223#define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4)
224#define S3C2410_GPB4_INP (0x00 << 8)
225#define S3C2410_GPB4_OUTP (0x01 << 8)
226#define S3C2410_GPB4_TCLK0 (0x02 << 8) 165#define S3C2410_GPB4_TCLK0 (0x02 << 8)
227#define S3C2400_GPB4_DATA20 (0x02 << 8) 166#define S3C2400_GPB4_DATA20 (0x02 << 8)
228#define S3C2410_GPB4_MASK (0x03 << 8) 167#define S3C2410_GPB4_MASK (0x03 << 8)
229#define S3C2400_GPB4_RXD1 (0x03 << 8) 168#define S3C2400_GPB4_RXD1 (0x03 << 8)
230#define S3C2400_GPB4_MASK (0x03 << 8) 169#define S3C2400_GPB4_MASK (0x03 << 8)
231 170
232#define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5)
233#define S3C2410_GPB5_INP (0x00 << 10)
234#define S3C2410_GPB5_OUTP (0x01 << 10)
235#define S3C2410_GPB5_nXBACK (0x02 << 10) 171#define S3C2410_GPB5_nXBACK (0x02 << 10)
236#define S3C2443_GPB5_XBACK (0x03 << 10) 172#define S3C2443_GPB5_XBACK (0x03 << 10)
237#define S3C2400_GPB5_DATA21 (0x02 << 10) 173#define S3C2400_GPB5_DATA21 (0x02 << 10)
238#define S3C2400_GPB5_nCTS1 (0x03 << 10) 174#define S3C2400_GPB5_nCTS1 (0x03 << 10)
239 175
240#define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6)
241#define S3C2410_GPB6_INP (0x00 << 12)
242#define S3C2410_GPB6_OUTP (0x01 << 12)
243#define S3C2410_GPB6_nXBREQ (0x02 << 12) 176#define S3C2410_GPB6_nXBREQ (0x02 << 12)
244#define S3C2443_GPB6_XBREQ (0x03 << 12) 177#define S3C2443_GPB6_XBREQ (0x03 << 12)
245#define S3C2400_GPB6_DATA22 (0x02 << 12) 178#define S3C2400_GPB6_DATA22 (0x02 << 12)
246#define S3C2400_GPB6_nRTS1 (0x03 << 12) 179#define S3C2400_GPB6_nRTS1 (0x03 << 12)
247 180
248#define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7)
249#define S3C2410_GPB7_INP (0x00 << 14)
250#define S3C2410_GPB7_OUTP (0x01 << 14)
251#define S3C2410_GPB7_nXDACK1 (0x02 << 14) 181#define S3C2410_GPB7_nXDACK1 (0x02 << 14)
252#define S3C2443_GPB7_XDACK1 (0x03 << 14) 182#define S3C2443_GPB7_XDACK1 (0x03 << 14)
253#define S3C2400_GPB7_DATA23 (0x02 << 14) 183#define S3C2400_GPB7_DATA23 (0x02 << 14)
254 184
255#define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8)
256#define S3C2410_GPB8_INP (0x00 << 16)
257#define S3C2410_GPB8_OUTP (0x01 << 16)
258#define S3C2410_GPB8_nXDREQ1 (0x02 << 16) 185#define S3C2410_GPB8_nXDREQ1 (0x02 << 16)
259#define S3C2400_GPB8_DATA24 (0x02 << 16) 186#define S3C2400_GPB8_DATA24 (0x02 << 16)
260 187
261#define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9)
262#define S3C2410_GPB9_INP (0x00 << 18)
263#define S3C2410_GPB9_OUTP (0x01 << 18)
264#define S3C2410_GPB9_nXDACK0 (0x02 << 18) 188#define S3C2410_GPB9_nXDACK0 (0x02 << 18)
265#define S3C2443_GPB9_XDACK0 (0x03 << 18) 189#define S3C2443_GPB9_XDACK0 (0x03 << 18)
266#define S3C2400_GPB9_DATA25 (0x02 << 18) 190#define S3C2400_GPB9_DATA25 (0x02 << 18)
267#define S3C2400_GPB9_I2SSDI (0x03 << 18) 191#define S3C2400_GPB9_I2SSDI (0x03 << 18)
268 192
269#define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10)
270#define S3C2410_GPB10_INP (0x00 << 20)
271#define S3C2410_GPB10_OUTP (0x01 << 20)
272#define S3C2410_GPB10_nXDRE0 (0x02 << 20) 193#define S3C2410_GPB10_nXDRE0 (0x02 << 20)
273#define S3C2443_GPB10_XDREQ0 (0x03 << 20) 194#define S3C2443_GPB10_XDREQ0 (0x03 << 20)
274#define S3C2400_GPB10_DATA26 (0x02 << 20) 195#define S3C2400_GPB10_DATA26 (0x02 << 20)
275#define S3C2400_GPB10_nSS (0x03 << 20) 196#define S3C2400_GPB10_nSS (0x03 << 20)
276 197
277#define S3C2400_GPB11 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 11)
278#define S3C2400_GPB11_INP (0x00 << 22) 198#define S3C2400_GPB11_INP (0x00 << 22)
279#define S3C2400_GPB11_OUTP (0x01 << 22) 199#define S3C2400_GPB11_OUTP (0x01 << 22)
280#define S3C2400_GPB11_DATA27 (0x02 << 22) 200#define S3C2400_GPB11_DATA27 (0x02 << 22)
281 201
282#define S3C2400_GPB12 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 12)
283#define S3C2400_GPB12_INP (0x00 << 24) 202#define S3C2400_GPB12_INP (0x00 << 24)
284#define S3C2400_GPB12_OUTP (0x01 << 24) 203#define S3C2400_GPB12_OUTP (0x01 << 24)
285#define S3C2400_GPB12_DATA28 (0x02 << 24) 204#define S3C2400_GPB12_DATA28 (0x02 << 24)
286 205
287#define S3C2400_GPB13 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 13)
288#define S3C2400_GPB13_INP (0x00 << 26) 206#define S3C2400_GPB13_INP (0x00 << 26)
289#define S3C2400_GPB13_OUTP (0x01 << 26) 207#define S3C2400_GPB13_OUTP (0x01 << 26)
290#define S3C2400_GPB13_DATA29 (0x02 << 26) 208#define S3C2400_GPB13_DATA29 (0x02 << 26)
291 209
292#define S3C2400_GPB14 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 14)
293#define S3C2400_GPB14_INP (0x00 << 28) 210#define S3C2400_GPB14_INP (0x00 << 28)
294#define S3C2400_GPB14_OUTP (0x01 << 28) 211#define S3C2400_GPB14_OUTP (0x01 << 28)
295#define S3C2400_GPB14_DATA30 (0x02 << 28) 212#define S3C2400_GPB14_DATA30 (0x02 << 28)
296 213
297#define S3C2400_GPB15 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 15)
298#define S3C2400_GPB15_INP (0x00 << 30) 214#define S3C2400_GPB15_INP (0x00 << 30)
299#define S3C2400_GPB15_OUTP (0x01 << 30) 215#define S3C2400_GPB15_OUTP (0x01 << 30)
300#define S3C2400_GPB15_DATA31 (0x02 << 30) 216#define S3C2400_GPB15_DATA31 (0x02 << 30)
@@ -315,99 +231,51 @@
315#define S3C2400_GPCDAT S3C2410_GPIOREG(0x18) 231#define S3C2400_GPCDAT S3C2410_GPIOREG(0x18)
316#define S3C2400_GPCUP S3C2410_GPIOREG(0x1C) 232#define S3C2400_GPCUP S3C2410_GPIOREG(0x1C)
317 233
318#define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0)
319#define S3C2410_GPC0_INP (0x00 << 0)
320#define S3C2410_GPC0_OUTP (0x01 << 0)
321#define S3C2410_GPC0_LEND (0x02 << 0) 234#define S3C2410_GPC0_LEND (0x02 << 0)
322#define S3C2400_GPC0_VD0 (0x02 << 0) 235#define S3C2400_GPC0_VD0 (0x02 << 0)
323 236
324#define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1)
325#define S3C2410_GPC1_INP (0x00 << 2)
326#define S3C2410_GPC1_OUTP (0x01 << 2)
327#define S3C2410_GPC1_VCLK (0x02 << 2) 237#define S3C2410_GPC1_VCLK (0x02 << 2)
328#define S3C2400_GPC1_VD1 (0x02 << 2) 238#define S3C2400_GPC1_VD1 (0x02 << 2)
329 239
330#define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2)
331#define S3C2410_GPC2_INP (0x00 << 4)
332#define S3C2410_GPC2_OUTP (0x01 << 4)
333#define S3C2410_GPC2_VLINE (0x02 << 4) 240#define S3C2410_GPC2_VLINE (0x02 << 4)
334#define S3C2400_GPC2_VD2 (0x02 << 4) 241#define S3C2400_GPC2_VD2 (0x02 << 4)
335 242
336#define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3)
337#define S3C2410_GPC3_INP (0x00 << 6)
338#define S3C2410_GPC3_OUTP (0x01 << 6)
339#define S3C2410_GPC3_VFRAME (0x02 << 6) 243#define S3C2410_GPC3_VFRAME (0x02 << 6)
340#define S3C2400_GPC3_VD3 (0x02 << 6) 244#define S3C2400_GPC3_VD3 (0x02 << 6)
341 245
342#define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4)
343#define S3C2410_GPC4_INP (0x00 << 8)
344#define S3C2410_GPC4_OUTP (0x01 << 8)
345#define S3C2410_GPC4_VM (0x02 << 8) 246#define S3C2410_GPC4_VM (0x02 << 8)
346#define S3C2400_GPC4_VD4 (0x02 << 8) 247#define S3C2400_GPC4_VD4 (0x02 << 8)
347 248
348#define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5)
349#define S3C2410_GPC5_INP (0x00 << 10)
350#define S3C2410_GPC5_OUTP (0x01 << 10)
351#define S3C2410_GPC5_LCDVF0 (0x02 << 10) 249#define S3C2410_GPC5_LCDVF0 (0x02 << 10)
352#define S3C2400_GPC5_VD5 (0x02 << 10) 250#define S3C2400_GPC5_VD5 (0x02 << 10)
353 251
354#define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6)
355#define S3C2410_GPC6_INP (0x00 << 12)
356#define S3C2410_GPC6_OUTP (0x01 << 12)
357#define S3C2410_GPC6_LCDVF1 (0x02 << 12) 252#define S3C2410_GPC6_LCDVF1 (0x02 << 12)
358#define S3C2400_GPC6_VD6 (0x02 << 12) 253#define S3C2400_GPC6_VD6 (0x02 << 12)
359 254
360#define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7)
361#define S3C2410_GPC7_INP (0x00 << 14)
362#define S3C2410_GPC7_OUTP (0x01 << 14)
363#define S3C2410_GPC7_LCDVF2 (0x02 << 14) 255#define S3C2410_GPC7_LCDVF2 (0x02 << 14)
364#define S3C2400_GPC7_VD7 (0x02 << 14) 256#define S3C2400_GPC7_VD7 (0x02 << 14)
365 257
366#define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8)
367#define S3C2410_GPC8_INP (0x00 << 16)
368#define S3C2410_GPC8_OUTP (0x01 << 16)
369#define S3C2410_GPC8_VD0 (0x02 << 16) 258#define S3C2410_GPC8_VD0 (0x02 << 16)
370#define S3C2400_GPC8_VD8 (0x02 << 16) 259#define S3C2400_GPC8_VD8 (0x02 << 16)
371 260
372#define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9)
373#define S3C2410_GPC9_INP (0x00 << 18)
374#define S3C2410_GPC9_OUTP (0x01 << 18)
375#define S3C2410_GPC9_VD1 (0x02 << 18) 261#define S3C2410_GPC9_VD1 (0x02 << 18)
376#define S3C2400_GPC9_VD9 (0x02 << 18) 262#define S3C2400_GPC9_VD9 (0x02 << 18)
377 263
378#define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10)
379#define S3C2410_GPC10_INP (0x00 << 20)
380#define S3C2410_GPC10_OUTP (0x01 << 20)
381#define S3C2410_GPC10_VD2 (0x02 << 20) 264#define S3C2410_GPC10_VD2 (0x02 << 20)
382#define S3C2400_GPC10_VD10 (0x02 << 20) 265#define S3C2400_GPC10_VD10 (0x02 << 20)
383 266
384#define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11)
385#define S3C2410_GPC11_INP (0x00 << 22)
386#define S3C2410_GPC11_OUTP (0x01 << 22)
387#define S3C2410_GPC11_VD3 (0x02 << 22) 267#define S3C2410_GPC11_VD3 (0x02 << 22)
388#define S3C2400_GPC11_VD11 (0x02 << 22) 268#define S3C2400_GPC11_VD11 (0x02 << 22)
389 269
390#define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12)
391#define S3C2410_GPC12_INP (0x00 << 24)
392#define S3C2410_GPC12_OUTP (0x01 << 24)
393#define S3C2410_GPC12_VD4 (0x02 << 24) 270#define S3C2410_GPC12_VD4 (0x02 << 24)
394#define S3C2400_GPC12_VD12 (0x02 << 24) 271#define S3C2400_GPC12_VD12 (0x02 << 24)
395 272
396#define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13)
397#define S3C2410_GPC13_INP (0x00 << 26)
398#define S3C2410_GPC13_OUTP (0x01 << 26)
399#define S3C2410_GPC13_VD5 (0x02 << 26) 273#define S3C2410_GPC13_VD5 (0x02 << 26)
400#define S3C2400_GPC13_VD13 (0x02 << 26) 274#define S3C2400_GPC13_VD13 (0x02 << 26)
401 275
402#define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14)
403#define S3C2410_GPC14_INP (0x00 << 28)
404#define S3C2410_GPC14_OUTP (0x01 << 28)
405#define S3C2410_GPC14_VD6 (0x02 << 28) 276#define S3C2410_GPC14_VD6 (0x02 << 28)
406#define S3C2400_GPC14_VD14 (0x02 << 28) 277#define S3C2400_GPC14_VD14 (0x02 << 28)
407 278
408#define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15)
409#define S3C2410_GPC15_INP (0x00 << 30)
410#define S3C2410_GPC15_OUTP (0x01 << 30)
411#define S3C2410_GPC15_VD7 (0x02 << 30) 279#define S3C2410_GPC15_VD7 (0x02 << 30)
412#define S3C2400_GPC15_VD15 (0x02 << 30) 280#define S3C2400_GPC15_VD15 (0x02 << 30)
413 281
@@ -432,99 +300,51 @@
432#define S3C2400_GPDDAT S3C2410_GPIOREG(0x24) 300#define S3C2400_GPDDAT S3C2410_GPIOREG(0x24)
433#define S3C2400_GPDUP S3C2410_GPIOREG(0x28) 301#define S3C2400_GPDUP S3C2410_GPIOREG(0x28)
434 302
435#define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0)
436#define S3C2410_GPD0_INP (0x00 << 0)
437#define S3C2410_GPD0_OUTP (0x01 << 0)
438#define S3C2410_GPD0_VD8 (0x02 << 0) 303#define S3C2410_GPD0_VD8 (0x02 << 0)
439#define S3C2400_GPD0_VFRAME (0x02 << 0) 304#define S3C2400_GPD0_VFRAME (0x02 << 0)
440#define S3C2442_GPD0_nSPICS1 (0x03 << 0) 305#define S3C2442_GPD0_nSPICS1 (0x03 << 0)
441 306
442#define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1)
443#define S3C2410_GPD1_INP (0x00 << 2)
444#define S3C2410_GPD1_OUTP (0x01 << 2)
445#define S3C2410_GPD1_VD9 (0x02 << 2) 307#define S3C2410_GPD1_VD9 (0x02 << 2)
446#define S3C2400_GPD1_VM (0x02 << 2) 308#define S3C2400_GPD1_VM (0x02 << 2)
447#define S3C2442_GPD1_SPICLK1 (0x03 << 2) 309#define S3C2442_GPD1_SPICLK1 (0x03 << 2)
448 310
449#define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2)
450#define S3C2410_GPD2_INP (0x00 << 4)
451#define S3C2410_GPD2_OUTP (0x01 << 4)
452#define S3C2410_GPD2_VD10 (0x02 << 4) 311#define S3C2410_GPD2_VD10 (0x02 << 4)
453#define S3C2400_GPD2_VLINE (0x02 << 4) 312#define S3C2400_GPD2_VLINE (0x02 << 4)
454 313
455#define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3)
456#define S3C2410_GPD3_INP (0x00 << 6)
457#define S3C2410_GPD3_OUTP (0x01 << 6)
458#define S3C2410_GPD3_VD11 (0x02 << 6) 314#define S3C2410_GPD3_VD11 (0x02 << 6)
459#define S3C2400_GPD3_VCLK (0x02 << 6) 315#define S3C2400_GPD3_VCLK (0x02 << 6)
460 316
461#define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4)
462#define S3C2410_GPD4_INP (0x00 << 8)
463#define S3C2410_GPD4_OUTP (0x01 << 8)
464#define S3C2410_GPD4_VD12 (0x02 << 8) 317#define S3C2410_GPD4_VD12 (0x02 << 8)
465#define S3C2400_GPD4_LEND (0x02 << 8) 318#define S3C2400_GPD4_LEND (0x02 << 8)
466 319
467#define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5)
468#define S3C2410_GPD5_INP (0x00 << 10)
469#define S3C2410_GPD5_OUTP (0x01 << 10)
470#define S3C2410_GPD5_VD13 (0x02 << 10) 320#define S3C2410_GPD5_VD13 (0x02 << 10)
471#define S3C2400_GPD5_TOUT0 (0x02 << 10) 321#define S3C2400_GPD5_TOUT0 (0x02 << 10)
472 322
473#define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6)
474#define S3C2410_GPD6_INP (0x00 << 12)
475#define S3C2410_GPD6_OUTP (0x01 << 12)
476#define S3C2410_GPD6_VD14 (0x02 << 12) 323#define S3C2410_GPD6_VD14 (0x02 << 12)
477#define S3C2400_GPD6_TOUT1 (0x02 << 12) 324#define S3C2400_GPD6_TOUT1 (0x02 << 12)
478 325
479#define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7)
480#define S3C2410_GPD7_INP (0x00 << 14)
481#define S3C2410_GPD7_OUTP (0x01 << 14)
482#define S3C2410_GPD7_VD15 (0x02 << 14) 326#define S3C2410_GPD7_VD15 (0x02 << 14)
483#define S3C2400_GPD7_TOUT2 (0x02 << 14) 327#define S3C2400_GPD7_TOUT2 (0x02 << 14)
484 328
485#define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8)
486#define S3C2410_GPD8_INP (0x00 << 16)
487#define S3C2410_GPD8_OUTP (0x01 << 16)
488#define S3C2410_GPD8_VD16 (0x02 << 16) 329#define S3C2410_GPD8_VD16 (0x02 << 16)
489#define S3C2400_GPD8_TOUT3 (0x02 << 16) 330#define S3C2400_GPD8_TOUT3 (0x02 << 16)
490 331
491#define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9)
492#define S3C2410_GPD9_INP (0x00 << 18)
493#define S3C2410_GPD9_OUTP (0x01 << 18)
494#define S3C2410_GPD9_VD17 (0x02 << 18) 332#define S3C2410_GPD9_VD17 (0x02 << 18)
495#define S3C2400_GPD9_TCLK0 (0x02 << 18) 333#define S3C2400_GPD9_TCLK0 (0x02 << 18)
496#define S3C2410_GPD9_MASK (0x03 << 18) 334#define S3C2410_GPD9_MASK (0x03 << 18)
497 335
498#define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10)
499#define S3C2410_GPD10_INP (0x00 << 20)
500#define S3C2410_GPD10_OUTP (0x01 << 20)
501#define S3C2410_GPD10_VD18 (0x02 << 20) 336#define S3C2410_GPD10_VD18 (0x02 << 20)
502#define S3C2400_GPD10_nWAIT (0x02 << 20) 337#define S3C2400_GPD10_nWAIT (0x02 << 20)
503 338
504#define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11)
505#define S3C2410_GPD11_INP (0x00 << 22)
506#define S3C2410_GPD11_OUTP (0x01 << 22)
507#define S3C2410_GPD11_VD19 (0x02 << 22) 339#define S3C2410_GPD11_VD19 (0x02 << 22)
508 340
509#define S3C2410_GPD12 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 12)
510#define S3C2410_GPD12_INP (0x00 << 24)
511#define S3C2410_GPD12_OUTP (0x01 << 24)
512#define S3C2410_GPD12_VD20 (0x02 << 24) 341#define S3C2410_GPD12_VD20 (0x02 << 24)
513 342
514#define S3C2410_GPD13 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 13)
515#define S3C2410_GPD13_INP (0x00 << 26)
516#define S3C2410_GPD13_OUTP (0x01 << 26)
517#define S3C2410_GPD13_VD21 (0x02 << 26) 343#define S3C2410_GPD13_VD21 (0x02 << 26)
518 344
519#define S3C2410_GPD14 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 14)
520#define S3C2410_GPD14_INP (0x00 << 28)
521#define S3C2410_GPD14_OUTP (0x01 << 28)
522#define S3C2410_GPD14_VD22 (0x02 << 28) 345#define S3C2410_GPD14_VD22 (0x02 << 28)
523#define S3C2410_GPD14_nSS1 (0x03 << 28) 346#define S3C2410_GPD14_nSS1 (0x03 << 28)
524 347
525#define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
526#define S3C2410_GPD15_INP (0x00 << 30)
527#define S3C2410_GPD15_OUTP (0x01 << 30)
528#define S3C2410_GPD15_VD23 (0x02 << 30) 348#define S3C2410_GPD15_VD23 (0x02 << 30)
529#define S3C2410_GPD15_nSS0 (0x03 << 30) 349#define S3C2410_GPD15_nSS0 (0x03 << 30)
530 350
@@ -550,34 +370,22 @@
550#define S3C2400_GPEDAT S3C2410_GPIOREG(0x30) 370#define S3C2400_GPEDAT S3C2410_GPIOREG(0x30)
551#define S3C2400_GPEUP S3C2410_GPIOREG(0x34) 371#define S3C2400_GPEUP S3C2410_GPIOREG(0x34)
552 372
553#define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0)
554#define S3C2410_GPE0_INP (0x00 << 0)
555#define S3C2410_GPE0_OUTP (0x01 << 0)
556#define S3C2410_GPE0_I2SLRCK (0x02 << 0) 373#define S3C2410_GPE0_I2SLRCK (0x02 << 0)
557#define S3C2443_GPE0_AC_nRESET (0x03 << 0) 374#define S3C2443_GPE0_AC_nRESET (0x03 << 0)
558#define S3C2400_GPE0_EINT0 (0x02 << 0) 375#define S3C2400_GPE0_EINT0 (0x02 << 0)
559#define S3C2410_GPE0_MASK (0x03 << 0) 376#define S3C2410_GPE0_MASK (0x03 << 0)
560 377
561#define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1)
562#define S3C2410_GPE1_INP (0x00 << 2)
563#define S3C2410_GPE1_OUTP (0x01 << 2)
564#define S3C2410_GPE1_I2SSCLK (0x02 << 2) 378#define S3C2410_GPE1_I2SSCLK (0x02 << 2)
565#define S3C2443_GPE1_AC_SYNC (0x03 << 2) 379#define S3C2443_GPE1_AC_SYNC (0x03 << 2)
566#define S3C2400_GPE1_EINT1 (0x02 << 2) 380#define S3C2400_GPE1_EINT1 (0x02 << 2)
567#define S3C2400_GPE1_nSS (0x03 << 2) 381#define S3C2400_GPE1_nSS (0x03 << 2)
568#define S3C2410_GPE1_MASK (0x03 << 2) 382#define S3C2410_GPE1_MASK (0x03 << 2)
569 383
570#define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2)
571#define S3C2410_GPE2_INP (0x00 << 4)
572#define S3C2410_GPE2_OUTP (0x01 << 4)
573#define S3C2410_GPE2_CDCLK (0x02 << 4) 384#define S3C2410_GPE2_CDCLK (0x02 << 4)
574#define S3C2443_GPE2_AC_BITCLK (0x03 << 4) 385#define S3C2443_GPE2_AC_BITCLK (0x03 << 4)
575#define S3C2400_GPE2_EINT2 (0x02 << 4) 386#define S3C2400_GPE2_EINT2 (0x02 << 4)
576#define S3C2400_GPE2_I2SSDI (0x03 << 4) 387#define S3C2400_GPE2_I2SSDI (0x03 << 4)
577 388
578#define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3)
579#define S3C2410_GPE3_INP (0x00 << 6)
580#define S3C2410_GPE3_OUTP (0x01 << 6)
581#define S3C2410_GPE3_I2SSDI (0x02 << 6) 389#define S3C2410_GPE3_I2SSDI (0x02 << 6)
582#define S3C2443_GPE3_AC_SDI (0x03 << 6) 390#define S3C2443_GPE3_AC_SDI (0x03 << 6)
583#define S3C2400_GPE3_EINT3 (0x02 << 6) 391#define S3C2400_GPE3_EINT3 (0x02 << 6)
@@ -585,9 +393,6 @@
585#define S3C2410_GPE3_nSS0 (0x03 << 6) 393#define S3C2410_GPE3_nSS0 (0x03 << 6)
586#define S3C2410_GPE3_MASK (0x03 << 6) 394#define S3C2410_GPE3_MASK (0x03 << 6)
587 395
588#define S3C2410_GPE4 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 4)
589#define S3C2410_GPE4_INP (0x00 << 8)
590#define S3C2410_GPE4_OUTP (0x01 << 8)
591#define S3C2410_GPE4_I2SSDO (0x02 << 8) 396#define S3C2410_GPE4_I2SSDO (0x02 << 8)
592#define S3C2443_GPE4_AC_SDO (0x03 << 8) 397#define S3C2443_GPE4_AC_SDO (0x03 << 8)
593#define S3C2400_GPE4_EINT4 (0x02 << 8) 398#define S3C2400_GPE4_EINT4 (0x02 << 8)
@@ -595,81 +400,48 @@
595#define S3C2410_GPE4_I2SSDI (0x03 << 8) 400#define S3C2410_GPE4_I2SSDI (0x03 << 8)
596#define S3C2410_GPE4_MASK (0x03 << 8) 401#define S3C2410_GPE4_MASK (0x03 << 8)
597 402
598#define S3C2410_GPE5 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 5)
599#define S3C2410_GPE5_INP (0x00 << 10)
600#define S3C2410_GPE5_OUTP (0x01 << 10)
601#define S3C2410_GPE5_SDCLK (0x02 << 10) 403#define S3C2410_GPE5_SDCLK (0x02 << 10)
602#define S3C2443_GPE5_SD1_CLK (0x02 << 10) 404#define S3C2443_GPE5_SD1_CLK (0x02 << 10)
603#define S3C2400_GPE5_EINT5 (0x02 << 10) 405#define S3C2400_GPE5_EINT5 (0x02 << 10)
604#define S3C2400_GPE5_TCLK1 (0x03 << 10) 406#define S3C2400_GPE5_TCLK1 (0x03 << 10)
605 407
606#define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6)
607#define S3C2410_GPE6_INP (0x00 << 12)
608#define S3C2410_GPE6_OUTP (0x01 << 12)
609#define S3C2410_GPE6_SDCMD (0x02 << 12) 408#define S3C2410_GPE6_SDCMD (0x02 << 12)
610#define S3C2443_GPE6_SD1_CMD (0x02 << 12) 409#define S3C2443_GPE6_SD1_CMD (0x02 << 12)
611#define S3C2443_GPE6_AC_BITCLK (0x03 << 12) 410#define S3C2443_GPE6_AC_BITCLK (0x03 << 12)
612#define S3C2400_GPE6_EINT6 (0x02 << 12) 411#define S3C2400_GPE6_EINT6 (0x02 << 12)
613 412
614#define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7)
615#define S3C2410_GPE7_INP (0x00 << 14)
616#define S3C2410_GPE7_OUTP (0x01 << 14)
617#define S3C2410_GPE7_SDDAT0 (0x02 << 14) 413#define S3C2410_GPE7_SDDAT0 (0x02 << 14)
618#define S3C2443_GPE5_SD1_DAT0 (0x02 << 14) 414#define S3C2443_GPE5_SD1_DAT0 (0x02 << 14)
619#define S3C2443_GPE7_AC_SDI (0x03 << 14) 415#define S3C2443_GPE7_AC_SDI (0x03 << 14)
620#define S3C2400_GPE7_EINT7 (0x02 << 14) 416#define S3C2400_GPE7_EINT7 (0x02 << 14)
621 417
622#define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8)
623#define S3C2410_GPE8_INP (0x00 << 16)
624#define S3C2410_GPE8_OUTP (0x01 << 16)
625#define S3C2410_GPE8_SDDAT1 (0x02 << 16) 418#define S3C2410_GPE8_SDDAT1 (0x02 << 16)
626#define S3C2443_GPE8_SD1_DAT1 (0x02 << 16) 419#define S3C2443_GPE8_SD1_DAT1 (0x02 << 16)
627#define S3C2443_GPE8_AC_SDO (0x03 << 16) 420#define S3C2443_GPE8_AC_SDO (0x03 << 16)
628#define S3C2400_GPE8_nXDACK0 (0x02 << 16) 421#define S3C2400_GPE8_nXDACK0 (0x02 << 16)
629 422
630#define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9)
631#define S3C2410_GPE9_INP (0x00 << 18)
632#define S3C2410_GPE9_OUTP (0x01 << 18)
633#define S3C2410_GPE9_SDDAT2 (0x02 << 18) 423#define S3C2410_GPE9_SDDAT2 (0x02 << 18)
634#define S3C2443_GPE9_SD1_DAT2 (0x02 << 18) 424#define S3C2443_GPE9_SD1_DAT2 (0x02 << 18)
635#define S3C2443_GPE9_AC_SYNC (0x03 << 18) 425#define S3C2443_GPE9_AC_SYNC (0x03 << 18)
636#define S3C2400_GPE9_nXDACK1 (0x02 << 18) 426#define S3C2400_GPE9_nXDACK1 (0x02 << 18)
637#define S3C2400_GPE9_nXBACK (0x03 << 18) 427#define S3C2400_GPE9_nXBACK (0x03 << 18)
638 428
639#define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10)
640#define S3C2410_GPE10_INP (0x00 << 20)
641#define S3C2410_GPE10_OUTP (0x01 << 20)
642#define S3C2410_GPE10_SDDAT3 (0x02 << 20) 429#define S3C2410_GPE10_SDDAT3 (0x02 << 20)
643#define S3C2443_GPE10_SD1_DAT3 (0x02 << 20) 430#define S3C2443_GPE10_SD1_DAT3 (0x02 << 20)
644#define S3C2443_GPE10_AC_nRESET (0x03 << 20) 431#define S3C2443_GPE10_AC_nRESET (0x03 << 20)
645#define S3C2400_GPE10_nXDREQ0 (0x02 << 20) 432#define S3C2400_GPE10_nXDREQ0 (0x02 << 20)
646 433
647#define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11)
648#define S3C2410_GPE11_INP (0x00 << 22)
649#define S3C2410_GPE11_OUTP (0x01 << 22)
650#define S3C2410_GPE11_SPIMISO0 (0x02 << 22) 434#define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
651#define S3C2400_GPE11_nXDREQ1 (0x02 << 22) 435#define S3C2400_GPE11_nXDREQ1 (0x02 << 22)
652#define S3C2400_GPE11_nXBREQ (0x03 << 22) 436#define S3C2400_GPE11_nXBREQ (0x03 << 22)
653 437
654#define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12)
655#define S3C2410_GPE12_INP (0x00 << 24)
656#define S3C2410_GPE12_OUTP (0x01 << 24)
657#define S3C2410_GPE12_SPIMOSI0 (0x02 << 24) 438#define S3C2410_GPE12_SPIMOSI0 (0x02 << 24)
658 439
659#define S3C2410_GPE13 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 13)
660#define S3C2410_GPE13_INP (0x00 << 26)
661#define S3C2410_GPE13_OUTP (0x01 << 26)
662#define S3C2410_GPE13_SPICLK0 (0x02 << 26) 440#define S3C2410_GPE13_SPICLK0 (0x02 << 26)
663 441
664#define S3C2410_GPE14 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 14)
665#define S3C2410_GPE14_INP (0x00 << 28)
666#define S3C2410_GPE14_OUTP (0x01 << 28)
667#define S3C2410_GPE14_IICSCL (0x02 << 28) 442#define S3C2410_GPE14_IICSCL (0x02 << 28)
668#define S3C2410_GPE14_MASK (0x03 << 28) 443#define S3C2410_GPE14_MASK (0x03 << 28)
669 444
670#define S3C2410_GPE15 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 15)
671#define S3C2410_GPE15_INP (0x00 << 30)
672#define S3C2410_GPE15_OUTP (0x01 << 30)
673#define S3C2410_GPE15_IICSDA (0x02 << 30) 445#define S3C2410_GPE15_IICSDA (0x02 << 30)
674#define S3C2410_GPE15_MASK (0x03 << 30) 446#define S3C2410_GPE15_MASK (0x03 << 30)
675 447
@@ -705,55 +477,31 @@
705#define S3C2400_GPFDAT S3C2410_GPIOREG(0x3C) 477#define S3C2400_GPFDAT S3C2410_GPIOREG(0x3C)
706#define S3C2400_GPFUP S3C2410_GPIOREG(0x40) 478#define S3C2400_GPFUP S3C2410_GPIOREG(0x40)
707 479
708#define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0)
709#define S3C2410_GPF0_INP (0x00 << 0)
710#define S3C2410_GPF0_OUTP (0x01 << 0)
711#define S3C2410_GPF0_EINT0 (0x02 << 0) 480#define S3C2410_GPF0_EINT0 (0x02 << 0)
712#define S3C2400_GPF0_RXD0 (0x02 << 0) 481#define S3C2400_GPF0_RXD0 (0x02 << 0)
713 482
714#define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1)
715#define S3C2410_GPF1_INP (0x00 << 2)
716#define S3C2410_GPF1_OUTP (0x01 << 2)
717#define S3C2410_GPF1_EINT1 (0x02 << 2) 483#define S3C2410_GPF1_EINT1 (0x02 << 2)
718#define S3C2400_GPF1_RXD1 (0x02 << 2) 484#define S3C2400_GPF1_RXD1 (0x02 << 2)
719#define S3C2400_GPF1_IICSDA (0x03 << 2) 485#define S3C2400_GPF1_IICSDA (0x03 << 2)
720 486
721#define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2)
722#define S3C2410_GPF2_INP (0x00 << 4)
723#define S3C2410_GPF2_OUTP (0x01 << 4)
724#define S3C2410_GPF2_EINT2 (0x02 << 4) 487#define S3C2410_GPF2_EINT2 (0x02 << 4)
725#define S3C2400_GPF2_TXD0 (0x02 << 4) 488#define S3C2400_GPF2_TXD0 (0x02 << 4)
726 489
727#define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3)
728#define S3C2410_GPF3_INP (0x00 << 6)
729#define S3C2410_GPF3_OUTP (0x01 << 6)
730#define S3C2410_GPF3_EINT3 (0x02 << 6) 490#define S3C2410_GPF3_EINT3 (0x02 << 6)
731#define S3C2400_GPF3_TXD1 (0x02 << 6) 491#define S3C2400_GPF3_TXD1 (0x02 << 6)
732#define S3C2400_GPF3_IICSCL (0x03 << 6) 492#define S3C2400_GPF3_IICSCL (0x03 << 6)
733 493
734#define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4)
735#define S3C2410_GPF4_INP (0x00 << 8)
736#define S3C2410_GPF4_OUTP (0x01 << 8)
737#define S3C2410_GPF4_EINT4 (0x02 << 8) 494#define S3C2410_GPF4_EINT4 (0x02 << 8)
738#define S3C2400_GPF4_nRTS0 (0x02 << 8) 495#define S3C2400_GPF4_nRTS0 (0x02 << 8)
739#define S3C2400_GPF4_nXBACK (0x03 << 8) 496#define S3C2400_GPF4_nXBACK (0x03 << 8)
740 497
741#define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5)
742#define S3C2410_GPF5_INP (0x00 << 10)
743#define S3C2410_GPF5_OUTP (0x01 << 10)
744#define S3C2410_GPF5_EINT5 (0x02 << 10) 498#define S3C2410_GPF5_EINT5 (0x02 << 10)
745#define S3C2400_GPF5_nCTS0 (0x02 << 10) 499#define S3C2400_GPF5_nCTS0 (0x02 << 10)
746#define S3C2400_GPF5_nXBREQ (0x03 << 10) 500#define S3C2400_GPF5_nXBREQ (0x03 << 10)
747 501
748#define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6)
749#define S3C2410_GPF6_INP (0x00 << 12)
750#define S3C2410_GPF6_OUTP (0x01 << 12)
751#define S3C2410_GPF6_EINT6 (0x02 << 12) 502#define S3C2410_GPF6_EINT6 (0x02 << 12)
752#define S3C2400_GPF6_CLKOUT (0x02 << 12) 503#define S3C2400_GPF6_CLKOUT (0x02 << 12)
753 504
754#define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7)
755#define S3C2410_GPF7_INP (0x00 << 14)
756#define S3C2410_GPF7_OUTP (0x01 << 14)
757#define S3C2410_GPF7_EINT7 (0x02 << 14) 505#define S3C2410_GPF7_EINT7 (0x02 << 14)
758 506
759#define S3C2410_GPF_PUPDIS(x) (1<<(x)) 507#define S3C2410_GPF_PUPDIS(x) (1<<(x))
@@ -778,117 +526,69 @@
778#define S3C2400_GPGDAT S3C2410_GPIOREG(0x48) 526#define S3C2400_GPGDAT S3C2410_GPIOREG(0x48)
779#define S3C2400_GPGUP S3C2410_GPIOREG(0x4C) 527#define S3C2400_GPGUP S3C2410_GPIOREG(0x4C)
780 528
781#define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0)
782#define S3C2410_GPG0_INP (0x00 << 0)
783#define S3C2410_GPG0_OUTP (0x01 << 0)
784#define S3C2410_GPG0_EINT8 (0x02 << 0) 529#define S3C2410_GPG0_EINT8 (0x02 << 0)
785#define S3C2400_GPG0_I2SLRCK (0x02 << 0) 530#define S3C2400_GPG0_I2SLRCK (0x02 << 0)
786 531
787#define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1)
788#define S3C2410_GPG1_INP (0x00 << 2)
789#define S3C2410_GPG1_OUTP (0x01 << 2)
790#define S3C2410_GPG1_EINT9 (0x02 << 2) 532#define S3C2410_GPG1_EINT9 (0x02 << 2)
791#define S3C2400_GPG1_I2SSCLK (0x02 << 2) 533#define S3C2400_GPG1_I2SSCLK (0x02 << 2)
792 534
793#define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2)
794#define S3C2410_GPG2_INP (0x00 << 4)
795#define S3C2410_GPG2_OUTP (0x01 << 4)
796#define S3C2410_GPG2_EINT10 (0x02 << 4) 535#define S3C2410_GPG2_EINT10 (0x02 << 4)
797#define S3C2410_GPG2_nSS0 (0x03 << 4) 536#define S3C2410_GPG2_nSS0 (0x03 << 4)
798#define S3C2400_GPG2_CDCLK (0x02 << 4) 537#define S3C2400_GPG2_CDCLK (0x02 << 4)
799 538
800#define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
801#define S3C2410_GPG3_INP (0x00 << 6)
802#define S3C2410_GPG3_OUTP (0x01 << 6)
803#define S3C2410_GPG3_EINT11 (0x02 << 6) 539#define S3C2410_GPG3_EINT11 (0x02 << 6)
804#define S3C2410_GPG3_nSS1 (0x03 << 6) 540#define S3C2410_GPG3_nSS1 (0x03 << 6)
805#define S3C2400_GPG3_I2SSDO (0x02 << 6) 541#define S3C2400_GPG3_I2SSDO (0x02 << 6)
806#define S3C2400_GPG3_I2SSDI (0x03 << 6) 542#define S3C2400_GPG3_I2SSDI (0x03 << 6)
807 543
808#define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4)
809#define S3C2410_GPG4_INP (0x00 << 8)
810#define S3C2410_GPG4_OUTP (0x01 << 8)
811#define S3C2410_GPG4_EINT12 (0x02 << 8) 544#define S3C2410_GPG4_EINT12 (0x02 << 8)
812#define S3C2400_GPG4_MMCCLK (0x02 << 8) 545#define S3C2400_GPG4_MMCCLK (0x02 << 8)
813#define S3C2400_GPG4_I2SSDI (0x03 << 8) 546#define S3C2400_GPG4_I2SSDI (0x03 << 8)
814#define S3C2410_GPG4_LCDPWREN (0x03 << 8) 547#define S3C2410_GPG4_LCDPWREN (0x03 << 8)
815#define S3C2443_GPG4_LCDPWRDN (0x03 << 8) 548#define S3C2443_GPG4_LCDPWRDN (0x03 << 8)
816 549
817#define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5)
818#define S3C2410_GPG5_INP (0x00 << 10)
819#define S3C2410_GPG5_OUTP (0x01 << 10)
820#define S3C2410_GPG5_EINT13 (0x02 << 10) 550#define S3C2410_GPG5_EINT13 (0x02 << 10)
821#define S3C2400_GPG5_MMCCMD (0x02 << 10) 551#define S3C2400_GPG5_MMCCMD (0x02 << 10)
822#define S3C2400_GPG5_IICSDA (0x03 << 10) 552#define S3C2400_GPG5_IICSDA (0x03 << 10)
823#define S3C2410_GPG5_SPIMISO1 (0x03 << 10) /* not s3c2443 */ 553#define S3C2410_GPG5_SPIMISO1 (0x03 << 10) /* not s3c2443 */
824 554
825#define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6)
826#define S3C2410_GPG6_INP (0x00 << 12)
827#define S3C2410_GPG6_OUTP (0x01 << 12)
828#define S3C2410_GPG6_EINT14 (0x02 << 12) 555#define S3C2410_GPG6_EINT14 (0x02 << 12)
829#define S3C2400_GPG6_MMCDAT (0x02 << 12) 556#define S3C2400_GPG6_MMCDAT (0x02 << 12)
830#define S3C2400_GPG6_IICSCL (0x03 << 12) 557#define S3C2400_GPG6_IICSCL (0x03 << 12)
831#define S3C2410_GPG6_SPIMOSI1 (0x03 << 12) 558#define S3C2410_GPG6_SPIMOSI1 (0x03 << 12)
832 559
833#define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7)
834#define S3C2410_GPG7_INP (0x00 << 14)
835#define S3C2410_GPG7_OUTP (0x01 << 14)
836#define S3C2410_GPG7_EINT15 (0x02 << 14) 560#define S3C2410_GPG7_EINT15 (0x02 << 14)
837#define S3C2410_GPG7_SPICLK1 (0x03 << 14) 561#define S3C2410_GPG7_SPICLK1 (0x03 << 14)
838#define S3C2400_GPG7_SPIMISO (0x02 << 14) 562#define S3C2400_GPG7_SPIMISO (0x02 << 14)
839#define S3C2400_GPG7_IICSDA (0x03 << 14) 563#define S3C2400_GPG7_IICSDA (0x03 << 14)
840 564
841#define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8)
842#define S3C2410_GPG8_INP (0x00 << 16)
843#define S3C2410_GPG8_OUTP (0x01 << 16)
844#define S3C2410_GPG8_EINT16 (0x02 << 16) 565#define S3C2410_GPG8_EINT16 (0x02 << 16)
845#define S3C2400_GPG8_SPIMOSI (0x02 << 16) 566#define S3C2400_GPG8_SPIMOSI (0x02 << 16)
846#define S3C2400_GPG8_IICSCL (0x03 << 16) 567#define S3C2400_GPG8_IICSCL (0x03 << 16)
847 568
848#define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9)
849#define S3C2410_GPG9_INP (0x00 << 18)
850#define S3C2410_GPG9_OUTP (0x01 << 18)
851#define S3C2410_GPG9_EINT17 (0x02 << 18) 569#define S3C2410_GPG9_EINT17 (0x02 << 18)
852#define S3C2400_GPG9_SPICLK (0x02 << 18) 570#define S3C2400_GPG9_SPICLK (0x02 << 18)
853#define S3C2400_GPG9_MMCCLK (0x03 << 18) 571#define S3C2400_GPG9_MMCCLK (0x03 << 18)
854 572
855#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
856#define S3C2410_GPG10_INP (0x00 << 20)
857#define S3C2410_GPG10_OUTP (0x01 << 20)
858#define S3C2410_GPG10_EINT18 (0x02 << 20) 573#define S3C2410_GPG10_EINT18 (0x02 << 20)
859 574
860#define S3C2410_GPG11 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 11)
861#define S3C2410_GPG11_INP (0x00 << 22)
862#define S3C2410_GPG11_OUTP (0x01 << 22)
863#define S3C2410_GPG11_EINT19 (0x02 << 22) 575#define S3C2410_GPG11_EINT19 (0x02 << 22)
864#define S3C2410_GPG11_TCLK1 (0x03 << 22) 576#define S3C2410_GPG11_TCLK1 (0x03 << 22)
865#define S3C2443_GPG11_CF_nIREQ (0x03 << 22) 577#define S3C2443_GPG11_CF_nIREQ (0x03 << 22)
866 578
867#define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12)
868#define S3C2410_GPG12_INP (0x00 << 24)
869#define S3C2410_GPG12_OUTP (0x01 << 24)
870#define S3C2410_GPG12_EINT20 (0x02 << 24) 579#define S3C2410_GPG12_EINT20 (0x02 << 24)
871#define S3C2410_GPG12_XMON (0x03 << 24) 580#define S3C2410_GPG12_XMON (0x03 << 24)
872#define S3C2442_GPG12_nSPICS0 (0x03 << 24) 581#define S3C2442_GPG12_nSPICS0 (0x03 << 24)
873#define S3C2443_GPG12_nINPACK (0x03 << 24) 582#define S3C2443_GPG12_nINPACK (0x03 << 24)
874 583
875#define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13)
876#define S3C2410_GPG13_INP (0x00 << 26)
877#define S3C2410_GPG13_OUTP (0x01 << 26)
878#define S3C2410_GPG13_EINT21 (0x02 << 26) 584#define S3C2410_GPG13_EINT21 (0x02 << 26)
879#define S3C2410_GPG13_nXPON (0x03 << 26) 585#define S3C2410_GPG13_nXPON (0x03 << 26)
880#define S3C2443_GPG13_CF_nREG (0x03 << 26) 586#define S3C2443_GPG13_CF_nREG (0x03 << 26)
881 587
882#define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14)
883#define S3C2410_GPG14_INP (0x00 << 28)
884#define S3C2410_GPG14_OUTP (0x01 << 28)
885#define S3C2410_GPG14_EINT22 (0x02 << 28) 588#define S3C2410_GPG14_EINT22 (0x02 << 28)
886#define S3C2410_GPG14_YMON (0x03 << 28) 589#define S3C2410_GPG14_YMON (0x03 << 28)
887#define S3C2443_GPG14_CF_RESET (0x03 << 28) 590#define S3C2443_GPG14_CF_RESET (0x03 << 28)
888 591
889#define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15)
890#define S3C2410_GPG15_INP (0x00 << 30)
891#define S3C2410_GPG15_OUTP (0x01 << 30)
892#define S3C2410_GPG15_EINT23 (0x02 << 30) 592#define S3C2410_GPG15_EINT23 (0x02 << 30)
893#define S3C2410_GPG15_nYPON (0x03 << 30) 593#define S3C2410_GPG15_nYPON (0x03 << 30)
894#define S3C2443_GPG15_CF_PWR (0x03 << 30) 594#define S3C2443_GPG15_CF_PWR (0x03 << 30)
@@ -907,62 +607,29 @@
907#define S3C2410_GPHDAT S3C2410_GPIOREG(0x74) 607#define S3C2410_GPHDAT S3C2410_GPIOREG(0x74)
908#define S3C2410_GPHUP S3C2410_GPIOREG(0x78) 608#define S3C2410_GPHUP S3C2410_GPIOREG(0x78)
909 609
910#define S3C2410_GPH0 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 0)
911#define S3C2410_GPH0_INP (0x00 << 0)
912#define S3C2410_GPH0_OUTP (0x01 << 0)
913#define S3C2410_GPH0_nCTS0 (0x02 << 0) 610#define S3C2410_GPH0_nCTS0 (0x02 << 0)
914 611
915#define S3C2410_GPH1 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 1)
916#define S3C2410_GPH1_INP (0x00 << 2)
917#define S3C2410_GPH1_OUTP (0x01 << 2)
918#define S3C2410_GPH1_nRTS0 (0x02 << 2) 612#define S3C2410_GPH1_nRTS0 (0x02 << 2)
919 613
920#define S3C2410_GPH2 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 2)
921#define S3C2410_GPH2_INP (0x00 << 4)
922#define S3C2410_GPH2_OUTP (0x01 << 4)
923#define S3C2410_GPH2_TXD0 (0x02 << 4) 614#define S3C2410_GPH2_TXD0 (0x02 << 4)
924 615
925#define S3C2410_GPH3 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 3)
926#define S3C2410_GPH3_INP (0x00 << 6)
927#define S3C2410_GPH3_OUTP (0x01 << 6)
928#define S3C2410_GPH3_RXD0 (0x02 << 6) 616#define S3C2410_GPH3_RXD0 (0x02 << 6)
929 617
930#define S3C2410_GPH4 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 4)
931#define S3C2410_GPH4_INP (0x00 << 8)
932#define S3C2410_GPH4_OUTP (0x01 << 8)
933#define S3C2410_GPH4_TXD1 (0x02 << 8) 618#define S3C2410_GPH4_TXD1 (0x02 << 8)
934 619
935#define S3C2410_GPH5 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 5)
936#define S3C2410_GPH5_INP (0x00 << 10)
937#define S3C2410_GPH5_OUTP (0x01 << 10)
938#define S3C2410_GPH5_RXD1 (0x02 << 10) 620#define S3C2410_GPH5_RXD1 (0x02 << 10)
939 621
940#define S3C2410_GPH6 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 6)
941#define S3C2410_GPH6_INP (0x00 << 12)
942#define S3C2410_GPH6_OUTP (0x01 << 12)
943#define S3C2410_GPH6_TXD2 (0x02 << 12) 622#define S3C2410_GPH6_TXD2 (0x02 << 12)
944#define S3C2410_GPH6_nRTS1 (0x03 << 12) 623#define S3C2410_GPH6_nRTS1 (0x03 << 12)
945 624
946#define S3C2410_GPH7 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 7)
947#define S3C2410_GPH7_INP (0x00 << 14)
948#define S3C2410_GPH7_OUTP (0x01 << 14)
949#define S3C2410_GPH7_RXD2 (0x02 << 14) 625#define S3C2410_GPH7_RXD2 (0x02 << 14)
950#define S3C2410_GPH7_nCTS1 (0x03 << 14) 626#define S3C2410_GPH7_nCTS1 (0x03 << 14)
951 627
952#define S3C2410_GPH8 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 8)
953#define S3C2410_GPH8_INP (0x00 << 16)
954#define S3C2410_GPH8_OUTP (0x01 << 16)
955#define S3C2410_GPH8_UCLK (0x02 << 16) 628#define S3C2410_GPH8_UCLK (0x02 << 16)
956 629
957#define S3C2410_GPH9 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 9)
958#define S3C2410_GPH9_INP (0x00 << 18)
959#define S3C2410_GPH9_OUTP (0x01 << 18)
960#define S3C2410_GPH9_CLKOUT0 (0x02 << 18) 630#define S3C2410_GPH9_CLKOUT0 (0x02 << 18)
961#define S3C2442_GPH9_nSPICS0 (0x03 << 18) 631#define S3C2442_GPH9_nSPICS0 (0x03 << 18)
962 632
963#define S3C2410_GPH10 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10)
964#define S3C2410_GPH10_INP (0x00 << 20)
965#define S3C2410_GPH10_OUTP (0x01 << 20)
966#define S3C2410_GPH10_CLKOUT1 (0x02 << 20) 633#define S3C2410_GPH10_CLKOUT1 (0x02 << 20)
967 634
968/* The S3C2412 and S3C2413 move the GPJ register set to after 635/* The S3C2412 and S3C2413 move the GPJ register set to after
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h
index b8687f71c304..6faadcee7729 100644
--- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
+++ b/arch/arm/mach-s3c2410/include/mach/system-reset.h
@@ -11,21 +11,13 @@
11*/ 11*/
12 12
13#include <mach/hardware.h> 13#include <mach/hardware.h>
14#include <linux/io.h> 14#include <plat/watchdog-reset.h>
15
16#include <plat/regs-watchdog.h>
17#include <mach/regs-clock.h>
18
19#include <linux/clk.h>
20#include <linux/err.h>
21 15
22extern void (*s3c24xx_reset_hook)(void); 16extern void (*s3c24xx_reset_hook)(void);
23 17
24static void 18static void
25arch_reset(char mode, const char *cmd) 19arch_reset(char mode, const char *cmd)
26{ 20{
27 struct clk *wdtclk;
28
29 if (mode == 's') { 21 if (mode == 's') {
30 cpu_reset(0); 22 cpu_reset(0);
31 } 23 }
@@ -33,31 +25,7 @@ arch_reset(char mode, const char *cmd)
33 if (s3c24xx_reset_hook) 25 if (s3c24xx_reset_hook)
34 s3c24xx_reset_hook(); 26 s3c24xx_reset_hook();
35 27
36 printk("arch_reset: attempting watchdog reset\n"); 28 arch_wdt_reset();
37
38 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
39
40 wdtclk = clk_get(NULL, "watchdog");
41 if (!IS_ERR(wdtclk)) {
42 clk_enable(wdtclk);
43 } else
44 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
45
46 /* put initial values into count and data */
47 __raw_writel(0x80, S3C2410_WTCNT);
48 __raw_writel(0x80, S3C2410_WTDAT);
49
50 /* set the watchdog to go and reset... */
51 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
52 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
53
54 /* wait for reset to assert... */
55 mdelay(500);
56
57 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
58
59 /* delay to allow the serial port to show the message */
60 mdelay(50);
61 29
62 /* we'll take a jump through zero as a poor second */ 30 /* we'll take a jump through zero as a poor second */
63 cpu_reset(0); 31 cpu_reset(0);
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 6d6995afeb43..06a84adfb13f 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -32,6 +32,7 @@
32#include <linux/list.h> 32#include <linux/list.h>
33#include <linux/timer.h> 33#include <linux/timer.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/gpio.h>
35#include <linux/device.h> 36#include <linux/device.h>
36#include <linux/platform_device.h> 37#include <linux/platform_device.h>
37#include <linux/proc_fs.h> 38#include <linux/proc_fs.h>
@@ -224,8 +225,8 @@ static void amlm5900_init_pm(void)
224 } else { 225 } else {
225 enable_irq_wake(IRQ_EINT9); 226 enable_irq_wake(IRQ_EINT9);
226 /* configure the suspend/resume status pin */ 227 /* configure the suspend/resume status pin */
227 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); 228 s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT);
228 s3c2410_gpio_pullup(S3C2410_GPF2, 0); 229 s3c2410_gpio_pullup(S3C2410_GPF(2), 0);
229 } 230 }
230} 231}
231static void __init amlm5900_init(void) 232static void __init amlm5900_init(void)
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 8637dea5e150..ce3baba2cd7f 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h>
19#include <linux/sysdev.h> 20#include <linux/sysdev.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
@@ -212,15 +213,15 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
212static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) 213static int bast_pm_suspend(struct sys_device *sd, pm_message_t state)
213{ 214{
214 /* ensure that an nRESET is not generated on resume. */ 215 /* ensure that an nRESET is not generated on resume. */
215 s3c2410_gpio_setpin(S3C2410_GPA21, 1); 216 s3c2410_gpio_setpin(S3C2410_GPA(21), 1);
216 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT); 217 s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT);
217 218
218 return 0; 219 return 0;
219} 220}
220 221
221static int bast_pm_resume(struct sys_device *sd) 222static int bast_pm_resume(struct sys_device *sd)
222{ 223{
223 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT); 224 s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
224 return 0; 225 return 0;
225} 226}
226 227
@@ -591,8 +592,6 @@ static void __init bast_map_io(void)
591 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 592 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
592 s3c24xx_init_clocks(0); 593 s3c24xx_init_clocks(0);
593 s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); 594 s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
594
595 usb_simtec_init();
596} 595}
597 596
598static void __init bast_init(void) 597static void __init bast_init(void)
@@ -607,6 +606,7 @@ static void __init bast_init(void)
607 i2c_register_board_info(0, bast_i2c_devs, 606 i2c_register_board_info(0, bast_i2c_devs,
608 ARRAY_SIZE(bast_i2c_devs)); 607 ARRAY_SIZE(bast_i2c_devs));
609 608
609 usb_simtec_init();
610 nor_simtec_init(); 610 nor_simtec_init();
611} 611}
612 612
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 7a7c4da4c256..d9cd5ddecf4a 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -127,7 +127,7 @@ static void h1940_udc_pullup(enum s3c2410_udc_cmd_e cmd)
127 127
128static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = { 128static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
129 .udc_command = h1940_udc_pullup, 129 .udc_command = h1940_udc_pullup,
130 .vbus_pin = S3C2410_GPG5, 130 .vbus_pin = S3C2410_GPG(5),
131 .vbus_pin_inverted = 1, 131 .vbus_pin_inverted = 1,
132}; 132};
133 133
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 2b83f8707710..0f6ed61af415 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -19,6 +19,7 @@
19 19
20#include <linux/gpio_keys.h> 20#include <linux/gpio_keys.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/gpio.h>
22#include <linux/input.h> 23#include <linux/input.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <linux/platform_device.h> 25#include <linux/platform_device.h>
@@ -85,10 +86,10 @@ static void n30_udc_pullup(enum s3c2410_udc_cmd_e cmd)
85{ 86{
86 switch (cmd) { 87 switch (cmd) {
87 case S3C2410_UDC_P_ENABLE : 88 case S3C2410_UDC_P_ENABLE :
88 s3c2410_gpio_setpin(S3C2410_GPB3, 1); 89 s3c2410_gpio_setpin(S3C2410_GPB(3), 1);
89 break; 90 break;
90 case S3C2410_UDC_P_DISABLE : 91 case S3C2410_UDC_P_DISABLE :
91 s3c2410_gpio_setpin(S3C2410_GPB3, 0); 92 s3c2410_gpio_setpin(S3C2410_GPB(3), 0);
92 break; 93 break;
93 case S3C2410_UDC_P_RESET : 94 case S3C2410_UDC_P_RESET :
94 break; 95 break;
@@ -99,55 +100,55 @@ static void n30_udc_pullup(enum s3c2410_udc_cmd_e cmd)
99 100
100static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = { 101static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = {
101 .udc_command = n30_udc_pullup, 102 .udc_command = n30_udc_pullup,
102 .vbus_pin = S3C2410_GPG1, 103 .vbus_pin = S3C2410_GPG(1),
103 .vbus_pin_inverted = 0, 104 .vbus_pin_inverted = 0,
104}; 105};
105 106
106static struct gpio_keys_button n30_buttons[] = { 107static struct gpio_keys_button n30_buttons[] = {
107 { 108 {
108 .gpio = S3C2410_GPF0, 109 .gpio = S3C2410_GPF(0),
109 .code = KEY_POWER, 110 .code = KEY_POWER,
110 .desc = "Power", 111 .desc = "Power",
111 .active_low = 0, 112 .active_low = 0,
112 }, 113 },
113 { 114 {
114 .gpio = S3C2410_GPG9, 115 .gpio = S3C2410_GPG(9),
115 .code = KEY_UP, 116 .code = KEY_UP,
116 .desc = "Thumbwheel Up", 117 .desc = "Thumbwheel Up",
117 .active_low = 0, 118 .active_low = 0,
118 }, 119 },
119 { 120 {
120 .gpio = S3C2410_GPG8, 121 .gpio = S3C2410_GPG(8),
121 .code = KEY_DOWN, 122 .code = KEY_DOWN,
122 .desc = "Thumbwheel Down", 123 .desc = "Thumbwheel Down",
123 .active_low = 0, 124 .active_low = 0,
124 }, 125 },
125 { 126 {
126 .gpio = S3C2410_GPG7, 127 .gpio = S3C2410_GPG(7),
127 .code = KEY_ENTER, 128 .code = KEY_ENTER,
128 .desc = "Thumbwheel Press", 129 .desc = "Thumbwheel Press",
129 .active_low = 0, 130 .active_low = 0,
130 }, 131 },
131 { 132 {
132 .gpio = S3C2410_GPF7, 133 .gpio = S3C2410_GPF(7),
133 .code = KEY_HOMEPAGE, 134 .code = KEY_HOMEPAGE,
134 .desc = "Home", 135 .desc = "Home",
135 .active_low = 0, 136 .active_low = 0,
136 }, 137 },
137 { 138 {
138 .gpio = S3C2410_GPF6, 139 .gpio = S3C2410_GPF(6),
139 .code = KEY_CALENDAR, 140 .code = KEY_CALENDAR,
140 .desc = "Calendar", 141 .desc = "Calendar",
141 .active_low = 0, 142 .active_low = 0,
142 }, 143 },
143 { 144 {
144 .gpio = S3C2410_GPF5, 145 .gpio = S3C2410_GPF(5),
145 .code = KEY_ADDRESSBOOK, 146 .code = KEY_ADDRESSBOOK,
146 .desc = "Contacts", 147 .desc = "Contacts",
147 .active_low = 0, 148 .active_low = 0,
148 }, 149 },
149 { 150 {
150 .gpio = S3C2410_GPF4, 151 .gpio = S3C2410_GPF(4),
151 .code = KEY_MAIL, 152 .code = KEY_MAIL,
152 .desc = "Mail", 153 .desc = "Mail",
153 .active_low = 0, 154 .active_low = 0,
@@ -169,73 +170,73 @@ static struct platform_device n30_button_device = {
169 170
170static struct gpio_keys_button n35_buttons[] = { 171static struct gpio_keys_button n35_buttons[] = {
171 { 172 {
172 .gpio = S3C2410_GPF0, 173 .gpio = S3C2410_GPF(0),
173 .code = KEY_POWER, 174 .code = KEY_POWER,
174 .desc = "Power", 175 .desc = "Power",
175 .active_low = 0, 176 .active_low = 0,
176 }, 177 },
177 { 178 {
178 .gpio = S3C2410_GPG9, 179 .gpio = S3C2410_GPG(9),
179 .code = KEY_UP, 180 .code = KEY_UP,
180 .desc = "Joystick Up", 181 .desc = "Joystick Up",
181 .active_low = 0, 182 .active_low = 0,
182 }, 183 },
183 { 184 {
184 .gpio = S3C2410_GPG8, 185 .gpio = S3C2410_GPG(8),
185 .code = KEY_DOWN, 186 .code = KEY_DOWN,
186 .desc = "Joystick Down", 187 .desc = "Joystick Down",
187 .active_low = 0, 188 .active_low = 0,
188 }, 189 },
189 { 190 {
190 .gpio = S3C2410_GPG6, 191 .gpio = S3C2410_GPG(6),
191 .code = KEY_DOWN, 192 .code = KEY_DOWN,
192 .desc = "Joystick Left", 193 .desc = "Joystick Left",
193 .active_low = 0, 194 .active_low = 0,
194 }, 195 },
195 { 196 {
196 .gpio = S3C2410_GPG5, 197 .gpio = S3C2410_GPG(5),
197 .code = KEY_DOWN, 198 .code = KEY_DOWN,
198 .desc = "Joystick Right", 199 .desc = "Joystick Right",
199 .active_low = 0, 200 .active_low = 0,
200 }, 201 },
201 { 202 {
202 .gpio = S3C2410_GPG7, 203 .gpio = S3C2410_GPG(7),
203 .code = KEY_ENTER, 204 .code = KEY_ENTER,
204 .desc = "Joystick Press", 205 .desc = "Joystick Press",
205 .active_low = 0, 206 .active_low = 0,
206 }, 207 },
207 { 208 {
208 .gpio = S3C2410_GPF7, 209 .gpio = S3C2410_GPF(7),
209 .code = KEY_HOMEPAGE, 210 .code = KEY_HOMEPAGE,
210 .desc = "Home", 211 .desc = "Home",
211 .active_low = 0, 212 .active_low = 0,
212 }, 213 },
213 { 214 {
214 .gpio = S3C2410_GPF6, 215 .gpio = S3C2410_GPF(6),
215 .code = KEY_CALENDAR, 216 .code = KEY_CALENDAR,
216 .desc = "Calendar", 217 .desc = "Calendar",
217 .active_low = 0, 218 .active_low = 0,
218 }, 219 },
219 { 220 {
220 .gpio = S3C2410_GPF5, 221 .gpio = S3C2410_GPF(5),
221 .code = KEY_ADDRESSBOOK, 222 .code = KEY_ADDRESSBOOK,
222 .desc = "Contacts", 223 .desc = "Contacts",
223 .active_low = 0, 224 .active_low = 0,
224 }, 225 },
225 { 226 {
226 .gpio = S3C2410_GPF4, 227 .gpio = S3C2410_GPF(4),
227 .code = KEY_MAIL, 228 .code = KEY_MAIL,
228 .desc = "Mail", 229 .desc = "Mail",
229 .active_low = 0, 230 .active_low = 0,
230 }, 231 },
231 { 232 {
232 .gpio = S3C2410_GPF3, 233 .gpio = S3C2410_GPF(3),
233 .code = SW_RADIO, 234 .code = SW_RADIO,
234 .desc = "GPS Antenna", 235 .desc = "GPS Antenna",
235 .active_low = 0, 236 .active_low = 0,
236 }, 237 },
237 { 238 {
238 .gpio = S3C2410_GPG2, 239 .gpio = S3C2410_GPG(2),
239 .code = SW_HEADPHONE_INSERT, 240 .code = SW_HEADPHONE_INSERT,
240 .desc = "Headphone", 241 .desc = "Headphone",
241 .active_low = 0, 242 .active_low = 0,
@@ -259,7 +260,7 @@ static struct platform_device n35_button_device = {
259/* This is the bluetooth LED on the device. */ 260/* This is the bluetooth LED on the device. */
260static struct s3c24xx_led_platdata n30_blue_led_pdata = { 261static struct s3c24xx_led_platdata n30_blue_led_pdata = {
261 .name = "blue_led", 262 .name = "blue_led",
262 .gpio = S3C2410_GPG6, 263 .gpio = S3C2410_GPG(6),
263 .def_trigger = "", 264 .def_trigger = "",
264}; 265};
265 266
@@ -270,7 +271,7 @@ static struct s3c24xx_led_platdata n30_blue_led_pdata = {
270static struct s3c24xx_led_platdata n30_warning_led_pdata = { 271static struct s3c24xx_led_platdata n30_warning_led_pdata = {
271 .name = "warning_led", 272 .name = "warning_led",
272 .flags = S3C24XX_LEDF_ACTLOW, 273 .flags = S3C24XX_LEDF_ACTLOW,
273 .gpio = S3C2410_GPD9, 274 .gpio = S3C2410_GPD(9),
274 .def_trigger = "", 275 .def_trigger = "",
275}; 276};
276 277
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 9f1ba9b63f70..2cc9849eb448 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -27,6 +27,7 @@
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/gpio.h>
30#include <linux/sysdev.h> 31#include <linux/sysdev.h>
31#include <linux/platform_device.h> 32#include <linux/platform_device.h>
32#include <linux/serial_core.h> 33#include <linux/serial_core.h>
@@ -198,7 +199,7 @@ static struct platform_device qt2410_cs89x0 = {
198/* LED */ 199/* LED */
199 200
200static struct s3c24xx_led_platdata qt2410_pdata_led = { 201static struct s3c24xx_led_platdata qt2410_pdata_led = {
201 .gpio = S3C2410_GPB0, 202 .gpio = S3C2410_GPB(0),
202 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 203 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
203 .name = "led", 204 .name = "led",
204 .def_trigger = "timer", 205 .def_trigger = "timer",
@@ -218,18 +219,18 @@ static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs)
218{ 219{
219 switch (cs) { 220 switch (cs) {
220 case BITBANG_CS_ACTIVE: 221 case BITBANG_CS_ACTIVE:
221 s3c2410_gpio_setpin(S3C2410_GPB5, 0); 222 s3c2410_gpio_setpin(S3C2410_GPB(5), 0);
222 break; 223 break;
223 case BITBANG_CS_INACTIVE: 224 case BITBANG_CS_INACTIVE:
224 s3c2410_gpio_setpin(S3C2410_GPB5, 1); 225 s3c2410_gpio_setpin(S3C2410_GPB(5), 1);
225 break; 226 break;
226 } 227 }
227} 228}
228 229
229static struct s3c2410_spigpio_info spi_gpio_cfg = { 230static struct s3c2410_spigpio_info spi_gpio_cfg = {
230 .pin_clk = S3C2410_GPG7, 231 .pin_clk = S3C2410_GPG(7),
231 .pin_mosi = S3C2410_GPG6, 232 .pin_mosi = S3C2410_GPG(6),
232 .pin_miso = S3C2410_GPG5, 233 .pin_miso = S3C2410_GPG(5),
233 .chip_select = &spi_gpio_cs, 234 .chip_select = &spi_gpio_cs,
234}; 235};
235 236
@@ -346,13 +347,13 @@ static void __init qt2410_machine_init(void)
346 } 347 }
347 s3c24xx_fb_set_platdata(&qt2410_fb_info); 348 s3c24xx_fb_set_platdata(&qt2410_fb_info);
348 349
349 s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPIO_OUTPUT); 350 s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPIO_OUTPUT);
350 s3c2410_gpio_setpin(S3C2410_GPB0, 1); 351 s3c2410_gpio_setpin(S3C2410_GPB(0), 1);
351 352
352 s3c24xx_udc_set_platdata(&qt2410_udc_cfg); 353 s3c24xx_udc_set_platdata(&qt2410_udc_cfg);
353 s3c_i2c0_set_platdata(NULL); 354 s3c_i2c0_set_platdata(NULL);
354 355
355 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT); 356 s3c2410_gpio_cfgpin(S3C2410_GPB(5), S3C2410_GPIO_OUTPUT);
356 357
357 platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); 358 platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices));
358 s3c_pm_init(); 359 s3c_pm_init();
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 61a1ea9c5c5c..1628cc773a2c 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -18,6 +18,7 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h>
21#include <linux/dm9000.h> 22#include <linux/dm9000.h>
22#include <linux/i2c.h> 23#include <linux/i2c.h>
23 24
@@ -277,19 +278,19 @@ static struct platform_device vr1000_dm9k1 = {
277 278
278static struct s3c24xx_led_platdata vr1000_led1_pdata = { 279static struct s3c24xx_led_platdata vr1000_led1_pdata = {
279 .name = "led1", 280 .name = "led1",
280 .gpio = S3C2410_GPB0, 281 .gpio = S3C2410_GPB(0),
281 .def_trigger = "", 282 .def_trigger = "",
282}; 283};
283 284
284static struct s3c24xx_led_platdata vr1000_led2_pdata = { 285static struct s3c24xx_led_platdata vr1000_led2_pdata = {
285 .name = "led2", 286 .name = "led2",
286 .gpio = S3C2410_GPB1, 287 .gpio = S3C2410_GPB(1),
287 .def_trigger = "", 288 .def_trigger = "",
288}; 289};
289 290
290static struct s3c24xx_led_platdata vr1000_led3_pdata = { 291static struct s3c24xx_led_platdata vr1000_led3_pdata = {
291 .name = "led3", 292 .name = "led3",
292 .gpio = S3C2410_GPB2, 293 .gpio = S3C2410_GPB(2),
293 .def_trigger = "", 294 .def_trigger = "",
294}; 295};
295 296
@@ -355,8 +356,8 @@ static struct clk *vr1000_clocks[] __initdata = {
355 356
356static void vr1000_power_off(void) 357static void vr1000_power_off(void)
357{ 358{
358 s3c2410_gpio_cfgpin(S3C2410_GPB9, S3C2410_GPB9_OUTP); 359 s3c2410_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_OUTPUT);
359 s3c2410_gpio_setpin(S3C2410_GPB9, 1); 360 s3c2410_gpio_setpin(S3C2410_GPB(9), 1);
360} 361}
361 362
362static void __init vr1000_map_io(void) 363static void __init vr1000_map_io(void)
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index 87fc481d92d4..143e08a599d4 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -25,6 +25,7 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/sysdev.h> 27#include <linux/sysdev.h>
28#include <linux/gpio.h>
28#include <linux/io.h> 29#include <linux/io.h>
29 30
30#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -76,7 +77,7 @@ static void s3c2410_pm_prepare(void)
76 } 77 }
77 78
78 if ( machine_is_aml_m5900() ) 79 if ( machine_is_aml_m5900() )
79 s3c2410_gpio_setpin(S3C2410_GPF2, 1); 80 s3c2410_gpio_setpin(S3C2410_GPF(2), 1);
80 81
81} 82}
82 83
@@ -91,7 +92,7 @@ static int s3c2410_pm_resume(struct sys_device *dev)
91 __raw_writel(tmp, S3C2410_GSTATUS2); 92 __raw_writel(tmp, S3C2410_GSTATUS2);
92 93
93 if ( machine_is_aml_m5900() ) 94 if ( machine_is_aml_m5900() )
94 s3c2410_gpio_setpin(S3C2410_GPF2, 0); 95 s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
95 96
96 return 0; 97 return 0;
97} 98}
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 8331e8d97e20..6cd9377ddb82 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -18,9 +18,11 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/gpio.h>
21#include <linux/timer.h> 22#include <linux/timer.h>
22#include <linux/init.h> 23#include <linux/init.h>
23#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/gpio.h>
24#include <linux/io.h> 26#include <linux/io.h>
25 27
26#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -29,7 +31,6 @@
29 31
30#include <mach/bast-map.h> 32#include <mach/bast-map.h>
31#include <mach/bast-irq.h> 33#include <mach/bast-irq.h>
32#include <mach/regs-gpio.h>
33 34
34#include <mach/hardware.h> 35#include <mach/hardware.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
@@ -53,9 +54,9 @@ usb_simtec_powercontrol(int port, int to)
53 power_state[port] = to; 54 power_state[port] = to;
54 55
55 if (power_state[0] && power_state[1]) 56 if (power_state[0] && power_state[1])
56 s3c2410_gpio_setpin(S3C2410_GPB4, 0); 57 gpio_set_value(S3C2410_GPB(4), 0);
57 else 58 else
58 s3c2410_gpio_setpin(S3C2410_GPB4, 1); 59 gpio_set_value(S3C2410_GPB(4), 1);
59} 60}
60 61
61static irqreturn_t 62static irqreturn_t
@@ -63,7 +64,7 @@ usb_simtec_ocirq(int irq, void *pw)
63{ 64{
64 struct s3c2410_hcd_info *info = pw; 65 struct s3c2410_hcd_info *info = pw;
65 66
66 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { 67 if (gpio_get_value(S3C2410_GPG(10)) == 0) {
67 pr_debug("usb_simtec: over-current irq (oc detected)\n"); 68 pr_debug("usb_simtec: over-current irq (oc detected)\n");
68 s3c2410_usb_report_oc(info, 3); 69 s3c2410_usb_report_oc(info, 3);
69 } else { 70 } else {
@@ -106,10 +107,27 @@ static struct s3c2410_hcd_info usb_simtec_info = {
106 107
107int usb_simtec_init(void) 108int usb_simtec_init(void)
108{ 109{
110 int ret;
111
109 printk("USB Power Control, (c) 2004 Simtec Electronics\n"); 112 printk("USB Power Control, (c) 2004 Simtec Electronics\n");
110 s3c_device_usb.dev.platform_data = &usb_simtec_info;
111 113
112 s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP); 114 ret = gpio_request(S3C2410_GPB(4), "USB power control");
113 s3c2410_gpio_setpin(S3C2410_GPB4, 1); 115 if (ret < 0) {
116 pr_err("%s: failed to get GPB4\n", __func__);
117 return ret;
118 }
119
120 ret = gpio_request(S3C2410_GPG(10), "USB overcurrent");
121 if (ret < 0) {
122 pr_err("%s: failed to get GPG10\n", __func__);
123 gpio_free(S3C2410_GPB(4));
124 return ret;
125 }
126
127 /* turn power on */
128 gpio_direction_output(S3C2410_GPB(4), 1);
129 gpio_direction_input(S3C2410_GPG(10));
130
131 s3c_device_usb.dev.platform_data = &usb_simtec_info;
114 return 0; 132 return 0;
115} 133}
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index ca99564ae4b5..63586ffd0ae7 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -38,6 +38,7 @@ menu "S3C2412 Machines"
38config MACH_JIVE 38config MACH_JIVE
39 bool "Logitech Jive" 39 bool "Logitech Jive"
40 select CPU_S3C2412 40 select CPU_S3C2412
41 select S3C_DEV_USB_HOST
41 help 42 help
42 Say Y here if you are using the Logitech Jive. 43 Say Y here if you are using the Logitech Jive.
43 44
@@ -50,6 +51,7 @@ config MACH_SMDK2413
50 select CPU_S3C2412 51 select CPU_S3C2412
51 select MACH_S3C2413 52 select MACH_S3C2413
52 select MACH_SMDK 53 select MACH_SMDK
54 select S3C_DEV_USB_HOST
53 help 55 help
54 Say Y here if you are using an SMDK2413 56 Say Y here if you are using an SMDK2413
55 57
@@ -72,6 +74,7 @@ config MACH_SMDK2412
72config MACH_VSTMS 74config MACH_VSTMS
73 bool "VMSTMS" 75 bool "VMSTMS"
74 select CPU_S3C2412 76 select CPU_S3C2412
77 select S3C_DEV_USB_HOST
75 help 78 help
76 Say Y here if you are using an VSTMS board 79 Say Y here if you are using an VSTMS board
77 80
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index 9e3478506c6f..f8d16fc10bc6 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -20,12 +20,13 @@
20 20
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include <plat/dma.h> 23#include <plat/dma-plat.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h>
29#include <mach/regs-mem.h> 30#include <mach/regs-mem.h>
30#include <mach/regs-lcd.h> 31#include <mach/regs-lcd.h>
31#include <mach/regs-sdi.h> 32#include <mach/regs-sdi.h>
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 8f0d37d43b43..8df506eac903 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h>
19#include <linux/sysdev.h> 20#include <linux/sysdev.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
@@ -356,8 +357,8 @@ static void jive_lcm_reset(unsigned int set)
356{ 357{
357 printk(KERN_DEBUG "%s(%d)\n", __func__, set); 358 printk(KERN_DEBUG "%s(%d)\n", __func__, set);
358 359
359 s3c2410_gpio_setpin(S3C2410_GPG13, set); 360 s3c2410_gpio_setpin(S3C2410_GPG(13), set);
360 s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPIO_OUTPUT); 361 s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT);
361} 362}
362 363
363#undef LCD_UPPER_MARGIN 364#undef LCD_UPPER_MARGIN
@@ -390,13 +391,13 @@ static struct ili9320_platdata jive_lcm_config = {
390 391
391static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) 392static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs)
392{ 393{
393 s3c2410_gpio_setpin(S3C2410_GPB7, cs ? 0 : 1); 394 s3c2410_gpio_setpin(S3C2410_GPB(7), cs ? 0 : 1);
394} 395}
395 396
396static struct s3c2410_spigpio_info jive_lcd_spi = { 397static struct s3c2410_spigpio_info jive_lcd_spi = {
397 .bus_num = 1, 398 .bus_num = 1,
398 .pin_clk = S3C2410_GPG8, 399 .pin_clk = S3C2410_GPG(8),
399 .pin_mosi = S3C2410_GPB8, 400 .pin_mosi = S3C2410_GPB(8),
400 .num_chipselect = 1, 401 .num_chipselect = 1,
401 .chip_select = jive_lcd_spi_chipselect, 402 .chip_select = jive_lcd_spi_chipselect,
402}; 403};
@@ -412,13 +413,13 @@ static struct platform_device jive_device_lcdspi = {
412 413
413static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs) 414static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs)
414{ 415{
415 s3c2410_gpio_setpin(S3C2410_GPH10, cs ? 0 : 1); 416 s3c2410_gpio_setpin(S3C2410_GPH(10), cs ? 0 : 1);
416} 417}
417 418
418static struct s3c2410_spigpio_info jive_wm8750_spi = { 419static struct s3c2410_spigpio_info jive_wm8750_spi = {
419 .bus_num = 2, 420 .bus_num = 2,
420 .pin_clk = S3C2410_GPB4, 421 .pin_clk = S3C2410_GPB(4),
421 .pin_mosi = S3C2410_GPB9, 422 .pin_mosi = S3C2410_GPB(9),
422 .num_chipselect = 1, 423 .num_chipselect = 1,
423 .chip_select = jive_wm8750_chipselect, 424 .chip_select = jive_wm8750_chipselect,
424}; 425};
@@ -479,7 +480,7 @@ static struct platform_device *jive_devices[] __initdata = {
479}; 480};
480 481
481static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = { 482static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = {
482 .vbus_pin = S3C2410_GPG1, /* detect is on GPG1 */ 483 .vbus_pin = S3C2410_GPG(1), /* detect is on GPG1 */
483}; 484};
484 485
485/* Jive power management device */ 486/* Jive power management device */
@@ -529,8 +530,8 @@ static void jive_power_off(void)
529{ 530{
530 printk(KERN_INFO "powering system down...\n"); 531 printk(KERN_INFO "powering system down...\n");
531 532
532 s3c2410_gpio_setpin(S3C2410_GPC5, 1); 533 s3c2410_gpio_setpin(S3C2410_GPC(5), 1);
533 s3c2410_gpio_cfgpin(S3C2410_GPC5, S3C2410_GPIO_OUTPUT); 534 s3c2410_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT);
534} 535}
535 536
536static void __init jive_machine_init(void) 537static void __init jive_machine_init(void)
@@ -634,22 +635,22 @@ static void __init jive_machine_init(void)
634 635
635 /* initialise the spi */ 636 /* initialise the spi */
636 637
637 s3c2410_gpio_setpin(S3C2410_GPG13, 0); 638 s3c2410_gpio_setpin(S3C2410_GPG(13), 0);
638 s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPIO_OUTPUT); 639 s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT);
639 640
640 s3c2410_gpio_setpin(S3C2410_GPB7, 1); 641 s3c2410_gpio_setpin(S3C2410_GPB(7), 1);
641 s3c2410_gpio_cfgpin(S3C2410_GPB7, S3C2410_GPIO_OUTPUT); 642 s3c2410_gpio_cfgpin(S3C2410_GPB(7), S3C2410_GPIO_OUTPUT);
642 643
643 s3c2410_gpio_setpin(S3C2410_GPB6, 0); 644 s3c2410_gpio_setpin(S3C2410_GPB(6), 0);
644 s3c2410_gpio_cfgpin(S3C2410_GPB6, S3C2410_GPIO_OUTPUT); 645 s3c2410_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT);
645 646
646 s3c2410_gpio_setpin(S3C2410_GPG8, 1); 647 s3c2410_gpio_setpin(S3C2410_GPG(8), 1);
647 s3c2410_gpio_cfgpin(S3C2410_GPG8, S3C2410_GPIO_OUTPUT); 648 s3c2410_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT);
648 649
649 /* initialise the WM8750 spi */ 650 /* initialise the WM8750 spi */
650 651
651 s3c2410_gpio_setpin(S3C2410_GPH10, 1); 652 s3c2410_gpio_setpin(S3C2410_GPH(10), 1);
652 s3c2410_gpio_cfgpin(S3C2410_GPH10, S3C2410_GPIO_OUTPUT); 653 s3c2410_gpio_cfgpin(S3C2410_GPH(10), S3C2410_GPIO_OUTPUT);
653 654
654 /* Turn off suspend on both USB ports, and switch the 655 /* Turn off suspend on both USB ports, and switch the
655 * selectable USB port to USB device mode. */ 656 * selectable USB port to USB device mode. */
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index eba66aa6bd20..9a5e43419722 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -17,6 +17,7 @@
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/gpio.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/io.h> 23#include <linux/io.h>
@@ -84,10 +85,10 @@ static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd)
84 switch (cmd) 85 switch (cmd)
85 { 86 {
86 case S3C2410_UDC_P_ENABLE : 87 case S3C2410_UDC_P_ENABLE :
87 s3c2410_gpio_setpin(S3C2410_GPF2, 1); 88 s3c2410_gpio_setpin(S3C2410_GPF(2), 1);
88 break; 89 break;
89 case S3C2410_UDC_P_DISABLE : 90 case S3C2410_UDC_P_DISABLE :
90 s3c2410_gpio_setpin(S3C2410_GPF2, 0); 91 s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
91 break; 92 break;
92 case S3C2410_UDC_P_RESET : 93 case S3C2410_UDC_P_RESET :
93 break; 94 break;
@@ -134,8 +135,8 @@ static void __init smdk2413_machine_init(void)
134{ /* Turn off suspend on both USB ports, and switch the 135{ /* Turn off suspend on both USB ports, and switch the
135 * selectable USB port to USB device mode. */ 136 * selectable USB port to USB device mode. */
136 137
137 s3c2410_gpio_setpin(S3C2410_GPF2, 0); 138 s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
138 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPIO_OUTPUT); 139 s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT);
139 140
140 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | 141 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
141 S3C2410_MISCCR_USBSUSPND0 | 142 S3C2410_MISCCR_USBSUSPND0 |
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index cde5ae9a4340..5df73cbf2b40 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -33,6 +33,7 @@ config MACH_ANUBIS
33 select PM_SIMTEC if PM 33 select PM_SIMTEC if PM
34 select HAVE_PATA_PLATFORM 34 select HAVE_PATA_PLATFORM
35 select S3C24XX_GPIO_EXTRA64 35 select S3C24XX_GPIO_EXTRA64
36 select S3C_DEV_USB_HOST
36 help 37 help
37 Say Y here if you are using the Simtec Electronics ANUBIS 38 Say Y here if you are using the Simtec Electronics ANUBIS
38 development system 39 development system
@@ -43,6 +44,7 @@ config MACH_OSIRIS
43 select S3C24XX_DCLK 44 select S3C24XX_DCLK
44 select PM_SIMTEC if PM 45 select PM_SIMTEC if PM
45 select S3C24XX_GPIO_EXTRA128 46 select S3C24XX_GPIO_EXTRA128
47 select S3C_DEV_USB_HOST
46 help 48 help
47 Say Y here if you are using the Simtec IM2440D20 module, also 49 Say Y here if you are using the Simtec IM2440D20 module, also
48 known as the Osiris. 50 known as the Osiris.
@@ -58,12 +60,14 @@ config ARCH_S3C2440
58 bool "SMDK2440" 60 bool "SMDK2440"
59 select CPU_S3C2440 61 select CPU_S3C2440
60 select MACH_SMDK 62 select MACH_SMDK
63 select S3C_DEV_USB_HOST
61 help 64 help
62 Say Y here if you are using the SMDK2440. 65 Say Y here if you are using the SMDK2440.
63 66
64config MACH_NEXCODER_2440 67config MACH_NEXCODER_2440
65 bool "NexVision NEXCODER 2440 Light Board" 68 bool "NexVision NEXCODER 2440 Light Board"
66 select CPU_S3C2440 69 select CPU_S3C2440
70 select S3C_DEV_USB_HOST
67 help 71 help
68 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board 72 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
69 73
@@ -76,6 +80,7 @@ config SMDK2440_CPU2440
76config MACH_AT2440EVB 80config MACH_AT2440EVB
77 bool "Avantech AT2440EVB development board" 81 bool "Avantech AT2440EVB development board"
78 select CPU_S3C2440 82 select CPU_S3C2440
83 select S3C_DEV_USB_HOST
79 help 84 help
80 Say Y here if you are using the AT2440EVB development board 85 Say Y here if you are using the AT2440EVB development board
81 86
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
index 69b6cf34df47..e08e081430f0 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c2440/dma.c
@@ -17,14 +17,16 @@
17#include <linux/sysdev.h> 17#include <linux/sysdev.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19 19
20#include <mach/map.h>
20#include <mach/dma.h> 21#include <mach/dma.h>
21 22
22#include <plat/dma.h> 23#include <plat/dma-plat.h>
23#include <plat/cpu.h> 24#include <plat/cpu.h>
24 25
25#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
26#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
27#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h>
28#include <mach/regs-mem.h> 30#include <mach/regs-mem.h>
29#include <mach/regs-lcd.h> 31#include <mach/regs-lcd.h>
30#include <mach/regs-sdi.h> 32#include <mach/regs-sdi.h>
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 9c6abf9fb540..68f3870991bf 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -15,6 +15,7 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/gpio.h>
18#include <linux/serial_core.h> 19#include <linux/serial_core.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/ata_platform.h> 21#include <linux/ata_platform.h>
@@ -468,7 +469,7 @@ static void __init anubis_map_io(void)
468 anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large); 469 anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large);
469 } else { 470 } else {
470 /* ensure that the GPIO is setup */ 471 /* ensure that the GPIO is setup */
471 s3c2410_gpio_setpin(S3C2410_GPA0, 1); 472 s3c2410_gpio_setpin(S3C2410_GPA(0), 1);
472 } 473 }
473} 474}
474 475
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index 315c42e31278..dfc7010935da 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -166,7 +166,7 @@ static struct platform_device at2440evb_device_eth = {
166}; 166};
167 167
168static struct s3c24xx_mci_pdata at2440evb_mci_pdata = { 168static struct s3c24xx_mci_pdata at2440evb_mci_pdata = {
169 .gpio_detect = S3C2410_GPG10, 169 .gpio_detect = S3C2410_GPG(10),
170}; 170};
171 171
172/* 7" LCD panel */ 172/* 7" LCD panel */
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index 7aeaa972d7f5..d43edede590e 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -18,6 +18,7 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h>
21#include <linux/string.h> 22#include <linux/string.h>
22#include <linux/serial_core.h> 23#include <linux/serial_core.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
@@ -120,16 +121,16 @@ static struct platform_device *nexcoder_devices[] __initdata = {
120static void __init nexcoder_sensorboard_init(void) 121static void __init nexcoder_sensorboard_init(void)
121{ 122{
122 // Initialize SCCB bus 123 // Initialize SCCB bus
123 s3c2410_gpio_setpin(S3C2410_GPE14, 1); // IICSCL 124 s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL
124 s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_OUTP); 125 s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT);
125 s3c2410_gpio_setpin(S3C2410_GPE15, 1); // IICSDA 126 s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA
126 s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_OUTP); 127 s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT);
127 128
128 // Power up the sensor board 129 // Power up the sensor board
129 s3c2410_gpio_setpin(S3C2410_GPF1, 1); 130 s3c2410_gpio_setpin(S3C2410_GPF(1), 1);
130 s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_OUTP); // CAM_GPIO7 => nLDO_PWRDN 131 s3c2410_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN
131 s3c2410_gpio_setpin(S3C2410_GPF2, 0); 132 s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
132 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN 133 s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN
133} 134}
134 135
135static void __init nexcoder_map_io(void) 136static void __init nexcoder_map_io(void)
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index c8a46685ce38..cba064b49a64 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -15,6 +15,7 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/gpio.h>
18#include <linux/device.h> 19#include <linux/device.h>
19#include <linux/sysdev.h> 20#include <linux/sysdev.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
@@ -291,8 +292,8 @@ static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state)
291 __raw_writeb(tmp, OSIRIS_VA_CTRL0); 292 __raw_writeb(tmp, OSIRIS_VA_CTRL0);
292 293
293 /* ensure that an nRESET is not generated on resume. */ 294 /* ensure that an nRESET is not generated on resume. */
294 s3c2410_gpio_setpin(S3C2410_GPA21, 1); 295 s3c2410_gpio_setpin(S3C2410_GPA(21), 1);
295 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT); 296 s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT);
296 297
297 return 0; 298 return 0;
298} 299}
@@ -304,7 +305,7 @@ static int osiris_pm_resume(struct sys_device *sd)
304 305
305 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); 306 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0);
306 307
307 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT); 308 s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
308 309
309 return 0; 310 return 0;
310} 311}
@@ -384,7 +385,7 @@ static void __init osiris_map_io(void)
384 osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large); 385 osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large);
385 } else { 386 } else {
386 /* write-protect line to the NAND */ 387 /* write-protect line to the NAND */
387 s3c2410_gpio_setpin(S3C2410_GPA0, 1); 388 s3c2410_gpio_setpin(S3C2410_GPA(0), 1);
388 } 389 }
389 390
390 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */ 391 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
index 8430e5829186..397f3b5c0b47 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c2443/dma.c
@@ -20,12 +20,13 @@
20 20
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include <plat/dma.h> 23#include <plat/dma-plat.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h>
29#include <mach/regs-mem.h> 30#include <mach/regs-mem.h>
30#include <mach/regs-lcd.h> 31#include <mach/regs-lcd.h>
31#include <mach/regs-sdi.h> 32#include <mach/regs-sdi.h>
diff --git a/arch/arm/mach-s3c6400/Kconfig b/arch/arm/mach-s3c6400/Kconfig
index 6da82b5c09ba..f5af212066c3 100644
--- a/arch/arm/mach-s3c6400/Kconfig
+++ b/arch/arm/mach-s3c6400/Kconfig
@@ -5,4 +5,27 @@
5# 5#
6# Licensed under GPLv2 6# Licensed under GPLv2
7 7
8# Currently nothing here, this will be added later 8# Configuration options for the S3C6410 CPU
9
10config CPU_S3C6400
11 bool
12 select CPU_S3C6400_INIT
13 select CPU_S3C6400_CLOCK
14 help
15 Enable S3C6400 CPU support
16
17config S3C6400_SETUP_SDHCI
18 bool
19 help
20 Internal configuration for default SDHCI
21 setup for S3C6400.
22
23# S36400 Macchine support
24
25config MACH_SMDK6400
26 bool "SMDK6400"
27 select CPU_S3C6400
28 select S3C_DEV_HSMMC
29 select S3C6400_SETUP_SDHCI
30 help
31 Machine support for the Samsung SMDK6400
diff --git a/arch/arm/mach-s3c6400/Makefile b/arch/arm/mach-s3c6400/Makefile
index 8f397db25b87..df1ce4aa03e5 100644
--- a/arch/arm/mach-s3c6400/Makefile
+++ b/arch/arm/mach-s3c6400/Makefile
@@ -12,4 +12,12 @@ obj- :=
12 12
13# Core support for S3C6400 system 13# Core support for S3C6400 system
14 14
15obj-n += blank.o 15obj-$(CONFIG_CPU_S3C6400) += s3c6400.o
16
17# setup support
18
19obj-$(CONFIG_S3C6400_SETUP_SDHCI) += setup-sdhci.o
20
21# Machine support
22
23obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
diff --git a/arch/arm/mach-s3c6400/include/mach/dma.h b/arch/arm/mach-s3c6400/include/mach/dma.h
index 9771ac2cb07e..1067619f0ba0 100644
--- a/arch/arm/mach-s3c6400/include/mach/dma.h
+++ b/arch/arm/mach-s3c6400/include/mach/dma.h
@@ -11,6 +11,63 @@
11#ifndef __ASM_ARCH_DMA_H 11#ifndef __ASM_ARCH_DMA_H
12#define __ASM_ARCH_DMA_H __FILE__ 12#define __ASM_ARCH_DMA_H __FILE__
13 13
14/* currently nothing here, placeholder */ 14#define S3C_DMA_CHANNELS (16)
15
16/* see mach-s3c2410/dma.h for notes on dma channel numbers */
17
18/* Note, for the S3C64XX architecture we keep the DMACH_
19 * defines in the order they are allocated to [S]DMA0/[S]DMA1
20 * so that is easy to do DHACH_ -> DMA controller conversion
21 */
22enum dma_ch {
23 /* DMA0/SDMA0 */
24 DMACH_UART0 = 0,
25 DMACH_UART0_SRC2,
26 DMACH_UART1,
27 DMACH_UART1_SRC2,
28 DMACH_UART2,
29 DMACH_UART2_SRC2,
30 DMACH_UART3,
31 DMACH_UART3_SRC2,
32 DMACH_PCM0_TX,
33 DMACH_PCM0_RX,
34 DMACH_I2S0_OUT,
35 DMACH_I2S0_IN,
36 DMACH_SPI0_TX,
37 DMACH_SPI0_RX,
38 DMACH_HSI_I2SV40_TX,
39 DMACH_HSI_I2SV40_RX,
40
41 /* DMA1/SDMA1 */
42 DMACH_PCM1_TX = 16,
43 DMACH_PCM1_RX,
44 DMACH_I2S1_OUT,
45 DMACH_I2S1_IN,
46 DMACH_SPI1_TX,
47 DMACH_SPI1_RX,
48 DMACH_AC97_PCMOUT,
49 DMACH_AC97_PCMIN,
50 DMACH_AC97_MICIN,
51 DMACH_PWM,
52 DMACH_IRDA,
53 DMACH_EXTERNAL,
54 DMACH_RES1,
55 DMACH_RES2,
56 DMACH_SECURITY_RX, /* SDMA1 only */
57 DMACH_SECURITY_TX, /* SDMA1 only */
58 DMACH_MAX /* the end */
59};
60
61static __inline__ int s3c_dma_has_circular(void)
62{
63 /* we will be supporting ciruclar buffers as soon as we have DMA
64 * engine support.
65 */
66 return 1;
67}
68
69#define S3C2410_DMAF_CIRCULAR (1 << 0)
70
71#include <plat/dma.h>
15 72
16#endif /* __ASM_ARCH_IRQ_H */ 73#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index 8199972ed5bd..5057d9948d35 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -39,6 +39,8 @@
39#define S3C_VA_UART3 S3C_VA_UARTx(3) 39#define S3C_VA_UART3 S3C_VA_UARTx(3)
40 40
41#define S3C64XX_PA_FB (0x77100000) 41#define S3C64XX_PA_FB (0x77100000)
42#define S3C64XX_PA_USB_HSOTG (0x7C000000)
43#define S3C64XX_PA_WATCHDOG (0x7E004000)
42#define S3C64XX_PA_SYSCON (0x7E00F000) 44#define S3C64XX_PA_SYSCON (0x7E00F000)
43#define S3C64XX_PA_IIS0 (0x7F002000) 45#define S3C64XX_PA_IIS0 (0x7F002000)
44#define S3C64XX_PA_IIS1 (0x7F003000) 46#define S3C64XX_PA_IIS1 (0x7F003000)
@@ -57,6 +59,8 @@
57#define S3C64XX_PA_MODEM (0x74108000) 59#define S3C64XX_PA_MODEM (0x74108000)
58#define S3C64XX_VA_MODEM S3C_ADDR(0x00600000) 60#define S3C64XX_VA_MODEM S3C_ADDR(0x00600000)
59 61
62#define S3C64XX_PA_USBHOST (0x74300000)
63
60/* place VICs close together */ 64/* place VICs close together */
61#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) 65#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00)
62#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 66#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
@@ -69,5 +73,7 @@
69#define S3C_PA_IIC S3C64XX_PA_IIC0 73#define S3C_PA_IIC S3C64XX_PA_IIC0
70#define S3C_PA_IIC1 S3C64XX_PA_IIC1 74#define S3C_PA_IIC1 S3C64XX_PA_IIC1
71#define S3C_PA_FB S3C64XX_PA_FB 75#define S3C_PA_FB S3C64XX_PA_FB
76#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
77#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
72 78
73#endif /* __ASM_ARCH_6400_MAP_H */ 79#endif /* __ASM_ARCH_6400_MAP_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/regs-clock.h b/arch/arm/mach-s3c6400/include/mach/regs-clock.h
new file mode 100644
index 000000000000..a6c7f4eb3a1b
--- /dev/null
+++ b/arch/arm/mach-s3c6400/include/mach/regs-clock.h
@@ -0,0 +1,16 @@
1/* linux/arch/arm/mach-s3c6400/include/mach/regs-clock.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C64XX - clock register compatibility with s3c24xx
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <plat/regs-clock.h>
16
diff --git a/arch/arm/mach-s3c6400/include/mach/system.h b/arch/arm/mach-s3c6400/include/mach/system.h
index 090cfd969bc7..2e58cb7a7147 100644
--- a/arch/arm/mach-s3c6400/include/mach/system.h
+++ b/arch/arm/mach-s3c6400/include/mach/system.h
@@ -11,6 +11,8 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H __FILE__ 12#define __ASM_ARCH_SYSTEM_H __FILE__
13 13
14#include <plat/watchdog-reset.h>
15
14static void arch_idle(void) 16static void arch_idle(void)
15{ 17{
16 /* nothing here yet */ 18 /* nothing here yet */
@@ -18,7 +20,11 @@ static void arch_idle(void)
18 20
19static void arch_reset(char mode, const char *cmd) 21static void arch_reset(char mode, const char *cmd)
20{ 22{
21 /* nothing here yet */ 23 if (mode != 's')
24 arch_wdt_reset();
25
26 /* if all else fails, or mode was for soft, jump to 0 */
27 cpu_reset(0);
22} 28}
23 29
24#endif /* __ASM_ARCH_IRQ_H */ 30#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c6400/mach-smdk6400.c b/arch/arm/mach-s3c6400/mach-smdk6400.c
new file mode 100644
index 000000000000..ab19285389a7
--- /dev/null
+++ b/arch/arm/mach-s3c6400/mach-smdk6400.c
@@ -0,0 +1,96 @@
1/* linux/arch/arm/mach-s3c6400/mach-smdk6400.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
20#include <linux/i2c.h>
21#include <linux/io.h>
22
23#include <asm/mach-types.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/mach/irq.h>
28
29#include <mach/hardware.h>
30#include <mach/map.h>
31
32#include <plat/regs-serial.h>
33
34#include <plat/s3c6400.h>
35#include <plat/clock.h>
36#include <plat/devs.h>
37#include <plat/cpu.h>
38#include <plat/iic.h>
39
40#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
41#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
42#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
43
44static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = {
45 [0] = {
46 .hwport = 0,
47 .flags = 0,
48 .ucon = 0x3c5,
49 .ulcon = 0x03,
50 .ufcon = 0x51,
51 },
52 [1] = {
53 .hwport = 1,
54 .flags = 0,
55 .ucon = 0x3c5,
56 .ulcon = 0x03,
57 .ufcon = 0x51,
58 },
59};
60
61static struct map_desc smdk6400_iodesc[] = {};
62
63static void __init smdk6400_map_io(void)
64{
65 s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
66 s3c24xx_init_clocks(12000000);
67 s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
68}
69
70static struct platform_device *smdk6400_devices[] __initdata = {
71 &s3c_device_hsmmc1,
72 &s3c_device_i2c0,
73};
74
75static struct i2c_board_info i2c_devs[] __initdata = {
76 { I2C_BOARD_INFO("wm8753", 0x1A), },
77 { I2C_BOARD_INFO("24c08", 0x50), },
78};
79
80static void __init smdk6400_machine_init(void)
81{
82 i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs));
83 platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices));
84}
85
86MACHINE_START(SMDK6400, "SMDK6400")
87 /* Maintainer: Ben Dooks <ben@fluff.org> */
88 .phys_io = S3C_PA_UART & 0xfff00000,
89 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
90 .boot_params = S3C64XX_PA_SDRAM + 0x100,
91
92 .init_irq = s3c6400_init_irq,
93 .map_io = smdk6400_map_io,
94 .init_machine = smdk6400_machine_init,
95 .timer = &s3c24xx_timer,
96MACHINE_END
diff --git a/arch/arm/mach-s3c6400/s3c6400.c b/arch/arm/mach-s3c6400/s3c6400.c
new file mode 100644
index 000000000000..1ece887d90bb
--- /dev/null
+++ b/arch/arm/mach-s3c6400/s3c6400.c
@@ -0,0 +1,89 @@
1/* linux/arch/arm/mach-s3c6410/cpu.c
2 *
3 * Copyright 2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20#include <linux/sysdev.h>
21#include <linux/serial_core.h>
22#include <linux/platform_device.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26#include <asm/mach/irq.h>
27
28#include <mach/hardware.h>
29#include <asm/irq.h>
30
31#include <plat/cpu-freq.h>
32#include <plat/regs-serial.h>
33#include <plat/regs-clock.h>
34
35#include <plat/cpu.h>
36#include <plat/devs.h>
37#include <plat/clock.h>
38#include <plat/sdhci.h>
39#include <plat/iic-core.h>
40#include <plat/s3c6400.h>
41
42void __init s3c6400_map_io(void)
43{
44 /* setup SDHCI */
45
46 s3c6400_default_sdhci0();
47 s3c6400_default_sdhci1();
48
49 /* the i2c devices are directly compatible with s3c2440 */
50 s3c_i2c0_setname("s3c2440-i2c");
51}
52
53void __init s3c6400_init_clocks(int xtal)
54{
55 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
56 s3c24xx_register_baseclocks(xtal);
57 s3c64xx_register_clocks();
58 s3c6400_register_clocks(S3C6400_CLKDIV0_ARM_MASK);
59 s3c6400_setup_clocks();
60}
61
62void __init s3c6400_init_irq(void)
63{
64 /* VIC0 does not have IRQS 5..7,
65 * VIC1 is fully populated. */
66 s3c64xx_init_irq(~0 & ~(0xf << 5), ~0);
67}
68
69struct sysdev_class s3c6400_sysclass = {
70 .name = "s3c6400-core",
71};
72
73static struct sys_device s3c6400_sysdev = {
74 .cls = &s3c6400_sysclass,
75};
76
77static int __init s3c6400_core_init(void)
78{
79 return sysdev_class_register(&s3c6400_sysclass);
80}
81
82core_initcall(s3c6400_core_init);
83
84int __init s3c6400_init(void)
85{
86 printk("S3C6400: Initialising architecture\n");
87
88 return sysdev_register(&s3c6400_sysdev);
89}
diff --git a/arch/arm/mach-s3c6400/setup-sdhci.c b/arch/arm/mach-s3c6400/setup-sdhci.c
new file mode 100644
index 000000000000..b93dafbee1f4
--- /dev/null
+++ b/arch/arm/mach-s3c6400/setup-sdhci.c
@@ -0,0 +1,63 @@
1/* linux/arch/arm/mach-s3c6410/setup-sdhci.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20
21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h>
23
24#include <plat/regs-sdhci.h>
25#include <plat/sdhci.h>
26
27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
28
29char *s3c6400_hsmmc_clksrcs[4] = {
30 [0] = "hsmmc",
31 [1] = "hsmmc",
32 [2] = "mmc_bus",
33 /* [3] = "48m", - note not succesfully used yet */
34};
35
36void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
44 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
45 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
46 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
47 S3C_SDHCI_CTRL2_ENFBCLKRX |
48 S3C_SDHCI_CTRL2_DFCNT_NONE |
49 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
50
51 if (ios->clock < 25 * 1000000)
52 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
53 S3C_SDHCI_CTRL3_FCSEL2 |
54 S3C_SDHCI_CTRL3_FCSEL1 |
55 S3C_SDHCI_CTRL3_FCSEL0);
56 else
57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
58
59 printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3);
60 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
61 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
62}
63
diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig
index 1d5010070027..e63aac7f4e5a 100644
--- a/arch/arm/mach-s3c6410/Kconfig
+++ b/arch/arm/mach-s3c6410/Kconfig
@@ -16,9 +16,18 @@ config CPU_S3C6410
16 16
17config S3C6410_SETUP_SDHCI 17config S3C6410_SETUP_SDHCI
18 bool 18 bool
19 select S3C64XX_SETUP_SDHCI_GPIO
19 help 20 help
20 Internal helper functions for S3C6410 based SDHCI systems 21 Internal helper functions for S3C6410 based SDHCI systems
21 22
23config MACH_ANW6410
24 bool "A&W6410"
25 select CPU_S3C6410
26 select S3C_DEV_FB
27 select S3C64XX_SETUP_FB_24BPP
28 help
29 Machine support for the A&W6410
30
22config MACH_SMDK6410 31config MACH_SMDK6410
23 bool "SMDK6410" 32 bool "SMDK6410"
24 select CPU_S3C6410 33 select CPU_S3C6410
@@ -26,6 +35,8 @@ config MACH_SMDK6410
26 select S3C_DEV_HSMMC1 35 select S3C_DEV_HSMMC1
27 select S3C_DEV_I2C1 36 select S3C_DEV_I2C1
28 select S3C_DEV_FB 37 select S3C_DEV_FB
38 select S3C_DEV_USB_HOST
39 select S3C_DEV_USB_HSOTG
29 select S3C6410_SETUP_SDHCI 40 select S3C6410_SETUP_SDHCI
30 select S3C64XX_SETUP_I2C1 41 select S3C64XX_SETUP_I2C1
31 select S3C64XX_SETUP_FB_24BPP 42 select S3C64XX_SETUP_FB_24BPP
@@ -60,3 +71,29 @@ config SMDK6410_SD_CH1
60 channels 0 and 1 are the same. 71 channels 0 and 1 are the same.
61 72
62endchoice 73endchoice
74
75config SMDK6410_WM1190_EV1
76 bool "Support Wolfson Microelectronics 1190-EV1 PMIC card"
77 depends on MACH_SMDK6410
78 select REGULATOR
79 select REGULATOR_WM8350
80 select MFD_WM8350_I2C
81 select MFD_WM8350_CONFIG_MODE_0
82 select MFD_WM8350_CONFIG_MODE_3
83 select MFD_WM8352_CONFIG_MODE_0
84 help
85 The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC
86 and audio daughtercard for the Samsung SMDK6410 reference
87 platform. Enabling this option will build support for this
88 module into the kernel. The presence of the module will be
89 detected at runtime so the the resulting kernel can be used
90 with or without the 1190-EV1 fitted.
91
92config MACH_NCP
93 bool "NCP"
94 select CPU_S3C6410
95 select S3C_DEV_I2C1
96 select S3C_DEV_HSMMC1
97 select S3C64XX_SETUP_I2C1
98 help
99 Machine support for the Samsung NCP
diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile
index 2cd4f189036b..6f9deac88612 100644
--- a/arch/arm/mach-s3c6410/Makefile
+++ b/arch/arm/mach-s3c6410/Makefile
@@ -20,4 +20,8 @@ obj-$(CONFIG_S3C6410_SETUP_SDHCI) += setup-sdhci.o
20 20
21# machine support 21# machine support
22 22
23obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
23obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 24obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
25obj-$(CONFIG_MACH_NCP) += mach-ncp.o
26
27
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c
index 6a73ca6b7a3a..ade904de8895 100644
--- a/arch/arm/mach-s3c6410/cpu.c
+++ b/arch/arm/mach-s3c6410/cpu.c
@@ -31,6 +31,7 @@
31 31
32#include <plat/cpu-freq.h> 32#include <plat/cpu-freq.h>
33#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
34#include <plat/regs-clock.h>
34 35
35#include <plat/cpu.h> 36#include <plat/cpu.h>
36#include <plat/devs.h> 37#include <plat/devs.h>
@@ -68,7 +69,7 @@ void __init s3c6410_init_clocks(int xtal)
68 printk(KERN_DEBUG "%s: initialising clocks\n", __func__); 69 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
69 s3c24xx_register_baseclocks(xtal); 70 s3c24xx_register_baseclocks(xtal);
70 s3c64xx_register_clocks(); 71 s3c64xx_register_clocks();
71 s3c6400_register_clocks(); 72 s3c6400_register_clocks(S3C6410_CLKDIV0_ARM_MASK);
72 s3c6400_setup_clocks(); 73 s3c6400_setup_clocks();
73} 74}
74 75
diff --git a/arch/arm/mach-s3c6410/mach-anw6410.c b/arch/arm/mach-s3c6410/mach-anw6410.c
new file mode 100644
index 000000000000..661cca63de25
--- /dev/null
+++ b/arch/arm/mach-s3c6410/mach-anw6410.c
@@ -0,0 +1,245 @@
1/* linux/arch/arm/mach-s3c6410/mach-anw6410.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 * Copyright 2009 Kwangwoo Lee
8 * Kwangwoo Lee <kwangwoo.lee@gmail.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14*/
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/interrupt.h>
19#include <linux/list.h>
20#include <linux/timer.h>
21#include <linux/init.h>
22#include <linux/serial_core.h>
23#include <linux/platform_device.h>
24#include <linux/io.h>
25#include <linux/i2c.h>
26#include <linux/fb.h>
27#include <linux/gpio.h>
28#include <linux/delay.h>
29#include <linux/dm9000.h>
30
31#include <video/platform_lcd.h>
32
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/mach/irq.h>
36
37#include <mach/hardware.h>
38#include <mach/regs-fb.h>
39#include <mach/map.h>
40
41#include <asm/irq.h>
42#include <asm/mach-types.h>
43
44#include <plat/regs-serial.h>
45#include <plat/iic.h>
46#include <plat/fb.h>
47
48#include <plat/s3c6410.h>
49#include <plat/clock.h>
50#include <plat/devs.h>
51#include <plat/cpu.h>
52#include <plat/regs-gpio.h>
53#include <plat/regs-modem.h>
54
55/* DM9000 */
56#define ANW6410_PA_DM9000 (0x18000000)
57
58/* A hardware buffer to control external devices is mapped at 0x30000000.
59 * It can not be read. So current status must be kept in anw6410_extdev_status.
60 */
61#define ANW6410_VA_EXTDEV S3C_ADDR(0x02000000)
62#define ANW6410_PA_EXTDEV (0x30000000)
63
64#define ANW6410_EN_DM9000 (1<<11)
65#define ANW6410_EN_LCD (1<<14)
66
67static __u32 anw6410_extdev_status;
68
69static struct s3c2410_uartcfg anw6410_uartcfgs[] __initdata = {
70 [0] = {
71 .hwport = 0,
72 .flags = 0,
73 .ucon = 0x3c5,
74 .ulcon = 0x03,
75 .ufcon = 0x51,
76 },
77 [1] = {
78 .hwport = 1,
79 .flags = 0,
80 .ucon = 0x3c5,
81 .ulcon = 0x03,
82 .ufcon = 0x51,
83 },
84};
85
86/* framebuffer and LCD setup. */
87static void __init anw6410_lcd_mode_set(void)
88{
89 u32 tmp;
90
91 /* set the LCD type */
92 tmp = __raw_readl(S3C64XX_SPCON);
93 tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK;
94 tmp |= S3C64XX_SPCON_LCD_SEL_RGB;
95 __raw_writel(tmp, S3C64XX_SPCON);
96
97 /* remove the LCD bypass */
98 tmp = __raw_readl(S3C64XX_MODEM_MIFPCON);
99 tmp &= ~MIFPCON_LCD_BYPASS;
100 __raw_writel(tmp, S3C64XX_MODEM_MIFPCON);
101}
102
103/* GPF1 = LCD panel power
104 * GPF4 = LCD backlight control
105 */
106static void anw6410_lcd_power_set(struct plat_lcd_data *pd,
107 unsigned int power)
108{
109 if (power) {
110 anw6410_extdev_status |= (ANW6410_EN_LCD << 16);
111 __raw_writel(anw6410_extdev_status, ANW6410_VA_EXTDEV);
112
113 gpio_direction_output(S3C64XX_GPF(1), 1);
114 gpio_direction_output(S3C64XX_GPF(4), 1);
115 } else {
116 anw6410_extdev_status &= ~(ANW6410_EN_LCD << 16);
117 __raw_writel(anw6410_extdev_status, ANW6410_VA_EXTDEV);
118
119 gpio_direction_output(S3C64XX_GPF(1), 0);
120 gpio_direction_output(S3C64XX_GPF(4), 0);
121 }
122}
123
124static struct plat_lcd_data anw6410_lcd_power_data = {
125 .set_power = anw6410_lcd_power_set,
126};
127
128static struct platform_device anw6410_lcd_powerdev = {
129 .name = "platform-lcd",
130 .dev.parent = &s3c_device_fb.dev,
131 .dev.platform_data = &anw6410_lcd_power_data,
132};
133
134static struct s3c_fb_pd_win anw6410_fb_win0 = {
135 /* this is to ensure we use win0 */
136 .win_mode = {
137 .pixclock = 41094,
138 .left_margin = 8,
139 .right_margin = 13,
140 .upper_margin = 7,
141 .lower_margin = 5,
142 .hsync_len = 3,
143 .vsync_len = 1,
144 .xres = 800,
145 .yres = 480,
146 },
147 .max_bpp = 32,
148 .default_bpp = 16,
149};
150
151/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
152static struct s3c_fb_platdata anw6410_lcd_pdata __initdata = {
153 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
154 .win[0] = &anw6410_fb_win0,
155 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
156 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
157};
158
159/* DM9000AEP 10/100 ethernet controller */
160static void __init anw6410_dm9000_enable(void)
161{
162 anw6410_extdev_status |= (ANW6410_EN_DM9000 << 16);
163 __raw_writel(anw6410_extdev_status, ANW6410_VA_EXTDEV);
164}
165
166static struct resource anw6410_dm9000_resource[] = {
167 [0] = {
168 .start = ANW6410_PA_DM9000,
169 .end = ANW6410_PA_DM9000 + 3,
170 .flags = IORESOURCE_MEM,
171 },
172 [1] = {
173 .start = ANW6410_PA_DM9000 + 4,
174 .end = ANW6410_PA_DM9000 + 4 + 500,
175 .flags = IORESOURCE_MEM,
176 },
177 [2] = {
178 .start = IRQ_EINT(15),
179 .end = IRQ_EINT(15),
180 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
181 },
182};
183
184static struct dm9000_plat_data anw6410_dm9000_pdata = {
185 .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
186 /* dev_addr can be set to provide hwaddr. */
187};
188
189static struct platform_device anw6410_device_eth = {
190 .name = "dm9000",
191 .id = -1,
192 .num_resources = ARRAY_SIZE(anw6410_dm9000_resource),
193 .resource = anw6410_dm9000_resource,
194 .dev = {
195 .platform_data = &anw6410_dm9000_pdata,
196 },
197};
198
199static struct map_desc anw6410_iodesc[] __initdata = {
200 {
201 .virtual = (unsigned long)ANW6410_VA_EXTDEV,
202 .pfn = __phys_to_pfn(ANW6410_PA_EXTDEV),
203 .length = SZ_64K,
204 .type = MT_DEVICE,
205 },
206};
207
208static struct platform_device *anw6410_devices[] __initdata = {
209 &s3c_device_fb,
210 &anw6410_lcd_powerdev,
211 &anw6410_device_eth,
212};
213
214static void __init anw6410_map_io(void)
215{
216 s3c64xx_init_io(anw6410_iodesc, ARRAY_SIZE(anw6410_iodesc));
217 s3c24xx_init_clocks(12000000);
218 s3c24xx_init_uarts(anw6410_uartcfgs, ARRAY_SIZE(anw6410_uartcfgs));
219
220 anw6410_lcd_mode_set();
221}
222
223static void __init anw6410_machine_init(void)
224{
225 s3c_fb_set_platdata(&anw6410_lcd_pdata);
226
227 gpio_request(S3C64XX_GPF(1), "panel power");
228 gpio_request(S3C64XX_GPF(4), "LCD backlight");
229
230 anw6410_dm9000_enable();
231
232 platform_add_devices(anw6410_devices, ARRAY_SIZE(anw6410_devices));
233}
234
235MACHINE_START(ANW6410, "A&W6410")
236 /* Maintainer: Kwangwoo Lee <kwangwoo.lee@gmail.com> */
237 .phys_io = S3C_PA_UART & 0xfff00000,
238 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
239 .boot_params = S3C64XX_PA_SDRAM + 0x100,
240
241 .init_irq = s3c6410_init_irq,
242 .map_io = anw6410_map_io,
243 .init_machine = anw6410_machine_init,
244 .timer = &s3c24xx_timer,
245MACHINE_END
diff --git a/arch/arm/mach-s3c6410/mach-ncp.c b/arch/arm/mach-s3c6410/mach-ncp.c
new file mode 100644
index 000000000000..6030636f8548
--- /dev/null
+++ b/arch/arm/mach-s3c6410/mach-ncp.c
@@ -0,0 +1,107 @@
1/*
2 * linux/arch/arm/mach-s3c6410/mach-ncp.c
3 *
4 * Copyright (C) 2008-2009 Samsung Electronics
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/i2c.h>
22#include <linux/fb.h>
23#include <linux/gpio.h>
24#include <linux/delay.h>
25
26#include <video/platform_lcd.h>
27
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/irq.h>
31
32#include <mach/hardware.h>
33#include <mach/regs-fb.h>
34#include <mach/map.h>
35
36#include <asm/irq.h>
37#include <asm/mach-types.h>
38
39#include <plat/regs-serial.h>
40#include <plat/iic.h>
41#include <plat/fb.h>
42
43#include <plat/s3c6410.h>
44#include <plat/clock.h>
45#include <plat/devs.h>
46#include <plat/cpu.h>
47
48#define UCON S3C2410_UCON_DEFAULT
49#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
50#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
51
52static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = {
53 /* REVISIT: NCP uses only serial 1, 2 */
54 [0] = {
55 .hwport = 0,
56 .flags = 0,
57 .ucon = UCON,
58 .ulcon = ULCON,
59 .ufcon = UFCON,
60 },
61 [1] = {
62 .hwport = 1,
63 .flags = 0,
64 .ucon = UCON,
65 .ulcon = ULCON,
66 .ufcon = UFCON,
67 },
68 [2] = {
69 .hwport = 2,
70 .flags = 0,
71 .ucon = UCON,
72 .ulcon = ULCON,
73 .ufcon = UFCON,
74 },
75};
76
77static struct platform_device *ncp_devices[] __initdata = {
78 &s3c_device_hsmmc1,
79 &s3c_device_i2c0,
80};
81
82struct map_desc ncp_iodesc[] = {};
83
84static void __init ncp_map_io(void)
85{
86 s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
87 s3c24xx_init_clocks(12000000);
88 s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
89}
90
91static void __init ncp_machine_init(void)
92{
93 s3c_i2c0_set_platdata(NULL);
94
95 platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices));
96}
97
98MACHINE_START(NCP, "NCP")
99 /* Maintainer: Samsung Electronics */
100 .phys_io = S3C_PA_UART & 0xfff00000,
101 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
102 .boot_params = S3C64XX_PA_SDRAM + 0x100,
103 .init_irq = s3c6410_init_irq,
104 .map_io = ncp_map_io,
105 .init_machine = ncp_machine_init,
106 .timer = &s3c24xx_timer,
107MACHINE_END
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
index 7f473e47e4f1..bc9a7dea567f 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -24,6 +24,12 @@
24#include <linux/fb.h> 24#include <linux/fb.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/smsc911x.h>
28
29#ifdef CONFIG_SMDK6410_WM1190_EV1
30#include <linux/mfd/wm8350/core.h>
31#include <linux/mfd/wm8350/pmic.h>
32#endif
27 33
28#include <video/platform_lcd.h> 34#include <video/platform_lcd.h>
29 35
@@ -39,8 +45,12 @@
39#include <asm/mach-types.h> 45#include <asm/mach-types.h>
40 46
41#include <plat/regs-serial.h> 47#include <plat/regs-serial.h>
48#include <plat/regs-modem.h>
49#include <plat/regs-gpio.h>
50#include <plat/regs-sys.h>
42#include <plat/iic.h> 51#include <plat/iic.h>
43#include <plat/fb.h> 52#include <plat/fb.h>
53#include <plat/gpio-cfg.h>
44 54
45#include <plat/s3c6410.h> 55#include <plat/s3c6410.h>
46#include <plat/clock.h> 56#include <plat/clock.h>
@@ -129,6 +139,37 @@ static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
129 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 139 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
130}; 140};
131 141
142static struct resource smdk6410_smsc911x_resources[] = {
143 [0] = {
144 .start = 0x18000000,
145 .end = 0x18000000 + SZ_64K - 1,
146 .flags = IORESOURCE_MEM,
147 },
148 [1] = {
149 .start = S3C_EINT(10),
150 .end = S3C_EINT(10),
151 .flags = IORESOURCE_IRQ | IRQ_TYPE_LEVEL_LOW,
152 },
153};
154
155static struct smsc911x_platform_config smdk6410_smsc911x_pdata = {
156 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
157 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
158 .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY,
159 .phy_interface = PHY_INTERFACE_MODE_MII,
160};
161
162
163static struct platform_device smdk6410_smsc911x = {
164 .name = "smsc911x",
165 .id = -1,
166 .num_resources = ARRAY_SIZE(smdk6410_smsc911x_resources),
167 .resource = &smdk6410_smsc911x_resources[0],
168 .dev = {
169 .platform_data = &smdk6410_smsc911x_pdata,
170 },
171};
172
132static struct map_desc smdk6410_iodesc[] = {}; 173static struct map_desc smdk6410_iodesc[] = {};
133 174
134static struct platform_device *smdk6410_devices[] __initdata = { 175static struct platform_device *smdk6410_devices[] __initdata = {
@@ -141,12 +182,155 @@ static struct platform_device *smdk6410_devices[] __initdata = {
141 &s3c_device_i2c0, 182 &s3c_device_i2c0,
142 &s3c_device_i2c1, 183 &s3c_device_i2c1,
143 &s3c_device_fb, 184 &s3c_device_fb,
185 &s3c_device_usb,
186 &s3c_device_usb_hsotg,
144 &smdk6410_lcd_powerdev, 187 &smdk6410_lcd_powerdev,
188
189 &smdk6410_smsc911x,
190};
191
192#ifdef CONFIG_SMDK6410_WM1190_EV1
193/* S3C64xx internal logic & PLL */
194static struct regulator_init_data wm8350_dcdc1_data = {
195 .constraints = {
196 .name = "PVDD_INT/PVDD_PLL",
197 .min_uV = 1200000,
198 .max_uV = 1200000,
199 .always_on = 1,
200 .apply_uV = 1,
201 },
202};
203
204/* Memory */
205static struct regulator_init_data wm8350_dcdc3_data = {
206 .constraints = {
207 .name = "PVDD_MEM",
208 .min_uV = 1800000,
209 .max_uV = 1800000,
210 .always_on = 1,
211 .state_mem = {
212 .uV = 1800000,
213 .mode = REGULATOR_MODE_NORMAL,
214 .enabled = 1,
215 },
216 .initial_state = PM_SUSPEND_MEM,
217 },
218};
219
220/* USB, EXT, PCM, ADC/DAC, USB, MMC */
221static struct regulator_init_data wm8350_dcdc4_data = {
222 .constraints = {
223 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV",
224 .min_uV = 3000000,
225 .max_uV = 3000000,
226 .always_on = 1,
227 },
228};
229
230/* ARM core */
231static struct regulator_consumer_supply dcdc6_consumers[] = {
232 {
233 .supply = "vddarm",
234 }
235};
236
237static struct regulator_init_data wm8350_dcdc6_data = {
238 .constraints = {
239 .name = "PVDD_ARM",
240 .min_uV = 1000000,
241 .max_uV = 1300000,
242 .always_on = 1,
243 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
244 },
245 .num_consumer_supplies = ARRAY_SIZE(dcdc6_consumers),
246 .consumer_supplies = dcdc6_consumers,
145}; 247};
146 248
249/* Alive */
250static struct regulator_init_data wm8350_ldo1_data = {
251 .constraints = {
252 .name = "PVDD_ALIVE",
253 .min_uV = 1200000,
254 .max_uV = 1200000,
255 .always_on = 1,
256 .apply_uV = 1,
257 },
258};
259
260/* OTG */
261static struct regulator_init_data wm8350_ldo2_data = {
262 .constraints = {
263 .name = "PVDD_OTG",
264 .min_uV = 3300000,
265 .max_uV = 3300000,
266 .always_on = 1,
267 },
268};
269
270/* LCD */
271static struct regulator_init_data wm8350_ldo3_data = {
272 .constraints = {
273 .name = "PVDD_LCD",
274 .min_uV = 3000000,
275 .max_uV = 3000000,
276 .always_on = 1,
277 },
278};
279
280/* OTGi/1190-EV1 HPVDD & AVDD */
281static struct regulator_init_data wm8350_ldo4_data = {
282 .constraints = {
283 .name = "PVDD_OTGI/HPVDD/AVDD",
284 .min_uV = 1200000,
285 .max_uV = 1200000,
286 .apply_uV = 1,
287 .always_on = 1,
288 },
289};
290
291static struct {
292 int regulator;
293 struct regulator_init_data *initdata;
294} wm1190_regulators[] = {
295 { WM8350_DCDC_1, &wm8350_dcdc1_data },
296 { WM8350_DCDC_3, &wm8350_dcdc3_data },
297 { WM8350_DCDC_4, &wm8350_dcdc4_data },
298 { WM8350_DCDC_6, &wm8350_dcdc6_data },
299 { WM8350_LDO_1, &wm8350_ldo1_data },
300 { WM8350_LDO_2, &wm8350_ldo2_data },
301 { WM8350_LDO_3, &wm8350_ldo3_data },
302 { WM8350_LDO_4, &wm8350_ldo4_data },
303};
304
305static int __init smdk6410_wm8350_init(struct wm8350 *wm8350)
306{
307 int i;
308
309 /* Instantiate the regulators */
310 for (i = 0; i < ARRAY_SIZE(wm1190_regulators); i++)
311 wm8350_register_regulator(wm8350,
312 wm1190_regulators[i].regulator,
313 wm1190_regulators[i].initdata);
314
315 return 0;
316}
317
318static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = {
319 .init = smdk6410_wm8350_init,
320 .irq_high = 1,
321};
322#endif
323
147static struct i2c_board_info i2c_devs0[] __initdata = { 324static struct i2c_board_info i2c_devs0[] __initdata = {
148 { I2C_BOARD_INFO("24c08", 0x50), }, 325 { I2C_BOARD_INFO("24c08", 0x50), },
149 { I2C_BOARD_INFO("wm8580", 0x1b), }, 326 { I2C_BOARD_INFO("wm8580", 0x1b), },
327
328#ifdef CONFIG_SMDK6410_WM1190_EV1
329 { I2C_BOARD_INFO("wm8350", 0x1a),
330 .platform_data = &smdk6410_wm8350_pdata,
331 .irq = S3C_EINT(12),
332 },
333#endif
150}; 334};
151 335
152static struct i2c_board_info i2c_devs1[] __initdata = { 336static struct i2c_board_info i2c_devs1[] __initdata = {
@@ -155,9 +339,23 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
155 339
156static void __init smdk6410_map_io(void) 340static void __init smdk6410_map_io(void)
157{ 341{
342 u32 tmp;
343
158 s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc)); 344 s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
159 s3c24xx_init_clocks(12000000); 345 s3c24xx_init_clocks(12000000);
160 s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs)); 346 s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs));
347
348 /* set the LCD type */
349
350 tmp = __raw_readl(S3C64XX_SPCON);
351 tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK;
352 tmp |= S3C64XX_SPCON_LCD_SEL_RGB;
353 __raw_writel(tmp, S3C64XX_SPCON);
354
355 /* remove the lcd bypass */
356 tmp = __raw_readl(S3C64XX_MODEM_MIFPCON);
357 tmp &= ~MIFPCON_LCD_BYPASS;
358 __raw_writel(tmp, S3C64XX_MODEM_MIFPCON);
161} 359}
162 360
163static void __init smdk6410_machine_init(void) 361static void __init smdk6410_machine_init(void)
diff --git a/arch/arm/mach-s3c6410/setup-sdhci.c b/arch/arm/mach-s3c6410/setup-sdhci.c
index 0b5788bd5985..20666f3bd478 100644
--- a/arch/arm/mach-s3c6410/setup-sdhci.c
+++ b/arch/arm/mach-s3c6410/setup-sdhci.c
@@ -21,8 +21,6 @@
21#include <linux/mmc/card.h> 21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23 23
24#include <mach/gpio.h>
25#include <plat/gpio-cfg.h>
26#include <plat/regs-sdhci.h> 24#include <plat/regs-sdhci.h>
27#include <plat/sdhci.h> 25#include <plat/sdhci.h>
28 26
@@ -35,22 +33,6 @@ char *s3c6410_hsmmc_clksrcs[4] = {
35 /* [3] = "48m", - note not succesfully used yet */ 33 /* [3] = "48m", - note not succesfully used yet */
36}; 34};
37 35
38void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
39{
40 unsigned int gpio;
41 unsigned int end;
42
43 end = S3C64XX_GPG(2 + width);
44
45 /* Set all the necessary GPG pins to special-function 0 */
46 for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) {
47 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
48 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
49 }
50
51 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
52 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2));
53}
54 36
55void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, 37void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev,
56 void __iomem *r, 38 void __iomem *r,
@@ -84,19 +66,3 @@ void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev,
84 writel(ctrl3, r + S3C_SDHCI_CONTROL3); 66 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
85} 67}
86 68
87void s3c6410_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
88{
89 unsigned int gpio;
90 unsigned int end;
91
92 end = S3C64XX_GPH(2 + width);
93
94 /* Set all the necessary GPG pins to special-function 0 */
95 for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) {
96 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
97 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
98 }
99
100 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
101 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
102}
diff --git a/arch/arm/mach-sa1100/collie_pm.c b/arch/arm/mach-sa1100/collie_pm.c
deleted file mode 100644
index 444f266ecc06..000000000000
--- a/arch/arm/mach-sa1100/collie_pm.c
+++ /dev/null
@@ -1,296 +0,0 @@
1/*
2 * Based on spitz_pm.c and sharp code.
3 *
4 * Copyright (C) 2001 SHARP
5 * Copyright 2005 Pavel Machek <pavel@suse.cz>
6 *
7 * Distribute under GPLv2.
8 *
9 * Li-ion batteries are angry beasts, and they like to explode. This driver is not finished,
10 * and sometimes charges them when it should not. If it makes angry lithium to come your way...
11 * ...well, you have been warned.
12 *
13 * Actually, this should be quite safe, it seems sharp leaves charger enabled by default,
14 * and my collie did not explode (yet).
15 */
16
17#include <linux/module.h>
18#include <linux/stat.h>
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/delay.h>
22#include <linux/interrupt.h>
23#include <linux/device.h>
24#include <linux/platform_device.h>
25#include <linux/gpio.h>
26
27#include <asm/irq.h>
28#include <mach/hardware.h>
29#include <asm/hardware/scoop.h>
30#include <mach/dma.h>
31#include <mach/collie.h>
32#include <asm/mach/sharpsl_param.h>
33#include <asm/hardware/sharpsl_pm.h>
34
35#include "../drivers/mfd/ucb1x00.h"
36
37static struct ucb1x00 *ucb;
38static int ad_revise;
39
40#define ADCtoPower(x) ((330 * x * 2) / 1024)
41
42static void collie_charger_init(void)
43{
44 int err;
45
46 if (sharpsl_param.adadj != -1)
47 ad_revise = sharpsl_param.adadj;
48
49 /* Register interrupt handler. */
50 if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, IRQF_DISABLED,
51 "ACIN", sharpsl_ac_isr))) {
52 printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_AC_IN);
53 return;
54 }
55 if ((err = request_irq(COLLIE_IRQ_GPIO_CO, sharpsl_chrg_full_isr, IRQF_DISABLED,
56 "CO", sharpsl_chrg_full_isr))) {
57 free_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr);
58 printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_CO);
59 return;
60 }
61
62 gpio_request(COLLIE_GPIO_CHARGE_ON, "charge on");
63 gpio_direction_output(COLLIE_GPIO_CHARGE_ON, 1);
64
65 ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON |
66 COLLIE_TC35143_GPIO_BBAT_ON);
67 return;
68}
69
70static void collie_measure_temp(int on)
71{
72 if (on)
73 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_TMP_ON, 0);
74 else
75 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_TMP_ON);
76}
77
78static void collie_charge(int on)
79{
80 /* Zaurus seems to contain LTC1731; it should know when to
81 * stop charging itself, so setting charge on should be
82 * relatively harmless (as long as it is not done too often).
83 */
84 gpio_set_value(COLLIE_GPIO_CHARGE_ON, on);
85}
86
87static void collie_discharge(int on)
88{
89}
90
91static void collie_discharge1(int on)
92{
93}
94
95static void collie_presuspend(void)
96{
97}
98
99static void collie_postsuspend(void)
100{
101}
102
103static int collie_should_wakeup(unsigned int resume_on_alarm)
104{
105 return 0;
106}
107
108static unsigned long collie_charger_wakeup(void)
109{
110 return 0;
111}
112
113int collie_read_backup_battery(void)
114{
115 int voltage;
116
117 ucb1x00_adc_enable(ucb);
118
119 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_BBAT_ON, 0);
120 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC);
121
122 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON);
123 ucb1x00_adc_disable(ucb);
124
125 printk("Backup battery = %d(%d)\n", ADCtoPower(voltage), voltage);
126
127 return ADCtoPower(voltage);
128}
129
130int collie_read_main_battery(void)
131{
132 int voltage, voltage_rev, voltage_volts;
133
134 ucb1x00_adc_enable(ucb);
135 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON);
136 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_MBAT_ON, 0);
137
138 mdelay(1);
139 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC);
140
141 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON);
142 ucb1x00_adc_disable(ucb);
143
144 voltage_rev = voltage + ((ad_revise * voltage) / 652);
145 voltage_volts = ADCtoPower(voltage_rev);
146
147 printk("Main battery = %d(%d)\n", voltage_volts, voltage);
148
149 if (voltage != -1)
150 return voltage_volts;
151 else
152 return voltage;
153}
154
155int collie_read_temp(void)
156{
157 int voltage;
158
159 /* According to Sharp, temp must be > 973, main battery must be < 465,
160 FIXME: sharpsl_pm.c has both conditions negated? FIXME: values
161 are way out of range? */
162
163 ucb1x00_adc_enable(ucb);
164 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_TMP_ON, 0);
165 /* >1010 = battery removed, 460 = 22C ?, higher = lower temp ? */
166 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD0, UCB_SYNC);
167 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_TMP_ON);
168 ucb1x00_adc_disable(ucb);
169
170 printk("Battery temp = %d\n", voltage);
171 return voltage;
172}
173
174static unsigned long read_devdata(int which)
175{
176 switch (which) {
177 case SHARPSL_BATT_VOLT:
178 return collie_read_main_battery();
179 case SHARPSL_BATT_TEMP:
180 return collie_read_temp();
181 case SHARPSL_ACIN_VOLT:
182 return 500;
183 case SHARPSL_STATUS_ACIN: {
184 int ret = GPLR & COLLIE_GPIO_AC_IN;
185 printk("AC status = %d\n", ret);
186 return ret;
187 }
188 case SHARPSL_STATUS_FATAL: {
189 int ret = GPLR & COLLIE_GPIO_MAIN_BAT_LOW;
190 printk("Fatal bat = %d\n", ret);
191 return ret;
192 }
193 default:
194 return ~0;
195 }
196}
197
198struct battery_thresh collie_battery_levels_acin[] = {
199 { 420, 100},
200 { 417, 95},
201 { 415, 90},
202 { 413, 80},
203 { 411, 75},
204 { 408, 70},
205 { 406, 60},
206 { 403, 50},
207 { 398, 40},
208 { 391, 25},
209 { 10, 5},
210 { 0, 0},
211};
212
213struct battery_thresh collie_battery_levels[] = {
214 { 394, 100},
215 { 390, 95},
216 { 380, 90},
217 { 370, 80},
218 { 368, 75}, /* From sharp code: battery high with frontlight */
219 { 366, 70}, /* 60..90 -- fake values invented by me for testing */
220 { 364, 60},
221 { 362, 50},
222 { 360, 40},
223 { 358, 25}, /* From sharp code: battery low with frontlight */
224 { 356, 5}, /* From sharp code: battery verylow with frontlight */
225 { 0, 0},
226};
227
228struct sharpsl_charger_machinfo collie_pm_machinfo = {
229 .init = collie_charger_init,
230 .read_devdata = read_devdata,
231 .discharge = collie_discharge,
232 .discharge1 = collie_discharge1,
233 .charge = collie_charge,
234 .measure_temp = collie_measure_temp,
235 .presuspend = collie_presuspend,
236 .postsuspend = collie_postsuspend,
237 .charger_wakeup = collie_charger_wakeup,
238 .should_wakeup = collie_should_wakeup,
239 .bat_levels = 12,
240 .bat_levels_noac = collie_battery_levels,
241 .bat_levels_acin = collie_battery_levels_acin,
242 .status_high_acin = 368,
243 .status_low_acin = 358,
244 .status_high_noac = 368,
245 .status_low_noac = 358,
246 .charge_on_volt = 350, /* spitz uses 2.90V, but lets play it safe. */
247 .charge_on_temp = 550,
248 .charge_acin_high = 550, /* collie does not seem to have sensor for this, anyway */
249 .charge_acin_low = 450, /* ignored, too */
250 .fatal_acin_volt = 356,
251 .fatal_noacin_volt = 356,
252
253 .batfull_irq = 1, /* We do not want periodical charge restarts */
254};
255
256static int __init collie_pm_ucb_add(struct ucb1x00_dev *pdev)
257{
258 sharpsl_pm.machinfo = &collie_pm_machinfo;
259 ucb = pdev->ucb;
260 return 0;
261}
262
263static struct ucb1x00_driver collie_pm_ucb_driver = {
264 .add = collie_pm_ucb_add,
265};
266
267static struct platform_device *collie_pm_device;
268
269static int __init collie_pm_init(void)
270{
271 int ret;
272
273 collie_pm_device = platform_device_alloc("sharpsl-pm", -1);
274 if (!collie_pm_device)
275 return -ENOMEM;
276
277 collie_pm_device->dev.platform_data = &collie_pm_machinfo;
278 ret = platform_device_add(collie_pm_device);
279
280 if (ret)
281 platform_device_put(collie_pm_device);
282
283 if (!ret)
284 ret = ucb1x00_register_driver(&collie_pm_ucb_driver);
285
286 return ret;
287}
288
289static void __exit collie_pm_exit(void)
290{
291 ucb1x00_unregister_driver(&collie_pm_ucb_driver);
292 platform_device_unregister(collie_pm_device);
293}
294
295module_init(collie_pm_init);
296module_exit(collie_pm_exit);
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 28cf36967977..506a5e5a9ad5 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(jornada_ssp_reverse);
54 * timeout after <timeout> rounds. Needs mcu running before its called. 54 * timeout after <timeout> rounds. Needs mcu running before its called.
55 * 55 *
56 * returns : %mcu output on success 56 * returns : %mcu output on success
57 * : %-ETIMEOUT on timeout 57 * : %-ETIMEDOUT on timeout
58 */ 58 */
59int jornada_ssp_byte(u8 byte) 59int jornada_ssp_byte(u8 byte)
60{ 60{
@@ -82,7 +82,7 @@ EXPORT_SYMBOL(jornada_ssp_byte);
82 * jornada_ssp_inout - decide if input is command or trading byte 82 * jornada_ssp_inout - decide if input is command or trading byte
83 * 83 *
84 * returns : (jornada_ssp_byte(byte)) on success 84 * returns : (jornada_ssp_byte(byte)) on success
85 * : %-ETIMEOUT on timeout failure 85 * : %-ETIMEDOUT on timeout failure
86 */ 86 */
87int jornada_ssp_inout(u8 byte) 87int jornada_ssp_inout(u8 byte)
88{ 88{
diff --git a/arch/arm/mach-stmp378x/Makefile b/arch/arm/mach-stmp378x/Makefile
new file mode 100644
index 000000000000..d156f76b379f
--- /dev/null
+++ b/arch/arm/mach-stmp378x/Makefile
@@ -0,0 +1,2 @@
1obj-$(CONFIG_ARCH_STMP378X) += stmp378x.o
2obj-$(CONFIG_MACH_STMP378X) += stmp378x_devb.o
diff --git a/arch/arm/mach-stmp378x/Makefile.boot b/arch/arm/mach-stmp378x/Makefile.boot
new file mode 100644
index 000000000000..1568ad404d59
--- /dev/null
+++ b/arch/arm/mach-stmp378x/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x40008000
2params_phys-y := 0x40000100
3initrd_phys-y := 0x40800000
diff --git a/arch/arm/mach-stmp378x/include/mach/entry-macro.S b/arch/arm/mach-stmp378x/include/mach/entry-macro.S
new file mode 100644
index 000000000000..731a92286da2
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/entry-macro.S
@@ -0,0 +1,35 @@
1/*
2 * Low-level IRQ helper macros for Freescale STMP378X
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19 .macro disable_fiq
20 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23
24 mov \base, #0xf0000000 @ vm address of IRQ controller
25 ldr \irqnr, [\base, #0x70] @ HW_ICOLL_STAT
26 cmp \irqnr, #0x7f
27 moveqs \irqnr, #0 @ Zero flag set for no IRQ
28
29 .endm
30
31 .macro get_irqnr_preamble, base, tmp
32 .endm
33
34 .macro arch_ret_to_user, tmp1, tmp2
35 .endm
diff --git a/arch/arm/mach-stmp378x/include/mach/irqs.h b/arch/arm/mach-stmp378x/include/mach/irqs.h
new file mode 100644
index 000000000000..cc59673becdd
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/irqs.h
@@ -0,0 +1,95 @@
1/*
2 * Freescale STMP378X interrupts
3 *
4 * Copyright (C) 2005 Sigmatel Inc
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19#define IRQ_DEBUG_UART 0
20#define IRQ_COMMS_RX 1
21#define IRQ_COMMS_TX 1
22#define IRQ_SSP2_ERROR 2
23#define IRQ_VDD5V 3
24#define IRQ_HEADPHONE_SHORT 4
25#define IRQ_DAC_DMA 5
26#define IRQ_DAC_ERROR 6
27#define IRQ_ADC_DMA 7
28#define IRQ_ADC_ERROR 8
29#define IRQ_SPDIF_DMA 9
30#define IRQ_SAIF2_DMA 9
31#define IRQ_SPDIF_ERROR 10
32#define IRQ_SAIF1_IRQ 10
33#define IRQ_SAIF2_IRQ 10
34#define IRQ_USB_CTRL 11
35#define IRQ_USB_WAKEUP 12
36#define IRQ_GPMI_DMA 13
37#define IRQ_SSP1_DMA 14
38#define IRQ_SSP_ERROR 15
39#define IRQ_GPIO0 16
40#define IRQ_GPIO1 17
41#define IRQ_GPIO2 18
42#define IRQ_SAIF1_DMA 19
43#define IRQ_SSP2_DMA 20
44#define IRQ_ECC8_IRQ 21
45#define IRQ_RTC_ALARM 22
46#define IRQ_UARTAPP_TX_DMA 23
47#define IRQ_UARTAPP_INTERNAL 24
48#define IRQ_UARTAPP_RX_DMA 25
49#define IRQ_I2C_DMA 26
50#define IRQ_I2C_ERROR 27
51#define IRQ_TIMER0 28
52#define IRQ_TIMER1 29
53#define IRQ_TIMER2 30
54#define IRQ_TIMER3 31
55#define IRQ_BATT_BRNOUT 32
56#define IRQ_VDDD_BRNOUT 33
57#define IRQ_VDDIO_BRNOUT 34
58#define IRQ_VDD18_BRNOUT 35
59#define IRQ_TOUCH_DETECT 36
60#define IRQ_LRADC_CH0 37
61#define IRQ_LRADC_CH1 38
62#define IRQ_LRADC_CH2 39
63#define IRQ_LRADC_CH3 40
64#define IRQ_LRADC_CH4 41
65#define IRQ_LRADC_CH5 42
66#define IRQ_LRADC_CH6 43
67#define IRQ_LRADC_CH7 44
68#define IRQ_LCDIF_DMA 45
69#define IRQ_LCDIF_ERROR 46
70#define IRQ_DIGCTL_DEBUG_TRAP 47
71#define IRQ_RTC_1MSEC 48
72#define IRQ_DRI_DMA 49
73#define IRQ_DRI_ATTENTION 50
74#define IRQ_GPMI_ATTENTION 51
75#define IRQ_IR 52
76#define IRQ_DCP_VMI 53
77#define IRQ_DCP 54
78#define IRQ_BCH 56
79#define IRQ_PXP 57
80#define IRQ_UARTAPP2_TX_DMA 58
81#define IRQ_UARTAPP2_INTERNAL 59
82#define IRQ_UARTAPP2_RX_DMA 60
83#define IRQ_VDAC_DETECT 61
84#define IRQ_VDD5V_DROOP 64
85#define IRQ_DCDC4P2_BO 65
86
87
88#define NR_REAL_IRQS 128
89#define NR_IRQS (NR_REAL_IRQS + 32 * 3)
90
91/* All interrupts are FIQ capable */
92#define FIQ_START IRQ_DEBUG_UART
93
94/* Hard disk IRQ is a GPMI attention IRQ */
95#define IRQ_HARDDISK IRQ_GPMI_ATTENTION
diff --git a/arch/arm/mach-stmp378x/include/mach/pins.h b/arch/arm/mach-stmp378x/include/mach/pins.h
new file mode 100644
index 000000000000..93f952d35969
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/pins.h
@@ -0,0 +1,151 @@
1/*
2 * Freescale STMP378X SoC pin multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_ARCH_PINS_H
19#define __ASM_ARCH_PINS_H
20
21/*
22 * Define all STMP378x pins, a pin name corresponds to a STMP378x hardware
23 * interface this pin belongs to.
24 */
25
26/* Bank 0 */
27#define PINID_GPMI_D00 STMP3XXX_PINID(0, 0)
28#define PINID_GPMI_D01 STMP3XXX_PINID(0, 1)
29#define PINID_GPMI_D02 STMP3XXX_PINID(0, 2)
30#define PINID_GPMI_D03 STMP3XXX_PINID(0, 3)
31#define PINID_GPMI_D04 STMP3XXX_PINID(0, 4)
32#define PINID_GPMI_D05 STMP3XXX_PINID(0, 5)
33#define PINID_GPMI_D06 STMP3XXX_PINID(0, 6)
34#define PINID_GPMI_D07 STMP3XXX_PINID(0, 7)
35#define PINID_GPMI_D08 STMP3XXX_PINID(0, 8)
36#define PINID_GPMI_D09 STMP3XXX_PINID(0, 9)
37#define PINID_GPMI_D10 STMP3XXX_PINID(0, 10)
38#define PINID_GPMI_D11 STMP3XXX_PINID(0, 11)
39#define PINID_GPMI_D12 STMP3XXX_PINID(0, 12)
40#define PINID_GPMI_D13 STMP3XXX_PINID(0, 13)
41#define PINID_GPMI_D14 STMP3XXX_PINID(0, 14)
42#define PINID_GPMI_D15 STMP3XXX_PINID(0, 15)
43#define PINID_GPMI_CLE STMP3XXX_PINID(0, 16)
44#define PINID_GPMI_ALE STMP3XXX_PINID(0, 17)
45#define PINID_GMPI_CE2N STMP3XXX_PINID(0, 18)
46#define PINID_GPMI_RDY0 STMP3XXX_PINID(0, 19)
47#define PINID_GPMI_RDY1 STMP3XXX_PINID(0, 20)
48#define PINID_GPMI_RDY2 STMP3XXX_PINID(0, 21)
49#define PINID_GPMI_RDY3 STMP3XXX_PINID(0, 22)
50#define PINID_GPMI_WPN STMP3XXX_PINID(0, 23)
51#define PINID_GPMI_WRN STMP3XXX_PINID(0, 24)
52#define PINID_GPMI_RDN STMP3XXX_PINID(0, 25)
53#define PINID_AUART1_CTS STMP3XXX_PINID(0, 26)
54#define PINID_AUART1_RTS STMP3XXX_PINID(0, 27)
55#define PINID_AUART1_RX STMP3XXX_PINID(0, 28)
56#define PINID_AUART1_TX STMP3XXX_PINID(0, 29)
57#define PINID_I2C_SCL STMP3XXX_PINID(0, 30)
58#define PINID_I2C_SDA STMP3XXX_PINID(0, 31)
59
60/* Bank 1 */
61#define PINID_LCD_D00 STMP3XXX_PINID(1, 0)
62#define PINID_LCD_D01 STMP3XXX_PINID(1, 1)
63#define PINID_LCD_D02 STMP3XXX_PINID(1, 2)
64#define PINID_LCD_D03 STMP3XXX_PINID(1, 3)
65#define PINID_LCD_D04 STMP3XXX_PINID(1, 4)
66#define PINID_LCD_D05 STMP3XXX_PINID(1, 5)
67#define PINID_LCD_D06 STMP3XXX_PINID(1, 6)
68#define PINID_LCD_D07 STMP3XXX_PINID(1, 7)
69#define PINID_LCD_D08 STMP3XXX_PINID(1, 8)
70#define PINID_LCD_D09 STMP3XXX_PINID(1, 9)
71#define PINID_LCD_D10 STMP3XXX_PINID(1, 10)
72#define PINID_LCD_D11 STMP3XXX_PINID(1, 11)
73#define PINID_LCD_D12 STMP3XXX_PINID(1, 12)
74#define PINID_LCD_D13 STMP3XXX_PINID(1, 13)
75#define PINID_LCD_D14 STMP3XXX_PINID(1, 14)
76#define PINID_LCD_D15 STMP3XXX_PINID(1, 15)
77#define PINID_LCD_D16 STMP3XXX_PINID(1, 16)
78#define PINID_LCD_D17 STMP3XXX_PINID(1, 17)
79#define PINID_LCD_RESET STMP3XXX_PINID(1, 18)
80#define PINID_LCD_RS STMP3XXX_PINID(1, 19)
81#define PINID_LCD_WR STMP3XXX_PINID(1, 20)
82#define PINID_LCD_CS STMP3XXX_PINID(1, 21)
83#define PINID_LCD_DOTCK STMP3XXX_PINID(1, 22)
84#define PINID_LCD_ENABLE STMP3XXX_PINID(1, 23)
85#define PINID_LCD_HSYNC STMP3XXX_PINID(1, 24)
86#define PINID_LCD_VSYNC STMP3XXX_PINID(1, 25)
87#define PINID_PWM0 STMP3XXX_PINID(1, 26)
88#define PINID_PWM1 STMP3XXX_PINID(1, 27)
89#define PINID_PWM2 STMP3XXX_PINID(1, 28)
90#define PINID_PWM3 STMP3XXX_PINID(1, 29)
91#define PINID_PWM4 STMP3XXX_PINID(1, 30)
92
93/* Bank 2 */
94#define PINID_SSP1_CMD STMP3XXX_PINID(2, 0)
95#define PINID_SSP1_DETECT STMP3XXX_PINID(2, 1)
96#define PINID_SSP1_DATA0 STMP3XXX_PINID(2, 2)
97#define PINID_SSP1_DATA1 STMP3XXX_PINID(2, 3)
98#define PINID_SSP1_DATA2 STMP3XXX_PINID(2, 4)
99#define PINID_SSP1_DATA3 STMP3XXX_PINID(2, 5)
100#define PINID_SSP1_SCK STMP3XXX_PINID(2, 6)
101#define PINID_ROTARYA STMP3XXX_PINID(2, 7)
102#define PINID_ROTARYB STMP3XXX_PINID(2, 8)
103#define PINID_EMI_A00 STMP3XXX_PINID(2, 9)
104#define PINID_EMI_A01 STMP3XXX_PINID(2, 10)
105#define PINID_EMI_A02 STMP3XXX_PINID(2, 11)
106#define PINID_EMI_A03 STMP3XXX_PINID(2, 12)
107#define PINID_EMI_A04 STMP3XXX_PINID(2, 13)
108#define PINID_EMI_A05 STMP3XXX_PINID(2, 14)
109#define PINID_EMI_A06 STMP3XXX_PINID(2, 15)
110#define PINID_EMI_A07 STMP3XXX_PINID(2, 16)
111#define PINID_EMI_A08 STMP3XXX_PINID(2, 17)
112#define PINID_EMI_A09 STMP3XXX_PINID(2, 18)
113#define PINID_EMI_A10 STMP3XXX_PINID(2, 19)
114#define PINID_EMI_A11 STMP3XXX_PINID(2, 20)
115#define PINID_EMI_A12 STMP3XXX_PINID(2, 21)
116#define PINID_EMI_BA0 STMP3XXX_PINID(2, 22)
117#define PINID_EMI_BA1 STMP3XXX_PINID(2, 23)
118#define PINID_EMI_CASN STMP3XXX_PINID(2, 24)
119#define PINID_EMI_CE0N STMP3XXX_PINID(2, 25)
120#define PINID_EMI_CE1N STMP3XXX_PINID(2, 26)
121#define PINID_GPMI_CE1N STMP3XXX_PINID(2, 27)
122#define PINID_GPMI_CE0N STMP3XXX_PINID(2, 28)
123#define PINID_EMI_CKE STMP3XXX_PINID(2, 29)
124#define PINID_EMI_RASN STMP3XXX_PINID(2, 30)
125#define PINID_EMI_WEN STMP3XXX_PINID(2, 31)
126
127/* Bank 3 */
128#define PINID_EMI_D00 STMP3XXX_PINID(3, 0)
129#define PINID_EMI_D01 STMP3XXX_PINID(3, 1)
130#define PINID_EMI_D02 STMP3XXX_PINID(3, 2)
131#define PINID_EMI_D03 STMP3XXX_PINID(3, 3)
132#define PINID_EMI_D04 STMP3XXX_PINID(3, 4)
133#define PINID_EMI_D05 STMP3XXX_PINID(3, 5)
134#define PINID_EMI_D06 STMP3XXX_PINID(3, 6)
135#define PINID_EMI_D07 STMP3XXX_PINID(3, 7)
136#define PINID_EMI_D08 STMP3XXX_PINID(3, 8)
137#define PINID_EMI_D09 STMP3XXX_PINID(3, 9)
138#define PINID_EMI_D10 STMP3XXX_PINID(3, 10)
139#define PINID_EMI_D11 STMP3XXX_PINID(3, 11)
140#define PINID_EMI_D12 STMP3XXX_PINID(3, 12)
141#define PINID_EMI_D13 STMP3XXX_PINID(3, 13)
142#define PINID_EMI_D14 STMP3XXX_PINID(3, 14)
143#define PINID_EMI_D15 STMP3XXX_PINID(3, 15)
144#define PINID_EMI_DQM0 STMP3XXX_PINID(3, 16)
145#define PINID_EMI_DQM1 STMP3XXX_PINID(3, 17)
146#define PINID_EMI_DQS0 STMP3XXX_PINID(3, 18)
147#define PINID_EMI_DQS1 STMP3XXX_PINID(3, 19)
148#define PINID_EMI_CLK STMP3XXX_PINID(3, 20)
149#define PINID_EMI_CLKN STMP3XXX_PINID(3, 21)
150
151#endif /* __ASM_ARCH_PINS_H */
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-apbh.h b/arch/arm/mach-stmp378x/include/mach/regs-apbh.h
new file mode 100644
index 000000000000..dbcf85b6ac2a
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-apbh.h
@@ -0,0 +1,101 @@
1/*
2 * stmp378x: APBH register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_APBH
22#define _MACH_REGS_APBH
23
24#define REGS_APBH_BASE (STMP3XXX_REGS_BASE + 0x4000)
25#define REGS_APBH_PHYS 0x80004000
26#define REGS_APBH_SIZE 0x2000
27
28#define HW_APBH_CTRL0 0x0
29#define BM_APBH_CTRL0_RESET_CHANNEL 0x00FF0000
30#define BP_APBH_CTRL0_RESET_CHANNEL 16
31#define BM_APBH_CTRL0_CLKGATE 0x40000000
32#define BM_APBH_CTRL0_SFTRST 0x80000000
33
34#define HW_APBH_CTRL1 0x10
35#define BM_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0x00000001
36#define BP_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0
37
38#define HW_APBH_CTRL2 0x20
39
40#define HW_APBH_DEVSEL 0x30
41
42#define HW_APBH_CH0_NXTCMDAR (0x50 + 0 * 0x70)
43#define HW_APBH_CH1_NXTCMDAR (0x50 + 1 * 0x70)
44#define HW_APBH_CH2_NXTCMDAR (0x50 + 2 * 0x70)
45#define HW_APBH_CH3_NXTCMDAR (0x50 + 3 * 0x70)
46#define HW_APBH_CH4_NXTCMDAR (0x50 + 4 * 0x70)
47#define HW_APBH_CH5_NXTCMDAR (0x50 + 5 * 0x70)
48#define HW_APBH_CH6_NXTCMDAR (0x50 + 6 * 0x70)
49#define HW_APBH_CH7_NXTCMDAR (0x50 + 7 * 0x70)
50#define HW_APBH_CH8_NXTCMDAR (0x50 + 8 * 0x70)
51#define HW_APBH_CH9_NXTCMDAR (0x50 + 9 * 0x70)
52#define HW_APBH_CH10_NXTCMDAR (0x50 + 10 * 0x70)
53#define HW_APBH_CH11_NXTCMDAR (0x50 + 11 * 0x70)
54#define HW_APBH_CH12_NXTCMDAR (0x50 + 12 * 0x70)
55#define HW_APBH_CH13_NXTCMDAR (0x50 + 13 * 0x70)
56#define HW_APBH_CH14_NXTCMDAR (0x50 + 14 * 0x70)
57#define HW_APBH_CH15_NXTCMDAR (0x50 + 15 * 0x70)
58
59#define HW_APBH_CHn_NXTCMDAR 0x50
60
61#define BV_APBH_CHn_CMD_COMMAND__NO_DMA_XFER 0
62#define BV_APBH_CHn_CMD_COMMAND__DMA_WRITE 1
63#define BV_APBH_CHn_CMD_COMMAND__DMA_READ 2
64#define BV_APBH_CHn_CMD_COMMAND__DMA_SENSE 3
65#define BM_APBH_CHn_CMD_COMMAND 0x00000003
66#define BP_APBH_CHn_CMD_COMMAND 0
67#define BM_APBH_CHn_CMD_CHAIN 0x00000004
68#define BM_APBH_CHn_CMD_IRQONCMPLT 0x00000008
69#define BM_APBH_CHn_CMD_NANDLOCK 0x00000010
70#define BM_APBH_CHn_CMD_NANDWAIT4READY 0x00000020
71#define BM_APBH_CHn_CMD_SEMAPHORE 0x00000040
72#define BM_APBH_CHn_CMD_WAIT4ENDCMD 0x00000080
73#define BM_APBH_CHn_CMD_CMDWORDS 0x0000F000
74#define BP_APBH_CHn_CMD_CMDWORDS 12
75#define BM_APBH_CHn_CMD_XFER_COUNT 0xFFFF0000
76#define BP_APBH_CHn_CMD_XFER_COUNT 16
77
78#define HW_APBH_CH0_SEMA (0x80 + 0 * 0x70)
79#define HW_APBH_CH1_SEMA (0x80 + 1 * 0x70)
80#define HW_APBH_CH2_SEMA (0x80 + 2 * 0x70)
81#define HW_APBH_CH3_SEMA (0x80 + 3 * 0x70)
82#define HW_APBH_CH4_SEMA (0x80 + 4 * 0x70)
83#define HW_APBH_CH5_SEMA (0x80 + 5 * 0x70)
84#define HW_APBH_CH6_SEMA (0x80 + 6 * 0x70)
85#define HW_APBH_CH7_SEMA (0x80 + 7 * 0x70)
86#define HW_APBH_CH8_SEMA (0x80 + 8 * 0x70)
87#define HW_APBH_CH9_SEMA (0x80 + 9 * 0x70)
88#define HW_APBH_CH10_SEMA (0x80 + 10 * 0x70)
89#define HW_APBH_CH11_SEMA (0x80 + 11 * 0x70)
90#define HW_APBH_CH12_SEMA (0x80 + 12 * 0x70)
91#define HW_APBH_CH13_SEMA (0x80 + 13 * 0x70)
92#define HW_APBH_CH14_SEMA (0x80 + 14 * 0x70)
93#define HW_APBH_CH15_SEMA (0x80 + 15 * 0x70)
94
95#define HW_APBH_CHn_SEMA 0x80
96#define BM_APBH_CHn_SEMA_INCREMENT_SEMA 0x000000FF
97#define BP_APBH_CHn_SEMA_INCREMENT_SEMA 0
98#define BM_APBH_CHn_SEMA_PHORE 0x00FF0000
99#define BP_APBH_CHn_SEMA_PHORE 16
100
101#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-apbx.h b/arch/arm/mach-stmp378x/include/mach/regs-apbx.h
new file mode 100644
index 000000000000..3b934a4d27f0
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-apbx.h
@@ -0,0 +1,119 @@
1/*
2 * stmp378x: APBX register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_APBX
22#define _MACH_REGS_APBX
23
24#define REGS_APBX_BASE (STMP3XXX_REGS_BASE + 0x24000)
25#define REGS_APBX_PHYS 0x80024000
26#define REGS_APBX_SIZE 0x2000
27
28#define HW_APBX_CTRL0 0x0
29#define BM_APBX_CTRL0_CLKGATE 0x40000000
30#define BM_APBX_CTRL0_SFTRST 0x80000000
31
32#define HW_APBX_CTRL1 0x10
33
34#define HW_APBX_CTRL2 0x20
35
36#define HW_APBX_CHANNEL_CTRL 0x30
37#define BM_APBX_CHANNEL_CTRL_RESET_CHANNEL 0xFFFF0000
38#define BP_APBX_CHANNEL_CTRL_RESET_CHANNEL 16
39
40#define HW_APBX_DEVSEL 0x40
41
42#define HW_APBX_CH0_NXTCMDAR (0x110 + 0 * 0x70)
43#define HW_APBX_CH1_NXTCMDAR (0x110 + 1 * 0x70)
44#define HW_APBX_CH2_NXTCMDAR (0x110 + 2 * 0x70)
45#define HW_APBX_CH3_NXTCMDAR (0x110 + 3 * 0x70)
46#define HW_APBX_CH4_NXTCMDAR (0x110 + 4 * 0x70)
47#define HW_APBX_CH5_NXTCMDAR (0x110 + 5 * 0x70)
48#define HW_APBX_CH6_NXTCMDAR (0x110 + 6 * 0x70)
49#define HW_APBX_CH7_NXTCMDAR (0x110 + 7 * 0x70)
50#define HW_APBX_CH8_NXTCMDAR (0x110 + 8 * 0x70)
51#define HW_APBX_CH9_NXTCMDAR (0x110 + 9 * 0x70)
52#define HW_APBX_CH10_NXTCMDAR (0x110 + 10 * 0x70)
53#define HW_APBX_CH11_NXTCMDAR (0x110 + 11 * 0x70)
54#define HW_APBX_CH12_NXTCMDAR (0x110 + 12 * 0x70)
55#define HW_APBX_CH13_NXTCMDAR (0x110 + 13 * 0x70)
56#define HW_APBX_CH14_NXTCMDAR (0x110 + 14 * 0x70)
57#define HW_APBX_CH15_NXTCMDAR (0x110 + 15 * 0x70)
58
59#define HW_APBX_CHn_NXTCMDAR 0x110
60#define BM_APBX_CHn_CMD_COMMAND 0x00000003
61#define BP_APBX_CHn_CMD_COMMAND 0
62#define BV_APBX_CHn_CMD_COMMAND__NO_DMA_XFER 0
63#define BV_APBX_CHn_CMD_COMMAND__DMA_WRITE 1
64#define BV_APBX_CHn_CMD_COMMAND__DMA_READ 2
65#define BV_APBX_CHn_CMD_COMMAND__DMA_SENSE 3
66#define BM_APBX_CHn_CMD_CHAIN 0x00000004
67#define BM_APBX_CHn_CMD_IRQONCMPLT 0x00000008
68#define BM_APBX_CHn_CMD_SEMAPHORE 0x00000040
69#define BM_APBX_CHn_CMD_WAIT4ENDCMD 0x00000080
70#define BM_APBX_CHn_CMD_HALTONTERMINATE 0x00000100
71#define BM_APBX_CHn_CMD_CMDWORDS 0x0000F000
72#define BP_APBX_CHn_CMD_CMDWORDS 12
73#define BM_APBX_CHn_CMD_XFER_COUNT 0xFFFF0000
74#define BP_APBX_CHn_CMD_XFER_COUNT 16
75
76#define HW_APBX_CH0_BAR (0x130 + 0 * 0x70)
77#define HW_APBX_CH1_BAR (0x130 + 1 * 0x70)
78#define HW_APBX_CH2_BAR (0x130 + 2 * 0x70)
79#define HW_APBX_CH3_BAR (0x130 + 3 * 0x70)
80#define HW_APBX_CH4_BAR (0x130 + 4 * 0x70)
81#define HW_APBX_CH5_BAR (0x130 + 5 * 0x70)
82#define HW_APBX_CH6_BAR (0x130 + 6 * 0x70)
83#define HW_APBX_CH7_BAR (0x130 + 7 * 0x70)
84#define HW_APBX_CH8_BAR (0x130 + 8 * 0x70)
85#define HW_APBX_CH9_BAR (0x130 + 9 * 0x70)
86#define HW_APBX_CH10_BAR (0x130 + 10 * 0x70)
87#define HW_APBX_CH11_BAR (0x130 + 11 * 0x70)
88#define HW_APBX_CH12_BAR (0x130 + 12 * 0x70)
89#define HW_APBX_CH13_BAR (0x130 + 13 * 0x70)
90#define HW_APBX_CH14_BAR (0x130 + 14 * 0x70)
91#define HW_APBX_CH15_BAR (0x130 + 15 * 0x70)
92
93#define HW_APBX_CHn_BAR 0x130
94
95#define HW_APBX_CH0_SEMA (0x140 + 0 * 0x70)
96#define HW_APBX_CH1_SEMA (0x140 + 1 * 0x70)
97#define HW_APBX_CH2_SEMA (0x140 + 2 * 0x70)
98#define HW_APBX_CH3_SEMA (0x140 + 3 * 0x70)
99#define HW_APBX_CH4_SEMA (0x140 + 4 * 0x70)
100#define HW_APBX_CH5_SEMA (0x140 + 5 * 0x70)
101#define HW_APBX_CH6_SEMA (0x140 + 6 * 0x70)
102#define HW_APBX_CH7_SEMA (0x140 + 7 * 0x70)
103#define HW_APBX_CH8_SEMA (0x140 + 8 * 0x70)
104#define HW_APBX_CH9_SEMA (0x140 + 9 * 0x70)
105#define HW_APBX_CH10_SEMA (0x140 + 10 * 0x70)
106#define HW_APBX_CH11_SEMA (0x140 + 11 * 0x70)
107#define HW_APBX_CH12_SEMA (0x140 + 12 * 0x70)
108#define HW_APBX_CH13_SEMA (0x140 + 13 * 0x70)
109#define HW_APBX_CH14_SEMA (0x140 + 14 * 0x70)
110#define HW_APBX_CH15_SEMA (0x140 + 15 * 0x70)
111
112#define HW_APBX_CHn_SEMA 0x140
113#define BM_APBX_CHn_SEMA_INCREMENT_SEMA 0x000000FF
114#define BP_APBX_CHn_SEMA_INCREMENT_SEMA 0
115#define BM_APBX_CHn_SEMA_PHORE 0x00FF0000
116#define BP_APBX_CHn_SEMA_PHORE 16
117
118#endif
119
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-audioin.h b/arch/arm/mach-stmp378x/include/mach/regs-audioin.h
new file mode 100644
index 000000000000..641ac6126f83
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-audioin.h
@@ -0,0 +1,63 @@
1/*
2 * stmp378x: AUDIOIN register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_AUDIOIN_BASE (STMP3XXX_REGS_BASE + 0x4C000)
22#define REGS_AUDIOIN_PHYS 0x8004C000
23#define REGS_AUDIOIN_SIZE 0x2000
24
25#define HW_AUDIOIN_CTRL 0x0
26#define BM_AUDIOIN_CTRL_RUN 0x00000001
27#define BP_AUDIOIN_CTRL_RUN 0
28#define BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
29#define BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
30#define BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
31#define BM_AUDIOIN_CTRL_WORD_LENGTH 0x00000020
32#define BM_AUDIOIN_CTRL_CLKGATE 0x40000000
33#define BM_AUDIOIN_CTRL_SFTRST 0x80000000
34
35#define HW_AUDIOIN_STAT 0x10
36
37#define HW_AUDIOIN_ADCSRR 0x20
38
39#define HW_AUDIOIN_ADCVOLUME 0x30
40#define BM_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0x000000FF
41#define BP_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0
42#define BM_AUDIOIN_ADCVOLUME_VOLUME_LEFT 0x00FF0000
43#define BP_AUDIOIN_ADCVOLUME_VOLUME_LEFT 16
44
45#define HW_AUDIOIN_ADCDEBUG 0x40
46
47#define HW_AUDIOIN_ADCVOL 0x50
48#define BM_AUDIOIN_ADCVOL_GAIN_RIGHT 0x0000000F
49#define BP_AUDIOIN_ADCVOL_GAIN_RIGHT 0
50#define BM_AUDIOIN_ADCVOL_SELECT_RIGHT 0x00000030
51#define BP_AUDIOIN_ADCVOL_SELECT_RIGHT 4
52#define BM_AUDIOIN_ADCVOL_GAIN_LEFT 0x00000F00
53#define BP_AUDIOIN_ADCVOL_GAIN_LEFT 8
54#define BM_AUDIOIN_ADCVOL_SELECT_LEFT 0x00003000
55#define BP_AUDIOIN_ADCVOL_SELECT_LEFT 12
56#define BM_AUDIOIN_ADCVOL_MUTE 0x01000000
57
58#define HW_AUDIOIN_MICLINE 0x60
59
60#define HW_AUDIOIN_ANACLKCTRL 0x70
61#define BM_AUDIOIN_ANACLKCTRL_CLKGATE 0x80000000
62
63#define HW_AUDIOIN_DATA 0x80
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-audioout.h b/arch/arm/mach-stmp378x/include/mach/regs-audioout.h
new file mode 100644
index 000000000000..f533e23694a0
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-audioout.h
@@ -0,0 +1,104 @@
1/*
2 * stmp378x: AUDIOOUT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_AUDIOOUT_BASE (STMP3XXX_REGS_BASE + 0x48000)
22#define REGS_AUDIOOUT_PHYS 0x80048000
23#define REGS_AUDIOOUT_SIZE 0x2000
24
25#define HW_AUDIOOUT_CTRL 0x0
26#define BM_AUDIOOUT_CTRL_RUN 0x00000001
27#define BP_AUDIOOUT_CTRL_RUN 0
28#define BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
29#define BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
30#define BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
31#define BM_AUDIOOUT_CTRL_WORD_LENGTH 0x00000040
32#define BM_AUDIOOUT_CTRL_CLKGATE 0x40000000
33#define BM_AUDIOOUT_CTRL_SFTRST 0x80000000
34
35#define HW_AUDIOOUT_STAT 0x10
36
37#define HW_AUDIOOUT_DACSRR 0x20
38#define BM_AUDIOOUT_DACSRR_SRC_FRAC 0x00001FFF
39#define BP_AUDIOOUT_DACSRR_SRC_FRAC 0
40#define BM_AUDIOOUT_DACSRR_SRC_INT 0x001F0000
41#define BP_AUDIOOUT_DACSRR_SRC_INT 16
42#define BM_AUDIOOUT_DACSRR_SRC_HOLD 0x07000000
43#define BP_AUDIOOUT_DACSRR_SRC_HOLD 24
44#define BM_AUDIOOUT_DACSRR_BASEMULT 0x70000000
45#define BP_AUDIOOUT_DACSRR_BASEMULT 28
46
47#define HW_AUDIOOUT_DACVOLUME 0x30
48#define BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT 0x00000100
49#define BM_AUDIOOUT_DACVOLUME_MUTE_LEFT 0x01000000
50#define BM_AUDIOOUT_DACVOLUME_EN_ZCD 0x02000000
51
52#define HW_AUDIOOUT_DACDEBUG 0x40
53
54#define HW_AUDIOOUT_HPVOL 0x50
55#define BM_AUDIOOUT_HPVOL_MUTE 0x01000000
56#define BM_AUDIOOUT_HPVOL_EN_MSTR_ZCD 0x02000000
57
58#define HW_AUDIOOUT_PWRDN 0x70
59#define BM_AUDIOOUT_PWRDN_HEADPHONE 0x00000001
60#define BP_AUDIOOUT_PWRDN_HEADPHONE 0
61#define BM_AUDIOOUT_PWRDN_CAPLESS 0x00000010
62#define BM_AUDIOOUT_PWRDN_ADC 0x00000100
63#define BM_AUDIOOUT_PWRDN_DAC 0x00001000
64#define BM_AUDIOOUT_PWRDN_RIGHT_ADC 0x00010000
65#define BM_AUDIOOUT_PWRDN_SPEAKER 0x01000000
66
67#define HW_AUDIOOUT_REFCTRL 0x80
68#define BM_AUDIOOUT_REFCTRL_VAG_VAL 0x000000F0
69#define BP_AUDIOOUT_REFCTRL_VAG_VAL 4
70#define BM_AUDIOOUT_REFCTRL_ADC_REFVAL 0x00000F00
71#define BP_AUDIOOUT_REFCTRL_ADC_REFVAL 8
72#define BM_AUDIOOUT_REFCTRL_ADJ_VAG 0x00001000
73#define BM_AUDIOOUT_REFCTRL_ADJ_ADC 0x00002000
74#define BM_AUDIOOUT_REFCTRL_BIAS_CTRL 0x00030000
75#define BP_AUDIOOUT_REFCTRL_BIAS_CTRL 16
76#define BM_AUDIOOUT_REFCTRL_LOW_PWR 0x00080000
77#define BM_AUDIOOUT_REFCTRL_VBG_ADJ 0x00700000
78#define BP_AUDIOOUT_REFCTRL_VBG_ADJ 20
79#define BM_AUDIOOUT_REFCTRL_XTAL_BGR_BIAS 0x01000000
80#define BM_AUDIOOUT_REFCTRL_RAISE_REF 0x02000000
81
82#define HW_AUDIOOUT_ANACTRL 0x90
83#define BM_AUDIOOUT_ANACTRL_HP_CLASSAB 0x00000010
84#define BM_AUDIOOUT_ANACTRL_HP_HOLD_GND 0x00000020
85
86#define HW_AUDIOOUT_TEST 0xA0
87#define BM_AUDIOOUT_TEST_HP_I1_ADJ 0x00C00000
88#define BP_AUDIOOUT_TEST_HP_I1_ADJ 22
89
90#define HW_AUDIOOUT_BISTCTRL 0xB0
91
92#define HW_AUDIOOUT_BISTSTAT0 0xC0
93
94#define HW_AUDIOOUT_BISTSTAT1 0xD0
95
96#define HW_AUDIOOUT_ANACLKCTRL 0xE0
97#define BM_AUDIOOUT_ANACLKCTRL_CLKGATE 0x80000000
98
99#define HW_AUDIOOUT_DATA 0xF0
100
101#define HW_AUDIOOUT_SPEAKERCTRL 0x100
102#define BM_AUDIOOUT_SPEAKERCTRL_MUTE 0x01000000
103
104#define HW_AUDIOOUT_VERSION 0x200
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-bch.h b/arch/arm/mach-stmp378x/include/mach/regs-bch.h
new file mode 100644
index 000000000000..532d24650717
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-bch.h
@@ -0,0 +1,56 @@
1/*
2 * stmp378x: BCH register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_BCH_BASE (STMP3XXX_REGS_BASE + 0xA000)
22#define REGS_BCH_PHYS 0x8000A000
23#define REGS_BCH_SIZE 0x2000
24
25#define HW_BCH_CTRL 0x0
26#define BM_BCH_CTRL_COMPLETE_IRQ 0x00000001
27#define BP_BCH_CTRL_COMPLETE_IRQ 0
28#define BM_BCH_CTRL_COMPLETE_IRQ_EN 0x00000100
29
30#define HW_BCH_STATUS0 0x10
31#define BM_BCH_STATUS0_UNCORRECTABLE 0x00000004
32#define BM_BCH_STATUS0_CORRECTED 0x00000008
33#define BM_BCH_STATUS0_STATUS_BLK0 0x0000FF00
34#define BP_BCH_STATUS0_STATUS_BLK0 8
35#define BM_BCH_STATUS0_COMPLETED_CE 0x000F0000
36#define BP_BCH_STATUS0_COMPLETED_CE 16
37
38#define HW_BCH_LAYOUTSELECT 0x70
39
40#define HW_BCH_FLASH0LAYOUT0 0x80
41#define BM_BCH_FLASH0LAYOUT0_DATA0_SIZE 0x00000FFF
42#define BP_BCH_FLASH0LAYOUT0_DATA0_SIZE 0
43#define BM_BCH_FLASH0LAYOUT0_ECC0 0x0000F000
44#define BP_BCH_FLASH0LAYOUT0_ECC0 12
45#define BM_BCH_FLASH0LAYOUT0_META_SIZE 0x00FF0000
46#define BP_BCH_FLASH0LAYOUT0_META_SIZE 16
47#define BM_BCH_FLASH0LAYOUT0_NBLOCKS 0xFF000000
48#define BP_BCH_FLASH0LAYOUT0_NBLOCKS 24
49#define BM_BCH_FLASH0LAYOUT1_DATAN_SIZE 0x00000FFF
50#define BP_BCH_FLASH0LAYOUT1_DATAN_SIZE 0
51#define BM_BCH_FLASH0LAYOUT1_ECCN 0x0000F000
52#define BP_BCH_FLASH0LAYOUT1_ECCN 12
53#define BM_BCH_FLASH0LAYOUT1_PAGE_SIZE 0xFFFF0000
54#define BP_BCH_FLASH0LAYOUT1_PAGE_SIZE 16
55
56#define HW_BCH_BLOCKNAME 0x150
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h b/arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h
new file mode 100644
index 000000000000..7c546afd57a3
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h
@@ -0,0 +1,88 @@
1/*
2 * stmp378x: CLKCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_CLKCTRL
22#define _MACH_REGS_CLKCTRL
23
24#define REGS_CLKCTRL_BASE (STMP3XXX_REGS_BASE + 0x40000)
25#define REGS_CLKCTRL_PHYS 0x80040000
26#define REGS_CLKCTRL_SIZE 0x2000
27
28#define HW_CLKCTRL_PLLCTRL0 0x0
29#define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000
30
31#define HW_CLKCTRL_CPU 0x20
32#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F
33#define BP_CLKCTRL_CPU_DIV_CPU 0
34
35#define HW_CLKCTRL_HBUS 0x30
36#define BM_CLKCTRL_HBUS_DIV 0x0000001F
37#define BP_CLKCTRL_HBUS_DIV 0
38#define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020
39
40#define HW_CLKCTRL_XBUS 0x40
41
42#define HW_CLKCTRL_XTAL 0x50
43#define BM_CLKCTRL_XTAL_DRI_CLK24M_GATE 0x10000000
44
45#define HW_CLKCTRL_PIX 0x60
46#define BM_CLKCTRL_PIX_DIV 0x00000FFF
47#define BP_CLKCTRL_PIX_DIV 0
48#define BM_CLKCTRL_PIX_CLKGATE 0x80000000
49
50#define HW_CLKCTRL_SSP 0x70
51
52#define HW_CLKCTRL_GPMI 0x80
53
54#define HW_CLKCTRL_SPDIF 0x90
55
56#define HW_CLKCTRL_EMI 0xA0
57#define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F
58#define BP_CLKCTRL_EMI_DIV_EMI 0
59#define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000
60#define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000
61#define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000
62#define BM_CLKCTRL_EMI_BUSY_REF_XTAL 0x20000000
63
64#define HW_CLKCTRL_IR 0xB0
65
66#define HW_CLKCTRL_SAIF 0xC0
67
68#define HW_CLKCTRL_TV 0xD0
69
70#define HW_CLKCTRL_ETM 0xE0
71
72#define HW_CLKCTRL_FRAC 0xF0
73#define BM_CLKCTRL_FRAC_EMIFRAC 0x00003F00
74#define BP_CLKCTRL_FRAC_EMIFRAC 8
75#define BM_CLKCTRL_FRAC_PIXFRAC 0x003F0000
76#define BP_CLKCTRL_FRAC_PIXFRAC 16
77#define BM_CLKCTRL_FRAC_CLKGATEPIX 0x00800000
78
79#define HW_CLKCTRL_FRAC1 0x100
80
81#define HW_CLKCTRL_CLKSEQ 0x110
82#define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002
83
84#define HW_CLKCTRL_RESET 0x120
85#define BM_CLKCTRL_RESET_DIG 0x00000001
86#define BP_CLKCTRL_RESET_DIG 0
87
88#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-dcp.h b/arch/arm/mach-stmp378x/include/mach/regs-dcp.h
new file mode 100644
index 000000000000..fdedd00c0e28
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-dcp.h
@@ -0,0 +1,87 @@
1/*
2 * stmp378x: DCP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_DCP_BASE (STMP3XXX_REGS_BASE + 0x28000)
22#define REGS_DCP_PHYS 0x80028000
23#define REGS_DCP_SIZE 0x2000
24
25#define HW_DCP_CTRL 0x0
26#define BM_DCP_CTRL_CHANNEL_INTERRUPT_ENABLE 0x000000FF
27#define BP_DCP_CTRL_CHANNEL_INTERRUPT_ENABLE 0
28#define BM_DCP_CTRL_ENABLE_CONTEXT_CACHING 0x00400000
29#define BM_DCP_CTRL_GATHER_RESIDUAL_WRITES 0x00800000
30#define BM_DCP_CTRL_CLKGATE 0x40000000
31#define BM_DCP_CTRL_SFTRST 0x80000000
32
33#define HW_DCP_STAT 0x10
34#define BM_DCP_STAT_IRQ 0x0000000F
35#define BP_DCP_STAT_IRQ 0
36
37#define HW_DCP_CHANNELCTRL 0x20
38#define BM_DCP_CHANNELCTRL_ENABLE_CHANNEL 0x000000FF
39#define BP_DCP_CHANNELCTRL_ENABLE_CHANNEL 0
40
41#define HW_DCP_CONTEXT 0x50
42#define BM_DCP_PACKET1_INTERRUPT 0x00000001
43#define BP_DCP_PACKET1_INTERRUPT 0
44#define BM_DCP_PACKET1_DECR_SEMAPHORE 0x00000002
45#define BM_DCP_PACKET1_CHAIN 0x00000004
46#define BM_DCP_PACKET1_CHAIN_CONTIGUOUS 0x00000008
47#define BM_DCP_PACKET1_ENABLE_CIPHER 0x00000020
48#define BM_DCP_PACKET1_ENABLE_HASH 0x00000040
49#define BM_DCP_PACKET1_CIPHER_ENCRYPT 0x00000100
50#define BM_DCP_PACKET1_CIPHER_INIT 0x00000200
51#define BM_DCP_PACKET1_OTP_KEY 0x00000400
52#define BM_DCP_PACKET1_PAYLOAD_KEY 0x00000800
53#define BM_DCP_PACKET1_HASH_INIT 0x00001000
54#define BM_DCP_PACKET1_HASH_TERM 0x00002000
55#define BM_DCP_PACKET2_CIPHER_SELECT 0x0000000F
56#define BP_DCP_PACKET2_CIPHER_SELECT 0
57#define BM_DCP_PACKET2_CIPHER_MODE 0x000000F0
58#define BP_DCP_PACKET2_CIPHER_MODE 4
59#define BM_DCP_PACKET2_KEY_SELECT 0x0000FF00
60#define BP_DCP_PACKET2_KEY_SELECT 8
61#define BM_DCP_PACKET2_HASH_SELECT 0x000F0000
62#define BP_DCP_PACKET2_HASH_SELECT 16
63#define BM_DCP_PACKET2_CIPHER_CFG 0xFF000000
64#define BP_DCP_PACKET2_CIPHER_CFG 24
65
66#define HW_DCP_CH0CMDPTR (0x100 + 0 * 0x40)
67#define HW_DCP_CH1CMDPTR (0x100 + 1 * 0x40)
68#define HW_DCP_CH2CMDPTR (0x100 + 2 * 0x40)
69#define HW_DCP_CH3CMDPTR (0x100 + 3 * 0x40)
70
71#define HW_DCP_CHnCMDPTR 0x100
72
73#define HW_DCP_CH0SEMA (0x110 + 0 * 0x40)
74#define HW_DCP_CH1SEMA (0x110 + 1 * 0x40)
75#define HW_DCP_CH2SEMA (0x110 + 2 * 0x40)
76#define HW_DCP_CH3SEMA (0x110 + 3 * 0x40)
77
78#define HW_DCP_CHnSEMA 0x110
79#define BM_DCP_CHnSEMA_INCREMENT 0x000000FF
80#define BP_DCP_CHnSEMA_INCREMENT 0
81
82#define HW_DCP_CH0STAT (0x120 + 0 * 0x40)
83#define HW_DCP_CH1STAT (0x120 + 1 * 0x40)
84#define HW_DCP_CH2STAT (0x120 + 2 * 0x40)
85#define HW_DCP_CH3STAT (0x120 + 3 * 0x40)
86
87#define HW_DCP_CHnSTAT 0x120
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-digctl.h b/arch/arm/mach-stmp378x/include/mach/regs-digctl.h
new file mode 100644
index 000000000000..5293005523b3
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-digctl.h
@@ -0,0 +1,38 @@
1/*
2 * stmp378x: DIGCTL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_DIGCTL_BASE (STMP3XXX_REGS_BASE + 0x1C000)
22#define REGS_DIGCTL_PHYS 0x8001C000
23#define REGS_DIGCTL_SIZE 0x2000
24
25#define HW_DIGCTL_CTRL 0x0
26#define BM_DIGCTL_CTRL_USB_CLKGATE 0x00000004
27
28#define HW_DIGCTL_ARMCACHE 0x2B0
29#define BM_DIGCTL_ARMCACHE_ITAG_SS 0x00000003
30#define BP_DIGCTL_ARMCACHE_ITAG_SS 0
31#define BM_DIGCTL_ARMCACHE_DTAG_SS 0x00000030
32#define BP_DIGCTL_ARMCACHE_DTAG_SS 4
33#define BM_DIGCTL_ARMCACHE_CACHE_SS 0x00000300
34#define BP_DIGCTL_ARMCACHE_CACHE_SS 8
35#define BM_DIGCTL_ARMCACHE_DRTY_SS 0x00003000
36#define BP_DIGCTL_ARMCACHE_DRTY_SS 12
37#define BM_DIGCTL_ARMCACHE_VALID_SS 0x00030000
38#define BP_DIGCTL_ARMCACHE_VALID_SS 16
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-dram.h b/arch/arm/mach-stmp378x/include/mach/regs-dram.h
new file mode 100644
index 000000000000..02851431677c
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-dram.h
@@ -0,0 +1,27 @@
1/*
2 * stmp378x: DRAM register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_DRAM_BASE (STMP3XXX_REGS_BASE + 0xE0000)
22#define REGS_DRAM_PHYS 0x800E0000
23#define REGS_DRAM_SIZE 0x2000
24
25#define HW_DRAM_CTL06 0x18
26
27#define HW_DRAM_CTL08 0x20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-dri.h b/arch/arm/mach-stmp378x/include/mach/regs-dri.h
new file mode 100644
index 000000000000..da25f7e397e5
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-dri.h
@@ -0,0 +1,45 @@
1/*
2 * stmp378x: DRI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_DRI_BASE (STMP3XXX_REGS_BASE + 0x74000)
22#define REGS_DRI_PHYS 0x80074000
23#define REGS_DRI_SIZE 0x2000
24
25#define HW_DRI_CTRL 0x0
26#define BM_DRI_CTRL_RUN 0x00000001
27#define BP_DRI_CTRL_RUN 0
28#define BM_DRI_CTRL_ATTENTION_IRQ 0x00000002
29#define BM_DRI_CTRL_PILOT_SYNC_LOSS_IRQ 0x00000004
30#define BM_DRI_CTRL_OVERFLOW_IRQ 0x00000008
31#define BM_DRI_CTRL_ATTENTION_IRQ_EN 0x00000200
32#define BM_DRI_CTRL_PILOT_SYNC_LOSS_IRQ_EN 0x00000400
33#define BM_DRI_CTRL_OVERFLOW_IRQ_EN 0x00000800
34#define BM_DRI_CTRL_REACQUIRE_PHASE 0x00008000
35#define BM_DRI_CTRL_STOP_ON_PILOT_ERROR 0x02000000
36#define BM_DRI_CTRL_STOP_ON_OFLOW_ERROR 0x04000000
37#define BM_DRI_CTRL_ENABLE_INPUTS 0x20000000
38#define BM_DRI_CTRL_CLKGATE 0x40000000
39#define BM_DRI_CTRL_SFTRST 0x80000000
40
41#define HW_DRI_TIMING 0x10
42#define BM_DRI_TIMING_GAP_DETECTION_INTERVAL 0x000000FF
43#define BP_DRI_TIMING_GAP_DETECTION_INTERVAL 0
44#define BM_DRI_TIMING_PILOT_REP_RATE 0x000F0000
45#define BP_DRI_TIMING_PILOT_REP_RATE 16
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ecc8.h b/arch/arm/mach-stmp378x/include/mach/regs-ecc8.h
new file mode 100644
index 000000000000..cc353bec331b
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-ecc8.h
@@ -0,0 +1,39 @@
1/*
2 * stmp378x: ECC8 register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_ECC8_BASE (STMP3XXX_REGS_BASE + 0x8000)
22#define REGS_ECC8_PHYS 0x80008000
23#define REGS_ECC8_SIZE 0x2000
24
25#define HW_ECC8_CTRL 0x0
26#define BM_ECC8_CTRL_COMPLETE_IRQ 0x00000001
27#define BP_ECC8_CTRL_COMPLETE_IRQ 0
28#define BM_ECC8_CTRL_COMPLETE_IRQ_EN 0x00000100
29#define BM_ECC8_CTRL_AHBM_SFTRST 0x20000000
30
31#define HW_ECC8_STATUS0 0x10
32#define BM_ECC8_STATUS0_UNCORRECTABLE 0x00000004
33#define BM_ECC8_STATUS0_CORRECTED 0x00000008
34#define BM_ECC8_STATUS0_STATUS_AUX 0x00000F00
35#define BP_ECC8_STATUS0_STATUS_AUX 8
36#define BM_ECC8_STATUS0_COMPLETED_CE 0x000F0000
37#define BP_ECC8_STATUS0_COMPLETED_CE 16
38
39#define HW_ECC8_STATUS1 0x20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-emi.h b/arch/arm/mach-stmp378x/include/mach/regs-emi.h
new file mode 100644
index 000000000000..98773fc33d7b
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-emi.h
@@ -0,0 +1,25 @@
1/*
2 * stmp378x: EMI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_EMI_BASE (STMP3XXX_REGS_BASE + 0x20000)
22#define REGS_EMI_PHYS 0x80020000
23#define REGS_EMI_SIZE 0x2000
24
25#define HW_EMI_STAT 0x10
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-gpmi.h b/arch/arm/mach-stmp378x/include/mach/regs-gpmi.h
new file mode 100644
index 000000000000..2cc8bbe91687
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-gpmi.h
@@ -0,0 +1,78 @@
1/*
2 * stmp378x: GPMI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_GPMI_BASE (STMP3XXX_REGS_BASE + 0xC000)
22#define REGS_GPMI_PHYS 0x8000C000
23#define REGS_GPMI_SIZE 0x2000
24
25#define HW_GPMI_CTRL0 0x0
26#define BM_GPMI_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_GPMI_CTRL0_XFER_COUNT 0
28#define BM_GPMI_CTRL0_CS 0x00300000
29#define BP_GPMI_CTRL0_CS 20
30#define BM_GPMI_CTRL0_LOCK_CS 0x00400000
31#define BM_GPMI_CTRL0_WORD_LENGTH 0x00800000
32#define BM_GPMI_CTRL0_ADDRESS 0x000E0000
33#define BP_GPMI_CTRL0_ADDRESS 17
34#define BV_GPMI_CTRL0_ADDRESS__NAND_DATA 0x0
35#define BV_GPMI_CTRL0_ADDRESS__NAND_CLE 0x1
36#define BV_GPMI_CTRL0_ADDRESS__NAND_ALE 0x2
37#define BM_GPMI_CTRL0_ADDRESS_INCREMENT 0x00010000
38#define BM_GPMI_CTRL0_COMMAND_MODE 0x03000000
39#define BP_GPMI_CTRL0_COMMAND_MODE 24
40#define BV_GPMI_CTRL0_COMMAND_MODE__WRITE 0x0
41#define BV_GPMI_CTRL0_COMMAND_MODE__READ 0x1
42#define BV_GPMI_CTRL0_COMMAND_MODE__READ_AND_COMPARE 0x2
43#define BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY 0x3
44#define BM_GPMI_CTRL0_RUN 0x20000000
45#define BM_GPMI_CTRL0_CLKGATE 0x40000000
46#define BM_GPMI_CTRL0_SFTRST 0x80000000
47#define BM_GPMI_ECCCTRL_BUFFER_MASK 0x000001FF
48#define BP_GPMI_ECCCTRL_BUFFER_MASK 0
49#define BM_GPMI_ECCCTRL_ENABLE_ECC 0x00001000
50#define BM_GPMI_ECCCTRL_ECC_CMD 0x00006000
51#define BP_GPMI_ECCCTRL_ECC_CMD 13
52#define BV_GPMI_ECCCTRL_ECC_CMD__DECODE_4_BIT 0
53#define BV_GPMI_ECCCTRL_ECC_CMD__ENCODE_4_BIT 1
54#define BV_GPMI_ECCCTRL_ECC_CMD__DECODE_8_BIT 2
55#define BV_GPMI_ECCCTRL_ECC_CMD__ENCODE_8_BIT 3
56
57#define HW_GPMI_CTRL1 0x60
58#define BM_GPMI_CTRL1_GPMI_MODE 0x00000001
59#define BP_GPMI_CTRL1_GPMI_MODE 0
60#define BM_GPMI_CTRL1_ATA_IRQRDY_POLARITY 0x00000004
61#define BM_GPMI_CTRL1_DEV_RESET 0x00000008
62#define BM_GPMI_CTRL1_TIMEOUT_IRQ 0x00000200
63#define BM_GPMI_CTRL1_DEV_IRQ 0x00000400
64#define BM_GPMI_CTRL1_RDN_DELAY 0x0000F000
65#define BP_GPMI_CTRL1_RDN_DELAY 12
66#define BM_GPMI_CTRL1_BCH_MODE 0x00040000
67
68#define HW_GPMI_TIMING0 0x70
69#define BM_GPMI_TIMING0_DATA_SETUP 0x000000FF
70#define BP_GPMI_TIMING0_DATA_SETUP 0
71#define BM_GPMI_TIMING0_DATA_HOLD 0x0000FF00
72#define BP_GPMI_TIMING0_DATA_HOLD 8
73#define BM_GPMI_TIMING0_ADDRESS_SETUP 0x00FF0000
74#define BP_GPMI_TIMING0_ADDRESS_SETUP 16
75
76#define HW_GPMI_TIMING1 0x80
77#define BM_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 0xFFFF0000
78#define BP_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 16
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-i2c.h b/arch/arm/mach-stmp378x/include/mach/regs-i2c.h
new file mode 100644
index 000000000000..13a234c99433
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-i2c.h
@@ -0,0 +1,55 @@
1/*
2 * stmp378x: I2C register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_I2C_BASE (STMP3XXX_REGS_BASE + 0x58000)
22#define REGS_I2C_PHYS 0x80058000
23#define REGS_I2C_SIZE 0x2000
24
25#define HW_I2C_CTRL0 0x0
26#define BM_I2C_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_I2C_CTRL0_XFER_COUNT 0
28#define BM_I2C_CTRL0_DIRECTION 0x00010000
29#define BM_I2C_CTRL0_MASTER_MODE 0x00020000
30#define BM_I2C_CTRL0_PRE_SEND_START 0x00080000
31#define BM_I2C_CTRL0_POST_SEND_STOP 0x00100000
32#define BM_I2C_CTRL0_RETAIN_CLOCK 0x00200000
33#define BM_I2C_CTRL0_SEND_NAK_ON_LAST 0x02000000
34#define BM_I2C_CTRL0_CLKGATE 0x40000000
35#define BM_I2C_CTRL0_SFTRST 0x80000000
36
37#define HW_I2C_TIMING0 0x10
38
39#define HW_I2C_TIMING1 0x20
40
41#define HW_I2C_TIMING2 0x30
42
43#define HW_I2C_CTRL1 0x40
44#define BM_I2C_CTRL1_SLAVE_IRQ 0x00000001
45#define BP_I2C_CTRL1_SLAVE_IRQ 0
46#define BM_I2C_CTRL1_SLAVE_STOP_IRQ 0x00000002
47#define BM_I2C_CTRL1_MASTER_LOSS_IRQ 0x00000004
48#define BM_I2C_CTRL1_EARLY_TERM_IRQ 0x00000008
49#define BM_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ 0x00000010
50#define BM_I2C_CTRL1_NO_SLAVE_ACK_IRQ 0x00000020
51#define BM_I2C_CTRL1_DATA_ENGINE_CMPLT_IRQ 0x00000040
52#define BM_I2C_CTRL1_BUS_FREE_IRQ 0x00000080
53#define BM_I2C_CTRL1_CLR_GOT_A_NAK 0x10000000
54
55#define HW_I2C_VERSION 0x90
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-icoll.h b/arch/arm/mach-stmp378x/include/mach/regs-icoll.h
new file mode 100644
index 000000000000..f996e80f40e7
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-icoll.h
@@ -0,0 +1,45 @@
1/*
2 * stmp378x: ICOLL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_ICOLL
22#define _MACH_REGS_ICOLL
23
24#define REGS_ICOLL_BASE (STMP3XXX_REGS_BASE + 0x0)
25#define REGS_ICOLL_PHYS 0x80000000
26#define REGS_ICOLL_SIZE 0x2000
27
28#define HW_ICOLL_VECTOR 0x0
29
30#define HW_ICOLL_LEVELACK 0x10
31#define BM_ICOLL_LEVELACK_IRQLEVELACK 0x0000000F
32#define BP_ICOLL_LEVELACK_IRQLEVELACK 0
33
34#define HW_ICOLL_CTRL 0x20
35#define BM_ICOLL_CTRL_CLKGATE 0x40000000
36#define BM_ICOLL_CTRL_SFTRST 0x80000000
37
38#define HW_ICOLL_STAT 0x70
39
40#define HW_ICOLL_INTERRUPTn 0x120
41
42#define HW_ICOLL_INTERRUPTn 0x120
43#define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004
44
45#endif
diff --git a/arch/arm/mach-imx/include/mach/timex.h b/arch/arm/mach-stmp378x/include/mach/regs-ir.h
index e22ba789546c..a5b4ef10fab8 100644
--- a/arch/arm/mach-imx/include/mach/timex.h
+++ b/arch/arm/mach-stmp378x/include/mach/regs-ir.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * linux/include/asm-arm/imx/timex.h 2 * stmp378x: IR register definitions
3 * 3 *
4 * Copyright (C) 1999 ARM Limited 4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -15,12 +16,8 @@
15 * 16 *
16 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 20 */
20 21#define REGS_IR_BASE (STMP3XXX_REGS_BASE + 0x78000)
21#ifndef __ASM_ARCH_TIMEX_H 22#define REGS_IR_PHYS 0x80078000
22#define __ASM_ARCH_TIMEX_H 23#define REGS_IR_SIZE 0x2000
23
24#define CLOCK_TICK_RATE (16000000)
25
26#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-lcdif.h b/arch/arm/mach-stmp378x/include/mach/regs-lcdif.h
new file mode 100644
index 000000000000..9cdbef4badc3
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-lcdif.h
@@ -0,0 +1,195 @@
1/*
2 * stmp378x: LCDIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_LCDIF_BASE (STMP3XXX_REGS_BASE + 0x30000)
22#define REGS_LCDIF_PHYS 0x80030000
23#define REGS_LCDIF_SIZE 0x2000
24
25#define HW_LCDIF_CTRL 0x0
26#define BM_LCDIF_CTRL_RUN 0x00000001
27#define BP_LCDIF_CTRL_RUN 0
28#define BM_LCDIF_CTRL_LCDIF_MASTER 0x00000020
29#define BM_LCDIF_CTRL_RGB_TO_YCBCR422_CSC 0x00000080
30#define BM_LCDIF_CTRL_WORD_LENGTH 0x00000300
31#define BP_LCDIF_CTRL_WORD_LENGTH 8
32#define BM_LCDIF_CTRL_LCD_DATABUS_WIDTH 0x00000C00
33#define BP_LCDIF_CTRL_LCD_DATABUS_WIDTH 10
34#define BM_LCDIF_CTRL_INPUT_DATA_SWIZZLE 0x0000C000
35#define BP_LCDIF_CTRL_INPUT_DATA_SWIZZLE 14
36#define BM_LCDIF_CTRL_DATA_SELECT 0x00010000
37#define BM_LCDIF_CTRL_DOTCLK_MODE 0x00020000
38#define BM_LCDIF_CTRL_VSYNC_MODE 0x00040000
39#define BM_LCDIF_CTRL_BYPASS_COUNT 0x00080000
40#define BM_LCDIF_CTRL_DVI_MODE 0x00100000
41#define BM_LCDIF_CTRL_SHIFT_NUM_BITS 0x03E00000
42#define BP_LCDIF_CTRL_SHIFT_NUM_BITS 21
43#define BM_LCDIF_CTRL_DATA_SHIFT_DIR 0x04000000
44#define BM_LCDIF_CTRL_WAIT_FOR_VSYNC_EDGE 0x08000000
45#define BM_LCDIF_CTRL_CLKGATE 0x40000000
46#define BM_LCDIF_CTRL_SFTRST 0x80000000
47
48#define HW_LCDIF_CTRL1 0x10
49#define BM_LCDIF_CTRL1_RESET 0x00000001
50#define BP_LCDIF_CTRL1_RESET 0
51#define BM_LCDIF_CTRL1_MODE86 0x00000002
52#define BM_LCDIF_CTRL1_BUSY_ENABLE 0x00000004
53#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ 0x00000100
54#define BM_LCDIF_CTRL1_CUR_FRAME_DONE_IRQ 0x00000200
55#define BM_LCDIF_CTRL1_UNDERFLOW_IRQ 0x00000400
56#define BM_LCDIF_CTRL1_OVERFLOW_IRQ 0x00000800
57#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ_EN 0x00001000
58#define BM_LCDIF_CTRL1_BYTE_PACKING_FORMAT 0x000F0000
59#define BP_LCDIF_CTRL1_BYTE_PACKING_FORMAT 16
60#define BM_LCDIF_CTRL1_INTERLACE_FIELDS 0x00800000
61#define BM_LCDIF_CTRL1_RECOVER_ON_UNDERFLOW 0x01000000
62
63#define HW_LCDIF_TRANSFER_COUNT 0x20
64#define BM_LCDIF_TRANSFER_COUNT_H_COUNT 0x0000FFFF
65#define BP_LCDIF_TRANSFER_COUNT_H_COUNT 0
66#define BM_LCDIF_TRANSFER_COUNT_V_COUNT 0xFFFF0000
67#define BP_LCDIF_TRANSFER_COUNT_V_COUNT 16
68
69#define HW_LCDIF_CUR_BUF 0x30
70
71#define HW_LCDIF_NEXT_BUF 0x40
72
73#define HW_LCDIF_TIMING 0x60
74
75#define HW_LCDIF_VDCTRL0 0x70
76#define BM_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH 0x0003FFFF
77#define BP_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH 0
78#define BM_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT 0x00100000
79#define BM_LCDIF_VDCTRL0_VSYNC_PERIOD_UNIT 0x00200000
80#define BM_LCDIF_VDCTRL0_ENABLE_POL 0x01000000
81#define BM_LCDIF_VDCTRL0_DOTCLK_POL 0x02000000
82#define BM_LCDIF_VDCTRL0_HSYNC_POL 0x04000000
83#define BM_LCDIF_VDCTRL0_VSYNC_POL 0x08000000
84#define BM_LCDIF_VDCTRL0_ENABLE_PRESENT 0x10000000
85#define BM_LCDIF_VDCTRL0_VSYNC_OEB 0x20000000
86
87#define HW_LCDIF_VDCTRL1 0x80
88#define BM_LCDIF_VDCTRL1_VSYNC_PERIOD 0xFFFFFFFF
89#define BP_LCDIF_VDCTRL1_VSYNC_PERIOD 0
90
91#define HW_LCDIF_VDCTRL2 0x90
92#define BM_LCDIF_VDCTRL2_HSYNC_PERIOD 0x0003FFFF
93#define BP_LCDIF_VDCTRL2_HSYNC_PERIOD 0
94#define BM_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 0xFF000000
95#define BP_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 24
96
97#define HW_LCDIF_VDCTRL3 0xA0
98#define BM_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0x0000FFFF
99#define BP_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0
100#define BM_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 0x0FFF0000
101#define BP_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 16
102
103#define HW_LCDIF_VDCTRL4 0xB0
104#define BM_LCDIF_VDCTRL4_DOTCLK_H_VALID_DATA_CNT 0x0003FFFF
105#define BP_LCDIF_VDCTRL4_DOTCLK_H_VALID_DATA_CNT 0
106#define BM_LCDIF_VDCTRL4_SYNC_SIGNALS_ON 0x00040000
107
108#define HW_LCDIF_DVICTRL0 0xC0
109#define BM_LCDIF_DVICTRL0_V_LINES_CNT 0x000003FF
110#define BP_LCDIF_DVICTRL0_V_LINES_CNT 0
111#define BM_LCDIF_DVICTRL0_H_BLANKING_CNT 0x000FFC00
112#define BP_LCDIF_DVICTRL0_H_BLANKING_CNT 10
113#define BM_LCDIF_DVICTRL0_H_ACTIVE_CNT 0x7FF00000
114#define BP_LCDIF_DVICTRL0_H_ACTIVE_CNT 20
115
116#define HW_LCDIF_DVICTRL1 0xD0
117#define BM_LCDIF_DVICTRL1_F2_START_LINE 0x000003FF
118#define BP_LCDIF_DVICTRL1_F2_START_LINE 0
119#define BM_LCDIF_DVICTRL1_F1_END_LINE 0x000FFC00
120#define BP_LCDIF_DVICTRL1_F1_END_LINE 10
121#define BM_LCDIF_DVICTRL1_F1_START_LINE 0x3FF00000
122#define BP_LCDIF_DVICTRL1_F1_START_LINE 20
123
124#define HW_LCDIF_DVICTRL2 0xE0
125#define BM_LCDIF_DVICTRL2_V1_BLANK_END_LINE 0x000003FF
126#define BP_LCDIF_DVICTRL2_V1_BLANK_END_LINE 0
127#define BM_LCDIF_DVICTRL2_V1_BLANK_START_LINE 0x000FFC00
128#define BP_LCDIF_DVICTRL2_V1_BLANK_START_LINE 10
129#define BM_LCDIF_DVICTRL2_F2_END_LINE 0x3FF00000
130#define BP_LCDIF_DVICTRL2_F2_END_LINE 20
131
132#define HW_LCDIF_DVICTRL3 0xF0
133#define BM_LCDIF_DVICTRL3_V2_BLANK_END_LINE 0x000003FF
134#define BP_LCDIF_DVICTRL3_V2_BLANK_END_LINE 0
135#define BM_LCDIF_DVICTRL3_V2_BLANK_START_LINE 0x03FF0000
136#define BP_LCDIF_DVICTRL3_V2_BLANK_START_LINE 16
137
138#define HW_LCDIF_DVICTRL4 0x100
139#define BM_LCDIF_DVICTRL4_H_FILL_CNT 0x000000FF
140#define BP_LCDIF_DVICTRL4_H_FILL_CNT 0
141#define BM_LCDIF_DVICTRL4_CR_FILL_VALUE 0x0000FF00
142#define BP_LCDIF_DVICTRL4_CR_FILL_VALUE 8
143#define BM_LCDIF_DVICTRL4_CB_FILL_VALUE 0x00FF0000
144#define BP_LCDIF_DVICTRL4_CB_FILL_VALUE 16
145#define BM_LCDIF_DVICTRL4_Y_FILL_VALUE 0xFF000000
146#define BP_LCDIF_DVICTRL4_Y_FILL_VALUE 24
147
148#define HW_LCDIF_CSC_COEFF0 0x110
149#define BM_LCDIF_CSC_COEFF0_CSC_SUBSAMPLE_FILTER 0x00000003
150#define BP_LCDIF_CSC_COEFF0_CSC_SUBSAMPLE_FILTER 0
151#define BM_LCDIF_CSC_COEFF0_C0 0x03FF0000
152#define BP_LCDIF_CSC_COEFF0_C0 16
153
154#define HW_LCDIF_CSC_COEFF1 0x120
155#define BM_LCDIF_CSC_COEFF1_C1 0x000003FF
156#define BP_LCDIF_CSC_COEFF1_C1 0
157#define BM_LCDIF_CSC_COEFF1_C2 0x03FF0000
158#define BP_LCDIF_CSC_COEFF1_C2 16
159
160#define HW_LCDIF_CSC_COEFF2 0x130
161#define BM_LCDIF_CSC_COEFF2_C3 0x000003FF
162#define BP_LCDIF_CSC_COEFF2_C3 0
163#define BM_LCDIF_CSC_COEFF2_C4 0x03FF0000
164#define BP_LCDIF_CSC_COEFF2_C4 16
165
166#define HW_LCDIF_CSC_COEFF3 0x140
167#define BM_LCDIF_CSC_COEFF3_C5 0x000003FF
168#define BP_LCDIF_CSC_COEFF3_C5 0
169#define BM_LCDIF_CSC_COEFF3_C6 0x03FF0000
170#define BP_LCDIF_CSC_COEFF3_C6 16
171
172#define HW_LCDIF_CSC_COEFF4 0x150
173#define BM_LCDIF_CSC_COEFF4_C7 0x000003FF
174#define BP_LCDIF_CSC_COEFF4_C7 0
175#define BM_LCDIF_CSC_COEFF4_C8 0x03FF0000
176#define BP_LCDIF_CSC_COEFF4_C8 16
177
178#define HW_LCDIF_CSC_OFFSET 0x160
179#define BM_LCDIF_CSC_OFFSET_Y_OFFSET 0x000001FF
180#define BP_LCDIF_CSC_OFFSET_Y_OFFSET 0
181#define BM_LCDIF_CSC_OFFSET_CBCR_OFFSET 0x01FF0000
182#define BP_LCDIF_CSC_OFFSET_CBCR_OFFSET 16
183
184#define HW_LCDIF_CSC_LIMIT 0x170
185#define BM_LCDIF_CSC_LIMIT_Y_MAX 0x000000FF
186#define BP_LCDIF_CSC_LIMIT_Y_MAX 0
187#define BM_LCDIF_CSC_LIMIT_Y_MIN 0x0000FF00
188#define BP_LCDIF_CSC_LIMIT_Y_MIN 8
189#define BM_LCDIF_CSC_LIMIT_CBCR_MAX 0x00FF0000
190#define BP_LCDIF_CSC_LIMIT_CBCR_MAX 16
191#define BM_LCDIF_CSC_LIMIT_CBCR_MIN 0xFF000000
192#define BP_LCDIF_CSC_LIMIT_CBCR_MIN 24
193
194#define HW_LCDIF_STAT 0x1D0
195#define BM_LCDIF_STAT_TXFIFO_EMPTY 0x04000000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-lradc.h b/arch/arm/mach-stmp378x/include/mach/regs-lradc.h
new file mode 100644
index 000000000000..cb8cb06f8277
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-lradc.h
@@ -0,0 +1,99 @@
1/*
2 * stmp378x: LRADC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_LRADC_BASE (STMP3XXX_REGS_BASE + 0x50000)
22#define REGS_LRADC_PHYS 0x80050000
23#define REGS_LRADC_SIZE 0x2000
24
25#define HW_LRADC_CTRL0 0x0
26#define BM_LRADC_CTRL0_SCHEDULE 0x000000FF
27#define BP_LRADC_CTRL0_SCHEDULE 0
28#define BM_LRADC_CTRL0_XPLUS_ENABLE 0x00010000
29#define BM_LRADC_CTRL0_YPLUS_ENABLE 0x00020000
30#define BM_LRADC_CTRL0_XMINUS_ENABLE 0x00040000
31#define BM_LRADC_CTRL0_YMINUS_ENABLE 0x00080000
32#define BM_LRADC_CTRL0_TOUCH_DETECT_ENABLE 0x00100000
33#define BM_LRADC_CTRL0_ONCHIP_GROUNDREF 0x00200000
34#define BM_LRADC_CTRL0_CLKGATE 0x40000000
35#define BM_LRADC_CTRL0_SFTRST 0x80000000
36
37#define HW_LRADC_CTRL1 0x10
38#define BM_LRADC_CTRL1_LRADC0_IRQ 0x00000001
39#define BP_LRADC_CTRL1_LRADC0_IRQ 0
40#define BM_LRADC_CTRL1_LRADC5_IRQ 0x00000020
41#define BM_LRADC_CTRL1_LRADC6_IRQ 0x00000040
42#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ 0x00000100
43#define BM_LRADC_CTRL1_LRADC0_IRQ_EN 0x00010000
44#define BM_LRADC_CTRL1_LRADC5_IRQ_EN 0x00200000
45#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ_EN 0x01000000
46
47#define HW_LRADC_CTRL2 0x20
48#define BM_LRADC_CTRL2_BL_BRIGHTNESS 0x001F0000
49#define BP_LRADC_CTRL2_BL_BRIGHTNESS 16
50#define BM_LRADC_CTRL2_BL_MUX_SELECT 0x00200000
51#define BM_LRADC_CTRL2_BL_ENABLE 0x00400000
52#define BM_LRADC_CTRL2_DIVIDE_BY_TWO 0xFF000000
53#define BP_LRADC_CTRL2_DIVIDE_BY_TWO 24
54
55#define HW_LRADC_CTRL3 0x30
56#define BM_LRADC_CTRL3_CYCLE_TIME 0x00000300
57#define BP_LRADC_CTRL3_CYCLE_TIME 8
58
59#define HW_LRADC_STATUS 0x40
60#define BM_LRADC_STATUS_TOUCH_DETECT_RAW 0x00000001
61#define BP_LRADC_STATUS_TOUCH_DETECT_RAW 0
62
63#define HW_LRADC_CH0 (0x50 + 0 * 0x10)
64#define HW_LRADC_CH1 (0x50 + 1 * 0x10)
65#define HW_LRADC_CH2 (0x50 + 2 * 0x10)
66#define HW_LRADC_CH3 (0x50 + 3 * 0x10)
67#define HW_LRADC_CH4 (0x50 + 4 * 0x10)
68#define HW_LRADC_CH5 (0x50 + 5 * 0x10)
69#define HW_LRADC_CH6 (0x50 + 6 * 0x10)
70#define HW_LRADC_CH7 (0x50 + 7 * 0x10)
71
72#define HW_LRADC_CHn 0x50
73#define BM_LRADC_CHn_VALUE 0x0003FFFF
74#define BP_LRADC_CHn_VALUE 0
75#define BM_LRADC_CHn_NUM_SAMPLES 0x1F000000
76#define BP_LRADC_CHn_NUM_SAMPLES 24
77#define BM_LRADC_CHn_ACCUMULATE 0x20000000
78
79#define HW_LRADC_DELAY0 (0xD0 + 0 * 0x10)
80#define HW_LRADC_DELAY1 (0xD0 + 1 * 0x10)
81#define HW_LRADC_DELAY2 (0xD0 + 2 * 0x10)
82#define HW_LRADC_DELAY3 (0xD0 + 3 * 0x10)
83
84#define HW_LRADC_DELAYn 0xD0
85#define BM_LRADC_DELAYn_DELAY 0x000007FF
86#define BP_LRADC_DELAYn_DELAY 0
87#define BM_LRADC_DELAYn_LOOP_COUNT 0x0000F800
88#define BP_LRADC_DELAYn_LOOP_COUNT 11
89#define BM_LRADC_DELAYn_TRIGGER_DELAYS 0x000F0000
90#define BP_LRADC_DELAYn_TRIGGER_DELAYS 16
91#define BM_LRADC_DELAYn_KICK 0x00100000
92#define BM_LRADC_DELAYn_TRIGGER_LRADCS 0xFF000000
93#define BP_LRADC_DELAYn_TRIGGER_LRADCS 24
94
95#define HW_LRADC_CTRL4 0x140
96#define BM_LRADC_CTRL4_LRADC6SELECT 0x0F000000
97#define BP_LRADC_CTRL4_LRADC6SELECT 24
98#define BM_LRADC_CTRL4_LRADC7SELECT 0xF0000000
99#define BP_LRADC_CTRL4_LRADC7SELECT 28
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ocotp.h b/arch/arm/mach-stmp378x/include/mach/regs-ocotp.h
new file mode 100644
index 000000000000..f0af64d9937e
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-ocotp.h
@@ -0,0 +1,40 @@
1/*
2 * stmp378x: OCOTP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_OCOTP_BASE (STMP3XXX_REGS_BASE + 0x2C000)
22#define REGS_OCOTP_PHYS 0x8002C000
23#define REGS_OCOTP_SIZE 0x2000
24
25#define HW_OCOTP_CTRL 0x0
26#define BM_OCOTP_CTRL_BUSY 0x00000100
27#define BM_OCOTP_CTRL_ERROR 0x00000200
28#define BM_OCOTP_CTRL_RD_BANK_OPEN 0x00001000
29#define BM_OCOTP_CTRL_RELOAD_SHADOWS 0x00002000
30#define BM_OCOTP_CTRL_WR_UNLOCK 0xFFFF0000
31#define BP_OCOTP_CTRL_WR_UNLOCK 16
32
33#define HW_OCOTP_DATA 0x10
34
35#define HW_OCOTP_CUST0 (0x20 + 0 * 0x10)
36#define HW_OCOTP_CUST1 (0x20 + 1 * 0x10)
37#define HW_OCOTP_CUST2 (0x20 + 2 * 0x10)
38#define HW_OCOTP_CUST3 (0x20 + 3 * 0x10)
39
40#define HW_OCOTP_CUSTn 0x20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h b/arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h
new file mode 100644
index 000000000000..50d90ea1b136
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h
@@ -0,0 +1,90 @@
1/*
2 * stmp378x: PINCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_PINCTRL
22#define _MACH_REGS_PINCTRL
23
24#define REGS_PINCTRL_BASE (STMP3XXX_REGS_BASE + 0x18000)
25#define REGS_PINCTRL_PHYS 0x80018000
26#define REGS_PINCTRL_SIZE 0x2000
27
28#define HW_PINCTRL_MUXSEL0 0x100
29#define HW_PINCTRL_MUXSEL1 0x110
30#define HW_PINCTRL_MUXSEL2 0x120
31#define HW_PINCTRL_MUXSEL3 0x130
32#define HW_PINCTRL_MUXSEL4 0x140
33#define HW_PINCTRL_MUXSEL5 0x150
34#define HW_PINCTRL_MUXSEL6 0x160
35#define HW_PINCTRL_MUXSEL7 0x170
36
37#define HW_PINCTRL_DRIVE0 0x200
38#define HW_PINCTRL_DRIVE1 0x210
39#define HW_PINCTRL_DRIVE2 0x220
40#define HW_PINCTRL_DRIVE3 0x230
41#define HW_PINCTRL_DRIVE4 0x240
42#define HW_PINCTRL_DRIVE5 0x250
43#define HW_PINCTRL_DRIVE6 0x260
44#define HW_PINCTRL_DRIVE7 0x270
45#define HW_PINCTRL_DRIVE8 0x280
46#define HW_PINCTRL_DRIVE9 0x290
47#define HW_PINCTRL_DRIVE10 0x2A0
48#define HW_PINCTRL_DRIVE11 0x2B0
49#define HW_PINCTRL_DRIVE12 0x2C0
50#define HW_PINCTRL_DRIVE13 0x2D0
51#define HW_PINCTRL_DRIVE14 0x2E0
52
53#define HW_PINCTRL_PULL0 0x400
54#define HW_PINCTRL_PULL1 0x410
55#define HW_PINCTRL_PULL2 0x420
56#define HW_PINCTRL_PULL3 0x430
57
58#define HW_PINCTRL_DOUT0 0x500
59#define HW_PINCTRL_DOUT1 0x510
60#define HW_PINCTRL_DOUT2 0x520
61
62#define HW_PINCTRL_DIN0 0x600
63#define HW_PINCTRL_DIN1 0x610
64#define HW_PINCTRL_DIN2 0x620
65
66#define HW_PINCTRL_DOE0 0x700
67#define HW_PINCTRL_DOE1 0x710
68#define HW_PINCTRL_DOE2 0x720
69
70#define HW_PINCTRL_PIN2IRQ0 0x800
71#define HW_PINCTRL_PIN2IRQ1 0x810
72#define HW_PINCTRL_PIN2IRQ2 0x820
73
74#define HW_PINCTRL_IRQEN0 0x900
75#define HW_PINCTRL_IRQEN1 0x910
76#define HW_PINCTRL_IRQEN2 0x920
77
78#define HW_PINCTRL_IRQLEVEL0 0xA00
79#define HW_PINCTRL_IRQLEVEL1 0xA10
80#define HW_PINCTRL_IRQLEVEL2 0xA20
81
82#define HW_PINCTRL_IRQPOL0 0xB00
83#define HW_PINCTRL_IRQPOL1 0xB10
84#define HW_PINCTRL_IRQPOL2 0xB20
85
86#define HW_PINCTRL_IRQSTAT0 0xC00
87#define HW_PINCTRL_IRQSTAT1 0xC10
88#define HW_PINCTRL_IRQSTAT2 0xC20
89
90#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-power.h b/arch/arm/mach-stmp378x/include/mach/regs-power.h
new file mode 100644
index 000000000000..e454c830f076
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-power.h
@@ -0,0 +1,63 @@
1/*
2 * stmp378x: POWER register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_POWER
22#define _MACH_REGS_POWER
23
24#define REGS_POWER_BASE (STMP3XXX_REGS_BASE + 0x44000)
25#define REGS_POWER_PHYS 0x80044000
26#define REGS_POWER_SIZE 0x2000
27
28#define HW_POWER_CTRL 0x0
29#define BM_POWER_CTRL_ENIRQ_VDD5V_GT_VDDIO 0x00000001
30#define BP_POWER_CTRL_ENIRQ_VDD5V_GT_VDDIO 0
31#define BM_POWER_CTRL_ENIRQ_PSWITCH 0x00020000
32#define BM_POWER_CTRL_PSWITCH_IRQ 0x00100000
33#define BM_POWER_CTRL_CLKGATE 0x40000000
34
35#define HW_POWER_5VCTRL 0x10
36#define BM_POWER_5VCTRL_ENABLE_LINREG_ILIMIT 0x00000040
37
38#define HW_POWER_MINPWR 0x20
39
40#define HW_POWER_CHARGE 0x30
41
42#define HW_POWER_VDDDCTRL 0x40
43
44#define HW_POWER_VDDACTRL 0x50
45
46#define HW_POWER_VDDIOCTRL 0x60
47#define BM_POWER_VDDIOCTRL_TRG 0x0000001F
48#define BP_POWER_VDDIOCTRL_TRG 0
49
50#define HW_POWER_STS 0xC0
51#define BM_POWER_STS_VBUSVALID 0x00000002
52#define BM_POWER_STS_BVALID 0x00000004
53#define BM_POWER_STS_AVALID 0x00000008
54#define BM_POWER_STS_DC_OK 0x00000200
55
56#define HW_POWER_RESET 0x100
57
58#define HW_POWER_DEBUG 0x110
59#define BM_POWER_DEBUG_BVALIDPIOLOCK 0x00000002
60#define BM_POWER_DEBUG_AVALIDPIOLOCK 0x00000004
61#define BM_POWER_DEBUG_VBUSVALIDPIOLOCK 0x00000008
62
63#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-pwm.h b/arch/arm/mach-stmp378x/include/mach/regs-pwm.h
new file mode 100644
index 000000000000..0d0f9e56ec77
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-pwm.h
@@ -0,0 +1,53 @@
1/*
2 * stmp378x: PWM register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_PWM_BASE (STMP3XXX_REGS_BASE + 0x64000)
22#define REGS_PWM_PHYS 0x80064000
23#define REGS_PWM_SIZE 0x2000
24
25#define HW_PWM_CTRL 0x0
26#define BM_PWM_CTRL_PWM2_ENABLE 0x00000004
27#define BM_PWM_CTRL_PWM2_ANA_CTRL_ENABLE 0x00000020
28
29#define HW_PWM_ACTIVE0 (0x10 + 0 * 0x20)
30#define HW_PWM_ACTIVE1 (0x10 + 1 * 0x20)
31#define HW_PWM_ACTIVE2 (0x10 + 2 * 0x20)
32#define HW_PWM_ACTIVE3 (0x10 + 3 * 0x20)
33
34#define HW_PWM_ACTIVEn 0x10
35#define BM_PWM_ACTIVEn_ACTIVE 0x0000FFFF
36#define BP_PWM_ACTIVEn_ACTIVE 0
37#define BM_PWM_ACTIVEn_INACTIVE 0xFFFF0000
38#define BP_PWM_ACTIVEn_INACTIVE 16
39
40#define HW_PWM_PERIOD0 (0x20 + 0 * 0x20)
41#define HW_PWM_PERIOD1 (0x20 + 1 * 0x20)
42#define HW_PWM_PERIOD2 (0x20 + 2 * 0x20)
43#define HW_PWM_PERIOD3 (0x20 + 3 * 0x20)
44
45#define HW_PWM_PERIODn 0x20
46#define BM_PWM_PERIODn_PERIOD 0x0000FFFF
47#define BP_PWM_PERIODn_PERIOD 0
48#define BM_PWM_PERIODn_ACTIVE_STATE 0x00030000
49#define BP_PWM_PERIODn_ACTIVE_STATE 16
50#define BM_PWM_PERIODn_INACTIVE_STATE 0x000C0000
51#define BP_PWM_PERIODn_INACTIVE_STATE 18
52#define BM_PWM_PERIODn_CDIV 0x00700000
53#define BP_PWM_PERIODn_CDIV 20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-pxp.h b/arch/arm/mach-stmp378x/include/mach/regs-pxp.h
new file mode 100644
index 000000000000..54d297896de8
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-pxp.h
@@ -0,0 +1,140 @@
1/*
2 * stmp378x: PXP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_PXP_BASE (STMP3XXX_REGS_BASE + 0x2A000)
22#define REGS_PXP_PHYS 0x8002A000
23#define REGS_PXP_SIZE 0x2000
24
25#define HW_PXP_CTRL 0x0
26#define BM_PXP_CTRL_ENABLE 0x00000001
27#define BP_PXP_CTRL_ENABLE 0
28#define BM_PXP_CTRL_IRQ_ENABLE 0x00000002
29#define BM_PXP_CTRL_OUTPUT_RGB_FORMAT 0x000000F0
30#define BP_PXP_CTRL_OUTPUT_RGB_FORMAT 4
31#define BM_PXP_CTRL_ROTATE 0x00000300
32#define BP_PXP_CTRL_ROTATE 8
33#define BM_PXP_CTRL_HFLIP 0x00000400
34#define BM_PXP_CTRL_VFLIP 0x00000800
35#define BM_PXP_CTRL_S0_FORMAT 0x0000F000
36#define BP_PXP_CTRL_S0_FORMAT 12
37#define BM_PXP_CTRL_SCALE 0x00040000
38#define BM_PXP_CTRL_CROP 0x00080000
39
40#define HW_PXP_STAT 0x10
41#define BM_PXP_STAT_IRQ 0x00000001
42#define BP_PXP_STAT_IRQ 0
43
44#define HW_PXP_RGBBUF 0x20
45
46#define HW_PXP_RGBSIZE 0x40
47#define BM_PXP_RGBSIZE_HEIGHT 0x00000FFF
48#define BP_PXP_RGBSIZE_HEIGHT 0
49#define BM_PXP_RGBSIZE_WIDTH 0x00FFF000
50#define BP_PXP_RGBSIZE_WIDTH 12
51
52#define HW_PXP_S0BUF 0x50
53
54#define HW_PXP_S0UBUF 0x60
55
56#define HW_PXP_S0VBUF 0x70
57
58#define HW_PXP_S0PARAM 0x80
59#define BM_PXP_S0PARAM_HEIGHT 0x000000FF
60#define BP_PXP_S0PARAM_HEIGHT 0
61#define BM_PXP_S0PARAM_WIDTH 0x0000FF00
62#define BP_PXP_S0PARAM_WIDTH 8
63#define BM_PXP_S0PARAM_YBASE 0x00FF0000
64#define BP_PXP_S0PARAM_YBASE 16
65#define BM_PXP_S0PARAM_XBASE 0xFF000000
66#define BP_PXP_S0PARAM_XBASE 24
67
68#define HW_PXP_S0BACKGROUND 0x90
69
70#define HW_PXP_S0CROP 0xA0
71#define BM_PXP_S0CROP_HEIGHT 0x000000FF
72#define BP_PXP_S0CROP_HEIGHT 0
73#define BM_PXP_S0CROP_WIDTH 0x0000FF00
74#define BP_PXP_S0CROP_WIDTH 8
75#define BM_PXP_S0CROP_YBASE 0x00FF0000
76#define BP_PXP_S0CROP_YBASE 16
77#define BM_PXP_S0CROP_XBASE 0xFF000000
78#define BP_PXP_S0CROP_XBASE 24
79
80#define HW_PXP_S0SCALE 0xB0
81#define BM_PXP_S0SCALE_XSCALE 0x00003FFF
82#define BP_PXP_S0SCALE_XSCALE 0
83#define BM_PXP_S0SCALE_YSCALE 0x3FFF0000
84#define BP_PXP_S0SCALE_YSCALE 16
85
86#define HW_PXP_CSCCOEFF0 0xD0
87
88#define HW_PXP_CSCCOEFF1 0xE0
89
90#define HW_PXP_CSCCOEFF2 0xF0
91
92#define HW_PXP_S0COLORKEYLOW 0x180
93
94#define HW_PXP_S0COLORKEYHIGH 0x190
95
96#define HW_PXP_OL0 (0x200 + 0 * 0x40)
97#define HW_PXP_OL1 (0x200 + 1 * 0x40)
98#define HW_PXP_OL2 (0x200 + 2 * 0x40)
99#define HW_PXP_OL3 (0x200 + 3 * 0x40)
100#define HW_PXP_OL4 (0x200 + 4 * 0x40)
101#define HW_PXP_OL5 (0x200 + 5 * 0x40)
102#define HW_PXP_OL6 (0x200 + 6 * 0x40)
103#define HW_PXP_OL7 (0x200 + 7 * 0x40)
104
105#define HW_PXP_OLn 0x200
106
107#define HW_PXP_OL0SIZE (0x210 + 0 * 0x40)
108#define HW_PXP_OL1SIZE (0x210 + 1 * 0x40)
109#define HW_PXP_OL2SIZE (0x210 + 2 * 0x40)
110#define HW_PXP_OL3SIZE (0x210 + 3 * 0x40)
111#define HW_PXP_OL4SIZE (0x210 + 4 * 0x40)
112#define HW_PXP_OL5SIZE (0x210 + 5 * 0x40)
113#define HW_PXP_OL6SIZE (0x210 + 6 * 0x40)
114#define HW_PXP_OL7SIZE (0x210 + 7 * 0x40)
115
116#define HW_PXP_OLnSIZE 0x210
117#define BM_PXP_OLnSIZE_HEIGHT 0x000000FF
118#define BP_PXP_OLnSIZE_HEIGHT 0
119#define BM_PXP_OLnSIZE_WIDTH 0x0000FF00
120#define BP_PXP_OLnSIZE_WIDTH 8
121
122#define HW_PXP_OL0PARAM (0x220 + 0 * 0x40)
123#define HW_PXP_OL1PARAM (0x220 + 1 * 0x40)
124#define HW_PXP_OL2PARAM (0x220 + 2 * 0x40)
125#define HW_PXP_OL3PARAM (0x220 + 3 * 0x40)
126#define HW_PXP_OL4PARAM (0x220 + 4 * 0x40)
127#define HW_PXP_OL5PARAM (0x220 + 5 * 0x40)
128#define HW_PXP_OL6PARAM (0x220 + 6 * 0x40)
129#define HW_PXP_OL7PARAM (0x220 + 7 * 0x40)
130
131#define HW_PXP_OLnPARAM 0x220
132#define BM_PXP_OLnPARAM_ENABLE 0x00000001
133#define BP_PXP_OLnPARAM_ENABLE 0
134#define BM_PXP_OLnPARAM_ALPHA_CNTL 0x00000006
135#define BP_PXP_OLnPARAM_ALPHA_CNTL 1
136#define BM_PXP_OLnPARAM_ENABLE_COLORKEY 0x00000008
137#define BM_PXP_OLnPARAM_FORMAT 0x000000F0
138#define BP_PXP_OLnPARAM_FORMAT 4
139#define BM_PXP_OLnPARAM_ALPHA 0x0000FF00
140#define BP_PXP_OLnPARAM_ALPHA 8
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-rtc.h b/arch/arm/mach-stmp378x/include/mach/regs-rtc.h
new file mode 100644
index 000000000000..b8dbd6742d98
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-rtc.h
@@ -0,0 +1,59 @@
1/*
2 * stmp378x: RTC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_RTC_BASE (STMP3XXX_REGS_BASE + 0x5C000)
22#define REGS_RTC_PHYS 0x8005C000
23#define REGS_RTC_SIZE 0x2000
24
25#define HW_RTC_CTRL 0x0
26#define BM_RTC_CTRL_ALARM_IRQ_EN 0x00000001
27#define BP_RTC_CTRL_ALARM_IRQ_EN 0
28#define BM_RTC_CTRL_ONEMSEC_IRQ_EN 0x00000002
29#define BM_RTC_CTRL_ALARM_IRQ 0x00000004
30#define BM_RTC_CTRL_ONEMSEC_IRQ 0x00000008
31#define BM_RTC_CTRL_WATCHDOGEN 0x00000010
32
33#define HW_RTC_STAT 0x10
34#define BM_RTC_STAT_NEW_REGS 0x0000FF00
35#define BP_RTC_STAT_NEW_REGS 8
36#define BM_RTC_STAT_STALE_REGS 0x00FF0000
37#define BP_RTC_STAT_STALE_REGS 16
38#define BM_RTC_STAT_RTC_PRESENT 0x80000000
39
40#define HW_RTC_SECONDS 0x30
41
42#define HW_RTC_ALARM 0x40
43
44#define HW_RTC_WATCHDOG 0x50
45
46#define HW_RTC_PERSISTENT0 0x60
47#define BM_RTC_PERSISTENT0_ALARM_WAKE_EN 0x00000002
48#define BM_RTC_PERSISTENT0_ALARM_EN 0x00000004
49#define BM_RTC_PERSISTENT0_XTAL24MHZ_PWRUP 0x00000010
50#define BM_RTC_PERSISTENT0_XTAL32KHZ_PWRUP 0x00000020
51#define BM_RTC_PERSISTENT0_ALARM_WAKE 0x00000080
52#define BM_RTC_PERSISTENT0_SPARE_ANALOG 0xFFFC0000
53#define BP_RTC_PERSISTENT0_SPARE_ANALOG 18
54
55#define HW_RTC_PERSISTENT1 0x70
56#define BM_RTC_PERSISTENT1_GENERAL 0xFFFFFFFF
57#define BP_RTC_PERSISTENT1_GENERAL 0
58
59#define HW_RTC_VERSION 0xD0
diff --git a/arch/arm/mach-imx/include/mach/vmalloc.h b/arch/arm/mach-stmp378x/include/mach/regs-saif.h
index 7d7cb0bde3e8..6df41762c2a3 100644
--- a/arch/arm/mach-imx/include/mach/vmalloc.h
+++ b/arch/arm/mach-stmp378x/include/mach/regs-saif.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * arch/arm/mach-imx/include/mach/vmalloc.h 2 * stmp378x: SAIF register definitions
3 * 3 *
4 * Copyright (C) 2000 Russell King. 4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -15,6 +16,6 @@
15 * 16 *
16 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 20 */
20#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 21#define REGS_SAIF_SIZE 0x2000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-spdif.h b/arch/arm/mach-stmp378x/include/mach/regs-spdif.h
new file mode 100644
index 000000000000..801539848c28
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-spdif.h
@@ -0,0 +1,49 @@
1/*
2 * stmp378x: SPDIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_SPDIF_BASE (STMP3XXX_REGS_BASE + 0x54000)
22#define REGS_SPDIF_PHYS 0x80054000
23#define REGS_SPDIF_SIZE 0x2000
24
25#define HW_SPDIF_CTRL 0x0
26#define BM_SPDIF_CTRL_RUN 0x00000001
27#define BP_SPDIF_CTRL_RUN 0
28#define BM_SPDIF_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
29#define BM_SPDIF_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
30#define BM_SPDIF_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
31#define BM_SPDIF_CTRL_WORD_LENGTH 0x00000010
32#define BM_SPDIF_CTRL_CLKGATE 0x40000000
33#define BM_SPDIF_CTRL_SFTRST 0x80000000
34
35#define HW_SPDIF_STAT 0x10
36
37#define HW_SPDIF_FRAMECTRL 0x20
38
39#define HW_SPDIF_SRR 0x30
40#define BM_SPDIF_SRR_RATE 0x000FFFFF
41#define BP_SPDIF_SRR_RATE 0
42#define BM_SPDIF_SRR_BASEMULT 0x70000000
43#define BP_SPDIF_SRR_BASEMULT 28
44
45#define HW_SPDIF_DEBUG 0x40
46
47#define HW_SPDIF_DATA 0x50
48
49#define HW_SPDIF_VERSION 0x60
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ssp.h b/arch/arm/mach-stmp378x/include/mach/regs-ssp.h
new file mode 100644
index 000000000000..28aacf0f58ed
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-ssp.h
@@ -0,0 +1,102 @@
1/*
2 * stmp378x: SSP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_SSP1_BASE (STMP3XXX_REGS_BASE + 0x10000)
22#define REGS_SSP1_PHYS 0x80010000
23#define REGS_SSP2_BASE (STMP3XXX_REGS_BASE + 0x34000)
24#define REGS_SSP2_PHYS 0x80034000
25#define REGS_SSP_SIZE 0x2000
26
27#define HW_SSP_CTRL0 0x0
28#define BM_SSP_CTRL0_XFER_COUNT 0x0000FFFF
29#define BP_SSP_CTRL0_XFER_COUNT 0
30#define BM_SSP_CTRL0_ENABLE 0x00010000
31#define BM_SSP_CTRL0_GET_RESP 0x00020000
32#define BM_SSP_CTRL0_LONG_RESP 0x00080000
33#define BM_SSP_CTRL0_WAIT_FOR_CMD 0x00100000
34#define BM_SSP_CTRL0_WAIT_FOR_IRQ 0x00200000
35#define BM_SSP_CTRL0_BUS_WIDTH 0x00C00000
36#define BP_SSP_CTRL0_BUS_WIDTH 22
37#define BM_SSP_CTRL0_DATA_XFER 0x01000000
38#define BM_SSP_CTRL0_READ 0x02000000
39#define BM_SSP_CTRL0_IGNORE_CRC 0x04000000
40#define BM_SSP_CTRL0_LOCK_CS 0x08000000
41#define BM_SSP_CTRL0_RUN 0x20000000
42#define BM_SSP_CTRL0_CLKGATE 0x40000000
43#define BM_SSP_CTRL0_SFTRST 0x80000000
44
45#define HW_SSP_CMD0 0x10
46#define BM_SSP_CMD0_CMD 0x000000FF
47#define BP_SSP_CMD0_CMD 0
48#define BM_SSP_CMD0_BLOCK_COUNT 0x0000FF00
49#define BP_SSP_CMD0_BLOCK_COUNT 8
50#define BM_SSP_CMD0_BLOCK_SIZE 0x000F0000
51#define BP_SSP_CMD0_BLOCK_SIZE 16
52#define BM_SSP_CMD0_APPEND_8CYC 0x00100000
53#define BM_SSP_CMD1_CMD_ARG 0xFFFFFFFF
54#define BP_SSP_CMD1_CMD_ARG 0
55
56#define HW_SSP_TIMING 0x50
57#define BM_SSP_TIMING_CLOCK_RATE 0x000000FF
58#define BP_SSP_TIMING_CLOCK_RATE 0
59#define BM_SSP_TIMING_CLOCK_DIVIDE 0x0000FF00
60#define BP_SSP_TIMING_CLOCK_DIVIDE 8
61#define BM_SSP_TIMING_TIMEOUT 0xFFFF0000
62#define BP_SSP_TIMING_TIMEOUT 16
63
64#define HW_SSP_CTRL1 0x60
65#define BM_SSP_CTRL1_SSP_MODE 0x0000000F
66#define BP_SSP_CTRL1_SSP_MODE 0
67#define BM_SSP_CTRL1_WORD_LENGTH 0x000000F0
68#define BP_SSP_CTRL1_WORD_LENGTH 4
69#define BM_SSP_CTRL1_POLARITY 0x00000200
70#define BM_SSP_CTRL1_PHASE 0x00000400
71#define BM_SSP_CTRL1_DMA_ENABLE 0x00002000
72#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ 0x00008000
73#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ_EN 0x00010000
74#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ 0x00020000
75#define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ 0x00200000
76#define BM_SSP_CTRL1_DATA_CRC_IRQ_EN 0x00400000
77#define BM_SSP_CTRL1_DATA_CRC_IRQ 0x00800000
78#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ_EN 0x01000000
79#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ 0x02000000
80#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ_EN 0x04000000
81#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ 0x08000000
82#define BM_SSP_CTRL1_RESP_ERR_IRQ_EN 0x10000000
83#define BM_SSP_CTRL1_RESP_ERR_IRQ 0x20000000
84#define BM_SSP_CTRL1_SDIO_IRQ 0x80000000
85
86#define HW_SSP_DATA 0x70
87
88#define HW_SSP_SDRESP0 0x80
89
90#define HW_SSP_SDRESP1 0x90
91
92#define HW_SSP_SDRESP2 0xA0
93
94#define HW_SSP_SDRESP3 0xB0
95
96#define HW_SSP_STATUS 0xC0
97#define BM_SSP_STATUS_FIFO_EMPTY 0x00000020
98#define BM_SSP_STATUS_TIMEOUT 0x00001000
99#define BM_SSP_STATUS_RESP_TIMEOUT 0x00004000
100#define BM_SSP_STATUS_RESP_ERR 0x00008000
101#define BM_SSP_STATUS_RESP_CRC_ERR 0x00010000
102#define BM_SSP_STATUS_CARD_DETECT 0x10000000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-sydma.h b/arch/arm/mach-stmp378x/include/mach/regs-sydma.h
new file mode 100644
index 000000000000..08343a8b5566
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-sydma.h
@@ -0,0 +1,23 @@
1/*
2 * stmp378x: SYDMA register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_SYDMA_BASE (STMP3XXX_REGS_BASE + 0x26000)
22#define REGS_SYDMA_PHYS 0x80026000
23#define REGS_SYDMA_SIZE 0x2000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-timrot.h b/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
new file mode 100644
index 000000000000..b5527957c67f
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
@@ -0,0 +1,68 @@
1/*
2 * stmp378x: TIMROT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_TIMROT
22#define _MACH_REGS_TIMROT
23
24#define REGS_TIMROT_BASE (STMP3XXX_REGS_BASE + 0x68000)
25#define REGS_TIMROT_PHYS 0x80068000
26#define REGS_TIMROT_SIZE 0x2000
27
28#define HW_TIMROT_ROTCTRL 0x0
29#define BM_TIMROT_ROTCTRL_SELECT_A 0x00000007
30#define BP_TIMROT_ROTCTRL_SELECT_A 0
31#define BM_TIMROT_ROTCTRL_SELECT_B 0x00000070
32#define BP_TIMROT_ROTCTRL_SELECT_B 4
33#define BM_TIMROT_ROTCTRL_POLARITY_A 0x00000100
34#define BM_TIMROT_ROTCTRL_POLARITY_B 0x00000200
35#define BM_TIMROT_ROTCTRL_OVERSAMPLE 0x00000C00
36#define BP_TIMROT_ROTCTRL_OVERSAMPLE 10
37#define BM_TIMROT_ROTCTRL_RELATIVE 0x00001000
38#define BM_TIMROT_ROTCTRL_DIVIDER 0x003F0000
39#define BP_TIMROT_ROTCTRL_DIVIDER 16
40#define BM_TIMROT_ROTCTRL_ROTARY_PRESENT 0x20000000
41#define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000
42#define BM_TIMROT_ROTCTRL_SFTRST 0x80000000
43
44#define HW_TIMROT_ROTCOUNT 0x10
45#define BM_TIMROT_ROTCOUNT_UPDOWN 0x0000FFFF
46#define BP_TIMROT_ROTCOUNT_UPDOWN 0
47
48#define HW_TIMROT_TIMCTRL0 (0x20 + 0 * 0x20)
49#define HW_TIMROT_TIMCTRL1 (0x20 + 1 * 0x20)
50#define HW_TIMROT_TIMCTRL2 (0x20 + 2 * 0x20)
51
52#define HW_TIMROT_TIMCTRLn 0x20
53#define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
54#define BP_TIMROT_TIMCTRLn_SELECT 0
55#define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
56#define BP_TIMROT_TIMCTRLn_PRESCALE 4
57#define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
58#define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
59#define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
60#define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
61
62#define HW_TIMROT_TIMCOUNT0 (0x30 + 0 * 0x20)
63#define HW_TIMROT_TIMCOUNT1 (0x30 + 1 * 0x20)
64#define HW_TIMROT_TIMCOUNT2 (0x30 + 2 * 0x20)
65
66#define HW_TIMROT_TIMCOUNTn 0x30
67
68#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-tvenc.h b/arch/arm/mach-stmp378x/include/mach/regs-tvenc.h
new file mode 100644
index 000000000000..7f895cb34350
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-tvenc.h
@@ -0,0 +1,67 @@
1/*
2 * stmp378x: TVENC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_TVENC_BASE (STMP3XXX_REGS_BASE + 0x38000)
22#define REGS_TVENC_PHYS 0x80038000
23#define REGS_TVENC_SIZE 0x2000
24
25#define HW_TVENC_CTRL 0x0
26#define BM_TVENC_CTRL_CLKGATE 0x40000000
27#define BM_TVENC_CTRL_SFTRST 0x80000000
28
29#define HW_TVENC_CONFIG 0x10
30#define BM_TVENC_CONFIG_ENCD_MODE 0x00000007
31#define BP_TVENC_CONFIG_ENCD_MODE 0
32#define BM_TVENC_CONFIG_SYNC_MODE 0x00000070
33#define BP_TVENC_CONFIG_SYNC_MODE 4
34#define BM_TVENC_CONFIG_FSYNC_PHS 0x00000200
35#define BM_TVENC_CONFIG_CGAIN 0x0000C000
36#define BP_TVENC_CONFIG_CGAIN 14
37#define BM_TVENC_CONFIG_YGAIN_SEL 0x00030000
38#define BP_TVENC_CONFIG_YGAIN_SEL 16
39#define BM_TVENC_CONFIG_PAL_SHAPE 0x00100000
40
41#define HW_TVENC_SYNCOFFSET 0x30
42
43#define HW_TVENC_COLORSUB0 0xC0
44
45#define HW_TVENC_COLORBURST 0x140
46#define BM_TVENC_COLORBURST_PBA 0x00FF0000
47#define BP_TVENC_COLORBURST_PBA 16
48#define BM_TVENC_COLORBURST_NBA 0xFF000000
49#define BP_TVENC_COLORBURST_NBA 24
50
51#define HW_TVENC_MACROVISION0 0x150
52
53#define HW_TVENC_MACROVISION1 0x160
54
55#define HW_TVENC_MACROVISION2 0x170
56
57#define HW_TVENC_MACROVISION3 0x180
58
59#define HW_TVENC_MACROVISION4 0x190
60
61#define HW_TVENC_DACCTRL 0x1A0
62#define BM_TVENC_DACCTRL_RVAL 0x00000070
63#define BP_TVENC_DACCTRL_RVAL 4
64#define BM_TVENC_DACCTRL_DUMP_TOVDD1 0x00000100
65#define BM_TVENC_DACCTRL_PWRUP1 0x00001000
66#define BM_TVENC_DACCTRL_GAINUP 0x00040000
67#define BM_TVENC_DACCTRL_GAINDN 0x00080000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-uartapp.h b/arch/arm/mach-stmp378x/include/mach/regs-uartapp.h
new file mode 100644
index 000000000000..a251e68bb3a1
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-uartapp.h
@@ -0,0 +1,87 @@
1/*
2 * stmp378x: UARTAPP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_UARTAPP1_BASE (STMP3XXX_REGS_BASE + 0x6C000)
22#define REGS_UARTAPP1_PHYS 0x8006C000
23#define REGS_UARTAPP2_BASE (STMP3XXX_REGS_BASE + 0x6E000)
24#define REGS_UARTAPP2_PHYS 0x8006E000
25#define REGS_UARTAPP_SIZE 0x2000
26
27#define HW_UARTAPP_CTRL0 0x0
28#define BM_UARTAPP_CTRL0_XFER_COUNT 0x0000FFFF
29#define BP_UARTAPP_CTRL0_XFER_COUNT 0
30#define BM_UARTAPP_CTRL0_RXTIMEOUT 0x07FF0000
31#define BP_UARTAPP_CTRL0_RXTIMEOUT 16
32#define BM_UARTAPP_CTRL0_RXTO_ENABLE 0x08000000
33#define BM_UARTAPP_CTRL0_RUN 0x20000000
34#define BM_UARTAPP_CTRL0_SFTRST 0x80000000
35#define BM_UARTAPP_CTRL1_XFER_COUNT 0x0000FFFF
36#define BP_UARTAPP_CTRL1_XFER_COUNT 0
37#define BM_UARTAPP_CTRL1_RUN 0x10000000
38
39#define HW_UARTAPP_CTRL2 0x20
40#define BM_UARTAPP_CTRL2_UARTEN 0x00000001
41#define BP_UARTAPP_CTRL2_UARTEN 0
42#define BM_UARTAPP_CTRL2_TXE 0x00000100
43#define BM_UARTAPP_CTRL2_RXE 0x00000200
44#define BM_UARTAPP_CTRL2_RTS 0x00000800
45#define BM_UARTAPP_CTRL2_RTSEN 0x00004000
46#define BM_UARTAPP_CTRL2_CTSEN 0x00008000
47#define BM_UARTAPP_CTRL2_RXDMAE 0x01000000
48#define BM_UARTAPP_CTRL2_TXDMAE 0x02000000
49#define BM_UARTAPP_CTRL2_DMAONERR 0x04000000
50
51#define HW_UARTAPP_LINECTRL 0x30
52#define BM_UARTAPP_LINECTRL_BRK 0x00000001
53#define BP_UARTAPP_LINECTRL_BRK 0
54#define BM_UARTAPP_LINECTRL_PEN 0x00000002
55#define BM_UARTAPP_LINECTRL_EPS 0x00000004
56#define BM_UARTAPP_LINECTRL_STP2 0x00000008
57#define BM_UARTAPP_LINECTRL_FEN 0x00000010
58#define BM_UARTAPP_LINECTRL_WLEN 0x00000060
59#define BP_UARTAPP_LINECTRL_WLEN 5
60#define BM_UARTAPP_LINECTRL_SPS 0x00000080
61#define BM_UARTAPP_LINECTRL_BAUD_DIVFRAC 0x00003F00
62#define BP_UARTAPP_LINECTRL_BAUD_DIVFRAC 8
63#define BM_UARTAPP_LINECTRL_BAUD_DIVINT 0xFFFF0000
64#define BP_UARTAPP_LINECTRL_BAUD_DIVINT 16
65
66#define HW_UARTAPP_INTR 0x50
67#define BM_UARTAPP_INTR_CTSMIS 0x00000002
68#define BM_UARTAPP_INTR_RTIS 0x00000040
69#define BM_UARTAPP_INTR_CTSMIEN 0x00020000
70#define BM_UARTAPP_INTR_RXIEN 0x00100000
71#define BM_UARTAPP_INTR_RTIEN 0x00400000
72
73#define HW_UARTAPP_DATA 0x60
74
75#define HW_UARTAPP_STAT 0x70
76#define BM_UARTAPP_STAT_RXCOUNT 0x0000FFFF
77#define BP_UARTAPP_STAT_RXCOUNT 0
78#define BM_UARTAPP_STAT_FERR 0x00010000
79#define BM_UARTAPP_STAT_PERR 0x00020000
80#define BM_UARTAPP_STAT_BERR 0x00040000
81#define BM_UARTAPP_STAT_OERR 0x00080000
82#define BM_UARTAPP_STAT_RXFE 0x01000000
83#define BM_UARTAPP_STAT_TXFF 0x02000000
84#define BM_UARTAPP_STAT_TXFE 0x08000000
85#define BM_UARTAPP_STAT_CTS 0x10000000
86
87#define HW_UARTAPP_VERSION 0x90
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h b/arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h
new file mode 100644
index 000000000000..b810deb552a9
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h
@@ -0,0 +1,268 @@
1/*
2 * stmp378x: UARTDBG register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_UARTDBG_BASE (STMP3XXX_REGS_BASE + 0x70000)
22#define REGS_UARTDBG_PHYS 0x80070000
23#define REGS_UARTDBG_SIZE 0x2000
24
25#define HW_UARTDBGDR 0x00000000
26#define BP_UARTDBGDR_UNAVAILABLE 16
27#define BM_UARTDBGDR_UNAVAILABLE 0xFFFF0000
28#define BF_UARTDBGDR_UNAVAILABLE(v) \
29 (((v) << 16) & BM_UARTDBGDR_UNAVAILABLE)
30#define BP_UARTDBGDR_RESERVED 12
31#define BM_UARTDBGDR_RESERVED 0x0000F000
32#define BF_UARTDBGDR_RESERVED(v) \
33 (((v) << 12) & BM_UARTDBGDR_RESERVED)
34#define BM_UARTDBGDR_OE 0x00000800
35#define BM_UARTDBGDR_BE 0x00000400
36#define BM_UARTDBGDR_PE 0x00000200
37#define BM_UARTDBGDR_FE 0x00000100
38#define BP_UARTDBGDR_DATA 0
39#define BM_UARTDBGDR_DATA 0x000000FF
40#define BF_UARTDBGDR_DATA(v) \
41 (((v) << 0) & BM_UARTDBGDR_DATA)
42#define HW_UARTDBGRSR_ECR 0x00000004
43#define BP_UARTDBGRSR_ECR_UNAVAILABLE 8
44#define BM_UARTDBGRSR_ECR_UNAVAILABLE 0xFFFFFF00
45#define BF_UARTDBGRSR_ECR_UNAVAILABLE(v) \
46 (((v) << 8) & BM_UARTDBGRSR_ECR_UNAVAILABLE)
47#define BP_UARTDBGRSR_ECR_EC 4
48#define BM_UARTDBGRSR_ECR_EC 0x000000F0
49#define BF_UARTDBGRSR_ECR_EC(v) \
50 (((v) << 4) & BM_UARTDBGRSR_ECR_EC)
51#define BM_UARTDBGRSR_ECR_OE 0x00000008
52#define BM_UARTDBGRSR_ECR_BE 0x00000004
53#define BM_UARTDBGRSR_ECR_PE 0x00000002
54#define BM_UARTDBGRSR_ECR_FE 0x00000001
55#define HW_UARTDBGFR 0x00000018
56#define BP_UARTDBGFR_UNAVAILABLE 16
57#define BM_UARTDBGFR_UNAVAILABLE 0xFFFF0000
58#define BF_UARTDBGFR_UNAVAILABLE(v) \
59 (((v) << 16) & BM_UARTDBGFR_UNAVAILABLE)
60#define BP_UARTDBGFR_RESERVED 9
61#define BM_UARTDBGFR_RESERVED 0x0000FE00
62#define BF_UARTDBGFR_RESERVED(v) \
63 (((v) << 9) & BM_UARTDBGFR_RESERVED)
64#define BM_UARTDBGFR_RI 0x00000100
65#define BM_UARTDBGFR_TXFE 0x00000080
66#define BM_UARTDBGFR_RXFF 0x00000040
67#define BM_UARTDBGFR_TXFF 0x00000020
68#define BM_UARTDBGFR_RXFE 0x00000010
69#define BM_UARTDBGFR_BUSY 0x00000008
70#define BM_UARTDBGFR_DCD 0x00000004
71#define BM_UARTDBGFR_DSR 0x00000002
72#define BM_UARTDBGFR_CTS 0x00000001
73#define HW_UARTDBGILPR 0x00000020
74#define BP_UARTDBGILPR_UNAVAILABLE 8
75#define BM_UARTDBGILPR_UNAVAILABLE 0xFFFFFF00
76#define BF_UARTDBGILPR_UNAVAILABLE(v) \
77 (((v) << 8) & BM_UARTDBGILPR_UNAVAILABLE)
78#define BP_UARTDBGILPR_ILPDVSR 0
79#define BM_UARTDBGILPR_ILPDVSR 0x000000FF
80#define BF_UARTDBGILPR_ILPDVSR(v) \
81 (((v) << 0) & BM_UARTDBGILPR_ILPDVSR)
82#define HW_UARTDBGIBRD 0x00000024
83#define BP_UARTDBGIBRD_UNAVAILABLE 16
84#define BM_UARTDBGIBRD_UNAVAILABLE 0xFFFF0000
85#define BF_UARTDBGIBRD_UNAVAILABLE(v) \
86 (((v) << 16) & BM_UARTDBGIBRD_UNAVAILABLE)
87#define BP_UARTDBGIBRD_BAUD_DIVINT 0
88#define BM_UARTDBGIBRD_BAUD_DIVINT 0x0000FFFF
89#define BF_UARTDBGIBRD_BAUD_DIVINT(v) \
90 (((v) << 0) & BM_UARTDBGIBRD_BAUD_DIVINT)
91#define HW_UARTDBGFBRD 0x00000028
92#define BP_UARTDBGFBRD_UNAVAILABLE 8
93#define BM_UARTDBGFBRD_UNAVAILABLE 0xFFFFFF00
94#define BF_UARTDBGFBRD_UNAVAILABLE(v) \
95 (((v) << 8) & BM_UARTDBGFBRD_UNAVAILABLE)
96#define BP_UARTDBGFBRD_RESERVED 6
97#define BM_UARTDBGFBRD_RESERVED 0x000000C0
98#define BF_UARTDBGFBRD_RESERVED(v) \
99 (((v) << 6) & BM_UARTDBGFBRD_RESERVED)
100#define BP_UARTDBGFBRD_BAUD_DIVFRAC 0
101#define BM_UARTDBGFBRD_BAUD_DIVFRAC 0x0000003F
102#define BF_UARTDBGFBRD_BAUD_DIVFRAC(v) \
103 (((v) << 0) & BM_UARTDBGFBRD_BAUD_DIVFRAC)
104#define HW_UARTDBGLCR_H 0x0000002c
105#define BP_UARTDBGLCR_H_UNAVAILABLE 16
106#define BM_UARTDBGLCR_H_UNAVAILABLE 0xFFFF0000
107#define BF_UARTDBGLCR_H_UNAVAILABLE(v) \
108 (((v) << 16) & BM_UARTDBGLCR_H_UNAVAILABLE)
109#define BP_UARTDBGLCR_H_RESERVED 8
110#define BM_UARTDBGLCR_H_RESERVED 0x0000FF00
111#define BF_UARTDBGLCR_H_RESERVED(v) \
112 (((v) << 8) & BM_UARTDBGLCR_H_RESERVED)
113#define BM_UARTDBGLCR_H_SPS 0x00000080
114#define BP_UARTDBGLCR_H_WLEN 5
115#define BM_UARTDBGLCR_H_WLEN 0x00000060
116#define BF_UARTDBGLCR_H_WLEN(v) \
117 (((v) << 5) & BM_UARTDBGLCR_H_WLEN)
118#define BM_UARTDBGLCR_H_FEN 0x00000010
119#define BM_UARTDBGLCR_H_STP2 0x00000008
120#define BM_UARTDBGLCR_H_EPS 0x00000004
121#define BM_UARTDBGLCR_H_PEN 0x00000002
122#define BM_UARTDBGLCR_H_BRK 0x00000001
123#define HW_UARTDBGCR 0x00000030
124#define BP_UARTDBGCR_UNAVAILABLE 16
125#define BM_UARTDBGCR_UNAVAILABLE 0xFFFF0000
126#define BF_UARTDBGCR_UNAVAILABLE(v) \
127 (((v) << 16) & BM_UARTDBGCR_UNAVAILABLE)
128#define BM_UARTDBGCR_CTSEN 0x00008000
129#define BM_UARTDBGCR_RTSEN 0x00004000
130#define BM_UARTDBGCR_OUT2 0x00002000
131#define BM_UARTDBGCR_OUT1 0x00001000
132#define BM_UARTDBGCR_RTS 0x00000800
133#define BM_UARTDBGCR_DTR 0x00000400
134#define BM_UARTDBGCR_RXE 0x00000200
135#define BM_UARTDBGCR_TXE 0x00000100
136#define BM_UARTDBGCR_LBE 0x00000080
137#define BP_UARTDBGCR_RESERVED 3
138#define BM_UARTDBGCR_RESERVED 0x00000078
139#define BF_UARTDBGCR_RESERVED(v) \
140 (((v) << 3) & BM_UARTDBGCR_RESERVED)
141#define BM_UARTDBGCR_SIRLP 0x00000004
142#define BM_UARTDBGCR_SIREN 0x00000002
143#define BM_UARTDBGCR_UARTEN 0x00000001
144#define HW_UARTDBGIFLS 0x00000034
145#define BP_UARTDBGIFLS_UNAVAILABLE 16
146#define BM_UARTDBGIFLS_UNAVAILABLE 0xFFFF0000
147#define BF_UARTDBGIFLS_UNAVAILABLE(v) \
148 (((v) << 16) & BM_UARTDBGIFLS_UNAVAILABLE)
149#define BP_UARTDBGIFLS_RESERVED 6
150#define BM_UARTDBGIFLS_RESERVED 0x0000FFC0
151#define BF_UARTDBGIFLS_RESERVED(v) \
152 (((v) << 6) & BM_UARTDBGIFLS_RESERVED)
153#define BP_UARTDBGIFLS_RXIFLSEL 3
154#define BM_UARTDBGIFLS_RXIFLSEL 0x00000038
155#define BF_UARTDBGIFLS_RXIFLSEL(v) \
156 (((v) << 3) & BM_UARTDBGIFLS_RXIFLSEL)
157#define BV_UARTDBGIFLS_RXIFLSEL__NOT_EMPTY 0x0
158#define BV_UARTDBGIFLS_RXIFLSEL__ONE_QUARTER 0x1
159#define BV_UARTDBGIFLS_RXIFLSEL__ONE_HALF 0x2
160#define BV_UARTDBGIFLS_RXIFLSEL__THREE_QUARTERS 0x3
161#define BV_UARTDBGIFLS_RXIFLSEL__SEVEN_EIGHTHS 0x4
162#define BV_UARTDBGIFLS_RXIFLSEL__INVALID5 0x5
163#define BV_UARTDBGIFLS_RXIFLSEL__INVALID6 0x6
164#define BV_UARTDBGIFLS_RXIFLSEL__INVALID7 0x7
165#define BP_UARTDBGIFLS_TXIFLSEL 0
166#define BM_UARTDBGIFLS_TXIFLSEL 0x00000007
167#define BF_UARTDBGIFLS_TXIFLSEL(v) \
168 (((v) << 0) & BM_UARTDBGIFLS_TXIFLSEL)
169#define BV_UARTDBGIFLS_TXIFLSEL__EMPTY 0x0
170#define BV_UARTDBGIFLS_TXIFLSEL__ONE_QUARTER 0x1
171#define BV_UARTDBGIFLS_TXIFLSEL__ONE_HALF 0x2
172#define BV_UARTDBGIFLS_TXIFLSEL__THREE_QUARTERS 0x3
173#define BV_UARTDBGIFLS_TXIFLSEL__SEVEN_EIGHTHS 0x4
174#define BV_UARTDBGIFLS_TXIFLSEL__INVALID5 0x5
175#define BV_UARTDBGIFLS_TXIFLSEL__INVALID6 0x6
176#define BV_UARTDBGIFLS_TXIFLSEL__INVALID7 0x7
177#define HW_UARTDBGIMSC 0x00000038
178#define BP_UARTDBGIMSC_UNAVAILABLE 16
179#define BM_UARTDBGIMSC_UNAVAILABLE 0xFFFF0000
180#define BF_UARTDBGIMSC_UNAVAILABLE(v) \
181 (((v) << 16) & BM_UARTDBGIMSC_UNAVAILABLE)
182#define BP_UARTDBGIMSC_RESERVED 11
183#define BM_UARTDBGIMSC_RESERVED 0x0000F800
184#define BF_UARTDBGIMSC_RESERVED(v) \
185 (((v) << 11) & BM_UARTDBGIMSC_RESERVED)
186#define BM_UARTDBGIMSC_OEIM 0x00000400
187#define BM_UARTDBGIMSC_BEIM 0x00000200
188#define BM_UARTDBGIMSC_PEIM 0x00000100
189#define BM_UARTDBGIMSC_FEIM 0x00000080
190#define BM_UARTDBGIMSC_RTIM 0x00000040
191#define BM_UARTDBGIMSC_TXIM 0x00000020
192#define BM_UARTDBGIMSC_RXIM 0x00000010
193#define BM_UARTDBGIMSC_DSRMIM 0x00000008
194#define BM_UARTDBGIMSC_DCDMIM 0x00000004
195#define BM_UARTDBGIMSC_CTSMIM 0x00000002
196#define BM_UARTDBGIMSC_RIMIM 0x00000001
197#define HW_UARTDBGRIS 0x0000003c
198#define BP_UARTDBGRIS_UNAVAILABLE 16
199#define BM_UARTDBGRIS_UNAVAILABLE 0xFFFF0000
200#define BF_UARTDBGRIS_UNAVAILABLE(v) \
201 (((v) << 16) & BM_UARTDBGRIS_UNAVAILABLE)
202#define BP_UARTDBGRIS_RESERVED 11
203#define BM_UARTDBGRIS_RESERVED 0x0000F800
204#define BF_UARTDBGRIS_RESERVED(v) \
205 (((v) << 11) & BM_UARTDBGRIS_RESERVED)
206#define BM_UARTDBGRIS_OERIS 0x00000400
207#define BM_UARTDBGRIS_BERIS 0x00000200
208#define BM_UARTDBGRIS_PERIS 0x00000100
209#define BM_UARTDBGRIS_FERIS 0x00000080
210#define BM_UARTDBGRIS_RTRIS 0x00000040
211#define BM_UARTDBGRIS_TXRIS 0x00000020
212#define BM_UARTDBGRIS_RXRIS 0x00000010
213#define BM_UARTDBGRIS_DSRRMIS 0x00000008
214#define BM_UARTDBGRIS_DCDRMIS 0x00000004
215#define BM_UARTDBGRIS_CTSRMIS 0x00000002
216#define BM_UARTDBGRIS_RIRMIS 0x00000001
217#define HW_UARTDBGMIS 0x00000040
218#define BP_UARTDBGMIS_UNAVAILABLE 16
219#define BM_UARTDBGMIS_UNAVAILABLE 0xFFFF0000
220#define BF_UARTDBGMIS_UNAVAILABLE(v) \
221 (((v) << 16) & BM_UARTDBGMIS_UNAVAILABLE)
222#define BP_UARTDBGMIS_RESERVED 11
223#define BM_UARTDBGMIS_RESERVED 0x0000F800
224#define BF_UARTDBGMIS_RESERVED(v) \
225 (((v) << 11) & BM_UARTDBGMIS_RESERVED)
226#define BM_UARTDBGMIS_OEMIS 0x00000400
227#define BM_UARTDBGMIS_BEMIS 0x00000200
228#define BM_UARTDBGMIS_PEMIS 0x00000100
229#define BM_UARTDBGMIS_FEMIS 0x00000080
230#define BM_UARTDBGMIS_RTMIS 0x00000040
231#define BM_UARTDBGMIS_TXMIS 0x00000020
232#define BM_UARTDBGMIS_RXMIS 0x00000010
233#define BM_UARTDBGMIS_DSRMMIS 0x00000008
234#define BM_UARTDBGMIS_DCDMMIS 0x00000004
235#define BM_UARTDBGMIS_CTSMMIS 0x00000002
236#define BM_UARTDBGMIS_RIMMIS 0x00000001
237#define HW_UARTDBGICR 0x00000044
238#define BP_UARTDBGICR_UNAVAILABLE 16
239#define BM_UARTDBGICR_UNAVAILABLE 0xFFFF0000
240#define BF_UARTDBGICR_UNAVAILABLE(v) \
241 (((v) << 16) & BM_UARTDBGICR_UNAVAILABLE)
242#define BP_UARTDBGICR_RESERVED 11
243#define BM_UARTDBGICR_RESERVED 0x0000F800
244#define BF_UARTDBGICR_RESERVED(v) \
245 (((v) << 11) & BM_UARTDBGICR_RESERVED)
246#define BM_UARTDBGICR_OEIC 0x00000400
247#define BM_UARTDBGICR_BEIC 0x00000200
248#define BM_UARTDBGICR_PEIC 0x00000100
249#define BM_UARTDBGICR_FEIC 0x00000080
250#define BM_UARTDBGICR_RTIC 0x00000040
251#define BM_UARTDBGICR_TXIC 0x00000020
252#define BM_UARTDBGICR_RXIC 0x00000010
253#define BM_UARTDBGICR_DSRMIC 0x00000008
254#define BM_UARTDBGICR_DCDMIC 0x00000004
255#define BM_UARTDBGICR_CTSMIC 0x00000002
256#define BM_UARTDBGICR_RIMIC 0x00000001
257#define HW_UARTDBGDMACR 0x00000048
258#define BP_UARTDBGDMACR_UNAVAILABLE 16
259#define BM_UARTDBGDMACR_UNAVAILABLE 0xFFFF0000
260#define BF_UARTDBGDMACR_UNAVAILABLE(v) \
261 (((v) << 16) & BM_UARTDBGDMACR_UNAVAILABLE)
262#define BP_UARTDBGDMACR_RESERVED 3
263#define BM_UARTDBGDMACR_RESERVED 0x0000FFF8
264#define BF_UARTDBGDMACR_RESERVED(v) \
265 (((v) << 3) & BM_UARTDBGDMACR_RESERVED)
266#define BM_UARTDBGDMACR_DMAONERR 0x00000004
267#define BM_UARTDBGDMACR_TXDMAE 0x00000002
268#define BM_UARTDBGDMACR_RXDMAE 0x00000001
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h b/arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h
new file mode 100644
index 000000000000..25112c1aa608
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h
@@ -0,0 +1,40 @@
1/*
2 * stmp378x: USBCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_USBCTRL_BASE (STMP3XXX_REGS_BASE + 0x80000)
22#define REGS_USBCTRL_PHYS 0x80080000
23#define REGS_USBCTRL_SIZE 0x2000
24
25#define HW_USBCTRL_USBCMD 0x140
26#define BM_USBCTRL_USBCMD_RS 0x00000001
27#define BP_USBCTRL_USBCMD_RS 0
28#define BM_USBCTRL_USBCMD_RST 0x00000002
29
30#define HW_USBCTRL_USBINTR 0x148
31#define BM_USBCTRL_USBINTR_UE 0x00000001
32#define BP_USBCTRL_USBINTR_UE 0
33
34#define HW_USBCTRL_PORTSC1 0x184
35#define BM_USBCTRL_PORTSC1_PHCD 0x00800000
36
37#define HW_USBCTRL_OTGSC 0x1A4
38#define BM_USBCTRL_OTGSC_ID 0x00000100
39#define BM_USBCTRL_OTGSC_IDIS 0x00010000
40#define BM_USBCTRL_OTGSC_IDIE 0x01000000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-usbphy.h b/arch/arm/mach-stmp378x/include/mach/regs-usbphy.h
new file mode 100644
index 000000000000..11f3b732dc92
--- /dev/null
+++ b/arch/arm/mach-stmp378x/include/mach/regs-usbphy.h
@@ -0,0 +1,37 @@
1/*
2 * stmp378x: USBPHY register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_USBPHY_BASE (STMP3XXX_REGS_BASE + 0x7C000)
22#define REGS_USBPHY_PHYS 0x8007C000
23#define REGS_USBPHY_SIZE 0x2000
24
25#define HW_USBPHY_PWD 0x0
26
27#define HW_USBPHY_CTRL 0x30
28#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT 0x00000002
29#define BM_USBPHY_CTRL_ENDEVPLUGINDETECT 0x00000010
30#define BM_USBPHY_CTRL_ENOTGIDDETECT 0x00000080
31#define BM_USBPHY_CTRL_ENIRQDEVPLUGIN 0x00000800
32#define BM_USBPHY_CTRL_CLKGATE 0x40000000
33#define BM_USBPHY_CTRL_SFTRST 0x80000000
34
35#define HW_USBPHY_STATUS 0x40
36#define BM_USBPHY_STATUS_DEVPLUGIN_STATUS 0x00000040
37#define BM_USBPHY_STATUS_OTGID_STATUS 0x00000100
diff --git a/arch/arm/mach-stmp378x/stmp378x.c b/arch/arm/mach-stmp378x/stmp378x.c
new file mode 100644
index 000000000000..ddd49a760fd4
--- /dev/null
+++ b/arch/arm/mach-stmp378x/stmp378x.c
@@ -0,0 +1,299 @@
1/*
2 * Freescale STMP378X platform support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/irq.h>
22#include <linux/dma-mapping.h>
23
24#include <asm/dma.h>
25#include <asm/setup.h>
26#include <asm/mach-types.h>
27
28#include <asm/mach/arch.h>
29#include <asm/mach/irq.h>
30#include <asm/mach/map.h>
31#include <asm/mach/time.h>
32
33#include <mach/pins.h>
34#include <mach/pinmux.h>
35#include <mach/dma.h>
36#include <mach/hardware.h>
37#include <mach/system.h>
38#include <mach/platform.h>
39#include <mach/stmp3xxx.h>
40#include <mach/regs-icoll.h>
41#include <mach/regs-apbh.h>
42#include <mach/regs-apbx.h>
43#include <mach/regs-pxp.h>
44#include <mach/regs-i2c.h>
45
46#include "stmp378x.h"
47/*
48 * IRQ handling
49 */
50static void stmp378x_ack_irq(unsigned int irq)
51{
52 /* Tell ICOLL to release IRQ line */
53 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR);
54
55 /* ACK current interrupt */
56 __raw_writel(0x01 /* BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 */,
57 REGS_ICOLL_BASE + HW_ICOLL_LEVELACK);
58
59 /* Barrier */
60 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT);
61}
62
63static void stmp378x_mask_irq(unsigned int irq)
64{
65 /* IRQ disable */
66 stmp3xxx_clearl(BM_ICOLL_INTERRUPTn_ENABLE,
67 REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10);
68}
69
70static void stmp378x_unmask_irq(unsigned int irq)
71{
72 /* IRQ enable */
73 stmp3xxx_setl(BM_ICOLL_INTERRUPTn_ENABLE,
74 REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10);
75}
76
77static struct irq_chip stmp378x_chip = {
78 .ack = stmp378x_ack_irq,
79 .mask = stmp378x_mask_irq,
80 .unmask = stmp378x_unmask_irq,
81};
82
83void __init stmp378x_init_irq(void)
84{
85 stmp3xxx_init_irq(&stmp378x_chip);
86}
87
88/*
89 * DMA interrupt handling
90 */
91void stmp3xxx_arch_dma_enable_interrupt(int channel)
92{
93 void __iomem *c1, *c2;
94
95 switch (STMP3XXX_DMA_BUS(channel)) {
96 case STMP3XXX_BUS_APBH:
97 c1 = REGS_APBH_BASE + HW_APBH_CTRL1;
98 c2 = REGS_APBH_BASE + HW_APBH_CTRL2;
99 break;
100
101 case STMP3XXX_BUS_APBX:
102 c1 = REGS_APBX_BASE + HW_APBX_CTRL1;
103 c2 = REGS_APBX_BASE + HW_APBX_CTRL2;
104 break;
105
106 default:
107 return;
108 }
109 stmp3xxx_setl(1 << (16 + STMP3XXX_DMA_CHANNEL(channel)), c1);
110 stmp3xxx_setl(1 << (16 + STMP3XXX_DMA_CHANNEL(channel)), c2);
111}
112EXPORT_SYMBOL(stmp3xxx_arch_dma_enable_interrupt);
113
114void stmp3xxx_arch_dma_clear_interrupt(int channel)
115{
116 void __iomem *c1, *c2;
117
118 switch (STMP3XXX_DMA_BUS(channel)) {
119 case STMP3XXX_BUS_APBH:
120 c1 = REGS_APBH_BASE + HW_APBH_CTRL1;
121 c2 = REGS_APBH_BASE + HW_APBH_CTRL2;
122 break;
123
124 case STMP3XXX_BUS_APBX:
125 c1 = REGS_APBX_BASE + HW_APBX_CTRL1;
126 c2 = REGS_APBX_BASE + HW_APBX_CTRL2;
127 break;
128
129 default:
130 return;
131 }
132 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel), c1);
133 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel), c2);
134}
135EXPORT_SYMBOL(stmp3xxx_arch_dma_clear_interrupt);
136
137int stmp3xxx_arch_dma_is_interrupt(int channel)
138{
139 int r = 0;
140
141 switch (STMP3XXX_DMA_BUS(channel)) {
142 case STMP3XXX_BUS_APBH:
143 r = __raw_readl(REGS_APBH_BASE + HW_APBH_CTRL1) &
144 (1 << STMP3XXX_DMA_CHANNEL(channel));
145 break;
146
147 case STMP3XXX_BUS_APBX:
148 r = __raw_readl(REGS_APBX_BASE + HW_APBX_CTRL1) &
149 (1 << STMP3XXX_DMA_CHANNEL(channel));
150 break;
151 }
152 return r;
153}
154EXPORT_SYMBOL(stmp3xxx_arch_dma_is_interrupt);
155
156void stmp3xxx_arch_dma_reset_channel(int channel)
157{
158 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
159 void __iomem *c0;
160 u32 mask;
161
162 switch (STMP3XXX_DMA_BUS(channel)) {
163 case STMP3XXX_BUS_APBH:
164 c0 = REGS_APBH_BASE + HW_APBH_CTRL0;
165 mask = chbit << BP_APBH_CTRL0_RESET_CHANNEL;
166 break;
167 case STMP3XXX_BUS_APBX:
168 c0 = REGS_APBX_BASE + HW_APBX_CHANNEL_CTRL;
169 mask = chbit << BP_APBX_CHANNEL_CTRL_RESET_CHANNEL;
170 break;
171 default:
172 return;
173 }
174
175 /* Reset channel and wait for it to complete */
176 stmp3xxx_setl(mask, c0);
177 while (__raw_readl(c0) & mask)
178 cpu_relax();
179}
180EXPORT_SYMBOL(stmp3xxx_arch_dma_reset_channel);
181
182void stmp3xxx_arch_dma_freeze(int channel)
183{
184 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
185 u32 mask = 1 << chbit;
186
187 switch (STMP3XXX_DMA_BUS(channel)) {
188 case STMP3XXX_BUS_APBH:
189 stmp3xxx_setl(mask, REGS_APBH_BASE + HW_APBH_CTRL0);
190 break;
191 case STMP3XXX_BUS_APBX:
192 stmp3xxx_setl(mask, REGS_APBX_BASE + HW_APBX_CHANNEL_CTRL);
193 break;
194 }
195}
196EXPORT_SYMBOL(stmp3xxx_arch_dma_freeze);
197
198void stmp3xxx_arch_dma_unfreeze(int channel)
199{
200 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
201 u32 mask = 1 << chbit;
202
203 switch (STMP3XXX_DMA_BUS(channel)) {
204 case STMP3XXX_BUS_APBH:
205 stmp3xxx_clearl(mask, REGS_APBH_BASE + HW_APBH_CTRL0);
206 break;
207 case STMP3XXX_BUS_APBX:
208 stmp3xxx_clearl(mask, REGS_APBX_BASE + HW_APBX_CHANNEL_CTRL);
209 break;
210 }
211}
212EXPORT_SYMBOL(stmp3xxx_arch_dma_unfreeze);
213
214/*
215 * The registers are all very closely mapped, so we might as well map them all
216 * with a single mapping
217 *
218 * Logical Physical
219 * f0000000 80000000 On-chip registers
220 * f1000000 00000000 32k on-chip SRAM
221 */
222
223static struct map_desc stmp378x_io_desc[] __initdata = {
224 {
225 .virtual = (u32)STMP3XXX_REGS_BASE,
226 .pfn = __phys_to_pfn(STMP3XXX_REGS_PHBASE),
227 .length = STMP3XXX_REGS_SIZE,
228 .type = MT_DEVICE,
229 },
230 {
231 .virtual = (u32)STMP3XXX_OCRAM_BASE,
232 .pfn = __phys_to_pfn(STMP3XXX_OCRAM_PHBASE),
233 .length = STMP3XXX_OCRAM_SIZE,
234 .type = MT_DEVICE,
235 },
236};
237
238
239static u64 common_dmamask = DMA_BIT_MASK(32);
240
241/*
242 * devices that are present only on stmp378x, not on all 3xxx boards:
243 * PxP
244 * I2C
245 */
246static struct resource pxp_resource[] = {
247 {
248 .flags = IORESOURCE_MEM,
249 .start = REGS_PXP_PHYS,
250 .end = REGS_PXP_PHYS + REGS_PXP_SIZE,
251 }, {
252 .flags = IORESOURCE_IRQ,
253 .start = IRQ_PXP,
254 .end = IRQ_PXP,
255 },
256};
257
258struct platform_device stmp378x_pxp = {
259 .name = "stmp3xxx-pxp",
260 .id = -1,
261 .dev = {
262 .dma_mask = &common_dmamask,
263 .coherent_dma_mask = DMA_BIT_MASK(32),
264 },
265 .num_resources = ARRAY_SIZE(pxp_resource),
266 .resource = pxp_resource,
267};
268
269static struct resource i2c_resources[] = {
270 {
271 .flags = IORESOURCE_IRQ,
272 .start = IRQ_I2C_ERROR,
273 .end = IRQ_I2C_ERROR,
274 }, {
275 .flags = IORESOURCE_MEM,
276 .start = REGS_I2C_PHYS,
277 .end = REGS_I2C_PHYS + REGS_I2C_SIZE,
278 }, {
279 .flags = IORESOURCE_DMA,
280 .start = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX),
281 .end = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX),
282 },
283};
284
285struct platform_device stmp378x_i2c = {
286 .name = "i2c_stmp3xxx",
287 .id = 0,
288 .dev = {
289 .dma_mask = &common_dmamask,
290 .coherent_dma_mask = DMA_BIT_MASK(32),
291 },
292 .resource = i2c_resources,
293 .num_resources = ARRAY_SIZE(i2c_resources),
294};
295
296void __init stmp378x_map_io(void)
297{
298 iotable_init(stmp378x_io_desc, ARRAY_SIZE(stmp378x_io_desc));
299}
diff --git a/arch/arm/mach-stmp378x/stmp378x.h b/arch/arm/mach-stmp378x/stmp378x.h
new file mode 100644
index 000000000000..0dc15b3c891f
--- /dev/null
+++ b/arch/arm/mach-stmp378x/stmp378x.h
@@ -0,0 +1,25 @@
1/*
2 * Freescale STMP37XX/STMP378X internal functions and data declarations
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __MACH_STMP378X_H
19#define __MACH_STMP378X_H
20
21void stmp378x_map_io(void);
22void stmp378x_init_irq(void);
23
24extern struct platform_device stmp378x_pxp, stmp378x_i2c;
25#endif /* __MACH_STMP378X_COMMON_H */
diff --git a/arch/arm/mach-stmp378x/stmp378x_devb.c b/arch/arm/mach-stmp378x/stmp378x_devb.c
new file mode 100644
index 000000000000..90d8fe6f10fe
--- /dev/null
+++ b/arch/arm/mach-stmp378x/stmp378x_devb.c
@@ -0,0 +1,334 @@
1/*
2 * Freescale STMP378X development board support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/io.h>
21#include <linux/platform_device.h>
22#include <linux/delay.h>
23#include <linux/clk.h>
24#include <linux/err.h>
25#include <linux/spi/spi.h>
26
27#include <asm/setup.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30
31#include <mach/pins.h>
32#include <mach/pinmux.h>
33#include <mach/platform.h>
34#include <mach/stmp3xxx.h>
35#include <mach/mmc.h>
36#include <mach/gpmi.h>
37
38#include "stmp378x.h"
39
40static struct platform_device *devices[] = {
41 &stmp3xxx_dbguart,
42 &stmp3xxx_appuart,
43 &stmp3xxx_watchdog,
44 &stmp3xxx_touchscreen,
45 &stmp3xxx_rtc,
46 &stmp3xxx_keyboard,
47 &stmp3xxx_framebuffer,
48 &stmp3xxx_backlight,
49 &stmp3xxx_rotdec,
50 &stmp3xxx_persistent,
51 &stmp3xxx_dcp_bootstream,
52 &stmp3xxx_dcp,
53 &stmp3xxx_battery,
54 &stmp378x_pxp,
55 &stmp378x_i2c,
56};
57
58static struct pin_desc i2c_pins_desc[] = {
59 { PINID_I2C_SCL, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
60 { PINID_I2C_SDA, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
61};
62
63static struct pin_group i2c_pins = {
64 .pins = i2c_pins_desc,
65 .nr_pins = ARRAY_SIZE(i2c_pins_desc),
66};
67
68static struct pin_desc dbguart_pins_0[] = {
69 { PINID_PWM0, PIN_FUN3, },
70 { PINID_PWM1, PIN_FUN3, },
71};
72
73static struct pin_group dbguart_pins[] = {
74 [0] = {
75 .pins = dbguart_pins_0,
76 .nr_pins = ARRAY_SIZE(dbguart_pins_0),
77 },
78};
79
80static int dbguart_pins_control(int id, int request)
81{
82 int r = 0;
83
84 if (request)
85 r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart");
86 else
87 stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart");
88 return r;
89}
90
91static struct pin_desc appuart_pins_0[] = {
92 { PINID_AUART1_CTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
93 { PINID_AUART1_RTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
94 { PINID_AUART1_RX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
95 { PINID_AUART1_TX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
96};
97
98static struct pin_desc appuart_pins_1[] = {
99#if 0 /* enable these when second appuart will be connected */
100 { PINID_AUART2_CTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
101 { PINID_AUART2_RTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
102 { PINID_AUART2_RX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
103 { PINID_AUART2_TX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
104#endif
105};
106
107static struct pin_desc mmc_pins_desc[] = {
108 { PINID_SSP1_DATA0, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
109 { PINID_SSP1_DATA1, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
110 { PINID_SSP1_DATA2, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
111 { PINID_SSP1_DATA3, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
112 { PINID_SSP1_CMD, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
113 { PINID_SSP1_SCK, PIN_FUN1, PIN_8MA, PIN_3_3V, 0 },
114 { PINID_SSP1_DETECT, PIN_FUN1, PIN_8MA, PIN_3_3V, 0 },
115};
116
117static struct pin_group mmc_pins = {
118 .pins = mmc_pins_desc,
119 .nr_pins = ARRAY_SIZE(mmc_pins_desc),
120};
121
122static int stmp3xxxmmc_get_wp(void)
123{
124 return gpio_get_value(PINID_PWM4);
125}
126
127static int stmp3xxxmmc_hw_init_ssp1(void)
128{
129 int ret;
130
131 ret = stmp3xxx_request_pin_group(&mmc_pins, "mmc");
132 if (ret)
133 goto out;
134
135 /* Configure write protect GPIO pin */
136 ret = gpio_request(PINID_PWM4, "mmc wp");
137 if (ret)
138 goto out_wp;
139
140 gpio_direction_input(PINID_PWM4);
141
142 /* Configure POWER pin as gpio to drive power to MMC slot */
143 ret = gpio_request(PINID_PWM3, "mmc power");
144 if (ret)
145 goto out_power;
146
147 gpio_direction_output(PINID_PWM3, 0);
148 mdelay(100);
149
150 return 0;
151
152out_power:
153 gpio_free(PINID_PWM4);
154out_wp:
155 stmp3xxx_release_pin_group(&mmc_pins, "mmc");
156out:
157 return ret;
158}
159
160static void stmp3xxxmmc_hw_release_ssp1(void)
161{
162 gpio_free(PINID_PWM3);
163 gpio_free(PINID_PWM4);
164 stmp3xxx_release_pin_group(&mmc_pins, "mmc");
165}
166
167static void stmp3xxxmmc_cmd_pullup_ssp1(int enable)
168{
169 stmp3xxx_pin_pullup(PINID_SSP1_CMD, enable, "mmc");
170}
171
172static unsigned long
173stmp3xxxmmc_setclock_ssp1(void __iomem *base, unsigned long hz)
174{
175 struct clk *ssp, *parent;
176 char *p;
177 long r;
178
179 ssp = clk_get(NULL, "ssp");
180
181 /* using SSP1, no timeout, clock rate 1 */
182 writel(BF(2, SSP_TIMING_CLOCK_DIVIDE) |
183 BF(0xFFFF, SSP_TIMING_TIMEOUT),
184 base + HW_SSP_TIMING);
185
186 p = (hz > 1000000) ? "io" : "osc_24M";
187 parent = clk_get(NULL, p);
188 clk_set_parent(ssp, parent);
189 r = clk_set_rate(ssp, 2 * hz / 1000);
190 clk_put(parent);
191 clk_put(ssp);
192
193 return hz;
194}
195
196static struct stmp3xxxmmc_platform_data mmc_data = {
197 .hw_init = stmp3xxxmmc_hw_init_ssp1,
198 .hw_release = stmp3xxxmmc_hw_release_ssp1,
199 .get_wp = stmp3xxxmmc_get_wp,
200 .cmd_pullup = stmp3xxxmmc_cmd_pullup_ssp1,
201 .setclock = stmp3xxxmmc_setclock_ssp1,
202};
203
204
205static struct pin_group appuart_pins[] = {
206 [0] = {
207 .pins = appuart_pins_0,
208 .nr_pins = ARRAY_SIZE(appuart_pins_0),
209 },
210 [1] = {
211 .pins = appuart_pins_1,
212 .nr_pins = ARRAY_SIZE(appuart_pins_1),
213 },
214};
215
216static struct pin_desc ssp1_pins_desc[] = {
217 { PINID_SSP1_SCK, PIN_FUN1, PIN_8MA, PIN_3_3V, 0, },
218 { PINID_SSP1_CMD, PIN_FUN1, PIN_4MA, PIN_3_3V, 0, },
219 { PINID_SSP1_DATA0, PIN_FUN1, PIN_4MA, PIN_3_3V, 0, },
220 { PINID_SSP1_DATA3, PIN_FUN1, PIN_4MA, PIN_3_3V, 0, },
221};
222
223static struct pin_desc ssp2_pins_desc[] = {
224 { PINID_GPMI_WRN, PIN_FUN3, PIN_8MA, PIN_3_3V, 0, },
225 { PINID_GPMI_RDY1, PIN_FUN3, PIN_4MA, PIN_3_3V, 0, },
226 { PINID_GPMI_D00, PIN_FUN3, PIN_4MA, PIN_3_3V, 0, },
227 { PINID_GPMI_D03, PIN_FUN3, PIN_4MA, PIN_3_3V, 0, },
228};
229
230static struct pin_group ssp1_pins = {
231 .pins = ssp1_pins_desc,
232 .nr_pins = ARRAY_SIZE(ssp1_pins_desc),
233};
234
235static struct pin_group ssp2_pins = {
236 .pins = ssp1_pins_desc,
237 .nr_pins = ARRAY_SIZE(ssp2_pins_desc),
238};
239
240static struct pin_desc gpmi_pins_desc[] = {
241 { PINID_GPMI_CE0N, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
242 { PINID_GPMI_CE1N, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
243 { PINID_GMPI_CE2N, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
244 { PINID_GPMI_CLE, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
245 { PINID_GPMI_ALE, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
246 { PINID_GPMI_WPN, PIN_FUN1, PIN_12MA, PIN_3_3V, 0 },
247 { PINID_GPMI_RDY1, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
248 { PINID_GPMI_D00, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
249 { PINID_GPMI_D01, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
250 { PINID_GPMI_D02, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
251 { PINID_GPMI_D03, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
252 { PINID_GPMI_D04, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
253 { PINID_GPMI_D05, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
254 { PINID_GPMI_D06, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
255 { PINID_GPMI_D07, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
256 { PINID_GPMI_RDY0, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
257 { PINID_GPMI_RDY2, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
258 { PINID_GPMI_RDY3, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
259 { PINID_GPMI_WRN, PIN_FUN1, PIN_12MA, PIN_3_3V, 0 },
260 { PINID_GPMI_RDN, PIN_FUN1, PIN_12MA, PIN_3_3V, 0 },
261};
262
263static struct pin_group gpmi_pins = {
264 .pins = gpmi_pins_desc,
265 .nr_pins = ARRAY_SIZE(gpmi_pins_desc),
266};
267
268static struct mtd_partition gpmi_partitions[] = {
269 [0] = {
270 .name = "boot",
271 .size = 10 * SZ_1M,
272 .offset = 0,
273 },
274 [1] = {
275 .name = "data",
276 .size = MTDPART_SIZ_FULL,
277 .offset = MTDPART_OFS_APPEND,
278 },
279};
280
281static struct gpmi_platform_data gpmi_data = {
282 .pins = &gpmi_pins,
283 .nr_parts = ARRAY_SIZE(gpmi_partitions),
284 .parts = gpmi_partitions,
285 .part_types = { "cmdline", NULL },
286};
287
288static struct spi_board_info spi_board_info[] __initdata = {
289#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
290 {
291 .modalias = "enc28j60",
292 .max_speed_hz = 6 * 1000 * 1000,
293 .bus_num = 1,
294 .chip_select = 0,
295 .platform_data = NULL,
296 },
297#endif
298};
299
300static void __init stmp378x_devb_init(void)
301{
302 stmp3xxx_pinmux_init(NR_REAL_IRQS);
303
304 /* init stmp3xxx platform */
305 stmp3xxx_init();
306
307 stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control;
308 stmp3xxx_appuart.dev.platform_data = appuart_pins;
309 stmp3xxx_mmc.dev.platform_data = &mmc_data;
310 stmp3xxx_gpmi.dev.platform_data = &gpmi_data;
311 stmp3xxx_spi1.dev.platform_data = &ssp1_pins;
312 stmp3xxx_spi2.dev.platform_data = &ssp2_pins;
313 stmp378x_i2c.dev.platform_data = &i2c_pins;
314
315 /* register spi devices */
316 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
317
318 /* add board's devices */
319 platform_add_devices(devices, ARRAY_SIZE(devices));
320
321 /* add devices selected by command line ssp1= and ssp2= options */
322 stmp3xxx_ssp1_device_register();
323 stmp3xxx_ssp2_device_register();
324}
325
326MACHINE_START(STMP378X, "STMP378X")
327 .phys_io = 0x80000000,
328 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
329 .boot_params = 0x40000100,
330 .map_io = stmp378x_map_io,
331 .init_irq = stmp378x_init_irq,
332 .timer = &stmp3xxx_timer,
333 .init_machine = stmp378x_devb_init,
334MACHINE_END
diff --git a/arch/arm/mach-stmp37xx/Makefile b/arch/arm/mach-stmp37xx/Makefile
new file mode 100644
index 000000000000..57deffd09fbf
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/Makefile
@@ -0,0 +1,2 @@
1obj-$(CONFIG_ARCH_STMP37XX) += stmp37xx.o
2obj-$(CONFIG_MACH_STMP37XX) += stmp37xx_devb.o
diff --git a/arch/arm/mach-stmp37xx/Makefile.boot b/arch/arm/mach-stmp37xx/Makefile.boot
new file mode 100644
index 000000000000..1568ad404d59
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x40008000
2params_phys-y := 0x40000100
3initrd_phys-y := 0x40800000
diff --git a/arch/arm/mach-stmp37xx/include/mach/entry-macro.S b/arch/arm/mach-stmp37xx/include/mach/entry-macro.S
new file mode 100644
index 000000000000..fed2787b6c34
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/entry-macro.S
@@ -0,0 +1,37 @@
1/*
2 * Low-level IRQ helper macros for Freescale STMP37XX
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19 .macro disable_fiq
20 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23
24 mov \base, #0xf0000000 @ vm address of IRQ controller
25 ldr \irqnr, [\base, #0x30] @ HW_ICOLL_STAT
26 cmp \irqnr, #0x3f
27 movne \irqstat, #0 @ Ack this IRQ
28 strne \irqstat, [\base, #0x00]@ HW_ICOLL_VECTOR
29 moveqs \irqnr, #0 @ Zero flag set for no IRQ
30
31 .endm
32
33 .macro get_irqnr_preamble, base, tmp
34 .endm
35
36 .macro arch_ret_to_user, tmp1, tmp2
37 .endm
diff --git a/arch/arm/mach-stmp37xx/include/mach/irqs.h b/arch/arm/mach-stmp37xx/include/mach/irqs.h
new file mode 100644
index 000000000000..98f12938550d
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/irqs.h
@@ -0,0 +1,99 @@
1/*
2 * Freescale STMP37XX interrupts
3 *
4 * Copyright (C) 2005 Sigmatel Inc
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef _ASM_ARCH_IRQS_H
19#define _ASM_ARCH_IRQS_H
20
21#define IRQ_DEBUG_UART 0
22#define IRQ_COMMS_RX 1
23#define IRQ_COMMS_TX 1
24#define IRQ_SSP2_ERROR 2
25#define IRQ_VDD5V 3
26#define IRQ_HEADPHONE_SHORT 4
27#define IRQ_DAC_DMA 5
28#define IRQ_DAC_ERROR 6
29#define IRQ_ADC_DMA 7
30#define IRQ_ADC_ERROR 8
31#define IRQ_SPDIF_DMA 9
32#define IRQ_SAIF2_DMA 9
33#define IRQ_SPDIF_ERROR 10
34#define IRQ_SAIF1_IRQ 10
35#define IRQ_SAIF2_IRQ 10
36#define IRQ_USB_CTRL 11
37#define IRQ_USB_WAKEUP 12
38#define IRQ_GPMI_DMA 13
39#define IRQ_SSP1_DMA 14
40#define IRQ_SSP_ERROR 15
41#define IRQ_GPIO0 16
42#define IRQ_GPIO1 17
43#define IRQ_GPIO2 18
44#define IRQ_SAIF1_DMA 19
45#define IRQ_SSP2_DMA 20
46#define IRQ_ECC8_IRQ 21
47#define IRQ_RTC_ALARM 22
48#define IRQ_UARTAPP_TX_DMA 23
49#define IRQ_UARTAPP_INTERNAL 24
50#define IRQ_UARTAPP_RX_DMA 25
51#define IRQ_I2C_DMA 26
52#define IRQ_I2C_ERROR 27
53#define IRQ_TIMER0 28
54#define IRQ_TIMER1 29
55#define IRQ_TIMER2 30
56#define IRQ_TIMER3 31
57#define IRQ_BATT_BRNOUT 32
58#define IRQ_VDDD_BRNOUT 33
59#define IRQ_VDDIO_BRNOUT 34
60#define IRQ_VDD18_BRNOUT 35
61#define IRQ_TOUCH_DETECT 36
62#define IRQ_LRADC_CH0 37
63#define IRQ_LRADC_CH1 38
64#define IRQ_LRADC_CH2 39
65#define IRQ_LRADC_CH3 40
66#define IRQ_LRADC_CH4 41
67#define IRQ_LRADC_CH5 42
68#define IRQ_LRADC_CH6 43
69#define IRQ_LRADC_CH7 44
70#define IRQ_LCDIF_DMA 45
71#define IRQ_LCDIF_ERROR 46
72#define IRQ_DIGCTL_DEBUG_TRAP 47
73#define IRQ_RTC_1MSEC 48
74#define IRQ_DRI_DMA 49
75#define IRQ_DRI_ATTENTION 50
76#define IRQ_GPMI_ATTENTION 51
77#define IRQ_IR 52
78#define IRQ_DCP_VMI 53
79#define IRQ_DCP 54
80#define IRQ_RESERVED_55 55
81#define IRQ_RESERVED_56 56
82#define IRQ_RESERVED_57 57
83#define IRQ_RESERVED_58 58
84#define IRQ_RESERVED_59 59
85#define SW_IRQ_60 60
86#define SW_IRQ_61 61
87#define SW_IRQ_62 62
88#define SW_IRQ_63 63
89
90#define NR_REAL_IRQS 64
91#define NR_IRQS (NR_REAL_IRQS + 32 * 3)
92
93/* TIMER and BRNOUT are FIQ capable */
94#define FIQ_START IRQ_TIMER0
95
96/* Hard disk IRQ is a GPMI attention IRQ */
97#define IRQ_HARDDISK IRQ_GPMI_ATTENTION
98
99#endif /* _ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-stmp37xx/include/mach/pins.h b/arch/arm/mach-stmp37xx/include/mach/pins.h
new file mode 100644
index 000000000000..d56de0c471d8
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/pins.h
@@ -0,0 +1,147 @@
1/*
2 * Freescale STMP37XX SoC pin multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_ARCH_PINS_H
19#define __ASM_ARCH_PINS_H
20
21/*
22 * Define all STMP37XX pins, a pin name corresponds to a STMP37xx hardware
23 * interface this pin belongs to.
24 */
25
26/* Bank 0 */
27#define PINID_GPMI_D00 STMP3XXX_PINID(0, 0)
28#define PINID_GPMI_D01 STMP3XXX_PINID(0, 1)
29#define PINID_GPMI_D02 STMP3XXX_PINID(0, 2)
30#define PINID_GPMI_D03 STMP3XXX_PINID(0, 3)
31#define PINID_GPMI_D04 STMP3XXX_PINID(0, 4)
32#define PINID_GPMI_D05 STMP3XXX_PINID(0, 5)
33#define PINID_GPMI_D06 STMP3XXX_PINID(0, 6)
34#define PINID_GPMI_D07 STMP3XXX_PINID(0, 7)
35#define PINID_GPMI_D08 STMP3XXX_PINID(0, 8)
36#define PINID_GPMI_D09 STMP3XXX_PINID(0, 9)
37#define PINID_GPMI_D10 STMP3XXX_PINID(0, 10)
38#define PINID_GPMI_D11 STMP3XXX_PINID(0, 11)
39#define PINID_GPMI_D12 STMP3XXX_PINID(0, 12)
40#define PINID_GPMI_D13 STMP3XXX_PINID(0, 13)
41#define PINID_GPMI_D14 STMP3XXX_PINID(0, 14)
42#define PINID_GPMI_D15 STMP3XXX_PINID(0, 15)
43#define PINID_GPMI_A0 STMP3XXX_PINID(0, 16)
44#define PINID_GPMI_A1 STMP3XXX_PINID(0, 17)
45#define PINID_GPMI_A2 STMP3XXX_PINID(0, 18)
46#define PINID_GPMI_RDY0 STMP3XXX_PINID(0, 19)
47#define PINID_GPMI_RDY2 STMP3XXX_PINID(0, 20)
48#define PINID_GPMI_RDY3 STMP3XXX_PINID(0, 21)
49#define PINID_GPMI_RESETN STMP3XXX_PINID(0, 22)
50#define PINID_GPMI_IRQ STMP3XXX_PINID(0, 23)
51#define PINID_GPMI_WRN STMP3XXX_PINID(0, 24)
52#define PINID_GPMI_RDN STMP3XXX_PINID(0, 25)
53#define PINID_UART2_CTS STMP3XXX_PINID(0, 26)
54#define PINID_UART2_RTS STMP3XXX_PINID(0, 27)
55#define PINID_UART2_RX STMP3XXX_PINID(0, 28)
56#define PINID_UART2_TX STMP3XXX_PINID(0, 29)
57
58/* Bank 1 */
59#define PINID_LCD_D00 STMP3XXX_PINID(1, 0)
60#define PINID_LCD_D01 STMP3XXX_PINID(1, 1)
61#define PINID_LCD_D02 STMP3XXX_PINID(1, 2)
62#define PINID_LCD_D03 STMP3XXX_PINID(1, 3)
63#define PINID_LCD_D04 STMP3XXX_PINID(1, 4)
64#define PINID_LCD_D05 STMP3XXX_PINID(1, 5)
65#define PINID_LCD_D06 STMP3XXX_PINID(1, 6)
66#define PINID_LCD_D07 STMP3XXX_PINID(1, 7)
67#define PINID_LCD_D08 STMP3XXX_PINID(1, 8)
68#define PINID_LCD_D09 STMP3XXX_PINID(1, 9)
69#define PINID_LCD_D10 STMP3XXX_PINID(1, 10)
70#define PINID_LCD_D11 STMP3XXX_PINID(1, 11)
71#define PINID_LCD_D12 STMP3XXX_PINID(1, 12)
72#define PINID_LCD_D13 STMP3XXX_PINID(1, 13)
73#define PINID_LCD_D14 STMP3XXX_PINID(1, 14)
74#define PINID_LCD_D15 STMP3XXX_PINID(1, 15)
75#define PINID_LCD_RESET STMP3XXX_PINID(1, 16)
76#define PINID_LCD_RS STMP3XXX_PINID(1, 17)
77#define PINID_LCD_WR_RWN STMP3XXX_PINID(1, 18)
78#define PINID_LCD_RD_E STMP3XXX_PINID(1, 19)
79#define PINID_LCD_CS STMP3XXX_PINID(1, 20)
80#define PINID_LCD_BUSY STMP3XXX_PINID(1, 21)
81#define PINID_SSP1_CMD STMP3XXX_PINID(1, 22)
82#define PINID_SSP1_SCK STMP3XXX_PINID(1, 23)
83#define PINID_SSP1_DATA0 STMP3XXX_PINID(1, 24)
84#define PINID_SSP1_DATA1 STMP3XXX_PINID(1, 25)
85#define PINID_SSP1_DATA2 STMP3XXX_PINID(1, 26)
86#define PINID_SSP1_DATA3 STMP3XXX_PINID(1, 27)
87#define PINID_SSP1_DETECT STMP3XXX_PINID(1, 28)
88
89/* Bank 2 */
90#define PINID_PWM0 STMP3XXX_PINID(2, 0)
91#define PINID_PWM1 STMP3XXX_PINID(2, 1)
92#define PINID_PWM2 STMP3XXX_PINID(2, 2)
93#define PINID_PWM3 STMP3XXX_PINID(2, 3)
94#define PINID_PWM4 STMP3XXX_PINID(2, 4)
95#define PINID_I2C_SCL STMP3XXX_PINID(2, 5)
96#define PINID_I2C_SDA STMP3XXX_PINID(2, 6)
97#define PINID_ROTTARYA STMP3XXX_PINID(2, 7)
98#define PINID_ROTTARYB STMP3XXX_PINID(2, 8)
99#define PINID_EMI_CKE STMP3XXX_PINID(2, 9)
100#define PINID_EMI_RASN STMP3XXX_PINID(2, 10)
101#define PINID_EMI_CASN STMP3XXX_PINID(2, 11)
102#define PINID_EMI_CE0N STMP3XXX_PINID(2, 12)
103#define PINID_EMI_CE1N STMP3XXX_PINID(2, 13)
104#define PINID_EMI_CE2N STMP3XXX_PINID(2, 14)
105#define PINID_EMI_CE3N STMP3XXX_PINID(2, 15)
106#define PINID_EMI_A00 STMP3XXX_PINID(2, 16)
107#define PINID_EMI_A01 STMP3XXX_PINID(2, 17)
108#define PINID_EMI_A02 STMP3XXX_PINID(2, 18)
109#define PINID_EMI_A03 STMP3XXX_PINID(2, 19)
110#define PINID_EMI_A04 STMP3XXX_PINID(2, 20)
111#define PINID_EMI_A05 STMP3XXX_PINID(2, 21)
112#define PINID_EMI_A06 STMP3XXX_PINID(2, 22)
113#define PINID_EMI_A07 STMP3XXX_PINID(2, 23)
114#define PINID_EMI_A08 STMP3XXX_PINID(2, 24)
115#define PINID_EMI_A09 STMP3XXX_PINID(2, 25)
116#define PINID_EMI_A10 STMP3XXX_PINID(2, 26)
117#define PINID_EMI_A11 STMP3XXX_PINID(2, 27)
118#define PINID_EMI_A12 STMP3XXX_PINID(2, 28)
119#define PINID_EMI_A13 STMP3XXX_PINID(2, 29)
120#define PINID_EMI_A14 STMP3XXX_PINID(2, 30)
121#define PINID_EMI_WEN STMP3XXX_PINID(2, 31)
122
123/* Bank 3 */
124#define PINID_EMI_D00 STMP3XXX_PINID(3, 0)
125#define PINID_EMI_D01 STMP3XXX_PINID(3, 1)
126#define PINID_EMI_D02 STMP3XXX_PINID(3, 2)
127#define PINID_EMI_D03 STMP3XXX_PINID(3, 3)
128#define PINID_EMI_D04 STMP3XXX_PINID(3, 4)
129#define PINID_EMI_D05 STMP3XXX_PINID(3, 5)
130#define PINID_EMI_D06 STMP3XXX_PINID(3, 6)
131#define PINID_EMI_D07 STMP3XXX_PINID(3, 7)
132#define PINID_EMI_D08 STMP3XXX_PINID(3, 8)
133#define PINID_EMI_D09 STMP3XXX_PINID(3, 9)
134#define PINID_EMI_D10 STMP3XXX_PINID(3, 10)
135#define PINID_EMI_D11 STMP3XXX_PINID(3, 11)
136#define PINID_EMI_D12 STMP3XXX_PINID(3, 12)
137#define PINID_EMI_D13 STMP3XXX_PINID(3, 13)
138#define PINID_EMI_D14 STMP3XXX_PINID(3, 14)
139#define PINID_EMI_D15 STMP3XXX_PINID(3, 15)
140#define PINID_EMI_DQS0 STMP3XXX_PINID(3, 16)
141#define PINID_EMI_DQS1 STMP3XXX_PINID(3, 17)
142#define PINID_EMI_DQM0 STMP3XXX_PINID(3, 18)
143#define PINID_EMI_DQM1 STMP3XXX_PINID(3, 19)
144#define PINID_EMI_CLK STMP3XXX_PINID(3, 20)
145#define PINID_EMI_CLKN STMP3XXX_PINID(3, 21)
146
147#endif /* __ASM_ARCH_PINS_H */
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-apbh.h b/arch/arm/mach-stmp37xx/include/mach/regs-apbh.h
new file mode 100644
index 000000000000..a323aa9a21f2
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-apbh.h
@@ -0,0 +1,97 @@
1/*
2 * stmp37xx: APBH register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_APBH
22#define _MACH_REGS_APBH
23
24#define REGS_APBH_BASE (STMP3XXX_REGS_BASE + 0x4000)
25
26#define HW_APBH_CTRL0 0x0
27#define BM_APBH_CTRL0_RESET_CHANNEL 0x00FF0000
28#define BP_APBH_CTRL0_RESET_CHANNEL 16
29#define BM_APBH_CTRL0_CLKGATE 0x40000000
30#define BM_APBH_CTRL0_SFTRST 0x80000000
31
32#define HW_APBH_CTRL1 0x10
33#define BM_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0x00000001
34#define BP_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0
35
36#define HW_APBH_DEVSEL 0x20
37
38#define HW_APBH_CH0_NXTCMDAR (0x50 + 0 * 0x70)
39#define HW_APBH_CH1_NXTCMDAR (0x50 + 1 * 0x70)
40#define HW_APBH_CH2_NXTCMDAR (0x50 + 2 * 0x70)
41#define HW_APBH_CH3_NXTCMDAR (0x50 + 3 * 0x70)
42#define HW_APBH_CH4_NXTCMDAR (0x50 + 4 * 0x70)
43#define HW_APBH_CH5_NXTCMDAR (0x50 + 5 * 0x70)
44#define HW_APBH_CH6_NXTCMDAR (0x50 + 6 * 0x70)
45#define HW_APBH_CH7_NXTCMDAR (0x50 + 7 * 0x70)
46#define HW_APBH_CH8_NXTCMDAR (0x50 + 8 * 0x70)
47#define HW_APBH_CH9_NXTCMDAR (0x50 + 9 * 0x70)
48#define HW_APBH_CH10_NXTCMDAR (0x50 + 10 * 0x70)
49#define HW_APBH_CH11_NXTCMDAR (0x50 + 11 * 0x70)
50#define HW_APBH_CH12_NXTCMDAR (0x50 + 12 * 0x70)
51#define HW_APBH_CH13_NXTCMDAR (0x50 + 13 * 0x70)
52#define HW_APBH_CH14_NXTCMDAR (0x50 + 14 * 0x70)
53#define HW_APBH_CH15_NXTCMDAR (0x50 + 15 * 0x70)
54
55#define HW_APBH_CHn_NXTCMDAR 0x50
56
57#define BM_APBH_CHn_CMD_MODE 0x00000003
58#define BP_APBH_CHn_CMD_MODE 0x00000001
59#define BV_APBH_CHn_CMD_MODE_NOOP 0
60#define BV_APBH_CHn_CMD_MODE_WRITE 1
61#define BV_APBH_CHn_CMD_MODE_READ 2
62#define BV_APBH_CHn_CMD_MODE_SENSE 3
63#define BM_APBH_CHn_CMD_CHAIN 0x00000004
64#define BM_APBH_CHn_CMD_IRQONCMPLT 0x00000008
65#define BM_APBH_CHn_CMD_NANDLOCK 0x00000010
66#define BM_APBH_CHn_CMD_NANDWAIT4READY 0x00000020
67#define BM_APBH_CHn_CMD_SEMAPHORE 0x00000040
68#define BM_APBH_CHn_CMD_WAIT4ENDCMD 0x00000080
69#define BM_APBH_CHn_CMD_CMDWORDS 0x0000F000
70#define BP_APBH_CHn_CMD_CMDWORDS 12
71#define BM_APBH_CHn_CMD_XFER_COUNT 0xFFFF0000
72#define BP_APBH_CHn_CMD_XFER_COUNT 16
73
74#define HW_APBH_CH0_SEMA (0x80 + 0 * 0x70)
75#define HW_APBH_CH1_SEMA (0x80 + 1 * 0x70)
76#define HW_APBH_CH2_SEMA (0x80 + 2 * 0x70)
77#define HW_APBH_CH3_SEMA (0x80 + 3 * 0x70)
78#define HW_APBH_CH4_SEMA (0x80 + 4 * 0x70)
79#define HW_APBH_CH5_SEMA (0x80 + 5 * 0x70)
80#define HW_APBH_CH6_SEMA (0x80 + 6 * 0x70)
81#define HW_APBH_CH7_SEMA (0x80 + 7 * 0x70)
82#define HW_APBH_CH8_SEMA (0x80 + 8 * 0x70)
83#define HW_APBH_CH9_SEMA (0x80 + 9 * 0x70)
84#define HW_APBH_CH10_SEMA (0x80 + 10 * 0x70)
85#define HW_APBH_CH11_SEMA (0x80 + 11 * 0x70)
86#define HW_APBH_CH12_SEMA (0x80 + 12 * 0x70)
87#define HW_APBH_CH13_SEMA (0x80 + 13 * 0x70)
88#define HW_APBH_CH14_SEMA (0x80 + 14 * 0x70)
89#define HW_APBH_CH15_SEMA (0x80 + 15 * 0x70)
90
91#define HW_APBH_CHn_SEMA 0x80
92#define BM_APBH_CHn_SEMA_INCREMENT_SEMA 0x000000FF
93#define BP_APBH_CHn_SEMA_INCREMENT_SEMA 0
94#define BM_APBH_CHn_SEMA_PHORE 0x00FF0000
95#define BP_APBH_CHn_SEMA_PHORE 16
96
97#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-apbx.h b/arch/arm/mach-stmp37xx/include/mach/regs-apbx.h
new file mode 100644
index 000000000000..6d080cd5b702
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-apbx.h
@@ -0,0 +1,113 @@
1/*
2 * stmp37xx: APBX register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_APBX
22#define _MACH_REGS_APBX
23
24#define REGS_APBX_BASE (STMP3XXX_REGS_BASE + 0x24000)
25
26#define HW_APBX_CTRL0 0x0
27#define BM_APBX_CTRL0_RESET_CHANNEL 0x00FF0000
28#define BP_APBX_CTRL0_RESET_CHANNEL 16
29#define BM_APBX_CTRL0_CLKGATE 0x40000000
30#define BM_APBX_CTRL0_SFTRST 0x80000000
31
32#define HW_APBX_CTRL1 0x10
33
34#define HW_APBX_DEVSEL 0x20
35
36#define HW_APBX_CH0_NXTCMDAR (0x50 + 0 * 0x70)
37#define HW_APBX_CH1_NXTCMDAR (0x50 + 1 * 0x70)
38#define HW_APBX_CH2_NXTCMDAR (0x50 + 2 * 0x70)
39#define HW_APBX_CH3_NXTCMDAR (0x50 + 3 * 0x70)
40#define HW_APBX_CH4_NXTCMDAR (0x50 + 4 * 0x70)
41#define HW_APBX_CH5_NXTCMDAR (0x50 + 5 * 0x70)
42#define HW_APBX_CH6_NXTCMDAR (0x50 + 6 * 0x70)
43#define HW_APBX_CH7_NXTCMDAR (0x50 + 7 * 0x70)
44#define HW_APBX_CH8_NXTCMDAR (0x50 + 8 * 0x70)
45#define HW_APBX_CH9_NXTCMDAR (0x50 + 9 * 0x70)
46#define HW_APBX_CH10_NXTCMDAR (0x50 + 10 * 0x70)
47#define HW_APBX_CH11_NXTCMDAR (0x50 + 11 * 0x70)
48#define HW_APBX_CH12_NXTCMDAR (0x50 + 12 * 0x70)
49#define HW_APBX_CH13_NXTCMDAR (0x50 + 13 * 0x70)
50#define HW_APBX_CH14_NXTCMDAR (0x50 + 14 * 0x70)
51#define HW_APBX_CH15_NXTCMDAR (0x50 + 15 * 0x70)
52
53#define HW_APBX_CHn_NXTCMDAR 0x50
54#define BM_APBX_CHn_CMD_MODE 0x00000003
55#define BP_APBX_CHn_CMD_MODE 0x00000001
56#define BV_APBX_CHn_CMD_MODE_NOOP 0
57#define BV_APBX_CHn_CMD_MODE_WRITE 1
58#define BV_APBX_CHn_CMD_MODE_READ 2
59#define BV_APBX_CHn_CMD_MODE_SENSE 3
60#define BM_APBX_CHn_CMD_COMMAND 0x00000003
61#define BP_APBX_CHn_CMD_COMMAND 0
62#define BM_APBX_CHn_CMD_CHAIN 0x00000004
63#define BM_APBX_CHn_CMD_IRQONCMPLT 0x00000008
64#define BM_APBX_CHn_CMD_SEMAPHORE 0x00000040
65#define BM_APBX_CHn_CMD_WAIT4ENDCMD 0x00000080
66#define BM_APBX_CHn_CMD_CMDWORDS 0x0000F000
67#define BP_APBX_CHn_CMD_CMDWORDS 12
68#define BM_APBX_CHn_CMD_XFER_COUNT 0xFFFF0000
69#define BP_APBX_CHn_CMD_XFER_COUNT 16
70
71#define HW_APBX_CH0_BAR (0x70 + 0 * 0x70)
72#define HW_APBX_CH1_BAR (0x70 + 1 * 0x70)
73#define HW_APBX_CH2_BAR (0x70 + 2 * 0x70)
74#define HW_APBX_CH3_BAR (0x70 + 3 * 0x70)
75#define HW_APBX_CH4_BAR (0x70 + 4 * 0x70)
76#define HW_APBX_CH5_BAR (0x70 + 5 * 0x70)
77#define HW_APBX_CH6_BAR (0x70 + 6 * 0x70)
78#define HW_APBX_CH7_BAR (0x70 + 7 * 0x70)
79#define HW_APBX_CH8_BAR (0x70 + 8 * 0x70)
80#define HW_APBX_CH9_BAR (0x70 + 9 * 0x70)
81#define HW_APBX_CH10_BAR (0x70 + 10 * 0x70)
82#define HW_APBX_CH11_BAR (0x70 + 11 * 0x70)
83#define HW_APBX_CH12_BAR (0x70 + 12 * 0x70)
84#define HW_APBX_CH13_BAR (0x70 + 13 * 0x70)
85#define HW_APBX_CH14_BAR (0x70 + 14 * 0x70)
86#define HW_APBX_CH15_BAR (0x70 + 15 * 0x70)
87
88#define HW_APBX_CHn_BAR 0x70
89
90#define HW_APBX_CH0_SEMA (0x80 + 0 * 0x70)
91#define HW_APBX_CH1_SEMA (0x80 + 1 * 0x70)
92#define HW_APBX_CH2_SEMA (0x80 + 2 * 0x70)
93#define HW_APBX_CH3_SEMA (0x80 + 3 * 0x70)
94#define HW_APBX_CH4_SEMA (0x80 + 4 * 0x70)
95#define HW_APBX_CH5_SEMA (0x80 + 5 * 0x70)
96#define HW_APBX_CH6_SEMA (0x80 + 6 * 0x70)
97#define HW_APBX_CH7_SEMA (0x80 + 7 * 0x70)
98#define HW_APBX_CH8_SEMA (0x80 + 8 * 0x70)
99#define HW_APBX_CH9_SEMA (0x80 + 9 * 0x70)
100#define HW_APBX_CH10_SEMA (0x80 + 10 * 0x70)
101#define HW_APBX_CH11_SEMA (0x80 + 11 * 0x70)
102#define HW_APBX_CH12_SEMA (0x80 + 12 * 0x70)
103#define HW_APBX_CH13_SEMA (0x80 + 13 * 0x70)
104#define HW_APBX_CH14_SEMA (0x80 + 14 * 0x70)
105#define HW_APBX_CH15_SEMA (0x80 + 15 * 0x70)
106
107#define HW_APBX_CHn_SEMA 0x80
108#define BM_APBX_CHn_SEMA_INCREMENT_SEMA 0x000000FF
109#define BP_APBX_CHn_SEMA_INCREMENT_SEMA 0
110#define BM_APBX_CHn_SEMA_PHORE 0x00FF0000
111#define BP_APBX_CHn_SEMA_PHORE 16
112
113#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-audioin.h b/arch/arm/mach-stmp37xx/include/mach/regs-audioin.h
new file mode 100644
index 000000000000..3b511f947a53
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-audioin.h
@@ -0,0 +1,61 @@
1/*
2 * stmp37xx: AUDIOIN register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_AUDIOIN_BASE (STMP3XXX_REGS_BASE + 0x4C000)
22
23#define HW_AUDIOIN_CTRL 0x0
24#define BM_AUDIOIN_CTRL_RUN 0x00000001
25#define BP_AUDIOIN_CTRL_RUN 0
26#define BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
27#define BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
28#define BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
29#define BM_AUDIOIN_CTRL_WORD_LENGTH 0x00000020
30#define BM_AUDIOIN_CTRL_CLKGATE 0x40000000
31#define BM_AUDIOIN_CTRL_SFTRST 0x80000000
32
33#define HW_AUDIOIN_STAT 0x10
34
35#define HW_AUDIOIN_ADCSRR 0x20
36
37#define HW_AUDIOIN_ADCVOLUME 0x30
38#define BM_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0x000000FF
39#define BP_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0
40#define BM_AUDIOIN_ADCVOLUME_VOLUME_LEFT 0x00FF0000
41#define BP_AUDIOIN_ADCVOLUME_VOLUME_LEFT 16
42
43#define HW_AUDIOIN_ADCDEBUG 0x40
44
45#define HW_AUDIOIN_ADCVOL 0x50
46#define BM_AUDIOIN_ADCVOL_GAIN_RIGHT 0x0000000F
47#define BP_AUDIOIN_ADCVOL_GAIN_RIGHT 0
48#define BM_AUDIOIN_ADCVOL_SELECT_RIGHT 0x00000030
49#define BP_AUDIOIN_ADCVOL_SELECT_RIGHT 4
50#define BM_AUDIOIN_ADCVOL_GAIN_LEFT 0x00000F00
51#define BP_AUDIOIN_ADCVOL_GAIN_LEFT 8
52#define BM_AUDIOIN_ADCVOL_SELECT_LEFT 0x00003000
53#define BP_AUDIOIN_ADCVOL_SELECT_LEFT 12
54#define BM_AUDIOIN_ADCVOL_MUTE 0x01000000
55
56#define HW_AUDIOIN_MICLINE 0x60
57
58#define HW_AUDIOIN_ANACLKCTRL 0x70
59#define BM_AUDIOIN_ANACLKCTRL_CLKGATE 0x80000000
60
61#define HW_AUDIOIN_DATA 0x80
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-audioout.h b/arch/arm/mach-stmp37xx/include/mach/regs-audioout.h
new file mode 100644
index 000000000000..ca1942b8a3e9
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-audioout.h
@@ -0,0 +1,111 @@
1/*
2 * stmp37xx: AUDIOOUT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_AUDIOOUT_BASE (STMP3XXX_REGS_BASE + 0x48000)
22
23#define HW_AUDIOOUT_CTRL 0x0
24#define BM_AUDIOOUT_CTRL_RUN 0x00000001
25#define BP_AUDIOOUT_CTRL_RUN 0
26#define BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
27#define BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
28#define BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
29#define BM_AUDIOOUT_CTRL_WORD_LENGTH 0x00000040
30#define BM_AUDIOOUT_CTRL_CLKGATE 0x40000000
31#define BM_AUDIOOUT_CTRL_SFTRST 0x80000000
32
33#define HW_AUDIOOUT_STAT 0x10
34
35#define HW_AUDIOOUT_DACSRR 0x20
36#define BM_AUDIOOUT_DACSRR_SRC_FRAC 0x00001FFF
37#define BP_AUDIOOUT_DACSRR_SRC_FRAC 0
38#define BM_AUDIOOUT_DACSRR_SRC_INT 0x001F0000
39#define BP_AUDIOOUT_DACSRR_SRC_INT 16
40#define BM_AUDIOOUT_DACSRR_SRC_HOLD 0x07000000
41#define BP_AUDIOOUT_DACSRR_SRC_HOLD 24
42#define BM_AUDIOOUT_DACSRR_BASEMULT 0x70000000
43#define BP_AUDIOOUT_DACSRR_BASEMULT 28
44
45#define HW_AUDIOOUT_DACVOLUME 0x30
46#define BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT 0x00000100
47#define BM_AUDIOOUT_DACVOLUME_MUTE_LEFT 0x01000000
48#define BM_AUDIOOUT_DACVOLUME_EN_ZCD 0x02000000
49
50#define HW_AUDIOOUT_DACDEBUG 0x40
51
52#define HW_AUDIOOUT_HPVOL 0x50
53#define BM_AUDIOOUT_HPVOL_MUTE 0x01000000
54#define BM_AUDIOOUT_HPVOL_EN_MSTR_ZCD 0x02000000
55
56#define HW_AUDIOOUT_PWRDN 0x70
57#define BM_AUDIOOUT_PWRDN_HEADPHONE 0x00000001
58#define BP_AUDIOOUT_PWRDN_HEADPHONE 0
59#define BM_AUDIOOUT_PWRDN_CAPLESS 0x00000010
60#define BM_AUDIOOUT_PWRDN_ADC 0x00000100
61#define BM_AUDIOOUT_PWRDN_DAC 0x00001000
62#define BM_AUDIOOUT_PWRDN_RIGHT_ADC 0x00010000
63#define BM_AUDIOOUT_PWRDN_LINEOUT 0x01000000
64
65#define HW_AUDIOOUT_REFCTRL 0x80
66#define BM_AUDIOOUT_REFCTRL_VAG_VAL 0x000000F0
67#define BP_AUDIOOUT_REFCTRL_VAG_VAL 4
68#define BM_AUDIOOUT_REFCTRL_ADC_REFVAL 0x00000F00
69#define BP_AUDIOOUT_REFCTRL_ADC_REFVAL 8
70#define BM_AUDIOOUT_REFCTRL_ADJ_VAG 0x00001000
71#define BM_AUDIOOUT_REFCTRL_ADJ_ADC 0x00002000
72#define BM_AUDIOOUT_REFCTRL_BIAS_CTRL 0x00030000
73#define BP_AUDIOOUT_REFCTRL_BIAS_CTRL 16
74#define BM_AUDIOOUT_REFCTRL_LOW_PWR 0x00080000
75#define BM_AUDIOOUT_REFCTRL_VBG_ADJ 0x00700000
76#define BP_AUDIOOUT_REFCTRL_VBG_ADJ 20
77#define BM_AUDIOOUT_REFCTRL_XTAL_BGR_BIAS 0x01000000
78#define BM_AUDIOOUT_REFCTRL_RAISE_REF 0x02000000
79
80#define HW_AUDIOOUT_ANACTRL 0x90
81#define BM_AUDIOOUT_ANACTRL_HP_CLASSAB 0x00000010
82#define BM_AUDIOOUT_ANACTRL_HP_HOLD_GND 0x00000020
83
84#define HW_AUDIOOUT_TEST 0xA0
85#define BM_AUDIOOUT_TEST_HP_I1_ADJ 0x00C00000
86#define BP_AUDIOOUT_TEST_HP_I1_ADJ 22
87
88#define HW_AUDIOOUT_BISTCTRL 0xB0
89
90#define HW_AUDIOOUT_BISTSTAT0 0xC0
91
92#define HW_AUDIOOUT_BISTSTAT1 0xD0
93
94#define HW_AUDIOOUT_ANACLKCTRL 0xE0
95#define BM_AUDIOOUT_ANACLKCTRL_CLKGATE 0x80000000
96
97#define HW_AUDIOOUT_DATA 0xF0
98
99#define HW_AUDIOOUT_LINEOUTCTRL 0x100
100#define BM_AUDIOOUT_LINEOUTCTRL_VOL_RIGHT 0x0000001F
101#define BP_AUDIOOUT_LINEOUTCTRL_VOL_RIGHT 0
102#define BM_AUDIOOUT_LINEOUTCTRL_VOL_LEFT 0x00001F00
103#define BP_AUDIOOUT_LINEOUTCTRL_VOL_LEFT 8
104#define BM_AUDIOOUT_LINEOUTCTRL_CHARGE_CAP 0x00007000
105#define BP_AUDIOOUT_LINEOUTCTRL_CHARGE_CAP 12
106#define BM_AUDIOOUT_LINEOUTCTRL_VAG_CTRL 0x00F00000
107#define BP_AUDIOOUT_LINEOUTCTRL_VAG_CTRL 20
108#define BM_AUDIOOUT_LINEOUTCTRL_MUTE 0x01000000
109#define BM_AUDIOOUT_LINEOUTCTRL_EN_ZCD 0x02000000
110
111#define HW_AUDIOOUT_VERSION 0x200
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h b/arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h
new file mode 100644
index 000000000000..47f5c92fdaf6
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h
@@ -0,0 +1,72 @@
1/*
2 * stmp37xx: CLKCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_CLKCTRL
22#define _MACH_REGS_CLKCTRL
23
24#define REGS_CLKCTRL_BASE (STMP3XXX_REGS_BASE + 0x40000)
25
26#define HW_CLKCTRL_PLLCTRL0 0x0
27#define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000
28
29#define HW_CLKCTRL_CPU 0x20
30#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F
31#define BP_CLKCTRL_CPU_DIV_CPU 0
32
33#define HW_CLKCTRL_HBUS 0x30
34#define BM_CLKCTRL_HBUS_DIV 0x0000001F
35#define BP_CLKCTRL_HBUS_DIV 0
36
37#define HW_CLKCTRL_XBUS 0x40
38
39#define HW_CLKCTRL_XTAL 0x50
40
41#define HW_CLKCTRL_PIX 0x60
42#define BM_CLKCTRL_PIX_DIV 0x00007FFF
43#define BP_CLKCTRL_PIX_DIV 0
44#define BM_CLKCTRL_PIX_CLKGATE 0x80000000
45
46#define HW_CLKCTRL_SSP 0x70
47
48#define HW_CLKCTRL_GPMI 0x80
49
50#define HW_CLKCTRL_SPDIF 0x90
51
52#define HW_CLKCTRL_EMI 0xA0
53
54#define HW_CLKCTRL_IR 0xB0
55
56#define HW_CLKCTRL_SAIF 0xC0
57
58#define HW_CLKCTRL_FRAC 0xD0
59#define BM_CLKCTRL_FRAC_EMIFRAC 0x00003F00
60#define BP_CLKCTRL_FRAC_EMIFRAC 8
61#define BM_CLKCTRL_FRAC_PIXFRAC 0x003F0000
62#define BP_CLKCTRL_FRAC_PIXFRAC 16
63#define BM_CLKCTRL_FRAC_CLKGATEPIX 0x00800000
64
65#define HW_CLKCTRL_CLKSEQ 0xE0
66#define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002
67
68#define HW_CLKCTRL_RESET 0xF0
69#define BM_CLKCTRL_RESET_DIG 0x00000001
70#define BP_CLKCTRL_RESET_DIG 0
71
72#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-digctl.h b/arch/arm/mach-stmp37xx/include/mach/regs-digctl.h
new file mode 100644
index 000000000000..ba1bbe265c20
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-digctl.h
@@ -0,0 +1,24 @@
1/*
2 * stmp37xx: DIGCTL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_DIGCTL_BASE (STMP3XXX_REGS_BASE + 0x1C000)
22
23#define HW_DIGCTL_CTRL 0x0
24#define BM_DIGCTL_CTRL_USB_CLKGATE 0x00000004
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h b/arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h
new file mode 100644
index 000000000000..3b6d990a3af5
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h
@@ -0,0 +1,37 @@
1/*
2 * stmp37xx: ECC8 register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_ECC8_BASE (STMP3XXX_REGS_BASE + 0x8000)
22
23#define HW_ECC8_CTRL 0x0
24#define BM_ECC8_CTRL_COMPLETE_IRQ 0x00000001
25#define BP_ECC8_CTRL_COMPLETE_IRQ 0
26#define BM_ECC8_CTRL_COMPLETE_IRQ_EN 0x00000100
27#define BM_ECC8_CTRL_AHBM_SFTRST 0x20000000
28
29#define HW_ECC8_STATUS0 0x10
30#define BM_ECC8_STATUS0_UNCORRECTABLE 0x00000004
31#define BM_ECC8_STATUS0_CORRECTED 0x00000008
32#define BM_ECC8_STATUS0_STATUS_AUX 0x00000F00
33#define BP_ECC8_STATUS0_STATUS_AUX 8
34#define BM_ECC8_STATUS0_COMPLETED_CE 0x000F0000
35#define BP_ECC8_STATUS0_COMPLETED_CE 16
36
37#define HW_ECC8_STATUS1 0x20
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h b/arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h
new file mode 100644
index 000000000000..f2b304f54490
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h
@@ -0,0 +1,63 @@
1/*
2 * stmp37xx: GPMI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_GPMI_BASE (STMP3XXX_REGS_BASE + 0xC000)
22#define REGS_GPMI_PHYS 0x8000C000
23#define REGS_GPMI_SIZE 0x2000
24
25#define HW_GPMI_CTRL0 0x0
26#define BM_GPMI_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_GPMI_CTRL0_XFER_COUNT 0
28#define BM_GPMI_CTRL0_CS 0x00300000
29#define BP_GPMI_CTRL0_CS 20
30#define BM_GPMI_CTRL0_LOCK_CS 0x00400000
31#define BM_GPMI_CTRL0_WORD_LENGTH 0x00800000
32#define BM_GPMI_CTRL0_COMMAND_MODE 0x03000000
33#define BP_GPMI_CTRL0_COMMAND_MODE 24
34#define BV_GPMI_CTRL0_COMMAND_MODE__WRITE 0x0
35#define BV_GPMI_CTRL0_COMMAND_MODE__READ 0x1
36#define BV_GPMI_CTRL0_COMMAND_MODE__READ_AND_COMPARE 0x2
37#define BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY 0x3
38#define BM_GPMI_CTRL0_RUN 0x20000000
39#define BM_GPMI_CTRL0_CLKGATE 0x40000000
40#define BM_GPMI_CTRL0_SFTRST 0x80000000
41#define BM_GPMI_ECCCTRL_ENABLE_ECC 0x00001000
42#define BM_GPMI_ECCCTRL_ECC_CMD 0x00006000
43#define BP_GPMI_ECCCTRL_ECC_CMD 13
44
45#define HW_GPMI_CTRL1 0x60
46#define BM_GPMI_CTRL1_GPMI_MODE 0x00000003
47#define BP_GPMI_CTRL1_GPMI_MODE 0
48#define BM_GPMI_CTRL1_ATA_IRQRDY_POLARITY 0x00000004
49#define BM_GPMI_CTRL1_DEV_RESET 0x00000008
50#define BM_GPMI_CTRL1_TIMEOUT_IRQ 0x00000200
51#define BM_GPMI_CTRL1_DEV_IRQ 0x00000400
52#define BM_GPMI_CTRL1_DSAMPLE_TIME 0x00007000
53#define BP_GPMI_CTRL1_DSAMPLE_TIME 12
54
55#define HW_GPMI_TIMING0 0x70
56#define BM_GPMI_TIMING0_DATA_SETUP 0x000000FF
57#define BP_GPMI_TIMING0_DATA_SETUP 0
58#define BM_GPMI_TIMING0_DATA_HOLD 0x0000FF00
59#define BP_GPMI_TIMING0_DATA_HOLD 8
60
61#define HW_GPMI_TIMING1 0x80
62#define BM_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 0xFFFF0000
63#define BP_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 16
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-i2c.h b/arch/arm/mach-stmp37xx/include/mach/regs-i2c.h
new file mode 100644
index 000000000000..35882a9b8bc5
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-i2c.h
@@ -0,0 +1,55 @@
1/*
2 * stmp37xx: I2C register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_I2C_BASE (STMP3XXX_REGS_BASE + 0x58000)
22#define REGS_I2C_PHYS 0x80058000
23#define REGS_I2C_SIZE 0x2000
24
25#define HW_I2C_CTRL0 0x0
26#define BM_I2C_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_I2C_CTRL0_XFER_COUNT 0
28#define BM_I2C_CTRL0_DIRECTION 0x00010000
29#define BM_I2C_CTRL0_MASTER_MODE 0x00020000
30#define BM_I2C_CTRL0_PRE_SEND_START 0x00080000
31#define BM_I2C_CTRL0_POST_SEND_STOP 0x00100000
32#define BM_I2C_CTRL0_RETAIN_CLOCK 0x00200000
33#define BM_I2C_CTRL0_SEND_NAK_ON_LAST 0x02000000
34#define BM_I2C_CTRL0_CLKGATE 0x40000000
35#define BM_I2C_CTRL0_SFTRST 0x80000000
36
37#define HW_I2C_TIMING0 0x10
38
39#define HW_I2C_TIMING1 0x20
40
41#define HW_I2C_TIMING2 0x30
42
43#define HW_I2C_CTRL1 0x40
44#define BM_I2C_CTRL1_SLAVE_IRQ 0x00000001
45#define BP_I2C_CTRL1_SLAVE_IRQ 0
46#define BM_I2C_CTRL1_SLAVE_STOP_IRQ 0x00000002
47#define BM_I2C_CTRL1_MASTER_LOSS_IRQ 0x00000004
48#define BM_I2C_CTRL1_EARLY_TERM_IRQ 0x00000008
49#define BM_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ 0x00000010
50#define BM_I2C_CTRL1_NO_SLAVE_ACK_IRQ 0x00000020
51#define BM_I2C_CTRL1_DATA_ENGINE_CMPLT_IRQ 0x00000040
52#define BM_I2C_CTRL1_BUS_FREE_IRQ 0x00000080
53#define BM_I2C_CTRL1_CLR_GOT_A_NAK 0x10000000
54
55#define HW_I2C_VERSION 0x90
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-icoll.h b/arch/arm/mach-stmp37xx/include/mach/regs-icoll.h
new file mode 100644
index 000000000000..3b7c92239e20
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-icoll.h
@@ -0,0 +1,43 @@
1/*
2 * stmp37xx: ICOLL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_ICOLL
22#define _MACH_REGS_ICOLL
23
24#define REGS_ICOLL_BASE (STMP3XXX_REGS_BASE + 0x0)
25
26#define HW_ICOLL_VECTOR 0x0
27
28#define HW_ICOLL_LEVELACK 0x10
29
30#define HW_ICOLL_CTRL 0x20
31#define BM_ICOLL_CTRL_CLKGATE 0x40000000
32#define BM_ICOLL_CTRL_SFTRST 0x80000000
33
34#define HW_ICOLL_STAT 0x30
35
36#define HW_ICOLL_PRIORITY0 (0x60 + 0 * 0x10)
37#define HW_ICOLL_PRIORITY1 (0x60 + 1 * 0x10)
38#define HW_ICOLL_PRIORITY2 (0x60 + 2 * 0x10)
39#define HW_ICOLL_PRIORITY3 (0x60 + 3 * 0x10)
40
41#define HW_ICOLL_PRIORITYn 0x60
42
43#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h b/arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h
new file mode 100644
index 000000000000..72514e8b0737
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h
@@ -0,0 +1,89 @@
1/*
2 * stmp37xx: LCDIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_LCDIF_BASE (STMP3XXX_REGS_BASE + 0x30000)
22#define REGS_LCDIF_PHYS 0x80030000
23#define REGS_LCDIF_SIZE 0x2000
24
25#define HW_LCDIF_CTRL 0x0
26#define BM_LCDIF_CTRL_COUNT 0x0000FFFF
27#define BP_LCDIF_CTRL_COUNT 0
28#define BM_LCDIF_CTRL_RUN 0x00010000
29#define BM_LCDIF_CTRL_WORD_LENGTH 0x00020000
30#define BM_LCDIF_CTRL_DATA_SELECT 0x00040000
31#define BM_LCDIF_CTRL_DOTCLK_MODE 0x00080000
32#define BM_LCDIF_CTRL_VSYNC_MODE 0x00100000
33#define BM_LCDIF_CTRL_DATA_SWIZZLE 0x00600000
34#define BP_LCDIF_CTRL_DATA_SWIZZLE 21
35#define BM_LCDIF_CTRL_BYPASS_COUNT 0x00800000
36#define BM_LCDIF_CTRL_SHIFT_NUM_BITS 0x06000000
37#define BP_LCDIF_CTRL_SHIFT_NUM_BITS 25
38#define BM_LCDIF_CTRL_DATA_SHIFT_DIR 0x08000000
39#define BM_LCDIF_CTRL_WAIT_FOR_VSYNC_EDGE 0x10000000
40#define BM_LCDIF_CTRL_CLKGATE 0x40000000
41#define BM_LCDIF_CTRL_SFTRST 0x80000000
42
43#define HW_LCDIF_CTRL1 0x10
44#define BM_LCDIF_CTRL1_RESET 0x00000001
45#define BP_LCDIF_CTRL1_RESET 0
46#define BM_LCDIF_CTRL1_MODE86 0x00000002
47#define BM_LCDIF_CTRL1_BUSY_ENABLE 0x00000004
48#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ 0x00000100
49#define BM_LCDIF_CTRL1_CUR_FRAME_DONE_IRQ 0x00000200
50#define BM_LCDIF_CTRL1_UNDERFLOW_IRQ 0x00000400
51#define BM_LCDIF_CTRL1_OVERFLOW_IRQ 0x00000800
52#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ_EN 0x00001000
53#define BM_LCDIF_CTRL1_BYTE_PACKING_FORMAT 0x000F0000
54#define BP_LCDIF_CTRL1_BYTE_PACKING_FORMAT 16
55
56#define HW_LCDIF_TIMING 0x20
57
58#define HW_LCDIF_VDCTRL0 0x30
59#define BM_LCDIF_VDCTRL0_VALID_DATA_CNT 0x000003FF
60#define BP_LCDIF_VDCTRL0_VALID_DATA_CNT 0
61#define BM_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT 0x00100000
62#define BM_LCDIF_VDCTRL0_VSYNC_PERIOD_UNIT 0x00200000
63#define BM_LCDIF_VDCTRL0_ENABLE_POL 0x01000000
64#define BM_LCDIF_VDCTRL0_DOTCLK_POL 0x02000000
65#define BM_LCDIF_VDCTRL0_HSYNC_POL 0x04000000
66#define BM_LCDIF_VDCTRL0_VSYNC_POL 0x08000000
67#define BM_LCDIF_VDCTRL0_ENABLE_PRESENT 0x10000000
68#define BM_LCDIF_VDCTRL0_VSYNC_OEB 0x20000000
69
70#define HW_LCDIF_VDCTRL1 0x40
71#define BM_LCDIF_VDCTRL1_VSYNC_PERIOD 0x000FFFFF
72#define BP_LCDIF_VDCTRL1_VSYNC_PERIOD 0
73#define BM_LCDIF_VDCTRL1_VSYNC_PULSE_WIDTH 0xFFF00000
74#define BP_LCDIF_VDCTRL1_VSYNC_PULSE_WIDTH 20
75
76#define HW_LCDIF_VDCTRL2 0x50
77#define BM_LCDIF_VDCTRL2_VALID_DATA_CNT 0x000007FF
78#define BP_LCDIF_VDCTRL2_VALID_DATA_CNT 0
79#define BM_LCDIF_VDCTRL2_HSYNC_PERIOD 0x007FF800
80#define BP_LCDIF_VDCTRL2_HSYNC_PERIOD 11
81#define BM_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 0xFF800000
82#define BP_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 23
83
84#define HW_LCDIF_VDCTRL3 0x60
85#define BM_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0x000001FF
86#define BP_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0
87#define BM_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 0x00FFF000
88#define BP_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 12
89#define BM_LCDIF_VDCTRL3_SYNC_SIGNALS_ON 0x01000000
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-lradc.h b/arch/arm/mach-stmp37xx/include/mach/regs-lradc.h
new file mode 100644
index 000000000000..cc7b4702d1cd
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-lradc.h
@@ -0,0 +1,97 @@
1/*
2 * stmp37xx: LRADC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_LRADC_BASE (STMP3XXX_REGS_BASE + 0x50000)
22
23#define HW_LRADC_CTRL0 0x0
24#define BM_LRADC_CTRL0_SCHEDULE 0x000000FF
25#define BP_LRADC_CTRL0_SCHEDULE 0
26#define BM_LRADC_CTRL0_XPLUS_ENABLE 0x00010000
27#define BM_LRADC_CTRL0_YPLUS_ENABLE 0x00020000
28#define BM_LRADC_CTRL0_XMINUS_ENABLE 0x00040000
29#define BM_LRADC_CTRL0_YMINUS_ENABLE 0x00080000
30#define BM_LRADC_CTRL0_TOUCH_DETECT_ENABLE 0x00100000
31#define BM_LRADC_CTRL0_ONCHIP_GROUNDREF 0x00200000
32#define BM_LRADC_CTRL0_CLKGATE 0x40000000
33#define BM_LRADC_CTRL0_SFTRST 0x80000000
34
35#define HW_LRADC_CTRL1 0x10
36#define BM_LRADC_CTRL1_LRADC0_IRQ 0x00000001
37#define BP_LRADC_CTRL1_LRADC0_IRQ 0
38#define BM_LRADC_CTRL1_LRADC5_IRQ 0x00000020
39#define BM_LRADC_CTRL1_LRADC6_IRQ 0x00000040
40#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ 0x00000100
41#define BM_LRADC_CTRL1_LRADC0_IRQ_EN 0x00010000
42#define BM_LRADC_CTRL1_LRADC5_IRQ_EN 0x00200000
43#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ_EN 0x01000000
44
45#define HW_LRADC_CTRL2 0x20
46#define BM_LRADC_CTRL2_BL_BRIGHTNESS 0x001F0000
47#define BP_LRADC_CTRL2_BL_BRIGHTNESS 16
48#define BM_LRADC_CTRL2_BL_MUX_SELECT 0x00200000
49#define BM_LRADC_CTRL2_BL_ENABLE 0x00400000
50#define BM_LRADC_CTRL2_DIVIDE_BY_TWO 0xFF000000
51#define BP_LRADC_CTRL2_DIVIDE_BY_TWO 24
52
53#define HW_LRADC_CTRL3 0x30
54#define BM_LRADC_CTRL3_CYCLE_TIME 0x00000300
55#define BP_LRADC_CTRL3_CYCLE_TIME 8
56
57#define HW_LRADC_STATUS 0x40
58#define BM_LRADC_STATUS_TOUCH_DETECT_RAW 0x00000001
59#define BP_LRADC_STATUS_TOUCH_DETECT_RAW 0
60
61#define HW_LRADC_CH0 (0x50 + 0 * 0x10)
62#define HW_LRADC_CH1 (0x50 + 1 * 0x10)
63#define HW_LRADC_CH2 (0x50 + 2 * 0x10)
64#define HW_LRADC_CH3 (0x50 + 3 * 0x10)
65#define HW_LRADC_CH4 (0x50 + 4 * 0x10)
66#define HW_LRADC_CH5 (0x50 + 5 * 0x10)
67#define HW_LRADC_CH6 (0x50 + 6 * 0x10)
68#define HW_LRADC_CH7 (0x50 + 7 * 0x10)
69
70#define HW_LRADC_CHn 0x50
71#define BM_LRADC_CHn_VALUE 0x0003FFFF
72#define BP_LRADC_CHn_VALUE 0
73#define BM_LRADC_CHn_NUM_SAMPLES 0x1F000000
74#define BP_LRADC_CHn_NUM_SAMPLES 24
75#define BM_LRADC_CHn_ACCUMULATE 0x20000000
76
77#define HW_LRADC_DELAY0 (0xD0 + 0 * 0x10)
78#define HW_LRADC_DELAY1 (0xD0 + 1 * 0x10)
79#define HW_LRADC_DELAY2 (0xD0 + 2 * 0x10)
80#define HW_LRADC_DELAY3 (0xD0 + 3 * 0x10)
81
82#define HW_LRADC_DELAYn 0xD0
83#define BM_LRADC_DELAYn_DELAY 0x000007FF
84#define BP_LRADC_DELAYn_DELAY 0
85#define BM_LRADC_DELAYn_LOOP_COUNT 0x0000F800
86#define BP_LRADC_DELAYn_LOOP_COUNT 11
87#define BM_LRADC_DELAYn_TRIGGER_DELAYS 0x000F0000
88#define BP_LRADC_DELAYn_TRIGGER_DELAYS 16
89#define BM_LRADC_DELAYn_KICK 0x00100000
90#define BM_LRADC_DELAYn_TRIGGER_LRADCS 0xFF000000
91#define BP_LRADC_DELAYn_TRIGGER_LRADCS 24
92
93#define HW_LRADC_CTRL4 0x140
94#define BM_LRADC_CTRL4_LRADC6SELECT 0x0F000000
95#define BP_LRADC_CTRL4_LRADC6SELECT 24
96#define BM_LRADC_CTRL4_LRADC7SELECT 0xF0000000
97#define BP_LRADC_CTRL4_LRADC7SELECT 28
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h b/arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h
new file mode 100644
index 000000000000..d5efce2388c7
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h
@@ -0,0 +1,88 @@
1/*
2 * stmp37xx: PINCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_PINCTRL
22#define _MACH_REGS_PINCTRL
23
24#define REGS_PINCTRL_BASE (STMP3XXX_REGS_BASE + 0x18000)
25
26#define HW_PINCTRL_MUXSEL0 0x100
27#define HW_PINCTRL_MUXSEL1 0x110
28#define HW_PINCTRL_MUXSEL2 0x120
29#define HW_PINCTRL_MUXSEL3 0x130
30#define HW_PINCTRL_MUXSEL4 0x140
31#define HW_PINCTRL_MUXSEL5 0x150
32#define HW_PINCTRL_MUXSEL6 0x160
33#define HW_PINCTRL_MUXSEL7 0x170
34
35#define HW_PINCTRL_DRIVE0 0x200
36#define HW_PINCTRL_DRIVE1 0x210
37#define HW_PINCTRL_DRIVE2 0x220
38#define HW_PINCTRL_DRIVE3 0x230
39#define HW_PINCTRL_DRIVE4 0x240
40#define HW_PINCTRL_DRIVE5 0x250
41#define HW_PINCTRL_DRIVE6 0x260
42#define HW_PINCTRL_DRIVE7 0x270
43#define HW_PINCTRL_DRIVE8 0x280
44#define HW_PINCTRL_DRIVE9 0x290
45#define HW_PINCTRL_DRIVE10 0x2A0
46#define HW_PINCTRL_DRIVE11 0x2B0
47#define HW_PINCTRL_DRIVE12 0x2C0
48#define HW_PINCTRL_DRIVE13 0x2D0
49#define HW_PINCTRL_DRIVE14 0x2E0
50
51#define HW_PINCTRL_PULL0 0x300
52#define HW_PINCTRL_PULL1 0x310
53#define HW_PINCTRL_PULL2 0x320
54#define HW_PINCTRL_PULL3 0x330
55
56#define HW_PINCTRL_DOUT0 0x400
57#define HW_PINCTRL_DOUT1 0x410
58#define HW_PINCTRL_DOUT2 0x420
59
60#define HW_PINCTRL_DIN0 0x500
61#define HW_PINCTRL_DIN1 0x510
62#define HW_PINCTRL_DIN2 0x520
63
64#define HW_PINCTRL_DOE0 0x600
65#define HW_PINCTRL_DOE1 0x610
66#define HW_PINCTRL_DOE2 0x620
67
68#define HW_PINCTRL_PIN2IRQ0 0x700
69#define HW_PINCTRL_PIN2IRQ1 0x710
70#define HW_PINCTRL_PIN2IRQ2 0x720
71
72#define HW_PINCTRL_IRQEN0 0x800
73#define HW_PINCTRL_IRQEN1 0x810
74#define HW_PINCTRL_IRQEN2 0x820
75
76#define HW_PINCTRL_IRQLEVEL0 0x900
77#define HW_PINCTRL_IRQLEVEL1 0x910
78#define HW_PINCTRL_IRQLEVEL2 0x920
79
80#define HW_PINCTRL_IRQPOL0 0xA00
81#define HW_PINCTRL_IRQPOL1 0xA10
82#define HW_PINCTRL_IRQPOL2 0xA20
83
84#define HW_PINCTRL_IRQSTAT0 0xB00
85#define HW_PINCTRL_IRQSTAT1 0xB10
86#define HW_PINCTRL_IRQSTAT2 0xB20
87
88#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-power.h b/arch/arm/mach-stmp37xx/include/mach/regs-power.h
new file mode 100644
index 000000000000..0e733d74a229
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-power.h
@@ -0,0 +1,56 @@
1/*
2 * stmp37xx: POWER register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_POWER
22#define _MACH_REGS_POWER
23
24#define REGS_POWER_BASE (STMP3XXX_REGS_BASE + 0x44000)
25
26#define HW_POWER_CTRL 0x0
27#define BM_POWER_CTRL_CLKGATE 0x40000000
28
29#define HW_POWER_5VCTRL 0x10
30
31#define HW_POWER_MINPWR 0x20
32
33#define HW_POWER_CHARGE 0x30
34
35#define HW_POWER_VDDDCTRL 0x40
36
37#define HW_POWER_VDDACTRL 0x50
38
39#define HW_POWER_VDDIOCTRL 0x60
40#define BM_POWER_VDDIOCTRL_TRG 0x0000001F
41#define BP_POWER_VDDIOCTRL_TRG 0
42
43#define HW_POWER_STS 0xB0
44#define BM_POWER_STS_VBUSVALID 0x00000002
45#define BM_POWER_STS_BVALID 0x00000004
46#define BM_POWER_STS_AVALID 0x00000008
47#define BM_POWER_STS_DC_OK 0x00000100
48
49#define HW_POWER_RESET 0xE0
50
51#define HW_POWER_DEBUG 0xF0
52#define BM_POWER_DEBUG_BVALIDPIOLOCK 0x00000002
53#define BM_POWER_DEBUG_AVALIDPIOLOCK 0x00000004
54#define BM_POWER_DEBUG_VBUSVALIDPIOLOCK 0x00000008
55
56#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-pwm.h b/arch/arm/mach-stmp37xx/include/mach/regs-pwm.h
new file mode 100644
index 000000000000..15966a1b62e0
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-pwm.h
@@ -0,0 +1,51 @@
1/*
2 * stmp37xx: PWM register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_PWM_BASE (STMP3XXX_REGS_BASE + 0x64000)
22
23#define HW_PWM_CTRL 0x0
24#define BM_PWM_CTRL_PWM2_ENABLE 0x00000004
25#define BM_PWM_CTRL_PWM2_ANA_CTRL_ENABLE 0x00000020
26
27#define HW_PWM_ACTIVE0 (0x10 + 0 * 0x20)
28#define HW_PWM_ACTIVE1 (0x10 + 1 * 0x20)
29#define HW_PWM_ACTIVE2 (0x10 + 2 * 0x20)
30#define HW_PWM_ACTIVE3 (0x10 + 3 * 0x20)
31
32#define HW_PWM_ACTIVEn 0x10
33#define BM_PWM_ACTIVEn_ACTIVE 0x0000FFFF
34#define BP_PWM_ACTIVEn_ACTIVE 0
35#define BM_PWM_ACTIVEn_INACTIVE 0xFFFF0000
36#define BP_PWM_ACTIVEn_INACTIVE 16
37
38#define HW_PWM_PERIOD0 (0x20 + 0 * 0x20)
39#define HW_PWM_PERIOD1 (0x20 + 1 * 0x20)
40#define HW_PWM_PERIOD2 (0x20 + 2 * 0x20)
41#define HW_PWM_PERIOD3 (0x20 + 3 * 0x20)
42
43#define HW_PWM_PERIODn 0x20
44#define BM_PWM_PERIODn_PERIOD 0x0000FFFF
45#define BP_PWM_PERIODn_PERIOD 0
46#define BM_PWM_PERIODn_ACTIVE_STATE 0x00030000
47#define BP_PWM_PERIODn_ACTIVE_STATE 16
48#define BM_PWM_PERIODn_INACTIVE_STATE 0x000C0000
49#define BP_PWM_PERIODn_INACTIVE_STATE 18
50#define BM_PWM_PERIODn_CDIV 0x00700000
51#define BP_PWM_PERIODn_CDIV 20
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-rtc.h b/arch/arm/mach-stmp37xx/include/mach/regs-rtc.h
new file mode 100644
index 000000000000..fac40edc38a1
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-rtc.h
@@ -0,0 +1,57 @@
1/*
2 * stmp37xx: RTC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_RTC_BASE (STMP3XXX_REGS_BASE + 0x5C000)
22#define REGS_RTC_PHYS 0x8005C000
23#define REGS_RTC_SIZE 0x2000
24
25#define HW_RTC_CTRL 0x0
26#define BM_RTC_CTRL_ALARM_IRQ_EN 0x00000001
27#define BP_RTC_CTRL_ALARM_IRQ_EN 0
28#define BM_RTC_CTRL_ONEMSEC_IRQ_EN 0x00000002
29#define BM_RTC_CTRL_ALARM_IRQ 0x00000004
30#define BM_RTC_CTRL_ONEMSEC_IRQ 0x00000008
31#define BM_RTC_CTRL_WATCHDOGEN 0x00000010
32
33#define HW_RTC_STAT 0x10
34#define BM_RTC_STAT_NEW_REGS 0x0000FF00
35#define BP_RTC_STAT_NEW_REGS 8
36#define BM_RTC_STAT_STALE_REGS 0x00FF0000
37#define BP_RTC_STAT_STALE_REGS 16
38#define BM_RTC_STAT_RTC_PRESENT 0x80000000
39
40#define HW_RTC_SECONDS 0x30
41
42#define HW_RTC_ALARM 0x40
43
44#define HW_RTC_WATCHDOG 0x50
45
46#define HW_RTC_PERSISTENT0 0x60
47#define BM_RTC_PERSISTENT0_ALARM_WAKE_EN 0x00000002
48#define BM_RTC_PERSISTENT0_ALARM_EN 0x00000004
49#define BM_RTC_PERSISTENT0_XTAL24MHZ_PWRUP 0x00000010
50#define BM_RTC_PERSISTENT0_XTAL32KHZ_PWRUP 0x00000020
51#define BM_RTC_PERSISTENT0_ALARM_WAKE 0x00000080
52#define BM_RTC_PERSISTENT0_SPARE_ANALOG 0xFFFC0000
53#define BP_RTC_PERSISTENT0_SPARE_ANALOG 18
54
55#define HW_RTC_PERSISTENT1 0x70
56
57#define HW_RTC_VERSION 0xD0
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-ssp.h b/arch/arm/mach-stmp37xx/include/mach/regs-ssp.h
new file mode 100644
index 000000000000..cbde891a06c2
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-ssp.h
@@ -0,0 +1,101 @@
1/*
2 * stmp37xx: SSP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_SSP_BASE (STMP3XXX_REGS_BASE + 0x10000)
22#define REGS_SSP1_PHYS 0x80010000
23#define REGS_SSP2_PHYS 0x80034000
24#define REGS_SSP_SIZE 0x2000
25
26#define HW_SSP_CTRL0 0x0
27#define BM_SSP_CTRL0_XFER_COUNT 0x0000FFFF
28#define BP_SSP_CTRL0_XFER_COUNT 0
29#define BM_SSP_CTRL0_ENABLE 0x00010000
30#define BM_SSP_CTRL0_GET_RESP 0x00020000
31#define BM_SSP_CTRL0_LONG_RESP 0x00080000
32#define BM_SSP_CTRL0_WAIT_FOR_CMD 0x00100000
33#define BM_SSP_CTRL0_WAIT_FOR_IRQ 0x00200000
34#define BM_SSP_CTRL0_BUS_WIDTH 0x00C00000
35#define BP_SSP_CTRL0_BUS_WIDTH 22
36#define BM_SSP_CTRL0_DATA_XFER 0x01000000
37#define BM_SSP_CTRL0_READ 0x02000000
38#define BM_SSP_CTRL0_IGNORE_CRC 0x04000000
39#define BM_SSP_CTRL0_LOCK_CS 0x08000000
40#define BM_SSP_CTRL0_RUN 0x20000000
41#define BM_SSP_CTRL0_CLKGATE 0x40000000
42#define BM_SSP_CTRL0_SFTRST 0x80000000
43
44#define HW_SSP_CMD0 0x10
45#define BM_SSP_CMD0_CMD 0x000000FF
46#define BP_SSP_CMD0_CMD 0
47#define BM_SSP_CMD0_BLOCK_COUNT 0x0000FF00
48#define BP_SSP_CMD0_BLOCK_COUNT 8
49#define BM_SSP_CMD0_BLOCK_SIZE 0x000F0000
50#define BP_SSP_CMD0_BLOCK_SIZE 16
51#define BM_SSP_CMD0_APPEND_8CYC 0x00100000
52#define BM_SSP_CMD1_CMD_ARG 0xFFFFFFFF
53#define BP_SSP_CMD1_CMD_ARG 0
54
55#define HW_SSP_TIMING 0x50
56#define BM_SSP_TIMING_CLOCK_RATE 0x000000FF
57#define BP_SSP_TIMING_CLOCK_RATE 0
58#define BM_SSP_TIMING_CLOCK_DIVIDE 0x0000FF00
59#define BP_SSP_TIMING_CLOCK_DIVIDE 8
60#define BM_SSP_TIMING_TIMEOUT 0xFFFF0000
61#define BP_SSP_TIMING_TIMEOUT 16
62
63#define HW_SSP_CTRL1 0x60
64#define BM_SSP_CTRL1_SSP_MODE 0x0000000F
65#define BP_SSP_CTRL1_SSP_MODE 0
66#define BM_SSP_CTRL1_WORD_LENGTH 0x000000F0
67#define BP_SSP_CTRL1_WORD_LENGTH 4
68#define BM_SSP_CTRL1_POLARITY 0x00000200
69#define BM_SSP_CTRL1_PHASE 0x00000400
70#define BM_SSP_CTRL1_DMA_ENABLE 0x00002000
71#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ 0x00008000
72#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ_EN 0x00010000
73#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ 0x00020000
74#define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ 0x00200000
75#define BM_SSP_CTRL1_DATA_CRC_IRQ_EN 0x00400000
76#define BM_SSP_CTRL1_DATA_CRC_IRQ 0x00800000
77#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ_EN 0x01000000
78#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ 0x02000000
79#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ_EN 0x04000000
80#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ 0x08000000
81#define BM_SSP_CTRL1_RESP_ERR_IRQ_EN 0x10000000
82#define BM_SSP_CTRL1_RESP_ERR_IRQ 0x20000000
83#define BM_SSP_CTRL1_SDIO_IRQ 0x80000000
84
85#define HW_SSP_DATA 0x70
86
87#define HW_SSP_SDRESP0 0x80
88
89#define HW_SSP_SDRESP1 0x90
90
91#define HW_SSP_SDRESP2 0xA0
92
93#define HW_SSP_SDRESP3 0xB0
94
95#define HW_SSP_STATUS 0xC0
96#define BM_SSP_STATUS_FIFO_EMPTY 0x00000020
97#define BM_SSP_STATUS_TIMEOUT 0x00001000
98#define BM_SSP_STATUS_RESP_TIMEOUT 0x00004000
99#define BM_SSP_STATUS_RESP_ERR 0x00008000
100#define BM_SSP_STATUS_RESP_CRC_ERR 0x00010000
101#define BM_SSP_STATUS_CARD_DETECT 0x10000000
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-timrot.h b/arch/arm/mach-stmp37xx/include/mach/regs-timrot.h
new file mode 100644
index 000000000000..4af0f6edfa78
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-timrot.h
@@ -0,0 +1,49 @@
1/*
2 * stmp37xx: TIMROT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _MACH_REGS_TIMROT
22#define _MACH_REGS_TIMROT
23
24#define REGS_TIMROT_BASE (STMP3XXX_REGS_BASE + 0x68000)
25
26#define HW_TIMROT_ROTCTRL 0x0
27#define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000
28#define BM_TIMROT_ROTCTRL_SFTRST 0x80000000
29
30#define HW_TIMROT_TIMCTRL0 (0x20 + 0 * 0x20)
31#define HW_TIMROT_TIMCTRL1 (0x20 + 1 * 0x20)
32#define HW_TIMROT_TIMCTRL2 (0x20 + 2 * 0x20)
33
34#define HW_TIMROT_TIMCTRLn 0x20
35#define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
36#define BP_TIMROT_TIMCTRLn_SELECT 0
37#define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
38#define BP_TIMROT_TIMCTRLn_PRESCALE 4
39#define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
40#define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
41#define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
42#define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
43
44#define HW_TIMROT_TIMCOUNT0 (0x30 + 0 * 0x20)
45#define HW_TIMROT_TIMCOUNT1 (0x30 + 1 * 0x20)
46#define HW_TIMROT_TIMCOUNT2 (0x30 + 2 * 0x20)
47
48#define HW_TIMROT_TIMCOUNTn 0x30
49#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h b/arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h
new file mode 100644
index 000000000000..0594275d860c
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h
@@ -0,0 +1,85 @@
1/*
2 * stmp37xx: UARTAPP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_UARTAPP_BASE (STMP3XXX_REGS_BASE + 0x6C000)
22#define REGS_UARTAPP1_PHYS 0x8006C000
23#define REGS_UARTAPP_SIZE 0x2000
24
25#define HW_UARTAPP_CTRL0 0x0
26#define BM_UARTAPP_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_UARTAPP_CTRL0_XFER_COUNT 0
28#define BM_UARTAPP_CTRL0_RXTIMEOUT 0x07FF0000
29#define BP_UARTAPP_CTRL0_RXTIMEOUT 16
30#define BM_UARTAPP_CTRL0_RXTO_ENABLE 0x08000000
31#define BM_UARTAPP_CTRL0_RUN 0x20000000
32#define BM_UARTAPP_CTRL0_SFTRST 0x80000000
33#define BM_UARTAPP_CTRL1_XFER_COUNT 0x0000FFFF
34#define BP_UARTAPP_CTRL1_XFER_COUNT 0
35#define BM_UARTAPP_CTRL1_RUN 0x10000000
36
37#define HW_UARTAPP_CTRL2 0x20
38#define BM_UARTAPP_CTRL2_UARTEN 0x00000001
39#define BP_UARTAPP_CTRL2_UARTEN 0
40#define BM_UARTAPP_CTRL2_TXE 0x00000100
41#define BM_UARTAPP_CTRL2_RXE 0x00000200
42#define BM_UARTAPP_CTRL2_RTS 0x00000800
43#define BM_UARTAPP_CTRL2_RTSEN 0x00004000
44#define BM_UARTAPP_CTRL2_CTSEN 0x00008000
45#define BM_UARTAPP_CTRL2_RXDMAE 0x01000000
46#define BM_UARTAPP_CTRL2_TXDMAE 0x02000000
47#define BM_UARTAPP_CTRL2_DMAONERR 0x04000000
48
49#define HW_UARTAPP_LINECTRL 0x30
50#define BM_UARTAPP_LINECTRL_BRK 0x00000001
51#define BP_UARTAPP_LINECTRL_BRK 0
52#define BM_UARTAPP_LINECTRL_PEN 0x00000002
53#define BM_UARTAPP_LINECTRL_EPS 0x00000004
54#define BM_UARTAPP_LINECTRL_STP2 0x00000008
55#define BM_UARTAPP_LINECTRL_FEN 0x00000010
56#define BM_UARTAPP_LINECTRL_WLEN 0x00000060
57#define BP_UARTAPP_LINECTRL_WLEN 5
58#define BM_UARTAPP_LINECTRL_SPS 0x00000080
59#define BM_UARTAPP_LINECTRL_BAUD_DIVFRAC 0x00003F00
60#define BP_UARTAPP_LINECTRL_BAUD_DIVFRAC 8
61#define BM_UARTAPP_LINECTRL_BAUD_DIVINT 0xFFFF0000
62#define BP_UARTAPP_LINECTRL_BAUD_DIVINT 16
63
64#define HW_UARTAPP_INTR 0x50
65#define BM_UARTAPP_INTR_CTSMIS 0x00000002
66#define BM_UARTAPP_INTR_RTIS 0x00000040
67#define BM_UARTAPP_INTR_CTSMIEN 0x00020000
68#define BM_UARTAPP_INTR_RXIEN 0x00100000
69#define BM_UARTAPP_INTR_RTIEN 0x00400000
70
71#define HW_UARTAPP_DATA 0x60
72
73#define HW_UARTAPP_STAT 0x70
74#define BM_UARTAPP_STAT_RXCOUNT 0x0000FFFF
75#define BP_UARTAPP_STAT_RXCOUNT 0
76#define BM_UARTAPP_STAT_FERR 0x00010000
77#define BM_UARTAPP_STAT_PERR 0x00020000
78#define BM_UARTAPP_STAT_BERR 0x00040000
79#define BM_UARTAPP_STAT_OERR 0x00080000
80#define BM_UARTAPP_STAT_RXFE 0x01000000
81#define BM_UARTAPP_STAT_TXFF 0x02000000
82#define BM_UARTAPP_STAT_TXFE 0x08000000
83#define BM_UARTAPP_STAT_CTS 0x10000000
84
85#define HW_UARTAPP_VERSION 0x90
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h b/arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h
new file mode 100644
index 000000000000..b810deb552a9
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h
@@ -0,0 +1,268 @@
1/*
2 * stmp378x: UARTDBG register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_UARTDBG_BASE (STMP3XXX_REGS_BASE + 0x70000)
22#define REGS_UARTDBG_PHYS 0x80070000
23#define REGS_UARTDBG_SIZE 0x2000
24
25#define HW_UARTDBGDR 0x00000000
26#define BP_UARTDBGDR_UNAVAILABLE 16
27#define BM_UARTDBGDR_UNAVAILABLE 0xFFFF0000
28#define BF_UARTDBGDR_UNAVAILABLE(v) \
29 (((v) << 16) & BM_UARTDBGDR_UNAVAILABLE)
30#define BP_UARTDBGDR_RESERVED 12
31#define BM_UARTDBGDR_RESERVED 0x0000F000
32#define BF_UARTDBGDR_RESERVED(v) \
33 (((v) << 12) & BM_UARTDBGDR_RESERVED)
34#define BM_UARTDBGDR_OE 0x00000800
35#define BM_UARTDBGDR_BE 0x00000400
36#define BM_UARTDBGDR_PE 0x00000200
37#define BM_UARTDBGDR_FE 0x00000100
38#define BP_UARTDBGDR_DATA 0
39#define BM_UARTDBGDR_DATA 0x000000FF
40#define BF_UARTDBGDR_DATA(v) \
41 (((v) << 0) & BM_UARTDBGDR_DATA)
42#define HW_UARTDBGRSR_ECR 0x00000004
43#define BP_UARTDBGRSR_ECR_UNAVAILABLE 8
44#define BM_UARTDBGRSR_ECR_UNAVAILABLE 0xFFFFFF00
45#define BF_UARTDBGRSR_ECR_UNAVAILABLE(v) \
46 (((v) << 8) & BM_UARTDBGRSR_ECR_UNAVAILABLE)
47#define BP_UARTDBGRSR_ECR_EC 4
48#define BM_UARTDBGRSR_ECR_EC 0x000000F0
49#define BF_UARTDBGRSR_ECR_EC(v) \
50 (((v) << 4) & BM_UARTDBGRSR_ECR_EC)
51#define BM_UARTDBGRSR_ECR_OE 0x00000008
52#define BM_UARTDBGRSR_ECR_BE 0x00000004
53#define BM_UARTDBGRSR_ECR_PE 0x00000002
54#define BM_UARTDBGRSR_ECR_FE 0x00000001
55#define HW_UARTDBGFR 0x00000018
56#define BP_UARTDBGFR_UNAVAILABLE 16
57#define BM_UARTDBGFR_UNAVAILABLE 0xFFFF0000
58#define BF_UARTDBGFR_UNAVAILABLE(v) \
59 (((v) << 16) & BM_UARTDBGFR_UNAVAILABLE)
60#define BP_UARTDBGFR_RESERVED 9
61#define BM_UARTDBGFR_RESERVED 0x0000FE00
62#define BF_UARTDBGFR_RESERVED(v) \
63 (((v) << 9) & BM_UARTDBGFR_RESERVED)
64#define BM_UARTDBGFR_RI 0x00000100
65#define BM_UARTDBGFR_TXFE 0x00000080
66#define BM_UARTDBGFR_RXFF 0x00000040
67#define BM_UARTDBGFR_TXFF 0x00000020
68#define BM_UARTDBGFR_RXFE 0x00000010
69#define BM_UARTDBGFR_BUSY 0x00000008
70#define BM_UARTDBGFR_DCD 0x00000004
71#define BM_UARTDBGFR_DSR 0x00000002
72#define BM_UARTDBGFR_CTS 0x00000001
73#define HW_UARTDBGILPR 0x00000020
74#define BP_UARTDBGILPR_UNAVAILABLE 8
75#define BM_UARTDBGILPR_UNAVAILABLE 0xFFFFFF00
76#define BF_UARTDBGILPR_UNAVAILABLE(v) \
77 (((v) << 8) & BM_UARTDBGILPR_UNAVAILABLE)
78#define BP_UARTDBGILPR_ILPDVSR 0
79#define BM_UARTDBGILPR_ILPDVSR 0x000000FF
80#define BF_UARTDBGILPR_ILPDVSR(v) \
81 (((v) << 0) & BM_UARTDBGILPR_ILPDVSR)
82#define HW_UARTDBGIBRD 0x00000024
83#define BP_UARTDBGIBRD_UNAVAILABLE 16
84#define BM_UARTDBGIBRD_UNAVAILABLE 0xFFFF0000
85#define BF_UARTDBGIBRD_UNAVAILABLE(v) \
86 (((v) << 16) & BM_UARTDBGIBRD_UNAVAILABLE)
87#define BP_UARTDBGIBRD_BAUD_DIVINT 0
88#define BM_UARTDBGIBRD_BAUD_DIVINT 0x0000FFFF
89#define BF_UARTDBGIBRD_BAUD_DIVINT(v) \
90 (((v) << 0) & BM_UARTDBGIBRD_BAUD_DIVINT)
91#define HW_UARTDBGFBRD 0x00000028
92#define BP_UARTDBGFBRD_UNAVAILABLE 8
93#define BM_UARTDBGFBRD_UNAVAILABLE 0xFFFFFF00
94#define BF_UARTDBGFBRD_UNAVAILABLE(v) \
95 (((v) << 8) & BM_UARTDBGFBRD_UNAVAILABLE)
96#define BP_UARTDBGFBRD_RESERVED 6
97#define BM_UARTDBGFBRD_RESERVED 0x000000C0
98#define BF_UARTDBGFBRD_RESERVED(v) \
99 (((v) << 6) & BM_UARTDBGFBRD_RESERVED)
100#define BP_UARTDBGFBRD_BAUD_DIVFRAC 0
101#define BM_UARTDBGFBRD_BAUD_DIVFRAC 0x0000003F
102#define BF_UARTDBGFBRD_BAUD_DIVFRAC(v) \
103 (((v) << 0) & BM_UARTDBGFBRD_BAUD_DIVFRAC)
104#define HW_UARTDBGLCR_H 0x0000002c
105#define BP_UARTDBGLCR_H_UNAVAILABLE 16
106#define BM_UARTDBGLCR_H_UNAVAILABLE 0xFFFF0000
107#define BF_UARTDBGLCR_H_UNAVAILABLE(v) \
108 (((v) << 16) & BM_UARTDBGLCR_H_UNAVAILABLE)
109#define BP_UARTDBGLCR_H_RESERVED 8
110#define BM_UARTDBGLCR_H_RESERVED 0x0000FF00
111#define BF_UARTDBGLCR_H_RESERVED(v) \
112 (((v) << 8) & BM_UARTDBGLCR_H_RESERVED)
113#define BM_UARTDBGLCR_H_SPS 0x00000080
114#define BP_UARTDBGLCR_H_WLEN 5
115#define BM_UARTDBGLCR_H_WLEN 0x00000060
116#define BF_UARTDBGLCR_H_WLEN(v) \
117 (((v) << 5) & BM_UARTDBGLCR_H_WLEN)
118#define BM_UARTDBGLCR_H_FEN 0x00000010
119#define BM_UARTDBGLCR_H_STP2 0x00000008
120#define BM_UARTDBGLCR_H_EPS 0x00000004
121#define BM_UARTDBGLCR_H_PEN 0x00000002
122#define BM_UARTDBGLCR_H_BRK 0x00000001
123#define HW_UARTDBGCR 0x00000030
124#define BP_UARTDBGCR_UNAVAILABLE 16
125#define BM_UARTDBGCR_UNAVAILABLE 0xFFFF0000
126#define BF_UARTDBGCR_UNAVAILABLE(v) \
127 (((v) << 16) & BM_UARTDBGCR_UNAVAILABLE)
128#define BM_UARTDBGCR_CTSEN 0x00008000
129#define BM_UARTDBGCR_RTSEN 0x00004000
130#define BM_UARTDBGCR_OUT2 0x00002000
131#define BM_UARTDBGCR_OUT1 0x00001000
132#define BM_UARTDBGCR_RTS 0x00000800
133#define BM_UARTDBGCR_DTR 0x00000400
134#define BM_UARTDBGCR_RXE 0x00000200
135#define BM_UARTDBGCR_TXE 0x00000100
136#define BM_UARTDBGCR_LBE 0x00000080
137#define BP_UARTDBGCR_RESERVED 3
138#define BM_UARTDBGCR_RESERVED 0x00000078
139#define BF_UARTDBGCR_RESERVED(v) \
140 (((v) << 3) & BM_UARTDBGCR_RESERVED)
141#define BM_UARTDBGCR_SIRLP 0x00000004
142#define BM_UARTDBGCR_SIREN 0x00000002
143#define BM_UARTDBGCR_UARTEN 0x00000001
144#define HW_UARTDBGIFLS 0x00000034
145#define BP_UARTDBGIFLS_UNAVAILABLE 16
146#define BM_UARTDBGIFLS_UNAVAILABLE 0xFFFF0000
147#define BF_UARTDBGIFLS_UNAVAILABLE(v) \
148 (((v) << 16) & BM_UARTDBGIFLS_UNAVAILABLE)
149#define BP_UARTDBGIFLS_RESERVED 6
150#define BM_UARTDBGIFLS_RESERVED 0x0000FFC0
151#define BF_UARTDBGIFLS_RESERVED(v) \
152 (((v) << 6) & BM_UARTDBGIFLS_RESERVED)
153#define BP_UARTDBGIFLS_RXIFLSEL 3
154#define BM_UARTDBGIFLS_RXIFLSEL 0x00000038
155#define BF_UARTDBGIFLS_RXIFLSEL(v) \
156 (((v) << 3) & BM_UARTDBGIFLS_RXIFLSEL)
157#define BV_UARTDBGIFLS_RXIFLSEL__NOT_EMPTY 0x0
158#define BV_UARTDBGIFLS_RXIFLSEL__ONE_QUARTER 0x1
159#define BV_UARTDBGIFLS_RXIFLSEL__ONE_HALF 0x2
160#define BV_UARTDBGIFLS_RXIFLSEL__THREE_QUARTERS 0x3
161#define BV_UARTDBGIFLS_RXIFLSEL__SEVEN_EIGHTHS 0x4
162#define BV_UARTDBGIFLS_RXIFLSEL__INVALID5 0x5
163#define BV_UARTDBGIFLS_RXIFLSEL__INVALID6 0x6
164#define BV_UARTDBGIFLS_RXIFLSEL__INVALID7 0x7
165#define BP_UARTDBGIFLS_TXIFLSEL 0
166#define BM_UARTDBGIFLS_TXIFLSEL 0x00000007
167#define BF_UARTDBGIFLS_TXIFLSEL(v) \
168 (((v) << 0) & BM_UARTDBGIFLS_TXIFLSEL)
169#define BV_UARTDBGIFLS_TXIFLSEL__EMPTY 0x0
170#define BV_UARTDBGIFLS_TXIFLSEL__ONE_QUARTER 0x1
171#define BV_UARTDBGIFLS_TXIFLSEL__ONE_HALF 0x2
172#define BV_UARTDBGIFLS_TXIFLSEL__THREE_QUARTERS 0x3
173#define BV_UARTDBGIFLS_TXIFLSEL__SEVEN_EIGHTHS 0x4
174#define BV_UARTDBGIFLS_TXIFLSEL__INVALID5 0x5
175#define BV_UARTDBGIFLS_TXIFLSEL__INVALID6 0x6
176#define BV_UARTDBGIFLS_TXIFLSEL__INVALID7 0x7
177#define HW_UARTDBGIMSC 0x00000038
178#define BP_UARTDBGIMSC_UNAVAILABLE 16
179#define BM_UARTDBGIMSC_UNAVAILABLE 0xFFFF0000
180#define BF_UARTDBGIMSC_UNAVAILABLE(v) \
181 (((v) << 16) & BM_UARTDBGIMSC_UNAVAILABLE)
182#define BP_UARTDBGIMSC_RESERVED 11
183#define BM_UARTDBGIMSC_RESERVED 0x0000F800
184#define BF_UARTDBGIMSC_RESERVED(v) \
185 (((v) << 11) & BM_UARTDBGIMSC_RESERVED)
186#define BM_UARTDBGIMSC_OEIM 0x00000400
187#define BM_UARTDBGIMSC_BEIM 0x00000200
188#define BM_UARTDBGIMSC_PEIM 0x00000100
189#define BM_UARTDBGIMSC_FEIM 0x00000080
190#define BM_UARTDBGIMSC_RTIM 0x00000040
191#define BM_UARTDBGIMSC_TXIM 0x00000020
192#define BM_UARTDBGIMSC_RXIM 0x00000010
193#define BM_UARTDBGIMSC_DSRMIM 0x00000008
194#define BM_UARTDBGIMSC_DCDMIM 0x00000004
195#define BM_UARTDBGIMSC_CTSMIM 0x00000002
196#define BM_UARTDBGIMSC_RIMIM 0x00000001
197#define HW_UARTDBGRIS 0x0000003c
198#define BP_UARTDBGRIS_UNAVAILABLE 16
199#define BM_UARTDBGRIS_UNAVAILABLE 0xFFFF0000
200#define BF_UARTDBGRIS_UNAVAILABLE(v) \
201 (((v) << 16) & BM_UARTDBGRIS_UNAVAILABLE)
202#define BP_UARTDBGRIS_RESERVED 11
203#define BM_UARTDBGRIS_RESERVED 0x0000F800
204#define BF_UARTDBGRIS_RESERVED(v) \
205 (((v) << 11) & BM_UARTDBGRIS_RESERVED)
206#define BM_UARTDBGRIS_OERIS 0x00000400
207#define BM_UARTDBGRIS_BERIS 0x00000200
208#define BM_UARTDBGRIS_PERIS 0x00000100
209#define BM_UARTDBGRIS_FERIS 0x00000080
210#define BM_UARTDBGRIS_RTRIS 0x00000040
211#define BM_UARTDBGRIS_TXRIS 0x00000020
212#define BM_UARTDBGRIS_RXRIS 0x00000010
213#define BM_UARTDBGRIS_DSRRMIS 0x00000008
214#define BM_UARTDBGRIS_DCDRMIS 0x00000004
215#define BM_UARTDBGRIS_CTSRMIS 0x00000002
216#define BM_UARTDBGRIS_RIRMIS 0x00000001
217#define HW_UARTDBGMIS 0x00000040
218#define BP_UARTDBGMIS_UNAVAILABLE 16
219#define BM_UARTDBGMIS_UNAVAILABLE 0xFFFF0000
220#define BF_UARTDBGMIS_UNAVAILABLE(v) \
221 (((v) << 16) & BM_UARTDBGMIS_UNAVAILABLE)
222#define BP_UARTDBGMIS_RESERVED 11
223#define BM_UARTDBGMIS_RESERVED 0x0000F800
224#define BF_UARTDBGMIS_RESERVED(v) \
225 (((v) << 11) & BM_UARTDBGMIS_RESERVED)
226#define BM_UARTDBGMIS_OEMIS 0x00000400
227#define BM_UARTDBGMIS_BEMIS 0x00000200
228#define BM_UARTDBGMIS_PEMIS 0x00000100
229#define BM_UARTDBGMIS_FEMIS 0x00000080
230#define BM_UARTDBGMIS_RTMIS 0x00000040
231#define BM_UARTDBGMIS_TXMIS 0x00000020
232#define BM_UARTDBGMIS_RXMIS 0x00000010
233#define BM_UARTDBGMIS_DSRMMIS 0x00000008
234#define BM_UARTDBGMIS_DCDMMIS 0x00000004
235#define BM_UARTDBGMIS_CTSMMIS 0x00000002
236#define BM_UARTDBGMIS_RIMMIS 0x00000001
237#define HW_UARTDBGICR 0x00000044
238#define BP_UARTDBGICR_UNAVAILABLE 16
239#define BM_UARTDBGICR_UNAVAILABLE 0xFFFF0000
240#define BF_UARTDBGICR_UNAVAILABLE(v) \
241 (((v) << 16) & BM_UARTDBGICR_UNAVAILABLE)
242#define BP_UARTDBGICR_RESERVED 11
243#define BM_UARTDBGICR_RESERVED 0x0000F800
244#define BF_UARTDBGICR_RESERVED(v) \
245 (((v) << 11) & BM_UARTDBGICR_RESERVED)
246#define BM_UARTDBGICR_OEIC 0x00000400
247#define BM_UARTDBGICR_BEIC 0x00000200
248#define BM_UARTDBGICR_PEIC 0x00000100
249#define BM_UARTDBGICR_FEIC 0x00000080
250#define BM_UARTDBGICR_RTIC 0x00000040
251#define BM_UARTDBGICR_TXIC 0x00000020
252#define BM_UARTDBGICR_RXIC 0x00000010
253#define BM_UARTDBGICR_DSRMIC 0x00000008
254#define BM_UARTDBGICR_DCDMIC 0x00000004
255#define BM_UARTDBGICR_CTSMIC 0x00000002
256#define BM_UARTDBGICR_RIMIC 0x00000001
257#define HW_UARTDBGDMACR 0x00000048
258#define BP_UARTDBGDMACR_UNAVAILABLE 16
259#define BM_UARTDBGDMACR_UNAVAILABLE 0xFFFF0000
260#define BF_UARTDBGDMACR_UNAVAILABLE(v) \
261 (((v) << 16) & BM_UARTDBGDMACR_UNAVAILABLE)
262#define BP_UARTDBGDMACR_RESERVED 3
263#define BM_UARTDBGDMACR_RESERVED 0x0000FFF8
264#define BF_UARTDBGDMACR_RESERVED(v) \
265 (((v) << 3) & BM_UARTDBGDMACR_RESERVED)
266#define BM_UARTDBGDMACR_DMAONERR 0x00000004
267#define BM_UARTDBGDMACR_TXDMAE 0x00000002
268#define BM_UARTDBGDMACR_RXDMAE 0x00000001
diff --git a/arch/arm/mach-imx/include/mach/io.h b/arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h
index 9e197ae4590f..9145e22df32c 100644
--- a/arch/arm/mach-imx/include/mach/io.h
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * arch/arm/mach-imxads/include/mach/io.h 2 * stmp37xx: USBCTL register definitions
3 * 3 *
4 * Copyright (C) 1999 ARM Limited 4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -15,14 +16,7 @@
15 * 16 *
16 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 20 */
20#ifndef __ASM_ARM_ARCH_IO_H 21#define REGS_USBCTL_BASE (STMP3XXX_REGS_BASE + 0x80000)
21#define __ASM_ARM_ARCH_IO_H 22#define REGS_USBCTL_PHYS 0x80000
22
23#define IO_SPACE_LIMIT 0xffffffff
24
25#define __io(a) __typesafe_io(a)
26#define __mem_pci(a) (a)
27
28#endif
diff --git a/arch/arm/mach-imx/include/mach/memory.h b/arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h
index a93df7cba694..1a2ae9cbdfed 100644
--- a/arch/arm/mach-imx/include/mach/memory.h
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/arm/mach-imx/include/mach/memory.h 2 * stmp37xx: USBCTRL register definitions
3 * 3 *
4 * Copyright (C) 1999 ARM Limited 4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright (C) 2002 Shane Nay (shane@minirl.com) 5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -16,11 +16,7 @@
16 * 16 *
17 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#ifndef __ASM_ARCH_MMU_H 21#define REGS_USBCTRL_BASE (STMP3XXX_REGS_BASE + 0x80000)
22#define __ASM_ARCH_MMU_H 22#define REGS_USBCTRL_PHYS 0x80080000
23
24#define PHYS_OFFSET UL(0x08000000)
25
26#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h b/arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h
new file mode 100644
index 000000000000..b7fce0fbc560
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h
@@ -0,0 +1,37 @@
1/*
2 * stmp37xx: USBPHY register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define REGS_USBPHY_BASE (STMP3XXX_REGS_BASE + 0x7C000)
22
23#define HW_USBPHY_PWD 0x0
24
25#define HW_USBPHY_CTRL 0x30
26#define BM_USBPHY_CTRL_ENHSPRECHARGEXMIT 0x00000001
27#define BP_USBPHY_CTRL_ENHSPRECHARGEXMIT 0
28#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT 0x00000002
29#define BM_USBPHY_CTRL_ENDEVPLUGINDETECT 0x00000010
30#define BM_USBPHY_CTRL_ENOTGIDDETECT 0x00000080
31#define BM_USBPHY_CTRL_ENIRQDEVPLUGIN 0x00000800
32#define BM_USBPHY_CTRL_CLKGATE 0x40000000
33#define BM_USBPHY_CTRL_SFTRST 0x80000000
34
35#define HW_USBPHY_STATUS 0x40
36#define BM_USBPHY_STATUS_DEVPLUGIN_STATUS 0x00000040
37#define BM_USBPHY_STATUS_OTGID_STATUS 0x00000100
diff --git a/arch/arm/mach-stmp37xx/stmp37xx.c b/arch/arm/mach-stmp37xx/stmp37xx.c
new file mode 100644
index 000000000000..8c7d6fb191a3
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/stmp37xx.c
@@ -0,0 +1,219 @@
1/*
2 * Freescale STMP37XX platform support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/types.h>
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/device.h>
22#include <linux/platform_device.h>
23#include <linux/irq.h>
24#include <linux/io.h>
25
26#include <asm/setup.h>
27#include <asm/mach-types.h>
28
29#include <asm/mach/arch.h>
30#include <asm/mach/irq.h>
31#include <asm/mach/map.h>
32#include <asm/mach/time.h>
33
34#include <mach/stmp3xxx.h>
35#include <mach/dma.h>
36
37#include <mach/platform.h>
38#include <mach/regs-icoll.h>
39#include <mach/regs-apbh.h>
40#include <mach/regs-apbx.h>
41#include "stmp37xx.h"
42
43/*
44 * IRQ handling
45 */
46static void stmp37xx_ack_irq(unsigned int irq)
47{
48 /* Disable IRQ */
49 stmp3xxx_clearl(0x04 << ((irq % 4) * 8),
50 REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10);
51
52 /* ACK current interrupt */
53 __raw_writel(1, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK);
54
55 /* Barrier */
56 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT);
57}
58
59static void stmp37xx_mask_irq(unsigned int irq)
60{
61 /* IRQ disable */
62 stmp3xxx_clearl(0x04 << ((irq % 4) * 8),
63 REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10);
64}
65
66static void stmp37xx_unmask_irq(unsigned int irq)
67{
68 /* IRQ enable */
69 stmp3xxx_setl(0x04 << ((irq % 4) * 8),
70 REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10);
71}
72
73static struct irq_chip stmp37xx_chip = {
74 .ack = stmp37xx_ack_irq,
75 .mask = stmp37xx_mask_irq,
76 .unmask = stmp37xx_unmask_irq,
77};
78
79void __init stmp37xx_init_irq(void)
80{
81 stmp3xxx_init_irq(&stmp37xx_chip);
82}
83
84/*
85 * DMA interrupt handling
86 */
87void stmp3xxx_arch_dma_enable_interrupt(int channel)
88{
89 switch (STMP3XXX_DMA_BUS(channel)) {
90 case STMP3XXX_BUS_APBH:
91 stmp3xxx_setl(1 << (8 + STMP3XXX_DMA_CHANNEL(channel)),
92 REGS_APBH_BASE + HW_APBH_CTRL1);
93 break;
94
95 case STMP3XXX_BUS_APBX:
96 stmp3xxx_setl(1 << (8 + STMP3XXX_DMA_CHANNEL(channel)),
97 REGS_APBX_BASE + HW_APBX_CTRL1);
98 break;
99 }
100}
101EXPORT_SYMBOL(stmp3xxx_arch_dma_enable_interrupt);
102
103void stmp3xxx_arch_dma_clear_interrupt(int channel)
104{
105 switch (STMP3XXX_DMA_BUS(channel)) {
106 case STMP3XXX_BUS_APBH:
107 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel),
108 REGS_APBH_BASE + HW_APBH_CTRL1);
109 break;
110
111 case STMP3XXX_BUS_APBX:
112 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel),
113 REGS_APBX_BASE + HW_APBX_CTRL1);
114 break;
115 }
116}
117EXPORT_SYMBOL(stmp3xxx_arch_dma_clear_interrupt);
118
119int stmp3xxx_arch_dma_is_interrupt(int channel)
120{
121 int r = 0;
122
123 switch (STMP3XXX_DMA_BUS(channel)) {
124 case STMP3XXX_BUS_APBH:
125 r = __raw_readl(REGS_APBH_BASE + HW_APBH_CTRL1) &
126 (1 << STMP3XXX_DMA_CHANNEL(channel));
127 break;
128
129 case STMP3XXX_BUS_APBX:
130 r = __raw_readl(REGS_APBH_BASE + HW_APBH_CTRL1) &
131 (1 << STMP3XXX_DMA_CHANNEL(channel));
132 break;
133 }
134 return r;
135}
136EXPORT_SYMBOL(stmp3xxx_arch_dma_is_interrupt);
137
138void stmp3xxx_arch_dma_reset_channel(int channel)
139{
140 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
141
142 switch (STMP3XXX_DMA_BUS(channel)) {
143 case STMP3XXX_BUS_APBH:
144 /* Reset channel and wait for it to complete */
145 stmp3xxx_setl(chbit << BP_APBH_CTRL0_RESET_CHANNEL,
146 REGS_APBH_BASE + HW_APBH_CTRL0);
147 while (__raw_readl(REGS_APBH_BASE + HW_APBH_CTRL0) &
148 (chbit << BP_APBH_CTRL0_RESET_CHANNEL))
149 cpu_relax();
150 break;
151
152 case STMP3XXX_BUS_APBX:
153 stmp3xxx_setl(chbit << BP_APBX_CTRL0_RESET_CHANNEL,
154 REGS_APBX_BASE + HW_APBX_CTRL0);
155 while (__raw_readl(REGS_APBX_BASE + HW_APBX_CTRL0) &
156 (chbit << BP_APBX_CTRL0_RESET_CHANNEL))
157 cpu_relax();
158 break;
159 }
160}
161EXPORT_SYMBOL(stmp3xxx_arch_dma_reset_channel);
162
163void stmp3xxx_arch_dma_freeze(int channel)
164{
165 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
166
167 switch (STMP3XXX_DMA_BUS(channel)) {
168 case STMP3XXX_BUS_APBH:
169 stmp3xxx_setl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
170 break;
171 case STMP3XXX_BUS_APBX:
172 stmp3xxx_setl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
173 break;
174 }
175}
176EXPORT_SYMBOL(stmp3xxx_arch_dma_freeze);
177
178void stmp3xxx_arch_dma_unfreeze(int channel)
179{
180 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
181
182 switch (STMP3XXX_DMA_BUS(channel)) {
183 case STMP3XXX_BUS_APBH:
184 stmp3xxx_clearl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
185 break;
186 case STMP3XXX_BUS_APBX:
187 stmp3xxx_clearl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
188 break;
189 }
190}
191EXPORT_SYMBOL(stmp3xxx_arch_dma_unfreeze);
192
193/*
194 * The registers are all very closely mapped, so we might as well map them all
195 * with a single mapping
196 *
197 * Logical Physical
198 * f0000000 80000000 On-chip registers
199 * f1000000 00000000 32k on-chip SRAM
200 */
201static struct map_desc stmp37xx_io_desc[] __initdata = {
202 {
203 .virtual = (u32)STMP3XXX_REGS_BASE,
204 .pfn = __phys_to_pfn(STMP3XXX_REGS_PHBASE),
205 .length = SZ_1M,
206 .type = MT_DEVICE
207 },
208 {
209 .virtual = (u32)STMP3XXX_OCRAM_BASE,
210 .pfn = __phys_to_pfn(STMP3XXX_OCRAM_PHBASE),
211 .length = STMP3XXX_OCRAM_SIZE,
212 .type = MT_DEVICE,
213 },
214};
215
216void __init stmp37xx_map_io(void)
217{
218 iotable_init(stmp37xx_io_desc, ARRAY_SIZE(stmp37xx_io_desc));
219}
diff --git a/arch/arm/mach-stmp37xx/stmp37xx.h b/arch/arm/mach-stmp37xx/stmp37xx.h
new file mode 100644
index 000000000000..0b75fb796a64
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/stmp37xx.h
@@ -0,0 +1,24 @@
1/*
2 * Freescale STMP37XX/STMP378X internal functions and data declarations
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __MACH_STMP37XX_H
19#define __MACH_STMP37XX_H
20
21void stmp37xx_map_io(void);
22void stmp37xx_init_irq(void);
23
24#endif /* __MACH_STMP37XX_H */
diff --git a/arch/arm/mach-stmp37xx/stmp37xx_devb.c b/arch/arm/mach-stmp37xx/stmp37xx_devb.c
new file mode 100644
index 000000000000..394f21ab59e6
--- /dev/null
+++ b/arch/arm/mach-stmp37xx/stmp37xx_devb.c
@@ -0,0 +1,101 @@
1/*
2 * Freescale STMP37XX development board support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/device.h>
21#include <linux/platform_device.h>
22#include <asm/setup.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25
26#include <mach/stmp3xxx.h>
27#include <mach/pins.h>
28#include <mach/pinmux.h>
29#include "stmp37xx.h"
30
31/*
32 * List of STMP37xx development board specific devices
33 */
34static struct platform_device *stmp37xx_devb_devices[] = {
35 &stmp3xxx_dbguart,
36 &stmp3xxx_appuart,
37};
38
39static struct pin_desc dbguart_pins_0[] = {
40 { PINID_PWM0, PIN_FUN3, },
41 { PINID_PWM1, PIN_FUN3, },
42};
43
44struct pin_desc appuart_pins_0[] = {
45 { PINID_UART2_CTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
46 { PINID_UART2_RTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
47 { PINID_UART2_RX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
48 { PINID_UART2_TX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
49};
50
51static struct pin_group appuart_pins[] = {
52 [0] = {
53 .pins = appuart_pins_0,
54 .nr_pins = ARRAY_SIZE(appuart_pins_0),
55 },
56 /* 37xx has the only app uart */
57};
58
59static struct pin_group dbguart_pins[] = {
60 [0] = {
61 .pins = dbguart_pins_0,
62 .nr_pins = ARRAY_SIZE(dbguart_pins_0),
63 },
64};
65
66static int dbguart_pins_control(int id, int request)
67{
68 int r = 0;
69
70 if (request)
71 r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart");
72 else
73 stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart");
74 return r;
75}
76
77
78static void __init stmp37xx_devb_init(void)
79{
80 stmp3xxx_pinmux_init(NR_REAL_IRQS);
81
82 /* Init STMP3xxx platform */
83 stmp3xxx_init();
84
85 stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control;
86 stmp3xxx_appuart.dev.platform_data = appuart_pins;
87
88 /* Add STMP37xx development board devices */
89 platform_add_devices(stmp37xx_devb_devices,
90 ARRAY_SIZE(stmp37xx_devb_devices));
91}
92
93MACHINE_START(STMP37XX, "STMP37XX")
94 .phys_io = 0x80000000,
95 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
96 .boot_params = 0x40000100,
97 .map_io = stmp37xx_map_io,
98 .init_irq = stmp37xx_init_irq,
99 .timer = &stmp3xxx_timer,
100 .init_machine = stmp37xx_devb_init,
101MACHINE_END
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
new file mode 100644
index 000000000000..337b9aabce49
--- /dev/null
+++ b/arch/arm/mach-u300/Kconfig
@@ -0,0 +1,105 @@
1if ARCH_U300
2
3menu "ST-Ericsson AB U300/U330/U335/U365 Platform"
4
5comment "ST-Ericsson Mobile Platform Products"
6
7config MACH_U300
8 bool "U300"
9
10comment "ST-Ericsson U300/U330/U335/U365 Feature Selections"
11
12choice
13 prompt "U300/U330/U335/U365 system type"
14 default MACH_U300_BS2X
15 ---help---
16 You need to select the target system, i.e. the
17 U300/U330/U335/U365 board that you want to compile your kernel
18 for.
19
20config MACH_U300_BS2X
21 bool "S26/S26/B25/B26 Test Products"
22 depends on MACH_U300
23 help
24 Select this if you're developing on the
25 S26/S25 test products. (Also works on
26 B26/B25 big boards.)
27
28config MACH_U300_BS330
29 bool "S330/B330 Test Products"
30 depends on MACH_U300
31 help
32 Select this if you're developing on the
33 S330/B330 test products.
34
35config MACH_U300_BS335
36 bool "S335/B335 Test Products"
37 depends on MACH_U300
38 help
39 Select this if you're developing on the
40 S335/B335 test products.
41
42config MACH_U300_BS365
43 bool "S365/B365 Test Products"
44 depends on MACH_U300
45 help
46 Select this if you're developing on the
47 S365/B365 test products.
48
49endchoice
50
51choice
52 prompt "Memory configuration"
53 default MACH_U300_SINGLE_RAM
54 ---help---
55 You have to config the kernel according to the physical memory
56 configuration.
57
58config MACH_U300_SINGLE_RAM
59 bool "Single RAM"
60 help
61 Select this if you want support for Single RAM phones.
62
63config MACH_U300_DUAL_RAM
64 bool "Dual RAM"
65 help
66 Select this if you want support for Dual RAM phones.
67 This is two RAM memorys on different EMIFs.
68endchoice
69
70config U300_DEBUG
71 bool "Debug support for U300"
72 depends on PM
73 help
74 Debug support for U300 in sysfs, procfs etc.
75
76config MACH_U300_SEMI_IS_SHARED
77 bool "The SEMI is used by both the access and application side"
78 depends on MACH_U300
79 help
80 This makes it possible to use the SEMI (Shared External
81 Memory Interface) from both from access and application
82 side.
83
84comment "All the settings below must match the bootloader's settings"
85
86config MACH_U300_ACCESS_MEM_SIZE
87 int "Access CPU memory allocation"
88 range 7 25
89 depends on MACH_U300_SINGLE_RAM
90 default 13
91 help
92 How much memory in MiB that the Access side CPU has allocated
93
94config MACH_U300_2MB_ALIGNMENT_FIX
95 bool "2MiB alignment fix"
96 depends on MACH_U300_SINGLE_RAM
97 default y
98 help
99 If yes and the Access side CPU has allocated an odd size in
100 MiB, this fix gives you one MiB extra that would otherwise be
101 lost due to Linux 2 MiB alignment policy.
102
103endmenu
104
105endif
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile
new file mode 100644
index 000000000000..24950e0df4b4
--- /dev/null
+++ b/arch/arm/mach-u300/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel, U300 machine.
3#
4
5obj-y := core.o clock.o timer.o gpio.o padmux.o
6obj-m :=
7obj-n :=
8obj- :=
9
10obj-$(CONFIG_ARCH_U300) += u300.o
11obj-$(CONFIG_MMC) += mmc.o
diff --git a/arch/arm/mach-u300/Makefile.boot b/arch/arm/mach-u300/Makefile.boot
new file mode 100644
index 000000000000..6fbfc6ea2d35
--- /dev/null
+++ b/arch/arm/mach-u300/Makefile.boot
@@ -0,0 +1,15 @@
1# Note: the following conditions must always be true:
2# ZRELADDR == virt_to_phys(TEXTADDR)
3# PARAMS_PHYS must be within 4MB of ZRELADDR
4# INITRD_PHYS must be in RAM
5
6ifdef CONFIG_MACH_U300_SINGLE_RAM
7 zreladdr-y := 0x28E08000
8 params_phys-y := 0x28E00100
9else
10 zreladdr-y := 0x48008000
11 params_phys-y := 0x48000100
12endif
13
14# This isn't used.
15#initrd_phys-y := 0x29800000
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c
new file mode 100644
index 000000000000..5cd04d6751b3
--- /dev/null
+++ b/arch/arm/mach-u300/clock.c
@@ -0,0 +1,1487 @@
1/*
2 *
3 * arch/arm/mach-u300/clock.c
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Define clocks in the app platform.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
11 *
12 */
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/string.h>
19#include <linux/clk.h>
20#include <linux/mutex.h>
21#include <linux/spinlock.h>
22#include <linux/debugfs.h>
23#include <linux/device.h>
24#include <linux/init.h>
25#include <linux/timer.h>
26#include <linux/io.h>
27
28#include <asm/clkdev.h>
29#include <mach/hardware.h>
30#include <mach/syscon.h>
31
32#include "clock.h"
33
34/*
35 * TODO:
36 * - move all handling of the CCR register into this file and create
37 * a spinlock for the CCR register
38 * - switch to the clkdevice lookup mechanism that maps clocks to
39 * device ID:s instead when it becomes available in kernel 2.6.29.
40 * - implement rate get/set for all clocks that need it.
41 */
42
43/*
44 * Syscon clock I/O registers lock so clock requests don't collide
45 * NOTE: this is a local lock only used to lock access to clock and
46 * reset registers in syscon.
47 */
48static DEFINE_SPINLOCK(syscon_clkreg_lock);
49static DEFINE_SPINLOCK(syscon_resetreg_lock);
50
51/*
52 * The clocking hierarchy currently looks like this.
53 * NOTE: the idea is NOT to show how the clocks are routed on the chip!
54 * The ideas is to show dependencies, so a clock higher up in the
55 * hierarchy has to be on in order for another clock to be on. Now,
56 * both CPU and DMA can actually be on top of the hierarchy, and that
57 * is not modeled currently. Instead we have the backbone AMBA bus on
58 * top. This bus cannot be programmed in any way but conceptually it
59 * needs to be active for the bridges and devices to transport data.
60 *
61 * Please be aware that a few clocks are hw controlled, which mean that
62 * the hw itself can turn on/off or change the rate of the clock when
63 * needed!
64 *
65 * AMBA bus
66 * |
67 * +- CPU
68 * +- NANDIF NAND Flash interface
69 * +- SEMI Shared Memory interface
70 * +- ISP Image Signal Processor (U335 only)
71 * +- CDS (U335 only)
72 * +- DMA Direct Memory Access Controller
73 * +- AAIF APP/ACC Inteface (Mobile Scalable Link, MSL)
74 * +- APEX
75 * +- VIDEO_ENC AVE2/3 Video Encoder
76 * +- XGAM Graphics Accelerator Controller
77 * +- AHB
78 * |
79 * +- ahb:0 AHB Bridge
80 * | |
81 * | +- ahb:1 INTCON Interrupt controller
82 * | +- ahb:3 MSPRO Memory Stick Pro controller
83 * | +- ahb:4 EMIF External Memory interface
84 * |
85 * +- fast:0 FAST bridge
86 * | |
87 * | +- fast:1 MMCSD MMC/SD card reader controller
88 * | +- fast:2 I2S0 PCM I2S channel 0 controller
89 * | +- fast:3 I2S1 PCM I2S channel 1 controller
90 * | +- fast:4 I2C0 I2C channel 0 controller
91 * | +- fast:5 I2C1 I2C channel 1 controller
92 * | +- fast:6 SPI SPI controller
93 * | +- fast:7 UART1 Secondary UART (U335 only)
94 * |
95 * +- slow:0 SLOW bridge
96 * |
97 * +- slow:1 SYSCON (not possible to control)
98 * +- slow:2 WDOG Watchdog
99 * +- slow:3 UART0 primary UART
100 * +- slow:4 TIMER_APP Application timer - used in Linux
101 * +- slow:5 KEYPAD controller
102 * +- slow:6 GPIO controller
103 * +- slow:7 RTC controller
104 * +- slow:8 BT Bus Tracer (not used currently)
105 * +- slow:9 EH Event Handler (not used currently)
106 * +- slow:a TIMER_ACC Access style timer (not used currently)
107 * +- slow:b PPM (U335 only, what is that?)
108 */
109
110/*
111 * Reset control functions. We remember if a block has been
112 * taken out of reset and don't remove the reset assertion again
113 * and vice versa. Currently we only remove resets so the
114 * enablement function is defined out.
115 */
116static void syscon_block_reset_enable(struct clk *clk)
117{
118 u16 val;
119 unsigned long iflags;
120
121 /* Not all blocks support resetting */
122 if (!clk->res_reg || !clk->res_mask)
123 return;
124 spin_lock_irqsave(&syscon_resetreg_lock, iflags);
125 val = readw(clk->res_reg);
126 val |= clk->res_mask;
127 writew(val, clk->res_reg);
128 spin_unlock_irqrestore(&syscon_resetreg_lock, iflags);
129 clk->reset = true;
130}
131
132static void syscon_block_reset_disable(struct clk *clk)
133{
134 u16 val;
135 unsigned long iflags;
136
137 /* Not all blocks support resetting */
138 if (!clk->res_reg || !clk->res_mask)
139 return;
140 spin_lock_irqsave(&syscon_resetreg_lock, iflags);
141 val = readw(clk->res_reg);
142 val &= ~clk->res_mask;
143 writew(val, clk->res_reg);
144 spin_unlock_irqrestore(&syscon_resetreg_lock, iflags);
145 clk->reset = false;
146}
147
148int __clk_get(struct clk *clk)
149{
150 u16 val;
151
152 /* The MMC and MSPRO clocks need some special set-up */
153 if (!strcmp(clk->name, "MCLK")) {
154 /* Set default MMC clock divisor to 18.9 MHz */
155 writew(0x0054U, U300_SYSCON_VBASE + U300_SYSCON_MMF0R);
156 val = readw(U300_SYSCON_VBASE + U300_SYSCON_MMCR);
157 /* Disable the MMC feedback clock */
158 val &= ~U300_SYSCON_MMCR_MMC_FB_CLK_SEL_ENABLE;
159 /* Disable MSPRO frequency */
160 val &= ~U300_SYSCON_MMCR_MSPRO_FREQSEL_ENABLE;
161 writew(val, U300_SYSCON_VBASE + U300_SYSCON_MMCR);
162 }
163 if (!strcmp(clk->name, "MSPRO")) {
164 val = readw(U300_SYSCON_VBASE + U300_SYSCON_MMCR);
165 /* Disable the MMC feedback clock */
166 val &= ~U300_SYSCON_MMCR_MMC_FB_CLK_SEL_ENABLE;
167 /* Enable MSPRO frequency */
168 val |= U300_SYSCON_MMCR_MSPRO_FREQSEL_ENABLE;
169 writew(val, U300_SYSCON_VBASE + U300_SYSCON_MMCR);
170 }
171 return 1;
172}
173EXPORT_SYMBOL(__clk_get);
174
175void __clk_put(struct clk *clk)
176{
177}
178EXPORT_SYMBOL(__clk_put);
179
180static void syscon_clk_disable(struct clk *clk)
181{
182 unsigned long iflags;
183
184 /* Don't touch the hardware controlled clocks */
185 if (clk->hw_ctrld)
186 return;
187
188 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
189 writew(clk->clk_val, U300_SYSCON_VBASE + U300_SYSCON_SBCDR);
190 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
191}
192
193static void syscon_clk_enable(struct clk *clk)
194{
195 unsigned long iflags;
196
197 /* Don't touch the hardware controlled clocks */
198 if (clk->hw_ctrld)
199 return;
200
201 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
202 writew(clk->clk_val, U300_SYSCON_VBASE + U300_SYSCON_SBCER);
203 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
204}
205
206static u16 syscon_clk_get_rate(void)
207{
208 u16 val;
209 unsigned long iflags;
210
211 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
212 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
213 val &= U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK;
214 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
215 return val;
216}
217
218#ifdef CONFIG_MACH_U300_USE_I2S_AS_MASTER
219static void enable_i2s0_vcxo(void)
220{
221 u16 val;
222 unsigned long iflags;
223
224 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
225 /* Set I2S0 to use the VCXO 26 MHz clock */
226 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
227 val |= U300_SYSCON_CCR_TURN_VCXO_ON;
228 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
229 val |= U300_SYSCON_CCR_I2S0_USE_VCXO;
230 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
231 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CEFR);
232 val |= U300_SYSCON_CEFR_I2S0_CLK_EN;
233 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CEFR);
234 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
235}
236
237static void enable_i2s1_vcxo(void)
238{
239 u16 val;
240 unsigned long iflags;
241
242 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
243 /* Set I2S1 to use the VCXO 26 MHz clock */
244 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
245 val |= U300_SYSCON_CCR_TURN_VCXO_ON;
246 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
247 val |= U300_SYSCON_CCR_I2S1_USE_VCXO;
248 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
249 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CEFR);
250 val |= U300_SYSCON_CEFR_I2S1_CLK_EN;
251 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CEFR);
252 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
253}
254
255static void disable_i2s0_vcxo(void)
256{
257 u16 val;
258 unsigned long iflags;
259
260 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
261 /* Disable I2S0 use of the VCXO 26 MHz clock */
262 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
263 val &= ~U300_SYSCON_CCR_I2S0_USE_VCXO;
264 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
265 /* Deactivate VCXO if noone else is using VCXO */
266 if (!(val & U300_SYSCON_CCR_I2S1_USE_VCXO))
267 val &= ~U300_SYSCON_CCR_TURN_VCXO_ON;
268 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
269 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CEFR);
270 val &= ~U300_SYSCON_CEFR_I2S0_CLK_EN;
271 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CEFR);
272 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
273}
274
275static void disable_i2s1_vcxo(void)
276{
277 u16 val;
278 unsigned long iflags;
279
280 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
281 /* Disable I2S1 use of the VCXO 26 MHz clock */
282 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
283 val &= ~U300_SYSCON_CCR_I2S1_USE_VCXO;
284 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
285 /* Deactivate VCXO if noone else is using VCXO */
286 if (!(val & U300_SYSCON_CCR_I2S0_USE_VCXO))
287 val &= ~U300_SYSCON_CCR_TURN_VCXO_ON;
288 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
289 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CEFR);
290 val &= ~U300_SYSCON_CEFR_I2S0_CLK_EN;
291 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CEFR);
292 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
293}
294#endif /* CONFIG_MACH_U300_USE_I2S_AS_MASTER */
295
296
297static void syscon_clk_rate_set_mclk(unsigned long rate)
298{
299 u16 val;
300 u32 reg;
301 unsigned long iflags;
302
303 switch (rate) {
304 case 18900000:
305 val = 0x0054;
306 break;
307 case 20800000:
308 val = 0x0044;
309 break;
310 case 23100000:
311 val = 0x0043;
312 break;
313 case 26000000:
314 val = 0x0033;
315 break;
316 case 29700000:
317 val = 0x0032;
318 break;
319 case 34700000:
320 val = 0x0022;
321 break;
322 case 41600000:
323 val = 0x0021;
324 break;
325 case 52000000:
326 val = 0x0011;
327 break;
328 case 104000000:
329 val = 0x0000;
330 break;
331 default:
332 printk(KERN_ERR "Trying to set MCLK to unknown speed! %ld\n",
333 rate);
334 return;
335 }
336
337 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
338 reg = readw(U300_SYSCON_VBASE + U300_SYSCON_MMF0R) &
339 ~U300_SYSCON_MMF0R_MASK;
340 writew(reg | val, U300_SYSCON_VBASE + U300_SYSCON_MMF0R);
341 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
342}
343
344void syscon_clk_rate_set_cpuclk(unsigned long rate)
345{
346 u16 val;
347 unsigned long iflags;
348
349 switch (rate) {
350 case 13000000:
351 val = U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER;
352 break;
353 case 52000000:
354 val = U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE;
355 break;
356 case 104000000:
357 val = U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH;
358 break;
359 case 208000000:
360 val = U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST;
361 break;
362 default:
363 return;
364 }
365 spin_lock_irqsave(&syscon_clkreg_lock, iflags);
366 val |= readw(U300_SYSCON_VBASE + U300_SYSCON_CCR) &
367 ~U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK ;
368 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
369 spin_unlock_irqrestore(&syscon_clkreg_lock, iflags);
370}
371EXPORT_SYMBOL(syscon_clk_rate_set_cpuclk);
372
373void clk_disable(struct clk *clk)
374{
375 unsigned long iflags;
376
377 spin_lock_irqsave(&clk->lock, iflags);
378 if (clk->usecount > 0 && !(--clk->usecount)) {
379 /* some blocks lack clocking registers and cannot be disabled */
380 if (clk->disable)
381 clk->disable(clk);
382 if (likely((u32)clk->parent))
383 clk_disable(clk->parent);
384 }
385#ifdef CONFIG_MACH_U300_USE_I2S_AS_MASTER
386 if (unlikely(!strcmp(clk->name, "I2S0")))
387 disable_i2s0_vcxo();
388 if (unlikely(!strcmp(clk->name, "I2S1")))
389 disable_i2s1_vcxo();
390#endif
391 spin_unlock_irqrestore(&clk->lock, iflags);
392}
393EXPORT_SYMBOL(clk_disable);
394
395int clk_enable(struct clk *clk)
396{
397 int ret = 0;
398 unsigned long iflags;
399
400 spin_lock_irqsave(&clk->lock, iflags);
401 if (clk->usecount++ == 0) {
402 if (likely((u32)clk->parent))
403 ret = clk_enable(clk->parent);
404
405 if (unlikely(ret != 0))
406 clk->usecount--;
407 else {
408 /* remove reset line (we never enable reset again) */
409 syscon_block_reset_disable(clk);
410 /* clocks without enable function are always on */
411 if (clk->enable)
412 clk->enable(clk);
413#ifdef CONFIG_MACH_U300_USE_I2S_AS_MASTER
414 if (unlikely(!strcmp(clk->name, "I2S0")))
415 enable_i2s0_vcxo();
416 if (unlikely(!strcmp(clk->name, "I2S1")))
417 enable_i2s1_vcxo();
418#endif
419 }
420 }
421 spin_unlock_irqrestore(&clk->lock, iflags);
422 return ret;
423
424}
425EXPORT_SYMBOL(clk_enable);
426
427/* Returns the clock rate in Hz */
428static unsigned long clk_get_rate_cpuclk(struct clk *clk)
429{
430 u16 val;
431
432 val = syscon_clk_get_rate();
433
434 switch (val) {
435 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER:
436 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW:
437 return 13000000;
438 case U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE:
439 return 52000000;
440 case U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH:
441 return 104000000;
442 case U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST:
443 return 208000000;
444 default:
445 break;
446 }
447 return clk->rate;
448}
449
450static unsigned long clk_get_rate_ahb_clk(struct clk *clk)
451{
452 u16 val;
453
454 val = syscon_clk_get_rate();
455
456 switch (val) {
457 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER:
458 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW:
459 return 6500000;
460 case U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE:
461 return 26000000;
462 case U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH:
463 case U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST:
464 return 52000000;
465 default:
466 break;
467 }
468 return clk->rate;
469
470}
471
472static unsigned long clk_get_rate_emif_clk(struct clk *clk)
473{
474 u16 val;
475
476 val = syscon_clk_get_rate();
477
478 switch (val) {
479 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER:
480 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW:
481 return 13000000;
482 case U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE:
483 return 52000000;
484 case U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH:
485 case U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST:
486 return 104000000;
487 default:
488 break;
489 }
490 return clk->rate;
491
492}
493
494static unsigned long clk_get_rate_xgamclk(struct clk *clk)
495{
496 u16 val;
497
498 val = syscon_clk_get_rate();
499
500 switch (val) {
501 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER:
502 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW:
503 return 6500000;
504 case U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE:
505 return 26000000;
506 case U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH:
507 case U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST:
508 return 52000000;
509 default:
510 break;
511 }
512
513 return clk->rate;
514}
515
516static unsigned long clk_get_rate_mclk(struct clk *clk)
517{
518 u16 val;
519
520 val = syscon_clk_get_rate();
521
522 switch (val) {
523 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER:
524 /*
525 * Here, the 208 MHz PLL gets shut down and the always
526 * on 13 MHz PLL used for RTC etc kicks into use
527 * instead.
528 */
529 return 13000000;
530 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW:
531 case U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE:
532 case U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH:
533 case U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST:
534 {
535 /*
536 * This clock is under program control. The register is
537 * divided in two nybbles, bit 7-4 gives cycles-1 to count
538 * high, bit 3-0 gives cycles-1 to count low. Distribute
539 * these with no more than 1 cycle difference between
540 * low and high and add low and high to get the actual
541 * divisor. The base PLL is 208 MHz. Writing 0x00 will
542 * divide by 1 and 1 so the highest frequency possible
543 * is 104 MHz.
544 *
545 * e.g. 0x54 =>
546 * f = 208 / ((5+1) + (4+1)) = 208 / 11 = 18.9 MHz
547 */
548 u16 val = readw(U300_SYSCON_VBASE + U300_SYSCON_MMF0R) &
549 U300_SYSCON_MMF0R_MASK;
550 switch (val) {
551 case 0x0054:
552 return 18900000;
553 case 0x0044:
554 return 20800000;
555 case 0x0043:
556 return 23100000;
557 case 0x0033:
558 return 26000000;
559 case 0x0032:
560 return 29700000;
561 case 0x0022:
562 return 34700000;
563 case 0x0021:
564 return 41600000;
565 case 0x0011:
566 return 52000000;
567 case 0x0000:
568 return 104000000;
569 default:
570 break;
571 }
572 }
573 default:
574 break;
575 }
576
577 return clk->rate;
578}
579
580static unsigned long clk_get_rate_i2s_i2c_spi(struct clk *clk)
581{
582 u16 val;
583
584 val = syscon_clk_get_rate();
585
586 switch (val) {
587 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER:
588 case U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW:
589 return 13000000;
590 case U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE:
591 case U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH:
592 case U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST:
593 return 26000000;
594 default:
595 break;
596 }
597
598 return clk->rate;
599}
600
601unsigned long clk_get_rate(struct clk *clk)
602{
603 if (clk->get_rate)
604 return clk->get_rate(clk);
605 else
606 return clk->rate;
607}
608EXPORT_SYMBOL(clk_get_rate);
609
610static unsigned long clk_round_rate_mclk(struct clk *clk, unsigned long rate)
611{
612 if (rate >= 18900000)
613 return 18900000;
614 if (rate >= 20800000)
615 return 20800000;
616 if (rate >= 23100000)
617 return 23100000;
618 if (rate >= 26000000)
619 return 26000000;
620 if (rate >= 29700000)
621 return 29700000;
622 if (rate >= 34700000)
623 return 34700000;
624 if (rate >= 41600000)
625 return 41600000;
626 if (rate >= 52000000)
627 return 52000000;
628 return -EINVAL;
629}
630
631static unsigned long clk_round_rate_cpuclk(struct clk *clk, unsigned long rate)
632{
633 if (rate >= 13000000)
634 return 13000000;
635 if (rate >= 52000000)
636 return 52000000;
637 if (rate >= 104000000)
638 return 104000000;
639 if (rate >= 208000000)
640 return 208000000;
641 return -EINVAL;
642}
643
644/*
645 * This adjusts a requested rate to the closest exact rate
646 * a certain clock can provide. For a fixed clock it's
647 * mostly clk->rate.
648 */
649long clk_round_rate(struct clk *clk, unsigned long rate)
650{
651 /* TODO: get apropriate switches for EMIFCLK, AHBCLK and MCLK */
652 /* Else default to fixed value */
653
654 if (clk->round_rate) {
655 return (long) clk->round_rate(clk, rate);
656 } else {
657 printk(KERN_ERR "clock: Failed to round rate of %s\n",
658 clk->name);
659 }
660 return (long) clk->rate;
661}
662EXPORT_SYMBOL(clk_round_rate);
663
664static int clk_set_rate_mclk(struct clk *clk, unsigned long rate)
665{
666 syscon_clk_rate_set_mclk(clk_round_rate(clk, rate));
667 return 0;
668}
669
670static int clk_set_rate_cpuclk(struct clk *clk, unsigned long rate)
671{
672 syscon_clk_rate_set_cpuclk(clk_round_rate(clk, rate));
673 return 0;
674}
675
676int clk_set_rate(struct clk *clk, unsigned long rate)
677{
678 /* TODO: set for EMIFCLK and AHBCLK */
679 /* Else assume the clock is fixed and fail */
680 if (clk->set_rate) {
681 return clk->set_rate(clk, rate);
682 } else {
683 printk(KERN_ERR "clock: Failed to set %s to %ld hz\n",
684 clk->name, rate);
685 return -EINVAL;
686 }
687}
688EXPORT_SYMBOL(clk_set_rate);
689
690/*
691 * Clock definitions. The clock parents are set to respective
692 * bridge and the clock framework makes sure that the clocks have
693 * parents activated and are brought out of reset when in use.
694 *
695 * Clocks that have hw_ctrld = true are hw controlled, and the hw
696 * can by itself turn these clocks on and off.
697 * So in other words, we don't really have to care about them.
698 */
699
700static struct clk amba_clk = {
701 .name = "AMBA",
702 .rate = 52000000, /* this varies! */
703 .hw_ctrld = true,
704 .reset = false,
705};
706
707/*
708 * These blocks are connected directly to the AMBA bus
709 * with no bridge.
710 */
711
712static struct clk cpu_clk = {
713 .name = "CPU",
714 .parent = &amba_clk,
715 .rate = 208000000, /* this varies! */
716 .hw_ctrld = true,
717 .reset = true,
718 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
719 .res_mask = U300_SYSCON_RRR_CPU_RESET_EN,
720 .set_rate = clk_set_rate_cpuclk,
721 .get_rate = clk_get_rate_cpuclk,
722 .round_rate = clk_round_rate_cpuclk,
723};
724
725static struct clk nandif_clk = {
726 .name = "NANDIF",
727 .parent = &amba_clk,
728 .hw_ctrld = false,
729 .reset = true,
730 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
731 .res_mask = U300_SYSCON_RRR_NANDIF_RESET_EN,
732 .clk_val = U300_SYSCON_SBCER_NANDIF_CLK_EN,
733 .enable = syscon_clk_enable,
734 .disable = syscon_clk_disable,
735};
736
737static struct clk semi_clk = {
738 .name = "SEMI",
739 .parent = &amba_clk,
740 .rate = 0, /* FIXME */
741 /* It is not possible to reset SEMI */
742 .hw_ctrld = false,
743 .reset = false,
744 .clk_val = U300_SYSCON_SBCER_SEMI_CLK_EN,
745 .enable = syscon_clk_enable,
746 .disable = syscon_clk_disable,
747};
748
749#ifdef CONFIG_MACH_U300_BS335
750static struct clk isp_clk = {
751 .name = "ISP",
752 .parent = &amba_clk,
753 .rate = 0, /* FIXME */
754 .hw_ctrld = false,
755 .reset = true,
756 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
757 .res_mask = U300_SYSCON_RRR_ISP_RESET_EN,
758 .clk_val = U300_SYSCON_SBCER_ISP_CLK_EN,
759 .enable = syscon_clk_enable,
760 .disable = syscon_clk_disable,
761};
762
763static struct clk cds_clk = {
764 .name = "CDS",
765 .parent = &amba_clk,
766 .rate = 0, /* FIXME */
767 .hw_ctrld = false,
768 .reset = true,
769 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
770 .res_mask = U300_SYSCON_RRR_CDS_RESET_EN,
771 .clk_val = U300_SYSCON_SBCER_CDS_CLK_EN,
772 .enable = syscon_clk_enable,
773 .disable = syscon_clk_disable,
774};
775#endif
776
777static struct clk dma_clk = {
778 .name = "DMA",
779 .parent = &amba_clk,
780 .rate = 52000000, /* this varies! */
781 .hw_ctrld = true,
782 .reset = true,
783 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
784 .res_mask = U300_SYSCON_RRR_DMAC_RESET_EN,
785 .clk_val = U300_SYSCON_SBCER_DMAC_CLK_EN,
786 .enable = syscon_clk_enable,
787 .disable = syscon_clk_disable,
788};
789
790static struct clk aaif_clk = {
791 .name = "AAIF",
792 .parent = &amba_clk,
793 .rate = 52000000, /* this varies! */
794 .hw_ctrld = true,
795 .reset = true,
796 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
797 .res_mask = U300_SYSCON_RRR_AAIF_RESET_EN,
798 .clk_val = U300_SYSCON_SBCER_AAIF_CLK_EN,
799 .enable = syscon_clk_enable,
800 .disable = syscon_clk_disable,
801};
802
803static struct clk apex_clk = {
804 .name = "APEX",
805 .parent = &amba_clk,
806 .rate = 0, /* FIXME */
807 .hw_ctrld = true,
808 .reset = true,
809 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
810 .res_mask = U300_SYSCON_RRR_APEX_RESET_EN,
811 .clk_val = U300_SYSCON_SBCER_APEX_CLK_EN,
812 .enable = syscon_clk_enable,
813 .disable = syscon_clk_disable,
814};
815
816static struct clk video_enc_clk = {
817 .name = "VIDEO_ENC",
818 .parent = &amba_clk,
819 .rate = 208000000, /* this varies! */
820 .hw_ctrld = false,
821 .reset = false,
822 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
823 /* This has XGAM in the name but refers to the video encoder */
824 .res_mask = U300_SYSCON_RRR_XGAM_VC_SYNC_RESET_EN,
825 .clk_val = U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN,
826 .enable = syscon_clk_enable,
827 .disable = syscon_clk_disable,
828};
829
830static struct clk xgam_clk = {
831 .name = "XGAMCLK",
832 .parent = &amba_clk,
833 .rate = 52000000, /* this varies! */
834 .hw_ctrld = false,
835 .reset = true,
836 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
837 .res_mask = U300_SYSCON_RRR_XGAM_RESET_EN,
838 .clk_val = U300_SYSCON_SBCER_XGAM_CLK_EN,
839 .get_rate = clk_get_rate_xgamclk,
840 .enable = syscon_clk_enable,
841 .disable = syscon_clk_disable,
842};
843
844/* This clock is used to activate the video encoder */
845static struct clk ahb_clk = {
846 .name = "AHB",
847 .parent = &amba_clk,
848 .rate = 52000000, /* this varies! */
849 .hw_ctrld = false, /* This one is set to false due to HW bug */
850 .reset = true,
851 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
852 .res_mask = U300_SYSCON_RRR_AHB_RESET_EN,
853 .clk_val = U300_SYSCON_SBCER_AHB_CLK_EN,
854 .enable = syscon_clk_enable,
855 .disable = syscon_clk_disable,
856 .get_rate = clk_get_rate_ahb_clk,
857};
858
859
860/*
861 * Clocks on the AHB bridge
862 */
863
864static struct clk ahb_subsys_clk = {
865 .name = "AHB_SUBSYS",
866 .parent = &amba_clk,
867 .rate = 52000000, /* this varies! */
868 .hw_ctrld = true,
869 .reset = false,
870 .clk_val = U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN,
871 .enable = syscon_clk_enable,
872 .disable = syscon_clk_disable,
873 .get_rate = clk_get_rate_ahb_clk,
874};
875
876static struct clk intcon_clk = {
877 .name = "INTCON",
878 .parent = &ahb_subsys_clk,
879 .rate = 52000000, /* this varies! */
880 .hw_ctrld = false,
881 .reset = true,
882 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
883 .res_mask = U300_SYSCON_RRR_INTCON_RESET_EN,
884 /* INTCON can be reset but not clock-gated */
885};
886
887static struct clk mspro_clk = {
888 .name = "MSPRO",
889 .parent = &ahb_subsys_clk,
890 .rate = 0, /* FIXME */
891 .hw_ctrld = false,
892 .reset = true,
893 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
894 .res_mask = U300_SYSCON_RRR_MSPRO_RESET_EN,
895 .clk_val = U300_SYSCON_SBCER_MSPRO_CLK_EN,
896 .enable = syscon_clk_enable,
897 .disable = syscon_clk_disable,
898};
899
900static struct clk emif_clk = {
901 .name = "EMIF",
902 .parent = &ahb_subsys_clk,
903 .rate = 104000000, /* this varies! */
904 .hw_ctrld = false,
905 .reset = true,
906 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
907 .res_mask = U300_SYSCON_RRR_EMIF_RESET_EN,
908 .clk_val = U300_SYSCON_SBCER_EMIF_CLK_EN,
909 .enable = syscon_clk_enable,
910 .disable = syscon_clk_disable,
911 .get_rate = clk_get_rate_emif_clk,
912};
913
914
915/*
916 * Clocks on the FAST bridge
917 */
918static struct clk fast_clk = {
919 .name = "FAST_BRIDGE",
920 .parent = &amba_clk,
921 .rate = 13000000, /* this varies! */
922 .hw_ctrld = true,
923 .reset = true,
924 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
925 .res_mask = U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE,
926 .clk_val = U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN,
927 .enable = syscon_clk_enable,
928 .disable = syscon_clk_disable,
929};
930
931static struct clk mmcsd_clk = {
932 .name = "MCLK",
933 .parent = &fast_clk,
934 .rate = 18900000, /* this varies! */
935 .hw_ctrld = false,
936 .reset = true,
937 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
938 .res_mask = U300_SYSCON_RFR_MMC_RESET_ENABLE,
939 .clk_val = U300_SYSCON_SBCER_MMC_CLK_EN,
940 .get_rate = clk_get_rate_mclk,
941 .set_rate = clk_set_rate_mclk,
942 .round_rate = clk_round_rate_mclk,
943 .disable = syscon_clk_disable,
944 .enable = syscon_clk_enable,
945};
946
947static struct clk i2s0_clk = {
948 .name = "i2s0",
949 .parent = &fast_clk,
950 .rate = 26000000, /* this varies! */
951 .hw_ctrld = true,
952 .reset = true,
953 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
954 .res_mask = U300_SYSCON_RFR_PCM_I2S0_RESET_ENABLE,
955 .clk_val = U300_SYSCON_SBCER_I2S0_CORE_CLK_EN,
956 .enable = syscon_clk_enable,
957 .disable = syscon_clk_disable,
958 .get_rate = clk_get_rate_i2s_i2c_spi,
959};
960
961static struct clk i2s1_clk = {
962 .name = "i2s1",
963 .parent = &fast_clk,
964 .rate = 26000000, /* this varies! */
965 .hw_ctrld = true,
966 .reset = true,
967 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
968 .res_mask = U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE,
969 .clk_val = U300_SYSCON_SBCER_I2S1_CORE_CLK_EN,
970 .enable = syscon_clk_enable,
971 .disable = syscon_clk_disable,
972 .get_rate = clk_get_rate_i2s_i2c_spi,
973};
974
975static struct clk i2c0_clk = {
976 .name = "I2C0",
977 .parent = &fast_clk,
978 .rate = 26000000, /* this varies! */
979 .hw_ctrld = false,
980 .reset = true,
981 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
982 .res_mask = U300_SYSCON_RFR_I2C0_RESET_ENABLE,
983 .clk_val = U300_SYSCON_SBCER_I2C0_CLK_EN,
984 .enable = syscon_clk_enable,
985 .disable = syscon_clk_disable,
986 .get_rate = clk_get_rate_i2s_i2c_spi,
987};
988
989static struct clk i2c1_clk = {
990 .name = "I2C1",
991 .parent = &fast_clk,
992 .rate = 26000000, /* this varies! */
993 .hw_ctrld = false,
994 .reset = true,
995 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
996 .res_mask = U300_SYSCON_RFR_I2C1_RESET_ENABLE,
997 .clk_val = U300_SYSCON_SBCER_I2C1_CLK_EN,
998 .enable = syscon_clk_enable,
999 .disable = syscon_clk_disable,
1000 .get_rate = clk_get_rate_i2s_i2c_spi,
1001};
1002
1003static struct clk spi_clk = {
1004 .name = "SPI",
1005 .parent = &fast_clk,
1006 .rate = 26000000, /* this varies! */
1007 .hw_ctrld = false,
1008 .reset = true,
1009 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
1010 .res_mask = U300_SYSCON_RFR_SPI_RESET_ENABLE,
1011 .clk_val = U300_SYSCON_SBCER_SPI_CLK_EN,
1012 .enable = syscon_clk_enable,
1013 .disable = syscon_clk_disable,
1014 .get_rate = clk_get_rate_i2s_i2c_spi,
1015};
1016
1017#ifdef CONFIG_MACH_U300_BS335
1018static struct clk uart1_clk = {
1019 .name = "UART1",
1020 .parent = &fast_clk,
1021 .rate = 13000000,
1022 .hw_ctrld = false,
1023 .reset = true,
1024 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RFR,
1025 .res_mask = U300_SYSCON_RFR_UART1_RESET_ENABLE,
1026 .clk_val = U300_SYSCON_SBCER_UART1_CLK_EN,
1027 .enable = syscon_clk_enable,
1028 .disable = syscon_clk_disable,
1029};
1030#endif
1031
1032
1033/*
1034 * Clocks on the SLOW bridge
1035 */
1036static struct clk slow_clk = {
1037 .name = "SLOW_BRIDGE",
1038 .parent = &amba_clk,
1039 .rate = 13000000,
1040 .hw_ctrld = true,
1041 .reset = true,
1042 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1043 .res_mask = U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN,
1044 .clk_val = U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN,
1045 .enable = syscon_clk_enable,
1046 .disable = syscon_clk_disable,
1047};
1048
1049/* TODO: implement SYSCON clock? */
1050
1051static struct clk wdog_clk = {
1052 .name = "WDOG",
1053 .parent = &slow_clk,
1054 .hw_ctrld = false,
1055 .rate = 32768,
1056 .reset = false,
1057 /* This is always on, cannot be enabled/disabled or reset */
1058};
1059
1060/* This one is hardwired to PLL13 */
1061static struct clk uart_clk = {
1062 .name = "UARTCLK",
1063 .parent = &slow_clk,
1064 .rate = 13000000,
1065 .hw_ctrld = false,
1066 .reset = true,
1067 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1068 .res_mask = U300_SYSCON_RSR_UART_RESET_EN,
1069 .clk_val = U300_SYSCON_SBCER_UART_CLK_EN,
1070 .enable = syscon_clk_enable,
1071 .disable = syscon_clk_disable,
1072};
1073
1074static struct clk keypad_clk = {
1075 .name = "KEYPAD",
1076 .parent = &slow_clk,
1077 .rate = 32768,
1078 .hw_ctrld = false,
1079 .reset = true,
1080 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1081 .res_mask = U300_SYSCON_RSR_KEYPAD_RESET_EN,
1082 .clk_val = U300_SYSCON_SBCER_KEYPAD_CLK_EN,
1083 .enable = syscon_clk_enable,
1084 .disable = syscon_clk_disable,
1085};
1086
1087static struct clk gpio_clk = {
1088 .name = "GPIO",
1089 .parent = &slow_clk,
1090 .rate = 13000000,
1091 .hw_ctrld = true,
1092 .reset = true,
1093 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1094 .res_mask = U300_SYSCON_RSR_GPIO_RESET_EN,
1095 .clk_val = U300_SYSCON_SBCER_GPIO_CLK_EN,
1096 .enable = syscon_clk_enable,
1097 .disable = syscon_clk_disable,
1098};
1099
1100static struct clk rtc_clk = {
1101 .name = "RTC",
1102 .parent = &slow_clk,
1103 .rate = 32768,
1104 .hw_ctrld = true,
1105 .reset = true,
1106 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1107 .res_mask = U300_SYSCON_RSR_RTC_RESET_EN,
1108 /* This clock is always on, cannot be enabled/disabled */
1109};
1110
1111static struct clk bustr_clk = {
1112 .name = "BUSTR",
1113 .parent = &slow_clk,
1114 .rate = 13000000,
1115 .hw_ctrld = true,
1116 .reset = true,
1117 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1118 .res_mask = U300_SYSCON_RSR_BTR_RESET_EN,
1119 .clk_val = U300_SYSCON_SBCER_BTR_CLK_EN,
1120 .enable = syscon_clk_enable,
1121 .disable = syscon_clk_disable,
1122};
1123
1124static struct clk evhist_clk = {
1125 .name = "EVHIST",
1126 .parent = &slow_clk,
1127 .rate = 13000000,
1128 .hw_ctrld = true,
1129 .reset = true,
1130 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1131 .res_mask = U300_SYSCON_RSR_EH_RESET_EN,
1132 .clk_val = U300_SYSCON_SBCER_EH_CLK_EN,
1133 .enable = syscon_clk_enable,
1134 .disable = syscon_clk_disable,
1135};
1136
1137static struct clk timer_clk = {
1138 .name = "TIMER",
1139 .parent = &slow_clk,
1140 .rate = 13000000,
1141 .hw_ctrld = true,
1142 .reset = true,
1143 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1144 .res_mask = U300_SYSCON_RSR_ACC_TMR_RESET_EN,
1145 .clk_val = U300_SYSCON_SBCER_ACC_TMR_CLK_EN,
1146 .enable = syscon_clk_enable,
1147 .disable = syscon_clk_disable,
1148};
1149
1150static struct clk app_timer_clk = {
1151 .name = "TIMER_APP",
1152 .parent = &slow_clk,
1153 .rate = 13000000,
1154 .hw_ctrld = true,
1155 .reset = true,
1156 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1157 .res_mask = U300_SYSCON_RSR_APP_TMR_RESET_EN,
1158 .clk_val = U300_SYSCON_SBCER_APP_TMR_CLK_EN,
1159 .enable = syscon_clk_enable,
1160 .disable = syscon_clk_disable,
1161};
1162
1163#ifdef CONFIG_MACH_U300_BS335
1164static struct clk ppm_clk = {
1165 .name = "PPM",
1166 .parent = &slow_clk,
1167 .rate = 0, /* FIXME */
1168 .hw_ctrld = true, /* TODO: Look up if it is hw ctrld or not */
1169 .reset = true,
1170 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1171 .res_mask = U300_SYSCON_RSR_PPM_RESET_EN,
1172 .clk_val = U300_SYSCON_SBCER_PPM_CLK_EN,
1173 .enable = syscon_clk_enable,
1174 .disable = syscon_clk_disable,
1175};
1176#endif
1177
1178#define DEF_LOOKUP(devid, clkref) \
1179 { \
1180 .dev_id = devid, \
1181 .clk = clkref, \
1182 }
1183
1184/*
1185 * Here we only define clocks that are meaningful to
1186 * look up through clockdevice.
1187 */
1188static struct clk_lookup lookups[] = {
1189 /* Connected directly to the AMBA bus */
1190 DEF_LOOKUP("amba", &amba_clk),
1191 DEF_LOOKUP("cpu", &cpu_clk),
1192 DEF_LOOKUP("nandif", &nandif_clk),
1193 DEF_LOOKUP("semi", &semi_clk),
1194#ifdef CONFIG_MACH_U300_BS335
1195 DEF_LOOKUP("isp", &isp_clk),
1196 DEF_LOOKUP("cds", &cds_clk),
1197#endif
1198 DEF_LOOKUP("dma", &dma_clk),
1199 DEF_LOOKUP("aaif", &aaif_clk),
1200 DEF_LOOKUP("apex", &apex_clk),
1201 DEF_LOOKUP("video_enc", &video_enc_clk),
1202 DEF_LOOKUP("xgam", &xgam_clk),
1203 DEF_LOOKUP("ahb", &ahb_clk),
1204 /* AHB bridge clocks */
1205 DEF_LOOKUP("ahb", &ahb_subsys_clk),
1206 DEF_LOOKUP("intcon", &intcon_clk),
1207 DEF_LOOKUP("mspro", &mspro_clk),
1208 DEF_LOOKUP("pl172", &emif_clk),
1209 /* FAST bridge clocks */
1210 DEF_LOOKUP("fast", &fast_clk),
1211 DEF_LOOKUP("mmci", &mmcsd_clk),
1212 /*
1213 * The .0 and .1 identifiers on these comes from the platform device
1214 * .id field and are assigned when the platform devices are registered.
1215 */
1216 DEF_LOOKUP("i2s.0", &i2s0_clk),
1217 DEF_LOOKUP("i2s.1", &i2s1_clk),
1218 DEF_LOOKUP("stddci2c.0", &i2c0_clk),
1219 DEF_LOOKUP("stddci2c.1", &i2c1_clk),
1220 DEF_LOOKUP("pl022", &spi_clk),
1221#ifdef CONFIG_MACH_U300_BS335
1222 DEF_LOOKUP("uart1", &uart1_clk),
1223#endif
1224 /* SLOW bridge clocks */
1225 DEF_LOOKUP("slow", &slow_clk),
1226 DEF_LOOKUP("wdog", &wdog_clk),
1227 DEF_LOOKUP("uart0", &uart_clk),
1228 DEF_LOOKUP("apptimer", &app_timer_clk),
1229 DEF_LOOKUP("keypad", &keypad_clk),
1230 DEF_LOOKUP("u300-gpio", &gpio_clk),
1231 DEF_LOOKUP("rtc0", &rtc_clk),
1232 DEF_LOOKUP("bustr", &bustr_clk),
1233 DEF_LOOKUP("evhist", &evhist_clk),
1234 DEF_LOOKUP("timer", &timer_clk),
1235#ifdef CONFIG_MACH_U300_BS335
1236 DEF_LOOKUP("ppm", &ppm_clk),
1237#endif
1238};
1239
1240static void __init clk_register(void)
1241{
1242 int i;
1243
1244 /* Register the lookups */
1245 for (i = 0; i < ARRAY_SIZE(lookups); i++)
1246 clkdev_add(&lookups[i]);
1247}
1248
1249/*
1250 * These are the clocks for cells registered as primecell drivers
1251 * on the AMBA bus. These must be on during AMBA device registration
1252 * since the bus probe will attempt to read magic configuration
1253 * registers for these devices. If they are deactivated these probes
1254 * will fail.
1255 *
1256 *
1257 * Please note that on emif, both RAM and NAND is connected in dual
1258 * RAM phones. On single RAM phones, ram is on semi and NAND on emif.
1259 *
1260 */
1261void u300_clock_primecells(void)
1262{
1263 clk_enable(&intcon_clk);
1264 clk_enable(&uart_clk);
1265#ifdef CONFIG_MACH_U300_BS335
1266 clk_enable(&uart1_clk);
1267#endif
1268 clk_enable(&spi_clk);
1269
1270 clk_enable(&mmcsd_clk);
1271
1272}
1273EXPORT_SYMBOL(u300_clock_primecells);
1274
1275void u300_unclock_primecells(void)
1276{
1277
1278 clk_disable(&intcon_clk);
1279 clk_disable(&uart_clk);
1280#ifdef CONFIG_MACH_U300_BS335
1281 clk_disable(&uart1_clk);
1282#endif
1283 clk_disable(&spi_clk);
1284 clk_disable(&mmcsd_clk);
1285
1286}
1287EXPORT_SYMBOL(u300_unclock_primecells);
1288
1289/*
1290 * The interrupt controller is enabled before the clock API is registered.
1291 */
1292void u300_enable_intcon_clock(void)
1293{
1294 clk_enable(&intcon_clk);
1295}
1296EXPORT_SYMBOL(u300_enable_intcon_clock);
1297
1298/*
1299 * The timer is enabled before the clock API is registered.
1300 */
1301void u300_enable_timer_clock(void)
1302{
1303 clk_enable(&app_timer_clk);
1304}
1305EXPORT_SYMBOL(u300_enable_timer_clock);
1306
1307#if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG))
1308/*
1309 * The following makes it possible to view the status (especially
1310 * reference count and reset status) for the clocks in the platform
1311 * by looking into the special file <debugfs>/u300_clocks
1312 */
1313
1314/* A list of all clocks in the platform */
1315static struct clk *clks[] = {
1316 /* Top node clock for the AMBA bus */
1317 &amba_clk,
1318 /* Connected directly to the AMBA bus */
1319 &cpu_clk,
1320 &nandif_clk,
1321 &semi_clk,
1322#ifdef CONFIG_MACH_U300_BS335
1323 &isp_clk,
1324 &cds_clk,
1325#endif
1326 &dma_clk,
1327 &aaif_clk,
1328 &apex_clk,
1329 &video_enc_clk,
1330 &xgam_clk,
1331 &ahb_clk,
1332
1333 /* AHB bridge clocks */
1334 &ahb_subsys_clk,
1335 &intcon_clk,
1336 &mspro_clk,
1337 &emif_clk,
1338 /* FAST bridge clocks */
1339 &fast_clk,
1340 &mmcsd_clk,
1341 &i2s0_clk,
1342 &i2s1_clk,
1343 &i2c0_clk,
1344 &i2c1_clk,
1345 &spi_clk,
1346#ifdef CONFIG_MACH_U300_BS335
1347 &uart1_clk,
1348#endif
1349 /* SLOW bridge clocks */
1350 &slow_clk,
1351 &wdog_clk,
1352 &uart_clk,
1353 &app_timer_clk,
1354 &keypad_clk,
1355 &gpio_clk,
1356 &rtc_clk,
1357 &bustr_clk,
1358 &evhist_clk,
1359 &timer_clk,
1360#ifdef CONFIG_MACH_U300_BS335
1361 &ppm_clk,
1362#endif
1363};
1364
1365static int u300_clocks_show(struct seq_file *s, void *data)
1366{
1367 struct clk *clk;
1368 int i;
1369
1370 seq_printf(s, "CLOCK DEVICE RESET STATE\t" \
1371 "ACTIVE\tUSERS\tHW CTRL FREQ\n");
1372 seq_printf(s, "---------------------------------------------" \
1373 "-----------------------------------------\n");
1374 for (i = 0; i < ARRAY_SIZE(clks); i++) {
1375 clk = clks[i];
1376 if (clk != ERR_PTR(-ENOENT)) {
1377 /* Format clock and device name nicely */
1378 char cdp[33];
1379 int chars;
1380
1381 chars = snprintf(&cdp[0], 17, "%s", clk->name);
1382 while (chars < 16) {
1383 cdp[chars] = ' ';
1384 chars++;
1385 }
1386 chars = snprintf(&cdp[16], 17, "%s", clk->dev ?
1387 dev_name(clk->dev) : "N/A");
1388 while (chars < 16) {
1389 cdp[chars+16] = ' ';
1390 chars++;
1391 }
1392 cdp[32] = '\0';
1393 if (clk->get_rate)
1394 seq_printf(s,
1395 "%s%s\t%s\t%d\t%s\t%lu Hz\n",
1396 &cdp[0],
1397 clk->reset ?
1398 "ASSERTED" : "RELEASED",
1399 clk->usecount ? "ON" : "OFF",
1400 clk->usecount,
1401 clk->hw_ctrld ? "YES" : "NO ",
1402 clk->get_rate(clk));
1403 else
1404 seq_printf(s,
1405 "%s%s\t%s\t%d\t%s\t" \
1406 "(unknown rate)\n",
1407 &cdp[0],
1408 clk->reset ?
1409 "ASSERTED" : "RELEASED",
1410 clk->usecount ? "ON" : "OFF",
1411 clk->usecount,
1412 clk->hw_ctrld ? "YES" : "NO ");
1413 }
1414 }
1415 return 0;
1416}
1417
1418static int u300_clocks_open(struct inode *inode, struct file *file)
1419{
1420 return single_open(file, u300_clocks_show, NULL);
1421}
1422
1423static const struct file_operations u300_clocks_operations = {
1424 .open = u300_clocks_open,
1425 .read = seq_read,
1426 .llseek = seq_lseek,
1427 .release = single_release,
1428};
1429
1430static void init_clk_read_procfs(void)
1431{
1432 /* Expose a simple debugfs interface to view all clocks */
1433 (void) debugfs_create_file("u300_clocks", S_IFREG | S_IRUGO,
1434 NULL, NULL, &u300_clocks_operations);
1435}
1436#else
1437static inline void init_clk_read_procfs(void)
1438{
1439}
1440#endif
1441
1442static int __init u300_clock_init(void)
1443{
1444 u16 val;
1445
1446 /*
1447 * FIXME: shall all this powermanagement stuff really live here???
1448 */
1449
1450 /* Set system to run at PLL208, max performance, a known state. */
1451 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
1452 val &= ~U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK;
1453 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
1454 /* Wait for the PLL208 to lock if not locked in yet */
1455 while (!(readw(U300_SYSCON_VBASE + U300_SYSCON_CSR) &
1456 U300_SYSCON_CSR_PLL208_LOCK_IND));
1457
1458 /* Power management enable */
1459 val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMCR);
1460 val |= U300_SYSCON_PMCR_PWR_MGNT_ENABLE;
1461 writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMCR);
1462
1463 clk_register();
1464
1465 init_clk_read_procfs();
1466
1467 /*
1468 * Some of these may be on when we boot the system so make sure they
1469 * are turned OFF.
1470 */
1471 syscon_block_reset_enable(&timer_clk);
1472 timer_clk.disable(&timer_clk);
1473
1474 /*
1475 * These shall be turned on by default when we boot the system
1476 * so make sure they are ON. (Adding CPU here is a bit too much.)
1477 * These clocks will be claimed by drivers later.
1478 */
1479 syscon_block_reset_disable(&semi_clk);
1480 syscon_block_reset_disable(&emif_clk);
1481 semi_clk.enable(&semi_clk);
1482 emif_clk.enable(&emif_clk);
1483
1484 return 0;
1485}
1486/* initialize clocking early to be available later in the boot */
1487core_initcall(u300_clock_init);
diff --git a/arch/arm/mach-u300/clock.h b/arch/arm/mach-u300/clock.h
new file mode 100644
index 000000000000..fc6d9ccfe7e3
--- /dev/null
+++ b/arch/arm/mach-u300/clock.h
@@ -0,0 +1,53 @@
1/*
2 * arch/arm/mach-u300/include/mach/clock.h
3 *
4 * Copyright (C) 2004 - 2005 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 * Copyright (C) 2007-2009 ST-Ericsson AB
8 * Adopted to ST-Ericsson U300 platforms by
9 * Jonas Aaberg <jonas.aberg@stericsson.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 *
15 */
16
17#ifndef __MACH_CLOCK_H
18#define __MACH_CLOCK_H
19
20#include <linux/clk.h>
21
22struct clk {
23 struct list_head node;
24 struct module *owner;
25 struct device *dev;
26 const char *name;
27 struct clk *parent;
28
29 spinlock_t lock;
30 unsigned long rate;
31 bool reset;
32 __u16 clk_val;
33 __s8 usecount;
34 __u32 res_reg;
35 __u16 res_mask;
36
37 bool hw_ctrld;
38
39 void (*recalc) (struct clk *);
40 int (*set_rate) (struct clk *, unsigned long);
41 unsigned long (*get_rate) (struct clk *);
42 unsigned long (*round_rate) (struct clk *, unsigned long);
43 void (*init) (struct clk *);
44 void (*enable) (struct clk *);
45 void (*disable) (struct clk *);
46};
47
48void u300_clock_primecells(void);
49void u300_unclock_primecells(void);
50void u300_enable_intcon_clock(void);
51void u300_enable_timer_clock(void);
52
53#endif
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
new file mode 100644
index 000000000000..89b3ccf35e1b
--- /dev/null
+++ b/arch/arm/mach-u300/core.c
@@ -0,0 +1,649 @@
1/*
2 *
3 * arch/arm/mach-u300/core.c
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Core platform support, IRQ handling and device definitions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/spinlock.h>
14#include <linux/interrupt.h>
15#include <linux/bitops.h>
16#include <linux/device.h>
17#include <linux/mm.h>
18#include <linux/termios.h>
19#include <linux/amba/bus.h>
20#include <linux/platform_device.h>
21#include <linux/gpio.h>
22
23#include <asm/types.h>
24#include <asm/setup.h>
25#include <asm/memory.h>
26#include <asm/hardware/vic.h>
27#include <asm/mach/map.h>
28#include <asm/mach/irq.h>
29
30#include <mach/hardware.h>
31#include <mach/syscon.h>
32
33#include "clock.h"
34#include "mmc.h"
35
36/*
37 * Static I/O mappings that are needed for booting the U300 platforms. The
38 * only things we need are the areas where we find the timer, syscon and
39 * intcon, since the remaining device drivers will map their own memory
40 * physical to virtual as the need arise.
41 */
42static struct map_desc u300_io_desc[] __initdata = {
43 {
44 .virtual = U300_SLOW_PER_VIRT_BASE,
45 .pfn = __phys_to_pfn(U300_SLOW_PER_PHYS_BASE),
46 .length = SZ_64K,
47 .type = MT_DEVICE,
48 },
49 {
50 .virtual = U300_AHB_PER_VIRT_BASE,
51 .pfn = __phys_to_pfn(U300_AHB_PER_PHYS_BASE),
52 .length = SZ_32K,
53 .type = MT_DEVICE,
54 },
55 {
56 .virtual = U300_FAST_PER_VIRT_BASE,
57 .pfn = __phys_to_pfn(U300_FAST_PER_PHYS_BASE),
58 .length = SZ_32K,
59 .type = MT_DEVICE,
60 },
61 {
62 .virtual = 0xffff2000, /* TCM memory */
63 .pfn = __phys_to_pfn(0xffff2000),
64 .length = SZ_16K,
65 .type = MT_DEVICE,
66 },
67
68 /*
69 * This overlaps with the IRQ vectors etc at 0xffff0000, so these
70 * may have to be moved to 0x00000000 in order to use the ROM.
71 */
72 /*
73 {
74 .virtual = U300_BOOTROM_VIRT_BASE,
75 .pfn = __phys_to_pfn(U300_BOOTROM_PHYS_BASE),
76 .length = SZ_64K,
77 .type = MT_ROM,
78 },
79 */
80};
81
82void __init u300_map_io(void)
83{
84 iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc));
85}
86
87/*
88 * Declaration of devices found on the U300 board and
89 * their respective memory locations.
90 */
91static struct amba_device uart0_device = {
92 .dev = {
93 .init_name = "uart0", /* Slow device at 0x3000 offset */
94 .platform_data = NULL,
95 },
96 .res = {
97 .start = U300_UART0_BASE,
98 .end = U300_UART0_BASE + SZ_4K - 1,
99 .flags = IORESOURCE_MEM,
100 },
101 .irq = { IRQ_U300_UART0, NO_IRQ },
102};
103
104/* The U335 have an additional UART1 on the APP CPU */
105#ifdef CONFIG_MACH_U300_BS335
106static struct amba_device uart1_device = {
107 .dev = {
108 .init_name = "uart1", /* Fast device at 0x7000 offset */
109 .platform_data = NULL,
110 },
111 .res = {
112 .start = U300_UART1_BASE,
113 .end = U300_UART1_BASE + SZ_4K - 1,
114 .flags = IORESOURCE_MEM,
115 },
116 .irq = { IRQ_U300_UART1, NO_IRQ },
117};
118#endif
119
120static struct amba_device pl172_device = {
121 .dev = {
122 .init_name = "pl172", /* AHB device at 0x4000 offset */
123 .platform_data = NULL,
124 },
125 .res = {
126 .start = U300_EMIF_CFG_BASE,
127 .end = U300_EMIF_CFG_BASE + SZ_4K - 1,
128 .flags = IORESOURCE_MEM,
129 },
130};
131
132
133/*
134 * Everything within this next ifdef deals with external devices connected to
135 * the APP SPI bus.
136 */
137static struct amba_device pl022_device = {
138 .dev = {
139 .coherent_dma_mask = ~0,
140 .init_name = "pl022", /* Fast device at 0x6000 offset */
141 },
142 .res = {
143 .start = U300_SPI_BASE,
144 .end = U300_SPI_BASE + SZ_4K - 1,
145 .flags = IORESOURCE_MEM,
146 },
147 .irq = {IRQ_U300_SPI, NO_IRQ },
148 /*
149 * This device has a DMA channel but the Linux driver does not use
150 * it currently.
151 */
152};
153
154static struct amba_device mmcsd_device = {
155 .dev = {
156 .init_name = "mmci", /* Fast device at 0x1000 offset */
157 .platform_data = NULL, /* Added later */
158 },
159 .res = {
160 .start = U300_MMCSD_BASE,
161 .end = U300_MMCSD_BASE + SZ_4K - 1,
162 .flags = IORESOURCE_MEM,
163 },
164 .irq = {IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 },
165 /*
166 * This device has a DMA channel but the Linux driver does not use
167 * it currently.
168 */
169};
170
171/*
172 * The order of device declaration may be important, since some devices
173 * have dependencies on other devices being initialized first.
174 */
175static struct amba_device *amba_devs[] __initdata = {
176 &uart0_device,
177#ifdef CONFIG_MACH_U300_BS335
178 &uart1_device,
179#endif
180 &pl022_device,
181 &pl172_device,
182 &mmcsd_device,
183};
184
185/* Here follows a list of all hw resources that the platform devices
186 * allocate. Note, clock dependencies are not included
187 */
188
189static struct resource gpio_resources[] = {
190 {
191 .start = U300_GPIO_BASE,
192 .end = (U300_GPIO_BASE + SZ_4K - 1),
193 .flags = IORESOURCE_MEM,
194 },
195 {
196 .name = "gpio0",
197 .start = IRQ_U300_GPIO_PORT0,
198 .end = IRQ_U300_GPIO_PORT0,
199 .flags = IORESOURCE_IRQ,
200 },
201 {
202 .name = "gpio1",
203 .start = IRQ_U300_GPIO_PORT1,
204 .end = IRQ_U300_GPIO_PORT1,
205 .flags = IORESOURCE_IRQ,
206 },
207 {
208 .name = "gpio2",
209 .start = IRQ_U300_GPIO_PORT2,
210 .end = IRQ_U300_GPIO_PORT2,
211 .flags = IORESOURCE_IRQ,
212 },
213#ifdef U300_COH901571_3
214 {
215 .name = "gpio3",
216 .start = IRQ_U300_GPIO_PORT3,
217 .end = IRQ_U300_GPIO_PORT3,
218 .flags = IORESOURCE_IRQ,
219 },
220 {
221 .name = "gpio4",
222 .start = IRQ_U300_GPIO_PORT4,
223 .end = IRQ_U300_GPIO_PORT4,
224 .flags = IORESOURCE_IRQ,
225 },
226#ifdef CONFIG_MACH_U300_BS335
227 {
228 .name = "gpio5",
229 .start = IRQ_U300_GPIO_PORT5,
230 .end = IRQ_U300_GPIO_PORT5,
231 .flags = IORESOURCE_IRQ,
232 },
233 {
234 .name = "gpio6",
235 .start = IRQ_U300_GPIO_PORT6,
236 .end = IRQ_U300_GPIO_PORT6,
237 .flags = IORESOURCE_IRQ,
238 },
239#endif /* CONFIG_MACH_U300_BS335 */
240#endif /* U300_COH901571_3 */
241};
242
243static struct resource keypad_resources[] = {
244 {
245 .start = U300_KEYPAD_BASE,
246 .end = U300_KEYPAD_BASE + SZ_4K - 1,
247 .flags = IORESOURCE_MEM,
248 },
249 {
250 .name = "coh901461-press",
251 .start = IRQ_U300_KEYPAD_KEYBF,
252 .end = IRQ_U300_KEYPAD_KEYBF,
253 .flags = IORESOURCE_IRQ,
254 },
255 {
256 .name = "coh901461-release",
257 .start = IRQ_U300_KEYPAD_KEYBR,
258 .end = IRQ_U300_KEYPAD_KEYBR,
259 .flags = IORESOURCE_IRQ,
260 },
261};
262
263static struct resource rtc_resources[] = {
264 {
265 .start = U300_RTC_BASE,
266 .end = U300_RTC_BASE + SZ_4K - 1,
267 .flags = IORESOURCE_MEM,
268 },
269 {
270 .start = IRQ_U300_RTC,
271 .end = IRQ_U300_RTC,
272 .flags = IORESOURCE_IRQ,
273 },
274};
275
276/*
277 * Fsmc does have IRQs: #43 and #44 (NFIF and NFIF2)
278 * but these are not yet used by the driver.
279 */
280static struct resource fsmc_resources[] = {
281 {
282 .start = U300_NAND_IF_PHYS_BASE,
283 .end = U300_NAND_IF_PHYS_BASE + SZ_4K - 1,
284 .flags = IORESOURCE_MEM,
285 },
286};
287
288static struct resource i2c0_resources[] = {
289 {
290 .start = U300_I2C0_BASE,
291 .end = U300_I2C0_BASE + SZ_4K - 1,
292 .flags = IORESOURCE_MEM,
293 },
294 {
295 .start = IRQ_U300_I2C0,
296 .end = IRQ_U300_I2C0,
297 .flags = IORESOURCE_IRQ,
298 },
299};
300
301static struct resource i2c1_resources[] = {
302 {
303 .start = U300_I2C1_BASE,
304 .end = U300_I2C1_BASE + SZ_4K - 1,
305 .flags = IORESOURCE_MEM,
306 },
307 {
308 .start = IRQ_U300_I2C1,
309 .end = IRQ_U300_I2C1,
310 .flags = IORESOURCE_IRQ,
311 },
312
313};
314
315static struct resource wdog_resources[] = {
316 {
317 .start = U300_WDOG_BASE,
318 .end = U300_WDOG_BASE + SZ_4K - 1,
319 .flags = IORESOURCE_MEM,
320 },
321 {
322 .start = IRQ_U300_WDOG,
323 .end = IRQ_U300_WDOG,
324 .flags = IORESOURCE_IRQ,
325 }
326};
327
328/* TODO: These should be protected by suitable #ifdef's */
329static struct resource ave_resources[] = {
330 {
331 .name = "AVE3e I/O Area",
332 .start = U300_VIDEOENC_BASE,
333 .end = U300_VIDEOENC_BASE + SZ_512K - 1,
334 .flags = IORESOURCE_MEM,
335 },
336 {
337 .name = "AVE3e IRQ0",
338 .start = IRQ_U300_VIDEO_ENC_0,
339 .end = IRQ_U300_VIDEO_ENC_0,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .name = "AVE3e IRQ1",
344 .start = IRQ_U300_VIDEO_ENC_1,
345 .end = IRQ_U300_VIDEO_ENC_1,
346 .flags = IORESOURCE_IRQ,
347 },
348 {
349 .name = "AVE3e Physmem Area",
350 .start = 0, /* 0 will be remapped to reserved memory */
351 .end = SZ_1M - 1,
352 .flags = IORESOURCE_MEM,
353 },
354 /*
355 * The AVE3e requires two regions of 256MB that it considers
356 * "invisible". The hardware will not be able to access these
357 * adresses, so they should never point to system RAM.
358 */
359 {
360 .name = "AVE3e Reserved 0",
361 .start = 0xd0000000,
362 .end = 0xd0000000 + SZ_256M - 1,
363 .flags = IORESOURCE_MEM,
364 },
365 {
366 .name = "AVE3e Reserved 1",
367 .start = 0xe0000000,
368 .end = 0xe0000000 + SZ_256M - 1,
369 .flags = IORESOURCE_MEM,
370 },
371};
372
373static struct platform_device wdog_device = {
374 .name = "wdog",
375 .id = -1,
376 .num_resources = ARRAY_SIZE(wdog_resources),
377 .resource = wdog_resources,
378};
379
380static struct platform_device i2c0_device = {
381 .name = "stddci2c",
382 .id = 0,
383 .num_resources = ARRAY_SIZE(i2c0_resources),
384 .resource = i2c0_resources,
385};
386
387static struct platform_device i2c1_device = {
388 .name = "stddci2c",
389 .id = 1,
390 .num_resources = ARRAY_SIZE(i2c1_resources),
391 .resource = i2c1_resources,
392};
393
394static struct platform_device gpio_device = {
395 .name = "u300-gpio",
396 .id = -1,
397 .num_resources = ARRAY_SIZE(gpio_resources),
398 .resource = gpio_resources,
399};
400
401static struct platform_device keypad_device = {
402 .name = "keypad",
403 .id = -1,
404 .num_resources = ARRAY_SIZE(keypad_resources),
405 .resource = keypad_resources,
406};
407
408static struct platform_device rtc_device = {
409 .name = "rtc0",
410 .id = -1,
411 .num_resources = ARRAY_SIZE(rtc_resources),
412 .resource = rtc_resources,
413};
414
415static struct platform_device fsmc_device = {
416 .name = "nandif",
417 .id = -1,
418 .num_resources = ARRAY_SIZE(fsmc_resources),
419 .resource = fsmc_resources,
420};
421
422static struct platform_device ave_device = {
423 .name = "video_enc",
424 .id = -1,
425 .num_resources = ARRAY_SIZE(ave_resources),
426 .resource = ave_resources,
427};
428
429/*
430 * Notice that AMBA devices are initialized before platform devices.
431 *
432 */
433static struct platform_device *platform_devs[] __initdata = {
434 &i2c0_device,
435 &i2c1_device,
436 &keypad_device,
437 &rtc_device,
438 &gpio_device,
439 &fsmc_device,
440 &wdog_device,
441 &ave_device
442};
443
444
445/*
446 * Interrupts: the U300 platforms have two pl190 ARM PrimeCells connected
447 * together so some interrupts are connected to the first one and some
448 * to the second one.
449 */
450void __init u300_init_irq(void)
451{
452 u32 mask[2] = {0, 0};
453 int i;
454
455 for (i = 0; i < NR_IRQS; i++)
456 set_bit(i, (unsigned long *) &mask[0]);
457 u300_enable_intcon_clock();
458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], 0);
459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], 0);
460}
461
462
463/*
464 * U300 platforms peripheral handling
465 */
466struct db_chip {
467 u16 chipid;
468 const char *name;
469};
470
471/*
472 * This is a list of the Digital Baseband chips used in the U300 platform.
473 */
474static struct db_chip db_chips[] __initdata = {
475 {
476 .chipid = 0xb800,
477 .name = "DB3000",
478 },
479 {
480 .chipid = 0xc000,
481 .name = "DB3100",
482 },
483 {
484 .chipid = 0xc800,
485 .name = "DB3150",
486 },
487 {
488 .chipid = 0xd800,
489 .name = "DB3200",
490 },
491 {
492 .chipid = 0xe000,
493 .name = "DB3250",
494 },
495 {
496 .chipid = 0xe800,
497 .name = "DB3210",
498 },
499 {
500 .chipid = 0xf000,
501 .name = "DB3350 P1x",
502 },
503 {
504 .chipid = 0xf100,
505 .name = "DB3350 P2x",
506 },
507 {
508 .chipid = 0x0000, /* List terminator */
509 .name = NULL,
510 }
511};
512
513static void u300_init_check_chip(void)
514{
515
516 u16 val;
517 struct db_chip *chip;
518 const char *chipname;
519 const char unknown[] = "UNKNOWN";
520
521 /* Read out and print chip ID */
522 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CIDR);
523 /* This is in funky bigendian order... */
524 val = (val & 0xFFU) << 8 | (val >> 8);
525 chip = db_chips;
526 chipname = unknown;
527
528 for ( ; chip->chipid; chip++) {
529 if (chip->chipid == (val & 0xFF00U)) {
530 chipname = chip->name;
531 break;
532 }
533 }
534 printk(KERN_INFO "Initializing U300 system on %s baseband chip " \
535 "(chip ID 0x%04x)\n", chipname, val);
536
537#ifdef CONFIG_MACH_U300_BS26
538 if ((val & 0xFF00U) != 0xc800) {
539 printk(KERN_ERR "Platform configured for BS25/BS26 " \
540 "with DB3150 but %s detected, expect problems!",
541 chipname);
542 }
543#endif
544#ifdef CONFIG_MACH_U300_BS330
545 if ((val & 0xFF00U) != 0xd800) {
546 printk(KERN_ERR "Platform configured for BS330 " \
547 "with DB3200 but %s detected, expect problems!",
548 chipname);
549 }
550#endif
551#ifdef CONFIG_MACH_U300_BS335
552 if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) {
553 printk(KERN_ERR "Platform configured for BS365 " \
554 " with DB3350 but %s detected, expect problems!",
555 chipname);
556 }
557#endif
558#ifdef CONFIG_MACH_U300_BS365
559 if ((val & 0xFF00U) != 0xe800) {
560 printk(KERN_ERR "Platform configured for BS365 " \
561 "with DB3210 but %s detected, expect problems!",
562 chipname);
563 }
564#endif
565
566
567}
568
569/*
570 * Some devices and their resources require reserved physical memory from
571 * the end of the available RAM. This function traverses the list of devices
572 * and assigns actual adresses to these.
573 */
574static void __init u300_assign_physmem(void)
575{
576 unsigned long curr_start = __pa(high_memory);
577 int i, j;
578
579 for (i = 0; i < ARRAY_SIZE(platform_devs); i++) {
580 for (j = 0; j < platform_devs[i]->num_resources; j++) {
581 struct resource *const res =
582 &platform_devs[i]->resource[j];
583
584 if (IORESOURCE_MEM == res->flags &&
585 0 == res->start) {
586 res->start = curr_start;
587 res->end += curr_start;
588 curr_start += (res->end - res->start + 1);
589
590 printk(KERN_INFO "core.c: Mapping RAM " \
591 "%#x-%#x to device %s:%s\n",
592 res->start, res->end,
593 platform_devs[i]->name, res->name);
594 }
595 }
596 }
597}
598
599void __init u300_init_devices(void)
600{
601 int i;
602 u16 val;
603
604 /* Check what platform we run and print some status information */
605 u300_init_check_chip();
606
607 /* Set system to run at PLL208, max performance, a known state. */
608 val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
609 val &= ~U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK;
610 writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
611 /* Wait for the PLL208 to lock if not locked in yet */
612 while (!(readw(U300_SYSCON_VBASE + U300_SYSCON_CSR) &
613 U300_SYSCON_CSR_PLL208_LOCK_IND));
614
615 /* Register the AMBA devices in the AMBA bus abstraction layer */
616 u300_clock_primecells();
617 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
618 struct amba_device *d = amba_devs[i];
619 amba_device_register(d, &iomem_resource);
620 }
621 u300_unclock_primecells();
622
623 u300_assign_physmem();
624
625 /* Register the platform devices */
626 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
627
628#ifndef CONFIG_MACH_U300_SEMI_IS_SHARED
629 /*
630 * Enable SEMI self refresh. Self-refresh of the SDRAM is entered when
631 * both subsystems are requesting this mode.
632 * If we not share the Acc SDRAM, this is never the case. Therefore
633 * enable it here from the App side.
634 */
635 val = readw(U300_SYSCON_VBASE + U300_SYSCON_SMCR) |
636 U300_SYSCON_SMCR_SEMI_SREFREQ_ENABLE;
637 writew(val, U300_SYSCON_VBASE + U300_SYSCON_SMCR);
638#endif /* CONFIG_MACH_U300_SEMI_IS_SHARED */
639}
640
641static int core_module_init(void)
642{
643 /*
644 * This needs to be initialized later: it needs the input framework
645 * to be initialized first.
646 */
647 return mmc_init(&mmcsd_device);
648}
649module_init(core_module_init);
diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c
new file mode 100644
index 000000000000..308cdb197a92
--- /dev/null
+++ b/arch/arm/mach-u300/gpio.c
@@ -0,0 +1,703 @@
1/*
2 *
3 * arch/arm/mach-u300/gpio.c
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * U300 GPIO module.
9 * This can driver either of the two basic GPIO cores
10 * available in the U300 platforms:
11 * COH 901 335 - Used in DB3150 (U300 1.0) and DB3200 (U330 1.0)
12 * COH 901 571/3 - Used in DB3210 (U365 2.0) and DB3350 (U335 1.0)
13 * Notice that you also have inline macros in <asm-arch/gpio.h>
14 * Author: Linus Walleij <linus.walleij@stericsson.com>
15 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
16 *
17 */
18#include <linux/module.h>
19#include <linux/interrupt.h>
20#include <linux/delay.h>
21#include <linux/errno.h>
22#include <linux/io.h>
23#include <linux/clk.h>
24#include <linux/err.h>
25#include <linux/platform_device.h>
26#include <linux/gpio.h>
27
28/* Need access to SYSCON registers for PADmuxing */
29#include <mach/syscon.h>
30
31#include "padmux.h"
32
33/* Reference to GPIO block clock */
34static struct clk *clk;
35
36/* Memory resource */
37static struct resource *memres;
38static void __iomem *virtbase;
39static struct device *gpiodev;
40
41struct u300_gpio_port {
42 const char *name;
43 int irq;
44 int number;
45};
46
47
48static struct u300_gpio_port gpio_ports[] = {
49 {
50 .name = "gpio0",
51 .number = 0,
52 },
53 {
54 .name = "gpio1",
55 .number = 1,
56 },
57 {
58 .name = "gpio2",
59 .number = 2,
60 },
61#ifdef U300_COH901571_3
62 {
63 .name = "gpio3",
64 .number = 3,
65 },
66 {
67 .name = "gpio4",
68 .number = 4,
69 },
70#ifdef CONFIG_MACH_U300_BS335
71 {
72 .name = "gpio5",
73 .number = 5,
74 },
75 {
76 .name = "gpio6",
77 .number = 6,
78 },
79#endif
80#endif
81
82};
83
84
85#ifdef U300_COH901571_3
86
87/* Default input value */
88#define DEFAULT_OUTPUT_LOW 0
89#define DEFAULT_OUTPUT_HIGH 1
90
91/* GPIO Pull-Up status */
92#define DISABLE_PULL_UP 0
93#define ENABLE_PULL_UP 1
94
95#define GPIO_NOT_USED 0
96#define GPIO_IN 1
97#define GPIO_OUT 2
98
99struct u300_gpio_configuration_data {
100 unsigned char pin_usage;
101 unsigned char default_output_value;
102 unsigned char pull_up;
103};
104
105/* Initial configuration */
106const struct u300_gpio_configuration_data
107u300_gpio_config[U300_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
108#ifdef CONFIG_MACH_U300_BS335
109 /* Port 0, pins 0-7 */
110 {
111 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
112 {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP},
113 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
114 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
115 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
116 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
117 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
118 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
119 },
120 /* Port 1, pins 0-7 */
121 {
122 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
123 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
124 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
125 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
126 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
127 {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP},
128 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
129 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
130 },
131 /* Port 2, pins 0-7 */
132 {
133 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
134 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
135 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
136 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
137 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
138 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
139 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
140 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}
141 },
142 /* Port 3, pins 0-7 */
143 {
144 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
145 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
146 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
147 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
148 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
149 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
150 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
151 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
152 },
153 /* Port 4, pins 0-7 */
154 {
155 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
156 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
157 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
158 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
159 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
160 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
161 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
162 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
163 },
164 /* Port 5, pins 0-7 */
165 {
166 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
167 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
168 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
169 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
170 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
171 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
172 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
173 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
174 },
175 /* Port 6, pind 0-7 */
176 {
177 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
178 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
179 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
180 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
181 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
182 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
183 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
184 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
185 }
186#endif
187
188#ifdef CONFIG_MACH_U300_BS365
189 /* Port 0, pins 0-7 */
190 {
191 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
192 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
193 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
194 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
195 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
196 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
197 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
198 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
199 },
200 /* Port 1, pins 0-7 */
201 {
202 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
203 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
204 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
205 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
206 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
207 {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP},
208 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
209 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
210 },
211 /* Port 2, pins 0-7 */
212 {
213 {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
214 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
215 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
216 {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
217 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
218 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
219 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
220 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}
221 },
222 /* Port 3, pins 0-7 */
223 {
224 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
225 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
226 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
227 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
228 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
229 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
230 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
231 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}
232 },
233 /* Port 4, pins 0-7 */
234 {
235 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
236 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
237 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
238 {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
239 /* These 4 pins doesn't exist on DB3210 */
240 {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
241 {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
242 {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
243 {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}
244 }
245#endif
246};
247#endif
248
249
250/* No users == we can power down GPIO */
251static int gpio_users;
252
253struct gpio_struct {
254 int (*callback)(void *);
255 void *data;
256 int users;
257};
258
259static struct gpio_struct gpio_pin[U300_GPIO_MAX];
260
261/*
262 * Let drivers register callback in order to get notified when there is
263 * an interrupt on the gpio pin
264 */
265int gpio_register_callback(unsigned gpio, int (*func)(void *arg), void *data)
266{
267 if (gpio_pin[gpio].callback)
268 dev_warn(gpiodev, "%s: WARNING: callback already "
269 "registered for gpio pin#%d\n", __func__, gpio);
270 gpio_pin[gpio].callback = func;
271 gpio_pin[gpio].data = data;
272
273 return 0;
274}
275EXPORT_SYMBOL(gpio_register_callback);
276
277int gpio_unregister_callback(unsigned gpio)
278{
279 if (!gpio_pin[gpio].callback)
280 dev_warn(gpiodev, "%s: WARNING: callback already "
281 "unregistered for gpio pin#%d\n", __func__, gpio);
282 gpio_pin[gpio].callback = NULL;
283 gpio_pin[gpio].data = NULL;
284
285 return 0;
286}
287EXPORT_SYMBOL(gpio_unregister_callback);
288
289int gpio_request(unsigned gpio, const char *label)
290{
291 if (gpio_pin[gpio].users)
292 return -EINVAL;
293 else
294 gpio_pin[gpio].users++;
295
296 gpio_users++;
297
298 return 0;
299}
300EXPORT_SYMBOL(gpio_request);
301
302void gpio_free(unsigned gpio)
303{
304 gpio_users--;
305 gpio_pin[gpio].users--;
306 if (unlikely(gpio_pin[gpio].users < 0)) {
307 dev_warn(gpiodev, "warning: gpio#%d release mismatch\n",
308 gpio);
309 gpio_pin[gpio].users = 0;
310 }
311
312 return;
313}
314EXPORT_SYMBOL(gpio_free);
315
316/* This returns zero or nonzero */
317int gpio_get_value(unsigned gpio)
318{
319 return readl(virtbase + U300_GPIO_PXPDIR +
320 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING) & (1 << (gpio & 0x07));
321}
322EXPORT_SYMBOL(gpio_get_value);
323
324/*
325 * We hope that the compiler will optimize away the unused branch
326 * in case "value" is a constant
327 */
328void gpio_set_value(unsigned gpio, int value)
329{
330 u32 val;
331 unsigned long flags;
332
333 local_irq_save(flags);
334 if (value) {
335 /* set */
336 val = readl(virtbase + U300_GPIO_PXPDOR +
337 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING)
338 & (1 << (gpio & 0x07));
339 writel(val | (1 << (gpio & 0x07)), virtbase +
340 U300_GPIO_PXPDOR +
341 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING);
342 } else {
343 /* clear */
344 val = readl(virtbase + U300_GPIO_PXPDOR +
345 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING)
346 & (1 << (gpio & 0x07));
347 writel(val & ~(1 << (gpio & 0x07)), virtbase +
348 U300_GPIO_PXPDOR +
349 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING);
350 }
351 local_irq_restore(flags);
352}
353EXPORT_SYMBOL(gpio_set_value);
354
355int gpio_direction_input(unsigned gpio)
356{
357 unsigned long flags;
358 u32 val;
359
360 if (gpio > U300_GPIO_MAX)
361 return -EINVAL;
362
363 local_irq_save(flags);
364 val = readl(virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) *
365 U300_GPIO_PORTX_SPACING);
366 /* Mask out this pin*/
367 val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << ((gpio & 0x07) << 1));
368 /* This is not needed since it sets the bits to zero.*/
369 /* val |= (U300_GPIO_PXPCR_PIN_MODE_INPUT << (gpio*2)); */
370 writel(val, virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) *
371 U300_GPIO_PORTX_SPACING);
372 local_irq_restore(flags);
373 return 0;
374}
375EXPORT_SYMBOL(gpio_direction_input);
376
377int gpio_direction_output(unsigned gpio, int value)
378{
379 unsigned long flags;
380 u32 val;
381
382 if (gpio > U300_GPIO_MAX)
383 return -EINVAL;
384
385 local_irq_save(flags);
386 val = readl(virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) *
387 U300_GPIO_PORTX_SPACING);
388 /* Mask out this pin */
389 val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << ((gpio & 0x07) << 1));
390 /*
391 * FIXME: configure for push/pull, open drain or open source per pin
392 * in setup. The current driver will only support push/pull.
393 */
394 val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL
395 << ((gpio & 0x07) << 1));
396 writel(val, virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) *
397 U300_GPIO_PORTX_SPACING);
398 gpio_set_value(gpio, value);
399 local_irq_restore(flags);
400 return 0;
401}
402EXPORT_SYMBOL(gpio_direction_output);
403
404/*
405 * Enable an IRQ, edge is rising edge (!= 0) or falling edge (==0).
406 */
407void enable_irq_on_gpio_pin(unsigned gpio, int edge)
408{
409 u32 val;
410 unsigned long flags;
411 local_irq_save(flags);
412
413 val = readl(virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) *
414 U300_GPIO_PORTX_SPACING);
415 val |= (1 << (gpio & 0x07));
416 writel(val, virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) *
417 U300_GPIO_PORTX_SPACING);
418 val = readl(virtbase + U300_GPIO_PXICR + PIN_TO_PORT(gpio) *
419 U300_GPIO_PORTX_SPACING);
420 if (edge)
421 val |= (1 << (gpio & 0x07));
422 else
423 val &= ~(1 << (gpio & 0x07));
424 writel(val, virtbase + U300_GPIO_PXICR + PIN_TO_PORT(gpio) *
425 U300_GPIO_PORTX_SPACING);
426 local_irq_restore(flags);
427}
428EXPORT_SYMBOL(enable_irq_on_gpio_pin);
429
430void disable_irq_on_gpio_pin(unsigned gpio)
431{
432 u32 val;
433 unsigned long flags;
434
435 local_irq_save(flags);
436 val = readl(virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) *
437 U300_GPIO_PORTX_SPACING);
438 val &= ~(1 << (gpio & 0x07));
439 writel(val, virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) *
440 U300_GPIO_PORTX_SPACING);
441 local_irq_restore(flags);
442}
443EXPORT_SYMBOL(disable_irq_on_gpio_pin);
444
445/* Enable (value == 0) or disable (value == 1) internal pullup */
446void gpio_pullup(unsigned gpio, int value)
447{
448 u32 val;
449 unsigned long flags;
450
451 local_irq_save(flags);
452 if (value) {
453 val = readl(virtbase + U300_GPIO_PXPER + PIN_TO_PORT(gpio) *
454 U300_GPIO_PORTX_SPACING);
455 writel(val | (1 << (gpio & 0x07)), virtbase + U300_GPIO_PXPER +
456 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING);
457 } else {
458 val = readl(virtbase + U300_GPIO_PXPER + PIN_TO_PORT(gpio) *
459 U300_GPIO_PORTX_SPACING);
460 writel(val & ~(1 << (gpio & 0x07)), virtbase + U300_GPIO_PXPER +
461 PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING);
462 }
463 local_irq_restore(flags);
464}
465EXPORT_SYMBOL(gpio_pullup);
466
467static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
468{
469 struct u300_gpio_port *port = dev_id;
470 u32 val;
471 int pin;
472
473 /* Read event register */
474 val = readl(virtbase + U300_GPIO_PXIEV + port->number *
475 U300_GPIO_PORTX_SPACING);
476 /* Mask with enable register */
477 val &= readl(virtbase + U300_GPIO_PXIEV + port->number *
478 U300_GPIO_PORTX_SPACING);
479 /* Mask relevant bits */
480 val &= U300_GPIO_PXIEV_ALL_IRQ_EVENT_MASK;
481 /* ACK IRQ (clear event) */
482 writel(val, virtbase + U300_GPIO_PXIEV + port->number *
483 U300_GPIO_PORTX_SPACING);
484 /* Print message */
485 while (val != 0) {
486 unsigned gpio;
487
488 pin = __ffs(val);
489 /* mask off this pin */
490 val &= ~(1 << pin);
491 gpio = (port->number << 3) + pin;
492
493 if (gpio_pin[gpio].callback)
494 (void)gpio_pin[gpio].callback(gpio_pin[gpio].data);
495 else
496 dev_dbg(gpiodev, "stray GPIO IRQ on line %d\n",
497 gpio);
498 }
499 return IRQ_HANDLED;
500}
501
502static void gpio_set_initial_values(void)
503{
504#ifdef U300_COH901571_3
505 int i, j;
506 unsigned long flags;
507 u32 val;
508
509 /* Write default values to all pins */
510 for (i = 0; i < U300_GPIO_NUM_PORTS; i++) {
511 val = 0;
512 for (j = 0; j < 8; j++)
513 val |= (u32) (u300_gpio_config[i][j].default_output_value != DEFAULT_OUTPUT_LOW) << j;
514 local_irq_save(flags);
515 writel(val, virtbase + U300_GPIO_PXPDOR + i * U300_GPIO_PORTX_SPACING);
516 local_irq_restore(flags);
517 }
518
519 /*
520 * Put all pins that are set to either 'GPIO_OUT' or 'GPIO_NOT_USED'
521 * to output and 'GPIO_IN' to input for each port. And initalize
522 * default value on outputs.
523 */
524 for (i = 0; i < U300_GPIO_NUM_PORTS; i++) {
525 for (j = 0; j < U300_GPIO_PINS_PER_PORT; j++) {
526 local_irq_save(flags);
527 val = readl(virtbase + U300_GPIO_PXPCR +
528 i * U300_GPIO_PORTX_SPACING);
529 /* Mask out this pin */
530 val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << (j << 1));
531
532 if (u300_gpio_config[i][j].pin_usage != GPIO_IN)
533 val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL << (j << 1));
534 writel(val, virtbase + U300_GPIO_PXPCR +
535 i * U300_GPIO_PORTX_SPACING);
536 local_irq_restore(flags);
537 }
538 }
539
540 /* Enable or disable the internal pull-ups in the GPIO ASIC block */
541 for (i = 0; i < U300_GPIO_MAX; i++) {
542 val = 0;
543 for (j = 0; j < 8; j++)
544 val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP)) << j;
545 local_irq_save(flags);
546 writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING);
547 local_irq_restore(flags);
548 }
549#endif
550}
551
552static int __init gpio_probe(struct platform_device *pdev)
553{
554 u32 val;
555 int err = 0;
556 int i;
557 int num_irqs;
558
559 gpiodev = &pdev->dev;
560 memset(gpio_pin, 0, sizeof(gpio_pin));
561
562 /* Get GPIO clock */
563 clk = clk_get(&pdev->dev, NULL);
564 if (IS_ERR(clk)) {
565 err = PTR_ERR(clk);
566 dev_err(gpiodev, "could not get GPIO clock\n");
567 goto err_no_clk;
568 }
569 err = clk_enable(clk);
570 if (err) {
571 dev_err(gpiodev, "could not enable GPIO clock\n");
572 goto err_no_clk_enable;
573 }
574
575 memres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
576 if (!memres)
577 goto err_no_resource;
578
579 if (request_mem_region(memres->start, memres->end - memres->start, "GPIO Controller")
580 == NULL) {
581 err = -ENODEV;
582 goto err_no_ioregion;
583 }
584
585 virtbase = ioremap(memres->start, resource_size(memres));
586 if (!virtbase) {
587 err = -ENOMEM;
588 goto err_no_ioremap;
589 }
590 dev_info(gpiodev, "remapped 0x%08x to %p\n",
591 memres->start, virtbase);
592
593#ifdef U300_COH901335
594 dev_info(gpiodev, "initializing GPIO Controller COH 901 335\n");
595 /* Turn on the GPIO block */
596 writel(U300_GPIO_CR_BLOCK_CLOCK_ENABLE, virtbase + U300_GPIO_CR);
597#endif
598
599#ifdef U300_COH901571_3
600 dev_info(gpiodev, "initializing GPIO Controller COH 901 571/3\n");
601 val = readl(virtbase + U300_GPIO_CR);
602 dev_info(gpiodev, "COH901571/3 block version: %d, " \
603 "number of cores: %d\n",
604 ((val & 0x0000FE00) >> 9),
605 ((val & 0x000001FC) >> 2));
606 writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE, virtbase + U300_GPIO_CR);
607#endif
608
609 /* Set up some padmuxing here */
610#ifdef CONFIG_MMC
611 pmx_set_mission_mode_mmc();
612#endif
613#ifdef CONFIG_SPI_PL022
614 pmx_set_mission_mode_spi();
615#endif
616
617 gpio_set_initial_values();
618
619 for (num_irqs = 0 ; num_irqs < U300_GPIO_NUM_PORTS; num_irqs++) {
620
621 gpio_ports[num_irqs].irq =
622 platform_get_irq_byname(pdev,
623 gpio_ports[num_irqs].name);
624
625 err = request_irq(gpio_ports[num_irqs].irq,
626 gpio_irq_handler, IRQF_DISABLED,
627 gpio_ports[num_irqs].name,
628 &gpio_ports[num_irqs]);
629 if (err) {
630 dev_err(gpiodev, "cannot allocate IRQ for %s!\n",
631 gpio_ports[num_irqs].name);
632 goto err_no_irq;
633 }
634 /* Turns off PortX_irq_force */
635 writel(0x0, virtbase + U300_GPIO_PXIFR +
636 num_irqs * U300_GPIO_PORTX_SPACING);
637 }
638
639 return 0;
640
641 err_no_irq:
642 for (i = 0; i < num_irqs; i++)
643 free_irq(gpio_ports[i].irq, &gpio_ports[i]);
644 iounmap(virtbase);
645 err_no_ioremap:
646 release_mem_region(memres->start, memres->end - memres->start);
647 err_no_ioregion:
648 err_no_resource:
649 clk_disable(clk);
650 err_no_clk_enable:
651 clk_put(clk);
652 err_no_clk:
653 dev_info(gpiodev, "module ERROR:%d\n", err);
654 return err;
655}
656
657static int __exit gpio_remove(struct platform_device *pdev)
658{
659 int i;
660
661 /* Turn off the GPIO block */
662 writel(0x00000000U, virtbase + U300_GPIO_CR);
663 for (i = 0 ; i < U300_GPIO_NUM_PORTS; i++)
664 free_irq(gpio_ports[i].irq, &gpio_ports[i]);
665 iounmap(virtbase);
666 release_mem_region(memres->start, memres->end - memres->start);
667 clk_disable(clk);
668 clk_put(clk);
669 return 0;
670}
671
672static struct platform_driver gpio_driver = {
673 .driver = {
674 .name = "u300-gpio",
675 },
676 .remove = __exit_p(gpio_remove),
677};
678
679
680static int __init u300_gpio_init(void)
681{
682 return platform_driver_probe(&gpio_driver, gpio_probe);
683}
684
685static void __exit u300_gpio_exit(void)
686{
687 platform_driver_unregister(&gpio_driver);
688}
689
690arch_initcall(u300_gpio_init);
691module_exit(u300_gpio_exit);
692
693MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>");
694
695#ifdef U300_COH901571_3
696MODULE_DESCRIPTION("ST-Ericsson AB COH 901 571/3 GPIO driver");
697#endif
698
699#ifdef U300_COH901335
700MODULE_DESCRIPTION("ST-Ericsson AB COH 901 335 GPIO driver");
701#endif
702
703MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-u300/include/mach/clkdev.h b/arch/arm/mach-u300/include/mach/clkdev.h
new file mode 100644
index 000000000000..92e3cc872c66
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __MACH_CLKDEV_H
2#define __MACH_CLKDEV_H
3
4int __clk_get(struct clk *clk);
5void __clk_put(struct clk *clk);
6
7#endif
diff --git a/arch/arm/mach-u300/include/mach/debug-macro.S b/arch/arm/mach-u300/include/mach/debug-macro.S
new file mode 100644
index 000000000000..f3a1cbbeeab3
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/debug-macro.S
@@ -0,0 +1,22 @@
1/*
2 *
3 * arch-arm/mach-u300/include/mach/debug-macro.S
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Debugging macro include header.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <mach/hardware.h>
12
13 .macro addruart,rx
14 /* If we move the adress using MMU, use this. */
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 ldreq \rx, = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address
18 ldrne \rx, = U300_SLOW_PER_VIRT_BASE @ MMU on, virtual address
19 orr \rx, \rx, #0x00003000
20 .endm
21
22#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-u300/include/mach/entry-macro.S b/arch/arm/mach-u300/include/mach/entry-macro.S
new file mode 100644
index 000000000000..20731ae39d38
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/entry-macro.S
@@ -0,0 +1,40 @@
1/*
2 *
3 * arch-arm/mach-u300/include/mach/entry-macro.S
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Low-level IRQ helper macros for ST-Ericsson U300
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <mach/hardware.h>
12#include <asm/hardware/vic.h>
13
14 .macro disable_fiq
15 .endm
16
17 .macro get_irqnr_preamble, base, tmp
18 .endm
19
20 .macro arch_ret_to_user, tmp1, tmp2
21 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 ldr \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON0_BASE
25 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
26 mov \irqnr, #0
27 teq \irqstat, #0
28 bne 1002f
291001: ldr \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON1_BASE
30 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
31 mov \irqnr, #32
32 teq \irqstat, #0
33 beq 1003f
341002: tst \irqstat, #1
35 bne 1003f
36 add \irqnr, \irqnr, #1
37 movs \irqstat, \irqstat, lsr #1
38 bne 1002b
391003: /* EQ will be set if no irqs pending */
40 .endm
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h
new file mode 100644
index 000000000000..c8174128d7eb
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/gpio.h
@@ -0,0 +1,290 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/gpio.h
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * GPIO block resgister definitions and inline macros for
9 * U300 GPIO COH 901 335 or COH 901 571/3
10 * Author: Linus Walleij <linus.walleij@stericsson.com>
11 */
12
13#ifndef __MACH_U300_GPIO_H
14#define __MACH_U300_GPIO_H
15
16#include <linux/kernel.h>
17#include <linux/io.h>
18#include <mach/hardware.h>
19#include <asm/irq.h>
20
21/* Switch type depending on platform/chip variant */
22#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
23#define U300_COH901335
24#endif
25#if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335)
26#define U300_COH901571_3
27#endif
28
29/* Get base address for regs here */
30#include "u300-regs.h"
31/* IRQ numbers */
32#include "irqs.h"
33
34/*
35 * This is the GPIO block definitions. GPIO (General Purpose I/O) can be
36 * used for anything, and often is. The event/enable etc figures are for
37 * the lowermost pin (pin 0 on each port), shift this left to match your
38 * pin if you're gonna use these values.
39 */
40#ifdef U300_COH901335
41#define U300_GPIO_PORTX_SPACING (0x1C)
42/* Port X Pin Data Register 32bit, this is both input and output (R/W) */
43#define U300_GPIO_PXPDIR (0x00)
44#define U300_GPIO_PXPDOR (0x00)
45/* Port X Pin Config Register 32bit (R/W) */
46#define U300_GPIO_PXPCR (0x04)
47#define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL)
48#define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL)
49#define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL)
50#define U300_GPIO_PXPCR_PIN_MODE_INPUT (0x00000000UL)
51#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL)
52#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL)
53#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL)
54/* Port X Interrupt Event Register 32bit (R/W) */
55#define U300_GPIO_PXIEV (0x08)
56#define U300_GPIO_PXIEV_ALL_IRQ_EVENT_MASK (0x000000FFUL)
57#define U300_GPIO_PXIEV_IRQ_EVENT (0x00000001UL)
58/* Port X Interrupt Enable Register 32bit (R/W) */
59#define U300_GPIO_PXIEN (0x0C)
60#define U300_GPIO_PXIEN_ALL_IRQ_ENABLE_MASK (0x000000FFUL)
61#define U300_GPIO_PXIEN_IRQ_ENABLE (0x00000001UL)
62/* Port X Interrupt Force Register 32bit (R/W) */
63#define U300_GPIO_PXIFR (0x10)
64#define U300_GPIO_PXIFR_ALL_IRQ_FORCE_MASK (0x000000FFUL)
65#define U300_GPIO_PXIFR_IRQ_FORCE (0x00000001UL)
66/* Port X Interrupt Config Register 32bit (R/W) */
67#define U300_GPIO_PXICR (0x14)
68#define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL)
69#define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL)
70#define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL)
71#define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL)
72/* Port X Pull-up Enable Register 32bit (R/W) */
73#define U300_GPIO_PXPER (0x18)
74#define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL)
75#define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL)
76/* Control Register 32bit (R/W) */
77#define U300_GPIO_CR (0x54)
78#define U300_GPIO_CR_BLOCK_CLOCK_ENABLE (0x00000001UL)
79/* three ports of 8 bits each = GPIO pins 0..23 */
80#define U300_GPIO_NUM_PORTS 3
81#define U300_GPIO_PINS_PER_PORT 8
82#define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * U300_GPIO_NUM_PORTS - 1)
83#endif
84
85#ifdef U300_COH901571_3
86/*
87 * Control Register 32bit (R/W)
88 * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores
89 * gives the number of GPIO pins.
90 * bit 8-2 (mask 0x000001FC) contains the core version ID.
91 */
92#define U300_GPIO_CR (0x00)
93#define U300_GPIO_CR_SYNC_SEL_ENABLE (0x00000002UL)
94#define U300_GPIO_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL)
95#define U300_GPIO_PORTX_SPACING (0x30)
96/* Port X Pin Data INPUT Register 32bit (R/W) */
97#define U300_GPIO_PXPDIR (0x04)
98/* Port X Pin Data OUTPUT Register 32bit (R/W) */
99#define U300_GPIO_PXPDOR (0x08)
100/* Port X Pin Config Register 32bit (R/W) */
101#define U300_GPIO_PXPCR (0x0C)
102#define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL)
103#define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL)
104#define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL)
105#define U300_GPIO_PXPCR_PIN_MODE_INPUT (0x00000000UL)
106#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL)
107#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL)
108#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL)
109/* Port X Pull-up Enable Register 32bit (R/W) */
110#define U300_GPIO_PXPER (0x10)
111#define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL)
112#define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL)
113/* Port X Interrupt Event Register 32bit (R/W) */
114#define U300_GPIO_PXIEV (0x14)
115#define U300_GPIO_PXIEV_ALL_IRQ_EVENT_MASK (0x000000FFUL)
116#define U300_GPIO_PXIEV_IRQ_EVENT (0x00000001UL)
117/* Port X Interrupt Enable Register 32bit (R/W) */
118#define U300_GPIO_PXIEN (0x18)
119#define U300_GPIO_PXIEN_ALL_IRQ_ENABLE_MASK (0x000000FFUL)
120#define U300_GPIO_PXIEN_IRQ_ENABLE (0x00000001UL)
121/* Port X Interrupt Force Register 32bit (R/W) */
122#define U300_GPIO_PXIFR (0x1C)
123#define U300_GPIO_PXIFR_ALL_IRQ_FORCE_MASK (0x000000FFUL)
124#define U300_GPIO_PXIFR_IRQ_FORCE (0x00000001UL)
125/* Port X Interrupt Config Register 32bit (R/W) */
126#define U300_GPIO_PXICR (0x20)
127#define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL)
128#define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL)
129#define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL)
130#define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL)
131#ifdef CONFIG_MACH_U300_BS335
132/* seven ports of 8 bits each = GPIO pins 0..55 */
133#define U300_GPIO_NUM_PORTS 7
134#else
135/* five ports of 8 bits each = GPIO pins 0..39 */
136#define U300_GPIO_NUM_PORTS 5
137#endif
138#define U300_GPIO_PINS_PER_PORT 8
139#define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * U300_GPIO_NUM_PORTS - 1)
140#endif
141
142/*
143 * Individual pin assignments for the B26/S26. Notice that the
144 * actual usage of these pins depends on the PAD MUX settings, that
145 * is why the same number can potentially appear several times.
146 * In the reference design each pin is only used for one purpose.
147 * These were determined by inspecting the B26/S26 schematic:
148 * 2/1911-ROA 128 1603
149 */
150#ifdef CONFIG_MACH_U300_BS2X
151#define U300_GPIO_PIN_UART_RX 0
152#define U300_GPIO_PIN_UART_TX 1
153#define U300_GPIO_PIN_GPIO02 2 /* Unrouted */
154#define U300_GPIO_PIN_GPIO03 3 /* Unrouted */
155#define U300_GPIO_PIN_CAM_SLEEP 4
156#define U300_GPIO_PIN_CAM_REG_EN 5
157#define U300_GPIO_PIN_GPIO06 6 /* Unrouted */
158#define U300_GPIO_PIN_GPIO07 7 /* Unrouted */
159
160#define U300_GPIO_PIN_GPIO08 8 /* Service point SP2321 */
161#define U300_GPIO_PIN_GPIO09 9 /* Service point SP2322 */
162#define U300_GPIO_PIN_PHFSENSE 10 /* Headphone jack sensing */
163#define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */
164#define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */
165#define U300_GPIO_PIN_FLIPSENSE 13 /* Mechanical flip sensing */
166#define U300_GPIO_PIN_GPIO14 14 /* DSP JTAG Port RTCK */
167#define U300_GPIO_PIN_GPIO15 15 /* Unrouted */
168
169#define U300_GPIO_PIN_GPIO16 16 /* Unrouted */
170#define U300_GPIO_PIN_GPIO17 17 /* Unrouted */
171#define U300_GPIO_PIN_GPIO18 18 /* Unrouted */
172#define U300_GPIO_PIN_GPIO19 19 /* Unrouted */
173#define U300_GPIO_PIN_GPIO20 20 /* Unrouted */
174#define U300_GPIO_PIN_GPIO21 21 /* Unrouted */
175#define U300_GPIO_PIN_GPIO22 22 /* Unrouted */
176#define U300_GPIO_PIN_GPIO23 23 /* Unrouted */
177#endif
178
179/*
180 * Individual pin assignments for the B330/S330 and B365/S365.
181 * Notice that the actual usage of these pins depends on the
182 * PAD MUX settings, that is why the same number can potentially
183 * appear several times. In the reference design each pin is only
184 * used for one purpose. These were determined by inspecting the
185 * S365 schematic.
186 */
187#if defined(CONFIG_MACH_U300_BS330) || defined(CONFIG_MACH_U300_BS365) || \
188 defined(CONFIG_MACH_U300_BS335)
189#define U300_GPIO_PIN_UART_RX 0
190#define U300_GPIO_PIN_UART_TX 1
191#define U300_GPIO_PIN_UART_CTS 2
192#define U300_GPIO_PIN_UART_RTS 3
193#define U300_GPIO_PIN_CAM_MAIN_STANDBY 4 /* Camera MAIN standby */
194#define U300_GPIO_PIN_GPIO05 5 /* Unrouted */
195#define U300_GPIO_PIN_MS_CD 6 /* Memory Stick Card insertion */
196#define U300_GPIO_PIN_GPIO07 7 /* Test point TP2430 */
197
198#define U300_GPIO_PIN_GPIO08 8 /* Test point TP2437 */
199#define U300_GPIO_PIN_GPIO09 9 /* Test point TP2431 */
200#define U300_GPIO_PIN_GPIO10 10 /* Test point TP2432 */
201#define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */
202#define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */
203#define U300_GPIO_PIN_CAM_SUB_STANDBY 13 /* Camera SUB standby */
204#define U300_GPIO_PIN_GPIO14 14 /* Test point TP2436 */
205#define U300_GPIO_PIN_GPIO15 15 /* Unrouted */
206
207#define U300_GPIO_PIN_GPIO16 16 /* Test point TP2438 */
208#define U300_GPIO_PIN_PHFSENSE 17 /* Headphone jack sensing */
209#define U300_GPIO_PIN_GPIO18 18 /* Test point TP2439 */
210#define U300_GPIO_PIN_GPIO19 19 /* Routed somewhere */
211#define U300_GPIO_PIN_GPIO20 20 /* Unrouted */
212#define U300_GPIO_PIN_GPIO21 21 /* Unrouted */
213#define U300_GPIO_PIN_GPIO22 22 /* Unrouted */
214#define U300_GPIO_PIN_GPIO23 23 /* Unrouted */
215
216#define U300_GPIO_PIN_GPIO24 24 /* Unrouted */
217#define U300_GPIO_PIN_GPIO25 25 /* Unrouted */
218#define U300_GPIO_PIN_GPIO26 26 /* Unrouted */
219#define U300_GPIO_PIN_GPIO27 27 /* Unrouted */
220#define U300_GPIO_PIN_GPIO28 28 /* Unrouted */
221#define U300_GPIO_PIN_GPIO29 29 /* Unrouted */
222#define U300_GPIO_PIN_GPIO30 30 /* Unrouted */
223#define U300_GPIO_PIN_GPIO31 31 /* Unrouted */
224
225#define U300_GPIO_PIN_GPIO32 32 /* Unrouted */
226#define U300_GPIO_PIN_GPIO33 33 /* Unrouted */
227#define U300_GPIO_PIN_GPIO34 34 /* Unrouted */
228#define U300_GPIO_PIN_GPIO35 35 /* Unrouted */
229#define U300_GPIO_PIN_GPIO36 36 /* Unrouted */
230#define U300_GPIO_PIN_GPIO37 37 /* Unrouted */
231#define U300_GPIO_PIN_GPIO38 38 /* Unrouted */
232#define U300_GPIO_PIN_GPIO39 39 /* Unrouted */
233
234#ifdef CONFIG_MACH_U300_BS335
235
236#define U300_GPIO_PIN_GPIO40 40 /* Unrouted */
237#define U300_GPIO_PIN_GPIO41 41 /* Unrouted */
238#define U300_GPIO_PIN_GPIO42 42 /* Unrouted */
239#define U300_GPIO_PIN_GPIO43 43 /* Unrouted */
240#define U300_GPIO_PIN_GPIO44 44 /* Unrouted */
241#define U300_GPIO_PIN_GPIO45 45 /* Unrouted */
242#define U300_GPIO_PIN_GPIO46 46 /* Unrouted */
243#define U300_GPIO_PIN_GPIO47 47 /* Unrouted */
244
245#define U300_GPIO_PIN_GPIO48 48 /* Unrouted */
246#define U300_GPIO_PIN_GPIO49 49 /* Unrouted */
247#define U300_GPIO_PIN_GPIO50 50 /* Unrouted */
248#define U300_GPIO_PIN_GPIO51 51 /* Unrouted */
249#define U300_GPIO_PIN_GPIO52 52 /* Unrouted */
250#define U300_GPIO_PIN_GPIO53 53 /* Unrouted */
251#define U300_GPIO_PIN_GPIO54 54 /* Unrouted */
252#define U300_GPIO_PIN_GPIO55 55 /* Unrouted */
253#endif
254
255#endif
256
257/* translates a pin number to a port number */
258#define PIN_TO_PORT(val) (val >> 3)
259
260/* These can be found in arch/arm/mach-u300/gpio.c */
261extern int gpio_request(unsigned gpio, const char *label);
262extern void gpio_free(unsigned gpio);
263extern int gpio_direction_input(unsigned gpio);
264extern int gpio_direction_output(unsigned gpio, int value);
265extern int gpio_register_callback(unsigned gpio,
266 int (*func)(void *arg),
267 void *);
268extern int gpio_unregister_callback(unsigned gpio);
269extern void enable_irq_on_gpio_pin(unsigned gpio, int edge);
270extern void disable_irq_on_gpio_pin(unsigned gpio);
271extern void gpio_pullup(unsigned gpio, int value);
272extern int gpio_get_value(unsigned gpio);
273extern void gpio_set_value(unsigned gpio, int value);
274
275/* wrappers to sleep-enable the previous two functions */
276static inline unsigned gpio_to_irq(unsigned gpio)
277{
278 return PIN_TO_PORT(gpio) + IRQ_U300_GPIO_PORT0;
279}
280
281static inline unsigned irq_to_gpio(unsigned irq)
282{
283 /*
284 * FIXME: This is no 1-1 mapping at all, it points to the
285 * whole block of 8 pins.
286 */
287 return (irq - IRQ_U300_GPIO_PORT0) << 3;
288}
289
290#endif
diff --git a/arch/arm/mach-u300/include/mach/hardware.h b/arch/arm/mach-u300/include/mach/hardware.h
new file mode 100644
index 000000000000..b99d4ce0ac2b
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/hardware.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-u300/include/mach/hardware.h
3 */
4#include <asm/sizes.h>
5#include <mach/u300-regs.h>
diff --git a/arch/arm/mach-u300/include/mach/io.h b/arch/arm/mach-u300/include/mach/io.h
new file mode 100644
index 000000000000..5d6b4c13b3a0
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/io.h
@@ -0,0 +1,20 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/io.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Dummy IO map for being able to use writew()/readw(),
9 * writel()/readw() and similar accessor functions.
10 * Author: Linus Walleij <linus.walleij@stericsson.com>
11 */
12#ifndef __MACH_IO_H
13#define __MACH_IO_H
14
15#define IO_SPACE_LIMIT 0xffffffff
16
17#define __io(a) __typesafe_io(a)
18#define __mem_pci(a) (a)
19
20#endif
diff --git a/arch/arm/mach-u300/include/mach/irqs.h b/arch/arm/mach-u300/include/mach/irqs.h
new file mode 100644
index 000000000000..a6867b12773e
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/irqs.h
@@ -0,0 +1,114 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/irqs.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * IRQ channel definitions for the U300 platforms.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11
12#ifndef __MACH_IRQS_H
13#define __MACH_IRQS_H
14
15#define IRQ_U300_INTCON0_START 0
16#define IRQ_U300_INTCON1_START 32
17/* These are on INTCON0 - 30 lines */
18#define IRQ_U300_IRQ0_EXT 0
19#define IRQ_U300_IRQ1_EXT 1
20#define IRQ_U300_DMA 2
21#define IRQ_U300_VIDEO_ENC_0 3
22#define IRQ_U300_VIDEO_ENC_1 4
23#define IRQ_U300_AAIF_RX 5
24#define IRQ_U300_AAIF_TX 6
25#define IRQ_U300_AAIF_VGPIO 7
26#define IRQ_U300_AAIF_WAKEUP 8
27#define IRQ_U300_PCM_I2S0_FRAME 9
28#define IRQ_U300_PCM_I2S0_FIFO 10
29#define IRQ_U300_PCM_I2S1_FRAME 11
30#define IRQ_U300_PCM_I2S1_FIFO 12
31#define IRQ_U300_XGAM_GAMCON 13
32#define IRQ_U300_XGAM_CDI 14
33#define IRQ_U300_XGAM_CDICON 15
34#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
35/* MMIACC not used on the DB3210 or DB3350 chips */
36#define IRQ_U300_XGAM_MMIACC 16
37#endif
38#define IRQ_U300_XGAM_PDI 17
39#define IRQ_U300_XGAM_PDICON 18
40#define IRQ_U300_XGAM_GAMEACC 19
41#define IRQ_U300_XGAM_MCIDCT 20
42#define IRQ_U300_APEX 21
43#define IRQ_U300_UART0 22
44#define IRQ_U300_SPI 23
45#define IRQ_U300_TIMER_APP_OS 24
46#define IRQ_U300_TIMER_APP_DD 25
47#define IRQ_U300_TIMER_APP_GP1 26
48#define IRQ_U300_TIMER_APP_GP2 27
49#define IRQ_U300_TIMER_OS 28
50#define IRQ_U300_TIMER_MS 29
51#define IRQ_U300_KEYPAD_KEYBF 30
52#define IRQ_U300_KEYPAD_KEYBR 31
53/* These are on INTCON1 - 32 lines */
54#define IRQ_U300_GPIO_PORT0 32
55#define IRQ_U300_GPIO_PORT1 33
56#define IRQ_U300_GPIO_PORT2 34
57
58#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \
59 defined(CONFIG_MACH_U300_BS335)
60/* These are for DB3150, DB3200 and DB3350 */
61#define IRQ_U300_WDOG 35
62#define IRQ_U300_EVHIST 36
63#define IRQ_U300_MSPRO 37
64#define IRQ_U300_MMCSD_MCIINTR0 38
65#define IRQ_U300_MMCSD_MCIINTR1 39
66#define IRQ_U300_I2C0 40
67#define IRQ_U300_I2C1 41
68#define IRQ_U300_RTC 42
69#define IRQ_U300_NFIF 43
70#define IRQ_U300_NFIF2 44
71#endif
72
73/* DB3150 and DB3200 have only 45 IRQs */
74#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
75#define U300_NR_IRQS 45
76#endif
77
78/* The DB3350-specific interrupt lines */
79#ifdef CONFIG_MACH_U300_BS335
80#define IRQ_U300_ISP_F0 45
81#define IRQ_U300_ISP_F1 46
82#define IRQ_U300_ISP_F2 47
83#define IRQ_U300_ISP_F3 48
84#define IRQ_U300_ISP_F4 49
85#define IRQ_U300_GPIO_PORT3 50
86#define IRQ_U300_SYSCON_PLL_LOCK 51
87#define IRQ_U300_UART1 52
88#define IRQ_U300_GPIO_PORT4 53
89#define IRQ_U300_GPIO_PORT5 54
90#define IRQ_U300_GPIO_PORT6 55
91#define U300_NR_IRQS 56
92#endif
93
94/* The DB3210-specific interrupt lines */
95#ifdef CONFIG_MACH_U300_BS365
96#define IRQ_U300_GPIO_PORT3 35
97#define IRQ_U300_GPIO_PORT4 36
98#define IRQ_U300_WDOG 37
99#define IRQ_U300_EVHIST 38
100#define IRQ_U300_MSPRO 39
101#define IRQ_U300_MMCSD_MCIINTR0 40
102#define IRQ_U300_MMCSD_MCIINTR1 41
103#define IRQ_U300_I2C0 42
104#define IRQ_U300_I2C1 43
105#define IRQ_U300_RTC 44
106#define IRQ_U300_NFIF 45
107#define IRQ_U300_NFIF2 46
108#define IRQ_U300_SYSCON_PLL_LOCK 47
109#define U300_NR_IRQS 48
110#endif
111
112#define NR_IRQS U300_NR_IRQS
113
114#endif
diff --git a/arch/arm/mach-u300/include/mach/memory.h b/arch/arm/mach-u300/include/mach/memory.h
new file mode 100644
index 000000000000..bf134bcc129d
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/memory.h
@@ -0,0 +1,42 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/memory.h
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Memory virtual/physical mapping constants.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
11 */
12
13#ifndef __MACH_MEMORY_H
14#define __MACH_MEMORY_H
15
16#ifdef CONFIG_MACH_U300_DUAL_RAM
17
18#define PHYS_OFFSET UL(0x48000000)
19#define BOOT_PARAMS_OFFSET (PHYS_OFFSET + 0x100)
20
21#else
22
23#ifdef CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
24#define PHYS_OFFSET (0x28000000 + \
25 (CONFIG_MACH_U300_ACCESS_MEM_SIZE - \
26 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024)
27#else
28#define PHYS_OFFSET (0x28000000 + \
29 (CONFIG_MACH_U300_ACCESS_MEM_SIZE + \
30 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024)
31#endif
32#define BOOT_PARAMS_OFFSET (0x28000000 + \
33 (CONFIG_MACH_U300_ACCESS_MEM_SIZE + \
34 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024 + 0x100)
35#endif
36
37/*
38 * We enable a real big DMA buffer if need be.
39 */
40#define CONSISTENT_DMA_SIZE SZ_4M
41
42#endif
diff --git a/arch/arm/mach-u300/include/mach/platform.h b/arch/arm/mach-u300/include/mach/platform.h
new file mode 100644
index 000000000000..77d9210a82e2
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/platform.h
@@ -0,0 +1,19 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/platform.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Basic platform init and mapping functions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11
12#ifndef __ASSEMBLY__
13
14void u300_map_io(void);
15void u300_init_irq(void);
16void u300_init_devices(void);
17extern struct sys_timer u300_timer;
18
19#endif
diff --git a/arch/arm/mach-u300/include/mach/syscon.h b/arch/arm/mach-u300/include/mach/syscon.h
new file mode 100644
index 000000000000..1c90d1b1ccb6
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/syscon.h
@@ -0,0 +1,644 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/syscon.h
4 *
5 *
6 * Copyright (C) 2008 ST-Ericsson AB
7 *
8 * Author: Rickard Andersson <rickard.andersson@stericsson.com>
9 */
10
11#ifndef __MACH_SYSCON_H
12#define __MACH_SYSCON_H
13
14/*
15 * All register defines for SYSCON registers that concerns individual
16 * block clocks and reset lines are registered here. This is because
17 * we don't want any other file to try to fool around with this stuff.
18 */
19
20/* APP side SYSCON registers */
21/* TODO: this is incomplete. Add all from asic_syscon_map.h eventually. */
22/* CLK Control Register 16bit (R/W) */
23#define U300_SYSCON_CCR (0x0000)
24#define U300_SYSCON_CCR_I2S1_USE_VCXO (0x0040)
25#define U300_SYSCON_CCR_I2S0_USE_VCXO (0x0020)
26#define U300_SYSCON_CCR_TURN_VCXO_ON (0x0008)
27#define U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK (0x0007)
28#define U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER (0x04)
29#define U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW (0x03)
30#define U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE (0x02)
31#define U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH (0x01)
32#define U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST (0x00)
33/* CLK Status Register 16bit (R/W) */
34#define U300_SYSCON_CSR (0x0004)
35#define U300_SYSCON_CSR_PLL208_LOCK_IND (0x0002)
36#define U300_SYSCON_CSR_PLL13_LOCK_IND (0x0001)
37/* Reset lines for SLOW devices 16bit (R/W) */
38#define U300_SYSCON_RSR (0x0014)
39#ifdef CONFIG_MACH_U300_BS335
40#define U300_SYSCON_RSR_PPM_RESET_EN (0x0200)
41#endif
42#define U300_SYSCON_RSR_ACC_TMR_RESET_EN (0x0100)
43#define U300_SYSCON_RSR_APP_TMR_RESET_EN (0x0080)
44#define U300_SYSCON_RSR_RTC_RESET_EN (0x0040)
45#define U300_SYSCON_RSR_KEYPAD_RESET_EN (0x0020)
46#define U300_SYSCON_RSR_GPIO_RESET_EN (0x0010)
47#define U300_SYSCON_RSR_EH_RESET_EN (0x0008)
48#define U300_SYSCON_RSR_BTR_RESET_EN (0x0004)
49#define U300_SYSCON_RSR_UART_RESET_EN (0x0002)
50#define U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN (0x0001)
51/* Reset lines for FAST devices 16bit (R/W) */
52#define U300_SYSCON_RFR (0x0018)
53#ifdef CONFIG_MACH_U300_BS335
54#define U300_SYSCON_RFR_UART1_RESET_ENABLE (0x0080)
55#endif
56#define U300_SYSCON_RFR_SPI_RESET_ENABLE (0x0040)
57#define U300_SYSCON_RFR_MMC_RESET_ENABLE (0x0020)
58#define U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE (0x0010)
59#define U300_SYSCON_RFR_PCM_I2S0_RESET_ENABLE (0x0008)
60#define U300_SYSCON_RFR_I2C1_RESET_ENABLE (0x0004)
61#define U300_SYSCON_RFR_I2C0_RESET_ENABLE (0x0002)
62#define U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE (0x0001)
63/* Reset lines for the rest of the peripherals 16bit (R/W) */
64#define U300_SYSCON_RRR (0x001c)
65#ifdef CONFIG_MACH_U300_BS335
66#define U300_SYSCON_RRR_CDS_RESET_EN (0x4000)
67#define U300_SYSCON_RRR_ISP_RESET_EN (0x2000)
68#endif
69#define U300_SYSCON_RRR_INTCON_RESET_EN (0x1000)
70#define U300_SYSCON_RRR_MSPRO_RESET_EN (0x0800)
71#define U300_SYSCON_RRR_XGAM_RESET_EN (0x0100)
72#define U300_SYSCON_RRR_XGAM_VC_SYNC_RESET_EN (0x0080)
73#define U300_SYSCON_RRR_NANDIF_RESET_EN (0x0040)
74#define U300_SYSCON_RRR_EMIF_RESET_EN (0x0020)
75#define U300_SYSCON_RRR_DMAC_RESET_EN (0x0010)
76#define U300_SYSCON_RRR_CPU_RESET_EN (0x0008)
77#define U300_SYSCON_RRR_APEX_RESET_EN (0x0004)
78#define U300_SYSCON_RRR_AHB_RESET_EN (0x0002)
79#define U300_SYSCON_RRR_AAIF_RESET_EN (0x0001)
80/* Clock enable for SLOW peripherals 16bit (R/W) */
81#define U300_SYSCON_CESR (0x0020)
82#ifdef CONFIG_MACH_U300_BS335
83#define U300_SYSCON_CESR_PPM_CLK_EN (0x0200)
84#endif
85#define U300_SYSCON_CESR_ACC_TMR_CLK_EN (0x0100)
86#define U300_SYSCON_CESR_APP_TMR_CLK_EN (0x0080)
87#define U300_SYSCON_CESR_KEYPAD_CLK_EN (0x0040)
88#define U300_SYSCON_CESR_GPIO_CLK_EN (0x0010)
89#define U300_SYSCON_CESR_EH_CLK_EN (0x0008)
90#define U300_SYSCON_CESR_BTR_CLK_EN (0x0004)
91#define U300_SYSCON_CESR_UART_CLK_EN (0x0002)
92#define U300_SYSCON_CESR_SLOW_BRIDGE_CLK_EN (0x0001)
93/* Clock enable for FAST peripherals 16bit (R/W) */
94#define U300_SYSCON_CEFR (0x0024)
95#ifdef CONFIG_MACH_U300_BS335
96#define U300_SYSCON_CEFR_UART1_CLK_EN (0x0200)
97#endif
98#define U300_SYSCON_CEFR_I2S1_CORE_CLK_EN (0x0100)
99#define U300_SYSCON_CEFR_I2S0_CORE_CLK_EN (0x0080)
100#define U300_SYSCON_CEFR_SPI_CLK_EN (0x0040)
101#define U300_SYSCON_CEFR_MMC_CLK_EN (0x0020)
102#define U300_SYSCON_CEFR_I2S1_CLK_EN (0x0010)
103#define U300_SYSCON_CEFR_I2S0_CLK_EN (0x0008)
104#define U300_SYSCON_CEFR_I2C1_CLK_EN (0x0004)
105#define U300_SYSCON_CEFR_I2C0_CLK_EN (0x0002)
106#define U300_SYSCON_CEFR_FAST_BRIDGE_CLK_EN (0x0001)
107/* Clock enable for the rest of the peripherals 16bit (R/W) */
108#define U300_SYSCON_CERR (0x0028)
109#ifdef CONFIG_MACH_U300_BS335
110#define U300_SYSCON_CERR_CDS_CLK_EN (0x2000)
111#define U300_SYSCON_CERR_ISP_CLK_EN (0x1000)
112#endif
113#define U300_SYSCON_CERR_MSPRO_CLK_EN (0x0800)
114#define U300_SYSCON_CERR_AHB_SUBSYS_BRIDGE_CLK_EN (0x0400)
115#define U300_SYSCON_CERR_SEMI_CLK_EN (0x0200)
116#define U300_SYSCON_CERR_XGAM_CLK_EN (0x0100)
117#define U300_SYSCON_CERR_VIDEO_ENC_CLK_EN (0x0080)
118#define U300_SYSCON_CERR_NANDIF_CLK_EN (0x0040)
119#define U300_SYSCON_CERR_EMIF_CLK_EN (0x0020)
120#define U300_SYSCON_CERR_DMAC_CLK_EN (0x0010)
121#define U300_SYSCON_CERR_CPU_CLK_EN (0x0008)
122#define U300_SYSCON_CERR_APEX_CLK_EN (0x0004)
123#define U300_SYSCON_CERR_AHB_CLK_EN (0x0002)
124#define U300_SYSCON_CERR_AAIF_CLK_EN (0x0001)
125/* Single block clock enable 16bit (-/W) */
126#define U300_SYSCON_SBCER (0x002c)
127#ifdef CONFIG_MACH_U300_BS335
128#define U300_SYSCON_SBCER_PPM_CLK_EN (0x0009)
129#endif
130#define U300_SYSCON_SBCER_ACC_TMR_CLK_EN (0x0008)
131#define U300_SYSCON_SBCER_APP_TMR_CLK_EN (0x0007)
132#define U300_SYSCON_SBCER_KEYPAD_CLK_EN (0x0006)
133#define U300_SYSCON_SBCER_GPIO_CLK_EN (0x0004)
134#define U300_SYSCON_SBCER_EH_CLK_EN (0x0003)
135#define U300_SYSCON_SBCER_BTR_CLK_EN (0x0002)
136#define U300_SYSCON_SBCER_UART_CLK_EN (0x0001)
137#define U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN (0x0000)
138#ifdef CONFIG_MACH_U300_BS335
139#define U300_SYSCON_SBCER_UART1_CLK_EN (0x0019)
140#endif
141#define U300_SYSCON_SBCER_I2S1_CORE_CLK_EN (0x0018)
142#define U300_SYSCON_SBCER_I2S0_CORE_CLK_EN (0x0017)
143#define U300_SYSCON_SBCER_SPI_CLK_EN (0x0016)
144#define U300_SYSCON_SBCER_MMC_CLK_EN (0x0015)
145#define U300_SYSCON_SBCER_I2S1_CLK_EN (0x0014)
146#define U300_SYSCON_SBCER_I2S0_CLK_EN (0x0013)
147#define U300_SYSCON_SBCER_I2C1_CLK_EN (0x0012)
148#define U300_SYSCON_SBCER_I2C0_CLK_EN (0x0011)
149#define U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN (0x0010)
150#ifdef CONFIG_MACH_U300_BS335
151#define U300_SYSCON_SBCER_CDS_CLK_EN (0x002D)
152#define U300_SYSCON_SBCER_ISP_CLK_EN (0x002C)
153#endif
154#define U300_SYSCON_SBCER_MSPRO_CLK_EN (0x002B)
155#define U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN (0x002A)
156#define U300_SYSCON_SBCER_SEMI_CLK_EN (0x0029)
157#define U300_SYSCON_SBCER_XGAM_CLK_EN (0x0028)
158#define U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN (0x0027)
159#define U300_SYSCON_SBCER_NANDIF_CLK_EN (0x0026)
160#define U300_SYSCON_SBCER_EMIF_CLK_EN (0x0025)
161#define U300_SYSCON_SBCER_DMAC_CLK_EN (0x0024)
162#define U300_SYSCON_SBCER_CPU_CLK_EN (0x0023)
163#define U300_SYSCON_SBCER_APEX_CLK_EN (0x0022)
164#define U300_SYSCON_SBCER_AHB_CLK_EN (0x0021)
165#define U300_SYSCON_SBCER_AAIF_CLK_EN (0x0020)
166/* Single block clock disable 16bit (-/W) */
167#define U300_SYSCON_SBCDR (0x0030)
168/* Same values as above for SBCER */
169/* Clock force SLOW peripherals 16bit (R/W) */
170#define U300_SYSCON_CFSR (0x003c)
171#ifdef CONFIG_MACH_U300_BS335
172#define U300_SYSCON_CFSR_PPM_CLK_FORCE_EN (0x0200)
173#endif
174#define U300_SYSCON_CFSR_ACC_TMR_CLK_FORCE_EN (0x0100)
175#define U300_SYSCON_CFSR_APP_TMR_CLK_FORCE_EN (0x0080)
176#define U300_SYSCON_CFSR_KEYPAD_CLK_FORCE_EN (0x0020)
177#define U300_SYSCON_CFSR_GPIO_CLK_FORCE_EN (0x0010)
178#define U300_SYSCON_CFSR_EH_CLK_FORCE_EN (0x0008)
179#define U300_SYSCON_CFSR_BTR_CLK_FORCE_EN (0x0004)
180#define U300_SYSCON_CFSR_UART_CLK_FORCE_EN (0x0002)
181#define U300_SYSCON_CFSR_SLOW_BRIDGE_CLK_FORCE_EN (0x0001)
182/* Clock force FAST peripherals 16bit (R/W) */
183#define U300_SYSCON_CFFR (0x40)
184/* Values not defined. Define if you want to use them. */
185/* Clock force the rest of the peripherals 16bit (R/W) */
186#define U300_SYSCON_CFRR (0x44)
187#ifdef CONFIG_MACH_U300_BS335
188#define U300_SYSCON_CFRR_CDS_CLK_FORCE_EN (0x2000)
189#define U300_SYSCON_CFRR_ISP_CLK_FORCE_EN (0x1000)
190#endif
191#define U300_SYSCON_CFRR_MSPRO_CLK_FORCE_EN (0x0800)
192#define U300_SYSCON_CFRR_AHB_SUBSYS_BRIDGE_CLK_FORCE_EN (0x0400)
193#define U300_SYSCON_CFRR_SEMI_CLK_FORCE_EN (0x0200)
194#define U300_SYSCON_CFRR_XGAM_CLK_FORCE_EN (0x0100)
195#define U300_SYSCON_CFRR_VIDEO_ENC_CLK_FORCE_EN (0x0080)
196#define U300_SYSCON_CFRR_NANDIF_CLK_FORCE_EN (0x0040)
197#define U300_SYSCON_CFRR_EMIF_CLK_FORCE_EN (0x0020)
198#define U300_SYSCON_CFRR_DMAC_CLK_FORCE_EN (0x0010)
199#define U300_SYSCON_CFRR_CPU_CLK_FORCE_EN (0x0008)
200#define U300_SYSCON_CFRR_APEX_CLK_FORCE_EN (0x0004)
201#define U300_SYSCON_CFRR_AHB_CLK_FORCE_EN (0x0002)
202#define U300_SYSCON_CFRR_AAIF_CLK_FORCE_EN (0x0001)
203/* PLL208 Frequency Control 16bit (R/W) */
204#define U300_SYSCON_PFCR (0x48)
205#define U300_SYSCON_PFCR_DPLL_MULT_NUM (0x000F)
206/* Power Management Control 16bit (R/W) */
207#define U300_SYSCON_PMCR (0x50)
208#define U300_SYSCON_PMCR_DCON_ENABLE (0x0002)
209#define U300_SYSCON_PMCR_PWR_MGNT_ENABLE (0x0001)
210/*
211 * All other clocking registers moved to clock.c!
212 */
213/* Reset Out 16bit (R/W) */
214#define U300_SYSCON_RCR (0x6c)
215#define U300_SYSCON_RCR_RESOUT0_RST_N_DISABLE (0x0001)
216/* EMIF Slew Rate Control 16bit (R/W) */
217#define U300_SYSCON_SRCLR (0x70)
218#define U300_SYSCON_SRCLR_MASK (0x03FF)
219#define U300_SYSCON_SRCLR_VALUE (0x03FF)
220#define U300_SYSCON_SRCLR_EMIF_1_SLRC_5_B (0x0200)
221#define U300_SYSCON_SRCLR_EMIF_1_SLRC_5_A (0x0100)
222#define U300_SYSCON_SRCLR_EMIF_1_SLRC_4_B (0x0080)
223#define U300_SYSCON_SRCLR_EMIF_1_SLRC_4_A (0x0040)
224#define U300_SYSCON_SRCLR_EMIF_1_SLRC_3_B (0x0020)
225#define U300_SYSCON_SRCLR_EMIF_1_SLRC_3_A (0x0010)
226#define U300_SYSCON_SRCLR_EMIF_1_SLRC_2_B (0x0008)
227#define U300_SYSCON_SRCLR_EMIF_1_SLRC_2_A (0x0004)
228#define U300_SYSCON_SRCLR_EMIF_1_SLRC_1_B (0x0002)
229#define U300_SYSCON_SRCLR_EMIF_1_SLRC_1_A (0x0001)
230/* EMIF Clock Control Register 16bit (R/W) */
231#define U300_SYSCON_ECCR (0x0078)
232#define U300_SYSCON_ECCR_MASK (0x000F)
233#define U300_SYSCON_ECCR_EMIF_1_STATIC_CLK_EN_N_DISABLE (0x0008)
234#define U300_SYSCON_ECCR_EMIF_1_RET_OUT_CLK_EN_N_DISABLE (0x0004)
235#define U300_SYSCON_ECCR_EMIF_MEMCLK_RET_EN_N_DISABLE (0x0002)
236#define U300_SYSCON_ECCR_EMIF_SDRCLK_RET_EN_N_DISABLE (0x0001)
237/* PAD MUX Control register 1 (LOW) 16bit (R/W) */
238#define U300_SYSCON_PMC1LR (0x007C)
239#define U300_SYSCON_PMC1LR_MASK (0xFFFF)
240#define U300_SYSCON_PMC1LR_CDI_MASK (0xC000)
241#define U300_SYSCON_PMC1LR_CDI_CDI (0x0000)
242#define U300_SYSCON_PMC1LR_CDI_EMIF (0x4000)
243#define U300_SYSCON_PMC1LR_CDI_GPIO (0x8000)
244#define U300_SYSCON_PMC1LR_CDI_WCDMA (0xC000)
245#define U300_SYSCON_PMC1LR_PDI_MASK (0x3000)
246#define U300_SYSCON_PMC1LR_PDI_PDI (0x0000)
247#define U300_SYSCON_PMC1LR_PDI_EGG (0x1000)
248#define U300_SYSCON_PMC1LR_PDI_WCDMA (0x3000)
249#define U300_SYSCON_PMC1LR_MMCSD_MASK (0x0C00)
250#define U300_SYSCON_PMC1LR_MMCSD_MMCSD (0x0000)
251#define U300_SYSCON_PMC1LR_MMCSD_MSPRO (0x0400)
252#define U300_SYSCON_PMC1LR_MMCSD_DSP (0x0800)
253#define U300_SYSCON_PMC1LR_MMCSD_WCDMA (0x0C00)
254#define U300_SYSCON_PMC1LR_ETM_MASK (0x0300)
255#define U300_SYSCON_PMC1LR_ETM_ACC (0x0000)
256#define U300_SYSCON_PMC1LR_ETM_APP (0x0100)
257#define U300_SYSCON_PMC1LR_EMIF_1_CS2_MASK (0x00C0)
258#define U300_SYSCON_PMC1LR_EMIF_1_CS2_STATIC (0x0000)
259#define U300_SYSCON_PMC1LR_EMIF_1_CS2_NFIF (0x0040)
260#define U300_SYSCON_PMC1LR_EMIF_1_CS2_SDRAM (0x0080)
261#define U300_SYSCON_PMC1LR_EMIF_1_CS2_STATIC_2GB (0x00C0)
262#define U300_SYSCON_PMC1LR_EMIF_1_CS1_MASK (0x0030)
263#define U300_SYSCON_PMC1LR_EMIF_1_CS1_STATIC (0x0000)
264#define U300_SYSCON_PMC1LR_EMIF_1_CS1_NFIF (0x0010)
265#define U300_SYSCON_PMC1LR_EMIF_1_CS1_SDRAM (0x0020)
266#define U300_SYSCON_PMC1LR_EMIF_1_CS1_SEMI (0x0030)
267#define U300_SYSCON_PMC1LR_EMIF_1_CS0_MASK (0x000C)
268#define U300_SYSCON_PMC1LR_EMIF_1_CS0_STATIC (0x0000)
269#define U300_SYSCON_PMC1LR_EMIF_1_CS0_NFIF (0x0004)
270#define U300_SYSCON_PMC1LR_EMIF_1_CS0_SDRAM (0x0008)
271#define U300_SYSCON_PMC1LR_EMIF_1_CS0_SEMI (0x000C)
272#define U300_SYSCON_PMC1LR_EMIF_1_MASK (0x0003)
273#define U300_SYSCON_PMC1LR_EMIF_1_STATIC (0x0000)
274#define U300_SYSCON_PMC1LR_EMIF_1_SDRAM0 (0x0001)
275#define U300_SYSCON_PMC1LR_EMIF_1_SDRAM1 (0x0002)
276#define U300_SYSCON_PMC1LR_EMIF_1 (0x0003)
277/* PAD MUX Control register 2 (HIGH) 16bit (R/W) */
278#define U300_SYSCON_PMC1HR (0x007E)
279#define U300_SYSCON_PMC1HR_MASK (0xFFFF)
280#define U300_SYSCON_PMC1HR_MISC_2_MASK (0xC000)
281#define U300_SYSCON_PMC1HR_MISC_2_APP_GPIO (0x0000)
282#define U300_SYSCON_PMC1HR_MISC_2_MSPRO (0x4000)
283#define U300_SYSCON_PMC1HR_MISC_2_DSP (0x8000)
284#define U300_SYSCON_PMC1HR_MISC_2_AAIF (0xC000)
285#define U300_SYSCON_PMC1HR_APP_GPIO_2_MASK (0x3000)
286#define U300_SYSCON_PMC1HR_APP_GPIO_2_APP_GPIO (0x0000)
287#define U300_SYSCON_PMC1HR_APP_GPIO_2_NFIF (0x1000)
288#define U300_SYSCON_PMC1HR_APP_GPIO_2_DSP (0x2000)
289#define U300_SYSCON_PMC1HR_APP_GPIO_2_AAIF (0x3000)
290#define U300_SYSCON_PMC1HR_APP_GPIO_1_MASK (0x0C00)
291#define U300_SYSCON_PMC1HR_APP_GPIO_1_APP_GPIO (0x0000)
292#define U300_SYSCON_PMC1HR_APP_GPIO_1_MMC (0x0400)
293#define U300_SYSCON_PMC1HR_APP_GPIO_1_DSP (0x0800)
294#define U300_SYSCON_PMC1HR_APP_GPIO_1_AAIF (0x0C00)
295#define U300_SYSCON_PMC1HR_APP_SPI_CS_2_MASK (0x0300)
296#define U300_SYSCON_PMC1HR_APP_SPI_CS_2_APP_GPIO (0x0000)
297#define U300_SYSCON_PMC1HR_APP_SPI_CS_2_SPI (0x0100)
298#define U300_SYSCON_PMC1HR_APP_SPI_CS_2_AAIF (0x0300)
299#define U300_SYSCON_PMC1HR_APP_SPI_CS_1_MASK (0x00C0)
300#define U300_SYSCON_PMC1HR_APP_SPI_CS_1_APP_GPIO (0x0000)
301#define U300_SYSCON_PMC1HR_APP_SPI_CS_1_SPI (0x0040)
302#define U300_SYSCON_PMC1HR_APP_SPI_CS_1_AAIF (0x00C0)
303#define U300_SYSCON_PMC1HR_APP_SPI_2_MASK (0x0030)
304#define U300_SYSCON_PMC1HR_APP_SPI_2_APP_GPIO (0x0000)
305#define U300_SYSCON_PMC1HR_APP_SPI_2_SPI (0x0010)
306#define U300_SYSCON_PMC1HR_APP_SPI_2_DSP (0x0020)
307#define U300_SYSCON_PMC1HR_APP_SPI_2_AAIF (0x0030)
308#define U300_SYSCON_PMC1HR_APP_UART0_2_MASK (0x000C)
309#define U300_SYSCON_PMC1HR_APP_UART0_2_APP_GPIO (0x0000)
310#define U300_SYSCON_PMC1HR_APP_UART0_2_UART0 (0x0004)
311#define U300_SYSCON_PMC1HR_APP_UART0_2_NFIF_CS (0x0008)
312#define U300_SYSCON_PMC1HR_APP_UART0_2_AAIF (0x000C)
313#define U300_SYSCON_PMC1HR_APP_UART0_1_MASK (0x0003)
314#define U300_SYSCON_PMC1HR_APP_UART0_1_APP_GPIO (0x0000)
315#define U300_SYSCON_PMC1HR_APP_UART0_1_UART0 (0x0001)
316#define U300_SYSCON_PMC1HR_APP_UART0_1_AAIF (0x0003)
317/* Step one for killing the applications system 16bit (-/W) */
318#define U300_SYSCON_KA1R (0x0080)
319#define U300_SYSCON_KA1R_MASK (0xFFFF)
320#define U300_SYSCON_KA1R_VALUE (0xFFFF)
321/* Step two for killing the application system 16bit (-/W) */
322#define U300_SYSCON_KA2R (0x0084)
323#define U300_SYSCON_KA2R_MASK (0xFFFF)
324#define U300_SYSCON_KA2R_VALUE (0xFFFF)
325/* MMC/MSPRO frequency divider register 0 16bit (R/W) */
326#define U300_SYSCON_MMF0R (0x90)
327#define U300_SYSCON_MMF0R_MASK (0x00FF)
328#define U300_SYSCON_MMF0R_FREQ_0_HIGH_MASK (0x00F0)
329#define U300_SYSCON_MMF0R_FREQ_0_LOW_MASK (0x000F)
330/* MMC/MSPRO frequency divider register 1 16bit (R/W) */
331#define U300_SYSCON_MMF1R (0x94)
332#define U300_SYSCON_MMF1R_MASK (0x00FF)
333#define U300_SYSCON_MMF1R_FREQ_1_HIGH_MASK (0x00F0)
334#define U300_SYSCON_MMF1R_FREQ_1_LOW_MASK (0x000F)
335/* AAIF control register 16 bit (R/W) */
336#define U300_SYSCON_AAIFCR (0x98)
337#define U300_SYSCON_AAIFCR_MASK (0x0003)
338#define U300_SYSCON_AAIFCR_AASW_CTRL_MASK (0x0003)
339#define U300_SYSCON_AAIFCR_AASW_CTRL_FUNCTIONAL (0x0000)
340#define U300_SYSCON_AAIFCR_AASW_CTRL_MONITORING (0x0001)
341#define U300_SYSCON_AAIFCR_AASW_CTRL_ACC_TO_EXT (0x0002)
342#define U300_SYSCON_AAIFCR_AASW_CTRL_APP_TO_EXT (0x0003)
343/* Clock control for the MMC and MSPRO blocks 16bit (R/W) */
344#define U300_SYSCON_MMCR (0x9C)
345#define U300_SYSCON_MMCR_MASK (0x0003)
346#define U300_SYSCON_MMCR_MMC_FB_CLK_SEL_ENABLE (0x0002)
347#define U300_SYSCON_MMCR_MSPRO_FREQSEL_ENABLE (0x0001)
348
349/* TODO: More SYSCON registers missing */
350#define U300_SYSCON_PMC3R (0x10c)
351#define U300_SYSCON_PMC3R_APP_MISC_11_MASK (0xc000)
352#define U300_SYSCON_PMC3R_APP_MISC_11_SPI (0x4000)
353#define U300_SYSCON_PMC3R_APP_MISC_10_MASK (0x3000)
354#define U300_SYSCON_PMC3R_APP_MISC_10_SPI (0x1000)
355/* TODO: Missing other configs, I just added the SPI stuff */
356
357/* SYS_0_CLK_CONTROL first clock control 16bit (R/W) */
358#define U300_SYSCON_S0CCR (0x120)
359#define U300_SYSCON_S0CCR_FIELD_MASK (0x43FF)
360#define U300_SYSCON_S0CCR_CLOCK_REQ (0x4000)
361#define U300_SYSCON_S0CCR_CLOCK_INV (0x0200)
362#define U300_SYSCON_S0CCR_CLOCK_FREQ_MASK (0x01E0)
363#define U300_SYSCON_S0CCR_CLOCK_SELECT_MASK (0x001E)
364#define U300_SYSCON_S0CCR_CLOCK_ENABLE (0x0001)
365#define U300_SYSCON_S0CCR_SEL_MCLK (0x8<<1)
366#define U300_SYSCON_S0CCR_SEL_ACC_FSM_CLK (0xA<<1)
367#define U300_SYSCON_S0CCR_SEL_PLL60_48_CLK (0xC<<1)
368#define U300_SYSCON_S0CCR_SEL_PLL60_60_CLK (0xD<<1)
369#define U300_SYSCON_S0CCR_SEL_ACC_PLL208_CLK (0xE<<1)
370#define U300_SYSCON_S0CCR_SEL_APP_PLL13_CLK (0x0<<1)
371#define U300_SYSCON_S0CCR_SEL_APP_FSM_CLK (0x2<<1)
372#define U300_SYSCON_S0CCR_SEL_RTC_CLK (0x4<<1)
373#define U300_SYSCON_S0CCR_SEL_APP_PLL208_CLK (0x6<<1)
374/* SYS_1_CLK_CONTROL second clock control 16 bit (R/W) */
375#define U300_SYSCON_S1CCR (0x124)
376#define U300_SYSCON_S1CCR_FIELD_MASK (0x43FF)
377#define U300_SYSCON_S1CCR_CLOCK_REQ (0x4000)
378#define U300_SYSCON_S1CCR_CLOCK_INV (0x0200)
379#define U300_SYSCON_S1CCR_CLOCK_FREQ_MASK (0x01E0)
380#define U300_SYSCON_S1CCR_CLOCK_SELECT_MASK (0x001E)
381#define U300_SYSCON_S1CCR_CLOCK_ENABLE (0x0001)
382#define U300_SYSCON_S1CCR_SEL_MCLK (0x8<<1)
383#define U300_SYSCON_S1CCR_SEL_ACC_FSM_CLK (0xA<<1)
384#define U300_SYSCON_S1CCR_SEL_PLL60_48_CLK (0xC<<1)
385#define U300_SYSCON_S1CCR_SEL_PLL60_60_CLK (0xD<<1)
386#define U300_SYSCON_S1CCR_SEL_ACC_PLL208_CLK (0xE<<1)
387#define U300_SYSCON_S1CCR_SEL_ACC_PLL13_CLK (0x0<<1)
388#define U300_SYSCON_S1CCR_SEL_APP_FSM_CLK (0x2<<1)
389#define U300_SYSCON_S1CCR_SEL_RTC_CLK (0x4<<1)
390#define U300_SYSCON_S1CCR_SEL_APP_PLL208_CLK (0x6<<1)
391/* SYS_2_CLK_CONTROL third clock contol 16 bit (R/W) */
392#define U300_SYSCON_S2CCR (0x128)
393#define U300_SYSCON_S2CCR_FIELD_MASK (0xC3FF)
394#define U300_SYSCON_S2CCR_CLK_STEAL (0x8000)
395#define U300_SYSCON_S2CCR_CLOCK_REQ (0x4000)
396#define U300_SYSCON_S2CCR_CLOCK_INV (0x0200)
397#define U300_SYSCON_S2CCR_CLOCK_FREQ_MASK (0x01E0)
398#define U300_SYSCON_S2CCR_CLOCK_SELECT_MASK (0x001E)
399#define U300_SYSCON_S2CCR_CLOCK_ENABLE (0x0001)
400#define U300_SYSCON_S2CCR_SEL_MCLK (0x8<<1)
401#define U300_SYSCON_S2CCR_SEL_ACC_FSM_CLK (0xA<<1)
402#define U300_SYSCON_S2CCR_SEL_PLL60_48_CLK (0xC<<1)
403#define U300_SYSCON_S2CCR_SEL_PLL60_60_CLK (0xD<<1)
404#define U300_SYSCON_S2CCR_SEL_ACC_PLL208_CLK (0xE<<1)
405#define U300_SYSCON_S2CCR_SEL_ACC_PLL13_CLK (0x0<<1)
406#define U300_SYSCON_S2CCR_SEL_APP_FSM_CLK (0x2<<1)
407#define U300_SYSCON_S2CCR_SEL_RTC_CLK (0x4<<1)
408#define U300_SYSCON_S2CCR_SEL_APP_PLL208_CLK (0x6<<1)
409/* SYS_MISC_CONTROL, miscellaneous 16bit (R/W) */
410#define U300_SYSCON_MCR (0x12c)
411#define U300_SYSCON_MCR_FIELD_MASK (0x00FF)
412#define U300_SYSCON_MCR_PMGEN_CR_4_MASK (0x00C0)
413#define U300_SYSCON_MCR_PMGEN_CR_4_GPIO (0x0000)
414#define U300_SYSCON_MCR_PMGEN_CR_4_SPI (0x0040)
415#define U300_SYSCON_MCR_PMGEN_CR_4_AAIF (0x00C0)
416#define U300_SYSCON_MCR_PMGEN_CR_2_MASK (0x0030)
417#define U300_SYSCON_MCR_PMGEN_CR_2_GPIO (0x0000)
418#define U300_SYSCON_MCR_PMGEN_CR_2_EMIF_1_STATIC (0x0010)
419#define U300_SYSCON_MCR_PMGEN_CR_2_DSP (0x0020)
420#define U300_SYSCON_MCR_PMGEN_CR_2_AAIF (0x0030)
421#define U300_SYSCON_MCR_PMGEN_CR_0_MASK (0x000C)
422#define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_1_SDRAM_M1 (0x0000)
423#define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_1_SDRAM_M2 (0x0004)
424#define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_1_SDRAM_M3 (0x0008)
425#define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_0_SDRAM (0x000C)
426#define U300_SYSCON_MCR_PM1G_MODE_ENABLE (0x0002)
427#define U300_SYSCON_MCR_PMTG5_MODE_ENABLE (0x0001)
428/* Clock activity observability register 0 */
429#define U300_SYSCON_C0OAR (0x140)
430#define U300_SYSCON_C0OAR_MASK (0xFFFF)
431#define U300_SYSCON_C0OAR_VALUE (0xFFFF)
432#define U300_SYSCON_C0OAR_BT_H_CLK (0x8000)
433#define U300_SYSCON_C0OAR_ASPB_P_CLK (0x4000)
434#define U300_SYSCON_C0OAR_APP_SEMI_H_CLK (0x2000)
435#define U300_SYSCON_C0OAR_APP_SEMI_CLK (0x1000)
436#define U300_SYSCON_C0OAR_APP_MMC_MSPRO_CLK (0x0800)
437#define U300_SYSCON_C0OAR_APP_I2S1_CLK (0x0400)
438#define U300_SYSCON_C0OAR_APP_I2S0_CLK (0x0200)
439#define U300_SYSCON_C0OAR_APP_CPU_CLK (0x0100)
440#define U300_SYSCON_C0OAR_APP_52_CLK (0x0080)
441#define U300_SYSCON_C0OAR_APP_208_CLK (0x0040)
442#define U300_SYSCON_C0OAR_APP_104_CLK (0x0020)
443#define U300_SYSCON_C0OAR_APEX_CLK (0x0010)
444#define U300_SYSCON_C0OAR_AHPB_M_H_CLK (0x0008)
445#define U300_SYSCON_C0OAR_AHB_CLK (0x0004)
446#define U300_SYSCON_C0OAR_AFPB_P_CLK (0x0002)
447#define U300_SYSCON_C0OAR_AAIF_CLK (0x0001)
448/* Clock activity observability register 1 */
449#define U300_SYSCON_C1OAR (0x144)
450#define U300_SYSCON_C1OAR_MASK (0x3FFE)
451#define U300_SYSCON_C1OAR_VALUE (0x3FFE)
452#define U300_SYSCON_C1OAR_NFIF_F_CLK (0x2000)
453#define U300_SYSCON_C1OAR_MSPRO_CLK (0x1000)
454#define U300_SYSCON_C1OAR_MMC_P_CLK (0x0800)
455#define U300_SYSCON_C1OAR_MMC_CLK (0x0400)
456#define U300_SYSCON_C1OAR_KP_P_CLK (0x0200)
457#define U300_SYSCON_C1OAR_I2C1_P_CLK (0x0100)
458#define U300_SYSCON_C1OAR_I2C0_P_CLK (0x0080)
459#define U300_SYSCON_C1OAR_GPIO_CLK (0x0040)
460#define U300_SYSCON_C1OAR_EMIF_MPMC_CLK (0x0020)
461#define U300_SYSCON_C1OAR_EMIF_H_CLK (0x0010)
462#define U300_SYSCON_C1OAR_EVHIST_CLK (0x0008)
463#define U300_SYSCON_C1OAR_PPM_CLK (0x0004)
464#define U300_SYSCON_C1OAR_DMA_CLK (0x0002)
465/* Clock activity observability register 2 */
466#define U300_SYSCON_C2OAR (0x148)
467#define U300_SYSCON_C2OAR_MASK (0x0FFF)
468#define U300_SYSCON_C2OAR_VALUE (0x0FFF)
469#define U300_SYSCON_C2OAR_XGAM_CDI_CLK (0x0800)
470#define U300_SYSCON_C2OAR_XGAM_CLK (0x0400)
471#define U300_SYSCON_C2OAR_VC_H_CLK (0x0200)
472#define U300_SYSCON_C2OAR_VC_CLK (0x0100)
473#define U300_SYSCON_C2OAR_UA_P_CLK (0x0080)
474#define U300_SYSCON_C2OAR_TMR1_CLK (0x0040)
475#define U300_SYSCON_C2OAR_TMR0_CLK (0x0020)
476#define U300_SYSCON_C2OAR_SPI_P_CLK (0x0010)
477#define U300_SYSCON_C2OAR_PCM_I2S1_CORE_CLK (0x0008)
478#define U300_SYSCON_C2OAR_PCM_I2S1_CLK (0x0004)
479#define U300_SYSCON_C2OAR_PCM_I2S0_CORE_CLK (0x0002)
480#define U300_SYSCON_C2OAR_PCM_I2S0_CLK (0x0001)
481
482/* Chip ID register 16bit (R/-) */
483#define U300_SYSCON_CIDR (0x400)
484/* Video IRQ clear 16bit (R/W) */
485#define U300_SYSCON_VICR (0x404)
486#define U300_SYSCON_VICR_VIDEO1_IRQ_CLEAR_ENABLE (0x0002)
487#define U300_SYSCON_VICR_VIDEO0_IRQ_CLEAR_ENABLE (0x0001)
488/* SMCR */
489#define U300_SYSCON_SMCR (0x4d0)
490#define U300_SYSCON_SMCR_FIELD_MASK (0x000e)
491#define U300_SYSCON_SMCR_SEMI_SREFACK_IND (0x0008)
492#define U300_SYSCON_SMCR_SEMI_SREFREQ_ENABLE (0x0004)
493#define U300_SYSCON_SMCR_SEMI_EXT_BOOT_MODE_ENABLE (0x0002)
494/* CPU_SW_DBGEN Software Debug Enable 16bit (R/W) */
495#define U300_SYSCON_CSDR (0x4f0)
496#define U300_SYSCON_CSDR_SW_DEBUG_ENABLE (0x0001)
497/* PRINT_CONTROL Print Control 16bit (R/-) */
498#define U300_SYSCON_PCR (0x4f8)
499#define U300_SYSCON_PCR_SERV_IND (0x0001)
500/* BOOT_CONTROL 16bit (R/-) */
501#define U300_SYSCON_BCR (0x4fc)
502#define U300_SYSCON_BCR_ACC_CPU_SUBSYS_VINITHI_IND (0x0400)
503#define U300_SYSCON_BCR_APP_CPU_SUBSYS_VINITHI_IND (0x0200)
504#define U300_SYSCON_BCR_EXTRA_BOOT_OPTION_MASK (0x01FC)
505#define U300_SYSCON_BCR_APP_BOOT_SERV_MASK (0x0003)
506
507
508/* CPU clock defines */
509/**
510 * CPU high frequency in MHz
511 */
512#define SYSCON_CPU_CLOCK_HIGH 208
513/**
514 * CPU medium frequency in MHz
515 */
516#define SYSCON_CPU_CLOCK_MEDIUM 104
517/**
518 * CPU low frequency in MHz
519 */
520#define SYSCON_CPU_CLOCK_LOW 13
521
522/* EMIF clock defines */
523/**
524 * EMIF high frequency in MHz
525 */
526#define SYSCON_EMIF_CLOCK_HIGH 104
527/**
528 * EMIF medium frequency in MHz
529 */
530#define SYSCON_EMIF_CLOCK_MEDIUM 104
531/**
532 * EMIF low frequency in MHz
533 */
534#define SYSCON_EMIF_CLOCK_LOW 13
535
536/* AHB clock defines */
537/**
538 * AHB high frequency in MHz
539 */
540#define SYSCON_AHB_CLOCK_HIGH 52
541/**
542 * AHB medium frequency in MHz
543 */
544#define SYSCON_AHB_CLOCK_MEDIUM 52
545/**
546 * AHB low frequency in MHz
547 */
548#define SYSCON_AHB_CLOCK_LOW 7 /* i.e 13/2=6.5MHz */
549
550enum syscon_busmaster {
551 SYSCON_BM_DMAC,
552 SYSCON_BM_XGAM,
553 SYSCON_BM_VIDEO_ENC
554};
555
556/*
557 * Note that this array must match the order of the array "clk_reg"
558 * in syscon.c
559 */
560enum syscon_clk {
561 SYSCON_CLKCONTROL_SLOW_BRIDGE,
562 SYSCON_CLKCONTROL_UART,
563 SYSCON_CLKCONTROL_BTR,
564 SYSCON_CLKCONTROL_EH,
565 SYSCON_CLKCONTROL_GPIO,
566 SYSCON_CLKCONTROL_KEYPAD,
567 SYSCON_CLKCONTROL_APP_TIMER,
568 SYSCON_CLKCONTROL_ACC_TIMER,
569 SYSCON_CLKCONTROL_FAST_BRIDGE,
570 SYSCON_CLKCONTROL_I2C0,
571 SYSCON_CLKCONTROL_I2C1,
572 SYSCON_CLKCONTROL_I2S0,
573 SYSCON_CLKCONTROL_I2S1,
574 SYSCON_CLKCONTROL_MMC,
575 SYSCON_CLKCONTROL_SPI,
576 SYSCON_CLKCONTROL_I2S0_CORE,
577 SYSCON_CLKCONTROL_I2S1_CORE,
578 SYSCON_CLKCONTROL_AAIF,
579 SYSCON_CLKCONTROL_AHB,
580 SYSCON_CLKCONTROL_APEX,
581 SYSCON_CLKCONTROL_CPU,
582 SYSCON_CLKCONTROL_DMA,
583 SYSCON_CLKCONTROL_EMIF,
584 SYSCON_CLKCONTROL_NAND_IF,
585 SYSCON_CLKCONTROL_VIDEO_ENC,
586 SYSCON_CLKCONTROL_XGAM,
587 SYSCON_CLKCONTROL_SEMI,
588 SYSCON_CLKCONTROL_AHB_SUBSYS,
589 SYSCON_CLKCONTROL_MSPRO
590};
591
592enum syscon_sysclk_mode {
593 SYSCON_SYSCLK_DISABLED,
594 SYSCON_SYSCLK_M_CLK,
595 SYSCON_SYSCLK_ACC_FSM,
596 SYSCON_SYSCLK_PLL60_48,
597 SYSCON_SYSCLK_PLL60_60,
598 SYSCON_SYSCLK_ACC_PLL208,
599 SYSCON_SYSCLK_APP_PLL13,
600 SYSCON_SYSCLK_APP_FSM,
601 SYSCON_SYSCLK_RTC,
602 SYSCON_SYSCLK_APP_PLL208
603};
604
605enum syscon_sysclk_req {
606 SYSCON_SYSCLKREQ_DISABLED,
607 SYSCON_SYSCLKREQ_ACTIVE_LOW
608};
609
610enum syscon_clk_mode {
611 SYSCON_CLKMODE_OFF,
612 SYSCON_CLKMODE_DEFAULT,
613 SYSCON_CLKMODE_LOW,
614 SYSCON_CLKMODE_MEDIUM,
615 SYSCON_CLKMODE_HIGH,
616 SYSCON_CLKMODE_PERMANENT,
617 SYSCON_CLKMODE_ON,
618};
619
620enum syscon_call_mode {
621 SYSCON_CLKCALL_NOWAIT,
622 SYSCON_CLKCALL_WAIT,
623};
624
625int syscon_dc_on(bool keep_power_on);
626int syscon_set_busmaster_active_state(enum syscon_busmaster busmaster,
627 bool active);
628bool syscon_get_busmaster_active_state(void);
629int syscon_set_sleep_mask(enum syscon_clk,
630 bool sleep_ctrl);
631int syscon_config_sysclk(u32 sysclk,
632 enum syscon_sysclk_mode sysclkmode,
633 bool inverse,
634 u32 divisor,
635 enum syscon_sysclk_req sysclkreq);
636bool syscon_can_turn_off_semi_clock(void);
637
638/* This function is restricted to core.c */
639int syscon_request_normal_power(bool req);
640
641/* This function is restricted to be used by platform_speed.c */
642int syscon_speed_request(enum syscon_call_mode wait_mode,
643 enum syscon_clk_mode req_clk_mode);
644#endif /* __MACH_SYSCON_H */
diff --git a/arch/arm/mach-u300/include/mach/system.h b/arch/arm/mach-u300/include/mach/system.h
new file mode 100644
index 000000000000..8daf13634ce0
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/system.h
@@ -0,0 +1,42 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/system.h
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * System shutdown and reset functions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <mach/hardware.h>
12#include <asm/io.h>
13#include <asm/hardware/vic.h>
14#include <asm/irq.h>
15
16/* Forward declare this function from the watchdog */
17void coh901327_watchdog_reset(void);
18
19static inline void arch_idle(void)
20{
21 cpu_do_idle();
22}
23
24static void arch_reset(char mode, const char *cmd)
25{
26 switch (mode) {
27 case 's':
28 case 'h':
29 printk(KERN_CRIT "RESET: shutting down/rebooting system\n");
30 /* Disable interrupts */
31 local_irq_disable();
32#ifdef CONFIG_COH901327_WATCHDOG
33 coh901327_watchdog_reset();
34#endif
35 break;
36 default:
37 /* Do nothing */
38 break;
39 }
40 /* Wait for system do die/reset. */
41 while (1);
42}
diff --git a/arch/arm/mach-u300/include/mach/timex.h b/arch/arm/mach-u300/include/mach/timex.h
new file mode 100644
index 000000000000..f233b72633f6
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/timex.h
@@ -0,0 +1,17 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/timex.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Platform tick rate definition.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#ifndef __MACH_TIMEX_H
12#define __MACH_TIMEX_H
13
14/* This is for the APP OS GP1 (General Purpose 1) timer */
15#define CLOCK_TICK_RATE 1000000
16
17#endif
diff --git a/arch/arm/mach-u300/include/mach/u300-regs.h b/arch/arm/mach-u300/include/mach/u300-regs.h
new file mode 100644
index 000000000000..88333dfb19fc
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/u300-regs.h
@@ -0,0 +1,187 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/u300-regs.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Basic register address definitions in physical memory and
9 * some block defintions for core devices like the timer.
10 * Author: Linus Walleij <linus.walleij@stericsson.com>
11 */
12
13#ifndef __MACH_U300_REGS_H
14#define __MACH_U300_REGS_H
15
16/*
17 * These are the large blocks of memory allocated for I/O.
18 * the defines are used for setting up the I/O memory mapping.
19 */
20
21/* NAND Flash CS0 */
22#define U300_NAND_CS0_PHYS_BASE 0x80000000
23#define U300_NAND_CS0_VIRT_BASE 0xff040000
24
25/* NFIF */
26#define U300_NAND_IF_PHYS_BASE 0x9f800000
27#define U300_NAND_IF_VIRT_BASE 0xff030000
28
29/* AHB Peripherals */
30#define U300_AHB_PER_PHYS_BASE 0xa0000000
31#define U300_AHB_PER_VIRT_BASE 0xff010000
32
33/* FAST Peripherals */
34#define U300_FAST_PER_PHYS_BASE 0xc0000000
35#define U300_FAST_PER_VIRT_BASE 0xff020000
36
37/* SLOW Peripherals */
38#define U300_SLOW_PER_PHYS_BASE 0xc0010000
39#define U300_SLOW_PER_VIRT_BASE 0xff000000
40
41/* Boot ROM */
42#define U300_BOOTROM_PHYS_BASE 0xffff0000
43#define U300_BOOTROM_VIRT_BASE 0xffff0000
44
45/* SEMI config base */
46#ifdef CONFIG_MACH_U300_BS335
47#define U300_SEMI_CONFIG_BASE 0x2FFE0000
48#else
49#define U300_SEMI_CONFIG_BASE 0x30000000
50#endif
51
52/*
53 * All the following peripherals are specified at their PHYSICAL address,
54 * so if you need to access them (in the kernel), you MUST use the macros
55 * defined in <asm/io.h> to map to the IO_ADDRESS_AHB() IO_ADDRESS_FAST()
56 * etc.
57 */
58
59/*
60 * AHB peripherals
61 */
62
63/* AHB Peripherals Bridge Controller */
64#define U300_AHB_BRIDGE_BASE (U300_AHB_PER_PHYS_BASE+0x0000)
65
66/* Vectored Interrupt Controller 0, servicing 32 interrupts */
67#define U300_INTCON0_BASE (U300_AHB_PER_PHYS_BASE+0x1000)
68#define U300_INTCON0_VBASE (U300_AHB_PER_VIRT_BASE+0x1000)
69
70/* Vectored Interrupt Controller 1, servicing 32 interrupts */
71#define U300_INTCON1_BASE (U300_AHB_PER_PHYS_BASE+0x2000)
72#define U300_INTCON1_VBASE (U300_AHB_PER_VIRT_BASE+0x2000)
73
74/* Memory Stick Pro (MSPRO) controller */
75#define U300_MSPRO_BASE (U300_AHB_PER_PHYS_BASE+0x3000)
76
77/* EMIF Configuration Area */
78#define U300_EMIF_CFG_BASE (U300_AHB_PER_PHYS_BASE+0x4000)
79
80
81/*
82 * FAST peripherals
83 */
84
85/* FAST bridge control */
86#define U300_FAST_BRIDGE_BASE (U300_FAST_PER_PHYS_BASE+0x0000)
87
88/* MMC/SD controller */
89#define U300_MMCSD_BASE (U300_FAST_PER_PHYS_BASE+0x1000)
90
91/* PCM I2S0 controller */
92#define U300_PCM_I2S0_BASE (U300_FAST_PER_PHYS_BASE+0x2000)
93
94/* PCM I2S1 controller */
95#define U300_PCM_I2S1_BASE (U300_FAST_PER_PHYS_BASE+0x3000)
96
97/* I2C0 controller */
98#define U300_I2C0_BASE (U300_FAST_PER_PHYS_BASE+0x4000)
99
100/* I2C1 controller */
101#define U300_I2C1_BASE (U300_FAST_PER_PHYS_BASE+0x5000)
102
103/* SPI controller */
104#define U300_SPI_BASE (U300_FAST_PER_PHYS_BASE+0x6000)
105
106#ifdef CONFIG_MACH_U300_BS335
107/* Fast UART1 on U335 only */
108#define U300_UART1_BASE (U300_SLOW_PER_PHYS_BASE+0x7000)
109#endif
110
111/*
112 * SLOW peripherals
113 */
114
115/* SLOW bridge control */
116#define U300_SLOW_BRIDGE_BASE (U300_SLOW_PER_PHYS_BASE)
117
118/* SYSCON */
119#define U300_SYSCON_BASE (U300_SLOW_PER_PHYS_BASE+0x1000)
120#define U300_SYSCON_VBASE (U300_SLOW_PER_VIRT_BASE+0x1000)
121
122/* Watchdog */
123#define U300_WDOG_BASE (U300_SLOW_PER_PHYS_BASE+0x2000)
124
125/* UART0 */
126#define U300_UART0_BASE (U300_SLOW_PER_PHYS_BASE+0x3000)
127
128/* APP side special timer */
129#define U300_TIMER_APP_BASE (U300_SLOW_PER_PHYS_BASE+0x4000)
130#define U300_TIMER_APP_VBASE (U300_SLOW_PER_VIRT_BASE+0x4000)
131
132/* Keypad */
133#define U300_KEYPAD_BASE (U300_SLOW_PER_PHYS_BASE+0x5000)
134
135/* GPIO */
136#define U300_GPIO_BASE (U300_SLOW_PER_PHYS_BASE+0x6000)
137
138/* RTC */
139#define U300_RTC_BASE (U300_SLOW_PER_PHYS_BASE+0x7000)
140
141/* Bus tracer */
142#define U300_BUSTR_BASE (U300_SLOW_PER_PHYS_BASE+0x8000)
143
144/* Event handler (hardware queue) */
145#define U300_EVHIST_BASE (U300_SLOW_PER_PHYS_BASE+0x9000)
146
147/* Genric Timer */
148#define U300_TIMER_BASE (U300_SLOW_PER_PHYS_BASE+0xa000)
149
150/* PPM */
151#define U300_PPM_BASE (U300_SLOW_PER_PHYS_BASE+0xb000)
152
153
154/*
155 * REST peripherals
156 */
157
158/* ISP (image signal processor) is only available in U335 */
159#ifdef CONFIG_MACH_U300_BS335
160#define U300_ISP_BASE (0xA0008000)
161#endif
162
163/* DMA Controller base */
164#define U300_DMAC_BASE (0xC0020000)
165
166/* MSL Base */
167#define U300_MSL_BASE (0xc0022000)
168
169/* APEX Base */
170#define U300_APEX_BASE (0xc0030000)
171
172/* Video Encoder Base */
173#ifdef CONFIG_MACH_U300_BS335
174#define U300_VIDEOENC_BASE (0xc0080000)
175#else
176#define U300_VIDEOENC_BASE (0xc0040000)
177#endif
178
179/* XGAM Base */
180#define U300_XGAM_BASE (0xd0000000)
181
182/*
183 * Virtual accessor macros for static devices
184 */
185
186
187#endif
diff --git a/arch/arm/mach-imx/include/mach/system.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 46d4ca91af79..29acb718acf7 100644
--- a/arch/arm/mach-imx/include/mach/system.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -1,8 +1,7 @@
1/* 1/*
2 * arch/arm/mach-imxads/include/mach/system.h 2 * arch/arm/mach-u300/include/mach/uncompress.h
3 * 3 *
4 * Copyright (C) 1999 ARM Limited 4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 * 5 *
7 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -18,23 +17,30 @@
18 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 19 */
21#ifndef __ASM_ARCH_SYSTEM_H 20#define AMBA_UART_DR (*(volatile unsigned char *)0xc0013000)
22#define __ASM_ARCH_SYSTEM_H 21#define AMBA_UART_LCRH (*(volatile unsigned char *)0xc001302C)
22#define AMBA_UART_CR (*(volatile unsigned char *)0xc0013030)
23#define AMBA_UART_FR (*(volatile unsigned char *)0xc0013018)
23 24
24static void 25/*
25arch_idle(void) 26 * This does not append a newline
27 */
28static inline void putc(int c)
26{ 29{
27 /* 30 while (AMBA_UART_FR & (1 << 5))
28 * This should do all the clock switching 31 barrier();
29 * and wait for interrupt tricks 32
30 */ 33 AMBA_UART_DR = c;
31 cpu_do_idle();
32} 34}
33 35
34static inline void 36static inline void flush(void)
35arch_reset(char mode, const char *cmd)
36{ 37{
37 cpu_reset(0); 38 while (AMBA_UART_FR & (1 << 3))
39 barrier();
38} 40}
39 41
40#endif 42/*
43 * nothing to do
44 */
45#define arch_decomp_setup()
46#define arch_decomp_wdog()
diff --git a/arch/arm/mach-u300/include/mach/vmalloc.h b/arch/arm/mach-u300/include/mach/vmalloc.h
new file mode 100644
index 000000000000..b00c51a66fbe
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/vmalloc.h
@@ -0,0 +1,12 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/vmalloc.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Virtual memory allocations
9 * End must be above the I/O registers and on an even 2MiB boundary.
10 * Author: Linus Walleij <linus.walleij@stericsson.com>
11 */
12#define VMALLOC_END 0xfe800000
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c
new file mode 100644
index 000000000000..3138d3955c9e
--- /dev/null
+++ b/arch/arm/mach-u300/mmc.c
@@ -0,0 +1,216 @@
1/*
2 *
3 * arch/arm/mach-u300/mmc.c
4 *
5 *
6 * Copyright (C) 2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 *
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 * Author: Johan Lundin <johan.lundin@stericsson.com>
11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
12 */
13#include <linux/device.h>
14#include <linux/amba/bus.h>
15#include <linux/mmc/host.h>
16#include <linux/input.h>
17#include <linux/workqueue.h>
18#include <linux/delay.h>
19#include <linux/regulator/consumer.h>
20#include <linux/regulator/machine.h>
21#include <linux/gpio.h>
22
23#include <asm/mach/mmc.h>
24#include "mmc.h"
25
26struct mmci_card_event {
27 struct input_dev *mmc_input;
28 int mmc_inserted;
29 struct work_struct workq;
30 struct mmc_platform_data mmc0_plat_data;
31};
32
33static unsigned int mmc_status(struct device *dev)
34{
35 struct mmci_card_event *mmci_card = container_of(
36 dev->platform_data,
37 struct mmci_card_event, mmc0_plat_data);
38
39 return mmci_card->mmc_inserted;
40}
41
42/*
43 * Here follows a large chunk of code which will only be enabled if you
44 * have both the AB3100 chip mounted and the MMC subsystem activated.
45 */
46
47static u32 mmc_translate_vdd(struct device *dev, unsigned int voltage)
48{
49 int v;
50
51 /*
52 * MMC Spec:
53 * bit 7: 1.70 - 1.95V
54 * bit 8 - 14: 2.0 - 2.6V
55 * bit 15 - 23: 2.7 - 3.6V
56 *
57 * ab3100 voltages:
58 * 000 - 2.85V
59 * 001 - 2.75V
60 * 010 - 1.8V
61 * 011 - 1.5V
62 */
63 switch (voltage) {
64 case 8:
65 v = 3;
66 break;
67 case 9:
68 case 10:
69 case 11:
70 case 12:
71 case 13:
72 case 14:
73 case 15:
74 v = 1;
75 break;
76 case 16:
77 v = 1;
78 break;
79 case 17:
80 case 18:
81 case 19:
82 case 20:
83 case 21:
84 case 22:
85 case 23:
86 case 24:
87 v = 0;
88 break;
89 default:
90 v = 0;
91 break;
92 }
93
94 /* PL180 voltage register bits */
95 return v << 2;
96}
97
98
99
100static int mmci_callback(void *data)
101{
102 struct mmci_card_event *mmci_card = data;
103
104 disable_irq_on_gpio_pin(U300_GPIO_PIN_MMC_CD);
105 schedule_work(&mmci_card->workq);
106
107 return 0;
108}
109
110
111static ssize_t gpio_show(struct device *dev, struct device_attribute *attr,
112 char *buf)
113{
114 struct mmci_card_event *mmci_card = container_of(
115 dev->platform_data,
116 struct mmci_card_event, mmc0_plat_data);
117
118
119 return sprintf(buf, "%d\n", !mmci_card->mmc_inserted);
120}
121
122static DEVICE_ATTR(mmc_inserted, S_IRUGO, gpio_show, NULL);
123
124static void _mmci_callback(struct work_struct *ws)
125{
126
127 struct mmci_card_event *mmci_card = container_of(
128 ws,
129 struct mmci_card_event, workq);
130
131 mdelay(20);
132
133 mmci_card->mmc_inserted = !!gpio_get_value(U300_GPIO_PIN_MMC_CD);
134
135 input_report_switch(mmci_card->mmc_input, KEY_INSERT,
136 !mmci_card->mmc_inserted);
137 input_sync(mmci_card->mmc_input);
138
139 pr_debug("MMC/SD card was %s\n",
140 mmci_card->mmc_inserted ? "removed" : "inserted");
141
142 enable_irq_on_gpio_pin(U300_GPIO_PIN_MMC_CD, !mmci_card->mmc_inserted);
143}
144
145int __devinit mmc_init(struct amba_device *adev)
146{
147 struct mmci_card_event *mmci_card;
148 struct device *mmcsd_device = &adev->dev;
149 int ret = 0;
150
151 mmci_card = kzalloc(sizeof(struct mmci_card_event), GFP_KERNEL);
152 if (!mmci_card)
153 return -ENOMEM;
154
155 /* Nominally 2.85V on our platform */
156 mmci_card->mmc0_plat_data.ocr_mask = MMC_VDD_28_29;
157 mmci_card->mmc0_plat_data.translate_vdd = mmc_translate_vdd;
158 mmci_card->mmc0_plat_data.status = mmc_status;
159
160 mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data;
161
162 INIT_WORK(&mmci_card->workq, _mmci_callback);
163
164 ret = gpio_request(U300_GPIO_PIN_MMC_CD, "MMC card detection");
165 if (ret) {
166 printk(KERN_CRIT "Could not allocate MMC card detection " \
167 "GPIO pin\n");
168 goto out;
169 }
170
171 ret = gpio_direction_input(U300_GPIO_PIN_MMC_CD);
172 if (ret) {
173 printk(KERN_CRIT "Invalid GPIO pin requested\n");
174 goto out;
175 }
176
177 ret = sysfs_create_file(&mmcsd_device->kobj,
178 &dev_attr_mmc_inserted.attr);
179 if (ret)
180 goto out;
181
182 mmci_card->mmc_input = input_allocate_device();
183 if (!mmci_card->mmc_input) {
184 printk(KERN_CRIT "Could not allocate MMC input device\n");
185 return -ENOMEM;
186 }
187
188 mmci_card->mmc_input->name = "MMC insert notification";
189 mmci_card->mmc_input->id.bustype = BUS_HOST;
190 mmci_card->mmc_input->id.vendor = 0;
191 mmci_card->mmc_input->id.product = 0;
192 mmci_card->mmc_input->id.version = 0x0100;
193 mmci_card->mmc_input->dev.parent = mmcsd_device;
194 input_set_capability(mmci_card->mmc_input, EV_SW, KEY_INSERT);
195
196 /*
197 * Since this must always be compiled into the kernel, this input
198 * is never unregistered or free:ed.
199 */
200 ret = input_register_device(mmci_card->mmc_input);
201 if (ret) {
202 input_free_device(mmci_card->mmc_input);
203 goto out;
204 }
205
206 input_set_drvdata(mmci_card->mmc_input, mmci_card);
207
208 ret = gpio_register_callback(U300_GPIO_PIN_MMC_CD, mmci_callback,
209 mmci_card);
210
211 schedule_work(&mmci_card->workq);
212
213 printk(KERN_INFO "Registered MMC insert/remove notification\n");
214out:
215 return ret;
216}
diff --git a/arch/arm/mach-u300/mmc.h b/arch/arm/mach-u300/mmc.h
new file mode 100644
index 000000000000..92b85125abb3
--- /dev/null
+++ b/arch/arm/mach-u300/mmc.h
@@ -0,0 +1,18 @@
1/*
2 *
3 * arch/arm/mach-u300/mmc.h
4 *
5 *
6 * Copyright (C) 2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 *
9 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
10 */
11#ifndef MMC_H
12#define MMC_H
13
14#include <linux/amba/bus.h>
15
16int __devinit mmc_init(struct amba_device *adev);
17
18#endif
diff --git a/arch/arm/mach-u300/padmux.c b/arch/arm/mach-u300/padmux.c
new file mode 100644
index 000000000000..f3664564f086
--- /dev/null
+++ b/arch/arm/mach-u300/padmux.c
@@ -0,0 +1,58 @@
1/*
2 *
3 * arch/arm/mach-u300/padmux.c
4 *
5 *
6 * Copyright (C) 2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * U300 PADMUX functions
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 *
11 */
12#include <linux/io.h>
13#include <linux/err.h>
14#include <mach/u300-regs.h>
15#include <mach/syscon.h>
16
17#include "padmux.h"
18
19/* Set the PAD MUX to route the MMC reader correctly to GPIO0. */
20void pmx_set_mission_mode_mmc(void)
21{
22 u16 val;
23
24 val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1LR);
25 val &= ~U300_SYSCON_PMC1LR_MMCSD_MASK;
26 writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1LR);
27 val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1HR);
28 val &= ~U300_SYSCON_PMC1HR_APP_GPIO_1_MASK;
29 val |= U300_SYSCON_PMC1HR_APP_GPIO_1_MMC;
30 writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1HR);
31}
32
33void pmx_set_mission_mode_spi(void)
34{
35 u16 val;
36
37 /* Set up padmuxing so the SPI port and its chipselects are active */
38 val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1HR);
39 /*
40 * Activate the SPI port (disable the use of these pins for generic
41 * GPIO, DSP, AAIF
42 */
43 val &= ~U300_SYSCON_PMC1HR_APP_SPI_2_MASK;
44 val |= U300_SYSCON_PMC1HR_APP_SPI_2_SPI;
45 /*
46 * Use GPIO pin SPI CS1 for CS1 actually (it can be used for other
47 * things also)
48 */
49 val &= ~U300_SYSCON_PMC1HR_APP_SPI_CS_1_MASK;
50 val |= U300_SYSCON_PMC1HR_APP_SPI_CS_1_SPI;
51 /*
52 * Use GPIO pin SPI CS2 for CS2 actually (it can be used for other
53 * things also)
54 */
55 val &= ~U300_SYSCON_PMC1HR_APP_SPI_CS_2_MASK;
56 val |= U300_SYSCON_PMC1HR_APP_SPI_CS_2_SPI;
57 writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1HR);
58}
diff --git a/arch/arm/mach-u300/padmux.h b/arch/arm/mach-u300/padmux.h
new file mode 100644
index 000000000000..8c2099ac5046
--- /dev/null
+++ b/arch/arm/mach-u300/padmux.h
@@ -0,0 +1,19 @@
1/*
2 *
3 * arch/arm/mach-u300/padmux.h
4 *
5 *
6 * Copyright (C) 2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * U300 PADMUX API
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 *
11 */
12
13#ifndef __MACH_U300_PADMUX_H
14#define __MACH_U300_PADMUX_H
15
16void pmx_set_mission_mode_mmc(void);
17void pmx_set_mission_mode_spi(void);
18
19#endif
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
new file mode 100644
index 000000000000..cce53204880e
--- /dev/null
+++ b/arch/arm/mach-u300/timer.c
@@ -0,0 +1,422 @@
1/*
2 *
3 * arch/arm/mach-u300/timer.c
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Timer COH 901 328, runs the OS timer interrupt.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <linux/interrupt.h>
12#include <linux/time.h>
13#include <linux/timex.h>
14#include <linux/clockchips.h>
15#include <linux/clocksource.h>
16#include <linux/types.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20
21/* Generic stuff */
22#include <asm/mach/map.h>
23#include <asm/mach/time.h>
24#include <asm/mach/irq.h>
25
26#include "clock.h"
27
28/*
29 * APP side special timer registers
30 * This timer contains four timers which can fire an interrupt each.
31 * OS (operating system) timer @ 32768 Hz
32 * DD (device driver) timer @ 1 kHz
33 * GP1 (general purpose 1) timer @ 1MHz
34 * GP2 (general purpose 2) timer @ 1MHz
35 */
36
37/* Reset OS Timer 32bit (-/W) */
38#define U300_TIMER_APP_ROST (0x0000)
39#define U300_TIMER_APP_ROST_TIMER_RESET (0x00000000)
40/* Enable OS Timer 32bit (-/W) */
41#define U300_TIMER_APP_EOST (0x0004)
42#define U300_TIMER_APP_EOST_TIMER_ENABLE (0x00000000)
43/* Disable OS Timer 32bit (-/W) */
44#define U300_TIMER_APP_DOST (0x0008)
45#define U300_TIMER_APP_DOST_TIMER_DISABLE (0x00000000)
46/* OS Timer Mode Register 32bit (-/W) */
47#define U300_TIMER_APP_SOSTM (0x000c)
48#define U300_TIMER_APP_SOSTM_MODE_CONTINUOUS (0x00000000)
49#define U300_TIMER_APP_SOSTM_MODE_ONE_SHOT (0x00000001)
50/* OS Timer Status Register 32bit (R/-) */
51#define U300_TIMER_APP_OSTS (0x0010)
52#define U300_TIMER_APP_OSTS_TIMER_STATE_MASK (0x0000000F)
53#define U300_TIMER_APP_OSTS_TIMER_STATE_IDLE (0x00000001)
54#define U300_TIMER_APP_OSTS_TIMER_STATE_ACTIVE (0x00000002)
55#define U300_TIMER_APP_OSTS_ENABLE_IND (0x00000010)
56#define U300_TIMER_APP_OSTS_MODE_MASK (0x00000020)
57#define U300_TIMER_APP_OSTS_MODE_CONTINUOUS (0x00000000)
58#define U300_TIMER_APP_OSTS_MODE_ONE_SHOT (0x00000020)
59#define U300_TIMER_APP_OSTS_IRQ_ENABLED_IND (0x00000040)
60#define U300_TIMER_APP_OSTS_IRQ_PENDING_IND (0x00000080)
61/* OS Timer Current Count Register 32bit (R/-) */
62#define U300_TIMER_APP_OSTCC (0x0014)
63/* OS Timer Terminal Count Register 32bit (R/W) */
64#define U300_TIMER_APP_OSTTC (0x0018)
65/* OS Timer Interrupt Enable Register 32bit (-/W) */
66#define U300_TIMER_APP_OSTIE (0x001c)
67#define U300_TIMER_APP_OSTIE_IRQ_DISABLE (0x00000000)
68#define U300_TIMER_APP_OSTIE_IRQ_ENABLE (0x00000001)
69/* OS Timer Interrupt Acknowledge Register 32bit (-/W) */
70#define U300_TIMER_APP_OSTIA (0x0020)
71#define U300_TIMER_APP_OSTIA_IRQ_ACK (0x00000080)
72
73/* Reset DD Timer 32bit (-/W) */
74#define U300_TIMER_APP_RDDT (0x0040)
75#define U300_TIMER_APP_RDDT_TIMER_RESET (0x00000000)
76/* Enable DD Timer 32bit (-/W) */
77#define U300_TIMER_APP_EDDT (0x0044)
78#define U300_TIMER_APP_EDDT_TIMER_ENABLE (0x00000000)
79/* Disable DD Timer 32bit (-/W) */
80#define U300_TIMER_APP_DDDT (0x0048)
81#define U300_TIMER_APP_DDDT_TIMER_DISABLE (0x00000000)
82/* DD Timer Mode Register 32bit (-/W) */
83#define U300_TIMER_APP_SDDTM (0x004c)
84#define U300_TIMER_APP_SDDTM_MODE_CONTINUOUS (0x00000000)
85#define U300_TIMER_APP_SDDTM_MODE_ONE_SHOT (0x00000001)
86/* DD Timer Status Register 32bit (R/-) */
87#define U300_TIMER_APP_DDTS (0x0050)
88#define U300_TIMER_APP_DDTS_TIMER_STATE_MASK (0x0000000F)
89#define U300_TIMER_APP_DDTS_TIMER_STATE_IDLE (0x00000001)
90#define U300_TIMER_APP_DDTS_TIMER_STATE_ACTIVE (0x00000002)
91#define U300_TIMER_APP_DDTS_ENABLE_IND (0x00000010)
92#define U300_TIMER_APP_DDTS_MODE_MASK (0x00000020)
93#define U300_TIMER_APP_DDTS_MODE_CONTINUOUS (0x00000000)
94#define U300_TIMER_APP_DDTS_MODE_ONE_SHOT (0x00000020)
95#define U300_TIMER_APP_DDTS_IRQ_ENABLED_IND (0x00000040)
96#define U300_TIMER_APP_DDTS_IRQ_PENDING_IND (0x00000080)
97/* DD Timer Current Count Register 32bit (R/-) */
98#define U300_TIMER_APP_DDTCC (0x0054)
99/* DD Timer Terminal Count Register 32bit (R/W) */
100#define U300_TIMER_APP_DDTTC (0x0058)
101/* DD Timer Interrupt Enable Register 32bit (-/W) */
102#define U300_TIMER_APP_DDTIE (0x005c)
103#define U300_TIMER_APP_DDTIE_IRQ_DISABLE (0x00000000)
104#define U300_TIMER_APP_DDTIE_IRQ_ENABLE (0x00000001)
105/* DD Timer Interrupt Acknowledge Register 32bit (-/W) */
106#define U300_TIMER_APP_DDTIA (0x0060)
107#define U300_TIMER_APP_DDTIA_IRQ_ACK (0x00000080)
108
109/* Reset GP1 Timer 32bit (-/W) */
110#define U300_TIMER_APP_RGPT1 (0x0080)
111#define U300_TIMER_APP_RGPT1_TIMER_RESET (0x00000000)
112/* Enable GP1 Timer 32bit (-/W) */
113#define U300_TIMER_APP_EGPT1 (0x0084)
114#define U300_TIMER_APP_EGPT1_TIMER_ENABLE (0x00000000)
115/* Disable GP1 Timer 32bit (-/W) */
116#define U300_TIMER_APP_DGPT1 (0x0088)
117#define U300_TIMER_APP_DGPT1_TIMER_DISABLE (0x00000000)
118/* GP1 Timer Mode Register 32bit (-/W) */
119#define U300_TIMER_APP_SGPT1M (0x008c)
120#define U300_TIMER_APP_SGPT1M_MODE_CONTINUOUS (0x00000000)
121#define U300_TIMER_APP_SGPT1M_MODE_ONE_SHOT (0x00000001)
122/* GP1 Timer Status Register 32bit (R/-) */
123#define U300_TIMER_APP_GPT1S (0x0090)
124#define U300_TIMER_APP_GPT1S_TIMER_STATE_MASK (0x0000000F)
125#define U300_TIMER_APP_GPT1S_TIMER_STATE_IDLE (0x00000001)
126#define U300_TIMER_APP_GPT1S_TIMER_STATE_ACTIVE (0x00000002)
127#define U300_TIMER_APP_GPT1S_ENABLE_IND (0x00000010)
128#define U300_TIMER_APP_GPT1S_MODE_MASK (0x00000020)
129#define U300_TIMER_APP_GPT1S_MODE_CONTINUOUS (0x00000000)
130#define U300_TIMER_APP_GPT1S_MODE_ONE_SHOT (0x00000020)
131#define U300_TIMER_APP_GPT1S_IRQ_ENABLED_IND (0x00000040)
132#define U300_TIMER_APP_GPT1S_IRQ_PENDING_IND (0x00000080)
133/* GP1 Timer Current Count Register 32bit (R/-) */
134#define U300_TIMER_APP_GPT1CC (0x0094)
135/* GP1 Timer Terminal Count Register 32bit (R/W) */
136#define U300_TIMER_APP_GPT1TC (0x0098)
137/* GP1 Timer Interrupt Enable Register 32bit (-/W) */
138#define U300_TIMER_APP_GPT1IE (0x009c)
139#define U300_TIMER_APP_GPT1IE_IRQ_DISABLE (0x00000000)
140#define U300_TIMER_APP_GPT1IE_IRQ_ENABLE (0x00000001)
141/* GP1 Timer Interrupt Acknowledge Register 32bit (-/W) */
142#define U300_TIMER_APP_GPT1IA (0x00a0)
143#define U300_TIMER_APP_GPT1IA_IRQ_ACK (0x00000080)
144
145/* Reset GP2 Timer 32bit (-/W) */
146#define U300_TIMER_APP_RGPT2 (0x00c0)
147#define U300_TIMER_APP_RGPT2_TIMER_RESET (0x00000000)
148/* Enable GP2 Timer 32bit (-/W) */
149#define U300_TIMER_APP_EGPT2 (0x00c4)
150#define U300_TIMER_APP_EGPT2_TIMER_ENABLE (0x00000000)
151/* Disable GP2 Timer 32bit (-/W) */
152#define U300_TIMER_APP_DGPT2 (0x00c8)
153#define U300_TIMER_APP_DGPT2_TIMER_DISABLE (0x00000000)
154/* GP2 Timer Mode Register 32bit (-/W) */
155#define U300_TIMER_APP_SGPT2M (0x00cc)
156#define U300_TIMER_APP_SGPT2M_MODE_CONTINUOUS (0x00000000)
157#define U300_TIMER_APP_SGPT2M_MODE_ONE_SHOT (0x00000001)
158/* GP2 Timer Status Register 32bit (R/-) */
159#define U300_TIMER_APP_GPT2S (0x00d0)
160#define U300_TIMER_APP_GPT2S_TIMER_STATE_MASK (0x0000000F)
161#define U300_TIMER_APP_GPT2S_TIMER_STATE_IDLE (0x00000001)
162#define U300_TIMER_APP_GPT2S_TIMER_STATE_ACTIVE (0x00000002)
163#define U300_TIMER_APP_GPT2S_ENABLE_IND (0x00000010)
164#define U300_TIMER_APP_GPT2S_MODE_MASK (0x00000020)
165#define U300_TIMER_APP_GPT2S_MODE_CONTINUOUS (0x00000000)
166#define U300_TIMER_APP_GPT2S_MODE_ONE_SHOT (0x00000020)
167#define U300_TIMER_APP_GPT2S_IRQ_ENABLED_IND (0x00000040)
168#define U300_TIMER_APP_GPT2S_IRQ_PENDING_IND (0x00000080)
169/* GP2 Timer Current Count Register 32bit (R/-) */
170#define U300_TIMER_APP_GPT2CC (0x00d4)
171/* GP2 Timer Terminal Count Register 32bit (R/W) */
172#define U300_TIMER_APP_GPT2TC (0x00d8)
173/* GP2 Timer Interrupt Enable Register 32bit (-/W) */
174#define U300_TIMER_APP_GPT2IE (0x00dc)
175#define U300_TIMER_APP_GPT2IE_IRQ_DISABLE (0x00000000)
176#define U300_TIMER_APP_GPT2IE_IRQ_ENABLE (0x00000001)
177/* GP2 Timer Interrupt Acknowledge Register 32bit (-/W) */
178#define U300_TIMER_APP_GPT2IA (0x00e0)
179#define U300_TIMER_APP_GPT2IA_IRQ_ACK (0x00000080)
180
181/* Clock request control register - all four timers */
182#define U300_TIMER_APP_CRC (0x100)
183#define U300_TIMER_APP_CRC_CLOCK_REQUEST_ENABLE (0x00000001)
184
185#define TICKS_PER_JIFFY ((CLOCK_TICK_RATE + (HZ/2)) / HZ)
186#define US_PER_TICK ((1000000 + (HZ/2)) / HZ)
187
188/*
189 * The u300_set_mode() function is always called first, if we
190 * have oneshot timer active, the oneshot scheduling function
191 * u300_set_next_event() is called immediately after.
192 */
193static void u300_set_mode(enum clock_event_mode mode,
194 struct clock_event_device *evt)
195{
196 switch (mode) {
197 case CLOCK_EVT_MODE_PERIODIC:
198 /* Disable interrupts on GPT1 */
199 writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE,
200 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
201 /* Disable GP1 while we're reprogramming it. */
202 writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE,
203 U300_TIMER_APP_VBASE + U300_TIMER_APP_DGPT1);
204 /*
205 * Set the periodic mode to a certain number of ticks per
206 * jiffy.
207 */
208 writel(TICKS_PER_JIFFY,
209 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1TC);
210 /*
211 * Set continuous mode, so the timer keeps triggering
212 * interrupts.
213 */
214 writel(U300_TIMER_APP_SGPT1M_MODE_CONTINUOUS,
215 U300_TIMER_APP_VBASE + U300_TIMER_APP_SGPT1M);
216 /* Enable timer interrupts */
217 writel(U300_TIMER_APP_GPT1IE_IRQ_ENABLE,
218 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
219 /* Then enable the OS timer again */
220 writel(U300_TIMER_APP_EGPT1_TIMER_ENABLE,
221 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT1);
222 break;
223 case CLOCK_EVT_MODE_ONESHOT:
224 /* Just break; here? */
225 /*
226 * The actual event will be programmed by the next event hook,
227 * so we just set a dummy value somewhere at the end of the
228 * universe here.
229 */
230 /* Disable interrupts on GPT1 */
231 writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE,
232 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
233 /* Disable GP1 while we're reprogramming it. */
234 writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE,
235 U300_TIMER_APP_VBASE + U300_TIMER_APP_DGPT1);
236 /*
237 * Expire far in the future, u300_set_next_event() will be
238 * called soon...
239 */
240 writel(0xFFFFFFFF, U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1TC);
241 /* We run one shot per tick here! */
242 writel(U300_TIMER_APP_SGPT1M_MODE_ONE_SHOT,
243 U300_TIMER_APP_VBASE + U300_TIMER_APP_SGPT1M);
244 /* Enable interrupts for this timer */
245 writel(U300_TIMER_APP_GPT1IE_IRQ_ENABLE,
246 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
247 /* Enable timer */
248 writel(U300_TIMER_APP_EGPT1_TIMER_ENABLE,
249 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT1);
250 break;
251 case CLOCK_EVT_MODE_UNUSED:
252 case CLOCK_EVT_MODE_SHUTDOWN:
253 /* Disable interrupts on GP1 */
254 writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE,
255 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
256 /* Disable GP1 */
257 writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE,
258 U300_TIMER_APP_VBASE + U300_TIMER_APP_DGPT1);
259 break;
260 case CLOCK_EVT_MODE_RESUME:
261 /* Ignore this call */
262 break;
263 }
264}
265
266/*
267 * The app timer in one shot mode obviously has to be reprogrammed
268 * in EXACTLY this sequence to work properly. Do NOT try to e.g. replace
269 * the interrupt disable + timer disable commands with a reset command,
270 * it will fail miserably. Apparently (and I found this the hard way)
271 * the timer is very sensitive to the instruction order, though you don't
272 * get that impression from the data sheet.
273 */
274static int u300_set_next_event(unsigned long cycles,
275 struct clock_event_device *evt)
276
277{
278 /* Disable interrupts on GPT1 */
279 writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE,
280 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
281 /* Disable GP1 while we're reprogramming it. */
282 writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE,
283 U300_TIMER_APP_VBASE + U300_TIMER_APP_DGPT1);
284 /* Reset the General Purpose timer 1. */
285 writel(U300_TIMER_APP_RGPT1_TIMER_RESET,
286 U300_TIMER_APP_VBASE + U300_TIMER_APP_RGPT1);
287 /* IRQ in n * cycles */
288 writel(cycles, U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1TC);
289 /*
290 * We run one shot per tick here! (This is necessary to reconfigure,
291 * the timer will tilt if you don't!)
292 */
293 writel(U300_TIMER_APP_SGPT1M_MODE_ONE_SHOT,
294 U300_TIMER_APP_VBASE + U300_TIMER_APP_SGPT1M);
295 /* Enable timer interrupts */
296 writel(U300_TIMER_APP_GPT1IE_IRQ_ENABLE,
297 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IE);
298 /* Then enable the OS timer again */
299 writel(U300_TIMER_APP_EGPT1_TIMER_ENABLE,
300 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT1);
301 return 0;
302}
303
304
305/* Use general purpose timer 1 as clock event */
306static struct clock_event_device clockevent_u300_1mhz = {
307 .name = "GPT1",
308 .rating = 300, /* Reasonably fast and accurate clock event */
309 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
310 /* 22 calculated using the algorithm in arch/mips/kernel/time.c */
311 .shift = 22,
312 .set_next_event = u300_set_next_event,
313 .set_mode = u300_set_mode,
314};
315
316/* Clock event timer interrupt handler */
317static irqreturn_t u300_timer_interrupt(int irq, void *dev_id)
318{
319 struct clock_event_device *evt = &clockevent_u300_1mhz;
320 /* ACK/Clear timer IRQ for the APP GPT1 Timer */
321 writel(U300_TIMER_APP_GPT1IA_IRQ_ACK,
322 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT1IA);
323 evt->event_handler(evt);
324 return IRQ_HANDLED;
325}
326
327static struct irqaction u300_timer_irq = {
328 .name = "U300 Timer Tick",
329 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
330 .handler = u300_timer_interrupt,
331};
332
333/* Use general purpose timer 2 as clock source */
334static cycle_t u300_get_cycles(struct clocksource *cs)
335{
336 return (cycles_t) readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
337}
338
339static struct clocksource clocksource_u300_1mhz = {
340 .name = "GPT2",
341 .rating = 300, /* Reasonably fast and accurate clock source */
342 .read = u300_get_cycles,
343 .mask = CLOCKSOURCE_MASK(32), /* 32 bits */
344 /* 22 calculated using the algorithm in arch/mips/kernel/time.c */
345 .shift = 22,
346 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
347};
348
349
350/*
351 * This sets up the system timers, clock source and clock event.
352 */
353static void __init u300_timer_init(void)
354{
355 u300_enable_timer_clock();
356 /*
357 * Disable the "OS" and "DD" timers - these are designed for Symbian!
358 * Example usage in cnh1601578 cpu subsystem pd_timer_app.c
359 */
360 writel(U300_TIMER_APP_CRC_CLOCK_REQUEST_ENABLE,
361 U300_TIMER_APP_VBASE + U300_TIMER_APP_CRC);
362 writel(U300_TIMER_APP_ROST_TIMER_RESET,
363 U300_TIMER_APP_VBASE + U300_TIMER_APP_ROST);
364 writel(U300_TIMER_APP_DOST_TIMER_DISABLE,
365 U300_TIMER_APP_VBASE + U300_TIMER_APP_DOST);
366 writel(U300_TIMER_APP_RDDT_TIMER_RESET,
367 U300_TIMER_APP_VBASE + U300_TIMER_APP_RDDT);
368 writel(U300_TIMER_APP_DDDT_TIMER_DISABLE,
369 U300_TIMER_APP_VBASE + U300_TIMER_APP_DDDT);
370
371 /* Reset the General Purpose timer 1. */
372 writel(U300_TIMER_APP_RGPT1_TIMER_RESET,
373 U300_TIMER_APP_VBASE + U300_TIMER_APP_RGPT1);
374
375 /* Set up the IRQ handler */
376 setup_irq(IRQ_U300_TIMER_APP_GP1, &u300_timer_irq);
377
378 /* Reset the General Purpose timer 2 */
379 writel(U300_TIMER_APP_RGPT2_TIMER_RESET,
380 U300_TIMER_APP_VBASE + U300_TIMER_APP_RGPT2);
381 /* Set this timer to run around forever */
382 writel(0xFFFFFFFFU, U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2TC);
383 /* Set continuous mode so it wraps around */
384 writel(U300_TIMER_APP_SGPT2M_MODE_CONTINUOUS,
385 U300_TIMER_APP_VBASE + U300_TIMER_APP_SGPT2M);
386 /* Disable timer interrupts */
387 writel(U300_TIMER_APP_GPT2IE_IRQ_DISABLE,
388 U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2IE);
389 /* Then enable the GP2 timer to use as a free running us counter */
390 writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE,
391 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2);
392
393 /* This is a pure microsecond clock source */
394 clocksource_u300_1mhz.mult =
395 clocksource_khz2mult(1000, clocksource_u300_1mhz.shift);
396 if (clocksource_register(&clocksource_u300_1mhz))
397 printk(KERN_ERR "timer: failed to initialize clock "
398 "source %s\n", clocksource_u300_1mhz.name);
399
400 clockevent_u300_1mhz.mult =
401 div_sc(1000000, NSEC_PER_SEC, clockevent_u300_1mhz.shift);
402 /* 32bit counter, so 32bits delta is max */
403 clockevent_u300_1mhz.max_delta_ns =
404 clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz);
405 /* This timer is slow enough to set for 1 cycle == 1 MHz */
406 clockevent_u300_1mhz.min_delta_ns =
407 clockevent_delta2ns(1, &clockevent_u300_1mhz);
408 clockevent_u300_1mhz.cpumask = cpumask_of(0);
409 clockevents_register_device(&clockevent_u300_1mhz);
410 /*
411 * TODO: init and register the rest of the timers too, they can be
412 * used by hrtimers!
413 */
414}
415
416/*
417 * Very simple system timer that only register the clock event and
418 * clock source.
419 */
420struct sys_timer u300_timer = {
421 .init = u300_timer_init,
422};
diff --git a/arch/arm/mach-u300/u300.c b/arch/arm/mach-u300/u300.c
new file mode 100644
index 000000000000..d2a0b8847a18
--- /dev/null
+++ b/arch/arm/mach-u300/u300.c
@@ -0,0 +1,55 @@
1/*
2 *
3 * arch/arm/mach-u300/u300.c
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Platform machine definition.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mm.h>
14#include <linux/sched.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19#include <mach/hardware.h>
20#include <mach/platform.h>
21#include <mach/memory.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24
25static void __init u300_init_machine(void)
26{
27 u300_init_devices();
28}
29
30#ifdef CONFIG_MACH_U300_BS2X
31#define MACH_U300_STRING "Ericsson AB U300 S25/S26/B25/B26 Prototype Board"
32#endif
33
34#ifdef CONFIG_MACH_U300_BS330
35#define MACH_U300_STRING "Ericsson AB U330 S330/B330 Prototype Board"
36#endif
37
38#ifdef CONFIG_MACH_U300_BS335
39#define MACH_U300_STRING "Ericsson AB U335 S335/B335 Prototype Board"
40#endif
41
42#ifdef CONFIG_MACH_U300_BS365
43#define MACH_U300_STRING "Ericsson AB U365 S365/B365 Prototype Board"
44#endif
45
46MACHINE_START(U300, MACH_U300_STRING)
47 /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */
48 .phys_io = U300_AHB_PER_PHYS_BASE,
49 .io_pg_offst = ((U300_AHB_PER_VIRT_BASE) >> 18) & 0xfffc,
50 .boot_params = BOOT_PARAMS_OFFSET,
51 .map_io = u300_map_io,
52 .init_irq = u300_init_irq,
53 .timer = &u300_timer,
54 .init_machine = u300_init_machine,
55MACHINE_END
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index b3bebcc5623b..69214fc8bd19 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -116,7 +116,7 @@ void __init versatile_init_irq(void)
116{ 116{
117 unsigned int i; 117 unsigned int i;
118 118
119 vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0); 119 vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0);
120 120
121 set_irq_chained_handler(IRQ_VICSOURCE31, sic_handle_irq); 121 set_irq_chained_handler(IRQ_VICSOURCE31, sic_handle_irq);
122 122
diff --git a/arch/arm/mach-w90x900/Makefile b/arch/arm/mach-w90x900/Makefile
index 0c0c1d63f1c7..d50c94f4dbdf 100644
--- a/arch/arm/mach-w90x900/Makefile
+++ b/arch/arm/mach-w90x900/Makefile
@@ -4,7 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := irq.o time.o 7obj-y := irq.o time.o mfp-w90p910.o gpio.o clock.o
8 8
9# W90X900 CPU support files 9# W90X900 CPU support files
10 10
diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
new file mode 100644
index 000000000000..f420613cd395
--- /dev/null
+++ b/arch/arm/mach-w90x900/clock.c
@@ -0,0 +1,77 @@
1/*
2 * linux/arch/arm/mach-w90x900/clock.c
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/string.h>
19#include <linux/clk.h>
20#include <linux/spinlock.h>
21#include <linux/platform_device.h>
22#include <linux/io.h>
23
24#include <mach/hardware.h>
25
26#include "clock.h"
27
28static DEFINE_SPINLOCK(clocks_lock);
29
30int clk_enable(struct clk *clk)
31{
32 unsigned long flags;
33
34 spin_lock_irqsave(&clocks_lock, flags);
35 if (clk->enabled++ == 0)
36 (clk->enable)(clk, 1);
37 spin_unlock_irqrestore(&clocks_lock, flags);
38
39 return 0;
40}
41EXPORT_SYMBOL(clk_enable);
42
43void clk_disable(struct clk *clk)
44{
45 unsigned long flags;
46
47 WARN_ON(clk->enabled == 0);
48
49 spin_lock_irqsave(&clocks_lock, flags);
50 if (--clk->enabled == 0)
51 (clk->enable)(clk, 0);
52 spin_unlock_irqrestore(&clocks_lock, flags);
53}
54EXPORT_SYMBOL(clk_disable);
55
56void w90x900_clk_enable(struct clk *clk, int enable)
57{
58 unsigned int clocks = clk->cken;
59 unsigned long clken;
60
61 clken = __raw_readl(W90X900_VA_CLKPWR);
62
63 if (enable)
64 clken |= clocks;
65 else
66 clken &= ~clocks;
67
68 __raw_writel(clken, W90X900_VA_CLKPWR);
69}
70
71void clks_register(struct clk_lookup *clks, size_t num)
72{
73 int i;
74
75 for (i = 0; i < num; i++)
76 clkdev_add(&clks[i]);
77}
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h
new file mode 100644
index 000000000000..4f27bda76d56
--- /dev/null
+++ b/arch/arm/mach-w90x900/clock.h
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-w90x900/clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <asm/clkdev.h>
14
15void w90x900_clk_enable(struct clk *clk, int enable);
16void clks_register(struct clk_lookup *clks, size_t num);
17
18struct clk {
19 unsigned long cken;
20 unsigned int enabled;
21 void (*enable)(struct clk *, int enable);
22};
23
24#define DEFINE_CLK(_name, _ctrlbit) \
25struct clk clk_##_name = { \
26 .enable = w90x900_clk_enable, \
27 .cken = (1 << _ctrlbit), \
28 }
29
30#define DEF_CLKLOOK(_clk, _devname, _conname) \
31 { \
32 .clk = _clk, \
33 .dev_id = _devname, \
34 .con_id = _conname, \
35 }
36
diff --git a/arch/arm/mach-w90x900/cpu.h b/arch/arm/mach-w90x900/cpu.h
index de29ddcb9459..57b5dbabeb41 100644
--- a/arch/arm/mach-w90x900/cpu.h
+++ b/arch/arm/mach-w90x900/cpu.h
@@ -41,7 +41,7 @@ struct sys_timer;
41extern void w90x900_init_irq(void); 41extern void w90x900_init_irq(void);
42extern void w90p910_init_io(struct map_desc *mach_desc, int size); 42extern void w90p910_init_io(struct map_desc *mach_desc, int size);
43extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no); 43extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no);
44extern void w90p910_init_clocks(int xtal); 44extern void w90p910_init_clocks(void);
45extern void w90p910_map_io(struct map_desc *mach_desc, int size); 45extern void w90p910_map_io(struct map_desc *mach_desc, int size);
46extern struct platform_device w90p910_serial_device; 46extern struct platform_device w90p910_serial_device;
47extern struct sys_timer w90x900_timer; 47extern struct sys_timer w90x900_timer;
diff --git a/arch/arm/mach-w90x900/gpio.c b/arch/arm/mach-w90x900/gpio.c
new file mode 100644
index 000000000000..c72e0dfa1825
--- /dev/null
+++ b/arch/arm/mach-w90x900/gpio.c
@@ -0,0 +1,154 @@
1/*
2 * linux/arch/arm/mach-w90p910/gpio.c
3 *
4 * Generic w90p910 GPIO handling
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/clk.h>
14#include <linux/errno.h>
15#include <linux/interrupt.h>
16#include <linux/irq.h>
17#include <linux/debugfs.h>
18#include <linux/seq_file.h>
19#include <linux/kernel.h>
20#include <linux/list.h>
21#include <linux/module.h>
22#include <linux/io.h>
23#include <linux/gpio.h>
24
25#include <mach/hardware.h>
26
27#define GPIO_BASE (W90X900_VA_GPIO)
28#define GPIO_DIR (0x04)
29#define GPIO_OUT (0x08)
30#define GPIO_IN (0x0C)
31#define GROUPINERV (0x10)
32#define GPIO_GPIO(Nb) (0x00000001 << (Nb))
33#define to_w90p910_gpio_chip(c) container_of(c, struct w90p910_gpio_chip, chip)
34
35#define W90P910_GPIO_CHIP(name, base_gpio, nr_gpio) \
36 { \
37 .chip = { \
38 .label = name, \
39 .direction_input = w90p910_dir_input, \
40 .direction_output = w90p910_dir_output, \
41 .get = w90p910_gpio_get, \
42 .set = w90p910_gpio_set, \
43 .base = base_gpio, \
44 .ngpio = nr_gpio, \
45 } \
46 }
47
48struct w90p910_gpio_chip {
49 struct gpio_chip chip;
50 void __iomem *regbase; /* Base of group register*/
51 spinlock_t gpio_lock;
52};
53
54static int w90p910_gpio_get(struct gpio_chip *chip, unsigned offset)
55{
56 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
57 void __iomem *pio = w90p910_gpio->regbase + GPIO_IN;
58 unsigned int regval;
59
60 regval = __raw_readl(pio);
61 regval &= GPIO_GPIO(offset);
62
63 return (regval != 0);
64}
65
66static void w90p910_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
67{
68 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
69 void __iomem *pio = w90p910_gpio->regbase + GPIO_OUT;
70 unsigned int regval;
71 unsigned long flags;
72
73 spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
74
75 regval = __raw_readl(pio);
76
77 if (val)
78 regval |= GPIO_GPIO(offset);
79 else
80 regval &= ~GPIO_GPIO(offset);
81
82 __raw_writel(regval, pio);
83
84 spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
85}
86
87static int w90p910_dir_input(struct gpio_chip *chip, unsigned offset)
88{
89 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
90 void __iomem *pio = w90p910_gpio->regbase + GPIO_DIR;
91 unsigned int regval;
92 unsigned long flags;
93
94 spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
95
96 regval = __raw_readl(pio);
97 regval &= ~GPIO_GPIO(offset);
98 __raw_writel(regval, pio);
99
100 spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
101
102 return 0;
103}
104
105static int w90p910_dir_output(struct gpio_chip *chip, unsigned offset, int val)
106{
107 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
108 void __iomem *outreg = w90p910_gpio->regbase + GPIO_OUT;
109 void __iomem *pio = w90p910_gpio->regbase + GPIO_DIR;
110 unsigned int regval;
111 unsigned long flags;
112
113 spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
114
115 regval = __raw_readl(pio);
116 regval |= GPIO_GPIO(offset);
117 __raw_writel(regval, pio);
118
119 regval = __raw_readl(outreg);
120
121 if (val)
122 regval |= GPIO_GPIO(offset);
123 else
124 regval &= ~GPIO_GPIO(offset);
125
126 __raw_writel(regval, outreg);
127
128 spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
129
130 return 0;
131}
132
133static struct w90p910_gpio_chip w90p910_gpio[] = {
134 W90P910_GPIO_CHIP("GROUPC", 0, 16),
135 W90P910_GPIO_CHIP("GROUPD", 16, 10),
136 W90P910_GPIO_CHIP("GROUPE", 26, 14),
137 W90P910_GPIO_CHIP("GROUPF", 40, 10),
138 W90P910_GPIO_CHIP("GROUPG", 50, 17),
139 W90P910_GPIO_CHIP("GROUPH", 67, 8),
140 W90P910_GPIO_CHIP("GROUPI", 75, 17),
141};
142
143void __init w90p910_init_gpio(int nr_group)
144{
145 unsigned i;
146 struct w90p910_gpio_chip *gpio_chip;
147
148 for (i = 0; i < nr_group; i++) {
149 gpio_chip = &w90p910_gpio[i];
150 spin_lock_init(&gpio_chip->gpio_lock);
151 gpio_chip->regbase = GPIO_BASE + i * GROUPINERV;
152 gpiochip_add(&gpio_chip->chip);
153 }
154}
diff --git a/arch/arm/mach-w90x900/include/mach/clkdev.h b/arch/arm/mach-w90x900/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
new file mode 100644
index 000000000000..034da3e390c9
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -0,0 +1,34 @@
1/*
2 * linux/arch/arm/mach-w90p910/include/mach/gpio.h
3 *
4 * Generic w90p910 GPIO handling
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_W90P910_GPIO_H
14#define __ASM_ARCH_W90P910_GPIO_H
15
16#include <mach/hardware.h>
17#include <asm/irq.h>
18#include <asm-generic/gpio.h>
19
20#define gpio_get_value __gpio_get_value
21#define gpio_set_value __gpio_set_value
22#define gpio_cansleep __gpio_cansleep
23
24static inline int gpio_to_irq(unsigned gpio)
25{
26 return gpio;
27}
28
29static inline int irq_to_gpio(unsigned irq)
30{
31 return irq;
32}
33
34#endif
diff --git a/arch/arm/mach-w90x900/include/mach/irqs.h b/arch/arm/mach-w90x900/include/mach/irqs.h
index 1c583f9cbcde..9d5cba3a509f 100644
--- a/arch/arm/mach-w90x900/include/mach/irqs.h
+++ b/arch/arm/mach-w90x900/include/mach/irqs.h
@@ -1,8 +1,7 @@
1/* 1/*
2 * arch/arm/mach-w90x900/include/mach/irqs.h 2 * arch/arm/mach-w90x900/include/mach/irqs.h
3 * 3 *
4 * Copyright (c) 2008 Nuvoton technology corporation 4 * Copyright (c) 2008 Nuvoton technology corporation.
5 * All rights reserved.
6 * 5 *
7 * Wan ZongShun <mcuos.com@gmail.com> 6 * Wan ZongShun <mcuos.com@gmail.com>
8 * 7 *
@@ -10,8 +9,7 @@
10 * 9 *
11 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation;version 2 of the License.
14 * (at your option) any later version.
15 * 13 *
16 */ 14 */
17 15
@@ -31,6 +29,11 @@
31/* Main cpu interrupts */ 29/* Main cpu interrupts */
32 30
33#define IRQ_WDT W90X900_IRQ(1) 31#define IRQ_WDT W90X900_IRQ(1)
32#define IRQ_GROUP0 W90X900_IRQ(2)
33#define IRQ_GROUP1 W90X900_IRQ(3)
34#define IRQ_ACTL W90X900_IRQ(4)
35#define IRQ_LCD W90X900_IRQ(5)
36#define IRQ_RTC W90X900_IRQ(6)
34#define IRQ_UART0 W90X900_IRQ(7) 37#define IRQ_UART0 W90X900_IRQ(7)
35#define IRQ_UART1 W90X900_IRQ(8) 38#define IRQ_UART1 W90X900_IRQ(8)
36#define IRQ_UART2 W90X900_IRQ(9) 39#define IRQ_UART2 W90X900_IRQ(9)
@@ -39,7 +42,45 @@
39#define IRQ_TIMER0 W90X900_IRQ(12) 42#define IRQ_TIMER0 W90X900_IRQ(12)
40#define IRQ_TIMER1 W90X900_IRQ(13) 43#define IRQ_TIMER1 W90X900_IRQ(13)
41#define IRQ_T_INT_GROUP W90X900_IRQ(14) 44#define IRQ_T_INT_GROUP W90X900_IRQ(14)
45#define IRQ_USBH W90X900_IRQ(15)
46#define IRQ_EMCTX W90X900_IRQ(16)
47#define IRQ_EMCRX W90X900_IRQ(17)
48#define IRQ_GDMAGROUP W90X900_IRQ(18)
49#define IRQ_DMAC W90X900_IRQ(19)
50#define IRQ_FMI W90X900_IRQ(20)
51#define IRQ_USBD W90X900_IRQ(21)
52#define IRQ_ATAPI W90X900_IRQ(22)
53#define IRQ_G2D W90X900_IRQ(23)
54#define IRQ_PCI W90X900_IRQ(24)
55#define IRQ_SCGROUP W90X900_IRQ(25)
56#define IRQ_I2CGROUP W90X900_IRQ(26)
57#define IRQ_SSP W90X900_IRQ(27)
58#define IRQ_PWM W90X900_IRQ(28)
59#define IRQ_KPI W90X900_IRQ(29)
60#define IRQ_P2SGROUP W90X900_IRQ(30)
42#define IRQ_ADC W90X900_IRQ(31) 61#define IRQ_ADC W90X900_IRQ(31)
43#define NR_IRQS (IRQ_ADC+1) 62#define NR_IRQS (IRQ_ADC+1)
44 63
64/*for irq group*/
65
66#define IRQ_PS2_PORT0 0x10000000
67#define IRQ_PS2_PORT1 0x20000000
68#define IRQ_I2C_LINE0 0x04000000
69#define IRQ_I2C_LINE1 0x08000000
70#define IRQ_SC_CARD0 0x01000000
71#define IRQ_SC_CARD1 0x02000000
72#define IRQ_GDMA_CH0 0x00100000
73#define IRQ_GDMA_CH1 0x00200000
74#define IRQ_TIMER2 0x00010000
75#define IRQ_TIMER3 0x00020000
76#define IRQ_TIMER4 0x00040000
77#define IRQ_GROUP0_IRQ0 0x00000001
78#define IRQ_GROUP0_IRQ1 0x00000002
79#define IRQ_GROUP0_IRQ2 0x00000004
80#define IRQ_GROUP0_IRQ3 0x00000008
81#define IRQ_GROUP1_IRQ4 0x00000010
82#define IRQ_GROUP1_IRQ5 0x00000020
83#define IRQ_GROUP1_IRQ6 0x00000040
84#define IRQ_GROUP1_IRQ7 0x00000080
85
45#endif /* __ASM_ARCH_IRQ_H */ 86#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-w90x900/include/mach/map.h b/arch/arm/mach-w90x900/include/mach/map.h
index 79320ebe614b..1a2095304117 100644
--- a/arch/arm/mach-w90x900/include/mach/map.h
+++ b/arch/arm/mach-w90x900/include/mach/map.h
@@ -1,8 +1,7 @@
1/* 1/*
2 * arch/arm/mach-w90x900/include/mach/map.h 2 * arch/arm/mach-w90x900/include/mach/map.h
3 * 3 *
4 * Copyright (c) 2008 Nuvoton technology corporation 4 * Copyright (c) 2008 Nuvoton technology corporation.
5 * All rights reserved.
6 * 5 *
7 * Wan ZongShun <mcuos.com@gmail.com> 6 * Wan ZongShun <mcuos.com@gmail.com>
8 * 7 *
@@ -10,8 +9,7 @@
10 * 9 *
11 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation;version 2 of the License.
14 * (at your option) any later version.
15 * 13 *
16 */ 14 */
17 15
@@ -34,7 +32,6 @@
34 * interrupt controller is the first thing we put in, to make 32 * interrupt controller is the first thing we put in, to make
35 * the assembly code for the irq detection easier 33 * the assembly code for the irq detection easier
36 */ 34 */
37
38#define W90X900_VA_IRQ W90X900_ADDR(0x00000000) 35#define W90X900_VA_IRQ W90X900_ADDR(0x00000000)
39#define W90X900_PA_IRQ (0xB8002000) 36#define W90X900_PA_IRQ (0xB8002000)
40#define W90X900_SZ_IRQ SZ_4K 37#define W90X900_SZ_IRQ SZ_4K
@@ -44,33 +41,117 @@
44#define W90X900_SZ_GCR SZ_4K 41#define W90X900_SZ_GCR SZ_4K
45 42
46/* Clock and Power management */ 43/* Clock and Power management */
47
48#define W90X900_VA_CLKPWR (W90X900_VA_GCR+0x200) 44#define W90X900_VA_CLKPWR (W90X900_VA_GCR+0x200)
49#define W90X900_PA_CLKPWR (0xB0000200) 45#define W90X900_PA_CLKPWR (0xB0000200)
50#define W90X900_SZ_CLKPWR SZ_4K 46#define W90X900_SZ_CLKPWR SZ_4K
51 47
52/* EBI management */ 48/* EBI management */
53
54#define W90X900_VA_EBI W90X900_ADDR(0x00001000) 49#define W90X900_VA_EBI W90X900_ADDR(0x00001000)
55#define W90X900_PA_EBI (0xB0001000) 50#define W90X900_PA_EBI (0xB0001000)
56#define W90X900_SZ_EBI SZ_4K 51#define W90X900_SZ_EBI SZ_4K
57 52
58/* UARTs */ 53/* UARTs */
59
60#define W90X900_VA_UART W90X900_ADDR(0x08000000) 54#define W90X900_VA_UART W90X900_ADDR(0x08000000)
61#define W90X900_PA_UART (0xB8000000) 55#define W90X900_PA_UART (0xB8000000)
62#define W90X900_SZ_UART SZ_4K 56#define W90X900_SZ_UART SZ_4K
63 57
64/* Timers */ 58/* Timers */
65
66#define W90X900_VA_TIMER W90X900_ADDR(0x08001000) 59#define W90X900_VA_TIMER W90X900_ADDR(0x08001000)
67#define W90X900_PA_TIMER (0xB8001000) 60#define W90X900_PA_TIMER (0xB8001000)
68#define W90X900_SZ_TIMER SZ_4K 61#define W90X900_SZ_TIMER SZ_4K
69 62
70/* GPIO ports */ 63/* GPIO ports */
71
72#define W90X900_VA_GPIO W90X900_ADDR(0x08003000) 64#define W90X900_VA_GPIO W90X900_ADDR(0x08003000)
73#define W90X900_PA_GPIO (0xB8003000) 65#define W90X900_PA_GPIO (0xB8003000)
74#define W90X900_SZ_GPIO SZ_4K 66#define W90X900_SZ_GPIO SZ_4K
75 67
68/* GDMA control */
69#define W90X900_VA_GDMA W90X900_ADDR(0x00004000)
70#define W90X900_PA_GDMA (0xB0004000)
71#define W90X900_SZ_GDMA SZ_4K
72
73/* USB host controller*/
74#define W90X900_VA_USBEHCIHOST W90X900_ADDR(0x00005000)
75#define W90X900_PA_USBEHCIHOST (0xB0005000)
76#define W90X900_SZ_USBEHCIHOST SZ_4K
77
78#define W90X900_VA_USBOHCIHOST W90X900_ADDR(0x00007000)
79#define W90X900_PA_USBOHCIHOST (0xB0007000)
80#define W90X900_SZ_USBOHCIHOST SZ_4K
81
82/* I2C hardware controller */
83#define W90X900_VA_I2C W90X900_ADDR(0x08006000)
84#define W90X900_PA_I2C (0xB8006000)
85#define W90X900_SZ_I2C SZ_4K
86
87/* Keypad Interface*/
88#define W90X900_VA_KPI W90X900_ADDR(0x08008000)
89#define W90X900_PA_KPI (0xB8008000)
90#define W90X900_SZ_KPI SZ_4K
91
92/* Smart card host*/
93#define W90X900_VA_SC W90X900_ADDR(0x08005000)
94#define W90X900_PA_SC (0xB8005000)
95#define W90X900_SZ_SC SZ_4K
96
97/* LCD controller*/
98#define W90X900_VA_LCD W90X900_ADDR(0x00008000)
99#define W90X900_PA_LCD (0xB0008000)
100#define W90X900_SZ_LCD SZ_4K
101
102/* 2D controller*/
103#define W90X900_VA_GE W90X900_ADDR(0x0000B000)
104#define W90X900_PA_GE (0xB000B000)
105#define W90X900_SZ_GE SZ_4K
106
107/* ATAPI */
108#define W90X900_VA_ATAPI W90X900_ADDR(0x0000A000)
109#define W90X900_PA_ATAPI (0xB000A000)
110#define W90X900_SZ_ATAPI SZ_4K
111
112/* ADC */
113#define W90X900_VA_ADC W90X900_ADDR(0x0800A000)
114#define W90X900_PA_ADC (0xB800A000)
115#define W90X900_SZ_ADC SZ_4K
116
117/* PS2 Interface*/
118#define W90X900_VA_PS2 W90X900_ADDR(0x08009000)
119#define W90X900_PA_PS2 (0xB8009000)
120#define W90X900_SZ_PS2 SZ_4K
121
122/* RTC */
123#define W90X900_VA_RTC W90X900_ADDR(0x08004000)
124#define W90X900_PA_RTC (0xB8004000)
125#define W90X900_SZ_RTC SZ_4K
126
127/* Pulse Width Modulation(PWM) Registers */
128#define W90X900_VA_PWM W90X900_ADDR(0x08007000)
129#define W90X900_PA_PWM (0xB8007000)
130#define W90X900_SZ_PWM SZ_4K
131
132/* Audio Controller controller */
133#define W90X900_VA_ACTL W90X900_ADDR(0x00009000)
134#define W90X900_PA_ACTL (0xB0009000)
135#define W90X900_SZ_ACTL SZ_4K
136
137/* DMA controller */
138#define W90X900_VA_DMA W90X900_ADDR(0x0000c000)
139#define W90X900_PA_DMA (0xB000c000)
140#define W90X900_SZ_DMA SZ_4K
141
142/* FMI controller */
143#define W90X900_VA_FMI W90X900_ADDR(0x0000d000)
144#define W90X900_PA_FMI (0xB000d000)
145#define W90X900_SZ_FMI SZ_4K
146
147/* USB Device port */
148#define W90X900_VA_USBDEV W90X900_ADDR(0x00006000)
149#define W90X900_PA_USBDEV (0xB0006000)
150#define W90X900_SZ_USBDEV SZ_4K
151
152/* External MAC control*/
153#define W90X900_VA_EMC W90X900_ADDR(0x00003000)
154#define W90X900_PA_EMC (0xB0003000)
155#define W90X900_SZ_EMC SZ_4K
156
76#endif /* __ASM_ARCH_MAP_H */ 157#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-clock.h b/arch/arm/mach-w90x900/include/mach/regs-clock.h
new file mode 100644
index 000000000000..f10b6a8dc069
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/regs-clock.h
@@ -0,0 +1,31 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/regs-clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_REGS_CLOCK_H
15#define __ASM_ARCH_REGS_CLOCK_H
16
17/* Clock Control Registers */
18#define CLK_BA W90X900_VA_CLKPWR
19#define REG_CLKEN (CLK_BA + 0x00)
20#define REG_CLKSEL (CLK_BA + 0x04)
21#define REG_CLKDIV (CLK_BA + 0x08)
22#define REG_PLLCON0 (CLK_BA + 0x0C)
23#define REG_PLLCON1 (CLK_BA + 0x10)
24#define REG_PMCON (CLK_BA + 0x14)
25#define REG_IRQWAKECON (CLK_BA + 0x18)
26#define REG_IRQWAKEFLAG (CLK_BA + 0x1C)
27#define REG_IPSRST (CLK_BA + 0x20)
28#define REG_CLKEN1 (CLK_BA + 0x24)
29#define REG_CLKDIV1 (CLK_BA + 0x28)
30
31#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-usb.h b/arch/arm/mach-w90x900/include/mach/regs-usb.h
new file mode 100644
index 000000000000..ab74b0c2480b
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/regs-usb.h
@@ -0,0 +1,35 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/regs-usb.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_REGS_USB_H
15#define __ASM_ARCH_REGS_USB_H
16
17/* usb Control Registers */
18#define USBH_BA W90X900_VA_USBEHCIHOST
19#define USBD_BA W90X900_VA_USBDEV
20#define USBO_BA W90X900_VA_USBOHCIHOST
21
22/* USB Host Control Registers */
23#define REG_UPSCR0 (USBH_BA+0x064)
24#define REG_UPSCR1 (USBH_BA+0x068)
25#define REG_USBPCR0 (USBH_BA+0x0C4)
26#define REG_USBPCR1 (USBH_BA+0x0C8)
27
28/* USBH OHCI Control Registers */
29#define REG_OpModEn (USBO_BA+0x204)
30/*This bit controls the polarity of over
31*current flag from external power IC.
32*/
33#define OCALow 0x08
34
35#endif /* __ASM_ARCH_REGS_USB_H */
diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c
index 726ff6798a56..7a62bd348e80 100644
--- a/arch/arm/mach-w90x900/mach-w90p910evb.c
+++ b/arch/arm/mach-w90x900/mach-w90p910evb.c
@@ -3,15 +3,13 @@
3 * 3 *
4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche 4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
5 * 5 *
6 * Copyright (C) 2008 Nuvoton technology corporation 6 * Copyright (C) 2008 Nuvoton technology corporation.
7 * All rights reserved.
8 * 7 *
9 * Wan ZongShun <mcuos.com@gmail.com> 8 * Wan ZongShun <mcuos.com@gmail.com>
10 * 9 *
11 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as 11 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of 12 * published by the Free Software Foundation;version 2 of the License.
14 * the License, or (at your option) any later version.
15 * 13 *
16 */ 14 */
17 15
@@ -80,6 +78,156 @@ static struct platform_device w90p910_flash_device = {
80 .num_resources = ARRAY_SIZE(w90p910_flash_resources), 78 .num_resources = ARRAY_SIZE(w90p910_flash_resources),
81}; 79};
82 80
81/* USB EHCI Host Controller */
82
83static struct resource w90x900_usb_ehci_resource[] = {
84 [0] = {
85 .start = W90X900_PA_USBEHCIHOST,
86 .end = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
87 .flags = IORESOURCE_MEM,
88 },
89 [1] = {
90 .start = IRQ_USBH,
91 .end = IRQ_USBH,
92 .flags = IORESOURCE_IRQ,
93 }
94};
95
96static u64 w90x900_device_usb_ehci_dmamask = 0xffffffffUL;
97
98struct platform_device w90x900_device_usb_ehci = {
99 .name = "w90x900-ehci",
100 .id = -1,
101 .num_resources = ARRAY_SIZE(w90x900_usb_ehci_resource),
102 .resource = w90x900_usb_ehci_resource,
103 .dev = {
104 .dma_mask = &w90x900_device_usb_ehci_dmamask,
105 .coherent_dma_mask = 0xffffffffUL
106 }
107};
108EXPORT_SYMBOL(w90x900_device_usb_ehci);
109
110/* USB OHCI Host Controller */
111
112static struct resource w90x900_usb_ohci_resource[] = {
113 [0] = {
114 .start = W90X900_PA_USBOHCIHOST,
115 .end = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = IRQ_USBH,
120 .end = IRQ_USBH,
121 .flags = IORESOURCE_IRQ,
122 }
123};
124
125static u64 w90x900_device_usb_ohci_dmamask = 0xffffffffUL;
126struct platform_device w90x900_device_usb_ohci = {
127 .name = "w90x900-ohci",
128 .id = -1,
129 .num_resources = ARRAY_SIZE(w90x900_usb_ohci_resource),
130 .resource = w90x900_usb_ohci_resource,
131 .dev = {
132 .dma_mask = &w90x900_device_usb_ohci_dmamask,
133 .coherent_dma_mask = 0xffffffffUL
134 }
135};
136EXPORT_SYMBOL(w90x900_device_usb_ohci);
137
138/*TouchScreen controller*/
139
140static struct resource w90x900_ts_resource[] = {
141 [0] = {
142 .start = W90X900_PA_ADC,
143 .end = W90X900_PA_ADC + W90X900_SZ_ADC-1,
144 .flags = IORESOURCE_MEM,
145 },
146 [1] = {
147 .start = IRQ_ADC,
148 .end = IRQ_ADC,
149 .flags = IORESOURCE_IRQ,
150 },
151};
152
153struct platform_device w90x900_device_ts = {
154 .name = "w90x900-ts",
155 .id = -1,
156 .resource = w90x900_ts_resource,
157 .num_resources = ARRAY_SIZE(w90x900_ts_resource),
158};
159EXPORT_SYMBOL(w90x900_device_ts);
160
161/* RTC controller*/
162
163static struct resource w90x900_rtc_resource[] = {
164 [0] = {
165 .start = W90X900_PA_RTC,
166 .end = W90X900_PA_RTC + 0xff,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = {
170 .start = IRQ_RTC,
171 .end = IRQ_RTC,
172 .flags = IORESOURCE_IRQ,
173 },
174};
175
176struct platform_device w90x900_device_rtc = {
177 .name = "w90x900-rtc",
178 .id = -1,
179 .num_resources = ARRAY_SIZE(w90x900_rtc_resource),
180 .resource = w90x900_rtc_resource,
181};
182EXPORT_SYMBOL(w90x900_device_rtc);
183
184/* KPI controller*/
185
186static struct resource w90x900_kpi_resource[] = {
187 [0] = {
188 .start = W90X900_PA_KPI,
189 .end = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
190 .flags = IORESOURCE_MEM,
191 },
192 [1] = {
193 .start = IRQ_KPI,
194 .end = IRQ_KPI,
195 .flags = IORESOURCE_IRQ,
196 }
197
198};
199
200struct platform_device w90x900_device_kpi = {
201 .name = "w90x900-kpi",
202 .id = -1,
203 .num_resources = ARRAY_SIZE(w90x900_kpi_resource),
204 .resource = w90x900_kpi_resource,
205};
206EXPORT_SYMBOL(w90x900_device_kpi);
207
208/* USB Device (Gadget)*/
209
210static struct resource w90x900_usbgadget_resource[] = {
211 [0] = {
212 .start = W90X900_PA_USBDEV,
213 .end = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
214 .flags = IORESOURCE_MEM,
215 },
216 [1] = {
217 .start = IRQ_USBD,
218 .end = IRQ_USBD,
219 .flags = IORESOURCE_IRQ,
220 }
221};
222
223struct platform_device w90x900_device_usbgadget = {
224 .name = "w90x900-usbgadget",
225 .id = -1,
226 .num_resources = ARRAY_SIZE(w90x900_usbgadget_resource),
227 .resource = w90x900_usbgadget_resource,
228};
229EXPORT_SYMBOL(w90x900_device_usbgadget);
230
83static struct map_desc w90p910_iodesc[] __initdata = { 231static struct map_desc w90p910_iodesc[] __initdata = {
84}; 232};
85 233
@@ -88,12 +236,18 @@ static struct map_desc w90p910_iodesc[] __initdata = {
88static struct platform_device *w90p910evb_dev[] __initdata = { 236static struct platform_device *w90p910evb_dev[] __initdata = {
89 &w90p910_serial_device, 237 &w90p910_serial_device,
90 &w90p910_flash_device, 238 &w90p910_flash_device,
239 &w90x900_device_usb_ehci,
240 &w90x900_device_usb_ohci,
241 &w90x900_device_ts,
242 &w90x900_device_rtc,
243 &w90x900_device_kpi,
244 &w90x900_device_usbgadget,
91}; 245};
92 246
93static void __init w90p910evb_map_io(void) 247static void __init w90p910evb_map_io(void)
94{ 248{
95 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc)); 249 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
96 w90p910_init_clocks(0); 250 w90p910_init_clocks();
97} 251}
98 252
99static void __init w90p910evb_init(void) 253static void __init w90p910evb_init(void)
diff --git a/arch/arm/mach-w90x900/mfp-w90p910.c b/arch/arm/mach-w90x900/mfp-w90p910.c
new file mode 100644
index 000000000000..a3520fefb5e7
--- /dev/null
+++ b/arch/arm/mach-w90x900/mfp-w90p910.c
@@ -0,0 +1,116 @@
1/*
2 * linux/arch/arm/mach-w90x900/mfp-w90p910.c
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/device.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/string.h>
20#include <linux/clk.h>
21#include <linux/mutex.h>
22#include <linux/io.h>
23
24#include <mach/hardware.h>
25
26#define REG_MFSEL (W90X900_VA_GCR + 0xC)
27
28#define GPSELF (0x01 << 1)
29
30#define GPSELC (0x03 << 2)
31#define ENKPI (0x02 << 2)
32#define ENNAND (0x01 << 2)
33
34#define GPSELEI0 (0x01 << 26)
35#define GPSELEI1 (0x01 << 27)
36
37static DECLARE_MUTEX(mfp_sem);
38
39void mfp_set_groupf(struct device *dev)
40{
41 unsigned long mfpen;
42 const char *dev_id;
43
44 BUG_ON(!dev);
45
46 down(&mfp_sem);
47
48 dev_id = dev_name(dev);
49
50 mfpen = __raw_readl(REG_MFSEL);
51
52 if (strcmp(dev_id, "w90p910-emc") == 0)
53 mfpen |= GPSELF;/*enable mac*/
54 else
55 mfpen &= ~GPSELF;/*GPIOF[9:0]*/
56
57 __raw_writel(mfpen, REG_MFSEL);
58
59 up(&mfp_sem);
60}
61EXPORT_SYMBOL(mfp_set_groupf);
62
63void mfp_set_groupc(struct device *dev)
64{
65 unsigned long mfpen;
66 const char *dev_id;
67
68 BUG_ON(!dev);
69
70 down(&mfp_sem);
71
72 dev_id = dev_name(dev);
73
74 mfpen = __raw_readl(REG_MFSEL);
75
76 if (strcmp(dev_id, "w90p910-lcd") == 0)
77 mfpen |= GPSELC;/*enable lcd*/
78 else if (strcmp(dev_id, "w90p910-kpi") == 0) {
79 mfpen &= (~GPSELC);/*enable kpi*/
80 mfpen |= ENKPI;
81 } else if (strcmp(dev_id, "w90p910-nand") == 0) {
82 mfpen &= (~GPSELC);/*enable nand*/
83 mfpen |= ENNAND;
84 } else
85 mfpen &= (~GPSELC);/*GPIOC[14:0]*/
86
87 __raw_writel(mfpen, REG_MFSEL);
88
89 up(&mfp_sem);
90}
91EXPORT_SYMBOL(mfp_set_groupc);
92
93void mfp_set_groupi(struct device *dev, int gpio)
94{
95 unsigned long mfpen;
96 const char *dev_id;
97
98 BUG_ON(!dev);
99
100 down(&mfp_sem);
101
102 dev_id = dev_name(dev);
103
104 mfpen = __raw_readl(REG_MFSEL);
105
106 if (strcmp(dev_id, "w90p910-wdog") == 0)
107 mfpen |= GPSELEI1;/*enable wdog*/
108 else if (strcmp(dev_id, "w90p910-atapi") == 0)
109 mfpen |= GPSELEI0;/*enable atapi*/
110
111 __raw_writel(mfpen, REG_MFSEL);
112
113 up(&mfp_sem);
114}
115EXPORT_SYMBOL(mfp_set_groupi);
116
diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c
index 2bcbaa681b99..1c97e4930b7a 100644
--- a/arch/arm/mach-w90x900/w90p910.c
+++ b/arch/arm/mach-w90x900/w90p910.c
@@ -3,8 +3,7 @@
3 * 3 *
4 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks 4 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
5 * 5 *
6 * Copyright (c) 2008 Nuvoton technology corporation 6 * Copyright (c) 2008 Nuvoton technology corporation.
7 * All rights reserved.
8 * 7 *
9 * Wan ZongShun <mcuos.com@gmail.com> 8 * Wan ZongShun <mcuos.com@gmail.com>
10 * 9 *
@@ -12,8 +11,7 @@
12 * 11 *
13 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or 14 * the Free Software Foundation;version 2 of the License.
16 * (at your option) any later version.
17 * 15 *
18 */ 16 */
19 17
@@ -36,6 +34,7 @@
36#include <mach/regs-serial.h> 34#include <mach/regs-serial.h>
37 35
38#include "cpu.h" 36#include "cpu.h"
37#include "clock.h"
39 38
40/* Initial IO mappings */ 39/* Initial IO mappings */
41 40
@@ -45,9 +44,52 @@ static struct map_desc w90p910_iodesc[] __initdata = {
45 IODESC_ENT(UART), 44 IODESC_ENT(UART),
46 IODESC_ENT(TIMER), 45 IODESC_ENT(TIMER),
47 IODESC_ENT(EBI), 46 IODESC_ENT(EBI),
47 IODESC_ENT(USBEHCIHOST),
48 IODESC_ENT(USBOHCIHOST),
49 IODESC_ENT(ADC),
50 IODESC_ENT(RTC),
51 IODESC_ENT(KPI),
52 IODESC_ENT(USBDEV),
48 /*IODESC_ENT(LCD),*/ 53 /*IODESC_ENT(LCD),*/
49}; 54};
50 55
56/* Initial clock declarations. */
57static DEFINE_CLK(lcd, 0);
58static DEFINE_CLK(audio, 1);
59static DEFINE_CLK(fmi, 4);
60static DEFINE_CLK(dmac, 5);
61static DEFINE_CLK(atapi, 6);
62static DEFINE_CLK(emc, 7);
63static DEFINE_CLK(usbd, 8);
64static DEFINE_CLK(usbh, 9);
65static DEFINE_CLK(g2d, 10);;
66static DEFINE_CLK(pwm, 18);
67static DEFINE_CLK(ps2, 24);
68static DEFINE_CLK(kpi, 25);
69static DEFINE_CLK(wdt, 26);
70static DEFINE_CLK(gdma, 27);
71static DEFINE_CLK(adc, 28);
72static DEFINE_CLK(usi, 29);
73
74static struct clk_lookup w90p910_clkregs[] = {
75 DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL),
76 DEF_CLKLOOK(&clk_audio, "w90p910-audio", NULL),
77 DEF_CLKLOOK(&clk_fmi, "w90p910-fmi", NULL),
78 DEF_CLKLOOK(&clk_dmac, "w90p910-dmac", NULL),
79 DEF_CLKLOOK(&clk_atapi, "w90p910-atapi", NULL),
80 DEF_CLKLOOK(&clk_emc, "w90p910-emc", NULL),
81 DEF_CLKLOOK(&clk_usbd, "w90p910-usbd", NULL),
82 DEF_CLKLOOK(&clk_usbh, "w90p910-usbh", NULL),
83 DEF_CLKLOOK(&clk_g2d, "w90p910-g2d", NULL),
84 DEF_CLKLOOK(&clk_pwm, "w90p910-pwm", NULL),
85 DEF_CLKLOOK(&clk_ps2, "w90p910-ps2", NULL),
86 DEF_CLKLOOK(&clk_kpi, "w90p910-kpi", NULL),
87 DEF_CLKLOOK(&clk_wdt, "w90p910-wdt", NULL),
88 DEF_CLKLOOK(&clk_gdma, "w90p910-gdma", NULL),
89 DEF_CLKLOOK(&clk_adc, "w90p910-adc", NULL),
90 DEF_CLKLOOK(&clk_usi, "w90p910-usi", NULL),
91};
92
51/* Initial serial platform data */ 93/* Initial serial platform data */
52 94
53struct plat_serial8250_port w90p910_uart_data[] = { 95struct plat_serial8250_port w90p910_uart_data[] = {
@@ -77,8 +119,9 @@ void __init w90p910_map_io(struct map_desc *mach_desc, int mach_size)
77 119
78/*Init W90P910 clock*/ 120/*Init W90P910 clock*/
79 121
80void __init w90p910_init_clocks(int xtal) 122void __init w90p910_init_clocks(void)
81{ 123{
124 clks_register(w90p910_clkregs, ARRAY_SIZE(w90p910_clkregs));
82} 125}
83 126
84static int __init w90p910_init_cpu(void) 127static int __init w90p910_init_cpu(void)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 20979564e7ee..83c025e72ceb 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -391,7 +391,7 @@ config CPU_FEROCEON_OLD_ID
391 391
392# ARMv6 392# ARMv6
393config CPU_V6 393config CPU_V6
394 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB 394 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
395 select CPU_32v6 395 select CPU_32v6
396 select CPU_ABRT_EV6 396 select CPU_ABRT_EV6
397 select CPU_PABRT_NOIFAR 397 select CPU_PABRT_NOIFAR
@@ -416,7 +416,7 @@ config CPU_32v6K
416 416
417# ARMv7 417# ARMv7
418config CPU_V7 418config CPU_V7
419 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB 419 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
420 select CPU_32v6K 420 select CPU_32v6K
421 select CPU_32v7 421 select CPU_32v7
422 select CPU_ABRT_EV7 422 select CPU_ABRT_EV7
@@ -639,10 +639,23 @@ config CPU_BIG_ENDIAN
639 port must properly enable any big-endian related features 639 port must properly enable any big-endian related features
640 of your chipset/board/processor. 640 of your chipset/board/processor.
641 641
642config CPU_ENDIAN_BE8
643 bool
644 depends on CPU_BIG_ENDIAN
645 default CPU_V6 || CPU_V7
646 help
647 Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
648
649config CPU_ENDIAN_BE32
650 bool
651 depends on CPU_BIG_ENDIAN
652 default !CPU_ENDIAN_BE8
653 help
654 Support for the BE-32 (big-endian) mode on pre-ARMv6 processors.
655
642config CPU_HIGH_VECTOR 656config CPU_HIGH_VECTOR
643 depends on !MMU && CPU_CP15 && !CPU_ARM740T 657 depends on !MMU && CPU_CP15 && !CPU_ARM740T
644 bool "Select the High exception vector" 658 bool "Select the High exception vector"
645 default n
646 help 659 help
647 Say Y here to select high exception vector(0xFFFF0000~). 660 Say Y here to select high exception vector(0xFFFF0000~).
648 The exception vector can be vary depending on the platform 661 The exception vector can be vary depending on the platform
@@ -726,7 +739,6 @@ config NEEDS_SYSCALL_FOR_CMPXCHG
726 739
727config OUTER_CACHE 740config OUTER_CACHE
728 bool 741 bool
729 default n
730 742
731config CACHE_FEROCEON_L2 743config CACHE_FEROCEON_L2
732 bool "Enable the Feroceon L2 cache controller" 744 bool "Enable the Feroceon L2 cache controller"
@@ -739,7 +751,6 @@ config CACHE_FEROCEON_L2
739config CACHE_FEROCEON_L2_WRITETHROUGH 751config CACHE_FEROCEON_L2_WRITETHROUGH
740 bool "Force Feroceon L2 cache write through" 752 bool "Force Feroceon L2 cache write through"
741 depends on CACHE_FEROCEON_L2 753 depends on CACHE_FEROCEON_L2
742 default n
743 help 754 help
744 Say Y here to use the Feroceon L2 cache in writethrough mode. 755 Say Y here to use the Feroceon L2 cache in writethrough mode.
745 Unless you specifically require this, say N for writeback mode. 756 Unless you specifically require this, say N for writeback mode.
@@ -747,7 +758,7 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
747config CACHE_L2X0 758config CACHE_L2X0
748 bool "Enable the L2x0 outer cache controller" 759 bool "Enable the L2x0 outer cache controller"
749 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 760 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
750 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 761 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX
751 default y 762 default y
752 select OUTER_CACHE 763 select OUTER_CACHE
753 help 764 help
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
index 6f7e70907e44..f332df7f0d37 100644
--- a/arch/arm/mm/abort-ev6.S
+++ b/arch/arm/mm/abort-ev6.S
@@ -37,6 +37,9 @@ ENTRY(v6_early_abort)
37 movne pc, lr 37 movne pc, lr
38 do_thumb_abort 38 do_thumb_abort
39 ldreq r3, [r2] @ read aborted ARM instruction 39 ldreq r3, [r2] @ read aborted ARM instruction
40#ifdef CONFIG_CPU_ENDIAN_BE8
41 reveq r3, r3
42#endif
40 do_ldrd_abort 43 do_ldrd_abort
41 tst r3, #1 << 20 @ L = 0 -> write 44 tst r3, #1 << 20 @ L = 0 -> write
42 orreq r1, r1, #1 << 11 @ yes. 45 orreq r1, r1, #1 << 11 @ yes.
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 9f88dd3be601..0ab75c60f7cf 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -110,6 +110,12 @@ static int remap_area_pages(unsigned long start, unsigned long pfn,
110 return err; 110 return err;
111} 111}
112 112
113int ioremap_page(unsigned long virt, unsigned long phys,
114 const struct mem_type *mtype)
115{
116 return remap_area_pages(virt, __phys_to_pfn(phys), PAGE_SIZE, mtype);
117}
118EXPORT_SYMBOL(ioremap_page);
113 119
114void __check_kvm_seq(struct mm_struct *mm) 120void __check_kvm_seq(struct mm_struct *mm)
115{ 121{
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index e6344ece00ce..fdaa9bb87c16 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -255,6 +255,7 @@ const struct mem_type *get_mem_type(unsigned int type)
255{ 255{
256 return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL; 256 return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL;
257} 257}
258EXPORT_SYMBOL(get_mem_type);
258 259
259/* 260/*
260 * Adjust the PMD section entries according to the CPU in use. 261 * Adjust the PMD section entries according to the CPU in use.
@@ -839,6 +840,20 @@ void __init reserve_node_zero(pg_data_t *pgdat)
839 reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, 840 reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
840 BOOTMEM_EXCLUSIVE); 841 BOOTMEM_EXCLUSIVE);
841 842
843 /*
844 * U300 - This platform family can share physical memory
845 * between two ARM cpus, one running Linux and the other
846 * running another OS.
847 */
848 if (machine_is_u300()) {
849#ifdef CONFIG_MACH_U300_SINGLE_RAM
850#if ((CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1) == 1) && \
851 CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
852 res_size = 0x00100000;
853#endif
854#endif
855 }
856
842#ifdef CONFIG_SA1111 857#ifdef CONFIG_SA1111
843 /* 858 /*
844 * Because of the SA1111 DMA bug, we want to preserve our 859 * Because of the SA1111 DMA bug, we want to preserve our
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 087e239704df..524ddae92595 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -170,6 +170,9 @@ __v6_setup:
170#endif /* CONFIG_MMU */ 170#endif /* CONFIG_MMU */
171 adr r5, v6_crval 171 adr r5, v6_crval
172 ldmia r5, {r5, r6} 172 ldmia r5, {r5, r6}
173#ifdef CONFIG_CPU_ENDIAN_BE8
174 orr r6, r6, #1 << 25 @ big-endian page tables
175#endif
173 mrc p15, 0, r0, c1, c0, 0 @ read control register 176 mrc p15, 0, r0, c1, c0, 0 @ read control register
174 bic r0, r0, r5 @ clear bits them 177 bic r0, r0, r5 @ clear bits them
175 orr r0, r0, r6 @ set them 178 orr r0, r0, r6 @ set them
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index a08d9d2380d3..180a08d03a03 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -19,17 +19,23 @@
19 19
20#include "proc-macros.S" 20#include "proc-macros.S"
21 21
22#define TTB_C (1 << 0)
23#define TTB_S (1 << 1) 22#define TTB_S (1 << 1)
24#define TTB_RGN_NC (0 << 3) 23#define TTB_RGN_NC (0 << 3)
25#define TTB_RGN_OC_WBWA (1 << 3) 24#define TTB_RGN_OC_WBWA (1 << 3)
26#define TTB_RGN_OC_WT (2 << 3) 25#define TTB_RGN_OC_WT (2 << 3)
27#define TTB_RGN_OC_WB (3 << 3) 26#define TTB_RGN_OC_WB (3 << 3)
27#define TTB_NOS (1 << 5)
28#define TTB_IRGN_NC ((0 << 0) | (0 << 6))
29#define TTB_IRGN_WBWA ((0 << 0) | (1 << 6))
30#define TTB_IRGN_WT ((1 << 0) | (0 << 6))
31#define TTB_IRGN_WB ((1 << 0) | (1 << 6))
28 32
29#ifndef CONFIG_SMP 33#ifndef CONFIG_SMP
30#define TTB_FLAGS TTB_C|TTB_RGN_OC_WB @ mark PTWs cacheable, outer WB 34/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
35#define TTB_FLAGS TTB_IRGN_WB|TTB_RGN_OC_WB
31#else 36#else
32#define TTB_FLAGS TTB_C|TTB_S|TTB_RGN_OC_WBWA @ mark PTWs cacheable and shared, outer WBWA 37/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
38#define TTB_FLAGS TTB_IRGN_WBWA|TTB_S|TTB_NOS|TTB_RGN_OC_WBWA
33#endif 39#endif
34 40
35ENTRY(cpu_v7_proc_init) 41ENTRY(cpu_v7_proc_init)
@@ -176,8 +182,8 @@ cpu_v7_name:
176 */ 182 */
177__v7_setup: 183__v7_setup:
178#ifdef CONFIG_SMP 184#ifdef CONFIG_SMP
179 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode 185 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode and
180 orr r0, r0, #(0x1 << 6) 186 orr r0, r0, #(1 << 6) | (1 << 0) @ TLB ops broadcasting
181 mcr p15, 0, r0, c1, c0, 1 187 mcr p15, 0, r0, c1, c0, 1
182#endif 188#endif
183 adr r12, __v7_setup_stack @ the local stack 189 adr r12, __v7_setup_stack @ the local stack
@@ -227,12 +233,43 @@ __v7_setup:
227 mov r10, #0x1f @ domains 0, 1 = manager 233 mov r10, #0x1f @ domains 0, 1 = manager
228 mcr p15, 0, r10, c3, c0, 0 @ load domain access register 234 mcr p15, 0, r10, c3, c0, 0 @ load domain access register
229#endif 235#endif
230 ldr r5, =0xff0aa1a8 236 /*
231 ldr r6, =0x40e040e0 237 * Memory region attributes with SCTLR.TRE=1
238 *
239 * n = TEX[0],C,B
240 * TR = PRRR[2n+1:2n] - memory type
241 * IR = NMRR[2n+1:2n] - inner cacheable property
242 * OR = NMRR[2n+17:2n+16] - outer cacheable property
243 *
244 * n TR IR OR
245 * UNCACHED 000 00
246 * BUFFERABLE 001 10 00 00
247 * WRITETHROUGH 010 10 10 10
248 * WRITEBACK 011 10 11 11
249 * reserved 110
250 * WRITEALLOC 111 10 01 01
251 * DEV_SHARED 100 01
252 * DEV_NONSHARED 100 01
253 * DEV_WC 001 10
254 * DEV_CACHED 011 10
255 *
256 * Other attributes:
257 *
258 * DS0 = PRRR[16] = 0 - device shareable property
259 * DS1 = PRRR[17] = 1 - device shareable property
260 * NS0 = PRRR[18] = 0 - normal shareable property
261 * NS1 = PRRR[19] = 1 - normal shareable property
262 * NOS = PRRR[24+n] = 1 - not outer shareable
263 */
264 ldr r5, =0xff0a81a8 @ PRRR
265 ldr r6, =0x40e040e0 @ NMRR
232 mcr p15, 0, r5, c10, c2, 0 @ write PRRR 266 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
233 mcr p15, 0, r6, c10, c2, 1 @ write NMRR 267 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
234 adr r5, v7_crval 268 adr r5, v7_crval
235 ldmia r5, {r5, r6} 269 ldmia r5, {r5, r6}
270#ifdef CONFIG_CPU_ENDIAN_BE8
271 orr r6, r6, #1 << 25 @ big-endian page tables
272#endif
236 mrc p15, 0, r0, c1, c0, 0 @ read control register 273 mrc p15, 0, r0, c1, c0, 0 @ read control register
237 bic r0, r0, r5 @ clear bits them 274 bic r0, r0, r5 @ clear bits them
238 orr r0, r0, r6 @ set them 275 orr r0, r0, r6 @ set them
@@ -240,14 +277,14 @@ __v7_setup:
240ENDPROC(__v7_setup) 277ENDPROC(__v7_setup)
241 278
242 /* AT 279 /* AT
243 * TFR EV X F I D LR 280 * TFR EV X F I D LR S
244 * .EEE ..EE PUI. .T.T 4RVI ZFRS BLDP WCAM 281 * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM
245 * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced 282 * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
246 * 1 0 110 0011 1.00 .111 1101 < we want 283 * 1 0 110 0011 1100 .111 1101 < we want
247 */ 284 */
248 .type v7_crval, #object 285 .type v7_crval, #object
249v7_crval: 286v7_crval:
250 crval clear=0x0120c302, mmuset=0x10c0387d, ucset=0x00c0187c 287 crval clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
251 288
252__v7_setup_stack: 289__v7_setup_stack:
253 .space 4 * 11 @ 11 registers 290 .space 4 * 11 @ 11 registers
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index b637e7380ab7..a26a605b73bd 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -42,9 +42,11 @@ ENTRY(v7wbi_flush_user_tlb_range)
42 mov r1, r1, lsl #PAGE_SHIFT 42 mov r1, r1, lsl #PAGE_SHIFT
43 vma_vm_flags r2, r2 @ get vma->vm_flags 43 vma_vm_flags r2, r2 @ get vma->vm_flags
441: 441:
45 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA (was 1) 45#ifdef CONFIG_SMP
46 tst r2, #VM_EXEC @ Executable area ? 46 mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable)
47 mcrne p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA (was 1) 47#else
48 mcr p15, 0, r0, c8, c7, 1 @ TLB invalidate U MVA
49#endif
48 add r0, r0, #PAGE_SZ 50 add r0, r0, #PAGE_SZ
49 cmp r0, r1 51 cmp r0, r1
50 blo 1b 52 blo 1b
@@ -69,8 +71,11 @@ ENTRY(v7wbi_flush_kern_tlb_range)
69 mov r0, r0, lsl #PAGE_SHIFT 71 mov r0, r0, lsl #PAGE_SHIFT
70 mov r1, r1, lsl #PAGE_SHIFT 72 mov r1, r1, lsl #PAGE_SHIFT
711: 731:
72 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA 74#ifdef CONFIG_SMP
73 mcr p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA 75 mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable)
76#else
77 mcr p15, 0, r0, c8, c7, 1 @ TLB invalidate U MVA
78#endif
74 add r0, r0, #PAGE_SZ 79 add r0, r0, #PAGE_SZ
75 cmp r0, r1 80 cmp r0, r1
76 blo 1b 81 blo 1b
@@ -87,5 +92,5 @@ ENDPROC(v7wbi_flush_kern_tlb_range)
87ENTRY(v7wbi_tlb_fns) 92ENTRY(v7wbi_tlb_fns)
88 .long v7wbi_flush_user_tlb_range 93 .long v7wbi_flush_user_tlb_range
89 .long v7wbi_flush_kern_tlb_range 94 .long v7wbi_flush_kern_tlb_range
90 .long v6wbi_tlb_flags 95 .long v7wbi_tlb_flags
91 .size v7wbi_tlb_fns, . - v7wbi_tlb_fns 96 .size v7wbi_tlb_fns, . - v7wbi_tlb_fns
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
index 853d42bb8682..4ce0f9801e2e 100644
--- a/arch/arm/oprofile/op_model_mpcore.c
+++ b/arch/arm/oprofile/op_model_mpcore.c
@@ -41,6 +41,7 @@
41#include <asm/irq.h> 41#include <asm/irq.h>
42#include <asm/mach/irq.h> 42#include <asm/mach/irq.h>
43#include <mach/hardware.h> 43#include <mach/hardware.h>
44#include <mach/board-eb.h>
44#include <asm/system.h> 45#include <asm/system.h>
45 46
46#include "op_counter.h" 47#include "op_counter.h"
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 17d0e9906d5f..8986b7412235 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -48,7 +48,14 @@ config MXC_IRQ_PRIOR
48config MXC_PWM 48config MXC_PWM
49 tristate "Enable PWM driver" 49 tristate "Enable PWM driver"
50 depends on ARCH_MXC 50 depends on ARCH_MXC
51 select HAVE_PWM
51 help 52 help
52 Enable support for the i.MX PWM controller(s). 53 Enable support for the i.MX PWM controller(s).
53 54
55config ARCH_HAS_RNGA
56 bool
57 depends on ARCH_MXC
58
59config ARCH_MXC_IOMUX_V3
60 bool
54endif 61endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 055406312b69..e3212c8ff421 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -7,4 +7,5 @@ obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o
7 7
8obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o 8obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o
9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o 9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
10obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
10obj-$(CONFIG_MXC_PWM) += pwm.o 11obj-$(CONFIG_MXC_PWM) += pwm.o
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index 89e95798cc3b..7506d963be4b 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -64,6 +64,8 @@ static void gpio_unmask_irq(u32 irq)
64 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1); 64 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1);
65} 65}
66 66
67static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset);
68
67static int gpio_set_irq_type(u32 irq, u32 type) 69static int gpio_set_irq_type(u32 irq, u32 type)
68{ 70{
69 u32 gpio = irq_to_gpio(irq); 71 u32 gpio = irq_to_gpio(irq);
@@ -72,6 +74,7 @@ static int gpio_set_irq_type(u32 irq, u32 type)
72 int edge; 74 int edge;
73 void __iomem *reg = port->base; 75 void __iomem *reg = port->base;
74 76
77 port->both_edges &= ~(1 << (gpio & 31));
75 switch (type) { 78 switch (type) {
76 case IRQ_TYPE_EDGE_RISING: 79 case IRQ_TYPE_EDGE_RISING:
77 edge = GPIO_INT_RISE_EDGE; 80 edge = GPIO_INT_RISE_EDGE;
@@ -79,13 +82,24 @@ static int gpio_set_irq_type(u32 irq, u32 type)
79 case IRQ_TYPE_EDGE_FALLING: 82 case IRQ_TYPE_EDGE_FALLING:
80 edge = GPIO_INT_FALL_EDGE; 83 edge = GPIO_INT_FALL_EDGE;
81 break; 84 break;
85 case IRQ_TYPE_EDGE_BOTH:
86 val = mxc_gpio_get(&port->chip, gpio & 31);
87 if (val) {
88 edge = GPIO_INT_LOW_LEV;
89 pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
90 } else {
91 edge = GPIO_INT_HIGH_LEV;
92 pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
93 }
94 port->both_edges |= 1 << (gpio & 31);
95 break;
82 case IRQ_TYPE_LEVEL_LOW: 96 case IRQ_TYPE_LEVEL_LOW:
83 edge = GPIO_INT_LOW_LEV; 97 edge = GPIO_INT_LOW_LEV;
84 break; 98 break;
85 case IRQ_TYPE_LEVEL_HIGH: 99 case IRQ_TYPE_LEVEL_HIGH:
86 edge = GPIO_INT_HIGH_LEV; 100 edge = GPIO_INT_HIGH_LEV;
87 break; 101 break;
88 default: /* this includes IRQ_TYPE_EDGE_BOTH */ 102 default:
89 return -EINVAL; 103 return -EINVAL;
90 } 104 }
91 105
@@ -98,6 +112,34 @@ static int gpio_set_irq_type(u32 irq, u32 type)
98 return 0; 112 return 0;
99} 113}
100 114
115static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
116{
117 void __iomem *reg = port->base;
118 u32 bit, val;
119 int edge;
120
121 reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
122 bit = gpio & 0xf;
123 val = __raw_readl(reg);
124 edge = (val >> (bit << 1)) & 3;
125 val &= ~(0x3 << (bit << 1));
126 switch (edge) {
127 case GPIO_INT_HIGH_LEV:
128 edge = GPIO_INT_LOW_LEV;
129 pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
130 break;
131 case GPIO_INT_LOW_LEV:
132 edge = GPIO_INT_HIGH_LEV;
133 pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
134 break;
135 default:
136 pr_err("mxc: invalid configuration for GPIO %d: %x\n",
137 gpio, edge);
138 return;
139 }
140 __raw_writel(val | (edge << (bit << 1)), reg);
141}
142
101/* handle n interrupts in one status register */ 143/* handle n interrupts in one status register */
102static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat) 144static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
103{ 145{
@@ -105,11 +147,16 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
105 147
106 gpio_irq_no = port->virtual_irq_start; 148 gpio_irq_no = port->virtual_irq_start;
107 for (; irq_stat != 0; irq_stat >>= 1, gpio_irq_no++) { 149 for (; irq_stat != 0; irq_stat >>= 1, gpio_irq_no++) {
150 u32 gpio = irq_to_gpio(gpio_irq_no);
108 151
109 if ((irq_stat & 1) == 0) 152 if ((irq_stat & 1) == 0)
110 continue; 153 continue;
111 154
112 BUG_ON(!(irq_desc[gpio_irq_no].handle_irq)); 155 BUG_ON(!(irq_desc[gpio_irq_no].handle_irq));
156
157 if (port->both_edges & (1 << (gpio & 31)))
158 mxc_flip_edge(port, gpio);
159
113 irq_desc[gpio_irq_no].handle_irq(gpio_irq_no, 160 irq_desc[gpio_irq_no].handle_irq(gpio_irq_no,
114 &irq_desc[gpio_irq_no]); 161 &irq_desc[gpio_irq_no]);
115 } 162 }
diff --git a/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
new file mode 100644
index 000000000000..8769e910e559
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>.
3 * All Rights Reserved.
4 */
5
6/*
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
13#define __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
14
15#include <mach/hardware.h>
16
17/* mandatory for CONFIG_DEBUG_LL */
18
19#define MXC_LL_UART_PADDR UART1_BASE_ADDR
20#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
21
22#endif
diff --git a/arch/arm/plat-mxc/include/mach/board-mx21ads.h b/arch/arm/plat-mxc/include/mach/board-mx21ads.h
new file mode 100644
index 000000000000..06701df74c42
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx21ads.h
@@ -0,0 +1,58 @@
1/*
2 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14#ifndef __ASM_ARCH_MXC_BOARD_MX21ADS_H__
15#define __ASM_ARCH_MXC_BOARD_MX21ADS_H__
16
17/*
18 * MXC UART EVB board level configurations
19 */
20#define MXC_LL_UART_PADDR UART1_BASE_ADDR
21#define MXC_LL_UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
22
23/*
24 * Memory-mapped I/O on MX21ADS base board
25 */
26#define MX21ADS_MMIO_BASE_ADDR 0xF5000000
27#define MX21ADS_MMIO_SIZE SZ_16M
28
29#define MX21ADS_REG_ADDR(offset) (void __force __iomem *) \
30 (MX21ADS_MMIO_BASE_ADDR + (offset))
31
32#define MX21ADS_CS8900A_IRQ IRQ_GPIOE(11)
33#define MX21ADS_CS8900A_IOBASE_REG MX21ADS_REG_ADDR(0x000000)
34#define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000)
35#define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000)
36#define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000)
37
38/* MX21ADS_IO_REG bit definitions */
39#define MX21ADS_IO_SD_WP 0x0001 /* read */
40#define MX21ADS_IO_TP6 0x0001 /* write */
41#define MX21ADS_IO_SW_SEL 0x0002 /* read */
42#define MX21ADS_IO_TP7 0x0002 /* write */
43#define MX21ADS_IO_RESET_E_UART 0x0004
44#define MX21ADS_IO_RESET_BASE 0x0008
45#define MX21ADS_IO_CSI_CTL2 0x0010
46#define MX21ADS_IO_CSI_CTL1 0x0020
47#define MX21ADS_IO_CSI_CTL0 0x0040
48#define MX21ADS_IO_UART1_EN 0x0080
49#define MX21ADS_IO_UART4_EN 0x0100
50#define MX21ADS_IO_LCDON 0x0200
51#define MX21ADS_IO_IRDA_EN 0x0400
52#define MX21ADS_IO_IRDA_FIR_SEL 0x0800
53#define MX21ADS_IO_IRDA_MD0_B 0x1000
54#define MX21ADS_IO_IRDA_MD1 0x2000
55#define MX21ADS_IO_LED4_ON 0x4000
56#define MX21ADS_IO_LED3_ON 0x8000
57
58#endif /* __ASM_ARCH_MXC_BOARD_MX21ADS_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27lite.h b/arch/arm/plat-mxc/include/mach/board-mx27lite.h
new file mode 100644
index 000000000000..a870f8ea2443
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx27lite.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_BOARD_MX27LITE_H__
12#define __ASM_ARCH_MXC_BOARD_MX27LITE_H__
13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19#endif /* __ASM_ARCH_MXC_BOARD_MX27LITE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27pdk.h b/arch/arm/plat-mxc/include/mach/board-mx27pdk.h
new file mode 100644
index 000000000000..552b55d714d8
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx27pdk.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_BOARD_MX27PDK_H__
12#define __ASM_ARCH_MXC_BOARD_MX27PDK_H__
13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19#endif /* __ASM_ARCH_MXC_BOARD_MX27PDK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
index 318c72ada13d..06e6895f7f65 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
@@ -114,7 +114,7 @@
114 114
115#define MXC_MAX_EXP_IO_LINES 16 115#define MXC_MAX_EXP_IO_LINES 16
116 116
117/* mandatory for CONFIG_LL_DEBUG */ 117/* mandatory for CONFIG_DEBUG_LL */
118 118
119#define MXC_LL_UART_PADDR UART1_BASE_ADDR 119#define MXC_LL_UART_PADDR UART1_BASE_ADDR
120#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) 120#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h b/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
new file mode 100644
index 000000000000..78cf31e22e4d
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
3 *
4 * Based on code for mobots boards,
5 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
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 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22#ifndef __ASM_ARCH_MXC_BOARD_MX31LILLY_H__
23#define __ASM_ARCH_MXC_BOARD_MX31LILLY_H__
24
25/* mandatory for CONFIG_LL_DEBUG */
26
27#define MXC_LL_UART_PADDR UART1_BASE_ADDR
28#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
29
30#ifndef __ASSEMBLY__
31
32enum mx31lilly_boards {
33 MX31LILLY_NOBOARD = 0,
34 MX31LILLY_DB = 1,
35};
36
37/*
38 * This CPU module needs a baseboard to work. After basic initializing
39 * its own devices, it calls baseboard's init function.
40 */
41
42extern void mx31lilly_db_init(void);
43
44#endif
45
46#endif /* __ASM_ARCH_MXC_BOARD_MX31LILLY_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lite.h b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
index e4e5cf5ad7db..52fbdf2d6f26 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lite.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
@@ -11,28 +11,8 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__
12#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
13 13
14#define MXC_MAX_EXP_IO_LINES 16
15
16
17/*
18 * Memory Size parameters
19 */
20
21/*
22 * Size of SDRAM memory
23 */
24#define SDRAM_MEM_SIZE SZ_128M
25/*
26 * Size of MBX buffer memory
27 */
28#define MXC_MBX_MEM_SIZE SZ_16M
29/*
30 * Size of memory available to kernel
31 */
32#define MEM_SIZE (SDRAM_MEM_SIZE - MXC_MBX_MEM_SIZE)
33
34#define MXC_LL_UART_PADDR UART1_BASE_ADDR 14#define MXC_LL_UART_PADDR UART1_BASE_ADDR
35#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) 15#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
36 16
37#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */ 17#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */
38 18
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
index f8aef1babb75..303fd2434a21 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
@@ -19,7 +19,7 @@
19#ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
20#define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ 20#define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
21 21
22/* mandatory for CONFIG_LL_DEBUG */ 22/* mandatory for CONFIG_DEBUG_LL */
23 23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR 24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000) 25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31pdk.h b/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
index 2b6b316d0f51..519bab3eb28b 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
@@ -11,9 +11,54 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31PDK_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31PDK_H__
12#define __ASM_ARCH_MXC_BOARD_MX31PDK_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31PDK_H__
13 13
14/* mandatory for CONFIG_LL_DEBUG */ 14/* mandatory for CONFIG_DEBUG_LL */
15 15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR 16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) 17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18 18
19/* Definitions for components on the Debug board */
20
21/* Base address of CPLD controller on the Debug board */
22#define DEBUG_BASE_ADDRESS CS5_IO_ADDRESS(CS5_BASE_ADDR)
23
24/* LAN9217 ethernet base address */
25#define LAN9217_BASE_ADDR CS5_BASE_ADDR
26
27/* CPLD config and interrupt base address */
28#define CPLD_ADDR (DEBUG_BASE_ADDRESS + 0x20000)
29
30/* LED switchs */
31#define CPLD_LED_REG (CPLD_ADDR + 0x00)
32/* buttons */
33#define CPLD_SWITCH_BUTTONS_REG (EXPIO_ADDR + 0x08)
34/* status, interrupt */
35#define CPLD_INT_STATUS_REG (CPLD_ADDR + 0x10)
36#define CPLD_INT_MASK_REG (CPLD_ADDR + 0x38)
37#define CPLD_INT_RESET_REG (CPLD_ADDR + 0x20)
38/* magic word for debug CPLD */
39#define CPLD_MAGIC_NUMBER1_REG (CPLD_ADDR + 0x40)
40#define CPLD_MAGIC_NUMBER2_REG (CPLD_ADDR + 0x48)
41/* CPLD code version */
42#define CPLD_CODE_VER_REG (CPLD_ADDR + 0x50)
43/* magic word for debug CPLD */
44#define CPLD_MAGIC_NUMBER3_REG (CPLD_ADDR + 0x58)
45/* module reset register */
46#define CPLD_MODULE_RESET_REG (CPLD_ADDR + 0x60)
47/* CPU ID and Personality ID */
48#define CPLD_MCU_BOARD_ID_REG (CPLD_ADDR + 0x68)
49
50/* CPLD IRQ line for external uart, external ethernet etc */
51#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1)
52
53#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)
54#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
55
56#define EXPIO_INT_ENET (MXC_EXP_IO_BASE + 0)
57#define EXPIO_INT_XUART_A (MXC_EXP_IO_BASE + 1)
58#define EXPIO_INT_XUART_B (MXC_EXP_IO_BASE + 2)
59#define EXPIO_INT_BUTTON_A (MXC_EXP_IO_BASE + 3)
60#define EXPIO_INT_BUTTON_B (MXC_EXP_IO_BASE + 4)
61
62#define MXC_MAX_EXP_IO_LINES 16
63
19#endif /* __ASM_ARCH_MXC_BOARD_MX31PDK_H__ */ 64#endif /* __ASM_ARCH_MXC_BOARD_MX31PDK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx35pdk.h b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
new file mode 100644
index 000000000000..1111037d6d9d
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARCH_MXC_BOARD_MX35PDK_H__
20#define __ASM_ARCH_MXC_BOARD_MX35PDK_H__
21
22/* mandatory for CONFIG_DEBUG_LL */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
26
27#endif /* __ASM_ARCH_MXC_BOARD_MX35PDK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm037.h b/arch/arm/plat-mxc/include/mach/board-pcm037.h
index 82232ba3c8fc..f0a1fa1938a2 100644
--- a/arch/arm/plat-mxc/include/mach/board-pcm037.h
+++ b/arch/arm/plat-mxc/include/mach/board-pcm037.h
@@ -19,7 +19,7 @@
19#ifndef __ASM_ARCH_MXC_BOARD_PCM037_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_PCM037_H__
20#define __ASM_ARCH_MXC_BOARD_PCM037_H__ 20#define __ASM_ARCH_MXC_BOARD_PCM037_H__
21 21
22/* mandatory for CONFIG_LL_DEBUG */ 22/* mandatory for CONFIG_DEBUG_LL */
23 23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR 24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) 25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm038.h b/arch/arm/plat-mxc/include/mach/board-pcm038.h
index 750c62afd90f..4fcd7499e092 100644
--- a/arch/arm/plat-mxc/include/mach/board-pcm038.h
+++ b/arch/arm/plat-mxc/include/mach/board-pcm038.h
@@ -19,7 +19,7 @@
19#ifndef __ASM_ARCH_MXC_BOARD_PCM038_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_PCM038_H__
20#define __ASM_ARCH_MXC_BOARD_PCM038_H__ 20#define __ASM_ARCH_MXC_BOARD_PCM038_H__
21 21
22/* mandatory for CONFIG_LL_DEBUG */ 22/* mandatory for CONFIG_DEBUG_LL */
23 23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR 24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000) 25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm043.h b/arch/arm/plat-mxc/include/mach/board-pcm043.h
new file mode 100644
index 000000000000..15fbdf16abcd
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-pcm043.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2008 Sascha Hauer, Pengutronix
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARCH_MXC_BOARD_PCM043_H__
20#define __ASM_ARCH_MXC_BOARD_PCM043_H__
21
22/* mandatory for CONFIG_LL_DEBUG */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
26
27#endif /* __ASM_ARCH_MXC_BOARD_PCM043_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-qong.h b/arch/arm/plat-mxc/include/mach/board-qong.h
index 4ff762dd45cf..04033ec637d2 100644
--- a/arch/arm/plat-mxc/include/mach/board-qong.h
+++ b/arch/arm/plat-mxc/include/mach/board-qong.h
@@ -11,7 +11,7 @@
11#ifndef __ASM_ARCH_MXC_BOARD_QONG_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_QONG_H__
12#define __ASM_ARCH_MXC_BOARD_QONG_H__ 12#define __ASM_ARCH_MXC_BOARD_QONG_H__
13 13
14/* mandatory for CONFIG_LL_DEBUG */ 14/* mandatory for CONFIG_DEBUG_LL */
15 15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR 16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) 17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index b2f9b72644db..02c3cd004db3 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -14,7 +14,11 @@
14struct platform_device; 14struct platform_device;
15struct clk; 15struct clk;
16 16
17extern void mxc_map_io(void); 17extern void mx1_map_io(void);
18extern void mx21_map_io(void);
19extern void mx27_map_io(void);
20extern void mx31_map_io(void);
21extern void mx35_map_io(void);
18extern void mxc_init_irq(void); 22extern void mxc_init_irq(void);
19extern void mxc_timer_init(struct clk *timer_clk); 23extern void mxc_timer_init(struct clk *timer_clk);
20extern int mx1_clocks_init(unsigned long fref); 24extern int mx1_clocks_init(unsigned long fref);
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index 4f773148bc20..bbc5f6753cfb 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -25,6 +25,9 @@
25#ifdef CONFIG_MACH_MX27ADS 25#ifdef CONFIG_MACH_MX27ADS
26#include <mach/board-mx27ads.h> 26#include <mach/board-mx27ads.h>
27#endif 27#endif
28#ifdef CONFIG_MACH_MX21ADS
29#include <mach/board-mx21ads.h>
30#endif
28#ifdef CONFIG_MACH_PCM038 31#ifdef CONFIG_MACH_PCM038
29#include <mach/board-pcm038.h> 32#include <mach/board-pcm038.h>
30#endif 33#endif
@@ -34,6 +37,21 @@
34#ifdef CONFIG_MACH_QONG 37#ifdef CONFIG_MACH_QONG
35#include <mach/board-qong.h> 38#include <mach/board-qong.h>
36#endif 39#endif
40#ifdef CONFIG_MACH_PCM043
41#include <mach/board-pcm043.h>
42#endif
43#ifdef CONFIG_MACH_MX27_3DS
44#include <mach/board-mx27pdk.h>
45#endif
46#ifdef CONFIG_MACH_ARMADILLO5X0
47#include <mach/board-armadillo5x0.h>
48#endif
49#ifdef CONFIG_MACH_MX35_3DS
50#include <mach/board-mx35pdk.h>
51#endif
52#ifdef CONFIG_MACH_MX27LITE
53#include <mach/board-mx27lite.h>
54#endif
37 .macro addruart,rx 55 .macro addruart,rx
38 mrc p15, 0, \rx, c1, c0 56 mrc p15, 0, \rx, c1, c0
39 tst \rx, #1 @ MMU enabled? 57 tst \rx, #1 @ MMU enabled?
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index ea509f1090fb..894d2f87c856 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -35,6 +35,7 @@ struct mxc_gpio_port {
35 int irq; 35 int irq;
36 int virtual_irq_start; 36 int virtual_irq_start;
37 struct gpio_chip chip; 37 struct gpio_chip chip;
38 u32 both_edges;
38}; 39};
39 40
40int mxc_gpio_init(struct mxc_gpio_port*, int); 41int mxc_gpio_init(struct mxc_gpio_port*, int);
diff --git a/arch/arm/plat-mxc/include/mach/imx-uart.h b/arch/arm/plat-mxc/include/mach/imx-uart.h
index f9bd17dd8dd7..4adec9b154dd 100644
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ b/arch/arm/plat-mxc/include/mach/imx-uart.h
@@ -24,7 +24,7 @@
24 24
25struct imxuart_platform_data { 25struct imxuart_platform_data {
26 int (*init)(struct platform_device *pdev); 26 int (*init)(struct platform_device *pdev);
27 int (*exit)(struct platform_device *pdev); 27 void (*exit)(struct platform_device *pdev);
28 unsigned int flags; 28 unsigned int flags;
29 void (*irda_enable)(int enable); 29 void (*irda_enable)(int enable);
30 unsigned int irda_inv_rx:1; 30 unsigned int irda_inv_rx:1;
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
index 762a7b0430e2..9f0101157ec1 100644
--- a/arch/arm/plat-mxc/include/mach/imxfb.h
+++ b/arch/arm/plat-mxc/include/mach/imxfb.h
@@ -76,8 +76,8 @@ struct imx_fb_platform_data {
76 u_char * fixed_screen_cpu; 76 u_char * fixed_screen_cpu;
77 dma_addr_t fixed_screen_dma; 77 dma_addr_t fixed_screen_dma;
78 78
79 int (*init)(struct platform_device*); 79 int (*init)(struct platform_device *);
80 int (*exit)(struct platform_device*); 80 void (*exit)(struct platform_device *);
81 81
82 void (*lcd_power)(int); 82 void (*lcd_power)(int);
83 void (*backlight_power)(int); 83 void (*backlight_power)(int);
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 57e927a1fd3a..27f8d1b2bc6b 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -114,7 +114,7 @@ enum iomux_gp_func {
114 * - setups the iomux according to the configuration 114 * - setups the iomux according to the configuration
115 * - if the pin is configured as a GPIO, we claim it throug kernel gpiolib 115 * - if the pin is configured as a GPIO, we claim it throug kernel gpiolib
116 */ 116 */
117int mxc_iomux_setup_pin(const unsigned int pin, const char *label); 117int mxc_iomux_alloc_pin(const unsigned int pin, const char *label);
118/* 118/*
119 * setups mutliple pins 119 * setups mutliple pins
120 * convenient way to call the above function with tables 120 * convenient way to call the above function with tables
@@ -633,6 +633,40 @@ enum iomux_pins {
633#define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC) 633#define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC)
634#define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC) 634#define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC)
635#define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC) 635#define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC)
636#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO)
637#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
638#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC)
639#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2)
640#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2)
641#define MX31_PIN_ATA_CS0__GPIO3_26 IOMUX_MODE(MX31_PIN_ATA_CS0, IOMUX_CONFIG_GPIO)
642#define MX31_PIN_ATA_CS1__GPIO3_27 IOMUX_MODE(MX31_PIN_ATA_CS1, IOMUX_CONFIG_GPIO)
643#define MX31_PIN_PC_PWRON__SD2_DATA3 IOMUX_MODE(MX31_PIN_PC_PWRON, IOMUX_CONFIG_ALT1)
644#define MX31_PIN_PC_VS1__SD2_DATA2 IOMUX_MODE(MX31_PIN_PC_VS1, IOMUX_CONFIG_ALT1)
645#define MX31_PIN_PC_READY__SD2_DATA1 IOMUX_MODE(MX31_PIN_PC_READY, IOMUX_CONFIG_ALT1)
646#define MX31_PIN_PC_WAIT_B__SD2_DATA0 IOMUX_MODE(MX31_PIN_PC_WAIT_B, IOMUX_CONFIG_ALT1)
647#define MX31_PIN_PC_CD2_B__SD2_CLK IOMUX_MODE(MX31_PIN_PC_CD2_B, IOMUX_CONFIG_ALT1)
648#define MX31_PIN_PC_CD1_B__SD2_CMD IOMUX_MODE(MX31_PIN_PC_CD1_B, IOMUX_CONFIG_ALT1)
649#define MX31_PIN_ATA_DIOR__GPIO3_28 IOMUX_MODE(MX31_PIN_ATA_DIOR, IOMUX_CONFIG_GPIO)
650#define MX31_PIN_ATA_DIOW__GPIO3_29 IOMUX_MODE(MX31_PIN_ATA_DIOW, IOMUX_CONFIG_GPIO)
651#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC)
652#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC)
653#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC)
654#define MX31_PIN_CSI_D7__CSI_D7 IOMUX_MODE(MX31_PIN_CSI_D7, IOMUX_CONFIG_FUNC)
655#define MX31_PIN_CSI_D8__CSI_D8 IOMUX_MODE(MX31_PIN_CSI_D8, IOMUX_CONFIG_FUNC)
656#define MX31_PIN_CSI_D9__CSI_D9 IOMUX_MODE(MX31_PIN_CSI_D9, IOMUX_CONFIG_FUNC)
657#define MX31_PIN_CSI_D10__CSI_D10 IOMUX_MODE(MX31_PIN_CSI_D10, IOMUX_CONFIG_FUNC)
658#define MX31_PIN_CSI_D11__CSI_D11 IOMUX_MODE(MX31_PIN_CSI_D11, IOMUX_CONFIG_FUNC)
659#define MX31_PIN_CSI_D12__CSI_D12 IOMUX_MODE(MX31_PIN_CSI_D12, IOMUX_CONFIG_FUNC)
660#define MX31_PIN_CSI_D13__CSI_D13 IOMUX_MODE(MX31_PIN_CSI_D13, IOMUX_CONFIG_FUNC)
661#define MX31_PIN_CSI_D14__CSI_D14 IOMUX_MODE(MX31_PIN_CSI_D14, IOMUX_CONFIG_FUNC)
662#define MX31_PIN_CSI_D15__CSI_D15 IOMUX_MODE(MX31_PIN_CSI_D15, IOMUX_CONFIG_FUNC)
663#define MX31_PIN_CSI_HSYNC__CSI_HSYNC IOMUX_MODE(MX31_PIN_CSI_HSYNC, IOMUX_CONFIG_FUNC)
664#define MX31_PIN_CSI_MCLK__CSI_MCLK IOMUX_MODE(MX31_PIN_CSI_MCLK, IOMUX_CONFIG_FUNC)
665#define MX31_PIN_CSI_PIXCLK__CSI_PIXCLK IOMUX_MODE(MX31_PIN_CSI_PIXCLK, IOMUX_CONFIG_FUNC)
666#define MX31_PIN_CSI_VSYNC__CSI_VSYNC IOMUX_MODE(MX31_PIN_CSI_VSYNC, IOMUX_CONFIG_FUNC)
667#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO)
668#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)
669#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO)
636 670
637/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 671/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0
638 * cspi1_ss1*/ 672 * cspi1_ss1*/
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx35.h b/arch/arm/plat-mxc/include/mach/iomux-mx35.h
new file mode 100644
index 000000000000..00b0ac1db225
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx35.h
@@ -0,0 +1,1267 @@
1/*
2 * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option, NO_PAD_CTRL) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#ifndef __MACH_IOMUX_MX35_H__
20#define __MACH_IOMUX_MX35_H__
21
22#include <mach/iomux-v3.h>
23
24/*
25 * The naming convention for the pad modes is MX35_PAD_<padname>__<padmode>
26 * If <padname> or <padmode> refers to a GPIO, it is named
27 * GPIO_<unit>_<num> see also iomux-v3.h
28 */
29
30/* PAD MUX ALT INPSE PATH */
31#define MX35_PAD_CAPTURE__GPT_CAPIN1 IOMUX_PAD(0x328, 0x004, 0, 0x0, 0, NO_PAD_CTRL)
32#define MX35_PAD_CAPTURE__GPT_CMPOUT2 IOMUX_PAD(0x328, 0x004, 1, 0x0, 0, NO_PAD_CTRL)
33#define MX35_PAD_CAPTURE__CSPI2_SS1 IOMUX_PAD(0x328, 0x004, 2, 0x7f4, 0, NO_PAD_CTRL)
34#define MX35_PAD_CAPTURE__EPIT1_EPITO IOMUX_PAD(0x328, 0x004, 3, 0x0, 0, NO_PAD_CTRL)
35#define MX35_PAD_CAPTURE__CCM_CLK32K IOMUX_PAD(0x328, 0x004, 4, 0x7d0, 0, NO_PAD_CTRL)
36#define MX35_PAD_CAPTURE__GPIO1_4 IOMUX_PAD(0x328, 0x004, 5, 0x850, 0, NO_PAD_CTRL)
37
38#define MX35_PAD_COMPARE__GPT_CMPOUT1 IOMUX_PAD(0x32c, 0x008, 0, 0x0, 0, NO_PAD_CTRL)
39#define MX35_PAD_COMPARE__GPT_CAPIN2 IOMUX_PAD(0x32c, 0x008, 1, 0x0, 0, NO_PAD_CTRL)
40#define MX35_PAD_COMPARE__GPT_CMPOUT3 IOMUX_PAD(0x32c, 0x008, 2, 0x0, 0, NO_PAD_CTRL)
41#define MX35_PAD_COMPARE__EPIT2_EPITO IOMUX_PAD(0x32c, 0x008, 3, 0x0, 0, NO_PAD_CTRL)
42#define MX35_PAD_COMPARE__GPIO1_5 IOMUX_PAD(0x32c, 0x008, 5, 0x854, 0, NO_PAD_CTRL)
43#define MX35_PAD_COMPARE__SDMA_EXTDMA_2 IOMUX_PAD(0x32c, 0x008, 7, 0x0, 0, NO_PAD_CTRL)
44
45#define MX35_PAD_WDOG_RST__WDOG_WDOG_B IOMUX_PAD(0x330, 0x00c, 0, 0x0, 0, NO_PAD_CTRL)
46#define MX35_PAD_WDOG_RST__IPU_FLASH_STROBE IOMUX_PAD(0x330, 0x00c, 3, 0x0, 0, NO_PAD_CTRL)
47#define MX35_PAD_WDOG_RST__GPIO1_6 IOMUX_PAD(0x330, 0x00c, 5, 0x858, 0, NO_PAD_CTRL)
48
49#define MX35_PAD_GPIO1_0__GPIO1_0 IOMUX_PAD(0x334, 0x010, 0, 0x82c, 0, NO_PAD_CTRL)
50#define MX35_PAD_GPIO1_0__CCM_PMIC_RDY IOMUX_PAD(0x334, 0x010, 1, 0x7d4, 0, NO_PAD_CTRL)
51#define MX35_PAD_GPIO1_0__OWIRE_LINE IOMUX_PAD(0x334, 0x010, 2, 0x990, 0, NO_PAD_CTRL)
52#define MX35_PAD_GPIO1_0__SDMA_EXTDMA_0 IOMUX_PAD(0x334, 0x010, 7, 0x0, 0, NO_PAD_CTRL)
53
54#define MX35_PAD_GPIO1_1__GPIO1_1 IOMUX_PAD(0x338, 0x014, 0, 0x838, 0, NO_PAD_CTRL)
55#define MX35_PAD_GPIO1_1__PWM_PWMO IOMUX_PAD(0x338, 0x014, 2, 0x0, 0, NO_PAD_CTRL)
56#define MX35_PAD_GPIO1_1__CSPI1_SS2 IOMUX_PAD(0x338, 0x014, 3, 0x7d8, 0, NO_PAD_CTRL)
57#define MX35_PAD_GPIO1_1__SCC_TAMPER_DETECT IOMUX_PAD(0x338, 0x014, 6, 0x0, 0, NO_PAD_CTRL)
58#define MX35_PAD_GPIO1_1__SDMA_EXTDMA_1 IOMUX_PAD(0x338, 0x014, 7, 0x0, 0, NO_PAD_CTRL)
59
60#define MX35_PAD_GPIO2_0__GPIO2_0 IOMUX_PAD(0x33c, 0x018, 0, 0x868, 0, NO_PAD_CTRL)
61#define MX35_PAD_GPIO2_0__USB_TOP_USBOTG_CLK IOMUX_PAD(0x33c, 0x018, 1, 0x0, 0, NO_PAD_CTRL)
62
63#define MX35_PAD_GPIO3_0__GPIO3_0 IOMUX_PAD(0x340, 0x01c, 0, 0x8e8, 0, NO_PAD_CTRL)
64#define MX35_PAD_GPIO3_0__USB_TOP_USBH2_CLK IOMUX_PAD(0x340, 0x01c, 1, 0x0, 0, NO_PAD_CTRL)
65
66#define MX35_PAD_RESET_IN_B__CCM_RESET_IN_B IOMUX_PAD(0x344, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
67
68#define MX35_PAD_POR_B__CCM_POR_B IOMUX_PAD(0x348, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
69
70#define MX35_PAD_CLKO__CCM_CLKO IOMUX_PAD(0x34c, 0x020, 0, 0x0, 0, NO_PAD_CTRL)
71#define MX35_PAD_CLKO__GPIO1_8 IOMUX_PAD(0x34c, 0x020, 5, 0x860, 0, NO_PAD_CTRL)
72
73#define MX35_PAD_BOOT_MODE0__CCM_BOOT_MODE_0 IOMUX_PAD(0x350, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
74
75#define MX35_PAD_BOOT_MODE1__CCM_BOOT_MODE_1 IOMUX_PAD(0x354, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
76
77#define MX35_PAD_CLK_MODE0__CCM_CLK_MODE_0 IOMUX_PAD(0x358, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
78
79#define MX35_PAD_CLK_MODE1__CCM_CLK_MODE_1 IOMUX_PAD(0x35c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
80
81#define MX35_PAD_POWER_FAIL__CCM_DSM_WAKEUP_INT_26 IOMUX_PAD(0x360, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
82
83#define MX35_PAD_VSTBY__CCM_VSTBY IOMUX_PAD(0x364, 0x024, 0, 0x0, 0, NO_PAD_CTRL)
84#define MX35_PAD_VSTBY__GPIO1_7 IOMUX_PAD(0x364, 0x024, 5, 0x85c, 0, NO_PAD_CTRL)
85
86#define MX35_PAD_A0__EMI_EIM_DA_L_0 IOMUX_PAD(0x368, 0x028, 0, 0x0, 0, NO_PAD_CTRL)
87
88#define MX35_PAD_A1__EMI_EIM_DA_L_1 IOMUX_PAD(0x36c, 0x02c, 0, 0x0, 0, NO_PAD_CTRL)
89
90#define MX35_PAD_A2__EMI_EIM_DA_L_2 IOMUX_PAD(0x370, 0x030, 0, 0x0, 0, NO_PAD_CTRL)
91
92#define MX35_PAD_A3__EMI_EIM_DA_L_3 IOMUX_PAD(0x374, 0x034, 0, 0x0, 0, NO_PAD_CTRL)
93
94#define MX35_PAD_A4__EMI_EIM_DA_L_4 IOMUX_PAD(0x378, 0x038, 0, 0x0, 0, NO_PAD_CTRL)
95
96#define MX35_PAD_A5__EMI_EIM_DA_L_5 IOMUX_PAD(0x37c, 0x03c, 0, 0x0, 0, NO_PAD_CTRL)
97
98#define MX35_PAD_A6__EMI_EIM_DA_L_6 IOMUX_PAD(0x380, 0x040, 0, 0x0, 0, NO_PAD_CTRL)
99
100#define MX35_PAD_A7__EMI_EIM_DA_L_7 IOMUX_PAD(0x384, 0x044, 0, 0x0, 0, NO_PAD_CTRL)
101
102#define MX35_PAD_A8__EMI_EIM_DA_H_8 IOMUX_PAD(0x388, 0x048, 0, 0x0, 0, NO_PAD_CTRL)
103
104#define MX35_PAD_A9__EMI_EIM_DA_H_9 IOMUX_PAD(0x38c, 0x04c, 0, 0x0, 0, NO_PAD_CTRL)
105
106#define MX35_PAD_A10__EMI_EIM_DA_H_10 IOMUX_PAD(0x390, 0x050, 0, 0x0, 0, NO_PAD_CTRL)
107
108#define MX35_PAD_MA10__EMI_MA10 IOMUX_PAD(0x394, 0x054, 0, 0x0, 0, NO_PAD_CTRL)
109
110#define MX35_PAD_A11__EMI_EIM_DA_H_11 IOMUX_PAD(0x398, 0x058, 0, 0x0, 0, NO_PAD_CTRL)
111
112#define MX35_PAD_A12__EMI_EIM_DA_H_12 IOMUX_PAD(0x39c, 0x05c, 0, 0x0, 0, NO_PAD_CTRL)
113
114#define MX35_PAD_A13__EMI_EIM_DA_H_13 IOMUX_PAD(0x3a0, 0x060, 0, 0x0, 0, NO_PAD_CTRL)
115
116#define MX35_PAD_A14__EMI_EIM_DA_H2_14 IOMUX_PAD(0x3a4, 0x064, 0, 0x0, 0, NO_PAD_CTRL)
117
118#define MX35_PAD_A15__EMI_EIM_DA_H2_15 IOMUX_PAD(0x3a8, 0x068, 0, 0x0, 0, NO_PAD_CTRL)
119
120#define MX35_PAD_A16__EMI_EIM_A_16 IOMUX_PAD(0x3ac, 0x06c, 0, 0x0, 0, NO_PAD_CTRL)
121
122#define MX35_PAD_A17__EMI_EIM_A_17 IOMUX_PAD(0x3b0, 0x070, 0, 0x0, 0, NO_PAD_CTRL)
123
124#define MX35_PAD_A18__EMI_EIM_A_18 IOMUX_PAD(0x3b4, 0x074, 0, 0x0, 0, NO_PAD_CTRL)
125
126#define MX35_PAD_A19__EMI_EIM_A_19 IOMUX_PAD(0x3b8, 0x078, 0, 0x0, 0, NO_PAD_CTRL)
127
128#define MX35_PAD_A20__EMI_EIM_A_20 IOMUX_PAD(0x3bc, 0x07c, 0, 0x0, 0, NO_PAD_CTRL)
129
130#define MX35_PAD_A21__EMI_EIM_A_21 IOMUX_PAD(0x3c0, 0x080, 0, 0x0, 0, NO_PAD_CTRL)
131
132#define MX35_PAD_A22__EMI_EIM_A_22 IOMUX_PAD(0x3c4, 0x084, 0, 0x0, 0, NO_PAD_CTRL)
133
134#define MX35_PAD_A23__EMI_EIM_A_23 IOMUX_PAD(0x3c8, 0x088, 0, 0x0, 0, NO_PAD_CTRL)
135
136#define MX35_PAD_A24__EMI_EIM_A_24 IOMUX_PAD(0x3cc, 0x08c, 0, 0x0, 0, NO_PAD_CTRL)
137
138#define MX35_PAD_A25__EMI_EIM_A_25 IOMUX_PAD(0x3d0, 0x090, 0, 0x0, 0, NO_PAD_CTRL)
139
140#define MX35_PAD_SDBA1__EMI_EIM_SDBA1 IOMUX_PAD(0x3d4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
141
142#define MX35_PAD_SDBA0__EMI_EIM_SDBA0 IOMUX_PAD(0x3d8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
143
144#define MX35_PAD_SD0__EMI_DRAM_D_0 IOMUX_PAD(0x3dc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
145
146#define MX35_PAD_SD1__EMI_DRAM_D_1 IOMUX_PAD(0x3e0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
147
148#define MX35_PAD_SD2__EMI_DRAM_D_2 IOMUX_PAD(0x3e4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
149
150#define MX35_PAD_SD3__EMI_DRAM_D_3 IOMUX_PAD(0x3e8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
151
152#define MX35_PAD_SD4__EMI_DRAM_D_4 IOMUX_PAD(0x3ec, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
153
154#define MX35_PAD_SD5__EMI_DRAM_D_5 IOMUX_PAD(0x3f0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
155
156#define MX35_PAD_SD6__EMI_DRAM_D_6 IOMUX_PAD(0x3f4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
157
158#define MX35_PAD_SD7__EMI_DRAM_D_7 IOMUX_PAD(0x3f8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
159
160#define MX35_PAD_SD8__EMI_DRAM_D_8 IOMUX_PAD(0x3fc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
161
162#define MX35_PAD_SD9__EMI_DRAM_D_9 IOMUX_PAD(0x400, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
163
164#define MX35_PAD_SD10__EMI_DRAM_D_10 IOMUX_PAD(0x404, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
165
166#define MX35_PAD_SD11__EMI_DRAM_D_11 IOMUX_PAD(0x408, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
167
168#define MX35_PAD_SD12__EMI_DRAM_D_12 IOMUX_PAD(0x40c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
169
170#define MX35_PAD_SD13__EMI_DRAM_D_13 IOMUX_PAD(0x410, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
171
172#define MX35_PAD_SD14__EMI_DRAM_D_14 IOMUX_PAD(0x414, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
173
174#define MX35_PAD_SD15__EMI_DRAM_D_15 IOMUX_PAD(0x418, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
175
176#define MX35_PAD_SD16__EMI_DRAM_D_16 IOMUX_PAD(0x41c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
177
178#define MX35_PAD_SD17__EMI_DRAM_D_17 IOMUX_PAD(0x420, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
179
180#define MX35_PAD_SD18__EMI_DRAM_D_18 IOMUX_PAD(0x424, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
181
182#define MX35_PAD_SD19__EMI_DRAM_D_19 IOMUX_PAD(0x428, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
183
184#define MX35_PAD_SD20__EMI_DRAM_D_20 IOMUX_PAD(0x42c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
185
186#define MX35_PAD_SD21__EMI_DRAM_D_21 IOMUX_PAD(0x430, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
187
188#define MX35_PAD_SD22__EMI_DRAM_D_22 IOMUX_PAD(0x434, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
189
190#define MX35_PAD_SD23__EMI_DRAM_D_23 IOMUX_PAD(0x438, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
191
192#define MX35_PAD_SD24__EMI_DRAM_D_24 IOMUX_PAD(0x43c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
193
194#define MX35_PAD_SD25__EMI_DRAM_D_25 IOMUX_PAD(0x440, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
195
196#define MX35_PAD_SD26__EMI_DRAM_D_26 IOMUX_PAD(0x444, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
197
198#define MX35_PAD_SD27__EMI_DRAM_D_27 IOMUX_PAD(0x448, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
199
200#define MX35_PAD_SD28__EMI_DRAM_D_28 IOMUX_PAD(0x44c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
201
202#define MX35_PAD_SD29__EMI_DRAM_D_29 IOMUX_PAD(0x450, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
203
204#define MX35_PAD_SD30__EMI_DRAM_D_30 IOMUX_PAD(0x454, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
205
206#define MX35_PAD_SD31__EMI_DRAM_D_31 IOMUX_PAD(0x458, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
207
208#define MX35_PAD_DQM0__EMI_DRAM_DQM_0 IOMUX_PAD(0x45c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
209
210#define MX35_PAD_DQM1__EMI_DRAM_DQM_1 IOMUX_PAD(0x460, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
211
212#define MX35_PAD_DQM2__EMI_DRAM_DQM_2 IOMUX_PAD(0x464, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
213
214#define MX35_PAD_DQM3__EMI_DRAM_DQM_3 IOMUX_PAD(0x468, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
215
216#define MX35_PAD_EB0__EMI_EIM_EB0_B IOMUX_PAD(0x46c, 0x094, 0, 0x0, 0, NO_PAD_CTRL)
217
218#define MX35_PAD_EB1__EMI_EIM_EB1_B IOMUX_PAD(0x470, 0x098, 0, 0x0, 0, NO_PAD_CTRL)
219
220#define MX35_PAD_OE__EMI_EIM_OE IOMUX_PAD(0x474, 0x09c, 0, 0x0, 0, NO_PAD_CTRL)
221
222#define MX35_PAD_CS0__EMI_EIM_CS0 IOMUX_PAD(0x478, 0x0a0, 0, 0x0, 0, NO_PAD_CTRL)
223
224#define MX35_PAD_CS1__EMI_EIM_CS1 IOMUX_PAD(0x47c, 0x0a4, 0, 0x0, 0, NO_PAD_CTRL)
225#define MX35_PAD_CS1__EMI_NANDF_CE3 IOMUX_PAD(0x47c, 0x0a4, 3, 0x0, 0, NO_PAD_CTRL)
226
227#define MX35_PAD_CS2__EMI_EIM_CS2 IOMUX_PAD(0x480, 0x0a8, 0, 0x0, 0, NO_PAD_CTRL)
228
229#define MX35_PAD_CS3__EMI_EIM_CS3 IOMUX_PAD(0x484, 0x0ac, 0, 0x0, 0, NO_PAD_CTRL)
230
231#define MX35_PAD_CS4__EMI_EIM_CS4 IOMUX_PAD(0x488, 0x0b0, 0, 0x0, 0, NO_PAD_CTRL)
232#define MX35_PAD_CS4__EMI_DTACK_B IOMUX_PAD(0x488, 0x0b0, 1, 0x800, 0, NO_PAD_CTRL)
233#define MX35_PAD_CS4__EMI_NANDF_CE1 IOMUX_PAD(0x488, 0x0b0, 3, 0x0, 0, NO_PAD_CTRL)
234#define MX35_PAD_CS4__GPIO1_20 IOMUX_PAD(0x488, 0x0b0, 5, 0x83c, 0, NO_PAD_CTRL)
235
236#define MX35_PAD_CS5__EMI_EIM_CS5 IOMUX_PAD(0x48c, 0x0b4, 0, 0x0, 0, NO_PAD_CTRL)
237#define MX35_PAD_CS5__CSPI2_SS2 IOMUX_PAD(0x48c, 0x0b4, 1, 0x7f8, 0, NO_PAD_CTRL)
238#define MX35_PAD_CS5__CSPI1_SS2 IOMUX_PAD(0x48c, 0x0b4, 2, 0x7d8, 1, NO_PAD_CTRL)
239#define MX35_PAD_CS5__EMI_NANDF_CE2 IOMUX_PAD(0x48c, 0x0b4, 3, 0x0, 0, NO_PAD_CTRL)
240#define MX35_PAD_CS5__GPIO1_21 IOMUX_PAD(0x48c, 0x0b4, 5, 0x840, 0, NO_PAD_CTRL)
241
242#define MX35_PAD_NF_CE0__EMI_NANDF_CE0 IOMUX_PAD(0x490, 0x0b8, 0, 0x0, 0, NO_PAD_CTRL)
243#define MX35_PAD_NF_CE0__GPIO1_22 IOMUX_PAD(0x490, 0x0b8, 5, 0x844, 0, NO_PAD_CTRL)
244
245#define MX35_PAD_ECB__EMI_EIM_ECB IOMUX_PAD(0x494, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
246
247#define MX35_PAD_LBA__EMI_EIM_LBA IOMUX_PAD(0x498, 0x0bc, 0, 0x0, 0, NO_PAD_CTRL)
248
249#define MX35_PAD_BCLK__EMI_EIM_BCLK IOMUX_PAD(0x49c, 0x0c0, 0, 0x0, 0, NO_PAD_CTRL)
250
251#define MX35_PAD_RW__EMI_EIM_RW IOMUX_PAD(0x4a0, 0x0c4, 0, 0x0, 0, NO_PAD_CTRL)
252
253#define MX35_PAD_RAS__EMI_DRAM_RAS IOMUX_PAD(0x4a4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
254
255#define MX35_PAD_CAS__EMI_DRAM_CAS IOMUX_PAD(0x4a8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
256
257#define MX35_PAD_SDWE__EMI_DRAM_SDWE IOMUX_PAD(0x4ac, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
258
259#define MX35_PAD_SDCKE0__EMI_DRAM_SDCKE_0 IOMUX_PAD(0x4b0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
260
261#define MX35_PAD_SDCKE1__EMI_DRAM_SDCKE_1 IOMUX_PAD(0x4b4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
262
263#define MX35_PAD_SDCLK__EMI_DRAM_SDCLK IOMUX_PAD(0x4b8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
264
265#define MX35_PAD_SDQS0__EMI_DRAM_SDQS_0 IOMUX_PAD(0x4bc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
266
267#define MX35_PAD_SDQS1__EMI_DRAM_SDQS_1 IOMUX_PAD(0x4c0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
268
269#define MX35_PAD_SDQS2__EMI_DRAM_SDQS_2 IOMUX_PAD(0x4c4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
270
271#define MX35_PAD_SDQS3__EMI_DRAM_SDQS_3 IOMUX_PAD(0x4c8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
272
273#define MX35_PAD_NFWE_B__EMI_NANDF_WE_B IOMUX_PAD(0x4cc, 0x0c8, 0, 0x0, 0, NO_PAD_CTRL)
274#define MX35_PAD_NFWE_B__USB_TOP_USBH2_DATA_3 IOMUX_PAD(0x4cc, 0x0c8, 1, 0x9d8, 0, NO_PAD_CTRL)
275#define MX35_PAD_NFWE_B__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x4cc, 0x0c8, 2, 0x924, 0, NO_PAD_CTRL)
276#define MX35_PAD_NFWE_B__GPIO2_18 IOMUX_PAD(0x4cc, 0x0c8, 5, 0x88c, 0, NO_PAD_CTRL)
277#define MX35_PAD_NFWE_B__ARM11P_TOP_TRACE_0 IOMUX_PAD(0x4cc, 0x0c8, 7, 0x0, 0, NO_PAD_CTRL)
278
279#define MX35_PAD_NFRE_B__EMI_NANDF_RE_B IOMUX_PAD(0x4d0, 0x0cc, 0, 0x0, 0, NO_PAD_CTRL)
280#define MX35_PAD_NFRE_B__USB_TOP_USBH2_DIR IOMUX_PAD(0x4d0, 0x0cc, 1, 0x9ec, 0, NO_PAD_CTRL)
281#define MX35_PAD_NFRE_B__IPU_DISPB_BCLK IOMUX_PAD(0x4d0, 0x0cc, 2, 0x0, 0, NO_PAD_CTRL)
282#define MX35_PAD_NFRE_B__GPIO2_19 IOMUX_PAD(0x4d0, 0x0cc, 5, 0x890, 0, NO_PAD_CTRL)
283#define MX35_PAD_NFRE_B__ARM11P_TOP_TRACE_1 IOMUX_PAD(0x4d0, 0x0cc, 7, 0x0, 0, NO_PAD_CTRL)
284
285#define MX35_PAD_NFALE__EMI_NANDF_ALE IOMUX_PAD(0x4d4, 0x0d0, 0, 0x0, 0, NO_PAD_CTRL)
286#define MX35_PAD_NFALE__USB_TOP_USBH2_STP IOMUX_PAD(0x4d4, 0x0d0, 1, 0x0, 0, NO_PAD_CTRL)
287#define MX35_PAD_NFALE__IPU_DISPB_CS0 IOMUX_PAD(0x4d4, 0x0d0, 2, 0x0, 0, NO_PAD_CTRL)
288#define MX35_PAD_NFALE__GPIO2_20 IOMUX_PAD(0x4d4, 0x0d0, 5, 0x898, 0, NO_PAD_CTRL)
289#define MX35_PAD_NFALE__ARM11P_TOP_TRACE_2 IOMUX_PAD(0x4d4, 0x0d0, 7, 0x0, 0, NO_PAD_CTRL)
290
291#define MX35_PAD_NFCLE__EMI_NANDF_CLE IOMUX_PAD(0x4d8, 0x0d4, 0, 0x0, 0, NO_PAD_CTRL)
292#define MX35_PAD_NFCLE__USB_TOP_USBH2_NXT IOMUX_PAD(0x4d8, 0x0d4, 1, 0x9f0, 0, NO_PAD_CTRL)
293#define MX35_PAD_NFCLE__IPU_DISPB_PAR_RS IOMUX_PAD(0x4d8, 0x0d4, 2, 0x0, 0, NO_PAD_CTRL)
294#define MX35_PAD_NFCLE__GPIO2_21 IOMUX_PAD(0x4d8, 0x0d4, 5, 0x89c, 0, NO_PAD_CTRL)
295#define MX35_PAD_NFCLE__ARM11P_TOP_TRACE_3 IOMUX_PAD(0x4d8, 0x0d4, 7, 0x0, 0, NO_PAD_CTRL)
296
297#define MX35_PAD_NFWP_B__EMI_NANDF_WP_B IOMUX_PAD(0x4dc, 0x0d8, 0, 0x0, 0, NO_PAD_CTRL)
298#define MX35_PAD_NFWP_B__USB_TOP_USBH2_DATA_7 IOMUX_PAD(0x4dc, 0x0d8, 1, 0x9e8, 0, NO_PAD_CTRL)
299#define MX35_PAD_NFWP_B__IPU_DISPB_WR IOMUX_PAD(0x4dc, 0x0d8, 2, 0x0, 0, NO_PAD_CTRL)
300#define MX35_PAD_NFWP_B__GPIO2_22 IOMUX_PAD(0x4dc, 0x0d8, 5, 0x8a0, 0, NO_PAD_CTRL)
301#define MX35_PAD_NFWP_B__ARM11P_TOP_TRCTL IOMUX_PAD(0x4dc, 0x0d8, 7, 0x0, 0, NO_PAD_CTRL)
302
303#define MX35_PAD_NFRB__EMI_NANDF_RB IOMUX_PAD(0x4e0, 0x0dc, 0, 0x0, 0, NO_PAD_CTRL)
304#define MX35_PAD_NFRB__IPU_DISPB_RD IOMUX_PAD(0x4e0, 0x0dc, 2, 0x0, 0, NO_PAD_CTRL)
305#define MX35_PAD_NFRB__GPIO2_23 IOMUX_PAD(0x4e0, 0x0dc, 5, 0x8a4, 0, NO_PAD_CTRL)
306#define MX35_PAD_NFRB__ARM11P_TOP_TRCLK IOMUX_PAD(0x4e0, 0x0dc, 7, 0x0, 0, NO_PAD_CTRL)
307
308#define MX35_PAD_D15__EMI_EIM_D_15 IOMUX_PAD(0x4e4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
309
310#define MX35_PAD_D14__EMI_EIM_D_14 IOMUX_PAD(0x4e8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
311
312#define MX35_PAD_D13__EMI_EIM_D_13 IOMUX_PAD(0x4ec, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
313
314#define MX35_PAD_D12__EMI_EIM_D_12 IOMUX_PAD(0x4f0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
315
316#define MX35_PAD_D11__EMI_EIM_D_11 IOMUX_PAD(0x4f4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
317
318#define MX35_PAD_D10__EMI_EIM_D_10 IOMUX_PAD(0x4f8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
319
320#define MX35_PAD_D9__EMI_EIM_D_9 IOMUX_PAD(0x4fc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
321
322#define MX35_PAD_D8__EMI_EIM_D_8 IOMUX_PAD(0x500, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
323
324#define MX35_PAD_D7__EMI_EIM_D_7 IOMUX_PAD(0x504, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
325
326#define MX35_PAD_D6__EMI_EIM_D_6 IOMUX_PAD(0x508, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
327
328#define MX35_PAD_D5__EMI_EIM_D_5 IOMUX_PAD(0x50c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
329
330#define MX35_PAD_D4__EMI_EIM_D_4 IOMUX_PAD(0x510, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
331
332#define MX35_PAD_D3__EMI_EIM_D_3 IOMUX_PAD(0x514, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
333
334#define MX35_PAD_D2__EMI_EIM_D_2 IOMUX_PAD(0x518, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
335
336#define MX35_PAD_D1__EMI_EIM_D_1 IOMUX_PAD(0x51c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
337
338#define MX35_PAD_D0__EMI_EIM_D_0 IOMUX_PAD(0x520, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
339
340#define MX35_PAD_CSI_D8__IPU_CSI_D_8 IOMUX_PAD(0x524, 0x0e0, 0, 0x0, 0, NO_PAD_CTRL)
341#define MX35_PAD_CSI_D8__KPP_COL_0 IOMUX_PAD(0x524, 0x0e0, 1, 0x950, 0, NO_PAD_CTRL)
342#define MX35_PAD_CSI_D8__GPIO1_20 IOMUX_PAD(0x524, 0x0e0, 5, 0x83c, 1, NO_PAD_CTRL)
343#define MX35_PAD_CSI_D8__ARM11P_TOP_EVNTBUS_13 IOMUX_PAD(0x524, 0x0e0, 7, 0x0, 0, NO_PAD_CTRL)
344
345#define MX35_PAD_CSI_D9__IPU_CSI_D_9 IOMUX_PAD(0x528, 0x0e4, 0, 0x0, 0, NO_PAD_CTRL)
346#define MX35_PAD_CSI_D9__KPP_COL_1 IOMUX_PAD(0x528, 0x0e4, 1, 0x954, 0, NO_PAD_CTRL)
347#define MX35_PAD_CSI_D9__GPIO1_21 IOMUX_PAD(0x528, 0x0e4, 5, 0x840, 1, NO_PAD_CTRL)
348#define MX35_PAD_CSI_D9__ARM11P_TOP_EVNTBUS_14 IOMUX_PAD(0x528, 0x0e4, 7, 0x0, 0, NO_PAD_CTRL)
349
350#define MX35_PAD_CSI_D10__IPU_CSI_D_10 IOMUX_PAD(0x52c, 0x0e8, 0, 0x0, 0, NO_PAD_CTRL)
351#define MX35_PAD_CSI_D10__KPP_COL_2 IOMUX_PAD(0x52c, 0x0e8, 1, 0x958, 0, NO_PAD_CTRL)
352#define MX35_PAD_CSI_D10__GPIO1_22 IOMUX_PAD(0x52c, 0x0e8, 5, 0x844, 1, NO_PAD_CTRL)
353#define MX35_PAD_CSI_D10__ARM11P_TOP_EVNTBUS_15 IOMUX_PAD(0x52c, 0x0e8, 7, 0x0, 0, NO_PAD_CTRL)
354
355#define MX35_PAD_CSI_D11__IPU_CSI_D_11 IOMUX_PAD(0x530, 0x0ec, 0, 0x0, 0, NO_PAD_CTRL)
356#define MX35_PAD_CSI_D11__KPP_COL_3 IOMUX_PAD(0x530, 0x0ec, 1, 0x95c, 0, NO_PAD_CTRL)
357#define MX35_PAD_CSI_D11__GPIO1_23 IOMUX_PAD(0x530, 0x0ec, 5, 0x0, 0, NO_PAD_CTRL)
358
359#define MX35_PAD_CSI_D12__IPU_CSI_D_12 IOMUX_PAD(0x534, 0x0f0, 0, 0x0, 0, NO_PAD_CTRL)
360#define MX35_PAD_CSI_D12__KPP_ROW_0 IOMUX_PAD(0x534, 0x0f0, 1, 0x970, 0, NO_PAD_CTRL)
361#define MX35_PAD_CSI_D12__GPIO1_24 IOMUX_PAD(0x534, 0x0f0, 5, 0x0, 0, NO_PAD_CTRL)
362
363#define MX35_PAD_CSI_D13__IPU_CSI_D_13 IOMUX_PAD(0x538, 0x0f4, 0, 0x0, 0, NO_PAD_CTRL)
364#define MX35_PAD_CSI_D13__KPP_ROW_1 IOMUX_PAD(0x538, 0x0f4, 1, 0x974, 0, NO_PAD_CTRL)
365#define MX35_PAD_CSI_D13__GPIO1_25 IOMUX_PAD(0x538, 0x0f4, 5, 0x0, 0, NO_PAD_CTRL)
366
367#define MX35_PAD_CSI_D14__IPU_CSI_D_14 IOMUX_PAD(0x53c, 0x0f8, 0, 0x0, 0, NO_PAD_CTRL)
368#define MX35_PAD_CSI_D14__KPP_ROW_2 IOMUX_PAD(0x53c, 0x0f8, 1, 0x978, 0, NO_PAD_CTRL)
369#define MX35_PAD_CSI_D14__GPIO1_26 IOMUX_PAD(0x53c, 0x0f8, 5, 0x0, 0, NO_PAD_CTRL)
370
371#define MX35_PAD_CSI_D15__IPU_CSI_D_15 IOMUX_PAD(0x540, 0x0fc, 0, 0x97c, 0, NO_PAD_CTRL)
372#define MX35_PAD_CSI_D15__KPP_ROW_3 IOMUX_PAD(0x540, 0x0fc, 1, 0x0, 0, NO_PAD_CTRL)
373#define MX35_PAD_CSI_D15__GPIO1_27 IOMUX_PAD(0x540, 0x0fc, 5, 0x0, 0, NO_PAD_CTRL)
374
375#define MX35_PAD_CSI_MCLK__IPU_CSI_MCLK IOMUX_PAD(0x544, 0x100, 0, 0x0, 0, NO_PAD_CTRL)
376#define MX35_PAD_CSI_MCLK__GPIO1_28 IOMUX_PAD(0x544, 0x100, 5, 0x0, 0, NO_PAD_CTRL)
377
378#define MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC IOMUX_PAD(0x548, 0x104, 0, 0x0, 0, NO_PAD_CTRL)
379#define MX35_PAD_CSI_VSYNC__GPIO1_29 IOMUX_PAD(0x548, 0x104, 5, 0x0, 0, NO_PAD_CTRL)
380
381#define MX35_PAD_CSI_HSYNC__IPU_CSI_HSYNC IOMUX_PAD(0x54c, 0x108, 0, 0x0, 0, NO_PAD_CTRL)
382#define MX35_PAD_CSI_HSYNC__GPIO1_30 IOMUX_PAD(0x54c, 0x108, 5, 0x0, 0, NO_PAD_CTRL)
383
384#define MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK IOMUX_PAD(0x550, 0x10c, 0, 0x0, 0, NO_PAD_CTRL)
385#define MX35_PAD_CSI_PIXCLK__GPIO1_31 IOMUX_PAD(0x550, 0x10c, 5, 0x0, 0, NO_PAD_CTRL)
386
387#define MX35_PAD_I2C1_CLK__I2C1_SCL IOMUX_PAD(0x554, 0x110, 0, 0x0, 0, NO_PAD_CTRL)
388#define MX35_PAD_I2C1_CLK__GPIO2_24 IOMUX_PAD(0x554, 0x110, 5, 0x8a8, 0, NO_PAD_CTRL)
389#define MX35_PAD_I2C1_CLK__CCM_USB_BYP_CLK IOMUX_PAD(0x554, 0x110, 6, 0x0, 0, NO_PAD_CTRL)
390
391#define MX35_PAD_I2C1_DAT__I2C1_SDA IOMUX_PAD(0x558, 0x114, 0, 0x0, 0, NO_PAD_CTRL)
392#define MX35_PAD_I2C1_DAT__GPIO2_25 IOMUX_PAD(0x558, 0x114, 5, 0x8ac, 0, NO_PAD_CTRL)
393
394#define MX35_PAD_I2C2_CLK__I2C2_SCL IOMUX_PAD(0x55c, 0x118, 0, 0x0, 0, NO_PAD_CTRL)
395#define MX35_PAD_I2C2_CLK__CAN1_TXCAN IOMUX_PAD(0x55c, 0x118, 1, 0x0, 0, NO_PAD_CTRL)
396#define MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR IOMUX_PAD(0x55c, 0x118, 2, 0x0, 0, NO_PAD_CTRL)
397#define MX35_PAD_I2C2_CLK__GPIO2_26 IOMUX_PAD(0x55c, 0x118, 5, 0x8b0, 0, NO_PAD_CTRL)
398#define MX35_PAD_I2C2_CLK__SDMA_DEBUG_BUS_DEVICE_2 IOMUX_PAD(0x55c, 0x118, 6, 0x0, 0, NO_PAD_CTRL)
399
400#define MX35_PAD_I2C2_DAT__I2C2_SDA IOMUX_PAD(0x560, 0x11c, 0, 0x0, 0, NO_PAD_CTRL)
401#define MX35_PAD_I2C2_DAT__CAN1_RXCAN IOMUX_PAD(0x560, 0x11c, 1, 0x7c8, 0, NO_PAD_CTRL)
402#define MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC IOMUX_PAD(0x560, 0x11c, 2, 0x9f4, 0, NO_PAD_CTRL)
403#define MX35_PAD_I2C2_DAT__GPIO2_27 IOMUX_PAD(0x560, 0x11c, 5, 0x8b4, 0, NO_PAD_CTRL)
404#define MX35_PAD_I2C2_DAT__SDMA_DEBUG_BUS_DEVICE_3 IOMUX_PAD(0x560, 0x11c, 6, 0x0, 0, NO_PAD_CTRL)
405
406#define MX35_PAD_STXD4__AUDMUX_AUD4_TXD IOMUX_PAD(0x564, 0x120, 0, 0x0, 0, NO_PAD_CTRL)
407#define MX35_PAD_STXD4__GPIO2_28 IOMUX_PAD(0x564, 0x120, 5, 0x8b8, 0, NO_PAD_CTRL)
408#define MX35_PAD_STXD4__ARM11P_TOP_ARM_COREASID0 IOMUX_PAD(0x564, 0x120, 7, 0x0, 0, NO_PAD_CTRL)
409
410#define MX35_PAD_SRXD4__AUDMUX_AUD4_RXD IOMUX_PAD(0x568, 0x124, 0, 0x0, 0, NO_PAD_CTRL)
411#define MX35_PAD_SRXD4__GPIO2_29 IOMUX_PAD(0x568, 0x124, 5, 0x8bc, 0, NO_PAD_CTRL)
412#define MX35_PAD_SRXD4__ARM11P_TOP_ARM_COREASID1 IOMUX_PAD(0x568, 0x124, 7, 0x0, 0, NO_PAD_CTRL)
413
414#define MX35_PAD_SCK4__AUDMUX_AUD4_TXC IOMUX_PAD(0x56c, 0x128, 0, 0x0, 0, NO_PAD_CTRL)
415#define MX35_PAD_SCK4__GPIO2_30 IOMUX_PAD(0x56c, 0x128, 5, 0x8c4, 0, NO_PAD_CTRL)
416#define MX35_PAD_SCK4__ARM11P_TOP_ARM_COREASID2 IOMUX_PAD(0x56c, 0x128, 7, 0x0, 0, NO_PAD_CTRL)
417
418#define MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS IOMUX_PAD(0x570, 0x12c, 0, 0x0, 0, NO_PAD_CTRL)
419#define MX35_PAD_STXFS4__GPIO2_31 IOMUX_PAD(0x570, 0x12c, 5, 0x8c8, 0, NO_PAD_CTRL)
420#define MX35_PAD_STXFS4__ARM11P_TOP_ARM_COREASID3 IOMUX_PAD(0x570, 0x12c, 7, 0x0, 0, NO_PAD_CTRL)
421
422#define MX35_PAD_STXD5__AUDMUX_AUD5_TXD IOMUX_PAD(0x574, 0x130, 0, 0x0, 0, NO_PAD_CTRL)
423#define MX35_PAD_STXD5__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x574, 0x130, 1, 0x0, 0, NO_PAD_CTRL)
424#define MX35_PAD_STXD5__CSPI2_MOSI IOMUX_PAD(0x574, 0x130, 2, 0x7ec, 0, NO_PAD_CTRL)
425#define MX35_PAD_STXD5__GPIO1_0 IOMUX_PAD(0x574, 0x130, 5, 0x82c, 1, NO_PAD_CTRL)
426#define MX35_PAD_STXD5__ARM11P_TOP_ARM_COREASID4 IOMUX_PAD(0x574, 0x130, 7, 0x0, 0, NO_PAD_CTRL)
427
428#define MX35_PAD_SRXD5__AUDMUX_AUD5_RXD IOMUX_PAD(0x578, 0x134, 0, 0x0, 0, NO_PAD_CTRL)
429#define MX35_PAD_SRXD5__SPDIF_SPDIF_IN1 IOMUX_PAD(0x578, 0x134, 1, 0x998, 0, NO_PAD_CTRL)
430#define MX35_PAD_SRXD5__CSPI2_MISO IOMUX_PAD(0x578, 0x134, 2, 0x7e8, 0, NO_PAD_CTRL)
431#define MX35_PAD_SRXD5__GPIO1_1 IOMUX_PAD(0x578, 0x134, 5, 0x838, 1, NO_PAD_CTRL)
432#define MX35_PAD_SRXD5__ARM11P_TOP_ARM_COREASID5 IOMUX_PAD(0x578, 0x134, 7, 0x0, 0, NO_PAD_CTRL)
433
434#define MX35_PAD_SCK5__AUDMUX_AUD5_TXC IOMUX_PAD(0x57c, 0x138, 0, 0x0, 0, NO_PAD_CTRL)
435#define MX35_PAD_SCK5__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x57c, 0x138, 1, 0x994, 0, NO_PAD_CTRL)
436#define MX35_PAD_SCK5__CSPI2_SCLK IOMUX_PAD(0x57c, 0x138, 2, 0x7e0, 0, NO_PAD_CTRL)
437#define MX35_PAD_SCK5__GPIO1_2 IOMUX_PAD(0x57c, 0x138, 5, 0x848, 0, NO_PAD_CTRL)
438#define MX35_PAD_SCK5__ARM11P_TOP_ARM_COREASID6 IOMUX_PAD(0x57c, 0x138, 7, 0x0, 0, NO_PAD_CTRL)
439
440#define MX35_PAD_STXFS5__AUDMUX_AUD5_TXFS IOMUX_PAD(0x580, 0x13c, 0, 0x0, 0, NO_PAD_CTRL)
441#define MX35_PAD_STXFS5__CSPI2_RDY IOMUX_PAD(0x580, 0x13c, 2, 0x7e4, 0, NO_PAD_CTRL)
442#define MX35_PAD_STXFS5__GPIO1_3 IOMUX_PAD(0x580, 0x13c, 5, 0x84c, 0, NO_PAD_CTRL)
443#define MX35_PAD_STXFS5__ARM11P_TOP_ARM_COREASID7 IOMUX_PAD(0x580, 0x13c, 7, 0x0, 0, NO_PAD_CTRL)
444
445#define MX35_PAD_SCKR__ESAI_SCKR IOMUX_PAD(0x584, 0x140, 0, 0x0, 0, NO_PAD_CTRL)
446#define MX35_PAD_SCKR__GPIO1_4 IOMUX_PAD(0x584, 0x140, 5, 0x850, 1, NO_PAD_CTRL)
447#define MX35_PAD_SCKR__ARM11P_TOP_EVNTBUS_10 IOMUX_PAD(0x584, 0x140, 7, 0x0, 0, NO_PAD_CTRL)
448
449#define MX35_PAD_FSR__ESAI_FSR IOMUX_PAD(0x588, 0x144, 0, 0x0, 0, NO_PAD_CTRL)
450#define MX35_PAD_FSR__GPIO1_5 IOMUX_PAD(0x588, 0x144, 5, 0x854, 1, NO_PAD_CTRL)
451#define MX35_PAD_FSR__ARM11P_TOP_EVNTBUS_11 IOMUX_PAD(0x588, 0x144, 7, 0x0, 0, NO_PAD_CTRL)
452
453#define MX35_PAD_HCKR__ESAI_HCKR IOMUX_PAD(0x58c, 0x148, 0, 0x0, 0, NO_PAD_CTRL)
454#define MX35_PAD_HCKR__AUDMUX_AUD5_RXFS IOMUX_PAD(0x58c, 0x148, 1, 0x0, 0, NO_PAD_CTRL)
455#define MX35_PAD_HCKR__CSPI2_SS0 IOMUX_PAD(0x58c, 0x148, 2, 0x7f0, 0, NO_PAD_CTRL)
456#define MX35_PAD_HCKR__IPU_FLASH_STROBE IOMUX_PAD(0x58c, 0x148, 3, 0x0, 0, NO_PAD_CTRL)
457#define MX35_PAD_HCKR__GPIO1_6 IOMUX_PAD(0x58c, 0x148, 5, 0x858, 1, NO_PAD_CTRL)
458#define MX35_PAD_HCKR__ARM11P_TOP_EVNTBUS_12 IOMUX_PAD(0x58c, 0x148, 7, 0x0, 0, NO_PAD_CTRL)
459
460#define MX35_PAD_SCKT__ESAI_SCKT IOMUX_PAD(0x590, 0x14c, 0, 0x0, 0, NO_PAD_CTRL)
461#define MX35_PAD_SCKT__GPIO1_7 IOMUX_PAD(0x590, 0x14c, 5, 0x85c, 1, NO_PAD_CTRL)
462#define MX35_PAD_SCKT__IPU_CSI_D_0 IOMUX_PAD(0x590, 0x14c, 6, 0x930, 0, NO_PAD_CTRL)
463#define MX35_PAD_SCKT__KPP_ROW_2 IOMUX_PAD(0x590, 0x14c, 7, 0x978, 1, NO_PAD_CTRL)
464
465#define MX35_PAD_FST__ESAI_FST IOMUX_PAD(0x594, 0x150, 0, 0x0, 0, NO_PAD_CTRL)
466#define MX35_PAD_FST__GPIO1_8 IOMUX_PAD(0x594, 0x150, 5, 0x860, 1, NO_PAD_CTRL)
467#define MX35_PAD_FST__IPU_CSI_D_1 IOMUX_PAD(0x594, 0x150, 6, 0x934, 0, NO_PAD_CTRL)
468#define MX35_PAD_FST__KPP_ROW_3 IOMUX_PAD(0x594, 0x150, 7, 0x97c, 1, NO_PAD_CTRL)
469
470#define MX35_PAD_HCKT__ESAI_HCKT IOMUX_PAD(0x598, 0x154, 0, 0x0, 0, NO_PAD_CTRL)
471#define MX35_PAD_HCKT__AUDMUX_AUD5_RXC IOMUX_PAD(0x598, 0x154, 1, 0x7a8, 0, NO_PAD_CTRL)
472#define MX35_PAD_HCKT__GPIO1_9 IOMUX_PAD(0x598, 0x154, 5, 0x864, 0, NO_PAD_CTRL)
473#define MX35_PAD_HCKT__IPU_CSI_D_2 IOMUX_PAD(0x598, 0x154, 6, 0x938, 0, NO_PAD_CTRL)
474#define MX35_PAD_HCKT__KPP_COL_3 IOMUX_PAD(0x598, 0x154, 7, 0x95c, 1, NO_PAD_CTRL)
475
476#define MX35_PAD_TX5_RX0__ESAI_TX5_RX0 IOMUX_PAD(0x59c, 0x158, 0, 0x0, 0, NO_PAD_CTRL)
477#define MX35_PAD_TX5_RX0__AUDMUX_AUD4_RXC IOMUX_PAD(0x59c, 0x158, 1, 0x0, 0, NO_PAD_CTRL)
478#define MX35_PAD_TX5_RX0__CSPI2_SS2 IOMUX_PAD(0x59c, 0x158, 2, 0x7f8, 1, NO_PAD_CTRL)
479#define MX35_PAD_TX5_RX0__CAN2_TXCAN IOMUX_PAD(0x59c, 0x158, 3, 0x0, 0, NO_PAD_CTRL)
480#define MX35_PAD_TX5_RX0__UART2_DTR IOMUX_PAD(0x59c, 0x158, 4, 0x0, 0, NO_PAD_CTRL)
481#define MX35_PAD_TX5_RX0__GPIO1_10 IOMUX_PAD(0x59c, 0x158, 5, 0x830, 0, NO_PAD_CTRL)
482#define MX35_PAD_TX5_RX0__EMI_M3IF_CHOSEN_MASTER_0 IOMUX_PAD(0x59c, 0x158, 7, 0x0, 0, NO_PAD_CTRL)
483
484#define MX35_PAD_TX4_RX1__ESAI_TX4_RX1 IOMUX_PAD(0x5a0, 0x15c, 0, 0x0, 0, NO_PAD_CTRL)
485#define MX35_PAD_TX4_RX1__AUDMUX_AUD4_RXFS IOMUX_PAD(0x5a0, 0x15c, 1, 0x0, 0, NO_PAD_CTRL)
486#define MX35_PAD_TX4_RX1__CSPI2_SS3 IOMUX_PAD(0x5a0, 0x15c, 2, 0x7fc, 0, NO_PAD_CTRL)
487#define MX35_PAD_TX4_RX1__CAN2_RXCAN IOMUX_PAD(0x5a0, 0x15c, 3, 0x7cc, 0, NO_PAD_CTRL)
488#define MX35_PAD_TX4_RX1__UART2_DSR IOMUX_PAD(0x5a0, 0x15c, 4, 0x0, 0, NO_PAD_CTRL)
489#define MX35_PAD_TX4_RX1__GPIO1_11 IOMUX_PAD(0x5a0, 0x15c, 5, 0x834, 0, NO_PAD_CTRL)
490#define MX35_PAD_TX4_RX1__IPU_CSI_D_3 IOMUX_PAD(0x5a0, 0x15c, 6, 0x93c, 0, NO_PAD_CTRL)
491#define MX35_PAD_TX4_RX1__KPP_ROW_0 IOMUX_PAD(0x5a0, 0x15c, 7, 0x970, 1, NO_PAD_CTRL)
492
493#define MX35_PAD_TX3_RX2__ESAI_TX3_RX2 IOMUX_PAD(0x5a4, 0x160, 0, 0x0, 0, NO_PAD_CTRL)
494#define MX35_PAD_TX3_RX2__I2C3_SCL IOMUX_PAD(0x5a4, 0x160, 1, 0x91c, 0, NO_PAD_CTRL)
495#define MX35_PAD_TX3_RX2__EMI_NANDF_CE1 IOMUX_PAD(0x5a4, 0x160, 3, 0x0, 0, NO_PAD_CTRL)
496#define MX35_PAD_TX3_RX2__GPIO1_12 IOMUX_PAD(0x5a4, 0x160, 5, 0x0, 0, NO_PAD_CTRL)
497#define MX35_PAD_TX3_RX2__IPU_CSI_D_4 IOMUX_PAD(0x5a4, 0x160, 6, 0x940, 0, NO_PAD_CTRL)
498#define MX35_PAD_TX3_RX2__KPP_ROW_1 IOMUX_PAD(0x5a4, 0x160, 7, 0x974, 1, NO_PAD_CTRL)
499
500#define MX35_PAD_TX2_RX3__ESAI_TX2_RX3 IOMUX_PAD(0x5a8, 0x164, 0, 0x0, 0, NO_PAD_CTRL)
501#define MX35_PAD_TX2_RX3__I2C3_SDA IOMUX_PAD(0x5a8, 0x164, 1, 0x920, 0, NO_PAD_CTRL)
502#define MX35_PAD_TX2_RX3__EMI_NANDF_CE2 IOMUX_PAD(0x5a8, 0x164, 3, 0x0, 0, NO_PAD_CTRL)
503#define MX35_PAD_TX2_RX3__GPIO1_13 IOMUX_PAD(0x5a8, 0x164, 5, 0x0, 0, NO_PAD_CTRL)
504#define MX35_PAD_TX2_RX3__IPU_CSI_D_5 IOMUX_PAD(0x5a8, 0x164, 6, 0x944, 0, NO_PAD_CTRL)
505#define MX35_PAD_TX2_RX3__KPP_COL_0 IOMUX_PAD(0x5a8, 0x164, 7, 0x950, 1, NO_PAD_CTRL)
506
507#define MX35_PAD_TX1__ESAI_TX1 IOMUX_PAD(0x5ac, 0x168, 0, 0x0, 0, NO_PAD_CTRL)
508#define MX35_PAD_TX1__CCM_PMIC_RDY IOMUX_PAD(0x5ac, 0x168, 1, 0x7d4, 1, NO_PAD_CTRL)
509#define MX35_PAD_TX1__CSPI1_SS2 IOMUX_PAD(0x5ac, 0x168, 2, 0x7d8, 2, NO_PAD_CTRL)
510#define MX35_PAD_TX1__EMI_NANDF_CE3 IOMUX_PAD(0x5ac, 0x168, 3, 0x0, 0, NO_PAD_CTRL)
511#define MX35_PAD_TX1__UART2_RI IOMUX_PAD(0x5ac, 0x168, 4, 0x0, 0, NO_PAD_CTRL)
512#define MX35_PAD_TX1__GPIO1_14 IOMUX_PAD(0x5ac, 0x168, 5, 0x0, 0, NO_PAD_CTRL)
513#define MX35_PAD_TX1__IPU_CSI_D_6 IOMUX_PAD(0x5ac, 0x168, 6, 0x948, 0, NO_PAD_CTRL)
514#define MX35_PAD_TX1__KPP_COL_1 IOMUX_PAD(0x5ac, 0x168, 7, 0x954, 1, NO_PAD_CTRL)
515
516#define MX35_PAD_TX0__ESAI_TX0 IOMUX_PAD(0x5b0, 0x16c, 0, 0x0, 0, NO_PAD_CTRL)
517#define MX35_PAD_TX0__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x5b0, 0x16c, 1, 0x994, 1, NO_PAD_CTRL)
518#define MX35_PAD_TX0__CSPI1_SS3 IOMUX_PAD(0x5b0, 0x16c, 2, 0x7dc, 0, NO_PAD_CTRL)
519#define MX35_PAD_TX0__EMI_DTACK_B IOMUX_PAD(0x5b0, 0x16c, 3, 0x800, 1, NO_PAD_CTRL)
520#define MX35_PAD_TX0__UART2_DCD IOMUX_PAD(0x5b0, 0x16c, 4, 0x0, 0, NO_PAD_CTRL)
521#define MX35_PAD_TX0__GPIO1_15 IOMUX_PAD(0x5b0, 0x16c, 5, 0x0, 0, NO_PAD_CTRL)
522#define MX35_PAD_TX0__IPU_CSI_D_7 IOMUX_PAD(0x5b0, 0x16c, 6, 0x94c, 0, NO_PAD_CTRL)
523#define MX35_PAD_TX0__KPP_COL_2 IOMUX_PAD(0x5b0, 0x16c, 7, 0x958, 1, NO_PAD_CTRL)
524
525#define MX35_PAD_CSPI1_MOSI__CSPI1_MOSI IOMUX_PAD(0x5b4, 0x170, 0, 0x0, 0, NO_PAD_CTRL)
526#define MX35_PAD_CSPI1_MOSI__GPIO1_16 IOMUX_PAD(0x5b4, 0x170, 5, 0x0, 0, NO_PAD_CTRL)
527#define MX35_PAD_CSPI1_MOSI__ECT_CTI_TRIG_OUT1_2 IOMUX_PAD(0x5b4, 0x170, 7, 0x0, 0, NO_PAD_CTRL)
528
529#define MX35_PAD_CSPI1_MISO__CSPI1_MISO IOMUX_PAD(0x5b8, 0x174, 0, 0x0, 0, NO_PAD_CTRL)
530#define MX35_PAD_CSPI1_MISO__GPIO1_17 IOMUX_PAD(0x5b8, 0x174, 5, 0x0, 0, NO_PAD_CTRL)
531#define MX35_PAD_CSPI1_MISO__ECT_CTI_TRIG_OUT1_3 IOMUX_PAD(0x5b8, 0x174, 7, 0x0, 0, NO_PAD_CTRL)
532
533#define MX35_PAD_CSPI1_SS0__CSPI1_SS0 IOMUX_PAD(0x5bc, 0x178, 0, 0x0, 0, NO_PAD_CTRL)
534#define MX35_PAD_CSPI1_SS0__OWIRE_LINE IOMUX_PAD(0x5bc, 0x178, 1, 0x990, 1, NO_PAD_CTRL)
535#define MX35_PAD_CSPI1_SS0__CSPI2_SS3 IOMUX_PAD(0x5bc, 0x178, 2, 0x7fc, 1, NO_PAD_CTRL)
536#define MX35_PAD_CSPI1_SS0__GPIO1_18 IOMUX_PAD(0x5bc, 0x178, 5, 0x0, 0, NO_PAD_CTRL)
537#define MX35_PAD_CSPI1_SS0__ECT_CTI_TRIG_OUT1_4 IOMUX_PAD(0x5bc, 0x178, 7, 0x0, 0, NO_PAD_CTRL)
538
539#define MX35_PAD_CSPI1_SS1__CSPI1_SS1 IOMUX_PAD(0x5c0, 0x17c, 0, 0x0, 0, NO_PAD_CTRL)
540#define MX35_PAD_CSPI1_SS1__PWM_PWMO IOMUX_PAD(0x5c0, 0x17c, 1, 0x0, 0, NO_PAD_CTRL)
541#define MX35_PAD_CSPI1_SS1__CCM_CLK32K IOMUX_PAD(0x5c0, 0x17c, 2, 0x7d0, 1, NO_PAD_CTRL)
542#define MX35_PAD_CSPI1_SS1__GPIO1_19 IOMUX_PAD(0x5c0, 0x17c, 5, 0x0, 0, NO_PAD_CTRL)
543#define MX35_PAD_CSPI1_SS1__IPU_DIAGB_29 IOMUX_PAD(0x5c0, 0x17c, 6, 0x0, 0, NO_PAD_CTRL)
544#define MX35_PAD_CSPI1_SS1__ECT_CTI_TRIG_OUT1_5 IOMUX_PAD(0x5c0, 0x17c, 7, 0x0, 0, NO_PAD_CTRL)
545
546#define MX35_PAD_CSPI1_SCLK__CSPI1_SCLK IOMUX_PAD(0x5c4, 0x180, 0, 0x0, 0, NO_PAD_CTRL)
547#define MX35_PAD_CSPI1_SCLK__GPIO3_4 IOMUX_PAD(0x5c4, 0x180, 5, 0x904, 0, NO_PAD_CTRL)
548#define MX35_PAD_CSPI1_SCLK__IPU_DIAGB_30 IOMUX_PAD(0x5c4, 0x180, 6, 0x0, 0, NO_PAD_CTRL)
549#define MX35_PAD_CSPI1_SCLK__EMI_M3IF_CHOSEN_MASTER_1 IOMUX_PAD(0x5c4, 0x180, 7, 0x0, 0, NO_PAD_CTRL)
550
551#define MX35_PAD_CSPI1_SPI_RDY__CSPI1_RDY IOMUX_PAD(0x5c8, 0x184, 0, 0x0, 0, NO_PAD_CTRL)
552#define MX35_PAD_CSPI1_SPI_RDY__GPIO3_5 IOMUX_PAD(0x5c8, 0x184, 5, 0x908, 0, NO_PAD_CTRL)
553#define MX35_PAD_CSPI1_SPI_RDY__IPU_DIAGB_31 IOMUX_PAD(0x5c8, 0x184, 6, 0x0, 0, NO_PAD_CTRL)
554#define MX35_PAD_CSPI1_SPI_RDY__EMI_M3IF_CHOSEN_MASTER_2 IOMUX_PAD(0x5c8, 0x184, 7, 0x0, 0, NO_PAD_CTRL)
555
556#define MX35_PAD_RXD1__UART1_RXD_MUX IOMUX_PAD(0x5cc, 0x188, 0, 0x0, 0, NO_PAD_CTRL)
557#define MX35_PAD_RXD1__CSPI2_MOSI IOMUX_PAD(0x5cc, 0x188, 1, 0x7ec, 1, NO_PAD_CTRL)
558#define MX35_PAD_RXD1__KPP_COL_4 IOMUX_PAD(0x5cc, 0x188, 4, 0x960, 0, NO_PAD_CTRL)
559#define MX35_PAD_RXD1__GPIO3_6 IOMUX_PAD(0x5cc, 0x188, 5, 0x90c, 0, NO_PAD_CTRL)
560#define MX35_PAD_RXD1__ARM11P_TOP_EVNTBUS_16 IOMUX_PAD(0x5cc, 0x188, 7, 0x0, 0, NO_PAD_CTRL)
561
562#define MX35_PAD_TXD1__UART1_TXD_MUX IOMUX_PAD(0x5d0, 0x18c, 0, 0x0, 0, NO_PAD_CTRL)
563#define MX35_PAD_TXD1__CSPI2_MISO IOMUX_PAD(0x5d0, 0x18c, 1, 0x7e8, 1, NO_PAD_CTRL)
564#define MX35_PAD_TXD1__KPP_COL_5 IOMUX_PAD(0x5d0, 0x18c, 4, 0x964, 0, NO_PAD_CTRL)
565#define MX35_PAD_TXD1__GPIO3_7 IOMUX_PAD(0x5d0, 0x18c, 5, 0x910, 0, NO_PAD_CTRL)
566#define MX35_PAD_TXD1__ARM11P_TOP_EVNTBUS_17 IOMUX_PAD(0x5d0, 0x18c, 7, 0x0, 0, NO_PAD_CTRL)
567
568#define MX35_PAD_RTS1__UART1_RTS IOMUX_PAD(0x5d4, 0x190, 0, 0x0, 0, NO_PAD_CTRL)
569#define MX35_PAD_RTS1__CSPI2_SCLK IOMUX_PAD(0x5d4, 0x190, 1, 0x7e0, 1, NO_PAD_CTRL)
570#define MX35_PAD_RTS1__I2C3_SCL IOMUX_PAD(0x5d4, 0x190, 2, 0x91c, 1, NO_PAD_CTRL)
571#define MX35_PAD_RTS1__IPU_CSI_D_0 IOMUX_PAD(0x5d4, 0x190, 3, 0x930, 1, NO_PAD_CTRL)
572#define MX35_PAD_RTS1__KPP_COL_6 IOMUX_PAD(0x5d4, 0x190, 4, 0x968, 0, NO_PAD_CTRL)
573#define MX35_PAD_RTS1__GPIO3_8 IOMUX_PAD(0x5d4, 0x190, 5, 0x914, 0, NO_PAD_CTRL)
574#define MX35_PAD_RTS1__EMI_NANDF_CE1 IOMUX_PAD(0x5d4, 0x190, 6, 0x0, 0, NO_PAD_CTRL)
575#define MX35_PAD_RTS1__ARM11P_TOP_EVNTBUS_18 IOMUX_PAD(0x5d4, 0x190, 7, 0x0, 0, NO_PAD_CTRL)
576
577#define MX35_PAD_CTS1__UART1_CTS IOMUX_PAD(0x5d8, 0x194, 0, 0x0, 0, NO_PAD_CTRL)
578#define MX35_PAD_CTS1__CSPI2_RDY IOMUX_PAD(0x5d8, 0x194, 1, 0x7e4, 1, NO_PAD_CTRL)
579#define MX35_PAD_CTS1__I2C3_SDA IOMUX_PAD(0x5d8, 0x194, 2, 0x920, 1, NO_PAD_CTRL)
580#define MX35_PAD_CTS1__IPU_CSI_D_1 IOMUX_PAD(0x5d8, 0x194, 3, 0x934, 1, NO_PAD_CTRL)
581#define MX35_PAD_CTS1__KPP_COL_7 IOMUX_PAD(0x5d8, 0x194, 4, 0x96c, 0, NO_PAD_CTRL)
582#define MX35_PAD_CTS1__GPIO3_9 IOMUX_PAD(0x5d8, 0x194, 5, 0x918, 0, NO_PAD_CTRL)
583#define MX35_PAD_CTS1__EMI_NANDF_CE2 IOMUX_PAD(0x5d8, 0x194, 6, 0x0, 0, NO_PAD_CTRL)
584#define MX35_PAD_CTS1__ARM11P_TOP_EVNTBUS_19 IOMUX_PAD(0x5d8, 0x194, 7, 0x0, 0, NO_PAD_CTRL)
585
586#define MX35_PAD_RXD2__UART2_RXD_MUX IOMUX_PAD(0x5dc, 0x198, 0, 0x0, 0, NO_PAD_CTRL)
587#define MX35_PAD_RXD2__KPP_ROW_4 IOMUX_PAD(0x5dc, 0x198, 4, 0x980, 0, NO_PAD_CTRL)
588#define MX35_PAD_RXD2__GPIO3_10 IOMUX_PAD(0x5dc, 0x198, 5, 0x8ec, 0, NO_PAD_CTRL)
589
590#define MX35_PAD_TXD2__UART2_TXD_MUX IOMUX_PAD(0x5e0, 0x19c, 0, 0x0, 0, NO_PAD_CTRL)
591#define MX35_PAD_TXD2__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x5e0, 0x19c, 1, 0x994, 2, NO_PAD_CTRL)
592#define MX35_PAD_TXD2__KPP_ROW_5 IOMUX_PAD(0x5e0, 0x19c, 4, 0x984, 0, NO_PAD_CTRL)
593#define MX35_PAD_TXD2__GPIO3_11 IOMUX_PAD(0x5e0, 0x19c, 5, 0x8f0, 0, NO_PAD_CTRL)
594
595#define MX35_PAD_RTS2__UART2_RTS IOMUX_PAD(0x5e4, 0x1a0, 0, 0x0, 0, NO_PAD_CTRL)
596#define MX35_PAD_RTS2__SPDIF_SPDIF_IN1 IOMUX_PAD(0x5e4, 0x1a0, 1, 0x998, 1, NO_PAD_CTRL)
597#define MX35_PAD_RTS2__CAN2_RXCAN IOMUX_PAD(0x5e4, 0x1a0, 2, 0x7cc, 1, NO_PAD_CTRL)
598#define MX35_PAD_RTS2__IPU_CSI_D_2 IOMUX_PAD(0x5e4, 0x1a0, 3, 0x938, 1, NO_PAD_CTRL)
599#define MX35_PAD_RTS2__KPP_ROW_6 IOMUX_PAD(0x5e4, 0x1a0, 4, 0x988, 0, NO_PAD_CTRL)
600#define MX35_PAD_RTS2__GPIO3_12 IOMUX_PAD(0x5e4, 0x1a0, 5, 0x8f4, 0, NO_PAD_CTRL)
601#define MX35_PAD_RTS2__AUDMUX_AUD5_RXC IOMUX_PAD(0x5e4, 0x1a0, 6, 0x0, 0, NO_PAD_CTRL)
602#define MX35_PAD_RTS2__UART3_RXD_MUX IOMUX_PAD(0x5e4, 0x1a0, 7, 0x9a0, 0, NO_PAD_CTRL)
603
604#define MX35_PAD_CTS2__UART2_CTS IOMUX_PAD(0x5e8, 0x1a4, 0, 0x0, 0, NO_PAD_CTRL)
605#define MX35_PAD_CTS2__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x5e8, 0x1a4, 1, 0x0, 0, NO_PAD_CTRL)
606#define MX35_PAD_CTS2__CAN2_TXCAN IOMUX_PAD(0x5e8, 0x1a4, 2, 0x0, 0, NO_PAD_CTRL)
607#define MX35_PAD_CTS2__IPU_CSI_D_3 IOMUX_PAD(0x5e8, 0x1a4, 3, 0x93c, 1, NO_PAD_CTRL)
608#define MX35_PAD_CTS2__KPP_ROW_7 IOMUX_PAD(0x5e8, 0x1a4, 4, 0x98c, 0, NO_PAD_CTRL)
609#define MX35_PAD_CTS2__GPIO3_13 IOMUX_PAD(0x5e8, 0x1a4, 5, 0x8f8, 0, NO_PAD_CTRL)
610#define MX35_PAD_CTS2__AUDMUX_AUD5_RXFS IOMUX_PAD(0x5e8, 0x1a4, 6, 0x0, 0, NO_PAD_CTRL)
611#define MX35_PAD_CTS2__UART3_TXD_MUX IOMUX_PAD(0x5e8, 0x1a4, 7, 0x0, 0, NO_PAD_CTRL)
612
613#define MX35_PAD_RTCK__ARM11P_TOP_RTCK IOMUX_PAD(0x5ec, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
614
615#define MX35_PAD_TCK__SJC_TCK IOMUX_PAD(0x5f0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
616
617#define MX35_PAD_TMS__SJC_TMS IOMUX_PAD(0x5f4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
618
619#define MX35_PAD_TDI__SJC_TDI IOMUX_PAD(0x5f8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
620
621#define MX35_PAD_TDO__SJC_TDO IOMUX_PAD(0x5fc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
622
623#define MX35_PAD_TRSTB__SJC_TRSTB IOMUX_PAD(0x600, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
624
625#define MX35_PAD_DE_B__SJC_DE_B IOMUX_PAD(0x604, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
626
627#define MX35_PAD_SJC_MOD__SJC_MOD IOMUX_PAD(0x608, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
628
629#define MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR IOMUX_PAD(0x60c, 0x1a8, 0, 0x0, 0, NO_PAD_CTRL)
630#define MX35_PAD_USBOTG_PWR__USB_TOP_USBH2_PWR IOMUX_PAD(0x60c, 0x1a8, 1, 0x0, 0, NO_PAD_CTRL)
631#define MX35_PAD_USBOTG_PWR__GPIO3_14 IOMUX_PAD(0x60c, 0x1a8, 5, 0x8fc, 0, NO_PAD_CTRL)
632
633#define MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC IOMUX_PAD(0x610, 0x1ac, 0, 0x0, 0, NO_PAD_CTRL)
634#define MX35_PAD_USBOTG_OC__USB_TOP_USBH2_OC IOMUX_PAD(0x610, 0x1ac, 1, 0x9f4, 1, NO_PAD_CTRL)
635#define MX35_PAD_USBOTG_OC__GPIO3_15 IOMUX_PAD(0x610, 0x1ac, 5, 0x900, 0, NO_PAD_CTRL)
636
637#define MX35_PAD_LD0__IPU_DISPB_DAT_0 IOMUX_PAD(0x614, 0x1b0, 0, 0x0, 0, NO_PAD_CTRL)
638#define MX35_PAD_LD0__GPIO2_0 IOMUX_PAD(0x614, 0x1b0, 5, 0x868, 1, NO_PAD_CTRL)
639#define MX35_PAD_LD0__SDMA_SDMA_DEBUG_PC_0 IOMUX_PAD(0x614, 0x1b0, 6, 0x0, 0, NO_PAD_CTRL)
640
641#define MX35_PAD_LD1__IPU_DISPB_DAT_1 IOMUX_PAD(0x618, 0x1b4, 0, 0x0, 0, NO_PAD_CTRL)
642#define MX35_PAD_LD1__GPIO2_1 IOMUX_PAD(0x618, 0x1b4, 5, 0x894, 0, NO_PAD_CTRL)
643#define MX35_PAD_LD1__SDMA_SDMA_DEBUG_PC_1 IOMUX_PAD(0x618, 0x1b4, 6, 0x0, 0, NO_PAD_CTRL)
644
645#define MX35_PAD_LD2__IPU_DISPB_DAT_2 IOMUX_PAD(0x61c, 0x1b8, 0, 0x0, 0, NO_PAD_CTRL)
646#define MX35_PAD_LD2__GPIO2_2 IOMUX_PAD(0x61c, 0x1b8, 5, 0x8c0, 0, NO_PAD_CTRL)
647#define MX35_PAD_LD2__SDMA_SDMA_DEBUG_PC_2 IOMUX_PAD(0x61c, 0x1b8, 6, 0x0, 0, NO_PAD_CTRL)
648
649#define MX35_PAD_LD3__IPU_DISPB_DAT_3 IOMUX_PAD(0x620, 0x1bc, 0, 0x0, 0, NO_PAD_CTRL)
650#define MX35_PAD_LD3__GPIO2_3 IOMUX_PAD(0x620, 0x1bc, 5, 0x8cc, 0, NO_PAD_CTRL)
651#define MX35_PAD_LD3__SDMA_SDMA_DEBUG_PC_3 IOMUX_PAD(0x620, 0x1bc, 6, 0x0, 0, NO_PAD_CTRL)
652
653#define MX35_PAD_LD4__IPU_DISPB_DAT_4 IOMUX_PAD(0x624, 0x1c0, 0, 0x0, 0, NO_PAD_CTRL)
654#define MX35_PAD_LD4__GPIO2_4 IOMUX_PAD(0x624, 0x1c0, 5, 0x8d0, 0, NO_PAD_CTRL)
655#define MX35_PAD_LD4__SDMA_SDMA_DEBUG_PC_4 IOMUX_PAD(0x624, 0x1c0, 6, 0x0, 0, NO_PAD_CTRL)
656
657#define MX35_PAD_LD5__IPU_DISPB_DAT_5 IOMUX_PAD(0x628, 0x1c4, 0, 0x0, 0, NO_PAD_CTRL)
658#define MX35_PAD_LD5__GPIO2_5 IOMUX_PAD(0x628, 0x1c4, 5, 0x8d4, 0, NO_PAD_CTRL)
659#define MX35_PAD_LD5__SDMA_SDMA_DEBUG_PC_5 IOMUX_PAD(0x628, 0x1c4, 6, 0x0, 0, NO_PAD_CTRL)
660
661#define MX35_PAD_LD6__IPU_DISPB_DAT_6 IOMUX_PAD(0x62c, 0x1c8, 0, 0x0, 0, NO_PAD_CTRL)
662#define MX35_PAD_LD6__GPIO2_6 IOMUX_PAD(0x62c, 0x1c8, 5, 0x8d8, 0, NO_PAD_CTRL)
663#define MX35_PAD_LD6__SDMA_SDMA_DEBUG_PC_6 IOMUX_PAD(0x62c, 0x1c8, 6, 0x0, 0, NO_PAD_CTRL)
664
665#define MX35_PAD_LD7__IPU_DISPB_DAT_7 IOMUX_PAD(0x630, 0x1cc, 0, 0x0, 0, NO_PAD_CTRL)
666#define MX35_PAD_LD7__GPIO2_7 IOMUX_PAD(0x630, 0x1cc, 5, 0x8dc, 0, NO_PAD_CTRL)
667#define MX35_PAD_LD7__SDMA_SDMA_DEBUG_PC_7 IOMUX_PAD(0x630, 0x1cc, 6, 0x0, 0, NO_PAD_CTRL)
668
669#define MX35_PAD_LD8__IPU_DISPB_DAT_8 IOMUX_PAD(0x634, 0x1d0, 0, 0x0, 0, NO_PAD_CTRL)
670#define MX35_PAD_LD8__GPIO2_8 IOMUX_PAD(0x634, 0x1d0, 5, 0x8e0, 0, NO_PAD_CTRL)
671#define MX35_PAD_LD8__SDMA_SDMA_DEBUG_PC_8 IOMUX_PAD(0x634, 0x1d0, 6, 0x0, 0, NO_PAD_CTRL)
672
673#define MX35_PAD_LD9__IPU_DISPB_DAT_9 IOMUX_PAD(0x638, 0x1d4, 0, 0x0, 0, NO_PAD_CTRL)
674#define MX35_PAD_LD9__GPIO2_9 IOMUX_PAD(0x638, 0x1d4, 5, 0x8e4 0, NO_PAD_CTRL)
675#define MX35_PAD_LD9__SDMA_SDMA_DEBUG_PC_9 IOMUX_PAD(0x638, 0x1d4, 6, 0x0, 0, NO_PAD_CTRL)
676
677#define MX35_PAD_LD10__IPU_DISPB_DAT_10 IOMUX_PAD(0x63c, 0x1d8, 0, 0x0, 0, NO_PAD_CTRL)
678#define MX35_PAD_LD10__GPIO2_10 IOMUX_PAD(0x63c, 0x1d8, 5, 0x86c, 0, NO_PAD_CTRL)
679#define MX35_PAD_LD10__SDMA_SDMA_DEBUG_PC_10 IOMUX_PAD(0x63c, 0x1d8, 6, 0x0, 0, NO_PAD_CTRL)
680
681#define MX35_PAD_LD11__IPU_DISPB_DAT_11 IOMUX_PAD(0x640, 0x1dc, 0, 0x0, 0, NO_PAD_CTRL)
682#define MX35_PAD_LD11__GPIO2_11 IOMUX_PAD(0x640, 0x1dc, 5, 0x870, 0, NO_PAD_CTRL)
683#define MX35_PAD_LD11__SDMA_SDMA_DEBUG_PC_11 IOMUX_PAD(0x640, 0x1dc, 6, 0x0, 0, NO_PAD_CTRL)
684#define MX35_PAD_LD11__ARM11P_TOP_TRACE_4 IOMUX_PAD(0x640, 0x1dc, 7, 0x0, 0, NO_PAD_CTRL)
685
686#define MX35_PAD_LD12__IPU_DISPB_DAT_12 IOMUX_PAD(0x644, 0x1e0, 0, 0x0, 0, NO_PAD_CTRL)
687#define MX35_PAD_LD12__GPIO2_12 IOMUX_PAD(0x644, 0x1e0, 5, 0x874, 0, NO_PAD_CTRL)
688#define MX35_PAD_LD12__SDMA_SDMA_DEBUG_PC_12 IOMUX_PAD(0x644, 0x1e0, 6, 0x0, 0, NO_PAD_CTRL)
689#define MX35_PAD_LD12__ARM11P_TOP_TRACE_5 IOMUX_PAD(0x644, 0x1e0, 7, 0x0, 0, NO_PAD_CTRL)
690
691#define MX35_PAD_LD13__IPU_DISPB_DAT_13 IOMUX_PAD(0x648, 0x1e4, 0, 0x0, 0, NO_PAD_CTRL)
692#define MX35_PAD_LD13__GPIO2_13 IOMUX_PAD(0x648, 0x1e4, 5, 0x878, 0, NO_PAD_CTRL)
693#define MX35_PAD_LD13__SDMA_SDMA_DEBUG_PC_13 IOMUX_PAD(0x648, 0x1e4, 6, 0x0, 0, NO_PAD_CTRL)
694#define MX35_PAD_LD13__ARM11P_TOP_TRACE_6 IOMUX_PAD(0x648, 0x1e4, 7, 0x0, 0, NO_PAD_CTRL)
695
696#define MX35_PAD_LD14__IPU_DISPB_DAT_14 IOMUX_PAD(0x64c, 0x1e8, 0, 0x0, 0, NO_PAD_CTRL)
697#define MX35_PAD_LD14__GPIO2_14 IOMUX_PAD(0x64c, 0x1e8, 5, 0x87c, 0, NO_PAD_CTRL)
698#define MX35_PAD_LD14__SDMA_SDMA_DEBUG_EVENT_CHANNEL_0 IOMUX_PAD(0x64c, 0x1e8, 6, 0x0, 0, NO_PAD_CTRL)
699#define MX35_PAD_LD14__ARM11P_TOP_TRACE_7 IOMUX_PAD(0x64c, 0x1e8, 7, 0x0, 0, NO_PAD_CTRL)
700
701#define MX35_PAD_LD15__IPU_DISPB_DAT_15 IOMUX_PAD(0x650, 0x1ec, 0, 0x0, 0, NO_PAD_CTRL)
702#define MX35_PAD_LD15__GPIO2_15 IOMUX_PAD(0x650, 0x1ec, 5, 0x880, 0, NO_PAD_CTRL)
703#define MX35_PAD_LD15__SDMA_SDMA_DEBUG_EVENT_CHANNEL_1 IOMUX_PAD(0x650, 0x1ec, 6, 0x0, 0, NO_PAD_CTRL)
704#define MX35_PAD_LD15__ARM11P_TOP_TRACE_8 IOMUX_PAD(0x650, 0x1ec, 7, 0x0, 0, NO_PAD_CTRL)
705
706#define MX35_PAD_LD16__IPU_DISPB_DAT_16 IOMUX_PAD(0x654, 0x1f0, 0, 0x0, 0, NO_PAD_CTRL)
707#define MX35_PAD_LD16__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x654, 0x1f0, 2, 0x928, 0, NO_PAD_CTRL)
708#define MX35_PAD_LD16__GPIO2_16 IOMUX_PAD(0x654, 0x1f0, 5, 0x884, 0, NO_PAD_CTRL)
709#define MX35_PAD_LD16__SDMA_SDMA_DEBUG_EVENT_CHANNEL_2 IOMUX_PAD(0x654, 0x1f0, 6, 0x0, 0, NO_PAD_CTRL)
710#define MX35_PAD_LD16__ARM11P_TOP_TRACE_9 IOMUX_PAD(0x654, 0x1f0, 7, 0x0, 0, NO_PAD_CTRL)
711
712#define MX35_PAD_LD17__IPU_DISPB_DAT_17 IOMUX_PAD(0x658, 0x1f4, 0, 0x0, 0, NO_PAD_CTRL)
713#define MX35_PAD_LD17__IPU_DISPB_CS2 IOMUX_PAD(0x658, 0x1f4, 2, 0x0, 0, NO_PAD_CTRL)
714#define MX35_PAD_LD17__GPIO2_17 IOMUX_PAD(0x658, 0x1f4, 5, 0x888, 0, NO_PAD_CTRL)
715#define MX35_PAD_LD17__SDMA_SDMA_DEBUG_EVENT_CHANNEL_3 IOMUX_PAD(0x658, 0x1f4, 6, 0x0, 0, NO_PAD_CTRL)
716#define MX35_PAD_LD17__ARM11P_TOP_TRACE_10 IOMUX_PAD(0x658, 0x1f4, 7, 0x0, 0, NO_PAD_CTRL)
717
718#define MX35_PAD_LD18__IPU_DISPB_DAT_18 IOMUX_PAD(0x65c, 0x1f8, 0, 0x0, 0, NO_PAD_CTRL)
719#define MX35_PAD_LD18__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x65c, 0x1f8, 1, 0x924, 1, NO_PAD_CTRL)
720#define MX35_PAD_LD18__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x65c, 0x1f8, 2, 0x928, 1, NO_PAD_CTRL)
721#define MX35_PAD_LD18__ESDHC3_CMD IOMUX_PAD(0x65c, 0x1f8, 3, 0x818, 0, NO_PAD_CTRL)
722#define MX35_PAD_LD18__USB_TOP_USBOTG_DATA_3 IOMUX_PAD(0x65c, 0x1f8, 4, 0x9b0, 0, NO_PAD_CTRL)
723#define MX35_PAD_LD18__GPIO3_24 IOMUX_PAD(0x65c, 0x1f8, 5, 0x0, 0, NO_PAD_CTRL)
724#define MX35_PAD_LD18__SDMA_SDMA_DEBUG_EVENT_CHANNEL_4 IOMUX_PAD(0x65c, 0x1f8, 6, 0x0, 0, NO_PAD_CTRL)
725#define MX35_PAD_LD18__ARM11P_TOP_TRACE_11 IOMUX_PAD(0x65c, 0x1f8, 7, 0x0, 0, NO_PAD_CTRL)
726
727#define MX35_PAD_LD19__IPU_DISPB_DAT_19 IOMUX_PAD(0x660, 0x1fc, 0, 0x0, 0, NO_PAD_CTRL)
728#define MX35_PAD_LD19__IPU_DISPB_BCLK IOMUX_PAD(0x660, 0x1fc, 1, 0x0, 0, NO_PAD_CTRL)
729#define MX35_PAD_LD19__IPU_DISPB_CS1 IOMUX_PAD(0x660, 0x1fc, 2, 0x0, 0, NO_PAD_CTRL)
730#define MX35_PAD_LD19__ESDHC3_CLK IOMUX_PAD(0x660, 0x1fc, 3, 0x814, 0, NO_PAD_CTRL)
731#define MX35_PAD_LD19__USB_TOP_USBOTG_DIR IOMUX_PAD(0x660, 0x1fc, 4, 0x9c4, 0, NO_PAD_CTRL)
732#define MX35_PAD_LD19__GPIO3_25 IOMUX_PAD(0x660, 0x1fc, 5, 0x0, 0, NO_PAD_CTRL)
733#define MX35_PAD_LD19__SDMA_SDMA_DEBUG_EVENT_CHANNEL_5 IOMUX_PAD(0x660, 0x1fc, 6, 0x0, 0, NO_PAD_CTRL)
734#define MX35_PAD_LD19__ARM11P_TOP_TRACE_12 IOMUX_PAD(0x660, 0x1fc, 7, 0x0, 0, NO_PAD_CTRL)
735
736#define MX35_PAD_LD20__IPU_DISPB_DAT_20 IOMUX_PAD(0x664, 0x200, 0, 0x0, 0, NO_PAD_CTRL)
737#define MX35_PAD_LD20__IPU_DISPB_CS0 IOMUX_PAD(0x664, 0x200, 1, 0x0, 0, NO_PAD_CTRL)
738#define MX35_PAD_LD20__IPU_DISPB_SD_CLK IOMUX_PAD(0x664, 0x200, 2, 0x0, 0, NO_PAD_CTRL)
739#define MX35_PAD_LD20__ESDHC3_DAT0 IOMUX_PAD(0x664, 0x200, 3, 0x81c, 0, NO_PAD_CTRL)
740#define MX35_PAD_LD20__GPIO3_26 IOMUX_PAD(0x664, 0x200, 5, 0x0, 0, NO_PAD_CTRL)
741#define MX35_PAD_LD20__SDMA_SDMA_DEBUG_CORE_STATUS_3 IOMUX_PAD(0x664, 0x200, 6, 0x0, 0, NO_PAD_CTRL)
742#define MX35_PAD_LD20__ARM11P_TOP_TRACE_13 IOMUX_PAD(0x664, 0x200, 7, 0x0, 0, NO_PAD_CTRL)
743
744#define MX35_PAD_LD21__IPU_DISPB_DAT_21 IOMUX_PAD(0x668, 0x204, 0, 0x0, 0, NO_PAD_CTRL)
745#define MX35_PAD_LD21__IPU_DISPB_PAR_RS IOMUX_PAD(0x668, 0x204, 1, 0x0, 0, NO_PAD_CTRL)
746#define MX35_PAD_LD21__IPU_DISPB_SER_RS IOMUX_PAD(0x668, 0x204, 2, 0x0, 0, NO_PAD_CTRL)
747#define MX35_PAD_LD21__ESDHC3_DAT1 IOMUX_PAD(0x668, 0x204, 3, 0x820, 0, NO_PAD_CTRL)
748#define MX35_PAD_LD21__USB_TOP_USBOTG_STP IOMUX_PAD(0x668, 0x204, 4, 0x0, 0, NO_PAD_CTRL)
749#define MX35_PAD_LD21__GPIO3_27 IOMUX_PAD(0x668, 0x204, 5, 0x0, 0, NO_PAD_CTRL)
750#define MX35_PAD_LD21__SDMA_DEBUG_EVENT_CHANNEL_SEL IOMUX_PAD(0x668, 0x204, 6, 0x0, 0, NO_PAD_CTRL)
751#define MX35_PAD_LD21__ARM11P_TOP_TRACE_14 IOMUX_PAD(0x668, 0x204, 7, 0x0, 0, NO_PAD_CTRL)
752
753#define MX35_PAD_LD22__IPU_DISPB_DAT_22 IOMUX_PAD(0x66c, 0x208, 0, 0x0, 0, NO_PAD_CTRL)
754#define MX35_PAD_LD22__IPU_DISPB_WR IOMUX_PAD(0x66c, 0x208, 1, 0x0, 0, NO_PAD_CTRL)
755#define MX35_PAD_LD22__IPU_DISPB_SD_D_I IOMUX_PAD(0x66c, 0x208, 2, 0x92c, 0, NO_PAD_CTRL)
756#define MX35_PAD_LD22__ESDHC3_DAT2 IOMUX_PAD(0x66c, 0x208, 3, 0x824, 0, NO_PAD_CTRL)
757#define MX35_PAD_LD22__USB_TOP_USBOTG_NXT IOMUX_PAD(0x66c, 0x208, 4, 0x9c8, 0, NO_PAD_CTRL)
758#define MX35_PAD_LD22__GPIO3_28 IOMUX_PAD(0x66c, 0x208, 5, 0x0, 0, NO_PAD_CTRL)
759#define MX35_PAD_LD22__SDMA_DEBUG_BUS_ERROR IOMUX_PAD(0x66c, 0x208, 6, 0x0, 0, NO_PAD_CTRL)
760#define MX35_PAD_LD22__ARM11P_TOP_TRCTL IOMUX_PAD(0x66c, 0x208, 7, 0x0, 0, NO_PAD_CTRL)
761
762#define MX35_PAD_LD23__IPU_DISPB_DAT_23 IOMUX_PAD(0x670, 0x20c, 0, 0x0, 0, NO_PAD_CTRL)
763#define MX35_PAD_LD23__IPU_DISPB_RD IOMUX_PAD(0x670, 0x20c, 1, 0x0, 0, NO_PAD_CTRL)
764#define MX35_PAD_LD23__IPU_DISPB_SD_D_IO IOMUX_PAD(0x670, 0x20c, 2, 0x92c, 1, NO_PAD_CTRL)
765#define MX35_PAD_LD23__ESDHC3_DAT3 IOMUX_PAD(0x670, 0x20c, 3, 0x828, 0, NO_PAD_CTRL)
766#define MX35_PAD_LD23__USB_TOP_USBOTG_DATA_7 IOMUX_PAD(0x670, 0x20c, 4, 0x9c0, 0, NO_PAD_CTRL)
767#define MX35_PAD_LD23__GPIO3_29 IOMUX_PAD(0x670, 0x20c, 5, 0x0, 0, NO_PAD_CTRL)
768#define MX35_PAD_LD23__SDMA_DEBUG_MATCHED_DMBUS IOMUX_PAD(0x670, 0x20c, 6, 0x0, 0, NO_PAD_CTRL)
769#define MX35_PAD_LD23__ARM11P_TOP_TRCLK IOMUX_PAD(0x670, 0x20c, 7, 0x0, 0, NO_PAD_CTRL)
770
771#define MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC IOMUX_PAD(0x674, 0x210, 0, 0x0, 0, NO_PAD_CTRL)
772#define MX35_PAD_D3_HSYNC__IPU_DISPB_SD_D_IO IOMUX_PAD(0x674, 0x210, 2, 0x92c, 2, NO_PAD_CTRL)
773#define MX35_PAD_D3_HSYNC__GPIO3_30 IOMUX_PAD(0x674, 0x210, 5, 0x0, 0, NO_PAD_CTRL)
774#define MX35_PAD_D3_HSYNC__SDMA_DEBUG_RTBUFFER_WRITE IOMUX_PAD(0x674, 0x210, 6, 0x0, 0, NO_PAD_CTRL)
775#define MX35_PAD_D3_HSYNC__ARM11P_TOP_TRACE_15 IOMUX_PAD(0x674, 0x210, 7, 0x0, 0, NO_PAD_CTRL)
776
777#define MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK IOMUX_PAD(0x678, 0x214, 0, 0x0, 0, NO_PAD_CTRL)
778#define MX35_PAD_D3_FPSHIFT__IPU_DISPB_SD_CLK IOMUX_PAD(0x678, 0x214, 2, 0x0, 0, NO_PAD_CTRL)
779#define MX35_PAD_D3_FPSHIFT__GPIO3_31 IOMUX_PAD(0x678, 0x214, 5, 0x0, 0, NO_PAD_CTRL)
780#define MX35_PAD_D3_FPSHIFT__SDMA_SDMA_DEBUG_CORE_STATUS_0 IOMUX_PAD(0x678, 0x214, 6, 0x0, 0, NO_PAD_CTRL)
781#define MX35_PAD_D3_FPSHIFT__ARM11P_TOP_TRACE_16 IOMUX_PAD(0x678, 0x214, 7, 0x0, 0, NO_PAD_CTRL)
782
783#define MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY IOMUX_PAD(0x67c, 0x218, 0, 0x0, 0, NO_PAD_CTRL)
784#define MX35_PAD_D3_DRDY__IPU_DISPB_SD_D_O IOMUX_PAD(0x67c, 0x218, 2, 0x0, 0, NO_PAD_CTRL)
785#define MX35_PAD_D3_DRDY__GPIO1_0 IOMUX_PAD(0x67c, 0x218, 5, 0x82c, 2, NO_PAD_CTRL)
786#define MX35_PAD_D3_DRDY__SDMA_SDMA_DEBUG_CORE_STATUS_1 IOMUX_PAD(0x67c, 0x218, 6, 0x0, 0, NO_PAD_CTRL)
787#define MX35_PAD_D3_DRDY__ARM11P_TOP_TRACE_17 IOMUX_PAD(0x67c, 0x218, 7, 0x0, 0, NO_PAD_CTRL)
788
789#define MX35_PAD_CONTRAST__IPU_DISPB_CONTR IOMUX_PAD(0x680, 0x21c, 0, 0x0, 0, NO_PAD_CTRL)
790#define MX35_PAD_CONTRAST__GPIO1_1 IOMUX_PAD(0x680, 0x21c, 5, 0x838, 2, NO_PAD_CTRL)
791#define MX35_PAD_CONTRAST__SDMA_SDMA_DEBUG_CORE_STATUS_2 IOMUX_PAD(0x680, 0x21c, 6, 0x0, 0, NO_PAD_CTRL)
792#define MX35_PAD_CONTRAST__ARM11P_TOP_TRACE_18 IOMUX_PAD(0x680, 0x21c, 7, 0x0, 0, NO_PAD_CTRL)
793
794#define MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC IOMUX_PAD(0x684, 0x220, 0, 0x0, 0, NO_PAD_CTRL)
795#define MX35_PAD_D3_VSYNC__IPU_DISPB_CS1 IOMUX_PAD(0x684, 0x220, 2, 0x0, 0, NO_PAD_CTRL)
796#define MX35_PAD_D3_VSYNC__GPIO1_2 IOMUX_PAD(0x684, 0x220, 5, 0x848, 1, NO_PAD_CTRL)
797#define MX35_PAD_D3_VSYNC__SDMA_DEBUG_YIELD IOMUX_PAD(0x684, 0x220, 6, 0x0, 0, NO_PAD_CTRL)
798#define MX35_PAD_D3_VSYNC__ARM11P_TOP_TRACE_19 IOMUX_PAD(0x684, 0x220, 7, 0x0, 0, NO_PAD_CTRL)
799
800#define MX35_PAD_D3_REV__IPU_DISPB_D3_REV IOMUX_PAD(0x688, 0x224, 0, 0x0, 0, NO_PAD_CTRL)
801#define MX35_PAD_D3_REV__IPU_DISPB_SER_RS IOMUX_PAD(0x688, 0x224, 2, 0x0, 0, NO_PAD_CTRL)
802#define MX35_PAD_D3_REV__GPIO1_3 IOMUX_PAD(0x688, 0x224, 5, 0x84c, 1, NO_PAD_CTRL)
803#define MX35_PAD_D3_REV__SDMA_DEBUG_BUS_RWB IOMUX_PAD(0x688, 0x224, 6, 0x0, 0, NO_PAD_CTRL)
804#define MX35_PAD_D3_REV__ARM11P_TOP_TRACE_20 IOMUX_PAD(0x688, 0x224, 7, 0x0, 0, NO_PAD_CTRL)
805
806#define MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS IOMUX_PAD(0x68c, 0x228, 0, 0x0, 0, NO_PAD_CTRL)
807#define MX35_PAD_D3_CLS__IPU_DISPB_CS2 IOMUX_PAD(0x68c, 0x228, 2, 0x0, 0, NO_PAD_CTRL)
808#define MX35_PAD_D3_CLS__GPIO1_4 IOMUX_PAD(0x68c, 0x228, 5, 0x850, 2, NO_PAD_CTRL)
809#define MX35_PAD_D3_CLS__SDMA_DEBUG_BUS_DEVICE_0 IOMUX_PAD(0x68c, 0x228, 6, 0x0, 0, NO_PAD_CTRL)
810#define MX35_PAD_D3_CLS__ARM11P_TOP_TRACE_21 IOMUX_PAD(0x68c, 0x228, 7, 0x0, 0, NO_PAD_CTRL)
811
812#define MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL IOMUX_PAD(0x690, 0x22c, 0, 0x0, 0, NO_PAD_CTRL)
813#define MX35_PAD_D3_SPL__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x690, 0x22c, 2, 0x928, 2, NO_PAD_CTRL)
814#define MX35_PAD_D3_SPL__GPIO1_5 IOMUX_PAD(0x690, 0x22c, 5, 0x854, 2, NO_PAD_CTRL)
815#define MX35_PAD_D3_SPL__SDMA_DEBUG_BUS_DEVICE_1 IOMUX_PAD(0x690, 0x22c, 6, 0x0, 0, NO_PAD_CTRL)
816#define MX35_PAD_D3_SPL__ARM11P_TOP_TRACE_22 IOMUX_PAD(0x690, 0x22c, 7, 0x0, 0, NO_PAD_CTRL)
817
818#define MX35_PAD_SD1_CMD__ESDHC1_CMD IOMUX_PAD(0x694, 0x230, 0, 0x0, 0, NO_PAD_CTRL)
819#define MX35_PAD_SD1_CMD__MSHC_SCLK IOMUX_PAD(0x694, 0x230, 1, 0x0, 0, NO_PAD_CTRL)
820#define MX35_PAD_SD1_CMD__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x694, 0x230, 3, 0x924, 2, NO_PAD_CTRL)
821#define MX35_PAD_SD1_CMD__USB_TOP_USBOTG_DATA_4 IOMUX_PAD(0x694, 0x230, 4, 0x9b4, 0, NO_PAD_CTRL)
822#define MX35_PAD_SD1_CMD__GPIO1_6 IOMUX_PAD(0x694, 0x230, 5, 0x858, 2, NO_PAD_CTRL)
823#define MX35_PAD_SD1_CMD__ARM11P_TOP_TRCTL IOMUX_PAD(0x694, 0x230, 7, 0x0, 0, NO_PAD_CTRL)
824
825#define MX35_PAD_SD1_CLK__ESDHC1_CLK IOMUX_PAD(0x698, 0x234, 0, 0x0, 0, NO_PAD_CTRL)
826#define MX35_PAD_SD1_CLK__MSHC_BS IOMUX_PAD(0x698, 0x234, 1, 0x0, 0, NO_PAD_CTRL)
827#define MX35_PAD_SD1_CLK__IPU_DISPB_BCLK IOMUX_PAD(0x698, 0x234, 3, 0x0, 0, NO_PAD_CTRL)
828#define MX35_PAD_SD1_CLK__USB_TOP_USBOTG_DATA_5 IOMUX_PAD(0x698, 0x234, 4, 0x9b8, 0, NO_PAD_CTRL)
829#define MX35_PAD_SD1_CLK__GPIO1_7 IOMUX_PAD(0x698, 0x234, 5, 0x85c, 2, NO_PAD_CTRL)
830#define MX35_PAD_SD1_CLK__ARM11P_TOP_TRCLK IOMUX_PAD(0x698, 0x234, 7, 0x0, 0, NO_PAD_CTRL)
831
832#define MX35_PAD_SD1_DATA0__ESDHC1_DAT0 IOMUX_PAD(0x69c, 0x238, 0, 0x0, 0, NO_PAD_CTRL)
833#define MX35_PAD_SD1_DATA0__MSHC_DATA_0 IOMUX_PAD(0x69c, 0x238, 1, 0x0, 0, NO_PAD_CTRL)
834#define MX35_PAD_SD1_DATA0__IPU_DISPB_CS0 IOMUX_PAD(0x69c, 0x238, 3, 0x0, 0, NO_PAD_CTRL)
835#define MX35_PAD_SD1_DATA0__USB_TOP_USBOTG_DATA_6 IOMUX_PAD(0x69c, 0x238, 4, 0x9bc, 0, NO_PAD_CTRL)
836#define MX35_PAD_SD1_DATA0__GPIO1_8 IOMUX_PAD(0x69c, 0x238, 5, 0x860, 2, NO_PAD_CTRL)
837#define MX35_PAD_SD1_DATA0__ARM11P_TOP_TRACE_23 IOMUX_PAD(0x69c, 0x238, 7, 0x0, 0, NO_PAD_CTRL)
838
839#define MX35_PAD_SD1_DATA1__ESDHC1_DAT1 IOMUX_PAD(0x6a0, 0x23c, 0, 0x0, 0, NO_PAD_CTRL)
840#define MX35_PAD_SD1_DATA1__MSHC_DATA_1 IOMUX_PAD(0x6a0, 0x23c, 1, 0x0, 0, NO_PAD_CTRL)
841#define MX35_PAD_SD1_DATA1__IPU_DISPB_PAR_RS IOMUX_PAD(0x6a0, 0x23c, 3, 0x0, 0, NO_PAD_CTRL)
842#define MX35_PAD_SD1_DATA1__USB_TOP_USBOTG_DATA_0 IOMUX_PAD(0x6a0, 0x23c, 4, 0x9a4, 0, NO_PAD_CTRL)
843#define MX35_PAD_SD1_DATA1__GPIO1_9 IOMUX_PAD(0x6a0, 0x23c, 5, 0x864, 1, NO_PAD_CTRL)
844#define MX35_PAD_SD1_DATA1__ARM11P_TOP_TRACE_24 IOMUX_PAD(0x6a0, 0x23c, 7, 0x0, 0, NO_PAD_CTRL)
845
846#define MX35_PAD_SD1_DATA2__ESDHC1_DAT2 IOMUX_PAD(0x6a4, 0x240, 0, 0x0, 0, NO_PAD_CTRL)
847#define MX35_PAD_SD1_DATA2__MSHC_DATA_2 IOMUX_PAD(0x6a4, 0x240, 1, 0x0, 0, NO_PAD_CTRL)
848#define MX35_PAD_SD1_DATA2__IPU_DISPB_WR IOMUX_PAD(0x6a4, 0x240, 3, 0x0, 0, NO_PAD_CTRL)
849#define MX35_PAD_SD1_DATA2__USB_TOP_USBOTG_DATA_1 IOMUX_PAD(0x6a4, 0x240, 4, 0x9a8, 0, NO_PAD_CTRL)
850#define MX35_PAD_SD1_DATA2__GPIO1_10 IOMUX_PAD(0x6a4, 0x240, 5, 0x830, 1, NO_PAD_CTRL)
851#define MX35_PAD_SD1_DATA2__ARM11P_TOP_TRACE_25 IOMUX_PAD(0x6a4, 0x240, 7, 0x0, 0, NO_PAD_CTRL)
852
853#define MX35_PAD_SD1_DATA3__ESDHC1_DAT3 IOMUX_PAD(0x6a8, 0x244, 0, 0x0, 0, NO_PAD_CTRL)
854#define MX35_PAD_SD1_DATA3__MSHC_DATA_3 IOMUX_PAD(0x6a8, 0x244, 1, 0x0, 0, NO_PAD_CTRL)
855#define MX35_PAD_SD1_DATA3__IPU_DISPB_RD IOMUX_PAD(0x6a8, 0x244, 3, 0x0, 0, NO_PAD_CTRL)
856#define MX35_PAD_SD1_DATA3__USB_TOP_USBOTG_DATA_2 IOMUX_PAD(0x6a8, 0x244, 4, 0x9ac, 0, NO_PAD_CTRL)
857#define MX35_PAD_SD1_DATA3__GPIO1_11 IOMUX_PAD(0x6a8, 0x244, 5, 0x834, 1, NO_PAD_CTRL)
858#define MX35_PAD_SD1_DATA3__ARM11P_TOP_TRACE_26 IOMUX_PAD(0x6a8, 0x244, 7, 0x0, 0, NO_PAD_CTRL)
859
860#define MX35_PAD_SD2_CMD__ESDHC2_CMD IOMUX_PAD(0x6ac, 0x248, 0, 0x0, 0, NO_PAD_CTRL)
861#define MX35_PAD_SD2_CMD__I2C3_SCL IOMUX_PAD(0x6ac, 0x248, 1, 0x91c, 2, NO_PAD_CTRL)
862#define MX35_PAD_SD2_CMD__ESDHC1_DAT4 IOMUX_PAD(0x6ac, 0x248, 2, 0x804, 0, NO_PAD_CTRL)
863#define MX35_PAD_SD2_CMD__IPU_CSI_D_2 IOMUX_PAD(0x6ac, 0x248, 3, 0x938, 2, NO_PAD_CTRL)
864#define MX35_PAD_SD2_CMD__USB_TOP_USBH2_DATA_4 IOMUX_PAD(0x6ac, 0x248, 4, 0x9dc, 0, NO_PAD_CTRL)
865#define MX35_PAD_SD2_CMD__GPIO2_0 IOMUX_PAD(0x6ac, 0x248, 5, 0x868, 2, NO_PAD_CTRL)
866#define MX35_PAD_SD2_CMD__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x6ac, 0x248, 6, 0x0, 0, NO_PAD_CTRL)
867#define MX35_PAD_SD2_CMD__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x6ac, 0x248, 7, 0x928, 3, NO_PAD_CTRL)
868
869#define MX35_PAD_SD2_CLK__ESDHC2_CLK IOMUX_PAD(0x6b0, 0x24c, 0, 0x0, 0, NO_PAD_CTRL)
870#define MX35_PAD_SD2_CLK__I2C3_SDA IOMUX_PAD(0x6b0, 0x24c, 1, 0x920, 2, NO_PAD_CTRL)
871#define MX35_PAD_SD2_CLK__ESDHC1_DAT5 IOMUX_PAD(0x6b0, 0x24c, 2, 0x808, 0, NO_PAD_CTRL)
872#define MX35_PAD_SD2_CLK__IPU_CSI_D_3 IOMUX_PAD(0x6b0, 0x24c, 3, 0x93c, 2, NO_PAD_CTRL)
873#define MX35_PAD_SD2_CLK__USB_TOP_USBH2_DATA_5 IOMUX_PAD(0x6b0, 0x24c, 4, 0x9e0, 0, NO_PAD_CTRL)
874#define MX35_PAD_SD2_CLK__GPIO2_1 IOMUX_PAD(0x6b0, 0x24c, 5, 0x894, 1, NO_PAD_CTRL)
875#define MX35_PAD_SD2_CLK__SPDIF_SPDIF_IN1 IOMUX_PAD(0x6b0, 0x24c, 6, 0x998, 2, NO_PAD_CTRL)
876#define MX35_PAD_SD2_CLK__IPU_DISPB_CS2 IOMUX_PAD(0x6b0, 0x24c, 7, 0x0, 0, NO_PAD_CTRL)
877
878#define MX35_PAD_SD2_DATA0__ESDHC2_DAT0 IOMUX_PAD(0x6b4, 0x250, 0, 0x0, 0, NO_PAD_CTRL)
879#define MX35_PAD_SD2_DATA0__UART3_RXD_MUX IOMUX_PAD(0x6b4, 0x250, 1, 0x9a0, 1, NO_PAD_CTRL)
880#define MX35_PAD_SD2_DATA0__ESDHC1_DAT6 IOMUX_PAD(0x6b4, 0x250, 2, 0x80c, 0, NO_PAD_CTRL)
881#define MX35_PAD_SD2_DATA0__IPU_CSI_D_4 IOMUX_PAD(0x6b4, 0x250, 3, 0x940, 1, NO_PAD_CTRL)
882#define MX35_PAD_SD2_DATA0__USB_TOP_USBH2_DATA_6 IOMUX_PAD(0x6b4, 0x250, 4, 0x9e4, 0, NO_PAD_CTRL)
883#define MX35_PAD_SD2_DATA0__GPIO2_2 IOMUX_PAD(0x6b4, 0x250, 5, 0x8c0, 1, NO_PAD_CTRL)
884#define MX35_PAD_SD2_DATA0__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x6b4, 0x250, 6, 0x994, 3, NO_PAD_CTRL)
885
886#define MX35_PAD_SD2_DATA1__ESDHC2_DAT1 IOMUX_PAD(0x6b8, 0x254, 0, 0x0, 0, NO_PAD_CTRL)
887#define MX35_PAD_SD2_DATA1__UART3_TXD_MUX IOMUX_PAD(0x6b8, 0x254, 1, 0x0, 0, NO_PAD_CTRL)
888#define MX35_PAD_SD2_DATA1__ESDHC1_DAT7 IOMUX_PAD(0x6b8, 0x254, 2, 0x810, 0, NO_PAD_CTRL)
889#define MX35_PAD_SD2_DATA1__IPU_CSI_D_5 IOMUX_PAD(0x6b8, 0x254, 3, 0x944, 1, NO_PAD_CTRL)
890#define MX35_PAD_SD2_DATA1__USB_TOP_USBH2_DATA_0 IOMUX_PAD(0x6b8, 0x254, 4, 0x9cc, 0, NO_PAD_CTRL)
891#define MX35_PAD_SD2_DATA1__GPIO2_3 IOMUX_PAD(0x6b8, 0x254, 5, 0x8cc, 1, NO_PAD_CTRL)
892
893#define MX35_PAD_SD2_DATA2__ESDHC2_DAT2 IOMUX_PAD(0x6bc, 0x258, 0, 0x0, 0, NO_PAD_CTRL)
894#define MX35_PAD_SD2_DATA2__UART3_RTS IOMUX_PAD(0x6bc, 0x258, 1, 0x99c, 0, NO_PAD_CTRL)
895#define MX35_PAD_SD2_DATA2__CAN1_RXCAN IOMUX_PAD(0x6bc, 0x258, 2, 0x7c8, 1, NO_PAD_CTRL)
896#define MX35_PAD_SD2_DATA2__IPU_CSI_D_6 IOMUX_PAD(0x6bc, 0x258, 3, 0x948, 1, NO_PAD_CTRL)
897#define MX35_PAD_SD2_DATA2__USB_TOP_USBH2_DATA_1 IOMUX_PAD(0x6bc, 0x258, 4, 0x9d0, 0, NO_PAD_CTRL)
898#define MX35_PAD_SD2_DATA2__GPIO2_4 IOMUX_PAD(0x6bc, 0x258, 5, 0x8d0, 1, NO_PAD_CTRL)
899
900#define MX35_PAD_SD2_DATA3__ESDHC2_DAT3 IOMUX_PAD(0x6c0, 0x25c, 0, 0x0, 0, NO_PAD_CTRL)
901#define MX35_PAD_SD2_DATA3__UART3_CTS IOMUX_PAD(0x6c0, 0x25c, 1, 0x0, 0, NO_PAD_CTRL)
902#define MX35_PAD_SD2_DATA3__CAN1_TXCAN IOMUX_PAD(0x6c0, 0x25c, 2, 0x0, 0, NO_PAD_CTRL)
903#define MX35_PAD_SD2_DATA3__IPU_CSI_D_7 IOMUX_PAD(0x6c0, 0x25c, 3, 0x94c, 1, NO_PAD_CTRL)
904#define MX35_PAD_SD2_DATA3__USB_TOP_USBH2_DATA_2 IOMUX_PAD(0x6c0, 0x25c, 4, 0x9d4, 0, NO_PAD_CTRL)
905#define MX35_PAD_SD2_DATA3__GPIO2_5 IOMUX_PAD(0x6c0, 0x25c, 5, 0x8d4, 1, NO_PAD_CTRL)
906
907#define MX35_PAD_ATA_CS0__ATA_CS0 IOMUX_PAD(0x6c4, 0x260, 0, 0x0, 0, NO_PAD_CTRL)
908#define MX35_PAD_ATA_CS0__CSPI1_SS3 IOMUX_PAD(0x6c4, 0x260, 1, 0x7dc, 1, NO_PAD_CTRL)
909#define MX35_PAD_ATA_CS0__IPU_DISPB_CS1 IOMUX_PAD(0x6c4, 0x260, 3, 0x0, 0, NO_PAD_CTRL)
910#define MX35_PAD_ATA_CS0__GPIO2_6 IOMUX_PAD(0x6c4, 0x260, 5, 0x8d8, 1, NO_PAD_CTRL)
911#define MX35_PAD_ATA_CS0__IPU_DIAGB_0 IOMUX_PAD(0x6c4, 0x260, 6, 0x0, 0, NO_PAD_CTRL)
912#define MX35_PAD_ATA_CS0__ARM11P_TOP_MAX1_HMASTER_0 IOMUX_PAD(0x6c4, 0x260, 7, 0x0, 0, NO_PAD_CTRL)
913
914#define MX35_PAD_ATA_CS1__ATA_CS1 IOMUX_PAD(0x6c8, 0x264, 0, 0x0, 0, NO_PAD_CTRL)
915#define MX35_PAD_ATA_CS1__IPU_DISPB_CS2 IOMUX_PAD(0x6c8, 0x264, 3, 0x0, 0, NO_PAD_CTRL)
916#define MX35_PAD_ATA_CS1__CSPI2_SS0 IOMUX_PAD(0x6c8, 0x264, 4, 0x7f0, 1, NO_PAD_CTRL)
917#define MX35_PAD_ATA_CS1__GPIO2_7 IOMUX_PAD(0x6c8, 0x264, 5, 0x8dc, 1, NO_PAD_CTRL)
918#define MX35_PAD_ATA_CS1__IPU_DIAGB_1 IOMUX_PAD(0x6c8, 0x264, 6, 0x0, 0, NO_PAD_CTRL)
919#define MX35_PAD_ATA_CS1__ARM11P_TOP_MAX1_HMASTER_1 IOMUX_PAD(0x6c8, 0x264, 7, 0x0, 0, NO_PAD_CTRL)
920
921#define MX35_PAD_ATA_DIOR__ATA_DIOR IOMUX_PAD(0x6cc, 0x268, 0, 0x0, 0, NO_PAD_CTRL)
922#define MX35_PAD_ATA_DIOR__ESDHC3_DAT0 IOMUX_PAD(0x6cc, 0x268, 1, 0x81c, 1, NO_PAD_CTRL)
923#define MX35_PAD_ATA_DIOR__USB_TOP_USBOTG_DIR IOMUX_PAD(0x6cc, 0x268, 2, 0x9c4, 1, NO_PAD_CTRL)
924#define MX35_PAD_ATA_DIOR__IPU_DISPB_BE0 IOMUX_PAD(0x6cc, 0x268, 3, 0x0, 0, NO_PAD_CTRL)
925#define MX35_PAD_ATA_DIOR__CSPI2_SS1 IOMUX_PAD(0x6cc, 0x268, 4, 0x7f4, 1, NO_PAD_CTRL)
926#define MX35_PAD_ATA_DIOR__GPIO2_8 IOMUX_PAD(0x6cc, 0x268, 5, 0x8e0, 1, NO_PAD_CTRL)
927#define MX35_PAD_ATA_DIOR__IPU_DIAGB_2 IOMUX_PAD(0x6cc, 0x268, 6, 0x0, 0, NO_PAD_CTRL)
928#define MX35_PAD_ATA_DIOR__ARM11P_TOP_MAX1_HMASTER_2 IOMUX_PAD(0x6cc, 0x268, 7, 0x0, 0, NO_PAD_CTRL)
929
930#define MX35_PAD_ATA_DIOW__ATA_DIOW IOMUX_PAD(0x6d0, 0x26c, 0, 0x0, 0, NO_PAD_CTRL)
931#define MX35_PAD_ATA_DIOW__ESDHC3_DAT1 IOMUX_PAD(0x6d0, 0x26c, 1, 0x820, 1, NO_PAD_CTRL)
932#define MX35_PAD_ATA_DIOW__USB_TOP_USBOTG_STP IOMUX_PAD(0x6d0, 0x26c, 2, 0x0, 0, NO_PAD_CTRL)
933#define MX35_PAD_ATA_DIOW__IPU_DISPB_BE1 IOMUX_PAD(0x6d0, 0x26c, 3, 0x0, 0, NO_PAD_CTRL)
934#define MX35_PAD_ATA_DIOW__CSPI2_MOSI IOMUX_PAD(0x6d0, 0x26c, 4, 0x7ec, 2, NO_PAD_CTRL)
935#define MX35_PAD_ATA_DIOW__GPIO2_9 IOMUX_PAD(0x6d0, 0x26c, 5, 0x8e4, 1, NO_PAD_CTRL)
936#define MX35_PAD_ATA_DIOW__IPU_DIAGB_3 IOMUX_PAD(0x6d0, 0x26c, 6, 0x0, 0, NO_PAD_CTRL)
937#define MX35_PAD_ATA_DIOW__ARM11P_TOP_MAX1_HMASTER_3 IOMUX_PAD(0x6d0, 0x26c, 7, 0x0, 0, NO_PAD_CTRL)
938
939#define MX35_PAD_ATA_DMACK__ATA_DMACK IOMUX_PAD(0x6d4, 0x270, 0, 0x0, 0, NO_PAD_CTRL)
940#define MX35_PAD_ATA_DMACK__ESDHC3_DAT2 IOMUX_PAD(0x6d4, 0x270, 1, 0x824, 1, NO_PAD_CTRL)
941#define MX35_PAD_ATA_DMACK__USB_TOP_USBOTG_NXT IOMUX_PAD(0x6d4, 0x270, 2, 0x9c8, 1, NO_PAD_CTRL)
942#define MX35_PAD_ATA_DMACK__CSPI2_MISO IOMUX_PAD(0x6d4, 0x270, 4, 0x7e8, 2, NO_PAD_CTRL)
943#define MX35_PAD_ATA_DMACK__GPIO2_10 IOMUX_PAD(0x6d4, 0x270, 5, 0x86c, 1, NO_PAD_CTRL)
944#define MX35_PAD_ATA_DMACK__IPU_DIAGB_4 IOMUX_PAD(0x6d4, 0x270, 6, 0x0, 0, NO_PAD_CTRL)
945#define MX35_PAD_ATA_DMACK__ARM11P_TOP_MAX0_HMASTER_0 IOMUX_PAD(0x6d4, 0x270, 7, 0x0, 0, NO_PAD_CTRL)
946
947#define MX35_PAD_ATA_RESET_B__ATA_RESET_B IOMUX_PAD(0x6d8, 0x274, 0, 0x0, 0, NO_PAD_CTRL)
948#define MX35_PAD_ATA_RESET_B__ESDHC3_DAT3 IOMUX_PAD(0x6d8, 0x274, 1, 0x828, 1, NO_PAD_CTRL)
949#define MX35_PAD_ATA_RESET_B__USB_TOP_USBOTG_DATA_0 IOMUX_PAD(0x6d8, 0x274, 2, 0x9a4, 1, NO_PAD_CTRL)
950#define MX35_PAD_ATA_RESET_B__IPU_DISPB_SD_D_O IOMUX_PAD(0x6d8, 0x274, 3, 0x0, 0, NO_PAD_CTRL)
951#define MX35_PAD_ATA_RESET_B__CSPI2_RDY IOMUX_PAD(0x6d8, 0x274, 4, 0x7e4, 2, NO_PAD_CTRL)
952#define MX35_PAD_ATA_RESET_B__GPIO2_11 IOMUX_PAD(0x6d8, 0x274, 5, 0x870, 1, NO_PAD_CTRL)
953#define MX35_PAD_ATA_RESET_B__IPU_DIAGB_5 IOMUX_PAD(0x6d8, 0x274, 6, 0x0, 0, NO_PAD_CTRL)
954#define MX35_PAD_ATA_RESET_B__ARM11P_TOP_MAX0_HMASTER_1 IOMUX_PAD(0x6d8, 0x274, 7, 0x0, 0, NO_PAD_CTRL)
955
956#define MX35_PAD_ATA_IORDY__ATA_IORDY IOMUX_PAD(0x6dc, 0x278, 0, 0x0, 0, NO_PAD_CTRL)
957#define MX35_PAD_ATA_IORDY__ESDHC3_DAT4 IOMUX_PAD(0x6dc, 0x278, 1, 0x0, 0, NO_PAD_CTRL)
958#define MX35_PAD_ATA_IORDY__USB_TOP_USBOTG_DATA_1 IOMUX_PAD(0x6dc, 0x278, 2, 0x9a8, 1, NO_PAD_CTRL)
959#define MX35_PAD_ATA_IORDY__IPU_DISPB_SD_D_IO IOMUX_PAD(0x6dc, 0x278, 3, 0x92c, 3, NO_PAD_CTRL)
960#define MX35_PAD_ATA_IORDY__ESDHC2_DAT4 IOMUX_PAD(0x6dc, 0x278, 4, 0x0, 0, NO_PAD_CTRL)
961#define MX35_PAD_ATA_IORDY__GPIO2_12 IOMUX_PAD(0x6dc, 0x278, 5, 0x874, 1, NO_PAD_CTRL)
962#define MX35_PAD_ATA_IORDY__IPU_DIAGB_6 IOMUX_PAD(0x6dc, 0x278, 6, 0x0, 0, NO_PAD_CTRL)
963#define MX35_PAD_ATA_IORDY__ARM11P_TOP_MAX0_HMASTER_2 IOMUX_PAD(0x6dc, 0x278, 7, 0x0, 0, NO_PAD_CTRL)
964
965#define MX35_PAD_ATA_DATA0__ATA_DATA_0 IOMUX_PAD(0x6e0, 0x27c, 0, 0x0, 0, NO_PAD_CTRL)
966#define MX35_PAD_ATA_DATA0__ESDHC3_DAT5 IOMUX_PAD(0x6e0, 0x27c, 1, 0x0, 0, NO_PAD_CTRL)
967#define MX35_PAD_ATA_DATA0__USB_TOP_USBOTG_DATA_2 IOMUX_PAD(0x6e0, 0x27c, 2, 0x9ac, 1, NO_PAD_CTRL)
968#define MX35_PAD_ATA_DATA0__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x6e0, 0x27c, 3, 0x928, 4, NO_PAD_CTRL)
969#define MX35_PAD_ATA_DATA0__ESDHC2_DAT5 IOMUX_PAD(0x6e0, 0x27c, 4, 0x0, 0, NO_PAD_CTRL)
970#define MX35_PAD_ATA_DATA0__GPIO2_13 IOMUX_PAD(0x6e0, 0x27c, 5, 0x878, 1, NO_PAD_CTRL)
971#define MX35_PAD_ATA_DATA0__IPU_DIAGB_7 IOMUX_PAD(0x6e0, 0x27c, 6, 0x0, 0, NO_PAD_CTRL)
972#define MX35_PAD_ATA_DATA0__ARM11P_TOP_MAX0_HMASTER_3 IOMUX_PAD(0x6e0, 0x27c, 7, 0x0, 0, NO_PAD_CTRL)
973
974#define MX35_PAD_ATA_DATA1__ATA_DATA_1 IOMUX_PAD(0x6e4, 0x280, 0, 0x0, 0, NO_PAD_CTRL)
975#define MX35_PAD_ATA_DATA1__ESDHC3_DAT6 IOMUX_PAD(0x6e4, 0x280, 1, 0x0, 0, NO_PAD_CTRL)
976#define MX35_PAD_ATA_DATA1__USB_TOP_USBOTG_DATA_3 IOMUX_PAD(0x6e4, 0x280, 2, 0x9b0, 1, NO_PAD_CTRL)
977#define MX35_PAD_ATA_DATA1__IPU_DISPB_SD_CLK IOMUX_PAD(0x6e4, 0x280, 3, 0x0, 0, NO_PAD_CTRL)
978#define MX35_PAD_ATA_DATA1__ESDHC2_DAT6 IOMUX_PAD(0x6e4, 0x280, 4, 0x0, 0, NO_PAD_CTRL)
979#define MX35_PAD_ATA_DATA1__GPIO2_14 IOMUX_PAD(0x6e4, 0x280, 5, 0x87c, 1, NO_PAD_CTRL)
980#define MX35_PAD_ATA_DATA1__IPU_DIAGB_8 IOMUX_PAD(0x6e4, 0x280, 6, 0x0, 0, NO_PAD_CTRL)
981#define MX35_PAD_ATA_DATA1__ARM11P_TOP_TRACE_27 IOMUX_PAD(0x6e4, 0x280, 7, 0x0, 0, NO_PAD_CTRL)
982
983#define MX35_PAD_ATA_DATA2__ATA_DATA_2 IOMUX_PAD(0x6e8, 0x284, 0, 0x0, 0, NO_PAD_CTRL)
984#define MX35_PAD_ATA_DATA2__ESDHC3_DAT7 IOMUX_PAD(0x6e8, 0x284, 1, 0x0, 0, NO_PAD_CTRL)
985#define MX35_PAD_ATA_DATA2__USB_TOP_USBOTG_DATA_4 IOMUX_PAD(0x6e8, 0x284, 2, 0x9b4, 1, NO_PAD_CTRL)
986#define MX35_PAD_ATA_DATA2__IPU_DISPB_SER_RS IOMUX_PAD(0x6e8, 0x284, 3, 0x0, 0, NO_PAD_CTRL)
987#define MX35_PAD_ATA_DATA2__ESDHC2_DAT7 IOMUX_PAD(0x6e8, 0x284, 4, 0x0, 0, NO_PAD_CTRL)
988#define MX35_PAD_ATA_DATA2__GPIO2_15 IOMUX_PAD(0x6e8, 0x284, 5, 0x880, 1, NO_PAD_CTRL)
989#define MX35_PAD_ATA_DATA2__IPU_DIAGB_9 IOMUX_PAD(0x6e8, 0x284, 6, 0x0, 0, NO_PAD_CTRL)
990#define MX35_PAD_ATA_DATA2__ARM11P_TOP_TRACE_28 IOMUX_PAD(0x6e8, 0x284, 7, 0x0, 0, NO_PAD_CTRL)
991
992#define MX35_PAD_ATA_DATA3__ATA_DATA_3 IOMUX_PAD(0x6e8, 0x288, 0, 0x0, 0, NO_PAD_CTRL)
993#define MX35_PAD_ATA_DATA3__ESDHC3_CLK IOMUX_PAD(0x6e8, 0x288, 1, 0x814, 1, NO_PAD_CTRL)
994#define MX35_PAD_ATA_DATA3__USB_TOP_USBOTG_DATA_5 IOMUX_PAD(0x6e8, 0x288, 2, 0x9b8, 1, NO_PAD_CTRL)
995#define MX35_PAD_ATA_DATA3__CSPI2_SCLK IOMUX_PAD(0x6e8, 0x288, 4, 0x7e0, 2, NO_PAD_CTRL)
996#define MX35_PAD_ATA_DATA3__GPIO2_16 IOMUX_PAD(0x6e8, 0x288, 5, 0x884, 1, NO_PAD_CTRL)
997#define MX35_PAD_ATA_DATA3__IPU_DIAGB_10 IOMUX_PAD(0x6e8, 0x288, 6, 0x0, 0, NO_PAD_CTRL)
998#define MX35_PAD_ATA_DATA3__ARM11P_TOP_TRACE_29 IOMUX_PAD(0x6e8, 0x288, 7, 0x0, 0, NO_PAD_CTRL)
999
1000#define MX35_PAD_ATA_DATA4__ATA_DATA_4 IOMUX_PAD(0x6f0, 0x28c, 0, 0x0, 0, NO_PAD_CTRL)
1001#define MX35_PAD_ATA_DATA4__ESDHC3_CMD IOMUX_PAD(0x6f0, 0x28c, 1, 0x818, 1, NO_PAD_CTRL)
1002#define MX35_PAD_ATA_DATA4__USB_TOP_USBOTG_DATA_6 IOMUX_PAD(0x6f0, 0x28c, 2, 0x9bc, 1, NO_PAD_CTRL)
1003#define MX35_PAD_ATA_DATA4__GPIO2_17 IOMUX_PAD(0x6f0, 0x28c, 5, 0x888, 1, NO_PAD_CTRL)
1004#define MX35_PAD_ATA_DATA4__IPU_DIAGB_11 IOMUX_PAD(0x6f0, 0x28c, 6, 0x0, 0, NO_PAD_CTRL)
1005#define MX35_PAD_ATA_DATA4__ARM11P_TOP_TRACE_30 IOMUX_PAD(0x6f0, 0x28c, 7, 0x0, 0, NO_PAD_CTRL)
1006
1007#define MX35_PAD_ATA_DATA5__ATA_DATA_5 IOMUX_PAD(0x6f4, 0x290, 0, 0x0, 0, NO_PAD_CTRL)
1008#define MX35_PAD_ATA_DATA5__USB_TOP_USBOTG_DATA_7 IOMUX_PAD(0x6f4, 0x290, 2, 0x9c0, 1, NO_PAD_CTRL)
1009#define MX35_PAD_ATA_DATA5__GPIO2_18 IOMUX_PAD(0x6f4, 0x290, 5, 0x88c, 1, NO_PAD_CTRL)
1010#define MX35_PAD_ATA_DATA5__IPU_DIAGB_12 IOMUX_PAD(0x6f4, 0x290, 6, 0x0, 0, NO_PAD_CTRL)
1011#define MX35_PAD_ATA_DATA5__ARM11P_TOP_TRACE_31 IOMUX_PAD(0x6f4, 0x290, 7, 0x0, 0, NO_PAD_CTRL)
1012
1013#define MX35_PAD_ATA_DATA6__ATA_DATA_6 IOMUX_PAD(0x6f8, 0x294, 0, 0x0, 0, NO_PAD_CTRL)
1014#define MX35_PAD_ATA_DATA6__CAN1_TXCAN IOMUX_PAD(0x6f8, 0x294, 1, 0x0, 0, NO_PAD_CTRL)
1015#define MX35_PAD_ATA_DATA6__UART1_DTR IOMUX_PAD(0x6f8, 0x294, 2, 0x0, 0, NO_PAD_CTRL)
1016#define MX35_PAD_ATA_DATA6__AUDMUX_AUD6_TXD IOMUX_PAD(0x6f8, 0x294, 3, 0x7b4, 0, NO_PAD_CTRL)
1017#define MX35_PAD_ATA_DATA6__GPIO2_19 IOMUX_PAD(0x6f8, 0x294, 5, 0x890, 1, NO_PAD_CTRL)
1018#define MX35_PAD_ATA_DATA6__IPU_DIAGB_13 IOMUX_PAD(0x6f8, 0x294, 6, 0x0, 0, NO_PAD_CTRL)
1019
1020#define MX35_PAD_ATA_DATA7__ATA_DATA_7 IOMUX_PAD(0x6fc, 0x298, 0, 0x0, 0, NO_PAD_CTRL)
1021#define MX35_PAD_ATA_DATA7__CAN1_RXCAN IOMUX_PAD(0x6fc, 0x298, 1, 0x7c8, 2, NO_PAD_CTRL)
1022#define MX35_PAD_ATA_DATA7__UART1_DSR IOMUX_PAD(0x6fc, 0x298, 2, 0x0, 0, NO_PAD_CTRL)
1023#define MX35_PAD_ATA_DATA7__AUDMUX_AUD6_RXD IOMUX_PAD(0x6fc, 0x298, 3, 0x7b0, 0, NO_PAD_CTRL)
1024#define MX35_PAD_ATA_DATA7__GPIO2_20 IOMUX_PAD(0x6fc, 0x298, 5, 0x898, 1, NO_PAD_CTRL)
1025#define MX35_PAD_ATA_DATA7__IPU_DIAGB_14 IOMUX_PAD(0x6fc, 0x298, 6, 0x0, 0, NO_PAD_CTRL)
1026
1027#define MX35_PAD_ATA_DATA8__ATA_DATA_8 IOMUX_PAD(0x700, 0x29c, 0, 0x0, 0, NO_PAD_CTRL)
1028#define MX35_PAD_ATA_DATA8__UART3_RTS IOMUX_PAD(0x700, 0x29c, 1, 0x99c, 1, NO_PAD_CTRL)
1029#define MX35_PAD_ATA_DATA8__UART1_RI IOMUX_PAD(0x700, 0x29c, 2, 0x0, 0, NO_PAD_CTRL)
1030#define MX35_PAD_ATA_DATA8__AUDMUX_AUD6_TXC IOMUX_PAD(0x700, 0x29c, 3, 0x7c0, 0, NO_PAD_CTRL)
1031#define MX35_PAD_ATA_DATA8__GPIO2_21 IOMUX_PAD(0x700, 0x29c, 5, 0x89c, 1, NO_PAD_CTRL)
1032#define MX35_PAD_ATA_DATA8__IPU_DIAGB_15 IOMUX_PAD(0x700, 0x29c, 6, 0x0, 0, NO_PAD_CTRL)
1033
1034#define MX35_PAD_ATA_DATA9__ATA_DATA_9 IOMUX_PAD(0x704, 0x2a0, 0, 0x0, 0, NO_PAD_CTRL)
1035#define MX35_PAD_ATA_DATA9__UART3_CTS IOMUX_PAD(0x704, 0x2a0, 1, 0x0, 0, NO_PAD_CTRL)
1036#define MX35_PAD_ATA_DATA9__UART1_DCD IOMUX_PAD(0x704, 0x2a0, 2, 0x0, 0, NO_PAD_CTRL)
1037#define MX35_PAD_ATA_DATA9__AUDMUX_AUD6_TXFS IOMUX_PAD(0x704, 0x2a0, 3, 0x7c4, 0, NO_PAD_CTRL)
1038#define MX35_PAD_ATA_DATA9__GPIO2_22 IOMUX_PAD(0x704, 0x2a0, 5, 0x8a0, 1, NO_PAD_CTRL)
1039#define MX35_PAD_ATA_DATA9__IPU_DIAGB_16 IOMUX_PAD(0x704, 0x2a0, 6, 0x0, 0, NO_PAD_CTRL)
1040
1041#define MX35_PAD_ATA_DATA10__ATA_DATA_10 IOMUX_PAD(0x708, 0x2a4, 0, 0x0, 0, NO_PAD_CTRL)
1042#define MX35_PAD_ATA_DATA10__UART3_RXD_MUX IOMUX_PAD(0x708, 0x2a4, 1, 0x9a0, 2, NO_PAD_CTRL)
1043#define MX35_PAD_ATA_DATA10__AUDMUX_AUD6_RXC IOMUX_PAD(0x708, 0x2a4, 3, 0x7b8, 0, NO_PAD_CTRL)
1044#define MX35_PAD_ATA_DATA10__GPIO2_23 IOMUX_PAD(0x708, 0x2a4, 5, 0x8a4, 1, NO_PAD_CTRL)
1045#define MX35_PAD_ATA_DATA10__IPU_DIAGB_17 IOMUX_PAD(0x708, 0x2a4, 6, 0x0, 0, NO_PAD_CTRL)
1046
1047#define MX35_PAD_ATA_DATA11__ATA_DATA_11 IOMUX_PAD(0x70c, 0x2a8, 0, 0x0, 0, NO_PAD_CTRL)
1048#define MX35_PAD_ATA_DATA11__UART3_TXD_MUX IOMUX_PAD(0x70c, 0x2a8, 1, 0x0, 0, NO_PAD_CTRL)
1049#define MX35_PAD_ATA_DATA11__AUDMUX_AUD6_RXFS IOMUX_PAD(0x70c, 0x2a8, 3, 0x7bc, 0, NO_PAD_CTRL)
1050#define MX35_PAD_ATA_DATA11__GPIO2_24 IOMUX_PAD(0x70c, 0x2a8, 5, 0x8a8, 1, NO_PAD_CTRL)
1051#define MX35_PAD_ATA_DATA11__IPU_DIAGB_18 IOMUX_PAD(0x70c, 0x2a8, 6, 0x0, 0, NO_PAD_CTRL)
1052
1053#define MX35_PAD_ATA_DATA12__ATA_DATA_12 IOMUX_PAD(0x710, 0x2ac, 0, 0x0, 0, NO_PAD_CTRL)
1054#define MX35_PAD_ATA_DATA12__I2C3_SCL IOMUX_PAD(0x710, 0x2ac, 1, 0x91c, 3, NO_PAD_CTRL)
1055#define MX35_PAD_ATA_DATA12__GPIO2_25 IOMUX_PAD(0x710, 0x2ac, 5, 0x8ac, 1, NO_PAD_CTRL)
1056#define MX35_PAD_ATA_DATA12__IPU_DIAGB_19 IOMUX_PAD(0x710, 0x2ac, 6, 0x0, 0, NO_PAD_CTRL)
1057
1058#define MX35_PAD_ATA_DATA13__ATA_DATA_13 IOMUX_PAD(0x714, 0x2b0, 0, 0x0, 0, NO_PAD_CTRL)
1059#define MX35_PAD_ATA_DATA13__I2C3_SDA IOMUX_PAD(0x714, 0x2b0, 1, 0x920, 3, NO_PAD_CTRL)
1060#define MX35_PAD_ATA_DATA13__GPIO2_26 IOMUX_PAD(0x714, 0x2b0, 5, 0x8b0, 1, NO_PAD_CTRL)
1061#define MX35_PAD_ATA_DATA13__IPU_DIAGB_20 IOMUX_PAD(0x714, 0x2b0, 6, 0x0, 0, NO_PAD_CTRL)
1062
1063#define MX35_PAD_ATA_DATA14__ATA_DATA_14 IOMUX_PAD(0x718, 0x2b4, 0, 0x0, 0, NO_PAD_CTRL)
1064#define MX35_PAD_ATA_DATA14__IPU_CSI_D_0 IOMUX_PAD(0x718, 0x2b4, 1, 0x930, 2, NO_PAD_CTRL)
1065#define MX35_PAD_ATA_DATA14__KPP_ROW_0 IOMUX_PAD(0x718, 0x2b4, 3, 0x970, 2, NO_PAD_CTRL)
1066#define MX35_PAD_ATA_DATA14__GPIO2_27 IOMUX_PAD(0x718, 0x2b4, 5, 0x8b4, 1, NO_PAD_CTRL)
1067#define MX35_PAD_ATA_DATA14__IPU_DIAGB_21 IOMUX_PAD(0x718, 0x2b4, 6, 0x0, 0, NO_PAD_CTRL)
1068
1069#define MX35_PAD_ATA_DATA15__ATA_DATA_15 IOMUX_PAD(0x71c, 0x2b8, 0, 0x0, 0, NO_PAD_CTRL)
1070#define MX35_PAD_ATA_DATA15__IPU_CSI_D_1 IOMUX_PAD(0x71c, 0x2b8, 1, 0x934, 2, NO_PAD_CTRL)
1071#define MX35_PAD_ATA_DATA15__KPP_ROW_1 IOMUX_PAD(0x71c, 0x2b8, 3, 0x974, 2, NO_PAD_CTRL)
1072#define MX35_PAD_ATA_DATA15__GPIO2_28 IOMUX_PAD(0x71c, 0x2b8, 5, 0x8b8, 1, NO_PAD_CTRL)
1073#define MX35_PAD_ATA_DATA15__IPU_DIAGB_22 IOMUX_PAD(0x71c, 0x2b8, 6, 0x0, 0, NO_PAD_CTRL)
1074
1075#define MX35_PAD_ATA_INTRQ__ATA_INTRQ IOMUX_PAD(0x720, 0x2bc, 0, 0x0, 0, NO_PAD_CTRL)
1076#define MX35_PAD_ATA_INTRQ__IPU_CSI_D_2 IOMUX_PAD(0x720, 0x2bc, 1, 0x938, 3, NO_PAD_CTRL)
1077#define MX35_PAD_ATA_INTRQ__KPP_ROW_2 IOMUX_PAD(0x720, 0x2bc, 3, 0x978, 2, NO_PAD_CTRL)
1078#define MX35_PAD_ATA_INTRQ__GPIO2_29 IOMUX_PAD(0x720, 0x2bc, 5, 0x8bc, 1, NO_PAD_CTRL)
1079#define MX35_PAD_ATA_INTRQ__IPU_DIAGB_23 IOMUX_PAD(0x720, 0x2bc, 6, 0x0, 0, NO_PAD_CTRL)
1080
1081#define MX35_PAD_ATA_BUFF_EN__ATA_BUFFER_EN IOMUX_PAD(0x724, 0x2c0, 0, 0x0, 0, NO_PAD_CTRL)
1082#define MX35_PAD_ATA_BUFF_EN__IPU_CSI_D_3 IOMUX_PAD(0x724, 0x2c0, 1, 0x93c, 3, NO_PAD_CTRL)
1083#define MX35_PAD_ATA_BUFF_EN__KPP_ROW_3 IOMUX_PAD(0x724, 0x2c0, 3, 0x97c, 2, NO_PAD_CTRL)
1084#define MX35_PAD_ATA_BUFF_EN__GPIO2_30 IOMUX_PAD(0x724, 0x2c0, 5, 0x8c4, 1, NO_PAD_CTRL)
1085#define MX35_PAD_ATA_BUFF_EN__IPU_DIAGB_24 IOMUX_PAD(0x724, 0x2c0, 6, 0x0, 0, NO_PAD_CTRL)
1086
1087#define MX35_PAD_ATA_DMARQ__ATA_DMARQ IOMUX_PAD(0x728, 0x2c4, 0, 0x0, 0, NO_PAD_CTRL)
1088#define MX35_PAD_ATA_DMARQ__IPU_CSI_D_4 IOMUX_PAD(0x728, 0x2c4, 1, 0x940, 2, NO_PAD_CTRL)
1089#define MX35_PAD_ATA_DMARQ__KPP_COL_0 IOMUX_PAD(0x728, 0x2c4, 3, 0x950, 2, NO_PAD_CTRL)
1090#define MX35_PAD_ATA_DMARQ__GPIO2_31 IOMUX_PAD(0x728, 0x2c4, 5, 0x8c8, 1, NO_PAD_CTRL)
1091#define MX35_PAD_ATA_DMARQ__IPU_DIAGB_25 IOMUX_PAD(0x728, 0x2c4, 6, 0x0, 0, NO_PAD_CTRL)
1092#define MX35_PAD_ATA_DMARQ__ECT_CTI_TRIG_IN1_4 IOMUX_PAD(0x728, 0x2c4, 7, 0x0, 0, NO_PAD_CTRL)
1093
1094#define MX35_PAD_ATA_DA0__ATA_DA_0 IOMUX_PAD(0x72c, 0x2c8, 0, 0x0, 0, NO_PAD_CTRL)
1095#define MX35_PAD_ATA_DA0__IPU_CSI_D_5 IOMUX_PAD(0x72c, 0x2c8, 1, 0x944, 2, NO_PAD_CTRL)
1096#define MX35_PAD_ATA_DA0__KPP_COL_1 IOMUX_PAD(0x72c, 0x2c8, 3, 0x954, 2, NO_PAD_CTRL)
1097#define MX35_PAD_ATA_DA0__GPIO3_0 IOMUX_PAD(0x72c, 0x2c8, 5, 0x8e8, 1, NO_PAD_CTRL)
1098#define MX35_PAD_ATA_DA0__IPU_DIAGB_26 IOMUX_PAD(0x72c, 0x2c8, 6, 0x0, 0, NO_PAD_CTRL)
1099#define MX35_PAD_ATA_DA0__ECT_CTI_TRIG_IN1_5 IOMUX_PAD(0x72c, 0x2c8, 7, 0x0, 0, NO_PAD_CTRL)
1100
1101#define MX35_PAD_ATA_DA1__ATA_DA_1 IOMUX_PAD(0x730, 0x2cc, 0, 0x0, 0, NO_PAD_CTRL)
1102#define MX35_PAD_ATA_DA1__IPU_CSI_D_6 IOMUX_PAD(0x730, 0x2cc, 1, 0x948, 2, NO_PAD_CTRL)
1103#define MX35_PAD_ATA_DA1__KPP_COL_2 IOMUX_PAD(0x730, 0x2cc, 3, 0x958, 2, NO_PAD_CTRL)
1104#define MX35_PAD_ATA_DA1__GPIO3_1 IOMUX_PAD(0x730, 0x2cc, 5, 0x0, 0, NO_PAD_CTRL)
1105#define MX35_PAD_ATA_DA1__IPU_DIAGB_27 IOMUX_PAD(0x730, 0x2cc, 6, 0x0, 0, NO_PAD_CTRL)
1106#define MX35_PAD_ATA_DA1__ECT_CTI_TRIG_IN1_6 IOMUX_PAD(0x730, 0x2cc, 7, 0x0, 0, NO_PAD_CTRL)
1107
1108#define MX35_PAD_ATA_DA2__ATA_DA_2 IOMUX_PAD(0x734, 0x2d0, 0, 0x0, 0, NO_PAD_CTRL)
1109#define MX35_PAD_ATA_DA2__IPU_CSI_D_7 IOMUX_PAD(0x734, 0x2d0, 1, 0x94c, 2, NO_PAD_CTRL)
1110#define MX35_PAD_ATA_DA2__KPP_COL_3 IOMUX_PAD(0x734, 0x2d0, 3, 0x95c, 2, NO_PAD_CTRL)
1111#define MX35_PAD_ATA_DA2__GPIO3_2 IOMUX_PAD(0x734, 0x2d0, 5, 0x0, 0, NO_PAD_CTRL)
1112#define MX35_PAD_ATA_DA2__IPU_DIAGB_28 IOMUX_PAD(0x734, 0x2d0, 6, 0x0, 0, NO_PAD_CTRL)
1113#define MX35_PAD_ATA_DA2__ECT_CTI_TRIG_IN1_7 IOMUX_PAD(0x734, 0x2d0, 7, 0x0, 0, NO_PAD_CTRL)
1114
1115#define MX35_PAD_MLB_CLK__MLB_MLBCLK IOMUX_PAD(0x738, 0x2d4, 0, 0x0, 0, NO_PAD_CTRL)
1116#define MX35_PAD_MLB_CLK__GPIO3_3 IOMUX_PAD(0x738, 0x2d4, 5, 0x0, 0, NO_PAD_CTRL)
1117
1118#define MX35_PAD_MLB_DAT__MLB_MLBDAT IOMUX_PAD(0x73c, 0x2d8, 0, 0x0, 0, NO_PAD_CTRL)
1119#define MX35_PAD_MLB_DAT__GPIO3_4 IOMUX_PAD(0x73c, 0x2d8, 5, 0x904, 1, NO_PAD_CTRL)
1120
1121#define MX35_PAD_MLB_SIG__MLB_MLBSIG IOMUX_PAD(0x740, 0x2dc, 0, 0x0, 0, NO_PAD_CTRL)
1122#define MX35_PAD_MLB_SIG__GPIO3_5 IOMUX_PAD(0x740, 0x2dc, 5, 0x908, 1, NO_PAD_CTRL)
1123
1124#define MX35_PAD_FEC_TX_CLK__FEC_TX_CLK IOMUX_PAD(0x744, 0x2e0, 0, 0x0, 0, NO_PAD_CTRL)
1125#define MX35_PAD_FEC_TX_CLK__ESDHC1_DAT4 IOMUX_PAD(0x744, 0x2e0, 1, 0x804, 1, NO_PAD_CTRL)
1126#define MX35_PAD_FEC_TX_CLK__UART3_RXD_MUX IOMUX_PAD(0x744, 0x2e0, 2, 0x9a0, 3, NO_PAD_CTRL)
1127#define MX35_PAD_FEC_TX_CLK__USB_TOP_USBH2_DIR IOMUX_PAD(0x744, 0x2e0, 3, 0x9ec, 1, NO_PAD_CTRL)
1128#define MX35_PAD_FEC_TX_CLK__CSPI2_MOSI IOMUX_PAD(0x744, 0x2e0, 4, 0x7ec, 3, NO_PAD_CTRL)
1129#define MX35_PAD_FEC_TX_CLK__GPIO3_6 IOMUX_PAD(0x744, 0x2e0, 5, 0x90c, 1, NO_PAD_CTRL)
1130#define MX35_PAD_FEC_TX_CLK__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x744, 0x2e0, 6, 0x928, 5, NO_PAD_CTRL)
1131#define MX35_PAD_FEC_TX_CLK__ARM11P_TOP_EVNTBUS_0 IOMUX_PAD(0x744, 0x2e0, 7, 0x0, 0, NO_PAD_CTRL)
1132
1133#define MX35_PAD_FEC_RX_CLK__FEC_RX_CLK IOMUX_PAD(0x748, 0x2e4, 0, 0x0, 0, NO_PAD_CTRL)
1134#define MX35_PAD_FEC_RX_CLK__ESDHC1_DAT5 IOMUX_PAD(0x748, 0x2e4, 1, 0x808, 1, NO_PAD_CTRL)
1135#define MX35_PAD_FEC_RX_CLK__UART3_TXD_MUX IOMUX_PAD(0x748, 0x2e4, 2, 0x0, 0, NO_PAD_CTRL)
1136#define MX35_PAD_FEC_RX_CLK__USB_TOP_USBH2_STP IOMUX_PAD(0x748, 0x2e4, 3, 0x0, 0, NO_PAD_CTRL)
1137#define MX35_PAD_FEC_RX_CLK__CSPI2_MISO IOMUX_PAD(0x748, 0x2e4, 4, 0x7e8, 3, NO_PAD_CTRL)
1138#define MX35_PAD_FEC_RX_CLK__GPIO3_7 IOMUX_PAD(0x748, 0x2e4, 5, 0x910, 1, NO_PAD_CTRL)
1139#define MX35_PAD_FEC_RX_CLK__IPU_DISPB_SD_D_I IOMUX_PAD(0x748, 0x2e4, 6, 0x92c, 4, NO_PAD_CTRL)
1140#define MX35_PAD_FEC_RX_CLK__ARM11P_TOP_EVNTBUS_1 IOMUX_PAD(0x748, 0x2e4, 7, 0x0, 0, NO_PAD_CTRL)
1141
1142#define MX35_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(0x74c, 0x2e8, 0, 0x0, 0, NO_PAD_CTRL)
1143#define MX35_PAD_FEC_RX_DV__ESDHC1_DAT6 IOMUX_PAD(0x74c, 0x2e8, 1, 0x80c, 1, NO_PAD_CTRL)
1144#define MX35_PAD_FEC_RX_DV__UART3_RTS IOMUX_PAD(0x74c, 0x2e8, 2, 0x99c, 2, NO_PAD_CTRL)
1145#define MX35_PAD_FEC_RX_DV__USB_TOP_USBH2_NXT IOMUX_PAD(0x74c, 0x2e8, 3, 0x9f0, 1, NO_PAD_CTRL)
1146#define MX35_PAD_FEC_RX_DV__CSPI2_SCLK IOMUX_PAD(0x74c, 0x2e8, 4, 0x7e0, 3, NO_PAD_CTRL)
1147#define MX35_PAD_FEC_RX_DV__GPIO3_8 IOMUX_PAD(0x74c, 0x2e8, 5, 0x914, 1, NO_PAD_CTRL)
1148#define MX35_PAD_FEC_RX_DV__IPU_DISPB_SD_CLK IOMUX_PAD(0x74c, 0x2e8, 6, 0x0, 0, NO_PAD_CTRL)
1149#define MX35_PAD_FEC_RX_DV__ARM11P_TOP_EVNTBUS_2 IOMUX_PAD(0x74c, 0x2e8, 7, 0x0, 0, NO_PAD_CTRL)
1150
1151#define MX35_PAD_FEC_COL__FEC_COL IOMUX_PAD(0x750, 0x2ec, 0, 0x0, 0, NO_PAD_CTRL)
1152#define MX35_PAD_FEC_COL__ESDHC1_DAT7 IOMUX_PAD(0x750, 0x2ec, 1, 0x810, 1, NO_PAD_CTRL)
1153#define MX35_PAD_FEC_COL__UART3_CTS IOMUX_PAD(0x750, 0x2ec, 2, 0x0, 0, NO_PAD_CTRL)
1154#define MX35_PAD_FEC_COL__USB_TOP_USBH2_DATA_0 IOMUX_PAD(0x750, 0x2ec, 3, 0x9cc, 1, NO_PAD_CTRL)
1155#define MX35_PAD_FEC_COL__CSPI2_RDY IOMUX_PAD(0x750, 0x2ec, 4, 0x7e4, 3, NO_PAD_CTRL)
1156#define MX35_PAD_FEC_COL__GPIO3_9 IOMUX_PAD(0x750, 0x2ec, 5, 0x918, 1, NO_PAD_CTRL)
1157#define MX35_PAD_FEC_COL__IPU_DISPB_SER_RS IOMUX_PAD(0x750, 0x2ec, 6, 0x0, 0, NO_PAD_CTRL)
1158#define MX35_PAD_FEC_COL__ARM11P_TOP_EVNTBUS_3 IOMUX_PAD(0x750, 0x2ec, 7, 0x0, 0, NO_PAD_CTRL)
1159
1160#define MX35_PAD_FEC_RDATA0__FEC_RDATA_0 IOMUX_PAD(0x754, 0x2f0, 0, 0x0, 0, NO_PAD_CTRL)
1161#define MX35_PAD_FEC_RDATA0__PWM_PWMO IOMUX_PAD(0x754, 0x2f0, 1, 0x0, 0, NO_PAD_CTRL)
1162#define MX35_PAD_FEC_RDATA0__UART3_DTR IOMUX_PAD(0x754, 0x2f0, 2, 0x0, 0, NO_PAD_CTRL)
1163#define MX35_PAD_FEC_RDATA0__USB_TOP_USBH2_DATA_1 IOMUX_PAD(0x754, 0x2f0, 3, 0x9d0, 1, NO_PAD_CTRL)
1164#define MX35_PAD_FEC_RDATA0__CSPI2_SS0 IOMUX_PAD(0x754, 0x2f0, 4, 0x7f0, 2, NO_PAD_CTRL)
1165#define MX35_PAD_FEC_RDATA0__GPIO3_10 IOMUX_PAD(0x754, 0x2f0, 5, 0x8ec, 1, NO_PAD_CTRL)
1166#define MX35_PAD_FEC_RDATA0__IPU_DISPB_CS1 IOMUX_PAD(0x754, 0x2f0, 6, 0x0, 0, NO_PAD_CTRL)
1167#define MX35_PAD_FEC_RDATA0__ARM11P_TOP_EVNTBUS_4 IOMUX_PAD(0x754, 0x2f0, 7, 0x0, 0, NO_PAD_CTRL)
1168
1169#define MX35_PAD_FEC_TDATA0__FEC_TDATA_0 IOMUX_PAD(0x758, 0x2f4, 0, 0x0, 0, NO_PAD_CTRL)
1170#define MX35_PAD_FEC_TDATA0__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x758, 0x2f4, 1, 0x0, 0, NO_PAD_CTRL)
1171#define MX35_PAD_FEC_TDATA0__UART3_DSR IOMUX_PAD(0x758, 0x2f4, 2, 0x0, 0, NO_PAD_CTRL)
1172#define MX35_PAD_FEC_TDATA0__USB_TOP_USBH2_DATA_2 IOMUX_PAD(0x758, 0x2f4, 3, 0x9d4, 1, NO_PAD_CTRL)
1173#define MX35_PAD_FEC_TDATA0__CSPI2_SS1 IOMUX_PAD(0x758, 0x2f4, 4, 0x7f4, 2, NO_PAD_CTRL)
1174#define MX35_PAD_FEC_TDATA0__GPIO3_11 IOMUX_PAD(0x758, 0x2f4, 5, 0x8f0, 1, NO_PAD_CTRL)
1175#define MX35_PAD_FEC_TDATA0__IPU_DISPB_CS0 IOMUX_PAD(0x758, 0x2f4, 6, 0x0, 0, NO_PAD_CTRL)
1176#define MX35_PAD_FEC_TDATA0__ARM11P_TOP_EVNTBUS_5 IOMUX_PAD(0x758, 0x2f4, 7, 0x0, 0, NO_PAD_CTRL)
1177
1178#define MX35_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x75c, 0x2f8, 0, 0x0, 0, NO_PAD_CTRL)
1179#define MX35_PAD_FEC_TX_EN__SPDIF_SPDIF_IN1 IOMUX_PAD(0x75c, 0x2f8, 1, 0x998, 3, NO_PAD_CTRL)
1180#define MX35_PAD_FEC_TX_EN__UART3_RI IOMUX_PAD(0x75c, 0x2f8, 2, 0x0, 0, NO_PAD_CTRL)
1181#define MX35_PAD_FEC_TX_EN__USB_TOP_USBH2_DATA_3 IOMUX_PAD(0x75c, 0x2f8, 3, 0x9d8, 1, NO_PAD_CTRL)
1182#define MX35_PAD_FEC_TX_EN__GPIO3_12 IOMUX_PAD(0x75c, 0x2f8, 5, 0x8f4, 1, NO_PAD_CTRL)
1183#define MX35_PAD_FEC_TX_EN__IPU_DISPB_PAR_RS IOMUX_PAD(0x75c, 0x2f8, 6, 0x0, 0, NO_PAD_CTRL)
1184#define MX35_PAD_FEC_TX_EN__ARM11P_TOP_EVNTBUS_6 IOMUX_PAD(0x75c, 0x2f8, 7, 0x0, 0, NO_PAD_CTRL)
1185
1186#define MX35_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x760, 0x2fc, 0, 0x0, 0, NO_PAD_CTRL)
1187#define MX35_PAD_FEC_MDC__CAN2_TXCAN IOMUX_PAD(0x760, 0x2fc, 1, 0x0, 0, NO_PAD_CTRL)
1188#define MX35_PAD_FEC_MDC__UART3_DCD IOMUX_PAD(0x760, 0x2fc, 2, 0x0, 0, NO_PAD_CTRL)
1189#define MX35_PAD_FEC_MDC__USB_TOP_USBH2_DATA_4 IOMUX_PAD(0x760, 0x2fc, 3, 0x9dc, 1, NO_PAD_CTRL)
1190#define MX35_PAD_FEC_MDC__GPIO3_13 IOMUX_PAD(0x760, 0x2fc, 5, 0x8f8, 1, NO_PAD_CTRL)
1191#define MX35_PAD_FEC_MDC__IPU_DISPB_WR IOMUX_PAD(0x760, 0x2fc, 6, 0x0, 0, NO_PAD_CTRL)
1192#define MX35_PAD_FEC_MDC__ARM11P_TOP_EVNTBUS_7 IOMUX_PAD(0x760, 0x2fc, 7, 0x0, 0, NO_PAD_CTRL)
1193
1194#define MX35_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(0x764, 0x300, 0, 0x0, 0, NO_PAD_CTRL)
1195#define MX35_PAD_FEC_MDIO__CAN2_RXCAN IOMUX_PAD(0x764, 0x300, 1, 0x7cc, 2, NO_PAD_CTRL)
1196#define MX35_PAD_FEC_MDIO__USB_TOP_USBH2_DATA_5 IOMUX_PAD(0x764, 0x300, 3, 0x9e0, 1, NO_PAD_CTRL)
1197#define MX35_PAD_FEC_MDIO__GPIO3_14 IOMUX_PAD(0x764, 0x300, 5, 0x8fc, 1, NO_PAD_CTRL)
1198#define MX35_PAD_FEC_MDIO__IPU_DISPB_RD IOMUX_PAD(0x764, 0x300, 6, 0x0, 0, NO_PAD_CTRL)
1199#define MX35_PAD_FEC_MDIO__ARM11P_TOP_EVNTBUS_8 IOMUX_PAD(0x764, 0x300, 7, 0x0, 0, NO_PAD_CTRL)
1200
1201#define MX35_PAD_FEC_TX_ERR__FEC_TX_ERR IOMUX_PAD(0x768, 0x304, 0, 0x0, 0, NO_PAD_CTRL)
1202#define MX35_PAD_FEC_TX_ERR__OWIRE_LINE IOMUX_PAD(0x768, 0x304, 1, 0x990, 2, NO_PAD_CTRL)
1203#define MX35_PAD_FEC_TX_ERR__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x768, 0x304, 2, 0x994, 4, NO_PAD_CTRL)
1204#define MX35_PAD_FEC_TX_ERR__USB_TOP_USBH2_DATA_6 IOMUX_PAD(0x768, 0x304, 3, 0x9e4, 1, NO_PAD_CTRL)
1205#define MX35_PAD_FEC_TX_ERR__GPIO3_15 IOMUX_PAD(0x768, 0x304, 5, 0x900, 1, NO_PAD_CTRL)
1206#define MX35_PAD_FEC_TX_ERR__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x768, 0x304, 6, 0x924, 3, NO_PAD_CTRL)
1207#define MX35_PAD_FEC_TX_ERR__ARM11P_TOP_EVNTBUS_9 IOMUX_PAD(0x768, 0x304, 7, 0x0, 0, NO_PAD_CTRL)
1208
1209#define MX35_PAD_FEC_RX_ERR__FEC_RX_ERR IOMUX_PAD(0x76c, 0x308, 0, 0x0, 0, NO_PAD_CTRL)
1210#define MX35_PAD_FEC_RX_ERR__IPU_CSI_D_0 IOMUX_PAD(0x76c, 0x308, 1, 0x930, 3, NO_PAD_CTRL)
1211#define MX35_PAD_FEC_RX_ERR__USB_TOP_USBH2_DATA_7 IOMUX_PAD(0x76c, 0x308, 3, 0x9e8, 1, NO_PAD_CTRL)
1212#define MX35_PAD_FEC_RX_ERR__KPP_COL_4 IOMUX_PAD(0x76c, 0x308, 4, 0x960, 1, NO_PAD_CTRL)
1213#define MX35_PAD_FEC_RX_ERR__GPIO3_16 IOMUX_PAD(0x76c, 0x308, 5, 0x0, 0, NO_PAD_CTRL)
1214#define MX35_PAD_FEC_RX_ERR__IPU_DISPB_SD_D_IO IOMUX_PAD(0x76c, 0x308, 6, 0x92c, 5, NO_PAD_CTRL)
1215
1216#define MX35_PAD_FEC_CRS__FEC_CRS IOMUX_PAD(0x770, 0x30c, 0, 0x0, 0, NO_PAD_CTRL)
1217#define MX35_PAD_FEC_CRS__IPU_CSI_D_1 IOMUX_PAD(0x770, 0x30c, 1, 0x934, 3, NO_PAD_CTRL)
1218#define MX35_PAD_FEC_CRS__USB_TOP_USBH2_PWR IOMUX_PAD(0x770, 0x30c, 3, 0x0, 0, NO_PAD_CTRL)
1219#define MX35_PAD_FEC_CRS__KPP_COL_5 IOMUX_PAD(0x770, 0x30c, 4, 0x964, 1, NO_PAD_CTRL)
1220#define MX35_PAD_FEC_CRS__GPIO3_17 IOMUX_PAD(0x770, 0x30c, 5, 0x0, 0, NO_PAD_CTRL)
1221#define MX35_PAD_FEC_CRS__IPU_FLASH_STROBE IOMUX_PAD(0x770, 0x30c, 6, 0x0, 0, NO_PAD_CTRL)
1222
1223#define MX35_PAD_FEC_RDATA1__FEC_RDATA_1 IOMUX_PAD(0x774, 0x310, 0, 0x0, 0, NO_PAD_CTRL)
1224#define MX35_PAD_FEC_RDATA1__IPU_CSI_D_2 IOMUX_PAD(0x774, 0x310, 1, 0x938, 4, NO_PAD_CTRL)
1225#define MX35_PAD_FEC_RDATA1__AUDMUX_AUD6_RXC IOMUX_PAD(0x774, 0x310, 2, 0x0, 0, NO_PAD_CTRL)
1226#define MX35_PAD_FEC_RDATA1__USB_TOP_USBH2_OC IOMUX_PAD(0x774, 0x310, 3, 0x9f4, 2, NO_PAD_CTRL)
1227#define MX35_PAD_FEC_RDATA1__KPP_COL_6 IOMUX_PAD(0x774, 0x310, 4, 0x968, 1, NO_PAD_CTRL)
1228#define MX35_PAD_FEC_RDATA1__GPIO3_18 IOMUX_PAD(0x774, 0x310, 5, 0x0, 0, NO_PAD_CTRL)
1229#define MX35_PAD_FEC_RDATA1__IPU_DISPB_BE0 IOMUX_PAD(0x774, 0x310, 6, 0x0, 0, NO_PAD_CTRL)
1230
1231#define MX35_PAD_FEC_TDATA1__FEC_TDATA_1 IOMUX_PAD(0x778, 0x314, 0, 0x0, 0, NO_PAD_CTRL)
1232#define MX35_PAD_FEC_TDATA1__IPU_CSI_D_3 IOMUX_PAD(0x778, 0x314, 1, 0x93c, 4, NO_PAD_CTRL)
1233#define MX35_PAD_FEC_TDATA1__AUDMUX_AUD6_RXFS IOMUX_PAD(0x778, 0x314, 2, 0x7bc, 1, NO_PAD_CTRL)
1234#define MX35_PAD_FEC_TDATA1__KPP_COL_7 IOMUX_PAD(0x778, 0x314, 4, 0x96c, 1, NO_PAD_CTRL)
1235#define MX35_PAD_FEC_TDATA1__GPIO3_19 IOMUX_PAD(0x778, 0x314, 5, 0x0, 0, NO_PAD_CTRL)
1236#define MX35_PAD_FEC_TDATA1__IPU_DISPB_BE1 IOMUX_PAD(0x778, 0x314, 6, 0x0, 0, NO_PAD_CTRL)
1237
1238#define MX35_PAD_FEC_RDATA2__FEC_RDATA_2 IOMUX_PAD(0x77c, 0x318, 0, 0x0, 0, NO_PAD_CTRL)
1239#define MX35_PAD_FEC_RDATA2__IPU_CSI_D_4 IOMUX_PAD(0x77c, 0x318, 1, 0x940, 3, NO_PAD_CTRL)
1240#define MX35_PAD_FEC_RDATA2__AUDMUX_AUD6_TXD IOMUX_PAD(0x77c, 0x318, 2, 0x7b4, 1, NO_PAD_CTRL)
1241#define MX35_PAD_FEC_RDATA2__KPP_ROW_4 IOMUX_PAD(0x77c, 0x318, 4, 0x980, 1, NO_PAD_CTRL)
1242#define MX35_PAD_FEC_RDATA2__GPIO3_20 IOMUX_PAD(0x77c, 0x318, 5, 0x0, 0, NO_PAD_CTRL)
1243
1244#define MX35_PAD_FEC_TDATA2__FEC_TDATA_2 IOMUX_PAD(0x780, 0x31c, 0, 0x0, 0, NO_PAD_CTRL)
1245#define MX35_PAD_FEC_TDATA2__IPU_CSI_D_5 IOMUX_PAD(0x780, 0x31c, 1, 0x944, 3, NO_PAD_CTRL)
1246#define MX35_PAD_FEC_TDATA2__AUDMUX_AUD6_RXD IOMUX_PAD(0x780, 0x31c, 2, 0x7b0, 1, NO_PAD_CTRL)
1247#define MX35_PAD_FEC_TDATA2__KPP_ROW_5 IOMUX_PAD(0x780, 0x31c, 4, 0x984, 1, NO_PAD_CTRL)
1248#define MX35_PAD_FEC_TDATA2__GPIO3_21 IOMUX_PAD(0x780, 0x31c, 5, 0x0, 0, NO_PAD_CTRL)
1249
1250#define MX35_PAD_FEC_RDATA3__FEC_RDATA_3 IOMUX_PAD(0x784, 0x320, 0, 0x0, 0, NO_PAD_CTRL)
1251#define MX35_PAD_FEC_RDATA3__IPU_CSI_D_6 IOMUX_PAD(0x784, 0x320, 1, 0x948, 3, NO_PAD_CTRL)
1252#define MX35_PAD_FEC_RDATA3__AUDMUX_AUD6_TXC IOMUX_PAD(0x784, 0x320, 2, 0x7c0, 1, NO_PAD_CTRL)
1253#define MX35_PAD_FEC_RDATA3__KPP_ROW_6 IOMUX_PAD(0x784, 0x320, 4, 0x988, 1, NO_PAD_CTRL)
1254#define MX35_PAD_FEC_RDATA3__GPIO3_22 IOMUX_PAD(0x784, 0x320, 6, 0x0, 0, NO_PAD_CTRL)
1255
1256#define MX35_PAD_FEC_TDATA3__FEC_TDATA_3 IOMUX_PAD(0x788, 0x324, 0, 0x0, 0, NO_PAD_CTRL)
1257#define MX35_PAD_FEC_TDATA3__IPU_CSI_D_7 IOMUX_PAD(0x788, 0x324, 1, 0x94c, 3, NO_PAD_CTRL)
1258#define MX35_PAD_FEC_TDATA3__AUDMUX_AUD6_TXFS IOMUX_PAD(0x788, 0x324, 2, 0x7c4, 1, NO_PAD_CTRL)
1259#define MX35_PAD_FEC_TDATA3__KPP_ROW_7 IOMUX_PAD(0x788, 0x324, 4, 0x98c, 1, NO_PAD_CTRL)
1260#define MX35_PAD_FEC_TDATA3__GPIO3_23 IOMUX_PAD(0x788, 0x324, 5, 0x0, 0, NO_PAD_CTRL)
1261
1262#define MX35_PAD_EXT_ARMCLK__CCM_EXT_ARMCLK IOMUX_PAD(0x78c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
1263
1264#define MX35_PAD_TEST_MODE__TCU_TEST_MODE IOMUX_PAD(0x790, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
1265
1266
1267#endif /* __MACH_IOMUX_MX35_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
new file mode 100644
index 000000000000..7cd84547658f
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -0,0 +1,121 @@
1/*
2 * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
3 * <armlinux@phytec.de>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#ifndef __MACH_IOMUX_V3_H__
21#define __MACH_IOMUX_V3_H__
22
23/*
24 * build IOMUX_PAD structure
25 *
26 * This iomux scheme is based around pads, which are the physical balls
27 * on the processor.
28 *
29 * - Each pad has a pad control register (IOMUXC_SW_PAD_CTRL_x) which controls
30 * things like driving strength and pullup/pulldown.
31 * - Each pad can have but not necessarily does have an output routing register
32 * (IOMUXC_SW_MUX_CTL_PAD_x).
33 * - Each pad can have but not necessarily does have an input routing register
34 * (IOMUXC_x_SELECT_INPUT)
35 *
36 * The three register sets do not have a fixed offset to each other,
37 * hence we order this table by pad control registers (which all pads
38 * have) and put the optional i/o routing registers into additional
39 * fields.
40 *
41 * The naming convention for the pad modes is MX35_PAD_<padname>__<padmode>
42 * If <padname> or <padmode> refers to a GPIO, it is named
43 * GPIO_<unit>_<num>
44 *
45 */
46
47struct pad_desc {
48 unsigned mux_ctrl_ofs:12; /* IOMUXC_SW_MUX_CTL_PAD offset */
49 unsigned mux_mode:8;
50 unsigned pad_ctrl_ofs:12; /* IOMUXC_SW_PAD_CTRL offset */
51#define NO_PAD_CTRL (1 << 16)
52 unsigned pad_ctrl:17;
53 unsigned select_input_ofs:12; /* IOMUXC_SELECT_INPUT offset */
54 unsigned select_input:3;
55};
56
57#define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \
58 _select_input, _pad_ctrl) \
59 { \
60 .mux_ctrl_ofs = _mux_ctrl_ofs, \
61 .mux_mode = _mux_mode, \
62 .pad_ctrl_ofs = _pad_ctrl_ofs, \
63 .pad_ctrl = _pad_ctrl, \
64 .select_input_ofs = _select_input_ofs, \
65 .select_input = _select_input, \
66 }
67
68/*
69 * Use to set PAD control
70 */
71#define PAD_CTL_DRIVE_VOLTAGE_3_3_V 0
72#define PAD_CTL_DRIVE_VOLTAGE_1_8_V 1
73
74#define PAD_CTL_NO_HYSTERESIS 0
75#define PAD_CTL_HYSTERESIS 1
76
77#define PAD_CTL_PULL_DISABLED 0x0
78#define PAD_CTL_PULL_KEEPER 0xa
79#define PAD_CTL_PULL_DOWN_100K 0xc
80#define PAD_CTL_PULL_UP_47K 0xd
81#define PAD_CTL_PULL_UP_100K 0xe
82#define PAD_CTL_PULL_UP_22K 0xf
83
84#define PAD_CTL_OUTPUT_CMOS 0
85#define PAD_CTL_OUTPUT_OPEN_DRAIN 1
86
87#define PAD_CTL_DRIVE_STRENGTH_NORM 0
88#define PAD_CTL_DRIVE_STRENGTH_HIGH 1
89#define PAD_CTL_DRIVE_STRENGTH_MAX 2
90
91#define PAD_CTL_SLEW_RATE_SLOW 0
92#define PAD_CTL_SLEW_RATE_FAST 1
93
94/*
95 * setups a single pad:
96 * - reserves the pad so that it is not claimed by another driver
97 * - setups the iomux according to the configuration
98 */
99int mxc_iomux_v3_setup_pad(struct pad_desc *pad);
100
101/*
102 * setups mutliple pads
103 * convenient way to call the above function with tables
104 */
105int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count);
106
107/*
108 * releases a single pad:
109 * - make it available for a future use by another driver
110 * - DOES NOT reconfigure the IOMUX in its reset state
111 */
112void mxc_iomux_v3_release_pad(struct pad_desc *pad);
113
114/*
115 * releases multiple pads
116 * convenvient way to call the above function with tables
117 */
118void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count);
119
120#endif /* __MACH_IOMUX_V3_H__*/
121
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index eca37d09f3f8..6065e00176ed 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -32,4 +32,12 @@
32#define CONSISTENT_DMA_SIZE SZ_4M 32#define CONSISTENT_DMA_SIZE SZ_4M
33#endif /* CONFIG_MX1_VIDEO */ 33#endif /* CONFIG_MX1_VIDEO */
34 34
35#if defined(CONFIG_MX3_VIDEO)
36/*
37 * Increase size of DMA-consistent memory region.
38 * This is required for mx3 camera driver to capture at least two QXGA frames.
39 */
40#define CONSISTENT_DMA_SIZE SZ_8M
41#endif /* CONFIG_MX3_VIDEO */
42
35#endif /* __ASM_ARCH_MXC_MEMORY_H__ */ 43#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index b92e02324d8e..1000bf330bcd 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -179,7 +179,7 @@
179#define DMA_REQ_UART1_T 30 179#define DMA_REQ_UART1_T 30
180#define DMA_REQ_UART1_R 31 180#define DMA_REQ_UART1_R 31
181 181
182/* mandatory for CONFIG_LL_DEBUG */ 182/* mandatory for CONFIG_DEBUG_LL */
183#define MXC_LL_UART_PADDR UART1_BASE_ADDR 183#define MXC_LL_UART_PADDR UART1_BASE_ADDR
184#define MXC_LL_UART_VADDR IO_ADDRESS(UART1_BASE_ADDR) 184#define MXC_LL_UART_VADDR IO_ADDRESS(UART1_BASE_ADDR)
185 185
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
index 3878c6085d5c..b559a4bb5769 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -48,6 +48,9 @@
48#define CS4_SIZE SZ_32M 48#define CS4_SIZE SZ_32M
49 49
50#define CS5_BASE_ADDR 0xB6000000 50#define CS5_BASE_ADDR 0xB6000000
51#define CS5_BASE_ADDR_VIRT 0xF6000000
52#define CS5_SIZE SZ_32M
53
51#define PCMCIA_MEM_BASE_ADDR 0xBC000000 54#define PCMCIA_MEM_BASE_ADDR 0xBC000000
52 55
53/* 56/*
@@ -191,6 +194,9 @@
191#define CS4_IO_ADDRESS(x) \ 194#define CS4_IO_ADDRESS(x) \
192 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) 195 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
193 196
197#define CS5_IO_ADDRESS(x) \
198 (((x) - CS5_BASE_ADDR) + CS5_BASE_ADDR_VIRT)
199
194#define X_MEMC_IO_ADDRESS(x) \ 200#define X_MEMC_IO_ADDRESS(x) \
195 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) 201 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
196 202
diff --git a/arch/arm/plat-mxc/include/mach/mxc_timer.h b/arch/arm/plat-mxc/include/mach/mxc_timer.h
deleted file mode 100644
index 6c19a134744b..000000000000
--- a/arch/arm/plat-mxc/include/mach/mxc_timer.h
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * mxc_timer.h
3 *
4 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
5 *
6 * Platform independent (i.MX1, i.MX2, i.MX3) definition for timer handling.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23#ifndef __PLAT_MXC_TIMER_H
24#define __PLAT_MXC_TIMER_H
25
26#include <linux/clk.h>
27#include <mach/hardware.h>
28
29#ifdef CONFIG_ARCH_MX1
30#define TIMER_BASE IO_ADDRESS(TIM1_BASE_ADDR)
31#define TIMER_INTERRUPT TIM1_INT
32
33#define TCTL_VAL TCTL_CLK_PCLK1
34#define TCTL_IRQEN (1<<4)
35#define TCTL_FRR (1<<8)
36#define TCTL_CLK_PCLK1 (1<<1)
37#define TCTL_CLK_PCLK1_4 (2<<1)
38#define TCTL_CLK_TIN (3<<1)
39#define TCTL_CLK_32 (4<<1)
40
41#define MXC_TCTL 0x00
42#define MXC_TPRER 0x04
43#define MXC_TCMP 0x08
44#define MXC_TCR 0x0c
45#define MXC_TCN 0x10
46#define MXC_TSTAT 0x14
47#define TSTAT_CAPT (1<<1)
48#define TSTAT_COMP (1<<0)
49
50static inline void gpt_irq_disable(void)
51{
52 unsigned int tmp;
53
54 tmp = __raw_readl(TIMER_BASE + MXC_TCTL);
55 __raw_writel(tmp & ~TCTL_IRQEN, TIMER_BASE + MXC_TCTL);
56}
57
58static inline void gpt_irq_enable(void)
59{
60 __raw_writel(__raw_readl(TIMER_BASE + MXC_TCTL) | TCTL_IRQEN,
61 TIMER_BASE + MXC_TCTL);
62}
63
64static void gpt_irq_acknowledge(void)
65{
66 __raw_writel(0, TIMER_BASE + MXC_TSTAT);
67}
68#endif /* CONFIG_ARCH_MX1 */
69
70#ifdef CONFIG_ARCH_MX2
71#define TIMER_BASE IO_ADDRESS(GPT1_BASE_ADDR)
72#define TIMER_INTERRUPT MXC_INT_GPT1
73
74#define MXC_TCTL 0x00
75#define TCTL_VAL TCTL_CLK_PCLK1
76#define TCTL_CLK_PCLK1 (1<<1)
77#define TCTL_CLK_PCLK1_4 (2<<1)
78#define TCTL_IRQEN (1<<4)
79#define TCTL_FRR (1<<8)
80#define MXC_TPRER 0x04
81#define MXC_TCMP 0x08
82#define MXC_TCR 0x0c
83#define MXC_TCN 0x10
84#define MXC_TSTAT 0x14
85#define TSTAT_CAPT (1<<1)
86#define TSTAT_COMP (1<<0)
87
88static inline void gpt_irq_disable(void)
89{
90 unsigned int tmp;
91
92 tmp = __raw_readl(TIMER_BASE + MXC_TCTL);
93 __raw_writel(tmp & ~TCTL_IRQEN, TIMER_BASE + MXC_TCTL);
94}
95
96static inline void gpt_irq_enable(void)
97{
98 __raw_writel(__raw_readl(TIMER_BASE + MXC_TCTL) | TCTL_IRQEN,
99 TIMER_BASE + MXC_TCTL);
100}
101
102static void gpt_irq_acknowledge(void)
103{
104 __raw_writel(TSTAT_CAPT | TSTAT_COMP, TIMER_BASE + MXC_TSTAT);
105}
106#endif /* CONFIG_ARCH_MX2 */
107
108#ifdef CONFIG_ARCH_MX3
109#define TIMER_BASE IO_ADDRESS(GPT1_BASE_ADDR)
110#define TIMER_INTERRUPT MXC_INT_GPT
111
112#define MXC_TCTL 0x00
113#define TCTL_VAL (TCTL_CLK_IPG | TCTL_WAITEN)
114#define TCTL_CLK_IPG (1<<6)
115#define TCTL_FRR (1<<9)
116#define TCTL_WAITEN (1<<3)
117
118#define MXC_TPRER 0x04
119#define MXC_TSTAT 0x08
120#define TSTAT_OF1 (1<<0)
121#define TSTAT_OF2 (1<<1)
122#define TSTAT_OF3 (1<<2)
123#define TSTAT_IF1 (1<<3)
124#define TSTAT_IF2 (1<<4)
125#define TSTAT_ROV (1<<5)
126#define MXC_IR 0x0c
127#define MXC_TCMP 0x10
128#define MXC_TCMP2 0x14
129#define MXC_TCMP3 0x18
130#define MXC_TCR 0x1c
131#define MXC_TCN 0x24
132
133static inline void gpt_irq_disable(void)
134{
135 __raw_writel(0, TIMER_BASE + MXC_IR);
136}
137
138static inline void gpt_irq_enable(void)
139{
140 __raw_writel(1<<0, TIMER_BASE + MXC_IR);
141}
142
143static inline void gpt_irq_acknowledge(void)
144{
145 __raw_writel(TSTAT_OF1, TIMER_BASE + MXC_TSTAT);
146}
147#endif /* CONFIG_ARCH_MX3 */
148
149#define TCTL_SWR (1<<15)
150#define TCTL_CC (1<<10)
151#define TCTL_OM (1<<9)
152#define TCTL_CAP_RIS (1<<6)
153#define TCTL_CAP_FAL (2<<6)
154#define TCTL_CAP_RIS_FAL (3<<6)
155#define TCTL_CAP_ENA (1<<5)
156#define TCTL_TEN (1<<0)
157
158#endif
diff --git a/arch/arm/plat-mxc/include/mach/usb.h b/arch/arm/plat-mxc/include/mach/usb.h
index 2dacb3086f1c..be273371f34a 100644
--- a/arch/arm/plat-mxc/include/mach/usb.h
+++ b/arch/arm/plat-mxc/include/mach/usb.h
@@ -17,7 +17,7 @@
17 17
18struct imxusb_platform_data { 18struct imxusb_platform_data {
19 int (*init)(struct device *); 19 int (*init)(struct device *);
20 int (*exit)(struct device *); 20 void (*exit)(struct device *);
21}; 21};
22 22
23#endif /* __ASM_ARCH_MXC_USB */ 23#endif /* __ASM_ARCH_MXC_USB */
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c
new file mode 100644
index 000000000000..77a078f9513f
--- /dev/null
+++ b/arch/arm/plat-mxc/iomux-v3.c
@@ -0,0 +1,98 @@
1/*
2 * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
4 * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
5 * <armlinux@phytec.de>
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 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21#include <linux/errno.h>
22#include <linux/init.h>
23#include <linux/kernel.h>
24#include <linux/module.h>
25#include <linux/string.h>
26#include <linux/gpio.h>
27
28#include <mach/hardware.h>
29#include <asm/mach/map.h>
30#include <mach/iomux-v3.h>
31
32#define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR)
33
34static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG];
35
36/*
37 * setups a single pin:
38 * - reserves the pin so that it is not claimed by another driver
39 * - setups the iomux according to the configuration
40 */
41int mxc_iomux_v3_setup_pad(struct pad_desc *pad)
42{
43 unsigned int pad_ofs = pad->pad_ctrl_ofs;
44
45 if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map))
46 return -EBUSY;
47 if (pad->mux_ctrl_ofs)
48 __raw_writel(pad->mux_mode, IOMUX_BASE + pad->mux_ctrl_ofs);
49
50 if (pad->select_input_ofs)
51 __raw_writel(pad->select_input,
52 IOMUX_BASE + pad->select_input_ofs);
53
54 if (!(pad->pad_ctrl & NO_PAD_CTRL))
55 __raw_writel(pad->pad_ctrl, IOMUX_BASE + pad->pad_ctrl_ofs);
56 return 0;
57}
58EXPORT_SYMBOL(mxc_iomux_v3_setup_pad);
59
60int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count)
61{
62 struct pad_desc *p = pad_list;
63 int i;
64 int ret;
65
66 for (i = 0; i < count; i++) {
67 ret = mxc_iomux_v3_setup_pad(p);
68 if (ret)
69 goto setup_error;
70 p++;
71 }
72 return 0;
73
74setup_error:
75 mxc_iomux_v3_release_multiple_pads(pad_list, i);
76 return ret;
77}
78EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads);
79
80void mxc_iomux_v3_release_pad(struct pad_desc *pad)
81{
82 unsigned int pad_ofs = pad->pad_ctrl_ofs;
83
84 clear_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map);
85}
86EXPORT_SYMBOL(mxc_iomux_v3_release_pad);
87
88void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count)
89{
90 struct pad_desc *p = pad_list;
91 int i;
92
93 for (i = 0; i < count; i++) {
94 mxc_iomux_v3_release_pad(p);
95 p++;
96 }
97}
98EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads);
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c
index 0fb68a531f55..8aee76304f8f 100644
--- a/arch/arm/plat-mxc/irq.c
+++ b/arch/arm/plat-mxc/irq.c
@@ -24,31 +24,27 @@
24#include <asm/mach/irq.h> 24#include <asm/mach/irq.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26 26
27#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR) 27#define AVIC_INTCNTL 0x00 /* int control reg */
28#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */ 28#define AVIC_NIMASK 0x04 /* int mask reg */
29#define AVIC_NIMASK (AVIC_BASE + 0x04) /* int mask reg */ 29#define AVIC_INTENNUM 0x08 /* int enable number reg */
30#define AVIC_INTENNUM (AVIC_BASE + 0x08) /* int enable number reg */ 30#define AVIC_INTDISNUM 0x0C /* int disable number reg */
31#define AVIC_INTDISNUM (AVIC_BASE + 0x0C) /* int disable number reg */ 31#define AVIC_INTENABLEH 0x10 /* int enable reg high */
32#define AVIC_INTENABLEH (AVIC_BASE + 0x10) /* int enable reg high */ 32#define AVIC_INTENABLEL 0x14 /* int enable reg low */
33#define AVIC_INTENABLEL (AVIC_BASE + 0x14) /* int enable reg low */ 33#define AVIC_INTTYPEH 0x18 /* int type reg high */
34#define AVIC_INTTYPEH (AVIC_BASE + 0x18) /* int type reg high */ 34#define AVIC_INTTYPEL 0x1C /* int type reg low */
35#define AVIC_INTTYPEL (AVIC_BASE + 0x1C) /* int type reg low */ 35#define AVIC_NIPRIORITY(x) (0x20 + 4 * (7 - (x))) /* int priority */
36#define AVIC_NIPRIORITY(x) (AVIC_BASE + (0x20 + 4 * (7 - (x)))) /* int priority */ 36#define AVIC_NIVECSR 0x40 /* norm int vector/status */
37#define AVIC_NIVECSR (AVIC_BASE + 0x40) /* norm int vector/status */ 37#define AVIC_FIVECSR 0x44 /* fast int vector/status */
38#define AVIC_FIVECSR (AVIC_BASE + 0x44) /* fast int vector/status */ 38#define AVIC_INTSRCH 0x48 /* int source reg high */
39#define AVIC_INTSRCH (AVIC_BASE + 0x48) /* int source reg high */ 39#define AVIC_INTSRCL 0x4C /* int source reg low */
40#define AVIC_INTSRCL (AVIC_BASE + 0x4C) /* int source reg low */ 40#define AVIC_INTFRCH 0x50 /* int force reg high */
41#define AVIC_INTFRCH (AVIC_BASE + 0x50) /* int force reg high */ 41#define AVIC_INTFRCL 0x54 /* int force reg low */
42#define AVIC_INTFRCL (AVIC_BASE + 0x54) /* int force reg low */ 42#define AVIC_NIPNDH 0x58 /* norm int pending high */
43#define AVIC_NIPNDH (AVIC_BASE + 0x58) /* norm int pending high */ 43#define AVIC_NIPNDL 0x5C /* norm int pending low */
44#define AVIC_NIPNDL (AVIC_BASE + 0x5C) /* norm int pending low */ 44#define AVIC_FIPNDH 0x60 /* fast int pending high */
45#define AVIC_FIPNDH (AVIC_BASE + 0x60) /* fast int pending high */ 45#define AVIC_FIPNDL 0x64 /* fast int pending low */
46#define AVIC_FIPNDL (AVIC_BASE + 0x64) /* fast int pending low */ 46
47 47static void __iomem *avic_base;
48#define SYSTEM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20)
49#define SYSTEM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24)
50#define IIM_PROD_REV_SH 3
51#define IIM_PROD_REV_LEN 5
52 48
53int imx_irq_set_priority(unsigned char irq, unsigned char prio) 49int imx_irq_set_priority(unsigned char irq, unsigned char prio)
54{ 50{
@@ -59,11 +55,11 @@ int imx_irq_set_priority(unsigned char irq, unsigned char prio)
59 if (irq >= MXC_INTERNAL_IRQS) 55 if (irq >= MXC_INTERNAL_IRQS)
60 return -EINVAL;; 56 return -EINVAL;;
61 57
62 temp = __raw_readl(AVIC_NIPRIORITY(irq / 8)); 58 temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8));
63 temp &= ~mask; 59 temp &= ~mask;
64 temp |= prio & mask; 60 temp |= prio & mask;
65 61
66 __raw_writel(temp, AVIC_NIPRIORITY(irq / 8)); 62 __raw_writel(temp, avic_base + AVIC_NIPRIORITY(irq / 8));
67 63
68 return 0; 64 return 0;
69#else 65#else
@@ -81,12 +77,12 @@ int mxc_set_irq_fiq(unsigned int irq, unsigned int type)
81 return -EINVAL; 77 return -EINVAL;
82 78
83 if (irq < MXC_INTERNAL_IRQS / 2) { 79 if (irq < MXC_INTERNAL_IRQS / 2) {
84 irqt = __raw_readl(AVIC_INTTYPEL) & ~(1 << irq); 80 irqt = __raw_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq);
85 __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEL); 81 __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL);
86 } else { 82 } else {
87 irq -= MXC_INTERNAL_IRQS / 2; 83 irq -= MXC_INTERNAL_IRQS / 2;
88 irqt = __raw_readl(AVIC_INTTYPEH) & ~(1 << irq); 84 irqt = __raw_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq);
89 __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEH); 85 __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH);
90 } 86 }
91 87
92 return 0; 88 return 0;
@@ -97,13 +93,13 @@ EXPORT_SYMBOL(mxc_set_irq_fiq);
97/* Disable interrupt number "irq" in the AVIC */ 93/* Disable interrupt number "irq" in the AVIC */
98static void mxc_mask_irq(unsigned int irq) 94static void mxc_mask_irq(unsigned int irq)
99{ 95{
100 __raw_writel(irq, AVIC_INTDISNUM); 96 __raw_writel(irq, avic_base + AVIC_INTDISNUM);
101} 97}
102 98
103/* Enable interrupt number "irq" in the AVIC */ 99/* Enable interrupt number "irq" in the AVIC */
104static void mxc_unmask_irq(unsigned int irq) 100static void mxc_unmask_irq(unsigned int irq)
105{ 101{
106 __raw_writel(irq, AVIC_INTENNUM); 102 __raw_writel(irq, avic_base + AVIC_INTENNUM);
107} 103}
108 104
109static struct irq_chip mxc_avic_chip = { 105static struct irq_chip mxc_avic_chip = {
@@ -121,19 +117,21 @@ void __init mxc_init_irq(void)
121{ 117{
122 int i; 118 int i;
123 119
120 avic_base = IO_ADDRESS(AVIC_BASE_ADDR);
121
124 /* put the AVIC into the reset value with 122 /* put the AVIC into the reset value with
125 * all interrupts disabled 123 * all interrupts disabled
126 */ 124 */
127 __raw_writel(0, AVIC_INTCNTL); 125 __raw_writel(0, avic_base + AVIC_INTCNTL);
128 __raw_writel(0x1f, AVIC_NIMASK); 126 __raw_writel(0x1f, avic_base + AVIC_NIMASK);
129 127
130 /* disable all interrupts */ 128 /* disable all interrupts */
131 __raw_writel(0, AVIC_INTENABLEH); 129 __raw_writel(0, avic_base + AVIC_INTENABLEH);
132 __raw_writel(0, AVIC_INTENABLEL); 130 __raw_writel(0, avic_base + AVIC_INTENABLEL);
133 131
134 /* all IRQ no FIQ */ 132 /* all IRQ no FIQ */
135 __raw_writel(0, AVIC_INTTYPEH); 133 __raw_writel(0, avic_base + AVIC_INTTYPEH);
136 __raw_writel(0, AVIC_INTTYPEL); 134 __raw_writel(0, avic_base + AVIC_INTTYPEL);
137 for (i = 0; i < MXC_INTERNAL_IRQS; i++) { 135 for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
138 set_irq_chip(i, &mxc_avic_chip); 136 set_irq_chip(i, &mxc_avic_chip);
139 set_irq_handler(i, handle_level_irq); 137 set_irq_handler(i, handle_level_irq);
@@ -142,7 +140,7 @@ void __init mxc_init_irq(void)
142 140
143 /* Set default priority value (0) for all IRQ's */ 141 /* Set default priority value (0) for all IRQ's */
144 for (i = 0; i < 8; i++) 142 for (i = 0; i < 8; i++)
145 __raw_writel(0, AVIC_NIPRIORITY(i)); 143 __raw_writel(0, avic_base + AVIC_NIPRIORITY(i));
146 144
147 /* init architectures chained interrupt handler */ 145 /* init architectures chained interrupt handler */
148 mxc_register_gpios(); 146 mxc_register_gpios();
@@ -154,3 +152,4 @@ void __init mxc_init_irq(void)
154 152
155 printk(KERN_INFO "MXC IRQ initialized\n"); 153 printk(KERN_INFO "MXC IRQ initialized\n");
156} 154}
155
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index 9bffbc507cc2..ae34198a79dd 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -15,65 +15,26 @@
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/pwm.h> 17#include <linux/pwm.h>
18#include <mach/hardware.h>
19
20
21/* i.MX1 and i.MX21 share the same PWM function block: */
22
23#define MX1_PWMC 0x00 /* PWM Control Register */
24#define MX1_PWMS 0x04 /* PWM Sample Register */
25#define MX1_PWMP 0x08 /* PWM Period Register */
26
27
28/* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
29
30#define MX3_PWMCR 0x00 /* PWM Control Register */
31#define MX3_PWMSAR 0x0C /* PWM Sample Register */
32#define MX3_PWMPR 0x10 /* PWM Period Register */
33#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)
34#define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
35#define MX3_PWMCR_EN (1 << 0)
36
18 37
19#if defined CONFIG_ARCH_MX1 || defined CONFIG_ARCH_MX21
20#define PWM_VER_1
21
22#define PWMCR 0x00 /* PWM Control Register */
23#define PWMSR 0x04 /* PWM Sample Register */
24#define PWMPR 0x08 /* PWM Period Register */
25#define PWMCNR 0x0C /* PWM Counter Register */
26
27#define PWMCR_HCTR (1 << 18) /* Halfword FIFO Data Swapping */
28#define PWMCR_BCTR (1 << 17) /* Byte FIFO Data Swapping */
29#define PWMCR_SWR (1 << 16) /* Software Reset */
30#define PWMCR_CLKSRC_PERCLK (0 << 15) /* PERCLK Clock Source */
31#define PWMCR_CLKSRC_CLK32 (1 << 15) /* 32KHz Clock Source */
32#define PWMCR_PRESCALER(x) (((x - 1) & 0x7F) << 8) /* PRESCALER */
33#define PWMCR_IRQ (1 << 7) /* Interrupt Request */
34#define PWMCR_IRQEN (1 << 6) /* Interrupt Request Enable */
35#define PWMCR_FIFOAV (1 << 5) /* FIFO Available */
36#define PWMCR_EN (1 << 4) /* Enables/Disables the PWM */
37#define PWMCR_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */
38#define PWMCR_DIV(x) (((x) & 0x03) << 0) /* Clock divider 2/4/8/16 */
39
40#define MAX_DIV (128 * 16)
41#endif
42
43#if defined CONFIG_MACH_MX27 || defined CONFIG_ARCH_MX31
44#define PWM_VER_2
45
46#define PWMCR 0x00 /* PWM Control Register */
47#define PWMSR 0x04 /* PWM Status Register */
48#define PWMIR 0x08 /* PWM Interrupt Register */
49#define PWMSAR 0x0C /* PWM Sample Register */
50#define PWMPR 0x10 /* PWM Period Register */
51#define PWMCNR 0x14 /* PWM Counter Register */
52
53#define PWMCR_EN (1 << 0) /* Enables/Disables the PWM */
54#define PWMCR_REPEAT(x) (((x) & 0x03) << 1) /* Sample Repeats */
55#define PWMCR_SWR (1 << 3) /* Software Reset */
56#define PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)/* PRESCALER */
57#define PWMCR_CLKSRC(x) (((x) & 0x3) << 16)
58#define PWMCR_CLKSRC_OFF (0 << 16)
59#define PWMCR_CLKSRC_IPG (1 << 16)
60#define PWMCR_CLKSRC_IPG_HIGH (2 << 16)
61#define PWMCR_CLKSRC_CLK32 (3 << 16)
62#define PWMCR_POUTC
63#define PWMCR_HCTR (1 << 20) /* Halfword FIFO Data Swapping */
64#define PWMCR_BCTR (1 << 21) /* Byte FIFO Data Swapping */
65#define PWMCR_DBGEN (1 << 22) /* Debug Mode */
66#define PWMCR_WAITEN (1 << 23) /* Wait Mode */
67#define PWMCR_DOZEN (1 << 24) /* Doze Mode */
68#define PWMCR_STOPEN (1 << 25) /* Stop Mode */
69#define PWMCR_FWM(x) (((x) & 0x3) << 26) /* FIFO Water Mark */
70
71#define MAX_DIV 4096
72#endif
73
74#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */
75#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */
76#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */
77 38
78struct pwm_device { 39struct pwm_device {
79 struct list_head node; 40 struct list_head node;
@@ -91,32 +52,52 @@ struct pwm_device {
91 52
92int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) 53int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
93{ 54{
94 unsigned long long c;
95 unsigned long period_cycles, duty_cycles, prescale;
96
97 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) 55 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
98 return -EINVAL; 56 return -EINVAL;
99 57
100 c = clk_get_rate(pwm->clk); 58 if (cpu_is_mx27() || cpu_is_mx3()) {
101 c = c * period_ns; 59 unsigned long long c;
102 do_div(c, 1000000000); 60 unsigned long period_cycles, duty_cycles, prescale;
103 period_cycles = c; 61 c = clk_get_rate(pwm->clk);
104 62 c = c * period_ns;
105 prescale = period_cycles / 0x10000 + 1; 63 do_div(c, 1000000000);
106 64 period_cycles = c;
107 period_cycles /= prescale; 65
108 c = (unsigned long long)period_cycles * duty_ns; 66 prescale = period_cycles / 0x10000 + 1;
109 do_div(c, period_ns); 67
110 duty_cycles = c; 68 period_cycles /= prescale;
111 69 c = (unsigned long long)period_cycles * duty_ns;
112#ifdef PWM_VER_2 70 do_div(c, period_ns);
113 writel(duty_cycles, pwm->mmio_base + PWMSAR); 71 duty_cycles = c;
114 writel(period_cycles, pwm->mmio_base + PWMPR); 72
115 writel(PWMCR_PRESCALER(prescale - 1) | PWMCR_CLKSRC_IPG_HIGH | PWMCR_EN, 73 writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR);
116 pwm->mmio_base + PWMCR); 74 writel(period_cycles, pwm->mmio_base + MX3_PWMPR);
117#elif defined PWM_VER_1 75 writel(MX3_PWMCR_PRESCALER(prescale - 1) |
118#error PWM not yet working on MX1 / MX21 76 MX3_PWMCR_CLKSRC_IPG_HIGH | MX3_PWMCR_EN,
119#endif 77 pwm->mmio_base + MX3_PWMCR);
78 } else if (cpu_is_mx1() || cpu_is_mx21()) {
79 /* The PWM subsystem allows for exact frequencies. However,
80 * I cannot connect a scope on my device to the PWM line and
81 * thus cannot provide the program the PWM controller
82 * exactly. Instead, I'm relying on the fact that the
83 * Bootloader (u-boot or WinCE+haret) has programmed the PWM
84 * function group already. So I'll just modify the PWM sample
85 * register to follow the ratio of duty_ns vs. period_ns
86 * accordingly.
87 *
88 * This is good enought for programming the brightness of
89 * the LCD backlight.
90 *
91 * The real implementation would divide PERCLK[0] first by
92 * both the prescaler (/1 .. /128) and then by CLKSEL
93 * (/2 .. /16).
94 */
95 u32 max = readl(pwm->mmio_base + MX1_PWMP);
96 u32 p = max * duty_ns / period_ns;
97 writel(max - p, pwm->mmio_base + MX1_PWMS);
98 } else {
99 BUG();
100 }
120 101
121 return 0; 102 return 0;
122} 103}
@@ -297,4 +278,3 @@ module_exit(mxc_pwm_exit);
297 278
298MODULE_LICENSE("GPL v2"); 279MODULE_LICENSE("GPL v2");
299MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); 280MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
300
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index dab3357196fb..88fb3a57e029 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -29,22 +29,85 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <asm/mach/time.h> 30#include <asm/mach/time.h>
31#include <mach/common.h> 31#include <mach/common.h>
32#include <mach/mxc_timer.h> 32
33/* defines common for all i.MX */
34#define MXC_TCTL 0x00
35#define MXC_TCTL_TEN (1 << 0)
36#define MXC_TPRER 0x04
37
38/* MX1, MX21, MX27 */
39#define MX1_2_TCTL_CLK_PCLK1 (1 << 1)
40#define MX1_2_TCTL_IRQEN (1 << 4)
41#define MX1_2_TCTL_FRR (1 << 8)
42#define MX1_2_TCMP 0x08
43#define MX1_2_TCN 0x10
44#define MX1_2_TSTAT 0x14
45
46/* MX21, MX27 */
47#define MX2_TSTAT_CAPT (1 << 1)
48#define MX2_TSTAT_COMP (1 << 0)
49
50/* MX31, MX35 */
51#define MX3_TCTL_WAITEN (1 << 3)
52#define MX3_TCTL_CLK_IPG (1 << 6)
53#define MX3_TCTL_FRR (1 << 9)
54#define MX3_IR 0x0c
55#define MX3_TSTAT 0x08
56#define MX3_TSTAT_OF1 (1 << 0)
57#define MX3_TCN 0x24
58#define MX3_TCMP 0x10
33 59
34static struct clock_event_device clockevent_mxc; 60static struct clock_event_device clockevent_mxc;
35static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; 61static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
36 62
37/* clock source */ 63static void __iomem *timer_base;
38 64
39static cycle_t mxc_get_cycles(struct clocksource *cs) 65static inline void gpt_irq_disable(void)
40{ 66{
41 return __raw_readl(TIMER_BASE + MXC_TCN); 67 unsigned int tmp;
68
69 if (cpu_is_mx3())
70 __raw_writel(0, timer_base + MX3_IR);
71 else {
72 tmp = __raw_readl(timer_base + MXC_TCTL);
73 __raw_writel(tmp & ~MX1_2_TCTL_IRQEN, timer_base + MXC_TCTL);
74 }
75}
76
77static inline void gpt_irq_enable(void)
78{
79 if (cpu_is_mx3())
80 __raw_writel(1<<0, timer_base + MX3_IR);
81 else {
82 __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN,
83 timer_base + MXC_TCTL);
84 }
85}
86
87static void gpt_irq_acknowledge(void)
88{
89 if (cpu_is_mx1())
90 __raw_writel(0, timer_base + MX1_2_TSTAT);
91 if (cpu_is_mx2())
92 __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT);
93 if (cpu_is_mx3())
94 __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT);
95}
96
97static cycle_t mx1_2_get_cycles(struct clocksource *cs)
98{
99 return __raw_readl(timer_base + MX1_2_TCN);
100}
101
102static cycle_t mx3_get_cycles(struct clocksource *cs)
103{
104 return __raw_readl(timer_base + MX3_TCN);
42} 105}
43 106
44static struct clocksource clocksource_mxc = { 107static struct clocksource clocksource_mxc = {
45 .name = "mxc_timer1", 108 .name = "mxc_timer1",
46 .rating = 200, 109 .rating = 200,
47 .read = mxc_get_cycles, 110 .read = mx1_2_get_cycles,
48 .mask = CLOCKSOURCE_MASK(32), 111 .mask = CLOCKSOURCE_MASK(32),
49 .shift = 20, 112 .shift = 20,
50 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 113 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
@@ -54,6 +117,9 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
54{ 117{
55 unsigned int c = clk_get_rate(timer_clk); 118 unsigned int c = clk_get_rate(timer_clk);
56 119
120 if (cpu_is_mx3())
121 clocksource_mxc.read = mx3_get_cycles;
122
57 clocksource_mxc.mult = clocksource_hz2mult(c, 123 clocksource_mxc.mult = clocksource_hz2mult(c,
58 clocksource_mxc.shift); 124 clocksource_mxc.shift);
59 clocksource_register(&clocksource_mxc); 125 clocksource_register(&clocksource_mxc);
@@ -63,15 +129,29 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
63 129
64/* clock event */ 130/* clock event */
65 131
66static int mxc_set_next_event(unsigned long evt, 132static int mx1_2_set_next_event(unsigned long evt,
67 struct clock_event_device *unused) 133 struct clock_event_device *unused)
68{ 134{
69 unsigned long tcmp; 135 unsigned long tcmp;
70 136
71 tcmp = __raw_readl(TIMER_BASE + MXC_TCN) + evt; 137 tcmp = __raw_readl(timer_base + MX1_2_TCN) + evt;
72 __raw_writel(tcmp, TIMER_BASE + MXC_TCMP);
73 138
74 return (int)(tcmp - __raw_readl(TIMER_BASE + MXC_TCN)) < 0 ? 139 __raw_writel(tcmp, timer_base + MX1_2_TCMP);
140
141 return (int)(tcmp - __raw_readl(timer_base + MX1_2_TCN)) < 0 ?
142 -ETIME : 0;
143}
144
145static int mx3_set_next_event(unsigned long evt,
146 struct clock_event_device *unused)
147{
148 unsigned long tcmp;
149
150 tcmp = __raw_readl(timer_base + MX3_TCN) + evt;
151
152 __raw_writel(tcmp, timer_base + MX3_TCMP);
153
154 return (int)(tcmp - __raw_readl(timer_base + MX3_TCN)) < 0 ?
75 -ETIME : 0; 155 -ETIME : 0;
76} 156}
77 157
@@ -100,8 +180,13 @@ static void mxc_set_mode(enum clock_event_mode mode,
100 180
101 if (mode != clockevent_mode) { 181 if (mode != clockevent_mode) {
102 /* Set event time into far-far future */ 182 /* Set event time into far-far future */
103 __raw_writel(__raw_readl(TIMER_BASE + MXC_TCN) - 3, 183 if (cpu_is_mx3())
104 TIMER_BASE + MXC_TCMP); 184 __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3,
185 timer_base + MX3_TCMP);
186 else
187 __raw_writel(__raw_readl(timer_base + MX1_2_TCN) - 3,
188 timer_base + MX1_2_TCMP);
189
105 /* Clear pending interrupt */ 190 /* Clear pending interrupt */
106 gpt_irq_acknowledge(); 191 gpt_irq_acknowledge();
107 } 192 }
@@ -148,7 +233,10 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
148 struct clock_event_device *evt = &clockevent_mxc; 233 struct clock_event_device *evt = &clockevent_mxc;
149 uint32_t tstat; 234 uint32_t tstat;
150 235
151 tstat = __raw_readl(TIMER_BASE + MXC_TSTAT); 236 if (cpu_is_mx3())
237 tstat = __raw_readl(timer_base + MX3_TSTAT);
238 else
239 tstat = __raw_readl(timer_base + MX1_2_TSTAT);
152 240
153 gpt_irq_acknowledge(); 241 gpt_irq_acknowledge();
154 242
@@ -168,7 +256,7 @@ static struct clock_event_device clockevent_mxc = {
168 .features = CLOCK_EVT_FEAT_ONESHOT, 256 .features = CLOCK_EVT_FEAT_ONESHOT,
169 .shift = 32, 257 .shift = 32,
170 .set_mode = mxc_set_mode, 258 .set_mode = mxc_set_mode,
171 .set_next_event = mxc_set_next_event, 259 .set_next_event = mx1_2_set_next_event,
172 .rating = 200, 260 .rating = 200,
173}; 261};
174 262
@@ -176,6 +264,9 @@ static int __init mxc_clockevent_init(struct clk *timer_clk)
176{ 264{
177 unsigned int c = clk_get_rate(timer_clk); 265 unsigned int c = clk_get_rate(timer_clk);
178 266
267 if (cpu_is_mx3())
268 clockevent_mxc.set_next_event = mx3_set_next_event;
269
179 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, 270 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
180 clockevent_mxc.shift); 271 clockevent_mxc.shift);
181 clockevent_mxc.max_delta_ns = 272 clockevent_mxc.max_delta_ns =
@@ -192,23 +283,47 @@ static int __init mxc_clockevent_init(struct clk *timer_clk)
192 283
193void __init mxc_timer_init(struct clk *timer_clk) 284void __init mxc_timer_init(struct clk *timer_clk)
194{ 285{
286 uint32_t tctl_val;
287 int irq;
288
195 clk_enable(timer_clk); 289 clk_enable(timer_clk);
196 290
291 if (cpu_is_mx1()) {
292#ifdef CONFIG_ARCH_MX1
293 timer_base = IO_ADDRESS(TIM1_BASE_ADDR);
294 irq = TIM1_INT;
295#endif
296 } else if (cpu_is_mx2()) {
297#ifdef CONFIG_ARCH_MX2
298 timer_base = IO_ADDRESS(GPT1_BASE_ADDR);
299 irq = MXC_INT_GPT1;
300#endif
301 } else if (cpu_is_mx3()) {
302#ifdef CONFIG_ARCH_MX3
303 timer_base = IO_ADDRESS(GPT1_BASE_ADDR);
304 irq = MXC_INT_GPT;
305#endif
306 } else
307 BUG();
308
197 /* 309 /*
198 * Initialise to a known state (all timers off, and timing reset) 310 * Initialise to a known state (all timers off, and timing reset)
199 */ 311 */
200 __raw_writel(0, TIMER_BASE + MXC_TCTL);
201 __raw_writel(0, TIMER_BASE + MXC_TPRER); /* see datasheet note */
202 312
203 __raw_writel(TCTL_FRR | /* free running */ 313 __raw_writel(0, timer_base + MXC_TCTL);
204 TCTL_VAL | /* set clocksource and arch specific bits */ 314 __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */
205 TCTL_TEN, /* start the timer */ 315
206 TIMER_BASE + MXC_TCTL); 316 if (cpu_is_mx3())
317 tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN;
318 else
319 tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
320
321 __raw_writel(tctl_val, timer_base + MXC_TCTL);
207 322
208 /* init and register the timer to the framework */ 323 /* init and register the timer to the framework */
209 mxc_clocksource_init(timer_clk); 324 mxc_clocksource_init(timer_clk);
210 mxc_clockevent_init(timer_clk); 325 mxc_clockevent_init(timer_clk);
211 326
212 /* Make irqs happen */ 327 /* Make irqs happen */
213 setup_irq(TIMER_INTERRUPT, &mxc_timer_irq); 328 setup_irq(irq, &mxc_timer_irq);
214} 329}
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 9dd68fafb374..efe85d095190 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -23,6 +23,11 @@ config ARCH_OMAP3
23 select CPU_V7 23 select CPU_V7
24 select COMMON_CLKDEV 24 select COMMON_CLKDEV
25 25
26config ARCH_OMAP4
27 bool "TI OMAP4"
28 select CPU_V7
29 select ARM_GIC
30
26endchoice 31endchoice
27 32
28comment "OMAP Feature Selections" 33comment "OMAP Feature Selections"
@@ -40,7 +45,6 @@ config OMAP_DEBUG_LEDS
40config OMAP_DEBUG_POWERDOMAIN 45config OMAP_DEBUG_POWERDOMAIN
41 bool "Emit debug messages from powerdomain layer" 46 bool "Emit debug messages from powerdomain layer"
42 depends on ARCH_OMAP2 || ARCH_OMAP3 47 depends on ARCH_OMAP2 || ARCH_OMAP3
43 default n
44 help 48 help
45 Say Y here if you want to compile in powerdomain layer 49 Say Y here if you want to compile in powerdomain layer
46 debugging messages for OMAP2/3. These messages can 50 debugging messages for OMAP2/3. These messages can
@@ -52,7 +56,6 @@ config OMAP_DEBUG_POWERDOMAIN
52config OMAP_DEBUG_CLOCKDOMAIN 56config OMAP_DEBUG_CLOCKDOMAIN
53 bool "Emit debug messages from clockdomain layer" 57 bool "Emit debug messages from clockdomain layer"
54 depends on ARCH_OMAP2 || ARCH_OMAP3 58 depends on ARCH_OMAP2 || ARCH_OMAP3
55 default n
56 help 59 help
57 Say Y here if you want to compile in clockdomain layer 60 Say Y here if you want to compile in clockdomain layer
58 debugging messages for OMAP2/3. These messages can 61 debugging messages for OMAP2/3. These messages can
@@ -110,11 +113,13 @@ config OMAP_MCBSP
110config OMAP_MBOX_FWK 113config OMAP_MBOX_FWK
111 tristate "Mailbox framework support" 114 tristate "Mailbox framework support"
112 depends on ARCH_OMAP 115 depends on ARCH_OMAP
113 default n
114 help 116 help
115 Say Y here if you want to use OMAP Mailbox framework support for 117 Say Y here if you want to use OMAP Mailbox framework support for
116 DSP, IVA1.0 and IVA2 in OMAP1/2/3. 118 DSP, IVA1.0 and IVA2 in OMAP1/2/3.
117 119
120config OMAP_IOMMU
121 tristate
122
118choice 123choice
119 prompt "System timer" 124 prompt "System timer"
120 default OMAP_MPU_TIMER 125 default OMAP_MPU_TIMER
@@ -128,13 +133,13 @@ config OMAP_MPU_TIMER
128 133
129config OMAP_32K_TIMER 134config OMAP_32K_TIMER
130 bool "Use 32KHz timer" 135 bool "Use 32KHz timer"
131 depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX 136 depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX || ARCH_OMAP4
132 help 137 help
133 Select this option if you want to enable the OMAP 32KHz timer. 138 Select this option if you want to enable the OMAP 32KHz timer.
134 This timer saves power compared to the OMAP_MPU_TIMER, and has 139 This timer saves power compared to the OMAP_MPU_TIMER, and has
135 support for no tick during idle. The 32KHz timer provides less 140 support for no tick during idle. The 32KHz timer provides less
136 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is 141 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
137 currently only available for OMAP16XX, 24XX and 34XX. 142 currently only available for OMAP16XX, 24XX, 34XX and OMAP4.
138 143
139endchoice 144endchoice
140 145
@@ -149,7 +154,7 @@ config OMAP_32K_TIMER_HZ
149 154
150config OMAP_DM_TIMER 155config OMAP_DM_TIMER
151 bool "Use dual-mode timer" 156 bool "Use dual-mode timer"
152 depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX 157 depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX || ARCH_OMAP4
153 help 158 help
154 Select this option if you want to use OMAP Dual-Mode timers. 159 Select this option if you want to use OMAP Dual-Mode timers.
155 160
@@ -171,7 +176,7 @@ endchoice
171 176
172config OMAP_SERIAL_WAKE 177config OMAP_SERIAL_WAKE
173 bool "Enable wake-up events for serial ports" 178 bool "Enable wake-up events for serial ports"
174 depends on OMAP_MUX 179 depends on ARCH_OMAP1 && OMAP_MUX
175 default y 180 default y
176 help 181 help
177 Select this option if you want to have your system wake up 182 Select this option if you want to have your system wake up
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 04a100cfb8e5..a83279523958 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -13,6 +13,7 @@ obj- :=
13obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o 13obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
14 14
15obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 15obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
16obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o
16 17
17obj-$(CONFIG_CPU_FREQ) += cpu-omap.o 18obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
18obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o 19obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 29efc279287a..e8c327a45a55 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -36,10 +36,40 @@ static struct clk_functions *arch_clock;
36 * Standard clock functions defined in include/linux/clk.h 36 * Standard clock functions defined in include/linux/clk.h
37 *-------------------------------------------------------------------------*/ 37 *-------------------------------------------------------------------------*/
38 38
39/* This functions is moved to arch/arm/common/clkdev.c. For OMAP4 since
40 * clock framework is not up , it is defined here to avoid rework in
41 * every driver. Also dummy prcm reset function is added */
42
43/* Dummy hooks only for OMAP4.For rest OMAPs, common clkdev is used */
44#if defined(CONFIG_ARCH_OMAP4)
45struct clk *clk_get(struct device *dev, const char *id)
46{
47 return NULL;
48}
49EXPORT_SYMBOL(clk_get);
50
51void clk_put(struct clk *clk)
52{
53}
54EXPORT_SYMBOL(clk_put);
55
56void omap2_clk_prepare_for_reboot(void)
57{
58}
59EXPORT_SYMBOL(omap2_clk_prepare_for_reboot);
60
61void omap_prcm_arch_reset(char mode)
62{
63}
64EXPORT_SYMBOL(omap_prcm_arch_reset);
65#endif
39int clk_enable(struct clk *clk) 66int clk_enable(struct clk *clk)
40{ 67{
41 unsigned long flags; 68 unsigned long flags;
42 int ret = 0; 69 int ret = 0;
70 if (cpu_is_omap44xx())
71 /* OMAP4 clk framework not supported yet */
72 return 0;
43 73
44 if (clk == NULL || IS_ERR(clk)) 74 if (clk == NULL || IS_ERR(clk))
45 return -EINVAL; 75 return -EINVAL;
@@ -140,6 +170,9 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
140 unsigned long flags; 170 unsigned long flags;
141 int ret = -EINVAL; 171 int ret = -EINVAL;
142 172
173 if (cpu_is_omap44xx())
174 /* OMAP4 clk framework not supported yet */
175 return 0;
143 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) 176 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
144 return ret; 177 return ret;
145 178
@@ -240,13 +273,13 @@ void recalculate_root_clocks(void)
240} 273}
241 274
242/** 275/**
243 * clk_init_one - initialize any fields in the struct clk before clk init 276 * clk_preinit - initialize any fields in the struct clk before clk init
244 * @clk: struct clk * to initialize 277 * @clk: struct clk * to initialize
245 * 278 *
246 * Initialize any struct clk fields needed before normal clk initialization 279 * Initialize any struct clk fields needed before normal clk initialization
247 * can run. No return value. 280 * can run. No return value.
248 */ 281 */
249void clk_init_one(struct clk *clk) 282void clk_preinit(struct clk *clk)
250{ 283{
251 INIT_LIST_HEAD(&clk->children); 284 INIT_LIST_HEAD(&clk->children);
252} 285}
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 433021f3d7cc..ebcf006406f9 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -2,6 +2,10 @@
2 * linux/arch/arm/plat-omap/common.c 2 * linux/arch/arm/plat-omap/common.c
3 * 3 *
4 * Code common to all OMAP machines. 4 * Code common to all OMAP machines.
5 * The file is created by Tony Lindgren <tony@atomide.com>
6 *
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
5 * 9 *
6 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -11,7 +15,6 @@
11#include <linux/kernel.h> 15#include <linux/kernel.h>
12#include <linux/init.h> 16#include <linux/init.h>
13#include <linux/delay.h> 17#include <linux/delay.h>
14#include <linux/pm.h>
15#include <linux/console.h> 18#include <linux/console.h>
16#include <linux/serial.h> 19#include <linux/serial.h>
17#include <linux/tty.h> 20#include <linux/tty.h>
@@ -175,25 +178,70 @@ console_initcall(omap_add_serial_console);
175 * but systems won't necessarily want to spend resources that way. 178 * but systems won't necessarily want to spend resources that way.
176 */ 179 */
177 180
178#if defined(CONFIG_ARCH_OMAP16XX) 181#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410
179#define TIMER_32K_SYNCHRONIZED 0xfffbc410
180#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
181#define TIMER_32K_SYNCHRONIZED (OMAP2_32KSYNCT_BASE + 0x10)
182#endif
183 182
184#ifdef TIMER_32K_SYNCHRONIZED 183#if !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX))
185 184
186#include <linux/clocksource.h> 185#include <linux/clocksource.h>
187 186
188static cycle_t omap_32k_read(struct clocksource *cs) 187#ifdef CONFIG_ARCH_OMAP16XX
188static cycle_t omap16xx_32k_read(struct clocksource *cs)
189{
190 return omap_readl(OMAP16XX_TIMER_32K_SYNCHRONIZED);
191}
192#else
193#define omap16xx_32k_read NULL
194#endif
195
196#ifdef CONFIG_ARCH_OMAP2420
197static cycle_t omap2420_32k_read(struct clocksource *cs)
198{
199 return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10);
200}
201#else
202#define omap2420_32k_read NULL
203#endif
204
205#ifdef CONFIG_ARCH_OMAP2430
206static cycle_t omap2430_32k_read(struct clocksource *cs)
207{
208 return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10);
209}
210#else
211#define omap2430_32k_read NULL
212#endif
213
214#ifdef CONFIG_ARCH_OMAP34XX
215static cycle_t omap34xx_32k_read(struct clocksource *cs)
216{
217 return omap_readl(OMAP3430_32KSYNCT_BASE + 0x10);
218}
219#else
220#define omap34xx_32k_read NULL
221#endif
222
223#ifdef CONFIG_ARCH_OMAP4
224static cycle_t omap44xx_32k_read(struct clocksource *cs)
189{ 225{
190 return omap_readl(TIMER_32K_SYNCHRONIZED); 226 return omap_readl(OMAP4430_32KSYNCT_BASE + 0x10);
227}
228#else
229#define omap44xx_32k_read NULL
230#endif
231
232/*
233 * Kernel assumes that sched_clock can be called early but may not have
234 * things ready yet.
235 */
236static cycle_t omap_32k_read_dummy(struct clocksource *cs)
237{
238 return 0;
191} 239}
192 240
193static struct clocksource clocksource_32k = { 241static struct clocksource clocksource_32k = {
194 .name = "32k_counter", 242 .name = "32k_counter",
195 .rating = 250, 243 .rating = 250,
196 .read = omap_32k_read, 244 .read = omap_32k_read_dummy,
197 .mask = CLOCKSOURCE_MASK(32), 245 .mask = CLOCKSOURCE_MASK(32),
198 .shift = 10, 246 .shift = 10,
199 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 247 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
@@ -207,7 +255,7 @@ unsigned long long sched_clock(void)
207{ 255{
208 unsigned long long ret; 256 unsigned long long ret;
209 257
210 ret = (unsigned long long)omap_32k_read(&clocksource_32k); 258 ret = (unsigned long long)clocksource_32k.read(&clocksource_32k);
211 ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift; 259 ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift;
212 return ret; 260 return ret;
213} 261}
@@ -220,6 +268,19 @@ static int __init omap_init_clocksource_32k(void)
220 if (cpu_is_omap16xx() || cpu_class_is_omap2()) { 268 if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
221 struct clk *sync_32k_ick; 269 struct clk *sync_32k_ick;
222 270
271 if (cpu_is_omap16xx())
272 clocksource_32k.read = omap16xx_32k_read;
273 else if (cpu_is_omap2420())
274 clocksource_32k.read = omap2420_32k_read;
275 else if (cpu_is_omap2430())
276 clocksource_32k.read = omap2430_32k_read;
277 else if (cpu_is_omap34xx())
278 clocksource_32k.read = omap34xx_32k_read;
279 else if (cpu_is_omap44xx())
280 clocksource_32k.read = omap44xx_32k_read;
281 else
282 return -ENODEV;
283
223 sync_32k_ick = clk_get(NULL, "omap_32ksync_ick"); 284 sync_32k_ick = clk_get(NULL, "omap_32ksync_ick");
224 if (sync_32k_ick) 285 if (sync_32k_ick)
225 clk_enable(sync_32k_ick); 286 clk_enable(sync_32k_ick);
@@ -234,15 +295,13 @@ static int __init omap_init_clocksource_32k(void)
234} 295}
235arch_initcall(omap_init_clocksource_32k); 296arch_initcall(omap_init_clocksource_32k);
236 297
237#endif /* TIMER_32K_SYNCHRONIZED */ 298#endif /* !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX)) */
238 299
239/* Global address base setup code */ 300/* Global address base setup code */
240 301
241#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 302#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
242 303
243static struct omap_globals *omap2_globals; 304static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
244
245static void __init __omap2_set_globals(void)
246{ 305{
247 omap2_set_globals_tap(omap2_globals); 306 omap2_set_globals_tap(omap2_globals);
248 omap2_set_globals_sdrc(omap2_globals); 307 omap2_set_globals_sdrc(omap2_globals);
@@ -266,8 +325,7 @@ static struct omap_globals omap242x_globals = {
266 325
267void __init omap2_set_globals_242x(void) 326void __init omap2_set_globals_242x(void)
268{ 327{
269 omap2_globals = &omap242x_globals; 328 __omap2_set_globals(&omap242x_globals);
270 __omap2_set_globals();
271} 329}
272#endif 330#endif
273 331
@@ -285,8 +343,7 @@ static struct omap_globals omap243x_globals = {
285 343
286void __init omap2_set_globals_243x(void) 344void __init omap2_set_globals_243x(void)
287{ 345{
288 omap2_globals = &omap243x_globals; 346 __omap2_set_globals(&omap243x_globals);
289 __omap2_set_globals();
290} 347}
291#endif 348#endif
292 349
@@ -304,8 +361,23 @@ static struct omap_globals omap343x_globals = {
304 361
305void __init omap2_set_globals_343x(void) 362void __init omap2_set_globals_343x(void)
306{ 363{
307 omap2_globals = &omap343x_globals; 364 __omap2_set_globals(&omap343x_globals);
308 __omap2_set_globals(); 365}
366#endif
367
368#if defined(CONFIG_ARCH_OMAP4)
369static struct omap_globals omap4_globals = {
370 .class = OMAP443X_CLASS,
371 .tap = OMAP2_IO_ADDRESS(0x4830a000),
372 .ctrl = OMAP2_IO_ADDRESS(OMAP443X_CTRL_BASE),
373 .prm = OMAP2_IO_ADDRESS(OMAP4430_PRM_BASE),
374 .cm = OMAP2_IO_ADDRESS(OMAP4430_CM_BASE),
375};
376
377void __init omap2_set_globals_443x(void)
378{
379 omap2_set_globals_tap(&omap4_globals);
380 omap2_set_globals_control(&omap4_globals);
309} 381}
310#endif 382#endif
311 383
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 87fb7ff41794..a64b692a1bfe 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -311,6 +311,8 @@ static void omap_init_wdt(void)
311 wdt_resources[0].start = 0x49016000; /* WDT2 */ 311 wdt_resources[0].start = 0x49016000; /* WDT2 */
312 else if (cpu_is_omap343x()) 312 else if (cpu_is_omap343x())
313 wdt_resources[0].start = 0x48314000; /* WDT2 */ 313 wdt_resources[0].start = 0x48314000; /* WDT2 */
314 else if (cpu_is_omap44xx())
315 wdt_resources[0].start = 0x4a314000;
314 else 316 else
315 return; 317 return;
316 318
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 7fc8c045ad5d..def14ec265b3 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -10,6 +10,9 @@
10 * Merged to support both OMAP1 and OMAP2 by Tony Lindgren <tony@atomide.com> 10 * Merged to support both OMAP1 and OMAP2 by Tony Lindgren <tony@atomide.com>
11 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc. 11 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
12 * 12 *
13 * Copyright (C) 2009 Texas Instruments
14 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
15 *
13 * Support functions for the OMAP internal DMA channels. 16 * Support functions for the OMAP internal DMA channels.
14 * 17 *
15 * This program is free software; you can redistribute it and/or modify 18 * This program is free software; you can redistribute it and/or modify
@@ -310,41 +313,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params);
310 313
311void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) 314void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
312{ 315{
313 u16 w;
314
315 BUG_ON(omap_dma_in_1510_mode()); 316 BUG_ON(omap_dma_in_1510_mode());
316 317
317 if (cpu_class_is_omap2()) { 318 if (cpu_class_is_omap1()) {
318 REVISIT_24XX(); 319 u16 w;
319 return;
320 }
321 320
322 w = dma_read(CCR2(lch)); 321 w = dma_read(CCR2(lch));
323 w &= ~0x03; 322 w &= ~0x03;
324 323
325 switch (mode) { 324 switch (mode) {
326 case OMAP_DMA_CONSTANT_FILL: 325 case OMAP_DMA_CONSTANT_FILL:
327 w |= 0x01; 326 w |= 0x01;
328 break; 327 break;
329 case OMAP_DMA_TRANSPARENT_COPY: 328 case OMAP_DMA_TRANSPARENT_COPY:
330 w |= 0x02; 329 w |= 0x02;
331 break; 330 break;
332 case OMAP_DMA_COLOR_DIS: 331 case OMAP_DMA_COLOR_DIS:
333 break; 332 break;
334 default: 333 default:
335 BUG(); 334 BUG();
335 }
336 dma_write(w, CCR2(lch));
337
338 w = dma_read(LCH_CTRL(lch));
339 w &= ~0x0f;
340 /* Default is channel type 2D */
341 if (mode) {
342 dma_write((u16)color, COLOR_L(lch));
343 dma_write((u16)(color >> 16), COLOR_U(lch));
344 w |= 1; /* Channel type G */
345 }
346 dma_write(w, LCH_CTRL(lch));
336 } 347 }
337 dma_write(w, CCR2(lch));
338 348
339 w = dma_read(LCH_CTRL(lch)); 349 if (cpu_class_is_omap2()) {
340 w &= ~0x0f; 350 u32 val;
341 /* Default is channel type 2D */ 351
342 if (mode) { 352 val = dma_read(CCR(lch));
343 dma_write((u16)color, COLOR_L(lch)); 353 val &= ~((1 << 17) | (1 << 16));
344 dma_write((u16)(color >> 16), COLOR_U(lch)); 354
345 w |= 1; /* Channel type G */ 355 switch (mode) {
356 case OMAP_DMA_CONSTANT_FILL:
357 val |= 1 << 16;
358 break;
359 case OMAP_DMA_TRANSPARENT_COPY:
360 val |= 1 << 17;
361 break;
362 case OMAP_DMA_COLOR_DIS:
363 break;
364 default:
365 BUG();
366 }
367 dma_write(val, CCR(lch));
368
369 color &= 0xffffff;
370 dma_write(color, COLOR(lch));
346 } 371 }
347 dma_write(w, LCH_CTRL(lch));
348} 372}
349EXPORT_SYMBOL(omap_set_dma_color_mode); 373EXPORT_SYMBOL(omap_set_dma_color_mode);
350 374
@@ -851,7 +875,7 @@ omap_dma_set_prio_lch(int lch, unsigned char read_prio,
851 } 875 }
852 l = dma_read(CCR(lch)); 876 l = dma_read(CCR(lch));
853 l &= ~((1 << 6) | (1 << 26)); 877 l &= ~((1 << 6) | (1 << 26));
854 if (cpu_is_omap2430() || cpu_is_omap34xx()) 878 if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx())
855 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26); 879 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
856 else 880 else
857 l |= ((read_prio & 0x1) << 6); 881 l |= ((read_prio & 0x1) << 6);
@@ -1199,7 +1223,7 @@ static void create_dma_lch_chain(int lch_head, int lch_queue)
1199 * Failure: -EINVAL/-ENOMEM 1223 * Failure: -EINVAL/-ENOMEM
1200 */ 1224 */
1201int omap_request_dma_chain(int dev_id, const char *dev_name, 1225int omap_request_dma_chain(int dev_id, const char *dev_name,
1202 void (*callback) (int chain_id, u16 ch_status, 1226 void (*callback) (int lch, u16 ch_status,
1203 void *data), 1227 void *data),
1204 int *chain_id, int no_of_chans, int chain_mode, 1228 int *chain_id, int no_of_chans, int chain_mode,
1205 struct omap_dma_channel_params params) 1229 struct omap_dma_channel_params params)
@@ -1823,7 +1847,8 @@ static irqreturn_t omap1_dma_irq_handler(int irq, void *dev_id)
1823#define omap1_dma_irq_handler NULL 1847#define omap1_dma_irq_handler NULL
1824#endif 1848#endif
1825 1849
1826#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 1850#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
1851 defined(CONFIG_ARCH_OMAP4)
1827 1852
1828static int omap2_dma_handle_ch(int ch) 1853static int omap2_dma_handle_ch(int ch)
1829{ 1854{
@@ -2318,6 +2343,9 @@ static int __init omap_init_dma(void)
2318 } else if (cpu_is_omap34xx()) { 2343 } else if (cpu_is_omap34xx()) {
2319 omap_dma_base = IO_ADDRESS(OMAP34XX_DMA4_BASE); 2344 omap_dma_base = IO_ADDRESS(OMAP34XX_DMA4_BASE);
2320 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; 2345 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2346 } else if (cpu_is_omap44xx()) {
2347 omap_dma_base = IO_ADDRESS(OMAP44XX_DMA4_BASE);
2348 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2321 } else { 2349 } else {
2322 pr_err("DMA init failed for unsupported omap\n"); 2350 pr_err("DMA init failed for unsupported omap\n");
2323 return -ENODEV; 2351 return -ENODEV;
@@ -2416,12 +2444,18 @@ static int __init omap_init_dma(void)
2416 } 2444 }
2417 } 2445 }
2418 2446
2419 if (cpu_is_omap2430() || cpu_is_omap34xx()) 2447 if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx())
2420 omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, 2448 omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE,
2421 DMA_DEFAULT_FIFO_DEPTH, 0); 2449 DMA_DEFAULT_FIFO_DEPTH, 0);
2422 2450
2423 if (cpu_class_is_omap2()) 2451 if (cpu_class_is_omap2()) {
2424 setup_irq(INT_24XX_SDMA_IRQ0, &omap24xx_dma_irq); 2452 int irq;
2453 if (cpu_is_omap44xx())
2454 irq = INT_44XX_SDMA_IRQ0;
2455 else
2456 irq = INT_24XX_SDMA_IRQ0;
2457 setup_irq(irq, &omap24xx_dma_irq);
2458 }
2425 2459
2426 /* FIXME: Update LCD DMA to work on 24xx */ 2460 /* FIXME: Update LCD DMA to work on 24xx */
2427 if (cpu_class_is_omap1()) { 2461 if (cpu_class_is_omap1()) {
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 55bb99631292..7f50b6103dee 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -7,6 +7,9 @@
7 * OMAP2 support by Juha Yrjola 7 * OMAP2 support by Juha Yrjola
8 * API improvements and OMAP2 clock framework support by Timo Teras 8 * API improvements and OMAP2 clock framework support by Timo Teras
9 * 9 *
10 * Copyright (C) 2009 Texas Instruments
11 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
12 *
10 * This program is free software; you can redistribute it and/or modify it 13 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 14 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your 15 * Free Software Foundation; either version 2 of the License, or (at your
@@ -150,7 +153,8 @@
150struct omap_dm_timer { 153struct omap_dm_timer {
151 unsigned long phys_base; 154 unsigned long phys_base;
152 int irq; 155 int irq;
153#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 156#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
157 defined(CONFIG_ARCH_OMAP4)
154 struct clk *iclk, *fclk; 158 struct clk *iclk, *fclk;
155#endif 159#endif
156 void __iomem *io_base; 160 void __iomem *io_base;
@@ -169,6 +173,9 @@ struct omap_dm_timer {
169#define omap3_dm_timers NULL 173#define omap3_dm_timers NULL
170#define omap3_dm_source_names NULL 174#define omap3_dm_source_names NULL
171#define omap3_dm_source_clocks NULL 175#define omap3_dm_source_clocks NULL
176#define omap4_dm_timers NULL
177#define omap4_dm_source_names NULL
178#define omap4_dm_source_clocks NULL
172 179
173static struct omap_dm_timer omap1_dm_timers[] = { 180static struct omap_dm_timer omap1_dm_timers[] = {
174 { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 }, 181 { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 },
@@ -191,6 +198,9 @@ static const int dm_timer_count = ARRAY_SIZE(omap1_dm_timers);
191#define omap3_dm_timers NULL 198#define omap3_dm_timers NULL
192#define omap3_dm_source_names NULL 199#define omap3_dm_source_names NULL
193#define omap3_dm_source_clocks NULL 200#define omap3_dm_source_clocks NULL
201#define omap4_dm_timers NULL
202#define omap4_dm_source_names NULL
203#define omap4_dm_source_clocks NULL
194 204
195static struct omap_dm_timer omap2_dm_timers[] = { 205static struct omap_dm_timer omap2_dm_timers[] = {
196 { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 }, 206 { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 },
@@ -214,7 +224,7 @@ static const char *omap2_dm_source_names[] __initdata = {
214 NULL 224 NULL
215}; 225};
216 226
217static struct clk **omap2_dm_source_clocks[3]; 227static struct clk *omap2_dm_source_clocks[3];
218static const int dm_timer_count = ARRAY_SIZE(omap2_dm_timers); 228static const int dm_timer_count = ARRAY_SIZE(omap2_dm_timers);
219 229
220#elif defined(CONFIG_ARCH_OMAP3) 230#elif defined(CONFIG_ARCH_OMAP3)
@@ -225,6 +235,9 @@ static const int dm_timer_count = ARRAY_SIZE(omap2_dm_timers);
225#define omap2_dm_timers NULL 235#define omap2_dm_timers NULL
226#define omap2_dm_source_names NULL 236#define omap2_dm_source_names NULL
227#define omap2_dm_source_clocks NULL 237#define omap2_dm_source_clocks NULL
238#define omap4_dm_timers NULL
239#define omap4_dm_source_names NULL
240#define omap4_dm_source_clocks NULL
228 241
229static struct omap_dm_timer omap3_dm_timers[] = { 242static struct omap_dm_timer omap3_dm_timers[] = {
230 { .phys_base = 0x48318000, .irq = INT_24XX_GPTIMER1 }, 243 { .phys_base = 0x48318000, .irq = INT_24XX_GPTIMER1 },
@@ -247,9 +260,43 @@ static const char *omap3_dm_source_names[] __initdata = {
247 NULL 260 NULL
248}; 261};
249 262
250static struct clk **omap3_dm_source_clocks[2]; 263static struct clk *omap3_dm_source_clocks[2];
251static const int dm_timer_count = ARRAY_SIZE(omap3_dm_timers); 264static const int dm_timer_count = ARRAY_SIZE(omap3_dm_timers);
252 265
266#elif defined(CONFIG_ARCH_OMAP4)
267
268#define omap_dm_clk_enable(x) clk_enable(x)
269#define omap_dm_clk_disable(x) clk_disable(x)
270#define omap1_dm_timers NULL
271#define omap2_dm_timers NULL
272#define omap2_dm_source_names NULL
273#define omap2_dm_source_clocks NULL
274#define omap3_dm_timers NULL
275#define omap3_dm_source_names NULL
276#define omap3_dm_source_clocks NULL
277
278static struct omap_dm_timer omap4_dm_timers[] = {
279 { .phys_base = 0x4a318000, .irq = INT_44XX_GPTIMER1 },
280 { .phys_base = 0x48032000, .irq = INT_44XX_GPTIMER2 },
281 { .phys_base = 0x48034000, .irq = INT_44XX_GPTIMER3 },
282 { .phys_base = 0x48036000, .irq = INT_44XX_GPTIMER4 },
283 { .phys_base = 0x40138000, .irq = INT_44XX_GPTIMER5 },
284 { .phys_base = 0x4013a000, .irq = INT_44XX_GPTIMER6 },
285 { .phys_base = 0x4013a000, .irq = INT_44XX_GPTIMER7 },
286 { .phys_base = 0x4013e000, .irq = INT_44XX_GPTIMER8 },
287 { .phys_base = 0x4803e000, .irq = INT_44XX_GPTIMER9 },
288 { .phys_base = 0x48086000, .irq = INT_44XX_GPTIMER10 },
289 { .phys_base = 0x48088000, .irq = INT_44XX_GPTIMER11 },
290 { .phys_base = 0x4a320000, .irq = INT_44XX_GPTIMER12 },
291};
292static const char *omap4_dm_source_names[] __initdata = {
293 "sys_ck",
294 "omap_32k_fck",
295 NULL
296};
297static struct clk *omap4_dm_source_clocks[2];
298static const int dm_timer_count = ARRAY_SIZE(omap4_dm_timers);
299
253#else 300#else
254 301
255#error OMAP architecture not supported! 302#error OMAP architecture not supported!
@@ -257,7 +304,7 @@ static const int dm_timer_count = ARRAY_SIZE(omap3_dm_timers);
257#endif 304#endif
258 305
259static struct omap_dm_timer *dm_timers; 306static struct omap_dm_timer *dm_timers;
260static char **dm_source_names; 307static const char **dm_source_names;
261static struct clk **dm_source_clocks; 308static struct clk **dm_source_clocks;
262 309
263static spinlock_t dm_timer_lock; 310static spinlock_t dm_timer_lock;
@@ -459,7 +506,8 @@ __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
459} 506}
460EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask); 507EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
461 508
462#elif defined(CONFIG_ARCH_OMAP2) || defined (CONFIG_ARCH_OMAP3) 509#elif defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
510 defined(CONFIG_ARCH_OMAP4)
463 511
464struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 512struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
465{ 513{
@@ -705,12 +753,16 @@ int __init omap_dm_timer_init(void)
705 dm_timers = omap1_dm_timers; 753 dm_timers = omap1_dm_timers;
706 else if (cpu_is_omap24xx()) { 754 else if (cpu_is_omap24xx()) {
707 dm_timers = omap2_dm_timers; 755 dm_timers = omap2_dm_timers;
708 dm_source_names = (char **)omap2_dm_source_names; 756 dm_source_names = omap2_dm_source_names;
709 dm_source_clocks = (struct clk **)omap2_dm_source_clocks; 757 dm_source_clocks = omap2_dm_source_clocks;
710 } else if (cpu_is_omap34xx()) { 758 } else if (cpu_is_omap34xx()) {
711 dm_timers = omap3_dm_timers; 759 dm_timers = omap3_dm_timers;
712 dm_source_names = (char **)omap3_dm_source_names; 760 dm_source_names = omap3_dm_source_names;
713 dm_source_clocks = (struct clk **)omap3_dm_source_clocks; 761 dm_source_clocks = omap3_dm_source_clocks;
762 } else if (cpu_is_omap44xx()) {
763 dm_timers = omap4_dm_timers;
764 dm_source_names = omap4_dm_source_names;
765 dm_source_clocks = omap4_dm_source_clocks;
714 } 766 }
715 767
716 if (cpu_class_is_omap2()) 768 if (cpu_class_is_omap2())
@@ -723,7 +775,8 @@ int __init omap_dm_timer_init(void)
723 for (i = 0; i < dm_timer_count; i++) { 775 for (i = 0; i < dm_timer_count; i++) {
724 timer = &dm_timers[i]; 776 timer = &dm_timers[i];
725 timer->io_base = IO_ADDRESS(timer->phys_base); 777 timer->io_base = IO_ADDRESS(timer->phys_base);
726#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 778#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
779 defined(CONFIG_ARCH_OMAP4)
727 if (cpu_class_is_omap2()) { 780 if (cpu_class_is_omap2()) {
728 char clk_name[16]; 781 char clk_name[16];
729 sprintf(clk_name, "gpt%d_ick", i + 1); 782 sprintf(clk_name, "gpt%d_ick", i + 1);
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index ee0b21f5b094..7fd89ba8d3b5 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -6,6 +6,9 @@
6 * Copyright (C) 2003-2005 Nokia Corporation 6 * Copyright (C) 2003-2005 Nokia Corporation
7 * Written by Juha Yrjölä <juha.yrjola@nokia.com> 7 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
8 * 8 *
9 * Copyright (C) 2009 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
9 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
@@ -146,6 +149,16 @@
146#define OMAP34XX_GPIO5_BASE IO_ADDRESS(0x49056000) 149#define OMAP34XX_GPIO5_BASE IO_ADDRESS(0x49056000)
147#define OMAP34XX_GPIO6_BASE IO_ADDRESS(0x49058000) 150#define OMAP34XX_GPIO6_BASE IO_ADDRESS(0x49058000)
148 151
152/*
153 * OMAP44XX specific GPIO registers
154 */
155#define OMAP44XX_GPIO1_BASE IO_ADDRESS(0x4a310000)
156#define OMAP44XX_GPIO2_BASE IO_ADDRESS(0x48055000)
157#define OMAP44XX_GPIO3_BASE IO_ADDRESS(0x48057000)
158#define OMAP44XX_GPIO4_BASE IO_ADDRESS(0x48059000)
159#define OMAP44XX_GPIO5_BASE IO_ADDRESS(0x4805B000)
160#define OMAP44XX_GPIO6_BASE IO_ADDRESS(0x4805D000)
161
149#define OMAP_MPUIO_VBASE IO_ADDRESS(OMAP_MPUIO_BASE) 162#define OMAP_MPUIO_VBASE IO_ADDRESS(OMAP_MPUIO_BASE)
150 163
151struct gpio_bank { 164struct gpio_bank {
@@ -153,11 +166,13 @@ struct gpio_bank {
153 u16 irq; 166 u16 irq;
154 u16 virtual_irq_start; 167 u16 virtual_irq_start;
155 int method; 168 int method;
156#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 169#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \
170 defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP4)
157 u32 suspend_wakeup; 171 u32 suspend_wakeup;
158 u32 saved_wakeup; 172 u32 saved_wakeup;
159#endif 173#endif
160#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 174#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
175 defined(CONFIG_ARCH_OMAP4)
161 u32 non_wakeup_gpios; 176 u32 non_wakeup_gpios;
162 u32 enabled_non_wakeup_gpios; 177 u32 enabled_non_wakeup_gpios;
163 178
@@ -251,6 +266,24 @@ static struct gpio_bank gpio_bank_34xx[6] = {
251 266
252#endif 267#endif
253 268
269#ifdef CONFIG_ARCH_OMAP4
270static struct gpio_bank gpio_bank_44xx[6] = {
271 { OMAP44XX_GPIO1_BASE, INT_44XX_GPIO_BANK1, IH_GPIO_BASE, \
272 METHOD_GPIO_24XX },
273 { OMAP44XX_GPIO2_BASE, INT_44XX_GPIO_BANK2, IH_GPIO_BASE + 32, \
274 METHOD_GPIO_24XX },
275 { OMAP44XX_GPIO3_BASE, INT_44XX_GPIO_BANK3, IH_GPIO_BASE + 64, \
276 METHOD_GPIO_24XX },
277 { OMAP44XX_GPIO4_BASE, INT_44XX_GPIO_BANK4, IH_GPIO_BASE + 96, \
278 METHOD_GPIO_24XX },
279 { OMAP44XX_GPIO5_BASE, INT_44XX_GPIO_BANK5, IH_GPIO_BASE + 128, \
280 METHOD_GPIO_24XX },
281 { OMAP44XX_GPIO6_BASE, INT_44XX_GPIO_BANK6, IH_GPIO_BASE + 160, \
282 METHOD_GPIO_24XX },
283};
284
285#endif
286
254static struct gpio_bank *gpio_bank; 287static struct gpio_bank *gpio_bank;
255static int gpio_bank_count; 288static int gpio_bank_count;
256 289
@@ -273,7 +306,7 @@ static inline struct gpio_bank *get_gpio_bank(int gpio)
273 } 306 }
274 if (cpu_is_omap24xx()) 307 if (cpu_is_omap24xx())
275 return &gpio_bank[gpio >> 5]; 308 return &gpio_bank[gpio >> 5];
276 if (cpu_is_omap34xx()) 309 if (cpu_is_omap34xx() || cpu_is_omap44xx())
277 return &gpio_bank[gpio >> 5]; 310 return &gpio_bank[gpio >> 5];
278 BUG(); 311 BUG();
279 return NULL; 312 return NULL;
@@ -285,7 +318,7 @@ static inline int get_gpio_index(int gpio)
285 return gpio & 0x1f; 318 return gpio & 0x1f;
286 if (cpu_is_omap24xx()) 319 if (cpu_is_omap24xx())
287 return gpio & 0x1f; 320 return gpio & 0x1f;
288 if (cpu_is_omap34xx()) 321 if (cpu_is_omap34xx() || cpu_is_omap44xx())
289 return gpio & 0x1f; 322 return gpio & 0x1f;
290 return gpio & 0x0f; 323 return gpio & 0x0f;
291} 324}
@@ -307,7 +340,7 @@ static inline int gpio_valid(int gpio)
307 return 0; 340 return 0;
308 if (cpu_is_omap24xx() && gpio < 128) 341 if (cpu_is_omap24xx() && gpio < 128)
309 return 0; 342 return 0;
310 if (cpu_is_omap34xx() && gpio < 192) 343 if ((cpu_is_omap34xx() || cpu_is_omap44xx()) && gpio < 192)
311 return 0; 344 return 0;
312 return -1; 345 return -1;
313} 346}
@@ -353,7 +386,8 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
353 reg += OMAP850_GPIO_DIR_CONTROL; 386 reg += OMAP850_GPIO_DIR_CONTROL;
354 break; 387 break;
355#endif 388#endif
356#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 389#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
390 defined(CONFIG_ARCH_OMAP4)
357 case METHOD_GPIO_24XX: 391 case METHOD_GPIO_24XX:
358 reg += OMAP24XX_GPIO_OE; 392 reg += OMAP24XX_GPIO_OE;
359 break; 393 break;
@@ -425,7 +459,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
425 l &= ~(1 << gpio); 459 l &= ~(1 << gpio);
426 break; 460 break;
427#endif 461#endif
428#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 462#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
463 defined(CONFIG_ARCH_OMAP4)
429 case METHOD_GPIO_24XX: 464 case METHOD_GPIO_24XX:
430 if (enable) 465 if (enable)
431 reg += OMAP24XX_GPIO_SETDATAOUT; 466 reg += OMAP24XX_GPIO_SETDATAOUT;
@@ -476,7 +511,8 @@ static int __omap_get_gpio_datain(int gpio)
476 reg += OMAP850_GPIO_DATA_INPUT; 511 reg += OMAP850_GPIO_DATA_INPUT;
477 break; 512 break;
478#endif 513#endif
479#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 514#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
515 defined(CONFIG_ARCH_OMAP4)
480 case METHOD_GPIO_24XX: 516 case METHOD_GPIO_24XX:
481 reg += OMAP24XX_GPIO_DATAIN; 517 reg += OMAP24XX_GPIO_DATAIN;
482 break; 518 break;
@@ -520,7 +556,7 @@ void omap_set_gpio_debounce(int gpio, int enable)
520 else 556 else
521 goto done; 557 goto done;
522 558
523 if (cpu_is_omap34xx()) { 559 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
524 if (enable) 560 if (enable)
525 clk_enable(bank->dbck); 561 clk_enable(bank->dbck);
526 else 562 else
@@ -550,7 +586,8 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time)
550} 586}
551EXPORT_SYMBOL(omap_set_gpio_debounce_time); 587EXPORT_SYMBOL(omap_set_gpio_debounce_time);
552 588
553#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 589#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
590 defined(CONFIG_ARCH_OMAP4)
554static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, 591static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
555 int trigger) 592 int trigger)
556{ 593{
@@ -660,7 +697,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
660 goto bad; 697 goto bad;
661 break; 698 break;
662#endif 699#endif
663#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 700#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
701 defined(CONFIG_ARCH_OMAP4)
664 case METHOD_GPIO_24XX: 702 case METHOD_GPIO_24XX:
665 set_24xx_gpio_triggering(bank, gpio, trigger); 703 set_24xx_gpio_triggering(bank, gpio, trigger);
666 break; 704 break;
@@ -745,7 +783,8 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
745 reg += OMAP850_GPIO_INT_STATUS; 783 reg += OMAP850_GPIO_INT_STATUS;
746 break; 784 break;
747#endif 785#endif
748#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 786#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
787 defined(CONFIG_ARCH_OMAP4)
749 case METHOD_GPIO_24XX: 788 case METHOD_GPIO_24XX:
750 reg += OMAP24XX_GPIO_IRQSTATUS1; 789 reg += OMAP24XX_GPIO_IRQSTATUS1;
751 break; 790 break;
@@ -814,7 +853,8 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
814 inv = 1; 853 inv = 1;
815 break; 854 break;
816#endif 855#endif
817#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 856#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
857 defined(CONFIG_ARCH_OMAP4)
818 case METHOD_GPIO_24XX: 858 case METHOD_GPIO_24XX:
819 reg += OMAP24XX_GPIO_IRQENABLE1; 859 reg += OMAP24XX_GPIO_IRQENABLE1;
820 mask = 0xffffffff; 860 mask = 0xffffffff;
@@ -887,7 +927,8 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
887 l |= gpio_mask; 927 l |= gpio_mask;
888 break; 928 break;
889#endif 929#endif
890#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 930#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
931 defined(CONFIG_ARCH_OMAP4)
891 case METHOD_GPIO_24XX: 932 case METHOD_GPIO_24XX:
892 if (enable) 933 if (enable)
893 reg += OMAP24XX_GPIO_SETIRQENABLE1; 934 reg += OMAP24XX_GPIO_SETIRQENABLE1;
@@ -932,7 +973,8 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
932 spin_unlock_irqrestore(&bank->lock, flags); 973 spin_unlock_irqrestore(&bank->lock, flags);
933 return 0; 974 return 0;
934#endif 975#endif
935#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 976#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
977 defined(CONFIG_ARCH_OMAP4)
936 case METHOD_GPIO_24XX: 978 case METHOD_GPIO_24XX:
937 if (bank->non_wakeup_gpios & (1 << gpio)) { 979 if (bank->non_wakeup_gpios & (1 << gpio)) {
938 printk(KERN_ERR "Unable to modify wakeup on " 980 printk(KERN_ERR "Unable to modify wakeup on "
@@ -1017,7 +1059,8 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
1017 __raw_writel(1 << offset, reg); 1059 __raw_writel(1 << offset, reg);
1018 } 1060 }
1019#endif 1061#endif
1020#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1062#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1063 defined(CONFIG_ARCH_OMAP4)
1021 if (bank->method == METHOD_GPIO_24XX) { 1064 if (bank->method == METHOD_GPIO_24XX) {
1022 /* Disable wake-up during idle for dynamic tick */ 1065 /* Disable wake-up during idle for dynamic tick */
1023 void __iomem *reg = bank->base + OMAP24XX_GPIO_CLEARWKUENA; 1066 void __iomem *reg = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
@@ -1069,7 +1112,8 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1069 if (bank->method == METHOD_GPIO_850) 1112 if (bank->method == METHOD_GPIO_850)
1070 isr_reg = bank->base + OMAP850_GPIO_INT_STATUS; 1113 isr_reg = bank->base + OMAP850_GPIO_INT_STATUS;
1071#endif 1114#endif
1072#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1115#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1116 defined(CONFIG_ARCH_OMAP4)
1073 if (bank->method == METHOD_GPIO_24XX) 1117 if (bank->method == METHOD_GPIO_24XX)
1074 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1; 1118 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1;
1075#endif 1119#endif
@@ -1346,7 +1390,7 @@ static int gpio_2irq(struct gpio_chip *chip, unsigned offset)
1346/*---------------------------------------------------------------------*/ 1390/*---------------------------------------------------------------------*/
1347 1391
1348static int initialized; 1392static int initialized;
1349#if !defined(CONFIG_ARCH_OMAP3) 1393#if !(defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4))
1350static struct clk * gpio_ick; 1394static struct clk * gpio_ick;
1351#endif 1395#endif
1352 1396
@@ -1359,7 +1403,7 @@ static struct clk * gpio5_ick;
1359static struct clk * gpio5_fck; 1403static struct clk * gpio5_fck;
1360#endif 1404#endif
1361 1405
1362#if defined(CONFIG_ARCH_OMAP3) 1406#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
1363static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS]; 1407static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS];
1364#endif 1408#endif
1365 1409
@@ -1419,8 +1463,8 @@ static int __init _omap_gpio_init(void)
1419 } 1463 }
1420#endif 1464#endif
1421 1465
1422#if defined(CONFIG_ARCH_OMAP3) 1466#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
1423 if (cpu_is_omap34xx()) { 1467 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
1424 for (i = 0; i < OMAP34XX_NR_GPIOS; i++) { 1468 for (i = 0; i < OMAP34XX_NR_GPIOS; i++) {
1425 sprintf(clk_name, "gpio%d_ick", i + 1); 1469 sprintf(clk_name, "gpio%d_ick", i + 1);
1426 gpio_iclks[i] = clk_get(NULL, clk_name); 1470 gpio_iclks[i] = clk_get(NULL, clk_name);
@@ -1497,6 +1541,17 @@ static int __init _omap_gpio_init(void)
1497 (rev >> 4) & 0x0f, rev & 0x0f); 1541 (rev >> 4) & 0x0f, rev & 0x0f);
1498 } 1542 }
1499#endif 1543#endif
1544#ifdef CONFIG_ARCH_OMAP4
1545 if (cpu_is_omap44xx()) {
1546 int rev;
1547
1548 gpio_bank_count = OMAP34XX_NR_GPIOS;
1549 gpio_bank = gpio_bank_44xx;
1550 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
1551 printk(KERN_INFO "OMAP44xx GPIO hardware version %d.%d\n",
1552 (rev >> 4) & 0x0f, rev & 0x0f);
1553 }
1554#endif
1500 for (i = 0; i < gpio_bank_count; i++) { 1555 for (i = 0; i < gpio_bank_count; i++) {
1501 int j, gpio_count = 16; 1556 int j, gpio_count = 16;
1502 1557
@@ -1520,7 +1575,8 @@ static int __init _omap_gpio_init(void)
1520 gpio_count = 32; /* 730 has 32-bit GPIOs */ 1575 gpio_count = 32; /* 730 has 32-bit GPIOs */
1521 } 1576 }
1522 1577
1523#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1578#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1579 defined(CONFIG_ARCH_OMAP4)
1524 if (bank->method == METHOD_GPIO_24XX) { 1580 if (bank->method == METHOD_GPIO_24XX) {
1525 static const u32 non_wakeup_gpios[] = { 1581 static const u32 non_wakeup_gpios[] = {
1526 0xe203ffc0, 0x08700040 1582 0xe203ffc0, 0x08700040
@@ -1577,7 +1633,7 @@ static int __init _omap_gpio_init(void)
1577 set_irq_chained_handler(bank->irq, gpio_irq_handler); 1633 set_irq_chained_handler(bank->irq, gpio_irq_handler);
1578 set_irq_data(bank->irq, bank); 1634 set_irq_data(bank->irq, bank);
1579 1635
1580 if (cpu_is_omap34xx()) { 1636 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
1581 sprintf(clk_name, "gpio%d_dbck", i + 1); 1637 sprintf(clk_name, "gpio%d_dbck", i + 1);
1582 bank->dbck = clk_get(NULL, clk_name); 1638 bank->dbck = clk_get(NULL, clk_name);
1583 if (IS_ERR(bank->dbck)) 1639 if (IS_ERR(bank->dbck))
@@ -1599,7 +1655,8 @@ static int __init _omap_gpio_init(void)
1599 return 0; 1655 return 0;
1600} 1656}
1601 1657
1602#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1658#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \
1659 defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP4)
1603static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) 1660static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
1604{ 1661{
1605 int i; 1662 int i;
@@ -1622,7 +1679,8 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
1622 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA; 1679 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
1623 break; 1680 break;
1624#endif 1681#endif
1625#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1682#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1683 defined(CONFIG_ARCH_OMAP4)
1626 case METHOD_GPIO_24XX: 1684 case METHOD_GPIO_24XX:
1627 wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN; 1685 wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN;
1628 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA; 1686 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
@@ -1663,7 +1721,8 @@ static int omap_gpio_resume(struct sys_device *dev)
1663 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA; 1721 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
1664 break; 1722 break;
1665#endif 1723#endif
1666#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1724#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1725 defined(CONFIG_ARCH_OMAP4)
1667 case METHOD_GPIO_24XX: 1726 case METHOD_GPIO_24XX:
1668 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA; 1727 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
1669 wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA; 1728 wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
@@ -1695,7 +1754,8 @@ static struct sys_device omap_gpio_device = {
1695 1754
1696#endif 1755#endif
1697 1756
1698#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1757#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1758 defined(CONFIG_ARCH_OMAP4)
1699 1759
1700static int workaround_enabled; 1760static int workaround_enabled;
1701 1761
@@ -1711,7 +1771,8 @@ void omap2_gpio_prepare_for_retention(void)
1711 1771
1712 if (!(bank->enabled_non_wakeup_gpios)) 1772 if (!(bank->enabled_non_wakeup_gpios))
1713 continue; 1773 continue;
1714#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1774#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1775 defined(CONFIG_ARCH_OMAP4)
1715 bank->saved_datain = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN); 1776 bank->saved_datain = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
1716 l1 = __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT); 1777 l1 = __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
1717 l2 = __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT); 1778 l2 = __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
@@ -1720,7 +1781,8 @@ void omap2_gpio_prepare_for_retention(void)
1720 bank->saved_risingdetect = l2; 1781 bank->saved_risingdetect = l2;
1721 l1 &= ~bank->enabled_non_wakeup_gpios; 1782 l1 &= ~bank->enabled_non_wakeup_gpios;
1722 l2 &= ~bank->enabled_non_wakeup_gpios; 1783 l2 &= ~bank->enabled_non_wakeup_gpios;
1723#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1784#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1785 defined(CONFIG_ARCH_OMAP4)
1724 __raw_writel(l1, bank->base + OMAP24XX_GPIO_FALLINGDETECT); 1786 __raw_writel(l1, bank->base + OMAP24XX_GPIO_FALLINGDETECT);
1725 __raw_writel(l2, bank->base + OMAP24XX_GPIO_RISINGDETECT); 1787 __raw_writel(l2, bank->base + OMAP24XX_GPIO_RISINGDETECT);
1726#endif 1788#endif
@@ -1745,7 +1807,8 @@ void omap2_gpio_resume_after_retention(void)
1745 1807
1746 if (!(bank->enabled_non_wakeup_gpios)) 1808 if (!(bank->enabled_non_wakeup_gpios))
1747 continue; 1809 continue;
1748#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1810#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1811 defined(CONFIG_ARCH_OMAP4)
1749 __raw_writel(bank->saved_fallingdetect, 1812 __raw_writel(bank->saved_fallingdetect,
1750 bank->base + OMAP24XX_GPIO_FALLINGDETECT); 1813 bank->base + OMAP24XX_GPIO_FALLINGDETECT);
1751 __raw_writel(bank->saved_risingdetect, 1814 __raw_writel(bank->saved_risingdetect,
@@ -1755,14 +1818,16 @@ void omap2_gpio_resume_after_retention(void)
1755 * state. If so, generate an IRQ by software. This is 1818 * state. If so, generate an IRQ by software. This is
1756 * horribly racy, but it's the best we can do to work around 1819 * horribly racy, but it's the best we can do to work around
1757 * this silicon bug. */ 1820 * this silicon bug. */
1758#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1821#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1822 defined(CONFIG_ARCH_OMAP4)
1759 l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN); 1823 l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
1760#endif 1824#endif
1761 l ^= bank->saved_datain; 1825 l ^= bank->saved_datain;
1762 l &= bank->non_wakeup_gpios; 1826 l &= bank->non_wakeup_gpios;
1763 if (l) { 1827 if (l) {
1764 u32 old0, old1; 1828 u32 old0, old1;
1765#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1829#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1830 defined(CONFIG_ARCH_OMAP4)
1766 old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1831 old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
1767 old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); 1832 old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
1768 __raw_writel(old0 | l, bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1833 __raw_writel(old0 | l, bank->base + OMAP24XX_GPIO_LEVELDETECT0);
@@ -1798,7 +1863,8 @@ static int __init omap_gpio_sysinit(void)
1798 1863
1799 mpuio_init(); 1864 mpuio_init();
1800 1865
1801#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1866#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \
1867 defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP4)
1802 if (cpu_is_omap16xx() || cpu_class_is_omap2()) { 1868 if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
1803 if (ret == 0) { 1869 if (ret == 0) {
1804 ret = sysdev_class_register(&omap_gpio_sysclass); 1870 ret = sysdev_class_register(&omap_gpio_sysclass);
@@ -1887,7 +1953,7 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
1887 1953
1888 irqstat = irq_desc[irq].status; 1954 irqstat = irq_desc[irq].status;
1889#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \ 1955#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \
1890 defined(CONFIG_ARCH_OMAP34XX) 1956 defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP4)
1891 if (is_in && ((bank->suspend_wakeup & mask) 1957 if (is_in && ((bank->suspend_wakeup & mask)
1892 || irqstat & IRQ_TYPE_SENSE_MASK)) { 1958 || irqstat & IRQ_TYPE_SENSE_MASK)) {
1893 char *trigger = NULL; 1959 char *trigger = NULL;
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index a303071d5e36..8b848391f0c8 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2007 Nokia Corporation. 6 * Copyright (C) 2007 Nokia Corporation.
7 * 7 *
8 * Contact: Jarkko Nikula <jarkko.nikula@nokia.com> 8 * Contact: Jarkko Nikula <jhnikula@gmail.com>
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h
index 073a2c5569f0..f9f65e1ba3f1 100644
--- a/arch/arm/plat-omap/include/mach/clock.h
+++ b/arch/arm/plat-omap/include/mach/clock.h
@@ -22,7 +22,8 @@ struct clkops {
22 void (*disable)(struct clk *); 22 void (*disable)(struct clk *);
23}; 23};
24 24
25#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 25#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
26 defined(CONFIG_ARCH_OMAP4)
26 27
27struct clksel_rate { 28struct clksel_rate {
28 u32 val; 29 u32 val;
@@ -51,7 +52,7 @@ struct dpll_data {
51 u8 max_divider; 52 u8 max_divider;
52 u32 max_tolerance; 53 u32 max_tolerance;
53 u16 max_multiplier; 54 u16 max_multiplier;
54# if defined(CONFIG_ARCH_OMAP3) 55#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
55 u8 modes; 56 u8 modes;
56 void __iomem *autoidle_reg; 57 void __iomem *autoidle_reg;
57 void __iomem *idlest_reg; 58 void __iomem *idlest_reg;
@@ -83,7 +84,8 @@ struct clk {
83 void (*init)(struct clk *); 84 void (*init)(struct clk *);
84 __u8 enable_bit; 85 __u8 enable_bit;
85 __s8 usecount; 86 __s8 usecount;
86#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 87#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
88 defined(CONFIG_ARCH_OMAP4)
87 u8 fixed_div; 89 u8 fixed_div;
88 void __iomem *clksel_reg; 90 void __iomem *clksel_reg;
89 u32 clksel_mask; 91 u32 clksel_mask;
@@ -119,7 +121,7 @@ struct clk_functions {
119extern unsigned int mpurate; 121extern unsigned int mpurate;
120 122
121extern int clk_init(struct clk_functions *custom_clocks); 123extern int clk_init(struct clk_functions *custom_clocks);
122extern void clk_init_one(struct clk *clk); 124extern void clk_preinit(struct clk *clk);
123extern int clk_register(struct clk *clk); 125extern int clk_register(struct clk *clk);
124extern void clk_reparent(struct clk *child, struct clk *parent); 126extern void clk_reparent(struct clk *child, struct clk *parent);
125extern void clk_unregister(struct clk *clk); 127extern void clk_unregister(struct clk *clk);
diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/mach/common.h
index 0ecf36deb17b..fdeab421b4dc 100644
--- a/arch/arm/plat-omap/include/mach/common.h
+++ b/arch/arm/plat-omap/include/mach/common.h
@@ -33,8 +33,6 @@ struct sys_timer;
33 33
34extern void omap_map_common_io(void); 34extern void omap_map_common_io(void);
35extern struct sys_timer omap_timer; 35extern struct sys_timer omap_timer;
36extern void omap_serial_init(void);
37extern void omap_serial_enable_clocks(int enable);
38#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) 36#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
39extern int omap_register_i2c_bus(int bus_id, u32 clkrate, 37extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
40 struct i2c_board_info const *info, 38 struct i2c_board_info const *info,
@@ -62,6 +60,7 @@ struct omap_globals {
62void omap2_set_globals_242x(void); 60void omap2_set_globals_242x(void);
63void omap2_set_globals_243x(void); 61void omap2_set_globals_243x(void);
64void omap2_set_globals_343x(void); 62void omap2_set_globals_343x(void);
63void omap2_set_globals_443x(void);
65 64
66/* These get called from omap2_set_globals_xxxx(), do not call these */ 65/* These get called from omap2_set_globals_xxxx(), do not call these */
67void omap2_set_globals_tap(struct omap_globals *); 66void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
index 269147f3836f..8140dbccb7bc 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -1,9 +1,9 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/control.h 2 * arch/arm/plat-omap/include/mach/control.h
3 * 3 *
4 * OMAP2/3 System Control Module definitions 4 * OMAP2/3/4 System Control Module definitions
5 * 5 *
6 * Copyright (C) 2007-2008 Texas Instruments, Inc. 6 * Copyright (C) 2007-2009 Texas Instruments, Inc.
7 * Copyright (C) 2007-2008 Nokia Corporation 7 * Copyright (C) 2007-2008 Nokia Corporation
8 * 8 *
9 * Written by Paul Walmsley 9 * Written by Paul Walmsley
@@ -144,6 +144,10 @@
144#define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02b0) 144#define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02b0)
145#define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02b4) 145#define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02b4)
146 146
147/* 34xx D2D idle-related pins, handled by PM core */
148#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
149#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
150
147/* 151/*
148 * REVISIT: This list of registers is not comprehensive - there are more 152 * REVISIT: This list of registers is not comprehensive - there are more
149 * that should be added. 153 * that should be added.
@@ -189,8 +193,18 @@
189#define OMAP2_PBIASLITEPWRDNZ0 (1 << 1) 193#define OMAP2_PBIASLITEPWRDNZ0 (1 << 1)
190#define OMAP2_PBIASLITEVMODE0 (1 << 0) 194#define OMAP2_PBIASLITEVMODE0 (1 << 0)
191 195
196/* CONTROL_IVA2_BOOTMOD bits */
197#define OMAP3_IVA2_BOOTMOD_SHIFT 0
198#define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0)
199#define OMAP3_IVA2_BOOTMOD_IDLE (0x1 << 0)
200
201/* CONTROL_PADCONF_X bits */
202#define OMAP3_PADCONF_WAKEUPEVENT0 (1 << 15)
203#define OMAP3_PADCONF_WAKEUPENABLE0 (1 << 14)
204
192#ifndef __ASSEMBLY__ 205#ifndef __ASSEMBLY__
193#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 206#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
207 defined(CONFIG_ARCH_OMAP4)
194extern void __iomem *omap_ctrl_base_get(void); 208extern void __iomem *omap_ctrl_base_get(void);
195extern u8 omap_ctrl_readb(u16 offset); 209extern u8 omap_ctrl_readb(u16 offset);
196extern u16 omap_ctrl_readw(u16 offset); 210extern u16 omap_ctrl_readw(u16 offset);
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index 98b144252364..fc60c4ebcc28 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -5,8 +5,12 @@
5 * 5 *
6 * Copyright (C) 2004, 2008 Nokia Corporation 6 * Copyright (C) 2004, 2008 Nokia Corporation
7 * 7 *
8 * Copyright (C) 2009 Texas Instruments.
9 *
8 * Written by Tony Lindgren <tony.lindgren@nokia.com> 10 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 * 11 *
12 * Added OMAP4 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
13 *
10 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or 16 * the Free Software Foundation; either version 2 of the License, or
@@ -155,6 +159,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
155#define cpu_is_omap243x() 0 159#define cpu_is_omap243x() 0
156#define cpu_is_omap34xx() 0 160#define cpu_is_omap34xx() 0
157#define cpu_is_omap343x() 0 161#define cpu_is_omap343x() 0
162#define cpu_is_omap44xx() 0
163#define cpu_is_omap443x() 0
158 164
159#if defined(MULTI_OMAP1) 165#if defined(MULTI_OMAP1)
160# if defined(CONFIG_ARCH_OMAP730) 166# if defined(CONFIG_ARCH_OMAP730)
@@ -348,12 +354,21 @@ IS_OMAP_TYPE(3430, 0x3430)
348# define cpu_is_omap3430() is_omap3430() 354# define cpu_is_omap3430() is_omap3430()
349#endif 355#endif
350 356
357# if defined(CONFIG_ARCH_OMAP4)
358# undef cpu_is_omap44xx
359# undef cpu_is_omap443x
360# define cpu_is_omap44xx() 1
361# define cpu_is_omap443x() 1
362# endif
363
351/* Macros to detect if we have OMAP1 or OMAP2 */ 364/* Macros to detect if we have OMAP1 or OMAP2 */
352#define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \ 365#define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
353 cpu_is_omap16xx()) 366 cpu_is_omap16xx())
354#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx()) 367#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \
368 cpu_is_omap44xx())
355 369
356#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 370#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
371 defined(CONFIG_ARCH_OMAP4)
357 372
358/* Various silicon revisions for omap2 */ 373/* Various silicon revisions for omap2 */
359#define OMAP242X_CLASS 0x24200024 374#define OMAP242X_CLASS 0x24200024
@@ -370,6 +385,8 @@ IS_OMAP_TYPE(3430, 0x3430)
370#define OMAP3430_REV_ES3_0 0x34303034 385#define OMAP3430_REV_ES3_0 0x34303034
371#define OMAP3430_REV_ES3_1 0x34304034 386#define OMAP3430_REV_ES3_1 0x34304034
372 387
388#define OMAP443X_CLASS 0x44300034
389
373/* 390/*
374 * omap_chip bits 391 * omap_chip bits
375 * 392 *
diff --git a/arch/arm/plat-omap/include/mach/debug-macro.S b/arch/arm/plat-omap/include/mach/debug-macro.S
index 1b11f5c6a2d9..ac24050e3416 100644
--- a/arch/arm/plat-omap/include/mach/debug-macro.S
+++ b/arch/arm/plat-omap/include/mach/debug-macro.S
@@ -36,7 +36,7 @@
36 add \rx, \rx, #0x00004000 @ UART 3 36 add \rx, \rx, #0x00004000 @ UART 3
37#endif 37#endif
38 38
39#elif CONFIG_ARCH_OMAP3 39#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
40 moveq \rx, #0x48000000 @ physical base address 40 moveq \rx, #0x48000000 @ physical base address
41 movne \rx, #0xd8000000 @ virtual base 41 movne \rx, #0xd8000000 @ virtual base
42 orr \rx, \rx, #0x0006a000 42 orr \rx, \rx, #0x0006a000
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 54fe9665b182..8c1eae88737e 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -48,6 +48,7 @@
48/* Hardware registers for omap2 and omap3 */ 48/* Hardware registers for omap2 and omap3 */
49#define OMAP24XX_DMA4_BASE (L4_24XX_BASE + 0x56000) 49#define OMAP24XX_DMA4_BASE (L4_24XX_BASE + 0x56000)
50#define OMAP34XX_DMA4_BASE (L4_34XX_BASE + 0x56000) 50#define OMAP34XX_DMA4_BASE (L4_34XX_BASE + 0x56000)
51#define OMAP44XX_DMA4_BASE (L4_44XX_BASE + 0x56000)
51 52
52#define OMAP_DMA4_REVISION 0x00 53#define OMAP_DMA4_REVISION 0x00
53#define OMAP_DMA4_GCR 0x78 54#define OMAP_DMA4_GCR 0x78
@@ -144,6 +145,7 @@
144#define OMAP_DMA4_CSSA_U(n) 0 145#define OMAP_DMA4_CSSA_U(n) 0
145#define OMAP_DMA4_CDSA_L(n) 0 146#define OMAP_DMA4_CDSA_L(n) 0
146#define OMAP_DMA4_CDSA_U(n) 0 147#define OMAP_DMA4_CDSA_U(n) 0
148#define OMAP1_DMA_COLOR(n) 0
147 149
148/*----------------------------------------------------------------------------*/ 150/*----------------------------------------------------------------------------*/
149 151
@@ -531,7 +533,7 @@ extern int omap_get_dma_index(int lch, int *ei, int *fi);
531/* Chaining APIs */ 533/* Chaining APIs */
532#ifndef CONFIG_ARCH_OMAP1 534#ifndef CONFIG_ARCH_OMAP1
533extern int omap_request_dma_chain(int dev_id, const char *dev_name, 535extern int omap_request_dma_chain(int dev_id, const char *dev_name,
534 void (*callback) (int chain_id, u16 ch_status, 536 void (*callback) (int lch, u16 ch_status,
535 void *data), 537 void *data),
536 int *chain_id, int no_of_chans, 538 int *chain_id, int no_of_chans,
537 int chain_mode, 539 int chain_mode,
diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S
index 2276f89671d8..56426ed45ef4 100644
--- a/arch/arm/plat-omap/include/mach/entry-macro.S
+++ b/arch/arm/plat-omap/include/mach/entry-macro.S
@@ -3,6 +3,9 @@
3 * 3 *
4 * Low-level IRQ helper macros for OMAP-based platforms 4 * Low-level IRQ helper macros for OMAP-based platforms
5 * 5 *
6 * Copyright (C) 2009 Texas Instruments
7 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
6 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
@@ -10,6 +13,7 @@
10#include <mach/hardware.h> 13#include <mach/hardware.h>
11#include <mach/io.h> 14#include <mach/io.h>
12#include <mach/irqs.h> 15#include <mach/irqs.h>
16#include <asm/hardware/gic.h>
13 17
14#if defined(CONFIG_ARCH_OMAP1) 18#if defined(CONFIG_ARCH_OMAP1)
15 19
@@ -56,15 +60,21 @@
56 .endm 60 .endm
57 61
58#endif 62#endif
59#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 63#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
64 defined(CONFIG_ARCH_OMAP4)
60 65
61#if defined(CONFIG_ARCH_OMAP24XX)
62#include <mach/omap24xx.h> 66#include <mach/omap24xx.h>
63#endif
64#if defined(CONFIG_ARCH_OMAP34XX)
65#include <mach/omap34xx.h> 67#include <mach/omap34xx.h>
66#endif
67 68
69/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
70#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
71#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
72#elif defined(CONFIG_ARCH_OMAP34XX)
73#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE)
74#endif
75#if defined(CONFIG_ARCH_OMAP4)
76#include <mach/omap44xx.h>
77#endif
68#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */ 78#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */
69#define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */ 79#define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */
70 80
@@ -77,6 +87,7 @@
77 .macro arch_ret_to_user, tmp1, tmp2 87 .macro arch_ret_to_user, tmp1, tmp2
78 .endm 88 .endm
79 89
90#ifndef CONFIG_ARCH_OMAP4
80 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 91 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
81 ldr \base, =OMAP2_VA_IC_BASE 92 ldr \base, =OMAP2_VA_IC_BASE
82 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ 93 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
@@ -92,6 +103,68 @@
92 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ 103 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
93 104
94 .endm 105 .endm
106#else
107 /*
108 * The interrupt numbering scheme is defined in the
109 * interrupt controller spec. To wit:
110 *
111 * Interrupts 0-15 are IPI
112 * 16-28 are reserved
113 * 29-31 are local. We allow 30 to be used for the watchdog.
114 * 32-1020 are global
115 * 1021-1022 are reserved
116 * 1023 is "spurious" (no interrupt)
117 *
118 * For now, we ignore all local interrupts so only return an
119 * interrupt if it's between 30 and 1020. The test_for_ipi
120 * routine below will pick up on IPIs.
121 * A simple read from the controller will tell us the number
122 * of the highest priority enabled interrupt.
123 * We then just need to check whether it is in the
124 * valid range for an IRQ (30-1020 inclusive).
125 */
126 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
127 ldr \base, =OMAP44XX_VA_GIC_CPU_BASE
128 ldr \irqstat, [\base, #GIC_CPU_INTACK]
129
130 ldr \tmp, =1021
131
132 bic \irqnr, \irqstat, #0x1c00
133
134 cmp \irqnr, #29
135 cmpcc \irqnr, \irqnr
136 cmpne \irqnr, \tmp
137 cmpcs \irqnr, \irqnr
138 .endm
139
140 /* We assume that irqstat (the raw value of the IRQ acknowledge
141 * register) is preserved from the macro above.
142 * If there is an IPI, we immediately signal end of interrupt
143 * on the controller, since this requires the original irqstat
144 * value which we won't easily be able to recreate later.
145 */
146
147 .macro test_for_ipi, irqnr, irqstat, base, tmp
148 bic \irqnr, \irqstat, #0x1c00
149 cmp \irqnr, #16
150 it cc
151 strcc \irqstat, [\base, #GIC_CPU_EOI]
152 it cs
153 cmpcs \irqnr, \irqnr
154 .endm
155
156 /* As above, this assumes that irqstat and base are preserved */
157
158 .macro test_for_ltirq, irqnr, irqstat, base, tmp
159 bic \irqnr, \irqstat, #0x1c00
160 mov \tmp, #0
161 cmp \irqnr, #29
162 itt eq
163 moveq \tmp, #1
164 streq \irqstat, [\base, #GIC_CPU_EOI]
165 cmp \tmp, #0
166 .endm
167#endif
95 168
96 .macro irq_prio_table 169 .macro irq_prio_table
97 .endm 170 .endm
diff --git a/arch/arm/plat-omap/include/mach/gpmc-smc91x.h b/arch/arm/plat-omap/include/mach/gpmc-smc91x.h
new file mode 100644
index 000000000000..b64fbee4d567
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/gpmc-smc91x.h
@@ -0,0 +1,42 @@
1/*
2 * arch/arm/plat-omap/include/mach/gpmc-smc91x.h
3 *
4 * Copyright (C) 2009 Nokia Corporation
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_OMAP_GPMC_SMC91X_H__
12
13#define GPMC_TIMINGS_SMC91C96 (1 << 4)
14#define GPMC_MUX_ADD_DATA (1 << 5) /* GPMC_CONFIG1_MUXADDDATA */
15#define GPMC_READ_MON (1 << 6) /* GPMC_CONFIG1_WAIT_READ_MON */
16#define GPMC_WRITE_MON (1 << 7) /* GPMC_CONFIG1_WAIT_WRITE_MON */
17
18struct omap_smc91x_platform_data {
19 int cs;
20 int gpio_irq;
21 int gpio_pwrdwn;
22 int gpio_reset;
23 int wait_pin; /* Optional GPMC_CONFIG1_WAITPINSELECT */
24 u32 flags;
25 int (*retime)(void);
26};
27
28#if defined(CONFIG_SMC91X) || \
29 defined(CONFIG_SMC91X_MODULE)
30
31extern void gpmc_smc91x_init(struct omap_smc91x_platform_data *d);
32
33#else
34
35#define board_smc91x_data NULL
36
37static inline void gpmc_smc91x_init(struct omap_smc91x_platform_data *d)
38{
39}
40
41#endif
42#endif
diff --git a/arch/arm/plat-omap/include/mach/hardware.h b/arch/arm/plat-omap/include/mach/hardware.h
index 3dc423ed3e80..26c1fbff08aa 100644
--- a/arch/arm/plat-omap/include/mach/hardware.h
+++ b/arch/arm/plat-omap/include/mach/hardware.h
@@ -285,5 +285,6 @@
285#include "omap16xx.h" 285#include "omap16xx.h"
286#include "omap24xx.h" 286#include "omap24xx.h"
287#include "omap34xx.h" 287#include "omap34xx.h"
288#include "omap44xx.h"
288 289
289#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 290#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/mach/hwa742.h b/arch/arm/plat-omap/include/mach/hwa742.h
index 577f492f2d3c..886248d32b49 100644
--- a/arch/arm/plat-omap/include/mach/hwa742.h
+++ b/arch/arm/plat-omap/include/mach/hwa742.h
@@ -2,10 +2,6 @@
2#define _HWA742_H 2#define _HWA742_H
3 3
4struct hwa742_platform_data { 4struct hwa742_platform_data {
5 void (*power_up)(struct device *dev);
6 void (*power_down)(struct device *dev);
7 unsigned long (*get_clock_rate)(struct device *dev);
8
9 unsigned te_connected:1; 5 unsigned te_connected:1;
10}; 6};
11 7
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h
index 0610d7e2b3d7..3b2814720569 100644
--- a/arch/arm/plat-omap/include/mach/io.h
+++ b/arch/arm/plat-omap/include/mach/io.h
@@ -6,6 +6,9 @@
6 * Copied from arch/arm/mach-sa1100/include/mach/io.h 6 * Copied from arch/arm/mach-sa1100/include/mach/io.h
7 * Copyright (C) 1997-1999 Russell King 7 * Copyright (C) 1997-1999 Russell King
8 * 8 *
9 * Copyright (C) 2009 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
9 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your 14 * Free Software Foundation; either version 2 of the License, or (at your
@@ -157,6 +160,40 @@
157#define DSP_MMU_34XX_VIRT 0xe2000000 160#define DSP_MMU_34XX_VIRT 0xe2000000
158#define DSP_MMU_34XX_SIZE SZ_4K 161#define DSP_MMU_34XX_SIZE SZ_4K
159 162
163
164#elif defined(CONFIG_ARCH_OMAP4)
165/* We map both L3 and L4 on OMAP4 */
166#define L3_44XX_PHYS L3_44XX_BASE
167#define L3_44XX_VIRT 0xd4000000
168#define L3_44XX_SIZE SZ_1M
169
170#define L4_44XX_PHYS L4_44XX_BASE
171#define L4_44XX_VIRT 0xda000000
172#define L4_44XX_SIZE SZ_4M
173
174
175#define L4_WK_44XX_PHYS L4_WK_44XX_BASE
176#define L4_WK_44XX_VIRT 0xda300000
177#define L4_WK_44XX_SIZE SZ_1M
178
179#define L4_PER_44XX_PHYS L4_PER_44XX_BASE
180#define L4_PER_44XX_VIRT 0xd8000000
181#define L4_PER_44XX_SIZE SZ_4M
182
183#define L4_EMU_44XX_PHYS L4_EMU_44XX_BASE
184#define L4_EMU_44XX_VIRT 0xe4000000
185#define L4_EMU_44XX_SIZE SZ_64M
186
187#define OMAP44XX_GPMC_PHYS OMAP44XX_GPMC_BASE
188#define OMAP44XX_GPMC_VIRT 0xe0000000
189#define OMAP44XX_GPMC_SIZE SZ_1M
190
191
192#define IO_OFFSET 0x90000000
193#define __IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
194#define __OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
195#define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */
196
160#endif 197#endif
161 198
162#define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa)) 199#define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa))
diff --git a/arch/arm/plat-omap/include/mach/iommu.h b/arch/arm/plat-omap/include/mach/iommu.h
new file mode 100644
index 000000000000..769b00b4c34a
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/iommu.h
@@ -0,0 +1,168 @@
1/*
2 * omap iommu: main structures
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __MACH_IOMMU_H
14#define __MACH_IOMMU_H
15
16struct iotlb_entry {
17 u32 da;
18 u32 pa;
19 u32 pgsz, prsvd, valid;
20 union {
21 u16 ap;
22 struct {
23 u32 endian, elsz, mixed;
24 };
25 };
26};
27
28struct iommu {
29 const char *name;
30 struct module *owner;
31 struct clk *clk;
32 void __iomem *regbase;
33 struct device *dev;
34
35 unsigned int refcount;
36 struct mutex iommu_lock; /* global for this whole object */
37
38 /*
39 * We don't change iopgd for a situation like pgd for a task,
40 * but share it globally for each iommu.
41 */
42 u32 *iopgd;
43 spinlock_t page_table_lock; /* protect iopgd */
44
45 int nr_tlb_entries;
46
47 struct list_head mmap;
48 struct mutex mmap_lock; /* protect mmap */
49
50 int (*isr)(struct iommu *obj);
51
52 void *ctx; /* iommu context: registres saved area */
53};
54
55struct cr_regs {
56 union {
57 struct {
58 u16 cam_l;
59 u16 cam_h;
60 };
61 u32 cam;
62 };
63 union {
64 struct {
65 u16 ram_l;
66 u16 ram_h;
67 };
68 u32 ram;
69 };
70};
71
72struct iotlb_lock {
73 short base;
74 short vict;
75};
76
77/* architecture specific functions */
78struct iommu_functions {
79 unsigned long version;
80
81 int (*enable)(struct iommu *obj);
82 void (*disable)(struct iommu *obj);
83 u32 (*fault_isr)(struct iommu *obj, u32 *ra);
84
85 void (*tlb_read_cr)(struct iommu *obj, struct cr_regs *cr);
86 void (*tlb_load_cr)(struct iommu *obj, struct cr_regs *cr);
87
88 struct cr_regs *(*alloc_cr)(struct iommu *obj, struct iotlb_entry *e);
89 int (*cr_valid)(struct cr_regs *cr);
90 u32 (*cr_to_virt)(struct cr_regs *cr);
91 void (*cr_to_e)(struct cr_regs *cr, struct iotlb_entry *e);
92 ssize_t (*dump_cr)(struct iommu *obj, struct cr_regs *cr, char *buf);
93
94 u32 (*get_pte_attr)(struct iotlb_entry *e);
95
96 void (*save_ctx)(struct iommu *obj);
97 void (*restore_ctx)(struct iommu *obj);
98 ssize_t (*dump_ctx)(struct iommu *obj, char *buf);
99};
100
101struct iommu_platform_data {
102 const char *name;
103 const char *clk_name;
104 const int nr_tlb_entries;
105};
106
107#if defined(CONFIG_ARCH_OMAP1)
108#error "iommu for this processor not implemented yet"
109#else
110#include <mach/iommu2.h>
111#endif
112
113/*
114 * utilities for super page(16MB, 1MB, 64KB and 4KB)
115 */
116
117#define iopgsz_max(bytes) \
118 (((bytes) >= SZ_16M) ? SZ_16M : \
119 ((bytes) >= SZ_1M) ? SZ_1M : \
120 ((bytes) >= SZ_64K) ? SZ_64K : \
121 ((bytes) >= SZ_4K) ? SZ_4K : 0)
122
123#define bytes_to_iopgsz(bytes) \
124 (((bytes) == SZ_16M) ? MMU_CAM_PGSZ_16M : \
125 ((bytes) == SZ_1M) ? MMU_CAM_PGSZ_1M : \
126 ((bytes) == SZ_64K) ? MMU_CAM_PGSZ_64K : \
127 ((bytes) == SZ_4K) ? MMU_CAM_PGSZ_4K : -1)
128
129#define iopgsz_to_bytes(iopgsz) \
130 (((iopgsz) == MMU_CAM_PGSZ_16M) ? SZ_16M : \
131 ((iopgsz) == MMU_CAM_PGSZ_1M) ? SZ_1M : \
132 ((iopgsz) == MMU_CAM_PGSZ_64K) ? SZ_64K : \
133 ((iopgsz) == MMU_CAM_PGSZ_4K) ? SZ_4K : 0)
134
135#define iopgsz_ok(bytes) (bytes_to_iopgsz(bytes) >= 0)
136
137/*
138 * global functions
139 */
140extern u32 iommu_arch_version(void);
141
142extern void iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e);
143extern u32 iotlb_cr_to_virt(struct cr_regs *cr);
144
145extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e);
146extern void flush_iotlb_page(struct iommu *obj, u32 da);
147extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end);
148extern void flush_iotlb_all(struct iommu *obj);
149
150extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e);
151extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova);
152
153extern struct iommu *iommu_get(const char *name);
154extern void iommu_put(struct iommu *obj);
155
156extern void iommu_save_ctx(struct iommu *obj);
157extern void iommu_restore_ctx(struct iommu *obj);
158
159extern int install_iommu_arch(const struct iommu_functions *ops);
160extern void uninstall_iommu_arch(const struct iommu_functions *ops);
161
162extern int foreach_iommu_device(void *data,
163 int (*fn)(struct device *, void *));
164
165extern ssize_t iommu_dump_ctx(struct iommu *obj, char *buf);
166extern size_t dump_tlb_entries(struct iommu *obj, char *buf);
167
168#endif /* __MACH_IOMMU_H */
diff --git a/arch/arm/plat-omap/include/mach/iommu2.h b/arch/arm/plat-omap/include/mach/iommu2.h
new file mode 100644
index 000000000000..10ad05f410e9
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/iommu2.h
@@ -0,0 +1,96 @@
1/*
2 * omap iommu: omap2 architecture specific definitions
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __MACH_IOMMU2_H
14#define __MACH_IOMMU2_H
15
16#include <linux/io.h>
17
18/*
19 * MMU Register offsets
20 */
21#define MMU_REVISION 0x00
22#define MMU_SYSCONFIG 0x10
23#define MMU_SYSSTATUS 0x14
24#define MMU_IRQSTATUS 0x18
25#define MMU_IRQENABLE 0x1c
26#define MMU_WALKING_ST 0x40
27#define MMU_CNTL 0x44
28#define MMU_FAULT_AD 0x48
29#define MMU_TTB 0x4c
30#define MMU_LOCK 0x50
31#define MMU_LD_TLB 0x54
32#define MMU_CAM 0x58
33#define MMU_RAM 0x5c
34#define MMU_GFLUSH 0x60
35#define MMU_FLUSH_ENTRY 0x64
36#define MMU_READ_CAM 0x68
37#define MMU_READ_RAM 0x6c
38#define MMU_EMU_FAULT_AD 0x70
39
40#define MMU_REG_SIZE 256
41
42/*
43 * MMU Register bit definitions
44 */
45#define MMU_LOCK_BASE_SHIFT 10
46#define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT)
47#define MMU_LOCK_BASE(x) \
48 ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT)
49
50#define MMU_LOCK_VICT_SHIFT 4
51#define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT)
52#define MMU_LOCK_VICT(x) \
53 ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT)
54
55#define MMU_CAM_VATAG_SHIFT 12
56#define MMU_CAM_VATAG_MASK \
57 ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT)
58#define MMU_CAM_P (1 << 3)
59#define MMU_CAM_V (1 << 2)
60#define MMU_CAM_PGSZ_MASK 3
61#define MMU_CAM_PGSZ_1M (0 << 0)
62#define MMU_CAM_PGSZ_64K (1 << 0)
63#define MMU_CAM_PGSZ_4K (2 << 0)
64#define MMU_CAM_PGSZ_16M (3 << 0)
65
66#define MMU_RAM_PADDR_SHIFT 12
67#define MMU_RAM_PADDR_MASK \
68 ((~0UL >> MMU_RAM_PADDR_SHIFT) << MMU_RAM_PADDR_SHIFT)
69#define MMU_RAM_ENDIAN_SHIFT 9
70#define MMU_RAM_ENDIAN_MASK (1 << MMU_RAM_ENDIAN_SHIFT)
71#define MMU_RAM_ENDIAN_BIG (1 << MMU_RAM_ENDIAN_SHIFT)
72#define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT)
73#define MMU_RAM_ELSZ_SHIFT 7
74#define MMU_RAM_ELSZ_MASK (3 << MMU_RAM_ELSZ_SHIFT)
75#define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT)
76#define MMU_RAM_ELSZ_16 (1 << MMU_RAM_ELSZ_SHIFT)
77#define MMU_RAM_ELSZ_32 (2 << MMU_RAM_ELSZ_SHIFT)
78#define MMU_RAM_ELSZ_NONE (3 << MMU_RAM_ELSZ_SHIFT)
79#define MMU_RAM_MIXED_SHIFT 6
80#define MMU_RAM_MIXED_MASK (1 << MMU_RAM_MIXED_SHIFT)
81#define MMU_RAM_MIXED MMU_RAM_MIXED_MASK
82
83/*
84 * register accessors
85 */
86static inline u32 iommu_read_reg(struct iommu *obj, size_t offs)
87{
88 return __raw_readl(obj->regbase + offs);
89}
90
91static inline void iommu_write_reg(struct iommu *obj, u32 val, size_t offs)
92{
93 __raw_writel(val, obj->regbase + offs);
94}
95
96#endif /* __MACH_IOMMU2_H */
diff --git a/arch/arm/plat-omap/include/mach/iovmm.h b/arch/arm/plat-omap/include/mach/iovmm.h
new file mode 100644
index 000000000000..bdc7ce5d7a4a
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/iovmm.h
@@ -0,0 +1,94 @@
1/*
2 * omap iommu: simple virtual address space management
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __IOMMU_MMAP_H
14#define __IOMMU_MMAP_H
15
16struct iovm_struct {
17 struct iommu *iommu; /* iommu object which this belongs to */
18 u32 da_start; /* area definition */
19 u32 da_end;
20 u32 flags; /* IOVMF_: see below */
21 struct list_head list; /* linked in ascending order */
22 const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */
23 void *va; /* mpu side mapped address */
24};
25
26/*
27 * IOVMF_FLAGS: attribute for iommu virtual memory area(iovma)
28 *
29 * lower 16 bit is used for h/w and upper 16 bit is for s/w.
30 */
31#define IOVMF_SW_SHIFT 16
32#define IOVMF_HW_SIZE (1 << IOVMF_SW_SHIFT)
33#define IOVMF_HW_MASK (IOVMF_HW_SIZE - 1)
34#define IOVMF_SW_MASK (~IOVMF_HW_MASK)UL
35
36/*
37 * iovma: h/w flags derived from cam and ram attribute
38 */
39#define IOVMF_CAM_MASK (~((1 << 10) - 1))
40#define IOVMF_RAM_MASK (~IOVMF_CAM_MASK)
41
42#define IOVMF_PGSZ_MASK (3 << 0)
43#define IOVMF_PGSZ_1M MMU_CAM_PGSZ_1M
44#define IOVMF_PGSZ_64K MMU_CAM_PGSZ_64K
45#define IOVMF_PGSZ_4K MMU_CAM_PGSZ_4K
46#define IOVMF_PGSZ_16M MMU_CAM_PGSZ_16M
47
48#define IOVMF_ENDIAN_MASK (1 << 9)
49#define IOVMF_ENDIAN_BIG MMU_RAM_ENDIAN_BIG
50#define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE
51
52#define IOVMF_ELSZ_MASK (3 << 7)
53#define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8
54#define IOVMF_ELSZ_16 MMU_RAM_ELSZ_16
55#define IOVMF_ELSZ_32 MMU_RAM_ELSZ_32
56#define IOVMF_ELSZ_NONE MMU_RAM_ELSZ_NONE
57
58#define IOVMF_MIXED_MASK (1 << 6)
59#define IOVMF_MIXED MMU_RAM_MIXED
60
61/*
62 * iovma: s/w flags, used for mapping and umapping internally.
63 */
64#define IOVMF_MMIO (1 << IOVMF_SW_SHIFT)
65#define IOVMF_ALLOC (2 << IOVMF_SW_SHIFT)
66#define IOVMF_ALLOC_MASK (3 << IOVMF_SW_SHIFT)
67
68/* "superpages" is supported just with physically linear pages */
69#define IOVMF_DISCONT (1 << (2 + IOVMF_SW_SHIFT))
70#define IOVMF_LINEAR (2 << (2 + IOVMF_SW_SHIFT))
71#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT))
72
73#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT))
74#define IOVMF_DA_ANON (2 << (4 + IOVMF_SW_SHIFT))
75#define IOVMF_DA_MASK (3 << (4 + IOVMF_SW_SHIFT))
76
77
78extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da);
79extern u32 iommu_vmap(struct iommu *obj, u32 da,
80 const struct sg_table *sgt, u32 flags);
81extern struct sg_table *iommu_vunmap(struct iommu *obj, u32 da);
82extern u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes,
83 u32 flags);
84extern void iommu_vfree(struct iommu *obj, const u32 da);
85extern u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
86 u32 flags);
87extern void iommu_kunmap(struct iommu *obj, u32 da);
88extern u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes,
89 u32 flags);
90extern void iommu_kfree(struct iommu *obj, u32 da);
91
92extern void *da_to_va(struct iommu *obj, u32 da);
93
94#endif /* __IOMMU_MMAP_H */
diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/mach/irqs.h
index 7f57ee66f364..fb7cb7723990 100644
--- a/arch/arm/plat-omap/include/mach/irqs.h
+++ b/arch/arm/plat-omap/include/mach/irqs.h
@@ -4,6 +4,9 @@
4 * Copyright (C) Greg Lonnon 2001 4 * Copyright (C) Greg Lonnon 2001
5 * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com> 5 * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com>
6 * 6 *
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
9 *
7 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation; either version 2 of the License, or
@@ -422,6 +425,94 @@
422 425
423#define INT_34XX_BENCH_MPU_EMUL 3 426#define INT_34XX_BENCH_MPU_EMUL 3
424 427
428
429#define IRQ_GIC_START 32
430#define INT_44XX_LOCALTIMER_IRQ 29
431#define INT_44XX_LOCALWDT_IRQ 30
432
433#define INT_44XX_BENCH_MPU_EMUL (3 + IRQ_GIC_START)
434#define INT_44XX_SSM_ABORT_IRQ (6 + IRQ_GIC_START)
435#define INT_44XX_SYS_NIRQ (7 + IRQ_GIC_START)
436#define INT_44XX_D2D_FW_IRQ (8 + IRQ_GIC_START)
437#define INT_44XX_PRCM_MPU_IRQ (11 + IRQ_GIC_START)
438#define INT_44XX_SDMA_IRQ0 (12 + IRQ_GIC_START)
439#define INT_44XX_SDMA_IRQ1 (13 + IRQ_GIC_START)
440#define INT_44XX_SDMA_IRQ2 (14 + IRQ_GIC_START)
441#define INT_44XX_SDMA_IRQ3 (15 + IRQ_GIC_START)
442#define INT_44XX_ISS_IRQ (24 + IRQ_GIC_START)
443#define INT_44XX_DSS_IRQ (25 + IRQ_GIC_START)
444#define INT_44XX_MAIL_U0_MPU (26 + IRQ_GIC_START)
445#define INT_44XX_DSP_MMU (28 + IRQ_GIC_START)
446#define INT_44XX_GPTIMER1 (37 + IRQ_GIC_START)
447#define INT_44XX_GPTIMER2 (38 + IRQ_GIC_START)
448#define INT_44XX_GPTIMER3 (39 + IRQ_GIC_START)
449#define INT_44XX_GPTIMER4 (40 + IRQ_GIC_START)
450#define INT_44XX_GPTIMER5 (41 + IRQ_GIC_START)
451#define INT_44XX_GPTIMER6 (42 + IRQ_GIC_START)
452#define INT_44XX_GPTIMER7 (43 + IRQ_GIC_START)
453#define INT_44XX_GPTIMER8 (44 + IRQ_GIC_START)
454#define INT_44XX_GPTIMER9 (45 + IRQ_GIC_START)
455#define INT_44XX_GPTIMER10 (46 + IRQ_GIC_START)
456#define INT_44XX_GPTIMER11 (47 + IRQ_GIC_START)
457#define INT_44XX_GPTIMER12 (95 + IRQ_GIC_START)
458#define INT_44XX_SHA1MD5 (51 + IRQ_GIC_START)
459#define INT_44XX_I2C1_IRQ (56 + IRQ_GIC_START)
460#define INT_44XX_I2C2_IRQ (57 + IRQ_GIC_START)
461#define INT_44XX_HDQ_IRQ (58 + IRQ_GIC_START)
462#define INT_44XX_SPI1_IRQ (65 + IRQ_GIC_START)
463#define INT_44XX_SPI2_IRQ (66 + IRQ_GIC_START)
464#define INT_44XX_HSI_1_IRQ0 (67 + IRQ_GIC_START)
465#define INT_44XX_HSI_2_IRQ1 (68 + IRQ_GIC_START)
466#define INT_44XX_HSI_1_DMAIRQ (71 + IRQ_GIC_START)
467#define INT_44XX_UART1_IRQ (72 + IRQ_GIC_START)
468#define INT_44XX_UART2_IRQ (73 + IRQ_GIC_START)
469#define INT_44XX_UART3_IRQ (74 + IRQ_GIC_START)
470#define INT_44XX_UART4_IRQ (70 + IRQ_GIC_START)
471#define INT_44XX_USB_IRQ_NISO (76 + IRQ_GIC_START)
472#define INT_44XX_USB_IRQ_ISO (77 + IRQ_GIC_START)
473#define INT_44XX_USB_IRQ_HGEN (78 + IRQ_GIC_START)
474#define INT_44XX_USB_IRQ_HSOF (79 + IRQ_GIC_START)
475#define INT_44XX_USB_IRQ_OTG (80 + IRQ_GIC_START)
476#define INT_44XX_MCBSP4_IRQ_TX (81 + IRQ_GIC_START)
477#define INT_44XX_MCBSP4_IRQ_RX (82 + IRQ_GIC_START)
478#define INT_44XX_MMC_IRQ (83 + IRQ_GIC_START)
479#define INT_44XX_MMC2_IRQ (86 + IRQ_GIC_START)
480#define INT_44XX_MCBSP2_IRQ_TX (89 + IRQ_GIC_START)
481#define INT_44XX_MCBSP2_IRQ_RX (90 + IRQ_GIC_START)
482#define INT_44XX_SPI3_IRQ (91 + IRQ_GIC_START)
483#define INT_44XX_SPI5_IRQ (69 + IRQ_GIC_START)
484
485#define INT_44XX_MCBSP5_IRQ (16 + IRQ_GIC_START)
486#define INT_44xX_MCBSP1_IRQ (17 + IRQ_GIC_START)
487#define INT_44XX_MCBSP2_IRQ (22 + IRQ_GIC_START)
488#define INT_44XX_MCBSP3_IRQ (23 + IRQ_GIC_START)
489#define INT_44XX_MCBSP4_IRQ (27 + IRQ_GIC_START)
490#define INT_44XX_HS_USB_MC (92 + IRQ_GIC_START)
491#define INT_44XX_HS_USB_DMA (93 + IRQ_GIC_START)
492
493#define INT_44XX_GPIO_BANK1 (29 + IRQ_GIC_START)
494#define INT_44XX_GPIO_BANK2 (30 + IRQ_GIC_START)
495#define INT_44XX_GPIO_BANK3 (31 + IRQ_GIC_START)
496#define INT_44XX_GPIO_BANK4 (32 + IRQ_GIC_START)
497#define INT_44XX_GPIO_BANK5 (33 + IRQ_GIC_START)
498#define INT_44XX_GPIO_BANK6 (34 + IRQ_GIC_START)
499#define INT_44XX_USIM_IRQ (35 + IRQ_GIC_START)
500#define INT_44XX_WDT3_IRQ (36 + IRQ_GIC_START)
501#define INT_44XX_SPI4_IRQ (48 + IRQ_GIC_START)
502#define INT_44XX_SHA1MD52_IRQ (49 + IRQ_GIC_START)
503#define INT_44XX_FPKA_READY_IRQ (50 + IRQ_GIC_START)
504#define INT_44XX_SHA1MD51_IRQ (51 + IRQ_GIC_START)
505#define INT_44XX_RNG_IRQ (52 + IRQ_GIC_START)
506#define INT_44XX_I2C3_IRQ (61 + IRQ_GIC_START)
507#define INT_44XX_FPKA_ERROR_IRQ (64 + IRQ_GIC_START)
508#define INT_44XX_PBIAS_IRQ (75 + IRQ_GIC_START)
509#define INT_44XX_OHCI_IRQ (76 + IRQ_GIC_START)
510#define INT_44XX_EHCI_IRQ (77 + IRQ_GIC_START)
511#define INT_44XX_TLL_IRQ (78 + IRQ_GIC_START)
512#define INT_44XX_PARTHASH_IRQ (79 + IRQ_GIC_START)
513#define INT_44XX_MMC3_IRQ (94 + IRQ_GIC_START)
514
515
425/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and 516/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
426 * 16 MPUIO lines */ 517 * 16 MPUIO lines */
427#define OMAP_MAX_GPIO_LINES 192 518#define OMAP_MAX_GPIO_LINES 192
@@ -467,6 +558,7 @@
467 558
468#ifndef __ASSEMBLY__ 559#ifndef __ASSEMBLY__
469extern void omap_init_irq(void); 560extern void omap_init_irq(void);
561extern int omap_irq_pending(void);
470#endif 562#endif
471 563
472#include <mach/hardware.h> 564#include <mach/hardware.h>
diff --git a/arch/arm/plat-omap/include/mach/keypad.h b/arch/arm/plat-omap/include/mach/keypad.h
index 232923aaf61d..45ea3ae3c995 100644
--- a/arch/arm/plat-omap/include/mach/keypad.h
+++ b/arch/arm/plat-omap/include/mach/keypad.h
@@ -33,7 +33,11 @@ struct omap_kp_platform_data {
33#define GROUP_3 (3 << 16) 33#define GROUP_3 (3 << 16)
34#define GROUP_MASK GROUP_3 34#define GROUP_MASK GROUP_3
35 35
36#define KEY_PERSISTENT 0x00800000
37#define KEYNUM_MASK 0x00EFFFFF
36#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val)) 38#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val))
39#define PERSISTENT_KEY(col, row) (((col) << 28) | ((row) << 24) | \
40 KEY_PERSISTENT)
37 41
38#endif 42#endif
39 43
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/mach/memory.h
index 99ed564d9277..9ad41dc484c1 100644
--- a/arch/arm/plat-omap/include/mach/memory.h
+++ b/arch/arm/plat-omap/include/mach/memory.h
@@ -38,7 +38,8 @@
38 */ 38 */
39#if defined(CONFIG_ARCH_OMAP1) 39#if defined(CONFIG_ARCH_OMAP1)
40#define PHYS_OFFSET UL(0x10000000) 40#define PHYS_OFFSET UL(0x10000000)
41#elif defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 41#elif defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
42 defined(CONFIG_ARCH_OMAP4)
42#define PHYS_OFFSET UL(0x80000000) 43#define PHYS_OFFSET UL(0x80000000)
43#endif 44#endif
44 45
diff --git a/arch/arm/plat-omap/include/mach/omap24xx.h b/arch/arm/plat-omap/include/mach/omap24xx.h
index 24335d4932f5..696edfc145a6 100644
--- a/arch/arm/plat-omap/include/mach/omap24xx.h
+++ b/arch/arm/plat-omap/include/mach/omap24xx.h
@@ -85,23 +85,5 @@
85#define OMAP24XX_SEC_AES_BASE (OMAP24XX_SEC_BASE + 0x6000) 85#define OMAP24XX_SEC_AES_BASE (OMAP24XX_SEC_BASE + 0x6000)
86#define OMAP24XX_SEC_PKA_BASE (OMAP24XX_SEC_BASE + 0x8000) 86#define OMAP24XX_SEC_PKA_BASE (OMAP24XX_SEC_BASE + 0x8000)
87 87
88#if defined(CONFIG_ARCH_OMAP2420)
89
90#define OMAP2_32KSYNCT_BASE OMAP2420_32KSYNCT_BASE
91#define OMAP2_PRCM_BASE OMAP2420_PRCM_BASE
92#define OMAP2_CM_BASE OMAP2420_CM_BASE
93#define OMAP2_PRM_BASE OMAP2420_PRM_BASE
94#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
95
96#elif defined(CONFIG_ARCH_OMAP2430)
97
98#define OMAP2_32KSYNCT_BASE OMAP2430_32KSYNCT_BASE
99#define OMAP2_PRCM_BASE OMAP2430_PRCM_BASE
100#define OMAP2_CM_BASE OMAP2430_CM_BASE
101#define OMAP2_PRM_BASE OMAP2430_PRM_BASE
102#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
103
104#endif
105
106#endif /* __ASM_ARCH_OMAP24XX_H */ 88#endif /* __ASM_ARCH_OMAP24XX_H */
107 89
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/mach/omap34xx.h
index ab640151d3ec..f8d186a73712 100644
--- a/arch/arm/plat-omap/include/mach/omap34xx.h
+++ b/arch/arm/plat-omap/include/mach/omap34xx.h
@@ -31,13 +31,9 @@
31 31
32#define L4_34XX_BASE 0x48000000 32#define L4_34XX_BASE 0x48000000
33#define L4_WK_34XX_BASE 0x48300000 33#define L4_WK_34XX_BASE 0x48300000
34#define L4_WK_OMAP_BASE L4_WK_34XX_BASE
35#define L4_PER_34XX_BASE 0x49000000 34#define L4_PER_34XX_BASE 0x49000000
36#define L4_PER_OMAP_BASE L4_PER_34XX_BASE
37#define L4_EMU_34XX_BASE 0x54000000 35#define L4_EMU_34XX_BASE 0x54000000
38#define L4_EMU_BASE L4_EMU_34XX_BASE
39#define L3_34XX_BASE 0x68000000 36#define L3_34XX_BASE 0x68000000
40#define L3_OMAP_BASE L3_34XX_BASE
41 37
42#define OMAP3430_32KSYNCT_BASE 0x48320000 38#define OMAP3430_32KSYNCT_BASE 0x48320000
43#define OMAP3430_CM_BASE 0x48004800 39#define OMAP3430_CM_BASE 0x48004800
@@ -83,15 +79,6 @@
83 79
84#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) 80#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000)
85 81
86#if defined(CONFIG_ARCH_OMAP3430)
87
88#define OMAP2_32KSYNCT_BASE OMAP3430_32KSYNCT_BASE
89#define OMAP2_CM_BASE OMAP3430_CM_BASE
90#define OMAP2_PRM_BASE OMAP3430_PRM_BASE
91#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE)
92
93#endif
94
95#define OMAP34XX_DSP_BASE 0x58000000 82#define OMAP34XX_DSP_BASE 0x58000000
96#define OMAP34XX_DSP_MEM_BASE (OMAP34XX_DSP_BASE + 0x0) 83#define OMAP34XX_DSP_MEM_BASE (OMAP34XX_DSP_BASE + 0x0)
97#define OMAP34XX_DSP_IPI_BASE (OMAP34XX_DSP_BASE + 0x1000000) 84#define OMAP34XX_DSP_IPI_BASE (OMAP34XX_DSP_BASE + 0x1000000)
diff --git a/arch/arm/plat-omap/include/mach/omap44xx.h b/arch/arm/plat-omap/include/mach/omap44xx.h
new file mode 100644
index 000000000000..15dec7f1c7c0
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/omap44xx.h
@@ -0,0 +1,46 @@
1/*:
2 * Address mappings and base address for OMAP4 interconnects
3 * and peripherals.
4 *
5 * Copyright (C) 2009 Texas Instruments
6 *
7 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * This program 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#ifndef __ASM_ARCH_OMAP44XX_H
14#define __ASM_ARCH_OMAP44XX_H
15
16/*
17 * Please place only base defines here and put the rest in device
18 * specific headers.
19 */
20#define L4_44XX_BASE 0x4a000000
21#define L4_WK_44XX_BASE 0x4a300000
22#define L4_PER_44XX_BASE 0x48000000
23#define L4_EMU_44XX_BASE 0x54000000
24#define L3_44XX_BASE 0x44000000
25#define OMAP4430_32KSYNCT_BASE 0x4a304000
26#define OMAP4430_CM_BASE 0x4a004000
27#define OMAP4430_PRM_BASE 0x48306000
28#define OMAP44XX_GPMC_BASE 0x50000000
29#define OMAP443X_SCM_BASE 0x4a002000
30#define OMAP443X_CTRL_BASE OMAP443X_SCM_BASE
31#define OMAP44XX_IC_BASE 0x48200000
32#define OMAP44XX_IVA_INTC_BASE 0x40000000
33#define IRQ_SIR_IRQ 0x0040
34#define OMAP44XX_GIC_DIST_BASE 0x48241000
35#define OMAP44XX_GIC_CPU_BASE 0x48240100
36#define OMAP44XX_VA_GIC_CPU_BASE IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
37#define OMAP44XX_SCU_BASE 0x48240000
38#define OMAP44XX_VA_SCU_BASE IO_ADDRESS(OMAP44XX_SCU_BASE)
39#define OMAP44XX_LOCAL_TWD_BASE 0x48240600
40#define OMAP44XX_VA_LOCAL_TWD_BASE IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE)
41#define OMAP44XX_LOCAL_TWD_SIZE 0x00000100
42#define OMAP44XX_WKUPGEN_BASE 0x48281000
43#define OMAP44XX_VA_WKUPGEN_BASE IO_ADDRESS(OMAP44XX_WKUPGEN_BASE)
44
45#endif /* __ASM_ARCH_OMAP44XX_H */
46
diff --git a/arch/arm/plat-omap/include/mach/onenand.h b/arch/arm/plat-omap/include/mach/onenand.h
index 4649d302c263..72f433d7d827 100644
--- a/arch/arm/plat-omap/include/mach/onenand.h
+++ b/arch/arm/plat-omap/include/mach/onenand.h
@@ -9,8 +9,12 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/mtd/mtd.h>
12#include <linux/mtd/partitions.h> 13#include <linux/mtd/partitions.h>
13 14
15#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1)
17
14struct omap_onenand_platform_data { 18struct omap_onenand_platform_data {
15 int cs; 19 int cs;
16 int gpio_irq; 20 int gpio_irq;
@@ -18,8 +22,22 @@ struct omap_onenand_platform_data {
18 int nr_parts; 22 int nr_parts;
19 int (*onenand_setup)(void __iomem *, int freq); 23 int (*onenand_setup)(void __iomem *, int freq);
20 int dma_channel; 24 int dma_channel;
25 u8 flags;
21}; 26};
22 27
23int omap2_onenand_rephase(void);
24
25#define ONENAND_MAX_PARTITIONS 8 28#define ONENAND_MAX_PARTITIONS 8
29
30#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
31 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
32
33extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
34
35#else
36
37#define board_onenand_data NULL
38
39static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
40{
41}
42
43#endif
diff --git a/arch/arm/plat-omap/include/mach/serial.h b/arch/arm/plat-omap/include/mach/serial.h
index 8a676a04be48..13abd02d1527 100644
--- a/arch/arm/plat-omap/include/mach/serial.h
+++ b/arch/arm/plat-omap/include/mach/serial.h
@@ -1,5 +1,8 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/serial.h 2 * arch/arm/plat-omap/include/mach/serial.h
3 *
4 * Copyright (C) 2009 Texas Instruments
5 * Addded OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
3 * 6 *
4 * This program is distributed in the hope that it will be useful, 7 * This program is distributed in the hope that it will be useful,
5 * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,19 +18,28 @@
15#define OMAP_UART1_BASE 0xfffb0000 18#define OMAP_UART1_BASE 0xfffb0000
16#define OMAP_UART2_BASE 0xfffb0800 19#define OMAP_UART2_BASE 0xfffb0800
17#define OMAP_UART3_BASE 0xfffb9800 20#define OMAP_UART3_BASE 0xfffb9800
21#define OMAP_MAX_NR_PORTS 3
18#elif defined(CONFIG_ARCH_OMAP2) 22#elif defined(CONFIG_ARCH_OMAP2)
19/* OMAP2 serial ports */ 23/* OMAP2 serial ports */
20#define OMAP_UART1_BASE 0x4806a000 24#define OMAP_UART1_BASE 0x4806a000
21#define OMAP_UART2_BASE 0x4806c000 25#define OMAP_UART2_BASE 0x4806c000
22#define OMAP_UART3_BASE 0x4806e000 26#define OMAP_UART3_BASE 0x4806e000
27#define OMAP_MAX_NR_PORTS 3
23#elif defined(CONFIG_ARCH_OMAP3) 28#elif defined(CONFIG_ARCH_OMAP3)
24/* OMAP3 serial ports */ 29/* OMAP3 serial ports */
25#define OMAP_UART1_BASE 0x4806a000 30#define OMAP_UART1_BASE 0x4806a000
26#define OMAP_UART2_BASE 0x4806c000 31#define OMAP_UART2_BASE 0x4806c000
27#define OMAP_UART3_BASE 0x49020000 32#define OMAP_UART3_BASE 0x49020000
33#define OMAP_MAX_NR_PORTS 3
34#elif defined(CONFIG_ARCH_OMAP4)
35/* OMAP4 serial ports */
36#define OMAP_UART1_BASE 0x4806a000
37#define OMAP_UART2_BASE 0x4806c000
38#define OMAP_UART3_BASE 0x48020000
39#define OMAP_UART4_BASE 0x4806e000
40#define OMAP_MAX_NR_PORTS 4
28#endif 41#endif
29 42
30#define OMAP_MAX_NR_PORTS 3
31#define OMAP1510_BASE_BAUD (12000000/16) 43#define OMAP1510_BASE_BAUD (12000000/16)
32#define OMAP16XX_BASE_BAUD (48000000/16) 44#define OMAP16XX_BASE_BAUD (48000000/16)
33#define OMAP24XX_BASE_BAUD (48000000/16) 45#define OMAP24XX_BASE_BAUD (48000000/16)
@@ -40,4 +52,13 @@
40 __ret; \ 52 __ret; \
41 }) 53 })
42 54
55#ifndef __ASSEMBLER__
56extern void omap_serial_init(void);
57extern int omap_uart_can_sleep(void);
58extern void omap_uart_check_wakeup(void);
59extern void omap_uart_prepare_suspend(void);
60extern void omap_uart_prepare_idle(int num);
61extern void omap_uart_resume_idle(int num);
62#endif
63
43#endif 64#endif
diff --git a/arch/arm/plat-omap/include/mach/smp.h b/arch/arm/plat-omap/include/mach/smp.h
new file mode 100644
index 000000000000..dcaa8fde7063
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/smp.h
@@ -0,0 +1,51 @@
1/*
2 * OMAP4 machine specific smp.h
3 *
4 * Copyright (C) 2009 Texas Instruments, Inc.
5 *
6 * Author:
7 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * Interface functions needed for the SMP. This file is based on arm
10 * realview smp platform.
11 * Copyright (c) 2003 ARM Limited.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17#ifndef OMAP_ARCH_SMP_H
18#define OMAP_ARCH_SMP_H
19
20#include <asm/hardware/gic.h>
21
22/*
23 * set_event() is used to wake up secondary core from wfe using sev. ROM
24 * code puts the second core into wfe(standby).
25 *
26 */
27#define set_event() __asm__ __volatile__ ("sev" : : : "memory")
28
29/* Needed for secondary core boot */
30extern void omap_secondary_startup(void);
31
32/*
33 * We use Soft IRQ1 as the IPI
34 */
35static inline void smp_cross_call(const struct cpumask *mask)
36{
37 gic_raise_softirq(mask, 1);
38}
39
40/*
41 * Read MPIDR: Multiprocessor affinity register
42 */
43#define hard_smp_processor_id() \
44 ({ \
45 unsigned int cpunum; \
46 __asm__("mrc p15, 0, %0, c0, c0, 5" \
47 : "=r" (cpunum)); \
48 cpunum &= 0x0F; \
49 })
50
51#endif
diff --git a/arch/arm/plat-omap/include/mach/sram.h b/arch/arm/plat-omap/include/mach/sram.h
index ab35d622dcf5..dca7c16ae903 100644
--- a/arch/arm/plat-omap/include/mach/sram.h
+++ b/arch/arm/plat-omap/include/mach/sram.h
@@ -23,7 +23,8 @@ extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
23 23
24extern u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, 24extern u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl,
25 u32 sdrc_actim_ctrla, 25 u32 sdrc_actim_ctrla,
26 u32 sdrc_actim_ctrlb, u32 m2); 26 u32 sdrc_actim_ctrlb, u32 m2,
27 u32 unlock_dll);
27 28
28/* Do not use these */ 29/* Do not use these */
29extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 30extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
@@ -60,7 +61,8 @@ extern unsigned long omap243x_sram_reprogram_sdrc_sz;
60 61
61extern u32 omap3_sram_configure_core_dpll(u32 sdrc_rfr_ctrl, 62extern u32 omap3_sram_configure_core_dpll(u32 sdrc_rfr_ctrl,
62 u32 sdrc_actim_ctrla, 63 u32 sdrc_actim_ctrla,
63 u32 sdrc_actim_ctrlb, u32 m2); 64 u32 sdrc_actim_ctrlb, u32 m2,
65 u32 unlock_dll);
64extern unsigned long omap3_sram_configure_core_dpll_sz; 66extern unsigned long omap3_sram_configure_core_dpll_sz;
65 67
66#endif 68#endif
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index 69f0ceed500b..f337e1761e2c 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,13 +27,7 @@
27#define UDC_BASE OMAP2_UDC_BASE 27#define UDC_BASE OMAP2_UDC_BASE
28#define OMAP_OHCI_BASE OMAP2_OHCI_BASE 28#define OMAP_OHCI_BASE OMAP2_OHCI_BASE
29 29
30#ifdef CONFIG_USB_MUSB_SOC
31extern void usb_musb_init(void); 30extern void usb_musb_init(void);
32#else
33static inline void usb_musb_init(void)
34{
35}
36#endif
37 31
38#endif 32#endif
39 33
diff --git a/arch/arm/plat-omap/include/mach/vmalloc.h b/arch/arm/plat-omap/include/mach/vmalloc.h
index dc104cd96197..b97dfafeebda 100644
--- a/arch/arm/plat-omap/include/mach/vmalloc.h
+++ b/arch/arm/plat-omap/include/mach/vmalloc.h
@@ -17,5 +17,5 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x18000000)
21 21
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index af326efc1ad3..9b42d72d96cf 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -1,3 +1,14 @@
1/*
2 * Common io.c file
3 * This file is created by Russell King <rmk+kernel@arm.linux.org.uk>
4 *
5 * Copyright (C) 2009 Texas Instruments
6 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
1#include <linux/module.h> 12#include <linux/module.h>
2#include <linux/io.h> 13#include <linux/io.h>
3#include <linux/mm.h> 14#include <linux/mm.h>
@@ -7,6 +18,7 @@
7#include <mach/omap16xx.h> 18#include <mach/omap16xx.h>
8#include <mach/omap24xx.h> 19#include <mach/omap24xx.h>
9#include <mach/omap34xx.h> 20#include <mach/omap34xx.h>
21#include <mach/omap44xx.h>
10 22
11#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) 23#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz)))
12#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) 24#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst)))
@@ -92,7 +104,22 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
92 return XLATE(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_VIRT); 104 return XLATE(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_VIRT);
93 } 105 }
94#endif 106#endif
95 107#ifdef CONFIG_ARCH_OMAP4
108 if (cpu_is_omap44xx()) {
109 if (BETWEEN(p, L3_44XX_PHYS, L3_44XX_SIZE))
110 return XLATE(p, L3_44XX_PHYS, L3_44XX_VIRT);
111 if (BETWEEN(p, L4_44XX_PHYS, L4_44XX_SIZE))
112 return XLATE(p, L4_44XX_PHYS, L4_44XX_VIRT);
113 if (BETWEEN(p, L4_WK_44XX_PHYS, L4_WK_44XX_SIZE))
114 return XLATE(p, L4_WK_44XX_PHYS, L4_WK_44XX_VIRT);
115 if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE))
116 return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT);
117 if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE))
118 return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT);
119 if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE))
120 return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT);
121 }
122#endif
96 return __arm_ioremap(p, size, type); 123 return __arm_ioremap(p, size, type);
97} 124}
98EXPORT_SYMBOL(omap_ioremap); 125EXPORT_SYMBOL(omap_ioremap);
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
new file mode 100644
index 000000000000..4cf449fa2cb5
--- /dev/null
+++ b/arch/arm/plat-omap/iommu.c
@@ -0,0 +1,996 @@
1/*
2 * omap iommu: tlb and pagetable primitives
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
7 * Paul Mundt and Toshihiro Kobayashi
8 *
9 * This program 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
14#include <linux/err.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/clk.h>
19#include <linux/platform_device.h>
20
21#include <asm/cacheflush.h>
22
23#include <mach/iommu.h>
24
25#include "iopgtable.h"
26
27/* accommodate the difference between omap1 and omap2/3 */
28static const struct iommu_functions *arch_iommu;
29
30static struct platform_driver omap_iommu_driver;
31static struct kmem_cache *iopte_cachep;
32
33/**
34 * install_iommu_arch - Install archtecure specific iommu functions
35 * @ops: a pointer to architecture specific iommu functions
36 *
37 * There are several kind of iommu algorithm(tlb, pagetable) among
38 * omap series. This interface installs such an iommu algorighm.
39 **/
40int install_iommu_arch(const struct iommu_functions *ops)
41{
42 if (arch_iommu)
43 return -EBUSY;
44
45 arch_iommu = ops;
46 return 0;
47}
48EXPORT_SYMBOL_GPL(install_iommu_arch);
49
50/**
51 * uninstall_iommu_arch - Uninstall archtecure specific iommu functions
52 * @ops: a pointer to architecture specific iommu functions
53 *
54 * This interface uninstalls the iommu algorighm installed previously.
55 **/
56void uninstall_iommu_arch(const struct iommu_functions *ops)
57{
58 if (arch_iommu != ops)
59 pr_err("%s: not your arch\n", __func__);
60
61 arch_iommu = NULL;
62}
63EXPORT_SYMBOL_GPL(uninstall_iommu_arch);
64
65/**
66 * iommu_save_ctx - Save registers for pm off-mode support
67 * @obj: target iommu
68 **/
69void iommu_save_ctx(struct iommu *obj)
70{
71 arch_iommu->save_ctx(obj);
72}
73EXPORT_SYMBOL_GPL(iommu_save_ctx);
74
75/**
76 * iommu_restore_ctx - Restore registers for pm off-mode support
77 * @obj: target iommu
78 **/
79void iommu_restore_ctx(struct iommu *obj)
80{
81 arch_iommu->restore_ctx(obj);
82}
83EXPORT_SYMBOL_GPL(iommu_restore_ctx);
84
85/**
86 * iommu_arch_version - Return running iommu arch version
87 **/
88u32 iommu_arch_version(void)
89{
90 return arch_iommu->version;
91}
92EXPORT_SYMBOL_GPL(iommu_arch_version);
93
94static int iommu_enable(struct iommu *obj)
95{
96 int err;
97
98 if (!obj)
99 return -EINVAL;
100
101 clk_enable(obj->clk);
102
103 err = arch_iommu->enable(obj);
104
105 clk_disable(obj->clk);
106 return err;
107}
108
109static void iommu_disable(struct iommu *obj)
110{
111 if (!obj)
112 return;
113
114 clk_enable(obj->clk);
115
116 arch_iommu->disable(obj);
117
118 clk_disable(obj->clk);
119}
120
121/*
122 * TLB operations
123 */
124void iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
125{
126 BUG_ON(!cr || !e);
127
128 arch_iommu->cr_to_e(cr, e);
129}
130EXPORT_SYMBOL_GPL(iotlb_cr_to_e);
131
132static inline int iotlb_cr_valid(struct cr_regs *cr)
133{
134 if (!cr)
135 return -EINVAL;
136
137 return arch_iommu->cr_valid(cr);
138}
139
140static inline struct cr_regs *iotlb_alloc_cr(struct iommu *obj,
141 struct iotlb_entry *e)
142{
143 if (!e)
144 return NULL;
145
146 return arch_iommu->alloc_cr(obj, e);
147}
148
149u32 iotlb_cr_to_virt(struct cr_regs *cr)
150{
151 return arch_iommu->cr_to_virt(cr);
152}
153EXPORT_SYMBOL_GPL(iotlb_cr_to_virt);
154
155static u32 get_iopte_attr(struct iotlb_entry *e)
156{
157 return arch_iommu->get_pte_attr(e);
158}
159
160static u32 iommu_report_fault(struct iommu *obj, u32 *da)
161{
162 return arch_iommu->fault_isr(obj, da);
163}
164
165static void iotlb_lock_get(struct iommu *obj, struct iotlb_lock *l)
166{
167 u32 val;
168
169 val = iommu_read_reg(obj, MMU_LOCK);
170
171 l->base = MMU_LOCK_BASE(val);
172 l->vict = MMU_LOCK_VICT(val);
173
174 BUG_ON(l->base != 0); /* Currently no preservation is used */
175}
176
177static void iotlb_lock_set(struct iommu *obj, struct iotlb_lock *l)
178{
179 u32 val;
180
181 BUG_ON(l->base != 0); /* Currently no preservation is used */
182
183 val = (l->base << MMU_LOCK_BASE_SHIFT);
184 val |= (l->vict << MMU_LOCK_VICT_SHIFT);
185
186 iommu_write_reg(obj, val, MMU_LOCK);
187}
188
189static void iotlb_read_cr(struct iommu *obj, struct cr_regs *cr)
190{
191 arch_iommu->tlb_read_cr(obj, cr);
192}
193
194static void iotlb_load_cr(struct iommu *obj, struct cr_regs *cr)
195{
196 arch_iommu->tlb_load_cr(obj, cr);
197
198 iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
199 iommu_write_reg(obj, 1, MMU_LD_TLB);
200}
201
202/**
203 * iotlb_dump_cr - Dump an iommu tlb entry into buf
204 * @obj: target iommu
205 * @cr: contents of cam and ram register
206 * @buf: output buffer
207 **/
208static inline ssize_t iotlb_dump_cr(struct iommu *obj, struct cr_regs *cr,
209 char *buf)
210{
211 BUG_ON(!cr || !buf);
212
213 return arch_iommu->dump_cr(obj, cr, buf);
214}
215
216/**
217 * load_iotlb_entry - Set an iommu tlb entry
218 * @obj: target iommu
219 * @e: an iommu tlb entry info
220 **/
221int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e)
222{
223 int i;
224 int err = 0;
225 struct iotlb_lock l;
226 struct cr_regs *cr;
227
228 if (!obj || !obj->nr_tlb_entries || !e)
229 return -EINVAL;
230
231 clk_enable(obj->clk);
232
233 for (i = 0; i < obj->nr_tlb_entries; i++) {
234 struct cr_regs tmp;
235
236 iotlb_lock_get(obj, &l);
237 l.vict = i;
238 iotlb_lock_set(obj, &l);
239 iotlb_read_cr(obj, &tmp);
240 if (!iotlb_cr_valid(&tmp))
241 break;
242 }
243
244 if (i == obj->nr_tlb_entries) {
245 dev_dbg(obj->dev, "%s: full: no entry\n", __func__);
246 err = -EBUSY;
247 goto out;
248 }
249
250 cr = iotlb_alloc_cr(obj, e);
251 if (IS_ERR(cr)) {
252 clk_disable(obj->clk);
253 return PTR_ERR(cr);
254 }
255
256 iotlb_load_cr(obj, cr);
257 kfree(cr);
258
259 /* increment victim for next tlb load */
260 if (++l.vict == obj->nr_tlb_entries)
261 l.vict = 0;
262 iotlb_lock_set(obj, &l);
263out:
264 clk_disable(obj->clk);
265 return err;
266}
267EXPORT_SYMBOL_GPL(load_iotlb_entry);
268
269/**
270 * flush_iotlb_page - Clear an iommu tlb entry
271 * @obj: target iommu
272 * @da: iommu device virtual address
273 *
274 * Clear an iommu tlb entry which includes 'da' address.
275 **/
276void flush_iotlb_page(struct iommu *obj, u32 da)
277{
278 struct iotlb_lock l;
279 int i;
280
281 clk_enable(obj->clk);
282
283 for (i = 0; i < obj->nr_tlb_entries; i++) {
284 struct cr_regs cr;
285 u32 start;
286 size_t bytes;
287
288 iotlb_lock_get(obj, &l);
289 l.vict = i;
290 iotlb_lock_set(obj, &l);
291 iotlb_read_cr(obj, &cr);
292 if (!iotlb_cr_valid(&cr))
293 continue;
294
295 start = iotlb_cr_to_virt(&cr);
296 bytes = iopgsz_to_bytes(cr.cam & 3);
297
298 if ((start <= da) && (da < start + bytes)) {
299 dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n",
300 __func__, start, da, bytes);
301
302 iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
303 }
304 }
305 clk_disable(obj->clk);
306
307 if (i == obj->nr_tlb_entries)
308 dev_dbg(obj->dev, "%s: no page for %08x\n", __func__, da);
309}
310EXPORT_SYMBOL_GPL(flush_iotlb_page);
311
312/**
313 * flush_iotlb_range - Clear an iommu tlb entries
314 * @obj: target iommu
315 * @start: iommu device virtual address(start)
316 * @end: iommu device virtual address(end)
317 *
318 * Clear an iommu tlb entry which includes 'da' address.
319 **/
320void flush_iotlb_range(struct iommu *obj, u32 start, u32 end)
321{
322 u32 da = start;
323
324 while (da < end) {
325 flush_iotlb_page(obj, da);
326 /* FIXME: Optimize for multiple page size */
327 da += IOPTE_SIZE;
328 }
329}
330EXPORT_SYMBOL_GPL(flush_iotlb_range);
331
332/**
333 * flush_iotlb_all - Clear all iommu tlb entries
334 * @obj: target iommu
335 **/
336void flush_iotlb_all(struct iommu *obj)
337{
338 struct iotlb_lock l;
339
340 clk_enable(obj->clk);
341
342 l.base = 0;
343 l.vict = 0;
344 iotlb_lock_set(obj, &l);
345
346 iommu_write_reg(obj, 1, MMU_GFLUSH);
347
348 clk_disable(obj->clk);
349}
350EXPORT_SYMBOL_GPL(flush_iotlb_all);
351
352#if defined(CONFIG_OMAP_IOMMU_DEBUG_MODULE)
353
354ssize_t iommu_dump_ctx(struct iommu *obj, char *buf)
355{
356 ssize_t bytes;
357
358 if (!obj || !buf)
359 return -EINVAL;
360
361 clk_enable(obj->clk);
362
363 bytes = arch_iommu->dump_ctx(obj, buf);
364
365 clk_disable(obj->clk);
366
367 return bytes;
368}
369EXPORT_SYMBOL_GPL(iommu_dump_ctx);
370
371static int __dump_tlb_entries(struct iommu *obj, struct cr_regs *crs)
372{
373 int i;
374 struct iotlb_lock saved, l;
375 struct cr_regs *p = crs;
376
377 clk_enable(obj->clk);
378
379 iotlb_lock_get(obj, &saved);
380 memcpy(&l, &saved, sizeof(saved));
381
382 for (i = 0; i < obj->nr_tlb_entries; i++) {
383 struct cr_regs tmp;
384
385 iotlb_lock_get(obj, &l);
386 l.vict = i;
387 iotlb_lock_set(obj, &l);
388 iotlb_read_cr(obj, &tmp);
389 if (!iotlb_cr_valid(&tmp))
390 continue;
391
392 *p++ = tmp;
393 }
394 iotlb_lock_set(obj, &saved);
395 clk_disable(obj->clk);
396
397 return p - crs;
398}
399
400/**
401 * dump_tlb_entries - dump cr arrays to given buffer
402 * @obj: target iommu
403 * @buf: output buffer
404 **/
405size_t dump_tlb_entries(struct iommu *obj, char *buf)
406{
407 int i, n;
408 struct cr_regs *cr;
409 char *p = buf;
410
411 cr = kcalloc(obj->nr_tlb_entries, sizeof(*cr), GFP_KERNEL);
412 if (!cr)
413 return 0;
414
415 n = __dump_tlb_entries(obj, cr);
416 for (i = 0; i < n; i++)
417 p += iotlb_dump_cr(obj, cr + i, p);
418 kfree(cr);
419
420 return p - buf;
421}
422EXPORT_SYMBOL_GPL(dump_tlb_entries);
423
424int foreach_iommu_device(void *data, int (*fn)(struct device *, void *))
425{
426 return driver_for_each_device(&omap_iommu_driver.driver,
427 NULL, data, fn);
428}
429EXPORT_SYMBOL_GPL(foreach_iommu_device);
430
431#endif /* CONFIG_OMAP_IOMMU_DEBUG_MODULE */
432
433/*
434 * H/W pagetable operations
435 */
436static void flush_iopgd_range(u32 *first, u32 *last)
437{
438 /* FIXME: L2 cache should be taken care of if it exists */
439 do {
440 asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pgd"
441 : : "r" (first));
442 first += L1_CACHE_BYTES / sizeof(*first);
443 } while (first <= last);
444}
445
446static void flush_iopte_range(u32 *first, u32 *last)
447{
448 /* FIXME: L2 cache should be taken care of if it exists */
449 do {
450 asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pte"
451 : : "r" (first));
452 first += L1_CACHE_BYTES / sizeof(*first);
453 } while (first <= last);
454}
455
456static void iopte_free(u32 *iopte)
457{
458 /* Note: freed iopte's must be clean ready for re-use */
459 kmem_cache_free(iopte_cachep, iopte);
460}
461
462static u32 *iopte_alloc(struct iommu *obj, u32 *iopgd, u32 da)
463{
464 u32 *iopte;
465
466 /* a table has already existed */
467 if (*iopgd)
468 goto pte_ready;
469
470 /*
471 * do the allocation outside the page table lock
472 */
473 spin_unlock(&obj->page_table_lock);
474 iopte = kmem_cache_zalloc(iopte_cachep, GFP_KERNEL);
475 spin_lock(&obj->page_table_lock);
476
477 if (!*iopgd) {
478 if (!iopte)
479 return ERR_PTR(-ENOMEM);
480
481 *iopgd = virt_to_phys(iopte) | IOPGD_TABLE;
482 flush_iopgd_range(iopgd, iopgd);
483
484 dev_vdbg(obj->dev, "%s: a new pte:%p\n", __func__, iopte);
485 } else {
486 /* We raced, free the reduniovant table */
487 iopte_free(iopte);
488 }
489
490pte_ready:
491 iopte = iopte_offset(iopgd, da);
492
493 dev_vdbg(obj->dev,
494 "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
495 __func__, da, iopgd, *iopgd, iopte, *iopte);
496
497 return iopte;
498}
499
500static int iopgd_alloc_section(struct iommu *obj, u32 da, u32 pa, u32 prot)
501{
502 u32 *iopgd = iopgd_offset(obj, da);
503
504 *iopgd = (pa & IOSECTION_MASK) | prot | IOPGD_SECTION;
505 flush_iopgd_range(iopgd, iopgd);
506 return 0;
507}
508
509static int iopgd_alloc_super(struct iommu *obj, u32 da, u32 pa, u32 prot)
510{
511 u32 *iopgd = iopgd_offset(obj, da);
512 int i;
513
514 for (i = 0; i < 16; i++)
515 *(iopgd + i) = (pa & IOSUPER_MASK) | prot | IOPGD_SUPER;
516 flush_iopgd_range(iopgd, iopgd + 15);
517 return 0;
518}
519
520static int iopte_alloc_page(struct iommu *obj, u32 da, u32 pa, u32 prot)
521{
522 u32 *iopgd = iopgd_offset(obj, da);
523 u32 *iopte = iopte_alloc(obj, iopgd, da);
524
525 if (IS_ERR(iopte))
526 return PTR_ERR(iopte);
527
528 *iopte = (pa & IOPAGE_MASK) | prot | IOPTE_SMALL;
529 flush_iopte_range(iopte, iopte);
530
531 dev_vdbg(obj->dev, "%s: da:%08x pa:%08x pte:%p *pte:%08x\n",
532 __func__, da, pa, iopte, *iopte);
533
534 return 0;
535}
536
537static int iopte_alloc_large(struct iommu *obj, u32 da, u32 pa, u32 prot)
538{
539 u32 *iopgd = iopgd_offset(obj, da);
540 u32 *iopte = iopte_alloc(obj, iopgd, da);
541 int i;
542
543 if (IS_ERR(iopte))
544 return PTR_ERR(iopte);
545
546 for (i = 0; i < 16; i++)
547 *(iopte + i) = (pa & IOLARGE_MASK) | prot | IOPTE_LARGE;
548 flush_iopte_range(iopte, iopte + 15);
549 return 0;
550}
551
552static int iopgtable_store_entry_core(struct iommu *obj, struct iotlb_entry *e)
553{
554 int (*fn)(struct iommu *, u32, u32, u32);
555 u32 prot;
556 int err;
557
558 if (!obj || !e)
559 return -EINVAL;
560
561 switch (e->pgsz) {
562 case MMU_CAM_PGSZ_16M:
563 fn = iopgd_alloc_super;
564 break;
565 case MMU_CAM_PGSZ_1M:
566 fn = iopgd_alloc_section;
567 break;
568 case MMU_CAM_PGSZ_64K:
569 fn = iopte_alloc_large;
570 break;
571 case MMU_CAM_PGSZ_4K:
572 fn = iopte_alloc_page;
573 break;
574 default:
575 fn = NULL;
576 BUG();
577 break;
578 }
579
580 prot = get_iopte_attr(e);
581
582 spin_lock(&obj->page_table_lock);
583 err = fn(obj, e->da, e->pa, prot);
584 spin_unlock(&obj->page_table_lock);
585
586 return err;
587}
588
589/**
590 * iopgtable_store_entry - Make an iommu pte entry
591 * @obj: target iommu
592 * @e: an iommu tlb entry info
593 **/
594int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e)
595{
596 int err;
597
598 flush_iotlb_page(obj, e->da);
599 err = iopgtable_store_entry_core(obj, e);
600#ifdef PREFETCH_IOTLB
601 if (!err)
602 load_iotlb_entry(obj, e);
603#endif
604 return err;
605}
606EXPORT_SYMBOL_GPL(iopgtable_store_entry);
607
608/**
609 * iopgtable_lookup_entry - Lookup an iommu pte entry
610 * @obj: target iommu
611 * @da: iommu device virtual address
612 * @ppgd: iommu pgd entry pointer to be returned
613 * @ppte: iommu pte entry pointer to be returned
614 **/
615void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte)
616{
617 u32 *iopgd, *iopte = NULL;
618
619 iopgd = iopgd_offset(obj, da);
620 if (!*iopgd)
621 goto out;
622
623 if (*iopgd & IOPGD_TABLE)
624 iopte = iopte_offset(iopgd, da);
625out:
626 *ppgd = iopgd;
627 *ppte = iopte;
628}
629EXPORT_SYMBOL_GPL(iopgtable_lookup_entry);
630
631static size_t iopgtable_clear_entry_core(struct iommu *obj, u32 da)
632{
633 size_t bytes;
634 u32 *iopgd = iopgd_offset(obj, da);
635 int nent = 1;
636
637 if (!*iopgd)
638 return 0;
639
640 if (*iopgd & IOPGD_TABLE) {
641 int i;
642 u32 *iopte = iopte_offset(iopgd, da);
643
644 bytes = IOPTE_SIZE;
645 if (*iopte & IOPTE_LARGE) {
646 nent *= 16;
647 /* rewind to the 1st entry */
648 iopte = (u32 *)((u32)iopte & IOLARGE_MASK);
649 }
650 bytes *= nent;
651 memset(iopte, 0, nent * sizeof(*iopte));
652 flush_iopte_range(iopte, iopte + (nent - 1) * sizeof(*iopte));
653
654 /*
655 * do table walk to check if this table is necessary or not
656 */
657 iopte = iopte_offset(iopgd, 0);
658 for (i = 0; i < PTRS_PER_IOPTE; i++)
659 if (iopte[i])
660 goto out;
661
662 iopte_free(iopte);
663 nent = 1; /* for the next L1 entry */
664 } else {
665 bytes = IOPGD_SIZE;
666 if (*iopgd & IOPGD_SUPER) {
667 nent *= 16;
668 /* rewind to the 1st entry */
669 iopgd = (u32 *)((u32)iopgd & IOSUPER_MASK);
670 }
671 bytes *= nent;
672 }
673 memset(iopgd, 0, nent * sizeof(*iopgd));
674 flush_iopgd_range(iopgd, iopgd + (nent - 1) * sizeof(*iopgd));
675out:
676 return bytes;
677}
678
679/**
680 * iopgtable_clear_entry - Remove an iommu pte entry
681 * @obj: target iommu
682 * @da: iommu device virtual address
683 **/
684size_t iopgtable_clear_entry(struct iommu *obj, u32 da)
685{
686 size_t bytes;
687
688 spin_lock(&obj->page_table_lock);
689
690 bytes = iopgtable_clear_entry_core(obj, da);
691 flush_iotlb_page(obj, da);
692
693 spin_unlock(&obj->page_table_lock);
694
695 return bytes;
696}
697EXPORT_SYMBOL_GPL(iopgtable_clear_entry);
698
699static void iopgtable_clear_entry_all(struct iommu *obj)
700{
701 int i;
702
703 spin_lock(&obj->page_table_lock);
704
705 for (i = 0; i < PTRS_PER_IOPGD; i++) {
706 u32 da;
707 u32 *iopgd;
708
709 da = i << IOPGD_SHIFT;
710 iopgd = iopgd_offset(obj, da);
711
712 if (!*iopgd)
713 continue;
714
715 if (*iopgd & IOPGD_TABLE)
716 iopte_free(iopte_offset(iopgd, 0));
717
718 *iopgd = 0;
719 flush_iopgd_range(iopgd, iopgd);
720 }
721
722 flush_iotlb_all(obj);
723
724 spin_unlock(&obj->page_table_lock);
725}
726
727/*
728 * Device IOMMU generic operations
729 */
730static irqreturn_t iommu_fault_handler(int irq, void *data)
731{
732 u32 stat, da;
733 u32 *iopgd, *iopte;
734 int err = -EIO;
735 struct iommu *obj = data;
736
737 if (!obj->refcount)
738 return IRQ_NONE;
739
740 /* Dynamic loading TLB or PTE */
741 if (obj->isr)
742 err = obj->isr(obj);
743
744 if (!err)
745 return IRQ_HANDLED;
746
747 clk_enable(obj->clk);
748 stat = iommu_report_fault(obj, &da);
749 clk_disable(obj->clk);
750 if (!stat)
751 return IRQ_HANDLED;
752
753 iopgd = iopgd_offset(obj, da);
754
755 if (!(*iopgd & IOPGD_TABLE)) {
756 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__,
757 da, iopgd, *iopgd);
758 return IRQ_NONE;
759 }
760
761 iopte = iopte_offset(iopgd, da);
762
763 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
764 __func__, da, iopgd, *iopgd, iopte, *iopte);
765
766 return IRQ_NONE;
767}
768
769static int device_match_by_alias(struct device *dev, void *data)
770{
771 struct iommu *obj = to_iommu(dev);
772 const char *name = data;
773
774 pr_debug("%s: %s %s\n", __func__, obj->name, name);
775
776 return strcmp(obj->name, name) == 0;
777}
778
779/**
780 * iommu_get - Get iommu handler
781 * @name: target iommu name
782 **/
783struct iommu *iommu_get(const char *name)
784{
785 int err = -ENOMEM;
786 struct device *dev;
787 struct iommu *obj;
788
789 dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name,
790 device_match_by_alias);
791 if (!dev)
792 return ERR_PTR(-ENODEV);
793
794 obj = to_iommu(dev);
795
796 mutex_lock(&obj->iommu_lock);
797
798 if (obj->refcount++ == 0) {
799 err = iommu_enable(obj);
800 if (err)
801 goto err_enable;
802 flush_iotlb_all(obj);
803 }
804
805 if (!try_module_get(obj->owner))
806 goto err_module;
807
808 mutex_unlock(&obj->iommu_lock);
809
810 dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
811 return obj;
812
813err_module:
814 if (obj->refcount == 1)
815 iommu_disable(obj);
816err_enable:
817 obj->refcount--;
818 mutex_unlock(&obj->iommu_lock);
819 return ERR_PTR(err);
820}
821EXPORT_SYMBOL_GPL(iommu_get);
822
823/**
824 * iommu_put - Put back iommu handler
825 * @obj: target iommu
826 **/
827void iommu_put(struct iommu *obj)
828{
829 if (!obj && IS_ERR(obj))
830 return;
831
832 mutex_lock(&obj->iommu_lock);
833
834 if (--obj->refcount == 0)
835 iommu_disable(obj);
836
837 module_put(obj->owner);
838
839 mutex_unlock(&obj->iommu_lock);
840
841 dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
842}
843EXPORT_SYMBOL_GPL(iommu_put);
844
845/*
846 * OMAP Device MMU(IOMMU) detection
847 */
848static int __devinit omap_iommu_probe(struct platform_device *pdev)
849{
850 int err = -ENODEV;
851 void *p;
852 int irq;
853 struct iommu *obj;
854 struct resource *res;
855 struct iommu_platform_data *pdata = pdev->dev.platform_data;
856
857 if (pdev->num_resources != 2)
858 return -EINVAL;
859
860 obj = kzalloc(sizeof(*obj) + MMU_REG_SIZE, GFP_KERNEL);
861 if (!obj)
862 return -ENOMEM;
863
864 obj->clk = clk_get(&pdev->dev, pdata->clk_name);
865 if (IS_ERR(obj->clk))
866 goto err_clk;
867
868 obj->nr_tlb_entries = pdata->nr_tlb_entries;
869 obj->name = pdata->name;
870 obj->dev = &pdev->dev;
871 obj->ctx = (void *)obj + sizeof(*obj);
872
873 mutex_init(&obj->iommu_lock);
874 mutex_init(&obj->mmap_lock);
875 spin_lock_init(&obj->page_table_lock);
876 INIT_LIST_HEAD(&obj->mmap);
877
878 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
879 if (!res) {
880 err = -ENODEV;
881 goto err_mem;
882 }
883 obj->regbase = ioremap(res->start, resource_size(res));
884 if (!obj->regbase) {
885 err = -ENOMEM;
886 goto err_mem;
887 }
888
889 res = request_mem_region(res->start, resource_size(res),
890 dev_name(&pdev->dev));
891 if (!res) {
892 err = -EIO;
893 goto err_mem;
894 }
895
896 irq = platform_get_irq(pdev, 0);
897 if (irq < 0) {
898 err = -ENODEV;
899 goto err_irq;
900 }
901 err = request_irq(irq, iommu_fault_handler, IRQF_SHARED,
902 dev_name(&pdev->dev), obj);
903 if (err < 0)
904 goto err_irq;
905 platform_set_drvdata(pdev, obj);
906
907 p = (void *)__get_free_pages(GFP_KERNEL, get_order(IOPGD_TABLE_SIZE));
908 if (!p) {
909 err = -ENOMEM;
910 goto err_pgd;
911 }
912 memset(p, 0, IOPGD_TABLE_SIZE);
913 clean_dcache_area(p, IOPGD_TABLE_SIZE);
914 obj->iopgd = p;
915
916 BUG_ON(!IS_ALIGNED((unsigned long)obj->iopgd, IOPGD_TABLE_SIZE));
917
918 dev_info(&pdev->dev, "%s registered\n", obj->name);
919 return 0;
920
921err_pgd:
922 free_irq(irq, obj);
923err_irq:
924 release_mem_region(res->start, resource_size(res));
925 iounmap(obj->regbase);
926err_mem:
927 clk_put(obj->clk);
928err_clk:
929 kfree(obj);
930 return err;
931}
932
933static int __devexit omap_iommu_remove(struct platform_device *pdev)
934{
935 int irq;
936 struct resource *res;
937 struct iommu *obj = platform_get_drvdata(pdev);
938
939 platform_set_drvdata(pdev, NULL);
940
941 iopgtable_clear_entry_all(obj);
942 free_pages((unsigned long)obj->iopgd, get_order(IOPGD_TABLE_SIZE));
943
944 irq = platform_get_irq(pdev, 0);
945 free_irq(irq, obj);
946 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
947 release_mem_region(res->start, resource_size(res));
948 iounmap(obj->regbase);
949
950 clk_put(obj->clk);
951 dev_info(&pdev->dev, "%s removed\n", obj->name);
952 kfree(obj);
953 return 0;
954}
955
956static struct platform_driver omap_iommu_driver = {
957 .probe = omap_iommu_probe,
958 .remove = __devexit_p(omap_iommu_remove),
959 .driver = {
960 .name = "omap-iommu",
961 },
962};
963
964static void iopte_cachep_ctor(void *iopte)
965{
966 clean_dcache_area(iopte, IOPTE_TABLE_SIZE);
967}
968
969static int __init omap_iommu_init(void)
970{
971 struct kmem_cache *p;
972 const unsigned long flags = SLAB_HWCACHE_ALIGN;
973 size_t align = 1 << 10; /* L2 pagetable alignement */
974
975 p = kmem_cache_create("iopte_cache", IOPTE_TABLE_SIZE, align, flags,
976 iopte_cachep_ctor);
977 if (!p)
978 return -ENOMEM;
979 iopte_cachep = p;
980
981 return platform_driver_register(&omap_iommu_driver);
982}
983module_init(omap_iommu_init);
984
985static void __exit omap_iommu_exit(void)
986{
987 kmem_cache_destroy(iopte_cachep);
988
989 platform_driver_unregister(&omap_iommu_driver);
990}
991module_exit(omap_iommu_exit);
992
993MODULE_DESCRIPTION("omap iommu: tlb and pagetable primitives");
994MODULE_ALIAS("platform:omap-iommu");
995MODULE_AUTHOR("Hiroshi DOYU, Paul Mundt and Toshihiro Kobayashi");
996MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/plat-omap/iopgtable.h b/arch/arm/plat-omap/iopgtable.h
new file mode 100644
index 000000000000..37dac434c7a1
--- /dev/null
+++ b/arch/arm/plat-omap/iopgtable.h
@@ -0,0 +1,72 @@
1/*
2 * omap iommu: pagetable definitions
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __PLAT_OMAP_IOMMU_H
14#define __PLAT_OMAP_IOMMU_H
15
16#define IOPGD_SHIFT 20
17#define IOPGD_SIZE (1 << IOPGD_SHIFT)
18#define IOPGD_MASK (~(IOPGD_SIZE - 1))
19#define IOSECTION_MASK IOPGD_MASK
20#define PTRS_PER_IOPGD (1 << (32 - IOPGD_SHIFT))
21#define IOPGD_TABLE_SIZE (PTRS_PER_IOPGD * sizeof(u32))
22
23#define IOSUPER_SIZE (IOPGD_SIZE << 4)
24#define IOSUPER_MASK (~(IOSUPER_SIZE - 1))
25
26#define IOPTE_SHIFT 12
27#define IOPTE_SIZE (1 << IOPTE_SHIFT)
28#define IOPTE_MASK (~(IOPTE_SIZE - 1))
29#define IOPAGE_MASK IOPTE_MASK
30#define PTRS_PER_IOPTE (1 << (IOPGD_SHIFT - IOPTE_SHIFT))
31#define IOPTE_TABLE_SIZE (PTRS_PER_IOPTE * sizeof(u32))
32
33#define IOLARGE_SIZE (IOPTE_SIZE << 4)
34#define IOLARGE_MASK (~(IOLARGE_SIZE - 1))
35
36#define IOPGD_TABLE (1 << 0)
37#define IOPGD_SECTION (2 << 0)
38#define IOPGD_SUPER (1 << 18 | 2 << 0)
39
40#define IOPTE_SMALL (2 << 0)
41#define IOPTE_LARGE (1 << 0)
42
43#define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1))
44#define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da))
45
46#define iopte_paddr(iopgd) (*iopgd & ~((1 << 10) - 1))
47#define iopte_vaddr(iopgd) ((u32 *)phys_to_virt(iopte_paddr(iopgd)))
48
49#define iopte_index(da) (((da) >> IOPTE_SHIFT) & (PTRS_PER_IOPTE - 1))
50#define iopte_offset(iopgd, da) (iopte_vaddr(iopgd) + iopte_index(da))
51
52static inline u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa,
53 u32 flags)
54{
55 memset(e, 0, sizeof(*e));
56
57 e->da = da;
58 e->pa = pa;
59 e->valid = 1;
60 /* FIXME: add OMAP1 support */
61 e->pgsz = flags & MMU_CAM_PGSZ_MASK;
62 e->endian = flags & MMU_RAM_ENDIAN_MASK;
63 e->elsz = flags & MMU_RAM_ELSZ_MASK;
64 e->mixed = flags & MMU_RAM_MIXED_MASK;
65
66 return iopgsz_to_bytes(e->pgsz);
67}
68
69#define to_iommu(dev) \
70 (struct iommu *)platform_get_drvdata(to_platform_device(dev))
71
72#endif /* __PLAT_OMAP_IOMMU_H */
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
new file mode 100644
index 000000000000..2fce2c151a95
--- /dev/null
+++ b/arch/arm/plat-omap/iovmm.c
@@ -0,0 +1,896 @@
1/*
2 * omap iommu: simple virtual address space management
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/err.h>
14#include <linux/vmalloc.h>
15#include <linux/device.h>
16#include <linux/scatterlist.h>
17
18#include <asm/cacheflush.h>
19#include <asm/mach/map.h>
20
21#include <mach/iommu.h>
22#include <mach/iovmm.h>
23
24#include "iopgtable.h"
25
26/*
27 * A device driver needs to create address mappings between:
28 *
29 * - iommu/device address
30 * - physical address
31 * - mpu virtual address
32 *
33 * There are 4 possible patterns for them:
34 *
35 * |iova/ mapping iommu_ page
36 * | da pa va (d)-(p)-(v) function type
37 * ---------------------------------------------------------------------------
38 * 1 | c c c 1 - 1 - 1 _kmap() / _kunmap() s
39 * 2 | c c,a c 1 - 1 - 1 _kmalloc()/ _kfree() s
40 * 3 | c d c 1 - n - 1 _vmap() / _vunmap() s
41 * 4 | c d,a c 1 - n - 1 _vmalloc()/ _vfree() n*
42 *
43 *
44 * 'iova': device iommu virtual address
45 * 'da': alias of 'iova'
46 * 'pa': physical address
47 * 'va': mpu virtual address
48 *
49 * 'c': contiguous memory area
50 * 'd': dicontiguous memory area
51 * 'a': anonymous memory allocation
52 * '()': optional feature
53 *
54 * 'n': a normal page(4KB) size is used.
55 * 's': multiple iommu superpage(16MB, 1MB, 64KB, 4KB) size is used.
56 *
57 * '*': not yet, but feasible.
58 */
59
60static struct kmem_cache *iovm_area_cachep;
61
62/* return total bytes of sg buffers */
63static size_t sgtable_len(const struct sg_table *sgt)
64{
65 unsigned int i, total = 0;
66 struct scatterlist *sg;
67
68 if (!sgt)
69 return 0;
70
71 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
72 size_t bytes;
73
74 bytes = sg_dma_len(sg);
75
76 if (!iopgsz_ok(bytes)) {
77 pr_err("%s: sg[%d] not iommu pagesize(%x)\n",
78 __func__, i, bytes);
79 return 0;
80 }
81
82 total += bytes;
83 }
84
85 return total;
86}
87#define sgtable_ok(x) (!!sgtable_len(x))
88
89/*
90 * calculate the optimal number sg elements from total bytes based on
91 * iommu superpages
92 */
93static unsigned int sgtable_nents(size_t bytes)
94{
95 int i;
96 unsigned int nr_entries;
97 const unsigned long pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
98
99 if (!IS_ALIGNED(bytes, PAGE_SIZE)) {
100 pr_err("%s: wrong size %08x\n", __func__, bytes);
101 return 0;
102 }
103
104 nr_entries = 0;
105 for (i = 0; i < ARRAY_SIZE(pagesize); i++) {
106 if (bytes >= pagesize[i]) {
107 nr_entries += (bytes / pagesize[i]);
108 bytes %= pagesize[i];
109 }
110 }
111 BUG_ON(bytes);
112
113 return nr_entries;
114}
115
116/* allocate and initialize sg_table header(a kind of 'superblock') */
117static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags)
118{
119 unsigned int nr_entries;
120 int err;
121 struct sg_table *sgt;
122
123 if (!bytes)
124 return ERR_PTR(-EINVAL);
125
126 if (!IS_ALIGNED(bytes, PAGE_SIZE))
127 return ERR_PTR(-EINVAL);
128
129 /* FIXME: IOVMF_DA_FIXED should support 'superpages' */
130 if ((flags & IOVMF_LINEAR) && (flags & IOVMF_DA_ANON)) {
131 nr_entries = sgtable_nents(bytes);
132 if (!nr_entries)
133 return ERR_PTR(-EINVAL);
134 } else
135 nr_entries = bytes / PAGE_SIZE;
136
137 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
138 if (!sgt)
139 return ERR_PTR(-ENOMEM);
140
141 err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL);
142 if (err)
143 return ERR_PTR(err);
144
145 pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries);
146
147 return sgt;
148}
149
150/* free sg_table header(a kind of superblock) */
151static void sgtable_free(struct sg_table *sgt)
152{
153 if (!sgt)
154 return;
155
156 sg_free_table(sgt);
157 kfree(sgt);
158
159 pr_debug("%s: sgt:%p\n", __func__, sgt);
160}
161
162/* map 'sglist' to a contiguous mpu virtual area and return 'va' */
163static void *vmap_sg(const struct sg_table *sgt)
164{
165 u32 va;
166 size_t total;
167 unsigned int i;
168 struct scatterlist *sg;
169 struct vm_struct *new;
170 const struct mem_type *mtype;
171
172 mtype = get_mem_type(MT_DEVICE);
173 if (!mtype)
174 return ERR_PTR(-EINVAL);
175
176 total = sgtable_len(sgt);
177 if (!total)
178 return ERR_PTR(-EINVAL);
179
180 new = __get_vm_area(total, VM_IOREMAP, VMALLOC_START, VMALLOC_END);
181 if (!new)
182 return ERR_PTR(-ENOMEM);
183 va = (u32)new->addr;
184
185 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
186 size_t bytes;
187 u32 pa;
188 int err;
189
190 pa = sg_phys(sg);
191 bytes = sg_dma_len(sg);
192
193 BUG_ON(bytes != PAGE_SIZE);
194
195 err = ioremap_page(va, pa, mtype);
196 if (err)
197 goto err_out;
198
199 va += bytes;
200 }
201
202 flush_cache_vmap(new->addr, total);
203 return new->addr;
204
205err_out:
206 WARN_ON(1); /* FIXME: cleanup some mpu mappings */
207 vunmap(new->addr);
208 return ERR_PTR(-EAGAIN);
209}
210
211static inline void vunmap_sg(const void *va)
212{
213 vunmap(va);
214}
215
216static struct iovm_struct *__find_iovm_area(struct iommu *obj, const u32 da)
217{
218 struct iovm_struct *tmp;
219
220 list_for_each_entry(tmp, &obj->mmap, list) {
221 if ((da >= tmp->da_start) && (da < tmp->da_end)) {
222 size_t len;
223
224 len = tmp->da_end - tmp->da_start;
225
226 dev_dbg(obj->dev, "%s: %08x-%08x-%08x(%x) %08x\n",
227 __func__, tmp->da_start, da, tmp->da_end, len,
228 tmp->flags);
229
230 return tmp;
231 }
232 }
233
234 return NULL;
235}
236
237/**
238 * find_iovm_area - find iovma which includes @da
239 * @da: iommu device virtual address
240 *
241 * Find the existing iovma starting at @da
242 */
243struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da)
244{
245 struct iovm_struct *area;
246
247 mutex_lock(&obj->mmap_lock);
248 area = __find_iovm_area(obj, da);
249 mutex_unlock(&obj->mmap_lock);
250
251 return area;
252}
253EXPORT_SYMBOL_GPL(find_iovm_area);
254
255/*
256 * This finds the hole(area) which fits the requested address and len
257 * in iovmas mmap, and returns the new allocated iovma.
258 */
259static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
260 size_t bytes, u32 flags)
261{
262 struct iovm_struct *new, *tmp;
263 u32 start, prev_end, alignement;
264
265 if (!obj || !bytes)
266 return ERR_PTR(-EINVAL);
267
268 start = da;
269 alignement = PAGE_SIZE;
270
271 if (flags & IOVMF_DA_ANON) {
272 /*
273 * Reserve the first page for NULL
274 */
275 start = PAGE_SIZE;
276 if (flags & IOVMF_LINEAR)
277 alignement = iopgsz_max(bytes);
278 start = roundup(start, alignement);
279 }
280
281 tmp = NULL;
282 if (list_empty(&obj->mmap))
283 goto found;
284
285 prev_end = 0;
286 list_for_each_entry(tmp, &obj->mmap, list) {
287
288 if ((prev_end <= start) && (start + bytes < tmp->da_start))
289 goto found;
290
291 if (flags & IOVMF_DA_ANON)
292 start = roundup(tmp->da_end, alignement);
293
294 prev_end = tmp->da_end;
295 }
296
297 if ((start >= prev_end) && (ULONG_MAX - start >= bytes))
298 goto found;
299
300 dev_dbg(obj->dev, "%s: no space to fit %08x(%x) flags: %08x\n",
301 __func__, da, bytes, flags);
302
303 return ERR_PTR(-EINVAL);
304
305found:
306 new = kmem_cache_zalloc(iovm_area_cachep, GFP_KERNEL);
307 if (!new)
308 return ERR_PTR(-ENOMEM);
309
310 new->iommu = obj;
311 new->da_start = start;
312 new->da_end = start + bytes;
313 new->flags = flags;
314
315 /*
316 * keep ascending order of iovmas
317 */
318 if (tmp)
319 list_add_tail(&new->list, &tmp->list);
320 else
321 list_add(&new->list, &obj->mmap);
322
323 dev_dbg(obj->dev, "%s: found %08x-%08x-%08x(%x) %08x\n",
324 __func__, new->da_start, start, new->da_end, bytes, flags);
325
326 return new;
327}
328
329static void free_iovm_area(struct iommu *obj, struct iovm_struct *area)
330{
331 size_t bytes;
332
333 BUG_ON(!obj || !area);
334
335 bytes = area->da_end - area->da_start;
336
337 dev_dbg(obj->dev, "%s: %08x-%08x(%x) %08x\n",
338 __func__, area->da_start, area->da_end, bytes, area->flags);
339
340 list_del(&area->list);
341 kmem_cache_free(iovm_area_cachep, area);
342}
343
344/**
345 * da_to_va - convert (d) to (v)
346 * @obj: objective iommu
347 * @da: iommu device virtual address
348 * @va: mpu virtual address
349 *
350 * Returns mpu virtual addr which corresponds to a given device virtual addr
351 */
352void *da_to_va(struct iommu *obj, u32 da)
353{
354 void *va = NULL;
355 struct iovm_struct *area;
356
357 mutex_lock(&obj->mmap_lock);
358
359 area = __find_iovm_area(obj, da);
360 if (!area) {
361 dev_dbg(obj->dev, "%s: no da area(%08x)\n", __func__, da);
362 goto out;
363 }
364 va = area->va;
365 mutex_unlock(&obj->mmap_lock);
366out:
367 return va;
368}
369EXPORT_SYMBOL_GPL(da_to_va);
370
371static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va)
372{
373 unsigned int i;
374 struct scatterlist *sg;
375 void *va = _va;
376 void *va_end;
377
378 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
379 struct page *pg;
380 const size_t bytes = PAGE_SIZE;
381
382 /*
383 * iommu 'superpage' isn't supported with 'iommu_vmalloc()'
384 */
385 pg = vmalloc_to_page(va);
386 BUG_ON(!pg);
387 sg_set_page(sg, pg, bytes, 0);
388
389 va += bytes;
390 }
391
392 va_end = _va + PAGE_SIZE * i;
393 flush_cache_vmap(_va, va_end);
394}
395
396static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
397{
398 /*
399 * Actually this is not necessary at all, just exists for
400 * consistency of the code readibility.
401 */
402 BUG_ON(!sgt);
403}
404
405static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
406{
407 unsigned int i;
408 struct scatterlist *sg;
409 void *va;
410
411 va = phys_to_virt(pa);
412
413 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
414 size_t bytes;
415
416 bytes = iopgsz_max(len);
417
418 BUG_ON(!iopgsz_ok(bytes));
419
420 sg_set_buf(sg, phys_to_virt(pa), bytes);
421 /*
422 * 'pa' is cotinuous(linear).
423 */
424 pa += bytes;
425 len -= bytes;
426 }
427 BUG_ON(len);
428
429 clean_dcache_area(va, len);
430}
431
432static inline void sgtable_drain_kmalloc(struct sg_table *sgt)
433{
434 /*
435 * Actually this is not necessary at all, just exists for
436 * consistency of the code readibility
437 */
438 BUG_ON(!sgt);
439}
440
441/* create 'da' <-> 'pa' mapping from 'sgt' */
442static int map_iovm_area(struct iommu *obj, struct iovm_struct *new,
443 const struct sg_table *sgt, u32 flags)
444{
445 int err;
446 unsigned int i, j;
447 struct scatterlist *sg;
448 u32 da = new->da_start;
449
450 if (!obj || !new || !sgt)
451 return -EINVAL;
452
453 BUG_ON(!sgtable_ok(sgt));
454
455 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
456 u32 pa;
457 int pgsz;
458 size_t bytes;
459 struct iotlb_entry e;
460
461 pa = sg_phys(sg);
462 bytes = sg_dma_len(sg);
463
464 flags &= ~IOVMF_PGSZ_MASK;
465 pgsz = bytes_to_iopgsz(bytes);
466 if (pgsz < 0)
467 goto err_out;
468 flags |= pgsz;
469
470 pr_debug("%s: [%d] %08x %08x(%x)\n", __func__,
471 i, da, pa, bytes);
472
473 iotlb_init_entry(&e, da, pa, flags);
474 err = iopgtable_store_entry(obj, &e);
475 if (err)
476 goto err_out;
477
478 da += bytes;
479 }
480 return 0;
481
482err_out:
483 da = new->da_start;
484
485 for_each_sg(sgt->sgl, sg, i, j) {
486 size_t bytes;
487
488 bytes = iopgtable_clear_entry(obj, da);
489
490 BUG_ON(!iopgsz_ok(bytes));
491
492 da += bytes;
493 }
494 return err;
495}
496
497/* release 'da' <-> 'pa' mapping */
498static void unmap_iovm_area(struct iommu *obj, struct iovm_struct *area)
499{
500 u32 start;
501 size_t total = area->da_end - area->da_start;
502
503 BUG_ON((!total) || !IS_ALIGNED(total, PAGE_SIZE));
504
505 start = area->da_start;
506 while (total > 0) {
507 size_t bytes;
508
509 bytes = iopgtable_clear_entry(obj, start);
510 if (bytes == 0)
511 bytes = PAGE_SIZE;
512 else
513 dev_dbg(obj->dev, "%s: unmap %08x(%x) %08x\n",
514 __func__, start, bytes, area->flags);
515
516 BUG_ON(!IS_ALIGNED(bytes, PAGE_SIZE));
517
518 total -= bytes;
519 start += bytes;
520 }
521 BUG_ON(total);
522}
523
524/* template function for all unmapping */
525static struct sg_table *unmap_vm_area(struct iommu *obj, const u32 da,
526 void (*fn)(const void *), u32 flags)
527{
528 struct sg_table *sgt = NULL;
529 struct iovm_struct *area;
530
531 if (!IS_ALIGNED(da, PAGE_SIZE)) {
532 dev_err(obj->dev, "%s: alignment err(%08x)\n", __func__, da);
533 return NULL;
534 }
535
536 mutex_lock(&obj->mmap_lock);
537
538 area = __find_iovm_area(obj, da);
539 if (!area) {
540 dev_dbg(obj->dev, "%s: no da area(%08x)\n", __func__, da);
541 goto out;
542 }
543
544 if ((area->flags & flags) != flags) {
545 dev_err(obj->dev, "%s: wrong flags(%08x)\n", __func__,
546 area->flags);
547 goto out;
548 }
549 sgt = (struct sg_table *)area->sgt;
550
551 unmap_iovm_area(obj, area);
552
553 fn(area->va);
554
555 dev_dbg(obj->dev, "%s: %08x-%08x-%08x(%x) %08x\n", __func__,
556 area->da_start, da, area->da_end,
557 area->da_end - area->da_start, area->flags);
558
559 free_iovm_area(obj, area);
560out:
561 mutex_unlock(&obj->mmap_lock);
562
563 return sgt;
564}
565
566static u32 map_iommu_region(struct iommu *obj, u32 da,
567 const struct sg_table *sgt, void *va, size_t bytes, u32 flags)
568{
569 int err = -ENOMEM;
570 struct iovm_struct *new;
571
572 mutex_lock(&obj->mmap_lock);
573
574 new = alloc_iovm_area(obj, da, bytes, flags);
575 if (IS_ERR(new)) {
576 err = PTR_ERR(new);
577 goto err_alloc_iovma;
578 }
579 new->va = va;
580 new->sgt = sgt;
581
582 if (map_iovm_area(obj, new, sgt, new->flags))
583 goto err_map;
584
585 mutex_unlock(&obj->mmap_lock);
586
587 dev_dbg(obj->dev, "%s: da:%08x(%x) flags:%08x va:%p\n",
588 __func__, new->da_start, bytes, new->flags, va);
589
590 return new->da_start;
591
592err_map:
593 free_iovm_area(obj, new);
594err_alloc_iovma:
595 mutex_unlock(&obj->mmap_lock);
596 return err;
597}
598
599static inline u32 __iommu_vmap(struct iommu *obj, u32 da,
600 const struct sg_table *sgt, void *va, size_t bytes, u32 flags)
601{
602 return map_iommu_region(obj, da, sgt, va, bytes, flags);
603}
604
605/**
606 * iommu_vmap - (d)-(p)-(v) address mapper
607 * @obj: objective iommu
608 * @sgt: address of scatter gather table
609 * @flags: iovma and page property
610 *
611 * Creates 1-n-1 mapping with given @sgt and returns @da.
612 * All @sgt element must be io page size aligned.
613 */
614u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
615 u32 flags)
616{
617 size_t bytes;
618 void *va;
619
620 if (!obj || !obj->dev || !sgt)
621 return -EINVAL;
622
623 bytes = sgtable_len(sgt);
624 if (!bytes)
625 return -EINVAL;
626 bytes = PAGE_ALIGN(bytes);
627
628 va = vmap_sg(sgt);
629 if (IS_ERR(va))
630 return PTR_ERR(va);
631
632 flags &= IOVMF_HW_MASK;
633 flags |= IOVMF_DISCONT;
634 flags |= IOVMF_MMIO;
635 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
636
637 da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
638 if (IS_ERR_VALUE(da))
639 vunmap_sg(va);
640
641 return da;
642}
643EXPORT_SYMBOL_GPL(iommu_vmap);
644
645/**
646 * iommu_vunmap - release virtual mapping obtained by 'iommu_vmap()'
647 * @obj: objective iommu
648 * @da: iommu device virtual address
649 *
650 * Free the iommu virtually contiguous memory area starting at
651 * @da, which was returned by 'iommu_vmap()'.
652 */
653struct sg_table *iommu_vunmap(struct iommu *obj, u32 da)
654{
655 struct sg_table *sgt;
656 /*
657 * 'sgt' is allocated before 'iommu_vmalloc()' is called.
658 * Just returns 'sgt' to the caller to free
659 */
660 sgt = unmap_vm_area(obj, da, vunmap_sg, IOVMF_DISCONT | IOVMF_MMIO);
661 if (!sgt)
662 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
663 return sgt;
664}
665EXPORT_SYMBOL_GPL(iommu_vunmap);
666
667/**
668 * iommu_vmalloc - (d)-(p)-(v) address allocator and mapper
669 * @obj: objective iommu
670 * @da: contiguous iommu virtual memory
671 * @bytes: allocation size
672 * @flags: iovma and page property
673 *
674 * Allocate @bytes linearly and creates 1-n-1 mapping and returns
675 * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set.
676 */
677u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
678{
679 void *va;
680 struct sg_table *sgt;
681
682 if (!obj || !obj->dev || !bytes)
683 return -EINVAL;
684
685 bytes = PAGE_ALIGN(bytes);
686
687 va = vmalloc(bytes);
688 if (!va)
689 return -ENOMEM;
690
691 sgt = sgtable_alloc(bytes, flags);
692 if (IS_ERR(sgt)) {
693 da = PTR_ERR(sgt);
694 goto err_sgt_alloc;
695 }
696 sgtable_fill_vmalloc(sgt, va);
697
698 flags &= IOVMF_HW_MASK;
699 flags |= IOVMF_DISCONT;
700 flags |= IOVMF_ALLOC;
701 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
702
703 da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
704 if (IS_ERR_VALUE(da))
705 goto err_iommu_vmap;
706
707 return da;
708
709err_iommu_vmap:
710 sgtable_drain_vmalloc(sgt);
711 sgtable_free(sgt);
712err_sgt_alloc:
713 vfree(va);
714 return da;
715}
716EXPORT_SYMBOL_GPL(iommu_vmalloc);
717
718/**
719 * iommu_vfree - release memory allocated by 'iommu_vmalloc()'
720 * @obj: objective iommu
721 * @da: iommu device virtual address
722 *
723 * Frees the iommu virtually continuous memory area starting at
724 * @da, as obtained from 'iommu_vmalloc()'.
725 */
726void iommu_vfree(struct iommu *obj, const u32 da)
727{
728 struct sg_table *sgt;
729
730 sgt = unmap_vm_area(obj, da, vfree, IOVMF_DISCONT | IOVMF_ALLOC);
731 if (!sgt)
732 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
733 sgtable_free(sgt);
734}
735EXPORT_SYMBOL_GPL(iommu_vfree);
736
737static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va,
738 size_t bytes, u32 flags)
739{
740 struct sg_table *sgt;
741
742 sgt = sgtable_alloc(bytes, flags);
743 if (IS_ERR(sgt))
744 return PTR_ERR(sgt);
745
746 sgtable_fill_kmalloc(sgt, pa, bytes);
747
748 da = map_iommu_region(obj, da, sgt, va, bytes, flags);
749 if (IS_ERR_VALUE(da)) {
750 sgtable_drain_kmalloc(sgt);
751 sgtable_free(sgt);
752 }
753
754 return da;
755}
756
757/**
758 * iommu_kmap - (d)-(p)-(v) address mapper
759 * @obj: objective iommu
760 * @da: contiguous iommu virtual memory
761 * @pa: contiguous physical memory
762 * @flags: iovma and page property
763 *
764 * Creates 1-1-1 mapping and returns @da again, which can be
765 * adjusted if 'IOVMF_DA_ANON' is set.
766 */
767u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
768 u32 flags)
769{
770 void *va;
771
772 if (!obj || !obj->dev || !bytes)
773 return -EINVAL;
774
775 bytes = PAGE_ALIGN(bytes);
776
777 va = ioremap(pa, bytes);
778 if (!va)
779 return -ENOMEM;
780
781 flags &= IOVMF_HW_MASK;
782 flags |= IOVMF_LINEAR;
783 flags |= IOVMF_MMIO;
784 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
785
786 da = __iommu_kmap(obj, da, pa, va, bytes, flags);
787 if (IS_ERR_VALUE(da))
788 iounmap(va);
789
790 return da;
791}
792EXPORT_SYMBOL_GPL(iommu_kmap);
793
794/**
795 * iommu_kunmap - release virtual mapping obtained by 'iommu_kmap()'
796 * @obj: objective iommu
797 * @da: iommu device virtual address
798 *
799 * Frees the iommu virtually contiguous memory area starting at
800 * @da, which was passed to and was returned by'iommu_kmap()'.
801 */
802void iommu_kunmap(struct iommu *obj, u32 da)
803{
804 struct sg_table *sgt;
805 typedef void (*func_t)(const void *);
806
807 sgt = unmap_vm_area(obj, da, (func_t)__iounmap,
808 IOVMF_LINEAR | IOVMF_MMIO);
809 if (!sgt)
810 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
811 sgtable_free(sgt);
812}
813EXPORT_SYMBOL_GPL(iommu_kunmap);
814
815/**
816 * iommu_kmalloc - (d)-(p)-(v) address allocator and mapper
817 * @obj: objective iommu
818 * @da: contiguous iommu virtual memory
819 * @bytes: bytes for allocation
820 * @flags: iovma and page property
821 *
822 * Allocate @bytes linearly and creates 1-1-1 mapping and returns
823 * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set.
824 */
825u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
826{
827 void *va;
828 u32 pa;
829
830 if (!obj || !obj->dev || !bytes)
831 return -EINVAL;
832
833 bytes = PAGE_ALIGN(bytes);
834
835 va = kmalloc(bytes, GFP_KERNEL | GFP_DMA);
836 if (!va)
837 return -ENOMEM;
838 pa = virt_to_phys(va);
839
840 flags &= IOVMF_HW_MASK;
841 flags |= IOVMF_LINEAR;
842 flags |= IOVMF_ALLOC;
843 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
844
845 da = __iommu_kmap(obj, da, pa, va, bytes, flags);
846 if (IS_ERR_VALUE(da))
847 kfree(va);
848
849 return da;
850}
851EXPORT_SYMBOL_GPL(iommu_kmalloc);
852
853/**
854 * iommu_kfree - release virtual mapping obtained by 'iommu_kmalloc()'
855 * @obj: objective iommu
856 * @da: iommu device virtual address
857 *
858 * Frees the iommu virtually contiguous memory area starting at
859 * @da, which was passed to and was returned by'iommu_kmalloc()'.
860 */
861void iommu_kfree(struct iommu *obj, u32 da)
862{
863 struct sg_table *sgt;
864
865 sgt = unmap_vm_area(obj, da, kfree, IOVMF_LINEAR | IOVMF_ALLOC);
866 if (!sgt)
867 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
868 sgtable_free(sgt);
869}
870EXPORT_SYMBOL_GPL(iommu_kfree);
871
872
873static int __init iovmm_init(void)
874{
875 const unsigned long flags = SLAB_HWCACHE_ALIGN;
876 struct kmem_cache *p;
877
878 p = kmem_cache_create("iovm_area_cache", sizeof(struct iovm_struct), 0,
879 flags, NULL);
880 if (!p)
881 return -ENOMEM;
882 iovm_area_cachep = p;
883
884 return 0;
885}
886module_init(iovmm_init);
887
888static void __exit iovmm_exit(void)
889{
890 kmem_cache_destroy(iovm_area_cachep);
891}
892module_exit(iovmm_exit);
893
894MODULE_DESCRIPTION("omap iommu: simple virtual address space management");
895MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>");
896MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 28b0a824b8cf..efa0e0111f38 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -91,11 +91,20 @@ static void omap_mcbsp_dump_reg(u8 id)
91static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id) 91static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id)
92{ 92{
93 struct omap_mcbsp *mcbsp_tx = dev_id; 93 struct omap_mcbsp *mcbsp_tx = dev_id;
94 u16 irqst_spcr2;
94 95
95 dev_dbg(mcbsp_tx->dev, "TX IRQ callback : 0x%x\n", 96 irqst_spcr2 = OMAP_MCBSP_READ(mcbsp_tx->io_base, SPCR2);
96 OMAP_MCBSP_READ(mcbsp_tx->io_base, SPCR2)); 97 dev_dbg(mcbsp_tx->dev, "TX IRQ callback : 0x%x\n", irqst_spcr2);
97 98
98 complete(&mcbsp_tx->tx_irq_completion); 99 if (irqst_spcr2 & XSYNC_ERR) {
100 dev_err(mcbsp_tx->dev, "TX Frame Sync Error! : 0x%x\n",
101 irqst_spcr2);
102 /* Writing zero to XSYNC_ERR clears the IRQ */
103 OMAP_MCBSP_WRITE(mcbsp_tx->io_base, SPCR2,
104 irqst_spcr2 & ~(XSYNC_ERR));
105 } else {
106 complete(&mcbsp_tx->tx_irq_completion);
107 }
99 108
100 return IRQ_HANDLED; 109 return IRQ_HANDLED;
101} 110}
@@ -103,11 +112,20 @@ static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id)
103static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id) 112static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id)
104{ 113{
105 struct omap_mcbsp *mcbsp_rx = dev_id; 114 struct omap_mcbsp *mcbsp_rx = dev_id;
115 u16 irqst_spcr1;
106 116
107 dev_dbg(mcbsp_rx->dev, "RX IRQ callback : 0x%x\n", 117 irqst_spcr1 = OMAP_MCBSP_READ(mcbsp_rx->io_base, SPCR1);
108 OMAP_MCBSP_READ(mcbsp_rx->io_base, SPCR2)); 118 dev_dbg(mcbsp_rx->dev, "RX IRQ callback : 0x%x\n", irqst_spcr1);
109 119
110 complete(&mcbsp_rx->rx_irq_completion); 120 if (irqst_spcr1 & RSYNC_ERR) {
121 dev_err(mcbsp_rx->dev, "RX Frame Sync Error! : 0x%x\n",
122 irqst_spcr1);
123 /* Writing zero to RSYNC_ERR clears the IRQ */
124 OMAP_MCBSP_WRITE(mcbsp_rx->io_base, SPCR1,
125 irqst_spcr1 & ~(RSYNC_ERR));
126 } else {
127 complete(&mcbsp_rx->tx_irq_completion);
128 }
111 129
112 return IRQ_HANDLED; 130 return IRQ_HANDLED;
113} 131}
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c
index 80b040fd5ca7..8d329fb20740 100644
--- a/arch/arm/plat-omap/mux.c
+++ b/arch/arm/plat-omap/mux.c
@@ -54,6 +54,9 @@ int __init_or_module omap_cfg_reg(const unsigned long index)
54{ 54{
55 struct pin_config *reg; 55 struct pin_config *reg;
56 56
57 if (cpu_is_omap44xx())
58 return 0;
59
57 if (mux_cfg == NULL) { 60 if (mux_cfg == NULL) {
58 printk(KERN_ERR "Pin mux table not initialized\n"); 61 printk(KERN_ERR "Pin mux table not initialized\n");
59 return -ENODEV; 62 return -ENODEV;
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index fa5297d643d3..a5b9bcd6b108 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -6,6 +6,9 @@
6 * Copyright (C) 2005 Nokia Corporation 6 * Copyright (C) 2005 Nokia Corporation
7 * Written by Tony Lindgren <tony@atomide.com> 7 * Written by Tony Lindgren <tony@atomide.com>
8 * 8 *
9 * Copyright (C) 2009 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
9 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
@@ -38,12 +41,14 @@
38#define OMAP1_SRAM_VA VMALLOC_END 41#define OMAP1_SRAM_VA VMALLOC_END
39#define OMAP2_SRAM_PA 0x40200000 42#define OMAP2_SRAM_PA 0x40200000
40#define OMAP2_SRAM_PUB_PA 0x4020f800 43#define OMAP2_SRAM_PUB_PA 0x4020f800
41#define OMAP2_SRAM_VA VMALLOC_END 44#define OMAP2_SRAM_VA 0xe3000000
42#define OMAP2_SRAM_PUB_VA (VMALLOC_END + 0x800) 45#define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800)
43#define OMAP3_SRAM_PA 0x40200000 46#define OMAP3_SRAM_PA 0x40200000
44#define OMAP3_SRAM_VA 0xd7000000 47#define OMAP3_SRAM_VA 0xd7000000
45#define OMAP3_SRAM_PUB_PA 0x40208000 48#define OMAP3_SRAM_PUB_PA 0x40208000
46#define OMAP3_SRAM_PUB_VA 0xd7008000 49#define OMAP3_SRAM_PUB_VA 0xd7008000
50#define OMAP4_SRAM_PA 0x40200000 /*0x402f0000*/
51#define OMAP4_SRAM_VA 0xd7000000 /*0xd70f0000*/
47 52
48#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 53#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
49#define SRAM_BOOTLOADER_SZ 0x00 54#define SRAM_BOOTLOADER_SZ 0x00
@@ -87,6 +92,10 @@ static int is_sram_locked(void)
87{ 92{
88 int type = 0; 93 int type = 0;
89 94
95 if (cpu_is_omap44xx())
96 /* Not yet supported */
97 return 0;
98
90 if (cpu_is_omap242x()) 99 if (cpu_is_omap242x())
91 type = omap_rev() & OMAP2_DEVICETYPE_MASK; 100 type = omap_rev() & OMAP2_DEVICETYPE_MASK;
92 101
@@ -135,6 +144,10 @@ void __init omap_detect_sram(void)
135 omap_sram_base = OMAP3_SRAM_VA; 144 omap_sram_base = OMAP3_SRAM_VA;
136 omap_sram_start = OMAP3_SRAM_PA; 145 omap_sram_start = OMAP3_SRAM_PA;
137 omap_sram_size = 0x10000; /* 64K */ 146 omap_sram_size = 0x10000; /* 64K */
147 } else if (cpu_is_omap44xx()) {
148 omap_sram_base = OMAP4_SRAM_VA;
149 omap_sram_start = OMAP4_SRAM_PA;
150 omap_sram_size = 0x8000; /* 32K */
138 } else { 151 } else {
139 omap_sram_base = OMAP2_SRAM_VA; 152 omap_sram_base = OMAP2_SRAM_VA;
140 omap_sram_start = OMAP2_SRAM_PA; 153 omap_sram_start = OMAP2_SRAM_PA;
@@ -201,8 +214,23 @@ void __init omap_map_sram(void)
201 base = OMAP3_SRAM_PA; 214 base = OMAP3_SRAM_PA;
202 base = ROUND_DOWN(base, PAGE_SIZE); 215 base = ROUND_DOWN(base, PAGE_SIZE);
203 omap_sram_io_desc[0].pfn = __phys_to_pfn(base); 216 omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
217
218 /*
219 * SRAM must be marked as non-cached on OMAP3 since the
220 * CORE DPLL M2 divider change code (in SRAM) runs with the
221 * SDRAM controller disabled, and if it is marked cached,
222 * the ARM may attempt to write cache lines back to SDRAM
223 * which will cause the system to hang.
224 */
225 omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;
204 } 226 }
205 227
228 if (cpu_is_omap44xx()) {
229 omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA;
230 base = OMAP4_SRAM_PA;
231 base = ROUND_DOWN(base, PAGE_SIZE);
232 omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
233 }
206 omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ 234 omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */
207 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); 235 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));
208 236
@@ -242,20 +270,13 @@ void * omap_sram_push(void * start, unsigned long size)
242 return (void *)omap_sram_ceil; 270 return (void *)omap_sram_ceil;
243} 271}
244 272
245static void omap_sram_error(void)
246{
247 panic("Uninitialized SRAM function\n");
248}
249
250#ifdef CONFIG_ARCH_OMAP1 273#ifdef CONFIG_ARCH_OMAP1
251 274
252static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl); 275static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl);
253 276
254void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) 277void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
255{ 278{
256 if (!_omap_sram_reprogram_clock) 279 BUG_ON(!_omap_sram_reprogram_clock);
257 omap_sram_error();
258
259 _omap_sram_reprogram_clock(dpllctl, ckctl); 280 _omap_sram_reprogram_clock(dpllctl, ckctl);
260} 281}
261 282
@@ -280,9 +301,7 @@ static void (*_omap2_sram_ddr_init)(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
280void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 301void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
281 u32 base_cs, u32 force_unlock) 302 u32 base_cs, u32 force_unlock)
282{ 303{
283 if (!_omap2_sram_ddr_init) 304 BUG_ON(!_omap2_sram_ddr_init);
284 omap_sram_error();
285
286 _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl, 305 _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl,
287 base_cs, force_unlock); 306 base_cs, force_unlock);
288} 307}
@@ -292,9 +311,7 @@ static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val,
292 311
293void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type) 312void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type)
294{ 313{
295 if (!_omap2_sram_reprogram_sdrc) 314 BUG_ON(!_omap2_sram_reprogram_sdrc);
296 omap_sram_error();
297
298 _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type); 315 _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type);
299} 316}
300 317
@@ -302,9 +319,7 @@ static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
302 319
303u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass) 320u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass)
304{ 321{
305 if (!_omap2_set_prcm) 322 BUG_ON(!_omap2_set_prcm);
306 omap_sram_error();
307
308 return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass); 323 return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass);
309} 324}
310#endif 325#endif
@@ -356,16 +371,15 @@ static inline int omap243x_sram_init(void)
356static u32 (*_omap3_sram_configure_core_dpll)(u32 sdrc_rfr_ctrl, 371static u32 (*_omap3_sram_configure_core_dpll)(u32 sdrc_rfr_ctrl,
357 u32 sdrc_actim_ctrla, 372 u32 sdrc_actim_ctrla,
358 u32 sdrc_actim_ctrlb, 373 u32 sdrc_actim_ctrlb,
359 u32 m2); 374 u32 m2, u32 unlock_dll);
360u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, u32 sdrc_actim_ctrla, 375u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, u32 sdrc_actim_ctrla,
361 u32 sdrc_actim_ctrlb, u32 m2) 376 u32 sdrc_actim_ctrlb, u32 m2, u32 unlock_dll)
362{ 377{
363 if (!_omap3_sram_configure_core_dpll) 378 BUG_ON(!_omap3_sram_configure_core_dpll);
364 omap_sram_error();
365
366 return _omap3_sram_configure_core_dpll(sdrc_rfr_ctrl, 379 return _omap3_sram_configure_core_dpll(sdrc_rfr_ctrl,
367 sdrc_actim_ctrla, 380 sdrc_actim_ctrla,
368 sdrc_actim_ctrlb, m2); 381 sdrc_actim_ctrlb, m2,
382 unlock_dll);
369} 383}
370 384
371/* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */ 385/* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */
@@ -406,6 +420,8 @@ int __init omap_sram_init(void)
406 omap243x_sram_init(); 420 omap243x_sram_init();
407 else if (cpu_is_omap34xx()) 421 else if (cpu_is_omap34xx())
408 omap34xx_sram_init(); 422 omap34xx_sram_init();
423 else if (cpu_is_omap44xx())
424 omap34xx_sram_init(); /* FIXME: */
409 425
410 return 0; 426 return 0;
411} 427}
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 32eb9e33bebb..e814803d4741 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -15,10 +15,9 @@
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <asm/gpio.h> 18#include <linux/gpio.h>
19 19
20static DEFINE_SPINLOCK(gpio_lock); 20static DEFINE_SPINLOCK(gpio_lock);
21static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */
22static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)]; 21static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)];
23static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)]; 22static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)];
24 23
@@ -46,82 +45,54 @@ static void __set_level(unsigned pin, int high)
46 writel(u, GPIO_OUT(pin)); 45 writel(u, GPIO_OUT(pin));
47} 46}
48 47
49 48static inline void __set_blinking(unsigned pin, int blink)
50/*
51 * GENERIC_GPIO primitives.
52 */
53int gpio_direction_input(unsigned pin)
54{ 49{
55 unsigned long flags; 50 u32 u;
56
57 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_input)) {
58 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
59 return -EINVAL;
60 }
61
62 spin_lock_irqsave(&gpio_lock, flags);
63
64 /*
65 * Some callers might not have used gpio_request(),
66 * so flag this pin as requested now.
67 */
68 if (gpio_label[pin] == NULL)
69 gpio_label[pin] = "?";
70 51
71 /* 52 u = readl(GPIO_BLINK_EN(pin));
72 * Configure GPIO direction. 53 if (blink)
73 */ 54 u |= 1 << (pin & 31);
74 __set_direction(pin, 1); 55 else
56 u &= ~(1 << (pin & 31));
57 writel(u, GPIO_BLINK_EN(pin));
58}
75 59
76 spin_unlock_irqrestore(&gpio_lock, flags); 60static inline int orion_gpio_is_valid(unsigned pin, int mode)
61{
62 if (pin < GPIO_MAX) {
63 if ((mode & GPIO_INPUT_OK) && !test_bit(pin, gpio_valid_input))
64 goto err_out;
65 if ((mode & GPIO_OUTPUT_OK) && !test_bit(pin, gpio_valid_output))
66 goto err_out;
67 return true;
68 }
77 69
78 return 0; 70err_out:
71 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
72 return false;
79} 73}
80EXPORT_SYMBOL(gpio_direction_input);
81 74
82int gpio_direction_output(unsigned pin, int value) 75/*
76 * GENERIC_GPIO primitives.
77 */
78static int orion_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
83{ 79{
84 unsigned long flags; 80 unsigned long flags;
85 u32 u;
86 81
87 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_output)) { 82 if (!orion_gpio_is_valid(pin, GPIO_INPUT_OK))
88 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
89 return -EINVAL; 83 return -EINVAL;
90 }
91 84
92 spin_lock_irqsave(&gpio_lock, flags); 85 spin_lock_irqsave(&gpio_lock, flags);
93 86
94 /* 87 /* Configure GPIO direction. */
95 * Some callers might not have used gpio_request(), 88 __set_direction(pin, 1);
96 * so flag this pin as requested now.
97 */
98 if (gpio_label[pin] == NULL)
99 gpio_label[pin] = "?";
100
101 /*
102 * Disable blinking.
103 */
104 u = readl(GPIO_BLINK_EN(pin));
105 u &= ~(1 << (pin & 31));
106 writel(u, GPIO_BLINK_EN(pin));
107
108 /*
109 * Configure GPIO output value.
110 */
111 __set_level(pin, value);
112
113 /*
114 * Configure GPIO direction.
115 */
116 __set_direction(pin, 0);
117 89
118 spin_unlock_irqrestore(&gpio_lock, flags); 90 spin_unlock_irqrestore(&gpio_lock, flags);
119 91
120 return 0; 92 return 0;
121} 93}
122EXPORT_SYMBOL(gpio_direction_output);
123 94
124int gpio_get_value(unsigned pin) 95static int orion_gpio_get_value(struct gpio_chip *chip, unsigned pin)
125{ 96{
126 int val; 97 int val;
127 98
@@ -132,83 +103,75 @@ int gpio_get_value(unsigned pin)
132 103
133 return (val >> (pin & 31)) & 1; 104 return (val >> (pin & 31)) & 1;
134} 105}
135EXPORT_SYMBOL(gpio_get_value);
136 106
137void gpio_set_value(unsigned pin, int value) 107static int orion_gpio_direction_output(struct gpio_chip *chip, unsigned pin,
108 int value)
138{ 109{
139 unsigned long flags; 110 unsigned long flags;
140 u32 u; 111
112 if (!orion_gpio_is_valid(pin, GPIO_OUTPUT_OK))
113 return -EINVAL;
141 114
142 spin_lock_irqsave(&gpio_lock, flags); 115 spin_lock_irqsave(&gpio_lock, flags);
143 116
144 /* 117 /* Disable blinking. */
145 * Disable blinking. 118 __set_blinking(pin, 0);
146 */
147 u = readl(GPIO_BLINK_EN(pin));
148 u &= ~(1 << (pin & 31));
149 writel(u, GPIO_BLINK_EN(pin));
150 119
151 /* 120 /* Configure GPIO output value. */
152 * Configure GPIO output value.
153 */
154 __set_level(pin, value); 121 __set_level(pin, value);
155 122
123 /* Configure GPIO direction. */
124 __set_direction(pin, 0);
125
156 spin_unlock_irqrestore(&gpio_lock, flags); 126 spin_unlock_irqrestore(&gpio_lock, flags);
127
128 return 0;
157} 129}
158EXPORT_SYMBOL(gpio_set_value);
159 130
160int gpio_request(unsigned pin, const char *label) 131static void orion_gpio_set_value(struct gpio_chip *chip, unsigned pin,
132 int value)
161{ 133{
162 unsigned long flags; 134 unsigned long flags;
163 int ret;
164
165 if (pin >= GPIO_MAX ||
166 !(test_bit(pin, gpio_valid_input) ||
167 test_bit(pin, gpio_valid_output))) {
168 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
169 return -EINVAL;
170 }
171 135
172 spin_lock_irqsave(&gpio_lock, flags); 136 spin_lock_irqsave(&gpio_lock, flags);
173 if (gpio_label[pin] == NULL) {
174 gpio_label[pin] = label ? label : "?";
175 ret = 0;
176 } else {
177 pr_debug("%s: GPIO %d already used as %s\n",
178 __func__, pin, gpio_label[pin]);
179 ret = -EBUSY;
180 }
181 spin_unlock_irqrestore(&gpio_lock, flags);
182 137
183 return ret; 138 /* Configure GPIO output value. */
139 __set_level(pin, value);
140
141 spin_unlock_irqrestore(&gpio_lock, flags);
184} 142}
185EXPORT_SYMBOL(gpio_request);
186 143
187void gpio_free(unsigned pin) 144static int orion_gpio_request(struct gpio_chip *chip, unsigned pin)
188{ 145{
189 if (pin >= GPIO_MAX || 146 if (orion_gpio_is_valid(pin, GPIO_INPUT_OK) ||
190 !(test_bit(pin, gpio_valid_input) || 147 orion_gpio_is_valid(pin, GPIO_OUTPUT_OK))
191 test_bit(pin, gpio_valid_output))) { 148 return 0;
192 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 149 return -EINVAL;
193 return;
194 }
195
196 if (gpio_label[pin] == NULL)
197 pr_warning("%s: GPIO %d already freed\n", __func__, pin);
198 else
199 gpio_label[pin] = NULL;
200} 150}
201EXPORT_SYMBOL(gpio_free);
202 151
152static struct gpio_chip orion_gpiochip = {
153 .label = "orion_gpio",
154 .direction_input = orion_gpio_direction_input,
155 .get = orion_gpio_get_value,
156 .direction_output = orion_gpio_direction_output,
157 .set = orion_gpio_set_value,
158 .request = orion_gpio_request,
159 .base = 0,
160 .ngpio = GPIO_MAX,
161 .can_sleep = 0,
162};
163
164void __init orion_gpio_init(void)
165{
166 gpiochip_add(&orion_gpiochip);
167}
203 168
204/* 169/*
205 * Orion-specific GPIO API extensions. 170 * Orion-specific GPIO API extensions.
206 */ 171 */
207void __init orion_gpio_set_unused(unsigned pin) 172void __init orion_gpio_set_unused(unsigned pin)
208{ 173{
209 /* 174 /* Configure as output, drive low. */
210 * Configure as output, drive low.
211 */
212 __set_level(pin, 0); 175 __set_level(pin, 0);
213 __set_direction(pin, 0); 176 __set_direction(pin, 0);
214} 177}
@@ -230,21 +193,14 @@ void __init orion_gpio_set_valid(unsigned pin, int mode)
230void orion_gpio_set_blink(unsigned pin, int blink) 193void orion_gpio_set_blink(unsigned pin, int blink)
231{ 194{
232 unsigned long flags; 195 unsigned long flags;
233 u32 u;
234 196
235 spin_lock_irqsave(&gpio_lock, flags); 197 spin_lock_irqsave(&gpio_lock, flags);
236 198
237 /* 199 /* Set output value to zero. */
238 * Set output value to zero.
239 */
240 __set_level(pin, 0); 200 __set_level(pin, 0);
241 201
242 u = readl(GPIO_BLINK_EN(pin)); 202 /* Set blinking. */
243 if (blink) 203 __set_blinking(pin, blink);
244 u |= 1 << (pin & 31);
245 else
246 u &= ~(1 << (pin & 31));
247 writel(u, GPIO_BLINK_EN(pin));
248 204
249 spin_unlock_irqrestore(&gpio_lock, flags); 205 spin_unlock_irqrestore(&gpio_lock, flags);
250} 206}
@@ -368,7 +324,7 @@ static int gpio_irq_set_type(u32 irq, u32 type)
368} 324}
369 325
370struct irq_chip orion_gpio_irq_chip = { 326struct irq_chip orion_gpio_irq_chip = {
371 .name = "orion_gpio", 327 .name = "orion_gpio_irq",
372 .ack = gpio_irq_ack, 328 .ack = gpio_irq_ack,
373 .mask = gpio_irq_mask, 329 .mask = gpio_irq_mask,
374 .unmask = gpio_irq_unmask, 330 .unmask = gpio_irq_unmask,
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 33f6c6aec185..9646a94ed3d0 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -14,12 +14,9 @@
14/* 14/*
15 * GENERIC_GPIO primitives. 15 * GENERIC_GPIO primitives.
16 */ 16 */
17int gpio_request(unsigned pin, const char *label); 17#define gpio_get_value __gpio_get_value
18void gpio_free(unsigned pin); 18#define gpio_set_value __gpio_set_value
19int gpio_direction_input(unsigned pin); 19#define gpio_cansleep __gpio_cansleep
20int gpio_direction_output(unsigned pin, int value);
21int gpio_get_value(unsigned pin);
22void gpio_set_value(unsigned pin, int value);
23 20
24/* 21/*
25 * Orion-specific GPIO API extensions. 22 * Orion-specific GPIO API extensions.
@@ -27,11 +24,13 @@ void gpio_set_value(unsigned pin, int value);
27void orion_gpio_set_unused(unsigned pin); 24void orion_gpio_set_unused(unsigned pin);
28void orion_gpio_set_blink(unsigned pin, int blink); 25void orion_gpio_set_blink(unsigned pin, int blink);
29 26
30#define GPIO_BIDI_OK (1 << 0) 27#define GPIO_INPUT_OK (1 << 0)
31#define GPIO_INPUT_OK (1 << 1) 28#define GPIO_OUTPUT_OK (1 << 1)
32#define GPIO_OUTPUT_OK (1 << 2)
33void orion_gpio_set_valid(unsigned pin, int mode); 29void orion_gpio_set_valid(unsigned pin, int mode);
34 30
31/* Initialize gpiolib. */
32void __init orion_gpio_init(void);
33
35/* 34/*
36 * GPIO interrupt handling. 35 * GPIO interrupt handling.
37 */ 36 */
diff --git a/arch/arm/plat-orion/include/plat/orion5x_wdt.h b/arch/arm/plat-orion/include/plat/orion_wdt.h
index 3c9cf6a305ef..665c362a2fba 100644
--- a/arch/arm/plat-orion/include/plat/orion5x_wdt.h
+++ b/arch/arm/plat-orion/include/plat/orion_wdt.h
@@ -1,15 +1,15 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/orion5x_wdt.h 2 * arch/arm/plat-orion/include/plat/orion_wdt.h
3 * 3 *
4 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#ifndef __PLAT_ORION5X_WDT_H 9#ifndef __PLAT_ORION_WDT_H
10#define __PLAT_ORION5X_WDT_H 10#define __PLAT_ORION_WDT_H
11 11
12struct orion5x_wdt_platform_data { 12struct orion_wdt_platform_data {
13 u32 tclk; /* no <linux/clk.h> support yet */ 13 u32 tclk; /* no <linux/clk.h> support yet */
14}; 14};
15 15
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index de8a001fc3a9..715a30177f28 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -12,11 +12,15 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/cnt32_to_63.h>
17#include <linux/timer.h>
15#include <linux/clockchips.h> 18#include <linux/clockchips.h>
16#include <linux/interrupt.h> 19#include <linux/interrupt.h>
17#include <linux/irq.h> 20#include <linux/irq.h>
18#include <asm/mach/time.h> 21#include <asm/mach/time.h>
19#include <mach/bridge-regs.h> 22#include <mach/bridge-regs.h>
23#include <mach/hardware.h>
20 24
21/* 25/*
22 * Number of timer ticks per jiffy. 26 * Number of timer ticks per jiffy.
@@ -39,6 +43,56 @@ static u32 ticks_per_jiffy;
39 43
40 44
41/* 45/*
46 * Orion's sched_clock implementation. It has a resolution of
47 * at least 7.5ns (133MHz TCLK) and a maximum value of 834 days.
48 *
49 * Because the hardware timer period is quite short (21 secs if
50 * 200MHz TCLK) and because cnt32_to_63() needs to be called at
51 * least once per half period to work properly, a kernel timer is
52 * set up to ensure this requirement is always met.
53 */
54#define TCLK2NS_SCALE_FACTOR 8
55
56static unsigned long tclk2ns_scale;
57
58unsigned long long sched_clock(void)
59{
60 unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
61 return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
62}
63
64static struct timer_list cnt32_to_63_keepwarm_timer;
65
66static void cnt32_to_63_keepwarm(unsigned long data)
67{
68 mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
69 (void) sched_clock();
70}
71
72static void __init setup_sched_clock(unsigned long tclk)
73{
74 unsigned long long v;
75 unsigned long data;
76
77 v = NSEC_PER_SEC;
78 v <<= TCLK2NS_SCALE_FACTOR;
79 v += tclk/2;
80 do_div(v, tclk);
81 /*
82 * We want an even value to automatically clear the top bit
83 * returned by cnt32_to_63() without an additional run time
84 * instruction. So if the LSB is 1 then round it up.
85 */
86 if (v & 1)
87 v++;
88 tclk2ns_scale = v;
89
90 data = (0xffffffffUL / tclk / 2 - 2) * HZ;
91 setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, data);
92 mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
93}
94
95/*
42 * Clocksource handling. 96 * Clocksource handling.
43 */ 97 */
44static cycle_t orion_clksrc_read(struct clocksource *cs) 98static cycle_t orion_clksrc_read(struct clocksource *cs)
@@ -176,6 +230,10 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
176 230
177 ticks_per_jiffy = (tclk + HZ/2) / HZ; 231 ticks_per_jiffy = (tclk + HZ/2) / HZ;
178 232
233 /*
234 * Set scale and timer for sched_clock
235 */
236 setup_sched_clock(tclk);
179 237
180 /* 238 /*
181 * Setup free-running clocksource timer (interrupts 239 * Setup free-running clocksource timer (interrupts
@@ -190,7 +248,6 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
190 orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift); 248 orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift);
191 clocksource_register(&orion_clksrc); 249 clocksource_register(&orion_clksrc);
192 250
193
194 /* 251 /*
195 * Setup clockevent timer (interrupt-driven.) 252 * Setup clockevent timer (interrupt-driven.)
196 */ 253 */
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile
index 8f2c4c7fbd48..0264bfb0ca4f 100644
--- a/arch/arm/plat-pxa/Makefile
+++ b/arch/arm/plat-pxa/Makefile
@@ -7,3 +7,5 @@ obj-y := dma.o
7obj-$(CONFIG_GENERIC_GPIO) += gpio.o 7obj-$(CONFIG_GENERIC_GPIO) += gpio.o
8obj-$(CONFIG_PXA3xx) += mfp.o 8obj-$(CONFIG_PXA3xx) += mfp.o
9obj-$(CONFIG_ARCH_MMP) += mfp.o 9obj-$(CONFIG_ARCH_MMP) += mfp.o
10
11obj-$(CONFIG_HAVE_PWM) += pwm.o
diff --git a/arch/arm/mach-pxa/include/mach/i2c.h b/arch/arm/plat-pxa/include/plat/i2c.h
index 1a9f65e6ec0f..1a9f65e6ec0f 100644
--- a/arch/arm/mach-pxa/include/mach/i2c.h
+++ b/arch/arm/plat-pxa/include/plat/i2c.h
diff --git a/arch/arm/mach-pxa/pwm.c b/arch/arm/plat-pxa/pwm.c
index fcdd374437a8..a9eabdcfa163 100644
--- a/arch/arm/mach-pxa/pwm.c
+++ b/arch/arm/plat-pxa/pwm.c
@@ -21,6 +21,19 @@
21 21
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
24#define HAS_SECONDARY_PWM 0x10
25#define PWM_ID_BASE(d) ((d) & 0xf)
26
27static const struct platform_device_id pwm_id_table[] = {
28 /* PWM has_secondary_pwm? */
29 { "pxa25x-pwm", 0 },
30 { "pxa27x-pwm", 0 | HAS_SECONDARY_PWM },
31 { "pxa168-pwm", 1 },
32 { "pxa910-pwm", 1 },
33 { },
34};
35MODULE_DEVICE_TABLE(platform, pwm_id_table);
36
24/* PWM registers and bits definitions */ 37/* PWM registers and bits definitions */
25#define PWMCR (0x00) 38#define PWMCR (0x00)
26#define PWMDCR (0x04) 39#define PWMDCR (0x04)
@@ -31,7 +44,8 @@
31 44
32struct pwm_device { 45struct pwm_device {
33 struct list_head node; 46 struct list_head node;
34 struct platform_device *pdev; 47 struct pwm_device *secondary;
48 struct platform_device *pdev;
35 49
36 const char *label; 50 const char *label;
37 struct clk *clk; 51 struct clk *clk;
@@ -159,17 +173,17 @@ static inline void __add_pwm(struct pwm_device *pwm)
159 mutex_unlock(&pwm_lock); 173 mutex_unlock(&pwm_lock);
160} 174}
161 175
162static struct pwm_device *pwm_probe(struct platform_device *pdev, 176static int __devinit pwm_probe(struct platform_device *pdev)
163 unsigned int pwm_id, struct pwm_device *parent_pwm)
164{ 177{
165 struct pwm_device *pwm; 178 struct platform_device_id *id = platform_get_device_id(pdev);
179 struct pwm_device *pwm, *secondary = NULL;
166 struct resource *r; 180 struct resource *r;
167 int ret = 0; 181 int ret = 0;
168 182
169 pwm = kzalloc(sizeof(struct pwm_device), GFP_KERNEL); 183 pwm = kzalloc(sizeof(struct pwm_device), GFP_KERNEL);
170 if (pwm == NULL) { 184 if (pwm == NULL) {
171 dev_err(&pdev->dev, "failed to allocate memory\n"); 185 dev_err(&pdev->dev, "failed to allocate memory\n");
172 return ERR_PTR(-ENOMEM); 186 return -ENOMEM;
173 } 187 }
174 188
175 pwm->clk = clk_get(&pdev->dev, NULL); 189 pwm->clk = clk_get(&pdev->dev, NULL);
@@ -180,16 +194,9 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,
180 pwm->clk_enabled = 0; 194 pwm->clk_enabled = 0;
181 195
182 pwm->use_count = 0; 196 pwm->use_count = 0;
183 pwm->pwm_id = pwm_id; 197 pwm->pwm_id = PWM_ID_BASE(id->driver_data) + pdev->id;
184 pwm->pdev = pdev; 198 pwm->pdev = pdev;
185 199
186 if (parent_pwm != NULL) {
187 /* registers for the second PWM has offset of 0x10 */
188 pwm->mmio_base = parent_pwm->mmio_base + 0x10;
189 __add_pwm(pwm);
190 return pwm;
191 }
192
193 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 200 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
194 if (r == NULL) { 201 if (r == NULL) {
195 dev_err(&pdev->dev, "no memory resource defined\n"); 202 dev_err(&pdev->dev, "no memory resource defined\n");
@@ -211,9 +218,27 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,
211 goto err_free_mem; 218 goto err_free_mem;
212 } 219 }
213 220
221 if (id->driver_data & HAS_SECONDARY_PWM) {
222 secondary = kzalloc(sizeof(struct pwm_device), GFP_KERNEL);
223 if (secondary == NULL) {
224 ret = -ENOMEM;
225 goto err_free_mem;
226 }
227
228 *secondary = *pwm;
229 pwm->secondary = secondary;
230
231 /* registers for the second PWM has offset of 0x10 */
232 secondary->mmio_base = pwm->mmio_base + 0x10;
233 secondary->pwm_id = pdev->id + 2;
234 }
235
214 __add_pwm(pwm); 236 __add_pwm(pwm);
237 if (secondary)
238 __add_pwm(secondary);
239
215 platform_set_drvdata(pdev, pwm); 240 platform_set_drvdata(pdev, pwm);
216 return pwm; 241 return 0;
217 242
218err_free_mem: 243err_free_mem:
219 release_mem_region(r->start, r->end - r->start + 1); 244 release_mem_region(r->start, r->end - r->start + 1);
@@ -221,32 +246,7 @@ err_free_clk:
221 clk_put(pwm->clk); 246 clk_put(pwm->clk);
222err_free: 247err_free:
223 kfree(pwm); 248 kfree(pwm);
224 return ERR_PTR(ret); 249 return ret;
225}
226
227static int __devinit pxa25x_pwm_probe(struct platform_device *pdev)
228{
229 struct pwm_device *pwm = pwm_probe(pdev, pdev->id, NULL);
230
231 if (IS_ERR(pwm))
232 return PTR_ERR(pwm);
233
234 return 0;
235}
236
237static int __devinit pxa27x_pwm_probe(struct platform_device *pdev)
238{
239 struct pwm_device *pwm;
240
241 pwm = pwm_probe(pdev, pdev->id, NULL);
242 if (IS_ERR(pwm))
243 return PTR_ERR(pwm);
244
245 pwm = pwm_probe(pdev, pdev->id + 2, pwm);
246 if (IS_ERR(pwm))
247 return PTR_ERR(pwm);
248
249 return 0;
250} 250}
251 251
252static int __devexit pwm_remove(struct platform_device *pdev) 252static int __devexit pwm_remove(struct platform_device *pdev)
@@ -259,6 +259,12 @@ static int __devexit pwm_remove(struct platform_device *pdev)
259 return -ENODEV; 259 return -ENODEV;
260 260
261 mutex_lock(&pwm_lock); 261 mutex_lock(&pwm_lock);
262
263 if (pwm->secondary) {
264 list_del(&pwm->secondary->node);
265 kfree(pwm->secondary);
266 }
267
262 list_del(&pwm->node); 268 list_del(&pwm->node);
263 mutex_unlock(&pwm_lock); 269 mutex_unlock(&pwm_lock);
264 270
@@ -272,46 +278,25 @@ static int __devexit pwm_remove(struct platform_device *pdev)
272 return 0; 278 return 0;
273} 279}
274 280
275static struct platform_driver pxa25x_pwm_driver = { 281static struct platform_driver pwm_driver = {
276 .driver = { 282 .driver = {
277 .name = "pxa25x-pwm", 283 .name = "pxa25x-pwm",
284 .owner = THIS_MODULE,
278 }, 285 },
279 .probe = pxa25x_pwm_probe, 286 .probe = pwm_probe,
280 .remove = __devexit_p(pwm_remove),
281};
282
283static struct platform_driver pxa27x_pwm_driver = {
284 .driver = {
285 .name = "pxa27x-pwm",
286 },
287 .probe = pxa27x_pwm_probe,
288 .remove = __devexit_p(pwm_remove), 287 .remove = __devexit_p(pwm_remove),
288 .id_table = pwm_id_table,
289}; 289};
290 290
291static int __init pwm_init(void) 291static int __init pwm_init(void)
292{ 292{
293 int ret = 0; 293 return platform_driver_register(&pwm_driver);
294
295 ret = platform_driver_register(&pxa25x_pwm_driver);
296 if (ret) {
297 printk(KERN_ERR "failed to register pxa25x_pwm_driver\n");
298 return ret;
299 }
300
301 ret = platform_driver_register(&pxa27x_pwm_driver);
302 if (ret) {
303 printk(KERN_ERR "failed to register pxa27x_pwm_driver\n");
304 return ret;
305 }
306
307 return ret;
308} 294}
309arch_initcall(pwm_init); 295arch_initcall(pwm_init);
310 296
311static void __exit pwm_exit(void) 297static void __exit pwm_exit(void)
312{ 298{
313 platform_driver_unregister(&pxa25x_pwm_driver); 299 platform_driver_unregister(&pwm_driver);
314 platform_driver_unregister(&pxa27x_pwm_driver);
315} 300}
316module_exit(pwm_exit); 301module_exit(pwm_exit);
317 302
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index de9383814e5e..935c7558469b 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -71,6 +71,15 @@ config S3C2410_PM_DEBUG
71 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt> 71 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
72 for more information. 72 for more information.
73 73
74config S3C_PM_DEBUG_LED_SMDK
75 bool "SMDK LED suspend/resume debugging"
76 depends on PM && (MACH_SMDK6410)
77 help
78 Say Y here to enable the use of the SMDK LEDs on the baseboard
79 for debugging of the state of the suspend and resume process.
80
81 Note, this currently only works for S3C64XX based SMDK boards.
82
74config S3C2410_PM_CHECK 83config S3C2410_PM_CHECK
75 bool "S3C2410 PM Suspend Memory CRC" 84 bool "S3C2410 PM Suspend Memory CRC"
76 depends on PM && CRC32 85 depends on PM && CRC32
@@ -150,6 +159,13 @@ config S3C_GPIO_CFG_S3C64XX
150 Internal configuration to enable S3C64XX style GPIO configuration 159 Internal configuration to enable S3C64XX style GPIO configuration
151 functions. 160 functions.
152 161
162# DMA
163
164config S3C_DMA
165 bool
166 help
167 Internal configuration for S3C DMA core
168
153# device definitions to compile in 169# device definitions to compile in
154 170
155config S3C_DEV_HSMMC 171config S3C_DEV_HSMMC
@@ -172,4 +188,14 @@ config S3C_DEV_FB
172 help 188 help
173 Compile in platform device definition for framebuffer 189 Compile in platform device definition for framebuffer
174 190
191config S3C_DEV_USB_HOST
192 bool
193 help
194 Compile in platform device definition for USB host.
195
196config S3C_DEV_USB_HSOTG
197 bool
198 help
199 Compile in platform device definition for USB high-speed OtG
200
175endif 201endif
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 8d7815d25a51..610651455a78 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -18,9 +18,14 @@ obj-y += pwm-clock.o
18obj-y += gpio.o 18obj-y += gpio.o
19obj-y += gpio-config.o 19obj-y += gpio-config.o
20 20
21# DMA support
22
23obj-$(CONFIG_S3C_DMA) += dma.o
24
21# PM support 25# PM support
22 26
23obj-$(CONFIG_PM) += pm.o 27obj-$(CONFIG_PM) += pm.o
28obj-$(CONFIG_PM) += pm-gpio.o
24obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o 29obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o
25 30
26# devices 31# devices
@@ -30,3 +35,5 @@ obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
30obj-y += dev-i2c0.o 35obj-y += dev-i2c0.o
31obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 36obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
32obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 37obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
38obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
39obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
diff --git a/arch/arm/plat-s3c/dev-usb-hsotg.c b/arch/arm/plat-s3c/dev-usb-hsotg.c
new file mode 100644
index 000000000000..e2f604b51c86
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-usb-hsotg.c
@@ -0,0 +1,41 @@
1/* linux/arch/arm/plat-s3c/dev-usb-hsotg.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB high-speed UDC/OtG block
8 *
9 * This program 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
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/devs.h>
22
23static struct resource s3c_usb_hsotg_resources[] = {
24 [0] = {
25 .start = S3C_PA_USB_HSOTG,
26 .end = S3C_PA_USB_HSOTG + 0x10000 - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 [1] = {
30 .start = IRQ_OTG,
31 .end = IRQ_OTG,
32 .flags = IORESOURCE_IRQ,
33 },
34};
35
36struct platform_device s3c_device_usb_hsotg = {
37 .name = "s3c-hsotg",
38 .id = -1,
39 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
40 .resource = s3c_usb_hsotg_resources,
41};
diff --git a/arch/arm/plat-s3c/dev-usb.c b/arch/arm/plat-s3c/dev-usb.c
new file mode 100644
index 000000000000..2ee85abed6d9
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-usb.c
@@ -0,0 +1,50 @@
1/* linux/arch/arm/plat-s3c/dev-usb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB host
8 *
9 * This program 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
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/devs.h>
22
23
24static struct resource s3c_usb_resource[] = {
25 [0] = {
26 .start = S3C_PA_USBHOST,
27 .end = S3C_PA_USBHOST + 0x100 - 1,
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = IRQ_USBH,
32 .end = IRQ_USBH,
33 .flags = IORESOURCE_IRQ,
34 }
35};
36
37static u64 s3c_device_usb_dmamask = 0xffffffffUL;
38
39struct platform_device s3c_device_usb = {
40 .name = "s3c2410-ohci",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_usb_resource),
43 .resource = s3c_usb_resource,
44 .dev = {
45 .dma_mask = &s3c_device_usb_dmamask,
46 .coherent_dma_mask = 0xffffffffUL
47 }
48};
49
50EXPORT_SYMBOL(s3c_device_usb);
diff --git a/arch/arm/plat-s3c/dma.c b/arch/arm/plat-s3c/dma.c
new file mode 100644
index 000000000000..c9db75c06af5
--- /dev/null
+++ b/arch/arm/plat-s3c/dma.c
@@ -0,0 +1,86 @@
1/* linux/arch/arm/plat-s3c/dma.c
2 *
3 * Copyright (c) 2003-2005,2006,2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C DMA core
8 *
9 * This program 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
14struct s3c2410_dma_buf;
15
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/errno.h>
19
20#include <mach/dma.h>
21#include <mach/irqs.h>
22
23#include <plat/dma-plat.h>
24
25/* dma channel state information */
26struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS];
27struct s3c2410_dma_chan *s3c_dma_chan_map[DMACH_MAX];
28
29/* s3c_dma_lookup_channel
30 *
31 * change the dma channel number given into a real dma channel id
32*/
33
34struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel)
35{
36 if (channel & DMACH_LOW_LEVEL)
37 return &s3c2410_chans[channel & ~DMACH_LOW_LEVEL];
38 else
39 return s3c_dma_chan_map[channel];
40}
41
42/* do we need to protect the settings of the fields from
43 * irq?
44*/
45
46int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn)
47{
48 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
49
50 if (chan == NULL)
51 return -EINVAL;
52
53 pr_debug("%s: chan=%p, op rtn=%p\n", __func__, chan, rtn);
54
55 chan->op_fn = rtn;
56
57 return 0;
58}
59EXPORT_SYMBOL(s3c2410_dma_set_opfn);
60
61int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn)
62{
63 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
64
65 if (chan == NULL)
66 return -EINVAL;
67
68 pr_debug("%s: chan=%p, callback rtn=%p\n", __func__, chan, rtn);
69
70 chan->callback_fn = rtn;
71
72 return 0;
73}
74EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
75
76int s3c2410_dma_setflags(unsigned int channel, unsigned int flags)
77{
78 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
79
80 if (chan == NULL)
81 return -EINVAL;
82
83 chan->flags = flags;
84 return 0;
85}
86EXPORT_SYMBOL(s3c2410_dma_setflags);
diff --git a/arch/arm/plat-s3c/gpio.c b/arch/arm/plat-s3c/gpio.c
index d71dd6d9ce5c..260fdc6ad685 100644
--- a/arch/arm/plat-s3c/gpio.c
+++ b/arch/arm/plat-s3c/gpio.c
@@ -16,7 +16,7 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18 18
19#include <plat/gpio-core.h> 19#include <mach/gpio-core.h>
20 20
21#ifdef CONFIG_S3C_GPIO_TRACK 21#ifdef CONFIG_S3C_GPIO_TRACK
22struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; 22struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
@@ -140,6 +140,15 @@ __init void s3c_gpiolib_add(struct s3c_gpio_chip *chip)
140 if (!gc->get) 140 if (!gc->get)
141 gc->get = s3c_gpiolib_get; 141 gc->get = s3c_gpiolib_get;
142 142
143#ifdef CONFIG_PM
144 if (chip->pm != NULL) {
145 if (!chip->pm->save || !chip->pm->resume)
146 printk(KERN_ERR "gpio: %s has missing PM functions\n",
147 gc->label);
148 } else
149 printk(KERN_ERR "gpio: %s has no PM function\n", gc->label);
150#endif
151
143 /* gpiochip_add() prints own failure message on error. */ 152 /* gpiochip_add() prints own failure message on error. */
144 ret = gpiochip_add(gc); 153 ret = gpiochip_add(gc);
145 if (ret >= 0) 154 if (ret >= 0)
diff --git a/arch/arm/plat-s3c/include/plat/adc.h b/arch/arm/plat-s3c/include/plat/adc.h
index 43df2a404b0b..d847bd476b6c 100644
--- a/arch/arm/plat-s3c/include/plat/adc.h
+++ b/arch/arm/plat-s3c/include/plat/adc.h
@@ -19,10 +19,12 @@ struct s3c_adc_client;
19extern int s3c_adc_start(struct s3c_adc_client *client, 19extern int s3c_adc_start(struct s3c_adc_client *client,
20 unsigned int channel, unsigned int nr_samples); 20 unsigned int channel, unsigned int nr_samples);
21 21
22extern struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, 22extern struct s3c_adc_client *
23 void (*select)(unsigned selected), 23 s3c_adc_register(struct platform_device *pdev,
24 void (*conv)(unsigned d0, unsigned d1), 24 void (*select)(unsigned selected),
25 unsigned int is_ts); 25 void (*conv)(unsigned d0, unsigned d1,
26 unsigned *samples_left),
27 unsigned int is_ts);
26 28
27extern void s3c_adc_release(struct s3c_adc_client *client); 29extern void s3c_adc_release(struct s3c_adc_client *client);
28 30
diff --git a/arch/arm/plat-s3c/include/plat/clock.h b/arch/arm/plat-s3c/include/plat/clock.h
index a10622eed43a..d86af84b5b8c 100644
--- a/arch/arm/plat-s3c/include/plat/clock.h
+++ b/arch/arm/plat-s3c/include/plat/clock.h
@@ -50,6 +50,7 @@ extern struct clk clk_xtal;
50extern struct clk clk_ext; 50extern struct clk clk_ext;
51 51
52/* S3C64XX specific clocks */ 52/* S3C64XX specific clocks */
53extern struct clk clk_h2;
53extern struct clk clk_27m; 54extern struct clk clk_27m;
54extern struct clk clk_48m; 55extern struct clk clk_48m;
55 56
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h
index e62ae0fcfe56..be541cbba070 100644
--- a/arch/arm/plat-s3c/include/plat/cpu.h
+++ b/arch/arm/plat-s3c/include/plat/cpu.h
@@ -69,3 +69,6 @@ extern struct sysdev_class s3c2412_sysclass;
69extern struct sysdev_class s3c2440_sysclass; 69extern struct sysdev_class s3c2440_sysclass;
70extern struct sysdev_class s3c2442_sysclass; 70extern struct sysdev_class s3c2442_sysclass;
71extern struct sysdev_class s3c2443_sysclass; 71extern struct sysdev_class s3c2443_sysclass;
72extern struct sysdev_class s3c6410_sysclass;
73extern struct sysdev_class s3c64xx_sysclass;
74
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index 26f0cec3ac04..a0b6768fddcf 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -45,6 +45,7 @@ extern struct platform_device s3c_device_spi1;
45extern struct platform_device s3c_device_nand; 45extern struct platform_device s3c_device_nand;
46 46
47extern struct platform_device s3c_device_usbgadget; 47extern struct platform_device s3c_device_usbgadget;
48extern struct platform_device s3c_device_usb_hsotg;
48 49
49/* s3c2440 specific devices */ 50/* s3c2440 specific devices */
50 51
diff --git a/arch/arm/plat-s3c/include/plat/dma-core.h b/arch/arm/plat-s3c/include/plat/dma-core.h
new file mode 100644
index 000000000000..32ff2a92cb3c
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/dma-core.h
@@ -0,0 +1,22 @@
1/* arch/arm/plat-s3c/include/plat/dma.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * Samsung S3C DMA core support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15extern struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel);
16
17extern struct s3c2410_dma_chan *s3c_dma_chan_map[];
18
19/* the currently allocated channel information */
20extern struct s3c2410_dma_chan s3c2410_chans[];
21
22
diff --git a/arch/arm/plat-s3c/include/plat/dma.h b/arch/arm/plat-s3c/include/plat/dma.h
new file mode 100644
index 000000000000..34dba98f08e1
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/dma.h
@@ -0,0 +1,127 @@
1/* arch/arm/plat-s3c/include/plat/dma.h
2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C DMA support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13enum s3c2410_dma_buffresult {
14 S3C2410_RES_OK,
15 S3C2410_RES_ERR,
16 S3C2410_RES_ABORT
17};
18
19enum s3c2410_dmasrc {
20 S3C2410_DMASRC_HW, /* source is memory */
21 S3C2410_DMASRC_MEM /* source is hardware */
22};
23
24/* enum s3c2410_chan_op
25 *
26 * operation codes passed to the DMA code by the user, and also used
27 * to inform the current channel owner of any changes to the system state
28*/
29
30enum s3c2410_chan_op {
31 S3C2410_DMAOP_START,
32 S3C2410_DMAOP_STOP,
33 S3C2410_DMAOP_PAUSE,
34 S3C2410_DMAOP_RESUME,
35 S3C2410_DMAOP_FLUSH,
36 S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */
37 S3C2410_DMAOP_STARTED, /* indicate channel started */
38};
39
40struct s3c2410_dma_client {
41 char *name;
42};
43
44struct s3c2410_dma_chan;
45
46/* s3c2410_dma_cbfn_t
47 *
48 * buffer callback routine type
49*/
50
51typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *,
52 void *buf, int size,
53 enum s3c2410_dma_buffresult result);
54
55typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *,
56 enum s3c2410_chan_op );
57
58
59
60/* s3c2410_dma_request
61 *
62 * request a dma channel exclusivley
63*/
64
65extern int s3c2410_dma_request(unsigned int channel,
66 struct s3c2410_dma_client *, void *dev);
67
68
69/* s3c2410_dma_ctrl
70 *
71 * change the state of the dma channel
72*/
73
74extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op);
75
76/* s3c2410_dma_setflags
77 *
78 * set the channel's flags to a given state
79*/
80
81extern int s3c2410_dma_setflags(unsigned int channel,
82 unsigned int flags);
83
84/* s3c2410_dma_free
85 *
86 * free the dma channel (will also abort any outstanding operations)
87*/
88
89extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *);
90
91/* s3c2410_dma_enqueue
92 *
93 * place the given buffer onto the queue of operations for the channel.
94 * The buffer must be allocated from dma coherent memory, or the Dcache/WB
95 * drained before the buffer is given to the DMA system.
96*/
97
98extern int s3c2410_dma_enqueue(unsigned int channel, void *id,
99 dma_addr_t data, int size);
100
101/* s3c2410_dma_config
102 *
103 * configure the dma channel
104*/
105
106extern int s3c2410_dma_config(unsigned int channel, int xferunit);
107
108/* s3c2410_dma_devconfig
109 *
110 * configure the device we're talking to
111*/
112
113extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source,
114 unsigned long devaddr);
115
116/* s3c2410_dma_getposition
117 *
118 * get the position that the dma transfer is currently at
119*/
120
121extern int s3c2410_dma_getposition(unsigned int channel,
122 dma_addr_t *src, dma_addr_t *dest);
123
124extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn);
125extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn);
126
127
diff --git a/arch/arm/plat-s3c/include/plat/gpio-core.h b/arch/arm/plat-s3c/include/plat/gpio-core.h
index 2fc60a580ac8..32af612767aa 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-core.h
+++ b/arch/arm/plat-s3c/include/plat/gpio-core.h
@@ -20,6 +20,18 @@
20 * specific code. 20 * specific code.
21*/ 21*/
22 22
23struct s3c_gpio_chip;
24
25/**
26 * struct s3c_gpio_pm - power management (suspend/resume) information
27 * @save: Routine to save the state of the GPIO block
28 * @resume: Routine to resume the GPIO block.
29 */
30struct s3c_gpio_pm {
31 void (*save)(struct s3c_gpio_chip *chip);
32 void (*resume)(struct s3c_gpio_chip *chip);
33};
34
23struct s3c_gpio_cfg; 35struct s3c_gpio_cfg;
24 36
25/** 37/**
@@ -27,6 +39,7 @@ struct s3c_gpio_cfg;
27 * @chip: The chip structure to be exported via gpiolib. 39 * @chip: The chip structure to be exported via gpiolib.
28 * @base: The base pointer to the gpio configuration registers. 40 * @base: The base pointer to the gpio configuration registers.
29 * @config: special function and pull-resistor control information. 41 * @config: special function and pull-resistor control information.
42 * @pm_save: Save information for suspend/resume support.
30 * 43 *
31 * This wrapper provides the necessary information for the Samsung 44 * This wrapper provides the necessary information for the Samsung
32 * specific gpios being registered with gpiolib. 45 * specific gpios being registered with gpiolib.
@@ -34,7 +47,11 @@ struct s3c_gpio_cfg;
34struct s3c_gpio_chip { 47struct s3c_gpio_chip {
35 struct gpio_chip chip; 48 struct gpio_chip chip;
36 struct s3c_gpio_cfg *config; 49 struct s3c_gpio_cfg *config;
50 struct s3c_gpio_pm *pm;
37 void __iomem *base; 51 void __iomem *base;
52#ifdef CONFIG_PM
53 u32 pm_save[4];
54#endif
38}; 55};
39 56
40static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc) 57static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc)
@@ -75,3 +92,16 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int chip)
75 92
76static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { } 93static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { }
77#endif 94#endif
95
96#ifdef CONFIG_PM
97extern struct s3c_gpio_pm s3c_gpio_pm_1bit;
98extern struct s3c_gpio_pm s3c_gpio_pm_2bit;
99extern struct s3c_gpio_pm s3c_gpio_pm_4bit;
100#define __gpio_pm(x) x
101#else
102#define s3c_gpio_pm_1bit NULL
103#define s3c_gpio_pm_2bit NULL
104#define s3c_gpio_pm_4bit NULL
105#define __gpio_pm(x) NULL
106
107#endif /* CONFIG_PM */
diff --git a/arch/arm/plat-s3c/include/plat/pm.h b/arch/arm/plat-s3c/include/plat/pm.h
index 3779775133a9..7a797192fcf3 100644
--- a/arch/arm/plat-s3c/include/plat/pm.h
+++ b/arch/arm/plat-s3c/include/plat/pm.h
@@ -44,6 +44,8 @@ extern void (*pm_cpu_sleep)(void);
44 44
45extern unsigned long s3c_pm_flags; 45extern unsigned long s3c_pm_flags;
46 46
47extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */
48
47/* from sleep.S */ 49/* from sleep.S */
48 50
49extern int s3c_cpu_save(unsigned long *saveblk); 51extern int s3c_cpu_save(unsigned long *saveblk);
@@ -88,6 +90,7 @@ struct pm_uart_save {
88 u32 ufcon; 90 u32 ufcon;
89 u32 umcon; 91 u32 umcon;
90 u32 ubrdiv; 92 u32 ubrdiv;
93 u32 udivslot;
91}; 94};
92 95
93/* helper functions to save/restore lists of registers. */ 96/* helper functions to save/restore lists of registers. */
@@ -124,6 +127,18 @@ extern void s3c_pm_dbg(const char *msg, ...);
124#define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt) 127#define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
125#endif 128#endif
126 129
130#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
131/**
132 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs
133 * @set: set bits for the state of the LEDs
134 * @clear: clear bits for the state of the LEDs.
135 */
136extern void s3c_pm_debug_smdkled(u32 set, u32 clear);
137
138#else
139static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { }
140#endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */
141
127/* suspend memory checking */ 142/* suspend memory checking */
128 143
129#ifdef CONFIG_S3C2410_PM_CHECK 144#ifdef CONFIG_S3C2410_PM_CHECK
diff --git a/arch/arm/plat-s3c/include/plat/regs-serial.h b/arch/arm/plat-s3c/include/plat/regs-serial.h
index 487d7d2a7e1d..66af75a5cdd1 100644
--- a/arch/arm/plat-s3c/include/plat/regs-serial.h
+++ b/arch/arm/plat-s3c/include/plat/regs-serial.h
@@ -189,6 +189,11 @@
189 189
190#define S3C2443_DIVSLOT (0x2C) 190#define S3C2443_DIVSLOT (0x2C)
191 191
192/* S3C64XX interrupt registers. */
193#define S3C64XX_UINTP 0x30
194#define S3C64XX_UINTSP 0x34
195#define S3C64XX_UINTM 0x38
196
192#ifndef __ASSEMBLY__ 197#ifndef __ASSEMBLY__
193 198
194/* struct s3c24xx_uart_clksrc 199/* struct s3c24xx_uart_clksrc
diff --git a/arch/arm/plat-s3c/include/plat/sdhci.h b/arch/arm/plat-s3c/include/plat/sdhci.h
index c4ca3920ca4b..f615308ccdfb 100644
--- a/arch/arm/plat-s3c/include/plat/sdhci.h
+++ b/arch/arm/plat-s3c/include/plat/sdhci.h
@@ -67,12 +67,52 @@ extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
67 67
68/* Helper function availablity */ 68/* Helper function availablity */
69 69
70extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
71extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
72
73/* S3C6400 SDHCI setup */
74
75#ifdef CONFIG_S3C6400_SETUP_SDHCI
76extern char *s3c6400_hsmmc_clksrcs[4];
77
78#ifdef CONFIG_S3C_DEV_HSMMC
79extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
80 void __iomem *r,
81 struct mmc_ios *ios,
82 struct mmc_card *card);
83
84static inline void s3c6400_default_sdhci0(void)
85{
86 s3c_hsmmc0_def_platdata.clocks = s3c6400_hsmmc_clksrcs;
87 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
88 s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
89}
90
91#else
92static inline void s3c6400_default_sdhci0(void) { }
93#endif /* CONFIG_S3C_DEV_HSMMC */
94
95#ifdef CONFIG_S3C_DEV_HSMMC1
96static inline void s3c6400_default_sdhci1(void)
97{
98 s3c_hsmmc1_def_platdata.clocks = s3c6400_hsmmc_clksrcs;
99 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
100 s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
101}
102#else
103static inline void s3c6400_default_sdhci1(void) { }
104#endif /* CONFIG_S3C_DEV_HSMMC1 */
105
106#else
107static inline void s3c6400_default_sdhci0(void) { }
108static inline void s3c6400_default_sdhci1(void) { }
109#endif /* CONFIG_S3C6400_SETUP_SDHCI */
110
111/* S3C6410 SDHCI setup */
112
70#ifdef CONFIG_S3C6410_SETUP_SDHCI 113#ifdef CONFIG_S3C6410_SETUP_SDHCI
71extern char *s3c6410_hsmmc_clksrcs[4]; 114extern char *s3c6410_hsmmc_clksrcs[4];
72 115
73extern void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
74extern void s3c6410_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
75
76extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, 116extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev,
77 void __iomem *r, 117 void __iomem *r,
78 struct mmc_ios *ios, 118 struct mmc_ios *ios,
@@ -82,7 +122,7 @@ extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev,
82static inline void s3c6410_default_sdhci0(void) 122static inline void s3c6410_default_sdhci0(void)
83{ 123{
84 s3c_hsmmc0_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 124 s3c_hsmmc0_def_platdata.clocks = s3c6410_hsmmc_clksrcs;
85 s3c_hsmmc0_def_platdata.cfg_gpio = s3c6410_setup_sdhci0_cfg_gpio; 125 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
86 s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 126 s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card;
87} 127}
88#else 128#else
@@ -93,7 +133,7 @@ static inline void s3c6410_default_sdhci0(void) { }
93static inline void s3c6410_default_sdhci1(void) 133static inline void s3c6410_default_sdhci1(void)
94{ 134{
95 s3c_hsmmc1_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 135 s3c_hsmmc1_def_platdata.clocks = s3c6410_hsmmc_clksrcs;
96 s3c_hsmmc1_def_platdata.cfg_gpio = s3c6410_setup_sdhci1_cfg_gpio; 136 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
97 s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 137 s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card;
98} 138}
99#else 139#else
diff --git a/arch/arm/plat-s3c/include/plat/udc-hs.h b/arch/arm/plat-s3c/include/plat/udc-hs.h
new file mode 100644
index 000000000000..dd04db043109
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/udc-hs.h
@@ -0,0 +1,29 @@
1/* arch/arm/plat-s3c/include/plat/udc-hs.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C USB2.0 High-speed / OtG platform information
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15enum s3c_hostg_dmamode {
16 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */
17 S3C_HSOTG_DMA_ONLY, /* always use DMA */
18 S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */
19};
20
21/**
22 * struct s3c_hsotg_plat - platform data for high-speed otg/udc
23 * @dma: Whether to use DMA or not.
24 * @is_osc: The clock source is an oscillator, not a crystal
25 */
26struct s3c_hsotg_plat {
27 enum s3c_hostg_dmamode dma;
28 unsigned int is_osc : 1;
29};
diff --git a/arch/arm/plat-s3c/include/plat/watchdog-reset.h b/arch/arm/plat-s3c/include/plat/watchdog-reset.h
new file mode 100644
index 000000000000..54b762acb5a0
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/watchdog-reset.h
@@ -0,0 +1,49 @@
1/* arch/arm/plat-s3c/include/plat/watchdog-reset.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - System define for arch_reset() function
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <plat/regs-watchdog.h>
14#include <mach/map.h>
15
16#include <linux/clk.h>
17#include <linux/err.h>
18#include <linux/io.h>
19
20static inline void arch_wdt_reset(void)
21{
22 struct clk *wdtclk;
23
24 printk("arch_reset: attempting watchdog reset\n");
25
26 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
27
28 wdtclk = clk_get(NULL, "watchdog");
29 if (!IS_ERR(wdtclk)) {
30 clk_enable(wdtclk);
31 } else
32 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
33
34 /* put initial values into count and data */
35 __raw_writel(0x80, S3C2410_WTCNT);
36 __raw_writel(0x80, S3C2410_WTDAT);
37
38 /* set the watchdog to go and reset... */
39 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
40 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
41
42 /* wait for reset to assert... */
43 mdelay(500);
44
45 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
46
47 /* delay to allow the serial port to show the message */
48 mdelay(50);
49}
diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
new file mode 100644
index 000000000000..cfd326a8b693
--- /dev/null
+++ b/arch/arm/plat-s3c/pm-gpio.c
@@ -0,0 +1,380 @@
1
2/* linux/arch/arm/plat-s3c/pm-gpio.c
3 *
4 * Copyright 2008 Openmoko, Inc.
5 * Copyright 2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * S3C series GPIO PM code
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/sysdev.h>
18#include <linux/init.h>
19#include <linux/io.h>
20#include <linux/gpio.h>
21
22#include <mach/gpio-core.h>
23#include <plat/pm.h>
24
25/* PM GPIO helpers */
26
27#define OFFS_CON (0x00)
28#define OFFS_DAT (0x04)
29#define OFFS_UP (0x08)
30
31static void s3c_gpio_pm_1bit_save(struct s3c_gpio_chip *chip)
32{
33 chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON);
34 chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT);
35}
36
37static void s3c_gpio_pm_1bit_resume(struct s3c_gpio_chip *chip)
38{
39 void __iomem *base = chip->base;
40 u32 old_gpcon = __raw_readl(base + OFFS_CON);
41 u32 old_gpdat = __raw_readl(base + OFFS_DAT);
42 u32 gps_gpcon = chip->pm_save[0];
43 u32 gps_gpdat = chip->pm_save[1];
44 u32 gpcon;
45
46 /* GPACON only has one bit per control / data and no PULLUPs.
47 * GPACON[x] = 0 => Output, 1 => SFN */
48
49 /* first set all SFN bits to SFN */
50
51 gpcon = old_gpcon | gps_gpcon;
52 __raw_writel(gpcon, base + OFFS_CON);
53
54 /* now set all the other bits */
55
56 __raw_writel(gps_gpdat, base + OFFS_DAT);
57 __raw_writel(gps_gpcon, base + OFFS_CON);
58
59 S3C_PMDBG("%s: CON %08x => %08x, DAT %08x => %08x\n",
60 chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat);
61}
62
63struct s3c_gpio_pm s3c_gpio_pm_1bit = {
64 .save = s3c_gpio_pm_1bit_save,
65 .resume = s3c_gpio_pm_1bit_resume,
66};
67
68static void s3c_gpio_pm_2bit_save(struct s3c_gpio_chip *chip)
69{
70 chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON);
71 chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT);
72 chip->pm_save[2] = __raw_readl(chip->base + OFFS_UP);
73}
74
75/* Test whether the given masked+shifted bits of an GPIO configuration
76 * are one of the SFN (special function) modes. */
77
78static inline int is_sfn(unsigned long con)
79{
80 return con >= 2;
81}
82
83/* Test if the given masked+shifted GPIO configuration is an input */
84
85static inline int is_in(unsigned long con)
86{
87 return con == 0;
88}
89
90/* Test if the given masked+shifted GPIO configuration is an output */
91
92static inline int is_out(unsigned long con)
93{
94 return con == 1;
95}
96
97/**
98 * s3c_gpio_pm_2bit_resume() - restore the given GPIO bank
99 * @chip: The chip information to resume.
100 *
101 * Restore one of the GPIO banks that was saved during suspend. This is
102 * not as simple as once thought, due to the possibility of glitches
103 * from the order that the CON and DAT registers are set in.
104 *
105 * The three states the pin can be are {IN,OUT,SFN} which gives us 9
106 * combinations of changes to check. Three of these, if the pin stays
107 * in the same configuration can be discounted. This leaves us with
108 * the following:
109 *
110 * { IN => OUT } Change DAT first
111 * { IN => SFN } Change CON first
112 * { OUT => SFN } Change CON first, so new data will not glitch
113 * { OUT => IN } Change CON first, so new data will not glitch
114 * { SFN => IN } Change CON first
115 * { SFN => OUT } Change DAT first, so new data will not glitch [1]
116 *
117 * We do not currently deal with the UP registers as these control
118 * weak resistors, so a small delay in change should not need to bring
119 * these into the calculations.
120 *
121 * [1] this assumes that writing to a pin DAT whilst in SFN will set the
122 * state for when it is next output.
123 */
124static void s3c_gpio_pm_2bit_resume(struct s3c_gpio_chip *chip)
125{
126 void __iomem *base = chip->base;
127 u32 old_gpcon = __raw_readl(base + OFFS_CON);
128 u32 old_gpdat = __raw_readl(base + OFFS_DAT);
129 u32 gps_gpcon = chip->pm_save[0];
130 u32 gps_gpdat = chip->pm_save[1];
131 u32 gpcon, old, new, mask;
132 u32 change_mask = 0x0;
133 int nr;
134
135 /* restore GPIO pull-up settings */
136 __raw_writel(chip->pm_save[2], base + OFFS_UP);
137
138 /* Create a change_mask of all the items that need to have
139 * their CON value changed before their DAT value, so that
140 * we minimise the work between the two settings.
141 */
142
143 for (nr = 0, mask = 0x03; nr < 32; nr += 2, mask <<= 2) {
144 old = (old_gpcon & mask) >> nr;
145 new = (gps_gpcon & mask) >> nr;
146
147 /* If there is no change, then skip */
148
149 if (old == new)
150 continue;
151
152 /* If both are special function, then skip */
153
154 if (is_sfn(old) && is_sfn(new))
155 continue;
156
157 /* Change is IN => OUT, do not change now */
158
159 if (is_in(old) && is_out(new))
160 continue;
161
162 /* Change is SFN => OUT, do not change now */
163
164 if (is_sfn(old) && is_out(new))
165 continue;
166
167 /* We should now be at the case of IN=>SFN,
168 * OUT=>SFN, OUT=>IN, SFN=>IN. */
169
170 change_mask |= mask;
171 }
172
173
174 /* Write the new CON settings */
175
176 gpcon = old_gpcon & ~change_mask;
177 gpcon |= gps_gpcon & change_mask;
178
179 __raw_writel(gpcon, base + OFFS_CON);
180
181 /* Now change any items that require DAT,CON */
182
183 __raw_writel(gps_gpdat, base + OFFS_DAT);
184 __raw_writel(gps_gpcon, base + OFFS_CON);
185
186 S3C_PMDBG("%s: CON %08x => %08x, DAT %08x => %08x\n",
187 chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat);
188}
189
190struct s3c_gpio_pm s3c_gpio_pm_2bit = {
191 .save = s3c_gpio_pm_2bit_save,
192 .resume = s3c_gpio_pm_2bit_resume,
193};
194
195#ifdef CONFIG_ARCH_S3C64XX
196static void s3c_gpio_pm_4bit_save(struct s3c_gpio_chip *chip)
197{
198 chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON);
199 chip->pm_save[2] = __raw_readl(chip->base + OFFS_DAT);
200 chip->pm_save[3] = __raw_readl(chip->base + OFFS_UP);
201
202 if (chip->chip.ngpio > 8)
203 chip->pm_save[0] = __raw_readl(chip->base - 4);
204}
205
206static u32 s3c_gpio_pm_4bit_mask(u32 old_gpcon, u32 gps_gpcon)
207{
208 u32 old, new, mask;
209 u32 change_mask = 0x0;
210 int nr;
211
212 for (nr = 0, mask = 0x0f; nr < 16; nr += 4, mask <<= 4) {
213 old = (old_gpcon & mask) >> nr;
214 new = (gps_gpcon & mask) >> nr;
215
216 /* If there is no change, then skip */
217
218 if (old == new)
219 continue;
220
221 /* If both are special function, then skip */
222
223 if (is_sfn(old) && is_sfn(new))
224 continue;
225
226 /* Change is IN => OUT, do not change now */
227
228 if (is_in(old) && is_out(new))
229 continue;
230
231 /* Change is SFN => OUT, do not change now */
232
233 if (is_sfn(old) && is_out(new))
234 continue;
235
236 /* We should now be at the case of IN=>SFN,
237 * OUT=>SFN, OUT=>IN, SFN=>IN. */
238
239 change_mask |= mask;
240 }
241
242 return change_mask;
243}
244
245static void s3c_gpio_pm_4bit_con(struct s3c_gpio_chip *chip, int index)
246{
247 void __iomem *con = chip->base + (index * 4);
248 u32 old_gpcon = __raw_readl(con);
249 u32 gps_gpcon = chip->pm_save[index + 1];
250 u32 gpcon, mask;
251
252 mask = s3c_gpio_pm_4bit_mask(old_gpcon, gps_gpcon);
253
254 gpcon = old_gpcon & ~mask;
255 gpcon |= gps_gpcon & mask;
256
257 __raw_writel(gpcon, con);
258}
259
260static void s3c_gpio_pm_4bit_resume(struct s3c_gpio_chip *chip)
261{
262 void __iomem *base = chip->base;
263 u32 old_gpcon[2];
264 u32 old_gpdat = __raw_readl(base + OFFS_DAT);
265 u32 gps_gpdat = chip->pm_save[2];
266
267 /* First, modify the CON settings */
268
269 old_gpcon[0] = 0;
270 old_gpcon[1] = __raw_readl(base + OFFS_CON);
271
272 s3c_gpio_pm_4bit_con(chip, 0);
273 if (chip->chip.ngpio > 8) {
274 old_gpcon[0] = __raw_readl(base - 4);
275 s3c_gpio_pm_4bit_con(chip, -1);
276 }
277
278 /* Now change the configurations that require DAT,CON */
279
280 __raw_writel(chip->pm_save[2], base + OFFS_DAT);
281 __raw_writel(chip->pm_save[1], base + OFFS_CON);
282 if (chip->chip.ngpio > 8)
283 __raw_writel(chip->pm_save[0], base - 4);
284
285 __raw_writel(chip->pm_save[2], base + OFFS_DAT);
286 __raw_writel(chip->pm_save[3], base + OFFS_UP);
287
288 if (chip->chip.ngpio > 8) {
289 S3C_PMDBG("%s: CON4 %08x,%08x => %08x,%08x, DAT %08x => %08x\n",
290 chip->chip.label, old_gpcon[0], old_gpcon[1],
291 __raw_readl(base - 4),
292 __raw_readl(base + OFFS_CON),
293 old_gpdat, gps_gpdat);
294 } else
295 S3C_PMDBG("%s: CON4 %08x => %08x, DAT %08x => %08x\n",
296 chip->chip.label, old_gpcon[1],
297 __raw_readl(base + OFFS_CON),
298 old_gpdat, gps_gpdat);
299}
300
301struct s3c_gpio_pm s3c_gpio_pm_4bit = {
302 .save = s3c_gpio_pm_4bit_save,
303 .resume = s3c_gpio_pm_4bit_resume,
304};
305#endif /* CONFIG_ARCH_S3C64XX */
306
307/**
308 * s3c_pm_save_gpio() - save gpio chip data for suspend
309 * @ourchip: The chip for suspend.
310 */
311static void s3c_pm_save_gpio(struct s3c_gpio_chip *ourchip)
312{
313 struct s3c_gpio_pm *pm = ourchip->pm;
314
315 if (pm == NULL || pm->save == NULL)
316 S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label);
317 else
318 pm->save(ourchip);
319}
320
321/**
322 * s3c_pm_save_gpios() - Save the state of the GPIO banks.
323 *
324 * For all the GPIO banks, save the state of each one ready for going
325 * into a suspend mode.
326 */
327void s3c_pm_save_gpios(void)
328{
329 struct s3c_gpio_chip *ourchip;
330 unsigned int gpio_nr;
331
332 for (gpio_nr = 0; gpio_nr < S3C_GPIO_END; gpio_nr++) {
333 ourchip = s3c_gpiolib_getchip(gpio_nr);
334 if (!ourchip)
335 continue;
336
337 s3c_pm_save_gpio(ourchip);
338
339 S3C_PMDBG("%s: save %08x,%08x,%08x,%08x\n",
340 ourchip->chip.label,
341 ourchip->pm_save[0],
342 ourchip->pm_save[1],
343 ourchip->pm_save[2],
344 ourchip->pm_save[3]);
345
346 gpio_nr += ourchip->chip.ngpio;
347 gpio_nr += CONFIG_S3C_GPIO_SPACE;
348 }
349}
350
351/**
352 * s3c_pm_resume_gpio() - restore gpio chip data after suspend
353 * @ourchip: The suspended chip.
354 */
355static void s3c_pm_resume_gpio(struct s3c_gpio_chip *ourchip)
356{
357 struct s3c_gpio_pm *pm = ourchip->pm;
358
359 if (pm == NULL || pm->resume == NULL)
360 S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label);
361 else
362 pm->resume(ourchip);
363}
364
365void s3c_pm_restore_gpios(void)
366{
367 struct s3c_gpio_chip *ourchip;
368 unsigned int gpio_nr;
369
370 for (gpio_nr = 0; gpio_nr < S3C_GPIO_END; gpio_nr++) {
371 ourchip = s3c_gpiolib_getchip(gpio_nr);
372 if (!ourchip)
373 continue;
374
375 s3c_pm_resume_gpio(ourchip);
376
377 gpio_nr += ourchip->chip.ngpio;
378 gpio_nr += CONFIG_S3C_GPIO_SPACE;
379 }
380}
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
index 061182ca66e3..8d97db2c7a0d 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-s3c/pm.c
@@ -21,11 +21,10 @@
21 21
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/map.h>
24 25
25#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
26#include <mach/regs-clock.h> 27#include <mach/regs-clock.h>
27#include <mach/regs-gpio.h>
28#include <mach/regs-mem.h>
29#include <mach/regs-irq.h> 28#include <mach/regs-irq.h>
30#include <asm/irq.h> 29#include <asm/irq.h>
31 30
@@ -70,6 +69,8 @@ static inline void s3c_pm_debug_init(void)
70 69
71/* Save the UART configurations if we are configured for debug. */ 70/* Save the UART configurations if we are configured for debug. */
72 71
72unsigned char pm_uart_udivslot;
73
73#ifdef CONFIG_S3C2410_PM_DEBUG 74#ifdef CONFIG_S3C2410_PM_DEBUG
74 75
75struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS]; 76struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
@@ -83,6 +84,12 @@ static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
83 save->ufcon = __raw_readl(regs + S3C2410_UFCON); 84 save->ufcon = __raw_readl(regs + S3C2410_UFCON);
84 save->umcon = __raw_readl(regs + S3C2410_UMCON); 85 save->umcon = __raw_readl(regs + S3C2410_UMCON);
85 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV); 86 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
87
88 if (pm_uart_udivslot)
89 save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT);
90
91 S3C_PMDBG("UART[%d]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n",
92 uart, save->ulcon, save->ucon, save->ufcon, save->ubrdiv);
86} 93}
87 94
88static void s3c_pm_save_uarts(void) 95static void s3c_pm_save_uarts(void)
@@ -98,11 +105,16 @@ static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
98{ 105{
99 void __iomem *regs = S3C_VA_UARTx(uart); 106 void __iomem *regs = S3C_VA_UARTx(uart);
100 107
108 s3c_pm_arch_update_uart(regs, save);
109
101 __raw_writel(save->ulcon, regs + S3C2410_ULCON); 110 __raw_writel(save->ulcon, regs + S3C2410_ULCON);
102 __raw_writel(save->ucon, regs + S3C2410_UCON); 111 __raw_writel(save->ucon, regs + S3C2410_UCON);
103 __raw_writel(save->ufcon, regs + S3C2410_UFCON); 112 __raw_writel(save->ufcon, regs + S3C2410_UFCON);
104 __raw_writel(save->umcon, regs + S3C2410_UMCON); 113 __raw_writel(save->umcon, regs + S3C2410_UMCON);
105 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV); 114 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
115
116 if (pm_uart_udivslot)
117 __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT);
106} 118}
107 119
108static void s3c_pm_restore_uarts(void) 120static void s3c_pm_restore_uarts(void)
@@ -313,6 +325,9 @@ static int s3c_pm_enter(suspend_state_t state)
313 325
314 S3C_PMDBG("%s: post sleep, preparing to return\n", __func__); 326 S3C_PMDBG("%s: post sleep, preparing to return\n", __func__);
315 327
328 /* LEDs should now be 1110 */
329 s3c_pm_debug_smdkled(1 << 1, 0);
330
316 s3c_pm_check_restore(); 331 s3c_pm_check_restore();
317 332
318 /* ok, let's return from sleep */ 333 /* ok, let's return from sleep */
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 2c8a2f5d75ff..5b0bc914f58e 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -71,6 +71,7 @@ config PM_SIMTEC
71config S3C2410_DMA 71config S3C2410_DMA
72 bool "S3C2410 DMA support" 72 bool "S3C2410 DMA support"
73 depends on ARCH_S3C2410 73 depends on ARCH_S3C2410
74 select S3C_DMA
74 help 75 help
75 S3C2410 DMA support. This is needed for drivers like sound which 76 S3C2410 DMA support. This is needed for drivers like sound which
76 use the S3C2410's DMA system to move data to and from the 77 use the S3C2410's DMA system to move data to and from the
diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c
index 91adfa71c172..ee1baf11ad9e 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-s3c24xx/adc.c
@@ -45,7 +45,8 @@ struct s3c_adc_client {
45 unsigned char channel; 45 unsigned char channel;
46 46
47 void (*select_cb)(unsigned selected); 47 void (*select_cb)(unsigned selected);
48 void (*convert_cb)(unsigned val1, unsigned val2); 48 void (*convert_cb)(unsigned val1, unsigned val2,
49 unsigned *samples_left);
49}; 50};
50 51
51struct adc_device { 52struct adc_device {
@@ -158,7 +159,8 @@ static void s3c_adc_default_select(unsigned select)
158 159
159struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, 160struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev,
160 void (*select)(unsigned int selected), 161 void (*select)(unsigned int selected),
161 void (*conv)(unsigned d0, unsigned d1), 162 void (*conv)(unsigned d0, unsigned d1,
163 unsigned *samples_left),
162 unsigned int is_ts) 164 unsigned int is_ts)
163{ 165{
164 struct s3c_adc_client *client; 166 struct s3c_adc_client *client;
@@ -227,9 +229,10 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
227 data1 = readl(adc->regs + S3C2410_ADCDAT1); 229 data1 = readl(adc->regs + S3C2410_ADCDAT1);
228 adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1); 230 adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1);
229 231
230 (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff); 232 client->nr_samples--;
233 (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff, &client->nr_samples);
231 234
232 if (--client->nr_samples > 0) { 235 if (client->nr_samples > 0) {
233 /* fire another conversion for this */ 236 /* fire another conversion for this */
234 237
235 client->select_cb(1); 238 client->select_cb(1);
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index 1a8347cec20a..aa119863c5ce 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -18,6 +18,7 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h>
21#include <linux/sysdev.h> 22#include <linux/sysdev.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23 24
@@ -47,27 +48,27 @@
47/* LED devices */ 48/* LED devices */
48 49
49static struct s3c24xx_led_platdata smdk_pdata_led4 = { 50static struct s3c24xx_led_platdata smdk_pdata_led4 = {
50 .gpio = S3C2410_GPF4, 51 .gpio = S3C2410_GPF(4),
51 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 52 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
52 .name = "led4", 53 .name = "led4",
53 .def_trigger = "timer", 54 .def_trigger = "timer",
54}; 55};
55 56
56static struct s3c24xx_led_platdata smdk_pdata_led5 = { 57static struct s3c24xx_led_platdata smdk_pdata_led5 = {
57 .gpio = S3C2410_GPF5, 58 .gpio = S3C2410_GPF(5),
58 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 59 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
59 .name = "led5", 60 .name = "led5",
60 .def_trigger = "nand-disk", 61 .def_trigger = "nand-disk",
61}; 62};
62 63
63static struct s3c24xx_led_platdata smdk_pdata_led6 = { 64static struct s3c24xx_led_platdata smdk_pdata_led6 = {
64 .gpio = S3C2410_GPF6, 65 .gpio = S3C2410_GPF(6),
65 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 66 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
66 .name = "led6", 67 .name = "led6",
67}; 68};
68 69
69static struct s3c24xx_led_platdata smdk_pdata_led7 = { 70static struct s3c24xx_led_platdata smdk_pdata_led7 = {
70 .gpio = S3C2410_GPF7, 71 .gpio = S3C2410_GPF(7),
71 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 72 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
72 .name = "led7", 73 .name = "led7",
73}; 74};
@@ -184,15 +185,15 @@ void __init smdk_machine_init(void)
184{ 185{
185 /* Configure the LEDs (even if we have no LED support)*/ 186 /* Configure the LEDs (even if we have no LED support)*/
186 187
187 s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); 188 s3c2410_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT);
188 s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); 189 s3c2410_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT);
189 s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); 190 s3c2410_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT);
190 s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); 191 s3c2410_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT);
191 192
192 s3c2410_gpio_setpin(S3C2410_GPF4, 1); 193 s3c2410_gpio_setpin(S3C2410_GPF(4), 1);
193 s3c2410_gpio_setpin(S3C2410_GPF5, 1); 194 s3c2410_gpio_setpin(S3C2410_GPF(5), 1);
194 s3c2410_gpio_setpin(S3C2410_GPF6, 1); 195 s3c2410_gpio_setpin(S3C2410_GPF(6), 1);
195 s3c2410_gpio_setpin(S3C2410_GPF7, 1); 196 s3c2410_gpio_setpin(S3C2410_GPF(7), 1);
196 197
197 if (machine_is_smdk2443()) 198 if (machine_is_smdk2443())
198 smdk_nand_info.twrph0 = 50; 199 smdk_nand_info.twrph0 = 50;
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 16ac01d9b8ab..4eb378c89a39 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -136,36 +136,6 @@ struct platform_device *s3c24xx_uart_src[4] = {
136struct platform_device *s3c24xx_uart_devs[4] = { 136struct platform_device *s3c24xx_uart_devs[4] = {
137}; 137};
138 138
139/* USB Host Controller */
140
141static struct resource s3c_usb_resource[] = {
142 [0] = {
143 .start = S3C24XX_PA_USBHOST,
144 .end = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
145 .flags = IORESOURCE_MEM,
146 },
147 [1] = {
148 .start = IRQ_USBH,
149 .end = IRQ_USBH,
150 .flags = IORESOURCE_IRQ,
151 }
152};
153
154static u64 s3c_device_usb_dmamask = 0xffffffffUL;
155
156struct platform_device s3c_device_usb = {
157 .name = "s3c2410-ohci",
158 .id = -1,
159 .num_resources = ARRAY_SIZE(s3c_usb_resource),
160 .resource = s3c_usb_resource,
161 .dev = {
162 .dma_mask = &s3c_device_usb_dmamask,
163 .coherent_dma_mask = 0xffffffffUL
164 }
165};
166
167EXPORT_SYMBOL(s3c_device_usb);
168
169/* LCD Controller */ 139/* LCD Controller */
170 140
171static struct resource s3c_lcd_resource[] = { 141static struct resource s3c_lcd_resource[] = {
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 07326f632361..196b19123653 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -31,10 +31,10 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/dma.h> 33#include <mach/dma.h>
34
35#include <mach/map.h> 34#include <mach/map.h>
36 35
37#include <plat/dma.h> 36#include <plat/dma-plat.h>
37#include <plat/regs-dma.h>
38 38
39/* io map for dma */ 39/* io map for dma */
40static void __iomem *dma_base; 40static void __iomem *dma_base;
@@ -44,8 +44,6 @@ static int dma_channels;
44 44
45static struct s3c24xx_dma_selection dma_sel; 45static struct s3c24xx_dma_selection dma_sel;
46 46
47/* dma channel state information */
48struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
49 47
50/* debugging functions */ 48/* debugging functions */
51 49
@@ -135,21 +133,6 @@ dmadbg_showregs(const char *fname, int line, struct s3c2410_dma_chan *chan)
135#define dbg_showchan(chan) do { } while(0) 133#define dbg_showchan(chan) do { } while(0)
136#endif /* CONFIG_S3C2410_DMA_DEBUG */ 134#endif /* CONFIG_S3C2410_DMA_DEBUG */
137 135
138static struct s3c2410_dma_chan *dma_chan_map[DMACH_MAX];
139
140/* lookup_dma_channel
141 *
142 * change the dma channel number given into a real dma channel id
143*/
144
145static struct s3c2410_dma_chan *lookup_dma_channel(unsigned int channel)
146{
147 if (channel & DMACH_LOW_LEVEL)
148 return &s3c2410_chans[channel & ~DMACH_LOW_LEVEL];
149 else
150 return dma_chan_map[channel];
151}
152
153/* s3c2410_dma_stats_timeout 136/* s3c2410_dma_stats_timeout
154 * 137 *
155 * Update DMA stats from timeout info 138 * Update DMA stats from timeout info
@@ -214,8 +197,6 @@ s3c2410_dma_waitforload(struct s3c2410_dma_chan *chan, int line)
214 return 0; 197 return 0;
215} 198}
216 199
217
218
219/* s3c2410_dma_loadbuffer 200/* s3c2410_dma_loadbuffer
220 * 201 *
221 * load a buffer, and update the channel state 202 * load a buffer, and update the channel state
@@ -453,7 +434,7 @@ s3c2410_dma_canload(struct s3c2410_dma_chan *chan)
453int s3c2410_dma_enqueue(unsigned int channel, void *id, 434int s3c2410_dma_enqueue(unsigned int channel, void *id,
454 dma_addr_t data, int size) 435 dma_addr_t data, int size)
455{ 436{
456 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 437 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
457 struct s3c2410_dma_buf *buf; 438 struct s3c2410_dma_buf *buf;
458 unsigned long flags; 439 unsigned long flags;
459 440
@@ -804,7 +785,7 @@ EXPORT_SYMBOL(s3c2410_dma_request);
804 785
805int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 786int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
806{ 787{
807 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 788 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
808 unsigned long flags; 789 unsigned long flags;
809 790
810 if (chan == NULL) 791 if (chan == NULL)
@@ -836,7 +817,7 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
836 chan->irq_claimed = 0; 817 chan->irq_claimed = 0;
837 818
838 if (!(channel & DMACH_LOW_LEVEL)) 819 if (!(channel & DMACH_LOW_LEVEL))
839 dma_chan_map[channel] = NULL; 820 s3c_dma_chan_map[channel] = NULL;
840 821
841 local_irq_restore(flags); 822 local_irq_restore(flags);
842 823
@@ -995,7 +976,7 @@ static int s3c2410_dma_started(struct s3c2410_dma_chan *chan)
995int 976int
996s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 977s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op)
997{ 978{
998 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 979 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
999 980
1000 if (chan == NULL) 981 if (chan == NULL)
1001 return -EINVAL; 982 return -EINVAL;
@@ -1038,14 +1019,13 @@ EXPORT_SYMBOL(s3c2410_dma_ctrl);
1038/* s3c2410_dma_config 1019/* s3c2410_dma_config
1039 * 1020 *
1040 * xfersize: size of unit in bytes (1,2,4) 1021 * xfersize: size of unit in bytes (1,2,4)
1041 * dcon: base value of the DCONx register
1042*/ 1022*/
1043 1023
1044int s3c2410_dma_config(unsigned int channel, 1024int s3c2410_dma_config(unsigned int channel,
1045 int xferunit, 1025 int xferunit)
1046 int dcon)
1047{ 1026{
1048 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1027 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
1028 unsigned int dcon;
1049 1029
1050 pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n", 1030 pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n",
1051 __func__, channel, xferunit, dcon); 1031 __func__, channel, xferunit, dcon);
@@ -1055,10 +1035,33 @@ int s3c2410_dma_config(unsigned int channel,
1055 1035
1056 pr_debug("%s: Initial dcon is %08x\n", __func__, dcon); 1036 pr_debug("%s: Initial dcon is %08x\n", __func__, dcon);
1057 1037
1058 dcon |= chan->dcon & dma_sel.dcon_mask; 1038 dcon = chan->dcon & dma_sel.dcon_mask;
1059 1039
1060 pr_debug("%s: New dcon is %08x\n", __func__, dcon); 1040 pr_debug("%s: New dcon is %08x\n", __func__, dcon);
1061 1041
1042 switch (chan->req_ch) {
1043 case DMACH_I2S_IN:
1044 case DMACH_I2S_OUT:
1045 case DMACH_PCM_IN:
1046 case DMACH_PCM_OUT:
1047 case DMACH_MIC_IN:
1048 default:
1049 dcon |= S3C2410_DCON_HANDSHAKE;
1050 dcon |= S3C2410_DCON_SYNC_PCLK;
1051 break;
1052
1053 case DMACH_SDI:
1054 /* note, ensure if need HANDSHAKE or not */
1055 dcon |= S3C2410_DCON_SYNC_PCLK;
1056 break;
1057
1058 case DMACH_XD0:
1059 case DMACH_XD1:
1060 dcon |= S3C2410_DCON_HANDSHAKE;
1061 dcon |= S3C2410_DCON_SYNC_HCLK;
1062 break;
1063 }
1064
1062 switch (xferunit) { 1065 switch (xferunit) {
1063 case 1: 1066 case 1:
1064 dcon |= S3C2410_DCON_BYTE; 1067 dcon |= S3C2410_DCON_BYTE;
@@ -1090,58 +1093,6 @@ int s3c2410_dma_config(unsigned int channel,
1090 1093
1091EXPORT_SYMBOL(s3c2410_dma_config); 1094EXPORT_SYMBOL(s3c2410_dma_config);
1092 1095
1093int s3c2410_dma_setflags(unsigned int channel, unsigned int flags)
1094{
1095 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
1096
1097 if (chan == NULL)
1098 return -EINVAL;
1099
1100 pr_debug("%s: chan=%p, flags=%08x\n", __func__, chan, flags);
1101
1102 chan->flags = flags;
1103
1104 return 0;
1105}
1106
1107EXPORT_SYMBOL(s3c2410_dma_setflags);
1108
1109
1110/* do we need to protect the settings of the fields from
1111 * irq?
1112*/
1113
1114int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn)
1115{
1116 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
1117
1118 if (chan == NULL)
1119 return -EINVAL;
1120
1121 pr_debug("%s: chan=%p, op rtn=%p\n", __func__, chan, rtn);
1122
1123 chan->op_fn = rtn;
1124
1125 return 0;
1126}
1127
1128EXPORT_SYMBOL(s3c2410_dma_set_opfn);
1129
1130int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn)
1131{
1132 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
1133
1134 if (chan == NULL)
1135 return -EINVAL;
1136
1137 pr_debug("%s: chan=%p, callback rtn=%p\n", __func__, chan, rtn);
1138
1139 chan->callback_fn = rtn;
1140
1141 return 0;
1142}
1143
1144EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
1145 1096
1146/* s3c2410_dma_devconfig 1097/* s3c2410_dma_devconfig
1147 * 1098 *
@@ -1150,29 +1101,38 @@ EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
1150 * source: S3C2410_DMASRC_HW: source is hardware 1101 * source: S3C2410_DMASRC_HW: source is hardware
1151 * S3C2410_DMASRC_MEM: source is memory 1102 * S3C2410_DMASRC_MEM: source is memory
1152 * 1103 *
1153 * hwcfg: the value for xxxSTCn register,
1154 * bit 0: 0=increment pointer, 1=leave pointer
1155 * bit 1: 0=source is AHB, 1=source is APB
1156 *
1157 * devaddr: physical address of the source 1104 * devaddr: physical address of the source
1158*/ 1105*/
1159 1106
1160int s3c2410_dma_devconfig(int channel, 1107int s3c2410_dma_devconfig(int channel,
1161 enum s3c2410_dmasrc source, 1108 enum s3c2410_dmasrc source,
1162 int hwcfg,
1163 unsigned long devaddr) 1109 unsigned long devaddr)
1164{ 1110{
1165 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1111 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
1112 unsigned int hwcfg;
1166 1113
1167 if (chan == NULL) 1114 if (chan == NULL)
1168 return -EINVAL; 1115 return -EINVAL;
1169 1116
1170 pr_debug("%s: source=%d, hwcfg=%08x, devaddr=%08lx\n", 1117 pr_debug("%s: source=%d, devaddr=%08lx\n",
1171 __func__, (int)source, hwcfg, devaddr); 1118 __func__, (int)source, devaddr);
1172 1119
1173 chan->source = source; 1120 chan->source = source;
1174 chan->dev_addr = devaddr; 1121 chan->dev_addr = devaddr;
1175 chan->hw_cfg = hwcfg; 1122
1123 switch (chan->req_ch) {
1124 case DMACH_XD0:
1125 case DMACH_XD1:
1126 hwcfg = 0; /* AHB */
1127 break;
1128
1129 default:
1130 hwcfg = S3C2410_DISRCC_APB;
1131 }
1132
1133 /* always assume our peripheral desintation is a fixed
1134 * address in memory. */
1135 hwcfg |= S3C2410_DISRCC_INC;
1176 1136
1177 switch (source) { 1137 switch (source) {
1178 case S3C2410_DMASRC_HW: 1138 case S3C2410_DMASRC_HW:
@@ -1219,7 +1179,7 @@ EXPORT_SYMBOL(s3c2410_dma_devconfig);
1219 1179
1220int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst) 1180int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst)
1221{ 1181{
1222 struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1182 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
1223 1183
1224 if (chan == NULL) 1184 if (chan == NULL)
1225 return -EINVAL; 1185 return -EINVAL;
@@ -1278,8 +1238,8 @@ static int s3c2410_dma_resume(struct sys_device *dev)
1278 1238
1279 printk(KERN_INFO "dma%d: restoring configuration\n", cp->number); 1239 printk(KERN_INFO "dma%d: restoring configuration\n", cp->number);
1280 1240
1281 s3c2410_dma_config(no, cp->xfer_unit, cp->dcon); 1241 s3c2410_dma_config(no, cp->xfer_unit);
1282 s3c2410_dma_devconfig(no, cp->source, cp->hw_cfg, cp->dev_addr); 1242 s3c2410_dma_devconfig(no, cp->source, cp->dev_addr);
1283 1243
1284 /* re-select the dma source for this channel */ 1244 /* re-select the dma source for this channel */
1285 1245
@@ -1476,7 +1436,8 @@ static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
1476 found: 1436 found:
1477 dmach = &s3c2410_chans[ch]; 1437 dmach = &s3c2410_chans[ch];
1478 dmach->map = ch_map; 1438 dmach->map = ch_map;
1479 dma_chan_map[channel] = dmach; 1439 dmach->req_ch = channel;
1440 s3c_dma_chan_map[channel] = dmach;
1480 1441
1481 /* select the channel */ 1442 /* select the channel */
1482 1443
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c
index 4a899c279eb5..95df059b5a1d 100644
--- a/arch/arm/plat-s3c24xx/gpio.c
+++ b/arch/arm/plat-s3c24xx/gpio.c
@@ -183,35 +183,19 @@ EXPORT_SYMBOL(s3c2410_modify_misccr);
183 183
184int s3c2410_gpio_getirq(unsigned int pin) 184int s3c2410_gpio_getirq(unsigned int pin)
185{ 185{
186 if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15) 186 if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15))
187 return -1; /* not valid interrupts */ 187 return -EINVAL; /* not valid interrupts */
188 188
189 if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7) 189 if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7))
190 return -1; /* not valid pin */ 190 return -EINVAL; /* not valid pin */
191 191
192 if (pin < S3C2410_GPF4) 192 if (pin < S3C2410_GPF(4))
193 return (pin - S3C2410_GPF0) + IRQ_EINT0; 193 return (pin - S3C2410_GPF(0)) + IRQ_EINT0;
194 194
195 if (pin < S3C2410_GPG0) 195 if (pin < S3C2410_GPG(0))
196 return (pin - S3C2410_GPF4) + IRQ_EINT4; 196 return (pin - S3C2410_GPF(4)) + IRQ_EINT4;
197 197
198 return (pin - S3C2410_GPG0) + IRQ_EINT8; 198 return (pin - S3C2410_GPG(0)) + IRQ_EINT8;
199} 199}
200 200
201EXPORT_SYMBOL(s3c2410_gpio_getirq); 201EXPORT_SYMBOL(s3c2410_gpio_getirq);
202
203int s3c2410_gpio_irq2pin(unsigned int irq)
204{
205 if (irq >= IRQ_EINT0 && irq <= IRQ_EINT3)
206 return S3C2410_GPF0 + (irq - IRQ_EINT0);
207
208 if (irq >= IRQ_EINT4 && irq <= IRQ_EINT7)
209 return S3C2410_GPF4 + (irq - IRQ_EINT4);
210
211 if (irq >= IRQ_EINT8 && irq <= IRQ_EINT23)
212 return S3C2410_GPG0 + (irq - IRQ_EINT8);
213
214 return -EINVAL;
215}
216
217EXPORT_SYMBOL(s3c2410_gpio_irq2pin);
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index 5c0491bf738b..6d7a961d3269 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/sysdev.h>
18#include <linux/ioport.h> 19#include <linux/ioport.h>
19#include <linux/io.h> 20#include <linux/io.h>
20#include <linux/gpio.h> 21#include <linux/gpio.h>
@@ -22,6 +23,7 @@
22#include <mach/gpio-core.h> 23#include <mach/gpio-core.h>
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <asm/irq.h> 25#include <asm/irq.h>
26#include <plat/pm.h>
25 27
26#include <mach/regs-gpio.h> 28#include <mach/regs-gpio.h>
27 29
@@ -77,9 +79,10 @@ static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset)
77 79
78struct s3c_gpio_chip s3c24xx_gpios[] = { 80struct s3c_gpio_chip s3c24xx_gpios[] = {
79 [0] = { 81 [0] = {
80 .base = S3C24XX_GPIO_BASE(S3C2410_GPA0), 82 .base = S3C2410_GPACON,
83 .pm = __gpio_pm(&s3c_gpio_pm_1bit),
81 .chip = { 84 .chip = {
82 .base = S3C2410_GPA0, 85 .base = S3C2410_GPA(0),
83 .owner = THIS_MODULE, 86 .owner = THIS_MODULE,
84 .label = "GPIOA", 87 .label = "GPIOA",
85 .ngpio = 24, 88 .ngpio = 24,
@@ -88,45 +91,50 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
88 }, 91 },
89 }, 92 },
90 [1] = { 93 [1] = {
91 .base = S3C24XX_GPIO_BASE(S3C2410_GPB0), 94 .base = S3C2410_GPBCON,
95 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
92 .chip = { 96 .chip = {
93 .base = S3C2410_GPB0, 97 .base = S3C2410_GPB(0),
94 .owner = THIS_MODULE, 98 .owner = THIS_MODULE,
95 .label = "GPIOB", 99 .label = "GPIOB",
96 .ngpio = 16, 100 .ngpio = 16,
97 }, 101 },
98 }, 102 },
99 [2] = { 103 [2] = {
100 .base = S3C24XX_GPIO_BASE(S3C2410_GPC0), 104 .base = S3C2410_GPCCON,
105 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
101 .chip = { 106 .chip = {
102 .base = S3C2410_GPC0, 107 .base = S3C2410_GPC(0),
103 .owner = THIS_MODULE, 108 .owner = THIS_MODULE,
104 .label = "GPIOC", 109 .label = "GPIOC",
105 .ngpio = 16, 110 .ngpio = 16,
106 }, 111 },
107 }, 112 },
108 [3] = { 113 [3] = {
109 .base = S3C24XX_GPIO_BASE(S3C2410_GPD0), 114 .base = S3C2410_GPDCON,
115 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
110 .chip = { 116 .chip = {
111 .base = S3C2410_GPD0, 117 .base = S3C2410_GPD(0),
112 .owner = THIS_MODULE, 118 .owner = THIS_MODULE,
113 .label = "GPIOD", 119 .label = "GPIOD",
114 .ngpio = 16, 120 .ngpio = 16,
115 }, 121 },
116 }, 122 },
117 [4] = { 123 [4] = {
118 .base = S3C24XX_GPIO_BASE(S3C2410_GPE0), 124 .base = S3C2410_GPECON,
125 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
119 .chip = { 126 .chip = {
120 .base = S3C2410_GPE0, 127 .base = S3C2410_GPE(0),
121 .label = "GPIOE", 128 .label = "GPIOE",
122 .owner = THIS_MODULE, 129 .owner = THIS_MODULE,
123 .ngpio = 16, 130 .ngpio = 16,
124 }, 131 },
125 }, 132 },
126 [5] = { 133 [5] = {
127 .base = S3C24XX_GPIO_BASE(S3C2410_GPF0), 134 .base = S3C2410_GPFCON,
135 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
128 .chip = { 136 .chip = {
129 .base = S3C2410_GPF0, 137 .base = S3C2410_GPF(0),
130 .owner = THIS_MODULE, 138 .owner = THIS_MODULE,
131 .label = "GPIOF", 139 .label = "GPIOF",
132 .ngpio = 8, 140 .ngpio = 8,
@@ -134,14 +142,24 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
134 }, 142 },
135 }, 143 },
136 [6] = { 144 [6] = {
137 .base = S3C24XX_GPIO_BASE(S3C2410_GPG0), 145 .base = S3C2410_GPGCON,
146 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
138 .chip = { 147 .chip = {
139 .base = S3C2410_GPG0, 148 .base = S3C2410_GPG(0),
140 .owner = THIS_MODULE, 149 .owner = THIS_MODULE,
141 .label = "GPIOG", 150 .label = "GPIOG",
142 .ngpio = 10, 151 .ngpio = 16,
143 .to_irq = s3c24xx_gpiolib_bankg_toirq, 152 .to_irq = s3c24xx_gpiolib_bankg_toirq,
144 }, 153 },
154 }, {
155 .base = S3C2410_GPHCON,
156 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
157 .chip = {
158 .base = S3C2410_GPH(0),
159 .owner = THIS_MODULE,
160 .label = "GPIOH",
161 .ngpio = 11,
162 },
145 }, 163 },
146}; 164};
147 165
@@ -156,4 +174,4 @@ static __init int s3c24xx_gpiolib_init(void)
156 return 0; 174 return 0;
157} 175}
158 176
159arch_initcall(s3c24xx_gpiolib_init); 177core_initcall(s3c24xx_gpiolib_init);
diff --git a/arch/arm/plat-s3c24xx/include/plat/dma.h b/arch/arm/plat-s3c24xx/include/plat/dma-plat.h
index c78efe316fc8..9565ead1bc9b 100644
--- a/arch/arm/plat-s3c24xx/include/plat/dma.h
+++ b/arch/arm/plat-s3c24xx/include/plat/dma-plat.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/dma.h 1/* linux/arch/arm/plat-s3c24xx/include/plat/dma-plat.h
2 * 2 *
3 * Copyright (C) 2006 Simtec Electronics 3 * Copyright (C) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -10,8 +10,10 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <plat/dma-core.h>
14
13extern struct sysdev_class dma_sysclass; 15extern struct sysdev_class dma_sysclass;
14extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS]; 16extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS];
15 17
16#define DMA_CH_VALID (1<<31) 18#define DMA_CH_VALID (1<<31)
17#define DMA_CH_NEVER (1<<30) 19#define DMA_CH_NEVER (1<<30)
@@ -31,8 +33,8 @@ struct s3c24xx_dma_map {
31 const char *name; 33 const char *name;
32 struct s3c24xx_dma_addr hw_addr; 34 struct s3c24xx_dma_addr hw_addr;
33 35
34 unsigned long channels[S3C2410_DMA_CHANNELS]; 36 unsigned long channels[S3C_DMA_CHANNELS];
35 unsigned long channels_rx[S3C2410_DMA_CHANNELS]; 37 unsigned long channels_rx[S3C_DMA_CHANNELS];
36}; 38};
37 39
38struct s3c24xx_dma_selection { 40struct s3c24xx_dma_selection {
@@ -58,7 +60,7 @@ extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);
58*/ 60*/
59 61
60struct s3c24xx_dma_order_ch { 62struct s3c24xx_dma_order_ch {
61 unsigned int list[S3C2410_DMA_CHANNELS]; /* list of channels */ 63 unsigned int list[S3C_DMA_CHANNELS]; /* list of channels */
62 unsigned int flags; /* flags */ 64 unsigned int flags; /* flags */
63}; 65};
64 66
diff --git a/arch/arm/plat-s3c24xx/include/plat/map.h b/arch/arm/plat-s3c24xx/include/plat/map.h
index eed8f78e7593..c4d133436fc7 100644
--- a/arch/arm/plat-s3c24xx/include/plat/map.h
+++ b/arch/arm/plat-s3c24xx/include/plat/map.h
@@ -58,7 +58,6 @@
58#define S3C24XX_SZ_SPI SZ_1M 58#define S3C24XX_SZ_SPI SZ_1M
59#define S3C24XX_SZ_SDI SZ_1M 59#define S3C24XX_SZ_SDI SZ_1M
60#define S3C24XX_SZ_NAND SZ_1M 60#define S3C24XX_SZ_NAND SZ_1M
61#define S3C24XX_SZ_USBHOST SZ_1M
62 61
63/* GPIO ports */ 62/* GPIO ports */
64 63
diff --git a/arch/arm/plat-s3c24xx/include/plat/pm-core.h b/arch/arm/plat-s3c24xx/include/plat/pm-core.h
index c75882113e04..fb45dd9adca5 100644
--- a/arch/arm/plat-s3c24xx/include/plat/pm-core.h
+++ b/arch/arm/plat-s3c24xx/include/plat/pm-core.h
@@ -57,3 +57,8 @@ static inline void s3c_pm_arch_show_resume_irqs(void)
57 s3c_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND), 57 s3c_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND),
58 s3c_irqwake_eintmask); 58 s3c_irqwake_eintmask);
59} 59}
60
61static inline void s3c_pm_arch_update_uart(void __iomem *regs,
62 struct pm_uart_save *save)
63{
64}
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
new file mode 100644
index 000000000000..3bc0a216df97
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
@@ -0,0 +1,145 @@
1/* arch/arm/mach-s3c2410/include/mach/dma.h
2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C24XX DMA support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* DMA Register definitions */
14
15#define S3C2410_DMA_DISRC (0x00)
16#define S3C2410_DMA_DISRCC (0x04)
17#define S3C2410_DMA_DIDST (0x08)
18#define S3C2410_DMA_DIDSTC (0x0C)
19#define S3C2410_DMA_DCON (0x10)
20#define S3C2410_DMA_DSTAT (0x14)
21#define S3C2410_DMA_DCSRC (0x18)
22#define S3C2410_DMA_DCDST (0x1C)
23#define S3C2410_DMA_DMASKTRIG (0x20)
24#define S3C2412_DMA_DMAREQSEL (0x24)
25#define S3C2443_DMA_DMAREQSEL (0x24)
26
27#define S3C2410_DISRCC_INC (1<<0)
28#define S3C2410_DISRCC_APB (1<<1)
29
30#define S3C2410_DMASKTRIG_STOP (1<<2)
31#define S3C2410_DMASKTRIG_ON (1<<1)
32#define S3C2410_DMASKTRIG_SWTRIG (1<<0)
33
34#define S3C2410_DCON_DEMAND (0<<31)
35#define S3C2410_DCON_HANDSHAKE (1<<31)
36#define S3C2410_DCON_SYNC_PCLK (0<<30)
37#define S3C2410_DCON_SYNC_HCLK (1<<30)
38
39#define S3C2410_DCON_INTREQ (1<<29)
40
41#define S3C2410_DCON_CH0_XDREQ0 (0<<24)
42#define S3C2410_DCON_CH0_UART0 (1<<24)
43#define S3C2410_DCON_CH0_SDI (2<<24)
44#define S3C2410_DCON_CH0_TIMER (3<<24)
45#define S3C2410_DCON_CH0_USBEP1 (4<<24)
46
47#define S3C2410_DCON_CH1_XDREQ1 (0<<24)
48#define S3C2410_DCON_CH1_UART1 (1<<24)
49#define S3C2410_DCON_CH1_I2SSDI (2<<24)
50#define S3C2410_DCON_CH1_SPI (3<<24)
51#define S3C2410_DCON_CH1_USBEP2 (4<<24)
52
53#define S3C2410_DCON_CH2_I2SSDO (0<<24)
54#define S3C2410_DCON_CH2_I2SSDI (1<<24)
55#define S3C2410_DCON_CH2_SDI (2<<24)
56#define S3C2410_DCON_CH2_TIMER (3<<24)
57#define S3C2410_DCON_CH2_USBEP3 (4<<24)
58
59#define S3C2410_DCON_CH3_UART2 (0<<24)
60#define S3C2410_DCON_CH3_SDI (1<<24)
61#define S3C2410_DCON_CH3_SPI (2<<24)
62#define S3C2410_DCON_CH3_TIMER (3<<24)
63#define S3C2410_DCON_CH3_USBEP4 (4<<24)
64
65#define S3C2410_DCON_SRCSHIFT (24)
66#define S3C2410_DCON_SRCMASK (7<<24)
67
68#define S3C2410_DCON_BYTE (0<<20)
69#define S3C2410_DCON_HALFWORD (1<<20)
70#define S3C2410_DCON_WORD (2<<20)
71
72#define S3C2410_DCON_AUTORELOAD (0<<22)
73#define S3C2410_DCON_NORELOAD (1<<22)
74#define S3C2410_DCON_HWTRIG (1<<23)
75
76#ifdef CONFIG_CPU_S3C2440
77#define S3C2440_DIDSTC_CHKINT (1<<2)
78
79#define S3C2440_DCON_CH0_I2SSDO (5<<24)
80#define S3C2440_DCON_CH0_PCMIN (6<<24)
81
82#define S3C2440_DCON_CH1_PCMOUT (5<<24)
83#define S3C2440_DCON_CH1_SDI (6<<24)
84
85#define S3C2440_DCON_CH2_PCMIN (5<<24)
86#define S3C2440_DCON_CH2_MICIN (6<<24)
87
88#define S3C2440_DCON_CH3_MICIN (5<<24)
89#define S3C2440_DCON_CH3_PCMOUT (6<<24)
90#endif
91
92#ifdef CONFIG_CPU_S3C2412
93
94#define S3C2412_DMAREQSEL_SRC(x) ((x)<<1)
95
96#define S3C2412_DMAREQSEL_HW (1)
97
98#define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0)
99#define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1)
100#define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2)
101#define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3)
102#define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4)
103#define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5)
104#define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9)
105#define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10)
106#define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13)
107#define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14)
108#define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15)
109#define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16)
110#define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17)
111#define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18)
112#define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19)
113#define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20)
114#define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21)
115#define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22)
116#define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23)
117#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24)
118
119#endif
120
121#define S3C2443_DMAREQSEL_SRC(x) ((x)<<1)
122
123#define S3C2443_DMAREQSEL_HW (1)
124
125#define S3C2443_DMAREQSEL_SPI0TX S3C2443_DMAREQSEL_SRC(0)
126#define S3C2443_DMAREQSEL_SPI0RX S3C2443_DMAREQSEL_SRC(1)
127#define S3C2443_DMAREQSEL_SPI1TX S3C2443_DMAREQSEL_SRC(2)
128#define S3C2443_DMAREQSEL_SPI1RX S3C2443_DMAREQSEL_SRC(3)
129#define S3C2443_DMAREQSEL_I2STX S3C2443_DMAREQSEL_SRC(4)
130#define S3C2443_DMAREQSEL_I2SRX S3C2443_DMAREQSEL_SRC(5)
131#define S3C2443_DMAREQSEL_TIMER S3C2443_DMAREQSEL_SRC(9)
132#define S3C2443_DMAREQSEL_SDI S3C2443_DMAREQSEL_SRC(10)
133#define S3C2443_DMAREQSEL_XDREQ0 S3C2443_DMAREQSEL_SRC(17)
134#define S3C2443_DMAREQSEL_XDREQ1 S3C2443_DMAREQSEL_SRC(18)
135#define S3C2443_DMAREQSEL_UART0_0 S3C2443_DMAREQSEL_SRC(19)
136#define S3C2443_DMAREQSEL_UART0_1 S3C2443_DMAREQSEL_SRC(20)
137#define S3C2443_DMAREQSEL_UART1_0 S3C2443_DMAREQSEL_SRC(21)
138#define S3C2443_DMAREQSEL_UART1_1 S3C2443_DMAREQSEL_SRC(22)
139#define S3C2443_DMAREQSEL_UART2_0 S3C2443_DMAREQSEL_SRC(23)
140#define S3C2443_DMAREQSEL_UART2_1 S3C2443_DMAREQSEL_SRC(24)
141#define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25)
142#define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26)
143#define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27)
144#define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28)
145#define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29)
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index 062a29339a91..56e5253ca02c 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -30,6 +30,7 @@
30#include <linux/suspend.h> 30#include <linux/suspend.h>
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/time.h> 32#include <linux/time.h>
33#include <linux/gpio.h>
33#include <linux/interrupt.h> 34#include <linux/interrupt.h>
34#include <linux/serial_core.h> 35#include <linux/serial_core.h>
35#include <linux/io.h> 36#include <linux/io.h>
@@ -75,43 +76,10 @@ static struct sleep_save core_save[] = {
75 SAVE_ITEM(S3C2410_CLKSLOW), 76 SAVE_ITEM(S3C2410_CLKSLOW),
76}; 77};
77 78
78static struct gpio_sleep {
79 void __iomem *base;
80 unsigned int gpcon;
81 unsigned int gpdat;
82 unsigned int gpup;
83} gpio_save[] = {
84 [0] = {
85 .base = S3C2410_GPACON,
86 },
87 [1] = {
88 .base = S3C2410_GPBCON,
89 },
90 [2] = {
91 .base = S3C2410_GPCCON,
92 },
93 [3] = {
94 .base = S3C2410_GPDCON,
95 },
96 [4] = {
97 .base = S3C2410_GPECON,
98 },
99 [5] = {
100 .base = S3C2410_GPFCON,
101 },
102 [6] = {
103 .base = S3C2410_GPGCON,
104 },
105 [7] = {
106 .base = S3C2410_GPHCON,
107 },
108};
109
110static struct sleep_save misc_save[] = { 79static struct sleep_save misc_save[] = {
111 SAVE_ITEM(S3C2410_DCLKCON), 80 SAVE_ITEM(S3C2410_DCLKCON),
112}; 81};
113 82
114
115/* s3c_pm_check_resume_pin 83/* s3c_pm_check_resume_pin
116 * 84 *
117 * check to see if the pin is configured correctly for sleep mode, and 85 * check to see if the pin is configured correctly for sleep mode, and
@@ -156,195 +124,15 @@ void s3c_pm_configure_extint(void)
156 * and then configure it as an input if it is not 124 * and then configure it as an input if it is not
157 */ 125 */
158 126
159 for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) { 127 for (pin = S3C2410_GPF(0); pin <= S3C2410_GPF(7); pin++) {
160 s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF0); 128 s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF(0));
161 }
162
163 for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) {
164 s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8);
165 } 129 }
166}
167
168/* offsets for CON/DAT/UP registers */
169
170#define OFFS_CON (S3C2410_GPACON - S3C2410_GPACON)
171#define OFFS_DAT (S3C2410_GPADAT - S3C2410_GPACON)
172#define OFFS_UP (S3C2410_GPBUP - S3C2410_GPBCON)
173
174/* s3c_pm_save_gpios()
175 *
176 * Save the state of the GPIOs
177 */
178
179void s3c_pm_save_gpios(void)
180{
181 struct gpio_sleep *gps = gpio_save;
182 unsigned int gpio;
183
184 for (gpio = 0; gpio < ARRAY_SIZE(gpio_save); gpio++, gps++) {
185 void __iomem *base = gps->base;
186
187 gps->gpcon = __raw_readl(base + OFFS_CON);
188 gps->gpdat = __raw_readl(base + OFFS_DAT);
189
190 if (gpio > 0)
191 gps->gpup = __raw_readl(base + OFFS_UP);
192 130
131 for (pin = S3C2410_GPG(0); pin <= S3C2410_GPG(7); pin++) {
132 s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG(0))+8);
193 } 133 }
194} 134}
195 135
196/* Test whether the given masked+shifted bits of an GPIO configuration
197 * are one of the SFN (special function) modes. */
198
199static inline int is_sfn(unsigned long con)
200{
201 return (con == 2 || con == 3);
202}
203
204/* Test if the given masked+shifted GPIO configuration is an input */
205
206static inline int is_in(unsigned long con)
207{
208 return con == 0;
209}
210
211/* Test if the given masked+shifted GPIO configuration is an output */
212
213static inline int is_out(unsigned long con)
214{
215 return con == 1;
216}
217
218/**
219 * s3c2410_pm_restore_gpio() - restore the given GPIO bank
220 * @index: The number of the GPIO bank being resumed.
221 * @gps: The sleep confgiuration for the bank.
222 *
223 * Restore one of the GPIO banks that was saved during suspend. This is
224 * not as simple as once thought, due to the possibility of glitches
225 * from the order that the CON and DAT registers are set in.
226 *
227 * The three states the pin can be are {IN,OUT,SFN} which gives us 9
228 * combinations of changes to check. Three of these, if the pin stays
229 * in the same configuration can be discounted. This leaves us with
230 * the following:
231 *
232 * { IN => OUT } Change DAT first
233 * { IN => SFN } Change CON first
234 * { OUT => SFN } Change CON first, so new data will not glitch
235 * { OUT => IN } Change CON first, so new data will not glitch
236 * { SFN => IN } Change CON first
237 * { SFN => OUT } Change DAT first, so new data will not glitch [1]
238 *
239 * We do not currently deal with the UP registers as these control
240 * weak resistors, so a small delay in change should not need to bring
241 * these into the calculations.
242 *
243 * [1] this assumes that writing to a pin DAT whilst in SFN will set the
244 * state for when it is next output.
245 */
246
247static void s3c2410_pm_restore_gpio(int index, struct gpio_sleep *gps)
248{
249 void __iomem *base = gps->base;
250 unsigned long gps_gpcon = gps->gpcon;
251 unsigned long gps_gpdat = gps->gpdat;
252 unsigned long old_gpcon;
253 unsigned long old_gpdat;
254 unsigned long old_gpup = 0x0;
255 unsigned long gpcon;
256 int nr;
257
258 old_gpcon = __raw_readl(base + OFFS_CON);
259 old_gpdat = __raw_readl(base + OFFS_DAT);
260
261 if (base == S3C2410_GPACON) {
262 /* GPACON only has one bit per control / data and no PULLUPs.
263 * GPACON[x] = 0 => Output, 1 => SFN */
264
265 /* first set all SFN bits to SFN */
266
267 gpcon = old_gpcon | gps->gpcon;
268 __raw_writel(gpcon, base + OFFS_CON);
269
270 /* now set all the other bits */
271
272 __raw_writel(gps_gpdat, base + OFFS_DAT);
273 __raw_writel(gps_gpcon, base + OFFS_CON);
274 } else {
275 unsigned long old, new, mask;
276 unsigned long change_mask = 0x0;
277
278 old_gpup = __raw_readl(base + OFFS_UP);
279
280 /* Create a change_mask of all the items that need to have
281 * their CON value changed before their DAT value, so that
282 * we minimise the work between the two settings.
283 */
284
285 for (nr = 0, mask = 0x03; nr < 32; nr += 2, mask <<= 2) {
286 old = (old_gpcon & mask) >> nr;
287 new = (gps_gpcon & mask) >> nr;
288
289 /* If there is no change, then skip */
290
291 if (old == new)
292 continue;
293
294 /* If both are special function, then skip */
295
296 if (is_sfn(old) && is_sfn(new))
297 continue;
298
299 /* Change is IN => OUT, do not change now */
300
301 if (is_in(old) && is_out(new))
302 continue;
303
304 /* Change is SFN => OUT, do not change now */
305
306 if (is_sfn(old) && is_out(new))
307 continue;
308
309 /* We should now be at the case of IN=>SFN,
310 * OUT=>SFN, OUT=>IN, SFN=>IN. */
311
312 change_mask |= mask;
313 }
314
315 /* Write the new CON settings */
316
317 gpcon = old_gpcon & ~change_mask;
318 gpcon |= gps_gpcon & change_mask;
319
320 __raw_writel(gpcon, base + OFFS_CON);
321
322 /* Now change any items that require DAT,CON */
323
324 __raw_writel(gps_gpdat, base + OFFS_DAT);
325 __raw_writel(gps_gpcon, base + OFFS_CON);
326 __raw_writel(gps->gpup, base + OFFS_UP);
327 }
328
329 S3C_PMDBG("GPIO[%d] CON %08lx => %08lx, DAT %08lx => %08lx\n",
330 index, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat);
331}
332
333
334/** s3c2410_pm_restore_gpios()
335 *
336 * Restore the state of the GPIOs
337 */
338
339void s3c_pm_restore_gpios(void)
340{
341 struct gpio_sleep *gps = gpio_save;
342 int gpio;
343
344 for (gpio = 0; gpio < ARRAY_SIZE(gpio_save); gpio++, gps++) {
345 s3c2410_pm_restore_gpio(gpio, gps);
346 }
347}
348 136
349void s3c_pm_restore_core(void) 137void s3c_pm_restore_core(void)
350{ 138{
diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c
index d62b7e7fb355..71a6accf114e 100644
--- a/arch/arm/plat-s3c24xx/setup-i2c.c
+++ b/arch/arm/plat-s3c24xx/setup-i2c.c
@@ -11,6 +11,7 @@
11*/ 11*/
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/gpio.h>
14 15
15struct platform_device; 16struct platform_device;
16 17
@@ -20,6 +21,6 @@ struct platform_device;
20 21
21void s3c_i2c0_cfg_gpio(struct platform_device *dev) 22void s3c_i2c0_cfg_gpio(struct platform_device *dev)
22{ 23{
23 s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA); 24 s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA);
24 s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL); 25 s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL);
25} 26}
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
index 8b403cbb53d2..9edf7894eedd 100644
--- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
+++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
@@ -22,16 +22,16 @@ void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi,
22 int enable) 22 int enable)
23{ 23{
24 if (enable) { 24 if (enable) {
25 s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPE13_SPICLK0); 25 s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0);
26 s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPE12_SPIMOSI0); 26 s3c2410_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0);
27 s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPE11_SPIMISO0); 27 s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0);
28 s3c2410_gpio_pullup(S3C2410_GPE11, 0); 28 s3c2410_gpio_pullup(S3C2410_GPE(11), 0);
29 s3c2410_gpio_pullup(S3C2410_GPE13, 0); 29 s3c2410_gpio_pullup(S3C2410_GPE(13), 0);
30 } else { 30 } else {
31 s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPIO_INPUT); 31 s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT);
32 s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPIO_INPUT); 32 s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT);
33 s3c2410_gpio_pullup(S3C2410_GPE11, 1); 33 s3c2410_gpio_pullup(S3C2410_GPE(11), 1);
34 s3c2410_gpio_pullup(S3C2410_GPE12, 1); 34 s3c2410_gpio_pullup(S3C2410_GPE(12), 1);
35 s3c2410_gpio_pullup(S3C2410_GPE13, 1); 35 s3c2410_gpio_pullup(S3C2410_GPE(13), 1);
36 } 36 }
37} 37}
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
index 8fccd4e549f0..f34d0fc69ad8 100644
--- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
+++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
@@ -22,16 +22,16 @@ void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi,
22 int enable) 22 int enable)
23{ 23{
24 if (enable) { 24 if (enable) {
25 s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_SPICLK1); 25 s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1);
26 s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_SPIMOSI1); 26 s3c2410_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1);
27 s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_SPIMISO1); 27 s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1);
28 s3c2410_gpio_pullup(S3C2410_GPG5, 0); 28 s3c2410_gpio_pullup(S3C2410_GPG(5), 0);
29 s3c2410_gpio_pullup(S3C2410_GPG6, 0); 29 s3c2410_gpio_pullup(S3C2410_GPG(6), 0);
30 } else { 30 } else {
31 s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPIO_INPUT); 31 s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT);
32 s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPIO_INPUT); 32 s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT);
33 s3c2410_gpio_pullup(S3C2410_GPG5, 1); 33 s3c2410_gpio_pullup(S3C2410_GPG(5), 1);
34 s3c2410_gpio_pullup(S3C2410_GPG6, 1); 34 s3c2410_gpio_pullup(S3C2410_GPG(6), 1);
35 s3c2410_gpio_pullup(S3C2410_GPG7, 1); 35 s3c2410_gpio_pullup(S3C2410_GPG(7), 1);
36 } 36 }
37} 37}
diff --git a/arch/arm/plat-s3c64xx/Kconfig b/arch/arm/plat-s3c64xx/Kconfig
index 54375a00a7d2..5ebd8b425a54 100644
--- a/arch/arm/plat-s3c64xx/Kconfig
+++ b/arch/arm/plat-s3c64xx/Kconfig
@@ -19,6 +19,7 @@ config PLAT_S3C64XX
19 select S3C_GPIO_PULL_UPDOWN 19 select S3C_GPIO_PULL_UPDOWN
20 select S3C_GPIO_CFG_S3C24XX 20 select S3C_GPIO_CFG_S3C24XX
21 select S3C_GPIO_CFG_S3C64XX 21 select S3C_GPIO_CFG_S3C64XX
22 select USB_ARCH_HAS_OHCI
22 help 23 help
23 Base platform code for any Samsung S3C64XX device 24 Base platform code for any Samsung S3C64XX device
24 25
@@ -38,6 +39,10 @@ config CPU_S3C6400_CLOCK
38 Common clock support code for the S3C6400 that is shared 39 Common clock support code for the S3C6400 that is shared
39 by other CPUs in the series, such as the S3C6410. 40 by other CPUs in the series, such as the S3C6410.
40 41
42config S3C64XX_DMA
43 bool "S3C64XX DMA"
44 select S3C_DMA
45
41# platform specific device setup 46# platform specific device setup
42 47
43config S3C64XX_SETUP_I2C0 48config S3C64XX_SETUP_I2C0
@@ -59,4 +64,9 @@ config S3C64XX_SETUP_FB_24BPP
59 help 64 help
60 Common setup code for S3C64XX with an 24bpp RGB display helper. 65 Common setup code for S3C64XX with an 24bpp RGB display helper.
61 66
67config S3C64XX_SETUP_SDHCI_GPIO
68 bool
69 help
70 Common setup code for S3C64XX SDHCI GPIO configurations
71
62endif 72endif
diff --git a/arch/arm/plat-s3c64xx/Makefile b/arch/arm/plat-s3c64xx/Makefile
index 2e6d79bf8f33..2ed5df34f9ea 100644
--- a/arch/arm/plat-s3c64xx/Makefile
+++ b/arch/arm/plat-s3c64xx/Makefile
@@ -24,8 +24,19 @@ obj-y += gpiolib.o
24obj-$(CONFIG_CPU_S3C6400_INIT) += s3c6400-init.o 24obj-$(CONFIG_CPU_S3C6400_INIT) += s3c6400-init.o
25obj-$(CONFIG_CPU_S3C6400_CLOCK) += s3c6400-clock.o 25obj-$(CONFIG_CPU_S3C6400_CLOCK) += s3c6400-clock.o
26 26
27# PM support
28
29obj-$(CONFIG_PM) += pm.o
30obj-$(CONFIG_PM) += sleep.o
31obj-$(CONFIG_PM) += irq-pm.o
32
33# DMA support
34
35obj-$(CONFIG_S3C64XX_DMA) += dma.o
36
27# Device setup 37# Device setup
28 38
29obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o 39obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
30obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o 40obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
31obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o 41obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
42obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o \ No newline at end of file
diff --git a/arch/arm/plat-s3c64xx/clock.c b/arch/arm/plat-s3c64xx/clock.c
index ad1b9682c9c3..0bc2fa1dfc40 100644
--- a/arch/arm/plat-s3c64xx/clock.c
+++ b/arch/arm/plat-s3c64xx/clock.c
@@ -27,6 +27,12 @@
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/clock.h> 28#include <plat/clock.h>
29 29
30struct clk clk_h2 = {
31 .name = "hclk2",
32 .id = -1,
33 .rate = 0,
34};
35
30struct clk clk_27m = { 36struct clk clk_27m = {
31 .name = "clk_27m", 37 .name = "clk_27m",
32 .id = -1, 38 .id = -1,
@@ -152,6 +158,18 @@ static struct clk init_clocks_disable[] = {
152 .parent = &clk_48m, 158 .parent = &clk_48m,
153 .enable = s3c64xx_sclk_ctrl, 159 .enable = s3c64xx_sclk_ctrl,
154 .ctrlbit = S3C_CLKCON_SCLK_MMC2_48, 160 .ctrlbit = S3C_CLKCON_SCLK_MMC2_48,
161 }, {
162 .name = "dma0",
163 .id = -1,
164 .parent = &clk_h,
165 .enable = s3c64xx_hclk_ctrl,
166 .ctrlbit = S3C_CLKCON_HCLK_DMA0,
167 }, {
168 .name = "dma1",
169 .id = -1,
170 .parent = &clk_h,
171 .enable = s3c64xx_hclk_ctrl,
172 .ctrlbit = S3C_CLKCON_HCLK_DMA1,
155 }, 173 },
156}; 174};
157 175
@@ -246,6 +264,7 @@ static struct clk *clks[] __initdata = {
246 &clk_epll, 264 &clk_epll,
247 &clk_27m, 265 &clk_27m,
248 &clk_48m, 266 &clk_48m,
267 &clk_h2,
249}; 268};
250 269
251void __init s3c64xx_register_clocks(void) 270void __init s3c64xx_register_clocks(void)
diff --git a/arch/arm/plat-s3c64xx/cpu.c b/arch/arm/plat-s3c64xx/cpu.c
index 91f49a3a665d..b1fdd83940a6 100644
--- a/arch/arm/plat-s3c64xx/cpu.c
+++ b/arch/arm/plat-s3c64xx/cpu.c
@@ -16,6 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/sysdev.h>
19#include <linux/serial_core.h> 20#include <linux/serial_core.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/io.h> 22#include <linux/io.h>
@@ -101,9 +102,24 @@ static struct map_desc s3c_iodesc[] __initdata = {
101 .pfn = __phys_to_pfn(S3C64XX_PA_MODEM), 102 .pfn = __phys_to_pfn(S3C64XX_PA_MODEM),
102 .length = SZ_4K, 103 .length = SZ_4K,
103 .type = MT_DEVICE, 104 .type = MT_DEVICE,
105 }, {
106 .virtual = (unsigned long)S3C_VA_WATCHDOG,
107 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG),
108 .length = SZ_4K,
109 .type = MT_DEVICE,
104 }, 110 },
105}; 111};
106 112
113
114struct sysdev_class s3c64xx_sysclass = {
115 .name = "s3c64xx-core",
116};
117
118static struct sys_device s3c64xx_sysdev = {
119 .cls = &s3c64xx_sysclass,
120};
121
122
107/* read cpu identification code */ 123/* read cpu identification code */
108 124
109void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) 125void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
@@ -115,5 +131,21 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
115 iotable_init(mach_desc, size); 131 iotable_init(mach_desc, size);
116 132
117 idcode = __raw_readl(S3C_VA_SYS + 0x118); 133 idcode = __raw_readl(S3C_VA_SYS + 0x118);
134 if (!idcode) {
135 /* S3C6400 has the ID register in a different place,
136 * and needs a write before it can be read. */
137
138 __raw_writel(0x0, S3C_VA_SYS + 0xA1C);
139 idcode = __raw_readl(S3C_VA_SYS + 0xA1C);
140 }
141
118 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); 142 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
119} 143}
144
145static __init int s3c64xx_sysdev_init(void)
146{
147 sysdev_class_register(&s3c64xx_sysclass);
148 return sysdev_register(&s3c64xx_sysdev);
149}
150
151core_initcall(s3c64xx_sysdev_init);
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c
new file mode 100644
index 000000000000..67aa93dbb69e
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/dma.c
@@ -0,0 +1,722 @@
1/* linux/arch/arm/plat-s3c64xx/dma.c
2 *
3 * Copyright 2009 Openmoko, Inc.
4 * Copyright 2009 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX DMA core
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/dmapool.h>
19#include <linux/sysdev.h>
20#include <linux/errno.h>
21#include <linux/delay.h>
22#include <linux/clk.h>
23#include <linux/err.h>
24#include <linux/io.h>
25
26#include <mach/dma.h>
27#include <mach/map.h>
28#include <mach/irqs.h>
29
30#include <plat/dma-plat.h>
31#include <plat/regs-sys.h>
32
33#include <asm/hardware/pl080.h>
34
35/* dma channel state information */
36
37struct s3c64xx_dmac {
38 struct sys_device sysdev;
39 struct clk *clk;
40 void __iomem *regs;
41 struct s3c2410_dma_chan *channels;
42 enum dma_ch chanbase;
43};
44
45/* pool to provide LLI buffers */
46static struct dma_pool *dma_pool;
47
48/* Debug configuration and code */
49
50static unsigned char debug_show_buffs = 0;
51
52static void dbg_showchan(struct s3c2410_dma_chan *chan)
53{
54 pr_debug("DMA%d: %08x->%08x L %08x C %08x,%08x S %08x\n",
55 chan->number,
56 readl(chan->regs + PL080_CH_SRC_ADDR),
57 readl(chan->regs + PL080_CH_DST_ADDR),
58 readl(chan->regs + PL080_CH_LLI),
59 readl(chan->regs + PL080_CH_CONTROL),
60 readl(chan->regs + PL080S_CH_CONTROL2),
61 readl(chan->regs + PL080S_CH_CONFIG));
62}
63
64static void show_lli(struct pl080s_lli *lli)
65{
66 pr_debug("LLI[%p] %08x->%08x, NL %08x C %08x,%08x\n",
67 lli, lli->src_addr, lli->dst_addr, lli->next_lli,
68 lli->control0, lli->control1);
69}
70
71static void dbg_showbuffs(struct s3c2410_dma_chan *chan)
72{
73 struct s3c64xx_dma_buff *ptr;
74 struct s3c64xx_dma_buff *end;
75
76 pr_debug("DMA%d: buffs next %p, curr %p, end %p\n",
77 chan->number, chan->next, chan->curr, chan->end);
78
79 ptr = chan->next;
80 end = chan->end;
81
82 if (debug_show_buffs) {
83 for (; ptr != NULL; ptr = ptr->next) {
84 pr_debug("DMA%d: %08x ",
85 chan->number, ptr->lli_dma);
86 show_lli(ptr->lli);
87 }
88 }
89}
90
91/* End of Debug */
92
93static struct s3c2410_dma_chan *s3c64xx_dma_map_channel(unsigned int channel)
94{
95 struct s3c2410_dma_chan *chan;
96 unsigned int start, offs;
97
98 start = 0;
99
100 if (channel >= DMACH_PCM1_TX)
101 start = 8;
102
103 for (offs = 0; offs < 8; offs++) {
104 chan = &s3c2410_chans[start + offs];
105 if (!chan->in_use)
106 goto found;
107 }
108
109 return NULL;
110
111found:
112 s3c_dma_chan_map[channel] = chan;
113 return chan;
114}
115
116int s3c2410_dma_config(unsigned int channel, int xferunit)
117{
118 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
119
120 if (chan == NULL)
121 return -EINVAL;
122
123 switch (xferunit) {
124 case 1:
125 chan->hw_width = 0;
126 break;
127 case 2:
128 chan->hw_width = 1;
129 break;
130 case 4:
131 chan->hw_width = 2;
132 break;
133 default:
134 printk(KERN_ERR "%s: illegal width %d\n", __func__, xferunit);
135 return -EINVAL;
136 }
137
138 return 0;
139}
140EXPORT_SYMBOL(s3c2410_dma_config);
141
142static void s3c64xx_dma_fill_lli(struct s3c2410_dma_chan *chan,
143 struct pl080s_lli *lli,
144 dma_addr_t data, int size)
145{
146 dma_addr_t src, dst;
147 u32 control0, control1;
148
149 switch (chan->source) {
150 case S3C2410_DMASRC_HW:
151 src = chan->dev_addr;
152 dst = data;
153 control0 = PL080_CONTROL_SRC_AHB2;
154 control0 |= (u32)chan->hw_width << PL080_CONTROL_SWIDTH_SHIFT;
155 control0 |= 2 << PL080_CONTROL_DWIDTH_SHIFT;
156 control0 |= PL080_CONTROL_DST_INCR;
157 break;
158
159 case S3C2410_DMASRC_MEM:
160 src = data;
161 dst = chan->dev_addr;
162 control0 = PL080_CONTROL_DST_AHB2;
163 control0 |= (u32)chan->hw_width << PL080_CONTROL_DWIDTH_SHIFT;
164 control0 |= 2 << PL080_CONTROL_SWIDTH_SHIFT;
165 control0 |= PL080_CONTROL_SRC_INCR;
166 break;
167 default:
168 BUG();
169 }
170
171 /* note, we do not currently setup any of the burst controls */
172
173 control1 = size >> chan->hw_width; /* size in no of xfers */
174 control0 |= PL080_CONTROL_PROT_SYS; /* always in priv. mode */
175 control0 |= PL080_CONTROL_TC_IRQ_EN; /* always fire IRQ */
176
177 lli->src_addr = src;
178 lli->dst_addr = dst;
179 lli->next_lli = 0;
180 lli->control0 = control0;
181 lli->control1 = control1;
182}
183
184static void s3c64xx_lli_to_regs(struct s3c2410_dma_chan *chan,
185 struct pl080s_lli *lli)
186{
187 void __iomem *regs = chan->regs;
188
189 pr_debug("%s: LLI %p => regs\n", __func__, lli);
190 show_lli(lli);
191
192 writel(lli->src_addr, regs + PL080_CH_SRC_ADDR);
193 writel(lli->dst_addr, regs + PL080_CH_DST_ADDR);
194 writel(lli->next_lli, regs + PL080_CH_LLI);
195 writel(lli->control0, regs + PL080_CH_CONTROL);
196 writel(lli->control1, regs + PL080S_CH_CONTROL2);
197}
198
199static int s3c64xx_dma_start(struct s3c2410_dma_chan *chan)
200{
201 struct s3c64xx_dmac *dmac = chan->dmac;
202 u32 config;
203 u32 bit = chan->bit;
204
205 dbg_showchan(chan);
206
207 pr_debug("%s: clearing interrupts\n", __func__);
208
209 /* clear interrupts */
210 writel(bit, dmac->regs + PL080_TC_CLEAR);
211 writel(bit, dmac->regs + PL080_ERR_CLEAR);
212
213 pr_debug("%s: starting channel\n", __func__);
214
215 config = readl(chan->regs + PL080S_CH_CONFIG);
216 config |= PL080_CONFIG_ENABLE;
217
218 pr_debug("%s: writing config %08x\n", __func__, config);
219 writel(config, chan->regs + PL080S_CH_CONFIG);
220
221 return 0;
222}
223
224static int s3c64xx_dma_stop(struct s3c2410_dma_chan *chan)
225{
226 u32 config;
227 int timeout;
228
229 pr_debug("%s: stopping channel\n", __func__);
230
231 dbg_showchan(chan);
232
233 config = readl(chan->regs + PL080S_CH_CONFIG);
234 config |= PL080_CONFIG_HALT;
235 writel(config, chan->regs + PL080S_CH_CONFIG);
236
237 timeout = 1000;
238 do {
239 config = readl(chan->regs + PL080S_CH_CONFIG);
240 pr_debug("%s: %d - config %08x\n", __func__, timeout, config);
241 if (config & PL080_CONFIG_ACTIVE)
242 udelay(10);
243 else
244 break;
245 } while (--timeout > 0);
246
247 if (config & PL080_CONFIG_ACTIVE) {
248 printk(KERN_ERR "%s: channel still active\n", __func__);
249 return -EFAULT;
250 }
251
252 config = readl(chan->regs + PL080S_CH_CONFIG);
253 config &= ~PL080_CONFIG_ENABLE;
254 writel(config, chan->regs + PL080S_CH_CONFIG);
255
256 return 0;
257}
258
259static inline void s3c64xx_dma_bufffdone(struct s3c2410_dma_chan *chan,
260 struct s3c64xx_dma_buff *buf,
261 enum s3c2410_dma_buffresult result)
262{
263 if (chan->callback_fn != NULL)
264 (chan->callback_fn)(chan, buf->pw, 0, result);
265}
266
267static void s3c64xx_dma_freebuff(struct s3c64xx_dma_buff *buff)
268{
269 dma_pool_free(dma_pool, buff->lli, buff->lli_dma);
270 kfree(buff);
271}
272
273static int s3c64xx_dma_flush(struct s3c2410_dma_chan *chan)
274{
275 struct s3c64xx_dma_buff *buff, *next;
276 u32 config;
277
278 dbg_showchan(chan);
279
280 pr_debug("%s: flushing channel\n", __func__);
281
282 config = readl(chan->regs + PL080S_CH_CONFIG);
283 config &= ~PL080_CONFIG_ENABLE;
284 writel(config, chan->regs + PL080S_CH_CONFIG);
285
286 /* dump all the buffers associated with this channel */
287
288 for (buff = chan->curr; buff != NULL; buff = next) {
289 next = buff->next;
290 pr_debug("%s: buff %p (next %p)\n", __func__, buff, buff->next);
291
292 s3c64xx_dma_bufffdone(chan, buff, S3C2410_RES_ABORT);
293 s3c64xx_dma_freebuff(buff);
294 }
295
296 chan->curr = chan->next = chan->end = NULL;
297
298 return 0;
299}
300
301int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op)
302{
303 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
304
305 WARN_ON(!chan);
306 if (!chan)
307 return -EINVAL;
308
309 switch (op) {
310 case S3C2410_DMAOP_START:
311 return s3c64xx_dma_start(chan);
312
313 case S3C2410_DMAOP_STOP:
314 return s3c64xx_dma_stop(chan);
315
316 case S3C2410_DMAOP_FLUSH:
317 return s3c64xx_dma_flush(chan);
318
319 /* belive PAUSE/RESUME are no-ops */
320 case S3C2410_DMAOP_PAUSE:
321 case S3C2410_DMAOP_RESUME:
322 case S3C2410_DMAOP_STARTED:
323 case S3C2410_DMAOP_TIMEOUT:
324 return 0;
325 }
326
327 return -ENOENT;
328}
329EXPORT_SYMBOL(s3c2410_dma_ctrl);
330
331/* s3c2410_dma_enque
332 *
333 */
334
335int s3c2410_dma_enqueue(unsigned int channel, void *id,
336 dma_addr_t data, int size)
337{
338 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
339 struct s3c64xx_dma_buff *next;
340 struct s3c64xx_dma_buff *buff;
341 struct pl080s_lli *lli;
342 int ret;
343
344 WARN_ON(!chan);
345 if (!chan)
346 return -EINVAL;
347
348 buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL);
349 if (!buff) {
350 printk(KERN_ERR "%s: no memory for buffer\n", __func__);
351 return -ENOMEM;
352 }
353
354 lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma);
355 if (!lli) {
356 printk(KERN_ERR "%s: no memory for lli\n", __func__);
357 ret = -ENOMEM;
358 goto err_buff;
359 }
360
361 pr_debug("%s: buff %p, dp %08x lli (%p, %08x) %d\n",
362 __func__, buff, data, lli, (u32)buff->lli_dma, size);
363
364 buff->lli = lli;
365 buff->pw = id;
366
367 s3c64xx_dma_fill_lli(chan, lli, data, size);
368
369 if ((next = chan->next) != NULL) {
370 struct s3c64xx_dma_buff *end = chan->end;
371 struct pl080s_lli *endlli = end->lli;
372
373 pr_debug("enquing onto channel\n");
374
375 end->next = buff;
376 endlli->next_lli = buff->lli_dma;
377
378 if (chan->flags & S3C2410_DMAF_CIRCULAR) {
379 struct s3c64xx_dma_buff *curr = chan->curr;
380 lli->next_lli = curr->lli_dma;
381 }
382
383 if (next == chan->curr) {
384 writel(buff->lli_dma, chan->regs + PL080_CH_LLI);
385 chan->next = buff;
386 }
387
388 show_lli(endlli);
389 chan->end = buff;
390 } else {
391 pr_debug("enquing onto empty channel\n");
392
393 chan->curr = buff;
394 chan->next = buff;
395 chan->end = buff;
396
397 s3c64xx_lli_to_regs(chan, lli);
398 }
399
400 show_lli(lli);
401
402 dbg_showchan(chan);
403 dbg_showbuffs(chan);
404 return 0;
405
406err_buff:
407 kfree(buff);
408 return ret;
409}
410
411EXPORT_SYMBOL(s3c2410_dma_enqueue);
412
413
414int s3c2410_dma_devconfig(int channel,
415 enum s3c2410_dmasrc source,
416 unsigned long devaddr)
417{
418 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
419 u32 peripheral;
420 u32 config = 0;
421
422 pr_debug("%s: channel %d, source %d, dev %08lx, chan %p\n",
423 __func__, channel, source, devaddr, chan);
424
425 WARN_ON(!chan);
426 if (!chan)
427 return -EINVAL;
428
429 peripheral = (chan->peripheral & 0xf);
430 chan->source = source;
431 chan->dev_addr = devaddr;
432
433 pr_debug("%s: peripheral %d\n", __func__, peripheral);
434
435 switch (source) {
436 case S3C2410_DMASRC_HW:
437 config = 2 << PL080_CONFIG_FLOW_CONTROL_SHIFT;
438 config |= peripheral << PL080_CONFIG_SRC_SEL_SHIFT;
439 break;
440 case S3C2410_DMASRC_MEM:
441 config = 1 << PL080_CONFIG_FLOW_CONTROL_SHIFT;
442 config |= peripheral << PL080_CONFIG_DST_SEL_SHIFT;
443 break;
444 default:
445 printk(KERN_ERR "%s: bad source\n", __func__);
446 return -EINVAL;
447 }
448
449 /* allow TC and ERR interrupts */
450 config |= PL080_CONFIG_TC_IRQ_MASK;
451 config |= PL080_CONFIG_ERR_IRQ_MASK;
452
453 pr_debug("%s: config %08x\n", __func__, config);
454
455 writel(config, chan->regs + PL080S_CH_CONFIG);
456
457 return 0;
458}
459EXPORT_SYMBOL(s3c2410_dma_devconfig);
460
461
462int s3c2410_dma_getposition(unsigned int channel,
463 dma_addr_t *src, dma_addr_t *dst)
464{
465 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
466
467 WARN_ON(!chan);
468 if (!chan)
469 return -EINVAL;
470
471 if (src != NULL)
472 *src = readl(chan->regs + PL080_CH_SRC_ADDR);
473
474 if (dst != NULL)
475 *dst = readl(chan->regs + PL080_CH_DST_ADDR);
476
477 return 0;
478}
479EXPORT_SYMBOL(s3c2410_dma_getposition);
480
481/* s3c2410_request_dma
482 *
483 * get control of an dma channel
484*/
485
486int s3c2410_dma_request(unsigned int channel,
487 struct s3c2410_dma_client *client,
488 void *dev)
489{
490 struct s3c2410_dma_chan *chan;
491 unsigned long flags;
492
493 pr_debug("dma%d: s3c2410_request_dma: client=%s, dev=%p\n",
494 channel, client->name, dev);
495
496 local_irq_save(flags);
497
498 chan = s3c64xx_dma_map_channel(channel);
499 if (chan == NULL) {
500 local_irq_restore(flags);
501 return -EBUSY;
502 }
503
504 dbg_showchan(chan);
505
506 chan->client = client;
507 chan->in_use = 1;
508 chan->peripheral = channel;
509
510 local_irq_restore(flags);
511
512 /* need to setup */
513
514 pr_debug("%s: channel initialised, %p\n", __func__, chan);
515
516 return chan->number | DMACH_LOW_LEVEL;
517}
518
519EXPORT_SYMBOL(s3c2410_dma_request);
520
521/* s3c2410_dma_free
522 *
523 * release the given channel back to the system, will stop and flush
524 * any outstanding transfers, and ensure the channel is ready for the
525 * next claimant.
526 *
527 * Note, although a warning is currently printed if the freeing client
528 * info is not the same as the registrant's client info, the free is still
529 * allowed to go through.
530*/
531
532int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
533{
534 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
535 unsigned long flags;
536
537 if (chan == NULL)
538 return -EINVAL;
539
540 local_irq_save(flags);
541
542 if (chan->client != client) {
543 printk(KERN_WARNING "dma%d: possible free from different client (channel %p, passed %p)\n",
544 channel, chan->client, client);
545 }
546
547 /* sort out stopping and freeing the channel */
548
549
550 chan->client = NULL;
551 chan->in_use = 0;
552
553 if (!(channel & DMACH_LOW_LEVEL))
554 s3c_dma_chan_map[channel] = NULL;
555
556 local_irq_restore(flags);
557
558 return 0;
559}
560
561EXPORT_SYMBOL(s3c2410_dma_free);
562
563
564static void s3c64xx_dma_tcirq(struct s3c64xx_dmac *dmac, int offs)
565{
566 struct s3c2410_dma_chan *chan = dmac->channels + offs;
567
568 /* note, we currently do not bother to work out which buffer
569 * or buffers have been completed since the last tc-irq. */
570
571 if (chan->callback_fn)
572 (chan->callback_fn)(chan, chan->curr->pw, 0, S3C2410_RES_OK);
573}
574
575static void s3c64xx_dma_errirq(struct s3c64xx_dmac *dmac, int offs)
576{
577 printk(KERN_DEBUG "%s: offs %d\n", __func__, offs);
578}
579
580static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
581{
582 struct s3c64xx_dmac *dmac = pw;
583 u32 tcstat, errstat;
584 u32 bit;
585 int offs;
586
587 tcstat = readl(dmac->regs + PL080_TC_STATUS);
588 errstat = readl(dmac->regs + PL080_ERR_STATUS);
589
590 for (offs = 0, bit = 1; offs < 8; offs++, bit <<= 1) {
591 if (tcstat & bit) {
592 writel(bit, dmac->regs + PL080_TC_CLEAR);
593 s3c64xx_dma_tcirq(dmac, offs);
594 }
595
596 if (errstat & bit) {
597 s3c64xx_dma_errirq(dmac, offs);
598 writel(bit, dmac->regs + PL080_ERR_CLEAR);
599 }
600 }
601
602 return IRQ_HANDLED;
603}
604
605static struct sysdev_class dma_sysclass = {
606 .name = "s3c64xx-dma",
607};
608
609static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
610 int irq, unsigned int base)
611{
612 struct s3c2410_dma_chan *chptr = &s3c2410_chans[chno];
613 struct s3c64xx_dmac *dmac;
614 char clkname[16];
615 void __iomem *regs;
616 void __iomem *regptr;
617 int err, ch;
618
619 dmac = kzalloc(sizeof(struct s3c64xx_dmac), GFP_KERNEL);
620 if (!dmac) {
621 printk(KERN_ERR "%s: failed to alloc mem\n", __func__);
622 return -ENOMEM;
623 }
624
625 dmac->sysdev.id = chno / 8;
626 dmac->sysdev.cls = &dma_sysclass;
627
628 err = sysdev_register(&dmac->sysdev);
629 if (err) {
630 printk(KERN_ERR "%s: failed to register sysdevice\n", __func__);
631 goto err_alloc;
632 }
633
634 regs = ioremap(base, 0x200);
635 if (!regs) {
636 printk(KERN_ERR "%s: failed to ioremap()\n", __func__);
637 err = -ENXIO;
638 goto err_dev;
639 }
640
641 snprintf(clkname, sizeof(clkname), "dma%d", dmac->sysdev.id);
642
643 dmac->clk = clk_get(NULL, clkname);
644 if (IS_ERR(dmac->clk)) {
645 printk(KERN_ERR "%s: failed to get clock %s\n", __func__, clkname);
646 err = PTR_ERR(dmac->clk);
647 goto err_map;
648 }
649
650 clk_enable(dmac->clk);
651
652 dmac->regs = regs;
653 dmac->chanbase = chbase;
654 dmac->channels = chptr;
655
656 err = request_irq(irq, s3c64xx_dma_irq, 0, "DMA", dmac);
657 if (err < 0) {
658 printk(KERN_ERR "%s: failed to get irq\n", __func__);
659 goto err_clk;
660 }
661
662 regptr = regs + PL080_Cx_BASE(0);
663
664 for (ch = 0; ch < 8; ch++, chno++, chptr++) {
665 printk(KERN_INFO "%s: registering DMA %d (%p)\n",
666 __func__, chno, regptr);
667
668 chptr->bit = 1 << ch;
669 chptr->number = chno;
670 chptr->dmac = dmac;
671 chptr->regs = regptr;
672 regptr += PL008_Cx_STRIDE;
673 }
674
675 /* for the moment, permanently enable the controller */
676 writel(PL080_CONFIG_ENABLE, regs + PL080_CONFIG);
677
678 printk(KERN_INFO "PL080: IRQ %d, at %p\n", irq, regs);
679
680 return 0;
681
682err_clk:
683 clk_disable(dmac->clk);
684 clk_put(dmac->clk);
685err_map:
686 iounmap(regs);
687err_dev:
688 sysdev_unregister(&dmac->sysdev);
689err_alloc:
690 kfree(dmac);
691 return err;
692}
693
694static int __init s3c64xx_dma_init(void)
695{
696 int ret;
697
698 printk(KERN_INFO "%s: Registering DMA channels\n", __func__);
699
700 dma_pool = dma_pool_create("DMA-LLI", NULL, 32, 16, 0);
701 if (!dma_pool) {
702 printk(KERN_ERR "%s: failed to create pool\n", __func__);
703 return -ENOMEM;
704 }
705
706 ret = sysdev_class_register(&dma_sysclass);
707 if (ret) {
708 printk(KERN_ERR "%s: failed to create sysclass\n", __func__);
709 return -ENOMEM;
710 }
711
712 /* Set all DMA configuration to be DMA, not SDMA */
713 writel(0xffffff, S3C_SYSREG(0x110));
714
715 /* Register standard DMA controlers */
716 s3c64xx_dma_init1(0, DMACH_UART0, IRQ_DMA0, 0x75000000);
717 s3c64xx_dma_init1(8, DMACH_PCM1_TX, IRQ_DMA1, 0x75100000);
718
719 return 0;
720}
721
722arch_initcall(s3c64xx_dma_init);
diff --git a/arch/arm/plat-s3c64xx/gpiolib.c b/arch/arm/plat-s3c64xx/gpiolib.c
index 78ee52cffc9e..da7b60ee5e67 100644
--- a/arch/arm/plat-s3c64xx/gpiolib.c
+++ b/arch/arm/plat-s3c64xx/gpiolib.c
@@ -385,12 +385,19 @@ static __init void s3c64xx_gpiolib_add_4bit(struct s3c_gpio_chip *chip)
385{ 385{
386 chip->chip.direction_input = s3c64xx_gpiolib_4bit_input; 386 chip->chip.direction_input = s3c64xx_gpiolib_4bit_input;
387 chip->chip.direction_output = s3c64xx_gpiolib_4bit_output; 387 chip->chip.direction_output = s3c64xx_gpiolib_4bit_output;
388 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
388} 389}
389 390
390static __init void s3c64xx_gpiolib_add_4bit2(struct s3c_gpio_chip *chip) 391static __init void s3c64xx_gpiolib_add_4bit2(struct s3c_gpio_chip *chip)
391{ 392{
392 chip->chip.direction_input = s3c64xx_gpiolib_4bit2_input; 393 chip->chip.direction_input = s3c64xx_gpiolib_4bit2_input;
393 chip->chip.direction_output = s3c64xx_gpiolib_4bit2_output; 394 chip->chip.direction_output = s3c64xx_gpiolib_4bit2_output;
395 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
396}
397
398static __init void s3c64xx_gpiolib_add_2bit(struct s3c_gpio_chip *chip)
399{
400 chip->pm = __gpio_pm(&s3c_gpio_pm_2bit);
394} 401}
395 402
396static __init void s3c64xx_gpiolib_add(struct s3c_gpio_chip *chips, 403static __init void s3c64xx_gpiolib_add(struct s3c_gpio_chip *chips,
@@ -412,7 +419,8 @@ static __init int s3c64xx_gpiolib_init(void)
412 s3c64xx_gpiolib_add(gpio_4bit2, ARRAY_SIZE(gpio_4bit2), 419 s3c64xx_gpiolib_add(gpio_4bit2, ARRAY_SIZE(gpio_4bit2),
413 s3c64xx_gpiolib_add_4bit2); 420 s3c64xx_gpiolib_add_4bit2);
414 421
415 s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit), NULL); 422 s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit),
423 s3c64xx_gpiolib_add_2bit);
416 424
417 return 0; 425 return 0;
418} 426}
diff --git a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
new file mode 100644
index 000000000000..0c30dd986725
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
@@ -0,0 +1,70 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
2 *
3 * Copyright 2009 Openmoko, Inc.
4 * Copyright 2009 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX DMA core
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */
16
17struct s3c64xx_dma_buff;
18
19/** s3c64xx_dma_buff - S3C64XX DMA buffer descriptor
20 * @next: Pointer to next buffer in queue or ring.
21 * @pw: Client provided identifier
22 * @lli: Pointer to hardware descriptor this buffer is associated with.
23 * @lli_dma: Hardare address of the descriptor.
24 */
25struct s3c64xx_dma_buff {
26 struct s3c64xx_dma_buff *next;
27
28 void *pw;
29 struct pl080_lli *lli;
30 dma_addr_t lli_dma;
31};
32
33struct s3c64xx_dmac;
34
35struct s3c2410_dma_chan {
36 unsigned char number; /* number of this dma channel */
37 unsigned char in_use; /* channel allocated */
38 unsigned char bit; /* bit for enable/disable/etc */
39 unsigned char hw_width;
40 unsigned char peripheral;
41
42 unsigned int flags;
43 enum s3c2410_dmasrc source;
44
45
46 dma_addr_t dev_addr;
47
48 struct s3c2410_dma_client *client;
49 struct s3c64xx_dmac *dmac; /* pointer to controller */
50
51 void __iomem *regs;
52
53 /* cdriver callbacks */
54 s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */
55 s3c2410_dma_opfn_t op_fn; /* channel op callback */
56
57 /* buffer list and information */
58 struct s3c64xx_dma_buff *curr; /* current dma buffer */
59 struct s3c64xx_dma_buff *next; /* next buffer to load */
60 struct s3c64xx_dma_buff *end; /* end of queue */
61
62 /* note, when channel is running in circular mode, curr is the
63 * first buffer enqueued, end is the last and curr is where the
64 * last buffer-done event is set-at. The buffers are not freed
65 * and the last buffer hardware descriptor points back to the
66 * first.
67 */
68};
69
70#include <plat/dma-core.h>
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h
index f865bf4d709e..743a70094d04 100644
--- a/arch/arm/plat-s3c64xx/include/plat/irqs.h
+++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h
@@ -157,6 +157,7 @@
157 157
158#define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE) 158#define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE)
159#define IRQ_EINT(x) S3C_EINT(x) 159#define IRQ_EINT(x) S3C_EINT(x)
160#define IRQ_EINT_BIT(x) ((x) - S3C_EINT(0))
160 161
161/* Next the external interrupt groups. These are similar to the IRQ_EINT(x) 162/* Next the external interrupt groups. These are similar to the IRQ_EINT(x)
162 * that they are sourced from the GPIO pins but with a different scheme for 163 * that they are sourced from the GPIO pins but with a different scheme for
diff --git a/arch/arm/plat-s3c64xx/include/plat/pm-core.h b/arch/arm/plat-s3c64xx/include/plat/pm-core.h
new file mode 100644
index 000000000000..d347de3ba0dc
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/include/plat/pm-core.h
@@ -0,0 +1,98 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/pm-core.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - PM core support for arch/arm/plat-s3c/pm.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <plat/regs-gpio.h>
16
17static inline void s3c_pm_debug_init_uart(void)
18{
19 u32 tmp = __raw_readl(S3C_PCLK_GATE);
20
21 /* As a note, since the S3C64XX UARTs generally have multiple
22 * clock sources, we simply enable PCLK at the moment and hope
23 * that the resume settings for the UART are suitable for the
24 * use with PCLK.
25 */
26
27 tmp |= S3C_CLKCON_PCLK_UART0;
28 tmp |= S3C_CLKCON_PCLK_UART1;
29 tmp |= S3C_CLKCON_PCLK_UART2;
30 tmp |= S3C_CLKCON_PCLK_UART3;
31
32 __raw_writel(tmp, S3C_PCLK_GATE);
33 udelay(10);
34}
35
36static inline void s3c_pm_arch_prepare_irqs(void)
37{
38 /* VIC should have already been taken care of */
39
40 /* clear any pending EINT0 interrupts */
41 __raw_writel(__raw_readl(S3C64XX_EINT0PEND), S3C64XX_EINT0PEND);
42}
43
44static inline void s3c_pm_arch_stop_clocks(void)
45{
46}
47
48static inline void s3c_pm_arch_show_resume_irqs(void)
49{
50}
51
52/* make these defines, we currently do not have any need to change
53 * the IRQ wake controls depending on the CPU we are running on */
54
55#define s3c_irqwake_eintallow ((1 << 28) - 1)
56#define s3c_irqwake_intallow (0)
57
58static inline void s3c_pm_arch_update_uart(void __iomem *regs,
59 struct pm_uart_save *save)
60{
61 u32 ucon = __raw_readl(regs + S3C2410_UCON);
62 u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK;
63 u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK;
64 u32 new_ucon;
65 u32 delta;
66
67 /* S3C64XX UART blocks only support level interrupts, so ensure that
68 * when we restore unused UART blocks we force the level interrupt
69 * settigs. */
70 save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
71
72 /* We have a constraint on changing the clock type of the UART
73 * between UCLKx and PCLK, so ensure that when we restore UCON
74 * that the CLK field is correctly modified if the bootloader
75 * has changed anything.
76 */
77 if (ucon_clk != save_clk) {
78 new_ucon = save->ucon;
79 delta = ucon_clk ^ save_clk;
80
81 /* change from UCLKx => wrong PCLK,
82 * either UCLK can be tested for by a bit-test
83 * with UCLK0 */
84 if (ucon_clk & S3C6400_UCON_UCLK0 &&
85 !(save_clk & S3C6400_UCON_UCLK0) &&
86 delta & S3C6400_UCON_PCLK2) {
87 new_ucon &= ~S3C6400_UCON_UCLK0;
88 } else if (delta == S3C6400_UCON_PCLK2) {
89 /* as an precaution, don't change from
90 * PCLK2 => PCLK or vice-versa */
91 new_ucon ^= S3C6400_UCON_PCLK2;
92 }
93
94 S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
95 ucon, new_ucon, save->ucon);
96 save->ucon = new_ucon;
97 }
98}
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
index b1082c163247..52836d41e333 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
@@ -32,6 +32,7 @@
32#define S3C_HCLK_GATE S3C_CLKREG(0x30) 32#define S3C_HCLK_GATE S3C_CLKREG(0x30)
33#define S3C_PCLK_GATE S3C_CLKREG(0x34) 33#define S3C_PCLK_GATE S3C_CLKREG(0x34)
34#define S3C_SCLK_GATE S3C_CLKREG(0x38) 34#define S3C_SCLK_GATE S3C_CLKREG(0x38)
35#define S3C_MEM0_GATE S3C_CLKREG(0x3C)
35 36
36/* CLKDIV0 */ 37/* CLKDIV0 */
37#define S3C6400_CLKDIV0_MFC_MASK (0xf << 28) 38#define S3C6400_CLKDIV0_MFC_MASK (0xf << 28)
diff --git a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h b/arch/arm/plat-s3c64xx/include/plat/s3c6400.h
index 571eaa2e54f1..11f2e1e119b0 100644
--- a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h
+++ b/arch/arm/plat-s3c64xx/include/plat/s3c6400.h
@@ -15,12 +15,13 @@
15/* Common init code for S3C6400 related SoCs */ 15/* Common init code for S3C6400 related SoCs */
16 16
17extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); 17extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
18extern void s3c6400_register_clocks(void); 18extern void s3c6400_register_clocks(unsigned armclk_divlimit);
19extern void s3c6400_setup_clocks(void); 19extern void s3c6400_setup_clocks(void);
20 20
21#ifdef CONFIG_CPU_S3C6400 21#ifdef CONFIG_CPU_S3C6400
22 22
23extern int s3c6400_init(void); 23extern int s3c6400_init(void);
24extern void s3c6400_init_irq(void);
24extern void s3c6400_map_io(void); 25extern void s3c6400_map_io(void);
25extern void s3c6400_init_clocks(int xtal); 26extern void s3c6400_init_clocks(int xtal);
26 27
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c
index 47e5155bb13e..f81b7b818ba0 100644
--- a/arch/arm/plat-s3c64xx/irq-eint.c
+++ b/arch/arm/plat-s3c64xx/irq-eint.c
@@ -14,6 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/sysdev.h>
17#include <linux/gpio.h> 18#include <linux/gpio.h>
18#include <linux/irq.h> 19#include <linux/irq.h>
19#include <linux/io.h> 20#include <linux/io.h>
@@ -26,6 +27,7 @@
26 27
27#include <mach/map.h> 28#include <mach/map.h>
28#include <plat/cpu.h> 29#include <plat/cpu.h>
30#include <plat/pm.h>
29 31
30#define eint_offset(irq) ((irq) - IRQ_EINT(0)) 32#define eint_offset(irq) ((irq) - IRQ_EINT(0))
31#define eint_irq_to_bit(irq) (1 << eint_offset(irq)) 33#define eint_irq_to_bit(irq) (1 << eint_offset(irq))
@@ -134,6 +136,7 @@ static struct irq_chip s3c_irq_eint = {
134 .mask_ack = s3c_irq_eint_maskack, 136 .mask_ack = s3c_irq_eint_maskack,
135 .ack = s3c_irq_eint_ack, 137 .ack = s3c_irq_eint_ack,
136 .set_type = s3c_irq_eint_set_type, 138 .set_type = s3c_irq_eint_set_type,
139 .set_wake = s3c_irqext_wake,
137}; 140};
138 141
139/* s3c_irq_demux_eint 142/* s3c_irq_demux_eint
diff --git a/arch/arm/plat-s3c64xx/irq-pm.c b/arch/arm/plat-s3c64xx/irq-pm.c
new file mode 100644
index 000000000000..ca523b5d4c17
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/irq-pm.c
@@ -0,0 +1,111 @@
1/* arch/arm/plat-s3c64xx/irq-pm.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - Interrupt handling Power Management
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/sysdev.h>
17#include <linux/interrupt.h>
18#include <linux/serial_core.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21
22#include <mach/map.h>
23
24#include <plat/regs-serial.h>
25#include <plat/regs-timer.h>
26#include <plat/regs-gpio.h>
27#include <plat/cpu.h>
28#include <plat/pm.h>
29
30/* We handled all the IRQ types in this code, to save having to make several
31 * small files to handle each different type separately. Having the EINT_GRP
32 * code here shouldn't be as much bloat as the IRQ table space needed when
33 * they are enabled. The added benefit is we ensure that these registers are
34 * in the same state as we suspended.
35 */
36
37static struct sleep_save irq_save[] = {
38 SAVE_ITEM(S3C64XX_PRIORITY),
39 SAVE_ITEM(S3C64XX_EINT0CON0),
40 SAVE_ITEM(S3C64XX_EINT0CON1),
41 SAVE_ITEM(S3C64XX_EINT0FLTCON0),
42 SAVE_ITEM(S3C64XX_EINT0FLTCON1),
43 SAVE_ITEM(S3C64XX_EINT0FLTCON2),
44 SAVE_ITEM(S3C64XX_EINT0FLTCON3),
45 SAVE_ITEM(S3C64XX_EINT0MASK),
46 SAVE_ITEM(S3C64XX_TINT_CSTAT),
47};
48
49static struct irq_grp_save {
50 u32 fltcon;
51 u32 con;
52 u32 mask;
53} eint_grp_save[5];
54
55static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS];
56
57static int s3c64xx_irq_pm_suspend(struct sys_device *dev, pm_message_t state)
58{
59 struct irq_grp_save *grp = eint_grp_save;
60 int i;
61
62 S3C_PMDBG("%s: suspending IRQs\n", __func__);
63
64 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
65
66 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
67 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
68
69 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
70 grp->con = __raw_readl(S3C64XX_EINT12CON + (i * 4));
71 grp->mask = __raw_readl(S3C64XX_EINT12MASK + (i * 4));
72 grp->fltcon = __raw_readl(S3C64XX_EINT12FLTCON + (i * 4));
73 }
74
75 return 0;
76}
77
78static int s3c64xx_irq_pm_resume(struct sys_device *dev)
79{
80 struct irq_grp_save *grp = eint_grp_save;
81 int i;
82
83 S3C_PMDBG("%s: resuming IRQs\n", __func__);
84
85 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
86
87 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
88 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
89
90 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
91 __raw_writel(grp->con, S3C64XX_EINT12CON + (i * 4));
92 __raw_writel(grp->mask, S3C64XX_EINT12MASK + (i * 4));
93 __raw_writel(grp->fltcon, S3C64XX_EINT12FLTCON + (i * 4));
94 }
95
96 S3C_PMDBG("%s: IRQ configuration restored\n", __func__);
97 return 0;
98}
99
100static struct sysdev_driver s3c64xx_irq_driver = {
101 .suspend = s3c64xx_irq_pm_suspend,
102 .resume = s3c64xx_irq_pm_resume,
103};
104
105static int __init s3c64xx_irq_pm_init(void)
106{
107 return sysdev_driver_register(&s3c64xx_sysclass, &s3c64xx_irq_driver);
108}
109
110arch_initcall(s3c64xx_irq_pm_init);
111
diff --git a/arch/arm/plat-s3c64xx/irq.c b/arch/arm/plat-s3c64xx/irq.c
index f22edf7c2d2d..8dc5b6da9789 100644
--- a/arch/arm/plat-s3c64xx/irq.c
+++ b/arch/arm/plat-s3c64xx/irq.c
@@ -14,12 +14,14 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/serial_core.h>
17#include <linux/irq.h> 18#include <linux/irq.h>
18#include <linux/io.h> 19#include <linux/io.h>
19 20
20#include <asm/hardware/vic.h> 21#include <asm/hardware/vic.h>
21 22
22#include <mach/map.h> 23#include <mach/map.h>
24#include <plat/regs-serial.h>
23#include <plat/regs-timer.h> 25#include <plat/regs-timer.h>
24#include <plat/cpu.h> 26#include <plat/cpu.h>
25 27
@@ -135,9 +137,6 @@ static inline unsigned int s3c_irq_uart_bit(unsigned int irq)
135} 137}
136 138
137/* UART interrupt registers, not worth adding to seperate include header */ 139/* UART interrupt registers, not worth adding to seperate include header */
138#define S3C64XX_UINTP 0x30
139#define S3C64XX_UINTSP 0x34
140#define S3C64XX_UINTM 0x38
141 140
142static void s3c_irq_uart_mask(unsigned int irq) 141static void s3c_irq_uart_mask(unsigned int irq)
143{ 142{
@@ -233,8 +232,8 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
233 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); 232 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
234 233
235 /* initialise the pair of VICs */ 234 /* initialise the pair of VICs */
236 vic_init(S3C_VA_VIC0, S3C_VIC0_BASE, vic0_valid); 235 vic_init(S3C_VA_VIC0, S3C_VIC0_BASE, vic0_valid, 0);
237 vic_init(S3C_VA_VIC1, S3C_VIC1_BASE, vic1_valid); 236 vic_init(S3C_VA_VIC1, S3C_VIC1_BASE, vic1_valid, 0);
238 237
239 /* add the timer sub-irqs */ 238 /* add the timer sub-irqs */
240 239
diff --git a/arch/arm/plat-s3c64xx/pm.c b/arch/arm/plat-s3c64xx/pm.c
new file mode 100644
index 000000000000..07a6516a4f3c
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/pm.c
@@ -0,0 +1,175 @@
1/* linux/arch/arm/plat-s3c64xx/pm.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX CPU PM support.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/suspend.h>
17#include <linux/serial_core.h>
18#include <linux/io.h>
19
20#include <mach/map.h>
21
22#include <plat/pm.h>
23#include <plat/regs-sys.h>
24#include <plat/regs-gpio.h>
25#include <plat/regs-clock.h>
26#include <plat/regs-syscon-power.h>
27#include <plat/regs-gpio-memport.h>
28
29#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
30#include <plat/gpio-bank-n.h>
31
32void s3c_pm_debug_smdkled(u32 set, u32 clear)
33{
34 unsigned long flags;
35 u32 reg;
36
37 local_irq_save(flags);
38 reg = __raw_readl(S3C64XX_GPNCON);
39 reg &= ~(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) |
40 S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15));
41 reg |= S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) |
42 S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15);
43 __raw_writel(reg, S3C64XX_GPNCON);
44
45 reg = __raw_readl(S3C64XX_GPNDAT);
46 reg &= ~(clear << 12);
47 reg |= set << 12;
48 __raw_writel(reg, S3C64XX_GPNDAT);
49
50 local_irq_restore(flags);
51}
52#endif
53
54static struct sleep_save core_save[] = {
55 SAVE_ITEM(S3C_APLL_LOCK),
56 SAVE_ITEM(S3C_MPLL_LOCK),
57 SAVE_ITEM(S3C_EPLL_LOCK),
58 SAVE_ITEM(S3C_CLK_SRC),
59 SAVE_ITEM(S3C_CLK_DIV0),
60 SAVE_ITEM(S3C_CLK_DIV1),
61 SAVE_ITEM(S3C_CLK_DIV2),
62 SAVE_ITEM(S3C_CLK_OUT),
63 SAVE_ITEM(S3C_HCLK_GATE),
64 SAVE_ITEM(S3C_PCLK_GATE),
65 SAVE_ITEM(S3C_SCLK_GATE),
66 SAVE_ITEM(S3C_MEM0_GATE),
67
68 SAVE_ITEM(S3C_EPLL_CON1),
69 SAVE_ITEM(S3C_EPLL_CON0),
70
71 SAVE_ITEM(S3C64XX_MEM0DRVCON),
72 SAVE_ITEM(S3C64XX_MEM1DRVCON),
73
74#ifndef CONFIG_CPU_FREQ
75 SAVE_ITEM(S3C_APLL_CON),
76 SAVE_ITEM(S3C_MPLL_CON),
77#endif
78};
79
80static struct sleep_save misc_save[] = {
81 SAVE_ITEM(S3C64XX_AHB_CON0),
82 SAVE_ITEM(S3C64XX_AHB_CON1),
83 SAVE_ITEM(S3C64XX_AHB_CON2),
84
85 SAVE_ITEM(S3C64XX_SPCON),
86
87 SAVE_ITEM(S3C64XX_MEM0CONSTOP),
88 SAVE_ITEM(S3C64XX_MEM1CONSTOP),
89 SAVE_ITEM(S3C64XX_MEM0CONSLP0),
90 SAVE_ITEM(S3C64XX_MEM0CONSLP1),
91 SAVE_ITEM(S3C64XX_MEM1CONSLP),
92};
93
94void s3c_pm_configure_extint(void)
95{
96 __raw_writel(s3c_irqwake_eintmask, S3C64XX_EINT_MASK);
97}
98
99void s3c_pm_restore_core(void)
100{
101 __raw_writel(0, S3C64XX_EINT_MASK);
102
103 s3c_pm_debug_smdkled(1 << 2, 0);
104
105 s3c_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
106 s3c_pm_do_restore(misc_save, ARRAY_SIZE(misc_save));
107}
108
109void s3c_pm_save_core(void)
110{
111 s3c_pm_do_save(misc_save, ARRAY_SIZE(misc_save));
112 s3c_pm_do_save(core_save, ARRAY_SIZE(core_save));
113}
114
115/* since both s3c6400 and s3c6410 share the same sleep pm calls, we
116 * put the per-cpu code in here until any new cpu comes along and changes
117 * this.
118 */
119
120#include <plat/regs-gpio.h>
121
122static void s3c64xx_cpu_suspend(void)
123{
124 unsigned long tmp;
125
126 /* set our standby method to sleep */
127
128 tmp = __raw_readl(S3C64XX_PWR_CFG);
129 tmp &= ~S3C64XX_PWRCFG_CFG_WFI_MASK;
130 tmp |= S3C64XX_PWRCFG_CFG_WFI_SLEEP;
131 __raw_writel(tmp, S3C64XX_PWR_CFG);
132
133 /* clear any old wakeup */
134
135 __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT),
136 S3C64XX_WAKEUP_STAT);
137
138 /* set the LED state to 0110 over sleep */
139 s3c_pm_debug_smdkled(3 << 1, 0xf);
140
141 /* issue the standby signal into the pm unit. Note, we
142 * issue a write-buffer drain just in case */
143
144 tmp = 0;
145
146 asm("b 1f\n\t"
147 ".align 5\n\t"
148 "1:\n\t"
149 "mcr p15, 0, %0, c7, c10, 5\n\t"
150 "mcr p15, 0, %0, c7, c10, 4\n\t"
151 "mcr p15, 0, %0, c7, c0, 4" :: "r" (tmp));
152
153 /* we should never get past here */
154
155 panic("sleep resumed to originator?");
156}
157
158static void s3c64xx_pm_prepare(void)
159{
160 /* store address of resume. */
161 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C64XX_INFORM0);
162
163 /* ensure previous wakeup state is cleared before sleeping */
164 __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT);
165}
166
167static int s3c64xx_pm_init(void)
168{
169 pm_cpu_prep = s3c64xx_pm_prepare;
170 pm_cpu_sleep = s3c64xx_cpu_suspend;
171 pm_uart_udivslot = 1;
172 return 0;
173}
174
175arch_initcall(s3c64xx_pm_init);
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
index 05b17528041e..1debc1f9f987 100644
--- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
+++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c
@@ -133,6 +133,65 @@ static struct clksrc_clk clk_mout_mpll = {
133 .sources = &clk_src_mpll, 133 .sources = &clk_src_mpll,
134}; 134};
135 135
136static unsigned int armclk_mask;
137
138static unsigned long s3c64xx_clk_arm_get_rate(struct clk *clk)
139{
140 unsigned long rate = clk_get_rate(clk->parent);
141 u32 clkdiv;
142
143 /* divisor mask starts at bit0, so no need to shift */
144 clkdiv = __raw_readl(S3C_CLK_DIV0) & armclk_mask;
145
146 return rate / (clkdiv + 1);
147}
148
149static unsigned long s3c64xx_clk_arm_round_rate(struct clk *clk,
150 unsigned long rate)
151{
152 unsigned long parent = clk_get_rate(clk->parent);
153 u32 div;
154
155 if (parent < rate)
156 return rate;
157
158 div = (parent / rate) - 1;
159 if (div > armclk_mask)
160 div = armclk_mask;
161
162 return parent / (div + 1);
163}
164
165static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate)
166{
167 unsigned long parent = clk_get_rate(clk->parent);
168 u32 div;
169 u32 val;
170
171 if (rate < parent / (armclk_mask + 1))
172 return -EINVAL;
173
174 rate = clk_round_rate(clk, rate);
175 div = clk_get_rate(clk->parent) / rate;
176
177 val = __raw_readl(S3C_CLK_DIV0);
178 val &= armclk_mask;
179 val |= (div - 1);
180 __raw_writel(val, S3C_CLK_DIV0);
181
182 return 0;
183
184}
185
186static struct clk clk_arm = {
187 .name = "armclk",
188 .id = -1,
189 .parent = &clk_mout_apll.clk,
190 .get_rate = s3c64xx_clk_arm_get_rate,
191 .set_rate = s3c64xx_clk_arm_set_rate,
192 .round_rate = s3c64xx_clk_arm_round_rate,
193};
194
136static unsigned long s3c64xx_clk_doutmpll_get_rate(struct clk *clk) 195static unsigned long s3c64xx_clk_doutmpll_get_rate(struct clk *clk)
137{ 196{
138 unsigned long rate = clk_get_rate(clk->parent); 197 unsigned long rate = clk_get_rate(clk->parent);
@@ -520,6 +579,33 @@ static struct clksrc_clk clk_irda = {
520 .reg_divider = S3C_CLK_DIV2, 579 .reg_divider = S3C_CLK_DIV2,
521}; 580};
522 581
582static struct clk *clkset_camif_list[] = {
583 &clk_h2,
584};
585
586static struct clk_sources clkset_camif = {
587 .sources = clkset_camif_list,
588 .nr_sources = ARRAY_SIZE(clkset_camif_list),
589};
590
591static struct clksrc_clk clk_camif = {
592 .clk = {
593 .name = "camera",
594 .id = -1,
595 .ctrlbit = S3C_CLKCON_SCLK_CAM,
596 .enable = s3c64xx_sclk_ctrl,
597 .set_parent = s3c64xx_setparent_clksrc,
598 .get_rate = s3c64xx_getrate_clksrc,
599 .set_rate = s3c64xx_setrate_clksrc,
600 .round_rate = s3c64xx_roundrate_clksrc,
601 },
602 .shift = 0,
603 .mask = 0,
604 .sources = &clkset_camif,
605 .divider_shift = S3C6400_CLKDIV0_CAM_SHIFT,
606 .reg_divider = S3C_CLK_DIV0,
607};
608
523/* Clock initialisation code */ 609/* Clock initialisation code */
524 610
525static struct clksrc_clk *init_parents[] = { 611static struct clksrc_clk *init_parents[] = {
@@ -536,6 +622,7 @@ static struct clksrc_clk *init_parents[] = {
536 &clk_audio0, 622 &clk_audio0,
537 &clk_audio1, 623 &clk_audio1,
538 &clk_irda, 624 &clk_irda,
625 &clk_camif,
539}; 626};
540 627
541static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk) 628static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
@@ -608,6 +695,7 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
608 clk_fout_epll.rate = epll; 695 clk_fout_epll.rate = epll;
609 clk_fout_apll.rate = apll; 696 clk_fout_apll.rate = apll;
610 697
698 clk_h2.rate = hclk2;
611 clk_h.rate = hclk; 699 clk_h.rate = hclk;
612 clk_p.rate = pclk; 700 clk_p.rate = pclk;
613 clk_f.rate = fclk; 701 clk_f.rate = fclk;
@@ -635,14 +723,30 @@ static struct clk *clks[] __initdata = {
635 &clk_audio0.clk, 723 &clk_audio0.clk,
636 &clk_audio1.clk, 724 &clk_audio1.clk,
637 &clk_irda.clk, 725 &clk_irda.clk,
726 &clk_camif.clk,
727 &clk_arm,
638}; 728};
639 729
640void __init s3c6400_register_clocks(void) 730/**
731 * s3c6400_register_clocks - register clocks for s3c6400 and above
732 * @armclk_divlimit: Divisor mask for ARMCLK
733 *
734 * Register the clocks for the S3C6400 and above SoC range, such
735 * as ARMCLK and the clocks which have divider chains attached.
736 *
737 * This call does not setup the clocks, which is left to the
738 * s3c6400_setup_clocks() call which may be needed by the cpufreq
739 * or resume code to re-set the clocks if the bootloader has changed
740 * them.
741 */
742void __init s3c6400_register_clocks(unsigned armclk_divlimit)
641{ 743{
642 struct clk *clkp; 744 struct clk *clkp;
643 int ret; 745 int ret;
644 int ptr; 746 int ptr;
645 747
748 armclk_mask = armclk_divlimit;
749
646 for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) { 750 for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
647 clkp = clks[ptr]; 751 clkp = clks[ptr];
648 ret = s3c24xx_register_clock(clkp); 752 ret = s3c24xx_register_clock(clkp);
diff --git a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
new file mode 100644
index 000000000000..5417123b0ac1
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
@@ -0,0 +1,55 @@
1/* linux/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C64XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
8 *
9 * This program 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
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19
20#include <mach/gpio.h>
21#include <plat/gpio-cfg.h>
22
23void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
24{
25 unsigned int gpio;
26 unsigned int end;
27
28 end = S3C64XX_GPG(2 + width);
29
30 /* Set all the necessary GPG pins to special-function 0 */
31 for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) {
32 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
33 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
34 }
35
36 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
37 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2));
38}
39
40void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
41{
42 unsigned int gpio;
43 unsigned int end;
44
45 end = S3C64XX_GPH(2 + width);
46
47 /* Set all the necessary GPG pins to special-function 0 */
48 for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) {
49 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
50 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
51 }
52
53 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
54 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
55}
diff --git a/arch/arm/plat-s3c64xx/sleep.S b/arch/arm/plat-s3c64xx/sleep.S
new file mode 100644
index 000000000000..8e71fe90a373
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/sleep.S
@@ -0,0 +1,144 @@
1/* linux/0arch/arm/plat-s3c64xx/sleep.S
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX CPU sleep code
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/linkage.h>
16#include <asm/assembler.h>
17#include <mach/map.h>
18
19#undef S3C64XX_VA_GPIO
20#define S3C64XX_VA_GPIO (0x0)
21
22#include <plat/regs-gpio.h>
23#include <plat/gpio-bank-n.h>
24
25#define LL_UART (S3C_PA_UART + (0x400 * CONFIG_S3C_LOWLEVEL_UART_PORT))
26
27 .text
28
29 /* s3c_cpu_save
30 *
31 * Save enough processor state to allow the restart of the pm.c
32 * code after resume.
33 *
34 * entry:
35 * r0 = pointer to the save block
36 */
37
38ENTRY(s3c_cpu_save)
39 stmfd sp!, { r4 - r12, lr }
40
41 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
42 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
43 mrc p15, 0, r6, c2, c0, 0 @ Translation Table BASE0
44 mrc p15, 0, r7, c2, c0, 1 @ Translation Table BASE1
45 mrc p15, 0, r8, c2, c0, 2 @ Translation Table Control
46 mrc p15, 0, r9, c1, c0, 0 @ Control register
47 mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register
48 mrc p15, 0, r11, c1, c0, 2 @ Co-processor access controls
49
50 stmia r0, { r4 - r13 } @ Save CP registers and SP
51
52 @@ save our state to ram
53 bl s3c_pm_cb_flushcache
54
55 @@ call final suspend code
56 ldr r0, =pm_cpu_sleep
57 ldr pc, [r0]
58
59 @@ return to the caller, after the MMU is turned on.
60 @@ restore the last bits of the stack and return.
61resume_with_mmu:
62 ldmfd sp!, { r4 - r12, pc } @ return, from sp from s3c_cpu_save
63
64 .data
65
66 /* the next bit is code, but it requires easy access to the
67 * s3c_sleep_save_phys data before the MMU is switched on, so
68 * we store the code that needs this variable in the .data where
69 * the value can be written to (the .text segment is RO).
70 */
71
72 .global s3c_sleep_save_phys
73s3c_sleep_save_phys:
74 .word 0
75
76 /* Sleep magic, the word before the resume entry point so that the
77 * bootloader can check for a resumeable image. */
78
79 .word 0x2bedf00d
80
81 /* s3c_cpu_reusme
82 *
83 * This is the entry point, stored by whatever method the bootloader
84 * requires to get the kernel runnign again. This code expects to be
85 * entered with no caches live and the MMU disabled. It will then
86 * restore the MMU and other basic CP registers saved and restart
87 * the kernel C code to finish the resume code.
88 */
89
90ENTRY(s3c_cpu_resume)
91 msr cpsr_c, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
92 ldr r2, =LL_UART /* for debug */
93
94#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
95 /* Initialise the GPIO state if we are debugging via the SMDK LEDs,
96 * as the uboot version supplied resets these to inputs during the
97 * resume checks.
98 */
99
100 ldr r3, =S3C64XX_PA_GPIO
101 ldr r0, [ r3, #S3C64XX_GPNCON ]
102 bic r0, r0, #(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) | \
103 S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15))
104 orr r0, r0, #(S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) | \
105 S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15))
106 str r0, [ r3, #S3C64XX_GPNCON ]
107
108 ldr r0, [ r3, #S3C64XX_GPNDAT ]
109 bic r0, r0, #0xf << 12 @ GPN12..15
110 orr r0, r0, #1 << 15 @ GPN15
111 str r0, [ r3, #S3C64XX_GPNDAT ]
112#endif
113
114 /* __v6_setup from arch/arm/mm/proc-v6.S, ensure that the caches
115 * are thoroughly cleaned just in case the bootloader didn't do it
116 * for us. */
117 mov r0, #0
118 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache
119 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
120 mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache
121 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
122 @@mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs
123 @@mcr p15, 0, r0, c7, c7, 0 @ Invalidate I + D caches
124
125 ldr r0, s3c_sleep_save_phys
126 ldmia r0, { r4 - r13 }
127
128 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
129 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
130 mcr p15, 0, r6, c2, c0, 0 @ Translation Table BASE0
131 mcr p15, 0, r7, c2, c0, 1 @ Translation Table BASE1
132 mcr p15, 0, r8, c2, c0, 2 @ Translation Table Control
133 mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register
134
135 mov r0, #0 @ restore copro access controls
136 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access controls
137 mcr p15, 0, r0, c7, c5, 4
138
139 ldr r2, =resume_with_mmu
140 mcr p15, 0, r9, c1, c0, 0 /* turn mmu back on */
141 nop
142 mov pc, r2 /* jump back */
143
144 .end
diff --git a/arch/arm/plat-stmp3xxx/Kconfig b/arch/arm/plat-stmp3xxx/Kconfig
new file mode 100644
index 000000000000..2cf37c35951b
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/Kconfig
@@ -0,0 +1,37 @@
1if ARCH_STMP3XXX
2
3menu "Freescale STMP3xxx implementations"
4
5choice
6 prompt "Select STMP3xxx chip family"
7
8config ARCH_STMP37XX
9 bool "Freescale SMTP37xx"
10 select CPU_ARM926T
11 ---help---
12 STMP37xx refers to 3700 through 3769 chips
13
14config ARCH_STMP378X
15 bool "Freescale STMP378x"
16 select CPU_ARM926T
17 ---help---
18 STMP378x refers to 3780 through 3789 chips
19
20endchoice
21
22choice
23 prompt "Select STMP3xxx board type"
24
25config MACH_STMP37XX
26 depends on ARCH_STMP37XX
27 bool "Freescale STMP37xx development board"
28
29config MACH_STMP378X
30 depends on ARCH_STMP378X
31 bool "Freescale STMP378x development board"
32
33endchoice
34
35endmenu
36
37endif
diff --git a/arch/arm/plat-stmp3xxx/Makefile b/arch/arm/plat-stmp3xxx/Makefile
new file mode 100644
index 000000000000..31dd518f37a5
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for the linux kernel.
3#
4# Object file lists.
5obj-y += core.o timer.o irq.o dma.o clock.o pinmux.o devices.o
diff --git a/arch/arm/plat-stmp3xxx/clock.c b/arch/arm/plat-stmp3xxx/clock.c
new file mode 100644
index 000000000000..5d2f19a09e44
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/clock.c
@@ -0,0 +1,1135 @@
1/*
2 * Clock manipulation routines for Freescale STMP37XX/STMP378X
3 *
4 * Author: Vitaly Wool <vital@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#define DEBUG
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/init.h>
22#include <linux/clk.h>
23#include <linux/spinlock.h>
24#include <linux/errno.h>
25#include <linux/err.h>
26#include <linux/delay.h>
27#include <linux/io.h>
28
29#include <asm/mach-types.h>
30#include <asm/clkdev.h>
31#include <mach/platform.h>
32#include <mach/regs-clkctrl.h>
33
34#include "clock.h"
35
36static DEFINE_SPINLOCK(clocks_lock);
37
38static struct clk osc_24M;
39static struct clk pll_clk;
40static struct clk cpu_clk;
41static struct clk hclk;
42
43static int propagate_rate(struct clk *);
44
45static inline int clk_is_busy(struct clk *clk)
46{
47 return __raw_readl(clk->busy_reg) & (1 << clk->busy_bit);
48}
49
50static inline int clk_good(struct clk *clk)
51{
52 return clk && !IS_ERR(clk) && clk->ops;
53}
54
55static int std_clk_enable(struct clk *clk)
56{
57 if (clk->enable_reg) {
58 u32 clk_reg = __raw_readl(clk->enable_reg);
59 if (clk->enable_negate)
60 clk_reg &= ~(1 << clk->enable_shift);
61 else
62 clk_reg |= (1 << clk->enable_shift);
63 __raw_writel(clk_reg, clk->enable_reg);
64 if (clk->enable_wait)
65 udelay(clk->enable_wait);
66 return 0;
67 } else
68 return -EINVAL;
69}
70
71static int std_clk_disable(struct clk *clk)
72{
73 if (clk->enable_reg) {
74 u32 clk_reg = __raw_readl(clk->enable_reg);
75 if (clk->enable_negate)
76 clk_reg |= (1 << clk->enable_shift);
77 else
78 clk_reg &= ~(1 << clk->enable_shift);
79 __raw_writel(clk_reg, clk->enable_reg);
80 return 0;
81 } else
82 return -EINVAL;
83}
84
85static int io_set_rate(struct clk *clk, u32 rate)
86{
87 u32 reg_frac, clkctrl_frac;
88 int i, ret = 0, mask = 0x1f;
89
90 clkctrl_frac = (clk->parent->rate * 18 + rate - 1) / rate;
91
92 if (clkctrl_frac < 18 || clkctrl_frac > 35) {
93 ret = -EINVAL;
94 goto out;
95 }
96
97 reg_frac = __raw_readl(clk->scale_reg);
98 reg_frac &= ~(mask << clk->scale_shift);
99 __raw_writel(reg_frac | (clkctrl_frac << clk->scale_shift),
100 clk->scale_reg);
101 if (clk->busy_reg) {
102 for (i = 10000; i; i--)
103 if (!clk_is_busy(clk))
104 break;
105 if (!i)
106 ret = -ETIMEDOUT;
107 else
108 ret = 0;
109 }
110out:
111 return ret;
112}
113
114static long io_get_rate(struct clk *clk)
115{
116 long rate = clk->parent->rate * 18;
117 int mask = 0x1f;
118
119 rate /= (__raw_readl(clk->scale_reg) >> clk->scale_shift) & mask;
120 clk->rate = rate;
121
122 return rate;
123}
124
125static long per_get_rate(struct clk *clk)
126{
127 long rate = clk->parent->rate;
128 long div;
129 const int mask = 0xff;
130
131 if (clk->enable_reg &&
132 !(__raw_readl(clk->enable_reg) & clk->enable_shift))
133 clk->rate = 0;
134 else {
135 div = (__raw_readl(clk->scale_reg) >> clk->scale_shift) & mask;
136 if (div)
137 rate /= div;
138 clk->rate = rate;
139 }
140
141 return clk->rate;
142}
143
144static int per_set_rate(struct clk *clk, u32 rate)
145{
146 int ret = -EINVAL;
147 int div = (clk->parent->rate + rate - 1) / rate;
148 u32 reg_frac;
149 const int mask = 0xff;
150 int try = 10;
151 int i = -1;
152
153 if (div == 0 || div > mask)
154 goto out;
155
156 reg_frac = __raw_readl(clk->scale_reg);
157 reg_frac &= ~(mask << clk->scale_shift);
158
159 while (try--) {
160 __raw_writel(reg_frac | (div << clk->scale_shift),
161 clk->scale_reg);
162
163 if (clk->busy_reg) {
164 for (i = 10000; i; i--)
165 if (!clk_is_busy(clk))
166 break;
167 }
168 if (i)
169 break;
170 }
171
172 if (!i)
173 ret = -ETIMEDOUT;
174 else
175 ret = 0;
176
177out:
178 if (ret != 0)
179 printk(KERN_ERR "%s: error %d\n", __func__, ret);
180 return ret;
181}
182
183static long lcdif_get_rate(struct clk *clk)
184{
185 long rate = clk->parent->rate;
186 long div;
187 const int mask = 0xff;
188
189 div = (__raw_readl(clk->scale_reg) >> clk->scale_shift) & mask;
190 if (div) {
191 rate /= div;
192 div = (__raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC) &
193 BM_CLKCTRL_FRAC_PIXFRAC) >> BP_CLKCTRL_FRAC_PIXFRAC;
194 rate /= div;
195 }
196 clk->rate = rate;
197
198 return rate;
199}
200
201static int lcdif_set_rate(struct clk *clk, u32 rate)
202{
203 int ret = 0;
204 /*
205 * On 3700, we can get most timings exact by modifying ref_pix
206 * and the divider, but keeping the phase timings at 1 (2
207 * phases per cycle).
208 *
209 * ref_pix can be between 480e6*18/35=246.9MHz and 480e6*18/18=480MHz,
210 * which is between 18/(18*480e6)=2.084ns and 35/(18*480e6)=4.050ns.
211 *
212 * ns_cycle >= 2*18e3/(18*480) = 25/6
213 * ns_cycle <= 2*35e3/(18*480) = 875/108
214 *
215 * Multiply the ns_cycle by 'div' to lengthen it until it fits the
216 * bounds. This is the divider we'll use after ref_pix.
217 *
218 * 6 * ns_cycle >= 25 * div
219 * 108 * ns_cycle <= 875 * div
220 */
221 u32 ns_cycle = 1000000 / rate;
222 u32 div, reg_val;
223 u32 lowest_result = (u32) -1;
224 u32 lowest_div = 0, lowest_fracdiv = 0;
225
226 for (div = 1; div < 256; ++div) {
227 u32 fracdiv;
228 u32 ps_result;
229 int lower_bound = 6 * ns_cycle >= 25 * div;
230 int upper_bound = 108 * ns_cycle <= 875 * div;
231 if (!lower_bound)
232 break;
233 if (!upper_bound)
234 continue;
235 /*
236 * Found a matching div. Calculate fractional divider needed,
237 * rounded up.
238 */
239 fracdiv = ((clk->parent->rate / 1000 * 18 / 2) *
240 ns_cycle + 1000 * div - 1) /
241 (1000 * div);
242 if (fracdiv < 18 || fracdiv > 35) {
243 ret = -EINVAL;
244 goto out;
245 }
246 /* Calculate the actual cycle time this results in */
247 ps_result = 6250 * div * fracdiv / 27;
248
249 /* Use the fastest result that doesn't break ns_cycle */
250 if (ps_result <= lowest_result) {
251 lowest_result = ps_result;
252 lowest_div = div;
253 lowest_fracdiv = fracdiv;
254 }
255 }
256
257 if (div >= 256 || lowest_result == (u32) -1) {
258 ret = -EINVAL;
259 goto out;
260 }
261 pr_debug("Programming PFD=%u,DIV=%u ref_pix=%uMHz "
262 "PIXCLK=%uMHz cycle=%u.%03uns\n",
263 lowest_fracdiv, lowest_div,
264 480*18/lowest_fracdiv, 480*18/lowest_fracdiv/lowest_div,
265 lowest_result / 1000, lowest_result % 1000);
266
267 /* Program ref_pix phase fractional divider */
268 reg_val = __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC);
269 reg_val &= ~BM_CLKCTRL_FRAC_PIXFRAC;
270 reg_val |= BF(lowest_fracdiv, CLKCTRL_FRAC_PIXFRAC);
271 __raw_writel(reg_val, REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC);
272
273 /* Ungate PFD */
274 stmp3xxx_clearl(BM_CLKCTRL_FRAC_CLKGATEPIX,
275 REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC);
276
277 /* Program pix divider */
278 reg_val = __raw_readl(clk->scale_reg);
279 reg_val &= ~(BM_CLKCTRL_PIX_DIV | BM_CLKCTRL_PIX_CLKGATE);
280 reg_val |= BF(lowest_div, CLKCTRL_PIX_DIV);
281 __raw_writel(reg_val, clk->scale_reg);
282
283 /* Wait for divider update */
284 if (clk->busy_reg) {
285 int i;
286 for (i = 10000; i; i--)
287 if (!clk_is_busy(clk))
288 break;
289 if (!i) {
290 ret = -ETIMEDOUT;
291 goto out;
292 }
293 }
294
295 /* Switch to ref_pix source */
296 reg_val = __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ);
297 reg_val &= ~BM_CLKCTRL_CLKSEQ_BYPASS_PIX;
298 __raw_writel(reg_val, REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ);
299
300out:
301 return ret;
302}
303
304
305static int cpu_set_rate(struct clk *clk, u32 rate)
306{
307 u32 reg_val;
308
309 if (rate < 24000)
310 return -EINVAL;
311 else if (rate == 24000) {
312 /* switch to the 24M source */
313 clk_set_parent(clk, &osc_24M);
314 } else {
315 int i;
316 u32 clkctrl_cpu = 1;
317 u32 c = clkctrl_cpu;
318 u32 clkctrl_frac = 1;
319 u32 val;
320 for ( ; c < 0x40; c++) {
321 u32 f = (pll_clk.rate*18/c + rate/2) / rate;
322 int s1, s2;
323
324 if (f < 18 || f > 35)
325 continue;
326 s1 = pll_clk.rate*18/clkctrl_frac/clkctrl_cpu - rate;
327 s2 = pll_clk.rate*18/c/f - rate;
328 pr_debug("%s: s1 %d, s2 %d\n", __func__, s1, s2);
329 if (abs(s1) > abs(s2)) {
330 clkctrl_cpu = c;
331 clkctrl_frac = f;
332 }
333 if (s2 == 0)
334 break;
335 };
336 pr_debug("%s: clkctrl_cpu %d, clkctrl_frac %d\n", __func__,
337 clkctrl_cpu, clkctrl_frac);
338 if (c == 0x40) {
339 int d = pll_clk.rate*18/clkctrl_frac/clkctrl_cpu -
340 rate;
341 if (abs(d) > 100 ||
342 clkctrl_frac < 18 || clkctrl_frac > 35)
343 return -EINVAL;
344 }
345
346 /* 4.6.2 */
347 val = __raw_readl(clk->scale_reg);
348 val &= ~(0x3f << clk->scale_shift);
349 val |= clkctrl_frac;
350 clk_set_parent(clk, &osc_24M);
351 udelay(10);
352 __raw_writel(val, clk->scale_reg);
353 /* ungate */
354 __raw_writel(1<<7, clk->scale_reg + 8);
355 /* write clkctrl_cpu */
356 clk->saved_div = clkctrl_cpu;
357
358 reg_val = __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
359 reg_val &= ~0x3F;
360 reg_val |= clkctrl_cpu;
361 __raw_writel(reg_val, REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
362
363 for (i = 10000; i; i--)
364 if (!clk_is_busy(clk))
365 break;
366 if (!i) {
367 printk(KERN_ERR "couldn't set up CPU divisor\n");
368 return -ETIMEDOUT;
369 }
370 clk_set_parent(clk, &pll_clk);
371 clk->saved_div = 0;
372 udelay(10);
373 }
374 return 0;
375}
376
377static long cpu_get_rate(struct clk *clk)
378{
379 long rate = clk->parent->rate * 18;
380
381 rate /= (__raw_readl(clk->scale_reg) >> clk->scale_shift) & 0x3f;
382 rate /= __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU) & 0x3f;
383 rate = ((rate + 9) / 10) * 10;
384 clk->rate = rate;
385
386 return rate;
387}
388
389static long cpu_round_rate(struct clk *clk, u32 rate)
390{
391 unsigned long r = 0;
392
393 if (rate <= 24000)
394 r = 24000;
395 else {
396 u32 clkctrl_cpu = 1;
397 u32 clkctrl_frac;
398 do {
399 clkctrl_frac =
400 (pll_clk.rate*18 / clkctrl_cpu + rate/2) / rate;
401 if (clkctrl_frac > 35)
402 continue;
403 if (pll_clk.rate*18 / clkctrl_frac / clkctrl_cpu/10 ==
404 rate / 10)
405 break;
406 } while (pll_clk.rate / 2 >= clkctrl_cpu++ * rate);
407 if (pll_clk.rate / 2 < (clkctrl_cpu - 1) * rate)
408 clkctrl_cpu--;
409 pr_debug("%s: clkctrl_cpu %d, clkctrl_frac %d\n", __func__,
410 clkctrl_cpu, clkctrl_frac);
411 if (clkctrl_frac < 18)
412 clkctrl_frac = 18;
413 if (clkctrl_frac > 35)
414 clkctrl_frac = 35;
415
416 r = pll_clk.rate * 18;
417 r /= clkctrl_frac;
418 r /= clkctrl_cpu;
419 r = 10 * ((r + 9) / 10);
420 }
421 return r;
422}
423
424static long emi_get_rate(struct clk *clk)
425{
426 long rate = clk->parent->rate * 18;
427
428 rate /= (__raw_readl(clk->scale_reg) >> clk->scale_shift) & 0x3f;
429 rate /= __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_EMI) & 0x3f;
430 clk->rate = rate;
431
432 return rate;
433}
434
435static int clkseq_set_parent(struct clk *clk, struct clk *parent)
436{
437 int ret = -EINVAL;
438 int shift = 8;
439
440 /* bypass? */
441 if (parent == &osc_24M)
442 shift = 4;
443
444 if (clk->bypass_reg) {
445#ifdef CONFIG_ARCH_STMP378X
446 u32 hbus_val, cpu_val;
447
448 if (clk == &cpu_clk && shift == 4) {
449 hbus_val = __raw_readl(REGS_CLKCTRL_BASE +
450 HW_CLKCTRL_HBUS);
451 cpu_val = __raw_readl(REGS_CLKCTRL_BASE +
452 HW_CLKCTRL_CPU);
453
454 hbus_val &= ~(BM_CLKCTRL_HBUS_DIV_FRAC_EN |
455 BM_CLKCTRL_HBUS_DIV);
456 clk->saved_div = cpu_val & BM_CLKCTRL_CPU_DIV_CPU;
457 cpu_val &= ~BM_CLKCTRL_CPU_DIV_CPU;
458 cpu_val |= 1;
459
460 if (machine_is_stmp378x()) {
461 __raw_writel(hbus_val,
462 REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS);
463 __raw_writel(cpu_val,
464 REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
465 hclk.rate = 0;
466 }
467 } else if (clk == &cpu_clk && shift == 8) {
468 hbus_val = __raw_readl(REGS_CLKCTRL_BASE +
469 HW_CLKCTRL_HBUS);
470 cpu_val = __raw_readl(REGS_CLKCTRL_BASE +
471 HW_CLKCTRL_CPU);
472 hbus_val &= ~(BM_CLKCTRL_HBUS_DIV_FRAC_EN |
473 BM_CLKCTRL_HBUS_DIV);
474 hbus_val |= 2;
475 cpu_val &= ~BM_CLKCTRL_CPU_DIV_CPU;
476 if (clk->saved_div)
477 cpu_val |= clk->saved_div;
478 else
479 cpu_val |= 2;
480
481 if (machine_is_stmp378x()) {
482 __raw_writel(hbus_val,
483 REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS);
484 __raw_writel(cpu_val,
485 REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
486 hclk.rate = 0;
487 }
488 }
489#endif
490 __raw_writel(1 << clk->bypass_shift, clk->bypass_reg + shift);
491
492 ret = 0;
493 }
494
495 return ret;
496}
497
498static int hbus_set_rate(struct clk *clk, u32 rate)
499{
500 u8 div = 0;
501 int is_frac = 0;
502 u32 clkctrl_hbus;
503 struct clk *parent = clk->parent;
504
505 pr_debug("%s: rate %d, parent rate %d\n", __func__, rate,
506 parent->rate);
507
508 if (rate > parent->rate)
509 return -EINVAL;
510
511 if (((parent->rate + rate/2) / rate) * rate != parent->rate &&
512 parent->rate / rate < 32) {
513 pr_debug("%s: switching to fractional mode\n", __func__);
514 is_frac = 1;
515 }
516
517 if (is_frac)
518 div = (32 * rate + parent->rate / 2) / parent->rate;
519 else
520 div = (parent->rate + rate - 1) / rate;
521 pr_debug("%s: div calculated is %d\n", __func__, div);
522 if (!div || div > 0x1f)
523 return -EINVAL;
524
525 clk_set_parent(&cpu_clk, &osc_24M);
526 udelay(10);
527 clkctrl_hbus = __raw_readl(clk->scale_reg);
528 clkctrl_hbus &= ~0x3f;
529 clkctrl_hbus |= div;
530 clkctrl_hbus |= (is_frac << 5);
531
532 __raw_writel(clkctrl_hbus, clk->scale_reg);
533 if (clk->busy_reg) {
534 int i;
535 for (i = 10000; i; i--)
536 if (!clk_is_busy(clk))
537 break;
538 if (!i) {
539 printk(KERN_ERR "couldn't set up CPU divisor\n");
540 return -ETIMEDOUT;
541 }
542 }
543 clk_set_parent(&cpu_clk, &pll_clk);
544 __raw_writel(clkctrl_hbus, clk->scale_reg);
545 udelay(10);
546 return 0;
547}
548
549static long hbus_get_rate(struct clk *clk)
550{
551 long rate = clk->parent->rate;
552
553 if (__raw_readl(clk->scale_reg) & 0x20) {
554 rate *= __raw_readl(clk->scale_reg) & 0x1f;
555 rate /= 32;
556 } else
557 rate /= __raw_readl(clk->scale_reg) & 0x1f;
558 clk->rate = rate;
559
560 return rate;
561}
562
563static int xbus_set_rate(struct clk *clk, u32 rate)
564{
565 u16 div = 0;
566 u32 clkctrl_xbus;
567
568 pr_debug("%s: rate %d, parent rate %d\n", __func__, rate,
569 clk->parent->rate);
570
571 div = (clk->parent->rate + rate - 1) / rate;
572 pr_debug("%s: div calculated is %d\n", __func__, div);
573 if (!div || div > 0x3ff)
574 return -EINVAL;
575
576 clkctrl_xbus = __raw_readl(clk->scale_reg);
577 clkctrl_xbus &= ~0x3ff;
578 clkctrl_xbus |= div;
579 __raw_writel(clkctrl_xbus, clk->scale_reg);
580 if (clk->busy_reg) {
581 int i;
582 for (i = 10000; i; i--)
583 if (!clk_is_busy(clk))
584 break;
585 if (!i) {
586 printk(KERN_ERR "couldn't set up xbus divisor\n");
587 return -ETIMEDOUT;
588 }
589 }
590 return 0;
591}
592
593static long xbus_get_rate(struct clk *clk)
594{
595 long rate = clk->parent->rate;
596
597 rate /= __raw_readl(clk->scale_reg) & 0x3ff;
598 clk->rate = rate;
599
600 return rate;
601}
602
603
604/* Clock ops */
605
606static struct clk_ops std_ops = {
607 .enable = std_clk_enable,
608 .disable = std_clk_disable,
609 .get_rate = per_get_rate,
610 .set_rate = per_set_rate,
611 .set_parent = clkseq_set_parent,
612};
613
614static struct clk_ops min_ops = {
615 .enable = std_clk_enable,
616 .disable = std_clk_disable,
617};
618
619static struct clk_ops cpu_ops = {
620 .enable = std_clk_enable,
621 .disable = std_clk_disable,
622 .get_rate = cpu_get_rate,
623 .set_rate = cpu_set_rate,
624 .round_rate = cpu_round_rate,
625 .set_parent = clkseq_set_parent,
626};
627
628static struct clk_ops io_ops = {
629 .enable = std_clk_enable,
630 .disable = std_clk_disable,
631 .get_rate = io_get_rate,
632 .set_rate = io_set_rate,
633};
634
635static struct clk_ops hbus_ops = {
636 .get_rate = hbus_get_rate,
637 .set_rate = hbus_set_rate,
638};
639
640static struct clk_ops xbus_ops = {
641 .get_rate = xbus_get_rate,
642 .set_rate = xbus_set_rate,
643};
644
645static struct clk_ops lcdif_ops = {
646 .enable = std_clk_enable,
647 .disable = std_clk_disable,
648 .get_rate = lcdif_get_rate,
649 .set_rate = lcdif_set_rate,
650 .set_parent = clkseq_set_parent,
651};
652
653static struct clk_ops emi_ops = {
654 .get_rate = emi_get_rate,
655};
656
657/* List of on-chip clocks */
658
659static struct clk osc_24M = {
660 .flags = FIXED_RATE | ENABLED,
661 .rate = 24000,
662};
663
664static struct clk pll_clk = {
665 .parent = &osc_24M,
666 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PLLCTRL0,
667 .enable_shift = 16,
668 .enable_wait = 10,
669 .flags = FIXED_RATE | ENABLED,
670 .rate = 480000,
671 .ops = &min_ops,
672};
673
674static struct clk cpu_clk = {
675 .parent = &pll_clk,
676 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
677 .scale_shift = 0,
678 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
679 .bypass_shift = 7,
680 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU,
681 .busy_bit = 28,
682 .flags = RATE_PROPAGATES | ENABLED,
683 .ops = &cpu_ops,
684};
685
686static struct clk io_clk = {
687 .parent = &pll_clk,
688 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
689 .enable_shift = 31,
690 .enable_negate = 1,
691 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
692 .scale_shift = 24,
693 .flags = RATE_PROPAGATES | ENABLED,
694 .ops = &io_ops,
695};
696
697static struct clk hclk = {
698 .parent = &cpu_clk,
699 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS,
700 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
701 .bypass_shift = 7,
702 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS,
703 .busy_bit = 29,
704 .flags = RATE_PROPAGATES | ENABLED,
705 .ops = &hbus_ops,
706};
707
708static struct clk xclk = {
709 .parent = &osc_24M,
710 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XBUS,
711 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XBUS,
712 .busy_bit = 31,
713 .flags = RATE_PROPAGATES | ENABLED,
714 .ops = &xbus_ops,
715};
716
717static struct clk uart_clk = {
718 .parent = &xclk,
719 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
720 .enable_shift = 31,
721 .enable_negate = 1,
722 .flags = ENABLED,
723 .ops = &min_ops,
724};
725
726static struct clk audio_clk = {
727 .parent = &xclk,
728 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
729 .enable_shift = 30,
730 .enable_negate = 1,
731 .ops = &min_ops,
732};
733
734static struct clk pwm_clk = {
735 .parent = &xclk,
736 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
737 .enable_shift = 29,
738 .enable_negate = 1,
739 .ops = &min_ops,
740};
741
742static struct clk dri_clk = {
743 .parent = &xclk,
744 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
745 .enable_shift = 28,
746 .enable_negate = 1,
747 .ops = &min_ops,
748};
749
750static struct clk digctl_clk = {
751 .parent = &xclk,
752 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
753 .enable_shift = 27,
754 .enable_negate = 1,
755 .ops = &min_ops,
756};
757
758static struct clk timer_clk = {
759 .parent = &xclk,
760 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
761 .enable_shift = 26,
762 .enable_negate = 1,
763 .flags = ENABLED,
764 .ops = &min_ops,
765};
766
767static struct clk lcdif_clk = {
768 .parent = &pll_clk,
769 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PIX,
770 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PIX,
771 .busy_bit = 29,
772 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PIX,
773 .enable_shift = 31,
774 .enable_negate = 1,
775 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
776 .bypass_shift = 1,
777 .flags = NEEDS_SET_PARENT,
778 .ops = &lcdif_ops,
779};
780
781static struct clk ssp_clk = {
782 .parent = &io_clk,
783 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SSP,
784 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SSP,
785 .busy_bit = 29,
786 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SSP,
787 .enable_shift = 31,
788 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
789 .bypass_shift = 5,
790 .enable_negate = 1,
791 .flags = NEEDS_SET_PARENT,
792 .ops = &std_ops,
793};
794
795static struct clk gpmi_clk = {
796 .parent = &io_clk,
797 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_GPMI,
798 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_GPMI,
799 .busy_bit = 29,
800 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_GPMI,
801 .enable_shift = 31,
802 .enable_negate = 1,
803 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
804 .bypass_shift = 4,
805 .flags = NEEDS_SET_PARENT,
806 .ops = &std_ops,
807};
808
809static struct clk spdif_clk = {
810 .parent = &pll_clk,
811 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SPDIF,
812 .enable_shift = 31,
813 .enable_negate = 1,
814 .ops = &min_ops,
815};
816
817static struct clk emi_clk = {
818 .parent = &pll_clk,
819 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_EMI,
820 .enable_shift = 31,
821 .enable_negate = 1,
822 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
823 .scale_shift = 8,
824 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_EMI,
825 .busy_bit = 28,
826 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
827 .bypass_shift = 6,
828 .flags = ENABLED,
829 .ops = &emi_ops,
830};
831
832static struct clk ir_clk = {
833 .parent = &io_clk,
834 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_IR,
835 .enable_shift = 31,
836 .enable_negate = 1,
837 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
838 .bypass_shift = 3,
839 .ops = &min_ops,
840};
841
842static struct clk saif_clk = {
843 .parent = &pll_clk,
844 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SAIF,
845 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SAIF,
846 .busy_bit = 29,
847 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SAIF,
848 .enable_shift = 31,
849 .enable_negate = 1,
850 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
851 .bypass_shift = 0,
852 .ops = &std_ops,
853};
854
855static struct clk usb_clk = {
856 .parent = &pll_clk,
857 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PLLCTRL0,
858 .enable_shift = 18,
859 .enable_negate = 1,
860 .ops = &min_ops,
861};
862
863/* list of all the clocks */
864static struct clk_lookup onchip_clks[] = {
865 {
866 .con_id = "osc_24M",
867 .clk = &osc_24M,
868 }, {
869 .con_id = "pll",
870 .clk = &pll_clk,
871 }, {
872 .con_id = "cpu",
873 .clk = &cpu_clk,
874 }, {
875 .con_id = "hclk",
876 .clk = &hclk,
877 }, {
878 .con_id = "xclk",
879 .clk = &xclk,
880 }, {
881 .con_id = "io",
882 .clk = &io_clk,
883 }, {
884 .con_id = "uart",
885 .clk = &uart_clk,
886 }, {
887 .con_id = "audio",
888 .clk = &audio_clk,
889 }, {
890 .con_id = "pwm",
891 .clk = &pwm_clk,
892 }, {
893 .con_id = "dri",
894 .clk = &dri_clk,
895 }, {
896 .con_id = "digctl",
897 .clk = &digctl_clk,
898 }, {
899 .con_id = "timer",
900 .clk = &timer_clk,
901 }, {
902 .con_id = "lcdif",
903 .clk = &lcdif_clk,
904 }, {
905 .con_id = "ssp",
906 .clk = &ssp_clk,
907 }, {
908 .con_id = "gpmi",
909 .clk = &gpmi_clk,
910 }, {
911 .con_id = "spdif",
912 .clk = &spdif_clk,
913 }, {
914 .con_id = "emi",
915 .clk = &emi_clk,
916 }, {
917 .con_id = "ir",
918 .clk = &ir_clk,
919 }, {
920 .con_id = "saif",
921 .clk = &saif_clk,
922 }, {
923 .con_id = "usb",
924 .clk = &usb_clk,
925 },
926};
927
928static int __init propagate_rate(struct clk *clk)
929{
930 struct clk_lookup *cl;
931
932 for (cl = onchip_clks; cl < onchip_clks + ARRAY_SIZE(onchip_clks);
933 cl++) {
934 if (unlikely(!clk_good(cl->clk)))
935 continue;
936 if (cl->clk->parent == clk && cl->clk->ops->get_rate) {
937 cl->clk->ops->get_rate(cl->clk);
938 if (cl->clk->flags & RATE_PROPAGATES)
939 propagate_rate(cl->clk);
940 }
941 }
942
943 return 0;
944}
945
946/* Exported API */
947unsigned long clk_get_rate(struct clk *clk)
948{
949 if (unlikely(!clk_good(clk)))
950 return 0;
951
952 if (clk->rate != 0)
953 return clk->rate;
954
955 if (clk->ops->get_rate != NULL)
956 return clk->ops->get_rate(clk);
957
958 return clk_get_rate(clk->parent);
959}
960EXPORT_SYMBOL(clk_get_rate);
961
962long clk_round_rate(struct clk *clk, unsigned long rate)
963{
964 if (unlikely(!clk_good(clk)))
965 return 0;
966
967 if (clk->ops->round_rate)
968 return clk->ops->round_rate(clk, rate);
969
970 return 0;
971}
972EXPORT_SYMBOL(clk_round_rate);
973
974static inline int close_enough(long rate1, long rate2)
975{
976 return rate1 && !((rate2 - rate1) * 1000 / rate1);
977}
978
979int clk_set_rate(struct clk *clk, unsigned long rate)
980{
981 int ret = -EINVAL;
982
983 if (unlikely(!clk_good(clk)))
984 goto out;
985
986 if (clk->flags & FIXED_RATE || !clk->ops->set_rate)
987 goto out;
988
989 else if (!close_enough(clk->rate, rate)) {
990 ret = clk->ops->set_rate(clk, rate);
991 if (ret < 0)
992 goto out;
993 clk->rate = rate;
994 if (clk->flags & RATE_PROPAGATES)
995 propagate_rate(clk);
996 } else
997 ret = 0;
998
999out:
1000 return ret;
1001}
1002EXPORT_SYMBOL(clk_set_rate);
1003
1004int clk_enable(struct clk *clk)
1005{
1006 unsigned long clocks_flags;
1007
1008 if (unlikely(!clk_good(clk)))
1009 return -EINVAL;
1010
1011 if (clk->parent)
1012 clk_enable(clk->parent);
1013
1014 spin_lock_irqsave(&clocks_lock, clocks_flags);
1015
1016 clk->usage++;
1017 if (clk->ops && clk->ops->enable)
1018 clk->ops->enable(clk);
1019
1020 spin_unlock_irqrestore(&clocks_lock, clocks_flags);
1021 return 0;
1022}
1023EXPORT_SYMBOL(clk_enable);
1024
1025static void local_clk_disable(struct clk *clk)
1026{
1027 if (unlikely(!clk_good(clk)))
1028 return;
1029
1030 if (clk->usage == 0 && clk->ops->disable)
1031 clk->ops->disable(clk);
1032
1033 if (clk->parent)
1034 local_clk_disable(clk->parent);
1035}
1036
1037void clk_disable(struct clk *clk)
1038{
1039 unsigned long clocks_flags;
1040
1041 if (unlikely(!clk_good(clk)))
1042 return;
1043
1044 spin_lock_irqsave(&clocks_lock, clocks_flags);
1045
1046 if ((--clk->usage) == 0 && clk->ops->disable)
1047 clk->ops->disable(clk);
1048
1049 spin_unlock_irqrestore(&clocks_lock, clocks_flags);
1050 if (clk->parent)
1051 clk_disable(clk->parent);
1052}
1053EXPORT_SYMBOL(clk_disable);
1054
1055/* Some additional API */
1056int clk_set_parent(struct clk *clk, struct clk *parent)
1057{
1058 int ret = -ENODEV;
1059 unsigned long clocks_flags;
1060
1061 if (unlikely(!clk_good(clk)))
1062 goto out;
1063
1064 if (!clk->ops->set_parent)
1065 goto out;
1066
1067 spin_lock_irqsave(&clocks_lock, clocks_flags);
1068
1069 ret = clk->ops->set_parent(clk, parent);
1070 if (!ret) {
1071 /* disable if usage count is 0 */
1072 local_clk_disable(parent);
1073
1074 parent->usage += clk->usage;
1075 clk->parent->usage -= clk->usage;
1076
1077 /* disable if new usage count is 0 */
1078 local_clk_disable(clk->parent);
1079
1080 clk->parent = parent;
1081 }
1082 spin_unlock_irqrestore(&clocks_lock, clocks_flags);
1083
1084out:
1085 return ret;
1086}
1087EXPORT_SYMBOL(clk_set_parent);
1088
1089struct clk *clk_get_parent(struct clk *clk)
1090{
1091 if (unlikely(!clk_good(clk)))
1092 return NULL;
1093 return clk->parent;
1094}
1095EXPORT_SYMBOL(clk_get_parent);
1096
1097static int __init clk_init(void)
1098{
1099 struct clk_lookup *cl;
1100 struct clk_ops *ops;
1101
1102 spin_lock_init(&clocks_lock);
1103
1104 for (cl = onchip_clks; cl < onchip_clks + ARRAY_SIZE(onchip_clks);
1105 cl++) {
1106 if (cl->clk->flags & ENABLED)
1107 clk_enable(cl->clk);
1108 else
1109 local_clk_disable(cl->clk);
1110
1111 ops = cl->clk->ops;
1112
1113 if ((cl->clk->flags & NEEDS_INITIALIZATION) &&
1114 ops && ops->set_rate)
1115 ops->set_rate(cl->clk, cl->clk->rate);
1116
1117 if (cl->clk->flags & FIXED_RATE) {
1118 if (cl->clk->flags & RATE_PROPAGATES)
1119 propagate_rate(cl->clk);
1120 } else {
1121 if (ops && ops->get_rate)
1122 ops->get_rate(cl->clk);
1123 }
1124
1125 if (cl->clk->flags & NEEDS_SET_PARENT) {
1126 if (ops && ops->set_parent)
1127 ops->set_parent(cl->clk, cl->clk->parent);
1128 }
1129
1130 clkdev_add(cl);
1131 }
1132 return 0;
1133}
1134
1135arch_initcall(clk_init);
diff --git a/arch/arm/plat-stmp3xxx/clock.h b/arch/arm/plat-stmp3xxx/clock.h
new file mode 100644
index 000000000000..a6611e1a3510
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/clock.h
@@ -0,0 +1,61 @@
1/*
2 * Clock control driver for Freescale STMP37XX/STMP378X - internal header file
3 *
4 * Author: Vitaly Wool <vital@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ARCH_ARM_STMX3XXX_CLOCK_H__
19#define __ARCH_ARM_STMX3XXX_CLOCK_H__
20
21#ifndef __ASSEMBLER__
22
23struct clk_ops {
24 int (*enable) (struct clk *);
25 int (*disable) (struct clk *);
26 long (*get_rate) (struct clk *);
27 long (*round_rate) (struct clk *, u32);
28 int (*set_rate) (struct clk *, u32);
29 int (*set_parent) (struct clk *, struct clk *);
30};
31
32struct clk {
33 struct clk *parent;
34 u32 rate;
35 u32 flags;
36 u8 scale_shift;
37 u8 enable_shift;
38 u8 bypass_shift;
39 u8 busy_bit;
40 s8 usage;
41 int enable_wait;
42 int enable_negate;
43 u32 saved_div;
44 void __iomem *enable_reg;
45 void __iomem *scale_reg;
46 void __iomem *bypass_reg;
47 void __iomem *busy_reg;
48 struct clk_ops *ops;
49};
50
51#endif /* __ASSEMBLER__ */
52
53/* Flags */
54#define RATE_PROPAGATES (1<<0)
55#define NEEDS_INITIALIZATION (1<<1)
56#define PARENT_SET_RATE (1<<2)
57#define FIXED_RATE (1<<3)
58#define ENABLED (1<<4)
59#define NEEDS_SET_PARENT (1<<5)
60
61#endif
diff --git a/arch/arm/plat-stmp3xxx/core.c b/arch/arm/plat-stmp3xxx/core.c
new file mode 100644
index 000000000000..37b8a09148a4
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/core.c
@@ -0,0 +1,128 @@
1/*
2 * Freescale STMP37XX/STMP378X core routines
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/io.h>
21
22#include <mach/stmp3xxx.h>
23#include <mach/platform.h>
24#include <mach/dma.h>
25#include <mach/regs-clkctrl.h>
26
27static int __stmp3xxx_reset_block(void __iomem *hwreg, int just_enable)
28{
29 u32 c;
30 int timeout;
31
32 /* the process of software reset of IP block is done
33 in several steps:
34
35 - clear SFTRST and wait for block is enabled;
36 - clear clock gating (CLKGATE bit);
37 - set the SFTRST again and wait for block is in reset;
38 - clear SFTRST and wait for reset completion.
39 */
40 c = __raw_readl(hwreg);
41 c &= ~(1<<31); /* clear SFTRST */
42 __raw_writel(c, hwreg);
43 for (timeout = 1000000; timeout > 0; timeout--)
44 /* still in SFTRST state ? */
45 if ((__raw_readl(hwreg) & (1<<31)) == 0)
46 break;
47 if (timeout <= 0) {
48 printk(KERN_ERR"%s(%p): timeout when enabling\n",
49 __func__, hwreg);
50 return -ETIME;
51 }
52
53 c = __raw_readl(hwreg);
54 c &= ~(1<<30); /* clear CLKGATE */
55 __raw_writel(c, hwreg);
56
57 if (!just_enable) {
58 c = __raw_readl(hwreg);
59 c |= (1<<31); /* now again set SFTRST */
60 __raw_writel(c, hwreg);
61 for (timeout = 1000000; timeout > 0; timeout--)
62 /* poll until CLKGATE set */
63 if (__raw_readl(hwreg) & (1<<30))
64 break;
65 if (timeout <= 0) {
66 printk(KERN_ERR"%s(%p): timeout when resetting\n",
67 __func__, hwreg);
68 return -ETIME;
69 }
70
71 c = __raw_readl(hwreg);
72 c &= ~(1<<31); /* clear SFTRST */
73 __raw_writel(c, hwreg);
74 for (timeout = 1000000; timeout > 0; timeout--)
75 /* still in SFTRST state ? */
76 if ((__raw_readl(hwreg) & (1<<31)) == 0)
77 break;
78 if (timeout <= 0) {
79 printk(KERN_ERR"%s(%p): timeout when enabling "
80 "after reset\n", __func__, hwreg);
81 return -ETIME;
82 }
83
84 c = __raw_readl(hwreg);
85 c &= ~(1<<30); /* clear CLKGATE */
86 __raw_writel(c, hwreg);
87 }
88 for (timeout = 1000000; timeout > 0; timeout--)
89 /* still in SFTRST state ? */
90 if ((__raw_readl(hwreg) & (1<<30)) == 0)
91 break;
92
93 if (timeout <= 0) {
94 printk(KERN_ERR"%s(%p): timeout when unclockgating\n",
95 __func__, hwreg);
96 return -ETIME;
97 }
98
99 return 0;
100}
101
102int stmp3xxx_reset_block(void __iomem *hwreg, int just_enable)
103{
104 int try = 10;
105 int r;
106
107 while (try--) {
108 r = __stmp3xxx_reset_block(hwreg, just_enable);
109 if (!r)
110 break;
111 pr_debug("%s: try %d failed\n", __func__, 10 - try);
112 }
113 return r;
114}
115EXPORT_SYMBOL(stmp3xxx_reset_block);
116
117struct platform_device stmp3xxx_dbguart = {
118 .name = "stmp3xxx-dbguart",
119 .id = -1,
120};
121
122void __init stmp3xxx_init(void)
123{
124 /* Turn off auto-slow and other tricks */
125 stmp3xxx_clearl(0x7f00000, REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS);
126
127 stmp3xxx_dma_init();
128}
diff --git a/arch/arm/plat-stmp3xxx/devices.c b/arch/arm/plat-stmp3xxx/devices.c
new file mode 100644
index 000000000000..68fed4b8746a
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/devices.c
@@ -0,0 +1,389 @@
1/*
2* Freescale STMP37XX/STMP378X platform devices
3*
4* Embedded Alley Solutions, Inc <source@embeddedalley.com>
5*
6* Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7* Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8*/
9
10/*
11* The code contained herein is licensed under the GNU General Public
12* License. You may obtain a copy of the GNU General Public License
13* Version 2 or later at the following locations:
14*
15* http://www.opensource.org/licenses/gpl-license.html
16* http://www.gnu.org/copyleft/gpl.html
17*/
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/device.h>
21#include <linux/platform_device.h>
22#include <linux/dma-mapping.h>
23
24#include <mach/dma.h>
25#include <mach/platform.h>
26#include <mach/stmp3xxx.h>
27#include <mach/regs-lcdif.h>
28#include <mach/regs-uartapp.h>
29#include <mach/regs-gpmi.h>
30#include <mach/regs-usbctrl.h>
31#include <mach/regs-ssp.h>
32#include <mach/regs-rtc.h>
33
34static u64 common_dmamask = DMA_BIT_MASK(32);
35
36static struct resource appuart_resources[] = {
37 {
38 .start = IRQ_UARTAPP_INTERNAL,
39 .end = IRQ_UARTAPP_INTERNAL,
40 .flags = IORESOURCE_IRQ,
41 }, {
42 .start = IRQ_UARTAPP_RX_DMA,
43 .end = IRQ_UARTAPP_RX_DMA,
44 .flags = IORESOURCE_IRQ,
45 }, {
46 .start = IRQ_UARTAPP_TX_DMA,
47 .end = IRQ_UARTAPP_TX_DMA,
48 .flags = IORESOURCE_IRQ,
49 }, {
50 .start = REGS_UARTAPP1_PHYS,
51 .end = REGS_UARTAPP1_PHYS + REGS_UARTAPP_SIZE,
52 .flags = IORESOURCE_MEM,
53 }, {
54 /* Rx DMA channel */
55 .start = STMP3XXX_DMA(6, STMP3XXX_BUS_APBX),
56 .end = STMP3XXX_DMA(6, STMP3XXX_BUS_APBX),
57 .flags = IORESOURCE_DMA,
58 }, {
59 /* Tx DMA channel */
60 .start = STMP3XXX_DMA(7, STMP3XXX_BUS_APBX),
61 .end = STMP3XXX_DMA(7, STMP3XXX_BUS_APBX),
62 .flags = IORESOURCE_DMA,
63 },
64};
65
66struct platform_device stmp3xxx_appuart = {
67 .name = "stmp3xxx-appuart",
68 .id = 0,
69 .resource = appuart_resources,
70 .num_resources = ARRAY_SIZE(appuart_resources),
71 .dev = {
72 .dma_mask = &common_dmamask,
73 .coherent_dma_mask = DMA_BIT_MASK(32),
74 },
75};
76
77struct platform_device stmp3xxx_watchdog = {
78 .name = "stmp3xxx_wdt",
79 .id = -1,
80};
81
82static struct resource ts_resource[] = {
83 {
84 .flags = IORESOURCE_IRQ,
85 .start = IRQ_TOUCH_DETECT,
86 .end = IRQ_TOUCH_DETECT,
87 }, {
88 .flags = IORESOURCE_IRQ,
89 .start = IRQ_LRADC_CH5,
90 .end = IRQ_LRADC_CH5,
91 },
92};
93
94struct platform_device stmp3xxx_touchscreen = {
95 .name = "stmp3xxx_ts",
96 .id = -1,
97 .resource = ts_resource,
98 .num_resources = ARRAY_SIZE(ts_resource),
99};
100
101/*
102* Keypad device
103*/
104struct platform_device stmp3xxx_keyboard = {
105 .name = "stmp3xxx-keyboard",
106 .id = -1,
107};
108
109static struct resource gpmi_resources[] = {
110 {
111 .flags = IORESOURCE_MEM,
112 .start = REGS_GPMI_PHYS,
113 .end = REGS_GPMI_PHYS + REGS_GPMI_SIZE,
114 }, {
115 .flags = IORESOURCE_IRQ,
116 .start = IRQ_GPMI_DMA,
117 .end = IRQ_GPMI_DMA,
118 }, {
119 .flags = IORESOURCE_DMA,
120 .start = STMP3XXX_DMA(4, STMP3XXX_BUS_APBH),
121 .end = STMP3XXX_DMA(8, STMP3XXX_BUS_APBH),
122 },
123};
124
125struct platform_device stmp3xxx_gpmi = {
126 .name = "gpmi",
127 .id = -1,
128 .dev = {
129 .dma_mask = &common_dmamask,
130 .coherent_dma_mask = DMA_BIT_MASK(32),
131 },
132 .resource = gpmi_resources,
133 .num_resources = ARRAY_SIZE(gpmi_resources),
134};
135
136static struct resource mmc1_resource[] = {
137 {
138 .flags = IORESOURCE_MEM,
139 .start = REGS_SSP1_PHYS,
140 .end = REGS_SSP1_PHYS + REGS_SSP_SIZE,
141 }, {
142 .flags = IORESOURCE_DMA,
143 .start = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
144 .end = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
145 }, {
146 .flags = IORESOURCE_IRQ,
147 .start = IRQ_SSP1_DMA,
148 .end = IRQ_SSP1_DMA,
149 }, {
150 .flags = IORESOURCE_IRQ,
151 .start = IRQ_SSP_ERROR,
152 .end = IRQ_SSP_ERROR,
153 },
154};
155
156struct platform_device stmp3xxx_mmc = {
157 .name = "stmp3xxx-mmc",
158 .id = 1,
159 .dev = {
160 .dma_mask = &common_dmamask,
161 .coherent_dma_mask = DMA_BIT_MASK(32),
162 },
163 .resource = mmc1_resource,
164 .num_resources = ARRAY_SIZE(mmc1_resource),
165};
166
167static struct resource usb_resources[] = {
168 {
169 .start = REGS_USBCTRL_PHYS,
170 .end = REGS_USBCTRL_PHYS + SZ_4K,
171 .flags = IORESOURCE_MEM,
172 }, {
173 .start = IRQ_USB_CTRL,
174 .end = IRQ_USB_CTRL,
175 .flags = IORESOURCE_IRQ,
176 },
177};
178
179struct platform_device stmp3xxx_udc = {
180 .name = "fsl-usb2-udc",
181 .id = -1,
182 .dev = {
183 .dma_mask = &common_dmamask,
184 .coherent_dma_mask = DMA_BIT_MASK(32),
185 },
186 .resource = usb_resources,
187 .num_resources = ARRAY_SIZE(usb_resources),
188};
189
190struct platform_device stmp3xxx_ehci = {
191 .name = "fsl-ehci",
192 .id = -1,
193 .dev = {
194 .dma_mask = &common_dmamask,
195 .coherent_dma_mask = DMA_BIT_MASK(32),
196 },
197 .resource = usb_resources,
198 .num_resources = ARRAY_SIZE(usb_resources),
199};
200
201static struct resource rtc_resources[] = {
202 {
203 .start = REGS_RTC_PHYS,
204 .end = REGS_RTC_PHYS + REGS_RTC_SIZE,
205 .flags = IORESOURCE_MEM,
206 }, {
207 .start = IRQ_RTC_ALARM,
208 .end = IRQ_RTC_ALARM,
209 .flags = IORESOURCE_IRQ,
210 }, {
211 .start = IRQ_RTC_1MSEC,
212 .end = IRQ_RTC_1MSEC,
213 .flags = IORESOURCE_IRQ,
214 },
215};
216
217struct platform_device stmp3xxx_rtc = {
218 .name = "stmp3xxx-rtc",
219 .id = -1,
220 .resource = rtc_resources,
221 .num_resources = ARRAY_SIZE(rtc_resources),
222};
223
224static struct resource ssp1_resources[] = {
225 {
226 .start = REGS_SSP1_PHYS,
227 .end = REGS_SSP1_PHYS + REGS_SSP_SIZE,
228 .flags = IORESOURCE_MEM,
229 }, {
230 .start = IRQ_SSP1_DMA,
231 .end = IRQ_SSP1_DMA,
232 .flags = IORESOURCE_IRQ,
233 }, {
234 .start = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
235 .end = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
236 .flags = IORESOURCE_DMA,
237 },
238};
239
240static struct resource ssp2_resources[] = {
241 {
242 .start = REGS_SSP2_PHYS,
243 .end = REGS_SSP2_PHYS + REGS_SSP_SIZE,
244 .flags = IORESOURCE_MEM,
245 }, {
246 .start = IRQ_SSP2_DMA,
247 .end = IRQ_SSP2_DMA,
248 .flags = IORESOURCE_IRQ,
249 }, {
250 .start = STMP3XXX_DMA(2, STMP3XXX_BUS_APBH),
251 .end = STMP3XXX_DMA(2, STMP3XXX_BUS_APBH),
252 .flags = IORESOURCE_DMA,
253 },
254};
255
256struct platform_device stmp3xxx_spi1 = {
257 .name = "stmp3xxx_ssp",
258 .id = 1,
259 .dev = {
260 .dma_mask = &common_dmamask,
261 .coherent_dma_mask = DMA_BIT_MASK(32),
262 },
263 .resource = ssp1_resources,
264 .num_resources = ARRAY_SIZE(ssp1_resources),
265};
266
267struct platform_device stmp3xxx_spi2 = {
268 .name = "stmp3xxx_ssp",
269 .id = 2,
270 .dev = {
271 .dma_mask = &common_dmamask,
272 .coherent_dma_mask = DMA_BIT_MASK(32),
273 },
274 .resource = ssp2_resources,
275 .num_resources = ARRAY_SIZE(ssp2_resources),
276};
277
278static struct resource fb_resource[] = {
279 {
280 .flags = IORESOURCE_IRQ,
281 .start = IRQ_LCDIF_DMA,
282 .end = IRQ_LCDIF_DMA,
283 }, {
284 .flags = IORESOURCE_IRQ,
285 .start = IRQ_LCDIF_ERROR,
286 .end = IRQ_LCDIF_ERROR,
287 }, {
288 .flags = IORESOURCE_MEM,
289 .start = REGS_LCDIF_PHYS,
290 .end = REGS_LCDIF_PHYS + REGS_LCDIF_SIZE,
291 },
292};
293
294struct platform_device stmp3xxx_framebuffer = {
295 .name = "stmp3xxx-fb",
296 .id = -1,
297 .dev = {
298 .dma_mask = &common_dmamask,
299 .coherent_dma_mask = DMA_BIT_MASK(32),
300 },
301 .num_resources = ARRAY_SIZE(fb_resource),
302 .resource = fb_resource,
303};
304
305#define CMDLINE_DEVICE_CHOOSE(name, dev1, dev2) \
306 static char *cmdline_device_##name; \
307 static int cmdline_device_##name##_setup(char *dev) \
308 { \
309 cmdline_device_##name = dev + 1; \
310 return 0; \
311 } \
312 __setup(#name, cmdline_device_##name##_setup); \
313 int stmp3xxx_##name##_device_register(void) \
314 { \
315 struct platform_device *d = NULL; \
316 if (!cmdline_device_##name || \
317 !strcmp(cmdline_device_##name, #dev1)) \
318 d = &stmp3xxx_##dev1; \
319 else if (!strcmp(cmdline_device_##name, #dev2)) \
320 d = &stmp3xxx_##dev2; \
321 else \
322 printk(KERN_ERR"Unknown %s assignment '%s'.\n", \
323 #name, cmdline_device_##name); \
324 return d ? platform_device_register(d) : -ENOENT; \
325 }
326
327CMDLINE_DEVICE_CHOOSE(ssp1, mmc, spi1)
328CMDLINE_DEVICE_CHOOSE(ssp2, gpmi, spi2)
329
330struct platform_device stmp3xxx_backlight = {
331 .name = "stmp3xxx-bl",
332 .id = -1,
333};
334
335struct platform_device stmp3xxx_rotdec = {
336 .name = "stmp3xxx-rotdec",
337 .id = -1,
338};
339
340struct platform_device stmp3xxx_persistent = {
341 .name = "stmp3xxx-persistent",
342 .id = -1,
343};
344
345struct platform_device stmp3xxx_dcp_bootstream = {
346 .name = "stmp3xxx-dcpboot",
347 .id = -1,
348 .dev = {
349 .dma_mask = &common_dmamask,
350 .coherent_dma_mask = DMA_BIT_MASK(32),
351 },
352};
353
354static struct resource dcp_resources[] = {
355 {
356 .start = IRQ_DCP_VMI,
357 .end = IRQ_DCP_VMI,
358 .flags = IORESOURCE_IRQ,
359 }, {
360 .start = IRQ_DCP,
361 .end = IRQ_DCP,
362 .flags = IORESOURCE_IRQ,
363 },
364};
365
366struct platform_device stmp3xxx_dcp = {
367 .name = "stmp3xxx-dcp",
368 .id = -1,
369 .resource = dcp_resources,
370 .num_resources = ARRAY_SIZE(dcp_resources),
371 .dev = {
372 .dma_mask = &common_dmamask,
373 .coherent_dma_mask = DMA_BIT_MASK(32),
374 },
375};
376
377static struct resource battery_resource[] = {
378 {
379 .flags = IORESOURCE_IRQ,
380 .start = IRQ_VDD5V,
381 .end = IRQ_VDD5V,
382 },
383};
384
385struct platform_device stmp3xxx_battery = {
386 .name = "stmp3xxx-battery",
387 .resource = battery_resource,
388 .num_resources = ARRAY_SIZE(battery_resource),
389};
diff --git a/arch/arm/plat-stmp3xxx/dma.c b/arch/arm/plat-stmp3xxx/dma.c
new file mode 100644
index 000000000000..d2f497764dce
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/dma.c
@@ -0,0 +1,463 @@
1/*
2 * DMA helper routines for Freescale STMP37XX/STMP378X
3 *
4 * Author: dmitry pervushin <dpervushin@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/device.h>
20#include <linux/dmapool.h>
21#include <linux/sysdev.h>
22#include <linux/cpufreq.h>
23
24#include <asm/page.h>
25
26#include <mach/platform.h>
27#include <mach/dma.h>
28#include <mach/regs-apbx.h>
29#include <mach/regs-apbh.h>
30
31static const size_t pool_item_size = sizeof(struct stmp3xxx_dma_command);
32static const size_t pool_alignment = 8;
33static struct stmp3xxx_dma_user {
34 void *pool;
35 int inuse;
36 const char *name;
37} channels[MAX_DMA_CHANNELS];
38
39#define IS_VALID_CHANNEL(ch) ((ch) >= 0 && (ch) < MAX_DMA_CHANNELS)
40#define IS_USED(ch) (channels[ch].inuse)
41
42int stmp3xxx_dma_request(int ch, struct device *dev, const char *name)
43{
44 struct stmp3xxx_dma_user *user;
45 int err = 0;
46
47 user = channels + ch;
48 if (!IS_VALID_CHANNEL(ch)) {
49 err = -ENODEV;
50 goto out;
51 }
52 if (IS_USED(ch)) {
53 err = -EBUSY;
54 goto out;
55 }
56 /* Create a pool to allocate dma commands from */
57 user->pool = dma_pool_create(name, dev, pool_item_size,
58 pool_alignment, PAGE_SIZE);
59 if (user->pool == NULL) {
60 err = -ENOMEM;
61 goto out;
62 }
63 user->name = name;
64 user->inuse++;
65out:
66 return err;
67}
68EXPORT_SYMBOL(stmp3xxx_dma_request);
69
70int stmp3xxx_dma_release(int ch)
71{
72 struct stmp3xxx_dma_user *user = channels + ch;
73 int err = 0;
74
75 if (!IS_VALID_CHANNEL(ch)) {
76 err = -ENODEV;
77 goto out;
78 }
79 if (!IS_USED(ch)) {
80 err = -EBUSY;
81 goto out;
82 }
83 BUG_ON(user->pool == NULL);
84 dma_pool_destroy(user->pool);
85 user->inuse--;
86out:
87 return err;
88}
89EXPORT_SYMBOL(stmp3xxx_dma_release);
90
91int stmp3xxx_dma_read_semaphore(int channel)
92{
93 int sem = -1;
94
95 switch (STMP3XXX_DMA_BUS(channel)) {
96 case STMP3XXX_BUS_APBH:
97 sem = __raw_readl(REGS_APBH_BASE + HW_APBH_CHn_SEMA +
98 STMP3XXX_DMA_CHANNEL(channel) * 0x70);
99 sem &= BM_APBH_CHn_SEMA_PHORE;
100 sem >>= BP_APBH_CHn_SEMA_PHORE;
101 break;
102
103 case STMP3XXX_BUS_APBX:
104 sem = __raw_readl(REGS_APBX_BASE + HW_APBX_CHn_SEMA +
105 STMP3XXX_DMA_CHANNEL(channel) * 0x70);
106 sem &= BM_APBX_CHn_SEMA_PHORE;
107 sem >>= BP_APBX_CHn_SEMA_PHORE;
108 break;
109 default:
110 BUG();
111 }
112 return sem;
113}
114EXPORT_SYMBOL(stmp3xxx_dma_read_semaphore);
115
116int stmp3xxx_dma_allocate_command(int channel,
117 struct stmp3xxx_dma_descriptor *descriptor)
118{
119 struct stmp3xxx_dma_user *user = channels + channel;
120 int err = 0;
121
122 if (!IS_VALID_CHANNEL(channel)) {
123 err = -ENODEV;
124 goto out;
125 }
126 if (!IS_USED(channel)) {
127 err = -EBUSY;
128 goto out;
129 }
130 if (descriptor == NULL) {
131 err = -EINVAL;
132 goto out;
133 }
134
135 /* Allocate memory for a command from the buffer */
136 descriptor->command =
137 dma_pool_alloc(user->pool, GFP_KERNEL, &descriptor->handle);
138
139 /* Check it worked */
140 if (!descriptor->command) {
141 err = -ENOMEM;
142 goto out;
143 }
144
145 memset(descriptor->command, 0, pool_item_size);
146out:
147 WARN_ON(err);
148 return err;
149}
150EXPORT_SYMBOL(stmp3xxx_dma_allocate_command);
151
152int stmp3xxx_dma_free_command(int channel,
153 struct stmp3xxx_dma_descriptor *descriptor)
154{
155 int err = 0;
156
157 if (!IS_VALID_CHANNEL(channel)) {
158 err = -ENODEV;
159 goto out;
160 }
161 if (!IS_USED(channel)) {
162 err = -EBUSY;
163 goto out;
164 }
165
166 /* Return the command memory to the pool */
167 dma_pool_free(channels[channel].pool, descriptor->command,
168 descriptor->handle);
169
170 /* Initialise descriptor so we're not tempted to use it */
171 descriptor->command = NULL;
172 descriptor->handle = 0;
173 descriptor->virtual_buf_ptr = NULL;
174 descriptor->next_descr = NULL;
175
176 WARN_ON(err);
177out:
178 return err;
179}
180EXPORT_SYMBOL(stmp3xxx_dma_free_command);
181
182void stmp3xxx_dma_go(int channel,
183 struct stmp3xxx_dma_descriptor *head, u32 semaphore)
184{
185 int ch = STMP3XXX_DMA_CHANNEL(channel);
186 void __iomem *c, *s;
187
188 switch (STMP3XXX_DMA_BUS(channel)) {
189 case STMP3XXX_BUS_APBH:
190 c = REGS_APBH_BASE + HW_APBH_CHn_NXTCMDAR + 0x70 * ch;
191 s = REGS_APBH_BASE + HW_APBH_CHn_SEMA + 0x70 * ch;
192 break;
193
194 case STMP3XXX_BUS_APBX:
195 c = REGS_APBX_BASE + HW_APBX_CHn_NXTCMDAR + 0x70 * ch;
196 s = REGS_APBX_BASE + HW_APBX_CHn_SEMA + 0x70 * ch;
197 break;
198
199 default:
200 return;
201 }
202
203 /* Set next command */
204 __raw_writel(head->handle, c);
205 /* Set counting semaphore (kicks off transfer). Assumes
206 peripheral has been set up correctly */
207 __raw_writel(semaphore, s);
208}
209EXPORT_SYMBOL(stmp3xxx_dma_go);
210
211int stmp3xxx_dma_running(int channel)
212{
213 switch (STMP3XXX_DMA_BUS(channel)) {
214 case STMP3XXX_BUS_APBH:
215 return (__raw_readl(REGS_APBH_BASE + HW_APBH_CHn_SEMA +
216 0x70 * STMP3XXX_DMA_CHANNEL(channel))) &
217 BM_APBH_CHn_SEMA_PHORE;
218
219 case STMP3XXX_BUS_APBX:
220 return (__raw_readl(REGS_APBX_BASE + HW_APBX_CHn_SEMA +
221 0x70 * STMP3XXX_DMA_CHANNEL(channel))) &
222 BM_APBX_CHn_SEMA_PHORE;
223 default:
224 BUG();
225 return 0;
226 }
227}
228EXPORT_SYMBOL(stmp3xxx_dma_running);
229
230/*
231 * Circular dma chain management
232 */
233void stmp3xxx_dma_free_chain(struct stmp37xx_circ_dma_chain *chain)
234{
235 int i;
236
237 for (i = 0; i < chain->total_count; i++)
238 stmp3xxx_dma_free_command(
239 STMP3XXX_DMA(chain->channel, chain->bus),
240 &chain->chain[i]);
241}
242EXPORT_SYMBOL(stmp3xxx_dma_free_chain);
243
244int stmp3xxx_dma_make_chain(int ch, struct stmp37xx_circ_dma_chain *chain,
245 struct stmp3xxx_dma_descriptor descriptors[],
246 unsigned items)
247{
248 int i;
249 int err = 0;
250
251 if (items == 0)
252 return err;
253
254 for (i = 0; i < items; i++) {
255 err = stmp3xxx_dma_allocate_command(ch, &descriptors[i]);
256 if (err) {
257 WARN_ON(err);
258 /*
259 * Couldn't allocate the whole chain.
260 * deallocate what has been allocated
261 */
262 if (i) {
263 do {
264 stmp3xxx_dma_free_command(ch,
265 &descriptors
266 [i]);
267 } while (i-- >= 0);
268 }
269 return err;
270 }
271
272 /* link them! */
273 if (i > 0) {
274 descriptors[i - 1].next_descr = &descriptors[i];
275 descriptors[i - 1].command->next =
276 descriptors[i].handle;
277 }
278 }
279
280 /* make list circular */
281 descriptors[items - 1].next_descr = &descriptors[0];
282 descriptors[items - 1].command->next = descriptors[0].handle;
283
284 chain->total_count = items;
285 chain->chain = descriptors;
286 chain->free_index = 0;
287 chain->active_index = 0;
288 chain->cooked_index = 0;
289 chain->free_count = items;
290 chain->active_count = 0;
291 chain->cooked_count = 0;
292 chain->bus = STMP3XXX_DMA_BUS(ch);
293 chain->channel = STMP3XXX_DMA_CHANNEL(ch);
294 return err;
295}
296EXPORT_SYMBOL(stmp3xxx_dma_make_chain);
297
298void stmp37xx_circ_clear_chain(struct stmp37xx_circ_dma_chain *chain)
299{
300 BUG_ON(stmp3xxx_dma_running(STMP3XXX_DMA(chain->channel, chain->bus)));
301 chain->free_index = 0;
302 chain->active_index = 0;
303 chain->cooked_index = 0;
304 chain->free_count = chain->total_count;
305 chain->active_count = 0;
306 chain->cooked_count = 0;
307}
308EXPORT_SYMBOL(stmp37xx_circ_clear_chain);
309
310void stmp37xx_circ_advance_free(struct stmp37xx_circ_dma_chain *chain,
311 unsigned count)
312{
313 BUG_ON(chain->cooked_count < count);
314
315 chain->cooked_count -= count;
316 chain->cooked_index += count;
317 chain->cooked_index %= chain->total_count;
318 chain->free_count += count;
319}
320EXPORT_SYMBOL(stmp37xx_circ_advance_free);
321
322void stmp37xx_circ_advance_active(struct stmp37xx_circ_dma_chain *chain,
323 unsigned count)
324{
325 void __iomem *c;
326 u32 mask_clr, mask;
327 BUG_ON(chain->free_count < count);
328
329 chain->free_count -= count;
330 chain->free_index += count;
331 chain->free_index %= chain->total_count;
332 chain->active_count += count;
333
334 switch (chain->bus) {
335 case STMP3XXX_BUS_APBH:
336 c = REGS_APBH_BASE + HW_APBH_CHn_SEMA + 0x70 * chain->channel;
337 mask_clr = BM_APBH_CHn_SEMA_INCREMENT_SEMA;
338 mask = BF(count, APBH_CHn_SEMA_INCREMENT_SEMA);
339 break;
340 case STMP3XXX_BUS_APBX:
341 c = REGS_APBX_BASE + HW_APBX_CHn_SEMA + 0x70 * chain->channel;
342 mask_clr = BM_APBX_CHn_SEMA_INCREMENT_SEMA;
343 mask = BF(count, APBX_CHn_SEMA_INCREMENT_SEMA);
344 break;
345 default:
346 BUG();
347 return;
348 }
349
350 /* Set counting semaphore (kicks off transfer). Assumes
351 peripheral has been set up correctly */
352 stmp3xxx_clearl(mask_clr, c);
353 stmp3xxx_setl(mask, c);
354}
355EXPORT_SYMBOL(stmp37xx_circ_advance_active);
356
357unsigned stmp37xx_circ_advance_cooked(struct stmp37xx_circ_dma_chain *chain)
358{
359 unsigned cooked;
360
361 cooked = chain->active_count -
362 stmp3xxx_dma_read_semaphore(STMP3XXX_DMA(chain->channel, chain->bus));
363
364 chain->active_count -= cooked;
365 chain->active_index += cooked;
366 chain->active_index %= chain->total_count;
367
368 chain->cooked_count += cooked;
369
370 return cooked;
371}
372EXPORT_SYMBOL(stmp37xx_circ_advance_cooked);
373
374void stmp3xxx_dma_set_alt_target(int channel, int function)
375{
376#if defined(CONFIG_ARCH_STMP37XX)
377 unsigned bits = 4;
378#elif defined(CONFIG_ARCH_STMP378X)
379 unsigned bits = 2;
380#else
381#error wrong arch
382#endif
383 int shift = STMP3XXX_DMA_CHANNEL(channel) * bits;
384 unsigned mask = (1<<bits) - 1;
385 void __iomem *c;
386
387 BUG_ON(function < 0 || function >= (1<<bits));
388 pr_debug("%s: channel = %d, using mask %x, "
389 "shift = %d\n", __func__, channel, mask, shift);
390
391 switch (STMP3XXX_DMA_BUS(channel)) {
392 case STMP3XXX_BUS_APBH:
393 c = REGS_APBH_BASE + HW_APBH_DEVSEL;
394 break;
395 case STMP3XXX_BUS_APBX:
396 c = REGS_APBX_BASE + HW_APBX_DEVSEL;
397 break;
398 default:
399 BUG();
400 }
401 stmp3xxx_clearl(mask << shift, c);
402 stmp3xxx_setl(mask << shift, c);
403}
404EXPORT_SYMBOL(stmp3xxx_dma_set_alt_target);
405
406void stmp3xxx_dma_suspend(void)
407{
408 stmp3xxx_setl(BM_APBH_CTRL0_CLKGATE, REGS_APBH_BASE + HW_APBH_CTRL0);
409 stmp3xxx_setl(BM_APBX_CTRL0_CLKGATE, REGS_APBX_BASE + HW_APBX_CTRL0);
410}
411
412void stmp3xxx_dma_resume(void)
413{
414 stmp3xxx_clearl(BM_APBH_CTRL0_CLKGATE | BM_APBH_CTRL0_SFTRST,
415 REGS_APBH_BASE + HW_APBH_CTRL0);
416 stmp3xxx_clearl(BM_APBX_CTRL0_CLKGATE | BM_APBX_CTRL0_SFTRST,
417 REGS_APBX_BASE + HW_APBX_CTRL0);
418}
419
420#ifdef CONFIG_CPU_FREQ
421
422struct dma_notifier_block {
423 struct notifier_block nb;
424 void *data;
425};
426
427static int dma_cpufreq_notifier(struct notifier_block *self,
428 unsigned long phase, void *p)
429{
430 switch (phase) {
431 case CPUFREQ_POSTCHANGE:
432 stmp3xxx_dma_resume();
433 break;
434
435 case CPUFREQ_PRECHANGE:
436 stmp3xxx_dma_suspend();
437 break;
438
439 default:
440 break;
441 }
442
443 return NOTIFY_DONE;
444}
445
446static struct dma_notifier_block dma_cpufreq_nb = {
447 .nb = {
448 .notifier_call = dma_cpufreq_notifier,
449 },
450};
451#endif /* CONFIG_CPU_FREQ */
452
453void __init stmp3xxx_dma_init(void)
454{
455 stmp3xxx_clearl(BM_APBH_CTRL0_CLKGATE | BM_APBH_CTRL0_SFTRST,
456 REGS_APBH_BASE + HW_APBH_CTRL0);
457 stmp3xxx_clearl(BM_APBX_CTRL0_CLKGATE | BM_APBX_CTRL0_SFTRST,
458 REGS_APBX_BASE + HW_APBX_CTRL0);
459#ifdef CONFIG_CPU_FREQ
460 cpufreq_register_notifier(&dma_cpufreq_nb.nb,
461 CPUFREQ_TRANSITION_NOTIFIER);
462#endif /* CONFIG_CPU_FREQ */
463}
diff --git a/arch/arm/plat-stmp3xxx/include/mach/clkdev.h b/arch/arm/plat-stmp3xxx/include/mach/clkdev.h
new file mode 100644
index 000000000000..f9c39772d7c5
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/clkdev.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12#ifndef __ASM_MACH_CLKDEV_H
13#define __ASM_MACH_CLKDEV_H
14
15#define __clk_get(clk) ({ 1; })
16#define __clk_put(clk) do { } while (0)
17
18#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/cputype.h b/arch/arm/plat-stmp3xxx/include/mach/cputype.h
new file mode 100644
index 000000000000..b4e205b95f2c
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/cputype.h
@@ -0,0 +1,33 @@
1/*
2 * Freescale STMP37XX/STMP378X CPU type detection
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_CPU_H
19#define __ASM_PLAT_CPU_H
20
21#ifdef CONFIG_ARCH_STMP37XX
22#define cpu_is_stmp37xx() (1)
23#else
24#define cpu_is_stmp37xx() (0)
25#endif
26
27#ifdef CONFIG_ARCH_STMP378X
28#define cpu_is_stmp378x() (1)
29#else
30#define cpu_is_stmp378x() (0)
31#endif
32
33#endif /* __ASM_PLAT_CPU_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/debug-macro.S b/arch/arm/plat-stmp3xxx/include/mach/debug-macro.S
new file mode 100644
index 000000000000..fb3b969bf0a2
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/debug-macro.S
@@ -0,0 +1,42 @@
1/*
2 * Debugging macro include header
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19 .macro addruart,rx
20 mrc p15, 0, \rx, c1, c0
21 tst \rx, #1 @ MMU enabled?
22 moveq \rx, #0x80000000 @ physical base address
23 addeq \rx, \rx, #0x00070000
24 movne \rx, #0xf0000000 @ virtual base
25 addne \rx, \rx, #0x00070000
26 .endm
27
28 .macro senduart,rd,rx
29 strb \rd, [\rx, #0] @ data register at 0
30 .endm
31
32 .macro waituart,rd,rx
331001: ldr \rd, [\rx, #0x18] @ UARTFLG
34 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
35 bne 1001b
36 .endm
37
38 .macro busyuart,rd,rx
391001: ldr \rd, [\rx, #0x18] @ UARTFLG
40 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
41 bne 1001b
42 .endm
diff --git a/arch/arm/plat-stmp3xxx/include/mach/dma.h b/arch/arm/plat-stmp3xxx/include/mach/dma.h
new file mode 100644
index 000000000000..7c58557c6766
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/dma.h
@@ -0,0 +1,153 @@
1/*
2 * Freescale STMP37XX/STMP378X DMA helper interface
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_STMP3XXX_DMA_H
19#define __ASM_PLAT_STMP3XXX_DMA_H
20
21#include <linux/platform_device.h>
22#include <linux/dmapool.h>
23
24#if !defined(MAX_PIO_WORDS)
25#define MAX_PIO_WORDS (15)
26#endif
27
28#define STMP3XXX_BUS_APBH 0
29#define STMP3XXX_BUS_APBX 1
30#define STMP3XXX_DMA_MAX_CHANNEL 16
31#define STMP3XXX_DMA_BUS(dma) ((dma) / 16)
32#define STMP3XXX_DMA_CHANNEL(dma) ((dma) % 16)
33#define STMP3XXX_DMA(channel, bus) ((bus) * 16 + (channel))
34#define MAX_DMA_ADDRESS 0xffffffff
35#define MAX_DMA_CHANNELS 32
36
37struct stmp3xxx_dma_command {
38 u32 next;
39 u32 cmd;
40 union {
41 u32 buf_ptr;
42 u32 alternate;
43 };
44 u32 pio_words[MAX_PIO_WORDS];
45};
46
47struct stmp3xxx_dma_descriptor {
48 struct stmp3xxx_dma_command *command;
49 dma_addr_t handle;
50
51 /* The virtual address of the buffer pointer */
52 void *virtual_buf_ptr;
53 /* The next descriptor in a the DMA chain (optional) */
54 struct stmp3xxx_dma_descriptor *next_descr;
55};
56
57struct stmp37xx_circ_dma_chain {
58 unsigned total_count;
59 struct stmp3xxx_dma_descriptor *chain;
60
61 unsigned free_index;
62 unsigned free_count;
63 unsigned active_index;
64 unsigned active_count;
65 unsigned cooked_index;
66 unsigned cooked_count;
67
68 int bus;
69 unsigned channel;
70};
71
72static inline struct stmp3xxx_dma_descriptor
73 *stmp3xxx_dma_circ_get_free_head(struct stmp37xx_circ_dma_chain *chain)
74{
75 return &(chain->chain[chain->free_index]);
76}
77
78static inline struct stmp3xxx_dma_descriptor
79 *stmp3xxx_dma_circ_get_cooked_head(struct stmp37xx_circ_dma_chain *chain)
80{
81 return &(chain->chain[chain->cooked_index]);
82}
83
84int stmp3xxx_dma_request(int ch, struct device *dev, const char *name);
85int stmp3xxx_dma_release(int ch);
86int stmp3xxx_dma_allocate_command(int ch,
87 struct stmp3xxx_dma_descriptor *descriptor);
88int stmp3xxx_dma_free_command(int ch,
89 struct stmp3xxx_dma_descriptor *descriptor);
90void stmp3xxx_dma_continue(int channel, u32 semaphore);
91void stmp3xxx_dma_go(int ch, struct stmp3xxx_dma_descriptor *head,
92 u32 semaphore);
93int stmp3xxx_dma_running(int ch);
94int stmp3xxx_dma_make_chain(int ch, struct stmp37xx_circ_dma_chain *chain,
95 struct stmp3xxx_dma_descriptor descriptors[],
96 unsigned items);
97void stmp3xxx_dma_free_chain(struct stmp37xx_circ_dma_chain *chain);
98void stmp37xx_circ_clear_chain(struct stmp37xx_circ_dma_chain *chain);
99void stmp37xx_circ_advance_free(struct stmp37xx_circ_dma_chain *chain,
100 unsigned count);
101void stmp37xx_circ_advance_active(struct stmp37xx_circ_dma_chain *chain,
102 unsigned count);
103unsigned stmp37xx_circ_advance_cooked(struct stmp37xx_circ_dma_chain *chain);
104int stmp3xxx_dma_read_semaphore(int ch);
105void stmp3xxx_dma_init(void);
106void stmp3xxx_dma_set_alt_target(int ch, int target);
107void stmp3xxx_dma_suspend(void);
108void stmp3xxx_dma_resume(void);
109
110/*
111 * STMP37xx and STMP378x have different DMA control
112 * registers layout
113 */
114
115void stmp3xxx_arch_dma_freeze(int ch);
116void stmp3xxx_arch_dma_unfreeze(int ch);
117void stmp3xxx_arch_dma_reset_channel(int ch);
118void stmp3xxx_arch_dma_enable_interrupt(int ch);
119void stmp3xxx_arch_dma_clear_interrupt(int ch);
120int stmp3xxx_arch_dma_is_interrupt(int ch);
121
122static inline void stmp3xxx_dma_reset_channel(int ch)
123{
124 stmp3xxx_arch_dma_reset_channel(ch);
125}
126
127
128static inline void stmp3xxx_dma_freeze(int ch)
129{
130 stmp3xxx_arch_dma_freeze(ch);
131}
132
133static inline void stmp3xxx_dma_unfreeze(int ch)
134{
135 stmp3xxx_arch_dma_unfreeze(ch);
136}
137
138static inline void stmp3xxx_dma_enable_interrupt(int ch)
139{
140 stmp3xxx_arch_dma_enable_interrupt(ch);
141}
142
143static inline void stmp3xxx_dma_clear_interrupt(int ch)
144{
145 stmp3xxx_arch_dma_clear_interrupt(ch);
146}
147
148static inline int stmp3xxx_dma_is_interrupt(int ch)
149{
150 return stmp3xxx_arch_dma_is_interrupt(ch);
151}
152
153#endif /* __ASM_PLAT_STMP3XXX_DMA_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/gpio.h b/arch/arm/plat-stmp3xxx/include/mach/gpio.h
new file mode 100644
index 000000000000..a8b579256170
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/gpio.h
@@ -0,0 +1,28 @@
1/*
2 * Freescale STMP37XX/STMP378X GPIO interface
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_GPIO_H
19#define __ASM_PLAT_GPIO_H
20
21#define ARCH_NR_GPIOS (32 * 3)
22#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
23#define gpio_get_value(gpio) __gpio_get_value(gpio)
24#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
25
26#include <asm-generic/gpio.h>
27
28#endif /* __ASM_PLAT_GPIO_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/gpmi.h b/arch/arm/plat-stmp3xxx/include/mach/gpmi.h
new file mode 100644
index 000000000000..e166432910ad
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/gpmi.h
@@ -0,0 +1,12 @@
1#ifndef __MACH_GPMI_H
2
3#include <linux/mtd/partitions.h>
4#include <mach/regs-gpmi.h>
5
6struct gpmi_platform_data {
7 void *pins;
8 int nr_parts;
9 struct mtd_partition *parts;
10 const char *part_types[];
11};
12#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/hardware.h b/arch/arm/plat-stmp3xxx/include/mach/hardware.h
new file mode 100644
index 000000000000..47b8978405bc
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/hardware.h
@@ -0,0 +1,32 @@
1/*
2 * This file contains the hardware definitions of the Freescale STMP3XXX
3 *
4 * Copyright (C) 2005 Sigmatel Inc
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_ARCH_HARDWARE_H
19#define __ASM_ARCH_HARDWARE_H
20
21/*
22 * Where in virtual memory the IO devices (timers, system controllers
23 * and so on)
24 */
25#define IO_BASE 0xF0000000 /* VA of IO */
26#define IO_SIZE 0x00100000 /* How much? */
27#define IO_START 0x80000000 /* PA of IO */
28
29/* macro to get at IO space when running virtually */
30#define IO_ADDRESS(x) (((x) & 0x000fffff) | IO_BASE)
31
32#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/io.h b/arch/arm/plat-stmp3xxx/include/mach/io.h
new file mode 100644
index 000000000000..d08b1b7f3d1c
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/io.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2005 Sigmatel Inc
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 */
7
8/*
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16#ifndef __ASM_ARM_ARCH_IO_H
17#define __ASM_ARM_ARCH_IO_H
18
19#define IO_SPACE_LIMIT 0xffffffff
20
21#define __io(a) __typesafe_io(a)
22#define __mem_pci(a) (a)
23#define __mem_isa(a) (a)
24
25#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/memory.h b/arch/arm/plat-stmp3xxx/include/mach/memory.h
new file mode 100644
index 000000000000..7b875a07a1a7
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/memory.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 */
5
6/*
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14#ifndef __ASM_ARCH_MEMORY_H
15#define __ASM_ARCH_MEMORY_H
16
17/*
18 * Physical DRAM offset.
19 */
20#define PHYS_OFFSET UL(0x40000000)
21
22#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/mmc.h b/arch/arm/plat-stmp3xxx/include/mach/mmc.h
new file mode 100644
index 000000000000..ba81e1543761
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/mmc.h
@@ -0,0 +1,14 @@
1#ifndef _MACH_MMC_H
2#define _MACH_MMC_H
3
4#include <mach/regs-ssp.h>
5
6struct stmp3xxxmmc_platform_data {
7 int (*get_wp)(void);
8 unsigned long (*setclock)(void __iomem *base, unsigned long);
9 void (*cmd_pullup)(int);
10 int (*hw_init)(void);
11 void (*hw_release)(void);
12};
13
14#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/pinmux.h b/arch/arm/plat-stmp3xxx/include/mach/pinmux.h
new file mode 100644
index 000000000000..cc5af82279ad
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/pinmux.h
@@ -0,0 +1,157 @@
1/*
2 * Freescale STMP37XX/STMP378X Pin Multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __PINMUX_H
19#define __PINMUX_H
20
21#include <linux/spinlock.h>
22#include <linux/types.h>
23#include <linux/gpio.h>
24#include <asm-generic/gpio.h>
25
26/* Pin definitions */
27#include "pins.h"
28#include <mach/pins.h>
29
30/*
31 * Each pin may be routed up to four different HW interfaces
32 * including GPIO
33 */
34enum pin_fun {
35 PIN_FUN1 = 0,
36 PIN_FUN2,
37 PIN_FUN3,
38 PIN_GPIO,
39};
40
41/*
42 * Each pin may have different output drive strength in range from
43 * 4mA to 20mA. The most common case is 4, 8 and 12 mA strengths.
44 */
45enum pin_strength {
46 PIN_4MA = 0,
47 PIN_8MA,
48 PIN_12MA,
49 PIN_16MA,
50 PIN_20MA,
51};
52
53/*
54 * Each pin can be programmed for 1.8V or 3.3V
55 */
56enum pin_voltage {
57 PIN_1_8V = 0,
58 PIN_3_3V,
59};
60
61/*
62 * Structure to define a group of pins and their parameters
63 */
64struct pin_desc {
65 unsigned id;
66 enum pin_fun fun;
67 enum pin_strength strength;
68 enum pin_voltage voltage;
69 unsigned pullup:1;
70};
71
72struct pin_group {
73 struct pin_desc *pins;
74 int nr_pins;
75};
76
77/* Set pin drive strength */
78void stmp3xxx_pin_strength(unsigned id, enum pin_strength strength,
79 const char *label);
80
81/* Set pin voltage */
82void stmp3xxx_pin_voltage(unsigned id, enum pin_voltage voltage,
83 const char *label);
84
85/* Enable pull-up resistor for a pin */
86void stmp3xxx_pin_pullup(unsigned id, int enable, const char *label);
87
88/*
89 * Request a pin ownership, only one module (identified by @label)
90 * may own a pin.
91 */
92int stmp3xxx_request_pin(unsigned id, enum pin_fun fun, const char *label);
93
94/* Release pin */
95void stmp3xxx_release_pin(unsigned id, const char *label);
96
97void stmp3xxx_set_pin_type(unsigned id, enum pin_fun fun);
98
99/*
100 * Each bank is associated with a number of registers to control
101 * pin function, drive strength, voltage and pull-up reigster. The
102 * number of registers of a given type depends on the number of bits
103 * describin particular pin.
104 */
105#define HW_MUXSEL_NUM 2 /* registers per bank */
106#define HW_MUXSEL_PIN_LEN 2 /* bits per pin */
107#define HW_MUXSEL_PIN_NUM 16 /* pins per register */
108#define HW_MUXSEL_PINFUN_MASK 0x3 /* pin function mask */
109#define HW_MUXSEL_PINFUN_NUM 4 /* four options for a pin */
110
111#define HW_DRIVE_NUM 4 /* registers per bank */
112#define HW_DRIVE_PIN_LEN 4 /* bits per pin */
113#define HW_DRIVE_PIN_NUM 8 /* pins per register */
114#define HW_DRIVE_PINDRV_MASK 0x3 /* pin strength mask - 2 bits */
115#define HW_DRIVE_PINDRV_NUM 5 /* five possible strength values */
116#define HW_DRIVE_PINV_MASK 0x4 /* pin voltage mask - 1 bit */
117
118
119struct stmp3xxx_pinmux_bank {
120 struct gpio_chip chip;
121
122 /* Pins allocation map */
123 unsigned long pin_map;
124
125 /* Pin owner names */
126 const char *pin_labels[32];
127
128 /* Bank registers */
129 void __iomem *hw_muxsel[HW_MUXSEL_NUM];
130 void __iomem *hw_drive[HW_DRIVE_NUM];
131 void __iomem *hw_pull;
132
133 void __iomem *pin2irq,
134 *irqlevel,
135 *irqpolarity,
136 *irqen,
137 *irqstat;
138
139 /* HW MUXSEL register function bit values */
140 u8 functions[HW_MUXSEL_PINFUN_NUM];
141
142 /*
143 * HW DRIVE register strength bit values:
144 * 0xff - requested strength is not supported for this bank
145 */
146 u8 strengths[HW_DRIVE_PINDRV_NUM];
147
148 /* GPIO things */
149 void __iomem *hw_gpio_in,
150 *hw_gpio_out,
151 *hw_gpio_doe;
152 int irq, virq;
153};
154
155int __init stmp3xxx_pinmux_init(int virtual_irq_start);
156
157#endif /* __PINMUX_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/pins.h b/arch/arm/plat-stmp3xxx/include/mach/pins.h
new file mode 100644
index 000000000000..c573318e1caa
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/pins.h
@@ -0,0 +1,30 @@
1/*
2 * Freescale STMP37XX/STMP378X Pin multiplexing interface definitions
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_PINS_H
19#define __ASM_PLAT_PINS_H
20
21#define STMP3XXX_PINID(bank, pin) (bank * 32 + pin)
22#define STMP3XXX_PINID_TO_BANK(pinid) (pinid / 32)
23#define STMP3XXX_PINID_TO_PINNUM(pinid) (pinid % 32)
24
25/*
26 * Special invalid pin identificator to show a pin doesn't exist
27 */
28#define PINID_NO_PIN STMP3XXX_PINID(0xFF, 0xFF)
29
30#endif /* __ASM_PLAT_PINS_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/platform.h b/arch/arm/plat-stmp3xxx/include/mach/platform.h
new file mode 100644
index 000000000000..7007ddaa91eb
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/platform.h
@@ -0,0 +1,68 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 */
5
6/*
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14#ifndef __ASM_PLAT_PLATFORM_H
15#define __ASM_PLAT_PLATFORM_H
16
17#ifndef __ASSEMBLER__
18#include <linux/io.h>
19#endif
20#include <asm/sizes.h>
21
22/* Virtual address where registers are mapped */
23#define STMP3XXX_REGS_PHBASE 0x80000000
24#ifdef __ASSEMBLER__
25#define STMP3XXX_REGS_BASE 0xF0000000
26#else
27#define STMP3XXX_REGS_BASE (void __iomem *)0xF0000000
28#endif
29#define STMP3XXX_REGS_SIZE SZ_1M
30
31/* Virtual address where OCRAM is mapped */
32#define STMP3XXX_OCRAM_PHBASE 0x00000000
33#ifdef __ASSEMBLER__
34#define STMP3XXX_OCRAM_BASE 0xf1000000
35#else
36#define STMP3XXX_OCRAM_BASE (void __iomem *)0xf1000000
37#endif
38#define STMP3XXX_OCRAM_SIZE (32 * SZ_1K)
39
40#ifdef CONFIG_ARCH_STMP37XX
41#define IRQ_PRIORITY_REG_RD HW_ICOLL_PRIORITYn_RD
42#define IRQ_PRIORITY_REG_WR HW_ICOLL_PRIORITYn_WR
43#endif
44
45#ifdef CONFIG_ARCH_STMP378X
46#define IRQ_PRIORITY_REG_RD HW_ICOLL_INTERRUPTn_RD
47#define IRQ_PRIORITY_REG_WR HW_ICOLL_INTERRUPTn_WR
48#endif
49
50#define HW_STMP3XXX_SET 0x04
51#define HW_STMP3XXX_CLR 0x08
52#define HW_STMP3XXX_TOG 0x0c
53
54#ifndef __ASSEMBLER__
55static inline void stmp3xxx_clearl(u32 v, void __iomem *r)
56{
57 __raw_writel(v, r + HW_STMP3XXX_CLR);
58}
59
60static inline void stmp3xxx_setl(u32 v, void __iomem *r)
61{
62 __raw_writel(v, r + HW_STMP3XXX_SET);
63}
64#endif
65
66#define BF(value, field) (((value) << BP_##field) & BM_##field)
67
68#endif /* __ASM_ARCH_PLATFORM_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h b/arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h
new file mode 100644
index 000000000000..2e300feaa4cf
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h
@@ -0,0 +1,54 @@
1/*
2 * Freescale STMP37XX/STMP378X core structure and function declarations
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_STMP3XXX_H
19#define __ASM_PLAT_STMP3XXX_H
20
21#include <linux/irq.h>
22
23extern struct sys_timer stmp3xxx_timer;
24
25void stmp3xxx_init_irq(struct irq_chip *chip);
26void stmp3xxx_init(void);
27int stmp3xxx_reset_block(void __iomem *hwreg, int just_enable);
28extern struct platform_device stmp3xxx_dbguart,
29 stmp3xxx_appuart,
30 stmp3xxx_watchdog,
31 stmp3xxx_touchscreen,
32 stmp3xxx_keyboard,
33 stmp3xxx_gpmi,
34 stmp3xxx_mmc,
35 stmp3xxx_udc,
36 stmp3xxx_ehci,
37 stmp3xxx_rtc,
38 stmp3xxx_spi1,
39 stmp3xxx_spi2,
40 stmp3xxx_backlight,
41 stmp3xxx_rotdec,
42 stmp3xxx_dcp,
43 stmp3xxx_dcp_bootstream,
44 stmp3xxx_persistent,
45 stmp3xxx_framebuffer,
46 stmp3xxx_battery;
47int stmp3xxx_ssp1_device_register(void);
48int stmp3xxx_ssp2_device_register(void);
49
50struct pin_group;
51void stmp3xxx_release_pin_group(struct pin_group *pin_group, const char *label);
52int stmp3xxx_request_pin_group(struct pin_group *pin_group, const char *label);
53
54#endif /* __ASM_PLAT_STMP3XXX_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/system.h b/arch/arm/plat-stmp3xxx/include/mach/system.h
new file mode 100644
index 000000000000..28a988889319
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/system.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2005 Sigmatel Inc
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 */
7
8/*
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16#ifndef __ASM_ARCH_SYSTEM_H
17#define __ASM_ARCH_SYSTEM_H
18
19#include <asm/proc-fns.h>
20#include <mach/platform.h>
21#include <mach/regs-clkctrl.h>
22#include <mach/regs-power.h>
23
24static inline void arch_idle(void)
25{
26 /*
27 * This should do all the clock switching
28 * and wait for interrupt tricks
29 */
30
31 cpu_do_idle();
32}
33
34static inline void arch_reset(char mode, const char *cmd)
35{
36 /* Set BATTCHRG to default value */
37 __raw_writel(0x00010000, REGS_POWER_BASE + HW_POWER_CHARGE);
38
39 /* Set MINPWR to default value */
40 __raw_writel(0, REGS_POWER_BASE + HW_POWER_MINPWR);
41
42 /* Reset digital side of chip (but not power or RTC) */
43 __raw_writel(BM_CLKCTRL_RESET_DIG,
44 REGS_CLKCTRL_BASE + HW_CLKCTRL_RESET);
45
46 /* Should not return */
47}
48
49#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/timex.h b/arch/arm/plat-stmp3xxx/include/mach/timex.h
new file mode 100644
index 000000000000..3373985d7a8e
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/timex.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 */
7
8/*
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16
17/*
18 * System time clock is sourced from the 32k clock
19 */
20#define CLOCK_TICK_RATE (32768)
diff --git a/arch/arm/plat-stmp3xxx/include/mach/uncompress.h b/arch/arm/plat-stmp3xxx/include/mach/uncompress.h
new file mode 100644
index 000000000000..f79f5ee56cd4
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/uncompress.h
@@ -0,0 +1,53 @@
1/*
2 *
3 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
5 */
6
7/*
8 * The code contained herein is licensed under the GNU General Public
9 * License. You may obtain a copy of the GNU General Public License
10 * Version 2 or later at the following locations:
11 *
12 * http://www.opensource.org/licenses/gpl-license.html
13 * http://www.gnu.org/copyleft/gpl.html
14 */
15#ifndef __ASM_PLAT_UNCOMPRESS_H
16#define __ASM_PLAT_UNCOMPRESS_H
17
18/*
19 * Register includes are for when the MMU enabled; we need to define our
20 * own stuff here for pre-MMU use
21 */
22#define UARTDBG_BASE 0x80070000
23#define UART(c) (((volatile unsigned *)UARTDBG_BASE)[c])
24
25/*
26 * This does not append a newline
27 */
28static void putc(char c)
29{
30 /* Wait for TX fifo empty */
31 while ((UART(6) & (1<<7)) == 0)
32 continue;
33
34 /* Write byte */
35 UART(0) = c;
36
37 /* Wait for last bit to exit the UART */
38 while (UART(6) & (1<<3))
39 continue;
40}
41
42static void flush(void)
43{
44}
45
46/*
47 * nothing to do
48 */
49#define arch_decomp_setup()
50
51#define arch_decomp_wdog()
52
53#endif /* __ASM_PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
new file mode 100644
index 000000000000..541b880c1863
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
@@ -0,0 +1,12 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12#define VMALLOC_END (0xF0000000)
diff --git a/arch/arm/plat-stmp3xxx/irq.c b/arch/arm/plat-stmp3xxx/irq.c
new file mode 100644
index 000000000000..20de4e0401ef
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/irq.c
@@ -0,0 +1,51 @@
1/*
2 * Freescale STMP37XX/STMP378X common interrupt handling code
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/delay.h>
21#include <linux/irq.h>
22#include <linux/sysdev.h>
23
24#include <mach/stmp3xxx.h>
25#include <mach/platform.h>
26#include <mach/regs-icoll.h>
27
28void __init stmp3xxx_init_irq(struct irq_chip *chip)
29{
30 unsigned int i, lv;
31
32 /* Reset the interrupt controller */
33 stmp3xxx_reset_block(REGS_ICOLL_BASE + HW_ICOLL_CTRL, true);
34
35 /* Disable all interrupts initially */
36 for (i = 0; i < NR_REAL_IRQS; i++) {
37 chip->mask(i);
38 set_irq_chip(i, chip);
39 set_irq_handler(i, handle_level_irq);
40 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
41 }
42
43 /* Ensure vector is cleared */
44 for (lv = 0; lv < 4; lv++)
45 __raw_writel(1 << lv, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK);
46 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR);
47
48 /* Barrier */
49 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT);
50}
51
diff --git a/arch/arm/plat-stmp3xxx/pinmux.c b/arch/arm/plat-stmp3xxx/pinmux.c
new file mode 100644
index 000000000000..d41200382208
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/pinmux.c
@@ -0,0 +1,552 @@
1/*
2 * Freescale STMP378X/STMP378X Pin Multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#define DEBUG
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/errno.h>
22#include <linux/sysdev.h>
23#include <linux/string.h>
24#include <linux/bitops.h>
25#include <linux/sysdev.h>
26#include <linux/irq.h>
27
28#include <mach/hardware.h>
29#include <mach/platform.h>
30#include <mach/regs-pinctrl.h>
31#include <mach/pins.h>
32#include <mach/pinmux.h>
33
34#define NR_BANKS ARRAY_SIZE(pinmux_banks)
35static struct stmp3xxx_pinmux_bank pinmux_banks[] = {
36 [0] = {
37 .hw_muxsel = {
38 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL0,
39 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL1,
40 },
41 .hw_drive = {
42 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE0,
43 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE1,
44 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE2,
45 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE3,
46 },
47 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL0,
48 .functions = { 0x0, 0x1, 0x2, 0x3 },
49 .strengths = { 0x0, 0x1, 0x2, 0x3, 0xff },
50
51 .hw_gpio_in = REGS_PINCTRL_BASE + HW_PINCTRL_DIN0,
52 .hw_gpio_out = REGS_PINCTRL_BASE + HW_PINCTRL_DOUT0,
53 .hw_gpio_doe = REGS_PINCTRL_BASE + HW_PINCTRL_DOE0,
54 .irq = IRQ_GPIO0,
55
56 .pin2irq = REGS_PINCTRL_BASE + HW_PINCTRL_PIN2IRQ0,
57 .irqstat = REGS_PINCTRL_BASE + HW_PINCTRL_IRQSTAT0,
58 .irqlevel = REGS_PINCTRL_BASE + HW_PINCTRL_IRQLEVEL0,
59 .irqpolarity = REGS_PINCTRL_BASE + HW_PINCTRL_IRQPOL0,
60 .irqen = REGS_PINCTRL_BASE + HW_PINCTRL_IRQEN0,
61 },
62 [1] = {
63 .hw_muxsel = {
64 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL2,
65 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL3,
66 },
67 .hw_drive = {
68 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE4,
69 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE5,
70 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE6,
71 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE7,
72 },
73 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL1,
74 .functions = { 0x0, 0x1, 0x2, 0x3 },
75 .strengths = { 0x0, 0x1, 0x2, 0x3, 0xff },
76
77 .hw_gpio_in = REGS_PINCTRL_BASE + HW_PINCTRL_DIN1,
78 .hw_gpio_out = REGS_PINCTRL_BASE + HW_PINCTRL_DOUT1,
79 .hw_gpio_doe = REGS_PINCTRL_BASE + HW_PINCTRL_DOE1,
80 .irq = IRQ_GPIO1,
81
82 .pin2irq = REGS_PINCTRL_BASE + HW_PINCTRL_PIN2IRQ1,
83 .irqstat = REGS_PINCTRL_BASE + HW_PINCTRL_IRQSTAT1,
84 .irqlevel = REGS_PINCTRL_BASE + HW_PINCTRL_IRQLEVEL1,
85 .irqpolarity = REGS_PINCTRL_BASE + HW_PINCTRL_IRQPOL1,
86 .irqen = REGS_PINCTRL_BASE + HW_PINCTRL_IRQEN1,
87 },
88 [2] = {
89 .hw_muxsel = {
90 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL4,
91 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL5,
92 },
93 .hw_drive = {
94 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE8,
95 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE9,
96 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE10,
97 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE11,
98 },
99 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL2,
100 .functions = { 0x0, 0x1, 0x2, 0x3 },
101 .strengths = { 0x0, 0x1, 0x2, 0x1, 0x2 },
102
103 .hw_gpio_in = REGS_PINCTRL_BASE + HW_PINCTRL_DIN2,
104 .hw_gpio_out = REGS_PINCTRL_BASE + HW_PINCTRL_DOUT2,
105 .hw_gpio_doe = REGS_PINCTRL_BASE + HW_PINCTRL_DOE2,
106 .irq = IRQ_GPIO2,
107
108 .pin2irq = REGS_PINCTRL_BASE + HW_PINCTRL_PIN2IRQ2,
109 .irqstat = REGS_PINCTRL_BASE + HW_PINCTRL_IRQSTAT2,
110 .irqlevel = REGS_PINCTRL_BASE + HW_PINCTRL_IRQLEVEL2,
111 .irqpolarity = REGS_PINCTRL_BASE + HW_PINCTRL_IRQPOL2,
112 .irqen = REGS_PINCTRL_BASE + HW_PINCTRL_IRQEN2,
113 },
114 [3] = {
115 .hw_muxsel = {
116 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL6,
117 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL7,
118 },
119 .hw_drive = {
120 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE12,
121 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE13,
122 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE14,
123 NULL,
124 },
125 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL3,
126 .functions = {0x0, 0x1, 0x2, 0x3},
127 .strengths = {0x0, 0x1, 0x2, 0x3, 0xff},
128 },
129};
130
131static inline struct stmp3xxx_pinmux_bank *
132stmp3xxx_pinmux_bank(unsigned id, unsigned *bank, unsigned *pin)
133{
134 unsigned b, p;
135
136 b = STMP3XXX_PINID_TO_BANK(id);
137 p = STMP3XXX_PINID_TO_PINNUM(id);
138 BUG_ON(b >= NR_BANKS);
139 if (bank)
140 *bank = b;
141 if (pin)
142 *pin = p;
143 return &pinmux_banks[b];
144}
145
146/* Check if requested pin is owned by caller */
147static int stmp3xxx_check_pin(unsigned id, const char *label)
148{
149 unsigned pin;
150 struct stmp3xxx_pinmux_bank *pm = stmp3xxx_pinmux_bank(id, NULL, &pin);
151
152 if (!test_bit(pin, &pm->pin_map)) {
153 printk(KERN_WARNING
154 "%s: Accessing free pin %x, caller %s\n",
155 __func__, id, label);
156
157 return -EINVAL;
158 }
159
160 if (label && pm->pin_labels[pin] &&
161 strcmp(label, pm->pin_labels[pin])) {
162 printk(KERN_WARNING
163 "%s: Wrong pin owner %x, caller %s owner %s\n",
164 __func__, id, label, pm->pin_labels[pin]);
165
166 return -EINVAL;
167 }
168 return 0;
169}
170
171void stmp3xxx_pin_strength(unsigned id, enum pin_strength strength,
172 const char *label)
173{
174 struct stmp3xxx_pinmux_bank *pbank;
175 void __iomem *hwdrive;
176 u32 shift, val;
177 u32 bank, pin;
178
179 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
180 pr_debug("%s: label %s bank %d pin %d strength %d\n", __func__, label,
181 bank, pin, strength);
182
183 hwdrive = pbank->hw_drive[pin / HW_DRIVE_PIN_NUM];
184 shift = (pin % HW_DRIVE_PIN_NUM) * HW_DRIVE_PIN_LEN;
185 val = pbank->strengths[strength];
186 if (val == 0xff) {
187 printk(KERN_WARNING
188 "%s: strength is not supported for bank %d, caller %s",
189 __func__, bank, label);
190 return;
191 }
192
193 if (stmp3xxx_check_pin(id, label))
194 return;
195
196 pr_debug("%s: writing 0x%x to 0x%p register\n", __func__,
197 val << shift, hwdrive);
198 stmp3xxx_clearl(HW_DRIVE_PINDRV_MASK << shift, hwdrive);
199 stmp3xxx_setl(val << shift, hwdrive);
200}
201
202void stmp3xxx_pin_voltage(unsigned id, enum pin_voltage voltage,
203 const char *label)
204{
205 struct stmp3xxx_pinmux_bank *pbank;
206 void __iomem *hwdrive;
207 u32 shift;
208 u32 bank, pin;
209
210 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
211 pr_debug("%s: label %s bank %d pin %d voltage %d\n", __func__, label,
212 bank, pin, voltage);
213
214 hwdrive = pbank->hw_drive[pin / HW_DRIVE_PIN_NUM];
215 shift = (pin % HW_DRIVE_PIN_NUM) * HW_DRIVE_PIN_LEN;
216
217 if (stmp3xxx_check_pin(id, label))
218 return;
219
220 pr_debug("%s: changing 0x%x bit in 0x%p register\n",
221 __func__, HW_DRIVE_PINV_MASK << shift, hwdrive);
222 if (voltage == PIN_1_8V)
223 stmp3xxx_clearl(HW_DRIVE_PINV_MASK << shift, hwdrive);
224 else
225 stmp3xxx_setl(HW_DRIVE_PINV_MASK << shift, hwdrive);
226}
227
228void stmp3xxx_pin_pullup(unsigned id, int enable, const char *label)
229{
230 struct stmp3xxx_pinmux_bank *pbank;
231 void __iomem *hwpull;
232 u32 bank, pin;
233
234 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
235 pr_debug("%s: label %s bank %d pin %d enable %d\n", __func__, label,
236 bank, pin, enable);
237
238 hwpull = pbank->hw_pull;
239
240 if (stmp3xxx_check_pin(id, label))
241 return;
242
243 pr_debug("%s: changing 0x%x bit in 0x%p register\n",
244 __func__, 1 << pin, hwpull);
245 if (enable)
246 stmp3xxx_setl(1 << pin, hwpull);
247 else
248 stmp3xxx_clearl(1 << pin, hwpull);
249}
250
251int stmp3xxx_request_pin(unsigned id, enum pin_fun fun, const char *label)
252{
253 struct stmp3xxx_pinmux_bank *pbank;
254 u32 bank, pin;
255 int ret = 0;
256
257 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
258 pr_debug("%s: label %s bank %d pin %d fun %d\n", __func__, label,
259 bank, pin, fun);
260
261 if (test_bit(pin, &pbank->pin_map)) {
262 printk(KERN_WARNING
263 "%s: CONFLICT DETECTED pin %d:%d caller %s owner %s\n",
264 __func__, bank, pin, label, pbank->pin_labels[pin]);
265 return -EBUSY;
266 }
267
268 set_bit(pin, &pbank->pin_map);
269 pbank->pin_labels[pin] = label;
270
271 stmp3xxx_set_pin_type(id, fun);
272
273 return ret;
274}
275
276void stmp3xxx_set_pin_type(unsigned id, enum pin_fun fun)
277{
278 struct stmp3xxx_pinmux_bank *pbank;
279 void __iomem *hwmux;
280 u32 shift, val;
281 u32 bank, pin;
282
283 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
284
285 hwmux = pbank->hw_muxsel[pin / HW_MUXSEL_PIN_NUM];
286 shift = (pin % HW_MUXSEL_PIN_NUM) * HW_MUXSEL_PIN_LEN;
287
288 val = pbank->functions[fun];
289 shift = (pin % HW_MUXSEL_PIN_NUM) * HW_MUXSEL_PIN_LEN;
290 pr_debug("%s: writing 0x%x to 0x%p register\n",
291 __func__, val << shift, hwmux);
292 stmp3xxx_clearl(HW_MUXSEL_PINFUN_MASK << shift, hwmux);
293 stmp3xxx_setl(val << shift, hwmux);
294}
295
296void stmp3xxx_release_pin(unsigned id, const char *label)
297{
298 struct stmp3xxx_pinmux_bank *pbank;
299 u32 bank, pin;
300
301 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
302 pr_debug("%s: label %s bank %d pin %d\n", __func__, label, bank, pin);
303
304 if (stmp3xxx_check_pin(id, label))
305 return;
306
307 clear_bit(pin, &pbank->pin_map);
308 pbank->pin_labels[pin] = NULL;
309}
310
311int stmp3xxx_request_pin_group(struct pin_group *pin_group, const char *label)
312{
313 struct pin_desc *pin;
314 int p;
315 int err = 0;
316
317 /* Allocate and configure pins */
318 for (p = 0; p < pin_group->nr_pins; p++) {
319 pr_debug("%s: #%d\n", __func__, p);
320 pin = &pin_group->pins[p];
321
322 err = stmp3xxx_request_pin(pin->id, pin->fun, label);
323 if (err)
324 goto out_err;
325
326 stmp3xxx_pin_strength(pin->id, pin->strength, label);
327 stmp3xxx_pin_voltage(pin->id, pin->voltage, label);
328 stmp3xxx_pin_pullup(pin->id, pin->pullup, label);
329 }
330
331 return 0;
332
333out_err:
334 /* Release allocated pins in case of error */
335 while (--p >= 0) {
336 pr_debug("%s: releasing #%d\n", __func__, p);
337 stmp3xxx_release_pin(pin_group->pins[p].id, label);
338 }
339 return err;
340}
341EXPORT_SYMBOL(stmp3xxx_request_pin_group);
342
343void stmp3xxx_release_pin_group(struct pin_group *pin_group, const char *label)
344{
345 struct pin_desc *pin;
346 int p;
347
348 for (p = 0; p < pin_group->nr_pins; p++) {
349 pin = &pin_group->pins[p];
350 stmp3xxx_release_pin(pin->id, label);
351 }
352}
353EXPORT_SYMBOL(stmp3xxx_release_pin_group);
354
355static int stmp3xxx_irq_to_gpio(int irq,
356 struct stmp3xxx_pinmux_bank **bank, unsigned *gpio)
357{
358 struct stmp3xxx_pinmux_bank *pm;
359
360 for (pm = pinmux_banks; pm < pinmux_banks + NR_BANKS; pm++)
361 if (pm->virq <= irq && irq < pm->virq + 32) {
362 *bank = pm;
363 *gpio = irq - pm->virq;
364 return 0;
365 }
366 return -ENOENT;
367}
368
369static int stmp3xxx_set_irqtype(unsigned irq, unsigned type)
370{
371 struct stmp3xxx_pinmux_bank *pm;
372 unsigned gpio;
373 int l, p;
374
375 stmp3xxx_irq_to_gpio(irq, &pm, &gpio);
376 switch (type) {
377 case IRQ_TYPE_EDGE_RISING:
378 l = 0; p = 1; break;
379 case IRQ_TYPE_EDGE_FALLING:
380 l = 0; p = 0; break;
381 case IRQ_TYPE_LEVEL_HIGH:
382 l = 1; p = 1; break;
383 case IRQ_TYPE_LEVEL_LOW:
384 l = 1; p = 0; break;
385 default:
386 pr_debug("%s: Incorrect GPIO interrupt type 0x%x\n",
387 __func__, type);
388 return -ENXIO;
389 }
390
391 if (l)
392 stmp3xxx_setl(1 << gpio, pm->irqlevel);
393 else
394 stmp3xxx_clearl(1 << gpio, pm->irqlevel);
395 if (p)
396 stmp3xxx_setl(1 << gpio, pm->irqpolarity);
397 else
398 stmp3xxx_clearl(1 << gpio, pm->irqpolarity);
399 return 0;
400}
401
402static void stmp3xxx_pin_ack_irq(unsigned irq)
403{
404 u32 stat;
405 struct stmp3xxx_pinmux_bank *pm;
406 unsigned gpio;
407
408 stmp3xxx_irq_to_gpio(irq, &pm, &gpio);
409 stat = __raw_readl(pm->irqstat) & (1 << gpio);
410 stmp3xxx_clearl(stat, pm->irqstat);
411}
412
413static void stmp3xxx_pin_mask_irq(unsigned irq)
414{
415 struct stmp3xxx_pinmux_bank *pm;
416 unsigned gpio;
417
418 stmp3xxx_irq_to_gpio(irq, &pm, &gpio);
419 stmp3xxx_clearl(1 << gpio, pm->irqen);
420 stmp3xxx_clearl(1 << gpio, pm->pin2irq);
421}
422
423static void stmp3xxx_pin_unmask_irq(unsigned irq)
424{
425 struct stmp3xxx_pinmux_bank *pm;
426 unsigned gpio;
427
428 stmp3xxx_irq_to_gpio(irq, &pm, &gpio);
429 stmp3xxx_setl(1 << gpio, pm->irqen);
430 stmp3xxx_setl(1 << gpio, pm->pin2irq);
431}
432
433static inline
434struct stmp3xxx_pinmux_bank *to_pinmux_bank(struct gpio_chip *chip)
435{
436 return container_of(chip, struct stmp3xxx_pinmux_bank, chip);
437}
438
439static int stmp3xxx_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
440{
441 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
442 return pm->virq + offset;
443}
444
445static int stmp3xxx_gpio_get(struct gpio_chip *chip, unsigned offset)
446{
447 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
448 unsigned v;
449
450 v = __raw_readl(pm->hw_gpio_in) & (1 << offset);
451 return v ? 1 : 0;
452}
453
454static void stmp3xxx_gpio_set(struct gpio_chip *chip, unsigned offset, int v)
455{
456 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
457
458 if (v)
459 stmp3xxx_setl(1 << offset, pm->hw_gpio_out);
460 else
461 stmp3xxx_clearl(1 << offset, pm->hw_gpio_out);
462}
463
464static int stmp3xxx_gpio_output(struct gpio_chip *chip, unsigned offset, int v)
465{
466 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
467
468 stmp3xxx_setl(1 << offset, pm->hw_gpio_doe);
469 stmp3xxx_gpio_set(chip, offset, v);
470 return 0;
471}
472
473static int stmp3xxx_gpio_input(struct gpio_chip *chip, unsigned offset)
474{
475 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
476
477 stmp3xxx_clearl(1 << offset, pm->hw_gpio_doe);
478 return 0;
479}
480
481static int stmp3xxx_gpio_request(struct gpio_chip *chip, unsigned offset)
482{
483 return stmp3xxx_request_pin(chip->base + offset, PIN_GPIO, "gpio");
484}
485
486static void stmp3xxx_gpio_free(struct gpio_chip *chip, unsigned offset)
487{
488 stmp3xxx_release_pin(chip->base + offset, "gpio");
489}
490
491static void stmp3xxx_gpio_irq(u32 irq, struct irq_desc *desc)
492{
493 struct stmp3xxx_pinmux_bank *pm = get_irq_data(irq);
494 int gpio_irq = pm->virq;
495 u32 stat = __raw_readl(pm->irqstat);
496
497 while (stat) {
498 if (stat & 1)
499 irq_desc[gpio_irq].handle_irq(gpio_irq,
500 &irq_desc[gpio_irq]);
501 gpio_irq++;
502 stat >>= 1;
503 }
504}
505
506static struct irq_chip gpio_irq_chip = {
507 .ack = stmp3xxx_pin_ack_irq,
508 .mask = stmp3xxx_pin_mask_irq,
509 .unmask = stmp3xxx_pin_unmask_irq,
510 .set_type = stmp3xxx_set_irqtype,
511};
512
513int __init stmp3xxx_pinmux_init(int virtual_irq_start)
514{
515 int b, r = 0;
516 struct stmp3xxx_pinmux_bank *pm;
517 int virq;
518
519 for (b = 0; b < 3; b++) {
520 /* only banks 0,1,2 are allowed to GPIO */
521 pm = pinmux_banks + b;
522 pm->chip.base = 32 * b;
523 pm->chip.ngpio = 32;
524 pm->chip.owner = THIS_MODULE;
525 pm->chip.can_sleep = 1;
526 pm->chip.exported = 1;
527 pm->chip.to_irq = stmp3xxx_gpio_to_irq;
528 pm->chip.direction_input = stmp3xxx_gpio_input;
529 pm->chip.direction_output = stmp3xxx_gpio_output;
530 pm->chip.get = stmp3xxx_gpio_get;
531 pm->chip.set = stmp3xxx_gpio_set;
532 pm->chip.request = stmp3xxx_gpio_request;
533 pm->chip.free = stmp3xxx_gpio_free;
534 pm->virq = virtual_irq_start + b * 32;
535
536 for (virq = pm->virq; virq < pm->virq; virq++) {
537 gpio_irq_chip.mask(virq);
538 set_irq_chip(virq, &gpio_irq_chip);
539 set_irq_handler(virq, handle_level_irq);
540 set_irq_flags(virq, IRQF_VALID);
541 }
542 r = gpiochip_add(&pm->chip);
543 if (r < 0)
544 break;
545 set_irq_chained_handler(pm->irq, stmp3xxx_gpio_irq);
546 set_irq_data(pm->irq, pm);
547 }
548 return r;
549}
550
551MODULE_AUTHOR("Vladislav Buzov");
552MODULE_LICENSE("GPL");
diff --git a/arch/arm/plat-stmp3xxx/timer.c b/arch/arm/plat-stmp3xxx/timer.c
new file mode 100644
index 000000000000..063c7bc0e740
--- /dev/null
+++ b/arch/arm/plat-stmp3xxx/timer.c
@@ -0,0 +1,189 @@
1/*
2 * System timer for Freescale STMP37XX/STMP378X
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/clocksource.h>
22#include <linux/clockchips.h>
23#include <linux/io.h>
24#include <linux/irq.h>
25#include <linux/interrupt.h>
26
27#include <asm/mach/time.h>
28#include <mach/stmp3xxx.h>
29#include <mach/platform.h>
30#include <mach/regs-timrot.h>
31
32static irqreturn_t
33stmp3xxx_timer_interrupt(int irq, void *dev_id)
34{
35 struct clock_event_device *c = dev_id;
36
37 /* timer 0 */
38 if (__raw_readl(REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0) &
39 BM_TIMROT_TIMCTRLn_IRQ) {
40 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ,
41 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
42 c->event_handler(c);
43 }
44
45 /* timer 1 */
46 else if (__raw_readl(REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1)
47 & BM_TIMROT_TIMCTRLn_IRQ) {
48 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ,
49 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
50 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ_EN,
51 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
52 __raw_writel(0xFFFF, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
53 }
54
55 return IRQ_HANDLED;
56}
57
58static cycle_t stmp3xxx_clock_read(struct clocksource *cs)
59{
60 return ~((__raw_readl(REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1)
61 & 0xFFFF0000) >> 16);
62}
63
64static int
65stmp3xxx_timrot_set_next_event(unsigned long delta,
66 struct clock_event_device *dev)
67{
68 /* reload the timer */
69 __raw_writel(delta, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
70 return 0;
71}
72
73static void
74stmp3xxx_timrot_set_mode(enum clock_event_mode mode,
75 struct clock_event_device *dev)
76{
77}
78
79static struct clock_event_device ckevt_timrot = {
80 .name = "timrot",
81 .features = CLOCK_EVT_FEAT_ONESHOT,
82 .shift = 32,
83 .set_next_event = stmp3xxx_timrot_set_next_event,
84 .set_mode = stmp3xxx_timrot_set_mode,
85};
86
87static struct clocksource cksrc_stmp3xxx = {
88 .name = "cksrc_stmp3xxx",
89 .rating = 250,
90 .read = stmp3xxx_clock_read,
91 .mask = CLOCKSOURCE_MASK(16),
92 .shift = 10,
93 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
94};
95
96static struct irqaction stmp3xxx_timer_irq = {
97 .name = "stmp3xxx_timer",
98 .flags = IRQF_DISABLED | IRQF_TIMER,
99 .handler = stmp3xxx_timer_interrupt,
100 .dev_id = &ckevt_timrot,
101};
102
103
104/*
105 * Set up timer interrupt, and return the current time in seconds.
106 */
107static void __init stmp3xxx_init_timer(void)
108{
109 cksrc_stmp3xxx.mult = clocksource_hz2mult(CLOCK_TICK_RATE,
110 cksrc_stmp3xxx.shift);
111 ckevt_timrot.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
112 ckevt_timrot.shift);
113 ckevt_timrot.min_delta_ns = clockevent_delta2ns(2, &ckevt_timrot);
114 ckevt_timrot.max_delta_ns = clockevent_delta2ns(0xFFF, &ckevt_timrot);
115 ckevt_timrot.cpumask = cpumask_of(0);
116
117 stmp3xxx_reset_block(REGS_TIMROT_BASE, false);
118
119 /* clear two timers */
120 __raw_writel(0, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
121 __raw_writel(0, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
122
123 /* configure them */
124 __raw_writel(
125 (8 << BP_TIMROT_TIMCTRLn_SELECT) | /* 32 kHz */
126 BM_TIMROT_TIMCTRLn_RELOAD |
127 BM_TIMROT_TIMCTRLn_UPDATE |
128 BM_TIMROT_TIMCTRLn_IRQ_EN,
129 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
130 __raw_writel(
131 (8 << BP_TIMROT_TIMCTRLn_SELECT) | /* 32 kHz */
132 BM_TIMROT_TIMCTRLn_RELOAD |
133 BM_TIMROT_TIMCTRLn_UPDATE |
134 BM_TIMROT_TIMCTRLn_IRQ_EN,
135 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
136
137 __raw_writel(CLOCK_TICK_RATE / HZ - 1,
138 REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
139 __raw_writel(0xFFFF, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
140
141 setup_irq(IRQ_TIMER0, &stmp3xxx_timer_irq);
142
143 clocksource_register(&cksrc_stmp3xxx);
144 clockevents_register_device(&ckevt_timrot);
145}
146
147#ifdef CONFIG_PM
148
149void stmp3xxx_suspend_timer(void)
150{
151 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ_EN | BM_TIMROT_TIMCTRLn_IRQ,
152 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
153 stmp3xxx_setl(BM_TIMROT_ROTCTRL_CLKGATE,
154 REGS_TIMROT_BASE + HW_TIMROT_ROTCTRL);
155}
156
157void stmp3xxx_resume_timer(void)
158{
159 stmp3xxx_clearl(BM_TIMROT_ROTCTRL_SFTRST | BM_TIMROT_ROTCTRL_CLKGATE,
160 REGS_TIMROT_BASE + HW_TIMROT_ROTCTRL);
161 __raw_writel(
162 8 << BP_TIMROT_TIMCTRLn_SELECT | /* 32 kHz */
163 BM_TIMROT_TIMCTRLn_RELOAD |
164 BM_TIMROT_TIMCTRLn_UPDATE |
165 BM_TIMROT_TIMCTRLn_IRQ_EN,
166 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
167 __raw_writel(
168 8 << BP_TIMROT_TIMCTRLn_SELECT | /* 32 kHz */
169 BM_TIMROT_TIMCTRLn_RELOAD |
170 BM_TIMROT_TIMCTRLn_UPDATE |
171 BM_TIMROT_TIMCTRLn_IRQ_EN,
172 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
173 __raw_writel(CLOCK_TICK_RATE / HZ - 1,
174 REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
175 __raw_writel(0xFFFF, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
176}
177
178#else
179
180#define stmp3xxx_suspend_timer NULL
181#define stmp3xxx_resume_timer NULL
182
183#endif /* CONFIG_PM */
184
185struct sys_timer stmp3xxx_timer = {
186 .init = stmp3xxx_init_timer,
187 .suspend = stmp3xxx_suspend_timer,
188 .resume = stmp3xxx_resume_timer,
189};
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 83c4e384b16d..1aeae38725dd 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -100,6 +100,7 @@ ENTRY(vfp_support_entry)
100 beq no_old_VFP_process 100 beq no_old_VFP_process
101 VFPFSTMIA r4, r5 @ save the working registers 101 VFPFSTMIA r4, r5 @ save the working registers
102 VFPFMRX r5, FPSCR @ current status 102 VFPFMRX r5, FPSCR @ current status
103#ifndef CONFIG_CPU_FEROCEON
103 tst r1, #FPEXC_EX @ is there additional state to save? 104 tst r1, #FPEXC_EX @ is there additional state to save?
104 beq 1f 105 beq 1f
105 VFPFMRX r6, FPINST @ FPINST (only if FPEXC.EX is set) 106 VFPFMRX r6, FPINST @ FPINST (only if FPEXC.EX is set)
@@ -107,6 +108,7 @@ ENTRY(vfp_support_entry)
107 beq 1f 108 beq 1f
108 VFPFMRX r8, FPINST2 @ FPINST2 if needed (and present) 109 VFPFMRX r8, FPINST2 @ FPINST2 if needed (and present)
1091: 1101:
111#endif
110 stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 112 stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2
111 @ and point r4 at the word at the 113 @ and point r4 at the word at the
112 @ start of the register dump 114 @ start of the register dump
@@ -119,6 +121,7 @@ no_old_VFP_process:
119 VFPFLDMIA r10, r5 @ reload the working registers while 121 VFPFLDMIA r10, r5 @ reload the working registers while
120 @ FPEXC is in a safe state 122 @ FPEXC is in a safe state
121 ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 123 ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2
124#ifndef CONFIG_CPU_FEROCEON
122 tst r1, #FPEXC_EX @ is there additional state to restore? 125 tst r1, #FPEXC_EX @ is there additional state to restore?
123 beq 1f 126 beq 1f
124 VFPFMXR FPINST, r6 @ restore FPINST (only if FPEXC.EX is set) 127 VFPFMXR FPINST, r6 @ restore FPINST (only if FPEXC.EX is set)
@@ -126,6 +129,7 @@ no_old_VFP_process:
126 beq 1f 129 beq 1f
127 VFPFMXR FPINST2, r8 @ FPINST2 if needed (and present) 130 VFPFMXR FPINST2, r8 @ FPINST2 if needed (and present)
1281: 1311:
132#endif
129 VFPFMXR FPSCR, r5 @ restore status 133 VFPFMXR FPSCR, r5 @ restore status
130 134
131check_for_exception: 135check_for_exception:
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 01599c4ef726..2d7423af1197 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -253,12 +253,14 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
253 } 253 }
254 254
255 if (fpexc & FPEXC_EX) { 255 if (fpexc & FPEXC_EX) {
256#ifndef CONFIG_CPU_FEROCEON
256 /* 257 /*
257 * Asynchronous exception. The instruction is read from FPINST 258 * Asynchronous exception. The instruction is read from FPINST
258 * and the interrupted instruction has to be restarted. 259 * and the interrupted instruction has to be restarted.
259 */ 260 */
260 trigger = fmrx(FPINST); 261 trigger = fmrx(FPINST);
261 regs->ARM_pc -= 4; 262 regs->ARM_pc -= 4;
263#endif
262 } else if (!(fpexc & FPEXC_DEX)) { 264 } else if (!(fpexc & FPEXC_DEX)) {
263 /* 265 /*
264 * Illegal combination of bits. It can be caused by an 266 * Illegal combination of bits. It can be caused by an
diff --git a/arch/avr32/boards/atngw100/Kconfig b/arch/avr32/boards/atngw100/Kconfig
index b3f99477bbeb..be27a0218ab4 100644
--- a/arch/avr32/boards/atngw100/Kconfig
+++ b/arch/avr32/boards/atngw100/Kconfig
@@ -2,8 +2,15 @@
2 2
3if BOARD_ATNGW100 3if BOARD_ATNGW100
4 4
5choice
6 prompt "Select an NGW100 add-on board to support"
7 default BOARD_ATNGW100_ADDON_NONE
8
9config BOARD_ATNGW100_ADDON_NONE
10 bool "None"
11
5config BOARD_ATNGW100_EVKLCD10X 12config BOARD_ATNGW100_EVKLCD10X
6 bool "Add support for EVKLCD10X addon board" 13 bool "EVKLCD10X addon board"
7 help 14 help
8 This enables support for the EVKLCD100 (QVGA) or EVKLCD101 (VGA) 15 This enables support for the EVKLCD100 (QVGA) or EVKLCD101 (VGA)
9 addon board for the NGW100. By enabling this the LCD controller and 16 addon board for the NGW100. By enabling this the LCD controller and
@@ -14,7 +21,19 @@ config BOARD_ATNGW100_EVKLCD10X
14 The MCI pins can be reenabled by editing the "add device function" but 21 The MCI pins can be reenabled by editing the "add device function" but
15 this may break the setup for other displays that use these pins. 22 this may break the setup for other displays that use these pins.
16 23
17 Choose 'Y' here if you have a EVKLCD100/101 connected to the NGW100. 24config BOARD_ATNGW100_MRMT
25 bool "Mediama RMT1/2 add-on board"
26 help
27 This enables support for the Mediama RMT1 or RMT2 board.
28 RMT provides LCD support, AC97 codec and other
29 optional peripherals to the Atmel NGW100.
30
31 This choice disables the detect pin and the write-protect pin for the
32 MCI platform device, since it conflicts with the LCD platform device.
33 The MCI pins can be reenabled by editing the "add device function" but
34 this may break the setup for other displays that use these pins.
35
36endchoice
18 37
19choice 38choice
20 prompt "LCD panel resolution on EVKLCD10X" 39 prompt "LCD panel resolution on EVKLCD10X"
@@ -32,4 +51,8 @@ config BOARD_ATNGW100_EVKLCD10X_POW_QVGA
32 51
33endchoice 52endchoice
34 53
54if BOARD_ATNGW100_MRMT
55source "arch/avr32/boards/atngw100/Kconfig_mrmt"
56endif
57
35endif # BOARD_ATNGW100 58endif # BOARD_ATNGW100
diff --git a/arch/avr32/boards/atngw100/Kconfig_mrmt b/arch/avr32/boards/atngw100/Kconfig_mrmt
new file mode 100644
index 000000000000..9a199a207f3c
--- /dev/null
+++ b/arch/avr32/boards/atngw100/Kconfig_mrmt
@@ -0,0 +1,80 @@
1# RMT for NGW100 customization
2
3choice
4 prompt "RMT Version"
5 help
6 Select the RMTx board version.
7
8config BOARD_MRMT_REV1
9 bool "RMT1"
10config BOARD_MRMT_REV2
11 bool "RMT2"
12
13endchoice
14
15config BOARD_MRMT_AC97
16 bool "Enable AC97 CODEC"
17 help
18 Enable the UCB1400 AC97 CODEC driver.
19
20choice
21 prompt "Touchscreen Driver"
22 default BOARD_MRMT_ADS7846_TS
23
24config BOARD_MRMT_UCB1400_TS
25 bool "Use UCB1400 Touchscreen"
26
27config BOARD_MRMT_ADS7846_TS
28 bool "Use ADS7846 Touchscreen"
29
30endchoice
31
32choice
33 prompt "RMTx LCD Selection"
34 default BOARD_MRMT_LCD_DISABLE
35
36config BOARD_MRMT_LCD_DISABLE
37 bool "LCD Disabled"
38
39config BOARD_MRMT_LCD_LQ043T3DX0X
40 bool "Sharp LQ043T3DX0x or compatible"
41 help
42 If using RMT2, be sure to load the resistor pack selectors accordingly
43
44if BOARD_MRMT_REV2
45config BOARD_MRMT_LCD_KWH043GM08
46 bool "Formike KWH043GM08 or compatible"
47 help
48 Be sure to load the RMT2 resistor pack selectors accordingly
49endif
50
51endchoice
52
53if !BOARD_MRMT_LCD_DISABLE
54config BOARD_MRMT_BL_PWM
55 bool "Use PWM control for LCD Backlight"
56 help
57 Use PWM driver for controlling LCD Backlight.
58 Otherwise, LCD Backlight is always on.
59endif
60
61config BOARD_MRMT_RTC_I2C
62 bool "Use External RTC on I2C Bus"
63 help
64 RMT1 has an optional RTC device on the I2C bus.
65 It is a SII S35390A. Be sure to select the
66 matching RTC driver.
67
68choice
69 prompt "Wireless Module on ttyS2"
70 default BOARD_MRMT_WIRELESS_ZB
71
72config BOARD_MRMT_WIRELESS_ZB
73 bool "Use ZigBee/802.15.4 Module"
74
75config BOARD_MRMT_WIRELESS_BT
76 bool "Use Bluetooth (HCI) Module"
77
78config BOARD_MRMT_WIRELESS_NONE
79 bool "Not Installed"
80endchoice
diff --git a/arch/avr32/boards/atngw100/Makefile b/arch/avr32/boards/atngw100/Makefile
index 6376f5322e4d..f4ebe42a8254 100644
--- a/arch/avr32/boards/atngw100/Makefile
+++ b/arch/avr32/boards/atngw100/Makefile
@@ -1,2 +1,3 @@
1obj-y += setup.o flash.o 1obj-y += setup.o flash.o
2obj-$(CONFIG_BOARD_ATNGW100_EVKLCD10X) += evklcd10x.o 2obj-$(CONFIG_BOARD_ATNGW100_EVKLCD10X) += evklcd10x.o
3obj-$(CONFIG_BOARD_ATNGW100_MRMT) += mrmt.o
diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c
new file mode 100644
index 000000000000..bf78e516a85f
--- /dev/null
+++ b/arch/avr32/boards/atngw100/mrmt.c
@@ -0,0 +1,373 @@
1/*
2 * Board-specific setup code for Remote Media Terminal 1 (RMT1)
3 * add-on board for the ATNGW100 Network Gateway
4 *
5 * Copyright (C) 2008 Mediama Technologies
6 * Based on ATNGW100 Network Gateway (Copyright (C) Atmel)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/gpio.h>
13#include <linux/init.h>
14#include <linux/irq.h>
15#include <linux/linkage.h>
16#include <linux/platform_device.h>
17#include <linux/types.h>
18#include <linux/fb.h>
19#include <linux/leds.h>
20#include <linux/input.h>
21#include <linux/gpio_keys.h>
22#include <linux/atmel_serial.h>
23#include <linux/spi/spi.h>
24#include <linux/spi/ads7846.h>
25
26#include <video/atmel_lcdc.h>
27#include <sound/atmel-ac97c.h>
28
29#include <asm/delay.h>
30#include <asm/io.h>
31#include <asm/setup.h>
32
33#include <mach/at32ap700x.h>
34#include <mach/board.h>
35#include <mach/init.h>
36#include <mach/portmux.h>
37
38/* Define board-specifoic GPIO assignments */
39#define PIN_LCD_BL GPIO_PIN_PA(28)
40#define PWM_CH_BL 0 /* Must match with GPIO pin definition */
41#define PIN_LCD_DISP GPIO_PIN_PA(31)
42#define PIN_AC97_RST_N GPIO_PIN_PA(30)
43#define PB_EXTINT_BASE 25
44#define TS_IRQ 0
45#define PIN_TS_EXTINT GPIO_PIN_PB(PB_EXTINT_BASE+TS_IRQ)
46#define PIN_PB_LEFT GPIO_PIN_PB(11)
47#define PIN_PB_RIGHT GPIO_PIN_PB(12)
48#define PIN_PWR_SW_N GPIO_PIN_PB(14)
49#define PIN_PWR_ON GPIO_PIN_PB(13)
50#define PIN_ZB_RST_N GPIO_PIN_PA(21)
51#define PIN_BT_RST GPIO_PIN_PA(22)
52#define PIN_LED_SYS GPIO_PIN_PA(16)
53#define PIN_LED_A GPIO_PIN_PA(19)
54#define PIN_LED_B GPIO_PIN_PE(19)
55
56#ifdef CONFIG_BOARD_MRMT_LCD_LQ043T3DX0X
57/* Sharp LQ043T3DX0x (or compatible) panel */
58static struct fb_videomode __initdata lcd_fb_modes[] = {
59 {
60 .name = "480x272 @ 59.94Hz",
61 .refresh = 59.94,
62 .xres = 480, .yres = 272,
63 .pixclock = KHZ2PICOS(9000),
64
65 .left_margin = 2, .right_margin = 2,
66 .upper_margin = 3, .lower_margin = 9,
67 .hsync_len = 41, .vsync_len = 1,
68
69 .sync = 0,
70 .vmode = FB_VMODE_NONINTERLACED,
71 },
72};
73
74static struct fb_monspecs __initdata lcd_fb_default_monspecs = {
75 .manufacturer = "SHA",
76 .monitor = "LQ043T3DX02",
77 .modedb = lcd_fb_modes,
78 .modedb_len = ARRAY_SIZE(lcd_fb_modes),
79 .hfmin = 14915,
80 .hfmax = 17638,
81 .vfmin = 53,
82 .vfmax = 61,
83 .dclkmax = 9260000,
84};
85
86static struct atmel_lcdfb_info __initdata rmt_lcdc_data = {
87 .default_bpp = 24,
88 .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
89 .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
90 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
91 | ATMEL_LCDC_INVCLK_NORMAL
92 | ATMEL_LCDC_MEMOR_BIG),
93 .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
94 .default_monspecs = &lcd_fb_default_monspecs,
95 .guard_time = 2,
96};
97#endif
98
99#ifdef CONFIG_BOARD_MRMT_LCD_KWH043GM08
100/* Sharp KWH043GM08-Fxx (or compatible) panel */
101static struct fb_videomode __initdata lcd_fb_modes[] = {
102 {
103 .name = "480x272 @ 59.94Hz",
104 .refresh = 59.94,
105 .xres = 480, .yres = 272,
106 .pixclock = KHZ2PICOS(9000),
107
108 .left_margin = 2, .right_margin = 2,
109 .upper_margin = 3, .lower_margin = 9,
110 .hsync_len = 41, .vsync_len = 1,
111
112 .sync = 0,
113 .vmode = FB_VMODE_NONINTERLACED,
114 },
115};
116
117static struct fb_monspecs __initdata lcd_fb_default_monspecs = {
118 .manufacturer = "FOR",
119 .monitor = "KWH043GM08",
120 .modedb = lcd_fb_modes,
121 .modedb_len = ARRAY_SIZE(lcd_fb_modes),
122 .hfmin = 14915,
123 .hfmax = 17638,
124 .vfmin = 53,
125 .vfmax = 61,
126 .dclkmax = 9260000,
127};
128
129static struct atmel_lcdfb_info __initdata rmt_lcdc_data = {
130 .default_bpp = 24,
131 .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
132 .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
133 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
134 | ATMEL_LCDC_INVCLK_INVERTED
135 | ATMEL_LCDC_MEMOR_BIG),
136 .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
137 .default_monspecs = &lcd_fb_default_monspecs,
138 .guard_time = 2,
139};
140#endif
141
142#ifdef CONFIG_BOARD_MRMT_AC97
143static struct ac97c_platform_data __initdata ac97c0_data = {
144 .reset_pin = PIN_AC97_RST_N,
145};
146#endif
147
148#ifdef CONFIG_BOARD_MRMT_UCB1400_TS
149/* NOTE: IRQ assignment relies on kernel module parameter */
150static struct platform_device rmt_ts_device = {
151 .name = "ucb1400_ts",
152 .id = -1,
153 }
154};
155#endif
156
157#ifdef CONFIG_BOARD_MRMT_BL_PWM
158/* PWM LEDs: LCD Backlight, etc */
159static struct gpio_led rmt_pwm_led[] = {
160 /* here the "gpio" is actually a PWM channel */
161 { .name = "backlight", .gpio = PWM_CH_BL, },
162};
163
164static struct gpio_led_platform_data rmt_pwm_led_data = {
165 .num_leds = ARRAY_SIZE(rmt_pwm_led),
166 .leds = rmt_pwm_led,
167};
168
169static struct platform_device rmt_pwm_led_dev = {
170 .name = "leds-atmel-pwm",
171 .id = -1,
172 .dev = {
173 .platform_data = &rmt_pwm_led_data,
174 },
175};
176#endif
177
178#ifdef CONFIG_BOARD_MRMT_ADS7846_TS
179static int ads7846_pendown_state(void)
180{
181 return !gpio_get_value( PIN_TS_EXTINT ); /* PENIRQ.*/
182}
183
184static struct ads7846_platform_data ads_info = {
185 .model = 7846,
186 .keep_vref_on = 0, /* Use external VREF pin */
187 .vref_delay_usecs = 0,
188 .vref_mv = 3300, /* VREF = 3.3V */
189 .settle_delay_usecs = 800,
190 .penirq_recheck_delay_usecs = 800,
191 .x_plate_ohms = 750,
192 .y_plate_ohms = 300,
193 .pressure_max = 4096,
194 .debounce_max = 1,
195 .debounce_rep = 0,
196 .debounce_tol = (~0),
197 .get_pendown_state = ads7846_pendown_state,
198 .filter = NULL,
199 .filter_init = NULL,
200};
201
202static struct spi_board_info spi01_board_info[] __initdata = {
203 {
204 .modalias = "ads7846",
205 .max_speed_hz = 31250*26,
206 .bus_num = 0,
207 .chip_select = 1,
208 .platform_data = &ads_info,
209 .irq = AT32_EXTINT(TS_IRQ),
210 },
211};
212#endif
213
214/* GPIO Keys: left, right, power, etc */
215static const struct gpio_keys_button rmt_gpio_keys_buttons[] = {
216 [0] = {
217 .type = EV_KEY,
218 .code = KEY_POWER,
219 .gpio = PIN_PWR_SW_N,
220 .active_low = 1,
221 .desc = "power button",
222 },
223 [1] = {
224 .type = EV_KEY,
225 .code = KEY_LEFT,
226 .gpio = PIN_PB_LEFT,
227 .active_low = 1,
228 .desc = "left button",
229 },
230 [2] = {
231 .type = EV_KEY,
232 .code = KEY_RIGHT,
233 .gpio = PIN_PB_RIGHT,
234 .active_low = 1,
235 .desc = "right button",
236 },
237};
238
239static const struct gpio_keys_platform_data rmt_gpio_keys_data = {
240 .nbuttons = ARRAY_SIZE(rmt_gpio_keys_buttons),
241 .buttons = (void *) rmt_gpio_keys_buttons,
242};
243
244static struct platform_device rmt_gpio_keys = {
245 .name = "gpio-keys",
246 .id = -1,
247 .dev = {
248 .platform_data = (void *) &rmt_gpio_keys_data,
249 }
250};
251
252#ifdef CONFIG_BOARD_MRMT_RTC_I2C
253static struct i2c_board_info __initdata mrmt1_i2c_rtc = {
254 I2C_BOARD_INFO("s35390a", 0x30),
255 .irq = 0,
256};
257#endif
258
259static void mrmt_power_off(void)
260{
261 /* PWR_ON=0 will force power off */
262 gpio_set_value( PIN_PWR_ON, 0 );
263}
264
265static int __init mrmt1_init(void)
266{
267 gpio_set_value( PIN_PWR_ON, 1 ); /* Ensure PWR_ON is enabled */
268
269 pm_power_off = mrmt_power_off;
270
271 /* Setup USARTS (other than console) */
272 at32_map_usart(2, 1, 0); /* USART 2: /dev/ttyS1, RMT1:DB9M */
273 at32_map_usart(3, 2, ATMEL_USART_RTS | ATMEL_USART_CTS);
274 /* USART 3: /dev/ttyS2, RMT1:Wireless, w/ RTS/CTS */
275 at32_add_device_usart(1);
276 at32_add_device_usart(2);
277
278 /* Select GPIO Key pins */
279 at32_select_gpio( PIN_PWR_SW_N, AT32_GPIOF_DEGLITCH);
280 at32_select_gpio( PIN_PB_LEFT, AT32_GPIOF_DEGLITCH);
281 at32_select_gpio( PIN_PB_RIGHT, AT32_GPIOF_DEGLITCH);
282 platform_device_register(&rmt_gpio_keys);
283
284#ifdef CONFIG_BOARD_MRMT_RTC_I2C
285 i2c_register_board_info(0, &mrmt1_i2c_rtc, 1);
286#endif
287
288#ifndef CONFIG_BOARD_MRMT_LCD_DISABLE
289 /* User "alternate" LCDC inferface on Port E & D */
290 /* NB: exclude LCDC_CC pin, as NGW100 reserves it for other use */
291 at32_add_device_lcdc(0, &rmt_lcdc_data,
292 fbmem_start, fbmem_size,
293 (ATMEL_LCDC_ALT_24BIT | ATMEL_LCDC_PE_DVAL ) );
294#endif
295
296#ifdef CONFIG_BOARD_MRMT_AC97
297 at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH);
298#endif
299
300#ifdef CONFIG_BOARD_MRMT_ADS7846_TS
301 /* Select the Touchscreen interrupt pin mode */
302 at32_select_periph( GPIO_PIOB_BASE, 1 << (PB_EXTINT_BASE+TS_IRQ),
303 GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
304 set_irq_type( AT32_EXTINT(TS_IRQ), IRQ_TYPE_EDGE_FALLING );
305 spi_register_board_info(spi01_board_info,ARRAY_SIZE(spi01_board_info));
306#endif
307
308#ifdef CONFIG_BOARD_MRMT_UCB1400_TS
309 /* Select the Touchscreen interrupt pin mode */
310 at32_select_periph( GPIO_PIOB_BASE, 1 << (PB_EXTINT_BASE+TS_IRQ),
311 GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
312 platform_device_register(&rmt_ts_device);
313#endif
314
315 at32_select_gpio( PIN_LCD_DISP, AT32_GPIOF_OUTPUT );
316 gpio_request( PIN_LCD_DISP, "LCD_DISP" );
317 gpio_direction_output( PIN_LCD_DISP, 0 ); /* LCD DISP */
318#ifdef CONFIG_BOARD_MRMT_LCD_DISABLE
319 /* Keep Backlight and DISP off */
320 at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT );
321 gpio_request( PIN_LCD_BL, "LCD_BL" );
322 gpio_direction_output( PIN_LCD_BL, 0 ); /* Backlight */
323#else
324 gpio_set_value( PIN_LCD_DISP, 1 ); /* DISP asserted first */
325#ifdef CONFIG_BOARD_MRMT_BL_PWM
326 /* Use PWM for Backlight controls */
327 at32_add_device_pwm(1 << PWM_CH_BL);
328 platform_device_register(&rmt_pwm_led_dev);
329#else
330 /* Backlight always on */
331 udelay( 1 );
332 at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT );
333 gpio_request( PIN_LCD_BL, "LCD_BL" );
334 gpio_direction_output( PIN_LCD_BL, 1 );
335#endif
336#endif
337
338 /* Make sure BT and Zigbee modules in reset */
339 at32_select_gpio( PIN_BT_RST, AT32_GPIOF_OUTPUT );
340 gpio_request( PIN_BT_RST, "BT_RST" );
341 gpio_direction_output( PIN_BT_RST, 1 );
342 /* BT Module in Reset */
343
344 at32_select_gpio( PIN_ZB_RST_N, AT32_GPIOF_OUTPUT );
345 gpio_request( PIN_ZB_RST_N, "ZB_RST_N" );
346 gpio_direction_output( PIN_ZB_RST_N, 0 );
347 /* XBee Module in Reset */
348
349#ifdef CONFIG_BOARD_MRMT_WIRELESS_ZB
350 udelay( 1000 );
351 /* Unreset the XBee Module */
352 gpio_set_value( PIN_ZB_RST_N, 1 );
353#endif
354#ifdef CONFIG_BOARD_MRMT_WIRELESS_BT
355 udelay( 1000 );
356 /* Unreset the BT Module */
357 gpio_set_value( PIN_BT_RST, 0 );
358#endif
359
360 return 0;
361}
362arch_initcall(mrmt1_init);
363
364static int __init mrmt1_early_init(void)
365{
366 /* To maintain power-on signal in case boot loader did not already */
367 at32_select_gpio( PIN_PWR_ON, AT32_GPIOF_OUTPUT );
368 gpio_request( PIN_PWR_ON, "PIN_PWR_ON" );
369 gpio_direction_output( PIN_PWR_ON, 1 );
370
371 return 0;
372}
373core_initcall(mrmt1_early_init);
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 5b022aad4bd9..bc299fbbeb4e 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -56,8 +56,13 @@ static struct spi_board_info spi0_board_info[] __initdata = {
56static struct mci_platform_data __initdata mci0_data = { 56static struct mci_platform_data __initdata mci0_data = {
57 .slot[0] = { 57 .slot[0] = {
58 .bus_width = 4, 58 .bus_width = 4,
59#if defined(CONFIG_BOARD_ATNGW100_EVKLCD10X) || defined(CONFIG_BOARD_ATNGW100_MRMT1)
60 .detect_pin = GPIO_PIN_NONE,
61 .wp_pin = GPIO_PIN_NONE,
62#else
59 .detect_pin = GPIO_PIN_PC(25), 63 .detect_pin = GPIO_PIN_PC(25),
60 .wp_pin = GPIO_PIN_PE(0), 64 .wp_pin = GPIO_PIN_PE(0),
65#endif
61 }, 66 },
62}; 67};
63 68
diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
index 20b300cf105a..623b077594fc 100644
--- a/arch/avr32/boards/merisc/setup.c
+++ b/arch/avr32/boards/merisc/setup.c
@@ -94,9 +94,10 @@ static struct spi_board_info __initdata spi0_board_info[] = {
94 94
95static struct mci_platform_data __initdata mci0_data = { 95static struct mci_platform_data __initdata mci0_data = {
96 .slot[0] = { 96 .slot[0] = {
97 .bus_width = 4, 97 .bus_width = 4,
98 .detect_pin = GPIO_PIN_PE(19), 98 .detect_pin = GPIO_PIN_PE(19),
99 .wp_pin = GPIO_PIN_PE(20), 99 .wp_pin = GPIO_PIN_PE(20),
100 .detect_is_active_high = true,
100 }, 101 },
101}; 102};
102 103
diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c
index c1b2175b4fea..523d8e183bef 100644
--- a/arch/avr32/boards/mimc200/setup.c
+++ b/arch/avr32/boards/mimc200/setup.c
@@ -43,16 +43,16 @@ unsigned long at32_board_osc_rates[3] = {
43/* Initialized by bootloader-specific startup code. */ 43/* Initialized by bootloader-specific startup code. */
44struct tag *bootloader_tags __initdata; 44struct tag *bootloader_tags __initdata;
45 45
46static struct fb_videomode __initdata tx14d14_modes[] = { 46static struct fb_videomode __initdata pt0434827_modes[] = {
47 { 47 {
48 .name = "640x480 @ 60", 48 .name = "480x272 @ 72",
49 .refresh = 60, 49 .refresh = 72,
50 .xres = 640, .yres = 480, 50 .xres = 480, .yres = 272,
51 .pixclock = KHZ2PICOS(11666), 51 .pixclock = KHZ2PICOS(10000),
52 52
53 .left_margin = 80, .right_margin = 1, 53 .left_margin = 1, .right_margin = 1,
54 .upper_margin = 13, .lower_margin = 2, 54 .upper_margin = 12, .lower_margin = 1,
55 .hsync_len = 64, .vsync_len = 1, 55 .hsync_len = 42, .vsync_len = 1,
56 56
57 .sync = 0, 57 .sync = 0,
58 .vmode = FB_VMODE_NONINTERLACED, 58 .vmode = FB_VMODE_NONINTERLACED,
@@ -60,14 +60,14 @@ static struct fb_videomode __initdata tx14d14_modes[] = {
60}; 60};
61 61
62static struct fb_monspecs __initdata mimc200_default_monspecs = { 62static struct fb_monspecs __initdata mimc200_default_monspecs = {
63 .manufacturer = "HIT", 63 .manufacturer = "PT",
64 .monitor = "TX14D14VM1BAB", 64 .monitor = "PT0434827-A401",
65 .modedb = tx14d14_modes, 65 .modedb = pt0434827_modes,
66 .modedb_len = ARRAY_SIZE(tx14d14_modes), 66 .modedb_len = ARRAY_SIZE(pt0434827_modes),
67 .hfmin = 14820, 67 .hfmin = 14820,
68 .hfmax = 22230, 68 .hfmax = 22230,
69 .vfmin = 60, 69 .vfmin = 60,
70 .vfmax = 73.3, 70 .vfmax = 85,
71 .dclkmax = 25200000, 71 .dclkmax = 25200000,
72}; 72};
73 73
@@ -228,7 +228,8 @@ static int __init mimc200_init(void)
228 i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); 228 i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info));
229 229
230 at32_add_device_lcdc(0, &mimc200_lcdc_data, 230 at32_add_device_lcdc(0, &mimc200_lcdc_data,
231 fbmem_start, fbmem_size, 1); 231 fbmem_start, fbmem_size,
232 ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_CONTROL | ATMEL_LCDC_ALT_24B_DATA);
232 233
233 return 0; 234 return 0;
234} 235}
diff --git a/arch/avr32/configs/atngw100_mrmt_defconfig b/arch/avr32/configs/atngw100_mrmt_defconfig
new file mode 100644
index 000000000000..17b030777d36
--- /dev/null
+++ b/arch/avr32/configs/atngw100_mrmt_defconfig
@@ -0,0 +1,1363 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc1
4# Wed Jun 3 00:24:53 2009
5#
6CONFIG_AVR32=y
7CONFIG_GENERIC_GPIO=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_STACKTRACE_SUPPORT=y
10CONFIG_LOCKDEP_SUPPORT=y
11CONFIG_TRACE_IRQFLAGS_SUPPORT=y
12CONFIG_HARDIRQS_SW_RESEND=y
13CONFIG_GENERIC_IRQ_PROBE=y
14CONFIG_RWSEM_GENERIC_SPINLOCK=y
15CONFIG_GENERIC_TIME=y
16CONFIG_GENERIC_CLOCKEVENTS=y
17# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
18# CONFIG_ARCH_HAS_ILOG2_U32 is not set
19# CONFIG_ARCH_HAS_ILOG2_U64 is not set
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_BUG=y
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32# CONFIG_LOCALVERSION_AUTO is not set
33CONFIG_SWAP=y
34CONFIG_SYSVIPC=y
35CONFIG_SYSVIPC_SYSCTL=y
36CONFIG_POSIX_MQUEUE=y
37CONFIG_POSIX_MQUEUE_SYSCTL=y
38CONFIG_BSD_PROCESS_ACCT=y
39CONFIG_BSD_PROCESS_ACCT_V3=y
40# CONFIG_TASKSTATS is not set
41# CONFIG_AUDIT is not set
42
43#
44# RCU Subsystem
45#
46CONFIG_CLASSIC_RCU=y
47# CONFIG_TREE_RCU is not set
48# CONFIG_PREEMPT_RCU is not set
49# CONFIG_TREE_RCU_TRACE is not set
50# CONFIG_PREEMPT_RCU_TRACE is not set
51# CONFIG_IKCONFIG is not set
52CONFIG_LOG_BUF_SHIFT=14
53CONFIG_GROUP_SCHED=y
54CONFIG_FAIR_GROUP_SCHED=y
55# CONFIG_RT_GROUP_SCHED is not set
56CONFIG_USER_SCHED=y
57# CONFIG_CGROUP_SCHED is not set
58# CONFIG_CGROUPS is not set
59CONFIG_SYSFS_DEPRECATED=y
60CONFIG_SYSFS_DEPRECATED_V2=y
61# CONFIG_RELAY is not set
62# CONFIG_NAMESPACES is not set
63CONFIG_BLK_DEV_INITRD=y
64CONFIG_INITRAMFS_SOURCE=""
65CONFIG_RD_GZIP=y
66# CONFIG_RD_BZIP2 is not set
67# CONFIG_RD_LZMA is not set
68CONFIG_CC_OPTIMIZE_FOR_SIZE=y
69CONFIG_SYSCTL=y
70CONFIG_ANON_INODES=y
71CONFIG_EMBEDDED=y
72# CONFIG_SYSCTL_SYSCALL is not set
73CONFIG_KALLSYMS=y
74# CONFIG_KALLSYMS_ALL is not set
75# CONFIG_KALLSYMS_EXTRA_PASS is not set
76CONFIG_HOTPLUG=y
77CONFIG_PRINTK=y
78CONFIG_BUG=y
79CONFIG_ELF_CORE=y
80# CONFIG_BASE_FULL is not set
81CONFIG_FUTEX=y
82CONFIG_EPOLL=y
83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y
86CONFIG_SHMEM=y
87CONFIG_AIO=y
88CONFIG_VM_EVENT_COUNTERS=y
89# CONFIG_SLUB_DEBUG is not set
90CONFIG_COMPAT_BRK=y
91# CONFIG_SLAB is not set
92CONFIG_SLUB=y
93# CONFIG_SLOB is not set
94# CONFIG_PROFILING is not set
95# CONFIG_MARKERS is not set
96CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_CLK=y
100# CONFIG_SLOW_WORK is not set
101# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
102CONFIG_RT_MUTEXES=y
103CONFIG_BASE_SMALL=1
104CONFIG_MODULES=y
105# CONFIG_MODULE_FORCE_LOAD is not set
106CONFIG_MODULE_UNLOAD=y
107CONFIG_MODULE_FORCE_UNLOAD=y
108# CONFIG_MODVERSIONS is not set
109# CONFIG_MODULE_SRCVERSION_ALL is not set
110CONFIG_BLOCK=y
111# CONFIG_LBD is not set
112# CONFIG_BLK_DEV_BSG is not set
113# CONFIG_BLK_DEV_INTEGRITY is not set
114
115#
116# IO Schedulers
117#
118CONFIG_IOSCHED_NOOP=y
119# CONFIG_IOSCHED_AS is not set
120# CONFIG_IOSCHED_DEADLINE is not set
121CONFIG_IOSCHED_CFQ=y
122# CONFIG_DEFAULT_AS is not set
123# CONFIG_DEFAULT_DEADLINE is not set
124CONFIG_DEFAULT_CFQ=y
125# CONFIG_DEFAULT_NOOP is not set
126CONFIG_DEFAULT_IOSCHED="cfq"
127# CONFIG_FREEZER is not set
128
129#
130# System Type and features
131#
132# CONFIG_NO_HZ is not set
133# CONFIG_HIGH_RES_TIMERS is not set
134CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
135CONFIG_SUBARCH_AVR32B=y
136CONFIG_MMU=y
137CONFIG_PERFORMANCE_COUNTERS=y
138CONFIG_PLATFORM_AT32AP=y
139CONFIG_CPU_AT32AP700X=y
140CONFIG_CPU_AT32AP7000=y
141# CONFIG_BOARD_ATSTK1000 is not set
142CONFIG_BOARD_ATNGW100=y
143# CONFIG_BOARD_HAMMERHEAD is not set
144# CONFIG_BOARD_FAVR_32 is not set
145# CONFIG_BOARD_MERISC is not set
146# CONFIG_BOARD_MIMC200 is not set
147# CONFIG_BOARD_ATNGW100_ADDON_NONE is not set
148# CONFIG_BOARD_ATNGW100_EVKLCD10X is not set
149CONFIG_BOARD_ATNGW100_MRMT=y
150CONFIG_BOARD_MRMT_REV1=y
151# CONFIG_BOARD_MRMT_REV2 is not set
152CONFIG_BOARD_MRMT_AC97=y
153# CONFIG_BOARD_MRMT_UCB1400_TS is not set
154CONFIG_BOARD_MRMT_ADS7846_TS=y
155# CONFIG_BOARD_MRMT_LCD_DISABLE is not set
156CONFIG_BOARD_MRMT_LCD_LQ043T3DX0X=y
157# CONFIG_BOARD_MRMT_LCD_KWH043GM08 is not set
158CONFIG_BOARD_MRMT_BL_PWM=y
159CONFIG_BOARD_MRMT_RTC_I2C=y
160CONFIG_BOARD_MRMT_WIRELESS_ZB=y
161# CONFIG_BOARD_MRMT_WIRELESS_BT is not set
162# CONFIG_BOARD_MRMT_WIRELESS_NONE is not set
163CONFIG_LOADER_U_BOOT=y
164
165#
166# Atmel AVR32 AP options
167#
168# CONFIG_AP700X_32_BIT_SMC is not set
169CONFIG_AP700X_16_BIT_SMC=y
170# CONFIG_AP700X_8_BIT_SMC is not set
171CONFIG_LOAD_ADDRESS=0x10000000
172CONFIG_ENTRY_ADDRESS=0x90000000
173CONFIG_PHYS_OFFSET=0x10000000
174CONFIG_PREEMPT_NONE=y
175# CONFIG_PREEMPT_VOLUNTARY is not set
176# CONFIG_PREEMPT is not set
177CONFIG_QUICKLIST=y
178# CONFIG_HAVE_ARCH_BOOTMEM is not set
179# CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set
180# CONFIG_NEED_NODE_MEMMAP_SIZE is not set
181CONFIG_ARCH_FLATMEM_ENABLE=y
182# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
183# CONFIG_ARCH_SPARSEMEM_ENABLE is not set
184CONFIG_SELECT_MEMORY_MODEL=y
185CONFIG_FLATMEM_MANUAL=y
186# CONFIG_DISCONTIGMEM_MANUAL is not set
187# CONFIG_SPARSEMEM_MANUAL is not set
188CONFIG_FLATMEM=y
189CONFIG_FLAT_NODE_MEM_MAP=y
190CONFIG_PAGEFLAGS_EXTENDED=y
191CONFIG_SPLIT_PTLOCK_CPUS=4
192# CONFIG_PHYS_ADDR_T_64BIT is not set
193CONFIG_ZONE_DMA_FLAG=0
194CONFIG_NR_QUICK=2
195CONFIG_VIRT_TO_BUS=y
196CONFIG_UNEVICTABLE_LRU=y
197CONFIG_HAVE_MLOCK=y
198CONFIG_HAVE_MLOCKED_PAGE_BIT=y
199# CONFIG_OWNERSHIP_TRACE is not set
200# CONFIG_NMI_DEBUGGING is not set
201# CONFIG_HZ_100 is not set
202CONFIG_HZ_250=y
203# CONFIG_HZ_300 is not set
204# CONFIG_HZ_1000 is not set
205CONFIG_HZ=250
206# CONFIG_SCHED_HRTICK is not set
207CONFIG_CMDLINE=""
208
209#
210# Power management options
211#
212CONFIG_PM=y
213# CONFIG_PM_DEBUG is not set
214# CONFIG_SUSPEND is not set
215CONFIG_ARCH_SUSPEND_POSSIBLE=y
216
217#
218# CPU Frequency scaling
219#
220CONFIG_CPU_FREQ=y
221CONFIG_CPU_FREQ_TABLE=y
222# CONFIG_CPU_FREQ_DEBUG is not set
223CONFIG_CPU_FREQ_STAT=y
224# CONFIG_CPU_FREQ_STAT_DETAILS is not set
225CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
226# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
227# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
228# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
229# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
230CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
231CONFIG_CPU_FREQ_GOV_POWERSAVE=y
232CONFIG_CPU_FREQ_GOV_USERSPACE=y
233CONFIG_CPU_FREQ_GOV_ONDEMAND=y
234# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
235CONFIG_CPU_FREQ_AT32AP=y
236
237#
238# Bus options
239#
240# CONFIG_ARCH_SUPPORTS_MSI is not set
241# CONFIG_PCCARD is not set
242
243#
244# Executable file formats
245#
246CONFIG_BINFMT_ELF=y
247# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
248# CONFIG_HAVE_AOUT is not set
249# CONFIG_BINFMT_MISC is not set
250CONFIG_NET=y
251
252#
253# Networking options
254#
255CONFIG_PACKET=y
256CONFIG_PACKET_MMAP=y
257CONFIG_UNIX=y
258# CONFIG_NET_KEY is not set
259CONFIG_INET=y
260# CONFIG_IP_MULTICAST is not set
261# CONFIG_IP_ADVANCED_ROUTER is not set
262CONFIG_IP_FIB_HASH=y
263CONFIG_IP_PNP=y
264CONFIG_IP_PNP_DHCP=y
265# CONFIG_IP_PNP_BOOTP is not set
266# CONFIG_IP_PNP_RARP is not set
267# CONFIG_NET_IPIP is not set
268# CONFIG_NET_IPGRE is not set
269# CONFIG_ARPD is not set
270CONFIG_SYN_COOKIES=y
271# CONFIG_INET_AH is not set
272# CONFIG_INET_ESP is not set
273# CONFIG_INET_IPCOMP is not set
274# CONFIG_INET_XFRM_TUNNEL is not set
275# CONFIG_INET_TUNNEL is not set
276# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
277# CONFIG_INET_XFRM_MODE_TUNNEL is not set
278# CONFIG_INET_XFRM_MODE_BEET is not set
279# CONFIG_INET_LRO is not set
280CONFIG_INET_DIAG=y
281CONFIG_INET_TCP_DIAG=y
282# CONFIG_TCP_CONG_ADVANCED is not set
283CONFIG_TCP_CONG_CUBIC=y
284CONFIG_DEFAULT_TCP_CONG="cubic"
285# CONFIG_TCP_MD5SIG is not set
286# CONFIG_IPV6 is not set
287# CONFIG_NETWORK_SECMARK is not set
288# CONFIG_NETFILTER is not set
289# CONFIG_IP_DCCP is not set
290# CONFIG_IP_SCTP is not set
291# CONFIG_TIPC is not set
292# CONFIG_ATM is not set
293# CONFIG_BRIDGE is not set
294# CONFIG_NET_DSA is not set
295# CONFIG_VLAN_8021Q is not set
296# CONFIG_DECNET is not set
297# CONFIG_LLC2 is not set
298# CONFIG_IPX is not set
299# CONFIG_ATALK is not set
300# CONFIG_X25 is not set
301# CONFIG_LAPB is not set
302# CONFIG_ECONET is not set
303# CONFIG_WAN_ROUTER is not set
304# CONFIG_PHONET is not set
305# CONFIG_NET_SCHED is not set
306# CONFIG_DCB is not set
307
308#
309# Network testing
310#
311# CONFIG_NET_PKTGEN is not set
312# CONFIG_HAMRADIO is not set
313# CONFIG_CAN is not set
314# CONFIG_IRDA is not set
315CONFIG_BT=m
316CONFIG_BT_L2CAP=m
317# CONFIG_BT_SCO is not set
318CONFIG_BT_RFCOMM=m
319CONFIG_BT_RFCOMM_TTY=y
320# CONFIG_BT_BNEP is not set
321CONFIG_BT_HIDP=m
322
323#
324# Bluetooth device drivers
325#
326# CONFIG_BT_HCIBTSDIO is not set
327CONFIG_BT_HCIUART=m
328CONFIG_BT_HCIUART_H4=y
329CONFIG_BT_HCIUART_BCSP=y
330# CONFIG_BT_HCIUART_LL is not set
331# CONFIG_BT_HCIVHCI is not set
332# CONFIG_AF_RXRPC is not set
333# CONFIG_WIRELESS is not set
334# CONFIG_WIMAX is not set
335# CONFIG_RFKILL is not set
336# CONFIG_NET_9P is not set
337
338#
339# Device Drivers
340#
341
342#
343# Generic Driver Options
344#
345CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
346CONFIG_STANDALONE=y
347# CONFIG_PREVENT_FIRMWARE_BUILD is not set
348# CONFIG_FW_LOADER is not set
349# CONFIG_DEBUG_DRIVER is not set
350# CONFIG_DEBUG_DEVRES is not set
351# CONFIG_SYS_HYPERVISOR is not set
352# CONFIG_CONNECTOR is not set
353CONFIG_MTD=y
354# CONFIG_MTD_DEBUG is not set
355# CONFIG_MTD_CONCAT is not set
356CONFIG_MTD_PARTITIONS=y
357# CONFIG_MTD_TESTS is not set
358# CONFIG_MTD_REDBOOT_PARTS is not set
359CONFIG_MTD_CMDLINE_PARTS=y
360# CONFIG_MTD_AR7_PARTS is not set
361
362#
363# User Modules And Translation Layers
364#
365CONFIG_MTD_CHAR=y
366CONFIG_MTD_BLKDEVS=y
367CONFIG_MTD_BLOCK=y
368# CONFIG_FTL is not set
369# CONFIG_NFTL is not set
370# CONFIG_INFTL is not set
371# CONFIG_RFD_FTL is not set
372# CONFIG_SSFDC is not set
373# CONFIG_MTD_OOPS is not set
374
375#
376# RAM/ROM/Flash chip drivers
377#
378CONFIG_MTD_CFI=y
379# CONFIG_MTD_JEDECPROBE is not set
380CONFIG_MTD_GEN_PROBE=y
381# CONFIG_MTD_CFI_ADV_OPTIONS is not set
382CONFIG_MTD_MAP_BANK_WIDTH_1=y
383CONFIG_MTD_MAP_BANK_WIDTH_2=y
384CONFIG_MTD_MAP_BANK_WIDTH_4=y
385# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
386# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
387# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
388CONFIG_MTD_CFI_I1=y
389CONFIG_MTD_CFI_I2=y
390# CONFIG_MTD_CFI_I4 is not set
391# CONFIG_MTD_CFI_I8 is not set
392# CONFIG_MTD_CFI_INTELEXT is not set
393CONFIG_MTD_CFI_AMDSTD=y
394# CONFIG_MTD_CFI_STAA is not set
395CONFIG_MTD_CFI_UTIL=y
396# CONFIG_MTD_RAM is not set
397# CONFIG_MTD_ROM is not set
398# CONFIG_MTD_ABSENT is not set
399
400#
401# Mapping drivers for chip access
402#
403# CONFIG_MTD_COMPLEX_MAPPINGS is not set
404CONFIG_MTD_PHYSMAP=y
405# CONFIG_MTD_PHYSMAP_COMPAT is not set
406# CONFIG_MTD_PLATRAM is not set
407
408#
409# Self-contained MTD device drivers
410#
411CONFIG_MTD_DATAFLASH=y
412# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
413# CONFIG_MTD_DATAFLASH_OTP is not set
414# CONFIG_MTD_M25P80 is not set
415# CONFIG_MTD_SLRAM is not set
416# CONFIG_MTD_PHRAM is not set
417# CONFIG_MTD_MTDRAM is not set
418# CONFIG_MTD_BLOCK2MTD is not set
419
420#
421# Disk-On-Chip Device Drivers
422#
423# CONFIG_MTD_DOC2000 is not set
424# CONFIG_MTD_DOC2001 is not set
425# CONFIG_MTD_DOC2001PLUS is not set
426# CONFIG_MTD_NAND is not set
427# CONFIG_MTD_ONENAND is not set
428
429#
430# LPDDR flash memory drivers
431#
432# CONFIG_MTD_LPDDR is not set
433
434#
435# UBI - Unsorted block images
436#
437# CONFIG_MTD_UBI is not set
438# CONFIG_PARPORT is not set
439CONFIG_BLK_DEV=y
440# CONFIG_BLK_DEV_COW_COMMON is not set
441CONFIG_BLK_DEV_LOOP=y
442# CONFIG_BLK_DEV_CRYPTOLOOP is not set
443# CONFIG_BLK_DEV_NBD is not set
444# CONFIG_BLK_DEV_RAM is not set
445# CONFIG_CDROM_PKTCDVD is not set
446# CONFIG_ATA_OVER_ETH is not set
447CONFIG_MISC_DEVICES=y
448CONFIG_ATMEL_PWM=y
449# CONFIG_ATMEL_TCLIB is not set
450# CONFIG_ICS932S401 is not set
451# CONFIG_ATMEL_SSC is not set
452# CONFIG_ENCLOSURE_SERVICES is not set
453# CONFIG_ISL29003 is not set
454# CONFIG_C2PORT is not set
455
456#
457# EEPROM support
458#
459# CONFIG_EEPROM_AT24 is not set
460# CONFIG_EEPROM_AT25 is not set
461# CONFIG_EEPROM_LEGACY is not set
462# CONFIG_EEPROM_93CX6 is not set
463
464#
465# SCSI device support
466#
467# CONFIG_RAID_ATTRS is not set
468# CONFIG_SCSI is not set
469# CONFIG_SCSI_DMA is not set
470# CONFIG_SCSI_NETLINK is not set
471# CONFIG_ATA is not set
472# CONFIG_MD is not set
473CONFIG_NETDEVICES=y
474CONFIG_COMPAT_NET_DEV_OPS=y
475# CONFIG_DUMMY is not set
476# CONFIG_BONDING is not set
477# CONFIG_MACVLAN is not set
478# CONFIG_EQUALIZER is not set
479# CONFIG_TUN is not set
480# CONFIG_VETH is not set
481CONFIG_PHYLIB=y
482
483#
484# MII PHY device drivers
485#
486# CONFIG_MARVELL_PHY is not set
487# CONFIG_DAVICOM_PHY is not set
488# CONFIG_QSEMI_PHY is not set
489# CONFIG_LXT_PHY is not set
490# CONFIG_CICADA_PHY is not set
491# CONFIG_VITESSE_PHY is not set
492# CONFIG_SMSC_PHY is not set
493# CONFIG_BROADCOM_PHY is not set
494# CONFIG_ICPLUS_PHY is not set
495# CONFIG_REALTEK_PHY is not set
496# CONFIG_NATIONAL_PHY is not set
497# CONFIG_STE10XP is not set
498# CONFIG_LSI_ET1011C_PHY is not set
499# CONFIG_FIXED_PHY is not set
500# CONFIG_MDIO_BITBANG is not set
501CONFIG_NET_ETHERNET=y
502# CONFIG_MII is not set
503CONFIG_MACB=y
504# CONFIG_ENC28J60 is not set
505# CONFIG_ETHOC is not set
506# CONFIG_DNET is not set
507# CONFIG_IBM_NEW_EMAC_ZMII is not set
508# CONFIG_IBM_NEW_EMAC_RGMII is not set
509# CONFIG_IBM_NEW_EMAC_TAH is not set
510# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
511# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
512# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
513# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
514# CONFIG_B44 is not set
515# CONFIG_NETDEV_1000 is not set
516# CONFIG_NETDEV_10000 is not set
517
518#
519# Wireless LAN
520#
521# CONFIG_WLAN_PRE80211 is not set
522# CONFIG_WLAN_80211 is not set
523
524#
525# Enable WiMAX (Networking options) to see the WiMAX drivers
526#
527# CONFIG_WAN is not set
528# CONFIG_PPP is not set
529# CONFIG_SLIP is not set
530# CONFIG_NETCONSOLE is not set
531# CONFIG_NETPOLL is not set
532# CONFIG_NET_POLL_CONTROLLER is not set
533# CONFIG_ISDN is not set
534# CONFIG_PHONE is not set
535
536#
537# Input device support
538#
539CONFIG_INPUT=y
540# CONFIG_INPUT_FF_MEMLESS is not set
541# CONFIG_INPUT_POLLDEV is not set
542
543#
544# Userland interfaces
545#
546# CONFIG_INPUT_MOUSEDEV is not set
547# CONFIG_INPUT_JOYDEV is not set
548CONFIG_INPUT_EVDEV=y
549# CONFIG_INPUT_EVBUG is not set
550
551#
552# Input Device Drivers
553#
554CONFIG_INPUT_KEYBOARD=y
555# CONFIG_KEYBOARD_ATKBD is not set
556# CONFIG_KEYBOARD_SUNKBD is not set
557# CONFIG_KEYBOARD_LKKBD is not set
558# CONFIG_KEYBOARD_XTKBD is not set
559# CONFIG_KEYBOARD_NEWTON is not set
560# CONFIG_KEYBOARD_STOWAWAY is not set
561CONFIG_KEYBOARD_GPIO=y
562# CONFIG_INPUT_MOUSE is not set
563# CONFIG_INPUT_JOYSTICK is not set
564# CONFIG_INPUT_TABLET is not set
565CONFIG_INPUT_TOUCHSCREEN=y
566CONFIG_TOUCHSCREEN_ADS7846=m
567# CONFIG_TOUCHSCREEN_FUJITSU is not set
568# CONFIG_TOUCHSCREEN_GUNZE is not set
569# CONFIG_TOUCHSCREEN_ELO is not set
570# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
571# CONFIG_TOUCHSCREEN_MTOUCH is not set
572# CONFIG_TOUCHSCREEN_INEXIO is not set
573# CONFIG_TOUCHSCREEN_MK712 is not set
574# CONFIG_TOUCHSCREEN_PENMOUNT is not set
575# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
576# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
577# CONFIG_TOUCHSCREEN_WM97XX is not set
578# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
579# CONFIG_TOUCHSCREEN_TSC2007 is not set
580# CONFIG_INPUT_MISC is not set
581
582#
583# Hardware I/O ports
584#
585# CONFIG_SERIO is not set
586# CONFIG_GAMEPORT is not set
587
588#
589# Character devices
590#
591CONFIG_VT=y
592CONFIG_CONSOLE_TRANSLATIONS=y
593CONFIG_VT_CONSOLE=y
594CONFIG_HW_CONSOLE=y
595CONFIG_VT_HW_CONSOLE_BINDING=y
596CONFIG_DEVKMEM=y
597# CONFIG_SERIAL_NONSTANDARD is not set
598
599#
600# Serial drivers
601#
602# CONFIG_SERIAL_8250 is not set
603
604#
605# Non-8250 serial port support
606#
607CONFIG_SERIAL_ATMEL=y
608CONFIG_SERIAL_ATMEL_CONSOLE=y
609CONFIG_SERIAL_ATMEL_PDC=y
610# CONFIG_SERIAL_ATMEL_TTYAT is not set
611# CONFIG_SERIAL_MAX3100 is not set
612CONFIG_SERIAL_CORE=y
613CONFIG_SERIAL_CORE_CONSOLE=y
614CONFIG_UNIX98_PTYS=y
615# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
616# CONFIG_LEGACY_PTYS is not set
617# CONFIG_IPMI_HANDLER is not set
618# CONFIG_HW_RANDOM is not set
619# CONFIG_R3964 is not set
620# CONFIG_RAW_DRIVER is not set
621# CONFIG_TCG_TPM is not set
622CONFIG_I2C=y
623CONFIG_I2C_BOARDINFO=y
624CONFIG_I2C_CHARDEV=y
625CONFIG_I2C_HELPER_AUTO=y
626CONFIG_I2C_ALGOBIT=y
627
628#
629# I2C Hardware Bus support
630#
631
632#
633# I2C system bus drivers (mostly embedded / system-on-chip)
634#
635CONFIG_I2C_GPIO=y
636# CONFIG_I2C_OCORES is not set
637# CONFIG_I2C_SIMTEC is not set
638
639#
640# External I2C/SMBus adapter drivers
641#
642# CONFIG_I2C_PARPORT_LIGHT is not set
643# CONFIG_I2C_TAOS_EVM is not set
644
645#
646# Other I2C/SMBus bus drivers
647#
648# CONFIG_I2C_PCA_PLATFORM is not set
649# CONFIG_I2C_STUB is not set
650
651#
652# Miscellaneous I2C Chip support
653#
654# CONFIG_DS1682 is not set
655# CONFIG_SENSORS_PCF8574 is not set
656# CONFIG_PCF8575 is not set
657# CONFIG_SENSORS_PCA9539 is not set
658# CONFIG_SENSORS_MAX6875 is not set
659# CONFIG_SENSORS_TSL2550 is not set
660# CONFIG_I2C_DEBUG_CORE is not set
661# CONFIG_I2C_DEBUG_ALGO is not set
662# CONFIG_I2C_DEBUG_BUS is not set
663# CONFIG_I2C_DEBUG_CHIP is not set
664CONFIG_SPI=y
665# CONFIG_SPI_DEBUG is not set
666CONFIG_SPI_MASTER=y
667
668#
669# SPI Master Controller Drivers
670#
671CONFIG_SPI_ATMEL=y
672# CONFIG_SPI_BITBANG is not set
673# CONFIG_SPI_GPIO is not set
674
675#
676# SPI Protocol Masters
677#
678CONFIG_SPI_SPIDEV=y
679# CONFIG_SPI_TLE62X0 is not set
680CONFIG_ARCH_REQUIRE_GPIOLIB=y
681CONFIG_GPIOLIB=y
682# CONFIG_DEBUG_GPIO is not set
683# CONFIG_GPIO_SYSFS is not set
684
685#
686# Memory mapped GPIO expanders:
687#
688
689#
690# I2C GPIO expanders:
691#
692# CONFIG_GPIO_MAX732X is not set
693# CONFIG_GPIO_PCA953X is not set
694# CONFIG_GPIO_PCF857X is not set
695
696#
697# PCI GPIO expanders:
698#
699
700#
701# SPI GPIO expanders:
702#
703# CONFIG_GPIO_MAX7301 is not set
704# CONFIG_GPIO_MCP23S08 is not set
705# CONFIG_W1 is not set
706# CONFIG_POWER_SUPPLY is not set
707CONFIG_HWMON=y
708# CONFIG_HWMON_VID is not set
709# CONFIG_SENSORS_AD7414 is not set
710# CONFIG_SENSORS_AD7418 is not set
711# CONFIG_SENSORS_ADCXX is not set
712# CONFIG_SENSORS_ADM1021 is not set
713# CONFIG_SENSORS_ADM1025 is not set
714# CONFIG_SENSORS_ADM1026 is not set
715# CONFIG_SENSORS_ADM1029 is not set
716# CONFIG_SENSORS_ADM1031 is not set
717# CONFIG_SENSORS_ADM9240 is not set
718# CONFIG_SENSORS_ADT7462 is not set
719# CONFIG_SENSORS_ADT7470 is not set
720# CONFIG_SENSORS_ADT7473 is not set
721# CONFIG_SENSORS_ADT7475 is not set
722# CONFIG_SENSORS_ATXP1 is not set
723# CONFIG_SENSORS_DS1621 is not set
724# CONFIG_SENSORS_F71805F is not set
725# CONFIG_SENSORS_F71882FG is not set
726# CONFIG_SENSORS_F75375S is not set
727# CONFIG_SENSORS_G760A is not set
728# CONFIG_SENSORS_GL518SM is not set
729# CONFIG_SENSORS_GL520SM is not set
730# CONFIG_SENSORS_IT87 is not set
731# CONFIG_SENSORS_LM63 is not set
732# CONFIG_SENSORS_LM70 is not set
733# CONFIG_SENSORS_LM75 is not set
734# CONFIG_SENSORS_LM77 is not set
735# CONFIG_SENSORS_LM78 is not set
736# CONFIG_SENSORS_LM80 is not set
737# CONFIG_SENSORS_LM83 is not set
738# CONFIG_SENSORS_LM85 is not set
739# CONFIG_SENSORS_LM87 is not set
740# CONFIG_SENSORS_LM90 is not set
741# CONFIG_SENSORS_LM92 is not set
742# CONFIG_SENSORS_LM93 is not set
743# CONFIG_SENSORS_LTC4215 is not set
744# CONFIG_SENSORS_LTC4245 is not set
745# CONFIG_SENSORS_LM95241 is not set
746# CONFIG_SENSORS_MAX1111 is not set
747# CONFIG_SENSORS_MAX1619 is not set
748# CONFIG_SENSORS_MAX6650 is not set
749# CONFIG_SENSORS_PC87360 is not set
750# CONFIG_SENSORS_PC87427 is not set
751# CONFIG_SENSORS_PCF8591 is not set
752# CONFIG_SENSORS_DME1737 is not set
753# CONFIG_SENSORS_SMSC47M1 is not set
754# CONFIG_SENSORS_SMSC47M192 is not set
755# CONFIG_SENSORS_SMSC47B397 is not set
756# CONFIG_SENSORS_ADS7828 is not set
757# CONFIG_SENSORS_THMC50 is not set
758# CONFIG_SENSORS_VT1211 is not set
759# CONFIG_SENSORS_W83781D is not set
760# CONFIG_SENSORS_W83791D is not set
761# CONFIG_SENSORS_W83792D is not set
762# CONFIG_SENSORS_W83793 is not set
763# CONFIG_SENSORS_W83L785TS is not set
764# CONFIG_SENSORS_W83L786NG is not set
765# CONFIG_SENSORS_W83627HF is not set
766# CONFIG_SENSORS_W83627EHF is not set
767# CONFIG_SENSORS_LIS3_SPI is not set
768# CONFIG_HWMON_DEBUG_CHIP is not set
769# CONFIG_THERMAL is not set
770# CONFIG_THERMAL_HWMON is not set
771CONFIG_WATCHDOG=y
772# CONFIG_WATCHDOG_NOWAYOUT is not set
773
774#
775# Watchdog Device Drivers
776#
777# CONFIG_SOFT_WATCHDOG is not set
778CONFIG_AT32AP700X_WDT=y
779CONFIG_SSB_POSSIBLE=y
780
781#
782# Sonics Silicon Backplane
783#
784# CONFIG_SSB is not set
785
786#
787# Multifunction device drivers
788#
789# CONFIG_MFD_CORE is not set
790# CONFIG_MFD_SM501 is not set
791# CONFIG_HTC_PASIC3 is not set
792# CONFIG_UCB1400_CORE is not set
793# CONFIG_TPS65010 is not set
794# CONFIG_TWL4030_CORE is not set
795# CONFIG_MFD_TMIO is not set
796# CONFIG_PMIC_DA903X is not set
797# CONFIG_MFD_WM8400 is not set
798# CONFIG_MFD_WM8350_I2C is not set
799# CONFIG_MFD_PCF50633 is not set
800# CONFIG_REGULATOR is not set
801
802#
803# Multimedia devices
804#
805
806#
807# Multimedia core support
808#
809# CONFIG_VIDEO_DEV is not set
810# CONFIG_DVB_CORE is not set
811# CONFIG_VIDEO_MEDIA is not set
812
813#
814# Multimedia drivers
815#
816# CONFIG_DAB is not set
817
818#
819# Graphics support
820#
821# CONFIG_VGASTATE is not set
822# CONFIG_VIDEO_OUTPUT_CONTROL is not set
823CONFIG_FB=y
824# CONFIG_FIRMWARE_EDID is not set
825# CONFIG_FB_DDC is not set
826# CONFIG_FB_BOOT_VESA_SUPPORT is not set
827CONFIG_FB_CFB_FILLRECT=y
828CONFIG_FB_CFB_COPYAREA=y
829CONFIG_FB_CFB_IMAGEBLIT=y
830# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
831# CONFIG_FB_SYS_FILLRECT is not set
832# CONFIG_FB_SYS_COPYAREA is not set
833# CONFIG_FB_SYS_IMAGEBLIT is not set
834# CONFIG_FB_FOREIGN_ENDIAN is not set
835# CONFIG_FB_SYS_FOPS is not set
836# CONFIG_FB_SVGALIB is not set
837# CONFIG_FB_MACMODES is not set
838# CONFIG_FB_BACKLIGHT is not set
839# CONFIG_FB_MODE_HELPERS is not set
840# CONFIG_FB_TILEBLITTING is not set
841
842#
843# Frame buffer hardware drivers
844#
845# CONFIG_FB_S1D13XXX is not set
846CONFIG_FB_ATMEL=y
847# CONFIG_FB_VIRTUAL is not set
848# CONFIG_FB_METRONOME is not set
849# CONFIG_FB_MB862XX is not set
850# CONFIG_FB_BROADSHEET is not set
851CONFIG_BACKLIGHT_LCD_SUPPORT=y
852CONFIG_LCD_CLASS_DEVICE=y
853# CONFIG_LCD_LTV350QV is not set
854# CONFIG_LCD_ILI9320 is not set
855# CONFIG_LCD_TDO24M is not set
856# CONFIG_LCD_VGG2432A4 is not set
857# CONFIG_LCD_PLATFORM is not set
858CONFIG_BACKLIGHT_CLASS_DEVICE=y
859# CONFIG_BACKLIGHT_ATMEL_LCDC is not set
860# CONFIG_BACKLIGHT_ATMEL_PWM is not set
861CONFIG_BACKLIGHT_GENERIC=y
862
863#
864# Display device support
865#
866# CONFIG_DISPLAY_SUPPORT is not set
867
868#
869# Console display driver support
870#
871CONFIG_DUMMY_CONSOLE=y
872# CONFIG_FRAMEBUFFER_CONSOLE is not set
873# CONFIG_LOGO is not set
874CONFIG_SOUND=m
875CONFIG_SOUND_OSS_CORE=y
876CONFIG_SND=m
877CONFIG_SND_TIMER=m
878CONFIG_SND_PCM=m
879# CONFIG_SND_SEQUENCER is not set
880CONFIG_SND_OSSEMUL=y
881CONFIG_SND_MIXER_OSS=m
882CONFIG_SND_PCM_OSS=m
883CONFIG_SND_PCM_OSS_PLUGINS=y
884# CONFIG_SND_DYNAMIC_MINORS is not set
885# CONFIG_SND_SUPPORT_OLD_API is not set
886# CONFIG_SND_VERBOSE_PROCFS is not set
887# CONFIG_SND_VERBOSE_PRINTK is not set
888# CONFIG_SND_DEBUG is not set
889CONFIG_SND_VMASTER=y
890CONFIG_SND_AC97_CODEC=m
891CONFIG_SND_DRIVERS=y
892# CONFIG_SND_DUMMY is not set
893# CONFIG_SND_MTPAV is not set
894# CONFIG_SND_SERIAL_U16550 is not set
895# CONFIG_SND_MPU401 is not set
896# CONFIG_SND_AC97_POWER_SAVE is not set
897
898#
899# Atmel devices (AVR32 and AT91)
900#
901# CONFIG_SND_ATMEL_ABDAC is not set
902CONFIG_SND_ATMEL_AC97C=m
903# CONFIG_SND_SPI is not set
904# CONFIG_SND_SOC is not set
905# CONFIG_SOUND_PRIME is not set
906CONFIG_AC97_BUS=m
907CONFIG_HID_SUPPORT=y
908CONFIG_HID=y
909# CONFIG_HID_DEBUG is not set
910# CONFIG_HIDRAW is not set
911# CONFIG_HID_PID is not set
912
913#
914# Special HID drivers
915#
916# CONFIG_HID_APPLE is not set
917CONFIG_USB_SUPPORT=y
918# CONFIG_USB_ARCH_HAS_HCD is not set
919# CONFIG_USB_ARCH_HAS_OHCI is not set
920# CONFIG_USB_ARCH_HAS_EHCI is not set
921# CONFIG_USB_OTG_WHITELIST is not set
922# CONFIG_USB_OTG_BLACKLIST_HUB is not set
923# CONFIG_USB_MUSB_HDRC is not set
924# CONFIG_USB_GADGET_MUSB_HDRC is not set
925
926#
927# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
928#
929CONFIG_USB_GADGET=m
930# CONFIG_USB_GADGET_DEBUG is not set
931CONFIG_USB_GADGET_DEBUG_FILES=y
932# CONFIG_USB_GADGET_DEBUG_FS is not set
933CONFIG_USB_GADGET_VBUS_DRAW=2
934CONFIG_USB_GADGET_SELECTED=y
935# CONFIG_USB_GADGET_AT91 is not set
936CONFIG_USB_GADGET_ATMEL_USBA=y
937CONFIG_USB_ATMEL_USBA=m
938# CONFIG_USB_GADGET_FSL_USB2 is not set
939# CONFIG_USB_GADGET_LH7A40X is not set
940# CONFIG_USB_GADGET_OMAP is not set
941# CONFIG_USB_GADGET_PXA25X is not set
942# CONFIG_USB_GADGET_PXA27X is not set
943# CONFIG_USB_GADGET_S3C2410 is not set
944# CONFIG_USB_GADGET_IMX is not set
945# CONFIG_USB_GADGET_M66592 is not set
946# CONFIG_USB_GADGET_AMD5536UDC is not set
947# CONFIG_USB_GADGET_FSL_QE is not set
948# CONFIG_USB_GADGET_CI13XXX is not set
949# CONFIG_USB_GADGET_NET2280 is not set
950# CONFIG_USB_GADGET_GOKU is not set
951# CONFIG_USB_GADGET_DUMMY_HCD is not set
952CONFIG_USB_GADGET_DUALSPEED=y
953# CONFIG_USB_ZERO is not set
954# CONFIG_USB_ETH is not set
955# CONFIG_USB_GADGETFS is not set
956CONFIG_USB_FILE_STORAGE=m
957# CONFIG_USB_FILE_STORAGE_TEST is not set
958CONFIG_USB_G_SERIAL=m
959# CONFIG_USB_MIDI_GADGET is not set
960# CONFIG_USB_G_PRINTER is not set
961# CONFIG_USB_CDC_COMPOSITE is not set
962
963#
964# OTG and related infrastructure
965#
966# CONFIG_USB_GPIO_VBUS is not set
967# CONFIG_NOP_USB_XCEIV is not set
968CONFIG_MMC=y
969# CONFIG_MMC_DEBUG is not set
970# CONFIG_MMC_UNSAFE_RESUME is not set
971
972#
973# MMC/SD/SDIO Card Drivers
974#
975CONFIG_MMC_BLOCK=y
976CONFIG_MMC_BLOCK_BOUNCE=y
977# CONFIG_SDIO_UART is not set
978# CONFIG_MMC_TEST is not set
979
980#
981# MMC/SD/SDIO Host Controller Drivers
982#
983# CONFIG_MMC_SDHCI is not set
984CONFIG_MMC_ATMELMCI=y
985# CONFIG_MMC_ATMELMCI_DMA is not set
986# CONFIG_MMC_SPI is not set
987# CONFIG_MEMSTICK is not set
988CONFIG_NEW_LEDS=y
989CONFIG_LEDS_CLASS=y
990
991#
992# LED drivers
993#
994CONFIG_LEDS_ATMEL_PWM=y
995# CONFIG_LEDS_PCA9532 is not set
996CONFIG_LEDS_GPIO=y
997CONFIG_LEDS_GPIO_PLATFORM=y
998# CONFIG_LEDS_LP5521 is not set
999# CONFIG_LEDS_PCA955X is not set
1000# CONFIG_LEDS_DAC124S085 is not set
1001# CONFIG_LEDS_BD2802 is not set
1002
1003#
1004# LED Triggers
1005#
1006CONFIG_LEDS_TRIGGERS=y
1007CONFIG_LEDS_TRIGGER_TIMER=y
1008CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1009# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1010# CONFIG_LEDS_TRIGGER_GPIO is not set
1011# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1012
1013#
1014# iptables trigger is under Netfilter config (LED target)
1015#
1016# CONFIG_ACCESSIBILITY is not set
1017CONFIG_RTC_LIB=m
1018CONFIG_RTC_CLASS=m
1019
1020#
1021# RTC interfaces
1022#
1023CONFIG_RTC_INTF_SYSFS=y
1024CONFIG_RTC_INTF_PROC=y
1025CONFIG_RTC_INTF_DEV=y
1026# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1027# CONFIG_RTC_DRV_TEST is not set
1028
1029#
1030# I2C RTC drivers
1031#
1032# CONFIG_RTC_DRV_DS1307 is not set
1033# CONFIG_RTC_DRV_DS1374 is not set
1034# CONFIG_RTC_DRV_DS1672 is not set
1035# CONFIG_RTC_DRV_MAX6900 is not set
1036# CONFIG_RTC_DRV_RS5C372 is not set
1037# CONFIG_RTC_DRV_ISL1208 is not set
1038# CONFIG_RTC_DRV_X1205 is not set
1039# CONFIG_RTC_DRV_PCF8563 is not set
1040# CONFIG_RTC_DRV_PCF8583 is not set
1041# CONFIG_RTC_DRV_M41T80 is not set
1042CONFIG_RTC_DRV_S35390A=m
1043# CONFIG_RTC_DRV_FM3130 is not set
1044# CONFIG_RTC_DRV_RX8581 is not set
1045
1046#
1047# SPI RTC drivers
1048#
1049# CONFIG_RTC_DRV_M41T94 is not set
1050# CONFIG_RTC_DRV_DS1305 is not set
1051# CONFIG_RTC_DRV_DS1390 is not set
1052# CONFIG_RTC_DRV_MAX6902 is not set
1053# CONFIG_RTC_DRV_R9701 is not set
1054# CONFIG_RTC_DRV_RS5C348 is not set
1055# CONFIG_RTC_DRV_DS3234 is not set
1056
1057#
1058# Platform RTC drivers
1059#
1060# CONFIG_RTC_DRV_DS1286 is not set
1061# CONFIG_RTC_DRV_DS1511 is not set
1062# CONFIG_RTC_DRV_DS1553 is not set
1063# CONFIG_RTC_DRV_DS1742 is not set
1064# CONFIG_RTC_DRV_STK17TA8 is not set
1065# CONFIG_RTC_DRV_M48T86 is not set
1066# CONFIG_RTC_DRV_M48T35 is not set
1067# CONFIG_RTC_DRV_M48T59 is not set
1068# CONFIG_RTC_DRV_BQ4802 is not set
1069# CONFIG_RTC_DRV_V3020 is not set
1070
1071#
1072# on-CPU RTC drivers
1073#
1074CONFIG_RTC_DRV_AT32AP700X=m
1075CONFIG_DMADEVICES=y
1076
1077#
1078# DMA Devices
1079#
1080CONFIG_DW_DMAC=y
1081CONFIG_DMA_ENGINE=y
1082
1083#
1084# DMA Clients
1085#
1086# CONFIG_NET_DMA is not set
1087# CONFIG_ASYNC_TX_DMA is not set
1088# CONFIG_DMATEST is not set
1089# CONFIG_AUXDISPLAY is not set
1090CONFIG_UIO=y
1091# CONFIG_UIO_PDRV is not set
1092# CONFIG_UIO_PDRV_GENIRQ is not set
1093# CONFIG_UIO_SMX is not set
1094# CONFIG_UIO_SERCOS3 is not set
1095# CONFIG_STAGING is not set
1096
1097#
1098# File systems
1099#
1100CONFIG_EXT2_FS=y
1101CONFIG_EXT2_FS_XATTR=y
1102# CONFIG_EXT2_FS_POSIX_ACL is not set
1103# CONFIG_EXT2_FS_SECURITY is not set
1104# CONFIG_EXT2_FS_XIP is not set
1105CONFIG_EXT3_FS=y
1106# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1107CONFIG_EXT3_FS_XATTR=y
1108# CONFIG_EXT3_FS_POSIX_ACL is not set
1109# CONFIG_EXT3_FS_SECURITY is not set
1110# CONFIG_EXT4_FS is not set
1111CONFIG_JBD=y
1112# CONFIG_JBD_DEBUG is not set
1113CONFIG_FS_MBCACHE=y
1114# CONFIG_REISERFS_FS is not set
1115# CONFIG_JFS_FS is not set
1116# CONFIG_FS_POSIX_ACL is not set
1117CONFIG_FILE_LOCKING=y
1118# CONFIG_XFS_FS is not set
1119# CONFIG_OCFS2_FS is not set
1120# CONFIG_BTRFS_FS is not set
1121# CONFIG_DNOTIFY is not set
1122# CONFIG_INOTIFY is not set
1123# CONFIG_QUOTA is not set
1124# CONFIG_AUTOFS_FS is not set
1125# CONFIG_AUTOFS4_FS is not set
1126# CONFIG_FUSE_FS is not set
1127
1128#
1129# Caches
1130#
1131# CONFIG_FSCACHE is not set
1132
1133#
1134# CD-ROM/DVD Filesystems
1135#
1136# CONFIG_ISO9660_FS is not set
1137# CONFIG_UDF_FS is not set
1138
1139#
1140# DOS/FAT/NT Filesystems
1141#
1142CONFIG_FAT_FS=y
1143CONFIG_MSDOS_FS=y
1144CONFIG_VFAT_FS=y
1145CONFIG_FAT_DEFAULT_CODEPAGE=850
1146CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1147CONFIG_NTFS_FS=m
1148# CONFIG_NTFS_DEBUG is not set
1149CONFIG_NTFS_RW=y
1150
1151#
1152# Pseudo filesystems
1153#
1154CONFIG_PROC_FS=y
1155# CONFIG_PROC_KCORE is not set
1156CONFIG_PROC_SYSCTL=y
1157CONFIG_PROC_PAGE_MONITOR=y
1158CONFIG_SYSFS=y
1159CONFIG_TMPFS=y
1160# CONFIG_TMPFS_POSIX_ACL is not set
1161# CONFIG_HUGETLB_PAGE is not set
1162CONFIG_CONFIGFS_FS=y
1163CONFIG_MISC_FILESYSTEMS=y
1164# CONFIG_ADFS_FS is not set
1165# CONFIG_AFFS_FS is not set
1166# CONFIG_HFS_FS is not set
1167# CONFIG_HFSPLUS_FS is not set
1168# CONFIG_BEFS_FS is not set
1169# CONFIG_BFS_FS is not set
1170# CONFIG_EFS_FS is not set
1171CONFIG_JFFS2_FS=y
1172CONFIG_JFFS2_FS_DEBUG=0
1173CONFIG_JFFS2_FS_WRITEBUFFER=y
1174# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1175# CONFIG_JFFS2_SUMMARY is not set
1176# CONFIG_JFFS2_FS_XATTR is not set
1177# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1178CONFIG_JFFS2_ZLIB=y
1179# CONFIG_JFFS2_LZO is not set
1180CONFIG_JFFS2_RTIME=y
1181# CONFIG_JFFS2_RUBIN is not set
1182# CONFIG_CRAMFS is not set
1183# CONFIG_SQUASHFS is not set
1184# CONFIG_VXFS_FS is not set
1185# CONFIG_MINIX_FS is not set
1186# CONFIG_OMFS_FS is not set
1187# CONFIG_HPFS_FS is not set
1188# CONFIG_QNX4FS_FS is not set
1189# CONFIG_ROMFS_FS is not set
1190# CONFIG_SYSV_FS is not set
1191# CONFIG_UFS_FS is not set
1192# CONFIG_NILFS2_FS is not set
1193CONFIG_NETWORK_FILESYSTEMS=y
1194CONFIG_NFS_FS=y
1195CONFIG_NFS_V3=y
1196# CONFIG_NFS_V3_ACL is not set
1197# CONFIG_NFS_V4 is not set
1198CONFIG_ROOT_NFS=y
1199# CONFIG_NFSD is not set
1200CONFIG_LOCKD=y
1201CONFIG_LOCKD_V4=y
1202CONFIG_NFS_COMMON=y
1203CONFIG_SUNRPC=y
1204# CONFIG_RPCSEC_GSS_KRB5 is not set
1205# CONFIG_RPCSEC_GSS_SPKM3 is not set
1206CONFIG_SMB_FS=m
1207CONFIG_SMB_NLS_DEFAULT=y
1208CONFIG_SMB_NLS_REMOTE="cp437"
1209CONFIG_CIFS=m
1210CONFIG_CIFS_STATS=y
1211# CONFIG_CIFS_STATS2 is not set
1212CONFIG_CIFS_WEAK_PW_HASH=y
1213CONFIG_CIFS_XATTR=y
1214CONFIG_CIFS_POSIX=y
1215# CONFIG_CIFS_DEBUG2 is not set
1216# CONFIG_CIFS_EXPERIMENTAL is not set
1217# CONFIG_NCP_FS is not set
1218# CONFIG_CODA_FS is not set
1219# CONFIG_AFS_FS is not set
1220
1221#
1222# Partition Types
1223#
1224# CONFIG_PARTITION_ADVANCED is not set
1225CONFIG_MSDOS_PARTITION=y
1226CONFIG_NLS=y
1227CONFIG_NLS_DEFAULT="iso8859-1"
1228CONFIG_NLS_CODEPAGE_437=y
1229# CONFIG_NLS_CODEPAGE_737 is not set
1230# CONFIG_NLS_CODEPAGE_775 is not set
1231CONFIG_NLS_CODEPAGE_850=y
1232# CONFIG_NLS_CODEPAGE_852 is not set
1233# CONFIG_NLS_CODEPAGE_855 is not set
1234# CONFIG_NLS_CODEPAGE_857 is not set
1235# CONFIG_NLS_CODEPAGE_860 is not set
1236# CONFIG_NLS_CODEPAGE_861 is not set
1237# CONFIG_NLS_CODEPAGE_862 is not set
1238# CONFIG_NLS_CODEPAGE_863 is not set
1239# CONFIG_NLS_CODEPAGE_864 is not set
1240# CONFIG_NLS_CODEPAGE_865 is not set
1241# CONFIG_NLS_CODEPAGE_866 is not set
1242# CONFIG_NLS_CODEPAGE_869 is not set
1243# CONFIG_NLS_CODEPAGE_936 is not set
1244# CONFIG_NLS_CODEPAGE_950 is not set
1245# CONFIG_NLS_CODEPAGE_932 is not set
1246# CONFIG_NLS_CODEPAGE_949 is not set
1247# CONFIG_NLS_CODEPAGE_874 is not set
1248# CONFIG_NLS_ISO8859_8 is not set
1249# CONFIG_NLS_CODEPAGE_1250 is not set
1250# CONFIG_NLS_CODEPAGE_1251 is not set
1251# CONFIG_NLS_ASCII is not set
1252CONFIG_NLS_ISO8859_1=y
1253# CONFIG_NLS_ISO8859_2 is not set
1254# CONFIG_NLS_ISO8859_3 is not set
1255# CONFIG_NLS_ISO8859_4 is not set
1256# CONFIG_NLS_ISO8859_5 is not set
1257# CONFIG_NLS_ISO8859_6 is not set
1258# CONFIG_NLS_ISO8859_7 is not set
1259# CONFIG_NLS_ISO8859_9 is not set
1260# CONFIG_NLS_ISO8859_13 is not set
1261# CONFIG_NLS_ISO8859_14 is not set
1262# CONFIG_NLS_ISO8859_15 is not set
1263# CONFIG_NLS_KOI8_R is not set
1264# CONFIG_NLS_KOI8_U is not set
1265CONFIG_NLS_UTF8=y
1266# CONFIG_DLM is not set
1267
1268#
1269# Kernel hacking
1270#
1271# CONFIG_PRINTK_TIME is not set
1272CONFIG_ENABLE_WARN_DEPRECATED=y
1273CONFIG_ENABLE_MUST_CHECK=y
1274CONFIG_FRAME_WARN=1024
1275CONFIG_MAGIC_SYSRQ=y
1276# CONFIG_UNUSED_SYMBOLS is not set
1277CONFIG_DEBUG_FS=y
1278# CONFIG_HEADERS_CHECK is not set
1279CONFIG_DEBUG_KERNEL=y
1280# CONFIG_DEBUG_SHIRQ is not set
1281CONFIG_DETECT_SOFTLOCKUP=y
1282# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1283CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1284CONFIG_DETECT_HUNG_TASK=y
1285# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1286CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1287CONFIG_SCHED_DEBUG=y
1288# CONFIG_SCHEDSTATS is not set
1289# CONFIG_TIMER_STATS is not set
1290# CONFIG_DEBUG_OBJECTS is not set
1291# CONFIG_DEBUG_RT_MUTEXES is not set
1292# CONFIG_RT_MUTEX_TESTER is not set
1293# CONFIG_DEBUG_SPINLOCK is not set
1294# CONFIG_DEBUG_MUTEXES is not set
1295# CONFIG_DEBUG_LOCK_ALLOC is not set
1296# CONFIG_PROVE_LOCKING is not set
1297# CONFIG_LOCK_STAT is not set
1298# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1299# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1300# CONFIG_DEBUG_KOBJECT is not set
1301CONFIG_DEBUG_BUGVERBOSE=y
1302# CONFIG_DEBUG_INFO is not set
1303# CONFIG_DEBUG_VM is not set
1304# CONFIG_DEBUG_WRITECOUNT is not set
1305# CONFIG_DEBUG_MEMORY_INIT is not set
1306# CONFIG_DEBUG_LIST is not set
1307# CONFIG_DEBUG_SG is not set
1308# CONFIG_DEBUG_NOTIFIERS is not set
1309CONFIG_FRAME_POINTER=y
1310# CONFIG_BOOT_PRINTK_DELAY is not set
1311# CONFIG_RCU_TORTURE_TEST is not set
1312# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1313# CONFIG_BACKTRACE_SELF_TEST is not set
1314# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1315# CONFIG_FAULT_INJECTION is not set
1316# CONFIG_PAGE_POISONING is not set
1317CONFIG_TRACING_SUPPORT=y
1318
1319#
1320# Tracers
1321#
1322# CONFIG_IRQSOFF_TRACER is not set
1323# CONFIG_SCHED_TRACER is not set
1324# CONFIG_CONTEXT_SWITCH_TRACER is not set
1325# CONFIG_EVENT_TRACER is not set
1326# CONFIG_BOOT_TRACER is not set
1327# CONFIG_TRACE_BRANCH_PROFILING is not set
1328# CONFIG_KMEMTRACE is not set
1329# CONFIG_WORKQUEUE_TRACER is not set
1330# CONFIG_BLK_DEV_IO_TRACE is not set
1331# CONFIG_DYNAMIC_DEBUG is not set
1332# CONFIG_SAMPLES is not set
1333
1334#
1335# Security options
1336#
1337# CONFIG_KEYS is not set
1338# CONFIG_SECURITY is not set
1339# CONFIG_SECURITYFS is not set
1340# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1341# CONFIG_CRYPTO is not set
1342# CONFIG_BINARY_PRINTF is not set
1343
1344#
1345# Library routines
1346#
1347CONFIG_BITREVERSE=y
1348CONFIG_GENERIC_FIND_LAST_BIT=y
1349CONFIG_CRC_CCITT=y
1350# CONFIG_CRC16 is not set
1351# CONFIG_CRC_T10DIF is not set
1352# CONFIG_CRC_ITU_T is not set
1353CONFIG_CRC32=y
1354# CONFIG_CRC7 is not set
1355# CONFIG_LIBCRC32C is not set
1356CONFIG_ZLIB_INFLATE=y
1357CONFIG_ZLIB_DEFLATE=y
1358CONFIG_DECOMPRESS_GZIP=y
1359CONFIG_GENERIC_ALLOCATOR=y
1360CONFIG_HAS_IOMEM=y
1361CONFIG_HAS_IOPORT=y
1362CONFIG_HAS_DMA=y
1363CONFIG_NLATTR=y
diff --git a/arch/avr32/include/asm/atomic.h b/arch/avr32/include/asm/atomic.h
index 318815107748..b131c27ddf57 100644
--- a/arch/avr32/include/asm/atomic.h
+++ b/arch/avr32/include/asm/atomic.h
@@ -196,6 +196,6 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v)
196#define smp_mb__before_atomic_inc() barrier() 196#define smp_mb__before_atomic_inc() barrier()
197#define smp_mb__after_atomic_inc() barrier() 197#define smp_mb__after_atomic_inc() barrier()
198 198
199#include <asm-generic/atomic.h> 199#include <asm-generic/atomic-long.h>
200 200
201#endif /* __ASM_AVR32_ATOMIC_H */ 201#endif /* __ASM_AVR32_ATOMIC_H */
diff --git a/arch/avr32/include/asm/bitsperlong.h b/arch/avr32/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/avr32/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/avr32/include/asm/hw_irq.h b/arch/avr32/include/asm/hw_irq.h
index 218b0a6bfd1b..a36f9fcb8fcd 100644
--- a/arch/avr32/include/asm/hw_irq.h
+++ b/arch/avr32/include/asm/hw_irq.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_AVR32_HW_IRQ_H 1#ifndef __ASM_AVR32_HW_IRQ_H
2#define __ASM_AVR32_HW_IRQ_H 2#define __ASM_AVR32_HW_IRQ_H
3 3
4static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) 4static inline void hw_resend_irq(struct irq_chip *h, unsigned int i)
5{ 5{
6 /* Nothing to do */ 6 /* Nothing to do */
7} 7}
diff --git a/arch/avr32/include/asm/mman.h b/arch/avr32/include/asm/mman.h
index 648f91e7187a..9a92b15f6a66 100644
--- a/arch/avr32/include/asm/mman.h
+++ b/arch/avr32/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_AVR32_MMAN_H__ 1#ifndef __ASM_AVR32_MMAN_H__
2#define __ASM_AVR32_MMAN_H__ 2#define __ASM_AVR32_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/avr32/include/asm/signal.h b/arch/avr32/include/asm/signal.h
index caffefeeba1f..8790dfc10d5b 100644
--- a/arch/avr32/include/asm/signal.h
+++ b/arch/avr32/include/asm/signal.h
@@ -112,7 +112,7 @@ typedef unsigned long sigset_t;
112#define MINSIGSTKSZ 2048 112#define MINSIGSTKSZ 2048
113#define SIGSTKSZ 8192 113#define SIGSTKSZ 8192
114 114
115#include <asm-generic/signal.h> 115#include <asm-generic/signal-defs.h>
116 116
117#ifdef __KERNEL__ 117#ifdef __KERNEL__
118struct old_sigaction { 118struct old_sigaction {
diff --git a/arch/avr32/include/asm/termios.h b/arch/avr32/include/asm/termios.h
index 0152aba35154..dd7e9da25488 100644
--- a/arch/avr32/include/asm/termios.h
+++ b/arch/avr32/include/asm/termios.h
@@ -55,7 +55,7 @@ struct termio {
55*/ 55*/
56#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" 56#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
57 57
58#include <asm-generic/termios.h> 58#include <asm-generic/termios-base.h>
59 59
60#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
61 61
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c
index 1167fe9cf6c4..98f94d041d9c 100644
--- a/arch/avr32/kernel/module.c
+++ b/arch/avr32/kernel/module.c
@@ -32,8 +32,6 @@ void module_free(struct module *mod, void *module_region)
32 mod->arch.syminfo = NULL; 32 mod->arch.syminfo = NULL;
33 33
34 vfree(module_region); 34 vfree(module_region);
35 /* FIXME: if module_region == mod->init_region, trim exception
36 * table entries. */
37} 35}
38 36
39static inline int check_rela(Elf32_Rela *rela, struct module *module, 37static inline int check_rela(Elf32_Rela *rela, struct module *module,
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index d547c8df157d..6e3d491184ea 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -75,8 +75,17 @@ void _exception(long signr, struct pt_regs *regs, int code,
75{ 75{
76 siginfo_t info; 76 siginfo_t info;
77 77
78 if (!user_mode(regs)) 78 if (!user_mode(regs)) {
79 const struct exception_table_entry *fixup;
80
81 /* Are we prepared to handle this kernel fault? */
82 fixup = search_exception_tables(regs->pc);
83 if (fixup) {
84 regs->pc = fixup->fixup;
85 return;
86 }
79 die("Unhandled exception in kernel mode", regs, signr); 87 die("Unhandled exception in kernel mode", regs, signr);
88 }
80 89
81 memset(&info, 0, sizeof(info)); 90 memset(&info, 0, sizeof(info));
82 info.si_signo = signr; 91 info.si_signo = signr;
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index 0b8164281899..ddedb471f33e 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -29,7 +29,7 @@ extern struct platform_device *atmel_default_console_device;
29/* Flags for selecting USART extra pins */ 29/* Flags for selecting USART extra pins */
30#define ATMEL_USART_RTS 0x01 30#define ATMEL_USART_RTS 0x01
31#define ATMEL_USART_CTS 0x02 31#define ATMEL_USART_CTS 0x02
32#define ATMEL_USART_CLK 0x03 32#define ATMEL_USART_CLK 0x04
33 33
34struct atmel_uart_data { 34struct atmel_uart_data {
35 short use_dma_tx; /* use transmit DMA? */ 35 short use_dma_tx; /* use transmit DMA? */
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 3640cdc38aac..a60cfe757914 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -223,6 +223,7 @@ endchoice
223 223
224config SMP 224config SMP
225 depends on BF561 225 depends on BF561
226 select GENERIC_TIME
226 bool "Symmetric multi-processing support" 227 bool "Symmetric multi-processing support"
227 ---help--- 228 ---help---
228 This enables support for systems with more than one CPU, 229 This enables support for systems with more than one CPU,
@@ -241,12 +242,6 @@ config IRQ_PER_CPU
241 depends on SMP 242 depends on SMP
242 default y 243 default y
243 244
244config TICK_SOURCE_SYSTMR0
245 bool
246 select BFIN_GPTIMERS
247 depends on SMP
248 default y
249
250config BF_REV_MIN 245config BF_REV_MIN
251 int 246 int
252 default 0 if (BF51x || BF52x || (BF54x && !BF54xM)) 247 default 0 if (BF51x || BF52x || (BF54x && !BF54xM))
@@ -263,8 +258,8 @@ config BF_REV_MAX
263 258
264choice 259choice
265 prompt "Silicon Rev" 260 prompt "Silicon Rev"
266 default BF_REV_0_1 if (BF51x || BF52x || (BF54x && !BF54xM)) 261 default BF_REV_0_0 if (BF51x || BF52x)
267 default BF_REV_0_2 if (BF534 || BF536 || BF537) 262 default BF_REV_0_2 if (BF534 || BF536 || BF537 || (BF54x && !BF54xM))
268 default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF54xM || BF561) 263 default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF54xM || BF561)
269 264
270config BF_REV_0_0 265config BF_REV_0_0
@@ -607,7 +602,6 @@ source kernel/Kconfig.hz
607 602
608config GENERIC_TIME 603config GENERIC_TIME
609 bool "Generic time" 604 bool "Generic time"
610 depends on !SMP
611 default y 605 default y
612 606
613config GENERIC_CLOCKEVENTS 607config GENERIC_CLOCKEVENTS
@@ -615,12 +609,26 @@ config GENERIC_CLOCKEVENTS
615 depends on GENERIC_TIME 609 depends on GENERIC_TIME
616 default y 610 default y
617 611
612choice
613 prompt "Kernel Tick Source"
614 depends on GENERIC_CLOCKEVENTS
615 default TICKSOURCE_CORETMR
616
617config TICKSOURCE_GPTMR0
618 bool "Gptimer0 (SCLK domain)"
619 select BFIN_GPTIMERS
620 depends on !IPIPE
621
622config TICKSOURCE_CORETMR
623 bool "Core timer (CCLK domain)"
624
625endchoice
626
618config CYCLES_CLOCKSOURCE 627config CYCLES_CLOCKSOURCE
619 bool "Use 'CYCLES' as a clocksource (EXPERIMENTAL)" 628 bool "Use 'CYCLES' as a clocksource"
620 depends on EXPERIMENTAL
621 depends on GENERIC_CLOCKEVENTS 629 depends on GENERIC_CLOCKEVENTS
622 depends on !BFIN_SCRATCH_REG_CYCLES 630 depends on !BFIN_SCRATCH_REG_CYCLES
623 default n 631 depends on !SMP
624 help 632 help
625 If you say Y here, you will enable support for using the 'cycles' 633 If you say Y here, you will enable support for using the 'cycles'
626 registers as a clock source. Doing so means you will be unable to 634 registers as a clock source. Doing so means you will be unable to
@@ -628,6 +636,11 @@ config CYCLES_CLOCKSOURCE
628 still be able to read it (such as for performance monitoring), but 636 still be able to read it (such as for performance monitoring), but
629 writing the registers will most likely crash the kernel. 637 writing the registers will most likely crash the kernel.
630 638
639config GPTMR0_CLOCKSOURCE
640 bool "Use GPTimer0 as a clocksource (higher rating)"
641 depends on GENERIC_CLOCKEVENTS
642 depends on !TICKSOURCE_GPTMR0
643
631source kernel/time/Kconfig 644source kernel/time/Kconfig
632 645
633comment "Misc" 646comment "Misc"
@@ -808,7 +821,7 @@ config APP_STACK_L1
808config EXCEPTION_L1_SCRATCH 821config EXCEPTION_L1_SCRATCH
809 bool "Locate exception stack in L1 Scratch Memory" 822 bool "Locate exception stack in L1 Scratch Memory"
810 default n 823 default n
811 depends on !APP_STACK_L1 && !SYSCALL_TAB_L1 824 depends on !APP_STACK_L1
812 help 825 help
813 Whenever an exception occurs, use the L1 Scratch memory for 826 Whenever an exception occurs, use the L1 Scratch memory for
814 stack storage. You cannot place the stacks of FLAT binaries 827 stack storage. You cannot place the stacks of FLAT binaries
@@ -872,7 +885,7 @@ config BFIN_GPTIMERS
872 are unsure, say N. 885 are unsure, say N.
873 886
874 To compile this driver as a module, choose M here: the module 887 To compile this driver as a module, choose M here: the module
875 will be called gptimers.ko. 888 will be called gptimers.
876 889
877choice 890choice
878 prompt "Uncached DMA region" 891 prompt "Uncached DMA region"
@@ -901,7 +914,7 @@ config BFIN_ICACHE_LOCK
901 bool "Enable Instruction Cache Locking" 914 bool "Enable Instruction Cache Locking"
902 915
903choice 916choice
904 prompt "Policy" 917 prompt "External memory cache policy"
905 depends on BFIN_DCACHE 918 depends on BFIN_DCACHE
906 default BFIN_WB if !SMP 919 default BFIN_WB if !SMP
907 default BFIN_WT if SMP 920 default BFIN_WT if SMP
@@ -942,12 +955,22 @@ config BFIN_WT
942 955
943endchoice 956endchoice
944 957
945config BFIN_L2_CACHEABLE 958choice
946 bool "Cache L2 SRAM" 959 prompt "L2 SRAM cache policy"
947 depends on (BFIN_DCACHE || BFIN_ICACHE) && (BF54x || (BF561 && !SMP)) 960 depends on (BF54x || BF561)
948 default n 961 default BFIN_L2_WT
949 help 962config BFIN_L2_WB
950 Select to make L2 SRAM cacheable in L1 data and instruction cache. 963 bool "Write back"
964 depends on !SMP
965
966config BFIN_L2_WT
967 bool "Write through"
968 depends on !SMP
969
970config BFIN_L2_NOT_CACHED
971 bool "Not cached"
972
973endchoice
951 974
952config MPU 975config MPU
953 bool "Enable the memory protection unit (EXPERIMENTAL)" 976 bool "Enable the memory protection unit (EXPERIMENTAL)"
@@ -1011,21 +1034,34 @@ endmenu
1011 1034
1012menu "EBIU_AMBCTL Control" 1035menu "EBIU_AMBCTL Control"
1013config BANK_0 1036config BANK_0
1014 hex "Bank 0" 1037 hex "Bank 0 (AMBCTL0.L)"
1015 default 0x7BB0 1038 default 0x7BB0
1039 help
1040 These are the low 16 bits of the EBIU_AMBCTL0 MMR which are
1041 used to control the Asynchronous Memory Bank 0 settings.
1016 1042
1017config BANK_1 1043config BANK_1
1018 hex "Bank 1" 1044 hex "Bank 1 (AMBCTL0.H)"
1019 default 0x7BB0 1045 default 0x7BB0
1020 default 0x5558 if BF54x 1046 default 0x5558 if BF54x
1047 help
1048 These are the high 16 bits of the EBIU_AMBCTL0 MMR which are
1049 used to control the Asynchronous Memory Bank 1 settings.
1021 1050
1022config BANK_2 1051config BANK_2
1023 hex "Bank 2" 1052 hex "Bank 2 (AMBCTL1.L)"
1024 default 0x7BB0 1053 default 0x7BB0
1054 help
1055 These are the low 16 bits of the EBIU_AMBCTL1 MMR which are
1056 used to control the Asynchronous Memory Bank 2 settings.
1025 1057
1026config BANK_3 1058config BANK_3
1027 hex "Bank 3" 1059 hex "Bank 3 (AMBCTL1.H)"
1028 default 0x99B3 1060 default 0x99B3
1061 help
1062 These are the high 16 bits of the EBIU_AMBCTL1 MMR which are
1063 used to control the Asynchronous Memory Bank 3 settings.
1064
1029endmenu 1065endmenu
1030 1066
1031config EBIU_MBSCTLVAL 1067config EBIU_MBSCTLVAL
diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug
index 79e7e63ab709..1fc4981d486f 100644
--- a/arch/blackfin/Kconfig.debug
+++ b/arch/blackfin/Kconfig.debug
@@ -54,6 +54,19 @@ config DEBUG_HWERR
54 hardware error interrupts and need to know where they are coming 54 hardware error interrupts and need to know where they are coming
55 from. 55 from.
56 56
57config EXACT_HWERR
58 bool "Try to make Hardware errors exact"
59 depends on DEBUG_HWERR
60 help
61 By default, the Blackfin hardware errors are not exact - the error
62 be reported multiple cycles after the error happens. This delay
63 can cause the wrong application, or even the kernel to receive a
64 signal to be killed. If you are getting HW errors in your system,
65 try turning this on to ensure they are at least comming from the
66 proper thread.
67
68 On production systems, it is safe (and a small optimization) to say N.
69
57config DEBUG_DOUBLEFAULT 70config DEBUG_DOUBLEFAULT
58 bool "Debug Double Faults" 71 bool "Debug Double Faults"
59 default n 72 default n
diff --git a/arch/blackfin/configs/BF518F-EZBRD_defconfig b/arch/blackfin/configs/BF518F-EZBRD_defconfig
index c121d6e6e2b8..baec1337f282 100644
--- a/arch/blackfin/configs/BF518F-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF518F-EZBRD_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -259,7 +259,10 @@ CONFIG_HZ=250
259# CONFIG_SCHED_HRTICK is not set 259# CONFIG_SCHED_HRTICK is not set
260CONFIG_GENERIC_TIME=y 260CONFIG_GENERIC_TIME=y
261CONFIG_GENERIC_CLOCKEVENTS=y 261CONFIG_GENERIC_CLOCKEVENTS=y
262# CONFIG_TICKSOURCE_GPTMR0 is not set
263CONFIG_TICKSOURCE_CORETMR=y
262# CONFIG_CYCLES_CLOCKSOURCE is not set 264# CONFIG_CYCLES_CLOCKSOURCE is not set
265# CONFIG_GPTMR0_CLOCKSOURCE is not set
263# CONFIG_NO_HZ is not set 266# CONFIG_NO_HZ is not set
264# CONFIG_HIGH_RES_TIMERS is not set 267# CONFIG_HIGH_RES_TIMERS is not set
265CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 268CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -404,7 +407,7 @@ CONFIG_IP_PNP=y
404# CONFIG_NET_IPIP is not set 407# CONFIG_NET_IPIP is not set
405# CONFIG_NET_IPGRE is not set 408# CONFIG_NET_IPGRE is not set
406# CONFIG_ARPD is not set 409# CONFIG_ARPD is not set
407CONFIG_SYN_COOKIES=y 410# CONFIG_SYN_COOKIES is not set
408# CONFIG_INET_AH is not set 411# CONFIG_INET_AH is not set
409# CONFIG_INET_ESP is not set 412# CONFIG_INET_ESP is not set
410# CONFIG_INET_IPCOMP is not set 413# CONFIG_INET_IPCOMP is not set
@@ -688,14 +691,14 @@ CONFIG_INPUT_MISC=y
688# Character devices 691# Character devices
689# 692#
690# CONFIG_AD9960 is not set 693# CONFIG_AD9960 is not set
691# CONFIG_SPI_ADC_BF533 is not set 694CONFIG_BFIN_DMA_INTERFACE=m
692# CONFIG_BF5xx_PPIFCD is not set 695# CONFIG_BFIN_PPI is not set
696# CONFIG_BFIN_PPIFCD is not set
693# CONFIG_BFIN_SIMPLE_TIMER is not set 697# CONFIG_BFIN_SIMPLE_TIMER is not set
694# CONFIG_BF5xx_PPI is not set 698# CONFIG_BFIN_SPI_ADC is not set
695# CONFIG_BFIN_SPORT is not set 699# CONFIG_BFIN_SPORT is not set
696# CONFIG_BFIN_TIMER_LATENCY is not set 700# CONFIG_BFIN_TIMER_LATENCY is not set
697# CONFIG_TWI_LCD is not set 701# CONFIG_BFIN_TWI_LCD is not set
698CONFIG_BFIN_DMA_INTERFACE=m
699CONFIG_SIMPLE_GPIO=m 702CONFIG_SIMPLE_GPIO=m
700CONFIG_VT=y 703CONFIG_VT=y
701CONFIG_CONSOLE_TRANSLATIONS=y 704CONFIG_CONSOLE_TRANSLATIONS=y
@@ -802,7 +805,30 @@ CONFIG_SPI_BFIN=y
802# CONFIG_SPI_SPIDEV is not set 805# CONFIG_SPI_SPIDEV is not set
803# CONFIG_SPI_TLE62X0 is not set 806# CONFIG_SPI_TLE62X0 is not set
804CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 807CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
805# CONFIG_GPIOLIB is not set 808CONFIG_GPIOLIB=y
809# CONFIG_DEBUG_GPIO is not set
810CONFIG_GPIO_SYSFS=y
811
812#
813# Memory mapped GPIO expanders:
814#
815
816#
817# I2C GPIO expanders:
818#
819# CONFIG_GPIO_MAX732X is not set
820# CONFIG_GPIO_PCA953X is not set
821# CONFIG_GPIO_PCF857X is not set
822
823#
824# PCI GPIO expanders:
825#
826
827#
828# SPI GPIO expanders:
829#
830# CONFIG_GPIO_MAX7301 is not set
831# CONFIG_GPIO_MCP23S08 is not set
806# CONFIG_W1 is not set 832# CONFIG_W1 is not set
807# CONFIG_POWER_SUPPLY is not set 833# CONFIG_POWER_SUPPLY is not set
808# CONFIG_HWMON is not set 834# CONFIG_HWMON is not set
@@ -831,6 +857,7 @@ CONFIG_SSB_POSSIBLE=y
831# CONFIG_HTC_PASIC3 is not set 857# CONFIG_HTC_PASIC3 is not set
832# CONFIG_MFD_TMIO is not set 858# CONFIG_MFD_TMIO is not set
833# CONFIG_PMIC_DA903X is not set 859# CONFIG_PMIC_DA903X is not set
860# CONFIG_PMIC_ADP5520 is not set
834# CONFIG_MFD_WM8400 is not set 861# CONFIG_MFD_WM8400 is not set
835# CONFIG_MFD_WM8350_I2C is not set 862# CONFIG_MFD_WM8350_I2C is not set
836# CONFIG_REGULATOR is not set 863# CONFIG_REGULATOR is not set
@@ -962,7 +989,8 @@ CONFIG_RTC_DRV_BFIN=y
962# 989#
963# File systems 990# File systems
964# 991#
965# CONFIG_EXT2_FS is not set 992CONFIG_EXT2_FS=m
993# CONFIG_EXT2_FS_XATTR is not set
966# CONFIG_EXT3_FS is not set 994# CONFIG_EXT3_FS is not set
967# CONFIG_EXT4_FS is not set 995# CONFIG_EXT4_FS is not set
968# CONFIG_REISERFS_FS is not set 996# CONFIG_REISERFS_FS is not set
@@ -988,8 +1016,11 @@ CONFIG_INOTIFY_USER=y
988# 1016#
989# DOS/FAT/NT Filesystems 1017# DOS/FAT/NT Filesystems
990# 1018#
1019CONFIG_FAT_FS=m
991# CONFIG_MSDOS_FS is not set 1020# CONFIG_MSDOS_FS is not set
992# CONFIG_VFAT_FS is not set 1021CONFIG_VFAT_FS=m
1022CONFIG_FAT_DEFAULT_CODEPAGE=437
1023CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
993# CONFIG_NTFS_FS is not set 1024# CONFIG_NTFS_FS is not set
994 1025
995# 1026#
@@ -1012,8 +1043,8 @@ CONFIG_SYSFS=y
1012# CONFIG_BEFS_FS is not set 1043# CONFIG_BEFS_FS is not set
1013# CONFIG_BFS_FS is not set 1044# CONFIG_BFS_FS is not set
1014# CONFIG_EFS_FS is not set 1045# CONFIG_EFS_FS is not set
1015# CONFIG_YAFFS_FS is not set
1016# CONFIG_JFFS2_FS is not set 1046# CONFIG_JFFS2_FS is not set
1047# CONFIG_YAFFS_FS is not set
1017# CONFIG_CRAMFS is not set 1048# CONFIG_CRAMFS is not set
1018# CONFIG_VXFS_FS is not set 1049# CONFIG_VXFS_FS is not set
1019# CONFIG_MINIX_FS is not set 1050# CONFIG_MINIX_FS is not set
@@ -1048,9 +1079,9 @@ CONFIG_SMB_FS=m
1048# 1079#
1049# CONFIG_PARTITION_ADVANCED is not set 1080# CONFIG_PARTITION_ADVANCED is not set
1050CONFIG_MSDOS_PARTITION=y 1081CONFIG_MSDOS_PARTITION=y
1051CONFIG_NLS=y 1082CONFIG_NLS=m
1052CONFIG_NLS_DEFAULT="iso8859-1" 1083CONFIG_NLS_DEFAULT="iso8859-1"
1053CONFIG_NLS_CODEPAGE_437=y 1084CONFIG_NLS_CODEPAGE_437=m
1054# CONFIG_NLS_CODEPAGE_737 is not set 1085# CONFIG_NLS_CODEPAGE_737 is not set
1055# CONFIG_NLS_CODEPAGE_775 is not set 1086# CONFIG_NLS_CODEPAGE_775 is not set
1056# CONFIG_NLS_CODEPAGE_850 is not set 1087# CONFIG_NLS_CODEPAGE_850 is not set
@@ -1065,7 +1096,7 @@ CONFIG_NLS_CODEPAGE_437=y
1065# CONFIG_NLS_CODEPAGE_865 is not set 1096# CONFIG_NLS_CODEPAGE_865 is not set
1066# CONFIG_NLS_CODEPAGE_866 is not set 1097# CONFIG_NLS_CODEPAGE_866 is not set
1067# CONFIG_NLS_CODEPAGE_869 is not set 1098# CONFIG_NLS_CODEPAGE_869 is not set
1068# CONFIG_NLS_CODEPAGE_936 is not set 1099CONFIG_NLS_CODEPAGE_936=m
1069# CONFIG_NLS_CODEPAGE_950 is not set 1100# CONFIG_NLS_CODEPAGE_950 is not set
1070# CONFIG_NLS_CODEPAGE_932 is not set 1101# CONFIG_NLS_CODEPAGE_932 is not set
1071# CONFIG_NLS_CODEPAGE_949 is not set 1102# CONFIG_NLS_CODEPAGE_949 is not set
@@ -1074,7 +1105,7 @@ CONFIG_NLS_CODEPAGE_437=y
1074# CONFIG_NLS_CODEPAGE_1250 is not set 1105# CONFIG_NLS_CODEPAGE_1250 is not set
1075# CONFIG_NLS_CODEPAGE_1251 is not set 1106# CONFIG_NLS_CODEPAGE_1251 is not set
1076# CONFIG_NLS_ASCII is not set 1107# CONFIG_NLS_ASCII is not set
1077CONFIG_NLS_ISO8859_1=y 1108CONFIG_NLS_ISO8859_1=m
1078# CONFIG_NLS_ISO8859_2 is not set 1109# CONFIG_NLS_ISO8859_2 is not set
1079# CONFIG_NLS_ISO8859_3 is not set 1110# CONFIG_NLS_ISO8859_3 is not set
1080# CONFIG_NLS_ISO8859_4 is not set 1111# CONFIG_NLS_ISO8859_4 is not set
@@ -1087,7 +1118,7 @@ CONFIG_NLS_ISO8859_1=y
1087# CONFIG_NLS_ISO8859_15 is not set 1118# CONFIG_NLS_ISO8859_15 is not set
1088# CONFIG_NLS_KOI8_R is not set 1119# CONFIG_NLS_KOI8_R is not set
1089# CONFIG_NLS_KOI8_U is not set 1120# CONFIG_NLS_KOI8_U is not set
1090# CONFIG_NLS_UTF8 is not set 1121CONFIG_NLS_UTF8=m
1091# CONFIG_DLM is not set 1122# CONFIG_DLM is not set
1092 1123
1093# 1124#
@@ -1102,7 +1133,7 @@ CONFIG_FRAME_WARN=1024
1102CONFIG_DEBUG_FS=y 1133CONFIG_DEBUG_FS=y
1103# CONFIG_HEADERS_CHECK is not set 1134# CONFIG_HEADERS_CHECK is not set
1104CONFIG_DEBUG_KERNEL=y 1135CONFIG_DEBUG_KERNEL=y
1105# CONFIG_DEBUG_SHIRQ is not set 1136CONFIG_DEBUG_SHIRQ=y
1106CONFIG_DETECT_SOFTLOCKUP=y 1137CONFIG_DETECT_SOFTLOCKUP=y
1107# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1138# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1108CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1139CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1111,8 +1142,6 @@ CONFIG_SCHED_DEBUG=y
1111# CONFIG_TIMER_STATS is not set 1142# CONFIG_TIMER_STATS is not set
1112# CONFIG_DEBUG_OBJECTS is not set 1143# CONFIG_DEBUG_OBJECTS is not set
1113# CONFIG_DEBUG_SLAB is not set 1144# CONFIG_DEBUG_SLAB is not set
1114# CONFIG_DEBUG_RT_MUTEXES is not set
1115# CONFIG_RT_MUTEX_TESTER is not set
1116# CONFIG_DEBUG_SPINLOCK is not set 1145# CONFIG_DEBUG_SPINLOCK is not set
1117# CONFIG_DEBUG_MUTEXES is not set 1146# CONFIG_DEBUG_MUTEXES is not set
1118# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1147# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1132,7 +1161,6 @@ CONFIG_DEBUG_INFO=y
1132# CONFIG_BACKTRACE_SELF_TEST is not set 1161# CONFIG_BACKTRACE_SELF_TEST is not set
1133# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1162# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1134# CONFIG_FAULT_INJECTION is not set 1163# CONFIG_FAULT_INJECTION is not set
1135CONFIG_SYSCTL_SYSCALL_CHECK=y
1136 1164
1137# 1165#
1138# Tracers 1166# Tracers
@@ -1148,16 +1176,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1148# CONFIG_DEBUG_STACK_USAGE is not set 1176# CONFIG_DEBUG_STACK_USAGE is not set
1149CONFIG_DEBUG_VERBOSE=y 1177CONFIG_DEBUG_VERBOSE=y
1150CONFIG_DEBUG_MMRS=y 1178CONFIG_DEBUG_MMRS=y
1151# CONFIG_DEBUG_HWERR is not set 1179CONFIG_DEBUG_HWERR=y
1152# CONFIG_DEBUG_DOUBLEFAULT is not set 1180CONFIG_EXACT_HWERR=y
1181CONFIG_DEBUG_DOUBLEFAULT=y
1182CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1183# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1184# CONFIG_DEBUG_ICACHE_CHECK is not set
1153CONFIG_DEBUG_HUNT_FOR_ZERO=y 1185CONFIG_DEBUG_HUNT_FOR_ZERO=y
1154CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1186CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1155CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1187# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1156# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1188CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1157# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1189# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1158CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1190CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1159# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1191# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1160# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1192CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1161CONFIG_EARLY_PRINTK=y 1193CONFIG_EARLY_PRINTK=y
1162CONFIG_CPLB_INFO=y 1194CONFIG_CPLB_INFO=y
1163CONFIG_ACCESS_CHECK=y 1195CONFIG_ACCESS_CHECK=y
@@ -1269,7 +1301,6 @@ CONFIG_CRC32=y
1269# CONFIG_CRC7 is not set 1301# CONFIG_CRC7 is not set
1270# CONFIG_LIBCRC32C is not set 1302# CONFIG_LIBCRC32C is not set
1271CONFIG_ZLIB_INFLATE=y 1303CONFIG_ZLIB_INFLATE=y
1272CONFIG_PLIST=y
1273CONFIG_HAS_IOMEM=y 1304CONFIG_HAS_IOMEM=y
1274CONFIG_HAS_IOPORT=y 1305CONFIG_HAS_IOPORT=y
1275CONFIG_HAS_DMA=y 1306CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF526-EZBRD_defconfig b/arch/blackfin/configs/BF526-EZBRD_defconfig
index 3e562b2775d4..c06262e41f7c 100644
--- a/arch/blackfin/configs/BF526-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF526-EZBRD_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -144,8 +144,8 @@ CONFIG_BF526=y
144# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
145CONFIG_BF_REV_MIN=0 145CONFIG_BF_REV_MIN=0
146CONFIG_BF_REV_MAX=2 146CONFIG_BF_REV_MAX=2
147# CONFIG_BF_REV_0_0 is not set 147CONFIG_BF_REV_0_0=y
148CONFIG_BF_REV_0_1=y 148# CONFIG_BF_REV_0_1 is not set
149# CONFIG_BF_REV_0_2 is not set 149# CONFIG_BF_REV_0_2 is not set
150# CONFIG_BF_REV_0_3 is not set 150# CONFIG_BF_REV_0_3 is not set
151# CONFIG_BF_REV_0_4 is not set 151# CONFIG_BF_REV_0_4 is not set
@@ -264,7 +264,10 @@ CONFIG_HZ=250
264# CONFIG_SCHED_HRTICK is not set 264# CONFIG_SCHED_HRTICK is not set
265CONFIG_GENERIC_TIME=y 265CONFIG_GENERIC_TIME=y
266CONFIG_GENERIC_CLOCKEVENTS=y 266CONFIG_GENERIC_CLOCKEVENTS=y
267# CONFIG_TICKSOURCE_GPTMR0 is not set
268CONFIG_TICKSOURCE_CORETMR=y
267# CONFIG_CYCLES_CLOCKSOURCE is not set 269# CONFIG_CYCLES_CLOCKSOURCE is not set
270# CONFIG_GPTMR0_CLOCKSOURCE is not set
268# CONFIG_NO_HZ is not set 271# CONFIG_NO_HZ is not set
269# CONFIG_HIGH_RES_TIMERS is not set 272# CONFIG_HIGH_RES_TIMERS is not set
270CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 273CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -409,7 +412,7 @@ CONFIG_IP_PNP=y
409# CONFIG_NET_IPIP is not set 412# CONFIG_NET_IPIP is not set
410# CONFIG_NET_IPGRE is not set 413# CONFIG_NET_IPGRE is not set
411# CONFIG_ARPD is not set 414# CONFIG_ARPD is not set
412CONFIG_SYN_COOKIES=y 415# CONFIG_SYN_COOKIES is not set
413# CONFIG_INET_AH is not set 416# CONFIG_INET_AH is not set
414# CONFIG_INET_ESP is not set 417# CONFIG_INET_ESP is not set
415# CONFIG_INET_IPCOMP is not set 418# CONFIG_INET_IPCOMP is not set
@@ -491,7 +494,7 @@ CONFIG_MTD_PARTITIONS=y
491# 494#
492# User Modules And Translation Layers 495# User Modules And Translation Layers
493# 496#
494CONFIG_MTD_CHAR=m 497CONFIG_MTD_CHAR=y
495CONFIG_MTD_BLKDEVS=y 498CONFIG_MTD_BLKDEVS=y
496CONFIG_MTD_BLOCK=y 499CONFIG_MTD_BLOCK=y
497# CONFIG_FTL is not set 500# CONFIG_FTL is not set
@@ -504,9 +507,9 @@ CONFIG_MTD_BLOCK=y
504# 507#
505# RAM/ROM/Flash chip drivers 508# RAM/ROM/Flash chip drivers
506# 509#
507# CONFIG_MTD_CFI is not set 510CONFIG_MTD_CFI=y
508CONFIG_MTD_JEDECPROBE=m 511# CONFIG_MTD_JEDECPROBE is not set
509CONFIG_MTD_GEN_PROBE=m 512CONFIG_MTD_GEN_PROBE=y
510# CONFIG_MTD_CFI_ADV_OPTIONS is not set 513# CONFIG_MTD_CFI_ADV_OPTIONS is not set
511CONFIG_MTD_MAP_BANK_WIDTH_1=y 514CONFIG_MTD_MAP_BANK_WIDTH_1=y
512CONFIG_MTD_MAP_BANK_WIDTH_2=y 515CONFIG_MTD_MAP_BANK_WIDTH_2=y
@@ -518,9 +521,10 @@ CONFIG_MTD_CFI_I1=y
518CONFIG_MTD_CFI_I2=y 521CONFIG_MTD_CFI_I2=y
519# CONFIG_MTD_CFI_I4 is not set 522# CONFIG_MTD_CFI_I4 is not set
520# CONFIG_MTD_CFI_I8 is not set 523# CONFIG_MTD_CFI_I8 is not set
521# CONFIG_MTD_CFI_INTELEXT is not set 524CONFIG_MTD_CFI_INTELEXT=y
522# CONFIG_MTD_CFI_AMDSTD is not set 525# CONFIG_MTD_CFI_AMDSTD is not set
523# CONFIG_MTD_CFI_STAA is not set 526# CONFIG_MTD_CFI_STAA is not set
527CONFIG_MTD_CFI_UTIL=y
524CONFIG_MTD_RAM=y 528CONFIG_MTD_RAM=y
525CONFIG_MTD_ROM=m 529CONFIG_MTD_ROM=m
526# CONFIG_MTD_ABSENT is not set 530# CONFIG_MTD_ABSENT is not set
@@ -529,7 +533,8 @@ CONFIG_MTD_ROM=m
529# Mapping drivers for chip access 533# Mapping drivers for chip access
530# 534#
531CONFIG_MTD_COMPLEX_MAPPINGS=y 535CONFIG_MTD_COMPLEX_MAPPINGS=y
532# CONFIG_MTD_PHYSMAP is not set 536CONFIG_MTD_PHYSMAP=y
537# CONFIG_MTD_PHYSMAP_COMPAT is not set
533# CONFIG_MTD_GPIO_ADDR is not set 538# CONFIG_MTD_GPIO_ADDR is not set
534# CONFIG_MTD_UCLINUX is not set 539# CONFIG_MTD_UCLINUX is not set
535# CONFIG_MTD_PLATRAM is not set 540# CONFIG_MTD_PLATRAM is not set
@@ -597,9 +602,42 @@ CONFIG_HAVE_IDE=y
597# SCSI device support 602# SCSI device support
598# 603#
599# CONFIG_RAID_ATTRS is not set 604# CONFIG_RAID_ATTRS is not set
600# CONFIG_SCSI is not set 605CONFIG_SCSI=y
601# CONFIG_SCSI_DMA is not set 606CONFIG_SCSI_DMA=y
607# CONFIG_SCSI_TGT is not set
602# CONFIG_SCSI_NETLINK is not set 608# CONFIG_SCSI_NETLINK is not set
609# CONFIG_SCSI_PROC_FS is not set
610
611#
612# SCSI support type (disk, tape, CD-ROM)
613#
614CONFIG_BLK_DEV_SD=y
615# CONFIG_CHR_DEV_ST is not set
616# CONFIG_CHR_DEV_OSST is not set
617CONFIG_BLK_DEV_SR=m
618# CONFIG_BLK_DEV_SR_VENDOR is not set
619# CONFIG_CHR_DEV_SG is not set
620# CONFIG_CHR_DEV_SCH is not set
621
622#
623# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
624#
625# CONFIG_SCSI_MULTI_LUN is not set
626# CONFIG_SCSI_CONSTANTS is not set
627# CONFIG_SCSI_LOGGING is not set
628# CONFIG_SCSI_SCAN_ASYNC is not set
629CONFIG_SCSI_WAIT_SCAN=m
630
631#
632# SCSI Transports
633#
634# CONFIG_SCSI_SPI_ATTRS is not set
635# CONFIG_SCSI_FC_ATTRS is not set
636# CONFIG_SCSI_ISCSI_ATTRS is not set
637# CONFIG_SCSI_SAS_LIBSAS is not set
638# CONFIG_SCSI_SRP_ATTRS is not set
639# CONFIG_SCSI_LOWLEVEL is not set
640# CONFIG_SCSI_DH is not set
603# CONFIG_ATA is not set 641# CONFIG_ATA is not set
604# CONFIG_MD is not set 642# CONFIG_MD is not set
605CONFIG_NETDEVICES=y 643CONFIG_NETDEVICES=y
@@ -644,9 +682,8 @@ CONFIG_BFIN_MAC_RMII=y
644# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 682# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
645# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 683# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
646# CONFIG_B44 is not set 684# CONFIG_B44 is not set
647CONFIG_NETDEV_1000=y 685# CONFIG_NETDEV_1000 is not set
648# CONFIG_AX88180 is not set 686# CONFIG_NETDEV_10000 is not set
649CONFIG_NETDEV_10000=y
650 687
651# 688#
652# Wireless LAN 689# Wireless LAN
@@ -715,14 +752,14 @@ CONFIG_INPUT_MISC=y
715# Character devices 752# Character devices
716# 753#
717# CONFIG_AD9960 is not set 754# CONFIG_AD9960 is not set
718# CONFIG_SPI_ADC_BF533 is not set 755CONFIG_BFIN_DMA_INTERFACE=m
719# CONFIG_BF5xx_PPIFCD is not set 756# CONFIG_BFIN_PPI is not set
757# CONFIG_BFIN_PPIFCD is not set
720# CONFIG_BFIN_SIMPLE_TIMER is not set 758# CONFIG_BFIN_SIMPLE_TIMER is not set
721# CONFIG_BF5xx_PPI is not set 759# CONFIG_BFIN_SPI_ADC is not set
722# CONFIG_BFIN_SPORT is not set 760# CONFIG_BFIN_SPORT is not set
723# CONFIG_BFIN_TIMER_LATENCY is not set 761# CONFIG_BFIN_TIMER_LATENCY is not set
724# CONFIG_TWI_LCD is not set 762# CONFIG_BFIN_TWI_LCD is not set
725CONFIG_BFIN_DMA_INTERFACE=m
726CONFIG_SIMPLE_GPIO=m 763CONFIG_SIMPLE_GPIO=m
727CONFIG_VT=y 764CONFIG_VT=y
728CONFIG_CONSOLE_TRANSLATIONS=y 765CONFIG_CONSOLE_TRANSLATIONS=y
@@ -832,11 +869,35 @@ CONFIG_SPI_BFIN=y
832# CONFIG_SPI_SPIDEV is not set 869# CONFIG_SPI_SPIDEV is not set
833# CONFIG_SPI_TLE62X0 is not set 870# CONFIG_SPI_TLE62X0 is not set
834CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 871CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
835# CONFIG_GPIOLIB is not set 872CONFIG_GPIOLIB=y
873# CONFIG_DEBUG_GPIO is not set
874CONFIG_GPIO_SYSFS=y
875
876#
877# Memory mapped GPIO expanders:
878#
879
880#
881# I2C GPIO expanders:
882#
883# CONFIG_GPIO_MAX732X is not set
884# CONFIG_GPIO_PCA953X is not set
885# CONFIG_GPIO_PCF857X is not set
886
887#
888# PCI GPIO expanders:
889#
890
891#
892# SPI GPIO expanders:
893#
894# CONFIG_GPIO_MAX7301 is not set
895# CONFIG_GPIO_MCP23S08 is not set
836# CONFIG_W1 is not set 896# CONFIG_W1 is not set
837# CONFIG_POWER_SUPPLY is not set 897# CONFIG_POWER_SUPPLY is not set
838CONFIG_HWMON=y 898CONFIG_HWMON=y
839# CONFIG_HWMON_VID is not set 899# CONFIG_HWMON_VID is not set
900# CONFIG_SENSORS_AD5252 is not set
840# CONFIG_SENSORS_AD7414 is not set 901# CONFIG_SENSORS_AD7414 is not set
841# CONFIG_SENSORS_AD7418 is not set 902# CONFIG_SENSORS_AD7418 is not set
842# CONFIG_SENSORS_ADCXX is not set 903# CONFIG_SENSORS_ADCXX is not set
@@ -920,6 +981,7 @@ CONFIG_SSB_POSSIBLE=y
920# CONFIG_HTC_PASIC3 is not set 981# CONFIG_HTC_PASIC3 is not set
921# CONFIG_MFD_TMIO is not set 982# CONFIG_MFD_TMIO is not set
922# CONFIG_PMIC_DA903X is not set 983# CONFIG_PMIC_DA903X is not set
984# CONFIG_PMIC_ADP5520 is not set
923# CONFIG_MFD_WM8400 is not set 985# CONFIG_MFD_WM8400 is not set
924# CONFIG_MFD_WM8350_I2C is not set 986# CONFIG_MFD_WM8350_I2C is not set
925# CONFIG_REGULATOR is not set 987# CONFIG_REGULATOR is not set
@@ -1008,8 +1070,8 @@ CONFIG_USB=y
1008# 1070#
1009# Miscellaneous USB options 1071# Miscellaneous USB options
1010# 1072#
1011# CONFIG_USB_DEVICEFS is not set 1073CONFIG_USB_DEVICEFS=y
1012CONFIG_USB_DEVICE_CLASS=y 1074# CONFIG_USB_DEVICE_CLASS is not set
1013# CONFIG_USB_DYNAMIC_MINORS is not set 1075# CONFIG_USB_DYNAMIC_MINORS is not set
1014# CONFIG_USB_OTG is not set 1076# CONFIG_USB_OTG is not set
1015# CONFIG_USB_OTG_WHITELIST is not set 1077# CONFIG_USB_OTG_WHITELIST is not set
@@ -1037,10 +1099,10 @@ CONFIG_USB_MUSB_SOC=y
1037CONFIG_USB_MUSB_HOST=y 1099CONFIG_USB_MUSB_HOST=y
1038# CONFIG_USB_MUSB_PERIPHERAL is not set 1100# CONFIG_USB_MUSB_PERIPHERAL is not set
1039# CONFIG_USB_MUSB_OTG is not set 1101# CONFIG_USB_MUSB_OTG is not set
1040# CONFIG_USB_GADGET_MUSB_HDRC is not set
1041CONFIG_USB_MUSB_HDRC_HCD=y 1102CONFIG_USB_MUSB_HDRC_HCD=y
1042CONFIG_MUSB_PIO_ONLY=y 1103# CONFIG_MUSB_PIO_ONLY is not set
1043CONFIG_MUSB_DMA_POLL=y 1104CONFIG_USB_INVENTRA_DMA=y
1105# CONFIG_USB_TI_CPPI_DMA is not set
1044# CONFIG_USB_MUSB_DEBUG is not set 1106# CONFIG_USB_MUSB_DEBUG is not set
1045 1107
1046# 1108#
@@ -1058,7 +1120,7 @@ CONFIG_MUSB_DMA_POLL=y
1058# 1120#
1059# see USB_STORAGE Help for more information 1121# see USB_STORAGE Help for more information
1060# 1122#
1061CONFIG_USB_STORAGE=m 1123CONFIG_USB_STORAGE=y
1062# CONFIG_USB_STORAGE_DEBUG is not set 1124# CONFIG_USB_STORAGE_DEBUG is not set
1063# CONFIG_USB_STORAGE_DATAFAB is not set 1125# CONFIG_USB_STORAGE_DATAFAB is not set
1064# CONFIG_USB_STORAGE_FREECOM is not set 1126# CONFIG_USB_STORAGE_FREECOM is not set
@@ -1107,33 +1169,10 @@ CONFIG_USB_STORAGE=m
1107# CONFIG_USB_LD is not set 1169# CONFIG_USB_LD is not set
1108# CONFIG_USB_TRANCEVIBRATOR is not set 1170# CONFIG_USB_TRANCEVIBRATOR is not set
1109# CONFIG_USB_IOWARRIOR is not set 1171# CONFIG_USB_IOWARRIOR is not set
1172# CONFIG_USB_TEST is not set
1110# CONFIG_USB_ISIGHTFW is not set 1173# CONFIG_USB_ISIGHTFW is not set
1111# CONFIG_USB_VST is not set 1174# CONFIG_USB_VST is not set
1112# CONFIG_USB_GADGET is not set 1175# CONFIG_USB_GADGET is not set
1113# CONFIG_USB_GADGET_AT91 is not set
1114# CONFIG_USB_GADGET_ATMEL_USBA is not set
1115# CONFIG_USB_GADGET_FSL_USB2 is not set
1116# CONFIG_USB_GADGET_LH7A40X is not set
1117# CONFIG_USB_GADGET_OMAP is not set
1118# CONFIG_USB_GADGET_PXA25X is not set
1119# CONFIG_USB_GADGET_PXA27X is not set
1120# CONFIG_USB_GADGET_S3C2410 is not set
1121# CONFIG_USB_GADGET_M66592 is not set
1122# CONFIG_USB_GADGET_AMD5536UDC is not set
1123# CONFIG_USB_GADGET_FSL_QE is not set
1124# CONFIG_USB_GADGET_NET2272 is not set
1125# CONFIG_USB_GADGET_NET2280 is not set
1126# CONFIG_USB_GADGET_GOKU is not set
1127# CONFIG_USB_GADGET_DUMMY_HCD is not set
1128# CONFIG_USB_ZERO is not set
1129# CONFIG_USB_AUDIO is not set
1130# CONFIG_USB_ETH is not set
1131# CONFIG_USB_GADGETFS is not set
1132# CONFIG_USB_FILE_STORAGE is not set
1133# CONFIG_USB_G_SERIAL is not set
1134# CONFIG_USB_MIDI_GADGET is not set
1135# CONFIG_USB_G_PRINTER is not set
1136# CONFIG_USB_CDC_COMPOSITE is not set
1137# CONFIG_MMC is not set 1176# CONFIG_MMC is not set
1138# CONFIG_MEMSTICK is not set 1177# CONFIG_MEMSTICK is not set
1139# CONFIG_NEW_LEDS is not set 1178# CONFIG_NEW_LEDS is not set
@@ -1206,7 +1245,8 @@ CONFIG_RTC_DRV_BFIN=y
1206# 1245#
1207# File systems 1246# File systems
1208# 1247#
1209# CONFIG_EXT2_FS is not set 1248CONFIG_EXT2_FS=m
1249# CONFIG_EXT2_FS_XATTR is not set
1210# CONFIG_EXT3_FS is not set 1250# CONFIG_EXT3_FS is not set
1211# CONFIG_EXT4_FS is not set 1251# CONFIG_EXT4_FS is not set
1212# CONFIG_REISERFS_FS is not set 1252# CONFIG_REISERFS_FS is not set
@@ -1226,14 +1266,19 @@ CONFIG_INOTIFY_USER=y
1226# 1266#
1227# CD-ROM/DVD Filesystems 1267# CD-ROM/DVD Filesystems
1228# 1268#
1229# CONFIG_ISO9660_FS is not set 1269CONFIG_ISO9660_FS=m
1270CONFIG_JOLIET=y
1271# CONFIG_ZISOFS is not set
1230# CONFIG_UDF_FS is not set 1272# CONFIG_UDF_FS is not set
1231 1273
1232# 1274#
1233# DOS/FAT/NT Filesystems 1275# DOS/FAT/NT Filesystems
1234# 1276#
1277CONFIG_FAT_FS=m
1235# CONFIG_MSDOS_FS is not set 1278# CONFIG_MSDOS_FS is not set
1236# CONFIG_VFAT_FS is not set 1279CONFIG_VFAT_FS=m
1280CONFIG_FAT_DEFAULT_CODEPAGE=437
1281CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1237# CONFIG_NTFS_FS is not set 1282# CONFIG_NTFS_FS is not set
1238 1283
1239# 1284#
@@ -1256,16 +1301,6 @@ CONFIG_SYSFS=y
1256# CONFIG_BEFS_FS is not set 1301# CONFIG_BEFS_FS is not set
1257# CONFIG_BFS_FS is not set 1302# CONFIG_BFS_FS is not set
1258# CONFIG_EFS_FS is not set 1303# CONFIG_EFS_FS is not set
1259CONFIG_YAFFS_FS=m
1260CONFIG_YAFFS_YAFFS1=y
1261# CONFIG_YAFFS_9BYTE_TAGS is not set
1262# CONFIG_YAFFS_DOES_ECC is not set
1263CONFIG_YAFFS_YAFFS2=y
1264CONFIG_YAFFS_AUTO_YAFFS2=y
1265# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1266# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1267# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1268CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1269CONFIG_JFFS2_FS=m 1304CONFIG_JFFS2_FS=m
1270CONFIG_JFFS2_FS_DEBUG=0 1305CONFIG_JFFS2_FS_DEBUG=0
1271CONFIG_JFFS2_FS_WRITEBUFFER=y 1306CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1277,6 +1312,16 @@ CONFIG_JFFS2_ZLIB=y
1277# CONFIG_JFFS2_LZO is not set 1312# CONFIG_JFFS2_LZO is not set
1278CONFIG_JFFS2_RTIME=y 1313CONFIG_JFFS2_RTIME=y
1279# CONFIG_JFFS2_RUBIN is not set 1314# CONFIG_JFFS2_RUBIN is not set
1315CONFIG_YAFFS_FS=m
1316CONFIG_YAFFS_YAFFS1=y
1317# CONFIG_YAFFS_9BYTE_TAGS is not set
1318# CONFIG_YAFFS_DOES_ECC is not set
1319CONFIG_YAFFS_YAFFS2=y
1320CONFIG_YAFFS_AUTO_YAFFS2=y
1321# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1322# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1323# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1324CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1280# CONFIG_CRAMFS is not set 1325# CONFIG_CRAMFS is not set
1281# CONFIG_VXFS_FS is not set 1326# CONFIG_VXFS_FS is not set
1282# CONFIG_MINIX_FS is not set 1327# CONFIG_MINIX_FS is not set
@@ -1313,7 +1358,7 @@ CONFIG_SMB_FS=m
1313CONFIG_MSDOS_PARTITION=y 1358CONFIG_MSDOS_PARTITION=y
1314CONFIG_NLS=m 1359CONFIG_NLS=m
1315CONFIG_NLS_DEFAULT="iso8859-1" 1360CONFIG_NLS_DEFAULT="iso8859-1"
1316# CONFIG_NLS_CODEPAGE_437 is not set 1361CONFIG_NLS_CODEPAGE_437=m
1317# CONFIG_NLS_CODEPAGE_737 is not set 1362# CONFIG_NLS_CODEPAGE_737 is not set
1318# CONFIG_NLS_CODEPAGE_775 is not set 1363# CONFIG_NLS_CODEPAGE_775 is not set
1319# CONFIG_NLS_CODEPAGE_850 is not set 1364# CONFIG_NLS_CODEPAGE_850 is not set
@@ -1328,7 +1373,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1328# CONFIG_NLS_CODEPAGE_865 is not set 1373# CONFIG_NLS_CODEPAGE_865 is not set
1329# CONFIG_NLS_CODEPAGE_866 is not set 1374# CONFIG_NLS_CODEPAGE_866 is not set
1330# CONFIG_NLS_CODEPAGE_869 is not set 1375# CONFIG_NLS_CODEPAGE_869 is not set
1331# CONFIG_NLS_CODEPAGE_936 is not set 1376CONFIG_NLS_CODEPAGE_936=m
1332# CONFIG_NLS_CODEPAGE_950 is not set 1377# CONFIG_NLS_CODEPAGE_950 is not set
1333# CONFIG_NLS_CODEPAGE_932 is not set 1378# CONFIG_NLS_CODEPAGE_932 is not set
1334# CONFIG_NLS_CODEPAGE_949 is not set 1379# CONFIG_NLS_CODEPAGE_949 is not set
@@ -1337,7 +1382,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1337# CONFIG_NLS_CODEPAGE_1250 is not set 1382# CONFIG_NLS_CODEPAGE_1250 is not set
1338# CONFIG_NLS_CODEPAGE_1251 is not set 1383# CONFIG_NLS_CODEPAGE_1251 is not set
1339# CONFIG_NLS_ASCII is not set 1384# CONFIG_NLS_ASCII is not set
1340# CONFIG_NLS_ISO8859_1 is not set 1385CONFIG_NLS_ISO8859_1=m
1341# CONFIG_NLS_ISO8859_2 is not set 1386# CONFIG_NLS_ISO8859_2 is not set
1342# CONFIG_NLS_ISO8859_3 is not set 1387# CONFIG_NLS_ISO8859_3 is not set
1343# CONFIG_NLS_ISO8859_4 is not set 1388# CONFIG_NLS_ISO8859_4 is not set
@@ -1350,7 +1395,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1350# CONFIG_NLS_ISO8859_15 is not set 1395# CONFIG_NLS_ISO8859_15 is not set
1351# CONFIG_NLS_KOI8_R is not set 1396# CONFIG_NLS_KOI8_R is not set
1352# CONFIG_NLS_KOI8_U is not set 1397# CONFIG_NLS_KOI8_U is not set
1353# CONFIG_NLS_UTF8 is not set 1398CONFIG_NLS_UTF8=m
1354# CONFIG_DLM is not set 1399# CONFIG_DLM is not set
1355 1400
1356# 1401#
@@ -1365,7 +1410,7 @@ CONFIG_FRAME_WARN=1024
1365CONFIG_DEBUG_FS=y 1410CONFIG_DEBUG_FS=y
1366# CONFIG_HEADERS_CHECK is not set 1411# CONFIG_HEADERS_CHECK is not set
1367CONFIG_DEBUG_KERNEL=y 1412CONFIG_DEBUG_KERNEL=y
1368# CONFIG_DEBUG_SHIRQ is not set 1413CONFIG_DEBUG_SHIRQ=y
1369CONFIG_DETECT_SOFTLOCKUP=y 1414CONFIG_DETECT_SOFTLOCKUP=y
1370# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1415# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1371CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1416CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1374,8 +1419,6 @@ CONFIG_SCHED_DEBUG=y
1374# CONFIG_TIMER_STATS is not set 1419# CONFIG_TIMER_STATS is not set
1375# CONFIG_DEBUG_OBJECTS is not set 1420# CONFIG_DEBUG_OBJECTS is not set
1376# CONFIG_DEBUG_SLAB is not set 1421# CONFIG_DEBUG_SLAB is not set
1377# CONFIG_DEBUG_RT_MUTEXES is not set
1378# CONFIG_RT_MUTEX_TESTER is not set
1379# CONFIG_DEBUG_SPINLOCK is not set 1422# CONFIG_DEBUG_SPINLOCK is not set
1380# CONFIG_DEBUG_MUTEXES is not set 1423# CONFIG_DEBUG_MUTEXES is not set
1381# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1424# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1395,7 +1438,6 @@ CONFIG_DEBUG_INFO=y
1395# CONFIG_BACKTRACE_SELF_TEST is not set 1438# CONFIG_BACKTRACE_SELF_TEST is not set
1396# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1439# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1397# CONFIG_FAULT_INJECTION is not set 1440# CONFIG_FAULT_INJECTION is not set
1398CONFIG_SYSCTL_SYSCALL_CHECK=y
1399 1441
1400# 1442#
1401# Tracers 1443# Tracers
@@ -1411,16 +1453,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1411# CONFIG_DEBUG_STACK_USAGE is not set 1453# CONFIG_DEBUG_STACK_USAGE is not set
1412CONFIG_DEBUG_VERBOSE=y 1454CONFIG_DEBUG_VERBOSE=y
1413CONFIG_DEBUG_MMRS=y 1455CONFIG_DEBUG_MMRS=y
1414# CONFIG_DEBUG_HWERR is not set 1456CONFIG_DEBUG_HWERR=y
1415# CONFIG_DEBUG_DOUBLEFAULT is not set 1457CONFIG_EXACT_HWERR=y
1458CONFIG_DEBUG_DOUBLEFAULT=y
1459CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1460# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1461# CONFIG_DEBUG_ICACHE_CHECK is not set
1416CONFIG_DEBUG_HUNT_FOR_ZERO=y 1462CONFIG_DEBUG_HUNT_FOR_ZERO=y
1417CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1463CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1418CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1464# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1419# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1465CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1420# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1466# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1421CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1467CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1422# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1468# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1423# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1469CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1424CONFIG_EARLY_PRINTK=y 1470CONFIG_EARLY_PRINTK=y
1425CONFIG_CPLB_INFO=y 1471CONFIG_CPLB_INFO=y
1426CONFIG_ACCESS_CHECK=y 1472CONFIG_ACCESS_CHECK=y
@@ -1534,7 +1580,6 @@ CONFIG_CRC32=y
1534# CONFIG_LIBCRC32C is not set 1580# CONFIG_LIBCRC32C is not set
1535CONFIG_ZLIB_INFLATE=y 1581CONFIG_ZLIB_INFLATE=y
1536CONFIG_ZLIB_DEFLATE=m 1582CONFIG_ZLIB_DEFLATE=m
1537CONFIG_PLIST=y
1538CONFIG_HAS_IOMEM=y 1583CONFIG_HAS_IOMEM=y
1539CONFIG_HAS_IOPORT=y 1584CONFIG_HAS_IOPORT=y
1540CONFIG_HAS_DMA=y 1585CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig
index 911b5dba1dbc..e9175c608aa7 100644
--- a/arch/blackfin/configs/BF527-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF527-EZKIT_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -145,8 +145,8 @@ CONFIG_BF527=y
145CONFIG_BF_REV_MIN=0 145CONFIG_BF_REV_MIN=0
146CONFIG_BF_REV_MAX=2 146CONFIG_BF_REV_MAX=2
147# CONFIG_BF_REV_0_0 is not set 147# CONFIG_BF_REV_0_0 is not set
148CONFIG_BF_REV_0_1=y 148# CONFIG_BF_REV_0_1 is not set
149# CONFIG_BF_REV_0_2 is not set 149CONFIG_BF_REV_0_2=y
150# CONFIG_BF_REV_0_3 is not set 150# CONFIG_BF_REV_0_3 is not set
151# CONFIG_BF_REV_0_4 is not set 151# CONFIG_BF_REV_0_4 is not set
152# CONFIG_BF_REV_0_5 is not set 152# CONFIG_BF_REV_0_5 is not set
@@ -264,7 +264,10 @@ CONFIG_HZ=250
264# CONFIG_SCHED_HRTICK is not set 264# CONFIG_SCHED_HRTICK is not set
265CONFIG_GENERIC_TIME=y 265CONFIG_GENERIC_TIME=y
266CONFIG_GENERIC_CLOCKEVENTS=y 266CONFIG_GENERIC_CLOCKEVENTS=y
267# CONFIG_TICKSOURCE_GPTMR0 is not set
268CONFIG_TICKSOURCE_CORETMR=y
267# CONFIG_CYCLES_CLOCKSOURCE is not set 269# CONFIG_CYCLES_CLOCKSOURCE is not set
270# CONFIG_GPTMR0_CLOCKSOURCE is not set
268# CONFIG_NO_HZ is not set 271# CONFIG_NO_HZ is not set
269# CONFIG_HIGH_RES_TIMERS is not set 272# CONFIG_HIGH_RES_TIMERS is not set
270CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 273CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -318,7 +321,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
318# CONFIG_PHYS_ADDR_T_64BIT is not set 321# CONFIG_PHYS_ADDR_T_64BIT is not set
319CONFIG_ZONE_DMA_FLAG=1 322CONFIG_ZONE_DMA_FLAG=1
320CONFIG_VIRT_TO_BUS=y 323CONFIG_VIRT_TO_BUS=y
321CONFIG_BFIN_GPTIMERS=m 324CONFIG_BFIN_GPTIMERS=y
322# CONFIG_DMA_UNCACHED_4M is not set 325# CONFIG_DMA_UNCACHED_4M is not set
323# CONFIG_DMA_UNCACHED_2M is not set 326# CONFIG_DMA_UNCACHED_2M is not set
324CONFIG_DMA_UNCACHED_1M=y 327CONFIG_DMA_UNCACHED_1M=y
@@ -409,7 +412,7 @@ CONFIG_IP_PNP=y
409# CONFIG_NET_IPIP is not set 412# CONFIG_NET_IPIP is not set
410# CONFIG_NET_IPGRE is not set 413# CONFIG_NET_IPGRE is not set
411# CONFIG_ARPD is not set 414# CONFIG_ARPD is not set
412CONFIG_SYN_COOKIES=y 415# CONFIG_SYN_COOKIES is not set
413# CONFIG_INET_AH is not set 416# CONFIG_INET_AH is not set
414# CONFIG_INET_ESP is not set 417# CONFIG_INET_ESP is not set
415# CONFIG_INET_IPCOMP is not set 418# CONFIG_INET_IPCOMP is not set
@@ -639,9 +642,42 @@ CONFIG_HAVE_IDE=y
639# SCSI device support 642# SCSI device support
640# 643#
641# CONFIG_RAID_ATTRS is not set 644# CONFIG_RAID_ATTRS is not set
642# CONFIG_SCSI is not set 645CONFIG_SCSI=y
643# CONFIG_SCSI_DMA is not set 646CONFIG_SCSI_DMA=y
647# CONFIG_SCSI_TGT is not set
644# CONFIG_SCSI_NETLINK is not set 648# CONFIG_SCSI_NETLINK is not set
649# CONFIG_SCSI_PROC_FS is not set
650
651#
652# SCSI support type (disk, tape, CD-ROM)
653#
654CONFIG_BLK_DEV_SD=y
655# CONFIG_CHR_DEV_ST is not set
656# CONFIG_CHR_DEV_OSST is not set
657CONFIG_BLK_DEV_SR=m
658# CONFIG_BLK_DEV_SR_VENDOR is not set
659# CONFIG_CHR_DEV_SG is not set
660# CONFIG_CHR_DEV_SCH is not set
661
662#
663# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
664#
665# CONFIG_SCSI_MULTI_LUN is not set
666# CONFIG_SCSI_CONSTANTS is not set
667# CONFIG_SCSI_LOGGING is not set
668# CONFIG_SCSI_SCAN_ASYNC is not set
669CONFIG_SCSI_WAIT_SCAN=m
670
671#
672# SCSI Transports
673#
674# CONFIG_SCSI_SPI_ATTRS is not set
675# CONFIG_SCSI_FC_ATTRS is not set
676# CONFIG_SCSI_ISCSI_ATTRS is not set
677# CONFIG_SCSI_SAS_LIBSAS is not set
678# CONFIG_SCSI_SRP_ATTRS is not set
679# CONFIG_SCSI_LOWLEVEL is not set
680# CONFIG_SCSI_DH is not set
645# CONFIG_ATA is not set 681# CONFIG_ATA is not set
646# CONFIG_MD is not set 682# CONFIG_MD is not set
647CONFIG_NETDEVICES=y 683CONFIG_NETDEVICES=y
@@ -687,9 +723,8 @@ CONFIG_BFIN_MAC_RMII=y
687# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 723# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
688# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 724# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
689# CONFIG_B44 is not set 725# CONFIG_B44 is not set
690CONFIG_NETDEV_1000=y 726# CONFIG_NETDEV_1000 is not set
691# CONFIG_AX88180 is not set 727# CONFIG_NETDEV_10000 is not set
692CONFIG_NETDEV_10000=y
693 728
694# 729#
695# Wireless LAN 730# Wireless LAN
@@ -758,14 +793,14 @@ CONFIG_INPUT_MISC=y
758# Character devices 793# Character devices
759# 794#
760# CONFIG_AD9960 is not set 795# CONFIG_AD9960 is not set
761# CONFIG_SPI_ADC_BF533 is not set 796CONFIG_BFIN_DMA_INTERFACE=m
762# CONFIG_BF5xx_PPIFCD is not set 797# CONFIG_BFIN_PPI is not set
798# CONFIG_BFIN_PPIFCD is not set
763# CONFIG_BFIN_SIMPLE_TIMER is not set 799# CONFIG_BFIN_SIMPLE_TIMER is not set
764CONFIG_BF5xx_PPI=m 800# CONFIG_BFIN_SPI_ADC is not set
765CONFIG_BFIN_SPORT=m 801CONFIG_BFIN_SPORT=m
766# CONFIG_BFIN_TIMER_LATENCY is not set 802# CONFIG_BFIN_TIMER_LATENCY is not set
767# CONFIG_TWI_LCD is not set 803# CONFIG_BFIN_TWI_LCD is not set
768CONFIG_BFIN_DMA_INTERFACE=m
769CONFIG_SIMPLE_GPIO=m 804CONFIG_SIMPLE_GPIO=m
770CONFIG_VT=y 805CONFIG_VT=y
771CONFIG_CONSOLE_TRANSLATIONS=y 806CONFIG_CONSOLE_TRANSLATIONS=y
@@ -875,7 +910,30 @@ CONFIG_SPI_BFIN=y
875# CONFIG_SPI_SPIDEV is not set 910# CONFIG_SPI_SPIDEV is not set
876# CONFIG_SPI_TLE62X0 is not set 911# CONFIG_SPI_TLE62X0 is not set
877CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 912CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
878# CONFIG_GPIOLIB is not set 913CONFIG_GPIOLIB=y
914# CONFIG_DEBUG_GPIO is not set
915CONFIG_GPIO_SYSFS=y
916
917#
918# Memory mapped GPIO expanders:
919#
920
921#
922# I2C GPIO expanders:
923#
924# CONFIG_GPIO_MAX732X is not set
925# CONFIG_GPIO_PCA953X is not set
926# CONFIG_GPIO_PCF857X is not set
927
928#
929# PCI GPIO expanders:
930#
931
932#
933# SPI GPIO expanders:
934#
935# CONFIG_GPIO_MAX7301 is not set
936# CONFIG_GPIO_MCP23S08 is not set
879# CONFIG_W1 is not set 937# CONFIG_W1 is not set
880# CONFIG_POWER_SUPPLY is not set 938# CONFIG_POWER_SUPPLY is not set
881# CONFIG_HWMON is not set 939# CONFIG_HWMON is not set
@@ -909,6 +967,7 @@ CONFIG_SSB_POSSIBLE=y
909# CONFIG_HTC_PASIC3 is not set 967# CONFIG_HTC_PASIC3 is not set
910# CONFIG_MFD_TMIO is not set 968# CONFIG_MFD_TMIO is not set
911# CONFIG_PMIC_DA903X is not set 969# CONFIG_PMIC_DA903X is not set
970# CONFIG_PMIC_ADP5520 is not set
912# CONFIG_MFD_WM8400 is not set 971# CONFIG_MFD_WM8400 is not set
913# CONFIG_MFD_WM8350_I2C is not set 972# CONFIG_MFD_WM8350_I2C is not set
914# CONFIG_REGULATOR is not set 973# CONFIG_REGULATOR is not set
@@ -1091,8 +1150,8 @@ CONFIG_USB=y
1091# 1150#
1092# Miscellaneous USB options 1151# Miscellaneous USB options
1093# 1152#
1094# CONFIG_USB_DEVICEFS is not set 1153CONFIG_USB_DEVICEFS=y
1095CONFIG_USB_DEVICE_CLASS=y 1154# CONFIG_USB_DEVICE_CLASS is not set
1096# CONFIG_USB_DYNAMIC_MINORS is not set 1155# CONFIG_USB_DYNAMIC_MINORS is not set
1097# CONFIG_USB_OTG is not set 1156# CONFIG_USB_OTG is not set
1098# CONFIG_USB_OTG_WHITELIST is not set 1157# CONFIG_USB_OTG_WHITELIST is not set
@@ -1120,10 +1179,10 @@ CONFIG_USB_MUSB_SOC=y
1120CONFIG_USB_MUSB_HOST=y 1179CONFIG_USB_MUSB_HOST=y
1121# CONFIG_USB_MUSB_PERIPHERAL is not set 1180# CONFIG_USB_MUSB_PERIPHERAL is not set
1122# CONFIG_USB_MUSB_OTG is not set 1181# CONFIG_USB_MUSB_OTG is not set
1123# CONFIG_USB_GADGET_MUSB_HDRC is not set
1124CONFIG_USB_MUSB_HDRC_HCD=y 1182CONFIG_USB_MUSB_HDRC_HCD=y
1125CONFIG_MUSB_PIO_ONLY=y 1183# CONFIG_MUSB_PIO_ONLY is not set
1126CONFIG_MUSB_DMA_POLL=y 1184CONFIG_USB_INVENTRA_DMA=y
1185# CONFIG_USB_TI_CPPI_DMA is not set
1127# CONFIG_USB_MUSB_DEBUG is not set 1186# CONFIG_USB_MUSB_DEBUG is not set
1128 1187
1129# 1188#
@@ -1141,7 +1200,7 @@ CONFIG_MUSB_DMA_POLL=y
1141# 1200#
1142# see USB_STORAGE Help for more information 1201# see USB_STORAGE Help for more information
1143# 1202#
1144CONFIG_USB_STORAGE=m 1203CONFIG_USB_STORAGE=y
1145# CONFIG_USB_STORAGE_DEBUG is not set 1204# CONFIG_USB_STORAGE_DEBUG is not set
1146# CONFIG_USB_STORAGE_DATAFAB is not set 1205# CONFIG_USB_STORAGE_DATAFAB is not set
1147# CONFIG_USB_STORAGE_FREECOM is not set 1206# CONFIG_USB_STORAGE_FREECOM is not set
@@ -1190,33 +1249,10 @@ CONFIG_USB_STORAGE=m
1190# CONFIG_USB_LD is not set 1249# CONFIG_USB_LD is not set
1191# CONFIG_USB_TRANCEVIBRATOR is not set 1250# CONFIG_USB_TRANCEVIBRATOR is not set
1192# CONFIG_USB_IOWARRIOR is not set 1251# CONFIG_USB_IOWARRIOR is not set
1252# CONFIG_USB_TEST is not set
1193# CONFIG_USB_ISIGHTFW is not set 1253# CONFIG_USB_ISIGHTFW is not set
1194# CONFIG_USB_VST is not set 1254# CONFIG_USB_VST is not set
1195# CONFIG_USB_GADGET is not set 1255# CONFIG_USB_GADGET is not set
1196# CONFIG_USB_GADGET_AT91 is not set
1197# CONFIG_USB_GADGET_ATMEL_USBA is not set
1198# CONFIG_USB_GADGET_FSL_USB2 is not set
1199# CONFIG_USB_GADGET_LH7A40X is not set
1200# CONFIG_USB_GADGET_OMAP is not set
1201# CONFIG_USB_GADGET_PXA25X is not set
1202# CONFIG_USB_GADGET_PXA27X is not set
1203# CONFIG_USB_GADGET_S3C2410 is not set
1204# CONFIG_USB_GADGET_M66592 is not set
1205# CONFIG_USB_GADGET_AMD5536UDC is not set
1206# CONFIG_USB_GADGET_FSL_QE is not set
1207# CONFIG_USB_GADGET_NET2272 is not set
1208# CONFIG_USB_GADGET_NET2280 is not set
1209# CONFIG_USB_GADGET_GOKU is not set
1210# CONFIG_USB_GADGET_DUMMY_HCD is not set
1211# CONFIG_USB_ZERO is not set
1212# CONFIG_USB_AUDIO is not set
1213# CONFIG_USB_ETH is not set
1214# CONFIG_USB_GADGETFS is not set
1215# CONFIG_USB_FILE_STORAGE is not set
1216# CONFIG_USB_G_SERIAL is not set
1217# CONFIG_USB_MIDI_GADGET is not set
1218# CONFIG_USB_G_PRINTER is not set
1219# CONFIG_USB_CDC_COMPOSITE is not set
1220# CONFIG_MMC is not set 1256# CONFIG_MMC is not set
1221# CONFIG_MEMSTICK is not set 1257# CONFIG_MEMSTICK is not set
1222# CONFIG_NEW_LEDS is not set 1258# CONFIG_NEW_LEDS is not set
@@ -1289,7 +1325,8 @@ CONFIG_RTC_DRV_BFIN=y
1289# 1325#
1290# File systems 1326# File systems
1291# 1327#
1292# CONFIG_EXT2_FS is not set 1328CONFIG_EXT2_FS=m
1329# CONFIG_EXT2_FS_XATTR is not set
1293# CONFIG_EXT3_FS is not set 1330# CONFIG_EXT3_FS is not set
1294# CONFIG_EXT4_FS is not set 1331# CONFIG_EXT4_FS is not set
1295# CONFIG_REISERFS_FS is not set 1332# CONFIG_REISERFS_FS is not set
@@ -1309,14 +1346,20 @@ CONFIG_INOTIFY_USER=y
1309# 1346#
1310# CD-ROM/DVD Filesystems 1347# CD-ROM/DVD Filesystems
1311# 1348#
1312# CONFIG_ISO9660_FS is not set 1349CONFIG_ISO9660_FS=m
1313# CONFIG_UDF_FS is not set 1350CONFIG_JOLIET=y
1351# CONFIG_ZISOFS is not set
1352CONFIG_UDF_FS=m
1353CONFIG_UDF_NLS=y
1314 1354
1315# 1355#
1316# DOS/FAT/NT Filesystems 1356# DOS/FAT/NT Filesystems
1317# 1357#
1358CONFIG_FAT_FS=m
1318# CONFIG_MSDOS_FS is not set 1359# CONFIG_MSDOS_FS is not set
1319# CONFIG_VFAT_FS is not set 1360CONFIG_VFAT_FS=m
1361CONFIG_FAT_DEFAULT_CODEPAGE=437
1362CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1320# CONFIG_NTFS_FS is not set 1363# CONFIG_NTFS_FS is not set
1321 1364
1322# 1365#
@@ -1339,16 +1382,6 @@ CONFIG_SYSFS=y
1339# CONFIG_BEFS_FS is not set 1382# CONFIG_BEFS_FS is not set
1340# CONFIG_BFS_FS is not set 1383# CONFIG_BFS_FS is not set
1341# CONFIG_EFS_FS is not set 1384# CONFIG_EFS_FS is not set
1342CONFIG_YAFFS_FS=m
1343CONFIG_YAFFS_YAFFS1=y
1344# CONFIG_YAFFS_9BYTE_TAGS is not set
1345# CONFIG_YAFFS_DOES_ECC is not set
1346CONFIG_YAFFS_YAFFS2=y
1347CONFIG_YAFFS_AUTO_YAFFS2=y
1348# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1349# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1350# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1351CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1352CONFIG_JFFS2_FS=m 1385CONFIG_JFFS2_FS=m
1353CONFIG_JFFS2_FS_DEBUG=0 1386CONFIG_JFFS2_FS_DEBUG=0
1354CONFIG_JFFS2_FS_WRITEBUFFER=y 1387CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1360,6 +1393,16 @@ CONFIG_JFFS2_ZLIB=y
1360# CONFIG_JFFS2_LZO is not set 1393# CONFIG_JFFS2_LZO is not set
1361CONFIG_JFFS2_RTIME=y 1394CONFIG_JFFS2_RTIME=y
1362# CONFIG_JFFS2_RUBIN is not set 1395# CONFIG_JFFS2_RUBIN is not set
1396CONFIG_YAFFS_FS=m
1397CONFIG_YAFFS_YAFFS1=y
1398# CONFIG_YAFFS_9BYTE_TAGS is not set
1399# CONFIG_YAFFS_DOES_ECC is not set
1400CONFIG_YAFFS_YAFFS2=y
1401CONFIG_YAFFS_AUTO_YAFFS2=y
1402# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1403# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1404# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1405CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1363# CONFIG_CRAMFS is not set 1406# CONFIG_CRAMFS is not set
1364# CONFIG_VXFS_FS is not set 1407# CONFIG_VXFS_FS is not set
1365# CONFIG_MINIX_FS is not set 1408# CONFIG_MINIX_FS is not set
@@ -1396,7 +1439,7 @@ CONFIG_SMB_FS=m
1396CONFIG_MSDOS_PARTITION=y 1439CONFIG_MSDOS_PARTITION=y
1397CONFIG_NLS=m 1440CONFIG_NLS=m
1398CONFIG_NLS_DEFAULT="iso8859-1" 1441CONFIG_NLS_DEFAULT="iso8859-1"
1399# CONFIG_NLS_CODEPAGE_437 is not set 1442CONFIG_NLS_CODEPAGE_437=m
1400# CONFIG_NLS_CODEPAGE_737 is not set 1443# CONFIG_NLS_CODEPAGE_737 is not set
1401# CONFIG_NLS_CODEPAGE_775 is not set 1444# CONFIG_NLS_CODEPAGE_775 is not set
1402# CONFIG_NLS_CODEPAGE_850 is not set 1445# CONFIG_NLS_CODEPAGE_850 is not set
@@ -1411,7 +1454,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1411# CONFIG_NLS_CODEPAGE_865 is not set 1454# CONFIG_NLS_CODEPAGE_865 is not set
1412# CONFIG_NLS_CODEPAGE_866 is not set 1455# CONFIG_NLS_CODEPAGE_866 is not set
1413# CONFIG_NLS_CODEPAGE_869 is not set 1456# CONFIG_NLS_CODEPAGE_869 is not set
1414# CONFIG_NLS_CODEPAGE_936 is not set 1457CONFIG_NLS_CODEPAGE_936=m
1415# CONFIG_NLS_CODEPAGE_950 is not set 1458# CONFIG_NLS_CODEPAGE_950 is not set
1416# CONFIG_NLS_CODEPAGE_932 is not set 1459# CONFIG_NLS_CODEPAGE_932 is not set
1417# CONFIG_NLS_CODEPAGE_949 is not set 1460# CONFIG_NLS_CODEPAGE_949 is not set
@@ -1420,7 +1463,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1420# CONFIG_NLS_CODEPAGE_1250 is not set 1463# CONFIG_NLS_CODEPAGE_1250 is not set
1421# CONFIG_NLS_CODEPAGE_1251 is not set 1464# CONFIG_NLS_CODEPAGE_1251 is not set
1422# CONFIG_NLS_ASCII is not set 1465# CONFIG_NLS_ASCII is not set
1423# CONFIG_NLS_ISO8859_1 is not set 1466CONFIG_NLS_ISO8859_1=m
1424# CONFIG_NLS_ISO8859_2 is not set 1467# CONFIG_NLS_ISO8859_2 is not set
1425# CONFIG_NLS_ISO8859_3 is not set 1468# CONFIG_NLS_ISO8859_3 is not set
1426# CONFIG_NLS_ISO8859_4 is not set 1469# CONFIG_NLS_ISO8859_4 is not set
@@ -1433,7 +1476,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1433# CONFIG_NLS_ISO8859_15 is not set 1476# CONFIG_NLS_ISO8859_15 is not set
1434# CONFIG_NLS_KOI8_R is not set 1477# CONFIG_NLS_KOI8_R is not set
1435# CONFIG_NLS_KOI8_U is not set 1478# CONFIG_NLS_KOI8_U is not set
1436# CONFIG_NLS_UTF8 is not set 1479CONFIG_NLS_UTF8=m
1437# CONFIG_DLM is not set 1480# CONFIG_DLM is not set
1438 1481
1439# 1482#
@@ -1448,7 +1491,7 @@ CONFIG_FRAME_WARN=1024
1448CONFIG_DEBUG_FS=y 1491CONFIG_DEBUG_FS=y
1449# CONFIG_HEADERS_CHECK is not set 1492# CONFIG_HEADERS_CHECK is not set
1450CONFIG_DEBUG_KERNEL=y 1493CONFIG_DEBUG_KERNEL=y
1451# CONFIG_DEBUG_SHIRQ is not set 1494CONFIG_DEBUG_SHIRQ=y
1452CONFIG_DETECT_SOFTLOCKUP=y 1495CONFIG_DETECT_SOFTLOCKUP=y
1453# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1496# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1454CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1497CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1457,8 +1500,6 @@ CONFIG_SCHED_DEBUG=y
1457# CONFIG_TIMER_STATS is not set 1500# CONFIG_TIMER_STATS is not set
1458# CONFIG_DEBUG_OBJECTS is not set 1501# CONFIG_DEBUG_OBJECTS is not set
1459# CONFIG_DEBUG_SLAB is not set 1502# CONFIG_DEBUG_SLAB is not set
1460# CONFIG_DEBUG_RT_MUTEXES is not set
1461# CONFIG_RT_MUTEX_TESTER is not set
1462# CONFIG_DEBUG_SPINLOCK is not set 1503# CONFIG_DEBUG_SPINLOCK is not set
1463# CONFIG_DEBUG_MUTEXES is not set 1504# CONFIG_DEBUG_MUTEXES is not set
1464# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1505# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1478,7 +1519,6 @@ CONFIG_DEBUG_INFO=y
1478# CONFIG_BACKTRACE_SELF_TEST is not set 1519# CONFIG_BACKTRACE_SELF_TEST is not set
1479# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1520# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1480# CONFIG_FAULT_INJECTION is not set 1521# CONFIG_FAULT_INJECTION is not set
1481# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1482 1522
1483# 1523#
1484# Tracers 1524# Tracers
@@ -1494,16 +1534,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1494# CONFIG_DEBUG_STACK_USAGE is not set 1534# CONFIG_DEBUG_STACK_USAGE is not set
1495CONFIG_DEBUG_VERBOSE=y 1535CONFIG_DEBUG_VERBOSE=y
1496CONFIG_DEBUG_MMRS=y 1536CONFIG_DEBUG_MMRS=y
1497# CONFIG_DEBUG_HWERR is not set 1537CONFIG_DEBUG_HWERR=y
1498# CONFIG_DEBUG_DOUBLEFAULT is not set 1538CONFIG_EXACT_HWERR=y
1539CONFIG_DEBUG_DOUBLEFAULT=y
1540CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1541# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1542# CONFIG_DEBUG_ICACHE_CHECK is not set
1499CONFIG_DEBUG_HUNT_FOR_ZERO=y 1543CONFIG_DEBUG_HUNT_FOR_ZERO=y
1500CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1544CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1501CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1545# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1502# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1546CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1503# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1547# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1504CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1548CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1505# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1549# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1506# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1550CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1507CONFIG_EARLY_PRINTK=y 1551CONFIG_EARLY_PRINTK=y
1508CONFIG_CPLB_INFO=y 1552CONFIG_CPLB_INFO=y
1509CONFIG_ACCESS_CHECK=y 1553CONFIG_ACCESS_CHECK=y
@@ -1611,13 +1655,12 @@ CONFIG_BITREVERSE=y
1611CONFIG_CRC_CCITT=m 1655CONFIG_CRC_CCITT=m
1612# CONFIG_CRC16 is not set 1656# CONFIG_CRC16 is not set
1613# CONFIG_CRC_T10DIF is not set 1657# CONFIG_CRC_T10DIF is not set
1614# CONFIG_CRC_ITU_T is not set 1658CONFIG_CRC_ITU_T=m
1615CONFIG_CRC32=y 1659CONFIG_CRC32=y
1616# CONFIG_CRC7 is not set 1660# CONFIG_CRC7 is not set
1617# CONFIG_LIBCRC32C is not set 1661# CONFIG_LIBCRC32C is not set
1618CONFIG_ZLIB_INFLATE=y 1662CONFIG_ZLIB_INFLATE=y
1619CONFIG_ZLIB_DEFLATE=m 1663CONFIG_ZLIB_DEFLATE=m
1620CONFIG_PLIST=y
1621CONFIG_HAS_IOMEM=y 1664CONFIG_HAS_IOMEM=y
1622CONFIG_HAS_IOPORT=y 1665CONFIG_HAS_IOPORT=y
1623CONFIG_HAS_DMA=y 1666CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF533-EZKIT_defconfig b/arch/blackfin/configs/BF533-EZKIT_defconfig
index 4c41e03efe0f..5aa63bafdd62 100644
--- a/arch/blackfin/configs/BF533-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF533-EZKIT_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -225,7 +225,10 @@ CONFIG_HZ=250
225CONFIG_SCHED_HRTICK=y 225CONFIG_SCHED_HRTICK=y
226CONFIG_GENERIC_TIME=y 226CONFIG_GENERIC_TIME=y
227CONFIG_GENERIC_CLOCKEVENTS=y 227CONFIG_GENERIC_CLOCKEVENTS=y
228# CONFIG_TICKSOURCE_GPTMR0 is not set
229CONFIG_TICKSOURCE_CORETMR=y
228# CONFIG_CYCLES_CLOCKSOURCE is not set 230# CONFIG_CYCLES_CLOCKSOURCE is not set
231# CONFIG_GPTMR0_CLOCKSOURCE is not set
229CONFIG_TICK_ONESHOT=y 232CONFIG_TICK_ONESHOT=y
230# CONFIG_NO_HZ is not set 233# CONFIG_NO_HZ is not set
231CONFIG_HIGH_RES_TIMERS=y 234CONFIG_HIGH_RES_TIMERS=y
@@ -382,7 +385,7 @@ CONFIG_IP_PNP=y
382# CONFIG_NET_IPIP is not set 385# CONFIG_NET_IPIP is not set
383# CONFIG_NET_IPGRE is not set 386# CONFIG_NET_IPGRE is not set
384# CONFIG_ARPD is not set 387# CONFIG_ARPD is not set
385CONFIG_SYN_COOKIES=y 388# CONFIG_SYN_COOKIES is not set
386# CONFIG_INET_AH is not set 389# CONFIG_INET_AH is not set
387# CONFIG_INET_ESP is not set 390# CONFIG_INET_ESP is not set
388# CONFIG_INET_IPCOMP is not set 391# CONFIG_INET_IPCOMP is not set
@@ -613,9 +616,8 @@ CONFIG_SMC91X=y
613# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 616# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
614# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 617# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
615# CONFIG_B44 is not set 618# CONFIG_B44 is not set
616CONFIG_NETDEV_1000=y 619# CONFIG_NETDEV_1000 is not set
617# CONFIG_AX88180 is not set 620# CONFIG_NETDEV_10000 is not set
618CONFIG_NETDEV_10000=y
619 621
620# 622#
621# Wireless LAN 623# Wireless LAN
@@ -667,13 +669,13 @@ CONFIG_INPUT_EVDEV=m
667# Character devices 669# Character devices
668# 670#
669# CONFIG_AD9960 is not set 671# CONFIG_AD9960 is not set
670# CONFIG_SPI_ADC_BF533 is not set 672CONFIG_BFIN_DMA_INTERFACE=m
671# CONFIG_BF5xx_PPIFCD is not set 673# CONFIG_BFIN_PPI is not set
674# CONFIG_BFIN_PPIFCD is not set
672# CONFIG_BFIN_SIMPLE_TIMER is not set 675# CONFIG_BFIN_SIMPLE_TIMER is not set
673# CONFIG_BF5xx_PPI is not set 676# CONFIG_BFIN_SPI_ADC is not set
674CONFIG_BFIN_SPORT=y 677CONFIG_BFIN_SPORT=y
675# CONFIG_BFIN_TIMER_LATENCY is not set 678# CONFIG_BFIN_TIMER_LATENCY is not set
676CONFIG_BFIN_DMA_INTERFACE=m
677CONFIG_SIMPLE_GPIO=m 679CONFIG_SIMPLE_GPIO=m
678# CONFIG_VT is not set 680# CONFIG_VT is not set
679# CONFIG_DEVKMEM is not set 681# CONFIG_DEVKMEM is not set
@@ -729,7 +731,30 @@ CONFIG_SPI_BFIN=y
729# CONFIG_SPI_SPIDEV is not set 731# CONFIG_SPI_SPIDEV is not set
730# CONFIG_SPI_TLE62X0 is not set 732# CONFIG_SPI_TLE62X0 is not set
731CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 733CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
732# CONFIG_GPIOLIB is not set 734CONFIG_GPIOLIB=y
735# CONFIG_DEBUG_GPIO is not set
736CONFIG_GPIO_SYSFS=y
737
738#
739# Memory mapped GPIO expanders:
740#
741
742#
743# I2C GPIO expanders:
744#
745# CONFIG_GPIO_MAX732X is not set
746# CONFIG_GPIO_PCA953X is not set
747# CONFIG_GPIO_PCF857X is not set
748
749#
750# PCI GPIO expanders:
751#
752
753#
754# SPI GPIO expanders:
755#
756# CONFIG_GPIO_MAX7301 is not set
757# CONFIG_GPIO_MCP23S08 is not set
733# CONFIG_W1 is not set 758# CONFIG_W1 is not set
734# CONFIG_POWER_SUPPLY is not set 759# CONFIG_POWER_SUPPLY is not set
735# CONFIG_HWMON is not set 760# CONFIG_HWMON is not set
@@ -904,16 +929,6 @@ CONFIG_SYSFS=y
904# CONFIG_BEFS_FS is not set 929# CONFIG_BEFS_FS is not set
905# CONFIG_BFS_FS is not set 930# CONFIG_BFS_FS is not set
906# CONFIG_EFS_FS is not set 931# CONFIG_EFS_FS is not set
907CONFIG_YAFFS_FS=m
908CONFIG_YAFFS_YAFFS1=y
909# CONFIG_YAFFS_9BYTE_TAGS is not set
910# CONFIG_YAFFS_DOES_ECC is not set
911CONFIG_YAFFS_YAFFS2=y
912CONFIG_YAFFS_AUTO_YAFFS2=y
913# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
914# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
915# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
916CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
917CONFIG_JFFS2_FS=m 932CONFIG_JFFS2_FS=m
918CONFIG_JFFS2_FS_DEBUG=0 933CONFIG_JFFS2_FS_DEBUG=0
919CONFIG_JFFS2_FS_WRITEBUFFER=y 934CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -925,6 +940,16 @@ CONFIG_JFFS2_ZLIB=y
925# CONFIG_JFFS2_LZO is not set 940# CONFIG_JFFS2_LZO is not set
926CONFIG_JFFS2_RTIME=y 941CONFIG_JFFS2_RTIME=y
927# CONFIG_JFFS2_RUBIN is not set 942# CONFIG_JFFS2_RUBIN is not set
943CONFIG_YAFFS_FS=m
944CONFIG_YAFFS_YAFFS1=y
945# CONFIG_YAFFS_9BYTE_TAGS is not set
946# CONFIG_YAFFS_DOES_ECC is not set
947CONFIG_YAFFS_YAFFS2=y
948CONFIG_YAFFS_AUTO_YAFFS2=y
949# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
950# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
951# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
952CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
928# CONFIG_CRAMFS is not set 953# CONFIG_CRAMFS is not set
929# CONFIG_VXFS_FS is not set 954# CONFIG_VXFS_FS is not set
930# CONFIG_MINIX_FS is not set 955# CONFIG_MINIX_FS is not set
@@ -1013,7 +1038,7 @@ CONFIG_FRAME_WARN=1024
1013CONFIG_DEBUG_FS=y 1038CONFIG_DEBUG_FS=y
1014# CONFIG_HEADERS_CHECK is not set 1039# CONFIG_HEADERS_CHECK is not set
1015CONFIG_DEBUG_KERNEL=y 1040CONFIG_DEBUG_KERNEL=y
1016# CONFIG_DEBUG_SHIRQ is not set 1041CONFIG_DEBUG_SHIRQ=y
1017CONFIG_DETECT_SOFTLOCKUP=y 1042CONFIG_DETECT_SOFTLOCKUP=y
1018# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1043# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1019CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1044CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1022,8 +1047,6 @@ CONFIG_SCHED_DEBUG=y
1022# CONFIG_TIMER_STATS is not set 1047# CONFIG_TIMER_STATS is not set
1023# CONFIG_DEBUG_OBJECTS is not set 1048# CONFIG_DEBUG_OBJECTS is not set
1024# CONFIG_DEBUG_SLAB is not set 1049# CONFIG_DEBUG_SLAB is not set
1025# CONFIG_DEBUG_RT_MUTEXES is not set
1026# CONFIG_RT_MUTEX_TESTER is not set
1027# CONFIG_DEBUG_SPINLOCK is not set 1050# CONFIG_DEBUG_SPINLOCK is not set
1028# CONFIG_DEBUG_MUTEXES is not set 1051# CONFIG_DEBUG_MUTEXES is not set
1029# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1052# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1043,7 +1066,6 @@ CONFIG_DEBUG_INFO=y
1043# CONFIG_BACKTRACE_SELF_TEST is not set 1066# CONFIG_BACKTRACE_SELF_TEST is not set
1044# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1067# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1045# CONFIG_FAULT_INJECTION is not set 1068# CONFIG_FAULT_INJECTION is not set
1046# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1047 1069
1048# 1070#
1049# Tracers 1071# Tracers
@@ -1059,16 +1081,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1059# CONFIG_DEBUG_STACK_USAGE is not set 1081# CONFIG_DEBUG_STACK_USAGE is not set
1060CONFIG_DEBUG_VERBOSE=y 1082CONFIG_DEBUG_VERBOSE=y
1061CONFIG_DEBUG_MMRS=y 1083CONFIG_DEBUG_MMRS=y
1062# CONFIG_DEBUG_HWERR is not set 1084CONFIG_DEBUG_HWERR=y
1063# CONFIG_DEBUG_DOUBLEFAULT is not set 1085CONFIG_EXACT_HWERR=y
1086CONFIG_DEBUG_DOUBLEFAULT=y
1087CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1088# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1089# CONFIG_DEBUG_ICACHE_CHECK is not set
1064CONFIG_DEBUG_HUNT_FOR_ZERO=y 1090CONFIG_DEBUG_HUNT_FOR_ZERO=y
1065CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1091CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1066CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1092# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1067# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1093CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1068# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1094# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1069CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1095CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1070# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1096# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1071# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1097CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1072CONFIG_EARLY_PRINTK=y 1098CONFIG_EARLY_PRINTK=y
1073CONFIG_CPLB_INFO=y 1099CONFIG_CPLB_INFO=y
1074CONFIG_ACCESS_CHECK=y 1100CONFIG_ACCESS_CHECK=y
@@ -1181,7 +1207,6 @@ CONFIG_CRC32=y
1181# CONFIG_LIBCRC32C is not set 1207# CONFIG_LIBCRC32C is not set
1182CONFIG_ZLIB_INFLATE=y 1208CONFIG_ZLIB_INFLATE=y
1183CONFIG_ZLIB_DEFLATE=m 1209CONFIG_ZLIB_DEFLATE=m
1184CONFIG_PLIST=y
1185CONFIG_HAS_IOMEM=y 1210CONFIG_HAS_IOMEM=y
1186CONFIG_HAS_IOPORT=y 1211CONFIG_HAS_IOPORT=y
1187CONFIG_HAS_DMA=y 1212CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF533-STAMP_defconfig b/arch/blackfin/configs/BF533-STAMP_defconfig
index 9c482cd1b343..fed25329e13c 100644
--- a/arch/blackfin/configs/BF533-STAMP_defconfig
+++ b/arch/blackfin/configs/BF533-STAMP_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -225,7 +225,10 @@ CONFIG_HZ=250
225CONFIG_SCHED_HRTICK=y 225CONFIG_SCHED_HRTICK=y
226CONFIG_GENERIC_TIME=y 226CONFIG_GENERIC_TIME=y
227CONFIG_GENERIC_CLOCKEVENTS=y 227CONFIG_GENERIC_CLOCKEVENTS=y
228# CONFIG_TICKSOURCE_GPTMR0 is not set
229CONFIG_TICKSOURCE_CORETMR=y
228# CONFIG_CYCLES_CLOCKSOURCE is not set 230# CONFIG_CYCLES_CLOCKSOURCE is not set
231# CONFIG_GPTMR0_CLOCKSOURCE is not set
229CONFIG_TICK_ONESHOT=y 232CONFIG_TICK_ONESHOT=y
230# CONFIG_NO_HZ is not set 233# CONFIG_NO_HZ is not set
231CONFIG_HIGH_RES_TIMERS=y 234CONFIG_HIGH_RES_TIMERS=y
@@ -382,7 +385,7 @@ CONFIG_IP_PNP=y
382# CONFIG_NET_IPIP is not set 385# CONFIG_NET_IPIP is not set
383# CONFIG_NET_IPGRE is not set 386# CONFIG_NET_IPGRE is not set
384# CONFIG_ARPD is not set 387# CONFIG_ARPD is not set
385CONFIG_SYN_COOKIES=y 388# CONFIG_SYN_COOKIES is not set
386# CONFIG_INET_AH is not set 389# CONFIG_INET_AH is not set
387# CONFIG_INET_ESP is not set 390# CONFIG_INET_ESP is not set
388# CONFIG_INET_IPCOMP is not set 391# CONFIG_INET_IPCOMP is not set
@@ -618,9 +621,8 @@ CONFIG_SMC91X=y
618# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 621# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
619# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 622# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
620# CONFIG_B44 is not set 623# CONFIG_B44 is not set
621CONFIG_NETDEV_1000=y 624# CONFIG_NETDEV_1000 is not set
622# CONFIG_AX88180 is not set 625# CONFIG_NETDEV_10000 is not set
623CONFIG_NETDEV_10000=y
624 626
625# 627#
626# Wireless LAN 628# Wireless LAN
@@ -674,14 +676,14 @@ CONFIG_CONFIG_INPUT_PCF8574=m
674# Character devices 676# Character devices
675# 677#
676# CONFIG_AD9960 is not set 678# CONFIG_AD9960 is not set
677# CONFIG_SPI_ADC_BF533 is not set 679CONFIG_BFIN_DMA_INTERFACE=m
678# CONFIG_BF5xx_PPIFCD is not set 680# CONFIG_BFIN_PPI is not set
681# CONFIG_BFIN_PPIFCD is not set
679# CONFIG_BFIN_SIMPLE_TIMER is not set 682# CONFIG_BFIN_SIMPLE_TIMER is not set
680CONFIG_BF5xx_PPI=m 683# CONFIG_BFIN_SPI_ADC is not set
681CONFIG_BFIN_SPORT=m 684CONFIG_BFIN_SPORT=m
682# CONFIG_BFIN_TIMER_LATENCY is not set 685# CONFIG_BFIN_TIMER_LATENCY is not set
683# CONFIG_TWI_LCD is not set 686# CONFIG_BFIN_TWI_LCD is not set
684CONFIG_BFIN_DMA_INTERFACE=m
685CONFIG_SIMPLE_GPIO=m 687CONFIG_SIMPLE_GPIO=m
686# CONFIG_VT is not set 688# CONFIG_VT is not set
687# CONFIG_DEVKMEM is not set 689# CONFIG_DEVKMEM is not set
@@ -781,7 +783,30 @@ CONFIG_SPI_BFIN=y
781# CONFIG_SPI_SPIDEV is not set 783# CONFIG_SPI_SPIDEV is not set
782# CONFIG_SPI_TLE62X0 is not set 784# CONFIG_SPI_TLE62X0 is not set
783CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 785CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
784# CONFIG_GPIOLIB is not set 786CONFIG_GPIOLIB=y
787# CONFIG_DEBUG_GPIO is not set
788CONFIG_GPIO_SYSFS=y
789
790#
791# Memory mapped GPIO expanders:
792#
793
794#
795# I2C GPIO expanders:
796#
797# CONFIG_GPIO_MAX732X is not set
798# CONFIG_GPIO_PCA953X is not set
799# CONFIG_GPIO_PCF857X is not set
800
801#
802# PCI GPIO expanders:
803#
804
805#
806# SPI GPIO expanders:
807#
808# CONFIG_GPIO_MAX7301 is not set
809# CONFIG_GPIO_MCP23S08 is not set
785# CONFIG_W1 is not set 810# CONFIG_W1 is not set
786# CONFIG_POWER_SUPPLY is not set 811# CONFIG_POWER_SUPPLY is not set
787# CONFIG_HWMON is not set 812# CONFIG_HWMON is not set
@@ -1068,16 +1093,6 @@ CONFIG_SYSFS=y
1068# CONFIG_BEFS_FS is not set 1093# CONFIG_BEFS_FS is not set
1069# CONFIG_BFS_FS is not set 1094# CONFIG_BFS_FS is not set
1070# CONFIG_EFS_FS is not set 1095# CONFIG_EFS_FS is not set
1071CONFIG_YAFFS_FS=m
1072CONFIG_YAFFS_YAFFS1=y
1073# CONFIG_YAFFS_9BYTE_TAGS is not set
1074# CONFIG_YAFFS_DOES_ECC is not set
1075CONFIG_YAFFS_YAFFS2=y
1076CONFIG_YAFFS_AUTO_YAFFS2=y
1077# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1078# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1079# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1080CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1081CONFIG_JFFS2_FS=m 1096CONFIG_JFFS2_FS=m
1082CONFIG_JFFS2_FS_DEBUG=0 1097CONFIG_JFFS2_FS_DEBUG=0
1083CONFIG_JFFS2_FS_WRITEBUFFER=y 1098CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1089,6 +1104,16 @@ CONFIG_JFFS2_ZLIB=y
1089# CONFIG_JFFS2_LZO is not set 1104# CONFIG_JFFS2_LZO is not set
1090CONFIG_JFFS2_RTIME=y 1105CONFIG_JFFS2_RTIME=y
1091# CONFIG_JFFS2_RUBIN is not set 1106# CONFIG_JFFS2_RUBIN is not set
1107CONFIG_YAFFS_FS=m
1108CONFIG_YAFFS_YAFFS1=y
1109# CONFIG_YAFFS_9BYTE_TAGS is not set
1110# CONFIG_YAFFS_DOES_ECC is not set
1111CONFIG_YAFFS_YAFFS2=y
1112CONFIG_YAFFS_AUTO_YAFFS2=y
1113# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1114# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1115# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1116CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1092# CONFIG_CRAMFS is not set 1117# CONFIG_CRAMFS is not set
1093# CONFIG_VXFS_FS is not set 1118# CONFIG_VXFS_FS is not set
1094# CONFIG_MINIX_FS is not set 1119# CONFIG_MINIX_FS is not set
@@ -1177,7 +1202,7 @@ CONFIG_FRAME_WARN=1024
1177CONFIG_DEBUG_FS=y 1202CONFIG_DEBUG_FS=y
1178# CONFIG_HEADERS_CHECK is not set 1203# CONFIG_HEADERS_CHECK is not set
1179CONFIG_DEBUG_KERNEL=y 1204CONFIG_DEBUG_KERNEL=y
1180# CONFIG_DEBUG_SHIRQ is not set 1205CONFIG_DEBUG_SHIRQ=y
1181CONFIG_DETECT_SOFTLOCKUP=y 1206CONFIG_DETECT_SOFTLOCKUP=y
1182# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1207# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1183CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1208CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1186,8 +1211,6 @@ CONFIG_SCHED_DEBUG=y
1186# CONFIG_TIMER_STATS is not set 1211# CONFIG_TIMER_STATS is not set
1187# CONFIG_DEBUG_OBJECTS is not set 1212# CONFIG_DEBUG_OBJECTS is not set
1188# CONFIG_DEBUG_SLAB is not set 1213# CONFIG_DEBUG_SLAB is not set
1189# CONFIG_DEBUG_RT_MUTEXES is not set
1190# CONFIG_RT_MUTEX_TESTER is not set
1191# CONFIG_DEBUG_SPINLOCK is not set 1214# CONFIG_DEBUG_SPINLOCK is not set
1192# CONFIG_DEBUG_MUTEXES is not set 1215# CONFIG_DEBUG_MUTEXES is not set
1193# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1216# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1207,7 +1230,6 @@ CONFIG_DEBUG_INFO=y
1207# CONFIG_BACKTRACE_SELF_TEST is not set 1230# CONFIG_BACKTRACE_SELF_TEST is not set
1208# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1231# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1209# CONFIG_FAULT_INJECTION is not set 1232# CONFIG_FAULT_INJECTION is not set
1210# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1211 1233
1212# 1234#
1213# Tracers 1235# Tracers
@@ -1223,16 +1245,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1223# CONFIG_DEBUG_STACK_USAGE is not set 1245# CONFIG_DEBUG_STACK_USAGE is not set
1224CONFIG_DEBUG_VERBOSE=y 1246CONFIG_DEBUG_VERBOSE=y
1225CONFIG_DEBUG_MMRS=y 1247CONFIG_DEBUG_MMRS=y
1226# CONFIG_DEBUG_HWERR is not set 1248CONFIG_DEBUG_HWERR=y
1227# CONFIG_DEBUG_DOUBLEFAULT is not set 1249CONFIG_EXACT_HWERR=y
1250CONFIG_DEBUG_DOUBLEFAULT=y
1251CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1252# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1253# CONFIG_DEBUG_ICACHE_CHECK is not set
1228CONFIG_DEBUG_HUNT_FOR_ZERO=y 1254CONFIG_DEBUG_HUNT_FOR_ZERO=y
1229CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1255CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1230CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1256# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1231# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1257CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1232# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1258# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1233CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1259CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1234# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1260# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1235# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1261CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1236CONFIG_EARLY_PRINTK=y 1262CONFIG_EARLY_PRINTK=y
1237CONFIG_CPLB_INFO=y 1263CONFIG_CPLB_INFO=y
1238CONFIG_ACCESS_CHECK=y 1264CONFIG_ACCESS_CHECK=y
@@ -1345,7 +1371,6 @@ CONFIG_CRC32=y
1345# CONFIG_LIBCRC32C is not set 1371# CONFIG_LIBCRC32C is not set
1346CONFIG_ZLIB_INFLATE=y 1372CONFIG_ZLIB_INFLATE=y
1347CONFIG_ZLIB_DEFLATE=m 1373CONFIG_ZLIB_DEFLATE=m
1348CONFIG_PLIST=y
1349CONFIG_HAS_IOMEM=y 1374CONFIG_HAS_IOMEM=y
1350CONFIG_HAS_IOPORT=y 1375CONFIG_HAS_IOPORT=y
1351CONFIG_HAS_DMA=y 1376CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF537-STAMP_defconfig b/arch/blackfin/configs/BF537-STAMP_defconfig
index 591f6edda4f7..f9ac20d55799 100644
--- a/arch/blackfin/configs/BF537-STAMP_defconfig
+++ b/arch/blackfin/configs/BF537-STAMP_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -232,7 +232,10 @@ CONFIG_HZ=250
232CONFIG_SCHED_HRTICK=y 232CONFIG_SCHED_HRTICK=y
233CONFIG_GENERIC_TIME=y 233CONFIG_GENERIC_TIME=y
234CONFIG_GENERIC_CLOCKEVENTS=y 234CONFIG_GENERIC_CLOCKEVENTS=y
235# CONFIG_TICKSOURCE_GPTMR0 is not set
236CONFIG_TICKSOURCE_CORETMR=y
235# CONFIG_CYCLES_CLOCKSOURCE is not set 237# CONFIG_CYCLES_CLOCKSOURCE is not set
238# CONFIG_GPTMR0_CLOCKSOURCE is not set
236CONFIG_TICK_ONESHOT=y 239CONFIG_TICK_ONESHOT=y
237# CONFIG_NO_HZ is not set 240# CONFIG_NO_HZ is not set
238CONFIG_HIGH_RES_TIMERS=y 241CONFIG_HIGH_RES_TIMERS=y
@@ -390,7 +393,7 @@ CONFIG_IP_PNP=y
390# CONFIG_NET_IPIP is not set 393# CONFIG_NET_IPIP is not set
391# CONFIG_NET_IPGRE is not set 394# CONFIG_NET_IPGRE is not set
392# CONFIG_ARPD is not set 395# CONFIG_ARPD is not set
393CONFIG_SYN_COOKIES=y 396# CONFIG_SYN_COOKIES is not set
394# CONFIG_INET_AH is not set 397# CONFIG_INET_AH is not set
395# CONFIG_INET_ESP is not set 398# CONFIG_INET_ESP is not set
396# CONFIG_INET_IPCOMP is not set 399# CONFIG_INET_IPCOMP is not set
@@ -548,9 +551,7 @@ CONFIG_MTD_ROM=m
548# 551#
549# CONFIG_MTD_COMPLEX_MAPPINGS is not set 552# CONFIG_MTD_COMPLEX_MAPPINGS is not set
550CONFIG_MTD_PHYSMAP=m 553CONFIG_MTD_PHYSMAP=m
551CONFIG_MTD_PHYSMAP_START=0x20000000 554# CONFIG_MTD_PHYSMAP_COMPAT is not set
552CONFIG_MTD_PHYSMAP_LEN=0x0
553CONFIG_MTD_PHYSMAP_BANKWIDTH=2
554# CONFIG_MTD_UCLINUX is not set 555# CONFIG_MTD_UCLINUX is not set
555# CONFIG_MTD_PLATRAM is not set 556# CONFIG_MTD_PLATRAM is not set
556 557
@@ -649,9 +650,8 @@ CONFIG_BFIN_RX_DESC_NUM=20
649# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 650# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
650# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 651# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
651# CONFIG_B44 is not set 652# CONFIG_B44 is not set
652CONFIG_NETDEV_1000=y 653# CONFIG_NETDEV_1000 is not set
653# CONFIG_AX88180 is not set 654# CONFIG_NETDEV_10000 is not set
654CONFIG_NETDEV_10000=y
655 655
656# 656#
657# Wireless LAN 657# Wireless LAN
@@ -708,14 +708,14 @@ CONFIG_SERIO_LIBPS2=y
708# Character devices 708# Character devices
709# 709#
710# CONFIG_AD9960 is not set 710# CONFIG_AD9960 is not set
711# CONFIG_SPI_ADC_BF533 is not set 711CONFIG_BFIN_DMA_INTERFACE=m
712# CONFIG_BF5xx_PPIFCD is not set 712# CONFIG_BFIN_PPI is not set
713# CONFIG_BFIN_PPIFCD is not set
713# CONFIG_BFIN_SIMPLE_TIMER is not set 714# CONFIG_BFIN_SIMPLE_TIMER is not set
714CONFIG_BF5xx_PPI=m 715# CONFIG_BFIN_SPI_ADC is not set
715CONFIG_BFIN_SPORT=m 716CONFIG_BFIN_SPORT=m
716# CONFIG_BFIN_TIMER_LATENCY is not set 717# CONFIG_BFIN_TIMER_LATENCY is not set
717# CONFIG_TWI_LCD is not set 718# CONFIG_BFIN_TWI_LCD is not set
718CONFIG_BFIN_DMA_INTERFACE=m
719CONFIG_SIMPLE_GPIO=m 719CONFIG_SIMPLE_GPIO=m
720# CONFIG_VT is not set 720# CONFIG_VT is not set
721# CONFIG_DEVKMEM is not set 721# CONFIG_DEVKMEM is not set
@@ -823,7 +823,30 @@ CONFIG_SPI_BFIN=y
823# CONFIG_SPI_SPIDEV is not set 823# CONFIG_SPI_SPIDEV is not set
824# CONFIG_SPI_TLE62X0 is not set 824# CONFIG_SPI_TLE62X0 is not set
825CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 825CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
826# CONFIG_GPIOLIB is not set 826CONFIG_GPIOLIB=y
827# CONFIG_DEBUG_GPIO is not set
828CONFIG_GPIO_SYSFS=y
829
830#
831# Memory mapped GPIO expanders:
832#
833
834#
835# I2C GPIO expanders:
836#
837# CONFIG_GPIO_MAX732X is not set
838# CONFIG_GPIO_PCA953X is not set
839# CONFIG_GPIO_PCF857X is not set
840
841#
842# PCI GPIO expanders:
843#
844
845#
846# SPI GPIO expanders:
847#
848# CONFIG_GPIO_MAX7301 is not set
849# CONFIG_GPIO_MCP23S08 is not set
827# CONFIG_W1 is not set 850# CONFIG_W1 is not set
828# CONFIG_POWER_SUPPLY is not set 851# CONFIG_POWER_SUPPLY is not set
829# CONFIG_HWMON is not set 852# CONFIG_HWMON is not set
@@ -1123,16 +1146,6 @@ CONFIG_SYSFS=y
1123# CONFIG_BEFS_FS is not set 1146# CONFIG_BEFS_FS is not set
1124# CONFIG_BFS_FS is not set 1147# CONFIG_BFS_FS is not set
1125# CONFIG_EFS_FS is not set 1148# CONFIG_EFS_FS is not set
1126CONFIG_YAFFS_FS=m
1127CONFIG_YAFFS_YAFFS1=y
1128# CONFIG_YAFFS_9BYTE_TAGS is not set
1129# CONFIG_YAFFS_DOES_ECC is not set
1130CONFIG_YAFFS_YAFFS2=y
1131CONFIG_YAFFS_AUTO_YAFFS2=y
1132# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1133# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1134# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1135CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1136CONFIG_JFFS2_FS=m 1149CONFIG_JFFS2_FS=m
1137CONFIG_JFFS2_FS_DEBUG=0 1150CONFIG_JFFS2_FS_DEBUG=0
1138CONFIG_JFFS2_FS_WRITEBUFFER=y 1151CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1144,6 +1157,16 @@ CONFIG_JFFS2_ZLIB=y
1144# CONFIG_JFFS2_LZO is not set 1157# CONFIG_JFFS2_LZO is not set
1145CONFIG_JFFS2_RTIME=y 1158CONFIG_JFFS2_RTIME=y
1146# CONFIG_JFFS2_RUBIN is not set 1159# CONFIG_JFFS2_RUBIN is not set
1160CONFIG_YAFFS_FS=m
1161CONFIG_YAFFS_YAFFS1=y
1162# CONFIG_YAFFS_9BYTE_TAGS is not set
1163# CONFIG_YAFFS_DOES_ECC is not set
1164CONFIG_YAFFS_YAFFS2=y
1165CONFIG_YAFFS_AUTO_YAFFS2=y
1166# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1167# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1168# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1169CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1147# CONFIG_CRAMFS is not set 1170# CONFIG_CRAMFS is not set
1148# CONFIG_VXFS_FS is not set 1171# CONFIG_VXFS_FS is not set
1149# CONFIG_MINIX_FS is not set 1172# CONFIG_MINIX_FS is not set
@@ -1232,7 +1255,7 @@ CONFIG_FRAME_WARN=1024
1232CONFIG_DEBUG_FS=y 1255CONFIG_DEBUG_FS=y
1233# CONFIG_HEADERS_CHECK is not set 1256# CONFIG_HEADERS_CHECK is not set
1234CONFIG_DEBUG_KERNEL=y 1257CONFIG_DEBUG_KERNEL=y
1235# CONFIG_DEBUG_SHIRQ is not set 1258CONFIG_DEBUG_SHIRQ=y
1236CONFIG_DETECT_SOFTLOCKUP=y 1259CONFIG_DETECT_SOFTLOCKUP=y
1237# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1260# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1238CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1261CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1241,8 +1264,6 @@ CONFIG_SCHED_DEBUG=y
1241# CONFIG_TIMER_STATS is not set 1264# CONFIG_TIMER_STATS is not set
1242# CONFIG_DEBUG_OBJECTS is not set 1265# CONFIG_DEBUG_OBJECTS is not set
1243# CONFIG_DEBUG_SLAB is not set 1266# CONFIG_DEBUG_SLAB is not set
1244# CONFIG_DEBUG_RT_MUTEXES is not set
1245# CONFIG_RT_MUTEX_TESTER is not set
1246# CONFIG_DEBUG_SPINLOCK is not set 1267# CONFIG_DEBUG_SPINLOCK is not set
1247# CONFIG_DEBUG_MUTEXES is not set 1268# CONFIG_DEBUG_MUTEXES is not set
1248# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1269# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1262,7 +1283,6 @@ CONFIG_DEBUG_INFO=y
1262# CONFIG_BACKTRACE_SELF_TEST is not set 1283# CONFIG_BACKTRACE_SELF_TEST is not set
1263# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1284# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1264# CONFIG_FAULT_INJECTION is not set 1285# CONFIG_FAULT_INJECTION is not set
1265# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1266 1286
1267# 1287#
1268# Tracers 1288# Tracers
@@ -1278,16 +1298,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1278# CONFIG_DEBUG_STACK_USAGE is not set 1298# CONFIG_DEBUG_STACK_USAGE is not set
1279CONFIG_DEBUG_VERBOSE=y 1299CONFIG_DEBUG_VERBOSE=y
1280CONFIG_DEBUG_MMRS=y 1300CONFIG_DEBUG_MMRS=y
1281# CONFIG_DEBUG_HWERR is not set 1301CONFIG_DEBUG_HWERR=y
1282# CONFIG_DEBUG_DOUBLEFAULT is not set 1302CONFIG_EXACT_HWERR=y
1303CONFIG_DEBUG_DOUBLEFAULT=y
1304CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1305# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1306# CONFIG_DEBUG_ICACHE_CHECK is not set
1283CONFIG_DEBUG_HUNT_FOR_ZERO=y 1307CONFIG_DEBUG_HUNT_FOR_ZERO=y
1284CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1308CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1285CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1309# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1286# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1310CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1287# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1311# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1288CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1312CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1289# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1313# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1290# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1314CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1291CONFIG_EARLY_PRINTK=y 1315CONFIG_EARLY_PRINTK=y
1292CONFIG_CPLB_INFO=y 1316CONFIG_CPLB_INFO=y
1293CONFIG_ACCESS_CHECK=y 1317CONFIG_ACCESS_CHECK=y
@@ -1400,7 +1424,6 @@ CONFIG_CRC32=y
1400# CONFIG_LIBCRC32C is not set 1424# CONFIG_LIBCRC32C is not set
1401CONFIG_ZLIB_INFLATE=y 1425CONFIG_ZLIB_INFLATE=y
1402CONFIG_ZLIB_DEFLATE=m 1426CONFIG_ZLIB_DEFLATE=m
1403CONFIG_PLIST=y
1404CONFIG_HAS_IOMEM=y 1427CONFIG_HAS_IOMEM=y
1405CONFIG_HAS_IOPORT=y 1428CONFIG_HAS_IOPORT=y
1406CONFIG_HAS_DMA=y 1429CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF538-EZKIT_defconfig b/arch/blackfin/configs/BF538-EZKIT_defconfig
index 1a8e8c3adf98..ee98e227b887 100644
--- a/arch/blackfin/configs/BF538-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF538-EZKIT_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -243,7 +243,10 @@ CONFIG_HZ=250
243CONFIG_SCHED_HRTICK=y 243CONFIG_SCHED_HRTICK=y
244CONFIG_GENERIC_TIME=y 244CONFIG_GENERIC_TIME=y
245CONFIG_GENERIC_CLOCKEVENTS=y 245CONFIG_GENERIC_CLOCKEVENTS=y
246# CONFIG_TICKSOURCE_GPTMR0 is not set
247CONFIG_TICKSOURCE_CORETMR=y
246# CONFIG_CYCLES_CLOCKSOURCE is not set 248# CONFIG_CYCLES_CLOCKSOURCE is not set
249# CONFIG_GPTMR0_CLOCKSOURCE is not set
247CONFIG_TICK_ONESHOT=y 250CONFIG_TICK_ONESHOT=y
248# CONFIG_NO_HZ is not set 251# CONFIG_NO_HZ is not set
249CONFIG_HIGH_RES_TIMERS=y 252CONFIG_HIGH_RES_TIMERS=y
@@ -389,7 +392,7 @@ CONFIG_IP_PNP=y
389# CONFIG_NET_IPIP is not set 392# CONFIG_NET_IPIP is not set
390# CONFIG_NET_IPGRE is not set 393# CONFIG_NET_IPGRE is not set
391# CONFIG_ARPD is not set 394# CONFIG_ARPD is not set
392CONFIG_SYN_COOKIES=y 395# CONFIG_SYN_COOKIES is not set
393# CONFIG_INET_AH is not set 396# CONFIG_INET_AH is not set
394# CONFIG_INET_ESP is not set 397# CONFIG_INET_ESP is not set
395# CONFIG_INET_IPCOMP is not set 398# CONFIG_INET_IPCOMP is not set
@@ -546,9 +549,7 @@ CONFIG_MTD_ROM=m
546# 549#
547# CONFIG_MTD_COMPLEX_MAPPINGS is not set 550# CONFIG_MTD_COMPLEX_MAPPINGS is not set
548CONFIG_MTD_PHYSMAP=m 551CONFIG_MTD_PHYSMAP=m
549CONFIG_MTD_PHYSMAP_START=0x20000000 552# CONFIG_MTD_PHYSMAP_COMPAT is not set
550CONFIG_MTD_PHYSMAP_LEN=0x0
551CONFIG_MTD_PHYSMAP_BANKWIDTH=2
552# CONFIG_MTD_UCLINUX is not set 553# CONFIG_MTD_UCLINUX is not set
553# CONFIG_MTD_PLATRAM is not set 554# CONFIG_MTD_PLATRAM is not set
554 555
@@ -691,11 +692,11 @@ CONFIG_INPUT_EVDEV=m
691# CONFIG_INPUT_JOYSTICK is not set 692# CONFIG_INPUT_JOYSTICK is not set
692# CONFIG_INPUT_TABLET is not set 693# CONFIG_INPUT_TABLET is not set
693CONFIG_INPUT_TOUCHSCREEN=y 694CONFIG_INPUT_TOUCHSCREEN=y
694# CONFIG_TOUCHSCREEN_ADS7846 is not set
695# CONFIG_TOUCHSCREEN_AD7877 is not set 695# CONFIG_TOUCHSCREEN_AD7877 is not set
696# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 696# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
697CONFIG_TOUCHSCREEN_AD7879_SPI=y 697CONFIG_TOUCHSCREEN_AD7879_SPI=y
698CONFIG_TOUCHSCREEN_AD7879=y 698CONFIG_TOUCHSCREEN_AD7879=y
699# CONFIG_TOUCHSCREEN_ADS7846 is not set
699# CONFIG_TOUCHSCREEN_FUJITSU is not set 700# CONFIG_TOUCHSCREEN_FUJITSU is not set
700# CONFIG_TOUCHSCREEN_GUNZE is not set 701# CONFIG_TOUCHSCREEN_GUNZE is not set
701# CONFIG_TOUCHSCREEN_ELO is not set 702# CONFIG_TOUCHSCREEN_ELO is not set
@@ -720,14 +721,14 @@ CONFIG_INPUT_MISC=y
720# Character devices 721# Character devices
721# 722#
722# CONFIG_AD9960 is not set 723# CONFIG_AD9960 is not set
723# CONFIG_SPI_ADC_BF533 is not set 724CONFIG_BFIN_DMA_INTERFACE=m
724# CONFIG_BF5xx_PPIFCD is not set 725# CONFIG_BFIN_PPI is not set
726# CONFIG_BFIN_PPIFCD is not set
725# CONFIG_BFIN_SIMPLE_TIMER is not set 727# CONFIG_BFIN_SIMPLE_TIMER is not set
726CONFIG_BF5xx_PPI=m 728# CONFIG_BFIN_SPI_ADC is not set
727CONFIG_BFIN_SPORT=m 729CONFIG_BFIN_SPORT=m
728# CONFIG_BFIN_TIMER_LATENCY is not set 730# CONFIG_BFIN_TIMER_LATENCY is not set
729# CONFIG_TWI_LCD is not set 731# CONFIG_BFIN_TWI_LCD is not set
730CONFIG_BFIN_DMA_INTERFACE=m
731CONFIG_SIMPLE_GPIO=m 732CONFIG_SIMPLE_GPIO=m
732# CONFIG_VT is not set 733# CONFIG_VT is not set
733# CONFIG_DEVKMEM is not set 734# CONFIG_DEVKMEM is not set
@@ -833,7 +834,30 @@ CONFIG_SPI_BFIN=y
833# CONFIG_SPI_SPIDEV is not set 834# CONFIG_SPI_SPIDEV is not set
834# CONFIG_SPI_TLE62X0 is not set 835# CONFIG_SPI_TLE62X0 is not set
835CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 836CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
836# CONFIG_GPIOLIB is not set 837CONFIG_GPIOLIB=y
838# CONFIG_DEBUG_GPIO is not set
839CONFIG_GPIO_SYSFS=y
840
841#
842# Memory mapped GPIO expanders:
843#
844
845#
846# I2C GPIO expanders:
847#
848# CONFIG_GPIO_MAX732X is not set
849# CONFIG_GPIO_PCA953X is not set
850# CONFIG_GPIO_PCF857X is not set
851
852#
853# PCI GPIO expanders:
854#
855
856#
857# SPI GPIO expanders:
858#
859# CONFIG_GPIO_MAX7301 is not set
860# CONFIG_GPIO_MCP23S08 is not set
837# CONFIG_W1 is not set 861# CONFIG_W1 is not set
838# CONFIG_POWER_SUPPLY is not set 862# CONFIG_POWER_SUPPLY is not set
839# CONFIG_HWMON is not set 863# CONFIG_HWMON is not set
@@ -1056,16 +1080,6 @@ CONFIG_SYSFS=y
1056# CONFIG_BEFS_FS is not set 1080# CONFIG_BEFS_FS is not set
1057# CONFIG_BFS_FS is not set 1081# CONFIG_BFS_FS is not set
1058# CONFIG_EFS_FS is not set 1082# CONFIG_EFS_FS is not set
1059CONFIG_YAFFS_FS=m
1060CONFIG_YAFFS_YAFFS1=y
1061# CONFIG_YAFFS_9BYTE_TAGS is not set
1062# CONFIG_YAFFS_DOES_ECC is not set
1063CONFIG_YAFFS_YAFFS2=y
1064CONFIG_YAFFS_AUTO_YAFFS2=y
1065# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1066# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1067# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1068CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1069CONFIG_JFFS2_FS=m 1083CONFIG_JFFS2_FS=m
1070CONFIG_JFFS2_FS_DEBUG=0 1084CONFIG_JFFS2_FS_DEBUG=0
1071CONFIG_JFFS2_FS_WRITEBUFFER=y 1085CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1077,6 +1091,16 @@ CONFIG_JFFS2_ZLIB=y
1077# CONFIG_JFFS2_LZO is not set 1091# CONFIG_JFFS2_LZO is not set
1078CONFIG_JFFS2_RTIME=y 1092CONFIG_JFFS2_RTIME=y
1079# CONFIG_JFFS2_RUBIN is not set 1093# CONFIG_JFFS2_RUBIN is not set
1094CONFIG_YAFFS_FS=m
1095CONFIG_YAFFS_YAFFS1=y
1096# CONFIG_YAFFS_9BYTE_TAGS is not set
1097# CONFIG_YAFFS_DOES_ECC is not set
1098CONFIG_YAFFS_YAFFS2=y
1099CONFIG_YAFFS_AUTO_YAFFS2=y
1100# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1101# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1102# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1103CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1080# CONFIG_CRAMFS is not set 1104# CONFIG_CRAMFS is not set
1081# CONFIG_VXFS_FS is not set 1105# CONFIG_VXFS_FS is not set
1082# CONFIG_MINIX_FS is not set 1106# CONFIG_MINIX_FS is not set
@@ -1165,7 +1189,7 @@ CONFIG_FRAME_WARN=1024
1165CONFIG_DEBUG_FS=y 1189CONFIG_DEBUG_FS=y
1166# CONFIG_HEADERS_CHECK is not set 1190# CONFIG_HEADERS_CHECK is not set
1167CONFIG_DEBUG_KERNEL=y 1191CONFIG_DEBUG_KERNEL=y
1168# CONFIG_DEBUG_SHIRQ is not set 1192CONFIG_DEBUG_SHIRQ=y
1169CONFIG_DETECT_SOFTLOCKUP=y 1193CONFIG_DETECT_SOFTLOCKUP=y
1170# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1194# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1171CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1195CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1174,8 +1198,6 @@ CONFIG_SCHED_DEBUG=y
1174# CONFIG_TIMER_STATS is not set 1198# CONFIG_TIMER_STATS is not set
1175# CONFIG_DEBUG_OBJECTS is not set 1199# CONFIG_DEBUG_OBJECTS is not set
1176# CONFIG_DEBUG_SLAB is not set 1200# CONFIG_DEBUG_SLAB is not set
1177# CONFIG_DEBUG_RT_MUTEXES is not set
1178# CONFIG_RT_MUTEX_TESTER is not set
1179# CONFIG_DEBUG_SPINLOCK is not set 1201# CONFIG_DEBUG_SPINLOCK is not set
1180# CONFIG_DEBUG_MUTEXES is not set 1202# CONFIG_DEBUG_MUTEXES is not set
1181# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1203# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1195,7 +1217,6 @@ CONFIG_DEBUG_INFO=y
1195# CONFIG_BACKTRACE_SELF_TEST is not set 1217# CONFIG_BACKTRACE_SELF_TEST is not set
1196# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1218# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1197# CONFIG_FAULT_INJECTION is not set 1219# CONFIG_FAULT_INJECTION is not set
1198CONFIG_SYSCTL_SYSCALL_CHECK=y
1199 1220
1200# 1221#
1201# Tracers 1222# Tracers
@@ -1211,16 +1232,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1211# CONFIG_DEBUG_STACK_USAGE is not set 1232# CONFIG_DEBUG_STACK_USAGE is not set
1212CONFIG_DEBUG_VERBOSE=y 1233CONFIG_DEBUG_VERBOSE=y
1213CONFIG_DEBUG_MMRS=y 1234CONFIG_DEBUG_MMRS=y
1214# CONFIG_DEBUG_HWERR is not set 1235CONFIG_DEBUG_HWERR=y
1215# CONFIG_DEBUG_DOUBLEFAULT is not set 1236CONFIG_EXACT_HWERR=y
1237CONFIG_DEBUG_DOUBLEFAULT=y
1238CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1239# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1240# CONFIG_DEBUG_ICACHE_CHECK is not set
1216CONFIG_DEBUG_HUNT_FOR_ZERO=y 1241CONFIG_DEBUG_HUNT_FOR_ZERO=y
1217CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1242CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1218CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1243# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1219# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1244CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1220# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1245# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1221CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1246CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1222# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1247# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1223# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1248CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1224CONFIG_EARLY_PRINTK=y 1249CONFIG_EARLY_PRINTK=y
1225CONFIG_CPLB_INFO=y 1250CONFIG_CPLB_INFO=y
1226CONFIG_ACCESS_CHECK=y 1251CONFIG_ACCESS_CHECK=y
@@ -1333,7 +1358,6 @@ CONFIG_CRC32=y
1333# CONFIG_LIBCRC32C is not set 1358# CONFIG_LIBCRC32C is not set
1334CONFIG_ZLIB_INFLATE=y 1359CONFIG_ZLIB_INFLATE=y
1335CONFIG_ZLIB_DEFLATE=m 1360CONFIG_ZLIB_DEFLATE=m
1336CONFIG_PLIST=y
1337CONFIG_HAS_IOMEM=y 1361CONFIG_HAS_IOMEM=y
1338CONFIG_HAS_IOPORT=y 1362CONFIG_HAS_IOPORT=y
1339CONFIG_HAS_DMA=y 1363CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig
index 2cd1c2b218d7..deeabef8ab80 100644
--- a/arch/blackfin/configs/BF548-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -196,6 +196,7 @@ CONFIG_BFIN548_EZKIT=y
196# BF548 Specific Configuration 196# BF548 Specific Configuration
197# 197#
198# CONFIG_DEB_DMA_URGENT is not set 198# CONFIG_DEB_DMA_URGENT is not set
199# CONFIG_BF548_ATAPI_ALTERNATIVE_PORT is not set
199 200
200# 201#
201# Interrupt Priority Assignment 202# Interrupt Priority Assignment
@@ -298,7 +299,10 @@ CONFIG_HZ=250
298# CONFIG_SCHED_HRTICK is not set 299# CONFIG_SCHED_HRTICK is not set
299CONFIG_GENERIC_TIME=y 300CONFIG_GENERIC_TIME=y
300CONFIG_GENERIC_CLOCKEVENTS=y 301CONFIG_GENERIC_CLOCKEVENTS=y
302# CONFIG_TICKSOURCE_GPTMR0 is not set
303CONFIG_TICKSOURCE_CORETMR=y
301# CONFIG_CYCLES_CLOCKSOURCE is not set 304# CONFIG_CYCLES_CLOCKSOURCE is not set
305# CONFIG_GPTMR0_CLOCKSOURCE is not set
302# CONFIG_NO_HZ is not set 306# CONFIG_NO_HZ is not set
303# CONFIG_HIGH_RES_TIMERS is not set 307# CONFIG_HIGH_RES_TIMERS is not set
304CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 308CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -367,7 +371,9 @@ CONFIG_BFIN_DCACHE=y
367# CONFIG_BFIN_ICACHE_LOCK is not set 371# CONFIG_BFIN_ICACHE_LOCK is not set
368CONFIG_BFIN_WB=y 372CONFIG_BFIN_WB=y
369# CONFIG_BFIN_WT is not set 373# CONFIG_BFIN_WT is not set
370# CONFIG_BFIN_L2_CACHEABLE is not set 374# CONFIG_BFIN_L2_WB is not set
375CONFIG_BFIN_L2_WT=y
376# CONFIG_BFIN_L2_NOT_CACHED is not set
371# CONFIG_MPU is not set 377# CONFIG_MPU is not set
372 378
373# 379#
@@ -447,7 +453,7 @@ CONFIG_IP_PNP=y
447# CONFIG_NET_IPIP is not set 453# CONFIG_NET_IPIP is not set
448# CONFIG_NET_IPGRE is not set 454# CONFIG_NET_IPGRE is not set
449# CONFIG_ARPD is not set 455# CONFIG_ARPD is not set
450CONFIG_SYN_COOKIES=y 456# CONFIG_SYN_COOKIES is not set
451# CONFIG_INET_AH is not set 457# CONFIG_INET_AH is not set
452# CONFIG_INET_ESP is not set 458# CONFIG_INET_ESP is not set
453# CONFIG_INET_IPCOMP is not set 459# CONFIG_INET_IPCOMP is not set
@@ -616,9 +622,7 @@ CONFIG_MTD_RAM=y
616# 622#
617CONFIG_MTD_COMPLEX_MAPPINGS=y 623CONFIG_MTD_COMPLEX_MAPPINGS=y
618CONFIG_MTD_PHYSMAP=y 624CONFIG_MTD_PHYSMAP=y
619CONFIG_MTD_PHYSMAP_START=0x20000000 625# CONFIG_MTD_PHYSMAP_COMPAT is not set
620CONFIG_MTD_PHYSMAP_LEN=0
621CONFIG_MTD_PHYSMAP_BANKWIDTH=2
622# CONFIG_MTD_GPIO_ADDR is not set 626# CONFIG_MTD_GPIO_ADDR is not set
623# CONFIG_MTD_UCLINUX is not set 627# CONFIG_MTD_UCLINUX is not set
624# CONFIG_MTD_PLATRAM is not set 628# CONFIG_MTD_PLATRAM is not set
@@ -696,7 +700,7 @@ CONFIG_SCSI_DMA=y
696CONFIG_BLK_DEV_SD=y 700CONFIG_BLK_DEV_SD=y
697# CONFIG_CHR_DEV_ST is not set 701# CONFIG_CHR_DEV_ST is not set
698# CONFIG_CHR_DEV_OSST is not set 702# CONFIG_CHR_DEV_OSST is not set
699CONFIG_BLK_DEV_SR=y 703CONFIG_BLK_DEV_SR=m
700# CONFIG_BLK_DEV_SR_VENDOR is not set 704# CONFIG_BLK_DEV_SR_VENDOR is not set
701# CONFIG_CHR_DEV_SG is not set 705# CONFIG_CHR_DEV_SG is not set
702# CONFIG_CHR_DEV_SCH is not set 706# CONFIG_CHR_DEV_SCH is not set
@@ -718,9 +722,7 @@ CONFIG_SCSI_WAIT_SCAN=m
718# CONFIG_SCSI_ISCSI_ATTRS is not set 722# CONFIG_SCSI_ISCSI_ATTRS is not set
719# CONFIG_SCSI_SAS_LIBSAS is not set 723# CONFIG_SCSI_SAS_LIBSAS is not set
720# CONFIG_SCSI_SRP_ATTRS is not set 724# CONFIG_SCSI_SRP_ATTRS is not set
721CONFIG_SCSI_LOWLEVEL=y 725# CONFIG_SCSI_LOWLEVEL is not set
722# CONFIG_ISCSI_TCP is not set
723# CONFIG_SCSI_DEBUG is not set
724# CONFIG_SCSI_DH is not set 726# CONFIG_SCSI_DH is not set
725CONFIG_ATA=y 727CONFIG_ATA=y
726# CONFIG_ATA_NONSTANDARD is not set 728# CONFIG_ATA_NONSTANDARD is not set
@@ -752,9 +754,8 @@ CONFIG_SMSC911X=y
752# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 754# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
753# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 755# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
754# CONFIG_B44 is not set 756# CONFIG_B44 is not set
755CONFIG_NETDEV_1000=y 757# CONFIG_NETDEV_1000 is not set
756# CONFIG_AX88180 is not set 758# CONFIG_NETDEV_10000 is not set
757CONFIG_NETDEV_10000=y
758 759
759# 760#
760# Wireless LAN 761# Wireless LAN
@@ -821,11 +822,11 @@ CONFIG_KEYBOARD_BFIN=y
821# CONFIG_INPUT_JOYSTICK is not set 822# CONFIG_INPUT_JOYSTICK is not set
822# CONFIG_INPUT_TABLET is not set 823# CONFIG_INPUT_TABLET is not set
823CONFIG_INPUT_TOUCHSCREEN=y 824CONFIG_INPUT_TOUCHSCREEN=y
824# CONFIG_TOUCHSCREEN_ADS7846 is not set
825CONFIG_TOUCHSCREEN_AD7877=m 825CONFIG_TOUCHSCREEN_AD7877=m
826# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 826# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
827# CONFIG_TOUCHSCREEN_AD7879_SPI is not set 827# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
828# CONFIG_TOUCHSCREEN_AD7879 is not set 828# CONFIG_TOUCHSCREEN_AD7879 is not set
829# CONFIG_TOUCHSCREEN_ADS7846 is not set
829# CONFIG_TOUCHSCREEN_FUJITSU is not set 830# CONFIG_TOUCHSCREEN_FUJITSU is not set
830# CONFIG_TOUCHSCREEN_GUNZE is not set 831# CONFIG_TOUCHSCREEN_GUNZE is not set
831# CONFIG_TOUCHSCREEN_ELO is not set 832# CONFIG_TOUCHSCREEN_ELO is not set
@@ -858,14 +859,14 @@ CONFIG_INPUT_MISC=y
858# Character devices 859# Character devices
859# 860#
860# CONFIG_AD9960 is not set 861# CONFIG_AD9960 is not set
861# CONFIG_SPI_ADC_BF533 is not set 862CONFIG_BFIN_DMA_INTERFACE=m
862# CONFIG_BF5xx_PPIFCD is not set 863# CONFIG_BFIN_PPI is not set
864# CONFIG_BFIN_PPIFCD is not set
863# CONFIG_BFIN_SIMPLE_TIMER is not set 865# CONFIG_BFIN_SIMPLE_TIMER is not set
864CONFIG_BF5xx_PPI=m 866# CONFIG_BFIN_SPI_ADC is not set
865CONFIG_BFIN_SPORT=m 867CONFIG_BFIN_SPORT=m
866# CONFIG_BFIN_TIMER_LATENCY is not set 868# CONFIG_BFIN_TIMER_LATENCY is not set
867# CONFIG_TWI_LCD is not set 869# CONFIG_BFIN_TWI_LCD is not set
868CONFIG_BFIN_DMA_INTERFACE=m
869CONFIG_SIMPLE_GPIO=m 870CONFIG_SIMPLE_GPIO=m
870CONFIG_VT=y 871CONFIG_VT=y
871CONFIG_CONSOLE_TRANSLATIONS=y 872CONFIG_CONSOLE_TRANSLATIONS=y
@@ -977,7 +978,30 @@ CONFIG_SPI_BFIN=y
977# CONFIG_SPI_SPIDEV is not set 978# CONFIG_SPI_SPIDEV is not set
978# CONFIG_SPI_TLE62X0 is not set 979# CONFIG_SPI_TLE62X0 is not set
979CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 980CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
980# CONFIG_GPIOLIB is not set 981CONFIG_GPIOLIB=y
982# CONFIG_DEBUG_GPIO is not set
983CONFIG_GPIO_SYSFS=y
984
985#
986# Memory mapped GPIO expanders:
987#
988
989#
990# I2C GPIO expanders:
991#
992# CONFIG_GPIO_MAX732X is not set
993# CONFIG_GPIO_PCA953X is not set
994# CONFIG_GPIO_PCF857X is not set
995
996#
997# PCI GPIO expanders:
998#
999
1000#
1001# SPI GPIO expanders:
1002#
1003# CONFIG_GPIO_MAX7301 is not set
1004# CONFIG_GPIO_MCP23S08 is not set
981# CONFIG_W1 is not set 1005# CONFIG_W1 is not set
982# CONFIG_POWER_SUPPLY is not set 1006# CONFIG_POWER_SUPPLY is not set
983# CONFIG_HWMON is not set 1007# CONFIG_HWMON is not set
@@ -1011,6 +1035,7 @@ CONFIG_SSB_POSSIBLE=y
1011# CONFIG_HTC_PASIC3 is not set 1035# CONFIG_HTC_PASIC3 is not set
1012# CONFIG_MFD_TMIO is not set 1036# CONFIG_MFD_TMIO is not set
1013# CONFIG_PMIC_DA903X is not set 1037# CONFIG_PMIC_DA903X is not set
1038# CONFIG_PMIC_ADP5520 is not set
1014# CONFIG_MFD_WM8400 is not set 1039# CONFIG_MFD_WM8400 is not set
1015# CONFIG_MFD_WM8350_I2C is not set 1040# CONFIG_MFD_WM8350_I2C is not set
1016# CONFIG_REGULATOR is not set 1041# CONFIG_REGULATOR is not set
@@ -1193,8 +1218,8 @@ CONFIG_USB=y
1193# 1218#
1194# Miscellaneous USB options 1219# Miscellaneous USB options
1195# 1220#
1196# CONFIG_USB_DEVICEFS is not set 1221CONFIG_USB_DEVICEFS=y
1197CONFIG_USB_DEVICE_CLASS=y 1222# CONFIG_USB_DEVICE_CLASS is not set
1198# CONFIG_USB_DYNAMIC_MINORS is not set 1223# CONFIG_USB_DYNAMIC_MINORS is not set
1199# CONFIG_USB_OTG is not set 1224# CONFIG_USB_OTG is not set
1200# CONFIG_USB_OTG_WHITELIST is not set 1225# CONFIG_USB_OTG_WHITELIST is not set
@@ -1222,10 +1247,10 @@ CONFIG_USB_MUSB_SOC=y
1222CONFIG_USB_MUSB_HOST=y 1247CONFIG_USB_MUSB_HOST=y
1223# CONFIG_USB_MUSB_PERIPHERAL is not set 1248# CONFIG_USB_MUSB_PERIPHERAL is not set
1224# CONFIG_USB_MUSB_OTG is not set 1249# CONFIG_USB_MUSB_OTG is not set
1225# CONFIG_USB_GADGET_MUSB_HDRC is not set
1226CONFIG_USB_MUSB_HDRC_HCD=y 1250CONFIG_USB_MUSB_HDRC_HCD=y
1227CONFIG_MUSB_PIO_ONLY=y 1251# CONFIG_MUSB_PIO_ONLY is not set
1228CONFIG_MUSB_DMA_POLL=y 1252CONFIG_USB_INVENTRA_DMA=y
1253# CONFIG_USB_TI_CPPI_DMA is not set
1229# CONFIG_USB_MUSB_DEBUG is not set 1254# CONFIG_USB_MUSB_DEBUG is not set
1230 1255
1231# 1256#
@@ -1243,7 +1268,7 @@ CONFIG_MUSB_DMA_POLL=y
1243# 1268#
1244# see USB_STORAGE Help for more information 1269# see USB_STORAGE Help for more information
1245# 1270#
1246CONFIG_USB_STORAGE=m 1271CONFIG_USB_STORAGE=y
1247# CONFIG_USB_STORAGE_DEBUG is not set 1272# CONFIG_USB_STORAGE_DEBUG is not set
1248# CONFIG_USB_STORAGE_DATAFAB is not set 1273# CONFIG_USB_STORAGE_DATAFAB is not set
1249# CONFIG_USB_STORAGE_FREECOM is not set 1274# CONFIG_USB_STORAGE_FREECOM is not set
@@ -1292,33 +1317,10 @@ CONFIG_USB_STORAGE=m
1292# CONFIG_USB_LD is not set 1317# CONFIG_USB_LD is not set
1293# CONFIG_USB_TRANCEVIBRATOR is not set 1318# CONFIG_USB_TRANCEVIBRATOR is not set
1294# CONFIG_USB_IOWARRIOR is not set 1319# CONFIG_USB_IOWARRIOR is not set
1320# CONFIG_USB_TEST is not set
1295# CONFIG_USB_ISIGHTFW is not set 1321# CONFIG_USB_ISIGHTFW is not set
1296# CONFIG_USB_VST is not set 1322# CONFIG_USB_VST is not set
1297# CONFIG_USB_GADGET is not set 1323# CONFIG_USB_GADGET is not set
1298# CONFIG_USB_GADGET_AT91 is not set
1299# CONFIG_USB_GADGET_ATMEL_USBA is not set
1300# CONFIG_USB_GADGET_FSL_USB2 is not set
1301# CONFIG_USB_GADGET_LH7A40X is not set
1302# CONFIG_USB_GADGET_OMAP is not set
1303# CONFIG_USB_GADGET_PXA25X is not set
1304# CONFIG_USB_GADGET_PXA27X is not set
1305# CONFIG_USB_GADGET_S3C2410 is not set
1306# CONFIG_USB_GADGET_M66592 is not set
1307# CONFIG_USB_GADGET_AMD5536UDC is not set
1308# CONFIG_USB_GADGET_FSL_QE is not set
1309# CONFIG_USB_GADGET_NET2272 is not set
1310# CONFIG_USB_GADGET_NET2280 is not set
1311# CONFIG_USB_GADGET_GOKU is not set
1312# CONFIG_USB_GADGET_DUMMY_HCD is not set
1313# CONFIG_USB_ZERO is not set
1314# CONFIG_USB_AUDIO is not set
1315# CONFIG_USB_ETH is not set
1316# CONFIG_USB_GADGETFS is not set
1317# CONFIG_USB_FILE_STORAGE is not set
1318# CONFIG_USB_G_SERIAL is not set
1319# CONFIG_USB_MIDI_GADGET is not set
1320# CONFIG_USB_G_PRINTER is not set
1321# CONFIG_USB_CDC_COMPOSITE is not set
1322CONFIG_MMC=y 1324CONFIG_MMC=y
1323# CONFIG_MMC_DEBUG is not set 1325# CONFIG_MMC_DEBUG is not set
1324# CONFIG_MMC_UNSAFE_RESUME is not set 1326# CONFIG_MMC_UNSAFE_RESUME is not set
@@ -1414,13 +1416,8 @@ CONFIG_EXT2_FS=y
1414CONFIG_EXT2_FS_XATTR=y 1416CONFIG_EXT2_FS_XATTR=y
1415# CONFIG_EXT2_FS_POSIX_ACL is not set 1417# CONFIG_EXT2_FS_POSIX_ACL is not set
1416# CONFIG_EXT2_FS_SECURITY is not set 1418# CONFIG_EXT2_FS_SECURITY is not set
1417CONFIG_EXT3_FS=y 1419# CONFIG_EXT3_FS is not set
1418CONFIG_EXT3_FS_XATTR=y
1419# CONFIG_EXT3_FS_POSIX_ACL is not set
1420# CONFIG_EXT3_FS_SECURITY is not set
1421# CONFIG_EXT4_FS is not set 1420# CONFIG_EXT4_FS is not set
1422CONFIG_JBD=y
1423# CONFIG_JBD_DEBUG is not set
1424CONFIG_FS_MBCACHE=y 1421CONFIG_FS_MBCACHE=y
1425# CONFIG_REISERFS_FS is not set 1422# CONFIG_REISERFS_FS is not set
1426# CONFIG_JFS_FS is not set 1423# CONFIG_JFS_FS is not set
@@ -1476,16 +1473,6 @@ CONFIG_SYSFS=y
1476# CONFIG_BEFS_FS is not set 1473# CONFIG_BEFS_FS is not set
1477# CONFIG_BFS_FS is not set 1474# CONFIG_BFS_FS is not set
1478# CONFIG_EFS_FS is not set 1475# CONFIG_EFS_FS is not set
1479CONFIG_YAFFS_FS=m
1480CONFIG_YAFFS_YAFFS1=y
1481# CONFIG_YAFFS_9BYTE_TAGS is not set
1482# CONFIG_YAFFS_DOES_ECC is not set
1483CONFIG_YAFFS_YAFFS2=y
1484CONFIG_YAFFS_AUTO_YAFFS2=y
1485# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1486# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1487# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1488CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1489CONFIG_JFFS2_FS=m 1476CONFIG_JFFS2_FS=m
1490CONFIG_JFFS2_FS_DEBUG=0 1477CONFIG_JFFS2_FS_DEBUG=0
1491CONFIG_JFFS2_FS_WRITEBUFFER=y 1478CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1497,6 +1484,16 @@ CONFIG_JFFS2_ZLIB=y
1497# CONFIG_JFFS2_LZO is not set 1484# CONFIG_JFFS2_LZO is not set
1498CONFIG_JFFS2_RTIME=y 1485CONFIG_JFFS2_RTIME=y
1499# CONFIG_JFFS2_RUBIN is not set 1486# CONFIG_JFFS2_RUBIN is not set
1487CONFIG_YAFFS_FS=m
1488CONFIG_YAFFS_YAFFS1=y
1489# CONFIG_YAFFS_9BYTE_TAGS is not set
1490# CONFIG_YAFFS_DOES_ECC is not set
1491CONFIG_YAFFS_YAFFS2=y
1492CONFIG_YAFFS_AUTO_YAFFS2=y
1493# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1494# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1495# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1496CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1500# CONFIG_CRAMFS is not set 1497# CONFIG_CRAMFS is not set
1501# CONFIG_VXFS_FS is not set 1498# CONFIG_VXFS_FS is not set
1502# CONFIG_MINIX_FS is not set 1499# CONFIG_MINIX_FS is not set
@@ -1539,63 +1536,47 @@ CONFIG_CIFS=y
1539# 1536#
1540# Partition Types 1537# Partition Types
1541# 1538#
1542CONFIG_PARTITION_ADVANCED=y 1539# CONFIG_PARTITION_ADVANCED is not set
1543# CONFIG_ACORN_PARTITION is not set
1544# CONFIG_OSF_PARTITION is not set
1545# CONFIG_AMIGA_PARTITION is not set
1546# CONFIG_ATARI_PARTITION is not set
1547# CONFIG_MAC_PARTITION is not set
1548CONFIG_MSDOS_PARTITION=y 1540CONFIG_MSDOS_PARTITION=y
1549# CONFIG_BSD_DISKLABEL is not set
1550# CONFIG_MINIX_SUBPARTITION is not set
1551# CONFIG_SOLARIS_X86_PARTITION is not set
1552# CONFIG_UNIXWARE_DISKLABEL is not set
1553# CONFIG_LDM_PARTITION is not set
1554# CONFIG_SGI_PARTITION is not set
1555# CONFIG_ULTRIX_PARTITION is not set
1556# CONFIG_SUN_PARTITION is not set
1557# CONFIG_KARMA_PARTITION is not set
1558# CONFIG_EFI_PARTITION is not set
1559# CONFIG_SYSV68_PARTITION is not set
1560CONFIG_NLS=y 1541CONFIG_NLS=y
1561CONFIG_NLS_DEFAULT="iso8859-1" 1542CONFIG_NLS_DEFAULT="iso8859-1"
1562CONFIG_NLS_CODEPAGE_437=m 1543CONFIG_NLS_CODEPAGE_437=m
1563CONFIG_NLS_CODEPAGE_737=m 1544# CONFIG_NLS_CODEPAGE_737 is not set
1564CONFIG_NLS_CODEPAGE_775=m 1545# CONFIG_NLS_CODEPAGE_775 is not set
1565CONFIG_NLS_CODEPAGE_850=m 1546# CONFIG_NLS_CODEPAGE_850 is not set
1566CONFIG_NLS_CODEPAGE_852=m 1547# CONFIG_NLS_CODEPAGE_852 is not set
1567CONFIG_NLS_CODEPAGE_855=m 1548# CONFIG_NLS_CODEPAGE_855 is not set
1568CONFIG_NLS_CODEPAGE_857=m 1549# CONFIG_NLS_CODEPAGE_857 is not set
1569CONFIG_NLS_CODEPAGE_860=m 1550# CONFIG_NLS_CODEPAGE_860 is not set
1570CONFIG_NLS_CODEPAGE_861=m 1551# CONFIG_NLS_CODEPAGE_861 is not set
1571CONFIG_NLS_CODEPAGE_862=m 1552# CONFIG_NLS_CODEPAGE_862 is not set
1572CONFIG_NLS_CODEPAGE_863=m 1553# CONFIG_NLS_CODEPAGE_863 is not set
1573CONFIG_NLS_CODEPAGE_864=m 1554# CONFIG_NLS_CODEPAGE_864 is not set
1574CONFIG_NLS_CODEPAGE_865=m 1555# CONFIG_NLS_CODEPAGE_865 is not set
1575CONFIG_NLS_CODEPAGE_866=m 1556# CONFIG_NLS_CODEPAGE_866 is not set
1576CONFIG_NLS_CODEPAGE_869=m 1557# CONFIG_NLS_CODEPAGE_869 is not set
1577CONFIG_NLS_CODEPAGE_936=m 1558CONFIG_NLS_CODEPAGE_936=m
1578CONFIG_NLS_CODEPAGE_950=m 1559# CONFIG_NLS_CODEPAGE_950 is not set
1579CONFIG_NLS_CODEPAGE_932=m 1560# CONFIG_NLS_CODEPAGE_932 is not set
1580CONFIG_NLS_CODEPAGE_949=m 1561# CONFIG_NLS_CODEPAGE_949 is not set
1581CONFIG_NLS_CODEPAGE_874=m 1562# CONFIG_NLS_CODEPAGE_874 is not set
1582CONFIG_NLS_ISO8859_8=m 1563# CONFIG_NLS_ISO8859_8 is not set
1583CONFIG_NLS_CODEPAGE_1250=m 1564# CONFIG_NLS_CODEPAGE_1250 is not set
1584CONFIG_NLS_CODEPAGE_1251=m 1565# CONFIG_NLS_CODEPAGE_1251 is not set
1585CONFIG_NLS_ASCII=m 1566# CONFIG_NLS_ASCII is not set
1586CONFIG_NLS_ISO8859_1=m 1567CONFIG_NLS_ISO8859_1=m
1587CONFIG_NLS_ISO8859_2=m 1568# CONFIG_NLS_ISO8859_2 is not set
1588CONFIG_NLS_ISO8859_3=m 1569# CONFIG_NLS_ISO8859_3 is not set
1589CONFIG_NLS_ISO8859_4=m 1570# CONFIG_NLS_ISO8859_4 is not set
1590CONFIG_NLS_ISO8859_5=m 1571# CONFIG_NLS_ISO8859_5 is not set
1591CONFIG_NLS_ISO8859_6=m 1572# CONFIG_NLS_ISO8859_6 is not set
1592CONFIG_NLS_ISO8859_7=m 1573# CONFIG_NLS_ISO8859_7 is not set
1593CONFIG_NLS_ISO8859_9=m 1574# CONFIG_NLS_ISO8859_9 is not set
1594CONFIG_NLS_ISO8859_13=m 1575# CONFIG_NLS_ISO8859_13 is not set
1595CONFIG_NLS_ISO8859_14=m 1576# CONFIG_NLS_ISO8859_14 is not set
1596CONFIG_NLS_ISO8859_15=m 1577# CONFIG_NLS_ISO8859_15 is not set
1597CONFIG_NLS_KOI8_R=m 1578# CONFIG_NLS_KOI8_R is not set
1598CONFIG_NLS_KOI8_U=m 1579# CONFIG_NLS_KOI8_U is not set
1599CONFIG_NLS_UTF8=m 1580CONFIG_NLS_UTF8=m
1600# CONFIG_DLM is not set 1581# CONFIG_DLM is not set
1601 1582
@@ -1611,7 +1592,7 @@ CONFIG_FRAME_WARN=1024
1611CONFIG_DEBUG_FS=y 1592CONFIG_DEBUG_FS=y
1612# CONFIG_HEADERS_CHECK is not set 1593# CONFIG_HEADERS_CHECK is not set
1613CONFIG_DEBUG_KERNEL=y 1594CONFIG_DEBUG_KERNEL=y
1614# CONFIG_DEBUG_SHIRQ is not set 1595CONFIG_DEBUG_SHIRQ=y
1615CONFIG_DETECT_SOFTLOCKUP=y 1596CONFIG_DETECT_SOFTLOCKUP=y
1616# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1597# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1617CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1598CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1620,8 +1601,6 @@ CONFIG_SCHED_DEBUG=y
1620# CONFIG_TIMER_STATS is not set 1601# CONFIG_TIMER_STATS is not set
1621# CONFIG_DEBUG_OBJECTS is not set 1602# CONFIG_DEBUG_OBJECTS is not set
1622# CONFIG_DEBUG_SLAB is not set 1603# CONFIG_DEBUG_SLAB is not set
1623# CONFIG_DEBUG_RT_MUTEXES is not set
1624# CONFIG_RT_MUTEX_TESTER is not set
1625# CONFIG_DEBUG_SPINLOCK is not set 1604# CONFIG_DEBUG_SPINLOCK is not set
1626# CONFIG_DEBUG_MUTEXES is not set 1605# CONFIG_DEBUG_MUTEXES is not set
1627# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1606# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1641,7 +1620,6 @@ CONFIG_DEBUG_INFO=y
1641# CONFIG_BACKTRACE_SELF_TEST is not set 1620# CONFIG_BACKTRACE_SELF_TEST is not set
1642# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1621# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1643# CONFIG_FAULT_INJECTION is not set 1622# CONFIG_FAULT_INJECTION is not set
1644# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1645 1623
1646# 1624#
1647# Tracers 1625# Tracers
@@ -1657,16 +1635,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1657# CONFIG_DEBUG_STACK_USAGE is not set 1635# CONFIG_DEBUG_STACK_USAGE is not set
1658CONFIG_DEBUG_VERBOSE=y 1636CONFIG_DEBUG_VERBOSE=y
1659CONFIG_DEBUG_MMRS=y 1637CONFIG_DEBUG_MMRS=y
1660# CONFIG_DEBUG_HWERR is not set 1638CONFIG_DEBUG_HWERR=y
1661# CONFIG_DEBUG_DOUBLEFAULT is not set 1639CONFIG_EXACT_HWERR=y
1640CONFIG_DEBUG_DOUBLEFAULT=y
1641CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1642# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1643# CONFIG_DEBUG_ICACHE_CHECK is not set
1662CONFIG_DEBUG_HUNT_FOR_ZERO=y 1644CONFIG_DEBUG_HUNT_FOR_ZERO=y
1663CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1645CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1664CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1646# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1665# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1647CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1666# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1648# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1667CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1649CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1668# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1650# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1669# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1651CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1670CONFIG_EARLY_PRINTK=y 1652CONFIG_EARLY_PRINTK=y
1671CONFIG_CPLB_INFO=y 1653CONFIG_CPLB_INFO=y
1672CONFIG_ACCESS_CHECK=y 1654CONFIG_ACCESS_CHECK=y
@@ -1780,7 +1762,6 @@ CONFIG_CRC32=y
1780# CONFIG_LIBCRC32C is not set 1762# CONFIG_LIBCRC32C is not set
1781CONFIG_ZLIB_INFLATE=y 1763CONFIG_ZLIB_INFLATE=y
1782CONFIG_ZLIB_DEFLATE=m 1764CONFIG_ZLIB_DEFLATE=m
1783CONFIG_PLIST=y
1784CONFIG_HAS_IOMEM=y 1765CONFIG_HAS_IOMEM=y
1785CONFIG_HAS_IOPORT=y 1766CONFIG_HAS_IOPORT=y
1786CONFIG_HAS_DMA=y 1767CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF561-EZKIT_defconfig b/arch/blackfin/configs/BF561-EZKIT_defconfig
index 4a6ea8e31df7..dcfbe2e2931e 100644
--- a/arch/blackfin/configs/BF561-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF561-EZKIT_defconfig
@@ -1,6 +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.7 3# Linux kernel version: 2.6.28.10
4# Thu May 21 05:50:01 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45# CONFIG_SYSCTL is not set 46CONFIG_SYSCTL=y
47CONFIG_ANON_INODES=y
46CONFIG_EMBEDDED=y 48CONFIG_EMBEDDED=y
47CONFIG_UID16=y 49CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 50# CONFIG_SYSCTL_SYSCALL is not set
49CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set 52# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y 55CONFIG_PRINTK=y
54CONFIG_BUG=y 56CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
58# CONFIG_FUTEX is not set 59# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61# CONFIG_SIGNALFD is not set
62CONFIG_TIMERFD=y 62# CONFIG_TIMERFD is not set
63CONFIG_EVENTFD=y 63# CONFIG_EVENTFD is not set
64# CONFIG_AIO is not set 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_COMPAT_BRK=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y
71CONFIG_HAVE_OPROFILE=y 72CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y 77CONFIG_MODULES=y
@@ -148,9 +148,9 @@ CONFIG_BF_REV_MAX=5
148# CONFIG_BF_REV_0_0 is not set 148# CONFIG_BF_REV_0_0 is not set
149# CONFIG_BF_REV_0_1 is not set 149# CONFIG_BF_REV_0_1 is not set
150# CONFIG_BF_REV_0_2 is not set 150# CONFIG_BF_REV_0_2 is not set
151CONFIG_BF_REV_0_3=y 151# CONFIG_BF_REV_0_3 is not set
152# CONFIG_BF_REV_0_4 is not set 152# CONFIG_BF_REV_0_4 is not set
153# CONFIG_BF_REV_0_5 is not set 153CONFIG_BF_REV_0_5=y
154# CONFIG_BF_REV_0_6 is not set 154# CONFIG_BF_REV_0_6 is not set
155# CONFIG_BF_REV_ANY is not set 155# CONFIG_BF_REV_ANY is not set
156# CONFIG_BF_REV_NONE is not set 156# CONFIG_BF_REV_NONE is not set
@@ -179,7 +179,6 @@ CONFIG_BFIN561_EZKIT=y
179# Core B Support 179# Core B Support
180# 180#
181CONFIG_BF561_COREB=y 181CONFIG_BF561_COREB=y
182CONFIG_BF561_COREB_RESET=y
183 182
184# 183#
185# Interrupt Priority Assignment 184# Interrupt Priority Assignment
@@ -264,7 +263,10 @@ CONFIG_HZ=250
264CONFIG_SCHED_HRTICK=y 263CONFIG_SCHED_HRTICK=y
265CONFIG_GENERIC_TIME=y 264CONFIG_GENERIC_TIME=y
266CONFIG_GENERIC_CLOCKEVENTS=y 265CONFIG_GENERIC_CLOCKEVENTS=y
266# CONFIG_TICKSOURCE_GPTMR0 is not set
267CONFIG_TICKSOURCE_CORETMR=y
267# CONFIG_CYCLES_CLOCKSOURCE is not set 268# CONFIG_CYCLES_CLOCKSOURCE is not set
269# CONFIG_GPTMR0_CLOCKSOURCE is not set
268CONFIG_TICK_ONESHOT=y 270CONFIG_TICK_ONESHOT=y
269# CONFIG_NO_HZ is not set 271# CONFIG_NO_HZ is not set
270CONFIG_HIGH_RES_TIMERS=y 272CONFIG_HIGH_RES_TIMERS=y
@@ -334,7 +336,9 @@ CONFIG_BFIN_DCACHE=y
334# CONFIG_BFIN_ICACHE_LOCK is not set 336# CONFIG_BFIN_ICACHE_LOCK is not set
335CONFIG_BFIN_WB=y 337CONFIG_BFIN_WB=y
336# CONFIG_BFIN_WT is not set 338# CONFIG_BFIN_WT is not set
337# CONFIG_BFIN_L2_CACHEABLE is not set 339# CONFIG_BFIN_L2_WB is not set
340CONFIG_BFIN_L2_WT=y
341# CONFIG_BFIN_L2_NOT_CACHED is not set
338# CONFIG_MPU is not set 342# CONFIG_MPU is not set
339 343
340# 344#
@@ -415,7 +419,7 @@ CONFIG_IP_PNP=y
415# CONFIG_NET_IPIP is not set 419# CONFIG_NET_IPIP is not set
416# CONFIG_NET_IPGRE is not set 420# CONFIG_NET_IPGRE is not set
417# CONFIG_ARPD is not set 421# CONFIG_ARPD is not set
418CONFIG_SYN_COOKIES=y 422# CONFIG_SYN_COOKIES is not set
419# CONFIG_INET_AH is not set 423# CONFIG_INET_AH is not set
420# CONFIG_INET_ESP is not set 424# CONFIG_INET_ESP is not set
421# CONFIG_INET_IPCOMP is not set 425# CONFIG_INET_IPCOMP is not set
@@ -570,9 +574,7 @@ CONFIG_MTD_ROM=m
570# 574#
571# CONFIG_MTD_COMPLEX_MAPPINGS is not set 575# CONFIG_MTD_COMPLEX_MAPPINGS is not set
572CONFIG_MTD_PHYSMAP=m 576CONFIG_MTD_PHYSMAP=m
573CONFIG_MTD_PHYSMAP_START=0x20000000 577# CONFIG_MTD_PHYSMAP_COMPAT is not set
574CONFIG_MTD_PHYSMAP_LEN=0x0
575CONFIG_MTD_PHYSMAP_BANKWIDTH=2
576# CONFIG_MTD_UCLINUX is not set 578# CONFIG_MTD_UCLINUX is not set
577# CONFIG_MTD_PLATRAM is not set 579# CONFIG_MTD_PLATRAM is not set
578 580
@@ -649,9 +651,8 @@ CONFIG_SMC91X=y
649# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 651# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
650# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 652# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
651# CONFIG_B44 is not set 653# CONFIG_B44 is not set
652CONFIG_NETDEV_1000=y 654# CONFIG_NETDEV_1000 is not set
653# CONFIG_AX88180 is not set 655# CONFIG_NETDEV_10000 is not set
654CONFIG_NETDEV_10000=y
655 656
656# 657#
657# Wireless LAN 658# Wireless LAN
@@ -703,13 +704,13 @@ CONFIG_INPUT_EVDEV=m
703# Character devices 704# Character devices
704# 705#
705# CONFIG_AD9960 is not set 706# CONFIG_AD9960 is not set
706# CONFIG_SPI_ADC_BF533 is not set 707CONFIG_BFIN_DMA_INTERFACE=m
707# CONFIG_BF5xx_PPIFCD is not set 708# CONFIG_BFIN_PPI is not set
709# CONFIG_BFIN_PPIFCD is not set
708# CONFIG_BFIN_SIMPLE_TIMER is not set 710# CONFIG_BFIN_SIMPLE_TIMER is not set
709# CONFIG_BF5xx_PPI is not set 711# CONFIG_BFIN_SPI_ADC is not set
710# CONFIG_BFIN_SPORT is not set 712# CONFIG_BFIN_SPORT is not set
711# CONFIG_BFIN_TIMER_LATENCY is not set 713# CONFIG_BFIN_TIMER_LATENCY is not set
712CONFIG_BFIN_DMA_INTERFACE=m
713CONFIG_SIMPLE_GPIO=m 714CONFIG_SIMPLE_GPIO=m
714# CONFIG_VT is not set 715# CONFIG_VT is not set
715# CONFIG_DEVKMEM is not set 716# CONFIG_DEVKMEM is not set
@@ -765,7 +766,30 @@ CONFIG_SPI_BFIN=y
765# CONFIG_SPI_SPIDEV is not set 766# CONFIG_SPI_SPIDEV is not set
766# CONFIG_SPI_TLE62X0 is not set 767# CONFIG_SPI_TLE62X0 is not set
767CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 768CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
768# CONFIG_GPIOLIB is not set 769CONFIG_GPIOLIB=y
770# CONFIG_DEBUG_GPIO is not set
771CONFIG_GPIO_SYSFS=y
772
773#
774# Memory mapped GPIO expanders:
775#
776
777#
778# I2C GPIO expanders:
779#
780# CONFIG_GPIO_MAX732X is not set
781# CONFIG_GPIO_PCA953X is not set
782# CONFIG_GPIO_PCF857X is not set
783
784#
785# PCI GPIO expanders:
786#
787
788#
789# SPI GPIO expanders:
790#
791# CONFIG_GPIO_MAX7301 is not set
792# CONFIG_GPIO_MCP23S08 is not set
769# CONFIG_W1 is not set 793# CONFIG_W1 is not set
770# CONFIG_POWER_SUPPLY is not set 794# CONFIG_POWER_SUPPLY is not set
771# CONFIG_HWMON is not set 795# CONFIG_HWMON is not set
@@ -897,16 +921,6 @@ CONFIG_SYSFS=y
897# CONFIG_BEFS_FS is not set 921# CONFIG_BEFS_FS is not set
898# CONFIG_BFS_FS is not set 922# CONFIG_BFS_FS is not set
899# CONFIG_EFS_FS is not set 923# CONFIG_EFS_FS is not set
900CONFIG_YAFFS_FS=m
901CONFIG_YAFFS_YAFFS1=y
902# CONFIG_YAFFS_9BYTE_TAGS is not set
903# CONFIG_YAFFS_DOES_ECC is not set
904CONFIG_YAFFS_YAFFS2=y
905CONFIG_YAFFS_AUTO_YAFFS2=y
906# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
907# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
908# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
909CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
910CONFIG_JFFS2_FS=m 924CONFIG_JFFS2_FS=m
911CONFIG_JFFS2_FS_DEBUG=0 925CONFIG_JFFS2_FS_DEBUG=0
912CONFIG_JFFS2_FS_WRITEBUFFER=y 926CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -918,6 +932,16 @@ CONFIG_JFFS2_ZLIB=y
918# CONFIG_JFFS2_LZO is not set 932# CONFIG_JFFS2_LZO is not set
919CONFIG_JFFS2_RTIME=y 933CONFIG_JFFS2_RTIME=y
920# CONFIG_JFFS2_RUBIN is not set 934# CONFIG_JFFS2_RUBIN is not set
935CONFIG_YAFFS_FS=m
936CONFIG_YAFFS_YAFFS1=y
937# CONFIG_YAFFS_9BYTE_TAGS is not set
938# CONFIG_YAFFS_DOES_ECC is not set
939CONFIG_YAFFS_YAFFS2=y
940CONFIG_YAFFS_AUTO_YAFFS2=y
941# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
942# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
943# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
944CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
921# CONFIG_CRAMFS is not set 945# CONFIG_CRAMFS is not set
922# CONFIG_VXFS_FS is not set 946# CONFIG_VXFS_FS is not set
923# CONFIG_MINIX_FS is not set 947# CONFIG_MINIX_FS is not set
@@ -1006,7 +1030,7 @@ CONFIG_FRAME_WARN=1024
1006CONFIG_DEBUG_FS=y 1030CONFIG_DEBUG_FS=y
1007# CONFIG_HEADERS_CHECK is not set 1031# CONFIG_HEADERS_CHECK is not set
1008CONFIG_DEBUG_KERNEL=y 1032CONFIG_DEBUG_KERNEL=y
1009# CONFIG_DEBUG_SHIRQ is not set 1033CONFIG_DEBUG_SHIRQ=y
1010CONFIG_DETECT_SOFTLOCKUP=y 1034CONFIG_DETECT_SOFTLOCKUP=y
1011# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1035# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1012CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1036CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1015,8 +1039,6 @@ CONFIG_SCHED_DEBUG=y
1015# CONFIG_TIMER_STATS is not set 1039# CONFIG_TIMER_STATS is not set
1016# CONFIG_DEBUG_OBJECTS is not set 1040# CONFIG_DEBUG_OBJECTS is not set
1017# CONFIG_DEBUG_SLAB is not set 1041# CONFIG_DEBUG_SLAB is not set
1018# CONFIG_DEBUG_RT_MUTEXES is not set
1019# CONFIG_RT_MUTEX_TESTER is not set
1020# CONFIG_DEBUG_SPINLOCK is not set 1042# CONFIG_DEBUG_SPINLOCK is not set
1021# CONFIG_DEBUG_MUTEXES is not set 1043# CONFIG_DEBUG_MUTEXES is not set
1022# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1044# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1036,7 +1058,6 @@ CONFIG_DEBUG_INFO=y
1036# CONFIG_BACKTRACE_SELF_TEST is not set 1058# CONFIG_BACKTRACE_SELF_TEST is not set
1037# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1059# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1038# CONFIG_FAULT_INJECTION is not set 1060# CONFIG_FAULT_INJECTION is not set
1039# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1040 1061
1041# 1062#
1042# Tracers 1063# Tracers
@@ -1052,16 +1073,20 @@ CONFIG_HAVE_ARCH_KGDB=y
1052# CONFIG_DEBUG_STACK_USAGE is not set 1073# CONFIG_DEBUG_STACK_USAGE is not set
1053CONFIG_DEBUG_VERBOSE=y 1074CONFIG_DEBUG_VERBOSE=y
1054CONFIG_DEBUG_MMRS=y 1075CONFIG_DEBUG_MMRS=y
1055# CONFIG_DEBUG_HWERR is not set 1076CONFIG_DEBUG_HWERR=y
1056# CONFIG_DEBUG_DOUBLEFAULT is not set 1077CONFIG_EXACT_HWERR=y
1078CONFIG_DEBUG_DOUBLEFAULT=y
1079CONFIG_DEBUG_DOUBLEFAULT_PRINT=y
1080# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set
1081# CONFIG_DEBUG_ICACHE_CHECK is not set
1057CONFIG_DEBUG_HUNT_FOR_ZERO=y 1082CONFIG_DEBUG_HUNT_FOR_ZERO=y
1058CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1083CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1059CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1084# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set
1060# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set 1085CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y
1061# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set 1086# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1062CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 1087CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1
1063# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1088# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1064# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1089CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y
1065CONFIG_EARLY_PRINTK=y 1090CONFIG_EARLY_PRINTK=y
1066CONFIG_CPLB_INFO=y 1091CONFIG_CPLB_INFO=y
1067CONFIG_ACCESS_CHECK=y 1092CONFIG_ACCESS_CHECK=y
@@ -1174,7 +1199,6 @@ CONFIG_CRC32=y
1174# CONFIG_LIBCRC32C is not set 1199# CONFIG_LIBCRC32C is not set
1175CONFIG_ZLIB_INFLATE=y 1200CONFIG_ZLIB_INFLATE=y
1176CONFIG_ZLIB_DEFLATE=m 1201CONFIG_ZLIB_DEFLATE=m
1177CONFIG_PLIST=y
1178CONFIG_HAS_IOMEM=y 1202CONFIG_HAS_IOMEM=y
1179CONFIG_HAS_IOPORT=y 1203CONFIG_HAS_IOPORT=y
1180CONFIG_HAS_DMA=y 1204CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BlackStamp_defconfig b/arch/blackfin/configs/BlackStamp_defconfig
index ef1a2c84ace1..174c578b8ec4 100644
--- a/arch/blackfin/configs/BlackStamp_defconfig
+++ b/arch/blackfin/configs/BlackStamp_defconfig
@@ -46,7 +46,7 @@ CONFIG_INITRAMFS_SOURCE=""
46# CONFIG_SYSCTL is not set 46# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 47CONFIG_EMBEDDED=y
48CONFIG_UID16=y 48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 49# CONFIG_SYSCTL_SYSCALL is not set
50CONFIG_SYSCTL_SYSCALL_CHECK=y 50CONFIG_SYSCTL_SYSCALL_CHECK=y
51CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
52# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -381,7 +381,7 @@ CONFIG_IP_PNP=y
381# CONFIG_NET_IPIP is not set 381# CONFIG_NET_IPIP is not set
382# CONFIG_NET_IPGRE is not set 382# CONFIG_NET_IPGRE is not set
383# CONFIG_ARPD is not set 383# CONFIG_ARPD is not set
384CONFIG_SYN_COOKIES=y 384# CONFIG_SYN_COOKIES is not set
385# CONFIG_INET_AH is not set 385# CONFIG_INET_AH is not set
386# CONFIG_INET_ESP is not set 386# CONFIG_INET_ESP is not set
387# CONFIG_INET_IPCOMP is not set 387# CONFIG_INET_IPCOMP is not set
diff --git a/arch/blackfin/configs/CM-BF527_defconfig b/arch/blackfin/configs/CM-BF527_defconfig
index e2fc588e4336..e17875e8abe8 100644
--- a/arch/blackfin/configs/CM-BF527_defconfig
+++ b/arch/blackfin/configs/CM-BF527_defconfig
@@ -46,7 +46,7 @@ CONFIG_INITRAMFS_SOURCE=""
46# CONFIG_SYSCTL is not set 46# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 47CONFIG_EMBEDDED=y
48CONFIG_UID16=y 48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 49# CONFIG_SYSCTL_SYSCALL is not set
50CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set 51# CONFIG_KALLSYMS_ALL is not set
52# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -411,7 +411,7 @@ CONFIG_IP_PNP=y
411# CONFIG_NET_IPIP is not set 411# CONFIG_NET_IPIP is not set
412# CONFIG_NET_IPGRE is not set 412# CONFIG_NET_IPGRE is not set
413# CONFIG_ARPD is not set 413# CONFIG_ARPD is not set
414CONFIG_SYN_COOKIES=y 414# CONFIG_SYN_COOKIES is not set
415# CONFIG_INET_AH is not set 415# CONFIG_INET_AH is not set
416# CONFIG_INET_ESP is not set 416# CONFIG_INET_ESP is not set
417# CONFIG_INET_IPCOMP is not set 417# CONFIG_INET_IPCOMP is not set
@@ -783,7 +783,30 @@ CONFIG_SPI_BFIN=y
783# CONFIG_SPI_SPIDEV is not set 783# CONFIG_SPI_SPIDEV is not set
784# CONFIG_SPI_TLE62X0 is not set 784# CONFIG_SPI_TLE62X0 is not set
785CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 785CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
786# CONFIG_GPIOLIB is not set 786CONFIG_GPIOLIB=y
787# CONFIG_DEBUG_GPIO is not set
788CONFIG_GPIO_SYSFS=y
789
790#
791# Memory mapped GPIO expanders:
792#
793
794#
795# I2C GPIO expanders:
796#
797# CONFIG_GPIO_MAX732X is not set
798# CONFIG_GPIO_PCA953X is not set
799# CONFIG_GPIO_PCF857X is not set
800
801#
802# PCI GPIO expanders:
803#
804
805#
806# SPI GPIO expanders:
807#
808# CONFIG_GPIO_MAX7301 is not set
809# CONFIG_GPIO_MCP23S08 is not set
787# CONFIG_W1 is not set 810# CONFIG_W1 is not set
788# CONFIG_POWER_SUPPLY is not set 811# CONFIG_POWER_SUPPLY is not set
789CONFIG_HWMON=y 812CONFIG_HWMON=y
diff --git a/arch/blackfin/configs/CM-BF533_defconfig b/arch/blackfin/configs/CM-BF533_defconfig
index 65a8bbb8d647..fafd95e84b28 100644
--- a/arch/blackfin/configs/CM-BF533_defconfig
+++ b/arch/blackfin/configs/CM-BF533_defconfig
@@ -49,7 +49,7 @@ CONFIG_LOG_BUF_SHIFT=14
49# CONFIG_SYSCTL is not set 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52# CONFIG_SYSCTL_SYSCALL is not set
53CONFIG_KALLSYMS=y 53CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 54# CONFIG_KALLSYMS_EXTRA_PASS is not set
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
@@ -347,7 +347,7 @@ CONFIG_IP_FIB_HASH=y
347# CONFIG_NET_IPIP is not set 347# CONFIG_NET_IPIP is not set
348# CONFIG_NET_IPGRE is not set 348# CONFIG_NET_IPGRE is not set
349# CONFIG_ARPD is not set 349# CONFIG_ARPD is not set
350CONFIG_SYN_COOKIES=y 350# CONFIG_SYN_COOKIES is not set
351# CONFIG_INET_AH is not set 351# CONFIG_INET_AH is not set
352# CONFIG_INET_ESP is not set 352# CONFIG_INET_ESP is not set
353# CONFIG_INET_IPCOMP is not set 353# CONFIG_INET_IPCOMP is not set
@@ -547,9 +547,9 @@ CONFIG_MII=y
547CONFIG_SMC91X=y 547CONFIG_SMC91X=y
548# CONFIG_SMSC911X is not set 548# CONFIG_SMSC911X is not set
549# CONFIG_DM9000 is not set 549# CONFIG_DM9000 is not set
550CONFIG_NETDEV_1000=y 550# CONFIG_NETDEV_1000 is not set
551# CONFIG_AX88180 is not set 551# CONFIG_AX88180 is not set
552CONFIG_NETDEV_10000=y 552# CONFIG_NETDEV_10000 is not set
553 553
554# 554#
555# Wireless LAN 555# Wireless LAN
@@ -641,6 +641,10 @@ CONFIG_UNIX98_PTYS=y
641# CONFIG_TCG_TPM is not set 641# CONFIG_TCG_TPM is not set
642# CONFIG_I2C is not set 642# CONFIG_I2C is not set
643 643
644CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
645CONFIG_GPIOLIB=y
646CONFIG_GPIO_SYSFS=y
647
644# 648#
645# SPI support 649# SPI support
646# 650#
diff --git a/arch/blackfin/configs/CM-BF537E_defconfig b/arch/blackfin/configs/CM-BF537E_defconfig
index 9b7e9d781145..e73aa5af58b9 100644
--- a/arch/blackfin/configs/CM-BF537E_defconfig
+++ b/arch/blackfin/configs/CM-BF537E_defconfig
@@ -1,6 +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.22.16 3# Linux kernel version: 2.6.28.10
4# Wed Jun 3 06:27:41 2009
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -8,48 +9,44 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 10CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 11CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y 15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_TIME=y
17CONFIG_GENERIC_GPIO=y 16CONFIG_GENERIC_GPIO=y
18CONFIG_FORCE_MAX_ZONEORDER=14 17CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21 20
22# 21#
23# Code maturity level options 22# General setup
24# 23#
25CONFIG_EXPERIMENTAL=y 24CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y 25CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32 26CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION="" 27CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y 28CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y 29CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36CONFIG_SYSVIPC_SYSCTL=y 30CONFIG_SYSVIPC_SYSCTL=y
37# CONFIG_POSIX_MQUEUE is not set 31# CONFIG_POSIX_MQUEUE is not set
38# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
39# CONFIG_TASKSTATS is not set 33# CONFIG_TASKSTATS is not set
40# CONFIG_UTS_NS is not set
41# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
42CONFIG_IKCONFIG=y 35CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 36CONFIG_IKCONFIG_PROC=y
44CONFIG_LOG_BUF_SHIFT=14 37CONFIG_LOG_BUF_SHIFT=14
45# CONFIG_SYSFS_DEPRECATED is not set 38# CONFIG_CGROUPS is not set
39# CONFIG_GROUP_SCHED is not set
40# CONFIG_SYSFS_DEPRECATED_V2 is not set
46# CONFIG_RELAY is not set 41# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set
47# CONFIG_BLK_DEV_INITRD is not set 43# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49# CONFIG_SYSCTL is not set 45CONFIG_SYSCTL=y
46CONFIG_ANON_INODES=y
50CONFIG_EMBEDDED=y 47CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 48# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 49# CONFIG_SYSCTL_SYSCALL is not set
53CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 51# CONFIG_KALLSYMS_EXTRA_PASS is not set
55# CONFIG_HOTPLUG is not set 52# CONFIG_HOTPLUG is not set
@@ -58,37 +55,36 @@ CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 56CONFIG_BASE_FULL=y
60# CONFIG_FUTEX is not set 57# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 58CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 59# CONFIG_SIGNALFD is not set
64CONFIG_EVENTFD=y 60# CONFIG_TIMERFD is not set
61# CONFIG_EVENTFD is not set
62# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 63CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 64CONFIG_COMPAT_BRK=y
67# CONFIG_NP2 is not set
68CONFIG_SLAB=y 65CONFIG_SLAB=y
69# CONFIG_SLUB is not set 66# CONFIG_SLUB is not set
70# CONFIG_SLOB is not set 67# CONFIG_SLOB is not set
71CONFIG_RT_MUTEXES=y 68# CONFIG_PROFILING is not set
69# CONFIG_MARKERS is not set
70CONFIG_HAVE_OPROFILE=y
71# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
72CONFIG_SLABINFO=y
72CONFIG_TINY_SHMEM=y 73CONFIG_TINY_SHMEM=y
73CONFIG_BASE_SMALL=0 74CONFIG_BASE_SMALL=0
74
75#
76# Loadable module support
77#
78CONFIG_MODULES=y 75CONFIG_MODULES=y
76# CONFIG_MODULE_FORCE_LOAD is not set
79CONFIG_MODULE_UNLOAD=y 77CONFIG_MODULE_UNLOAD=y
80# CONFIG_MODULE_FORCE_UNLOAD is not set 78# CONFIG_MODULE_FORCE_UNLOAD is not set
81# CONFIG_MODVERSIONS is not set 79# CONFIG_MODVERSIONS is not set
82# CONFIG_MODULE_SRCVERSION_ALL is not set 80# CONFIG_MODULE_SRCVERSION_ALL is not set
83CONFIG_KMOD=y 81CONFIG_KMOD=y
84
85#
86# Block layer
87#
88CONFIG_BLOCK=y 82CONFIG_BLOCK=y
89# CONFIG_LBD is not set 83# CONFIG_LBD is not set
90# CONFIG_BLK_DEV_IO_TRACE is not set 84# CONFIG_BLK_DEV_IO_TRACE is not set
91# CONFIG_LSF is not set 85# CONFIG_LSF is not set
86# CONFIG_BLK_DEV_BSG is not set
87# CONFIG_BLK_DEV_INTEGRITY is not set
92 88
93# 89#
94# IO Schedulers 90# IO Schedulers
@@ -102,9 +98,11 @@ CONFIG_IOSCHED_CFQ=y
102# CONFIG_DEFAULT_CFQ is not set 98# CONFIG_DEFAULT_CFQ is not set
103CONFIG_DEFAULT_NOOP=y 99CONFIG_DEFAULT_NOOP=y
104CONFIG_DEFAULT_IOSCHED="noop" 100CONFIG_DEFAULT_IOSCHED="noop"
101CONFIG_CLASSIC_RCU=y
105CONFIG_PREEMPT_NONE=y 102CONFIG_PREEMPT_NONE=y
106# CONFIG_PREEMPT_VOLUNTARY is not set 103# CONFIG_PREEMPT_VOLUNTARY is not set
107# CONFIG_PREEMPT is not set 104# CONFIG_PREEMPT is not set
105# CONFIG_FREEZER is not set
108 106
109# 107#
110# Blackfin Processor Options 108# Blackfin Processor Options
@@ -113,6 +111,10 @@ CONFIG_PREEMPT_NONE=y
113# 111#
114# Processor and Board Settings 112# Processor and Board Settings
115# 113#
114# CONFIG_BF512 is not set
115# CONFIG_BF514 is not set
116# CONFIG_BF516 is not set
117# CONFIG_BF518 is not set
116# CONFIG_BF522 is not set 118# CONFIG_BF522 is not set
117# CONFIG_BF523 is not set 119# CONFIG_BF523 is not set
118# CONFIG_BF524 is not set 120# CONFIG_BF524 is not set
@@ -125,22 +127,31 @@ CONFIG_PREEMPT_NONE=y
125# CONFIG_BF534 is not set 127# CONFIG_BF534 is not set
126# CONFIG_BF536 is not set 128# CONFIG_BF536 is not set
127CONFIG_BF537=y 129CONFIG_BF537=y
130# CONFIG_BF538 is not set
131# CONFIG_BF539 is not set
128# CONFIG_BF542 is not set 132# CONFIG_BF542 is not set
133# CONFIG_BF542M is not set
129# CONFIG_BF544 is not set 134# CONFIG_BF544 is not set
135# CONFIG_BF544M is not set
130# CONFIG_BF547 is not set 136# CONFIG_BF547 is not set
137# CONFIG_BF547M is not set
131# CONFIG_BF548 is not set 138# CONFIG_BF548 is not set
139# CONFIG_BF548M is not set
132# CONFIG_BF549 is not set 140# CONFIG_BF549 is not set
141# CONFIG_BF549M is not set
133# CONFIG_BF561 is not set 142# CONFIG_BF561 is not set
143CONFIG_BF_REV_MIN=2
144CONFIG_BF_REV_MAX=3
134# CONFIG_BF_REV_0_0 is not set 145# CONFIG_BF_REV_0_0 is not set
135# CONFIG_BF_REV_0_1 is not set 146# CONFIG_BF_REV_0_1 is not set
136CONFIG_BF_REV_0_2=y 147CONFIG_BF_REV_0_2=y
137# CONFIG_BF_REV_0_3 is not set 148# CONFIG_BF_REV_0_3 is not set
138# CONFIG_BF_REV_0_4 is not set 149# CONFIG_BF_REV_0_4 is not set
139# CONFIG_BF_REV_0_5 is not set 150# CONFIG_BF_REV_0_5 is not set
151# CONFIG_BF_REV_0_6 is not set
140# CONFIG_BF_REV_ANY is not set 152# CONFIG_BF_REV_ANY is not set
141# CONFIG_BF_REV_NONE is not set 153# CONFIG_BF_REV_NONE is not set
142CONFIG_BF53x=y 154CONFIG_BF53x=y
143CONFIG_BFIN_SINGLE_CORE=y
144CONFIG_MEM_MT48LC16M16A2TG_75=y 155CONFIG_MEM_MT48LC16M16A2TG_75=y
145CONFIG_IRQ_PLL_WAKEUP=7 156CONFIG_IRQ_PLL_WAKEUP=7
146CONFIG_IRQ_RTC=8 157CONFIG_IRQ_RTC=8
@@ -150,7 +161,6 @@ CONFIG_IRQ_SPORT0_TX=9
150CONFIG_IRQ_SPORT1_RX=9 161CONFIG_IRQ_SPORT1_RX=9
151CONFIG_IRQ_SPORT1_TX=9 162CONFIG_IRQ_SPORT1_TX=9
152CONFIG_IRQ_TWI=10 163CONFIG_IRQ_TWI=10
153CONFIG_IRQ_SPI=10
154CONFIG_IRQ_UART0_RX=10 164CONFIG_IRQ_UART0_RX=10
155CONFIG_IRQ_UART0_TX=10 165CONFIG_IRQ_UART0_TX=10
156CONFIG_IRQ_UART1_RX=10 166CONFIG_IRQ_UART1_RX=10
@@ -169,11 +179,12 @@ CONFIG_IRQ_PORTG_INTB=12
169CONFIG_IRQ_MEM_DMA0=13 179CONFIG_IRQ_MEM_DMA0=13
170CONFIG_IRQ_MEM_DMA1=13 180CONFIG_IRQ_MEM_DMA1=13
171CONFIG_IRQ_WATCH=13 181CONFIG_IRQ_WATCH=13
182CONFIG_IRQ_SPI=10
172# CONFIG_BFIN537_STAMP is not set 183# CONFIG_BFIN537_STAMP is not set
173CONFIG_BFIN537_BLUETECHNIX_CM=y 184CONFIG_BFIN537_BLUETECHNIX_CM=y
185# CONFIG_BFIN537_BLUETECHNIX_TCM is not set
174# CONFIG_PNAV10 is not set 186# CONFIG_PNAV10 is not set
175# CONFIG_CAMSIG_MINOTAUR is not set 187# CONFIG_CAMSIG_MINOTAUR is not set
176# CONFIG_GENERIC_BF537_BOARD is not set
177 188
178# 189#
179# BF537 Specific Configuration 190# BF537 Specific Configuration
@@ -196,6 +207,7 @@ CONFIG_IRQ_PROG_INTA=12
196# Board customizations 207# Board customizations
197# 208#
198# CONFIG_CMDLINE_BOOL is not set 209# CONFIG_CMDLINE_BOOL is not set
210CONFIG_BOOT_LOAD=0x1000
199 211
200# 212#
201# Clock/PLL Setup 213# Clock/PLL Setup
@@ -215,13 +227,20 @@ CONFIG_HZ_250=y
215# CONFIG_HZ_300 is not set 227# CONFIG_HZ_300 is not set
216# CONFIG_HZ_1000 is not set 228# CONFIG_HZ_1000 is not set
217CONFIG_HZ=250 229CONFIG_HZ=250
230# CONFIG_SCHED_HRTICK is not set
231CONFIG_GENERIC_TIME=y
232CONFIG_GENERIC_CLOCKEVENTS=y
233# CONFIG_TICKSOURCE_GPTMR0 is not set
234CONFIG_TICKSOURCE_CORETMR=y
235# CONFIG_CYCLES_CLOCKSOURCE is not set
236# CONFIG_GPTMR0_CLOCKSOURCE is not set
237# CONFIG_NO_HZ is not set
238# CONFIG_HIGH_RES_TIMERS is not set
239CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
218 240
219# 241#
220# Memory Setup 242# Misc
221# 243#
222CONFIG_MAX_MEM_SIZE=32
223CONFIG_MEM_ADD_WIDTH=9
224CONFIG_BOOT_LOAD=0x1000
225CONFIG_BFIN_SCRATCH_REG_RETN=y 244CONFIG_BFIN_SCRATCH_REG_RETN=y
226# CONFIG_BFIN_SCRATCH_REG_RETE is not set 245# CONFIG_BFIN_SCRATCH_REG_RETE is not set
227# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set 246# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
@@ -248,6 +267,12 @@ CONFIG_IP_CHECKSUM_L1=y
248CONFIG_CACHELINE_ALIGNED_L1=y 267CONFIG_CACHELINE_ALIGNED_L1=y
249CONFIG_SYSCALL_TAB_L1=y 268CONFIG_SYSCALL_TAB_L1=y
250CONFIG_CPLB_SWITCH_TAB_L1=y 269CONFIG_CPLB_SWITCH_TAB_L1=y
270CONFIG_APP_STACK_L1=y
271
272#
273# Speed Optimizations
274#
275CONFIG_BFIN_INS_LOWOVERHEAD=y
251CONFIG_RAMKERNEL=y 276CONFIG_RAMKERNEL=y
252# CONFIG_ROMKERNEL is not set 277# CONFIG_ROMKERNEL is not set
253CONFIG_SELECT_MEMORY_MODEL=y 278CONFIG_SELECT_MEMORY_MODEL=y
@@ -256,12 +281,14 @@ CONFIG_FLATMEM_MANUAL=y
256# CONFIG_SPARSEMEM_MANUAL is not set 281# CONFIG_SPARSEMEM_MANUAL is not set
257CONFIG_FLATMEM=y 282CONFIG_FLATMEM=y
258CONFIG_FLAT_NODE_MEM_MAP=y 283CONFIG_FLAT_NODE_MEM_MAP=y
259# CONFIG_SPARSEMEM_STATIC is not set 284CONFIG_PAGEFLAGS_EXTENDED=y
260CONFIG_SPLIT_PTLOCK_CPUS=4 285CONFIG_SPLIT_PTLOCK_CPUS=4
261# CONFIG_RESOURCES_64BIT is not set 286# CONFIG_RESOURCES_64BIT is not set
287# CONFIG_PHYS_ADDR_T_64BIT is not set
262CONFIG_ZONE_DMA_FLAG=1 288CONFIG_ZONE_DMA_FLAG=1
263CONFIG_LARGE_ALLOCS=y 289CONFIG_VIRT_TO_BUS=y
264# CONFIG_BFIN_GPTIMERS is not set 290# CONFIG_BFIN_GPTIMERS is not set
291# CONFIG_DMA_UNCACHED_4M is not set
265# CONFIG_DMA_UNCACHED_2M is not set 292# CONFIG_DMA_UNCACHED_2M is not set
266CONFIG_DMA_UNCACHED_1M=y 293CONFIG_DMA_UNCACHED_1M=y
267# CONFIG_DMA_UNCACHED_NONE is not set 294# CONFIG_DMA_UNCACHED_NONE is not set
@@ -275,7 +302,6 @@ CONFIG_BFIN_DCACHE=y
275# CONFIG_BFIN_ICACHE_LOCK is not set 302# CONFIG_BFIN_ICACHE_LOCK is not set
276CONFIG_BFIN_WB=y 303CONFIG_BFIN_WB=y
277# CONFIG_BFIN_WT is not set 304# CONFIG_BFIN_WT is not set
278CONFIG_L1_MAX_PIECE=16
279# CONFIG_MPU is not set 305# CONFIG_MPU is not set
280 306
281# 307#
@@ -304,36 +330,28 @@ CONFIG_BANK_3=0xFFC2
304# 330#
305# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 331# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
306# 332#
307# CONFIG_PCI is not set
308# CONFIG_ARCH_SUPPORTS_MSI is not set 333# CONFIG_ARCH_SUPPORTS_MSI is not set
309 334
310# 335#
311# PCCARD (PCMCIA/CardBus) support
312#
313
314#
315# Executable file formats 336# Executable file formats
316# 337#
317CONFIG_BINFMT_ELF_FDPIC=y 338CONFIG_BINFMT_ELF_FDPIC=y
318CONFIG_BINFMT_FLAT=y 339CONFIG_BINFMT_FLAT=y
319CONFIG_BINFMT_ZFLAT=y 340CONFIG_BINFMT_ZFLAT=y
320CONFIG_BINFMT_SHARED_FLAT=y 341CONFIG_BINFMT_SHARED_FLAT=y
342# CONFIG_HAVE_AOUT is not set
321# CONFIG_BINFMT_MISC is not set 343# CONFIG_BINFMT_MISC is not set
322 344
323# 345#
324# Power management options 346# Power management options
325# 347#
326# CONFIG_PM is not set 348# CONFIG_PM is not set
327# CONFIG_PM_WAKEUP_BY_GPIO is not set 349CONFIG_ARCH_SUSPEND_POSSIBLE=y
328 350
329# 351#
330# CPU Frequency scaling 352# CPU Frequency scaling
331# 353#
332# CONFIG_CPU_FREQ is not set 354# CONFIG_CPU_FREQ is not set
333
334#
335# Networking
336#
337CONFIG_NET=y 355CONFIG_NET=y
338 356
339# 357#
@@ -346,6 +364,7 @@ CONFIG_XFRM=y
346# CONFIG_XFRM_USER is not set 364# CONFIG_XFRM_USER is not set
347# CONFIG_XFRM_SUB_POLICY is not set 365# CONFIG_XFRM_SUB_POLICY is not set
348# CONFIG_XFRM_MIGRATE is not set 366# CONFIG_XFRM_MIGRATE is not set
367# CONFIG_XFRM_STATISTICS is not set
349# CONFIG_NET_KEY is not set 368# CONFIG_NET_KEY is not set
350CONFIG_INET=y 369CONFIG_INET=y
351# CONFIG_IP_MULTICAST is not set 370# CONFIG_IP_MULTICAST is not set
@@ -358,7 +377,7 @@ CONFIG_IP_PNP=y
358# CONFIG_NET_IPIP is not set 377# CONFIG_NET_IPIP is not set
359# CONFIG_NET_IPGRE is not set 378# CONFIG_NET_IPGRE is not set
360# CONFIG_ARPD is not set 379# CONFIG_ARPD is not set
361CONFIG_SYN_COOKIES=y 380# CONFIG_SYN_COOKIES is not set
362# CONFIG_INET_AH is not set 381# CONFIG_INET_AH is not set
363# CONFIG_INET_ESP is not set 382# CONFIG_INET_ESP is not set
364# CONFIG_INET_IPCOMP is not set 383# CONFIG_INET_IPCOMP is not set
@@ -367,6 +386,7 @@ CONFIG_SYN_COOKIES=y
367CONFIG_INET_XFRM_MODE_TRANSPORT=y 386CONFIG_INET_XFRM_MODE_TRANSPORT=y
368CONFIG_INET_XFRM_MODE_TUNNEL=y 387CONFIG_INET_XFRM_MODE_TUNNEL=y
369CONFIG_INET_XFRM_MODE_BEET=y 388CONFIG_INET_XFRM_MODE_BEET=y
389# CONFIG_INET_LRO is not set
370CONFIG_INET_DIAG=y 390CONFIG_INET_DIAG=y
371CONFIG_INET_TCP_DIAG=y 391CONFIG_INET_TCP_DIAG=y
372# CONFIG_TCP_CONG_ADVANCED is not set 392# CONFIG_TCP_CONG_ADVANCED is not set
@@ -374,8 +394,6 @@ CONFIG_TCP_CONG_CUBIC=y
374CONFIG_DEFAULT_TCP_CONG="cubic" 394CONFIG_DEFAULT_TCP_CONG="cubic"
375# CONFIG_TCP_MD5SIG is not set 395# CONFIG_TCP_MD5SIG is not set
376# CONFIG_IPV6 is not set 396# CONFIG_IPV6 is not set
377# CONFIG_INET6_XFRM_TUNNEL is not set
378# CONFIG_INET6_TUNNEL is not set
379# CONFIG_NETLABEL is not set 397# CONFIG_NETLABEL is not set
380# CONFIG_NETWORK_SECMARK is not set 398# CONFIG_NETWORK_SECMARK is not set
381# CONFIG_NETFILTER is not set 399# CONFIG_NETFILTER is not set
@@ -384,6 +402,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
384# CONFIG_TIPC is not set 402# CONFIG_TIPC is not set
385# CONFIG_ATM is not set 403# CONFIG_ATM is not set
386# CONFIG_BRIDGE is not set 404# CONFIG_BRIDGE is not set
405# CONFIG_NET_DSA is not set
387# CONFIG_VLAN_8021Q is not set 406# CONFIG_VLAN_8021Q is not set
388# CONFIG_DECNET is not set 407# CONFIG_DECNET is not set
389# CONFIG_LLC2 is not set 408# CONFIG_LLC2 is not set
@@ -393,10 +412,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
393# CONFIG_LAPB is not set 412# CONFIG_LAPB is not set
394# CONFIG_ECONET is not set 413# CONFIG_ECONET is not set
395# CONFIG_WAN_ROUTER is not set 414# CONFIG_WAN_ROUTER is not set
396
397#
398# QoS and/or fair queueing
399#
400# CONFIG_NET_SCHED is not set 415# CONFIG_NET_SCHED is not set
401 416
402# 417#
@@ -404,18 +419,14 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
404# 419#
405# CONFIG_NET_PKTGEN is not set 420# CONFIG_NET_PKTGEN is not set
406# CONFIG_HAMRADIO is not set 421# CONFIG_HAMRADIO is not set
422# CONFIG_CAN is not set
407# CONFIG_IRDA is not set 423# CONFIG_IRDA is not set
408# CONFIG_BT is not set 424# CONFIG_BT is not set
409# CONFIG_AF_RXRPC is not set 425# CONFIG_AF_RXRPC is not set
410 426# CONFIG_PHONET is not set
411# 427# CONFIG_WIRELESS is not set
412# Wireless
413#
414# CONFIG_CFG80211 is not set
415# CONFIG_WIRELESS_EXT is not set
416# CONFIG_MAC80211 is not set
417# CONFIG_IEEE80211 is not set
418# CONFIG_RFKILL is not set 428# CONFIG_RFKILL is not set
429# CONFIG_NET_9P is not set
419 430
420# 431#
421# Device Drivers 432# Device Drivers
@@ -427,10 +438,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
427CONFIG_STANDALONE=y 438CONFIG_STANDALONE=y
428CONFIG_PREVENT_FIRMWARE_BUILD=y 439CONFIG_PREVENT_FIRMWARE_BUILD=y
429# CONFIG_SYS_HYPERVISOR is not set 440# CONFIG_SYS_HYPERVISOR is not set
430
431#
432# Connector - unified userspace <-> kernelspace linker
433#
434# CONFIG_CONNECTOR is not set 441# CONFIG_CONNECTOR is not set
435CONFIG_MTD=y 442CONFIG_MTD=y
436# CONFIG_MTD_DEBUG is not set 443# CONFIG_MTD_DEBUG is not set
@@ -438,6 +445,7 @@ CONFIG_MTD=y
438CONFIG_MTD_PARTITIONS=y 445CONFIG_MTD_PARTITIONS=y
439# CONFIG_MTD_REDBOOT_PARTS is not set 446# CONFIG_MTD_REDBOOT_PARTS is not set
440# CONFIG_MTD_CMDLINE_PARTS is not set 447# CONFIG_MTD_CMDLINE_PARTS is not set
448# CONFIG_MTD_AR7_PARTS is not set
441 449
442# 450#
443# User Modules And Translation Layers 451# User Modules And Translation Layers
@@ -450,12 +458,15 @@ CONFIG_MTD_BLOCK=y
450# CONFIG_INFTL is not set 458# CONFIG_INFTL is not set
451# CONFIG_RFD_FTL is not set 459# CONFIG_RFD_FTL is not set
452# CONFIG_SSFDC is not set 460# CONFIG_SSFDC is not set
461# CONFIG_MTD_OOPS is not set
453 462
454# 463#
455# RAM/ROM/Flash chip drivers 464# RAM/ROM/Flash chip drivers
456# 465#
457# CONFIG_MTD_CFI is not set 466CONFIG_MTD_CFI=y
458# CONFIG_MTD_JEDECPROBE is not set 467# CONFIG_MTD_JEDECPROBE is not set
468CONFIG_MTD_GEN_PROBE=y
469# CONFIG_MTD_CFI_ADV_OPTIONS is not set
459CONFIG_MTD_MAP_BANK_WIDTH_1=y 470CONFIG_MTD_MAP_BANK_WIDTH_1=y
460CONFIG_MTD_MAP_BANK_WIDTH_2=y 471CONFIG_MTD_MAP_BANK_WIDTH_2=y
461CONFIG_MTD_MAP_BANK_WIDTH_4=y 472CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -466,6 +477,10 @@ CONFIG_MTD_CFI_I1=y
466CONFIG_MTD_CFI_I2=y 477CONFIG_MTD_CFI_I2=y
467# CONFIG_MTD_CFI_I4 is not set 478# CONFIG_MTD_CFI_I4 is not set
468# CONFIG_MTD_CFI_I8 is not set 479# CONFIG_MTD_CFI_I8 is not set
480CONFIG_MTD_CFI_INTELEXT=y
481# CONFIG_MTD_CFI_AMDSTD is not set
482# CONFIG_MTD_CFI_STAA is not set
483CONFIG_MTD_CFI_UTIL=y
469CONFIG_MTD_RAM=y 484CONFIG_MTD_RAM=y
470# CONFIG_MTD_ROM is not set 485# CONFIG_MTD_ROM is not set
471# CONFIG_MTD_ABSENT is not set 486# CONFIG_MTD_ABSENT is not set
@@ -473,7 +488,8 @@ CONFIG_MTD_RAM=y
473# 488#
474# Mapping drivers for chip access 489# Mapping drivers for chip access
475# 490#
476# CONFIG_MTD_COMPLEX_MAPPINGS is not set 491CONFIG_MTD_COMPLEX_MAPPINGS=y
492CONFIG_MTD_GPIO_ADDR=y
477CONFIG_MTD_UCLINUX=y 493CONFIG_MTD_UCLINUX=y
478# CONFIG_MTD_PLATRAM is not set 494# CONFIG_MTD_PLATRAM is not set
479 495
@@ -498,33 +514,23 @@ CONFIG_MTD_UCLINUX=y
498# UBI - Unsorted block images 514# UBI - Unsorted block images
499# 515#
500# CONFIG_MTD_UBI is not set 516# CONFIG_MTD_UBI is not set
501
502#
503# Parallel port support
504#
505# CONFIG_PARPORT is not set 517# CONFIG_PARPORT is not set
506 518CONFIG_BLK_DEV=y
507#
508# Plug and Play support
509#
510# CONFIG_PNPACPI is not set
511
512#
513# Block devices
514#
515# CONFIG_BLK_DEV_COW_COMMON is not set 519# CONFIG_BLK_DEV_COW_COMMON is not set
516# CONFIG_BLK_DEV_LOOP is not set 520# CONFIG_BLK_DEV_LOOP is not set
517# CONFIG_BLK_DEV_NBD is not set 521# CONFIG_BLK_DEV_NBD is not set
518CONFIG_BLK_DEV_RAM=y 522CONFIG_BLK_DEV_RAM=y
519CONFIG_BLK_DEV_RAM_COUNT=16 523CONFIG_BLK_DEV_RAM_COUNT=16
520CONFIG_BLK_DEV_RAM_SIZE=4096 524CONFIG_BLK_DEV_RAM_SIZE=4096
521CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 525# CONFIG_BLK_DEV_XIP is not set
522# CONFIG_CDROM_PKTCDVD is not set 526# CONFIG_CDROM_PKTCDVD is not set
523# CONFIG_ATA_OVER_ETH is not set 527# CONFIG_ATA_OVER_ETH is not set
524 528# CONFIG_BLK_DEV_HD is not set
525# 529CONFIG_MISC_DEVICES=y
526# Misc devices 530# CONFIG_EEPROM_93CX6 is not set
527# 531# CONFIG_ENCLOSURE_SERVICES is not set
532# CONFIG_C2PORT is not set
533CONFIG_HAVE_IDE=y
528# CONFIG_IDE is not set 534# CONFIG_IDE is not set
529 535
530# 536#
@@ -532,22 +538,17 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
532# 538#
533# CONFIG_RAID_ATTRS is not set 539# CONFIG_RAID_ATTRS is not set
534# CONFIG_SCSI is not set 540# CONFIG_SCSI is not set
541# CONFIG_SCSI_DMA is not set
535# CONFIG_SCSI_NETLINK is not set 542# CONFIG_SCSI_NETLINK is not set
536# CONFIG_ATA is not set 543# CONFIG_ATA is not set
537
538#
539# Multi-device support (RAID and LVM)
540#
541# CONFIG_MD is not set 544# CONFIG_MD is not set
542
543#
544# Network device support
545#
546CONFIG_NETDEVICES=y 545CONFIG_NETDEVICES=y
547# CONFIG_DUMMY is not set 546# CONFIG_DUMMY is not set
548# CONFIG_BONDING is not set 547# CONFIG_BONDING is not set
548# CONFIG_MACVLAN is not set
549# CONFIG_EQUALIZER is not set 549# CONFIG_EQUALIZER is not set
550# CONFIG_TUN is not set 550# CONFIG_TUN is not set
551# CONFIG_VETH is not set
551CONFIG_PHYLIB=y 552CONFIG_PHYLIB=y
552 553
553# 554#
@@ -561,46 +562,44 @@ CONFIG_PHYLIB=y
561# CONFIG_VITESSE_PHY is not set 562# CONFIG_VITESSE_PHY is not set
562# CONFIG_SMSC_PHY is not set 563# CONFIG_SMSC_PHY is not set
563# CONFIG_BROADCOM_PHY is not set 564# CONFIG_BROADCOM_PHY is not set
565# CONFIG_ICPLUS_PHY is not set
566# CONFIG_REALTEK_PHY is not set
564# CONFIG_FIXED_PHY is not set 567# CONFIG_FIXED_PHY is not set
565 568# CONFIG_MDIO_BITBANG is not set
566#
567# Ethernet (10 or 100Mbit)
568#
569CONFIG_NET_ETHERNET=y 569CONFIG_NET_ETHERNET=y
570CONFIG_MII=y 570CONFIG_MII=y
571# CONFIG_SMC91X is not set
572CONFIG_BFIN_MAC=y 571CONFIG_BFIN_MAC=y
573CONFIG_BFIN_MAC_USE_L1=y 572CONFIG_BFIN_MAC_USE_L1=y
574CONFIG_BFIN_TX_DESC_NUM=10 573CONFIG_BFIN_TX_DESC_NUM=10
575CONFIG_BFIN_RX_DESC_NUM=20 574CONFIG_BFIN_RX_DESC_NUM=20
576# CONFIG_BFIN_MAC_RMII is not set 575# CONFIG_BFIN_MAC_RMII is not set
576# CONFIG_SMC91X is not set
577# CONFIG_SMSC911X is not set 577# CONFIG_SMSC911X is not set
578# CONFIG_DM9000 is not set 578# CONFIG_DM9000 is not set
579CONFIG_NETDEV_1000=y 579# CONFIG_IBM_NEW_EMAC_ZMII is not set
580# CONFIG_AX88180 is not set 580# CONFIG_IBM_NEW_EMAC_RGMII is not set
581CONFIG_NETDEV_10000=y 581# CONFIG_IBM_NEW_EMAC_TAH is not set
582# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
583# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
584# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
585# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
586# CONFIG_B44 is not set
587# CONFIG_NETDEV_1000 is not set
588# CONFIG_NETDEV_10000 is not set
582 589
583# 590#
584# Wireless LAN 591# Wireless LAN
585# 592#
586# CONFIG_WLAN_PRE80211 is not set 593# CONFIG_WLAN_PRE80211 is not set
587# CONFIG_WLAN_80211 is not set 594# CONFIG_WLAN_80211 is not set
595# CONFIG_IWLWIFI_LEDS is not set
588# CONFIG_WAN is not set 596# CONFIG_WAN is not set
589# CONFIG_PPP is not set 597# CONFIG_PPP is not set
590# CONFIG_SLIP is not set 598# CONFIG_SLIP is not set
591# CONFIG_SHAPER is not set
592# CONFIG_NETCONSOLE is not set 599# CONFIG_NETCONSOLE is not set
593# CONFIG_NETPOLL is not set 600# CONFIG_NETPOLL is not set
594# CONFIG_NET_POLL_CONTROLLER is not set 601# CONFIG_NET_POLL_CONTROLLER is not set
595
596#
597# ISDN subsystem
598#
599# CONFIG_ISDN is not set 602# CONFIG_ISDN is not set
600
601#
602# Telephony Support
603#
604# CONFIG_PHONE is not set 603# CONFIG_PHONE is not set
605 604
606# 605#
@@ -618,15 +617,17 @@ CONFIG_NETDEV_10000=y
618# Character devices 617# Character devices
619# 618#
620# CONFIG_AD9960 is not set 619# CONFIG_AD9960 is not set
621# CONFIG_SPI_ADC_BF533 is not set 620CONFIG_BFIN_DMA_INTERFACE=m
622# CONFIG_BF5xx_PFLAGS is not set 621# CONFIG_BFIN_PPI is not set
623# CONFIG_BF5xx_PPIFCD is not set 622# CONFIG_BFIN_PPIFCD is not set
624# CONFIG_BFIN_SIMPLE_TIMER is not set 623# CONFIG_BFIN_SIMPLE_TIMER is not set
625# CONFIG_BF5xx_PPI is not set 624# CONFIG_BFIN_SPI_ADC is not set
626CONFIG_BFIN_SPORT=y 625CONFIG_BFIN_SPORT=y
627# CONFIG_BFIN_TIMER_LATENCY is not set 626# CONFIG_BFIN_TIMER_LATENCY is not set
627# CONFIG_SIMPLE_GPIO is not set
628# CONFIG_VT is not set 628# CONFIG_VT is not set
629# CONFIG_DEVKMEM is not set 629# CONFIG_DEVKMEM is not set
630# CONFIG_BFIN_JTAG_COMM is not set
630# CONFIG_SERIAL_NONSTANDARD is not set 631# CONFIG_SERIAL_NONSTANDARD is not set
631 632
632# 633#
@@ -655,138 +656,119 @@ CONFIG_UNIX98_PTYS=y
655# CAN, the car bus and industrial fieldbus 656# CAN, the car bus and industrial fieldbus
656# 657#
657# CONFIG_CAN4LINUX is not set 658# CONFIG_CAN4LINUX is not set
658
659#
660# IPMI
661#
662# CONFIG_IPMI_HANDLER is not set 659# CONFIG_IPMI_HANDLER is not set
663# CONFIG_WATCHDOG is not set
664# CONFIG_HW_RANDOM is not set 660# CONFIG_HW_RANDOM is not set
665# CONFIG_GEN_RTC is not set
666# CONFIG_R3964 is not set 661# CONFIG_R3964 is not set
667# CONFIG_RAW_DRIVER is not set 662# CONFIG_RAW_DRIVER is not set
663# CONFIG_TCG_TPM is not set
664# CONFIG_I2C is not set
665# CONFIG_SPI is not set
666CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
667CONFIG_GPIOLIB=y
668CONFIG_GPIO_SYSFS=y
668 669
669# 670#
670# TPM devices 671# Memory mapped GPIO expanders:
671# 672#
672# CONFIG_TCG_TPM is not set
673# CONFIG_I2C is not set
674 673
675# 674#
676# SPI support 675# I2C GPIO expanders:
676#
677
678#
679# PCI GPIO expanders:
677# 680#
678# CONFIG_SPI is not set
679# CONFIG_SPI_MASTER is not set
680 681
681# 682#
682# Dallas's 1-wire bus 683# SPI GPIO expanders:
683# 684#
684# CONFIG_W1 is not set 685# CONFIG_W1 is not set
686# CONFIG_POWER_SUPPLY is not set
685CONFIG_HWMON=y 687CONFIG_HWMON=y
686# CONFIG_HWMON_VID is not set 688# CONFIG_HWMON_VID is not set
687# CONFIG_SENSORS_ABITUGURU is not set
688# CONFIG_SENSORS_F71805F is not set 689# CONFIG_SENSORS_F71805F is not set
690# CONFIG_SENSORS_F71882FG is not set
691# CONFIG_SENSORS_IT87 is not set
692# CONFIG_SENSORS_PC87360 is not set
689# CONFIG_SENSORS_PC87427 is not set 693# CONFIG_SENSORS_PC87427 is not set
690# CONFIG_SENSORS_SMSC47M1 is not set 694# CONFIG_SENSORS_SMSC47M1 is not set
691# CONFIG_SENSORS_SMSC47B397 is not set 695# CONFIG_SENSORS_SMSC47B397 is not set
692# CONFIG_SENSORS_VT1211 is not set 696# CONFIG_SENSORS_VT1211 is not set
693# CONFIG_SENSORS_W83627HF is not set 697# CONFIG_SENSORS_W83627HF is not set
698# CONFIG_SENSORS_W83627EHF is not set
694# CONFIG_HWMON_DEBUG_CHIP is not set 699# CONFIG_HWMON_DEBUG_CHIP is not set
700# CONFIG_THERMAL is not set
701# CONFIG_THERMAL_HWMON is not set
702# CONFIG_WATCHDOG is not set
703CONFIG_SSB_POSSIBLE=y
704
705#
706# Sonics Silicon Backplane
707#
708# CONFIG_SSB is not set
695 709
696# 710#
697# Multifunction device drivers 711# Multifunction device drivers
698# 712#
713# CONFIG_MFD_CORE is not set
699# CONFIG_MFD_SM501 is not set 714# CONFIG_MFD_SM501 is not set
715# CONFIG_HTC_PASIC3 is not set
716# CONFIG_MFD_TMIO is not set
717# CONFIG_REGULATOR is not set
700 718
701# 719#
702# Multimedia devices 720# Multimedia devices
703# 721#
722
723#
724# Multimedia core support
725#
704# CONFIG_VIDEO_DEV is not set 726# CONFIG_VIDEO_DEV is not set
705# CONFIG_DVB_CORE is not set 727# CONFIG_DVB_CORE is not set
706# CONFIG_DAB is not set 728# CONFIG_VIDEO_MEDIA is not set
707 729
708# 730#
709# Graphics support 731# Multimedia drivers
710# 732#
711# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 733# CONFIG_DAB is not set
712 734
713# 735#
714# Display device support 736# Graphics support
715# 737#
716# CONFIG_DISPLAY_SUPPORT is not set
717# CONFIG_VGASTATE is not set 738# CONFIG_VGASTATE is not set
739# CONFIG_VIDEO_OUTPUT_CONTROL is not set
718# CONFIG_FB is not set 740# CONFIG_FB is not set
741# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
719 742
720# 743#
721# Sound 744# Display device support
722# 745#
746# CONFIG_DISPLAY_SUPPORT is not set
723# CONFIG_SOUND is not set 747# CONFIG_SOUND is not set
724 748CONFIG_USB_SUPPORT=y
725#
726# USB support
727#
728CONFIG_USB_ARCH_HAS_HCD=y 749CONFIG_USB_ARCH_HAS_HCD=y
729# CONFIG_USB_ARCH_HAS_OHCI is not set 750# CONFIG_USB_ARCH_HAS_OHCI is not set
730# CONFIG_USB_ARCH_HAS_EHCI is not set 751# CONFIG_USB_ARCH_HAS_EHCI is not set
731# CONFIG_USB is not set 752# CONFIG_USB is not set
753# CONFIG_USB_OTG_WHITELIST is not set
754# CONFIG_USB_OTG_BLACKLIST_HUB is not set
732 755
733# 756#
734# Enable Host or Gadget support to see Inventra options 757# Enable Host or Gadget support to see Inventra options
735# 758#
736 759
737# 760#
738# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 761# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
739#
740
741#
742# USB Gadget Support
743# 762#
744# CONFIG_USB_GADGET is not set 763# CONFIG_USB_GADGET is not set
745# CONFIG_MMC is not set 764# CONFIG_MMC is not set
746 765# CONFIG_MEMSTICK is not set
747#
748# LED devices
749#
750# CONFIG_NEW_LEDS is not set 766# CONFIG_NEW_LEDS is not set
751 767# CONFIG_ACCESSIBILITY is not set
752#
753# LED drivers
754#
755
756#
757# LED Triggers
758#
759
760#
761# InfiniBand support
762#
763
764#
765# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
766#
767
768#
769# Real Time Clock
770#
771# CONFIG_RTC_CLASS is not set 768# CONFIG_RTC_CLASS is not set
772 769# CONFIG_DMADEVICES is not set
773# 770# CONFIG_UIO is not set
774# DMA Engine support 771# CONFIG_STAGING is not set
775#
776# CONFIG_DMA_ENGINE is not set
777
778#
779# DMA Clients
780#
781
782#
783# DMA Devices
784#
785
786#
787# PBX support
788#
789# CONFIG_PBX is not set
790 772
791# 773#
792# File systems 774# File systems
@@ -796,20 +778,18 @@ CONFIG_EXT2_FS_XATTR=y
796# CONFIG_EXT2_FS_POSIX_ACL is not set 778# CONFIG_EXT2_FS_POSIX_ACL is not set
797# CONFIG_EXT2_FS_SECURITY is not set 779# CONFIG_EXT2_FS_SECURITY is not set
798# CONFIG_EXT3_FS is not set 780# CONFIG_EXT3_FS is not set
799# CONFIG_EXT4DEV_FS is not set 781# CONFIG_EXT4_FS is not set
800CONFIG_FS_MBCACHE=y 782CONFIG_FS_MBCACHE=y
801# CONFIG_REISERFS_FS is not set 783# CONFIG_REISERFS_FS is not set
802# CONFIG_JFS_FS is not set 784# CONFIG_JFS_FS is not set
803# CONFIG_FS_POSIX_ACL is not set 785# CONFIG_FS_POSIX_ACL is not set
786CONFIG_FILE_LOCKING=y
804# CONFIG_XFS_FS is not set 787# CONFIG_XFS_FS is not set
805# CONFIG_GFS2_FS is not set
806# CONFIG_OCFS2_FS is not set 788# CONFIG_OCFS2_FS is not set
807# CONFIG_MINIX_FS is not set 789# CONFIG_DNOTIFY is not set
808# CONFIG_ROMFS_FS is not set
809CONFIG_INOTIFY=y 790CONFIG_INOTIFY=y
810CONFIG_INOTIFY_USER=y 791CONFIG_INOTIFY_USER=y
811# CONFIG_QUOTA is not set 792# CONFIG_QUOTA is not set
812# CONFIG_DNOTIFY is not set
813# CONFIG_AUTOFS_FS is not set 793# CONFIG_AUTOFS_FS is not set
814# CONFIG_AUTOFS4_FS is not set 794# CONFIG_AUTOFS4_FS is not set
815# CONFIG_FUSE_FS is not set 795# CONFIG_FUSE_FS is not set
@@ -835,7 +815,6 @@ CONFIG_PROC_SYSCTL=y
835CONFIG_SYSFS=y 815CONFIG_SYSFS=y
836# CONFIG_TMPFS is not set 816# CONFIG_TMPFS is not set
837# CONFIG_HUGETLB_PAGE is not set 817# CONFIG_HUGETLB_PAGE is not set
838CONFIG_RAMFS=y
839# CONFIG_CONFIGFS_FS is not set 818# CONFIG_CONFIGFS_FS is not set
840 819
841# 820#
@@ -848,60 +827,53 @@ CONFIG_RAMFS=y
848# CONFIG_BEFS_FS is not set 827# CONFIG_BEFS_FS is not set
849# CONFIG_BFS_FS is not set 828# CONFIG_BFS_FS is not set
850# CONFIG_EFS_FS is not set 829# CONFIG_EFS_FS is not set
851# CONFIG_YAFFS_FS is not set
852# CONFIG_JFFS2_FS is not set 830# CONFIG_JFFS2_FS is not set
831# CONFIG_YAFFS_FS is not set
853# CONFIG_CRAMFS is not set 832# CONFIG_CRAMFS is not set
854# CONFIG_VXFS_FS is not set 833# CONFIG_VXFS_FS is not set
834# CONFIG_MINIX_FS is not set
835# CONFIG_OMFS_FS is not set
855# CONFIG_HPFS_FS is not set 836# CONFIG_HPFS_FS is not set
856# CONFIG_QNX4FS_FS is not set 837# CONFIG_QNX4FS_FS is not set
838# CONFIG_ROMFS_FS is not set
857# CONFIG_SYSV_FS is not set 839# CONFIG_SYSV_FS is not set
858# CONFIG_UFS_FS is not set 840# CONFIG_UFS_FS is not set
859 841# CONFIG_NETWORK_FILESYSTEMS is not set
860#
861# Network File Systems
862#
863# CONFIG_NFS_FS is not set
864# CONFIG_NFSD is not set
865# CONFIG_SMB_FS is not set
866# CONFIG_CIFS is not set
867# CONFIG_NCP_FS is not set
868# CONFIG_CODA_FS is not set
869# CONFIG_AFS_FS is not set
870# CONFIG_9P_FS is not set
871 842
872# 843#
873# Partition Types 844# Partition Types
874# 845#
875# CONFIG_PARTITION_ADVANCED is not set 846# CONFIG_PARTITION_ADVANCED is not set
876CONFIG_MSDOS_PARTITION=y 847CONFIG_MSDOS_PARTITION=y
877
878#
879# Native Language Support
880#
881# CONFIG_NLS is not set 848# CONFIG_NLS is not set
882
883#
884# Distributed Lock Manager
885#
886# CONFIG_DLM is not set 849# CONFIG_DLM is not set
887 850
888# 851#
889# Profiling support
890#
891# CONFIG_PROFILING is not set
892
893#
894# Kernel hacking 852# Kernel hacking
895# 853#
896# CONFIG_PRINTK_TIME is not set 854# CONFIG_PRINTK_TIME is not set
855CONFIG_ENABLE_WARN_DEPRECATED=y
897CONFIG_ENABLE_MUST_CHECK=y 856CONFIG_ENABLE_MUST_CHECK=y
857CONFIG_FRAME_WARN=1024
898# CONFIG_MAGIC_SYSRQ is not set 858# CONFIG_MAGIC_SYSRQ is not set
899# CONFIG_UNUSED_SYMBOLS is not set 859# CONFIG_UNUSED_SYMBOLS is not set
900CONFIG_DEBUG_FS=y 860CONFIG_DEBUG_FS=y
901# CONFIG_HEADERS_CHECK is not set 861# CONFIG_HEADERS_CHECK is not set
862CONFIG_DEBUG_SECTION_MISMATCH=y
902# CONFIG_DEBUG_KERNEL is not set 863# CONFIG_DEBUG_KERNEL is not set
903# CONFIG_DEBUG_BUGVERBOSE is not set 864# CONFIG_DEBUG_BUGVERBOSE is not set
865# CONFIG_DEBUG_MEMORY_INIT is not set
866# CONFIG_RCU_CPU_STALL_DETECTOR is not set
867
868#
869# Tracers
870#
871# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
872# CONFIG_SAMPLES is not set
873CONFIG_HAVE_ARCH_KGDB=y
874CONFIG_DEBUG_VERBOSE=y
904CONFIG_DEBUG_MMRS=y 875CONFIG_DEBUG_MMRS=y
876# CONFIG_DEBUG_DOUBLEFAULT is not set
905CONFIG_DEBUG_HUNT_FOR_ZERO=y 877CONFIG_DEBUG_HUNT_FOR_ZERO=y
906CONFIG_DEBUG_BFIN_HWTRACE_ON=y 878CONFIG_DEBUG_BFIN_HWTRACE_ON=y
907CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 879CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -919,13 +891,95 @@ CONFIG_ACCESS_CHECK=y
919# 891#
920# CONFIG_KEYS is not set 892# CONFIG_KEYS is not set
921CONFIG_SECURITY=y 893CONFIG_SECURITY=y
894# CONFIG_SECURITYFS is not set
922# CONFIG_SECURITY_NETWORK is not set 895# CONFIG_SECURITY_NETWORK is not set
923CONFIG_SECURITY_CAPABILITIES=y 896# CONFIG_SECURITY_FILE_CAPABILITIES is not set
897CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
898CONFIG_CRYPTO=y
899
900#
901# Crypto core or helper
902#
903# CONFIG_CRYPTO_FIPS is not set
904# CONFIG_CRYPTO_MANAGER is not set
905# CONFIG_CRYPTO_MANAGER2 is not set
906# CONFIG_CRYPTO_GF128MUL is not set
907# CONFIG_CRYPTO_NULL is not set
908# CONFIG_CRYPTO_CRYPTD is not set
909# CONFIG_CRYPTO_AUTHENC is not set
910# CONFIG_CRYPTO_TEST is not set
911
912#
913# Authenticated Encryption with Associated Data
914#
915# CONFIG_CRYPTO_CCM is not set
916# CONFIG_CRYPTO_GCM is not set
917# CONFIG_CRYPTO_SEQIV is not set
918
919#
920# Block modes
921#
922# CONFIG_CRYPTO_CBC is not set
923# CONFIG_CRYPTO_CTR is not set
924# CONFIG_CRYPTO_CTS is not set
925# CONFIG_CRYPTO_ECB is not set
926# CONFIG_CRYPTO_LRW is not set
927# CONFIG_CRYPTO_PCBC is not set
928# CONFIG_CRYPTO_XTS is not set
929
930#
931# Hash modes
932#
933# CONFIG_CRYPTO_HMAC is not set
934# CONFIG_CRYPTO_XCBC is not set
935
936#
937# Digest
938#
939# CONFIG_CRYPTO_CRC32C is not set
940# CONFIG_CRYPTO_MD4 is not set
941# CONFIG_CRYPTO_MD5 is not set
942# CONFIG_CRYPTO_MICHAEL_MIC is not set
943# CONFIG_CRYPTO_RMD128 is not set
944# CONFIG_CRYPTO_RMD160 is not set
945# CONFIG_CRYPTO_RMD256 is not set
946# CONFIG_CRYPTO_RMD320 is not set
947# CONFIG_CRYPTO_SHA1 is not set
948# CONFIG_CRYPTO_SHA256 is not set
949# CONFIG_CRYPTO_SHA512 is not set
950# CONFIG_CRYPTO_TGR192 is not set
951# CONFIG_CRYPTO_WP512 is not set
952
953#
954# Ciphers
955#
956# CONFIG_CRYPTO_AES is not set
957# CONFIG_CRYPTO_ANUBIS is not set
958# CONFIG_CRYPTO_ARC4 is not set
959# CONFIG_CRYPTO_BLOWFISH is not set
960# CONFIG_CRYPTO_CAMELLIA is not set
961# CONFIG_CRYPTO_CAST5 is not set
962# CONFIG_CRYPTO_CAST6 is not set
963# CONFIG_CRYPTO_DES is not set
964# CONFIG_CRYPTO_FCRYPT is not set
965# CONFIG_CRYPTO_KHAZAD is not set
966# CONFIG_CRYPTO_SALSA20 is not set
967# CONFIG_CRYPTO_SEED is not set
968# CONFIG_CRYPTO_SERPENT is not set
969# CONFIG_CRYPTO_TEA is not set
970# CONFIG_CRYPTO_TWOFISH is not set
971
972#
973# Compression
974#
975# CONFIG_CRYPTO_DEFLATE is not set
976# CONFIG_CRYPTO_LZO is not set
924 977
925# 978#
926# Cryptographic options 979# Random Number Generation
927# 980#
928# CONFIG_CRYPTO is not set 981# CONFIG_CRYPTO_ANSI_CPRNG is not set
982CONFIG_CRYPTO_HW=y
929 983
930# 984#
931# Library routines 985# Library routines
@@ -933,11 +987,12 @@ CONFIG_SECURITY_CAPABILITIES=y
933CONFIG_BITREVERSE=y 987CONFIG_BITREVERSE=y
934CONFIG_CRC_CCITT=m 988CONFIG_CRC_CCITT=m
935# CONFIG_CRC16 is not set 989# CONFIG_CRC16 is not set
990# CONFIG_CRC_T10DIF is not set
936# CONFIG_CRC_ITU_T is not set 991# CONFIG_CRC_ITU_T is not set
937CONFIG_CRC32=y 992CONFIG_CRC32=y
993# CONFIG_CRC7 is not set
938# CONFIG_LIBCRC32C is not set 994# CONFIG_LIBCRC32C is not set
939CONFIG_ZLIB_INFLATE=y 995CONFIG_ZLIB_INFLATE=y
940CONFIG_PLIST=y
941CONFIG_HAS_IOMEM=y 996CONFIG_HAS_IOMEM=y
942CONFIG_HAS_IOPORT=y 997CONFIG_HAS_IOPORT=y
943CONFIG_HAS_DMA=y 998CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/CM-BF537U_defconfig b/arch/blackfin/configs/CM-BF537U_defconfig
index 569523c1c034..80211303f6b9 100644
--- a/arch/blackfin/configs/CM-BF537U_defconfig
+++ b/arch/blackfin/configs/CM-BF537U_defconfig
@@ -49,7 +49,7 @@ CONFIG_LOG_BUF_SHIFT=14
49# CONFIG_SYSCTL is not set 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52# CONFIG_SYSCTL_SYSCALL is not set
53CONFIG_KALLSYMS=y 53CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 54# CONFIG_KALLSYMS_EXTRA_PASS is not set
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
@@ -355,7 +355,7 @@ CONFIG_IP_FIB_HASH=y
355# CONFIG_NET_IPIP is not set 355# CONFIG_NET_IPIP is not set
356# CONFIG_NET_IPGRE is not set 356# CONFIG_NET_IPGRE is not set
357# CONFIG_ARPD is not set 357# CONFIG_ARPD is not set
358CONFIG_SYN_COOKIES=y 358# CONFIG_SYN_COOKIES is not set
359# CONFIG_INET_AH is not set 359# CONFIG_INET_AH is not set
360# CONFIG_INET_ESP is not set 360# CONFIG_INET_ESP is not set
361# CONFIG_INET_IPCOMP is not set 361# CONFIG_INET_IPCOMP is not set
@@ -556,9 +556,9 @@ CONFIG_SMC91X=y
556# CONFIG_BFIN_MAC is not set 556# CONFIG_BFIN_MAC is not set
557# CONFIG_SMSC911X is not set 557# CONFIG_SMSC911X is not set
558# CONFIG_DM9000 is not set 558# CONFIG_DM9000 is not set
559CONFIG_NETDEV_1000=y 559# CONFIG_NETDEV_1000 is not set
560# CONFIG_AX88180 is not set 560# CONFIG_AX88180 is not set
561CONFIG_NETDEV_10000=y 561# CONFIG_NETDEV_10000 is not set
562 562
563# 563#
564# Wireless LAN 564# Wireless LAN
@@ -652,6 +652,10 @@ CONFIG_UNIX98_PTYS=y
652# CONFIG_TCG_TPM is not set 652# CONFIG_TCG_TPM is not set
653# CONFIG_I2C is not set 653# CONFIG_I2C is not set
654 654
655CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
656CONFIG_GPIOLIB=y
657CONFIG_GPIO_SYSFS=y
658
655# 659#
656# SPI support 660# SPI support
657# 661#
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig
index 035b635e599c..dd815f0d1517 100644
--- a/arch/blackfin/configs/CM-BF548_defconfig
+++ b/arch/blackfin/configs/CM-BF548_defconfig
@@ -49,7 +49,7 @@ CONFIG_INITRAMFS_SOURCE=""
49# CONFIG_SYSCTL is not set 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51CONFIG_UID16=y 51CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 52# CONFIG_SYSCTL_SYSCALL is not set
53CONFIG_KALLSYMS=y 53CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 54# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 55CONFIG_HOTPLUG=y
@@ -125,9 +125,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
125CONFIG_BF548=y 125CONFIG_BF548=y
126# CONFIG_BF549 is not set 126# CONFIG_BF549 is not set
127# CONFIG_BF561 is not set 127# CONFIG_BF561 is not set
128CONFIG_BF_REV_0_0=y 128# CONFIG_BF_REV_0_0 is not set
129# CONFIG_BF_REV_0_1 is not set 129# CONFIG_BF_REV_0_1 is not set
130# CONFIG_BF_REV_0_2 is not set 130CONFIG_BF_REV_0_2=y
131# CONFIG_BF_REV_0_3 is not set 131# CONFIG_BF_REV_0_3 is not set
132# CONFIG_BF_REV_0_4 is not set 132# CONFIG_BF_REV_0_4 is not set
133# CONFIG_BF_REV_0_5 is not set 133# CONFIG_BF_REV_0_5 is not set
@@ -422,7 +422,7 @@ CONFIG_IP_PNP=y
422# CONFIG_NET_IPIP is not set 422# CONFIG_NET_IPIP is not set
423# CONFIG_NET_IPGRE is not set 423# CONFIG_NET_IPGRE is not set
424# CONFIG_ARPD is not set 424# CONFIG_ARPD is not set
425CONFIG_SYN_COOKIES=y 425# CONFIG_SYN_COOKIES is not set
426# CONFIG_INET_AH is not set 426# CONFIG_INET_AH is not set
427# CONFIG_INET_ESP is not set 427# CONFIG_INET_ESP is not set
428# CONFIG_INET_IPCOMP is not set 428# CONFIG_INET_IPCOMP is not set
@@ -811,6 +811,10 @@ CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
811# CONFIG_I2C_DEBUG_BUS is not set 811# CONFIG_I2C_DEBUG_BUS is not set
812# CONFIG_I2C_DEBUG_CHIP is not set 812# CONFIG_I2C_DEBUG_CHIP is not set
813 813
814CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
815CONFIG_GPIOLIB=y
816CONFIG_GPIO_SYSFS=y
817
814# 818#
815# SPI support 819# SPI support
816# 820#
diff --git a/arch/blackfin/configs/CM-BF561_defconfig b/arch/blackfin/configs/CM-BF561_defconfig
index 7015e42ccce5..16c198bd40c5 100644
--- a/arch/blackfin/configs/CM-BF561_defconfig
+++ b/arch/blackfin/configs/CM-BF561_defconfig
@@ -49,7 +49,7 @@ CONFIG_FAIR_USER_SCHED=y
49# CONFIG_SYSCTL is not set 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52# CONFIG_SYSCTL_SYSCALL is not set
53CONFIG_KALLSYMS=y 53CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 54# CONFIG_KALLSYMS_EXTRA_PASS is not set
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
@@ -389,7 +389,7 @@ CONFIG_IP_FIB_HASH=y
389# CONFIG_NET_IPIP is not set 389# CONFIG_NET_IPIP is not set
390# CONFIG_NET_IPGRE is not set 390# CONFIG_NET_IPGRE is not set
391# CONFIG_ARPD is not set 391# CONFIG_ARPD is not set
392CONFIG_SYN_COOKIES=y 392# CONFIG_SYN_COOKIES is not set
393# CONFIG_INET_AH is not set 393# CONFIG_INET_AH is not set
394# CONFIG_INET_ESP is not set 394# CONFIG_INET_ESP is not set
395# CONFIG_INET_IPCOMP is not set 395# CONFIG_INET_IPCOMP is not set
@@ -569,9 +569,9 @@ CONFIG_SMC91X=y
569# CONFIG_IBM_NEW_EMAC_TAH is not set 569# CONFIG_IBM_NEW_EMAC_TAH is not set
570# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 570# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
571# CONFIG_B44 is not set 571# CONFIG_B44 is not set
572CONFIG_NETDEV_1000=y 572# CONFIG_NETDEV_1000 is not set
573# CONFIG_AX88180 is not set 573# CONFIG_AX88180 is not set
574CONFIG_NETDEV_10000=y 574# CONFIG_NETDEV_10000 is not set
575 575
576# 576#
577# Wireless LAN 577# Wireless LAN
@@ -646,6 +646,10 @@ CONFIG_UNIX98_PTYS=y
646# CONFIG_TCG_TPM is not set 646# CONFIG_TCG_TPM is not set
647# CONFIG_I2C is not set 647# CONFIG_I2C is not set
648 648
649CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
650CONFIG_GPIOLIB=y
651CONFIG_GPIO_SYSFS=y
652
649# 653#
650# SPI support 654# SPI support
651# 655#
diff --git a/arch/blackfin/configs/H8606_defconfig b/arch/blackfin/configs/H8606_defconfig
index dfc8e1ddd77a..6b4c1a982383 100644
--- a/arch/blackfin/configs/H8606_defconfig
+++ b/arch/blackfin/configs/H8606_defconfig
@@ -48,7 +48,7 @@ CONFIG_SYSFS_DEPRECATED=y
48# CONFIG_SYSCTL is not set 48# CONFIG_SYSCTL is not set
49CONFIG_EMBEDDED=y 49CONFIG_EMBEDDED=y
50CONFIG_UID16=y 50CONFIG_UID16=y
51CONFIG_SYSCTL_SYSCALL=y 51# CONFIG_SYSCTL_SYSCALL is not set
52CONFIG_KALLSYMS=y 52CONFIG_KALLSYMS=y
53# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
54CONFIG_HOTPLUG=y 54CONFIG_HOTPLUG=y
@@ -347,7 +347,7 @@ CONFIG_IP_PNP=y
347# CONFIG_NET_IPIP is not set 347# CONFIG_NET_IPIP is not set
348# CONFIG_NET_IPGRE is not set 348# CONFIG_NET_IPGRE is not set
349# CONFIG_ARPD is not set 349# CONFIG_ARPD is not set
350CONFIG_SYN_COOKIES=y 350# CONFIG_SYN_COOKIES is not set
351# CONFIG_INET_AH is not set 351# CONFIG_INET_AH is not set
352# CONFIG_INET_ESP is not set 352# CONFIG_INET_ESP is not set
353# CONFIG_INET_IPCOMP is not set 353# CONFIG_INET_IPCOMP is not set
@@ -594,8 +594,8 @@ CONFIG_MII=y
594# CONFIG_SMC91X is not set 594# CONFIG_SMC91X is not set
595# CONFIG_SMSC911X is not set 595# CONFIG_SMSC911X is not set
596CONFIG_DM9000=y 596CONFIG_DM9000=y
597CONFIG_NETDEV_1000=y 597# CONFIG_NETDEV_1000 is not set
598CONFIG_NETDEV_10000=y 598# CONFIG_NETDEV_10000 is not set
599# CONFIG_AX88180 is not set 599# CONFIG_AX88180 is not set
600 600
601# 601#
diff --git a/arch/blackfin/configs/IP0X_defconfig b/arch/blackfin/configs/IP0X_defconfig
index 95a5f91aebaa..1ec9ae2e964b 100644
--- a/arch/blackfin/configs/IP0X_defconfig
+++ b/arch/blackfin/configs/IP0X_defconfig
@@ -49,7 +49,7 @@ CONFIG_INITRAMFS_SOURCE=""
49# CONFIG_SYSCTL is not set 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51CONFIG_UID16=y 51CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 52# CONFIG_SYSCTL_SYSCALL is not set
53CONFIG_KALLSYMS=y 53CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 54# CONFIG_KALLSYMS_EXTRA_PASS is not set
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
@@ -355,7 +355,7 @@ CONFIG_IP_PNP=y
355# CONFIG_NET_IPIP is not set 355# CONFIG_NET_IPIP is not set
356# CONFIG_NET_IPGRE is not set 356# CONFIG_NET_IPGRE is not set
357# CONFIG_ARPD is not set 357# CONFIG_ARPD is not set
358CONFIG_SYN_COOKIES=y 358# CONFIG_SYN_COOKIES is not set
359# CONFIG_INET_AH is not set 359# CONFIG_INET_AH is not set
360# CONFIG_INET_ESP is not set 360# CONFIG_INET_ESP is not set
361# CONFIG_INET_IPCOMP is not set 361# CONFIG_INET_IPCOMP is not set
@@ -672,9 +672,9 @@ CONFIG_MII=y
672# CONFIG_SMC91X is not set 672# CONFIG_SMC91X is not set
673# CONFIG_SMSC911X is not set 673# CONFIG_SMSC911X is not set
674CONFIG_DM9000=y 674CONFIG_DM9000=y
675CONFIG_NETDEV_1000=y 675# CONFIG_NETDEV_1000 is not set
676# CONFIG_AX88180 is not set 676# CONFIG_AX88180 is not set
677CONFIG_NETDEV_10000=y 677# CONFIG_NETDEV_10000 is not set
678 678
679# 679#
680# Wireless LAN 680# Wireless LAN
diff --git a/arch/blackfin/configs/PNAV-10_defconfig b/arch/blackfin/configs/PNAV-10_defconfig
index 78e24080e7f1..09701f907e9b 100644
--- a/arch/blackfin/configs/PNAV-10_defconfig
+++ b/arch/blackfin/configs/PNAV-10_defconfig
@@ -1,6 +1,6 @@
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.7 3# Linux kernel version: 2.6.28.10
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -40,26 +40,26 @@ CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_NAMESPACES is not set 40# CONFIG_NAMESPACES is not set
41# CONFIG_BLK_DEV_INITRD is not set 41# CONFIG_BLK_DEV_INITRD is not set
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
43# CONFIG_SYSCTL is not set 43CONFIG_SYSCTL=y
44CONFIG_ANON_INODES=y
44CONFIG_EMBEDDED=y 45CONFIG_EMBEDDED=y
45CONFIG_UID16=y 46CONFIG_UID16=y
46CONFIG_SYSCTL_SYSCALL=y 47# CONFIG_SYSCTL_SYSCALL is not set
47CONFIG_KALLSYMS=y 48CONFIG_KALLSYMS=y
48# CONFIG_KALLSYMS_EXTRA_PASS is not set 49# CONFIG_KALLSYMS_EXTRA_PASS is not set
49CONFIG_HOTPLUG=y 50CONFIG_HOTPLUG=y
50CONFIG_PRINTK=y 51CONFIG_PRINTK=y
51CONFIG_BUG=y 52CONFIG_BUG=y
52# CONFIG_ELF_CORE is not set 53# CONFIG_ELF_CORE is not set
53CONFIG_COMPAT_BRK=y
54CONFIG_BASE_FULL=y 54CONFIG_BASE_FULL=y
55# CONFIG_FUTEX is not set 55# CONFIG_FUTEX is not set
56CONFIG_ANON_INODES=y
57CONFIG_EPOLL=y 56CONFIG_EPOLL=y
58CONFIG_SIGNALFD=y 57CONFIG_SIGNALFD=y
59CONFIG_TIMERFD=y 58CONFIG_TIMERFD=y
60CONFIG_EVENTFD=y 59CONFIG_EVENTFD=y
61# CONFIG_AIO is not set 60# CONFIG_AIO is not set
62CONFIG_VM_EVENT_COUNTERS=y 61CONFIG_VM_EVENT_COUNTERS=y
62CONFIG_COMPAT_BRK=y
63CONFIG_SLAB=y 63CONFIG_SLAB=y
64# CONFIG_SLUB is not set 64# CONFIG_SLUB is not set
65# CONFIG_SLOB is not set 65# CONFIG_SLOB is not set
@@ -68,7 +68,6 @@ CONFIG_SLAB=y
68CONFIG_HAVE_OPROFILE=y 68CONFIG_HAVE_OPROFILE=y
69# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 69# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
70CONFIG_SLABINFO=y 70CONFIG_SLABINFO=y
71CONFIG_RT_MUTEXES=y
72CONFIG_TINY_SHMEM=y 71CONFIG_TINY_SHMEM=y
73CONFIG_BASE_SMALL=0 72CONFIG_BASE_SMALL=0
74CONFIG_MODULES=y 73CONFIG_MODULES=y
@@ -229,7 +228,10 @@ CONFIG_HZ=250
229# CONFIG_SCHED_HRTICK is not set 228# CONFIG_SCHED_HRTICK is not set
230CONFIG_GENERIC_TIME=y 229CONFIG_GENERIC_TIME=y
231CONFIG_GENERIC_CLOCKEVENTS=y 230CONFIG_GENERIC_CLOCKEVENTS=y
231# CONFIG_TICKSOURCE_GPTMR0 is not set
232CONFIG_TICKSOURCE_CORETMR=y
232# CONFIG_CYCLES_CLOCKSOURCE is not set 233# CONFIG_CYCLES_CLOCKSOURCE is not set
234# CONFIG_GPTMR0_CLOCKSOURCE is not set
233# CONFIG_NO_HZ is not set 235# CONFIG_NO_HZ is not set
234# CONFIG_HIGH_RES_TIMERS is not set 236# CONFIG_HIGH_RES_TIMERS is not set
235CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 237CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -374,7 +376,7 @@ CONFIG_IP_PNP=y
374# CONFIG_NET_IPIP is not set 376# CONFIG_NET_IPIP is not set
375# CONFIG_NET_IPGRE is not set 377# CONFIG_NET_IPGRE is not set
376# CONFIG_ARPD is not set 378# CONFIG_ARPD is not set
377CONFIG_SYN_COOKIES=y 379# CONFIG_SYN_COOKIES is not set
378# CONFIG_INET_AH is not set 380# CONFIG_INET_AH is not set
379# CONFIG_INET_ESP is not set 381# CONFIG_INET_ESP is not set
380# CONFIG_INET_IPCOMP is not set 382# CONFIG_INET_IPCOMP is not set
@@ -598,9 +600,8 @@ CONFIG_BFIN_MAC_RMII=y
598# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 600# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
599# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 601# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
600# CONFIG_B44 is not set 602# CONFIG_B44 is not set
601CONFIG_NETDEV_1000=y 603# CONFIG_NETDEV_1000 is not set
602# CONFIG_AX88180 is not set 604# CONFIG_NETDEV_10000 is not set
603CONFIG_NETDEV_10000=y
604 605
605# 606#
606# Wireless LAN 607# Wireless LAN
@@ -640,11 +641,11 @@ CONFIG_INPUT_EVDEV=y
640# CONFIG_INPUT_JOYSTICK is not set 641# CONFIG_INPUT_JOYSTICK is not set
641# CONFIG_INPUT_TABLET is not set 642# CONFIG_INPUT_TABLET is not set
642CONFIG_INPUT_TOUCHSCREEN=y 643CONFIG_INPUT_TOUCHSCREEN=y
643# CONFIG_TOUCHSCREEN_ADS7846 is not set
644CONFIG_TOUCHSCREEN_AD7877=y 644CONFIG_TOUCHSCREEN_AD7877=y
645# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 645# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
646# CONFIG_TOUCHSCREEN_AD7879_SPI is not set 646# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
647# CONFIG_TOUCHSCREEN_AD7879 is not set 647# CONFIG_TOUCHSCREEN_AD7879 is not set
648# CONFIG_TOUCHSCREEN_ADS7846 is not set
648# CONFIG_TOUCHSCREEN_FUJITSU is not set 649# CONFIG_TOUCHSCREEN_FUJITSU is not set
649# CONFIG_TOUCHSCREEN_GUNZE is not set 650# CONFIG_TOUCHSCREEN_GUNZE is not set
650# CONFIG_TOUCHSCREEN_ELO is not set 651# CONFIG_TOUCHSCREEN_ELO is not set
@@ -676,14 +677,14 @@ CONFIG_INPUT_UINPUT=y
676# Character devices 677# Character devices
677# 678#
678# CONFIG_AD9960 is not set 679# CONFIG_AD9960 is not set
679# CONFIG_SPI_ADC_BF533 is not set 680CONFIG_BFIN_DMA_INTERFACE=m
680# CONFIG_BF5xx_PPIFCD is not set 681# CONFIG_BFIN_PPI is not set
682# CONFIG_BFIN_PPIFCD is not set
681# CONFIG_BFIN_SIMPLE_TIMER is not set 683# CONFIG_BFIN_SIMPLE_TIMER is not set
682# CONFIG_BF5xx_PPI is not set 684# CONFIG_BFIN_SPI_ADC is not set
683CONFIG_BFIN_SPORT=y 685CONFIG_BFIN_SPORT=y
684# CONFIG_BFIN_TIMER_LATENCY is not set 686# CONFIG_BFIN_TIMER_LATENCY is not set
685CONFIG_TWI_LCD=m 687# CONFIG_BFIN_TWI_LCD is not set
686CONFIG_BFIN_DMA_INTERFACE=m
687# CONFIG_SIMPLE_GPIO is not set 688# CONFIG_SIMPLE_GPIO is not set
688# CONFIG_VT is not set 689# CONFIG_VT is not set
689CONFIG_DEVKMEM=y 690CONFIG_DEVKMEM=y
@@ -796,6 +797,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
796# CONFIG_POWER_SUPPLY is not set 797# CONFIG_POWER_SUPPLY is not set
797CONFIG_HWMON=y 798CONFIG_HWMON=y
798# CONFIG_HWMON_VID is not set 799# CONFIG_HWMON_VID is not set
800# CONFIG_SENSORS_AD5252 is not set
799# CONFIG_SENSORS_AD7414 is not set 801# CONFIG_SENSORS_AD7414 is not set
800# CONFIG_SENSORS_AD7418 is not set 802# CONFIG_SENSORS_AD7418 is not set
801# CONFIG_SENSORS_ADCXX is not set 803# CONFIG_SENSORS_ADCXX is not set
@@ -867,6 +869,7 @@ CONFIG_SSB_POSSIBLE=y
867# CONFIG_HTC_PASIC3 is not set 869# CONFIG_HTC_PASIC3 is not set
868# CONFIG_MFD_TMIO is not set 870# CONFIG_MFD_TMIO is not set
869# CONFIG_PMIC_DA903X is not set 871# CONFIG_PMIC_DA903X is not set
872# CONFIG_PMIC_ADP5520 is not set
870# CONFIG_MFD_WM8400 is not set 873# CONFIG_MFD_WM8400 is not set
871# CONFIG_MFD_WM8350_I2C is not set 874# CONFIG_MFD_WM8350_I2C is not set
872# CONFIG_REGULATOR is not set 875# CONFIG_REGULATOR is not set
@@ -1111,6 +1114,7 @@ CONFIG_SYSFS=y
1111# CONFIG_BEFS_FS is not set 1114# CONFIG_BEFS_FS is not set
1112# CONFIG_BFS_FS is not set 1115# CONFIG_BFS_FS is not set
1113# CONFIG_EFS_FS is not set 1116# CONFIG_EFS_FS is not set
1117# CONFIG_JFFS2_FS is not set
1114CONFIG_YAFFS_FS=y 1118CONFIG_YAFFS_FS=y
1115CONFIG_YAFFS_YAFFS1=y 1119CONFIG_YAFFS_YAFFS1=y
1116# CONFIG_YAFFS_9BYTE_TAGS is not set 1120# CONFIG_YAFFS_9BYTE_TAGS is not set
@@ -1121,7 +1125,6 @@ CONFIG_YAFFS_AUTO_YAFFS2=y
1121# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 1125# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1122# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 1126# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1123CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 1127CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1124# CONFIG_JFFS2_FS is not set
1125# CONFIG_CRAMFS is not set 1128# CONFIG_CRAMFS is not set
1126# CONFIG_VXFS_FS is not set 1129# CONFIG_VXFS_FS is not set
1127# CONFIG_MINIX_FS is not set 1130# CONFIG_MINIX_FS is not set
@@ -1213,7 +1216,6 @@ CONFIG_FRAME_WARN=1024
1213# CONFIG_DEBUG_BUGVERBOSE is not set 1216# CONFIG_DEBUG_BUGVERBOSE is not set
1214# CONFIG_DEBUG_MEMORY_INIT is not set 1217# CONFIG_DEBUG_MEMORY_INIT is not set
1215# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1218# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1216# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1217 1219
1218# 1220#
1219# Tracers 1221# Tracers
@@ -1343,7 +1345,6 @@ CONFIG_CRC32=y
1343# CONFIG_CRC7 is not set 1345# CONFIG_CRC7 is not set
1344# CONFIG_LIBCRC32C is not set 1346# CONFIG_LIBCRC32C is not set
1345CONFIG_ZLIB_INFLATE=y 1347CONFIG_ZLIB_INFLATE=y
1346CONFIG_PLIST=y
1347CONFIG_HAS_IOMEM=y 1348CONFIG_HAS_IOMEM=y
1348CONFIG_HAS_IOPORT=y 1349CONFIG_HAS_IOPORT=y
1349CONFIG_HAS_DMA=y 1350CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/SRV1_defconfig b/arch/blackfin/configs/SRV1_defconfig
index 2bc0779d22ea..ec84a53daae9 100644
--- a/arch/blackfin/configs/SRV1_defconfig
+++ b/arch/blackfin/configs/SRV1_defconfig
@@ -52,7 +52,7 @@ CONFIG_INITRAMFS_SOURCE=""
52# CONFIG_SYSCTL is not set 52# CONFIG_SYSCTL is not set
53CONFIG_EMBEDDED=y 53CONFIG_EMBEDDED=y
54CONFIG_UID16=y 54CONFIG_UID16=y
55CONFIG_SYSCTL_SYSCALL=y 55# CONFIG_SYSCTL_SYSCALL is not set
56CONFIG_KALLSYMS=y 56CONFIG_KALLSYMS=y
57CONFIG_KALLSYMS_ALL=y 57CONFIG_KALLSYMS_ALL=y
58# CONFIG_KALLSYMS_EXTRA_PASS is not set 58# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -373,7 +373,7 @@ CONFIG_IP_PNP=y
373# CONFIG_NET_IPIP is not set 373# CONFIG_NET_IPIP is not set
374# CONFIG_NET_IPGRE is not set 374# CONFIG_NET_IPGRE is not set
375# CONFIG_ARPD is not set 375# CONFIG_ARPD is not set
376CONFIG_SYN_COOKIES=y 376# CONFIG_SYN_COOKIES is not set
377# CONFIG_INET_AH is not set 377# CONFIG_INET_AH is not set
378# CONFIG_INET_ESP is not set 378# CONFIG_INET_ESP is not set
379# CONFIG_INET_IPCOMP is not set 379# CONFIG_INET_IPCOMP is not set
diff --git a/arch/blackfin/configs/TCM-BF537_defconfig b/arch/blackfin/configs/TCM-BF537_defconfig
index e65b3a49214f..6e2796240fdc 100644
--- a/arch/blackfin/configs/TCM-BF537_defconfig
+++ b/arch/blackfin/configs/TCM-BF537_defconfig
@@ -42,7 +42,7 @@ CONFIG_LOG_BUF_SHIFT=14
42# CONFIG_SYSCTL is not set 42# CONFIG_SYSCTL is not set
43CONFIG_EMBEDDED=y 43CONFIG_EMBEDDED=y
44# CONFIG_UID16 is not set 44# CONFIG_UID16 is not set
45CONFIG_SYSCTL_SYSCALL=y 45# CONFIG_SYSCTL_SYSCALL is not set
46CONFIG_KALLSYMS=y 46CONFIG_KALLSYMS=y
47# CONFIG_KALLSYMS_EXTRA_PASS is not set 47# CONFIG_KALLSYMS_EXTRA_PASS is not set
48# CONFIG_HOTPLUG is not set 48# CONFIG_HOTPLUG is not set
@@ -537,7 +537,30 @@ CONFIG_SPI_BFIN=y
537# CONFIG_SPI_SPIDEV is not set 537# CONFIG_SPI_SPIDEV is not set
538# CONFIG_SPI_TLE62X0 is not set 538# CONFIG_SPI_TLE62X0 is not set
539CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 539CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
540# CONFIG_GPIOLIB is not set 540CONFIG_GPIOLIB=y
541# CONFIG_DEBUG_GPIO is not set
542CONFIG_GPIO_SYSFS=y
543
544#
545# Memory mapped GPIO expanders:
546#
547
548#
549# I2C GPIO expanders:
550#
551# CONFIG_GPIO_MAX732X is not set
552# CONFIG_GPIO_PCA953X is not set
553# CONFIG_GPIO_PCF857X is not set
554
555#
556# PCI GPIO expanders:
557#
558
559#
560# SPI GPIO expanders:
561#
562# CONFIG_GPIO_MAX7301 is not set
563# CONFIG_GPIO_MCP23S08 is not set
541# CONFIG_W1 is not set 564# CONFIG_W1 is not set
542# CONFIG_POWER_SUPPLY is not set 565# CONFIG_POWER_SUPPLY is not set
543# CONFIG_HWMON is not set 566# CONFIG_HWMON is not set
diff --git a/arch/blackfin/include/asm/atomic.h b/arch/blackfin/include/asm/atomic.h
index 94b2a9b19451..7bbf44e4ddf9 100644
--- a/arch/blackfin/include/asm/atomic.h
+++ b/arch/blackfin/include/asm/atomic.h
@@ -208,6 +208,6 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
208#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) 208#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
209#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 209#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
210 210
211#include <asm-generic/atomic.h> 211#include <asm-generic/atomic-long.h>
212 212
213#endif /* __ARCH_BLACKFIN_ATOMIC __ */ 213#endif /* __ARCH_BLACKFIN_ATOMIC __ */
diff --git a/arch/blackfin/include/asm/bitsperlong.h b/arch/blackfin/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/blackfin/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/blackfin/include/asm/cacheflush.h b/arch/blackfin/include/asm/cacheflush.h
index 1b040f5b4feb..94697f0f6f40 100644
--- a/arch/blackfin/include/asm/cacheflush.h
+++ b/arch/blackfin/include/asm/cacheflush.h
@@ -30,7 +30,8 @@
30#ifndef _BLACKFIN_CACHEFLUSH_H 30#ifndef _BLACKFIN_CACHEFLUSH_H
31#define _BLACKFIN_CACHEFLUSH_H 31#define _BLACKFIN_CACHEFLUSH_H
32 32
33extern void blackfin_icache_dcache_flush_range(unsigned long start_address, unsigned long end_address); 33#include <asm/blackfin.h> /* for SSYNC() */
34
34extern void blackfin_icache_flush_range(unsigned long start_address, unsigned long end_address); 35extern void blackfin_icache_flush_range(unsigned long start_address, unsigned long end_address);
35extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned long end_address); 36extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned long end_address);
36extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address); 37extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address);
@@ -54,32 +55,28 @@ extern void blackfin_invalidate_entire_dcache(void);
54 55
55static inline void flush_icache_range(unsigned start, unsigned end) 56static inline void flush_icache_range(unsigned start, unsigned end)
56{ 57{
57#if defined(CONFIG_BFIN_DCACHE) && defined(CONFIG_BFIN_ICACHE) 58#if defined(CONFIG_BFIN_WB)
58 59 blackfin_dcache_flush_range(start, end);
59# if defined(CONFIG_BFIN_WT) 60#endif
60 blackfin_icache_flush_range((start), (end));
61 flush_icache_range_others(start, end);
62# else
63 blackfin_icache_dcache_flush_range((start), (end));
64# endif
65
66#else
67 61
68# if defined(CONFIG_BFIN_ICACHE) 62 /* Make sure all write buffers in the data side of the core
69 blackfin_icache_flush_range((start), (end)); 63 * are flushed before trying to invalidate the icache. This
64 * needs to be after the data flush and before the icache
65 * flush so that the SSYNC does the right thing in preventing
66 * the instruction prefetcher from hitting things in cached
67 * memory at the wrong time -- it runs much further ahead than
68 * the pipeline.
69 */
70 SSYNC();
71#if defined(CONFIG_BFIN_ICACHE)
72 blackfin_icache_flush_range(start, end);
70 flush_icache_range_others(start, end); 73 flush_icache_range_others(start, end);
71# endif
72# if defined(CONFIG_BFIN_DCACHE)
73 blackfin_dcache_flush_range((start), (end));
74# endif
75
76#endif 74#endif
77} 75}
78 76
79#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 77#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
80do { memcpy(dst, src, len); \ 78do { memcpy(dst, src, len); \
81 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \ 79 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
82 flush_icache_range_others((unsigned long) (dst), (unsigned long) (dst) + (len));\
83} while (0) 80} while (0)
84 81
85#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len) 82#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
@@ -111,6 +108,11 @@ static inline int bfin_addr_dcachable(unsigned long addr)
111 addr >= _ramend && addr < physical_mem_end) 108 addr >= _ramend && addr < physical_mem_end)
112 return 1; 109 return 1;
113 110
111#ifndef CONFIG_BFIN_L2_NOT_CACHED
112 if (addr >= L2_START && addr < L2_START + L2_LENGTH)
113 return 1;
114#endif
115
114 return 0; 116 return 0;
115} 117}
116 118
diff --git a/arch/blackfin/include/asm/cplb.h b/arch/blackfin/include/asm/cplb.h
index ad566ff9ad16..a75a6a9f0949 100644
--- a/arch/blackfin/include/asm/cplb.h
+++ b/arch/blackfin/include/asm/cplb.h
@@ -53,29 +53,32 @@
53#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON) 53#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON)
54#endif 54#endif
55 55
56#define SDRAM_DNON_CHBL (CPLB_COMMON)
57#define SDRAM_EBIU (CPLB_COMMON)
58#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
59
56#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON) 60#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON)
57 61
58#ifdef CONFIG_SMP 62#ifdef CONFIG_SMP
59#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB) 63#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB)
60#define L2_IMEMORY (CPLB_COMMON | CPLB_LOCK) 64#define L2_IMEMORY (CPLB_COMMON)
61#define L2_DMEMORY (CPLB_COMMON | CPLB_LOCK) 65#define L2_DMEMORY (CPLB_LOCK | CPLB_COMMON)
62 66
63#else 67#else
64#ifdef CONFIG_BFIN_L2_CACHEABLE 68#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB)
65#define L2_IMEMORY (SDRAM_IGENERIC) 69#define L2_IMEMORY (SDRAM_IGENERIC)
66#define L2_DMEMORY (SDRAM_DGENERIC) 70
67#else 71# if defined(CONFIG_BFIN_L2_WB)
68#define L2_IMEMORY (CPLB_COMMON) 72# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_COMMON)
69#define L2_DMEMORY (CPLB_COMMON) 73# elif defined(CONFIG_BFIN_L2_WT)
70#endif /* CONFIG_BFIN_L2_CACHEABLE */ 74# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON)
71 75# elif defined(CONFIG_BFIN_L2_NOT_CACHED)
72#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB) 76# define L2_DMEMORY (CPLB_COMMON)
77# else
78# define L2_DMEMORY (0)
79# endif
73#endif /* CONFIG_SMP */ 80#endif /* CONFIG_SMP */
74 81
75#define SDRAM_DNON_CHBL (CPLB_COMMON)
76#define SDRAM_EBIU (CPLB_COMMON)
77#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
78
79#define SIZE_1K 0x00000400 /* 1K */ 82#define SIZE_1K 0x00000400 /* 1K */
80#define SIZE_4K 0x00001000 /* 4K */ 83#define SIZE_4K 0x00001000 /* 4K */
81#define SIZE_1M 0x00100000 /* 1M */ 84#define SIZE_1M 0x00100000 /* 1M */
diff --git a/arch/blackfin/include/asm/dma.h b/arch/blackfin/include/asm/dma.h
index e4f7b8043f02..c9a59622e23f 100644
--- a/arch/blackfin/include/asm/dma.h
+++ b/arch/blackfin/include/asm/dma.h
@@ -206,10 +206,16 @@ static inline unsigned long get_dma_curr_addr(unsigned int channel)
206 206
207static inline void set_dma_sg(unsigned int channel, struct dmasg *sg, int ndsize) 207static inline void set_dma_sg(unsigned int channel, struct dmasg *sg, int ndsize)
208{ 208{
209 /* Make sure the internal data buffers in the core are drained
210 * so that the DMA descriptors are completely written when the
211 * DMA engine goes to fetch them below.
212 */
213 SSYNC();
214
215 dma_ch[channel].regs->next_desc_ptr = sg;
209 dma_ch[channel].regs->cfg = 216 dma_ch[channel].regs->cfg =
210 (dma_ch[channel].regs->cfg & ~(0xf << 8)) | 217 (dma_ch[channel].regs->cfg & ~(0xf << 8)) |
211 ((ndsize & 0xf) << 8); 218 ((ndsize & 0xf) << 8);
212 dma_ch[channel].regs->next_desc_ptr = sg;
213} 219}
214 220
215static inline int dma_channel_active(unsigned int channel) 221static inline int dma_channel_active(unsigned int channel)
@@ -253,5 +259,7 @@ static inline void clear_dma_irqstat(unsigned int channel)
253void *dma_memcpy(void *dest, const void *src, size_t count); 259void *dma_memcpy(void *dest, const void *src, size_t count);
254void *safe_dma_memcpy(void *dest, const void *src, size_t count); 260void *safe_dma_memcpy(void *dest, const void *src, size_t count);
255void blackfin_dma_early_init(void); 261void blackfin_dma_early_init(void);
262void early_dma_memcpy(void *dest, const void *src, size_t count);
263void early_dma_memcpy_done(void);
256 264
257#endif 265#endif
diff --git a/arch/blackfin/include/asm/elf.h b/arch/blackfin/include/asm/elf.h
index cdbfcfc30f6a..230e1605d3fb 100644
--- a/arch/blackfin/include/asm/elf.h
+++ b/arch/blackfin/include/asm/elf.h
@@ -55,50 +55,50 @@ do { \
55#define ELF_FDPIC_CORE_EFLAGS EF_BFIN_FDPIC 55#define ELF_FDPIC_CORE_EFLAGS EF_BFIN_FDPIC
56#define ELF_EXEC_PAGESIZE 4096 56#define ELF_EXEC_PAGESIZE 4096
57 57
58#define R_unused0 0 /* relocation type 0 is not defined */ 58#define R_BFIN_UNUSED0 0 /* relocation type 0 is not defined */
59#define R_pcrel5m2 1 /*LSETUP part a */ 59#define R_BFIN_PCREL5M2 1 /* LSETUP part a */
60#define R_unused1 2 /* relocation type 2 is not defined */ 60#define R_BFIN_UNUSED1 2 /* relocation type 2 is not defined */
61#define R_pcrel10 3 /* type 3, if cc jump <target> */ 61#define R_BFIN_PCREL10 3 /* type 3, if cc jump <target> */
62#define R_pcrel12_jump 4 /* type 4, jump <target> */ 62#define R_BFIN_PCREL12_JUMP 4 /* type 4, jump <target> */
63#define R_rimm16 5 /* type 0x5, rN = <target> */ 63#define R_BFIN_RIMM16 5 /* type 0x5, rN = <target> */
64#define R_luimm16 6 /* # 0x6, preg.l=<target> Load imm 16 to lower half */ 64#define R_BFIN_LUIMM16 6 /* # 0x6, preg.l=<target> Load imm 16 to lower half */
65#define R_huimm16 7 /* # 0x7, preg.h=<target> Load imm 16 to upper half */ 65#define R_BFIN_HUIMM16 7 /* # 0x7, preg.h=<target> Load imm 16 to upper half */
66#define R_pcrel12_jump_s 8 /* # 0x8 jump.s <target> */ 66#define R_BFIN_PCREL12_JUMP_S 8 /* # 0x8 jump.s <target> */
67#define R_pcrel24_jump_x 9 /* # 0x9 jump.x <target> */ 67#define R_BFIN_PCREL24_JUMP_X 9 /* # 0x9 jump.x <target> */
68#define R_pcrel24 10 /* # 0xa call <target> , not expandable */ 68#define R_BFIN_PCREL24 10 /* # 0xa call <target> , not expandable */
69#define R_unusedb 11 /* # 0xb not generated */ 69#define R_BFIN_UNUSEDB 11 /* # 0xb not generated */
70#define R_unusedc 12 /* # 0xc not used */ 70#define R_BFIN_UNUSEDC 12 /* # 0xc not used */
71#define R_pcrel24_jump_l 13 /*0xd jump.l <target> */ 71#define R_BFIN_PCREL24_JUMP_L 13 /* 0xd jump.l <target> */
72#define R_pcrel24_call_x 14 /* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */ 72#define R_BFIN_PCREL24_CALL_X 14 /* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */
73#define R_var_eq_symb 15 /* 0xf, linker should treat it same as 0x12 */ 73#define R_BFIN_VAR_EQ_SYMB 15 /* 0xf, linker should treat it same as 0x12 */
74#define R_byte_data 16 /* 0x10, .byte var = symbol */ 74#define R_BFIN_BYTE_DATA 16 /* 0x10, .byte var = symbol */
75#define R_byte2_data 17 /* 0x11, .byte2 var = symbol */ 75#define R_BFIN_BYTE2_DATA 17 /* 0x11, .byte2 var = symbol */
76#define R_byte4_data 18 /* 0x12, .byte4 var = symbol and .var var=symbol */ 76#define R_BFIN_BYTE4_DATA 18 /* 0x12, .byte4 var = symbol and .var var=symbol */
77#define R_pcrel11 19 /* 0x13, lsetup part b */ 77#define R_BFIN_PCREL11 19 /* 0x13, lsetup part b */
78#define R_unused14 20 /* 0x14, undefined */ 78#define R_BFIN_UNUSED14 20 /* 0x14, undefined */
79#define R_unused15 21 /* not generated by VDSP 3.5 */ 79#define R_BFIN_UNUSED15 21 /* not generated by VDSP 3.5 */
80 80
81/* arithmetic relocations */ 81/* arithmetic relocations */
82#define R_push 0xE0 82#define R_BFIN_PUSH 0xE0
83#define R_const 0xE1 83#define R_BFIN_CONST 0xE1
84#define R_add 0xE2 84#define R_BFIN_ADD 0xE2
85#define R_sub 0xE3 85#define R_BFIN_SUB 0xE3
86#define R_mult 0xE4 86#define R_BFIN_MULT 0xE4
87#define R_div 0xE5 87#define R_BFIN_DIV 0xE5
88#define R_mod 0xE6 88#define R_BFIN_MOD 0xE6
89#define R_lshift 0xE7 89#define R_BFIN_LSHIFT 0xE7
90#define R_rshift 0xE8 90#define R_BFIN_RSHIFT 0xE8
91#define R_and 0xE9 91#define R_BFIN_AND 0xE9
92#define R_or 0xEA 92#define R_BFIN_OR 0xEA
93#define R_xor 0xEB 93#define R_BFIN_XOR 0xEB
94#define R_land 0xEC 94#define R_BFIN_LAND 0xEC
95#define R_lor 0xED 95#define R_BFIN_LOR 0xED
96#define R_len 0xEE 96#define R_BFIN_LEN 0xEE
97#define R_neg 0xEF 97#define R_BFIN_NEG 0xEF
98#define R_comp 0xF0 98#define R_BFIN_COMP 0xF0
99#define R_page 0xF1 99#define R_BFIN_PAGE 0xF1
100#define R_hwpage 0xF2 100#define R_BFIN_HWPAGE 0xF2
101#define R_addr 0xF3 101#define R_BFIN_ADDR 0xF3
102 102
103/* This is the location that an ET_DYN program is loaded if exec'ed. Typical 103/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
104 use of this is to invoke "./ld.so someprog" to test out a new version of 104 use of this is to invoke "./ld.so someprog" to test out a new version of
diff --git a/arch/blackfin/include/asm/entry.h b/arch/blackfin/include/asm/entry.h
index b30a2968e274..ec58efc130e6 100644
--- a/arch/blackfin/include/asm/entry.h
+++ b/arch/blackfin/include/asm/entry.h
@@ -35,21 +35,39 @@
35#else 35#else
36# define LOAD_IPIPE_IPEND 36# define LOAD_IPIPE_IPEND
37#endif 37#endif
38
39#ifndef CONFIG_EXACT_HWERR
40/* As a debugging aid - we save IPEND when DEBUG_KERNEL is on,
41 * otherwise it is a waste of cycles.
42 */
43# ifndef CONFIG_DEBUG_KERNEL
44#define INTERRUPT_ENTRY(N) \
45 [--sp] = SYSCFG; \
46 [--sp] = P0; /*orig_p0*/ \
47 [--sp] = R0; /*orig_r0*/ \
48 [--sp] = (R7:0,P5:0); \
49 R0 = (N); \
50 LOAD_IPIPE_IPEND \
51 jump __common_int_entry;
52# else /* CONFIG_DEBUG_KERNEL */
38#define INTERRUPT_ENTRY(N) \ 53#define INTERRUPT_ENTRY(N) \
39 [--sp] = SYSCFG; \ 54 [--sp] = SYSCFG; \
40 \
41 [--sp] = P0; /*orig_p0*/ \ 55 [--sp] = P0; /*orig_p0*/ \
42 [--sp] = R0; /*orig_r0*/ \ 56 [--sp] = R0; /*orig_r0*/ \
43 [--sp] = (R7:0,P5:0); \ 57 [--sp] = (R7:0,P5:0); \
58 p0.l = lo(IPEND); \
59 p0.h = hi(IPEND); \
60 r1 = [p0]; \
44 R0 = (N); \ 61 R0 = (N); \
45 LOAD_IPIPE_IPEND \ 62 LOAD_IPIPE_IPEND \
46 jump __common_int_entry; 63 jump __common_int_entry;
64# endif /* CONFIG_DEBUG_KERNEL */
47 65
48/* For timer interrupts, we need to save IPEND, since the user_mode 66/* For timer interrupts, we need to save IPEND, since the user_mode
49 macro accesses it to determine where to account time. */ 67 *macro accesses it to determine where to account time.
68 */
50#define TIMER_INTERRUPT_ENTRY(N) \ 69#define TIMER_INTERRUPT_ENTRY(N) \
51 [--sp] = SYSCFG; \ 70 [--sp] = SYSCFG; \
52 \
53 [--sp] = P0; /*orig_p0*/ \ 71 [--sp] = P0; /*orig_p0*/ \
54 [--sp] = R0; /*orig_r0*/ \ 72 [--sp] = R0; /*orig_r0*/ \
55 [--sp] = (R7:0,P5:0); \ 73 [--sp] = (R7:0,P5:0); \
@@ -58,6 +76,74 @@
58 r1 = [p0]; \ 76 r1 = [p0]; \
59 R0 = (N); \ 77 R0 = (N); \
60 jump __common_int_entry; 78 jump __common_int_entry;
79#else /* CONFIG_EXACT_HWERR is defined */
80
81/* if we want hardware error to be exact, we need to do a SSYNC (which forces
82 * read/writes to complete to the memory controllers), and check to see that
83 * caused a pending HW error condition. If so, we assume it was caused by user
84 * space, by setting the same interrupt that we are in (so it goes off again)
85 * and context restore, and a RTI (without servicing anything). This should
86 * cause the pending HWERR to fire, and when that is done, this interrupt will
87 * be re-serviced properly.
88 * 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
90 * error is recognized by the core.
91 */
92#define INTERRUPT_ENTRY(N) \
93 SSYNC; \
94 SSYNC; \
95 [--sp] = SYSCFG; \
96 [--sp] = P0; /*orig_p0*/ \
97 [--sp] = R0; /*orig_r0*/ \
98 [--sp] = (R7:0,P5:0); \
99 R1 = ASTAT; \
100 P0.L = LO(ILAT); \
101 P0.H = HI(ILAT); \
102 R0 = [P0]; \
103 CC = BITTST(R0, EVT_IVHW_P); \
104 IF CC JUMP 1f; \
105 ASTAT = R1; \
106 p0.l = lo(IPEND); \
107 p0.h = hi(IPEND); \
108 r1 = [p0]; \
109 R0 = (N); \
110 LOAD_IPIPE_IPEND \
111 jump __common_int_entry; \
1121: ASTAT = R1; \
113 RAISE N; \
114 (R7:0, P5:0) = [SP++]; \
115 SP += 0x8; \
116 SYSCFG = [SP++]; \
117 CSYNC; \
118 RTI;
119
120#define TIMER_INTERRUPT_ENTRY(N) \
121 SSYNC; \
122 SSYNC; \
123 [--sp] = SYSCFG; \
124 [--sp] = P0; /*orig_p0*/ \
125 [--sp] = R0; /*orig_r0*/ \
126 [--sp] = (R7:0,P5:0); \
127 R1 = ASTAT; \
128 P0.L = LO(ILAT); \
129 P0.H = HI(ILAT); \
130 R0 = [P0]; \
131 CC = BITTST(R0, EVT_IVHW_P); \
132 IF CC JUMP 1f; \
133 ASTAT = R1; \
134 p0.l = lo(IPEND); \
135 p0.h = hi(IPEND); \
136 r1 = [p0]; \
137 R0 = (N); \
138 jump __common_int_entry; \
1391: ASTAT = R1; \
140 RAISE N; \
141 (R7:0, P5:0) = [SP++]; \
142 SP += 0x8; \
143 SYSCFG = [SP++]; \
144 CSYNC; \
145 RTI;
146#endif /* CONFIG_EXACT_HWERR */
61 147
62/* This one pushes RETI without using CLI. Interrupts are enabled. */ 148/* This one pushes RETI without using CLI. Interrupts are enabled. */
63#define SAVE_CONTEXT_SYSCALL save_context_syscall 149#define SAVE_CONTEXT_SYSCALL save_context_syscall
diff --git a/arch/blackfin/include/asm/gptimers.h b/arch/blackfin/include/asm/gptimers.h
index b0f847ae4bf4..89f08decb8e0 100644
--- a/arch/blackfin/include/asm/gptimers.h
+++ b/arch/blackfin/include/asm/gptimers.h
@@ -30,6 +30,7 @@
30# else 30# else
31# define MAX_BLACKFIN_GPTIMERS 11 31# define MAX_BLACKFIN_GPTIMERS 11
32# define TIMER8_GROUP_REG TIMER_ENABLE1 32# define TIMER8_GROUP_REG TIMER_ENABLE1
33# define TIMER_GROUP2 1
33# endif 34# endif
34# define TIMER0_GROUP_REG TIMER_ENABLE0 35# define TIMER0_GROUP_REG TIMER_ENABLE0
35#endif 36#endif
@@ -40,10 +41,12 @@
40# define MAX_BLACKFIN_GPTIMERS 12 41# define MAX_BLACKFIN_GPTIMERS 12
41# define TIMER0_GROUP_REG TMRS8_ENABLE 42# define TIMER0_GROUP_REG TMRS8_ENABLE
42# define TIMER8_GROUP_REG TMRS4_ENABLE 43# define TIMER8_GROUP_REG TMRS4_ENABLE
44# define TIMER_GROUP2 1
43#endif 45#endif
44/* 46/*
45 * All others: 3 timers: 47 * All others: 3 timers:
46 */ 48 */
49#define TIMER_GROUP1 0
47#if !defined(MAX_BLACKFIN_GPTIMERS) 50#if !defined(MAX_BLACKFIN_GPTIMERS)
48# define MAX_BLACKFIN_GPTIMERS 3 51# define MAX_BLACKFIN_GPTIMERS 3
49# define TIMER0_GROUP_REG TIMER_ENABLE 52# define TIMER0_GROUP_REG TIMER_ENABLE
@@ -109,8 +112,8 @@
109#define TIMER_ERR_PROG_PER 0x8000 112#define TIMER_ERR_PROG_PER 0x8000
110#define TIMER_ERR_PROG_PW 0xC000 113#define TIMER_ERR_PROG_PW 0xC000
111#define TIMER_EMU_RUN 0x0200 114#define TIMER_EMU_RUN 0x0200
112#define TIMER_TOGGLE_HI 0x0100 115#define TIMER_TOGGLE_HI 0x0100
113#define TIMER_CLK_SEL 0x0080 116#define TIMER_CLK_SEL 0x0080
114#define TIMER_OUT_DIS 0x0040 117#define TIMER_OUT_DIS 0x0040
115#define TIMER_TIN_SEL 0x0020 118#define TIMER_TIN_SEL 0x0020
116#define TIMER_IRQ_ENA 0x0010 119#define TIMER_IRQ_ENA 0x0010
@@ -169,23 +172,25 @@
169 172
170/* The actual gptimer API */ 173/* The actual gptimer API */
171 174
172void set_gptimer_pwidth (int timer_id, uint32_t width); 175void set_gptimer_pwidth(int timer_id, uint32_t width);
173uint32_t get_gptimer_pwidth (int timer_id); 176uint32_t get_gptimer_pwidth(int timer_id);
174void set_gptimer_period (int timer_id, uint32_t period); 177void set_gptimer_period(int timer_id, uint32_t period);
175uint32_t get_gptimer_period (int timer_id); 178uint32_t get_gptimer_period(int timer_id);
176uint32_t get_gptimer_count (int timer_id); 179uint32_t get_gptimer_count(int timer_id);
177uint16_t get_gptimer_intr (int timer_id); 180int get_gptimer_intr(int timer_id);
178void clear_gptimer_intr (int timer_id); 181void clear_gptimer_intr(int timer_id);
179uint16_t get_gptimer_over (int timer_id); 182int get_gptimer_over(int timer_id);
180void clear_gptimer_over (int timer_id); 183void clear_gptimer_over(int timer_id);
181void set_gptimer_config (int timer_id, uint16_t config); 184void set_gptimer_config(int timer_id, uint16_t config);
182uint16_t get_gptimer_config (int timer_id); 185uint16_t get_gptimer_config(int timer_id);
183void set_gptimer_pulse_hi (int timer_id); 186int get_gptimer_run(int timer_id);
187void set_gptimer_pulse_hi(int timer_id);
184void clear_gptimer_pulse_hi(int timer_id); 188void clear_gptimer_pulse_hi(int timer_id);
185void enable_gptimers (uint16_t mask); 189void enable_gptimers(uint16_t mask);
186void disable_gptimers (uint16_t mask); 190void disable_gptimers(uint16_t mask);
187uint16_t get_enabled_gptimers (void); 191void disable_gptimers_sync(uint16_t mask);
188uint32_t get_gptimer_status (int group); 192uint16_t get_enabled_gptimers(void);
189void set_gptimer_status (int group, uint32_t value); 193uint32_t get_gptimer_status(int group);
194void set_gptimer_status(int group, uint32_t value);
190 195
191#endif 196#endif
diff --git a/arch/blackfin/include/asm/io.h b/arch/blackfin/include/asm/io.h
index 63b2d8c78570..3022b5c96b37 100644
--- a/arch/blackfin/include/asm/io.h
+++ b/arch/blackfin/include/asm/io.h
@@ -80,19 +80,22 @@ static inline unsigned int readl(const volatile void __iomem *addr)
80#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) 80#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
81#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) 81#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
82 82
83#define inb(addr) readb(addr) 83/* Convert "I/O port addresses" to actual addresses. i.e. ugly casts. */
84#define inw(addr) readw(addr) 84#define __io(port) ((void *)(unsigned long)(port))
85#define inl(addr) readl(addr) 85
86#define outb(x,addr) ((void) writeb(x,addr)) 86#define inb(port) readb(__io(port))
87#define outw(x,addr) ((void) writew(x,addr)) 87#define inw(port) readw(__io(port))
88#define outl(x,addr) ((void) writel(x,addr)) 88#define inl(port) readl(__io(port))
89 89#define outb(x,port) writeb(x,__io(port))
90#define inb_p(addr) inb(addr) 90#define outw(x,port) writew(x,__io(port))
91#define inw_p(addr) inw(addr) 91#define outl(x,port) writel(x,__io(port))
92#define inl_p(addr) inl(addr) 92
93#define outb_p(x,addr) outb(x,addr) 93#define inb_p(port) inb(__io(port))
94#define outw_p(x,addr) outw(x,addr) 94#define inw_p(port) inw(__io(port))
95#define outl_p(x,addr) outl(x,addr) 95#define inl_p(port) inl(__io(port))
96#define outb_p(x,port) outb(x,__io(port))
97#define outw_p(x,port) outw(x,__io(port))
98#define outl_p(x,port) outl(x,__io(port))
96 99
97#define ioread8_rep(a,d,c) readsb(a,d,c) 100#define ioread8_rep(a,d,c) readsb(a,d,c)
98#define ioread16_rep(a,d,c) readsw(a,d,c) 101#define ioread16_rep(a,d,c) readsw(a,d,c)
diff --git a/arch/blackfin/include/asm/ipipe.h b/arch/blackfin/include/asm/ipipe.h
index 343b56361ec9..51d0bf5e2899 100644
--- a/arch/blackfin/include/asm/ipipe.h
+++ b/arch/blackfin/include/asm/ipipe.h
@@ -35,10 +35,10 @@
35#include <asm/atomic.h> 35#include <asm/atomic.h>
36#include <asm/traps.h> 36#include <asm/traps.h>
37 37
38#define IPIPE_ARCH_STRING "1.9-00" 38#define IPIPE_ARCH_STRING "1.9-01"
39#define IPIPE_MAJOR_NUMBER 1 39#define IPIPE_MAJOR_NUMBER 1
40#define IPIPE_MINOR_NUMBER 9 40#define IPIPE_MINOR_NUMBER 9
41#define IPIPE_PATCH_NUMBER 0 41#define IPIPE_PATCH_NUMBER 1
42 42
43#ifdef CONFIG_SMP 43#ifdef CONFIG_SMP
44#error "I-pipe/blackfin: SMP not implemented" 44#error "I-pipe/blackfin: SMP not implemented"
diff --git a/arch/blackfin/include/asm/page.h b/arch/blackfin/include/asm/page.h
index 344f6a8c1f22..3ea2016a1d4a 100644
--- a/arch/blackfin/include/asm/page.h
+++ b/arch/blackfin/include/asm/page.h
@@ -81,7 +81,7 @@ extern unsigned long memory_end;
81#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ 81#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
82 ((void *)(kaddr) < (void *)memory_end)) 82 ((void *)(kaddr) < (void *)memory_end))
83 83
84#include <asm-generic/page.h> 84#include <asm-generic/getorder.h>
85 85
86#endif /* __ASSEMBLY__ */ 86#endif /* __ASSEMBLY__ */
87 87
diff --git a/arch/blackfin/include/asm/pda.h b/arch/blackfin/include/asm/pda.h
index a67142740df0..b42555c1431c 100644
--- a/arch/blackfin/include/asm/pda.h
+++ b/arch/blackfin/include/asm/pda.h
@@ -64,8 +64,6 @@ struct blackfin_pda { /* Per-processor Data Area */
64 64
65extern struct blackfin_pda cpu_pda[]; 65extern struct blackfin_pda cpu_pda[];
66 66
67void reserve_pda(void);
68
69#endif /* __ASSEMBLY__ */ 67#endif /* __ASSEMBLY__ */
70 68
71#endif /* _ASM_BLACKFIN_PDA_H */ 69#endif /* _ASM_BLACKFIN_PDA_H */
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index 0eece23b41c7..3040415523b2 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -131,8 +131,8 @@ unsigned long get_wchan(struct task_struct *p);
131/* Get the Silicon Revision of the chip */ 131/* Get the Silicon Revision of the chip */
132static inline uint32_t __pure bfin_revid(void) 132static inline uint32_t __pure bfin_revid(void)
133{ 133{
134 /* stored in the upper 4 bits */ 134 /* Always use CHIPID, to work around ANOMALY_05000234 */
135 uint32_t revid = bfin_read_CHIPID() >> 28; 135 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28;
136 136
137#ifdef CONFIG_BF52x 137#ifdef CONFIG_BF52x
138 /* ANOMALY_05000357 138 /* ANOMALY_05000357
diff --git a/arch/blackfin/include/asm/signal.h b/arch/blackfin/include/asm/signal.h
index 87951d251458..2eea90794454 100644
--- a/arch/blackfin/include/asm/signal.h
+++ b/arch/blackfin/include/asm/signal.h
@@ -104,7 +104,7 @@ typedef unsigned long sigset_t;
104#define MINSIGSTKSZ 2048 104#define MINSIGSTKSZ 2048
105#define SIGSTKSZ 8192 105#define SIGSTKSZ 8192
106 106
107#include <asm-generic/signal.h> 107#include <asm-generic/signal-defs.h>
108 108
109#ifdef __KERNEL__ 109#ifdef __KERNEL__
110struct old_sigaction { 110struct old_sigaction {
diff --git a/arch/blackfin/include/asm/time.h b/arch/blackfin/include/asm/time.h
index ddc43ce38533..589e937ed1eb 100644
--- a/arch/blackfin/include/asm/time.h
+++ b/arch/blackfin/include/asm/time.h
@@ -37,4 +37,5 @@ extern unsigned long long __bfin_cycles_off;
37extern unsigned int __bfin_cycles_mod; 37extern unsigned int __bfin_cycles_mod;
38#endif 38#endif
39 39
40extern void __init setup_core_timer(void);
40#endif 41#endif
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h
index 3248033531e6..8894e9ffbb57 100644
--- a/arch/blackfin/include/asm/uaccess.h
+++ b/arch/blackfin/include/asm/uaccess.h
@@ -59,12 +59,8 @@ static inline int is_in_rom(unsigned long addr)
59#ifndef CONFIG_ACCESS_CHECK 59#ifndef CONFIG_ACCESS_CHECK
60static inline int _access_ok(unsigned long addr, unsigned long size) { return 1; } 60static inline int _access_ok(unsigned long addr, unsigned long size) { return 1; }
61#else 61#else
62#ifdef CONFIG_ACCESS_OK_L1
63extern int _access_ok(unsigned long addr, unsigned long size)__attribute__((l1_text));
64#else
65extern int _access_ok(unsigned long addr, unsigned long size); 62extern int _access_ok(unsigned long addr, unsigned long size);
66#endif 63#endif
67#endif
68 64
69/* 65/*
70 * The exception table consists of pairs of addresses: the first is the 66 * The exception table consists of pairs of addresses: the first is the
@@ -83,9 +79,6 @@ struct exception_table_entry {
83 unsigned long insn, fixup; 79 unsigned long insn, fixup;
84}; 80};
85 81
86/* Returns 0 if exception not found and fixup otherwise. */
87extern unsigned long search_exception_table(unsigned long);
88
89/* 82/*
90 * These are the main single-value transfer routines. They automatically 83 * These are the main single-value transfer routines. They automatically
91 * use the right size if we just have the right pointer type. 84 * use the right size if we just have the right pointer type.
@@ -233,16 +226,29 @@ strncpy_from_user(char *dst, const char *src, long count)
233} 226}
234 227
235/* 228/*
236 * Return the size of a string (including the ending 0) 229 * Get the size of a string in user space.
230 * src: The string to measure
231 * n: The maximum valid length
237 * 232 *
238 * Return 0 on exception, a value greater than N if too long 233 * Get the size of a NUL-terminated string in user space.
234 *
235 * Returns the size of the string INCLUDING the terminating NUL.
236 * On exception, returns 0.
237 * If the string is too long, returns a value greater than n.
239 */ 238 */
240static inline long strnlen_user(const char *src, long n) 239static inline long __must_check strnlen_user(const char *src, long n)
241{ 240{
242 return (strlen(src) + 1); 241 if (!access_ok(VERIFY_READ, src, 1))
242 return 0;
243 return strnlen(src, n) + 1;
243} 244}
244 245
245#define strlen_user(str) strnlen_user(str, 32767) 246static inline long __must_check strlen_user(const char *src)
247{
248 if (!access_ok(VERIFY_READ, src, 1))
249 return 0;
250 return strlen(src) + 1;
251}
246 252
247/* 253/*
248 * Zero Userspace 254 * Zero Userspace
@@ -251,6 +257,8 @@ static inline long strnlen_user(const char *src, long n)
251static inline unsigned long __must_check 257static inline unsigned long __must_check
252__clear_user(void *to, unsigned long n) 258__clear_user(void *to, unsigned long n)
253{ 259{
260 if (!access_ok(VERIFY_WRITE, to, n))
261 return n;
254 memset(to, 0, n); 262 memset(to, 0, n);
255 return 0; 263 return 0;
256} 264}
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 8531693fb48d..763ed84ba459 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -20,6 +20,11 @@
20#include <asm/dma.h> 20#include <asm/dma.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22 22
23/*
24 * To make sure we work around 05000119 - we always check DMA_DONE bit,
25 * never the DMA_RUN bit
26 */
27
23struct dma_channel dma_ch[MAX_DMA_CHANNELS]; 28struct dma_channel dma_ch[MAX_DMA_CHANNELS];
24EXPORT_SYMBOL(dma_ch); 29EXPORT_SYMBOL(dma_ch);
25 30
@@ -232,6 +237,87 @@ void blackfin_dma_resume(void)
232void __init blackfin_dma_early_init(void) 237void __init blackfin_dma_early_init(void)
233{ 238{
234 bfin_write_MDMA_S0_CONFIG(0); 239 bfin_write_MDMA_S0_CONFIG(0);
240 bfin_write_MDMA_S1_CONFIG(0);
241}
242
243void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
244{
245 unsigned long dst = (unsigned long)pdst;
246 unsigned long src = (unsigned long)psrc;
247 struct dma_register *dst_ch, *src_ch;
248
249 /* We assume that everything is 4 byte aligned, so include
250 * a basic sanity check
251 */
252 BUG_ON(dst % 4);
253 BUG_ON(src % 4);
254 BUG_ON(size % 4);
255
256 /* Force a sync in case a previous config reset on this channel
257 * occurred. This is needed so subsequent writes to DMA registers
258 * are not spuriously lost/corrupted.
259 */
260 __builtin_bfin_ssync();
261
262 src_ch = 0;
263 /* Find an avalible memDMA channel */
264 while (1) {
265 if (!src_ch || src_ch == (struct dma_register *)MDMA_S1_NEXT_DESC_PTR) {
266 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
267 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
268 } else {
269 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR;
270 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR;
271 }
272
273 if (!bfin_read16(&src_ch->cfg)) {
274 break;
275 } else {
276 if (bfin_read16(&src_ch->irq_status) & DMA_DONE)
277 bfin_write16(&src_ch->cfg, 0);
278 }
279
280 }
281
282 /* Destination */
283 bfin_write32(&dst_ch->start_addr, dst);
284 bfin_write16(&dst_ch->x_count, size >> 2);
285 bfin_write16(&dst_ch->x_modify, 1 << 2);
286 bfin_write16(&dst_ch->irq_status, DMA_DONE | DMA_ERR);
287
288 /* Source */
289 bfin_write32(&src_ch->start_addr, src);
290 bfin_write16(&src_ch->x_count, size >> 2);
291 bfin_write16(&src_ch->x_modify, 1 << 2);
292 bfin_write16(&src_ch->irq_status, DMA_DONE | DMA_ERR);
293
294 /* Enable */
295 bfin_write16(&src_ch->cfg, DMAEN | WDSIZE_32);
296 bfin_write16(&dst_ch->cfg, WNR | DI_EN | DMAEN | WDSIZE_32);
297
298 /* Since we are atomic now, don't use the workaround ssync */
299 __builtin_bfin_ssync();
300}
301
302void __init early_dma_memcpy_done(void)
303{
304 while ((bfin_read_MDMA_S0_CONFIG() && !(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) ||
305 (bfin_read_MDMA_S1_CONFIG() && !(bfin_read_MDMA_D1_IRQ_STATUS() & DMA_DONE)))
306 continue;
307
308 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
309 bfin_write_MDMA_D1_IRQ_STATUS(DMA_DONE | DMA_ERR);
310 /*
311 * Now that DMA is done, we would normally flush cache, but
312 * i/d cache isn't running this early, so we don't bother,
313 * and just clear out the DMA channel for next time
314 */
315 bfin_write_MDMA_S0_CONFIG(0);
316 bfin_write_MDMA_S1_CONFIG(0);
317 bfin_write_MDMA_D0_CONFIG(0);
318 bfin_write_MDMA_D1_CONFIG(0);
319
320 __builtin_bfin_ssync();
235} 321}
236 322
237/** 323/**
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index a0678da40532..beffa00a93c3 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -313,15 +313,6 @@ inline void portmux_setup(unsigned short per)
313# define portmux_setup(...) do { } while (0) 313# define portmux_setup(...) do { } while (0)
314#endif 314#endif
315 315
316static int __init bfin_gpio_init(void)
317{
318 printk(KERN_INFO "Blackfin GPIO Controller\n");
319
320 return 0;
321}
322arch_initcall(bfin_gpio_init);
323
324
325#ifndef CONFIG_BF54x 316#ifndef CONFIG_BF54x
326/*********************************************************** 317/***********************************************************
327* 318*
@@ -1021,15 +1012,6 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label)
1021 1012
1022 local_irq_save_hw(flags); 1013 local_irq_save_hw(flags);
1023 1014
1024 if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1025 if (system_state == SYSTEM_BOOTING)
1026 dump_stack();
1027 printk(KERN_ERR
1028 "bfin-gpio: GPIO %d is already reserved as gpio-irq !\n",
1029 gpio);
1030 local_irq_restore_hw(flags);
1031 return -EBUSY;
1032 }
1033 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 1015 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1034 if (system_state == SYSTEM_BOOTING) 1016 if (system_state == SYSTEM_BOOTING)
1035 dump_stack(); 1017 dump_stack();
diff --git a/arch/blackfin/kernel/bfin_ksyms.c b/arch/blackfin/kernel/bfin_ksyms.c
index 01f917d58b59..53e893ff708a 100644
--- a/arch/blackfin/kernel/bfin_ksyms.c
+++ b/arch/blackfin/kernel/bfin_ksyms.c
@@ -16,7 +16,6 @@ EXPORT_SYMBOL(bfin_return_from_exception);
16 16
17/* All the Blackfin cache functions: mach-common/cache.S */ 17/* All the Blackfin cache functions: mach-common/cache.S */
18EXPORT_SYMBOL(blackfin_dcache_invalidate_range); 18EXPORT_SYMBOL(blackfin_dcache_invalidate_range);
19EXPORT_SYMBOL(blackfin_icache_dcache_flush_range);
20EXPORT_SYMBOL(blackfin_icache_flush_range); 19EXPORT_SYMBOL(blackfin_icache_flush_range);
21EXPORT_SYMBOL(blackfin_dcache_flush_range); 20EXPORT_SYMBOL(blackfin_dcache_flush_range);
22EXPORT_SYMBOL(blackfin_dflush_page); 21EXPORT_SYMBOL(blackfin_dflush_page);
diff --git a/arch/blackfin/kernel/cplb-mpu/cacheinit.c b/arch/blackfin/kernel/cplb-mpu/cacheinit.c
index c6ff947f9d37..d5a86c3017f7 100644
--- a/arch/blackfin/kernel/cplb-mpu/cacheinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cacheinit.c
@@ -55,7 +55,14 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
55 } 55 }
56 56
57 ctrl = bfin_read_DMEM_CONTROL(); 57 ctrl = bfin_read_DMEM_CONTROL();
58 ctrl |= DMEM_CNTR; 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);
59 bfin_write_DMEM_CONTROL(ctrl); 66 bfin_write_DMEM_CONTROL(ctrl);
60 SSYNC(); 67 SSYNC();
61} 68}
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
index 3e329a6ce041..c006a44527bf 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
@@ -64,7 +64,7 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
64 dcplb_tbl[cpu][i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; 64 dcplb_tbl[cpu][i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB;
65 65
66 icplb_tbl[cpu][i_i].addr = 0; 66 icplb_tbl[cpu][i_i].addr = 0;
67 icplb_tbl[cpu][i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_1KB; 67 icplb_tbl[cpu][i_i++].data = CPLB_VALID | i_cache | CPLB_USER_RD | PAGE_SIZE_1KB;
68 68
69 /* Cover kernel memory with 4M pages. */ 69 /* Cover kernel memory with 4M pages. */
70 addr = 0; 70 addr = 0;
diff --git a/arch/blackfin/kernel/cplb-nompu/cacheinit.c b/arch/blackfin/kernel/cplb-nompu/cacheinit.c
index c6ff947f9d37..d5a86c3017f7 100644
--- a/arch/blackfin/kernel/cplb-nompu/cacheinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cacheinit.c
@@ -55,7 +55,14 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
55 } 55 }
56 56
57 ctrl = bfin_read_DMEM_CONTROL(); 57 ctrl = bfin_read_DMEM_CONTROL();
58 ctrl |= DMEM_CNTR; 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);
59 bfin_write_DMEM_CONTROL(ctrl); 66 bfin_write_DMEM_CONTROL(ctrl);
60 SSYNC(); 67 SSYNC();
61} 68}
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c
index c8ad051742e2..3302719173ca 100644
--- a/arch/blackfin/kernel/early_printk.c
+++ b/arch/blackfin/kernel/early_printk.c
@@ -178,25 +178,15 @@ int __init setup_early_printk(char *buf)
178 178
179asmlinkage void __init init_early_exception_vectors(void) 179asmlinkage void __init init_early_exception_vectors(void)
180{ 180{
181 u32 evt;
181 SSYNC(); 182 SSYNC();
182 183
183 /* cannot program in software: 184 /* cannot program in software:
184 * evt0 - emulation (jtag) 185 * evt0 - emulation (jtag)
185 * evt1 - reset 186 * evt1 - reset
186 */ 187 */
187 bfin_write_EVT2(early_trap); 188 for (evt = EVT2; evt <= EVT15; evt += 4)
188 bfin_write_EVT3(early_trap); 189 bfin_write32(evt, early_trap);
189 bfin_write_EVT5(early_trap);
190 bfin_write_EVT6(early_trap);
191 bfin_write_EVT7(early_trap);
192 bfin_write_EVT8(early_trap);
193 bfin_write_EVT9(early_trap);
194 bfin_write_EVT10(early_trap);
195 bfin_write_EVT11(early_trap);
196 bfin_write_EVT12(early_trap);
197 bfin_write_EVT13(early_trap);
198 bfin_write_EVT14(early_trap);
199 bfin_write_EVT15(early_trap);
200 CSYNC(); 190 CSYNC();
201 191
202 /* Set all the return from interrupt, exception, NMI to a known place 192 /* Set all the return from interrupt, exception, NMI to a known place
diff --git a/arch/blackfin/kernel/gptimers.c b/arch/blackfin/kernel/gptimers.c
index 3a3e9615b002..7281a91d26b5 100644
--- a/arch/blackfin/kernel/gptimers.c
+++ b/arch/blackfin/kernel/gptimers.c
@@ -189,10 +189,10 @@ void set_gptimer_status(int group, uint32_t value)
189} 189}
190EXPORT_SYMBOL(set_gptimer_status); 190EXPORT_SYMBOL(set_gptimer_status);
191 191
192uint16_t get_gptimer_intr(int timer_id) 192int get_gptimer_intr(int timer_id)
193{ 193{
194 tassert(timer_id < MAX_BLACKFIN_GPTIMERS); 194 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
195 return (group_regs[BFIN_TIMER_OCTET(timer_id)]->status & timil_mask[timer_id]) ? 1 : 0; 195 return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & timil_mask[timer_id]);
196} 196}
197EXPORT_SYMBOL(get_gptimer_intr); 197EXPORT_SYMBOL(get_gptimer_intr);
198 198
@@ -203,10 +203,10 @@ void clear_gptimer_intr(int timer_id)
203} 203}
204EXPORT_SYMBOL(clear_gptimer_intr); 204EXPORT_SYMBOL(clear_gptimer_intr);
205 205
206uint16_t get_gptimer_over(int timer_id) 206int get_gptimer_over(int timer_id)
207{ 207{
208 tassert(timer_id < MAX_BLACKFIN_GPTIMERS); 208 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
209 return (group_regs[BFIN_TIMER_OCTET(timer_id)]->status & tovf_mask[timer_id]) ? 1 : 0; 209 return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & tovf_mask[timer_id]);
210} 210}
211EXPORT_SYMBOL(get_gptimer_over); 211EXPORT_SYMBOL(get_gptimer_over);
212 212
@@ -217,6 +217,13 @@ void clear_gptimer_over(int timer_id)
217} 217}
218EXPORT_SYMBOL(clear_gptimer_over); 218EXPORT_SYMBOL(clear_gptimer_over);
219 219
220int get_gptimer_run(int timer_id)
221{
222 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
223 return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & trun_mask[timer_id]);
224}
225EXPORT_SYMBOL(get_gptimer_run);
226
220void set_gptimer_config(int timer_id, uint16_t config) 227void set_gptimer_config(int timer_id, uint16_t config)
221{ 228{
222 tassert(timer_id < MAX_BLACKFIN_GPTIMERS); 229 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
@@ -244,7 +251,7 @@ void enable_gptimers(uint16_t mask)
244} 251}
245EXPORT_SYMBOL(enable_gptimers); 252EXPORT_SYMBOL(enable_gptimers);
246 253
247void disable_gptimers(uint16_t mask) 254static void _disable_gptimers(uint16_t mask)
248{ 255{
249 int i; 256 int i;
250 uint16_t m = mask; 257 uint16_t m = mask;
@@ -253,6 +260,12 @@ void disable_gptimers(uint16_t mask)
253 group_regs[i]->disable = m & 0xFF; 260 group_regs[i]->disable = m & 0xFF;
254 m >>= 8; 261 m >>= 8;
255 } 262 }
263}
264
265void disable_gptimers(uint16_t mask)
266{
267 int i;
268 _disable_gptimers(mask);
256 for (i = 0; i < MAX_BLACKFIN_GPTIMERS; ++i) 269 for (i = 0; i < MAX_BLACKFIN_GPTIMERS; ++i)
257 if (mask & (1 << i)) 270 if (mask & (1 << i))
258 group_regs[BFIN_TIMER_OCTET(i)]->status |= trun_mask[i]; 271 group_regs[BFIN_TIMER_OCTET(i)]->status |= trun_mask[i];
@@ -260,6 +273,13 @@ void disable_gptimers(uint16_t mask)
260} 273}
261EXPORT_SYMBOL(disable_gptimers); 274EXPORT_SYMBOL(disable_gptimers);
262 275
276void disable_gptimers_sync(uint16_t mask)
277{
278 _disable_gptimers(mask);
279 SSYNC();
280}
281EXPORT_SYMBOL(disable_gptimers_sync);
282
263void set_gptimer_pulse_hi(int timer_id) 283void set_gptimer_pulse_hi(int timer_id)
264{ 284{
265 tassert(timer_id < MAX_BLACKFIN_GPTIMERS); 285 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c
index a5de8d45424c..5fc424803a17 100644
--- a/arch/blackfin/kernel/ipipe.c
+++ b/arch/blackfin/kernel/ipipe.c
@@ -167,7 +167,7 @@ int __ipipe_check_root(void)
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);
170 int prio = desc->ic_prio; 170 int prio = __ipipe_get_irq_priority(irq);
171 171
172 desc->depth = 0; 172 desc->depth = 0;
173 if (ipd != &ipipe_root && 173 if (ipd != &ipipe_root &&
@@ -178,8 +178,7 @@ EXPORT_SYMBOL(__ipipe_enable_irqdesc);
178 178
179void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq) 179void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
180{ 180{
181 struct irq_desc *desc = irq_to_desc(irq); 181 int prio = __ipipe_get_irq_priority(irq);
182 int prio = desc->ic_prio;
183 182
184 if (ipd != &ipipe_root && 183 if (ipd != &ipipe_root &&
185 atomic_dec_and_test(&__ipipe_irq_lvdepth[prio])) 184 atomic_dec_and_test(&__ipipe_irq_lvdepth[prio]))
@@ -310,12 +309,16 @@ int ipipe_trigger_irq(unsigned irq)
310 309
311asmlinkage void __ipipe_sync_root(void) 310asmlinkage void __ipipe_sync_root(void)
312{ 311{
312 void (*irq_tail_hook)(void) = (void (*)(void))__ipipe_irq_tail_hook;
313 unsigned long flags; 313 unsigned long flags;
314 314
315 BUG_ON(irqs_disabled()); 315 BUG_ON(irqs_disabled());
316 316
317 local_irq_save_hw(flags); 317 local_irq_save_hw(flags);
318 318
319 if (irq_tail_hook)
320 irq_tail_hook();
321
319 clear_thread_flag(TIF_IRQ_SYNC); 322 clear_thread_flag(TIF_IRQ_SYNC);
320 323
321 if (ipipe_root_cpudom_var(irqpend_himask) != 0) 324 if (ipipe_root_cpudom_var(irqpend_himask) != 0)
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index 401bd32aa499..6e31e935bb31 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -59,12 +59,14 @@ static struct irq_chip bad_chip = {
59 .unmask = dummy_mask_unmask_irq, 59 .unmask = dummy_mask_unmask_irq,
60}; 60};
61 61
62static int bad_stats;
62static struct irq_desc bad_irq_desc = { 63static struct irq_desc bad_irq_desc = {
63 .status = IRQ_DISABLED, 64 .status = IRQ_DISABLED,
64 .chip = &bad_chip, 65 .chip = &bad_chip,
65 .handle_irq = handle_bad_irq, 66 .handle_irq = handle_bad_irq,
66 .depth = 1, 67 .depth = 1,
67 .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock), 68 .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock),
69 .kstat_irqs = &bad_stats,
68#ifdef CONFIG_SMP 70#ifdef CONFIG_SMP
69 .affinity = CPU_MASK_ALL 71 .affinity = CPU_MASK_ALL
70#endif 72#endif
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c
index b163f6d3330d..da28f796ad78 100644
--- a/arch/blackfin/kernel/kgdb.c
+++ b/arch/blackfin/kernel/kgdb.c
@@ -466,7 +466,7 @@ static int validate_memory_access_address(unsigned long addr, int size)
466 int cpu = raw_smp_processor_id(); 466 int cpu = raw_smp_processor_id();
467 467
468 if (size < 0) 468 if (size < 0)
469 return EFAULT; 469 return -EFAULT;
470 if (addr >= 0x1000 && (addr + size) <= physical_mem_end) 470 if (addr >= 0x1000 && (addr + size) <= physical_mem_end)
471 return 0; 471 return 0;
472 if (addr >= SYSMMR_BASE) 472 if (addr >= SYSMMR_BASE)
@@ -498,7 +498,7 @@ static int validate_memory_access_address(unsigned long addr, int size)
498 if (IN_MEM(addr, size, L2_START, L2_LENGTH)) 498 if (IN_MEM(addr, size, L2_START, L2_LENGTH))
499 return 0; 499 return 0;
500 500
501 return EFAULT; 501 return -EFAULT;
502} 502}
503 503
504/* 504/*
@@ -508,14 +508,15 @@ static int validate_memory_access_address(unsigned long addr, int size)
508int kgdb_mem2hex(char *mem, char *buf, int count) 508int kgdb_mem2hex(char *mem, char *buf, int count)
509{ 509{
510 char *tmp; 510 char *tmp;
511 int err = 0; 511 int err;
512 unsigned char *pch; 512 unsigned char *pch;
513 unsigned short mmr16; 513 unsigned short mmr16;
514 unsigned long mmr32; 514 unsigned long mmr32;
515 int cpu = raw_smp_processor_id(); 515 int cpu = raw_smp_processor_id();
516 516
517 if (validate_memory_access_address((unsigned long)mem, count)) 517 err = validate_memory_access_address((unsigned long)mem, count);
518 return EFAULT; 518 if (err)
519 return err;
519 520
520 /* 521 /*
521 * We use the upper half of buf as an intermediate buffer for the 522 * We use the upper half of buf as an intermediate buffer for the
@@ -533,7 +534,7 @@ int kgdb_mem2hex(char *mem, char *buf, int count)
533 *tmp++ = *pch++; 534 *tmp++ = *pch++;
534 tmp -= 2; 535 tmp -= 2;
535 } else 536 } else
536 err = EFAULT; 537 err = -EFAULT;
537 break; 538 break;
538 case 4: 539 case 4:
539 if ((unsigned int)mem % 4 == 0) { 540 if ((unsigned int)mem % 4 == 0) {
@@ -545,10 +546,10 @@ int kgdb_mem2hex(char *mem, char *buf, int count)
545 *tmp++ = *pch++; 546 *tmp++ = *pch++;
546 tmp -= 4; 547 tmp -= 4;
547 } else 548 } else
548 err = EFAULT; 549 err = -EFAULT;
549 break; 550 break;
550 default: 551 default:
551 err = EFAULT; 552 err = -EFAULT;
552 } 553 }
553 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH)) 554 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))
554#ifdef CONFIG_SMP 555#ifdef CONFIG_SMP
@@ -557,7 +558,7 @@ int kgdb_mem2hex(char *mem, char *buf, int count)
557 ) { 558 ) {
558 /* access L1 instruction SRAM*/ 559 /* access L1 instruction SRAM*/
559 if (dma_memcpy(tmp, mem, count) == NULL) 560 if (dma_memcpy(tmp, mem, count) == NULL)
560 err = EFAULT; 561 err = -EFAULT;
561 } else 562 } else
562 err = probe_kernel_read(tmp, mem, count); 563 err = probe_kernel_read(tmp, mem, count);
563 564
@@ -585,24 +586,24 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)
585 char *tmp_new; 586 char *tmp_new;
586 unsigned short *mmr16; 587 unsigned short *mmr16;
587 unsigned long *mmr32; 588 unsigned long *mmr32;
588 int err = 0; 589 int err;
589 int size = 0; 590 int size;
590 int cpu = raw_smp_processor_id(); 591 int cpu = raw_smp_processor_id();
591 592
592 tmp_old = tmp_new = buf; 593 tmp_old = tmp_new = buf;
593 594
594 while (count-- > 0) { 595 for (size = 0; size < count; ++size) {
595 if (*tmp_old == 0x7d) 596 if (*tmp_old == 0x7d)
596 *tmp_new = *(++tmp_old) ^ 0x20; 597 *tmp_new = *(++tmp_old) ^ 0x20;
597 else 598 else
598 *tmp_new = *tmp_old; 599 *tmp_new = *tmp_old;
599 tmp_new++; 600 tmp_new++;
600 tmp_old++; 601 tmp_old++;
601 size++;
602 } 602 }
603 603
604 if (validate_memory_access_address((unsigned long)mem, size)) 604 err = validate_memory_access_address((unsigned long)mem, size);
605 return EFAULT; 605 if (err)
606 return err;
606 607
607 if ((unsigned int)mem >= SYSMMR_BASE) { /*access MMR registers*/ 608 if ((unsigned int)mem >= SYSMMR_BASE) { /*access MMR registers*/
608 switch (size) { 609 switch (size) {
@@ -611,17 +612,17 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)
611 mmr16 = (unsigned short *)buf; 612 mmr16 = (unsigned short *)buf;
612 *(unsigned short *)mem = *mmr16; 613 *(unsigned short *)mem = *mmr16;
613 } else 614 } else
614 return EFAULT; 615 err = -EFAULT;
615 break; 616 break;
616 case 4: 617 case 4:
617 if ((unsigned int)mem % 4 == 0) { 618 if ((unsigned int)mem % 4 == 0) {
618 mmr32 = (unsigned long *)buf; 619 mmr32 = (unsigned long *)buf;
619 *(unsigned long *)mem = *mmr32; 620 *(unsigned long *)mem = *mmr32;
620 } else 621 } else
621 return EFAULT; 622 err = -EFAULT;
622 break; 623 break;
623 default: 624 default:
624 return EFAULT; 625 err = -EFAULT;
625 } 626 }
626 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH)) 627 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))
627#ifdef CONFIG_SMP 628#ifdef CONFIG_SMP
@@ -630,7 +631,7 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)
630 ) { 631 ) {
631 /* access L1 instruction SRAM */ 632 /* access L1 instruction SRAM */
632 if (dma_memcpy(mem, buf, size) == NULL) 633 if (dma_memcpy(mem, buf, size) == NULL)
633 err = EFAULT; 634 err = -EFAULT;
634 } else 635 } else
635 err = probe_kernel_write(mem, buf, size); 636 err = probe_kernel_write(mem, buf, size);
636 637
@@ -648,10 +649,12 @@ int kgdb_hex2mem(char *buf, char *mem, int count)
648 char *tmp_hex; 649 char *tmp_hex;
649 unsigned short *mmr16; 650 unsigned short *mmr16;
650 unsigned long *mmr32; 651 unsigned long *mmr32;
652 int err;
651 int cpu = raw_smp_processor_id(); 653 int cpu = raw_smp_processor_id();
652 654
653 if (validate_memory_access_address((unsigned long)mem, count)) 655 err = validate_memory_access_address((unsigned long)mem, count);
654 return EFAULT; 656 if (err)
657 return err;
655 658
656 /* 659 /*
657 * We use the upper half of buf as an intermediate buffer for the 660 * We use the upper half of buf as an intermediate buffer for the
@@ -673,17 +676,17 @@ int kgdb_hex2mem(char *buf, char *mem, int count)
673 mmr16 = (unsigned short *)tmp_raw; 676 mmr16 = (unsigned short *)tmp_raw;
674 *(unsigned short *)mem = *mmr16; 677 *(unsigned short *)mem = *mmr16;
675 } else 678 } else
676 return EFAULT; 679 err = -EFAULT;
677 break; 680 break;
678 case 4: 681 case 4:
679 if ((unsigned int)mem % 4 == 0) { 682 if ((unsigned int)mem % 4 == 0) {
680 mmr32 = (unsigned long *)tmp_raw; 683 mmr32 = (unsigned long *)tmp_raw;
681 *(unsigned long *)mem = *mmr32; 684 *(unsigned long *)mem = *mmr32;
682 } else 685 } else
683 return EFAULT; 686 err = -EFAULT;
684 break; 687 break;
685 default: 688 default:
686 return EFAULT; 689 err = -EFAULT;
687 } 690 }
688 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH)) 691 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))
689#ifdef CONFIG_SMP 692#ifdef CONFIG_SMP
@@ -692,10 +695,11 @@ int kgdb_hex2mem(char *buf, char *mem, int count)
692 ) { 695 ) {
693 /* access L1 instruction SRAM */ 696 /* access L1 instruction SRAM */
694 if (dma_memcpy(mem, tmp_raw, count) == NULL) 697 if (dma_memcpy(mem, tmp_raw, count) == NULL)
695 return EFAULT; 698 err = -EFAULT;
696 } else 699 } else
697 return probe_kernel_write(mem, tmp_raw, count); 700 err = probe_kernel_write(mem, tmp_raw, count);
698 return 0; 701
702 return err;
699} 703}
700 704
701int kgdb_validate_break_address(unsigned long addr) 705int kgdb_validate_break_address(unsigned long addr)
@@ -715,7 +719,7 @@ int kgdb_validate_break_address(unsigned long addr)
715 if (IN_MEM(addr, BREAK_INSTR_SIZE, L2_START, L2_LENGTH)) 719 if (IN_MEM(addr, BREAK_INSTR_SIZE, L2_START, L2_LENGTH))
716 return 0; 720 return 0;
717 721
718 return EFAULT; 722 return -EFAULT;
719} 723}
720 724
721int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr) 725int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index 1bd7f2d018a8..d5aee3626688 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -201,8 +201,8 @@ apply_relocate(Elf_Shdr * sechdrs, const char *strtab,
201/* Arithmetic relocations are handled. */ 201/* Arithmetic relocations are handled. */
202/* We do not expect LSETUP to be split and hence is not */ 202/* We do not expect LSETUP to be split and hence is not */
203/* handled. */ 203/* handled. */
204/* R_byte and R_byte2 are also not handled as the gas */ 204/* R_BFIN_BYTE and R_BFIN_BYTE2 are also not handled as the */
205/* does not generate it. */ 205/* gas does not generate it. */
206/*************************************************************************/ 206/*************************************************************************/
207int 207int
208apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, 208apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
@@ -243,8 +243,8 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
243#endif 243#endif
244 switch (ELF32_R_TYPE(rel[i].r_info)) { 244 switch (ELF32_R_TYPE(rel[i].r_info)) {
245 245
246 case R_pcrel24: 246 case R_BFIN_PCREL24:
247 case R_pcrel24_jump_l: 247 case R_BFIN_PCREL24_JUMP_L:
248 /* Add the value, subtract its postition */ 248 /* Add the value, subtract its postition */
249 location16 = 249 location16 =
250 (uint16_t *) (sechdrs[sechdrs[relsec].sh_info]. 250 (uint16_t *) (sechdrs[sechdrs[relsec].sh_info].
@@ -266,18 +266,18 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
266 (*location16 & 0xff00) | (value >> 16 & 0x00ff); 266 (*location16 & 0xff00) | (value >> 16 & 0x00ff);
267 *(location16 + 1) = value & 0xffff; 267 *(location16 + 1) = value & 0xffff;
268 break; 268 break;
269 case R_pcrel12_jump: 269 case R_BFIN_PCREL12_JUMP:
270 case R_pcrel12_jump_s: 270 case R_BFIN_PCREL12_JUMP_S:
271 value -= (uint32_t) location32; 271 value -= (uint32_t) location32;
272 value >>= 1; 272 value >>= 1;
273 *location16 = (value & 0xfff); 273 *location16 = (value & 0xfff);
274 break; 274 break;
275 case R_pcrel10: 275 case R_BFIN_PCREL10:
276 value -= (uint32_t) location32; 276 value -= (uint32_t) location32;
277 value >>= 1; 277 value >>= 1;
278 *location16 = (value & 0x3ff); 278 *location16 = (value & 0x3ff);
279 break; 279 break;
280 case R_luimm16: 280 case R_BFIN_LUIMM16:
281 pr_debug("before %x after %x\n", *location16, 281 pr_debug("before %x after %x\n", *location16,
282 (value & 0xffff)); 282 (value & 0xffff));
283 tmp = (value & 0xffff); 283 tmp = (value & 0xffff);
@@ -286,7 +286,7 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
286 } else 286 } else
287 *location16 = tmp; 287 *location16 = tmp;
288 break; 288 break;
289 case R_huimm16: 289 case R_BFIN_HUIMM16:
290 pr_debug("before %x after %x\n", *location16, 290 pr_debug("before %x after %x\n", *location16,
291 ((value >> 16) & 0xffff)); 291 ((value >> 16) & 0xffff));
292 tmp = ((value >> 16) & 0xffff); 292 tmp = ((value >> 16) & 0xffff);
@@ -295,10 +295,10 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
295 } else 295 } else
296 *location16 = tmp; 296 *location16 = tmp;
297 break; 297 break;
298 case R_rimm16: 298 case R_BFIN_RIMM16:
299 *location16 = (value & 0xffff); 299 *location16 = (value & 0xffff);
300 break; 300 break;
301 case R_byte4_data: 301 case R_BFIN_BYTE4_DATA:
302 pr_debug("before %x after %x\n", *location32, value); 302 pr_debug("before %x after %x\n", *location32, value);
303 *location32 = value; 303 *location32 = value;
304 break; 304 break;
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index e040e03335ea..30d0843ed701 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -322,6 +322,9 @@ void finish_atomic_sections (struct pt_regs *regs)
322} 322}
323 323
324#if defined(CONFIG_ACCESS_CHECK) 324#if defined(CONFIG_ACCESS_CHECK)
325#ifdef CONFIG_ACCESS_OK_L1
326__attribute__((l1_text))
327#endif
325/* Return 1 if access to memory range is OK, 0 otherwise */ 328/* Return 1 if access to memory range is OK, 0 otherwise */
326int _access_ok(unsigned long addr, unsigned long size) 329int _access_ok(unsigned long addr, unsigned long size)
327{ 330{
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index a58687bdee6a..80447f99c2b5 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -18,9 +18,12 @@
18#include <linux/tty.h> 18#include <linux/tty.h>
19#include <linux/pfn.h> 19#include <linux/pfn.h>
20 20
21#ifdef CONFIG_MTD_UCLINUX
22#include <linux/mtd/map.h>
21#include <linux/ext2_fs.h> 23#include <linux/ext2_fs.h>
22#include <linux/cramfs_fs.h> 24#include <linux/cramfs_fs.h>
23#include <linux/romfs_fs.h> 25#include <linux/romfs_fs.h>
26#endif
24 27
25#include <asm/cplb.h> 28#include <asm/cplb.h>
26#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
@@ -45,6 +48,7 @@ EXPORT_SYMBOL(_ramend);
45EXPORT_SYMBOL(reserved_mem_dcache_on); 48EXPORT_SYMBOL(reserved_mem_dcache_on);
46 49
47#ifdef CONFIG_MTD_UCLINUX 50#ifdef CONFIG_MTD_UCLINUX
51extern struct map_info uclinux_ram_map;
48unsigned long memory_mtd_end, memory_mtd_start, mtd_size; 52unsigned long memory_mtd_end, memory_mtd_start, mtd_size;
49unsigned long _ebss; 53unsigned long _ebss;
50EXPORT_SYMBOL(memory_mtd_end); 54EXPORT_SYMBOL(memory_mtd_end);
@@ -150,40 +154,45 @@ void __init bfin_relocate_l1_mem(void)
150 unsigned long l1_data_b_length; 154 unsigned long l1_data_b_length;
151 unsigned long l2_length; 155 unsigned long l2_length;
152 156
157 /*
158 * due to the ALIGN(4) in the arch/blackfin/kernel/vmlinux.lds.S
159 * we know that everything about l1 text/data is nice and aligned,
160 * so copy by 4 byte chunks, and don't worry about overlapping
161 * src/dest.
162 *
163 * We can't use the dma_memcpy functions, since they can call
164 * scheduler functions which might be in L1 :( and core writes
165 * into L1 instruction cause bad access errors, so we are stuck,
166 * we are required to use DMA, but can't use the common dma
167 * functions. We can't use memcpy either - since that might be
168 * going to be in the relocated L1
169 */
170
153 blackfin_dma_early_init(); 171 blackfin_dma_early_init();
154 172
173 /* if necessary, copy _stext_l1 to _etext_l1 to L1 instruction SRAM */
155 l1_code_length = _etext_l1 - _stext_l1; 174 l1_code_length = _etext_l1 - _stext_l1;
156 if (l1_code_length > L1_CODE_LENGTH) 175 if (l1_code_length)
157 panic("L1 Instruction SRAM Overflow\n"); 176 early_dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length);
158 /* cannot complain as printk is not available as yet.
159 * But we can continue booting and complain later!
160 */
161
162 /* Copy _stext_l1 to _etext_l1 to L1 instruction SRAM */
163 dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length);
164 177
178 /* if necessary, copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */
165 l1_data_a_length = _sbss_l1 - _sdata_l1; 179 l1_data_a_length = _sbss_l1 - _sdata_l1;
166 if (l1_data_a_length > L1_DATA_A_LENGTH) 180 if (l1_data_a_length)
167 panic("L1 Data SRAM Bank A Overflow\n"); 181 early_dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length);
168
169 /* Copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */
170 dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length);
171 182
183 /* if necessary, copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */
172 l1_data_b_length = _sbss_b_l1 - _sdata_b_l1; 184 l1_data_b_length = _sbss_b_l1 - _sdata_b_l1;
173 if (l1_data_b_length > L1_DATA_B_LENGTH) 185 if (l1_data_b_length)
174 panic("L1 Data SRAM Bank B Overflow\n"); 186 early_dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length +
175
176 /* Copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */
177 dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length +
178 l1_data_a_length, l1_data_b_length); 187 l1_data_a_length, l1_data_b_length);
179 188
189 early_dma_memcpy_done();
190
191 /* if necessary, copy _stext_l2 to _edata_l2 to L2 SRAM */
180 if (L2_LENGTH != 0) { 192 if (L2_LENGTH != 0) {
181 l2_length = _sbss_l2 - _stext_l2; 193 l2_length = _sbss_l2 - _stext_l2;
182 if (l2_length > L2_LENGTH) 194 if (l2_length)
183 panic("L2 SRAM Overflow\n"); 195 memcpy(_stext_l2, _l2_lma_start, l2_length);
184
185 /* Copy _stext_l2 to _edata_l2 to L2 SRAM */
186 dma_memcpy(_stext_l2, _l2_lma_start, l2_length);
187 } 196 }
188} 197}
189 198
@@ -472,7 +481,7 @@ static __init void memory_setup(void)
472 481
473 if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) { 482 if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) {
474 console_init(); 483 console_init();
475 panic("DMA region exceeds memory limit: %lu.\n", 484 panic("DMA region exceeds memory limit: %lu.",
476 _ramend - _ramstart); 485 _ramend - _ramstart);
477 } 486 }
478 memory_end = _ramend - DMA_UNCACHED_REGION; 487 memory_end = _ramend - DMA_UNCACHED_REGION;
@@ -526,14 +535,13 @@ static __init void memory_setup(void)
526 535
527 if (mtd_size == 0) { 536 if (mtd_size == 0) {
528 console_init(); 537 console_init();
529 panic("Don't boot kernel without rootfs attached.\n"); 538 panic("Don't boot kernel without rootfs attached.");
530 } 539 }
531 540
532 /* Relocate MTD image to the top of memory after the uncached memory area */ 541 /* Relocate MTD image to the top of memory after the uncached memory area */
533 dma_memcpy((char *)memory_end, _end, mtd_size); 542 uclinux_ram_map.phys = memory_mtd_start = memory_end;
534 543 uclinux_ram_map.size = mtd_size;
535 memory_mtd_start = memory_end; 544 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
536 _ebss = memory_mtd_start; /* define _ebss for compatible */
537#endif /* CONFIG_MTD_UCLINUX */ 545#endif /* CONFIG_MTD_UCLINUX */
538 546
539#if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263) 547#if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263)
@@ -796,10 +804,8 @@ void __init setup_arch(char **cmdline_p)
796 cclk = get_cclk(); 804 cclk = get_cclk();
797 sclk = get_sclk(); 805 sclk = get_sclk();
798 806
799#if !defined(CONFIG_BFIN_KERNEL_CLOCK) 807 if ((ANOMALY_05000273 || ANOMALY_05000274) && (cclk >> 1) < sclk)
800 if (ANOMALY_05000273 && cclk == sclk) 808 panic("ANOMALY 05000273 or 05000274: CCLK must be >= 2*SCLK");
801 panic("ANOMALY 05000273, SCLK can not be same as CCLK");
802#endif
803 809
804#ifdef BF561_FAMILY 810#ifdef BF561_FAMILY
805 if (ANOMALY_05000266) { 811 if (ANOMALY_05000266) {
@@ -881,7 +887,7 @@ void __init setup_arch(char **cmdline_p)
881 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", 887 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n",
882 bfin_compiled_revid(), bfin_revid()); 888 bfin_compiled_revid(), bfin_revid());
883 if (bfin_compiled_revid() > bfin_revid()) 889 if (bfin_compiled_revid() > bfin_revid())
884 panic("Error: you are missing anomaly workarounds for this rev\n"); 890 panic("Error: you are missing anomaly workarounds for this rev");
885 } 891 }
886 } 892 }
887 if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) 893 if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX)
@@ -891,16 +897,13 @@ void __init setup_arch(char **cmdline_p)
891 897
892 /* We can't run on BF548-0.1 due to ANOMALY 05000448 */ 898 /* We can't run on BF548-0.1 due to ANOMALY 05000448 */
893 if (bfin_cpuid() == 0x27de && bfin_revid() == 1) 899 if (bfin_cpuid() == 0x27de && bfin_revid() == 1)
894 panic("You can't run on this processor due to 05000448\n"); 900 panic("You can't run on this processor due to 05000448");
895 901
896 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 902 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
897 903
898 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", 904 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
899 cclk / 1000000, sclk / 1000000); 905 cclk / 1000000, sclk / 1000000);
900 906
901 if (ANOMALY_05000273 && (cclk >> 1) <= sclk)
902 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n");
903
904 setup_bootmem_allocator(); 907 setup_bootmem_allocator();
905 908
906 paging_init(); 909 paging_init();
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index fce49d7cf001..a8f1329c15a4 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -78,11 +78,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
78 return do_mmap2(addr, len, prot, flags, fd, pgoff); 78 return do_mmap2(addr, len, prot, flags, fd, pgoff);
79} 79}
80 80
81asmlinkage int sys_getpagesize(void)
82{
83 return PAGE_SIZE;
84}
85
86asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags) 81asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags)
87{ 82{
88 return sram_alloc_with_lsl(size, flags); 83 return sram_alloc_with_lsl(size, flags);
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index 27646121280a..0791eba40d9f 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -20,8 +20,9 @@
20 20
21#include <asm/blackfin.h> 21#include <asm/blackfin.h>
22#include <asm/time.h> 22#include <asm/time.h>
23#include <asm/gptimers.h>
23 24
24#ifdef CONFIG_CYCLES_CLOCKSOURCE 25#if defined(CONFIG_CYCLES_CLOCKSOURCE)
25 26
26/* Accelerators for sched_clock() 27/* Accelerators for sched_clock()
27 * convert from cycles(64bits) => nanoseconds (64bits) 28 * convert from cycles(64bits) => nanoseconds (64bits)
@@ -58,15 +59,15 @@ static inline unsigned long long cycles_2_ns(cycle_t cyc)
58 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; 59 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
59} 60}
60 61
61static cycle_t read_cycles(struct clocksource *cs) 62static cycle_t bfin_read_cycles(struct clocksource *cs)
62{ 63{
63 return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod); 64 return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod);
64} 65}
65 66
66static struct clocksource clocksource_bfin = { 67static struct clocksource bfin_cs_cycles = {
67 .name = "bfin_cycles", 68 .name = "bfin_cs_cycles",
68 .rating = 350, 69 .rating = 350,
69 .read = read_cycles, 70 .read = bfin_read_cycles,
70 .mask = CLOCKSOURCE_MASK(64), 71 .mask = CLOCKSOURCE_MASK(64),
71 .shift = 22, 72 .shift = 22,
72 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 73 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
@@ -74,53 +75,198 @@ static struct clocksource clocksource_bfin = {
74 75
75unsigned long long sched_clock(void) 76unsigned long long sched_clock(void)
76{ 77{
77 return cycles_2_ns(read_cycles(&clocksource_bfin)); 78 return cycles_2_ns(bfin_read_cycles(&bfin_cs_cycles));
78} 79}
79 80
80static int __init bfin_clocksource_init(void) 81static int __init bfin_cs_cycles_init(void)
81{ 82{
82 set_cyc2ns_scale(get_cclk() / 1000); 83 set_cyc2ns_scale(get_cclk() / 1000);
83 84
84 clocksource_bfin.mult = clocksource_hz2mult(get_cclk(), clocksource_bfin.shift); 85 bfin_cs_cycles.mult = \
86 clocksource_hz2mult(get_cclk(), bfin_cs_cycles.shift);
85 87
86 if (clocksource_register(&clocksource_bfin)) 88 if (clocksource_register(&bfin_cs_cycles))
87 panic("failed to register clocksource"); 89 panic("failed to register clocksource");
88 90
89 return 0; 91 return 0;
90} 92}
93#else
94# define bfin_cs_cycles_init()
95#endif
96
97#ifdef CONFIG_GPTMR0_CLOCKSOURCE
98
99void __init setup_gptimer0(void)
100{
101 disable_gptimers(TIMER0bit);
102
103 set_gptimer_config(TIMER0_id, \
104 TIMER_OUT_DIS | TIMER_PERIOD_CNT | TIMER_MODE_PWM);
105 set_gptimer_period(TIMER0_id, -1);
106 set_gptimer_pwidth(TIMER0_id, -2);
107 SSYNC();
108 enable_gptimers(TIMER0bit);
109}
110
111static cycle_t bfin_read_gptimer0(void)
112{
113 return bfin_read_TIMER0_COUNTER();
114}
115
116static struct clocksource bfin_cs_gptimer0 = {
117 .name = "bfin_cs_gptimer0",
118 .rating = 400,
119 .read = bfin_read_gptimer0,
120 .mask = CLOCKSOURCE_MASK(32),
121 .shift = 22,
122 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
123};
124
125static int __init bfin_cs_gptimer0_init(void)
126{
127 setup_gptimer0();
91 128
129 bfin_cs_gptimer0.mult = \
130 clocksource_hz2mult(get_sclk(), bfin_cs_gptimer0.shift);
131
132 if (clocksource_register(&bfin_cs_gptimer0))
133 panic("failed to register clocksource");
134
135 return 0;
136}
92#else 137#else
93# define bfin_clocksource_init() 138# define bfin_cs_gptimer0_init()
94#endif 139#endif
95 140
141#ifdef CONFIG_CORE_TIMER_IRQ_L1
142__attribute__((l1_text))
143#endif
144irqreturn_t timer_interrupt(int irq, void *dev_id);
145
146static int bfin_timer_set_next_event(unsigned long, \
147 struct clock_event_device *);
148
149static void bfin_timer_set_mode(enum clock_event_mode, \
150 struct clock_event_device *);
151
152static struct clock_event_device clockevent_bfin = {
153#if defined(CONFIG_TICKSOURCE_GPTMR0)
154 .name = "bfin_gptimer0",
155 .rating = 300,
156 .irq = IRQ_TIMER0,
157#else
158 .name = "bfin_core_timer",
159 .rating = 350,
160 .irq = IRQ_CORETMR,
161#endif
162 .shift = 32,
163 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
164 .set_next_event = bfin_timer_set_next_event,
165 .set_mode = bfin_timer_set_mode,
166};
167
168static struct irqaction bfin_timer_irq = {
169#if defined(CONFIG_TICKSOURCE_GPTMR0)
170 .name = "Blackfin GPTimer0",
171#else
172 .name = "Blackfin CoreTimer",
173#endif
174 .flags = IRQF_DISABLED | IRQF_TIMER | \
175 IRQF_IRQPOLL | IRQF_PERCPU,
176 .handler = timer_interrupt,
177 .dev_id = &clockevent_bfin,
178};
179
180#if defined(CONFIG_TICKSOURCE_GPTMR0)
96static int bfin_timer_set_next_event(unsigned long cycles, 181static int bfin_timer_set_next_event(unsigned long cycles,
97 struct clock_event_device *evt) 182 struct clock_event_device *evt)
98{ 183{
184 disable_gptimers(TIMER0bit);
185
186 /* it starts counting three SCLK cycles after the TIMENx bit is set */
187 set_gptimer_pwidth(TIMER0_id, cycles - 3);
188 enable_gptimers(TIMER0bit);
189 return 0;
190}
191
192static void bfin_timer_set_mode(enum clock_event_mode mode,
193 struct clock_event_device *evt)
194{
195 switch (mode) {
196 case CLOCK_EVT_MODE_PERIODIC: {
197 set_gptimer_config(TIMER0_id, \
198 TIMER_OUT_DIS | TIMER_IRQ_ENA | \
199 TIMER_PERIOD_CNT | TIMER_MODE_PWM);
200 set_gptimer_period(TIMER0_id, get_sclk() / HZ);
201 set_gptimer_pwidth(TIMER0_id, get_sclk() / HZ - 1);
202 enable_gptimers(TIMER0bit);
203 break;
204 }
205 case CLOCK_EVT_MODE_ONESHOT:
206 disable_gptimers(TIMER0bit);
207 set_gptimer_config(TIMER0_id, \
208 TIMER_OUT_DIS | TIMER_IRQ_ENA | TIMER_MODE_PWM);
209 set_gptimer_period(TIMER0_id, 0);
210 break;
211 case CLOCK_EVT_MODE_UNUSED:
212 case CLOCK_EVT_MODE_SHUTDOWN:
213 disable_gptimers(TIMER0bit);
214 break;
215 case CLOCK_EVT_MODE_RESUME:
216 break;
217 }
218}
219
220static void bfin_timer_ack(void)
221{
222 set_gptimer_status(TIMER_GROUP1, TIMER_STATUS_TIMIL0);
223}
224
225static void __init bfin_timer_init(void)
226{
227 disable_gptimers(TIMER0bit);
228}
229
230static unsigned long __init bfin_clockevent_check(void)
231{
232 setup_irq(IRQ_TIMER0, &bfin_timer_irq);
233 return get_sclk();
234}
235
236#else /* CONFIG_TICKSOURCE_CORETMR */
237
238static int bfin_timer_set_next_event(unsigned long cycles,
239 struct clock_event_device *evt)
240{
241 bfin_write_TCNTL(TMPWR);
242 CSYNC();
99 bfin_write_TCOUNT(cycles); 243 bfin_write_TCOUNT(cycles);
100 CSYNC(); 244 CSYNC();
245 bfin_write_TCNTL(TMPWR | TMREN);
101 return 0; 246 return 0;
102} 247}
103 248
104static void bfin_timer_set_mode(enum clock_event_mode mode, 249static void bfin_timer_set_mode(enum clock_event_mode mode,
105 struct clock_event_device *evt) 250 struct clock_event_device *evt)
106{ 251{
107 switch (mode) { 252 switch (mode) {
108 case CLOCK_EVT_MODE_PERIODIC: { 253 case CLOCK_EVT_MODE_PERIODIC: {
109 unsigned long tcount = ((get_cclk() / (HZ * TIME_SCALE)) - 1); 254 unsigned long tcount = ((get_cclk() / (HZ * TIME_SCALE)) - 1);
110 bfin_write_TCNTL(TMPWR); 255 bfin_write_TCNTL(TMPWR);
111 bfin_write_TSCALE(TIME_SCALE - 1);
112 CSYNC(); 256 CSYNC();
257 bfin_write_TSCALE(TIME_SCALE - 1);
113 bfin_write_TPERIOD(tcount); 258 bfin_write_TPERIOD(tcount);
114 bfin_write_TCOUNT(tcount); 259 bfin_write_TCOUNT(tcount);
115 bfin_write_TCNTL(TMPWR | TMREN | TAUTORLD);
116 CSYNC(); 260 CSYNC();
261 bfin_write_TCNTL(TMPWR | TMREN | TAUTORLD);
117 break; 262 break;
118 } 263 }
119 case CLOCK_EVT_MODE_ONESHOT: 264 case CLOCK_EVT_MODE_ONESHOT:
265 bfin_write_TCNTL(TMPWR);
266 CSYNC();
120 bfin_write_TSCALE(TIME_SCALE - 1); 267 bfin_write_TSCALE(TIME_SCALE - 1);
268 bfin_write_TPERIOD(0);
121 bfin_write_TCOUNT(0); 269 bfin_write_TCOUNT(0);
122 bfin_write_TCNTL(TMPWR | TMREN);
123 CSYNC();
124 break; 270 break;
125 case CLOCK_EVT_MODE_UNUSED: 271 case CLOCK_EVT_MODE_UNUSED:
126 case CLOCK_EVT_MODE_SHUTDOWN: 272 case CLOCK_EVT_MODE_SHUTDOWN:
@@ -132,6 +278,10 @@ static void bfin_timer_set_mode(enum clock_event_mode mode,
132 } 278 }
133} 279}
134 280
281static void bfin_timer_ack(void)
282{
283}
284
135static void __init bfin_timer_init(void) 285static void __init bfin_timer_init(void)
136{ 286{
137 /* power up the timer, but don't enable it just yet */ 287 /* power up the timer, but don't enable it just yet */
@@ -145,38 +295,32 @@ static void __init bfin_timer_init(void)
145 bfin_write_TPERIOD(0); 295 bfin_write_TPERIOD(0);
146 bfin_write_TCOUNT(0); 296 bfin_write_TCOUNT(0);
147 297
148 /* now enable the timer */
149 CSYNC(); 298 CSYNC();
150} 299}
151 300
301static unsigned long __init bfin_clockevent_check(void)
302{
303 setup_irq(IRQ_CORETMR, &bfin_timer_irq);
304 return get_cclk() / TIME_SCALE;
305}
306
307void __init setup_core_timer(void)
308{
309 bfin_timer_init();
310 bfin_timer_set_mode(CLOCK_EVT_MODE_PERIODIC, NULL);
311}
312#endif /* CONFIG_TICKSOURCE_GPTMR0 */
313
152/* 314/*
153 * timer_interrupt() needs to keep up the real-time clock, 315 * timer_interrupt() needs to keep up the real-time clock,
154 * as well as call the "do_timer()" routine every clocktick 316 * as well as call the "do_timer()" routine every clocktick
155 */ 317 */
156#ifdef CONFIG_CORE_TIMER_IRQ_L1
157__attribute__((l1_text))
158#endif
159irqreturn_t timer_interrupt(int irq, void *dev_id);
160
161static struct clock_event_device clockevent_bfin = {
162 .name = "bfin_core_timer",
163 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
164 .shift = 32,
165 .set_next_event = bfin_timer_set_next_event,
166 .set_mode = bfin_timer_set_mode,
167};
168
169static struct irqaction bfin_timer_irq = {
170 .name = "Blackfin Core Timer",
171 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
172 .handler = timer_interrupt,
173 .dev_id = &clockevent_bfin,
174};
175
176irqreturn_t timer_interrupt(int irq, void *dev_id) 318irqreturn_t timer_interrupt(int irq, void *dev_id)
177{ 319{
178 struct clock_event_device *evt = dev_id; 320 struct clock_event_device *evt = dev_id;
321 smp_mb();
179 evt->event_handler(evt); 322 evt->event_handler(evt);
323 bfin_timer_ack();
180 return IRQ_HANDLED; 324 return IRQ_HANDLED;
181} 325}
182 326
@@ -184,9 +328,8 @@ static int __init bfin_clockevent_init(void)
184{ 328{
185 unsigned long timer_clk; 329 unsigned long timer_clk;
186 330
187 timer_clk = get_cclk() / TIME_SCALE; 331 timer_clk = bfin_clockevent_check();
188 332
189 setup_irq(IRQ_CORETMR, &bfin_timer_irq);
190 bfin_timer_init(); 333 bfin_timer_init();
191 334
192 clockevent_bfin.mult = div_sc(timer_clk, NSEC_PER_SEC, clockevent_bfin.shift); 335 clockevent_bfin.mult = div_sc(timer_clk, NSEC_PER_SEC, clockevent_bfin.shift);
@@ -218,6 +361,7 @@ void __init time_init(void)
218 xtime.tv_nsec = 0; 361 xtime.tv_nsec = 0;
219 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); 362 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
220 363
221 bfin_clocksource_init(); 364 bfin_cs_cycles_init();
365 bfin_cs_gptimer0_init();
222 bfin_clockevent_init(); 366 bfin_clockevent_init();
223} 367}
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c
index 1bbacfbd4c5d..adb54aa7d7c8 100644
--- a/arch/blackfin/kernel/time.c
+++ b/arch/blackfin/kernel/time.c
@@ -24,14 +24,10 @@
24 24
25static struct irqaction bfin_timer_irq = { 25static struct irqaction bfin_timer_irq = {
26 .name = "Blackfin Timer Tick", 26 .name = "Blackfin Timer Tick",
27#ifdef CONFIG_IRQ_PER_CPU
28 .flags = IRQF_DISABLED | IRQF_PERCPU,
29#else
30 .flags = IRQF_DISABLED 27 .flags = IRQF_DISABLED
31#endif
32}; 28};
33 29
34#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) 30#if defined(CONFIG_IPIPE)
35void __init setup_system_timer0(void) 31void __init setup_system_timer0(void)
36{ 32{
37 /* Power down the core timer, just to play safe. */ 33 /* Power down the core timer, just to play safe. */
@@ -74,7 +70,7 @@ void __init setup_core_timer(void)
74static void __init 70static void __init
75time_sched_init(irqreturn_t(*timer_routine) (int, void *)) 71time_sched_init(irqreturn_t(*timer_routine) (int, void *))
76{ 72{
77#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) 73#if defined(CONFIG_IPIPE)
78 setup_system_timer0(); 74 setup_system_timer0();
79 bfin_timer_irq.handler = timer_routine; 75 bfin_timer_irq.handler = timer_routine;
80 setup_irq(IRQ_TIMER0, &bfin_timer_irq); 76 setup_irq(IRQ_TIMER0, &bfin_timer_irq);
@@ -94,7 +90,7 @@ static unsigned long gettimeoffset(void)
94 unsigned long offset; 90 unsigned long offset;
95 unsigned long clocks_per_jiffy; 91 unsigned long clocks_per_jiffy;
96 92
97#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) 93#if defined(CONFIG_IPIPE)
98 clocks_per_jiffy = bfin_read_TIMER0_PERIOD(); 94 clocks_per_jiffy = bfin_read_TIMER0_PERIOD();
99 offset = bfin_read_TIMER0_COUNTER() / \ 95 offset = bfin_read_TIMER0_COUNTER() / \
100 (((clocks_per_jiffy + 1) * HZ) / USEC_PER_SEC); 96 (((clocks_per_jiffy + 1) * HZ) / USEC_PER_SEC);
@@ -133,36 +129,25 @@ irqreturn_t timer_interrupt(int irq, void *dummy)
133 static long last_rtc_update; 129 static long last_rtc_update;
134 130
135 write_seqlock(&xtime_lock); 131 write_seqlock(&xtime_lock);
136#if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE) 132 do_timer(1);
133
137 /* 134 /*
138 * TIMIL0 is latched in __ipipe_grab_irq() when the I-Pipe is 135 * If we have an externally synchronized Linux clock, then update
139 * enabled. 136 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
137 * called as close as possible to 500 ms before the new second starts.
140 */ 138 */
141 if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) { 139 if (ntp_synced() &&
142#endif 140 xtime.tv_sec > last_rtc_update + 660 &&
143 do_timer(1); 141 (xtime.tv_nsec / NSEC_PER_USEC) >=
144 142 500000 - ((unsigned)TICK_SIZE) / 2
145 /* 143 && (xtime.tv_nsec / NSEC_PER_USEC) <=
146 * If we have an externally synchronized Linux clock, then update 144 500000 + ((unsigned)TICK_SIZE) / 2) {
147 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be 145 if (set_rtc_mmss(xtime.tv_sec) == 0)
148 * called as close as possible to 500 ms before the new second starts. 146 last_rtc_update = xtime.tv_sec;
149 */ 147 else
150 if (ntp_synced() && 148 /* Do it again in 60s. */
151 xtime.tv_sec > last_rtc_update + 660 && 149 last_rtc_update = xtime.tv_sec - 600;
152 (xtime.tv_nsec / NSEC_PER_USEC) >=
153 500000 - ((unsigned)TICK_SIZE) / 2
154 && (xtime.tv_nsec / NSEC_PER_USEC) <=
155 500000 + ((unsigned)TICK_SIZE) / 2) {
156 if (set_rtc_mmss(xtime.tv_sec) == 0)
157 last_rtc_update = xtime.tv_sec;
158 else
159 /* Do it again in 60s. */
160 last_rtc_update = xtime.tv_sec - 600;
161 }
162#if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE)
163 set_gptimer_status(0, TIMER_STATUS_TIMIL0);
164 } 150 }
165#endif
166 write_sequnlock(&xtime_lock); 151 write_sequnlock(&xtime_lock);
167 152
168#ifdef CONFIG_IPIPE 153#ifdef CONFIG_IPIPE
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index ffe7fb53eccb..aa76dfb0226e 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -68,6 +68,13 @@
68 ({ if (0) printk(fmt, ##arg); 0; }) 68 ({ if (0) printk(fmt, ##arg); 0; })
69#endif 69#endif
70 70
71#if defined(CONFIG_DEBUG_MMRS) || defined(CONFIG_DEBUG_MMRS_MODULE)
72u32 last_seqstat;
73#ifdef CONFIG_DEBUG_MMRS_MODULE
74EXPORT_SYMBOL(last_seqstat);
75#endif
76#endif
77
71/* Initiate the event table handler */ 78/* Initiate the event table handler */
72void __init trap_init(void) 79void __init trap_init(void)
73{ 80{
@@ -79,7 +86,6 @@ void __init trap_init(void)
79static void decode_address(char *buf, unsigned long address) 86static void decode_address(char *buf, unsigned long address)
80{ 87{
81#ifdef CONFIG_DEBUG_VERBOSE 88#ifdef CONFIG_DEBUG_VERBOSE
82 struct vm_list_struct *vml;
83 struct task_struct *p; 89 struct task_struct *p;
84 struct mm_struct *mm; 90 struct mm_struct *mm;
85 unsigned long flags, offset; 91 unsigned long flags, offset;
@@ -196,6 +202,11 @@ done:
196 202
197asmlinkage void double_fault_c(struct pt_regs *fp) 203asmlinkage void double_fault_c(struct pt_regs *fp)
198{ 204{
205#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
206 int j;
207 trace_buffer_save(j);
208#endif
209
199 console_verbose(); 210 console_verbose();
200 oops_in_progress = 1; 211 oops_in_progress = 1;
201#ifdef CONFIG_DEBUG_VERBOSE 212#ifdef CONFIG_DEBUG_VERBOSE
@@ -220,9 +231,10 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
220 dump_bfin_process(fp); 231 dump_bfin_process(fp);
221 dump_bfin_mem(fp); 232 dump_bfin_mem(fp);
222 show_regs(fp); 233 show_regs(fp);
234 dump_bfin_trace_buffer();
223 } 235 }
224#endif 236#endif
225 panic("Double Fault - unrecoverable event\n"); 237 panic("Double Fault - unrecoverable event");
226 238
227} 239}
228 240
@@ -239,6 +251,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
239 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE; 251 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
240 252
241 trace_buffer_save(j); 253 trace_buffer_save(j);
254#if defined(CONFIG_DEBUG_MMRS) || defined(CONFIG_DEBUG_MMRS_MODULE)
255 last_seqstat = (u32)fp->seqstat;
256#endif
242 257
243 /* Important - be very careful dereferncing pointers - will lead to 258 /* Important - be very careful dereferncing pointers - will lead to
244 * double faults if the stack has become corrupt 259 * double faults if the stack has become corrupt
@@ -588,6 +603,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
588 force_sig_info(sig, &info, current); 603 force_sig_info(sig, &info, current);
589 } 604 }
590 605
606 if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8))
607 fp->pc = SAFE_USER_INSTRUCTION;
608
591 trace_buffer_restore(j); 609 trace_buffer_restore(j);
592 return; 610 return;
593} 611}
@@ -832,6 +850,11 @@ void show_stack(struct task_struct *task, unsigned long *stack)
832 decode_address(buf, (unsigned int)stack); 850 decode_address(buf, (unsigned int)stack);
833 printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf); 851 printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf);
834 852
853 if (!access_ok(VERIFY_READ, stack, (unsigned int)endstack - (unsigned int)stack)) {
854 printk(KERN_NOTICE "Invalid stack pointer\n");
855 return;
856 }
857
835 /* First thing is to look for a frame pointer */ 858 /* First thing is to look for a frame pointer */
836 for (addr = (unsigned int *)((unsigned int)stack & ~0xF); addr < endstack; addr++) { 859 for (addr = (unsigned int *)((unsigned int)stack & ~0xF); addr < endstack; addr++) {
837 if (*addr & 0x1) 860 if (*addr & 0x1)
@@ -1066,6 +1089,29 @@ void show_regs(struct pt_regs *fp)
1066 unsigned int cpu = smp_processor_id(); 1089 unsigned int cpu = smp_processor_id();
1067 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); 1090 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
1068 1091
1092 verbose_printk(KERN_NOTICE "\n");
1093 if (CPUID != bfin_cpuid())
1094 verbose_printk(KERN_NOTICE "Compiled for cpu family 0x%04x (Rev %d), "
1095 "but running on:0x%04x (Rev %d)\n",
1096 CPUID, bfin_compiled_revid(), bfin_cpuid(), bfin_revid());
1097
1098 verbose_printk(KERN_NOTICE "ADSP-%s-0.%d",
1099 CPU, bfin_compiled_revid());
1100
1101 if (bfin_compiled_revid() != bfin_revid())
1102 verbose_printk("(Detected 0.%d)", bfin_revid());
1103
1104 verbose_printk(" %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n",
1105 get_cclk()/1000000, get_sclk()/1000000,
1106#ifdef CONFIG_MPU
1107 "mpu on"
1108#else
1109 "mpu off"
1110#endif
1111 );
1112
1113 verbose_printk(KERN_NOTICE "%s", linux_banner);
1114
1069 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted()); 1115 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted());
1070 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n", 1116 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
1071 (long)fp->seqstat, fp->ipend, fp->syscfg); 1117 (long)fp->seqstat, fp->ipend, fp->syscfg);
@@ -1246,5 +1292,5 @@ void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
1246 dump_bfin_mem(fp); 1292 dump_bfin_mem(fp);
1247 show_regs(fp); 1293 show_regs(fp);
1248 dump_stack(); 1294 dump_stack();
1249 panic("Unrecoverable event\n"); 1295 panic("Unrecoverable event");
1250} 1296}
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 27952ae047d8..8b67167cb4f4 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -50,7 +50,9 @@ SECTIONS
50 _text = .; 50 _text = .;
51 __stext = .; 51 __stext = .;
52 TEXT_TEXT 52 TEXT_TEXT
53#ifndef CONFIG_SCHEDULE_L1
53 SCHED_TEXT 54 SCHED_TEXT
55#endif
54 LOCK_TEXT 56 LOCK_TEXT
55 KPROBES_TEXT 57 KPROBES_TEXT
56 *(.text.*) 58 *(.text.*)
@@ -180,6 +182,9 @@ SECTIONS
180 . = ALIGN(4); 182 . = ALIGN(4);
181 __stext_l1 = .; 183 __stext_l1 = .;
182 *(.l1.text) 184 *(.l1.text)
185#ifdef CONFIG_SCHEDULE_L1
186 SCHED_TEXT
187#endif
183 . = ALIGN(4); 188 . = ALIGN(4);
184 __etext_l1 = .; 189 __etext_l1 = .;
185 } 190 }
diff --git a/arch/blackfin/mach-bf518/Kconfig b/arch/blackfin/mach-bf518/Kconfig
index f397ede006bf..4c76fefb7a3b 100644
--- a/arch/blackfin/mach-bf518/Kconfig
+++ b/arch/blackfin/mach-bf518/Kconfig
@@ -156,6 +156,7 @@ config IRQ_PORTH_INTB
156 default 11 156 default 11
157config IRQ_TIMER0 157config IRQ_TIMER0
158 int "IRQ_TIMER0" 158 int "IRQ_TIMER0"
159 default 7 if TICKSOURCE_GPTMR0
159 default 8 160 default 8
160config IRQ_TIMER1 161config IRQ_TIMER1
161 int "IRQ_TIMER1" 162 int "IRQ_TIMER1"
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index 41f2eacfef20..62bba09bcce6 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -82,7 +82,11 @@ static struct physmap_flash_data ezbrd_flash_data = {
82 82
83static struct resource ezbrd_flash_resource = { 83static struct resource ezbrd_flash_resource = {
84 .start = 0x20000000, 84 .start = 0x20000000,
85#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
86 .end = 0x202fffff,
87#else
85 .end = 0x203fffff, 88 .end = 0x203fffff,
89#endif
86 .flags = IORESOURCE_MEM, 90 .flags = IORESOURCE_MEM,
87}; 91};
88 92
@@ -162,8 +166,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
162}; 166};
163#endif 167#endif
164 168
165#if defined(CONFIG_SPI_ADC_BF533) \ 169#if defined(CONFIG_BFIN_SPI_ADC) \
166 || defined(CONFIG_SPI_ADC_BF533_MODULE) 170 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
167/* SPI ADC chip */ 171/* SPI ADC chip */
168static struct bfin5xx_spi_chip spi_adc_chip_info = { 172static struct bfin5xx_spi_chip spi_adc_chip_info = {
169 .enable_dma = 1, /* use dma transfer with this chip*/ 173 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -249,8 +253,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
249 }, 253 },
250#endif 254#endif
251 255
252#if defined(CONFIG_SPI_ADC_BF533) \ 256#if defined(CONFIG_BFIN_SPI_ADC) \
253 || defined(CONFIG_SPI_ADC_BF533_MODULE) 257 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
254 { 258 {
255 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 259 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
256 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 260 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -514,7 +518,7 @@ static struct platform_device i2c_bfin_twi_device = {
514#endif 518#endif
515 519
516static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 520static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
517#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 521#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
518 { 522 {
519 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 523 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
520 }, 524 },
@@ -678,6 +682,11 @@ static int __init ezbrd_init(void)
678 ARRAY_SIZE(bfin_i2c_board_info)); 682 ARRAY_SIZE(bfin_i2c_board_info));
679 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 683 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
680 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 684 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
685 /* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */
686 peripheral_request(P_AMS2, "ParaFlash");
687#if !defined(CONFIG_SPI_BFIN) && !defined(CONFIG_SPI_BFIN_MODULE)
688 peripheral_request(P_AMS3, "ParaFlash");
689#endif
681 return 0; 690 return 0;
682} 691}
683 692
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index c847bb101076..b69bd9af38dd 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -6,14 +6,19 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file should be up to date with:
10 * - Revision B, 02/03/2009; ADSP-BF512/BF514/BF516/BF518 Blackfin Processor Anomaly List 10 * - Revision B, 02/03/2009; ADSP-BF512/BF514/BF516/BF518 Blackfin Processor Anomaly List
11 */ 11 */
12 12
13/* We plan on not supporting 0.0 silicon, but 0.1 isn't out yet - sorry */
14#if __SILICON_REVISION__ < 0
15# error will not work on BF518 silicon version
16#endif
17
13#ifndef _MACH_ANOMALY_H_ 18#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_ 19#define _MACH_ANOMALY_H_
15 20
16/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */ 21/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
17#define ANOMALY_05000074 (1) 22#define ANOMALY_05000074 (1)
18/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 23/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
19#define ANOMALY_05000122 (1) 24#define ANOMALY_05000122 (1)
@@ -47,7 +52,7 @@
47#define ANOMALY_05000435 (1) 52#define ANOMALY_05000435 (1)
48/* PORTx_DRIVE and PORTx_HYSTERESIS Registers Read Back Incorrect Values */ 53/* PORTx_DRIVE and PORTx_HYSTERESIS Registers Read Back Incorrect Values */
49#define ANOMALY_05000438 (1) 54#define ANOMALY_05000438 (1)
50/* Preboot Cannot be Used to Program the PLL_DIV Register */ 55/* Preboot Cannot be Used to Alter the PLL_DIV Register */
51#define ANOMALY_05000439 (1) 56#define ANOMALY_05000439 (1)
52/* bfrom_SysControl() Cannot be Used to Write the PLL_DIV Register */ 57/* bfrom_SysControl() Cannot be Used to Write the PLL_DIV Register */
53#define ANOMALY_05000440 (1) 58#define ANOMALY_05000440 (1)
@@ -61,32 +66,56 @@
61#define ANOMALY_05000453 (1) 66#define ANOMALY_05000453 (1)
62/* PPI_FS3 is Driven One Half Cycle Later Than PPI Data */ 67/* PPI_FS3 is Driven One Half Cycle Later Than PPI Data */
63#define ANOMALY_05000455 (1) 68#define ANOMALY_05000455 (1)
69/* False Hardware Error when RETI points to invalid memory */
70#define ANOMALY_05000461 (1)
64 71
65/* Anomalies that don't exist on this proc */ 72/* Anomalies that don't exist on this proc */
73#define ANOMALY_05000099 (0)
74#define ANOMALY_05000119 (0)
75#define ANOMALY_05000120 (0)
66#define ANOMALY_05000125 (0) 76#define ANOMALY_05000125 (0)
77#define ANOMALY_05000149 (0)
67#define ANOMALY_05000158 (0) 78#define ANOMALY_05000158 (0)
79#define ANOMALY_05000171 (0)
80#define ANOMALY_05000179 (0)
68#define ANOMALY_05000183 (0) 81#define ANOMALY_05000183 (0)
69#define ANOMALY_05000198 (0) 82#define ANOMALY_05000198 (0)
83#define ANOMALY_05000215 (0)
84#define ANOMALY_05000220 (0)
85#define ANOMALY_05000227 (0)
70#define ANOMALY_05000230 (0) 86#define ANOMALY_05000230 (0)
87#define ANOMALY_05000231 (0)
88#define ANOMALY_05000233 (0)
89#define ANOMALY_05000242 (0)
71#define ANOMALY_05000244 (0) 90#define ANOMALY_05000244 (0)
91#define ANOMALY_05000248 (0)
92#define ANOMALY_05000250 (0)
72#define ANOMALY_05000261 (0) 93#define ANOMALY_05000261 (0)
73#define ANOMALY_05000263 (0) 94#define ANOMALY_05000263 (0)
74#define ANOMALY_05000266 (0) 95#define ANOMALY_05000266 (0)
75#define ANOMALY_05000273 (0) 96#define ANOMALY_05000273 (0)
97#define ANOMALY_05000274 (0)
76#define ANOMALY_05000278 (0) 98#define ANOMALY_05000278 (0)
77#define ANOMALY_05000285 (0) 99#define ANOMALY_05000285 (0)
100#define ANOMALY_05000287 (0)
101#define ANOMALY_05000301 (0)
78#define ANOMALY_05000305 (0) 102#define ANOMALY_05000305 (0)
79#define ANOMALY_05000307 (0) 103#define ANOMALY_05000307 (0)
80#define ANOMALY_05000311 (0) 104#define ANOMALY_05000311 (0)
81#define ANOMALY_05000312 (0) 105#define ANOMALY_05000312 (0)
82#define ANOMALY_05000323 (0) 106#define ANOMALY_05000323 (0)
83#define ANOMALY_05000353 (0) 107#define ANOMALY_05000353 (0)
108#define ANOMALY_05000362 (1)
84#define ANOMALY_05000363 (0) 109#define ANOMALY_05000363 (0)
85#define ANOMALY_05000380 (0) 110#define ANOMALY_05000380 (0)
86#define ANOMALY_05000386 (0) 111#define ANOMALY_05000386 (0)
112#define ANOMALY_05000389 (0)
113#define ANOMALY_05000400 (0)
87#define ANOMALY_05000412 (0) 114#define ANOMALY_05000412 (0)
88#define ANOMALY_05000432 (0) 115#define ANOMALY_05000432 (0)
89#define ANOMALY_05000447 (0) 116#define ANOMALY_05000447 (0)
90#define ANOMALY_05000448 (0) 117#define ANOMALY_05000448 (0)
118#define ANOMALY_05000456 (0)
119#define ANOMALY_05000450 (0)
91 120
92#endif 121#endif
diff --git a/arch/blackfin/mach-bf518/include/mach/portmux.h b/arch/blackfin/mach-bf518/include/mach/portmux.h
index f618b487b2b0..a0fc77fd3315 100644
--- a/arch/blackfin/mach-bf518/include/mach/portmux.h
+++ b/arch/blackfin/mach-bf518/include/mach/portmux.h
@@ -185,6 +185,10 @@
185#define P_PTP_PPS (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(2)) 185#define P_PTP_PPS (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(2))
186#define P_PTP_CLKOUT (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(2)) 186#define P_PTP_CLKOUT (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(2))
187 187
188#define P_HWAIT (P_DEFINED | P_IDENT(GPIO_PG000000000) | P_FUNCT(1)) 188/* AMS */
189#define P_AMS2 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
190#define P_AMS3 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(2))
191
192#define P_HWAIT (P_DEFINED | P_IDENT(GPIO_PG000000000) | P_FUNCT(1))
189 193
190#endif /* _MACH_PORTMUX_H_ */ 194#endif /* _MACH_PORTMUX_H_ */
diff --git a/arch/blackfin/mach-bf527/Kconfig b/arch/blackfin/mach-bf527/Kconfig
index 8438ec6d6679..848ac6f86823 100644
--- a/arch/blackfin/mach-bf527/Kconfig
+++ b/arch/blackfin/mach-bf527/Kconfig
@@ -170,6 +170,7 @@ config IRQ_PORTH_INTB
170 default 11 170 default 11
171config IRQ_TIMER0 171config IRQ_TIMER0
172 int "IRQ_TIMER0" 172 int "IRQ_TIMER0"
173 default 7 if TICKSOURCE_GPTMR0
173 default 8 174 default 8
174config IRQ_TIMER1 175config IRQ_TIMER1
175 int "IRQ_TIMER1" 176 int "IRQ_TIMER1"
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index 48e69eecdba4..6d6f9effa0bb 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -463,8 +463,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
463}; 463};
464#endif 464#endif
465 465
466#if defined(CONFIG_SPI_ADC_BF533) \ 466#if defined(CONFIG_BFIN_SPI_ADC) \
467 || defined(CONFIG_SPI_ADC_BF533_MODULE) 467 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
468/* SPI ADC chip */ 468/* SPI ADC chip */
469static struct bfin5xx_spi_chip spi_adc_chip_info = { 469static struct bfin5xx_spi_chip spi_adc_chip_info = {
470 .enable_dma = 1, /* use dma transfer with this chip*/ 470 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -554,8 +554,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
554 }, 554 },
555#endif 555#endif
556 556
557#if defined(CONFIG_SPI_ADC_BF533) \ 557#if defined(CONFIG_BFIN_SPI_ADC) \
558 || defined(CONFIG_SPI_ADC_BF533_MODULE) 558 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
559 { 559 {
560 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 560 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
561 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 561 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -789,7 +789,7 @@ static struct platform_device i2c_bfin_twi_device = {
789#endif 789#endif
790 790
791static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 791static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
792#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 792#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
793 { 793 {
794 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 794 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
795 .type = "pcf8574_lcd", 795 .type = "pcf8574_lcd",
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index 7fe480e4ebe8..1435c5d38cd5 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -247,8 +247,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
247}; 247};
248#endif 248#endif
249 249
250#if defined(CONFIG_SPI_ADC_BF533) \ 250#if defined(CONFIG_BFIN_SPI_ADC) \
251 || defined(CONFIG_SPI_ADC_BF533_MODULE) 251 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
252/* SPI ADC chip */ 252/* SPI ADC chip */
253static struct bfin5xx_spi_chip spi_adc_chip_info = { 253static struct bfin5xx_spi_chip spi_adc_chip_info = {
254 .enable_dma = 1, /* use dma transfer with this chip*/ 254 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -354,8 +354,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
354 }, 354 },
355#endif 355#endif
356 356
357#if defined(CONFIG_SPI_ADC_BF533) \ 357#if defined(CONFIG_BFIN_SPI_ADC) \
358 || defined(CONFIG_SPI_ADC_BF533_MODULE) 358 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
359 { 359 {
360 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 360 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
361 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 361 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -586,7 +586,7 @@ static struct platform_device i2c_bfin_twi_device = {
586#endif 586#endif
587 587
588static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 588static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
589#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 589#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
590 { 590 {
591 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 591 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
592 }, 592 },
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index d0864111ef59..147edd1eb1ad 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -485,8 +485,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
485}; 485};
486#endif 486#endif
487 487
488#if defined(CONFIG_SPI_ADC_BF533) \ 488#if defined(CONFIG_BFIN_SPI_ADC) \
489 || defined(CONFIG_SPI_ADC_BF533_MODULE) 489 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
490/* SPI ADC chip */ 490/* SPI ADC chip */
491static struct bfin5xx_spi_chip spi_adc_chip_info = { 491static struct bfin5xx_spi_chip spi_adc_chip_info = {
492 .enable_dma = 1, /* use dma transfer with this chip*/ 492 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -509,6 +509,13 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
509}; 509};
510#endif 510#endif
511 511
512#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
513static struct bfin5xx_spi_chip mmc_spi_chip_info = {
514 .enable_dma = 0,
515 .bits_per_word = 8,
516};
517#endif
518
512#if defined(CONFIG_PBX) 519#if defined(CONFIG_PBX)
513static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { 520static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
514 .ctl_reg = 0x4, /* send zero */ 521 .ctl_reg = 0x4, /* send zero */
@@ -593,8 +600,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
593 }, 600 },
594#endif 601#endif
595 602
596#if defined(CONFIG_SPI_ADC_BF533) \ 603#if defined(CONFIG_BFIN_SPI_ADC) \
597 || defined(CONFIG_SPI_ADC_BF533_MODULE) 604 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
598 { 605 {
599 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 606 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
600 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 607 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -624,6 +631,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
624 .controller_data = &ad9960_spi_chip_info, 631 .controller_data = &ad9960_spi_chip_info,
625 }, 632 },
626#endif 633#endif
634#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
635 {
636 .modalias = "mmc_spi",
637 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
638 .bus_num = 0,
639 .chip_select = 3,
640 .controller_data = &mmc_spi_chip_info,
641 .mode = SPI_MODE_0,
642 },
643#endif
644
627#if defined(CONFIG_PBX) 645#if defined(CONFIG_PBX)
628 { 646 {
629 .modalias = "fxs-spi", 647 .modalias = "fxs-spi",
@@ -836,7 +854,7 @@ static struct platform_device i2c_bfin_twi_device = {
836#endif 854#endif
837 855
838static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 856static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
839#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 857#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
840 { 858 {
841 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 859 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
842 }, 860 },
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index df6808d8a6ef..c84ddea95749 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -6,14 +6,19 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file should be up to date with:
10 * - Revision B, 08/12/2008; ADSP-BF526 Blackfin Processor Anomaly List 10 * - Revision C, 03/13/2009; ADSP-BF526 Blackfin Processor Anomaly List
11 * - Revision E, 08/18/2008; ADSP-BF527 Blackfin Processor Anomaly List 11 * - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List
12 */ 12 */
13 13
14#ifndef _MACH_ANOMALY_H_ 14#ifndef _MACH_ANOMALY_H_
15#define _MACH_ANOMALY_H_ 15#define _MACH_ANOMALY_H_
16 16
17/* We do not support old silicon - sorry */
18#if __SILICON_REVISION__ < 0
19# error will not work on BF526/BF527 silicon version
20#endif
21
17#if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__) 22#if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__)
18# define ANOMALY_BF526 1 23# define ANOMALY_BF526 1
19#else 24#else
@@ -25,158 +30,203 @@
25# define ANOMALY_BF527 0 30# define ANOMALY_BF527 0
26#endif 31#endif
27 32
28/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */ 33#define _ANOMALY_BF526(rev526) (ANOMALY_BF526 && __SILICON_REVISION__ rev526)
34#define _ANOMALY_BF527(rev527) (ANOMALY_BF527 && __SILICON_REVISION__ rev527)
35#define _ANOMALY_BF526_BF527(rev526, rev527) (_ANOMALY_BF526(rev526) || _ANOMALY_BF527(rev527))
36
37/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
29#define ANOMALY_05000074 (1) 38#define ANOMALY_05000074 (1)
30/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */ 39/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
31#define ANOMALY_05000119 (1) /* note: brokenness is noted in documentation, not anomaly sheet */ 40#define ANOMALY_05000119 (1) /* note: brokenness is noted in documentation, not anomaly sheet */
32/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 41/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
33#define ANOMALY_05000122 (1) 42#define ANOMALY_05000122 (1)
34/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ 43/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
35#define ANOMALY_05000245 (1) 44#define ANOMALY_05000245 (1)
45/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
46#define ANOMALY_05000254 (1)
36/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ 47/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
37#define ANOMALY_05000265 (1) 48#define ANOMALY_05000265 (1)
38/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */ 49/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
39#define ANOMALY_05000310 (1) 50#define ANOMALY_05000310 (1)
40/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */ 51/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
41#define ANOMALY_05000313 (__SILICON_REVISION__ < 2) 52#define ANOMALY_05000313 (_ANOMALY_BF526_BF527(< 1, < 2))
42/* Incorrect Access of OTP_STATUS During otp_write() Function */ 53/* Incorrect Access of OTP_STATUS During otp_write() Function */
43#define ANOMALY_05000328 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 54#define ANOMALY_05000328 (_ANOMALY_BF527(< 2))
55/* Host DMA Boot Modes Are Not Functional */
56#define ANOMALY_05000330 (__SILICON_REVISION__ < 2)
44/* Disallowed Configuration Prevents Subsequent Allowed Configuration on Host DMA Port */ 57/* Disallowed Configuration Prevents Subsequent Allowed Configuration on Host DMA Port */
45#define ANOMALY_05000337 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 58#define ANOMALY_05000337 (_ANOMALY_BF527(< 2))
46/* Ethernet MAC MDIO Reads Do Not Meet IEEE Specification */ 59/* Ethernet MAC MDIO Reads Do Not Meet IEEE Specification */
47#define ANOMALY_05000341 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 60#define ANOMALY_05000341 (_ANOMALY_BF527(< 2))
48/* TWI May Not Operate Correctly Under Certain Signal Termination Conditions */ 61/* TWI May Not Operate Correctly Under Certain Signal Termination Conditions */
49#define ANOMALY_05000342 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 62#define ANOMALY_05000342 (_ANOMALY_BF527(< 2))
50/* USB Calibration Value Is Not Initialized */ 63/* USB Calibration Value Is Not Initialized */
51#define ANOMALY_05000346 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 64#define ANOMALY_05000346 (_ANOMALY_BF526_BF527(< 1, < 2))
52/* USB Calibration Value to use */ 65/* USB Calibration Value to use */
53#define ANOMALY_05000346_value 0xE510 66#define ANOMALY_05000346_value 0xE510
54/* Preboot Routine Incorrectly Alters Reset Value of USB Register */ 67/* Preboot Routine Incorrectly Alters Reset Value of USB Register */
55#define ANOMALY_05000347 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 68#define ANOMALY_05000347 (_ANOMALY_BF527(< 2))
56/* Security Features Are Not Functional */ 69/* Security Features Are Not Functional */
57#define ANOMALY_05000348 (ANOMALY_BF527 && __SILICON_REVISION__ < 1) 70#define ANOMALY_05000348 (_ANOMALY_BF527(< 1))
58/* bfrom_SysControl() Firmware Function Performs Improper System Reset */ 71/* bfrom_SysControl() Firmware Function Performs Improper System Reset */
59#define ANOMALY_05000353 (ANOMALY_BF526) 72#define ANOMALY_05000353 (_ANOMALY_BF526(< 1))
60/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */ 73/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */
61#define ANOMALY_05000355 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 74#define ANOMALY_05000355 (_ANOMALY_BF527(< 2))
62/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */ 75/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
63#define ANOMALY_05000357 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 76#define ANOMALY_05000357 (_ANOMALY_BF527(< 2))
64/* Incorrect Revision Number in DSPID Register */ 77/* Incorrect Revision Number in DSPID Register */
65#define ANOMALY_05000364 (ANOMALY_BF527 && __SILICON_REVISION__ == 1) 78#define ANOMALY_05000364 (_ANOMALY_BF527(== 1))
66/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */ 79/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
67#define ANOMALY_05000366 (1) 80#define ANOMALY_05000366 (1)
68/* Incorrect Default CSEL Value in PLL_DIV */ 81/* Incorrect Default CSEL Value in PLL_DIV */
69#define ANOMALY_05000368 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 82#define ANOMALY_05000368 (_ANOMALY_BF527(< 2))
70/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */ 83/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
71#define ANOMALY_05000371 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 84#define ANOMALY_05000371 (_ANOMALY_BF527(< 2))
72/* Authentication Fails To Initiate */ 85/* Authentication Fails To Initiate */
73#define ANOMALY_05000376 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 86#define ANOMALY_05000376 (_ANOMALY_BF527(< 2))
74/* Data Read From L3 Memory by USB DMA May be Corrupted */ 87/* Data Read From L3 Memory by USB DMA May be Corrupted */
75#define ANOMALY_05000380 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 88#define ANOMALY_05000380 (_ANOMALY_BF527(< 2))
76/* 8-Bit NAND Flash Boot Mode Not Functional */ 89/* 8-Bit NAND Flash Boot Mode Not Functional */
77#define ANOMALY_05000382 (__SILICON_REVISION__ < 2) 90#define ANOMALY_05000382 (_ANOMALY_BF526_BF527(< 1, < 2))
78/* Host Must Not Read Back During Host DMA Boot */
79#define ANOMALY_05000384 (ANOMALY_BF527 && __SILICON_REVISION__ < 2)
80/* Boot from OTP Memory Not Functional */ 91/* Boot from OTP Memory Not Functional */
81#define ANOMALY_05000385 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 92#define ANOMALY_05000385 (_ANOMALY_BF527(< 2))
82/* bfrom_SysControl() Firmware Routine Not Functional */ 93/* bfrom_SysControl() Firmware Routine Not Functional */
83#define ANOMALY_05000386 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 94#define ANOMALY_05000386 (_ANOMALY_BF527(< 2))
84/* Programmable Preboot Settings Not Functional */ 95/* Programmable Preboot Settings Not Functional */
85#define ANOMALY_05000387 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 96#define ANOMALY_05000387 (_ANOMALY_BF527(< 2))
86/* CRC32 Checksum Support Not Functional */ 97/* CRC32 Checksum Support Not Functional */
87#define ANOMALY_05000388 (__SILICON_REVISION__ < 2) 98#define ANOMALY_05000388 (_ANOMALY_BF526_BF527(< 1, < 2))
88/* Reset Vector Must Not Be in SDRAM Memory Space */ 99/* Reset Vector Must Not Be in SDRAM Memory Space */
89#define ANOMALY_05000389 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 100#define ANOMALY_05000389 (_ANOMALY_BF527(< 2))
90/* pTempCurrent Not Present in ADI_BOOT_DATA Structure */ 101/* pTempCurrent Not Present in ADI_BOOT_DATA Structure */
91#define ANOMALY_05000392 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 102#define ANOMALY_05000392 (_ANOMALY_BF527(< 2))
92/* Deprecated Value of dTempByteCount in ADI_BOOT_DATA Structure */ 103/* Deprecated Value of dTempByteCount in ADI_BOOT_DATA Structure */
93#define ANOMALY_05000393 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 104#define ANOMALY_05000393 (_ANOMALY_BF527(< 2))
94/* Log Buffer Not Functional */ 105/* Log Buffer Not Functional */
95#define ANOMALY_05000394 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 106#define ANOMALY_05000394 (_ANOMALY_BF527(< 2))
96/* Hook Routine Not Functional */ 107/* Hook Routine Not Functional */
97#define ANOMALY_05000395 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 108#define ANOMALY_05000395 (_ANOMALY_BF527(< 2))
98/* Header Indirect Bit Not Functional */ 109/* Header Indirect Bit Not Functional */
99#define ANOMALY_05000396 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 110#define ANOMALY_05000396 (_ANOMALY_BF527(< 2))
100/* BK_ONES, BK_ZEROS, and BK_DATECODE Constants Not Functional */ 111/* BK_ONES, BK_ZEROS, and BK_DATECODE Constants Not Functional */
101#define ANOMALY_05000397 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 112#define ANOMALY_05000397 (_ANOMALY_BF527(< 2))
102/* SWRESET, DFRESET and WDRESET Bits in the SYSCR Register Not Functional */ 113/* SWRESET, DFRESET and WDRESET Bits in the SYSCR Register Not Functional */
103#define ANOMALY_05000398 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 114#define ANOMALY_05000398 (_ANOMALY_BF527(< 2))
104/* BCODE_NOBOOT in BCODE Field of SYSCR Register Not Functional */ 115/* BCODE_NOBOOT in BCODE Field of SYSCR Register Not Functional */
105#define ANOMALY_05000399 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 116#define ANOMALY_05000399 (_ANOMALY_BF527(< 2))
106/* PPI Data Signals D0 and D8 do not Tristate After Disabling PPI */ 117/* PPI Data Signals D0 and D8 do not Tristate After Disabling PPI */
107#define ANOMALY_05000401 (__SILICON_REVISION__ < 2) 118#define ANOMALY_05000401 (_ANOMALY_BF526_BF527(< 1, < 2))
108/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ 119/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
109#define ANOMALY_05000403 (__SILICON_REVISION__ < 2) 120#define ANOMALY_05000403 (_ANOMALY_BF526_BF527(< 1, < 2))
110/* Lockbox SESR Disallows Certain User Interrupts */ 121/* Lockbox SESR Disallows Certain User Interrupts */
111#define ANOMALY_05000404 (__SILICON_REVISION__ < 2) 122#define ANOMALY_05000404 (_ANOMALY_BF526_BF527(< 1, < 2))
112/* Lockbox SESR Firmware Does Not Save/Restore Full Context */ 123/* Lockbox SESR Firmware Does Not Save/Restore Full Context */
113#define ANOMALY_05000405 (1) 124#define ANOMALY_05000405 (1)
114/* Lockbox SESR Firmware Arguments Are Not Retained After First Initialization */ 125/* Lockbox SESR Firmware Arguments Are Not Retained After First Initialization */
115#define ANOMALY_05000407 (__SILICON_REVISION__ < 2) 126#define ANOMALY_05000407 (_ANOMALY_BF526_BF527(< 1, < 2))
116/* Lockbox Firmware Memory Cleanup Routine Does not Clear Registers */ 127/* Lockbox Firmware Memory Cleanup Routine Does not Clear Registers */
117#define ANOMALY_05000408 (1) 128#define ANOMALY_05000408 (1)
118/* Lockbox firmware leaves MDMA0 channel enabled */ 129/* Lockbox firmware leaves MDMA0 channel enabled */
119#define ANOMALY_05000409 (__SILICON_REVISION__ < 2) 130#define ANOMALY_05000409 (_ANOMALY_BF526_BF527(< 1, < 2))
120/* Incorrect Default Internal Voltage Regulator Setting */ 131/* Incorrect Default Internal Voltage Regulator Setting */
121#define ANOMALY_05000410 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 132#define ANOMALY_05000410 (_ANOMALY_BF527(< 2))
122/* bfrom_SysControl() Firmware Function Cannot be Used to Enter Power Saving Modes */ 133/* bfrom_SysControl() Firmware Function Cannot be Used to Enter Power Saving Modes */
123#define ANOMALY_05000411 (__SILICON_REVISION__ < 2) 134#define ANOMALY_05000411 (_ANOMALY_BF526_BF527(< 1, < 2))
124/* OTP_CHECK_FOR_PREV_WRITE Bit is Not Functional in bfrom_OtpWrite() API */ 135/* OTP_CHECK_FOR_PREV_WRITE Bit is Not Functional in bfrom_OtpWrite() API */
125#define ANOMALY_05000414 (__SILICON_REVISION__ < 2) 136#define ANOMALY_05000414 (_ANOMALY_BF526_BF527(< 1, < 2))
126/* DEB2_URGENT Bit Not Functional */ 137/* DEB2_URGENT Bit Not Functional */
127#define ANOMALY_05000415 (__SILICON_REVISION__ < 2) 138#define ANOMALY_05000415 (_ANOMALY_BF526_BF527(< 1, < 2))
128/* Speculative Fetches Can Cause Undesired External FIFO Operations */ 139/* Speculative Fetches Can Cause Undesired External FIFO Operations */
129#define ANOMALY_05000416 (1) 140#define ANOMALY_05000416 (1)
130/* SPORT0 Ignores External TSCLK0 on PG14 When TMR6 is an Output */ 141/* SPORT0 Ignores External TSCLK0 on PG14 When TMR6 is an Output */
131#define ANOMALY_05000417 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 142#define ANOMALY_05000417 (_ANOMALY_BF527(< 2))
132/* tSFSPE and tHFSPE Do Not Meet Data Sheet Specifications */ 143/* PPI Timing Requirements tSFSPE and tHFSPE Do Not Meet Data Sheet Specifications */
133#define ANOMALY_05000418 (__SILICON_REVISION__ < 2) 144#define ANOMALY_05000418 (_ANOMALY_BF526_BF527(< 1, < 2))
134/* USB PLL_STABLE Bit May Not Accurately Reflect the USB PLL's Status */ 145/* USB PLL_STABLE Bit May Not Accurately Reflect the USB PLL's Status */
135#define ANOMALY_05000420 (__SILICON_REVISION__ < 2) 146#define ANOMALY_05000420 (_ANOMALY_BF526_BF527(< 1, < 2))
136/* TWI Fall Time (Tof) May Violate the Minimum I2C Specification */ 147/* TWI Fall Time (Tof) May Violate the Minimum I2C Specification */
137#define ANOMALY_05000421 (1) 148#define ANOMALY_05000421 (1)
138/* TWI Input Capacitance (Ci) May Violate the Maximum I2C Specification */ 149/* TWI Input Capacitance (Ci) May Violate the Maximum I2C Specification */
139#define ANOMALY_05000422 (ANOMALY_BF527 && __SILICON_REVISION__ > 1) 150#define ANOMALY_05000422 (_ANOMALY_BF526_BF527(> 0, > 1))
140/* Certain Ethernet Frames With Errors are Misclassified in RMII Mode */ 151/* Certain Ethernet Frames With Errors are Misclassified in RMII Mode */
141#define ANOMALY_05000423 (__SILICON_REVISION__ < 2) 152#define ANOMALY_05000423 (_ANOMALY_BF526_BF527(< 1, < 2))
142/* Internal Voltage Regulator Not Trimmed */ 153/* Internal Voltage Regulator Not Trimmed */
143#define ANOMALY_05000424 (ANOMALY_BF527 && __SILICON_REVISION__ < 2) 154#define ANOMALY_05000424 (_ANOMALY_BF527(< 2))
144/* Multichannel SPORT Channel Misalignment Under Specific Configuration */ 155/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
145#define ANOMALY_05000425 (__SILICON_REVISION__ < 2) 156#define ANOMALY_05000425 (_ANOMALY_BF526_BF527(< 1, < 2))
146/* Speculative Fetches of Indirect-Pointer Instructions Can Cause Spurious Hardware Errors */ 157/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
147#define ANOMALY_05000426 (1) 158#define ANOMALY_05000426 (1)
148/* WB_EDGE Bit in NFC_IRQSTAT Incorrectly Reflects Buffer Status Instead of IRQ Status */ 159/* WB_EDGE Bit in NFC_IRQSTAT Incorrectly Reflects Buffer Status Instead of IRQ Status */
149#define ANOMALY_05000429 (__SILICON_REVISION__ < 2) 160#define ANOMALY_05000429 (_ANOMALY_BF526_BF527(< 1, < 2))
150/* Software System Reset Corrupts PLL_LOCKCNT Register */ 161/* Software System Reset Corrupts PLL_LOCKCNT Register */
151#define ANOMALY_05000430 (ANOMALY_BF527 && __SILICON_REVISION__ > 1) 162#define ANOMALY_05000430 (_ANOMALY_BF527(> 1))
163/* Incorrect Use of Stack in Lockbox Firmware During Authentication */
164#define ANOMALY_05000431 (1)
152/* bfrom_SysControl() Does Not Clear SIC_IWR1 Before Executing PLL Programming Sequence */ 165/* bfrom_SysControl() Does Not Clear SIC_IWR1 Before Executing PLL Programming Sequence */
153#define ANOMALY_05000432 (ANOMALY_BF526) 166#define ANOMALY_05000432 (_ANOMALY_BF526(< 1))
154/* Certain SIC Registers are not Reset After Soft or Core Double Fault Reset */ 167/* Certain SIC Registers are not Reset After Soft or Core Double Fault Reset */
155#define ANOMALY_05000435 ((ANOMALY_BF526 && __SILICON_REVISION__ < 1) || ANOMALY_BF527) 168#define ANOMALY_05000435 (_ANOMALY_BF526_BF527(< 1, >= 0))
169/* Preboot Cannot be Used to Alter the PLL_DIV Register */
170#define ANOMALY_05000439 (_ANOMALY_BF526_BF527(< 1, >= 0))
171/* bfrom_SysControl() Cannot be Used to Write the PLL_DIV Register */
172#define ANOMALY_05000440 (_ANOMALY_BF526_BF527(< 1, >= 0))
173/* OTP Write Accesses Not Supported */
174#define ANOMALY_05000442 (_ANOMALY_BF527(< 1))
156/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 175/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
157#define ANOMALY_05000443 (1) 176#define ANOMALY_05000443 (1)
177/* The WURESET Bit in the SYSCR Register is not Functional */
178#define ANOMALY_05000445 (1)
179/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */
180#define ANOMALY_05000451 (1)
181/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */
182#define ANOMALY_05000452 (_ANOMALY_BF526_BF527(< 1, >= 0))
183/* USB Receive Interrupt Is Not Generated in DMA Mode 1 */
184#define ANOMALY_05000456 (1)
185/* Host DMA Port Responds to Certain Bus Activity Without HOST_CE Assertion */
186#define ANOMALY_05000457 (1)
187/* False Hardware Error when RETI points to invalid memory */
188#define ANOMALY_05000461 (1)
158 189
159/* Anomalies that don't exist on this proc */ 190/* Anomalies that don't exist on this proc */
191#define ANOMALY_05000099 (0)
192#define ANOMALY_05000120 (0)
160#define ANOMALY_05000125 (0) 193#define ANOMALY_05000125 (0)
194#define ANOMALY_05000149 (0)
161#define ANOMALY_05000158 (0) 195#define ANOMALY_05000158 (0)
196#define ANOMALY_05000171 (0)
197#define ANOMALY_05000179 (0)
162#define ANOMALY_05000183 (0) 198#define ANOMALY_05000183 (0)
163#define ANOMALY_05000198 (0) 199#define ANOMALY_05000198 (0)
200#define ANOMALY_05000215 (0)
201#define ANOMALY_05000220 (0)
202#define ANOMALY_05000227 (0)
164#define ANOMALY_05000230 (0) 203#define ANOMALY_05000230 (0)
204#define ANOMALY_05000231 (0)
205#define ANOMALY_05000233 (0)
206#define ANOMALY_05000242 (0)
165#define ANOMALY_05000244 (0) 207#define ANOMALY_05000244 (0)
208#define ANOMALY_05000248 (0)
209#define ANOMALY_05000250 (0)
166#define ANOMALY_05000261 (0) 210#define ANOMALY_05000261 (0)
167#define ANOMALY_05000263 (0) 211#define ANOMALY_05000263 (0)
168#define ANOMALY_05000266 (0) 212#define ANOMALY_05000266 (0)
169#define ANOMALY_05000273 (0) 213#define ANOMALY_05000273 (0)
214#define ANOMALY_05000274 (0)
170#define ANOMALY_05000278 (0) 215#define ANOMALY_05000278 (0)
171#define ANOMALY_05000285 (0) 216#define ANOMALY_05000285 (0)
217#define ANOMALY_05000287 (0)
218#define ANOMALY_05000301 (0)
172#define ANOMALY_05000305 (0) 219#define ANOMALY_05000305 (0)
173#define ANOMALY_05000307 (0) 220#define ANOMALY_05000307 (0)
174#define ANOMALY_05000311 (0) 221#define ANOMALY_05000311 (0)
175#define ANOMALY_05000312 (0) 222#define ANOMALY_05000312 (0)
176#define ANOMALY_05000323 (0) 223#define ANOMALY_05000323 (0)
224#define ANOMALY_05000362 (1)
177#define ANOMALY_05000363 (0) 225#define ANOMALY_05000363 (0)
226#define ANOMALY_05000400 (0)
178#define ANOMALY_05000412 (0) 227#define ANOMALY_05000412 (0)
179#define ANOMALY_05000447 (0) 228#define ANOMALY_05000447 (0)
180#define ANOMALY_05000448 (0) 229#define ANOMALY_05000448 (0)
230#define ANOMALY_05000450 (0)
181 231
182#endif 232#endif
diff --git a/arch/blackfin/mach-bf533/Kconfig b/arch/blackfin/mach-bf533/Kconfig
index 14427de7d77f..4c572443147e 100644
--- a/arch/blackfin/mach-bf533/Kconfig
+++ b/arch/blackfin/mach-bf533/Kconfig
@@ -59,6 +59,7 @@ config DMA7_UARTTX
59 default 10 59 default 10
60config TIMER0 60config TIMER0
61 int "TIMER0" 61 int "TIMER0"
62 default 7 if TICKSOURCE_GPTMR0
62 default 8 63 default 8
63config TIMER1 64config TIMER1
64 int "TIMER1" 65 int "TIMER1"
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 0c66bf44cfab..895f213ea454 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -173,7 +173,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
173}; 173};
174#endif 174#endif
175 175
176#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 176#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
177/* SPI ADC chip */ 177/* SPI ADC chip */
178static struct bfin5xx_spi_chip spi_adc_chip_info = { 178static struct bfin5xx_spi_chip spi_adc_chip_info = {
179 .ctl_reg = 0x1000, 179 .ctl_reg = 0x1000,
@@ -216,7 +216,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
216 }, 216 },
217#endif 217#endif
218 218
219#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 219#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
220 { 220 {
221 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 221 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
222 .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */ 222 .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index e8974878d8c2..a727e538fa28 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -82,7 +82,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
82#endif 82#endif
83 83
84/* SPI ADC chip */ 84/* SPI ADC chip */
85#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 85#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
86static struct bfin5xx_spi_chip spi_adc_chip_info = { 86static struct bfin5xx_spi_chip spi_adc_chip_info = {
87 .enable_dma = 1, /* use dma transfer with this chip*/ 87 .enable_dma = 1, /* use dma transfer with this chip*/
88 .bits_per_word = 16, 88 .bits_per_word = 16,
@@ -117,7 +117,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
117 }, 117 },
118#endif 118#endif
119 119
120#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 120#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
121 { 121 {
122 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 122 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
123 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 123 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 08cd0969de47..842f1c9c2393 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -118,7 +118,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
118}; 118};
119#endif 119#endif
120 120
121#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 121#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
122/* SPI ADC chip */ 122/* SPI ADC chip */
123static struct bfin5xx_spi_chip spi_adc_chip_info = { 123static struct bfin5xx_spi_chip spi_adc_chip_info = {
124 .enable_dma = 1, /* use dma transfer with this chip*/ 124 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -154,7 +154,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
154 }, 154 },
155#endif 155#endif
156 156
157#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 157#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
158 { 158 {
159 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 159 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
160 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 160 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index db96f33f72e2..e19c565ade16 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -192,7 +192,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
192}; 192};
193#endif 193#endif
194 194
195#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 195#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
196/* SPI ADC chip */ 196/* SPI ADC chip */
197static struct bfin5xx_spi_chip spi_adc_chip_info = { 197static struct bfin5xx_spi_chip spi_adc_chip_info = {
198 .enable_dma = 1, /* use dma transfer with this chip*/ 198 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -237,7 +237,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
237 }, 237 },
238#endif 238#endif
239 239
240#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 240#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
241 { 241 {
242 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 242 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
243 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 243 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -448,7 +448,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
448 .irq = 39, 448 .irq = 39,
449 }, 449 },
450#endif 450#endif
451#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 451#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
452 { 452 {
453 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 453 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
454 }, 454 },
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index 1cf893e2e55b..31145b509e20 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -6,7 +6,7 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file should be up to date with:
10 * - Revision E, 09/18/2008; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List 10 * - Revision E, 09/18/2008; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List
11 */ 11 */
12 12
@@ -34,12 +34,12 @@
34# define ANOMALY_BF533 0 34# define ANOMALY_BF533 0
35#endif 35#endif
36 36
37/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot 2 Not Supported */ 37/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
38#define ANOMALY_05000074 (1) 38#define ANOMALY_05000074 (1)
39/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */ 39/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */
40#define ANOMALY_05000099 (__SILICON_REVISION__ < 5) 40#define ANOMALY_05000099 (__SILICON_REVISION__ < 5)
41/* Watchpoint Status Register (WPSTAT) Bits Are Set on Every Corresponding Match */ 41/* Watchpoint Status Register (WPSTAT) Bits Are Set on Every Corresponding Match */
42#define ANOMALY_05000105 (1) 42#define ANOMALY_05000105 (__SILICON_REVISION__ > 2)
43/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */ 43/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
44#define ANOMALY_05000119 (1) 44#define ANOMALY_05000119 (1)
45/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 45/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
@@ -48,7 +48,7 @@
48#define ANOMALY_05000158 (__SILICON_REVISION__ < 5) 48#define ANOMALY_05000158 (__SILICON_REVISION__ < 5)
49/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */ 49/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */
50#define ANOMALY_05000166 (1) 50#define ANOMALY_05000166 (1)
51/* Turning Serial Ports on with External Frame Syncs */ 51/* Turning SPORTs on while External Frame Sync Is Active May Corrupt Data */
52#define ANOMALY_05000167 (1) 52#define ANOMALY_05000167 (1)
53/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */ 53/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */
54#define ANOMALY_05000179 (__SILICON_REVISION__ < 5) 54#define ANOMALY_05000179 (__SILICON_REVISION__ < 5)
@@ -67,9 +67,9 @@
67/* Current DMA Address Shows Wrong Value During Carry Fix */ 67/* Current DMA Address Shows Wrong Value During Carry Fix */
68#define ANOMALY_05000199 (__SILICON_REVISION__ < 4) 68#define ANOMALY_05000199 (__SILICON_REVISION__ < 4)
69/* SPORT TFS and DT Are Incorrectly Driven During Inactive Channels in Certain Conditions */ 69/* SPORT TFS and DT Are Incorrectly Driven During Inactive Channels in Certain Conditions */
70#define ANOMALY_05000200 (__SILICON_REVISION__ < 5) 70#define ANOMALY_05000200 (__SILICON_REVISION__ == 3 || __SILICON_REVISION__ == 4)
71/* Receive Frame Sync Not Ignored During Active Frames in SPORT Multi-Channel Mode */ 71/* Receive Frame Sync Not Ignored During Active Frames in SPORT Multi-Channel Mode */
72#define ANOMALY_05000201 (__SILICON_REVISION__ < 4) 72#define ANOMALY_05000201 (__SILICON_REVISION__ == 3)
73/* Possible Infinite Stall with Specific Dual-DAG Situation */ 73/* Possible Infinite Stall with Specific Dual-DAG Situation */
74#define ANOMALY_05000202 (__SILICON_REVISION__ < 5) 74#define ANOMALY_05000202 (__SILICON_REVISION__ < 5)
75/* Specific Sequence That Can Cause DMA Error or DMA Stopping */ 75/* Specific Sequence That Can Cause DMA Error or DMA Stopping */
@@ -104,7 +104,7 @@
104#define ANOMALY_05000242 (__SILICON_REVISION__ < 5) 104#define ANOMALY_05000242 (__SILICON_REVISION__ < 5)
105/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */ 105/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
106#define ANOMALY_05000244 (__SILICON_REVISION__ < 5) 106#define ANOMALY_05000244 (__SILICON_REVISION__ < 5)
107/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ 107/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
108#define ANOMALY_05000245 (1) 108#define ANOMALY_05000245 (1)
109/* Data CPLBs Should Prevent Spurious Hardware Errors */ 109/* Data CPLBs Should Prevent Spurious Hardware Errors */
110#define ANOMALY_05000246 (__SILICON_REVISION__ < 5) 110#define ANOMALY_05000246 (__SILICON_REVISION__ < 5)
@@ -137,7 +137,7 @@
137/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */ 137/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
138#define ANOMALY_05000270 (__SILICON_REVISION__ < 5) 138#define ANOMALY_05000270 (__SILICON_REVISION__ < 5)
139/* Spontaneous Reset of Internal Voltage Regulator */ 139/* Spontaneous Reset of Internal Voltage Regulator */
140#define ANOMALY_05000271 (__SILICON_REVISION__ < 4) 140#define ANOMALY_05000271 (__SILICON_REVISION__ == 3)
141/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */ 141/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
142#define ANOMALY_05000272 (1) 142#define ANOMALY_05000272 (1)
143/* Writes to Synchronous SDRAM Memory May Be Lost */ 143/* Writes to Synchronous SDRAM Memory May Be Lost */
@@ -165,14 +165,14 @@
165/* New Feature: Additional PPI Frame Sync Sampling Options (Not Available On Older Silicon) */ 165/* New Feature: Additional PPI Frame Sync Sampling Options (Not Available On Older Silicon) */
166#define ANOMALY_05000306 (__SILICON_REVISION__ < 5) 166#define ANOMALY_05000306 (__SILICON_REVISION__ < 5)
167/* SCKELOW Bit Does Not Maintain State Through Hibernate */ 167/* SCKELOW Bit Does Not Maintain State Through Hibernate */
168#define ANOMALY_05000307 (1) 168#define ANOMALY_05000307 (1) /* note: brokenness is noted in documentation, not anomaly sheet */
169/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */ 169/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
170#define ANOMALY_05000310 (1) 170#define ANOMALY_05000310 (1)
171/* Erroneous Flag (GPIO) Pin Operations under Specific Sequences */ 171/* Erroneous Flag (GPIO) Pin Operations under Specific Sequences */
172#define ANOMALY_05000311 (__SILICON_REVISION__ < 6) 172#define ANOMALY_05000311 (__SILICON_REVISION__ < 6)
173/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */ 173/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
174#define ANOMALY_05000312 (__SILICON_REVISION__ < 6) 174#define ANOMALY_05000312 (__SILICON_REVISION__ < 6)
175/* PPI Is Level-Sensitive on First Transfer */ 175/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
176#define ANOMALY_05000313 (__SILICON_REVISION__ < 6) 176#define ANOMALY_05000313 (__SILICON_REVISION__ < 6)
177/* Killed System MMR Write Completes Erroneously On Next System MMR Access */ 177/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
178#define ANOMALY_05000315 (__SILICON_REVISION__ < 6) 178#define ANOMALY_05000315 (__SILICON_REVISION__ < 6)
@@ -200,17 +200,63 @@
200#define ANOMALY_05000426 (1) 200#define ANOMALY_05000426 (1)
201/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 201/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
202#define ANOMALY_05000443 (1) 202#define ANOMALY_05000443 (1)
203/* False Hardware Error when RETI points to invalid memory */
204#define ANOMALY_05000461 (1)
203 205
204/* These anomalies have been "phased" out of analog.com anomaly sheets and are 206/* These anomalies have been "phased" out of analog.com anomaly sheets and are
205 * here to show running on older silicon just isn't feasible. 207 * here to show running on older silicon just isn't feasible.
206 */ 208 */
207 209
210/* Internal voltage regulator can't be modified via register writes */
211#define ANOMALY_05000066 (__SILICON_REVISION__ < 2)
208/* Watchpoints (Hardware Breakpoints) are not supported */ 212/* Watchpoints (Hardware Breakpoints) are not supported */
209#define ANOMALY_05000067 (__SILICON_REVISION__ < 3) 213#define ANOMALY_05000067 (__SILICON_REVISION__ < 3)
214/* SDRAM PSSE bit cannot be set again after SDRAM Powerup */
215#define ANOMALY_05000070 (__SILICON_REVISION__ < 2)
216/* Writing FIO_DIR can corrupt a programmable flag's data */
217#define ANOMALY_05000079 (__SILICON_REVISION__ < 2)
218/* Timer Auto-Baud Mode requires the UART clock to be enabled */
219#define ANOMALY_05000086 (__SILICON_REVISION__ < 2)
220/* Internal Clocking Modes on SPORT0 not supported */
221#define ANOMALY_05000088 (__SILICON_REVISION__ < 2)
222/* Internal voltage regulator does not wake up from an RTC wakeup */
223#define ANOMALY_05000092 (__SILICON_REVISION__ < 2)
224/* The IFLUSH instruction must be preceded by a CSYNC instruction */
225#define ANOMALY_05000093 (__SILICON_REVISION__ < 2)
226/* Vectoring to an instruction that is presently being filled into the instruction cache may cause erroneous behavior */
227#define ANOMALY_05000095 (__SILICON_REVISION__ < 2)
228/* PREFETCH, FLUSH, and FLUSHINV must be followed by a CSYNC */
229#define ANOMALY_05000096 (__SILICON_REVISION__ < 2)
230/* Performance Monitor 0 and 1 are swapped when monitoring memory events */
231#define ANOMALY_05000097 (__SILICON_REVISION__ < 2)
232/* 32-bit SPORT DMA will be word reversed */
233#define ANOMALY_05000098 (__SILICON_REVISION__ < 2)
234/* Incorrect status in the UART_IIR register */
235#define ANOMALY_05000100 (__SILICON_REVISION__ < 2)
236/* Reading X_MODIFY or Y_MODIFY while DMA channel is active */
237#define ANOMALY_05000101 (__SILICON_REVISION__ < 2)
238/* Descriptor-based MemDMA may lock up with 32-bit transfers or if transfers span 64KB buffers */
239#define ANOMALY_05000102 (__SILICON_REVISION__ < 2)
240/* Incorrect value written to the cycle counters */
241#define ANOMALY_05000103 (__SILICON_REVISION__ < 2)
242/* Stores to L1 Data memory incorrect when a specific sequence is followed */
243#define ANOMALY_05000104 (__SILICON_REVISION__ < 2)
244/* Programmable Flag (PF3) functionality not supported in all PPI modes */
245#define ANOMALY_05000106 (__SILICON_REVISION__ < 2)
246/* Data store can be lost when targeting a cache line fill */
247#define ANOMALY_05000107 (__SILICON_REVISION__ < 2)
210/* Reserved bits in SYSCFG register not set at power on */ 248/* Reserved bits in SYSCFG register not set at power on */
211#define ANOMALY_05000109 (__SILICON_REVISION__ < 3) 249#define ANOMALY_05000109 (__SILICON_REVISION__ < 3)
250/* Infinite Core Stall */
251#define ANOMALY_05000114 (__SILICON_REVISION__ < 2)
252/* PPI_FSx may glitch when generated by the on chip Timers */
253#define ANOMALY_05000115 (__SILICON_REVISION__ < 2)
212/* Trace Buffers may record discontinuities into emulation mode and/or exception, NMI, reset handlers */ 254/* Trace Buffers may record discontinuities into emulation mode and/or exception, NMI, reset handlers */
213#define ANOMALY_05000116 (__SILICON_REVISION__ < 3) 255#define ANOMALY_05000116 (__SILICON_REVISION__ < 3)
256/* DTEST registers allow access to Data Cache when DTEST_COMMAND< 14 >= 0 */
257#define ANOMALY_05000117 (__SILICON_REVISION__ < 2)
258/* Booting from an 8-bit or 24-bit Addressable SPI device is not supported */
259#define ANOMALY_05000118 (__SILICON_REVISION__ < 2)
214/* DTEST_COMMAND initiated memory access may be incorrect if data cache or DMA is active */ 260/* DTEST_COMMAND initiated memory access may be incorrect if data cache or DMA is active */
215#define ANOMALY_05000123 (__SILICON_REVISION__ < 3) 261#define ANOMALY_05000123 (__SILICON_REVISION__ < 3)
216/* DMA Lock-up at CCLK to SCLK ratios of 4:1, 2:1, or 1:1 */ 262/* DMA Lock-up at CCLK to SCLK ratios of 4:1, 2:1, or 1:1 */
@@ -222,7 +268,9 @@
222/* DMEM_CONTROL is not set on Reset */ 268/* DMEM_CONTROL is not set on Reset */
223#define ANOMALY_05000137 (__SILICON_REVISION__ < 3) 269#define ANOMALY_05000137 (__SILICON_REVISION__ < 3)
224/* SPI boot will not complete if there is a zero fill block in the loader file */ 270/* SPI boot will not complete if there is a zero fill block in the loader file */
225#define ANOMALY_05000138 (__SILICON_REVISION__ < 3) 271#define ANOMALY_05000138 (__SILICON_REVISION__ == 2)
272/* Timerx_Config must be set for using the PPI in GP output mode with internal Frame Syncs */
273#define ANOMALY_05000139 (__SILICON_REVISION__ < 2)
226/* Allowing the SPORT RX FIFO to fill will cause an overflow */ 274/* Allowing the SPORT RX FIFO to fill will cause an overflow */
227#define ANOMALY_05000140 (__SILICON_REVISION__ < 3) 275#define ANOMALY_05000140 (__SILICON_REVISION__ < 3)
228/* An Infinite Stall occurs with a particular sequence of consecutive dual dag events */ 276/* An Infinite Stall occurs with a particular sequence of consecutive dual dag events */
@@ -237,17 +285,17 @@
237#define ANOMALY_05000145 (__SILICON_REVISION__ < 3) 285#define ANOMALY_05000145 (__SILICON_REVISION__ < 3)
238/* MDMA may lose the first few words of a descriptor chain */ 286/* MDMA may lose the first few words of a descriptor chain */
239#define ANOMALY_05000146 (__SILICON_REVISION__ < 3) 287#define ANOMALY_05000146 (__SILICON_REVISION__ < 3)
240/* The source MDMA descriptor may stop with a DMA Error */ 288/* Source MDMA descriptor may stop with a DMA Error near beginning of descriptor fetch */
241#define ANOMALY_05000147 (__SILICON_REVISION__ < 3) 289#define ANOMALY_05000147 (__SILICON_REVISION__ < 3)
242/* When booting from a 16-bit asynchronous memory device, the upper 8-bits of each word must be 0x00 */ 290/* When booting from a 16-bit asynchronous memory device, the upper 8-bits of each word must be 0x00 */
243#define ANOMALY_05000148 (__SILICON_REVISION__ < 3) 291#define ANOMALY_05000148 (__SILICON_REVISION__ < 3)
244/* Frame Delay in SPORT Multichannel Mode */ 292/* Frame Delay in SPORT Multichannel Mode */
245#define ANOMALY_05000153 (__SILICON_REVISION__ < 3) 293#define ANOMALY_05000153 (__SILICON_REVISION__ < 3)
246/* SPORT TFS signal is active in Multi-channel mode outside of valid channels */ 294/* SPORT TFS signal stays active in multichannel mode outside of valid channels */
247#define ANOMALY_05000154 (__SILICON_REVISION__ < 3) 295#define ANOMALY_05000154 (__SILICON_REVISION__ < 3)
248/* Timer1 can not be used for PWMOUT mode when a certain PPI mode is in use */ 296/* Timer1 can not be used for PWMOUT mode when a certain PPI mode is in use */
249#define ANOMALY_05000155 (__SILICON_REVISION__ < 3) 297#define ANOMALY_05000155 (__SILICON_REVISION__ < 3)
250/* A killed 32-bit System MMR write will lead to the next system MMR access thinking it should be 32-bit. */ 298/* Killed 32-bit MMR write leads to next system MMR access thinking it should be 32-bit */
251#define ANOMALY_05000157 (__SILICON_REVISION__ < 3) 299#define ANOMALY_05000157 (__SILICON_REVISION__ < 3)
252/* SPORT transmit data is not gated by external frame sync in certain conditions */ 300/* SPORT transmit data is not gated by external frame sync in certain conditions */
253#define ANOMALY_05000163 (__SILICON_REVISION__ < 3) 301#define ANOMALY_05000163 (__SILICON_REVISION__ < 3)
@@ -275,15 +323,27 @@
275#define ANOMALY_05000206 (__SILICON_REVISION__ < 3) 323#define ANOMALY_05000206 (__SILICON_REVISION__ < 3)
276 324
277/* Anomalies that don't exist on this proc */ 325/* Anomalies that don't exist on this proc */
326#define ANOMALY_05000120 (0)
327#define ANOMALY_05000149 (0)
328#define ANOMALY_05000171 (0)
329#define ANOMALY_05000220 (0)
330#define ANOMALY_05000248 (0)
278#define ANOMALY_05000266 (0) 331#define ANOMALY_05000266 (0)
332#define ANOMALY_05000274 (0)
333#define ANOMALY_05000287 (0)
279#define ANOMALY_05000323 (0) 334#define ANOMALY_05000323 (0)
280#define ANOMALY_05000353 (1) 335#define ANOMALY_05000353 (1)
336#define ANOMALY_05000362 (1)
281#define ANOMALY_05000380 (0) 337#define ANOMALY_05000380 (0)
282#define ANOMALY_05000386 (1) 338#define ANOMALY_05000386 (1)
339#define ANOMALY_05000389 (0)
283#define ANOMALY_05000412 (0) 340#define ANOMALY_05000412 (0)
341#define ANOMALY_05000430 (0)
284#define ANOMALY_05000432 (0) 342#define ANOMALY_05000432 (0)
285#define ANOMALY_05000435 (0) 343#define ANOMALY_05000435 (0)
286#define ANOMALY_05000447 (0) 344#define ANOMALY_05000447 (0)
287#define ANOMALY_05000448 (0) 345#define ANOMALY_05000448 (0)
346#define ANOMALY_05000456 (0)
347#define ANOMALY_05000450 (0)
288 348
289#endif 349#endif
diff --git a/arch/blackfin/mach-bf537/Kconfig b/arch/blackfin/mach-bf537/Kconfig
index bbc08fd4f122..d81224f9d723 100644
--- a/arch/blackfin/mach-bf537/Kconfig
+++ b/arch/blackfin/mach-bf537/Kconfig
@@ -66,6 +66,7 @@ config IRQ_MAC_TX
66 default 11 66 default 11
67config IRQ_TIMER0 67config IRQ_TIMER0
68 int "IRQ_TIMER0" 68 int "IRQ_TIMER0"
69 default 7 if TICKSOURCE_GPTMR0
69 default 8 70 default 8
70config IRQ_TIMER1 71config IRQ_TIMER1
71 int "IRQ_TIMER1" 72 int "IRQ_TIMER1"
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c
index 41c75b9bfac0..4fee19673127 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c
@@ -86,7 +86,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
86}; 86};
87#endif 87#endif
88 88
89#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 89#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
90/* SPI ADC chip */ 90/* SPI ADC chip */
91static struct bfin5xx_spi_chip spi_adc_chip_info = { 91static struct bfin5xx_spi_chip spi_adc_chip_info = {
92 .enable_dma = 1, /* use dma transfer with this chip*/ 92 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -129,7 +129,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
129 }, 129 },
130#endif 130#endif
131 131
132#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 132#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
133 { 133 {
134 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 134 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
135 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 135 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 4e1de1e53f89..26707ce39f29 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -265,8 +265,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
265}; 265};
266#endif 266#endif
267 267
268#if defined(CONFIG_SPI_ADC_BF533) \ 268#if defined(CONFIG_BFIN_SPI_ADC) \
269 || defined(CONFIG_SPI_ADC_BF533_MODULE) 269 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
270/* SPI ADC chip */ 270/* SPI ADC chip */
271static struct bfin5xx_spi_chip spi_adc_chip_info = { 271static struct bfin5xx_spi_chip spi_adc_chip_info = {
272 .enable_dma = 1, /* use dma transfer with this chip*/ 272 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -333,8 +333,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
333 }, 333 },
334#endif 334#endif
335 335
336#if defined(CONFIG_SPI_ADC_BF533) \ 336#if defined(CONFIG_BFIN_SPI_ADC) \
337 || defined(CONFIG_SPI_ADC_BF533_MODULE) 337 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
338 { 338 {
339 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 339 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
340 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 340 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 0572926da23f..dfb5036f8a6b 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -508,8 +508,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
508}; 508};
509#endif 509#endif
510 510
511#if defined(CONFIG_SPI_ADC_BF533) \ 511#if defined(CONFIG_BFIN_SPI_ADC) \
512 || defined(CONFIG_SPI_ADC_BF533_MODULE) 512 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
513/* SPI ADC chip */ 513/* SPI ADC chip */
514static struct bfin5xx_spi_chip spi_adc_chip_info = { 514static struct bfin5xx_spi_chip spi_adc_chip_info = {
515 .enable_dma = 1, /* use dma transfer with this chip*/ 515 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -607,6 +607,43 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
607}; 607};
608#endif 608#endif
609 609
610#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
611#include <linux/input.h>
612#include <linux/spi/adxl34x.h>
613static const struct adxl34x_platform_data adxl34x_info = {
614 .x_axis_offset = 0,
615 .y_axis_offset = 0,
616 .z_axis_offset = 0,
617 .tap_threshold = 0x31,
618 .tap_duration = 0x10,
619 .tap_latency = 0x60,
620 .tap_window = 0xF0,
621 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
622 .act_axis_control = 0xFF,
623 .activity_threshold = 5,
624 .inactivity_threshold = 3,
625 .inactivity_time = 4,
626 .free_fall_threshold = 0x7,
627 .free_fall_time = 0x20,
628 .data_rate = 0x8,
629 .data_range = ADXL_FULL_RES,
630
631 .ev_type = EV_ABS,
632 .ev_code_x = ABS_X, /* EV_REL */
633 .ev_code_y = ABS_Y, /* EV_REL */
634 .ev_code_z = ABS_Z, /* EV_REL */
635
636 .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
637 .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
638 .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
639
640/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
641/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
642 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
643 .fifo_mode = ADXL_FIFO_STREAM,
644};
645#endif
646
610#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 647#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
611static struct bfin5xx_spi_chip spi_ad7879_chip_info = { 648static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
612 .enable_dma = 0, 649 .enable_dma = 0,
@@ -695,8 +732,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
695 .mode = SPI_MODE_3, 732 .mode = SPI_MODE_3,
696 }, 733 },
697#endif 734#endif
698#if defined(CONFIG_SPI_ADC_BF533) \ 735#if defined(CONFIG_BFIN_SPI_ADC) \
699 || defined(CONFIG_SPI_ADC_BF533_MODULE) 736 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
700 { 737 {
701 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 738 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
702 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 739 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -1280,7 +1317,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1280 .irq = IRQ_PF5, 1317 .irq = IRQ_PF5,
1281 }, 1318 },
1282#endif 1319#endif
1283#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 1320#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
1284 { 1321 {
1285 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1322 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1286 }, 1323 },
@@ -1312,6 +1349,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1312 .platform_data = (void *)&adp5520_pdev_data, 1349 .platform_data = (void *)&adp5520_pdev_data,
1313 }, 1350 },
1314#endif 1351#endif
1352#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1353 {
1354 I2C_BOARD_INFO("adxl34x", 0x53),
1355 .irq = IRQ_PG3,
1356 .platform_data = (void *)&adxl34x_info,
1357 },
1358#endif
1315}; 1359};
1316 1360
1317#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1361#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
@@ -1358,16 +1402,18 @@ static struct resource bfin_pata_resources[] = {
1358static struct pata_platform_info bfin_pata_platform_data = { 1402static struct pata_platform_info bfin_pata_platform_data = {
1359 .ioport_shift = 0, 1403 .ioport_shift = 0,
1360}; 1404};
1361 1405/* CompactFlash Storage Card Memory Mapped Adressing
1406 * /REG = A11 = 1
1407 */
1362static struct resource bfin_pata_resources[] = { 1408static struct resource bfin_pata_resources[] = {
1363 { 1409 {
1364 .start = 0x20211820, 1410 .start = 0x20211800,
1365 .end = 0x2021183F, 1411 .end = 0x20211807,
1366 .flags = IORESOURCE_MEM, 1412 .flags = IORESOURCE_MEM,
1367 }, 1413 },
1368 { 1414 {
1369 .start = 0x2021181C, 1415 .start = 0x2021180E, /* Device Ctl */
1370 .end = 0x2021181F, 1416 .end = 0x2021180E,
1371 .flags = IORESOURCE_MEM, 1417 .flags = IORESOURCE_MEM,
1372 }, 1418 },
1373}; 1419};
@@ -1527,7 +1573,8 @@ static int __init stamp_init(void)
1527 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 1573 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
1528 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 1574 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1529 1575
1530#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 1576#if (defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)) \
1577 && defined(PATA_INT)
1531 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; 1578 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
1532#endif 1579#endif
1533 1580
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index 53ad10f3cd76..280574591201 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -86,7 +86,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
86}; 86};
87#endif 87#endif
88 88
89#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 89#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
90/* SPI ADC chip */ 90/* SPI ADC chip */
91static struct bfin5xx_spi_chip spi_adc_chip_info = { 91static struct bfin5xx_spi_chip spi_adc_chip_info = {
92 .enable_dma = 1, /* use dma transfer with this chip*/ 92 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -129,7 +129,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
129 }, 129 },
130#endif 130#endif
131 131
132#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 132#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
133 { 133 {
134 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 134 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
135 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 135 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index 1bfd80c26c90..fc9663425465 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -6,7 +6,7 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file should be up to date with:
10 * - Revision D, 09/18/2008; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List 10 * - Revision D, 09/18/2008; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List
11 */ 11 */
12 12
@@ -36,77 +36,75 @@
36 36
37/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */ 37/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
38#define ANOMALY_05000074 (1) 38#define ANOMALY_05000074 (1)
39/* DMA_RUN bit is not valid after a Peripheral Receive Channel DMA stops */ 39/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
40#define ANOMALY_05000119 (1) 40#define ANOMALY_05000119 (1)
41/* Rx.H cannot be used to access 16-bit System MMR registers */ 41/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
42#define ANOMALY_05000122 (1) 42#define ANOMALY_05000122 (1)
43/* Killed 32-bit MMR write leads to next system MMR access thinking it should be 32-bit */ 43/* Killed 32-bit MMR write leads to next system MMR access thinking it should be 32-bit */
44#define ANOMALY_05000157 (__SILICON_REVISION__ < 2) 44#define ANOMALY_05000157 (__SILICON_REVISION__ < 2)
45/* Turning SPORTs on while External Frame Sync Is Active May Corrupt Data */ 45/* PPI_DELAY Not Functional in PPI Modes with 0 Frame Syncs */
46#define ANOMALY_05000167 (1)
47/* PPI_DELAY not functional in PPI modes with 0 frame syncs */
48#define ANOMALY_05000180 (1) 46#define ANOMALY_05000180 (1)
49/* Instruction Cache Is Not Functional */ 47/* Instruction Cache Is Not Functional */
50#define ANOMALY_05000237 (__SILICON_REVISION__ < 2) 48#define ANOMALY_05000237 (__SILICON_REVISION__ < 2)
51/* If i-cache is on, CSYNC/SSYNC/IDLE around Change of Control causes failures */ 49/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
52#define ANOMALY_05000244 (__SILICON_REVISION__ < 3) 50#define ANOMALY_05000244 (__SILICON_REVISION__ < 3)
53/* Spurious Hardware Error from an access in the shadow of a conditional branch */ 51/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
54#define ANOMALY_05000245 (1) 52#define ANOMALY_05000245 (1)
55/* CLKIN Buffer Output Enable Reset Behavior Is Changed */ 53/* CLKIN Buffer Output Enable Reset Behavior Is Changed */
56#define ANOMALY_05000247 (1) 54#define ANOMALY_05000247 (1)
57/* Incorrect Bit-Shift of Data Word in Multichannel (TDM) mode in certain conditions */ 55/* Incorrect Bit Shift of Data Word in Multichannel (TDM) Mode in Certain Conditions */
58#define ANOMALY_05000250 (__SILICON_REVISION__ < 3) 56#define ANOMALY_05000250 (__SILICON_REVISION__ < 3)
59/* EMAC Tx DMA error after an early frame abort */ 57/* EMAC Tx DMA error after an early frame abort */
60#define ANOMALY_05000252 (__SILICON_REVISION__ < 3) 58#define ANOMALY_05000252 (__SILICON_REVISION__ < 3)
61/* Maximum external clock speed for Timers */ 59/* Maximum External Clock Speed for Timers */
62#define ANOMALY_05000253 (__SILICON_REVISION__ < 3) 60#define ANOMALY_05000253 (__SILICON_REVISION__ < 3)
63/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT mode with external clock */ 61/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
64#define ANOMALY_05000254 (__SILICON_REVISION__ > 2) 62#define ANOMALY_05000254 (__SILICON_REVISION__ > 2)
65/* Entering Hibernate Mode with RTC Seconds event interrupt not functional */ 63/* Entering Hibernate State with RTC Seconds Interrupt Not Functional */
66#define ANOMALY_05000255 (__SILICON_REVISION__ < 3) 64#define ANOMALY_05000255 (__SILICON_REVISION__ < 3)
67/* EMAC MDIO input latched on wrong MDC edge */ 65/* EMAC MDIO input latched on wrong MDC edge */
68#define ANOMALY_05000256 (__SILICON_REVISION__ < 3) 66#define ANOMALY_05000256 (__SILICON_REVISION__ < 3)
69/* Interrupt/Exception during short hardware loop may cause bad instruction fetches */ 67/* Interrupt/Exception During Short Hardware Loop May Cause Bad Instruction Fetches */
70#define ANOMALY_05000257 (__SILICON_REVISION__ < 3) 68#define ANOMALY_05000257 (__SILICON_REVISION__ < 3)
71/* Instruction Cache is corrupted when bits 9 and 12 of the ICPLB Data registers differ */ 69/* Instruction Cache Is Corrupted When Bits 9 and 12 of the ICPLB Data Registers Differ */
72#define ANOMALY_05000258 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ == 1) || __SILICON_REVISION__ == 2) 70#define ANOMALY_05000258 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ == 1) || __SILICON_REVISION__ == 2)
73/* ICPLB_STATUS MMR register may be corrupted */ 71/* ICPLB_STATUS MMR Register May Be Corrupted */
74#define ANOMALY_05000260 (__SILICON_REVISION__ == 2) 72#define ANOMALY_05000260 (__SILICON_REVISION__ == 2)
75/* DCPLB_FAULT_ADDR MMR register may be corrupted */ 73/* DCPLB_FAULT_ADDR MMR Register May Be Corrupted */
76#define ANOMALY_05000261 (__SILICON_REVISION__ < 3) 74#define ANOMALY_05000261 (__SILICON_REVISION__ < 3)
77/* Stores to data cache may be lost */ 75/* Stores To Data Cache May Be Lost */
78#define ANOMALY_05000262 (__SILICON_REVISION__ < 3) 76#define ANOMALY_05000262 (__SILICON_REVISION__ < 3)
79/* Hardware loop corrupted when taking an ICPLB exception */ 77/* Hardware Loop Corrupted When Taking an ICPLB Exception */
80#define ANOMALY_05000263 (__SILICON_REVISION__ == 2) 78#define ANOMALY_05000263 (__SILICON_REVISION__ == 2)
81/* CSYNC/SSYNC/IDLE causes infinite stall in second to last instruction in hardware loop */ 79/* CSYNC/SSYNC/IDLE Causes Infinite Stall in Penultimate Instruction in Hardware Loop */
82#define ANOMALY_05000264 (__SILICON_REVISION__ < 3) 80#define ANOMALY_05000264 (__SILICON_REVISION__ < 3)
83/* Sensitivity to noise with slow input edge rates on external SPORT TX and RX clocks */ 81/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
84#define ANOMALY_05000265 (1) 82#define ANOMALY_05000265 (1)
85/* Memory DMA error when peripheral DMA is running with non-zero DEB_TRAFFIC_PERIOD */ 83/* Memory DMA error when peripheral DMA is running with non-zero DEB_TRAFFIC_PERIOD */
86#define ANOMALY_05000268 (__SILICON_REVISION__ < 3) 84#define ANOMALY_05000268 (__SILICON_REVISION__ < 3)
87/* High I/O activity causes output voltage of internal voltage regulator (VDDint) to decrease */ 85/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
88#define ANOMALY_05000270 (__SILICON_REVISION__ < 3) 86#define ANOMALY_05000270 (__SILICON_REVISION__ < 3)
89/* Certain data cache write through modes fail for VDDint <=0.9V */ 87/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
90#define ANOMALY_05000272 (1) 88#define ANOMALY_05000272 (1)
91/* Writes to Synchronous SDRAM memory may be lost */ 89/* Writes to Synchronous SDRAM Memory May Be Lost */
92#define ANOMALY_05000273 (__SILICON_REVISION__ < 3) 90#define ANOMALY_05000273 (__SILICON_REVISION__ < 3)
93/* Writes to an I/O data register one SCLK cycle after an edge is detected may clear interrupt */ 91/* Writes to an I/O Data Register One SCLK Cycle after an Edge Is Detected May Clear Interrupt */
94#define ANOMALY_05000277 (__SILICON_REVISION__ < 3) 92#define ANOMALY_05000277 (__SILICON_REVISION__ < 3)
95/* Disabling Peripherals with DMA running may cause DMA system instability */ 93/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
96#define ANOMALY_05000278 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ < 3) || (ANOMALY_BF534 && __SILICON_REVISION__ < 2)) 94#define ANOMALY_05000278 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ < 3) || (ANOMALY_BF534 && __SILICON_REVISION__ < 2))
97/* SPI Master boot mode does not work well with Atmel Data flash devices */ 95/* SPI Master boot mode does not work well with Atmel Data flash devices */
98#define ANOMALY_05000280 (1) 96#define ANOMALY_05000280 (1)
99/* False Hardware Error Exception when ISR context is not restored */ 97/* False Hardware Error Exception When ISR Context Is Not Restored */
100#define ANOMALY_05000281 (__SILICON_REVISION__ < 3) 98#define ANOMALY_05000281 (__SILICON_REVISION__ < 3)
101/* Memory DMA corruption with 32-bit data and traffic control */ 99/* Memory DMA Corruption with 32-Bit Data and Traffic Control */
102#define ANOMALY_05000282 (__SILICON_REVISION__ < 3) 100#define ANOMALY_05000282 (__SILICON_REVISION__ < 3)
103/* System MMR Write Is Stalled Indefinitely When Killed in a Particular Stage */ 101/* System MMR Write Is Stalled Indefinitely When Killed in a Particular Stage */
104#define ANOMALY_05000283 (__SILICON_REVISION__ < 3) 102#define ANOMALY_05000283 (__SILICON_REVISION__ < 3)
105/* New Feature: EMAC TX DMA Word Alignment (Not Available On Older Silicon) */ 103/* New Feature: EMAC TX DMA Word Alignment (Not Available On Older Silicon) */
106#define ANOMALY_05000285 (__SILICON_REVISION__ < 3) 104#define ANOMALY_05000285 (__SILICON_REVISION__ < 3)
107/* SPORTs may receive bad data if FIFOs fill up */ 105/* SPORTs May Receive Bad Data If FIFOs Fill Up */
108#define ANOMALY_05000288 (__SILICON_REVISION__ < 3) 106#define ANOMALY_05000288 (__SILICON_REVISION__ < 3)
109/* Memory to memory DMA source/destination descriptors must be in same memory space */ 107/* Memory-To-Memory DMA Source/Destination Descriptors Must Be in Same Memory Space */
110#define ANOMALY_05000301 (1) 108#define ANOMALY_05000301 (1)
111/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */ 109/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
112#define ANOMALY_05000304 (__SILICON_REVISION__ < 3) 110#define ANOMALY_05000304 (__SILICON_REVISION__ < 3)
@@ -116,11 +114,11 @@
116#define ANOMALY_05000307 (__SILICON_REVISION__ < 3) 114#define ANOMALY_05000307 (__SILICON_REVISION__ < 3)
117/* Writing UART_THR while UART clock is disabled sends erroneous start bit */ 115/* Writing UART_THR while UART clock is disabled sends erroneous start bit */
118#define ANOMALY_05000309 (__SILICON_REVISION__ < 3) 116#define ANOMALY_05000309 (__SILICON_REVISION__ < 3)
119/* False hardware errors caused by fetches at the boundary of reserved memory */ 117/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
120#define ANOMALY_05000310 (1) 118#define ANOMALY_05000310 (1)
121/* Errors when SSYNC, CSYNC, or loads to LT, LB and LC registers are interrupted */ 119/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
122#define ANOMALY_05000312 (1) 120#define ANOMALY_05000312 (1)
123/* PPI is level sensitive on first transfer */ 121/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
124#define ANOMALY_05000313 (1) 122#define ANOMALY_05000313 (1)
125/* Killed System MMR Write Completes Erroneously On Next System MMR Access */ 123/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
126#define ANOMALY_05000315 (__SILICON_REVISION__ < 3) 124#define ANOMALY_05000315 (__SILICON_REVISION__ < 3)
@@ -156,24 +154,46 @@
156#define ANOMALY_05000426 (1) 154#define ANOMALY_05000426 (1)
157/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 155/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
158#define ANOMALY_05000443 (1) 156#define ANOMALY_05000443 (1)
157/* False Hardware Error when RETI points to invalid memory */
158#define ANOMALY_05000461 (1)
159 159
160/* Anomalies that don't exist on this proc */ 160/* Anomalies that don't exist on this proc */
161#define ANOMALY_05000099 (0)
162#define ANOMALY_05000120 (0)
161#define ANOMALY_05000125 (0) 163#define ANOMALY_05000125 (0)
164#define ANOMALY_05000149 (0)
162#define ANOMALY_05000158 (0) 165#define ANOMALY_05000158 (0)
166#define ANOMALY_05000171 (0)
167#define ANOMALY_05000179 (0)
163#define ANOMALY_05000183 (0) 168#define ANOMALY_05000183 (0)
164#define ANOMALY_05000198 (0) 169#define ANOMALY_05000198 (0)
170#define ANOMALY_05000215 (0)
171#define ANOMALY_05000220 (0)
172#define ANOMALY_05000227 (0)
165#define ANOMALY_05000230 (0) 173#define ANOMALY_05000230 (0)
174#define ANOMALY_05000231 (0)
175#define ANOMALY_05000233 (0)
176#define ANOMALY_05000242 (0)
177#define ANOMALY_05000248 (0)
166#define ANOMALY_05000266 (0) 178#define ANOMALY_05000266 (0)
179#define ANOMALY_05000274 (0)
180#define ANOMALY_05000287 (0)
167#define ANOMALY_05000311 (0) 181#define ANOMALY_05000311 (0)
168#define ANOMALY_05000323 (0) 182#define ANOMALY_05000323 (0)
169#define ANOMALY_05000353 (1) 183#define ANOMALY_05000353 (1)
184#define ANOMALY_05000362 (1)
170#define ANOMALY_05000363 (0) 185#define ANOMALY_05000363 (0)
171#define ANOMALY_05000380 (0) 186#define ANOMALY_05000380 (0)
172#define ANOMALY_05000386 (1) 187#define ANOMALY_05000386 (1)
188#define ANOMALY_05000389 (0)
189#define ANOMALY_05000400 (0)
173#define ANOMALY_05000412 (0) 190#define ANOMALY_05000412 (0)
191#define ANOMALY_05000430 (0)
174#define ANOMALY_05000432 (0) 192#define ANOMALY_05000432 (0)
175#define ANOMALY_05000435 (0) 193#define ANOMALY_05000435 (0)
176#define ANOMALY_05000447 (0) 194#define ANOMALY_05000447 (0)
177#define ANOMALY_05000448 (0) 195#define ANOMALY_05000448 (0)
196#define ANOMALY_05000456 (0)
197#define ANOMALY_05000450 (0)
178 198
179#endif 199#endif
diff --git a/arch/blackfin/mach-bf538/Kconfig b/arch/blackfin/mach-bf538/Kconfig
index f068c3523cdc..2d280f504ab0 100644
--- a/arch/blackfin/mach-bf538/Kconfig
+++ b/arch/blackfin/mach-bf538/Kconfig
@@ -57,6 +57,7 @@ config IRQ_UART0_TX
57 default 10 57 default 10
58config IRQ_TIMER0 58config IRQ_TIMER0
59 int "IRQ_TIMER0" 59 int "IRQ_TIMER0"
60 default 7 if TICKSOURCE_GPTMR0
60 default 8 61 default 8
61config IRQ_TIMER1 62config IRQ_TIMER1
62 int "IRQ_TIMER1" 63 int "IRQ_TIMER1"
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index 3a5699827363..175ca9ef7232 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -6,7 +6,7 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file should be up to date with:
10 * - Revision G, 09/18/2008; ADSP-BF538/BF538F Blackfin Processor Anomaly List 10 * - Revision G, 09/18/2008; ADSP-BF538/BF538F Blackfin Processor Anomaly List
11 * - Revision L, 09/18/2008; ADSP-BF539/BF539F Blackfin Processor Anomaly List 11 * - Revision L, 09/18/2008; ADSP-BF539/BF539F Blackfin Processor Anomaly List
12 */ 12 */
@@ -14,17 +14,29 @@
14#ifndef _MACH_ANOMALY_H_ 14#ifndef _MACH_ANOMALY_H_
15#define _MACH_ANOMALY_H_ 15#define _MACH_ANOMALY_H_
16 16
17/* We do not support old silicon - sorry */
17#if __SILICON_REVISION__ < 4 18#if __SILICON_REVISION__ < 4
18# error will not work on BF538 silicon version 0.0, 0.1, 0.2, or 0.3 19# error will not work on BF538/BF539 silicon version 0.0, 0.1, 0.2, or 0.3
19#endif 20#endif
20 21
21/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */ 22#if defined(__ADSPBF538__)
23# define ANOMALY_BF538 1
24#else
25# define ANOMALY_BF538 0
26#endif
27#if defined(__ADSPBF539__)
28# define ANOMALY_BF539 1
29#else
30# define ANOMALY_BF539 0
31#endif
32
33/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
22#define ANOMALY_05000074 (1) 34#define ANOMALY_05000074 (1)
23/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */ 35/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
24#define ANOMALY_05000119 (1) 36#define ANOMALY_05000119 (1)
25/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 37/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
26#define ANOMALY_05000122 (1) 38#define ANOMALY_05000122 (1)
27/* PPI Data Lengths between 8 and 16 Do Not Zero Out Upper Bits */ 39/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */
28#define ANOMALY_05000166 (1) 40#define ANOMALY_05000166 (1)
29/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */ 41/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */
30#define ANOMALY_05000179 (1) 42#define ANOMALY_05000179 (1)
@@ -40,13 +52,13 @@
40#define ANOMALY_05000229 (1) 52#define ANOMALY_05000229 (1)
41/* PPI_FS3 Is Not Driven in 2 or 3 Internal Frame Sync Transmit Modes */ 53/* PPI_FS3 Is Not Driven in 2 or 3 Internal Frame Sync Transmit Modes */
42#define ANOMALY_05000233 (1) 54#define ANOMALY_05000233 (1)
43/* If i-cache is on, CSYNC/SSYNC/IDLE around Change of Control causes failures */ 55/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
44#define ANOMALY_05000244 (__SILICON_REVISION__ < 3) 56#define ANOMALY_05000244 (__SILICON_REVISION__ < 3)
45/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ 57/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
46#define ANOMALY_05000245 (1) 58#define ANOMALY_05000245 (1)
47/* Maximum External Clock Speed for Timers */ 59/* Maximum External Clock Speed for Timers */
48#define ANOMALY_05000253 (1) 60#define ANOMALY_05000253 (1)
49/* DCPLB_FAULT_ADDR MMR register may be corrupted */ 61/* DCPLB_FAULT_ADDR MMR Register May Be Corrupted */
50#define ANOMALY_05000261 (__SILICON_REVISION__ < 3) 62#define ANOMALY_05000261 (__SILICON_REVISION__ < 3)
51/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */ 63/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
52#define ANOMALY_05000270 (__SILICON_REVISION__ < 4) 64#define ANOMALY_05000270 (__SILICON_REVISION__ < 4)
@@ -58,11 +70,11 @@
58#define ANOMALY_05000277 (__SILICON_REVISION__ < 4) 70#define ANOMALY_05000277 (__SILICON_REVISION__ < 4)
59/* Disabling Peripherals with DMA Running May Cause DMA System Instability */ 71/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
60#define ANOMALY_05000278 (__SILICON_REVISION__ < 4) 72#define ANOMALY_05000278 (__SILICON_REVISION__ < 4)
61/* False Hardware Error Exception when ISR Context Is Not Restored */ 73/* False Hardware Error Exception When ISR Context Is Not Restored */
62#define ANOMALY_05000281 (__SILICON_REVISION__ < 4) 74#define ANOMALY_05000281 (__SILICON_REVISION__ < 4)
63/* Memory DMA Corruption with 32-Bit Data and Traffic Control */ 75/* Memory DMA Corruption with 32-Bit Data and Traffic Control */
64#define ANOMALY_05000282 (__SILICON_REVISION__ < 4) 76#define ANOMALY_05000282 (__SILICON_REVISION__ < 4)
65/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */ 77/* System MMR Write Is Stalled Indefinitely When Killed in a Particular Stage */
66#define ANOMALY_05000283 (__SILICON_REVISION__ < 4) 78#define ANOMALY_05000283 (__SILICON_REVISION__ < 4)
67/* SPORTs May Receive Bad Data If FIFOs Fill Up */ 79/* SPORTs May Receive Bad Data If FIFOs Fill Up */
68#define ANOMALY_05000288 (__SILICON_REVISION__ < 4) 80#define ANOMALY_05000288 (__SILICON_REVISION__ < 4)
@@ -80,14 +92,14 @@
80#define ANOMALY_05000307 (__SILICON_REVISION__ < 4) 92#define ANOMALY_05000307 (__SILICON_REVISION__ < 4)
81/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */ 93/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
82#define ANOMALY_05000310 (1) 94#define ANOMALY_05000310 (1)
83/* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */ 95/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
84#define ANOMALY_05000312 (__SILICON_REVISION__ < 5) 96#define ANOMALY_05000312 (__SILICON_REVISION__ < 5)
85/* PPI Is Level-Sensitive on First Transfer */ 97/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
86#define ANOMALY_05000313 (__SILICON_REVISION__ < 4) 98#define ANOMALY_05000313 (__SILICON_REVISION__ < 4)
87/* Killed System MMR Write Completes Erroneously on Next System MMR Access */ 99/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
88#define ANOMALY_05000315 (__SILICON_REVISION__ < 4) 100#define ANOMALY_05000315 (__SILICON_REVISION__ < 4)
89/* PFx Glitch on Write to FIO_FLAG_D or FIO_FLAG_T */ 101/* PFx Glitch on Write to FIO_FLAG_D or FIO_FLAG_T */
90#define ANOMALY_05000318 (__SILICON_REVISION__ < 4) 102#define ANOMALY_05000318 (ANOMALY_BF539 && __SILICON_REVISION__ < 4)
91/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */ 103/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */
92#define ANOMALY_05000355 (__SILICON_REVISION__ < 5) 104#define ANOMALY_05000355 (__SILICON_REVISION__ < 5)
93/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */ 105/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
@@ -114,23 +126,45 @@
114#define ANOMALY_05000436 (__SILICON_REVISION__ > 3) 126#define ANOMALY_05000436 (__SILICON_REVISION__ > 3)
115/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 127/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
116#define ANOMALY_05000443 (1) 128#define ANOMALY_05000443 (1)
129/* False Hardware Error when RETI points to invalid memory */
130#define ANOMALY_05000461 (1)
117 131
118/* Anomalies that don't exist on this proc */ 132/* Anomalies that don't exist on this proc */
133#define ANOMALY_05000099 (0)
134#define ANOMALY_05000120 (0)
135#define ANOMALY_05000149 (0)
119#define ANOMALY_05000158 (0) 136#define ANOMALY_05000158 (0)
137#define ANOMALY_05000171 (0)
120#define ANOMALY_05000198 (0) 138#define ANOMALY_05000198 (0)
139#define ANOMALY_05000215 (0)
140#define ANOMALY_05000220 (0)
141#define ANOMALY_05000227 (0)
121#define ANOMALY_05000230 (0) 142#define ANOMALY_05000230 (0)
143#define ANOMALY_05000231 (0)
144#define ANOMALY_05000242 (0)
145#define ANOMALY_05000248 (0)
146#define ANOMALY_05000250 (0)
147#define ANOMALY_05000254 (0)
122#define ANOMALY_05000263 (0) 148#define ANOMALY_05000263 (0)
149#define ANOMALY_05000274 (0)
150#define ANOMALY_05000287 (0)
123#define ANOMALY_05000305 (0) 151#define ANOMALY_05000305 (0)
124#define ANOMALY_05000311 (0) 152#define ANOMALY_05000311 (0)
125#define ANOMALY_05000323 (0) 153#define ANOMALY_05000323 (0)
126#define ANOMALY_05000353 (1) 154#define ANOMALY_05000353 (1)
155#define ANOMALY_05000362 (1)
127#define ANOMALY_05000363 (0) 156#define ANOMALY_05000363 (0)
128#define ANOMALY_05000380 (0) 157#define ANOMALY_05000380 (0)
129#define ANOMALY_05000386 (1) 158#define ANOMALY_05000386 (1)
159#define ANOMALY_05000389 (0)
160#define ANOMALY_05000400 (0)
130#define ANOMALY_05000412 (0) 161#define ANOMALY_05000412 (0)
162#define ANOMALY_05000430 (0)
131#define ANOMALY_05000432 (0) 163#define ANOMALY_05000432 (0)
132#define ANOMALY_05000435 (0) 164#define ANOMALY_05000435 (0)
133#define ANOMALY_05000447 (0) 165#define ANOMALY_05000447 (0)
134#define ANOMALY_05000448 (0) 166#define ANOMALY_05000448 (0)
167#define ANOMALY_05000456 (0)
168#define ANOMALY_05000450 (0)
135 169
136#endif 170#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/blackfin.h b/arch/blackfin/mach-bf538/include/mach/blackfin.h
index ea25371a922b..6f628353dde3 100644
--- a/arch/blackfin/mach-bf538/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf538/include/mach/blackfin.h
@@ -68,25 +68,6 @@
68#define OFFSET_SCR 0x1C /* SCR Scratch Register */ 68#define OFFSET_SCR 0x1C /* SCR Scratch Register */
69#define OFFSET_GCTL 0x24 /* Global Control Register */ 69#define OFFSET_GCTL 0x24 /* Global Control Register */
70 70
71
72#define bfin_write_MDMA_D0_IRQ_STATUS bfin_write_MDMA0_D0_IRQ_STATUS
73#define bfin_write_MDMA_D0_START_ADDR bfin_write_MDMA0_D0_START_ADDR
74#define bfin_write_MDMA_S0_START_ADDR bfin_write_MDMA0_S0_START_ADDR
75#define bfin_write_MDMA_D0_X_COUNT bfin_write_MDMA0_D0_X_COUNT
76#define bfin_write_MDMA_S0_X_COUNT bfin_write_MDMA0_S0_X_COUNT
77#define bfin_write_MDMA_D0_Y_COUNT bfin_write_MDMA0_D0_Y_COUNT
78#define bfin_write_MDMA_S0_Y_COUNT bfin_write_MDMA0_S0_Y_COUNT
79#define bfin_write_MDMA_D0_X_MODIFY bfin_write_MDMA0_D0_X_MODIFY
80#define bfin_write_MDMA_S0_X_MODIFY bfin_write_MDMA0_S0_X_MODIFY
81#define bfin_write_MDMA_D0_Y_MODIFY bfin_write_MDMA0_D0_Y_MODIFY
82#define bfin_write_MDMA_S0_Y_MODIFY bfin_write_MDMA0_S0_Y_MODIFY
83#define bfin_write_MDMA_S0_CONFIG bfin_write_MDMA0_S0_CONFIG
84#define bfin_write_MDMA_D0_CONFIG bfin_write_MDMA0_D0_CONFIG
85#define bfin_read_MDMA_S0_CONFIG bfin_read_MDMA0_S0_CONFIG
86#define bfin_read_MDMA_D0_IRQ_STATUS bfin_read_MDMA0_D0_IRQ_STATUS
87#define bfin_write_MDMA_S0_IRQ_STATUS bfin_write_MDMA0_S0_IRQ_STATUS
88
89
90/* DPMC*/ 71/* DPMC*/
91#define bfin_read_STOPCK_OFF() bfin_read_STOPCK() 72#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
92#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val) 73#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
diff --git a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
index 241725bc6988..99ca3f4305e2 100644
--- a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
+++ b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
@@ -67,14 +67,14 @@
67#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val) 67#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
68#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1) 68#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
69#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val) 69#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
70#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0)) 70#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0))
71#define bfin_write_SIC_ISR(x, val) bfin_write32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0), val) 71#define bfin_write_SIC_ISR(x, val) bfin_write32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0), val)
72#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0) 72#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
73#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val) 73#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
74#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1) 74#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
75#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val) 75#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
76#define bfin_read_SIC_IWR(x) bfin_read32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0)) 76#define bfin_read_SIC_IWR(x) bfin_read32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0))
77#define bfin_write_SIC_IWR(x, val) bfin_write32((SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0), val) 77#define bfin_write_SIC_IWR(x, val) bfin_write32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0), val)
78#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0) 78#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
79#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val) 79#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
80#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1) 80#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
@@ -1247,6 +1247,65 @@
1247#define bfin_write_MDMA1_S1_CURR_X_COUNT(val) bfin_write16(MDMA1_S1_CURR_X_COUNT, val) 1247#define bfin_write_MDMA1_S1_CURR_X_COUNT(val) bfin_write16(MDMA1_S1_CURR_X_COUNT, val)
1248#define bfin_read_MDMA1_S1_CURR_Y_COUNT() bfin_read16(MDMA1_S1_CURR_Y_COUNT) 1248#define bfin_read_MDMA1_S1_CURR_Y_COUNT() bfin_read16(MDMA1_S1_CURR_Y_COUNT)
1249#define bfin_write_MDMA1_S1_CURR_Y_COUNT(val) bfin_write16(MDMA1_S1_CURR_Y_COUNT, val) 1249#define bfin_write_MDMA1_S1_CURR_Y_COUNT(val) bfin_write16(MDMA1_S1_CURR_Y_COUNT, val)
1250
1251#define bfin_read_MDMA_S0_CONFIG() bfin_read_MDMA0_S0_CONFIG()
1252#define bfin_write_MDMA_S0_CONFIG(val) bfin_write_MDMA0_S0_CONFIG(val)
1253#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read_MDMA0_S0_IRQ_STATUS()
1254#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write_MDMA0_S0_IRQ_STATUS(val)
1255#define bfin_read_MDMA_S0_X_MODIFY() bfin_read_MDMA0_S0_X_MODIFY()
1256#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write_MDMA0_S0_X_MODIFY(val)
1257#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read_MDMA0_S0_Y_MODIFY()
1258#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write_MDMA0_S0_Y_MODIFY(val)
1259#define bfin_read_MDMA_S0_X_COUNT() bfin_read_MDMA0_S0_X_COUNT()
1260#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write_MDMA0_S0_X_COUNT(val)
1261#define bfin_read_MDMA_S0_Y_COUNT() bfin_read_MDMA0_S0_Y_COUNT()
1262#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write_MDMA0_S0_Y_COUNT(val)
1263#define bfin_read_MDMA_S0_START_ADDR() bfin_read_MDMA0_S0_START_ADDR()
1264#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write_MDMA0_S0_START_ADDR(val)
1265#define bfin_read_MDMA_D0_CONFIG() bfin_read_MDMA0_D0_CONFIG()
1266#define bfin_write_MDMA_D0_CONFIG(val) bfin_write_MDMA0_D0_CONFIG(val)
1267#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read_MDMA0_D0_IRQ_STATUS()
1268#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write_MDMA0_D0_IRQ_STATUS(val)
1269#define bfin_read_MDMA_D0_X_MODIFY() bfin_read_MDMA0_D0_X_MODIFY()
1270#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write_MDMA0_D0_X_MODIFY(val)
1271#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read_MDMA0_D0_Y_MODIFY()
1272#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write_MDMA0_D0_Y_MODIFY(val)
1273#define bfin_read_MDMA_D0_X_COUNT() bfin_read_MDMA0_D0_X_COUNT()
1274#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write_MDMA0_D0_X_COUNT(val)
1275#define bfin_read_MDMA_D0_Y_COUNT() bfin_read_MDMA0_D0_Y_COUNT()
1276#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write_MDMA0_D0_Y_COUNT(val)
1277#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA0_D0_START_ADDR()
1278#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA0_D0_START_ADDR(val)
1279
1280#define bfin_read_MDMA_S1_CONFIG() bfin_read_MDMA0_S1_CONFIG()
1281#define bfin_write_MDMA_S1_CONFIG(val) bfin_write_MDMA0_S1_CONFIG(val)
1282#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read_MDMA0_S1_IRQ_STATUS()
1283#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write_MDMA0_S1_IRQ_STATUS(val)
1284#define bfin_read_MDMA_S1_X_MODIFY() bfin_read_MDMA0_S1_X_MODIFY()
1285#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write_MDMA0_S1_X_MODIFY(val)
1286#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read_MDMA0_S1_Y_MODIFY()
1287#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write_MDMA0_S1_Y_MODIFY(val)
1288#define bfin_read_MDMA_S1_X_COUNT() bfin_read_MDMA0_S1_X_COUNT()
1289#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write_MDMA0_S1_X_COUNT(val)
1290#define bfin_read_MDMA_S1_Y_COUNT() bfin_read_MDMA0_S1_Y_COUNT()
1291#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write_MDMA0_S1_Y_COUNT(val)
1292#define bfin_read_MDMA_S1_START_ADDR() bfin_read_MDMA0_S1_START_ADDR()
1293#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write_MDMA0_S1_START_ADDR(val)
1294#define bfin_read_MDMA_D1_CONFIG() bfin_read_MDMA0_D1_CONFIG()
1295#define bfin_write_MDMA_D1_CONFIG(val) bfin_write_MDMA0_D1_CONFIG(val)
1296#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read_MDMA0_D1_IRQ_STATUS()
1297#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write_MDMA0_D1_IRQ_STATUS(val)
1298#define bfin_read_MDMA_D1_X_MODIFY() bfin_read_MDMA0_D1_X_MODIFY()
1299#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write_MDMA0_D1_X_MODIFY(val)
1300#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read_MDMA0_D1_Y_MODIFY()
1301#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write_MDMA0_D1_Y_MODIFY(val)
1302#define bfin_read_MDMA_D1_X_COUNT() bfin_read_MDMA0_D1_X_COUNT()
1303#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write_MDMA0_D1_X_COUNT(val)
1304#define bfin_read_MDMA_D1_Y_COUNT() bfin_read_MDMA0_D1_Y_COUNT()
1305#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write_MDMA0_D1_Y_COUNT(val)
1306#define bfin_read_MDMA_D1_START_ADDR() bfin_read_MDMA0_D1_START_ADDR()
1307#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write_MDMA0_D1_START_ADDR(val)
1308
1250#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL) 1309#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
1251#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val) 1310#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
1252#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS) 1311#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
diff --git a/arch/blackfin/mach-bf538/include/mach/defBF539.h b/arch/blackfin/mach-bf538/include/mach/defBF539.h
index 6adbfcc65a35..bdc330cd0e1c 100644
--- a/arch/blackfin/mach-bf538/include/mach/defBF539.h
+++ b/arch/blackfin/mach-bf538/include/mach/defBF539.h
@@ -412,6 +412,62 @@
412#define MDMA0_S1_CURR_X_COUNT 0xFFC00EF0 /* MemDMA0 Stream 1 Source Current X Count Register */ 412#define MDMA0_S1_CURR_X_COUNT 0xFFC00EF0 /* MemDMA0 Stream 1 Source Current X Count Register */
413#define MDMA0_S1_CURR_Y_COUNT 0xFFC00EF8 /* MemDMA0 Stream 1 Source Current Y Count Register */ 413#define MDMA0_S1_CURR_Y_COUNT 0xFFC00EF8 /* MemDMA0 Stream 1 Source Current Y Count Register */
414 414
415#define MDMA_D0_NEXT_DESC_PTR MDMA0_D0_NEXT_DESC_PTR
416#define MDMA_D0_START_ADDR MDMA0_D0_START_ADDR
417#define MDMA_D0_CONFIG MDMA0_D0_CONFIG
418#define MDMA_D0_X_COUNT MDMA0_D0_X_COUNT
419#define MDMA_D0_X_MODIFY MDMA0_D0_X_MODIFY
420#define MDMA_D0_Y_COUNT MDMA0_D0_Y_COUNT
421#define MDMA_D0_Y_MODIFY MDMA0_D0_Y_MODIFY
422#define MDMA_D0_CURR_DESC_PTR MDMA0_D0_CURR_DESC_PTR
423#define MDMA_D0_CURR_ADDR MDMA0_D0_CURR_ADDR
424#define MDMA_D0_IRQ_STATUS MDMA0_D0_IRQ_STATUS
425#define MDMA_D0_PERIPHERAL_MAP MDMA0_D0_PERIPHERAL_MAP
426#define MDMA_D0_CURR_X_COUNT MDMA0_D0_CURR_X_COUNT
427#define MDMA_D0_CURR_Y_COUNT MDMA0_D0_CURR_Y_COUNT
428
429#define MDMA_S0_NEXT_DESC_PTR MDMA0_S0_NEXT_DESC_PTR
430#define MDMA_S0_START_ADDR MDMA0_S0_START_ADDR
431#define MDMA_S0_CONFIG MDMA0_S0_CONFIG
432#define MDMA_S0_X_COUNT MDMA0_S0_X_COUNT
433#define MDMA_S0_X_MODIFY MDMA0_S0_X_MODIFY
434#define MDMA_S0_Y_COUNT MDMA0_S0_Y_COUNT
435#define MDMA_S0_Y_MODIFY MDMA0_S0_Y_MODIFY
436#define MDMA_S0_CURR_DESC_PTR MDMA0_S0_CURR_DESC_PTR
437#define MDMA_S0_CURR_ADDR MDMA0_S0_CURR_ADDR
438#define MDMA_S0_IRQ_STATUS MDMA0_S0_IRQ_STATUS
439#define MDMA_S0_PERIPHERAL_MAP MDMA0_S0_PERIPHERAL_MAP
440#define MDMA_S0_CURR_X_COUNT MDMA0_S0_CURR_X_COUNT
441#define MDMA_S0_CURR_Y_COUNT MDMA0_S0_CURR_Y_COUNT
442
443#define MDMA_D1_NEXT_DESC_PTR MDMA0_D1_NEXT_DESC_PTR
444#define MDMA_D1_START_ADDR MDMA0_D1_START_ADDR
445#define MDMA_D1_CONFIG MDMA0_D1_CONFIG
446#define MDMA_D1_X_COUNT MDMA0_D1_X_COUNT
447#define MDMA_D1_X_MODIFY MDMA0_D1_X_MODIFY
448#define MDMA_D1_Y_COUNT MDMA0_D1_Y_COUNT
449#define MDMA_D1_Y_MODIFY MDMA0_D1_Y_MODIFY
450#define MDMA_D1_CURR_DESC_PTR MDMA0_D1_CURR_DESC_PTR
451#define MDMA_D1_CURR_ADDR MDMA0_D1_CURR_ADDR
452#define MDMA_D1_IRQ_STATUS MDMA0_D1_IRQ_STATUS
453#define MDMA_D1_PERIPHERAL_MAP MDMA0_D1_PERIPHERAL_MAP
454#define MDMA_D1_CURR_X_COUNT MDMA0_D1_CURR_X_COUNT
455#define MDMA_D1_CURR_Y_COUNT MDMA0_D1_CURR_Y_COUNT
456
457#define MDMA_S1_NEXT_DESC_PTR MDMA0_S1_NEXT_DESC_PTR
458#define MDMA_S1_START_ADDR MDMA0_S1_START_ADDR
459#define MDMA_S1_CONFIG MDMA0_S1_CONFIG
460#define MDMA_S1_X_COUNT MDMA0_S1_X_COUNT
461#define MDMA_S1_X_MODIFY MDMA0_S1_X_MODIFY
462#define MDMA_S1_Y_COUNT MDMA0_S1_Y_COUNT
463#define MDMA_S1_Y_MODIFY MDMA0_S1_Y_MODIFY
464#define MDMA_S1_CURR_DESC_PTR MDMA0_S1_CURR_DESC_PTR
465#define MDMA_S1_CURR_ADDR MDMA0_S1_CURR_ADDR
466#define MDMA_S1_IRQ_STATUS MDMA0_S1_IRQ_STATUS
467#define MDMA_S1_PERIPHERAL_MAP MDMA0_S1_PERIPHERAL_MAP
468#define MDMA_S1_CURR_X_COUNT MDMA0_S1_CURR_X_COUNT
469#define MDMA_S1_CURR_Y_COUNT MDMA0_S1_CURR_Y_COUNT
470
415 471
416/* Parallel Peripheral Interface (PPI) (0xFFC01000 - 0xFFC010FF) */ 472/* Parallel Peripheral Interface (PPI) (0xFFC01000 - 0xFFC010FF) */
417#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */ 473#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
diff --git a/arch/blackfin/mach-bf548/Kconfig b/arch/blackfin/mach-bf548/Kconfig
index dcf657159051..a09623dfd550 100644
--- a/arch/blackfin/mach-bf548/Kconfig
+++ b/arch/blackfin/mach-bf548/Kconfig
@@ -11,6 +11,13 @@ config DEB_DMA_URGENT
11 help 11 help
12 Treat any DEB1, DEB2 and DEB3 request as Urgent 12 Treat any DEB1, DEB2 and DEB3 request as Urgent
13 13
14config BF548_ATAPI_ALTERNATIVE_PORT
15 bool "BF548 ATAPI alternative port via GPIO"
16 help
17 BF548 ATAPI data and address PINs can be routed through
18 async address or GPIO port F and G. Select y to route it
19 to GPIO.
20
14comment "Interrupt Priority Assignment" 21comment "Interrupt Priority Assignment"
15menu "Priority" 22menu "Priority"
16 23
@@ -250,6 +257,7 @@ config IRQ_OTPSEC
250 default 11 257 default 11
251config IRQ_TIMER0 258config IRQ_TIMER0
252 int "IRQ_TIMER0" 259 int "IRQ_TIMER0"
260 default 7 if TICKSOURCE_GPTMR0
253 default 8 261 default 8
254config IRQ_TIMER1 262config IRQ_TIMER1
255 int "IRQ_TIMER1" 263 int "IRQ_TIMER1"
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 096e661700a7..add5a17452ce 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -208,6 +208,43 @@ static struct platform_device bfin_rotary_device = {
208}; 208};
209#endif 209#endif
210 210
211#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
212#include <linux/input.h>
213#include <linux/spi/adxl34x.h>
214static const struct adxl34x_platform_data adxl34x_info = {
215 .x_axis_offset = 0,
216 .y_axis_offset = 0,
217 .z_axis_offset = 0,
218 .tap_threshold = 0x31,
219 .tap_duration = 0x10,
220 .tap_latency = 0x60,
221 .tap_window = 0xF0,
222 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
223 .act_axis_control = 0xFF,
224 .activity_threshold = 5,
225 .inactivity_threshold = 3,
226 .inactivity_time = 4,
227 .free_fall_threshold = 0x7,
228 .free_fall_time = 0x20,
229 .data_rate = 0x8,
230 .data_range = ADXL_FULL_RES,
231
232 .ev_type = EV_ABS,
233 .ev_code_x = ABS_X, /* EV_REL */
234 .ev_code_y = ABS_Y, /* EV_REL */
235 .ev_code_z = ABS_Z, /* EV_REL */
236
237 .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
238 .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
239 .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
240
241/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
242/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
243 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
244 .fifo_mode = ADXL_FIFO_STREAM,
245};
246#endif
247
211#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 248#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
212static struct platform_device rtc_device = { 249static struct platform_device rtc_device = {
213 .name = "rtc-bfin", 250 .name = "rtc-bfin",
@@ -628,6 +665,14 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
628}; 665};
629#endif 666#endif
630 667
668#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
669static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
670 .enable_dma = 0, /* use dma transfer with this chip*/
671 .bits_per_word = 8,
672 .cs_change_per_word = 0,
673};
674#endif
675
631static struct spi_board_info bfin_spi_board_info[] __initdata = { 676static struct spi_board_info bfin_spi_board_info[] __initdata = {
632#if defined(CONFIG_MTD_M25P80) \ 677#if defined(CONFIG_MTD_M25P80) \
633 || defined(CONFIG_MTD_M25P80_MODULE) 678 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -653,15 +698,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
653 }, 698 },
654#endif 699#endif
655#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 700#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
656{ 701 {
657 .modalias = "ad7877", 702 .modalias = "ad7877",
658 .platform_data = &bfin_ad7877_ts_info, 703 .platform_data = &bfin_ad7877_ts_info,
659 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ 704 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
660 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 705 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
661 .bus_num = 0, 706 .bus_num = 0,
662 .chip_select = 2, 707 .chip_select = 2,
663 .controller_data = &spi_ad7877_chip_info, 708 .controller_data = &spi_ad7877_chip_info,
664}, 709 },
665#endif 710#endif
666#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 711#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
667 { 712 {
@@ -672,8 +717,19 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
672 .controller_data = &spidev_chip_info, 717 .controller_data = &spidev_chip_info,
673 }, 718 },
674#endif 719#endif
720#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
721 {
722 .modalias = "adxl34x",
723 .platform_data = &adxl34x_info,
724 .irq = IRQ_PC5,
725 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
726 .bus_num = 1,
727 .chip_select = 2,
728 .controller_data = &spi_adxl34x_chip_info,
729 .mode = SPI_MODE_3,
730 },
731#endif
675}; 732};
676
677#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 733#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
678/* SPI (0) */ 734/* SPI (0) */
679static struct resource bfin_spi0_resource[] = { 735static struct resource bfin_spi0_resource[] = {
@@ -786,7 +842,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
786 842
787#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 843#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
788static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { 844static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
789#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 845#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
790 { 846 {
791 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 847 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
792 }, 848 },
@@ -797,6 +853,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
797 .irq = 212, 853 .irq = 212,
798 }, 854 },
799#endif 855#endif
856#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
857 {
858 I2C_BOARD_INFO("adxl34x", 0x53),
859 .irq = IRQ_PC5,
860 .platform_data = (void *)&adxl34x_info,
861 },
862#endif
800}; 863};
801#endif 864#endif
802 865
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 882e40ccf0d1..c510ae688e28 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -6,26 +6,31 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule 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 H, 01/16/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_
14#define _MACH_ANOMALY_H_ 14#define _MACH_ANOMALY_H_
15 15
16/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */ 16/* We do not support 0.0 or 0.1 silicon - sorry */
17#if __SILICON_REVISION__ < 2
18# error will not work on BF548 silicon version 0.0, or 0.1
19#endif
20
21/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
17#define ANOMALY_05000074 (1) 22#define ANOMALY_05000074 (1)
18/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */ 23/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
19#define ANOMALY_05000119 (1) 24#define ANOMALY_05000119 (1)
20/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 25/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
21#define ANOMALY_05000122 (1) 26#define ANOMALY_05000122 (1)
22/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ 27/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
23#define ANOMALY_05000245 (1) 28#define ANOMALY_05000245 (1)
24/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ 29/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
25#define ANOMALY_05000265 (1) 30#define ANOMALY_05000265 (1)
26/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */ 31/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
27#define ANOMALY_05000272 (1) 32#define ANOMALY_05000272 (1)
28/* False Hardware Error Exception when ISR context is not restored */ 33/* False Hardware Error Exception When ISR Context Is Not Restored */
29#define ANOMALY_05000281 (__SILICON_REVISION__ < 1) 34#define ANOMALY_05000281 (__SILICON_REVISION__ < 1)
30/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */ 35/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
31#define ANOMALY_05000304 (__SILICON_REVISION__ < 1) 36#define ANOMALY_05000304 (__SILICON_REVISION__ < 1)
@@ -59,7 +64,7 @@
59#define ANOMALY_05000340 (__SILICON_REVISION__ < 1) 64#define ANOMALY_05000340 (__SILICON_REVISION__ < 1)
60/* Boot Host Wait (HWAIT) and Boot Host Wait Alternate (HWAITA) Signals Are Swapped */ 65/* Boot Host Wait (HWAIT) and Boot Host Wait Alternate (HWAITA) Signals Are Swapped */
61#define ANOMALY_05000344 (__SILICON_REVISION__ < 1) 66#define ANOMALY_05000344 (__SILICON_REVISION__ < 1)
62/* USB Calibration Value Is Not Intialized */ 67/* USB Calibration Value Is Not Initialized */
63#define ANOMALY_05000346 (__SILICON_REVISION__ < 1) 68#define ANOMALY_05000346 (__SILICON_REVISION__ < 1)
64/* USB Calibration Value to use */ 69/* USB Calibration Value to use */
65#define ANOMALY_05000346_value 0x5411 70#define ANOMALY_05000346_value 0x5411
@@ -147,11 +152,11 @@
147#define ANOMALY_05000416 (1) 152#define ANOMALY_05000416 (1)
148/* Multichannel SPORT Channel Misalignment Under Specific Configuration */ 153/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
149#define ANOMALY_05000425 (1) 154#define ANOMALY_05000425 (1)
150/* Speculative Fetches of Indirect-Pointer Instructions Can Cause Spurious Hardware Errors */ 155/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
151#define ANOMALY_05000426 (1) 156#define ANOMALY_05000426 (1)
152/* CORE_EPPI_PRIO bit and SYS_EPPI_PRIO bit in the HMDMA1_CONTROL register are not functional */ 157/* CORE_EPPI_PRIO bit and SYS_EPPI_PRIO bit in the HMDMA1_CONTROL register are not functional */
153#define ANOMALY_05000427 (__SILICON_REVISION__ < 2) 158#define ANOMALY_05000427 (__SILICON_REVISION__ < 2)
154/* WB_EDGE Bit in NFC_IRQSTAT Incorrectly Behaves as a Buffer Status Bit Instead of an IRQ Status Bit */ 159/* WB_EDGE Bit in NFC_IRQSTAT Incorrectly Reflects Buffer Status Instead of IRQ Status */
155#define ANOMALY_05000429 (__SILICON_REVISION__ < 2) 160#define ANOMALY_05000429 (__SILICON_REVISION__ < 2)
156/* Software System Reset Corrupts PLL_LOCKCNT Register */ 161/* Software System Reset Corrupts PLL_LOCKCNT Register */
157#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2) 162#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2)
@@ -170,26 +175,49 @@
170/* Reduced Timing Margins on DDR Output Setup and Hold (tDS and tDH) */ 175/* Reduced Timing Margins on DDR Output Setup and Hold (tDS and tDH) */
171#define ANOMALY_05000449 (__SILICON_REVISION__ == 1) 176#define ANOMALY_05000449 (__SILICON_REVISION__ == 1)
172/* USB DMA Mode 1 Short Packet Data Corruption */ 177/* USB DMA Mode 1 Short Packet Data Corruption */
173#define ANOMALY_05000450 (1 178#define ANOMALY_05000450 (1)
179/* USB Receive Interrupt Is Not Generated in DMA Mode 1 */
180#define ANOMALY_05000456 (__SILICON_REVISION__ < 3)
181/* False Hardware Error when RETI points to invalid memory */
182#define ANOMALY_05000461 (1)
174 183
175/* Anomalies that don't exist on this proc */ 184/* Anomalies that don't exist on this proc */
185#define ANOMALY_05000099 (0)
186#define ANOMALY_05000120 (0)
176#define ANOMALY_05000125 (0) 187#define ANOMALY_05000125 (0)
188#define ANOMALY_05000149 (0)
177#define ANOMALY_05000158 (0) 189#define ANOMALY_05000158 (0)
190#define ANOMALY_05000171 (0)
191#define ANOMALY_05000179 (0)
178#define ANOMALY_05000183 (0) 192#define ANOMALY_05000183 (0)
179#define ANOMALY_05000198 (0) 193#define ANOMALY_05000198 (0)
194#define ANOMALY_05000215 (0)
195#define ANOMALY_05000220 (0)
196#define ANOMALY_05000227 (0)
180#define ANOMALY_05000230 (0) 197#define ANOMALY_05000230 (0)
198#define ANOMALY_05000231 (0)
199#define ANOMALY_05000233 (0)
200#define ANOMALY_05000242 (0)
181#define ANOMALY_05000244 (0) 201#define ANOMALY_05000244 (0)
202#define ANOMALY_05000248 (0)
203#define ANOMALY_05000250 (0)
204#define ANOMALY_05000254 (0)
182#define ANOMALY_05000261 (0) 205#define ANOMALY_05000261 (0)
183#define ANOMALY_05000263 (0) 206#define ANOMALY_05000263 (0)
184#define ANOMALY_05000266 (0) 207#define ANOMALY_05000266 (0)
185#define ANOMALY_05000273 (0) 208#define ANOMALY_05000273 (0)
209#define ANOMALY_05000274 (0)
186#define ANOMALY_05000278 (0) 210#define ANOMALY_05000278 (0)
211#define ANOMALY_05000287 (0)
212#define ANOMALY_05000301 (0)
187#define ANOMALY_05000305 (0) 213#define ANOMALY_05000305 (0)
188#define ANOMALY_05000307 (0) 214#define ANOMALY_05000307 (0)
189#define ANOMALY_05000311 (0) 215#define ANOMALY_05000311 (0)
190#define ANOMALY_05000323 (0) 216#define ANOMALY_05000323 (0)
217#define ANOMALY_05000362 (1)
191#define ANOMALY_05000363 (0) 218#define ANOMALY_05000363 (0)
192#define ANOMALY_05000380 (0) 219#define ANOMALY_05000380 (0)
220#define ANOMALY_05000400 (0)
193#define ANOMALY_05000412 (0) 221#define ANOMALY_05000412 (0)
194#define ANOMALY_05000432 (0) 222#define ANOMALY_05000432 (0)
195#define ANOMALY_05000435 (0) 223#define ANOMALY_05000435 (0)
diff --git a/arch/blackfin/mach-bf548/include/mach/portmux.h b/arch/blackfin/mach-bf548/include/mach/portmux.h
index ffb1d0a44b4d..ce372ba0f046 100644
--- a/arch/blackfin/mach-bf548/include/mach/portmux.h
+++ b/arch/blackfin/mach-bf548/include/mach/portmux.h
@@ -167,22 +167,42 @@
167#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0)) 167#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
168#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0)) 168#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
169#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0)) 169#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
170#define P_ATAPI_D0A (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1)) 170
171#define P_ATAPI_D1A (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1)) 171#ifdef CONFIG_BF548_ATAPI_ALTERNATIVE_PORT
172#define P_ATAPI_D2A (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1)) 172# define P_ATAPI_D0A (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
173#define P_ATAPI_D3A (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1)) 173# define P_ATAPI_D1A (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
174#define P_ATAPI_D4A (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1)) 174# define P_ATAPI_D2A (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
175#define P_ATAPI_D5A (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1)) 175# define P_ATAPI_D3A (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
176#define P_ATAPI_D6A (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1)) 176# define P_ATAPI_D4A (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
177#define P_ATAPI_D7A (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1)) 177# define P_ATAPI_D5A (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
178#define P_ATAPI_D8A (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1)) 178# define P_ATAPI_D6A (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
179#define P_ATAPI_D9A (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1)) 179# define P_ATAPI_D7A (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
180#define P_ATAPI_D10A (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1)) 180# define P_ATAPI_D8A (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
181#define P_ATAPI_D11A (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(1)) 181# define P_ATAPI_D9A (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
182#define P_ATAPI_D12A (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(1)) 182# define P_ATAPI_D10A (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1))
183#define P_ATAPI_D13A (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1)) 183# define P_ATAPI_D11A (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(1))
184#define P_ATAPI_D14A (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1)) 184# define P_ATAPI_D12A (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(1))
185#define P_ATAPI_D15A (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1)) 185# define P_ATAPI_D13A (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1))
186# define P_ATAPI_D14A (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
187# define P_ATAPI_D15A (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
188#else
189# define P_ATAPI_D0A (P_DONTCARE)
190# define P_ATAPI_D1A (P_DONTCARE)
191# define P_ATAPI_D2A (P_DONTCARE)
192# define P_ATAPI_D3A (P_DONTCARE)
193# define P_ATAPI_D4A (P_DONTCARE)
194# define P_ATAPI_D5A (P_DONTCARE)
195# define P_ATAPI_D6A (P_DONTCARE)
196# define P_ATAPI_D7A (P_DONTCARE)
197# define P_ATAPI_D8A (P_DONTCARE)
198# define P_ATAPI_D9A (P_DONTCARE)
199# define P_ATAPI_D10A (P_DONTCARE)
200# define P_ATAPI_D11A (P_DONTCARE)
201# define P_ATAPI_D12A (P_DONTCARE)
202# define P_ATAPI_D13A (P_DONTCARE)
203# define P_ATAPI_D14A (P_DONTCARE)
204# define P_ATAPI_D15A (P_DONTCARE)
205#endif
186 206
187#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0)) 207#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
188#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) 208#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
@@ -200,9 +220,15 @@
200#define P_CAN0_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0)) 220#define P_CAN0_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
201#define P_CAN1_TX (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0)) 221#define P_CAN1_TX (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
202#define P_CAN1_RX (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0)) 222#define P_CAN1_RX (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
203#define P_ATAPI_A0A (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(1)) 223#ifdef CONFIG_BF548_ATAPI_ALTERNATIVE_PORT
204#define P_ATAPI_A1A (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1)) 224# define P_ATAPI_A0A (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(1))
205#define P_ATAPI_A2A (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1)) 225# define P_ATAPI_A1A (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))
226# define P_ATAPI_A2A (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1))
227#else
228# define P_ATAPI_A0A (P_DONTCARE)
229# define P_ATAPI_A1A (P_DONTCARE)
230# define P_ATAPI_A2A (P_DONTCARE)
231#endif
206#define P_HOST_CE (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(1)) 232#define P_HOST_CE (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(1))
207#define P_HOST_RD (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1)) 233#define P_HOST_RD (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1))
208#define P_HOST_WR (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1)) 234#define P_HOST_WR (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))
diff --git a/arch/blackfin/mach-bf561/Kconfig b/arch/blackfin/mach-bf561/Kconfig
index 638ec38ca470..cb9743641511 100644
--- a/arch/blackfin/mach-bf561/Kconfig
+++ b/arch/blackfin/mach-bf561/Kconfig
@@ -9,22 +9,9 @@ if (!SMP)
9comment "Core B Support" 9comment "Core B Support"
10 10
11config BF561_COREB 11config BF561_COREB
12 bool "Enable Core B support" 12 bool "Enable Core B loader"
13 default y 13 default y
14 14
15config BF561_COREB_RESET
16 bool "Enable Core B reset support"
17 default n
18 help
19 This requires code in the application that is loaded
20 into Core B. In order to reset, the application needs
21 to install an interrupt handler for Supplemental
22 Interrupt 0, that sets RETI to 0xff600000 and writes
23 bit 11 of SICB_SYSCR when bit 5 of SICA_SYSCR is 0.
24 This causes Core B to stall when Supplemental Interrupt
25 0 is set, and will reset PC to 0xff600000 when
26 COREB_SRAM_INIT is cleared.
27
28endif 15endif
29 16
30comment "Interrupt Priority Assignment" 17comment "Interrupt Priority Assignment"
@@ -138,6 +125,7 @@ config IRQ_DMA2_11
138 default 9 125 default 9
139config IRQ_TIMER0 126config IRQ_TIMER0
140 int "TIMER 0 Interrupt" 127 int "TIMER 0 Interrupt"
128 default 7 if TICKSOURCE_GPTMR0
141 default 8 129 default 8
142config IRQ_TIMER1 130config IRQ_TIMER1
143 int "TIMER 1 Interrupt" 131 int "TIMER 1 Interrupt"
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index f623c6b0719f..0dd9685e5d53 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -83,7 +83,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
83}; 83};
84#endif 84#endif
85 85
86#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 86#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
87/* SPI ADC chip */ 87/* SPI ADC chip */
88static struct bfin5xx_spi_chip spi_adc_chip_info = { 88static struct bfin5xx_spi_chip spi_adc_chip_info = {
89 .enable_dma = 1, /* use dma transfer with this chip*/ 89 .enable_dma = 1, /* use dma transfer with this chip*/
@@ -126,7 +126,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
126 }, 126 },
127#endif 127#endif
128 128
129#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 129#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
130 { 130 {
131 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 131 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
132 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 132 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
diff --git a/arch/blackfin/mach-bf561/coreb.c b/arch/blackfin/mach-bf561/coreb.c
index 8598098c0840..93635a766f9c 100644
--- a/arch/blackfin/mach-bf561/coreb.c
+++ b/arch/blackfin/mach-bf561/coreb.c
@@ -1,406 +1,74 @@
1/* 1/* Load firmware into Core B on a BF561
2 * File: arch/blackfin/mach-bf561/coreb.c
3 * Based on:
4 * Author:
5 * 2 *
6 * Created: 3 * Copyright 2004-2009 Analog Devices Inc.
7 * Description: Handle CoreB on a BF561 4 * Licensed under the GPL-2 or later.
8 * 5 */
9 * Modified: 6
10 * Copyright 2004-2006 Analog Devices Inc. 7/* The Core B reset func requires code in the application that is loaded into
11 * 8 * Core B. In order to reset, the application needs to install an interrupt
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 9 * handler for Supplemental Interrupt 0, that sets RETI to 0xff600000 and
13 * 10 * writes bit 11 of SICB_SYSCR when bit 5 of SICA_SYSCR is 0. This causes Core
14 * This program is free software; you can redistribute it and/or modify 11 * B to stall when Supplemental Interrupt 0 is set, and will reset PC to
15 * it under the terms of the GNU General Public License as published by 12 * 0xff600000 when COREB_SRAM_INIT is cleared.
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 */ 13 */
29 14
30#include <linux/mm.h>
31#include <linux/miscdevice.h>
32#include <linux/device.h> 15#include <linux/device.h>
33#include <linux/ioport.h>
34#include <linux/module.h>
35#include <linux/uaccess.h>
36#include <linux/fs.h> 16#include <linux/fs.h>
37#include <asm/dma.h> 17#include <linux/kernel.h>
38#include <asm/cacheflush.h> 18#include <linux/miscdevice.h>
39 19#include <linux/module.h>
40#define MODULE_VER "v0.1"
41
42static spinlock_t coreb_lock;
43static wait_queue_head_t coreb_dma_wait;
44
45#define COREB_IS_OPEN 0x00000001
46#define COREB_IS_RUNNING 0x00000010
47 20
48#define CMD_COREB_INDEX 1
49#define CMD_COREB_START 2 21#define CMD_COREB_START 2
50#define CMD_COREB_STOP 3 22#define CMD_COREB_STOP 3
51#define CMD_COREB_RESET 4 23#define CMD_COREB_RESET 4
52 24
53#define COREB_MINOR 229 25static int
54 26coreb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
55static unsigned long coreb_status = 0;
56static unsigned long coreb_base = 0xff600000;
57static unsigned long coreb_size = 0x4000;
58int coreb_dma_done;
59
60static loff_t coreb_lseek(struct file *file, loff_t offset, int origin);
61static ssize_t coreb_read(struct file *file, char *buf, size_t count,
62 loff_t * ppos);
63static ssize_t coreb_write(struct file *file, const char *buf, size_t count,
64 loff_t * ppos);
65static int coreb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
66 unsigned long arg);
67static int coreb_open(struct inode *inode, struct file *file);
68static int coreb_release(struct inode *inode, struct file *file);
69
70static irqreturn_t coreb_dma_interrupt(int irq, void *dev_id)
71{
72 clear_dma_irqstat(CH_MEM_STREAM2_DEST);
73 coreb_dma_done = 1;
74 wake_up_interruptible(&coreb_dma_wait);
75 return IRQ_HANDLED;
76}
77
78static ssize_t coreb_write(struct file *file, const char *buf, size_t count,
79 loff_t * ppos)
80{
81 unsigned long p = *ppos;
82 ssize_t wrote = 0;
83
84 if (p + count > coreb_size)
85 return -EFAULT;
86
87 while (count > 0) {
88 int len = count;
89
90 if (len > PAGE_SIZE)
91 len = PAGE_SIZE;
92
93 coreb_dma_done = 0;
94
95 flush_dcache_range((unsigned long)buf, (unsigned long)(buf+len));
96 /* Source Channel */
97 set_dma_start_addr(CH_MEM_STREAM2_SRC, (unsigned long)buf);
98 set_dma_x_count(CH_MEM_STREAM2_SRC, len);
99 set_dma_x_modify(CH_MEM_STREAM2_SRC, sizeof(char));
100 set_dma_config(CH_MEM_STREAM2_SRC, 0);
101 /* Destination Channel */
102 set_dma_start_addr(CH_MEM_STREAM2_DEST, coreb_base + p);
103 set_dma_x_count(CH_MEM_STREAM2_DEST, len);
104 set_dma_x_modify(CH_MEM_STREAM2_DEST, sizeof(char));
105 set_dma_config(CH_MEM_STREAM2_DEST, WNR | RESTART | DI_EN);
106
107 enable_dma(CH_MEM_STREAM2_SRC);
108 enable_dma(CH_MEM_STREAM2_DEST);
109
110 wait_event_interruptible(coreb_dma_wait, coreb_dma_done);
111
112 disable_dma(CH_MEM_STREAM2_SRC);
113 disable_dma(CH_MEM_STREAM2_DEST);
114
115 count -= len;
116 wrote += len;
117 buf += len;
118 p += len;
119 }
120 *ppos = p;
121 return wrote;
122}
123
124static ssize_t coreb_read(struct file *file, char *buf, size_t count,
125 loff_t * ppos)
126{
127 unsigned long p = *ppos;
128 ssize_t read = 0;
129
130 if ((p + count) > coreb_size)
131 return -EFAULT;
132
133 while (count > 0) {
134 int len = count;
135
136 if (len > PAGE_SIZE)
137 len = PAGE_SIZE;
138
139 coreb_dma_done = 0;
140
141 invalidate_dcache_range((unsigned long)buf, (unsigned long)(buf+len));
142 /* Source Channel */
143 set_dma_start_addr(CH_MEM_STREAM2_SRC, coreb_base + p);
144 set_dma_x_count(CH_MEM_STREAM2_SRC, len);
145 set_dma_x_modify(CH_MEM_STREAM2_SRC, sizeof(char));
146 set_dma_config(CH_MEM_STREAM2_SRC, 0);
147 /* Destination Channel */
148 set_dma_start_addr(CH_MEM_STREAM2_DEST, (unsigned long)buf);
149 set_dma_x_count(CH_MEM_STREAM2_DEST, len);
150 set_dma_x_modify(CH_MEM_STREAM2_DEST, sizeof(char));
151 set_dma_config(CH_MEM_STREAM2_DEST, WNR | RESTART | DI_EN);
152
153 enable_dma(CH_MEM_STREAM2_SRC);
154 enable_dma(CH_MEM_STREAM2_DEST);
155
156 wait_event_interruptible(coreb_dma_wait, coreb_dma_done);
157
158 disable_dma(CH_MEM_STREAM2_SRC);
159 disable_dma(CH_MEM_STREAM2_DEST);
160
161 count -= len;
162 read += len;
163 buf += len;
164 p += len;
165 }
166
167 return read;
168}
169
170static loff_t coreb_lseek(struct file *file, loff_t offset, int origin)
171{ 27{
172 loff_t ret; 28 int ret = 0;
173
174 mutex_lock(&file->f_dentry->d_inode->i_mutex);
175
176 switch (origin) {
177 case 0 /* SEEK_SET */ :
178 if (offset < coreb_size) {
179 file->f_pos = offset;
180 ret = file->f_pos;
181 } else
182 ret = -EINVAL;
183 break;
184 case 1 /* SEEK_CUR */ :
185 if ((offset + file->f_pos) < coreb_size) {
186 file->f_pos += offset;
187 ret = file->f_pos;
188 } else
189 ret = -EINVAL;
190 default:
191 ret = -EINVAL;
192 }
193 mutex_unlock(&file->f_dentry->d_inode->i_mutex);
194 return ret;
195}
196
197/* No BKL needed here */
198static int coreb_open(struct inode *inode, struct file *file)
199{
200 spin_lock_irq(&coreb_lock);
201
202 if (coreb_status & COREB_IS_OPEN)
203 goto out_busy;
204
205 coreb_status |= COREB_IS_OPEN;
206
207 spin_unlock_irq(&coreb_lock);
208 return 0;
209
210 out_busy:
211 spin_unlock_irq(&coreb_lock);
212 return -EBUSY;
213}
214
215static int coreb_release(struct inode *inode, struct file *file)
216{
217 spin_lock_irq(&coreb_lock);
218 coreb_status &= ~COREB_IS_OPEN;
219 spin_unlock_irq(&coreb_lock);
220 return 0;
221}
222
223static int coreb_ioctl(struct inode *inode, struct file *file,
224 unsigned int cmd, unsigned long arg)
225{
226 int retval = 0;
227 int coreb_index = 0;
228 29
229 switch (cmd) { 30 switch (cmd) {
230 case CMD_COREB_INDEX:
231 if (copy_from_user(&coreb_index, (int *)arg, sizeof(int))) {
232 retval = -EFAULT;
233 break;
234 }
235
236 spin_lock_irq(&coreb_lock);
237 switch (coreb_index) {
238 case 0:
239 coreb_base = 0xff600000;
240 coreb_size = 0x4000;
241 break;
242 case 1:
243 coreb_base = 0xff610000;
244 coreb_size = 0x4000;
245 break;
246 case 2:
247 coreb_base = 0xff500000;
248 coreb_size = 0x8000;
249 break;
250 case 3:
251 coreb_base = 0xff400000;
252 coreb_size = 0x8000;
253 break;
254 default:
255 retval = -EINVAL;
256 break;
257 }
258 spin_unlock_irq(&coreb_lock);
259
260 mutex_lock(&file->f_dentry->d_inode->i_mutex);
261 file->f_pos = 0;
262 mutex_unlock(&file->f_dentry->d_inode->i_mutex);
263 break;
264 case CMD_COREB_START: 31 case CMD_COREB_START:
265 spin_lock_irq(&coreb_lock);
266 if (coreb_status & COREB_IS_RUNNING) {
267 retval = -EBUSY;
268 break;
269 }
270 printk(KERN_INFO "Starting Core B\n");
271 coreb_status |= COREB_IS_RUNNING;
272 bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() & ~0x0020); 32 bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() & ~0x0020);
273 SSYNC();
274 spin_unlock_irq(&coreb_lock);
275 break; 33 break;
276#if defined(CONFIG_BF561_COREB_RESET)
277 case CMD_COREB_STOP: 34 case CMD_COREB_STOP:
278 spin_lock_irq(&coreb_lock);
279 printk(KERN_INFO "Stopping Core B\n");
280 bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() | 0x0020); 35 bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() | 0x0020);
281 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | 0x0080); 36 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | 0x0080);
282 coreb_status &= ~COREB_IS_RUNNING;
283 spin_unlock_irq(&coreb_lock);
284 break; 37 break;
285 case CMD_COREB_RESET: 38 case CMD_COREB_RESET:
286 printk(KERN_INFO "Resetting Core B\n");
287 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | 0x0080); 39 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | 0x0080);
288 break; 40 break;
289#endif 41 default:
42 ret = -EINVAL;
43 break;
290 } 44 }
291 45
292 return retval; 46 CSYNC();
47
48 return ret;
293} 49}
294 50
295static struct file_operations coreb_fops = { 51static struct file_operations coreb_fops = {
296 .owner = THIS_MODULE, 52 .owner = THIS_MODULE,
297 .llseek = coreb_lseek, 53 .ioctl = coreb_ioctl,
298 .read = coreb_read,
299 .write = coreb_write,
300 .ioctl = coreb_ioctl,
301 .open = coreb_open,
302 .release = coreb_release
303}; 54};
304 55
305static struct miscdevice coreb_dev = { 56static struct miscdevice coreb_dev = {
306 COREB_MINOR, 57 .minor = MISC_DYNAMIC_MINOR,
307 "coreb", 58 .name = "coreb",
308 &coreb_fops 59 .fops = &coreb_fops,
309}; 60};
310 61
311static ssize_t coreb_show_status(struct device *dev, struct device_attribute *attr, char *buf) 62static int __init bf561_coreb_init(void)
312{ 63{
313 return sprintf(buf, 64 return misc_register(&coreb_dev);
314 "Base Address:\t0x%08lx\n"
315 "Core B is %s\n"
316 "SICA_SYSCR:\t%04x\n"
317 "SICB_SYSCR:\t%04x\n"
318 "\n"
319 "IRQ Status:\tCore A\t\tCore B\n"
320 "ISR0:\t\t%08x\t\t%08x\n"
321 "ISR1:\t\t%08x\t\t%08x\n"
322 "IMASK0:\t\t%08x\t\t%08x\n"
323 "IMASK1:\t\t%08x\t\t%08x\n",
324 coreb_base,
325 coreb_status & COREB_IS_RUNNING ? "running" : "stalled",
326 bfin_read_SICA_SYSCR(), bfin_read_SICB_SYSCR(),
327 bfin_read_SICA_ISR0(), bfin_read_SICB_ISR0(),
328 bfin_read_SICA_ISR1(), bfin_read_SICB_ISR0(),
329 bfin_read_SICA_IMASK0(), bfin_read_SICB_IMASK0(),
330 bfin_read_SICA_IMASK1(), bfin_read_SICB_IMASK1());
331}
332
333static DEVICE_ATTR(coreb_status, S_IRUGO, coreb_show_status, NULL);
334
335int __init bf561_coreb_init(void)
336{
337 init_waitqueue_head(&coreb_dma_wait);
338
339 spin_lock_init(&coreb_lock);
340 /* Request the core memory regions for Core B */
341 if (request_mem_region(0xff600000, 0x4000,
342 "Core B - Instruction SRAM") == NULL)
343 goto exit;
344
345 if (request_mem_region(0xFF610000, 0x4000,
346 "Core B - Instruction SRAM") == NULL)
347 goto release_instruction_a_sram;
348
349 if (request_mem_region(0xFF500000, 0x8000,
350 "Core B - Data Bank B SRAM") == NULL)
351 goto release_instruction_b_sram;
352
353 if (request_mem_region(0xff400000, 0x8000,
354 "Core B - Data Bank A SRAM") == NULL)
355 goto release_data_b_sram;
356
357 if (request_dma(CH_MEM_STREAM2_DEST, "Core B - DMA Destination") < 0)
358 goto release_data_a_sram;
359
360 if (request_dma(CH_MEM_STREAM2_SRC, "Core B - DMA Source") < 0)
361 goto release_dma_dest;
362
363 set_dma_callback(CH_MEM_STREAM2_DEST, coreb_dma_interrupt, NULL);
364
365 misc_register(&coreb_dev);
366
367 if (device_create_file(coreb_dev.this_device, &dev_attr_coreb_status))
368 goto release_dma_src;
369
370 printk(KERN_INFO "BF561 Core B driver %s initialized.\n", MODULE_VER);
371 return 0;
372
373 release_dma_src:
374 free_dma(CH_MEM_STREAM2_SRC);
375 release_dma_dest:
376 free_dma(CH_MEM_STREAM2_DEST);
377 release_data_a_sram:
378 release_mem_region(0xff400000, 0x8000);
379 release_data_b_sram:
380 release_mem_region(0xff500000, 0x8000);
381 release_instruction_b_sram:
382 release_mem_region(0xff610000, 0x4000);
383 release_instruction_a_sram:
384 release_mem_region(0xff600000, 0x4000);
385 exit:
386 return -ENOMEM;
387} 65}
66module_init(bf561_coreb_init);
388 67
389void __exit bf561_coreb_exit(void) 68static void __exit bf561_coreb_exit(void)
390{ 69{
391 device_remove_file(coreb_dev.this_device, &dev_attr_coreb_status);
392 misc_deregister(&coreb_dev); 70 misc_deregister(&coreb_dev);
393
394 release_mem_region(0xff610000, 0x4000);
395 release_mem_region(0xff600000, 0x4000);
396 release_mem_region(0xff500000, 0x8000);
397 release_mem_region(0xff400000, 0x8000);
398
399 free_dma(CH_MEM_STREAM2_DEST);
400 free_dma(CH_MEM_STREAM2_SRC);
401} 71}
402
403module_init(bf561_coreb_init);
404module_exit(bf561_coreb_exit); 72module_exit(bf561_coreb_exit);
405 73
406MODULE_AUTHOR("Bas Vermeulen <bvermeul@blackstar.xs4all.nl>"); 74MODULE_AUTHOR("Bas Vermeulen <bvermeul@blackstar.xs4all.nl>");
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index d0b0b3506440..dccd396cd931 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -6,7 +6,7 @@
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file should be up to date with:
10 * - Revision Q, 11/07/2008; ADSP-BF561 Blackfin Processor Anomaly List 10 * - Revision Q, 11/07/2008; ADSP-BF561 Blackfin Processor Anomaly List
11 */ 11 */
12 12
@@ -18,11 +18,11 @@
18# error will not work on BF561 silicon version 0.0, 0.1, 0.2, or 0.4 18# error will not work on BF561 silicon version 0.0, 0.1, 0.2, or 0.4
19#endif 19#endif
20 20
21/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot 2 Not Supported */ 21/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
22#define ANOMALY_05000074 (1) 22#define ANOMALY_05000074 (1)
23/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */ 23/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */
24#define ANOMALY_05000099 (__SILICON_REVISION__ < 5) 24#define ANOMALY_05000099 (__SILICON_REVISION__ < 5)
25/* Trace Buffers may contain errors in emulation mode and/or exception, NMI, reset handlers */ 25/* Trace Buffers may record discontinuities into emulation mode and/or exception, NMI, reset handlers */
26#define ANOMALY_05000116 (__SILICON_REVISION__ < 3) 26#define ANOMALY_05000116 (__SILICON_REVISION__ < 3)
27/* Testset instructions restricted to 32-bit aligned memory locations */ 27/* Testset instructions restricted to 32-bit aligned memory locations */
28#define ANOMALY_05000120 (1) 28#define ANOMALY_05000120 (1)
@@ -40,7 +40,7 @@
40#define ANOMALY_05000136 (__SILICON_REVISION__ < 3) 40#define ANOMALY_05000136 (__SILICON_REVISION__ < 3)
41/* Allowing the SPORT RX FIFO to fill will cause an overflow */ 41/* Allowing the SPORT RX FIFO to fill will cause an overflow */
42#define ANOMALY_05000140 (__SILICON_REVISION__ < 3) 42#define ANOMALY_05000140 (__SILICON_REVISION__ < 3)
43/* Infinite Stall may occur with a particular sequence of consecutive dual dag events */ 43/* An Infinite Stall occurs with a particular sequence of consecutive dual dag events */
44#define ANOMALY_05000141 (__SILICON_REVISION__ < 3) 44#define ANOMALY_05000141 (__SILICON_REVISION__ < 3)
45/* Interrupts may be lost when a programmable input flag is configured to be edge sensitive */ 45/* Interrupts may be lost when a programmable input flag is configured to be edge sensitive */
46#define ANOMALY_05000142 (__SILICON_REVISION__ < 3) 46#define ANOMALY_05000142 (__SILICON_REVISION__ < 3)
@@ -80,7 +80,7 @@
80#define ANOMALY_05000163 (__SILICON_REVISION__ < 3) 80#define ANOMALY_05000163 (__SILICON_REVISION__ < 3)
81/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */ 81/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */
82#define ANOMALY_05000166 (1) 82#define ANOMALY_05000166 (1)
83/* Turning Serial Ports on with External Frame Syncs */ 83/* Turning SPORTs on while External Frame Sync Is Active May Corrupt Data */
84#define ANOMALY_05000167 (1) 84#define ANOMALY_05000167 (1)
85/* SDRAM auto-refresh and subsequent Power Ups */ 85/* SDRAM auto-refresh and subsequent Power Ups */
86#define ANOMALY_05000168 (__SILICON_REVISION__ < 5) 86#define ANOMALY_05000168 (__SILICON_REVISION__ < 5)
@@ -164,7 +164,7 @@
164#define ANOMALY_05000242 (__SILICON_REVISION__ < 5) 164#define ANOMALY_05000242 (__SILICON_REVISION__ < 5)
165/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */ 165/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
166#define ANOMALY_05000244 (__SILICON_REVISION__ < 5) 166#define ANOMALY_05000244 (__SILICON_REVISION__ < 5)
167/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ 167/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
168#define ANOMALY_05000245 (__SILICON_REVISION__ < 5) 168#define ANOMALY_05000245 (__SILICON_REVISION__ < 5)
169/* TESTSET operation forces stall on the other core */ 169/* TESTSET operation forces stall on the other core */
170#define ANOMALY_05000248 (__SILICON_REVISION__ < 5) 170#define ANOMALY_05000248 (__SILICON_REVISION__ < 5)
@@ -208,7 +208,7 @@
208#define ANOMALY_05000275 (__SILICON_REVISION__ > 2) 208#define ANOMALY_05000275 (__SILICON_REVISION__ > 2)
209/* Timing Requirements Change for External Frame Sync PPI Modes with Non-Zero PPI_DELAY */ 209/* Timing Requirements Change for External Frame Sync PPI Modes with Non-Zero PPI_DELAY */
210#define ANOMALY_05000276 (__SILICON_REVISION__ < 5) 210#define ANOMALY_05000276 (__SILICON_REVISION__ < 5)
211/* Writes to an I/O data register one SCLK cycle after an edge is detected may clear interrupt */ 211/* Writes to an I/O Data Register One SCLK Cycle after an Edge Is Detected May Clear Interrupt */
212#define ANOMALY_05000277 (__SILICON_REVISION__ < 3) 212#define ANOMALY_05000277 (__SILICON_REVISION__ < 3)
213/* Disabling Peripherals with DMA Running May Cause DMA System Instability */ 213/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
214#define ANOMALY_05000278 (__SILICON_REVISION__ < 5) 214#define ANOMALY_05000278 (__SILICON_REVISION__ < 5)
@@ -232,7 +232,7 @@
232#define ANOMALY_05000310 (1) 232#define ANOMALY_05000310 (1)
233/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */ 233/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
234#define ANOMALY_05000312 (1) 234#define ANOMALY_05000312 (1)
235/* PPI Is Level-Sensitive on First Transfer */ 235/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
236#define ANOMALY_05000313 (1) 236#define ANOMALY_05000313 (1)
237/* Killed System MMR Write Completes Erroneously On Next System MMR Access */ 237/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
238#define ANOMALY_05000315 (1) 238#define ANOMALY_05000315 (1)
@@ -276,18 +276,27 @@
276#define ANOMALY_05000428 (__SILICON_REVISION__ > 3) 276#define ANOMALY_05000428 (__SILICON_REVISION__ > 3)
277/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 277/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
278#define ANOMALY_05000443 (1) 278#define ANOMALY_05000443 (1)
279/* False Hardware Error when RETI points to invalid memory */
280#define ANOMALY_05000461 (1)
279 281
280/* Anomalies that don't exist on this proc */ 282/* Anomalies that don't exist on this proc */
283#define ANOMALY_05000119 (0)
281#define ANOMALY_05000158 (0) 284#define ANOMALY_05000158 (0)
282#define ANOMALY_05000183 (0) 285#define ANOMALY_05000183 (0)
286#define ANOMALY_05000233 (0)
283#define ANOMALY_05000273 (0) 287#define ANOMALY_05000273 (0)
284#define ANOMALY_05000311 (0) 288#define ANOMALY_05000311 (0)
285#define ANOMALY_05000353 (1) 289#define ANOMALY_05000353 (1)
286#define ANOMALY_05000380 (0) 290#define ANOMALY_05000380 (0)
287#define ANOMALY_05000386 (1) 291#define ANOMALY_05000386 (1)
292#define ANOMALY_05000389 (0)
293#define ANOMALY_05000400 (0)
294#define ANOMALY_05000430 (0)
288#define ANOMALY_05000432 (0) 295#define ANOMALY_05000432 (0)
289#define ANOMALY_05000435 (0) 296#define ANOMALY_05000435 (0)
290#define ANOMALY_05000447 (0) 297#define ANOMALY_05000447 (0)
291#define ANOMALY_05000448 (0) 298#define ANOMALY_05000448 (0)
299#define ANOMALY_05000456 (0)
300#define ANOMALY_05000450 (0)
292 301
293#endif 302#endif
diff --git a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
index 95d609f11c97..9d9858c2be68 100644
--- a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
+++ b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
@@ -1526,6 +1526,35 @@
1526#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA1_D0_START_ADDR() 1526#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA1_D0_START_ADDR()
1527#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val) 1527#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val)
1528 1528
1529#define bfin_read_MDMA_S1_CONFIG() bfin_read_MDMA1_S1_CONFIG()
1530#define bfin_write_MDMA_S1_CONFIG(val) bfin_write_MDMA1_S1_CONFIG(val)
1531#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read_MDMA1_S1_IRQ_STATUS()
1532#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write_MDMA1_S1_IRQ_STATUS(val)
1533#define bfin_read_MDMA_S1_X_MODIFY() bfin_read_MDMA1_S1_X_MODIFY()
1534#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write_MDMA1_S1_X_MODIFY(val)
1535#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read_MDMA1_S1_Y_MODIFY()
1536#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write_MDMA1_S1_Y_MODIFY(val)
1537#define bfin_read_MDMA_S1_X_COUNT() bfin_read_MDMA1_S1_X_COUNT()
1538#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write_MDMA1_S1_X_COUNT(val)
1539#define bfin_read_MDMA_S1_Y_COUNT() bfin_read_MDMA1_S1_Y_COUNT()
1540#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write_MDMA1_S1_Y_COUNT(val)
1541#define bfin_read_MDMA_S1_START_ADDR() bfin_read_MDMA1_S1_START_ADDR()
1542#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write_MDMA1_S1_START_ADDR(val)
1543#define bfin_read_MDMA_D1_CONFIG() bfin_read_MDMA1_D1_CONFIG()
1544#define bfin_write_MDMA_D1_CONFIG(val) bfin_write_MDMA1_D1_CONFIG(val)
1545#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read_MDMA1_D1_IRQ_STATUS()
1546#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write_MDMA1_D1_IRQ_STATUS(val)
1547#define bfin_read_MDMA_D1_X_MODIFY() bfin_read_MDMA1_D1_X_MODIFY()
1548#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write_MDMA1_D1_X_MODIFY(val)
1549#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read_MDMA1_D1_Y_MODIFY()
1550#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write_MDMA1_D1_Y_MODIFY(val)
1551#define bfin_read_MDMA_D1_X_COUNT() bfin_read_MDMA1_D1_X_COUNT()
1552#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write_MDMA1_D1_X_COUNT(val)
1553#define bfin_read_MDMA_D1_Y_COUNT() bfin_read_MDMA1_D1_Y_COUNT()
1554#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write_MDMA1_D1_Y_COUNT(val)
1555#define bfin_read_MDMA_D1_START_ADDR() bfin_read_MDMA1_D1_START_ADDR()
1556#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write_MDMA1_D1_START_ADDR(val)
1557
1529/* These need to be last due to the cdef/linux inter-dependencies */ 1558/* These need to be last due to the cdef/linux inter-dependencies */
1530#include <asm/irq.h> 1559#include <asm/irq.h>
1531 1560
diff --git a/arch/blackfin/mach-bf561/include/mach/defBF561.h b/arch/blackfin/mach-bf561/include/mach/defBF561.h
index cf922295f4ce..5fc0f05026e0 100644
--- a/arch/blackfin/mach-bf561/include/mach/defBF561.h
+++ b/arch/blackfin/mach-bf561/include/mach/defBF561.h
@@ -796,6 +796,62 @@
796#define MDMA2_S1_IRQ_STATUS 0xFFC00FE8 /*MemDMA2 Stream 1 Source Interrupt/Status Register */ 796#define MDMA2_S1_IRQ_STATUS 0xFFC00FE8 /*MemDMA2 Stream 1 Source Interrupt/Status Register */
797#define MDMA2_S1_PERIPHERAL_MAP 0xFFC00FEC /*MemDMA2 Stream 1 Source Peripheral Map register */ 797#define MDMA2_S1_PERIPHERAL_MAP 0xFFC00FEC /*MemDMA2 Stream 1 Source Peripheral Map register */
798 798
799#define MDMA_D0_NEXT_DESC_PTR MDMA1_D0_NEXT_DESC_PTR
800#define MDMA_D0_START_ADDR MDMA1_D0_START_ADDR
801#define MDMA_D0_CONFIG MDMA1_D0_CONFIG
802#define MDMA_D0_X_COUNT MDMA1_D0_X_COUNT
803#define MDMA_D0_X_MODIFY MDMA1_D0_X_MODIFY
804#define MDMA_D0_Y_COUNT MDMA1_D0_Y_COUNT
805#define MDMA_D0_Y_MODIFY MDMA1_D0_Y_MODIFY
806#define MDMA_D0_CURR_DESC_PTR MDMA1_D0_CURR_DESC_PTR
807#define MDMA_D0_CURR_ADDR MDMA1_D0_CURR_ADDR
808#define MDMA_D0_IRQ_STATUS MDMA1_D0_IRQ_STATUS
809#define MDMA_D0_PERIPHERAL_MAP MDMA1_D0_PERIPHERAL_MAP
810#define MDMA_D0_CURR_X_COUNT MDMA1_D0_CURR_X_COUNT
811#define MDMA_D0_CURR_Y_COUNT MDMA1_D0_CURR_Y_COUNT
812
813#define MDMA_S0_NEXT_DESC_PTR MDMA1_S0_NEXT_DESC_PTR
814#define MDMA_S0_START_ADDR MDMA1_S0_START_ADDR
815#define MDMA_S0_CONFIG MDMA1_S0_CONFIG
816#define MDMA_S0_X_COUNT MDMA1_S0_X_COUNT
817#define MDMA_S0_X_MODIFY MDMA1_S0_X_MODIFY
818#define MDMA_S0_Y_COUNT MDMA1_S0_Y_COUNT
819#define MDMA_S0_Y_MODIFY MDMA1_S0_Y_MODIFY
820#define MDMA_S0_CURR_DESC_PTR MDMA1_S0_CURR_DESC_PTR
821#define MDMA_S0_CURR_ADDR MDMA1_S0_CURR_ADDR
822#define MDMA_S0_IRQ_STATUS MDMA1_S0_IRQ_STATUS
823#define MDMA_S0_PERIPHERAL_MAP MDMA1_S0_PERIPHERAL_MAP
824#define MDMA_S0_CURR_X_COUNT MDMA1_S0_CURR_X_COUNT
825#define MDMA_S0_CURR_Y_COUNT MDMA1_S0_CURR_Y_COUNT
826
827#define MDMA_D1_NEXT_DESC_PTR MDMA1_D1_NEXT_DESC_PTR
828#define MDMA_D1_START_ADDR MDMA1_D1_START_ADDR
829#define MDMA_D1_CONFIG MDMA1_D1_CONFIG
830#define MDMA_D1_X_COUNT MDMA1_D1_X_COUNT
831#define MDMA_D1_X_MODIFY MDMA1_D1_X_MODIFY
832#define MDMA_D1_Y_COUNT MDMA1_D1_Y_COUNT
833#define MDMA_D1_Y_MODIFY MDMA1_D1_Y_MODIFY
834#define MDMA_D1_CURR_DESC_PTR MDMA1_D1_CURR_DESC_PTR
835#define MDMA_D1_CURR_ADDR MDMA1_D1_CURR_ADDR
836#define MDMA_D1_IRQ_STATUS MDMA1_D1_IRQ_STATUS
837#define MDMA_D1_PERIPHERAL_MAP MDMA1_D1_PERIPHERAL_MAP
838#define MDMA_D1_CURR_X_COUNT MDMA1_D1_CURR_X_COUNT
839#define MDMA_D1_CURR_Y_COUNT MDMA1_D1_CURR_Y_COUNT
840
841#define MDMA_S1_NEXT_DESC_PTR MDMA1_S1_NEXT_DESC_PTR
842#define MDMA_S1_START_ADDR MDMA1_S1_START_ADDR
843#define MDMA_S1_CONFIG MDMA1_S1_CONFIG
844#define MDMA_S1_X_COUNT MDMA1_S1_X_COUNT
845#define MDMA_S1_X_MODIFY MDMA1_S1_X_MODIFY
846#define MDMA_S1_Y_COUNT MDMA1_S1_Y_COUNT
847#define MDMA_S1_Y_MODIFY MDMA1_S1_Y_MODIFY
848#define MDMA_S1_CURR_DESC_PTR MDMA1_S1_CURR_DESC_PTR
849#define MDMA_S1_CURR_ADDR MDMA1_S1_CURR_ADDR
850#define MDMA_S1_IRQ_STATUS MDMA1_S1_IRQ_STATUS
851#define MDMA_S1_PERIPHERAL_MAP MDMA1_S1_PERIPHERAL_MAP
852#define MDMA_S1_CURR_X_COUNT MDMA1_S1_CURR_X_COUNT
853#define MDMA_S1_CURR_Y_COUNT MDMA1_S1_CURR_Y_COUNT
854
799/* Internal Memory DMA Registers (0xFFC0_1800 - 0xFFC0_19FF) */ 855/* Internal Memory DMA Registers (0xFFC0_1800 - 0xFFC0_19FF) */
800#define IMDMA_D0_CONFIG 0xFFC01808 /*IMDMA Stream 0 Destination Configuration */ 856#define IMDMA_D0_CONFIG 0xFFC01808 /*IMDMA Stream 0 Destination Configuration */
801#define IMDMA_D0_NEXT_DESC_PTR 0xFFC01800 /*IMDMA Stream 0 Destination Next Descriptor Ptr Reg */ 857#define IMDMA_D0_NEXT_DESC_PTR 0xFFC01800 /*IMDMA Stream 0 Destination Next Descriptor Ptr Reg */
diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
index 9b27e698c0b2..8c10701c251f 100644
--- a/arch/blackfin/mach-bf561/smp.c
+++ b/arch/blackfin/mach-bf561/smp.c
@@ -133,9 +133,9 @@ void __init platform_request_ipi(irq_handler_t handler)
133 int ret; 133 int ret;
134 134
135 ret = request_irq(IRQ_SUPPLE_0, handler, IRQF_DISABLED, 135 ret = request_irq(IRQ_SUPPLE_0, handler, IRQF_DISABLED,
136 "SMP interrupt", handler); 136 "Supplemental Interrupt0", handler);
137 if (ret) 137 if (ret)
138 panic("Cannot request supplemental interrupt 0 for IPI service\n"); 138 panic("Cannot request supplemental interrupt 0 for IPI service");
139} 139}
140 140
141void platform_send_ipi(cpumask_t callmap) 141void platform_send_ipi(cpumask_t callmap)
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c
index 80d39b2f9db2..da93d9207165 100644
--- a/arch/blackfin/mach-common/arch_checks.c
+++ b/arch/blackfin/mach-common/arch_checks.c
@@ -71,3 +71,10 @@
71#if ANOMALY_05000448 71#if ANOMALY_05000448
72# error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes. 72# error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes.
73#endif 73#endif
74
75/* if 220 exists, can not set External Memory WB and L2 not_cached, either External Memory not_cached and L2 WB */
76#if ANOMALY_05000220 && \
77 ((defined(CONFIG_BFIN_WB) && defined(CONFIG_BFIN_L2_NOT_CACHED)) || \
78 (!defined(CONFIG_BFIN_DCACHE) && defined(CONFIG_BFIN_L2_WB)))
79# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB.
80#endif
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S
index aa0648c6a9fe..d9666fe6c3d6 100644
--- a/arch/blackfin/mach-common/cache.S
+++ b/arch/blackfin/mach-common/cache.S
@@ -15,6 +15,13 @@
15 15
16.text 16.text
17 17
18/* 05000443 - IFLUSH cannot be last instruction in hardware loop */
19#if ANOMALY_05000443
20# define BROK_FLUSH_INST "IFLUSH"
21#else
22# define BROK_FLUSH_INST "no anomaly! yeah!"
23#endif
24
18/* Since all L1 caches work the same way, we use the same method for flushing 25/* Since all L1 caches work the same way, we use the same method for flushing
19 * them. Only the actual flush instruction differs. We write this in asm as 26 * them. Only the actual flush instruction differs. We write this in asm as
20 * GCC can be hard to coax into writing nice hardware loops. 27 * GCC can be hard to coax into writing nice hardware loops.
@@ -23,7 +30,7 @@
23 * R0 = start address 30 * R0 = start address
24 * R1 = end address 31 * R1 = end address
25 */ 32 */
26.macro do_flush flushins:req optflushins optnopins label 33.macro do_flush flushins:req label
27 34
28 R2 = -L1_CACHE_BYTES; 35 R2 = -L1_CACHE_BYTES;
29 36
@@ -44,22 +51,15 @@
44\label : 51\label :
45.endif 52.endif
46 P0 = R0; 53 P0 = R0;
54
47 LSETUP (1f, 2f) LC1 = P1; 55 LSETUP (1f, 2f) LC1 = P1;
481: 561:
49.ifnb \optflushins 57.ifeqs "\flushins", BROK_FLUSH_INST
50 \optflushins [P0];
51.endif
52#if ANOMALY_05000443
53.ifb \optnopins
542:
55.endif
56 \flushins [P0++]; 58 \flushins [P0++];
57.ifnb \optnopins 592: nop;
582: \optnopins; 60.else
59.endif
60#else
612: \flushins [P0++]; 612: \flushins [P0++];
62#endif 62.endif
63 63
64 RTS; 64 RTS;
65.endm 65.endm
@@ -77,25 +77,9 @@ ENTRY(_blackfin_icache_flush_range)
77 */ 77 */
78 P0 = R0; 78 P0 = R0;
79 IFLUSH[P0]; 79 IFLUSH[P0];
80 do_flush IFLUSH, , nop 80 do_flush IFLUSH
81ENDPROC(_blackfin_icache_flush_range) 81ENDPROC(_blackfin_icache_flush_range)
82 82
83/* Flush all cache lines assocoiated with this area of memory. */
84ENTRY(_blackfin_icache_dcache_flush_range)
85/*
86 * Walkaround to avoid loading wrong instruction after invalidating icache
87 * and following sequence is met.
88 *
89 * 1) One instruction address is cached in the instruction cache.
90 * 2) This instruction in SDRAM is changed.
91 * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range().
92 * 4) This instruction is executed again, but the old one is loaded.
93 */
94 P0 = R0;
95 IFLUSH[P0];
96 do_flush FLUSH, IFLUSH
97ENDPROC(_blackfin_icache_dcache_flush_range)
98
99/* Throw away all D-cached data in specified region without any obligation to 83/* Throw away all D-cached data in specified region without any obligation to
100 * write them back. Since the Blackfin ISA does not have an "invalidate" 84 * write them back. Since the Blackfin ISA does not have an "invalidate"
101 * instruction, we use flush/invalidate. Perhaps as a speed optimization we 85 * instruction, we use flush/invalidate. Perhaps as a speed optimization we
@@ -107,7 +91,7 @@ ENDPROC(_blackfin_dcache_invalidate_range)
107 91
108/* Flush all data cache lines assocoiated with this memory area */ 92/* Flush all data cache lines assocoiated with this memory area */
109ENTRY(_blackfin_dcache_flush_range) 93ENTRY(_blackfin_dcache_flush_range)
110 do_flush FLUSH, , , .Ldfr 94 do_flush FLUSH, .Ldfr
111ENDPROC(_blackfin_dcache_flush_range) 95ENDPROC(_blackfin_dcache_flush_range)
112 96
113/* Our headers convert the page structure to an address, so just need to flush 97/* Our headers convert the page structure to an address, so just need to flush
diff --git a/arch/blackfin/mach-common/clocks-init.c b/arch/blackfin/mach-common/clocks-init.c
index 35393651359b..ef6870e9eea6 100644
--- a/arch/blackfin/mach-common/clocks-init.c
+++ b/arch/blackfin/mach-common/clocks-init.c
@@ -72,6 +72,7 @@ void init_clocks(void)
72#endif 72#endif
73 bfin_write_PLL_LOCKCNT(0x300); 73 bfin_write_PLL_LOCKCNT(0x300);
74 do_sync(); 74 do_sync();
75 /* We always write PLL_CTL thus avoiding Anomaly 05000242 */
75 bfin_write16(PLL_CTL, PLL_CTL_VAL); 76 bfin_write16(PLL_CTL, PLL_CTL_VAL);
76 __asm__ __volatile__("IDLE;"); 77 __asm__ __volatile__("IDLE;");
77 bfin_write_PLL_DIV(CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV); 78 bfin_write_PLL_DIV(CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c
index 72e16605ca09..70e3411f558c 100644
--- a/arch/blackfin/mach-common/cpufreq.c
+++ b/arch/blackfin/mach-common/cpufreq.c
@@ -140,7 +140,8 @@ static int __init __bfin_cpu_init(struct cpufreq_policy *policy)
140 cclk = get_cclk() / 1000; 140 cclk = get_cclk() / 1000;
141 sclk = get_sclk() / 1000; 141 sclk = get_sclk() / 1000;
142 142
143#if ANOMALY_05000273 || (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE)) 143#if ANOMALY_05000273 || ANOMALY_05000274 || \
144 (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE))
144 min_cclk = sclk * 2; 145 min_cclk = sclk * 2;
145#else 146#else
146 min_cclk = sclk; 147 min_cclk = sclk;
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index a063a434f7e3..da0558ad1b1a 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -36,7 +36,6 @@
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/linkage.h> 37#include <linux/linkage.h>
38#include <linux/unistd.h> 38#include <linux/unistd.h>
39#include <linux/threads.h>
40#include <asm/blackfin.h> 39#include <asm/blackfin.h>
41#include <asm/errno.h> 40#include <asm/errno.h>
42#include <asm/fixed_code.h> 41#include <asm/fixed_code.h>
@@ -201,7 +200,18 @@ ENTRY(_ex_single_step)
201 cc = r7 == 0; 200 cc = r7 == 0;
202 if !cc jump 1f; 201 if !cc jump 1f;
203#endif 202#endif
204 203#ifdef CONFIG_EXACT_HWERR
204 /* Read the ILAT, and to check to see if the process we are
205 * single stepping caused a previous hardware error
206 * If so, do not single step, (which lowers to IRQ5, and makes
207 * us miss the error).
208 */
209 p5.l = lo(ILAT);
210 p5.h = hi(ILAT);
211 r7 = [p5];
212 cc = bittst(r7, EVT_IVHW_P);
213 if cc jump 1f;
214#endif
205 /* Single stepping only a single instruction, so clear the trace 215 /* Single stepping only a single instruction, so clear the trace
206 * bit here. */ 216 * bit here. */
207 r7 = syscfg; 217 r7 = syscfg;
@@ -263,15 +273,6 @@ ENTRY(_bfin_return_from_exception)
263 r6 = 0x25; 273 r6 = 0x25;
264 CC = R7 == R6; 274 CC = R7 == R6;
265 if CC JUMP _double_fault; 275 if CC JUMP _double_fault;
266
267 /* Did we cause a HW error? */
268 p5.l = lo(ILAT);
269 p5.h = hi(ILAT);
270 r6 = [p5];
271 r7 = 0x20; /* Did I just cause anther HW error? */
272 r6 = r7 & r6;
273 CC = R7 == R6;
274 if CC JUMP _double_fault;
275#endif 276#endif
276 277
277 (R7:6,P5:4) = [sp++]; 278 (R7:6,P5:4) = [sp++];
@@ -473,6 +474,16 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
473 [--sp] = ASTAT; 474 [--sp] = ASTAT;
474 [--sp] = (R7:6,P5:4); 475 [--sp] = (R7:6,P5:4);
475 476
477#ifdef CONFIG_EXACT_HWERR
478 /* Make sure all pending read/writes complete. This will ensure any
479 * accesses which could cause hardware errors completes, and signal
480 * the the hardware before we do something silly, like crash the
481 * kernel. We don't need to work around anomaly 05000312, since
482 * we are already atomic
483 */
484 ssync;
485#endif
486
476#if ANOMALY_05000283 || ANOMALY_05000315 487#if ANOMALY_05000283 || ANOMALY_05000315
477 cc = r7 == r7; 488 cc = r7 == r7;
478 p5.h = HI(CHIPID); 489 p5.h = HI(CHIPID);
@@ -855,7 +866,7 @@ ENTRY(_ret_from_exception)
855 p1.h = _schedule_and_signal; 866 p1.h = _schedule_and_signal;
856 [p0] = p1; 867 [p0] = p1;
857 csync; 868 csync;
858 raise 15; /* raise evt14 to do signal or reschedule */ 869 raise 15; /* raise evt15 to do signal or reschedule */
8594: 8704:
860 r0 = syscfg; 871 r0 = syscfg;
861 bitclr(r0, 0); 872 bitclr(r0, 0);
@@ -916,7 +927,7 @@ ENTRY(_return_from_int)
916 p1.h = _schedule_and_signal_from_int; 927 p1.h = _schedule_and_signal_from_int;
917 [p0] = p1; 928 [p0] = p1;
918 csync; 929 csync;
919#if ANOMALY_05000281 930#if ANOMALY_05000281 || ANOMALY_05000461
920 r0.l = lo(SAFE_USER_INSTRUCTION); 931 r0.l = lo(SAFE_USER_INSTRUCTION);
921 r0.h = hi(SAFE_USER_INSTRUCTION); 932 r0.h = hi(SAFE_USER_INSTRUCTION);
922 reti = r0; 933 reti = r0;
@@ -930,18 +941,27 @@ ENTRY(_return_from_int)
930ENDPROC(_return_from_int) 941ENDPROC(_return_from_int)
931 942
932ENTRY(_lower_to_irq14) 943ENTRY(_lower_to_irq14)
933#if ANOMALY_05000281 944#if ANOMALY_05000281 || ANOMALY_05000461
934 r0.l = lo(SAFE_USER_INSTRUCTION); 945 r0.l = lo(SAFE_USER_INSTRUCTION);
935 r0.h = hi(SAFE_USER_INSTRUCTION); 946 r0.h = hi(SAFE_USER_INSTRUCTION);
936 reti = r0; 947 reti = r0;
937#endif 948#endif
938 r0 = 0x401f; 949
950#ifdef CONFIG_DEBUG_HWERR
951 /* enable irq14 & hwerr interrupt, until we transition to _evt14_softirq */
952 r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
953#else
954 /* Only enable irq14 interrupt, until we transition to _evt14_softirq */
955 r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
956#endif
939 sti r0; 957 sti r0;
940 raise 14; 958 raise 14;
941 rti; 959 rti;
960ENDPROC(_lower_to_irq14)
961
942ENTRY(_evt14_softirq) 962ENTRY(_evt14_softirq)
943#ifdef CONFIG_DEBUG_HWERR 963#ifdef CONFIG_DEBUG_HWERR
944 r0 = 0x3f; 964 r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
945 sti r0; 965 sti r0;
946#else 966#else
947 cli r0; 967 cli r0;
@@ -949,8 +969,9 @@ ENTRY(_evt14_softirq)
949 [--sp] = RETI; 969 [--sp] = RETI;
950 SP += 4; 970 SP += 4;
951 rts; 971 rts;
972ENDPROC(_evt14_softirq)
952 973
953_schedule_and_signal_from_int: 974ENTRY(_schedule_and_signal_from_int)
954 /* To end up here, vector 15 was changed - so we have to change it 975 /* To end up here, vector 15 was changed - so we have to change it
955 * back. 976 * back.
956 */ 977 */
@@ -983,8 +1004,9 @@ _schedule_and_signal_from_int:
983 call _finish_atomic_sections; 1004 call _finish_atomic_sections;
984 sp += 12; 1005 sp += 12;
985 jump.s .Lresume_userspace; 1006 jump.s .Lresume_userspace;
1007ENDPROC(_schedule_and_signal_from_int)
986 1008
987_schedule_and_signal: 1009ENTRY(_schedule_and_signal)
988 SAVE_CONTEXT_SYSCALL 1010 SAVE_CONTEXT_SYSCALL
989 /* To end up here, vector 15 was changed - so we have to change it 1011 /* To end up here, vector 15 was changed - so we have to change it
990 * back. 1012 * back.
@@ -1002,7 +1024,7 @@ _schedule_and_signal:
10021: 10241:
1003 RESTORE_CONTEXT 1025 RESTORE_CONTEXT
1004 rti; 1026 rti;
1005ENDPROC(_lower_to_irq14) 1027ENDPROC(_schedule_and_signal)
1006 1028
1007/* We handle this 100% in exception space - to reduce overhead 1029/* We handle this 100% in exception space - to reduce overhead
1008 * Only potiential problem is if the software buffer gets swapped out of the 1030 * Only potiential problem is if the software buffer gets swapped out of the
@@ -1588,19 +1610,3 @@ ENTRY(_sys_call_table)
1588 .long _sys_ni_syscall 1610 .long _sys_ni_syscall
1589 .endr 1611 .endr
1590END(_sys_call_table) 1612END(_sys_call_table)
1591
1592#ifdef CONFIG_EXCEPTION_L1_SCRATCH
1593/* .section .l1.bss.scratch */
1594.set _exception_stack_top, L1_SCRATCH_START + L1_SCRATCH_LENGTH
1595#else
1596#ifdef CONFIG_SYSCALL_TAB_L1
1597.section .l1.bss
1598#else
1599.bss
1600#endif
1601ENTRY(_exception_stack)
1602 .rept 1024 * NR_CPUS
1603 .long 0
1604 .endr
1605_exception_stack_top:
1606#endif
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S
index 698d4c05947e..f826f6b9f917 100644
--- a/arch/blackfin/mach-common/head.S
+++ b/arch/blackfin/mach-common/head.S
@@ -30,8 +30,6 @@ ENTRY(__init_clear_bss)
30 rts; 30 rts;
31ENDPROC(__init_clear_bss) 31ENDPROC(__init_clear_bss)
32 32
33#define INITIAL_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
34
35ENTRY(__start) 33ENTRY(__start)
36 /* R0: argument of command line string, passed from uboot, save it */ 34 /* R0: argument of command line string, passed from uboot, save it */
37 R7 = R0; 35 R7 = R0;
@@ -126,30 +124,30 @@ ENTRY(__start)
126 * below 124 * below
127 */ 125 */
128 GET_PDA(p0, r0); 126 GET_PDA(p0, r0);
129 r7 = [p0 + PDA_RETX]; 127 r6 = [p0 + PDA_RETX];
130 p1.l = _init_saved_retx; 128 p1.l = _init_saved_retx;
131 p1.h = _init_saved_retx; 129 p1.h = _init_saved_retx;
132 [p1] = r7; 130 [p1] = r6;
133 131
134 r7 = [p0 + PDA_DCPLB]; 132 r6 = [p0 + PDA_DCPLB];
135 p1.l = _init_saved_dcplb_fault_addr; 133 p1.l = _init_saved_dcplb_fault_addr;
136 p1.h = _init_saved_dcplb_fault_addr; 134 p1.h = _init_saved_dcplb_fault_addr;
137 [p1] = r7; 135 [p1] = r6;
138 136
139 r7 = [p0 + PDA_ICPLB]; 137 r6 = [p0 + PDA_ICPLB];
140 p1.l = _init_saved_icplb_fault_addr; 138 p1.l = _init_saved_icplb_fault_addr;
141 p1.h = _init_saved_icplb_fault_addr; 139 p1.h = _init_saved_icplb_fault_addr;
142 [p1] = r7; 140 [p1] = r6;
143 141
144 r7 = [p0 + PDA_SEQSTAT]; 142 r6 = [p0 + PDA_SEQSTAT];
145 p1.l = _init_saved_seqstat; 143 p1.l = _init_saved_seqstat;
146 p1.h = _init_saved_seqstat; 144 p1.h = _init_saved_seqstat;
147 [p1] = r7; 145 [p1] = r6;
148#endif 146#endif
149 147
150 /* Initialize stack pointer */ 148 /* Initialize stack pointer */
151 sp.l = lo(INITIAL_STACK); 149 sp.l = _init_thread_union;
152 sp.h = hi(INITIAL_STACK); 150 sp.h = _init_thread_union;
153 fp = sp; 151 fp = sp;
154 usp = sp; 152 usp = sp;
155 153
@@ -189,7 +187,15 @@ ENTRY(__start)
189 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 187 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
190 call _bfin_relocate_l1_mem; 188 call _bfin_relocate_l1_mem;
191#ifdef CONFIG_BFIN_KERNEL_CLOCK 189#ifdef CONFIG_BFIN_KERNEL_CLOCK
190 /* Only use on-chip scratch space for stack when absolutely required
191 * to avoid Anomaly 05000227 ... we know the init_clocks() func only
192 * uses L1 text and stack space and no other memory region.
193 */
194# define KERNEL_CLOCK_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
195 sp.l = lo(KERNEL_CLOCK_STACK);
196 sp.h = hi(KERNEL_CLOCK_STACK);
192 call _init_clocks; 197 call _init_clocks;
198 sp = usp; /* usp hasnt been touched, so restore from there */
193#endif 199#endif
194 200
195 /* This section keeps the processor in supervisor mode 201 /* This section keeps the processor in supervisor mode
@@ -243,9 +249,7 @@ ENTRY(_real_start)
243 call _cmdline_init; 249 call _cmdline_init;
244 250
245 /* Load the current thread pointer and stack */ 251 /* Load the current thread pointer and stack */
246 sp.l = _init_thread_union; 252 p1 = THREAD_SIZE + 4 (z); /* +4 is for reti loading */
247 sp.h = _init_thread_union;
248 p1 = THREAD_SIZE (z);
249 sp = sp + p1; 253 sp = sp + p1;
250 usp = sp; 254 usp = sp;
251 fp = sp; 255 fp = sp;
diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S
index 0069c2dd4625..9c46680186e4 100644
--- a/arch/blackfin/mach-common/interrupt.S
+++ b/arch/blackfin/mach-common/interrupt.S
@@ -145,6 +145,14 @@ __common_int_entry:
145 145
146/* interrupt routine for ivhw - 5 */ 146/* interrupt routine for ivhw - 5 */
147ENTRY(_evt_ivhw) 147ENTRY(_evt_ivhw)
148 /* In case a single action kicks off multiple memory transactions, (like
149 * a cache line fetch, - this can cause multiple hardware errors, let's
150 * catch them all. First - make sure all the actions are complete, and
151 * the core sees the hardware errors.
152 */
153 SSYNC;
154 SSYNC;
155
148 SAVE_ALL_SYS 156 SAVE_ALL_SYS
149#ifdef CONFIG_FRAME_POINTER 157#ifdef CONFIG_FRAME_POINTER
150 fp = 0; 158 fp = 0;
@@ -159,6 +167,25 @@ ENTRY(_evt_ivhw)
1591: 1671:
160#endif 168#endif
161 169
170 /* Handle all stacked hardware errors
171 * To make sure we don't hang forever, only do it 10 times
172 */
173 R0 = 0;
174 R2 = 10;
1751:
176 P0.L = LO(ILAT);
177 P0.H = HI(ILAT);
178 R1 = [P0];
179 CC = BITTST(R1, EVT_IVHW_P);
180 IF ! CC JUMP 2f;
181 /* OK a hardware error is pending - clear it */
182 R1 = EVT_IVHW_P;
183 [P0] = R1;
184 R0 += 1;
185 CC = R1 == R2;
186 if CC JUMP 2f;
187 JUMP 1b;
1882:
162 # We are going to dump something out, so make sure we print IPEND properly 189 # We are going to dump something out, so make sure we print IPEND properly
163 p2.l = lo(IPEND); 190 p2.l = lo(IPEND);
164 p2.h = hi(IPEND); 191 p2.h = hi(IPEND);
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index a7d7b2dd4059..351afd0e36d8 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -1052,7 +1052,7 @@ 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#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) 1055#if defined(CONFIG_TICKSOURCE_GPTMR0)
1056 case IRQ_TIMER0: 1056 case IRQ_TIMER0:
1057 set_irq_handler(irq, handle_percpu_irq); 1057 set_irq_handler(irq, handle_percpu_irq);
1058 break; 1058 break;
@@ -1116,6 +1116,9 @@ int __init init_arch_irq(void)
1116 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | 1116 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
1117 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; 1117 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
1118 1118
1119 /* This implicitly covers ANOMALY_05000171
1120 * Boot-ROM code modifies SICA_IWRx wakeup registers
1121 */
1119#ifdef SIC_IWR0 1122#ifdef SIC_IWR0
1120 bfin_write_SIC_IWR0(IWR_DISABLE_ALL); 1123 bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
1121# ifdef SIC_IWR1 1124# ifdef SIC_IWR1
@@ -1136,13 +1139,6 @@ int __init init_arch_irq(void)
1136 bfin_write_SIC_IWR(IWR_DISABLE_ALL); 1139 bfin_write_SIC_IWR(IWR_DISABLE_ALL);
1137#endif 1140#endif
1138 1141
1139#ifdef CONFIG_IPIPE
1140 for (irq = 0; irq < NR_IRQS; irq++) {
1141 struct irq_desc *desc = irq_to_desc(irq);
1142 desc->ic_prio = __ipipe_get_irq_priority(irq);
1143 }
1144#endif /* CONFIG_IPIPE */
1145
1146 return 0; 1142 return 0;
1147} 1143}
1148 1144
@@ -1156,23 +1152,22 @@ void do_irq(int vec, struct pt_regs *fp)
1156 } else { 1152 } else {
1157 struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; 1153 struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst;
1158 struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; 1154 struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop;
1159#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \ 1155#if defined(SIC_ISR0) || defined(SICA_ISR0)
1160 || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
1161 unsigned long sic_status[3]; 1156 unsigned long sic_status[3];
1162 1157
1163 if (smp_processor_id()) { 1158 if (smp_processor_id()) {
1164#ifdef CONFIG_SMP 1159# ifdef SICB_ISR0
1165 /* This will be optimized out in UP mode. */ 1160 /* This will be optimized out in UP mode. */
1166 sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0(); 1161 sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0();
1167 sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1(); 1162 sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1();
1168#endif 1163# endif
1169 } else { 1164 } else {
1170 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1165 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
1171 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1166 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
1172 } 1167 }
1173#ifdef CONFIG_BF54x 1168# ifdef SIC_ISR2
1174 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1169 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
1175#endif 1170# endif
1176 for (;; ivg++) { 1171 for (;; ivg++) {
1177 if (ivg >= ivg_stop) { 1172 if (ivg >= ivg_stop) {
1178 atomic_inc(&num_spurious); 1173 atomic_inc(&num_spurious);
@@ -1236,20 +1231,16 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)
1236 1231
1237 if (likely(vec == EVT_IVTMR_P)) { 1232 if (likely(vec == EVT_IVTMR_P)) {
1238 irq = IRQ_CORETMR; 1233 irq = IRQ_CORETMR;
1239 goto core_tick;
1240 }
1241 1234
1242 SSYNC(); 1235 } else {
1243 1236#if defined(SIC_ISR0) || defined(SICA_ISR0)
1244#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
1245 {
1246 unsigned long sic_status[3]; 1237 unsigned long sic_status[3];
1247 1238
1248 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1239 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
1249 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1240 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
1250#ifdef CONFIG_BF54x 1241# ifdef SIC_ISR2
1251 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1242 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
1252#endif 1243# endif
1253 for (;; ivg++) { 1244 for (;; ivg++) {
1254 if (ivg >= ivg_stop) { 1245 if (ivg >= ivg_stop) {
1255 atomic_inc(&num_spurious); 1246 atomic_inc(&num_spurious);
@@ -1258,9 +1249,7 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)
1258 if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag) 1249 if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag)
1259 break; 1250 break;
1260 } 1251 }
1261 }
1262#else 1252#else
1263 {
1264 unsigned long sic_status; 1253 unsigned long sic_status;
1265 1254
1266 sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR(); 1255 sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR();
@@ -1272,15 +1261,13 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)
1272 } else if (sic_status & ivg->isrflag) 1261 } else if (sic_status & ivg->isrflag)
1273 break; 1262 break;
1274 } 1263 }
1275 }
1276#endif 1264#endif
1277 1265
1278 irq = ivg->irqno; 1266 irq = ivg->irqno;
1267 }
1279 1268
1280 if (irq == IRQ_SYSTMR) { 1269 if (irq == IRQ_SYSTMR) {
1281#ifdef CONFIG_GENERIC_CLOCKEVENTS 1270#ifndef CONFIG_GENERIC_CLOCKEVENTS
1282core_tick:
1283#else
1284 bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */ 1271 bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */
1285#endif 1272#endif
1286 /* This is basically what we need from the register frame. */ 1273 /* This is basically what we need from the register frame. */
@@ -1292,9 +1279,6 @@ core_tick:
1292 __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10; 1279 __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10;
1293 } 1280 }
1294 1281
1295#ifndef CONFIG_GENERIC_CLOCKEVENTS
1296core_tick:
1297#endif
1298 if (this_domain == ipipe_root_domain) { 1282 if (this_domain == ipipe_root_domain) {
1299 s = __test_and_set_bit(IPIPE_SYNCDEFER_FLAG, &p->status); 1283 s = __test_and_set_bit(IPIPE_SYNCDEFER_FLAG, &p->status);
1300 barrier(); 1284 barrier();
@@ -1312,7 +1296,7 @@ core_tick:
1312 } 1296 }
1313 } 1297 }
1314 1298
1315 return 0; 1299 return 0;
1316} 1300}
1317 1301
1318#endif /* CONFIG_IPIPE */ 1302#endif /* CONFIG_IPIPE */
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 93eab6146079..3b8ebaee77f2 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -43,8 +43,13 @@
43#include <asm/processor.h> 43#include <asm/processor.h>
44#include <asm/ptrace.h> 44#include <asm/ptrace.h>
45#include <asm/cpu.h> 45#include <asm/cpu.h>
46#include <asm/time.h>
46#include <linux/err.h> 47#include <linux/err.h>
47 48
49/*
50 * Anomaly notes:
51 * 05000120 - we always define corelock as 32-bit integer in L2
52 */
48struct corelock_slot corelock __attribute__ ((__section__(".l2.bss"))); 53struct corelock_slot corelock __attribute__ ((__section__(".l2.bss")));
49 54
50void __cpuinitdata *init_retx_coreb, *init_saved_retx_coreb, 55void __cpuinitdata *init_retx_coreb, *init_saved_retx_coreb,
@@ -352,7 +357,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
352 357
353static void __cpuinit setup_secondary(unsigned int cpu) 358static void __cpuinit setup_secondary(unsigned int cpu)
354{ 359{
355#if !(defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)) 360#if !defined(CONFIG_TICKSOURCE_GPTMR0)
356 struct irq_desc *timer_desc; 361 struct irq_desc *timer_desc;
357#endif 362#endif
358 unsigned long ilat; 363 unsigned long ilat;
@@ -364,16 +369,13 @@ static void __cpuinit setup_secondary(unsigned int cpu)
364 bfin_write_ILAT(ilat); 369 bfin_write_ILAT(ilat);
365 CSYNC(); 370 CSYNC();
366 371
367 /* Reserve the PDA space for the secondary CPU. */
368 reserve_pda();
369
370 /* Enable interrupt levels IVG7-15. IARs have been already 372 /* Enable interrupt levels IVG7-15. IARs have been already
371 * programmed by the boot CPU. */ 373 * programmed by the boot CPU. */
372 bfin_irq_flags |= IMASK_IVG15 | 374 bfin_irq_flags |= IMASK_IVG15 |
373 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | 375 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
374 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; 376 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
375 377
376#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) 378#if defined(CONFIG_TICKSOURCE_GPTMR0)
377 /* Power down the core timer, just to play safe. */ 379 /* Power down the core timer, just to play safe. */
378 bfin_write_TCNTL(0); 380 bfin_write_TCNTL(0);
379 381
diff --git a/arch/blackfin/mm/blackfin_sram.h b/arch/blackfin/mm/blackfin_sram.h
index 8cb0945563f9..bc0062884fde 100644
--- a/arch/blackfin/mm/blackfin_sram.h
+++ b/arch/blackfin/mm/blackfin_sram.h
@@ -30,7 +30,6 @@
30#ifndef __BLACKFIN_SRAM_H__ 30#ifndef __BLACKFIN_SRAM_H__
31#define __BLACKFIN_SRAM_H__ 31#define __BLACKFIN_SRAM_H__
32 32
33extern void bfin_sram_init(void);
34extern void *l1sram_alloc(size_t); 33extern void *l1sram_alloc(size_t);
35 34
36#endif 35#endif
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 9c3629b9a689..014a55abd09a 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -52,9 +52,14 @@ static unsigned long empty_bad_page_table;
52 52
53static unsigned long empty_bad_page; 53static unsigned long empty_bad_page;
54 54
55unsigned long empty_zero_page; 55static unsigned long empty_zero_page;
56 56
57extern unsigned long exception_stack[NR_CPUS][1024]; 57#ifndef CONFIG_EXCEPTION_L1_SCRATCH
58#if defined CONFIG_SYSCALL_TAB_L1
59__attribute__((l1_data))
60#endif
61static unsigned long exception_stack[NR_CPUS][1024];
62#endif
58 63
59struct blackfin_pda cpu_pda[NR_CPUS]; 64struct blackfin_pda cpu_pda[NR_CPUS];
60EXPORT_SYMBOL(cpu_pda); 65EXPORT_SYMBOL(cpu_pda);
@@ -117,19 +122,18 @@ asmlinkage void __init init_pda(void)
117 cpu_pda[0].next = &cpu_pda[1]; 122 cpu_pda[0].next = &cpu_pda[1];
118 cpu_pda[1].next = &cpu_pda[0]; 123 cpu_pda[1].next = &cpu_pda[0];
119 124
125#ifdef CONFIG_EXCEPTION_L1_SCRATCH
126 cpu_pda[cpu].ex_stack = (unsigned long *)(L1_SCRATCH_START + \
127 L1_SCRATCH_LENGTH);
128#else
120 cpu_pda[cpu].ex_stack = exception_stack[cpu + 1]; 129 cpu_pda[cpu].ex_stack = exception_stack[cpu + 1];
130#endif
121 131
122#ifdef CONFIG_SMP 132#ifdef CONFIG_SMP
123 cpu_pda[cpu].imask = 0x1f; 133 cpu_pda[cpu].imask = 0x1f;
124#endif 134#endif
125} 135}
126 136
127void __cpuinit reserve_pda(void)
128{
129 printk(KERN_INFO "PDA for CPU%u reserved at %p\n", smp_processor_id(),
130 &cpu_pda[smp_processor_id()]);
131}
132
133void __init mem_init(void) 137void __init mem_init(void)
134{ 138{
135 unsigned int codek = 0, datak = 0, initk = 0; 139 unsigned int codek = 0, datak = 0, initk = 0;
@@ -171,19 +175,6 @@ void __init mem_init(void)
171 initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10))); 175 initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10)));
172} 176}
173 177
174static int __init sram_init(void)
175{
176 /* Initialize the blackfin L1 Memory. */
177 bfin_sram_init();
178
179 /* Reserve the PDA space for the boot CPU right after we
180 * initialized the scratch memory allocator.
181 */
182 reserve_pda();
183 return 0;
184}
185pure_initcall(sram_init);
186
187static void __init free_init_pages(const char *what, unsigned long begin, unsigned long end) 178static void __init free_init_pages(const char *what, unsigned long begin, unsigned long end)
188{ 179{
189 unsigned long addr; 180 unsigned long addr;
diff --git a/arch/blackfin/mm/isram-driver.c b/arch/blackfin/mm/isram-driver.c
index 22913e7a1818..c080e70f98b0 100644
--- a/arch/blackfin/mm/isram-driver.c
+++ b/arch/blackfin/mm/isram-driver.c
@@ -125,7 +125,7 @@ static bool isram_check_addr(const void *addr, size_t n)
125{ 125{
126 if ((addr >= (void *)L1_CODE_START) && 126 if ((addr >= (void *)L1_CODE_START) &&
127 (addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))) { 127 (addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))) {
128 if ((addr + n) >= (void *)(L1_CODE_START + L1_CODE_LENGTH)) { 128 if ((addr + n) > (void *)(L1_CODE_START + L1_CODE_LENGTH)) {
129 show_stack(NULL, NULL); 129 show_stack(NULL, NULL);
130 printk(KERN_ERR "isram_memcpy: copy involving %p length " 130 printk(KERN_ERR "isram_memcpy: copy involving %p length "
131 "(%zu) too long\n", addr, n); 131 "(%zu) too long\n", addr, n);
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index 530d1393a232..0bc3c4ef0aad 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -83,6 +83,14 @@ static struct kmem_cache *sram_piece_cache;
83static void __init l1sram_init(void) 83static void __init l1sram_init(void)
84{ 84{
85 unsigned int cpu; 85 unsigned int cpu;
86 unsigned long reserve;
87
88#ifdef CONFIG_SMP
89 reserve = 0;
90#else
91 reserve = sizeof(struct l1_scratch_task_info);
92#endif
93
86 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) { 94 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) {
87 per_cpu(free_l1_ssram_head, cpu).next = 95 per_cpu(free_l1_ssram_head, cpu).next =
88 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 96 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
@@ -91,8 +99,8 @@ static void __init l1sram_init(void)
91 return; 99 return;
92 } 100 }
93 101
94 per_cpu(free_l1_ssram_head, cpu).next->paddr = (void *)get_l1_scratch_start_cpu(cpu); 102 per_cpu(free_l1_ssram_head, cpu).next->paddr = (void *)get_l1_scratch_start_cpu(cpu) + reserve;
95 per_cpu(free_l1_ssram_head, cpu).next->size = L1_SCRATCH_LENGTH; 103 per_cpu(free_l1_ssram_head, cpu).next->size = L1_SCRATCH_LENGTH - reserve;
96 per_cpu(free_l1_ssram_head, cpu).next->pid = 0; 104 per_cpu(free_l1_ssram_head, cpu).next->pid = 0;
97 per_cpu(free_l1_ssram_head, cpu).next->next = NULL; 105 per_cpu(free_l1_ssram_head, cpu).next->next = NULL;
98 106
@@ -223,7 +231,7 @@ static void __init l2_sram_init(void)
223 spin_lock_init(&l2_sram_lock); 231 spin_lock_init(&l2_sram_lock);
224} 232}
225 233
226void __init bfin_sram_init(void) 234static int __init bfin_sram_init(void)
227{ 235{
228 sram_piece_cache = kmem_cache_create("sram_piece_cache", 236 sram_piece_cache = kmem_cache_create("sram_piece_cache",
229 sizeof(struct sram_piece), 237 sizeof(struct sram_piece),
@@ -233,7 +241,10 @@ void __init bfin_sram_init(void)
233 l1_data_sram_init(); 241 l1_data_sram_init();
234 l1_inst_sram_init(); 242 l1_inst_sram_init();
235 l2_sram_init(); 243 l2_sram_init();
244
245 return 0;
236} 246}
247pure_initcall(bfin_sram_init);
237 248
238/* SRAM allocate function */ 249/* SRAM allocate function */
239static void *_sram_alloc(size_t size, struct sram_piece *pfree_head, 250static void *_sram_alloc(size_t size, struct sram_piece *pfree_head,
@@ -732,6 +743,10 @@ found:
732} 743}
733EXPORT_SYMBOL(sram_free_with_lsl); 744EXPORT_SYMBOL(sram_free_with_lsl);
734 745
746/* Allocate memory and keep in L1 SRAM List (lsl) so that the resources are
747 * tracked. These are designed for userspace so that when a process exits,
748 * we can safely reap their resources.
749 */
735void *sram_alloc_with_lsl(size_t size, unsigned long flags) 750void *sram_alloc_with_lsl(size_t size, unsigned long flags)
736{ 751{
737 void *addr = NULL; 752 void *addr = NULL;
diff --git a/arch/cris/include/asm/atomic.h b/arch/cris/include/asm/atomic.h
index 5718dd8902a1..a6aca819e9f3 100644
--- a/arch/cris/include/asm/atomic.h
+++ b/arch/cris/include/asm/atomic.h
@@ -158,5 +158,5 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
158#define smp_mb__before_atomic_inc() barrier() 158#define smp_mb__before_atomic_inc() barrier()
159#define smp_mb__after_atomic_inc() barrier() 159#define smp_mb__after_atomic_inc() barrier()
160 160
161#include <asm-generic/atomic.h> 161#include <asm-generic/atomic-long.h>
162#endif 162#endif
diff --git a/arch/cris/include/asm/bitsperlong.h b/arch/cris/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/cris/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/asm/mman.h
index 1c35e1b66b46..b7f0afba3ce0 100644
--- a/arch/cris/include/asm/mman.h
+++ b/arch/cris/include/asm/mman.h
@@ -3,7 +3,7 @@
3 3
4/* verbatim copy of asm-i386/ version */ 4/* verbatim copy of asm-i386/ version */
5 5
6#include <asm-generic/mman.h> 6#include <asm-generic/mman-common.h>
7 7
8#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 8#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
9#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 9#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/cris/include/asm/page.h b/arch/cris/include/asm/page.h
index f3fdbd09c34c..be45ee366be9 100644
--- a/arch/cris/include/asm/page.h
+++ b/arch/cris/include/asm/page.h
@@ -68,7 +68,7 @@ typedef struct page *pgtable_t;
68 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 68 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
69 69
70#include <asm-generic/memory_model.h> 70#include <asm-generic/memory_model.h>
71#include <asm-generic/page.h> 71#include <asm-generic/getorder.h>
72 72
73#endif /* _CRIS_PAGE_H */ 73#endif /* _CRIS_PAGE_H */
74 74
diff --git a/arch/cris/include/asm/signal.h b/arch/cris/include/asm/signal.h
index 349ae682b568..ea6af9aad76c 100644
--- a/arch/cris/include/asm/signal.h
+++ b/arch/cris/include/asm/signal.h
@@ -106,7 +106,7 @@ typedef unsigned long sigset_t;
106#define MINSIGSTKSZ 2048 106#define MINSIGSTKSZ 2048
107#define SIGSTKSZ 8192 107#define SIGSTKSZ 8192
108 108
109#include <asm-generic/signal.h> 109#include <asm-generic/signal-defs.h>
110 110
111#ifdef __KERNEL__ 111#ifdef __KERNEL__
112struct old_sigaction { 112struct old_sigaction {
diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c
index a187833febc8..abc13e368b90 100644
--- a/arch/cris/kernel/module.c
+++ b/arch/cris/kernel/module.c
@@ -48,8 +48,6 @@ void *module_alloc(unsigned long size)
48void module_free(struct module *mod, void *module_region) 48void module_free(struct module *mod, void *module_region)
49{ 49{
50 FREE_MODULE(module_region); 50 FREE_MODULE(module_region);
51 /* FIXME: If module_region == mod->init_region, trim exception
52 table entries. */
53} 51}
54 52
55/* We don't need anything special. */ 53/* We don't need anything special. */
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h
index 296c35cfb207..0409d981fd39 100644
--- a/arch/frv/include/asm/atomic.h
+++ b/arch/frv/include/asm/atomic.h
@@ -194,5 +194,5 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
194 194
195#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 195#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
196 196
197#include <asm-generic/atomic.h> 197#include <asm-generic/atomic-long.h>
198#endif /* _ASM_ATOMIC_H */ 198#endif /* _ASM_ATOMIC_H */
diff --git a/arch/frv/include/asm/bitsperlong.h b/arch/frv/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/frv/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h
index b4371e928683..58c1d11e2ac7 100644
--- a/arch/frv/include/asm/mman.h
+++ b/arch/frv/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_MMAN_H__ 1#ifndef __ASM_MMAN_H__
2#define __ASM_MMAN_H__ 2#define __ASM_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/frv/include/asm/page.h b/arch/frv/include/asm/page.h
index bd9c220094c7..25c6a5002355 100644
--- a/arch/frv/include/asm/page.h
+++ b/arch/frv/include/asm/page.h
@@ -73,6 +73,6 @@ extern unsigned long max_pfn;
73#endif /* __ASSEMBLY__ */ 73#endif /* __ASSEMBLY__ */
74 74
75#include <asm-generic/memory_model.h> 75#include <asm-generic/memory_model.h>
76#include <asm-generic/page.h> 76#include <asm-generic/getorder.h>
77 77
78#endif /* _ASM_PAGE_H */ 78#endif /* _ASM_PAGE_H */
diff --git a/arch/frv/include/asm/pci.h b/arch/frv/include/asm/pci.h
index cc685e60b0f9..492b5c4dfed6 100644
--- a/arch/frv/include/asm/pci.h
+++ b/arch/frv/include/asm/pci.h
@@ -10,8 +10,8 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#ifndef ASM_PCI_H 13#ifndef _ASM_FRV_PCI_H
14#define ASM_PCI_H 14#define _ASM_FRV_PCI_H
15 15
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <asm/scatterlist.h> 17#include <asm/scatterlist.h>
@@ -43,12 +43,6 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
43/* Return the index of the PCI controller for device PDEV. */ 43/* Return the index of the PCI controller for device PDEV. */
44#define pci_controller_num(PDEV) (0) 44#define pci_controller_num(PDEV) (0)
45 45
46/* The PCI address space does equal the physical memory
47 * address space. The networking and block device layers use
48 * this boolean for bounce buffer decisions.
49 */
50#define PCI_DMA_BUS_IS_PHYS (1)
51
52/* pci_unmap_{page,single} is a nop so... */ 46/* pci_unmap_{page,single} is a nop so... */
53#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) 47#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
54#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) 48#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
@@ -111,5 +105,4 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
111 sg_dma_address(&sg[i])+sg_dma_len(&sg[i])); 105 sg_dma_address(&sg[i])+sg_dma_len(&sg[i]));
112} 106}
113 107
114 108#endif /* _ASM_FRV_PCI_H */
115#endif
diff --git a/arch/frv/include/asm/signal.h b/arch/frv/include/asm/signal.h
index 2079197d483d..f071e813dcb3 100644
--- a/arch/frv/include/asm/signal.h
+++ b/arch/frv/include/asm/signal.h
@@ -3,107 +3,15 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* Avoid too many header ordering problems. */ 6#ifndef __KERNEL__
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */
12
13#define _NSIG 64
14#define _NSIG_BPW 32
15#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
16
17typedef unsigned long old_sigset_t; /* at least 32 bits */
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */ 7/* Here we must cater to libcs that poke about in kernel headers. */
25 8
26#define NSIG 32 9#define NSIG 32
27typedef unsigned long sigset_t; 10typedef unsigned long sigset_t;
28 11
29#endif /* __KERNEL__ */ 12#endif /* !__KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX (_NSIG-1)
72
73/*
74 * SA_FLAGS values:
75 *
76 * SA_ONSTACK indicates that a registered stack_t will be used.
77 * SA_RESTART flag to get restarting signals (which were the default long ago)
78 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
79 * SA_RESETHAND clears the handler when the signal is delivered.
80 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
81 * SA_NODEFER prevents the current signal from being masked in the handler.
82 *
83 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
84 * Unix names RESETHAND and NODEFER respectively.
85 */
86#define SA_NOCLDSTOP 0x00000001
87#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
88#define SA_SIGINFO 0x00000004
89#define SA_ONSTACK 0x08000000
90#define SA_RESTART 0x10000000
91#define SA_NODEFER 0x40000000
92#define SA_RESETHAND 0x80000000
93
94#define SA_NOMASK SA_NODEFER
95#define SA_ONESHOT SA_RESETHAND
96
97#define SA_RESTORER 0x04000000
98
99/*
100 * sigaltstack controls
101 */
102#define SS_ONSTACK 1
103#define SS_DISABLE 2
104 13
105#define MINSIGSTKSZ 2048 14#define SA_RESTORER 0x04000000 /* to get struct sigaction correct */
106#define SIGSTKSZ 8192
107 15
108#include <asm-generic/signal.h> 16#include <asm-generic/signal.h>
109 17
@@ -115,16 +23,6 @@ struct old_sigaction {
115 __sigrestore_t sa_restorer; 23 __sigrestore_t sa_restorer;
116}; 24};
117 25
118struct sigaction {
119 __sighandler_t sa_handler;
120 unsigned long sa_flags;
121 __sigrestore_t sa_restorer;
122 sigset_t sa_mask; /* mask last for extensibility */
123};
124
125struct k_sigaction {
126 struct sigaction sa;
127};
128#else 26#else
129/* Here we must cater to libcs that poke about in kernel headers. */ 27/* Here we must cater to libcs that poke about in kernel headers. */
130 28
@@ -143,19 +41,4 @@ struct sigaction {
143 41
144#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
145 43
146typedef struct sigaltstack {
147 void __user *ss_sp;
148 int ss_flags;
149 size_t ss_size;
150} stack_t;
151
152#define ptrace_signal_deliver(regs, cookie) do { } while (0)
153
154#ifdef __KERNEL__
155
156#include <asm/sigcontext.h>
157#undef __HAVE_ARCH_SIG_BITOPS
158
159#endif /* __KERNEL__ */
160
161#endif /* _ASM_SIGNAL_H */ 44#endif /* _ASM_SIGNAL_H */
diff --git a/arch/frv/include/asm/termios.h b/arch/frv/include/asm/termios.h
index a62fb5872375..b4868aafe79c 100644
--- a/arch/frv/include/asm/termios.h
+++ b/arch/frv/include/asm/termios.h
@@ -52,7 +52,7 @@ struct termio {
52/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 52/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
53 53
54#ifdef __KERNEL__ 54#ifdef __KERNEL__
55#include <asm-generic/termios.h> 55#include <asm-generic/termios-base.h>
56#endif 56#endif
57 57
58#endif /* _ASM_TERMIOS_H */ 58#endif /* _ASM_TERMIOS_H */
diff --git a/arch/frv/kernel/module.c b/arch/frv/kernel/module.c
index 850d168f69fc..711763c8a6f3 100644
--- a/arch/frv/kernel/module.c
+++ b/arch/frv/kernel/module.c
@@ -35,8 +35,6 @@ void *module_alloc(unsigned long size)
35void module_free(struct module *mod, void *module_region) 35void module_free(struct module *mod, void *module_region)
36{ 36{
37 vfree(module_region); 37 vfree(module_region);
38 /* FIXME: If module_region == mod->init_region, trim exception
39 table entries. */
40} 38}
41 39
42/* We don't need anything special. */ 40/* We don't need anything special. */
diff --git a/arch/h8300/include/asm/atomic.h b/arch/h8300/include/asm/atomic.h
index 833186c8dc3b..33c8c0fa9583 100644
--- a/arch/h8300/include/asm/atomic.h
+++ b/arch/h8300/include/asm/atomic.h
@@ -141,5 +141,5 @@ static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v)
141#define smp_mb__before_atomic_inc() barrier() 141#define smp_mb__before_atomic_inc() barrier()
142#define smp_mb__after_atomic_inc() barrier() 142#define smp_mb__after_atomic_inc() barrier()
143 143
144#include <asm-generic/atomic.h> 144#include <asm-generic/atomic-long.h>
145#endif /* __ARCH_H8300_ATOMIC __ */ 145#endif /* __ARCH_H8300_ATOMIC __ */
diff --git a/arch/h8300/include/asm/bitsperlong.h b/arch/h8300/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/h8300/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/asm/mman.h
index b9f104f22a36..cf35f0a6f12e 100644
--- a/arch/h8300/include/asm/mman.h
+++ b/arch/h8300/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __H8300_MMAN_H__ 1#ifndef __H8300_MMAN_H__
2#define __H8300_MMAN_H__ 2#define __H8300_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/h8300/include/asm/page.h b/arch/h8300/include/asm/page.h
index 0b6acf0b03aa..837381a2df46 100644
--- a/arch/h8300/include/asm/page.h
+++ b/arch/h8300/include/asm/page.h
@@ -73,6 +73,6 @@ extern unsigned long memory_end;
73#endif /* __ASSEMBLY__ */ 73#endif /* __ASSEMBLY__ */
74 74
75#include <asm-generic/memory_model.h> 75#include <asm-generic/memory_model.h>
76#include <asm-generic/page.h> 76#include <asm-generic/getorder.h>
77 77
78#endif /* _H8300_PAGE_H */ 78#endif /* _H8300_PAGE_H */
diff --git a/arch/h8300/include/asm/signal.h b/arch/h8300/include/asm/signal.h
index 7bc15048a64f..fd8b66e40dca 100644
--- a/arch/h8300/include/asm/signal.h
+++ b/arch/h8300/include/asm/signal.h
@@ -105,7 +105,7 @@ typedef unsigned long sigset_t;
105#define MINSIGSTKSZ 2048 105#define MINSIGSTKSZ 2048
106#define SIGSTKSZ 8192 106#define SIGSTKSZ 8192
107 107
108#include <asm-generic/signal.h> 108#include <asm-generic/signal-defs.h>
109 109
110#ifdef __KERNEL__ 110#ifdef __KERNEL__
111struct old_sigaction { 111struct old_sigaction {
diff --git a/arch/h8300/kernel/module.c b/arch/h8300/kernel/module.c
index cfc9127d2ced..0865e291c20d 100644
--- a/arch/h8300/kernel/module.c
+++ b/arch/h8300/kernel/module.c
@@ -23,8 +23,6 @@ void *module_alloc(unsigned long size)
23void module_free(struct module *mod, void *module_region) 23void module_free(struct module *mod, void *module_region)
24{ 24{
25 vfree(module_region); 25 vfree(module_region);
26 /* FIXME: If module_region == mod->init_region, trim exception
27 table entries. */
28} 26}
29 27
30/* We don't need anything special. */ 28/* We don't need anything special. */
diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h
index d37292bd9875..88405cb0832a 100644
--- a/arch/ia64/include/asm/atomic.h
+++ b/arch/ia64/include/asm/atomic.h
@@ -216,5 +216,5 @@ atomic64_add_negative (__s64 i, atomic64_t *v)
216#define smp_mb__before_atomic_inc() barrier() 216#define smp_mb__before_atomic_inc() barrier()
217#define smp_mb__after_atomic_inc() barrier() 217#define smp_mb__after_atomic_inc() barrier()
218 218
219#include <asm-generic/atomic.h> 219#include <asm-generic/atomic-long.h>
220#endif /* _ASM_IA64_ATOMIC_H */ 220#endif /* _ASM_IA64_ATOMIC_H */
diff --git a/arch/ia64/include/asm/bitsperlong.h b/arch/ia64/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..ec4db3c970b7
--- /dev/null
+++ b/arch/ia64/include/asm/bitsperlong.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_IA64_BITSPERLONG_H
2#define __ASM_IA64_BITSPERLONG_H
3
4#define __BITS_PER_LONG 64
5
6#include <asm-generic/bitsperlong.h>
7
8#endif /* __ASM_IA64_BITSPERLONG_H */
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
index c73b87832a1e..48cf8b98a0b4 100644
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -8,7 +8,7 @@
8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co 8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
9 */ 9 */
10 10
11#include <asm-generic/mman.h> 11#include <asm-generic/mman-common.h>
12 12
13#define MAP_GROWSDOWN 0x00100 /* stack-like segment */ 13#define MAP_GROWSDOWN 0x00100 /* stack-like segment */
14#define MAP_GROWSUP 0x00200 /* register stack-like segment */ 14#define MAP_GROWSUP 0x00200 /* register stack-like segment */
diff --git a/arch/ia64/include/asm/signal.h b/arch/ia64/include/asm/signal.h
index 4f5ca5643cb1..b166248d49a4 100644
--- a/arch/ia64/include/asm/signal.h
+++ b/arch/ia64/include/asm/signal.h
@@ -114,7 +114,7 @@
114 114
115#endif /* __KERNEL__ */ 115#endif /* __KERNEL__ */
116 116
117#include <asm-generic/signal.h> 117#include <asm-generic/signal-defs.h>
118 118
119# ifndef __ASSEMBLY__ 119# ifndef __ASSEMBLY__
120 120
diff --git a/arch/ia64/include/asm/suspend.h b/arch/ia64/include/asm/suspend.h
deleted file mode 100644
index b05bbb6074e2..000000000000
--- a/arch/ia64/include/asm/suspend.h
+++ /dev/null
@@ -1 +0,0 @@
1/* dummy (must be non-empty to prevent prejudicial removal...) */
diff --git a/arch/ia64/include/asm/types.h b/arch/ia64/include/asm/types.h
index e36b3716e718..fbf1ed3b44ce 100644
--- a/arch/ia64/include/asm/types.h
+++ b/arch/ia64/include/asm/types.h
@@ -19,10 +19,6 @@
19# define __IA64_UL(x) (x) 19# define __IA64_UL(x) (x)
20# define __IA64_UL_CONST(x) x 20# define __IA64_UL_CONST(x) x
21 21
22# ifdef __KERNEL__
23# define BITS_PER_LONG 64
24# endif
25
26#else 22#else
27# define __IA64_UL(x) ((unsigned long)(x)) 23# define __IA64_UL(x) ((unsigned long)(x))
28# define __IA64_UL_CONST(x) x##UL 24# define __IA64_UL_CONST(x) x##UL
@@ -34,10 +30,7 @@ typedef unsigned int umode_t;
34 */ 30 */
35# ifdef __KERNEL__ 31# ifdef __KERNEL__
36 32
37#define BITS_PER_LONG 64
38
39/* DMA addresses are 64-bits wide, in general. */ 33/* DMA addresses are 64-bits wide, in general. */
40
41typedef u64 dma_addr_t; 34typedef u64 dma_addr_t;
42 35
43# endif /* __KERNEL__ */ 36# endif /* __KERNEL__ */
diff --git a/arch/ia64/mm/extable.c b/arch/ia64/mm/extable.c
index 71c50dd8f870..e95d5ad9285d 100644
--- a/arch/ia64/mm/extable.c
+++ b/arch/ia64/mm/extable.c
@@ -53,6 +53,32 @@ void sort_extable (struct exception_table_entry *start,
53 cmp_ex, swap_ex); 53 cmp_ex, swap_ex);
54} 54}
55 55
56static inline unsigned long ex_to_addr(const struct exception_table_entry *x)
57{
58 return (unsigned long)&x->insn + x->insn;
59}
60
61#ifdef CONFIG_MODULES
62/*
63 * Any entry referring to the module init will be at the beginning or
64 * the end.
65 */
66void trim_init_extable(struct module *m)
67{
68 /*trim the beginning*/
69 while (m->num_exentries &&
70 within_module_init(ex_to_addr(&m->extable[0]), m)) {
71 m->extable++;
72 m->num_exentries--;
73 }
74 /*trim the end*/
75 while (m->num_exentries &&
76 within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]),
77 m))
78 m->num_exentries--;
79}
80#endif /* CONFIG_MODULES */
81
56const struct exception_table_entry * 82const struct exception_table_entry *
57search_extable (const struct exception_table_entry *first, 83search_extable (const struct exception_table_entry *first,
58 const struct exception_table_entry *last, 84 const struct exception_table_entry *last,
diff --git a/arch/m32r/include/asm/atomic.h b/arch/m32r/include/asm/atomic.h
index 2eed30f84080..63f0cf0f50dd 100644
--- a/arch/m32r/include/asm/atomic.h
+++ b/arch/m32r/include/asm/atomic.h
@@ -314,5 +314,5 @@ static __inline__ void atomic_set_mask(unsigned long mask, atomic_t *addr)
314#define smp_mb__before_atomic_inc() barrier() 314#define smp_mb__before_atomic_inc() barrier()
315#define smp_mb__after_atomic_inc() barrier() 315#define smp_mb__after_atomic_inc() barrier()
316 316
317#include <asm-generic/atomic.h> 317#include <asm-generic/atomic-long.h>
318#endif /* _ASM_M32R_ATOMIC_H */ 318#endif /* _ASM_M32R_ATOMIC_H */
diff --git a/arch/m32r/include/asm/bitsperlong.h b/arch/m32r/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/m32r/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h
index 516a8973b130..04a5f40aa401 100644
--- a/arch/m32r/include/asm/mman.h
+++ b/arch/m32r/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __M32R_MMAN_H__ 1#ifndef __M32R_MMAN_H__
2#define __M32R_MMAN_H__ 2#define __M32R_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/m32r/include/asm/page.h b/arch/m32r/include/asm/page.h
index c9333089fe11..11777f7a5628 100644
--- a/arch/m32r/include/asm/page.h
+++ b/arch/m32r/include/asm/page.h
@@ -82,6 +82,6 @@ typedef struct page *pgtable_t;
82#define devmem_is_allowed(x) 1 82#define devmem_is_allowed(x) 1
83 83
84#include <asm-generic/memory_model.h> 84#include <asm-generic/memory_model.h>
85#include <asm-generic/page.h> 85#include <asm-generic/getorder.h>
86 86
87#endif /* _ASM_M32R_PAGE_H */ 87#endif /* _ASM_M32R_PAGE_H */
diff --git a/arch/m32r/include/asm/pci.h b/arch/m32r/include/asm/pci.h
index fe785d167db6..07d3834c6dec 100644
--- a/arch/m32r/include/asm/pci.h
+++ b/arch/m32r/include/asm/pci.h
@@ -3,6 +3,4 @@
3 3
4#include <asm-generic/pci.h> 4#include <asm-generic/pci.h>
5 5
6#define PCI_DMA_BUS_IS_PHYS (1)
7
8#endif /* _ASM_M32R_PCI_H */ 6#endif /* _ASM_M32R_PCI_H */
diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h
index 1a607066bc64..9c1acb2b1a92 100644
--- a/arch/m32r/include/asm/signal.h
+++ b/arch/m32r/include/asm/signal.h
@@ -107,7 +107,7 @@ typedef unsigned long sigset_t;
107#define MINSIGSTKSZ 2048 107#define MINSIGSTKSZ 2048
108#define SIGSTKSZ 8192 108#define SIGSTKSZ 8192
109 109
110#include <asm-generic/signal.h> 110#include <asm-generic/signal-defs.h>
111 111
112#ifdef __KERNEL__ 112#ifdef __KERNEL__
113struct old_sigaction { 113struct old_sigaction {
diff --git a/arch/m32r/kernel/module.c b/arch/m32r/kernel/module.c
index 8d4205794380..cb5f37d78d49 100644
--- a/arch/m32r/kernel/module.c
+++ b/arch/m32r/kernel/module.c
@@ -44,8 +44,6 @@ void *module_alloc(unsigned long size)
44void module_free(struct module *mod, void *module_region) 44void module_free(struct module *mod, void *module_region)
45{ 45{
46 vfree(module_region); 46 vfree(module_region);
47 /* FIXME: If module_region == mod->init_region, trim exception
48 table entries. */
49} 47}
50 48
51/* We don't need anything special. */ 49/* We don't need anything special. */
diff --git a/arch/m68k/include/asm/atomic_mm.h b/arch/m68k/include/asm/atomic_mm.h
index eb0ab9d4ee77..88b7af20a996 100644
--- a/arch/m68k/include/asm/atomic_mm.h
+++ b/arch/m68k/include/asm/atomic_mm.h
@@ -192,5 +192,5 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
192#define smp_mb__before_atomic_inc() barrier() 192#define smp_mb__before_atomic_inc() barrier()
193#define smp_mb__after_atomic_inc() barrier() 193#define smp_mb__after_atomic_inc() barrier()
194 194
195#include <asm-generic/atomic.h> 195#include <asm-generic/atomic-long.h>
196#endif /* __ARCH_M68K_ATOMIC __ */ 196#endif /* __ARCH_M68K_ATOMIC __ */
diff --git a/arch/m68k/include/asm/atomic_no.h b/arch/m68k/include/asm/atomic_no.h
index 6bb674855a3f..5674cb9449bd 100644
--- a/arch/m68k/include/asm/atomic_no.h
+++ b/arch/m68k/include/asm/atomic_no.h
@@ -151,5 +151,5 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
151#define atomic_dec_return(v) atomic_sub_return(1,(v)) 151#define atomic_dec_return(v) atomic_sub_return(1,(v))
152#define atomic_inc_return(v) atomic_add_return(1,(v)) 152#define atomic_inc_return(v) atomic_add_return(1,(v))
153 153
154#include <asm-generic/atomic.h> 154#include <asm-generic/atomic-long.h>
155#endif /* __ARCH_M68KNOMMU_ATOMIC __ */ 155#endif /* __ARCH_M68KNOMMU_ATOMIC __ */
diff --git a/arch/m68k/include/asm/bitsperlong.h b/arch/m68k/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/m68k/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h
index 1626d37f4898..9f5c4c4b3c7b 100644
--- a/arch/m68k/include/asm/mman.h
+++ b/arch/m68k/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __M68K_MMAN_H__ 1#ifndef __M68K_MMAN_H__
2#define __M68K_MMAN_H__ 2#define __M68K_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
index a34b8bad7847..d009f3ea39ab 100644
--- a/arch/m68k/include/asm/page_mm.h
+++ b/arch/m68k/include/asm/page_mm.h
@@ -223,6 +223,6 @@ static inline __attribute_const__ int __virt_to_node_shift(void)
223#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 223#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
224 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 224 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
225 225
226#include <asm-generic/page.h> 226#include <asm-generic/getorder.h>
227 227
228#endif /* _M68K_PAGE_H */ 228#endif /* _M68K_PAGE_H */
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index 3a1ede4544cb..9aa3f90f4855 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -72,6 +72,6 @@ extern unsigned long memory_end;
72 72
73#endif /* __ASSEMBLY__ */ 73#endif /* __ASSEMBLY__ */
74 74
75#include <asm-generic/page.h> 75#include <asm-generic/getorder.h>
76 76
77#endif /* _M68KNOMMU_PAGE_H */ 77#endif /* _M68KNOMMU_PAGE_H */
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h
index 08788fdefde0..5bc09c787a11 100644
--- a/arch/m68k/include/asm/signal.h
+++ b/arch/m68k/include/asm/signal.h
@@ -103,7 +103,7 @@ typedef unsigned long sigset_t;
103#define MINSIGSTKSZ 2048 103#define MINSIGSTKSZ 2048
104#define SIGSTKSZ 8192 104#define SIGSTKSZ 8192
105 105
106#include <asm-generic/signal.h> 106#include <asm-generic/signal-defs.h>
107 107
108#ifdef __KERNEL__ 108#ifdef __KERNEL__
109struct old_sigaction { 109struct old_sigaction {
diff --git a/arch/m68k/include/asm/suspend.h b/arch/m68k/include/asm/suspend.h
deleted file mode 100644
index 57b3ddb4d269..000000000000
--- a/arch/m68k/include/asm/suspend.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _M68K_SUSPEND_H
2#define _M68K_SUSPEND_H
3
4/* Dummy include. */
5
6#endif /* _M68K_SUSPEND_H */
diff --git a/arch/m68k/kernel/module.c b/arch/m68k/kernel/module.c
index 774862bc6977..cd6bcb1c957e 100644
--- a/arch/m68k/kernel/module.c
+++ b/arch/m68k/kernel/module.c
@@ -31,8 +31,6 @@ void *module_alloc(unsigned long size)
31void module_free(struct module *mod, void *module_region) 31void module_free(struct module *mod, void *module_region)
32{ 32{
33 vfree(module_region); 33 vfree(module_region);
34 /* FIXME: If module_region == mod->init_region, trim exception
35 table entries. */
36} 34}
37 35
38/* We don't need anything special. */ 36/* We don't need anything special. */
diff --git a/arch/m68knommu/kernel/module.c b/arch/m68knommu/kernel/module.c
index 3b1a2ff61ddc..d11ffae7956a 100644
--- a/arch/m68knommu/kernel/module.c
+++ b/arch/m68knommu/kernel/module.c
@@ -23,8 +23,6 @@ void *module_alloc(unsigned long size)
23void module_free(struct module *mod, void *module_region) 23void module_free(struct module *mod, void *module_region)
24{ 24{
25 vfree(module_region); 25 vfree(module_region);
26 /* FIXME: If module_region == mod->init_region, trim exception
27 table entries. */
28} 26}
29 27
30/* We don't need anything special. */ 28/* We don't need anything special. */
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 8cc312b5d4dc..b50b845fdd50 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -6,6 +6,7 @@ mainmenu "Linux/Microblaze Kernel Configuration"
6config MICROBLAZE 6config MICROBLAZE
7 def_bool y 7 def_bool y
8 select HAVE_LMB 8 select HAVE_LMB
9 select ARCH_WANT_OPTIONAL_GPIOLIB
9 10
10config SWAP 11config SWAP
11 def_bool n 12 def_bool n
@@ -49,13 +50,14 @@ config GENERIC_CLOCKEVENTS
49config GENERIC_HARDIRQS_NO__DO_IRQ 50config GENERIC_HARDIRQS_NO__DO_IRQ
50 def_bool y 51 def_bool y
51 52
53config GENERIC_GPIO
54 def_bool y
55
52config PCI 56config PCI
53 depends on !MMU
54 def_bool n 57 def_bool n
55 58
56config NO_DMA 59config NO_DMA
57 depends on !MMU 60 def_bool y
58 def_bool n
59 61
60source "init/Kconfig" 62source "init/Kconfig"
61 63
@@ -72,7 +74,8 @@ source "kernel/Kconfig.preempt"
72source "kernel/Kconfig.hz" 74source "kernel/Kconfig.hz"
73 75
74config MMU 76config MMU
75 def_bool n 77 bool "MMU support"
78 default n
76 79
77config NO_MMU 80config NO_MMU
78 bool 81 bool
@@ -105,9 +108,6 @@ config CMDLINE_FORCE
105config OF 108config OF
106 def_bool y 109 def_bool y
107 110
108config OF_DEVICE
109 def_bool y
110
111config PROC_DEVICETREE 111config PROC_DEVICETREE
112 bool "Support for device tree in /proc" 112 bool "Support for device tree in /proc"
113 depends on PROC_FS 113 depends on PROC_FS
@@ -118,6 +118,113 @@ config PROC_DEVICETREE
118 118
119endmenu 119endmenu
120 120
121menu "Advanced setup"
122
123config ADVANCED_OPTIONS
124 bool "Prompt for advanced kernel configuration options"
125 depends on MMU
126 help
127 This option will enable prompting for a variety of advanced kernel
128 configuration options. These options can cause the kernel to not
129 work if they are set incorrectly, but can be used to optimize certain
130 aspects of kernel memory management.
131
132 Unless you know what you are doing, say N here.
133
134comment "Default settings for advanced configuration options are used"
135 depends on !ADVANCED_OPTIONS
136
137config HIGHMEM_START_BOOL
138 bool "Set high memory pool address"
139 depends on ADVANCED_OPTIONS && HIGHMEM
140 help
141 This option allows you to set the base address of the kernel virtual
142 area used to map high memory pages. This can be useful in
143 optimizing the layout of kernel virtual memory.
144
145 Say N here unless you know what you are doing.
146
147config HIGHMEM_START
148 hex "Virtual start address of high memory pool" if HIGHMEM_START_BOOL
149 depends on MMU
150 default "0xfe000000"
151
152config LOWMEM_SIZE_BOOL
153 bool "Set maximum low memory"
154 depends on ADVANCED_OPTIONS
155 help
156 This option allows you to set the maximum amount of memory which
157 will be used as "low memory", that is, memory which the kernel can
158 access directly, without having to set up a kernel virtual mapping.
159 This can be useful in optimizing the layout of kernel virtual
160 memory.
161
162 Say N here unless you know what you are doing.
163
164config LOWMEM_SIZE
165 hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
166 depends on MMU
167 default "0x30000000"
168
169config KERNEL_START_BOOL
170 bool "Set custom kernel base address"
171 depends on ADVANCED_OPTIONS
172 help
173 This option allows you to set the kernel virtual address at which
174 the kernel will map low memory (the kernel image will be linked at
175 this address). This can be useful in optimizing the virtual memory
176 layout of the system.
177
178 Say N here unless you know what you are doing.
179
180config KERNEL_START
181 hex "Virtual address of kernel base" if KERNEL_START_BOOL
182 default "0xc0000000" if MMU
183 default KERNEL_BASE_ADDR if !MMU
184
185config TASK_SIZE_BOOL
186 bool "Set custom user task size"
187 depends on ADVANCED_OPTIONS
188 help
189 This option allows you to set the amount of virtual address space
190 allocated to user tasks. This can be useful in optimizing the
191 virtual memory layout of the system.
192
193 Say N here unless you know what you are doing.
194
195config TASK_SIZE
196 hex "Size of user task space" if TASK_SIZE_BOOL
197 depends on MMU
198 default "0x80000000"
199
200config CONSISTENT_START_BOOL
201 bool "Set custom consistent memory pool address"
202 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
203 help
204 This option allows you to set the base virtual address
205 of the the consistent memory pool. This pool of virtual
206 memory is used to make consistent memory allocations.
207
208config CONSISTENT_START
209 hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL
210 depends on MMU
211 default "0xff100000" if NOT_COHERENT_CACHE
212
213config CONSISTENT_SIZE_BOOL
214 bool "Set custom consistent memory pool size"
215 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
216 help
217 This option allows you to set the size of the the
218 consistent memory pool. This pool of virtual memory
219 is used to make consistent memory allocations.
220
221config CONSISTENT_SIZE
222 hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
223 depends on MMU
224 default "0x00200000" if NOT_COHERENT_CACHE
225
226endmenu
227
121source "mm/Kconfig" 228source "mm/Kconfig"
122 229
123menu "Exectuable file formats" 230menu "Exectuable file formats"
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index aaadfa701da3..d0bcf80a1136 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -1,4 +1,8 @@
1ifeq ($(CONFIG_MMU),y)
2UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
3else
1UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\" 4UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
5endif
2 6
3# What CPU vesion are we building for, and crack it open 7# What CPU vesion are we building for, and crack it open
4# as major.minor.rev 8# as major.minor.rev
@@ -36,6 +40,8 @@ CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
36# r31 holds current when in kernel mode 40# r31 holds current when in kernel mode
37CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) 41CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
38 42
43LDFLAGS :=
44LDFLAGS_vmlinux :=
39LDFLAGS_BLOB := --format binary --oformat elf32-microblaze 45LDFLAGS_BLOB := --format binary --oformat elf32-microblaze
40 46
41LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name) 47LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name)
diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile
index 844edf406d34..c2bb043a029d 100644
--- a/arch/microblaze/boot/Makefile
+++ b/arch/microblaze/boot/Makefile
@@ -7,6 +7,8 @@ targets := linux.bin linux.bin.gz
7OBJCOPYFLAGS_linux.bin := -O binary 7OBJCOPYFLAGS_linux.bin := -O binary
8 8
9$(obj)/linux.bin: vmlinux FORCE 9$(obj)/linux.bin: vmlinux FORCE
10 [ -n $(CONFIG_INITRAMFS_SOURCE) ] && [ ! -e $(CONFIG_INITRAMFS_SOURCE) ] && \
11 touch $(CONFIG_INITRAMFS_SOURCE) || echo "No CPIO image"
10 $(call if_changed,objcopy) 12 $(call if_changed,objcopy)
11 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' 13 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
12 14
diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
new file mode 100644
index 000000000000..bd0b85ec38f5
--- /dev/null
+++ b/arch/microblaze/configs/mmu_defconfig
@@ -0,0 +1,798 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc6
4# Fri May 22 10:02:33 2009
5#
6CONFIG_MICROBLAZE=y
7# CONFIG_SWAP is not set
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9# CONFIG_ARCH_HAS_ILOG2_U32 is not set
10# CONFIG_ARCH_HAS_ILOG2_U64 is not set
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_GENERIC_CALIBRATE_DELAY=y
16CONFIG_GENERIC_TIME=y
17# CONFIG_GENERIC_TIME_VSYSCALL is not set
18CONFIG_GENERIC_CLOCKEVENTS=y
19CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
20CONFIG_GENERIC_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22
23#
24# General setup
25#
26CONFIG_EXPERIMENTAL=y
27CONFIG_BROKEN_ON_SMP=y
28CONFIG_INIT_ENV_ARG_LIMIT=32
29CONFIG_LOCALVERSION=""
30CONFIG_LOCALVERSION_AUTO=y
31CONFIG_SYSVIPC=y
32CONFIG_SYSVIPC_SYSCTL=y
33# CONFIG_POSIX_MQUEUE is not set
34# CONFIG_BSD_PROCESS_ACCT is not set
35# CONFIG_TASKSTATS is not set
36# CONFIG_AUDIT is not set
37
38#
39# RCU Subsystem
40#
41CONFIG_CLASSIC_RCU=y
42# CONFIG_TREE_RCU is not set
43# CONFIG_PREEMPT_RCU is not set
44# CONFIG_TREE_RCU_TRACE is not set
45# CONFIG_PREEMPT_RCU_TRACE is not set
46CONFIG_IKCONFIG=y
47CONFIG_IKCONFIG_PROC=y
48CONFIG_LOG_BUF_SHIFT=17
49# CONFIG_GROUP_SCHED is not set
50# CONFIG_CGROUPS is not set
51CONFIG_SYSFS_DEPRECATED=y
52CONFIG_SYSFS_DEPRECATED_V2=y
53# CONFIG_RELAY is not set
54# CONFIG_NAMESPACES is not set
55CONFIG_BLK_DEV_INITRD=y
56CONFIG_INITRAMFS_SOURCE="rootfs.cpio"
57CONFIG_INITRAMFS_ROOT_UID=0
58CONFIG_INITRAMFS_ROOT_GID=0
59CONFIG_RD_GZIP=y
60# CONFIG_RD_BZIP2 is not set
61# CONFIG_RD_LZMA is not set
62CONFIG_INITRAMFS_COMPRESSION_NONE=y
63# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
64# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
65# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
67CONFIG_SYSCTL=y
68CONFIG_ANON_INODES=y
69CONFIG_EMBEDDED=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72CONFIG_KALLSYMS_ALL=y
73CONFIG_KALLSYMS_EXTRA_PASS=y
74# CONFIG_STRIP_ASM_SYMS is not set
75# CONFIG_HOTPLUG is not set
76CONFIG_PRINTK=y
77CONFIG_BUG=y
78CONFIG_ELF_CORE=y
79# CONFIG_BASE_FULL is not set
80# CONFIG_FUTEX is not set
81# CONFIG_EPOLL is not set
82# CONFIG_SIGNALFD is not set
83CONFIG_TIMERFD=y
84CONFIG_EVENTFD=y
85# CONFIG_SHMEM is not set
86CONFIG_AIO=y
87CONFIG_VM_EVENT_COUNTERS=y
88CONFIG_COMPAT_BRK=y
89CONFIG_SLAB=y
90# CONFIG_SLUB is not set
91# CONFIG_SLOB is not set
92# CONFIG_PROFILING is not set
93# CONFIG_MARKERS is not set
94# CONFIG_SLOW_WORK is not set
95# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
96CONFIG_SLABINFO=y
97CONFIG_BASE_SMALL=1
98CONFIG_MODULES=y
99# CONFIG_MODULE_FORCE_LOAD is not set
100CONFIG_MODULE_UNLOAD=y
101# CONFIG_MODULE_FORCE_UNLOAD is not set
102# CONFIG_MODVERSIONS is not set
103# CONFIG_MODULE_SRCVERSION_ALL is not set
104CONFIG_BLOCK=y
105# CONFIG_LBD is not set
106# CONFIG_BLK_DEV_BSG is not set
107# CONFIG_BLK_DEV_INTEGRITY is not set
108
109#
110# IO Schedulers
111#
112CONFIG_IOSCHED_NOOP=y
113CONFIG_IOSCHED_AS=y
114CONFIG_IOSCHED_DEADLINE=y
115CONFIG_IOSCHED_CFQ=y
116# CONFIG_DEFAULT_AS is not set
117# CONFIG_DEFAULT_DEADLINE is not set
118CONFIG_DEFAULT_CFQ=y
119# CONFIG_DEFAULT_NOOP is not set
120CONFIG_DEFAULT_IOSCHED="cfq"
121# CONFIG_FREEZER is not set
122
123#
124# Platform options
125#
126CONFIG_PLATFORM_GENERIC=y
127CONFIG_OPT_LIB_FUNCTION=y
128CONFIG_OPT_LIB_ASM=y
129CONFIG_ALLOW_EDIT_AUTO=y
130
131#
132# Automatic platform settings from Kconfig.auto
133#
134
135#
136# Definitions for MICROBLAZE0
137#
138CONFIG_KERNEL_BASE_ADDR=0x90000000
139CONFIG_XILINX_MICROBLAZE0_FAMILY="virtex5"
140CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
141CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
142CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1
143CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
144CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
145CONFIG_XILINX_MICROBLAZE0_USE_FPU=2
146CONFIG_XILINX_MICROBLAZE0_HW_VER="7.10.d"
147
148#
149# Processor type and features
150#
151# CONFIG_NO_HZ is not set
152# CONFIG_HIGH_RES_TIMERS is not set
153CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
154CONFIG_PREEMPT_NONE=y
155# CONFIG_PREEMPT_VOLUNTARY is not set
156# CONFIG_PREEMPT is not set
157CONFIG_HZ_100=y
158# CONFIG_HZ_250 is not set
159# CONFIG_HZ_300 is not set
160# CONFIG_HZ_1000 is not set
161CONFIG_HZ=100
162# CONFIG_SCHED_HRTICK is not set
163CONFIG_MMU=y
164
165#
166# Boot options
167#
168CONFIG_CMDLINE_BOOL=y
169CONFIG_CMDLINE="console=ttyUL0,115200"
170CONFIG_CMDLINE_FORCE=y
171CONFIG_OF=y
172CONFIG_PROC_DEVICETREE=y
173
174#
175# Advanced setup
176#
177# CONFIG_ADVANCED_OPTIONS is not set
178
179#
180# Default settings for advanced configuration options are used
181#
182CONFIG_HIGHMEM_START=0xfe000000
183CONFIG_LOWMEM_SIZE=0x30000000
184CONFIG_KERNEL_START=0xc0000000
185CONFIG_TASK_SIZE=0x80000000
186CONFIG_SELECT_MEMORY_MODEL=y
187CONFIG_FLATMEM_MANUAL=y
188# CONFIG_DISCONTIGMEM_MANUAL is not set
189# CONFIG_SPARSEMEM_MANUAL is not set
190CONFIG_FLATMEM=y
191CONFIG_FLAT_NODE_MEM_MAP=y
192CONFIG_PAGEFLAGS_EXTENDED=y
193CONFIG_SPLIT_PTLOCK_CPUS=4
194# CONFIG_PHYS_ADDR_T_64BIT is not set
195CONFIG_ZONE_DMA_FLAG=0
196CONFIG_VIRT_TO_BUS=y
197CONFIG_UNEVICTABLE_LRU=y
198CONFIG_HAVE_MLOCK=y
199CONFIG_HAVE_MLOCKED_PAGE_BIT=y
200
201#
202# Exectuable file formats
203#
204CONFIG_BINFMT_ELF=y
205# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
206# CONFIG_HAVE_AOUT is not set
207# CONFIG_BINFMT_MISC is not set
208CONFIG_NET=y
209
210#
211# Networking options
212#
213CONFIG_PACKET=y
214# CONFIG_PACKET_MMAP is not set
215CONFIG_UNIX=y
216CONFIG_XFRM=y
217# CONFIG_XFRM_USER is not set
218# CONFIG_XFRM_SUB_POLICY is not set
219# CONFIG_XFRM_MIGRATE is not set
220# CONFIG_XFRM_STATISTICS is not set
221# CONFIG_NET_KEY is not set
222CONFIG_INET=y
223# CONFIG_IP_MULTICAST is not set
224# CONFIG_IP_ADVANCED_ROUTER is not set
225CONFIG_IP_FIB_HASH=y
226# CONFIG_IP_PNP is not set
227# CONFIG_NET_IPIP is not set
228# CONFIG_NET_IPGRE is not set
229# CONFIG_ARPD is not set
230# CONFIG_SYN_COOKIES is not set
231# CONFIG_INET_AH is not set
232# CONFIG_INET_ESP is not set
233# CONFIG_INET_IPCOMP is not set
234# CONFIG_INET_XFRM_TUNNEL is not set
235# CONFIG_INET_TUNNEL is not set
236CONFIG_INET_XFRM_MODE_TRANSPORT=y
237CONFIG_INET_XFRM_MODE_TUNNEL=y
238CONFIG_INET_XFRM_MODE_BEET=y
239# CONFIG_INET_LRO is not set
240CONFIG_INET_DIAG=y
241CONFIG_INET_TCP_DIAG=y
242# CONFIG_TCP_CONG_ADVANCED is not set
243CONFIG_TCP_CONG_CUBIC=y
244CONFIG_DEFAULT_TCP_CONG="cubic"
245# CONFIG_TCP_MD5SIG is not set
246# CONFIG_IPV6 is not set
247# CONFIG_NETWORK_SECMARK is not set
248# CONFIG_NETFILTER is not set
249# CONFIG_IP_DCCP is not set
250# CONFIG_IP_SCTP is not set
251# CONFIG_TIPC is not set
252# CONFIG_ATM is not set
253# CONFIG_BRIDGE is not set
254# CONFIG_NET_DSA is not set
255# CONFIG_VLAN_8021Q is not set
256# CONFIG_DECNET is not set
257# CONFIG_LLC2 is not set
258# CONFIG_IPX is not set
259# CONFIG_ATALK is not set
260# CONFIG_X25 is not set
261# CONFIG_LAPB is not set
262# CONFIG_ECONET is not set
263# CONFIG_WAN_ROUTER is not set
264# CONFIG_PHONET is not set
265# CONFIG_NET_SCHED is not set
266# CONFIG_DCB is not set
267
268#
269# Network testing
270#
271# CONFIG_NET_PKTGEN is not set
272# CONFIG_HAMRADIO is not set
273# CONFIG_CAN is not set
274# CONFIG_IRDA is not set
275# CONFIG_BT is not set
276# CONFIG_AF_RXRPC is not set
277# CONFIG_WIRELESS is not set
278# CONFIG_WIMAX is not set
279# CONFIG_RFKILL is not set
280# CONFIG_NET_9P is not set
281
282#
283# Device Drivers
284#
285
286#
287# Generic Driver Options
288#
289CONFIG_STANDALONE=y
290CONFIG_PREVENT_FIRMWARE_BUILD=y
291# CONFIG_DEBUG_DRIVER is not set
292# CONFIG_DEBUG_DEVRES is not set
293# CONFIG_SYS_HYPERVISOR is not set
294# CONFIG_CONNECTOR is not set
295# CONFIG_MTD is not set
296CONFIG_OF_DEVICE=y
297# CONFIG_PARPORT is not set
298CONFIG_BLK_DEV=y
299# CONFIG_BLK_DEV_COW_COMMON is not set
300# CONFIG_BLK_DEV_LOOP is not set
301# CONFIG_BLK_DEV_NBD is not set
302CONFIG_BLK_DEV_RAM=y
303CONFIG_BLK_DEV_RAM_COUNT=16
304CONFIG_BLK_DEV_RAM_SIZE=8192
305# CONFIG_BLK_DEV_XIP is not set
306# CONFIG_CDROM_PKTCDVD is not set
307# CONFIG_ATA_OVER_ETH is not set
308# CONFIG_XILINX_SYSACE is not set
309CONFIG_MISC_DEVICES=y
310# CONFIG_ENCLOSURE_SERVICES is not set
311# CONFIG_C2PORT is not set
312
313#
314# EEPROM support
315#
316# CONFIG_EEPROM_93CX6 is not set
317
318#
319# SCSI device support
320#
321# CONFIG_RAID_ATTRS is not set
322# CONFIG_SCSI is not set
323# CONFIG_SCSI_DMA is not set
324# CONFIG_SCSI_NETLINK is not set
325# CONFIG_ATA is not set
326# CONFIG_MD is not set
327CONFIG_NETDEVICES=y
328CONFIG_COMPAT_NET_DEV_OPS=y
329# CONFIG_DUMMY is not set
330# CONFIG_BONDING is not set
331# CONFIG_MACVLAN is not set
332# CONFIG_EQUALIZER is not set
333# CONFIG_TUN is not set
334# CONFIG_VETH is not set
335# CONFIG_PHYLIB is not set
336CONFIG_NET_ETHERNET=y
337# CONFIG_MII is not set
338# CONFIG_ETHOC is not set
339# CONFIG_DNET is not set
340# CONFIG_IBM_NEW_EMAC_ZMII is not set
341# CONFIG_IBM_NEW_EMAC_RGMII is not set
342# CONFIG_IBM_NEW_EMAC_TAH is not set
343# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
344# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
345# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
346# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
347# CONFIG_B44 is not set
348CONFIG_NETDEV_1000=y
349CONFIG_NETDEV_10000=y
350
351#
352# Wireless LAN
353#
354# CONFIG_WLAN_PRE80211 is not set
355# CONFIG_WLAN_80211 is not set
356
357#
358# Enable WiMAX (Networking options) to see the WiMAX drivers
359#
360# CONFIG_WAN is not set
361# CONFIG_PPP is not set
362# CONFIG_SLIP is not set
363# CONFIG_NETCONSOLE is not set
364# CONFIG_NETPOLL is not set
365# CONFIG_NET_POLL_CONTROLLER is not set
366# CONFIG_ISDN is not set
367# CONFIG_PHONE is not set
368
369#
370# Input device support
371#
372# CONFIG_INPUT is not set
373
374#
375# Hardware I/O ports
376#
377# CONFIG_SERIO is not set
378# CONFIG_GAMEPORT is not set
379
380#
381# Character devices
382#
383# CONFIG_VT is not set
384CONFIG_DEVKMEM=y
385# CONFIG_SERIAL_NONSTANDARD is not set
386
387#
388# Serial drivers
389#
390# CONFIG_SERIAL_8250 is not set
391
392#
393# Non-8250 serial port support
394#
395CONFIG_SERIAL_UARTLITE=y
396CONFIG_SERIAL_UARTLITE_CONSOLE=y
397CONFIG_SERIAL_CORE=y
398CONFIG_SERIAL_CORE_CONSOLE=y
399CONFIG_UNIX98_PTYS=y
400# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
401CONFIG_LEGACY_PTYS=y
402CONFIG_LEGACY_PTY_COUNT=256
403# CONFIG_IPMI_HANDLER is not set
404# CONFIG_HW_RANDOM is not set
405# CONFIG_RTC is not set
406# CONFIG_GEN_RTC is not set
407# CONFIG_XILINX_HWICAP is not set
408# CONFIG_R3964 is not set
409# CONFIG_RAW_DRIVER is not set
410# CONFIG_TCG_TPM is not set
411# CONFIG_I2C is not set
412# CONFIG_SPI is not set
413CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
414# CONFIG_GPIOLIB is not set
415# CONFIG_W1 is not set
416# CONFIG_POWER_SUPPLY is not set
417# CONFIG_HWMON is not set
418# CONFIG_THERMAL is not set
419# CONFIG_THERMAL_HWMON is not set
420# CONFIG_WATCHDOG is not set
421CONFIG_SSB_POSSIBLE=y
422
423#
424# Sonics Silicon Backplane
425#
426# CONFIG_SSB is not set
427
428#
429# Multifunction device drivers
430#
431# CONFIG_MFD_CORE is not set
432# CONFIG_MFD_SM501 is not set
433# CONFIG_HTC_PASIC3 is not set
434# CONFIG_MFD_TMIO is not set
435# CONFIG_REGULATOR is not set
436
437#
438# Multimedia devices
439#
440
441#
442# Multimedia core support
443#
444# CONFIG_VIDEO_DEV is not set
445# CONFIG_DVB_CORE is not set
446# CONFIG_VIDEO_MEDIA is not set
447
448#
449# Multimedia drivers
450#
451# CONFIG_DAB is not set
452
453#
454# Graphics support
455#
456# CONFIG_VGASTATE is not set
457# CONFIG_VIDEO_OUTPUT_CONTROL is not set
458# CONFIG_FB is not set
459# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
460
461#
462# Display device support
463#
464# CONFIG_DISPLAY_SUPPORT is not set
465# CONFIG_SOUND is not set
466# CONFIG_USB_SUPPORT is not set
467# CONFIG_MMC is not set
468# CONFIG_MEMSTICK is not set
469# CONFIG_NEW_LEDS is not set
470# CONFIG_ACCESSIBILITY is not set
471# CONFIG_RTC_CLASS is not set
472# CONFIG_DMADEVICES is not set
473# CONFIG_AUXDISPLAY is not set
474# CONFIG_UIO is not set
475# CONFIG_STAGING is not set
476
477#
478# File systems
479#
480CONFIG_EXT2_FS=y
481# CONFIG_EXT2_FS_XATTR is not set
482# CONFIG_EXT2_FS_XIP is not set
483# CONFIG_EXT3_FS is not set
484# CONFIG_EXT4_FS is not set
485# CONFIG_REISERFS_FS is not set
486# CONFIG_JFS_FS is not set
487# CONFIG_FS_POSIX_ACL is not set
488CONFIG_FILE_LOCKING=y
489# CONFIG_XFS_FS is not set
490# CONFIG_OCFS2_FS is not set
491# CONFIG_BTRFS_FS is not set
492# CONFIG_DNOTIFY is not set
493# CONFIG_INOTIFY is not set
494# CONFIG_QUOTA is not set
495# CONFIG_AUTOFS_FS is not set
496# CONFIG_AUTOFS4_FS is not set
497# CONFIG_FUSE_FS is not set
498
499#
500# Caches
501#
502# CONFIG_FSCACHE is not set
503
504#
505# CD-ROM/DVD Filesystems
506#
507# CONFIG_ISO9660_FS is not set
508# CONFIG_UDF_FS is not set
509
510#
511# DOS/FAT/NT Filesystems
512#
513# CONFIG_MSDOS_FS is not set
514# CONFIG_VFAT_FS is not set
515# CONFIG_NTFS_FS is not set
516
517#
518# Pseudo filesystems
519#
520CONFIG_PROC_FS=y
521# CONFIG_PROC_KCORE is not set
522CONFIG_PROC_SYSCTL=y
523CONFIG_PROC_PAGE_MONITOR=y
524CONFIG_SYSFS=y
525CONFIG_TMPFS=y
526# CONFIG_TMPFS_POSIX_ACL is not set
527# CONFIG_HUGETLB_PAGE is not set
528# CONFIG_CONFIGFS_FS is not set
529CONFIG_MISC_FILESYSTEMS=y
530# CONFIG_ADFS_FS is not set
531# CONFIG_AFFS_FS is not set
532# CONFIG_HFS_FS is not set
533# CONFIG_HFSPLUS_FS is not set
534# CONFIG_BEFS_FS is not set
535# CONFIG_BFS_FS is not set
536# CONFIG_EFS_FS is not set
537# CONFIG_CRAMFS is not set
538# CONFIG_SQUASHFS is not set
539# CONFIG_VXFS_FS is not set
540# CONFIG_MINIX_FS is not set
541# CONFIG_OMFS_FS is not set
542# CONFIG_HPFS_FS is not set
543# CONFIG_QNX4FS_FS is not set
544# CONFIG_ROMFS_FS is not set
545# CONFIG_SYSV_FS is not set
546# CONFIG_UFS_FS is not set
547# CONFIG_NILFS2_FS is not set
548CONFIG_NETWORK_FILESYSTEMS=y
549CONFIG_NFS_FS=y
550CONFIG_NFS_V3=y
551# CONFIG_NFS_V3_ACL is not set
552# CONFIG_NFS_V4 is not set
553# CONFIG_NFSD is not set
554CONFIG_LOCKD=y
555CONFIG_LOCKD_V4=y
556CONFIG_NFS_COMMON=y
557CONFIG_SUNRPC=y
558# CONFIG_RPCSEC_GSS_KRB5 is not set
559# CONFIG_RPCSEC_GSS_SPKM3 is not set
560# CONFIG_SMB_FS is not set
561CONFIG_CIFS=y
562CONFIG_CIFS_STATS=y
563CONFIG_CIFS_STATS2=y
564# CONFIG_CIFS_WEAK_PW_HASH is not set
565# CONFIG_CIFS_XATTR is not set
566# CONFIG_CIFS_DEBUG2 is not set
567# CONFIG_CIFS_EXPERIMENTAL is not set
568# CONFIG_NCP_FS is not set
569# CONFIG_CODA_FS is not set
570# CONFIG_AFS_FS is not set
571
572#
573# Partition Types
574#
575CONFIG_PARTITION_ADVANCED=y
576# CONFIG_ACORN_PARTITION is not set
577# CONFIG_OSF_PARTITION is not set
578# CONFIG_AMIGA_PARTITION is not set
579# CONFIG_ATARI_PARTITION is not set
580# CONFIG_MAC_PARTITION is not set
581CONFIG_MSDOS_PARTITION=y
582# CONFIG_BSD_DISKLABEL is not set
583# CONFIG_MINIX_SUBPARTITION is not set
584# CONFIG_SOLARIS_X86_PARTITION is not set
585# CONFIG_UNIXWARE_DISKLABEL is not set
586# CONFIG_LDM_PARTITION is not set
587# CONFIG_SGI_PARTITION is not set
588# CONFIG_ULTRIX_PARTITION is not set
589# CONFIG_SUN_PARTITION is not set
590# CONFIG_KARMA_PARTITION is not set
591# CONFIG_EFI_PARTITION is not set
592# CONFIG_SYSV68_PARTITION is not set
593CONFIG_NLS=y
594CONFIG_NLS_DEFAULT="iso8859-1"
595# CONFIG_NLS_CODEPAGE_437 is not set
596# CONFIG_NLS_CODEPAGE_737 is not set
597# CONFIG_NLS_CODEPAGE_775 is not set
598# CONFIG_NLS_CODEPAGE_850 is not set
599# CONFIG_NLS_CODEPAGE_852 is not set
600# CONFIG_NLS_CODEPAGE_855 is not set
601# CONFIG_NLS_CODEPAGE_857 is not set
602# CONFIG_NLS_CODEPAGE_860 is not set
603# CONFIG_NLS_CODEPAGE_861 is not set
604# CONFIG_NLS_CODEPAGE_862 is not set
605# CONFIG_NLS_CODEPAGE_863 is not set
606# CONFIG_NLS_CODEPAGE_864 is not set
607# CONFIG_NLS_CODEPAGE_865 is not set
608# CONFIG_NLS_CODEPAGE_866 is not set
609# CONFIG_NLS_CODEPAGE_869 is not set
610# CONFIG_NLS_CODEPAGE_936 is not set
611# CONFIG_NLS_CODEPAGE_950 is not set
612# CONFIG_NLS_CODEPAGE_932 is not set
613# CONFIG_NLS_CODEPAGE_949 is not set
614# CONFIG_NLS_CODEPAGE_874 is not set
615# CONFIG_NLS_ISO8859_8 is not set
616# CONFIG_NLS_CODEPAGE_1250 is not set
617# CONFIG_NLS_CODEPAGE_1251 is not set
618# CONFIG_NLS_ASCII is not set
619# CONFIG_NLS_ISO8859_1 is not set
620# CONFIG_NLS_ISO8859_2 is not set
621# CONFIG_NLS_ISO8859_3 is not set
622# CONFIG_NLS_ISO8859_4 is not set
623# CONFIG_NLS_ISO8859_5 is not set
624# CONFIG_NLS_ISO8859_6 is not set
625# CONFIG_NLS_ISO8859_7 is not set
626# CONFIG_NLS_ISO8859_9 is not set
627# CONFIG_NLS_ISO8859_13 is not set
628# CONFIG_NLS_ISO8859_14 is not set
629# CONFIG_NLS_ISO8859_15 is not set
630# CONFIG_NLS_KOI8_R is not set
631# CONFIG_NLS_KOI8_U is not set
632# CONFIG_NLS_UTF8 is not set
633# CONFIG_DLM is not set
634
635#
636# Kernel hacking
637#
638# CONFIG_PRINTK_TIME is not set
639CONFIG_ENABLE_WARN_DEPRECATED=y
640CONFIG_ENABLE_MUST_CHECK=y
641CONFIG_FRAME_WARN=1024
642# CONFIG_MAGIC_SYSRQ is not set
643# CONFIG_UNUSED_SYMBOLS is not set
644# CONFIG_DEBUG_FS is not set
645# CONFIG_HEADERS_CHECK is not set
646CONFIG_DEBUG_KERNEL=y
647# CONFIG_DEBUG_SHIRQ is not set
648CONFIG_DETECT_SOFTLOCKUP=y
649# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
650CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
651CONFIG_DETECT_HUNG_TASK=y
652# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
653CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
654CONFIG_SCHED_DEBUG=y
655# CONFIG_SCHEDSTATS is not set
656# CONFIG_TIMER_STATS is not set
657# CONFIG_DEBUG_OBJECTS is not set
658CONFIG_DEBUG_SLAB=y
659# CONFIG_DEBUG_SLAB_LEAK is not set
660CONFIG_DEBUG_SPINLOCK=y
661# CONFIG_DEBUG_MUTEXES is not set
662# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
663# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
664# CONFIG_DEBUG_KOBJECT is not set
665CONFIG_DEBUG_INFO=y
666# CONFIG_DEBUG_VM is not set
667# CONFIG_DEBUG_WRITECOUNT is not set
668# CONFIG_DEBUG_MEMORY_INIT is not set
669# CONFIG_DEBUG_LIST is not set
670# CONFIG_DEBUG_SG is not set
671# CONFIG_DEBUG_NOTIFIERS is not set
672# CONFIG_BOOT_PRINTK_DELAY is not set
673# CONFIG_RCU_TORTURE_TEST is not set
674# CONFIG_RCU_CPU_STALL_DETECTOR is not set
675# CONFIG_BACKTRACE_SELF_TEST is not set
676# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
677# CONFIG_FAULT_INJECTION is not set
678# CONFIG_SYSCTL_SYSCALL_CHECK is not set
679# CONFIG_PAGE_POISONING is not set
680# CONFIG_SAMPLES is not set
681CONFIG_EARLY_PRINTK=y
682CONFIG_HEART_BEAT=y
683CONFIG_DEBUG_BOOTMEM=y
684
685#
686# Security options
687#
688# CONFIG_KEYS is not set
689# CONFIG_SECURITY is not set
690# CONFIG_SECURITYFS is not set
691# CONFIG_SECURITY_FILE_CAPABILITIES is not set
692CONFIG_CRYPTO=y
693
694#
695# Crypto core or helper
696#
697# CONFIG_CRYPTO_FIPS is not set
698# CONFIG_CRYPTO_MANAGER is not set
699# CONFIG_CRYPTO_MANAGER2 is not set
700# CONFIG_CRYPTO_GF128MUL is not set
701# CONFIG_CRYPTO_NULL is not set
702# CONFIG_CRYPTO_CRYPTD is not set
703# CONFIG_CRYPTO_AUTHENC is not set
704# CONFIG_CRYPTO_TEST is not set
705
706#
707# Authenticated Encryption with Associated Data
708#
709# CONFIG_CRYPTO_CCM is not set
710# CONFIG_CRYPTO_GCM is not set
711# CONFIG_CRYPTO_SEQIV is not set
712
713#
714# Block modes
715#
716# CONFIG_CRYPTO_CBC is not set
717# CONFIG_CRYPTO_CTR is not set
718# CONFIG_CRYPTO_CTS is not set
719# CONFIG_CRYPTO_ECB is not set
720# CONFIG_CRYPTO_LRW is not set
721# CONFIG_CRYPTO_PCBC is not set
722# CONFIG_CRYPTO_XTS is not set
723
724#
725# Hash modes
726#
727# CONFIG_CRYPTO_HMAC is not set
728# CONFIG_CRYPTO_XCBC is not set
729
730#
731# Digest
732#
733# CONFIG_CRYPTO_CRC32C is not set
734# CONFIG_CRYPTO_MD4 is not set
735# CONFIG_CRYPTO_MD5 is not set
736# CONFIG_CRYPTO_MICHAEL_MIC is not set
737# CONFIG_CRYPTO_RMD128 is not set
738# CONFIG_CRYPTO_RMD160 is not set
739# CONFIG_CRYPTO_RMD256 is not set
740# CONFIG_CRYPTO_RMD320 is not set
741# CONFIG_CRYPTO_SHA1 is not set
742# CONFIG_CRYPTO_SHA256 is not set
743# CONFIG_CRYPTO_SHA512 is not set
744# CONFIG_CRYPTO_TGR192 is not set
745# CONFIG_CRYPTO_WP512 is not set
746
747#
748# Ciphers
749#
750# CONFIG_CRYPTO_AES is not set
751# CONFIG_CRYPTO_ANUBIS is not set
752# CONFIG_CRYPTO_ARC4 is not set
753# CONFIG_CRYPTO_BLOWFISH is not set
754# CONFIG_CRYPTO_CAMELLIA is not set
755# CONFIG_CRYPTO_CAST5 is not set
756# CONFIG_CRYPTO_CAST6 is not set
757# CONFIG_CRYPTO_DES is not set
758# CONFIG_CRYPTO_FCRYPT is not set
759# CONFIG_CRYPTO_KHAZAD is not set
760# CONFIG_CRYPTO_SALSA20 is not set
761# CONFIG_CRYPTO_SEED is not set
762# CONFIG_CRYPTO_SERPENT is not set
763# CONFIG_CRYPTO_TEA is not set
764# CONFIG_CRYPTO_TWOFISH is not set
765
766#
767# Compression
768#
769# CONFIG_CRYPTO_DEFLATE is not set
770# CONFIG_CRYPTO_ZLIB is not set
771# CONFIG_CRYPTO_LZO is not set
772
773#
774# Random Number Generation
775#
776# CONFIG_CRYPTO_ANSI_CPRNG is not set
777CONFIG_CRYPTO_HW=y
778# CONFIG_BINARY_PRINTF is not set
779
780#
781# Library routines
782#
783CONFIG_BITREVERSE=y
784CONFIG_GENERIC_FIND_LAST_BIT=y
785# CONFIG_CRC_CCITT is not set
786# CONFIG_CRC16 is not set
787# CONFIG_CRC_T10DIF is not set
788# CONFIG_CRC_ITU_T is not set
789CONFIG_CRC32=y
790# CONFIG_CRC7 is not set
791# CONFIG_LIBCRC32C is not set
792CONFIG_ZLIB_INFLATE=y
793CONFIG_DECOMPRESS_GZIP=y
794CONFIG_HAS_IOMEM=y
795CONFIG_HAS_IOPORT=y
796CONFIG_HAS_DMA=y
797CONFIG_HAVE_LMB=y
798CONFIG_NLATTR=y
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index 31820dfef56b..db5294c30caf 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -1,26 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += auxvec.h 3header-y += elf.h
4header-y += errno.h
5header-y += fcntl.h
6header-y += ioctl.h
7header-y += ioctls.h
8header-y += ipcbuf.h
9header-y += linkage.h
10header-y += msgbuf.h
11header-y += poll.h
12header-y += resource.h
13header-y += sembuf.h
14header-y += shmbuf.h
15header-y += sigcontext.h
16header-y += siginfo.h
17header-y += socket.h
18header-y += sockios.h
19header-y += statfs.h
20header-y += stat.h
21header-y += termbits.h
22header-y += ucontext.h
23
24unifdef-y += cputable.h
25unifdef-y += elf.h
26unifdef-y += termios.h
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
index a448d94ab721..0de612ad7cb2 100644
--- a/arch/microblaze/include/asm/atomic.h
+++ b/arch/microblaze/include/asm/atomic.h
@@ -118,6 +118,6 @@ static inline int atomic_dec_if_positive(atomic_t *v)
118#define smp_mb__before_atomic_inc() barrier() 118#define smp_mb__before_atomic_inc() barrier()
119#define smp_mb__after_atomic_inc() barrier() 119#define smp_mb__after_atomic_inc() barrier()
120 120
121#include <asm-generic/atomic.h> 121#include <asm-generic/atomic-long.h>
122 122
123#endif /* _ASM_MICROBLAZE_ATOMIC_H */ 123#endif /* _ASM_MICROBLAZE_ATOMIC_H */
diff --git a/arch/microblaze/include/asm/bitsperlong.h b/arch/microblaze/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/microblaze/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
index 3300b785049b..f989d6aad648 100644
--- a/arch/microblaze/include/asm/cacheflush.h
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007 PetaLogix 2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
3 * Copyright (C) 2007 John Williams <john.williams@petalogix.com> 4 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
4 * based on v850 version which was 5 * based on v850 version which was
5 * Copyright (C) 2001,02,03 NEC Electronics Corporation 6 * Copyright (C) 2001,02,03 NEC Electronics Corporation
@@ -43,6 +44,23 @@
43#define flush_icache_range(start, len) __invalidate_icache_range(start, len) 44#define flush_icache_range(start, len) __invalidate_icache_range(start, len)
44#define flush_icache_page(vma, pg) do { } while (0) 45#define flush_icache_page(vma, pg) do { } while (0)
45 46
47#ifndef CONFIG_MMU
48# define flush_icache_user_range(start, len) do { } while (0)
49#else
50# define flush_icache_user_range(vma, pg, adr, len) __invalidate_icache_all()
51
52# define flush_page_to_ram(page) do { } while (0)
53
54# define flush_icache() __invalidate_icache_all()
55# define flush_cache_sigtramp(vaddr) \
56 __invalidate_icache_range(vaddr, vaddr + 8)
57
58# define flush_dcache_mmap_lock(mapping) do { } while (0)
59# define flush_dcache_mmap_unlock(mapping) do { } while (0)
60
61# define flush_cache_dup_mm(mm) do { } while (0)
62#endif
63
46#define flush_cache_vmap(start, end) do { } while (0) 64#define flush_cache_vmap(start, end) do { } while (0)
47#define flush_cache_vunmap(start, end) do { } while (0) 65#define flush_cache_vunmap(start, end) do { } while (0)
48 66
diff --git a/arch/microblaze/include/asm/checksum.h b/arch/microblaze/include/asm/checksum.h
index 92b30762ce59..97ea46b5cf80 100644
--- a/arch/microblaze/include/asm/checksum.h
+++ b/arch/microblaze/include/asm/checksum.h
@@ -51,7 +51,8 @@ extern __wsum csum_partial(const void *buff, int len, __wsum sum);
51 * here even more important to align src and dst on a 32-bit (or even 51 * here even more important to align src and dst on a 32-bit (or even
52 * better 64-bit) boundary 52 * better 64-bit) boundary
53 */ 53 */
54extern __wsum csum_partial_copy(const char *src, char *dst, int len, int sum); 54extern __wsum csum_partial_copy(const void *src, void *dst, int len,
55 __wsum sum);
55 56
56/* 57/*
57 * the same as csum_partial_copy, but copies from user space. 58 * the same as csum_partial_copy, but copies from user space.
@@ -59,8 +60,8 @@ extern __wsum csum_partial_copy(const char *src, char *dst, int len, int sum);
59 * here even more important to align src and dst on a 32-bit (or even 60 * here even more important to align src and dst on a 32-bit (or even
60 * better 64-bit) boundary 61 * better 64-bit) boundary
61 */ 62 */
62extern __wsum csum_partial_copy_from_user(const char *src, char *dst, 63extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
63 int len, int sum, int *csum_err); 64 int len, __wsum sum, int *csum_err);
64 65
65#define csum_partial_copy_nocheck(src, dst, len, sum) \ 66#define csum_partial_copy_nocheck(src, dst, len, sum) \
66 csum_partial_copy((src), (dst), (len), (sum)) 67 csum_partial_copy((src), (dst), (len), (sum))
@@ -75,11 +76,12 @@ extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
75/* 76/*
76 * Fold a partial checksum 77 * Fold a partial checksum
77 */ 78 */
78static inline __sum16 csum_fold(unsigned int sum) 79static inline __sum16 csum_fold(__wsum csum)
79{ 80{
81 u32 sum = (__force u32)csum;
80 sum = (sum & 0xffff) + (sum >> 16); 82 sum = (sum & 0xffff) + (sum >> 16);
81 sum = (sum & 0xffff) + (sum >> 16); 83 sum = (sum & 0xffff) + (sum >> 16);
82 return ~sum; 84 return (__force __sum16)~sum;
83} 85}
84 86
85static inline __sum16 87static inline __sum16
@@ -93,6 +95,6 @@ csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
93 * this routine is used for miscellaneous IP-like checksums, mainly 95 * this routine is used for miscellaneous IP-like checksums, mainly
94 * in icmp.c 96 * in icmp.c
95 */ 97 */
96extern __sum16 ip_compute_csum(const unsigned char *buff, int len); 98extern __sum16 ip_compute_csum(const void *buff, int len);
97 99
98#endif /* _ASM_MICROBLAZE_CHECKSUM_H */ 100#endif /* _ASM_MICROBLAZE_CHECKSUM_H */
diff --git a/arch/microblaze/include/asm/current.h b/arch/microblaze/include/asm/current.h
index 8375ea991e26..29303ed825cc 100644
--- a/arch/microblaze/include/asm/current.h
+++ b/arch/microblaze/include/asm/current.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -9,6 +11,12 @@
9#ifndef _ASM_MICROBLAZE_CURRENT_H 11#ifndef _ASM_MICROBLAZE_CURRENT_H
10#define _ASM_MICROBLAZE_CURRENT_H 12#define _ASM_MICROBLAZE_CURRENT_H
11 13
14/*
15 * Register used to hold the current task pointer while in the kernel.
16 * Any `call clobbered' register without a special meaning should be OK,
17 * but check asm/microblaze/kernel/entry.S to be sure.
18 */
19#define CURRENT_TASK r31
12# ifndef __ASSEMBLY__ 20# ifndef __ASSEMBLY__
13/* 21/*
14 * Dedicate r31 to keeping the current task pointer 22 * Dedicate r31 to keeping the current task pointer
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index 17336252a9b8..d00e40099165 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -1,129 +1 @@
1/* #include <asm-generic/dma-mapping-broken.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DMA_MAPPING_H
10#define _ASM_MICROBLAZE_DMA_MAPPING_H
11
12#include <asm/cacheflush.h>
13#include <linux/io.h>
14#include <linux/bug.h>
15
16struct scatterlist;
17
18#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
19#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
20
21/* FIXME */
22static inline int
23dma_supported(struct device *dev, u64 mask)
24{
25 return 1;
26}
27
28static inline dma_addr_t
29dma_map_page(struct device *dev, struct page *page,
30 unsigned long offset, size_t size,
31 enum dma_data_direction direction)
32{
33 BUG();
34 return 0;
35}
36
37static inline void
38dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
39 enum dma_data_direction direction)
40{
41 BUG();
42}
43
44static inline int
45dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
46 enum dma_data_direction direction)
47{
48 BUG();
49 return 0;
50}
51
52static inline void
53dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
54 enum dma_data_direction direction)
55{
56 BUG();
57}
58
59static inline void
60dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
61 enum dma_data_direction direction)
62{
63 BUG();
64}
65
66static inline void
67dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
68 size_t size, enum dma_data_direction direction)
69{
70 BUG();
71}
72
73static inline void
74dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
75 enum dma_data_direction direction)
76{
77 BUG();
78}
79
80static inline void
81dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
82 enum dma_data_direction direction)
83{
84 BUG();
85}
86
87static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
88{
89 return 0;
90}
91
92static inline void *dma_alloc_coherent(struct device *dev, size_t size,
93 dma_addr_t *dma_handle, int flag)
94{
95 return NULL; /* consistent_alloc(flag, size, dma_handle); */
96}
97
98static inline void dma_free_coherent(struct device *dev, size_t size,
99 void *vaddr, dma_addr_t dma_handle)
100{
101 BUG();
102}
103
104static inline dma_addr_t
105dma_map_single(struct device *dev, void *ptr, size_t size,
106 enum dma_data_direction direction)
107{
108 BUG_ON(direction == DMA_NONE);
109
110 return virt_to_bus(ptr);
111}
112
113static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
114 size_t size,
115 enum dma_data_direction direction)
116{
117 switch (direction) {
118 case DMA_FROM_DEVICE:
119 flush_dcache_range((unsigned)dma_addr,
120 (unsigned)dma_addr + size);
121 /* Fall through */
122 case DMA_TO_DEVICE:
123 break;
124 default:
125 BUG();
126 }
127}
128
129#endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */
diff --git a/arch/microblaze/include/asm/dma.h b/arch/microblaze/include/asm/dma.h
index 0967fa04fc5e..08c073badf19 100644
--- a/arch/microblaze/include/asm/dma.h
+++ b/arch/microblaze/include/asm/dma.h
@@ -9,8 +9,13 @@
9#ifndef _ASM_MICROBLAZE_DMA_H 9#ifndef _ASM_MICROBLAZE_DMA_H
10#define _ASM_MICROBLAZE_DMA_H 10#define _ASM_MICROBLAZE_DMA_H
11 11
12#ifndef CONFIG_MMU
12/* we don't have dma address limit. define it as zero to be 13/* we don't have dma address limit. define it as zero to be
13 * unlimited. */ 14 * unlimited. */
14#define MAX_DMA_ADDRESS (0) 15#define MAX_DMA_ADDRESS (0)
16#else
17/* Virtual address corresponding to last available physical memory address. */
18#define MAX_DMA_ADDRESS (CONFIG_KERNEL_START + memory_size - 1)
19#endif
15 20
16#endif /* _ASM_MICROBLAZE_DMA_H */ 21#endif /* _ASM_MICROBLAZE_DMA_H */
diff --git a/arch/microblaze/include/asm/elf.h b/arch/microblaze/include/asm/elf.h
index 81337f241347..f92fc0dda006 100644
--- a/arch/microblaze/include/asm/elf.h
+++ b/arch/microblaze/include/asm/elf.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -27,4 +29,95 @@
27 */ 29 */
28#define ELF_CLASS ELFCLASS32 30#define ELF_CLASS ELFCLASS32
29 31
32#ifndef __uClinux__
33
34/*
35 * ELF register definitions..
36 */
37
38#include <asm/ptrace.h>
39#include <asm/byteorder.h>
40
41#ifndef ELF_GREG_T
42#define ELF_GREG_T
43typedef unsigned long elf_greg_t;
44#endif
45
46#ifndef ELF_NGREG
47#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
48#endif
49
50#ifndef ELF_GREGSET_T
51#define ELF_GREGSET_T
52typedef elf_greg_t elf_gregset_t[ELF_NGREG];
53#endif
54
55#ifndef ELF_FPREGSET_T
56#define ELF_FPREGSET_T
57
58/* TBD */
59#define ELF_NFPREG 33 /* includes fsr */
60typedef unsigned long elf_fpreg_t;
61typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
62
63/* typedef struct user_fpu_struct elf_fpregset_t; */
64#endif
65
66/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
67 * use of this is to invoke "./ld.so someprog" to test out a new version of
68 * the loader. We need to make sure that it is out of the way of the program
69 * that it will "exec", and that there is sufficient room for the brk.
70 */
71
72#define ELF_ET_DYN_BASE (0x08000000)
73
74#ifdef __LITTLE_ENDIAN__
75#define ELF_DATA ELFDATA2LSB
76#else
77#define ELF_DATA ELFDATA2MSB
78#endif
79
80#define USE_ELF_CORE_DUMP
81#define ELF_EXEC_PAGESIZE 4096
82
83
84#define ELF_CORE_COPY_REGS(_dest, _regs) \
85 memcpy((char *) &_dest, (char *) _regs, \
86 sizeof(struct pt_regs));
87
88/* This yields a mask that user programs can use to figure out what
89 * instruction set this CPU supports. This could be done in user space,
90 * but it's not easy, and we've already done it here.
91 */
92#define ELF_HWCAP (0)
93
94/* This yields a string that ld.so will use to load implementation
95 * specific libraries for optimization. This is more specific in
96 * intent than poking at uname or /proc/cpuinfo.
97
98 * For the moment, we have only optimizations for the Intel generations,
99 * but that could change...
100 */
101#define ELF_PLATFORM (NULL)
102
103/* Added _f parameter. Is this definition correct: TBD */
104#define ELF_PLAT_INIT(_r, _f) \
105do { \
106 _r->r1 = _r->r1 = _r->r2 = _r->r3 = \
107 _r->r4 = _r->r5 = _r->r6 = _r->r7 = \
108 _r->r8 = _r->r9 = _r->r10 = _r->r11 = \
109 _r->r12 = _r->r13 = _r->r14 = _r->r15 = \
110 _r->r16 = _r->r17 = _r->r18 = _r->r19 = \
111 _r->r20 = _r->r21 = _r->r22 = _r->r23 = \
112 _r->r24 = _r->r25 = _r->r26 = _r->r27 = \
113 _r->r28 = _r->r29 = _r->r30 = _r->r31 = \
114 0; \
115} while (0)
116
117#ifdef __KERNEL__
118#define SET_PERSONALITY(ex) set_personality(PER_LINUX_32BIT)
119#endif
120
121#endif /* __uClinux__ */
122
30#endif /* _ASM_MICROBLAZE_ELF_H */ 123#endif /* _ASM_MICROBLAZE_ELF_H */
diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h
index e4c3aef884df..61abbd232640 100644
--- a/arch/microblaze/include/asm/entry.h
+++ b/arch/microblaze/include/asm/entry.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * Definitions used by low-level trap handlers 2 * Definitions used by low-level trap handlers
3 * 3 *
4 * Copyright (C) 2008 Michal Simek 4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007 - 2008 PetaLogix 5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com> 6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General 8 * This file is subject to the terms and conditions of the GNU General
@@ -31,7 +31,40 @@ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
31DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ 31DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
32# endif /* __ASSEMBLY__ */ 32# endif /* __ASSEMBLY__ */
33 33
34#ifndef CONFIG_MMU
35
34/* noMMU hasn't any space for args */ 36/* noMMU hasn't any space for args */
35# define STATE_SAVE_ARG_SPACE (0) 37# define STATE_SAVE_ARG_SPACE (0)
36 38
39#else /* CONFIG_MMU */
40
41/* If true, system calls save and restore all registers (except result
42 * registers, of course). If false, then `call clobbered' registers
43 * will not be preserved, on the theory that system calls are basically
44 * function calls anyway, and the caller should be able to deal with it.
45 * This is a security risk, of course, as `internal' values may leak out
46 * after a system call, but that certainly doesn't matter very much for
47 * a processor with no MMU protection! For a protected-mode kernel, it
48 * would be faster to just zero those registers before returning.
49 *
50 * I can not rely on the glibc implementation. If you turn it off make
51 * sure that r11/r12 is saved in user-space. --KAA
52 *
53 * These are special variables using by the kernel trap/interrupt code
54 * to save registers in, at a time when there are no spare registers we
55 * can use to do so, and we can't depend on the value of the stack
56 * pointer. This means that they must be within a signed 16-bit
57 * displacement of 0x00000000.
58 */
59
60/* A `state save frame' is a struct pt_regs preceded by some extra space
61 * suitable for a function call stack frame. */
62
63/* Amount of room on the stack reserved for arguments and to satisfy the
64 * C calling conventions, in addition to the space used by the struct
65 * pt_regs that actually holds saved values. */
66#define STATE_SAVE_ARG_SPACE (6*4) /* Up to six arguments */
67
68#endif /* CONFIG_MMU */
69
37#endif /* _ASM_MICROBLAZE_ENTRY_H */ 70#endif /* _ASM_MICROBLAZE_ENTRY_H */
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
index 24ca540e77c0..90731df9e574 100644
--- a/arch/microblaze/include/asm/exceptions.h
+++ b/arch/microblaze/include/asm/exceptions.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * Preliminary support for HW exception handing for Microblaze 2 * Preliminary support for HW exception handing for Microblaze
3 * 3 *
4 * Copyright (C) 2008 Michal Simek 4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008 PetaLogix 5 * Copyright (C) 2008-2009 PetaLogix
6 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au> 6 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General 8 * This file is subject to the terms and conditions of the GNU General
@@ -64,21 +64,13 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
64void die(const char *str, struct pt_regs *fp, long err); 64void die(const char *str, struct pt_regs *fp, long err);
65void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); 65void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
66 66
67#if defined(CONFIG_XMON) 67#ifdef CONFIG_MMU
68extern void xmon(struct pt_regs *regs); 68void __bug(const char *file, int line, void *data);
69extern int xmon_bpt(struct pt_regs *regs); 69int bad_trap(int trap_num, struct pt_regs *regs);
70extern int xmon_sstep(struct pt_regs *regs); 70int debug_trap(struct pt_regs *regs);
71extern int xmon_iabr_match(struct pt_regs *regs); 71#endif /* CONFIG_MMU */
72extern int xmon_dabr_match(struct pt_regs *regs);
73extern void (*xmon_fault_handler)(struct pt_regs *regs);
74 72
75void (*debugger)(struct pt_regs *regs) = xmon; 73#if defined(CONFIG_KGDB)
76int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
77int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
78int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
79int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
80void (*debugger_fault_handler)(struct pt_regs *regs);
81#elif defined(CONFIG_KGDB)
82void (*debugger)(struct pt_regs *regs); 74void (*debugger)(struct pt_regs *regs);
83int (*debugger_bpt)(struct pt_regs *regs); 75int (*debugger_bpt)(struct pt_regs *regs);
84int (*debugger_sstep)(struct pt_regs *regs); 76int (*debugger_sstep)(struct pt_regs *regs);
diff --git a/arch/microblaze/include/asm/flat.h b/arch/microblaze/include/asm/flat.h
index acf0da543ef1..6847c1512c7b 100644
--- a/arch/microblaze/include/asm/flat.h
+++ b/arch/microblaze/include/asm/flat.h
@@ -13,7 +13,6 @@
13 13
14#include <asm/unaligned.h> 14#include <asm/unaligned.h>
15 15
16#define flat_stack_align(sp) /* nothing needed */
17#define flat_argvp_envp_on_stack() 0 16#define flat_argvp_envp_on_stack() 0
18#define flat_old_ram_flag(flags) (flags) 17#define flat_old_ram_flag(flags) (flags)
19#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 18#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/microblaze/include/asm/gpio.h b/arch/microblaze/include/asm/gpio.h
index ea04632399d8..2345ac354d9b 100644
--- a/arch/microblaze/include/asm/gpio.h
+++ b/arch/microblaze/include/asm/gpio.h
@@ -11,8 +11,8 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#ifndef __ASM_POWERPC_GPIO_H 14#ifndef _ASM_MICROBLAZE_GPIO_H
15#define __ASM_POWERPC_GPIO_H 15#define _ASM_MICROBLAZE_GPIO_H
16 16
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <asm-generic/gpio.h> 18#include <asm-generic/gpio.h>
@@ -53,4 +53,4 @@ static inline int irq_to_gpio(unsigned int irq)
53 53
54#endif /* CONFIG_GPIOLIB */ 54#endif /* CONFIG_GPIOLIB */
55 55
56#endif /* __ASM_POWERPC_GPIO_H */ 56#endif /* _ASM_MICROBLAZE_GPIO_H */
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 8b5853ee6b5c..5c173424d074 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -12,6 +14,9 @@
12#include <asm/byteorder.h> 14#include <asm/byteorder.h>
13#include <asm/page.h> 15#include <asm/page.h>
14#include <linux/types.h> 16#include <linux/types.h>
17#include <asm/byteorder.h>
18#include <linux/mm.h> /* Get struct page {...} */
19
15 20
16#define IO_SPACE_LIMIT (0xFFFFFFFF) 21#define IO_SPACE_LIMIT (0xFFFFFFFF)
17 22
@@ -112,6 +117,30 @@ static inline void writel(unsigned int v, volatile void __iomem *addr)
112#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c)) 117#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c))
113#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c)) 118#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c))
114 119
120#ifdef CONFIG_MMU
121
122#define mm_ptov(addr) ((void *)__phys_to_virt(addr))
123#define mm_vtop(addr) ((unsigned long)__virt_to_phys(addr))
124#define phys_to_virt(addr) ((void *)__phys_to_virt(addr))
125#define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr))
126#define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr))
127
128#define __page_address(page) \
129 (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT))
130#define page_to_phys(page) virt_to_phys((void *)__page_address(page))
131#define page_to_bus(page) (page_to_phys(page))
132#define bus_to_virt(addr) (phys_to_virt(addr))
133
134extern void iounmap(void *addr);
135/*extern void *__ioremap(phys_addr_t address, unsigned long size,
136 unsigned long flags);*/
137extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
138#define ioremap_writethrough(addr, size) ioremap((addr), (size))
139#define ioremap_nocache(addr, size) ioremap((addr), (size))
140#define ioremap_fullcache(addr, size) ioremap((addr), (size))
141
142#else /* CONFIG_MMU */
143
115/** 144/**
116 * virt_to_phys - map virtual addresses to physical 145 * virt_to_phys - map virtual addresses to physical
117 * @address: address to remap 146 * @address: address to remap
@@ -160,6 +189,8 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
160#define iounmap(addr) ((void)0) 189#define iounmap(addr) ((void)0)
161#define ioremap_nocache(physaddr, size) ioremap(physaddr, size) 190#define ioremap_nocache(physaddr, size) ioremap(physaddr, size)
162 191
192#endif /* CONFIG_MMU */
193
163/* 194/*
164 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 195 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
165 * access 196 * access
diff --git a/arch/microblaze/include/asm/mmu.h b/arch/microblaze/include/asm/mmu.h
index 0e0431d61635..66cad6a99d77 100644
--- a/arch/microblaze/include/asm/mmu.h
+++ b/arch/microblaze/include/asm/mmu.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -9,11 +11,109 @@
9#ifndef _ASM_MICROBLAZE_MMU_H 11#ifndef _ASM_MICROBLAZE_MMU_H
10#define _ASM_MICROBLAZE_MMU_H 12#define _ASM_MICROBLAZE_MMU_H
11 13
12#ifndef __ASSEMBLY__ 14# ifndef CONFIG_MMU
15# ifndef __ASSEMBLY__
13typedef struct { 16typedef struct {
14 struct vm_list_struct *vmlist; 17 struct vm_list_struct *vmlist;
15 unsigned long end_brk; 18 unsigned long end_brk;
16} mm_context_t; 19} mm_context_t;
17#endif /* __ASSEMBLY__ */ 20# endif /* __ASSEMBLY__ */
21# else /* CONFIG_MMU */
22# ifdef __KERNEL__
23# ifndef __ASSEMBLY__
18 24
25/* Default "unsigned long" context */
26typedef unsigned long mm_context_t;
27
28/* Hardware Page Table Entry */
29typedef struct _PTE {
30 unsigned long v:1; /* Entry is valid */
31 unsigned long vsid:24; /* Virtual segment identifier */
32 unsigned long h:1; /* Hash algorithm indicator */
33 unsigned long api:6; /* Abbreviated page index */
34 unsigned long rpn:20; /* Real (physical) page number */
35 unsigned long :3; /* Unused */
36 unsigned long r:1; /* Referenced */
37 unsigned long c:1; /* Changed */
38 unsigned long w:1; /* Write-thru cache mode */
39 unsigned long i:1; /* Cache inhibited */
40 unsigned long m:1; /* Memory coherence */
41 unsigned long g:1; /* Guarded */
42 unsigned long :1; /* Unused */
43 unsigned long pp:2; /* Page protection */
44} PTE;
45
46/* Values for PP (assumes Ks=0, Kp=1) */
47# define PP_RWXX 0 /* Supervisor read/write, User none */
48# define PP_RWRX 1 /* Supervisor read/write, User read */
49# define PP_RWRW 2 /* Supervisor read/write, User read/write */
50# define PP_RXRX 3 /* Supervisor read, User read */
51
52/* Segment Register */
53typedef struct _SEGREG {
54 unsigned long t:1; /* Normal or I/O type */
55 unsigned long ks:1; /* Supervisor 'key' (normally 0) */
56 unsigned long kp:1; /* User 'key' (normally 1) */
57 unsigned long n:1; /* No-execute */
58 unsigned long :4; /* Unused */
59 unsigned long vsid:24; /* Virtual Segment Identifier */
60} SEGREG;
61
62extern void _tlbie(unsigned long va); /* invalidate a TLB entry */
63extern void _tlbia(void); /* invalidate all TLB entries */
64# endif /* __ASSEMBLY__ */
65
66/*
67 * The MicroBlaze processor has a TLB architecture identical to PPC-40x. The
68 * instruction and data sides share a unified, 64-entry, semi-associative
69 * TLB which is maintained totally under software control. In addition, the
70 * instruction side has a hardware-managed, 2,4, or 8-entry, fully-associative
71 * TLB which serves as a first level to the shared TLB. These two TLBs are
72 * known as the UTLB and ITLB, respectively.
73 */
74
75# define MICROBLAZE_TLB_SIZE 64
76
77/*
78 * TLB entries are defined by a "high" tag portion and a "low" data
79 * portion. The data portion is 32-bits.
80 *
81 * TLB entries are managed entirely under software control by reading,
82 * writing, and searching using the MTS and MFS instructions.
83 */
84
85# define TLB_LO 1
86# define TLB_HI 0
87# define TLB_DATA TLB_LO
88# define TLB_TAG TLB_HI
89
90/* Tag portion */
91# define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */
92# define TLB_PAGESZ_MASK 0x00000380
93# define TLB_PAGESZ(x) (((x) & 0x7) << 7)
94# define PAGESZ_1K 0
95# define PAGESZ_4K 1
96# define PAGESZ_16K 2
97# define PAGESZ_64K 3
98# define PAGESZ_256K 4
99# define PAGESZ_1M 5
100# define PAGESZ_4M 6
101# define PAGESZ_16M 7
102# define TLB_VALID 0x00000040 /* Entry is valid */
103
104/* Data portion */
105# define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */
106# define TLB_PERM_MASK 0x00000300
107# define TLB_EX 0x00000200 /* Instruction execution allowed */
108# define TLB_WR 0x00000100 /* Writes permitted */
109# define TLB_ZSEL_MASK 0x000000F0
110# define TLB_ZSEL(x) (((x) & 0xF) << 4)
111# define TLB_ATTR_MASK 0x0000000F
112# define TLB_W 0x00000008 /* Caching is write-through */
113# define TLB_I 0x00000004 /* Caching is inhibited */
114# define TLB_M 0x00000002 /* Memory is coherent */
115# define TLB_G 0x00000001 /* Memory is guarded from prefetch */
116
117# endif /* __KERNEL__ */
118# endif /* CONFIG_MMU */
19#endif /* _ASM_MICROBLAZE_MMU_H */ 119#endif /* _ASM_MICROBLAZE_MMU_H */
diff --git a/arch/microblaze/include/asm/mmu_context.h b/arch/microblaze/include/asm/mmu_context.h
index 150ca01b74ba..385fed16bbfb 100644
--- a/arch/microblaze/include/asm/mmu_context.h
+++ b/arch/microblaze/include/asm/mmu_context.h
@@ -1,21 +1,5 @@
1/* 1#ifdef CONFIG_MMU
2 * Copyright (C) 2006 Atmark Techno, Inc. 2# include "mmu_context_mm.h"
3 * 3#else
4 * This file is subject to the terms and conditions of the GNU General Public 4# include "mmu_context_no.h"
5 * License. See the file "COPYING" in the main directory of this archive 5#endif
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
10#define _ASM_MICROBLAZE_MMU_CONTEXT_H
11
12# define init_new_context(tsk, mm) ({ 0; })
13
14# define enter_lazy_tlb(mm, tsk) do {} while (0)
15# define change_mm_context(old, ctx, _pml4) do {} while (0)
16# define destroy_context(mm) do {} while (0)
17# define deactivate_mm(tsk, mm) do {} while (0)
18# define switch_mm(prev, next, tsk) do {} while (0)
19# define activate_mm(prev, next) do {} while (0)
20
21#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze/include/asm/mmu_context_mm.h
new file mode 100644
index 000000000000..3e5c254e8d1c
--- /dev/null
+++ b/arch/microblaze/include/asm/mmu_context_mm.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
12#define _ASM_MICROBLAZE_MMU_CONTEXT_H
13
14#include <asm/atomic.h>
15#include <asm/bitops.h>
16#include <asm/mmu.h>
17#include <asm-generic/mm_hooks.h>
18
19# ifdef __KERNEL__
20/*
21 * This function defines the mapping from contexts to VSIDs (virtual
22 * segment IDs). We use a skew on both the context and the high 4 bits
23 * of the 32-bit virtual address (the "effective segment ID") in order
24 * to spread out the entries in the MMU hash table.
25 */
26# define CTX_TO_VSID(ctx, va) (((ctx) * (897 * 16) + ((va) >> 28) * 0x111) \
27 & 0xffffff)
28
29/*
30 MicroBlaze has 256 contexts, so we can just rotate through these
31 as a way of "switching" contexts. If the TID of the TLB is zero,
32 the PID/TID comparison is disabled, so we can use a TID of zero
33 to represent all kernel pages as shared among all contexts.
34 */
35
36static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
37{
38}
39
40# define NO_CONTEXT 256
41# define LAST_CONTEXT 255
42# define FIRST_CONTEXT 1
43
44/*
45 * Set the current MMU context.
46 * This is done byloading up the segment registers for the user part of the
47 * address space.
48 *
49 * Since the PGD is immediately available, it is much faster to simply
50 * pass this along as a second parameter, which is required for 8xx and
51 * can be used for debugging on all processors (if you happen to have
52 * an Abatron).
53 */
54extern void set_context(mm_context_t context, pgd_t *pgd);
55
56/*
57 * Bitmap of contexts in use.
58 * The size of this bitmap is LAST_CONTEXT + 1 bits.
59 */
60extern unsigned long context_map[];
61
62/*
63 * This caches the next context number that we expect to be free.
64 * Its use is an optimization only, we can't rely on this context
65 * number to be free, but it usually will be.
66 */
67extern mm_context_t next_mmu_context;
68
69/*
70 * Since we don't have sufficient contexts to give one to every task
71 * that could be in the system, we need to be able to steal contexts.
72 * These variables support that.
73 */
74extern atomic_t nr_free_contexts;
75extern struct mm_struct *context_mm[LAST_CONTEXT+1];
76extern void steal_context(void);
77
78/*
79 * Get a new mmu context for the address space described by `mm'.
80 */
81static inline void get_mmu_context(struct mm_struct *mm)
82{
83 mm_context_t ctx;
84
85 if (mm->context != NO_CONTEXT)
86 return;
87 while (atomic_dec_if_positive(&nr_free_contexts) < 0)
88 steal_context();
89 ctx = next_mmu_context;
90 while (test_and_set_bit(ctx, context_map)) {
91 ctx = find_next_zero_bit(context_map, LAST_CONTEXT+1, ctx);
92 if (ctx > LAST_CONTEXT)
93 ctx = 0;
94 }
95 next_mmu_context = (ctx + 1) & LAST_CONTEXT;
96 mm->context = ctx;
97 context_mm[ctx] = mm;
98}
99
100/*
101 * Set up the context for a new address space.
102 */
103# define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0)
104
105/*
106 * We're finished using the context for an address space.
107 */
108static inline void destroy_context(struct mm_struct *mm)
109{
110 if (mm->context != NO_CONTEXT) {
111 clear_bit(mm->context, context_map);
112 mm->context = NO_CONTEXT;
113 atomic_inc(&nr_free_contexts);
114 }
115}
116
117static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
118 struct task_struct *tsk)
119{
120 tsk->thread.pgdir = next->pgd;
121 get_mmu_context(next);
122 set_context(next->context, next->pgd);
123}
124
125/*
126 * After we have set current->mm to a new value, this activates
127 * the context for the new mm so we see the new mappings.
128 */
129static inline void activate_mm(struct mm_struct *active_mm,
130 struct mm_struct *mm)
131{
132 current->thread.pgdir = mm->pgd;
133 get_mmu_context(mm);
134 set_context(mm->context, mm->pgd);
135}
136
137extern void mmu_context_init(void);
138
139# endif /* __KERNEL__ */
140#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/mmu_context_no.h b/arch/microblaze/include/asm/mmu_context_no.h
new file mode 100644
index 000000000000..ba5567190154
--- /dev/null
+++ b/arch/microblaze/include/asm/mmu_context_no.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
12#define _ASM_MICROBLAZE_MMU_CONTEXT_H
13
14# define init_new_context(tsk, mm) ({ 0; })
15
16# define enter_lazy_tlb(mm, tsk) do {} while (0)
17# define change_mm_context(old, ctx, _pml4) do {} while (0)
18# define destroy_context(mm) do {} while (0)
19# define deactivate_mm(tsk, mm) do {} while (0)
20# define switch_mm(prev, next, tsk) do {} while (0)
21# define activate_mm(prev, next) do {} while (0)
22
23#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 7238dcfcc517..72aceae88680 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -1,6 +1,8 @@
1/* 1/*
2 * Copyright (C) 2008 Michal Simek 2 * VM ops
3 * Copyright (C) 2008 PetaLogix 3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc. 6 * Copyright (C) 2006 Atmark Techno, Inc.
5 * Changes for MMU support: 7 * Changes for MMU support:
6 * Copyright (C) 2007 Xilinx, Inc. All rights reserved. 8 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
@@ -15,14 +17,15 @@
15 17
16#include <linux/pfn.h> 18#include <linux/pfn.h>
17#include <asm/setup.h> 19#include <asm/setup.h>
20#include <linux/const.h>
21
22#ifdef __KERNEL__
18 23
19/* PAGE_SHIFT determines the page size */ 24/* PAGE_SHIFT determines the page size */
20#define PAGE_SHIFT (12) 25#define PAGE_SHIFT (12)
21#define PAGE_SIZE (1UL << PAGE_SHIFT) 26#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
22#define PAGE_MASK (~(PAGE_SIZE-1)) 27#define PAGE_MASK (~(PAGE_SIZE-1))
23 28
24#ifdef __KERNEL__
25
26#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
27 30
28#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) 31#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
@@ -35,6 +38,7 @@
35/* align addr on a size boundary - adjust address up if needed */ 38/* align addr on a size boundary - adjust address up if needed */
36#define _ALIGN(addr, size) _ALIGN_UP(addr, size) 39#define _ALIGN(addr, size) _ALIGN_UP(addr, size)
37 40
41#ifndef CONFIG_MMU
38/* 42/*
39 * PAGE_OFFSET -- the first address of the first page of memory. When not 43 * PAGE_OFFSET -- the first address of the first page of memory. When not
40 * using MMU this corresponds to the first free page in physical memory (aligned 44 * using MMU this corresponds to the first free page in physical memory (aligned
@@ -43,15 +47,44 @@
43extern unsigned int __page_offset; 47extern unsigned int __page_offset;
44#define PAGE_OFFSET __page_offset 48#define PAGE_OFFSET __page_offset
45 49
46#define copy_page(to, from) memcpy((to), (from), PAGE_SIZE) 50#else /* CONFIG_MMU */
47#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
48#define free_user_page(page, addr) free_page(addr)
49 51
50#define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE) 52/*
53 * PAGE_OFFSET -- the first address of the first page of memory. With MMU
54 * it is set to the kernel start address (aligned on a page boundary).
55 *
56 * CONFIG_KERNEL_START is defined in arch/microblaze/config.in and used
57 * in arch/microblaze/Makefile.
58 */
59#define PAGE_OFFSET CONFIG_KERNEL_START
51 60
61/*
62 * MAP_NR -- given an address, calculate the index of the page struct which
63 * points to the address's page.
64 */
65#define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
52 66
53#define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE) 67/*
54#define copy_user_page(vto, vfrom, vaddr, topg) \ 68 * The basic type of a PTE - 32 bit physical addressing.
69 */
70typedef unsigned long pte_basic_t;
71#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
72#define PTE_FMT "%.8lx"
73
74#endif /* CONFIG_MMU */
75
76# ifndef CONFIG_MMU
77# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
78# define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
79# define free_user_page(page, addr) free_page(addr)
80# else /* CONFIG_MMU */
81extern void copy_page(void *to, void *from);
82# endif /* CONFIG_MMU */
83
84# define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
85
86# define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
87# define copy_user_page(vto, vfrom, vaddr, topg) \
55 memcpy((vto), (vfrom), PAGE_SIZE) 88 memcpy((vto), (vfrom), PAGE_SIZE)
56 89
57/* 90/*
@@ -60,21 +93,32 @@ extern unsigned int __page_offset;
60typedef struct page *pgtable_t; 93typedef struct page *pgtable_t;
61typedef struct { unsigned long pte; } pte_t; 94typedef struct { unsigned long pte; } pte_t;
62typedef struct { unsigned long pgprot; } pgprot_t; 95typedef struct { unsigned long pgprot; } pgprot_t;
96/* FIXME this can depend on linux kernel version */
97# ifdef CONFIG_MMU
98typedef struct { unsigned long pmd; } pmd_t;
99typedef struct { unsigned long pgd; } pgd_t;
100# else /* CONFIG_MMU */
63typedef struct { unsigned long ste[64]; } pmd_t; 101typedef struct { unsigned long ste[64]; } pmd_t;
64typedef struct { pmd_t pue[1]; } pud_t; 102typedef struct { pmd_t pue[1]; } pud_t;
65typedef struct { pud_t pge[1]; } pgd_t; 103typedef struct { pud_t pge[1]; } pgd_t;
104# endif /* CONFIG_MMU */
66 105
106# define pte_val(x) ((x).pte)
107# define pgprot_val(x) ((x).pgprot)
67 108
68#define pte_val(x) ((x).pte) 109# ifdef CONFIG_MMU
69#define pgprot_val(x) ((x).pgprot) 110# define pmd_val(x) ((x).pmd)
70#define pmd_val(x) ((x).ste[0]) 111# define pgd_val(x) ((x).pgd)
71#define pud_val(x) ((x).pue[0]) 112# else /* CONFIG_MMU */
72#define pgd_val(x) ((x).pge[0]) 113# define pmd_val(x) ((x).ste[0])
114# define pud_val(x) ((x).pue[0])
115# define pgd_val(x) ((x).pge[0])
116# endif /* CONFIG_MMU */
73 117
74#define __pte(x) ((pte_t) { (x) }) 118# define __pte(x) ((pte_t) { (x) })
75#define __pmd(x) ((pmd_t) { (x) }) 119# define __pmd(x) ((pmd_t) { (x) })
76#define __pgd(x) ((pgd_t) { (x) }) 120# define __pgd(x) ((pgd_t) { (x) })
77#define __pgprot(x) ((pgprot_t) { (x) }) 121# define __pgprot(x) ((pgprot_t) { (x) })
78 122
79/** 123/**
80 * Conversions for virtual address, physical address, pfn, and struct 124 * Conversions for virtual address, physical address, pfn, and struct
@@ -94,47 +138,83 @@ extern unsigned long max_low_pfn;
94extern unsigned long min_low_pfn; 138extern unsigned long min_low_pfn;
95extern unsigned long max_pfn; 139extern unsigned long max_pfn;
96 140
97#define __pa(vaddr) ((unsigned long) (vaddr)) 141extern unsigned long memory_start;
98#define __va(paddr) ((void *) (paddr)) 142extern unsigned long memory_end;
143extern unsigned long memory_size;
99 144
100#define phys_to_pfn(phys) (PFN_DOWN(phys)) 145extern int page_is_ram(unsigned long pfn);
101#define pfn_to_phys(pfn) (PFN_PHYS(pfn))
102 146
103#define virt_to_pfn(vaddr) (phys_to_pfn((__pa(vaddr)))) 147# define phys_to_pfn(phys) (PFN_DOWN(phys))
104#define pfn_to_virt(pfn) __va(pfn_to_phys((pfn))) 148# define pfn_to_phys(pfn) (PFN_PHYS(pfn))
105 149
106#define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr))) 150# define virt_to_pfn(vaddr) (phys_to_pfn((__pa(vaddr))))
107#define page_to_virt(page) (pfn_to_virt(page_to_pfn(page))) 151# define pfn_to_virt(pfn) __va(pfn_to_phys((pfn)))
108 152
109#define page_to_phys(page) (pfn_to_phys(page_to_pfn(page))) 153# ifdef CONFIG_MMU
110#define page_to_bus(page) (page_to_phys(page)) 154# define virt_to_page(kaddr) (mem_map + MAP_NR(kaddr))
111#define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr))) 155# else /* CONFIG_MMU */
156# define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
157# define page_to_virt(page) (pfn_to_virt(page_to_pfn(page)))
158# define page_to_phys(page) (pfn_to_phys(page_to_pfn(page)))
159# define page_to_bus(page) (page_to_phys(page))
160# define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr)))
161# endif /* CONFIG_MMU */
112 162
113extern unsigned int memory_start; 163# ifndef CONFIG_MMU
114extern unsigned int memory_end; 164# define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) <= max_mapnr)
115extern unsigned int memory_size; 165# define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
166# else /* CONFIG_MMU */
167# define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT)
168# define pfn_valid(pfn) ((pfn) < (max_mapnr + ARCH_PFN_OFFSET))
169# define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
170# endif /* CONFIG_MMU */
116 171
117#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_mapnr) 172# endif /* __ASSEMBLY__ */
118 173
119#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) 174#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
120 175
121#else
122#define tophys(rd, rs) (addik rd, rs, 0)
123#define tovirt(rd, rs) (addik rd, rs, 0)
124#endif /* __ASSEMBLY__ */
125 176
126#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr))) 177# ifndef CONFIG_MMU
178# define __pa(vaddr) ((unsigned long) (vaddr))
179# define __va(paddr) ((void *) (paddr))
180# else /* CONFIG_MMU */
181# define __pa(x) __virt_to_phys((unsigned long)(x))
182# define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
183# endif /* CONFIG_MMU */
184
127 185
128/* Convert between virtual and physical address for MMU. */ 186/* Convert between virtual and physical address for MMU. */
129/* Handle MicroBlaze processor with virtual memory. */ 187/* Handle MicroBlaze processor with virtual memory. */
188#ifndef CONFIG_MMU
130#define __virt_to_phys(addr) addr 189#define __virt_to_phys(addr) addr
131#define __phys_to_virt(addr) addr 190#define __phys_to_virt(addr) addr
191#define tophys(rd, rs) addik rd, rs, 0
192#define tovirt(rd, rs) addik rd, rs, 0
193#else
194#define __virt_to_phys(addr) \
195 ((addr) + CONFIG_KERNEL_BASE_ADDR - CONFIG_KERNEL_START)
196#define __phys_to_virt(addr) \
197 ((addr) + CONFIG_KERNEL_START - CONFIG_KERNEL_BASE_ADDR)
198#define tophys(rd, rs) \
199 addik rd, rs, (CONFIG_KERNEL_BASE_ADDR - CONFIG_KERNEL_START)
200#define tovirt(rd, rs) \
201 addik rd, rs, (CONFIG_KERNEL_START - CONFIG_KERNEL_BASE_ADDR)
202#endif /* CONFIG_MMU */
132 203
133#define TOPHYS(addr) __virt_to_phys(addr) 204#define TOPHYS(addr) __virt_to_phys(addr)
134 205
206#ifdef CONFIG_MMU
207#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
208#define WANT_PAGE_VIRTUAL 1 /* page alloc 2 relies on this */
209#endif
210
211#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
212 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
213#endif /* CONFIG_MMU */
214
135#endif /* __KERNEL__ */ 215#endif /* __KERNEL__ */
136 216
137#include <asm-generic/memory_model.h> 217#include <asm-generic/memory_model.h>
138#include <asm-generic/page.h> 218#include <asm-generic/getorder.h>
139 219
140#endif /* _ASM_MICROBLAZE_PAGE_H */ 220#endif /* _ASM_MICROBLAZE_PAGE_H */
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index 2a4b35484010..59a757e46ba5 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -9,6 +11,195 @@
9#ifndef _ASM_MICROBLAZE_PGALLOC_H 11#ifndef _ASM_MICROBLAZE_PGALLOC_H
10#define _ASM_MICROBLAZE_PGALLOC_H 12#define _ASM_MICROBLAZE_PGALLOC_H
11 13
14#ifdef CONFIG_MMU
15
16#include <linux/kernel.h> /* For min/max macros */
17#include <linux/highmem.h>
18#include <asm/setup.h>
19#include <asm/io.h>
20#include <asm/page.h>
21#include <asm/cache.h>
22
23#define PGDIR_ORDER 0
24
25/*
26 * This is handled very differently on MicroBlaze since out page tables
27 * are all 0's and I want to be able to use these zero'd pages elsewhere
28 * as well - it gives us quite a speedup.
29 * -- Cort
30 */
31extern struct pgtable_cache_struct {
32 unsigned long *pgd_cache;
33 unsigned long *pte_cache;
34 unsigned long pgtable_cache_sz;
35} quicklists;
36
37#define pgd_quicklist (quicklists.pgd_cache)
38#define pmd_quicklist ((unsigned long *)0)
39#define pte_quicklist (quicklists.pte_cache)
40#define pgtable_cache_size (quicklists.pgtable_cache_sz)
41
42extern unsigned long *zero_cache; /* head linked list of pre-zero'd pages */
43extern atomic_t zero_sz; /* # currently pre-zero'd pages */
44extern atomic_t zeropage_hits; /* # zero'd pages request that we've done */
45extern atomic_t zeropage_calls; /* # zero'd pages request that've been made */
46extern atomic_t zerototal; /* # pages zero'd over time */
47
48#define zero_quicklist (zero_cache)
49#define zero_cache_sz (zero_sz)
50#define zero_cache_calls (zeropage_calls)
51#define zero_cache_hits (zeropage_hits)
52#define zero_cache_total (zerototal)
53
54/*
55 * return a pre-zero'd page from the list,
56 * return NULL if none available -- Cort
57 */
58extern unsigned long get_zero_page_fast(void);
59
60extern void __bad_pte(pmd_t *pmd);
61
62extern inline pgd_t *get_pgd_slow(void)
63{
64 pgd_t *ret;
65
66 ret = (pgd_t *)__get_free_pages(GFP_KERNEL, PGDIR_ORDER);
67 if (ret != NULL)
68 clear_page(ret);
69 return ret;
70}
71
72extern inline pgd_t *get_pgd_fast(void)
73{
74 unsigned long *ret;
75
76 ret = pgd_quicklist;
77 if (ret != NULL) {
78 pgd_quicklist = (unsigned long *)(*ret);
79 ret[0] = 0;
80 pgtable_cache_size--;
81 } else
82 ret = (unsigned long *)get_pgd_slow();
83 return (pgd_t *)ret;
84}
85
86extern inline void free_pgd_fast(pgd_t *pgd)
87{
88 *(unsigned long **)pgd = pgd_quicklist;
89 pgd_quicklist = (unsigned long *) pgd;
90 pgtable_cache_size++;
91}
92
93extern inline void free_pgd_slow(pgd_t *pgd)
94{
95 free_page((unsigned long)pgd);
96}
97
98#define pgd_free(mm, pgd) free_pgd_fast(pgd)
99#define pgd_alloc(mm) get_pgd_fast()
100
101#define pmd_pgtable(pmd) pmd_page(pmd)
102
103/*
104 * We don't have any real pmd's, and this code never triggers because
105 * the pgd will always be present..
106 */
107#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
108#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
109/* FIXME two definition - look below */
110#define pmd_free(mm, x) do { } while (0)
111#define pgd_populate(mm, pmd, pte) BUG()
112
113static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
114 unsigned long address)
115{
116 pte_t *pte;
117 extern int mem_init_done;
118 extern void *early_get_page(void);
119 if (mem_init_done) {
120 pte = (pte_t *)__get_free_page(GFP_KERNEL |
121 __GFP_REPEAT | __GFP_ZERO);
122 } else {
123 pte = (pte_t *)early_get_page();
124 if (pte)
125 clear_page(pte);
126 }
127 return pte;
128}
129
130static inline struct page *pte_alloc_one(struct mm_struct *mm,
131 unsigned long address)
132{
133 struct page *ptepage;
134
135#ifdef CONFIG_HIGHPTE
136 int flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
137#else
138 int flags = GFP_KERNEL | __GFP_REPEAT;
139#endif
140
141 ptepage = alloc_pages(flags, 0);
142 if (ptepage)
143 clear_highpage(ptepage);
144 return ptepage;
145}
146
147static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm,
148 unsigned long address)
149{
150 unsigned long *ret;
151
152 ret = pte_quicklist;
153 if (ret != NULL) {
154 pte_quicklist = (unsigned long *)(*ret);
155 ret[0] = 0;
156 pgtable_cache_size--;
157 }
158 return (pte_t *)ret;
159}
160
161extern inline void pte_free_fast(pte_t *pte)
162{
163 *(unsigned long **)pte = pte_quicklist;
164 pte_quicklist = (unsigned long *) pte;
165 pgtable_cache_size++;
166}
167
168extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
169{
170 free_page((unsigned long)pte);
171}
172
173extern inline void pte_free_slow(struct page *ptepage)
174{
175 __free_page(ptepage);
176}
177
178extern inline void pte_free(struct mm_struct *mm, struct page *ptepage)
179{
180 __free_page(ptepage);
181}
182
183#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte))
184
185#define pmd_populate(mm, pmd, pte) (pmd_val(*(pmd)) = page_address(pte))
186
187#define pmd_populate_kernel(mm, pmd, pte) \
188 (pmd_val(*(pmd)) = (unsigned long) (pte))
189
190/*
191 * We don't have any real pmd's, and this code never triggers because
192 * the pgd will always be present..
193 */
194#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
195/*#define pmd_free(mm, x) do { } while (0)*/
196#define __pmd_free_tlb(tlb, x) do { } while (0)
197#define pgd_populate(mm, pmd, pte) BUG()
198
199extern int do_check_pgt_cache(int, int);
200
201#endif /* CONFIG_MMU */
202
12#define check_pgt_cache() do {} while (0) 203#define check_pgt_cache() do {} while (0)
13 204
14#endif /* _ASM_MICROBLAZE_PGALLOC_H */ 205#endif /* _ASM_MICROBLAZE_PGALLOC_H */
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index 4df31e46568e..4c57a586a989 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -14,6 +16,8 @@
14#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 16#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
15 remap_pfn_range(vma, vaddr, pfn, size, prot) 17 remap_pfn_range(vma, vaddr, pfn, size, prot)
16 18
19#ifndef CONFIG_MMU
20
17#define pgd_present(pgd) (1) /* pages are always present on non MMU */ 21#define pgd_present(pgd) (1) /* pages are always present on non MMU */
18#define pgd_none(pgd) (0) 22#define pgd_none(pgd) (0)
19#define pgd_bad(pgd) (0) 23#define pgd_bad(pgd) (0)
@@ -27,6 +31,8 @@
27#define PAGE_READONLY __pgprot(0) /* these mean nothing to non MMU */ 31#define PAGE_READONLY __pgprot(0) /* these mean nothing to non MMU */
28#define PAGE_KERNEL __pgprot(0) /* these mean nothing to non MMU */ 32#define PAGE_KERNEL __pgprot(0) /* these mean nothing to non MMU */
29 33
34#define pgprot_noncached(x) (x)
35
30#define __swp_type(x) (0) 36#define __swp_type(x) (0)
31#define __swp_offset(x) (0) 37#define __swp_offset(x) (0)
32#define __swp_entry(typ, off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) 38#define __swp_entry(typ, off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
@@ -45,6 +51,538 @@ static inline int pte_file(pte_t pte) { return 0; }
45 51
46#define arch_enter_lazy_cpu_mode() do {} while (0) 52#define arch_enter_lazy_cpu_mode() do {} while (0)
47 53
54#else /* CONFIG_MMU */
55
56#include <asm-generic/4level-fixup.h>
57
58#ifdef __KERNEL__
59#ifndef __ASSEMBLY__
60
61#include <linux/sched.h>
62#include <linux/threads.h>
63#include <asm/processor.h> /* For TASK_SIZE */
64#include <asm/mmu.h>
65#include <asm/page.h>
66
67#define FIRST_USER_ADDRESS 0
68
69extern unsigned long va_to_phys(unsigned long address);
70extern pte_t *va_to_pte(unsigned long address);
71extern unsigned long ioremap_bot, ioremap_base;
72
73/*
74 * The following only work if pte_present() is true.
75 * Undefined behaviour if not..
76 */
77
78static inline int pte_special(pte_t pte) { return 0; }
79
80static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
81
82/* Start and end of the vmalloc area. */
83/* Make sure to map the vmalloc area above the pinned kernel memory area
84 of 32Mb. */
85#define VMALLOC_START (CONFIG_KERNEL_START + \
86 max(32 * 1024 * 1024UL, memory_size))
87#define VMALLOC_END ioremap_bot
88#define VMALLOC_VMADDR(x) ((unsigned long)(x))
89
90#endif /* __ASSEMBLY__ */
91
92/*
93 * The MicroBlaze MMU is identical to the PPC-40x MMU, and uses a hash
94 * table containing PTEs, together with a set of 16 segment registers, to
95 * define the virtual to physical address mapping.
96 *
97 * We use the hash table as an extended TLB, i.e. a cache of currently
98 * active mappings. We maintain a two-level page table tree, much
99 * like that used by the i386, for the sake of the Linux memory
100 * management code. Low-level assembler code in hashtable.S
101 * (procedure hash_page) is responsible for extracting ptes from the
102 * tree and putting them into the hash table when necessary, and
103 * updating the accessed and modified bits in the page table tree.
104 */
105
106/*
107 * The MicroBlaze processor has a TLB architecture identical to PPC-40x. The
108 * instruction and data sides share a unified, 64-entry, semi-associative
109 * TLB which is maintained totally under software control. In addition, the
110 * instruction side has a hardware-managed, 2,4, or 8-entry, fully-associative
111 * TLB which serves as a first level to the shared TLB. These two TLBs are
112 * known as the UTLB and ITLB, respectively (see "mmu.h" for definitions).
113 */
114
115/*
116 * The normal case is that PTEs are 32-bits and we have a 1-page
117 * 1024-entry pgdir pointing to 1-page 1024-entry PTE pages. -- paulus
118 *
119 */
120
121/* PMD_SHIFT determines the size of the area mapped by the PTE pages */
122#define PMD_SHIFT (PAGE_SHIFT + PTE_SHIFT)
123#define PMD_SIZE (1UL << PMD_SHIFT)
124#define PMD_MASK (~(PMD_SIZE-1))
125
126/* PGDIR_SHIFT determines what a top-level page table entry can map */
127#define PGDIR_SHIFT PMD_SHIFT
128#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
129#define PGDIR_MASK (~(PGDIR_SIZE-1))
130
131/*
132 * entries per page directory level: our page-table tree is two-level, so
133 * we don't really have any PMD directory.
134 */
135#define PTRS_PER_PTE (1 << PTE_SHIFT)
136#define PTRS_PER_PMD 1
137#define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT))
138
139#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
140#define FIRST_USER_PGD_NR 0
141
142#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
143#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
144
145#define pte_ERROR(e) \
146 printk(KERN_ERR "%s:%d: bad pte "PTE_FMT".\n", \
147 __FILE__, __LINE__, pte_val(e))
148#define pmd_ERROR(e) \
149 printk(KERN_ERR "%s:%d: bad pmd %08lx.\n", \
150 __FILE__, __LINE__, pmd_val(e))
151#define pgd_ERROR(e) \
152 printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \
153 __FILE__, __LINE__, pgd_val(e))
154
155/*
156 * Bits in a linux-style PTE. These match the bits in the
157 * (hardware-defined) PTE as closely as possible.
158 */
159
160/* There are several potential gotchas here. The hardware TLBLO
161 * field looks like this:
162 *
163 * 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31
164 * RPN..................... 0 0 EX WR ZSEL....... W I M G
165 *
166 * Where possible we make the Linux PTE bits match up with this
167 *
168 * - bits 20 and 21 must be cleared, because we use 4k pages (4xx can
169 * support down to 1k pages), this is done in the TLBMiss exception
170 * handler.
171 * - We use only zones 0 (for kernel pages) and 1 (for user pages)
172 * of the 16 available. Bit 24-26 of the TLB are cleared in the TLB
173 * miss handler. Bit 27 is PAGE_USER, thus selecting the correct
174 * zone.
175 * - PRESENT *must* be in the bottom two bits because swap cache
176 * entries use the top 30 bits. Because 4xx doesn't support SMP
177 * anyway, M is irrelevant so we borrow it for PAGE_PRESENT. Bit 30
178 * is cleared in the TLB miss handler before the TLB entry is loaded.
179 * - All other bits of the PTE are loaded into TLBLO without
180 * * modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for
181 * software PTE bits. We actually use use bits 21, 24, 25, and
182 * 30 respectively for the software bits: ACCESSED, DIRTY, RW, and
183 * PRESENT.
184 */
185
186/* Definitions for MicroBlaze. */
187#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
188#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
189#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
190#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
191#define _PAGE_USER 0x010 /* matches one of the zone permission bits */
192#define _PAGE_RW 0x040 /* software: Writes permitted */
193#define _PAGE_DIRTY 0x080 /* software: dirty page */
194#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */
195#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */
196#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
197#define _PMD_PRESENT PAGE_MASK
198
199/*
200 * Some bits are unused...
201 */
202#ifndef _PAGE_HASHPTE
203#define _PAGE_HASHPTE 0
204#endif
205#ifndef _PTE_NONE_MASK
206#define _PTE_NONE_MASK 0
207#endif
208#ifndef _PAGE_SHARED
209#define _PAGE_SHARED 0
210#endif
211#ifndef _PAGE_HWWRITE
212#define _PAGE_HWWRITE 0
213#endif
214#ifndef _PAGE_HWEXEC
215#define _PAGE_HWEXEC 0
216#endif
217#ifndef _PAGE_EXEC
218#define _PAGE_EXEC 0
219#endif
220
221#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
222
223/*
224 * Note: the _PAGE_COHERENT bit automatically gets set in the hardware
225 * PTE if CONFIG_SMP is defined (hash_page does this); there is no need
226 * to have it in the Linux PTE, and in fact the bit could be reused for
227 * another purpose. -- paulus.
228 */
229#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED)
230#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE)
231
232#define _PAGE_KERNEL \
233 (_PAGE_BASE | _PAGE_WRENABLE | _PAGE_SHARED | _PAGE_HWEXEC)
234
235#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
236
237#define PAGE_NONE __pgprot(_PAGE_BASE)
238#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
239#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
240#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
241#define PAGE_SHARED_X \
242 __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
243#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
244#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
245
246#define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
247#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_SHARED)
248#define PAGE_KERNEL_CI __pgprot(_PAGE_IO)
249
250/*
251 * We consider execute permission the same as read.
252 * Also, write permissions imply read permissions.
253 */
254#define __P000 PAGE_NONE
255#define __P001 PAGE_READONLY_X
256#define __P010 PAGE_COPY
257#define __P011 PAGE_COPY_X
258#define __P100 PAGE_READONLY
259#define __P101 PAGE_READONLY_X
260#define __P110 PAGE_COPY
261#define __P111 PAGE_COPY_X
262
263#define __S000 PAGE_NONE
264#define __S001 PAGE_READONLY_X
265#define __S010 PAGE_SHARED
266#define __S011 PAGE_SHARED_X
267#define __S100 PAGE_READONLY
268#define __S101 PAGE_READONLY_X
269#define __S110 PAGE_SHARED
270#define __S111 PAGE_SHARED_X
271
272#ifndef __ASSEMBLY__
273/*
274 * ZERO_PAGE is a global shared page that is always zero: used
275 * for zero-mapped memory areas etc..
276 */
277extern unsigned long empty_zero_page[1024];
278#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
279
280#endif /* __ASSEMBLY__ */
281
282#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
283#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
284#define pte_clear(mm, addr, ptep) \
285 do { set_pte_at((mm), (addr), (ptep), __pte(0)); } while (0)
286
287#define pmd_none(pmd) (!pmd_val(pmd))
288#define pmd_bad(pmd) ((pmd_val(pmd) & _PMD_PRESENT) == 0)
289#define pmd_present(pmd) ((pmd_val(pmd) & _PMD_PRESENT) != 0)
290#define pmd_clear(pmdp) do { pmd_val(*(pmdp)) = 0; } while (0)
291
292#define pte_page(x) (mem_map + (unsigned long) \
293 ((pte_val(x) - memory_start) >> PAGE_SHIFT))
294#define PFN_SHIFT_OFFSET (PAGE_SHIFT)
295
296#define pte_pfn(x) (pte_val(x) >> PFN_SHIFT_OFFSET)
297
298#define pfn_pte(pfn, prot) \
299 __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) | pgprot_val(prot))
300
301#ifndef __ASSEMBLY__
302/*
303 * The "pgd_xxx()" functions here are trivial for a folded two-level
304 * setup: the pgd is never bad, and a pmd always exists (as it's folded
305 * into the pgd entry)
306 */
307static inline int pgd_none(pgd_t pgd) { return 0; }
308static inline int pgd_bad(pgd_t pgd) { return 0; }
309static inline int pgd_present(pgd_t pgd) { return 1; }
310#define pgd_clear(xp) do { } while (0)
311#define pgd_page(pgd) \
312 ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
313
314/*
315 * The following only work if pte_present() is true.
316 * Undefined behaviour if not..
317 */
318static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
319static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
320static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
321static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
322static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
323/* FIXME */
324static inline int pte_file(pte_t pte) { return 0; }
325
326static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
327static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
328
329static inline pte_t pte_rdprotect(pte_t pte) \
330 { pte_val(pte) &= ~_PAGE_USER; return pte; }
331static inline pte_t pte_wrprotect(pte_t pte) \
332 { pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
333static inline pte_t pte_exprotect(pte_t pte) \
334 { pte_val(pte) &= ~_PAGE_EXEC; return pte; }
335static inline pte_t pte_mkclean(pte_t pte) \
336 { pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
337static inline pte_t pte_mkold(pte_t pte) \
338 { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
339
340static inline pte_t pte_mkread(pte_t pte) \
341 { pte_val(pte) |= _PAGE_USER; return pte; }
342static inline pte_t pte_mkexec(pte_t pte) \
343 { pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
344static inline pte_t pte_mkwrite(pte_t pte) \
345 { pte_val(pte) |= _PAGE_RW; return pte; }
346static inline pte_t pte_mkdirty(pte_t pte) \
347 { pte_val(pte) |= _PAGE_DIRTY; return pte; }
348static inline pte_t pte_mkyoung(pte_t pte) \
349 { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
350
351/*
352 * Conversion functions: convert a page and protection to a page entry,
353 * and a page entry and page directory to the page they refer to.
354 */
355
356static inline pte_t mk_pte_phys(phys_addr_t physpage, pgprot_t pgprot)
357{
358 pte_t pte;
359 pte_val(pte) = physpage | pgprot_val(pgprot);
360 return pte;
361}
362
363#define mk_pte(page, pgprot) \
364({ \
365 pte_t pte; \
366 pte_val(pte) = (((page - mem_map) << PAGE_SHIFT) + memory_start) | \
367 pgprot_val(pgprot); \
368 pte; \
369})
370
371static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
372{
373 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
374 return pte;
375}
376
377/*
378 * Atomic PTE updates.
379 *
380 * pte_update clears and sets bit atomically, and returns
381 * the old pte value.
382 * The ((unsigned long)(p+1) - 4) hack is to get to the least-significant
383 * 32 bits of the PTE regardless of whether PTEs are 32 or 64 bits.
384 */
385static inline unsigned long pte_update(pte_t *p, unsigned long clr,
386 unsigned long set)
387{
388 unsigned long old, tmp, msr;
389
390 __asm__ __volatile__("\
391 msrclr %2, 0x2\n\
392 nop\n\
393 lw %0, %4, r0\n\
394 andn %1, %0, %5\n\
395 or %1, %1, %6\n\
396 sw %1, %4, r0\n\
397 mts rmsr, %2\n\
398 nop"
399 : "=&r" (old), "=&r" (tmp), "=&r" (msr), "=m" (*p)
400 : "r" ((unsigned long)(p+1) - 4), "r" (clr), "r" (set), "m" (*p)
401 : "cc");
402
403 return old;
404}
405
406/*
407 * set_pte stores a linux PTE into the linux page table.
408 */
409static inline void set_pte(struct mm_struct *mm, unsigned long addr,
410 pte_t *ptep, pte_t pte)
411{
412 *ptep = pte;
413}
414
415static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
416 pte_t *ptep, pte_t pte)
417{
418 *ptep = pte;
419}
420
421static inline int ptep_test_and_clear_young(struct mm_struct *mm,
422 unsigned long addr, pte_t *ptep)
423{
424 return (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED) != 0;
425}
426
427static inline int ptep_test_and_clear_dirty(struct mm_struct *mm,
428 unsigned long addr, pte_t *ptep)
429{
430 return (pte_update(ptep, \
431 (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
432}
433
434static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
435 unsigned long addr, pte_t *ptep)
436{
437 return __pte(pte_update(ptep, ~_PAGE_HASHPTE, 0));
438}
439
440/*static inline void ptep_set_wrprotect(struct mm_struct *mm,
441 unsigned long addr, pte_t *ptep)
442{
443 pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), 0);
444}*/
445
446static inline void ptep_mkdirty(struct mm_struct *mm,
447 unsigned long addr, pte_t *ptep)
448{
449 pte_update(ptep, 0, _PAGE_DIRTY);
450}
451
452/*#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)*/
453
454/* Convert pmd entry to page */
455/* our pmd entry is an effective address of pte table*/
456/* returns effective address of the pmd entry*/
457#define pmd_page_kernel(pmd) ((unsigned long) (pmd_val(pmd) & PAGE_MASK))
458
459/* returns struct *page of the pmd entry*/
460#define pmd_page(pmd) (pfn_to_page(__pa(pmd_val(pmd)) >> PAGE_SHIFT))
461
462/* to find an entry in a kernel page-table-directory */
463#define pgd_offset_k(address) pgd_offset(&init_mm, address)
464
465/* to find an entry in a page-table-directory */
466#define pgd_index(address) ((address) >> PGDIR_SHIFT)
467#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
468
469/* Find an entry in the second-level page table.. */
470static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
471{
472 return (pmd_t *) dir;
473}
474
475/* Find an entry in the third-level page table.. */
476#define pte_index(address) \
477 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
478#define pte_offset_kernel(dir, addr) \
479 ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(addr))
480#define pte_offset_map(dir, addr) \
481 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
482#define pte_offset_map_nested(dir, addr) \
483 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
484
485#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
486#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
487
488/* Encode and decode a nonlinear file mapping entry */
489#define PTE_FILE_MAX_BITS 29
490#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
491#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) })
492
493extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
494
495/*
496 * When flushing the tlb entry for a page, we also need to flush the hash
497 * table entry. flush_hash_page is assembler (for speed) in hashtable.S.
498 */
499extern int flush_hash_page(unsigned context, unsigned long va, pte_t *ptep);
500
501/* Add an HPTE to the hash table */
502extern void add_hash_page(unsigned context, unsigned long va, pte_t *ptep);
503
504/*
505 * Encode and decode a swap entry.
506 * Note that the bits we use in a PTE for representing a swap entry
507 * must not include the _PAGE_PRESENT bit, or the _PAGE_HASHPTE bit
508 * (if used). -- paulus
509 */
510#define __swp_type(entry) ((entry).val & 0x3f)
511#define __swp_offset(entry) ((entry).val >> 6)
512#define __swp_entry(type, offset) \
513 ((swp_entry_t) { (type) | ((offset) << 6) })
514#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 2 })
515#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 2 })
516
517
518/* CONFIG_APUS */
519/* For virtual address to physical address conversion */
520extern void cache_clear(__u32 addr, int length);
521extern void cache_push(__u32 addr, int length);
522extern int mm_end_of_chunk(unsigned long addr, int len);
523extern unsigned long iopa(unsigned long addr);
524/* extern unsigned long mm_ptov(unsigned long addr) \
525 __attribute__ ((const)); TBD */
526
527/* Values for nocacheflag and cmode */
528/* These are not used by the APUS kernel_map, but prevents
529 * compilation errors.
530 */
531#define IOMAP_FULL_CACHING 0
532#define IOMAP_NOCACHE_SER 1
533#define IOMAP_NOCACHE_NONSER 2
534#define IOMAP_NO_COPYBACK 3
535
536/*
537 * Map some physical address range into the kernel address space.
538 */
539extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
540 int nocacheflag, unsigned long *memavailp);
541
542/*
543 * Set cache mode of (kernel space) address range.
544 */
545extern void kernel_set_cachemode(unsigned long address, unsigned long size,
546 unsigned int cmode);
547
548/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
549#define kern_addr_valid(addr) (1)
550
551#define io_remap_page_range remap_page_range
552
553/*
554 * No page table caches to initialise
555 */
556#define pgtable_cache_init() do { } while (0)
557
558void do_page_fault(struct pt_regs *regs, unsigned long address,
559 unsigned long error_code);
560
561void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
562 unsigned int size, int flags);
563
564void __init adjust_total_lowmem(void);
565void mapin_ram(void);
566int map_page(unsigned long va, phys_addr_t pa, int flags);
567
568extern int mem_init_done;
569extern unsigned long ioremap_base;
570extern unsigned long ioremap_bot;
571
572asmlinkage void __init mmu_init(void);
573
574void __init *early_get_page(void);
575
576void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle);
577void consistent_free(void *vaddr);
578void consistent_sync(void *vaddr, size_t size, int direction);
579void consistent_sync_page(struct page *page, unsigned long offset,
580 size_t size, int direction);
581#endif /* __ASSEMBLY__ */
582#endif /* __KERNEL__ */
583
584#endif /* CONFIG_MMU */
585
48#ifndef __ASSEMBLY__ 586#ifndef __ASSEMBLY__
49#include <asm-generic/pgtable.h> 587#include <asm-generic/pgtable.h>
50 588
diff --git a/arch/microblaze/include/asm/posix_types.h b/arch/microblaze/include/asm/posix_types.h
index b4df41c5dde2..8c758b231f37 100644
--- a/arch/microblaze/include/asm/posix_types.h
+++ b/arch/microblaze/include/asm/posix_types.h
@@ -16,7 +16,7 @@
16 */ 16 */
17 17
18typedef unsigned long __kernel_ino_t; 18typedef unsigned long __kernel_ino_t;
19typedef unsigned int __kernel_mode_t; 19typedef unsigned short __kernel_mode_t;
20typedef unsigned int __kernel_nlink_t; 20typedef unsigned int __kernel_nlink_t;
21typedef long __kernel_off_t; 21typedef long __kernel_off_t;
22typedef int __kernel_pid_t; 22typedef int __kernel_pid_t;
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 9329029d2614..563c6b9453f0 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008 Michal Simek 2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008 PetaLogix 3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -26,14 +26,15 @@ extern const struct seq_operations cpuinfo_op;
26# define cpu_sleep() do {} while (0) 26# define cpu_sleep() do {} while (0)
27# define prepare_to_copy(tsk) do {} while (0) 27# define prepare_to_copy(tsk) do {} while (0)
28 28
29# endif /* __ASSEMBLY__ */
30
31#define task_pt_regs(tsk) \ 29#define task_pt_regs(tsk) \
32 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) 30 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
33 31
34/* Do necessary setup to start up a newly executed thread. */ 32/* Do necessary setup to start up a newly executed thread. */
35void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp); 33void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp);
36 34
35# endif /* __ASSEMBLY__ */
36
37# ifndef CONFIG_MMU
37/* 38/*
38 * User space process size: memory size 39 * User space process size: memory size
39 * 40 *
@@ -85,4 +86,90 @@ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
85# define KSTK_EIP(tsk) (0) 86# define KSTK_EIP(tsk) (0)
86# define KSTK_ESP(tsk) (0) 87# define KSTK_ESP(tsk) (0)
87 88
89# else /* CONFIG_MMU */
90
91/*
92 * This is used to define STACK_TOP, and with MMU it must be below
93 * kernel base to select the correct PGD when handling MMU exceptions.
94 */
95# define TASK_SIZE (CONFIG_KERNEL_START)
96
97/*
98 * This decides where the kernel will search for a free chunk of vm
99 * space during mmap's.
100 */
101# define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)
102
103# define THREAD_KSP 0
104
105# ifndef __ASSEMBLY__
106
107/*
108 * Default implementation of macro that returns current
109 * instruction pointer ("program counter").
110 */
111# define current_text_addr() ({ __label__ _l; _l: &&_l; })
112
113/* If you change this, you must change the associated assembly-languages
114 * constants defined below, THREAD_*.
115 */
116struct thread_struct {
117 /* kernel stack pointer (must be first field in structure) */
118 unsigned long ksp;
119 unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */
120 void *pgdir; /* root of page-table tree */
121 struct pt_regs *regs; /* Pointer to saved register state */
122};
123
124# define INIT_THREAD { \
125 .ksp = sizeof init_stack + (unsigned long)init_stack, \
126 .pgdir = swapper_pg_dir, \
127}
128
129/* Do necessary setup to start up a newly executed thread. */
130void start_thread(struct pt_regs *regs,
131 unsigned long pc, unsigned long usp);
132
133/* Free all resources held by a thread. */
134extern inline void release_thread(struct task_struct *dead_task)
135{
136}
137
138extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
139
140/* Free current thread data structures etc. */
141static inline void exit_thread(void)
142{
143}
144
145/* Return saved (kernel) PC of a blocked thread. */
146# define thread_saved_pc(tsk) \
147 ((tsk)->thread.regs ? (tsk)->thread.regs->r15 : 0)
148
149unsigned long get_wchan(struct task_struct *p);
150
151/* The size allocated for kernel stacks. This _must_ be a power of two! */
152# define KERNEL_STACK_SIZE 0x2000
153
154/* Return some info about the user process TASK. */
155# define task_tos(task) ((unsigned long)(task) + KERNEL_STACK_SIZE)
156# define task_regs(task) ((struct pt_regs *)task_tos(task) - 1)
157
158# define task_pt_regs_plus_args(tsk) \
159 (((void *)task_pt_regs(tsk)) - STATE_SAVE_ARG_SPACE)
160
161# define task_sp(task) (task_regs(task)->r1)
162# define task_pc(task) (task_regs(task)->pc)
163/* Grotty old names for some. */
164# define KSTK_EIP(task) (task_pc(task))
165# define KSTK_ESP(task) (task_sp(task))
166
167/* FIXME */
168# define deactivate_mm(tsk, mm) do { } while (0)
169
170# define STACK_TOP TASK_SIZE
171# define STACK_TOP_MAX STACK_TOP
172
173# endif /* __ASSEMBLY__ */
174# endif /* CONFIG_MMU */
88#endif /* _ASM_MICROBLAZE_PROCESSOR_H */ 175#endif /* _ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h
index 55015bce5e47..a917dc517736 100644
--- a/arch/microblaze/include/asm/ptrace.h
+++ b/arch/microblaze/include/asm/ptrace.h
@@ -10,7 +10,6 @@
10#define _ASM_MICROBLAZE_PTRACE_H 10#define _ASM_MICROBLAZE_PTRACE_H
11 11
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13#include <linux/types.h>
14 13
15typedef unsigned long microblaze_reg_t; 14typedef unsigned long microblaze_reg_t;
16 15
diff --git a/arch/microblaze/include/asm/registers.h b/arch/microblaze/include/asm/registers.h
index 834142d9356f..68c3afb73877 100644
--- a/arch/microblaze/include/asm/registers.h
+++ b/arch/microblaze/include/asm/registers.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008 Michal Simek 2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008 PetaLogix 3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -30,4 +30,21 @@
30#define FSR_UF (1<<1) /* Underflow */ 30#define FSR_UF (1<<1) /* Underflow */
31#define FSR_DO (1<<0) /* Denormalized operand error */ 31#define FSR_DO (1<<0) /* Denormalized operand error */
32 32
33# ifdef CONFIG_MMU
34/* Machine State Register (MSR) Fields */
35# define MSR_UM (1<<11) /* User Mode */
36# define MSR_UMS (1<<12) /* User Mode Save */
37# define MSR_VM (1<<13) /* Virtual Mode */
38# define MSR_VMS (1<<14) /* Virtual Mode Save */
39
40# define MSR_KERNEL (MSR_EE | MSR_VM)
41/* # define MSR_USER (MSR_KERNEL | MSR_UM | MSR_IE) */
42# define MSR_KERNEL_VMS (MSR_EE | MSR_VMS)
43/* # define MSR_USER_VMS (MSR_KERNEL_VMS | MSR_UMS | MSR_IE) */
44
45/* Exception State Register (ESR) Fields */
46# define ESR_DIZ (1<<11) /* Zone Protection */
47# define ESR_S (1<<10) /* Store instruction */
48
49# endif /* CONFIG_MMU */
33#endif /* _ASM_MICROBLAZE_REGISTERS_H */ 50#endif /* _ASM_MICROBLAZE_REGISTERS_H */
diff --git a/arch/microblaze/include/asm/sections.h b/arch/microblaze/include/asm/sections.h
index 8434a43e5421..4487e150b455 100644
--- a/arch/microblaze/include/asm/sections.h
+++ b/arch/microblaze/include/asm/sections.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -14,6 +16,7 @@
14# ifndef __ASSEMBLY__ 16# ifndef __ASSEMBLY__
15extern char _ssbss[], _esbss[]; 17extern char _ssbss[], _esbss[];
16extern unsigned long __ivt_start[], __ivt_end[]; 18extern unsigned long __ivt_start[], __ivt_end[];
19extern char _etext[], _stext[];
17 20
18# ifdef CONFIG_MTD_UCLINUX 21# ifdef CONFIG_MTD_UCLINUX
19extern char *_ebss; 22extern char *_ebss;
diff --git a/arch/microblaze/include/asm/segment.h b/arch/microblaze/include/asm/segment.h
index 7f5dcc56eea1..0e7102c3fb11 100644
--- a/arch/microblaze/include/asm/segment.h
+++ b/arch/microblaze/include/asm/segment.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008 Michal Simek 2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008 PetaLogix 3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -11,7 +11,7 @@
11#ifndef _ASM_MICROBLAZE_SEGMENT_H 11#ifndef _ASM_MICROBLAZE_SEGMENT_H
12#define _ASM_MICROBLAZE_SEGMENT_H 12#define _ASM_MICROBLAZE_SEGMENT_H
13 13
14#ifndef __ASSEMBLY__ 14# ifndef __ASSEMBLY__
15 15
16typedef struct { 16typedef struct {
17 unsigned long seg; 17 unsigned long seg;
@@ -29,15 +29,21 @@ typedef struct {
29 * 29 *
30 * For non-MMU arch like Microblaze, KERNEL_DS and USER_DS is equal. 30 * For non-MMU arch like Microblaze, KERNEL_DS and USER_DS is equal.
31 */ 31 */
32# define KERNEL_DS ((mm_segment_t){0}) 32# define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
33
34# ifndef CONFIG_MMU
35# define KERNEL_DS MAKE_MM_SEG(0)
33# define USER_DS KERNEL_DS 36# define USER_DS KERNEL_DS
37# else
38# define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF)
39# define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
40# endif
34 41
35# define get_ds() (KERNEL_DS) 42# define get_ds() (KERNEL_DS)
36# define get_fs() (current_thread_info()->addr_limit) 43# define get_fs() (current_thread_info()->addr_limit)
37# define set_fs(x) \ 44# define set_fs(val) (current_thread_info()->addr_limit = (val))
38 do { current_thread_info()->addr_limit = (x); } while (0)
39 45
40# define segment_eq(a, b) ((a).seg == (b).seg) 46# define segment_eq(a, b) ((a).seg == (b).seg)
41 47
42# endif /* __ASSEMBLY__ */ 48# endif /* __ASSEMBLY__ */
43#endif /* _ASM_MICROBLAZE_SEGMENT_H */ 49#endif /* _ASM_MICROBLAZE_SEGMENT_H */
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 9b98e8e6abae..27f8dafd8c34 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu> 2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
3 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
4 * 5 *
5 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -18,7 +19,6 @@
18extern unsigned int boot_cpuid; /* move to smp.h */ 19extern unsigned int boot_cpuid; /* move to smp.h */
19 20
20extern char cmd_line[COMMAND_LINE_SIZE]; 21extern char cmd_line[COMMAND_LINE_SIZE];
21# endif/* __KERNEL__ */
22 22
23void early_printk(const char *fmt, ...); 23void early_printk(const char *fmt, ...);
24 24
@@ -30,6 +30,11 @@ void setup_heartbeat(void);
30 30
31unsigned long long sched_clock(void); 31unsigned long long sched_clock(void);
32 32
33# ifdef CONFIG_MMU
34extern void mmu_reset(void);
35extern void early_console_reg_tlb_alloc(unsigned int addr);
36# endif /* CONFIG_MMU */
37
33void time_init(void); 38void time_init(void);
34void init_IRQ(void); 39void init_IRQ(void);
35void machine_early_init(const char *cmdline, unsigned int ram, 40void machine_early_init(const char *cmdline, unsigned int ram,
@@ -40,5 +45,6 @@ void machine_shutdown(void);
40void machine_halt(void); 45void machine_halt(void);
41void machine_power_off(void); 46void machine_power_off(void);
42 47
48# endif/* __KERNEL__ */
43# endif /* __ASSEMBLY__ */ 49# endif /* __ASSEMBLY__ */
44#endif /* _ASM_MICROBLAZE_SETUP_H */ 50#endif /* _ASM_MICROBLAZE_SETUP_H */
diff --git a/arch/microblaze/include/asm/signal.h b/arch/microblaze/include/asm/signal.h
index 9676fad3486c..46bc2267d949 100644
--- a/arch/microblaze/include/asm/signal.h
+++ b/arch/microblaze/include/asm/signal.h
@@ -90,7 +90,7 @@
90 90
91# ifndef __ASSEMBLY__ 91# ifndef __ASSEMBLY__
92# include <linux/types.h> 92# include <linux/types.h>
93# include <asm-generic/signal.h> 93# include <asm-generic/signal-defs.h>
94 94
95/* Avoid too many header ordering problems. */ 95/* Avoid too many header ordering problems. */
96struct siginfo; 96struct siginfo;
diff --git a/arch/microblaze/include/asm/stat.h b/arch/microblaze/include/asm/stat.h
index 5f18b8aed220..a15f77520bfd 100644
--- a/arch/microblaze/include/asm/stat.h
+++ b/arch/microblaze/include/asm/stat.h
@@ -16,58 +16,53 @@
16 16
17#include <linux/posix_types.h> 17#include <linux/posix_types.h>
18 18
19#define STAT_HAVE_NSEC 1
20
19struct stat { 21struct stat {
20 unsigned int st_dev; 22 unsigned long st_dev;
21 unsigned long st_ino; 23 unsigned long st_ino;
22 unsigned int st_mode; 24 unsigned int st_mode;
23 unsigned int st_nlink; 25 unsigned int st_nlink;
24 unsigned int st_uid; 26 unsigned int st_uid;
25 unsigned int st_gid; 27 unsigned int st_gid;
26 unsigned int st_rdev; 28 unsigned long st_rdev;
27 unsigned long st_size; 29 unsigned long __pad1;
28 unsigned long st_blksize; 30 long st_size;
29 unsigned long st_blocks; 31 int st_blksize;
30 unsigned long st_atime; 32 int __pad2;
31 unsigned long __unused1; /* unsigned long st_atime_nsec */ 33 long st_blocks;
32 unsigned long st_mtime; 34 int st_atime;
33 unsigned long __unused2; /* unsigned long st_mtime_nsec */ 35 unsigned int st_atime_nsec;
34 unsigned long st_ctime; 36 int st_mtime;
35 unsigned long __unused3; /* unsigned long st_ctime_nsec */ 37 unsigned int st_mtime_nsec;
38 int st_ctime;
39 unsigned int st_ctime_nsec;
36 unsigned long __unused4; 40 unsigned long __unused4;
37 unsigned long __unused5; 41 unsigned long __unused5;
38}; 42};
39 43
40struct stat64 { 44struct stat64 {
41 unsigned long long st_dev; 45 unsigned long long st_dev; /* Device. */
42 unsigned long __unused1; 46 unsigned long long st_ino; /* File serial number. */
43 47 unsigned int st_mode; /* File mode. */
44 unsigned long long st_ino; 48 unsigned int st_nlink; /* Link count. */
45 49 unsigned int st_uid; /* User ID of the file's owner. */
46 unsigned int st_mode; 50 unsigned int st_gid; /* Group ID of the file's group. */
47 unsigned int st_nlink; 51 unsigned long long st_rdev; /* Device number, if device. */
48 52 unsigned long long __pad1;
49 unsigned int st_uid; 53 long long st_size; /* Size of file, in bytes. */
50 unsigned int st_gid; 54 int st_blksize; /* Optimal block size for I/O. */
51 55 int __pad2;
52 unsigned long long st_rdev; 56 long long st_blocks; /* Number 512-byte blocks allocated. */
53 unsigned long __unused3; 57 int st_atime; /* Time of last access. */
54 58 unsigned int st_atime_nsec;
55 long long st_size; 59 int st_mtime; /* Time of last modification. */
56 unsigned long st_blksize; 60 unsigned int st_mtime_nsec;
57 61 int st_ctime; /* Time of last status change. */
58 unsigned long st_blocks; /* No. of 512-byte blocks allocated */ 62 unsigned int st_ctime_nsec;
59 unsigned long __unused4; /* future possible st_blocks high bits */ 63 unsigned int __unused4;
60 64 unsigned int __unused5;
61 unsigned long st_atime;
62 unsigned long st_atime_nsec;
63
64 unsigned long st_mtime;
65 unsigned long st_mtime_nsec;
66
67 unsigned long st_ctime;
68 unsigned long st_ctime_nsec;
69
70 unsigned long __unused8;
71}; 65};
72 66
73#endif /* _ASM_MICROBLAZE_STAT_H */ 67#endif /* _ASM_MICROBLAZE_STAT_H */
68
diff --git a/arch/microblaze/include/asm/string.h b/arch/microblaze/include/asm/string.h
index f7728c90fc18..aec2f59298b8 100644
--- a/arch/microblaze/include/asm/string.h
+++ b/arch/microblaze/include/asm/string.h
@@ -9,7 +9,7 @@
9#ifndef _ASM_MICROBLAZE_STRING_H 9#ifndef _ASM_MICROBLAZE_STRING_H
10#define _ASM_MICROBLAZE_STRING_H 10#define _ASM_MICROBLAZE_STRING_H
11 11
12#ifndef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#define __HAVE_ARCH_MEMSET 14#define __HAVE_ARCH_MEMSET
15#define __HAVE_ARCH_MEMCPY 15#define __HAVE_ARCH_MEMCPY
diff --git a/arch/microblaze/include/asm/syscalls.h b/arch/microblaze/include/asm/syscalls.h
index 9cb4ff0edeb2..ddea9eb31f8d 100644
--- a/arch/microblaze/include/asm/syscalls.h
+++ b/arch/microblaze/include/asm/syscalls.h
@@ -34,6 +34,9 @@ asmlinkage int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
34asmlinkage int sys_sigaction(int sig, const struct old_sigaction *act, 34asmlinkage int sys_sigaction(int sig, const struct old_sigaction *act,
35 struct old_sigaction *oact); 35 struct old_sigaction *oact);
36 36
37asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,
38 struct sigaction __user *oact, size_t sigsetsize);
39
37asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 40asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
38 struct pt_regs *regs); 41 struct pt_regs *regs);
39 42
diff --git a/arch/microblaze/include/asm/termios.h b/arch/microblaze/include/asm/termios.h
index 102d77258668..47a46d1fbe26 100644
--- a/arch/microblaze/include/asm/termios.h
+++ b/arch/microblaze/include/asm/termios.h
@@ -81,7 +81,7 @@ struct termio {
81 81
82#ifdef __KERNEL__ 82#ifdef __KERNEL__
83 83
84#include <asm-generic/termios.h> 84#include <asm-generic/termios-base.h>
85 85
86#endif /* __KERNEL__ */ 86#endif /* __KERNEL__ */
87 87
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index 4c3943e3f403..7fac44498445 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -122,6 +122,8 @@ static inline struct thread_info *current_thread_info(void)
122#define TIF_SINGLESTEP 4 122#define TIF_SINGLESTEP 4
123#define TIF_IRET 5 /* return with iret */ 123#define TIF_IRET 5 /* return with iret */
124#define TIF_MEMDIE 6 124#define TIF_MEMDIE 6
125#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */
126#define TIF_SECCOMP 10 /* secure computing */
125#define TIF_FREEZE 14 /* Freezing for suspend */ 127#define TIF_FREEZE 14 /* Freezing for suspend */
126 128
127/* FIXME change in entry.S */ 129/* FIXME change in entry.S */
@@ -138,10 +140,17 @@ static inline struct thread_info *current_thread_info(void)
138#define _TIF_IRET (1<<TIF_IRET) 140#define _TIF_IRET (1<<TIF_IRET)
139#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 141#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
140#define _TIF_FREEZE (1<<TIF_FREEZE) 142#define _TIF_FREEZE (1<<TIF_FREEZE)
143#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
144#define _TIF_SECCOMP (1 << TIF_SECCOMP)
141#define _TIF_KERNEL_TRACE (1 << TIF_KERNEL_TRACE) 145#define _TIF_KERNEL_TRACE (1 << TIF_KERNEL_TRACE)
142 146
147/* work to do in syscall trace */
148#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
149 _TIF_SYSCALL_AUDIT | _TIF_SECCOMP)
150
143/* work to do on interrupt/exception return */ 151/* work to do on interrupt/exception return */
144#define _TIF_WORK_MASK 0x0000FFFE 152#define _TIF_WORK_MASK 0x0000FFFE
153
145/* work to do on any return to u-space */ 154/* work to do on any return to u-space */
146#define _TIF_ALLWORK_MASK 0x0000FFFF 155#define _TIF_ALLWORK_MASK 0x0000FFFF
147 156
@@ -154,6 +163,17 @@ static inline struct thread_info *current_thread_info(void)
154 */ 163 */
155/* FPU was used by this task this quantum (SMP) */ 164/* FPU was used by this task this quantum (SMP) */
156#define TS_USEDFPU 0x0001 165#define TS_USEDFPU 0x0001
166#define TS_RESTORE_SIGMASK 0x0002
167
168#ifndef __ASSEMBLY__
169#define HAVE_SET_RESTORE_SIGMASK 1
170static inline void set_restore_sigmask(void)
171{
172 struct thread_info *ti = current_thread_info();
173 ti->status |= TS_RESTORE_SIGMASK;
174 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
175}
176#endif
157 177
158#endif /* __KERNEL__ */ 178#endif /* __KERNEL__ */
159#endif /* _ASM_MICROBLAZE_THREAD_INFO_H */ 179#endif /* _ASM_MICROBLAZE_THREAD_INFO_H */
diff --git a/arch/microblaze/include/asm/tlb.h b/arch/microblaze/include/asm/tlb.h
index d1dfe3791127..c472d2801132 100644
--- a/arch/microblaze/include/asm/tlb.h
+++ b/arch/microblaze/include/asm/tlb.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -13,4 +15,10 @@
13 15
14#include <asm-generic/tlb.h> 16#include <asm-generic/tlb.h>
15 17
18#ifdef CONFIG_MMU
19#define tlb_start_vma(tlb, vma) do { } while (0)
20#define tlb_end_vma(tlb, vma) do { } while (0)
21#define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
22#endif
23
16#endif /* _ASM_MICROBLAZE_TLB_H */ 24#endif /* _ASM_MICROBLAZE_TLB_H */
diff --git a/arch/microblaze/include/asm/tlbflush.h b/arch/microblaze/include/asm/tlbflush.h
index d7fe7629001b..eb31a0e8a772 100644
--- a/arch/microblaze/include/asm/tlbflush.h
+++ b/arch/microblaze/include/asm/tlbflush.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -9,6 +11,50 @@
9#ifndef _ASM_MICROBLAZE_TLBFLUSH_H 11#ifndef _ASM_MICROBLAZE_TLBFLUSH_H
10#define _ASM_MICROBLAZE_TLBFLUSH_H 12#define _ASM_MICROBLAZE_TLBFLUSH_H
11 13
14#ifdef CONFIG_MMU
15
16#include <linux/sched.h>
17#include <linux/threads.h>
18#include <asm/processor.h> /* For TASK_SIZE */
19#include <asm/mmu.h>
20#include <asm/page.h>
21#include <asm/pgalloc.h>
22
23extern void _tlbie(unsigned long address);
24extern void _tlbia(void);
25
26#define __tlbia() _tlbia()
27
28static inline void local_flush_tlb_all(void)
29 { __tlbia(); }
30static inline void local_flush_tlb_mm(struct mm_struct *mm)
31 { __tlbia(); }
32static inline void local_flush_tlb_page(struct vm_area_struct *vma,
33 unsigned long vmaddr)
34 { _tlbie(vmaddr); }
35static inline void local_flush_tlb_range(struct vm_area_struct *vma,
36 unsigned long start, unsigned long end)
37 { __tlbia(); }
38
39#define flush_tlb_kernel_range(start, end) do { } while (0)
40
41#define update_mmu_cache(vma, addr, pte) do { } while (0)
42
43#define flush_tlb_all local_flush_tlb_all
44#define flush_tlb_mm local_flush_tlb_mm
45#define flush_tlb_page local_flush_tlb_page
46#define flush_tlb_range local_flush_tlb_range
47
48/*
49 * This is called in munmap when we have freed up some page-table
50 * pages. We don't need to do anything here, there's nothing special
51 * about our page-table pages. -- paulus
52 */
53static inline void flush_tlb_pgtables(struct mm_struct *mm,
54 unsigned long start, unsigned long end) { }
55
56#else /* CONFIG_MMU */
57
12#define flush_tlb() BUG() 58#define flush_tlb() BUG()
13#define flush_tlb_all() BUG() 59#define flush_tlb_all() BUG()
14#define flush_tlb_mm(mm) BUG() 60#define flush_tlb_mm(mm) BUG()
@@ -17,4 +63,6 @@
17#define flush_tlb_pgtables(mm, start, end) BUG() 63#define flush_tlb_pgtables(mm, start, end) BUG()
18#define flush_tlb_kernel_range(start, end) BUG() 64#define flush_tlb_kernel_range(start, end) BUG()
19 65
66#endif /* CONFIG_MMU */
67
20#endif /* _ASM_MICROBLAZE_TLBFLUSH_H */ 68#endif /* _ASM_MICROBLAZE_TLBFLUSH_H */
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 5a3ffc308e12..65adad61e7e9 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
2 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
3 * 5 *
4 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
@@ -26,6 +28,10 @@
26#define VERIFY_READ 0 28#define VERIFY_READ 0
27#define VERIFY_WRITE 1 29#define VERIFY_WRITE 1
28 30
31#define __clear_user(addr, n) (memset((void *)(addr), 0, (n)), 0)
32
33#ifndef CONFIG_MMU
34
29extern int ___range_ok(unsigned long addr, unsigned long size); 35extern int ___range_ok(unsigned long addr, unsigned long size);
30 36
31#define __range_ok(addr, size) \ 37#define __range_ok(addr, size) \
@@ -34,68 +40,68 @@ extern int ___range_ok(unsigned long addr, unsigned long size);
34#define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0) 40#define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0)
35#define __access_ok(add, size) (__range_ok((addr), (size)) == 0) 41#define __access_ok(add, size) (__range_ok((addr), (size)) == 0)
36 42
37extern inline int bad_user_access_length(void) 43/* Undefined function to trigger linker error */
38{ 44extern int bad_user_access_length(void);
39 return 0; 45
40}
41/* FIXME this is function for optimalization -> memcpy */ 46/* FIXME this is function for optimalization -> memcpy */
42#define __get_user(var, ptr) \ 47#define __get_user(var, ptr) \
43 ({ \ 48({ \
44 int __gu_err = 0; \ 49 int __gu_err = 0; \
45 switch (sizeof(*(ptr))) { \ 50 switch (sizeof(*(ptr))) { \
46 case 1: \ 51 case 1: \
47 case 2: \ 52 case 2: \
48 case 4: \ 53 case 4: \
49 (var) = *(ptr); \ 54 (var) = *(ptr); \
50 break; \ 55 break; \
51 case 8: \ 56 case 8: \
52 memcpy((void *) &(var), (ptr), 8); \ 57 memcpy((void *) &(var), (ptr), 8); \
53 break; \ 58 break; \
54 default: \ 59 default: \
55 (var) = 0; \ 60 (var) = 0; \
56 __gu_err = __get_user_bad(); \ 61 __gu_err = __get_user_bad(); \
57 break; \ 62 break; \
58 } \ 63 } \
59 __gu_err; \ 64 __gu_err; \
60 }) 65})
61 66
62#define __get_user_bad() (bad_user_access_length(), (-EFAULT)) 67#define __get_user_bad() (bad_user_access_length(), (-EFAULT))
63 68
69/* FIXME is not there defined __pu_val */
64#define __put_user(var, ptr) \ 70#define __put_user(var, ptr) \
65 ({ \ 71({ \
66 int __pu_err = 0; \ 72 int __pu_err = 0; \
67 switch (sizeof(*(ptr))) { \ 73 switch (sizeof(*(ptr))) { \
68 case 1: \ 74 case 1: \
69 case 2: \ 75 case 2: \
70 case 4: \ 76 case 4: \
71 *(ptr) = (var); \ 77 *(ptr) = (var); \
72 break; \ 78 break; \
73 case 8: { \ 79 case 8: { \
74 typeof(*(ptr)) __pu_val = var; \ 80 typeof(*(ptr)) __pu_val = (var); \
75 memcpy(ptr, &__pu_val, sizeof(__pu_val));\ 81 memcpy(ptr, &__pu_val, sizeof(__pu_val)); \
76 } \ 82 } \
77 break; \ 83 break; \
78 default: \ 84 default: \
79 __pu_err = __put_user_bad(); \ 85 __pu_err = __put_user_bad(); \
80 break; \ 86 break; \
81 } \ 87 } \
82 __pu_err; \ 88 __pu_err; \
83 }) 89})
84 90
85#define __put_user_bad() (bad_user_access_length(), (-EFAULT)) 91#define __put_user_bad() (bad_user_access_length(), (-EFAULT))
86 92
87#define put_user(x, ptr) __put_user(x, ptr) 93#define put_user(x, ptr) __put_user((x), (ptr))
88#define get_user(x, ptr) __get_user(x, ptr) 94#define get_user(x, ptr) __get_user((x), (ptr))
89 95
90#define copy_to_user(to, from, n) (memcpy(to, from, n), 0) 96#define copy_to_user(to, from, n) (memcpy((to), (from), (n)), 0)
91#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) 97#define copy_from_user(to, from, n) (memcpy((to), (from), (n)), 0)
92 98
93#define __copy_to_user(to, from, n) (copy_to_user(to, from, n)) 99#define __copy_to_user(to, from, n) (copy_to_user((to), (from), (n)))
94#define __copy_from_user(to, from, n) (copy_from_user(to, from, n)) 100#define __copy_from_user(to, from, n) (copy_from_user((to), (from), (n)))
95#define __copy_to_user_inatomic(to, from, n) (__copy_to_user(to, from, n)) 101#define __copy_to_user_inatomic(to, from, n) \
96#define __copy_from_user_inatomic(to, from, n) (__copy_from_user(to, from, n)) 102 (__copy_to_user((to), (from), (n)))
97 103#define __copy_from_user_inatomic(to, from, n) \
98#define __clear_user(addr, n) (memset((void *)addr, 0, n), 0) 104 (__copy_from_user((to), (from), (n)))
99 105
100static inline unsigned long clear_user(void *addr, unsigned long size) 106static inline unsigned long clear_user(void *addr, unsigned long size)
101{ 107{
@@ -104,13 +110,200 @@ static inline unsigned long clear_user(void *addr, unsigned long size)
104 return size; 110 return size;
105} 111}
106 112
107/* Returns 0 if exception not found and fixup otherwise. */ 113/* Returns 0 if exception not found and fixup otherwise. */
108extern unsigned long search_exception_table(unsigned long); 114extern unsigned long search_exception_table(unsigned long);
109 115
116extern long strncpy_from_user(char *dst, const char *src, long count);
117extern long strnlen_user(const char *src, long count);
118
119#else /* CONFIG_MMU */
120
121/*
122 * Address is valid if:
123 * - "addr", "addr + size" and "size" are all below the limit
124 */
125#define access_ok(type, addr, size) \
126 (get_fs().seg > (((unsigned long)(addr)) | \
127 (size) | ((unsigned long)(addr) + (size))))
128
129/* || printk("access_ok failed for %s at 0x%08lx (size %d), seg 0x%08x\n",
130 type?"WRITE":"READ",addr,size,get_fs().seg)) */
131
132/*
133 * All the __XXX versions macros/functions below do not perform
134 * access checking. It is assumed that the necessary checks have been
135 * already performed before the finction (macro) is called.
136 */
137
138#define get_user(x, ptr) \
139({ \
140 access_ok(VERIFY_READ, (ptr), sizeof(*(ptr))) \
141 ? __get_user((x), (ptr)) : -EFAULT; \
142})
143
144#define put_user(x, ptr) \
145({ \
146 access_ok(VERIFY_WRITE, (ptr), sizeof(*(ptr))) \
147 ? __put_user((x), (ptr)) : -EFAULT; \
148})
149
150#define __get_user(x, ptr) \
151({ \
152 unsigned long __gu_val; \
153 /*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \
154 long __gu_err; \
155 switch (sizeof(*(ptr))) { \
156 case 1: \
157 __get_user_asm("lbu", (ptr), __gu_val, __gu_err); \
158 break; \
159 case 2: \
160 __get_user_asm("lhu", (ptr), __gu_val, __gu_err); \
161 break; \
162 case 4: \
163 __get_user_asm("lw", (ptr), __gu_val, __gu_err); \
164 break; \
165 default: \
166 __gu_val = 0; __gu_err = -EINVAL; \
167 } \
168 x = (__typeof__(*(ptr))) __gu_val; \
169 __gu_err; \
170})
171
172#define __get_user_asm(insn, __gu_ptr, __gu_val, __gu_err) \
173({ \
174 __asm__ __volatile__ ( \
175 "1:" insn " %1, %2, r0; \
176 addk %0, r0, r0; \
177 2: \
178 .section .fixup,\"ax\"; \
179 3: brid 2b; \
180 addik %0, r0, %3; \
181 .previous; \
182 .section __ex_table,\"a\"; \
183 .word 1b,3b; \
184 .previous;" \
185 : "=r"(__gu_err), "=r"(__gu_val) \
186 : "r"(__gu_ptr), "i"(-EFAULT) \
187 ); \
188})
189
190#define __put_user(x, ptr) \
191({ \
192 __typeof__(*(ptr)) __gu_val = x; \
193 long __gu_err = 0; \
194 switch (sizeof(__gu_val)) { \
195 case 1: \
196 __put_user_asm("sb", (ptr), __gu_val, __gu_err); \
197 break; \
198 case 2: \
199 __put_user_asm("sh", (ptr), __gu_val, __gu_err); \
200 break; \
201 case 4: \
202 __put_user_asm("sw", (ptr), __gu_val, __gu_err); \
203 break; \
204 case 8: \
205 __put_user_asm_8((ptr), __gu_val, __gu_err); \
206 break; \
207 default: \
208 __gu_err = -EINVAL; \
209 } \
210 __gu_err; \
211})
212
213#define __put_user_asm_8(__gu_ptr, __gu_val, __gu_err) \
214({ \
215__asm__ __volatile__ (" lwi %0, %1, 0; \
216 1: swi %0, %2, 0; \
217 lwi %0, %1, 4; \
218 2: swi %0, %2, 4; \
219 addk %0,r0,r0; \
220 3: \
221 .section .fixup,\"ax\"; \
222 4: brid 3b; \
223 addik %0, r0, %3; \
224 .previous; \
225 .section __ex_table,\"a\"; \
226 .word 1b,4b,2b,4b; \
227 .previous;" \
228 : "=&r"(__gu_err) \
229 : "r"(&__gu_val), \
230 "r"(__gu_ptr), "i"(-EFAULT) \
231 ); \
232})
233
234#define __put_user_asm(insn, __gu_ptr, __gu_val, __gu_err) \
235({ \
236 __asm__ __volatile__ ( \
237 "1:" insn " %1, %2, r0; \
238 addk %0, r0, r0; \
239 2: \
240 .section .fixup,\"ax\"; \
241 3: brid 2b; \
242 addik %0, r0, %3; \
243 .previous; \
244 .section __ex_table,\"a\"; \
245 .word 1b,3b; \
246 .previous;" \
247 : "=r"(__gu_err) \
248 : "r"(__gu_val), "r"(__gu_ptr), "i"(-EFAULT) \
249 ); \
250})
251
252/*
253 * Return: number of not copied bytes, i.e. 0 if OK or non-zero if fail.
254 */
255static inline int clear_user(char *to, int size)
256{
257 if (size && access_ok(VERIFY_WRITE, to, size)) {
258 __asm__ __volatile__ (" \
259 1: \
260 sb r0, %2, r0; \
261 addik %0, %0, -1; \
262 bneid %0, 1b; \
263 addik %2, %2, 1; \
264 2: \
265 .section __ex_table,\"a\"; \
266 .word 1b,2b; \
267 .section .text;" \
268 : "=r"(size) \
269 : "0"(size), "r"(to)
270 );
271 }
272 return size;
273}
274
275extern unsigned long __copy_tofrom_user(void __user *to,
276 const void __user *from, unsigned long size);
277
278#define copy_to_user(to, from, n) \
279 (access_ok(VERIFY_WRITE, (to), (n)) ? \
280 __copy_tofrom_user((void __user *)(to), \
281 (__force const void __user *)(from), (n)) \
282 : -EFAULT)
283
284#define __copy_to_user(to, from, n) copy_to_user((to), (from), (n))
285#define __copy_to_user_inatomic(to, from, n) copy_to_user((to), (from), (n))
286
287#define copy_from_user(to, from, n) \
288 (access_ok(VERIFY_READ, (from), (n)) ? \
289 __copy_tofrom_user((__force void __user *)(to), \
290 (void __user *)(from), (n)) \
291 : -EFAULT)
292
293#define __copy_from_user(to, from, n) copy_from_user((to), (from), (n))
294#define __copy_from_user_inatomic(to, from, n) \
295 copy_from_user((to), (from), (n))
296
297extern int __strncpy_user(char *to, const char __user *from, int len);
298extern int __strnlen_user(const char __user *sstr, int len);
299
300#define strncpy_from_user(to, from, len) \
301 (access_ok(VERIFY_READ, from, 1) ? \
302 __strncpy_user(to, from, len) : -EFAULT)
303#define strnlen_user(str, len) \
304 (access_ok(VERIFY_READ, str, 1) ? __strnlen_user(str, len) : 0)
110 305
111extern long strncpy_from_user(char *dst, const char __user *src, long count); 306#endif /* CONFIG_MMU */
112extern long strnlen_user(const char __user *src, long count);
113extern long __strncpy_from_user(char *dst, const char __user *src, long count);
114 307
115/* 308/*
116 * The exception table consists of pairs of addresses: the first is the 309 * The exception table consists of pairs of addresses: the first is the
diff --git a/arch/microblaze/include/asm/unaligned.h b/arch/microblaze/include/asm/unaligned.h
index 9d66b640c910..3658d91ac0fb 100644
--- a/arch/microblaze/include/asm/unaligned.h
+++ b/arch/microblaze/include/asm/unaligned.h
@@ -12,7 +12,8 @@
12 12
13# ifdef __KERNEL__ 13# ifdef __KERNEL__
14 14
15# include <linux/unaligned/access_ok.h> 15# include <linux/unaligned/be_struct.h>
16# include <linux/unaligned/le_byteshift.h>
16# include <linux/unaligned/generic.h> 17# include <linux/unaligned/generic.h>
17 18
18# define get_unaligned __get_unaligned_be 19# define get_unaligned __get_unaligned_be
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile
index da94bec4ecba..f4a5e19a20eb 100644
--- a/arch/microblaze/kernel/Makefile
+++ b/arch/microblaze/kernel/Makefile
@@ -15,5 +15,6 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
15obj-$(CONFIG_SELFMOD) += selfmod.o 15obj-$(CONFIG_SELFMOD) += selfmod.o
16obj-$(CONFIG_HEART_BEAT) += heartbeat.o 16obj-$(CONFIG_HEART_BEAT) += heartbeat.o
17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o 17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
18obj-$(CONFIG_MMU) += misc.o
18 19
19obj-y += entry$(MMUEXT).o 20obj-y += entry$(MMUEXT).o
diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/asm-offsets.c
index aabd9e9423a6..7bc7b68f97db 100644
--- a/arch/microblaze/kernel/asm-offsets.c
+++ b/arch/microblaze/kernel/asm-offsets.c
@@ -1,4 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
2 * Copyright (C) 2007-2009 PetaLogix 3 * Copyright (C) 2007-2009 PetaLogix
3 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
4 * 5 *
@@ -68,16 +69,26 @@ int main(int argc, char *argv[])
68 69
69 /* struct task_struct */ 70 /* struct task_struct */
70 DEFINE(TS_THREAD_INFO, offsetof(struct task_struct, stack)); 71 DEFINE(TS_THREAD_INFO, offsetof(struct task_struct, stack));
72#ifdef CONFIG_MMU
73 DEFINE(TASK_STATE, offsetof(struct task_struct, state));
74 DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
75 DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
76 DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
77 DEFINE(TASK_MM, offsetof(struct task_struct, mm));
78 DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
79 DEFINE(TASK_PID, offsetof(struct task_struct, pid));
80 DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
81 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
82 BLANK();
83
84 DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
85 BLANK();
86#endif
71 87
72 /* struct thread_info */ 88 /* struct thread_info */
73 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 89 DEFINE(TI_TASK, offsetof(struct thread_info, task));
74 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
75 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 90 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
76 DEFINE(TI_STATUS, offsetof(struct thread_info, status));
77 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
78 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
79 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); 91 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
80 DEFINE(TI_RESTART_BLOCK, offsetof(struct thread_info, restart_block));
81 DEFINE(TI_CPU_CONTEXT, offsetof(struct thread_info, cpu_context)); 92 DEFINE(TI_CPU_CONTEXT, offsetof(struct thread_info, cpu_context));
82 BLANK(); 93 BLANK();
83 94
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c
index 4b0f0fdb9ca0..7de84923ba07 100644
--- a/arch/microblaze/kernel/early_printk.c
+++ b/arch/microblaze/kernel/early_printk.c
@@ -87,6 +87,9 @@ int __init setup_early_printk(char *opt)
87 base_addr = early_uartlite_console(); 87 base_addr = early_uartlite_console();
88 if (base_addr) { 88 if (base_addr) {
89 early_console_initialized = 1; 89 early_console_initialized = 1;
90#ifdef CONFIG_MMU
91 early_console_reg_tlb_alloc(base_addr);
92#endif
90 early_printk("early_printk_console is enabled at 0x%08x\n", 93 early_printk("early_printk_console is enabled at 0x%08x\n",
91 base_addr); 94 base_addr);
92 95
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S
index f24b1268baaf..1fce6b803f54 100644
--- a/arch/microblaze/kernel/entry-nommu.S
+++ b/arch/microblaze/kernel/entry-nommu.S
@@ -10,7 +10,7 @@
10 10
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <asm/thread_info.h> 12#include <asm/thread_info.h>
13#include <asm/errno.h> 13#include <linux/errno.h>
14#include <asm/entry.h> 14#include <asm/entry.h>
15#include <asm/asm-offsets.h> 15#include <asm/asm-offsets.h>
16#include <asm/registers.h> 16#include <asm/registers.h>
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
new file mode 100644
index 000000000000..91a0e7b185dd
--- /dev/null
+++ b/arch/microblaze/kernel/entry.S
@@ -0,0 +1,1116 @@
1/*
2 * Low-level system-call handling, trap handlers and context-switching
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008-2009 PetaLogix
6 * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
7 * Copyright (C) 2001,2002 NEC Corporation
8 * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
9 *
10 * This file is subject to the terms and conditions of the GNU General
11 * Public License. See the file COPYING in the main directory of this
12 * archive for more details.
13 *
14 * Written by Miles Bader <miles@gnu.org>
15 * Heavily modified by John Williams for Microblaze
16 */
17
18#include <linux/sys.h>
19#include <linux/linkage.h>
20
21#include <asm/entry.h>
22#include <asm/current.h>
23#include <asm/processor.h>
24#include <asm/exceptions.h>
25#include <asm/asm-offsets.h>
26#include <asm/thread_info.h>
27
28#include <asm/page.h>
29#include <asm/unistd.h>
30
31#include <linux/errno.h>
32#include <asm/signal.h>
33
34/* The size of a state save frame. */
35#define STATE_SAVE_SIZE (PT_SIZE + STATE_SAVE_ARG_SPACE)
36
37/* The offset of the struct pt_regs in a `state save frame' on the stack. */
38#define PTO STATE_SAVE_ARG_SPACE /* 24 the space for args */
39
40#define C_ENTRY(name) .globl name; .align 4; name
41
42/*
43 * Various ways of setting and clearing BIP in flags reg.
44 * This is mucky, but necessary using microblaze version that
45 * allows msr ops to write to BIP
46 */
47#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
48 .macro clear_bip
49 msrclr r11, MSR_BIP
50 nop
51 .endm
52
53 .macro set_bip
54 msrset r11, MSR_BIP
55 nop
56 .endm
57
58 .macro clear_eip
59 msrclr r11, MSR_EIP
60 nop
61 .endm
62
63 .macro set_ee
64 msrset r11, MSR_EE
65 nop
66 .endm
67
68 .macro disable_irq
69 msrclr r11, MSR_IE
70 nop
71 .endm
72
73 .macro enable_irq
74 msrset r11, MSR_IE
75 nop
76 .endm
77
78 .macro set_ums
79 msrset r11, MSR_UMS
80 nop
81 msrclr r11, MSR_VMS
82 nop
83 .endm
84
85 .macro set_vms
86 msrclr r11, MSR_UMS
87 nop
88 msrset r11, MSR_VMS
89 nop
90 .endm
91
92 .macro clear_vms_ums
93 msrclr r11, MSR_VMS
94 nop
95 msrclr r11, MSR_UMS
96 nop
97 .endm
98#else
99 .macro clear_bip
100 mfs r11, rmsr
101 nop
102 andi r11, r11, ~MSR_BIP
103 mts rmsr, r11
104 nop
105 .endm
106
107 .macro set_bip
108 mfs r11, rmsr
109 nop
110 ori r11, r11, MSR_BIP
111 mts rmsr, r11
112 nop
113 .endm
114
115 .macro clear_eip
116 mfs r11, rmsr
117 nop
118 andi r11, r11, ~MSR_EIP
119 mts rmsr, r11
120 nop
121 .endm
122
123 .macro set_ee
124 mfs r11, rmsr
125 nop
126 ori r11, r11, MSR_EE
127 mts rmsr, r11
128 nop
129 .endm
130
131 .macro disable_irq
132 mfs r11, rmsr
133 nop
134 andi r11, r11, ~MSR_IE
135 mts rmsr, r11
136 nop
137 .endm
138
139 .macro enable_irq
140 mfs r11, rmsr
141 nop
142 ori r11, r11, MSR_IE
143 mts rmsr, r11
144 nop
145 .endm
146
147 .macro set_ums
148 mfs r11, rmsr
149 nop
150 ori r11, r11, MSR_VMS
151 andni r11, r11, MSR_UMS
152 mts rmsr, r11
153 nop
154 .endm
155
156 .macro set_vms
157 mfs r11, rmsr
158 nop
159 ori r11, r11, MSR_VMS
160 andni r11, r11, MSR_UMS
161 mts rmsr, r11
162 nop
163 .endm
164
165 .macro clear_vms_ums
166 mfs r11, rmsr
167 nop
168 andni r11, r11, (MSR_VMS|MSR_UMS)
169 mts rmsr,r11
170 nop
171 .endm
172#endif
173
174/* Define how to call high-level functions. With MMU, virtual mode must be
175 * enabled when calling the high-level function. Clobbers R11.
176 * VM_ON, VM_OFF, DO_JUMP_BIPCLR, DO_CALL
177 */
178
179/* turn on virtual protected mode save */
180#define VM_ON \
181 set_ums; \
182 rted r0, 2f; \
1832: nop;
184
185/* turn off virtual protected mode save and user mode save*/
186#define VM_OFF \
187 clear_vms_ums; \
188 rted r0, TOPHYS(1f); \
1891: nop;
190
191#define SAVE_REGS \
192 swi r2, r1, PTO+PT_R2; /* Save SDA */ \
193 swi r5, r1, PTO+PT_R5; \
194 swi r6, r1, PTO+PT_R6; \
195 swi r7, r1, PTO+PT_R7; \
196 swi r8, r1, PTO+PT_R8; \
197 swi r9, r1, PTO+PT_R9; \
198 swi r10, r1, PTO+PT_R10; \
199 swi r11, r1, PTO+PT_R11; /* save clobbered regs after rval */\
200 swi r12, r1, PTO+PT_R12; \
201 swi r13, r1, PTO+PT_R13; /* Save SDA2 */ \
202 swi r14, r1, PTO+PT_PC; /* PC, before IRQ/trap */ \
203 swi r15, r1, PTO+PT_R15; /* Save LP */ \
204 swi r18, r1, PTO+PT_R18; /* Save asm scratch reg */ \
205 swi r19, r1, PTO+PT_R19; \
206 swi r20, r1, PTO+PT_R20; \
207 swi r21, r1, PTO+PT_R21; \
208 swi r22, r1, PTO+PT_R22; \
209 swi r23, r1, PTO+PT_R23; \
210 swi r24, r1, PTO+PT_R24; \
211 swi r25, r1, PTO+PT_R25; \
212 swi r26, r1, PTO+PT_R26; \
213 swi r27, r1, PTO+PT_R27; \
214 swi r28, r1, PTO+PT_R28; \
215 swi r29, r1, PTO+PT_R29; \
216 swi r30, r1, PTO+PT_R30; \
217 swi r31, r1, PTO+PT_R31; /* Save current task reg */ \
218 mfs r11, rmsr; /* save MSR */ \
219 nop; \
220 swi r11, r1, PTO+PT_MSR;
221
222#define RESTORE_REGS \
223 lwi r11, r1, PTO+PT_MSR; \
224 mts rmsr , r11; \
225 nop; \
226 lwi r2, r1, PTO+PT_R2; /* restore SDA */ \
227 lwi r5, r1, PTO+PT_R5; \
228 lwi r6, r1, PTO+PT_R6; \
229 lwi r7, r1, PTO+PT_R7; \
230 lwi r8, r1, PTO+PT_R8; \
231 lwi r9, r1, PTO+PT_R9; \
232 lwi r10, r1, PTO+PT_R10; \
233 lwi r11, r1, PTO+PT_R11; /* restore clobbered regs after rval */\
234 lwi r12, r1, PTO+PT_R12; \
235 lwi r13, r1, PTO+PT_R13; /* restore SDA2 */ \
236 lwi r14, r1, PTO+PT_PC; /* RESTORE_LINK PC, before IRQ/trap */\
237 lwi r15, r1, PTO+PT_R15; /* restore LP */ \
238 lwi r18, r1, PTO+PT_R18; /* restore asm scratch reg */ \
239 lwi r19, r1, PTO+PT_R19; \
240 lwi r20, r1, PTO+PT_R20; \
241 lwi r21, r1, PTO+PT_R21; \
242 lwi r22, r1, PTO+PT_R22; \
243 lwi r23, r1, PTO+PT_R23; \
244 lwi r24, r1, PTO+PT_R24; \
245 lwi r25, r1, PTO+PT_R25; \
246 lwi r26, r1, PTO+PT_R26; \
247 lwi r27, r1, PTO+PT_R27; \
248 lwi r28, r1, PTO+PT_R28; \
249 lwi r29, r1, PTO+PT_R29; \
250 lwi r30, r1, PTO+PT_R30; \
251 lwi r31, r1, PTO+PT_R31; /* Restore cur task reg */
252
253.text
254
255/*
256 * User trap.
257 *
258 * System calls are handled here.
259 *
260 * Syscall protocol:
261 * Syscall number in r12, args in r5-r10
262 * Return value in r3
263 *
264 * Trap entered via brki instruction, so BIP bit is set, and interrupts
265 * are masked. This is nice, means we don't have to CLI before state save
266 */
267C_ENTRY(_user_exception):
268 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
269 addi r14, r14, 4 /* return address is 4 byte after call */
270 swi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* Save r11 */
271
272 lwi r11, r0, TOPHYS(PER_CPU(KM));/* See if already in kernel mode.*/
273 beqi r11, 1f; /* Jump ahead if coming from user */
274/* Kernel-mode state save. */
275 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); /* Reload kernel stack-ptr*/
276 tophys(r1,r11);
277 swi r11, r1, (PT_R1-PT_SIZE); /* Save original SP. */
278 lwi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* restore r11 */
279
280 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */
281 SAVE_REGS
282
283 addi r11, r0, 1; /* Was in kernel-mode. */
284 swi r11, r1, PTO+PT_MODE; /* pt_regs -> kernel mode */
285 brid 2f;
286 nop; /* Fill delay slot */
287
288/* User-mode state save. */
2891:
290 lwi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* restore r11 */
291 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */
292 tophys(r1,r1);
293 lwi r1, r1, TS_THREAD_INFO; /* get stack from task_struct */
294/* calculate kernel stack pointer from task struct 8k */
295 addik r1, r1, THREAD_SIZE;
296 tophys(r1,r1);
297
298 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */
299 SAVE_REGS
300
301 swi r0, r1, PTO+PT_MODE; /* Was in user-mode. */
302 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
303 swi r11, r1, PTO+PT_R1; /* Store user SP. */
304 addi r11, r0, 1;
305 swi r11, r0, TOPHYS(PER_CPU(KM)); /* Now we're in kernel-mode. */
3062: lwi r31, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */
307 /* Save away the syscall number. */
308 swi r12, r1, PTO+PT_R0;
309 tovirt(r1,r1)
310
311 la r15, r0, ret_from_trap-8
312/* where the trap should return need -8 to adjust for rtsd r15, 8*/
313/* Jump to the appropriate function for the system call number in r12
314 * (r12 is not preserved), or return an error if r12 is not valid. The LP
315 * register should point to the location where
316 * the called function should return. [note that MAKE_SYS_CALL uses label 1] */
317 /* See if the system call number is valid. */
318 addi r11, r12, -__NR_syscalls;
319 bgei r11,1f;
320 /* Figure out which function to use for this system call. */
321 /* Note Microblaze barrel shift is optional, so don't rely on it */
322 add r12, r12, r12; /* convert num -> ptr */
323 add r12, r12, r12;
324
325 /* Trac syscalls and stored them to r0_ram */
326 lwi r3, r12, 0x400 + TOPHYS(r0_ram)
327 addi r3, r3, 1
328 swi r3, r12, 0x400 + TOPHYS(r0_ram)
329
330 lwi r12, r12, TOPHYS(sys_call_table); /* Function ptr */
331 /* Make the system call. to r12*/
332 set_vms;
333 rtid r12, 0;
334 nop;
335 /* The syscall number is invalid, return an error. */
3361: VM_ON; /* RETURN() expects virtual mode*/
337 addi r3, r0, -ENOSYS;
338 rtsd r15,8; /* looks like a normal subroutine return */
339 or r0, r0, r0
340
341
342/* Entry point used to return from a syscall/trap. */
343/* We re-enable BIP bit before state restore */
344C_ENTRY(ret_from_trap):
345 set_bip; /* Ints masked for state restore*/
346 lwi r11, r1, PTO+PT_MODE;
347/* See if returning to kernel mode, if so, skip resched &c. */
348 bnei r11, 2f;
349
350 /* We're returning to user mode, so check for various conditions that
351 * trigger rescheduling. */
352 /* Get current task ptr into r11 */
353 add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
354 lwi r11, r11, TS_THREAD_INFO; /* get thread info */
355 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
356 andi r11, r11, _TIF_NEED_RESCHED;
357 beqi r11, 5f;
358
359 swi r3, r1, PTO + PT_R3; /* store syscall result */
360 swi r4, r1, PTO + PT_R4;
361 bralid r15, schedule; /* Call scheduler */
362 nop; /* delay slot */
363 lwi r3, r1, PTO + PT_R3; /* restore syscall result */
364 lwi r4, r1, PTO + PT_R4;
365
366 /* Maybe handle a signal */
3675: add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
368 lwi r11, r11, TS_THREAD_INFO; /* get thread info */
369 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
370 andi r11, r11, _TIF_SIGPENDING;
371 beqi r11, 1f; /* Signals to handle, handle them */
372
373 swi r3, r1, PTO + PT_R3; /* store syscall result */
374 swi r4, r1, PTO + PT_R4;
375 la r5, r1, PTO; /* Arg 1: struct pt_regs *regs */
376 add r6, r0, r0; /* Arg 2: sigset_t *oldset */
377 addi r7, r0, 1; /* Arg 3: int in_syscall */
378 bralid r15, do_signal; /* Handle any signals */
379 nop;
380 lwi r3, r1, PTO + PT_R3; /* restore syscall result */
381 lwi r4, r1, PTO + PT_R4;
382
383/* Finally, return to user state. */
3841: swi r0, r0, PER_CPU(KM); /* Now officially in user state. */
385 add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
386 swi r11, r0, PER_CPU(CURRENT_SAVE); /* save current */
387 VM_OFF;
388 tophys(r1,r1);
389 RESTORE_REGS;
390 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space. */
391 lwi r1, r1, PT_R1 - PT_SIZE;/* Restore user stack pointer. */
392 bri 6f;
393
394/* Return to kernel state. */
3952: VM_OFF;
396 tophys(r1,r1);
397 RESTORE_REGS;
398 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space. */
399 tovirt(r1,r1);
4006:
401TRAP_return: /* Make global symbol for debugging */
402 rtbd r14, 0; /* Instructions to return from an IRQ */
403 nop;
404
405
406/* These syscalls need access to the struct pt_regs on the stack, so we
407 implement them in assembly (they're basically all wrappers anyway). */
408
409C_ENTRY(sys_fork_wrapper):
410 addi r5, r0, SIGCHLD /* Arg 0: flags */
411 lwi r6, r1, PTO+PT_R1 /* Arg 1: child SP (use parent's) */
412 la r7, r1, PTO /* Arg 2: parent context */
413 add r8. r0, r0 /* Arg 3: (unused) */
414 add r9, r0, r0; /* Arg 4: (unused) */
415 add r10, r0, r0; /* Arg 5: (unused) */
416 brid do_fork /* Do real work (tail-call) */
417 nop;
418
419/* This the initial entry point for a new child thread, with an appropriate
420 stack in place that makes it look the the child is in the middle of an
421 syscall. This function is actually `returned to' from switch_thread
422 (copy_thread makes ret_from_fork the return address in each new thread's
423 saved context). */
424C_ENTRY(ret_from_fork):
425 bralid r15, schedule_tail; /* ...which is schedule_tail's arg */
426 add r3, r5, r0; /* switch_thread returns the prev task */
427 /* ( in the delay slot ) */
428 add r3, r0, r0; /* Child's fork call should return 0. */
429 brid ret_from_trap; /* Do normal trap return */
430 nop;
431
432C_ENTRY(sys_vfork_wrapper):
433 la r5, r1, PTO
434 brid sys_vfork /* Do real work (tail-call) */
435 nop
436
437C_ENTRY(sys_clone_wrapper):
438 bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */
439 lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */
4401: la r7, r1, PTO; /* Arg 2: parent context */
441 add r8, r0, r0; /* Arg 3: (unused) */
442 add r9, r0, r0; /* Arg 4: (unused) */
443 add r10, r0, r0; /* Arg 5: (unused) */
444 brid do_fork /* Do real work (tail-call) */
445 nop;
446
447C_ENTRY(sys_execve_wrapper):
448 la r8, r1, PTO; /* add user context as 4th arg */
449 brid sys_execve; /* Do real work (tail-call).*/
450 nop;
451
452C_ENTRY(sys_sigsuspend_wrapper):
453 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
454 swi r4, r1, PTO+PT_R4;
455 la r6, r1, PTO; /* add user context as 2nd arg */
456 bralid r15, sys_sigsuspend; /* Do real work.*/
457 nop;
458 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
459 lwi r4, r1, PTO+PT_R4;
460 bri ret_from_trap /* fall through will not work here due to align */
461 nop;
462
463C_ENTRY(sys_rt_sigsuspend_wrapper):
464 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
465 swi r4, r1, PTO+PT_R4;
466 la r7, r1, PTO; /* add user context as 3rd arg */
467 brlid r15, sys_rt_sigsuspend; /* Do real work.*/
468 nop;
469 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
470 lwi r4, r1, PTO+PT_R4;
471 bri ret_from_trap /* fall through will not work here due to align */
472 nop;
473
474
475C_ENTRY(sys_sigreturn_wrapper):
476 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
477 swi r4, r1, PTO+PT_R4;
478 la r5, r1, PTO; /* add user context as 1st arg */
479 brlid r15, sys_sigreturn; /* Do real work.*/
480 nop;
481 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
482 lwi r4, r1, PTO+PT_R4;
483 bri ret_from_trap /* fall through will not work here due to align */
484 nop;
485
486C_ENTRY(sys_rt_sigreturn_wrapper):
487 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
488 swi r4, r1, PTO+PT_R4;
489 la r5, r1, PTO; /* add user context as 1st arg */
490 brlid r15, sys_rt_sigreturn /* Do real work */
491 nop;
492 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
493 lwi r4, r1, PTO+PT_R4;
494 bri ret_from_trap /* fall through will not work here due to align */
495 nop;
496
497/*
498 * HW EXCEPTION rutine start
499 */
500
501#define SAVE_STATE \
502 swi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* Save r11 */ \
503 set_bip; /*equalize initial state for all possible entries*/\
504 clear_eip; \
505 enable_irq; \
506 set_ee; \
507 /* See if already in kernel mode.*/ \
508 lwi r11, r0, TOPHYS(PER_CPU(KM)); \
509 beqi r11, 1f; /* Jump ahead if coming from user */\
510 /* Kernel-mode state save. */ \
511 /* Reload kernel stack-ptr. */ \
512 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); \
513 tophys(r1,r11); \
514 swi r11, r1, (PT_R1-PT_SIZE); /* Save original SP. */ \
515 lwi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* restore r11 */\
516 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */\
517 /* store return registers separately because \
518 * this macros is use for others exceptions */ \
519 swi r3, r1, PTO + PT_R3; \
520 swi r4, r1, PTO + PT_R4; \
521 SAVE_REGS \
522 /* PC, before IRQ/trap - this is one instruction above */ \
523 swi r17, r1, PTO+PT_PC; \
524 \
525 addi r11, r0, 1; /* Was in kernel-mode. */ \
526 swi r11, r1, PTO+PT_MODE; \
527 brid 2f; \
528 nop; /* Fill delay slot */ \
5291: /* User-mode state save. */ \
530 lwi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* restore r11 */\
531 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */\
532 tophys(r1,r1); \
533 lwi r1, r1, TS_THREAD_INFO; /* get the thread info */ \
534 addik r1, r1, THREAD_SIZE; /* calculate kernel stack pointer */\
535 tophys(r1,r1); \
536 \
537 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */\
538 /* store return registers separately because this macros \
539 * is use for others exceptions */ \
540 swi r3, r1, PTO + PT_R3; \
541 swi r4, r1, PTO + PT_R4; \
542 SAVE_REGS \
543 /* PC, before IRQ/trap - this is one instruction above FIXME*/ \
544 swi r17, r1, PTO+PT_PC; \
545 \
546 swi r0, r1, PTO+PT_MODE; /* Was in user-mode. */ \
547 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); \
548 swi r11, r1, PTO+PT_R1; /* Store user SP. */ \
549 addi r11, r0, 1; \
550 swi r11, r0, TOPHYS(PER_CPU(KM)); /* Now we're in kernel-mode.*/\
5512: lwi r31, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */\
552 /* Save away the syscall number. */ \
553 swi r0, r1, PTO+PT_R0; \
554 tovirt(r1,r1)
555
556C_ENTRY(full_exception_trap):
557 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
558 /* adjust exception address for privileged instruction
559 * for finding where is it */
560 addik r17, r17, -4
561 SAVE_STATE /* Save registers */
562 /* FIXME this can be store directly in PT_ESR reg.
563 * I tested it but there is a fault */
564 /* where the trap should return need -8 to adjust for rtsd r15, 8 */
565 la r15, r0, ret_from_exc - 8
566 la r5, r1, PTO /* parameter struct pt_regs * regs */
567 mfs r6, resr
568 nop
569 mfs r7, rfsr; /* save FSR */
570 nop
571 la r12, r0, full_exception
572 set_vms;
573 rtbd r12, 0;
574 nop;
575
576/*
577 * Unaligned data trap.
578 *
579 * Unaligned data trap last on 4k page is handled here.
580 *
581 * Trap entered via exception, so EE bit is set, and interrupts
582 * are masked. This is nice, means we don't have to CLI before state save
583 *
584 * The assembler routine is in "arch/microblaze/kernel/hw_exception_handler.S"
585 */
586C_ENTRY(unaligned_data_trap):
587 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
588 SAVE_STATE /* Save registers.*/
589 /* where the trap should return need -8 to adjust for rtsd r15, 8 */
590 la r15, r0, ret_from_exc-8
591 mfs r3, resr /* ESR */
592 nop
593 mfs r4, rear /* EAR */
594 nop
595 la r7, r1, PTO /* parameter struct pt_regs * regs */
596 la r12, r0, _unaligned_data_exception
597 set_vms;
598 rtbd r12, 0; /* interrupts enabled */
599 nop;
600
601/*
602 * Page fault traps.
603 *
604 * If the real exception handler (from hw_exception_handler.S) didn't find
605 * the mapping for the process, then we're thrown here to handle such situation.
606 *
607 * Trap entered via exceptions, so EE bit is set, and interrupts
608 * are masked. This is nice, means we don't have to CLI before state save
609 *
610 * Build a standard exception frame for TLB Access errors. All TLB exceptions
611 * will bail out to this point if they can't resolve the lightweight TLB fault.
612 *
613 * The C function called is in "arch/microblaze/mm/fault.c", declared as:
614 * void do_page_fault(struct pt_regs *regs,
615 * unsigned long address,
616 * unsigned long error_code)
617 */
618/* data and intruction trap - which is choose is resolved int fault.c */
619C_ENTRY(page_fault_data_trap):
620 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
621 SAVE_STATE /* Save registers.*/
622 /* where the trap should return need -8 to adjust for rtsd r15, 8 */
623 la r15, r0, ret_from_exc-8
624 la r5, r1, PTO /* parameter struct pt_regs * regs */
625 mfs r6, rear /* parameter unsigned long address */
626 nop
627 mfs r7, resr /* parameter unsigned long error_code */
628 nop
629 la r12, r0, do_page_fault
630 set_vms;
631 rtbd r12, 0; /* interrupts enabled */
632 nop;
633
634C_ENTRY(page_fault_instr_trap):
635 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
636 SAVE_STATE /* Save registers.*/
637 /* where the trap should return need -8 to adjust for rtsd r15, 8 */
638 la r15, r0, ret_from_exc-8
639 la r5, r1, PTO /* parameter struct pt_regs * regs */
640 mfs r6, rear /* parameter unsigned long address */
641 nop
642 ori r7, r0, 0 /* parameter unsigned long error_code */
643 la r12, r0, do_page_fault
644 set_vms;
645 rtbd r12, 0; /* interrupts enabled */
646 nop;
647
648/* Entry point used to return from an exception. */
649C_ENTRY(ret_from_exc):
650 set_bip; /* Ints masked for state restore*/
651 lwi r11, r1, PTO+PT_MODE;
652 bnei r11, 2f; /* See if returning to kernel mode, */
653 /* ... if so, skip resched &c. */
654
655 /* We're returning to user mode, so check for various conditions that
656 trigger rescheduling. */
657 /* Get current task ptr into r11 */
658 add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
659 lwi r11, r11, TS_THREAD_INFO; /* get thread info */
660 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
661 andi r11, r11, _TIF_NEED_RESCHED;
662 beqi r11, 5f;
663
664/* Call the scheduler before returning from a syscall/trap. */
665 bralid r15, schedule; /* Call scheduler */
666 nop; /* delay slot */
667
668 /* Maybe handle a signal */
6695: add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
670 lwi r11, r11, TS_THREAD_INFO; /* get thread info */
671 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
672 andi r11, r11, _TIF_SIGPENDING;
673 beqi r11, 1f; /* Signals to handle, handle them */
674
675 /*
676 * Handle a signal return; Pending signals should be in r18.
677 *
678 * Not all registers are saved by the normal trap/interrupt entry
679 * points (for instance, call-saved registers (because the normal
680 * C-compiler calling sequence in the kernel makes sure they're
681 * preserved), and call-clobbered registers in the case of
682 * traps), but signal handlers may want to examine or change the
683 * complete register state. Here we save anything not saved by
684 * the normal entry sequence, so that it may be safely restored
685 * (in a possibly modified form) after do_signal returns.
686 * store return registers separately because this macros is use
687 * for others exceptions */
688 swi r3, r1, PTO + PT_R3;
689 swi r4, r1, PTO + PT_R4;
690 la r5, r1, PTO; /* Arg 1: struct pt_regs *regs */
691 add r6, r0, r0; /* Arg 2: sigset_t *oldset */
692 addi r7, r0, 0; /* Arg 3: int in_syscall */
693 bralid r15, do_signal; /* Handle any signals */
694 nop;
695 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
696 lwi r4, r1, PTO+PT_R4;
697
698/* Finally, return to user state. */
6991: swi r0, r0, PER_CPU(KM); /* Now officially in user state. */
700 add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
701 swi r11, r0, PER_CPU(CURRENT_SAVE); /* save current */
702 VM_OFF;
703 tophys(r1,r1);
704
705 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
706 lwi r4, r1, PTO+PT_R4;
707 RESTORE_REGS;
708 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space. */
709
710 lwi r1, r1, PT_R1 - PT_SIZE; /* Restore user stack pointer. */
711 bri 6f;
712/* Return to kernel state. */
7132: VM_OFF;
714 tophys(r1,r1);
715 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
716 lwi r4, r1, PTO+PT_R4;
717 RESTORE_REGS;
718 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space. */
719
720 tovirt(r1,r1);
7216:
722EXC_return: /* Make global symbol for debugging */
723 rtbd r14, 0; /* Instructions to return from an IRQ */
724 nop;
725
726/*
727 * HW EXCEPTION rutine end
728 */
729
730/*
731 * Hardware maskable interrupts.
732 *
733 * The stack-pointer (r1) should have already been saved to the memory
734 * location PER_CPU(ENTRY_SP).
735 */
736C_ENTRY(_interrupt):
737/* MS: we are in physical address */
738/* Save registers, switch to proper stack, convert SP to virtual.*/
739 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP))
740 swi r11, r0, TOPHYS(PER_CPU(R11_SAVE));
741 /* MS: See if already in kernel mode. */
742 lwi r11, r0, TOPHYS(PER_CPU(KM));
743 beqi r11, 1f; /* MS: Jump ahead if coming from user */
744
745/* Kernel-mode state save. */
746 or r11, r1, r0
747 tophys(r1,r11); /* MS: I have in r1 physical address where stack is */
748/* MS: Save original SP - position PT_R1 to next stack frame 4 *1 - 152*/
749 swi r11, r1, (PT_R1 - PT_SIZE);
750/* MS: restore r11 because of saving in SAVE_REGS */
751 lwi r11, r0, TOPHYS(PER_CPU(R11_SAVE));
752 /* save registers */
753/* MS: Make room on the stack -> activation record */
754 addik r1, r1, -STATE_SAVE_SIZE;
755/* MS: store return registers separately because
756 * this macros is use for others exceptions */
757 swi r3, r1, PTO + PT_R3;
758 swi r4, r1, PTO + PT_R4;
759 SAVE_REGS
760 /* MS: store mode */
761 addi r11, r0, 1; /* MS: Was in kernel-mode. */
762 swi r11, r1, PTO + PT_MODE; /* MS: and save it */
763 brid 2f;
764 nop; /* MS: Fill delay slot */
765
7661:
767/* User-mode state save. */
768/* MS: restore r11 -> FIXME move before SAVE_REG */
769 lwi r11, r0, TOPHYS(PER_CPU(R11_SAVE));
770 /* MS: get the saved current */
771 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
772 tophys(r1,r1);
773 lwi r1, r1, TS_THREAD_INFO;
774 addik r1, r1, THREAD_SIZE;
775 tophys(r1,r1);
776 /* save registers */
777 addik r1, r1, -STATE_SAVE_SIZE;
778 swi r3, r1, PTO+PT_R3;
779 swi r4, r1, PTO+PT_R4;
780 SAVE_REGS
781 /* calculate mode */
782 swi r0, r1, PTO + PT_MODE;
783 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
784 swi r11, r1, PTO+PT_R1;
785 /* setup kernel mode to KM */
786 addi r11, r0, 1;
787 swi r11, r0, TOPHYS(PER_CPU(KM));
788
7892:
790 lwi r31, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
791 swi r0, r1, PTO + PT_R0;
792 tovirt(r1,r1)
793 la r5, r1, PTO;
794 set_vms;
795 la r11, r0, do_IRQ;
796 la r15, r0, irq_call;
797irq_call:rtbd r11, 0;
798 nop;
799
800/* MS: we are in virtual mode */
801ret_from_irq:
802 lwi r11, r1, PTO + PT_MODE;
803 bnei r11, 2f;
804
805 add r11, r0, CURRENT_TASK;
806 lwi r11, r11, TS_THREAD_INFO;
807 lwi r11, r11, TI_FLAGS; /* MS: get flags from thread info */
808 andi r11, r11, _TIF_NEED_RESCHED;
809 beqi r11, 5f
810 bralid r15, schedule;
811 nop; /* delay slot */
812
813 /* Maybe handle a signal */
8145: add r11, r0, CURRENT_TASK;
815 lwi r11, r11, TS_THREAD_INFO; /* MS: get thread info */
816 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
817 andi r11, r11, _TIF_SIGPENDING;
818 beqid r11, no_intr_resched
819/* Handle a signal return; Pending signals should be in r18. */
820 addi r7, r0, 0; /* Arg 3: int in_syscall */
821 la r5, r1, PTO; /* Arg 1: struct pt_regs *regs */
822 bralid r15, do_signal; /* Handle any signals */
823 add r6, r0, r0; /* Arg 2: sigset_t *oldset */
824
825/* Finally, return to user state. */
826no_intr_resched:
827 /* Disable interrupts, we are now committed to the state restore */
828 disable_irq
829 swi r0, r0, PER_CPU(KM); /* MS: Now officially in user state. */
830 add r11, r0, CURRENT_TASK;
831 swi r11, r0, PER_CPU(CURRENT_SAVE);
832 VM_OFF;
833 tophys(r1,r1);
834 lwi r3, r1, PTO + PT_R3; /* MS: restore saved r3, r4 registers */
835 lwi r4, r1, PTO + PT_R4;
836 RESTORE_REGS
837 addik r1, r1, STATE_SAVE_SIZE /* MS: Clean up stack space. */
838 lwi r1, r1, PT_R1 - PT_SIZE;
839 bri 6f;
840/* MS: Return to kernel state. */
8412: VM_OFF /* MS: turn off MMU */
842 tophys(r1,r1)
843 lwi r3, r1, PTO + PT_R3; /* MS: restore saved r3, r4 registers */
844 lwi r4, r1, PTO + PT_R4;
845 RESTORE_REGS
846 addik r1, r1, STATE_SAVE_SIZE /* MS: Clean up stack space. */
847 tovirt(r1,r1);
8486:
849IRQ_return: /* MS: Make global symbol for debugging */
850 rtid r14, 0
851 nop
852
853/*
854 * `Debug' trap
855 * We enter dbtrap in "BIP" (breakpoint) mode.
856 * So we exit the breakpoint mode with an 'rtbd' and proceed with the
857 * original dbtrap.
858 * however, wait to save state first
859 */
860C_ENTRY(_debug_exception):
861 /* BIP bit is set on entry, no interrupts can occur */
862 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP))
863
864 swi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* Save r11 */
865 set_bip; /*equalize initial state for all possible entries*/
866 clear_eip;
867 enable_irq;
868 lwi r11, r0, TOPHYS(PER_CPU(KM));/* See if already in kernel mode.*/
869 beqi r11, 1f; /* Jump ahead if coming from user */
870 /* Kernel-mode state save. */
871 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); /* Reload kernel stack-ptr*/
872 tophys(r1,r11);
873 swi r11, r1, (PT_R1-PT_SIZE); /* Save original SP. */
874 lwi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* restore r11 */
875
876 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */
877 swi r3, r1, PTO + PT_R3;
878 swi r4, r1, PTO + PT_R4;
879 SAVE_REGS;
880
881 addi r11, r0, 1; /* Was in kernel-mode. */
882 swi r11, r1, PTO + PT_MODE;
883 brid 2f;
884 nop; /* Fill delay slot */
8851: /* User-mode state save. */
886 lwi r11, r0, TOPHYS(r0_ram + PTO + PT_R11); /* restore r11 */
887 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */
888 tophys(r1,r1);
889 lwi r1, r1, TS_THREAD_INFO; /* get the thread info */
890 addik r1, r1, THREAD_SIZE; /* calculate kernel stack pointer */
891 tophys(r1,r1);
892
893 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */
894 swi r3, r1, PTO + PT_R3;
895 swi r4, r1, PTO + PT_R4;
896 SAVE_REGS;
897
898 swi r0, r1, PTO+PT_MODE; /* Was in user-mode. */
899 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
900 swi r11, r1, PTO+PT_R1; /* Store user SP. */
901 addi r11, r0, 1;
902 swi r11, r0, TOPHYS(PER_CPU(KM)); /* Now we're in kernel-mode. */
9032: lwi r31, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */
904 /* Save away the syscall number. */
905 swi r0, r1, PTO+PT_R0;
906 tovirt(r1,r1)
907
908 addi r5, r0, SIGTRAP /* send the trap signal */
909 add r6, r0, CURRENT_TASK; /* Get current task ptr into r11 */
910 addk r7, r0, r0 /* 3rd param zero */
911
912 set_vms;
913 la r11, r0, send_sig;
914 la r15, r0, dbtrap_call;
915dbtrap_call: rtbd r11, 0;
916 nop;
917
918 set_bip; /* Ints masked for state restore*/
919 lwi r11, r1, PTO+PT_MODE;
920 bnei r11, 2f;
921
922 /* Get current task ptr into r11 */
923 add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
924 lwi r11, r11, TS_THREAD_INFO; /* get thread info */
925 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
926 andi r11, r11, _TIF_NEED_RESCHED;
927 beqi r11, 5f;
928
929/* Call the scheduler before returning from a syscall/trap. */
930
931 bralid r15, schedule; /* Call scheduler */
932 nop; /* delay slot */
933 /* XXX Is PT_DTRACE handling needed here? */
934 /* XXX m68knommu also checks TASK_STATE & TASK_COUNTER here. */
935
936 /* Maybe handle a signal */
9375: add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
938 lwi r11, r11, TS_THREAD_INFO; /* get thread info */
939 lwi r11, r11, TI_FLAGS; /* get flags in thread info */
940 andi r11, r11, _TIF_SIGPENDING;
941 beqi r11, 1f; /* Signals to handle, handle them */
942
943/* Handle a signal return; Pending signals should be in r18. */
944 /* Not all registers are saved by the normal trap/interrupt entry
945 points (for instance, call-saved registers (because the normal
946 C-compiler calling sequence in the kernel makes sure they're
947 preserved), and call-clobbered registers in the case of
948 traps), but signal handlers may want to examine or change the
949 complete register state. Here we save anything not saved by
950 the normal entry sequence, so that it may be safely restored
951 (in a possibly modified form) after do_signal returns. */
952
953 la r5, r1, PTO; /* Arg 1: struct pt_regs *regs */
954 add r6, r0, r0; /* Arg 2: sigset_t *oldset */
955 addi r7, r0, 0; /* Arg 3: int in_syscall */
956 bralid r15, do_signal; /* Handle any signals */
957 nop;
958
959
960/* Finally, return to user state. */
9611: swi r0, r0, PER_CPU(KM); /* Now officially in user state. */
962 add r11, r0, CURRENT_TASK; /* Get current task ptr into r11 */
963 swi r11, r0, PER_CPU(CURRENT_SAVE); /* save current */
964 VM_OFF;
965 tophys(r1,r1);
966
967 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
968 lwi r4, r1, PTO+PT_R4;
969 RESTORE_REGS
970 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space. */
971
972
973 lwi r1, r1, PT_R1 - PT_SIZE;
974 /* Restore user stack pointer. */
975 bri 6f;
976
977/* Return to kernel state. */
9782: VM_OFF;
979 tophys(r1,r1);
980 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
981 lwi r4, r1, PTO+PT_R4;
982 RESTORE_REGS
983 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space. */
984
985 tovirt(r1,r1);
9866:
987DBTRAP_return: /* Make global symbol for debugging */
988 rtbd r14, 0; /* Instructions to return from an IRQ */
989 nop;
990
991
992
993ENTRY(_switch_to)
994 /* prepare return value */
995 addk r3, r0, r31
996
997 /* save registers in cpu_context */
998 /* use r11 and r12, volatile registers, as temp register */
999 /* give start of cpu_context for previous process */
1000 addik r11, r5, TI_CPU_CONTEXT
1001 swi r1, r11, CC_R1
1002 swi r2, r11, CC_R2
1003 /* skip volatile registers.
1004 * they are saved on stack when we jumped to _switch_to() */
1005 /* dedicated registers */
1006 swi r13, r11, CC_R13
1007 swi r14, r11, CC_R14
1008 swi r15, r11, CC_R15
1009 swi r16, r11, CC_R16
1010 swi r17, r11, CC_R17
1011 swi r18, r11, CC_R18
1012 /* save non-volatile registers */
1013 swi r19, r11, CC_R19
1014 swi r20, r11, CC_R20
1015 swi r21, r11, CC_R21
1016 swi r22, r11, CC_R22
1017 swi r23, r11, CC_R23
1018 swi r24, r11, CC_R24
1019 swi r25, r11, CC_R25
1020 swi r26, r11, CC_R26
1021 swi r27, r11, CC_R27
1022 swi r28, r11, CC_R28
1023 swi r29, r11, CC_R29
1024 swi r30, r11, CC_R30
1025 /* special purpose registers */
1026 mfs r12, rmsr
1027 nop
1028 swi r12, r11, CC_MSR
1029 mfs r12, rear
1030 nop
1031 swi r12, r11, CC_EAR
1032 mfs r12, resr
1033 nop
1034 swi r12, r11, CC_ESR
1035 mfs r12, rfsr
1036 nop
1037 swi r12, r11, CC_FSR
1038
1039 /* update r31, the current */
1040 lwi r31, r6, TI_TASK/* give me pointer to task which will be next */
1041 /* stored it to current_save too */
1042 swi r31, r0, PER_CPU(CURRENT_SAVE)
1043
1044 /* get new process' cpu context and restore */
1045 /* give me start where start context of next task */
1046 addik r11, r6, TI_CPU_CONTEXT
1047
1048 /* non-volatile registers */
1049 lwi r30, r11, CC_R30
1050 lwi r29, r11, CC_R29
1051 lwi r28, r11, CC_R28
1052 lwi r27, r11, CC_R27
1053 lwi r26, r11, CC_R26
1054 lwi r25, r11, CC_R25
1055 lwi r24, r11, CC_R24
1056 lwi r23, r11, CC_R23
1057 lwi r22, r11, CC_R22
1058 lwi r21, r11, CC_R21
1059 lwi r20, r11, CC_R20
1060 lwi r19, r11, CC_R19
1061 /* dedicated registers */
1062 lwi r18, r11, CC_R18
1063 lwi r17, r11, CC_R17
1064 lwi r16, r11, CC_R16
1065 lwi r15, r11, CC_R15
1066 lwi r14, r11, CC_R14
1067 lwi r13, r11, CC_R13
1068 /* skip volatile registers */
1069 lwi r2, r11, CC_R2
1070 lwi r1, r11, CC_R1
1071
1072 /* special purpose registers */
1073 lwi r12, r11, CC_FSR
1074 mts rfsr, r12
1075 nop
1076 lwi r12, r11, CC_MSR
1077 mts rmsr, r12
1078 nop
1079
1080 rtsd r15, 8
1081 nop
1082
1083ENTRY(_reset)
1084 brai 0x70; /* Jump back to FS-boot */
1085
1086ENTRY(_break)
1087 mfs r5, rmsr
1088 nop
1089 swi r5, r0, 0x250 + TOPHYS(r0_ram)
1090 mfs r5, resr
1091 nop
1092 swi r5, r0, 0x254 + TOPHYS(r0_ram)
1093 bri 0
1094
1095 /* These are compiled and loaded into high memory, then
1096 * copied into place in mach_early_setup */
1097 .section .init.ivt, "ax"
1098 .org 0x0
1099 /* this is very important - here is the reset vector */
1100 /* in current MMU branch you don't care what is here - it is
1101 * used from bootloader site - but this is correct for FS-BOOT */
1102 brai 0x70
1103 nop
1104 brai TOPHYS(_user_exception); /* syscall handler */
1105 brai TOPHYS(_interrupt); /* Interrupt handler */
1106 brai TOPHYS(_break); /* nmi trap handler */
1107 brai TOPHYS(_hw_exception_handler); /* HW exception handler */
1108
1109 .org 0x60
1110 brai TOPHYS(_debug_exception); /* debug trap handler*/
1111
1112.section .rodata,"a"
1113#include "syscall_table.S"
1114
1115syscall_table_size=(.-sys_call_table)
1116
diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c
index 4a8a4064c7ee..0cb64a31e89a 100644
--- a/arch/microblaze/kernel/exceptions.c
+++ b/arch/microblaze/kernel/exceptions.c
@@ -21,9 +21,9 @@
21 21
22#include <asm/exceptions.h> 22#include <asm/exceptions.h>
23#include <asm/entry.h> /* For KM CPU var */ 23#include <asm/entry.h> /* For KM CPU var */
24#include <asm/uaccess.h> 24#include <linux/uaccess.h>
25#include <asm/errno.h> 25#include <linux/errno.h>
26#include <asm/ptrace.h> 26#include <linux/ptrace.h>
27#include <asm/current.h> 27#include <asm/current.h>
28 28
29#define MICROBLAZE_ILL_OPCODE_EXCEPTION 0x02 29#define MICROBLAZE_ILL_OPCODE_EXCEPTION 0x02
@@ -31,7 +31,7 @@
31#define MICROBLAZE_DBUS_EXCEPTION 0x04 31#define MICROBLAZE_DBUS_EXCEPTION 0x04
32#define MICROBLAZE_DIV_ZERO_EXCEPTION 0x05 32#define MICROBLAZE_DIV_ZERO_EXCEPTION 0x05
33#define MICROBLAZE_FPU_EXCEPTION 0x06 33#define MICROBLAZE_FPU_EXCEPTION 0x06
34#define MICROBLAZE_PRIVILEG_EXCEPTION 0x07 34#define MICROBLAZE_PRIVILEGED_EXCEPTION 0x07
35 35
36static DEFINE_SPINLOCK(die_lock); 36static DEFINE_SPINLOCK(die_lock);
37 37
@@ -66,6 +66,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
66asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, 66asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
67 int fsr, int addr) 67 int fsr, int addr)
68{ 68{
69#ifdef CONFIG_MMU
70 int code;
71 addr = regs->pc;
72#endif
73
69#if 0 74#if 0
70 printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n", 75 printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n",
71 type, user_mode(regs) ? "user" : "kernel", fsr, 76 type, user_mode(regs) ? "user" : "kernel", fsr,
@@ -74,7 +79,13 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
74 79
75 switch (type & 0x1F) { 80 switch (type & 0x1F) {
76 case MICROBLAZE_ILL_OPCODE_EXCEPTION: 81 case MICROBLAZE_ILL_OPCODE_EXCEPTION:
77 _exception(SIGILL, regs, ILL_ILLOPC, addr); 82 if (user_mode(regs)) {
83 printk(KERN_WARNING "Illegal opcode exception in user mode.\n");
84 _exception(SIGILL, regs, ILL_ILLOPC, addr);
85 return;
86 }
87 printk(KERN_WARNING "Illegal opcode exception in kernel mode.\n");
88 die("opcode exception", regs, SIGBUS);
78 break; 89 break;
79 case MICROBLAZE_IBUS_EXCEPTION: 90 case MICROBLAZE_IBUS_EXCEPTION:
80 if (user_mode(regs)) { 91 if (user_mode(regs)) {
@@ -95,11 +106,16 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
95 die("bus exception", regs, SIGBUS); 106 die("bus exception", regs, SIGBUS);
96 break; 107 break;
97 case MICROBLAZE_DIV_ZERO_EXCEPTION: 108 case MICROBLAZE_DIV_ZERO_EXCEPTION:
98 printk(KERN_WARNING "Divide by zero exception\n"); 109 if (user_mode(regs)) {
99 _exception(SIGILL, regs, ILL_ILLOPC, addr); 110 printk(KERN_WARNING "Divide by zero exception in user mode\n");
111 _exception(SIGILL, regs, ILL_ILLOPC, addr);
112 return;
113 }
114 printk(KERN_WARNING "Divide by zero exception in kernel mode.\n");
115 die("Divide by exception", regs, SIGBUS);
100 break; 116 break;
101
102 case MICROBLAZE_FPU_EXCEPTION: 117 case MICROBLAZE_FPU_EXCEPTION:
118 printk(KERN_WARNING "FPU exception\n");
103 /* IEEE FP exception */ 119 /* IEEE FP exception */
104 /* I removed fsr variable and use code var for storing fsr */ 120 /* I removed fsr variable and use code var for storing fsr */
105 if (fsr & FSR_IO) 121 if (fsr & FSR_IO)
@@ -115,7 +131,20 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
115 _exception(SIGFPE, regs, fsr, addr); 131 _exception(SIGFPE, regs, fsr, addr);
116 break; 132 break;
117 133
134#ifdef CONFIG_MMU
135 case MICROBLAZE_PRIVILEGED_EXCEPTION:
136 printk(KERN_WARNING "Privileged exception\n");
137 /* "brk r0,r0" - used as debug breakpoint */
138 if (get_user(code, (unsigned long *)regs->pc) == 0
139 && code == 0x980c0000) {
140 _exception(SIGTRAP, regs, TRAP_BRKPT, addr);
141 } else {
142 _exception(SIGILL, regs, ILL_PRVOPC, addr);
143 }
144 break;
145#endif
118 default: 146 default:
147 /* FIXME what to do in unexpected exception */
119 printk(KERN_WARNING "Unexpected exception %02x " 148 printk(KERN_WARNING "Unexpected exception %02x "
120 "PC=%08x in %s mode\n", type, (unsigned int) addr, 149 "PC=%08x in %s mode\n", type, (unsigned int) addr,
121 kernel_mode(regs) ? "kernel" : "user"); 150 kernel_mode(regs) ? "kernel" : "user");
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index 319dc35fc922..e568d6ec621b 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -3,6 +3,26 @@
3 * Copyright (C) 2007-2009 PetaLogix 3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc. 4 * Copyright (C) 2006 Atmark Techno, Inc.
5 * 5 *
6 * MMU code derived from arch/ppc/kernel/head_4xx.S:
7 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
8 * Initial PowerPC version.
9 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
10 * Rewritten for PReP
11 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
12 * Low-level exception handers, MMU support, and rewrite.
13 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
14 * PowerPC 8xx modifications.
15 * Copyright (c) 1998-1999 TiVo, Inc.
16 * PowerPC 403GCX modifications.
17 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
18 * PowerPC 403GCX/405GP modifications.
19 * Copyright 2000 MontaVista Software Inc.
20 * PPC405 modifications
21 * PowerPC 403GCX/405GP modifications.
22 * Author: MontaVista Software, Inc.
23 * frank_rowand@mvista.com or source@mvista.com
24 * debbie_chu@mvista.com
25 *
6 * This file is subject to the terms and conditions of the GNU General Public 26 * 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 27 * License. See the file "COPYING" in the main directory of this archive
8 * for more details. 28 * for more details.
@@ -12,6 +32,22 @@
12#include <asm/thread_info.h> 32#include <asm/thread_info.h>
13#include <asm/page.h> 33#include <asm/page.h>
14 34
35#ifdef CONFIG_MMU
36#include <asm/setup.h> /* COMMAND_LINE_SIZE */
37#include <asm/mmu.h>
38#include <asm/processor.h>
39
40.data
41.global empty_zero_page
42.align 12
43empty_zero_page:
44 .space 4096
45.global swapper_pg_dir
46swapper_pg_dir:
47 .space 4096
48
49#endif /* CONFIG_MMU */
50
15 .text 51 .text
16ENTRY(_start) 52ENTRY(_start)
17 mfs r1, rmsr 53 mfs r1, rmsr
@@ -32,6 +68,123 @@ _copy_fdt:
32 addik r3, r3, -4 /* descrement loop */ 68 addik r3, r3, -4 /* descrement loop */
33no_fdt_arg: 69no_fdt_arg:
34 70
71#ifdef CONFIG_MMU
72
73#ifndef CONFIG_CMDLINE_BOOL
74/*
75 * handling command line
76 * copy command line to __init_end. There is space for storing command line.
77 */
78 or r6, r0, r0 /* incremment */
79 ori r4, r0, __init_end /* load address of command line */
80 tophys(r4,r4) /* convert to phys address */
81 ori r3, r0, COMMAND_LINE_SIZE - 1 /* number of loops */
82_copy_command_line:
83 lbu r7, r5, r6 /* r7=r5+r6 - r5 contain pointer to command line */
84 sb r7, r4, r6 /* addr[r4+r6]= r7*/
85 addik r6, r6, 1 /* increment counting */
86 bgtid r3, _copy_command_line /* loop for all entries */
87 addik r3, r3, -1 /* descrement loop */
88 addik r5, r4, 0 /* add new space for command line */
89 tovirt(r5,r5)
90#endif /* CONFIG_CMDLINE_BOOL */
91
92#ifdef NOT_COMPILE
93/* save bram context */
94 or r6, r0, r0 /* incremment */
95 ori r4, r0, TOPHYS(_bram_load_start) /* save bram context */
96 ori r3, r0, (LMB_SIZE - 4)
97_copy_bram:
98 lw r7, r0, r6 /* r7 = r0 + r6 */
99 sw r7, r4, r6 /* addr[r4 + r6] = r7*/
100 addik r6, r6, 4 /* increment counting */
101 bgtid r3, _copy_bram /* loop for all entries */
102 addik r3, r3, -4 /* descrement loop */
103#endif
104 /* We have to turn on the MMU right away. */
105
106 /*
107 * Set up the initial MMU state so we can do the first level of
108 * kernel initialization. This maps the first 16 MBytes of memory 1:1
109 * virtual to physical.
110 */
111 nop
112 addik r3, r0, 63 /* Invalidate all TLB entries */
113_invalidate:
114 mts rtlbx, r3
115 mts rtlbhi, r0 /* flush: ensure V is clear */
116 bgtid r3, _invalidate /* loop for all entries */
117 addik r3, r3, -1
118 /* sync */
119
120 /*
121 * We should still be executing code at physical address area
122 * RAM_BASEADDR at this point. However, kernel code is at
123 * a virtual address. So, set up a TLB mapping to cover this once
124 * translation is enabled.
125 */
126
127 addik r3,r0, CONFIG_KERNEL_START /* Load the kernel virtual address */
128 tophys(r4,r3) /* Load the kernel physical address */
129
130 mts rpid,r0 /* Load the kernel PID */
131 nop
132 bri 4
133
134 /*
135 * Configure and load two entries into TLB slots 0 and 1.
136 * In case we are pinning TLBs, these are reserved in by the
137 * other TLB functions. If not reserving, then it doesn't
138 * matter where they are loaded.
139 */
140 andi r4,r4,0xfffffc00 /* Mask off the real page number */
141 ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */
142
143 andi r3,r3,0xfffffc00 /* Mask off the effective page number */
144 ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M))
145
146 mts rtlbx,r0 /* TLB slow 0 */
147
148 mts rtlblo,r4 /* Load the data portion of the entry */
149 mts rtlbhi,r3 /* Load the tag portion of the entry */
150
151 addik r4, r4, 0x01000000 /* Map next 16 M entries */
152 addik r3, r3, 0x01000000
153
154 ori r6,r0,1 /* TLB slot 1 */
155 mts rtlbx,r6
156
157 mts rtlblo,r4 /* Load the data portion of the entry */
158 mts rtlbhi,r3 /* Load the tag portion of the entry */
159
160 /*
161 * Load a TLB entry for LMB, since we need access to
162 * the exception vectors, using a 4k real==virtual mapping.
163 */
164 ori r6,r0,3 /* TLB slot 3 */
165 mts rtlbx,r6
166
167 ori r4,r0,(TLB_WR | TLB_EX)
168 ori r3,r0,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
169
170 mts rtlblo,r4 /* Load the data portion of the entry */
171 mts rtlbhi,r3 /* Load the tag portion of the entry */
172
173 /*
174 * We now have the lower 16 Meg of RAM mapped into TLB entries, and the
175 * caches ready to work.
176 */
177turn_on_mmu:
178 ori r15,r0,start_here
179 ori r4,r0,MSR_KERNEL_VMS
180 mts rmsr,r4
181 nop
182 rted r15,0 /* enables MMU */
183 nop
184
185start_here:
186#endif /* CONFIG_MMU */
187
35 /* Initialize small data anchors */ 188 /* Initialize small data anchors */
36 la r13, r0, _KERNEL_SDA_BASE_ 189 la r13, r0, _KERNEL_SDA_BASE_
37 la r2, r0, _KERNEL_SDA2_BASE_ 190 la r2, r0, _KERNEL_SDA2_BASE_
@@ -51,6 +204,43 @@ no_fdt_arg:
51 brald r15, r8 204 brald r15, r8
52 nop 205 nop
53 206
207#ifndef CONFIG_MMU
54 la r15, r0, machine_halt 208 la r15, r0, machine_halt
55 braid start_kernel 209 braid start_kernel
56 nop 210 nop
211#else
212 /*
213 * Initialize the MMU.
214 */
215 bralid r15, mmu_init
216 nop
217
218 /* Go back to running unmapped so we can load up new values
219 * and change to using our exception vectors.
220 * On the MicroBlaze, all we invalidate the used TLB entries to clear
221 * the old 16M byte TLB mappings.
222 */
223 ori r15,r0,TOPHYS(kernel_load_context)
224 ori r4,r0,MSR_KERNEL
225 mts rmsr,r4
226 nop
227 bri 4
228 rted r15,0
229 nop
230
231 /* Load up the kernel context */
232kernel_load_context:
233 # Keep entry 0 and 1 valid. Entry 3 mapped to LMB can go away.
234 ori r5,r0,3
235 mts rtlbx,r5
236 nop
237 mts rtlbhi,r0
238 nop
239 addi r15, r0, machine_halt
240 ori r17, r0, start_kernel
241 ori r4, r0, MSR_KERNEL_VMS
242 mts rmsr, r4
243 nop
244 rted r17, 0 /* enable MMU and jump to start_kernel */
245 nop
246#endif /* CONFIG_MMU */
diff --git a/arch/microblaze/kernel/hw_exception_handler.S b/arch/microblaze/kernel/hw_exception_handler.S
index cf9486d99838..9d591cd74fc2 100644
--- a/arch/microblaze/kernel/hw_exception_handler.S
+++ b/arch/microblaze/kernel/hw_exception_handler.S
@@ -53,6 +53,12 @@
53 * - Illegal instruction opcode 53 * - Illegal instruction opcode
54 * - Divide-by-zero 54 * - Divide-by-zero
55 * 55 *
56 * - Privileged instruction exception (MMU)
57 * - Data storage exception (MMU)
58 * - Instruction storage exception (MMU)
59 * - Data TLB miss exception (MMU)
60 * - Instruction TLB miss exception (MMU)
61 *
56 * Note we disable interrupts during exception handling, otherwise we will 62 * Note we disable interrupts during exception handling, otherwise we will
57 * possibly get multiple re-entrancy if interrupt handles themselves cause 63 * possibly get multiple re-entrancy if interrupt handles themselves cause
58 * exceptions. JW 64 * exceptions. JW
@@ -71,9 +77,24 @@
71#include <asm/asm-offsets.h> 77#include <asm/asm-offsets.h>
72 78
73/* Helpful Macros */ 79/* Helpful Macros */
80#ifndef CONFIG_MMU
74#define EX_HANDLER_STACK_SIZ (4*19) 81#define EX_HANDLER_STACK_SIZ (4*19)
82#endif
75#define NUM_TO_REG(num) r ## num 83#define NUM_TO_REG(num) r ## num
76 84
85#ifdef CONFIG_MMU
86/* FIXME you can't change first load of MSR because there is
87 * hardcoded jump bri 4 */
88 #define RESTORE_STATE \
89 lwi r3, r1, PT_R3; \
90 lwi r4, r1, PT_R4; \
91 lwi r5, r1, PT_R5; \
92 lwi r6, r1, PT_R6; \
93 lwi r11, r1, PT_R11; \
94 lwi r31, r1, PT_R31; \
95 lwi r1, r0, TOPHYS(r0_ram + 0);
96#endif /* CONFIG_MMU */
97
77#define LWREG_NOP \ 98#define LWREG_NOP \
78 bri ex_handler_unhandled; \ 99 bri ex_handler_unhandled; \
79 nop; 100 nop;
@@ -106,6 +127,54 @@
106 or r3, r0, NUM_TO_REG (regnum); \ 127 or r3, r0, NUM_TO_REG (regnum); \
107 bri ex_sw_tail; 128 bri ex_sw_tail;
108 129
130#ifdef CONFIG_MMU
131 #define R3_TO_LWREG_VM_V(regnum) \
132 brid ex_lw_end_vm; \
133 swi r3, r7, 4 * regnum;
134
135 #define R3_TO_LWREG_VM(regnum) \
136 brid ex_lw_end_vm; \
137 or NUM_TO_REG (regnum), r0, r3;
138
139 #define SWREG_TO_R3_VM_V(regnum) \
140 brid ex_sw_tail_vm; \
141 lwi r3, r7, 4 * regnum;
142
143 #define SWREG_TO_R3_VM(regnum) \
144 brid ex_sw_tail_vm; \
145 or r3, r0, NUM_TO_REG (regnum);
146
147 /* Shift right instruction depending on available configuration */
148 #if CONFIG_XILINX_MICROBLAZE0_USE_BARREL > 0
149 #define BSRLI(rD, rA, imm) \
150 bsrli rD, rA, imm
151 #elif CONFIG_XILINX_MICROBLAZE0_USE_DIV > 0
152 #define BSRLI(rD, rA, imm) \
153 ori rD, r0, (1 << imm); \
154 idivu rD, rD, rA
155 #else
156 #define BSRLI(rD, rA, imm) BSRLI ## imm (rD, rA)
157 /* Only the used shift constants defined here - add more if needed */
158 #define BSRLI2(rD, rA) \
159 srl rD, rA; /* << 1 */ \
160 srl rD, rD; /* << 2 */
161 #define BSRLI10(rD, rA) \
162 srl rD, rA; /* << 1 */ \
163 srl rD, rD; /* << 2 */ \
164 srl rD, rD; /* << 3 */ \
165 srl rD, rD; /* << 4 */ \
166 srl rD, rD; /* << 5 */ \
167 srl rD, rD; /* << 6 */ \
168 srl rD, rD; /* << 7 */ \
169 srl rD, rD; /* << 8 */ \
170 srl rD, rD; /* << 9 */ \
171 srl rD, rD /* << 10 */
172 #define BSRLI20(rD, rA) \
173 BSRLI10(rD, rA); \
174 BSRLI10(rD, rD)
175 #endif
176#endif /* CONFIG_MMU */
177
109.extern other_exception_handler /* Defined in exception.c */ 178.extern other_exception_handler /* Defined in exception.c */
110 179
111/* 180/*
@@ -163,34 +232,119 @@
163 232
164/* wrappers to restore state before coming to entry.S */ 233/* wrappers to restore state before coming to entry.S */
165 234
235#ifdef CONFIG_MMU
236.section .rodata
237.align 4
238_MB_HW_ExceptionVectorTable:
239/* 0 - Undefined */
240 .long TOPHYS(ex_handler_unhandled)
241/* 1 - Unaligned data access exception */
242 .long TOPHYS(handle_unaligned_ex)
243/* 2 - Illegal op-code exception */
244 .long TOPHYS(full_exception_trapw)
245/* 3 - Instruction bus error exception */
246 .long TOPHYS(full_exception_trapw)
247/* 4 - Data bus error exception */
248 .long TOPHYS(full_exception_trapw)
249/* 5 - Divide by zero exception */
250 .long TOPHYS(full_exception_trapw)
251/* 6 - Floating point unit exception */
252 .long TOPHYS(full_exception_trapw)
253/* 7 - Privileged instruction exception */
254 .long TOPHYS(full_exception_trapw)
255/* 8 - 15 - Undefined */
256 .long TOPHYS(ex_handler_unhandled)
257 .long TOPHYS(ex_handler_unhandled)
258 .long TOPHYS(ex_handler_unhandled)
259 .long TOPHYS(ex_handler_unhandled)
260 .long TOPHYS(ex_handler_unhandled)
261 .long TOPHYS(ex_handler_unhandled)
262 .long TOPHYS(ex_handler_unhandled)
263 .long TOPHYS(ex_handler_unhandled)
264/* 16 - Data storage exception */
265 .long TOPHYS(handle_data_storage_exception)
266/* 17 - Instruction storage exception */
267 .long TOPHYS(handle_instruction_storage_exception)
268/* 18 - Data TLB miss exception */
269 .long TOPHYS(handle_data_tlb_miss_exception)
270/* 19 - Instruction TLB miss exception */
271 .long TOPHYS(handle_instruction_tlb_miss_exception)
272/* 20 - 31 - Undefined */
273 .long TOPHYS(ex_handler_unhandled)
274 .long TOPHYS(ex_handler_unhandled)
275 .long TOPHYS(ex_handler_unhandled)
276 .long TOPHYS(ex_handler_unhandled)
277 .long TOPHYS(ex_handler_unhandled)
278 .long TOPHYS(ex_handler_unhandled)
279 .long TOPHYS(ex_handler_unhandled)
280 .long TOPHYS(ex_handler_unhandled)
281 .long TOPHYS(ex_handler_unhandled)
282 .long TOPHYS(ex_handler_unhandled)
283 .long TOPHYS(ex_handler_unhandled)
284 .long TOPHYS(ex_handler_unhandled)
285#endif
286
166.global _hw_exception_handler 287.global _hw_exception_handler
167.section .text 288.section .text
168.align 4 289.align 4
169.ent _hw_exception_handler 290.ent _hw_exception_handler
170_hw_exception_handler: 291_hw_exception_handler:
292#ifndef CONFIG_MMU
171 addik r1, r1, -(EX_HANDLER_STACK_SIZ); /* Create stack frame */ 293 addik r1, r1, -(EX_HANDLER_STACK_SIZ); /* Create stack frame */
294#else
295 swi r1, r0, TOPHYS(r0_ram + 0); /* GET_SP */
296 /* Save date to kernel memory. Here is the problem
297 * when you came from user space */
298 ori r1, r0, TOPHYS(r0_ram + 28);
299#endif
172 swi r3, r1, PT_R3 300 swi r3, r1, PT_R3
173 swi r4, r1, PT_R4 301 swi r4, r1, PT_R4
174 swi r5, r1, PT_R5 302 swi r5, r1, PT_R5
175 swi r6, r1, PT_R6 303 swi r6, r1, PT_R6
176 304
177 mfs r5, rmsr; 305#ifdef CONFIG_MMU
178 nop 306 swi r11, r1, PT_R11
179 swi r5, r1, 0; 307 swi r31, r1, PT_R31
180 mfs r4, rbtr /* Save BTR before jumping to handler */ 308 lwi r31, r0, TOPHYS(PER_CPU(CURRENT_SAVE)) /* get saved current */
181 nop 309#endif
310
182 mfs r3, resr 311 mfs r3, resr
183 nop 312 nop
313 mfs r4, rear;
314 nop
184 315
316#ifndef CONFIG_MMU
185 andi r5, r3, 0x1000; /* Check ESR[DS] */ 317 andi r5, r3, 0x1000; /* Check ESR[DS] */
186 beqi r5, not_in_delay_slot; /* Branch if ESR[DS] not set */ 318 beqi r5, not_in_delay_slot; /* Branch if ESR[DS] not set */
187 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */ 319 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */
188 nop 320 nop
189not_in_delay_slot: 321not_in_delay_slot:
190 swi r17, r1, PT_R17 322 swi r17, r1, PT_R17
323#endif
191 324
192 andi r5, r3, 0x1F; /* Extract ESR[EXC] */ 325 andi r5, r3, 0x1F; /* Extract ESR[EXC] */
193 326
327#ifdef CONFIG_MMU
328 /* Calculate exception vector offset = r5 << 2 */
329 addk r6, r5, r5; /* << 1 */
330 addk r6, r6, r6; /* << 2 */
331
332/* counting which exception happen */
333 lwi r5, r0, 0x200 + TOPHYS(r0_ram)
334 addi r5, r5, 1
335 swi r5, r0, 0x200 + TOPHYS(r0_ram)
336 lwi r5, r6, 0x200 + TOPHYS(r0_ram)
337 addi r5, r5, 1
338 swi r5, r6, 0x200 + TOPHYS(r0_ram)
339/* end */
340 /* Load the HW Exception vector */
341 lwi r6, r6, TOPHYS(_MB_HW_ExceptionVectorTable)
342 bra r6
343
344full_exception_trapw:
345 RESTORE_STATE
346 bri full_exception_trap
347#else
194 /* Exceptions enabled here. This will allow nested exceptions */ 348 /* Exceptions enabled here. This will allow nested exceptions */
195 mfs r6, rmsr; 349 mfs r6, rmsr;
196 nop 350 nop
@@ -254,6 +408,7 @@ handle_other_ex: /* Handle Other exceptions here */
254 lwi r18, r1, PT_R18 408 lwi r18, r1, PT_R18
255 409
256 bri ex_handler_done; /* Complete exception handling */ 410 bri ex_handler_done; /* Complete exception handling */
411#endif
257 412
258/* 0x01 - Unaligned data access exception 413/* 0x01 - Unaligned data access exception
259 * This occurs when a word access is not aligned on a word boundary, 414 * This occurs when a word access is not aligned on a word boundary,
@@ -265,11 +420,28 @@ handle_other_ex: /* Handle Other exceptions here */
265handle_unaligned_ex: 420handle_unaligned_ex:
266 /* Working registers already saved: R3, R4, R5, R6 421 /* Working registers already saved: R3, R4, R5, R6
267 * R3 = ESR 422 * R3 = ESR
268 * R4 = BTR 423 * R4 = EAR
269 */ 424 */
270 mfs r4, rear; 425#ifdef CONFIG_MMU
426 andi r6, r3, 0x1000 /* Check ESR[DS] */
427 beqi r6, _no_delayslot /* Branch if ESR[DS] not set */
428 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */
271 nop 429 nop
430_no_delayslot:
431#endif
432
433#ifdef CONFIG_MMU
434 /* Check if unaligned address is last on a 4k page */
435 andi r5, r4, 0xffc
436 xori r5, r5, 0xffc
437 bnei r5, _unaligned_ex2
438 _unaligned_ex1:
439 RESTORE_STATE;
440/* Another page must be accessed or physical address not in page table */
441 bri unaligned_data_trap
272 442
443 _unaligned_ex2:
444#endif
273 andi r6, r3, 0x3E0; /* Mask and extract the register operand */ 445 andi r6, r3, 0x3E0; /* Mask and extract the register operand */
274 srl r6, r6; /* r6 >> 5 */ 446 srl r6, r6; /* r6 >> 5 */
275 srl r6, r6; 447 srl r6, r6;
@@ -278,6 +450,45 @@ handle_unaligned_ex:
278 srl r6, r6; 450 srl r6, r6;
279 /* Store the register operand in a temporary location */ 451 /* Store the register operand in a temporary location */
280 sbi r6, r0, TOPHYS(ex_reg_op); 452 sbi r6, r0, TOPHYS(ex_reg_op);
453#ifdef CONFIG_MMU
454 /* Get physical address */
455 /* If we are faulting a kernel address, we have to use the
456 * kernel page tables.
457 */
458 ori r5, r0, CONFIG_KERNEL_START
459 cmpu r5, r4, r5
460 bgti r5, _unaligned_ex3
461 ori r5, r0, swapper_pg_dir
462 bri _unaligned_ex4
463
464 /* Get the PGD for the current thread. */
465_unaligned_ex3: /* user thread */
466 addi r5 ,CURRENT_TASK, TOPHYS(0); /* get current task address */
467 lwi r5, r5, TASK_THREAD + PGDIR
468_unaligned_ex4:
469 tophys(r5,r5)
470 BSRLI(r6,r4,20) /* Create L1 (pgdir/pmd) address */
471 andi r6, r6, 0xffc
472/* Assume pgdir aligned on 4K boundary, no need for "andi r5,r5,0xfffff003" */
473 or r5, r5, r6
474 lwi r6, r5, 0 /* Get L1 entry */
475 andi r5, r6, 0xfffff000 /* Extract L2 (pte) base address. */
476 beqi r5, _unaligned_ex1 /* Bail if no table */
477
478 tophys(r5,r5)
479 BSRLI(r6,r4,10) /* Compute PTE address */
480 andi r6, r6, 0xffc
481 andi r5, r5, 0xfffff003
482 or r5, r5, r6
483 lwi r5, r5, 0 /* Get Linux PTE */
484
485 andi r6, r5, _PAGE_PRESENT
486 beqi r6, _unaligned_ex1 /* Bail if no page */
487
488 andi r5, r5, 0xfffff000 /* Extract RPN */
489 andi r4, r4, 0x00000fff /* Extract offset */
490 or r4, r4, r5 /* Create physical address */
491#endif /* CONFIG_MMU */
281 492
282 andi r6, r3, 0x400; /* Extract ESR[S] */ 493 andi r6, r3, 0x400; /* Extract ESR[S] */
283 bnei r6, ex_sw; 494 bnei r6, ex_sw;
@@ -355,6 +566,7 @@ ex_shw:
355ex_sw_end: /* Exception handling of store word, ends. */ 566ex_sw_end: /* Exception handling of store word, ends. */
356 567
357ex_handler_done: 568ex_handler_done:
569#ifndef CONFIG_MMU
358 lwi r5, r1, 0 /* RMSR */ 570 lwi r5, r1, 0 /* RMSR */
359 mts rmsr, r5 571 mts rmsr, r5
360 nop 572 nop
@@ -366,13 +578,455 @@ ex_handler_done:
366 578
367 rted r17, 0 579 rted r17, 0
368 addik r1, r1, (EX_HANDLER_STACK_SIZ); /* Restore stack frame */ 580 addik r1, r1, (EX_HANDLER_STACK_SIZ); /* Restore stack frame */
581#else
582 RESTORE_STATE;
583 rted r17, 0
584 nop
585#endif
586
587#ifdef CONFIG_MMU
588 /* Exception vector entry code. This code runs with address translation
589 * turned off (i.e. using physical addresses). */
590
591 /* Exception vectors. */
592
593 /* 0x10 - Data Storage Exception
594 * This happens for just a few reasons. U0 set (but we don't do that),
595 * or zone protection fault (user violation, write to protected page).
596 * If this is just an update of modified status, we do that quickly
597 * and exit. Otherwise, we call heavyweight functions to do the work.
598 */
599 handle_data_storage_exception:
600 /* Working registers already saved: R3, R4, R5, R6
601 * R3 = ESR
602 */
603 mfs r11, rpid
604 nop
605 bri 4
606 mfs r3, rear /* Get faulting address */
607 nop
608 /* If we are faulting a kernel address, we have to use the
609 * kernel page tables.
610 */
611 ori r4, r0, CONFIG_KERNEL_START
612 cmpu r4, r3, r4
613 bgti r4, ex3
614 /* First, check if it was a zone fault (which means a user
615 * tried to access a kernel or read-protected page - always
616 * a SEGV). All other faults here must be stores, so no
617 * need to check ESR_S as well. */
618 mfs r4, resr
619 nop
620 andi r4, r4, 0x800 /* ESR_Z - zone protection */
621 bnei r4, ex2
622
623 ori r4, r0, swapper_pg_dir
624 mts rpid, r0 /* TLB will have 0 TID */
625 nop
626 bri ex4
627
628 /* Get the PGD for the current thread. */
629 ex3:
630 /* First, check if it was a zone fault (which means a user
631 * tried to access a kernel or read-protected page - always
632 * a SEGV). All other faults here must be stores, so no
633 * need to check ESR_S as well. */
634 mfs r4, resr
635 nop
636 andi r4, r4, 0x800 /* ESR_Z */
637 bnei r4, ex2
638 /* get current task address */
639 addi r4 ,CURRENT_TASK, TOPHYS(0);
640 lwi r4, r4, TASK_THREAD+PGDIR
641 ex4:
642 tophys(r4,r4)
643 BSRLI(r5,r3,20) /* Create L1 (pgdir/pmd) address */
644 andi r5, r5, 0xffc
645/* Assume pgdir aligned on 4K boundary, no need for "andi r4,r4,0xfffff003" */
646 or r4, r4, r5
647 lwi r4, r4, 0 /* Get L1 entry */
648 andi r5, r4, 0xfffff000 /* Extract L2 (pte) base address */
649 beqi r5, ex2 /* Bail if no table */
650
651 tophys(r5,r5)
652 BSRLI(r6,r3,10) /* Compute PTE address */
653 andi r6, r6, 0xffc
654 andi r5, r5, 0xfffff003
655 or r5, r5, r6
656 lwi r4, r5, 0 /* Get Linux PTE */
657
658 andi r6, r4, _PAGE_RW /* Is it writeable? */
659 beqi r6, ex2 /* Bail if not */
660
661 /* Update 'changed' */
662 ori r4, r4, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
663 swi r4, r5, 0 /* Update Linux page table */
664
665 /* Most of the Linux PTE is ready to load into the TLB LO.
666 * We set ZSEL, where only the LS-bit determines user access.
667 * We set execute, because we don't have the granularity to
668 * properly set this at the page level (Linux problem).
669 * If shared is set, we cause a zero PID->TID load.
670 * Many of these bits are software only. Bits we don't set
671 * here we (properly should) assume have the appropriate value.
672 */
673 andni r4, r4, 0x0ce2 /* Make sure 20, 21 are zero */
674 ori r4, r4, _PAGE_HWEXEC /* make it executable */
675
676 /* find the TLB index that caused the fault. It has to be here*/
677 mts rtlbsx, r3
678 nop
679 mfs r5, rtlbx /* DEBUG: TBD */
680 nop
681 mts rtlblo, r4 /* Load TLB LO */
682 nop
683 /* Will sync shadow TLBs */
684
685 /* Done...restore registers and get out of here. */
686 mts rpid, r11
687 nop
688 bri 4
689
690 RESTORE_STATE;
691 rted r17, 0
692 nop
693 ex2:
694 /* The bailout. Restore registers to pre-exception conditions
695 * and call the heavyweights to help us out. */
696 mts rpid, r11
697 nop
698 bri 4
699 RESTORE_STATE;
700 bri page_fault_data_trap
701
702
703 /* 0x11 - Instruction Storage Exception
704 * This is caused by a fetch from non-execute or guarded pages. */
705 handle_instruction_storage_exception:
706 /* Working registers already saved: R3, R4, R5, R6
707 * R3 = ESR
708 */
709
710 mfs r3, rear /* Get faulting address */
711 nop
712 RESTORE_STATE;
713 bri page_fault_instr_trap
714
715 /* 0x12 - Data TLB Miss Exception
716 * As the name implies, translation is not in the MMU, so search the
717 * page tables and fix it. The only purpose of this function is to
718 * load TLB entries from the page table if they exist.
719 */
720 handle_data_tlb_miss_exception:
721 /* Working registers already saved: R3, R4, R5, R6
722 * R3 = ESR
723 */
724 mfs r11, rpid
725 nop
726 bri 4
727 mfs r3, rear /* Get faulting address */
728 nop
729
730 /* If we are faulting a kernel address, we have to use the
731 * kernel page tables. */
732 ori r4, r0, CONFIG_KERNEL_START
733 cmpu r4, r3, r4
734 bgti r4, ex5
735 ori r4, r0, swapper_pg_dir
736 mts rpid, r0 /* TLB will have 0 TID */
737 nop
738 bri ex6
369 739
740 /* Get the PGD for the current thread. */
741 ex5:
742 /* get current task address */
743 addi r4 ,CURRENT_TASK, TOPHYS(0);
744 lwi r4, r4, TASK_THREAD+PGDIR
745 ex6:
746 tophys(r4,r4)
747 BSRLI(r5,r3,20) /* Create L1 (pgdir/pmd) address */
748 andi r5, r5, 0xffc
749/* Assume pgdir aligned on 4K boundary, no need for "andi r4,r4,0xfffff003" */
750 or r4, r4, r5
751 lwi r4, r4, 0 /* Get L1 entry */
752 andi r5, r4, 0xfffff000 /* Extract L2 (pte) base address */
753 beqi r5, ex7 /* Bail if no table */
754
755 tophys(r5,r5)
756 BSRLI(r6,r3,10) /* Compute PTE address */
757 andi r6, r6, 0xffc
758 andi r5, r5, 0xfffff003
759 or r5, r5, r6
760 lwi r4, r5, 0 /* Get Linux PTE */
761
762 andi r6, r4, _PAGE_PRESENT
763 beqi r6, ex7
764
765 ori r4, r4, _PAGE_ACCESSED
766 swi r4, r5, 0
767
768 /* Most of the Linux PTE is ready to load into the TLB LO.
769 * We set ZSEL, where only the LS-bit determines user access.
770 * We set execute, because we don't have the granularity to
771 * properly set this at the page level (Linux problem).
772 * If shared is set, we cause a zero PID->TID load.
773 * Many of these bits are software only. Bits we don't set
774 * here we (properly should) assume have the appropriate value.
775 */
776 andni r4, r4, 0x0ce2 /* Make sure 20, 21 are zero */
777
778 bri finish_tlb_load
779 ex7:
780 /* The bailout. Restore registers to pre-exception conditions
781 * and call the heavyweights to help us out.
782 */
783 mts rpid, r11
784 nop
785 bri 4
786 RESTORE_STATE;
787 bri page_fault_data_trap
788
789 /* 0x13 - Instruction TLB Miss Exception
790 * Nearly the same as above, except we get our information from
791 * different registers and bailout to a different point.
792 */
793 handle_instruction_tlb_miss_exception:
794 /* Working registers already saved: R3, R4, R5, R6
795 * R3 = ESR
796 */
797 mfs r11, rpid
798 nop
799 bri 4
800 mfs r3, rear /* Get faulting address */
801 nop
802
803 /* If we are faulting a kernel address, we have to use the
804 * kernel page tables.
805 */
806 ori r4, r0, CONFIG_KERNEL_START
807 cmpu r4, r3, r4
808 bgti r4, ex8
809 ori r4, r0, swapper_pg_dir
810 mts rpid, r0 /* TLB will have 0 TID */
811 nop
812 bri ex9
813
814 /* Get the PGD for the current thread. */
815 ex8:
816 /* get current task address */
817 addi r4 ,CURRENT_TASK, TOPHYS(0);
818 lwi r4, r4, TASK_THREAD+PGDIR
819 ex9:
820 tophys(r4,r4)
821 BSRLI(r5,r3,20) /* Create L1 (pgdir/pmd) address */
822 andi r5, r5, 0xffc
823/* Assume pgdir aligned on 4K boundary, no need for "andi r4,r4,0xfffff003" */
824 or r4, r4, r5
825 lwi r4, r4, 0 /* Get L1 entry */
826 andi r5, r4, 0xfffff000 /* Extract L2 (pte) base address */
827 beqi r5, ex10 /* Bail if no table */
828
829 tophys(r5,r5)
830 BSRLI(r6,r3,10) /* Compute PTE address */
831 andi r6, r6, 0xffc
832 andi r5, r5, 0xfffff003
833 or r5, r5, r6
834 lwi r4, r5, 0 /* Get Linux PTE */
835
836 andi r6, r4, _PAGE_PRESENT
837 beqi r6, ex7
838
839 ori r4, r4, _PAGE_ACCESSED
840 swi r4, r5, 0
841
842 /* Most of the Linux PTE is ready to load into the TLB LO.
843 * We set ZSEL, where only the LS-bit determines user access.
844 * We set execute, because we don't have the granularity to
845 * properly set this at the page level (Linux problem).
846 * If shared is set, we cause a zero PID->TID load.
847 * Many of these bits are software only. Bits we don't set
848 * here we (properly should) assume have the appropriate value.
849 */
850 andni r4, r4, 0x0ce2 /* Make sure 20, 21 are zero */
851
852 bri finish_tlb_load
853 ex10:
854 /* The bailout. Restore registers to pre-exception conditions
855 * and call the heavyweights to help us out.
856 */
857 mts rpid, r11
858 nop
859 bri 4
860 RESTORE_STATE;
861 bri page_fault_instr_trap
862
863/* Both the instruction and data TLB miss get to this point to load the TLB.
864 * r3 - EA of fault
865 * r4 - TLB LO (info from Linux PTE)
866 * r5, r6 - available to use
867 * PID - loaded with proper value when we get here
868 * Upon exit, we reload everything and RFI.
869 * A common place to load the TLB.
870 */
871 tlb_index:
872 .long 1 /* MS: storing last used tlb index */
873 finish_tlb_load:
874 /* MS: load the last used TLB index. */
875 lwi r5, r0, TOPHYS(tlb_index)
876 addik r5, r5, 1 /* MS: inc tlb_index -> use next one */
877
878/* MS: FIXME this is potential fault, because this is mask not count */
879 andi r5, r5, (MICROBLAZE_TLB_SIZE-1)
880 ori r6, r0, 1
881 cmp r31, r5, r6
882 blti r31, sem
883 addik r5, r6, 1
884 sem:
885 /* MS: save back current TLB index */
886 swi r5, r0, TOPHYS(tlb_index)
887
888 ori r4, r4, _PAGE_HWEXEC /* make it executable */
889 mts rtlbx, r5 /* MS: save current TLB */
890 nop
891 mts rtlblo, r4 /* MS: save to TLB LO */
892 nop
893
894 /* Create EPN. This is the faulting address plus a static
895 * set of bits. These are size, valid, E, U0, and ensure
896 * bits 20 and 21 are zero.
897 */
898 andi r3, r3, 0xfffff000
899 ori r3, r3, 0x0c0
900 mts rtlbhi, r3 /* Load TLB HI */
901 nop
902
903 /* Done...restore registers and get out of here. */
904 ex12:
905 mts rpid, r11
906 nop
907 bri 4
908 RESTORE_STATE;
909 rted r17, 0
910 nop
911
912 /* extern void giveup_fpu(struct task_struct *prev)
913 *
914 * The MicroBlaze processor may have an FPU, so this should not just
915 * return: TBD.
916 */
917 .globl giveup_fpu;
918 .align 4;
919 giveup_fpu:
920 bralid r15,0 /* TBD */
921 nop
922
923 /* At present, this routine just hangs. - extern void abort(void) */
924 .globl abort;
925 .align 4;
926 abort:
927 br r0
928
929 .globl set_context;
930 .align 4;
931 set_context:
932 mts rpid, r5 /* Shadow TLBs are automatically */
933 nop
934 bri 4 /* flushed by changing PID */
935 rtsd r15,8
936 nop
937
938#endif
370.end _hw_exception_handler 939.end _hw_exception_handler
371 940
941#ifdef CONFIG_MMU
942/* Unaligned data access exception last on a 4k page for MMU.
943 * When this is called, we are in virtual mode with exceptions enabled
944 * and registers 1-13,15,17,18 saved.
945 *
946 * R3 = ESR
947 * R4 = EAR
948 * R7 = pointer to saved registers (struct pt_regs *regs)
949 *
950 * This handler perform the access, and returns via ret_from_exc.
951 */
952.global _unaligned_data_exception
953.ent _unaligned_data_exception
954_unaligned_data_exception:
955 andi r8, r3, 0x3E0; /* Mask and extract the register operand */
956 BSRLI(r8,r8,2); /* r8 >> 2 = register operand * 8 */
957 andi r6, r3, 0x400; /* Extract ESR[S] */
958 bneid r6, ex_sw_vm;
959 andi r6, r3, 0x800; /* Extract ESR[W] - delay slot */
960ex_lw_vm:
961 beqid r6, ex_lhw_vm;
962 lbui r5, r4, 0; /* Exception address in r4 - delay slot */
963/* Load a word, byte-by-byte from destination address and save it in tmp space*/
964 la r6, r0, ex_tmp_data_loc_0;
965 sbi r5, r6, 0;
966 lbui r5, r4, 1;
967 sbi r5, r6, 1;
968 lbui r5, r4, 2;
969 sbi r5, r6, 2;
970 lbui r5, r4, 3;
971 sbi r5, r6, 3;
972 brid ex_lw_tail_vm;
973/* Get the destination register value into r3 - delay slot */
974 lwi r3, r6, 0;
975ex_lhw_vm:
976 /* Load a half-word, byte-by-byte from destination address and
977 * save it in tmp space */
978 la r6, r0, ex_tmp_data_loc_0;
979 sbi r5, r6, 0;
980 lbui r5, r4, 1;
981 sbi r5, r6, 1;
982 lhui r3, r6, 0; /* Get the destination register value into r3 */
983ex_lw_tail_vm:
984 /* Form load_word jump table offset (lw_table_vm + (8 * regnum)) */
985 addik r5, r8, lw_table_vm;
986 bra r5;
987ex_lw_end_vm: /* Exception handling of load word, ends */
988 brai ret_from_exc;
989ex_sw_vm:
990/* Form store_word jump table offset (sw_table_vm + (8 * regnum)) */
991 addik r5, r8, sw_table_vm;
992 bra r5;
993ex_sw_tail_vm:
994 la r5, r0, ex_tmp_data_loc_0;
995 beqid r6, ex_shw_vm;
996 swi r3, r5, 0; /* Get the word - delay slot */
997 /* Store the word, byte-by-byte into destination address */
998 lbui r3, r5, 0;
999 sbi r3, r4, 0;
1000 lbui r3, r5, 1;
1001 sbi r3, r4, 1;
1002 lbui r3, r5, 2;
1003 sbi r3, r4, 2;
1004 lbui r3, r5, 3;
1005 brid ret_from_exc;
1006 sbi r3, r4, 3; /* Delay slot */
1007ex_shw_vm:
1008 /* Store the lower half-word, byte-by-byte into destination address */
1009 lbui r3, r5, 2;
1010 sbi r3, r4, 0;
1011 lbui r3, r5, 3;
1012 brid ret_from_exc;
1013 sbi r3, r4, 1; /* Delay slot */
1014ex_sw_end_vm: /* Exception handling of store word, ends. */
1015.end _unaligned_data_exception
1016#endif /* CONFIG_MMU */
1017
372ex_handler_unhandled: 1018ex_handler_unhandled:
373/* FIXME add handle function for unhandled exception - dump register */ 1019/* FIXME add handle function for unhandled exception - dump register */
374 bri 0 1020 bri 0
375 1021
1022/*
1023 * hw_exception_handler Jump Table
1024 * - Contains code snippets for each register that caused the unalign exception
1025 * - Hence exception handler is NOT self-modifying
1026 * - Separate table for load exceptions and store exceptions.
1027 * - Each table is of size: (8 * 32) = 256 bytes
1028 */
1029
376.section .text 1030.section .text
377.align 4 1031.align 4
378lw_table: 1032lw_table:
@@ -407,7 +1061,11 @@ lw_r27: R3_TO_LWREG (27);
407lw_r28: R3_TO_LWREG (28); 1061lw_r28: R3_TO_LWREG (28);
408lw_r29: R3_TO_LWREG (29); 1062lw_r29: R3_TO_LWREG (29);
409lw_r30: R3_TO_LWREG (30); 1063lw_r30: R3_TO_LWREG (30);
1064#ifdef CONFIG_MMU
1065lw_r31: R3_TO_LWREG_V (31);
1066#else
410lw_r31: R3_TO_LWREG (31); 1067lw_r31: R3_TO_LWREG (31);
1068#endif
411 1069
412sw_table: 1070sw_table:
413sw_r0: SWREG_TO_R3 (0); 1071sw_r0: SWREG_TO_R3 (0);
@@ -441,7 +1099,81 @@ sw_r27: SWREG_TO_R3 (27);
441sw_r28: SWREG_TO_R3 (28); 1099sw_r28: SWREG_TO_R3 (28);
442sw_r29: SWREG_TO_R3 (29); 1100sw_r29: SWREG_TO_R3 (29);
443sw_r30: SWREG_TO_R3 (30); 1101sw_r30: SWREG_TO_R3 (30);
1102#ifdef CONFIG_MMU
1103sw_r31: SWREG_TO_R3_V (31);
1104#else
444sw_r31: SWREG_TO_R3 (31); 1105sw_r31: SWREG_TO_R3 (31);
1106#endif
1107
1108#ifdef CONFIG_MMU
1109lw_table_vm:
1110lw_r0_vm: R3_TO_LWREG_VM (0);
1111lw_r1_vm: R3_TO_LWREG_VM_V (1);
1112lw_r2_vm: R3_TO_LWREG_VM_V (2);
1113lw_r3_vm: R3_TO_LWREG_VM_V (3);
1114lw_r4_vm: R3_TO_LWREG_VM_V (4);
1115lw_r5_vm: R3_TO_LWREG_VM_V (5);
1116lw_r6_vm: R3_TO_LWREG_VM_V (6);
1117lw_r7_vm: R3_TO_LWREG_VM_V (7);
1118lw_r8_vm: R3_TO_LWREG_VM_V (8);
1119lw_r9_vm: R3_TO_LWREG_VM_V (9);
1120lw_r10_vm: R3_TO_LWREG_VM_V (10);
1121lw_r11_vm: R3_TO_LWREG_VM_V (11);
1122lw_r12_vm: R3_TO_LWREG_VM_V (12);
1123lw_r13_vm: R3_TO_LWREG_VM_V (13);
1124lw_r14_vm: R3_TO_LWREG_VM (14);
1125lw_r15_vm: R3_TO_LWREG_VM_V (15);
1126lw_r16_vm: R3_TO_LWREG_VM (16);
1127lw_r17_vm: R3_TO_LWREG_VM_V (17);
1128lw_r18_vm: R3_TO_LWREG_VM_V (18);
1129lw_r19_vm: R3_TO_LWREG_VM (19);
1130lw_r20_vm: R3_TO_LWREG_VM (20);
1131lw_r21_vm: R3_TO_LWREG_VM (21);
1132lw_r22_vm: R3_TO_LWREG_VM (22);
1133lw_r23_vm: R3_TO_LWREG_VM (23);
1134lw_r24_vm: R3_TO_LWREG_VM (24);
1135lw_r25_vm: R3_TO_LWREG_VM (25);
1136lw_r26_vm: R3_TO_LWREG_VM (26);
1137lw_r27_vm: R3_TO_LWREG_VM (27);
1138lw_r28_vm: R3_TO_LWREG_VM (28);
1139lw_r29_vm: R3_TO_LWREG_VM (29);
1140lw_r30_vm: R3_TO_LWREG_VM (30);
1141lw_r31_vm: R3_TO_LWREG_VM_V (31);
1142
1143sw_table_vm:
1144sw_r0_vm: SWREG_TO_R3_VM (0);
1145sw_r1_vm: SWREG_TO_R3_VM_V (1);
1146sw_r2_vm: SWREG_TO_R3_VM_V (2);
1147sw_r3_vm: SWREG_TO_R3_VM_V (3);
1148sw_r4_vm: SWREG_TO_R3_VM_V (4);
1149sw_r5_vm: SWREG_TO_R3_VM_V (5);
1150sw_r6_vm: SWREG_TO_R3_VM_V (6);
1151sw_r7_vm: SWREG_TO_R3_VM_V (7);
1152sw_r8_vm: SWREG_TO_R3_VM_V (8);
1153sw_r9_vm: SWREG_TO_R3_VM_V (9);
1154sw_r10_vm: SWREG_TO_R3_VM_V (10);
1155sw_r11_vm: SWREG_TO_R3_VM_V (11);
1156sw_r12_vm: SWREG_TO_R3_VM_V (12);
1157sw_r13_vm: SWREG_TO_R3_VM_V (13);
1158sw_r14_vm: SWREG_TO_R3_VM (14);
1159sw_r15_vm: SWREG_TO_R3_VM_V (15);
1160sw_r16_vm: SWREG_TO_R3_VM (16);
1161sw_r17_vm: SWREG_TO_R3_VM_V (17);
1162sw_r18_vm: SWREG_TO_R3_VM_V (18);
1163sw_r19_vm: SWREG_TO_R3_VM (19);
1164sw_r20_vm: SWREG_TO_R3_VM (20);
1165sw_r21_vm: SWREG_TO_R3_VM (21);
1166sw_r22_vm: SWREG_TO_R3_VM (22);
1167sw_r23_vm: SWREG_TO_R3_VM (23);
1168sw_r24_vm: SWREG_TO_R3_VM (24);
1169sw_r25_vm: SWREG_TO_R3_VM (25);
1170sw_r26_vm: SWREG_TO_R3_VM (26);
1171sw_r27_vm: SWREG_TO_R3_VM (27);
1172sw_r28_vm: SWREG_TO_R3_VM (28);
1173sw_r29_vm: SWREG_TO_R3_VM (29);
1174sw_r30_vm: SWREG_TO_R3_VM (30);
1175sw_r31_vm: SWREG_TO_R3_VM_V (31);
1176#endif /* CONFIG_MMU */
445 1177
446/* Temporary data structures used in the handler */ 1178/* Temporary data structures used in the handler */
447.section .data 1179.section .data
diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
index 5f71790e3c3c..59ff20e33e0c 100644
--- a/arch/microblaze/kernel/microblaze_ksyms.c
+++ b/arch/microblaze/kernel/microblaze_ksyms.c
@@ -45,3 +45,5 @@ extern void __udivsi3(void);
45EXPORT_SYMBOL(__udivsi3); 45EXPORT_SYMBOL(__udivsi3);
46extern void __umodsi3(void); 46extern void __umodsi3(void);
47EXPORT_SYMBOL(__umodsi3); 47EXPORT_SYMBOL(__umodsi3);
48extern char *_ebss;
49EXPORT_SYMBOL_GPL(_ebss);
diff --git a/arch/microblaze/kernel/misc.S b/arch/microblaze/kernel/misc.S
new file mode 100644
index 000000000000..df16c6287a8e
--- /dev/null
+++ b/arch/microblaze/kernel/misc.S
@@ -0,0 +1,120 @@
1/*
2 * Miscellaneous low-level MMU functions.
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008-2009 PetaLogix
6 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
7 *
8 * Derived from arch/ppc/kernel/misc.S
9 *
10 * This file is subject to the terms and conditions of the GNU General
11 * Public License. See the file COPYING in the main directory of this
12 * archive for more details.
13 */
14
15#include <linux/linkage.h>
16#include <linux/sys.h>
17#include <asm/unistd.h>
18#include <linux/errno.h>
19#include <asm/mmu.h>
20#include <asm/page.h>
21
22 .text
23/*
24 * Flush MMU TLB
25 *
26 * We avoid flushing the pinned 0, 1 and possibly 2 entries.
27 */
28.globl _tlbia;
29.align 4;
30_tlbia:
31 addik r12, r0, 63 /* flush all entries (63 - 3) */
32 /* isync */
33_tlbia_1:
34 mts rtlbx, r12
35 nop
36 mts rtlbhi, r0 /* flush: ensure V is clear */
37 nop
38 addik r11, r12, -2
39 bneid r11, _tlbia_1 /* loop for all entries */
40 addik r12, r12, -1
41 /* sync */
42 rtsd r15, 8
43 nop
44
45/*
46 * Flush MMU TLB for a particular address (in r5)
47 */
48.globl _tlbie;
49.align 4;
50_tlbie:
51 mts rtlbsx, r5 /* look up the address in TLB */
52 nop
53 mfs r12, rtlbx /* Retrieve index */
54 nop
55 blti r12, _tlbie_1 /* Check if found */
56 mts rtlbhi, r0 /* flush: ensure V is clear */
57 nop
58_tlbie_1:
59 rtsd r15, 8
60 nop
61
62/*
63 * Allocate TLB entry for early console
64 */
65.globl early_console_reg_tlb_alloc;
66.align 4;
67early_console_reg_tlb_alloc:
68 /*
69 * Load a TLB entry for the UART, so that microblaze_progress() can use
70 * the UARTs nice and early. We use a 4k real==virtual mapping.
71 */
72 ori r4, r0, 63
73 mts rtlbx, r4 /* TLB slot 2 */
74
75 or r4,r5,r0
76 andi r4,r4,0xfffff000
77 ori r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G)
78
79 andi r5,r5,0xfffff000
80 ori r5,r5,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
81
82 mts rtlblo,r4 /* Load the data portion of the entry */
83 nop
84 mts rtlbhi,r5 /* Load the tag portion of the entry */
85 nop
86 rtsd r15, 8
87 nop
88
89/*
90 * Copy a whole page (4096 bytes).
91 */
92#define COPY_16_BYTES \
93 lwi r7, r6, 0; \
94 lwi r8, r6, 4; \
95 lwi r9, r6, 8; \
96 lwi r10, r6, 12; \
97 swi r7, r5, 0; \
98 swi r8, r5, 4; \
99 swi r9, r5, 8; \
100 swi r10, r5, 12
101
102
103/* FIXME DCACHE_LINE_BYTES (CONFIG_XILINX_MICROBLAZE0_DCACHE_LINE_LEN * 4)*/
104#define DCACHE_LINE_BYTES (4 * 4)
105
106.globl copy_page;
107.align 4;
108copy_page:
109 ori r11, r0, (PAGE_SIZE/DCACHE_LINE_BYTES) - 1
110_copy_page_loop:
111 COPY_16_BYTES
112#if DCACHE_LINE_BYTES >= 32
113 COPY_16_BYTES
114#endif
115 addik r6, r6, DCACHE_LINE_BYTES
116 addik r5, r5, DCACHE_LINE_BYTES
117 bneid r11, _copy_page_loop
118 addik r11, r11, -1
119 rtsd r15, 8
120 nop
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 07d4fa339eda..00b12c6d5326 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -126,9 +126,54 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
126 else 126 else
127 childregs->r1 = ((unsigned long) ti) + THREAD_SIZE; 127 childregs->r1 = ((unsigned long) ti) + THREAD_SIZE;
128 128
129#ifndef CONFIG_MMU
129 memset(&ti->cpu_context, 0, sizeof(struct cpu_context)); 130 memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
130 ti->cpu_context.r1 = (unsigned long)childregs; 131 ti->cpu_context.r1 = (unsigned long)childregs;
131 ti->cpu_context.msr = (unsigned long)childregs->msr; 132 ti->cpu_context.msr = (unsigned long)childregs->msr;
133#else
134
135 /* if creating a kernel thread then update the current reg (we don't
136 * want to use the parent's value when restoring by POP_STATE) */
137 if (kernel_mode(regs))
138 /* save new current on stack to use POP_STATE */
139 childregs->CURRENT_TASK = (unsigned long)p;
140 /* if returning to user then use the parent's value of this register */
141
142 /* if we're creating a new kernel thread then just zeroing all
143 * the registers. That's OK for a brand new thread.*/
144 /* Pls. note that some of them will be restored in POP_STATE */
145 if (kernel_mode(regs))
146 memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
147 /* if this thread is created for fork/vfork/clone, then we want to
148 * restore all the parent's context */
149 /* in addition to the registers which will be restored by POP_STATE */
150 else {
151 ti->cpu_context = *(struct cpu_context *)regs;
152 childregs->msr |= MSR_UMS;
153 }
154
155 /* FIXME STATE_SAVE_PT_OFFSET; */
156 ti->cpu_context.r1 = (unsigned long)childregs - STATE_SAVE_ARG_SPACE;
157 /* we should consider the fact that childregs is a copy of the parent
158 * regs which were saved immediately after entering the kernel state
159 * before enabling VM. This MSR will be restored in switch_to and
160 * RETURN() and we want to have the right machine state there
161 * specifically this state must have INTs disabled before and enabled
162 * after performing rtbd
163 * compose the right MSR for RETURN(). It will work for switch_to also
164 * excepting for VM and UMS
165 * don't touch UMS , CARRY and cache bits
166 * right now MSR is a copy of parent one */
167 childregs->msr |= MSR_BIP;
168 childregs->msr &= ~MSR_EIP;
169 childregs->msr |= MSR_IE;
170 childregs->msr &= ~MSR_VM;
171 childregs->msr |= MSR_VMS;
172 childregs->msr |= MSR_EE; /* exceptions will be enabled*/
173
174 ti->cpu_context.msr = (childregs->msr|MSR_VM);
175 ti->cpu_context.msr &= ~MSR_UMS; /* switch_to to kernel mode */
176#endif
132 ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8; 177 ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8;
133 178
134 if (clone_flags & CLONE_SETTLS) 179 if (clone_flags & CLONE_SETTLS)
@@ -137,6 +182,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
137 return 0; 182 return 0;
138} 183}
139 184
185#ifndef CONFIG_MMU
140/* 186/*
141 * Return saved PC of a blocked thread. 187 * Return saved PC of a blocked thread.
142 */ 188 */
@@ -151,6 +197,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
151 else 197 else
152 return ctx->r14; 198 return ctx->r14;
153} 199}
200#endif
154 201
155static void kernel_thread_helper(int (*fn)(void *), void *arg) 202static void kernel_thread_helper(int (*fn)(void *), void *arg)
156{ 203{
@@ -173,6 +220,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
173 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, 220 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
174 &regs, 0, NULL, NULL); 221 &regs, 0, NULL, NULL);
175} 222}
223EXPORT_SYMBOL_GPL(kernel_thread);
176 224
177unsigned long get_wchan(struct task_struct *p) 225unsigned long get_wchan(struct task_struct *p)
178{ 226{
@@ -188,3 +236,14 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp)
188 regs->r1 = usp; 236 regs->r1 = usp;
189 regs->pt_mode = 0; 237 regs->pt_mode = 0;
190} 238}
239
240#ifdef CONFIG_MMU
241#include <linux/elfcore.h>
242/*
243 * Set up a thread for executing a new program
244 */
245int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
246{
247 return 0; /* MicroBlaze has no separate FPU registers */
248}
249#endif /* CONFIG_MMU */
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 34c48718061a..c005cc6f1aaf 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -509,12 +509,13 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)
509 509
510 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l); 510 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
511 if (prop) { 511 if (prop) {
512 initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4)); 512 initrd_start = (unsigned long)
513 __va((u32)of_read_ulong(prop, l/4));
513 514
514 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l); 515 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
515 if (prop) { 516 if (prop) {
516 initrd_end = (unsigned long) 517 initrd_end = (unsigned long)
517 __va(of_read_ulong(prop, l/4)); 518 __va((u32)of_read_ulong(prop, 1/4));
518 initrd_below_start_ok = 1; 519 initrd_below_start_ok = 1;
519 } else { 520 } else {
520 initrd_start = 0; 521 initrd_start = 0;
@@ -563,7 +564,9 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
563 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE)); 564 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
564 565
565#ifdef CONFIG_CMDLINE 566#ifdef CONFIG_CMDLINE
567#ifndef CONFIG_CMDLINE_FORCE
566 if (p == NULL || l == 0 || (l == 1 && (*p) == 0)) 568 if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
569#endif
567 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 570 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
568#endif /* CONFIG_CMDLINE */ 571#endif /* CONFIG_CMDLINE */
569 572
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index eb6b41758e23..8709bea09604 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -42,10 +42,6 @@ char cmd_line[COMMAND_LINE_SIZE];
42 42
43void __init setup_arch(char **cmdline_p) 43void __init setup_arch(char **cmdline_p)
44{ 44{
45#ifdef CONFIG_CMDLINE_FORCE
46 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
47 strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
48#endif
49 *cmdline_p = cmd_line; 45 *cmdline_p = cmd_line;
50 46
51 console_verbose(); 47 console_verbose();
@@ -102,14 +98,34 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
102{ 98{
103 unsigned long *src, *dst = (unsigned long *)0x0; 99 unsigned long *src, *dst = (unsigned long *)0x0;
104 100
101 /* If CONFIG_MTD_UCLINUX is defined, assume ROMFS is at the
102 * end of kernel. There are two position which we want to check.
103 * The first is __init_end and the second __bss_start.
104 */
105#ifdef CONFIG_MTD_UCLINUX
106 int romfs_size;
107 unsigned int romfs_base;
108 char *old_klimit = klimit;
109
110 romfs_base = (ram ? ram : (unsigned int)&__init_end);
111 romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
112 if (!romfs_size) {
113 romfs_base = (unsigned int)&__bss_start;
114 romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
115 }
116
117 /* Move ROMFS out of BSS before clearing it */
118 if (romfs_size > 0) {
119 memmove(&_ebss, (int *)romfs_base, romfs_size);
120 klimit += romfs_size;
121 }
122#endif
123
105/* clearing bss section */ 124/* clearing bss section */
106 memset(__bss_start, 0, __bss_stop-__bss_start); 125 memset(__bss_start, 0, __bss_stop-__bss_start);
107 memset(_ssbss, 0, _esbss-_ssbss); 126 memset(_ssbss, 0, _esbss-_ssbss);
108 127
109 /* 128 /* Copy command line passed from bootloader */
110 * Copy command line passed from bootloader, or use default
111 * if none provided, or forced
112 */
113#ifndef CONFIG_CMDLINE_BOOL 129#ifndef CONFIG_CMDLINE_BOOL
114 if (cmdline && cmdline[0] != '\0') 130 if (cmdline && cmdline[0] != '\0')
115 strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE); 131 strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
@@ -126,27 +142,15 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
126 printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt); 142 printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt);
127 143
128#ifdef CONFIG_MTD_UCLINUX 144#ifdef CONFIG_MTD_UCLINUX
129 { 145 early_printk("Found romfs @ 0x%08x (0x%08x)\n",
130 int size; 146 romfs_base, romfs_size);
131 unsigned int romfs_base; 147 early_printk("#### klimit %p ####\n", old_klimit);
132 romfs_base = (ram ? ram : (unsigned int)&__init_end); 148 BUG_ON(romfs_size < 0); /* What else can we do? */
133 /* if CONFIG_MTD_UCLINUX_EBSS is defined, assume ROMFS is at the 149
134 * end of kernel, which is ROMFS_LOCATION defined above. */ 150 early_printk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n",
135 size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base)); 151 romfs_size, romfs_base, (unsigned)&_ebss);
136 early_printk("Found romfs @ 0x%08x (0x%08x)\n", 152
137 romfs_base, size); 153 early_printk("New klimit: 0x%08x\n", (unsigned)klimit);
138 early_printk("#### klimit %p ####\n", klimit);
139 BUG_ON(size < 0); /* What else can we do? */
140
141 /* Use memmove to handle likely case of memory overlap */
142 early_printk("Moving 0x%08x bytes from 0x%08x to 0x%08x\n",
143 size, romfs_base, (unsigned)&_ebss);
144 memmove(&_ebss, (int *)romfs_base, size);
145
146 /* update klimit */
147 klimit += PAGE_ALIGN(size);
148 early_printk("New klimit: 0x%08x\n", (unsigned)klimit);
149 }
150#endif 154#endif
151 155
152 for (src = __ivt_start; src < __ivt_end; src++, dst++) 156 for (src = __ivt_start; src < __ivt_end; src++, dst++)
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index 40d36931e363..4c0e6521b114 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -152,8 +152,8 @@ struct rt_sigframe {
152 unsigned long tramp[2]; /* signal trampoline */ 152 unsigned long tramp[2]; /* signal trampoline */
153}; 153};
154 154
155static int 155static int restore_sigcontext(struct pt_regs *regs,
156restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *rval_p) 156 struct sigcontext __user *sc, int *rval_p)
157{ 157{
158 unsigned int err = 0; 158 unsigned int err = 0;
159 159
@@ -211,11 +211,10 @@ badframe:
211 211
212asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) 212asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
213{ 213{
214 struct rt_sigframe *frame = 214 struct rt_sigframe __user *frame =
215 (struct rt_sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE); 215 (struct rt_sigframe __user *)(regs->r1 + STATE_SAVE_ARG_SPACE);
216 216
217 sigset_t set; 217 sigset_t set;
218 stack_t st;
219 int rval; 218 int rval;
220 219
221 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 220 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -233,11 +232,10 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
233 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) 232 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval))
234 goto badframe; 233 goto badframe;
235 234
236 if (__copy_from_user((void *)&st, &frame->uc.uc_stack, sizeof(st)))
237 goto badframe;
238 /* It is more difficult to avoid calling this function than to 235 /* It is more difficult to avoid calling this function than to
239 call it and ignore errors. */ 236 call it and ignore errors. */
240 do_sigaltstack(&st, NULL, regs->r1); 237 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->r1))
238 goto badframe;
241 239
242 return rval; 240 return rval;
243 241
@@ -251,7 +249,7 @@ badframe:
251 */ 249 */
252 250
253static int 251static int
254setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, 252setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
255 unsigned long mask) 253 unsigned long mask)
256{ 254{
257 int err = 0; 255 int err = 0;
@@ -278,7 +276,7 @@ setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
278/* 276/*
279 * Determine which stack to use.. 277 * Determine which stack to use..
280 */ 278 */
281static inline void * 279static inline void __user *
282get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) 280get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
283{ 281{
284 /* Default to using normal stack */ 282 /* Default to using normal stack */
@@ -287,87 +285,13 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
287 if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && !on_sig_stack(sp)) 285 if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && !on_sig_stack(sp))
288 sp = current->sas_ss_sp + current->sas_ss_size; 286 sp = current->sas_ss_sp + current->sas_ss_size;
289 287
290 return (void *)((sp - frame_size) & -8UL); 288 return (void __user *)((sp - frame_size) & -8UL);
291}
292
293static void setup_frame(int sig, struct k_sigaction *ka,
294 sigset_t *set, struct pt_regs *regs)
295{
296 struct sigframe *frame;
297 int err = 0;
298 int signal;
299
300 frame = get_sigframe(ka, regs, sizeof(*frame));
301
302 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
303 goto give_sigsegv;
304
305 signal = current_thread_info()->exec_domain
306 && current_thread_info()->exec_domain->signal_invmap
307 && sig < 32
308 ? current_thread_info()->exec_domain->signal_invmap[sig]
309 : sig;
310
311 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
312
313 if (_NSIG_WORDS > 1) {
314 err |= __copy_to_user(frame->extramask, &set->sig[1],
315 sizeof(frame->extramask));
316 }
317
318 /* Set up to return from userspace. If provided, use a stub
319 already in userspace. */
320 /* minus 8 is offset to cater for "rtsd r15,8" offset */
321 if (ka->sa.sa_flags & SA_RESTORER) {
322 regs->r15 = ((unsigned long)ka->sa.sa_restorer)-8;
323 } else {
324 /* Note, these encodings are _big endian_! */
325
326 /* addi r12, r0, __NR_sigreturn */
327 err |= __put_user(0x31800000 | __NR_sigreturn ,
328 frame->tramp + 0);
329 /* brki r14, 0x8 */
330 err |= __put_user(0xb9cc0008, frame->tramp + 1);
331
332 /* Return from sighandler will jump to the tramp.
333 Negative 8 offset because return is rtsd r15, 8 */
334 regs->r15 = ((unsigned long)frame->tramp)-8;
335
336 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
337 }
338
339 if (err)
340 goto give_sigsegv;
341
342 /* Set up registers for signal handler */
343 regs->r1 = (unsigned long) frame - STATE_SAVE_ARG_SPACE;
344
345 /* Signal handler args: */
346 regs->r5 = signal; /* Arg 0: signum */
347 regs->r6 = (unsigned long) &frame->sc; /* arg 1: sigcontext */
348
349 /* Offset of 4 to handle microblaze rtid r14, 0 */
350 regs->pc = (unsigned long)ka->sa.sa_handler;
351
352 set_fs(USER_DS);
353
354#ifdef DEBUG_SIG
355 printk(KERN_INFO "SIG deliver (%s:%d): sp=%p pc=%08lx\n",
356 current->comm, current->pid, frame, regs->pc);
357#endif
358
359 return;
360
361give_sigsegv:
362 if (sig == SIGSEGV)
363 ka->sa.sa_handler = SIG_DFL;
364 force_sig(SIGSEGV, current);
365} 289}
366 290
367static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 291static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
368 sigset_t *set, struct pt_regs *regs) 292 sigset_t *set, struct pt_regs *regs)
369{ 293{
370 struct rt_sigframe *frame; 294 struct rt_sigframe __user *frame;
371 int err = 0; 295 int err = 0;
372 int signal; 296 int signal;
373 297
@@ -382,7 +306,8 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
382 ? current_thread_info()->exec_domain->signal_invmap[sig] 306 ? current_thread_info()->exec_domain->signal_invmap[sig]
383 : sig; 307 : sig;
384 308
385 err |= copy_siginfo_to_user(&frame->info, info); 309 if (info)
310 err |= copy_siginfo_to_user(&frame->info, info);
386 311
387 /* Create the ucontext. */ 312 /* Create the ucontext. */
388 err |= __put_user(0, &frame->uc.uc_flags); 313 err |= __put_user(0, &frame->uc.uc_flags);
@@ -463,7 +388,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
463 case -ERESTARTNOINTR: 388 case -ERESTARTNOINTR:
464do_restart: 389do_restart:
465 /* offset of 4 bytes to re-execute trap (brki) instruction */ 390 /* offset of 4 bytes to re-execute trap (brki) instruction */
391#ifndef CONFIG_MMU
466 regs->pc -= 4; 392 regs->pc -= 4;
393#else
394 /* offset of 8 bytes required = 4 for rtbd
395 offset, plus 4 for size of
396 "brki r14,8"
397 instruction. */
398 regs->pc -= 8;
399#endif
467 break; 400 break;
468 } 401 }
469} 402}
@@ -480,7 +413,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
480 if (ka->sa.sa_flags & SA_SIGINFO) 413 if (ka->sa.sa_flags & SA_SIGINFO)
481 setup_rt_frame(sig, ka, info, oldset, regs); 414 setup_rt_frame(sig, ka, info, oldset, regs);
482 else 415 else
483 setup_frame(sig, ka, oldset, regs); 416 setup_rt_frame(sig, ka, NULL, oldset, regs);
484 417
485 if (ka->sa.sa_flags & SA_ONESHOT) 418 if (ka->sa.sa_flags & SA_ONESHOT)
486 ka->sa.sa_handler = SIG_DFL; 419 ka->sa.sa_handler = SIG_DFL;
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 3bb42ec924c2..376d1789f7c0 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -2,7 +2,11 @@ ENTRY(sys_call_table)
2 .long sys_restart_syscall /* 0 - old "setup()" system call, 2 .long sys_restart_syscall /* 0 - old "setup()" system call,
3 * used for restarting */ 3 * used for restarting */
4 .long sys_exit 4 .long sys_exit
5 .long sys_ni_syscall /* was fork */ 5#ifdef CONFIG_MMU
6 .long sys_fork_wrapper
7#else
8 .long sys_ni_syscall
9#endif
6 .long sys_read 10 .long sys_read
7 .long sys_write 11 .long sys_write
8 .long sys_open /* 5 */ 12 .long sys_open /* 5 */
diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c
index 293ef486013a..eaaaf805f31b 100644
--- a/arch/microblaze/kernel/traps.c
+++ b/arch/microblaze/kernel/traps.c
@@ -22,14 +22,6 @@ void trap_init(void)
22 __enable_hw_exceptions(); 22 __enable_hw_exceptions();
23} 23}
24 24
25void __bad_xchg(volatile void *ptr, int size)
26{
27 printk(KERN_INFO "xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n",
28 __builtin_return_address(0), ptr, size);
29 BUG();
30}
31EXPORT_SYMBOL(__bad_xchg);
32
33static int kstack_depth_to_print = 24; 25static int kstack_depth_to_print = 24;
34 26
35static int __init kstack_setup(char *s) 27static int __init kstack_setup(char *s)
@@ -105,3 +97,37 @@ void dump_stack(void)
105 show_stack(NULL, NULL); 97 show_stack(NULL, NULL);
106} 98}
107EXPORT_SYMBOL(dump_stack); 99EXPORT_SYMBOL(dump_stack);
100
101#ifdef CONFIG_MMU
102void __bug(const char *file, int line, void *data)
103{
104 if (data)
105 printk(KERN_CRIT "kernel BUG at %s:%d (data = %p)!\n",
106 file, line, data);
107 else
108 printk(KERN_CRIT "kernel BUG at %s:%d!\n", file, line);
109
110 machine_halt();
111}
112
113int bad_trap(int trap_num, struct pt_regs *regs)
114{
115 printk(KERN_CRIT
116 "unimplemented trap %d called at 0x%08lx, pid %d!\n",
117 trap_num, regs->pc, current->pid);
118 return -ENOSYS;
119}
120
121int debug_trap(struct pt_regs *regs)
122{
123 int i;
124 printk(KERN_CRIT "debug trap\n");
125 for (i = 0; i < 32; i++) {
126 /* printk("r%i:%08X\t",i,regs->gpr[i]); */
127 if ((i % 4) == 3)
128 printk(KERN_CRIT "\n");
129 }
130 printk(KERN_CRIT "pc:%08lX\tmsr:%08lX\n", regs->pc, regs->msr);
131 return -ENOSYS;
132}
133#endif
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index 840385e51291..8ae807ab7a51 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -17,8 +17,7 @@ ENTRY(_start)
17jiffies = jiffies_64 + 4; 17jiffies = jiffies_64 + 4;
18 18
19SECTIONS { 19SECTIONS {
20 . = CONFIG_KERNEL_BASE_ADDR; 20 . = CONFIG_KERNEL_START;
21
22 .text : { 21 .text : {
23 _text = . ; 22 _text = . ;
24 _stext = . ; 23 _stext = . ;
@@ -132,6 +131,8 @@ SECTIONS {
132 __con_initcall_end = .; 131 __con_initcall_end = .;
133 } 132 }
134 133
134 SECURITY_INIT
135
135 __init_end_before_initramfs = .; 136 __init_end_before_initramfs = .;
136 137
137 .init.ramfs ALIGN(4096) : { 138 .init.ramfs ALIGN(4096) : {
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index d27126bf306a..71c8cb6c9e43 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -10,4 +10,5 @@ else
10lib-y += memcpy.o memmove.o 10lib-y += memcpy.o memmove.o
11endif 11endif
12 12
13lib-y += uaccess.o 13lib-$(CONFIG_NO_MMU) += uaccess.o
14lib-$(CONFIG_MMU) += uaccess_old.o
diff --git a/arch/microblaze/lib/checksum.c b/arch/microblaze/lib/checksum.c
index 809340070a13..f08e74591418 100644
--- a/arch/microblaze/lib/checksum.c
+++ b/arch/microblaze/lib/checksum.c
@@ -32,9 +32,10 @@
32/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access 32/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
33 kills, so most of the assembly has to go. */ 33 kills, so most of the assembly has to go. */
34 34
35#include <net/checksum.h>
36#include <asm/checksum.h>
37#include <linux/module.h> 35#include <linux/module.h>
36#include <net/checksum.h>
37
38#include <asm/byteorder.h>
38 39
39static inline unsigned short from32to16(unsigned long x) 40static inline unsigned short from32to16(unsigned long x)
40{ 41{
@@ -102,6 +103,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
102{ 103{
103 return (__force __sum16)~do_csum(iph, ihl*4); 104 return (__force __sum16)~do_csum(iph, ihl*4);
104} 105}
106EXPORT_SYMBOL(ip_fast_csum);
105 107
106/* 108/*
107 * computes the checksum of a memory block at buff, length len, 109 * computes the checksum of a memory block at buff, length len,
@@ -115,15 +117,16 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
115 * 117 *
116 * it's best to have buff aligned on a 32-bit boundary 118 * it's best to have buff aligned on a 32-bit boundary
117 */ 119 */
118__wsum csum_partial(const void *buff, int len, __wsum sum) 120__wsum csum_partial(const void *buff, int len, __wsum wsum)
119{ 121{
122 unsigned int sum = (__force unsigned int)wsum;
120 unsigned int result = do_csum(buff, len); 123 unsigned int result = do_csum(buff, len);
121 124
122 /* add in old sum, and carry.. */ 125 /* add in old sum, and carry.. */
123 result += sum; 126 result += sum;
124 if (sum > result) 127 if (sum > result)
125 result += 1; 128 result += 1;
126 return result; 129 return (__force __wsum)result;
127} 130}
128EXPORT_SYMBOL(csum_partial); 131EXPORT_SYMBOL(csum_partial);
129 132
@@ -131,9 +134,9 @@ EXPORT_SYMBOL(csum_partial);
131 * this routine is used for miscellaneous IP-like checksums, mainly 134 * this routine is used for miscellaneous IP-like checksums, mainly
132 * in icmp.c 135 * in icmp.c
133 */ 136 */
134__sum16 ip_compute_csum(const unsigned char *buff, int len) 137__sum16 ip_compute_csum(const void *buff, int len)
135{ 138{
136 return ~do_csum(buff, len); 139 return (__force __sum16)~do_csum(buff, len);
137} 140}
138EXPORT_SYMBOL(ip_compute_csum); 141EXPORT_SYMBOL(ip_compute_csum);
139 142
@@ -141,12 +144,18 @@ EXPORT_SYMBOL(ip_compute_csum);
141 * copy from fs while checksumming, otherwise like csum_partial 144 * copy from fs while checksumming, otherwise like csum_partial
142 */ 145 */
143__wsum 146__wsum
144csum_partial_copy_from_user(const char __user *src, char *dst, int len, 147csum_partial_copy_from_user(const void __user *src, void *dst, int len,
145 int sum, int *csum_err) 148 __wsum sum, int *csum_err)
146{ 149{
147 if (csum_err) 150 int missing;
151
152 missing = __copy_from_user(dst, src, len);
153 if (missing) {
154 memset(dst + len - missing, 0, missing);
155 *csum_err = -EFAULT;
156 } else
148 *csum_err = 0; 157 *csum_err = 0;
149 memcpy(dst, src, len); 158
150 return csum_partial(dst, len, sum); 159 return csum_partial(dst, len, sum);
151} 160}
152EXPORT_SYMBOL(csum_partial_copy_from_user); 161EXPORT_SYMBOL(csum_partial_copy_from_user);
@@ -155,7 +164,7 @@ EXPORT_SYMBOL(csum_partial_copy_from_user);
155 * copy from ds while checksumming, otherwise like csum_partial 164 * copy from ds while checksumming, otherwise like csum_partial
156 */ 165 */
157__wsum 166__wsum
158csum_partial_copy(const char *src, char *dst, int len, int sum) 167csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
159{ 168{
160 memcpy(dst, src, len); 169 memcpy(dst, src, len);
161 return csum_partial(dst, len, sum); 170 return csum_partial(dst, len, sum);
diff --git a/arch/microblaze/lib/memcpy.c b/arch/microblaze/lib/memcpy.c
index 5880119c4487..6a907c58a4bc 100644
--- a/arch/microblaze/lib/memcpy.c
+++ b/arch/microblaze/lib/memcpy.c
@@ -154,8 +154,3 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
154} 154}
155EXPORT_SYMBOL(memcpy); 155EXPORT_SYMBOL(memcpy);
156#endif /* __HAVE_ARCH_MEMCPY */ 156#endif /* __HAVE_ARCH_MEMCPY */
157
158void *cacheable_memcpy(void *d, const void *s, __kernel_size_t c)
159{
160 return memcpy(d, s, c);
161}
diff --git a/arch/microblaze/lib/uaccess_old.S b/arch/microblaze/lib/uaccess_old.S
new file mode 100644
index 000000000000..67f991c14b8a
--- /dev/null
+++ b/arch/microblaze/lib/uaccess_old.S
@@ -0,0 +1,135 @@
1/*
2 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2009 PetaLogix
4 * Copyright (C) 2007 LynuxWorks, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/errno.h>
12#include <linux/linkage.h>
13
14/*
15 * int __strncpy_user(char *to, char *from, int len);
16 *
17 * Returns:
18 * -EFAULT for an exception
19 * len if we hit the buffer limit
20 * bytes copied
21 */
22
23 .text
24.globl __strncpy_user;
25.align 4;
26__strncpy_user:
27
28 /*
29 * r5 - to
30 * r6 - from
31 * r7 - len
32 * r3 - temp count
33 * r4 - temp val
34 */
35 addik r3,r7,0 /* temp_count = len */
36 beqi r3,3f
371:
38 lbu r4,r6,r0
39 sb r4,r5,r0
40
41 addik r3,r3,-1
42 beqi r3,2f /* break on len */
43
44 addik r5,r5,1
45 bneid r4,1b
46 addik r6,r6,1 /* delay slot */
47 addik r3,r3,1 /* undo "temp_count--" */
482:
49 rsubk r3,r3,r7 /* temp_count = len - temp_count */
503:
51 rtsd r15,8
52 nop
53
54
55 .section .fixup, "ax"
56 .align 2
574:
58 brid 3b
59 addik r3,r0, -EFAULT
60
61 .section __ex_table, "a"
62 .word 1b,4b
63
64/*
65 * int __strnlen_user(char __user *str, int maxlen);
66 *
67 * Returns:
68 * 0 on error
69 * maxlen + 1 if no NUL byte found within maxlen bytes
70 * size of the string (including NUL byte)
71 */
72
73 .text
74.globl __strnlen_user;
75.align 4;
76__strnlen_user:
77 addik r3,r6,0
78 beqi r3,3f
791:
80 lbu r4,r5,r0
81 beqid r4,2f /* break on NUL */
82 addik r3,r3,-1 /* delay slot */
83
84 bneid r3,1b
85 addik r5,r5,1 /* delay slot */
86
87 addik r3,r3,-1 /* for break on len */
882:
89 rsubk r3,r3,r6
903:
91 rtsd r15,8
92 nop
93
94
95 .section .fixup,"ax"
964:
97 brid 3b
98 addk r3,r0,r0
99
100 .section __ex_table,"a"
101 .word 1b,4b
102
103/*
104 * int __copy_tofrom_user(char *to, char *from, int len)
105 * Return:
106 * 0 on success
107 * number of not copied bytes on error
108 */
109 .text
110.globl __copy_tofrom_user;
111.align 4;
112__copy_tofrom_user:
113 /*
114 * r5 - to
115 * r6 - from
116 * r7, r3 - count
117 * r4 - tempval
118 */
119 addik r3,r7,0
120 beqi r3,3f
1211:
122 lbu r4,r6,r0
123 addik r6,r6,1
1242:
125 sb r4,r5,r0
126 addik r3,r3,-1
127 bneid r3,1b
128 addik r5,r5,1 /* delay slot */
1293:
130 rtsd r15,8
131 nop
132
133
134 .section __ex_table,"a"
135 .word 1b,3b,2b,3b
diff --git a/arch/microblaze/mm/Makefile b/arch/microblaze/mm/Makefile
index bf9e4479a1fd..6c8a924d9e26 100644
--- a/arch/microblaze/mm/Makefile
+++ b/arch/microblaze/mm/Makefile
@@ -3,3 +3,5 @@
3# 3#
4 4
5obj-y := init.o 5obj-y := init.o
6
7obj-$(CONFIG_MMU) += pgtable.o mmu_context.o fault.o
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c
new file mode 100644
index 000000000000..5e67cd1fab40
--- /dev/null
+++ b/arch/microblaze/mm/fault.c
@@ -0,0 +1,304 @@
1/*
2 * arch/microblaze/mm/fault.c
3 *
4 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
5 *
6 * Derived from "arch/ppc/mm/fault.c"
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Derived from "arch/i386/mm/fault.c"
10 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
11 *
12 * Modified by Cort Dougan and Paul Mackerras.
13 *
14 * This file is subject to the terms and conditions of the GNU General
15 * Public License. See the file COPYING in the main directory of this
16 * archive for more details.
17 *
18 */
19
20#include <linux/module.h>
21#include <linux/signal.h>
22#include <linux/sched.h>
23#include <linux/kernel.h>
24#include <linux/errno.h>
25#include <linux/string.h>
26#include <linux/types.h>
27#include <linux/ptrace.h>
28#include <linux/mman.h>
29#include <linux/mm.h>
30#include <linux/interrupt.h>
31
32#include <asm/page.h>
33#include <asm/pgtable.h>
34#include <asm/mmu.h>
35#include <asm/mmu_context.h>
36#include <asm/system.h>
37#include <linux/uaccess.h>
38#include <asm/exceptions.h>
39
40#if defined(CONFIG_KGDB)
41int debugger_kernel_faults = 1;
42#endif
43
44static unsigned long pte_misses; /* updated by do_page_fault() */
45static unsigned long pte_errors; /* updated by do_page_fault() */
46
47/*
48 * Check whether the instruction at regs->pc is a store using
49 * an update addressing form which will update r1.
50 */
51static int store_updates_sp(struct pt_regs *regs)
52{
53 unsigned int inst;
54
55 if (get_user(inst, (unsigned int *)regs->pc))
56 return 0;
57 /* check for 1 in the rD field */
58 if (((inst >> 21) & 0x1f) != 1)
59 return 0;
60 /* check for store opcodes */
61 if ((inst & 0xd0000000) == 0xd0000000)
62 return 1;
63 return 0;
64}
65
66
67/*
68 * bad_page_fault is called when we have a bad access from the kernel.
69 * It is called from do_page_fault above and from some of the procedures
70 * in traps.c.
71 */
72static void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
73{
74 const struct exception_table_entry *fixup;
75/* MS: no context */
76 /* Are we prepared to handle this fault? */
77 fixup = search_exception_tables(regs->pc);
78 if (fixup) {
79 regs->pc = fixup->fixup;
80 return;
81 }
82
83 /* kernel has accessed a bad area */
84#if defined(CONFIG_KGDB)
85 if (debugger_kernel_faults)
86 debugger(regs);
87#endif
88 die("kernel access of bad area", regs, sig);
89}
90
91/*
92 * The error_code parameter is ESR for a data fault,
93 * 0 for an instruction fault.
94 */
95void do_page_fault(struct pt_regs *regs, unsigned long address,
96 unsigned long error_code)
97{
98 struct vm_area_struct *vma;
99 struct mm_struct *mm = current->mm;
100 siginfo_t info;
101 int code = SEGV_MAPERR;
102 int is_write = error_code & ESR_S;
103 int fault;
104
105 regs->ear = address;
106 regs->esr = error_code;
107
108 /* On a kernel SLB miss we can only check for a valid exception entry */
109 if (kernel_mode(regs) && (address >= TASK_SIZE)) {
110 printk(KERN_WARNING "kernel task_size exceed");
111 _exception(SIGSEGV, regs, code, address);
112 }
113
114 /* for instr TLB miss and instr storage exception ESR_S is undefined */
115 if ((error_code & 0x13) == 0x13 || (error_code & 0x11) == 0x11)
116 is_write = 0;
117
118#if defined(CONFIG_KGDB)
119 if (debugger_fault_handler && regs->trap == 0x300) {
120 debugger_fault_handler(regs);
121 return;
122 }
123#endif /* CONFIG_KGDB */
124
125 if (in_atomic() || mm == NULL) {
126 /* FIXME */
127 if (kernel_mode(regs)) {
128 printk(KERN_EMERG
129 "Page fault in kernel mode - Oooou!!! pid %d\n",
130 current->pid);
131 _exception(SIGSEGV, regs, code, address);
132 return;
133 }
134 /* in_atomic() in user mode is really bad,
135 as is current->mm == NULL. */
136 printk(KERN_EMERG "Page fault in user mode with "
137 "in_atomic(), mm = %p\n", mm);
138 printk(KERN_EMERG "r15 = %lx MSR = %lx\n",
139 regs->r15, regs->msr);
140 die("Weird page fault", regs, SIGSEGV);
141 }
142
143 /* When running in the kernel we expect faults to occur only to
144 * addresses in user space. All other faults represent errors in the
145 * kernel and should generate an OOPS. Unfortunately, in the case of an
146 * erroneous fault occurring in a code path which already holds mmap_sem
147 * we will deadlock attempting to validate the fault against the
148 * address space. Luckily the kernel only validly references user
149 * space from well defined areas of code, which are listed in the
150 * exceptions table.
151 *
152 * As the vast majority of faults will be valid we will only perform
153 * the source reference check when there is a possibility of a deadlock.
154 * Attempt to lock the address space, if we cannot we then validate the
155 * source. If this is invalid we can skip the address space check,
156 * thus avoiding the deadlock.
157 */
158 if (!down_read_trylock(&mm->mmap_sem)) {
159 if (kernel_mode(regs) && !search_exception_tables(regs->pc))
160 goto bad_area_nosemaphore;
161
162 down_read(&mm->mmap_sem);
163 }
164
165 vma = find_vma(mm, address);
166 if (!vma)
167 goto bad_area;
168
169 if (vma->vm_start <= address)
170 goto good_area;
171
172 if (!(vma->vm_flags & VM_GROWSDOWN))
173 goto bad_area;
174
175 if (!is_write)
176 goto bad_area;
177
178 /*
179 * N.B. The ABI allows programs to access up to
180 * a few hundred bytes below the stack pointer (TBD).
181 * The kernel signal delivery code writes up to about 1.5kB
182 * below the stack pointer (r1) before decrementing it.
183 * The exec code can write slightly over 640kB to the stack
184 * before setting the user r1. Thus we allow the stack to
185 * expand to 1MB without further checks.
186 */
187 if (address + 0x100000 < vma->vm_end) {
188
189 /* get user regs even if this fault is in kernel mode */
190 struct pt_regs *uregs = current->thread.regs;
191 if (uregs == NULL)
192 goto bad_area;
193
194 /*
195 * A user-mode access to an address a long way below
196 * the stack pointer is only valid if the instruction
197 * is one which would update the stack pointer to the
198 * address accessed if the instruction completed,
199 * i.e. either stwu rs,n(r1) or stwux rs,r1,rb
200 * (or the byte, halfword, float or double forms).
201 *
202 * If we don't check this then any write to the area
203 * between the last mapped region and the stack will
204 * expand the stack rather than segfaulting.
205 */
206 if (address + 2048 < uregs->r1
207 && (kernel_mode(regs) || !store_updates_sp(regs)))
208 goto bad_area;
209 }
210 if (expand_stack(vma, address))
211 goto bad_area;
212
213good_area:
214 code = SEGV_ACCERR;
215
216 /* a write */
217 if (is_write) {
218 if (!(vma->vm_flags & VM_WRITE))
219 goto bad_area;
220 /* a read */
221 } else {
222 /* protection fault */
223 if (error_code & 0x08000000)
224 goto bad_area;
225 if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
226 goto bad_area;
227 }
228
229 /*
230 * If for any reason at all we couldn't handle the fault,
231 * make sure we exit gracefully rather than endlessly redo
232 * the fault.
233 */
234survive:
235 fault = handle_mm_fault(mm, vma, address, is_write);
236 if (unlikely(fault & VM_FAULT_ERROR)) {
237 if (fault & VM_FAULT_OOM)
238 goto out_of_memory;
239 else if (fault & VM_FAULT_SIGBUS)
240 goto do_sigbus;
241 BUG();
242 }
243 if (fault & VM_FAULT_MAJOR)
244 current->maj_flt++;
245 else
246 current->min_flt++;
247 up_read(&mm->mmap_sem);
248 /*
249 * keep track of tlb+htab misses that are good addrs but
250 * just need pte's created via handle_mm_fault()
251 * -- Cort
252 */
253 pte_misses++;
254 return;
255
256bad_area:
257 up_read(&mm->mmap_sem);
258
259bad_area_nosemaphore:
260 pte_errors++;
261
262 /* User mode accesses cause a SIGSEGV */
263 if (user_mode(regs)) {
264 _exception(SIGSEGV, regs, code, address);
265/* info.si_signo = SIGSEGV;
266 info.si_errno = 0;
267 info.si_code = code;
268 info.si_addr = (void *) address;
269 force_sig_info(SIGSEGV, &info, current);*/
270 return;
271 }
272
273 bad_page_fault(regs, address, SIGSEGV);
274 return;
275
276/*
277 * We ran out of memory, or some other thing happened to us that made
278 * us unable to handle the page fault gracefully.
279 */
280out_of_memory:
281 if (current->pid == 1) {
282 yield();
283 down_read(&mm->mmap_sem);
284 goto survive;
285 }
286 up_read(&mm->mmap_sem);
287 printk(KERN_WARNING "VM: killing process %s\n", current->comm);
288 if (user_mode(regs))
289 do_exit(SIGKILL);
290 bad_page_fault(regs, address, SIGKILL);
291 return;
292
293do_sigbus:
294 up_read(&mm->mmap_sem);
295 if (user_mode(regs)) {
296 info.si_signo = SIGBUS;
297 info.si_errno = 0;
298 info.si_code = BUS_ADRERR;
299 info.si_addr = (void __user *)address;
300 force_sig_info(SIGBUS, &info, current);
301 return;
302 }
303 bad_page_fault(regs, address, SIGBUS);
304}
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index b0c8213cd6cf..b5a701cd71e0 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -23,8 +23,16 @@
23#include <asm/sections.h> 23#include <asm/sections.h>
24#include <asm/tlb.h> 24#include <asm/tlb.h>
25 25
26#ifndef CONFIG_MMU
26unsigned int __page_offset; 27unsigned int __page_offset;
27/* EXPORT_SYMBOL(__page_offset); */ 28EXPORT_SYMBOL(__page_offset);
29
30#else
31DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
32
33int mem_init_done;
34static int init_bootmem_done;
35#endif /* CONFIG_MMU */
28 36
29char *klimit = _end; 37char *klimit = _end;
30 38
@@ -32,28 +40,26 @@ char *klimit = _end;
32 * Initialize the bootmem system and give it all the memory we 40 * Initialize the bootmem system and give it all the memory we
33 * have available. 41 * have available.
34 */ 42 */
35unsigned int memory_start; 43unsigned long memory_start;
36unsigned int memory_end; /* due to mm/nommu.c */ 44unsigned long memory_end; /* due to mm/nommu.c */
37unsigned int memory_size; 45unsigned long memory_size;
38 46
39/* 47/*
40 * paging_init() sets up the page tables - in fact we've already done this. 48 * paging_init() sets up the page tables - in fact we've already done this.
41 */ 49 */
42static void __init paging_init(void) 50static void __init paging_init(void)
43{ 51{
44 int i;
45 unsigned long zones_size[MAX_NR_ZONES]; 52 unsigned long zones_size[MAX_NR_ZONES];
46 53
54 /* Clean every zones */
55 memset(zones_size, 0, sizeof(zones_size));
56
47 /* 57 /*
48 * old: we can DMA to/from any address.put all page into ZONE_DMA 58 * old: we can DMA to/from any address.put all page into ZONE_DMA
49 * We use only ZONE_NORMAL 59 * We use only ZONE_NORMAL
50 */ 60 */
51 zones_size[ZONE_NORMAL] = max_mapnr; 61 zones_size[ZONE_NORMAL] = max_mapnr;
52 62
53 /* every other zones are empty */
54 for (i = 1; i < MAX_NR_ZONES; i++)
55 zones_size[i] = 0;
56
57 free_area_init(zones_size); 63 free_area_init(zones_size);
58} 64}
59 65
@@ -61,6 +67,7 @@ void __init setup_memory(void)
61{ 67{
62 int i; 68 int i;
63 unsigned long map_size; 69 unsigned long map_size;
70#ifndef CONFIG_MMU
64 u32 kernel_align_start, kernel_align_size; 71 u32 kernel_align_start, kernel_align_size;
65 72
66 /* Find main memory where is the kernel */ 73 /* Find main memory where is the kernel */
@@ -93,6 +100,7 @@ void __init setup_memory(void)
93 __func__, kernel_align_start, kernel_align_start 100 __func__, kernel_align_start, kernel_align_start
94 + kernel_align_size, kernel_align_size); 101 + kernel_align_size, kernel_align_size);
95 102
103#endif
96 /* 104 /*
97 * Kernel: 105 * Kernel:
98 * start: base phys address of kernel - page align 106 * start: base phys address of kernel - page align
@@ -121,9 +129,13 @@ void __init setup_memory(void)
121 * for 4GB of memory, using 4kB pages), plus 1 page 129 * for 4GB of memory, using 4kB pages), plus 1 page
122 * (in case the address isn't page-aligned). 130 * (in case the address isn't page-aligned).
123 */ 131 */
132#ifndef CONFIG_MMU
124 map_size = init_bootmem_node(NODE_DATA(0), PFN_UP(TOPHYS((u32)_end)), 133 map_size = init_bootmem_node(NODE_DATA(0), PFN_UP(TOPHYS((u32)_end)),
125 min_low_pfn, max_low_pfn); 134 min_low_pfn, max_low_pfn);
126 135#else
136 map_size = init_bootmem_node(&contig_page_data,
137 PFN_UP(TOPHYS((u32)_end)), min_low_pfn, max_low_pfn);
138#endif
127 lmb_reserve(PFN_UP(TOPHYS((u32)_end)) << PAGE_SHIFT, map_size); 139 lmb_reserve(PFN_UP(TOPHYS((u32)_end)) << PAGE_SHIFT, map_size);
128 140
129 /* free bootmem is whole main memory */ 141 /* free bootmem is whole main memory */
@@ -137,6 +149,9 @@ void __init setup_memory(void)
137 reserve_bootmem(lmb.reserved.region[i].base, 149 reserve_bootmem(lmb.reserved.region[i].base,
138 lmb_size_bytes(&lmb.reserved, i) - 1, BOOTMEM_DEFAULT); 150 lmb_size_bytes(&lmb.reserved, i) - 1, BOOTMEM_DEFAULT);
139 } 151 }
152#ifdef CONFIG_MMU
153 init_bootmem_done = 1;
154#endif
140 paging_init(); 155 paging_init();
141} 156}
142 157
@@ -191,11 +206,145 @@ void __init mem_init(void)
191 printk(KERN_INFO "Memory: %luk/%luk available\n", 206 printk(KERN_INFO "Memory: %luk/%luk available\n",
192 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), 207 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
193 num_physpages << (PAGE_SHIFT-10)); 208 num_physpages << (PAGE_SHIFT-10));
209#ifdef CONFIG_MMU
210 mem_init_done = 1;
211#endif
194} 212}
195 213
214#ifndef CONFIG_MMU
196/* Check against bounds of physical memory */ 215/* Check against bounds of physical memory */
197int ___range_ok(unsigned long addr, unsigned long size) 216int ___range_ok(unsigned long addr, unsigned long size)
198{ 217{
199 return ((addr < memory_start) || 218 return ((addr < memory_start) ||
200 ((addr + size) > memory_end)); 219 ((addr + size) > memory_end));
201} 220}
221EXPORT_SYMBOL(___range_ok);
222
223#else
224int page_is_ram(unsigned long pfn)
225{
226 return pfn < max_low_pfn;
227}
228
229/*
230 * Check for command-line options that affect what MMU_init will do.
231 */
232static void mm_cmdline_setup(void)
233{
234 unsigned long maxmem = 0;
235 char *p = cmd_line;
236
237 /* Look for mem= option on command line */
238 p = strstr(cmd_line, "mem=");
239 if (p) {
240 p += 4;
241 maxmem = memparse(p, &p);
242 if (maxmem && memory_size > maxmem) {
243 memory_size = maxmem;
244 memory_end = memory_start + memory_size;
245 lmb.memory.region[0].size = memory_size;
246 }
247 }
248}
249
250/*
251 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
252 */
253static void __init mmu_init_hw(void)
254{
255 /*
256 * The Zone Protection Register (ZPR) defines how protection will
257 * be applied to every page which is a member of a given zone. At
258 * present, we utilize only two of the zones.
259 * The zone index bits (of ZSEL) in the PTE are used for software
260 * indicators, except the LSB. For user access, zone 1 is used,
261 * for kernel access, zone 0 is used. We set all but zone 1
262 * to zero, allowing only kernel access as indicated in the PTE.
263 * For zone 1, we set a 01 binary (a value of 10 will not work)
264 * to allow user access as indicated in the PTE. This also allows
265 * kernel access as indicated in the PTE.
266 */
267 __asm__ __volatile__ ("ori r11, r0, 0x10000000;" \
268 "mts rzpr, r11;"
269 : : : "r11");
270}
271
272/*
273 * MMU_init sets up the basic memory mappings for the kernel,
274 * including both RAM and possibly some I/O regions,
275 * and sets up the page tables and the MMU hardware ready to go.
276 */
277
278/* called from head.S */
279asmlinkage void __init mmu_init(void)
280{
281 unsigned int kstart, ksize;
282
283 if (!lmb.reserved.cnt) {
284 printk(KERN_EMERG "Error memory count\n");
285 machine_restart(NULL);
286 }
287
288 if ((u32) lmb.memory.region[0].size < 0x1000000) {
289 printk(KERN_EMERG "Memory must be greater than 16MB\n");
290 machine_restart(NULL);
291 }
292 /* Find main memory where the kernel is */
293 memory_start = (u32) lmb.memory.region[0].base;
294 memory_end = (u32) lmb.memory.region[0].base +
295 (u32) lmb.memory.region[0].size;
296 memory_size = memory_end - memory_start;
297
298 mm_cmdline_setup(); /* FIXME parse args from command line - not used */
299
300 /*
301 * Map out the kernel text/data/bss from the available physical
302 * memory.
303 */
304 kstart = __pa(CONFIG_KERNEL_START); /* kernel start */
305 /* kernel size */
306 ksize = PAGE_ALIGN(((u32)_end - (u32)CONFIG_KERNEL_START));
307 lmb_reserve(kstart, ksize);
308
309#if defined(CONFIG_BLK_DEV_INITRD)
310 /* Remove the init RAM disk from the available memory. */
311/* if (initrd_start) {
312 mem_pieces_remove(&phys_avail, __pa(initrd_start),
313 initrd_end - initrd_start, 1);
314 }*/
315#endif /* CONFIG_BLK_DEV_INITRD */
316
317 /* Initialize the MMU hardware */
318 mmu_init_hw();
319
320 /* Map in all of RAM starting at CONFIG_KERNEL_START */
321 mapin_ram();
322
323#ifdef HIGHMEM_START_BOOL
324 ioremap_base = HIGHMEM_START;
325#else
326 ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */
327#endif /* CONFIG_HIGHMEM */
328 ioremap_bot = ioremap_base;
329
330 /* Initialize the context management stuff */
331 mmu_context_init();
332}
333
334/* This is only called until mem_init is done. */
335void __init *early_get_page(void)
336{
337 void *p;
338 if (init_bootmem_done) {
339 p = alloc_bootmem_pages(PAGE_SIZE);
340 } else {
341 /*
342 * Mem start + 32MB -> here is limit
343 * because of mem mapping from head.S
344 */
345 p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE,
346 memory_start + 0x2000000));
347 }
348 return p;
349}
350#endif /* CONFIG_MMU */
diff --git a/arch/microblaze/mm/mmu_context.c b/arch/microblaze/mm/mmu_context.c
new file mode 100644
index 000000000000..26ff82f4fa8f
--- /dev/null
+++ b/arch/microblaze/mm/mmu_context.c
@@ -0,0 +1,70 @@
1/*
2 * This file contains the routines for handling the MMU.
3 *
4 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
5 *
6 * Derived from arch/ppc/mm/4xx_mmu.c:
7 * -- paulus
8 *
9 * Derived from arch/ppc/mm/init.c:
10 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
11 *
12 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
13 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
14 * Copyright (C) 1996 Paul Mackerras
15 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
16 *
17 * Derived from "arch/i386/mm/init.c"
18 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
19 *
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version
23 * 2 of the License, or (at your option) any later version.
24 *
25 */
26
27#include <linux/mm.h>
28#include <linux/init.h>
29
30#include <asm/tlbflush.h>
31#include <asm/mmu_context.h>
32
33mm_context_t next_mmu_context;
34unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
35atomic_t nr_free_contexts;
36struct mm_struct *context_mm[LAST_CONTEXT+1];
37
38/*
39 * Initialize the context management stuff.
40 */
41void __init mmu_context_init(void)
42{
43 /*
44 * The use of context zero is reserved for the kernel.
45 * This code assumes FIRST_CONTEXT < 32.
46 */
47 context_map[0] = (1 << FIRST_CONTEXT) - 1;
48 next_mmu_context = FIRST_CONTEXT;
49 atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
50}
51
52/*
53 * Steal a context from a task that has one at the moment.
54 *
55 * This isn't an LRU system, it just frees up each context in
56 * turn (sort-of pseudo-random replacement :). This would be the
57 * place to implement an LRU scheme if anyone were motivated to do it.
58 */
59void steal_context(void)
60{
61 struct mm_struct *mm;
62
63 /* free up context `next_mmu_context' */
64 /* if we shouldn't free context 0, don't... */
65 if (next_mmu_context < FIRST_CONTEXT)
66 next_mmu_context = FIRST_CONTEXT;
67 mm = context_mm[next_mmu_context];
68 flush_tlb_mm(mm);
69 destroy_context(mm);
70}
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c
new file mode 100644
index 000000000000..46c4ca5d15c5
--- /dev/null
+++ b/arch/microblaze/mm/pgtable.c
@@ -0,0 +1,286 @@
1/*
2 * This file contains the routines setting up the linux page tables.
3 *
4 * Copyright (C) 2008 Michal Simek
5 * Copyright (C) 2008 PetaLogix
6 *
7 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
8 *
9 * Derived from arch/ppc/mm/pgtable.c:
10 * -- paulus
11 *
12 * Derived from arch/ppc/mm/init.c:
13 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
14 *
15 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
16 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
17 * Copyright (C) 1996 Paul Mackerras
18 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
19 *
20 * Derived from "arch/i386/mm/init.c"
21 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
22 *
23 * This file is subject to the terms and conditions of the GNU General
24 * Public License. See the file COPYING in the main directory of this
25 * archive for more details.
26 *
27 */
28
29#include <linux/kernel.h>
30#include <linux/module.h>
31#include <linux/types.h>
32#include <linux/vmalloc.h>
33#include <linux/init.h>
34
35#include <asm/pgtable.h>
36#include <asm/pgalloc.h>
37#include <linux/io.h>
38#include <asm/mmu.h>
39#include <asm/sections.h>
40
41#define flush_HPTE(X, va, pg) _tlbie(va)
42
43unsigned long ioremap_base;
44unsigned long ioremap_bot;
45
46/* The maximum lowmem defaults to 768Mb, but this can be configured to
47 * another value.
48 */
49#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
50
51#ifndef CONFIG_SMP
52struct pgtable_cache_struct quicklists;
53#endif
54
55static void __iomem *__ioremap(phys_addr_t addr, unsigned long size,
56 unsigned long flags)
57{
58 unsigned long v, i;
59 phys_addr_t p;
60 int err;
61
62 /*
63 * Choose an address to map it to.
64 * Once the vmalloc system is running, we use it.
65 * Before then, we use space going down from ioremap_base
66 * (ioremap_bot records where we're up to).
67 */
68 p = addr & PAGE_MASK;
69 size = PAGE_ALIGN(addr + size) - p;
70
71 /*
72 * Don't allow anybody to remap normal RAM that we're using.
73 * mem_init() sets high_memory so only do the check after that.
74 *
75 * However, allow remap of rootfs: TBD
76 */
77 if (mem_init_done &&
78 p >= memory_start && p < virt_to_phys(high_memory) &&
79 !(p >= virt_to_phys((unsigned long)&__bss_stop) &&
80 p < virt_to_phys((unsigned long)__bss_stop))) {
81 printk(KERN_WARNING "__ioremap(): phys addr "PTE_FMT
82 " is RAM lr %p\n", (unsigned long)p,
83 __builtin_return_address(0));
84 return NULL;
85 }
86
87 if (size == 0)
88 return NULL;
89
90 /*
91 * Is it already mapped? If the whole area is mapped then we're
92 * done, otherwise remap it since we want to keep the virt addrs for
93 * each request contiguous.
94 *
95 * We make the assumption here that if the bottom and top
96 * of the range we want are mapped then it's mapped to the
97 * same virt address (and this is contiguous).
98 * -- Cort
99 */
100
101 if (mem_init_done) {
102 struct vm_struct *area;
103 area = get_vm_area(size, VM_IOREMAP);
104 if (area == NULL)
105 return NULL;
106 v = VMALLOC_VMADDR(area->addr);
107 } else {
108 v = (ioremap_bot -= size);
109 }
110
111 if ((flags & _PAGE_PRESENT) == 0)
112 flags |= _PAGE_KERNEL;
113 if (flags & _PAGE_NO_CACHE)
114 flags |= _PAGE_GUARDED;
115
116 err = 0;
117 for (i = 0; i < size && err == 0; i += PAGE_SIZE)
118 err = map_page(v + i, p + i, flags);
119 if (err) {
120 if (mem_init_done)
121 vfree((void *)v);
122 return NULL;
123 }
124
125 return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK));
126}
127
128void __iomem *ioremap(phys_addr_t addr, unsigned long size)
129{
130 return __ioremap(addr, size, _PAGE_NO_CACHE);
131}
132EXPORT_SYMBOL(ioremap);
133
134void iounmap(void *addr)
135{
136 if (addr > high_memory && (unsigned long) addr < ioremap_bot)
137 vfree((void *) (PAGE_MASK & (unsigned long) addr));
138}
139EXPORT_SYMBOL(iounmap);
140
141
142int map_page(unsigned long va, phys_addr_t pa, int flags)
143{
144 pmd_t *pd;
145 pte_t *pg;
146 int err = -ENOMEM;
147 /* spin_lock(&init_mm.page_table_lock); */
148 /* Use upper 10 bits of VA to index the first level map */
149 pd = pmd_offset(pgd_offset_k(va), va);
150 /* Use middle 10 bits of VA to index the second-level map */
151 pg = pte_alloc_kernel(pd, va); /* from powerpc - pgtable.c */
152 /* pg = pte_alloc_kernel(&init_mm, pd, va); */
153
154 if (pg != NULL) {
155 err = 0;
156 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT,
157 __pgprot(flags)));
158 if (mem_init_done)
159 flush_HPTE(0, va, pmd_val(*pd));
160 /* flush_HPTE(0, va, pg); */
161
162 }
163 /* spin_unlock(&init_mm.page_table_lock); */
164 return err;
165}
166
167void __init adjust_total_lowmem(void)
168{
169/* TBD */
170#if 0
171 unsigned long max_low_mem = MAX_LOW_MEM;
172
173 if (total_lowmem > max_low_mem) {
174 total_lowmem = max_low_mem;
175#ifndef CONFIG_HIGHMEM
176 printk(KERN_INFO "Warning, memory limited to %ld Mb, use "
177 "CONFIG_HIGHMEM to reach %ld Mb\n",
178 max_low_mem >> 20, total_memory >> 20);
179 total_memory = total_lowmem;
180#endif /* CONFIG_HIGHMEM */
181 }
182#endif
183}
184
185static void show_tmem(unsigned long tmem)
186{
187 volatile unsigned long a;
188 a = a + tmem;
189}
190
191/*
192 * Map in all of physical memory starting at CONFIG_KERNEL_START.
193 */
194void __init mapin_ram(void)
195{
196 unsigned long v, p, s, f;
197
198 v = CONFIG_KERNEL_START;
199 p = memory_start;
200 show_tmem(memory_size);
201 for (s = 0; s < memory_size; s += PAGE_SIZE) {
202 f = _PAGE_PRESENT | _PAGE_ACCESSED |
203 _PAGE_SHARED | _PAGE_HWEXEC;
204 if ((char *) v < _stext || (char *) v >= _etext)
205 f |= _PAGE_WRENABLE;
206 else
207 /* On the MicroBlaze, no user access
208 forces R/W kernel access */
209 f |= _PAGE_USER;
210 map_page(v, p, f);
211 v += PAGE_SIZE;
212 p += PAGE_SIZE;
213 }
214}
215
216/* is x a power of 2? */
217#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
218
219/*
220 * Set up a mapping for a block of I/O.
221 * virt, phys, size must all be page-aligned.
222 * This should only be called before ioremap is called.
223 */
224void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
225 unsigned int size, int flags)
226{
227 int i;
228
229 if (virt > CONFIG_KERNEL_START && virt < ioremap_bot)
230 ioremap_bot = ioremap_base = virt;
231
232 /* Put it in the page tables. */
233 for (i = 0; i < size; i += PAGE_SIZE)
234 map_page(virt + i, phys + i, flags);
235}
236
237/* Scan the real Linux page tables and return a PTE pointer for
238 * a virtual address in a context.
239 * Returns true (1) if PTE was found, zero otherwise. The pointer to
240 * the PTE pointer is unmodified if PTE is not found.
241 */
242static int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep)
243{
244 pgd_t *pgd;
245 pmd_t *pmd;
246 pte_t *pte;
247 int retval = 0;
248
249 pgd = pgd_offset(mm, addr & PAGE_MASK);
250 if (pgd) {
251 pmd = pmd_offset(pgd, addr & PAGE_MASK);
252 if (pmd_present(*pmd)) {
253 pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
254 if (pte) {
255 retval = 1;
256 *ptep = pte;
257 }
258 }
259 }
260 return retval;
261}
262
263/* Find physical address for this virtual address. Normally used by
264 * I/O functions, but anyone can call it.
265 */
266unsigned long iopa(unsigned long addr)
267{
268 unsigned long pa;
269
270 pte_t *pte;
271 struct mm_struct *mm;
272
273 /* Allow mapping of user addresses (within the thread)
274 * for DMA if necessary.
275 */
276 if (addr < TASK_SIZE)
277 mm = current->mm;
278 else
279 mm = &init_mm;
280
281 pa = 0;
282 if (get_pteptr(mm, addr, &pte))
283 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);
284
285 return pa;
286}
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 1b332e15ab52..eb7f01cfd1ac 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -793,6 +793,6 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
793#define smp_mb__before_atomic_inc() smp_llsc_mb() 793#define smp_mb__before_atomic_inc() smp_llsc_mb()
794#define smp_mb__after_atomic_inc() smp_llsc_mb() 794#define smp_mb__after_atomic_inc() smp_llsc_mb()
795 795
796#include <asm-generic/atomic.h> 796#include <asm-generic/atomic-long.h>
797 797
798#endif /* _ASM_ATOMIC_H */ 798#endif /* _ASM_ATOMIC_H */
diff --git a/arch/mips/include/asm/bitsperlong.h b/arch/mips/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..3e4c10a8e787
--- /dev/null
+++ b/arch/mips/include/asm/bitsperlong.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_MIPS_BITSPERLONG_H
2#define __ASM_MIPS_BITSPERLONG_H
3
4#define __BITS_PER_LONG _MIPS_SZLONG
5
6#include <asm-generic/bitsperlong.h>
7
8#endif /* __ASM_MIPS_BITSPERLONG_H */
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 9f946e4ca057..72c80d2034c2 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -189,6 +189,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
189#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) 189#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
190 190
191#include <asm-generic/memory_model.h> 191#include <asm-generic/memory_model.h>
192#include <asm-generic/page.h> 192#include <asm-generic/getorder.h>
193 193
194#endif /* _ASM_PAGE_H */ 194#endif /* _ASM_PAGE_H */
diff --git a/arch/mips/include/asm/signal.h b/arch/mips/include/asm/signal.h
index bee5153aca48..c783f364938c 100644
--- a/arch/mips/include/asm/signal.h
+++ b/arch/mips/include/asm/signal.h
@@ -109,7 +109,7 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
109#define SIG_UNBLOCK 2 /* for unblocking signals */ 109#define SIG_UNBLOCK 2 /* for unblocking signals */
110#define SIG_SETMASK 3 /* for setting the signal mask */ 110#define SIG_SETMASK 3 /* for setting the signal mask */
111 111
112#include <asm-generic/signal.h> 112#include <asm-generic/signal-defs.h>
113 113
114struct sigaction { 114struct sigaction {
115 unsigned int sa_flags; 115 unsigned int sa_flags;
diff --git a/arch/mips/include/asm/suspend.h b/arch/mips/include/asm/suspend.h
deleted file mode 100644
index 2562f8f9be0e..000000000000
--- a/arch/mips/include/asm/suspend.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_SUSPEND_H
2#define __ASM_SUSPEND_H
3
4/* Somewhen... Maybe :-) */
5
6#endif /* __ASM_SUSPEND_H */
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h
index 7956e69a3bd5..544a2854598f 100644
--- a/arch/mips/include/asm/types.h
+++ b/arch/mips/include/asm/types.h
@@ -31,9 +31,6 @@ typedef unsigned short umode_t;
31 * These aren't exported outside the kernel to avoid name space clashes 31 * These aren't exported outside the kernel to avoid name space clashes
32 */ 32 */
33#ifdef __KERNEL__ 33#ifdef __KERNEL__
34
35#define BITS_PER_LONG _MIPS_SZLONG
36
37#ifndef __ASSEMBLY__ 34#ifndef __ASSEMBLY__
38 35
39#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ 36#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 1f60e27523d9..3e9100dcc12d 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -68,8 +68,6 @@ void *module_alloc(unsigned long size)
68void module_free(struct module *mod, void *module_region) 68void module_free(struct module *mod, void *module_region)
69{ 69{
70 vfree(module_region); 70 vfree(module_region);
71 /* FIXME: If module_region == mod->init_region, trim exception
72 table entries. */
73} 71}
74 72
75int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, 73int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
diff --git a/arch/mn10300/include/asm/atomic.h b/arch/mn10300/include/asm/atomic.h
index bc064825f9b1..5bf5be9566de 100644
--- a/arch/mn10300/include/asm/atomic.h
+++ b/arch/mn10300/include/asm/atomic.h
@@ -151,7 +151,7 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
151#define smp_mb__before_atomic_inc() barrier() 151#define smp_mb__before_atomic_inc() barrier()
152#define smp_mb__after_atomic_inc() barrier() 152#define smp_mb__after_atomic_inc() barrier()
153 153
154#include <asm-generic/atomic.h> 154#include <asm-generic/atomic-long.h>
155 155
156#endif /* __KERNEL__ */ 156#endif /* __KERNEL__ */
157#endif /* _ASM_ATOMIC_H */ 157#endif /* _ASM_ATOMIC_H */
diff --git a/arch/mn10300/include/asm/bitsperlong.h b/arch/mn10300/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/mn10300/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h
index b7986b65addf..d04fac1da5aa 100644
--- a/arch/mn10300/include/asm/mman.h
+++ b/arch/mn10300/include/asm/mman.h
@@ -12,7 +12,7 @@
12#ifndef _ASM_MMAN_H 12#ifndef _ASM_MMAN_H
13#define _ASM_MMAN_H 13#define _ASM_MMAN_H
14 14
15#include <asm-generic/mman.h> 15#include <asm-generic/mman-common.h>
16 16
17#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 17#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
18#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 18#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/mn10300/include/asm/ptrace.h b/arch/mn10300/include/asm/ptrace.h
index 921942ed1b03..1b0ba5e182b0 100644
--- a/arch/mn10300/include/asm/ptrace.h
+++ b/arch/mn10300/include/asm/ptrace.h
@@ -77,8 +77,6 @@ struct pt_regs {
77}; 77};
78#endif 78#endif
79 79
80extern struct pt_regs *__frame; /* current frame pointer */
81
82/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 80/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
83#define PTRACE_GETREGS 12 81#define PTRACE_GETREGS 12
84#define PTRACE_SETREGS 13 82#define PTRACE_SETREGS 13
@@ -90,6 +88,8 @@ extern struct pt_regs *__frame; /* current frame pointer */
90 88
91#if defined(__KERNEL__) 89#if defined(__KERNEL__)
92 90
91extern struct pt_regs *__frame; /* current frame pointer */
92
93#if !defined(__ASSEMBLY__) 93#if !defined(__ASSEMBLY__)
94struct task_struct; 94struct task_struct;
95 95
@@ -107,5 +107,4 @@ extern void user_disable_single_step(struct task_struct *);
107#define profile_pc(regs) ((regs)->pc) 107#define profile_pc(regs) ((regs)->pc)
108 108
109#endif /* __KERNEL__ */ 109#endif /* __KERNEL__ */
110
111#endif /* _ASM_PTRACE_H */ 110#endif /* _ASM_PTRACE_H */
diff --git a/arch/mn10300/include/asm/setup.h b/arch/mn10300/include/asm/setup.h
index 08356c832283..c229d1e3f999 100644
--- a/arch/mn10300/include/asm/setup.h
+++ b/arch/mn10300/include/asm/setup.h
@@ -11,7 +11,8 @@
11#ifndef _ASM_SETUP_H 11#ifndef _ASM_SETUP_H
12#define _ASM_SETUP_H 12#define _ASM_SETUP_H
13 13
14#ifdef __KERNEL__
14extern void __init unit_setup(void); 15extern void __init unit_setup(void);
15extern void __init unit_init_IRQ(void); 16extern void __init unit_init_IRQ(void);
16 17#endif
17#endif /* _ASM_SETUP_H */ 18#endif /* _ASM_SETUP_H */
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h
index e98817cec5f7..7e891fce2370 100644
--- a/arch/mn10300/include/asm/signal.h
+++ b/arch/mn10300/include/asm/signal.h
@@ -115,7 +115,7 @@ typedef unsigned long sigset_t;
115#define MINSIGSTKSZ 2048 115#define MINSIGSTKSZ 2048
116#define SIGSTKSZ 8192 116#define SIGSTKSZ 8192
117 117
118#include <asm-generic/signal.h> 118#include <asm-generic/signal-defs.h>
119 119
120#ifdef __KERNEL__ 120#ifdef __KERNEL__
121struct old_sigaction { 121struct old_sigaction {
diff --git a/arch/mn10300/kernel/module.c b/arch/mn10300/kernel/module.c
index 6b287f2e8e84..4fa0e3648d8e 100644
--- a/arch/mn10300/kernel/module.c
+++ b/arch/mn10300/kernel/module.c
@@ -48,8 +48,6 @@ void *module_alloc(unsigned long size)
48void module_free(struct module *mod, void *module_region) 48void module_free(struct module *mod, void *module_region)
49{ 49{
50 vfree(module_region); 50 vfree(module_region);
51 /* FIXME: If module_region == mod->init_region, trim exception
52 * table entries. */
53} 51}
54 52
55/* 53/*
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index ada3e5364d82..7eeaff944360 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -338,6 +338,6 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
338 338
339#endif /* CONFIG_64BIT */ 339#endif /* CONFIG_64BIT */
340 340
341#include <asm-generic/atomic.h> 341#include <asm-generic/atomic-long.h>
342 342
343#endif /* _ASM_PARISC_ATOMIC_H_ */ 343#endif /* _ASM_PARISC_ATOMIC_H_ */
diff --git a/arch/parisc/include/asm/bitsperlong.h b/arch/parisc/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..75196b415d3f
--- /dev/null
+++ b/arch/parisc/include/asm/bitsperlong.h
@@ -0,0 +1,20 @@
1#ifndef __ASM_PARISC_BITSPERLONG_H
2#define __ASM_PARISC_BITSPERLONG_H
3
4/*
5 * using CONFIG_* outside of __KERNEL__ is wrong,
6 * __LP64__ was also removed from headers, so what
7 * is the right approach on parisc?
8 * -arnd
9 */
10#if (defined(__KERNEL__) && defined(CONFIG_64BIT)) || defined (__LP64__)
11#define __BITS_PER_LONG 64
12#define SHIFT_PER_LONG 6
13#else
14#define __BITS_PER_LONG 32
15#define SHIFT_PER_LONG 5
16#endif
17
18#include <asm-generic/bitsperlong.h>
19
20#endif /* __ASM_PARISC_BITSPERLONG_H */
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h
index 7bc5125d7d4c..a84cc1f925f6 100644
--- a/arch/parisc/include/asm/page.h
+++ b/arch/parisc/include/asm/page.h
@@ -159,6 +159,6 @@ extern int npmem_ranges;
159 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 159 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
160 160
161#include <asm-generic/memory_model.h> 161#include <asm-generic/memory_model.h>
162#include <asm-generic/page.h> 162#include <asm-generic/getorder.h>
163 163
164#endif /* _PARISC_PAGE_H */ 164#endif /* _PARISC_PAGE_H */
diff --git a/arch/parisc/include/asm/types.h b/arch/parisc/include/asm/types.h
index 7f5a39bfb4ce..20135cc80039 100644
--- a/arch/parisc/include/asm/types.h
+++ b/arch/parisc/include/asm/types.h
@@ -14,14 +14,6 @@ typedef unsigned short umode_t;
14 */ 14 */
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#ifdef CONFIG_64BIT
18#define BITS_PER_LONG 64
19#define SHIFT_PER_LONG 6
20#else
21#define BITS_PER_LONG 32
22#define SHIFT_PER_LONG 5
23#endif
24
25#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
26 18
27/* Dma addresses are 32-bits wide. */ 19/* Dma addresses are 32-bits wide. */
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index cd4c0b2a8e70..7cf799d70b4c 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -7,7 +7,7 @@
7#include <asm/page.h> 7#include <asm/page.h>
8#include <asm/system.h> 8#include <asm/system.h>
9#include <asm/cache.h> 9#include <asm/cache.h>
10#include <asm-generic/uaccess.h> 10#include <asm-generic/uaccess-unaligned.h>
11 11
12#define VERIFY_READ 0 12#define VERIFY_READ 0
13#define VERIFY_WRITE 1 13#define VERIFY_WRITE 1
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index ecd1c5024447..ef5caf2e6ed0 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -267,8 +267,6 @@ void module_free(struct module *mod, void *module_region)
267 mod->arch.section = NULL; 267 mod->arch.section = NULL;
268 268
269 vfree(module_region); 269 vfree(module_region);
270 /* FIXME: If module_region == mod->init_region, trim exception
271 table entries. */
272} 270}
273 271
274/* Additional bytes needed in front of individual sections */ 272/* Additional bytes needed in front of individual sections */
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index b401950f5259..b7d2d07b6f96 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -472,6 +472,6 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
472 472
473#endif /* __powerpc64__ */ 473#endif /* __powerpc64__ */
474 474
475#include <asm-generic/atomic.h> 475#include <asm-generic/atomic-long.h>
476#endif /* __KERNEL__ */ 476#endif /* __KERNEL__ */
477#endif /* _ASM_POWERPC_ATOMIC_H_ */ 477#endif /* _ASM_POWERPC_ATOMIC_H_ */
diff --git a/arch/powerpc/include/asm/bitsperlong.h b/arch/powerpc/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..5f1659032c40
--- /dev/null
+++ b/arch/powerpc/include/asm/bitsperlong.h
@@ -0,0 +1,12 @@
1#ifndef __ASM_POWERPC_BITSPERLONG_H
2#define __ASM_POWERPC_BITSPERLONG_H
3
4#if defined(__powerpc64__)
5# define __BITS_PER_LONG 64
6#else
7# define __BITS_PER_LONG 32
8#endif
9
10#include <asm-generic/bitsperlong.h>
11
12#endif /* __ASM_POWERPC_BITSPERLONG_H */
diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h
index e7b99bac9f48..7b1c49811a24 100644
--- a/arch/powerpc/include/asm/mman.h
+++ b/arch/powerpc/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_POWERPC_MMAN_H 1#ifndef _ASM_POWERPC_MMAN_H
2#define _ASM_POWERPC_MMAN_H 2#define _ASM_POWERPC_MMAN_H
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6/* 6/*
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
diff --git a/arch/powerpc/include/asm/mpc52xx_psc.h b/arch/powerpc/include/asm/mpc52xx_psc.h
index a218da6bec7c..fb8412057450 100644
--- a/arch/powerpc/include/asm/mpc52xx_psc.h
+++ b/arch/powerpc/include/asm/mpc52xx_psc.h
@@ -28,6 +28,10 @@
28#define MPC52xx_PSC_MAXNUM 6 28#define MPC52xx_PSC_MAXNUM 6
29 29
30/* Programmable Serial Controller (PSC) status register bits */ 30/* Programmable Serial Controller (PSC) status register bits */
31#define MPC52xx_PSC_SR_UNEX_RX 0x0001
32#define MPC52xx_PSC_SR_DATA_VAL 0x0002
33#define MPC52xx_PSC_SR_DATA_OVR 0x0004
34#define MPC52xx_PSC_SR_CMDSEND 0x0008
31#define MPC52xx_PSC_SR_CDE 0x0080 35#define MPC52xx_PSC_SR_CDE 0x0080
32#define MPC52xx_PSC_SR_RXRDY 0x0100 36#define MPC52xx_PSC_SR_RXRDY 0x0100
33#define MPC52xx_PSC_SR_RXFULL 0x0200 37#define MPC52xx_PSC_SR_RXFULL 0x0200
@@ -61,6 +65,12 @@
61#define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001 65#define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001
62 66
63/* PSC interrupt status/mask bits */ 67/* PSC interrupt status/mask bits */
68#define MPC52xx_PSC_IMR_UNEX_RX_SLOT 0x0001
69#define MPC52xx_PSC_IMR_DATA_VALID 0x0002
70#define MPC52xx_PSC_IMR_DATA_OVR 0x0004
71#define MPC52xx_PSC_IMR_CMD_SEND 0x0008
72#define MPC52xx_PSC_IMR_ERROR 0x0040
73#define MPC52xx_PSC_IMR_DEOF 0x0080
64#define MPC52xx_PSC_IMR_TXRDY 0x0100 74#define MPC52xx_PSC_IMR_TXRDY 0x0100
65#define MPC52xx_PSC_IMR_RXRDY 0x0200 75#define MPC52xx_PSC_IMR_RXRDY 0x0200
66#define MPC52xx_PSC_IMR_DB 0x0400 76#define MPC52xx_PSC_IMR_DB 0x0400
@@ -117,6 +127,7 @@
117#define MPC52xx_PSC_SICR_SIM_FIR (0x6 << 24) 127#define MPC52xx_PSC_SICR_SIM_FIR (0x6 << 24)
118#define MPC52xx_PSC_SICR_SIM_CODEC_24 (0x7 << 24) 128#define MPC52xx_PSC_SICR_SIM_CODEC_24 (0x7 << 24)
119#define MPC52xx_PSC_SICR_SIM_CODEC_32 (0xf << 24) 129#define MPC52xx_PSC_SICR_SIM_CODEC_32 (0xf << 24)
130#define MPC52xx_PSC_SICR_AWR (1 << 30)
120#define MPC52xx_PSC_SICR_GENCLK (1 << 23) 131#define MPC52xx_PSC_SICR_GENCLK (1 << 23)
121#define MPC52xx_PSC_SICR_I2S (1 << 22) 132#define MPC52xx_PSC_SICR_I2S (1 << 22)
122#define MPC52xx_PSC_SICR_CLKPOL (1 << 21) 133#define MPC52xx_PSC_SICR_CLKPOL (1 << 21)
diff --git a/arch/powerpc/include/asm/page_32.h b/arch/powerpc/include/asm/page_32.h
index a0e3f6e6b4ee..bd0849dbcaaa 100644
--- a/arch/powerpc/include/asm/page_32.h
+++ b/arch/powerpc/include/asm/page_32.h
@@ -41,7 +41,7 @@ extern void clear_pages(void *page, int order);
41static inline void clear_page(void *page) { clear_pages(page, 0); } 41static inline void clear_page(void *page) { clear_pages(page, 0); }
42extern void copy_page(void *to, void *from); 42extern void copy_page(void *to, void *from);
43 43
44#include <asm-generic/page.h> 44#include <asm-generic/getorder.h>
45 45
46#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1) 46#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
47#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) 47#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index 043bfdfe4f73..5817a3b747e5 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -180,6 +180,6 @@ do { \
180 (test_thread_flag(TIF_32BIT) ? \ 180 (test_thread_flag(TIF_32BIT) ? \
181 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) 181 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
182 182
183#include <asm-generic/page.h> 183#include <asm-generic/getorder.h>
184 184
185#endif /* _ASM_POWERPC_PAGE_64_H */ 185#endif /* _ASM_POWERPC_PAGE_64_H */
diff --git a/arch/powerpc/include/asm/signal.h b/arch/powerpc/include/asm/signal.h
index 69f709d8e8e7..3eb13be11d8f 100644
--- a/arch/powerpc/include/asm/signal.h
+++ b/arch/powerpc/include/asm/signal.h
@@ -94,7 +94,7 @@ typedef struct {
94#define MINSIGSTKSZ 2048 94#define MINSIGSTKSZ 2048
95#define SIGSTKSZ 8192 95#define SIGSTKSZ 8192
96 96
97#include <asm-generic/signal.h> 97#include <asm-generic/signal-defs.h>
98 98
99struct old_sigaction { 99struct old_sigaction {
100 __sighandler_t sa_handler; 100 __sighandler_t sa_handler;
diff --git a/arch/powerpc/include/asm/termios.h b/arch/powerpc/include/asm/termios.h
index 2c14fea07c8a..a24f48704a34 100644
--- a/arch/powerpc/include/asm/termios.h
+++ b/arch/powerpc/include/asm/termios.h
@@ -78,7 +78,7 @@ struct termio {
78 78
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80 80
81#include <asm-generic/termios.h> 81#include <asm-generic/termios-base.h>
82 82
83#endif /* __KERNEL__ */ 83#endif /* __KERNEL__ */
84 84
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h
index 7ce27a52bb34..a5aea0ca34e9 100644
--- a/arch/powerpc/include/asm/types.h
+++ b/arch/powerpc/include/asm/types.h
@@ -40,15 +40,6 @@ typedef struct {
40#endif /* __ASSEMBLY__ */ 40#endif /* __ASSEMBLY__ */
41 41
42#ifdef __KERNEL__ 42#ifdef __KERNEL__
43/*
44 * These aren't exported outside the kernel to avoid name space clashes
45 */
46#ifdef __powerpc64__
47#define BITS_PER_LONG 64
48#else
49#define BITS_PER_LONG 32
50#endif
51
52#ifndef __ASSEMBLY__ 43#ifndef __ASSEMBLY__
53 44
54typedef __vector128 vector128; 45typedef __vector128 vector128;
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index 43e7e3a7f130..477c663e0140 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -43,8 +43,6 @@ void *module_alloc(unsigned long size)
43void module_free(struct module *mod, void *module_region) 43void module_free(struct module *mod, void *module_region)
44{ 44{
45 vfree(module_region); 45 vfree(module_region);
46 /* FIXME: If module_region == mod->init_region, trim exception
47 table entries. */
48} 46}
49 47
50static const Elf_Shdr *find_section(const Elf_Ehdr *hdr, 48static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c
index b3f7d1216bae..b72e7a19d054 100644
--- a/arch/powerpc/kernel/power7-pmu.c
+++ b/arch/powerpc/kernel/power7-pmu.c
@@ -294,12 +294,12 @@ static void power7_disable_pmc(unsigned int pmc, u64 mmcr[])
294} 294}
295 295
296static int power7_generic_events[] = { 296static int power7_generic_events[] = {
297 [PERF_COUNT_CPU_CYCLES] = 0x1e, 297 [PERF_COUNT_HW_CPU_CYCLES] = 0x1e,
298 [PERF_COUNT_INSTRUCTIONS] = 2, 298 [PERF_COUNT_HW_INSTRUCTIONS] = 2,
299 [PERF_COUNT_CACHE_REFERENCES] = 0xc880, /* LD_REF_L1_LSU */ 299 [PERF_COUNT_HW_CACHE_REFERENCES] = 0xc880, /* LD_REF_L1_LSU*/
300 [PERF_COUNT_CACHE_MISSES] = 0x400f0, /* LD_MISS_L1 */ 300 [PERF_COUNT_HW_CACHE_MISSES] = 0x400f0, /* LD_MISS_L1 */
301 [PERF_COUNT_BRANCH_INSTRUCTIONS] = 0x10068, /* BRU_FIN */ 301 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x10068, /* BRU_FIN */
302 [PERF_COUNT_BRANCH_MISSES] = 0x400f6, /* BR_MPRED */ 302 [PERF_COUNT_HW_BRANCH_MISSES] = 0x400f6, /* BR_MPRED */
303}; 303};
304 304
305#define C(x) PERF_COUNT_HW_CACHE_##x 305#define C(x) PERF_COUNT_HW_CACHE_##x
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 89497fb04280..3b52c80e5e33 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -2,7 +2,7 @@
2 * PowerPC64 SLB support. 2 * PowerPC64 SLB support.
3 * 3 *
4 * Copyright (C) 2004 David Gibson <dwg@au.ibm.com>, IBM 4 * Copyright (C) 2004 David Gibson <dwg@au.ibm.com>, IBM
5 * Based on earlier code writteh by: 5 * Based on earlier code written by:
6 * Dave Engebretsen and Mike Corrigan {engebret|mikejc}@us.ibm.com 6 * Dave Engebretsen and Mike Corrigan {engebret|mikejc}@us.ibm.com
7 * Copyright (c) 2001 Dave Engebretsen 7 * Copyright (c) 2001 Dave Engebretsen
8 * Copyright (C) 2002 Anton Blanchard <anton@au.ibm.com>, IBM 8 * Copyright (C) 2002 Anton Blanchard <anton@au.ibm.com>, IBM
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 2eca5fe0e75b..99dc3ded6b49 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -82,6 +82,11 @@ config S390
82 select USE_GENERIC_SMP_HELPERS if SMP 82 select USE_GENERIC_SMP_HELPERS if SMP
83 select HAVE_SYSCALL_WRAPPERS 83 select HAVE_SYSCALL_WRAPPERS
84 select HAVE_FUNCTION_TRACER 84 select HAVE_FUNCTION_TRACER
85 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
86 select HAVE_FTRACE_MCOUNT_RECORD
87 select HAVE_FTRACE_SYSCALLS
88 select HAVE_DYNAMIC_FTRACE
89 select HAVE_FUNCTION_GRAPH_TRACER
85 select HAVE_DEFAULT_NO_SPIN_MUTEXES 90 select HAVE_DEFAULT_NO_SPIN_MUTEXES
86 select HAVE_OPROFILE 91 select HAVE_OPROFILE
87 select HAVE_KPROBES 92 select HAVE_KPROBES
@@ -567,6 +572,24 @@ bool "s390 guest support for KVM (EXPERIMENTAL)"
567 the KVM hypervisor. This will add detection for KVM as well as a 572 the KVM hypervisor. This will add detection for KVM as well as a
568 virtio transport. If KVM is detected, the virtio console will be 573 virtio transport. If KVM is detected, the virtio console will be
569 the default console. 574 the default console.
575
576config SECCOMP
577 bool "Enable seccomp to safely compute untrusted bytecode"
578 depends on PROC_FS
579 default y
580 help
581 This kernel feature is useful for number crunching applications
582 that may need to compute untrusted bytecode during their
583 execution. By using pipes or other transports made available to
584 the process as file descriptors supporting the read/write
585 syscalls, it's possible to isolate those applications in
586 their own address space using seccomp. Once seccomp is
587 enabled via /proc/<pid>/seccomp, it cannot be disabled
588 and the task is only allowed to execute a few safe syscalls
589 defined by each seccomp mode.
590
591 If unsure, say Y.
592
570endmenu 593endmenu
571 594
572source "net/Kconfig" 595source "net/Kconfig"
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index de432f2de2d2..fca9dffcc669 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -275,6 +275,6 @@ static __inline__ int atomic64_add_unless(atomic64_t *v,
275#define smp_mb__before_atomic_inc() smp_mb() 275#define smp_mb__before_atomic_inc() smp_mb()
276#define smp_mb__after_atomic_inc() smp_mb() 276#define smp_mb__after_atomic_inc() smp_mb()
277 277
278#include <asm-generic/atomic.h> 278#include <asm-generic/atomic-long.h>
279#endif /* __KERNEL__ */ 279#endif /* __KERNEL__ */
280#endif /* __ARCH_S390_ATOMIC__ */ 280#endif /* __ARCH_S390_ATOMIC__ */
diff --git a/arch/s390/include/asm/bitsperlong.h b/arch/s390/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6b235aea9c66
--- /dev/null
+++ b/arch/s390/include/asm/bitsperlong.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_S390_BITSPERLONG_H
2#define __ASM_S390_BITSPERLONG_H
3
4#ifndef __s390x__
5#define __BITS_PER_LONG 32
6#else
7#define __BITS_PER_LONG 64
8#endif
9
10#include <asm-generic/bitsperlong.h>
11
12#endif /* __ASM_S390_BITSPERLONG_H */
13
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index de065b32381a..01a08020bc0e 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -5,6 +5,7 @@
5 */ 5 */
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/thread_info.h>
8 9
9#define PSW32_MASK_PER 0x40000000UL 10#define PSW32_MASK_PER 0x40000000UL
10#define PSW32_MASK_DAT 0x04000000UL 11#define PSW32_MASK_DAT 0x04000000UL
@@ -163,12 +164,28 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
163 return (u32)(unsigned long)uptr; 164 return (u32)(unsigned long)uptr;
164} 165}
165 166
167#ifdef CONFIG_COMPAT
168
169static inline int is_compat_task(void)
170{
171 return test_thread_flag(TIF_31BIT);
172}
173
174#else
175
176static inline int is_compat_task(void)
177{
178 return 0;
179}
180
181#endif
182
166static inline void __user *compat_alloc_user_space(long len) 183static inline void __user *compat_alloc_user_space(long len)
167{ 184{
168 unsigned long stack; 185 unsigned long stack;
169 186
170 stack = KSTK_ESP(current); 187 stack = KSTK_ESP(current);
171 if (test_thread_flag(TIF_31BIT)) 188 if (is_compat_task())
172 stack &= 0x7fffffffUL; 189 stack &= 0x7fffffffUL;
173 return (void __user *) (stack - len); 190 return (void __user *) (stack - len);
174} 191}
diff --git a/arch/s390/include/asm/cpu.h b/arch/s390/include/asm/cpu.h
deleted file mode 100644
index d60a2eefb17b..000000000000
--- a/arch/s390/include/asm/cpu.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * include/asm-s390/cpu.h
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_CPU_H_
9#define _ASM_S390_CPU_H_
10
11#include <linux/types.h>
12#include <linux/percpu.h>
13#include <linux/spinlock.h>
14
15struct s390_idle_data {
16 spinlock_t lock;
17 unsigned long long idle_count;
18 unsigned long long idle_enter;
19 unsigned long long idle_time;
20};
21
22DECLARE_PER_CPU(struct s390_idle_data, s390_idle);
23
24void vtime_start_cpu(void);
25
26static inline void s390_idle_check(void)
27{
28 if ((&__get_cpu_var(s390_idle))->idle_enter != 0ULL)
29 vtime_start_cpu();
30}
31
32#endif /* _ASM_S390_CPU_H_ */
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 941384fbd39c..ec917d42ee6d 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -9,6 +9,9 @@
9#ifndef _S390_CPUTIME_H 9#ifndef _S390_CPUTIME_H
10#define _S390_CPUTIME_H 10#define _S390_CPUTIME_H
11 11
12#include <linux/types.h>
13#include <linux/percpu.h>
14#include <linux/spinlock.h>
12#include <asm/div64.h> 15#include <asm/div64.h>
13 16
14/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */ 17/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
@@ -174,8 +177,24 @@ cputime64_to_clock_t(cputime64_t cputime)
174 return __div(cputime, 4096000000ULL / USER_HZ); 177 return __div(cputime, 4096000000ULL / USER_HZ);
175} 178}
176 179
180struct s390_idle_data {
181 spinlock_t lock;
182 unsigned long long idle_count;
183 unsigned long long idle_enter;
184 unsigned long long idle_time;
185};
186
187DECLARE_PER_CPU(struct s390_idle_data, s390_idle);
188
189void vtime_start_cpu(void);
177cputime64_t s390_get_idle_time(int cpu); 190cputime64_t s390_get_idle_time(int cpu);
178 191
179#define arch_idle_time(cpu) s390_get_idle_time(cpu) 192#define arch_idle_time(cpu) s390_get_idle_time(cpu)
180 193
194static inline void s390_idle_check(void)
195{
196 if ((&__get_cpu_var(s390_idle))->idle_enter != 0ULL)
197 vtime_start_cpu();
198}
199
181#endif /* _S390_CPUTIME_H */ 200#endif /* _S390_CPUTIME_H */
diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
index 5a5bc75e19d4..96c14a9102b8 100644
--- a/arch/s390/include/asm/ftrace.h
+++ b/arch/s390/include/asm/ftrace.h
@@ -2,7 +2,28 @@
2#define _ASM_S390_FTRACE_H 2#define _ASM_S390_FTRACE_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5
5extern void _mcount(void); 6extern void _mcount(void);
7extern unsigned long ftrace_dyn_func;
8
9struct dyn_arch_ftrace { };
10
11#define MCOUNT_ADDR ((long)_mcount)
12
13#ifdef CONFIG_64BIT
14#define MCOUNT_OFFSET_RET 18
15#define MCOUNT_INSN_SIZE 24
16#define MCOUNT_OFFSET 14
17#else
18#define MCOUNT_OFFSET_RET 26
19#define MCOUNT_INSN_SIZE 30
20#define MCOUNT_OFFSET 8
6#endif 21#endif
7 22
23static inline unsigned long ftrace_call_adjust(unsigned long addr)
24{
25 return addr - MCOUNT_OFFSET;
26}
27
28#endif /* __ASSEMBLY__ */
8#endif /* _ASM_S390_FTRACE_H */ 29#endif /* _ASM_S390_FTRACE_H */
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index 3aeca492b147..5046ad6b7a63 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -30,6 +30,7 @@
30#define __LC_SUBCHANNEL_NR 0x00ba 30#define __LC_SUBCHANNEL_NR 0x00ba
31#define __LC_IO_INT_PARM 0x00bc 31#define __LC_IO_INT_PARM 0x00bc
32#define __LC_IO_INT_WORD 0x00c0 32#define __LC_IO_INT_WORD 0x00c0
33#define __LC_STFL_FAC_LIST 0x00c8
33#define __LC_MCCK_CODE 0x00e8 34#define __LC_MCCK_CODE 0x00e8
34 35
35#define __LC_DUMP_REIPL 0x0e00 36#define __LC_DUMP_REIPL 0x0e00
@@ -67,6 +68,7 @@
67#define __LC_CPUID 0x02b0 68#define __LC_CPUID 0x02b0
68#define __LC_INT_CLOCK 0x02c8 69#define __LC_INT_CLOCK 0x02c8
69#define __LC_MACHINE_FLAGS 0x02d8 70#define __LC_MACHINE_FLAGS 0x02d8
71#define __LC_FTRACE_FUNC 0x02dc
70#define __LC_IRB 0x0300 72#define __LC_IRB 0x0300
71#define __LC_PFAULT_INTPARM 0x0080 73#define __LC_PFAULT_INTPARM 0x0080
72#define __LC_CPU_TIMER_SAVE_AREA 0x00d8 74#define __LC_CPU_TIMER_SAVE_AREA 0x00d8
@@ -112,6 +114,7 @@
112#define __LC_INT_CLOCK 0x0340 114#define __LC_INT_CLOCK 0x0340
113#define __LC_VDSO_PER_CPU 0x0350 115#define __LC_VDSO_PER_CPU 0x0350
114#define __LC_MACHINE_FLAGS 0x0358 116#define __LC_MACHINE_FLAGS 0x0358
117#define __LC_FTRACE_FUNC 0x0360
115#define __LC_IRB 0x0380 118#define __LC_IRB 0x0380
116#define __LC_PASTE 0x03c0 119#define __LC_PASTE 0x03c0
117#define __LC_PFAULT_INTPARM 0x11b8 120#define __LC_PFAULT_INTPARM 0x11b8
@@ -280,7 +283,8 @@ struct _lowcore
280 __u64 int_clock; /* 0x02c8 */ 283 __u64 int_clock; /* 0x02c8 */
281 __u64 clock_comparator; /* 0x02d0 */ 284 __u64 clock_comparator; /* 0x02d0 */
282 __u32 machine_flags; /* 0x02d8 */ 285 __u32 machine_flags; /* 0x02d8 */
283 __u8 pad_0x02dc[0x0300-0x02dc]; /* 0x02dc */ 286 __u32 ftrace_func; /* 0x02dc */
287 __u8 pad_0x02f0[0x0300-0x02f0]; /* 0x02f0 */
284 288
285 /* Interrupt response block */ 289 /* Interrupt response block */
286 __u8 irb[64]; /* 0x0300 */ 290 __u8 irb[64]; /* 0x0300 */
@@ -385,7 +389,8 @@ struct _lowcore
385 __u64 clock_comparator; /* 0x0348 */ 389 __u64 clock_comparator; /* 0x0348 */
386 __u64 vdso_per_cpu_data; /* 0x0350 */ 390 __u64 vdso_per_cpu_data; /* 0x0350 */
387 __u64 machine_flags; /* 0x0358 */ 391 __u64 machine_flags; /* 0x0358 */
388 __u8 pad_0x0360[0x0380-0x0360]; /* 0x0360 */ 392 __u64 ftrace_func; /* 0x0360 */
393 __u8 pad_0x0368[0x0380-0x0368]; /* 0x0368 */
389 394
390 /* Interrupt response block. */ 395 /* Interrupt response block. */
391 __u8 irb[64]; /* 0x0380 */ 396 __u8 irb[64]; /* 0x0380 */
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index da01432e8f44..f63fe7b431ed 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -9,7 +9,7 @@
9#ifndef __S390_MMAN_H__ 9#ifndef __S390_MMAN_H__
10#define __S390_MMAN_H__ 10#define __S390_MMAN_H__
11 11
12#include <asm-generic/mman.h> 12#include <asm-generic/mman-common.h>
13 13
14#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 14#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
15#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 15#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 32e8f6aa4384..3e3594d01f83 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -150,7 +150,7 @@ void arch_alloc_page(struct page *page, int order);
150 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 150 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
151 151
152#include <asm-generic/memory_model.h> 152#include <asm-generic/memory_model.h>
153#include <asm-generic/page.h> 153#include <asm-generic/getorder.h>
154 154
155#define __HAVE_ARCH_GATE_AREA 1 155#define __HAVE_ARCH_GATE_AREA 1
156 156
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 5caddd4f7bed..60a7b1a1702f 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -112,12 +112,15 @@ extern char empty_zero_page[PAGE_SIZE];
112 * effect, this also makes sure that 64 bit module code cannot be used 112 * effect, this also makes sure that 64 bit module code cannot be used
113 * as system call address. 113 * as system call address.
114 */ 114 */
115
116extern unsigned long VMALLOC_START;
117
115#ifndef __s390x__ 118#ifndef __s390x__
116#define VMALLOC_START 0x78000000UL 119#define VMALLOC_SIZE (96UL << 20)
117#define VMALLOC_END 0x7e000000UL 120#define VMALLOC_END 0x7e000000UL
118#define VMEM_MAP_END 0x80000000UL 121#define VMEM_MAP_END 0x80000000UL
119#else /* __s390x__ */ 122#else /* __s390x__ */
120#define VMALLOC_START 0x3e000000000UL 123#define VMALLOC_SIZE (1UL << 30)
121#define VMALLOC_END 0x3e040000000UL 124#define VMALLOC_END 0x3e040000000UL
122#define VMEM_MAP_END 0x40000000000UL 125#define VMEM_MAP_END 0x40000000000UL
123#endif /* __s390x__ */ 126#endif /* __s390x__ */
diff --git a/arch/s390/include/asm/seccomp.h b/arch/s390/include/asm/seccomp.h
new file mode 100644
index 000000000000..781a9cf9b002
--- /dev/null
+++ b/arch/s390/include/asm/seccomp.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_S390_SECCOMP_H
2#define _ASM_S390_SECCOMP_H
3
4#include <linux/unistd.h>
5
6#define __NR_seccomp_read __NR_read
7#define __NR_seccomp_write __NR_write
8#define __NR_seccomp_exit __NR_exit
9#define __NR_seccomp_sigreturn __NR_sigreturn
10
11#define __NR_seccomp_read_32 __NR_read
12#define __NR_seccomp_write_32 __NR_write
13#define __NR_seccomp_exit_32 __NR_exit
14#define __NR_seccomp_sigreturn_32 __NR_sigreturn
15
16#endif /* _ASM_S390_SECCOMP_H */
diff --git a/arch/s390/include/asm/signal.h b/arch/s390/include/asm/signal.h
index f6cfddb278cb..cdf5cb2fe03f 100644
--- a/arch/s390/include/asm/signal.h
+++ b/arch/s390/include/asm/signal.h
@@ -115,7 +115,7 @@ typedef unsigned long sigset_t;
115#define MINSIGSTKSZ 2048 115#define MINSIGSTKSZ 2048
116#define SIGSTKSZ 8192 116#define SIGSTKSZ 8192
117 117
118#include <asm-generic/signal.h> 118#include <asm-generic/signal-defs.h>
119 119
120#ifdef __KERNEL__ 120#ifdef __KERNEL__
121struct old_sigaction { 121struct old_sigaction {
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index f3861b09ebb0..c9af0d19c7ab 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -122,8 +122,10 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lp)
122#define __raw_write_can_lock(x) ((x)->lock == 0) 122#define __raw_write_can_lock(x) ((x)->lock == 0)
123 123
124extern void _raw_read_lock_wait(raw_rwlock_t *lp); 124extern void _raw_read_lock_wait(raw_rwlock_t *lp);
125extern void _raw_read_lock_wait_flags(raw_rwlock_t *lp, unsigned long flags);
125extern int _raw_read_trylock_retry(raw_rwlock_t *lp); 126extern int _raw_read_trylock_retry(raw_rwlock_t *lp);
126extern void _raw_write_lock_wait(raw_rwlock_t *lp); 127extern void _raw_write_lock_wait(raw_rwlock_t *lp);
128extern void _raw_write_lock_wait_flags(raw_rwlock_t *lp, unsigned long flags);
127extern int _raw_write_trylock_retry(raw_rwlock_t *lp); 129extern int _raw_write_trylock_retry(raw_rwlock_t *lp);
128 130
129static inline void __raw_read_lock(raw_rwlock_t *rw) 131static inline void __raw_read_lock(raw_rwlock_t *rw)
@@ -134,6 +136,14 @@ static inline void __raw_read_lock(raw_rwlock_t *rw)
134 _raw_read_lock_wait(rw); 136 _raw_read_lock_wait(rw);
135} 137}
136 138
139static inline void __raw_read_lock_flags(raw_rwlock_t *rw, unsigned long flags)
140{
141 unsigned int old;
142 old = rw->lock & 0x7fffffffU;
143 if (_raw_compare_and_swap(&rw->lock, old, old + 1) != old)
144 _raw_read_lock_wait_flags(rw, flags);
145}
146
137static inline void __raw_read_unlock(raw_rwlock_t *rw) 147static inline void __raw_read_unlock(raw_rwlock_t *rw)
138{ 148{
139 unsigned int old, cmp; 149 unsigned int old, cmp;
@@ -151,6 +161,12 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
151 _raw_write_lock_wait(rw); 161 _raw_write_lock_wait(rw);
152} 162}
153 163
164static inline void __raw_write_lock_flags(raw_rwlock_t *rw, unsigned long flags)
165{
166 if (unlikely(_raw_compare_and_swap(&rw->lock, 0, 0x80000000) != 0))
167 _raw_write_lock_wait_flags(rw, flags);
168}
169
154static inline void __raw_write_unlock(raw_rwlock_t *rw) 170static inline void __raw_write_unlock(raw_rwlock_t *rw)
155{ 171{
156 _raw_compare_and_swap(&rw->lock, 0x80000000, 0); 172 _raw_compare_and_swap(&rw->lock, 0x80000000, 0);
@@ -172,9 +188,6 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
172 return _raw_write_trylock_retry(rw); 188 return _raw_write_trylock_retry(rw);
173} 189}
174 190
175#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
176#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
177
178#define _raw_read_relax(lock) cpu_relax() 191#define _raw_read_relax(lock) cpu_relax()
179#define _raw_write_relax(lock) cpu_relax() 192#define _raw_write_relax(lock) cpu_relax()
180 193
diff --git a/arch/s390/include/asm/suspend.h b/arch/s390/include/asm/suspend.h
deleted file mode 100644
index 1f34580e67a7..000000000000
--- a/arch/s390/include/asm/suspend.h
+++ /dev/null
@@ -1,5 +0,0 @@
1#ifndef __ASM_S390_SUSPEND_H
2#define __ASM_S390_SUSPEND_H
3
4#endif
5
diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h
index 2429b87eb28d..e0a73d3eb837 100644
--- a/arch/s390/include/asm/syscall.h
+++ b/arch/s390/include/asm/syscall.h
@@ -12,6 +12,7 @@
12#ifndef _ASM_SYSCALL_H 12#ifndef _ASM_SYSCALL_H
13#define _ASM_SYSCALL_H 1 13#define _ASM_SYSCALL_H 1
14 14
15#include <linux/sched.h>
15#include <asm/ptrace.h> 16#include <asm/ptrace.h>
16 17
17static inline long syscall_get_nr(struct task_struct *task, 18static inline long syscall_get_nr(struct task_struct *task,
diff --git a/arch/s390/include/asm/termios.h b/arch/s390/include/asm/termios.h
index 67f66278f533..bc3a35cefc96 100644
--- a/arch/s390/include/asm/termios.h
+++ b/arch/s390/include/asm/termios.h
@@ -60,7 +60,7 @@ struct termio {
60#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) 60#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
61#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) 61#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
62 62
63#include <asm-generic/termios.h> 63#include <asm-generic/termios-base.h>
64 64
65#endif /* __KERNEL__ */ 65#endif /* __KERNEL__ */
66 66
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index 461f2abd2e6f..925bcc649035 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -83,14 +83,16 @@ static inline struct thread_info *current_thread_info(void)
83/* 83/*
84 * thread information flags bit numbers 84 * thread information flags bit numbers
85 */ 85 */
86#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
87#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ 86#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
88#define TIF_SIGPENDING 2 /* signal pending */ 87#define TIF_SIGPENDING 2 /* signal pending */
89#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 88#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
90#define TIF_RESTART_SVC 4 /* restart svc with new svc number */ 89#define TIF_RESTART_SVC 4 /* restart svc with new svc number */
91#define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */
92#define TIF_SINGLE_STEP 6 /* deliver sigtrap on return to user */ 90#define TIF_SINGLE_STEP 6 /* deliver sigtrap on return to user */
93#define TIF_MCCK_PENDING 7 /* machine check handling is pending */ 91#define TIF_MCCK_PENDING 7 /* machine check handling is pending */
92#define TIF_SYSCALL_TRACE 8 /* syscall trace active */
93#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */
94#define TIF_SECCOMP 10 /* secure computing */
95#define TIF_SYSCALL_FTRACE 11 /* ftrace syscall instrumentation */
94#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 96#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
95#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling 97#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
96 TIF_NEED_RESCHED */ 98 TIF_NEED_RESCHED */
@@ -99,15 +101,17 @@ static inline struct thread_info *current_thread_info(void)
99#define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */ 101#define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
100#define TIF_FREEZE 21 /* thread is freezing for suspend */ 102#define TIF_FREEZE 21 /* thread is freezing for suspend */
101 103
102#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
103#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 104#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
104#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 105#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
105#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 106#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
106#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 107#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
107#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC) 108#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC)
108#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
109#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP) 109#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
110#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING) 110#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
111#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
112#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
113#define _TIF_SECCOMP (1<<TIF_SECCOMP)
114#define _TIF_SYSCALL_FTRACE (1<<TIF_SYSCALL_FTRACE)
111#define _TIF_USEDFPU (1<<TIF_USEDFPU) 115#define _TIF_USEDFPU (1<<TIF_USEDFPU)
112#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 116#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
113#define _TIF_31BIT (1<<TIF_31BIT) 117#define _TIF_31BIT (1<<TIF_31BIT)
diff --git a/arch/s390/include/asm/types.h b/arch/s390/include/asm/types.h
index 3dc3fc228812..04d6b95a89c6 100644
--- a/arch/s390/include/asm/types.h
+++ b/arch/s390/include/asm/types.h
@@ -28,12 +28,6 @@ typedef __signed__ long saddr_t;
28 */ 28 */
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#ifndef __s390x__
32#define BITS_PER_LONG 32
33#else
34#define BITS_PER_LONG 64
35#endif
36
37#ifndef __ASSEMBLY__ 31#ifndef __ASSEMBLY__
38 32
39typedef u64 dma64_addr_t; 33typedef u64 dma64_addr_t;
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 0235970278f0..8377e91533d2 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -131,7 +131,7 @@ static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
131 131
132#define put_user(x, ptr) \ 132#define put_user(x, ptr) \
133({ \ 133({ \
134 might_sleep(); \ 134 might_fault(); \
135 __put_user(x, ptr); \ 135 __put_user(x, ptr); \
136}) 136})
137 137
@@ -180,7 +180,7 @@ extern int __put_user_bad(void) __attribute__((noreturn));
180 180
181#define get_user(x, ptr) \ 181#define get_user(x, ptr) \
182({ \ 182({ \
183 might_sleep(); \ 183 might_fault(); \
184 __get_user(x, ptr); \ 184 __get_user(x, ptr); \
185}) 185})
186 186
@@ -231,7 +231,7 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
231static inline unsigned long __must_check 231static inline unsigned long __must_check
232copy_to_user(void __user *to, const void *from, unsigned long n) 232copy_to_user(void __user *to, const void *from, unsigned long n)
233{ 233{
234 might_sleep(); 234 might_fault();
235 if (access_ok(VERIFY_WRITE, to, n)) 235 if (access_ok(VERIFY_WRITE, to, n))
236 n = __copy_to_user(to, from, n); 236 n = __copy_to_user(to, from, n);
237 return n; 237 return n;
@@ -282,7 +282,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
282static inline unsigned long __must_check 282static inline unsigned long __must_check
283copy_from_user(void *to, const void __user *from, unsigned long n) 283copy_from_user(void *to, const void __user *from, unsigned long n)
284{ 284{
285 might_sleep(); 285 might_fault();
286 if (access_ok(VERIFY_READ, from, n)) 286 if (access_ok(VERIFY_READ, from, n))
287 n = __copy_from_user(to, from, n); 287 n = __copy_from_user(to, from, n);
288 else 288 else
@@ -299,7 +299,7 @@ __copy_in_user(void __user *to, const void __user *from, unsigned long n)
299static inline unsigned long __must_check 299static inline unsigned long __must_check
300copy_in_user(void __user *to, const void __user *from, unsigned long n) 300copy_in_user(void __user *to, const void __user *from, unsigned long n)
301{ 301{
302 might_sleep(); 302 might_fault();
303 if (__access_ok(from,n) && __access_ok(to,n)) 303 if (__access_ok(from,n) && __access_ok(to,n))
304 n = __copy_in_user(to, from, n); 304 n = __copy_in_user(to, from, n);
305 return n; 305 return n;
@@ -312,7 +312,7 @@ static inline long __must_check
312strncpy_from_user(char *dst, const char __user *src, long count) 312strncpy_from_user(char *dst, const char __user *src, long count)
313{ 313{
314 long res = -EFAULT; 314 long res = -EFAULT;
315 might_sleep(); 315 might_fault();
316 if (access_ok(VERIFY_READ, src, 1)) 316 if (access_ok(VERIFY_READ, src, 1))
317 res = uaccess.strncpy_from_user(count, src, dst); 317 res = uaccess.strncpy_from_user(count, src, dst);
318 return res; 318 return res;
@@ -321,7 +321,7 @@ strncpy_from_user(char *dst, const char __user *src, long count)
321static inline unsigned long 321static inline unsigned long
322strnlen_user(const char __user * src, unsigned long n) 322strnlen_user(const char __user * src, unsigned long n)
323{ 323{
324 might_sleep(); 324 might_fault();
325 return uaccess.strnlen_user(n, src); 325 return uaccess.strnlen_user(n, src);
326} 326}
327 327
@@ -354,7 +354,7 @@ __clear_user(void __user *to, unsigned long n)
354static inline unsigned long __must_check 354static inline unsigned long __must_check
355clear_user(void __user *to, unsigned long n) 355clear_user(void __user *to, unsigned long n)
356{ 356{
357 might_sleep(); 357 might_fault();
358 if (access_ok(VERIFY_WRITE, to, n)) 358 if (access_ok(VERIFY_WRITE, to, n))
359 n = uaccess.clear_user(n, to); 359 n = uaccess.clear_user(n, to);
360 return n; 360 return n;
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
index f0f19e6ace6c..c80602d7c880 100644
--- a/arch/s390/include/asm/unistd.h
+++ b/arch/s390/include/asm/unistd.h
@@ -267,7 +267,9 @@
267#define __NR_epoll_create1 327 267#define __NR_epoll_create1 327
268#define __NR_preadv 328 268#define __NR_preadv 328
269#define __NR_pwritev 329 269#define __NR_pwritev 329
270#define NR_syscalls 330 270#define __NR_rt_tgsigqueueinfo 330
271#define __NR_perf_counter_open 331
272#define NR_syscalls 332
271 273
272/* 274/*
273 * There are some system calls that are not present on 64 bit, some 275 * There are some system calls that are not present on 64 bit, some
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 228e3105ded7..c75ed43b1a18 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -3,8 +3,9 @@
3# 3#
4 4
5ifdef CONFIG_FUNCTION_TRACER 5ifdef CONFIG_FUNCTION_TRACER
6# Do not trace early boot code 6# Don't trace early setup code and tracing code
7CFLAGS_REMOVE_early.o = -pg 7CFLAGS_REMOVE_early.o = -pg
8CFLAGS_REMOVE_ftrace.o = -pg
8endif 9endif
9 10
10# 11#
@@ -22,7 +23,7 @@ CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w
22obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ 23obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \
23 processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ 24 processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
24 s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ 25 s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \
25 vdso.o vtime.o sysinfo.o nmi.o 26 vdso.o vtime.o sysinfo.o nmi.o sclp.o
26 27
27obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) 28obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o)
28obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) 29obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)
@@ -41,6 +42,8 @@ obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \
41obj-$(CONFIG_STACKTRACE) += stacktrace.o 42obj-$(CONFIG_STACKTRACE) += stacktrace.o
42obj-$(CONFIG_KPROBES) += kprobes.o 43obj-$(CONFIG_KPROBES) += kprobes.o
43obj-$(CONFIG_FUNCTION_TRACER) += mcount.o 44obj-$(CONFIG_FUNCTION_TRACER) += mcount.o
45obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
46obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
44 47
45# Kexec part 48# Kexec part
46S390_KEXEC_OBJS := machine_kexec.o crash.o 49S390_KEXEC_OBJS := machine_kexec.o crash.o
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index fb38af6316bb..88a83366819f 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1823,3 +1823,20 @@ compat_sys_pwritev_wrapper:
1823 llgfr %r5,%r5 # u32 1823 llgfr %r5,%r5 # u32
1824 llgfr %r6,%r6 # u32 1824 llgfr %r6,%r6 # u32
1825 jg compat_sys_pwritev # branch to system call 1825 jg compat_sys_pwritev # branch to system call
1826
1827 .globl compat_sys_rt_tgsigqueueinfo_wrapper
1828compat_sys_rt_tgsigqueueinfo_wrapper:
1829 lgfr %r2,%r2 # compat_pid_t
1830 lgfr %r3,%r3 # compat_pid_t
1831 lgfr %r4,%r4 # int
1832 llgtr %r5,%r5 # struct compat_siginfo *
1833 jg compat_sys_rt_tgsigqueueinfo_wrapper # branch to system call
1834
1835 .globl sys_perf_counter_open_wrapper
1836sys_perf_counter_open_wrapper:
1837 llgtr %r2,%r2 # const struct perf_counter_attr *
1838 lgfr %r3,%r3 # pid_t
1839 lgfr %r4,%r4 # int
1840 lgfr %r5,%r5 # int
1841 llgfr %r6,%r6 # unsigned long
1842 jg sys_perf_counter_open # branch to system call
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index cf09948faad6..fb263736826c 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -11,6 +11,7 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/ctype.h> 13#include <linux/ctype.h>
14#include <linux/ftrace.h>
14#include <linux/lockdep.h> 15#include <linux/lockdep.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/pfn.h> 17#include <linux/pfn.h>
@@ -410,5 +411,8 @@ void __init startup_init(void)
410 sclp_facilities_detect(); 411 sclp_facilities_detect();
411 detect_memory_layout(memory_chunk); 412 detect_memory_layout(memory_chunk);
412 S390_lowcore.machine_flags = machine_flags; 413 S390_lowcore.machine_flags = machine_flags;
414#ifdef CONFIG_DYNAMIC_FTRACE
415 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller;
416#endif
413 lockdep_on(); 417 lockdep_on();
414} 418}
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index f3e275934213..c4c80a22bc1f 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -53,6 +53,8 @@ _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
53 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) 53 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
54_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ 54_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
55 _TIF_MCCK_PENDING) 55 _TIF_MCCK_PENDING)
56_TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \
57 _TIF_SECCOMP>>8 | _TIF_SYSCALL_FTRACE>>8)
56 58
57STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER 59STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER
58STACK_SIZE = 1 << STACK_SHIFT 60STACK_SIZE = 1 << STACK_SHIFT
@@ -265,7 +267,7 @@ sysc_do_restart:
265 sth %r7,SP_SVCNR(%r15) 267 sth %r7,SP_SVCNR(%r15)
266 sll %r7,2 # svc number *4 268 sll %r7,2 # svc number *4
267 l %r8,BASED(.Lsysc_table) 269 l %r8,BASED(.Lsysc_table)
268 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 270 tm __TI_flags+2(%r9),_TIF_SYSCALL
269 l %r8,0(%r7,%r8) # get system call addr. 271 l %r8,0(%r7,%r8) # get system call addr.
270 bnz BASED(sysc_tracesys) 272 bnz BASED(sysc_tracesys)
271 basr %r14,%r8 # call sys_xxxx 273 basr %r14,%r8 # call sys_xxxx
@@ -405,7 +407,7 @@ sysc_tracego:
405 basr %r14,%r8 # call sys_xxx 407 basr %r14,%r8 # call sys_xxx
406 st %r2,SP_R2(%r15) # store return value 408 st %r2,SP_R2(%r15) # store return value
407sysc_tracenogo: 409sysc_tracenogo:
408 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 410 tm __TI_flags+2(%r9),_TIF_SYSCALL
409 bz BASED(sysc_return) 411 bz BASED(sysc_return)
410 l %r1,BASED(.Ltrace_exit) 412 l %r1,BASED(.Ltrace_exit)
411 la %r2,SP_PTREGS(%r15) # load pt_regs 413 la %r2,SP_PTREGS(%r15) # load pt_regs
@@ -1107,6 +1109,7 @@ cleanup_io_leave_insn:
1107 1109
1108 .section .rodata, "a" 1110 .section .rodata, "a"
1109#define SYSCALL(esa,esame,emu) .long esa 1111#define SYSCALL(esa,esame,emu) .long esa
1112 .globl sys_call_table
1110sys_call_table: 1113sys_call_table:
1111#include "syscalls.S" 1114#include "syscalls.S"
1112#undef SYSCALL 1115#undef SYSCALL
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 84a105838e03..f6618e9e15ef 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -56,6 +56,8 @@ _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
56 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) 56 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
57_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ 57_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
58 _TIF_MCCK_PENDING) 58 _TIF_MCCK_PENDING)
59_TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \
60 _TIF_SECCOMP>>8 | _TIF_SYSCALL_FTRACE>>8)
59 61
60#define BASED(name) name-system_call(%r13) 62#define BASED(name) name-system_call(%r13)
61 63
@@ -260,7 +262,7 @@ sysc_do_restart:
260 larl %r10,sys_call_table_emu # use 31 bit emulation system calls 262 larl %r10,sys_call_table_emu # use 31 bit emulation system calls
261sysc_noemu: 263sysc_noemu:
262#endif 264#endif
263 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 265 tm __TI_flags+6(%r9),_TIF_SYSCALL
264 lgf %r8,0(%r7,%r10) # load address of system call routine 266 lgf %r8,0(%r7,%r10) # load address of system call routine
265 jnz sysc_tracesys 267 jnz sysc_tracesys
266 basr %r14,%r8 # call sys_xxxx 268 basr %r14,%r8 # call sys_xxxx
@@ -391,7 +393,7 @@ sysc_tracego:
391 basr %r14,%r8 # call sys_xxx 393 basr %r14,%r8 # call sys_xxx
392 stg %r2,SP_R2(%r15) # store return value 394 stg %r2,SP_R2(%r15) # store return value
393sysc_tracenogo: 395sysc_tracenogo:
394 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 396 tm __TI_flags+6(%r9),_TIF_SYSCALL
395 jz sysc_return 397 jz sysc_return
396 la %r2,SP_PTREGS(%r15) # load pt_regs 398 la %r2,SP_PTREGS(%r15) # load pt_regs
397 larl %r14,sysc_return # return point is sysc_return 399 larl %r14,sysc_return # return point is sysc_return
@@ -1058,6 +1060,7 @@ cleanup_io_leave_insn:
1058 1060
1059 .section .rodata, "a" 1061 .section .rodata, "a"
1060#define SYSCALL(esa,esame,emu) .long esame 1062#define SYSCALL(esa,esame,emu) .long esame
1063 .globl sys_call_table
1061sys_call_table: 1064sys_call_table:
1062#include "syscalls.S" 1065#include "syscalls.S"
1063#undef SYSCALL 1066#undef SYSCALL
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
new file mode 100644
index 000000000000..82ddfd3a75af
--- /dev/null
+++ b/arch/s390/kernel/ftrace.c
@@ -0,0 +1,260 @@
1/*
2 * Dynamic function tracer architecture backend.
3 *
4 * Copyright IBM Corp. 2009
5 *
6 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>,
7 *
8 */
9
10#include <linux/hardirq.h>
11#include <linux/uaccess.h>
12#include <linux/ftrace.h>
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <trace/syscall.h>
16#include <asm/lowcore.h>
17
18#ifdef CONFIG_DYNAMIC_FTRACE
19
20void ftrace_disable_code(void);
21void ftrace_disable_return(void);
22void ftrace_call_code(void);
23void ftrace_nop_code(void);
24
25#define FTRACE_INSN_SIZE 4
26
27#ifdef CONFIG_64BIT
28
29asm(
30 " .align 4\n"
31 "ftrace_disable_code:\n"
32 " j 0f\n"
33 " .word 0x0024\n"
34 " lg %r1,"__stringify(__LC_FTRACE_FUNC)"\n"
35 " basr %r14,%r1\n"
36 "ftrace_disable_return:\n"
37 " lg %r14,8(15)\n"
38 " lgr %r0,%r0\n"
39 "0:\n");
40
41asm(
42 " .align 4\n"
43 "ftrace_nop_code:\n"
44 " j .+"__stringify(MCOUNT_INSN_SIZE)"\n");
45
46asm(
47 " .align 4\n"
48 "ftrace_call_code:\n"
49 " stg %r14,8(%r15)\n");
50
51#else /* CONFIG_64BIT */
52
53asm(
54 " .align 4\n"
55 "ftrace_disable_code:\n"
56 " j 0f\n"
57 " l %r1,"__stringify(__LC_FTRACE_FUNC)"\n"
58 " basr %r14,%r1\n"
59 "ftrace_disable_return:\n"
60 " l %r14,4(%r15)\n"
61 " j 0f\n"
62 " bcr 0,%r7\n"
63 " bcr 0,%r7\n"
64 " bcr 0,%r7\n"
65 " bcr 0,%r7\n"
66 " bcr 0,%r7\n"
67 " bcr 0,%r7\n"
68 "0:\n");
69
70asm(
71 " .align 4\n"
72 "ftrace_nop_code:\n"
73 " j .+"__stringify(MCOUNT_INSN_SIZE)"\n");
74
75asm(
76 " .align 4\n"
77 "ftrace_call_code:\n"
78 " st %r14,4(%r15)\n");
79
80#endif /* CONFIG_64BIT */
81
82static int ftrace_modify_code(unsigned long ip,
83 void *old_code, int old_size,
84 void *new_code, int new_size)
85{
86 unsigned char replaced[MCOUNT_INSN_SIZE];
87
88 /*
89 * Note: Due to modules code can disappear and change.
90 * We need to protect against faulting as well as code
91 * changing. We do this by using the probe_kernel_*
92 * functions.
93 * This however is just a simple sanity check.
94 */
95 if (probe_kernel_read(replaced, (void *)ip, old_size))
96 return -EFAULT;
97 if (memcmp(replaced, old_code, old_size) != 0)
98 return -EINVAL;
99 if (probe_kernel_write((void *)ip, new_code, new_size))
100 return -EPERM;
101 return 0;
102}
103
104static int ftrace_make_initial_nop(struct module *mod, struct dyn_ftrace *rec,
105 unsigned long addr)
106{
107 return ftrace_modify_code(rec->ip,
108 ftrace_call_code, FTRACE_INSN_SIZE,
109 ftrace_disable_code, MCOUNT_INSN_SIZE);
110}
111
112int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
113 unsigned long addr)
114{
115 if (addr == MCOUNT_ADDR)
116 return ftrace_make_initial_nop(mod, rec, addr);
117 return ftrace_modify_code(rec->ip,
118 ftrace_call_code, FTRACE_INSN_SIZE,
119 ftrace_nop_code, FTRACE_INSN_SIZE);
120}
121
122int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
123{
124 return ftrace_modify_code(rec->ip,
125 ftrace_nop_code, FTRACE_INSN_SIZE,
126 ftrace_call_code, FTRACE_INSN_SIZE);
127}
128
129int ftrace_update_ftrace_func(ftrace_func_t func)
130{
131 ftrace_dyn_func = (unsigned long)func;
132 return 0;
133}
134
135int __init ftrace_dyn_arch_init(void *data)
136{
137 *(unsigned long *)data = 0;
138 return 0;
139}
140
141#endif /* CONFIG_DYNAMIC_FTRACE */
142
143#ifdef CONFIG_FUNCTION_GRAPH_TRACER
144#ifdef CONFIG_DYNAMIC_FTRACE
145/*
146 * Patch the kernel code at ftrace_graph_caller location:
147 * The instruction there is branch relative on condition. The condition mask
148 * is either all ones (always branch aka disable ftrace_graph_caller) or all
149 * zeroes (nop aka enable ftrace_graph_caller).
150 * Instruction format for brc is a7m4xxxx where m is the condition mask.
151 */
152int ftrace_enable_ftrace_graph_caller(void)
153{
154 unsigned short opcode = 0xa704;
155
156 return probe_kernel_write(ftrace_graph_caller, &opcode, sizeof(opcode));
157}
158
159int ftrace_disable_ftrace_graph_caller(void)
160{
161 unsigned short opcode = 0xa7f4;
162
163 return probe_kernel_write(ftrace_graph_caller, &opcode, sizeof(opcode));
164}
165
166static inline unsigned long ftrace_mcount_call_adjust(unsigned long addr)
167{
168 return addr - (ftrace_disable_return - ftrace_disable_code);
169}
170
171#else /* CONFIG_DYNAMIC_FTRACE */
172
173static inline unsigned long ftrace_mcount_call_adjust(unsigned long addr)
174{
175 return addr - MCOUNT_OFFSET_RET;
176}
177
178#endif /* CONFIG_DYNAMIC_FTRACE */
179
180/*
181 * Hook the return address and push it in the stack of return addresses
182 * in current thread info.
183 */
184unsigned long prepare_ftrace_return(unsigned long ip, unsigned long parent)
185{
186 struct ftrace_graph_ent trace;
187
188 /* Nmi's are currently unsupported. */
189 if (unlikely(in_nmi()))
190 goto out;
191 if (unlikely(atomic_read(&current->tracing_graph_pause)))
192 goto out;
193 if (ftrace_push_return_trace(parent, ip, &trace.depth) == -EBUSY)
194 goto out;
195 trace.func = ftrace_mcount_call_adjust(ip) & PSW_ADDR_INSN;
196 /* Only trace if the calling function expects to. */
197 if (!ftrace_graph_entry(&trace)) {
198 current->curr_ret_stack--;
199 goto out;
200 }
201 parent = (unsigned long)return_to_handler;
202out:
203 return parent;
204}
205#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
206
207#ifdef CONFIG_FTRACE_SYSCALLS
208
209extern unsigned long __start_syscalls_metadata[];
210extern unsigned long __stop_syscalls_metadata[];
211extern unsigned int sys_call_table[];
212
213static struct syscall_metadata **syscalls_metadata;
214
215struct syscall_metadata *syscall_nr_to_meta(int nr)
216{
217 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
218 return NULL;
219
220 return syscalls_metadata[nr];
221}
222
223static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
224{
225 struct syscall_metadata *start;
226 struct syscall_metadata *stop;
227 char str[KSYM_SYMBOL_LEN];
228
229 start = (struct syscall_metadata *)__start_syscalls_metadata;
230 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
231 kallsyms_lookup(syscall, NULL, NULL, NULL, str);
232
233 for ( ; start < stop; start++) {
234 if (start->name && !strcmp(start->name + 3, str + 3))
235 return start;
236 }
237 return NULL;
238}
239
240void arch_init_ftrace_syscalls(void)
241{
242 struct syscall_metadata *meta;
243 int i;
244 static atomic_t refs;
245
246 if (atomic_inc_return(&refs) != 1)
247 goto out;
248 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * NR_syscalls,
249 GFP_KERNEL);
250 if (!syscalls_metadata)
251 goto out;
252 for (i = 0; i < NR_syscalls; i++) {
253 meta = find_syscall_meta((unsigned long)sys_call_table[i]);
254 syscalls_metadata[i] = meta;
255 }
256 return;
257out:
258 atomic_dec(&refs);
259}
260#endif
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 22596d70fc2e..ec6882348520 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -1,7 +1,5 @@
1/* 1/*
2 * arch/s390/kernel/head.S 2 * Copyright IBM Corp. 1999,2009
3 *
4 * Copyright (C) IBM Corp. 1999,2006
5 * 3 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com> 4 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com> 5 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -64,7 +62,7 @@ __HEAD
64 .org 0x100 62 .org 0x100
65# 63#
66# subroutine for loading from tape 64# subroutine for loading from tape
67# Paramters: 65# Parameters:
68# R1 = device number 66# R1 = device number
69# R2 = load address 67# R2 = load address
70.Lloader: 68.Lloader:
@@ -479,27 +477,58 @@ startup:basr %r13,0 # get base
479 mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13) 477 mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13)
480 mvc __LC_EXIT_TIMER(8),5f-.LPG0(%r13) 478 mvc __LC_EXIT_TIMER(8),5f-.LPG0(%r13)
481#ifndef CONFIG_MARCH_G5 479#ifndef CONFIG_MARCH_G5
482 # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10} 480 # check capabilities against MARCH_{G5,Z900,Z990,Z9_109,Z10}
483 stidp __LC_CPUID # store cpuid 481 xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST
484 lhi %r0,(3f-2f) / 2 482 stfl __LC_STFL_FAC_LIST # store facility list
485 la %r1,2f-.LPG0(%r13) 483 tm __LC_STFL_FAC_LIST,0x01 # stfle available ?
4860: clc __LC_CPUID+4(2),0(%r1) 484 jz 0f
487 jne 3f 485 la %r0,0
488 lpsw 1f-.LPG0(13) # machine type not good enough, crash 486 .insn s,0xb2b00000,__LC_STFL_FAC_LIST # store facility list extended
4870: l %r0,__LC_STFL_FAC_LIST
488 n %r0,2f+8-.LPG0(%r13)
489 cl %r0,2f+8-.LPG0(%r13)
490 jne 1f
491 l %r0,__LC_STFL_FAC_LIST+4
492 n %r0,2f+12-.LPG0(%r13)
493 cl %r0,2f+12-.LPG0(%r13)
494 je 3f
4951: l %r15,.Lstack-.LPG0(%r13)
496 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union+THREAD_SIZE
497 ahi %r15,-96
498 la %r2,.Lals_string-.LPG0(%r13)
499 l %r3,.Lsclp_print-.LPG0(%r13)
500 basr %r14,%r3
501 lpsw 2f-.LPG0(%r13) # machine type not good enough, crash
502.Lals_string:
503 .asciz "The Linux kernel requires more recent processor hardware"
504.Lsclp_print:
505 .long _sclp_print_early
506.Lstack:
507 .long init_thread_union
489 .align 16 508 .align 16
4901: .long 0x000a0000,0x00000000 5092: .long 0x000a0000,0x8badcccc
4912: 510#if defined(CONFIG_64BIT)
492#if defined(CONFIG_MARCH_Z10) 511#if defined(CONFIG_MARCH_Z10)
493 .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086, 0x2094, 0x2096 512 .long 0xc100efe3, 0xf0680000
494#elif defined(CONFIG_MARCH_Z9_109) 513#elif defined(CONFIG_MARCH_Z9_109)
495 .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086 514 .long 0xc100efc3, 0x00000000
496#elif defined(CONFIG_MARCH_Z990) 515#elif defined(CONFIG_MARCH_Z990)
497 .short 0x9672, 0x2064, 0x2066 516 .long 0xc0002000, 0x00000000
498#elif defined(CONFIG_MARCH_Z900) 517#elif defined(CONFIG_MARCH_Z900)
499 .short 0x9672 518 .long 0xc0000000, 0x00000000
519#endif
520#else
521#if defined(CONFIG_MARCH_Z10)
522 .long 0x8100c880, 0x00000000
523#elif defined(CONFIG_MARCH_Z9_109)
524 .long 0x8100c880, 0x00000000
525#elif defined(CONFIG_MARCH_Z990)
526 .long 0x80002000, 0x00000000
527#elif defined(CONFIG_MARCH_Z900)
528 .long 0x80000000, 0x00000000
529#endif
500#endif 530#endif
5013: la %r1,2(%r1) 5313:
502 brct %r0,0b
503#endif 532#endif
504 533
505 l %r13,4f-.LPG0(%r13) 534 l %r13,4f-.LPG0(%r13)
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index a01cf0284db2..9bb2f6241d9f 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -25,9 +25,9 @@
25#include <linux/preempt.h> 25#include <linux/preempt.h>
26#include <linux/stop_machine.h> 26#include <linux/stop_machine.h>
27#include <linux/kdebug.h> 27#include <linux/kdebug.h>
28#include <linux/uaccess.h>
28#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
29#include <asm/sections.h> 30#include <asm/sections.h>
30#include <asm/uaccess.h>
31#include <linux/module.h> 31#include <linux/module.h>
32 32
33DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 33DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
@@ -155,35 +155,8 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
155static int __kprobes swap_instruction(void *aref) 155static int __kprobes swap_instruction(void *aref)
156{ 156{
157 struct ins_replace_args *args = aref; 157 struct ins_replace_args *args = aref;
158 u32 *addr;
159 u32 instr;
160 int err = -EFAULT;
161 158
162 /* 159 return probe_kernel_write(args->ptr, &args->new, sizeof(args->new));
163 * Text segment is read-only, hence we use stura to bypass dynamic
164 * address translation to exchange the instruction. Since stura
165 * always operates on four bytes, but we only want to exchange two
166 * bytes do some calculations to get things right. In addition we
167 * shall not cross any page boundaries (vmalloc area!) when writing
168 * the new instruction.
169 */
170 addr = (u32 *)((unsigned long)args->ptr & -4UL);
171 if ((unsigned long)args->ptr & 2)
172 instr = ((*addr) & 0xffff0000) | args->new;
173 else
174 instr = ((*addr) & 0x0000ffff) | args->new << 16;
175
176 asm volatile(
177 " lra %1,0(%1)\n"
178 "0: stura %2,%1\n"
179 "1: la %0,0\n"
180 "2:\n"
181 EX_TABLE(0b,2b)
182 : "+d" (err)
183 : "a" (addr), "d" (instr)
184 : "memory", "cc");
185
186 return err;
187} 160}
188 161
189void __kprobes arch_arm_kprobe(struct kprobe *p) 162void __kprobes arch_arm_kprobe(struct kprobe *p)
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index 80641224a095..2a0a5e97ba8c 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright IBM Corp. 2008 2 * Copyright IBM Corp. 2008,2009
3 * 3 *
4 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>, 4 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>,
5 * 5 *
@@ -7,36 +7,64 @@
7 7
8#include <asm/asm-offsets.h> 8#include <asm/asm-offsets.h>
9 9
10#ifndef CONFIG_64BIT 10 .globl ftrace_stub
11.globl _mcount 11ftrace_stub:
12 br %r14
13
14#ifdef CONFIG_64BIT
15
16#ifdef CONFIG_DYNAMIC_FTRACE
17
18 .globl _mcount
12_mcount: 19_mcount:
13 stm %r0,%r5,8(%r15)
14 st %r14,56(%r15)
15 lr %r1,%r15
16 ahi %r15,-96
17 l %r3,100(%r15)
18 la %r2,0(%r14)
19 st %r1,__SF_BACKCHAIN(%r15)
20 la %r3,0(%r3)
21 bras %r14,0f
22 .long ftrace_trace_function
230: l %r14,0(%r14)
24 l %r14,0(%r14)
25 basr %r14,%r14
26 ahi %r15,96
27 lm %r0,%r5,8(%r15)
28 l %r14,56(%r15)
29 br %r14 20 br %r14
30 21
31.globl ftrace_stub 22 .globl ftrace_caller
32ftrace_stub: 23ftrace_caller:
24 larl %r1,function_trace_stop
25 icm %r1,0xf,0(%r1)
26 bnzr %r14
27 stmg %r2,%r5,32(%r15)
28 stg %r14,112(%r15)
29 lgr %r1,%r15
30 aghi %r15,-160
31 stg %r1,__SF_BACKCHAIN(%r15)
32 lgr %r2,%r14
33 lg %r3,168(%r15)
34 larl %r14,ftrace_dyn_func
35 lg %r14,0(%r14)
36 basr %r14,%r14
37#ifdef CONFIG_FUNCTION_GRAPH_TRACER
38 .globl ftrace_graph_caller
39ftrace_graph_caller:
40 # This unconditional branch gets runtime patched. Change only if
41 # you know what you are doing. See ftrace_enable_graph_caller().
42 j 0f
43 lg %r2,272(%r15)
44 lg %r3,168(%r15)
45 brasl %r14,prepare_ftrace_return
46 stg %r2,168(%r15)
470:
48#endif
49 aghi %r15,160
50 lmg %r2,%r5,32(%r15)
51 lg %r14,112(%r15)
33 br %r14 52 br %r14
34 53
35#else /* CONFIG_64BIT */ 54 .data
55 .globl ftrace_dyn_func
56ftrace_dyn_func:
57 .quad ftrace_stub
58 .previous
59
60#else /* CONFIG_DYNAMIC_FTRACE */
36 61
37.globl _mcount 62 .globl _mcount
38_mcount: 63_mcount:
39 stmg %r0,%r5,16(%r15) 64 larl %r1,function_trace_stop
65 icm %r1,0xf,0(%r1)
66 bnzr %r14
67 stmg %r2,%r5,32(%r15)
40 stg %r14,112(%r15) 68 stg %r14,112(%r15)
41 lgr %r1,%r15 69 lgr %r1,%r15
42 aghi %r15,-160 70 aghi %r15,-160
@@ -46,13 +74,143 @@ _mcount:
46 larl %r14,ftrace_trace_function 74 larl %r14,ftrace_trace_function
47 lg %r14,0(%r14) 75 lg %r14,0(%r14)
48 basr %r14,%r14 76 basr %r14,%r14
77#ifdef CONFIG_FUNCTION_GRAPH_TRACER
78 lg %r2,272(%r15)
79 lg %r3,168(%r15)
80 brasl %r14,prepare_ftrace_return
81 stg %r2,168(%r15)
82#endif
49 aghi %r15,160 83 aghi %r15,160
50 lmg %r0,%r5,16(%r15) 84 lmg %r2,%r5,32(%r15)
51 lg %r14,112(%r15) 85 lg %r14,112(%r15)
52 br %r14 86 br %r14
53 87
54.globl ftrace_stub 88#endif /* CONFIG_DYNAMIC_FTRACE */
55ftrace_stub: 89
90#ifdef CONFIG_FUNCTION_GRAPH_TRACER
91
92 .globl return_to_handler
93return_to_handler:
94 stmg %r2,%r5,32(%r15)
95 lgr %r1,%r15
96 aghi %r15,-160
97 stg %r1,__SF_BACKCHAIN(%r15)
98 brasl %r14,ftrace_return_to_handler
99 aghi %r15,160
100 lgr %r14,%r2
101 lmg %r2,%r5,32(%r15)
102 br %r14
103
104#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
105
106#else /* CONFIG_64BIT */
107
108#ifdef CONFIG_DYNAMIC_FTRACE
109
110 .globl _mcount
111_mcount:
112 br %r14
113
114 .globl ftrace_caller
115ftrace_caller:
116 stm %r2,%r5,16(%r15)
117 bras %r1,2f
1180: .long ftrace_trace_function
1191: .long function_trace_stop
1202: l %r2,1b-0b(%r1)
121 icm %r2,0xf,0(%r2)
122 jnz 3f
123 st %r14,56(%r15)
124 lr %r0,%r15
125 ahi %r15,-96
126 l %r3,100(%r15)
127 la %r2,0(%r14)
128 st %r0,__SF_BACKCHAIN(%r15)
129 la %r3,0(%r3)
130 l %r14,0b-0b(%r1)
131 l %r14,0(%r14)
132 basr %r14,%r14
133#ifdef CONFIG_FUNCTION_GRAPH_TRACER
134 .globl ftrace_graph_caller
135ftrace_graph_caller:
136 # This unconditional branch gets runtime patched. Change only if
137 # you know what you are doing. See ftrace_enable_graph_caller().
138 j 1f
139 bras %r1,0f
140 .long prepare_ftrace_return
1410: l %r2,152(%r15)
142 l %r4,0(%r1)
143 l %r3,100(%r15)
144 basr %r14,%r4
145 st %r2,100(%r15)
1461:
147#endif
148 ahi %r15,96
149 l %r14,56(%r15)
1503: lm %r2,%r5,16(%r15)
56 br %r14 151 br %r14
57 152
153 .data
154 .globl ftrace_dyn_func
155ftrace_dyn_func:
156 .long ftrace_stub
157 .previous
158
159#else /* CONFIG_DYNAMIC_FTRACE */
160
161 .globl _mcount
162_mcount:
163 stm %r2,%r5,16(%r15)
164 bras %r1,2f
1650: .long ftrace_trace_function
1661: .long function_trace_stop
1672: l %r2,1b-0b(%r1)
168 icm %r2,0xf,0(%r2)
169 jnz 3f
170 st %r14,56(%r15)
171 lr %r0,%r15
172 ahi %r15,-96
173 l %r3,100(%r15)
174 la %r2,0(%r14)
175 st %r0,__SF_BACKCHAIN(%r15)
176 la %r3,0(%r3)
177 l %r14,0b-0b(%r1)
178 l %r14,0(%r14)
179 basr %r14,%r14
180#ifdef CONFIG_FUNCTION_GRAPH_TRACER
181 bras %r1,0f
182 .long prepare_ftrace_return
1830: l %r2,152(%r15)
184 l %r4,0(%r1)
185 l %r3,100(%r15)
186 basr %r14,%r4
187 st %r2,100(%r15)
188#endif
189 ahi %r15,96
190 l %r14,56(%r15)
1913: lm %r2,%r5,16(%r15)
192 br %r14
193
194#endif /* CONFIG_DYNAMIC_FTRACE */
195
196#ifdef CONFIG_FUNCTION_GRAPH_TRACER
197
198 .globl return_to_handler
199return_to_handler:
200 stm %r2,%r5,16(%r15)
201 st %r14,56(%r15)
202 lr %r0,%r15
203 ahi %r15,-96
204 st %r0,__SF_BACKCHAIN(%r15)
205 bras %r1,0f
206 .long ftrace_return_to_handler
2070: l %r2,0b-0b(%r1)
208 basr %r14,%r2
209 lr %r14,%r2
210 ahi %r15,96
211 lm %r2,%r5,16(%r15)
212 br %r14
213
214#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
215
58#endif /* CONFIG_64BIT */ 216#endif /* CONFIG_64BIT */
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index eed4a00cb676..ab2e3ed28abc 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -56,8 +56,6 @@ void *module_alloc(unsigned long size)
56void module_free(struct module *mod, void *module_region) 56void module_free(struct module *mod, void *module_region)
57{ 57{
58 vfree(module_region); 58 vfree(module_region);
59 /* FIXME: If module_region == mod->init_region, trim exception
60 table entries. */
61} 59}
62 60
63static void 61static void
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
index 28cf196ba775..015e27da40eb 100644
--- a/arch/s390/kernel/nmi.c
+++ b/arch/s390/kernel/nmi.c
@@ -16,7 +16,7 @@
16#include <asm/lowcore.h> 16#include <asm/lowcore.h>
17#include <asm/smp.h> 17#include <asm/smp.h>
18#include <asm/etr.h> 18#include <asm/etr.h>
19#include <asm/cpu.h> 19#include <asm/cputime.h>
20#include <asm/nmi.h> 20#include <asm/nmi.h>
21#include <asm/crw.h> 21#include <asm/crw.h>
22 22
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index a3acd8e60aff..355f7a30c3f1 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -32,6 +32,7 @@
32#include <linux/elfcore.h> 32#include <linux/elfcore.h>
33#include <linux/kernel_stat.h> 33#include <linux/kernel_stat.h>
34#include <linux/syscalls.h> 34#include <linux/syscalls.h>
35#include <asm/compat.h>
35#include <asm/uaccess.h> 36#include <asm/uaccess.h>
36#include <asm/pgtable.h> 37#include <asm/pgtable.h>
37#include <asm/system.h> 38#include <asm/system.h>
@@ -204,7 +205,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
204 save_fp_regs(&p->thread.fp_regs); 205 save_fp_regs(&p->thread.fp_regs);
205 /* Set a new TLS ? */ 206 /* Set a new TLS ? */
206 if (clone_flags & CLONE_SETTLS) { 207 if (clone_flags & CLONE_SETTLS) {
207 if (test_thread_flag(TIF_31BIT)) { 208 if (is_compat_task()) {
208 p->thread.acrs[0] = (unsigned int) regs->gprs[6]; 209 p->thread.acrs[0] = (unsigned int) regs->gprs[6];
209 } else { 210 } else {
210 p->thread.acrs[0] = (unsigned int)(regs->gprs[6] >> 32); 211 p->thread.acrs[0] = (unsigned int)(regs->gprs[6] >> 32);
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 75c496f4f16d..490b39934d65 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -36,7 +36,9 @@
36#include <linux/elf.h> 36#include <linux/elf.h>
37#include <linux/regset.h> 37#include <linux/regset.h>
38#include <linux/tracehook.h> 38#include <linux/tracehook.h>
39 39#include <linux/seccomp.h>
40#include <trace/syscall.h>
41#include <asm/compat.h>
40#include <asm/segment.h> 42#include <asm/segment.h>
41#include <asm/page.h> 43#include <asm/page.h>
42#include <asm/pgtable.h> 44#include <asm/pgtable.h>
@@ -69,7 +71,7 @@ FixPerRegisters(struct task_struct *task)
69 if (per_info->single_step) { 71 if (per_info->single_step) {
70 per_info->control_regs.bits.starting_addr = 0; 72 per_info->control_regs.bits.starting_addr = 0;
71#ifdef CONFIG_COMPAT 73#ifdef CONFIG_COMPAT
72 if (test_thread_flag(TIF_31BIT)) 74 if (is_compat_task())
73 per_info->control_regs.bits.ending_addr = 0x7fffffffUL; 75 per_info->control_regs.bits.ending_addr = 0x7fffffffUL;
74 else 76 else
75#endif 77#endif
@@ -482,8 +484,7 @@ static int peek_user_compat(struct task_struct *child,
482{ 484{
483 __u32 tmp; 485 __u32 tmp;
484 486
485 if (!test_thread_flag(TIF_31BIT) || 487 if (!is_compat_task() || (addr & 3) || addr > sizeof(struct user) - 3)
486 (addr & 3) || addr > sizeof(struct user) - 3)
487 return -EIO; 488 return -EIO;
488 489
489 tmp = __peek_user_compat(child, addr); 490 tmp = __peek_user_compat(child, addr);
@@ -584,8 +585,7 @@ static int __poke_user_compat(struct task_struct *child,
584static int poke_user_compat(struct task_struct *child, 585static int poke_user_compat(struct task_struct *child,
585 addr_t addr, addr_t data) 586 addr_t addr, addr_t data)
586{ 587{
587 if (!test_thread_flag(TIF_31BIT) || 588 if (!is_compat_task() || (addr & 3) || addr > sizeof(struct user32) - 3)
588 (addr & 3) || addr > sizeof(struct user32) - 3)
589 return -EIO; 589 return -EIO;
590 590
591 return __poke_user_compat(child, addr, data); 591 return __poke_user_compat(child, addr, data);
@@ -642,6 +642,9 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
642{ 642{
643 long ret; 643 long ret;
644 644
645 /* Do the secure computing check first. */
646 secure_computing(regs->gprs[2]);
647
645 /* 648 /*
646 * The sysc_tracesys code in entry.S stored the system 649 * The sysc_tracesys code in entry.S stored the system
647 * call number to gprs[2]. 650 * call number to gprs[2].
@@ -659,8 +662,11 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
659 ret = -1; 662 ret = -1;
660 } 663 }
661 664
665 if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE)))
666 ftrace_syscall_enter(regs);
667
662 if (unlikely(current->audit_context)) 668 if (unlikely(current->audit_context))
663 audit_syscall_entry(test_thread_flag(TIF_31BIT) ? 669 audit_syscall_entry(is_compat_task() ?
664 AUDIT_ARCH_S390 : AUDIT_ARCH_S390X, 670 AUDIT_ARCH_S390 : AUDIT_ARCH_S390X,
665 regs->gprs[2], regs->orig_gpr2, 671 regs->gprs[2], regs->orig_gpr2,
666 regs->gprs[3], regs->gprs[4], 672 regs->gprs[3], regs->gprs[4],
@@ -674,6 +680,9 @@ asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
674 audit_syscall_exit(AUDITSC_RESULT(regs->gprs[2]), 680 audit_syscall_exit(AUDITSC_RESULT(regs->gprs[2]),
675 regs->gprs[2]); 681 regs->gprs[2]);
676 682
683 if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE)))
684 ftrace_syscall_exit(regs);
685
677 if (test_thread_flag(TIF_SYSCALL_TRACE)) 686 if (test_thread_flag(TIF_SYSCALL_TRACE))
678 tracehook_report_syscall_exit(regs, 0); 687 tracehook_report_syscall_exit(regs, 0);
679} 688}
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index a0d2d55d7fb3..0de305b598ce 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -10,10 +10,11 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/ftrace.h>
13#include <linux/errno.h> 14#include <linux/errno.h>
14#include <linux/kernel_stat.h> 15#include <linux/kernel_stat.h>
15#include <linux/interrupt.h> 16#include <linux/interrupt.h>
16#include <asm/cpu.h> 17#include <asm/cputime.h>
17#include <asm/lowcore.h> 18#include <asm/lowcore.h>
18#include <asm/s390_ext.h> 19#include <asm/s390_ext.h>
19#include <asm/irq_regs.h> 20#include <asm/irq_regs.h>
@@ -112,7 +113,7 @@ int unregister_early_external_interrupt(__u16 code, ext_int_handler_t handler,
112 return 0; 113 return 0;
113} 114}
114 115
115void do_extint(struct pt_regs *regs, unsigned short code) 116void __irq_entry do_extint(struct pt_regs *regs, unsigned short code)
116{ 117{
117 ext_int_info_t *p; 118 ext_int_info_t *p;
118 int index; 119 int index;
diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S
new file mode 100644
index 000000000000..20639dfe0c42
--- /dev/null
+++ b/arch/s390/kernel/sclp.S
@@ -0,0 +1,327 @@
1/*
2 * Mini SCLP driver.
3 *
4 * Copyright IBM Corp. 2004,2009
5 *
6 * Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>,
7 * Heiko Carstens <heiko.carstens@de.ibm.com>,
8 *
9 */
10
11LC_EXT_NEW_PSW = 0x58 # addr of ext int handler
12LC_EXT_INT_PARAM = 0x80 # addr of ext int parameter
13LC_EXT_INT_CODE = 0x86 # addr of ext int code
14
15#
16# Subroutine which waits synchronously until either an external interruption
17# or a timeout occurs.
18#
19# Parameters:
20# R2 = 0 for no timeout, non-zero for timeout in (approximated) seconds
21#
22# Returns:
23# R2 = 0 on interrupt, 2 on timeout
24# R3 = external interruption parameter if R2=0
25#
26
27.section ".init.text","ax"
28
29_sclp_wait_int:
30 stm %r6,%r15,24(%r15) # save registers
31 basr %r13,0 # get base register
32.LbaseS1:
33 ahi %r15,-96 # create stack frame
34 la %r8,LC_EXT_NEW_PSW # register int handler
35 mvc .LoldpswS1-.LbaseS1(8,%r13),0(%r8)
36 mvc 0(8,%r8),.LextpswS1-.LbaseS1(%r13)
37 lhi %r6,0x0200 # cr mask for ext int (cr0.54)
38 ltr %r2,%r2
39 jz .LsetctS1
40 ahi %r6,0x0800 # cr mask for clock int (cr0.52)
41 stck .LtimeS1-.LbaseS1(%r13) # initiate timeout
42 al %r2,.LtimeS1-.LbaseS1(%r13)
43 st %r2,.LtimeS1-.LbaseS1(%r13)
44 sckc .LtimeS1-.LbaseS1(%r13)
45
46.LsetctS1:
47 stctl %c0,%c0,.LctlS1-.LbaseS1(%r13) # enable required interrupts
48 l %r0,.LctlS1-.LbaseS1(%r13)
49 lhi %r1,~(0x200 | 0x800) # clear old values
50 nr %r1,%r0
51 or %r1,%r6 # set new value
52 st %r1,.LctlS1-.LbaseS1(%r13)
53 lctl %c0,%c0,.LctlS1-.LbaseS1(%r13)
54 st %r0,.LctlS1-.LbaseS1(%r13)
55 lhi %r2,2 # return code for timeout
56.LloopS1:
57 lpsw .LwaitpswS1-.LbaseS1(%r13) # wait until interrupt
58.LwaitS1:
59 lh %r7,LC_EXT_INT_CODE
60 chi %r7,0x1004 # timeout?
61 je .LtimeoutS1
62 chi %r7,0x2401 # service int?
63 jne .LloopS1
64 sr %r2,%r2
65 l %r3,LC_EXT_INT_PARAM
66.LtimeoutS1:
67 lctl %c0,%c0,.LctlS1-.LbaseS1(%r13) # restore interrupt setting
68 # restore old handler
69 mvc 0(8,%r8),.LoldpswS1-.LbaseS1(%r13)
70 lm %r6,%r15,120(%r15) # restore registers
71 br %r14 # return to caller
72
73 .align 8
74.LoldpswS1:
75 .long 0, 0 # old ext int PSW
76.LextpswS1:
77 .long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int
78.LwaitpswS1:
79 .long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int
80.LtimeS1:
81 .quad 0 # current time
82.LctlS1:
83 .long 0 # CT0 contents
84
85#
86# Subroutine to synchronously issue a service call.
87#
88# Parameters:
89# R2 = command word
90# R3 = sccb address
91#
92# Returns:
93# R2 = 0 on success, 1 on failure
94# R3 = sccb response code if R2 = 0
95#
96
97_sclp_servc:
98 stm %r6,%r15,24(%r15) # save registers
99 ahi %r15,-96 # create stack frame
100 lr %r6,%r2 # save command word
101 lr %r7,%r3 # save sccb address
102.LretryS2:
103 lhi %r2,1 # error return code
104 .insn rre,0xb2200000,%r6,%r7 # servc
105 brc 1,.LendS2 # exit if not operational
106 brc 8,.LnotbusyS2 # go on if not busy
107 sr %r2,%r2 # wait until no longer busy
108 bras %r14,_sclp_wait_int
109 j .LretryS2 # retry
110.LnotbusyS2:
111 sr %r2,%r2 # wait until result
112 bras %r14,_sclp_wait_int
113 sr %r2,%r2
114 lh %r3,6(%r7)
115.LendS2:
116 lm %r6,%r15,120(%r15) # restore registers
117 br %r14
118
119#
120# Subroutine to set up the SCLP interface.
121#
122# Parameters:
123# R2 = 0 to activate, non-zero to deactivate
124#
125# Returns:
126# R2 = 0 on success, non-zero on failure
127#
128
129_sclp_setup:
130 stm %r6,%r15,24(%r15) # save registers
131 ahi %r15,-96 # create stack frame
132 basr %r13,0 # get base register
133.LbaseS3:
134 l %r6,.LsccbS0-.LbaseS3(%r13) # prepare init mask sccb
135 mvc 0(.LinitendS3-.LinitsccbS3,%r6),.LinitsccbS3-.LbaseS3(%r13)
136 ltr %r2,%r2 # initialization?
137 jz .LdoinitS3 # go ahead
138 # clear masks
139 xc .LinitmaskS3-.LinitsccbS3(8,%r6),.LinitmaskS3-.LinitsccbS3(%r6)
140.LdoinitS3:
141 l %r2,.LwritemaskS3-.LbaseS3(%r13)# get command word
142 lr %r3,%r6 # get sccb address
143 bras %r14,_sclp_servc # issue service call
144 ltr %r2,%r2 # servc successful?
145 jnz .LerrorS3
146 chi %r3,0x20 # write mask successful?
147 jne .LerrorS3
148 # check masks
149 la %r2,.LinitmaskS3-.LinitsccbS3(%r6)
150 l %r1,0(%r2) # receive mask ok?
151 n %r1,12(%r2)
152 cl %r1,0(%r2)
153 jne .LerrorS3
154 l %r1,4(%r2) # send mask ok?
155 n %r1,8(%r2)
156 cl %r1,4(%r2)
157 sr %r2,%r2
158 je .LendS3
159.LerrorS3:
160 lhi %r2,1 # error return code
161.LendS3:
162 lm %r6,%r15,120(%r15) # restore registers
163 br %r14
164.LwritemaskS3:
165 .long 0x00780005 # SCLP command for write mask
166.LinitsccbS3:
167 .word .LinitendS3-.LinitsccbS3
168 .byte 0,0,0,0
169 .word 0
170 .word 0
171 .word 4
172.LinitmaskS3:
173 .long 0x80000000
174 .long 0x40000000
175 .long 0
176 .long 0
177.LinitendS3:
178
179#
180# Subroutine which prints a given text to the SCLP console.
181#
182# Parameters:
183# R2 = address of nil-terminated ASCII text
184#
185# Returns:
186# R2 = 0 on success, 1 on failure
187#
188
189_sclp_print:
190 stm %r6,%r15,24(%r15) # save registers
191 ahi %r15,-96 # create stack frame
192 basr %r13,0 # get base register
193.LbaseS4:
194 l %r8,.LsccbS0-.LbaseS4(%r13) # prepare write data sccb
195 mvc 0(.LmtoS4-.LwritesccbS4,%r8),.LwritesccbS4-.LbaseS4(%r13)
196 la %r7,.LmtoS4-.LwritesccbS4(%r8) # current mto addr
197 sr %r0,%r0
198 l %r10,.Lascebc-.LbaseS4(%r13) # address of translation table
199.LinitmtoS4:
200 # initialize mto
201 mvc 0(.LmtoendS4-.LmtoS4,%r7),.LmtoS4-.LbaseS4(%r13)
202 lhi %r6,.LmtoendS4-.LmtoS4 # current mto length
203.LloopS4:
204 ic %r0,0(%r2) # get character
205 ahi %r2,1
206 ltr %r0,%r0 # end of string?
207 jz .LfinalizemtoS4
208 chi %r0,0x15 # end of line (NL)?
209 jz .LfinalizemtoS4
210 stc %r0,0(%r6,%r7) # copy to mto
211 la %r11,0(%r6,%r7)
212 tr 0(1,%r11),0(%r10) # translate to EBCDIC
213 ahi %r6,1
214 j .LloopS4
215.LfinalizemtoS4:
216 sth %r6,0(%r7) # update mto length
217 lh %r9,.LmdbS4-.LwritesccbS4(%r8) # update mdb length
218 ar %r9,%r6
219 sth %r9,.LmdbS4-.LwritesccbS4(%r8)
220 lh %r9,.LevbufS4-.LwritesccbS4(%r8)# update evbuf length
221 ar %r9,%r6
222 sth %r9,.LevbufS4-.LwritesccbS4(%r8)
223 lh %r9,0(%r8) # update sccb length
224 ar %r9,%r6
225 sth %r9,0(%r8)
226 ar %r7,%r6 # update current mto adress
227 ltr %r0,%r0 # more characters?
228 jnz .LinitmtoS4
229 l %r2,.LwritedataS4-.LbaseS4(%r13)# write data
230 lr %r3,%r8
231 bras %r14,_sclp_servc
232 ltr %r2,%r2 # servc successful?
233 jnz .LendS4
234 chi %r3,0x20 # write data successful?
235 je .LendS4
236 lhi %r2,1 # error return code
237.LendS4:
238 lm %r6,%r15,120(%r15) # restore registers
239 br %r14
240
241#
242# Function which prints a given text to the SCLP console.
243#
244# Parameters:
245# R2 = address of nil-terminated ASCII text
246#
247# Returns:
248# R2 = 0 on success, 1 on failure
249#
250
251 .globl _sclp_print_early
252_sclp_print_early:
253 stm %r6,%r15,24(%r15) # save registers
254 ahi %r15,-96 # create stack frame
255 lr %r10,%r2 # save string pointer
256 lhi %r2,0
257 bras %r14,_sclp_setup # enable console
258 ltr %r2,%r2
259 jnz .LendS5
260 lr %r2,%r10
261 bras %r14,_sclp_print # print string
262 ltr %r2,%r2
263 jnz .LendS5
264 lhi %r2,1
265 bras %r14,_sclp_setup # disable console
266.LendS5:
267 lm %r6,%r15,120(%r15) # restore registers
268 br %r14
269
270.LwritedataS4:
271 .long 0x00760005 # SCLP command for write data
272.LwritesccbS4:
273 # sccb
274 .word .LmtoS4-.LwritesccbS4
275 .byte 0
276 .byte 0,0,0
277 .word 0
278
279 # evbuf
280.LevbufS4:
281 .word .LmtoS4-.LevbufS4
282 .byte 0x02
283 .byte 0
284 .word 0
285
286.LmdbS4:
287 # mdb
288 .word .LmtoS4-.LmdbS4
289 .word 1
290 .long 0xd4c4c240
291 .long 1
292
293 # go
294.LgoS4:
295 .word .LmtoS4-.LgoS4
296 .word 1
297 .long 0
298 .byte 0,0,0,0,0,0,0,0
299 .byte 0,0,0
300 .byte 0
301 .byte 0,0,0,0,0,0,0
302 .byte 0
303 .word 0
304 .byte 0,0,0,0,0,0,0,0,0,0
305 .byte 0,0,0,0,0,0,0,0
306 .byte 0,0,0,0,0,0,0,0
307
308.LmtoS4:
309 .word .LmtoendS4-.LmtoS4
310 .word 4
311 .word 0x1000
312 .byte 0
313 .byte 0,0,0
314.LmtoendS4:
315
316 # Global constants
317.LsccbS0:
318 .long _sclp_work_area
319.Lascebc:
320 .long _ascebc
321.previous
322
323.section ".init.data","a"
324 .balign 4096
325_sclp_work_area:
326 .fill 4096
327.previous
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 7402b6a39ead..9717717c6fea 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -42,6 +42,7 @@
42#include <linux/ctype.h> 42#include <linux/ctype.h>
43#include <linux/reboot.h> 43#include <linux/reboot.h>
44#include <linux/topology.h> 44#include <linux/topology.h>
45#include <linux/ftrace.h>
45 46
46#include <asm/ipl.h> 47#include <asm/ipl.h>
47#include <asm/uaccess.h> 48#include <asm/uaccess.h>
@@ -442,6 +443,7 @@ setup_lowcore(void)
442 lc->steal_timer = S390_lowcore.steal_timer; 443 lc->steal_timer = S390_lowcore.steal_timer;
443 lc->last_update_timer = S390_lowcore.last_update_timer; 444 lc->last_update_timer = S390_lowcore.last_update_timer;
444 lc->last_update_clock = S390_lowcore.last_update_clock; 445 lc->last_update_clock = S390_lowcore.last_update_clock;
446 lc->ftrace_func = S390_lowcore.ftrace_func;
445 set_prefix((u32)(unsigned long) lc); 447 set_prefix((u32)(unsigned long) lc);
446 lowcore_ptr[0] = lc; 448 lowcore_ptr[0] = lc;
447} 449}
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 3cf74c3ccb69..062bd64e65fa 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -26,6 +26,7 @@
26#include <linux/binfmts.h> 26#include <linux/binfmts.h>
27#include <linux/tracehook.h> 27#include <linux/tracehook.h>
28#include <linux/syscalls.h> 28#include <linux/syscalls.h>
29#include <linux/compat.h>
29#include <asm/ucontext.h> 30#include <asm/ucontext.h>
30#include <asm/uaccess.h> 31#include <asm/uaccess.h>
31#include <asm/lowcore.h> 32#include <asm/lowcore.h>
@@ -482,7 +483,7 @@ void do_signal(struct pt_regs *regs)
482 /* Whee! Actually deliver the signal. */ 483 /* Whee! Actually deliver the signal. */
483 int ret; 484 int ret;
484#ifdef CONFIG_COMPAT 485#ifdef CONFIG_COMPAT
485 if (test_thread_flag(TIF_31BIT)) { 486 if (is_compat_task()) {
486 ret = handle_signal32(signr, &ka, &info, oldset, regs); 487 ret = handle_signal32(signr, &ka, &info, oldset, regs);
487 } 488 }
488 else 489 else
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index a985a3ba4401..cc8c484984e3 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -47,7 +47,7 @@
47#include <asm/timer.h> 47#include <asm/timer.h>
48#include <asm/lowcore.h> 48#include <asm/lowcore.h>
49#include <asm/sclp.h> 49#include <asm/sclp.h>
50#include <asm/cpu.h> 50#include <asm/cputime.h>
51#include <asm/vdso.h> 51#include <asm/vdso.h>
52#include "entry.h" 52#include "entry.h"
53 53
@@ -572,6 +572,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
572 cpu_lowcore->cpu_nr = cpu; 572 cpu_lowcore->cpu_nr = cpu;
573 cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; 573 cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce;
574 cpu_lowcore->machine_flags = S390_lowcore.machine_flags; 574 cpu_lowcore->machine_flags = S390_lowcore.machine_flags;
575 cpu_lowcore->ftrace_func = S390_lowcore.ftrace_func;
575 eieio(); 576 eieio();
576 577
577 while (signal_processor(cpu, sigp_restart) == sigp_busy) 578 while (signal_processor(cpu, sigp_restart) == sigp_busy)
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 2c7739fe70b1..ad1acd200385 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -338,3 +338,5 @@ SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper)
338SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper) 338SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper)
339SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper) 339SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper)
340SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) 340SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper)
341SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */
342SYSCALL(sys_perf_counter_open,sys_perf_counter_open,sys_perf_counter_open_wrapper)
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index ef596d020573..215330a2c128 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -70,7 +70,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);
70/* 70/*
71 * Scheduler clock - returns current time in nanosec units. 71 * Scheduler clock - returns current time in nanosec units.
72 */ 72 */
73unsigned long long sched_clock(void) 73unsigned long long notrace sched_clock(void)
74{ 74{
75 return ((get_clock_xt() - sched_clock_base_cc) * 125) >> 9; 75 return ((get_clock_xt() - sched_clock_base_cc) * 125) >> 9;
76} 76}
@@ -95,12 +95,6 @@ void tod_to_timeval(__u64 todval, struct timespec *xtime)
95 xtime->tv_nsec = ((todval * 1000) >> 12); 95 xtime->tv_nsec = ((todval * 1000) >> 12);
96} 96}
97 97
98#ifdef CONFIG_PROFILING
99#define s390_do_profile() profile_tick(CPU_PROFILING)
100#else
101#define s390_do_profile() do { ; } while(0)
102#endif /* CONFIG_PROFILING */
103
104void clock_comparator_work(void) 98void clock_comparator_work(void)
105{ 99{
106 struct clock_event_device *cd; 100 struct clock_event_device *cd;
@@ -109,7 +103,6 @@ void clock_comparator_work(void)
109 set_clock_comparator(S390_lowcore.clock_comparator); 103 set_clock_comparator(S390_lowcore.clock_comparator);
110 cd = &__get_cpu_var(comparators); 104 cd = &__get_cpu_var(comparators);
111 cd->event_handler(cd); 105 cd->event_handler(cd);
112 s390_do_profile();
113} 106}
114 107
115/* 108/*
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 89b2e7f1b7a9..45e1708b70fd 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -22,7 +22,7 @@
22#include <linux/elf.h> 22#include <linux/elf.h>
23#include <linux/security.h> 23#include <linux/security.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25 25#include <linux/compat.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/system.h> 27#include <asm/system.h>
28#include <asm/processor.h> 28#include <asm/processor.h>
@@ -53,8 +53,19 @@ unsigned int __read_mostly vdso_enabled = 1;
53 53
54static int __init vdso_setup(char *s) 54static int __init vdso_setup(char *s)
55{ 55{
56 vdso_enabled = simple_strtoul(s, NULL, 0); 56 unsigned long val;
57 return 1; 57 int rc;
58
59 rc = 0;
60 if (strncmp(s, "on", 3) == 0)
61 vdso_enabled = 1;
62 else if (strncmp(s, "off", 4) == 0)
63 vdso_enabled = 0;
64 else {
65 rc = strict_strtoul(s, 0, &val);
66 vdso_enabled = rc ? 0 : !!val;
67 }
68 return !rc;
58} 69}
59__setup("vdso=", vdso_setup); 70__setup("vdso=", vdso_setup);
60 71
@@ -203,7 +214,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
203 vdso_pagelist = vdso64_pagelist; 214 vdso_pagelist = vdso64_pagelist;
204 vdso_pages = vdso64_pages; 215 vdso_pages = vdso64_pages;
205#ifdef CONFIG_COMPAT 216#ifdef CONFIG_COMPAT
206 if (test_thread_flag(TIF_31BIT)) { 217 if (is_compat_task()) {
207 vdso_pagelist = vdso32_pagelist; 218 vdso_pagelist = vdso32_pagelist;
208 vdso_pages = vdso32_pages; 219 vdso_pages = vdso32_pages;
209 } 220 }
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 89399b8756c2..a53db23ee092 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -34,6 +34,7 @@ SECTIONS
34 SCHED_TEXT 34 SCHED_TEXT
35 LOCK_TEXT 35 LOCK_TEXT
36 KPROBES_TEXT 36 KPROBES_TEXT
37 IRQENTRY_TEXT
37 *(.fixup) 38 *(.fixup)
38 *(.gnu.warning) 39 *(.gnu.warning)
39 } :text = 0x0700 40 } :text = 0x0700
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index c87f59bd8246..c8eb7255332b 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -23,7 +23,7 @@
23#include <asm/s390_ext.h> 23#include <asm/s390_ext.h>
24#include <asm/timer.h> 24#include <asm/timer.h>
25#include <asm/irq_regs.h> 25#include <asm/irq_regs.h>
26#include <asm/cpu.h> 26#include <asm/cputime.h>
27 27
28static ext_int_info_t ext_int_info_timer; 28static ext_int_info_t ext_int_info_timer;
29 29
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 10bccd1f8aee..c18b21d6991c 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -512,7 +512,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
512 BUG(); 512 BUG();
513 } 513 }
514 514
515 might_sleep(); 515 might_fault();
516 516
517 do { 517 do {
518 __vcpu_run(vcpu); 518 __vcpu_run(vcpu);
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index e41f4008afc5..f7e0d30250b7 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -124,6 +124,27 @@ void _raw_read_lock_wait(raw_rwlock_t *rw)
124} 124}
125EXPORT_SYMBOL(_raw_read_lock_wait); 125EXPORT_SYMBOL(_raw_read_lock_wait);
126 126
127void _raw_read_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags)
128{
129 unsigned int old;
130 int count = spin_retry;
131
132 local_irq_restore(flags);
133 while (1) {
134 if (count-- <= 0) {
135 _raw_yield();
136 count = spin_retry;
137 }
138 if (!__raw_read_can_lock(rw))
139 continue;
140 old = rw->lock & 0x7fffffffU;
141 local_irq_disable();
142 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
143 return;
144 }
145}
146EXPORT_SYMBOL(_raw_read_lock_wait_flags);
147
127int _raw_read_trylock_retry(raw_rwlock_t *rw) 148int _raw_read_trylock_retry(raw_rwlock_t *rw)
128{ 149{
129 unsigned int old; 150 unsigned int old;
@@ -157,6 +178,25 @@ void _raw_write_lock_wait(raw_rwlock_t *rw)
157} 178}
158EXPORT_SYMBOL(_raw_write_lock_wait); 179EXPORT_SYMBOL(_raw_write_lock_wait);
159 180
181void _raw_write_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags)
182{
183 int count = spin_retry;
184
185 local_irq_restore(flags);
186 while (1) {
187 if (count-- <= 0) {
188 _raw_yield();
189 count = spin_retry;
190 }
191 if (!__raw_write_can_lock(rw))
192 continue;
193 local_irq_disable();
194 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
195 return;
196 }
197}
198EXPORT_SYMBOL(_raw_write_lock_wait_flags);
199
160int _raw_write_trylock_retry(raw_rwlock_t *rw) 200int _raw_write_trylock_retry(raw_rwlock_t *rw)
161{ 201{
162 int count = spin_retry; 202 int count = spin_retry;
diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile
index 2a7458134544..db05661ac895 100644
--- a/arch/s390/mm/Makefile
+++ b/arch/s390/mm/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux s390-specific parts of the memory manager. 2# Makefile for the linux s390-specific parts of the memory manager.
3# 3#
4 4
5obj-y := init.o fault.o extmem.o mmap.o vmem.o pgtable.o 5obj-y := init.o fault.o extmem.o mmap.o vmem.o pgtable.o maccess.o
6obj-$(CONFIG_CMM) += cmm.o 6obj-$(CONFIG_CMM) += cmm.o
7obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 7obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
8obj-$(CONFIG_PAGE_STATES) += page-states.o 8obj-$(CONFIG_PAGE_STATES) += page-states.o
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 833e8366c351..220a152c836c 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -19,6 +19,7 @@
19#include <linux/ptrace.h> 19#include <linux/ptrace.h>
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/compat.h>
22#include <linux/smp.h> 23#include <linux/smp.h>
23#include <linux/kdebug.h> 24#include <linux/kdebug.h>
24#include <linux/smp_lock.h> 25#include <linux/smp_lock.h>
@@ -239,7 +240,7 @@ static int signal_return(struct mm_struct *mm, struct pt_regs *regs,
239 up_read(&mm->mmap_sem); 240 up_read(&mm->mmap_sem);
240 clear_tsk_thread_flag(current, TIF_SINGLE_STEP); 241 clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
241#ifdef CONFIG_COMPAT 242#ifdef CONFIG_COMPAT
242 compat = test_tsk_thread_flag(current, TIF_31BIT); 243 compat = is_compat_task();
243 if (compat && instruction == 0x0a77) 244 if (compat && instruction == 0x0a77)
244 sys32_sigreturn(); 245 sys32_sigreturn();
245 else if (compat && instruction == 0x0aad) 246 else if (compat && instruction == 0x0aad)
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c
new file mode 100644
index 000000000000..81756271dc44
--- /dev/null
+++ b/arch/s390/mm/maccess.c
@@ -0,0 +1,61 @@
1/*
2 * Access kernel memory without faulting -- s390 specific implementation.
3 *
4 * Copyright IBM Corp. 2009
5 *
6 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>,
7 *
8 */
9
10#include <linux/uaccess.h>
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/errno.h>
14#include <asm/system.h>
15
16/*
17 * This function writes to kernel memory bypassing DAT and possible
18 * write protection. It copies one to four bytes from src to dst
19 * using the stura instruction.
20 * Returns the number of bytes copied or -EFAULT.
21 */
22static long probe_kernel_write_odd(void *dst, void *src, size_t size)
23{
24 unsigned long count, aligned;
25 int offset, mask;
26 int rc = -EFAULT;
27
28 aligned = (unsigned long) dst & ~3UL;
29 offset = (unsigned long) dst & 3;
30 count = min_t(unsigned long, 4 - offset, size);
31 mask = (0xf << (4 - count)) & 0xf;
32 mask >>= offset;
33 asm volatile(
34 " bras 1,0f\n"
35 " icm 0,0,0(%3)\n"
36 "0: l 0,0(%1)\n"
37 " lra %1,0(%1)\n"
38 "1: ex %2,0(1)\n"
39 "2: stura 0,%1\n"
40 " la %0,0\n"
41 "3:\n"
42 EX_TABLE(0b,3b) EX_TABLE(1b,3b) EX_TABLE(2b,3b)
43 : "+d" (rc), "+a" (aligned)
44 : "a" (mask), "a" (src) : "cc", "memory", "0", "1");
45 return rc ? rc : count;
46}
47
48long probe_kernel_write(void *dst, void *src, size_t size)
49{
50 long copied = 0;
51
52 while (size) {
53 copied = probe_kernel_write_odd(dst, src, size);
54 if (copied < 0)
55 break;
56 dst += copied;
57 src += copied;
58 size -= copied;
59 }
60 return copied < 0 ? -EFAULT : 0;
61}
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index e008d236cc15..f4558ccf02b9 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -28,6 +28,7 @@
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <asm/pgalloc.h> 30#include <asm/pgalloc.h>
31#include <asm/compat.h>
31 32
32/* 33/*
33 * Top of mmap area (just below the process stack). 34 * Top of mmap area (just below the process stack).
@@ -55,7 +56,7 @@ static inline int mmap_is_legacy(void)
55 /* 56 /*
56 * Force standard allocation for 64 bit programs. 57 * Force standard allocation for 64 bit programs.
57 */ 58 */
58 if (!test_thread_flag(TIF_31BIT)) 59 if (!is_compat_task())
59 return 1; 60 return 1;
60#endif 61#endif
61 return sysctl_legacy_va_layout || 62 return sysctl_legacy_va_layout ||
@@ -91,7 +92,7 @@ EXPORT_SYMBOL_GPL(arch_pick_mmap_layout);
91 92
92int s390_mmap_check(unsigned long addr, unsigned long len) 93int s390_mmap_check(unsigned long addr, unsigned long len)
93{ 94{
94 if (!test_thread_flag(TIF_31BIT) && 95 if (!is_compat_task() &&
95 len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) 96 len >= TASK_SIZE && TASK_SIZE < (1UL << 53))
96 return crst_table_upgrade(current->mm, 1UL << 53); 97 return crst_table_upgrade(current->mm, 1UL << 53);
97 return 0; 98 return 0;
@@ -108,8 +109,7 @@ s390_get_unmapped_area(struct file *filp, unsigned long addr,
108 area = arch_get_unmapped_area(filp, addr, len, pgoff, flags); 109 area = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
109 if (!(area & ~PAGE_MASK)) 110 if (!(area & ~PAGE_MASK))
110 return area; 111 return area;
111 if (area == -ENOMEM && 112 if (area == -ENOMEM && !is_compat_task() && TASK_SIZE < (1UL << 53)) {
112 !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) {
113 /* Upgrade the page table to 4 levels and retry. */ 113 /* Upgrade the page table to 4 levels and retry. */
114 rc = crst_table_upgrade(mm, 1UL << 53); 114 rc = crst_table_upgrade(mm, 1UL << 53);
115 if (rc) 115 if (rc)
@@ -131,8 +131,7 @@ s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr,
131 area = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags); 131 area = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags);
132 if (!(area & ~PAGE_MASK)) 132 if (!(area & ~PAGE_MASK))
133 return area; 133 return area;
134 if (area == -ENOMEM && 134 if (area == -ENOMEM && !is_compat_task() && TASK_SIZE < (1UL << 53)) {
135 !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) {
136 /* Upgrade the page table to 4 levels and retry. */ 135 /* Upgrade the page table to 4 levels and retry. */
137 rc = crst_table_upgrade(mm, 1UL << 53); 136 rc = crst_table_upgrade(mm, 1UL << 53);
138 if (rc) 137 if (rc)
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index be6c1cf4ad5a..4ca8e826bf30 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -1,7 +1,5 @@
1/* 1/*
2 * arch/s390/mm/pgtable.c 2 * Copyright IBM Corp. 2007,2009
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> 3 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
6 */ 4 */
7 5
@@ -53,6 +51,18 @@ void clear_table_pgstes(unsigned long *table)
53 51
54#endif 52#endif
55 53
54unsigned long VMALLOC_START = VMALLOC_END - VMALLOC_SIZE;
55EXPORT_SYMBOL(VMALLOC_START);
56
57static int __init parse_vmalloc(char *arg)
58{
59 if (!arg)
60 return -EINVAL;
61 VMALLOC_START = (VMALLOC_END - memparse(arg, &arg)) & PAGE_MASK;
62 return 0;
63}
64early_param("vmalloc", parse_vmalloc);
65
56unsigned long *crst_table_alloc(struct mm_struct *mm, int noexec) 66unsigned long *crst_table_alloc(struct mm_struct *mm, int noexec)
57{ 67{
58 struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER); 68 struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index 978b58efb1e9..157c320272cb 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -84,5 +84,5 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
84#define smp_mb__before_atomic_inc() barrier() 84#define smp_mb__before_atomic_inc() barrier()
85#define smp_mb__after_atomic_inc() barrier() 85#define smp_mb__after_atomic_inc() barrier()
86 86
87#include <asm-generic/atomic.h> 87#include <asm-generic/atomic-long.h>
88#endif /* __ASM_SH_ATOMIC_H */ 88#endif /* __ASM_SH_ATOMIC_H */
diff --git a/arch/sh/include/asm/bitsperlong.h b/arch/sh/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/sh/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/sh/include/asm/mman.h b/arch/sh/include/asm/mman.h
index 156eb0225cf6..7d8b72c91a5f 100644
--- a/arch/sh/include/asm/mman.h
+++ b/arch/sh/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_SH_MMAN_H 1#ifndef __ASM_SH_MMAN_H
2#define __ASM_SH_MMAN_H 2#define __ASM_SH_MMAN_H
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
index 9c6d21ec0240..49592c780a6e 100644
--- a/arch/sh/include/asm/page.h
+++ b/arch/sh/include/asm/page.h
@@ -163,7 +163,7 @@ typedef struct page *pgtable_t;
163 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 163 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
164 164
165#include <asm-generic/memory_model.h> 165#include <asm-generic/memory_model.h>
166#include <asm-generic/page.h> 166#include <asm-generic/getorder.h>
167 167
168/* vDSO support */ 168/* vDSO support */
169#ifdef CONFIG_VSYSCALL 169#ifdef CONFIG_VSYSCALL
diff --git a/arch/sh/include/asm/signal.h b/arch/sh/include/asm/signal.h
index 5c5c1e852089..9cc5f0144689 100644
--- a/arch/sh/include/asm/signal.h
+++ b/arch/sh/include/asm/signal.h
@@ -106,7 +106,7 @@ typedef unsigned long sigset_t;
106#define MINSIGSTKSZ 2048 106#define MINSIGSTKSZ 2048
107#define SIGSTKSZ 8192 107#define SIGSTKSZ 8192
108 108
109#include <asm-generic/signal.h> 109#include <asm-generic/signal-defs.h>
110 110
111#ifdef __KERNEL__ 111#ifdef __KERNEL__
112struct old_sigaction { 112struct old_sigaction {
diff --git a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c
index c19b0f7d2cc1..c2efdcde266f 100644
--- a/arch/sh/kernel/module.c
+++ b/arch/sh/kernel/module.c
@@ -46,8 +46,6 @@ void *module_alloc(unsigned long size)
46void module_free(struct module *mod, void *module_region) 46void module_free(struct module *mod, void *module_region)
47{ 47{
48 vfree(module_region); 48 vfree(module_region);
49 /* FIXME: If module_region == mod->init_region, trim exception
50 table entries. */
51} 49}
52 50
53/* We don't need anything special. */ 51/* We don't need anything special. */
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h
index bb91b1248cd1..f0d343c3b956 100644
--- a/arch/sparc/include/asm/atomic_32.h
+++ b/arch/sparc/include/asm/atomic_32.h
@@ -161,5 +161,5 @@ static inline int __atomic24_sub(int i, atomic24_t *v)
161 161
162#endif /* !(__KERNEL__) */ 162#endif /* !(__KERNEL__) */
163 163
164#include <asm-generic/atomic.h> 164#include <asm-generic/atomic-long.h>
165#endif /* !(__ARCH_SPARC_ATOMIC__) */ 165#endif /* !(__ARCH_SPARC_ATOMIC__) */
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
index a0a706492696..f2e48009989e 100644
--- a/arch/sparc/include/asm/atomic_64.h
+++ b/arch/sparc/include/asm/atomic_64.h
@@ -114,5 +114,5 @@ static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
114#define smp_mb__before_atomic_inc() barrier() 114#define smp_mb__before_atomic_inc() barrier()
115#define smp_mb__after_atomic_inc() barrier() 115#define smp_mb__after_atomic_inc() barrier()
116 116
117#include <asm-generic/atomic.h> 117#include <asm-generic/atomic-long.h>
118#endif /* !(__ARCH_SPARC64_ATOMIC__) */ 118#endif /* !(__ARCH_SPARC64_ATOMIC__) */
diff --git a/arch/sparc/include/asm/bitsperlong.h b/arch/sparc/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..40dcaa3aaa56
--- /dev/null
+++ b/arch/sparc/include/asm/bitsperlong.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_ALPHA_BITSPERLONG_H
2#define __ASM_ALPHA_BITSPERLONG_H
3
4#if defined(__sparc__) && defined(__arch64__)
5#define __BITS_PER_LONG 64
6#else
7#define __BITS_PER_LONG 32
8#endif
9
10#include <asm-generic/bitsperlong.h>
11
12#endif /* __ASM_ALPHA_BITSPERLONG_H */
13
diff --git a/arch/sparc/include/asm/mman.h b/arch/sparc/include/asm/mman.h
index fdfbbf0a4736..988192e8e956 100644
--- a/arch/sparc/include/asm/mman.h
+++ b/arch/sparc/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef __SPARC_MMAN_H__ 1#ifndef __SPARC_MMAN_H__
2#define __SPARC_MMAN_H__ 2#define __SPARC_MMAN_H__
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6/* SunOS'ified... */ 6/* SunOS'ified... */
7 7
diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h
index d1806edc0958..f72080bdda94 100644
--- a/arch/sparc/include/asm/page_32.h
+++ b/arch/sparc/include/asm/page_32.h
@@ -152,6 +152,6 @@ extern unsigned long pfn_base;
152 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 152 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
153 153
154#include <asm-generic/memory_model.h> 154#include <asm-generic/memory_model.h>
155#include <asm-generic/page.h> 155#include <asm-generic/getorder.h>
156 156
157#endif /* _SPARC_PAGE_H */ 157#endif /* _SPARC_PAGE_H */
diff --git a/arch/sparc/include/asm/page_64.h b/arch/sparc/include/asm/page_64.h
index 4274ed13ddb2..f0d09b401036 100644
--- a/arch/sparc/include/asm/page_64.h
+++ b/arch/sparc/include/asm/page_64.h
@@ -132,6 +132,6 @@ typedef struct page *pgtable_t;
132#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 132#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
133 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 133 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
134 134
135#include <asm-generic/page.h> 135#include <asm-generic/getorder.h>
136 136
137#endif /* _SPARC64_PAGE_H */ 137#endif /* _SPARC64_PAGE_H */
diff --git a/arch/sparc/include/asm/signal.h b/arch/sparc/include/asm/signal.h
index cba45206b7f2..e49b828a2471 100644
--- a/arch/sparc/include/asm/signal.h
+++ b/arch/sparc/include/asm/signal.h
@@ -176,7 +176,7 @@ struct sigstack {
176#define SA_STATIC_ALLOC 0x8000 176#define SA_STATIC_ALLOC 0x8000
177#endif 177#endif
178 178
179#include <asm-generic/signal.h> 179#include <asm-generic/signal-defs.h>
180 180
181struct __new_sigaction { 181struct __new_sigaction {
182 __sighandler_t sa_handler; 182 __sighandler_t sa_handler;
diff --git a/arch/sparc/include/asm/types.h b/arch/sparc/include/asm/types.h
index 2237118825d0..de671d73baed 100644
--- a/arch/sparc/include/asm/types.h
+++ b/arch/sparc/include/asm/types.h
@@ -21,8 +21,6 @@ typedef unsigned short umode_t;
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#define BITS_PER_LONG 64
25
26#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
27 25
28/* Dma addresses come in generic and 64-bit flavours. */ 26/* Dma addresses come in generic and 64-bit flavours. */
@@ -46,8 +44,6 @@ typedef unsigned short umode_t;
46 44
47#ifdef __KERNEL__ 45#ifdef __KERNEL__
48 46
49#define BITS_PER_LONG 32
50
51#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
52 48
53typedef u32 dma_addr_t; 49typedef u32 dma_addr_t;
diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h
index 47d5619d43fa..8303ac481034 100644
--- a/arch/sparc/include/asm/uaccess_32.h
+++ b/arch/sparc/include/asm/uaccess_32.h
@@ -17,6 +17,9 @@
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
19 19
20#define ARCH_HAS_SORT_EXTABLE
21#define ARCH_HAS_SEARCH_EXTABLE
22
20/* Sparc is not segmented, however we need to be able to fool access_ok() 23/* Sparc is not segmented, however we need to be able to fool access_ok()
21 * when doing system calls from kernel mode legitimately. 24 * when doing system calls from kernel mode legitimately.
22 * 25 *
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
index c64e767a3e4b..a38c03238918 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
@@ -12,7 +12,7 @@
12#include <asm/asi.h> 12#include <asm/asi.h>
13#include <asm/system.h> 13#include <asm/system.h>
14#include <asm/spitfire.h> 14#include <asm/spitfire.h>
15#include <asm-generic/uaccess.h> 15#include <asm-generic/uaccess-unaligned.h>
16#endif 16#endif
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index 90273765e81f..0ee642f63234 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -75,8 +75,6 @@ void *module_alloc(unsigned long size)
75void module_free(struct module *mod, void *module_region) 75void module_free(struct module *mod, void *module_region)
76{ 76{
77 vfree(module_region); 77 vfree(module_region);
78 /* FIXME: If module_region == mod->init_region, trim exception
79 table entries. */
80} 78}
81 79
82/* Make generic code ignore STT_REGISTER dummy undefined symbols. */ 80/* Make generic code ignore STT_REGISTER dummy undefined symbols. */
diff --git a/arch/sparc/mm/extable.c b/arch/sparc/mm/extable.c
index 16cc28935e39..a61c349448e1 100644
--- a/arch/sparc/mm/extable.c
+++ b/arch/sparc/mm/extable.c
@@ -28,6 +28,10 @@ search_extable(const struct exception_table_entry *start,
28 * word 3: last insn address + 4 bytes 28 * word 3: last insn address + 4 bytes
29 * word 4: fixup code address 29 * word 4: fixup code address
30 * 30 *
31 * Deleted entries are encoded as:
32 * word 1: unused
33 * word 2: -1
34 *
31 * See asm/uaccess.h for more details. 35 * See asm/uaccess.h for more details.
32 */ 36 */
33 37
@@ -39,6 +43,10 @@ search_extable(const struct exception_table_entry *start,
39 continue; 43 continue;
40 } 44 }
41 45
46 /* A deleted entry; see trim_init_extable */
47 if (walk->fixup == -1)
48 continue;
49
42 if (walk->insn == value) 50 if (walk->insn == value)
43 return walk; 51 return walk;
44 } 52 }
@@ -57,6 +65,27 @@ search_extable(const struct exception_table_entry *start,
57 return NULL; 65 return NULL;
58} 66}
59 67
68#ifdef CONFIG_MODULES
69/* We could memmove them around; easier to mark the trimmed ones. */
70void trim_init_extable(struct module *m)
71{
72 unsigned int i;
73 bool range;
74
75 for (i = 0; i < m->num_exentries; i += range ? 2 : 1) {
76 range = m->extable[i].fixup == 0;
77
78 if (within_module_init(m->extable[i].insn, m)) {
79 m->extable[i].fixup = -1;
80 if (range)
81 m->extable[i+1].fixup = -1;
82 }
83 if (range)
84 i++;
85 }
86}
87#endif /* CONFIG_MODULES */
88
60/* Special extable search, which handles ranges. Returns fixup */ 89/* Special extable search, which handles ranges. Returns fixup */
61unsigned long search_extables_range(unsigned long addr, unsigned long *g2) 90unsigned long search_extables_range(unsigned long addr, unsigned long *g2)
62{ 91{
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
index 55f28a0bae6d..4cc9b6cf480a 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -116,7 +116,7 @@ extern unsigned long uml_physmem;
116#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) 116#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v)))
117 117
118#include <asm-generic/memory_model.h> 118#include <asm-generic/memory_model.h>
119#include <asm-generic/page.h> 119#include <asm-generic/getorder.h>
120 120
121#endif /* __ASSEMBLY__ */ 121#endif /* __ASSEMBLY__ */
122#endif /* __UM_PAGE_H */ 122#endif /* __UM_PAGE_H */
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index 58da2480a7f4..9ce3f165111a 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -53,16 +53,21 @@ extern unsigned long end_iomem;
53#else 53#else
54# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) 54# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
55#endif 55#endif
56#define MODULES_VADDR VMALLOC_START
57#define MODULES_END VMALLOC_END
58#define MODULES_LEN (MODULES_VADDR - MODULES_END)
56 59
57#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) 60#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
58#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) 61#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
59#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) 62#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
60 63#define __PAGE_KERNEL_EXEC \
64 (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
61#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED) 65#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
62#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED) 66#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
63#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) 67#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
64#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) 68#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
65#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED) 69#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
70#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
66 71
67/* 72/*
68 * The i386 can't do page protection for execute, and considers that the same 73 * The i386 can't do page protection for execute, and considers that the same
diff --git a/arch/um/include/asm/suspend.h b/arch/um/include/asm/suspend.h
deleted file mode 100644
index f4e8e007f468..000000000000
--- a/arch/um/include/asm/suspend.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __UM_SUSPEND_H
2#define __UM_SUSPEND_H
3
4#endif
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 598b5c1903af..1b549bca4645 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -8,7 +8,7 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
8 8
9subarch-obj-y = lib/semaphore_32.o lib/string_32.o 9subarch-obj-y = lib/semaphore_32.o lib/string_32.o
10subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o 10subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
11subarch-obj-$(CONFIG_MODULES) += kernel/module_32.o 11subarch-obj-$(CONFIG_MODULES) += kernel/module.o
12 12
13USER_OBJS := bugs.o ptrace_user.o fault.o 13USER_OBJS := bugs.o ptrace_user.o fault.o
14 14
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index c8b4cce9cfe1..2201e9c20e4a 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -8,10 +8,8 @@ obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
8 setjmp.o signal.o stub.o stub_segv.o syscalls.o syscall_table.o \ 8 setjmp.o signal.o stub.o stub_segv.o syscalls.o syscall_table.o \
9 sysrq.o ksyms.o tls.o 9 sysrq.o ksyms.o tls.o
10 10
11obj-$(CONFIG_MODULES) += um_module.o
12
13subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o 11subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
14subarch-obj-$(CONFIG_MODULES) += kernel/module_64.o 12subarch-obj-$(CONFIG_MODULES) += kernel/module.o
15 13
16ldt-y = ../sys-i386/ldt.o 14ldt-y = ../sys-i386/ldt.o
17 15
diff --git a/arch/um/sys-x86_64/um_module.c b/arch/um/sys-x86_64/um_module.c
deleted file mode 100644
index 3dead392a415..000000000000
--- a/arch/um/sys-x86_64/um_module.c
+++ /dev/null
@@ -1,21 +0,0 @@
1#include <linux/vmalloc.h>
2#include <linux/moduleloader.h>
3
4/* Copied from i386 arch/i386/kernel/module.c */
5void *module_alloc(unsigned long size)
6{
7 if (size == 0)
8 return NULL;
9 return vmalloc_exec(size);
10}
11
12/* Free memory returned from module_alloc */
13void module_free(struct module *mod, void *module_region)
14{
15 vfree(module_region);
16 /*
17 * FIXME: If module_region == mod->init_region, trim exception
18 * table entries.
19 */
20}
21
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 711b214684ef..cf42fc305419 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -790,10 +790,26 @@ config X86_MCE
790 to disable it. MCE support simply ignores non-MCE processors like 790 to disable it. MCE support simply ignores non-MCE processors like
791 the 386 and 486, so nearly everyone can say Y here. 791 the 386 and 486, so nearly everyone can say Y here.
792 792
793config X86_OLD_MCE
794 depends on X86_32 && X86_MCE
795 bool "Use legacy machine check code (will go away)"
796 default n
797 select X86_ANCIENT_MCE
798 ---help---
799 Use the old i386 machine check code. This is merely intended for
800 testing in a transition period. Try this if you run into any machine
801 check related software problems, but report the problem to
802 linux-kernel. When in doubt say no.
803
804config X86_NEW_MCE
805 depends on X86_MCE
806 bool
807 default y if (!X86_OLD_MCE && X86_32) || X86_64
808
793config X86_MCE_INTEL 809config X86_MCE_INTEL
794 def_bool y 810 def_bool y
795 prompt "Intel MCE features" 811 prompt "Intel MCE features"
796 depends on X86_64 && X86_MCE && X86_LOCAL_APIC 812 depends on X86_NEW_MCE && X86_LOCAL_APIC
797 ---help--- 813 ---help---
798 Additional support for intel specific MCE features such as 814 Additional support for intel specific MCE features such as
799 the thermal monitor. 815 the thermal monitor.
@@ -801,19 +817,36 @@ config X86_MCE_INTEL
801config X86_MCE_AMD 817config X86_MCE_AMD
802 def_bool y 818 def_bool y
803 prompt "AMD MCE features" 819 prompt "AMD MCE features"
804 depends on X86_64 && X86_MCE && X86_LOCAL_APIC 820 depends on X86_NEW_MCE && X86_LOCAL_APIC
805 ---help--- 821 ---help---
806 Additional support for AMD specific MCE features such as 822 Additional support for AMD specific MCE features such as
807 the DRAM Error Threshold. 823 the DRAM Error Threshold.
808 824
825config X86_ANCIENT_MCE
826 def_bool n
827 depends on X86_32
828 prompt "Support for old Pentium 5 / WinChip machine checks"
829 ---help---
830 Include support for machine check handling on old Pentium 5 or WinChip
831 systems. These typically need to be enabled explicitely on the command
832 line.
833
809config X86_MCE_THRESHOLD 834config X86_MCE_THRESHOLD
810 depends on X86_MCE_AMD || X86_MCE_INTEL 835 depends on X86_MCE_AMD || X86_MCE_INTEL
811 bool 836 bool
812 default y 837 default y
813 838
839config X86_MCE_INJECT
840 depends on X86_NEW_MCE
841 tristate "Machine check injector support"
842 ---help---
843 Provide support for injecting machine checks for testing purposes.
844 If you don't know what a machine check is and you don't do kernel
845 QA it is safe to say n.
846
814config X86_MCE_NONFATAL 847config X86_MCE_NONFATAL
815 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4" 848 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
816 depends on X86_32 && X86_MCE 849 depends on X86_OLD_MCE
817 ---help--- 850 ---help---
818 Enabling this feature starts a timer that triggers every 5 seconds which 851 Enabling this feature starts a timer that triggers every 5 seconds which
819 will look at the machine check registers to see if anything happened. 852 will look at the machine check registers to see if anything happened.
@@ -826,11 +859,15 @@ config X86_MCE_NONFATAL
826 859
827config X86_MCE_P4THERMAL 860config X86_MCE_P4THERMAL
828 bool "check for P4 thermal throttling interrupt." 861 bool "check for P4 thermal throttling interrupt."
829 depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) 862 depends on X86_OLD_MCE && X86_MCE && (X86_UP_APIC || SMP)
830 ---help--- 863 ---help---
831 Enabling this feature will cause a message to be printed when the P4 864 Enabling this feature will cause a message to be printed when the P4
832 enters thermal throttling. 865 enters thermal throttling.
833 866
867config X86_THERMAL_VECTOR
868 def_bool y
869 depends on X86_MCE_P4THERMAL || X86_MCE_INTEL
870
834config VM86 871config VM86
835 bool "Enable VM86 support" if EMBEDDED 872 bool "Enable VM86 support" if EMBEDDED
836 default y 873 default y
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index ebe7deedd5b4..cfb0010fa940 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -2,6 +2,8 @@
2# Arch-specific CryptoAPI modules. 2# Arch-specific CryptoAPI modules.
3# 3#
4 4
5obj-$(CONFIG_CRYPTO_FPU) += fpu.o
6
5obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o 7obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o
6obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o 8obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o
7obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o 9obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index 02af0af65497..4e663398f77f 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -21,6 +21,22 @@
21#include <asm/i387.h> 21#include <asm/i387.h>
22#include <asm/aes.h> 22#include <asm/aes.h>
23 23
24#if defined(CONFIG_CRYPTO_CTR) || defined(CONFIG_CRYPTO_CTR_MODULE)
25#define HAS_CTR
26#endif
27
28#if defined(CONFIG_CRYPTO_LRW) || defined(CONFIG_CRYPTO_LRW_MODULE)
29#define HAS_LRW
30#endif
31
32#if defined(CONFIG_CRYPTO_PCBC) || defined(CONFIG_CRYPTO_PCBC_MODULE)
33#define HAS_PCBC
34#endif
35
36#if defined(CONFIG_CRYPTO_XTS) || defined(CONFIG_CRYPTO_XTS_MODULE)
37#define HAS_XTS
38#endif
39
24struct async_aes_ctx { 40struct async_aes_ctx {
25 struct cryptd_ablkcipher *cryptd_tfm; 41 struct cryptd_ablkcipher *cryptd_tfm;
26}; 42};
@@ -137,6 +153,41 @@ static struct crypto_alg aesni_alg = {
137 } 153 }
138}; 154};
139 155
156static void __aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
157{
158 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
159
160 aesni_enc(ctx, dst, src);
161}
162
163static void __aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
164{
165 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
166
167 aesni_dec(ctx, dst, src);
168}
169
170static struct crypto_alg __aesni_alg = {
171 .cra_name = "__aes-aesni",
172 .cra_driver_name = "__driver-aes-aesni",
173 .cra_priority = 0,
174 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
175 .cra_blocksize = AES_BLOCK_SIZE,
176 .cra_ctxsize = sizeof(struct crypto_aes_ctx)+AESNI_ALIGN-1,
177 .cra_alignmask = 0,
178 .cra_module = THIS_MODULE,
179 .cra_list = LIST_HEAD_INIT(__aesni_alg.cra_list),
180 .cra_u = {
181 .cipher = {
182 .cia_min_keysize = AES_MIN_KEY_SIZE,
183 .cia_max_keysize = AES_MAX_KEY_SIZE,
184 .cia_setkey = aes_set_key,
185 .cia_encrypt = __aes_encrypt,
186 .cia_decrypt = __aes_decrypt
187 }
188 }
189};
190
140static int ecb_encrypt(struct blkcipher_desc *desc, 191static int ecb_encrypt(struct blkcipher_desc *desc,
141 struct scatterlist *dst, struct scatterlist *src, 192 struct scatterlist *dst, struct scatterlist *src,
142 unsigned int nbytes) 193 unsigned int nbytes)
@@ -277,8 +328,16 @@ static int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
277 unsigned int key_len) 328 unsigned int key_len)
278{ 329{
279 struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm); 330 struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm);
331 struct crypto_ablkcipher *child = &ctx->cryptd_tfm->base;
332 int err;
280 333
281 return crypto_ablkcipher_setkey(&ctx->cryptd_tfm->base, key, key_len); 334 crypto_ablkcipher_clear_flags(child, CRYPTO_TFM_REQ_MASK);
335 crypto_ablkcipher_set_flags(child, crypto_ablkcipher_get_flags(tfm)
336 & CRYPTO_TFM_REQ_MASK);
337 err = crypto_ablkcipher_setkey(child, key, key_len);
338 crypto_ablkcipher_set_flags(tfm, crypto_ablkcipher_get_flags(child)
339 & CRYPTO_TFM_RES_MASK);
340 return err;
282} 341}
283 342
284static int ablk_encrypt(struct ablkcipher_request *req) 343static int ablk_encrypt(struct ablkcipher_request *req)
@@ -411,6 +470,163 @@ static struct crypto_alg ablk_cbc_alg = {
411 }, 470 },
412}; 471};
413 472
473#ifdef HAS_CTR
474static int ablk_ctr_init(struct crypto_tfm *tfm)
475{
476 struct cryptd_ablkcipher *cryptd_tfm;
477
478 cryptd_tfm = cryptd_alloc_ablkcipher("fpu(ctr(__driver-aes-aesni))",
479 0, 0);
480 if (IS_ERR(cryptd_tfm))
481 return PTR_ERR(cryptd_tfm);
482 ablk_init_common(tfm, cryptd_tfm);
483 return 0;
484}
485
486static struct crypto_alg ablk_ctr_alg = {
487 .cra_name = "ctr(aes)",
488 .cra_driver_name = "ctr-aes-aesni",
489 .cra_priority = 400,
490 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
491 .cra_blocksize = 1,
492 .cra_ctxsize = sizeof(struct async_aes_ctx),
493 .cra_alignmask = 0,
494 .cra_type = &crypto_ablkcipher_type,
495 .cra_module = THIS_MODULE,
496 .cra_list = LIST_HEAD_INIT(ablk_ctr_alg.cra_list),
497 .cra_init = ablk_ctr_init,
498 .cra_exit = ablk_exit,
499 .cra_u = {
500 .ablkcipher = {
501 .min_keysize = AES_MIN_KEY_SIZE,
502 .max_keysize = AES_MAX_KEY_SIZE,
503 .ivsize = AES_BLOCK_SIZE,
504 .setkey = ablk_set_key,
505 .encrypt = ablk_encrypt,
506 .decrypt = ablk_decrypt,
507 .geniv = "chainiv",
508 },
509 },
510};
511#endif
512
513#ifdef HAS_LRW
514static int ablk_lrw_init(struct crypto_tfm *tfm)
515{
516 struct cryptd_ablkcipher *cryptd_tfm;
517
518 cryptd_tfm = cryptd_alloc_ablkcipher("fpu(lrw(__driver-aes-aesni))",
519 0, 0);
520 if (IS_ERR(cryptd_tfm))
521 return PTR_ERR(cryptd_tfm);
522 ablk_init_common(tfm, cryptd_tfm);
523 return 0;
524}
525
526static struct crypto_alg ablk_lrw_alg = {
527 .cra_name = "lrw(aes)",
528 .cra_driver_name = "lrw-aes-aesni",
529 .cra_priority = 400,
530 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
531 .cra_blocksize = AES_BLOCK_SIZE,
532 .cra_ctxsize = sizeof(struct async_aes_ctx),
533 .cra_alignmask = 0,
534 .cra_type = &crypto_ablkcipher_type,
535 .cra_module = THIS_MODULE,
536 .cra_list = LIST_HEAD_INIT(ablk_lrw_alg.cra_list),
537 .cra_init = ablk_lrw_init,
538 .cra_exit = ablk_exit,
539 .cra_u = {
540 .ablkcipher = {
541 .min_keysize = AES_MIN_KEY_SIZE + AES_BLOCK_SIZE,
542 .max_keysize = AES_MAX_KEY_SIZE + AES_BLOCK_SIZE,
543 .ivsize = AES_BLOCK_SIZE,
544 .setkey = ablk_set_key,
545 .encrypt = ablk_encrypt,
546 .decrypt = ablk_decrypt,
547 },
548 },
549};
550#endif
551
552#ifdef HAS_PCBC
553static int ablk_pcbc_init(struct crypto_tfm *tfm)
554{
555 struct cryptd_ablkcipher *cryptd_tfm;
556
557 cryptd_tfm = cryptd_alloc_ablkcipher("fpu(pcbc(__driver-aes-aesni))",
558 0, 0);
559 if (IS_ERR(cryptd_tfm))
560 return PTR_ERR(cryptd_tfm);
561 ablk_init_common(tfm, cryptd_tfm);
562 return 0;
563}
564
565static struct crypto_alg ablk_pcbc_alg = {
566 .cra_name = "pcbc(aes)",
567 .cra_driver_name = "pcbc-aes-aesni",
568 .cra_priority = 400,
569 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
570 .cra_blocksize = AES_BLOCK_SIZE,
571 .cra_ctxsize = sizeof(struct async_aes_ctx),
572 .cra_alignmask = 0,
573 .cra_type = &crypto_ablkcipher_type,
574 .cra_module = THIS_MODULE,
575 .cra_list = LIST_HEAD_INIT(ablk_pcbc_alg.cra_list),
576 .cra_init = ablk_pcbc_init,
577 .cra_exit = ablk_exit,
578 .cra_u = {
579 .ablkcipher = {
580 .min_keysize = AES_MIN_KEY_SIZE,
581 .max_keysize = AES_MAX_KEY_SIZE,
582 .ivsize = AES_BLOCK_SIZE,
583 .setkey = ablk_set_key,
584 .encrypt = ablk_encrypt,
585 .decrypt = ablk_decrypt,
586 },
587 },
588};
589#endif
590
591#ifdef HAS_XTS
592static int ablk_xts_init(struct crypto_tfm *tfm)
593{
594 struct cryptd_ablkcipher *cryptd_tfm;
595
596 cryptd_tfm = cryptd_alloc_ablkcipher("fpu(xts(__driver-aes-aesni))",
597 0, 0);
598 if (IS_ERR(cryptd_tfm))
599 return PTR_ERR(cryptd_tfm);
600 ablk_init_common(tfm, cryptd_tfm);
601 return 0;
602}
603
604static struct crypto_alg ablk_xts_alg = {
605 .cra_name = "xts(aes)",
606 .cra_driver_name = "xts-aes-aesni",
607 .cra_priority = 400,
608 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
609 .cra_blocksize = AES_BLOCK_SIZE,
610 .cra_ctxsize = sizeof(struct async_aes_ctx),
611 .cra_alignmask = 0,
612 .cra_type = &crypto_ablkcipher_type,
613 .cra_module = THIS_MODULE,
614 .cra_list = LIST_HEAD_INIT(ablk_xts_alg.cra_list),
615 .cra_init = ablk_xts_init,
616 .cra_exit = ablk_exit,
617 .cra_u = {
618 .ablkcipher = {
619 .min_keysize = 2 * AES_MIN_KEY_SIZE,
620 .max_keysize = 2 * AES_MAX_KEY_SIZE,
621 .ivsize = AES_BLOCK_SIZE,
622 .setkey = ablk_set_key,
623 .encrypt = ablk_encrypt,
624 .decrypt = ablk_decrypt,
625 },
626 },
627};
628#endif
629
414static int __init aesni_init(void) 630static int __init aesni_init(void)
415{ 631{
416 int err; 632 int err;
@@ -421,6 +637,8 @@ static int __init aesni_init(void)
421 } 637 }
422 if ((err = crypto_register_alg(&aesni_alg))) 638 if ((err = crypto_register_alg(&aesni_alg)))
423 goto aes_err; 639 goto aes_err;
640 if ((err = crypto_register_alg(&__aesni_alg)))
641 goto __aes_err;
424 if ((err = crypto_register_alg(&blk_ecb_alg))) 642 if ((err = crypto_register_alg(&blk_ecb_alg)))
425 goto blk_ecb_err; 643 goto blk_ecb_err;
426 if ((err = crypto_register_alg(&blk_cbc_alg))) 644 if ((err = crypto_register_alg(&blk_cbc_alg)))
@@ -429,9 +647,41 @@ static int __init aesni_init(void)
429 goto ablk_ecb_err; 647 goto ablk_ecb_err;
430 if ((err = crypto_register_alg(&ablk_cbc_alg))) 648 if ((err = crypto_register_alg(&ablk_cbc_alg)))
431 goto ablk_cbc_err; 649 goto ablk_cbc_err;
650#ifdef HAS_CTR
651 if ((err = crypto_register_alg(&ablk_ctr_alg)))
652 goto ablk_ctr_err;
653#endif
654#ifdef HAS_LRW
655 if ((err = crypto_register_alg(&ablk_lrw_alg)))
656 goto ablk_lrw_err;
657#endif
658#ifdef HAS_PCBC
659 if ((err = crypto_register_alg(&ablk_pcbc_alg)))
660 goto ablk_pcbc_err;
661#endif
662#ifdef HAS_XTS
663 if ((err = crypto_register_alg(&ablk_xts_alg)))
664 goto ablk_xts_err;
665#endif
432 666
433 return err; 667 return err;
434 668
669#ifdef HAS_XTS
670ablk_xts_err:
671#endif
672#ifdef HAS_PCBC
673 crypto_unregister_alg(&ablk_pcbc_alg);
674ablk_pcbc_err:
675#endif
676#ifdef HAS_LRW
677 crypto_unregister_alg(&ablk_lrw_alg);
678ablk_lrw_err:
679#endif
680#ifdef HAS_CTR
681 crypto_unregister_alg(&ablk_ctr_alg);
682ablk_ctr_err:
683#endif
684 crypto_unregister_alg(&ablk_cbc_alg);
435ablk_cbc_err: 685ablk_cbc_err:
436 crypto_unregister_alg(&ablk_ecb_alg); 686 crypto_unregister_alg(&ablk_ecb_alg);
437ablk_ecb_err: 687ablk_ecb_err:
@@ -439,6 +689,8 @@ ablk_ecb_err:
439blk_cbc_err: 689blk_cbc_err:
440 crypto_unregister_alg(&blk_ecb_alg); 690 crypto_unregister_alg(&blk_ecb_alg);
441blk_ecb_err: 691blk_ecb_err:
692 crypto_unregister_alg(&__aesni_alg);
693__aes_err:
442 crypto_unregister_alg(&aesni_alg); 694 crypto_unregister_alg(&aesni_alg);
443aes_err: 695aes_err:
444 return err; 696 return err;
@@ -446,10 +698,23 @@ aes_err:
446 698
447static void __exit aesni_exit(void) 699static void __exit aesni_exit(void)
448{ 700{
701#ifdef HAS_XTS
702 crypto_unregister_alg(&ablk_xts_alg);
703#endif
704#ifdef HAS_PCBC
705 crypto_unregister_alg(&ablk_pcbc_alg);
706#endif
707#ifdef HAS_LRW
708 crypto_unregister_alg(&ablk_lrw_alg);
709#endif
710#ifdef HAS_CTR
711 crypto_unregister_alg(&ablk_ctr_alg);
712#endif
449 crypto_unregister_alg(&ablk_cbc_alg); 713 crypto_unregister_alg(&ablk_cbc_alg);
450 crypto_unregister_alg(&ablk_ecb_alg); 714 crypto_unregister_alg(&ablk_ecb_alg);
451 crypto_unregister_alg(&blk_cbc_alg); 715 crypto_unregister_alg(&blk_cbc_alg);
452 crypto_unregister_alg(&blk_ecb_alg); 716 crypto_unregister_alg(&blk_ecb_alg);
717 crypto_unregister_alg(&__aesni_alg);
453 crypto_unregister_alg(&aesni_alg); 718 crypto_unregister_alg(&aesni_alg);
454} 719}
455 720
diff --git a/arch/x86/crypto/fpu.c b/arch/x86/crypto/fpu.c
new file mode 100644
index 000000000000..5f9781a3815f
--- /dev/null
+++ b/arch/x86/crypto/fpu.c
@@ -0,0 +1,166 @@
1/*
2 * FPU: Wrapper for blkcipher touching fpu
3 *
4 * Copyright (c) Intel Corp.
5 * Author: Huang Ying <ying.huang@intel.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 Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 */
13
14#include <crypto/algapi.h>
15#include <linux/err.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <asm/i387.h>
20
21struct crypto_fpu_ctx {
22 struct crypto_blkcipher *child;
23};
24
25static int crypto_fpu_setkey(struct crypto_tfm *parent, const u8 *key,
26 unsigned int keylen)
27{
28 struct crypto_fpu_ctx *ctx = crypto_tfm_ctx(parent);
29 struct crypto_blkcipher *child = ctx->child;
30 int err;
31
32 crypto_blkcipher_clear_flags(child, CRYPTO_TFM_REQ_MASK);
33 crypto_blkcipher_set_flags(child, crypto_tfm_get_flags(parent) &
34 CRYPTO_TFM_REQ_MASK);
35 err = crypto_blkcipher_setkey(child, key, keylen);
36 crypto_tfm_set_flags(parent, crypto_blkcipher_get_flags(child) &
37 CRYPTO_TFM_RES_MASK);
38 return err;
39}
40
41static int crypto_fpu_encrypt(struct blkcipher_desc *desc_in,
42 struct scatterlist *dst, struct scatterlist *src,
43 unsigned int nbytes)
44{
45 int err;
46 struct crypto_fpu_ctx *ctx = crypto_blkcipher_ctx(desc_in->tfm);
47 struct crypto_blkcipher *child = ctx->child;
48 struct blkcipher_desc desc = {
49 .tfm = child,
50 .info = desc_in->info,
51 .flags = desc_in->flags,
52 };
53
54 kernel_fpu_begin();
55 err = crypto_blkcipher_crt(desc.tfm)->encrypt(&desc, dst, src, nbytes);
56 kernel_fpu_end();
57 return err;
58}
59
60static int crypto_fpu_decrypt(struct blkcipher_desc *desc_in,
61 struct scatterlist *dst, struct scatterlist *src,
62 unsigned int nbytes)
63{
64 int err;
65 struct crypto_fpu_ctx *ctx = crypto_blkcipher_ctx(desc_in->tfm);
66 struct crypto_blkcipher *child = ctx->child;
67 struct blkcipher_desc desc = {
68 .tfm = child,
69 .info = desc_in->info,
70 .flags = desc_in->flags,
71 };
72
73 kernel_fpu_begin();
74 err = crypto_blkcipher_crt(desc.tfm)->decrypt(&desc, dst, src, nbytes);
75 kernel_fpu_end();
76 return err;
77}
78
79static int crypto_fpu_init_tfm(struct crypto_tfm *tfm)
80{
81 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
82 struct crypto_spawn *spawn = crypto_instance_ctx(inst);
83 struct crypto_fpu_ctx *ctx = crypto_tfm_ctx(tfm);
84 struct crypto_blkcipher *cipher;
85
86 cipher = crypto_spawn_blkcipher(spawn);
87 if (IS_ERR(cipher))
88 return PTR_ERR(cipher);
89
90 ctx->child = cipher;
91 return 0;
92}
93
94static void crypto_fpu_exit_tfm(struct crypto_tfm *tfm)
95{
96 struct crypto_fpu_ctx *ctx = crypto_tfm_ctx(tfm);
97 crypto_free_blkcipher(ctx->child);
98}
99
100static struct crypto_instance *crypto_fpu_alloc(struct rtattr **tb)
101{
102 struct crypto_instance *inst;
103 struct crypto_alg *alg;
104 int err;
105
106 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER);
107 if (err)
108 return ERR_PTR(err);
109
110 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER,
111 CRYPTO_ALG_TYPE_MASK);
112 if (IS_ERR(alg))
113 return ERR_CAST(alg);
114
115 inst = crypto_alloc_instance("fpu", alg);
116 if (IS_ERR(inst))
117 goto out_put_alg;
118
119 inst->alg.cra_flags = alg->cra_flags;
120 inst->alg.cra_priority = alg->cra_priority;
121 inst->alg.cra_blocksize = alg->cra_blocksize;
122 inst->alg.cra_alignmask = alg->cra_alignmask;
123 inst->alg.cra_type = alg->cra_type;
124 inst->alg.cra_blkcipher.ivsize = alg->cra_blkcipher.ivsize;
125 inst->alg.cra_blkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
126 inst->alg.cra_blkcipher.max_keysize = alg->cra_blkcipher.max_keysize;
127 inst->alg.cra_ctxsize = sizeof(struct crypto_fpu_ctx);
128 inst->alg.cra_init = crypto_fpu_init_tfm;
129 inst->alg.cra_exit = crypto_fpu_exit_tfm;
130 inst->alg.cra_blkcipher.setkey = crypto_fpu_setkey;
131 inst->alg.cra_blkcipher.encrypt = crypto_fpu_encrypt;
132 inst->alg.cra_blkcipher.decrypt = crypto_fpu_decrypt;
133
134out_put_alg:
135 crypto_mod_put(alg);
136 return inst;
137}
138
139static void crypto_fpu_free(struct crypto_instance *inst)
140{
141 crypto_drop_spawn(crypto_instance_ctx(inst));
142 kfree(inst);
143}
144
145static struct crypto_template crypto_fpu_tmpl = {
146 .name = "fpu",
147 .alloc = crypto_fpu_alloc,
148 .free = crypto_fpu_free,
149 .module = THIS_MODULE,
150};
151
152static int __init crypto_fpu_module_init(void)
153{
154 return crypto_register_template(&crypto_fpu_tmpl);
155}
156
157static void __exit crypto_fpu_module_exit(void)
158{
159 crypto_unregister_template(&crypto_fpu_tmpl);
160}
161
162module_init(crypto_fpu_module_init);
163module_exit(crypto_fpu_module_exit);
164
165MODULE_LICENSE("GPL");
166MODULE_DESCRIPTION("FPU block cipher wrapper");
diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h
index aff9f1fcdcd7..8cb9c814e120 100644
--- a/arch/x86/include/asm/atomic_32.h
+++ b/arch/x86/include/asm/atomic_32.h
@@ -483,5 +483,5 @@ atomic64_add_negative(unsigned long long delta, atomic64_t *ptr)
483 return old_val < 0; 483 return old_val < 0;
484} 484}
485 485
486#include <asm-generic/atomic.h> 486#include <asm-generic/atomic-long.h>
487#endif /* _ASM_X86_ATOMIC_32_H */ 487#endif /* _ASM_X86_ATOMIC_32_H */
diff --git a/arch/x86/include/asm/atomic_64.h b/arch/x86/include/asm/atomic_64.h
index 8c21731984da..0d6360220007 100644
--- a/arch/x86/include/asm/atomic_64.h
+++ b/arch/x86/include/asm/atomic_64.h
@@ -455,5 +455,5 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
455#define smp_mb__before_atomic_inc() barrier() 455#define smp_mb__before_atomic_inc() barrier()
456#define smp_mb__after_atomic_inc() barrier() 456#define smp_mb__after_atomic_inc() barrier()
457 457
458#include <asm-generic/atomic.h> 458#include <asm-generic/atomic-long.h>
459#endif /* _ASM_X86_ATOMIC_64_H */ 459#endif /* _ASM_X86_ATOMIC_64_H */
diff --git a/arch/x86/include/asm/bitsperlong.h b/arch/x86/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..b0ae1c4dc791
--- /dev/null
+++ b/arch/x86/include/asm/bitsperlong.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_X86_BITSPERLONG_H
2#define __ASM_X86_BITSPERLONG_H
3
4#ifdef __x86_64__
5# define __BITS_PER_LONG 64
6#else
7# define __BITS_PER_LONG 32
8#endif
9
10#include <asm-generic/bitsperlong.h>
11
12#endif /* __ASM_X86_BITSPERLONG_H */
13
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index d750a10ccad6..ff8cbfa07851 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -14,6 +14,7 @@ BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
14BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) 14BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
15BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) 15BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
16BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR) 16BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
17BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR)
17 18
18BUILD_INTERRUPT3(invalidate_interrupt0,INVALIDATE_TLB_VECTOR_START+0, 19BUILD_INTERRUPT3(invalidate_interrupt0,INVALIDATE_TLB_VECTOR_START+0,
19 smp_invalidate_interrupt) 20 smp_invalidate_interrupt)
@@ -52,8 +53,16 @@ BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
52BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR) 53BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR)
53#endif 54#endif
54 55
55#ifdef CONFIG_X86_MCE_P4THERMAL 56#ifdef CONFIG_X86_THERMAL_VECTOR
56BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) 57BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
57#endif 58#endif
58 59
60#ifdef CONFIG_X86_MCE_THRESHOLD
61BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR)
62#endif
63
64#ifdef CONFIG_X86_NEW_MCE
65BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR)
66#endif
67
59#endif 68#endif
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 9ebc5c255032..82e3e8f01043 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -22,7 +22,7 @@ typedef struct {
22#endif 22#endif
23#ifdef CONFIG_X86_MCE 23#ifdef CONFIG_X86_MCE
24 unsigned int irq_thermal_count; 24 unsigned int irq_thermal_count;
25# ifdef CONFIG_X86_64 25# ifdef CONFIG_X86_MCE_THRESHOLD
26 unsigned int irq_threshold_count; 26 unsigned int irq_threshold_count;
27# endif 27# endif
28#endif 28#endif
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 6df45f639666..ba180d93b08c 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -34,6 +34,7 @@ extern void perf_pending_interrupt(void);
34extern void spurious_interrupt(void); 34extern void spurious_interrupt(void);
35extern void thermal_interrupt(void); 35extern void thermal_interrupt(void);
36extern void reschedule_interrupt(void); 36extern void reschedule_interrupt(void);
37extern void mce_self_interrupt(void);
37 38
38extern void invalidate_interrupt(void); 39extern void invalidate_interrupt(void);
39extern void invalidate_interrupt0(void); 40extern void invalidate_interrupt0(void);
@@ -46,6 +47,7 @@ extern void invalidate_interrupt6(void);
46extern void invalidate_interrupt7(void); 47extern void invalidate_interrupt7(void);
47 48
48extern void irq_move_cleanup_interrupt(void); 49extern void irq_move_cleanup_interrupt(void);
50extern void reboot_interrupt(void);
49extern void threshold_interrupt(void); 51extern void threshold_interrupt(void);
50 52
51extern void call_function_interrupt(void); 53extern void call_function_interrupt(void);
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index e997be98c9b9..5b21f0ec3df2 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -25,6 +25,7 @@
25 */ 25 */
26 26
27#define NMI_VECTOR 0x02 27#define NMI_VECTOR 0x02
28#define MCE_VECTOR 0x12
28 29
29/* 30/*
30 * IDT vectors usable for external interrupt sources start 31 * IDT vectors usable for external interrupt sources start
@@ -87,13 +88,8 @@
87#define CALL_FUNCTION_VECTOR 0xfc 88#define CALL_FUNCTION_VECTOR 0xfc
88#define CALL_FUNCTION_SINGLE_VECTOR 0xfb 89#define CALL_FUNCTION_SINGLE_VECTOR 0xfb
89#define THERMAL_APIC_VECTOR 0xfa 90#define THERMAL_APIC_VECTOR 0xfa
90 91#define THRESHOLD_APIC_VECTOR 0xf9
91#ifdef CONFIG_X86_32 92#define REBOOT_VECTOR 0xf8
92/* 0xf8 - 0xf9 : free */
93#else
94# define THRESHOLD_APIC_VECTOR 0xf9
95# define UV_BAU_MESSAGE 0xf8
96#endif
97 93
98/* f0-f7 used for spreading out TLB flushes: */ 94/* f0-f7 used for spreading out TLB flushes: */
99#define INVALIDATE_TLB_VECTOR_END 0xf7 95#define INVALIDATE_TLB_VECTOR_END 0xf7
@@ -117,6 +113,13 @@
117 */ 113 */
118#define LOCAL_PENDING_VECTOR 0xec 114#define LOCAL_PENDING_VECTOR 0xec
119 115
116#define UV_BAU_MESSAGE 0xec
117
118/*
119 * Self IPI vector for machine checks
120 */
121#define MCE_SELF_VECTOR 0xeb
122
120/* 123/*
121 * First APIC vector available to drivers: (vectors 0x30-0xee) we 124 * First APIC vector available to drivers: (vectors 0x30-0xee) we
122 * start at 0x31(0x41) to spread out vectors evenly between priority 125 * start at 0x31(0x41) to spread out vectors evenly between priority
diff --git a/arch/x86/include/asm/lguest.h b/arch/x86/include/asm/lguest.h
index 1caf57628b9c..313389cd50d2 100644
--- a/arch/x86/include/asm/lguest.h
+++ b/arch/x86/include/asm/lguest.h
@@ -17,8 +17,13 @@
17/* Pages for switcher itself, then two pages per cpu */ 17/* Pages for switcher itself, then two pages per cpu */
18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids) 18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids)
19 19
20/* We map at -4M for ease of mapping into the guest (one PTE page). */ 20/* We map at -4M (-2M when PAE is activated) for ease of mapping
21 * into the guest (one PTE page). */
22#ifdef CONFIG_X86_PAE
23#define SWITCHER_ADDR 0xFFE00000
24#else
21#define SWITCHER_ADDR 0xFFC00000 25#define SWITCHER_ADDR 0xFFC00000
26#endif
22 27
23/* Found in switcher.S */ 28/* Found in switcher.S */
24extern unsigned long default_idt_entries[]; 29extern unsigned long default_idt_entries[];
diff --git a/arch/x86/include/asm/lguest_hcall.h b/arch/x86/include/asm/lguest_hcall.h
index faae1996487b..d31c4a684078 100644
--- a/arch/x86/include/asm/lguest_hcall.h
+++ b/arch/x86/include/asm/lguest_hcall.h
@@ -12,11 +12,13 @@
12#define LHCALL_TS 8 12#define LHCALL_TS 8
13#define LHCALL_SET_CLOCKEVENT 9 13#define LHCALL_SET_CLOCKEVENT 9
14#define LHCALL_HALT 10 14#define LHCALL_HALT 10
15#define LHCALL_SET_PMD 13
15#define LHCALL_SET_PTE 14 16#define LHCALL_SET_PTE 14
16#define LHCALL_SET_PMD 15 17#define LHCALL_SET_PGD 15
17#define LHCALL_LOAD_TLS 16 18#define LHCALL_LOAD_TLS 16
18#define LHCALL_NOTIFY 17 19#define LHCALL_NOTIFY 17
19#define LHCALL_LOAD_GDT_ENTRY 18 20#define LHCALL_LOAD_GDT_ENTRY 18
21#define LHCALL_SEND_INTERRUPTS 19
20 22
21#define LGUEST_TRAP_ENTRY 0x1F 23#define LGUEST_TRAP_ENTRY 0x1F
22 24
@@ -32,10 +34,10 @@
32 * operations? There are two ways: the direct way is to make a "hypercall", 34 * operations? There are two ways: the direct way is to make a "hypercall",
33 * to make requests of the Host Itself. 35 * to make requests of the Host Itself.
34 * 36 *
35 * We use the KVM hypercall mechanism. Eighteen hypercalls are 37 * We use the KVM hypercall mechanism. Seventeen hypercalls are
36 * available: the hypercall number is put in the %eax register, and the 38 * available: the hypercall number is put in the %eax register, and the
37 * arguments (when required) are placed in %ebx, %ecx and %edx. If a return 39 * arguments (when required) are placed in %ebx, %ecx, %edx and %esi.
38 * value makes sense, it's returned in %eax. 40 * If a return value makes sense, it's returned in %eax.
39 * 41 *
40 * Grossly invalid calls result in Sudden Death at the hands of the vengeful 42 * Grossly invalid calls result in Sudden Death at the hands of the vengeful
41 * Host, rather than returning failure. This reflects Winston Churchill's 43 * Host, rather than returning failure. This reflects Winston Churchill's
@@ -47,8 +49,9 @@
47 49
48#define LHCALL_RING_SIZE 64 50#define LHCALL_RING_SIZE 64
49struct hcall_args { 51struct hcall_args {
50 /* These map directly onto eax, ebx, ecx, edx in struct lguest_regs */ 52 /* These map directly onto eax, ebx, ecx, edx and esi
51 unsigned long arg0, arg1, arg2, arg3; 53 * in struct lguest_regs */
54 unsigned long arg0, arg1, arg2, arg3, arg4;
52}; 55};
53 56
54#endif /* !__ASSEMBLY__ */ 57#endif /* !__ASSEMBLY__ */
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 4f8c199584e7..540a466e50f5 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_MCE_H 1#ifndef _ASM_X86_MCE_H
2#define _ASM_X86_MCE_H 2#define _ASM_X86_MCE_H
3 3
4#ifdef __x86_64__
5
6#include <linux/types.h> 4#include <linux/types.h>
7#include <asm/ioctls.h> 5#include <asm/ioctls.h>
8 6
@@ -10,21 +8,35 @@
10 * Machine Check support for x86 8 * Machine Check support for x86
11 */ 9 */
12 10
13#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ 11#define MCG_BANKCNT_MASK 0xff /* Number of Banks */
14#define MCG_EXT_P (1ULL<<9) /* Extended registers available */ 12#define MCG_CTL_P (1ULL<<8) /* MCG_CAP register available */
15#define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ 13#define MCG_EXT_P (1ULL<<9) /* Extended registers available */
16 14#define MCG_CMCI_P (1ULL<<10) /* CMCI supported */
17#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ 15#define MCG_EXT_CNT_MASK 0xff0000 /* Number of Extended registers */
18#define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ 16#define MCG_EXT_CNT_SHIFT 16
19#define MCG_STATUS_MCIP (1UL<<2) /* machine check in progress */ 17#define MCG_EXT_CNT(c) (((c) & MCG_EXT_CNT_MASK) >> MCG_EXT_CNT_SHIFT)
20 18#define MCG_SER_P (1ULL<<24) /* MCA recovery/new status bits */
21#define MCI_STATUS_VAL (1UL<<63) /* valid error */ 19
22#define MCI_STATUS_OVER (1UL<<62) /* previous errors lost */ 20#define MCG_STATUS_RIPV (1ULL<<0) /* restart ip valid */
23#define MCI_STATUS_UC (1UL<<61) /* uncorrected error */ 21#define MCG_STATUS_EIPV (1ULL<<1) /* ip points to correct instruction */
24#define MCI_STATUS_EN (1UL<<60) /* error enabled */ 22#define MCG_STATUS_MCIP (1ULL<<2) /* machine check in progress */
25#define MCI_STATUS_MISCV (1UL<<59) /* misc error reg. valid */ 23
26#define MCI_STATUS_ADDRV (1UL<<58) /* addr reg. valid */ 24#define MCI_STATUS_VAL (1ULL<<63) /* valid error */
27#define MCI_STATUS_PCC (1UL<<57) /* processor context corrupt */ 25#define MCI_STATUS_OVER (1ULL<<62) /* previous errors lost */
26#define MCI_STATUS_UC (1ULL<<61) /* uncorrected error */
27#define MCI_STATUS_EN (1ULL<<60) /* error enabled */
28#define MCI_STATUS_MISCV (1ULL<<59) /* misc error reg. valid */
29#define MCI_STATUS_ADDRV (1ULL<<58) /* addr reg. valid */
30#define MCI_STATUS_PCC (1ULL<<57) /* processor context corrupt */
31#define MCI_STATUS_S (1ULL<<56) /* Signaled machine check */
32#define MCI_STATUS_AR (1ULL<<55) /* Action required */
33
34/* MISC register defines */
35#define MCM_ADDR_SEGOFF 0 /* segment offset */
36#define MCM_ADDR_LINEAR 1 /* linear address */
37#define MCM_ADDR_PHYS 2 /* physical address */
38#define MCM_ADDR_MEM 3 /* memory address */
39#define MCM_ADDR_GENERIC 7 /* generic */
28 40
29/* Fields are zero when not available */ 41/* Fields are zero when not available */
30struct mce { 42struct mce {
@@ -34,13 +46,19 @@ struct mce {
34 __u64 mcgstatus; 46 __u64 mcgstatus;
35 __u64 ip; 47 __u64 ip;
36 __u64 tsc; /* cpu time stamp counter */ 48 __u64 tsc; /* cpu time stamp counter */
37 __u64 res1; /* for future extension */ 49 __u64 time; /* wall time_t when error was detected */
38 __u64 res2; /* dito. */ 50 __u8 cpuvendor; /* cpu vendor as encoded in system.h */
51 __u8 pad1;
52 __u16 pad2;
53 __u32 cpuid; /* CPUID 1 EAX */
39 __u8 cs; /* code segment */ 54 __u8 cs; /* code segment */
40 __u8 bank; /* machine check bank */ 55 __u8 bank; /* machine check bank */
41 __u8 cpu; /* cpu that raised the error */ 56 __u8 cpu; /* cpu number; obsolete; use extcpu now */
42 __u8 finished; /* entry is valid */ 57 __u8 finished; /* entry is valid */
43 __u32 pad; 58 __u32 extcpu; /* linux cpu number that detected the error */
59 __u32 socketid; /* CPU socket ID */
60 __u32 apicid; /* CPU initial apic ID */
61 __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
44}; 62};
45 63
46/* 64/*
@@ -57,7 +75,7 @@ struct mce_log {
57 unsigned len; /* = MCE_LOG_LEN */ 75 unsigned len; /* = MCE_LOG_LEN */
58 unsigned next; 76 unsigned next;
59 unsigned flags; 77 unsigned flags;
60 unsigned pad0; 78 unsigned recordlen; /* length of struct mce */
61 struct mce entry[MCE_LOG_LEN]; 79 struct mce entry[MCE_LOG_LEN];
62}; 80};
63 81
@@ -82,19 +100,16 @@ struct mce_log {
82#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) 100#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9)
83#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) 101#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0)
84 102
85#endif /* __x86_64__ */
86
87#ifdef __KERNEL__ 103#ifdef __KERNEL__
88 104
89#ifdef CONFIG_X86_32
90extern int mce_disabled; 105extern int mce_disabled;
91#else /* CONFIG_X86_32 */
92 106
93#include <asm/atomic.h> 107#include <asm/atomic.h>
108#include <linux/percpu.h>
94 109
95void mce_setup(struct mce *m); 110void mce_setup(struct mce *m);
96void mce_log(struct mce *m); 111void mce_log(struct mce *m);
97DECLARE_PER_CPU(struct sys_device, device_mce); 112DECLARE_PER_CPU(struct sys_device, mce_dev);
98extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); 113extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
99 114
100/* 115/*
@@ -104,6 +119,8 @@ extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
104#define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1) 119#define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1)
105 120
106#ifdef CONFIG_X86_MCE_INTEL 121#ifdef CONFIG_X86_MCE_INTEL
122extern int mce_cmci_disabled;
123extern int mce_ignore_ce;
107void mce_intel_feature_init(struct cpuinfo_x86 *c); 124void mce_intel_feature_init(struct cpuinfo_x86 *c);
108void cmci_clear(void); 125void cmci_clear(void);
109void cmci_reenable(void); 126void cmci_reenable(void);
@@ -123,13 +140,16 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c);
123static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } 140static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
124#endif 141#endif
125 142
126extern int mce_available(struct cpuinfo_x86 *c); 143int mce_available(struct cpuinfo_x86 *c);
144
145DECLARE_PER_CPU(unsigned, mce_exception_count);
146DECLARE_PER_CPU(unsigned, mce_poll_count);
127 147
128void mce_log_therm_throt_event(__u64 status); 148void mce_log_therm_throt_event(__u64 status);
129 149
130extern atomic_t mce_entry; 150extern atomic_t mce_entry;
131 151
132extern void do_machine_check(struct pt_regs *, long); 152void do_machine_check(struct pt_regs *, long);
133 153
134typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS); 154typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS);
135DECLARE_PER_CPU(mce_banks_t, mce_poll_banks); 155DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
@@ -139,14 +159,16 @@ enum mcp_flags {
139 MCP_UC = (1 << 1), /* log uncorrected errors */ 159 MCP_UC = (1 << 1), /* log uncorrected errors */
140 MCP_DONTLOG = (1 << 2), /* only clear, don't log */ 160 MCP_DONTLOG = (1 << 2), /* only clear, don't log */
141}; 161};
142extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b); 162void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
143 163
144extern int mce_notify_user(void); 164int mce_notify_irq(void);
165void mce_notify_process(void);
145 166
146#endif /* !CONFIG_X86_32 */ 167DECLARE_PER_CPU(struct mce, injectm);
168extern struct file_operations mce_chrdev_ops;
147 169
148#ifdef CONFIG_X86_MCE 170#ifdef CONFIG_X86_MCE
149extern void mcheck_init(struct cpuinfo_x86 *c); 171void mcheck_init(struct cpuinfo_x86 *c);
150#else 172#else
151#define mcheck_init(c) do { } while (0) 173#define mcheck_init(c) do { } while (0)
152#endif 174#endif
diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
index 90bc4108a4fd..751af2550ed9 100644
--- a/arch/x86/include/asm/mman.h
+++ b/arch/x86/include/asm/mman.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_X86_MMAN_H 1#ifndef _ASM_X86_MMAN_H
2#define _ASM_X86_MMAN_H 2#define _ASM_X86_MMAN_H
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman-common.h>
5 5
6#define MAP_32BIT 0x40 /* only give out 32bit addresses */ 6#define MAP_32BIT 0x40 /* only give out 32bit addresses */
7 7
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 4d58d04fca83..1692fb5050e3 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -207,7 +207,14 @@
207 207
208#define MSR_IA32_THERM_CONTROL 0x0000019a 208#define MSR_IA32_THERM_CONTROL 0x0000019a
209#define MSR_IA32_THERM_INTERRUPT 0x0000019b 209#define MSR_IA32_THERM_INTERRUPT 0x0000019b
210
211#define THERM_INT_LOW_ENABLE (1 << 0)
212#define THERM_INT_HIGH_ENABLE (1 << 1)
213
210#define MSR_IA32_THERM_STATUS 0x0000019c 214#define MSR_IA32_THERM_STATUS 0x0000019c
215
216#define THERM_STATUS_PROCHOT (1 << 0)
217
211#define MSR_IA32_MISC_ENABLE 0x000001a0 218#define MSR_IA32_MISC_ENABLE 0x000001a0
212 219
213/* MISC_ENABLE bits: architectural */ 220/* MISC_ENABLE bits: architectural */
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 89ed9d70b0aa..625c3f0e741a 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -56,7 +56,7 @@ extern bool __virt_addr_valid(unsigned long kaddr);
56#endif /* __ASSEMBLY__ */ 56#endif /* __ASSEMBLY__ */
57 57
58#include <asm-generic/memory_model.h> 58#include <asm-generic/memory_model.h>
59#include <asm-generic/page.h> 59#include <asm-generic/getorder.h>
60 60
61#define __HAVE_ARCH_GATE_AREA 1 61#define __HAVE_ARCH_GATE_AREA 1
62 62
diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h
index 2733fad45f98..5e67c1532314 100644
--- a/arch/x86/include/asm/pgtable_32_types.h
+++ b/arch/x86/include/asm/pgtable_32_types.h
@@ -46,6 +46,10 @@ extern bool __vmalloc_start_set; /* set once high_memory is set */
46# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE) 46# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)
47#endif 47#endif
48 48
49#define MODULES_VADDR VMALLOC_START
50#define MODULES_END VMALLOC_END
51#define MODULES_LEN (MODULES_VADDR - MODULES_END)
52
49#define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE) 53#define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
50 54
51#endif /* _ASM_X86_PGTABLE_32_DEFS_H */ 55#endif /* _ASM_X86_PGTABLE_32_DEFS_H */
diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h
index 7761a5d554bb..598457cbd0f8 100644
--- a/arch/x86/include/asm/signal.h
+++ b/arch/x86/include/asm/signal.h
@@ -117,7 +117,7 @@ typedef unsigned long sigset_t;
117#define MINSIGSTKSZ 2048 117#define MINSIGSTKSZ 2048
118#define SIGSTKSZ 8192 118#define SIGSTKSZ 8192
119 119
120#include <asm-generic/signal.h> 120#include <asm-generic/signal-defs.h>
121 121
122#ifndef __ASSEMBLY__ 122#ifndef __ASSEMBLY__
123 123
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index a5ecc9c33e92..7f3eba08e7de 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -172,6 +172,6 @@ static inline void flush_tlb_kernel_range(unsigned long start,
172 flush_tlb_all(); 172 flush_tlb_all();
173} 173}
174 174
175extern void zap_low_mappings(void); 175extern void zap_low_mappings(bool early);
176 176
177#endif /* _ASM_X86_TLBFLUSH_H */ 177#endif /* _ASM_X86_TLBFLUSH_H */
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index e6f736320077..09b97745772f 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -14,12 +14,6 @@ typedef unsigned short umode_t;
14 */ 14 */
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#ifdef CONFIG_X86_32
18# define BITS_PER_LONG 32
19#else
20# define BITS_PER_LONG 64
21#endif
22
23#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
24 18
25typedef u64 dma64_addr_t; 19typedef u64 dma64_addr_t;
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 4f78bd682125..f3477bb84566 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -73,7 +73,7 @@ obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o
73obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o 73obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o
74obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o 74obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
75obj-$(CONFIG_KPROBES) += kprobes.o 75obj-$(CONFIG_KPROBES) += kprobes.o
76obj-$(CONFIG_MODULES) += module_$(BITS).o 76obj-$(CONFIG_MODULES) += module.o
77obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o 77obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o
78obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o 78obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o
79obj-$(CONFIG_KGDB) += kgdb.o 79obj-$(CONFIG_KGDB) += kgdb.o
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 7c243a2c5115..ca93638ba430 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -104,7 +104,7 @@ int acpi_save_state_mem(void)
104 initial_gs = per_cpu_offset(smp_processor_id()); 104 initial_gs = per_cpu_offset(smp_processor_id());
105#endif 105#endif
106 initial_code = (unsigned long)wakeup_long64; 106 initial_code = (unsigned long)wakeup_long64;
107 saved_magic = 0x123456789abcdef0; 107 saved_magic = 0x123456789abcdef0L;
108#endif /* CONFIG_64BIT */ 108#endif /* CONFIG_64BIT */
109 109
110 return 0; 110 return 0;
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 076d3881f3da..8c7c042ecad1 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -899,7 +899,7 @@ void clear_local_APIC(void)
899 } 899 }
900 900
901 /* lets not touch this if we didn't frob it */ 901 /* lets not touch this if we didn't frob it */
902#if defined(CONFIG_X86_MCE_P4THERMAL) || defined(CONFIG_X86_MCE_INTEL) 902#ifdef CONFIG_X86_THERMAL_VECTOR
903 if (maxlvt >= 5) { 903 if (maxlvt >= 5) {
904 v = apic_read(APIC_LVTTHMR); 904 v = apic_read(APIC_LVTTHMR);
905 apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED); 905 apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED);
@@ -2017,7 +2017,7 @@ static int lapic_suspend(struct sys_device *dev, pm_message_t state)
2017 apic_pm_state.apic_lvterr = apic_read(APIC_LVTERR); 2017 apic_pm_state.apic_lvterr = apic_read(APIC_LVTERR);
2018 apic_pm_state.apic_tmict = apic_read(APIC_TMICT); 2018 apic_pm_state.apic_tmict = apic_read(APIC_TMICT);
2019 apic_pm_state.apic_tdcr = apic_read(APIC_TDCR); 2019 apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
2020#if defined(CONFIG_X86_MCE_P4THERMAL) || defined(CONFIG_X86_MCE_INTEL) 2020#ifdef CONFIG_X86_THERMAL_VECTOR
2021 if (maxlvt >= 5) 2021 if (maxlvt >= 5)
2022 apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR); 2022 apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
2023#endif 2023#endif
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c
index a691302dc3ff..b3025b43b63a 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_64) && defined(CONFIG_X86_MCE) 69#if defined(CONFIG_X86_NEW_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/apm_32.c b/arch/x86/kernel/apm_32.c
index 49e0939bac42..79302e9a33a4 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1233,9 +1233,9 @@ static int suspend(int vetoable)
1233 int err; 1233 int err;
1234 struct apm_user *as; 1234 struct apm_user *as;
1235 1235
1236 device_suspend(PMSG_SUSPEND); 1236 dpm_suspend_start(PMSG_SUSPEND);
1237 1237
1238 device_power_down(PMSG_SUSPEND); 1238 dpm_suspend_noirq(PMSG_SUSPEND);
1239 1239
1240 local_irq_disable(); 1240 local_irq_disable();
1241 sysdev_suspend(PMSG_SUSPEND); 1241 sysdev_suspend(PMSG_SUSPEND);
@@ -1259,9 +1259,9 @@ static int suspend(int vetoable)
1259 sysdev_resume(); 1259 sysdev_resume();
1260 local_irq_enable(); 1260 local_irq_enable();
1261 1261
1262 device_power_up(PMSG_RESUME); 1262 dpm_resume_noirq(PMSG_RESUME);
1263 1263
1264 device_resume(PMSG_RESUME); 1264 dpm_resume_end(PMSG_RESUME);
1265 queue_event(APM_NORMAL_RESUME, NULL); 1265 queue_event(APM_NORMAL_RESUME, NULL);
1266 spin_lock(&user_list_lock); 1266 spin_lock(&user_list_lock);
1267 for (as = user_list; as != NULL; as = as->next) { 1267 for (as = user_list; as != NULL; as = as->next) {
@@ -1277,7 +1277,7 @@ static void standby(void)
1277{ 1277{
1278 int err; 1278 int err;
1279 1279
1280 device_power_down(PMSG_SUSPEND); 1280 dpm_suspend_noirq(PMSG_SUSPEND);
1281 1281
1282 local_irq_disable(); 1282 local_irq_disable();
1283 sysdev_suspend(PMSG_SUSPEND); 1283 sysdev_suspend(PMSG_SUSPEND);
@@ -1291,7 +1291,7 @@ static void standby(void)
1291 sysdev_resume(); 1291 sysdev_resume();
1292 local_irq_enable(); 1292 local_irq_enable();
1293 1293
1294 device_power_up(PMSG_RESUME); 1294 dpm_resume_noirq(PMSG_RESUME);
1295} 1295}
1296 1296
1297static apm_event_t get_event(void) 1297static apm_event_t get_event(void)
@@ -1376,7 +1376,7 @@ static void check_events(void)
1376 ignore_bounce = 1; 1376 ignore_bounce = 1;
1377 if ((event != APM_NORMAL_RESUME) 1377 if ((event != APM_NORMAL_RESUME)
1378 || (ignore_normal_resume == 0)) { 1378 || (ignore_normal_resume == 0)) {
1379 device_resume(PMSG_RESUME); 1379 dpm_resume_end(PMSG_RESUME);
1380 queue_event(event, NULL); 1380 queue_event(event, NULL);
1381 } 1381 }
1382 ignore_normal_resume = 0; 1382 ignore_normal_resume = 0;
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 1a830cbd7015..dfdbf6403895 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -126,6 +126,7 @@ void foo(void)
126#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST) || defined(CONFIG_LGUEST_MODULE) 126#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST) || defined(CONFIG_LGUEST_MODULE)
127 BLANK(); 127 BLANK();
128 OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled); 128 OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);
129 OFFSET(LGUEST_DATA_irq_pending, lguest_data, irq_pending);
129 OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir); 130 OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir);
130 131
131 BLANK(); 132 BLANK();
diff --git a/arch/x86/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mcheck/Makefile
index b2f89829bbe8..45004faf67ea 100644
--- a/arch/x86/kernel/cpu/mcheck/Makefile
+++ b/arch/x86/kernel/cpu/mcheck/Makefile
@@ -1,7 +1,11 @@
1obj-y = mce_$(BITS).o therm_throt.o 1obj-y = mce.o therm_throt.o
2 2
3obj-$(CONFIG_X86_32) += k7.o p4.o p5.o p6.o winchip.o 3obj-$(CONFIG_X86_NEW_MCE) += mce-severity.o
4obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o 4obj-$(CONFIG_X86_OLD_MCE) += k7.o p4.o p6.o
5obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o
6obj-$(CONFIG_X86_MCE_P4THERMAL) += mce_intel.o
7obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o mce_intel.o
5obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o 8obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o
6obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o 9obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o
7obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o 10obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
11obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o
diff --git a/arch/x86/kernel/cpu/mcheck/k7.c b/arch/x86/kernel/cpu/mcheck/k7.c
index dd3af6e7b39a..89e510424152 100644
--- a/arch/x86/kernel/cpu/mcheck/k7.c
+++ b/arch/x86/kernel/cpu/mcheck/k7.c
@@ -2,11 +2,10 @@
2 * Athlon specific Machine Check Exception Reporting 2 * Athlon specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Dave Jones <davej@redhat.com> 3 * (C) Copyright 2002 Dave Jones <davej@redhat.com>
4 */ 4 */
5
6#include <linux/init.h>
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
10#include <linux/smp.h> 9#include <linux/smp.h>
11 10
12#include <asm/processor.h> 11#include <asm/processor.h>
@@ -15,12 +14,12 @@
15 14
16#include "mce.h" 15#include "mce.h"
17 16
18/* Machine Check Handler For AMD Athlon/Duron */ 17/* Machine Check Handler For AMD Athlon/Duron: */
19static void k7_machine_check(struct pt_regs *regs, long error_code) 18static void k7_machine_check(struct pt_regs *regs, long error_code)
20{ 19{
21 int recover = 1;
22 u32 alow, ahigh, high, low; 20 u32 alow, ahigh, high, low;
23 u32 mcgstl, mcgsth; 21 u32 mcgstl, mcgsth;
22 int recover = 1;
24 int i; 23 int i;
25 24
26 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth); 25 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
@@ -32,15 +31,19 @@ static void k7_machine_check(struct pt_regs *regs, long error_code)
32 31
33 for (i = 1; i < nr_mce_banks; i++) { 32 for (i = 1; i < nr_mce_banks; i++) {
34 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high); 33 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
35 if (high&(1<<31)) { 34 if (high & (1<<31)) {
36 char misc[20]; 35 char misc[20];
37 char addr[24]; 36 char addr[24];
38 misc[0] = addr[0] = '\0'; 37
38 misc[0] = '\0';
39 addr[0] = '\0';
40
39 if (high & (1<<29)) 41 if (high & (1<<29))
40 recover |= 1; 42 recover |= 1;
41 if (high & (1<<25)) 43 if (high & (1<<25))
42 recover |= 2; 44 recover |= 2;
43 high &= ~(1<<31); 45 high &= ~(1<<31);
46
44 if (high & (1<<27)) { 47 if (high & (1<<27)) {
45 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh); 48 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh);
46 snprintf(misc, 20, "[%08x%08x]", ahigh, alow); 49 snprintf(misc, 20, "[%08x%08x]", ahigh, alow);
@@ -49,27 +52,31 @@ static void k7_machine_check(struct pt_regs *regs, long error_code)
49 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh); 52 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh);
50 snprintf(addr, 24, " at %08x%08x", ahigh, alow); 53 snprintf(addr, 24, " at %08x%08x", ahigh, alow);
51 } 54 }
55
52 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n", 56 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n",
53 smp_processor_id(), i, high, low, misc, addr); 57 smp_processor_id(), i, high, low, misc, addr);
54 /* Clear it */ 58
59 /* Clear it: */
55 wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL); 60 wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL);
56 /* Serialize */ 61 /* Serialize: */
57 wmb(); 62 wmb();
58 add_taint(TAINT_MACHINE_CHECK); 63 add_taint(TAINT_MACHINE_CHECK);
59 } 64 }
60 } 65 }
61 66
62 if (recover&2) 67 if (recover & 2)
63 panic("CPU context corrupt"); 68 panic("CPU context corrupt");
64 if (recover&1) 69 if (recover & 1)
65 panic("Unable to continue"); 70 panic("Unable to continue");
71
66 printk(KERN_EMERG "Attempting to continue.\n"); 72 printk(KERN_EMERG "Attempting to continue.\n");
73
67 mcgstl &= ~(1<<2); 74 mcgstl &= ~(1<<2);
68 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth); 75 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
69} 76}
70 77
71 78
72/* AMD K7 machine check is Intel like */ 79/* AMD K7 machine check is Intel like: */
73void amd_mcheck_init(struct cpuinfo_x86 *c) 80void amd_mcheck_init(struct cpuinfo_x86 *c)
74{ 81{
75 u32 l, h; 82 u32 l, h;
@@ -79,21 +86,26 @@ void amd_mcheck_init(struct cpuinfo_x86 *c)
79 return; 86 return;
80 87
81 machine_check_vector = k7_machine_check; 88 machine_check_vector = k7_machine_check;
89 /* Make sure the vector pointer is visible before we enable MCEs: */
82 wmb(); 90 wmb();
83 91
84 printk(KERN_INFO "Intel machine check architecture supported.\n"); 92 printk(KERN_INFO "Intel machine check architecture supported.\n");
93
85 rdmsr(MSR_IA32_MCG_CAP, l, h); 94 rdmsr(MSR_IA32_MCG_CAP, l, h);
86 if (l & (1<<8)) /* Control register present ? */ 95 if (l & (1<<8)) /* Control register present ? */
87 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff); 96 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
88 nr_mce_banks = l & 0xff; 97 nr_mce_banks = l & 0xff;
89 98
90 /* Clear status for MC index 0 separately, we don't touch CTL, 99 /*
91 * as some K7 Athlons cause spurious MCEs when its enabled. */ 100 * Clear status for MC index 0 separately, we don't touch CTL,
101 * as some K7 Athlons cause spurious MCEs when its enabled:
102 */
92 if (boot_cpu_data.x86 == 6) { 103 if (boot_cpu_data.x86 == 6) {
93 wrmsr(MSR_IA32_MC0_STATUS, 0x0, 0x0); 104 wrmsr(MSR_IA32_MC0_STATUS, 0x0, 0x0);
94 i = 1; 105 i = 1;
95 } else 106 } else
96 i = 0; 107 i = 0;
108
97 for (; i < nr_mce_banks; i++) { 109 for (; i < nr_mce_banks; i++) {
98 wrmsr(MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff); 110 wrmsr(MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
99 wrmsr(MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0); 111 wrmsr(MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
new file mode 100644
index 000000000000..a3a235a53f09
--- /dev/null
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -0,0 +1,127 @@
1/*
2 * Machine check injection support.
3 * Copyright 2008 Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; version 2
8 * of the License.
9 *
10 * Authors:
11 * Andi Kleen
12 * Ying Huang
13 */
14#include <linux/uaccess.h>
15#include <linux/module.h>
16#include <linux/timer.h>
17#include <linux/kernel.h>
18#include <linux/string.h>
19#include <linux/fs.h>
20#include <linux/smp.h>
21#include <asm/mce.h>
22
23/* Update fake mce registers on current CPU. */
24static void inject_mce(struct mce *m)
25{
26 struct mce *i = &per_cpu(injectm, m->extcpu);
27
28 /* Make sure noone reads partially written injectm */
29 i->finished = 0;
30 mb();
31 m->finished = 0;
32 /* First set the fields after finished */
33 i->extcpu = m->extcpu;
34 mb();
35 /* Now write record in order, finished last (except above) */
36 memcpy(i, m, sizeof(struct mce));
37 /* Finally activate it */
38 mb();
39 i->finished = 1;
40}
41
42struct delayed_mce {
43 struct timer_list timer;
44 struct mce m;
45};
46
47/* Inject mce on current CPU */
48static void raise_mce(unsigned long data)
49{
50 struct delayed_mce *dm = (struct delayed_mce *)data;
51 struct mce *m = &dm->m;
52 int cpu = m->extcpu;
53
54 inject_mce(m);
55 if (m->status & MCI_STATUS_UC) {
56 struct pt_regs regs;
57 memset(&regs, 0, sizeof(struct pt_regs));
58 regs.ip = m->ip;
59 regs.cs = m->cs;
60 printk(KERN_INFO "Triggering MCE exception on CPU %d\n", cpu);
61 do_machine_check(&regs, 0);
62 printk(KERN_INFO "MCE exception done on CPU %d\n", cpu);
63 } else {
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);
67 machine_check_poll(0, &b);
68 mce_notify_irq();
69 printk(KERN_INFO "Finished machine check poll on CPU %d\n",
70 cpu);
71 }
72 kfree(dm);
73}
74
75/* Error injection interface */
76static ssize_t mce_write(struct file *filp, const char __user *ubuf,
77 size_t usize, loff_t *off)
78{
79 struct delayed_mce *dm;
80 struct mce m;
81
82 if (!capable(CAP_SYS_ADMIN))
83 return -EPERM;
84 /*
85 * There are some cases where real MSR reads could slip
86 * through.
87 */
88 if (!boot_cpu_has(X86_FEATURE_MCE) || !boot_cpu_has(X86_FEATURE_MCA))
89 return -EIO;
90
91 if ((unsigned long)usize > sizeof(struct mce))
92 usize = sizeof(struct mce);
93 if (copy_from_user(&m, ubuf, usize))
94 return -EFAULT;
95
96 if (m.extcpu >= num_possible_cpus() || !cpu_online(m.extcpu))
97 return -EINVAL;
98
99 dm = kmalloc(sizeof(struct delayed_mce), GFP_KERNEL);
100 if (!dm)
101 return -ENOMEM;
102
103 /*
104 * Need to give user space some time to set everything up,
105 * so do it a jiffie or two later everywhere.
106 * Should we use a hrtimer here for better synchronization?
107 */
108 memcpy(&dm->m, &m, sizeof(struct mce));
109 setup_timer(&dm->timer, raise_mce, (unsigned long)dm);
110 dm->timer.expires = jiffies + 2;
111 add_timer_on(&dm->timer, m.extcpu);
112 return usize;
113}
114
115static int inject_init(void)
116{
117 printk(KERN_INFO "Machine check injector initialized\n");
118 mce_chrdev_ops.write = mce_write;
119 return 0;
120}
121
122module_init(inject_init);
123/*
124 * Cannot tolerate unloading currently because we cannot
125 * guarantee all openers of mce_chrdev will get a reference to us.
126 */
127MODULE_LICENSE("GPL");
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
new file mode 100644
index 000000000000..54dcb8ff12e5
--- /dev/null
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -0,0 +1,15 @@
1#include <asm/mce.h>
2
3enum severity_level {
4 MCE_NO_SEVERITY,
5 MCE_KEEP_SEVERITY,
6 MCE_SOME_SEVERITY,
7 MCE_AO_SEVERITY,
8 MCE_UC_SEVERITY,
9 MCE_AR_SEVERITY,
10 MCE_PANIC_SEVERITY,
11};
12
13int mce_severity(struct mce *a, int tolerant, char **msg);
14
15extern int mce_ser;
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
new file mode 100644
index 000000000000..ff0807f97056
--- /dev/null
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -0,0 +1,218 @@
1/*
2 * MCE grading rules.
3 * Copyright 2008, 2009 Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; version 2
8 * of the License.
9 *
10 * Author: Andi Kleen
11 */
12#include <linux/kernel.h>
13#include <linux/seq_file.h>
14#include <linux/init.h>
15#include <linux/debugfs.h>
16#include <asm/mce.h>
17
18#include "mce-internal.h"
19
20/*
21 * Grade an mce by severity. In general the most severe ones are processed
22 * first. Since there are quite a lot of combinations test the bits in a
23 * table-driven way. The rules are simply processed in order, first
24 * match wins.
25 *
26 * Note this is only used for machine check exceptions, the corrected
27 * errors use much simpler rules. The exceptions still check for the corrected
28 * errors, but only to leave them alone for the CMCI handler (except for
29 * panic situations)
30 */
31
32enum context { IN_KERNEL = 1, IN_USER = 2 };
33enum ser { SER_REQUIRED = 1, NO_SER = 2 };
34
35static struct severity {
36 u64 mask;
37 u64 result;
38 unsigned char sev;
39 unsigned char mcgmask;
40 unsigned char mcgres;
41 unsigned char ser;
42 unsigned char context;
43 unsigned char covered;
44 char *msg;
45} severities[] = {
46#define KERNEL .context = IN_KERNEL
47#define USER .context = IN_USER
48#define SER .ser = SER_REQUIRED
49#define NOSER .ser = NO_SER
50#define SEV(s) .sev = MCE_ ## s ## _SEVERITY
51#define BITCLR(x, s, m, r...) { .mask = x, .result = 0, SEV(s), .msg = m, ## r }
52#define BITSET(x, s, m, r...) { .mask = x, .result = x, SEV(s), .msg = m, ## r }
53#define MCGMASK(x, res, s, m, r...) \
54 { .mcgmask = x, .mcgres = res, SEV(s), .msg = m, ## r }
55#define MASK(x, y, s, m, r...) \
56 { .mask = x, .result = y, SEV(s), .msg = m, ## r }
57#define MCI_UC_S (MCI_STATUS_UC|MCI_STATUS_S)
58#define MCI_UC_SAR (MCI_STATUS_UC|MCI_STATUS_S|MCI_STATUS_AR)
59#define MCACOD 0xffff
60
61 BITCLR(MCI_STATUS_VAL, NO, "Invalid"),
62 BITCLR(MCI_STATUS_EN, NO, "Not enabled"),
63 BITSET(MCI_STATUS_PCC, PANIC, "Processor context corrupt"),
64 /* When MCIP is not set something is very confused */
65 MCGMASK(MCG_STATUS_MCIP, 0, PANIC, "MCIP not set in MCA handler"),
66 /* Neither return not error IP -- no chance to recover -> PANIC */
67 MCGMASK(MCG_STATUS_RIPV|MCG_STATUS_EIPV, 0, PANIC,
68 "Neither restart nor error IP"),
69 MCGMASK(MCG_STATUS_RIPV, 0, PANIC, "In kernel and no restart IP",
70 KERNEL),
71 BITCLR(MCI_STATUS_UC, KEEP, "Corrected error", NOSER),
72 MASK(MCI_STATUS_OVER|MCI_STATUS_UC|MCI_STATUS_EN, MCI_STATUS_UC, SOME,
73 "Spurious not enabled", SER),
74
75 /* ignore OVER for UCNA */
76 MASK(MCI_UC_SAR, MCI_STATUS_UC, KEEP,
77 "Uncorrected no action required", SER),
78 MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_UC|MCI_STATUS_AR, PANIC,
79 "Illegal combination (UCNA with AR=1)", SER),
80 MASK(MCI_STATUS_S, 0, KEEP, "Non signalled machine check", SER),
81
82 /* AR add known MCACODs here */
83 MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_OVER|MCI_UC_SAR, PANIC,
84 "Action required with lost events", SER),
85 MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCACOD, MCI_UC_SAR, PANIC,
86 "Action required; unknown MCACOD", SER),
87
88 /* known AO MCACODs: */
89 MASK(MCI_UC_SAR|MCI_STATUS_OVER|0xfff0, MCI_UC_S|0xc0, AO,
90 "Action optional: memory scrubbing error", SER),
91 MASK(MCI_UC_SAR|MCI_STATUS_OVER|MCACOD, MCI_UC_S|0x17a, AO,
92 "Action optional: last level cache writeback error", SER),
93
94 MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S, SOME,
95 "Action optional unknown MCACOD", SER),
96 MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S|MCI_STATUS_OVER, SOME,
97 "Action optional with lost events", SER),
98 BITSET(MCI_STATUS_UC|MCI_STATUS_OVER, PANIC, "Overflowed uncorrected"),
99 BITSET(MCI_STATUS_UC, UC, "Uncorrected"),
100 BITSET(0, SOME, "No match") /* always matches. keep at end */
101};
102
103/*
104 * If the EIPV bit is set, it means the saved IP is the
105 * instruction which caused the MCE.
106 */
107static int error_context(struct mce *m)
108{
109 if (m->mcgstatus & MCG_STATUS_EIPV)
110 return (m->ip && (m->cs & 3) == 3) ? IN_USER : IN_KERNEL;
111 /* Unknown, assume kernel */
112 return IN_KERNEL;
113}
114
115int mce_severity(struct mce *a, int tolerant, char **msg)
116{
117 enum context ctx = error_context(a);
118 struct severity *s;
119
120 for (s = severities;; s++) {
121 if ((a->status & s->mask) != s->result)
122 continue;
123 if ((a->mcgstatus & s->mcgmask) != s->mcgres)
124 continue;
125 if (s->ser == SER_REQUIRED && !mce_ser)
126 continue;
127 if (s->ser == NO_SER && mce_ser)
128 continue;
129 if (s->context && ctx != s->context)
130 continue;
131 if (msg)
132 *msg = s->msg;
133 s->covered = 1;
134 if (s->sev >= MCE_UC_SEVERITY && ctx == IN_KERNEL) {
135 if (panic_on_oops || tolerant < 1)
136 return MCE_PANIC_SEVERITY;
137 }
138 return s->sev;
139 }
140}
141
142static void *s_start(struct seq_file *f, loff_t *pos)
143{
144 if (*pos >= ARRAY_SIZE(severities))
145 return NULL;
146 return &severities[*pos];
147}
148
149static void *s_next(struct seq_file *f, void *data, loff_t *pos)
150{
151 if (++(*pos) >= ARRAY_SIZE(severities))
152 return NULL;
153 return &severities[*pos];
154}
155
156static void s_stop(struct seq_file *f, void *data)
157{
158}
159
160static int s_show(struct seq_file *f, void *data)
161{
162 struct severity *ser = data;
163 seq_printf(f, "%d\t%s\n", ser->covered, ser->msg);
164 return 0;
165}
166
167static const struct seq_operations severities_seq_ops = {
168 .start = s_start,
169 .next = s_next,
170 .stop = s_stop,
171 .show = s_show,
172};
173
174static int severities_coverage_open(struct inode *inode, struct file *file)
175{
176 return seq_open(file, &severities_seq_ops);
177}
178
179static ssize_t severities_coverage_write(struct file *file,
180 const char __user *ubuf,
181 size_t count, loff_t *ppos)
182{
183 int i;
184 for (i = 0; i < ARRAY_SIZE(severities); i++)
185 severities[i].covered = 0;
186 return count;
187}
188
189static const struct file_operations severities_coverage_fops = {
190 .open = severities_coverage_open,
191 .release = seq_release,
192 .read = seq_read,
193 .write = severities_coverage_write,
194};
195
196static int __init severities_debugfs_init(void)
197{
198 struct dentry *dmce = NULL, *fseverities_coverage = NULL;
199
200 dmce = debugfs_create_dir("mce", NULL);
201 if (dmce == NULL)
202 goto err_out;
203 fseverities_coverage = debugfs_create_file("severities-coverage",
204 0444, dmce, NULL,
205 &severities_coverage_fops);
206 if (fseverities_coverage == NULL)
207 goto err_out;
208
209 return 0;
210
211err_out:
212 if (fseverities_coverage)
213 debugfs_remove(fseverities_coverage);
214 if (dmce)
215 debugfs_remove(dmce);
216 return -ENOMEM;
217}
218late_initcall(severities_debugfs_init);
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
new file mode 100644
index 000000000000..fabba15e4558
--- /dev/null
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -0,0 +1,1964 @@
1/*
2 * Machine check handler.
3 *
4 * K8 parts Copyright 2002,2003 Andi Kleen, SuSE Labs.
5 * Rest from unknown author(s).
6 * 2004 Andi Kleen. Rewrote most of it.
7 * Copyright 2008 Intel Corporation
8 * Author: Andi Kleen
9 */
10#include <linux/thread_info.h>
11#include <linux/capability.h>
12#include <linux/miscdevice.h>
13#include <linux/interrupt.h>
14#include <linux/ratelimit.h>
15#include <linux/kallsyms.h>
16#include <linux/rcupdate.h>
17#include <linux/kobject.h>
18#include <linux/uaccess.h>
19#include <linux/kdebug.h>
20#include <linux/kernel.h>
21#include <linux/percpu.h>
22#include <linux/string.h>
23#include <linux/sysdev.h>
24#include <linux/delay.h>
25#include <linux/ctype.h>
26#include <linux/sched.h>
27#include <linux/sysfs.h>
28#include <linux/types.h>
29#include <linux/init.h>
30#include <linux/kmod.h>
31#include <linux/poll.h>
32#include <linux/nmi.h>
33#include <linux/cpu.h>
34#include <linux/smp.h>
35#include <linux/fs.h>
36#include <linux/mm.h>
37
38#include <asm/processor.h>
39#include <asm/hw_irq.h>
40#include <asm/apic.h>
41#include <asm/idle.h>
42#include <asm/ipi.h>
43#include <asm/mce.h>
44#include <asm/msr.h>
45
46#include "mce-internal.h"
47#include "mce.h"
48
49/* Handle unconfigured int18 (should never happen) */
50static void unexpected_machine_check(struct pt_regs *regs, long error_code)
51{
52 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
53 smp_processor_id());
54}
55
56/* Call the installed machine check handler for this CPU setup. */
57void (*machine_check_vector)(struct pt_regs *, long error_code) =
58 unexpected_machine_check;
59
60int mce_disabled;
61
62#ifdef CONFIG_X86_NEW_MCE
63
64#define MISC_MCELOG_MINOR 227
65
66#define SPINUNIT 100 /* 100ns */
67
68atomic_t mce_entry;
69
70DEFINE_PER_CPU(unsigned, mce_exception_count);
71
72/*
73 * Tolerant levels:
74 * 0: always panic on uncorrected errors, log corrected errors
75 * 1: panic or SIGBUS on uncorrected errors, log corrected errors
76 * 2: SIGBUS or log uncorrected errors (if possible), log corrected errors
77 * 3: never panic or SIGBUS, log all errors (for testing only)
78 */
79static int tolerant = 1;
80static int banks;
81static u64 *bank;
82static unsigned long notify_user;
83static int rip_msr;
84static int mce_bootlog = -1;
85static int monarch_timeout = -1;
86static int mce_panic_timeout;
87static int mce_dont_log_ce;
88int mce_cmci_disabled;
89int mce_ignore_ce;
90int mce_ser;
91
92static char trigger[128];
93static char *trigger_argv[2] = { trigger, NULL };
94
95static unsigned long dont_init_banks;
96
97static DECLARE_WAIT_QUEUE_HEAD(mce_wait);
98static DEFINE_PER_CPU(struct mce, mces_seen);
99static int cpu_missing;
100
101
102/* MCA banks polled by the period polling timer for corrected events */
103DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
104 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL
105};
106
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);
113
114/* Do initial initialization of a struct mce */
115void mce_setup(struct mce *m)
116{
117 memset(m, 0, sizeof(struct mce));
118 m->cpu = m->extcpu = smp_processor_id();
119 rdtscll(m->tsc);
120 /* We hope get_seconds stays lockless */
121 m->time = get_seconds();
122 m->cpuvendor = boot_cpu_data.x86_vendor;
123 m->cpuid = cpuid_eax(1);
124#ifdef CONFIG_SMP
125 m->socketid = cpu_data(m->extcpu).phys_proc_id;
126#endif
127 m->apicid = cpu_data(m->extcpu).initial_apicid;
128 rdmsrl(MSR_IA32_MCG_CAP, m->mcgcap);
129}
130
131DEFINE_PER_CPU(struct mce, injectm);
132EXPORT_PER_CPU_SYMBOL_GPL(injectm);
133
134/*
135 * Lockless MCE logging infrastructure.
136 * This avoids deadlocks on printk locks without having to break locks. Also
137 * separate MCEs from kernel messages to avoid bogus bug reports.
138 */
139
140static struct mce_log mcelog = {
141 .signature = MCE_LOG_SIGNATURE,
142 .len = MCE_LOG_LEN,
143 .recordlen = sizeof(struct mce),
144};
145
146void mce_log(struct mce *mce)
147{
148 unsigned next, entry;
149
150 mce->finished = 0;
151 wmb();
152 for (;;) {
153 entry = rcu_dereference(mcelog.next);
154 for (;;) {
155 /*
156 * When the buffer fills up discard new entries.
157 * Assume that the earlier errors are the more
158 * interesting ones:
159 */
160 if (entry >= MCE_LOG_LEN) {
161 set_bit(MCE_OVERFLOW,
162 (unsigned long *)&mcelog.flags);
163 return;
164 }
165 /* Old left over entry. Skip: */
166 if (mcelog.entry[entry].finished) {
167 entry++;
168 continue;
169 }
170 break;
171 }
172 smp_rmb();
173 next = entry + 1;
174 if (cmpxchg(&mcelog.next, entry, next) == entry)
175 break;
176 }
177 memcpy(mcelog.entry + entry, mce, sizeof(struct mce));
178 wmb();
179 mcelog.entry[entry].finished = 1;
180 wmb();
181
182 mce->finished = 1;
183 set_bit(0, &notify_user);
184}
185
186static void print_mce(struct mce *m)
187{
188 printk(KERN_EMERG
189 "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
190 m->extcpu, m->mcgstatus, m->bank, m->status);
191 if (m->ip) {
192 printk(KERN_EMERG "RIP%s %02x:<%016Lx> ",
193 !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
194 m->cs, m->ip);
195 if (m->cs == __KERNEL_CS)
196 print_symbol("{%s}", m->ip);
197 printk("\n");
198 }
199 printk(KERN_EMERG "TSC %llx ", m->tsc);
200 if (m->addr)
201 printk("ADDR %llx ", m->addr);
202 if (m->misc)
203 printk("MISC %llx ", m->misc);
204 printk("\n");
205 printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n",
206 m->cpuvendor, m->cpuid, m->time, m->socketid,
207 m->apicid);
208}
209
210static void print_mce_head(void)
211{
212 printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
213}
214
215static void print_mce_tail(void)
216{
217 printk(KERN_EMERG "This is not a software problem!\n"
218 KERN_EMERG "Run through mcelog --ascii to decode and contact your hardware vendor\n");
219}
220
221#define PANIC_TIMEOUT 5 /* 5 seconds */
222
223static atomic_t mce_paniced;
224
225/* Panic in progress. Enable interrupts and wait for final IPI */
226static void wait_for_panic(void)
227{
228 long timeout = PANIC_TIMEOUT*USEC_PER_SEC;
229 preempt_disable();
230 local_irq_enable();
231 while (timeout-- > 0)
232 udelay(1);
233 if (panic_timeout == 0)
234 panic_timeout = mce_panic_timeout;
235 panic("Panicing machine check CPU died");
236}
237
238static void mce_panic(char *msg, struct mce *final, char *exp)
239{
240 int i;
241
242 /*
243 * Make sure only one CPU runs in machine check panic
244 */
245 if (atomic_add_return(1, &mce_paniced) > 1)
246 wait_for_panic();
247 barrier();
248
249 bust_spinlocks(1);
250 console_verbose();
251 print_mce_head();
252 /* First print corrected ones that are still unlogged */
253 for (i = 0; i < MCE_LOG_LEN; i++) {
254 struct mce *m = &mcelog.entry[i];
255 if (!(m->status & MCI_STATUS_VAL))
256 continue;
257 if (!(m->status & MCI_STATUS_UC))
258 print_mce(m);
259 }
260 /* Now print uncorrected but with the final one last */
261 for (i = 0; i < MCE_LOG_LEN; i++) {
262 struct mce *m = &mcelog.entry[i];
263 if (!(m->status & MCI_STATUS_VAL))
264 continue;
265 if (!(m->status & MCI_STATUS_UC))
266 continue;
267 if (!final || memcmp(m, final, sizeof(struct mce)))
268 print_mce(m);
269 }
270 if (final)
271 print_mce(final);
272 if (cpu_missing)
273 printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
274 print_mce_tail();
275 if (exp)
276 printk(KERN_EMERG "Machine check: %s\n", exp);
277 if (panic_timeout == 0)
278 panic_timeout = mce_panic_timeout;
279 panic(msg);
280}
281
282/* Support code for software error injection */
283
284static int msr_to_offset(u32 msr)
285{
286 unsigned bank = __get_cpu_var(injectm.bank);
287 if (msr == rip_msr)
288 return offsetof(struct mce, ip);
289 if (msr == MSR_IA32_MC0_STATUS + bank*4)
290 return offsetof(struct mce, status);
291 if (msr == MSR_IA32_MC0_ADDR + bank*4)
292 return offsetof(struct mce, addr);
293 if (msr == MSR_IA32_MC0_MISC + bank*4)
294 return offsetof(struct mce, misc);
295 if (msr == MSR_IA32_MCG_STATUS)
296 return offsetof(struct mce, mcgstatus);
297 return -1;
298}
299
300/* MSR access wrappers used for error injection */
301static u64 mce_rdmsrl(u32 msr)
302{
303 u64 v;
304 if (__get_cpu_var(injectm).finished) {
305 int offset = msr_to_offset(msr);
306 if (offset < 0)
307 return 0;
308 return *(u64 *)((char *)&__get_cpu_var(injectm) + offset);
309 }
310 rdmsrl(msr, v);
311 return v;
312}
313
314static void mce_wrmsrl(u32 msr, u64 v)
315{
316 if (__get_cpu_var(injectm).finished) {
317 int offset = msr_to_offset(msr);
318 if (offset >= 0)
319 *(u64 *)((char *)&__get_cpu_var(injectm) + offset) = v;
320 return;
321 }
322 wrmsrl(msr, v);
323}
324
325/*
326 * Simple lockless ring to communicate PFNs from the exception handler with the
327 * process context work function. This is vastly simplified because there's
328 * only a single reader and a single writer.
329 */
330#define MCE_RING_SIZE 16 /* we use one entry less */
331
332struct mce_ring {
333 unsigned short start;
334 unsigned short end;
335 unsigned long ring[MCE_RING_SIZE];
336};
337static DEFINE_PER_CPU(struct mce_ring, mce_ring);
338
339/* Runs with CPU affinity in workqueue */
340static int mce_ring_empty(void)
341{
342 struct mce_ring *r = &__get_cpu_var(mce_ring);
343
344 return r->start == r->end;
345}
346
347static int mce_ring_get(unsigned long *pfn)
348{
349 struct mce_ring *r;
350 int ret = 0;
351
352 *pfn = 0;
353 get_cpu();
354 r = &__get_cpu_var(mce_ring);
355 if (r->start == r->end)
356 goto out;
357 *pfn = r->ring[r->start];
358 r->start = (r->start + 1) % MCE_RING_SIZE;
359 ret = 1;
360out:
361 put_cpu();
362 return ret;
363}
364
365/* Always runs in MCE context with preempt off */
366static int mce_ring_add(unsigned long pfn)
367{
368 struct mce_ring *r = &__get_cpu_var(mce_ring);
369 unsigned next;
370
371 next = (r->end + 1) % MCE_RING_SIZE;
372 if (next == r->start)
373 return -1;
374 r->ring[r->end] = pfn;
375 wmb();
376 r->end = next;
377 return 0;
378}
379
380int mce_available(struct cpuinfo_x86 *c)
381{
382 if (mce_disabled)
383 return 0;
384 return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA);
385}
386
387static void mce_schedule_work(void)
388{
389 if (!mce_ring_empty()) {
390 struct work_struct *work = &__get_cpu_var(mce_work);
391 if (!work_pending(work))
392 schedule_work(work);
393 }
394}
395
396/*
397 * Get the address of the instruction at the time of the machine check
398 * error.
399 */
400static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
401{
402
403 if (regs && (m->mcgstatus & (MCG_STATUS_RIPV|MCG_STATUS_EIPV))) {
404 m->ip = regs->ip;
405 m->cs = regs->cs;
406 } else {
407 m->ip = 0;
408 m->cs = 0;
409 }
410 if (rip_msr)
411 m->ip = mce_rdmsrl(rip_msr);
412}
413
414#ifdef CONFIG_X86_LOCAL_APIC
415/*
416 * Called after interrupts have been reenabled again
417 * when a MCE happened during an interrupts off region
418 * in the kernel.
419 */
420asmlinkage void smp_mce_self_interrupt(struct pt_regs *regs)
421{
422 ack_APIC_irq();
423 exit_idle();
424 irq_enter();
425 mce_notify_irq();
426 mce_schedule_work();
427 irq_exit();
428}
429#endif
430
431static void mce_report_event(struct pt_regs *regs)
432{
433 if (regs->flags & (X86_VM_MASK|X86_EFLAGS_IF)) {
434 mce_notify_irq();
435 /*
436 * Triggering the work queue here is just an insurance
437 * policy in case the syscall exit notify handler
438 * doesn't run soon enough or ends up running on the
439 * wrong CPU (can happen when audit sleeps)
440 */
441 mce_schedule_work();
442 return;
443 }
444
445#ifdef CONFIG_X86_LOCAL_APIC
446 /*
447 * Without APIC do not notify. The event will be picked
448 * up eventually.
449 */
450 if (!cpu_has_apic)
451 return;
452
453 /*
454 * When interrupts are disabled we cannot use
455 * kernel services safely. Trigger an self interrupt
456 * through the APIC to instead do the notification
457 * after interrupts are reenabled again.
458 */
459 apic->send_IPI_self(MCE_SELF_VECTOR);
460
461 /*
462 * Wait for idle afterwards again so that we don't leave the
463 * APIC in a non idle state because the normal APIC writes
464 * cannot exclude us.
465 */
466 apic_wait_icr_idle();
467#endif
468}
469
470DEFINE_PER_CPU(unsigned, mce_poll_count);
471
472/*
473 * Poll for corrected events or events that happened before reset.
474 * Those are just logged through /dev/mcelog.
475 *
476 * This is executed in standard interrupt context.
477 *
478 * Note: spec recommends to panic for fatal unsignalled
479 * errors here. However this would be quite problematic --
480 * we would need to reimplement the Monarch handling and
481 * it would mess up the exclusion between exception handler
482 * and poll hander -- * so we skip this for now.
483 * These cases should not happen anyways, or only when the CPU
484 * is already totally * confused. In this case it's likely it will
485 * not fully execute the machine check handler either.
486 */
487void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
488{
489 struct mce m;
490 int i;
491
492 __get_cpu_var(mce_poll_count)++;
493
494 mce_setup(&m);
495
496 m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
497 for (i = 0; i < banks; i++) {
498 if (!bank[i] || !test_bit(i, *b))
499 continue;
500
501 m.misc = 0;
502 m.addr = 0;
503 m.bank = i;
504 m.tsc = 0;
505
506 barrier();
507 m.status = mce_rdmsrl(MSR_IA32_MC0_STATUS + i*4);
508 if (!(m.status & MCI_STATUS_VAL))
509 continue;
510
511 /*
512 * Uncorrected or signalled events are handled by the exception
513 * handler when it is enabled, so don't process those here.
514 *
515 * TBD do the same check for MCI_STATUS_EN here?
516 */
517 if (!(flags & MCP_UC) &&
518 (m.status & (mce_ser ? MCI_STATUS_S : MCI_STATUS_UC)))
519 continue;
520
521 if (m.status & MCI_STATUS_MISCV)
522 m.misc = mce_rdmsrl(MSR_IA32_MC0_MISC + i*4);
523 if (m.status & MCI_STATUS_ADDRV)
524 m.addr = mce_rdmsrl(MSR_IA32_MC0_ADDR + i*4);
525
526 if (!(flags & MCP_TIMESTAMP))
527 m.tsc = 0;
528 /*
529 * Don't get the IP here because it's unlikely to
530 * have anything to do with the actual error location.
531 */
532 if (!(flags & MCP_DONTLOG) && !mce_dont_log_ce) {
533 mce_log(&m);
534 add_taint(TAINT_MACHINE_CHECK);
535 }
536
537 /*
538 * Clear state for this bank.
539 */
540 mce_wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
541 }
542
543 /*
544 * Don't clear MCG_STATUS here because it's only defined for
545 * exceptions.
546 */
547
548 sync_core();
549}
550EXPORT_SYMBOL_GPL(machine_check_poll);
551
552/*
553 * Do a quick check if any of the events requires a panic.
554 * This decides if we keep the events around or clear them.
555 */
556static int mce_no_way_out(struct mce *m, char **msg)
557{
558 int i;
559
560 for (i = 0; i < banks; i++) {
561 m->status = mce_rdmsrl(MSR_IA32_MC0_STATUS + i*4);
562 if (mce_severity(m, tolerant, msg) >= MCE_PANIC_SEVERITY)
563 return 1;
564 }
565 return 0;
566}
567
568/*
569 * Variable to establish order between CPUs while scanning.
570 * Each CPU spins initially until executing is equal its number.
571 */
572static atomic_t mce_executing;
573
574/*
575 * Defines order of CPUs on entry. First CPU becomes Monarch.
576 */
577static atomic_t mce_callin;
578
579/*
580 * Check if a timeout waiting for other CPUs happened.
581 */
582static int mce_timed_out(u64 *t)
583{
584 /*
585 * The others already did panic for some reason.
586 * Bail out like in a timeout.
587 * rmb() to tell the compiler that system_state
588 * might have been modified by someone else.
589 */
590 rmb();
591 if (atomic_read(&mce_paniced))
592 wait_for_panic();
593 if (!monarch_timeout)
594 goto out;
595 if ((s64)*t < SPINUNIT) {
596 /* CHECKME: Make panic default for 1 too? */
597 if (tolerant < 1)
598 mce_panic("Timeout synchronizing machine check over CPUs",
599 NULL, NULL);
600 cpu_missing = 1;
601 return 1;
602 }
603 *t -= SPINUNIT;
604out:
605 touch_nmi_watchdog();
606 return 0;
607}
608
609/*
610 * The Monarch's reign. The Monarch is the CPU who entered
611 * the machine check handler first. It waits for the others to
612 * raise the exception too and then grades them. When any
613 * error is fatal panic. Only then let the others continue.
614 *
615 * The other CPUs entering the MCE handler will be controlled by the
616 * Monarch. They are called Subjects.
617 *
618 * This way we prevent any potential data corruption in a unrecoverable case
619 * and also makes sure always all CPU's errors are examined.
620 *
621 * Also this detects the case of an machine check event coming from outer
622 * space (not detected by any CPUs) In this case some external agent wants
623 * us to shut down, so panic too.
624 *
625 * The other CPUs might still decide to panic if the handler happens
626 * in a unrecoverable place, but in this case the system is in a semi-stable
627 * state and won't corrupt anything by itself. It's ok to let the others
628 * continue for a bit first.
629 *
630 * All the spin loops have timeouts; when a timeout happens a CPU
631 * typically elects itself to be Monarch.
632 */
633static void mce_reign(void)
634{
635 int cpu;
636 struct mce *m = NULL;
637 int global_worst = 0;
638 char *msg = NULL;
639 char *nmsg = NULL;
640
641 /*
642 * This CPU is the Monarch and the other CPUs have run
643 * through their handlers.
644 * Grade the severity of the errors of all the CPUs.
645 */
646 for_each_possible_cpu(cpu) {
647 int severity = mce_severity(&per_cpu(mces_seen, cpu), tolerant,
648 &nmsg);
649 if (severity > global_worst) {
650 msg = nmsg;
651 global_worst = severity;
652 m = &per_cpu(mces_seen, cpu);
653 }
654 }
655
656 /*
657 * Cannot recover? Panic here then.
658 * This dumps all the mces in the log buffer and stops the
659 * other CPUs.
660 */
661 if (m && global_worst >= MCE_PANIC_SEVERITY && tolerant < 3)
662 mce_panic("Fatal Machine check", m, msg);
663
664 /*
665 * For UC somewhere we let the CPU who detects it handle it.
666 * Also must let continue the others, otherwise the handling
667 * CPU could deadlock on a lock.
668 */
669
670 /*
671 * No machine check event found. Must be some external
672 * source or one CPU is hung. Panic.
673 */
674 if (!m && tolerant < 3)
675 mce_panic("Machine check from unknown source", NULL, NULL);
676
677 /*
678 * Now clear all the mces_seen so that they don't reappear on
679 * the next mce.
680 */
681 for_each_possible_cpu(cpu)
682 memset(&per_cpu(mces_seen, cpu), 0, sizeof(struct mce));
683}
684
685static atomic_t global_nwo;
686
687/*
688 * Start of Monarch synchronization. This waits until all CPUs have
689 * entered the exception handler and then determines if any of them
690 * saw a fatal event that requires panic. Then it executes them
691 * in the entry order.
692 * TBD double check parallel CPU hotunplug
693 */
694static int mce_start(int no_way_out, int *order)
695{
696 int nwo;
697 int cpus = num_online_cpus();
698 u64 timeout = (u64)monarch_timeout * NSEC_PER_USEC;
699
700 if (!timeout) {
701 *order = -1;
702 return no_way_out;
703 }
704
705 atomic_add(no_way_out, &global_nwo);
706
707 /*
708 * Wait for everyone.
709 */
710 while (atomic_read(&mce_callin) != cpus) {
711 if (mce_timed_out(&timeout)) {
712 atomic_set(&global_nwo, 0);
713 *order = -1;
714 return no_way_out;
715 }
716 ndelay(SPINUNIT);
717 }
718
719 /*
720 * Cache the global no_way_out state.
721 */
722 nwo = atomic_read(&global_nwo);
723
724 /*
725 * Monarch starts executing now, the others wait.
726 */
727 if (*order == 1) {
728 atomic_set(&mce_executing, 1);
729 return nwo;
730 }
731
732 /*
733 * Now start the scanning loop one by one
734 * in the original callin order.
735 * This way when there are any shared banks it will
736 * be only seen by one CPU before cleared, avoiding duplicates.
737 */
738 while (atomic_read(&mce_executing) < *order) {
739 if (mce_timed_out(&timeout)) {
740 atomic_set(&global_nwo, 0);
741 *order = -1;
742 return no_way_out;
743 }
744 ndelay(SPINUNIT);
745 }
746 return nwo;
747}
748
749/*
750 * Synchronize between CPUs after main scanning loop.
751 * This invokes the bulk of the Monarch processing.
752 */
753static int mce_end(int order)
754{
755 int ret = -1;
756 u64 timeout = (u64)monarch_timeout * NSEC_PER_USEC;
757
758 if (!timeout)
759 goto reset;
760 if (order < 0)
761 goto reset;
762
763 /*
764 * Allow others to run.
765 */
766 atomic_inc(&mce_executing);
767
768 if (order == 1) {
769 /* CHECKME: Can this race with a parallel hotplug? */
770 int cpus = num_online_cpus();
771
772 /*
773 * Monarch: Wait for everyone to go through their scanning
774 * loops.
775 */
776 while (atomic_read(&mce_executing) <= cpus) {
777 if (mce_timed_out(&timeout))
778 goto reset;
779 ndelay(SPINUNIT);
780 }
781
782 mce_reign();
783 barrier();
784 ret = 0;
785 } else {
786 /*
787 * Subject: Wait for Monarch to finish.
788 */
789 while (atomic_read(&mce_executing) != 0) {
790 if (mce_timed_out(&timeout))
791 goto reset;
792 ndelay(SPINUNIT);
793 }
794
795 /*
796 * Don't reset anything. That's done by the Monarch.
797 */
798 return 0;
799 }
800
801 /*
802 * Reset all global state.
803 */
804reset:
805 atomic_set(&global_nwo, 0);
806 atomic_set(&mce_callin, 0);
807 barrier();
808
809 /*
810 * Let others run again.
811 */
812 atomic_set(&mce_executing, 0);
813 return ret;
814}
815
816/*
817 * Check if the address reported by the CPU is in a format we can parse.
818 * It would be possible to add code for most other cases, but all would
819 * be somewhat complicated (e.g. segment offset would require an instruction
820 * parser). So only support physical addresses upto page granuality for now.
821 */
822static int mce_usable_address(struct mce *m)
823{
824 if (!(m->status & MCI_STATUS_MISCV) || !(m->status & MCI_STATUS_ADDRV))
825 return 0;
826 if ((m->misc & 0x3f) > PAGE_SHIFT)
827 return 0;
828 if (((m->misc >> 6) & 7) != MCM_ADDR_PHYS)
829 return 0;
830 return 1;
831}
832
833static void mce_clear_state(unsigned long *toclear)
834{
835 int i;
836
837 for (i = 0; i < banks; i++) {
838 if (test_bit(i, toclear))
839 mce_wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
840 }
841}
842
843/*
844 * The actual machine check handler. This only handles real
845 * exceptions when something got corrupted coming in through int 18.
846 *
847 * This is executed in NMI context not subject to normal locking rules. This
848 * implies that most kernel services cannot be safely used. Don't even
849 * think about putting a printk in there!
850 *
851 * On Intel systems this is entered on all CPUs in parallel through
852 * MCE broadcast. However some CPUs might be broken beyond repair,
853 * so be always careful when synchronizing with others.
854 */
855void do_machine_check(struct pt_regs *regs, long error_code)
856{
857 struct mce m, *final;
858 int i;
859 int worst = 0;
860 int severity;
861 /*
862 * Establish sequential order between the CPUs entering the machine
863 * check handler.
864 */
865 int order;
866
867 /*
868 * If no_way_out gets set, there is no safe way to recover from this
869 * MCE. If tolerant is cranked up, we'll try anyway.
870 */
871 int no_way_out = 0;
872 /*
873 * If kill_it gets set, there might be a way to recover from this
874 * error.
875 */
876 int kill_it = 0;
877 DECLARE_BITMAP(toclear, MAX_NR_BANKS);
878 char *msg = "Unknown";
879
880 atomic_inc(&mce_entry);
881
882 __get_cpu_var(mce_exception_count)++;
883
884 if (notify_die(DIE_NMI, "machine check", regs, error_code,
885 18, SIGKILL) == NOTIFY_STOP)
886 goto out;
887 if (!banks)
888 goto out;
889
890 order = atomic_add_return(1, &mce_callin);
891 mce_setup(&m);
892
893 m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
894 no_way_out = mce_no_way_out(&m, &msg);
895
896 final = &__get_cpu_var(mces_seen);
897 *final = m;
898
899 barrier();
900
901 /*
902 * When no restart IP must always kill or panic.
903 */
904 if (!(m.mcgstatus & MCG_STATUS_RIPV))
905 kill_it = 1;
906
907 /*
908 * Go through all the banks in exclusion of the other CPUs.
909 * This way we don't report duplicated events on shared banks
910 * because the first one to see it will clear it.
911 */
912 no_way_out = mce_start(no_way_out, &order);
913 for (i = 0; i < banks; i++) {
914 __clear_bit(i, toclear);
915 if (!bank[i])
916 continue;
917
918 m.misc = 0;
919 m.addr = 0;
920 m.bank = i;
921
922 m.status = mce_rdmsrl(MSR_IA32_MC0_STATUS + i*4);
923 if ((m.status & MCI_STATUS_VAL) == 0)
924 continue;
925
926 /*
927 * Non uncorrected or non signaled errors are handled by
928 * machine_check_poll. Leave them alone, unless this panics.
929 */
930 if (!(m.status & (mce_ser ? MCI_STATUS_S : MCI_STATUS_UC)) &&
931 !no_way_out)
932 continue;
933
934 /*
935 * Set taint even when machine check was not enabled.
936 */
937 add_taint(TAINT_MACHINE_CHECK);
938
939 severity = mce_severity(&m, tolerant, NULL);
940
941 /*
942 * When machine check was for corrected handler don't touch,
943 * unless we're panicing.
944 */
945 if (severity == MCE_KEEP_SEVERITY && !no_way_out)
946 continue;
947 __set_bit(i, toclear);
948 if (severity == MCE_NO_SEVERITY) {
949 /*
950 * Machine check event was not enabled. Clear, but
951 * ignore.
952 */
953 continue;
954 }
955
956 /*
957 * Kill on action required.
958 */
959 if (severity == MCE_AR_SEVERITY)
960 kill_it = 1;
961
962 if (m.status & MCI_STATUS_MISCV)
963 m.misc = mce_rdmsrl(MSR_IA32_MC0_MISC + i*4);
964 if (m.status & MCI_STATUS_ADDRV)
965 m.addr = mce_rdmsrl(MSR_IA32_MC0_ADDR + i*4);
966
967 /*
968 * Action optional error. Queue address for later processing.
969 * When the ring overflows we just ignore the AO error.
970 * RED-PEN add some logging mechanism when
971 * usable_address or mce_add_ring fails.
972 * RED-PEN don't ignore overflow for tolerant == 0
973 */
974 if (severity == MCE_AO_SEVERITY && mce_usable_address(&m))
975 mce_ring_add(m.addr >> PAGE_SHIFT);
976
977 mce_get_rip(&m, regs);
978 mce_log(&m);
979
980 if (severity > worst) {
981 *final = m;
982 worst = severity;
983 }
984 }
985
986 if (!no_way_out)
987 mce_clear_state(toclear);
988
989 /*
990 * Do most of the synchronization with other CPUs.
991 * When there's any problem use only local no_way_out state.
992 */
993 if (mce_end(order) < 0)
994 no_way_out = worst >= MCE_PANIC_SEVERITY;
995
996 /*
997 * If we have decided that we just CAN'T continue, and the user
998 * has not set tolerant to an insane level, give up and die.
999 *
1000 * This is mainly used in the case when the system doesn't
1001 * support MCE broadcasting or it has been disabled.
1002 */
1003 if (no_way_out && tolerant < 3)
1004 mce_panic("Fatal machine check on current CPU", final, msg);
1005
1006 /*
1007 * If the error seems to be unrecoverable, something should be
1008 * done. Try to kill as little as possible. If we can kill just
1009 * one task, do that. If the user has set the tolerance very
1010 * high, don't try to do anything at all.
1011 */
1012
1013 if (kill_it && tolerant < 3)
1014 force_sig(SIGBUS, current);
1015
1016 /* notify userspace ASAP */
1017 set_thread_flag(TIF_MCE_NOTIFY);
1018
1019 if (worst > 0)
1020 mce_report_event(regs);
1021 mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
1022out:
1023 atomic_dec(&mce_entry);
1024 sync_core();
1025}
1026EXPORT_SYMBOL_GPL(do_machine_check);
1027
1028/* dummy to break dependency. actual code is in mm/memory-failure.c */
1029void __attribute__((weak)) memory_failure(unsigned long pfn, int vector)
1030{
1031 printk(KERN_ERR "Action optional memory failure at %lx ignored\n", pfn);
1032}
1033
1034/*
1035 * Called after mce notification in process context. This code
1036 * is allowed to sleep. Call the high level VM handler to process
1037 * any corrupted pages.
1038 * Assume that the work queue code only calls this one at a time
1039 * per CPU.
1040 * Note we don't disable preemption, so this code might run on the wrong
1041 * CPU. In this case the event is picked up by the scheduled work queue.
1042 * This is merely a fast path to expedite processing in some common
1043 * cases.
1044 */
1045void mce_notify_process(void)
1046{
1047 unsigned long pfn;
1048 mce_notify_irq();
1049 while (mce_ring_get(&pfn))
1050 memory_failure(pfn, MCE_VECTOR);
1051}
1052
1053static void mce_process_work(struct work_struct *dummy)
1054{
1055 mce_notify_process();
1056}
1057
1058#ifdef CONFIG_X86_MCE_INTEL
1059/***
1060 * mce_log_therm_throt_event - Logs the thermal throttling event to mcelog
1061 * @cpu: The CPU on which the event occurred.
1062 * @status: Event status information
1063 *
1064 * This function should be called by the thermal interrupt after the
1065 * event has been processed and the decision was made to log the event
1066 * further.
1067 *
1068 * The status parameter will be saved to the 'status' field of 'struct mce'
1069 * and historically has been the register value of the
1070 * MSR_IA32_THERMAL_STATUS (Intel) msr.
1071 */
1072void mce_log_therm_throt_event(__u64 status)
1073{
1074 struct mce m;
1075
1076 mce_setup(&m);
1077 m.bank = MCE_THERMAL_BANK;
1078 m.status = status;
1079 mce_log(&m);
1080}
1081#endif /* CONFIG_X86_MCE_INTEL */
1082
1083/*
1084 * Periodic polling timer for "silent" machine check errors. If the
1085 * poller finds an MCE, poll 2x faster. When the poller finds no more
1086 * errors, poll 2x slower (up to check_interval seconds).
1087 */
1088static int check_interval = 5 * 60; /* 5 minutes */
1089
1090static DEFINE_PER_CPU(int, next_interval); /* in jiffies */
1091static DEFINE_PER_CPU(struct timer_list, mce_timer);
1092
1093static void mcheck_timer(unsigned long data)
1094{
1095 struct timer_list *t = &per_cpu(mce_timer, data);
1096 int *n;
1097
1098 WARN_ON(smp_processor_id() != data);
1099
1100 if (mce_available(&current_cpu_data)) {
1101 machine_check_poll(MCP_TIMESTAMP,
1102 &__get_cpu_var(mce_poll_banks));
1103 }
1104
1105 /*
1106 * Alert userspace if needed. If we logged an MCE, reduce the
1107 * polling interval, otherwise increase the polling interval.
1108 */
1109 n = &__get_cpu_var(next_interval);
1110 if (mce_notify_irq())
1111 *n = max(*n/2, HZ/100);
1112 else
1113 *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ));
1114
1115 t->expires = jiffies + *n;
1116 add_timer(t);
1117}
1118
1119static void mce_do_trigger(struct work_struct *work)
1120{
1121 call_usermodehelper(trigger, trigger_argv, NULL, UMH_NO_WAIT);
1122}
1123
1124static DECLARE_WORK(mce_trigger_work, mce_do_trigger);
1125
1126/*
1127 * Notify the user(s) about new machine check events.
1128 * Can be called from interrupt context, but not from machine check/NMI
1129 * context.
1130 */
1131int mce_notify_irq(void)
1132{
1133 /* Not more than two messages every minute */
1134 static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
1135
1136 clear_thread_flag(TIF_MCE_NOTIFY);
1137
1138 if (test_and_clear_bit(0, &notify_user)) {
1139 wake_up_interruptible(&mce_wait);
1140
1141 /*
1142 * There is no risk of missing notifications because
1143 * work_pending is always cleared before the function is
1144 * executed.
1145 */
1146 if (trigger[0] && !work_pending(&mce_trigger_work))
1147 schedule_work(&mce_trigger_work);
1148
1149 if (__ratelimit(&ratelimit))
1150 printk(KERN_INFO "Machine check events logged\n");
1151
1152 return 1;
1153 }
1154 return 0;
1155}
1156EXPORT_SYMBOL_GPL(mce_notify_irq);
1157
1158/*
1159 * Initialize Machine Checks for a CPU.
1160 */
1161static int mce_cap_init(void)
1162{
1163 unsigned b;
1164 u64 cap;
1165
1166 rdmsrl(MSR_IA32_MCG_CAP, cap);
1167
1168 b = cap & MCG_BANKCNT_MASK;
1169 printk(KERN_INFO "mce: CPU supports %d MCE banks\n", b);
1170
1171 if (b > MAX_NR_BANKS) {
1172 printk(KERN_WARNING
1173 "MCE: Using only %u machine check banks out of %u\n",
1174 MAX_NR_BANKS, b);
1175 b = MAX_NR_BANKS;
1176 }
1177
1178 /* Don't support asymmetric configurations today */
1179 WARN_ON(banks != 0 && b != banks);
1180 banks = b;
1181 if (!bank) {
1182 bank = kmalloc(banks * sizeof(u64), GFP_KERNEL);
1183 if (!bank)
1184 return -ENOMEM;
1185 memset(bank, 0xff, banks * sizeof(u64));
1186 }
1187
1188 /* Use accurate RIP reporting if available. */
1189 if ((cap & MCG_EXT_P) && MCG_EXT_CNT(cap) >= 9)
1190 rip_msr = MSR_IA32_MCG_EIP;
1191
1192 if (cap & MCG_SER_P)
1193 mce_ser = 1;
1194
1195 return 0;
1196}
1197
1198static void mce_init(void)
1199{
1200 mce_banks_t all_banks;
1201 u64 cap;
1202 int i;
1203
1204 /*
1205 * Log the machine checks left over from the previous reset.
1206 */
1207 bitmap_fill(all_banks, MAX_NR_BANKS);
1208 machine_check_poll(MCP_UC|(!mce_bootlog ? MCP_DONTLOG : 0), &all_banks);
1209
1210 set_in_cr4(X86_CR4_MCE);
1211
1212 rdmsrl(MSR_IA32_MCG_CAP, cap);
1213 if (cap & MCG_CTL_P)
1214 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
1215
1216 for (i = 0; i < banks; i++) {
1217 if (skip_bank_init(i))
1218 continue;
1219 wrmsrl(MSR_IA32_MC0_CTL+4*i, bank[i]);
1220 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
1221 }
1222}
1223
1224/* Add per CPU specific workarounds here */
1225static void mce_cpu_quirks(struct cpuinfo_x86 *c)
1226{
1227 /* This should be disabled by the BIOS, but isn't always */
1228 if (c->x86_vendor == X86_VENDOR_AMD) {
1229 if (c->x86 == 15 && banks > 4) {
1230 /*
1231 * disable GART TBL walk error reporting, which
1232 * trips off incorrectly with the IOMMU & 3ware
1233 * & Cerberus:
1234 */
1235 clear_bit(10, (unsigned long *)&bank[4]);
1236 }
1237 if (c->x86 <= 17 && mce_bootlog < 0) {
1238 /*
1239 * Lots of broken BIOS around that don't clear them
1240 * by default and leave crap in there. Don't log:
1241 */
1242 mce_bootlog = 0;
1243 }
1244 /*
1245 * Various K7s with broken bank 0 around. Always disable
1246 * by default.
1247 */
1248 if (c->x86 == 6)
1249 bank[0] = 0;
1250 }
1251
1252 if (c->x86_vendor == X86_VENDOR_INTEL) {
1253 /*
1254 * SDM documents that on family 6 bank 0 should not be written
1255 * because it aliases to another special BIOS controlled
1256 * register.
1257 * But it's not aliased anymore on model 0x1a+
1258 * Don't ignore bank 0 completely because there could be a
1259 * valid event later, merely don't write CTL0.
1260 */
1261
1262 if (c->x86 == 6 && c->x86_model < 0x1A)
1263 __set_bit(0, &dont_init_banks);
1264
1265 /*
1266 * All newer Intel systems support MCE broadcasting. Enable
1267 * synchronization with a one second timeout.
1268 */
1269 if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xe)) &&
1270 monarch_timeout < 0)
1271 monarch_timeout = USEC_PER_SEC;
1272 }
1273 if (monarch_timeout < 0)
1274 monarch_timeout = 0;
1275 if (mce_bootlog != 0)
1276 mce_panic_timeout = 30;
1277}
1278
1279static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c)
1280{
1281 if (c->x86 != 5)
1282 return;
1283 switch (c->x86_vendor) {
1284 case X86_VENDOR_INTEL:
1285 if (mce_p5_enabled())
1286 intel_p5_mcheck_init(c);
1287 break;
1288 case X86_VENDOR_CENTAUR:
1289 winchip_mcheck_init(c);
1290 break;
1291 }
1292}
1293
1294static void mce_cpu_features(struct cpuinfo_x86 *c)
1295{
1296 switch (c->x86_vendor) {
1297 case X86_VENDOR_INTEL:
1298 mce_intel_feature_init(c);
1299 break;
1300 case X86_VENDOR_AMD:
1301 mce_amd_feature_init(c);
1302 break;
1303 default:
1304 break;
1305 }
1306}
1307
1308static void mce_init_timer(void)
1309{
1310 struct timer_list *t = &__get_cpu_var(mce_timer);
1311 int *n = &__get_cpu_var(next_interval);
1312
1313 if (mce_ignore_ce)
1314 return;
1315
1316 *n = check_interval * HZ;
1317 if (!*n)
1318 return;
1319 setup_timer(t, mcheck_timer, smp_processor_id());
1320 t->expires = round_jiffies(jiffies + *n);
1321 add_timer(t);
1322}
1323
1324/*
1325 * Called for each booted CPU to set up machine checks.
1326 * Must be called with preempt off:
1327 */
1328void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
1329{
1330 if (mce_disabled)
1331 return;
1332
1333 mce_ancient_init(c);
1334
1335 if (!mce_available(c))
1336 return;
1337
1338 if (mce_cap_init() < 0) {
1339 mce_disabled = 1;
1340 return;
1341 }
1342 mce_cpu_quirks(c);
1343
1344 machine_check_vector = do_machine_check;
1345
1346 mce_init();
1347 mce_cpu_features(c);
1348 mce_init_timer();
1349 INIT_WORK(&__get_cpu_var(mce_work), mce_process_work);
1350}
1351
1352/*
1353 * Character device to read and clear the MCE log.
1354 */
1355
1356static DEFINE_SPINLOCK(mce_state_lock);
1357static int open_count; /* #times opened */
1358static int open_exclu; /* already open exclusive? */
1359
1360static int mce_open(struct inode *inode, struct file *file)
1361{
1362 spin_lock(&mce_state_lock);
1363
1364 if (open_exclu || (open_count && (file->f_flags & O_EXCL))) {
1365 spin_unlock(&mce_state_lock);
1366
1367 return -EBUSY;
1368 }
1369
1370 if (file->f_flags & O_EXCL)
1371 open_exclu = 1;
1372 open_count++;
1373
1374 spin_unlock(&mce_state_lock);
1375
1376 return nonseekable_open(inode, file);
1377}
1378
1379static int mce_release(struct inode *inode, struct file *file)
1380{
1381 spin_lock(&mce_state_lock);
1382
1383 open_count--;
1384 open_exclu = 0;
1385
1386 spin_unlock(&mce_state_lock);
1387
1388 return 0;
1389}
1390
1391static void collect_tscs(void *data)
1392{
1393 unsigned long *cpu_tsc = (unsigned long *)data;
1394
1395 rdtscll(cpu_tsc[smp_processor_id()]);
1396}
1397
1398static DEFINE_MUTEX(mce_read_mutex);
1399
1400static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
1401 loff_t *off)
1402{
1403 char __user *buf = ubuf;
1404 unsigned long *cpu_tsc;
1405 unsigned prev, next;
1406 int i, err;
1407
1408 cpu_tsc = kmalloc(nr_cpu_ids * sizeof(long), GFP_KERNEL);
1409 if (!cpu_tsc)
1410 return -ENOMEM;
1411
1412 mutex_lock(&mce_read_mutex);
1413 next = rcu_dereference(mcelog.next);
1414
1415 /* Only supports full reads right now */
1416 if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) {
1417 mutex_unlock(&mce_read_mutex);
1418 kfree(cpu_tsc);
1419
1420 return -EINVAL;
1421 }
1422
1423 err = 0;
1424 prev = 0;
1425 do {
1426 for (i = prev; i < next; i++) {
1427 unsigned long start = jiffies;
1428
1429 while (!mcelog.entry[i].finished) {
1430 if (time_after_eq(jiffies, start + 2)) {
1431 memset(mcelog.entry + i, 0,
1432 sizeof(struct mce));
1433 goto timeout;
1434 }
1435 cpu_relax();
1436 }
1437 smp_rmb();
1438 err |= copy_to_user(buf, mcelog.entry + i,
1439 sizeof(struct mce));
1440 buf += sizeof(struct mce);
1441timeout:
1442 ;
1443 }
1444
1445 memset(mcelog.entry + prev, 0,
1446 (next - prev) * sizeof(struct mce));
1447 prev = next;
1448 next = cmpxchg(&mcelog.next, prev, 0);
1449 } while (next != prev);
1450
1451 synchronize_sched();
1452
1453 /*
1454 * Collect entries that were still getting written before the
1455 * synchronize.
1456 */
1457 on_each_cpu(collect_tscs, cpu_tsc, 1);
1458
1459 for (i = next; i < MCE_LOG_LEN; i++) {
1460 if (mcelog.entry[i].finished &&
1461 mcelog.entry[i].tsc < cpu_tsc[mcelog.entry[i].cpu]) {
1462 err |= copy_to_user(buf, mcelog.entry+i,
1463 sizeof(struct mce));
1464 smp_rmb();
1465 buf += sizeof(struct mce);
1466 memset(&mcelog.entry[i], 0, sizeof(struct mce));
1467 }
1468 }
1469 mutex_unlock(&mce_read_mutex);
1470 kfree(cpu_tsc);
1471
1472 return err ? -EFAULT : buf - ubuf;
1473}
1474
1475static unsigned int mce_poll(struct file *file, poll_table *wait)
1476{
1477 poll_wait(file, &mce_wait, wait);
1478 if (rcu_dereference(mcelog.next))
1479 return POLLIN | POLLRDNORM;
1480 return 0;
1481}
1482
1483static long mce_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
1484{
1485 int __user *p = (int __user *)arg;
1486
1487 if (!capable(CAP_SYS_ADMIN))
1488 return -EPERM;
1489
1490 switch (cmd) {
1491 case MCE_GET_RECORD_LEN:
1492 return put_user(sizeof(struct mce), p);
1493 case MCE_GET_LOG_LEN:
1494 return put_user(MCE_LOG_LEN, p);
1495 case MCE_GETCLEAR_FLAGS: {
1496 unsigned flags;
1497
1498 do {
1499 flags = mcelog.flags;
1500 } while (cmpxchg(&mcelog.flags, flags, 0) != flags);
1501
1502 return put_user(flags, p);
1503 }
1504 default:
1505 return -ENOTTY;
1506 }
1507}
1508
1509/* Modified in mce-inject.c, so not static or const */
1510struct file_operations mce_chrdev_ops = {
1511 .open = mce_open,
1512 .release = mce_release,
1513 .read = mce_read,
1514 .poll = mce_poll,
1515 .unlocked_ioctl = mce_ioctl,
1516};
1517EXPORT_SYMBOL_GPL(mce_chrdev_ops);
1518
1519static struct miscdevice mce_log_device = {
1520 MISC_MCELOG_MINOR,
1521 "mcelog",
1522 &mce_chrdev_ops,
1523};
1524
1525/*
1526 * mce=off Disables machine check
1527 * mce=no_cmci Disables CMCI
1528 * mce=dont_log_ce Clears corrected events silently, no log created for CEs.
1529 * mce=ignore_ce Disables polling and CMCI, corrected events are not cleared.
1530 * mce=TOLERANCELEVEL[,monarchtimeout] (number, see above)
1531 * monarchtimeout is how long to wait for other CPUs on machine
1532 * check, or 0 to not wait
1533 * mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
1534 * mce=nobootlog Don't log MCEs from before booting.
1535 */
1536static int __init mcheck_enable(char *str)
1537{
1538 if (*str == 0)
1539 enable_p5_mce();
1540 if (*str == '=')
1541 str++;
1542 if (!strcmp(str, "off"))
1543 mce_disabled = 1;
1544 else if (!strcmp(str, "no_cmci"))
1545 mce_cmci_disabled = 1;
1546 else if (!strcmp(str, "dont_log_ce"))
1547 mce_dont_log_ce = 1;
1548 else if (!strcmp(str, "ignore_ce"))
1549 mce_ignore_ce = 1;
1550 else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
1551 mce_bootlog = (str[0] == 'b');
1552 else if (isdigit(str[0])) {
1553 get_option(&str, &tolerant);
1554 if (*str == ',') {
1555 ++str;
1556 get_option(&str, &monarch_timeout);
1557 }
1558 } else {
1559 printk(KERN_INFO "mce argument %s ignored. Please use /sys\n",
1560 str);
1561 return 0;
1562 }
1563 return 1;
1564}
1565__setup("mce", mcheck_enable);
1566
1567/*
1568 * Sysfs support
1569 */
1570
1571/*
1572 * Disable machine checks on suspend and shutdown. We can't really handle
1573 * them later.
1574 */
1575static int mce_disable(void)
1576{
1577 int i;
1578
1579 for (i = 0; i < banks; i++) {
1580 if (!skip_bank_init(i))
1581 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
1582 }
1583 return 0;
1584}
1585
1586static int mce_suspend(struct sys_device *dev, pm_message_t state)
1587{
1588 return mce_disable();
1589}
1590
1591static int mce_shutdown(struct sys_device *dev)
1592{
1593 return mce_disable();
1594}
1595
1596/*
1597 * On resume clear all MCE state. Don't want to see leftovers from the BIOS.
1598 * Only one CPU is active at this time, the others get re-added later using
1599 * CPU hotplug:
1600 */
1601static int mce_resume(struct sys_device *dev)
1602{
1603 mce_init();
1604 mce_cpu_features(&current_cpu_data);
1605
1606 return 0;
1607}
1608
1609static void mce_cpu_restart(void *data)
1610{
1611 del_timer_sync(&__get_cpu_var(mce_timer));
1612 if (mce_available(&current_cpu_data))
1613 mce_init();
1614 mce_init_timer();
1615}
1616
1617/* Reinit MCEs after user configuration changes */
1618static void mce_restart(void)
1619{
1620 on_each_cpu(mce_cpu_restart, NULL, 1);
1621}
1622
1623static struct sysdev_class mce_sysclass = {
1624 .suspend = mce_suspend,
1625 .shutdown = mce_shutdown,
1626 .resume = mce_resume,
1627 .name = "machinecheck",
1628};
1629
1630DEFINE_PER_CPU(struct sys_device, mce_dev);
1631
1632__cpuinitdata
1633void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
1634
1635static struct sysdev_attribute *bank_attrs;
1636
1637static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr,
1638 char *buf)
1639{
1640 u64 b = bank[attr - bank_attrs];
1641
1642 return sprintf(buf, "%llx\n", b);
1643}
1644
1645static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
1646 const char *buf, size_t size)
1647{
1648 u64 new;
1649
1650 if (strict_strtoull(buf, 0, &new) < 0)
1651 return -EINVAL;
1652
1653 bank[attr - bank_attrs] = new;
1654 mce_restart();
1655
1656 return size;
1657}
1658
1659static ssize_t
1660show_trigger(struct sys_device *s, struct sysdev_attribute *attr, char *buf)
1661{
1662 strcpy(buf, trigger);
1663 strcat(buf, "\n");
1664 return strlen(trigger) + 1;
1665}
1666
1667static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
1668 const char *buf, size_t siz)
1669{
1670 char *p;
1671 int len;
1672
1673 strncpy(trigger, buf, sizeof(trigger));
1674 trigger[sizeof(trigger)-1] = 0;
1675 len = strlen(trigger);
1676 p = strchr(trigger, '\n');
1677
1678 if (*p)
1679 *p = 0;
1680
1681 return len;
1682}
1683
1684static ssize_t store_int_with_restart(struct sys_device *s,
1685 struct sysdev_attribute *attr,
1686 const char *buf, size_t size)
1687{
1688 ssize_t ret = sysdev_store_int(s, attr, buf, size);
1689 mce_restart();
1690 return ret;
1691}
1692
1693static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger);
1694static SYSDEV_INT_ATTR(tolerant, 0644, tolerant);
1695static SYSDEV_INT_ATTR(monarch_timeout, 0644, monarch_timeout);
1696
1697static struct sysdev_ext_attribute attr_check_interval = {
1698 _SYSDEV_ATTR(check_interval, 0644, sysdev_show_int,
1699 store_int_with_restart),
1700 &check_interval
1701};
1702
1703static struct sysdev_attribute *mce_attrs[] = {
1704 &attr_tolerant.attr, &attr_check_interval.attr, &attr_trigger,
1705 &attr_monarch_timeout.attr,
1706 NULL
1707};
1708
1709static cpumask_var_t mce_dev_initialized;
1710
1711/* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */
1712static __cpuinit int mce_create_device(unsigned int cpu)
1713{
1714 int err;
1715 int i;
1716
1717 if (!mce_available(&boot_cpu_data))
1718 return -EIO;
1719
1720 memset(&per_cpu(mce_dev, cpu).kobj, 0, sizeof(struct kobject));
1721 per_cpu(mce_dev, cpu).id = cpu;
1722 per_cpu(mce_dev, cpu).cls = &mce_sysclass;
1723
1724 err = sysdev_register(&per_cpu(mce_dev, cpu));
1725 if (err)
1726 return err;
1727
1728 for (i = 0; mce_attrs[i]; i++) {
1729 err = sysdev_create_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
1730 if (err)
1731 goto error;
1732 }
1733 for (i = 0; i < banks; i++) {
1734 err = sysdev_create_file(&per_cpu(mce_dev, cpu),
1735 &bank_attrs[i]);
1736 if (err)
1737 goto error2;
1738 }
1739 cpumask_set_cpu(cpu, mce_dev_initialized);
1740
1741 return 0;
1742error2:
1743 while (--i >= 0)
1744 sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]);
1745error:
1746 while (--i >= 0)
1747 sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
1748
1749 sysdev_unregister(&per_cpu(mce_dev, cpu));
1750
1751 return err;
1752}
1753
1754static __cpuinit void mce_remove_device(unsigned int cpu)
1755{
1756 int i;
1757
1758 if (!cpumask_test_cpu(cpu, mce_dev_initialized))
1759 return;
1760
1761 for (i = 0; mce_attrs[i]; i++)
1762 sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
1763
1764 for (i = 0; i < banks; i++)
1765 sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]);
1766
1767 sysdev_unregister(&per_cpu(mce_dev, cpu));
1768 cpumask_clear_cpu(cpu, mce_dev_initialized);
1769}
1770
1771/* Make sure there are no machine checks on offlined CPUs. */
1772static void mce_disable_cpu(void *h)
1773{
1774 unsigned long action = *(unsigned long *)h;
1775 int i;
1776
1777 if (!mce_available(&current_cpu_data))
1778 return;
1779 if (!(action & CPU_TASKS_FROZEN))
1780 cmci_clear();
1781 for (i = 0; i < banks; i++) {
1782 if (!skip_bank_init(i))
1783 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
1784 }
1785}
1786
1787static void mce_reenable_cpu(void *h)
1788{
1789 unsigned long action = *(unsigned long *)h;
1790 int i;
1791
1792 if (!mce_available(&current_cpu_data))
1793 return;
1794
1795 if (!(action & CPU_TASKS_FROZEN))
1796 cmci_reenable();
1797 for (i = 0; i < banks; i++) {
1798 if (!skip_bank_init(i))
1799 wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]);
1800 }
1801}
1802
1803/* Get notified when a cpu comes on/off. Be hotplug friendly. */
1804static int __cpuinit
1805mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
1806{
1807 unsigned int cpu = (unsigned long)hcpu;
1808 struct timer_list *t = &per_cpu(mce_timer, cpu);
1809
1810 switch (action) {
1811 case CPU_ONLINE:
1812 case CPU_ONLINE_FROZEN:
1813 mce_create_device(cpu);
1814 if (threshold_cpu_callback)
1815 threshold_cpu_callback(action, cpu);
1816 break;
1817 case CPU_DEAD:
1818 case CPU_DEAD_FROZEN:
1819 if (threshold_cpu_callback)
1820 threshold_cpu_callback(action, cpu);
1821 mce_remove_device(cpu);
1822 break;
1823 case CPU_DOWN_PREPARE:
1824 case CPU_DOWN_PREPARE_FROZEN:
1825 del_timer_sync(t);
1826 smp_call_function_single(cpu, mce_disable_cpu, &action, 1);
1827 break;
1828 case CPU_DOWN_FAILED:
1829 case CPU_DOWN_FAILED_FROZEN:
1830 t->expires = round_jiffies(jiffies +
1831 __get_cpu_var(next_interval));
1832 add_timer_on(t, cpu);
1833 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
1834 break;
1835 case CPU_POST_DEAD:
1836 /* intentionally ignoring frozen here */
1837 cmci_rediscover(cpu);
1838 break;
1839 }
1840 return NOTIFY_OK;
1841}
1842
1843static struct notifier_block mce_cpu_notifier __cpuinitdata = {
1844 .notifier_call = mce_cpu_callback,
1845};
1846
1847static __init int mce_init_banks(void)
1848{
1849 int i;
1850
1851 bank_attrs = kzalloc(sizeof(struct sysdev_attribute) * banks,
1852 GFP_KERNEL);
1853 if (!bank_attrs)
1854 return -ENOMEM;
1855
1856 for (i = 0; i < banks; i++) {
1857 struct sysdev_attribute *a = &bank_attrs[i];
1858
1859 a->attr.name = kasprintf(GFP_KERNEL, "bank%d", i);
1860 if (!a->attr.name)
1861 goto nomem;
1862
1863 a->attr.mode = 0644;
1864 a->show = show_bank;
1865 a->store = set_bank;
1866 }
1867 return 0;
1868
1869nomem:
1870 while (--i >= 0)
1871 kfree(bank_attrs[i].attr.name);
1872 kfree(bank_attrs);
1873 bank_attrs = NULL;
1874
1875 return -ENOMEM;
1876}
1877
1878static __init int mce_init_device(void)
1879{
1880 int err;
1881 int i = 0;
1882
1883 if (!mce_available(&boot_cpu_data))
1884 return -EIO;
1885
1886 alloc_cpumask_var(&mce_dev_initialized, GFP_KERNEL);
1887
1888 err = mce_init_banks();
1889 if (err)
1890 return err;
1891
1892 err = sysdev_class_register(&mce_sysclass);
1893 if (err)
1894 return err;
1895
1896 for_each_online_cpu(i) {
1897 err = mce_create_device(i);
1898 if (err)
1899 return err;
1900 }
1901
1902 register_hotcpu_notifier(&mce_cpu_notifier);
1903 misc_register(&mce_log_device);
1904
1905 return err;
1906}
1907
1908device_initcall(mce_init_device);
1909
1910#else /* CONFIG_X86_OLD_MCE: */
1911
1912int nr_mce_banks;
1913EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
1914
1915/* This has to be run for each processor */
1916void mcheck_init(struct cpuinfo_x86 *c)
1917{
1918 if (mce_disabled == 1)
1919 return;
1920
1921 switch (c->x86_vendor) {
1922 case X86_VENDOR_AMD:
1923 amd_mcheck_init(c);
1924 break;
1925
1926 case X86_VENDOR_INTEL:
1927 if (c->x86 == 5)
1928 intel_p5_mcheck_init(c);
1929 if (c->x86 == 6)
1930 intel_p6_mcheck_init(c);
1931 if (c->x86 == 15)
1932 intel_p4_mcheck_init(c);
1933 break;
1934
1935 case X86_VENDOR_CENTAUR:
1936 if (c->x86 == 5)
1937 winchip_mcheck_init(c);
1938 break;
1939
1940 default:
1941 break;
1942 }
1943 printk(KERN_INFO "mce: CPU supports %d MCE banks\n", nr_mce_banks);
1944}
1945
1946static int __init mcheck_enable(char *str)
1947{
1948 mce_disabled = -1;
1949 return 1;
1950}
1951
1952__setup("mce", mcheck_enable);
1953
1954#endif /* CONFIG_X86_OLD_MCE */
1955
1956/*
1957 * Old style boot options parsing. Only for compatibility.
1958 */
1959static int __init mcheck_disable(char *str)
1960{
1961 mce_disabled = 1;
1962 return 1;
1963}
1964__setup("nomce", mcheck_disable);
diff --git a/arch/x86/kernel/cpu/mcheck/mce.h b/arch/x86/kernel/cpu/mcheck/mce.h
index ae9f628838f1..84a552b458c8 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.h
+++ b/arch/x86/kernel/cpu/mcheck/mce.h
@@ -1,14 +1,38 @@
1#include <linux/init.h> 1#include <linux/init.h>
2#include <asm/mce.h> 2#include <asm/mce.h>
3 3
4#ifdef CONFIG_X86_OLD_MCE
4void amd_mcheck_init(struct cpuinfo_x86 *c); 5void amd_mcheck_init(struct cpuinfo_x86 *c);
5void intel_p4_mcheck_init(struct cpuinfo_x86 *c); 6void intel_p4_mcheck_init(struct cpuinfo_x86 *c);
6void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
7void intel_p6_mcheck_init(struct cpuinfo_x86 *c); 7void intel_p6_mcheck_init(struct cpuinfo_x86 *c);
8#endif
9
10#ifdef CONFIG_X86_ANCIENT_MCE
11void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
8void winchip_mcheck_init(struct cpuinfo_x86 *c); 12void winchip_mcheck_init(struct cpuinfo_x86 *c);
13extern int mce_p5_enable;
14static inline int mce_p5_enabled(void) { return mce_p5_enable; }
15static inline void enable_p5_mce(void) { mce_p5_enable = 1; }
16#else
17static inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {}
18static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {}
19static inline int mce_p5_enabled(void) { return 0; }
20static inline void enable_p5_mce(void) { }
21#endif
9 22
10/* Call the installed machine check handler for this CPU setup. */ 23/* Call the installed machine check handler for this CPU setup. */
11extern void (*machine_check_vector)(struct pt_regs *, long error_code); 24extern void (*machine_check_vector)(struct pt_regs *, long error_code);
12 25
26#ifdef CONFIG_X86_OLD_MCE
27
13extern int nr_mce_banks; 28extern int nr_mce_banks;
14 29
30void intel_set_thermal_handler(void);
31
32#else
33
34static inline void intel_set_thermal_handler(void) { }
35
36#endif
37
38void intel_init_thermal(struct cpuinfo_x86 *c);
diff --git a/arch/x86/kernel/cpu/mcheck/mce_32.c b/arch/x86/kernel/cpu/mcheck/mce_32.c
deleted file mode 100644
index 3552119b091d..000000000000
--- a/arch/x86/kernel/cpu/mcheck/mce_32.c
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * mce.c - x86 Machine Check Exception Reporting
3 * (c) 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>, Dave Jones <davej@redhat.com>
4 */
5
6#include <linux/init.h>
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/module.h>
10#include <linux/smp.h>
11#include <linux/thread_info.h>
12
13#include <asm/processor.h>
14#include <asm/system.h>
15#include <asm/mce.h>
16
17#include "mce.h"
18
19int mce_disabled;
20int nr_mce_banks;
21
22EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
23
24/* Handle unconfigured int18 (should never happen) */
25static void unexpected_machine_check(struct pt_regs *regs, long error_code)
26{
27 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n", smp_processor_id());
28}
29
30/* Call the installed machine check handler for this CPU setup. */
31void (*machine_check_vector)(struct pt_regs *, long error_code) = unexpected_machine_check;
32
33/* This has to be run for each processor */
34void mcheck_init(struct cpuinfo_x86 *c)
35{
36 if (mce_disabled == 1)
37 return;
38
39 switch (c->x86_vendor) {
40 case X86_VENDOR_AMD:
41 amd_mcheck_init(c);
42 break;
43
44 case X86_VENDOR_INTEL:
45 if (c->x86 == 5)
46 intel_p5_mcheck_init(c);
47 if (c->x86 == 6)
48 intel_p6_mcheck_init(c);
49 if (c->x86 == 15)
50 intel_p4_mcheck_init(c);
51 break;
52
53 case X86_VENDOR_CENTAUR:
54 if (c->x86 == 5)
55 winchip_mcheck_init(c);
56 break;
57
58 default:
59 break;
60 }
61}
62
63static int __init mcheck_disable(char *str)
64{
65 mce_disabled = 1;
66 return 1;
67}
68
69static int __init mcheck_enable(char *str)
70{
71 mce_disabled = -1;
72 return 1;
73}
74
75__setup("nomce", mcheck_disable);
76__setup("mce", mcheck_enable);
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c
deleted file mode 100644
index 289cc4815028..000000000000
--- a/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ /dev/null
@@ -1,1188 +0,0 @@
1/*
2 * Machine check handler.
3 * K8 parts Copyright 2002,2003 Andi Kleen, SuSE Labs.
4 * Rest from unknown author(s).
5 * 2004 Andi Kleen. Rewrote most of it.
6 * Copyright 2008 Intel Corporation
7 * Author: Andi Kleen
8 */
9
10#include <linux/init.h>
11#include <linux/types.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/smp_lock.h>
15#include <linux/string.h>
16#include <linux/rcupdate.h>
17#include <linux/kallsyms.h>
18#include <linux/sysdev.h>
19#include <linux/miscdevice.h>
20#include <linux/fs.h>
21#include <linux/capability.h>
22#include <linux/cpu.h>
23#include <linux/percpu.h>
24#include <linux/poll.h>
25#include <linux/thread_info.h>
26#include <linux/ctype.h>
27#include <linux/kmod.h>
28#include <linux/kdebug.h>
29#include <linux/kobject.h>
30#include <linux/sysfs.h>
31#include <linux/ratelimit.h>
32#include <asm/processor.h>
33#include <asm/msr.h>
34#include <asm/mce.h>
35#include <asm/uaccess.h>
36#include <asm/smp.h>
37#include <asm/idle.h>
38
39#define MISC_MCELOG_MINOR 227
40
41atomic_t mce_entry;
42
43static int mce_dont_init;
44
45/*
46 * Tolerant levels:
47 * 0: always panic on uncorrected errors, log corrected errors
48 * 1: panic or SIGBUS on uncorrected errors, log corrected errors
49 * 2: SIGBUS or log uncorrected errors (if possible), log corrected errors
50 * 3: never panic or SIGBUS, log all errors (for testing only)
51 */
52static int tolerant = 1;
53static int banks;
54static u64 *bank;
55static unsigned long notify_user;
56static int rip_msr;
57static int mce_bootlog = -1;
58static atomic_t mce_events;
59
60static char trigger[128];
61static char *trigger_argv[2] = { trigger, NULL };
62
63static DECLARE_WAIT_QUEUE_HEAD(mce_wait);
64
65/* MCA banks polled by the period polling timer for corrected events */
66DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
67 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL
68};
69
70/* Do initial initialization of a struct mce */
71void mce_setup(struct mce *m)
72{
73 memset(m, 0, sizeof(struct mce));
74 m->cpu = smp_processor_id();
75 rdtscll(m->tsc);
76}
77
78/*
79 * Lockless MCE logging infrastructure.
80 * This avoids deadlocks on printk locks without having to break locks. Also
81 * separate MCEs from kernel messages to avoid bogus bug reports.
82 */
83
84static struct mce_log mcelog = {
85 MCE_LOG_SIGNATURE,
86 MCE_LOG_LEN,
87};
88
89void mce_log(struct mce *mce)
90{
91 unsigned next, entry;
92 atomic_inc(&mce_events);
93 mce->finished = 0;
94 wmb();
95 for (;;) {
96 entry = rcu_dereference(mcelog.next);
97 for (;;) {
98 /* When the buffer fills up discard new entries. Assume
99 that the earlier errors are the more interesting. */
100 if (entry >= MCE_LOG_LEN) {
101 set_bit(MCE_OVERFLOW, (unsigned long *)&mcelog.flags);
102 return;
103 }
104 /* Old left over entry. Skip. */
105 if (mcelog.entry[entry].finished) {
106 entry++;
107 continue;
108 }
109 break;
110 }
111 smp_rmb();
112 next = entry + 1;
113 if (cmpxchg(&mcelog.next, entry, next) == entry)
114 break;
115 }
116 memcpy(mcelog.entry + entry, mce, sizeof(struct mce));
117 wmb();
118 mcelog.entry[entry].finished = 1;
119 wmb();
120
121 set_bit(0, &notify_user);
122}
123
124static void print_mce(struct mce *m)
125{
126 printk(KERN_EMERG "\n"
127 KERN_EMERG "HARDWARE ERROR\n"
128 KERN_EMERG
129 "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
130 m->cpu, m->mcgstatus, m->bank, m->status);
131 if (m->ip) {
132 printk(KERN_EMERG "RIP%s %02x:<%016Lx> ",
133 !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
134 m->cs, m->ip);
135 if (m->cs == __KERNEL_CS)
136 print_symbol("{%s}", m->ip);
137 printk("\n");
138 }
139 printk(KERN_EMERG "TSC %llx ", m->tsc);
140 if (m->addr)
141 printk("ADDR %llx ", m->addr);
142 if (m->misc)
143 printk("MISC %llx ", m->misc);
144 printk("\n");
145 printk(KERN_EMERG "This is not a software problem!\n");
146 printk(KERN_EMERG "Run through mcelog --ascii to decode "
147 "and contact your hardware vendor\n");
148}
149
150static void mce_panic(char *msg, struct mce *backup, unsigned long start)
151{
152 int i;
153
154 oops_begin();
155 for (i = 0; i < MCE_LOG_LEN; i++) {
156 unsigned long tsc = mcelog.entry[i].tsc;
157
158 if (time_before(tsc, start))
159 continue;
160 print_mce(&mcelog.entry[i]);
161 if (backup && mcelog.entry[i].tsc == backup->tsc)
162 backup = NULL;
163 }
164 if (backup)
165 print_mce(backup);
166 panic(msg);
167}
168
169int mce_available(struct cpuinfo_x86 *c)
170{
171 if (mce_dont_init)
172 return 0;
173 return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA);
174}
175
176static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
177{
178 if (regs && (m->mcgstatus & MCG_STATUS_RIPV)) {
179 m->ip = regs->ip;
180 m->cs = regs->cs;
181 } else {
182 m->ip = 0;
183 m->cs = 0;
184 }
185 if (rip_msr) {
186 /* Assume the RIP in the MSR is exact. Is this true? */
187 m->mcgstatus |= MCG_STATUS_EIPV;
188 rdmsrl(rip_msr, m->ip);
189 m->cs = 0;
190 }
191}
192
193/*
194 * Poll for corrected events or events that happened before reset.
195 * Those are just logged through /dev/mcelog.
196 *
197 * This is executed in standard interrupt context.
198 */
199void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
200{
201 struct mce m;
202 int i;
203
204 mce_setup(&m);
205
206 rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);
207 for (i = 0; i < banks; i++) {
208 if (!bank[i] || !test_bit(i, *b))
209 continue;
210
211 m.misc = 0;
212 m.addr = 0;
213 m.bank = i;
214 m.tsc = 0;
215
216 barrier();
217 rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
218 if (!(m.status & MCI_STATUS_VAL))
219 continue;
220
221 /*
222 * Uncorrected events are handled by the exception handler
223 * when it is enabled. But when the exception is disabled log
224 * everything.
225 *
226 * TBD do the same check for MCI_STATUS_EN here?
227 */
228 if ((m.status & MCI_STATUS_UC) && !(flags & MCP_UC))
229 continue;
230
231 if (m.status & MCI_STATUS_MISCV)
232 rdmsrl(MSR_IA32_MC0_MISC + i*4, m.misc);
233 if (m.status & MCI_STATUS_ADDRV)
234 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
235
236 if (!(flags & MCP_TIMESTAMP))
237 m.tsc = 0;
238 /*
239 * Don't get the IP here because it's unlikely to
240 * have anything to do with the actual error location.
241 */
242 if (!(flags & MCP_DONTLOG)) {
243 mce_log(&m);
244 add_taint(TAINT_MACHINE_CHECK);
245 }
246
247 /*
248 * Clear state for this bank.
249 */
250 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
251 }
252
253 /*
254 * Don't clear MCG_STATUS here because it's only defined for
255 * exceptions.
256 */
257}
258
259/*
260 * The actual machine check handler. This only handles real
261 * exceptions when something got corrupted coming in through int 18.
262 *
263 * This is executed in NMI context not subject to normal locking rules. This
264 * implies that most kernel services cannot be safely used. Don't even
265 * think about putting a printk in there!
266 */
267void do_machine_check(struct pt_regs * regs, long error_code)
268{
269 struct mce m, panicm;
270 u64 mcestart = 0;
271 int i;
272 int panicm_found = 0;
273 /*
274 * If no_way_out gets set, there is no safe way to recover from this
275 * MCE. If tolerant is cranked up, we'll try anyway.
276 */
277 int no_way_out = 0;
278 /*
279 * If kill_it gets set, there might be a way to recover from this
280 * error.
281 */
282 int kill_it = 0;
283 DECLARE_BITMAP(toclear, MAX_NR_BANKS);
284
285 atomic_inc(&mce_entry);
286
287 if (notify_die(DIE_NMI, "machine check", regs, error_code,
288 18, SIGKILL) == NOTIFY_STOP)
289 goto out2;
290 if (!banks)
291 goto out2;
292
293 mce_setup(&m);
294
295 rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);
296 /* if the restart IP is not valid, we're done for */
297 if (!(m.mcgstatus & MCG_STATUS_RIPV))
298 no_way_out = 1;
299
300 rdtscll(mcestart);
301 barrier();
302
303 for (i = 0; i < banks; i++) {
304 __clear_bit(i, toclear);
305 if (!bank[i])
306 continue;
307
308 m.misc = 0;
309 m.addr = 0;
310 m.bank = i;
311
312 rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
313 if ((m.status & MCI_STATUS_VAL) == 0)
314 continue;
315
316 /*
317 * Non uncorrected errors are handled by machine_check_poll
318 * Leave them alone.
319 */
320 if ((m.status & MCI_STATUS_UC) == 0)
321 continue;
322
323 /*
324 * Set taint even when machine check was not enabled.
325 */
326 add_taint(TAINT_MACHINE_CHECK);
327
328 __set_bit(i, toclear);
329
330 if (m.status & MCI_STATUS_EN) {
331 /* if PCC was set, there's no way out */
332 no_way_out |= !!(m.status & MCI_STATUS_PCC);
333 /*
334 * If this error was uncorrectable and there was
335 * an overflow, we're in trouble. If no overflow,
336 * we might get away with just killing a task.
337 */
338 if (m.status & MCI_STATUS_UC) {
339 if (tolerant < 1 || m.status & MCI_STATUS_OVER)
340 no_way_out = 1;
341 kill_it = 1;
342 }
343 } else {
344 /*
345 * Machine check event was not enabled. Clear, but
346 * ignore.
347 */
348 continue;
349 }
350
351 if (m.status & MCI_STATUS_MISCV)
352 rdmsrl(MSR_IA32_MC0_MISC + i*4, m.misc);
353 if (m.status & MCI_STATUS_ADDRV)
354 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
355
356 mce_get_rip(&m, regs);
357 mce_log(&m);
358
359 /* Did this bank cause the exception? */
360 /* Assume that the bank with uncorrectable errors did it,
361 and that there is only a single one. */
362 if ((m.status & MCI_STATUS_UC) && (m.status & MCI_STATUS_EN)) {
363 panicm = m;
364 panicm_found = 1;
365 }
366 }
367
368 /* If we didn't find an uncorrectable error, pick
369 the last one (shouldn't happen, just being safe). */
370 if (!panicm_found)
371 panicm = m;
372
373 /*
374 * If we have decided that we just CAN'T continue, and the user
375 * has not set tolerant to an insane level, give up and die.
376 */
377 if (no_way_out && tolerant < 3)
378 mce_panic("Machine check", &panicm, mcestart);
379
380 /*
381 * If the error seems to be unrecoverable, something should be
382 * done. Try to kill as little as possible. If we can kill just
383 * one task, do that. If the user has set the tolerance very
384 * high, don't try to do anything at all.
385 */
386 if (kill_it && tolerant < 3) {
387 int user_space = 0;
388
389 /*
390 * If the EIPV bit is set, it means the saved IP is the
391 * instruction which caused the MCE.
392 */
393 if (m.mcgstatus & MCG_STATUS_EIPV)
394 user_space = panicm.ip && (panicm.cs & 3);
395
396 /*
397 * If we know that the error was in user space, send a
398 * SIGBUS. Otherwise, panic if tolerance is low.
399 *
400 * force_sig() takes an awful lot of locks and has a slight
401 * risk of deadlocking.
402 */
403 if (user_space) {
404 force_sig(SIGBUS, current);
405 } else if (panic_on_oops || tolerant < 2) {
406 mce_panic("Uncorrected machine check",
407 &panicm, mcestart);
408 }
409 }
410
411 /* notify userspace ASAP */
412 set_thread_flag(TIF_MCE_NOTIFY);
413
414 /* the last thing we do is clear state */
415 for (i = 0; i < banks; i++) {
416 if (test_bit(i, toclear))
417 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
418 }
419 wrmsrl(MSR_IA32_MCG_STATUS, 0);
420 out2:
421 atomic_dec(&mce_entry);
422}
423EXPORT_SYMBOL_GPL(do_machine_check);
424
425#ifdef CONFIG_X86_MCE_INTEL
426/***
427 * mce_log_therm_throt_event - Logs the thermal throttling event to mcelog
428 * @cpu: The CPU on which the event occurred.
429 * @status: Event status information
430 *
431 * This function should be called by the thermal interrupt after the
432 * event has been processed and the decision was made to log the event
433 * further.
434 *
435 * The status parameter will be saved to the 'status' field of 'struct mce'
436 * and historically has been the register value of the
437 * MSR_IA32_THERMAL_STATUS (Intel) msr.
438 */
439void mce_log_therm_throt_event(__u64 status)
440{
441 struct mce m;
442
443 mce_setup(&m);
444 m.bank = MCE_THERMAL_BANK;
445 m.status = status;
446 mce_log(&m);
447}
448#endif /* CONFIG_X86_MCE_INTEL */
449
450/*
451 * Periodic polling timer for "silent" machine check errors. If the
452 * poller finds an MCE, poll 2x faster. When the poller finds no more
453 * errors, poll 2x slower (up to check_interval seconds).
454 */
455
456static int check_interval = 5 * 60; /* 5 minutes */
457static DEFINE_PER_CPU(int, next_interval); /* in jiffies */
458static void mcheck_timer(unsigned long);
459static DEFINE_PER_CPU(struct timer_list, mce_timer);
460
461static void mcheck_timer(unsigned long data)
462{
463 struct timer_list *t = &per_cpu(mce_timer, data);
464 int *n;
465
466 WARN_ON(smp_processor_id() != data);
467
468 if (mce_available(&current_cpu_data))
469 machine_check_poll(MCP_TIMESTAMP,
470 &__get_cpu_var(mce_poll_banks));
471
472 /*
473 * Alert userspace if needed. If we logged an MCE, reduce the
474 * polling interval, otherwise increase the polling interval.
475 */
476 n = &__get_cpu_var(next_interval);
477 if (mce_notify_user()) {
478 *n = max(*n/2, HZ/100);
479 } else {
480 *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ));
481 }
482
483 t->expires = jiffies + *n;
484 add_timer(t);
485}
486
487static void mce_do_trigger(struct work_struct *work)
488{
489 call_usermodehelper(trigger, trigger_argv, NULL, UMH_NO_WAIT);
490}
491
492static DECLARE_WORK(mce_trigger_work, mce_do_trigger);
493
494/*
495 * Notify the user(s) about new machine check events.
496 * Can be called from interrupt context, but not from machine check/NMI
497 * context.
498 */
499int mce_notify_user(void)
500{
501 /* Not more than two messages every minute */
502 static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
503
504 clear_thread_flag(TIF_MCE_NOTIFY);
505 if (test_and_clear_bit(0, &notify_user)) {
506 wake_up_interruptible(&mce_wait);
507
508 /*
509 * There is no risk of missing notifications because
510 * work_pending is always cleared before the function is
511 * executed.
512 */
513 if (trigger[0] && !work_pending(&mce_trigger_work))
514 schedule_work(&mce_trigger_work);
515
516 if (__ratelimit(&ratelimit))
517 printk(KERN_INFO "Machine check events logged\n");
518
519 return 1;
520 }
521 return 0;
522}
523
524/* see if the idle task needs to notify userspace */
525static int
526mce_idle_callback(struct notifier_block *nfb, unsigned long action, void *junk)
527{
528 /* IDLE_END should be safe - interrupts are back on */
529 if (action == IDLE_END && test_thread_flag(TIF_MCE_NOTIFY))
530 mce_notify_user();
531
532 return NOTIFY_OK;
533}
534
535static struct notifier_block mce_idle_notifier = {
536 .notifier_call = mce_idle_callback,
537};
538
539static __init int periodic_mcheck_init(void)
540{
541 idle_notifier_register(&mce_idle_notifier);
542 return 0;
543}
544__initcall(periodic_mcheck_init);
545
546/*
547 * Initialize Machine Checks for a CPU.
548 */
549static int mce_cap_init(void)
550{
551 u64 cap;
552 unsigned b;
553
554 rdmsrl(MSR_IA32_MCG_CAP, cap);
555 b = cap & 0xff;
556 if (b > MAX_NR_BANKS) {
557 printk(KERN_WARNING
558 "MCE: Using only %u machine check banks out of %u\n",
559 MAX_NR_BANKS, b);
560 b = MAX_NR_BANKS;
561 }
562
563 /* Don't support asymmetric configurations today */
564 WARN_ON(banks != 0 && b != banks);
565 banks = b;
566 if (!bank) {
567 bank = kmalloc(banks * sizeof(u64), GFP_KERNEL);
568 if (!bank)
569 return -ENOMEM;
570 memset(bank, 0xff, banks * sizeof(u64));
571 }
572
573 /* Use accurate RIP reporting if available. */
574 if ((cap & (1<<9)) && ((cap >> 16) & 0xff) >= 9)
575 rip_msr = MSR_IA32_MCG_EIP;
576
577 return 0;
578}
579
580static void mce_init(void *dummy)
581{
582 u64 cap;
583 int i;
584 mce_banks_t all_banks;
585
586 /*
587 * Log the machine checks left over from the previous reset.
588 */
589 bitmap_fill(all_banks, MAX_NR_BANKS);
590 machine_check_poll(MCP_UC|(!mce_bootlog ? MCP_DONTLOG : 0), &all_banks);
591
592 set_in_cr4(X86_CR4_MCE);
593
594 rdmsrl(MSR_IA32_MCG_CAP, cap);
595 if (cap & MCG_CTL_P)
596 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
597
598 for (i = 0; i < banks; i++) {
599 wrmsrl(MSR_IA32_MC0_CTL+4*i, bank[i]);
600 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
601 }
602}
603
604/* Add per CPU specific workarounds here */
605static void mce_cpu_quirks(struct cpuinfo_x86 *c)
606{
607 /* This should be disabled by the BIOS, but isn't always */
608 if (c->x86_vendor == X86_VENDOR_AMD) {
609 if (c->x86 == 15 && banks > 4)
610 /* disable GART TBL walk error reporting, which trips off
611 incorrectly with the IOMMU & 3ware & Cerberus. */
612 clear_bit(10, (unsigned long *)&bank[4]);
613 if(c->x86 <= 17 && mce_bootlog < 0)
614 /* Lots of broken BIOS around that don't clear them
615 by default and leave crap in there. Don't log. */
616 mce_bootlog = 0;
617 }
618
619}
620
621static void mce_cpu_features(struct cpuinfo_x86 *c)
622{
623 switch (c->x86_vendor) {
624 case X86_VENDOR_INTEL:
625 mce_intel_feature_init(c);
626 break;
627 case X86_VENDOR_AMD:
628 mce_amd_feature_init(c);
629 break;
630 default:
631 break;
632 }
633}
634
635static void mce_init_timer(void)
636{
637 struct timer_list *t = &__get_cpu_var(mce_timer);
638 int *n = &__get_cpu_var(next_interval);
639
640 *n = check_interval * HZ;
641 if (!*n)
642 return;
643 setup_timer(t, mcheck_timer, smp_processor_id());
644 t->expires = round_jiffies(jiffies + *n);
645 add_timer(t);
646}
647
648/*
649 * Called for each booted CPU to set up machine checks.
650 * Must be called with preempt off.
651 */
652void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
653{
654 if (!mce_available(c))
655 return;
656
657 if (mce_cap_init() < 0) {
658 mce_dont_init = 1;
659 return;
660 }
661 mce_cpu_quirks(c);
662
663 mce_init(NULL);
664 mce_cpu_features(c);
665 mce_init_timer();
666}
667
668/*
669 * Character device to read and clear the MCE log.
670 */
671
672static DEFINE_SPINLOCK(mce_state_lock);
673static int open_count; /* #times opened */
674static int open_exclu; /* already open exclusive? */
675
676static int mce_open(struct inode *inode, struct file *file)
677{
678 lock_kernel();
679 spin_lock(&mce_state_lock);
680
681 if (open_exclu || (open_count && (file->f_flags & O_EXCL))) {
682 spin_unlock(&mce_state_lock);
683 unlock_kernel();
684 return -EBUSY;
685 }
686
687 if (file->f_flags & O_EXCL)
688 open_exclu = 1;
689 open_count++;
690
691 spin_unlock(&mce_state_lock);
692 unlock_kernel();
693
694 return nonseekable_open(inode, file);
695}
696
697static int mce_release(struct inode *inode, struct file *file)
698{
699 spin_lock(&mce_state_lock);
700
701 open_count--;
702 open_exclu = 0;
703
704 spin_unlock(&mce_state_lock);
705
706 return 0;
707}
708
709static void collect_tscs(void *data)
710{
711 unsigned long *cpu_tsc = (unsigned long *)data;
712
713 rdtscll(cpu_tsc[smp_processor_id()]);
714}
715
716static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
717 loff_t *off)
718{
719 unsigned long *cpu_tsc;
720 static DEFINE_MUTEX(mce_read_mutex);
721 unsigned prev, next;
722 char __user *buf = ubuf;
723 int i, err;
724
725 cpu_tsc = kmalloc(nr_cpu_ids * sizeof(long), GFP_KERNEL);
726 if (!cpu_tsc)
727 return -ENOMEM;
728
729 mutex_lock(&mce_read_mutex);
730 next = rcu_dereference(mcelog.next);
731
732 /* Only supports full reads right now */
733 if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) {
734 mutex_unlock(&mce_read_mutex);
735 kfree(cpu_tsc);
736 return -EINVAL;
737 }
738
739 err = 0;
740 prev = 0;
741 do {
742 for (i = prev; i < next; i++) {
743 unsigned long start = jiffies;
744
745 while (!mcelog.entry[i].finished) {
746 if (time_after_eq(jiffies, start + 2)) {
747 memset(mcelog.entry + i, 0,
748 sizeof(struct mce));
749 goto timeout;
750 }
751 cpu_relax();
752 }
753 smp_rmb();
754 err |= copy_to_user(buf, mcelog.entry + i,
755 sizeof(struct mce));
756 buf += sizeof(struct mce);
757timeout:
758 ;
759 }
760
761 memset(mcelog.entry + prev, 0,
762 (next - prev) * sizeof(struct mce));
763 prev = next;
764 next = cmpxchg(&mcelog.next, prev, 0);
765 } while (next != prev);
766
767 synchronize_sched();
768
769 /*
770 * Collect entries that were still getting written before the
771 * synchronize.
772 */
773 on_each_cpu(collect_tscs, cpu_tsc, 1);
774 for (i = next; i < MCE_LOG_LEN; i++) {
775 if (mcelog.entry[i].finished &&
776 mcelog.entry[i].tsc < cpu_tsc[mcelog.entry[i].cpu]) {
777 err |= copy_to_user(buf, mcelog.entry+i,
778 sizeof(struct mce));
779 smp_rmb();
780 buf += sizeof(struct mce);
781 memset(&mcelog.entry[i], 0, sizeof(struct mce));
782 }
783 }
784 mutex_unlock(&mce_read_mutex);
785 kfree(cpu_tsc);
786 return err ? -EFAULT : buf - ubuf;
787}
788
789static unsigned int mce_poll(struct file *file, poll_table *wait)
790{
791 poll_wait(file, &mce_wait, wait);
792 if (rcu_dereference(mcelog.next))
793 return POLLIN | POLLRDNORM;
794 return 0;
795}
796
797static long mce_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
798{
799 int __user *p = (int __user *)arg;
800
801 if (!capable(CAP_SYS_ADMIN))
802 return -EPERM;
803 switch (cmd) {
804 case MCE_GET_RECORD_LEN:
805 return put_user(sizeof(struct mce), p);
806 case MCE_GET_LOG_LEN:
807 return put_user(MCE_LOG_LEN, p);
808 case MCE_GETCLEAR_FLAGS: {
809 unsigned flags;
810
811 do {
812 flags = mcelog.flags;
813 } while (cmpxchg(&mcelog.flags, flags, 0) != flags);
814 return put_user(flags, p);
815 }
816 default:
817 return -ENOTTY;
818 }
819}
820
821static const struct file_operations mce_chrdev_ops = {
822 .open = mce_open,
823 .release = mce_release,
824 .read = mce_read,
825 .poll = mce_poll,
826 .unlocked_ioctl = mce_ioctl,
827};
828
829static struct miscdevice mce_log_device = {
830 MISC_MCELOG_MINOR,
831 "mcelog",
832 &mce_chrdev_ops,
833};
834
835/*
836 * Old style boot options parsing. Only for compatibility.
837 */
838static int __init mcheck_disable(char *str)
839{
840 mce_dont_init = 1;
841 return 1;
842}
843
844/* mce=off disables machine check.
845 mce=TOLERANCELEVEL (number, see above)
846 mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
847 mce=nobootlog Don't log MCEs from before booting. */
848static int __init mcheck_enable(char *str)
849{
850 if (!strcmp(str, "off"))
851 mce_dont_init = 1;
852 else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog"))
853 mce_bootlog = str[0] == 'b';
854 else if (isdigit(str[0]))
855 get_option(&str, &tolerant);
856 else
857 printk("mce= argument %s ignored. Please use /sys", str);
858 return 1;
859}
860
861__setup("nomce", mcheck_disable);
862__setup("mce=", mcheck_enable);
863
864/*
865 * Sysfs support
866 */
867
868/*
869 * Disable machine checks on suspend and shutdown. We can't really handle
870 * them later.
871 */
872static int mce_disable(void)
873{
874 int i;
875
876 for (i = 0; i < banks; i++)
877 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
878 return 0;
879}
880
881static int mce_suspend(struct sys_device *dev, pm_message_t state)
882{
883 return mce_disable();
884}
885
886static int mce_shutdown(struct sys_device *dev)
887{
888 return mce_disable();
889}
890
891/* On resume clear all MCE state. Don't want to see leftovers from the BIOS.
892 Only one CPU is active at this time, the others get readded later using
893 CPU hotplug. */
894static int mce_resume(struct sys_device *dev)
895{
896 mce_init(NULL);
897 mce_cpu_features(&current_cpu_data);
898 return 0;
899}
900
901static void mce_cpu_restart(void *data)
902{
903 del_timer_sync(&__get_cpu_var(mce_timer));
904 if (mce_available(&current_cpu_data))
905 mce_init(NULL);
906 mce_init_timer();
907}
908
909/* Reinit MCEs after user configuration changes */
910static void mce_restart(void)
911{
912 on_each_cpu(mce_cpu_restart, NULL, 1);
913}
914
915static struct sysdev_class mce_sysclass = {
916 .suspend = mce_suspend,
917 .shutdown = mce_shutdown,
918 .resume = mce_resume,
919 .name = "machinecheck",
920};
921
922DEFINE_PER_CPU(struct sys_device, device_mce);
923void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu) __cpuinitdata;
924
925/* Why are there no generic functions for this? */
926#define ACCESSOR(name, var, start) \
927 static ssize_t show_ ## name(struct sys_device *s, \
928 struct sysdev_attribute *attr, \
929 char *buf) { \
930 return sprintf(buf, "%lx\n", (unsigned long)var); \
931 } \
932 static ssize_t set_ ## name(struct sys_device *s, \
933 struct sysdev_attribute *attr, \
934 const char *buf, size_t siz) { \
935 char *end; \
936 unsigned long new = simple_strtoul(buf, &end, 0); \
937 if (end == buf) return -EINVAL; \
938 var = new; \
939 start; \
940 return end-buf; \
941 } \
942 static SYSDEV_ATTR(name, 0644, show_ ## name, set_ ## name);
943
944static struct sysdev_attribute *bank_attrs;
945
946static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr,
947 char *buf)
948{
949 u64 b = bank[attr - bank_attrs];
950 return sprintf(buf, "%llx\n", b);
951}
952
953static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
954 const char *buf, size_t siz)
955{
956 char *end;
957 u64 new = simple_strtoull(buf, &end, 0);
958 if (end == buf)
959 return -EINVAL;
960 bank[attr - bank_attrs] = new;
961 mce_restart();
962 return end-buf;
963}
964
965static ssize_t show_trigger(struct sys_device *s, struct sysdev_attribute *attr,
966 char *buf)
967{
968 strcpy(buf, trigger);
969 strcat(buf, "\n");
970 return strlen(trigger) + 1;
971}
972
973static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
974 const char *buf,size_t siz)
975{
976 char *p;
977 int len;
978 strncpy(trigger, buf, sizeof(trigger));
979 trigger[sizeof(trigger)-1] = 0;
980 len = strlen(trigger);
981 p = strchr(trigger, '\n');
982 if (*p) *p = 0;
983 return len;
984}
985
986static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger);
987static SYSDEV_INT_ATTR(tolerant, 0644, tolerant);
988ACCESSOR(check_interval,check_interval,mce_restart())
989static struct sysdev_attribute *mce_attributes[] = {
990 &attr_tolerant.attr, &attr_check_interval, &attr_trigger,
991 NULL
992};
993
994static cpumask_var_t mce_device_initialized;
995
996/* Per cpu sysdev init. All of the cpus still share the same ctl bank */
997static __cpuinit int mce_create_device(unsigned int cpu)
998{
999 int err;
1000 int i;
1001
1002 if (!mce_available(&boot_cpu_data))
1003 return -EIO;
1004
1005 memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
1006 per_cpu(device_mce,cpu).id = cpu;
1007 per_cpu(device_mce,cpu).cls = &mce_sysclass;
1008
1009 err = sysdev_register(&per_cpu(device_mce,cpu));
1010 if (err)
1011 return err;
1012
1013 for (i = 0; mce_attributes[i]; i++) {
1014 err = sysdev_create_file(&per_cpu(device_mce,cpu),
1015 mce_attributes[i]);
1016 if (err)
1017 goto error;
1018 }
1019 for (i = 0; i < banks; i++) {
1020 err = sysdev_create_file(&per_cpu(device_mce, cpu),
1021 &bank_attrs[i]);
1022 if (err)
1023 goto error2;
1024 }
1025 cpumask_set_cpu(cpu, mce_device_initialized);
1026
1027 return 0;
1028error2:
1029 while (--i >= 0) {
1030 sysdev_remove_file(&per_cpu(device_mce, cpu),
1031 &bank_attrs[i]);
1032 }
1033error:
1034 while (--i >= 0) {
1035 sysdev_remove_file(&per_cpu(device_mce,cpu),
1036 mce_attributes[i]);
1037 }
1038 sysdev_unregister(&per_cpu(device_mce,cpu));
1039
1040 return err;
1041}
1042
1043static __cpuinit void mce_remove_device(unsigned int cpu)
1044{
1045 int i;
1046
1047 if (!cpumask_test_cpu(cpu, mce_device_initialized))
1048 return;
1049
1050 for (i = 0; mce_attributes[i]; i++)
1051 sysdev_remove_file(&per_cpu(device_mce,cpu),
1052 mce_attributes[i]);
1053 for (i = 0; i < banks; i++)
1054 sysdev_remove_file(&per_cpu(device_mce, cpu),
1055 &bank_attrs[i]);
1056 sysdev_unregister(&per_cpu(device_mce,cpu));
1057 cpumask_clear_cpu(cpu, mce_device_initialized);
1058}
1059
1060/* Make sure there are no machine checks on offlined CPUs. */
1061static void mce_disable_cpu(void *h)
1062{
1063 int i;
1064 unsigned long action = *(unsigned long *)h;
1065
1066 if (!mce_available(&current_cpu_data))
1067 return;
1068 if (!(action & CPU_TASKS_FROZEN))
1069 cmci_clear();
1070 for (i = 0; i < banks; i++)
1071 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
1072}
1073
1074static void mce_reenable_cpu(void *h)
1075{
1076 int i;
1077 unsigned long action = *(unsigned long *)h;
1078
1079 if (!mce_available(&current_cpu_data))
1080 return;
1081 if (!(action & CPU_TASKS_FROZEN))
1082 cmci_reenable();
1083 for (i = 0; i < banks; i++)
1084 wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]);
1085}
1086
1087/* Get notified when a cpu comes on/off. Be hotplug friendly. */
1088static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
1089 unsigned long action, void *hcpu)
1090{
1091 unsigned int cpu = (unsigned long)hcpu;
1092 struct timer_list *t = &per_cpu(mce_timer, cpu);
1093
1094 switch (action) {
1095 case CPU_ONLINE:
1096 case CPU_ONLINE_FROZEN:
1097 mce_create_device(cpu);
1098 if (threshold_cpu_callback)
1099 threshold_cpu_callback(action, cpu);
1100 break;
1101 case CPU_DEAD:
1102 case CPU_DEAD_FROZEN:
1103 if (threshold_cpu_callback)
1104 threshold_cpu_callback(action, cpu);
1105 mce_remove_device(cpu);
1106 break;
1107 case CPU_DOWN_PREPARE:
1108 case CPU_DOWN_PREPARE_FROZEN:
1109 del_timer_sync(t);
1110 smp_call_function_single(cpu, mce_disable_cpu, &action, 1);
1111 break;
1112 case CPU_DOWN_FAILED:
1113 case CPU_DOWN_FAILED_FROZEN:
1114 t->expires = round_jiffies(jiffies +
1115 __get_cpu_var(next_interval));
1116 add_timer_on(t, cpu);
1117 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
1118 break;
1119 case CPU_POST_DEAD:
1120 /* intentionally ignoring frozen here */
1121 cmci_rediscover(cpu);
1122 break;
1123 }
1124 return NOTIFY_OK;
1125}
1126
1127static struct notifier_block mce_cpu_notifier __cpuinitdata = {
1128 .notifier_call = mce_cpu_callback,
1129};
1130
1131static __init int mce_init_banks(void)
1132{
1133 int i;
1134
1135 bank_attrs = kzalloc(sizeof(struct sysdev_attribute) * banks,
1136 GFP_KERNEL);
1137 if (!bank_attrs)
1138 return -ENOMEM;
1139
1140 for (i = 0; i < banks; i++) {
1141 struct sysdev_attribute *a = &bank_attrs[i];
1142 a->attr.name = kasprintf(GFP_KERNEL, "bank%d", i);
1143 if (!a->attr.name)
1144 goto nomem;
1145 a->attr.mode = 0644;
1146 a->show = show_bank;
1147 a->store = set_bank;
1148 }
1149 return 0;
1150
1151nomem:
1152 while (--i >= 0)
1153 kfree(bank_attrs[i].attr.name);
1154 kfree(bank_attrs);
1155 bank_attrs = NULL;
1156 return -ENOMEM;
1157}
1158
1159static __init int mce_init_device(void)
1160{
1161 int err;
1162 int i = 0;
1163
1164 if (!mce_available(&boot_cpu_data))
1165 return -EIO;
1166
1167 zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL);
1168
1169 err = mce_init_banks();
1170 if (err)
1171 return err;
1172
1173 err = sysdev_class_register(&mce_sysclass);
1174 if (err)
1175 return err;
1176
1177 for_each_online_cpu(i) {
1178 err = mce_create_device(i);
1179 if (err)
1180 return err;
1181 }
1182
1183 register_hotcpu_notifier(&mce_cpu_notifier);
1184 misc_register(&mce_log_device);
1185 return err;
1186}
1187
1188device_initcall(mce_init_device);
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
index 56dde9c4bc96..ddae21620bda 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
@@ -13,22 +13,22 @@
13 * 13 *
14 * All MC4_MISCi registers are shared between multi-cores 14 * All MC4_MISCi registers are shared between multi-cores
15 */ 15 */
16
17#include <linux/cpu.h>
18#include <linux/errno.h>
19#include <linux/init.h>
20#include <linux/interrupt.h> 16#include <linux/interrupt.h>
21#include <linux/kobject.h>
22#include <linux/notifier.h> 17#include <linux/notifier.h>
23#include <linux/sched.h> 18#include <linux/kobject.h>
24#include <linux/smp.h> 19#include <linux/percpu.h>
25#include <linux/sysdev.h> 20#include <linux/sysdev.h>
21#include <linux/errno.h>
22#include <linux/sched.h>
26#include <linux/sysfs.h> 23#include <linux/sysfs.h>
24#include <linux/init.h>
25#include <linux/cpu.h>
26#include <linux/smp.h>
27
27#include <asm/apic.h> 28#include <asm/apic.h>
29#include <asm/idle.h>
28#include <asm/mce.h> 30#include <asm/mce.h>
29#include <asm/msr.h> 31#include <asm/msr.h>
30#include <asm/percpu.h>
31#include <asm/idle.h>
32 32
33#define PFX "mce_threshold: " 33#define PFX "mce_threshold: "
34#define VERSION "version 1.1.1" 34#define VERSION "version 1.1.1"
@@ -48,26 +48,26 @@
48#define MCG_XBLK_ADDR 0xC0000400 48#define MCG_XBLK_ADDR 0xC0000400
49 49
50struct threshold_block { 50struct threshold_block {
51 unsigned int block; 51 unsigned int block;
52 unsigned int bank; 52 unsigned int bank;
53 unsigned int cpu; 53 unsigned int cpu;
54 u32 address; 54 u32 address;
55 u16 interrupt_enable; 55 u16 interrupt_enable;
56 u16 threshold_limit; 56 u16 threshold_limit;
57 struct kobject kobj; 57 struct kobject kobj;
58 struct list_head miscj; 58 struct list_head miscj;
59}; 59};
60 60
61/* defaults used early on boot */ 61/* defaults used early on boot */
62static struct threshold_block threshold_defaults = { 62static struct threshold_block threshold_defaults = {
63 .interrupt_enable = 0, 63 .interrupt_enable = 0,
64 .threshold_limit = THRESHOLD_MAX, 64 .threshold_limit = THRESHOLD_MAX,
65}; 65};
66 66
67struct threshold_bank { 67struct threshold_bank {
68 struct kobject *kobj; 68 struct kobject *kobj;
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 *, threshold_banks[NR_BANKS]);
73 73
@@ -86,9 +86,9 @@ static void amd_threshold_interrupt(void);
86 */ 86 */
87 87
88struct thresh_restart { 88struct thresh_restart {
89 struct threshold_block *b; 89 struct threshold_block *b;
90 int reset; 90 int reset;
91 u16 old_limit; 91 u16 old_limit;
92}; 92};
93 93
94/* must be called with correct cpu affinity */ 94/* must be called with correct cpu affinity */
@@ -110,6 +110,7 @@ static void threshold_restart_bank(void *_tr)
110 } else if (tr->old_limit) { /* change limit w/o reset */ 110 } else if (tr->old_limit) { /* change limit w/o reset */
111 int new_count = (mci_misc_hi & THRESHOLD_MAX) + 111 int new_count = (mci_misc_hi & THRESHOLD_MAX) +
112 (tr->old_limit - tr->b->threshold_limit); 112 (tr->old_limit - tr->b->threshold_limit);
113
113 mci_misc_hi = (mci_misc_hi & ~MASK_ERR_COUNT_HI) | 114 mci_misc_hi = (mci_misc_hi & ~MASK_ERR_COUNT_HI) |
114 (new_count & THRESHOLD_MAX); 115 (new_count & THRESHOLD_MAX);
115 } 116 }
@@ -125,11 +126,11 @@ static void threshold_restart_bank(void *_tr)
125/* cpu init entry point, called from mce.c with preempt off */ 126/* cpu init entry point, called from mce.c with preempt off */
126void mce_amd_feature_init(struct cpuinfo_x86 *c) 127void mce_amd_feature_init(struct cpuinfo_x86 *c)
127{ 128{
128 unsigned int bank, block;
129 unsigned int cpu = smp_processor_id(); 129 unsigned int cpu = smp_processor_id();
130 u8 lvt_off;
131 u32 low = 0, high = 0, address = 0; 130 u32 low = 0, high = 0, address = 0;
131 unsigned int bank, block;
132 struct thresh_restart tr; 132 struct thresh_restart tr;
133 u8 lvt_off;
133 134
134 for (bank = 0; bank < NR_BANKS; ++bank) { 135 for (bank = 0; bank < NR_BANKS; ++bank) {
135 for (block = 0; block < NR_BLOCKS; ++block) { 136 for (block = 0; block < NR_BLOCKS; ++block) {
@@ -140,8 +141,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
140 if (!address) 141 if (!address)
141 break; 142 break;
142 address += MCG_XBLK_ADDR; 143 address += MCG_XBLK_ADDR;
143 } 144 } else
144 else
145 ++address; 145 ++address;
146 146
147 if (rdmsr_safe(address, &low, &high)) 147 if (rdmsr_safe(address, &low, &high))
@@ -193,9 +193,9 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
193 */ 193 */
194static void amd_threshold_interrupt(void) 194static void amd_threshold_interrupt(void)
195{ 195{
196 u32 low = 0, high = 0, address = 0;
196 unsigned int bank, block; 197 unsigned int bank, block;
197 struct mce m; 198 struct mce m;
198 u32 low = 0, high = 0, address = 0;
199 199
200 mce_setup(&m); 200 mce_setup(&m);
201 201
@@ -204,16 +204,16 @@ static void amd_threshold_interrupt(void)
204 if (!(per_cpu(bank_map, m.cpu) & (1 << bank))) 204 if (!(per_cpu(bank_map, m.cpu) & (1 << bank)))
205 continue; 205 continue;
206 for (block = 0; block < NR_BLOCKS; ++block) { 206 for (block = 0; block < NR_BLOCKS; ++block) {
207 if (block == 0) 207 if (block == 0) {
208 address = MSR_IA32_MC0_MISC + bank * 4; 208 address = MSR_IA32_MC0_MISC + bank * 4;
209 else if (block == 1) { 209 } else if (block == 1) {
210 address = (low & MASK_BLKPTR_LO) >> 21; 210 address = (low & MASK_BLKPTR_LO) >> 21;
211 if (!address) 211 if (!address)
212 break; 212 break;
213 address += MCG_XBLK_ADDR; 213 address += MCG_XBLK_ADDR;
214 } 214 } else {
215 else
216 ++address; 215 ++address;
216 }
217 217
218 if (rdmsr_safe(address, &low, &high)) 218 if (rdmsr_safe(address, &low, &high))
219 break; 219 break;
@@ -229,8 +229,10 @@ static void amd_threshold_interrupt(void)
229 (high & MASK_LOCKED_HI)) 229 (high & MASK_LOCKED_HI))
230 continue; 230 continue;
231 231
232 /* Log the machine check that caused the threshold 232 /*
233 event. */ 233 * Log the machine check that caused the threshold
234 * event.
235 */
234 machine_check_poll(MCP_TIMESTAMP, 236 machine_check_poll(MCP_TIMESTAMP,
235 &__get_cpu_var(mce_poll_banks)); 237 &__get_cpu_var(mce_poll_banks));
236 238
@@ -254,48 +256,52 @@ static void amd_threshold_interrupt(void)
254 256
255struct threshold_attr { 257struct threshold_attr {
256 struct attribute attr; 258 struct attribute attr;
257 ssize_t(*show) (struct threshold_block *, char *); 259 ssize_t (*show) (struct threshold_block *, char *);
258 ssize_t(*store) (struct threshold_block *, const char *, size_t count); 260 ssize_t (*store) (struct threshold_block *, const char *, size_t count);
259}; 261};
260 262
261#define SHOW_FIELDS(name) \ 263#define SHOW_FIELDS(name) \
262static ssize_t show_ ## name(struct threshold_block * b, char *buf) \ 264static ssize_t show_ ## name(struct threshold_block *b, char *buf) \
263{ \ 265{ \
264 return sprintf(buf, "%lx\n", (unsigned long) b->name); \ 266 return sprintf(buf, "%lx\n", (unsigned long) b->name); \
265} 267}
266SHOW_FIELDS(interrupt_enable) 268SHOW_FIELDS(interrupt_enable)
267SHOW_FIELDS(threshold_limit) 269SHOW_FIELDS(threshold_limit)
268 270
269static ssize_t store_interrupt_enable(struct threshold_block *b, 271static ssize_t
270 const char *buf, size_t count) 272store_interrupt_enable(struct threshold_block *b, const char *buf, size_t size)
271{ 273{
272 char *end;
273 struct thresh_restart tr; 274 struct thresh_restart tr;
274 unsigned long new = simple_strtoul(buf, &end, 0); 275 unsigned long new;
275 if (end == buf) 276
277 if (strict_strtoul(buf, 0, &new) < 0)
276 return -EINVAL; 278 return -EINVAL;
279
277 b->interrupt_enable = !!new; 280 b->interrupt_enable = !!new;
278 281
279 tr.b = b; 282 tr.b = b;
280 tr.reset = 0; 283 tr.reset = 0;
281 tr.old_limit = 0; 284 tr.old_limit = 0;
285
282 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1); 286 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);
283 287
284 return end - buf; 288 return size;
285} 289}
286 290
287static ssize_t store_threshold_limit(struct threshold_block *b, 291static ssize_t
288 const char *buf, size_t count) 292store_threshold_limit(struct threshold_block *b, const char *buf, size_t size)
289{ 293{
290 char *end;
291 struct thresh_restart tr; 294 struct thresh_restart tr;
292 unsigned long new = simple_strtoul(buf, &end, 0); 295 unsigned long new;
293 if (end == buf) 296
297 if (strict_strtoul(buf, 0, &new) < 0)
294 return -EINVAL; 298 return -EINVAL;
299
295 if (new > THRESHOLD_MAX) 300 if (new > THRESHOLD_MAX)
296 new = THRESHOLD_MAX; 301 new = THRESHOLD_MAX;
297 if (new < 1) 302 if (new < 1)
298 new = 1; 303 new = 1;
304
299 tr.old_limit = b->threshold_limit; 305 tr.old_limit = b->threshold_limit;
300 b->threshold_limit = new; 306 b->threshold_limit = new;
301 tr.b = b; 307 tr.b = b;
@@ -303,12 +309,12 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
303 309
304 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1); 310 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);
305 311
306 return end - buf; 312 return size;
307} 313}
308 314
309struct threshold_block_cross_cpu { 315struct threshold_block_cross_cpu {
310 struct threshold_block *tb; 316 struct threshold_block *tb;
311 long retval; 317 long retval;
312}; 318};
313 319
314static void local_error_count_handler(void *_tbcc) 320static void local_error_count_handler(void *_tbcc)
@@ -338,16 +344,13 @@ static ssize_t store_error_count(struct threshold_block *b,
338 return 1; 344 return 1;
339} 345}
340 346
341#define THRESHOLD_ATTR(_name,_mode,_show,_store) { \ 347#define RW_ATTR(val) \
342 .attr = {.name = __stringify(_name), .mode = _mode }, \ 348static struct threshold_attr val = { \
343 .show = _show, \ 349 .attr = {.name = __stringify(val), .mode = 0644 }, \
344 .store = _store, \ 350 .show = show_## val, \
351 .store = store_## val, \
345}; 352};
346 353
347#define RW_ATTR(name) \
348static struct threshold_attr name = \
349 THRESHOLD_ATTR(name, 0644, show_## name, store_## name)
350
351RW_ATTR(interrupt_enable); 354RW_ATTR(interrupt_enable);
352RW_ATTR(threshold_limit); 355RW_ATTR(threshold_limit);
353RW_ATTR(error_count); 356RW_ATTR(error_count);
@@ -359,15 +362,17 @@ static struct attribute *default_attrs[] = {
359 NULL 362 NULL
360}; 363};
361 364
362#define to_block(k) container_of(k, struct threshold_block, kobj) 365#define to_block(k) container_of(k, struct threshold_block, kobj)
363#define to_attr(a) container_of(a, struct threshold_attr, attr) 366#define to_attr(a) container_of(a, struct threshold_attr, attr)
364 367
365static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf) 368static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)
366{ 369{
367 struct threshold_block *b = to_block(kobj); 370 struct threshold_block *b = to_block(kobj);
368 struct threshold_attr *a = to_attr(attr); 371 struct threshold_attr *a = to_attr(attr);
369 ssize_t ret; 372 ssize_t ret;
373
370 ret = a->show ? a->show(b, buf) : -EIO; 374 ret = a->show ? a->show(b, buf) : -EIO;
375
371 return ret; 376 return ret;
372} 377}
373 378
@@ -377,18 +382,20 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
377 struct threshold_block *b = to_block(kobj); 382 struct threshold_block *b = to_block(kobj);
378 struct threshold_attr *a = to_attr(attr); 383 struct threshold_attr *a = to_attr(attr);
379 ssize_t ret; 384 ssize_t ret;
385
380 ret = a->store ? a->store(b, buf, count) : -EIO; 386 ret = a->store ? a->store(b, buf, count) : -EIO;
387
381 return ret; 388 return ret;
382} 389}
383 390
384static struct sysfs_ops threshold_ops = { 391static struct sysfs_ops threshold_ops = {
385 .show = show, 392 .show = show,
386 .store = store, 393 .store = store,
387}; 394};
388 395
389static struct kobj_type threshold_ktype = { 396static struct kobj_type threshold_ktype = {
390 .sysfs_ops = &threshold_ops, 397 .sysfs_ops = &threshold_ops,
391 .default_attrs = default_attrs, 398 .default_attrs = default_attrs,
392}; 399};
393 400
394static __cpuinit int allocate_threshold_blocks(unsigned int cpu, 401static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
@@ -396,9 +403,9 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
396 unsigned int block, 403 unsigned int block,
397 u32 address) 404 u32 address)
398{ 405{
399 int err;
400 u32 low, high;
401 struct threshold_block *b = NULL; 406 struct threshold_block *b = NULL;
407 u32 low, high;
408 int err;
402 409
403 if ((bank >= NR_BANKS) || (block >= NR_BLOCKS)) 410 if ((bank >= NR_BANKS) || (block >= NR_BLOCKS))
404 return 0; 411 return 0;
@@ -421,20 +428,21 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
421 if (!b) 428 if (!b)
422 return -ENOMEM; 429 return -ENOMEM;
423 430
424 b->block = block; 431 b->block = block;
425 b->bank = bank; 432 b->bank = bank;
426 b->cpu = cpu; 433 b->cpu = cpu;
427 b->address = address; 434 b->address = address;
428 b->interrupt_enable = 0; 435 b->interrupt_enable = 0;
429 b->threshold_limit = THRESHOLD_MAX; 436 b->threshold_limit = THRESHOLD_MAX;
430 437
431 INIT_LIST_HEAD(&b->miscj); 438 INIT_LIST_HEAD(&b->miscj);
432 439
433 if (per_cpu(threshold_banks, cpu)[bank]->blocks) 440 if (per_cpu(threshold_banks, cpu)[bank]->blocks) {
434 list_add(&b->miscj, 441 list_add(&b->miscj,
435 &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj); 442 &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj);
436 else 443 } else {
437 per_cpu(threshold_banks, cpu)[bank]->blocks = b; 444 per_cpu(threshold_banks, cpu)[bank]->blocks = b;
445 }
438 446
439 err = kobject_init_and_add(&b->kobj, &threshold_ktype, 447 err = kobject_init_and_add(&b->kobj, &threshold_ktype,
440 per_cpu(threshold_banks, cpu)[bank]->kobj, 448 per_cpu(threshold_banks, cpu)[bank]->kobj,
@@ -447,8 +455,9 @@ recurse:
447 if (!address) 455 if (!address)
448 return 0; 456 return 0;
449 address += MCG_XBLK_ADDR; 457 address += MCG_XBLK_ADDR;
450 } else 458 } else {
451 ++address; 459 ++address;
460 }
452 461
453 err = allocate_threshold_blocks(cpu, bank, ++block, address); 462 err = allocate_threshold_blocks(cpu, bank, ++block, address);
454 if (err) 463 if (err)
@@ -500,13 +509,14 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
500 if (!b) 509 if (!b)
501 goto out; 510 goto out;
502 511
503 err = sysfs_create_link(&per_cpu(device_mce, cpu).kobj, 512 err = sysfs_create_link(&per_cpu(mce_dev, cpu).kobj,
504 b->kobj, name); 513 b->kobj, name);
505 if (err) 514 if (err)
506 goto out; 515 goto out;
507 516
508 cpumask_copy(b->cpus, cpu_core_mask(cpu)); 517 cpumask_copy(b->cpus, cpu_core_mask(cpu));
509 per_cpu(threshold_banks, cpu)[bank] = b; 518 per_cpu(threshold_banks, cpu)[bank] = b;
519
510 goto out; 520 goto out;
511 } 521 }
512#endif 522#endif
@@ -522,7 +532,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
522 goto out; 532 goto out;
523 } 533 }
524 534
525 b->kobj = kobject_create_and_add(name, &per_cpu(device_mce, cpu).kobj); 535 b->kobj = kobject_create_and_add(name, &per_cpu(mce_dev, cpu).kobj);
526 if (!b->kobj) 536 if (!b->kobj)
527 goto out_free; 537 goto out_free;
528 538
@@ -542,7 +552,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
542 if (i == cpu) 552 if (i == cpu)
543 continue; 553 continue;
544 554
545 err = sysfs_create_link(&per_cpu(device_mce, i).kobj, 555 err = sysfs_create_link(&per_cpu(mce_dev, i).kobj,
546 b->kobj, name); 556 b->kobj, name);
547 if (err) 557 if (err)
548 goto out; 558 goto out;
@@ -605,15 +615,13 @@ static void deallocate_threshold_block(unsigned int cpu,
605 615
606static void threshold_remove_bank(unsigned int cpu, int bank) 616static void threshold_remove_bank(unsigned int cpu, int bank)
607{ 617{
608 int i = 0;
609 struct threshold_bank *b; 618 struct threshold_bank *b;
610 char name[32]; 619 char name[32];
620 int i = 0;
611 621
612 b = per_cpu(threshold_banks, cpu)[bank]; 622 b = per_cpu(threshold_banks, cpu)[bank];
613
614 if (!b) 623 if (!b)
615 return; 624 return;
616
617 if (!b->blocks) 625 if (!b->blocks)
618 goto free_out; 626 goto free_out;
619 627
@@ -622,8 +630,9 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
622#ifdef CONFIG_SMP 630#ifdef CONFIG_SMP
623 /* sibling symlink */ 631 /* sibling symlink */
624 if (shared_bank[bank] && b->blocks->cpu != cpu) { 632 if (shared_bank[bank] && b->blocks->cpu != cpu) {
625 sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name); 633 sysfs_remove_link(&per_cpu(mce_dev, cpu).kobj, name);
626 per_cpu(threshold_banks, cpu)[bank] = NULL; 634 per_cpu(threshold_banks, cpu)[bank] = NULL;
635
627 return; 636 return;
628 } 637 }
629#endif 638#endif
@@ -633,7 +642,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
633 if (i == cpu) 642 if (i == cpu)
634 continue; 643 continue;
635 644
636 sysfs_remove_link(&per_cpu(device_mce, i).kobj, name); 645 sysfs_remove_link(&per_cpu(mce_dev, i).kobj, name);
637 per_cpu(threshold_banks, i)[bank] = NULL; 646 per_cpu(threshold_banks, i)[bank] = NULL;
638 } 647 }
639 648
@@ -659,12 +668,9 @@ static void threshold_remove_device(unsigned int cpu)
659} 668}
660 669
661/* get notified when a cpu comes on/off */ 670/* get notified when a cpu comes on/off */
662static void __cpuinit amd_64_threshold_cpu_callback(unsigned long action, 671static void __cpuinit
663 unsigned int cpu) 672amd_64_threshold_cpu_callback(unsigned long action, unsigned int cpu)
664{ 673{
665 if (cpu >= NR_CPUS)
666 return;
667
668 switch (action) { 674 switch (action) {
669 case CPU_ONLINE: 675 case CPU_ONLINE:
670 case CPU_ONLINE_FROZEN: 676 case CPU_ONLINE_FROZEN:
@@ -686,11 +692,12 @@ static __init int threshold_init_device(void)
686 /* to hit CPUs online before the notifier is up */ 692 /* to hit CPUs online before the notifier is up */
687 for_each_online_cpu(lcpu) { 693 for_each_online_cpu(lcpu) {
688 int err = threshold_create_device(lcpu); 694 int err = threshold_create_device(lcpu);
695
689 if (err) 696 if (err)
690 return err; 697 return err;
691 } 698 }
692 threshold_cpu_callback = amd_64_threshold_cpu_callback; 699 threshold_cpu_callback = amd_64_threshold_cpu_callback;
700
693 return 0; 701 return 0;
694} 702}
695
696device_initcall(threshold_init_device); 703device_initcall(threshold_init_device);
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
new file mode 100644
index 000000000000..2b011d2d8579
--- /dev/null
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -0,0 +1,74 @@
1/*
2 * Common code for Intel machine checks
3 */
4#include <linux/interrupt.h>
5#include <linux/kernel.h>
6#include <linux/types.h>
7#include <linux/init.h>
8#include <linux/smp.h>
9
10#include <asm/therm_throt.h>
11#include <asm/processor.h>
12#include <asm/system.h>
13#include <asm/apic.h>
14#include <asm/msr.h>
15
16#include "mce.h"
17
18void intel_init_thermal(struct cpuinfo_x86 *c)
19{
20 unsigned int cpu = smp_processor_id();
21 int tm2 = 0;
22 u32 l, h;
23
24 /* Thermal monitoring depends on ACPI and clock modulation*/
25 if (!cpu_has(c, X86_FEATURE_ACPI) || !cpu_has(c, X86_FEATURE_ACC))
26 return;
27
28 /*
29 * First check if its enabled already, in which case there might
30 * be some SMM goo which handles it, so we can't even put a handler
31 * since it might be delivered via SMI already:
32 */
33 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
34 h = apic_read(APIC_LVTTHMR);
35 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
36 printk(KERN_DEBUG
37 "CPU%d: Thermal monitoring handled by SMI\n", cpu);
38 return;
39 }
40
41 if (cpu_has(c, X86_FEATURE_TM2) && (l & MSR_IA32_MISC_ENABLE_TM2))
42 tm2 = 1;
43
44 /* Check whether a vector already exists */
45 if (h & APIC_VECTOR_MASK) {
46 printk(KERN_DEBUG
47 "CPU%d: Thermal LVT vector (%#x) already installed\n",
48 cpu, (h & APIC_VECTOR_MASK));
49 return;
50 }
51
52 /* We'll mask the thermal vector in the lapic till we're ready: */
53 h = THERMAL_APIC_VECTOR | APIC_DM_FIXED | APIC_LVT_MASKED;
54 apic_write(APIC_LVTTHMR, h);
55
56 rdmsr(MSR_IA32_THERM_INTERRUPT, l, h);
57 wrmsr(MSR_IA32_THERM_INTERRUPT,
58 l | (THERM_INT_LOW_ENABLE | THERM_INT_HIGH_ENABLE), h);
59
60 intel_set_thermal_handler();
61
62 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
63 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
64
65 /* Unmask the thermal vector: */
66 l = apic_read(APIC_LVTTHMR);
67 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
68
69 printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
70 cpu, tm2 ? "TM2" : "TM1");
71
72 /* enable thermal throttle processing */
73 atomic_set(&therm_throt_en, 1);
74}
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
index 65a0fceedcd7..f2ef6952c400 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
@@ -16,6 +16,8 @@
16#include <asm/idle.h> 16#include <asm/idle.h>
17#include <asm/therm_throt.h> 17#include <asm/therm_throt.h>
18 18
19#include "mce.h"
20
19asmlinkage void smp_thermal_interrupt(void) 21asmlinkage void smp_thermal_interrupt(void)
20{ 22{
21 __u64 msr_val; 23 __u64 msr_val;
@@ -26,67 +28,13 @@ asmlinkage void smp_thermal_interrupt(void)
26 irq_enter(); 28 irq_enter();
27 29
28 rdmsrl(MSR_IA32_THERM_STATUS, msr_val); 30 rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
29 if (therm_throt_process(msr_val & 1)) 31 if (therm_throt_process(msr_val & THERM_STATUS_PROCHOT))
30 mce_log_therm_throt_event(msr_val); 32 mce_log_therm_throt_event(msr_val);
31 33
32 inc_irq_stat(irq_thermal_count); 34 inc_irq_stat(irq_thermal_count);
33 irq_exit(); 35 irq_exit();
34} 36}
35 37
36static void intel_init_thermal(struct cpuinfo_x86 *c)
37{
38 u32 l, h;
39 int tm2 = 0;
40 unsigned int cpu = smp_processor_id();
41
42 if (!cpu_has(c, X86_FEATURE_ACPI))
43 return;
44
45 if (!cpu_has(c, X86_FEATURE_ACC))
46 return;
47
48 /* first check if TM1 is already enabled by the BIOS, in which
49 * case there might be some SMM goo which handles it, so we can't even
50 * put a handler since it might be delivered via SMI already.
51 */
52 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
53 h = apic_read(APIC_LVTTHMR);
54 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
55 printk(KERN_DEBUG
56 "CPU%d: Thermal monitoring handled by SMI\n", cpu);
57 return;
58 }
59
60 if (cpu_has(c, X86_FEATURE_TM2) && (l & MSR_IA32_MISC_ENABLE_TM2))
61 tm2 = 1;
62
63 if (h & APIC_VECTOR_MASK) {
64 printk(KERN_DEBUG
65 "CPU%d: Thermal LVT vector (%#x) already "
66 "installed\n", cpu, (h & APIC_VECTOR_MASK));
67 return;
68 }
69
70 h = THERMAL_APIC_VECTOR;
71 h |= (APIC_DM_FIXED | APIC_LVT_MASKED);
72 apic_write(APIC_LVTTHMR, h);
73
74 rdmsr(MSR_IA32_THERM_INTERRUPT, l, h);
75 wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h);
76
77 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
78 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
79
80 l = apic_read(APIC_LVTTHMR);
81 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
82 printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
83 cpu, tm2 ? "TM2" : "TM1");
84
85 /* enable thermal throttle processing */
86 atomic_set(&therm_throt_en, 1);
87 return;
88}
89
90/* 38/*
91 * Support for Intel Correct Machine Check Interrupts. This allows 39 * Support for Intel Correct Machine Check Interrupts. This allows
92 * the CPU to raise an interrupt when a corrected machine check happened. 40 * the CPU to raise an interrupt when a corrected machine check happened.
@@ -108,6 +56,9 @@ static int cmci_supported(int *banks)
108{ 56{
109 u64 cap; 57 u64 cap;
110 58
59 if (mce_cmci_disabled || mce_ignore_ce)
60 return 0;
61
111 /* 62 /*
112 * Vendor check is not strictly needed, but the initial 63 * Vendor check is not strictly needed, but the initial
113 * initialization is vendor keyed and this 64 * initialization is vendor keyed and this
@@ -131,7 +82,7 @@ static int cmci_supported(int *banks)
131static void intel_threshold_interrupt(void) 82static void intel_threshold_interrupt(void)
132{ 83{
133 machine_check_poll(MCP_TIMESTAMP, &__get_cpu_var(mce_banks_owned)); 84 machine_check_poll(MCP_TIMESTAMP, &__get_cpu_var(mce_banks_owned));
134 mce_notify_user(); 85 mce_notify_irq();
135} 86}
136 87
137static void print_update(char *type, int *hdr, int num) 88static void print_update(char *type, int *hdr, int num)
@@ -247,7 +198,7 @@ void cmci_rediscover(int dying)
247 return; 198 return;
248 cpumask_copy(old, &current->cpus_allowed); 199 cpumask_copy(old, &current->cpus_allowed);
249 200
250 for_each_online_cpu (cpu) { 201 for_each_online_cpu(cpu) {
251 if (cpu == dying) 202 if (cpu == dying)
252 continue; 203 continue;
253 if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) 204 if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
diff --git a/arch/x86/kernel/cpu/mcheck/non-fatal.c b/arch/x86/kernel/cpu/mcheck/non-fatal.c
index a74af128efc9..70b710420f74 100644
--- a/arch/x86/kernel/cpu/mcheck/non-fatal.c
+++ b/arch/x86/kernel/cpu/mcheck/non-fatal.c
@@ -6,15 +6,14 @@
6 * This file contains routines to check for non-fatal MCEs every 15s 6 * This file contains routines to check for non-fatal MCEs every 15s
7 * 7 *
8 */ 8 */
9
10#include <linux/init.h>
11#include <linux/types.h>
12#include <linux/kernel.h>
13#include <linux/jiffies.h>
14#include <linux/workqueue.h>
15#include <linux/interrupt.h> 9#include <linux/interrupt.h>
16#include <linux/smp.h> 10#include <linux/workqueue.h>
11#include <linux/jiffies.h>
12#include <linux/kernel.h>
17#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/init.h>
16#include <linux/smp.h>
18 17
19#include <asm/processor.h> 18#include <asm/processor.h>
20#include <asm/system.h> 19#include <asm/system.h>
@@ -22,9 +21,9 @@
22 21
23#include "mce.h" 22#include "mce.h"
24 23
25static int firstbank; 24static int firstbank;
26 25
27#define MCE_RATE 15*HZ /* timer rate is 15s */ 26#define MCE_RATE (15*HZ) /* timer rate is 15s */
28 27
29static void mce_checkregs(void *info) 28static void mce_checkregs(void *info)
30{ 29{
@@ -34,23 +33,24 @@ static void mce_checkregs(void *info)
34 for (i = firstbank; i < nr_mce_banks; i++) { 33 for (i = firstbank; i < nr_mce_banks; i++) {
35 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high); 34 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
36 35
37 if (high & (1<<31)) { 36 if (!(high & (1<<31)))
38 printk(KERN_INFO "MCE: The hardware reports a non " 37 continue;
39 "fatal, correctable incident occurred on " 38
40 "CPU %d.\n", 39 printk(KERN_INFO "MCE: The hardware reports a non fatal, "
40 "correctable incident occurred on CPU %d.\n",
41 smp_processor_id()); 41 smp_processor_id());
42 printk(KERN_INFO "Bank %d: %08x%08x\n", i, high, low); 42
43 43 printk(KERN_INFO "Bank %d: %08x%08x\n", i, high, low);
44 /* 44
45 * Scrub the error so we don't pick it up in MCE_RATE 45 /*
46 * seconds time. 46 * Scrub the error so we don't pick it up in MCE_RATE
47 */ 47 * seconds time:
48 wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL); 48 */
49 49 wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL);
50 /* Serialize */ 50
51 wmb(); 51 /* Serialize: */
52 add_taint(TAINT_MACHINE_CHECK); 52 wmb();
53 } 53 add_taint(TAINT_MACHINE_CHECK);
54 } 54 }
55} 55}
56 56
@@ -77,16 +77,17 @@ static int __init init_nonfatal_mce_checker(void)
77 77
78 /* Some Athlons misbehave when we frob bank 0 */ 78 /* Some Athlons misbehave when we frob bank 0 */
79 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && 79 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
80 boot_cpu_data.x86 == 6) 80 boot_cpu_data.x86 == 6)
81 firstbank = 1; 81 firstbank = 1;
82 else 82 else
83 firstbank = 0; 83 firstbank = 0;
84 84
85 /* 85 /*
86 * Check for non-fatal errors every MCE_RATE s 86 * Check for non-fatal errors every MCE_RATE s
87 */ 87 */
88 schedule_delayed_work(&mce_work, round_jiffies_relative(MCE_RATE)); 88 schedule_delayed_work(&mce_work, round_jiffies_relative(MCE_RATE));
89 printk(KERN_INFO "Machine check exception polling timer started.\n"); 89 printk(KERN_INFO "Machine check exception polling timer started.\n");
90
90 return 0; 91 return 0;
91} 92}
92module_init(init_nonfatal_mce_checker); 93module_init(init_nonfatal_mce_checker);
diff --git a/arch/x86/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c
index f53bdcbaf382..82cee108a2d3 100644
--- a/arch/x86/kernel/cpu/mcheck/p4.c
+++ b/arch/x86/kernel/cpu/mcheck/p4.c
@@ -2,18 +2,17 @@
2 * P4 specific Machine Check Exception Reporting 2 * P4 specific Machine Check Exception Reporting
3 */ 3 */
4 4
5#include <linux/init.h>
6#include <linux/types.h>
7#include <linux/kernel.h>
8#include <linux/interrupt.h> 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> 9#include <linux/smp.h>
10 10
11#include <asm/therm_throt.h>
11#include <asm/processor.h> 12#include <asm/processor.h>
12#include <asm/system.h> 13#include <asm/system.h>
13#include <asm/msr.h>
14#include <asm/apic.h> 14#include <asm/apic.h>
15 15#include <asm/msr.h>
16#include <asm/therm_throt.h>
17 16
18#include "mce.h" 17#include "mce.h"
19 18
@@ -36,6 +35,7 @@ static int mce_num_extended_msrs;
36 35
37 36
38#ifdef CONFIG_X86_MCE_P4THERMAL 37#ifdef CONFIG_X86_MCE_P4THERMAL
38
39static void unexpected_thermal_interrupt(struct pt_regs *regs) 39static void unexpected_thermal_interrupt(struct pt_regs *regs)
40{ 40{
41 printk(KERN_ERR "CPU%d: Unexpected LVT TMR interrupt!\n", 41 printk(KERN_ERR "CPU%d: Unexpected LVT TMR interrupt!\n",
@@ -43,7 +43,7 @@ static void unexpected_thermal_interrupt(struct pt_regs *regs)
43 add_taint(TAINT_MACHINE_CHECK); 43 add_taint(TAINT_MACHINE_CHECK);
44} 44}
45 45
46/* P4/Xeon Thermal transition interrupt handler */ 46/* P4/Xeon Thermal transition interrupt handler: */
47static void intel_thermal_interrupt(struct pt_regs *regs) 47static void intel_thermal_interrupt(struct pt_regs *regs)
48{ 48{
49 __u64 msr_val; 49 __u64 msr_val;
@@ -51,11 +51,12 @@ static void intel_thermal_interrupt(struct pt_regs *regs)
51 ack_APIC_irq(); 51 ack_APIC_irq();
52 52
53 rdmsrl(MSR_IA32_THERM_STATUS, msr_val); 53 rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
54 therm_throt_process(msr_val & 0x1); 54 therm_throt_process(msr_val & THERM_STATUS_PROCHOT);
55} 55}
56 56
57/* Thermal interrupt handler for this CPU setup */ 57/* Thermal interrupt handler for this CPU setup: */
58static void (*vendor_thermal_interrupt)(struct pt_regs *regs) = unexpected_thermal_interrupt; 58static void (*vendor_thermal_interrupt)(struct pt_regs *regs) =
59 unexpected_thermal_interrupt;
59 60
60void smp_thermal_interrupt(struct pt_regs *regs) 61void smp_thermal_interrupt(struct pt_regs *regs)
61{ 62{
@@ -65,67 +66,15 @@ void smp_thermal_interrupt(struct pt_regs *regs)
65 irq_exit(); 66 irq_exit();
66} 67}
67 68
68/* P4/Xeon Thermal regulation detect and init */ 69void intel_set_thermal_handler(void)
69static void intel_init_thermal(struct cpuinfo_x86 *c)
70{ 70{
71 u32 l, h;
72 unsigned int cpu = smp_processor_id();
73
74 /* Thermal monitoring */
75 if (!cpu_has(c, X86_FEATURE_ACPI))
76 return; /* -ENODEV */
77
78 /* Clock modulation */
79 if (!cpu_has(c, X86_FEATURE_ACC))
80 return; /* -ENODEV */
81
82 /* first check if its enabled already, in which case there might
83 * be some SMM goo which handles it, so we can't even put a handler
84 * since it might be delivered via SMI already -zwanem.
85 */
86 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
87 h = apic_read(APIC_LVTTHMR);
88 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
89 printk(KERN_DEBUG "CPU%d: Thermal monitoring handled by SMI\n",
90 cpu);
91 return; /* -EBUSY */
92 }
93
94 /* check whether a vector already exists, temporarily masked? */
95 if (h & APIC_VECTOR_MASK) {
96 printk(KERN_DEBUG "CPU%d: Thermal LVT vector (%#x) already "
97 "installed\n",
98 cpu, (h & APIC_VECTOR_MASK));
99 return; /* -EBUSY */
100 }
101
102 /* The temperature transition interrupt handler setup */
103 h = THERMAL_APIC_VECTOR; /* our delivery vector */
104 h |= (APIC_DM_FIXED | APIC_LVT_MASKED); /* we'll mask till we're ready */
105 apic_write(APIC_LVTTHMR, h);
106
107 rdmsr(MSR_IA32_THERM_INTERRUPT, l, h);
108 wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03 , h);
109
110 /* ok we're good to go... */
111 vendor_thermal_interrupt = intel_thermal_interrupt; 71 vendor_thermal_interrupt = intel_thermal_interrupt;
112
113 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
114 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
115
116 l = apic_read(APIC_LVTTHMR);
117 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
118 printk(KERN_INFO "CPU%d: Thermal monitoring enabled\n", cpu);
119
120 /* enable thermal throttle processing */
121 atomic_set(&therm_throt_en, 1);
122 return;
123} 72}
124#endif /* CONFIG_X86_MCE_P4THERMAL */
125 73
74#endif /* CONFIG_X86_MCE_P4THERMAL */
126 75
127/* P4/Xeon Extended MCE MSR retrieval, return 0 if unsupported */ 76/* P4/Xeon Extended MCE MSR retrieval, return 0 if unsupported */
128static inline void intel_get_extended_msrs(struct intel_mce_extended_msrs *r) 77static void intel_get_extended_msrs(struct intel_mce_extended_msrs *r)
129{ 78{
130 u32 h; 79 u32 h;
131 80
@@ -143,9 +92,9 @@ static inline void intel_get_extended_msrs(struct intel_mce_extended_msrs *r)
143 92
144static void intel_machine_check(struct pt_regs *regs, long error_code) 93static void intel_machine_check(struct pt_regs *regs, long error_code)
145{ 94{
146 int recover = 1;
147 u32 alow, ahigh, high, low; 95 u32 alow, ahigh, high, low;
148 u32 mcgstl, mcgsth; 96 u32 mcgstl, mcgsth;
97 int recover = 1;
149 int i; 98 int i;
150 99
151 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth); 100 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
@@ -157,7 +106,9 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
157 106
158 if (mce_num_extended_msrs > 0) { 107 if (mce_num_extended_msrs > 0) {
159 struct intel_mce_extended_msrs dbg; 108 struct intel_mce_extended_msrs dbg;
109
160 intel_get_extended_msrs(&dbg); 110 intel_get_extended_msrs(&dbg);
111
161 printk(KERN_DEBUG "CPU %d: EIP: %08x EFLAGS: %08x\n" 112 printk(KERN_DEBUG "CPU %d: EIP: %08x EFLAGS: %08x\n"
162 "\teax: %08x ebx: %08x ecx: %08x edx: %08x\n" 113 "\teax: %08x ebx: %08x ecx: %08x edx: %08x\n"
163 "\tesi: %08x edi: %08x ebp: %08x esp: %08x\n", 114 "\tesi: %08x edi: %08x ebp: %08x esp: %08x\n",
@@ -171,6 +122,7 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
171 if (high & (1<<31)) { 122 if (high & (1<<31)) {
172 char misc[20]; 123 char misc[20];
173 char addr[24]; 124 char addr[24];
125
174 misc[0] = addr[0] = '\0'; 126 misc[0] = addr[0] = '\0';
175 if (high & (1<<29)) 127 if (high & (1<<29))
176 recover |= 1; 128 recover |= 1;
@@ -196,6 +148,7 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
196 panic("Unable to continue"); 148 panic("Unable to continue");
197 149
198 printk(KERN_EMERG "Attempting to continue.\n"); 150 printk(KERN_EMERG "Attempting to continue.\n");
151
199 /* 152 /*
200 * Do not clear the MSR_IA32_MCi_STATUS if the error is not 153 * Do not clear the MSR_IA32_MCi_STATUS if the error is not
201 * recoverable/continuable.This will allow BIOS to look at the MSRs 154 * recoverable/continuable.This will allow BIOS to look at the MSRs
@@ -217,7 +170,6 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
217 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth); 170 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
218} 171}
219 172
220
221void intel_p4_mcheck_init(struct cpuinfo_x86 *c) 173void intel_p4_mcheck_init(struct cpuinfo_x86 *c)
222{ 174{
223 u32 l, h; 175 u32 l, h;
diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
index c9f77ea69edc..015f481ab1b0 100644
--- a/arch/x86/kernel/cpu/mcheck/p5.c
+++ b/arch/x86/kernel/cpu/mcheck/p5.c
@@ -2,11 +2,10 @@
2 * P5 specific Machine Check Exception Reporting 2 * P5 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5
6#include <linux/init.h>
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
10#include <linux/smp.h> 9#include <linux/smp.h>
11 10
12#include <asm/processor.h> 11#include <asm/processor.h>
@@ -15,39 +14,58 @@
15 14
16#include "mce.h" 15#include "mce.h"
17 16
18/* Machine check handler for Pentium class Intel */ 17/* By default disabled */
18int mce_p5_enable;
19
20/* Machine check handler for Pentium class Intel CPUs: */
19static void pentium_machine_check(struct pt_regs *regs, long error_code) 21static void pentium_machine_check(struct pt_regs *regs, long error_code)
20{ 22{
21 u32 loaddr, hi, lotype; 23 u32 loaddr, hi, lotype;
24
22 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi); 25 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
23 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi); 26 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
24 printk(KERN_EMERG "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n", smp_processor_id(), loaddr, lotype); 27
25 if (lotype&(1<<5)) 28 printk(KERN_EMERG
26 printk(KERN_EMERG "CPU#%d: Possible thermal failure (CPU on fire ?).\n", smp_processor_id()); 29 "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n",
30 smp_processor_id(), loaddr, lotype);
31
32 if (lotype & (1<<5)) {
33 printk(KERN_EMERG
34 "CPU#%d: Possible thermal failure (CPU on fire ?).\n",
35 smp_processor_id());
36 }
37
27 add_taint(TAINT_MACHINE_CHECK); 38 add_taint(TAINT_MACHINE_CHECK);
28} 39}
29 40
30/* Set up machine check reporting for processors with Intel style MCE */ 41/* Set up machine check reporting for processors with Intel style MCE: */
31void intel_p5_mcheck_init(struct cpuinfo_x86 *c) 42void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
32{ 43{
33 u32 l, h; 44 u32 l, h;
34 45
35 /*Check for MCE support */ 46 /* Check for MCE support: */
36 if (!cpu_has(c, X86_FEATURE_MCE)) 47 if (!cpu_has(c, X86_FEATURE_MCE))
37 return; 48 return;
38 49
39 /* Default P5 to off as its often misconnected */ 50#ifdef CONFIG_X86_OLD_MCE
51 /* Default P5 to off as its often misconnected: */
40 if (mce_disabled != -1) 52 if (mce_disabled != -1)
41 return; 53 return;
54#endif
55
42 machine_check_vector = pentium_machine_check; 56 machine_check_vector = pentium_machine_check;
57 /* Make sure the vector pointer is visible before we enable MCEs: */
43 wmb(); 58 wmb();
44 59
45 /* Read registers before enabling */ 60 /* Read registers before enabling: */
46 rdmsr(MSR_IA32_P5_MC_ADDR, l, h); 61 rdmsr(MSR_IA32_P5_MC_ADDR, l, h);
47 rdmsr(MSR_IA32_P5_MC_TYPE, l, h); 62 rdmsr(MSR_IA32_P5_MC_TYPE, l, h);
48 printk(KERN_INFO "Intel old style machine check architecture supported.\n"); 63 printk(KERN_INFO
64 "Intel old style machine check architecture supported.\n");
49 65
50 /* Enable MCE */ 66 /* Enable MCE: */
51 set_in_cr4(X86_CR4_MCE); 67 set_in_cr4(X86_CR4_MCE);
52 printk(KERN_INFO "Intel old style machine check reporting enabled on CPU#%d.\n", smp_processor_id()); 68 printk(KERN_INFO
69 "Intel old style machine check reporting enabled on CPU#%d.\n",
70 smp_processor_id());
53} 71}
diff --git a/arch/x86/kernel/cpu/mcheck/p6.c b/arch/x86/kernel/cpu/mcheck/p6.c
index 2ac52d7b434b..43c24e667457 100644
--- a/arch/x86/kernel/cpu/mcheck/p6.c
+++ b/arch/x86/kernel/cpu/mcheck/p6.c
@@ -2,11 +2,10 @@
2 * P6 specific Machine Check Exception Reporting 2 * P6 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5
6#include <linux/init.h>
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
10#include <linux/smp.h> 9#include <linux/smp.h>
11 10
12#include <asm/processor.h> 11#include <asm/processor.h>
@@ -18,9 +17,9 @@
18/* Machine Check Handler For PII/PIII */ 17/* Machine Check Handler For PII/PIII */
19static void intel_machine_check(struct pt_regs *regs, long error_code) 18static void intel_machine_check(struct pt_regs *regs, long error_code)
20{ 19{
21 int recover = 1;
22 u32 alow, ahigh, high, low; 20 u32 alow, ahigh, high, low;
23 u32 mcgstl, mcgsth; 21 u32 mcgstl, mcgsth;
22 int recover = 1;
24 int i; 23 int i;
25 24
26 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth); 25 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
@@ -35,12 +34,16 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
35 if (high & (1<<31)) { 34 if (high & (1<<31)) {
36 char misc[20]; 35 char misc[20];
37 char addr[24]; 36 char addr[24];
38 misc[0] = addr[0] = '\0'; 37
38 misc[0] = '\0';
39 addr[0] = '\0';
40
39 if (high & (1<<29)) 41 if (high & (1<<29))
40 recover |= 1; 42 recover |= 1;
41 if (high & (1<<25)) 43 if (high & (1<<25))
42 recover |= 2; 44 recover |= 2;
43 high &= ~(1<<31); 45 high &= ~(1<<31);
46
44 if (high & (1<<27)) { 47 if (high & (1<<27)) {
45 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh); 48 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh);
46 snprintf(misc, 20, "[%08x%08x]", ahigh, alow); 49 snprintf(misc, 20, "[%08x%08x]", ahigh, alow);
@@ -49,6 +52,7 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
49 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh); 52 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh);
50 snprintf(addr, 24, " at %08x%08x", ahigh, alow); 53 snprintf(addr, 24, " at %08x%08x", ahigh, alow);
51 } 54 }
55
52 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n", 56 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n",
53 smp_processor_id(), i, high, low, misc, addr); 57 smp_processor_id(), i, high, low, misc, addr);
54 } 58 }
@@ -63,16 +67,17 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
63 /* 67 /*
64 * Do not clear the MSR_IA32_MCi_STATUS if the error is not 68 * Do not clear the MSR_IA32_MCi_STATUS if the error is not
65 * recoverable/continuable.This will allow BIOS to look at the MSRs 69 * recoverable/continuable.This will allow BIOS to look at the MSRs
66 * for errors if the OS could not log the error. 70 * for errors if the OS could not log the error:
67 */ 71 */
68 for (i = 0; i < nr_mce_banks; i++) { 72 for (i = 0; i < nr_mce_banks; i++) {
69 unsigned int msr; 73 unsigned int msr;
74
70 msr = MSR_IA32_MC0_STATUS+i*4; 75 msr = MSR_IA32_MC0_STATUS+i*4;
71 rdmsr(msr, low, high); 76 rdmsr(msr, low, high);
72 if (high & (1<<31)) { 77 if (high & (1<<31)) {
73 /* Clear it */ 78 /* Clear it: */
74 wrmsr(msr, 0UL, 0UL); 79 wrmsr(msr, 0UL, 0UL);
75 /* Serialize */ 80 /* Serialize: */
76 wmb(); 81 wmb();
77 add_taint(TAINT_MACHINE_CHECK); 82 add_taint(TAINT_MACHINE_CHECK);
78 } 83 }
@@ -81,7 +86,7 @@ static void intel_machine_check(struct pt_regs *regs, long error_code)
81 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth); 86 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
82} 87}
83 88
84/* Set up machine check reporting for processors with Intel style MCE */ 89/* Set up machine check reporting for processors with Intel style MCE: */
85void intel_p6_mcheck_init(struct cpuinfo_x86 *c) 90void intel_p6_mcheck_init(struct cpuinfo_x86 *c)
86{ 91{
87 u32 l, h; 92 u32 l, h;
@@ -97,6 +102,7 @@ void intel_p6_mcheck_init(struct cpuinfo_x86 *c)
97 102
98 /* Ok machine check is available */ 103 /* Ok machine check is available */
99 machine_check_vector = intel_machine_check; 104 machine_check_vector = intel_machine_check;
105 /* Make sure the vector pointer is visible before we enable MCEs: */
100 wmb(); 106 wmb();
101 107
102 printk(KERN_INFO "Intel machine check architecture supported.\n"); 108 printk(KERN_INFO "Intel machine check architecture supported.\n");
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index d5ae2243f0b9..7b1ae2e20ba5 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 *
3 * Thermal throttle event support code (such as syslog messaging and rate 2 * Thermal throttle event support code (such as syslog messaging and rate
4 * limiting) that was factored out from x86_64 (mce_intel.c) and i386 (p4.c). 3 * limiting) that was factored out from x86_64 (mce_intel.c) and i386 (p4.c).
4 *
5 * This allows consistent reporting of CPU thermal throttle events. 5 * This allows consistent reporting of CPU thermal throttle events.
6 * 6 *
7 * Maintains a counter in /sys that keeps track of the number of thermal 7 * Maintains a counter in /sys that keeps track of the number of thermal
@@ -13,43 +13,43 @@
13 * Credits: Adapted from Zwane Mwaikambo's original code in mce_intel.c. 13 * Credits: Adapted from Zwane Mwaikambo's original code in mce_intel.c.
14 * Inspired by Ross Biro's and Al Borchers' counter code. 14 * Inspired by Ross Biro's and Al Borchers' counter code.
15 */ 15 */
16 16#include <linux/notifier.h>
17#include <linux/jiffies.h>
17#include <linux/percpu.h> 18#include <linux/percpu.h>
18#include <linux/sysdev.h> 19#include <linux/sysdev.h>
19#include <linux/cpu.h> 20#include <linux/cpu.h>
20#include <asm/cpu.h> 21
21#include <linux/notifier.h>
22#include <linux/jiffies.h>
23#include <asm/therm_throt.h> 22#include <asm/therm_throt.h>
24 23
25/* How long to wait between reporting thermal events */ 24/* How long to wait between reporting thermal events */
26#define CHECK_INTERVAL (300 * HZ) 25#define CHECK_INTERVAL (300 * HZ)
27 26
28static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES; 27static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES;
29static DEFINE_PER_CPU(unsigned long, thermal_throttle_count); 28static DEFINE_PER_CPU(unsigned long, thermal_throttle_count);
30atomic_t therm_throt_en = ATOMIC_INIT(0); 29
30atomic_t therm_throt_en = ATOMIC_INIT(0);
31 31
32#ifdef CONFIG_SYSFS 32#ifdef CONFIG_SYSFS
33#define define_therm_throt_sysdev_one_ro(_name) \ 33#define define_therm_throt_sysdev_one_ro(_name) \
34 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL) 34 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL)
35 35
36#define define_therm_throt_sysdev_show_func(name) \ 36#define define_therm_throt_sysdev_show_func(name) \
37static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \ 37static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \
38 struct sysdev_attribute *attr, \ 38 struct sysdev_attribute *attr, \
39 char *buf) \ 39 char *buf) \
40{ \ 40{ \
41 unsigned int cpu = dev->id; \ 41 unsigned int cpu = dev->id; \
42 ssize_t ret; \ 42 ssize_t ret; \
43 \ 43 \
44 preempt_disable(); /* CPU hotplug */ \ 44 preempt_disable(); /* CPU hotplug */ \
45 if (cpu_online(cpu)) \ 45 if (cpu_online(cpu)) \
46 ret = sprintf(buf, "%lu\n", \ 46 ret = sprintf(buf, "%lu\n", \
47 per_cpu(thermal_throttle_##name, cpu)); \ 47 per_cpu(thermal_throttle_##name, cpu)); \
48 else \ 48 else \
49 ret = 0; \ 49 ret = 0; \
50 preempt_enable(); \ 50 preempt_enable(); \
51 \ 51 \
52 return ret; \ 52 return ret; \
53} 53}
54 54
55define_therm_throt_sysdev_show_func(count); 55define_therm_throt_sysdev_show_func(count);
@@ -61,8 +61,8 @@ static struct attribute *thermal_throttle_attrs[] = {
61}; 61};
62 62
63static struct attribute_group thermal_throttle_attr_group = { 63static struct attribute_group thermal_throttle_attr_group = {
64 .attrs = thermal_throttle_attrs, 64 .attrs = thermal_throttle_attrs,
65 .name = "thermal_throttle" 65 .name = "thermal_throttle"
66}; 66};
67#endif /* CONFIG_SYSFS */ 67#endif /* CONFIG_SYSFS */
68 68
@@ -110,10 +110,11 @@ int therm_throt_process(int curr)
110} 110}
111 111
112#ifdef CONFIG_SYSFS 112#ifdef CONFIG_SYSFS
113/* Add/Remove thermal_throttle interface for CPU device */ 113/* Add/Remove thermal_throttle interface for CPU device: */
114static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev) 114static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev)
115{ 115{
116 return sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group); 116 return sysfs_create_group(&sys_dev->kobj,
117 &thermal_throttle_attr_group);
117} 118}
118 119
119static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev) 120static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev)
@@ -121,19 +122,21 @@ static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev)
121 sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group); 122 sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group);
122} 123}
123 124
124/* Mutex protecting device creation against CPU hotplug */ 125/* Mutex protecting device creation against CPU hotplug: */
125static DEFINE_MUTEX(therm_cpu_lock); 126static DEFINE_MUTEX(therm_cpu_lock);
126 127
127/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 128/* Get notified when a cpu comes on/off. Be hotplug friendly. */
128static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb, 129static __cpuinit int
129 unsigned long action, 130thermal_throttle_cpu_callback(struct notifier_block *nfb,
130 void *hcpu) 131 unsigned long action,
132 void *hcpu)
131{ 133{
132 unsigned int cpu = (unsigned long)hcpu; 134 unsigned int cpu = (unsigned long)hcpu;
133 struct sys_device *sys_dev; 135 struct sys_device *sys_dev;
134 int err = 0; 136 int err = 0;
135 137
136 sys_dev = get_cpu_sysdev(cpu); 138 sys_dev = get_cpu_sysdev(cpu);
139
137 switch (action) { 140 switch (action) {
138 case CPU_UP_PREPARE: 141 case CPU_UP_PREPARE:
139 case CPU_UP_PREPARE_FROZEN: 142 case CPU_UP_PREPARE_FROZEN:
diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c
index 23ee9e730f78..d746df2909c9 100644
--- a/arch/x86/kernel/cpu/mcheck/threshold.c
+++ b/arch/x86/kernel/cpu/mcheck/threshold.c
@@ -17,7 +17,7 @@ static void default_threshold_interrupt(void)
17 17
18void (*mce_threshold_vector)(void) = default_threshold_interrupt; 18void (*mce_threshold_vector)(void) = default_threshold_interrupt;
19 19
20asmlinkage void mce_threshold_interrupt(void) 20asmlinkage void smp_threshold_interrupt(void)
21{ 21{
22 exit_idle(); 22 exit_idle();
23 irq_enter(); 23 irq_enter();
diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
index 2a043d89811d..81b02487090b 100644
--- a/arch/x86/kernel/cpu/mcheck/winchip.c
+++ b/arch/x86/kernel/cpu/mcheck/winchip.c
@@ -2,11 +2,10 @@
2 * IDT Winchip specific Machine Check Exception Reporting 2 * IDT Winchip specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5
6#include <linux/init.h>
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
10 9
11#include <asm/processor.h> 10#include <asm/processor.h>
12#include <asm/system.h> 11#include <asm/system.h>
@@ -14,7 +13,7 @@
14 13
15#include "mce.h" 14#include "mce.h"
16 15
17/* Machine check handler for WinChip C6 */ 16/* Machine check handler for WinChip C6: */
18static void winchip_machine_check(struct pt_regs *regs, long error_code) 17static void winchip_machine_check(struct pt_regs *regs, long error_code)
19{ 18{
20 printk(KERN_EMERG "CPU0: Machine Check Exception.\n"); 19 printk(KERN_EMERG "CPU0: Machine Check Exception.\n");
@@ -25,12 +24,18 @@ static void winchip_machine_check(struct pt_regs *regs, long error_code)
25void winchip_mcheck_init(struct cpuinfo_x86 *c) 24void winchip_mcheck_init(struct cpuinfo_x86 *c)
26{ 25{
27 u32 lo, hi; 26 u32 lo, hi;
27
28 machine_check_vector = winchip_machine_check; 28 machine_check_vector = winchip_machine_check;
29 /* Make sure the vector pointer is visible before we enable MCEs: */
29 wmb(); 30 wmb();
31
30 rdmsr(MSR_IDT_FCR1, lo, hi); 32 rdmsr(MSR_IDT_FCR1, lo, hi);
31 lo |= (1<<2); /* Enable EIERRINT (int 18 MCE) */ 33 lo |= (1<<2); /* Enable EIERRINT (int 18 MCE) */
32 lo &= ~(1<<4); /* Enable MCE */ 34 lo &= ~(1<<4); /* Enable MCE */
33 wrmsr(MSR_IDT_FCR1, lo, hi); 35 wrmsr(MSR_IDT_FCR1, lo, hi);
36
34 set_in_cr4(X86_CR4_MCE); 37 set_in_cr4(X86_CR4_MCE);
35 printk(KERN_INFO "Winchip machine check reporting enabled on CPU#0.\n"); 38
39 printk(KERN_INFO
40 "Winchip machine check reporting enabled on CPU#0.\n");
36} 41}
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 895c82e78455..275bc142cd5d 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -968,6 +968,13 @@ fixed_mode_idx(struct perf_counter *counter, struct hw_perf_counter *hwc)
968 if (!x86_pmu.num_counters_fixed) 968 if (!x86_pmu.num_counters_fixed)
969 return -1; 969 return -1;
970 970
971 /*
972 * Quirk, IA32_FIXED_CTRs do not work on current Atom processors:
973 */
974 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
975 boot_cpu_data.x86_model == 28)
976 return -1;
977
971 event = hwc->config & ARCH_PERFMON_EVENT_MASK; 978 event = hwc->config & ARCH_PERFMON_EVENT_MASK;
972 979
973 if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS))) 980 if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS)))
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index a4742a340d8d..de74f0a3e0ed 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -963,6 +963,8 @@ END(\sym)
963#ifdef CONFIG_SMP 963#ifdef CONFIG_SMP
964apicinterrupt IRQ_MOVE_CLEANUP_VECTOR \ 964apicinterrupt IRQ_MOVE_CLEANUP_VECTOR \
965 irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt 965 irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt
966apicinterrupt REBOOT_VECTOR \
967 reboot_interrupt smp_reboot_interrupt
966#endif 968#endif
967 969
968#ifdef CONFIG_X86_UV 970#ifdef CONFIG_X86_UV
@@ -994,10 +996,15 @@ apicinterrupt INVALIDATE_TLB_VECTOR_START+7 \
994#endif 996#endif
995 997
996apicinterrupt THRESHOLD_APIC_VECTOR \ 998apicinterrupt THRESHOLD_APIC_VECTOR \
997 threshold_interrupt mce_threshold_interrupt 999 threshold_interrupt smp_threshold_interrupt
998apicinterrupt THERMAL_APIC_VECTOR \ 1000apicinterrupt THERMAL_APIC_VECTOR \
999 thermal_interrupt smp_thermal_interrupt 1001 thermal_interrupt smp_thermal_interrupt
1000 1002
1003#ifdef CONFIG_X86_MCE
1004apicinterrupt MCE_SELF_VECTOR \
1005 mce_self_interrupt smp_mce_self_interrupt
1006#endif
1007
1001#ifdef CONFIG_SMP 1008#ifdef CONFIG_SMP
1002apicinterrupt CALL_FUNCTION_SINGLE_VECTOR \ 1009apicinterrupt CALL_FUNCTION_SINGLE_VECTOR \
1003 call_function_single_interrupt smp_call_function_single_interrupt 1010 call_function_single_interrupt smp_call_function_single_interrupt
@@ -1379,7 +1386,7 @@ errorentry xen_stack_segment do_stack_segment
1379errorentry general_protection do_general_protection 1386errorentry general_protection do_general_protection
1380errorentry page_fault do_page_fault 1387errorentry page_fault do_page_fault
1381#ifdef CONFIG_X86_MCE 1388#ifdef CONFIG_X86_MCE
1382paranoidzeroentry machine_check do_machine_check 1389paranoidzeroentry machine_check *machine_check_vector(%rip)
1383#endif 1390#endif
1384 1391
1385 /* 1392 /*
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 38287b5f116e..b0cdde6932f5 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -12,6 +12,7 @@
12#include <asm/io_apic.h> 12#include <asm/io_apic.h>
13#include <asm/irq.h> 13#include <asm/irq.h>
14#include <asm/idle.h> 14#include <asm/idle.h>
15#include <asm/mce.h>
15#include <asm/hw_irq.h> 16#include <asm/hw_irq.h>
16 17
17atomic_t irq_err_count; 18atomic_t irq_err_count;
@@ -96,13 +97,23 @@ static int show_other_interrupts(struct seq_file *p, int prec)
96 for_each_online_cpu(j) 97 for_each_online_cpu(j)
97 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count); 98 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count);
98 seq_printf(p, " Thermal event interrupts\n"); 99 seq_printf(p, " Thermal event interrupts\n");
99# ifdef CONFIG_X86_64 100# ifdef CONFIG_X86_MCE_THRESHOLD
100 seq_printf(p, "%*s: ", prec, "THR"); 101 seq_printf(p, "%*s: ", prec, "THR");
101 for_each_online_cpu(j) 102 for_each_online_cpu(j)
102 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count); 103 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
103 seq_printf(p, " Threshold APIC interrupts\n"); 104 seq_printf(p, " Threshold APIC interrupts\n");
104# endif 105# endif
105#endif 106#endif
107#ifdef CONFIG_X86_NEW_MCE
108 seq_printf(p, "%*s: ", prec, "MCE");
109 for_each_online_cpu(j)
110 seq_printf(p, "%10u ", per_cpu(mce_exception_count, j));
111 seq_printf(p, " Machine check exceptions\n");
112 seq_printf(p, "%*s: ", prec, "MCP");
113 for_each_online_cpu(j)
114 seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
115 seq_printf(p, " Machine check polls\n");
116#endif
106 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); 117 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
107#if defined(CONFIG_X86_IO_APIC) 118#if defined(CONFIG_X86_IO_APIC)
108 seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count)); 119 seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count));
@@ -185,10 +196,14 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
185#endif 196#endif
186#ifdef CONFIG_X86_MCE 197#ifdef CONFIG_X86_MCE
187 sum += irq_stats(cpu)->irq_thermal_count; 198 sum += irq_stats(cpu)->irq_thermal_count;
188# ifdef CONFIG_X86_64 199# ifdef CONFIG_X86_MCE_THRESHOLD
189 sum += irq_stats(cpu)->irq_threshold_count; 200 sum += irq_stats(cpu)->irq_threshold_count;
190# endif 201# endif
191#endif 202#endif
203#ifdef CONFIG_X86_NEW_MCE
204 sum += per_cpu(mce_exception_count, cpu);
205 sum += per_cpu(mce_poll_count, cpu);
206#endif
192 return sum; 207 return sum;
193} 208}
194 209
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 267c6624c77f..696f0e475c2d 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -173,6 +173,9 @@ static void __init smp_intr_init(void)
173 /* Low priority IPI to cleanup after moving an irq */ 173 /* Low priority IPI to cleanup after moving an irq */
174 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); 174 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
175 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors); 175 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
176
177 /* IPI used for rebooting/stopping */
178 alloc_intr_gate(REBOOT_VECTOR, reboot_interrupt);
176#endif 179#endif
177#endif /* CONFIG_SMP */ 180#endif /* CONFIG_SMP */
178} 181}
diff --git a/arch/x86/kernel/module_64.c b/arch/x86/kernel/module.c
index c23880b90b5c..89f386f044e4 100644
--- a/arch/x86/kernel/module_64.c
+++ b/arch/x86/kernel/module.c
@@ -1,6 +1,5 @@
1/* Kernel module help for x86-64 1/* Kernel module help for x86.
2 Copyright (C) 2001 Rusty Russell. 2 Copyright (C) 2001 Rusty Russell.
3 Copyright (C) 2002,2003 Andi Kleen, SuSE Labs.
4 3
5 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -22,23 +21,18 @@
22#include <linux/fs.h> 21#include <linux/fs.h>
23#include <linux/string.h> 22#include <linux/string.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/mm.h>
26#include <linux/slab.h>
27#include <linux/bug.h> 24#include <linux/bug.h>
25#include <linux/mm.h>
28 26
29#include <asm/system.h> 27#include <asm/system.h>
30#include <asm/page.h> 28#include <asm/page.h>
31#include <asm/pgtable.h> 29#include <asm/pgtable.h>
32 30
31#if 0
32#define DEBUGP printk
33#else
33#define DEBUGP(fmt...) 34#define DEBUGP(fmt...)
34 35#endif
35#ifndef CONFIG_UML
36void module_free(struct module *mod, void *module_region)
37{
38 vfree(module_region);
39 /* FIXME: If module_region == mod->init_region, trim exception
40 table entries. */
41}
42 36
43void *module_alloc(unsigned long size) 37void *module_alloc(unsigned long size)
44{ 38{
@@ -54,9 +48,15 @@ void *module_alloc(unsigned long size)
54 if (!area) 48 if (!area)
55 return NULL; 49 return NULL;
56 50
57 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC); 51 return __vmalloc_area(area, GFP_KERNEL | __GFP_HIGHMEM,
52 PAGE_KERNEL_EXEC);
53}
54
55/* Free memory returned from module_alloc */
56void module_free(struct module *mod, void *module_region)
57{
58 vfree(module_region);
58} 59}
59#endif
60 60
61/* We don't need anything special. */ 61/* We don't need anything special. */
62int module_frob_arch_sections(Elf_Ehdr *hdr, 62int module_frob_arch_sections(Elf_Ehdr *hdr,
@@ -67,6 +67,58 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
67 return 0; 67 return 0;
68} 68}
69 69
70#ifdef CONFIG_X86_32
71int apply_relocate(Elf32_Shdr *sechdrs,
72 const char *strtab,
73 unsigned int symindex,
74 unsigned int relsec,
75 struct module *me)
76{
77 unsigned int i;
78 Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;
79 Elf32_Sym *sym;
80 uint32_t *location;
81
82 DEBUGP("Applying relocate section %u to %u\n", relsec,
83 sechdrs[relsec].sh_info);
84 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
85 /* This is where to make the change */
86 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
87 + rel[i].r_offset;
88 /* This is the symbol it is referring to. Note that all
89 undefined symbols have been resolved. */
90 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
91 + ELF32_R_SYM(rel[i].r_info);
92
93 switch (ELF32_R_TYPE(rel[i].r_info)) {
94 case R_386_32:
95 /* We add the value into the location given */
96 *location += sym->st_value;
97 break;
98 case R_386_PC32:
99 /* Add the value, subtract its postition */
100 *location += sym->st_value - (uint32_t)location;
101 break;
102 default:
103 printk(KERN_ERR "module %s: Unknown relocation: %u\n",
104 me->name, ELF32_R_TYPE(rel[i].r_info));
105 return -ENOEXEC;
106 }
107 }
108 return 0;
109}
110
111int apply_relocate_add(Elf32_Shdr *sechdrs,
112 const char *strtab,
113 unsigned int symindex,
114 unsigned int relsec,
115 struct module *me)
116{
117 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
118 me->name);
119 return -ENOEXEC;
120}
121#else /*X86_64*/
70int apply_relocate_add(Elf64_Shdr *sechdrs, 122int apply_relocate_add(Elf64_Shdr *sechdrs,
71 const char *strtab, 123 const char *strtab,
72 unsigned int symindex, 124 unsigned int symindex,
@@ -147,6 +199,8 @@ int apply_relocate(Elf_Shdr *sechdrs,
147 return -ENOSYS; 199 return -ENOSYS;
148} 200}
149 201
202#endif
203
150int module_finalize(const Elf_Ehdr *hdr, 204int module_finalize(const Elf_Ehdr *hdr,
151 const Elf_Shdr *sechdrs, 205 const Elf_Shdr *sechdrs,
152 struct module *me) 206 struct module *me)
diff --git a/arch/x86/kernel/module_32.c b/arch/x86/kernel/module_32.c
deleted file mode 100644
index 0edd819050e7..000000000000
--- a/arch/x86/kernel/module_32.c
+++ /dev/null
@@ -1,152 +0,0 @@
1/* Kernel module help for i386.
2 Copyright (C) 2001 Rusty Russell.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18#include <linux/moduleloader.h>
19#include <linux/elf.h>
20#include <linux/vmalloc.h>
21#include <linux/fs.h>
22#include <linux/string.h>
23#include <linux/kernel.h>
24#include <linux/bug.h>
25
26#if 0
27#define DEBUGP printk
28#else
29#define DEBUGP(fmt...)
30#endif
31
32void *module_alloc(unsigned long size)
33{
34 if (size == 0)
35 return NULL;
36 return vmalloc_exec(size);
37}
38
39
40/* Free memory returned from module_alloc */
41void module_free(struct module *mod, void *module_region)
42{
43 vfree(module_region);
44 /* FIXME: If module_region == mod->init_region, trim exception
45 table entries. */
46}
47
48/* We don't need anything special. */
49int module_frob_arch_sections(Elf_Ehdr *hdr,
50 Elf_Shdr *sechdrs,
51 char *secstrings,
52 struct module *mod)
53{
54 return 0;
55}
56
57int apply_relocate(Elf32_Shdr *sechdrs,
58 const char *strtab,
59 unsigned int symindex,
60 unsigned int relsec,
61 struct module *me)
62{
63 unsigned int i;
64 Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;
65 Elf32_Sym *sym;
66 uint32_t *location;
67
68 DEBUGP("Applying relocate section %u to %u\n", relsec,
69 sechdrs[relsec].sh_info);
70 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
71 /* This is where to make the change */
72 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
73 + rel[i].r_offset;
74 /* This is the symbol it is referring to. Note that all
75 undefined symbols have been resolved. */
76 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
77 + ELF32_R_SYM(rel[i].r_info);
78
79 switch (ELF32_R_TYPE(rel[i].r_info)) {
80 case R_386_32:
81 /* We add the value into the location given */
82 *location += sym->st_value;
83 break;
84 case R_386_PC32:
85 /* Add the value, subtract its postition */
86 *location += sym->st_value - (uint32_t)location;
87 break;
88 default:
89 printk(KERN_ERR "module %s: Unknown relocation: %u\n",
90 me->name, ELF32_R_TYPE(rel[i].r_info));
91 return -ENOEXEC;
92 }
93 }
94 return 0;
95}
96
97int apply_relocate_add(Elf32_Shdr *sechdrs,
98 const char *strtab,
99 unsigned int symindex,
100 unsigned int relsec,
101 struct module *me)
102{
103 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
104 me->name);
105 return -ENOEXEC;
106}
107
108int module_finalize(const Elf_Ehdr *hdr,
109 const Elf_Shdr *sechdrs,
110 struct module *me)
111{
112 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL,
113 *para = NULL;
114 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
115
116 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
117 if (!strcmp(".text", secstrings + s->sh_name))
118 text = s;
119 if (!strcmp(".altinstructions", secstrings + s->sh_name))
120 alt = s;
121 if (!strcmp(".smp_locks", secstrings + s->sh_name))
122 locks = s;
123 if (!strcmp(".parainstructions", secstrings + s->sh_name))
124 para = s;
125 }
126
127 if (alt) {
128 /* patch .altinstructions */
129 void *aseg = (void *)alt->sh_addr;
130 apply_alternatives(aseg, aseg + alt->sh_size);
131 }
132 if (locks && text) {
133 void *lseg = (void *)locks->sh_addr;
134 void *tseg = (void *)text->sh_addr;
135 alternatives_smp_module_add(me, me->name,
136 lseg, lseg + locks->sh_size,
137 tseg, tseg + text->sh_size);
138 }
139
140 if (para) {
141 void *pseg = (void *)para->sh_addr;
142 apply_paravirt(pseg, pseg + para->sh_size);
143 }
144
145 return module_bug_finalize(hdr, sechdrs, me);
146}
147
148void module_arch_cleanup(struct module *mod)
149{
150 alternatives_smp_module_del(mod);
151 module_bug_cleanup(mod);
152}
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d1c636bf31a7..be5ae80f897f 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -301,15 +301,13 @@ static void __init reserve_brk(void)
301 301
302#ifdef CONFIG_BLK_DEV_INITRD 302#ifdef CONFIG_BLK_DEV_INITRD
303 303
304#ifdef CONFIG_X86_32
305
306#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) 304#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
307static void __init relocate_initrd(void) 305static void __init relocate_initrd(void)
308{ 306{
309 307
310 u64 ramdisk_image = boot_params.hdr.ramdisk_image; 308 u64 ramdisk_image = boot_params.hdr.ramdisk_image;
311 u64 ramdisk_size = boot_params.hdr.ramdisk_size; 309 u64 ramdisk_size = boot_params.hdr.ramdisk_size;
312 u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; 310 u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
313 u64 ramdisk_here; 311 u64 ramdisk_here;
314 unsigned long slop, clen, mapaddr; 312 unsigned long slop, clen, mapaddr;
315 char *p, *q; 313 char *p, *q;
@@ -365,14 +363,13 @@ static void __init relocate_initrd(void)
365 ramdisk_image, ramdisk_image + ramdisk_size - 1, 363 ramdisk_image, ramdisk_image + ramdisk_size - 1,
366 ramdisk_here, ramdisk_here + ramdisk_size - 1); 364 ramdisk_here, ramdisk_here + ramdisk_size - 1);
367} 365}
368#endif
369 366
370static void __init reserve_initrd(void) 367static void __init reserve_initrd(void)
371{ 368{
372 u64 ramdisk_image = boot_params.hdr.ramdisk_image; 369 u64 ramdisk_image = boot_params.hdr.ramdisk_image;
373 u64 ramdisk_size = boot_params.hdr.ramdisk_size; 370 u64 ramdisk_size = boot_params.hdr.ramdisk_size;
374 u64 ramdisk_end = ramdisk_image + ramdisk_size; 371 u64 ramdisk_end = ramdisk_image + ramdisk_size;
375 u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; 372 u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
376 373
377 if (!boot_params.hdr.type_of_loader || 374 if (!boot_params.hdr.type_of_loader ||
378 !ramdisk_image || !ramdisk_size) 375 !ramdisk_image || !ramdisk_size)
@@ -402,14 +399,8 @@ static void __init reserve_initrd(void)
402 return; 399 return;
403 } 400 }
404 401
405#ifdef CONFIG_X86_32
406 relocate_initrd(); 402 relocate_initrd();
407#else 403
408 printk(KERN_ERR "initrd extends beyond end of memory "
409 "(0x%08llx > 0x%08llx)\ndisabling initrd\n",
410 ramdisk_end, end_of_lowmem);
411 initrd_start = 0;
412#endif
413 free_early(ramdisk_image, ramdisk_end); 404 free_early(ramdisk_image, ramdisk_end);
414} 405}
415#else 406#else
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 0a813b17b172..4c578751e94e 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -24,11 +24,11 @@
24#include <asm/ucontext.h> 24#include <asm/ucontext.h>
25#include <asm/i387.h> 25#include <asm/i387.h>
26#include <asm/vdso.h> 26#include <asm/vdso.h>
27#include <asm/mce.h>
27 28
28#ifdef CONFIG_X86_64 29#ifdef CONFIG_X86_64
29#include <asm/proto.h> 30#include <asm/proto.h>
30#include <asm/ia32_unistd.h> 31#include <asm/ia32_unistd.h>
31#include <asm/mce.h>
32#endif /* CONFIG_X86_64 */ 32#endif /* CONFIG_X86_64 */
33 33
34#include <asm/syscall.h> 34#include <asm/syscall.h>
@@ -856,10 +856,10 @@ 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#if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE) 859#ifdef CONFIG_X86_NEW_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_user(); 862 mce_notify_process();
863#endif /* CONFIG_X86_64 && CONFIG_X86_MCE */ 863#endif /* CONFIG_X86_64 && CONFIG_X86_MCE */
864 864
865 /* deal with pending signal delivery */ 865 /* deal with pending signal delivery */
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 28f5fb495a66..ec1de97600e7 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -150,14 +150,40 @@ void native_send_call_func_ipi(const struct cpumask *mask)
150 * this function calls the 'stop' function on all other CPUs in the system. 150 * this function calls the 'stop' function on all other CPUs in the system.
151 */ 151 */
152 152
153asmlinkage void smp_reboot_interrupt(void)
154{
155 ack_APIC_irq();
156 irq_enter();
157 stop_this_cpu(NULL);
158 irq_exit();
159}
160
153static void native_smp_send_stop(void) 161static void native_smp_send_stop(void)
154{ 162{
155 unsigned long flags; 163 unsigned long flags;
164 unsigned long wait;
156 165
157 if (reboot_force) 166 if (reboot_force)
158 return; 167 return;
159 168
160 smp_call_function(stop_this_cpu, NULL, 0); 169 /*
170 * Use an own vector here because smp_call_function
171 * does lots of things not suitable in a panic situation.
172 * On most systems we could also use an NMI here,
173 * but there are a few systems around where NMI
174 * is problematic so stay with an non NMI for now
175 * (this implies we cannot stop CPUs spinning with irq off
176 * currently)
177 */
178 if (num_online_cpus() > 1) {
179 apic->send_IPI_allbutself(REBOOT_VECTOR);
180
181 /* Don't wait longer than a second */
182 wait = USEC_PER_SEC;
183 while (num_online_cpus() > 1 && wait--)
184 udelay(1);
185 }
186
161 local_irq_save(flags); 187 local_irq_save(flags);
162 disable_local_APIC(); 188 disable_local_APIC();
163 local_irq_restore(flags); 189 local_irq_restore(flags);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 7c80007ea5f7..2fecda69ee64 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -873,7 +873,7 @@ int __cpuinit native_cpu_up(unsigned int cpu)
873 873
874 err = do_boot_cpu(apicid, cpu); 874 err = do_boot_cpu(apicid, cpu);
875 875
876 zap_low_mappings(); 876 zap_low_mappings(false);
877 low_mappings = 0; 877 low_mappings = 0;
878#else 878#else
879 err = do_boot_cpu(apicid, cpu); 879 err = do_boot_cpu(apicid, cpu);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index e7a28e6aa4bc..5f935f0d5861 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -803,15 +803,15 @@ unsigned long patch_espfix_desc(unsigned long uesp, unsigned long kesp)
803 803
804 return new_kesp; 804 return new_kesp;
805} 805}
806#else 806#endif
807
807asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void) 808asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void)
808{ 809{
809} 810}
810 811
811asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void) 812asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
812{ 813{
813} 814}
814#endif
815 815
816/* 816/*
817 * 'math_state_restore()' saves the current math information in the 817 * 'math_state_restore()' saves the current math information in the
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 4c85b2e2bb65..367e87882041 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -108,6 +108,8 @@ SECTIONS
108 /* Data */ 108 /* Data */
109 . = ALIGN(PAGE_SIZE); 109 . = ALIGN(PAGE_SIZE);
110 .data : AT(ADDR(.data) - LOAD_OFFSET) { 110 .data : AT(ADDR(.data) - LOAD_OFFSET) {
111 /* Start of data section */
112 _sdata = .;
111 DATA_DATA 113 DATA_DATA
112 CONSTRUCTORS 114 CONSTRUCTORS
113 115
diff --git a/arch/x86/lguest/Kconfig b/arch/x86/lguest/Kconfig
index 8dab8f7844d3..38718041efc3 100644
--- a/arch/x86/lguest/Kconfig
+++ b/arch/x86/lguest/Kconfig
@@ -2,7 +2,6 @@ config LGUEST_GUEST
2 bool "Lguest guest support" 2 bool "Lguest guest support"
3 select PARAVIRT 3 select PARAVIRT
4 depends on X86_32 4 depends on X86_32
5 depends on !X86_PAE
6 select VIRTIO 5 select VIRTIO
7 select VIRTIO_RING 6 select VIRTIO_RING
8 select VIRTIO_CONSOLE 7 select VIRTIO_CONSOLE
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 4e0c26559395..7bc65f0f62c4 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -87,7 +87,7 @@ struct lguest_data lguest_data = {
87 87
88/*G:037 async_hcall() is pretty simple: I'm quite proud of it really. We have a 88/*G:037 async_hcall() is pretty simple: I'm quite proud of it really. We have a
89 * ring buffer of stored hypercalls which the Host will run though next time we 89 * ring buffer of stored hypercalls which the Host will run though next time we
90 * do a normal hypercall. Each entry in the ring has 4 slots for the hypercall 90 * do a normal hypercall. Each entry in the ring has 5 slots for the hypercall
91 * arguments, and a "hcall_status" word which is 0 if the call is ready to go, 91 * arguments, and a "hcall_status" word which is 0 if the call is ready to go,
92 * and 255 once the Host has finished with it. 92 * and 255 once the Host has finished with it.
93 * 93 *
@@ -96,7 +96,8 @@ struct lguest_data lguest_data = {
96 * effect of causing the Host to run all the stored calls in the ring buffer 96 * effect of causing the Host to run all the stored calls in the ring buffer
97 * which empties it for next time! */ 97 * which empties it for next time! */
98static void async_hcall(unsigned long call, unsigned long arg1, 98static void async_hcall(unsigned long call, unsigned long arg1,
99 unsigned long arg2, unsigned long arg3) 99 unsigned long arg2, unsigned long arg3,
100 unsigned long arg4)
100{ 101{
101 /* Note: This code assumes we're uniprocessor. */ 102 /* Note: This code assumes we're uniprocessor. */
102 static unsigned int next_call; 103 static unsigned int next_call;
@@ -108,12 +109,13 @@ static void async_hcall(unsigned long call, unsigned long arg1,
108 local_irq_save(flags); 109 local_irq_save(flags);
109 if (lguest_data.hcall_status[next_call] != 0xFF) { 110 if (lguest_data.hcall_status[next_call] != 0xFF) {
110 /* Table full, so do normal hcall which will flush table. */ 111 /* Table full, so do normal hcall which will flush table. */
111 kvm_hypercall3(call, arg1, arg2, arg3); 112 kvm_hypercall4(call, arg1, arg2, arg3, arg4);
112 } else { 113 } else {
113 lguest_data.hcalls[next_call].arg0 = call; 114 lguest_data.hcalls[next_call].arg0 = call;
114 lguest_data.hcalls[next_call].arg1 = arg1; 115 lguest_data.hcalls[next_call].arg1 = arg1;
115 lguest_data.hcalls[next_call].arg2 = arg2; 116 lguest_data.hcalls[next_call].arg2 = arg2;
116 lguest_data.hcalls[next_call].arg3 = arg3; 117 lguest_data.hcalls[next_call].arg3 = arg3;
118 lguest_data.hcalls[next_call].arg4 = arg4;
117 /* Arguments must all be written before we mark it to go */ 119 /* Arguments must all be written before we mark it to go */
118 wmb(); 120 wmb();
119 lguest_data.hcall_status[next_call] = 0; 121 lguest_data.hcall_status[next_call] = 0;
@@ -141,7 +143,7 @@ static void lazy_hcall1(unsigned long call,
141 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) 143 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
142 kvm_hypercall1(call, arg1); 144 kvm_hypercall1(call, arg1);
143 else 145 else
144 async_hcall(call, arg1, 0, 0); 146 async_hcall(call, arg1, 0, 0, 0);
145} 147}
146 148
147static void lazy_hcall2(unsigned long call, 149static void lazy_hcall2(unsigned long call,
@@ -151,7 +153,7 @@ static void lazy_hcall2(unsigned long call,
151 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) 153 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
152 kvm_hypercall2(call, arg1, arg2); 154 kvm_hypercall2(call, arg1, arg2);
153 else 155 else
154 async_hcall(call, arg1, arg2, 0); 156 async_hcall(call, arg1, arg2, 0, 0);
155} 157}
156 158
157static void lazy_hcall3(unsigned long call, 159static void lazy_hcall3(unsigned long call,
@@ -162,9 +164,23 @@ static void lazy_hcall3(unsigned long call,
162 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) 164 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
163 kvm_hypercall3(call, arg1, arg2, arg3); 165 kvm_hypercall3(call, arg1, arg2, arg3);
164 else 166 else
165 async_hcall(call, arg1, arg2, arg3); 167 async_hcall(call, arg1, arg2, arg3, 0);
166} 168}
167 169
170#ifdef CONFIG_X86_PAE
171static void lazy_hcall4(unsigned long call,
172 unsigned long arg1,
173 unsigned long arg2,
174 unsigned long arg3,
175 unsigned long arg4)
176{
177 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
178 kvm_hypercall4(call, arg1, arg2, arg3, arg4);
179 else
180 async_hcall(call, arg1, arg2, arg3, arg4);
181}
182#endif
183
168/* When lazy mode is turned off reset the per-cpu lazy mode variable and then 184/* When lazy mode is turned off reset the per-cpu lazy mode variable and then
169 * issue the do-nothing hypercall to flush any stored calls. */ 185 * issue the do-nothing hypercall to flush any stored calls. */
170static void lguest_leave_lazy_mmu_mode(void) 186static void lguest_leave_lazy_mmu_mode(void)
@@ -179,7 +195,7 @@ static void lguest_end_context_switch(struct task_struct *next)
179 paravirt_end_context_switch(next); 195 paravirt_end_context_switch(next);
180} 196}
181 197
182/*G:033 198/*G:032
183 * After that diversion we return to our first native-instruction 199 * After that diversion we return to our first native-instruction
184 * replacements: four functions for interrupt control. 200 * replacements: four functions for interrupt control.
185 * 201 *
@@ -199,30 +215,28 @@ static unsigned long save_fl(void)
199{ 215{
200 return lguest_data.irq_enabled; 216 return lguest_data.irq_enabled;
201} 217}
202PV_CALLEE_SAVE_REGS_THUNK(save_fl);
203
204/* restore_flags() just sets the flags back to the value given. */
205static void restore_fl(unsigned long flags)
206{
207 lguest_data.irq_enabled = flags;
208}
209PV_CALLEE_SAVE_REGS_THUNK(restore_fl);
210 218
211/* Interrupts go off... */ 219/* Interrupts go off... */
212static void irq_disable(void) 220static void irq_disable(void)
213{ 221{
214 lguest_data.irq_enabled = 0; 222 lguest_data.irq_enabled = 0;
215} 223}
224
225/* Let's pause a moment. Remember how I said these are called so often?
226 * Jeremy Fitzhardinge optimized them so hard early in 2009 that he had to
227 * break some rules. In particular, these functions are assumed to save their
228 * own registers if they need to: normal C functions assume they can trash the
229 * eax register. To use normal C functions, we use
230 * PV_CALLEE_SAVE_REGS_THUNK(), which pushes %eax onto the stack, calls the
231 * C function, then restores it. */
232PV_CALLEE_SAVE_REGS_THUNK(save_fl);
216PV_CALLEE_SAVE_REGS_THUNK(irq_disable); 233PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
234/*:*/
217 235
218/* Interrupts go on... */ 236/* These are in i386_head.S */
219static void irq_enable(void) 237extern void lg_irq_enable(void);
220{ 238extern void lg_restore_fl(unsigned long flags);
221 lguest_data.irq_enabled = X86_EFLAGS_IF;
222}
223PV_CALLEE_SAVE_REGS_THUNK(irq_enable);
224 239
225/*:*/
226/*M:003 Note that we don't check for outstanding interrupts when we re-enable 240/*M:003 Note that we don't check for outstanding interrupts when we re-enable
227 * them (or when we unmask an interrupt). This seems to work for the moment, 241 * them (or when we unmask an interrupt). This seems to work for the moment,
228 * since interrupts are rare and we'll just get the interrupt on the next timer 242 * since interrupts are rare and we'll just get the interrupt on the next timer
@@ -368,8 +382,8 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
368 case 1: /* Basic feature request. */ 382 case 1: /* Basic feature request. */
369 /* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */ 383 /* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */
370 *cx &= 0x00002201; 384 *cx &= 0x00002201;
371 /* SSE, SSE2, FXSR, MMX, CMOV, CMPXCHG8B, TSC, FPU. */ 385 /* SSE, SSE2, FXSR, MMX, CMOV, CMPXCHG8B, TSC, FPU, PAE. */
372 *dx &= 0x07808111; 386 *dx &= 0x07808151;
373 /* The Host can do a nice optimization if it knows that the 387 /* The Host can do a nice optimization if it knows that the
374 * kernel mappings (addresses above 0xC0000000 or whatever 388 * kernel mappings (addresses above 0xC0000000 or whatever
375 * PAGE_OFFSET is set to) haven't changed. But Linux calls 389 * PAGE_OFFSET is set to) haven't changed. But Linux calls
@@ -388,6 +402,11 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
388 if (*ax > 0x80000008) 402 if (*ax > 0x80000008)
389 *ax = 0x80000008; 403 *ax = 0x80000008;
390 break; 404 break;
405 case 0x80000001:
406 /* Here we should fix nx cap depending on host. */
407 /* For this version of PAE, we just clear NX bit. */
408 *dx &= ~(1 << 20);
409 break;
391 } 410 }
392} 411}
393 412
@@ -521,25 +540,52 @@ static void lguest_write_cr4(unsigned long val)
521static void lguest_pte_update(struct mm_struct *mm, unsigned long addr, 540static void lguest_pte_update(struct mm_struct *mm, unsigned long addr,
522 pte_t *ptep) 541 pte_t *ptep)
523{ 542{
543#ifdef CONFIG_X86_PAE
544 lazy_hcall4(LHCALL_SET_PTE, __pa(mm->pgd), addr,
545 ptep->pte_low, ptep->pte_high);
546#else
524 lazy_hcall3(LHCALL_SET_PTE, __pa(mm->pgd), addr, ptep->pte_low); 547 lazy_hcall3(LHCALL_SET_PTE, __pa(mm->pgd), addr, ptep->pte_low);
548#endif
525} 549}
526 550
527static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr, 551static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
528 pte_t *ptep, pte_t pteval) 552 pte_t *ptep, pte_t pteval)
529{ 553{
530 *ptep = pteval; 554 native_set_pte(ptep, pteval);
531 lguest_pte_update(mm, addr, ptep); 555 lguest_pte_update(mm, addr, ptep);
532} 556}
533 557
534/* The Guest calls this to set a top-level entry. Again, we set the entry then 558/* The Guest calls lguest_set_pud to set a top-level entry and lguest_set_pmd
535 * tell the Host which top-level page we changed, and the index of the entry we 559 * to set a middle-level entry when PAE is activated.
536 * changed. */ 560 * Again, we set the entry then tell the Host which page we changed,
561 * and the index of the entry we changed. */
562#ifdef CONFIG_X86_PAE
563static void lguest_set_pud(pud_t *pudp, pud_t pudval)
564{
565 native_set_pud(pudp, pudval);
566
567 /* 32 bytes aligned pdpt address and the index. */
568 lazy_hcall2(LHCALL_SET_PGD, __pa(pudp) & 0xFFFFFFE0,
569 (__pa(pudp) & 0x1F) / sizeof(pud_t));
570}
571
537static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) 572static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
538{ 573{
539 *pmdp = pmdval; 574 native_set_pmd(pmdp, pmdval);
540 lazy_hcall2(LHCALL_SET_PMD, __pa(pmdp) & PAGE_MASK, 575 lazy_hcall2(LHCALL_SET_PMD, __pa(pmdp) & PAGE_MASK,
541 (__pa(pmdp) & (PAGE_SIZE - 1)) / 4); 576 (__pa(pmdp) & (PAGE_SIZE - 1)) / sizeof(pmd_t));
542} 577}
578#else
579
580/* The Guest calls lguest_set_pmd to set a top-level entry when PAE is not
581 * activated. */
582static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
583{
584 native_set_pmd(pmdp, pmdval);
585 lazy_hcall2(LHCALL_SET_PGD, __pa(pmdp) & PAGE_MASK,
586 (__pa(pmdp) & (PAGE_SIZE - 1)) / sizeof(pmd_t));
587}
588#endif
543 589
544/* There are a couple of legacy places where the kernel sets a PTE, but we 590/* There are a couple of legacy places where the kernel sets a PTE, but we
545 * don't know the top level any more. This is useless for us, since we don't 591 * don't know the top level any more. This is useless for us, since we don't
@@ -552,11 +598,31 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
552 * which brings boot back to 0.25 seconds. */ 598 * which brings boot back to 0.25 seconds. */
553static void lguest_set_pte(pte_t *ptep, pte_t pteval) 599static void lguest_set_pte(pte_t *ptep, pte_t pteval)
554{ 600{
555 *ptep = pteval; 601 native_set_pte(ptep, pteval);
602 if (cr3_changed)
603 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
604}
605
606#ifdef CONFIG_X86_PAE
607static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte)
608{
609 native_set_pte_atomic(ptep, pte);
556 if (cr3_changed) 610 if (cr3_changed)
557 lazy_hcall1(LHCALL_FLUSH_TLB, 1); 611 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
558} 612}
559 613
614void lguest_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
615{
616 native_pte_clear(mm, addr, ptep);
617 lguest_pte_update(mm, addr, ptep);
618}
619
620void lguest_pmd_clear(pmd_t *pmdp)
621{
622 lguest_set_pmd(pmdp, __pmd(0));
623}
624#endif
625
560/* Unfortunately for Lguest, the pv_mmu_ops for page tables were based on 626/* Unfortunately for Lguest, the pv_mmu_ops for page tables were based on
561 * native page table operations. On native hardware you can set a new page 627 * native page table operations. On native hardware you can set a new page
562 * table entry whenever you want, but if you want to remove one you have to do 628 * table entry whenever you want, but if you want to remove one you have to do
@@ -628,13 +694,12 @@ static void __init lguest_init_IRQ(void)
628{ 694{
629 unsigned int i; 695 unsigned int i;
630 696
631 for (i = 0; i < LGUEST_IRQS; i++) { 697 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
632 int vector = FIRST_EXTERNAL_VECTOR + i;
633 /* Some systems map "vectors" to interrupts weirdly. Lguest has 698 /* Some systems map "vectors" to interrupts weirdly. Lguest has
634 * a straightforward 1 to 1 mapping, so force that here. */ 699 * a straightforward 1 to 1 mapping, so force that here. */
635 __get_cpu_var(vector_irq)[vector] = i; 700 __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;
636 if (vector != SYSCALL_VECTOR) 701 if (i != SYSCALL_VECTOR)
637 set_intr_gate(vector, interrupt[i]); 702 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
638 } 703 }
639 /* This call is required to set up for 4k stacks, where we have 704 /* This call is required to set up for 4k stacks, where we have
640 * separate stacks for hard and soft interrupts. */ 705 * separate stacks for hard and soft interrupts. */
@@ -973,10 +1038,10 @@ static void lguest_restart(char *reason)
973 * 1038 *
974 * Our current solution is to allow the paravirt back end to optionally patch 1039 * Our current solution is to allow the paravirt back end to optionally patch
975 * over the indirect calls to replace them with something more efficient. We 1040 * over the indirect calls to replace them with something more efficient. We
976 * patch the four most commonly called functions: disable interrupts, enable 1041 * patch two of the simplest of the most commonly called functions: disable
977 * interrupts, restore interrupts and save interrupts. We usually have 6 or 10 1042 * interrupts and save interrupts. We usually have 6 or 10 bytes to patch
978 * bytes to patch into: the Guest versions of these operations are small enough 1043 * into: the Guest versions of these operations are small enough that we can
979 * that we can fit comfortably. 1044 * fit comfortably.
980 * 1045 *
981 * First we need assembly templates of each of the patchable Guest operations, 1046 * First we need assembly templates of each of the patchable Guest operations,
982 * and these are in i386_head.S. */ 1047 * and these are in i386_head.S. */
@@ -987,8 +1052,6 @@ static const struct lguest_insns
987 const char *start, *end; 1052 const char *start, *end;
988} lguest_insns[] = { 1053} lguest_insns[] = {
989 [PARAVIRT_PATCH(pv_irq_ops.irq_disable)] = { lgstart_cli, lgend_cli }, 1054 [PARAVIRT_PATCH(pv_irq_ops.irq_disable)] = { lgstart_cli, lgend_cli },
990 [PARAVIRT_PATCH(pv_irq_ops.irq_enable)] = { lgstart_sti, lgend_sti },
991 [PARAVIRT_PATCH(pv_irq_ops.restore_fl)] = { lgstart_popf, lgend_popf },
992 [PARAVIRT_PATCH(pv_irq_ops.save_fl)] = { lgstart_pushf, lgend_pushf }, 1055 [PARAVIRT_PATCH(pv_irq_ops.save_fl)] = { lgstart_pushf, lgend_pushf },
993}; 1056};
994 1057
@@ -1026,6 +1089,7 @@ __init void lguest_init(void)
1026 pv_info.name = "lguest"; 1089 pv_info.name = "lguest";
1027 pv_info.paravirt_enabled = 1; 1090 pv_info.paravirt_enabled = 1;
1028 pv_info.kernel_rpl = 1; 1091 pv_info.kernel_rpl = 1;
1092 pv_info.shared_kernel_pmd = 1;
1029 1093
1030 /* We set up all the lguest overrides for sensitive operations. These 1094 /* We set up all the lguest overrides for sensitive operations. These
1031 * are detailed with the operations themselves. */ 1095 * are detailed with the operations themselves. */
@@ -1033,9 +1097,9 @@ __init void lguest_init(void)
1033 /* interrupt-related operations */ 1097 /* interrupt-related operations */
1034 pv_irq_ops.init_IRQ = lguest_init_IRQ; 1098 pv_irq_ops.init_IRQ = lguest_init_IRQ;
1035 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl); 1099 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
1036 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(restore_fl); 1100 pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl);
1037 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(irq_disable); 1101 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(irq_disable);
1038 pv_irq_ops.irq_enable = PV_CALLEE_SAVE(irq_enable); 1102 pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable);
1039 pv_irq_ops.safe_halt = lguest_safe_halt; 1103 pv_irq_ops.safe_halt = lguest_safe_halt;
1040 1104
1041 /* init-time operations */ 1105 /* init-time operations */
@@ -1071,6 +1135,12 @@ __init void lguest_init(void)
1071 pv_mmu_ops.set_pte = lguest_set_pte; 1135 pv_mmu_ops.set_pte = lguest_set_pte;
1072 pv_mmu_ops.set_pte_at = lguest_set_pte_at; 1136 pv_mmu_ops.set_pte_at = lguest_set_pte_at;
1073 pv_mmu_ops.set_pmd = lguest_set_pmd; 1137 pv_mmu_ops.set_pmd = lguest_set_pmd;
1138#ifdef CONFIG_X86_PAE
1139 pv_mmu_ops.set_pte_atomic = lguest_set_pte_atomic;
1140 pv_mmu_ops.pte_clear = lguest_pte_clear;
1141 pv_mmu_ops.pmd_clear = lguest_pmd_clear;
1142 pv_mmu_ops.set_pud = lguest_set_pud;
1143#endif
1074 pv_mmu_ops.read_cr2 = lguest_read_cr2; 1144 pv_mmu_ops.read_cr2 = lguest_read_cr2;
1075 pv_mmu_ops.read_cr3 = lguest_read_cr3; 1145 pv_mmu_ops.read_cr3 = lguest_read_cr3;
1076 pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu; 1146 pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu;
diff --git a/arch/x86/lguest/i386_head.S b/arch/x86/lguest/i386_head.S
index f79541989471..a9c8cfe61cd4 100644
--- a/arch/x86/lguest/i386_head.S
+++ b/arch/x86/lguest/i386_head.S
@@ -46,10 +46,64 @@ ENTRY(lguest_entry)
46 .globl lgstart_##name; .globl lgend_##name 46 .globl lgstart_##name; .globl lgend_##name
47 47
48LGUEST_PATCH(cli, movl $0, lguest_data+LGUEST_DATA_irq_enabled) 48LGUEST_PATCH(cli, movl $0, lguest_data+LGUEST_DATA_irq_enabled)
49LGUEST_PATCH(sti, movl $X86_EFLAGS_IF, lguest_data+LGUEST_DATA_irq_enabled)
50LGUEST_PATCH(popf, movl %eax, lguest_data+LGUEST_DATA_irq_enabled)
51LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax) 49LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax)
52/*:*/ 50
51/*G:033 But using those wrappers is inefficient (we'll see why that doesn't
52 * matter for save_fl and irq_disable later). If we write our routines
53 * carefully in assembler, we can avoid clobbering any registers and avoid
54 * jumping through the wrapper functions.
55 *
56 * I skipped over our first piece of assembler, but this one is worth studying
57 * in a bit more detail so I'll describe in easy stages. First, the routine
58 * to enable interrupts: */
59ENTRY(lg_irq_enable)
60 /* The reverse of irq_disable, this sets lguest_data.irq_enabled to
61 * X86_EFLAGS_IF (ie. "Interrupts enabled"). */
62 movl $X86_EFLAGS_IF, lguest_data+LGUEST_DATA_irq_enabled
63 /* But now we need to check if the Host wants to know: there might have
64 * been interrupts waiting to be delivered, in which case it will have
65 * set lguest_data.irq_pending to X86_EFLAGS_IF. If it's not zero, we
66 * jump to send_interrupts, otherwise we're done. */
67 testl $0, lguest_data+LGUEST_DATA_irq_pending
68 jnz send_interrupts
69 /* One cool thing about x86 is that you can do many things without using
70 * a register. In this case, the normal path hasn't needed to save or
71 * restore any registers at all! */
72 ret
73send_interrupts:
74 /* OK, now we need a register: eax is used for the hypercall number,
75 * which is LHCALL_SEND_INTERRUPTS.
76 *
77 * We used not to bother with this pending detection at all, which was
78 * much simpler. Sooner or later the Host would realize it had to
79 * send us an interrupt. But that turns out to make performance 7
80 * times worse on a simple tcp benchmark. So now we do this the hard
81 * way. */
82 pushl %eax
83 movl $LHCALL_SEND_INTERRUPTS, %eax
84 /* This is a vmcall instruction (same thing that KVM uses). Older
85 * assembler versions might not know the "vmcall" instruction, so we
86 * create one manually here. */
87 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */
88 popl %eax
89 ret
90
91/* Finally, the "popf" or "restore flags" routine. The %eax register holds the
92 * flags (in practice, either X86_EFLAGS_IF or 0): if it's X86_EFLAGS_IF we're
93 * enabling interrupts again, if it's 0 we're leaving them off. */
94ENTRY(lg_restore_fl)
95 /* This is just "lguest_data.irq_enabled = flags;" */
96 movl %eax, lguest_data+LGUEST_DATA_irq_enabled
97 /* Now, if the %eax value has enabled interrupts and
98 * lguest_data.irq_pending is set, we want to tell the Host so it can
99 * deliver any outstanding interrupts. Fortunately, both values will
100 * be X86_EFLAGS_IF (ie. 512) in that case, and the "testl"
101 * instruction will AND them together for us. If both are set, we
102 * jump to send_interrupts. */
103 testl lguest_data+LGUEST_DATA_irq_pending, %eax
104 jnz send_interrupts
105 /* Again, the normal path has used no extra registers. Clever, huh? */
106 ret
53 107
54/* These demark the EIP range where host should never deliver interrupts. */ 108/* These demark the EIP range where host should never deliver interrupts. */
55.global lguest_noirq_start 109.global lguest_noirq_start
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 80cafd76a2bd..3cd7711bb949 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -564,7 +564,7 @@ static inline void save_pg_dir(void)
564} 564}
565#endif /* !CONFIG_ACPI_SLEEP */ 565#endif /* !CONFIG_ACPI_SLEEP */
566 566
567void zap_low_mappings(void) 567void zap_low_mappings(bool early)
568{ 568{
569 int i; 569 int i;
570 570
@@ -581,7 +581,11 @@ void zap_low_mappings(void)
581 set_pgd(swapper_pg_dir+i, __pgd(0)); 581 set_pgd(swapper_pg_dir+i, __pgd(0));
582#endif 582#endif
583 } 583 }
584 flush_tlb_all(); 584
585 if (early)
586 __flush_tlb();
587 else
588 flush_tlb_all();
585} 589}
586 590
587pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP); 591pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP);
@@ -956,7 +960,7 @@ void __init mem_init(void)
956 test_wp_bit(); 960 test_wp_bit();
957 961
958 save_pg_dir(); 962 save_pg_dir();
959 zap_low_mappings(); 963 zap_low_mappings(true);
960} 964}
961 965
962#ifdef CONFIG_MEMORY_HOTPLUG 966#ifdef CONFIG_MEMORY_HOTPLUG
diff --git a/arch/x86/power/Makefile b/arch/x86/power/Makefile
index 58b32db33125..de2abbd07544 100644
--- a/arch/x86/power/Makefile
+++ b/arch/x86/power/Makefile
@@ -3,5 +3,5 @@
3nostackp := $(call cc-option, -fno-stack-protector) 3nostackp := $(call cc-option, -fno-stack-protector)
4CFLAGS_cpu_$(BITS).o := $(nostackp) 4CFLAGS_cpu_$(BITS).o := $(nostackp)
5 5
6obj-$(CONFIG_PM_SLEEP) += cpu_$(BITS).o 6obj-$(CONFIG_PM_SLEEP) += cpu.o
7obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o 7obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o
diff --git a/arch/x86/power/cpu_64.c b/arch/x86/power/cpu.c
index 5343540f2607..d277ef1eea51 100644
--- a/arch/x86/power/cpu_64.c
+++ b/arch/x86/power/cpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Suspend and hibernation support for x86-64 2 * Suspend support specific for i386/x86-64.
3 * 3 *
4 * Distribute under GPLv2 4 * Distribute under GPLv2
5 * 5 *
@@ -8,18 +8,28 @@
8 * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org> 8 * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
9 */ 9 */
10 10
11#include <linux/smp.h>
12#include <linux/suspend.h> 11#include <linux/suspend.h>
13#include <asm/proto.h> 12#include <linux/smp.h>
14#include <asm/page.h> 13
15#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/proto.h>
16#include <asm/mtrr.h> 16#include <asm/mtrr.h>
17#include <asm/page.h>
18#include <asm/mce.h>
17#include <asm/xcr.h> 19#include <asm/xcr.h>
18#include <asm/suspend.h> 20#include <asm/suspend.h>
19 21
20static void fix_processor_context(void); 22#ifdef CONFIG_X86_32
23static struct saved_context saved_context;
21 24
25unsigned long saved_context_ebx;
26unsigned long saved_context_esp, saved_context_ebp;
27unsigned long saved_context_esi, saved_context_edi;
28unsigned long saved_context_eflags;
29#else
30/* CONFIG_X86_64 */
22struct saved_context saved_context; 31struct saved_context saved_context;
32#endif
23 33
24/** 34/**
25 * __save_processor_state - save CPU registers before creating a 35 * __save_processor_state - save CPU registers before creating a
@@ -38,19 +48,35 @@ struct saved_context saved_context;
38 */ 48 */
39static void __save_processor_state(struct saved_context *ctxt) 49static void __save_processor_state(struct saved_context *ctxt)
40{ 50{
51#ifdef CONFIG_X86_32
52 mtrr_save_fixed_ranges(NULL);
53#endif
41 kernel_fpu_begin(); 54 kernel_fpu_begin();
42 55
43 /* 56 /*
44 * descriptor tables 57 * descriptor tables
45 */ 58 */
59#ifdef CONFIG_X86_32
60 store_gdt(&ctxt->gdt);
61 store_idt(&ctxt->idt);
62#else
63/* CONFIG_X86_64 */
46 store_gdt((struct desc_ptr *)&ctxt->gdt_limit); 64 store_gdt((struct desc_ptr *)&ctxt->gdt_limit);
47 store_idt((struct desc_ptr *)&ctxt->idt_limit); 65 store_idt((struct desc_ptr *)&ctxt->idt_limit);
66#endif
48 store_tr(ctxt->tr); 67 store_tr(ctxt->tr);
49 68
50 /* XMM0..XMM15 should be handled by kernel_fpu_begin(). */ 69 /* XMM0..XMM15 should be handled by kernel_fpu_begin(). */
51 /* 70 /*
52 * segment registers 71 * segment registers
53 */ 72 */
73#ifdef CONFIG_X86_32
74 savesegment(es, ctxt->es);
75 savesegment(fs, ctxt->fs);
76 savesegment(gs, ctxt->gs);
77 savesegment(ss, ctxt->ss);
78#else
79/* CONFIG_X86_64 */
54 asm volatile ("movw %%ds, %0" : "=m" (ctxt->ds)); 80 asm volatile ("movw %%ds, %0" : "=m" (ctxt->ds));
55 asm volatile ("movw %%es, %0" : "=m" (ctxt->es)); 81 asm volatile ("movw %%es, %0" : "=m" (ctxt->es));
56 asm volatile ("movw %%fs, %0" : "=m" (ctxt->fs)); 82 asm volatile ("movw %%fs, %0" : "=m" (ctxt->fs));
@@ -62,30 +88,87 @@ static void __save_processor_state(struct saved_context *ctxt)
62 rdmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base); 88 rdmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base);
63 mtrr_save_fixed_ranges(NULL); 89 mtrr_save_fixed_ranges(NULL);
64 90
91 rdmsrl(MSR_EFER, ctxt->efer);
92#endif
93
65 /* 94 /*
66 * control registers 95 * control registers
67 */ 96 */
68 rdmsrl(MSR_EFER, ctxt->efer);
69 ctxt->cr0 = read_cr0(); 97 ctxt->cr0 = read_cr0();
70 ctxt->cr2 = read_cr2(); 98 ctxt->cr2 = read_cr2();
71 ctxt->cr3 = read_cr3(); 99 ctxt->cr3 = read_cr3();
100#ifdef CONFIG_X86_32
101 ctxt->cr4 = read_cr4_safe();
102#else
103/* CONFIG_X86_64 */
72 ctxt->cr4 = read_cr4(); 104 ctxt->cr4 = read_cr4();
73 ctxt->cr8 = read_cr8(); 105 ctxt->cr8 = read_cr8();
106#endif
74} 107}
75 108
109/* Needed by apm.c */
76void save_processor_state(void) 110void save_processor_state(void)
77{ 111{
78 __save_processor_state(&saved_context); 112 __save_processor_state(&saved_context);
79} 113}
114#ifdef CONFIG_X86_32
115EXPORT_SYMBOL(save_processor_state);
116#endif
80 117
81static void do_fpu_end(void) 118static void do_fpu_end(void)
82{ 119{
83 /* 120 /*
84 * Restore FPU regs if necessary 121 * Restore FPU regs if necessary.
85 */ 122 */
86 kernel_fpu_end(); 123 kernel_fpu_end();
87} 124}
88 125
126static void fix_processor_context(void)
127{
128 int cpu = smp_processor_id();
129 struct tss_struct *t = &per_cpu(init_tss, cpu);
130
131 set_tss_desc(cpu, t); /*
132 * This just modifies memory; should not be
133 * necessary. But... This is necessary, because
134 * 386 hardware has concept of busy TSS or some
135 * similar stupidity.
136 */
137
138#ifdef CONFIG_X86_64
139 get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9;
140
141 syscall_init(); /* This sets MSR_*STAR and related */
142#endif
143 load_TR_desc(); /* This does ltr */
144 load_LDT(&current->active_mm->context); /* This does lldt */
145
146 /*
147 * Now maybe reload the debug registers
148 */
149 if (current->thread.debugreg7) {
150#ifdef CONFIG_X86_32
151 set_debugreg(current->thread.debugreg0, 0);
152 set_debugreg(current->thread.debugreg1, 1);
153 set_debugreg(current->thread.debugreg2, 2);
154 set_debugreg(current->thread.debugreg3, 3);
155 /* no 4 and 5 */
156 set_debugreg(current->thread.debugreg6, 6);
157 set_debugreg(current->thread.debugreg7, 7);
158#else
159 /* CONFIG_X86_64 */
160 loaddebug(&current->thread, 0);
161 loaddebug(&current->thread, 1);
162 loaddebug(&current->thread, 2);
163 loaddebug(&current->thread, 3);
164 /* no 4 and 5 */
165 loaddebug(&current->thread, 6);
166 loaddebug(&current->thread, 7);
167#endif
168 }
169
170}
171
89/** 172/**
90 * __restore_processor_state - restore the contents of CPU registers saved 173 * __restore_processor_state - restore the contents of CPU registers saved
91 * by __save_processor_state() 174 * by __save_processor_state()
@@ -96,9 +179,16 @@ static void __restore_processor_state(struct saved_context *ctxt)
96 /* 179 /*
97 * control registers 180 * control registers
98 */ 181 */
182 /* cr4 was introduced in the Pentium CPU */
183#ifdef CONFIG_X86_32
184 if (ctxt->cr4)
185 write_cr4(ctxt->cr4);
186#else
187/* CONFIG X86_64 */
99 wrmsrl(MSR_EFER, ctxt->efer); 188 wrmsrl(MSR_EFER, ctxt->efer);
100 write_cr8(ctxt->cr8); 189 write_cr8(ctxt->cr8);
101 write_cr4(ctxt->cr4); 190 write_cr4(ctxt->cr4);
191#endif
102 write_cr3(ctxt->cr3); 192 write_cr3(ctxt->cr3);
103 write_cr2(ctxt->cr2); 193 write_cr2(ctxt->cr2);
104 write_cr0(ctxt->cr0); 194 write_cr0(ctxt->cr0);
@@ -107,13 +197,31 @@ static void __restore_processor_state(struct saved_context *ctxt)
107 * now restore the descriptor tables to their proper values 197 * now restore the descriptor tables to their proper values
108 * ltr is done i fix_processor_context(). 198 * ltr is done i fix_processor_context().
109 */ 199 */
200#ifdef CONFIG_X86_32
201 load_gdt(&ctxt->gdt);
202 load_idt(&ctxt->idt);
203#else
204/* CONFIG_X86_64 */
110 load_gdt((const struct desc_ptr *)&ctxt->gdt_limit); 205 load_gdt((const struct desc_ptr *)&ctxt->gdt_limit);
111 load_idt((const struct desc_ptr *)&ctxt->idt_limit); 206 load_idt((const struct desc_ptr *)&ctxt->idt_limit);
112 207#endif
113 208
114 /* 209 /*
115 * segment registers 210 * segment registers
116 */ 211 */
212#ifdef CONFIG_X86_32
213 loadsegment(es, ctxt->es);
214 loadsegment(fs, ctxt->fs);
215 loadsegment(gs, ctxt->gs);
216 loadsegment(ss, ctxt->ss);
217
218 /*
219 * sysenter MSRs
220 */
221 if (boot_cpu_has(X86_FEATURE_SEP))
222 enable_sep_cpu();
223#else
224/* CONFIG_X86_64 */
117 asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds)); 225 asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds));
118 asm volatile ("movw %0, %%es" :: "r" (ctxt->es)); 226 asm volatile ("movw %0, %%es" :: "r" (ctxt->es));
119 asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs)); 227 asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs));
@@ -123,6 +231,7 @@ static void __restore_processor_state(struct saved_context *ctxt)
123 wrmsrl(MSR_FS_BASE, ctxt->fs_base); 231 wrmsrl(MSR_FS_BASE, ctxt->fs_base);
124 wrmsrl(MSR_GS_BASE, ctxt->gs_base); 232 wrmsrl(MSR_GS_BASE, ctxt->gs_base);
125 wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base); 233 wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base);
234#endif
126 235
127 /* 236 /*
128 * restore XCR0 for xsave capable cpu's. 237 * restore XCR0 for xsave capable cpu's.
@@ -134,41 +243,17 @@ static void __restore_processor_state(struct saved_context *ctxt)
134 243
135 do_fpu_end(); 244 do_fpu_end();
136 mtrr_ap_init(); 245 mtrr_ap_init();
246
247#ifdef CONFIG_X86_32
248 mcheck_init(&boot_cpu_data);
249#endif
137} 250}
138 251
252/* Needed by apm.c */
139void restore_processor_state(void) 253void restore_processor_state(void)
140{ 254{
141 __restore_processor_state(&saved_context); 255 __restore_processor_state(&saved_context);
142} 256}
143 257#ifdef CONFIG_X86_32
144static void fix_processor_context(void) 258EXPORT_SYMBOL(restore_processor_state);
145{ 259#endif
146 int cpu = smp_processor_id();
147 struct tss_struct *t = &per_cpu(init_tss, cpu);
148
149 /*
150 * This just modifies memory; should not be necessary. But... This
151 * is necessary, because 386 hardware has concept of busy TSS or some
152 * similar stupidity.
153 */
154 set_tss_desc(cpu, t);
155
156 get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9;
157
158 syscall_init(); /* This sets MSR_*STAR and related */
159 load_TR_desc(); /* This does ltr */
160 load_LDT(&current->active_mm->context); /* This does lldt */
161
162 /*
163 * Now maybe reload the debug registers
164 */
165 if (current->thread.debugreg7){
166 loaddebug(&current->thread, 0);
167 loaddebug(&current->thread, 1);
168 loaddebug(&current->thread, 2);
169 loaddebug(&current->thread, 3);
170 /* no 4 and 5 */
171 loaddebug(&current->thread, 6);
172 loaddebug(&current->thread, 7);
173 }
174}
diff --git a/arch/x86/power/cpu_32.c b/arch/x86/power/cpu_32.c
deleted file mode 100644
index ce702c5b3a2c..000000000000
--- a/arch/x86/power/cpu_32.c
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * Suspend support specific for i386.
3 *
4 * Distribute under GPLv2
5 *
6 * Copyright (c) 2002 Pavel Machek <pavel@suse.cz>
7 * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
8 */
9
10#include <linux/module.h>
11#include <linux/suspend.h>
12#include <asm/mtrr.h>
13#include <asm/mce.h>
14#include <asm/xcr.h>
15#include <asm/suspend.h>
16
17static struct saved_context saved_context;
18
19unsigned long saved_context_ebx;
20unsigned long saved_context_esp, saved_context_ebp;
21unsigned long saved_context_esi, saved_context_edi;
22unsigned long saved_context_eflags;
23
24static void __save_processor_state(struct saved_context *ctxt)
25{
26 mtrr_save_fixed_ranges(NULL);
27 kernel_fpu_begin();
28
29 /*
30 * descriptor tables
31 */
32 store_gdt(&ctxt->gdt);
33 store_idt(&ctxt->idt);
34 store_tr(ctxt->tr);
35
36 /*
37 * segment registers
38 */
39 savesegment(es, ctxt->es);
40 savesegment(fs, ctxt->fs);
41 savesegment(gs, ctxt->gs);
42 savesegment(ss, ctxt->ss);
43
44 /*
45 * control registers
46 */
47 ctxt->cr0 = read_cr0();
48 ctxt->cr2 = read_cr2();
49 ctxt->cr3 = read_cr3();
50 ctxt->cr4 = read_cr4_safe();
51}
52
53/* Needed by apm.c */
54void save_processor_state(void)
55{
56 __save_processor_state(&saved_context);
57}
58EXPORT_SYMBOL(save_processor_state);
59
60static void do_fpu_end(void)
61{
62 /*
63 * Restore FPU regs if necessary.
64 */
65 kernel_fpu_end();
66}
67
68static void fix_processor_context(void)
69{
70 int cpu = smp_processor_id();
71 struct tss_struct *t = &per_cpu(init_tss, cpu);
72
73 set_tss_desc(cpu, t); /*
74 * This just modifies memory; should not be
75 * necessary. But... This is necessary, because
76 * 386 hardware has concept of busy TSS or some
77 * similar stupidity.
78 */
79
80 load_TR_desc(); /* This does ltr */
81 load_LDT(&current->active_mm->context); /* This does lldt */
82
83 /*
84 * Now maybe reload the debug registers
85 */
86 if (current->thread.debugreg7) {
87 set_debugreg(current->thread.debugreg0, 0);
88 set_debugreg(current->thread.debugreg1, 1);
89 set_debugreg(current->thread.debugreg2, 2);
90 set_debugreg(current->thread.debugreg3, 3);
91 /* no 4 and 5 */
92 set_debugreg(current->thread.debugreg6, 6);
93 set_debugreg(current->thread.debugreg7, 7);
94 }
95
96}
97
98static void __restore_processor_state(struct saved_context *ctxt)
99{
100 /*
101 * control registers
102 */
103 /* cr4 was introduced in the Pentium CPU */
104 if (ctxt->cr4)
105 write_cr4(ctxt->cr4);
106 write_cr3(ctxt->cr3);
107 write_cr2(ctxt->cr2);
108 write_cr0(ctxt->cr0);
109
110 /*
111 * now restore the descriptor tables to their proper values
112 * ltr is done i fix_processor_context().
113 */
114 load_gdt(&ctxt->gdt);
115 load_idt(&ctxt->idt);
116
117 /*
118 * segment registers
119 */
120 loadsegment(es, ctxt->es);
121 loadsegment(fs, ctxt->fs);
122 loadsegment(gs, ctxt->gs);
123 loadsegment(ss, ctxt->ss);
124
125 /*
126 * sysenter MSRs
127 */
128 if (boot_cpu_has(X86_FEATURE_SEP))
129 enable_sep_cpu();
130
131 /*
132 * restore XCR0 for xsave capable cpu's.
133 */
134 if (cpu_has_xsave)
135 xsetbv(XCR_XFEATURE_ENABLED_MASK, pcntxt_mask);
136
137 fix_processor_context();
138 do_fpu_end();
139 mtrr_ap_init();
140 mcheck_init(&boot_cpu_data);
141}
142
143/* Needed by apm.c */
144void restore_processor_state(void)
145{
146 __restore_processor_state(&saved_context);
147}
148EXPORT_SYMBOL(restore_processor_state);
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
index 67ad67bed8c1..22d6dde42619 100644
--- a/arch/xtensa/include/asm/atomic.h
+++ b/arch/xtensa/include/asm/atomic.h
@@ -292,7 +292,7 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
292#define smp_mb__before_atomic_inc() barrier() 292#define smp_mb__before_atomic_inc() barrier()
293#define smp_mb__after_atomic_inc() barrier() 293#define smp_mb__after_atomic_inc() barrier()
294 294
295#include <asm-generic/atomic.h> 295#include <asm-generic/atomic-long.h>
296#endif /* __KERNEL__ */ 296#endif /* __KERNEL__ */
297 297
298#endif /* _XTENSA_ATOMIC_H */ 298#endif /* _XTENSA_ATOMIC_H */
diff --git a/arch/xtensa/include/asm/bitsperlong.h b/arch/xtensa/include/asm/bitsperlong.h
new file mode 100644
index 000000000000..6dc0bb0c13b2
--- /dev/null
+++ b/arch/xtensa/include/asm/bitsperlong.h
@@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
index 17e0c5383b10..161bb89e98c8 100644
--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -129,7 +129,7 @@ static inline __attribute_const__ int get_order(unsigned long size)
129 129
130#else 130#else
131 131
132# include <asm-generic/page.h> 132# include <asm-generic/getorder.h>
133 133
134#endif 134#endif
135 135
diff --git a/arch/xtensa/kernel/module.c b/arch/xtensa/kernel/module.c
index 3981a466c779..c1accea8cb56 100644
--- a/arch/xtensa/kernel/module.c
+++ b/arch/xtensa/kernel/module.c
@@ -34,8 +34,6 @@ void *module_alloc(unsigned long size)
34void module_free(struct module *mod, void *module_region) 34void module_free(struct module *mod, void *module_region)
35{ 35{
36 vfree(module_region); 36 vfree(module_region);
37 /* FIXME: If module_region == mod->init_region, trim exception
38 table entries. */
39} 37}
40 38
41int module_frob_arch_sections(Elf32_Ehdr *hdr, 39int module_frob_arch_sections(Elf32_Ehdr *hdr,