aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig189
-rw-r--r--arch/arm/Makefile117
-rw-r--r--arch/arm/common/clkdev.c18
-rw-r--r--arch/arm/configs/davinci_all_defconfig21
-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_defconfig806
-rw-r--r--arch/arm/configs/omap_zoom2_defconfig1211
-rw-r--r--arch/arm/configs/rx51_defconfig2
-rw-r--r--arch/arm/include/asm/hardware/arm_twd.h21
-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/pgtable.h2
-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/kernel/Makefile2
-rw-r--r--arch/arm/kernel/smp.c62
-rw-r--r--arch/arm/kernel/smp_scu.c48
-rw-r--r--arch/arm/kernel/smp_twd.c175
-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/core.c15
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h1
-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/memory.h26
-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/system.h40
-rw-r--r--arch/arm/mach-imx/include/mach/uncompress.h71
-rw-r--r--arch/arm/mach-imx/include/mach/vmalloc.h20
-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-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-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/Makefile35
-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/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.c9
-rw-r--r--arch/arm/mach-omap2/usb-musb.c21
-rw-r--r--arch/arm/mach-pxa/clock.c17
-rw-r--r--arch/arm/mach-pxa/include/mach/palmld.h1
-rw-r--r--arch/arm/mach-pxa/palmld.c11
-rw-r--r--arch/arm/mach-realview/Kconfig1
-rw-r--r--arch/arm/mach-realview/Makefile3
-rw-r--r--arch/arm/mach-realview/core.h3
-rw-r--r--arch/arm/mach-realview/include/mach/scu.h13
-rw-r--r--arch/arm/mach-realview/localtimer.c188
-rw-r--r--arch/arm/mach-realview/platsmp.c49
-rw-r--r--arch/arm/mach-realview/realview_eb.c1
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c1
-rw-r--r--arch/arm/mm/Kconfig3
-rw-r--r--arch/arm/mm/ioremap.c6
-rw-r--r--arch/arm/mm/mmu.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.h (renamed from arch/arm/mach-imx/include/mach/timex.h)15
-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.h (renamed from arch/arm/mach-imx/include/mach/io.h)17
-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.S55
-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.h90
-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/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
287 files changed, 23634 insertions, 6742 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c6225ead7bff..646a5d5eb8c1 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,17 @@ 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
296config ARCH_NETX 301config ARCH_NETX
297 bool "Hilscher NetX based" 302 bool "Hilscher NetX based"
298 select CPU_ARM926T 303 select CPU_ARM926T
@@ -309,15 +314,6 @@ config ARCH_H720X
309 help 314 help
310 This enables support for systems based on the Hynix HMS720x 315 This enables support for systems based on the Hynix HMS720x
311 316
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 317config ARCH_IOP13XX
322 bool "IOP13xx-based" 318 bool "IOP13xx-based"
323 depends on MMU 319 depends on MMU
@@ -406,28 +402,6 @@ config ARCH_KIRKWOOD
406 Support for the following Marvell Kirkwood series SoCs: 402 Support for the following Marvell Kirkwood series SoCs:
407 88F6180, 88F6192 and 88F6281. 403 88F6180, 88F6192 and 88F6281.
408 404
409config ARCH_KS8695
410 bool "Micrel/Kendin KS8695"
411 select CPU_ARM922T
412 select GENERIC_GPIO
413 select ARCH_REQUIRE_GPIOLIB
414 help
415 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
416 System-on-Chip devices.
417
418config ARCH_NS9XXX
419 bool "NetSilicon NS9xxx"
420 select CPU_ARM926T
421 select GENERIC_GPIO
422 select GENERIC_TIME
423 select GENERIC_CLOCKEVENTS
424 select HAVE_CLK
425 help
426 Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
427 System.
428
429 <http://www.digi.com/products/microprocessors/index.jsp>
430
431config ARCH_LOKI 405config ARCH_LOKI
432 bool "Marvell Loki (88RC8480)" 406 bool "Marvell Loki (88RC8480)"
433 select CPU_FEROCEON 407 select CPU_FEROCEON
@@ -450,17 +424,6 @@ config ARCH_MV78XX0
450 Support for the following Marvell MV78xx0 series SoCs: 424 Support for the following Marvell MV78xx0 series SoCs:
451 MV781x0, MV782x0. 425 MV781x0, MV782x0.
452 426
453config ARCH_MXC
454 bool "Freescale MXC/iMX-based"
455 select GENERIC_TIME
456 select GENERIC_CLOCKEVENTS
457 select ARCH_MTD_XIP
458 select GENERIC_GPIO
459 select ARCH_REQUIRE_GPIOLIB
460 select HAVE_CLK
461 help
462 Support for Freescale MXC/iMX-based family of processors
463
464config ARCH_ORION5X 427config ARCH_ORION5X
465 bool "Marvell Orion" 428 bool "Marvell Orion"
466 depends on MMU 429 depends on MMU
@@ -476,6 +439,49 @@ config ARCH_ORION5X
476 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182), 439 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
477 Orion-2 (5281), Orion-1-90 (6183). 440 Orion-2 (5281), Orion-1-90 (6183).
478 441
442config ARCH_MMP
443 bool "Marvell PXA168/910"
444 depends on MMU
445 select GENERIC_GPIO
446 select ARCH_REQUIRE_GPIOLIB
447 select HAVE_CLK
448 select COMMON_CLKDEV
449 select GENERIC_TIME
450 select GENERIC_CLOCKEVENTS
451 select TICK_ONESHOT
452 select PLAT_PXA
453 help
454 Support for Marvell's PXA168/910 processor line.
455
456config ARCH_KS8695
457 bool "Micrel/Kendin KS8695"
458 select CPU_ARM922T
459 select GENERIC_GPIO
460 select ARCH_REQUIRE_GPIOLIB
461 help
462 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
463 System-on-Chip devices.
464
465config ARCH_NS9XXX
466 bool "NetSilicon NS9xxx"
467 select CPU_ARM926T
468 select GENERIC_GPIO
469 select GENERIC_TIME
470 select GENERIC_CLOCKEVENTS
471 select HAVE_CLK
472 help
473 Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
474 System.
475
476 <http://www.digi.com/products/microprocessors/index.jsp>
477
478config ARCH_W90X900
479 bool "Nuvoton W90X900 CPU"
480 select CPU_ARM926T
481 help
482 Support for Nuvoton (Winbond logic dept.) ARM9 processor,You
483 can login www.mcuos.com or www.nuvoton.com to know more.
484
479config ARCH_PNX4008 485config ARCH_PNX4008
480 bool "Philips Nexperia PNX4008 Mobile" 486 bool "Philips Nexperia PNX4008 Mobile"
481 select CPU_ARM926T 487 select CPU_ARM926T
@@ -498,19 +504,16 @@ config ARCH_PXA
498 help 504 help
499 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 505 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
500 506
501config ARCH_MMP 507config ARCH_MSM
502 bool "Marvell PXA168/910" 508 bool "Qualcomm MSM"
503 depends on MMU 509 select CPU_V6
504 select GENERIC_GPIO
505 select ARCH_REQUIRE_GPIOLIB
506 select HAVE_CLK
507 select COMMON_CLKDEV
508 select GENERIC_TIME 510 select GENERIC_TIME
509 select GENERIC_CLOCKEVENTS 511 select GENERIC_CLOCKEVENTS
510 select TICK_ONESHOT
511 select PLAT_PXA
512 help 512 help
513 Support for Marvell's PXA168/910 processor line. 513 Support for Qualcomm MSM7K based systems. This runs on the ARM11
514 apps processor of the MSM7K and depends on a shared memory
515 interface to the ARM9 modem processor which runs the baseband stack
516 and controls some vital subsystems (clock and power control, etc).
514 517
515config ARCH_RPC 518config ARCH_RPC
516 bool "RiscPC" 519 bool "RiscPC"
@@ -590,6 +593,7 @@ config ARCH_DAVINCI
590 select ZONE_DMA 593 select ZONE_DMA
591 select HAVE_IDE 594 select HAVE_IDE
592 select COMMON_CLKDEV 595 select COMMON_CLKDEV
596 select GENERIC_ALLOCATOR
593 help 597 help
594 Support for TI's DaVinci platform. 598 Support for TI's DaVinci platform.
595 599
@@ -603,24 +607,6 @@ config ARCH_OMAP
603 help 607 help
604 Support for TI's OMAP platform (OMAP1 and OMAP2). 608 Support for TI's OMAP platform (OMAP1 and OMAP2).
605 609
606config ARCH_MSM
607 bool "Qualcomm MSM"
608 select CPU_V6
609 select GENERIC_TIME
610 select GENERIC_CLOCKEVENTS
611 help
612 Support for Qualcomm MSM7K based systems. This runs on the ARM11
613 apps processor of the MSM7K and depends on a shared memory
614 interface to the ARM9 modem processor which runs the baseband stack
615 and controls some vital subsystems (clock and power control, etc).
616
617config ARCH_W90X900
618 bool "Nuvoton W90X900 CPU"
619 select CPU_ARM926T
620 help
621 Support for Nuvoton (Winbond logic dept.) ARM9 processor,You
622 can login www.mcuos.com or www.nuvoton.com to know more.
623
624endchoice 610endchoice
625 611
626source "arch/arm/mach-clps711x/Kconfig" 612source "arch/arm/mach-clps711x/Kconfig"
@@ -686,8 +672,6 @@ endif
686 672
687source "arch/arm/mach-lh7a40x/Kconfig" 673source "arch/arm/mach-lh7a40x/Kconfig"
688 674
689source "arch/arm/mach-imx/Kconfig"
690
691source "arch/arm/mach-h720x/Kconfig" 675source "arch/arm/mach-h720x/Kconfig"
692 676
693source "arch/arm/mach-versatile/Kconfig" 677source "arch/arm/mach-versatile/Kconfig"
@@ -863,7 +847,9 @@ source "kernel/time/Kconfig"
863config SMP 847config SMP
864 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 848 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
865 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP) 849 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
850 depends on GENERIC_CLOCKEVENTS
866 select USE_GENERIC_SMP_HELPERS 851 select USE_GENERIC_SMP_HELPERS
852 select HAVE_ARM_SCU if ARCH_REALVIEW
867 help 853 help
868 This enables support for systems with more than one CPU. If you have 854 This enables support for systems with more than one CPU. If you have
869 a system with only one CPU, like most personal computers, say N. If 855 a system with only one CPU, like most personal computers, say N. If
@@ -881,6 +867,18 @@ config SMP
881 867
882 If you don't know what to do here, say N. 868 If you don't know what to do here, say N.
883 869
870config HAVE_ARM_SCU
871 bool
872 depends on SMP
873 help
874 This option enables support for the ARM system coherency unit
875
876config HAVE_ARM_TWD
877 bool
878 depends on SMP
879 help
880 This options enables support for the ARM timer and watchdog unit
881
884choice 882choice
885 prompt "Memory split" 883 prompt "Memory split"
886 default VMSPLIT_3G 884 default VMSPLIT_3G
@@ -921,6 +919,7 @@ config LOCAL_TIMERS
921 bool "Use local timer interrupts" 919 bool "Use local timer interrupts"
922 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || REALVIEW_EB_A9MP) 920 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || REALVIEW_EB_A9MP)
923 default y 921 default y
922 select HAVE_ARM_TWD if ARCH_REALVIEW
924 help 923 help
925 Enable support for local timers on SMP platforms, rather then the 924 Enable support for local timers on SMP platforms, rather then the
926 legacy IPI broadcast method. Local timers allows the system 925 legacy IPI broadcast method. Local timers allows the system
@@ -982,7 +981,6 @@ config OABI_COMPAT
982 981
983config ARCH_HAS_HOLES_MEMORYMODEL 982config ARCH_HAS_HOLES_MEMORYMODEL
984 bool 983 bool
985 default n
986 984
987# Discontigmem is deprecated 985# Discontigmem is deprecated
988config ARCH_DISCONTIGMEM_ENABLE 986config ARCH_DISCONTIGMEM_ENABLE
@@ -1025,7 +1023,7 @@ source "mm/Kconfig"
1025config LEDS 1023config LEDS
1026 bool "Timer and CPU usage LEDs" 1024 bool "Timer and CPU usage LEDs"
1027 depends on ARCH_CDB89712 || ARCH_EBSA110 || \ 1025 depends on ARCH_CDB89712 || ARCH_EBSA110 || \
1028 ARCH_EBSA285 || ARCH_IMX || ARCH_INTEGRATOR || \ 1026 ARCH_EBSA285 || ARCH_INTEGRATOR || \
1029 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \ 1027 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
1030 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \ 1028 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
1031 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \ 1029 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
@@ -1191,7 +1189,7 @@ endmenu
1191 1189
1192menu "CPU Power Management" 1190menu "CPU Power Management"
1193 1191
1194if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA) 1192if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_PXA)
1195 1193
1196source "drivers/cpufreq/Kconfig" 1194source "drivers/cpufreq/Kconfig"
1197 1195
@@ -1216,14 +1214,11 @@ config CPU_FREQ_INTEGRATOR
1216 1214
1217 If in doubt, say Y. 1215 If in doubt, say Y.
1218 1216
1219config CPU_FREQ_IMX 1217config CPU_FREQ_PXA
1220 tristate "CPUfreq driver for i.MX CPUs" 1218 bool
1221 depends on ARCH_IMX && CPU_FREQ 1219 depends on CPU_FREQ && ARCH_PXA && PXA25x
1222 default n 1220 default y
1223 help 1221 select CPU_FREQ_DEFAULT_GOV_USERSPACE
1224 This enables the CPUfreq driver for i.MX CPUs.
1225
1226 If in doubt, say N.
1227 1222
1228endif 1223endif
1229 1224
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e84729bf13d4..e8ab87750e9b 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -99,64 +99,69 @@ CHECKFLAGS += -D__arm__
99#Default value 99#Default value
100head-y := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o 100head-y := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o
101textofs-y := 0x00008000 101textofs-y := 0x00008000
102 102textofs-$(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 103# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
110 textofs-$(CONFIG_SA1111) := 0x00208000 104ifeq ($(CONFIG_ARCH_SA1100),y)
105textofs-$(CONFIG_SA1111) := 0x00208000
111endif 106endif
112 machine-$(CONFIG_ARCH_PXA) := pxa 107
113 machine-$(CONFIG_ARCH_MMP) := mmp 108# Machine directory name. This list is sorted alphanumerically
114 plat-$(CONFIG_PLAT_PXA) := pxa 109# by CONFIG_* macro name.
115 machine-$(CONFIG_ARCH_L7200) := l7200 110machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
116 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator 111machine-$(CONFIG_ARCH_AT91) := at91
117 machine-$(CONFIG_ARCH_GEMINI) := gemini 112machine-$(CONFIG_ARCH_CLPS711X) := clps711x
118 textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000 113machine-$(CONFIG_ARCH_DAVINCI) := davinci
119 machine-$(CONFIG_ARCH_CLPS711X) := clps711x 114machine-$(CONFIG_ARCH_EBSA110) := ebsa110
120 machine-$(CONFIG_ARCH_IOP32X) := iop32x 115machine-$(CONFIG_ARCH_EP93XX) := ep93xx
121 machine-$(CONFIG_ARCH_IOP33X) := iop33x 116machine-$(CONFIG_ARCH_GEMINI) := gemini
122 machine-$(CONFIG_ARCH_IOP13XX) := iop13xx 117machine-$(CONFIG_ARCH_H720X) := h720x
123 plat-$(CONFIG_PLAT_IOP) := iop 118machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
124 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 119machine-$(CONFIG_ARCH_IOP13XX) := iop13xx
125 machine-$(CONFIG_ARCH_IXP2000) := ixp2000 120machine-$(CONFIG_ARCH_IOP32X) := iop32x
126 machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx 121machine-$(CONFIG_ARCH_IOP33X) := iop33x
127 machine-$(CONFIG_ARCH_OMAP1) := omap1 122machine-$(CONFIG_ARCH_IXP2000) := ixp2000
128 machine-$(CONFIG_ARCH_OMAP2) := omap2 123machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
129 machine-$(CONFIG_ARCH_OMAP3) := omap2 124machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
130 plat-$(CONFIG_ARCH_OMAP) := omap 125machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood
131 machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 126machine-$(CONFIG_ARCH_KS8695) := ks8695
132 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 127machine-$(CONFIG_ARCH_L7200) := l7200
133 plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c 128machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
134 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 129machine-$(CONFIG_ARCH_LOKI) := loki
135 plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c 130machine-$(CONFIG_ARCH_MMP) := mmp
136 machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x 131machine-$(CONFIG_ARCH_MSM) := msm
137 machine-$(CONFIG_ARCH_VERSATILE) := versatile 132machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
138 machine-$(CONFIG_ARCH_IMX) := imx 133machine-$(CONFIG_ARCH_MX1) := mx1
139 machine-$(CONFIG_ARCH_H720X) := h720x 134machine-$(CONFIG_ARCH_MX2) := mx2
140 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 135machine-$(CONFIG_ARCH_MX3) := mx3
141 machine-$(CONFIG_ARCH_REALVIEW) := realview 136machine-$(CONFIG_ARCH_NETX) := netx
142 machine-$(CONFIG_ARCH_AT91) := at91 137machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx
143 machine-$(CONFIG_ARCH_EP93XX) := ep93xx 138machine-$(CONFIG_ARCH_OMAP1) := omap1
144 machine-$(CONFIG_ARCH_PNX4008) := pnx4008 139machine-$(CONFIG_ARCH_OMAP2) := omap2
145 machine-$(CONFIG_ARCH_NETX) := netx 140machine-$(CONFIG_ARCH_OMAP3) := omap2
146 machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx 141machine-$(CONFIG_ARCH_OMAP4) := omap2
147 machine-$(CONFIG_ARCH_DAVINCI) := davinci 142machine-$(CONFIG_ARCH_ORION5X) := orion5x
148 machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood 143machine-$(CONFIG_ARCH_PNX4008) := pnx4008
149 machine-$(CONFIG_ARCH_KS8695) := ks8695 144machine-$(CONFIG_ARCH_PXA) := pxa
150 plat-$(CONFIG_ARCH_MXC) := mxc 145machine-$(CONFIG_ARCH_REALVIEW) := realview
151 machine-$(CONFIG_ARCH_MX2) := mx2 146machine-$(CONFIG_ARCH_RPC) := rpc
152 machine-$(CONFIG_ARCH_MX3) := mx3 147machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443
153 machine-$(CONFIG_ARCH_MX1) := mx1 148machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
154 machine-$(CONFIG_ARCH_ORION5X) := orion5x 149machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410
155 plat-$(CONFIG_PLAT_ORION) := orion 150machine-$(CONFIG_ARCH_SA1100) := sa1100
156 machine-$(CONFIG_ARCH_MSM) := msm 151machine-$(CONFIG_ARCH_SHARK) := shark
157 machine-$(CONFIG_ARCH_LOKI) := loki 152machine-$(CONFIG_ARCH_VERSATILE) := versatile
158 machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 153machine-$(CONFIG_ARCH_W90X900) := w90x900
159 machine-$(CONFIG_ARCH_W90X900) := w90x900 154machine-$(CONFIG_FOOTBRIDGE) := footbridge
155
156# Platform directory name. This list is sorted alphanumerically
157# by CONFIG_* macro name.
158plat-$(CONFIG_ARCH_MXC) := mxc
159plat-$(CONFIG_ARCH_OMAP) := omap
160plat-$(CONFIG_PLAT_IOP) := iop
161plat-$(CONFIG_PLAT_ORION) := orion
162plat-$(CONFIG_PLAT_PXA) := pxa
163plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c
164plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c
160 165
161ifeq ($(CONFIG_ARCH_EBSA110),y) 166ifeq ($(CONFIG_ARCH_EBSA110),y)
162# This is what happens if you forget the IOCS16 line. 167# This is what happens if you forget the IOCS16 line.
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/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/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..67a3a770cc2f
--- /dev/null
+++ b/arch/arm/configs/omap_4430sdp_defconfig
@@ -0,0 +1,806 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29
4# Fri April 19 19:58:24 20089
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
40CONFIG_BSD_PROCESS_ACCT=y
41# CONFIG_BSD_PROCESS_ACCT_V3 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_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68CONFIG_EMBEDDED=y
69CONFIG_UID16=y
70# CONFIG_SYSCTL_SYSCALL is not set
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73# CONFIG_KALLSYMS_EXTRA_PASS 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_COMPAT_BRK=y
88# CONFIG_SLAB is not set
89# CONFIG_SLUB is not set
90# CONFIG_SLOB is not set
91# CONFIG_PROFILING 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
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
105CONFIG_MODVERSIONS=y
106CONFIG_MODULE_SRCVERSION_ALL=y
107CONFIG_BLOCK=y
108# CONFIG_LBD is not set
109# CONFIG_BLK_DEV_IO_TRACE 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
117CONFIG_IOSCHED_AS=y
118CONFIG_IOSCHED_DEADLINE=y
119CONFIG_IOSCHED_CFQ=y
120CONFIG_DEFAULT_AS=y
121# CONFIG_DEFAULT_DEADLINE is not set
122# CONFIG_DEFAULT_CFQ is not set
123# CONFIG_DEFAULT_NOOP is not set
124CONFIG_DEFAULT_IOSCHED="anticipatory"
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_EBSA110 is not set
137# CONFIG_ARCH_EP93XX 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_IMX is not set
142# CONFIG_ARCH_IOP13XX is not set
143# CONFIG_ARCH_IOP32X is not set
144# CONFIG_ARCH_IOP33X is not set
145# CONFIG_ARCH_IXP23XX is not set
146# CONFIG_ARCH_IXP2000 is not set
147# CONFIG_ARCH_IXP4XX is not set
148# CONFIG_ARCH_L7200 is not set
149# CONFIG_ARCH_KIRKWOOD is not set
150# CONFIG_ARCH_KS8695 is not set
151# CONFIG_ARCH_NS9XXX is not set
152# CONFIG_ARCH_LOKI is not set
153# CONFIG_ARCH_MV78XX0 is not set
154# CONFIG_ARCH_MXC is not set
155# CONFIG_ARCH_ORION5X is not set
156# CONFIG_ARCH_PNX4008 is not set
157# CONFIG_ARCH_PXA 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
165CONFIG_ARCH_OMAP=y
166# CONFIG_ARCH_MSM is not set
167# CONFIG_ARCH_W90X900 is not set
168
169#
170# TI OMAP Implementations
171#
172# CONFIG_ARCH_OMAP1 is not set
173# CONFIG_ARCH_OMAP2 is not set
174# CONFIG_ARCH_OMAP3 is not set
175CONFIG_ARCH_OMAP4=y
176
177#
178# OMAP Feature Selections
179#
180# CONFIG_OMAP_RESET_CLOCKS is not set
181# CONFIG_OMAP_COMPONENT_VERSION is not set
182# CONFIG_OMAP_GPIO_SWITCH is not set
183# CONFIG_OMAP_MUX is not set
184# CONFIG_OMAP_MCBSP is not set
185# CONFIG_OMAP_MBOX_FWK is not set
186# CONFIG_OMAP_MPU_TIMER is not set
187CONFIG_OMAP_32K_TIMER=y
188CONFIG_OMAP_32K_TIMER_HZ=128
189CONFIG_OMAP_DM_TIMER=y
190CONFIG_OMAP_LL_DEBUG_UART1=y
191# CONFIG_OMAP_LL_DEBUG_UART2 is not set
192# CONFIG_OMAP_LL_DEBUG_UART3 is not set
193
194
195
196#
197# OMAP Board Type
198#
199CONFIG_MACH_OMAP_4430SDP=y
200
201#
202# Processor Type
203#
204CONFIG_CPU_32=y
205CONFIG_CPU_32v6K=y
206CONFIG_CPU_V7=y
207CONFIG_CPU_32v7=y
208CONFIG_CPU_ABRT_EV7=y
209CONFIG_CPU_PABRT_IFAR=y
210CONFIG_CPU_CACHE_V7=y
211CONFIG_CPU_CACHE_VIPT=y
212CONFIG_CPU_COPY_V6=y
213CONFIG_CPU_TLB_V7=y
214CONFIG_CPU_HAS_ASID=y
215CONFIG_CPU_CP15=y
216CONFIG_CPU_CP15_MMU=y
217
218#
219# Processor Features
220#
221# CONFIG_ARM_THUMB is not set
222# CONFIG_ARM_THUMBEE is not set
223# CONFIG_CPU_ICACHE_DISABLE is not set
224CONFIG_CPU_DCACHE_DISABLE=y
225# CONFIG_CPU_BPREDICT_DISABLE is not set
226CONFIG_HAS_TLS_REG=y
227# CONFIG_OUTER_CACHE is not set
228CONFIG_ARM_GIC=y
229
230#
231# Bus support
232#
233# CONFIG_PCI_SYSCALL is not set
234# CONFIG_ARCH_SUPPORTS_MSI is not set
235# CONFIG_PCCARD is not set
236
237#
238# Kernel Features
239#
240# CONFIG_NO_HZ is not set
241# CONFIG_HIGH_RES_TIMERS is not set
242CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
243CONFIG_VMSPLIT_3G=y
244# CONFIG_VMSPLIT_2G is not set
245# CONFIG_VMSPLIT_1G is not set
246CONFIG_PAGE_OFFSET=0xC0000000
247# CONFIG_PREEMPT is not set
248CONFIG_HZ=128
249CONFIG_AEABI=y
250# CONFIG_OABI_COMPAT is not set
251CONFIG_ARCH_FLATMEM_HAS_HOLES=y
252# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
253# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
254CONFIG_SELECT_MEMORY_MODEL=y
255CONFIG_FLATMEM_MANUAL=y
256# CONFIG_DISCONTIGMEM_MANUAL is not set
257# CONFIG_SPARSEMEM_MANUAL is not set
258CONFIG_FLATMEM=y
259CONFIG_FLAT_NODE_MEM_MAP=y
260CONFIG_PAGEFLAGS_EXTENDED=y
261CONFIG_SPLIT_PTLOCK_CPUS=4
262# CONFIG_PHYS_ADDR_T_64BIT is not set
263CONFIG_ZONE_DMA_FLAG=0
264CONFIG_VIRT_TO_BUS=y
265# CONFIG_UNEVICTABLE_LRU is not set
266# CONFIG_LEDS is not set
267CONFIG_ALIGNMENT_TRAP=y
268
269#
270# Boot options
271#
272CONFIG_ZBOOT_ROM_TEXT=0x0
273CONFIG_ZBOOT_ROM_BSS=0x0
274CONFIG_CMDLINE="root=/dev/ram0 rw mem=128M console=ttyS0,115200n8 initrd=0x81600000,20M ramdisk_size=20480"
275# CONFIG_XIP_KERNEL is not set
276# CONFIG_KEXEC is not set
277
278#
279# CPU Power Management
280#
281# CONFIG_CPU_FREQ is not set
282# CONFIG_CPU_IDLE is not set
283
284#
285# Floating point emulation
286#
287
288#
289# At least one emulation must be selected
290#
291CONFIG_FPE_NWFPE=y
292# CONFIG_FPE_NWFPE_XP is not set
293# CONFIG_FPE_FASTFPE is not set
294CONFIG_VFP=y
295CONFIG_VFPv3=y
296# CONFIG_NEON is not set
297
298#
299# Userspace binary formats
300#
301CONFIG_BINFMT_ELF=y
302# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
303CONFIG_HAVE_AOUT=y
304# CONFIG_BINFMT_AOUT is not set
305CONFIG_BINFMT_MISC=y
306
307#
308# Power management options
309#
310# CONFIG_PM is not set
311CONFIG_ARCH_SUSPEND_POSSIBLE=y
312# CONFIG_NET is not set
313
314#
315# Device Drivers
316#
317
318#
319# Generic Driver Options
320#
321CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
322CONFIG_STANDALONE=y
323CONFIG_PREVENT_FIRMWARE_BUILD=y
324# CONFIG_FW_LOADER is not set
325# CONFIG_DEBUG_DRIVER is not set
326# CONFIG_DEBUG_DEVRES is not set
327# CONFIG_SYS_HYPERVISOR is not set
328# CONFIG_MTD is not set
329# CONFIG_PARPORT is not set
330CONFIG_BLK_DEV=y
331# CONFIG_BLK_DEV_COW_COMMON is not set
332CONFIG_BLK_DEV_LOOP=y
333# CONFIG_BLK_DEV_CRYPTOLOOP is not set
334CONFIG_BLK_DEV_RAM=y
335CONFIG_BLK_DEV_RAM_COUNT=16
336CONFIG_BLK_DEV_RAM_SIZE=16384
337# CONFIG_BLK_DEV_XIP is not set
338# CONFIG_CDROM_PKTCDVD is not set
339# CONFIG_MISC_DEVICES is not set
340CONFIG_HAVE_IDE=y
341# CONFIG_IDE is not set
342
343#
344# SCSI device support
345#
346# CONFIG_RAID_ATTRS is not set
347# CONFIG_SCSI is not set
348# CONFIG_SCSI_DMA is not set
349# CONFIG_SCSI_NETLINK is not set
350# CONFIG_ATA is not set
351# CONFIG_MD is not set
352
353#
354# Input device support
355#
356CONFIG_INPUT=y
357# CONFIG_INPUT_FF_MEMLESS is not set
358# CONFIG_INPUT_POLLDEV is not set
359
360#
361# Userland interfaces
362#
363# CONFIG_INPUT_MOUSEDEV is not set
364# CONFIG_INPUT_JOYDEV is not set
365CONFIG_INPUT_EVDEV=y
366# CONFIG_INPUT_EVBUG is not set
367
368#
369# Input Device Drivers
370#
371# CONFIG_INPUT_KEYBOARD is not set
372# CONFIG_INPUT_MOUSE is not set
373# CONFIG_INPUT_JOYSTICK is not set
374# CONFIG_INPUT_TABLET is not set
375# CONFIG_INPUT_TOUCHSCREEN is not set
376# CONFIG_INPUT_MISC is not set
377
378#
379# Hardware I/O ports
380#
381# CONFIG_SERIO is not set
382# CONFIG_GAMEPORT is not set
383
384#
385# Character devices
386#
387CONFIG_VT=y
388CONFIG_CONSOLE_TRANSLATIONS=y
389CONFIG_VT_CONSOLE=y
390CONFIG_HW_CONSOLE=y
391# CONFIG_VT_HW_CONSOLE_BINDING is not set
392CONFIG_DEVKMEM=y
393# CONFIG_SERIAL_NONSTANDARD is not set
394
395#
396# Serial drivers
397#
398CONFIG_SERIAL_8250=y
399CONFIG_SERIAL_8250_CONSOLE=y
400CONFIG_SERIAL_8250_NR_UARTS=32
401CONFIG_SERIAL_8250_RUNTIME_UARTS=4
402CONFIG_SERIAL_8250_EXTENDED=y
403CONFIG_SERIAL_8250_MANY_PORTS=y
404CONFIG_SERIAL_8250_SHARE_IRQ=y
405CONFIG_SERIAL_8250_DETECT_IRQ=y
406CONFIG_SERIAL_8250_RSA=y
407
408#
409# Non-8250 serial port support
410#
411CONFIG_SERIAL_CORE=y
412CONFIG_SERIAL_CORE_CONSOLE=y
413CONFIG_UNIX98_PTYS=y
414# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
415# CONFIG_LEGACY_PTYS is not set
416# CONFIG_IPMI_HANDLER is not set
417CONFIG_HW_RANDOM=y
418# CONFIG_R3964 is not set
419# CONFIG_RAW_DRIVER is not set
420# CONFIG_TCG_TPM is not set
421# CONFIG_I2C is not set
422# CONFIG_SPI is not set
423CONFIG_ARCH_REQUIRE_GPIOLIB=y
424CONFIG_GPIOLIB=y
425# CONFIG_DEBUG_GPIO is not set
426# CONFIG_GPIO_SYSFS is not set
427
428#
429# Memory mapped GPIO expanders:
430#
431
432#
433# I2C GPIO expanders:
434#
435
436#
437# PCI GPIO expanders:
438#
439
440#
441# SPI GPIO expanders:
442#
443# CONFIG_W1 is not set
444# CONFIG_POWER_SUPPLY is not set
445# CONFIG_HWMON is not set
446# CONFIG_THERMAL is not set
447# CONFIG_THERMAL_HWMON is not set
448# CONFIG_WATCHDOG is not set
449CONFIG_SSB_POSSIBLE=y
450
451#
452# Sonics Silicon Backplane
453#
454# CONFIG_SSB is not set
455
456#
457# Multifunction device drivers
458#
459# CONFIG_MFD_CORE is not set
460# CONFIG_MFD_SM501 is not set
461# CONFIG_MFD_ASIC3 is not set
462# CONFIG_HTC_EGPIO is not set
463# CONFIG_HTC_PASIC3 is not set
464# CONFIG_MFD_TMIO is not set
465# CONFIG_MFD_T7L66XB is not set
466# CONFIG_MFD_TC6387XB is not set
467# CONFIG_MFD_TC6393XB is not set
468
469#
470# Multimedia devices
471#
472
473#
474# Multimedia core support
475#
476# CONFIG_VIDEO_DEV is not set
477# CONFIG_VIDEO_MEDIA is not set
478
479#
480# Multimedia drivers
481#
482CONFIG_DAB=y
483
484#
485# Graphics support
486#
487# CONFIG_VGASTATE is not set
488# CONFIG_VIDEO_OUTPUT_CONTROL is not set
489# CONFIG_FB is not set
490# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
491
492#
493# Display device support
494#
495# CONFIG_DISPLAY_SUPPORT is not set
496
497#
498# Console display driver support
499#
500# CONFIG_VGA_CONSOLE is not set
501CONFIG_DUMMY_CONSOLE=y
502# CONFIG_SOUND is not set
503# CONFIG_HID_SUPPORT is not set
504# CONFIG_USB_SUPPORT is not set
505# CONFIG_MMC is not set
506# CONFIG_MEMSTICK is not set
507# CONFIG_ACCESSIBILITY is not set
508# CONFIG_NEW_LEDS is not set
509CONFIG_RTC_LIB=y
510# CONFIG_RTC_CLASS is not set
511# CONFIG_DMADEVICES is not set
512# CONFIG_REGULATOR is not set
513# CONFIG_UIO is not set
514# CONFIG_STAGING is not set
515
516#
517# CBUS support
518#
519# CONFIG_CBUS is not set
520
521#
522# File systems
523#
524CONFIG_EXT2_FS=y
525# CONFIG_EXT2_FS_XATTR is not set
526# CONFIG_EXT2_FS_XIP is not set
527CONFIG_EXT3_FS=y
528# CONFIG_EXT3_FS_XATTR is not set
529# CONFIG_EXT4_FS is not set
530CONFIG_JBD=y
531# CONFIG_REISERFS_FS is not set
532# CONFIG_JFS_FS is not set
533# CONFIG_FS_POSIX_ACL is not set
534CONFIG_FILE_LOCKING=y
535# CONFIG_XFS_FS is not set
536# CONFIG_BTRFS_FS is not set
537CONFIG_DNOTIFY=y
538CONFIG_INOTIFY=y
539CONFIG_INOTIFY_USER=y
540CONFIG_QUOTA=y
541CONFIG_PRINT_QUOTA_WARNING=y
542CONFIG_QUOTA_TREE=y
543# CONFIG_QFMT_V1 is not set
544CONFIG_QFMT_V2=y
545CONFIG_QUOTACTL=y
546# CONFIG_AUTOFS_FS is not set
547# CONFIG_AUTOFS4_FS is not set
548# CONFIG_FUSE_FS is not set
549
550#
551# CD-ROM/DVD Filesystems
552#
553# CONFIG_ISO9660_FS is not set
554# CONFIG_UDF_FS is not set
555
556#
557# DOS/FAT/NT Filesystems
558#
559CONFIG_FAT_FS=y
560CONFIG_MSDOS_FS=y
561CONFIG_VFAT_FS=y
562CONFIG_FAT_DEFAULT_CODEPAGE=437
563CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
564# CONFIG_NTFS_FS is not set
565
566#
567# Pseudo filesystems
568#
569CONFIG_PROC_FS=y
570CONFIG_PROC_SYSCTL=y
571CONFIG_SYSFS=y
572CONFIG_TMPFS=y
573# CONFIG_TMPFS_POSIX_ACL is not set
574# CONFIG_HUGETLB_PAGE is not set
575# CONFIG_CONFIGFS_FS is not set
576CONFIG_MISC_FILESYSTEMS=y
577# CONFIG_ADFS_FS is not set
578# CONFIG_AFFS_FS is not set
579# CONFIG_HFS_FS is not set
580# CONFIG_HFSPLUS_FS is not set
581# CONFIG_BEFS_FS is not set
582# CONFIG_BFS_FS is not set
583# CONFIG_EFS_FS is not set
584# CONFIG_CRAMFS is not set
585# CONFIG_SQUASHFS is not set
586# CONFIG_VXFS_FS is not set
587# CONFIG_MINIX_FS is not set
588# CONFIG_OMFS_FS is not set
589# CONFIG_HPFS_FS is not set
590# CONFIG_QNX4FS_FS is not set
591# CONFIG_ROMFS_FS is not set
592# CONFIG_SYSV_FS is not set
593# CONFIG_UFS_FS is not set
594
595#
596# Partition Types
597#
598CONFIG_PARTITION_ADVANCED=y
599# CONFIG_ACORN_PARTITION is not set
600# CONFIG_OSF_PARTITION is not set
601# CONFIG_AMIGA_PARTITION is not set
602# CONFIG_ATARI_PARTITION is not set
603# CONFIG_MAC_PARTITION is not set
604CONFIG_MSDOS_PARTITION=y
605# CONFIG_BSD_DISKLABEL is not set
606# CONFIG_MINIX_SUBPARTITION is not set
607# CONFIG_SOLARIS_X86_PARTITION is not set
608# CONFIG_UNIXWARE_DISKLABEL is not set
609# CONFIG_LDM_PARTITION is not set
610# CONFIG_SGI_PARTITION is not set
611# CONFIG_ULTRIX_PARTITION is not set
612# CONFIG_SUN_PARTITION is not set
613# CONFIG_KARMA_PARTITION is not set
614# CONFIG_EFI_PARTITION is not set
615# CONFIG_SYSV68_PARTITION is not set
616CONFIG_NLS=y
617CONFIG_NLS_DEFAULT="iso8859-1"
618CONFIG_NLS_CODEPAGE_437=y
619# CONFIG_NLS_CODEPAGE_737 is not set
620# CONFIG_NLS_CODEPAGE_775 is not set
621# CONFIG_NLS_CODEPAGE_850 is not set
622# CONFIG_NLS_CODEPAGE_852 is not set
623# CONFIG_NLS_CODEPAGE_855 is not set
624# CONFIG_NLS_CODEPAGE_857 is not set
625# CONFIG_NLS_CODEPAGE_860 is not set
626# CONFIG_NLS_CODEPAGE_861 is not set
627# CONFIG_NLS_CODEPAGE_862 is not set
628# CONFIG_NLS_CODEPAGE_863 is not set
629# CONFIG_NLS_CODEPAGE_864 is not set
630# CONFIG_NLS_CODEPAGE_865 is not set
631# CONFIG_NLS_CODEPAGE_866 is not set
632# CONFIG_NLS_CODEPAGE_869 is not set
633# CONFIG_NLS_CODEPAGE_936 is not set
634# CONFIG_NLS_CODEPAGE_950 is not set
635# CONFIG_NLS_CODEPAGE_932 is not set
636# CONFIG_NLS_CODEPAGE_949 is not set
637# CONFIG_NLS_CODEPAGE_874 is not set
638# CONFIG_NLS_ISO8859_8 is not set
639# CONFIG_NLS_CODEPAGE_1250 is not set
640# CONFIG_NLS_CODEPAGE_1251 is not set
641# CONFIG_NLS_ASCII is not set
642CONFIG_NLS_ISO8859_1=y
643# CONFIG_NLS_ISO8859_2 is not set
644# CONFIG_NLS_ISO8859_3 is not set
645# CONFIG_NLS_ISO8859_4 is not set
646# CONFIG_NLS_ISO8859_5 is not set
647# CONFIG_NLS_ISO8859_6 is not set
648# CONFIG_NLS_ISO8859_7 is not set
649# CONFIG_NLS_ISO8859_9 is not set
650# CONFIG_NLS_ISO8859_13 is not set
651# CONFIG_NLS_ISO8859_14 is not set
652# CONFIG_NLS_ISO8859_15 is not set
653# CONFIG_NLS_KOI8_R is not set
654# CONFIG_NLS_KOI8_U is not set
655# CONFIG_NLS_UTF8 is not set
656
657#
658# Kernel hacking
659#
660# CONFIG_PRINTK_TIME is not set
661# CONFIG_ENABLE_WARN_DEPRECATED is not set
662# CONFIG_ENABLE_MUST_CHECK is not set
663CONFIG_FRAME_WARN=1024
664CONFIG_MAGIC_SYSRQ=y
665# CONFIG_UNUSED_SYMBOLS is not set
666# CONFIG_DEBUG_FS is not set
667# CONFIG_HEADERS_CHECK is not set
668CONFIG_DEBUG_KERNEL=y
669# CONFIG_DEBUG_BUGVERBOSE is not set
670CONFIG_DEBUG_INFO=y
671# CONFIG_DEBUG_VM is not set
672# CONFIG_DEBUG_WRITECOUNT is not set
673# CONFIG_DEBUG_MEMORY_INIT is not set
674CONFIG_FRAME_POINTER=y
675# CONFIG_BOOT_PRINTK_DELAY is not set
676# CONFIG_RCU_TORTURE_TEST is not set
677# CONFIG_RCU_CPU_STALL_DETECTOR is not set
678# CONFIG_BACKTRACE_SELF_TEST is not set
679# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
680# CONFIG_FAULT_INJECTION is not set
681# CONFIG_LATENCYTOP is not set
682CONFIG_HAVE_FUNCTION_TRACER=y
683
684#
685# Tracers
686#
687# CONFIG_FUNCTION_TRACER is not set
688# CONFIG_IRQSOFF_TRACER is not set
689# CONFIG_SCHED_TRACER is not set
690# CONFIG_CONTEXT_SWITCH_TRACER is not set
691# CONFIG_BOOT_TRACER is not set
692# CONFIG_TRACE_BRANCH_PROFILING is not set
693# CONFIG_STACK_TRACER is not set
694# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
695# CONFIG_SAMPLES is not set
696CONFIG_HAVE_ARCH_KGDB=y
697# CONFIG_KGDB is not set
698# CONFIG_DEBUG_USER is not set
699# CONFIG_DEBUG_ERRORS is not set
700# CONFIG_DEBUG_STACK_USAGE is not set
701# CONFIG_DEBUG_ICEDCC is not set
702
703#
704# Security options
705#
706# CONFIG_KEYS is not set
707# CONFIG_SECURITY is not set
708# CONFIG_SECURITYFS is not set
709# CONFIG_SECURITY_FILE_CAPABILITIES is not set
710CONFIG_CRYPTO=y
711
712#
713# Crypto core or helper
714#
715CONFIG_CRYPTO_ALGAPI=y
716CONFIG_CRYPTO_BLKCIPHER=y
717CONFIG_CRYPTO_MANAGER=y
718# CONFIG_CRYPTO_GF128MUL is not set
719# CONFIG_CRYPTO_NULL is not set
720# CONFIG_CRYPTO_CRYPTD is not set
721# CONFIG_CRYPTO_AUTHENC is not set
722# CONFIG_CRYPTO_TEST is not set
723
724#
725# Authenticated Encryption with Associated Data
726#
727# CONFIG_CRYPTO_CCM is not set
728# CONFIG_CRYPTO_GCM is not set
729# CONFIG_CRYPTO_SEQIV is not set
730
731#
732# Block modes
733#
734CONFIG_CRYPTO_CBC=y
735# CONFIG_CRYPTO_CTR is not set
736# CONFIG_CRYPTO_CTS is not set
737CONFIG_CRYPTO_ECB=m
738# CONFIG_CRYPTO_LRW is not set
739CONFIG_CRYPTO_PCBC=m
740# CONFIG_CRYPTO_XTS is not set
741
742#
743# Hash modes
744#
745# CONFIG_CRYPTO_HMAC is not set
746# CONFIG_CRYPTO_XCBC is not set
747
748#
749# Digest
750#
751CONFIG_CRYPTO_CRC32C=y
752# CONFIG_CRYPTO_MD4 is not set
753CONFIG_CRYPTO_MD5=y
754# CONFIG_CRYPTO_MICHAEL_MIC is not set
755# CONFIG_CRYPTO_RMD128 is not set
756# CONFIG_CRYPTO_RMD160 is not set
757# CONFIG_CRYPTO_RMD256 is not set
758# CONFIG_CRYPTO_RMD320 is not set
759# CONFIG_CRYPTO_SHA1 is not set
760# CONFIG_CRYPTO_SHA256 is not set
761# CONFIG_CRYPTO_SHA512 is not set
762# CONFIG_CRYPTO_TGR192 is not set
763# CONFIG_CRYPTO_WP512 is not set
764
765#
766# Ciphers
767#
768# CONFIG_CRYPTO_AES is not set
769# CONFIG_CRYPTO_ANUBIS is not set
770# CONFIG_CRYPTO_ARC4 is not set
771# CONFIG_CRYPTO_BLOWFISH is not set
772# CONFIG_CRYPTO_CAMELLIA is not set
773# CONFIG_CRYPTO_CAST5 is not set
774# CONFIG_CRYPTO_CAST6 is not set
775CONFIG_CRYPTO_DES=y
776# CONFIG_CRYPTO_FCRYPT is not set
777# CONFIG_CRYPTO_KHAZAD is not set
778# CONFIG_CRYPTO_SALSA20 is not set
779# CONFIG_CRYPTO_SEED is not set
780# CONFIG_CRYPTO_SERPENT is not set
781# CONFIG_CRYPTO_TEA is not set
782# CONFIG_CRYPTO_TWOFISH is not set
783
784#
785# Compression
786#
787# CONFIG_CRYPTO_DEFLATE is not set
788# CONFIG_CRYPTO_LZO is not set
789CONFIG_CRYPTO_HW=y
790
791#
792# Library routines
793#
794CONFIG_BITREVERSE=y
795CONFIG_GENERIC_FIND_LAST_BIT=y
796CONFIG_CRC_CCITT=y
797# CONFIG_CRC16 is not set
798CONFIG_CRC_T10DIF=y
799# CONFIG_CRC_ITU_T is not set
800CONFIG_CRC32=y
801# CONFIG_CRC7 is not set
802CONFIG_LIBCRC32C=y
803CONFIG_PLIST=y
804CONFIG_HAS_IOMEM=y
805CONFIG_HAS_IOPORT=y
806CONFIG_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/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/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/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/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/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/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/smp.c b/arch/arm/kernel/smp.c
index 6014dfd22af4..0d8097fa4ca5 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -22,6 +22,8 @@
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>
@@ -32,6 +34,7 @@
32#include <asm/processor.h> 34#include <asm/processor.h>
33#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
34#include <asm/ptrace.h> 36#include <asm/ptrace.h>
37#include <asm/localtimer.h>
35 38
36/* 39/*
37 * as from 2.5, kernels no longer have an init_tasks structure 40 * as from 2.5, kernels no longer have an init_tasks structure
@@ -163,7 +166,7 @@ int __cpuexit __cpu_disable(void)
163 * Take this CPU offline. Once we clear this, we can't return, 166 * 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. 167 * and we must not schedule until we're ready to give up the cpu.
165 */ 168 */
166 cpu_clear(cpu, cpu_online_map); 169 set_cpu_online(cpu, false);
167 170
168 /* 171 /*
169 * OK - migrate IRQs away from this CPU 172 * OK - migrate IRQs away from this CPU
@@ -274,9 +277,9 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
274 local_fiq_enable(); 277 local_fiq_enable();
275 278
276 /* 279 /*
277 * Setup local timer for this CPU. 280 * Setup the percpu timer for this CPU.
278 */ 281 */
279 local_timer_setup(); 282 percpu_timer_setup();
280 283
281 calibrate_delay(); 284 calibrate_delay();
282 285
@@ -285,7 +288,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
285 /* 288 /*
286 * OK, now it's safe to let the boot CPU continue 289 * OK, now it's safe to let the boot CPU continue
287 */ 290 */
288 cpu_set(cpu, cpu_online_map); 291 set_cpu_online(cpu, true);
289 292
290 /* 293 /*
291 * OK, it's off to the idle thread for us 294 * OK, it's off to the idle thread for us
@@ -383,10 +386,16 @@ void show_local_irqs(struct seq_file *p)
383 seq_putc(p, '\n'); 386 seq_putc(p, '\n');
384} 387}
385 388
389/*
390 * Timer (local or broadcast) support
391 */
392static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
393
386static void ipi_timer(void) 394static void ipi_timer(void)
387{ 395{
396 struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
388 irq_enter(); 397 irq_enter();
389 local_timer_interrupt(); 398 evt->event_handler(evt);
390 irq_exit(); 399 irq_exit();
391} 400}
392 401
@@ -405,6 +414,42 @@ asmlinkage void __exception do_local_timer(struct pt_regs *regs)
405} 414}
406#endif 415#endif
407 416
417#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
418static void smp_timer_broadcast(const struct cpumask *mask)
419{
420 send_ipi_message(mask, IPI_TIMER);
421}
422
423static void broadcast_timer_set_mode(enum clock_event_mode mode,
424 struct clock_event_device *evt)
425{
426}
427
428static void local_timer_setup(struct clock_event_device *evt)
429{
430 evt->name = "dummy_timer";
431 evt->features = CLOCK_EVT_FEAT_ONESHOT |
432 CLOCK_EVT_FEAT_PERIODIC |
433 CLOCK_EVT_FEAT_DUMMY;
434 evt->rating = 400;
435 evt->mult = 1;
436 evt->set_mode = broadcast_timer_set_mode;
437 evt->broadcast = smp_timer_broadcast;
438
439 clockevents_register_device(evt);
440}
441#endif
442
443void __cpuinit percpu_timer_setup(void)
444{
445 unsigned int cpu = smp_processor_id();
446 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
447
448 evt->cpumask = cpumask_of(cpu);
449
450 local_timer_setup(evt);
451}
452
408static DEFINE_SPINLOCK(stop_lock); 453static DEFINE_SPINLOCK(stop_lock);
409 454
410/* 455/*
@@ -417,7 +462,7 @@ static void ipi_cpu_stop(unsigned int cpu)
417 dump_stack(); 462 dump_stack();
418 spin_unlock(&stop_lock); 463 spin_unlock(&stop_lock);
419 464
420 cpu_clear(cpu, cpu_online_map); 465 set_cpu_online(cpu, false);
421 466
422 local_fiq_disable(); 467 local_fiq_disable();
423 local_irq_disable(); 468 local_irq_disable();
@@ -501,11 +546,6 @@ void smp_send_reschedule(int cpu)
501 send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); 546 send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE);
502} 547}
503 548
504void smp_timer_broadcast(const struct cpumask *mask)
505{
506 send_ipi_message(mask, IPI_TIMER);
507}
508
509void smp_send_stop(void) 549void smp_send_stop(void)
510{ 550{
511 cpumask_t mask = cpu_online_map; 551 cpumask_t mask = cpu_online_map;
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/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/core.c b/arch/arm/mach-ep93xx/core.c
index ae24486f858a..c535e8805a3b 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -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/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index 1732de7629a5..420f71b85123 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -147,6 +147,7 @@
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))
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/memory.h b/arch/arm/mach-imx/include/mach/memory.h
deleted file mode 100644
index a93df7cba694..000000000000
--- a/arch/arm/mach-imx/include/mach/memory.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-imx/include/mach/memory.h
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#ifndef __ASM_ARCH_MMU_H
22#define __ASM_ARCH_MMU_H
23
24#define PHYS_OFFSET UL(0x08000000)
25
26#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/system.h b/arch/arm/mach-imx/include/mach/system.h
deleted file mode 100644
index 46d4ca91af79..000000000000
--- a/arch/arm/mach-imx/include/mach/system.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * arch/arm/mach-imxads/include/mach/system.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#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H
23
24static void
25arch_idle(void)
26{
27 /*
28 * This should do all the clock switching
29 * and wait for interrupt tricks
30 */
31 cpu_do_idle();
32}
33
34static inline void
35arch_reset(char mode, const char *cmd)
36{
37 cpu_reset(0);
38}
39
40#endif
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/include/mach/vmalloc.h b/arch/arm/mach-imx/include/mach/vmalloc.h
deleted file mode 100644
index 7d7cb0bde3e8..000000000000
--- a/arch/arm/mach-imx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-imx/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 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#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
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-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 999d013e06e3..fa2b292d7b3c 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[] __initdata = {
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 53a112d4e04a..0d76521cb491 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[] __initdata = {
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 9957a11533a4..217d114b177a 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-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..6226e64d99a1 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -3,9 +3,14 @@
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
@@ -20,14 +25,21 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
20 25
21# Power Management 26# Power Management
22ifeq ($(CONFIG_PM),y) 27ifeq ($(CONFIG_PM),y)
23obj-y += pm.o 28obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
24obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o 29obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o
30obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o
31obj-$(CONFIG_PM_DEBUG) += pm-debug.o
25endif 32endif
26 33
27# Clock framework 34# Clock framework
28obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o 35obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o
29obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o 36obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o
30 37
38iommu-y += iommu2.o
39iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o
40
41obj-$(CONFIG_OMAP_IOMMU) += $(iommu-y)
42
31# Specific board support 43# Specific board support
32obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 44obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
33obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 45obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
@@ -40,6 +52,8 @@ obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \
40 mmc-twl4030.o 52 mmc-twl4030.o
41obj-$(CONFIG_MACH_OVERO) += board-overo.o \ 53obj-$(CONFIG_MACH_OVERO) += board-overo.o \
42 mmc-twl4030.o 54 mmc-twl4030.o
55obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \
56 mmc-twl4030.o
43obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ 57obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \
44 mmc-twl4030.o 58 mmc-twl4030.o
45obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ 59obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
@@ -48,8 +62,17 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
48obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 62obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
49 board-rx51-peripherals.o \ 63 board-rx51-peripherals.o \
50 mmc-twl4030.o 64 mmc-twl4030.o
65obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \
66 mmc-twl4030.o \
67 board-zoom-debugboard.o
68
69obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
51 70
52# Platform specific device init code 71# Platform specific device init code
53ifeq ($(CONFIG_USB_MUSB_SOC),y)
54obj-y += usb-musb.o 72obj-y += usb-musb.o
55endif 73
74onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o
75obj-y += $(onenand-m) $(onenand-y)
76
77smc91x-$(CONFIG_SMC91X) := gpmc-smc91x.o
78obj-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/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..2ce474a9d2b6 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
@@ -82,7 +83,8 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
82 case CLOCK_EVT_MODE_PERIODIC: 83 case CLOCK_EVT_MODE_PERIODIC:
83 period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ; 84 period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
84 period -= 1; 85 period -= 1;
85 86 if (cpu_is_omap44xx())
87 period = 0xff; /* FIXME: */
86 omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period); 88 omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period);
87 break; 89 break;
88 case CLOCK_EVT_MODE_ONESHOT: 90 case CLOCK_EVT_MODE_ONESHOT:
@@ -145,6 +147,9 @@ static void __init omap2_gp_clockevent_init(void)
145 "timer-gp: omap_dm_timer_set_source() failed\n"); 147 "timer-gp: omap_dm_timer_set_source() failed\n");
146 148
147 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); 149 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer));
150 if (cpu_is_omap44xx())
151 /* Assuming 32kHz clk is driving GPT1 */
152 tick_rate = 32768; /* FIXME: */
148 153
149 pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n", 154 pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n",
150 gptimer_id, tick_rate); 155 gptimer_id, tick_rate);
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-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/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/palmld.c b/arch/arm/mach-pxa/palmld.c
index 471a853e548b..2e65f05d366c 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[] = {
@@ -559,6 +567,7 @@ static struct platform_device *devices[] __initdata = {
559 &palmld_leds, 567 &palmld_leds,
560 &power_supply, 568 &power_supply,
561 &palmld_asoc, 569 &palmld_asoc,
570 &palmld_hdd,
562}; 571};
563 572
564static struct map_desc palmld_io_desc[] __initdata = { 573static struct map_desc palmld_io_desc[] __initdata = {
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index b6ec10627776..bf35cfd89f34 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
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index 7bea8ffc4b59..e13d0947ad0b 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -7,5 +7,6 @@ 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_SMP) += platsmp.o headsmp.o
11obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 11obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
12obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
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/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/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..ca742172ea78 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -19,10 +19,11 @@
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 <asm/smp_scu.h>
26 27
27#include "core.h" 28#include "core.h"
28 29
@@ -44,31 +45,12 @@ static void __iomem *scu_base_addr(void)
44 return (void __iomem *)0; 45 return (void __iomem *)0;
45} 46}
46 47
47static unsigned int __init get_core_count(void) 48static inline unsigned int get_core_count(void)
48{ 49{
49 unsigned int ncores;
50 void __iomem *scu_base = scu_base_addr(); 50 void __iomem *scu_base = scu_base_addr();
51 51 if (scu_base)
52 if (scu_base) { 52 return scu_get_core_count(scu_base);
53 ncores = __raw_readl(scu_base + SCU_CONFIG); 53 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} 54}
73 55
74static DEFINE_SPINLOCK(boot_lock); 56static DEFINE_SPINLOCK(boot_lock);
@@ -184,7 +166,7 @@ void __init smp_init_cpus(void)
184 unsigned int i, ncores = get_core_count(); 166 unsigned int i, ncores = get_core_count();
185 167
186 for (i = 0; i < ncores; i++) 168 for (i = 0; i < ncores; i++)
187 cpu_set(i, cpu_possible_map); 169 set_cpu_possible(i, true);
188} 170}
189 171
190void __init smp_prepare_cpus(unsigned int max_cpus) 172void __init smp_prepare_cpus(unsigned int max_cpus)
@@ -217,19 +199,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
217 if (max_cpus > ncores) 199 if (max_cpus > ncores)
218 max_cpus = ncores; 200 max_cpus = ncores;
219 201
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 /* 202 /*
228 * Initialise the present map, which describes the set of CPUs 203 * Initialise the present map, which describes the set of CPUs
229 * actually populated at the present time. 204 * actually populated at the present time.
230 */ 205 */
231 for (i = 0; i < max_cpus; i++) 206 for (i = 0; i < max_cpus; i++)
232 cpu_set(i, cpu_present_map); 207 set_cpu_present(i, true);
233 208
234 /* 209 /*
235 * Initialise the SCU if there are more than one CPU and let 210 * Initialise the SCU if there are more than one CPU and let
@@ -239,7 +214,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
239 * WFI 214 * WFI
240 */ 215 */
241 if (max_cpus > 1) { 216 if (max_cpus > 1) {
242 scu_enable(); 217 /*
218 * Enable the local timer or broadcast device for the
219 * boot CPU, but only if we have more than one CPU.
220 */
221 percpu_timer_setup();
222
223 scu_enable(scu_base_addr());
243 poke_milo(); 224 poke_milo();
244 } 225 }
245} 226}
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_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/mm/Kconfig b/arch/arm/mm/Kconfig
index 20979564e7ee..b9bd481a0ecc 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -642,7 +642,6 @@ config CPU_BIG_ENDIAN
642config CPU_HIGH_VECTOR 642config CPU_HIGH_VECTOR
643 depends on !MMU && CPU_CP15 && !CPU_ARM740T 643 depends on !MMU && CPU_CP15 && !CPU_ARM740T
644 bool "Select the High exception vector" 644 bool "Select the High exception vector"
645 default n
646 help 645 help
647 Say Y here to select high exception vector(0xFFFF0000~). 646 Say Y here to select high exception vector(0xFFFF0000~).
648 The exception vector can be vary depending on the platform 647 The exception vector can be vary depending on the platform
@@ -726,7 +725,6 @@ config NEEDS_SYSCALL_FOR_CMPXCHG
726 725
727config OUTER_CACHE 726config OUTER_CACHE
728 bool 727 bool
729 default n
730 728
731config CACHE_FEROCEON_L2 729config CACHE_FEROCEON_L2
732 bool "Enable the Feroceon L2 cache controller" 730 bool "Enable the Feroceon L2 cache controller"
@@ -739,7 +737,6 @@ config CACHE_FEROCEON_L2
739config CACHE_FEROCEON_L2_WRITETHROUGH 737config CACHE_FEROCEON_L2_WRITETHROUGH
740 bool "Force Feroceon L2 cache write through" 738 bool "Force Feroceon L2 cache write through"
741 depends on CACHE_FEROCEON_L2 739 depends on CACHE_FEROCEON_L2
742 default n
743 help 740 help
744 Say Y here to use the Feroceon L2 cache in writethrough mode. 741 Say Y here to use the Feroceon L2 cache in writethrough mode.
745 Unless you specifically require this, say N for writeback mode. 742 Unless you specifically require this, say N for writeback mode.
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..70974d75a075 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.
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/mach-imx/include/mach/timex.h b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
index e22ba789546c..1111037d6d9d 100644
--- a/arch/arm/mach-imx/include/mach/timex.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
@@ -1,7 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/imx/timex.h 2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved
3 *
4 * Copyright (C) 1999 ARM Limited
5 * 3 *
6 * 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
7 * 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
@@ -18,9 +16,12 @@
18 * 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
19 */ 17 */
20 18
21#ifndef __ASM_ARCH_TIMEX_H 19#ifndef __ASM_ARCH_MXC_BOARD_MX35PDK_H__
22#define __ASM_ARCH_TIMEX_H 20#define __ASM_ARCH_MXC_BOARD_MX35PDK_H__
21
22/* mandatory for CONFIG_DEBUG_LL */
23 23
24#define CLOCK_TICK_RATE (16000000) 24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
25 26
26#endif 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/mach-imx/include/mach/io.h b/arch/arm/plat-mxc/include/mach/board-pcm043.h
index 9e197ae4590f..15fbdf16abcd 100644
--- a/arch/arm/mach-imx/include/mach/io.h
+++ b/arch/arm/plat-mxc/include/mach/board-pcm043.h
@@ -1,7 +1,5 @@
1/* 1/*
2 * arch/arm/mach-imxads/include/mach/io.h 2 * Copyright (C) 2008 Sascha Hauer, Pengutronix
3 *
4 * Copyright (C) 1999 ARM Limited
5 * 3 *
6 * 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
7 * 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
@@ -17,12 +15,13 @@
17 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
18 * 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
19 */ 17 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22 18
23#define IO_SPACE_LIMIT 0xffffffff 19#ifndef __ASM_ARCH_MXC_BOARD_PCM043_H__
20#define __ASM_ARCH_MXC_BOARD_PCM043_H__
21
22/* mandatory for CONFIG_LL_DEBUG */
24 23
25#define __io(a) __typesafe_io(a) 24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
26#define __mem_pci(a) (a) 25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
27 26
28#endif 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 599217b2e13f..90af4d9bc19e 100644
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ b/arch/arm/plat-mxc/include/mach/imx-uart.h
@@ -23,7 +23,7 @@
23 23
24struct imxuart_platform_data { 24struct imxuart_platform_data {
25 int (*init)(struct platform_device *pdev); 25 int (*init)(struct platform_device *pdev);
26 int (*exit)(struct platform_device *pdev); 26 void (*exit)(struct platform_device *pdev);
27 unsigned int flags; 27 unsigned int flags;
28}; 28};
29 29
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..00f45c01390d 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,40 @@
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#endif
95 140
96 .macro irq_prio_table 141 .macro irq_prio_table
97 .endm 142 .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..8015fe27c8b0 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,92 @@
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
431#define INT_44XX_BENCH_MPU_EMUL (3 + IRQ_GIC_START)
432#define INT_44XX_SSM_ABORT_IRQ (6 + IRQ_GIC_START)
433#define INT_44XX_SYS_NIRQ (7 + IRQ_GIC_START)
434#define INT_44XX_D2D_FW_IRQ (8 + IRQ_GIC_START)
435#define INT_44XX_PRCM_MPU_IRQ (11 + IRQ_GIC_START)
436#define INT_44XX_SDMA_IRQ0 (12 + IRQ_GIC_START)
437#define INT_44XX_SDMA_IRQ1 (13 + IRQ_GIC_START)
438#define INT_44XX_SDMA_IRQ2 (14 + IRQ_GIC_START)
439#define INT_44XX_SDMA_IRQ3 (15 + IRQ_GIC_START)
440#define INT_44XX_ISS_IRQ (24 + IRQ_GIC_START)
441#define INT_44XX_DSS_IRQ (25 + IRQ_GIC_START)
442#define INT_44XX_MAIL_U0_MPU (26 + IRQ_GIC_START)
443#define INT_44XX_DSP_MMU (28 + IRQ_GIC_START)
444#define INT_44XX_GPTIMER1 (37 + IRQ_GIC_START)
445#define INT_44XX_GPTIMER2 (38 + IRQ_GIC_START)
446#define INT_44XX_GPTIMER3 (39 + IRQ_GIC_START)
447#define INT_44XX_GPTIMER4 (40 + IRQ_GIC_START)
448#define INT_44XX_GPTIMER5 (41 + IRQ_GIC_START)
449#define INT_44XX_GPTIMER6 (42 + IRQ_GIC_START)
450#define INT_44XX_GPTIMER7 (43 + IRQ_GIC_START)
451#define INT_44XX_GPTIMER8 (44 + IRQ_GIC_START)
452#define INT_44XX_GPTIMER9 (45 + IRQ_GIC_START)
453#define INT_44XX_GPTIMER10 (46 + IRQ_GIC_START)
454#define INT_44XX_GPTIMER11 (47 + IRQ_GIC_START)
455#define INT_44XX_GPTIMER12 (95 + IRQ_GIC_START)
456#define INT_44XX_SHA1MD5 (51 + IRQ_GIC_START)
457#define INT_44XX_I2C1_IRQ (56 + IRQ_GIC_START)
458#define INT_44XX_I2C2_IRQ (57 + IRQ_GIC_START)
459#define INT_44XX_HDQ_IRQ (58 + IRQ_GIC_START)
460#define INT_44XX_SPI1_IRQ (65 + IRQ_GIC_START)
461#define INT_44XX_SPI2_IRQ (66 + IRQ_GIC_START)
462#define INT_44XX_HSI_1_IRQ0 (67 + IRQ_GIC_START)
463#define INT_44XX_HSI_2_IRQ1 (68 + IRQ_GIC_START)
464#define INT_44XX_HSI_1_DMAIRQ (71 + IRQ_GIC_START)
465#define INT_44XX_UART1_IRQ (72 + IRQ_GIC_START)
466#define INT_44XX_UART2_IRQ (73 + IRQ_GIC_START)
467#define INT_44XX_UART3_IRQ (74 + IRQ_GIC_START)
468#define INT_44XX_UART4_IRQ (70 + IRQ_GIC_START)
469#define INT_44XX_USB_IRQ_NISO (76 + IRQ_GIC_START)
470#define INT_44XX_USB_IRQ_ISO (77 + IRQ_GIC_START)
471#define INT_44XX_USB_IRQ_HGEN (78 + IRQ_GIC_START)
472#define INT_44XX_USB_IRQ_HSOF (79 + IRQ_GIC_START)
473#define INT_44XX_USB_IRQ_OTG (80 + IRQ_GIC_START)
474#define INT_44XX_MCBSP4_IRQ_TX (81 + IRQ_GIC_START)
475#define INT_44XX_MCBSP4_IRQ_RX (82 + IRQ_GIC_START)
476#define INT_44XX_MMC_IRQ (83 + IRQ_GIC_START)
477#define INT_44XX_MMC2_IRQ (86 + IRQ_GIC_START)
478#define INT_44XX_MCBSP2_IRQ_TX (89 + IRQ_GIC_START)
479#define INT_44XX_MCBSP2_IRQ_RX (90 + IRQ_GIC_START)
480#define INT_44XX_SPI3_IRQ (91 + IRQ_GIC_START)
481#define INT_44XX_SPI5_IRQ (69 + IRQ_GIC_START)
482
483#define INT_44XX_MCBSP5_IRQ (16 + IRQ_GIC_START)
484#define INT_44xX_MCBSP1_IRQ (17 + IRQ_GIC_START)
485#define INT_44XX_MCBSP2_IRQ (22 + IRQ_GIC_START)
486#define INT_44XX_MCBSP3_IRQ (23 + IRQ_GIC_START)
487#define INT_44XX_MCBSP4_IRQ (27 + IRQ_GIC_START)
488#define INT_44XX_HS_USB_MC (92 + IRQ_GIC_START)
489#define INT_44XX_HS_USB_DMA (93 + IRQ_GIC_START)
490
491#define INT_44XX_GPIO_BANK1 (29 + IRQ_GIC_START)
492#define INT_44XX_GPIO_BANK2 (30 + IRQ_GIC_START)
493#define INT_44XX_GPIO_BANK3 (31 + IRQ_GIC_START)
494#define INT_44XX_GPIO_BANK4 (32 + IRQ_GIC_START)
495#define INT_44XX_GPIO_BANK5 (33 + IRQ_GIC_START)
496#define INT_44XX_GPIO_BANK6 (34 + IRQ_GIC_START)
497#define INT_44XX_USIM_IRQ (35 + IRQ_GIC_START)
498#define INT_44XX_WDT3_IRQ (36 + IRQ_GIC_START)
499#define INT_44XX_SPI4_IRQ (48 + IRQ_GIC_START)
500#define INT_44XX_SHA1MD52_IRQ (49 + IRQ_GIC_START)
501#define INT_44XX_FPKA_READY_IRQ (50 + IRQ_GIC_START)
502#define INT_44XX_SHA1MD51_IRQ (51 + IRQ_GIC_START)
503#define INT_44XX_RNG_IRQ (52 + IRQ_GIC_START)
504#define INT_44XX_I2C3_IRQ (61 + IRQ_GIC_START)
505#define INT_44XX_FPKA_ERROR_IRQ (64 + IRQ_GIC_START)
506#define INT_44XX_PBIAS_IRQ (75 + IRQ_GIC_START)
507#define INT_44XX_OHCI_IRQ (76 + IRQ_GIC_START)
508#define INT_44XX_EHCI_IRQ (77 + IRQ_GIC_START)
509#define INT_44XX_TLL_IRQ (78 + IRQ_GIC_START)
510#define INT_44XX_PARTHASH_IRQ (79 + IRQ_GIC_START)
511#define INT_44XX_MMC3_IRQ (94 + IRQ_GIC_START)
512
513
425/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and 514/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
426 * 16 MPUIO lines */ 515 * 16 MPUIO lines */
427#define OMAP_MAX_GPIO_LINES 192 516#define OMAP_MAX_GPIO_LINES 192
@@ -467,6 +556,7 @@
467 556
468#ifndef __ASSEMBLY__ 557#ifndef __ASSEMBLY__
469extern void omap_init_irq(void); 558extern void omap_init_irq(void);
559extern int omap_irq_pending(void);
470#endif 560#endif
471 561
472#include <mach/hardware.h> 562#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/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}