aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-06 22:13:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-06 22:13:58 -0500
commit01539ba2a706ab7d35fc0667dff919ade7f87d63 (patch)
tree5a4bd0cf78007d06690fe4ac06bbd49a5a70bc47
parent9e9bc9736756f25d6c47b4eba0ebf25b20a6f153 (diff)
parentdc69d1af9e8d9cbbabff88bb35a6782187a22229 (diff)
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (243 commits) omap2: Make OMAP2PLUS select OMAP_DM_TIMER OMAP4: hwmod data: Fix alignment and end of line in structurefields OMAP4: hwmod data: Move the DMA structures OMAP4: hwmod data: Move the smartreflex structures OMAP4: hwmod data: Fix missing SIDLE_SMART_WKUP in smartreflexsysc arm: omap: tusb6010: add name for MUSB IRQ arm: omap: craneboard: Add USB EHCI support omap2+: Initialize serial port for dynamic remuxing for n8x0 omap2+: Add struct omap_board_data and use it for platform level serial init omap2+: Allow hwmod state changes to mux pads based on the state changes omap2+: Add support for hwmod specific muxing of devices omap2+: Add omap_mux_get_by_name OMAP2: PM: fix compile error when !CONFIG_SUSPEND MAINTAINERS: OMAP: hwmod: update hwmod code, data maintainership OMAP4: Smartreflex framework extensions OMAP4: hwmod: Add inital data for smartreflex modules. OMAP4: PM: Program correct init voltages for scalable VDDs OMAP4: Adding voltage driver support OMAP4: Register voltage PMIC parameters with the voltage layer OMAP3: PM: Program correct init voltages for VDD1 and VDD2 ... Fix up trivial conflict in arch/arm/plat-omap/Kconfig
-rw-r--r--Documentation/arm/OMAP/omap_pm25
-rw-r--r--MAINTAINERS14
-rw-r--r--arch/arm/configs/ams_delta_defconfig121
-rw-r--r--arch/arm/configs/htcherald_defconfig73
-rw-r--r--arch/arm/configs/n770_defconfig138
-rw-r--r--arch/arm/configs/omap1_defconfig286
-rw-r--r--arch/arm/configs/omap_generic_1510_defconfig84
-rw-r--r--arch/arm/configs/omap_generic_1610_defconfig87
-rw-r--r--arch/arm/configs/omap_generic_1710_defconfig75
-rw-r--r--arch/arm/configs/omap_h2_1610_defconfig109
-rw-r--r--arch/arm/configs/omap_innovator_1510_defconfig102
-rw-r--r--arch/arm/configs/omap_innovator_1610_defconfig58
-rw-r--r--arch/arm/configs/omap_osk_5912_defconfig87
-rw-r--r--arch/arm/configs/omap_perseus2_730_defconfig65
-rw-r--r--arch/arm/configs/palmte_defconfig48
-rw-r--r--arch/arm/configs/palmtt_defconfig56
-rw-r--r--arch/arm/configs/palmz71_defconfig53
-rw-r--r--arch/arm/configs/sx1_defconfig110
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h12
-rw-r--r--arch/arm/mach-omap1/Kconfig11
-rw-r--r--arch/arm/mach-omap1/Makefile12
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c137
-rw-r--r--arch/arm/mach-omap1/board-fsample.c89
-rw-r--r--arch/arm/mach-omap1/board-h2.c79
-rw-r--r--arch/arm/mach-omap1/board-h3.c97
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c102
-rw-r--r--arch/arm/mach-omap1/board-innovator.c32
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c30
-rw-r--r--arch/arm/mach-omap1/board-osk.c27
-rw-r--r--arch/arm/mach-omap1/board-palmte.c29
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c28
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c31
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c91
-rw-r--r--arch/arm/mach-omap1/board-sx1.c58
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c7
-rw-r--r--arch/arm/mach-omap1/clock_data.c27
-rw-r--r--arch/arm/mach-omap1/devices.c4
-rw-r--r--arch/arm/mach-omap1/dma.c390
-rw-r--r--arch/arm/mach-omap1/flash.c1
-rw-r--r--arch/arm/mach-omap1/fpga.c10
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c99
-rw-r--r--arch/arm/mach-omap1/gpio16xx.c200
-rw-r--r--arch/arm/mach-omap1/gpio7xx.c262
-rw-r--r--arch/arm/mach-omap1/include/mach/entry-macro.S27
-rw-r--r--arch/arm/mach-omap1/io.c39
-rw-r--r--arch/arm/mach-omap1/irq.c5
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c3
-rw-r--r--arch/arm/mach-omap1/leds.c3
-rw-r--r--arch/arm/mach-omap1/mailbox.c5
-rw-r--r--arch/arm/mach-omap1/mcbsp.c5
-rw-r--r--arch/arm/mach-omap1/mux.c2
-rw-r--r--arch/arm/mach-omap1/pm.c3
-rw-r--r--arch/arm/mach-omap1/pm_bus.c4
-rw-r--r--arch/arm/mach-omap1/serial.c11
-rw-r--r--arch/arm/mach-omap1/time.c1
-rw-r--r--arch/arm/mach-omap2/Kconfig34
-rw-r--r--arch/arm/mach-omap2/Makefile83
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c8
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c6
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c8
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c45
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c116
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c7
-rw-r--r--arch/arm/mach-omap2/board-apollon.c10
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c15
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c4
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c14
-rw-r--r--arch/arm/mach-omap2/board-generic.c3
-rw-r--r--arch/arm/mach-omap2/board-h4.c71
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c124
-rw-r--r--arch/arm/mach-omap2/board-igep0030.c7
-rw-r--r--arch/arm/mach-omap2/board-ldp.c8
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c70
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c8
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c10
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c8
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c22
-rw-r--r--arch/arm/mach-omap2/board-overo.c8
-rw-r--r--arch/arm/mach-omap2/board-rm680.c187
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c77
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c9
-rw-r--r--arch/arm/mach-omap2/board-rx51.c10
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c2
-rw-r--r--arch/arm/mach-omap2/board-zoom.c (renamed from arch/arm/mach-omap2/board-zoom3.c)102
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c117
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_apll.c12
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpllcore.c10
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_osc.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_sys.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c14
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c1
-rw-r--r--arch/arm/mach-omap2/clock.c6
-rw-r--r--arch/arm/mach-omap2/clock.h1
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c14
-rw-r--r--arch/arm/mach-omap2/clock2430.c2
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c14
-rw-r--r--arch/arm/mach-omap2/clock34xx.c2
-rw-r--r--arch/arm/mach-omap2/clock3517.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c6
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c230
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c690
-rw-r--r--arch/arm/mach-omap2/clockdomain.c220
-rw-r--r--arch/arm/mach-omap2/clockdomain.h (renamed from arch/arm/plat-omap/include/plat/clockdomain.h)40
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c (renamed from arch/arm/mach-omap2/clockdomains.h)109
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c (renamed from arch/arm/mach-omap2/clockdomains44xx.h)169
-rw-r--r--arch/arm/mach-omap2/cm-regbits-24xx.h11
-rw-r--r--arch/arm/mach-omap2/cm-regbits-34xx.h13
-rw-r--r--arch/arm/mach-omap2/cm-regbits-44xx.h3
-rw-r--r--arch/arm/mach-omap2/cm.c68
-rw-r--r--arch/arm/mach-omap2/cm.h137
-rw-r--r--arch/arm/mach-omap2/cm1_44xx.h261
-rw-r--r--arch/arm/mach-omap2/cm2_44xx.h508
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c471
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h147
-rw-r--r--arch/arm/mach-omap2/cm44xx.c52
-rw-r--r--arch/arm/mach-omap2/cm44xx.h668
-rw-r--r--arch/arm/mach-omap2/cm4xxx.c62
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c214
-rw-r--r--arch/arm/mach-omap2/cminst44xx.h31
-rw-r--r--arch/arm/mach-omap2/control.c133
-rw-r--r--arch/arm/mach-omap2/control.h42
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c40
-rw-r--r--arch/arm/mach-omap2/devices.c108
-rw-r--r--arch/arm/mach-omap2/dma.c297
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c57
-rw-r--r--arch/arm/mach-omap2/dsp.c23
-rw-r--r--arch/arm/mach-omap2/gpio.c104
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c19
-rw-r--r--arch/arm/mach-omap2/gpmc.c12
-rw-r--r--arch/arm/mach-omap2/include/mach/entry-macro.S44
-rw-r--r--arch/arm/mach-omap2/io.c141
-rw-r--r--arch/arm/mach-omap2/irq.c5
-rw-r--r--arch/arm/mach-omap2/mailbox.c19
-rw-r--r--arch/arm/mach-omap2/mux.c525
-rw-r--r--arch/arm/mach-omap2/mux.h154
-rw-r--r--arch/arm/mach-omap2/mux2420.c10
-rw-r--r--arch/arm/mach-omap2/mux2430.c10
-rw-r--r--arch/arm/mach-omap2/mux34xx.c9
-rw-r--r--arch/arm/mach-omap2/mux44xx.c1625
-rw-r--r--arch/arm/mach-omap2/mux44xx.h298
-rw-r--r--arch/arm/mach-omap2/omap-iommu.c10
-rw-r--r--arch/arm/mach-omap2/omap4-common.c30
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c483
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c465
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c519
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c870
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c1514
-rw-r--r--arch/arm/mach-omap2/omap_opp_data.h72
-rw-r--r--arch/arm/mach-omap2/omap_twl.c277
-rw-r--r--arch/arm/mach-omap2/opp.c93
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c107
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c57
-rw-r--r--arch/arm/mach-omap2/pm-debug.c21
-rw-r--r--arch/arm/mach-omap2/pm.c144
-rw-r--r--arch/arm/mach-omap2/pm.h59
-rw-r--r--arch/arm/mach-omap2/pm24xx.c224
-rw-r--r--arch/arm/mach-omap2/pm34xx.c236
-rw-r--r--arch/arm/mach-omap2/pm44xx.c18
-rw-r--r--arch/arm/mach-omap2/powerdomain-common.c110
-rw-r--r--arch/arm/mach-omap2/powerdomain.c441
-rw-r--r--arch/arm/mach-omap2/powerdomain.h (renamed from arch/arm/plat-omap/include/plat/powerdomain.h)84
-rw-r--r--arch/arm/mach-omap2/powerdomain2xxx_3xxx.c242
-rw-r--r--arch/arm/mach-omap2/powerdomain44xx.c225
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c (renamed from arch/arm/mach-omap2/powerdomains.h)84
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h22
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c (renamed from arch/arm/mach-omap2/powerdomains24xx.h)48
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c (renamed from arch/arm/mach-omap2/powerdomains34xx.h)56
-rw-r--r--arch/arm/mach-omap2/powerdomains44xx_data.c (renamed from arch/arm/mach-omap2/powerdomains44xx.h)92
-rw-r--r--arch/arm/mach-omap2/prcm-common.h85
-rw-r--r--arch/arm/mach-omap2/prcm.c556
-rw-r--r--arch/arm/mach-omap2/prcm44xx.h42
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.c45
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.h104
-rw-r--r--arch/arm/mach-omap2/prm-regbits-24xx.h2
-rw-r--r--arch/arm/mach-omap2/prm-regbits-34xx.h11
-rw-r--r--arch/arm/mach-omap2/prm-regbits-44xx.h2
-rw-r--r--arch/arm/mach-omap2/prm.h369
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c64
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.h367
-rw-r--r--arch/arm/mach-omap2/prm44xx.c81
-rw-r--r--arch/arm/mach-omap2/prm44xx.h766
-rw-r--r--arch/arm/mach-omap2/prminst44xx.c66
-rw-r--r--arch/arm/mach-omap2/prminst44xx.h25
-rw-r--r--arch/arm/mach-omap2/scrm44xx.h175
-rw-r--r--arch/arm/mach-omap2/sdram-nokia.c (renamed from arch/arm/mach-omap2/board-rx51-sdram.c)102
-rw-r--r--arch/arm/mach-omap2/sdram-nokia.h12
-rw-r--r--arch/arm/mach-omap2/sdrc.c2
-rw-r--r--arch/arm/mach-omap2/sdrc.h1
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c6
-rw-r--r--arch/arm/mach-omap2/serial.c69
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S836
-rw-r--r--arch/arm/mach-omap2/smartreflex-class3.c59
-rw-r--r--arch/arm/mach-omap2/smartreflex.c1029
-rw-r--r--arch/arm/mach-omap2/sr_device.c146
-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.S8
-rw-r--r--arch/arm/mach-omap2/timer-gp.c3
-rw-r--r--arch/arm/mach-omap2/usb-tusb6010.c5
-rw-r--r--arch/arm/mach-omap2/voltage.c1571
-rw-r--r--arch/arm/mach-omap2/wd_timer.c54
-rw-r--r--arch/arm/mach-omap2/wd_timer.h17
-rw-r--r--arch/arm/plat-omap/Kconfig35
-rw-r--r--arch/arm/plat-omap/devices.c40
-rw-r--r--arch/arm/plat-omap/dma.c695
-rw-r--r--arch/arm/plat-omap/gpio.c670
-rw-r--r--arch/arm/plat-omap/i2c.c128
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h20
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h16
-rw-r--r--arch/arm/plat-omap/include/plat/common.h2
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h232
-rw-r--r--arch/arm/plat-omap/include/plat/fpga.h4
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h48
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h9
-rw-r--r--arch/arm/plat-omap/include/plat/i2c.h13
-rw-r--r--arch/arm/plat-omap/include/plat/io.h5
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h5
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h2
-rw-r--r--arch/arm/plat-omap/include/plat/keypad.h35
-rw-r--r--arch/arm/plat-omap/include/plat/l4_3xxx.h24
-rw-r--r--arch/arm/plat-omap/include/plat/mailbox.h8
-rw-r--r--arch/arm/plat-omap/include/plat/omap-pm.h39
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h14
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h1
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h73
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h20
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h5
-rw-r--r--arch/arm/plat-omap/include/plat/smartreflex.h245
-rw-r--r--arch/arm/plat-omap/include/plat/sram.h11
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h3
-rw-r--r--arch/arm/plat-omap/include/plat/voltage.h146
-rw-r--r--arch/arm/plat-omap/io.c58
-rw-r--r--arch/arm/plat-omap/iommu.c24
-rw-r--r--arch/arm/plat-omap/iovmm.c81
-rw-r--r--arch/arm/plat-omap/mailbox.c130
-rw-r--r--arch/arm/plat-omap/mcbsp.c26
-rw-r--r--arch/arm/plat-omap/omap-pm-noop.c78
-rw-r--r--arch/arm/plat-omap/omap_device.c28
-rw-r--r--arch/arm/plat-omap/sram.c14
-rw-r--r--drivers/i2c/busses/i2c-omap.c73
-rw-r--r--drivers/input/keyboard/omap-keypad.c41
-rw-r--r--drivers/input/serio/Kconfig1
-rw-r--r--drivers/mtd/onenand/omap2.c3
-rw-r--r--drivers/serial/8250.c26
-rw-r--r--drivers/serial/omap-serial.c40
-rw-r--r--drivers/staging/tidspbridge/core/_tiomap.h15
-rw-r--r--include/linux/i2c-omap.h5
-rw-r--r--include/linux/input/matrix_keypad.h2
-rw-r--r--include/linux/serial_reg.h19
253 files changed, 20757 insertions, 8402 deletions
diff --git a/Documentation/arm/OMAP/omap_pm b/Documentation/arm/OMAP/omap_pm
index 5389440aade3..9012bb039094 100644
--- a/Documentation/arm/OMAP/omap_pm
+++ b/Documentation/arm/OMAP/omap_pm
@@ -127,3 +127,28 @@ implementation needs:
12710. (*pdata->cpu_set_freq)(unsigned long f) 12710. (*pdata->cpu_set_freq)(unsigned long f)
128 128
12911. (*pdata->cpu_get_freq)(void) 12911. (*pdata->cpu_get_freq)(void)
130
131Customizing OPP for platform
132============================
133Defining CONFIG_PM should enable OPP layer for the silicon
134and the registration of OPP table should take place automatically.
135However, in special cases, the default OPP table may need to be
136tweaked, for e.g.:
137 * enable default OPPs which are disabled by default, but which
138 could be enabled on a platform
139 * Disable an unsupported OPP on the platform
140 * Define and add a custom opp table entry
141in these cases, the board file needs to do additional steps as follows:
142arch/arm/mach-omapx/board-xyz.c
143 #include "pm.h"
144 ....
145 static void __init omap_xyz_init_irq(void)
146 {
147 ....
148 /* Initialize the default table */
149 omapx_opp_init();
150 /* Do customization to the defaults */
151 ....
152 }
153NOTE: omapx_opp_init will be omap3_opp_init or as required
154based on the omap family.
diff --git a/MAINTAINERS b/MAINTAINERS
index fd78afa0b147..bcb78306b62f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4363,6 +4363,20 @@ M: Deepak Saxena <dsaxena@plexity.net>
4363S: Maintained 4363S: Maintained
4364F: drivers/char/hw_random/omap-rng.c 4364F: drivers/char/hw_random/omap-rng.c
4365 4365
4366OMAP HWMOD SUPPORT
4367M: Benoît Cousson <b-cousson@ti.com>
4368M: Paul Walmsley <paul@pwsan.com>
4369L: linux-omap@vger.kernel.org
4370S: Maintained
4371F: arch/arm/mach-omap2/omap_hwmod.c
4372F: arch/arm/plat-omap/include/plat/omap_hwmod.h
4373
4374OMAP HWMOD DATA FOR OMAP4-BASED DEVICES
4375M: Benoît Cousson <b-cousson@ti.com>
4376L: linux-omap@vger.kernel.org
4377S: Maintained
4378F: arch/arm/mach-omap2/omap_hwmod_44xx_data.c
4379
4366OMAP USB SUPPORT 4380OMAP USB SUPPORT
4367M: Felipe Balbi <balbi@ti.com> 4381M: Felipe Balbi <balbi@ti.com>
4368M: David Brownell <dbrownell@users.sourceforge.net> 4382M: David Brownell <dbrownell@users.sourceforge.net>
diff --git a/arch/arm/configs/ams_delta_defconfig b/arch/arm/configs/ams_delta_defconfig
deleted file mode 100644
index 75de45e949b9..000000000000
--- a/arch/arm/configs/ams_delta_defconfig
+++ /dev/null
@@ -1,121 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y
4CONFIG_TREE_PREEMPT_RCU=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_BLK_DEV_INITRD=y
7CONFIG_EMBEDDED=y
8# CONFIG_KALLSYMS is not set
9CONFIG_SLAB=y
10CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y
12CONFIG_MODULE_FORCE_UNLOAD=y
13# CONFIG_LBDAF is not set
14CONFIG_ARCH_OMAP=y
15CONFIG_ARCH_OMAP1=y
16CONFIG_OMAP_MBOX_FWK=m
17CONFIG_MACH_AMS_DELTA=y
18CONFIG_OMAP_ARM_150MHZ=y
19# CONFIG_OMAP_ARM_60MHZ is not set
20CONFIG_PREEMPT=y
21CONFIG_AEABI=y
22CONFIG_ZBOOT_ROM_TEXT=0x0
23CONFIG_ZBOOT_ROM_BSS=0x0
24CONFIG_CMDLINE="mem=32M console=ttyS0,115200n8 root=/dev/ram0 initrd=0x11c00000,4M"
25CONFIG_FPE_NWFPE=y
26CONFIG_PM=y
27# CONFIG_SUSPEND is not set
28CONFIG_PM_RUNTIME=y
29CONFIG_NET=y
30CONFIG_PACKET=y
31CONFIG_UNIX=y
32CONFIG_INET=y
33CONFIG_IP_MULTICAST=y
34CONFIG_IPV6=y
35# CONFIG_FW_LOADER is not set
36CONFIG_MTD=y
37CONFIG_MTD_PARTITIONS=y
38CONFIG_MTD_CHAR=y
39CONFIG_MTD_BLOCK=y
40CONFIG_MTD_NAND=y
41CONFIG_MTD_NAND_AMS_DELTA=y
42CONFIG_BLK_DEV_LOOP=y
43CONFIG_BLK_DEV_RAM=y
44CONFIG_BLK_DEV_RAM_SIZE=8192
45CONFIG_SCSI=y
46CONFIG_BLK_DEV_SD=y
47CONFIG_NETDEVICES=y
48CONFIG_NET_ETHERNET=y
49CONFIG_USB_CATC=y
50CONFIG_USB_KAWETH=y
51CONFIG_USB_PEGASUS=y
52CONFIG_USB_RTL8150=y
53CONFIG_USB_USBNET=y
54CONFIG_PPP=y
55CONFIG_PPP_MULTILINK=y
56CONFIG_INPUT_EVDEV=y
57CONFIG_KEYBOARD_OMAP=y
58# CONFIG_INPUT_MOUSE is not set
59CONFIG_SERIAL_8250=y
60CONFIG_SERIAL_8250_CONSOLE=y
61# CONFIG_LEGACY_PTYS is not set
62CONFIG_HW_RANDOM=y
63CONFIG_I2C=y
64CONFIG_I2C_CHARDEV=y
65CONFIG_I2C_OMAP=y
66CONFIG_GPIO_SYSFS=y
67# CONFIG_HWMON is not set
68CONFIG_FB=y
69CONFIG_FIRMWARE_EDID=y
70CONFIG_FB_OMAP=y
71CONFIG_BACKLIGHT_LCD_SUPPORT=y
72CONFIG_LCD_CLASS_DEVICE=y
73# CONFIG_VGA_CONSOLE is not set
74CONFIG_FRAMEBUFFER_CONSOLE=y
75CONFIG_FONTS=y
76CONFIG_FONT_6x11=y
77CONFIG_LOGO=y
78# CONFIG_LOGO_LINUX_MONO is not set
79# CONFIG_LOGO_LINUX_VGA16 is not set
80CONFIG_SOUND=y
81CONFIG_SND=y
82CONFIG_SND_MIXER_OSS=y
83CONFIG_SND_PCM_OSS=y
84CONFIG_SND_SOC=y
85CONFIG_SND_OMAP_SOC=y
86CONFIG_SND_OMAP_SOC_AMS_DELTA=y
87CONFIG_USB=y
88CONFIG_USB_DEVICEFS=y
89# CONFIG_USB_DEVICE_CLASS is not set
90CONFIG_USB_MON=y
91CONFIG_USB_OHCI_HCD=y
92CONFIG_USB_STORAGE=y
93CONFIG_NEW_LEDS=y
94CONFIG_LEDS_CLASS=y
95CONFIG_LEDS_AMS_DELTA=y
96CONFIG_LEDS_TRIGGERS=y
97CONFIG_LEDS_TRIGGER_TIMER=y
98CONFIG_LEDS_TRIGGER_HEARTBEAT=y
99CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
100CONFIG_RTC_CLASS=y
101CONFIG_RTC_DRV_OMAP=y
102CONFIG_EXT2_FS=y
103CONFIG_EXT3_FS=y
104CONFIG_INOTIFY=y
105CONFIG_AUTOFS_FS=y
106CONFIG_AUTOFS4_FS=y
107CONFIG_MSDOS_FS=y
108CONFIG_VFAT_FS=y
109CONFIG_TMPFS=y
110CONFIG_JFFS2_FS=y
111CONFIG_JFFS2_SUMMARY=y
112CONFIG_NFS_FS=y
113CONFIG_PARTITION_ADVANCED=y
114CONFIG_NLS_CODEPAGE_437=y
115CONFIG_NLS_CODEPAGE_850=y
116CONFIG_NLS_CODEPAGE_852=y
117CONFIG_NLS_ISO8859_1=y
118CONFIG_NLS_ISO8859_2=y
119CONFIG_MAGIC_SYSRQ=y
120CONFIG_DEBUG_KERNEL=y
121# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/arm/configs/htcherald_defconfig b/arch/arm/configs/htcherald_defconfig
deleted file mode 100644
index edfa1c0daab0..000000000000
--- a/arch/arm/configs/htcherald_defconfig
+++ /dev/null
@@ -1,73 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8# CONFIG_BLK_DEV_BSG is not set
9CONFIG_ARCH_OMAP=y
10CONFIG_ARCH_OMAP1=y
11CONFIG_ARCH_OMAP850=y
12# CONFIG_ARCH_OMAP15XX is not set
13CONFIG_MACH_HERALD=y
14CONFIG_OMAP_ARM_195MHZ=y
15# CONFIG_OMAP_ARM_60MHZ is not set
16CONFIG_CPU_ARM925T=y
17CONFIG_PREEMPT=y
18CONFIG_AEABI=y
19CONFIG_LEDS=y
20CONFIG_ZBOOT_ROM_TEXT=0x0
21CONFIG_ZBOOT_ROM_BSS=0x0
22CONFIG_CMDLINE="mem=32M console=ttyS0,115200 ip=dhcp"
23CONFIG_FPE_NWFPE=y
24CONFIG_PM=y
25CONFIG_NET=y
26CONFIG_PACKET=y
27CONFIG_UNIX=y
28CONFIG_INET=y
29CONFIG_IP_MULTICAST=y
30CONFIG_IP_PNP=y
31CONFIG_IP_PNP_DHCP=y
32CONFIG_IP_PNP_BOOTP=y
33# CONFIG_IPV6 is not set
34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
35CONFIG_BLK_DEV_LOOP=y
36CONFIG_BLK_DEV_RAM=y
37CONFIG_BLK_DEV_RAM_SIZE=8192
38CONFIG_NETDEVICES=y
39CONFIG_NET_ETHERNET=y
40CONFIG_SMC91X=y
41# CONFIG_KEYBOARD_ATKBD is not set
42CONFIG_KEYBOARD_OMAP=y
43# CONFIG_INPUT_MOUSE is not set
44CONFIG_SERIAL_8250=m
45# CONFIG_LEGACY_PTYS is not set
46CONFIG_VIDEO_OUTPUT_CONTROL=m
47CONFIG_FB=y
48CONFIG_FB_MODE_HELPERS=y
49CONFIG_FB_OMAP=y
50# CONFIG_VGA_CONSOLE is not set
51CONFIG_FRAMEBUFFER_CONSOLE=y
52CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
53CONFIG_FONTS=y
54CONFIG_FONT_MINI_4x6=y
55CONFIG_USB_GADGET=y
56CONFIG_USB_ETH=m
57# CONFIG_USB_ETH_RNDIS is not set
58CONFIG_MMC=y
59CONFIG_MMC_SDHCI=y
60CONFIG_MMC_SDHCI_PLTFM=y
61CONFIG_MMC_OMAP=y
62CONFIG_RTC_CLASS=y
63CONFIG_EXT2_FS=y
64CONFIG_EXT3_FS=y
65CONFIG_INOTIFY=y
66CONFIG_TMPFS=y
67CONFIG_NFS_FS=y
68CONFIG_ROOT_NFS=y
69# CONFIG_RCU_CPU_STALL_DETECTOR is not set
70CONFIG_CRYPTO_DEFLATE=y
71CONFIG_CRYPTO_ZLIB=y
72CONFIG_CRYPTO_LZO=y
73# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/arm/configs/n770_defconfig b/arch/arm/configs/n770_defconfig
deleted file mode 100644
index 993e94df5d0e..000000000000
--- a/arch/arm/configs/n770_defconfig
+++ /dev/null
@@ -1,138 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8# CONFIG_BLK_DEV_BSG is not set
9# CONFIG_IOSCHED_DEADLINE is not set
10CONFIG_ARCH_OMAP=y
11CONFIG_ARCH_OMAP1=y
12CONFIG_OMAP_RESET_CLOCKS=y
13# CONFIG_OMAP_MUX is not set
14CONFIG_OMAP_MBOX_FWK=y
15CONFIG_OMAP_32K_TIMER=y
16CONFIG_OMAP_DM_TIMER=y
17# CONFIG_ARCH_OMAP15XX is not set
18CONFIG_ARCH_OMAP16XX=y
19CONFIG_MACH_NOKIA770=y
20CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
21CONFIG_OMAP_ARM_216MHZ=y
22# CONFIG_OMAP_ARM_60MHZ is not set
23CONFIG_ZBOOT_ROM_TEXT=0x0
24CONFIG_ZBOOT_ROM_BSS=0x0
25CONFIG_CMDLINE="root=1f03 rootfstype=jffs2 time"
26CONFIG_FPE_NWFPE=y
27CONFIG_PM=y
28CONFIG_PM_RUNTIME=y
29CONFIG_NET=y
30CONFIG_PACKET=y
31CONFIG_UNIX=y
32CONFIG_INET=y
33CONFIG_IP_MULTICAST=y
34CONFIG_IP_PNP=y
35CONFIG_IP_PNP_DHCP=y
36CONFIG_IP_PNP_BOOTP=y
37# CONFIG_INET_LRO is not set
38# CONFIG_INET_DIAG is not set
39# CONFIG_IPV6 is not set
40CONFIG_NETFILTER=y
41CONFIG_BT=y
42CONFIG_BT_L2CAP=y
43CONFIG_BT_SCO=y
44CONFIG_BT_RFCOMM=y
45CONFIG_BT_RFCOMM_TTY=y
46CONFIG_BT_BNEP=y
47CONFIG_BT_HIDP=y
48CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
49CONFIG_CONNECTOR=y
50# CONFIG_PROC_EVENTS is not set
51CONFIG_MTD=y
52CONFIG_MTD_PARTITIONS=y
53CONFIG_MTD_CMDLINE_PARTS=y
54CONFIG_MTD_CHAR=y
55CONFIG_MTD_BLOCK=y
56CONFIG_MTD_NAND=y
57CONFIG_BLK_DEV_LOOP=y
58CONFIG_SCSI=y
59# CONFIG_SCSI_PROC_FS is not set
60CONFIG_BLK_DEV_SD=y
61CONFIG_NETDEVICES=y
62CONFIG_TUN=y
63CONFIG_NET_ETHERNET=y
64CONFIG_USB_USBNET=y
65# CONFIG_USB_NET_AX8817X is not set
66# CONFIG_USB_NET_CDC_SUBSET is not set
67CONFIG_PPP=y
68CONFIG_PPP_FILTER=y
69CONFIG_PPP_ASYNC=y
70CONFIG_PPP_DEFLATE=y
71CONFIG_PPP_BSDCOMP=y
72# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
73CONFIG_INPUT_EVDEV=y
74# CONFIG_KEYBOARD_ATKBD is not set
75CONFIG_KEYBOARD_OMAP=y
76# CONFIG_INPUT_MOUSE is not set
77CONFIG_INPUT_TOUCHSCREEN=y
78CONFIG_TOUCHSCREEN_ADS7846=y
79CONFIG_SERIAL_8250=y
80CONFIG_SERIAL_8250_CONSOLE=y
81# CONFIG_LEGACY_PTYS is not set
82CONFIG_I2C=y
83CONFIG_I2C_OMAP=y
84CONFIG_SPI=y
85CONFIG_SPI_OMAP_UWIRE=y
86# CONFIG_HWMON is not set
87CONFIG_WATCHDOG=y
88CONFIG_WATCHDOG_NOWAYOUT=y
89CONFIG_OMAP_WATCHDOG=y
90CONFIG_FB=y
91CONFIG_FB_OMAP=y
92CONFIG_FB_OMAP_LCDC_EXTERNAL=y
93CONFIG_FB_OMAP_LCDC_HWA742=y
94CONFIG_FB_OMAP_MANUAL_UPDATE=y
95CONFIG_FB_OMAP_LCD_MIPID=y
96# CONFIG_VGA_CONSOLE is not set
97CONFIG_SOUND=y
98CONFIG_SND=y
99# CONFIG_SND_SUPPORT_OLD_API is not set
100CONFIG_SND_DUMMY=y
101CONFIG_SND_USB_AUDIO=y
102CONFIG_USB=y
103CONFIG_USB_DEVICEFS=y
104CONFIG_USB_SUSPEND=y
105CONFIG_USB_OTG=y
106# CONFIG_USB_OTG_WHITELIST is not set
107CONFIG_USB_OHCI_HCD=y
108CONFIG_USB_STORAGE=y
109CONFIG_USB_SERIAL=y
110CONFIG_USB_SERIAL_CONSOLE=y
111CONFIG_USB_SERIAL_PL2303=y
112CONFIG_USB_GADGET=y
113CONFIG_USB_ETH=m
114CONFIG_USB_FILE_STORAGE=m
115CONFIG_USB_FILE_STORAGE_TEST=y
116CONFIG_MMC=y
117CONFIG_MMC_OMAP=y
118CONFIG_EXT2_FS=y
119CONFIG_EXT3_FS=y
120CONFIG_MSDOS_FS=y
121CONFIG_VFAT_FS=y
122CONFIG_TMPFS=y
123CONFIG_JFFS2_FS=y
124CONFIG_JFFS2_SUMMARY=y
125CONFIG_JFFS2_COMPRESSION_OPTIONS=y
126CONFIG_NFS_FS=y
127CONFIG_NFS_V3=y
128CONFIG_PARTITION_ADVANCED=y
129CONFIG_NLS_CODEPAGE_437=y
130CONFIG_NLS_CODEPAGE_852=y
131CONFIG_NLS_ISO8859_1=y
132CONFIG_NLS_ISO8859_15=y
133CONFIG_NLS_UTF8=y
134CONFIG_MAGIC_SYSRQ=y
135CONFIG_DEBUG_KERNEL=y
136CONFIG_DEBUG_MUTEXES=y
137CONFIG_DEBUG_ERRORS=y
138CONFIG_SECURITY=y
diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig
new file mode 100644
index 000000000000..a350cc6bfe6a
--- /dev/null
+++ b/arch/arm/configs/omap1_defconfig
@@ -0,0 +1,286 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_IKCONFIG=y
7CONFIG_LOG_BUF_SHIFT=14
8CONFIG_BLK_DEV_INITRD=y
9CONFIG_EMBEDDED=y
10# CONFIG_KALLSYMS is not set
11# CONFIG_ELF_CORE is not set
12# CONFIG_BASE_FULL is not set
13# CONFIG_SHMEM is not set
14# CONFIG_VM_EVENT_COUNTERS is not set
15CONFIG_SLOB=y
16CONFIG_PROFILING=y
17CONFIG_OPROFILE=y
18CONFIG_MODULES=y
19CONFIG_MODULE_UNLOAD=y
20CONFIG_MODULE_FORCE_UNLOAD=y
21# CONFIG_LBDAF is not set
22# CONFIG_BLK_DEV_BSG is not set
23# CONFIG_IOSCHED_DEADLINE is not set
24# CONFIG_IOSCHED_CFQ is not set
25CONFIG_ARCH_OMAP=y
26CONFIG_ARCH_OMAP1=y
27CONFIG_OMAP_RESET_CLOCKS=y
28# CONFIG_OMAP_MUX is not set
29CONFIG_OMAP_MBOX_FWK=y
30CONFIG_OMAP_32K_TIMER=y
31CONFIG_OMAP_DM_TIMER=y
32CONFIG_ARCH_OMAP730=y
33CONFIG_ARCH_OMAP850=y
34CONFIG_ARCH_OMAP16XX=y
35CONFIG_MACH_OMAP_INNOVATOR=y
36CONFIG_MACH_OMAP_H2=y
37CONFIG_MACH_OMAP_H3=y
38CONFIG_MACH_OMAP_HTCWIZARD=y
39CONFIG_MACH_HERALD=y
40CONFIG_MACH_OMAP_OSK=y
41CONFIG_MACH_OMAP_PERSEUS2=y
42CONFIG_MACH_OMAP_FSAMPLE=y
43CONFIG_MACH_VOICEBLUE=y
44CONFIG_MACH_OMAP_PALMTE=y
45CONFIG_MACH_OMAP_PALMZ71=y
46CONFIG_MACH_OMAP_PALMTT=y
47CONFIG_MACH_SX1=y
48CONFIG_MACH_NOKIA770=y
49CONFIG_MACH_AMS_DELTA=y
50CONFIG_MACH_OMAP_GENERIC=y
51CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
52CONFIG_OMAP_ARM_216MHZ=y
53CONFIG_OMAP_ARM_195MHZ=y
54CONFIG_OMAP_ARM_192MHZ=y
55CONFIG_OMAP_ARM_182MHZ=y
56CONFIG_OMAP_ARM_168MHZ=y
57# CONFIG_OMAP_ARM_60MHZ is not set
58# CONFIG_ARM_THUMB is not set
59CONFIG_PCCARD=y
60CONFIG_OMAP_CF=y
61CONFIG_NO_HZ=y
62CONFIG_HIGH_RES_TIMERS=y
63CONFIG_PREEMPT=y
64CONFIG_AEABI=y
65CONFIG_LEDS=y
66CONFIG_LEDS_CPU=y
67CONFIG_ZBOOT_ROM_TEXT=0x0
68CONFIG_ZBOOT_ROM_BSS=0x0
69CONFIG_CMDLINE="root=1f03 rootfstype=jffs2"
70CONFIG_FPE_NWFPE=y
71CONFIG_BINFMT_MISC=y
72CONFIG_PM=y
73# CONFIG_SUSPEND is not set
74CONFIG_PM_RUNTIME=y
75CONFIG_NET=y
76CONFIG_PACKET=y
77CONFIG_UNIX=y
78CONFIG_NET_KEY=y
79CONFIG_INET=y
80CONFIG_IP_MULTICAST=y
81CONFIG_IP_PNP=y
82CONFIG_IP_PNP_DHCP=y
83CONFIG_IP_PNP_BOOTP=y
84# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
85# CONFIG_INET_XFRM_MODE_TUNNEL is not set
86# CONFIG_INET_XFRM_MODE_BEET is not set
87# CONFIG_INET_LRO is not set
88# CONFIG_INET_DIAG is not set
89CONFIG_IPV6=y
90CONFIG_NETFILTER=y
91CONFIG_BT=y
92CONFIG_BT_L2CAP=y
93CONFIG_BT_SCO=y
94CONFIG_BT_RFCOMM=y
95CONFIG_BT_RFCOMM_TTY=y
96CONFIG_BT_BNEP=y
97CONFIG_BT_HIDP=y
98CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
99# CONFIG_STANDALONE is not set
100# CONFIG_PREVENT_FIRMWARE_BUILD is not set
101CONFIG_CONNECTOR=y
102# CONFIG_PROC_EVENTS is not set
103CONFIG_MTD=y
104CONFIG_MTD_DEBUG=y
105CONFIG_MTD_DEBUG_VERBOSE=3
106CONFIG_MTD_PARTITIONS=y
107CONFIG_MTD_CMDLINE_PARTS=y
108CONFIG_MTD_CHAR=y
109CONFIG_MTD_BLOCK=y
110CONFIG_MTD_CFI=y
111CONFIG_MTD_CFI_INTELEXT=y
112CONFIG_MTD_NAND=y
113CONFIG_BLK_DEV_LOOP=y
114CONFIG_BLK_DEV_RAM=y
115CONFIG_BLK_DEV_RAM_COUNT=2
116CONFIG_BLK_DEV_RAM_SIZE=8192
117CONFIG_IDE=m
118CONFIG_BLK_DEV_IDECS=m
119CONFIG_SCSI=y
120# CONFIG_SCSI_PROC_FS is not set
121CONFIG_BLK_DEV_SD=y
122CONFIG_CHR_DEV_ST=y
123CONFIG_BLK_DEV_SR=y
124CONFIG_CHR_DEV_SG=y
125CONFIG_SCSI_MULTI_LUN=y
126CONFIG_NETDEVICES=y
127CONFIG_TUN=y
128CONFIG_PHYLIB=y
129CONFIG_NET_ETHERNET=y
130CONFIG_SMC91X=y
131CONFIG_USB_CATC=y
132CONFIG_USB_KAWETH=y
133CONFIG_USB_PEGASUS=y
134CONFIG_USB_RTL8150=y
135CONFIG_USB_USBNET=y
136# CONFIG_USB_NET_AX8817X is not set
137# CONFIG_USB_NET_CDC_SUBSET is not set
138CONFIG_PPP=y
139CONFIG_PPP_MULTILINK=y
140CONFIG_PPP_FILTER=y
141CONFIG_PPP_ASYNC=y
142CONFIG_PPP_DEFLATE=y
143CONFIG_PPP_BSDCOMP=y
144CONFIG_SLIP=y
145CONFIG_SLIP_COMPRESSED=y
146# CONFIG_INPUT_MOUSEDEV is not set
147CONFIG_INPUT_EVDEV=y
148CONFIG_INPUT_EVBUG=y
149# CONFIG_INPUT_KEYBOARD is not set
150# CONFIG_INPUT_MOUSE is not set
151CONFIG_INPUT_TOUCHSCREEN=y
152CONFIG_TOUCHSCREEN_ADS7846=y
153CONFIG_INPUT_MISC=y
154CONFIG_INPUT_UINPUT=y
155# CONFIG_SERIO is not set
156CONFIG_SERIAL_8250=y
157CONFIG_SERIAL_8250_CONSOLE=y
158CONFIG_SERIAL_8250_NR_UARTS=3
159CONFIG_SERIAL_8250_RUNTIME_UARTS=3
160# CONFIG_LEGACY_PTYS is not set
161CONFIG_HW_RANDOM=y
162CONFIG_I2C=y
163CONFIG_I2C_CHARDEV=y
164CONFIG_SPI=y
165CONFIG_SPI_OMAP_UWIRE=y
166# CONFIG_HWMON is not set
167CONFIG_WATCHDOG=y
168CONFIG_WATCHDOG_NOWAYOUT=y
169CONFIG_OMAP_WATCHDOG=y
170CONFIG_VIDEO_OUTPUT_CONTROL=y
171CONFIG_FB=y
172CONFIG_FIRMWARE_EDID=y
173CONFIG_FB_MODE_HELPERS=y
174CONFIG_FB_VIRTUAL=y
175CONFIG_FB_OMAP=y
176CONFIG_FB_OMAP_LCDC_EXTERNAL=y
177CONFIG_FB_OMAP_LCDC_HWA742=y
178CONFIG_FB_OMAP_MANUAL_UPDATE=y
179CONFIG_FB_OMAP_LCD_MIPID=y
180CONFIG_FB_OMAP_BOOTLOADER_INIT=y
181CONFIG_BACKLIGHT_LCD_SUPPORT=y
182CONFIG_LCD_CLASS_DEVICE=y
183CONFIG_FRAMEBUFFER_CONSOLE=y
184CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
185CONFIG_FONTS=y
186CONFIG_FONT_8x8=y
187CONFIG_FONT_8x16=y
188CONFIG_FONT_6x11=y
189CONFIG_FONT_MINI_4x6=y
190CONFIG_LOGO=y
191# CONFIG_LOGO_LINUX_MONO is not set
192# CONFIG_LOGO_LINUX_VGA16 is not set
193CONFIG_SOUND=y
194CONFIG_SND=y
195CONFIG_SND_MIXER_OSS=y
196CONFIG_SND_PCM_OSS=y
197# CONFIG_SND_SUPPORT_OLD_API is not set
198# CONFIG_SND_VERBOSE_PROCFS is not set
199CONFIG_SND_DUMMY=y
200CONFIG_SND_USB_AUDIO=y
201CONFIG_SND_SOC=y
202CONFIG_SND_OMAP_SOC=y
203# CONFIG_USB_HID is not set
204CONFIG_USB=y
205CONFIG_USB_DEBUG=y
206CONFIG_USB_DEVICEFS=y
207# CONFIG_USB_DEVICE_CLASS is not set
208CONFIG_USB_SUSPEND=y
209CONFIG_USB_MON=y
210CONFIG_USB_OHCI_HCD=y
211CONFIG_USB_STORAGE=y
212CONFIG_USB_STORAGE_DATAFAB=y
213CONFIG_USB_STORAGE_FREECOM=y
214CONFIG_USB_STORAGE_SDDR09=y
215CONFIG_USB_STORAGE_SDDR55=y
216CONFIG_USB_STORAGE_JUMPSHOT=y
217CONFIG_USB_SERIAL=y
218CONFIG_USB_SERIAL_CONSOLE=y
219CONFIG_USB_SERIAL_PL2303=y
220CONFIG_USB_TEST=y
221CONFIG_USB_GADGET=y
222CONFIG_USB_ETH=m
223# CONFIG_USB_ETH_RNDIS is not set
224CONFIG_USB_FILE_STORAGE=m
225CONFIG_USB_FILE_STORAGE_TEST=y
226CONFIG_MMC=y
227CONFIG_MMC_SDHCI=y
228CONFIG_MMC_SDHCI_PLTFM=y
229CONFIG_MMC_OMAP=y
230CONFIG_NEW_LEDS=y
231CONFIG_LEDS_CLASS=y
232CONFIG_LEDS_TRIGGERS=y
233CONFIG_LEDS_TRIGGER_TIMER=y
234CONFIG_LEDS_TRIGGER_HEARTBEAT=y
235CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
236CONFIG_RTC_CLASS=y
237CONFIG_RTC_DRV_OMAP=y
238CONFIG_EXT2_FS=y
239CONFIG_EXT3_FS=y
240# CONFIG_DNOTIFY is not set
241CONFIG_AUTOFS4_FS=y
242CONFIG_ISO9660_FS=y
243CONFIG_JOLIET=y
244CONFIG_MSDOS_FS=y
245CONFIG_VFAT_FS=y
246CONFIG_FAT_DEFAULT_CODEPAGE=866
247CONFIG_FAT_DEFAULT_IOCHARSET="koi8-r"
248CONFIG_JFFS2_FS=y
249CONFIG_JFFS2_SUMMARY=y
250CONFIG_JFFS2_COMPRESSION_OPTIONS=y
251CONFIG_CRAMFS=y
252CONFIG_ROMFS_FS=y
253CONFIG_NFS_FS=y
254CONFIG_NFS_V3=y
255CONFIG_NFS_V4=y
256CONFIG_ROOT_NFS=y
257CONFIG_PARTITION_ADVANCED=y
258CONFIG_NLS_CODEPAGE_437=y
259CONFIG_NLS_CODEPAGE_850=y
260CONFIG_NLS_CODEPAGE_852=y
261CONFIG_NLS_CODEPAGE_866=y
262CONFIG_NLS_CODEPAGE_1251=y
263CONFIG_NLS_ISO8859_1=y
264CONFIG_NLS_ISO8859_2=y
265CONFIG_NLS_ISO8859_5=y
266CONFIG_NLS_ISO8859_15=y
267CONFIG_NLS_KOI8_R=y
268CONFIG_NLS_UTF8=y
269# CONFIG_ENABLE_MUST_CHECK is not set
270CONFIG_MAGIC_SYSRQ=y
271CONFIG_DEBUG_KERNEL=y
272CONFIG_DEBUG_SPINLOCK=y
273CONFIG_DEBUG_MUTEXES=y
274# CONFIG_DEBUG_BUGVERBOSE is not set
275CONFIG_DEBUG_INFO=y
276# CONFIG_RCU_CPU_STALL_DETECTOR is not set
277CONFIG_DEBUG_USER=y
278CONFIG_DEBUG_ERRORS=y
279CONFIG_SECURITY=y
280CONFIG_CRYPTO_ECB=y
281CONFIG_CRYPTO_PCBC=y
282CONFIG_CRYPTO_DEFLATE=y
283CONFIG_CRYPTO_ZLIB=y
284CONFIG_CRYPTO_LZO=y
285# CONFIG_CRYPTO_ANSI_CPRNG is not set
286CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/omap_generic_1510_defconfig b/arch/arm/configs/omap_generic_1510_defconfig
deleted file mode 100644
index 0e42ba4ede9d..000000000000
--- a/arch/arm/configs/omap_generic_1510_defconfig
+++ /dev/null
@@ -1,84 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8CONFIG_MODULE_FORCE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set
10CONFIG_ARCH_OMAP=y
11CONFIG_ARCH_OMAP1=y
12CONFIG_MACH_OMAP_GENERIC=y
13CONFIG_OMAP_ARM_168MHZ=y
14# CONFIG_OMAP_ARM_60MHZ is not set
15# CONFIG_ARM_THUMB is not set
16CONFIG_PREEMPT=y
17CONFIG_ZBOOT_ROM_TEXT=0x0
18CONFIG_ZBOOT_ROM_BSS=0x0
19CONFIG_CMDLINE="mem=64M console=ttyS2,115200 root=0803 ro init=/bin/sh"
20CONFIG_FPE_NWFPE=y
21CONFIG_PM=y
22CONFIG_NET=y
23CONFIG_PACKET=y
24CONFIG_UNIX=y
25CONFIG_INET=y
26CONFIG_IP_MULTICAST=y
27CONFIG_IP_PNP=y
28CONFIG_IP_PNP_DHCP=y
29CONFIG_IP_PNP_BOOTP=y
30# CONFIG_IPV6 is not set
31CONFIG_BLK_DEV_LOOP=y
32CONFIG_BLK_DEV_RAM=y
33CONFIG_BLK_DEV_RAM_SIZE=8192
34CONFIG_SCSI=y
35CONFIG_BLK_DEV_SD=y
36CONFIG_BLK_DEV_SR=y
37CONFIG_CHR_DEV_SG=y
38CONFIG_SCSI_MULTI_LUN=y
39CONFIG_NETDEVICES=y
40CONFIG_NET_ETHERNET=y
41CONFIG_USB_RTL8150=y
42CONFIG_USB_USBNET=y
43CONFIG_USB_AN2720=y
44CONFIG_USB_EPSON2888=y
45CONFIG_PPP=y
46CONFIG_PPP_MULTILINK=y
47CONFIG_KEYBOARD_OMAP=y
48# CONFIG_INPUT_MOUSE is not set
49CONFIG_SERIAL_8250=y
50CONFIG_SERIAL_8250_CONSOLE=y
51# CONFIG_LEGACY_PTYS is not set
52CONFIG_I2C=y
53CONFIG_I2C_CHARDEV=y
54CONFIG_VIDEO_OUTPUT_CONTROL=m
55# CONFIG_VGA_CONSOLE is not set
56CONFIG_USB=y
57CONFIG_USB_DEBUG=y
58CONFIG_USB_DEVICEFS=y
59# CONFIG_USB_DEVICE_CLASS is not set
60CONFIG_USB_MON=y
61CONFIG_USB_OHCI_HCD=y
62CONFIG_USB_STORAGE=y
63CONFIG_USB_STORAGE_DATAFAB=y
64CONFIG_USB_STORAGE_FREECOM=y
65CONFIG_USB_STORAGE_SDDR09=y
66CONFIG_USB_STORAGE_SDDR55=y
67CONFIG_USB_STORAGE_JUMPSHOT=y
68CONFIG_MMC=y
69CONFIG_MMC_OMAP=y
70CONFIG_RTC_CLASS=y
71CONFIG_RTC_DRV_OMAP=y
72CONFIG_EXT2_FS=y
73CONFIG_EXT3_FS=y
74CONFIG_INOTIFY=y
75CONFIG_AUTOFS_FS=y
76CONFIG_AUTOFS4_FS=y
77CONFIG_ISO9660_FS=y
78CONFIG_JOLIET=y
79CONFIG_MSDOS_FS=m
80CONFIG_VFAT_FS=m
81CONFIG_NFS_FS=y
82CONFIG_PARTITION_ADVANCED=y
83CONFIG_MAGIC_SYSRQ=y
84CONFIG_DEBUG_KERNEL=y
diff --git a/arch/arm/configs/omap_generic_1610_defconfig b/arch/arm/configs/omap_generic_1610_defconfig
deleted file mode 100644
index 5e536cf0f9f7..000000000000
--- a/arch/arm/configs/omap_generic_1610_defconfig
+++ /dev/null
@@ -1,87 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8CONFIG_MODULE_FORCE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set
10CONFIG_ARCH_OMAP=y
11CONFIG_ARCH_OMAP1=y
12# CONFIG_ARCH_OMAP15XX is not set
13CONFIG_ARCH_OMAP16XX=y
14CONFIG_MACH_OMAP_GENERIC=y
15CONFIG_OMAP_ARM_192MHZ=y
16# CONFIG_OMAP_ARM_60MHZ is not set
17# CONFIG_ARM_THUMB is not set
18CONFIG_PREEMPT=y
19CONFIG_ZBOOT_ROM_TEXT=0x0
20CONFIG_ZBOOT_ROM_BSS=0x0
21CONFIG_CMDLINE="mem=64M console=ttyS2,115200 root=0803 ro init=/bin/sh"
22CONFIG_FPE_NWFPE=y
23CONFIG_PM=y
24CONFIG_NET=y
25CONFIG_PACKET=y
26CONFIG_UNIX=y
27CONFIG_INET=y
28CONFIG_IP_MULTICAST=y
29CONFIG_IP_PNP=y
30CONFIG_IP_PNP_DHCP=y
31CONFIG_IP_PNP_BOOTP=y
32# CONFIG_IPV6 is not set
33CONFIG_BLK_DEV_LOOP=y
34CONFIG_BLK_DEV_RAM=y
35CONFIG_BLK_DEV_RAM_SIZE=8192
36CONFIG_SCSI=y
37CONFIG_BLK_DEV_SD=y
38CONFIG_BLK_DEV_SR=y
39CONFIG_CHR_DEV_SG=y
40CONFIG_SCSI_MULTI_LUN=y
41CONFIG_NETDEVICES=y
42CONFIG_NET_ETHERNET=y
43CONFIG_USB_RTL8150=y
44CONFIG_USB_USBNET=y
45CONFIG_USB_ALI_M5632=y
46CONFIG_USB_AN2720=y
47CONFIG_USB_EPSON2888=y
48CONFIG_PPP=y
49CONFIG_PPP_MULTILINK=y
50CONFIG_KEYBOARD_OMAP=y
51# CONFIG_INPUT_MOUSE is not set
52CONFIG_SERIAL_8250=y
53CONFIG_SERIAL_8250_CONSOLE=y
54# CONFIG_LEGACY_PTYS is not set
55CONFIG_I2C=y
56CONFIG_I2C_CHARDEV=y
57CONFIG_VIDEO_OUTPUT_CONTROL=m
58# CONFIG_VGA_CONSOLE is not set
59CONFIG_USB=y
60CONFIG_USB_DEBUG=y
61CONFIG_USB_DEVICEFS=y
62# CONFIG_USB_DEVICE_CLASS is not set
63CONFIG_USB_MON=y
64CONFIG_USB_OHCI_HCD=y
65CONFIG_USB_STORAGE=y
66CONFIG_USB_STORAGE_DATAFAB=y
67CONFIG_USB_STORAGE_FREECOM=y
68CONFIG_USB_STORAGE_SDDR09=y
69CONFIG_USB_STORAGE_SDDR55=y
70CONFIG_USB_STORAGE_JUMPSHOT=y
71CONFIG_MMC=y
72CONFIG_MMC_OMAP=y
73CONFIG_RTC_CLASS=y
74CONFIG_RTC_DRV_OMAP=y
75CONFIG_EXT2_FS=y
76CONFIG_EXT3_FS=y
77CONFIG_INOTIFY=y
78CONFIG_AUTOFS_FS=y
79CONFIG_AUTOFS4_FS=y
80CONFIG_ISO9660_FS=y
81CONFIG_JOLIET=y
82CONFIG_MSDOS_FS=m
83CONFIG_VFAT_FS=m
84CONFIG_NFS_FS=y
85CONFIG_PARTITION_ADVANCED=y
86CONFIG_MAGIC_SYSRQ=y
87CONFIG_DEBUG_KERNEL=y
diff --git a/arch/arm/configs/omap_generic_1710_defconfig b/arch/arm/configs/omap_generic_1710_defconfig
deleted file mode 100644
index c0867b1d9815..000000000000
--- a/arch/arm/configs/omap_generic_1710_defconfig
+++ /dev/null
@@ -1,75 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5# CONFIG_BLK_DEV_BSG is not set
6CONFIG_ARCH_OMAP=y
7CONFIG_ARCH_OMAP1=y
8# CONFIG_OMAP_MUX is not set
9# CONFIG_ARCH_OMAP15XX is not set
10CONFIG_ARCH_OMAP16XX=y
11CONFIG_MACH_OMAP_GENERIC=y
12CONFIG_OMAP_ARM_192MHZ=y
13# CONFIG_OMAP_ARM_60MHZ is not set
14# CONFIG_ARM_THUMB is not set
15CONFIG_ZBOOT_ROM_TEXT=0x0
16CONFIG_ZBOOT_ROM_BSS=0x0
17CONFIG_CMDLINE="mem=64M console=tty0 console=ttyS2,115200 root=0801"
18CONFIG_FPE_NWFPE=y
19CONFIG_ARTHUR=y
20CONFIG_PM=y
21CONFIG_NET=y
22CONFIG_PACKET=y
23CONFIG_UNIX=y
24CONFIG_INET=y
25CONFIG_IP_MULTICAST=y
26CONFIG_IP_PNP=y
27CONFIG_IP_PNP_DHCP=y
28CONFIG_IP_PNP_BOOTP=y
29# CONFIG_IPV6 is not set
30CONFIG_BLK_DEV_LOOP=y
31CONFIG_BLK_DEV_RAM=y
32CONFIG_BLK_DEV_RAM_SIZE=8192
33CONFIG_SCSI=y
34CONFIG_BLK_DEV_SD=y
35CONFIG_NETDEVICES=y
36CONFIG_NET_ETHERNET=y
37CONFIG_USB_USBNET=y
38CONFIG_USB_ALI_M5632=y
39# CONFIG_USB_BELKIN is not set
40# CONFIG_USB_ARMLINUX is not set
41CONFIG_PPP=y
42CONFIG_INPUT_EVDEV=y
43CONFIG_KEYBOARD_OMAP=y
44# CONFIG_INPUT_MOUSE is not set
45CONFIG_SERIAL_8250=y
46CONFIG_SERIAL_8250_CONSOLE=y
47CONFIG_VIDEO_OUTPUT_CONTROL=y
48# CONFIG_VGA_CONSOLE is not set
49CONFIG_USB=y
50CONFIG_USB_DEBUG=y
51CONFIG_USB_DEVICEFS=y
52CONFIG_USB_MON=y
53CONFIG_USB_OHCI_HCD=y
54CONFIG_USB_STORAGE=y
55CONFIG_MMC=y
56CONFIG_MMC_OMAP=y
57CONFIG_EXT2_FS=y
58CONFIG_EXT3_FS=y
59CONFIG_INOTIFY=y
60CONFIG_TMPFS=y
61CONFIG_NFS_FS=y
62CONFIG_NFS_V3=y
63CONFIG_NFS_V4=y
64CONFIG_PARTITION_ADVANCED=y
65CONFIG_NLS_CODEPAGE_437=y
66CONFIG_NLS_CODEPAGE_852=y
67CONFIG_NLS_ISO8859_1=y
68CONFIG_NLS_ISO8859_15=y
69CONFIG_MAGIC_SYSRQ=y
70CONFIG_DEBUG_KERNEL=y
71CONFIG_DEBUG_SPINLOCK=y
72CONFIG_DEBUG_ERRORS=y
73CONFIG_SECURITY=y
74CONFIG_CRYPTO_ECB=y
75CONFIG_CRYPTO_PCBC=y
diff --git a/arch/arm/configs/omap_h2_1610_defconfig b/arch/arm/configs/omap_h2_1610_defconfig
deleted file mode 100644
index e2de2aa17e62..000000000000
--- a/arch/arm/configs/omap_h2_1610_defconfig
+++ /dev/null
@@ -1,109 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8# CONFIG_BLK_DEV_BSG is not set
9CONFIG_ARCH_OMAP=y
10CONFIG_ARCH_OMAP1=y
11CONFIG_OMAP_MUX_DEBUG=y
12CONFIG_OMAP_32K_TIMER=y
13CONFIG_OMAP_DM_TIMER=y
14# CONFIG_ARCH_OMAP15XX is not set
15CONFIG_ARCH_OMAP16XX=y
16CONFIG_MACH_OMAP_H2=y
17CONFIG_NO_HZ=y
18CONFIG_HIGH_RES_TIMERS=y
19CONFIG_LEDS=y
20CONFIG_ZBOOT_ROM_TEXT=0x0
21CONFIG_ZBOOT_ROM_BSS=0x0
22CONFIG_CMDLINE="mem=32M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x10600000,8M ramdisk_size=8192"
23CONFIG_FPE_NWFPE=y
24CONFIG_PM=y
25CONFIG_PM_RUNTIME=y
26CONFIG_NET=y
27CONFIG_PACKET=y
28CONFIG_UNIX=y
29CONFIG_INET=y
30CONFIG_IP_PNP=y
31CONFIG_IP_PNP_DHCP=y
32CONFIG_IP_PNP_BOOTP=y
33# CONFIG_INET_LRO is not set
34# CONFIG_IPV6 is not set
35CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
36CONFIG_DEBUG_DRIVER=y
37CONFIG_MTD=y
38CONFIG_MTD_DEBUG=y
39CONFIG_MTD_DEBUG_VERBOSE=3
40CONFIG_MTD_PARTITIONS=y
41CONFIG_MTD_CMDLINE_PARTS=y
42CONFIG_MTD_CHAR=y
43CONFIG_MTD_BLOCK=y
44CONFIG_MTD_CFI=y
45CONFIG_MTD_CFI_INTELEXT=y
46CONFIG_BLK_DEV_LOOP=y
47CONFIG_BLK_DEV_RAM=y
48CONFIG_BLK_DEV_RAM_SIZE=8192
49CONFIG_NETDEVICES=y
50CONFIG_NET_ETHERNET=y
51CONFIG_SMC91X=y
52CONFIG_PPP=y
53CONFIG_SLIP=y
54CONFIG_SLIP_COMPRESSED=y
55CONFIG_INPUT_EVDEV=y
56CONFIG_INPUT_EVBUG=y
57# CONFIG_INPUT_KEYBOARD is not set
58# CONFIG_INPUT_MOUSE is not set
59CONFIG_INPUT_MISC=y
60CONFIG_INPUT_UINPUT=y
61CONFIG_SERIAL_8250=y
62CONFIG_SERIAL_8250_CONSOLE=y
63# CONFIG_LEGACY_PTYS is not set
64CONFIG_I2C=y
65CONFIG_I2C_OMAP=y
66CONFIG_SPI=y
67CONFIG_SPI_OMAP_UWIRE=y
68CONFIG_WATCHDOG=y
69CONFIG_WATCHDOG_NOWAYOUT=y
70CONFIG_VIDEO_OUTPUT_CONTROL=m
71CONFIG_FB=y
72CONFIG_FIRMWARE_EDID=y
73CONFIG_FB_MODE_HELPERS=y
74CONFIG_FB_OMAP=y
75# CONFIG_VGA_CONSOLE is not set
76CONFIG_FRAMEBUFFER_CONSOLE=y
77CONFIG_LOGO=y
78# CONFIG_LOGO_LINUX_MONO is not set
79# CONFIG_LOGO_LINUX_VGA16 is not set
80# CONFIG_USB_HID is not set
81CONFIG_USB=y
82CONFIG_USB_DEVICEFS=y
83# CONFIG_USB_DEVICE_CLASS is not set
84CONFIG_USB_SUSPEND=y
85CONFIG_USB_OTG=y
86CONFIG_USB_MON=y
87CONFIG_USB_OHCI_HCD=y
88CONFIG_USB_TEST=y
89CONFIG_USB_GADGET=y
90CONFIG_USB_ETH=m
91CONFIG_MMC=y
92CONFIG_MMC_OMAP=y
93CONFIG_RTC_CLASS=y
94CONFIG_RTC_DRV_OMAP=y
95CONFIG_EXT2_FS=y
96CONFIG_INOTIFY=y
97CONFIG_MSDOS_FS=y
98CONFIG_VFAT_FS=y
99CONFIG_JFFS2_FS=y
100CONFIG_CRAMFS=y
101CONFIG_ROMFS_FS=y
102CONFIG_NFS_FS=y
103CONFIG_ROOT_NFS=y
104CONFIG_NLS_CODEPAGE_437=y
105CONFIG_NLS_ISO8859_1=y
106CONFIG_DEBUG_KERNEL=y
107CONFIG_DEBUG_INFO=y
108CONFIG_DEBUG_USER=y
109CONFIG_DEBUG_ERRORS=y
diff --git a/arch/arm/configs/omap_innovator_1510_defconfig b/arch/arm/configs/omap_innovator_1510_defconfig
deleted file mode 100644
index 265af2669ede..000000000000
--- a/arch/arm/configs/omap_innovator_1510_defconfig
+++ /dev/null
@@ -1,102 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8# CONFIG_BLK_DEV_BSG is not set
9CONFIG_ARCH_OMAP=y
10CONFIG_ARCH_OMAP1=y
11CONFIG_MACH_OMAP_INNOVATOR=y
12CONFIG_OMAP_ARM_168MHZ=y
13# CONFIG_OMAP_ARM_60MHZ is not set
14CONFIG_PREEMPT=y
15CONFIG_LEDS=y
16CONFIG_ZBOOT_ROM_TEXT=0x0
17CONFIG_ZBOOT_ROM_BSS=0x0
18CONFIG_CMDLINE="console=ttyS0,115200n8 root=/dev/nfs ip=bootp noinitrd"
19CONFIG_FPE_NWFPE=y
20CONFIG_PM=y
21CONFIG_NET=y
22CONFIG_PACKET=y
23CONFIG_UNIX=y
24CONFIG_INET=y
25CONFIG_IP_MULTICAST=y
26CONFIG_IP_PNP=y
27CONFIG_IP_PNP_DHCP=y
28CONFIG_IP_PNP_BOOTP=y
29# CONFIG_IPV6 is not set
30CONFIG_BLK_DEV_LOOP=y
31CONFIG_BLK_DEV_RAM=y
32CONFIG_BLK_DEV_RAM_SIZE=8192
33CONFIG_SCSI=y
34CONFIG_BLK_DEV_SD=y
35CONFIG_CHR_DEV_ST=y
36CONFIG_BLK_DEV_SR=y
37CONFIG_CHR_DEV_SG=y
38CONFIG_SCSI_MULTI_LUN=y
39CONFIG_NETDEVICES=y
40CONFIG_NET_ETHERNET=y
41CONFIG_SMC91X=y
42CONFIG_USB_RTL8150=y
43CONFIG_USB_USBNET=y
44# CONFIG_USB_NET_CDC_SUBSET is not set
45CONFIG_PPP=y
46CONFIG_PPP_MULTILINK=y
47CONFIG_PPP_ASYNC=y
48CONFIG_PPP_DEFLATE=y
49CONFIG_PPP_BSDCOMP=y
50CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
51CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
52# CONFIG_KEYBOARD_ATKBD is not set
53CONFIG_KEYBOARD_OMAP=y
54# CONFIG_INPUT_MOUSE is not set
55CONFIG_SERIAL_8250=y
56CONFIG_SERIAL_8250_CONSOLE=y
57# CONFIG_LEGACY_PTYS is not set
58CONFIG_I2C=y
59CONFIG_VIDEO_OUTPUT_CONTROL=m
60CONFIG_FB=y
61CONFIG_FB_OMAP=y
62# CONFIG_VGA_CONSOLE is not set
63CONFIG_FRAMEBUFFER_CONSOLE=y
64CONFIG_FONTS=y
65CONFIG_FONT_8x8=y
66CONFIG_FONT_8x16=y
67CONFIG_LOGO=y
68CONFIG_USB=y
69CONFIG_USB_DEBUG=y
70CONFIG_USB_DEVICEFS=y
71# CONFIG_USB_DEVICE_CLASS is not set
72CONFIG_USB_MON=y
73CONFIG_USB_OHCI_HCD=y
74CONFIG_USB_STORAGE=y
75CONFIG_USB_STORAGE_DATAFAB=y
76CONFIG_USB_STORAGE_FREECOM=y
77CONFIG_USB_STORAGE_SDDR09=y
78CONFIG_USB_STORAGE_SDDR55=y
79CONFIG_USB_STORAGE_JUMPSHOT=y
80CONFIG_MMC=y
81CONFIG_MMC_OMAP=y
82CONFIG_RTC_CLASS=y
83CONFIG_RTC_DRV_OMAP=y
84CONFIG_EXT2_FS=y
85CONFIG_EXT3_FS=y
86CONFIG_INOTIFY=y
87CONFIG_AUTOFS_FS=y
88CONFIG_AUTOFS4_FS=y
89CONFIG_ISO9660_FS=y
90CONFIG_JOLIET=y
91CONFIG_MSDOS_FS=m
92CONFIG_VFAT_FS=m
93CONFIG_TMPFS=y
94CONFIG_NFS_FS=y
95CONFIG_NFS_V3=y
96CONFIG_NFS_V4=y
97CONFIG_ROOT_NFS=y
98CONFIG_PARTITION_ADVANCED=y
99CONFIG_MAGIC_SYSRQ=y
100CONFIG_DEBUG_KERNEL=y
101CONFIG_CRYPTO_ECB=m
102CONFIG_CRYPTO_PCBC=m
diff --git a/arch/arm/configs/omap_innovator_1610_defconfig b/arch/arm/configs/omap_innovator_1610_defconfig
deleted file mode 100644
index cc7fbf84ddd9..000000000000
--- a/arch/arm/configs/omap_innovator_1610_defconfig
+++ /dev/null
@@ -1,58 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_MODULES=y
6CONFIG_MODULE_UNLOAD=y
7# CONFIG_BLK_DEV_BSG is not set
8CONFIG_ARCH_OMAP=y
9CONFIG_ARCH_OMAP1=y
10# CONFIG_ARCH_OMAP15XX is not set
11CONFIG_ARCH_OMAP16XX=y
12CONFIG_MACH_OMAP_INNOVATOR=y
13CONFIG_OMAP_ARM_192MHZ=y
14# CONFIG_OMAP_ARM_60MHZ is not set
15# CONFIG_ARM_THUMB is not set
16CONFIG_CPU_DCACHE_WRITETHROUGH=y
17CONFIG_ZBOOT_ROM_TEXT=0x0
18CONFIG_ZBOOT_ROM_BSS=0x0
19CONFIG_CMDLINE="mem=32M console=tty0 console=ttyS0,115200 initrd=0x10200000,8M root=/dev/ram0 rw"
20CONFIG_FPE_NWFPE=y
21CONFIG_NET=y
22CONFIG_PACKET=m
23CONFIG_UNIX=y
24CONFIG_INET=y
25CONFIG_IP_MULTICAST=y
26CONFIG_IP_PNP=y
27CONFIG_IP_PNP_DHCP=y
28CONFIG_IP_PNP_BOOTP=y
29# CONFIG_IPV6 is not set
30CONFIG_BLK_DEV_LOOP=y
31CONFIG_BLK_DEV_RAM=y
32CONFIG_BLK_DEV_RAM_SIZE=8192
33CONFIG_NETDEVICES=y
34CONFIG_NET_ETHERNET=y
35CONFIG_SMC91X=y
36CONFIG_PPP=y
37CONFIG_PPP_MULTILINK=y
38# CONFIG_KEYBOARD_ATKBD is not set
39CONFIG_KEYBOARD_OMAP=y
40# CONFIG_INPUT_MOUSE is not set
41CONFIG_SERIAL_8250=y
42CONFIG_SERIAL_8250_CONSOLE=y
43CONFIG_VIDEO_OUTPUT_CONTROL=m
44CONFIG_FB=y
45CONFIG_FB_MODE_HELPERS=y
46CONFIG_FB_OMAP=y
47# CONFIG_VGA_CONSOLE is not set
48CONFIG_FRAMEBUFFER_CONSOLE=y
49CONFIG_FONTS=y
50CONFIG_FONT_8x8=y
51CONFIG_FONT_8x16=y
52CONFIG_LOGO=y
53CONFIG_EXT2_FS=y
54CONFIG_INOTIFY=y
55CONFIG_AUTOFS_FS=y
56CONFIG_AUTOFS4_FS=y
57CONFIG_NFS_FS=y
58CONFIG_NFS_V3=y
diff --git a/arch/arm/configs/omap_osk_5912_defconfig b/arch/arm/configs/omap_osk_5912_defconfig
deleted file mode 100644
index 9105de7661f9..000000000000
--- a/arch/arm/configs/omap_osk_5912_defconfig
+++ /dev/null
@@ -1,87 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_MODULES=y
6CONFIG_MODULE_UNLOAD=y
7# CONFIG_BLK_DEV_BSG is not set
8CONFIG_ARCH_OMAP=y
9CONFIG_ARCH_OMAP1=y
10CONFIG_OMAP_RESET_CLOCKS=y
11CONFIG_OMAP_32K_TIMER=y
12# CONFIG_ARCH_OMAP15XX is not set
13CONFIG_ARCH_OMAP16XX=y
14CONFIG_MACH_OMAP_OSK=y
15CONFIG_OMAP_ARM_192MHZ=y
16# CONFIG_OMAP_ARM_60MHZ is not set
17# CONFIG_ARM_THUMB is not set
18CONFIG_PCCARD=y
19CONFIG_OMAP_CF=y
20CONFIG_NO_HZ=y
21CONFIG_ZBOOT_ROM_TEXT=0x0
22CONFIG_ZBOOT_ROM_BSS=0x0
23CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x10400000,8M root=/dev/ram0 rw"
24CONFIG_FPE_NWFPE=y
25CONFIG_PM=y
26CONFIG_NET=y
27CONFIG_PACKET=m
28CONFIG_UNIX=y
29CONFIG_INET=y
30CONFIG_IP_MULTICAST=y
31CONFIG_IP_PNP=y
32CONFIG_IP_PNP_DHCP=y
33CONFIG_IP_PNP_BOOTP=y
34# CONFIG_INET_LRO is not set
35# CONFIG_IPV6 is not set
36CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
37CONFIG_MTD=y
38CONFIG_MTD_PARTITIONS=y
39CONFIG_MTD_CMDLINE_PARTS=y
40CONFIG_MTD_CHAR=y
41CONFIG_MTD_BLOCK=y
42CONFIG_MTD_CFI=y
43CONFIG_MTD_CFI_INTELEXT=y
44CONFIG_BLK_DEV_LOOP=y
45CONFIG_BLK_DEV_RAM=y
46CONFIG_BLK_DEV_RAM_SIZE=8192
47CONFIG_IDE=m
48CONFIG_BLK_DEV_IDECS=m
49CONFIG_NETDEVICES=y
50CONFIG_NET_ETHERNET=y
51CONFIG_SMC91X=y
52CONFIG_PPP=y
53CONFIG_PPP_MULTILINK=y
54# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
55CONFIG_INPUT_EVDEV=y
56# CONFIG_KEYBOARD_ATKBD is not set
57CONFIG_KEYBOARD_OMAP=y
58# CONFIG_INPUT_MOUSE is not set
59CONFIG_INPUT_TOUCHSCREEN=y
60# CONFIG_SERIO is not set
61CONFIG_SERIAL_8250=y
62CONFIG_SERIAL_8250_CONSOLE=y
63CONFIG_I2C=y
64CONFIG_I2C_CHARDEV=y
65CONFIG_VIDEO_OUTPUT_CONTROL=m
66CONFIG_FB=y
67CONFIG_FB_MODE_HELPERS=y
68CONFIG_FB_OMAP=y
69# CONFIG_VGA_CONSOLE is not set
70CONFIG_FRAMEBUFFER_CONSOLE=y
71CONFIG_FONTS=y
72CONFIG_FONT_8x8=y
73CONFIG_LOGO=y
74# CONFIG_LOGO_LINUX_MONO is not set
75# CONFIG_LOGO_LINUX_VGA16 is not set
76CONFIG_EXT2_FS=y
77CONFIG_INOTIFY=y
78CONFIG_AUTOFS_FS=y
79CONFIG_AUTOFS4_FS=y
80CONFIG_MSDOS_FS=m
81CONFIG_VFAT_FS=m
82CONFIG_JFFS2_FS=y
83CONFIG_NFS_FS=y
84CONFIG_NFS_V3=y
85CONFIG_ROOT_NFS=y
86CONFIG_NLS_CODEPAGE_437=m
87CONFIG_NLS_ISO8859_1=m
diff --git a/arch/arm/configs/omap_perseus2_730_defconfig b/arch/arm/configs/omap_perseus2_730_defconfig
deleted file mode 100644
index aa777e624e23..000000000000
--- a/arch/arm/configs/omap_perseus2_730_defconfig
+++ /dev/null
@@ -1,65 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_SLAB=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8# CONFIG_BLK_DEV_BSG is not set
9CONFIG_ARCH_OMAP=y
10CONFIG_ARCH_OMAP1=y
11CONFIG_ARCH_OMAP730=y
12# CONFIG_ARCH_OMAP15XX is not set
13CONFIG_MACH_OMAP_PERSEUS2=y
14CONFIG_OMAP_ARM_182MHZ=y
15# CONFIG_OMAP_ARM_60MHZ is not set
16# CONFIG_ARM_THUMB is not set
17CONFIG_PREEMPT=y
18CONFIG_LEDS=y
19CONFIG_LEDS_CPU=y
20CONFIG_ZBOOT_ROM_TEXT=0x0
21CONFIG_ZBOOT_ROM_BSS=0x0
22CONFIG_CMDLINE="mem=32M console=ttyS0,115200 ip=dhcp"
23CONFIG_FPE_NWFPE=y
24CONFIG_PM=y
25CONFIG_NET=y
26CONFIG_PACKET=y
27CONFIG_UNIX=y
28CONFIG_INET=y
29CONFIG_IP_MULTICAST=y
30CONFIG_IP_PNP=y
31CONFIG_IP_PNP_DHCP=y
32CONFIG_IP_PNP_BOOTP=y
33# CONFIG_IPV6 is not set
34CONFIG_MTD=y
35CONFIG_MTD_PARTITIONS=y
36CONFIG_MTD_CMDLINE_PARTS=y
37CONFIG_MTD_CHAR=y
38CONFIG_MTD_BLOCK=y
39CONFIG_MTD_CFI=y
40CONFIG_MTD_CFI_INTELEXT=y
41CONFIG_MTD_NAND=y
42CONFIG_BLK_DEV_LOOP=y
43CONFIG_BLK_DEV_RAM=y
44CONFIG_BLK_DEV_RAM_SIZE=8192
45CONFIG_NETDEVICES=y
46CONFIG_NET_ETHERNET=y
47CONFIG_SMC91X=y
48# CONFIG_KEYBOARD_ATKBD is not set
49CONFIG_KEYBOARD_OMAP=y
50# CONFIG_INPUT_MOUSE is not set
51CONFIG_SERIAL_8250=y
52CONFIG_SERIAL_8250_CONSOLE=y
53# CONFIG_LEGACY_PTYS is not set
54CONFIG_VIDEO_OUTPUT_CONTROL=m
55CONFIG_FB=y
56CONFIG_FB_MODE_HELPERS=y
57CONFIG_FB_VIRTUAL=y
58# CONFIG_VGA_CONSOLE is not set
59CONFIG_RTC_CLASS=y
60CONFIG_RTC_DRV_OMAP=y
61CONFIG_EXT2_FS=y
62CONFIG_INOTIFY=y
63CONFIG_JFFS2_FS=y
64CONFIG_NFS_FS=y
65CONFIG_ROOT_NFS=y
diff --git a/arch/arm/configs/palmte_defconfig b/arch/arm/configs/palmte_defconfig
deleted file mode 100644
index 828d7cb9e667..000000000000
--- a/arch/arm/configs/palmte_defconfig
+++ /dev/null
@@ -1,48 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_SLAB=y
7# CONFIG_IOSCHED_DEADLINE is not set
8# CONFIG_IOSCHED_CFQ is not set
9CONFIG_ARCH_OMAP=y
10CONFIG_ARCH_OMAP1=y
11CONFIG_MACH_OMAP_PALMTE=y
12CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
13# CONFIG_OMAP_ARM_60MHZ is not set
14# CONFIG_ARM_THUMB is not set
15# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
16CONFIG_ZBOOT_ROM_TEXT=0x0
17CONFIG_ZBOOT_ROM_BSS=0x0
18CONFIG_FPE_NWFPE=y
19# CONFIG_STANDALONE is not set
20# CONFIG_PREVENT_FIRMWARE_BUILD is not set
21# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
22CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
23CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
24# CONFIG_INPUT_KEYBOARD is not set
25# CONFIG_INPUT_MOUSE is not set
26# CONFIG_SERIO is not set
27# CONFIG_LEGACY_PTYS is not set
28# CONFIG_HWMON is not set
29CONFIG_FB=y
30CONFIG_FB_OMAP=y
31# CONFIG_VGA_CONSOLE is not set
32CONFIG_FRAMEBUFFER_CONSOLE=y
33CONFIG_LOGO=y
34# CONFIG_LOGO_LINUX_MONO is not set
35# CONFIG_LOGO_LINUX_VGA16 is not set
36CONFIG_USB_GADGET=y
37CONFIG_MMC=y
38CONFIG_MMC_OMAP=y
39CONFIG_EXT2_FS=y
40CONFIG_MSDOS_FS=y
41CONFIG_VFAT_FS=y
42CONFIG_FAT_DEFAULT_CODEPAGE=850
43CONFIG_TMPFS=y
44CONFIG_CRAMFS=y
45CONFIG_PARTITION_ADVANCED=y
46CONFIG_NLS_CODEPAGE_850=y
47CONFIG_NLS_ISO8859_1=y
48CONFIG_CRC_CCITT=y
diff --git a/arch/arm/configs/palmtt_defconfig b/arch/arm/configs/palmtt_defconfig
deleted file mode 100644
index 31d02c48a3d9..000000000000
--- a/arch/arm/configs/palmtt_defconfig
+++ /dev/null
@@ -1,56 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_SLAB=y
6# CONFIG_IOSCHED_DEADLINE is not set
7# CONFIG_IOSCHED_CFQ is not set
8CONFIG_ARCH_OMAP=y
9CONFIG_ARCH_OMAP1=y
10CONFIG_MACH_OMAP_PALMTT=y
11CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
12# CONFIG_OMAP_ARM_60MHZ is not set
13# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
14CONFIG_ZBOOT_ROM_TEXT=0x0
15CONFIG_ZBOOT_ROM_BSS=0x0
16CONFIG_CMDLINE="root=/dev/mmcblk0p2 rw init=/init"
17CONFIG_FPE_NWFPE=y
18CONFIG_NET=y
19CONFIG_PACKET=y
20CONFIG_UNIX=y
21CONFIG_NET_KEY=y
22CONFIG_INET=y
23# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
24# CONFIG_INET_XFRM_MODE_TUNNEL is not set
25# CONFIG_INET_XFRM_MODE_BEET is not set
26# CONFIG_INET_DIAG is not set
27# CONFIG_IPV6 is not set
28CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
29CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
30CONFIG_INPUT_EVDEV=y
31# CONFIG_INPUT_KEYBOARD is not set
32# CONFIG_INPUT_MOUSE is not set
33CONFIG_INPUT_TOUCHSCREEN=y
34CONFIG_TOUCHSCREEN_ADS7846=y
35# CONFIG_SERIO is not set
36CONFIG_SPI=y
37CONFIG_SPI_OMAP_UWIRE=y
38CONFIG_FB=y
39CONFIG_FIRMWARE_EDID=y
40CONFIG_FB_OMAP=y
41CONFIG_BACKLIGHT_LCD_SUPPORT=y
42# CONFIG_VGA_CONSOLE is not set
43CONFIG_FRAMEBUFFER_CONSOLE=y
44CONFIG_NEW_LEDS=y
45CONFIG_LEDS_CLASS=y
46CONFIG_LEDS_TRIGGERS=y
47CONFIG_LEDS_TRIGGER_TIMER=y
48CONFIG_LEDS_TRIGGER_HEARTBEAT=y
49CONFIG_RTC_CLASS=y
50CONFIG_RTC_DRV_OMAP=y
51CONFIG_EXT2_FS=y
52CONFIG_PARTITION_ADVANCED=y
53# CONFIG_ENABLE_MUST_CHECK is not set
54CONFIG_CRC_CCITT=y
55CONFIG_CRC16=y
56CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/palmz71_defconfig b/arch/arm/configs/palmz71_defconfig
deleted file mode 100644
index c478db6f5192..000000000000
--- a/arch/arm/configs/palmz71_defconfig
+++ /dev/null
@@ -1,53 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_LOCALVERSION="-z71"
3CONFIG_SYSVIPC=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_SLAB=y
7# CONFIG_IOSCHED_DEADLINE is not set
8# CONFIG_IOSCHED_CFQ is not set
9CONFIG_ARCH_OMAP=y
10CONFIG_ARCH_OMAP1=y
11CONFIG_MACH_OMAP_PALMZ71=y
12CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
13# CONFIG_OMAP_ARM_60MHZ is not set
14# CONFIG_ARM_THUMB is not set
15# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
16CONFIG_ZBOOT_ROM_TEXT=0x0
17CONFIG_ZBOOT_ROM_BSS=0x0
18CONFIG_FPE_NWFPE=y
19CONFIG_NET=y
20CONFIG_PACKET=y
21CONFIG_UNIX=y
22CONFIG_NET_KEY=y
23CONFIG_INET=y
24# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25# CONFIG_INET_XFRM_MODE_TUNNEL is not set
26# CONFIG_INET_DIAG is not set
27# CONFIG_IPV6 is not set
28CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
29CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
30# CONFIG_INPUT_KEYBOARD is not set
31# CONFIG_INPUT_MOUSE is not set
32CONFIG_INPUT_TOUCHSCREEN=y
33CONFIG_TOUCHSCREEN_ADS7846=y
34# CONFIG_SERIO is not set
35CONFIG_SERIAL_8250=y
36CONFIG_SERIAL_8250_CONSOLE=y
37CONFIG_LEGACY_PTY_COUNT=16
38CONFIG_SPI=y
39CONFIG_SPI_OMAP_UWIRE=y
40CONFIG_FB=y
41CONFIG_FIRMWARE_EDID=y
42CONFIG_FB_OMAP=y
43CONFIG_BACKLIGHT_LCD_SUPPORT=y
44# CONFIG_VGA_CONSOLE is not set
45CONFIG_FRAMEBUFFER_CONSOLE=y
46CONFIG_MMC=y
47CONFIG_MMC_OMAP=y
48CONFIG_RTC_CLASS=y
49CONFIG_RTC_DRV_OMAP=y
50CONFIG_EXT2_FS=y
51CONFIG_CRC_CCITT=y
52CONFIG_CRC16=y
53CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/sx1_defconfig b/arch/arm/configs/sx1_defconfig
deleted file mode 100644
index 20a861877a33..000000000000
--- a/arch/arm/configs/sx1_defconfig
+++ /dev/null
@@ -1,110 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_IKCONFIG=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_EMBEDDED=y
7# CONFIG_KALLSYMS is not set
8# CONFIG_ELF_CORE is not set
9# CONFIG_BASE_FULL is not set
10# CONFIG_SHMEM is not set
11# CONFIG_VM_EVENT_COUNTERS is not set
12CONFIG_SLOB=y
13CONFIG_PROFILING=y
14CONFIG_OPROFILE=y
15CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y
17# CONFIG_IOSCHED_CFQ is not set
18CONFIG_ARCH_OMAP=y
19CONFIG_ARCH_OMAP1=y
20CONFIG_OMAP_MBOX_FWK=y
21CONFIG_MACH_SX1=y
22CONFIG_OMAP_ARM_168MHZ=y
23# CONFIG_OMAP_ARM_60MHZ is not set
24# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
25CONFIG_PREEMPT=y
26CONFIG_ZBOOT_ROM_TEXT=0x0
27CONFIG_ZBOOT_ROM_BSS=0x0
28CONFIG_FPE_NWFPE=y
29CONFIG_BINFMT_MISC=y
30CONFIG_NET=y
31CONFIG_PACKET=y
32CONFIG_UNIX=y
33CONFIG_INET=y
34CONFIG_IP_PNP=y
35# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
36# CONFIG_INET_XFRM_MODE_TUNNEL is not set
37# CONFIG_INET_XFRM_MODE_BEET is not set
38# CONFIG_INET_DIAG is not set
39# CONFIG_IPV6 is not set
40# CONFIG_FW_LOADER is not set
41CONFIG_CONNECTOR=y
42# CONFIG_PROC_EVENTS is not set
43CONFIG_BLK_DEV_LOOP=m
44CONFIG_BLK_DEV_RAM=m
45CONFIG_BLK_DEV_RAM_COUNT=2
46CONFIG_NETDEVICES=y
47CONFIG_PHYLIB=y
48CONFIG_NET_ETHERNET=y
49CONFIG_MII=y
50# CONFIG_INPUT_MOUSEDEV is not set
51CONFIG_INPUT_EVDEV=y
52# CONFIG_KEYBOARD_ATKBD is not set
53CONFIG_KEYBOARD_OMAP=y
54# CONFIG_INPUT_MOUSE is not set
55# CONFIG_SERIO is not set
56CONFIG_SERIAL_8250=y
57CONFIG_SERIAL_8250_NR_UARTS=3
58# CONFIG_LEGACY_PTYS is not set
59# CONFIG_HW_RANDOM is not set
60CONFIG_I2C=y
61CONFIG_I2C_CHARDEV=y
62CONFIG_I2C_OMAP=y
63# CONFIG_HWMON is not set
64CONFIG_FB=y
65CONFIG_FB_OMAP=y
66CONFIG_FB_OMAP_BOOTLOADER_INIT=y
67# CONFIG_VGA_CONSOLE is not set
68CONFIG_FRAMEBUFFER_CONSOLE=y
69CONFIG_FONTS=y
70CONFIG_FONT_MINI_4x6=y
71CONFIG_LOGO=y
72# CONFIG_LOGO_LINUX_MONO is not set
73# CONFIG_LOGO_LINUX_VGA16 is not set
74CONFIG_SOUND=y
75CONFIG_SND=y
76CONFIG_SND_MIXER_OSS=y
77CONFIG_SND_PCM_OSS=y
78# CONFIG_SND_SUPPORT_OLD_API is not set
79# CONFIG_SND_VERBOSE_PROCFS is not set
80CONFIG_USB_GADGET=y
81CONFIG_USB_ETH=m
82CONFIG_MMC=y
83CONFIG_MMC_OMAP=y
84CONFIG_RTC_CLASS=y
85CONFIG_RTC_DRV_OMAP=y
86CONFIG_EXT2_FS=y
87# CONFIG_DNOTIFY is not set
88CONFIG_INOTIFY=y
89CONFIG_MSDOS_FS=y
90CONFIG_VFAT_FS=y
91CONFIG_FAT_DEFAULT_CODEPAGE=866
92CONFIG_FAT_DEFAULT_IOCHARSET="koi8-r"
93CONFIG_CRAMFS=y
94CONFIG_NFS_FS=y
95CONFIG_ROOT_NFS=y
96CONFIG_PARTITION_ADVANCED=y
97CONFIG_NLS_CODEPAGE_437=y
98CONFIG_NLS_CODEPAGE_866=y
99CONFIG_NLS_CODEPAGE_1251=y
100CONFIG_NLS_ISO8859_1=y
101CONFIG_NLS_ISO8859_5=y
102CONFIG_NLS_KOI8_R=y
103CONFIG_NLS_UTF8=y
104# CONFIG_ENABLE_MUST_CHECK is not set
105CONFIG_DEBUG_KERNEL=y
106# CONFIG_DETECT_SOFTLOCKUP is not set
107# CONFIG_DEBUG_BUGVERBOSE is not set
108CONFIG_CRC_CCITT=y
109CONFIG_CRC16=y
110CONFIG_LIBCRC32C=y
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index cc42d5fdee17..5aeec1e1735c 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -59,7 +59,17 @@
59#define L2X0_CACHE_ID_PART_MASK (0xf << 6) 59#define L2X0_CACHE_ID_PART_MASK (0xf << 6)
60#define L2X0_CACHE_ID_PART_L210 (1 << 6) 60#define L2X0_CACHE_ID_PART_L210 (1 << 6)
61#define L2X0_CACHE_ID_PART_L310 (3 << 6) 61#define L2X0_CACHE_ID_PART_L310 (3 << 6)
62#define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x3 << 17) 62
63#define L2X0_AUX_CTRL_MASK 0xc0000fff
64#define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16
65#define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17
66#define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x3 << 17)
67#define L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT 22
68#define L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT 26
69#define L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT 27
70#define L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT 28
71#define L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT 29
72#define L2X0_AUX_CTRL_EARLY_BRESP_SHIFT 30
63 73
64#ifndef __ASSEMBLY__ 74#ifndef __ASSEMBLY__
65extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask); 75extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 5f6496375404..8d2f2daba0c0 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -152,20 +152,11 @@ config MACH_NOKIA770
152config MACH_AMS_DELTA 152config MACH_AMS_DELTA
153 bool "Amstrad E3 (Delta)" 153 bool "Amstrad E3 (Delta)"
154 depends on ARCH_OMAP1 && ARCH_OMAP15XX 154 depends on ARCH_OMAP1 && ARCH_OMAP15XX
155 select FIQ
155 help 156 help
156 Support for the Amstrad E3 (codename Delta) videophone. Say Y here 157 Support for the Amstrad E3 (codename Delta) videophone. Say Y here
157 if you have such a device. 158 if you have such a device.
158 159
159config AMS_DELTA_FIQ
160 bool "Fast Interrupt Request (FIQ) support for the E3"
161 depends on MACH_AMS_DELTA
162 select FIQ
163 help
164 Provide a FIQ handler for the E3.
165 This allows for fast handling of interrupts generated
166 by the clock line of the E3 mailboard (or a PS/2 keyboard)
167 connected to the GPIO based external keyboard port.
168
169config MACH_OMAP_GENERIC 160config MACH_OMAP_GENERIC
170 bool "Generic OMAP board" 161 bool "Generic OMAP board"
171 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX) 162 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 9a304d854e33..6ee19504845f 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o 6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o 7obj-y += clock.o clock_data.o opp_data.o
8 8
9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
@@ -39,8 +39,8 @@ obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
39obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o 39obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o
40obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o 40obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
41obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o 41obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o
42obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o 42obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o ams-delta-fiq.o \
43obj-$(CONFIG_AMS_DELTA_FIQ) += ams-delta-fiq.o ams-delta-fiq-handler.o 43 ams-delta-fiq-handler.o
44obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o 44obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
45obj-$(CONFIG_MACH_HERALD) += board-htcherald.o 45obj-$(CONFIG_MACH_HERALD) += board-htcherald.o
46 46
@@ -49,6 +49,12 @@ ifeq ($(CONFIG_ARCH_OMAP15XX),y)
49obj-$(CONFIG_MACH_OMAP_INNOVATOR) += fpga.o 49obj-$(CONFIG_MACH_OMAP_INNOVATOR) += fpga.o
50endif 50endif
51 51
52# GPIO
53obj-$(CONFIG_ARCH_OMAP730) += gpio7xx.o
54obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o
55obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o
56obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o
57
52# LEDs support 58# LEDs support
53led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o 59led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o
54led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o 60led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 1d4163b9f0b7..bd0495a9ac3b 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -28,6 +28,7 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30 30
31#include <plat/io.h>
31#include <plat/board-ams-delta.h> 32#include <plat/board-ams-delta.h>
32#include <mach/gpio.h> 33#include <mach/gpio.h>
33#include <plat/keypad.h> 34#include <plat/keypad.h>
@@ -42,84 +43,82 @@
42static u8 ams_delta_latch1_reg; 43static u8 ams_delta_latch1_reg;
43static u16 ams_delta_latch2_reg; 44static u16 ams_delta_latch2_reg;
44 45
45static int ams_delta_keymap[] = { 46static const unsigned int ams_delta_keymap[] = {
46 KEY(0, 0, KEY_F1), /* Advert */ 47 KEY(0, 0, KEY_F1), /* Advert */
47 48
48 KEY(3, 0, KEY_COFFEE), /* Games */ 49 KEY(0, 3, KEY_COFFEE), /* Games */
49 KEY(2, 0, KEY_QUESTION), /* Directory */ 50 KEY(0, 2, KEY_QUESTION), /* Directory */
50 KEY(3, 2, KEY_CONNECT), /* Internet */ 51 KEY(2, 3, KEY_CONNECT), /* Internet */
51 KEY(2, 1, KEY_SHOP), /* Services */ 52 KEY(1, 2, KEY_SHOP), /* Services */
52 KEY(1, 1, KEY_PHONE), /* VoiceMail */ 53 KEY(1, 1, KEY_PHONE), /* VoiceMail */
53 54
54 KEY(1, 0, KEY_DELETE), /* Delete */ 55 KEY(0, 1, KEY_DELETE), /* Delete */
55 KEY(2, 2, KEY_PLAY), /* Play */ 56 KEY(2, 2, KEY_PLAY), /* Play */
56 KEY(0, 1, KEY_PAGEUP), /* Up */ 57 KEY(1, 0, KEY_PAGEUP), /* Up */
57 KEY(3, 1, KEY_PAGEDOWN), /* Down */ 58 KEY(1, 3, KEY_PAGEDOWN), /* Down */
58 KEY(0, 2, KEY_EMAIL), /* ReadEmail */ 59 KEY(2, 0, KEY_EMAIL), /* ReadEmail */
59 KEY(1, 2, KEY_STOP), /* Stop */ 60 KEY(2, 1, KEY_STOP), /* Stop */
60 61
61 /* Numeric keypad portion */ 62 /* Numeric keypad portion */
62 KEY(7, 0, KEY_KP1), 63 KEY(0, 7, KEY_KP1),
63 KEY(6, 0, KEY_KP2), 64 KEY(0, 6, KEY_KP2),
64 KEY(5, 0, KEY_KP3), 65 KEY(0, 5, KEY_KP3),
65 KEY(7, 1, KEY_KP4), 66 KEY(1, 7, KEY_KP4),
66 KEY(6, 1, KEY_KP5), 67 KEY(1, 6, KEY_KP5),
67 KEY(5, 1, KEY_KP6), 68 KEY(1, 5, KEY_KP6),
68 KEY(7, 2, KEY_KP7), 69 KEY(2, 7, KEY_KP7),
69 KEY(6, 2, KEY_KP8), 70 KEY(2, 6, KEY_KP8),
70 KEY(5, 2, KEY_KP9), 71 KEY(2, 5, KEY_KP9),
71 KEY(6, 3, KEY_KP0), 72 KEY(3, 6, KEY_KP0),
72 KEY(7, 3, KEY_KPASTERISK), 73 KEY(3, 7, KEY_KPASTERISK),
73 KEY(5, 3, KEY_KPDOT), /* # key */ 74 KEY(3, 5, KEY_KPDOT), /* # key */
74 KEY(2, 7, KEY_NUMLOCK), /* Mute */ 75 KEY(7, 2, KEY_NUMLOCK), /* Mute */
75 KEY(1, 7, KEY_KPMINUS), /* Recall */ 76 KEY(7, 1, KEY_KPMINUS), /* Recall */
76 KEY(1, 6, KEY_KPPLUS), /* Redial */ 77 KEY(6, 1, KEY_KPPLUS), /* Redial */
77 KEY(6, 7, KEY_KPSLASH), /* Handsfree */ 78 KEY(7, 6, KEY_KPSLASH), /* Handsfree */
78 KEY(0, 6, KEY_ENTER), /* Video */ 79 KEY(6, 0, KEY_ENTER), /* Video */
79 80
80 KEY(4, 7, KEY_CAMERA), /* Photo */ 81 KEY(7, 4, KEY_CAMERA), /* Photo */
81 82
82 KEY(4, 0, KEY_F2), /* Home */ 83 KEY(0, 4, KEY_F2), /* Home */
83 KEY(4, 1, KEY_F3), /* Office */ 84 KEY(1, 4, KEY_F3), /* Office */
84 KEY(4, 2, KEY_F4), /* Mobile */ 85 KEY(2, 4, KEY_F4), /* Mobile */
85 KEY(7, 7, KEY_F5), /* SMS */ 86 KEY(7, 7, KEY_F5), /* SMS */
86 KEY(5, 7, KEY_F6), /* Email */ 87 KEY(7, 5, KEY_F6), /* Email */
87 88
88 /* QWERTY portion of keypad */ 89 /* QWERTY portion of keypad */
89 KEY(4, 3, KEY_Q), 90 KEY(3, 4, KEY_Q),
90 KEY(3, 3, KEY_W), 91 KEY(3, 3, KEY_W),
91 KEY(2, 3, KEY_E), 92 KEY(3, 2, KEY_E),
92 KEY(1, 3, KEY_R), 93 KEY(3, 1, KEY_R),
93 KEY(0, 3, KEY_T), 94 KEY(3, 0, KEY_T),
94 KEY(7, 4, KEY_Y), 95 KEY(4, 7, KEY_Y),
95 KEY(6, 4, KEY_U), 96 KEY(4, 6, KEY_U),
96 KEY(5, 4, KEY_I), 97 KEY(4, 5, KEY_I),
97 KEY(4, 4, KEY_O), 98 KEY(4, 4, KEY_O),
98 KEY(3, 4, KEY_P), 99 KEY(4, 3, KEY_P),
99 100
100 KEY(2, 4, KEY_A), 101 KEY(4, 2, KEY_A),
101 KEY(1, 4, KEY_S), 102 KEY(4, 1, KEY_S),
102 KEY(0, 4, KEY_D), 103 KEY(4, 0, KEY_D),
103 KEY(7, 5, KEY_F), 104 KEY(5, 7, KEY_F),
104 KEY(6, 5, KEY_G), 105 KEY(5, 6, KEY_G),
105 KEY(5, 5, KEY_H), 106 KEY(5, 5, KEY_H),
106 KEY(4, 5, KEY_J), 107 KEY(5, 4, KEY_J),
107 KEY(3, 5, KEY_K), 108 KEY(5, 3, KEY_K),
108 KEY(2, 5, KEY_L), 109 KEY(5, 2, KEY_L),
109 110
110 KEY(1, 5, KEY_Z), 111 KEY(5, 1, KEY_Z),
111 KEY(0, 5, KEY_X), 112 KEY(5, 0, KEY_X),
112 KEY(7, 6, KEY_C), 113 KEY(6, 7, KEY_C),
113 KEY(6, 6, KEY_V), 114 KEY(6, 6, KEY_V),
114 KEY(5, 6, KEY_B), 115 KEY(6, 5, KEY_B),
115 KEY(4, 6, KEY_N), 116 KEY(6, 4, KEY_N),
116 KEY(3, 6, KEY_M), 117 KEY(6, 3, KEY_M),
117 KEY(2, 6, KEY_SPACE), 118 KEY(6, 2, KEY_SPACE),
118 119
119 KEY(0, 7, KEY_LEFTSHIFT), /* Vol up */ 120 KEY(7, 0, KEY_LEFTSHIFT), /* Vol up */
120 KEY(3, 7, KEY_LEFTCTRL), /* Vol down */ 121 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
121
122 0
123}; 122};
124 123
125void ams_delta_latch1_write(u8 mask, u8 value) 124void ams_delta_latch1_write(u8 mask, u8 value)
@@ -140,7 +139,6 @@ static void __init ams_delta_init_irq(void)
140{ 139{
141 omap1_init_common_hw(); 140 omap1_init_common_hw();
142 omap_init_irq(); 141 omap_init_irq();
143 omap_gpio_init();
144} 142}
145 143
146static struct map_desc ams_delta_io_desc[] __initdata = { 144static struct map_desc ams_delta_io_desc[] __initdata = {
@@ -189,11 +187,15 @@ static struct resource ams_delta_kp_resources[] = {
189 }, 187 },
190}; 188};
191 189
190static const struct matrix_keymap_data ams_delta_keymap_data = {
191 .keymap = ams_delta_keymap,
192 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
193};
194
192static struct omap_kp_platform_data ams_delta_kp_data = { 195static struct omap_kp_platform_data ams_delta_kp_data = {
193 .rows = 8, 196 .rows = 8,
194 .cols = 8, 197 .cols = 8,
195 .keymap = ams_delta_keymap, 198 .keymap_data = &ams_delta_keymap_data,
196 .keymapsize = ARRAY_SIZE(ams_delta_keymap),
197 .delay = 9, 199 .delay = 9,
198}; 200};
199 201
@@ -307,16 +309,14 @@ static void __init ams_delta_init(void)
307#endif 309#endif
308 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 310 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
309 311
310#ifdef CONFIG_AMS_DELTA_FIQ
311 ams_delta_init_fiq(); 312 ams_delta_init_fiq();
312#endif
313 313
314 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1); 314 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
315} 315}
316 316
317static struct plat_serial8250_port ams_delta_modem_ports[] = { 317static struct plat_serial8250_port ams_delta_modem_ports[] = {
318 { 318 {
319 .membase = (void *) AMS_DELTA_MODEM_VIRT, 319 .membase = IOMEM(AMS_DELTA_MODEM_VIRT),
320 .mapbase = AMS_DELTA_MODEM_PHYS, 320 .mapbase = AMS_DELTA_MODEM_PHYS,
321 .irq = -EINVAL, /* changed later */ 321 .irq = -EINVAL, /* changed later */
322 .flags = UPF_BOOT_AUTOCONF, 322 .flags = UPF_BOOT_AUTOCONF,
@@ -340,6 +340,9 @@ static int __init ams_delta_modem_init(void)
340{ 340{
341 int err; 341 int err;
342 342
343 if (!machine_is_ams_delta())
344 return -ENODEV;
345
343 omap_cfg_reg(M14_1510_GPIO2); 346 omap_cfg_reg(M14_1510_GPIO2);
344 ams_delta_modem_ports[0].irq = 347 ams_delta_modem_ports[0].irq =
345 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ); 348 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 149fdd32e127..0efb9dbae44c 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -69,36 +69,35 @@
69#define fsample_cpld_clear(bit) \ 69#define fsample_cpld_clear(bit) \
70 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) 70 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR)
71 71
72static int fsample_keymap[] = { 72static const unsigned int fsample_keymap[] = {
73 KEY(0,0,KEY_UP), 73 KEY(0, 0, KEY_UP),
74 KEY(0,1,KEY_RIGHT), 74 KEY(1, 0, KEY_RIGHT),
75 KEY(0,2,KEY_LEFT), 75 KEY(2, 0, KEY_LEFT),
76 KEY(0,3,KEY_DOWN), 76 KEY(3, 0, KEY_DOWN),
77 KEY(0,4,KEY_ENTER), 77 KEY(4, 0, KEY_ENTER),
78 KEY(1,0,KEY_F10), 78 KEY(0, 1, KEY_F10),
79 KEY(1,1,KEY_SEND), 79 KEY(1, 1, KEY_SEND),
80 KEY(1,2,KEY_END), 80 KEY(2, 1, KEY_END),
81 KEY(1,3,KEY_VOLUMEDOWN), 81 KEY(3, 1, KEY_VOLUMEDOWN),
82 KEY(1,4,KEY_VOLUMEUP), 82 KEY(4, 1, KEY_VOLUMEUP),
83 KEY(1,5,KEY_RECORD), 83 KEY(5, 1, KEY_RECORD),
84 KEY(2,0,KEY_F9), 84 KEY(0, 2, KEY_F9),
85 KEY(2,1,KEY_3), 85 KEY(1, 2, KEY_3),
86 KEY(2,2,KEY_6), 86 KEY(2, 2, KEY_6),
87 KEY(2,3,KEY_9), 87 KEY(3, 2, KEY_9),
88 KEY(2,4,KEY_KPDOT), 88 KEY(4, 2, KEY_KPDOT),
89 KEY(3,0,KEY_BACK), 89 KEY(0, 3, KEY_BACK),
90 KEY(3,1,KEY_2), 90 KEY(1, 3, KEY_2),
91 KEY(3,2,KEY_5), 91 KEY(2, 3, KEY_5),
92 KEY(3,3,KEY_8), 92 KEY(3, 3, KEY_8),
93 KEY(3,4,KEY_0), 93 KEY(4, 3, KEY_0),
94 KEY(3,5,KEY_KPSLASH), 94 KEY(5, 3, KEY_KPSLASH),
95 KEY(4,0,KEY_HOME), 95 KEY(0, 4, KEY_HOME),
96 KEY(4,1,KEY_1), 96 KEY(1, 4, KEY_1),
97 KEY(4,2,KEY_4), 97 KEY(2, 4, KEY_4),
98 KEY(4,3,KEY_7), 98 KEY(3, 4, KEY_7),
99 KEY(4,4,KEY_KPASTERISK), 99 KEY(4, 4, KEY_KPASTERISK),
100 KEY(4,5,KEY_POWER), 100 KEY(5, 4, KEY_POWER),
101 0
102}; 101};
103 102
104static struct smc91x_platdata smc91x_info = { 103static struct smc91x_platdata smc91x_info = {
@@ -120,6 +119,15 @@ static struct resource smc91x_resources[] = {
120 }, 119 },
121}; 120};
122 121
122static void __init fsample_init_smc91x(void)
123{
124 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
125 mdelay(50);
126 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
127 H2P2_DBG_FPGA_LAN_RESET);
128 mdelay(50);
129}
130
123static struct mtd_partition nor_partitions[] = { 131static struct mtd_partition nor_partitions[] = {
124 /* bootloader (U-Boot, etc) in first sector */ 132 /* bootloader (U-Boot, etc) in first sector */
125 { 133 {
@@ -244,11 +252,15 @@ static struct resource kp_resources[] = {
244 }, 252 },
245}; 253};
246 254
255static const struct matrix_keymap_data fsample_keymap_data = {
256 .keymap = fsample_keymap,
257 .keymap_size = ARRAY_SIZE(fsample_keymap),
258};
259
247static struct omap_kp_platform_data kp_data = { 260static struct omap_kp_platform_data kp_data = {
248 .rows = 8, 261 .rows = 8,
249 .cols = 8, 262 .cols = 8,
250 .keymap = fsample_keymap, 263 .keymap_data = &fsample_keymap_data,
251 .keymapsize = ARRAY_SIZE(fsample_keymap),
252 .delay = 4, 264 .delay = 4,
253}; 265};
254 266
@@ -285,6 +297,8 @@ static struct omap_board_config_kernel fsample_config[] = {
285 297
286static void __init omap_fsample_init(void) 298static void __init omap_fsample_init(void)
287{ 299{
300 fsample_init_smc91x();
301
288 if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) 302 if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0)
289 BUG(); 303 BUG();
290 gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); 304 gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN);
@@ -312,21 +326,10 @@ static void __init omap_fsample_init(void)
312 omap_register_i2c_bus(1, 100, NULL, 0); 326 omap_register_i2c_bus(1, 100, NULL, 0);
313} 327}
314 328
315static void __init fsample_init_smc91x(void)
316{
317 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
318 mdelay(50);
319 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
320 H2P2_DBG_FPGA_LAN_RESET);
321 mdelay(50);
322}
323
324static void __init omap_fsample_init_irq(void) 329static void __init omap_fsample_init_irq(void)
325{ 330{
326 omap1_init_common_hw(); 331 omap1_init_common_hw();
327 omap_init_irq(); 332 omap_init_irq();
328 omap_gpio_init();
329 fsample_init_smc91x();
330} 333}
331 334
332/* Only FPGA needs to be mapped here. All others are done with ioremap */ 335/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 197adb49dc5a..28b84aa9bdba 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -52,43 +52,42 @@
52/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 52/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
53#define OMAP1610_ETHR_START 0x04000300 53#define OMAP1610_ETHR_START 0x04000300
54 54
55static int h2_keymap[] = { 55static const unsigned int h2_keymap[] = {
56 KEY(0, 0, KEY_LEFT), 56 KEY(0, 0, KEY_LEFT),
57 KEY(0, 1, KEY_RIGHT), 57 KEY(1, 0, KEY_RIGHT),
58 KEY(0, 2, KEY_3), 58 KEY(2, 0, KEY_3),
59 KEY(0, 3, KEY_F10), 59 KEY(3, 0, KEY_F10),
60 KEY(0, 4, KEY_F5), 60 KEY(4, 0, KEY_F5),
61 KEY(0, 5, KEY_9), 61 KEY(5, 0, KEY_9),
62 KEY(1, 0, KEY_DOWN), 62 KEY(0, 1, KEY_DOWN),
63 KEY(1, 1, KEY_UP), 63 KEY(1, 1, KEY_UP),
64 KEY(1, 2, KEY_2), 64 KEY(2, 1, KEY_2),
65 KEY(1, 3, KEY_F9), 65 KEY(3, 1, KEY_F9),
66 KEY(1, 4, KEY_F7), 66 KEY(4, 1, KEY_F7),
67 KEY(1, 5, KEY_0), 67 KEY(5, 1, KEY_0),
68 KEY(2, 0, KEY_ENTER), 68 KEY(0, 2, KEY_ENTER),
69 KEY(2, 1, KEY_6), 69 KEY(1, 2, KEY_6),
70 KEY(2, 2, KEY_1), 70 KEY(2, 2, KEY_1),
71 KEY(2, 3, KEY_F2), 71 KEY(3, 2, KEY_F2),
72 KEY(2, 4, KEY_F6), 72 KEY(4, 2, KEY_F6),
73 KEY(2, 5, KEY_HOME), 73 KEY(5, 2, KEY_HOME),
74 KEY(3, 0, KEY_8), 74 KEY(0, 3, KEY_8),
75 KEY(3, 1, KEY_5), 75 KEY(1, 3, KEY_5),
76 KEY(3, 2, KEY_F12), 76 KEY(2, 3, KEY_F12),
77 KEY(3, 3, KEY_F3), 77 KEY(3, 3, KEY_F3),
78 KEY(3, 4, KEY_F8), 78 KEY(4, 3, KEY_F8),
79 KEY(3, 5, KEY_END), 79 KEY(5, 3, KEY_END),
80 KEY(4, 0, KEY_7), 80 KEY(0, 4, KEY_7),
81 KEY(4, 1, KEY_4), 81 KEY(1, 4, KEY_4),
82 KEY(4, 2, KEY_F11), 82 KEY(2, 4, KEY_F11),
83 KEY(4, 3, KEY_F1), 83 KEY(3, 4, KEY_F1),
84 KEY(4, 4, KEY_F4), 84 KEY(4, 4, KEY_F4),
85 KEY(4, 5, KEY_ESC), 85 KEY(5, 4, KEY_ESC),
86 KEY(5, 0, KEY_F13), 86 KEY(0, 5, KEY_F13),
87 KEY(5, 1, KEY_F14), 87 KEY(1, 5, KEY_F14),
88 KEY(5, 2, KEY_F15), 88 KEY(2, 5, KEY_F15),
89 KEY(5, 3, KEY_F16), 89 KEY(3, 5, KEY_F16),
90 KEY(5, 4, KEY_SLEEP), 90 KEY(4, 5, KEY_SLEEP),
91 0
92}; 91};
93 92
94static struct mtd_partition h2_nor_partitions[] = { 93static struct mtd_partition h2_nor_partitions[] = {
@@ -270,14 +269,18 @@ static struct resource h2_kp_resources[] = {
270 }, 269 },
271}; 270};
272 271
272static const struct matrix_keymap_data h2_keymap_data = {
273 .keymap = h2_keymap,
274 .keymap_size = ARRAY_SIZE(h2_keymap),
275};
276
273static struct omap_kp_platform_data h2_kp_data = { 277static struct omap_kp_platform_data h2_kp_data = {
274 .rows = 8, 278 .rows = 8,
275 .cols = 8, 279 .cols = 8,
276 .keymap = h2_keymap, 280 .keymap_data = &h2_keymap_data,
277 .keymapsize = ARRAY_SIZE(h2_keymap), 281 .rep = true,
278 .rep = 1,
279 .delay = 9, 282 .delay = 9,
280 .dbounce = 1, 283 .dbounce = true,
281}; 284};
282 285
283static struct platform_device h2_kp_device = { 286static struct platform_device h2_kp_device = {
@@ -374,8 +377,6 @@ static void __init h2_init_irq(void)
374{ 377{
375 omap1_init_common_hw(); 378 omap1_init_common_hw();
376 omap_init_irq(); 379 omap_init_irq();
377 omap_gpio_init();
378 h2_init_smc91x();
379} 380}
380 381
381static struct omap_usb_config h2_usb_config __initdata = { 382static struct omap_usb_config h2_usb_config __initdata = {
@@ -403,6 +404,8 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
403 404
404static void __init h2_init(void) 405static void __init h2_init(void)
405{ 406{
407 h2_init_smc91x();
408
406 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 409 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
407 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 410 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will
408 * notice whether a NAND chip is enabled at probe time. 411 * notice whether a NAND chip is enabled at probe time.
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 9126e3e37b4a..dbc8b8d882ba 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -56,43 +56,42 @@
56 56
57#define H3_TS_GPIO 48 57#define H3_TS_GPIO 48
58 58
59static int h3_keymap[] = { 59static const unsigned int h3_keymap[] = {
60 KEY(0, 0, KEY_LEFT), 60 KEY(0, 0, KEY_LEFT),
61 KEY(0, 1, KEY_RIGHT), 61 KEY(1, 0, KEY_RIGHT),
62 KEY(0, 2, KEY_3), 62 KEY(2, 0, KEY_3),
63 KEY(0, 3, KEY_F10), 63 KEY(3, 0, KEY_F10),
64 KEY(0, 4, KEY_F5), 64 KEY(4, 0, KEY_F5),
65 KEY(0, 5, KEY_9), 65 KEY(5, 0, KEY_9),
66 KEY(1, 0, KEY_DOWN), 66 KEY(0, 1, KEY_DOWN),
67 KEY(1, 1, KEY_UP), 67 KEY(1, 1, KEY_UP),
68 KEY(1, 2, KEY_2), 68 KEY(2, 1, KEY_2),
69 KEY(1, 3, KEY_F9), 69 KEY(3, 1, KEY_F9),
70 KEY(1, 4, KEY_F7), 70 KEY(4, 1, KEY_F7),
71 KEY(1, 5, KEY_0), 71 KEY(5, 1, KEY_0),
72 KEY(2, 0, KEY_ENTER), 72 KEY(0, 2, KEY_ENTER),
73 KEY(2, 1, KEY_6), 73 KEY(1, 2, KEY_6),
74 KEY(2, 2, KEY_1), 74 KEY(2, 2, KEY_1),
75 KEY(2, 3, KEY_F2), 75 KEY(3, 2, KEY_F2),
76 KEY(2, 4, KEY_F6), 76 KEY(4, 2, KEY_F6),
77 KEY(2, 5, KEY_HOME), 77 KEY(5, 2, KEY_HOME),
78 KEY(3, 0, KEY_8), 78 KEY(0, 3, KEY_8),
79 KEY(3, 1, KEY_5), 79 KEY(1, 3, KEY_5),
80 KEY(3, 2, KEY_F12), 80 KEY(2, 3, KEY_F12),
81 KEY(3, 3, KEY_F3), 81 KEY(3, 3, KEY_F3),
82 KEY(3, 4, KEY_F8), 82 KEY(4, 3, KEY_F8),
83 KEY(3, 5, KEY_END), 83 KEY(5, 3, KEY_END),
84 KEY(4, 0, KEY_7), 84 KEY(0, 4, KEY_7),
85 KEY(4, 1, KEY_4), 85 KEY(1, 4, KEY_4),
86 KEY(4, 2, KEY_F11), 86 KEY(2, 4, KEY_F11),
87 KEY(4, 3, KEY_F1), 87 KEY(3, 4, KEY_F1),
88 KEY(4, 4, KEY_F4), 88 KEY(4, 4, KEY_F4),
89 KEY(4, 5, KEY_ESC), 89 KEY(5, 4, KEY_ESC),
90 KEY(5, 0, KEY_F13), 90 KEY(0, 5, KEY_F13),
91 KEY(5, 1, KEY_F14), 91 KEY(1, 5, KEY_F14),
92 KEY(5, 2, KEY_F15), 92 KEY(2, 5, KEY_F15),
93 KEY(5, 3, KEY_F16), 93 KEY(3, 5, KEY_F16),
94 KEY(5, 4, KEY_SLEEP), 94 KEY(4, 5, KEY_SLEEP),
95 0
96}; 95};
97 96
98 97
@@ -264,6 +263,15 @@ static struct platform_device smc91x_device = {
264 .resource = smc91x_resources, 263 .resource = smc91x_resources,
265}; 264};
266 265
266static void __init h3_init_smc91x(void)
267{
268 omap_cfg_reg(W15_1710_GPIO40);
269 if (gpio_request(40, "SMC91x irq") < 0) {
270 printk("Error requesting gpio 40 for smc91x irq\n");
271 return;
272 }
273}
274
267#define GPTIMER_BASE 0xFFFB1400 275#define GPTIMER_BASE 0xFFFB1400
268#define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800)) 276#define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
269#define GPTIMER_REGS_SIZE 0x46 277#define GPTIMER_REGS_SIZE 0x46
@@ -296,14 +304,18 @@ static struct resource h3_kp_resources[] = {
296 }, 304 },
297}; 305};
298 306
307static const struct matrix_keymap_data h3_keymap_data = {
308 .keymap = h3_keymap,
309 .keymap_size = ARRAY_SIZE(h3_keymap),
310};
311
299static struct omap_kp_platform_data h3_kp_data = { 312static struct omap_kp_platform_data h3_kp_data = {
300 .rows = 8, 313 .rows = 8,
301 .cols = 8, 314 .cols = 8,
302 .keymap = h3_keymap, 315 .keymap_data = &h3_keymap_data,
303 .keymapsize = ARRAY_SIZE(h3_keymap), 316 .rep = true,
304 .rep = 1,
305 .delay = 9, 317 .delay = 9,
306 .dbounce = 1, 318 .dbounce = true,
307}; 319};
308 320
309static struct platform_device h3_kp_device = { 321static struct platform_device h3_kp_device = {
@@ -376,6 +388,8 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = {
376 388
377static void __init h3_init(void) 389static void __init h3_init(void)
378{ 390{
391 h3_init_smc91x();
392
379 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 393 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
380 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 394 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will
381 * notice whether a NAND chip is enabled at probe time. 395 * notice whether a NAND chip is enabled at probe time.
@@ -422,21 +436,10 @@ static void __init h3_init(void)
422 h3_mmc_init(); 436 h3_mmc_init();
423} 437}
424 438
425static void __init h3_init_smc91x(void)
426{
427 omap_cfg_reg(W15_1710_GPIO40);
428 if (gpio_request(40, "SMC91x irq") < 0) {
429 printk("Error requesting gpio 40 for smc91x irq\n");
430 return;
431 }
432}
433
434static void __init h3_init_irq(void) 439static void __init h3_init_irq(void)
435{ 440{
436 omap1_init_common_hw(); 441 omap1_init_common_hw();
437 omap_init_irq(); 442 omap_init_irq();
438 omap_gpio_init();
439 h3_init_smc91x();
440} 443}
441 444
442static void __init h3_map_io(void) 445static void __init h3_map_io(void)
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 071af3e47789..f2c5c585bc83 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -180,64 +180,68 @@
180 180
181/* Keyboard definition */ 181/* Keyboard definition */
182 182
183static int htc_herald_keymap[] = { 183static const unsigned int htc_herald_keymap[] = {
184 KEY(0, 0, KEY_RECORD), /* Mail button */ 184 KEY(0, 0, KEY_RECORD), /* Mail button */
185 KEY(0, 1, KEY_CAMERA), /* Camera */ 185 KEY(1, 0, KEY_CAMERA), /* Camera */
186 KEY(0, 2, KEY_PHONE), /* Send key */ 186 KEY(2, 0, KEY_PHONE), /* Send key */
187 KEY(0, 3, KEY_VOLUMEUP), /* Volume up */ 187 KEY(3, 0, KEY_VOLUMEUP), /* Volume up */
188 KEY(0, 4, KEY_F2), /* Right bar (landscape) */ 188 KEY(4, 0, KEY_F2), /* Right bar (landscape) */
189 KEY(0, 5, KEY_MAIL), /* Win key (portrait) */ 189 KEY(5, 0, KEY_MAIL), /* Win key (portrait) */
190 KEY(0, 6, KEY_DIRECTORY), /* Right bar (protrait) */ 190 KEY(6, 0, KEY_DIRECTORY), /* Right bar (protrait) */
191 KEY(1, 0, KEY_LEFTCTRL), /* Windows key */ 191 KEY(0, 1, KEY_LEFTCTRL), /* Windows key */
192 KEY(1, 1, KEY_COMMA), 192 KEY(1, 1, KEY_COMMA),
193 KEY(1, 2, KEY_M), 193 KEY(2, 1, KEY_M),
194 KEY(1, 3, KEY_K), 194 KEY(3, 1, KEY_K),
195 KEY(1, 4, KEY_SLASH), /* OK key */ 195 KEY(4, 1, KEY_SLASH), /* OK key */
196 KEY(1, 5, KEY_I), 196 KEY(5, 1, KEY_I),
197 KEY(1, 6, KEY_U), 197 KEY(6, 1, KEY_U),
198 KEY(2, 0, KEY_LEFTALT), 198 KEY(0, 2, KEY_LEFTALT),
199 KEY(2, 1, KEY_TAB), 199 KEY(1, 2, KEY_TAB),
200 KEY(2, 2, KEY_N), 200 KEY(2, 2, KEY_N),
201 KEY(2, 3, KEY_J), 201 KEY(3, 2, KEY_J),
202 KEY(2, 4, KEY_ENTER), 202 KEY(4, 2, KEY_ENTER),
203 KEY(2, 5, KEY_H), 203 KEY(5, 2, KEY_H),
204 KEY(2, 6, KEY_Y), 204 KEY(6, 2, KEY_Y),
205 KEY(3, 0, KEY_SPACE), 205 KEY(0, 3, KEY_SPACE),
206 KEY(3, 1, KEY_L), 206 KEY(1, 3, KEY_L),
207 KEY(3, 2, KEY_B), 207 KEY(2, 3, KEY_B),
208 KEY(3, 3, KEY_V), 208 KEY(3, 3, KEY_V),
209 KEY(3, 4, KEY_BACKSPACE), 209 KEY(4, 3, KEY_BACKSPACE),
210 KEY(3, 5, KEY_G), 210 KEY(5, 3, KEY_G),
211 KEY(3, 6, KEY_T), 211 KEY(6, 3, KEY_T),
212 KEY(4, 0, KEY_CAPSLOCK), /* Shift */ 212 KEY(0, 4, KEY_CAPSLOCK), /* Shift */
213 KEY(4, 1, KEY_C), 213 KEY(1, 4, KEY_C),
214 KEY(4, 2, KEY_F), 214 KEY(2, 4, KEY_F),
215 KEY(4, 3, KEY_R), 215 KEY(3, 4, KEY_R),
216 KEY(4, 4, KEY_O), 216 KEY(4, 4, KEY_O),
217 KEY(4, 5, KEY_E), 217 KEY(5, 4, KEY_E),
218 KEY(4, 6, KEY_D), 218 KEY(6, 4, KEY_D),
219 KEY(5, 0, KEY_X), 219 KEY(0, 5, KEY_X),
220 KEY(5, 1, KEY_Z), 220 KEY(1, 5, KEY_Z),
221 KEY(5, 2, KEY_S), 221 KEY(2, 5, KEY_S),
222 KEY(5, 3, KEY_W), 222 KEY(3, 5, KEY_W),
223 KEY(5, 4, KEY_P), 223 KEY(4, 5, KEY_P),
224 KEY(5, 5, KEY_Q), 224 KEY(5, 5, KEY_Q),
225 KEY(5, 6, KEY_A), 225 KEY(6, 5, KEY_A),
226 KEY(6, 0, KEY_CONNECT), /* Voice button */ 226 KEY(0, 6, KEY_CONNECT), /* Voice button */
227 KEY(6, 2, KEY_CANCEL), /* End key */ 227 KEY(2, 6, KEY_CANCEL), /* End key */
228 KEY(6, 3, KEY_VOLUMEDOWN), /* Volume down */ 228 KEY(3, 6, KEY_VOLUMEDOWN), /* Volume down */
229 KEY(6, 4, KEY_F1), /* Left bar (landscape) */ 229 KEY(4, 6, KEY_F1), /* Left bar (landscape) */
230 KEY(6, 5, KEY_WWW), /* OK button (portrait) */ 230 KEY(5, 6, KEY_WWW), /* OK button (portrait) */
231 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */ 231 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */
232 0
233}; 232};
234 233
235struct omap_kp_platform_data htcherald_kp_data = { 234static const struct matrix_keymap_data htc_herald_keymap_data = {
235 .keymap = htc_herald_keymap,
236 .keymap_size = ARRAY_SIZE(htc_herald_keymap),
237};
238
239static struct omap_kp_platform_data htcherald_kp_data = {
236 .rows = 7, 240 .rows = 7,
237 .cols = 7, 241 .cols = 7,
238 .delay = 20, 242 .delay = 20,
239 .rep = 1, 243 .rep = true,
240 .keymap = htc_herald_keymap, 244 .keymap_data = &htc_herald_keymap_data,
241}; 245};
242 246
243static struct resource kp_resources[] = { 247static struct resource kp_resources[] = {
@@ -278,7 +282,7 @@ static struct gpio_keys_button herald_gpio_keys_table[] = {
278static struct gpio_keys_platform_data herald_gpio_keys_data = { 282static struct gpio_keys_platform_data herald_gpio_keys_data = {
279 .buttons = herald_gpio_keys_table, 283 .buttons = herald_gpio_keys_table,
280 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table), 284 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table),
281 .rep = 1, 285 .rep = true,
282}; 286};
283 287
284static struct platform_device herald_gpiokeys_device = { 288static struct platform_device herald_gpiokeys_device = {
@@ -439,7 +443,7 @@ static const struct ads7846_platform_data htcherald_ts_platform_data = {
439 .keep_vref_on = 1, 443 .keep_vref_on = 1,
440 .x_plate_ohms = 496, 444 .x_plate_ohms = 496,
441 .gpio_pendown = HTCHERALD_GPIO_TS, 445 .gpio_pendown = HTCHERALD_GPIO_TS,
442 .pressure_max = 100000, 446 .pressure_max = 10000,
443 .pressure_min = 5000, 447 .pressure_min = 5000,
444 .x_min = 528, 448 .x_min = 528,
445 .x_max = 3760, 449 .x_max = 3760,
@@ -577,8 +581,6 @@ static void __init htcherald_init(void)
577 printk(KERN_INFO "HTC Herald init.\n"); 581 printk(KERN_INFO "HTC Herald init.\n");
578 582
579 /* Do board initialization before we register all the devices */ 583 /* Do board initialization before we register all the devices */
580 omap_gpio_init();
581
582 omap_board_config = htcherald_config; 584 omap_board_config = htcherald_config;
583 omap_board_config_size = ARRAY_SIZE(htcherald_config); 585 omap_board_config_size = ARRAY_SIZE(htcherald_config);
584 platform_add_devices(devices, ARRAY_SIZE(devices)); 586 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index dc2b86fd66c1..a36e6742bf9b 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -44,17 +44,16 @@
44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
45#define INNOVATOR1610_ETHR_START 0x04000300 45#define INNOVATOR1610_ETHR_START 0x04000300
46 46
47static int innovator_keymap[] = { 47static const unsigned int innovator_keymap[] = {
48 KEY(0, 0, KEY_F1), 48 KEY(0, 0, KEY_F1),
49 KEY(0, 3, KEY_DOWN), 49 KEY(3, 0, KEY_DOWN),
50 KEY(1, 1, KEY_F2), 50 KEY(1, 1, KEY_F2),
51 KEY(1, 2, KEY_RIGHT), 51 KEY(2, 1, KEY_RIGHT),
52 KEY(2, 0, KEY_F3), 52 KEY(0, 2, KEY_F3),
53 KEY(2, 1, KEY_F4), 53 KEY(1, 2, KEY_F4),
54 KEY(2, 2, KEY_UP), 54 KEY(2, 2, KEY_UP),
55 KEY(3, 2, KEY_ENTER), 55 KEY(2, 3, KEY_ENTER),
56 KEY(3, 3, KEY_LEFT), 56 KEY(3, 3, KEY_LEFT),
57 0
58}; 57};
59 58
60static struct mtd_partition innovator_partitions[] = { 59static struct mtd_partition innovator_partitions[] = {
@@ -126,11 +125,15 @@ static struct resource innovator_kp_resources[] = {
126 }, 125 },
127}; 126};
128 127
128static const struct matrix_keymap_data innovator_keymap_data = {
129 .keymap = innovator_keymap,
130 .keymap_size = ARRAY_SIZE(innovator_keymap),
131};
132
129static struct omap_kp_platform_data innovator_kp_data = { 133static struct omap_kp_platform_data innovator_kp_data = {
130 .rows = 8, 134 .rows = 8,
131 .cols = 8, 135 .cols = 8,
132 .keymap = innovator_keymap, 136 .keymap_data = &innovator_keymap_data,
133 .keymapsize = ARRAY_SIZE(innovator_keymap),
134 .delay = 4, 137 .delay = 4,
135}; 138};
136 139
@@ -290,13 +293,6 @@ static void __init innovator_init_irq(void)
290{ 293{
291 omap1_init_common_hw(); 294 omap1_init_common_hw();
292 omap_init_irq(); 295 omap_init_irq();
293 omap_gpio_init();
294#ifdef CONFIG_ARCH_OMAP15XX
295 if (cpu_is_omap1510()) {
296 omap1510_fpga_init_irq();
297 }
298#endif
299 innovator_init_smc91x();
300} 296}
301 297
302#ifdef CONFIG_ARCH_OMAP15XX 298#ifdef CONFIG_ARCH_OMAP15XX
@@ -387,6 +383,10 @@ static struct omap_board_config_kernel innovator_config[] = {
387 383
388static void __init innovator_init(void) 384static void __init innovator_init(void)
389{ 385{
386 if (cpu_is_omap1510())
387 omap1510_fpga_init_irq();
388 innovator_init_smc91x();
389
390#ifdef CONFIG_ARCH_OMAP15XX 390#ifdef CONFIG_ARCH_OMAP15XX
391 if (cpu_is_omap1510()) { 391 if (cpu_is_omap1510()) {
392 unsigned char reg; 392 unsigned char reg;
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index aa8375b2a0a3..d21f09dc78f4 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -54,19 +54,18 @@ static void __init omap_nokia770_init_irq(void)
54 omap_init_irq(); 54 omap_init_irq();
55} 55}
56 56
57static int nokia770_keymap[] = { 57static const unsigned int nokia770_keymap[] = {
58 KEY(0, 1, GROUP_0 | KEY_UP), 58 KEY(1, 0, GROUP_0 | KEY_UP),
59 KEY(0, 2, GROUP_1 | KEY_F5), 59 KEY(2, 0, GROUP_1 | KEY_F5),
60 KEY(1, 0, GROUP_0 | KEY_LEFT), 60 KEY(0, 1, GROUP_0 | KEY_LEFT),
61 KEY(1, 1, GROUP_0 | KEY_ENTER), 61 KEY(1, 1, GROUP_0 | KEY_ENTER),
62 KEY(1, 2, GROUP_0 | KEY_RIGHT), 62 KEY(2, 1, GROUP_0 | KEY_RIGHT),
63 KEY(2, 0, GROUP_1 | KEY_ESC), 63 KEY(0, 2, GROUP_1 | KEY_ESC),
64 KEY(2, 1, GROUP_0 | KEY_DOWN), 64 KEY(1, 2, GROUP_0 | KEY_DOWN),
65 KEY(2, 2, GROUP_1 | KEY_F4), 65 KEY(2, 2, GROUP_1 | KEY_F4),
66 KEY(3, 0, GROUP_2 | KEY_F7), 66 KEY(0, 3, GROUP_2 | KEY_F7),
67 KEY(3, 1, GROUP_2 | KEY_F8), 67 KEY(1, 3, GROUP_2 | KEY_F8),
68 KEY(3, 2, GROUP_2 | KEY_F6), 68 KEY(2, 3, GROUP_2 | KEY_F6),
69 0
70}; 69};
71 70
72static struct resource nokia770_kp_resources[] = { 71static struct resource nokia770_kp_resources[] = {
@@ -77,11 +76,15 @@ static struct resource nokia770_kp_resources[] = {
77 }, 76 },
78}; 77};
79 78
79static const struct matrix_keymap_data nokia770_keymap_data = {
80 .keymap = nokia770_keymap,
81 .keymap_size = ARRAY_SIZE(nokia770_keymap),
82};
83
80static struct omap_kp_platform_data nokia770_kp_data = { 84static struct omap_kp_platform_data nokia770_kp_data = {
81 .rows = 8, 85 .rows = 8,
82 .cols = 8, 86 .cols = 8,
83 .keymap = nokia770_keymap, 87 .keymap_data = &nokia770_keymap_data,
84 .keymapsize = ARRAY_SIZE(nokia770_keymap),
85 .delay = 4, 88 .delay = 4,
86}; 89};
87 90
@@ -246,7 +249,6 @@ static void __init omap_nokia770_init(void)
246 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); 249 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
247 spi_register_board_info(nokia770_spi_board_info, 250 spi_register_board_info(nokia770_spi_board_info,
248 ARRAY_SIZE(nokia770_spi_board_info)); 251 ARRAY_SIZE(nokia770_spi_board_info));
249 omap_gpio_init();
250 omap_serial_init(); 252 omap_serial_init();
251 omap_register_i2c_bus(1, 100, NULL, 0); 253 omap_register_i2c_bus(1, 100, NULL, 0);
252 hwa742_dev_init(); 254 hwa742_dev_init();
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index e9dd79149a8e..7c5e2112c776 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -283,9 +283,6 @@ static void __init osk_init_irq(void)
283{ 283{
284 omap1_init_common_hw(); 284 omap1_init_common_hw();
285 omap_init_irq(); 285 omap_init_irq();
286 omap_gpio_init();
287 osk_init_smc91x();
288 osk_init_cf();
289} 286}
290 287
291static struct omap_usb_config osk_usb_config __initdata = { 288static struct omap_usb_config osk_usb_config __initdata = {
@@ -341,25 +338,28 @@ static struct i2c_board_info __initdata mistral_i2c_board_info[] = {
341 */ 338 */
342}; 339};
343 340
344static const int osk_keymap[] = { 341static const unsigned int osk_keymap[] = {
345 /* KEY(col, row, code) */ 342 /* KEY(col, row, code) */
346 KEY(0, 0, KEY_F1), /* SW4 */ 343 KEY(0, 0, KEY_F1), /* SW4 */
347 KEY(0, 3, KEY_UP), /* (sw2/up) */ 344 KEY(3, 0, KEY_UP), /* (sw2/up) */
348 KEY(1, 1, KEY_LEFTCTRL), /* SW5 */ 345 KEY(1, 1, KEY_LEFTCTRL), /* SW5 */
349 KEY(1, 2, KEY_LEFT), /* (sw2/left) */ 346 KEY(2, 1, KEY_LEFT), /* (sw2/left) */
350 KEY(2, 0, KEY_SPACE), /* SW3 */ 347 KEY(0, 2, KEY_SPACE), /* SW3 */
351 KEY(2, 1, KEY_ESC), /* SW6 */ 348 KEY(1, 2, KEY_ESC), /* SW6 */
352 KEY(2, 2, KEY_DOWN), /* (sw2/down) */ 349 KEY(2, 2, KEY_DOWN), /* (sw2/down) */
353 KEY(3, 2, KEY_ENTER), /* (sw2/select) */ 350 KEY(2, 3, KEY_ENTER), /* (sw2/select) */
354 KEY(3, 3, KEY_RIGHT), /* (sw2/right) */ 351 KEY(3, 3, KEY_RIGHT), /* (sw2/right) */
355 0 352};
353
354static const struct matrix_keymap_data osk_keymap_data = {
355 .keymap = osk_keymap,
356 .keymap_size = ARRAY_SIZE(osk_keymap),
356}; 357};
357 358
358static struct omap_kp_platform_data osk_kp_data = { 359static struct omap_kp_platform_data osk_kp_data = {
359 .rows = 8, 360 .rows = 8,
360 .cols = 8, 361 .cols = 8,
361 .keymap = (int *) osk_keymap, 362 .keymap_data = &osk_keymap_data,
362 .keymapsize = ARRAY_SIZE(osk_keymap),
363 .delay = 9, 363 .delay = 9,
364}; 364};
365 365
@@ -541,6 +541,9 @@ static void __init osk_init(void)
541{ 541{
542 u32 l; 542 u32 l;
543 543
544 osk_init_smc91x();
545 osk_init_cf();
546
544 /* Workaround for wrong CS3 (NOR flash) timing 547 /* Workaround for wrong CS3 (NOR flash) timing
545 * There are some U-Boot versions out there which configure 548 * There are some U-Boot versions out there which configure
546 * wrong CS3 memory timings. This mainly leads to CRC 549 * wrong CS3 memory timings. This mainly leads to CRC
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index f32738b1eb6b..fb51ce6123d8 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -63,28 +63,31 @@ static void __init omap_palmte_init_irq(void)
63{ 63{
64 omap1_init_common_hw(); 64 omap1_init_common_hw();
65 omap_init_irq(); 65 omap_init_irq();
66 omap_gpio_init();
67} 66}
68 67
69static const int palmte_keymap[] = { 68static const unsigned int palmte_keymap[] = {
70 KEY(0, 0, KEY_F1), /* Calendar */ 69 KEY(0, 0, KEY_F1), /* Calendar */
71 KEY(0, 1, KEY_F2), /* Contacts */ 70 KEY(1, 0, KEY_F2), /* Contacts */
72 KEY(0, 2, KEY_F3), /* Tasks List */ 71 KEY(2, 0, KEY_F3), /* Tasks List */
73 KEY(0, 3, KEY_F4), /* Note Pad */ 72 KEY(3, 0, KEY_F4), /* Note Pad */
74 KEY(0, 4, KEY_POWER), 73 KEY(4, 0, KEY_POWER),
75 KEY(1, 0, KEY_LEFT), 74 KEY(0, 1, KEY_LEFT),
76 KEY(1, 1, KEY_DOWN), 75 KEY(1, 1, KEY_DOWN),
77 KEY(1, 2, KEY_UP), 76 KEY(2, 1, KEY_UP),
78 KEY(1, 3, KEY_RIGHT), 77 KEY(3, 1, KEY_RIGHT),
79 KEY(1, 4, KEY_ENTER), 78 KEY(4, 1, KEY_ENTER),
80 0, 79};
80
81static const struct matrix_keymap_data palmte_keymap_data = {
82 .keymap = palmte_keymap,
83 .keymap_size = ARRAY_SIZE(palmte_keymap),
81}; 84};
82 85
83static struct omap_kp_platform_data palmte_kp_data = { 86static struct omap_kp_platform_data palmte_kp_data = {
84 .rows = 8, 87 .rows = 8,
85 .cols = 8, 88 .cols = 8,
86 .keymap = (int *) palmte_keymap, 89 .keymap_data = &palmte_keymap_data,
87 .rep = 1, 90 .rep = true,
88 .delay = 12, 91 .delay = 12,
89}; 92};
90 93
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index ed1400a67f75..f04f2d36e7d3 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -51,19 +51,18 @@
51#define PALMTT_MMC_WP_GPIO 8 51#define PALMTT_MMC_WP_GPIO 8
52#define PALMTT_HDQ_GPIO 11 52#define PALMTT_HDQ_GPIO 11
53 53
54static int palmtt_keymap[] = { 54static const unsigned int palmtt_keymap[] = {
55 KEY(0, 0, KEY_ESC), 55 KEY(0, 0, KEY_ESC),
56 KEY(0, 1, KEY_SPACE), 56 KEY(1, 0, KEY_SPACE),
57 KEY(0, 2, KEY_LEFTCTRL), 57 KEY(2, 0, KEY_LEFTCTRL),
58 KEY(0, 3, KEY_TAB), 58 KEY(3, 0, KEY_TAB),
59 KEY(0, 4, KEY_ENTER), 59 KEY(4, 0, KEY_ENTER),
60 KEY(1, 0, KEY_LEFT), 60 KEY(0, 1, KEY_LEFT),
61 KEY(1, 1, KEY_DOWN), 61 KEY(1, 1, KEY_DOWN),
62 KEY(1, 2, KEY_UP), 62 KEY(2, 1, KEY_UP),
63 KEY(1, 3, KEY_RIGHT), 63 KEY(3, 1, KEY_RIGHT),
64 KEY(2, 0, KEY_SLEEP), 64 KEY(0, 2, KEY_SLEEP),
65 KEY(2, 4, KEY_Y), 65 KEY(4, 2, KEY_Y),
66 0
67}; 66};
68 67
69static struct mtd_partition palmtt_partitions[] = { 68static struct mtd_partition palmtt_partitions[] = {
@@ -136,10 +135,15 @@ static struct resource palmtt_kp_resources[] = {
136 }, 135 },
137}; 136};
138 137
138static const struct matrix_keymap_data palmtt_keymap_data = {
139 .keymap = palmtt_keymap,
140 .keymap_size = ARRAY_SIZE(palmtt_keymap),
141};
142
139static struct omap_kp_platform_data palmtt_kp_data = { 143static struct omap_kp_platform_data palmtt_kp_data = {
140 .rows = 6, 144 .rows = 6,
141 .cols = 3, 145 .cols = 3,
142 .keymap = palmtt_keymap, 146 .keymap_data = &palmtt_keymap_data,
143}; 147};
144 148
145static struct platform_device palmtt_kp_device = { 149static struct platform_device palmtt_kp_device = {
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index d7a245cef9a4..d7bbbe721a75 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -62,29 +62,32 @@ omap_palmz71_init_irq(void)
62{ 62{
63 omap1_init_common_hw(); 63 omap1_init_common_hw();
64 omap_init_irq(); 64 omap_init_irq();
65 omap_gpio_init();
66} 65}
67 66
68static int palmz71_keymap[] = { 67static const unsigned int palmz71_keymap[] = {
69 KEY(0, 0, KEY_F1), 68 KEY(0, 0, KEY_F1),
70 KEY(0, 1, KEY_F2), 69 KEY(1, 0, KEY_F2),
71 KEY(0, 2, KEY_F3), 70 KEY(2, 0, KEY_F3),
72 KEY(0, 3, KEY_F4), 71 KEY(3, 0, KEY_F4),
73 KEY(0, 4, KEY_POWER), 72 KEY(4, 0, KEY_POWER),
74 KEY(1, 0, KEY_LEFT), 73 KEY(0, 1, KEY_LEFT),
75 KEY(1, 1, KEY_DOWN), 74 KEY(1, 1, KEY_DOWN),
76 KEY(1, 2, KEY_UP), 75 KEY(2, 1, KEY_UP),
77 KEY(1, 3, KEY_RIGHT), 76 KEY(3, 1, KEY_RIGHT),
78 KEY(1, 4, KEY_ENTER), 77 KEY(4, 1, KEY_ENTER),
79 KEY(2, 0, KEY_CAMERA), 78 KEY(0, 2, KEY_CAMERA),
80 0, 79};
80
81static const struct matrix_keymap_data palmz71_keymap_data = {
82 .keymap = palmz71_keymap,
83 .keymap_size = ARRAY_SIZE(palmz71_keymap),
81}; 84};
82 85
83static struct omap_kp_platform_data palmz71_kp_data = { 86static struct omap_kp_platform_data palmz71_kp_data = {
84 .rows = 8, 87 .rows = 8,
85 .cols = 8, 88 .cols = 8,
86 .keymap = palmz71_keymap, 89 .keymap_data = &palmz71_keymap_data,
87 .rep = 1, 90 .rep = true,
88 .delay = 80, 91 .delay = 80,
89}; 92};
90 93
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index a8d16a255c18..3c8ee8489458 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -36,36 +36,35 @@
36#include <plat/common.h> 36#include <plat/common.h>
37#include <plat/board.h> 37#include <plat/board.h>
38 38
39static int p2_keymap[] = { 39static const unsigned int p2_keymap[] = {
40 KEY(0,0,KEY_UP), 40 KEY(0, 0, KEY_UP),
41 KEY(0,1,KEY_RIGHT), 41 KEY(1, 0, KEY_RIGHT),
42 KEY(0,2,KEY_LEFT), 42 KEY(2, 0, KEY_LEFT),
43 KEY(0,3,KEY_DOWN), 43 KEY(3, 0, KEY_DOWN),
44 KEY(0,4,KEY_ENTER), 44 KEY(4, 0, KEY_ENTER),
45 KEY(1,0,KEY_F10), 45 KEY(0, 1, KEY_F10),
46 KEY(1,1,KEY_SEND), 46 KEY(1, 1, KEY_SEND),
47 KEY(1,2,KEY_END), 47 KEY(2, 1, KEY_END),
48 KEY(1,3,KEY_VOLUMEDOWN), 48 KEY(3, 1, KEY_VOLUMEDOWN),
49 KEY(1,4,KEY_VOLUMEUP), 49 KEY(4, 1, KEY_VOLUMEUP),
50 KEY(1,5,KEY_RECORD), 50 KEY(5, 1, KEY_RECORD),
51 KEY(2,0,KEY_F9), 51 KEY(0, 2, KEY_F9),
52 KEY(2,1,KEY_3), 52 KEY(1, 2, KEY_3),
53 KEY(2,2,KEY_6), 53 KEY(2, 2, KEY_6),
54 KEY(2,3,KEY_9), 54 KEY(3, 2, KEY_9),
55 KEY(2,4,KEY_KPDOT), 55 KEY(4, 2, KEY_KPDOT),
56 KEY(3,0,KEY_BACK), 56 KEY(0, 3, KEY_BACK),
57 KEY(3,1,KEY_2), 57 KEY(1, 3, KEY_2),
58 KEY(3,2,KEY_5), 58 KEY(2, 3, KEY_5),
59 KEY(3,3,KEY_8), 59 KEY(3, 3, KEY_8),
60 KEY(3,4,KEY_0), 60 KEY(4, 3, KEY_0),
61 KEY(3,5,KEY_KPSLASH), 61 KEY(5, 3, KEY_KPSLASH),
62 KEY(4,0,KEY_HOME), 62 KEY(0, 4, KEY_HOME),
63 KEY(4,1,KEY_1), 63 KEY(1, 4, KEY_1),
64 KEY(4,2,KEY_4), 64 KEY(2, 4, KEY_4),
65 KEY(4,3,KEY_7), 65 KEY(3, 4, KEY_7),
66 KEY(4,4,KEY_KPASTERISK), 66 KEY(4, 4, KEY_KPASTERISK),
67 KEY(4,5,KEY_POWER), 67 KEY(5, 4, KEY_POWER),
68 0
69}; 68};
70 69
71static struct smc91x_platdata smc91x_info = { 70static struct smc91x_platdata smc91x_info = {
@@ -211,13 +210,17 @@ static struct resource kp_resources[] = {
211 }, 210 },
212}; 211};
213 212
213static const struct matrix_keymap_data p2_keymap_data = {
214 .keymap = p2_keymap,
215 .keymap_size = ARRAY_SIZE(p2_keymap),
216};
217
214static struct omap_kp_platform_data kp_data = { 218static struct omap_kp_platform_data kp_data = {
215 .rows = 8, 219 .rows = 8,
216 .cols = 8, 220 .cols = 8,
217 .keymap = p2_keymap, 221 .keymap_data = &p2_keymap_data,
218 .keymapsize = ARRAY_SIZE(p2_keymap),
219 .delay = 4, 222 .delay = 4,
220 .dbounce = 1, 223 .dbounce = true,
221}; 224};
222 225
223static struct platform_device kp_device = { 226static struct platform_device kp_device = {
@@ -251,8 +254,19 @@ static struct omap_board_config_kernel perseus2_config[] __initdata = {
251 { OMAP_TAG_LCD, &perseus2_lcd_config }, 254 { OMAP_TAG_LCD, &perseus2_lcd_config },
252}; 255};
253 256
257static void __init perseus2_init_smc91x(void)
258{
259 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
260 mdelay(50);
261 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
262 H2P2_DBG_FPGA_LAN_RESET);
263 mdelay(50);
264}
265
254static void __init omap_perseus2_init(void) 266static void __init omap_perseus2_init(void)
255{ 267{
268 perseus2_init_smc91x();
269
256 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) 270 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
257 BUG(); 271 BUG();
258 gpio_direction_input(P2_NAND_RB_GPIO_PIN); 272 gpio_direction_input(P2_NAND_RB_GPIO_PIN);
@@ -280,21 +294,10 @@ static void __init omap_perseus2_init(void)
280 omap_register_i2c_bus(1, 100, NULL, 0); 294 omap_register_i2c_bus(1, 100, NULL, 0);
281} 295}
282 296
283static void __init perseus2_init_smc91x(void)
284{
285 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
286 mdelay(50);
287 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
288 H2P2_DBG_FPGA_LAN_RESET);
289 mdelay(50);
290}
291
292static void __init omap_perseus2_init_irq(void) 297static void __init omap_perseus2_init_irq(void)
293{ 298{
294 omap1_init_common_hw(); 299 omap1_init_common_hw();
295 omap_init_irq(); 300 omap_init_irq();
296 omap_gpio_init();
297 perseus2_init_smc91x();
298} 301}
299/* Only FPGA needs to be mapped here. All others are done with ioremap */ 302/* Only FPGA needs to be mapped here. All others are done with ioremap */
300static struct map_desc omap_perseus2_io_desc[] __initdata = { 303static struct map_desc omap_perseus2_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index d25f59e5a773..d41fe2d0616a 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -164,36 +164,35 @@ EXPORT_SYMBOL(sx1_setusbpower);
164 164
165/*----------- Keypad -------------------------*/ 165/*----------- Keypad -------------------------*/
166 166
167static int sx1_keymap[] = { 167static const unsigned int sx1_keymap[] = {
168 KEY(5, 3, GROUP_0 | 117), /* camera Qt::Key_F17 */ 168 KEY(3, 5, GROUP_0 | 117), /* camera Qt::Key_F17 */
169 KEY(0, 4, GROUP_0 | 114), /* voice memo Qt::Key_F14 */ 169 KEY(4, 0, GROUP_0 | 114), /* voice memo Qt::Key_F14 */
170 KEY(1, 4, GROUP_2 | 114), /* voice memo */ 170 KEY(4, 1, GROUP_2 | 114), /* voice memo */
171 KEY(2, 4, GROUP_3 | 114), /* voice memo */ 171 KEY(4, 2, GROUP_3 | 114), /* voice memo */
172 KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */ 172 KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */
173 KEY(4, 3, GROUP_1 | KEY_LEFT), 173 KEY(3, 4, GROUP_1 | KEY_LEFT),
174 KEY(2, 3, GROUP_1 | KEY_DOWN), 174 KEY(3, 2, GROUP_1 | KEY_DOWN),
175 KEY(1, 3, GROUP_1 | KEY_RIGHT), 175 KEY(3, 1, GROUP_1 | KEY_RIGHT),
176 KEY(0, 3, GROUP_1 | KEY_UP), 176 KEY(3, 0, GROUP_1 | KEY_UP),
177 KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */ 177 KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */
178 KEY(5, 0, GROUP_1 | KEY_1), 178 KEY(0, 5, GROUP_1 | KEY_1),
179 KEY(4, 0, GROUP_1 | KEY_2), 179 KEY(0, 4, GROUP_1 | KEY_2),
180 KEY(3, 0, GROUP_1 | KEY_3), 180 KEY(0, 3, GROUP_1 | KEY_3),
181 KEY(3, 4, GROUP_1 | KEY_4), 181 KEY(4, 3, GROUP_1 | KEY_4),
182 KEY(4, 4, GROUP_1 | KEY_5), 182 KEY(4, 4, GROUP_1 | KEY_5),
183 KEY(5, 4, GROUP_1 | KEY_KPASTERISK),/* "*" */ 183 KEY(4, 5, GROUP_1 | KEY_KPASTERISK),/* "*" */
184 KEY(4, 1, GROUP_1 | KEY_6), 184 KEY(1, 4, GROUP_1 | KEY_6),
185 KEY(5, 1, GROUP_1 | KEY_7), 185 KEY(1, 5, GROUP_1 | KEY_7),
186 KEY(3, 1, GROUP_1 | KEY_8), 186 KEY(1, 3, GROUP_1 | KEY_8),
187 KEY(3, 2, GROUP_1 | KEY_9), 187 KEY(2, 3, GROUP_1 | KEY_9),
188 KEY(5, 2, GROUP_1 | KEY_0), 188 KEY(2, 5, GROUP_1 | KEY_0),
189 KEY(4, 2, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */ 189 KEY(2, 4, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */
190 KEY(0, 1, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */ 190 KEY(1, 0, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */
191 KEY(1, 2, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */ 191 KEY(2, 1, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */
192 KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */ 192 KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */
193 KEY(2, 1, GROUP_1 | KEY_LEFTSHIFT), /* shift */ 193 KEY(1, 2, GROUP_1 | KEY_LEFTSHIFT), /* shift */
194 KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */ 194 KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */
195 KEY(0, 2, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */ 195 KEY(2, 0, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */
196 0
197}; 196};
198 197
199static struct resource sx1_kp_resources[] = { 198static struct resource sx1_kp_resources[] = {
@@ -204,11 +203,15 @@ static struct resource sx1_kp_resources[] = {
204 }, 203 },
205}; 204};
206 205
206static const struct matrix_keymap_data sx1_keymap_data = {
207 .keymap = sx1_keymap,
208 .keymap_size = ARRAY_SIZE(sx1_keymap),
209};
210
207static struct omap_kp_platform_data sx1_kp_data = { 211static struct omap_kp_platform_data sx1_kp_data = {
208 .rows = 6, 212 .rows = 6,
209 .cols = 6, 213 .cols = 6,
210 .keymap = sx1_keymap, 214 .keymap_data = &sx1_keymap_data,
211 .keymapsize = ARRAY_SIZE(sx1_keymap),
212 .delay = 80, 215 .delay = 80,
213}; 216};
214 217
@@ -409,7 +412,6 @@ static void __init omap_sx1_init_irq(void)
409{ 412{
410 omap1_init_common_hw(); 413 omap1_init_common_hw();
411 omap_init_irq(); 414 omap_init_irq();
412 omap_gpio_init();
413} 415}
414/*----------------------------------------*/ 416/*----------------------------------------*/
415 417
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index f5992c239bcd..815a69ce821d 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -83,6 +83,9 @@ static struct platform_device serial_device = {
83 83
84static int __init ext_uart_init(void) 84static int __init ext_uart_init(void)
85{ 85{
86 if (!machine_is_voiceblue())
87 return -ENODEV;
88
86 return platform_device_register(&serial_device); 89 return platform_device_register(&serial_device);
87} 90}
88arch_initcall(ext_uart_init); 91arch_initcall(ext_uart_init);
@@ -158,7 +161,6 @@ static void __init voiceblue_init_irq(void)
158{ 161{
159 omap1_init_common_hw(); 162 omap1_init_common_hw();
160 omap_init_irq(); 163 omap_init_irq();
161 omap_gpio_init();
162} 164}
163 165
164static void __init voiceblue_init(void) 166static void __init voiceblue_init(void)
@@ -236,6 +238,9 @@ static struct notifier_block panic_block = {
236 238
237static int __init voiceblue_setup(void) 239static int __init voiceblue_setup(void)
238{ 240{
241 if (!machine_is_voiceblue())
242 return -ENODEV;
243
239 /* Setup panic notifier */ 244 /* Setup panic notifier */
240 atomic_notifier_chain_register(&panic_notifier_list, &panic_block); 245 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
241 246
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index af54114b8f08..92400b9eb69f 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -143,7 +143,7 @@ static struct arm_idlect1_clk armper_ck = {
143 * activation. [ GPIO code for 1510 ] 143 * activation. [ GPIO code for 1510 ]
144 */ 144 */
145static struct clk arm_gpio_ck = { 145static struct clk arm_gpio_ck = {
146 .name = "arm_gpio_ck", 146 .name = "ick",
147 .ops = &clkops_generic, 147 .ops = &clkops_generic,
148 .parent = &ck_dpll1, 148 .parent = &ck_dpll1,
149 .flags = ENABLE_ON_INIT, 149 .flags = ENABLE_ON_INIT,
@@ -684,7 +684,7 @@ static struct omap_clk omap_clks[] = {
684 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), 684 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
685 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310), 685 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310),
686 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), 686 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
687 CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310), 687 CLK("omap_gpio.0", "ick", &arm_gpio_ck, CK_1510 | CK_310),
688 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX), 688 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
689 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310), 689 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310),
690 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310), 690 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310),
@@ -736,9 +736,9 @@ static struct omap_clk omap_clks[] = {
736 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX), 736 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX),
737 /* Virtual clocks */ 737 /* Virtual clocks */
738 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310), 738 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310),
739 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), 739 CLK("omap_i2c.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX),
740 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), 740 CLK("omap_i2c.1", "ick", &i2c_ick, CK_16XX),
741 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), 741 CLK("omap_i2c.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX),
742 CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX), 742 CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX),
743 CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX), 743 CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX),
744 CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX), 744 CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX),
@@ -823,12 +823,10 @@ int __init omap1_clk_init(void)
823 crystal_type = info->system_clock_type; 823 crystal_type = info->system_clock_type;
824 } 824 }
825 825
826#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 826 if (cpu_is_omap7xx())
827 ck_ref.rate = 13000000; 827 ck_ref.rate = 13000000;
828#elif defined(CONFIG_ARCH_OMAP16XX) 828 if (cpu_is_omap16xx() && crystal_type == 2)
829 if (crystal_type == 2)
830 ck_ref.rate = 19200000; 829 ck_ref.rate = 19200000;
831#endif
832 830
833 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: " 831 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: "
834 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), 832 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),
@@ -883,10 +881,11 @@ int __init omap1_clk_init(void)
883 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, 881 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
884 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); 882 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
885 883
886#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE) 884 if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
887 /* Select slicer output as OMAP input clock */ 885 /* Select slicer output as OMAP input clock */
888 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, OMAP7XX_PCC_UPLD_CTRL); 886 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1,
889#endif 887 OMAP7XX_PCC_UPLD_CTRL);
888 }
890 889
891 /* Amstrad Delta wants BCLK high when inactive */ 890 /* Amstrad Delta wants BCLK high when inactive */
892 if (machine_is_ams_delta()) 891 if (machine_is_ams_delta())
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index e7f9ee63dce5..b0f4c231595f 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -17,6 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19 19
20#include <mach/camera.h>
20#include <mach/hardware.h> 21#include <mach/hardware.h>
21#include <asm/mach/map.h> 22#include <asm/mach/map.h>
22 23
@@ -287,6 +288,9 @@ static inline void omap_init_audio(void) {}
287 */ 288 */
288static int __init omap1_init_devices(void) 289static int __init omap1_init_devices(void)
289{ 290{
291 if (!cpu_class_is_omap1())
292 return -ENODEV;
293
290 /* please keep these calls, and their implementations above, 294 /* please keep these calls, and their implementations above,
291 * in alphabetical order so they're easier to sort through. 295 * in alphabetical order so they're easier to sort through.
292 */ 296 */
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
new file mode 100644
index 000000000000..d8559344c6e2
--- /dev/null
+++ b/arch/arm/mach-omap1/dma.c
@@ -0,0 +1,390 @@
1/*
2 * OMAP1/OMAP7xx - specific DMA driver
3 *
4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
10 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
11 *
12 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
13 * Converted DMA library into platform driver
14 * - G, Manjunath Kondaiah <manjugk@ti.com>
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/err.h>
22#include <linux/io.h>
23#include <linux/slab.h>
24#include <linux/module.h>
25#include <linux/init.h>
26#include <linux/device.h>
27
28#include <plat/dma.h>
29#include <plat/tc.h>
30#include <plat/irqs.h>
31
32#define OMAP1_DMA_BASE (0xfffed800)
33#define OMAP1_LOGICAL_DMA_CH_COUNT 17
34#define OMAP1_DMA_STRIDE 0x40
35
36static u32 errata;
37static u32 enable_1510_mode;
38static u8 dma_stride;
39static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end;
40
41static u16 reg_map[] = {
42 [GCR] = 0x400,
43 [GSCR] = 0x404,
44 [GRST1] = 0x408,
45 [HW_ID] = 0x442,
46 [PCH2_ID] = 0x444,
47 [PCH0_ID] = 0x446,
48 [PCH1_ID] = 0x448,
49 [PCHG_ID] = 0x44a,
50 [PCHD_ID] = 0x44c,
51 [CAPS_0] = 0x44e,
52 [CAPS_1] = 0x452,
53 [CAPS_2] = 0x456,
54 [CAPS_3] = 0x458,
55 [CAPS_4] = 0x45a,
56 [PCH2_SR] = 0x460,
57 [PCH0_SR] = 0x480,
58 [PCH1_SR] = 0x482,
59 [PCHD_SR] = 0x4c0,
60
61 /* Common Registers */
62 [CSDP] = 0x00,
63 [CCR] = 0x02,
64 [CICR] = 0x04,
65 [CSR] = 0x06,
66 [CEN] = 0x10,
67 [CFN] = 0x12,
68 [CSFI] = 0x14,
69 [CSEI] = 0x16,
70 [CPC] = 0x18, /* 15xx only */
71 [CSAC] = 0x18,
72 [CDAC] = 0x1a,
73 [CDEI] = 0x1c,
74 [CDFI] = 0x1e,
75 [CLNK_CTRL] = 0x28,
76
77 /* Channel specific register offsets */
78 [CSSA] = 0x08,
79 [CDSA] = 0x0c,
80 [COLOR] = 0x20,
81 [CCR2] = 0x24,
82 [LCH_CTRL] = 0x2a,
83};
84
85static struct resource res[] __initdata = {
86 [0] = {
87 .start = OMAP1_DMA_BASE,
88 .end = OMAP1_DMA_BASE + SZ_2K - 1,
89 .flags = IORESOURCE_MEM,
90 },
91 [1] = {
92 .name = "0",
93 .start = INT_DMA_CH0_6,
94 .flags = IORESOURCE_IRQ,
95 },
96 [2] = {
97 .name = "1",
98 .start = INT_DMA_CH1_7,
99 .flags = IORESOURCE_IRQ,
100 },
101 [3] = {
102 .name = "2",
103 .start = INT_DMA_CH2_8,
104 .flags = IORESOURCE_IRQ,
105 },
106 [4] = {
107 .name = "3",
108 .start = INT_DMA_CH3,
109 .flags = IORESOURCE_IRQ,
110 },
111 [5] = {
112 .name = "4",
113 .start = INT_DMA_CH4,
114 .flags = IORESOURCE_IRQ,
115 },
116 [6] = {
117 .name = "5",
118 .start = INT_DMA_CH5,
119 .flags = IORESOURCE_IRQ,
120 },
121 /* Handled in lcd_dma.c */
122 [7] = {
123 .name = "6",
124 .start = INT_1610_DMA_CH6,
125 .flags = IORESOURCE_IRQ,
126 },
127 /* irq's for omap16xx and omap7xx */
128 [8] = {
129 .name = "7",
130 .start = INT_1610_DMA_CH7,
131 .flags = IORESOURCE_IRQ,
132 },
133 [9] = {
134 .name = "8",
135 .start = INT_1610_DMA_CH8,
136 .flags = IORESOURCE_IRQ,
137 },
138 [10] = {
139 .name = "9",
140 .start = INT_1610_DMA_CH9,
141 .flags = IORESOURCE_IRQ,
142 },
143 [11] = {
144 .name = "10",
145 .start = INT_1610_DMA_CH10,
146 .flags = IORESOURCE_IRQ,
147 },
148 [12] = {
149 .name = "11",
150 .start = INT_1610_DMA_CH11,
151 .flags = IORESOURCE_IRQ,
152 },
153 [13] = {
154 .name = "12",
155 .start = INT_1610_DMA_CH12,
156 .flags = IORESOURCE_IRQ,
157 },
158 [14] = {
159 .name = "13",
160 .start = INT_1610_DMA_CH13,
161 .flags = IORESOURCE_IRQ,
162 },
163 [15] = {
164 .name = "14",
165 .start = INT_1610_DMA_CH14,
166 .flags = IORESOURCE_IRQ,
167 },
168 [16] = {
169 .name = "15",
170 .start = INT_1610_DMA_CH15,
171 .flags = IORESOURCE_IRQ,
172 },
173 [17] = {
174 .name = "16",
175 .start = INT_DMA_LCD,
176 .flags = IORESOURCE_IRQ,
177 },
178};
179
180static void __iomem *dma_base;
181static inline void dma_write(u32 val, int reg, int lch)
182{
183 u8 stride;
184 u32 offset;
185
186 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
187 offset = reg_map[reg] + (stride * lch);
188
189 __raw_writew(val, dma_base + offset);
190 if ((reg > CLNK_CTRL && reg < CCEN) ||
191 (reg > PCHD_ID && reg < CAPS_2)) {
192 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
193 __raw_writew(val >> 16, dma_base + offset2);
194 }
195}
196
197static inline u32 dma_read(int reg, int lch)
198{
199 u8 stride;
200 u32 offset, val;
201
202 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
203 offset = reg_map[reg] + (stride * lch);
204
205 val = __raw_readw(dma_base + offset);
206 if ((reg > CLNK_CTRL && reg < CCEN) ||
207 (reg > PCHD_ID && reg < CAPS_2)) {
208 u16 upper;
209 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
210 upper = __raw_readw(dma_base + offset2);
211 val |= (upper << 16);
212 }
213 return val;
214}
215
216static void omap1_clear_lch_regs(int lch)
217{
218 int i = dma_common_ch_start;
219
220 for (; i <= dma_common_ch_end; i += 1)
221 dma_write(0, i, lch);
222}
223
224static void omap1_clear_dma(int lch)
225{
226 u32 l;
227
228 l = dma_read(CCR, lch);
229 l &= ~OMAP_DMA_CCR_EN;
230 dma_write(l, CCR, lch);
231
232 /* Clear pending interrupts */
233 l = dma_read(CSR, lch);
234}
235
236static void omap1_show_dma_caps(void)
237{
238 if (enable_1510_mode) {
239 printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
240 } else {
241 u16 w;
242 printk(KERN_INFO "OMAP DMA hardware version %d\n",
243 dma_read(HW_ID, 0));
244 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
245 dma_read(CAPS_0, 0), dma_read(CAPS_1, 0),
246 dma_read(CAPS_2, 0), dma_read(CAPS_3, 0),
247 dma_read(CAPS_4, 0));
248
249 /* Disable OMAP 3.0/3.1 compatibility mode. */
250 w = dma_read(GSCR, 0);
251 w |= 1 << 3;
252 dma_write(w, GSCR, 0);
253 }
254 return;
255}
256
257static u32 configure_dma_errata(void)
258{
259
260 /*
261 * Erratum 3.2/3.3: sometimes 0 is returned if CSAC/CDAC is
262 * read before the DMA controller finished disabling the channel.
263 */
264 if (!cpu_is_omap15xx())
265 SET_DMA_ERRATA(DMA_ERRATA_3_3);
266
267 return errata;
268}
269
270static int __init omap1_system_dma_init(void)
271{
272 struct omap_system_dma_plat_info *p;
273 struct omap_dma_dev_attr *d;
274 struct platform_device *pdev;
275 int ret;
276
277 pdev = platform_device_alloc("omap_dma_system", 0);
278 if (!pdev) {
279 pr_err("%s: Unable to device alloc for dma\n",
280 __func__);
281 return -ENOMEM;
282 }
283
284 dma_base = ioremap(res[0].start, resource_size(&res[0]));
285 if (!dma_base) {
286 pr_err("%s: Unable to ioremap\n", __func__);
287 return -ENODEV;
288 }
289
290 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
291 if (ret) {
292 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
293 __func__, pdev->name, pdev->id);
294 goto exit_device_del;
295 }
296
297 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
298 if (!p) {
299 dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
300 __func__, pdev->name);
301 ret = -ENOMEM;
302 goto exit_device_put;
303 }
304
305 d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
306 if (!d) {
307 dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n",
308 __func__, pdev->name);
309 ret = -ENOMEM;
310 goto exit_release_p;
311 }
312
313 d->lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
314
315 /* Valid attributes for omap1 plus processors */
316 if (cpu_is_omap15xx())
317 d->dev_caps = ENABLE_1510_MODE;
318 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
319
320 d->dev_caps |= SRC_PORT;
321 d->dev_caps |= DST_PORT;
322 d->dev_caps |= SRC_INDEX;
323 d->dev_caps |= DST_INDEX;
324 d->dev_caps |= IS_BURST_ONLY4;
325 d->dev_caps |= CLEAR_CSR_ON_READ;
326 d->dev_caps |= IS_WORD_16;
327
328
329 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
330 (d->lch_count), GFP_KERNEL);
331 if (!d->chan) {
332 dev_err(&pdev->dev, "%s: Memory allocation failed"
333 "for d->chan!!!\n", __func__);
334 goto exit_release_d;
335 }
336
337 if (cpu_is_omap15xx())
338 d->chan_count = 9;
339 else if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
340 if (!(d->dev_caps & ENABLE_1510_MODE))
341 d->chan_count = 16;
342 else
343 d->chan_count = 9;
344 }
345
346 p->dma_attr = d;
347
348 p->show_dma_caps = omap1_show_dma_caps;
349 p->clear_lch_regs = omap1_clear_lch_regs;
350 p->clear_dma = omap1_clear_dma;
351 p->dma_write = dma_write;
352 p->dma_read = dma_read;
353 p->disable_irq_lch = NULL;
354
355 p->errata = configure_dma_errata();
356
357 ret = platform_device_add_data(pdev, p, sizeof(*p));
358 if (ret) {
359 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
360 __func__, pdev->name, pdev->id);
361 goto exit_release_chan;
362 }
363
364 ret = platform_device_add(pdev);
365 if (ret) {
366 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
367 __func__, pdev->name, pdev->id);
368 goto exit_release_chan;
369 }
370
371 dma_stride = OMAP1_DMA_STRIDE;
372 dma_common_ch_start = CPC;
373 dma_common_ch_end = COLOR;
374
375 return ret;
376
377exit_release_chan:
378 kfree(d->chan);
379exit_release_d:
380 kfree(d);
381exit_release_p:
382 kfree(p);
383exit_device_put:
384 platform_device_put(pdev);
385exit_device_del:
386 platform_device_del(pdev);
387
388 return ret;
389}
390arch_initcall(omap1_system_dma_init);
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index 0b07a78eeaa7..acd161666408 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -11,6 +11,7 @@
11 11
12#include <plat/io.h> 12#include <plat/io.h>
13#include <plat/tc.h> 13#include <plat/tc.h>
14#include <plat/flash.h>
14 15
15void omap1_set_vpp(struct map_info *map, int enable) 16void omap1_set_vpp(struct map_info *map, int enable)
16{ 17{
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 5cfce1636da0..8780e75cdc3d 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -143,7 +143,7 @@ static struct irq_chip omap_fpga_irq = {
143 */ 143 */
144void omap1510_fpga_init_irq(void) 144void omap1510_fpga_init_irq(void)
145{ 145{
146 int i; 146 int i, res;
147 147
148 __raw_writeb(0, OMAP1510_FPGA_IMR_LO); 148 __raw_writeb(0, OMAP1510_FPGA_IMR_LO);
149 __raw_writeb(0, OMAP1510_FPGA_IMR_HI); 149 __raw_writeb(0, OMAP1510_FPGA_IMR_HI);
@@ -177,10 +177,12 @@ void omap1510_fpga_init_irq(void)
177 * NOTE: For general GPIO/MPUIO access and interrupts, please see 177 * NOTE: For general GPIO/MPUIO access and interrupts, please see
178 * gpio.[ch] 178 * gpio.[ch]
179 */ 179 */
180 gpio_request(13, "FPGA irq"); 180 res = gpio_request(13, "FPGA irq");
181 if (res) {
182 pr_err("%s failed to get gpio\n", __func__);
183 return;
184 }
181 gpio_direction_input(13); 185 gpio_direction_input(13);
182 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); 186 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
183 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); 187 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
184} 188}
185
186EXPORT_SYMBOL(omap1510_fpga_init_irq);
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
new file mode 100644
index 000000000000..04c4b04cf54e
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -0,0 +1,99 @@
1/*
2 * OMAP15xx specific gpio init
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20
21#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
22#define OMAP1510_GPIO_BASE 0xFFFCE000
23
24/* gpio1 */
25static struct __initdata resource omap15xx_mpu_gpio_resources[] = {
26 {
27 .start = OMAP1_MPUIO_VBASE,
28 .end = OMAP1_MPUIO_VBASE + SZ_2K - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 {
32 .start = INT_MPUIO,
33 .flags = IORESOURCE_IRQ,
34 },
35};
36
37static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
38 .virtual_irq_start = IH_MPUIO_BASE,
39 .bank_type = METHOD_MPUIO,
40 .bank_width = 16,
41 .bank_stride = 1,
42};
43
44static struct __initdata platform_device omap15xx_mpu_gpio = {
45 .name = "omap_gpio",
46 .id = 0,
47 .dev = {
48 .platform_data = &omap15xx_mpu_gpio_config,
49 },
50 .num_resources = ARRAY_SIZE(omap15xx_mpu_gpio_resources),
51 .resource = omap15xx_mpu_gpio_resources,
52};
53
54/* gpio2 */
55static struct __initdata resource omap15xx_gpio_resources[] = {
56 {
57 .start = OMAP1510_GPIO_BASE,
58 .end = OMAP1510_GPIO_BASE + SZ_2K - 1,
59 .flags = IORESOURCE_MEM,
60 },
61 {
62 .start = INT_GPIO_BANK1,
63 .flags = IORESOURCE_IRQ,
64 },
65};
66
67static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
68 .virtual_irq_start = IH_GPIO_BASE,
69 .bank_type = METHOD_GPIO_1510,
70 .bank_width = 16,
71};
72
73static struct __initdata platform_device omap15xx_gpio = {
74 .name = "omap_gpio",
75 .id = 1,
76 .dev = {
77 .platform_data = &omap15xx_gpio_config,
78 },
79 .num_resources = ARRAY_SIZE(omap15xx_gpio_resources),
80 .resource = omap15xx_gpio_resources,
81};
82
83/*
84 * omap15xx_gpio_init needs to be done before
85 * machine_init functions access gpio APIs.
86 * Hence omap15xx_gpio_init is a postcore_initcall.
87 */
88static int __init omap15xx_gpio_init(void)
89{
90 if (!cpu_is_omap15xx())
91 return -EINVAL;
92
93 platform_device_register(&omap15xx_mpu_gpio);
94 platform_device_register(&omap15xx_gpio);
95
96 gpio_bank_count = 2;
97 return 0;
98}
99postcore_initcall(omap15xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
new file mode 100644
index 000000000000..5dd0d4c82b24
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -0,0 +1,200 @@
1/*
2 * OMAP16xx specific gpio init
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20
21#define OMAP1610_GPIO1_BASE 0xfffbe400
22#define OMAP1610_GPIO2_BASE 0xfffbec00
23#define OMAP1610_GPIO3_BASE 0xfffbb400
24#define OMAP1610_GPIO4_BASE 0xfffbbc00
25#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
26
27/* mpu gpio */
28static struct __initdata resource omap16xx_mpu_gpio_resources[] = {
29 {
30 .start = OMAP1_MPUIO_VBASE,
31 .end = OMAP1_MPUIO_VBASE + SZ_2K - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 {
35 .start = INT_MPUIO,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
41 .virtual_irq_start = IH_MPUIO_BASE,
42 .bank_type = METHOD_MPUIO,
43 .bank_width = 16,
44 .bank_stride = 1,
45};
46
47static struct __initdata platform_device omap16xx_mpu_gpio = {
48 .name = "omap_gpio",
49 .id = 0,
50 .dev = {
51 .platform_data = &omap16xx_mpu_gpio_config,
52 },
53 .num_resources = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
54 .resource = omap16xx_mpu_gpio_resources,
55};
56
57/* gpio1 */
58static struct __initdata resource omap16xx_gpio1_resources[] = {
59 {
60 .start = OMAP1610_GPIO1_BASE,
61 .end = OMAP1610_GPIO1_BASE + SZ_2K - 1,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .start = INT_GPIO_BANK1,
66 .flags = IORESOURCE_IRQ,
67 },
68};
69
70static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
71 .virtual_irq_start = IH_GPIO_BASE,
72 .bank_type = METHOD_GPIO_1610,
73 .bank_width = 16,
74};
75
76static struct __initdata platform_device omap16xx_gpio1 = {
77 .name = "omap_gpio",
78 .id = 1,
79 .dev = {
80 .platform_data = &omap16xx_gpio1_config,
81 },
82 .num_resources = ARRAY_SIZE(omap16xx_gpio1_resources),
83 .resource = omap16xx_gpio1_resources,
84};
85
86/* gpio2 */
87static struct __initdata resource omap16xx_gpio2_resources[] = {
88 {
89 .start = OMAP1610_GPIO2_BASE,
90 .end = OMAP1610_GPIO2_BASE + SZ_2K - 1,
91 .flags = IORESOURCE_MEM,
92 },
93 {
94 .start = INT_1610_GPIO_BANK2,
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
100 .virtual_irq_start = IH_GPIO_BASE + 16,
101 .bank_type = METHOD_GPIO_1610,
102 .bank_width = 16,
103};
104
105static struct __initdata platform_device omap16xx_gpio2 = {
106 .name = "omap_gpio",
107 .id = 2,
108 .dev = {
109 .platform_data = &omap16xx_gpio2_config,
110 },
111 .num_resources = ARRAY_SIZE(omap16xx_gpio2_resources),
112 .resource = omap16xx_gpio2_resources,
113};
114
115/* gpio3 */
116static struct __initdata resource omap16xx_gpio3_resources[] = {
117 {
118 .start = OMAP1610_GPIO3_BASE,
119 .end = OMAP1610_GPIO3_BASE + SZ_2K - 1,
120 .flags = IORESOURCE_MEM,
121 },
122 {
123 .start = INT_1610_GPIO_BANK3,
124 .flags = IORESOURCE_IRQ,
125 },
126};
127
128static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
129 .virtual_irq_start = IH_GPIO_BASE + 32,
130 .bank_type = METHOD_GPIO_1610,
131 .bank_width = 16,
132};
133
134static struct __initdata platform_device omap16xx_gpio3 = {
135 .name = "omap_gpio",
136 .id = 3,
137 .dev = {
138 .platform_data = &omap16xx_gpio3_config,
139 },
140 .num_resources = ARRAY_SIZE(omap16xx_gpio3_resources),
141 .resource = omap16xx_gpio3_resources,
142};
143
144/* gpio4 */
145static struct __initdata resource omap16xx_gpio4_resources[] = {
146 {
147 .start = OMAP1610_GPIO4_BASE,
148 .end = OMAP1610_GPIO4_BASE + SZ_2K - 1,
149 .flags = IORESOURCE_MEM,
150 },
151 {
152 .start = INT_1610_GPIO_BANK4,
153 .flags = IORESOURCE_IRQ,
154 },
155};
156
157static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
158 .virtual_irq_start = IH_GPIO_BASE + 48,
159 .bank_type = METHOD_GPIO_1610,
160 .bank_width = 16,
161};
162
163static struct __initdata platform_device omap16xx_gpio4 = {
164 .name = "omap_gpio",
165 .id = 4,
166 .dev = {
167 .platform_data = &omap16xx_gpio4_config,
168 },
169 .num_resources = ARRAY_SIZE(omap16xx_gpio4_resources),
170 .resource = omap16xx_gpio4_resources,
171};
172
173static struct __initdata platform_device * omap16xx_gpio_dev[] = {
174 &omap16xx_mpu_gpio,
175 &omap16xx_gpio1,
176 &omap16xx_gpio2,
177 &omap16xx_gpio3,
178 &omap16xx_gpio4,
179};
180
181/*
182 * omap16xx_gpio_init needs to be done before
183 * machine_init functions access gpio APIs.
184 * Hence omap16xx_gpio_init is a postcore_initcall.
185 */
186static int __init omap16xx_gpio_init(void)
187{
188 int i;
189
190 if (!cpu_is_omap16xx())
191 return -EINVAL;
192
193 for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++)
194 platform_device_register(omap16xx_gpio_dev[i]);
195
196 gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev);
197
198 return 0;
199}
200postcore_initcall(omap16xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
new file mode 100644
index 000000000000..1204c8b871af
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -0,0 +1,262 @@
1/*
2 * OMAP7xx specific gpio init
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20
21#define OMAP7XX_GPIO1_BASE 0xfffbc000
22#define OMAP7XX_GPIO2_BASE 0xfffbc800
23#define OMAP7XX_GPIO3_BASE 0xfffbd000
24#define OMAP7XX_GPIO4_BASE 0xfffbd800
25#define OMAP7XX_GPIO5_BASE 0xfffbe000
26#define OMAP7XX_GPIO6_BASE 0xfffbe800
27#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
28
29/* mpu gpio */
30static struct __initdata resource omap7xx_mpu_gpio_resources[] = {
31 {
32 .start = OMAP1_MPUIO_VBASE,
33 .end = OMAP1_MPUIO_VBASE + SZ_2K - 1,
34 .flags = IORESOURCE_MEM,
35 },
36 {
37 .start = INT_7XX_MPUIO,
38 .flags = IORESOURCE_IRQ,
39 },
40};
41
42static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
43 .virtual_irq_start = IH_MPUIO_BASE,
44 .bank_type = METHOD_MPUIO,
45 .bank_width = 32,
46 .bank_stride = 2,
47};
48
49static struct __initdata platform_device omap7xx_mpu_gpio = {
50 .name = "omap_gpio",
51 .id = 0,
52 .dev = {
53 .platform_data = &omap7xx_mpu_gpio_config,
54 },
55 .num_resources = ARRAY_SIZE(omap7xx_mpu_gpio_resources),
56 .resource = omap7xx_mpu_gpio_resources,
57};
58
59/* gpio1 */
60static struct __initdata resource omap7xx_gpio1_resources[] = {
61 {
62 .start = OMAP7XX_GPIO1_BASE,
63 .end = OMAP7XX_GPIO1_BASE + SZ_2K - 1,
64 .flags = IORESOURCE_MEM,
65 },
66 {
67 .start = INT_7XX_GPIO_BANK1,
68 .flags = IORESOURCE_IRQ,
69 },
70};
71
72static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
73 .virtual_irq_start = IH_GPIO_BASE,
74 .bank_type = METHOD_GPIO_7XX,
75 .bank_width = 32,
76};
77
78static struct __initdata platform_device omap7xx_gpio1 = {
79 .name = "omap_gpio",
80 .id = 1,
81 .dev = {
82 .platform_data = &omap7xx_gpio1_config,
83 },
84 .num_resources = ARRAY_SIZE(omap7xx_gpio1_resources),
85 .resource = omap7xx_gpio1_resources,
86};
87
88/* gpio2 */
89static struct __initdata resource omap7xx_gpio2_resources[] = {
90 {
91 .start = OMAP7XX_GPIO2_BASE,
92 .end = OMAP7XX_GPIO2_BASE + SZ_2K - 1,
93 .flags = IORESOURCE_MEM,
94 },
95 {
96 .start = INT_7XX_GPIO_BANK2,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
102 .virtual_irq_start = IH_GPIO_BASE + 32,
103 .bank_type = METHOD_GPIO_7XX,
104 .bank_width = 32,
105};
106
107static struct __initdata platform_device omap7xx_gpio2 = {
108 .name = "omap_gpio",
109 .id = 2,
110 .dev = {
111 .platform_data = &omap7xx_gpio2_config,
112 },
113 .num_resources = ARRAY_SIZE(omap7xx_gpio2_resources),
114 .resource = omap7xx_gpio2_resources,
115};
116
117/* gpio3 */
118static struct __initdata resource omap7xx_gpio3_resources[] = {
119 {
120 .start = OMAP7XX_GPIO3_BASE,
121 .end = OMAP7XX_GPIO3_BASE + SZ_2K - 1,
122 .flags = IORESOURCE_MEM,
123 },
124 {
125 .start = INT_7XX_GPIO_BANK3,
126 .flags = IORESOURCE_IRQ,
127 },
128};
129
130static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
131 .virtual_irq_start = IH_GPIO_BASE + 64,
132 .bank_type = METHOD_GPIO_7XX,
133 .bank_width = 32,
134};
135
136static struct __initdata platform_device omap7xx_gpio3 = {
137 .name = "omap_gpio",
138 .id = 3,
139 .dev = {
140 .platform_data = &omap7xx_gpio3_config,
141 },
142 .num_resources = ARRAY_SIZE(omap7xx_gpio3_resources),
143 .resource = omap7xx_gpio3_resources,
144};
145
146/* gpio4 */
147static struct __initdata resource omap7xx_gpio4_resources[] = {
148 {
149 .start = OMAP7XX_GPIO4_BASE,
150 .end = OMAP7XX_GPIO4_BASE + SZ_2K - 1,
151 .flags = IORESOURCE_MEM,
152 },
153 {
154 .start = INT_7XX_GPIO_BANK4,
155 .flags = IORESOURCE_IRQ,
156 },
157};
158
159static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
160 .virtual_irq_start = IH_GPIO_BASE + 96,
161 .bank_type = METHOD_GPIO_7XX,
162 .bank_width = 32,
163};
164
165static struct __initdata platform_device omap7xx_gpio4 = {
166 .name = "omap_gpio",
167 .id = 4,
168 .dev = {
169 .platform_data = &omap7xx_gpio4_config,
170 },
171 .num_resources = ARRAY_SIZE(omap7xx_gpio4_resources),
172 .resource = omap7xx_gpio4_resources,
173};
174
175/* gpio5 */
176static struct __initdata resource omap7xx_gpio5_resources[] = {
177 {
178 .start = OMAP7XX_GPIO5_BASE,
179 .end = OMAP7XX_GPIO5_BASE + SZ_2K - 1,
180 .flags = IORESOURCE_MEM,
181 },
182 {
183 .start = INT_7XX_GPIO_BANK5,
184 .flags = IORESOURCE_IRQ,
185 },
186};
187
188static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
189 .virtual_irq_start = IH_GPIO_BASE + 128,
190 .bank_type = METHOD_GPIO_7XX,
191 .bank_width = 32,
192};
193
194static struct __initdata platform_device omap7xx_gpio5 = {
195 .name = "omap_gpio",
196 .id = 5,
197 .dev = {
198 .platform_data = &omap7xx_gpio5_config,
199 },
200 .num_resources = ARRAY_SIZE(omap7xx_gpio5_resources),
201 .resource = omap7xx_gpio5_resources,
202};
203
204/* gpio6 */
205static struct __initdata resource omap7xx_gpio6_resources[] = {
206 {
207 .start = OMAP7XX_GPIO6_BASE,
208 .end = OMAP7XX_GPIO6_BASE + SZ_2K - 1,
209 .flags = IORESOURCE_MEM,
210 },
211 {
212 .start = INT_7XX_GPIO_BANK6,
213 .flags = IORESOURCE_IRQ,
214 },
215};
216
217static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
218 .virtual_irq_start = IH_GPIO_BASE + 160,
219 .bank_type = METHOD_GPIO_7XX,
220 .bank_width = 32,
221};
222
223static struct __initdata platform_device omap7xx_gpio6 = {
224 .name = "omap_gpio",
225 .id = 6,
226 .dev = {
227 .platform_data = &omap7xx_gpio6_config,
228 },
229 .num_resources = ARRAY_SIZE(omap7xx_gpio6_resources),
230 .resource = omap7xx_gpio6_resources,
231};
232
233static struct __initdata platform_device * omap7xx_gpio_dev[] = {
234 &omap7xx_mpu_gpio,
235 &omap7xx_gpio1,
236 &omap7xx_gpio2,
237 &omap7xx_gpio3,
238 &omap7xx_gpio4,
239 &omap7xx_gpio5,
240 &omap7xx_gpio6,
241};
242
243/*
244 * omap7xx_gpio_init needs to be done before
245 * machine_init functions access gpio APIs.
246 * Hence omap7xx_gpio_init is a postcore_initcall.
247 */
248static int __init omap7xx_gpio_init(void)
249{
250 int i;
251
252 if (!cpu_is_omap7xx())
253 return -EINVAL;
254
255 for (i = 0; i < ARRAY_SIZE(omap7xx_gpio_dev); i++)
256 platform_device_register(omap7xx_gpio_dev[i]);
257
258 gpio_bank_count = ARRAY_SIZE(omap7xx_gpio_dev);
259
260 return 0;
261}
262postcore_initcall(omap7xx_gpio_init);
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
index df9060edda28..c9be6d4d83e2 100644
--- a/arch/arm/mach-omap1/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap1/include/mach/entry-macro.S
@@ -14,18 +14,17 @@
14#include <mach/irqs.h> 14#include <mach/irqs.h>
15#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
16 16
17#if (defined(CONFIG_ARCH_OMAP730)||defined(CONFIG_ARCH_OMAP850)) && \ 17/*
18 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)) 18 * We use __glue to avoid errors with multiple definitions of
19#error "FIXME: OMAP7XX doesn't support multiple-OMAP" 19 * .globl omap_irq_flags as it's included from entry-armv.S but not
20#elif defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 20 * from entry-common.S.
21#define INT_IH2_IRQ INT_7XX_IH2_IRQ 21 */
22#elif defined(CONFIG_ARCH_OMAP15XX) 22#ifdef __glue
23#define INT_IH2_IRQ INT_1510_IH2_IRQ 23 .pushsection .data
24#elif defined(CONFIG_ARCH_OMAP16XX) 24 .globl omap_irq_flags
25#define INT_IH2_IRQ INT_1610_IH2_IRQ 25omap_irq_flags:
26#else 26 .word 0
27#warning "IH2 IRQ defaulted" 27 .popsection
28#define INT_IH2_IRQ INT_1510_IH2_IRQ
29#endif 28#endif
30 29
31 .macro disable_fiq 30 .macro disable_fiq
@@ -47,9 +46,11 @@
47 beq 1510f 46 beq 1510f
48 47
49 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET] 48 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
49 ldr \tmp, =omap_irq_flags @ irq flags address
50 ldr \tmp, [\tmp, #0] @ irq flags value
50 cmp \irqnr, #0 51 cmp \irqnr, #0
51 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] 52 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
52 cmpeq \irqnr, #INT_IH2_IRQ 53 cmpeq \irqnr, \tmp
53 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE) 54 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
54 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] 55 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
55 addeqs \irqnr, \irqnr, #32 56 addeqs \irqnr, \irqnr, #32
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 0ce3fec2d257..870886a29594 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -142,3 +142,42 @@ void __init omap1_init_common_hw(void)
142 omap1_mux_init(); 142 omap1_mux_init();
143} 143}
144 144
145/*
146 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
147 */
148
149u8 omap_readb(u32 pa)
150{
151 return __raw_readb(OMAP1_IO_ADDRESS(pa));
152}
153EXPORT_SYMBOL(omap_readb);
154
155u16 omap_readw(u32 pa)
156{
157 return __raw_readw(OMAP1_IO_ADDRESS(pa));
158}
159EXPORT_SYMBOL(omap_readw);
160
161u32 omap_readl(u32 pa)
162{
163 return __raw_readl(OMAP1_IO_ADDRESS(pa));
164}
165EXPORT_SYMBOL(omap_readl);
166
167void omap_writeb(u8 v, u32 pa)
168{
169 __raw_writeb(v, OMAP1_IO_ADDRESS(pa));
170}
171EXPORT_SYMBOL(omap_writeb);
172
173void omap_writew(u16 v, u32 pa)
174{
175 __raw_writew(v, OMAP1_IO_ADDRESS(pa));
176}
177EXPORT_SYMBOL(omap_writew);
178
179void omap_writel(u32 v, u32 pa)
180{
181 __raw_writel(v, OMAP1_IO_ADDRESS(pa));
182}
183EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index db913c34d1fe..6bddbc869f4c 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -176,26 +176,31 @@ static struct irq_chip omap_irq_chip = {
176 176
177void __init omap_init_irq(void) 177void __init omap_init_irq(void)
178{ 178{
179 extern unsigned int omap_irq_flags;
179 int i, j; 180 int i, j;
180 181
181#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 182#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
182 if (cpu_is_omap7xx()) { 183 if (cpu_is_omap7xx()) {
184 omap_irq_flags = INT_7XX_IH2_IRQ;
183 irq_banks = omap7xx_irq_banks; 185 irq_banks = omap7xx_irq_banks;
184 irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks); 186 irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks);
185 } 187 }
186#endif 188#endif
187#ifdef CONFIG_ARCH_OMAP15XX 189#ifdef CONFIG_ARCH_OMAP15XX
188 if (cpu_is_omap1510()) { 190 if (cpu_is_omap1510()) {
191 omap_irq_flags = INT_1510_IH2_IRQ;
189 irq_banks = omap1510_irq_banks; 192 irq_banks = omap1510_irq_banks;
190 irq_bank_count = ARRAY_SIZE(omap1510_irq_banks); 193 irq_bank_count = ARRAY_SIZE(omap1510_irq_banks);
191 } 194 }
192 if (cpu_is_omap310()) { 195 if (cpu_is_omap310()) {
196 omap_irq_flags = INT_1510_IH2_IRQ;
193 irq_banks = omap310_irq_banks; 197 irq_banks = omap310_irq_banks;
194 irq_bank_count = ARRAY_SIZE(omap310_irq_banks); 198 irq_bank_count = ARRAY_SIZE(omap310_irq_banks);
195 } 199 }
196#endif 200#endif
197#if defined(CONFIG_ARCH_OMAP16XX) 201#if defined(CONFIG_ARCH_OMAP16XX)
198 if (cpu_is_omap16xx()) { 202 if (cpu_is_omap16xx()) {
203 omap_irq_flags = INT_1510_IH2_IRQ;
199 irq_banks = omap1610_irq_banks; 204 irq_banks = omap1610_irq_banks;
200 irq_bank_count = ARRAY_SIZE(omap1610_irq_banks); 205 irq_bank_count = ARRAY_SIZE(omap1610_irq_banks);
201 } 206 }
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index 3be11af687bb..c9088d85da04 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -424,6 +424,9 @@ static int __init omap_init_lcd_dma(void)
424{ 424{
425 int r; 425 int r;
426 426
427 if (!cpu_class_is_omap1())
428 return -ENODEV;
429
427 if (cpu_is_omap16xx()) { 430 if (cpu_is_omap16xx()) {
428 u16 w; 431 u16 w;
429 432
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 277f356d4cd0..22eb11dde9e7 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -17,6 +17,9 @@
17static int __init 17static int __init
18omap_leds_init(void) 18omap_leds_init(void)
19{ 19{
20 if (!cpu_class_is_omap1())
21 return -ENODEV;
22
20 if (machine_is_omap_innovator()) 23 if (machine_is_omap_innovator())
21 leds_event = innovator_leds_event; 24 leds_event = innovator_leds_event;
22 25
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 1a85a421007f..c0e1f48aa119 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -133,19 +133,18 @@ static struct omap_mbox1_priv omap1_mbox_dsp_priv = {
133 }, 133 },
134}; 134};
135 135
136struct omap_mbox mbox_dsp_info = { 136static struct omap_mbox mbox_dsp_info = {
137 .name = "dsp", 137 .name = "dsp",
138 .ops = &omap1_mbox_ops, 138 .ops = &omap1_mbox_ops,
139 .priv = &omap1_mbox_dsp_priv, 139 .priv = &omap1_mbox_dsp_priv,
140}; 140};
141 141
142struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL }; 142static struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
143 143
144static int __devinit omap1_mbox_probe(struct platform_device *pdev) 144static int __devinit omap1_mbox_probe(struct platform_device *pdev)
145{ 145{
146 struct resource *mem; 146 struct resource *mem;
147 int ret; 147 int ret;
148 int i;
149 struct omap_mbox **list; 148 struct omap_mbox **list;
150 149
151 list = omap1_mboxes; 150 list = omap1_mboxes;
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index b3a796a6da03..820973666f34 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -174,8 +174,11 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
174#define OMAP16XX_MCBSP_REG_NUM 0 174#define OMAP16XX_MCBSP_REG_NUM 0
175#endif 175#endif
176 176
177int __init omap1_mcbsp_init(void) 177static int __init omap1_mcbsp_init(void)
178{ 178{
179 if (!cpu_class_is_omap1())
180 return -ENODEV;
181
179 if (cpu_is_omap7xx()) { 182 if (cpu_is_omap7xx()) {
180 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; 183 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ;
181 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); 184 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16);
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 7835add00344..5fdef7a34828 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -343,7 +343,7 @@ MUX_CFG("Y14_1610_CCP_DATAM", 9, 21, 6, 2, 3, 1, 2, 0, 0)
343#define OMAP1XXX_PINS_SZ 0 343#define OMAP1XXX_PINS_SZ 0
344#endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */ 344#endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
345 345
346int __init_or_module omap1_cfg_reg(const struct pin_config *cfg) 346static int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
347{ 347{
348 static DEFINE_SPINLOCK(mux_spin_lock); 348 static DEFINE_SPINLOCK(mux_spin_lock);
349 unsigned long flags; 349 unsigned long flags;
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index b1d3f9fade23..0cca23a85175 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -661,6 +661,9 @@ static int __init omap_pm_init(void)
661 int error; 661 int error;
662#endif 662#endif
663 663
664 if (!cpu_class_is_omap1())
665 return -ENODEV;
666
664 printk("Power Management for TI OMAP.\n"); 667 printk("Power Management for TI OMAP.\n");
665 668
666 /* 669 /*
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 8b66392be745..6588c22b8a64 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -48,7 +48,6 @@ static int omap1_pm_runtime_suspend(struct device *dev)
48 48
49static int omap1_pm_runtime_resume(struct device *dev) 49static int omap1_pm_runtime_resume(struct device *dev)
50{ 50{
51 int ret = 0;
52 struct clk *iclk, *fclk; 51 struct clk *iclk, *fclk;
53 52
54 dev_dbg(dev, "%s\n", __func__); 53 dev_dbg(dev, "%s\n", __func__);
@@ -73,6 +72,9 @@ static int __init omap1_pm_runtime_init(void)
73 const struct dev_pm_ops *pm; 72 const struct dev_pm_ops *pm;
74 struct dev_pm_ops *omap_pm; 73 struct dev_pm_ops *omap_pm;
75 74
75 if (!cpu_class_is_omap1())
76 return -ENODEV;
77
76 pm = platform_bus_get_pm_ops(); 78 pm = platform_bus_get_pm_ops();
77 if (!pm) { 79 if (!pm) {
78 pr_err("%s: unable to get dev_pm_ops from platform_bus\n", 80 pr_err("%s: unable to get dev_pm_ops from platform_bus\n",
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index b78d0749f13d..550ca9d9991d 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -27,6 +27,8 @@
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <plat/fpga.h> 28#include <plat/fpga.h>
29 29
30#include "pm.h"
31
30static struct clk * uart1_ck; 32static struct clk * uart1_ck;
31static struct clk * uart2_ck; 33static struct clk * uart2_ck;
32static struct clk * uart3_ck; 34static struct clk * uart3_ck;
@@ -52,9 +54,11 @@ static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset,
52 */ 54 */
53static void __init omap_serial_reset(struct plat_serial8250_port *p) 55static void __init omap_serial_reset(struct plat_serial8250_port *p)
54{ 56{
55 omap_serial_outp(p, UART_OMAP_MDR1, 0x07); /* disable UART */ 57 omap_serial_outp(p, UART_OMAP_MDR1,
58 UART_OMAP_MDR1_DISABLE); /* disable UART */
56 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */ 59 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */
57 omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */ 60 omap_serial_outp(p, UART_OMAP_MDR1,
61 UART_OMAP_MDR1_16X_MODE); /* enable UART */
58 62
59 if (!cpu_is_omap15xx()) { 63 if (!cpu_is_omap15xx()) {
60 omap_serial_outp(p, UART_OMAP_SYSC, 0x01); 64 omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
@@ -254,6 +258,9 @@ late_initcall(omap_serial_wakeup_init);
254 258
255static int __init omap_init(void) 259static int __init omap_init(void)
256{ 260{
261 if (!cpu_class_is_omap1())
262 return -ENODEV;
263
257 return platform_device_register(&serial_device); 264 return platform_device_register(&serial_device);
258} 265}
259arch_initcall(omap_init); 266arch_initcall(omap_init);
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index abb34ff2041b..ed7a61ff916a 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -52,6 +52,7 @@
52#include <asm/mach/irq.h> 52#include <asm/mach/irq.h>
53#include <asm/mach/time.h> 53#include <asm/mach/time.h>
54 54
55#include <plat/common.h>
55 56
56#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE 57#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
57#define OMAP_MPU_TIMER_OFFSET 0x100 58#define OMAP_MPU_TIMER_OFFSET 0x100
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ab784bfde908..3e8c9e859f98 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -15,7 +15,7 @@ config ARCH_OMAP2PLUS_TYPICAL
15 select SERIAL_OMAP_CONSOLE 15 select SERIAL_OMAP_CONSOLE
16 select I2C 16 select I2C
17 select I2C_OMAP 17 select I2C_OMAP
18 select MFD 18 select MFD_SUPPORT
19 select MENELAUS if ARCH_OMAP2 19 select MENELAUS if ARCH_OMAP2
20 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 20 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
21 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 21 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
@@ -35,6 +35,8 @@ config ARCH_OMAP3
35 select CPU_V7 35 select CPU_V7
36 select USB_ARCH_HAS_EHCI 36 select USB_ARCH_HAS_EHCI
37 select ARM_L1_CACHE_SHIFT_6 if !ARCH_OMAP4 37 select ARM_L1_CACHE_SHIFT_6 if !ARCH_OMAP4
38 select ARCH_HAS_OPP
39 select PM_OPP if PM
38 40
39config ARCH_OMAP4 41config ARCH_OMAP4
40 bool "TI OMAP4" 42 bool "TI OMAP4"
@@ -44,6 +46,8 @@ config ARCH_OMAP4
44 select ARM_GIC 46 select ARM_GIC
45 select PL310_ERRATA_588369 47 select PL310_ERRATA_588369
46 select ARM_ERRATA_720789 48 select ARM_ERRATA_720789
49 select ARCH_HAS_OPP
50 select PM_OPP if PM
47 51
48comment "OMAP Core Type" 52comment "OMAP Core Type"
49 depends on ARCH_OMAP2 53 depends on ARCH_OMAP2
@@ -85,6 +89,12 @@ config OMAP_PACKAGE_CUS
85config OMAP_PACKAGE_CBP 89config OMAP_PACKAGE_CBP
86 bool 90 bool
87 91
92config OMAP_PACKAGE_CBL
93 bool
94
95config OMAP_PACKAGE_CBS
96 bool
97
88comment "OMAP Board Type" 98comment "OMAP Board Type"
89 depends on ARCH_OMAP2PLUS 99 depends on ARCH_OMAP2PLUS
90 100
@@ -128,7 +138,6 @@ config MACH_DEVKIT8000
128 depends on ARCH_OMAP3 138 depends on ARCH_OMAP3
129 default y 139 default y
130 select OMAP_PACKAGE_CUS 140 select OMAP_PACKAGE_CUS
131 select OMAP_MUX
132 141
133config MACH_OMAP_LDP 142config MACH_OMAP_LDP
134 bool "OMAP3 LDP board" 143 bool "OMAP3 LDP board"
@@ -174,11 +183,17 @@ config MACH_OMAP3517EVM
174 default y 183 default y
175 select OMAP_PACKAGE_CBB 184 select OMAP_PACKAGE_CBB
176 185
186config MACH_CRANEBOARD
187 bool "AM3517/05 CRANE board"
188 depends on ARCH_OMAP3
189 select OMAP_PACKAGE_CBB
190
177config MACH_OMAP3_PANDORA 191config MACH_OMAP3_PANDORA
178 bool "OMAP3 Pandora" 192 bool "OMAP3 Pandora"
179 depends on ARCH_OMAP3 193 depends on ARCH_OMAP3
180 default y 194 default y
181 select OMAP_PACKAGE_CBB 195 select OMAP_PACKAGE_CBB
196 select REGULATOR_FIXED_VOLTAGE
182 197
183config MACH_OMAP3_TOUCHBOOK 198config MACH_OMAP3_TOUCHBOOK
184 bool "OMAP3 Touch Book" 199 bool "OMAP3 Touch Book"
@@ -210,6 +225,12 @@ config MACH_NOKIA_N8X0
210 select MACH_NOKIA_N810 225 select MACH_NOKIA_N810
211 select MACH_NOKIA_N810_WIMAX 226 select MACH_NOKIA_N810_WIMAX
212 227
228config MACH_NOKIA_RM680
229 bool "Nokia RM-680 board"
230 depends on ARCH_OMAP3
231 default y
232 select OMAP_PACKAGE_CBB
233
213config MACH_NOKIA_RX51 234config MACH_NOKIA_RX51
214 bool "Nokia RX-51 board" 235 bool "Nokia RX-51 board"
215 depends on ARCH_OMAP3 236 depends on ARCH_OMAP3
@@ -224,6 +245,7 @@ config MACH_OMAP_ZOOM2
224 select SERIAL_8250 245 select SERIAL_8250
225 select SERIAL_CORE_CONSOLE 246 select SERIAL_CORE_CONSOLE
226 select SERIAL_8250_CONSOLE 247 select SERIAL_8250_CONSOLE
248 select REGULATOR_FIXED_VOLTAGE
227 249
228config MACH_OMAP_ZOOM3 250config MACH_OMAP_ZOOM3
229 bool "OMAP3630 Zoom3 board" 251 bool "OMAP3630 Zoom3 board"
@@ -233,20 +255,19 @@ config MACH_OMAP_ZOOM3
233 select SERIAL_8250 255 select SERIAL_8250
234 select SERIAL_CORE_CONSOLE 256 select SERIAL_CORE_CONSOLE
235 select SERIAL_8250_CONSOLE 257 select SERIAL_8250_CONSOLE
258 select REGULATOR_FIXED_VOLTAGE
236 259
237config MACH_CM_T35 260config MACH_CM_T35
238 bool "CompuLab CM-T35 module" 261 bool "CompuLab CM-T35 module"
239 depends on ARCH_OMAP3 262 depends on ARCH_OMAP3
240 default y 263 default y
241 select OMAP_PACKAGE_CUS 264 select OMAP_PACKAGE_CUS
242 select OMAP_MUX
243 265
244config MACH_CM_T3517 266config MACH_CM_T3517
245 bool "CompuLab CM-T3517 module" 267 bool "CompuLab CM-T3517 module"
246 depends on ARCH_OMAP3 268 depends on ARCH_OMAP3
247 default y 269 default y
248 select OMAP_PACKAGE_CBB 270 select OMAP_PACKAGE_CBB
249 select OMAP_MUX
250 271
251config MACH_IGEP0020 272config MACH_IGEP0020
252 bool "IGEP v2 board" 273 bool "IGEP v2 board"
@@ -265,7 +286,6 @@ config MACH_SBC3530
265 depends on ARCH_OMAP3 286 depends on ARCH_OMAP3
266 default y 287 default y
267 select OMAP_PACKAGE_CUS 288 select OMAP_PACKAGE_CUS
268 select OMAP_MUX
269 289
270config MACH_OMAP_3630SDP 290config MACH_OMAP_3630SDP
271 bool "OMAP3630 SDP board" 291 bool "OMAP3630 SDP board"
@@ -277,11 +297,15 @@ config MACH_OMAP_4430SDP
277 bool "OMAP 4430 SDP board" 297 bool "OMAP 4430 SDP board"
278 default y 298 default y
279 depends on ARCH_OMAP4 299 depends on ARCH_OMAP4
300 select OMAP_PACKAGE_CBL
301 select OMAP_PACKAGE_CBS
280 302
281config MACH_OMAP4_PANDA 303config MACH_OMAP4_PANDA
282 bool "OMAP4 Panda Board" 304 bool "OMAP4 Panda Board"
283 default y 305 default y
284 depends on ARCH_OMAP4 306 depends on ARCH_OMAP4
307 select OMAP_PACKAGE_CBL
308 select OMAP_PACKAGE_CBS
285 309
286config OMAP3_EMU 310config OMAP3_EMU
287 bool "OMAP3 debugging peripherals" 311 bool "OMAP3 debugging peripherals"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 60e51bcf53bd..4ab82f6f15b1 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,30 +4,31 @@
4 4
5# Common support 5# Common support
6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \ 6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
7 common.o 7 common.o gpio.o dma.o wd_timer.o
8 8
9omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o 9omap-2-3-common = irq.o sdrc.o
10hwmod-common = omap_hwmod.o \ 10hwmod-common = omap_hwmod.o \
11 omap_hwmod_common_data.o 11 omap_hwmod_common_data.o
12prcm-common = prcm.o powerdomain.o
13clock-common = clock.o clock_common_data.o \ 12clock-common = clock.o clock_common_data.o \
14 clockdomain.o clkt_dpll.o \ 13 clkt_dpll.o clkt_clksel.o
15 clkt_clksel.o
16 14
17obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) 15obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
18obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) 16obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
19obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) prm44xx.o $(hwmod-common) 17obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
20 18
21obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 19obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
22 20
21obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
22
23# SMP support ONLY available for OMAP4 23# SMP support ONLY available for OMAP4
24obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o 24obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o
25obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o 25obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o
26obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o 26obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o
27obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o 27obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o
28 28
29AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a 29plus_sec := $(call as-instr,.arch_extension sec,+sec)
30AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a 30AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
31AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec)
31 32
32# Functions loaded to SRAM 33# Functions loaded to SRAM
33obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o 34obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o
@@ -42,18 +43,29 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
42obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o 43obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o
43obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o 44obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o
44obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o 45obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o
46obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o
45 47
46# SMS/SDRC 48# SMS/SDRC
47obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o 49obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
48# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o 50# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o
49 51
52# OPP table initialization
53ifeq ($(CONFIG_PM_OPP),y)
54obj-y += opp.o
55obj-$(CONFIG_ARCH_OMAP3) += opp3xxx_data.o
56obj-$(CONFIG_ARCH_OMAP4) += opp4xxx_data.o
57endif
58
50# Power Management 59# Power Management
51ifeq ($(CONFIG_PM),y) 60ifeq ($(CONFIG_PM),y)
52obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o 61obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
53obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o 62obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o voltage.o
54obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o pm_bus.o 63obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \
55obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o 64 cpuidle34xx.o pm_bus.o
65obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o
56obj-$(CONFIG_PM_DEBUG) += pm-debug.o 66obj-$(CONFIG_PM_DEBUG) += pm-debug.o
67obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o
68obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
57 69
58AFLAGS_sleep24xx.o :=-Wa,-march=armv6 70AFLAGS_sleep24xx.o :=-Wa,-march=armv6
59AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a 71AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a
@@ -65,10 +77,36 @@ endif
65endif 77endif
66 78
67# PRCM 79# PRCM
68obj-$(CONFIG_ARCH_OMAP2) += cm.o 80obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
69obj-$(CONFIG_ARCH_OMAP3) += cm.o 81obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
70obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o 82# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
71 83# will be removed once the OMAP4 part of the codebase is converted to
84# use OMAP4-specific PRCM functions.
85obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \
86 cm44xx.o prcm_mpu44xx.o \
87 prminst44xx.o
88
89# OMAP powerdomain framework
90powerdomain-common += powerdomain.o powerdomain-common.o
91obj-$(CONFIG_ARCH_OMAP2) += $(powerdomain-common) \
92 powerdomain2xxx_3xxx.o \
93 powerdomains2xxx_data.o \
94 powerdomains2xxx_3xxx_data.o
95obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common) \
96 powerdomain2xxx_3xxx.o \
97 powerdomains3xxx_data.o \
98 powerdomains2xxx_3xxx_data.o
99obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
100 powerdomain44xx.o \
101 powerdomains44xx_data.o
102
103# PRCM clockdomain control
104obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
105 clockdomains2xxx_3xxx_data.o
106obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
107 clockdomains2xxx_3xxx_data.o
108obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
109 clockdomains44xx_data.o
72# Clock framework 110# Clock framework
73obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ 111obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
74 clkt2xxx_sys.o \ 112 clkt2xxx_sys.o \
@@ -139,17 +177,20 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
139 hsmmc.o \ 177 hsmmc.o \
140 board-flash.o 178 board-flash.o
141obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o 179obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
180obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
181 sdram-nokia.o \
182 hsmmc.o
142obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 183obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
143 board-rx51-sdram.o \ 184 sdram-nokia.o \
144 board-rx51-peripherals.o \ 185 board-rx51-peripherals.o \
145 board-rx51-video.o \ 186 board-rx51-video.o \
146 hsmmc.o 187 hsmmc.o
147obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ 188obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom.o \
148 board-zoom-peripherals.o \ 189 board-zoom-peripherals.o \
149 board-flash.o \ 190 board-flash.o \
150 hsmmc.o \ 191 hsmmc.o \
151 board-zoom-debugboard.o 192 board-zoom-debugboard.o
152obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ 193obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom.o \
153 board-zoom-peripherals.o \ 194 board-zoom-peripherals.o \
154 board-flash.o \ 195 board-flash.o \
155 hsmmc.o \ 196 hsmmc.o \
@@ -174,6 +215,8 @@ obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
174 215
175obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o 216obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
176 217
218obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o
219
177obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ 220obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
178 hsmmc.o 221 hsmmc.o
179# Platform specific device init code 222# Platform specific device init code
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index b527f8d187ad..e0661777f599 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -135,7 +135,7 @@ static inline void board_smc91x_init(void)
135 135
136#endif 136#endif
137 137
138static struct omap_board_config_kernel sdp2430_config[] = { 138static struct omap_board_config_kernel sdp2430_config[] __initdata = {
139 {OMAP_TAG_LCD, &sdp2430_lcd_config}, 139 {OMAP_TAG_LCD, &sdp2430_lcd_config},
140}; 140};
141 141
@@ -143,9 +143,9 @@ static void __init omap_2430sdp_init_irq(void)
143{ 143{
144 omap_board_config = sdp2430_config; 144 omap_board_config = sdp2430_config;
145 omap_board_config_size = ARRAY_SIZE(sdp2430_config); 145 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
146 omap2_init_common_hw(NULL, NULL); 146 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL);
147 omap_init_irq(); 148 omap_init_irq();
148 omap_gpio_init();
149} 149}
150 150
151static struct twl4030_gpio_platform_data sdp2430_gpio_data = { 151static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
@@ -218,8 +218,6 @@ static struct omap_usb_config sdp2430_usb_config __initdata = {
218static struct omap_board_mux board_mux[] __initdata = { 218static struct omap_board_mux board_mux[] __initdata = {
219 { .reg_offset = OMAP_MUX_TERMINATOR }, 219 { .reg_offset = OMAP_MUX_TERMINATOR },
220}; 220};
221#else
222#define board_mux NULL
223#endif 221#endif
224 222
225static void __init omap_2430sdp_init(void) 223static void __init omap_2430sdp_init(void)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 4e3742c512b8..3b39ef1a680a 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -326,9 +326,9 @@ static void __init omap_3430sdp_init_irq(void)
326 omap_board_config = sdp3430_config; 326 omap_board_config = sdp3430_config;
327 omap_board_config_size = ARRAY_SIZE(sdp3430_config); 327 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
328 omap3_pm_init_cpuidle(omap3_cpuidle_params_table); 328 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
329 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL); 329 omap2_init_common_infrastructure();
330 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
330 omap_init_irq(); 331 omap_init_irq();
331 omap_gpio_init();
332} 332}
333 333
334static int sdp3430_batt_table[] = { 334static int sdp3430_batt_table[] = {
@@ -663,8 +663,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
663static struct omap_board_mux board_mux[] __initdata = { 663static struct omap_board_mux board_mux[] __initdata = {
664 { .reg_offset = OMAP_MUX_TERMINATOR }, 664 { .reg_offset = OMAP_MUX_TERMINATOR },
665}; 665};
666#else
667#define board_mux NULL
668#endif 666#endif
669 667
670/* 668/*
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index bbcf580fa097..5d41dbe059a3 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -73,18 +73,16 @@ static void __init omap_sdp_init_irq(void)
73{ 73{
74 omap_board_config = sdp_config; 74 omap_board_config = sdp_config;
75 omap_board_config_size = ARRAY_SIZE(sdp_config); 75 omap_board_config_size = ARRAY_SIZE(sdp_config);
76 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params, 76 omap2_init_common_infrastructure();
77 h8mbx00u0mer0em_sdrc_params); 77 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
78 h8mbx00u0mer0em_sdrc_params);
78 omap_init_irq(); 79 omap_init_irq();
79 omap_gpio_init();
80} 80}
81 81
82#ifdef CONFIG_OMAP_MUX 82#ifdef CONFIG_OMAP_MUX
83static struct omap_board_mux board_mux[] __initdata = { 83static struct omap_board_mux board_mux[] __initdata = {
84 { .reg_offset = OMAP_MUX_TERMINATOR }, 84 { .reg_offset = OMAP_MUX_TERMINATOR },
85}; 85};
86#else
87#define board_mux NULL
88#endif 86#endif
89 87
90/* 88/*
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index df5a425a49d1..1cb208b6e626 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -23,6 +23,7 @@
23#include <linux/gpio_keys.h> 23#include <linux/gpio_keys.h>
24#include <linux/regulator/machine.h> 24#include <linux/regulator/machine.h>
25#include <linux/leds.h> 25#include <linux/leds.h>
26#include <linux/leds_pwm.h>
26 27
27#include <mach/hardware.h> 28#include <mach/hardware.h>
28#include <mach/omap4-common.h> 29#include <mach/omap4-common.h>
@@ -35,6 +36,7 @@
35#include <plat/usb.h> 36#include <plat/usb.h>
36#include <plat/mmc.h> 37#include <plat/mmc.h>
37 38
39#include "mux.h"
38#include "hsmmc.h" 40#include "hsmmc.h"
39#include "timer-gp.h" 41#include "timer-gp.h"
40#include "control.h" 42#include "control.h"
@@ -96,6 +98,28 @@ static struct gpio_led_platform_data sdp4430_led_data = {
96 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), 98 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
97}; 99};
98 100
101static struct led_pwm sdp4430_pwm_leds[] = {
102 {
103 .name = "omap4:green:chrg",
104 .pwm_id = 1,
105 .max_brightness = 255,
106 .pwm_period_ns = 7812500,
107 },
108};
109
110static struct led_pwm_platform_data sdp4430_pwm_data = {
111 .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
112 .leds = sdp4430_pwm_leds,
113};
114
115static struct platform_device sdp4430_leds_pwm = {
116 .name = "leds_pwm",
117 .id = -1,
118 .dev = {
119 .platform_data = &sdp4430_pwm_data,
120 },
121};
122
99static int omap_prox_activate(struct device *dev) 123static int omap_prox_activate(struct device *dev)
100{ 124{
101 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); 125 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
@@ -203,6 +227,7 @@ static struct platform_device *sdp4430_devices[] __initdata = {
203 &sdp4430_lcd_device, 227 &sdp4430_lcd_device,
204 &sdp4430_gpio_keys_device, 228 &sdp4430_gpio_keys_device,
205 &sdp4430_leds_gpio, 229 &sdp4430_leds_gpio,
230 &sdp4430_leds_pwm,
206}; 231};
207 232
208static struct omap_lcd_config sdp4430_lcd_config __initdata = { 233static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@ -217,12 +242,12 @@ static void __init omap_4430sdp_init_irq(void)
217{ 242{
218 omap_board_config = sdp4430_config; 243 omap_board_config = sdp4430_config;
219 omap_board_config_size = ARRAY_SIZE(sdp4430_config); 244 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
220 omap2_init_common_hw(NULL, NULL); 245 omap2_init_common_infrastructure();
246 omap2_init_common_devices(NULL, NULL);
221#ifdef CONFIG_OMAP_32K_TIMER 247#ifdef CONFIG_OMAP_32K_TIMER
222 omap2_gp_clockevent_set_gptimer(1); 248 omap2_gp_clockevent_set_gptimer(1);
223#endif 249#endif
224 gic_init_irq(); 250 gic_init_irq();
225 omap_gpio_init();
226} 251}
227 252
228static struct omap_musb_board_data musb_board_data = { 253static struct omap_musb_board_data musb_board_data = {
@@ -464,6 +489,9 @@ static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
464 { 489 {
465 I2C_BOARD_INFO("tmp105", 0x48), 490 I2C_BOARD_INFO("tmp105", 0x48),
466 }, 491 },
492 {
493 I2C_BOARD_INFO("bh1780", 0x29),
494 },
467}; 495};
468static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { 496static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
469 { 497 {
@@ -505,9 +533,22 @@ static void __init omap_sfh7741prox_init(void)
505 } 533 }
506} 534}
507 535
536#ifdef CONFIG_OMAP_MUX
537static struct omap_board_mux board_mux[] __initdata = {
538 { .reg_offset = OMAP_MUX_TERMINATOR },
539};
540#else
541#define board_mux NULL
542#endif
543
508static void __init omap_4430sdp_init(void) 544static void __init omap_4430sdp_init(void)
509{ 545{
510 int status; 546 int status;
547 int package = OMAP_PACKAGE_CBS;
548
549 if (omap_rev() == OMAP4430_REV_ES1_0)
550 package = OMAP_PACKAGE_CBL;
551 omap4_mux_init(board_mux, package);
511 552
512 omap4_i2c_init(); 553 omap4_i2c_init();
513 omap_sfh7741prox_init(); 554 omap_sfh7741prox_init();
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
new file mode 100644
index 000000000000..71acb5ab281c
--- /dev/null
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -0,0 +1,116 @@
1/*
2 * Support for AM3517/05 Craneboard
3 * http://www.mistralsolutions.com/products/craneboard.php
4 *
5 * Copyright (C) 2010 Mistral Solutions Pvt Ltd. <www.mistralsolutions.com>
6 * Author: R.Srinath <srinath@mistralsolutions.com>
7 *
8 * Based on mach-omap2/board-am3517evm.c
9 *
10 * 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
12 * Free Software Foundation version 2.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/gpio.h>
23
24#include <mach/hardware.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28
29#include <plat/board.h>
30#include <plat/common.h>
31#include <plat/usb.h>
32
33#include "mux.h"
34#include "control.h"
35
36#define GPIO_USB_POWER 35
37#define GPIO_USB_NRESET 38
38
39
40/* Board initialization */
41static struct omap_board_config_kernel am3517_crane_config[] __initdata = {
42};
43
44#ifdef CONFIG_OMAP_MUX
45static struct omap_board_mux board_mux[] __initdata = {
46 { .reg_offset = OMAP_MUX_TERMINATOR },
47};
48#else
49#define board_mux NULL
50#endif
51
52static void __init am3517_crane_init_irq(void)
53{
54 omap_board_config = am3517_crane_config;
55 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
56
57 omap2_init_common_infrastructure();
58 omap2_init_common_devices(NULL, NULL);
59 omap_init_irq();
60}
61
62static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
63 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
64 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
65 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
66
67 .phy_reset = true,
68 .reset_gpio_port[0] = GPIO_USB_NRESET,
69 .reset_gpio_port[1] = -EINVAL,
70 .reset_gpio_port[2] = -EINVAL
71};
72
73static void __init am3517_crane_init(void)
74{
75 int ret;
76
77 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
78 omap_serial_init();
79
80 /* Configure GPIO for EHCI port */
81 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
82 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n",
83 GPIO_USB_NRESET);
84 return;
85 }
86
87 if (omap_mux_init_gpio(GPIO_USB_POWER, OMAP_PIN_OUTPUT)) {
88 pr_err("Can not configure mux for GPIO_USB_POWER %d\n",
89 GPIO_USB_POWER);
90 return;
91 }
92
93 ret = gpio_request(GPIO_USB_POWER, "usb_ehci_enable");
94 if (ret < 0) {
95 pr_err("Can not request GPIO %d\n", GPIO_USB_POWER);
96 return;
97 }
98
99 ret = gpio_direction_output(GPIO_USB_POWER, 1);
100 if (ret < 0) {
101 gpio_free(GPIO_USB_POWER);
102 pr_err("Unable to initialize EHCI power\n");
103 return;
104 }
105
106 usb_ehci_init(&ehci_pdata);
107}
108
109MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
110 .boot_params = 0x80000100,
111 .map_io = omap3_map_io,
112 .reserve = omap_reserve,
113 .init_irq = am3517_crane_init_irq,
114 .init_machine = am3517_crane_init,
115 .timer = &omap_timer,
116MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 07399505312b..bc1562648020 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -389,10 +389,9 @@ static void __init am3517_evm_init_irq(void)
389{ 389{
390 omap_board_config = am3517_evm_config; 390 omap_board_config = am3517_evm_config;
391 omap_board_config_size = ARRAY_SIZE(am3517_evm_config); 391 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
392 392 omap2_init_common_infrastructure();
393 omap2_init_common_hw(NULL, NULL); 393 omap2_init_common_devices(NULL, NULL);
394 omap_init_irq(); 394 omap_init_irq();
395 omap_gpio_init();
396} 395}
397 396
398static struct omap_musb_board_data musb_board_data = { 397static struct omap_musb_board_data musb_board_data = {
@@ -442,8 +441,6 @@ static struct omap_board_mux board_mux[] __initdata = {
442 OMAP3_MUX(SAD2D_MCAD23, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), 441 OMAP3_MUX(SAD2D_MCAD23, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
443 { .reg_offset = OMAP_MUX_TERMINATOR }, 442 { .reg_offset = OMAP_MUX_TERMINATOR },
444}; 443};
445#else
446#define board_mux NULL
447#endif 444#endif
448 445
449 446
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 2c6db1aaeb29..9f55b68687f7 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -270,7 +270,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = {
270 .ctrl_name = "internal", 270 .ctrl_name = "internal",
271}; 271};
272 272
273static struct omap_board_config_kernel apollon_config[] = { 273static struct omap_board_config_kernel apollon_config[] __initdata = {
274 { OMAP_TAG_LCD, &apollon_lcd_config }, 274 { OMAP_TAG_LCD, &apollon_lcd_config },
275}; 275};
276 276
@@ -278,10 +278,9 @@ static void __init omap_apollon_init_irq(void)
278{ 278{
279 omap_board_config = apollon_config; 279 omap_board_config = apollon_config;
280 omap_board_config_size = ARRAY_SIZE(apollon_config); 280 omap_board_config_size = ARRAY_SIZE(apollon_config);
281 omap2_init_common_hw(NULL, NULL); 281 omap2_init_common_infrastructure();
282 omap2_init_common_devices(NULL, NULL);
282 omap_init_irq(); 283 omap_init_irq();
283 omap_gpio_init();
284 apollon_init_smc91x();
285} 284}
286 285
287static void __init apollon_led_init(void) 286static void __init apollon_led_init(void)
@@ -314,8 +313,6 @@ static void __init apollon_usb_init(void)
314static struct omap_board_mux board_mux[] __initdata = { 313static struct omap_board_mux board_mux[] __initdata = {
315 { .reg_offset = OMAP_MUX_TERMINATOR }, 314 { .reg_offset = OMAP_MUX_TERMINATOR },
316}; 315};
317#else
318#define board_mux NULL
319#endif 316#endif
320 317
321static void __init omap_apollon_init(void) 318static void __init omap_apollon_init(void)
@@ -324,6 +321,7 @@ static void __init omap_apollon_init(void)
324 321
325 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); 322 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
326 323
324 apollon_init_smc91x();
327 apollon_led_init(); 325 apollon_led_init();
328 apollon_flash_init(); 326 apollon_flash_init();
329 apollon_usb_init(); 327 apollon_usb_init();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 63f764e2af3f..486a3de5f401 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -600,8 +600,8 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
600 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 600 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
601 601
602 .phy_reset = true, 602 .phy_reset = true,
603 .reset_gpio_port[0] = -EINVAL, 603 .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6,
604 .reset_gpio_port[1] = -EINVAL, 604 .reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7,
605 .reset_gpio_port[2] = -EINVAL 605 .reset_gpio_port[2] = -EINVAL
606}; 606};
607 607
@@ -630,12 +630,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
630 cm_t35_vmmc1_supply.dev = mmc[0].dev; 630 cm_t35_vmmc1_supply.dev = mmc[0].dev;
631 cm_t35_vsim_supply.dev = mmc[0].dev; 631 cm_t35_vsim_supply.dev = mmc[0].dev;
632 632
633 /* setup USB with proper PHY reset GPIOs */
634 ehci_pdata.reset_gpio_port[0] = gpio + 6;
635 ehci_pdata.reset_gpio_port[1] = gpio + 7;
636
637 usb_ehci_init(&ehci_pdata);
638
639 return 0; 633 return 0;
640} 634}
641 635
@@ -683,10 +677,10 @@ static void __init cm_t35_init_irq(void)
683 omap_board_config = cm_t35_config; 677 omap_board_config = cm_t35_config;
684 omap_board_config_size = ARRAY_SIZE(cm_t35_config); 678 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
685 679
686 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 680 omap2_init_common_infrastructure();
681 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
687 mt46h32m32lf6_sdrc_params); 682 mt46h32m32lf6_sdrc_params);
688 omap_init_irq(); 683 omap_init_irq();
689 omap_gpio_init();
690} 684}
691 685
692static struct omap_board_mux board_mux[] __initdata = { 686static struct omap_board_mux board_mux[] __initdata = {
@@ -805,6 +799,7 @@ static void __init cm_t35_init(void)
805 cm_t35_init_display(); 799 cm_t35_init_display();
806 800
807 usb_musb_init(&musb_board_data); 801 usb_musb_init(&musb_board_data);
802 usb_ehci_init(&ehci_pdata);
808} 803}
809 804
810MACHINE_START(CM_T35, "Compulab CM-T35") 805MACHINE_START(CM_T35, "Compulab CM-T35")
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 1dd303e9a267..5b0c77732dfc 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -248,9 +248,9 @@ static void __init cm_t3517_init_irq(void)
248 omap_board_config = cm_t3517_config; 248 omap_board_config = cm_t3517_config;
249 omap_board_config_size = ARRAY_SIZE(cm_t3517_config); 249 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
250 250
251 omap2_init_common_hw(NULL, NULL); 251 omap2_init_common_infrastructure();
252 omap2_init_common_devices(NULL, NULL);
252 omap_init_irq(); 253 omap_init_irq();
253 omap_gpio_init();
254} 254}
255 255
256static struct omap_board_mux board_mux[] __initdata = { 256static struct omap_board_mux board_mux[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 53ac762518bd..451e7ff08b18 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -118,27 +118,27 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
118 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0); 118 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
119 119
120 if (gpio_is_valid(dssdev->reset_gpio)) 120 if (gpio_is_valid(dssdev->reset_gpio))
121 gpio_set_value(dssdev->reset_gpio, 1); 121 gpio_set_value_cansleep(dssdev->reset_gpio, 1);
122 return 0; 122 return 0;
123} 123}
124 124
125static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) 125static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
126{ 126{
127 if (gpio_is_valid(dssdev->reset_gpio)) 127 if (gpio_is_valid(dssdev->reset_gpio))
128 gpio_set_value(dssdev->reset_gpio, 0); 128 gpio_set_value_cansleep(dssdev->reset_gpio, 0);
129} 129}
130 130
131static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev) 131static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
132{ 132{
133 if (gpio_is_valid(dssdev->reset_gpio)) 133 if (gpio_is_valid(dssdev->reset_gpio))
134 gpio_set_value(dssdev->reset_gpio, 1); 134 gpio_set_value_cansleep(dssdev->reset_gpio, 1);
135 return 0; 135 return 0;
136} 136}
137 137
138static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) 138static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
139{ 139{
140 if (gpio_is_valid(dssdev->reset_gpio)) 140 if (gpio_is_valid(dssdev->reset_gpio))
141 gpio_set_value(dssdev->reset_gpio, 0); 141 gpio_set_value_cansleep(dssdev->reset_gpio, 0);
142} 142}
143 143
144static struct regulator_consumer_supply devkit8000_vmmc1_supply = 144static struct regulator_consumer_supply devkit8000_vmmc1_supply =
@@ -444,13 +444,13 @@ static struct platform_device keys_gpio = {
444 444
445static void __init devkit8000_init_irq(void) 445static void __init devkit8000_init_irq(void)
446{ 446{
447 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 447 omap2_init_common_infrastructure();
448 mt46h32m32lf6_sdrc_params); 448 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
449 mt46h32m32lf6_sdrc_params);
449 omap_init_irq(); 450 omap_init_irq();
450#ifdef CONFIG_OMAP_32K_TIMER 451#ifdef CONFIG_OMAP_32K_TIMER
451 omap2_gp_clockevent_set_gptimer(12); 452 omap2_gp_clockevent_set_gptimer(12);
452#endif 453#endif
453 omap_gpio_init();
454} 454}
455 455
456static void __init devkit8000_ads7846_init(void) 456static void __init devkit8000_ads7846_init(void)
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index b1c2c9a11c38..0e3d81e09f89 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -37,7 +37,8 @@ static void __init omap_generic_init_irq(void)
37{ 37{
38 omap_board_config = generic_config; 38 omap_board_config = generic_config;
39 omap_board_config_size = ARRAY_SIZE(generic_config); 39 omap_board_config_size = ARRAY_SIZE(generic_config);
40 omap2_init_common_hw(NULL, NULL); 40 omap2_init_common_infrastructure();
41 omap2_init_common_devices(NULL, NULL);
41 omap_init_irq(); 42 omap_init_irq();
42} 43}
43 44
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 929993b4bf26..25cc9dad4b02 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -51,38 +51,37 @@
51static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; 51static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
52static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; 52static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
53 53
54static int h4_keymap[] = { 54static const unsigned int h4_keymap[] = {
55 KEY(0, 0, KEY_LEFT), 55 KEY(0, 0, KEY_LEFT),
56 KEY(0, 1, KEY_RIGHT), 56 KEY(1, 0, KEY_RIGHT),
57 KEY(0, 2, KEY_A), 57 KEY(2, 0, KEY_A),
58 KEY(0, 3, KEY_B), 58 KEY(3, 0, KEY_B),
59 KEY(0, 4, KEY_C), 59 KEY(4, 0, KEY_C),
60 KEY(1, 0, KEY_DOWN), 60 KEY(0, 1, KEY_DOWN),
61 KEY(1, 1, KEY_UP), 61 KEY(1, 1, KEY_UP),
62 KEY(1, 2, KEY_E), 62 KEY(2, 1, KEY_E),
63 KEY(1, 3, KEY_F), 63 KEY(3, 1, KEY_F),
64 KEY(1, 4, KEY_G), 64 KEY(4, 1, KEY_G),
65 KEY(2, 0, KEY_ENTER), 65 KEY(0, 2, KEY_ENTER),
66 KEY(2, 1, KEY_I), 66 KEY(1, 2, KEY_I),
67 KEY(2, 2, KEY_J), 67 KEY(2, 2, KEY_J),
68 KEY(2, 3, KEY_K), 68 KEY(3, 2, KEY_K),
69 KEY(2, 4, KEY_3), 69 KEY(4, 2, KEY_3),
70 KEY(3, 0, KEY_M), 70 KEY(0, 3, KEY_M),
71 KEY(3, 1, KEY_N), 71 KEY(1, 3, KEY_N),
72 KEY(3, 2, KEY_O), 72 KEY(2, 3, KEY_O),
73 KEY(3, 3, KEY_P), 73 KEY(3, 3, KEY_P),
74 KEY(3, 4, KEY_Q), 74 KEY(4, 3, KEY_Q),
75 KEY(4, 0, KEY_R), 75 KEY(0, 4, KEY_R),
76 KEY(4, 1, KEY_4), 76 KEY(1, 4, KEY_4),
77 KEY(4, 2, KEY_T), 77 KEY(2, 4, KEY_T),
78 KEY(4, 3, KEY_U), 78 KEY(3, 4, KEY_U),
79 KEY(4, 4, KEY_ENTER), 79 KEY(4, 4, KEY_ENTER),
80 KEY(5, 0, KEY_V), 80 KEY(0, 5, KEY_V),
81 KEY(5, 1, KEY_W), 81 KEY(1, 5, KEY_W),
82 KEY(5, 2, KEY_L), 82 KEY(2, 5, KEY_L),
83 KEY(5, 3, KEY_S), 83 KEY(3, 5, KEY_S),
84 KEY(5, 4, KEY_ENTER), 84 KEY(4, 5, KEY_ENTER),
85 0
86}; 85};
87 86
88static struct mtd_partition h4_partitions[] = { 87static struct mtd_partition h4_partitions[] = {
@@ -136,12 +135,16 @@ static struct platform_device h4_flash_device = {
136 .resource = &h4_flash_resource, 135 .resource = &h4_flash_resource,
137}; 136};
138 137
138static const struct matrix_keymap_data h4_keymap_data = {
139 .keymap = h4_keymap,
140 .keymap_size = ARRAY_SIZE(h4_keymap),
141};
142
139static struct omap_kp_platform_data h4_kp_data = { 143static struct omap_kp_platform_data h4_kp_data = {
140 .rows = 6, 144 .rows = 6,
141 .cols = 7, 145 .cols = 7,
142 .keymap = h4_keymap, 146 .keymap_data = &h4_keymap_data,
143 .keymapsize = ARRAY_SIZE(h4_keymap), 147 .rep = true,
144 .rep = 1,
145 .row_gpios = row_gpios, 148 .row_gpios = row_gpios,
146 .col_gpios = col_gpios, 149 .col_gpios = col_gpios,
147}; 150};
@@ -283,7 +286,7 @@ static struct omap_usb_config h4_usb_config __initdata = {
283 .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ 286 .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */
284}; 287};
285 288
286static struct omap_board_config_kernel h4_config[] = { 289static struct omap_board_config_kernel h4_config[] __initdata = {
287 { OMAP_TAG_LCD, &h4_lcd_config }, 290 { OMAP_TAG_LCD, &h4_lcd_config },
288}; 291};
289 292
@@ -291,9 +294,9 @@ static void __init omap_h4_init_irq(void)
291{ 294{
292 omap_board_config = h4_config; 295 omap_board_config = h4_config;
293 omap_board_config_size = ARRAY_SIZE(h4_config); 296 omap_board_config_size = ARRAY_SIZE(h4_config);
294 omap2_init_common_hw(NULL, NULL); 297 omap2_init_common_infrastructure();
298 omap2_init_common_devices(NULL, NULL);
295 omap_init_irq(); 299 omap_init_irq();
296 omap_gpio_init();
297 h4_init_flash(); 300 h4_init_flash();
298} 301}
299 302
@@ -321,8 +324,6 @@ static struct i2c_board_info __initdata h4_i2c_board_info[] = {
321static struct omap_board_mux board_mux[] __initdata = { 324static struct omap_board_mux board_mux[] __initdata = {
322 { .reg_offset = OMAP_MUX_TERMINATOR }, 325 { .reg_offset = OMAP_MUX_TERMINATOR },
323}; 326};
324#else
325#define board_mux NULL
326#endif 327#endif
327 328
328static void __init omap_h4_init(void) 329static void __init omap_h4_init(void)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5e035a58b809..0afa3011db0f 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -19,6 +19,7 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20 20
21#include <linux/regulator/machine.h> 21#include <linux/regulator/machine.h>
22#include <linux/regulator/fixed.h>
22#include <linux/i2c/twl.h> 23#include <linux/i2c/twl.h>
23#include <linux/mmc/host.h> 24#include <linux/mmc/host.h>
24 25
@@ -136,16 +137,9 @@ static struct mtd_partition igep2_onenand_partitions[] = {
136 }, 137 },
137}; 138};
138 139
139static int igep2_onenand_setup(void __iomem *onenand_base, int freq)
140{
141 /* nothing is required to be setup for onenand as of now */
142 return 0;
143}
144
145static struct omap_onenand_platform_data igep2_onenand_data = { 140static struct omap_onenand_platform_data igep2_onenand_data = {
146 .parts = igep2_onenand_partitions, 141 .parts = igep2_onenand_partitions,
147 .nr_parts = ARRAY_SIZE(igep2_onenand_partitions), 142 .nr_parts = ARRAY_SIZE(igep2_onenand_partitions),
148 .onenand_setup = igep2_onenand_setup,
149 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ 143 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */
150}; 144};
151 145
@@ -159,35 +153,34 @@ static struct platform_device igep2_onenand_device = {
159 153
160static void __init igep2_flash_init(void) 154static void __init igep2_flash_init(void)
161{ 155{
162 u8 cs = 0; 156 u8 cs = 0;
163 u8 onenandcs = GPMC_CS_NUM + 1; 157 u8 onenandcs = GPMC_CS_NUM + 1;
164 158
165 while (cs < GPMC_CS_NUM) { 159 for (cs = 0; cs < GPMC_CS_NUM; cs++) {
166 u32 ret = 0; 160 u32 ret;
167 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); 161 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
168 162
169 /* Check if NAND/oneNAND is configured */ 163 /* Check if NAND/oneNAND is configured */
170 if ((ret & 0xC00) == 0x800) 164 if ((ret & 0xC00) == 0x800)
171 /* NAND found */ 165 /* NAND found */
172 pr_err("IGEP v2: Unsupported NAND found\n"); 166 pr_err("IGEP2: Unsupported NAND found\n");
173 else { 167 else {
174 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); 168 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
175 if ((ret & 0x3F) == (ONENAND_MAP >> 24)) 169 if ((ret & 0x3F) == (ONENAND_MAP >> 24))
176 /* ONENAND found */ 170 /* ONENAND found */
177 onenandcs = cs; 171 onenandcs = cs;
178 } 172 }
179 cs++;
180 } 173 }
174
181 if (onenandcs > GPMC_CS_NUM) { 175 if (onenandcs > GPMC_CS_NUM) {
182 pr_err("IGEP v2: Unable to find configuration in GPMC\n"); 176 pr_err("IGEP2: Unable to find configuration in GPMC\n");
183 return; 177 return;
184 } 178 }
185 179
186 if (onenandcs < GPMC_CS_NUM) { 180 igep2_onenand_data.cs = onenandcs;
187 igep2_onenand_data.cs = onenandcs; 181
188 if (platform_device_register(&igep2_onenand_device) < 0) 182 if (platform_device_register(&igep2_onenand_device) < 0)
189 pr_err("IGEP v2: Unable to register OneNAND device\n"); 183 pr_err("IGEP2: Unable to register OneNAND device\n");
190 }
191} 184}
192 185
193#else 186#else
@@ -254,12 +247,8 @@ static inline void __init igep2_init_smsc911x(void)
254static inline void __init igep2_init_smsc911x(void) { } 247static inline void __init igep2_init_smsc911x(void) { }
255#endif 248#endif
256 249
257static struct omap_board_config_kernel igep2_config[] __initdata = { 250static struct regulator_consumer_supply igep2_vmmc1_supply =
258}; 251 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
259
260static struct regulator_consumer_supply igep2_vmmc1_supply = {
261 .supply = "vmmc",
262};
263 252
264/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 253/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
265static struct regulator_init_data igep2_vmmc1 = { 254static struct regulator_init_data igep2_vmmc1 = {
@@ -276,6 +265,52 @@ static struct regulator_init_data igep2_vmmc1 = {
276 .consumer_supplies = &igep2_vmmc1_supply, 265 .consumer_supplies = &igep2_vmmc1_supply,
277}; 266};
278 267
268static struct regulator_consumer_supply igep2_vio_supply =
269 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1");
270
271static struct regulator_init_data igep2_vio = {
272 .constraints = {
273 .min_uV = 1800000,
274 .max_uV = 1800000,
275 .apply_uV = 1,
276 .valid_modes_mask = REGULATOR_MODE_NORMAL
277 | REGULATOR_MODE_STANDBY,
278 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
279 | REGULATOR_CHANGE_MODE
280 | REGULATOR_CHANGE_STATUS,
281 },
282 .num_consumer_supplies = 1,
283 .consumer_supplies = &igep2_vio_supply,
284};
285
286static struct regulator_consumer_supply igep2_vmmc2_supply =
287 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1");
288
289static struct regulator_init_data igep2_vmmc2 = {
290 .constraints = {
291 .valid_modes_mask = REGULATOR_MODE_NORMAL,
292 .always_on = 1,
293 },
294 .num_consumer_supplies = 1,
295 .consumer_supplies = &igep2_vmmc2_supply,
296};
297
298static struct fixed_voltage_config igep2_vwlan = {
299 .supply_name = "vwlan",
300 .microvolts = 3300000,
301 .gpio = -EINVAL,
302 .enabled_at_boot = 1,
303 .init_data = &igep2_vmmc2,
304};
305
306static struct platform_device igep2_vwlan_device = {
307 .name = "reg-fixed-voltage",
308 .id = 0,
309 .dev = {
310 .platform_data = &igep2_vwlan,
311 },
312};
313
279static struct omap2_hsmmc_info mmc[] = { 314static struct omap2_hsmmc_info mmc[] = {
280 { 315 {
281 .mmc = 1, 316 .mmc = 1,
@@ -317,6 +352,7 @@ static struct gpio_led igep2_gpio_leds[] = {
317 .name = "gpio-led:green:d1", 352 .name = "gpio-led:green:d1",
318 .default_trigger = "heartbeat", 353 .default_trigger = "heartbeat",
319 .gpio = -EINVAL, /* gets replaced */ 354 .gpio = -EINVAL, /* gets replaced */
355 .active_low = 1,
320 }, 356 },
321}; 357};
322 358
@@ -342,24 +378,21 @@ static void __init igep2_leds_init(void)
342static inline void igep2_leds_init(void) 378static inline void igep2_leds_init(void)
343{ 379{
344 if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) && 380 if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
345 (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) { 381 (gpio_direction_output(IGEP2_GPIO_LED0_RED, 0) == 0))
346 gpio_export(IGEP2_GPIO_LED0_RED, 0); 382 gpio_export(IGEP2_GPIO_LED0_RED, 0);
347 gpio_set_value(IGEP2_GPIO_LED0_RED, 0); 383 else
348 } else
349 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n"); 384 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
350 385
351 if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) && 386 if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
352 (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) { 387 (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 0) == 0))
353 gpio_export(IGEP2_GPIO_LED0_GREEN, 0); 388 gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
354 gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); 389 else
355 } else
356 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); 390 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
357 391
358 if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) && 392 if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
359 (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { 393 (gpio_direction_output(IGEP2_GPIO_LED1_RED, 0) == 0))
360 gpio_export(IGEP2_GPIO_LED1_RED, 0); 394 gpio_export(IGEP2_GPIO_LED1_RED, 0);
361 gpio_set_value(IGEP2_GPIO_LED1_RED, 0); 395 else
362 } else
363 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); 396 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
364 397
365} 398}
@@ -373,12 +406,6 @@ static int igep2_twl_gpio_setup(struct device *dev,
373 omap2_hsmmc_init(mmc); 406 omap2_hsmmc_init(mmc);
374 407
375 /* 408 /*
376 * link regulators to MMC adapters ... we "know" the
377 * regulators will be set up only *after* we return.
378 */
379 igep2_vmmc1_supply.dev = mmc[0].dev;
380
381 /*
382 * REVISIT: need ehci-omap hooks for external VBUS 409 * REVISIT: need ehci-omap hooks for external VBUS
383 * power switch and overcurrent detect 410 * power switch and overcurrent detect
384 */ 411 */
@@ -397,10 +424,9 @@ static int igep2_twl_gpio_setup(struct device *dev,
397 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ 424 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
398#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE) 425#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
399 if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0) 426 if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
400 && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) { 427 && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0))
401 gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0); 428 gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
402 gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0); 429 else
403 } else
404 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n"); 430 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
405#else 431#else
406 igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; 432 igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -489,15 +515,15 @@ static void __init igep2_display_init(void)
489 515
490static struct platform_device *igep2_devices[] __initdata = { 516static struct platform_device *igep2_devices[] __initdata = {
491 &igep2_dss_device, 517 &igep2_dss_device,
518 &igep2_vwlan_device,
492}; 519};
493 520
494static void __init igep2_init_irq(void) 521static void __init igep2_init_irq(void)
495{ 522{
496 omap_board_config = igep2_config; 523 omap2_init_common_infrastructure();
497 omap_board_config_size = ARRAY_SIZE(igep2_config); 524 omap2_init_common_devices(m65kxxxxam_sdrc_params,
498 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); 525 m65kxxxxam_sdrc_params);
499 omap_init_irq(); 526 omap_init_irq();
500 omap_gpio_init();
501} 527}
502 528
503static struct twl4030_codec_audio_data igep2_audio_data = { 529static struct twl4030_codec_audio_data igep2_audio_data = {
@@ -519,7 +545,7 @@ static struct twl4030_platform_data igep2_twldata = {
519 .gpio = &igep2_twl4030_gpio_pdata, 545 .gpio = &igep2_twl4030_gpio_pdata,
520 .vmmc1 = &igep2_vmmc1, 546 .vmmc1 = &igep2_vmmc1,
521 .vpll2 = &igep2_vpll2, 547 .vpll2 = &igep2_vpll2,
522 548 .vio = &igep2_vio,
523}; 549};
524 550
525static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = { 551static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
@@ -577,8 +603,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
577static struct omap_board_mux board_mux[] __initdata = { 603static struct omap_board_mux board_mux[] __initdata = {
578 { .reg_offset = OMAP_MUX_TERMINATOR }, 604 { .reg_offset = OMAP_MUX_TERMINATOR },
579}; 605};
580#else
581#define board_mux NULL
582#endif 606#endif
583 607
584#if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE) 608#if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 22b0b253e16b..bcccd68f1856 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -289,9 +289,10 @@ static struct twl4030_usb_data igep3_twl4030_usb_data = {
289 289
290static void __init igep3_init_irq(void) 290static void __init igep3_init_irq(void)
291{ 291{
292 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); 292 omap2_init_common_infrastructure();
293 omap2_init_common_devices(m65kxxxxam_sdrc_params,
294 m65kxxxxam_sdrc_params);
293 omap_init_irq(); 295 omap_init_irq();
294 omap_gpio_init();
295} 296}
296 297
297static struct twl4030_platform_data igep3_twl4030_pdata = { 298static struct twl4030_platform_data igep3_twl4030_pdata = {
@@ -366,8 +367,6 @@ void __init igep3_wifi_bt_init(void) {}
366static struct omap_board_mux board_mux[] __initdata = { 367static struct omap_board_mux board_mux[] __initdata = {
367 { .reg_offset = OMAP_MUX_TERMINATOR }, 368 { .reg_offset = OMAP_MUX_TERMINATOR },
368}; 369};
369#else
370#define board_mux NULL
371#endif 370#endif
372 371
373static void __init igep3_init(void) 372static void __init igep3_init(void)
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 001fd9713f39..e5dc74875f9d 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -292,10 +292,9 @@ static void __init omap_ldp_init_irq(void)
292{ 292{
293 omap_board_config = ldp_config; 293 omap_board_config = ldp_config;
294 omap_board_config_size = ARRAY_SIZE(ldp_config); 294 omap_board_config_size = ARRAY_SIZE(ldp_config);
295 omap2_init_common_hw(NULL, NULL); 295 omap2_init_common_infrastructure();
296 omap2_init_common_devices(NULL, NULL);
296 omap_init_irq(); 297 omap_init_irq();
297 omap_gpio_init();
298 ldp_init_smsc911x();
299} 298}
300 299
301static struct twl4030_usb_data ldp_usb_data = { 300static struct twl4030_usb_data ldp_usb_data = {
@@ -381,8 +380,6 @@ static struct platform_device *ldp_devices[] __initdata = {
381static struct omap_board_mux board_mux[] __initdata = { 380static struct omap_board_mux board_mux[] __initdata = {
382 { .reg_offset = OMAP_MUX_TERMINATOR }, 381 { .reg_offset = OMAP_MUX_TERMINATOR },
383}; 382};
384#else
385#define board_mux NULL
386#endif 383#endif
387 384
388static struct omap_musb_board_data musb_board_data = { 385static struct omap_musb_board_data musb_board_data = {
@@ -426,6 +423,7 @@ static struct mtd_partition ldp_nand_partitions[] = {
426static void __init omap_ldp_init(void) 423static void __init omap_ldp_init(void)
427{ 424{
428 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 425 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
426 ldp_init_smsc911x();
429 omap_i2c_init(); 427 omap_i2c_init();
430 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 428 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
431 ts_gpio = 54; 429 ts_gpio = 54;
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e823c7042ab3..147d9005f320 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -184,23 +184,15 @@ static struct mtd_partition onenand_partitions[] = {
184 }, 184 },
185}; 185};
186 186
187static struct omap_onenand_platform_data board_onenand_data = { 187static struct omap_onenand_platform_data board_onenand_data[] = {
188 .cs = 0, 188 {
189 .gpio_irq = 26, 189 .cs = 0,
190 .parts = onenand_partitions, 190 .gpio_irq = 26,
191 .nr_parts = ARRAY_SIZE(onenand_partitions), 191 .parts = onenand_partitions,
192 .flags = ONENAND_SYNC_READ, 192 .nr_parts = ARRAY_SIZE(onenand_partitions),
193 .flags = ONENAND_SYNC_READ,
194 }
193}; 195};
194
195static void __init n8x0_onenand_init(void)
196{
197 gpmc_onenand_init(&board_onenand_data);
198}
199
200#else
201
202static void __init n8x0_onenand_init(void) {}
203
204#endif 196#endif
205 197
206#if defined(CONFIG_MENELAUS) && \ 198#if defined(CONFIG_MENELAUS) && \
@@ -639,9 +631,9 @@ static void __init n8x0_map_io(void)
639 631
640static void __init n8x0_init_irq(void) 632static void __init n8x0_init_irq(void)
641{ 633{
642 omap2_init_common_hw(NULL, NULL); 634 omap2_init_common_infrastructure();
635 omap2_init_common_devices(NULL, NULL);
643 omap_init_irq(); 636 omap_init_irq();
644 omap_gpio_init();
645} 637}
646 638
647#ifdef CONFIG_OMAP_MUX 639#ifdef CONFIG_OMAP_MUX
@@ -653,8 +645,43 @@ static struct omap_board_mux board_mux[] __initdata = {
653 OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), 645 OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
654 { .reg_offset = OMAP_MUX_TERMINATOR }, 646 { .reg_offset = OMAP_MUX_TERMINATOR },
655}; 647};
648
649static struct omap_device_pad serial2_pads[] __initdata = {
650 {
651 .name = "uart3_rx_irrx.uart3_rx_irrx",
652 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
653 .enable = OMAP_MUX_MODE0,
654 .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */
655 },
656};
657
658static inline void board_serial_init(void)
659{
660 struct omap_board_data bdata;
661
662 bdata.flags = 0;
663 bdata.pads = NULL;
664 bdata.pads_cnt = 0;
665
666 bdata.id = 0;
667 omap_serial_init_port(&bdata);
668
669 bdata.id = 1;
670 omap_serial_init_port(&bdata);
671
672 bdata.id = 2;
673 bdata.pads = serial2_pads;
674 bdata.pads_cnt = ARRAY_SIZE(serial2_pads);
675 omap_serial_init_port(&bdata);
676}
677
656#else 678#else
657#define board_mux NULL 679
680static inline void board_serial_init(void)
681{
682 omap_serial_init();
683}
684
658#endif 685#endif
659 686
660static void __init n8x0_init_machine(void) 687static void __init n8x0_init_machine(void)
@@ -669,9 +696,8 @@ static void __init n8x0_init_machine(void)
669 if (machine_is_nokia_n810()) 696 if (machine_is_nokia_n810())
670 i2c_register_board_info(2, n810_i2c_board_info_2, 697 i2c_register_board_info(2, n810_i2c_board_info_2,
671 ARRAY_SIZE(n810_i2c_board_info_2)); 698 ARRAY_SIZE(n810_i2c_board_info_2));
672 699 board_serial_init();
673 omap_serial_init(); 700 gpmc_onenand_init(board_onenand_data);
674 n8x0_onenand_init();
675 n8x0_mmc_init(); 701 n8x0_mmc_init();
676 n8x0_usb_init(); 702 n8x0_usb_init();
677} 703}
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 14f42240ae79..6c127605942f 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -484,13 +484,13 @@ static struct platform_device keys_gpio = {
484 484
485static void __init omap3_beagle_init_irq(void) 485static void __init omap3_beagle_init_irq(void)
486{ 486{
487 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 487 omap2_init_common_infrastructure();
488 mt46h32m32lf6_sdrc_params); 488 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
489 mt46h32m32lf6_sdrc_params);
489 omap_init_irq(); 490 omap_init_irq();
490#ifdef CONFIG_OMAP_32K_TIMER 491#ifdef CONFIG_OMAP_32K_TIMER
491 omap2_gp_clockevent_set_gptimer(12); 492 omap2_gp_clockevent_set_gptimer(12);
492#endif 493#endif
493 omap_gpio_init();
494} 494}
495 495
496static struct platform_device *omap3_beagle_devices[] __initdata = { 496static struct platform_device *omap3_beagle_devices[] __initdata = {
@@ -548,8 +548,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
548static struct omap_board_mux board_mux[] __initdata = { 548static struct omap_board_mux board_mux[] __initdata = {
549 { .reg_offset = OMAP_MUX_TERMINATOR }, 549 { .reg_offset = OMAP_MUX_TERMINATOR },
550}; 550};
551#else
552#define board_mux NULL
553#endif 551#endif
554 552
555static struct omap_musb_board_data musb_board_data = { 553static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index b04365c6bb10..3de8d9b8ec76 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -623,9 +623,9 @@ static void __init omap3_evm_init_irq(void)
623{ 623{
624 omap_board_config = omap3_evm_config; 624 omap_board_config = omap3_evm_config;
625 omap_board_config_size = ARRAY_SIZE(omap3_evm_config); 625 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
626 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 626 omap2_init_common_infrastructure();
627 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
627 omap_init_irq(); 628 omap_init_irq();
628 omap_gpio_init();
629} 629}
630 630
631static struct platform_device *omap3_evm_devices[] __initdata = { 631static struct platform_device *omap3_evm_devices[] __initdata = {
@@ -654,8 +654,6 @@ static struct omap_board_mux board_mux[] __initdata = {
654 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), 654 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW),
655 { .reg_offset = OMAP_MUX_TERMINATOR }, 655 { .reg_offset = OMAP_MUX_TERMINATOR },
656}; 656};
657#else
658#define board_mux NULL
659#endif 657#endif
660 658
661static struct omap_musb_board_data musb_board_data = { 659static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 5f7d2c1e7ef5..15e4b08e99ba 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -197,17 +197,15 @@ static inline void __init board_smsc911x_init(void)
197 197
198static void __init omap3logic_init_irq(void) 198static void __init omap3logic_init_irq(void)
199{ 199{
200 omap2_init_common_hw(NULL, NULL); 200 omap2_init_common_infrastructure();
201 omap2_init_common_devices(NULL, NULL);
201 omap_init_irq(); 202 omap_init_irq();
202 omap_gpio_init();
203} 203}
204 204
205#ifdef CONFIG_OMAP_MUX 205#ifdef CONFIG_OMAP_MUX
206static struct omap_board_mux board_mux[] __initdata = { 206static struct omap_board_mux board_mux[] __initdata = {
207 { .reg_offset = OMAP_MUX_TERMINATOR }, 207 { .reg_offset = OMAP_MUX_TERMINATOR },
208}; 208};
209#else
210#define board_mux NULL
211#endif 209#endif
212 210
213static void __init omap3logic_init(void) 211static void __init omap3logic_init(void)
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 8be261506056..0b34beded11f 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -293,7 +293,7 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
293 }, 293 },
294 { 294 {
295 .mmc = 3, 295 .mmc = 3,
296 .caps = MMC_CAP_4_BIT_DATA, 296 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
297 .gpio_cd = -EINVAL, 297 .gpio_cd = -EINVAL,
298 .gpio_wp = -EINVAL, 298 .gpio_wp = -EINVAL,
299 .init_card = pandora_wl1251_init_card, 299 .init_card = pandora_wl1251_init_card,
@@ -636,10 +636,10 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
636 636
637static void __init omap3pandora_init_irq(void) 637static void __init omap3pandora_init_irq(void)
638{ 638{
639 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 639 omap2_init_common_infrastructure();
640 mt46h32m32lf6_sdrc_params); 640 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
641 mt46h32m32lf6_sdrc_params);
641 omap_init_irq(); 642 omap_init_irq();
642 omap_gpio_init();
643} 643}
644 644
645static void __init pandora_wl1251_init(void) 645static void __init pandora_wl1251_init(void)
@@ -697,8 +697,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
697static struct omap_board_mux board_mux[] __initdata = { 697static struct omap_board_mux board_mux[] __initdata = {
698 { .reg_offset = OMAP_MUX_TERMINATOR }, 698 { .reg_offset = OMAP_MUX_TERMINATOR },
699}; 699};
700#else
701#define board_mux NULL
702#endif 700#endif
703 701
704static struct omap_musb_board_data musb_board_data = { 702static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index f25272125413..9df9d9367608 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -584,12 +584,12 @@ static void __init omap3_stalker_init_irq(void)
584{ 584{
585 omap_board_config = omap3_stalker_config; 585 omap_board_config = omap3_stalker_config;
586 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); 586 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
587 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 587 omap2_init_common_infrastructure();
588 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
588 omap_init_irq(); 589 omap_init_irq();
589#ifdef CONFIG_OMAP_32K_TIMER 590#ifdef CONFIG_OMAP_32K_TIMER
590 omap2_gp_clockevent_set_gptimer(12); 591 omap2_gp_clockevent_set_gptimer(12);
591#endif 592#endif
592 omap_gpio_init();
593} 593}
594 594
595static struct platform_device *omap3_stalker_devices[] __initdata = { 595static struct platform_device *omap3_stalker_devices[] __initdata = {
@@ -616,8 +616,6 @@ static struct omap_board_mux board_mux[] __initdata = {
616 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE), 616 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
617 {.reg_offset = OMAP_MUX_TERMINATOR}, 617 {.reg_offset = OMAP_MUX_TERMINATOR},
618}; 618};
619#else
620#define board_mux NULL
621#endif 619#endif
622 620
623static struct omap_musb_board_data musb_board_data = { 621static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 41104bb8774c..db1f74fe6c4f 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -413,8 +413,6 @@ static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = {
413static struct omap_board_mux board_mux[] __initdata = { 413static struct omap_board_mux board_mux[] __initdata = {
414 { .reg_offset = OMAP_MUX_TERMINATOR }, 414 { .reg_offset = OMAP_MUX_TERMINATOR },
415}; 415};
416#else
417#define board_mux NULL
418#endif 416#endif
419 417
420static void __init omap3_touchbook_init_irq(void) 418static void __init omap3_touchbook_init_irq(void)
@@ -422,13 +420,13 @@ static void __init omap3_touchbook_init_irq(void)
422 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 420 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
423 omap_board_config = omap3_touchbook_config; 421 omap_board_config = omap3_touchbook_config;
424 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); 422 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
425 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 423 omap2_init_common_infrastructure();
426 mt46h32m32lf6_sdrc_params); 424 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
425 mt46h32m32lf6_sdrc_params);
427 omap_init_irq(); 426 omap_init_irq();
428#ifdef CONFIG_OMAP_32K_TIMER 427#ifdef CONFIG_OMAP_32K_TIMER
429 omap2_gp_clockevent_set_gptimer(12); 428 omap2_gp_clockevent_set_gptimer(12);
430#endif 429#endif
431 omap_gpio_init();
432} 430}
433 431
434static struct platform_device *omap3_touchbook_devices[] __initdata = { 432static struct platform_device *omap3_touchbook_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 1ecd0a6cefb7..b43e3ff9adec 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -40,6 +40,7 @@
40 40
41#include "hsmmc.h" 41#include "hsmmc.h"
42#include "control.h" 42#include "control.h"
43#include "mux.h"
43 44
44#define GPIO_HUB_POWER 1 45#define GPIO_HUB_POWER 1
45#define GPIO_HUB_NRESET 62 46#define GPIO_HUB_NRESET 62
@@ -76,9 +77,9 @@ static struct platform_device *panda_devices[] __initdata = {
76 77
77static void __init omap4_panda_init_irq(void) 78static void __init omap4_panda_init_irq(void)
78{ 79{
79 omap2_init_common_hw(NULL, NULL); 80 omap2_init_common_infrastructure();
81 omap2_init_common_devices(NULL, NULL);
80 gic_init_irq(); 82 gic_init_irq();
81 omap_gpio_init();
82} 83}
83 84
84static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 85static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -142,6 +143,7 @@ static struct omap2_hsmmc_info mmc[] = {
142 .mmc = 1, 143 .mmc = 1,
143 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 144 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
144 .gpio_wp = -EINVAL, 145 .gpio_wp = -EINVAL,
146 .gpio_cd = -EINVAL,
145 }, 147 },
146 {} /* Terminator */ 148 {} /* Terminator */
147}; 149};
@@ -368,8 +370,23 @@ static int __init omap4_panda_i2c_init(void)
368 omap_register_i2c_bus(4, 400, NULL, 0); 370 omap_register_i2c_bus(4, 400, NULL, 0);
369 return 0; 371 return 0;
370} 372}
373
374#ifdef CONFIG_OMAP_MUX
375static struct omap_board_mux board_mux[] __initdata = {
376 { .reg_offset = OMAP_MUX_TERMINATOR },
377};
378#else
379#define board_mux NULL
380#endif
381
371static void __init omap4_panda_init(void) 382static void __init omap4_panda_init(void)
372{ 383{
384 int package = OMAP_PACKAGE_CBS;
385
386 if (omap_rev() == OMAP4430_REV_ES1_0)
387 package = OMAP_PACKAGE_CBL;
388 omap4_mux_init(board_mux, package);
389
373 omap4_panda_i2c_init(); 390 omap4_panda_i2c_init();
374 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); 391 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
375 omap_serial_init(); 392 omap_serial_init();
@@ -391,6 +408,7 @@ static void __init omap4_panda_map_io(void)
391MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") 408MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
392 /* Maintainer: David Anders - Texas Instruments Inc */ 409 /* Maintainer: David Anders - Texas Instruments Inc */
393 .boot_params = 0x80000100, 410 .boot_params = 0x80000100,
411 .reserve = omap_reserve,
394 .map_io = omap4_panda_map_io, 412 .map_io = omap4_panda_map_io,
395 .init_irq = omap4_panda_init_irq, 413 .init_irq = omap4_panda_init_irq,
396 .init_machine = omap4_panda_init, 414 .init_machine = omap4_panda_init,
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 7053bc0b46db..cb26e5d8268d 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -413,10 +413,10 @@ static void __init overo_init_irq(void)
413{ 413{
414 omap_board_config = overo_config; 414 omap_board_config = overo_config;
415 omap_board_config_size = ARRAY_SIZE(overo_config); 415 omap_board_config_size = ARRAY_SIZE(overo_config);
416 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 416 omap2_init_common_infrastructure();
417 mt46h32m32lf6_sdrc_params); 417 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
418 mt46h32m32lf6_sdrc_params);
418 omap_init_irq(); 419 omap_init_irq();
419 omap_gpio_init();
420} 420}
421 421
422static struct platform_device *overo_devices[] __initdata = { 422static struct platform_device *overo_devices[] __initdata = {
@@ -438,8 +438,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
438static struct omap_board_mux board_mux[] __initdata = { 438static struct omap_board_mux board_mux[] __initdata = {
439 { .reg_offset = OMAP_MUX_TERMINATOR }, 439 { .reg_offset = OMAP_MUX_TERMINATOR },
440}; 440};
441#else
442#define board_mux NULL
443#endif 441#endif
444 442
445static struct omap_musb_board_data musb_board_data = { 443static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
new file mode 100644
index 000000000000..cb77be7ac44f
--- /dev/null
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -0,0 +1,187 @@
1/*
2 * Board support file for Nokia RM-680.
3 *
4 * Copyright (C) 2010 Nokia
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#include <linux/io.h>
12#include <linux/i2c.h>
13#include <linux/gpio.h>
14#include <linux/init.h>
15#include <linux/i2c/twl.h>
16#include <linux/platform_device.h>
17#include <linux/regulator/fixed.h>
18#include <linux/regulator/machine.h>
19#include <linux/regulator/consumer.h>
20
21#include <asm/mach/arch.h>
22#include <asm/mach-types.h>
23
24#include <plat/i2c.h>
25#include <plat/mmc.h>
26#include <plat/usb.h>
27#include <plat/gpmc.h>
28#include <plat/common.h>
29#include <plat/onenand.h>
30
31#include "mux.h"
32#include "hsmmc.h"
33#include "sdram-nokia.h"
34
35static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
36 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"),
37};
38
39/* Fixed regulator for internal eMMC */
40static struct regulator_init_data rm680_vemmc = {
41 .constraints = {
42 .name = "rm680_vemmc",
43 .min_uV = 2900000,
44 .max_uV = 2900000,
45 .apply_uV = 1,
46 .valid_modes_mask = REGULATOR_MODE_NORMAL
47 | REGULATOR_MODE_STANDBY,
48 .valid_ops_mask = REGULATOR_CHANGE_STATUS
49 | REGULATOR_CHANGE_MODE,
50 },
51 .num_consumer_supplies = ARRAY_SIZE(rm680_vemmc_consumers),
52 .consumer_supplies = rm680_vemmc_consumers,
53};
54
55static struct fixed_voltage_config rm680_vemmc_config = {
56 .supply_name = "VEMMC",
57 .microvolts = 2900000,
58 .gpio = 157,
59 .startup_delay = 150,
60 .enable_high = 1,
61 .init_data = &rm680_vemmc,
62};
63
64static struct platform_device rm680_vemmc_device = {
65 .name = "reg-fixed-voltage",
66 .dev = {
67 .platform_data = &rm680_vemmc_config,
68 },
69};
70
71static struct platform_device *rm680_peripherals_devices[] __initdata = {
72 &rm680_vemmc_device,
73};
74
75/* TWL */
76static struct twl4030_gpio_platform_data rm680_gpio_data = {
77 .gpio_base = OMAP_MAX_GPIO_LINES,
78 .irq_base = TWL4030_GPIO_IRQ_BASE,
79 .irq_end = TWL4030_GPIO_IRQ_END,
80 .pullups = BIT(0),
81 .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15),
82};
83
84static struct twl4030_usb_data rm680_usb_data = {
85 .usb_mode = T2_USB_MODE_ULPI,
86};
87
88static struct twl4030_platform_data rm680_twl_data = {
89 .irq_base = TWL4030_IRQ_BASE,
90 .irq_end = TWL4030_IRQ_END,
91 .gpio = &rm680_gpio_data,
92 .usb = &rm680_usb_data,
93 /* add rest of the children here */
94};
95
96static struct i2c_board_info __initdata rm680_twl_i2c_board_info[] = {
97 {
98 I2C_BOARD_INFO("twl5031", 0x48),
99 .flags = I2C_CLIENT_WAKE,
100 .irq = INT_34XX_SYS_NIRQ,
101 .platform_data = &rm680_twl_data,
102 },
103};
104
105static void __init rm680_i2c_init(void)
106{
107 omap_register_i2c_bus(1, 2900, rm680_twl_i2c_board_info,
108 ARRAY_SIZE(rm680_twl_i2c_board_info));
109 omap_register_i2c_bus(2, 400, NULL, 0);
110 omap_register_i2c_bus(3, 400, NULL, 0);
111}
112
113#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
114 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
115static struct omap_onenand_platform_data board_onenand_data[] = {
116 {
117 .gpio_irq = 65,
118 .flags = ONENAND_SYNC_READWRITE,
119 }
120};
121#endif
122
123/* eMMC */
124static struct omap2_hsmmc_info mmc[] __initdata = {
125 {
126 .name = "internal",
127 .mmc = 2,
128 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED,
129 .gpio_cd = -EINVAL,
130 .gpio_wp = -EINVAL,
131 },
132 { /* Terminator */ }
133};
134
135static void __init rm680_peripherals_init(void)
136{
137 platform_add_devices(rm680_peripherals_devices,
138 ARRAY_SIZE(rm680_peripherals_devices));
139 rm680_i2c_init();
140 gpmc_onenand_init(board_onenand_data);
141 omap2_hsmmc_init(mmc);
142}
143
144static void __init rm680_init_irq(void)
145{
146 struct omap_sdrc_params *sdrc_params;
147
148 omap2_init_common_infrastructure();
149 sdrc_params = nokia_get_sdram_timings();
150 omap2_init_common_devices(sdrc_params, sdrc_params);
151 omap_init_irq();
152}
153
154#ifdef CONFIG_OMAP_MUX
155static struct omap_board_mux board_mux[] __initdata = {
156 { .reg_offset = OMAP_MUX_TERMINATOR },
157};
158#endif
159
160static struct omap_musb_board_data rm680_musb_data = {
161 .interface_type = MUSB_INTERFACE_ULPI,
162 .mode = MUSB_PERIPHERAL,
163 .power = 100,
164};
165
166static void __init rm680_init(void)
167{
168 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
169 omap_serial_init();
170 usb_musb_init(&rm680_musb_data);
171 rm680_peripherals_init();
172}
173
174static void __init rm680_map_io(void)
175{
176 omap2_set_globals_3xxx();
177 omap34xx_map_common_io();
178}
179
180MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
181 .boot_params = 0x80000100,
182 .map_io = rm680_map_io,
183 .reserve = omap_reserve,
184 .init_irq = rm680_init_irq,
185 .init_machine = rm680_init,
186 .timer = &omap_timer,
187MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 3fec4d62a91a..e75e240cad67 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -23,7 +23,6 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <sound/tlv320aic3x.h>
27 26
28#include <plat/mcspi.h> 27#include <plat/mcspi.h>
29#include <plat/board.h> 28#include <plat/board.h>
@@ -293,6 +292,8 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = {
293 { .reg_offset = OMAP_MUX_TERMINATOR }, 292 { .reg_offset = OMAP_MUX_TERMINATOR },
294}; 293};
295 294
295static struct omap_mux_partition *partition;
296
296/* 297/*
297 * Current flows to eMMC when eMMC is off and the data lines are pulled up, 298 * Current flows to eMMC when eMMC is off and the data lines are pulled up,
298 * so pull them down. N.B. we pull 8 lines because we are using 8 lines. 299 * so pull them down. N.B. we pull 8 lines because we are using 8 lines.
@@ -300,9 +301,9 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = {
300static void rx51_mmc2_remux(struct device *dev, int slot, int power_on) 301static void rx51_mmc2_remux(struct device *dev, int slot, int power_on)
301{ 302{
302 if (power_on) 303 if (power_on)
303 omap_mux_write_array(rx51_mmc2_on_mux); 304 omap_mux_write_array(partition, rx51_mmc2_on_mux);
304 else 305 else
305 omap_mux_write_array(rx51_mmc2_off_mux); 306 omap_mux_write_array(partition, rx51_mmc2_off_mux);
306} 307}
307 308
308static struct omap2_hsmmc_info mmc[] __initdata = { 309static struct omap2_hsmmc_info mmc[] __initdata = {
@@ -342,6 +343,8 @@ static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
342 /* tlv320aic3x analog supplies */ 343 /* tlv320aic3x analog supplies */
343 REGULATOR_SUPPLY("AVDD", "2-0018"), 344 REGULATOR_SUPPLY("AVDD", "2-0018"),
344 REGULATOR_SUPPLY("DRVDD", "2-0018"), 345 REGULATOR_SUPPLY("DRVDD", "2-0018"),
346 REGULATOR_SUPPLY("AVDD", "2-0019"),
347 REGULATOR_SUPPLY("DRVDD", "2-0019"),
345 /* tpa6130a2 */ 348 /* tpa6130a2 */
346 REGULATOR_SUPPLY("Vdd", "2-0060"), 349 REGULATOR_SUPPLY("Vdd", "2-0060"),
347 /* Keep vmmc as last item. It is not iterated for newer boards */ 350 /* Keep vmmc as last item. It is not iterated for newer boards */
@@ -352,19 +355,16 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = {
352 /* tlv320aic3x digital supplies */ 355 /* tlv320aic3x digital supplies */
353 REGULATOR_SUPPLY("IOVDD", "2-0018"), 356 REGULATOR_SUPPLY("IOVDD", "2-0018"),
354 REGULATOR_SUPPLY("DVDD", "2-0018"), 357 REGULATOR_SUPPLY("DVDD", "2-0018"),
358 REGULATOR_SUPPLY("IOVDD", "2-0019"),
359 REGULATOR_SUPPLY("DVDD", "2-0019"),
355}; 360};
356 361
357#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
358extern struct platform_device rx51_display_device;
359#endif
360
361static struct regulator_consumer_supply rx51_vaux1_consumers[] = { 362static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
362#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) 363 REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
363 { 364};
364 .supply = "vdds_sdi", 365
365 .dev = &rx51_display_device.dev, 366static struct regulator_consumer_supply rx51_vdac_supply[] = {
366 }, 367 REGULATOR_SUPPLY("vdda_dac", "omapdss"),
367#endif
368}; 368};
369 369
370static struct regulator_init_data rx51_vaux1 = { 370static struct regulator_init_data rx51_vaux1 = {
@@ -484,14 +484,17 @@ static struct regulator_init_data rx51_vsim = {
484 484
485static struct regulator_init_data rx51_vdac = { 485static struct regulator_init_data rx51_vdac = {
486 .constraints = { 486 .constraints = {
487 .name = "VDAC",
487 .min_uV = 1800000, 488 .min_uV = 1800000,
488 .max_uV = 1800000, 489 .max_uV = 1800000,
490 .apply_uV = true,
489 .valid_modes_mask = REGULATOR_MODE_NORMAL 491 .valid_modes_mask = REGULATOR_MODE_NORMAL
490 | REGULATOR_MODE_STANDBY, 492 | REGULATOR_MODE_STANDBY,
491 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 493 .valid_ops_mask = REGULATOR_CHANGE_MODE
492 | REGULATOR_CHANGE_MODE
493 | REGULATOR_CHANGE_STATUS, 494 | REGULATOR_CHANGE_STATUS,
494 }, 495 },
496 .num_consumer_supplies = 1,
497 .consumer_supplies = rx51_vdac_supply,
495}; 498};
496 499
497static struct regulator_init_data rx51_vio = { 500static struct regulator_init_data rx51_vio = {
@@ -717,7 +720,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
717 .vio = &rx51_vio, 720 .vio = &rx51_vio,
718}; 721};
719 722
720static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata = { 723static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = {
721 .id = TPA6130A2, 724 .id = TPA6130A2,
722 .power_gpio = 98, 725 .power_gpio = 98,
723}; 726};
@@ -742,11 +745,19 @@ static struct aic3x_pdata rx51_aic3x_data = {
742 .gpio_reset = 60, 745 .gpio_reset = 60,
743}; 746};
744 747
748static struct aic3x_pdata rx51_aic3x_data2 = {
749 .gpio_reset = 60,
750};
751
745static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { 752static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
746 { 753 {
747 I2C_BOARD_INFO("tlv320aic3x", 0x18), 754 I2C_BOARD_INFO("tlv320aic3x", 0x18),
748 .platform_data = &rx51_aic3x_data, 755 .platform_data = &rx51_aic3x_data,
749 }, 756 },
757 {
758 I2C_BOARD_INFO("tlv320aic3x", 0x19),
759 .platform_data = &rx51_aic3x_data2,
760 },
750#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) 761#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
751 { 762 {
752 I2C_BOARD_INFO("tsl2563", 0x29), 763 I2C_BOARD_INFO("tsl2563", 0x29),
@@ -815,25 +826,15 @@ static struct mtd_partition onenand_partitions[] = {
815 }, 826 },
816}; 827};
817 828
818static struct omap_onenand_platform_data board_onenand_data = { 829static struct omap_onenand_platform_data board_onenand_data[] = {
819 .cs = 0, 830 {
820 .gpio_irq = 65, 831 .cs = 0,
821 .parts = onenand_partitions, 832 .gpio_irq = 65,
822 .nr_parts = ARRAY_SIZE(onenand_partitions), 833 .parts = onenand_partitions,
823 .flags = ONENAND_SYNC_READWRITE, 834 .nr_parts = ARRAY_SIZE(onenand_partitions),
835 .flags = ONENAND_SYNC_READWRITE,
836 }
824}; 837};
825
826static void __init board_onenand_init(void)
827{
828 gpmc_onenand_init(&board_onenand_data);
829}
830
831#else
832
833static inline void board_onenand_init(void)
834{
835}
836
837#endif 838#endif
838 839
839#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 840#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
@@ -916,13 +917,17 @@ error:
916void __init rx51_peripherals_init(void) 917void __init rx51_peripherals_init(void)
917{ 918{
918 rx51_i2c_init(); 919 rx51_i2c_init();
919 board_onenand_init(); 920 gpmc_onenand_init(board_onenand_data);
920 board_smc91x_init(); 921 board_smc91x_init();
921 rx51_add_gpio_keys(); 922 rx51_add_gpio_keys();
922 rx51_init_wl1251(); 923 rx51_init_wl1251();
923 spi_register_board_info(rx51_peripherals_spi_board_info, 924 spi_register_board_info(rx51_peripherals_spi_board_info,
924 ARRAY_SIZE(rx51_peripherals_spi_board_info)); 925 ARRAY_SIZE(rx51_peripherals_spi_board_info));
925 omap2_hsmmc_init(mmc); 926
927 partition = omap_mux_get("core");
928 if (partition)
929 omap2_hsmmc_init(mmc);
930
926 platform_device_register(&rx51_charger_device); 931 platform_device_register(&rx51_charger_device);
927} 932}
928 933
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index 85503fed4e13..acd670054d9a 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -14,7 +14,6 @@
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17
18#include <asm/mach-types.h> 17#include <asm/mach-types.h>
19#include <plat/display.h> 18#include <plat/display.h>
20#include <plat/vram.h> 19#include <plat/vram.h>
@@ -49,8 +48,16 @@ static struct omap_dss_device rx51_lcd_device = {
49 .platform_disable = rx51_lcd_disable, 48 .platform_disable = rx51_lcd_disable,
50}; 49};
51 50
51static struct omap_dss_device rx51_tv_device = {
52 .name = "tv",
53 .type = OMAP_DISPLAY_TYPE_VENC,
54 .driver_name = "venc",
55 .phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
56};
57
52static struct omap_dss_device *rx51_dss_devices[] = { 58static struct omap_dss_device *rx51_dss_devices[] = {
53 &rx51_lcd_device, 59 &rx51_lcd_device,
60 &rx51_tv_device,
54}; 61};
55 62
56static struct omap_dss_board_info rx51_dss_board_info = { 63static struct omap_dss_board_info rx51_dss_board_info = {
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 36f2cf4efd57..f53fc551c58f 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -32,10 +32,10 @@
32 32
33#include "mux.h" 33#include "mux.h"
34#include "pm.h" 34#include "pm.h"
35#include "sdram-nokia.h"
35 36
36#define RX51_GPIO_SLEEP_IND 162 37#define RX51_GPIO_SLEEP_IND 162
37 38
38struct omap_sdrc_params *rx51_get_sdram_timings(void);
39extern void rx51_video_mem_init(void); 39extern void rx51_video_mem_init(void);
40 40
41static struct gpio_led gpio_leds[] = { 41static struct gpio_led gpio_leds[] = {
@@ -105,10 +105,10 @@ static void __init rx51_init_irq(void)
105 omap_board_config = rx51_config; 105 omap_board_config = rx51_config;
106 omap_board_config_size = ARRAY_SIZE(rx51_config); 106 omap_board_config_size = ARRAY_SIZE(rx51_config);
107 omap3_pm_init_cpuidle(rx51_cpuidle_params); 107 omap3_pm_init_cpuidle(rx51_cpuidle_params);
108 sdrc_params = rx51_get_sdram_timings(); 108 omap2_init_common_infrastructure();
109 omap2_init_common_hw(sdrc_params, sdrc_params); 109 sdrc_params = nokia_get_sdram_timings();
110 omap2_init_common_devices(sdrc_params, sdrc_params);
110 omap_init_irq(); 111 omap_init_irq();
111 omap_gpio_init();
112} 112}
113 113
114extern void __init rx51_peripherals_init(void); 114extern void __init rx51_peripherals_init(void);
@@ -117,8 +117,6 @@ extern void __init rx51_peripherals_init(void);
117static struct omap_board_mux board_mux[] __initdata = { 117static struct omap_board_mux board_mux[] __initdata = {
118 { .reg_offset = OMAP_MUX_TERMINATOR }, 118 { .reg_offset = OMAP_MUX_TERMINATOR },
119}; 119};
120#else
121#define board_mux NULL
122#endif 120#endif
123 121
124static struct omap_musb_board_data musb_board_data = { 122static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 9db9203667df..3fbd0edd712e 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -196,7 +196,7 @@ struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
196 .board_ref_clock = 1, 196 .board_ref_clock = 1,
197}; 197};
198 198
199static struct omap2_hsmmc_info mmc[] __initdata = { 199static struct omap2_hsmmc_info mmc[] = {
200 { 200 {
201 .name = "external", 201 .name = "external",
202 .mmc = 1, 202 .mmc = 1,
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom.c
index 5adde12c0395..e041c537ea37 100644
--- a/arch/arm/mach-omap2/board-zoom3.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -1,6 +1,9 @@
1/* 1/*
2 * Copyright (C) 2009 Texas Instruments Inc. 2 * Copyright (C) 2009-2010 Texas Instruments Inc.
3 * Mikkel Christensen <mlc@ti.com>
4 * Felipe Balbi <balbi@ti.com>
3 * 5 *
6 * Modified from mach-omap2/board-ldp.c
4 * 7 *
5 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -12,22 +15,55 @@
12#include <linux/platform_device.h> 15#include <linux/platform_device.h>
13#include <linux/input.h> 16#include <linux/input.h>
14#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/i2c/twl.h>
15 19
16#include <asm/mach-types.h> 20#include <asm/mach-types.h>
17#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
18 22
19#include <mach/board-zoom.h>
20
21#include <plat/common.h> 23#include <plat/common.h>
22#include <plat/board.h> 24#include <plat/board.h>
23#include <plat/usb.h> 25#include <plat/usb.h>
24 26
27#include <mach/board-zoom.h>
28
25#include "board-flash.h" 29#include "board-flash.h"
26#include "mux.h" 30#include "mux.h"
31#include "sdram-micron-mt46h32m32lf-6.h"
27#include "sdram-hynix-h8mbx00u0mer-0em.h" 32#include "sdram-hynix-h8mbx00u0mer-0em.h"
28 33
29static struct omap_board_config_kernel zoom_config[] __initdata = { 34#define ZOOM3_EHCI_RESET_GPIO 64
35
36static void __init omap_zoom_init_irq(void)
37{
38 omap2_init_common_infrastructure();
39 if (machine_is_omap_zoom2())
40 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
41 mt46h32m32lf6_sdrc_params);
42 else if (machine_is_omap_zoom3())
43 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
44 h8mbx00u0mer0em_sdrc_params);
45
46 omap_init_irq();
47}
48
49#ifdef CONFIG_OMAP_MUX
50static struct omap_board_mux board_mux[] __initdata = {
51 /* WLAN IRQ - GPIO 162 */
52 OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
53 /* WLAN POWER ENABLE - GPIO 101 */
54 OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
55 /* WLAN SDIO: MMC3 CMD */
56 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
57 /* WLAN SDIO: MMC3 CLK */
58 OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
59 /* WLAN SDIO: MMC3 DAT[0-3] */
60 OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
61 OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
62 OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
63 OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
64 { .reg_offset = OMAP_MUX_TERMINATOR },
30}; 65};
66#endif
31 67
32static struct mtd_partition zoom_nand_partitions[] = { 68static struct mtd_partition zoom_nand_partitions[] = {
33 /* All the partition sizes are listed in terms of NAND block size */ 69 /* All the partition sizes are listed in terms of NAND block size */
@@ -70,59 +106,41 @@ static struct mtd_partition zoom_nand_partitions[] = {
70 }, 106 },
71}; 107};
72 108
73static void __init omap_zoom_init_irq(void)
74{
75 omap_board_config = zoom_config;
76 omap_board_config_size = ARRAY_SIZE(zoom_config);
77 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
78 h8mbx00u0mer0em_sdrc_params);
79 omap_init_irq();
80 omap_gpio_init();
81}
82
83#ifdef CONFIG_OMAP_MUX
84static struct omap_board_mux board_mux[] __initdata = {
85 /* WLAN IRQ - GPIO 162 */
86 OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
87 /* WLAN POWER ENABLE - GPIO 101 */
88 OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
89 /* WLAN SDIO: MMC3 CMD */
90 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
91 /* WLAN SDIO: MMC3 CLK */
92 OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
93 /* WLAN SDIO: MMC3 DAT[0-3] */
94 OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
95 OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
96 OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
97 OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
98 { .reg_offset = OMAP_MUX_TERMINATOR },
99};
100#else
101#define board_mux NULL
102#endif
103
104static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 109static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
105 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 110 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
106 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 111 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
107 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 112 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
108 .phy_reset = true, 113 .phy_reset = true,
109 .reset_gpio_port[0] = -EINVAL, 114 .reset_gpio_port[0] = -EINVAL,
110 .reset_gpio_port[1] = 64, 115 .reset_gpio_port[1] = ZOOM3_EHCI_RESET_GPIO,
111 .reset_gpio_port[2] = -EINVAL, 116 .reset_gpio_port[2] = -EINVAL,
112}; 117};
113 118
114static void __init omap_zoom_init(void) 119static void __init omap_zoom_init(void)
115{ 120{
116 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); 121 if (machine_is_omap_zoom2()) {
117 zoom_peripherals_init(); 122 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
123 } else if (machine_is_omap_zoom3()) {
124 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
125 omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT);
126 usb_ehci_init(&ehci_pdata);
127 }
128
118 board_nand_init(zoom_nand_partitions, 129 board_nand_init(zoom_nand_partitions,
119 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); 130 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
120 zoom_debugboard_init(); 131 zoom_debugboard_init();
121 132 zoom_peripherals_init();
122 omap_mux_init_gpio(64, OMAP_PIN_OUTPUT);
123 usb_ehci_init(&ehci_pdata);
124} 133}
125 134
135MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
136 .boot_params = 0x80000100,
137 .map_io = omap3_map_io,
138 .reserve = omap_reserve,
139 .init_irq = omap_zoom_init_irq,
140 .init_machine = omap_zoom_init,
141 .timer = &omap_timer,
142MACHINE_END
143
126MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") 144MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
127 .boot_params = 0x80000100, 145 .boot_params = 0x80000100,
128 .map_io = omap3_map_io, 146 .map_io = omap3_map_io,
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
deleted file mode 100644
index 2992a9f3a585..000000000000
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ /dev/null
@@ -1,117 +0,0 @@
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/input.h>
16#include <linux/gpio.h>
17#include <linux/i2c/twl.h>
18
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21
22#include <plat/common.h>
23#include <plat/board.h>
24
25#include <mach/board-zoom.h>
26
27#include "board-flash.h"
28#include "mux.h"
29#include "sdram-micron-mt46h32m32lf-6.h"
30
31static void __init omap_zoom2_init_irq(void)
32{
33 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
34 mt46h32m32lf6_sdrc_params);
35 omap_init_irq();
36 omap_gpio_init();
37}
38
39#ifdef CONFIG_OMAP_MUX
40static struct omap_board_mux board_mux[] __initdata = {
41 /* WLAN IRQ - GPIO 162 */
42 OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
43 /* WLAN POWER ENABLE - GPIO 101 */
44 OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
45 /* WLAN SDIO: MMC3 CMD */
46 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
47 /* WLAN SDIO: MMC3 CLK */
48 OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
49 /* WLAN SDIO: MMC3 DAT[0-3] */
50 OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
51 OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
52 OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
53 OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
54 { .reg_offset = OMAP_MUX_TERMINATOR },
55};
56#else
57#define board_mux NULL
58#endif
59
60static struct mtd_partition zoom_nand_partitions[] = {
61 /* All the partition sizes are listed in terms of NAND block size */
62 {
63 .name = "X-Loader-NAND",
64 .offset = 0,
65 .size = 4 * (64 * 2048), /* 512KB, 0x80000 */
66 .mask_flags = MTD_WRITEABLE, /* force read-only */
67 },
68 {
69 .name = "U-Boot-NAND",
70 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
71 .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */
72 .mask_flags = MTD_WRITEABLE, /* force read-only */
73 },
74 {
75 .name = "Boot Env-NAND",
76 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
77 .size = 2 * (64 * 2048), /* 256KB, 0x40000 */
78 },
79 {
80 .name = "Kernel-NAND",
81 .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/
82 .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */
83 },
84 {
85 .name = "system",
86 .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */
87 .size = 3328 * (64 * 2048), /* 416M, 0x1A000000 */
88 },
89 {
90 .name = "userdata",
91 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1C000000*/
92 .size = 256 * (64 * 2048), /* 32M, 0x2000000 */
93 },
94 {
95 .name = "cache",
96 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1E000000*/
97 .size = 256 * (64 * 2048), /* 32M, 0x2000000 */
98 },
99};
100
101static void __init omap_zoom2_init(void)
102{
103 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
104 zoom_peripherals_init();
105 board_nand_init(zoom_nand_partitions,
106 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
107 zoom_debugboard_init();
108}
109
110MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
111 .boot_params = 0x80000100,
112 .map_io = omap3_map_io,
113 .reserve = omap_reserve,
114 .init_irq = omap_zoom2_init_irq,
115 .init_machine = omap_zoom2_init,
116 .timer = &omap_timer,
117MACHINE_END
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c
index 66e01acfd585..f51cffd1fc53 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -26,7 +26,7 @@
26 26
27#include "clock.h" 27#include "clock.h"
28#include "clock2xxx.h" 28#include "clock2xxx.h"
29#include "cm.h" 29#include "cm2xxx_3xxx.h"
30#include "cm-regbits-24xx.h" 30#include "cm-regbits-24xx.h"
31 31
32/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ 32/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
@@ -49,14 +49,14 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
49 49
50 apll_mask = EN_APLL_LOCKED << clk->enable_bit; 50 apll_mask = EN_APLL_LOCKED << clk->enable_bit;
51 51
52 cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); 52 cval = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
53 53
54 if ((cval & apll_mask) == apll_mask) 54 if ((cval & apll_mask) == apll_mask)
55 return 0; /* apll already enabled */ 55 return 0; /* apll already enabled */
56 56
57 cval &= ~apll_mask; 57 cval &= ~apll_mask;
58 cval |= apll_mask; 58 cval |= apll_mask;
59 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 59 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
60 60
61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask, 61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask,
62 OMAP24XX_CM_IDLEST_VAL, clk->name); 62 OMAP24XX_CM_IDLEST_VAL, clk->name);
@@ -83,9 +83,9 @@ static void omap2_clk_apll_disable(struct clk *clk)
83{ 83{
84 u32 cval; 84 u32 cval;
85 85
86 cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); 86 cval = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
87 cval &= ~(EN_APLL_LOCKED << clk->enable_bit); 87 cval &= ~(EN_APLL_LOCKED << clk->enable_bit);
88 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 88 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
89} 89}
90 90
91/* Public data */ 91/* Public data */
@@ -106,7 +106,7 @@ u32 omap2xxx_get_apll_clkin(void)
106{ 106{
107 u32 aplls, srate = 0; 107 u32 aplls, srate = 0;
108 108
109 aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); 109 aplls = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
110 aplls &= OMAP24XX_APLLS_CLKIN_MASK; 110 aplls &= OMAP24XX_APLLS_CLKIN_MASK;
111 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; 111 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT;
112 112
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
index 019048434f13..4ae439222085 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
@@ -32,7 +32,7 @@
32#include "clock.h" 32#include "clock.h"
33#include "clock2xxx.h" 33#include "clock2xxx.h"
34#include "opp2xxx.h" 34#include "opp2xxx.h"
35#include "cm.h" 35#include "cm2xxx_3xxx.h"
36#include "cm-regbits-24xx.h" 36#include "cm-regbits-24xx.h"
37 37
38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ 38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
@@ -54,7 +54,7 @@ unsigned long omap2xxx_clk_get_core_rate(struct clk *clk)
54 54
55 core_clk = omap2_get_dpll_rate(clk); 55 core_clk = omap2_get_dpll_rate(clk);
56 56
57 v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 57 v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
58 v &= OMAP24XX_CORE_CLK_SRC_MASK; 58 v &= OMAP24XX_CORE_CLK_SRC_MASK;
59 59
60 if (v == CORE_CLK_SRC_32K) 60 if (v == CORE_CLK_SRC_32K)
@@ -73,7 +73,7 @@ static long omap2_dpllcore_round_rate(unsigned long target_rate)
73{ 73{
74 u32 high, low, core_clk_src; 74 u32 high, low, core_clk_src;
75 75
76 core_clk_src = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 76 core_clk_src = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
77 core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK; 77 core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK;
78 78
79 if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */ 79 if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */
@@ -111,7 +111,7 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
111 const struct dpll_data *dd; 111 const struct dpll_data *dd;
112 112
113 cur_rate = omap2xxx_clk_get_core_rate(dclk); 113 cur_rate = omap2xxx_clk_get_core_rate(dclk);
114 mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 114 mult = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
115 mult &= OMAP24XX_CORE_CLK_SRC_MASK; 115 mult &= OMAP24XX_CORE_CLK_SRC_MASK;
116 116
117 if ((rate == (cur_rate / 2)) && (mult == 2)) { 117 if ((rate == (cur_rate / 2)) && (mult == 2)) {
@@ -136,7 +136,7 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
136 tmpset.cm_clksel1_pll &= ~(dd->mult_mask | 136 tmpset.cm_clksel1_pll &= ~(dd->mult_mask |
137 dd->div1_mask); 137 dd->div1_mask);
138 div = ((curr_prcm_set->xtal_speed / 1000000) - 1); 138 div = ((curr_prcm_set->xtal_speed / 1000000) - 1);
139 tmpset.cm_clksel2_pll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 139 tmpset.cm_clksel2_pll = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
140 tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK; 140 tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK;
141 if (rate > low) { 141 if (rate > low) {
142 tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2; 142 tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2;
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c
index 2167be84a5bc..df7b80506483 100644
--- a/arch/arm/mach-omap2/clkt2xxx_osc.c
+++ b/arch/arm/mach-omap2/clkt2xxx_osc.c
@@ -27,7 +27,7 @@
27 27
28#include "clock.h" 28#include "clock.h"
29#include "clock2xxx.h" 29#include "clock2xxx.h"
30#include "prm.h" 30#include "prm2xxx_3xxx.h"
31#include "prm-regbits-24xx.h" 31#include "prm-regbits-24xx.h"
32 32
33static int omap2_enable_osc_ck(struct clk *clk) 33static int omap2_enable_osc_ck(struct clk *clk)
diff --git a/arch/arm/mach-omap2/clkt2xxx_sys.c b/arch/arm/mach-omap2/clkt2xxx_sys.c
index 822b5a79f457..8693cfdac49a 100644
--- a/arch/arm/mach-omap2/clkt2xxx_sys.c
+++ b/arch/arm/mach-omap2/clkt2xxx_sys.c
@@ -26,7 +26,7 @@
26 26
27#include "clock.h" 27#include "clock.h"
28#include "clock2xxx.h" 28#include "clock2xxx.h"
29#include "prm.h" 29#include "prm2xxx_3xxx.h"
30#include "prm-regbits-24xx.h" 30#include "prm-regbits-24xx.h"
31 31
32void __iomem *prcm_clksrc_ctrl; 32void __iomem *prcm_clksrc_ctrl;
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index aef62918aaf0..39f9d5a58d0c 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -40,7 +40,7 @@
40#include "clock.h" 40#include "clock.h"
41#include "clock2xxx.h" 41#include "clock2xxx.h"
42#include "opp2xxx.h" 42#include "opp2xxx.h"
43#include "cm.h" 43#include "cm2xxx_3xxx.h"
44#include "cm-regbits-24xx.h" 44#include "cm-regbits-24xx.h"
45 45
46const struct prcm_config *curr_prcm_set; 46const struct prcm_config *curr_prcm_set;
@@ -133,21 +133,21 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
133 done_rate = CORE_CLK_SRC_DPLL; 133 done_rate = CORE_CLK_SRC_DPLL;
134 134
135 /* MPU divider */ 135 /* MPU divider */
136 cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL); 136 omap2_cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL);
137 137
138 /* dsp + iva1 div(2420), iva2.1(2430) */ 138 /* dsp + iva1 div(2420), iva2.1(2430) */
139 cm_write_mod_reg(prcm->cm_clksel_dsp, 139 omap2_cm_write_mod_reg(prcm->cm_clksel_dsp,
140 OMAP24XX_DSP_MOD, CM_CLKSEL); 140 OMAP24XX_DSP_MOD, CM_CLKSEL);
141 141
142 cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL); 142 omap2_cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL);
143 143
144 /* Major subsystem dividers */ 144 /* Major subsystem dividers */
145 tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; 145 tmp = omap2_cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK;
146 cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, 146 omap2_cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD,
147 CM_CLKSEL1); 147 CM_CLKSEL1);
148 148
149 if (cpu_is_omap2430()) 149 if (cpu_is_omap2430())
150 cm_write_mod_reg(prcm->cm_clksel_mdm, 150 omap2_cm_write_mod_reg(prcm->cm_clksel_mdm,
151 OMAP2430_MDM_MOD, CM_CLKSEL); 151 OMAP2430_MDM_MOD, CM_CLKSEL);
152 152
153 /* x2 to enter omap2xxx_sdrc_init_params() */ 153 /* x2 to enter omap2xxx_sdrc_init_params() */
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index 6ce512e902c6..337392c3f549 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -24,7 +24,6 @@
24#include <plat/clock.h> 24#include <plat/clock.h>
25 25
26#include "clock.h" 26#include "clock.h"
27#include "cm.h"
28#include "cm-regbits-24xx.h" 27#include "cm-regbits-24xx.h"
29#include "cm-regbits-34xx.h" 28#include "cm-regbits-34xx.h"
30 29
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index b5babf5440e4..2a2f15213add 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -24,14 +24,12 @@
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25 25
26#include <plat/clock.h> 26#include <plat/clock.h>
27#include <plat/clockdomain.h> 27#include "clockdomain.h"
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/prcm.h> 29#include <plat/prcm.h>
30 30
31#include "clock.h" 31#include "clock.h"
32#include "prm.h" 32#include "cm2xxx_3xxx.h"
33#include "prm-regbits-24xx.h"
34#include "cm.h"
35#include "cm-regbits-24xx.h" 33#include "cm-regbits-24xx.h"
36#include "cm-regbits-34xx.h" 34#include "cm-regbits-34xx.h"
37 35
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index a535c7a2a62a..896584e3c4ab 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -49,7 +49,6 @@
49 49
50/* DPLL Type and DCO Selection Flags */ 50/* DPLL Type and DCO Selection Flags */
51#define DPLL_J_TYPE 0x1 51#define DPLL_J_TYPE 0x1
52#define DPLL_NO_DCO_SEL 0x2
53 52
54int omap2_clk_enable(struct clk *clk); 53int omap2_clk_enable(struct clk *clk);
55void omap2_clk_disable(struct clk *clk); 54void omap2_clk_disable(struct clk *clk);
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 21f856252ad8..ed1295f5046e 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -22,8 +22,8 @@
22#include "clock.h" 22#include "clock.h"
23#include "clock2xxx.h" 23#include "clock2xxx.h"
24#include "opp2xxx.h" 24#include "opp2xxx.h"
25#include "prm.h" 25#include "cm2xxx_3xxx.h"
26#include "cm.h" 26#include "prm2xxx_3xxx.h"
27#include "prm-regbits-24xx.h" 27#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "sdrc.h" 29#include "sdrc.h"
@@ -812,7 +812,7 @@ static struct clk dss2_fck = { /* Alt clk used in power management */
812 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), 812 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
813 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK, 813 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
814 .clksel = dss2_fck_clksel, 814 .clksel = dss2_fck_clksel,
815 .recalc = &followparent_recalc, 815 .recalc = &omap2_clksel_recalc,
816}; 816};
817 817
818static struct clk dss_54m_fck = { /* Alt clk used in power management */ 818static struct clk dss_54m_fck = { /* Alt clk used in power management */
@@ -1862,10 +1862,10 @@ static struct omap_clk omap2420_clks[] = {
1862 CLK(NULL, "eac_fck", &eac_fck, CK_242X), 1862 CLK(NULL, "eac_fck", &eac_fck, CK_242X),
1863 CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X), 1863 CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X),
1864 CLK("omap_hdq.1", "fck", &hdq_fck, CK_242X), 1864 CLK("omap_hdq.1", "fck", &hdq_fck, CK_242X),
1865 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_242X), 1865 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X),
1866 CLK("i2c_omap.1", "fck", &i2c1_fck, CK_242X), 1866 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_242X),
1867 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_242X), 1867 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X),
1868 CLK("i2c_omap.2", "fck", &i2c2_fck, CK_242X), 1868 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_242X),
1869 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), 1869 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
1870 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), 1870 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
1871 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), 1871 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c
index 44d0cccc51a9..d87bc9cb2a36 100644
--- a/arch/arm/mach-omap2/clock2430.c
+++ b/arch/arm/mach-omap2/clock2430.c
@@ -25,7 +25,7 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock2xxx.h" 27#include "clock2xxx.h"
28#include "cm.h" 28#include "cm2xxx_3xxx.h"
29#include "cm-regbits-24xx.h" 29#include "cm-regbits-24xx.h"
30 30
31/** 31/**
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index e32afcbdfb88..38341a71c6f8 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -22,8 +22,8 @@
22#include "clock.h" 22#include "clock.h"
23#include "clock2xxx.h" 23#include "clock2xxx.h"
24#include "opp2xxx.h" 24#include "opp2xxx.h"
25#include "prm.h" 25#include "cm2xxx_3xxx.h"
26#include "cm.h" 26#include "prm2xxx_3xxx.h"
27#include "prm-regbits-24xx.h" 27#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "sdrc.h" 29#include "sdrc.h"
@@ -800,7 +800,7 @@ static struct clk dss2_fck = { /* Alt clk used in power management */
800 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), 800 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
801 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK, 801 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
802 .clksel = dss2_fck_clksel, 802 .clksel = dss2_fck_clksel,
803 .recalc = &followparent_recalc, 803 .recalc = &omap2_clksel_recalc,
804}; 804};
805 805
806static struct clk dss_54m_fck = { /* Alt clk used in power management */ 806static struct clk dss_54m_fck = { /* Alt clk used in power management */
@@ -1969,10 +1969,10 @@ static struct omap_clk omap2430_clks[] = {
1969 CLK(NULL, "fac_fck", &fac_fck, CK_243X), 1969 CLK(NULL, "fac_fck", &fac_fck, CK_243X),
1970 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X), 1970 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1971 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X), 1971 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
1972 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X), 1972 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
1973 CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X), 1973 CLK("omap_i2c.1", "fck", &i2chs1_fck, CK_243X),
1974 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X), 1974 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
1975 CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X), 1975 CLK("omap_i2c.2", "fck", &i2chs2_fck, CK_243X),
1976 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X), 1976 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1977 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X), 1977 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
1978 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X), 1978 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 6febd5f11e85..287abc480924 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -25,7 +25,7 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock34xx.h" 27#include "clock34xx.h"
28#include "cm.h" 28#include "cm2xxx_3xxx.h"
29#include "cm-regbits-34xx.h" 29#include "cm-regbits-34xx.h"
30 30
31/** 31/**
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c
index b496a9305e1c..74116a3cf099 100644
--- a/arch/arm/mach-omap2/clock3517.c
+++ b/arch/arm/mach-omap2/clock3517.c
@@ -25,7 +25,7 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock3517.h" 27#include "clock3517.h"
28#include "cm.h" 28#include "cm2xxx_3xxx.h"
29#include "cm-regbits-34xx.h" 29#include "cm-regbits-34xx.h"
30 30
31/* 31/*
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index a447c4d2c28a..e9f66b6dec18 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -25,9 +25,9 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock3xxx.h" 27#include "clock3xxx.h"
28#include "prm.h" 28#include "prm2xxx_3xxx.h"
29#include "prm-regbits-34xx.h" 29#include "prm-regbits-34xx.h"
30#include "cm.h" 30#include "cm2xxx_3xxx.h"
31#include "cm-regbits-34xx.h" 31#include "cm-regbits-34xx.h"
32 32
33/* 33/*
@@ -94,7 +94,7 @@ static int __init omap3xxx_clk_arch_init(void)
94 94
95 ret = omap2_clk_switch_mpurate_at_boot("dpll1_ck"); 95 ret = omap2_clk_switch_mpurate_at_boot("dpll1_ck");
96 if (!ret) 96 if (!ret)
97 omap2_clk_print_new_rates("osc_sys_ck", "arm_fck", "core_ck"); 97 omap2_clk_print_new_rates("osc_sys_ck", "core_ck", "arm_fck");
98 98
99 return ret; 99 return ret;
100} 100}
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index d85ecd5aebfd..9ab817e6c300 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -28,9 +28,9 @@
28#include "clock36xx.h" 28#include "clock36xx.h"
29#include "clock3517.h" 29#include "clock3517.h"
30 30
31#include "cm.h" 31#include "cm2xxx_3xxx.h"
32#include "cm-regbits-34xx.h" 32#include "cm-regbits-34xx.h"
33#include "prm.h" 33#include "prm2xxx_3xxx.h"
34#include "prm-regbits-34xx.h" 34#include "prm-regbits-34xx.h"
35#include "control.h" 35#include "control.h"
36 36
@@ -120,7 +120,7 @@ static const struct clksel_rate osc_sys_13m_rates[] = {
120}; 120};
121 121
122static const struct clksel_rate osc_sys_16_8m_rates[] = { 122static const struct clksel_rate osc_sys_16_8m_rates[] = {
123 { .div = 1, .val = 5, .flags = RATE_IN_3430ES2PLUS }, 123 { .div = 1, .val = 5, .flags = RATE_IN_3430ES2PLUS_36XX },
124 { .div = 0 } 124 { .div = 0 }
125}; 125};
126 126
@@ -452,35 +452,35 @@ static struct clk dpll3_x2_ck = {
452static const struct clksel_rate div31_dpll3_rates[] = { 452static const struct clksel_rate div31_dpll3_rates[] = {
453 { .div = 1, .val = 1, .flags = RATE_IN_3XXX }, 453 { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
454 { .div = 2, .val = 2, .flags = RATE_IN_3XXX }, 454 { .div = 2, .val = 2, .flags = RATE_IN_3XXX },
455 { .div = 3, .val = 3, .flags = RATE_IN_3430ES2PLUS }, 455 { .div = 3, .val = 3, .flags = RATE_IN_3430ES2PLUS_36XX },
456 { .div = 4, .val = 4, .flags = RATE_IN_3430ES2PLUS }, 456 { .div = 4, .val = 4, .flags = RATE_IN_3430ES2PLUS_36XX },
457 { .div = 5, .val = 5, .flags = RATE_IN_3430ES2PLUS }, 457 { .div = 5, .val = 5, .flags = RATE_IN_3430ES2PLUS_36XX },
458 { .div = 6, .val = 6, .flags = RATE_IN_3430ES2PLUS }, 458 { .div = 6, .val = 6, .flags = RATE_IN_3430ES2PLUS_36XX },
459 { .div = 7, .val = 7, .flags = RATE_IN_3430ES2PLUS }, 459 { .div = 7, .val = 7, .flags = RATE_IN_3430ES2PLUS_36XX },
460 { .div = 8, .val = 8, .flags = RATE_IN_3430ES2PLUS }, 460 { .div = 8, .val = 8, .flags = RATE_IN_3430ES2PLUS_36XX },
461 { .div = 9, .val = 9, .flags = RATE_IN_3430ES2PLUS }, 461 { .div = 9, .val = 9, .flags = RATE_IN_3430ES2PLUS_36XX },
462 { .div = 10, .val = 10, .flags = RATE_IN_3430ES2PLUS }, 462 { .div = 10, .val = 10, .flags = RATE_IN_3430ES2PLUS_36XX },
463 { .div = 11, .val = 11, .flags = RATE_IN_3430ES2PLUS }, 463 { .div = 11, .val = 11, .flags = RATE_IN_3430ES2PLUS_36XX },
464 { .div = 12, .val = 12, .flags = RATE_IN_3430ES2PLUS }, 464 { .div = 12, .val = 12, .flags = RATE_IN_3430ES2PLUS_36XX },
465 { .div = 13, .val = 13, .flags = RATE_IN_3430ES2PLUS }, 465 { .div = 13, .val = 13, .flags = RATE_IN_3430ES2PLUS_36XX },
466 { .div = 14, .val = 14, .flags = RATE_IN_3430ES2PLUS }, 466 { .div = 14, .val = 14, .flags = RATE_IN_3430ES2PLUS_36XX },
467 { .div = 15, .val = 15, .flags = RATE_IN_3430ES2PLUS }, 467 { .div = 15, .val = 15, .flags = RATE_IN_3430ES2PLUS_36XX },
468 { .div = 16, .val = 16, .flags = RATE_IN_3430ES2PLUS }, 468 { .div = 16, .val = 16, .flags = RATE_IN_3430ES2PLUS_36XX },
469 { .div = 17, .val = 17, .flags = RATE_IN_3430ES2PLUS }, 469 { .div = 17, .val = 17, .flags = RATE_IN_3430ES2PLUS_36XX },
470 { .div = 18, .val = 18, .flags = RATE_IN_3430ES2PLUS }, 470 { .div = 18, .val = 18, .flags = RATE_IN_3430ES2PLUS_36XX },
471 { .div = 19, .val = 19, .flags = RATE_IN_3430ES2PLUS }, 471 { .div = 19, .val = 19, .flags = RATE_IN_3430ES2PLUS_36XX },
472 { .div = 20, .val = 20, .flags = RATE_IN_3430ES2PLUS }, 472 { .div = 20, .val = 20, .flags = RATE_IN_3430ES2PLUS_36XX },
473 { .div = 21, .val = 21, .flags = RATE_IN_3430ES2PLUS }, 473 { .div = 21, .val = 21, .flags = RATE_IN_3430ES2PLUS_36XX },
474 { .div = 22, .val = 22, .flags = RATE_IN_3430ES2PLUS }, 474 { .div = 22, .val = 22, .flags = RATE_IN_3430ES2PLUS_36XX },
475 { .div = 23, .val = 23, .flags = RATE_IN_3430ES2PLUS }, 475 { .div = 23, .val = 23, .flags = RATE_IN_3430ES2PLUS_36XX },
476 { .div = 24, .val = 24, .flags = RATE_IN_3430ES2PLUS }, 476 { .div = 24, .val = 24, .flags = RATE_IN_3430ES2PLUS_36XX },
477 { .div = 25, .val = 25, .flags = RATE_IN_3430ES2PLUS }, 477 { .div = 25, .val = 25, .flags = RATE_IN_3430ES2PLUS_36XX },
478 { .div = 26, .val = 26, .flags = RATE_IN_3430ES2PLUS }, 478 { .div = 26, .val = 26, .flags = RATE_IN_3430ES2PLUS_36XX },
479 { .div = 27, .val = 27, .flags = RATE_IN_3430ES2PLUS }, 479 { .div = 27, .val = 27, .flags = RATE_IN_3430ES2PLUS_36XX },
480 { .div = 28, .val = 28, .flags = RATE_IN_3430ES2PLUS }, 480 { .div = 28, .val = 28, .flags = RATE_IN_3430ES2PLUS_36XX },
481 { .div = 29, .val = 29, .flags = RATE_IN_3430ES2PLUS }, 481 { .div = 29, .val = 29, .flags = RATE_IN_3430ES2PLUS_36XX },
482 { .div = 30, .val = 30, .flags = RATE_IN_3430ES2PLUS }, 482 { .div = 30, .val = 30, .flags = RATE_IN_3430ES2PLUS_36XX },
483 { .div = 31, .val = 31, .flags = RATE_IN_3430ES2PLUS }, 483 { .div = 31, .val = 31, .flags = RATE_IN_3430ES2PLUS_36XX },
484 { .div = 0 }, 484 { .div = 0 },
485}; 485};
486 486
@@ -602,6 +602,8 @@ static struct dpll_data dpll4_dd_3630 __initdata = {
602 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK, 602 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
603 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 603 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
604 .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK, 604 .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
605 .dco_mask = OMAP3630_PERIPH_DPLL_DCO_SEL_MASK,
606 .sddiv_mask = OMAP3630_PERIPH_DPLL_SD_DIV_MASK,
605 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, 607 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
606 .min_divider = 1, 608 .min_divider = 1,
607 .max_divider = OMAP3_MAX_DPLL_DIV, 609 .max_divider = OMAP3_MAX_DPLL_DIV,
@@ -1558,6 +1560,7 @@ static struct clk mcspi4_fck = {
1558 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1560 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1559 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, 1561 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
1560 .recalc = &followparent_recalc, 1562 .recalc = &followparent_recalc,
1563 .clkdm_name = "core_l4_clkdm",
1561}; 1564};
1562 1565
1563static struct clk mcspi3_fck = { 1566static struct clk mcspi3_fck = {
@@ -1567,6 +1570,7 @@ static struct clk mcspi3_fck = {
1567 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1570 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1568 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, 1571 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
1569 .recalc = &followparent_recalc, 1572 .recalc = &followparent_recalc,
1573 .clkdm_name = "core_l4_clkdm",
1570}; 1574};
1571 1575
1572static struct clk mcspi2_fck = { 1576static struct clk mcspi2_fck = {
@@ -1576,6 +1580,7 @@ static struct clk mcspi2_fck = {
1576 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1580 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1577 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, 1581 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
1578 .recalc = &followparent_recalc, 1582 .recalc = &followparent_recalc,
1583 .clkdm_name = "core_l4_clkdm",
1579}; 1584};
1580 1585
1581static struct clk mcspi1_fck = { 1586static struct clk mcspi1_fck = {
@@ -1585,6 +1590,7 @@ static struct clk mcspi1_fck = {
1585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1590 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1586 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, 1591 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
1587 .recalc = &followparent_recalc, 1592 .recalc = &followparent_recalc,
1593 .clkdm_name = "core_l4_clkdm",
1588}; 1594};
1589 1595
1590static struct clk uart2_fck = { 1596static struct clk uart2_fck = {
@@ -3044,6 +3050,7 @@ static struct clk sr1_fck = {
3044 .parent = &sys_ck, 3050 .parent = &sys_ck,
3045 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 3051 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
3046 .enable_bit = OMAP3430_EN_SR1_SHIFT, 3052 .enable_bit = OMAP3430_EN_SR1_SHIFT,
3053 .clkdm_name = "wkup_clkdm",
3047 .recalc = &followparent_recalc, 3054 .recalc = &followparent_recalc,
3048}; 3055};
3049 3056
@@ -3054,6 +3061,7 @@ static struct clk sr2_fck = {
3054 .parent = &sys_ck, 3061 .parent = &sys_ck,
3055 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 3062 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
3056 .enable_bit = OMAP3430_EN_SR2_SHIFT, 3063 .enable_bit = OMAP3430_EN_SR2_SHIFT,
3064 .clkdm_name = "wkup_clkdm",
3057 .recalc = &followparent_recalc, 3065 .recalc = &followparent_recalc,
3058}; 3066};
3059 3067
@@ -3201,7 +3209,7 @@ static struct omap_clk omap3xxx_clks[] = {
3201 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX), 3209 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX),
3202 CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_3XXX), 3210 CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_3XXX),
3203 CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_3XXX), 3211 CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_3XXX),
3204 CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2 | CK_AM35XX), 3212 CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3205 CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_3XXX), 3213 CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_3XXX),
3206 CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_3XXX), 3214 CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_3XXX),
3207 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), 3215 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX),
@@ -3218,8 +3226,8 @@ static struct omap_clk omap3xxx_clks[] = {
3218 CLK(NULL, "dpll1_ck", &dpll1_ck, CK_3XXX), 3226 CLK(NULL, "dpll1_ck", &dpll1_ck, CK_3XXX),
3219 CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_3XXX), 3227 CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_3XXX),
3220 CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_3XXX), 3228 CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_3XXX),
3221 CLK(NULL, "dpll2_ck", &dpll2_ck, CK_343X), 3229 CLK(NULL, "dpll2_ck", &dpll2_ck, CK_34XX | CK_36XX),
3222 CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_343X), 3230 CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_34XX | CK_36XX),
3223 CLK(NULL, "dpll3_ck", &dpll3_ck, CK_3XXX), 3231 CLK(NULL, "dpll3_ck", &dpll3_ck, CK_3XXX),
3224 CLK(NULL, "core_ck", &core_ck, CK_3XXX), 3232 CLK(NULL, "core_ck", &core_ck, CK_3XXX),
3225 CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_3XXX), 3233 CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_3XXX),
@@ -3248,8 +3256,8 @@ static struct omap_clk omap3xxx_clks[] = {
3248 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX), 3256 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX),
3249 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX), 3257 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX),
3250 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX), 3258 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX),
3251 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2 | CK_AM35XX), 3259 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3252 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2 | CK_AM35XX), 3260 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3253 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_3XXX), 3261 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_3XXX),
3254 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_3XXX), 3262 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_3XXX),
3255 CLK(NULL, "corex2_fck", &corex2_fck, CK_3XXX), 3263 CLK(NULL, "corex2_fck", &corex2_fck, CK_3XXX),
@@ -3257,8 +3265,8 @@ static struct omap_clk omap3xxx_clks[] = {
3257 CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX), 3265 CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX),
3258 CLK(NULL, "arm_fck", &arm_fck, CK_3XXX), 3266 CLK(NULL, "arm_fck", &arm_fck, CK_3XXX),
3259 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX), 3267 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX),
3260 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X), 3268 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_34XX | CK_36XX),
3261 CLK(NULL, "iva2_ck", &iva2_ck, CK_343X), 3269 CLK(NULL, "iva2_ck", &iva2_ck, CK_34XX | CK_36XX),
3262 CLK(NULL, "l3_ick", &l3_ick, CK_3XXX), 3270 CLK(NULL, "l3_ick", &l3_ick, CK_3XXX),
3263 CLK(NULL, "l4_ick", &l4_ick, CK_3XXX), 3271 CLK(NULL, "l4_ick", &l4_ick, CK_3XXX),
3264 CLK(NULL, "rm_ick", &rm_ick, CK_3XXX), 3272 CLK(NULL, "rm_ick", &rm_ick, CK_3XXX),
@@ -3267,27 +3275,27 @@ static struct omap_clk omap3xxx_clks[] = {
3267 CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), 3275 CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1),
3268 CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), 3276 CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1),
3269 CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), 3277 CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1),
3270 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2 | CK_3517), 3278 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2PLUS | CK_3517 | CK_36XX),
3271 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2 | CK_3517), 3279 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2PLUS | CK_3517 | CK_36XX),
3272 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), 3280 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1),
3273 CLK(NULL, "modem_fck", &modem_fck, CK_343X), 3281 CLK(NULL, "modem_fck", &modem_fck, CK_34XX | CK_36XX),
3274 CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X), 3282 CLK(NULL, "sad2d_ick", &sad2d_ick, CK_34XX | CK_36XX),
3275 CLK(NULL, "mad2d_ick", &mad2d_ick, CK_343X), 3283 CLK(NULL, "mad2d_ick", &mad2d_ick, CK_34XX | CK_36XX),
3276 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_3XXX), 3284 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_3XXX),
3277 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_3XXX), 3285 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_3XXX),
3278 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2 | CK_AM35XX), 3286 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3279 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2 | CK_AM35XX), 3287 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3280 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2 | CK_AM35XX), 3288 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3281 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3282 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3283 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
3284 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2 | CK_AM35XX), 3292 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3285 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), 3293 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX),
3286 CLK(NULL, "mspro_fck", &mspro_fck, CK_343X), 3294 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX),
3287 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), 3295 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX),
3288 CLK("i2c_omap.3", "fck", &i2c3_fck, CK_3XXX), 3296 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX),
3289 CLK("i2c_omap.2", "fck", &i2c2_fck, CK_3XXX), 3297 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX),
3290 CLK("i2c_omap.1", "fck", &i2c1_fck, CK_3XXX), 3298 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX),
3291 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_3XXX), 3299 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_3XXX),
3292 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_3XXX), 3300 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_3XXX),
3293 CLK(NULL, "core_48m_fck", &core_48m_fck, CK_3XXX), 3301 CLK(NULL, "core_48m_fck", &core_48m_fck, CK_3XXX),
@@ -3301,34 +3309,34 @@ static struct omap_clk omap3xxx_clks[] = {
3301 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX), 3309 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX),
3302 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX), 3310 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX),
3303 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), 3311 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1),
3304 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2), 3312 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3305 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), 3313 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
3306 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2), 3314 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3307 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), 3315 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX),
3308 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), 3316 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1),
3309 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2), 3317 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3310 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), 3318 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX),
3311 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), 3319 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX),
3312 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X), 3320 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX),
3313 CLK(NULL, "pka_ick", &pka_ick, CK_343X), 3321 CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX),
3314 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3322 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3315 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX), 3323 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3316 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), 3324 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3317 CLK(NULL, "icr_ick", &icr_ick, CK_343X), 3325 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
3318 CLK("omap-aes", "ick", &aes2_ick, CK_343X), 3326 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
3319 CLK("omap-sham", "ick", &sha12_ick, CK_343X), 3327 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX),
3320 CLK(NULL, "des2_ick", &des2_ick, CK_343X), 3328 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX),
3321 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), 3329 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX),
3322 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), 3330 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX),
3323 CLK(NULL, "mspro_ick", &mspro_ick, CK_343X), 3331 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX),
3324 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), 3332 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX),
3325 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), 3333 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX),
3326 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX), 3334 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX),
3327 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX), 3335 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX),
3328 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX), 3336 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX),
3329 CLK("i2c_omap.3", "ick", &i2c3_ick, CK_3XXX), 3337 CLK("omap_i2c.3", "ick", &i2c3_ick, CK_3XXX),
3330 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_3XXX), 3338 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_3XXX),
3331 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_3XXX), 3339 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_3XXX),
3332 CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX), 3340 CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX),
3333 CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX), 3341 CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX),
3334 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX), 3342 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX),
@@ -3336,37 +3344,37 @@ static struct omap_clk omap3xxx_clks[] = {
3336 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX), 3344 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX),
3337 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX), 3345 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX),
3338 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), 3346 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1),
3339 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_343X), 3347 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_34XX | CK_36XX),
3340 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX), 3348 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX),
3341 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_343X), 3349 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_34XX | CK_36XX),
3342 CLK(NULL, "ssi_ick", &ssi_ick_3430es1, CK_3430ES1), 3350 CLK(NULL, "ssi_ick", &ssi_ick_3430es1, CK_3430ES1),
3343 CLK(NULL, "ssi_ick", &ssi_ick_3430es2, CK_3430ES2), 3351 CLK(NULL, "ssi_ick", &ssi_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3344 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_3430ES1), 3352 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_3430ES1),
3345 CLK(NULL, "security_l4_ick2", &security_l4_ick2, CK_343X), 3353 CLK(NULL, "security_l4_ick2", &security_l4_ick2, CK_34XX | CK_36XX),
3346 CLK(NULL, "aes1_ick", &aes1_ick, CK_343X), 3354 CLK(NULL, "aes1_ick", &aes1_ick, CK_34XX | CK_36XX),
3347 CLK("omap_rng", "ick", &rng_ick, CK_343X), 3355 CLK("omap_rng", "ick", &rng_ick, CK_34XX | CK_36XX),
3348 CLK(NULL, "sha11_ick", &sha11_ick, CK_343X), 3356 CLK(NULL, "sha11_ick", &sha11_ick, CK_34XX | CK_36XX),
3349 CLK(NULL, "des1_ick", &des1_ick, CK_343X), 3357 CLK(NULL, "des1_ick", &des1_ick, CK_34XX | CK_36XX),
3350 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1), 3358 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
3351 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2 | CK_AM35XX), 3359 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3352 CLK("omapdss", "tv_fck", &dss_tv_fck, CK_3XXX), 3360 CLK("omapdss", "tv_fck", &dss_tv_fck, CK_3XXX),
3353 CLK("omapdss", "video_fck", &dss_96m_fck, CK_3XXX), 3361 CLK("omapdss", "video_fck", &dss_96m_fck, CK_3XXX),
3354 CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_3XXX), 3362 CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_3XXX),
3355 CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1), 3363 CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1),
3356 CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2 | CK_AM35XX), 3364 CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3357 CLK(NULL, "cam_mclk", &cam_mclk, CK_343X), 3365 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX),
3358 CLK(NULL, "cam_ick", &cam_ick, CK_343X), 3366 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
3359 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X), 3367 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
3360 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2 | CK_AM35XX), 3368 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3361 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2 | CK_AM35XX), 3369 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3362 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2 | CK_AM35XX), 3370 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3363 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2), 3371 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
3364 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3372 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
3365 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), 3373 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
3366 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX), 3374 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX),
3367 CLK("omap_wdt", "fck", &wdt2_fck, CK_3XXX), 3375 CLK("omap_wdt", "fck", &wdt2_fck, CK_3XXX),
3368 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_343X), 3376 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX),
3369 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2), 3377 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX),
3370 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX), 3378 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX),
3371 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX), 3379 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX),
3372 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX), 3380 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX),
@@ -3424,9 +3432,9 @@ static struct omap_clk omap3xxx_clks[] = {
3424 CLK(NULL, "atclk_fck", &atclk_fck, CK_3XXX), 3432 CLK(NULL, "atclk_fck", &atclk_fck, CK_3XXX),
3425 CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_3XXX), 3433 CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_3XXX),
3426 CLK(NULL, "traceclk_fck", &traceclk_fck, CK_3XXX), 3434 CLK(NULL, "traceclk_fck", &traceclk_fck, CK_3XXX),
3427 CLK(NULL, "sr1_fck", &sr1_fck, CK_343X), 3435 CLK(NULL, "sr1_fck", &sr1_fck, CK_34XX | CK_36XX),
3428 CLK(NULL, "sr2_fck", &sr2_fck, CK_343X), 3436 CLK(NULL, "sr2_fck", &sr2_fck, CK_34XX | CK_36XX),
3429 CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_343X), 3437 CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_34XX | CK_36XX),
3430 CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_3XXX), 3438 CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_3XXX),
3431 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_3XXX), 3439 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_3XXX),
3432 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_3XXX), 3440 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_3XXX),
@@ -3447,38 +3455,37 @@ static struct omap_clk omap3xxx_clks[] = {
3447int __init omap3xxx_clk_init(void) 3455int __init omap3xxx_clk_init(void)
3448{ 3456{
3449 struct omap_clk *c; 3457 struct omap_clk *c;
3450 u32 cpu_clkflg = CK_3XXX; 3458 u32 cpu_clkflg = 0;
3451 3459
3452 if (cpu_is_omap3517()) { 3460 if (cpu_is_omap3517()) {
3453 cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS; 3461 cpu_mask = RATE_IN_34XX;
3454 cpu_clkflg |= CK_3517; 3462 cpu_clkflg = CK_3517;
3455 } else if (cpu_is_omap3505()) { 3463 } else if (cpu_is_omap3505()) {
3456 cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS; 3464 cpu_mask = RATE_IN_34XX;
3457 cpu_clkflg |= CK_3505; 3465 cpu_clkflg = CK_3505;
3466 } else if (cpu_is_omap3630()) {
3467 cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
3468 cpu_clkflg = CK_36XX;
3458 } else if (cpu_is_omap34xx()) { 3469 } else if (cpu_is_omap34xx()) {
3459 cpu_mask = RATE_IN_3XXX;
3460 cpu_clkflg |= CK_343X;
3461
3462 /*
3463 * Update this if there are further clock changes between ES2
3464 * and production parts
3465 */
3466 if (omap_rev() == OMAP3430_REV_ES1_0) { 3470 if (omap_rev() == OMAP3430_REV_ES1_0) {
3467 /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */ 3471 cpu_mask = RATE_IN_3430ES1;
3468 cpu_clkflg |= CK_3430ES1; 3472 cpu_clkflg = CK_3430ES1;
3469 } else { 3473 } else {
3470 cpu_mask |= RATE_IN_3430ES2PLUS; 3474 /*
3471 cpu_clkflg |= CK_3430ES2; 3475 * Assume that anything that we haven't matched yet
3476 * has 3430ES2-type clocks.
3477 */
3478 cpu_mask = RATE_IN_3430ES2PLUS;
3479 cpu_clkflg = CK_3430ES2PLUS;
3472 } 3480 }
3481 } else {
3482 WARN(1, "clock: could not identify OMAP3 variant\n");
3473 } 3483 }
3474 3484
3475 if (omap3_has_192mhz_clk()) 3485 if (omap3_has_192mhz_clk())
3476 omap_96m_alwon_fck = omap_96m_alwon_fck_3630; 3486 omap_96m_alwon_fck = omap_96m_alwon_fck_3630;
3477 3487
3478 if (cpu_is_omap3630()) { 3488 if (cpu_is_omap3630()) {
3479 cpu_mask |= RATE_IN_36XX;
3480 cpu_clkflg |= CK_36XX;
3481
3482 /* 3489 /*
3483 * XXX This type of dynamic rewriting of the clock tree is 3490 * XXX This type of dynamic rewriting of the clock tree is
3484 * deprecated and should be revised soon. 3491 * deprecated and should be revised soon.
@@ -3525,10 +3532,9 @@ int __init omap3xxx_clk_init(void)
3525 3532
3526 recalculate_root_clocks(); 3533 recalculate_root_clocks();
3527 3534
3528 printk(KERN_INFO "Clocking rate (Crystal/Core/MPU): " 3535 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
3529 "%ld.%01ld/%ld/%ld MHz\n", 3536 (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10,
3530 (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10, 3537 (core_ck.rate / 1000000), (arm_fck.rate / 1000000));
3531 (core_ck.rate / 1000000), (arm_fck.rate / 1000000));
3532 3538
3533 /* 3539 /*
3534 * Only enable those clocks we will need, let the drivers 3540 * Only enable those clocks we will need, let the drivers
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 1599836ba3d9..c426adccad06 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -30,11 +30,18 @@
30 30
31#include "clock.h" 31#include "clock.h"
32#include "clock44xx.h" 32#include "clock44xx.h"
33#include "cm.h" 33#include "cm1_44xx.h"
34#include "cm2_44xx.h"
34#include "cm-regbits-44xx.h" 35#include "cm-regbits-44xx.h"
35#include "prm.h" 36#include "prm44xx.h"
37#include "prm44xx.h"
36#include "prm-regbits-44xx.h" 38#include "prm-regbits-44xx.h"
37#include "control.h" 39#include "control.h"
40#include "scrm44xx.h"
41
42/* OMAP4 modulemode control */
43#define OMAP4430_MODULEMODE_HWCTRL 0
44#define OMAP4430_MODULEMODE_SWCTRL 1
38 45
39/* Root clocks */ 46/* Root clocks */
40 47
@@ -47,7 +54,9 @@ static struct clk extalt_clkin_ck = {
47static struct clk pad_clks_ck = { 54static struct clk pad_clks_ck = {
48 .name = "pad_clks_ck", 55 .name = "pad_clks_ck",
49 .rate = 12000000, 56 .rate = 12000000,
50 .ops = &clkops_null, 57 .ops = &clkops_omap2_dflt,
58 .enable_reg = OMAP4430_CM_CLKSEL_ABE,
59 .enable_bit = OMAP4430_PAD_CLKS_GATE_SHIFT,
51}; 60};
52 61
53static struct clk pad_slimbus_core_clks_ck = { 62static struct clk pad_slimbus_core_clks_ck = {
@@ -65,7 +74,9 @@ static struct clk secure_32k_clk_src_ck = {
65static struct clk slimbus_clk = { 74static struct clk slimbus_clk = {
66 .name = "slimbus_clk", 75 .name = "slimbus_clk",
67 .rate = 12000000, 76 .rate = 12000000,
68 .ops = &clkops_null, 77 .ops = &clkops_omap2_dflt,
78 .enable_reg = OMAP4430_CM_CLKSEL_ABE,
79 .enable_bit = OMAP4430_SLIMBUS_CLK_GATE_SHIFT,
69}; 80};
70 81
71static struct clk sys_32k_ck = { 82static struct clk sys_32k_ck = {
@@ -265,18 +276,71 @@ static struct clk dpll_abe_ck = {
265 .set_rate = &omap3_noncore_dpll_set_rate, 276 .set_rate = &omap3_noncore_dpll_set_rate,
266}; 277};
267 278
279static struct clk dpll_abe_x2_ck = {
280 .name = "dpll_abe_x2_ck",
281 .parent = &dpll_abe_ck,
282 .ops = &clkops_null,
283 .recalc = &omap3_clkoutx2_recalc,
284};
285
286static const struct clksel_rate div31_1to31_rates[] = {
287 { .div = 1, .val = 1, .flags = RATE_IN_4430 },
288 { .div = 2, .val = 2, .flags = RATE_IN_4430 },
289 { .div = 3, .val = 3, .flags = RATE_IN_4430 },
290 { .div = 4, .val = 4, .flags = RATE_IN_4430 },
291 { .div = 5, .val = 5, .flags = RATE_IN_4430 },
292 { .div = 6, .val = 6, .flags = RATE_IN_4430 },
293 { .div = 7, .val = 7, .flags = RATE_IN_4430 },
294 { .div = 8, .val = 8, .flags = RATE_IN_4430 },
295 { .div = 9, .val = 9, .flags = RATE_IN_4430 },
296 { .div = 10, .val = 10, .flags = RATE_IN_4430 },
297 { .div = 11, .val = 11, .flags = RATE_IN_4430 },
298 { .div = 12, .val = 12, .flags = RATE_IN_4430 },
299 { .div = 13, .val = 13, .flags = RATE_IN_4430 },
300 { .div = 14, .val = 14, .flags = RATE_IN_4430 },
301 { .div = 15, .val = 15, .flags = RATE_IN_4430 },
302 { .div = 16, .val = 16, .flags = RATE_IN_4430 },
303 { .div = 17, .val = 17, .flags = RATE_IN_4430 },
304 { .div = 18, .val = 18, .flags = RATE_IN_4430 },
305 { .div = 19, .val = 19, .flags = RATE_IN_4430 },
306 { .div = 20, .val = 20, .flags = RATE_IN_4430 },
307 { .div = 21, .val = 21, .flags = RATE_IN_4430 },
308 { .div = 22, .val = 22, .flags = RATE_IN_4430 },
309 { .div = 23, .val = 23, .flags = RATE_IN_4430 },
310 { .div = 24, .val = 24, .flags = RATE_IN_4430 },
311 { .div = 25, .val = 25, .flags = RATE_IN_4430 },
312 { .div = 26, .val = 26, .flags = RATE_IN_4430 },
313 { .div = 27, .val = 27, .flags = RATE_IN_4430 },
314 { .div = 28, .val = 28, .flags = RATE_IN_4430 },
315 { .div = 29, .val = 29, .flags = RATE_IN_4430 },
316 { .div = 30, .val = 30, .flags = RATE_IN_4430 },
317 { .div = 31, .val = 31, .flags = RATE_IN_4430 },
318 { .div = 0 },
319};
320
321static const struct clksel dpll_abe_m2x2_div[] = {
322 { .parent = &dpll_abe_x2_ck, .rates = div31_1to31_rates },
323 { .parent = NULL },
324};
325
268static struct clk dpll_abe_m2x2_ck = { 326static struct clk dpll_abe_m2x2_ck = {
269 .name = "dpll_abe_m2x2_ck", 327 .name = "dpll_abe_m2x2_ck",
270 .parent = &dpll_abe_ck, 328 .parent = &dpll_abe_x2_ck,
329 .clksel = dpll_abe_m2x2_div,
330 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
331 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
271 .ops = &clkops_null, 332 .ops = &clkops_null,
272 .recalc = &followparent_recalc, 333 .recalc = &omap2_clksel_recalc,
334 .round_rate = &omap2_clksel_round_rate,
335 .set_rate = &omap2_clksel_set_rate,
273}; 336};
274 337
275static struct clk abe_24m_fclk = { 338static struct clk abe_24m_fclk = {
276 .name = "abe_24m_fclk", 339 .name = "abe_24m_fclk",
277 .parent = &dpll_abe_m2x2_ck, 340 .parent = &dpll_abe_m2x2_ck,
278 .ops = &clkops_null, 341 .ops = &clkops_null,
279 .recalc = &followparent_recalc, 342 .fixed_div = 8,
343 .recalc = &omap_fixed_divisor_recalc,
280}; 344};
281 345
282static const struct clksel_rate div3_1to4_rates[] = { 346static const struct clksel_rate div3_1to4_rates[] = {
@@ -326,50 +390,10 @@ static struct clk aess_fclk = {
326 .set_rate = &omap2_clksel_set_rate, 390 .set_rate = &omap2_clksel_set_rate,
327}; 391};
328 392
329static const struct clksel_rate div31_1to31_rates[] = { 393static struct clk dpll_abe_m3x2_ck = {
330 { .div = 1, .val = 1, .flags = RATE_IN_4430 }, 394 .name = "dpll_abe_m3x2_ck",
331 { .div = 2, .val = 2, .flags = RATE_IN_4430 }, 395 .parent = &dpll_abe_x2_ck,
332 { .div = 3, .val = 3, .flags = RATE_IN_4430 }, 396 .clksel = dpll_abe_m2x2_div,
333 { .div = 4, .val = 4, .flags = RATE_IN_4430 },
334 { .div = 5, .val = 5, .flags = RATE_IN_4430 },
335 { .div = 6, .val = 6, .flags = RATE_IN_4430 },
336 { .div = 7, .val = 7, .flags = RATE_IN_4430 },
337 { .div = 8, .val = 8, .flags = RATE_IN_4430 },
338 { .div = 9, .val = 9, .flags = RATE_IN_4430 },
339 { .div = 10, .val = 10, .flags = RATE_IN_4430 },
340 { .div = 11, .val = 11, .flags = RATE_IN_4430 },
341 { .div = 12, .val = 12, .flags = RATE_IN_4430 },
342 { .div = 13, .val = 13, .flags = RATE_IN_4430 },
343 { .div = 14, .val = 14, .flags = RATE_IN_4430 },
344 { .div = 15, .val = 15, .flags = RATE_IN_4430 },
345 { .div = 16, .val = 16, .flags = RATE_IN_4430 },
346 { .div = 17, .val = 17, .flags = RATE_IN_4430 },
347 { .div = 18, .val = 18, .flags = RATE_IN_4430 },
348 { .div = 19, .val = 19, .flags = RATE_IN_4430 },
349 { .div = 20, .val = 20, .flags = RATE_IN_4430 },
350 { .div = 21, .val = 21, .flags = RATE_IN_4430 },
351 { .div = 22, .val = 22, .flags = RATE_IN_4430 },
352 { .div = 23, .val = 23, .flags = RATE_IN_4430 },
353 { .div = 24, .val = 24, .flags = RATE_IN_4430 },
354 { .div = 25, .val = 25, .flags = RATE_IN_4430 },
355 { .div = 26, .val = 26, .flags = RATE_IN_4430 },
356 { .div = 27, .val = 27, .flags = RATE_IN_4430 },
357 { .div = 28, .val = 28, .flags = RATE_IN_4430 },
358 { .div = 29, .val = 29, .flags = RATE_IN_4430 },
359 { .div = 30, .val = 30, .flags = RATE_IN_4430 },
360 { .div = 31, .val = 31, .flags = RATE_IN_4430 },
361 { .div = 0 },
362};
363
364static const struct clksel dpll_abe_m3_div[] = {
365 { .parent = &dpll_abe_ck, .rates = div31_1to31_rates },
366 { .parent = NULL },
367};
368
369static struct clk dpll_abe_m3_ck = {
370 .name = "dpll_abe_m3_ck",
371 .parent = &dpll_abe_ck,
372 .clksel = dpll_abe_m3_div,
373 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, 397 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE,
374 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 398 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
375 .ops = &clkops_null, 399 .ops = &clkops_null,
@@ -380,7 +404,7 @@ static struct clk dpll_abe_m3_ck = {
380 404
381static const struct clksel core_hsd_byp_clk_mux_sel[] = { 405static const struct clksel core_hsd_byp_clk_mux_sel[] = {
382 { .parent = &sys_clkin_ck, .rates = div_1_0_rates }, 406 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
383 { .parent = &dpll_abe_m3_ck, .rates = div_1_1_rates }, 407 { .parent = &dpll_abe_m3x2_ck, .rates = div_1_1_rates },
384 { .parent = NULL }, 408 { .parent = NULL },
385}; 409};
386 410
@@ -424,15 +448,22 @@ static struct clk dpll_core_ck = {
424 .recalc = &omap3_dpll_recalc, 448 .recalc = &omap3_dpll_recalc,
425}; 449};
426 450
427static const struct clksel dpll_core_m6_div[] = { 451static struct clk dpll_core_x2_ck = {
428 { .parent = &dpll_core_ck, .rates = div31_1to31_rates }, 452 .name = "dpll_core_x2_ck",
453 .parent = &dpll_core_ck,
454 .ops = &clkops_null,
455 .recalc = &omap3_clkoutx2_recalc,
456};
457
458static const struct clksel dpll_core_m6x2_div[] = {
459 { .parent = &dpll_core_x2_ck, .rates = div31_1to31_rates },
429 { .parent = NULL }, 460 { .parent = NULL },
430}; 461};
431 462
432static struct clk dpll_core_m6_ck = { 463static struct clk dpll_core_m6x2_ck = {
433 .name = "dpll_core_m6_ck", 464 .name = "dpll_core_m6x2_ck",
434 .parent = &dpll_core_ck, 465 .parent = &dpll_core_x2_ck,
435 .clksel = dpll_core_m6_div, 466 .clksel = dpll_core_m6x2_div,
436 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, 467 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE,
437 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 468 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
438 .ops = &clkops_null, 469 .ops = &clkops_null,
@@ -443,7 +474,7 @@ static struct clk dpll_core_m6_ck = {
443 474
444static const struct clksel dbgclk_mux_sel[] = { 475static const struct clksel dbgclk_mux_sel[] = {
445 { .parent = &sys_clkin_ck, .rates = div_1_0_rates }, 476 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
446 { .parent = &dpll_core_m6_ck, .rates = div_1_1_rates }, 477 { .parent = &dpll_core_m6x2_ck, .rates = div_1_1_rates },
447 { .parent = NULL }, 478 { .parent = NULL },
448}; 479};
449 480
@@ -454,10 +485,15 @@ static struct clk dbgclk_mux_ck = {
454 .recalc = &followparent_recalc, 485 .recalc = &followparent_recalc,
455}; 486};
456 487
488static const struct clksel dpll_core_m2_div[] = {
489 { .parent = &dpll_core_ck, .rates = div31_1to31_rates },
490 { .parent = NULL },
491};
492
457static struct clk dpll_core_m2_ck = { 493static struct clk dpll_core_m2_ck = {
458 .name = "dpll_core_m2_ck", 494 .name = "dpll_core_m2_ck",
459 .parent = &dpll_core_ck, 495 .parent = &dpll_core_ck,
460 .clksel = dpll_core_m6_div, 496 .clksel = dpll_core_m2_div,
461 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, 497 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE,
462 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 498 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
463 .ops = &clkops_null, 499 .ops = &clkops_null,
@@ -470,13 +506,14 @@ static struct clk ddrphy_ck = {
470 .name = "ddrphy_ck", 506 .name = "ddrphy_ck",
471 .parent = &dpll_core_m2_ck, 507 .parent = &dpll_core_m2_ck,
472 .ops = &clkops_null, 508 .ops = &clkops_null,
473 .recalc = &followparent_recalc, 509 .fixed_div = 2,
510 .recalc = &omap_fixed_divisor_recalc,
474}; 511};
475 512
476static struct clk dpll_core_m5_ck = { 513static struct clk dpll_core_m5x2_ck = {
477 .name = "dpll_core_m5_ck", 514 .name = "dpll_core_m5x2_ck",
478 .parent = &dpll_core_ck, 515 .parent = &dpll_core_x2_ck,
479 .clksel = dpll_core_m6_div, 516 .clksel = dpll_core_m6x2_div,
480 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, 517 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE,
481 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 518 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
482 .ops = &clkops_null, 519 .ops = &clkops_null,
@@ -486,13 +523,13 @@ static struct clk dpll_core_m5_ck = {
486}; 523};
487 524
488static const struct clksel div_core_div[] = { 525static const struct clksel div_core_div[] = {
489 { .parent = &dpll_core_m5_ck, .rates = div2_1to2_rates }, 526 { .parent = &dpll_core_m5x2_ck, .rates = div2_1to2_rates },
490 { .parent = NULL }, 527 { .parent = NULL },
491}; 528};
492 529
493static struct clk div_core_ck = { 530static struct clk div_core_ck = {
494 .name = "div_core_ck", 531 .name = "div_core_ck",
495 .parent = &dpll_core_m5_ck, 532 .parent = &dpll_core_m5x2_ck,
496 .clksel = div_core_div, 533 .clksel = div_core_div,
497 .clksel_reg = OMAP4430_CM_CLKSEL_CORE, 534 .clksel_reg = OMAP4430_CM_CLKSEL_CORE,
498 .clksel_mask = OMAP4430_CLKSEL_CORE_MASK, 535 .clksel_mask = OMAP4430_CLKSEL_CORE_MASK,
@@ -511,13 +548,13 @@ static const struct clksel_rate div4_1to8_rates[] = {
511}; 548};
512 549
513static const struct clksel div_iva_hs_clk_div[] = { 550static const struct clksel div_iva_hs_clk_div[] = {
514 { .parent = &dpll_core_m5_ck, .rates = div4_1to8_rates }, 551 { .parent = &dpll_core_m5x2_ck, .rates = div4_1to8_rates },
515 { .parent = NULL }, 552 { .parent = NULL },
516}; 553};
517 554
518static struct clk div_iva_hs_clk = { 555static struct clk div_iva_hs_clk = {
519 .name = "div_iva_hs_clk", 556 .name = "div_iva_hs_clk",
520 .parent = &dpll_core_m5_ck, 557 .parent = &dpll_core_m5x2_ck,
521 .clksel = div_iva_hs_clk_div, 558 .clksel = div_iva_hs_clk_div,
522 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_IVA, 559 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_IVA,
523 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK, 560 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK,
@@ -529,7 +566,7 @@ static struct clk div_iva_hs_clk = {
529 566
530static struct clk div_mpu_hs_clk = { 567static struct clk div_mpu_hs_clk = {
531 .name = "div_mpu_hs_clk", 568 .name = "div_mpu_hs_clk",
532 .parent = &dpll_core_m5_ck, 569 .parent = &dpll_core_m5x2_ck,
533 .clksel = div_iva_hs_clk_div, 570 .clksel = div_iva_hs_clk_div,
534 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_MPU, 571 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_MPU,
535 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK, 572 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK,
@@ -539,10 +576,10 @@ static struct clk div_mpu_hs_clk = {
539 .set_rate = &omap2_clksel_set_rate, 576 .set_rate = &omap2_clksel_set_rate,
540}; 577};
541 578
542static struct clk dpll_core_m4_ck = { 579static struct clk dpll_core_m4x2_ck = {
543 .name = "dpll_core_m4_ck", 580 .name = "dpll_core_m4x2_ck",
544 .parent = &dpll_core_ck, 581 .parent = &dpll_core_x2_ck,
545 .clksel = dpll_core_m6_div, 582 .clksel = dpll_core_m6x2_div,
546 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, 583 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE,
547 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 584 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
548 .ops = &clkops_null, 585 .ops = &clkops_null,
@@ -553,15 +590,21 @@ static struct clk dpll_core_m4_ck = {
553 590
554static struct clk dll_clk_div_ck = { 591static struct clk dll_clk_div_ck = {
555 .name = "dll_clk_div_ck", 592 .name = "dll_clk_div_ck",
556 .parent = &dpll_core_m4_ck, 593 .parent = &dpll_core_m4x2_ck,
557 .ops = &clkops_null, 594 .ops = &clkops_null,
558 .recalc = &followparent_recalc, 595 .fixed_div = 2,
596 .recalc = &omap_fixed_divisor_recalc,
597};
598
599static const struct clksel dpll_abe_m2_div[] = {
600 { .parent = &dpll_abe_ck, .rates = div31_1to31_rates },
601 { .parent = NULL },
559}; 602};
560 603
561static struct clk dpll_abe_m2_ck = { 604static struct clk dpll_abe_m2_ck = {
562 .name = "dpll_abe_m2_ck", 605 .name = "dpll_abe_m2_ck",
563 .parent = &dpll_abe_ck, 606 .parent = &dpll_abe_ck,
564 .clksel = dpll_abe_m3_div, 607 .clksel = dpll_abe_m2_div,
565 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, 608 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
566 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 609 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
567 .ops = &clkops_null, 610 .ops = &clkops_null,
@@ -570,22 +613,24 @@ static struct clk dpll_abe_m2_ck = {
570 .set_rate = &omap2_clksel_set_rate, 613 .set_rate = &omap2_clksel_set_rate,
571}; 614};
572 615
573static struct clk dpll_core_m3_ck = { 616static struct clk dpll_core_m3x2_ck = {
574 .name = "dpll_core_m3_ck", 617 .name = "dpll_core_m3x2_ck",
575 .parent = &dpll_core_ck, 618 .parent = &dpll_core_x2_ck,
576 .clksel = dpll_core_m6_div, 619 .clksel = dpll_core_m6x2_div,
577 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_CORE, 620 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_CORE,
578 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 621 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
579 .ops = &clkops_null, 622 .ops = &clkops_omap2_dflt,
623 .enable_reg = OMAP4430_CM_DIV_M3_DPLL_CORE,
624 .enable_bit = OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT,
580 .recalc = &omap2_clksel_recalc, 625 .recalc = &omap2_clksel_recalc,
581 .round_rate = &omap2_clksel_round_rate, 626 .round_rate = &omap2_clksel_round_rate,
582 .set_rate = &omap2_clksel_set_rate, 627 .set_rate = &omap2_clksel_set_rate,
583}; 628};
584 629
585static struct clk dpll_core_m7_ck = { 630static struct clk dpll_core_m7x2_ck = {
586 .name = "dpll_core_m7_ck", 631 .name = "dpll_core_m7x2_ck",
587 .parent = &dpll_core_ck, 632 .parent = &dpll_core_x2_ck,
588 .clksel = dpll_core_m6_div, 633 .clksel = dpll_core_m6x2_div,
589 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, 634 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE,
590 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 635 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
591 .ops = &clkops_null, 636 .ops = &clkops_null,
@@ -603,8 +648,12 @@ static const struct clksel iva_hsd_byp_clk_mux_sel[] = {
603static struct clk iva_hsd_byp_clk_mux_ck = { 648static struct clk iva_hsd_byp_clk_mux_ck = {
604 .name = "iva_hsd_byp_clk_mux_ck", 649 .name = "iva_hsd_byp_clk_mux_ck",
605 .parent = &sys_clkin_ck, 650 .parent = &sys_clkin_ck,
651 .clksel = iva_hsd_byp_clk_mux_sel,
652 .init = &omap2_init_clksel_parent,
653 .clksel_reg = OMAP4430_CM_CLKSEL_DPLL_IVA,
654 .clksel_mask = OMAP4430_DPLL_BYP_CLKSEL_MASK,
606 .ops = &clkops_null, 655 .ops = &clkops_null,
607 .recalc = &followparent_recalc, 656 .recalc = &omap2_clksel_recalc,
608}; 657};
609 658
610/* DPLL_IVA */ 659/* DPLL_IVA */
@@ -638,15 +687,22 @@ static struct clk dpll_iva_ck = {
638 .set_rate = &omap3_noncore_dpll_set_rate, 687 .set_rate = &omap3_noncore_dpll_set_rate,
639}; 688};
640 689
641static const struct clksel dpll_iva_m4_div[] = { 690static struct clk dpll_iva_x2_ck = {
642 { .parent = &dpll_iva_ck, .rates = div31_1to31_rates }, 691 .name = "dpll_iva_x2_ck",
692 .parent = &dpll_iva_ck,
693 .ops = &clkops_null,
694 .recalc = &omap3_clkoutx2_recalc,
695};
696
697static const struct clksel dpll_iva_m4x2_div[] = {
698 { .parent = &dpll_iva_x2_ck, .rates = div31_1to31_rates },
643 { .parent = NULL }, 699 { .parent = NULL },
644}; 700};
645 701
646static struct clk dpll_iva_m4_ck = { 702static struct clk dpll_iva_m4x2_ck = {
647 .name = "dpll_iva_m4_ck", 703 .name = "dpll_iva_m4x2_ck",
648 .parent = &dpll_iva_ck, 704 .parent = &dpll_iva_x2_ck,
649 .clksel = dpll_iva_m4_div, 705 .clksel = dpll_iva_m4x2_div,
650 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, 706 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA,
651 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 707 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
652 .ops = &clkops_null, 708 .ops = &clkops_null,
@@ -655,10 +711,10 @@ static struct clk dpll_iva_m4_ck = {
655 .set_rate = &omap2_clksel_set_rate, 711 .set_rate = &omap2_clksel_set_rate,
656}; 712};
657 713
658static struct clk dpll_iva_m5_ck = { 714static struct clk dpll_iva_m5x2_ck = {
659 .name = "dpll_iva_m5_ck", 715 .name = "dpll_iva_m5x2_ck",
660 .parent = &dpll_iva_ck, 716 .parent = &dpll_iva_x2_ck,
661 .clksel = dpll_iva_m4_div, 717 .clksel = dpll_iva_m4x2_div,
662 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, 718 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA,
663 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 719 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
664 .ops = &clkops_null, 720 .ops = &clkops_null,
@@ -717,9 +773,10 @@ static struct clk dpll_mpu_m2_ck = {
717 773
718static struct clk per_hs_clk_div_ck = { 774static struct clk per_hs_clk_div_ck = {
719 .name = "per_hs_clk_div_ck", 775 .name = "per_hs_clk_div_ck",
720 .parent = &dpll_abe_m3_ck, 776 .parent = &dpll_abe_m3x2_ck,
721 .ops = &clkops_null, 777 .ops = &clkops_null,
722 .recalc = &followparent_recalc, 778 .fixed_div = 2,
779 .recalc = &omap_fixed_divisor_recalc,
723}; 780};
724 781
725static const struct clksel per_hsd_byp_clk_mux_sel[] = { 782static const struct clksel per_hsd_byp_clk_mux_sel[] = {
@@ -787,29 +844,48 @@ static struct clk dpll_per_m2_ck = {
787 .set_rate = &omap2_clksel_set_rate, 844 .set_rate = &omap2_clksel_set_rate,
788}; 845};
789 846
847static struct clk dpll_per_x2_ck = {
848 .name = "dpll_per_x2_ck",
849 .parent = &dpll_per_ck,
850 .ops = &clkops_null,
851 .recalc = &omap3_clkoutx2_recalc,
852};
853
854static const struct clksel dpll_per_m2x2_div[] = {
855 { .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates },
856 { .parent = NULL },
857};
858
790static struct clk dpll_per_m2x2_ck = { 859static struct clk dpll_per_m2x2_ck = {
791 .name = "dpll_per_m2x2_ck", 860 .name = "dpll_per_m2x2_ck",
792 .parent = &dpll_per_ck, 861 .parent = &dpll_per_x2_ck,
862 .clksel = dpll_per_m2x2_div,
863 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
864 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
793 .ops = &clkops_null, 865 .ops = &clkops_null,
794 .recalc = &followparent_recalc, 866 .recalc = &omap2_clksel_recalc,
867 .round_rate = &omap2_clksel_round_rate,
868 .set_rate = &omap2_clksel_set_rate,
795}; 869};
796 870
797static struct clk dpll_per_m3_ck = { 871static struct clk dpll_per_m3x2_ck = {
798 .name = "dpll_per_m3_ck", 872 .name = "dpll_per_m3x2_ck",
799 .parent = &dpll_per_ck, 873 .parent = &dpll_per_x2_ck,
800 .clksel = dpll_per_m2_div, 874 .clksel = dpll_per_m2x2_div,
801 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_PER, 875 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_PER,
802 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 876 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
803 .ops = &clkops_null, 877 .ops = &clkops_omap2_dflt,
878 .enable_reg = OMAP4430_CM_DIV_M3_DPLL_PER,
879 .enable_bit = OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT,
804 .recalc = &omap2_clksel_recalc, 880 .recalc = &omap2_clksel_recalc,
805 .round_rate = &omap2_clksel_round_rate, 881 .round_rate = &omap2_clksel_round_rate,
806 .set_rate = &omap2_clksel_set_rate, 882 .set_rate = &omap2_clksel_set_rate,
807}; 883};
808 884
809static struct clk dpll_per_m4_ck = { 885static struct clk dpll_per_m4x2_ck = {
810 .name = "dpll_per_m4_ck", 886 .name = "dpll_per_m4x2_ck",
811 .parent = &dpll_per_ck, 887 .parent = &dpll_per_x2_ck,
812 .clksel = dpll_per_m2_div, 888 .clksel = dpll_per_m2x2_div,
813 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, 889 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER,
814 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 890 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
815 .ops = &clkops_null, 891 .ops = &clkops_null,
@@ -818,10 +894,10 @@ static struct clk dpll_per_m4_ck = {
818 .set_rate = &omap2_clksel_set_rate, 894 .set_rate = &omap2_clksel_set_rate,
819}; 895};
820 896
821static struct clk dpll_per_m5_ck = { 897static struct clk dpll_per_m5x2_ck = {
822 .name = "dpll_per_m5_ck", 898 .name = "dpll_per_m5x2_ck",
823 .parent = &dpll_per_ck, 899 .parent = &dpll_per_x2_ck,
824 .clksel = dpll_per_m2_div, 900 .clksel = dpll_per_m2x2_div,
825 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, 901 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER,
826 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 902 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
827 .ops = &clkops_null, 903 .ops = &clkops_null,
@@ -830,10 +906,10 @@ static struct clk dpll_per_m5_ck = {
830 .set_rate = &omap2_clksel_set_rate, 906 .set_rate = &omap2_clksel_set_rate,
831}; 907};
832 908
833static struct clk dpll_per_m6_ck = { 909static struct clk dpll_per_m6x2_ck = {
834 .name = "dpll_per_m6_ck", 910 .name = "dpll_per_m6x2_ck",
835 .parent = &dpll_per_ck, 911 .parent = &dpll_per_x2_ck,
836 .clksel = dpll_per_m2_div, 912 .clksel = dpll_per_m2x2_div,
837 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, 913 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER,
838 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 914 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
839 .ops = &clkops_null, 915 .ops = &clkops_null,
@@ -842,10 +918,10 @@ static struct clk dpll_per_m6_ck = {
842 .set_rate = &omap2_clksel_set_rate, 918 .set_rate = &omap2_clksel_set_rate,
843}; 919};
844 920
845static struct clk dpll_per_m7_ck = { 921static struct clk dpll_per_m7x2_ck = {
846 .name = "dpll_per_m7_ck", 922 .name = "dpll_per_m7x2_ck",
847 .parent = &dpll_per_ck, 923 .parent = &dpll_per_x2_ck,
848 .clksel = dpll_per_m2_div, 924 .clksel = dpll_per_m2x2_div,
849 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, 925 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER,
850 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 926 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
851 .ops = &clkops_null, 927 .ops = &clkops_null,
@@ -868,6 +944,7 @@ static struct dpll_data dpll_unipro_dd = {
868 .enable_mask = OMAP4430_DPLL_EN_MASK, 944 .enable_mask = OMAP4430_DPLL_EN_MASK,
869 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, 945 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
870 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, 946 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
947 .sddiv_mask = OMAP4430_DPLL_SD_DIV_MASK,
871 .max_multiplier = OMAP4430_MAX_DPLL_MULT, 948 .max_multiplier = OMAP4430_MAX_DPLL_MULT,
872 .max_divider = OMAP4430_MAX_DPLL_DIV, 949 .max_divider = OMAP4430_MAX_DPLL_DIV,
873 .min_divider = 1, 950 .min_divider = 1,
@@ -885,14 +962,21 @@ static struct clk dpll_unipro_ck = {
885 .set_rate = &omap3_noncore_dpll_set_rate, 962 .set_rate = &omap3_noncore_dpll_set_rate,
886}; 963};
887 964
965static struct clk dpll_unipro_x2_ck = {
966 .name = "dpll_unipro_x2_ck",
967 .parent = &dpll_unipro_ck,
968 .ops = &clkops_null,
969 .recalc = &omap3_clkoutx2_recalc,
970};
971
888static const struct clksel dpll_unipro_m2x2_div[] = { 972static const struct clksel dpll_unipro_m2x2_div[] = {
889 { .parent = &dpll_unipro_ck, .rates = div31_1to31_rates }, 973 { .parent = &dpll_unipro_x2_ck, .rates = div31_1to31_rates },
890 { .parent = NULL }, 974 { .parent = NULL },
891}; 975};
892 976
893static struct clk dpll_unipro_m2x2_ck = { 977static struct clk dpll_unipro_m2x2_ck = {
894 .name = "dpll_unipro_m2x2_ck", 978 .name = "dpll_unipro_m2x2_ck",
895 .parent = &dpll_unipro_ck, 979 .parent = &dpll_unipro_x2_ck,
896 .clksel = dpll_unipro_m2x2_div, 980 .clksel = dpll_unipro_m2x2_div,
897 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, 981 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO,
898 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 982 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
@@ -904,16 +988,17 @@ static struct clk dpll_unipro_m2x2_ck = {
904 988
905static struct clk usb_hs_clk_div_ck = { 989static struct clk usb_hs_clk_div_ck = {
906 .name = "usb_hs_clk_div_ck", 990 .name = "usb_hs_clk_div_ck",
907 .parent = &dpll_abe_m3_ck, 991 .parent = &dpll_abe_m3x2_ck,
908 .ops = &clkops_null, 992 .ops = &clkops_null,
909 .recalc = &followparent_recalc, 993 .fixed_div = 3,
994 .recalc = &omap_fixed_divisor_recalc,
910}; 995};
911 996
912/* DPLL_USB */ 997/* DPLL_USB */
913static struct dpll_data dpll_usb_dd = { 998static struct dpll_data dpll_usb_dd = {
914 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB, 999 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB,
915 .clk_bypass = &usb_hs_clk_div_ck, 1000 .clk_bypass = &usb_hs_clk_div_ck,
916 .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL, 1001 .flags = DPLL_J_TYPE,
917 .clk_ref = &sys_clkin_ck, 1002 .clk_ref = &sys_clkin_ck,
918 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB, 1003 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB,
919 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), 1004 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
@@ -967,7 +1052,7 @@ static struct clk dpll_usb_m2_ck = {
967 1052
968static const struct clksel ducati_clk_mux_sel[] = { 1053static const struct clksel ducati_clk_mux_sel[] = {
969 { .parent = &div_core_ck, .rates = div_1_0_rates }, 1054 { .parent = &div_core_ck, .rates = div_1_0_rates },
970 { .parent = &dpll_per_m6_ck, .rates = div_1_1_rates }, 1055 { .parent = &dpll_per_m6x2_ck, .rates = div_1_1_rates },
971 { .parent = NULL }, 1056 { .parent = NULL },
972}; 1057};
973 1058
@@ -986,21 +1071,24 @@ static struct clk func_12m_fclk = {
986 .name = "func_12m_fclk", 1071 .name = "func_12m_fclk",
987 .parent = &dpll_per_m2x2_ck, 1072 .parent = &dpll_per_m2x2_ck,
988 .ops = &clkops_null, 1073 .ops = &clkops_null,
989 .recalc = &followparent_recalc, 1074 .fixed_div = 16,
1075 .recalc = &omap_fixed_divisor_recalc,
990}; 1076};
991 1077
992static struct clk func_24m_clk = { 1078static struct clk func_24m_clk = {
993 .name = "func_24m_clk", 1079 .name = "func_24m_clk",
994 .parent = &dpll_per_m2_ck, 1080 .parent = &dpll_per_m2_ck,
995 .ops = &clkops_null, 1081 .ops = &clkops_null,
996 .recalc = &followparent_recalc, 1082 .fixed_div = 4,
1083 .recalc = &omap_fixed_divisor_recalc,
997}; 1084};
998 1085
999static struct clk func_24mc_fclk = { 1086static struct clk func_24mc_fclk = {
1000 .name = "func_24mc_fclk", 1087 .name = "func_24mc_fclk",
1001 .parent = &dpll_per_m2x2_ck, 1088 .parent = &dpll_per_m2x2_ck,
1002 .ops = &clkops_null, 1089 .ops = &clkops_null,
1003 .recalc = &followparent_recalc, 1090 .fixed_div = 8,
1091 .recalc = &omap_fixed_divisor_recalc,
1004}; 1092};
1005 1093
1006static const struct clksel_rate div2_4to8_rates[] = { 1094static const struct clksel_rate div2_4to8_rates[] = {
@@ -1030,7 +1118,8 @@ static struct clk func_48mc_fclk = {
1030 .name = "func_48mc_fclk", 1118 .name = "func_48mc_fclk",
1031 .parent = &dpll_per_m2x2_ck, 1119 .parent = &dpll_per_m2x2_ck,
1032 .ops = &clkops_null, 1120 .ops = &clkops_null,
1033 .recalc = &followparent_recalc, 1121 .fixed_div = 4,
1122 .recalc = &omap_fixed_divisor_recalc,
1034}; 1123};
1035 1124
1036static const struct clksel_rate div2_2to4_rates[] = { 1125static const struct clksel_rate div2_2to4_rates[] = {
@@ -1040,13 +1129,13 @@ static const struct clksel_rate div2_2to4_rates[] = {
1040}; 1129};
1041 1130
1042static const struct clksel func_64m_fclk_div[] = { 1131static const struct clksel func_64m_fclk_div[] = {
1043 { .parent = &dpll_per_m4_ck, .rates = div2_2to4_rates }, 1132 { .parent = &dpll_per_m4x2_ck, .rates = div2_2to4_rates },
1044 { .parent = NULL }, 1133 { .parent = NULL },
1045}; 1134};
1046 1135
1047static struct clk func_64m_fclk = { 1136static struct clk func_64m_fclk = {
1048 .name = "func_64m_fclk", 1137 .name = "func_64m_fclk",
1049 .parent = &dpll_per_m4_ck, 1138 .parent = &dpll_per_m4x2_ck,
1050 .clksel = func_64m_fclk_div, 1139 .clksel = func_64m_fclk_div,
1051 .clksel_reg = OMAP4430_CM_SCALE_FCLK, 1140 .clksel_reg = OMAP4430_CM_SCALE_FCLK,
1052 .clksel_mask = OMAP4430_SCALE_FCLK_MASK, 1141 .clksel_mask = OMAP4430_SCALE_FCLK_MASK,
@@ -1147,7 +1236,8 @@ static struct clk lp_clk_div_ck = {
1147 .name = "lp_clk_div_ck", 1236 .name = "lp_clk_div_ck",
1148 .parent = &dpll_abe_m2x2_ck, 1237 .parent = &dpll_abe_m2x2_ck,
1149 .ops = &clkops_null, 1238 .ops = &clkops_null,
1150 .recalc = &followparent_recalc, 1239 .fixed_div = 16,
1240 .recalc = &omap_fixed_divisor_recalc,
1151}; 1241};
1152 1242
1153static const struct clksel l4_wkup_clk_mux_sel[] = { 1243static const struct clksel l4_wkup_clk_mux_sel[] = {
@@ -1215,12 +1305,13 @@ static struct clk per_abe_24m_fclk = {
1215 .name = "per_abe_24m_fclk", 1305 .name = "per_abe_24m_fclk",
1216 .parent = &dpll_abe_m2_ck, 1306 .parent = &dpll_abe_m2_ck,
1217 .ops = &clkops_null, 1307 .ops = &clkops_null,
1218 .recalc = &followparent_recalc, 1308 .fixed_div = 4,
1309 .recalc = &omap_fixed_divisor_recalc,
1219}; 1310};
1220 1311
1221static const struct clksel pmd_stm_clock_mux_sel[] = { 1312static const struct clksel pmd_stm_clock_mux_sel[] = {
1222 { .parent = &sys_clkin_ck, .rates = div_1_0_rates }, 1313 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1223 { .parent = &dpll_core_m6_ck, .rates = div_1_1_rates }, 1314 { .parent = &dpll_core_m6x2_ck, .rates = div_1_1_rates },
1224 { .parent = &tie_low_clock_ck, .rates = div_1_2_rates }, 1315 { .parent = &tie_low_clock_ck, .rates = div_1_2_rates },
1225 { .parent = NULL }, 1316 { .parent = NULL },
1226}; 1317};
@@ -1354,7 +1445,7 @@ static struct clk dsp_fck = {
1354 .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, 1445 .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL,
1355 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1446 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1356 .clkdm_name = "tesla_clkdm", 1447 .clkdm_name = "tesla_clkdm",
1357 .parent = &dpll_iva_m4_ck, 1448 .parent = &dpll_iva_m4x2_ck,
1358 .recalc = &followparent_recalc, 1449 .recalc = &followparent_recalc,
1359}; 1450};
1360 1451
@@ -1384,7 +1475,7 @@ static struct clk dss_dss_clk = {
1384 .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, 1475 .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1385 .enable_bit = OMAP4430_OPTFCLKEN_DSSCLK_SHIFT, 1476 .enable_bit = OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
1386 .clkdm_name = "l3_dss_clkdm", 1477 .clkdm_name = "l3_dss_clkdm",
1387 .parent = &dpll_per_m5_ck, 1478 .parent = &dpll_per_m5x2_ck,
1388 .recalc = &followparent_recalc, 1479 .recalc = &followparent_recalc,
1389}; 1480};
1390 1481
@@ -1441,14 +1532,14 @@ static struct clk emif2_fck = {
1441}; 1532};
1442 1533
1443static const struct clksel fdif_fclk_div[] = { 1534static const struct clksel fdif_fclk_div[] = {
1444 { .parent = &dpll_per_m4_ck, .rates = div3_1to4_rates }, 1535 { .parent = &dpll_per_m4x2_ck, .rates = div3_1to4_rates },
1445 { .parent = NULL }, 1536 { .parent = NULL },
1446}; 1537};
1447 1538
1448/* Merged fdif_fclk into fdif */ 1539/* Merged fdif_fclk into fdif */
1449static struct clk fdif_fck = { 1540static struct clk fdif_fck = {
1450 .name = "fdif_fck", 1541 .name = "fdif_fck",
1451 .parent = &dpll_per_m4_ck, 1542 .parent = &dpll_per_m4x2_ck,
1452 .clksel = fdif_fclk_div, 1543 .clksel = fdif_fclk_div,
1453 .clksel_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL, 1544 .clksel_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL,
1454 .clksel_mask = OMAP4430_CLKSEL_FCLK_MASK, 1545 .clksel_mask = OMAP4430_CLKSEL_FCLK_MASK,
@@ -1602,15 +1693,15 @@ static struct clk gpmc_ick = {
1602}; 1693};
1603 1694
1604static const struct clksel sgx_clk_mux_sel[] = { 1695static const struct clksel sgx_clk_mux_sel[] = {
1605 { .parent = &dpll_core_m7_ck, .rates = div_1_0_rates }, 1696 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
1606 { .parent = &dpll_per_m7_ck, .rates = div_1_1_rates }, 1697 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
1607 { .parent = NULL }, 1698 { .parent = NULL },
1608}; 1699};
1609 1700
1610/* Merged sgx_clk_mux into gpu */ 1701/* Merged sgx_clk_mux into gpu */
1611static struct clk gpu_fck = { 1702static struct clk gpu_fck = {
1612 .name = "gpu_fck", 1703 .name = "gpu_fck",
1613 .parent = &dpll_core_m7_ck, 1704 .parent = &dpll_core_m7x2_ck,
1614 .clksel = sgx_clk_mux_sel, 1705 .clksel = sgx_clk_mux_sel,
1615 .init = &omap2_init_clksel_parent, 1706 .init = &omap2_init_clksel_parent,
1616 .clksel_reg = OMAP4430_CM_GFX_GFX_CLKCTRL, 1707 .clksel_reg = OMAP4430_CM_GFX_GFX_CLKCTRL,
@@ -1729,7 +1820,7 @@ static struct clk iva_fck = {
1729 .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, 1820 .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
1730 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1821 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1731 .clkdm_name = "ivahd_clkdm", 1822 .clkdm_name = "ivahd_clkdm",
1732 .parent = &dpll_iva_m5_ck, 1823 .parent = &dpll_iva_m5x2_ck,
1733 .recalc = &followparent_recalc, 1824 .recalc = &followparent_recalc,
1734}; 1825};
1735 1826
@@ -1749,6 +1840,7 @@ static struct clk l3_instr_ick = {
1749 .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL, 1840 .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL,
1750 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1841 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1751 .clkdm_name = "l3_instr_clkdm", 1842 .clkdm_name = "l3_instr_clkdm",
1843 .flags = ENABLE_ON_INIT,
1752 .parent = &l3_div_ck, 1844 .parent = &l3_div_ck,
1753 .recalc = &followparent_recalc, 1845 .recalc = &followparent_recalc,
1754}; 1846};
@@ -1759,6 +1851,7 @@ static struct clk l3_main_3_ick = {
1759 .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL, 1851 .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL,
1760 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1852 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1761 .clkdm_name = "l3_instr_clkdm", 1853 .clkdm_name = "l3_instr_clkdm",
1854 .flags = ENABLE_ON_INIT,
1762 .parent = &l3_div_ck, 1855 .parent = &l3_div_ck,
1763 .recalc = &followparent_recalc, 1856 .recalc = &followparent_recalc,
1764}; 1857};
@@ -2063,6 +2156,7 @@ static struct clk ocp_wp_noc_ick = {
2063 .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL, 2156 .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL,
2064 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 2157 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
2065 .clkdm_name = "l3_instr_clkdm", 2158 .clkdm_name = "l3_instr_clkdm",
2159 .flags = ENABLE_ON_INIT,
2066 .parent = &l3_div_ck, 2160 .parent = &l3_div_ck,
2067 .recalc = &followparent_recalc, 2161 .recalc = &followparent_recalc,
2068}; 2162};
@@ -2093,7 +2187,7 @@ static struct clk sl2if_ick = {
2093 .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, 2187 .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL,
2094 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 2188 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
2095 .clkdm_name = "ivahd_clkdm", 2189 .clkdm_name = "ivahd_clkdm",
2096 .parent = &dpll_iva_m5_ck, 2190 .parent = &dpll_iva_m5x2_ck,
2097 .recalc = &followparent_recalc, 2191 .recalc = &followparent_recalc,
2098}; 2192};
2099 2193
@@ -2438,36 +2532,6 @@ static struct clk usb_host_fs_fck = {
2438 .recalc = &followparent_recalc, 2532 .recalc = &followparent_recalc,
2439}; 2533};
2440 2534
2441static struct clk usb_host_hs_utmi_p3_clk = {
2442 .name = "usb_host_hs_utmi_p3_clk",
2443 .ops = &clkops_omap2_dflt,
2444 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2445 .enable_bit = OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT,
2446 .clkdm_name = "l3_init_clkdm",
2447 .parent = &init_60m_fclk,
2448 .recalc = &followparent_recalc,
2449};
2450
2451static struct clk usb_host_hs_hsic60m_p1_clk = {
2452 .name = "usb_host_hs_hsic60m_p1_clk",
2453 .ops = &clkops_omap2_dflt,
2454 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2455 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT,
2456 .clkdm_name = "l3_init_clkdm",
2457 .parent = &init_60m_fclk,
2458 .recalc = &followparent_recalc,
2459};
2460
2461static struct clk usb_host_hs_hsic60m_p2_clk = {
2462 .name = "usb_host_hs_hsic60m_p2_clk",
2463 .ops = &clkops_omap2_dflt,
2464 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2465 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT,
2466 .clkdm_name = "l3_init_clkdm",
2467 .parent = &init_60m_fclk,
2468 .recalc = &followparent_recalc,
2469};
2470
2471static const struct clksel utmi_p1_gfclk_sel[] = { 2535static const struct clksel utmi_p1_gfclk_sel[] = {
2472 { .parent = &init_60m_fclk, .rates = div_1_0_rates }, 2536 { .parent = &init_60m_fclk, .rates = div_1_0_rates },
2473 { .parent = &xclk60mhsp1_ck, .rates = div_1_1_rates }, 2537 { .parent = &xclk60mhsp1_ck, .rates = div_1_1_rates },
@@ -2522,6 +2586,16 @@ static struct clk usb_host_hs_utmi_p2_clk = {
2522 .recalc = &followparent_recalc, 2586 .recalc = &followparent_recalc,
2523}; 2587};
2524 2588
2589static struct clk usb_host_hs_utmi_p3_clk = {
2590 .name = "usb_host_hs_utmi_p3_clk",
2591 .ops = &clkops_omap2_dflt,
2592 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2593 .enable_bit = OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT,
2594 .clkdm_name = "l3_init_clkdm",
2595 .parent = &init_60m_fclk,
2596 .recalc = &followparent_recalc,
2597};
2598
2525static struct clk usb_host_hs_hsic480m_p1_clk = { 2599static struct clk usb_host_hs_hsic480m_p1_clk = {
2526 .name = "usb_host_hs_hsic480m_p1_clk", 2600 .name = "usb_host_hs_hsic480m_p1_clk",
2527 .ops = &clkops_omap2_dflt, 2601 .ops = &clkops_omap2_dflt,
@@ -2532,6 +2606,26 @@ static struct clk usb_host_hs_hsic480m_p1_clk = {
2532 .recalc = &followparent_recalc, 2606 .recalc = &followparent_recalc,
2533}; 2607};
2534 2608
2609static struct clk usb_host_hs_hsic60m_p1_clk = {
2610 .name = "usb_host_hs_hsic60m_p1_clk",
2611 .ops = &clkops_omap2_dflt,
2612 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2613 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT,
2614 .clkdm_name = "l3_init_clkdm",
2615 .parent = &init_60m_fclk,
2616 .recalc = &followparent_recalc,
2617};
2618
2619static struct clk usb_host_hs_hsic60m_p2_clk = {
2620 .name = "usb_host_hs_hsic60m_p2_clk",
2621 .ops = &clkops_omap2_dflt,
2622 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2623 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT,
2624 .clkdm_name = "l3_init_clkdm",
2625 .parent = &init_60m_fclk,
2626 .recalc = &followparent_recalc,
2627};
2628
2535static struct clk usb_host_hs_hsic480m_p2_clk = { 2629static struct clk usb_host_hs_hsic480m_p2_clk = {
2536 .name = "usb_host_hs_hsic480m_p2_clk", 2630 .name = "usb_host_hs_hsic480m_p2_clk",
2537 .ops = &clkops_omap2_dflt, 2631 .ops = &clkops_omap2_dflt,
@@ -2656,13 +2750,13 @@ static const struct clksel_rate div2_14to18_rates[] = {
2656}; 2750};
2657 2751
2658static const struct clksel usim_fclk_div[] = { 2752static const struct clksel usim_fclk_div[] = {
2659 { .parent = &dpll_per_m4_ck, .rates = div2_14to18_rates }, 2753 { .parent = &dpll_per_m4x2_ck, .rates = div2_14to18_rates },
2660 { .parent = NULL }, 2754 { .parent = NULL },
2661}; 2755};
2662 2756
2663static struct clk usim_ck = { 2757static struct clk usim_ck = {
2664 .name = "usim_ck", 2758 .name = "usim_ck",
2665 .parent = &dpll_per_m4_ck, 2759 .parent = &dpll_per_m4x2_ck,
2666 .clksel = usim_fclk_div, 2760 .clksel = usim_fclk_div,
2667 .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, 2761 .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL,
2668 .clksel_mask = OMAP4430_CLKSEL_DIV_MASK, 2762 .clksel_mask = OMAP4430_CLKSEL_DIV_MASK,
@@ -2747,6 +2841,168 @@ static struct clk trace_clk_div_ck = {
2747 .set_rate = &omap2_clksel_set_rate, 2841 .set_rate = &omap2_clksel_set_rate,
2748}; 2842};
2749 2843
2844/* SCRM aux clk nodes */
2845
2846static const struct clksel auxclk_sel[] = {
2847 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
2848 { .parent = &dpll_core_m3x2_ck, .rates = div_1_1_rates },
2849 { .parent = &dpll_per_m3x2_ck, .rates = div_1_2_rates },
2850 { .parent = NULL },
2851};
2852
2853static struct clk auxclk0_ck = {
2854 .name = "auxclk0_ck",
2855 .parent = &sys_clkin_ck,
2856 .init = &omap2_init_clksel_parent,
2857 .ops = &clkops_omap2_dflt,
2858 .clksel = auxclk_sel,
2859 .clksel_reg = OMAP4_SCRM_AUXCLK0,
2860 .clksel_mask = OMAP4_SRCSELECT_MASK,
2861 .recalc = &omap2_clksel_recalc,
2862 .enable_reg = OMAP4_SCRM_AUXCLK0,
2863 .enable_bit = OMAP4_ENABLE_SHIFT,
2864};
2865
2866static struct clk auxclk1_ck = {
2867 .name = "auxclk1_ck",
2868 .parent = &sys_clkin_ck,
2869 .init = &omap2_init_clksel_parent,
2870 .ops = &clkops_omap2_dflt,
2871 .clksel = auxclk_sel,
2872 .clksel_reg = OMAP4_SCRM_AUXCLK1,
2873 .clksel_mask = OMAP4_SRCSELECT_MASK,
2874 .recalc = &omap2_clksel_recalc,
2875 .enable_reg = OMAP4_SCRM_AUXCLK1,
2876 .enable_bit = OMAP4_ENABLE_SHIFT,
2877};
2878
2879static struct clk auxclk2_ck = {
2880 .name = "auxclk2_ck",
2881 .parent = &sys_clkin_ck,
2882 .init = &omap2_init_clksel_parent,
2883 .ops = &clkops_omap2_dflt,
2884 .clksel = auxclk_sel,
2885 .clksel_reg = OMAP4_SCRM_AUXCLK2,
2886 .clksel_mask = OMAP4_SRCSELECT_MASK,
2887 .recalc = &omap2_clksel_recalc,
2888 .enable_reg = OMAP4_SCRM_AUXCLK2,
2889 .enable_bit = OMAP4_ENABLE_SHIFT,
2890};
2891static struct clk auxclk3_ck = {
2892 .name = "auxclk3_ck",
2893 .parent = &sys_clkin_ck,
2894 .init = &omap2_init_clksel_parent,
2895 .ops = &clkops_omap2_dflt,
2896 .clksel = auxclk_sel,
2897 .clksel_reg = OMAP4_SCRM_AUXCLK3,
2898 .clksel_mask = OMAP4_SRCSELECT_MASK,
2899 .recalc = &omap2_clksel_recalc,
2900 .enable_reg = OMAP4_SCRM_AUXCLK3,
2901 .enable_bit = OMAP4_ENABLE_SHIFT,
2902};
2903
2904static struct clk auxclk4_ck = {
2905 .name = "auxclk4_ck",
2906 .parent = &sys_clkin_ck,
2907 .init = &omap2_init_clksel_parent,
2908 .ops = &clkops_omap2_dflt,
2909 .clksel = auxclk_sel,
2910 .clksel_reg = OMAP4_SCRM_AUXCLK4,
2911 .clksel_mask = OMAP4_SRCSELECT_MASK,
2912 .recalc = &omap2_clksel_recalc,
2913 .enable_reg = OMAP4_SCRM_AUXCLK4,
2914 .enable_bit = OMAP4_ENABLE_SHIFT,
2915};
2916
2917static struct clk auxclk5_ck = {
2918 .name = "auxclk5_ck",
2919 .parent = &sys_clkin_ck,
2920 .init = &omap2_init_clksel_parent,
2921 .ops = &clkops_omap2_dflt,
2922 .clksel = auxclk_sel,
2923 .clksel_reg = OMAP4_SCRM_AUXCLK5,
2924 .clksel_mask = OMAP4_SRCSELECT_MASK,
2925 .recalc = &omap2_clksel_recalc,
2926 .enable_reg = OMAP4_SCRM_AUXCLK5,
2927 .enable_bit = OMAP4_ENABLE_SHIFT,
2928};
2929
2930static const struct clksel auxclkreq_sel[] = {
2931 { .parent = &auxclk0_ck, .rates = div_1_0_rates },
2932 { .parent = &auxclk1_ck, .rates = div_1_1_rates },
2933 { .parent = &auxclk2_ck, .rates = div_1_2_rates },
2934 { .parent = &auxclk3_ck, .rates = div_1_3_rates },
2935 { .parent = &auxclk4_ck, .rates = div_1_4_rates },
2936 { .parent = &auxclk5_ck, .rates = div_1_5_rates },
2937 { .parent = NULL },
2938};
2939
2940static struct clk auxclkreq0_ck = {
2941 .name = "auxclkreq0_ck",
2942 .parent = &auxclk0_ck,
2943 .init = &omap2_init_clksel_parent,
2944 .ops = &clkops_null,
2945 .clksel = auxclkreq_sel,
2946 .clksel_reg = OMAP4_SCRM_AUXCLKREQ0,
2947 .clksel_mask = OMAP4_MAPPING_MASK,
2948 .recalc = &omap2_clksel_recalc,
2949};
2950
2951static struct clk auxclkreq1_ck = {
2952 .name = "auxclkreq1_ck",
2953 .parent = &auxclk1_ck,
2954 .init = &omap2_init_clksel_parent,
2955 .ops = &clkops_null,
2956 .clksel = auxclkreq_sel,
2957 .clksel_reg = OMAP4_SCRM_AUXCLKREQ1,
2958 .clksel_mask = OMAP4_MAPPING_MASK,
2959 .recalc = &omap2_clksel_recalc,
2960};
2961
2962static struct clk auxclkreq2_ck = {
2963 .name = "auxclkreq2_ck",
2964 .parent = &auxclk2_ck,
2965 .init = &omap2_init_clksel_parent,
2966 .ops = &clkops_null,
2967 .clksel = auxclkreq_sel,
2968 .clksel_reg = OMAP4_SCRM_AUXCLKREQ2,
2969 .clksel_mask = OMAP4_MAPPING_MASK,
2970 .recalc = &omap2_clksel_recalc,
2971};
2972
2973static struct clk auxclkreq3_ck = {
2974 .name = "auxclkreq3_ck",
2975 .parent = &auxclk3_ck,
2976 .init = &omap2_init_clksel_parent,
2977 .ops = &clkops_null,
2978 .clksel = auxclkreq_sel,
2979 .clksel_reg = OMAP4_SCRM_AUXCLKREQ3,
2980 .clksel_mask = OMAP4_MAPPING_MASK,
2981 .recalc = &omap2_clksel_recalc,
2982};
2983
2984static struct clk auxclkreq4_ck = {
2985 .name = "auxclkreq4_ck",
2986 .parent = &auxclk4_ck,
2987 .init = &omap2_init_clksel_parent,
2988 .ops = &clkops_null,
2989 .clksel = auxclkreq_sel,
2990 .clksel_reg = OMAP4_SCRM_AUXCLKREQ4,
2991 .clksel_mask = OMAP4_MAPPING_MASK,
2992 .recalc = &omap2_clksel_recalc,
2993};
2994
2995static struct clk auxclkreq5_ck = {
2996 .name = "auxclkreq5_ck",
2997 .parent = &auxclk5_ck,
2998 .init = &omap2_init_clksel_parent,
2999 .ops = &clkops_null,
3000 .clksel = auxclkreq_sel,
3001 .clksel_reg = OMAP4_SCRM_AUXCLKREQ5,
3002 .clksel_mask = OMAP4_MAPPING_MASK,
3003 .recalc = &omap2_clksel_recalc,
3004};
3005
2750/* 3006/*
2751 * clkdev 3007 * clkdev
2752 */ 3008 */
@@ -2774,43 +3030,48 @@ static struct omap_clk omap44xx_clks[] = {
2774 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck, CK_443X), 3030 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck, CK_443X),
2775 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck, CK_443X), 3031 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck, CK_443X),
2776 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck, CK_443X), 3032 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck, CK_443X),
3033 CLK(NULL, "dpll_abe_x2_ck", &dpll_abe_x2_ck, CK_443X),
2777 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, CK_443X), 3034 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, CK_443X),
2778 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk, CK_443X), 3035 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk, CK_443X),
2779 CLK(NULL, "abe_clk", &abe_clk, CK_443X), 3036 CLK(NULL, "abe_clk", &abe_clk, CK_443X),
2780 CLK(NULL, "aess_fclk", &aess_fclk, CK_443X), 3037 CLK(NULL, "aess_fclk", &aess_fclk, CK_443X),
2781 CLK(NULL, "dpll_abe_m3_ck", &dpll_abe_m3_ck, CK_443X), 3038 CLK(NULL, "dpll_abe_m3x2_ck", &dpll_abe_m3x2_ck, CK_443X),
2782 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck, CK_443X), 3039 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck, CK_443X),
2783 CLK(NULL, "dpll_core_ck", &dpll_core_ck, CK_443X), 3040 CLK(NULL, "dpll_core_ck", &dpll_core_ck, CK_443X),
2784 CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_443X), 3041 CLK(NULL, "dpll_core_x2_ck", &dpll_core_x2_ck, CK_443X),
3042 CLK(NULL, "dpll_core_m6x2_ck", &dpll_core_m6x2_ck, CK_443X),
2785 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck, CK_443X), 3043 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck, CK_443X),
2786 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck, CK_443X), 3044 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck, CK_443X),
2787 CLK(NULL, "ddrphy_ck", &ddrphy_ck, CK_443X), 3045 CLK(NULL, "ddrphy_ck", &ddrphy_ck, CK_443X),
2788 CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_443X), 3046 CLK(NULL, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, CK_443X),
2789 CLK(NULL, "div_core_ck", &div_core_ck, CK_443X), 3047 CLK(NULL, "div_core_ck", &div_core_ck, CK_443X),
2790 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk, CK_443X), 3048 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk, CK_443X),
2791 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X), 3049 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),
2792 CLK(NULL, "dpll_core_m4_ck", &dpll_core_m4_ck, CK_443X), 3050 CLK(NULL, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck, CK_443X),
2793 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck, CK_443X), 3051 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck, CK_443X),
2794 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck, CK_443X), 3052 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck, CK_443X),
2795 CLK(NULL, "dpll_core_m3_ck", &dpll_core_m3_ck, CK_443X), 3053 CLK(NULL, "dpll_core_m3x2_ck", &dpll_core_m3x2_ck, CK_443X),
2796 CLK(NULL, "dpll_core_m7_ck", &dpll_core_m7_ck, CK_443X), 3054 CLK(NULL, "dpll_core_m7x2_ck", &dpll_core_m7x2_ck, CK_443X),
2797 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck, CK_443X), 3055 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck, CK_443X),
2798 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck, CK_443X), 3056 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck, CK_443X),
2799 CLK(NULL, "dpll_iva_m4_ck", &dpll_iva_m4_ck, CK_443X), 3057 CLK(NULL, "dpll_iva_x2_ck", &dpll_iva_x2_ck, CK_443X),
2800 CLK(NULL, "dpll_iva_m5_ck", &dpll_iva_m5_ck, CK_443X), 3058 CLK(NULL, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck, CK_443X),
3059 CLK(NULL, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, CK_443X),
2801 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_443X), 3060 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_443X),
2802 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_443X), 3061 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_443X),
2803 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X), 3062 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X),
2804 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck, CK_443X), 3063 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck, CK_443X),
2805 CLK(NULL, "dpll_per_ck", &dpll_per_ck, CK_443X), 3064 CLK(NULL, "dpll_per_ck", &dpll_per_ck, CK_443X),
2806 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck, CK_443X), 3065 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck, CK_443X),
3066 CLK(NULL, "dpll_per_x2_ck", &dpll_per_x2_ck, CK_443X),
2807 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, CK_443X), 3067 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, CK_443X),
2808 CLK(NULL, "dpll_per_m3_ck", &dpll_per_m3_ck, CK_443X), 3068 CLK(NULL, "dpll_per_m3x2_ck", &dpll_per_m3x2_ck, CK_443X),
2809 CLK(NULL, "dpll_per_m4_ck", &dpll_per_m4_ck, CK_443X), 3069 CLK(NULL, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, CK_443X),
2810 CLK(NULL, "dpll_per_m5_ck", &dpll_per_m5_ck, CK_443X), 3070 CLK(NULL, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, CK_443X),
2811 CLK(NULL, "dpll_per_m6_ck", &dpll_per_m6_ck, CK_443X), 3071 CLK(NULL, "dpll_per_m6x2_ck", &dpll_per_m6x2_ck, CK_443X),
2812 CLK(NULL, "dpll_per_m7_ck", &dpll_per_m7_ck, CK_443X), 3072 CLK(NULL, "dpll_per_m7x2_ck", &dpll_per_m7x2_ck, CK_443X),
2813 CLK(NULL, "dpll_unipro_ck", &dpll_unipro_ck, CK_443X), 3073 CLK(NULL, "dpll_unipro_ck", &dpll_unipro_ck, CK_443X),
3074 CLK(NULL, "dpll_unipro_x2_ck", &dpll_unipro_x2_ck, CK_443X),
2814 CLK(NULL, "dpll_unipro_m2x2_ck", &dpll_unipro_m2x2_ck, CK_443X), 3075 CLK(NULL, "dpll_unipro_m2x2_ck", &dpll_unipro_m2x2_ck, CK_443X),
2815 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck, CK_443X), 3076 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck, CK_443X),
2816 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck, CK_443X), 3077 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck, CK_443X),
@@ -2856,26 +3117,26 @@ static struct omap_clk omap44xx_clks[] = {
2856 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X), 3117 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X),
2857 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X), 3118 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X),
2858 CLK(NULL, "fpka_fck", &fpka_fck, CK_443X), 3119 CLK(NULL, "fpka_fck", &fpka_fck, CK_443X),
2859 CLK(NULL, "gpio1_dbck", &gpio1_dbclk, CK_443X), 3120 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk, CK_443X),
2860 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X), 3121 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X),
2861 CLK(NULL, "gpio2_dbck", &gpio2_dbclk, CK_443X), 3122 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk, CK_443X),
2862 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X), 3123 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X),
2863 CLK(NULL, "gpio3_dbck", &gpio3_dbclk, CK_443X), 3124 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk, CK_443X),
2864 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X), 3125 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X),
2865 CLK(NULL, "gpio4_dbck", &gpio4_dbclk, CK_443X), 3126 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk, CK_443X),
2866 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X), 3127 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X),
2867 CLK(NULL, "gpio5_dbck", &gpio5_dbclk, CK_443X), 3128 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk, CK_443X),
2868 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X), 3129 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X),
2869 CLK(NULL, "gpio6_dbck", &gpio6_dbclk, CK_443X), 3130 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk, CK_443X),
2870 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X), 3131 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X),
2871 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X), 3132 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X),
2872 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X), 3133 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X),
2873 CLK("omap2_hdq.0", "fck", &hdq1w_fck, CK_443X), 3134 CLK("omap2_hdq.0", "fck", &hdq1w_fck, CK_443X),
2874 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X), 3135 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X),
2875 CLK("i2c_omap.1", "fck", &i2c1_fck, CK_443X), 3136 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_443X),
2876 CLK("i2c_omap.2", "fck", &i2c2_fck, CK_443X), 3137 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_443X),
2877 CLK("i2c_omap.3", "fck", &i2c3_fck, CK_443X), 3138 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_443X),
2878 CLK("i2c_omap.4", "fck", &i2c4_fck, CK_443X), 3139 CLK("omap_i2c.4", "fck", &i2c4_fck, CK_443X),
2879 CLK(NULL, "ipu_fck", &ipu_fck, CK_443X), 3140 CLK(NULL, "ipu_fck", &ipu_fck, CK_443X),
2880 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X), 3141 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X),
2881 CLK(NULL, "iss_fck", &iss_fck, CK_443X), 3142 CLK(NULL, "iss_fck", &iss_fck, CK_443X),
@@ -2937,14 +3198,14 @@ static struct omap_clk omap44xx_clks[] = {
2937 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), 3198 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
2938 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), 3199 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
2939 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), 3200 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
2940 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
2941 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
2942 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
2943 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), 3201 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
2944 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), 3202 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
2945 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), 3203 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
2946 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk, CK_443X), 3204 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk, CK_443X),
3205 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
2947 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk, CK_443X), 3206 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk, CK_443X),
3207 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
3208 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
2948 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), 3209 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
2949 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), 3210 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
2950 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X), 3211 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
@@ -2960,6 +3221,7 @@ static struct omap_clk omap44xx_clks[] = {
2960 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 3221 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
2961 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 3222 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
2962 CLK("omap_wdt", "fck", &wd_timer2_fck, CK_443X), 3223 CLK("omap_wdt", "fck", &wd_timer2_fck, CK_443X),
3224 CLK(NULL, "mailboxes_ick", &dummy_ck, CK_443X),
2963 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X), 3225 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X),
2964 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X), 3226 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X),
2965 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X), 3227 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X),
@@ -2975,10 +3237,10 @@ static struct omap_clk omap44xx_clks[] = {
2975 CLK(NULL, "gpt9_ick", &dummy_ck, CK_443X), 3237 CLK(NULL, "gpt9_ick", &dummy_ck, CK_443X),
2976 CLK(NULL, "gpt10_ick", &dummy_ck, CK_443X), 3238 CLK(NULL, "gpt10_ick", &dummy_ck, CK_443X),
2977 CLK(NULL, "gpt11_ick", &dummy_ck, CK_443X), 3239 CLK(NULL, "gpt11_ick", &dummy_ck, CK_443X),
2978 CLK("i2c_omap.1", "ick", &dummy_ck, CK_443X), 3240 CLK("omap_i2c.1", "ick", &dummy_ck, CK_443X),
2979 CLK("i2c_omap.2", "ick", &dummy_ck, CK_443X), 3241 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X),
2980 CLK("i2c_omap.3", "ick", &dummy_ck, CK_443X), 3242 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X),
2981 CLK("i2c_omap.4", "ick", &dummy_ck, CK_443X), 3243 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X),
2982 CLK("mmci-omap-hs.0", "ick", &dummy_ck, CK_443X), 3244 CLK("mmci-omap-hs.0", "ick", &dummy_ck, CK_443X),
2983 CLK("mmci-omap-hs.1", "ick", &dummy_ck, CK_443X), 3245 CLK("mmci-omap-hs.1", "ick", &dummy_ck, CK_443X),
2984 CLK("mmci-omap-hs.2", "ick", &dummy_ck, CK_443X), 3246 CLK("mmci-omap-hs.2", "ick", &dummy_ck, CK_443X),
@@ -2997,6 +3259,18 @@ static struct omap_clk omap44xx_clks[] = {
2997 CLK(NULL, "uart3_ick", &dummy_ck, CK_443X), 3259 CLK(NULL, "uart3_ick", &dummy_ck, CK_443X),
2998 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X), 3260 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
2999 CLK("omap_wdt", "ick", &dummy_ck, CK_443X), 3261 CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
3262 CLK(NULL, "auxclk0_ck", &auxclk0_ck, CK_443X),
3263 CLK(NULL, "auxclk1_ck", &auxclk1_ck, CK_443X),
3264 CLK(NULL, "auxclk2_ck", &auxclk2_ck, CK_443X),
3265 CLK(NULL, "auxclk3_ck", &auxclk3_ck, CK_443X),
3266 CLK(NULL, "auxclk4_ck", &auxclk4_ck, CK_443X),
3267 CLK(NULL, "auxclk5_ck", &auxclk5_ck, CK_443X),
3268 CLK(NULL, "auxclkreq0_ck", &auxclkreq0_ck, CK_443X),
3269 CLK(NULL, "auxclkreq1_ck", &auxclkreq1_ck, CK_443X),
3270 CLK(NULL, "auxclkreq2_ck", &auxclkreq2_ck, CK_443X),
3271 CLK(NULL, "auxclkreq3_ck", &auxclkreq3_ck, CK_443X),
3272 CLK(NULL, "auxclkreq4_ck", &auxclkreq4_ck, CK_443X),
3273 CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck, CK_443X),
3000}; 3274};
3001 3275
3002int __init omap4xxx_clk_init(void) 3276int __init omap4xxx_clk_init(void)
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 6fb61b1a0d46..e20b98636ab4 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -13,7 +13,6 @@
13 */ 13 */
14#undef DEBUG 14#undef DEBUG
15 15
16#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/device.h> 17#include <linux/device.h>
19#include <linux/list.h> 18#include <linux/list.h>
@@ -27,13 +26,16 @@
27 26
28#include <linux/bitops.h> 27#include <linux/bitops.h>
29 28
30#include "prm.h" 29#include "prm2xxx_3xxx.h"
31#include "prm-regbits-24xx.h" 30#include "prm-regbits-24xx.h"
32#include "cm.h" 31#include "cm2xxx_3xxx.h"
32#include "cm-regbits-24xx.h"
33#include "cminst44xx.h"
34#include "prcm44xx.h"
33 35
34#include <plat/clock.h> 36#include <plat/clock.h>
35#include <plat/powerdomain.h> 37#include "powerdomain.h"
36#include <plat/clockdomain.h> 38#include "clockdomain.h"
37#include <plat/prcm.h> 39#include <plat/prcm.h>
38 40
39/* clkdm_list contains all registered struct clockdomains */ 41/* clkdm_list contains all registered struct clockdomains */
@@ -141,6 +143,9 @@ static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm,
141 * clockdomain is in hardware-supervised mode. Meant to be called 143 * clockdomain is in hardware-supervised mode. Meant to be called
142 * once at clockdomain layer initialization, since these should remain 144 * once at clockdomain layer initialization, since these should remain
143 * fixed for a particular architecture. No return value. 145 * fixed for a particular architecture. No return value.
146 *
147 * XXX autodeps are deprecated and should be removed at the earliest
148 * opportunity
144 */ 149 */
145static void _autodep_lookup(struct clkdm_autodep *autodep) 150static void _autodep_lookup(struct clkdm_autodep *autodep)
146{ 151{
@@ -168,6 +173,9 @@ static void _autodep_lookup(struct clkdm_autodep *autodep)
168 * Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm' 173 * Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm'
169 * in hardware-supervised mode. Meant to be called from clock framework 174 * in hardware-supervised mode. Meant to be called from clock framework
170 * when a clock inside clockdomain 'clkdm' is enabled. No return value. 175 * when a clock inside clockdomain 'clkdm' is enabled. No return value.
176 *
177 * XXX autodeps are deprecated and should be removed at the earliest
178 * opportunity
171 */ 179 */
172static void _clkdm_add_autodeps(struct clockdomain *clkdm) 180static void _clkdm_add_autodeps(struct clockdomain *clkdm)
173{ 181{
@@ -199,6 +207,9 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
199 * Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm' 207 * Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm'
200 * in hardware-supervised mode. Meant to be called from clock framework 208 * in hardware-supervised mode. Meant to be called from clock framework
201 * when a clock inside clockdomain 'clkdm' is disabled. No return value. 209 * when a clock inside clockdomain 'clkdm' is disabled. No return value.
210 *
211 * XXX autodeps are deprecated and should be removed at the earliest
212 * opportunity
202 */ 213 */
203static void _clkdm_del_autodeps(struct clockdomain *clkdm) 214static void _clkdm_del_autodeps(struct clockdomain *clkdm)
204{ 215{
@@ -223,39 +234,56 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
223 } 234 }
224} 235}
225 236
226/* 237/**
227 * _omap2_clkdm_set_hwsup - set the hwsup idle transition bit 238 * _enable_hwsup - place a clockdomain into hardware-supervised idle
228 * @clkdm: struct clockdomain * 239 * @clkdm: struct clockdomain *
229 * @enable: int 0 to disable, 1 to enable
230 * 240 *
231 * Internal helper for actually switching the bit that controls hwsup 241 * Place the clockdomain into hardware-supervised idle mode. No return
232 * idle transitions for clkdm. 242 * value.
243 *
244 * XXX Should this return an error if the clockdomain does not support
245 * hardware-supervised idle mode?
233 */ 246 */
234static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable) 247static void _enable_hwsup(struct clockdomain *clkdm)
235{ 248{
236 u32 bits, v; 249 if (cpu_is_omap24xx())
237 250 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
238 if (cpu_is_omap24xx()) { 251 clkdm->clktrctrl_mask);
239 if (enable) 252 else if (cpu_is_omap34xx())
240 bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; 253 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
241 else 254 clkdm->clktrctrl_mask);
242 bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; 255 else if (cpu_is_omap44xx())
243 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 256 return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
244 if (enable) 257 clkdm->cm_inst,
245 bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; 258 clkdm->clkdm_offs);
246 else 259 else
247 bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO;
248 } else {
249 BUG(); 260 BUG();
250 } 261}
251
252 bits = bits << __ffs(clkdm->clktrctrl_mask);
253
254 v = __raw_readl(clkdm->clkstctrl_reg);
255 v &= ~(clkdm->clktrctrl_mask);
256 v |= bits;
257 __raw_writel(v, clkdm->clkstctrl_reg);
258 262
263/**
264 * _disable_hwsup - place a clockdomain into software-supervised idle
265 * @clkdm: struct clockdomain *
266 *
267 * Place the clockdomain @clkdm into software-supervised idle mode.
268 * No return value.
269 *
270 * XXX Should this return an error if the clockdomain does not support
271 * software-supervised idle mode?
272 */
273static void _disable_hwsup(struct clockdomain *clkdm)
274{
275 if (cpu_is_omap24xx())
276 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
277 clkdm->clktrctrl_mask);
278 else if (cpu_is_omap34xx())
279 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
280 clkdm->clktrctrl_mask);
281 else if (cpu_is_omap44xx())
282 return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition,
283 clkdm->cm_inst,
284 clkdm->clkdm_offs);
285 else
286 BUG();
259} 287}
260 288
261/* Public functions */ 289/* Public functions */
@@ -409,7 +437,7 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
409 pr_debug("clockdomain: hardware will wake up %s when %s wakes " 437 pr_debug("clockdomain: hardware will wake up %s when %s wakes "
410 "up\n", clkdm1->name, clkdm2->name); 438 "up\n", clkdm1->name, clkdm2->name);
411 439
412 prm_set_mod_reg_bits((1 << clkdm2->dep_bit), 440 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
413 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); 441 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
414 } 442 }
415 443
@@ -444,7 +472,7 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
444 pr_debug("clockdomain: hardware will no longer wake up %s " 472 pr_debug("clockdomain: hardware will no longer wake up %s "
445 "after %s wakes up\n", clkdm1->name, clkdm2->name); 473 "after %s wakes up\n", clkdm1->name, clkdm2->name);
446 474
447 prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 475 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
448 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); 476 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
449 } 477 }
450 478
@@ -480,7 +508,7 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
480 } 508 }
481 509
482 /* XXX It's faster to return the atomic wkdep_usecount */ 510 /* XXX It's faster to return the atomic wkdep_usecount */
483 return prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP, 511 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP,
484 (1 << clkdm2->dep_bit)); 512 (1 << clkdm2->dep_bit));
485} 513}
486 514
@@ -514,7 +542,7 @@ int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
514 atomic_set(&cd->wkdep_usecount, 0); 542 atomic_set(&cd->wkdep_usecount, 0);
515 } 543 }
516 544
517 prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP); 545 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP);
518 546
519 return 0; 547 return 0;
520} 548}
@@ -553,7 +581,7 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
553 pr_debug("clockdomain: will prevent %s from sleeping if %s " 581 pr_debug("clockdomain: will prevent %s from sleeping if %s "
554 "is active\n", clkdm1->name, clkdm2->name); 582 "is active\n", clkdm1->name, clkdm2->name);
555 583
556 cm_set_mod_reg_bits((1 << clkdm2->dep_bit), 584 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
557 clkdm1->pwrdm.ptr->prcm_offs, 585 clkdm1->pwrdm.ptr->prcm_offs,
558 OMAP3430_CM_SLEEPDEP); 586 OMAP3430_CM_SLEEPDEP);
559 } 587 }
@@ -596,7 +624,7 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
596 "sleeping if %s is active\n", clkdm1->name, 624 "sleeping if %s is active\n", clkdm1->name,
597 clkdm2->name); 625 clkdm2->name);
598 626
599 cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 627 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
600 clkdm1->pwrdm.ptr->prcm_offs, 628 clkdm1->pwrdm.ptr->prcm_offs,
601 OMAP3430_CM_SLEEPDEP); 629 OMAP3430_CM_SLEEPDEP);
602 } 630 }
@@ -639,7 +667,7 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
639 } 667 }
640 668
641 /* XXX It's faster to return the atomic sleepdep_usecount */ 669 /* XXX It's faster to return the atomic sleepdep_usecount */
642 return prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, 670 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
643 OMAP3430_CM_SLEEPDEP, 671 OMAP3430_CM_SLEEPDEP,
644 (1 << clkdm2->dep_bit)); 672 (1 << clkdm2->dep_bit));
645} 673}
@@ -677,35 +705,13 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
677 atomic_set(&cd->sleepdep_usecount, 0); 705 atomic_set(&cd->sleepdep_usecount, 0);
678 } 706 }
679 707
680 prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, 708 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
681 OMAP3430_CM_SLEEPDEP); 709 OMAP3430_CM_SLEEPDEP);
682 710
683 return 0; 711 return 0;
684} 712}
685 713
686/** 714/**
687 * omap2_clkdm_clktrctrl_read - read the clkdm's current state transition mode
688 * @clkdm: struct clkdm * of a clockdomain
689 *
690 * Return the clockdomain @clkdm current state transition mode from the
691 * corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if @clkdm
692 * is NULL or the current mode upon success.
693 */
694static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
695{
696 u32 v;
697
698 if (!clkdm)
699 return -EINVAL;
700
701 v = __raw_readl(clkdm->clkstctrl_reg);
702 v &= clkdm->clktrctrl_mask;
703 v >>= __ffs(clkdm->clktrctrl_mask);
704
705 return v;
706}
707
708/**
709 * omap2_clkdm_sleep - force clockdomain sleep transition 715 * omap2_clkdm_sleep - force clockdomain sleep transition
710 * @clkdm: struct clockdomain * 716 * @clkdm: struct clockdomain *
711 * 717 *
@@ -729,18 +735,19 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
729 735
730 if (cpu_is_omap24xx()) { 736 if (cpu_is_omap24xx()) {
731 737
732 cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, 738 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
733 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); 739 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
734 740
735 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 741 } else if (cpu_is_omap34xx()) {
742
743 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
744 clkdm->clktrctrl_mask);
736 745
737 u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << 746 } else if (cpu_is_omap44xx()) {
738 __ffs(clkdm->clktrctrl_mask));
739 747
740 u32 v = __raw_readl(clkdm->clkstctrl_reg); 748 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
741 v &= ~(clkdm->clktrctrl_mask); 749 clkdm->cm_inst,
742 v |= bits; 750 clkdm->clkdm_offs);
743 __raw_writel(v, clkdm->clkstctrl_reg);
744 751
745 } else { 752 } else {
746 BUG(); 753 BUG();
@@ -773,18 +780,19 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
773 780
774 if (cpu_is_omap24xx()) { 781 if (cpu_is_omap24xx()) {
775 782
776 cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, 783 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
777 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); 784 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
778 785
779 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 786 } else if (cpu_is_omap34xx()) {
780 787
781 u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << 788 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
782 __ffs(clkdm->clktrctrl_mask)); 789 clkdm->clktrctrl_mask);
783 790
784 u32 v = __raw_readl(clkdm->clkstctrl_reg); 791 } else if (cpu_is_omap44xx()) {
785 v &= ~(clkdm->clktrctrl_mask); 792
786 v |= bits; 793 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
787 __raw_writel(v, clkdm->clkstctrl_reg); 794 clkdm->cm_inst,
795 clkdm->clkdm_offs);
788 796
789 } else { 797 } else {
790 BUG(); 798 BUG();
@@ -829,7 +837,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
829 _clkdm_add_autodeps(clkdm); 837 _clkdm_add_autodeps(clkdm);
830 } 838 }
831 839
832 _omap2_clkdm_set_hwsup(clkdm, 1); 840 _enable_hwsup(clkdm);
833 841
834 pwrdm_clkdm_state_switch(clkdm); 842 pwrdm_clkdm_state_switch(clkdm);
835} 843}
@@ -857,7 +865,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
857 pr_debug("clockdomain: disabling automatic idle transitions for %s\n", 865 pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
858 clkdm->name); 866 clkdm->name);
859 867
860 _omap2_clkdm_set_hwsup(clkdm, 0); 868 _disable_hwsup(clkdm);
861 869
862 /* 870 /*
863 * XXX This should be removed once TI adds wakeup/sleep 871 * XXX This should be removed once TI adds wakeup/sleep
@@ -891,7 +899,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
891 */ 899 */
892int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) 900int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
893{ 901{
894 int v; 902 bool hwsup = false;
895 903
896 /* 904 /*
897 * XXX Rewrite this code to maintain a list of enabled 905 * XXX Rewrite this code to maintain a list of enabled
@@ -909,17 +917,27 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
909 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, 917 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name,
910 clk->name); 918 clk->name);
911 919
912 if (!clkdm->clkstctrl_reg) 920 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
913 return 0;
914 921
915 v = omap2_clkdm_clktrctrl_read(clkdm); 922 if (!clkdm->clktrctrl_mask)
923 return 0;
916 924
917 if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || 925 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
918 (cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) { 926 clkdm->clktrctrl_mask);
927
928 } else if (cpu_is_omap44xx()) {
929
930 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
931 clkdm->cm_inst,
932 clkdm->clkdm_offs);
933
934 }
935
936 if (hwsup) {
919 /* Disable HW transitions when we are changing deps */ 937 /* Disable HW transitions when we are changing deps */
920 _omap2_clkdm_set_hwsup(clkdm, 0); 938 _disable_hwsup(clkdm);
921 _clkdm_add_autodeps(clkdm); 939 _clkdm_add_autodeps(clkdm);
922 _omap2_clkdm_set_hwsup(clkdm, 1); 940 _enable_hwsup(clkdm);
923 } else { 941 } else {
924 omap2_clkdm_wakeup(clkdm); 942 omap2_clkdm_wakeup(clkdm);
925 } 943 }
@@ -946,7 +964,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
946 */ 964 */
947int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) 965int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
948{ 966{
949 int v; 967 bool hwsup = false;
950 968
951 /* 969 /*
952 * XXX Rewrite this code to maintain a list of enabled 970 * XXX Rewrite this code to maintain a list of enabled
@@ -971,17 +989,27 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
971 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, 989 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name,
972 clk->name); 990 clk->name);
973 991
974 if (!clkdm->clkstctrl_reg) 992 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
975 return 0;
976 993
977 v = omap2_clkdm_clktrctrl_read(clkdm); 994 if (!clkdm->clktrctrl_mask)
995 return 0;
996
997 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
998 clkdm->clktrctrl_mask);
999
1000 } else if (cpu_is_omap44xx()) {
1001
1002 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
1003 clkdm->cm_inst,
1004 clkdm->clkdm_offs);
1005
1006 }
978 1007
979 if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || 1008 if (hwsup) {
980 (cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) {
981 /* Disable HW transitions when we are changing deps */ 1009 /* Disable HW transitions when we are changing deps */
982 _omap2_clkdm_set_hwsup(clkdm, 0); 1010 _disable_hwsup(clkdm);
983 _clkdm_del_autodeps(clkdm); 1011 _clkdm_del_autodeps(clkdm);
984 _omap2_clkdm_set_hwsup(clkdm, 1); 1012 _enable_hwsup(clkdm);
985 } else { 1013 } else {
986 omap2_clkdm_sleep(clkdm); 1014 omap2_clkdm_sleep(clkdm);
987 } 1015 }
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index ba0a6c07c0fe..de3faa20b46b 100644
--- a/arch/arm/plat-omap/include/plat/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -4,19 +4,21 @@
4 * OMAP2/3 clockdomain framework functions 4 * OMAP2/3 clockdomain framework functions
5 * 5 *
6 * Copyright (C) 2008 Texas Instruments, Inc. 6 * Copyright (C) 2008 Texas Instruments, Inc.
7 * Copyright (C) 2008-2009 Nokia Corporation 7 * Copyright (C) 2008-2010 Nokia Corporation
8 * 8 *
9 * Written by Paul Walmsley 9 * Paul Walmsley
10 * 10 *
11 * 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
12 * 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
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 */ 14 */
15 15
16#ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 16#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
17#define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 17#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
18 18
19#include <plat/powerdomain.h> 19#include <linux/init.h>
20
21#include "powerdomain.h"
20#include <plat/clock.h> 22#include <plat/clock.h>
21#include <plat/cpu.h> 23#include <plat/cpu.h>
22 24
@@ -30,16 +32,6 @@
30#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) 32#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
31#define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP) 33#define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP)
32 34
33/* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */
34#define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0
35#define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1
36
37/* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */
38#define OMAP34XX_CLKSTCTRL_DISABLE_AUTO 0x0
39#define OMAP34XX_CLKSTCTRL_FORCE_SLEEP 0x1
40#define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2
41#define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3
42
43/** 35/**
44 * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode 36 * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode
45 * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only 37 * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only
@@ -90,11 +82,20 @@ struct clkdm_dep {
90 * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg 82 * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg
91 * @flags: Clockdomain capability flags 83 * @flags: Clockdomain capability flags
92 * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit 84 * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit
85 * @prcm_partition: (OMAP4 only) PRCM partition ID for this clkdm's registers
86 * @cm_inst: (OMAP4 only) CM instance register offset
87 * @clkdm_offs: (OMAP4 only) CM clockdomain register offset
93 * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up 88 * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up
94 * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact 89 * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact
95 * @omap_chip: OMAP chip types that this clockdomain is valid on 90 * @omap_chip: OMAP chip types that this clockdomain is valid on
96 * @usecount: Usecount tracking 91 * @usecount: Usecount tracking
97 * @node: list_head to link all clockdomains together 92 * @node: list_head to link all clockdomains together
93 *
94 * @prcm_partition should be a macro from mach-omap2/prcm44xx.h (OMAP4 only)
95 * @cm_inst should be a macro ending in _INST from the OMAP4 CM instance
96 * definitions (OMAP4 only)
97 * @clkdm_offs should be a macro ending in _CDOFFS from the OMAP4 CM instance
98 * definitions (OMAP4 only)
98 */ 99 */
99struct clockdomain { 100struct clockdomain {
100 const char *name; 101 const char *name;
@@ -102,10 +103,14 @@ struct clockdomain {
102 const char *name; 103 const char *name;
103 struct powerdomain *ptr; 104 struct powerdomain *ptr;
104 } pwrdm; 105 } pwrdm;
105 void __iomem *clkstctrl_reg; 106#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
106 const u16 clktrctrl_mask; 107 const u16 clktrctrl_mask;
108#endif
107 const u8 flags; 109 const u8 flags;
108 const u8 dep_bit; 110 const u8 dep_bit;
111 const u8 prcm_partition;
112 const s16 cm_inst;
113 const u16 clkdm_offs;
109 struct clkdm_dep *wkdep_srcs; 114 struct clkdm_dep *wkdep_srcs;
110 struct clkdm_dep *sleepdep_srcs; 115 struct clkdm_dep *sleepdep_srcs;
111 const struct omap_chip_id omap_chip; 116 const struct omap_chip_id omap_chip;
@@ -138,4 +143,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm);
138int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); 143int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
139int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); 144int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
140 145
146extern void __init omap2_clockdomains_init(void);
147extern void __init omap44xx_clockdomains_init(void);
148
141#endif 149#endif
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index 8fc19ff2cd89..e4a7133ea3b3 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2008-2009 Texas Instruments, Inc. 4 * Copyright (C) 2008-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation 5 * Copyright (C) 2008-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley and Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
9 * This file contains clockdomains and clockdomain wakeup/sleep 9 * This file contains clockdomains and clockdomain wakeup/sleep
10 * dependencies for the OMAP2/3 chips. Some notes: 10 * dependencies for the OMAP2/3 chips. Some notes:
@@ -32,12 +32,17 @@
32 * from the Power domain framework 32 * from the Power domain framework
33 */ 33 */
34 34
35#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 35#include <linux/kernel.h>
36#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 36#include <linux/io.h>
37 37
38#include <plat/clockdomain.h> 38#include "clockdomain.h"
39#include "cm.h" 39#include "prm2xxx_3xxx.h"
40#include "prm.h" 40#include "cm2xxx_3xxx.h"
41#include "cm-regbits-24xx.h"
42#include "cm-regbits-34xx.h"
43#include "cm-regbits-44xx.h"
44#include "prm-regbits-24xx.h"
45#include "prm-regbits-34xx.h"
41 46
42/* 47/*
43 * Clockdomain dependencies for wkdeps/sleepdeps 48 * Clockdomain dependencies for wkdeps/sleepdeps
@@ -84,8 +89,6 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = {
84 89
85/* 24XX-specific possible dependencies */ 90/* 24XX-specific possible dependencies */
86 91
87#ifdef CONFIG_ARCH_OMAP2
88
89/* Wakeup dependency source arrays */ 92/* Wakeup dependency source arrays */
90 93
91/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ 94/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
@@ -165,8 +168,6 @@ static struct clkdm_dep core_24xx_wkdeps[] = {
165 { NULL }, 168 { NULL },
166}; 169};
167 170
168#endif
169
170 171
171/* 2430-specific possible wakeup dependencies */ 172/* 2430-specific possible wakeup dependencies */
172 173
@@ -425,8 +426,6 @@ static struct clkdm_dep gfx_sgx_sleepdeps[] = {
425 * sys_clkout/sys_clkout2. 426 * sys_clkout/sys_clkout2.
426 */ 427 */
427 428
428#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
429
430/* This is an implicit clockdomain - it is never defined as such in TRM */ 429/* This is an implicit clockdomain - it is never defined as such in TRM */
431static struct clockdomain wkup_clkdm = { 430static struct clockdomain wkup_clkdm = {
432 .name = "wkup_clkdm", 431 .name = "wkup_clkdm",
@@ -447,8 +446,6 @@ static struct clockdomain cm_clkdm = {
447 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 446 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
448}; 447};
449 448
450#endif
451
452/* 449/*
453 * 2420-only clockdomains 450 * 2420-only clockdomains
454 */ 451 */
@@ -459,7 +456,6 @@ static struct clockdomain mpu_2420_clkdm = {
459 .name = "mpu_clkdm", 456 .name = "mpu_clkdm",
460 .pwrdm = { .name = "mpu_pwrdm" }, 457 .pwrdm = { .name = "mpu_pwrdm" },
461 .flags = CLKDM_CAN_HWSUP, 458 .flags = CLKDM_CAN_HWSUP,
462 .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
463 .wkdep_srcs = mpu_24xx_wkdeps, 459 .wkdep_srcs = mpu_24xx_wkdeps,
464 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 460 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
465 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 461 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -469,8 +465,6 @@ static struct clockdomain iva1_2420_clkdm = {
469 .name = "iva1_clkdm", 465 .name = "iva1_clkdm",
470 .pwrdm = { .name = "dsp_pwrdm" }, 466 .pwrdm = { .name = "dsp_pwrdm" },
471 .flags = CLKDM_CAN_HWSUP_SWSUP, 467 .flags = CLKDM_CAN_HWSUP_SWSUP,
472 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
473 OMAP2_CM_CLKSTCTRL),
474 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, 468 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
475 .wkdep_srcs = dsp_24xx_wkdeps, 469 .wkdep_srcs = dsp_24xx_wkdeps,
476 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, 470 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
@@ -481,8 +475,6 @@ static struct clockdomain dsp_2420_clkdm = {
481 .name = "dsp_clkdm", 475 .name = "dsp_clkdm",
482 .pwrdm = { .name = "dsp_pwrdm" }, 476 .pwrdm = { .name = "dsp_pwrdm" },
483 .flags = CLKDM_CAN_HWSUP_SWSUP, 477 .flags = CLKDM_CAN_HWSUP_SWSUP,
484 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
485 OMAP2_CM_CLKSTCTRL),
486 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 478 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
487 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 479 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
488}; 480};
@@ -491,7 +483,6 @@ static struct clockdomain gfx_2420_clkdm = {
491 .name = "gfx_clkdm", 483 .name = "gfx_clkdm",
492 .pwrdm = { .name = "gfx_pwrdm" }, 484 .pwrdm = { .name = "gfx_pwrdm" },
493 .flags = CLKDM_CAN_HWSUP_SWSUP, 485 .flags = CLKDM_CAN_HWSUP_SWSUP,
494 .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
495 .wkdep_srcs = gfx_sgx_wkdeps, 486 .wkdep_srcs = gfx_sgx_wkdeps,
496 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 487 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
497 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 488 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -501,7 +492,6 @@ static struct clockdomain core_l3_2420_clkdm = {
501 .name = "core_l3_clkdm", 492 .name = "core_l3_clkdm",
502 .pwrdm = { .name = "core_pwrdm" }, 493 .pwrdm = { .name = "core_pwrdm" },
503 .flags = CLKDM_CAN_HWSUP, 494 .flags = CLKDM_CAN_HWSUP,
504 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
505 .wkdep_srcs = core_24xx_wkdeps, 495 .wkdep_srcs = core_24xx_wkdeps,
506 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 496 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
507 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 497 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -511,7 +501,6 @@ static struct clockdomain core_l4_2420_clkdm = {
511 .name = "core_l4_clkdm", 501 .name = "core_l4_clkdm",
512 .pwrdm = { .name = "core_pwrdm" }, 502 .pwrdm = { .name = "core_pwrdm" },
513 .flags = CLKDM_CAN_HWSUP, 503 .flags = CLKDM_CAN_HWSUP,
514 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
515 .wkdep_srcs = core_24xx_wkdeps, 504 .wkdep_srcs = core_24xx_wkdeps,
516 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 505 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 506 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -521,7 +510,6 @@ static struct clockdomain dss_2420_clkdm = {
521 .name = "dss_clkdm", 510 .name = "dss_clkdm",
522 .pwrdm = { .name = "core_pwrdm" }, 511 .pwrdm = { .name = "core_pwrdm" },
523 .flags = CLKDM_CAN_HWSUP, 512 .flags = CLKDM_CAN_HWSUP,
524 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
525 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, 513 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
526 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 514 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
527}; 515};
@@ -539,8 +527,6 @@ static struct clockdomain mpu_2430_clkdm = {
539 .name = "mpu_clkdm", 527 .name = "mpu_clkdm",
540 .pwrdm = { .name = "mpu_pwrdm" }, 528 .pwrdm = { .name = "mpu_pwrdm" },
541 .flags = CLKDM_CAN_HWSUP_SWSUP, 529 .flags = CLKDM_CAN_HWSUP_SWSUP,
542 .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD,
543 OMAP2_CM_CLKSTCTRL),
544 .wkdep_srcs = mpu_24xx_wkdeps, 530 .wkdep_srcs = mpu_24xx_wkdeps,
545 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 531 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
546 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 532 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
@@ -551,8 +537,6 @@ static struct clockdomain mdm_clkdm = {
551 .name = "mdm_clkdm", 537 .name = "mdm_clkdm",
552 .pwrdm = { .name = "mdm_pwrdm" }, 538 .pwrdm = { .name = "mdm_pwrdm" },
553 .flags = CLKDM_CAN_HWSUP_SWSUP, 539 .flags = CLKDM_CAN_HWSUP_SWSUP,
554 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD,
555 OMAP2_CM_CLKSTCTRL),
556 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, 540 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
557 .wkdep_srcs = mdm_2430_wkdeps, 541 .wkdep_srcs = mdm_2430_wkdeps,
558 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, 542 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
@@ -563,8 +547,6 @@ static struct clockdomain dsp_2430_clkdm = {
563 .name = "dsp_clkdm", 547 .name = "dsp_clkdm",
564 .pwrdm = { .name = "dsp_pwrdm" }, 548 .pwrdm = { .name = "dsp_pwrdm" },
565 .flags = CLKDM_CAN_HWSUP_SWSUP, 549 .flags = CLKDM_CAN_HWSUP_SWSUP,
566 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD,
567 OMAP2_CM_CLKSTCTRL),
568 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, 550 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
569 .wkdep_srcs = dsp_24xx_wkdeps, 551 .wkdep_srcs = dsp_24xx_wkdeps,
570 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 552 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
@@ -575,7 +557,6 @@ static struct clockdomain gfx_2430_clkdm = {
575 .name = "gfx_clkdm", 557 .name = "gfx_clkdm",
576 .pwrdm = { .name = "gfx_pwrdm" }, 558 .pwrdm = { .name = "gfx_pwrdm" },
577 .flags = CLKDM_CAN_HWSUP_SWSUP, 559 .flags = CLKDM_CAN_HWSUP_SWSUP,
578 .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
579 .wkdep_srcs = gfx_sgx_wkdeps, 560 .wkdep_srcs = gfx_sgx_wkdeps,
580 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 561 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
581 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 562 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
@@ -590,7 +571,6 @@ static struct clockdomain core_l3_2430_clkdm = {
590 .name = "core_l3_clkdm", 571 .name = "core_l3_clkdm",
591 .pwrdm = { .name = "core_pwrdm" }, 572 .pwrdm = { .name = "core_pwrdm" },
592 .flags = CLKDM_CAN_HWSUP, 573 .flags = CLKDM_CAN_HWSUP,
593 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
594 .dep_bit = OMAP24XX_EN_CORE_SHIFT, 574 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
595 .wkdep_srcs = core_24xx_wkdeps, 575 .wkdep_srcs = core_24xx_wkdeps,
596 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 576 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
@@ -606,7 +586,6 @@ static struct clockdomain core_l4_2430_clkdm = {
606 .name = "core_l4_clkdm", 586 .name = "core_l4_clkdm",
607 .pwrdm = { .name = "core_pwrdm" }, 587 .pwrdm = { .name = "core_pwrdm" },
608 .flags = CLKDM_CAN_HWSUP, 588 .flags = CLKDM_CAN_HWSUP,
609 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
610 .dep_bit = OMAP24XX_EN_CORE_SHIFT, 589 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
611 .wkdep_srcs = core_24xx_wkdeps, 590 .wkdep_srcs = core_24xx_wkdeps,
612 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 591 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
@@ -617,7 +596,6 @@ static struct clockdomain dss_2430_clkdm = {
617 .name = "dss_clkdm", 596 .name = "dss_clkdm",
618 .pwrdm = { .name = "core_pwrdm" }, 597 .pwrdm = { .name = "core_pwrdm" },
619 .flags = CLKDM_CAN_HWSUP, 598 .flags = CLKDM_CAN_HWSUP,
620 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
621 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, 599 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
622 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 600 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
623}; 601};
@@ -635,7 +613,6 @@ static struct clockdomain mpu_3xxx_clkdm = {
635 .name = "mpu_clkdm", 613 .name = "mpu_clkdm",
636 .pwrdm = { .name = "mpu_pwrdm" }, 614 .pwrdm = { .name = "mpu_pwrdm" },
637 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, 615 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
638 .clkstctrl_reg = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
639 .dep_bit = OMAP3430_EN_MPU_SHIFT, 616 .dep_bit = OMAP3430_EN_MPU_SHIFT,
640 .wkdep_srcs = mpu_3xxx_wkdeps, 617 .wkdep_srcs = mpu_3xxx_wkdeps,
641 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, 618 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
@@ -646,8 +623,6 @@ static struct clockdomain neon_clkdm = {
646 .name = "neon_clkdm", 623 .name = "neon_clkdm",
647 .pwrdm = { .name = "neon_pwrdm" }, 624 .pwrdm = { .name = "neon_pwrdm" },
648 .flags = CLKDM_CAN_HWSUP_SWSUP, 625 .flags = CLKDM_CAN_HWSUP_SWSUP,
649 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD,
650 OMAP2_CM_CLKSTCTRL),
651 .wkdep_srcs = neon_wkdeps, 626 .wkdep_srcs = neon_wkdeps,
652 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, 627 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
653 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 628 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -657,8 +632,6 @@ static struct clockdomain iva2_clkdm = {
657 .name = "iva2_clkdm", 632 .name = "iva2_clkdm",
658 .pwrdm = { .name = "iva2_pwrdm" }, 633 .pwrdm = { .name = "iva2_pwrdm" },
659 .flags = CLKDM_CAN_HWSUP_SWSUP, 634 .flags = CLKDM_CAN_HWSUP_SWSUP,
660 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD,
661 OMAP2_CM_CLKSTCTRL),
662 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, 635 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
663 .wkdep_srcs = iva2_wkdeps, 636 .wkdep_srcs = iva2_wkdeps,
664 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 637 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
@@ -669,7 +642,6 @@ static struct clockdomain gfx_3430es1_clkdm = {
669 .name = "gfx_clkdm", 642 .name = "gfx_clkdm",
670 .pwrdm = { .name = "gfx_pwrdm" }, 643 .pwrdm = { .name = "gfx_pwrdm" },
671 .flags = CLKDM_CAN_HWSUP_SWSUP, 644 .flags = CLKDM_CAN_HWSUP_SWSUP,
672 .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
673 .wkdep_srcs = gfx_sgx_wkdeps, 645 .wkdep_srcs = gfx_sgx_wkdeps,
674 .sleepdep_srcs = gfx_sgx_sleepdeps, 646 .sleepdep_srcs = gfx_sgx_sleepdeps,
675 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, 647 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
@@ -680,8 +652,6 @@ static struct clockdomain sgx_clkdm = {
680 .name = "sgx_clkdm", 652 .name = "sgx_clkdm",
681 .pwrdm = { .name = "sgx_pwrdm" }, 653 .pwrdm = { .name = "sgx_pwrdm" },
682 .flags = CLKDM_CAN_HWSUP_SWSUP, 654 .flags = CLKDM_CAN_HWSUP_SWSUP,
683 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD,
684 OMAP2_CM_CLKSTCTRL),
685 .wkdep_srcs = gfx_sgx_wkdeps, 655 .wkdep_srcs = gfx_sgx_wkdeps,
686 .sleepdep_srcs = gfx_sgx_sleepdeps, 656 .sleepdep_srcs = gfx_sgx_sleepdeps,
687 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, 657 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
@@ -699,7 +669,6 @@ static struct clockdomain d2d_clkdm = {
699 .name = "d2d_clkdm", 669 .name = "d2d_clkdm",
700 .pwrdm = { .name = "core_pwrdm" }, 670 .pwrdm = { .name = "core_pwrdm" },
701 .flags = CLKDM_CAN_HWSUP_SWSUP, 671 .flags = CLKDM_CAN_HWSUP_SWSUP,
702 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
703 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, 672 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
704 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 673 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
705}; 674};
@@ -713,7 +682,6 @@ static struct clockdomain core_l3_3xxx_clkdm = {
713 .name = "core_l3_clkdm", 682 .name = "core_l3_clkdm",
714 .pwrdm = { .name = "core_pwrdm" }, 683 .pwrdm = { .name = "core_pwrdm" },
715 .flags = CLKDM_CAN_HWSUP, 684 .flags = CLKDM_CAN_HWSUP,
716 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
717 .dep_bit = OMAP3430_EN_CORE_SHIFT, 685 .dep_bit = OMAP3430_EN_CORE_SHIFT,
718 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, 686 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
719 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 687 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -728,7 +696,6 @@ static struct clockdomain core_l4_3xxx_clkdm = {
728 .name = "core_l4_clkdm", 696 .name = "core_l4_clkdm",
729 .pwrdm = { .name = "core_pwrdm" }, 697 .pwrdm = { .name = "core_pwrdm" },
730 .flags = CLKDM_CAN_HWSUP, 698 .flags = CLKDM_CAN_HWSUP,
731 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
732 .dep_bit = OMAP3430_EN_CORE_SHIFT, 699 .dep_bit = OMAP3430_EN_CORE_SHIFT,
733 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, 700 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
734 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 701 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -739,8 +706,6 @@ static struct clockdomain dss_3xxx_clkdm = {
739 .name = "dss_clkdm", 706 .name = "dss_clkdm",
740 .pwrdm = { .name = "dss_pwrdm" }, 707 .pwrdm = { .name = "dss_pwrdm" },
741 .flags = CLKDM_CAN_HWSUP_SWSUP, 708 .flags = CLKDM_CAN_HWSUP_SWSUP,
742 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD,
743 OMAP2_CM_CLKSTCTRL),
744 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, 709 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
745 .wkdep_srcs = dss_wkdeps, 710 .wkdep_srcs = dss_wkdeps,
746 .sleepdep_srcs = dss_sleepdeps, 711 .sleepdep_srcs = dss_sleepdeps,
@@ -752,8 +717,6 @@ static struct clockdomain cam_clkdm = {
752 .name = "cam_clkdm", 717 .name = "cam_clkdm",
753 .pwrdm = { .name = "cam_pwrdm" }, 718 .pwrdm = { .name = "cam_pwrdm" },
754 .flags = CLKDM_CAN_HWSUP_SWSUP, 719 .flags = CLKDM_CAN_HWSUP_SWSUP,
755 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD,
756 OMAP2_CM_CLKSTCTRL),
757 .wkdep_srcs = cam_wkdeps, 720 .wkdep_srcs = cam_wkdeps,
758 .sleepdep_srcs = cam_sleepdeps, 721 .sleepdep_srcs = cam_sleepdeps,
759 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, 722 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
@@ -764,8 +727,6 @@ static struct clockdomain usbhost_clkdm = {
764 .name = "usbhost_clkdm", 727 .name = "usbhost_clkdm",
765 .pwrdm = { .name = "usbhost_pwrdm" }, 728 .pwrdm = { .name = "usbhost_pwrdm" },
766 .flags = CLKDM_CAN_HWSUP_SWSUP, 729 .flags = CLKDM_CAN_HWSUP_SWSUP,
767 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD,
768 OMAP2_CM_CLKSTCTRL),
769 .wkdep_srcs = usbhost_wkdeps, 730 .wkdep_srcs = usbhost_wkdeps,
770 .sleepdep_srcs = usbhost_sleepdeps, 731 .sleepdep_srcs = usbhost_sleepdeps,
771 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, 732 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
@@ -776,8 +737,6 @@ static struct clockdomain per_clkdm = {
776 .name = "per_clkdm", 737 .name = "per_clkdm",
777 .pwrdm = { .name = "per_pwrdm" }, 738 .pwrdm = { .name = "per_pwrdm" },
778 .flags = CLKDM_CAN_HWSUP_SWSUP, 739 .flags = CLKDM_CAN_HWSUP_SWSUP,
779 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD,
780 OMAP2_CM_CLKSTCTRL),
781 .dep_bit = OMAP3430_EN_PER_SHIFT, 740 .dep_bit = OMAP3430_EN_PER_SHIFT,
782 .wkdep_srcs = per_wkdeps, 741 .wkdep_srcs = per_wkdeps,
783 .sleepdep_srcs = per_sleepdeps, 742 .sleepdep_srcs = per_sleepdeps,
@@ -793,8 +752,6 @@ static struct clockdomain emu_clkdm = {
793 .name = "emu_clkdm", 752 .name = "emu_clkdm",
794 .pwrdm = { .name = "emu_pwrdm" }, 753 .pwrdm = { .name = "emu_pwrdm" },
795 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, 754 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP,
796 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD,
797 OMAP2_CM_CLKSTCTRL),
798 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, 755 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
799 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 756 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
800}; 757};
@@ -831,8 +788,6 @@ static struct clockdomain dpll5_clkdm = {
831 788
832#endif /* CONFIG_ARCH_OMAP3 */ 789#endif /* CONFIG_ARCH_OMAP3 */
833 790
834#include "clockdomains44xx.h"
835
836/* 791/*
837 * Clockdomain hwsup dependencies (OMAP3 only) 792 * Clockdomain hwsup dependencies (OMAP3 only)
838 */ 793 */
@@ -851,17 +806,10 @@ static struct clkdm_autodep clkdm_autodeps[] = {
851 } 806 }
852}; 807};
853 808
854/* 809static struct clockdomain *clockdomains_omap2[] __initdata = {
855 * List of clockdomain pointers per platform
856 */
857
858static struct clockdomain *clockdomains_omap[] = {
859
860#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
861 &wkup_clkdm, 810 &wkup_clkdm,
862 &cm_clkdm, 811 &cm_clkdm,
863 &prm_clkdm, 812 &prm_clkdm,
864#endif
865 813
866#ifdef CONFIG_ARCH_OMAP2420 814#ifdef CONFIG_ARCH_OMAP2420
867 &mpu_2420_clkdm, 815 &mpu_2420_clkdm,
@@ -903,35 +851,10 @@ static struct clockdomain *clockdomains_omap[] = {
903 &dpll4_clkdm, 851 &dpll4_clkdm,
904 &dpll5_clkdm, 852 &dpll5_clkdm,
905#endif 853#endif
906
907#ifdef CONFIG_ARCH_OMAP4
908 &l4_cefuse_44xx_clkdm,
909 &l4_cfg_44xx_clkdm,
910 &tesla_44xx_clkdm,
911 &l3_gfx_44xx_clkdm,
912 &ivahd_44xx_clkdm,
913 &l4_secure_44xx_clkdm,
914 &l4_per_44xx_clkdm,
915 &abe_44xx_clkdm,
916 &l3_instr_44xx_clkdm,
917 &l3_init_44xx_clkdm,
918 &mpuss_44xx_clkdm,
919 &mpu0_44xx_clkdm,
920 &mpu1_44xx_clkdm,
921 &l3_emif_44xx_clkdm,
922 &l4_ao_44xx_clkdm,
923 &ducati_44xx_clkdm,
924 &l3_2_44xx_clkdm,
925 &l3_1_44xx_clkdm,
926 &l3_d2d_44xx_clkdm,
927 &iss_44xx_clkdm,
928 &l3_dss_44xx_clkdm,
929 &l4_wkup_44xx_clkdm,
930 &emu_sys_44xx_clkdm,
931 &l3_dma_44xx_clkdm,
932#endif
933
934 NULL, 854 NULL,
935}; 855};
936 856
937#endif 857void __init omap2_clockdomains_init(void)
858{
859 clkdm_init(clockdomains_omap2, clkdm_autodeps);
860}
diff --git a/arch/arm/mach-omap2/clockdomains44xx.h b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 7e5ba0f67925..51920fc7fc52 100644
--- a/arch/arm/mach-omap2/clockdomains44xx.h
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -23,18 +23,27 @@
23 * -> Populate the Sleep/Wakeup dependencies for the domains 23 * -> Populate the Sleep/Wakeup dependencies for the domains
24 */ 24 */
25 25
26#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H 26#include <linux/kernel.h>
27#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H 27#include <linux/io.h>
28 28
29#include <plat/clockdomain.h> 29#include "clockdomain.h"
30#include "cm1_44xx.h"
31#include "cm2_44xx.h"
32
33#include "cm1_44xx.h"
34#include "cm2_44xx.h"
35#include "cm-regbits-44xx.h"
36#include "prm44xx.h"
37#include "prcm44xx.h"
38#include "prcm_mpu44xx.h"
30 39
31#if defined(CONFIG_ARCH_OMAP4)
32 40
33static struct clockdomain l4_cefuse_44xx_clkdm = { 41static struct clockdomain l4_cefuse_44xx_clkdm = {
34 .name = "l4_cefuse_clkdm", 42 .name = "l4_cefuse_clkdm",
35 .pwrdm = { .name = "cefuse_pwrdm" }, 43 .pwrdm = { .name = "cefuse_pwrdm" },
36 .clkstctrl_reg = OMAP4430_CM_CEFUSE_CLKSTCTRL, 44 .prcm_partition = OMAP4430_CM2_PARTITION,
37 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 45 .cm_inst = OMAP4430_CM2_CEFUSE_INST,
46 .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS,
38 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 47 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 48 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
40}; 49};
@@ -42,8 +51,9 @@ static struct clockdomain l4_cefuse_44xx_clkdm = {
42static struct clockdomain l4_cfg_44xx_clkdm = { 51static struct clockdomain l4_cfg_44xx_clkdm = {
43 .name = "l4_cfg_clkdm", 52 .name = "l4_cfg_clkdm",
44 .pwrdm = { .name = "core_pwrdm" }, 53 .pwrdm = { .name = "core_pwrdm" },
45 .clkstctrl_reg = OMAP4430_CM_L4CFG_CLKSTCTRL, 54 .prcm_partition = OMAP4430_CM2_PARTITION,
46 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 55 .cm_inst = OMAP4430_CM2_CORE_INST,
56 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS,
47 .flags = CLKDM_CAN_HWSUP, 57 .flags = CLKDM_CAN_HWSUP,
48 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 58 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
49}; 59};
@@ -51,8 +61,9 @@ static struct clockdomain l4_cfg_44xx_clkdm = {
51static struct clockdomain tesla_44xx_clkdm = { 61static struct clockdomain tesla_44xx_clkdm = {
52 .name = "tesla_clkdm", 62 .name = "tesla_clkdm",
53 .pwrdm = { .name = "tesla_pwrdm" }, 63 .pwrdm = { .name = "tesla_pwrdm" },
54 .clkstctrl_reg = OMAP4430_CM_TESLA_CLKSTCTRL, 64 .prcm_partition = OMAP4430_CM1_PARTITION,
55 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 65 .cm_inst = OMAP4430_CM1_TESLA_INST,
66 .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS,
56 .flags = CLKDM_CAN_HWSUP_SWSUP, 67 .flags = CLKDM_CAN_HWSUP_SWSUP,
57 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 68 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
58}; 69};
@@ -60,8 +71,9 @@ static struct clockdomain tesla_44xx_clkdm = {
60static struct clockdomain l3_gfx_44xx_clkdm = { 71static struct clockdomain l3_gfx_44xx_clkdm = {
61 .name = "l3_gfx_clkdm", 72 .name = "l3_gfx_clkdm",
62 .pwrdm = { .name = "gfx_pwrdm" }, 73 .pwrdm = { .name = "gfx_pwrdm" },
63 .clkstctrl_reg = OMAP4430_CM_GFX_CLKSTCTRL, 74 .prcm_partition = OMAP4430_CM2_PARTITION,
64 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 75 .cm_inst = OMAP4430_CM2_GFX_INST,
76 .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS,
65 .flags = CLKDM_CAN_HWSUP_SWSUP, 77 .flags = CLKDM_CAN_HWSUP_SWSUP,
66 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
67}; 79};
@@ -69,8 +81,9 @@ static struct clockdomain l3_gfx_44xx_clkdm = {
69static struct clockdomain ivahd_44xx_clkdm = { 81static struct clockdomain ivahd_44xx_clkdm = {
70 .name = "ivahd_clkdm", 82 .name = "ivahd_clkdm",
71 .pwrdm = { .name = "ivahd_pwrdm" }, 83 .pwrdm = { .name = "ivahd_pwrdm" },
72 .clkstctrl_reg = OMAP4430_CM_IVAHD_CLKSTCTRL, 84 .prcm_partition = OMAP4430_CM2_PARTITION,
73 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 85 .cm_inst = OMAP4430_CM2_IVAHD_INST,
86 .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS,
74 .flags = CLKDM_CAN_HWSUP_SWSUP, 87 .flags = CLKDM_CAN_HWSUP_SWSUP,
75 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
76}; 89};
@@ -78,8 +91,9 @@ static struct clockdomain ivahd_44xx_clkdm = {
78static struct clockdomain l4_secure_44xx_clkdm = { 91static struct clockdomain l4_secure_44xx_clkdm = {
79 .name = "l4_secure_clkdm", 92 .name = "l4_secure_clkdm",
80 .pwrdm = { .name = "l4per_pwrdm" }, 93 .pwrdm = { .name = "l4per_pwrdm" },
81 .clkstctrl_reg = OMAP4430_CM_L4SEC_CLKSTCTRL, 94 .prcm_partition = OMAP4430_CM2_PARTITION,
82 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 95 .cm_inst = OMAP4430_CM2_L4PER_INST,
96 .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS,
83 .flags = CLKDM_CAN_HWSUP_SWSUP, 97 .flags = CLKDM_CAN_HWSUP_SWSUP,
84 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 98 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
85}; 99};
@@ -87,8 +101,9 @@ static struct clockdomain l4_secure_44xx_clkdm = {
87static struct clockdomain l4_per_44xx_clkdm = { 101static struct clockdomain l4_per_44xx_clkdm = {
88 .name = "l4_per_clkdm", 102 .name = "l4_per_clkdm",
89 .pwrdm = { .name = "l4per_pwrdm" }, 103 .pwrdm = { .name = "l4per_pwrdm" },
90 .clkstctrl_reg = OMAP4430_CM_L4PER_CLKSTCTRL, 104 .prcm_partition = OMAP4430_CM2_PARTITION,
91 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 105 .cm_inst = OMAP4430_CM2_L4PER_INST,
106 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS,
92 .flags = CLKDM_CAN_HWSUP_SWSUP, 107 .flags = CLKDM_CAN_HWSUP_SWSUP,
93 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 108 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
94}; 109};
@@ -96,8 +111,9 @@ static struct clockdomain l4_per_44xx_clkdm = {
96static struct clockdomain abe_44xx_clkdm = { 111static struct clockdomain abe_44xx_clkdm = {
97 .name = "abe_clkdm", 112 .name = "abe_clkdm",
98 .pwrdm = { .name = "abe_pwrdm" }, 113 .pwrdm = { .name = "abe_pwrdm" },
99 .clkstctrl_reg = OMAP4430_CM1_ABE_CLKSTCTRL, 114 .prcm_partition = OMAP4430_CM1_PARTITION,
100 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 115 .cm_inst = OMAP4430_CM1_ABE_INST,
116 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS,
101 .flags = CLKDM_CAN_HWSUP_SWSUP, 117 .flags = CLKDM_CAN_HWSUP_SWSUP,
102 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 118 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
103}; 119};
@@ -105,16 +121,18 @@ static struct clockdomain abe_44xx_clkdm = {
105static struct clockdomain l3_instr_44xx_clkdm = { 121static struct clockdomain l3_instr_44xx_clkdm = {
106 .name = "l3_instr_clkdm", 122 .name = "l3_instr_clkdm",
107 .pwrdm = { .name = "core_pwrdm" }, 123 .pwrdm = { .name = "core_pwrdm" },
108 .clkstctrl_reg = OMAP4430_CM_L3INSTR_CLKSTCTRL, 124 .prcm_partition = OMAP4430_CM2_PARTITION,
109 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 125 .cm_inst = OMAP4430_CM2_CORE_INST,
126 .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS,
110 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 127 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
111}; 128};
112 129
113static struct clockdomain l3_init_44xx_clkdm = { 130static struct clockdomain l3_init_44xx_clkdm = {
114 .name = "l3_init_clkdm", 131 .name = "l3_init_clkdm",
115 .pwrdm = { .name = "l3init_pwrdm" }, 132 .pwrdm = { .name = "l3init_pwrdm" },
116 .clkstctrl_reg = OMAP4430_CM_L3INIT_CLKSTCTRL, 133 .prcm_partition = OMAP4430_CM2_PARTITION,
117 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 134 .cm_inst = OMAP4430_CM2_L3INIT_INST,
135 .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS,
118 .flags = CLKDM_CAN_HWSUP_SWSUP, 136 .flags = CLKDM_CAN_HWSUP_SWSUP,
119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
120}; 138};
@@ -122,8 +140,9 @@ static struct clockdomain l3_init_44xx_clkdm = {
122static struct clockdomain mpuss_44xx_clkdm = { 140static struct clockdomain mpuss_44xx_clkdm = {
123 .name = "mpuss_clkdm", 141 .name = "mpuss_clkdm",
124 .pwrdm = { .name = "mpu_pwrdm" }, 142 .pwrdm = { .name = "mpu_pwrdm" },
125 .clkstctrl_reg = OMAP4430_CM_MPU_CLKSTCTRL, 143 .prcm_partition = OMAP4430_CM1_PARTITION,
126 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 144 .cm_inst = OMAP4430_CM1_MPU_INST,
145 .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS,
127 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 146 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 147 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
129}; 148};
@@ -131,8 +150,9 @@ static struct clockdomain mpuss_44xx_clkdm = {
131static struct clockdomain mpu0_44xx_clkdm = { 150static struct clockdomain mpu0_44xx_clkdm = {
132 .name = "mpu0_clkdm", 151 .name = "mpu0_clkdm",
133 .pwrdm = { .name = "cpu0_pwrdm" }, 152 .pwrdm = { .name = "cpu0_pwrdm" },
134 .clkstctrl_reg = OMAP4430_CM_CPU0_CLKSTCTRL, 153 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
135 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 154 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST,
155 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS,
136 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 156 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
138}; 158};
@@ -140,8 +160,9 @@ static struct clockdomain mpu0_44xx_clkdm = {
140static struct clockdomain mpu1_44xx_clkdm = { 160static struct clockdomain mpu1_44xx_clkdm = {
141 .name = "mpu1_clkdm", 161 .name = "mpu1_clkdm",
142 .pwrdm = { .name = "cpu1_pwrdm" }, 162 .pwrdm = { .name = "cpu1_pwrdm" },
143 .clkstctrl_reg = OMAP4430_CM_CPU1_CLKSTCTRL, 163 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
144 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 164 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST,
165 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS,
145 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 166 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
146 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 167 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
147}; 168};
@@ -149,8 +170,9 @@ static struct clockdomain mpu1_44xx_clkdm = {
149static struct clockdomain l3_emif_44xx_clkdm = { 170static struct clockdomain l3_emif_44xx_clkdm = {
150 .name = "l3_emif_clkdm", 171 .name = "l3_emif_clkdm",
151 .pwrdm = { .name = "core_pwrdm" }, 172 .pwrdm = { .name = "core_pwrdm" },
152 .clkstctrl_reg = OMAP4430_CM_MEMIF_CLKSTCTRL, 173 .prcm_partition = OMAP4430_CM2_PARTITION,
153 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 174 .cm_inst = OMAP4430_CM2_CORE_INST,
175 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS,
154 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 176 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
155 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 177 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
156}; 178};
@@ -158,8 +180,9 @@ static struct clockdomain l3_emif_44xx_clkdm = {
158static struct clockdomain l4_ao_44xx_clkdm = { 180static struct clockdomain l4_ao_44xx_clkdm = {
159 .name = "l4_ao_clkdm", 181 .name = "l4_ao_clkdm",
160 .pwrdm = { .name = "always_on_core_pwrdm" }, 182 .pwrdm = { .name = "always_on_core_pwrdm" },
161 .clkstctrl_reg = OMAP4430_CM_ALWON_CLKSTCTRL, 183 .prcm_partition = OMAP4430_CM2_PARTITION,
162 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 184 .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST,
185 .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS,
163 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 186 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 187 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
165}; 188};
@@ -167,8 +190,9 @@ static struct clockdomain l4_ao_44xx_clkdm = {
167static struct clockdomain ducati_44xx_clkdm = { 190static struct clockdomain ducati_44xx_clkdm = {
168 .name = "ducati_clkdm", 191 .name = "ducati_clkdm",
169 .pwrdm = { .name = "core_pwrdm" }, 192 .pwrdm = { .name = "core_pwrdm" },
170 .clkstctrl_reg = OMAP4430_CM_DUCATI_CLKSTCTRL, 193 .prcm_partition = OMAP4430_CM2_PARTITION,
171 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 194 .cm_inst = OMAP4430_CM2_CORE_INST,
195 .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS,
172 .flags = CLKDM_CAN_HWSUP_SWSUP, 196 .flags = CLKDM_CAN_HWSUP_SWSUP,
173 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 197 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
174}; 198};
@@ -176,8 +200,9 @@ static struct clockdomain ducati_44xx_clkdm = {
176static struct clockdomain l3_2_44xx_clkdm = { 200static struct clockdomain l3_2_44xx_clkdm = {
177 .name = "l3_2_clkdm", 201 .name = "l3_2_clkdm",
178 .pwrdm = { .name = "core_pwrdm" }, 202 .pwrdm = { .name = "core_pwrdm" },
179 .clkstctrl_reg = OMAP4430_CM_L3_2_CLKSTCTRL, 203 .prcm_partition = OMAP4430_CM2_PARTITION,
180 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 204 .cm_inst = OMAP4430_CM2_CORE_INST,
205 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS,
181 .flags = CLKDM_CAN_HWSUP, 206 .flags = CLKDM_CAN_HWSUP,
182 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
183}; 208};
@@ -185,8 +210,9 @@ static struct clockdomain l3_2_44xx_clkdm = {
185static struct clockdomain l3_1_44xx_clkdm = { 210static struct clockdomain l3_1_44xx_clkdm = {
186 .name = "l3_1_clkdm", 211 .name = "l3_1_clkdm",
187 .pwrdm = { .name = "core_pwrdm" }, 212 .pwrdm = { .name = "core_pwrdm" },
188 .clkstctrl_reg = OMAP4430_CM_L3_1_CLKSTCTRL, 213 .prcm_partition = OMAP4430_CM2_PARTITION,
189 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 214 .cm_inst = OMAP4430_CM2_CORE_INST,
215 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS,
190 .flags = CLKDM_CAN_HWSUP, 216 .flags = CLKDM_CAN_HWSUP,
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 217 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
192}; 218};
@@ -194,8 +220,9 @@ static struct clockdomain l3_1_44xx_clkdm = {
194static struct clockdomain l3_d2d_44xx_clkdm = { 220static struct clockdomain l3_d2d_44xx_clkdm = {
195 .name = "l3_d2d_clkdm", 221 .name = "l3_d2d_clkdm",
196 .pwrdm = { .name = "core_pwrdm" }, 222 .pwrdm = { .name = "core_pwrdm" },
197 .clkstctrl_reg = OMAP4430_CM_D2D_CLKSTCTRL, 223 .prcm_partition = OMAP4430_CM2_PARTITION,
198 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 224 .cm_inst = OMAP4430_CM2_CORE_INST,
225 .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS,
199 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 226 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
201}; 228};
@@ -203,8 +230,9 @@ static struct clockdomain l3_d2d_44xx_clkdm = {
203static struct clockdomain iss_44xx_clkdm = { 230static struct clockdomain iss_44xx_clkdm = {
204 .name = "iss_clkdm", 231 .name = "iss_clkdm",
205 .pwrdm = { .name = "cam_pwrdm" }, 232 .pwrdm = { .name = "cam_pwrdm" },
206 .clkstctrl_reg = OMAP4430_CM_CAM_CLKSTCTRL, 233 .prcm_partition = OMAP4430_CM2_PARTITION,
207 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 234 .cm_inst = OMAP4430_CM2_CAM_INST,
235 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS,
208 .flags = CLKDM_CAN_HWSUP_SWSUP, 236 .flags = CLKDM_CAN_HWSUP_SWSUP,
209 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 237 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
210}; 238};
@@ -212,8 +240,9 @@ static struct clockdomain iss_44xx_clkdm = {
212static struct clockdomain l3_dss_44xx_clkdm = { 240static struct clockdomain l3_dss_44xx_clkdm = {
213 .name = "l3_dss_clkdm", 241 .name = "l3_dss_clkdm",
214 .pwrdm = { .name = "dss_pwrdm" }, 242 .pwrdm = { .name = "dss_pwrdm" },
215 .clkstctrl_reg = OMAP4430_CM_DSS_CLKSTCTRL, 243 .prcm_partition = OMAP4430_CM2_PARTITION,
216 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 244 .cm_inst = OMAP4430_CM2_DSS_INST,
245 .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS,
217 .flags = CLKDM_CAN_HWSUP_SWSUP, 246 .flags = CLKDM_CAN_HWSUP_SWSUP,
218 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 247 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
219}; 248};
@@ -221,8 +250,9 @@ static struct clockdomain l3_dss_44xx_clkdm = {
221static struct clockdomain l4_wkup_44xx_clkdm = { 250static struct clockdomain l4_wkup_44xx_clkdm = {
222 .name = "l4_wkup_clkdm", 251 .name = "l4_wkup_clkdm",
223 .pwrdm = { .name = "wkup_pwrdm" }, 252 .pwrdm = { .name = "wkup_pwrdm" },
224 .clkstctrl_reg = OMAP4430_CM_WKUP_CLKSTCTRL, 253 .prcm_partition = OMAP4430_PRM_PARTITION,
225 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 254 .cm_inst = OMAP4430_PRM_WKUP_CM_INST,
255 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS,
226 .flags = CLKDM_CAN_HWSUP, 256 .flags = CLKDM_CAN_HWSUP,
227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 257 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
228}; 258};
@@ -230,8 +260,9 @@ static struct clockdomain l4_wkup_44xx_clkdm = {
230static struct clockdomain emu_sys_44xx_clkdm = { 260static struct clockdomain emu_sys_44xx_clkdm = {
231 .name = "emu_sys_clkdm", 261 .name = "emu_sys_clkdm",
232 .pwrdm = { .name = "emu_pwrdm" }, 262 .pwrdm = { .name = "emu_pwrdm" },
233 .clkstctrl_reg = OMAP4430_CM_EMU_CLKSTCTRL, 263 .prcm_partition = OMAP4430_PRM_PARTITION,
234 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 264 .cm_inst = OMAP4430_PRM_EMU_CM_INST,
265 .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS,
235 .flags = CLKDM_CAN_HWSUP, 266 .flags = CLKDM_CAN_HWSUP,
236 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 267 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
237}; 268};
@@ -239,12 +270,42 @@ static struct clockdomain emu_sys_44xx_clkdm = {
239static struct clockdomain l3_dma_44xx_clkdm = { 270static struct clockdomain l3_dma_44xx_clkdm = {
240 .name = "l3_dma_clkdm", 271 .name = "l3_dma_clkdm",
241 .pwrdm = { .name = "core_pwrdm" }, 272 .pwrdm = { .name = "core_pwrdm" },
242 .clkstctrl_reg = OMAP4430_CM_SDMA_CLKSTCTRL, 273 .prcm_partition = OMAP4430_CM2_PARTITION,
243 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 274 .cm_inst = OMAP4430_CM2_CORE_INST,
275 .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS,
244 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 276 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
245 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 277 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
246}; 278};
247 279
248#endif 280static struct clockdomain *clockdomains_omap44xx[] __initdata = {
281 &l4_cefuse_44xx_clkdm,
282 &l4_cfg_44xx_clkdm,
283 &tesla_44xx_clkdm,
284 &l3_gfx_44xx_clkdm,
285 &ivahd_44xx_clkdm,
286 &l4_secure_44xx_clkdm,
287 &l4_per_44xx_clkdm,
288 &abe_44xx_clkdm,
289 &l3_instr_44xx_clkdm,
290 &l3_init_44xx_clkdm,
291 &mpuss_44xx_clkdm,
292 &mpu0_44xx_clkdm,
293 &mpu1_44xx_clkdm,
294 &l3_emif_44xx_clkdm,
295 &l4_ao_44xx_clkdm,
296 &ducati_44xx_clkdm,
297 &l3_2_44xx_clkdm,
298 &l3_1_44xx_clkdm,
299 &l3_d2d_44xx_clkdm,
300 &iss_44xx_clkdm,
301 &l3_dss_44xx_clkdm,
302 &l4_wkup_44xx_clkdm,
303 &emu_sys_44xx_clkdm,
304 &l3_dma_44xx_clkdm,
305 NULL,
306};
249 307
250#endif 308void __init omap44xx_clockdomains_init(void)
309{
310 clkdm_init(clockdomains_omap44xx, NULL);
311}
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
index da51cc3ed7eb..d70660e82fe6 100644
--- a/arch/arm/mach-omap2/cm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-24xx.h
@@ -14,8 +14,6 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "cm.h"
18
19/* Bits shared between registers */ 17/* Bits shared between registers */
20 18
21/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */ 19/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
@@ -126,8 +124,12 @@
126#define OMAP24XX_ST_HDQ_MASK (1 << 23) 124#define OMAP24XX_ST_HDQ_MASK (1 << 23)
127#define OMAP2420_ST_I2C2_SHIFT 20 125#define OMAP2420_ST_I2C2_SHIFT 20
128#define OMAP2420_ST_I2C2_MASK (1 << 20) 126#define OMAP2420_ST_I2C2_MASK (1 << 20)
127#define OMAP2430_ST_I2CHS1_SHIFT 19
128#define OMAP2430_ST_I2CHS1_MASK (1 << 19)
129#define OMAP2420_ST_I2C1_SHIFT 19 129#define OMAP2420_ST_I2C1_SHIFT 19
130#define OMAP2420_ST_I2C1_MASK (1 << 19) 130#define OMAP2420_ST_I2C1_MASK (1 << 19)
131#define OMAP2430_ST_I2CHS2_SHIFT 20
132#define OMAP2430_ST_I2CHS2_MASK (1 << 20)
131#define OMAP24XX_ST_MCBSP2_SHIFT 16 133#define OMAP24XX_ST_MCBSP2_SHIFT 16
132#define OMAP24XX_ST_MCBSP2_MASK (1 << 16) 134#define OMAP24XX_ST_MCBSP2_MASK (1 << 16)
133#define OMAP24XX_ST_MCBSP1_SHIFT 15 135#define OMAP24XX_ST_MCBSP1_SHIFT 15
@@ -432,4 +434,9 @@
432#define OMAP2430_AUTOSTATE_MDM_SHIFT 0 434#define OMAP2430_AUTOSTATE_MDM_SHIFT 0
433#define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0) 435#define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0)
434 436
437/* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */
438#define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0
439#define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1
440
441
435#endif 442#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 4f959a7d881c..b91275908f33 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -14,8 +14,6 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "cm.h"
18
19/* Bits shared between registers */ 17/* Bits shared between registers */
20 18
21/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */ 19/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
@@ -800,4 +798,15 @@
800#define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0 798#define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0
801#define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0) 799#define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0)
802 800
801/*
802 *
803 */
804
805/* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */
806#define OMAP34XX_CLKSTCTRL_DISABLE_AUTO 0x0
807#define OMAP34XX_CLKSTCTRL_FORCE_SLEEP 0x1
808#define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2
809#define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3
810
811
803#endif 812#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-44xx.h b/arch/arm/mach-omap2/cm-regbits-44xx.h
index 0b72be433776..9d47a05b17b4 100644
--- a/arch/arm/mach-omap2/cm-regbits-44xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-44xx.h
@@ -22,9 +22,6 @@
22#ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H 22#ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
23#define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H 23#define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
24 24
25#include "cm.h"
26
27
28/* 25/*
29 * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP, 26 * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP,
30 * CM_TESLA_DYNAMICDEP 27 * CM_TESLA_DYNAMICDEP
diff --git a/arch/arm/mach-omap2/cm.c b/arch/arm/mach-omap2/cm.c
deleted file mode 100644
index 721c3b66740a..000000000000
--- a/arch/arm/mach-omap2/cm.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * OMAP2/3 CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
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/module.h>
14#include <linux/types.h>
15#include <linux/delay.h>
16#include <linux/spinlock.h>
17#include <linux/list.h>
18#include <linux/errno.h>
19#include <linux/err.h>
20#include <linux/io.h>
21
22#include <asm/atomic.h>
23
24#include <plat/common.h>
25
26#include "cm.h"
27#include "cm-regbits-24xx.h"
28#include "cm-regbits-34xx.h"
29
30static const u8 cm_idlest_offs[] = {
31 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
32};
33
34/**
35 * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
36 * @prcm_mod: PRCM module offset
37 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
38 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
39 *
40 * XXX document
41 */
42int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
43{
44 int ena = 0, i = 0;
45 u8 cm_idlest_reg;
46 u32 mask;
47
48 if (!idlest_id || (idlest_id > ARRAY_SIZE(cm_idlest_offs)))
49 return -EINVAL;
50
51 cm_idlest_reg = cm_idlest_offs[idlest_id - 1];
52
53 mask = 1 << idlest_shift;
54
55 if (cpu_is_omap24xx())
56 ena = mask;
57 else if (cpu_is_omap34xx())
58 ena = 0;
59 else
60 BUG();
61
62 /* XXX should be OMAP2 CM */
63 omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
64 MAX_MODULE_READY_TIME, i);
65
66 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
67}
68
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index a02ca30423dc..a7bc096bd407 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -1,8 +1,5 @@
1#ifndef __ARCH_ASM_MACH_OMAP2_CM_H
2#define __ARCH_ASM_MACH_OMAP2_CM_H
3
4/* 1/*
5 * OMAP2/3 Clock Management (CM) register definitions 2 * OMAP2+ Clock Management prototypes
6 * 3 *
7 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
8 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
@@ -13,136 +10,8 @@
13 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
15 */ 12 */
16 13#ifndef __ARCH_ASM_MACH_OMAP2_CM_H
17#include "prcm-common.h" 14#define __ARCH_ASM_MACH_OMAP2_CM_H
18
19#define OMAP2420_CM_REGADDR(module, reg) \
20 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
21#define OMAP2430_CM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
23#define OMAP34XX_CM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
25#define OMAP44XX_CM1_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (module) + (reg))
27#define OMAP44XX_CM2_REGADDR(module, reg) \
28 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (module) + (reg))
29
30#include "cm44xx.h"
31
32/*
33 * Architecture-specific global CM registers
34 * Use cm_{read,write}_reg() with these registers.
35 * These registers appear once per CM module.
36 */
37
38#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
39#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
40#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
41
42#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
43#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
44
45/*
46 * Module specific CM registers from CM_BASE + domain offset
47 * Use cm_{read,write}_mod_reg() with these registers.
48 * These register offsets generally appear in more than one PRCM submodule.
49 */
50
51/* Common between 24xx and 34xx */
52
53#define CM_FCLKEN 0x0000
54#define CM_FCLKEN1 CM_FCLKEN
55#define CM_CLKEN CM_FCLKEN
56#define CM_ICLKEN 0x0010
57#define CM_ICLKEN1 CM_ICLKEN
58#define CM_ICLKEN2 0x0014
59#define CM_ICLKEN3 0x0018
60#define CM_IDLEST 0x0020
61#define CM_IDLEST1 CM_IDLEST
62#define CM_IDLEST2 0x0024
63#define CM_AUTOIDLE 0x0030
64#define CM_AUTOIDLE1 CM_AUTOIDLE
65#define CM_AUTOIDLE2 0x0034
66#define CM_AUTOIDLE3 0x0038
67#define CM_CLKSEL 0x0040
68#define CM_CLKSEL1 CM_CLKSEL
69#define CM_CLKSEL2 0x0044
70#define OMAP2_CM_CLKSTCTRL 0x0048
71#define OMAP4_CM_CLKSTCTRL 0x0000
72
73
74/* Architecture-specific registers */
75
76#define OMAP24XX_CM_FCLKEN2 0x0004
77#define OMAP24XX_CM_ICLKEN4 0x001c
78#define OMAP24XX_CM_AUTOIDLE4 0x003c
79
80#define OMAP2430_CM_IDLEST3 0x0028
81
82#define OMAP3430_CM_CLKEN_PLL 0x0004
83#define OMAP3430ES2_CM_CLKEN2 0x0004
84#define OMAP3430ES2_CM_FCLKEN3 0x0008
85#define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
86#define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
87#define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
88#define OMAP3430_CM_CLKSEL1 CM_CLKSEL
89#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
90#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
91#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
92#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
93#define OMAP3430_CM_CLKSTST 0x004c
94#define OMAP3430ES2_CM_CLKSEL4 0x004c
95#define OMAP3430ES2_CM_CLKSEL5 0x0050
96#define OMAP3430_CM_CLKSEL2_EMU 0x0050
97#define OMAP3430_CM_CLKSEL3_EMU 0x0054
98
99/* CM2.CEFUSE_CM2 register offsets */
100
101/* OMAP4 modulemode control */
102#define OMAP4430_MODULEMODE_HWCTRL 0
103#define OMAP4430_MODULEMODE_SWCTRL 1
104
105/* Clock management domain register get/set */
106
107#ifndef __ASSEMBLER__
108
109extern u32 cm_read_mod_reg(s16 module, u16 idx);
110extern void cm_write_mod_reg(u32 val, s16 module, u16 idx);
111extern u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
112
113extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
114 u8 idlest_shift);
115extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
116
117static inline u32 cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
118{
119 return cm_rmw_mod_reg_bits(bits, bits, module, idx);
120}
121
122static inline u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
123{
124 return cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
125}
126
127#endif
128
129/* CM register bits shared between 24XX and 3430 */
130
131/* CM_CLKSEL_GFX */
132#define OMAP_CLKSEL_GFX_SHIFT 0
133#define OMAP_CLKSEL_GFX_MASK (0x7 << 0)
134
135/* CM_ICLKEN_GFX */
136#define OMAP_EN_GFX_SHIFT 0
137#define OMAP_EN_GFX_MASK (1 << 0)
138
139/* CM_IDLEST_GFX */
140#define OMAP_ST_GFX_MASK (1 << 0)
141
142
143/* CM_IDLEST indicator */
144#define OMAP24XX_CM_IDLEST_VAL 0
145#define OMAP34XX_CM_IDLEST_VAL 1
146 15
147/* 16/*
148 * MAX_MODULE_READY_TIME: max duration in microseconds to wait for the 17 * MAX_MODULE_READY_TIME: max duration in microseconds to wait for the
diff --git a/arch/arm/mach-omap2/cm1_44xx.h b/arch/arm/mach-omap2/cm1_44xx.h
new file mode 100644
index 000000000000..e2d7a56b2ad6
--- /dev/null
+++ b/arch/arm/mach-omap2/cm1_44xx.h
@@ -0,0 +1,261 @@
1/*
2 * OMAP44xx CM1 instance offset macros
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
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 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2_CM1_44XX_H
26#define __ARCH_ARM_MACH_OMAP2_CM1_44XX_H
27
28/* CM1 base address */
29#define OMAP4430_CM1_BASE 0x4a004000
30
31#define OMAP44XX_CM1_REGADDR(inst, reg) \
32 OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (inst) + (reg))
33
34/* CM1 instances */
35#define OMAP4430_CM1_OCP_SOCKET_INST 0x0000
36#define OMAP4430_CM1_CKGEN_INST 0x0100
37#define OMAP4430_CM1_MPU_INST 0x0300
38#define OMAP4430_CM1_TESLA_INST 0x0400
39#define OMAP4430_CM1_ABE_INST 0x0500
40#define OMAP4430_CM1_RESTORE_INST 0x0e00
41#define OMAP4430_CM1_INSTR_INST 0x0f00
42
43/* CM1 clockdomain register offsets (from instance start) */
44#define OMAP4430_CM1_ABE_ABE_CDOFFS 0x0000
45#define OMAP4430_CM1_MPU_MPU_CDOFFS 0x0000
46#define OMAP4430_CM1_TESLA_TESLA_CDOFFS 0x0000
47
48/* CM1 */
49
50/* CM1.OCP_SOCKET_CM1 register offsets */
51#define OMAP4_REVISION_CM1_OFFSET 0x0000
52#define OMAP4430_REVISION_CM1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_INST, 0x0000)
53#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET 0x0040
54#define OMAP4430_CM_CM1_PROFILING_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_INST, 0x0040)
55
56/* CM1.CKGEN_CM1 register offsets */
57#define OMAP4_CM_CLKSEL_CORE_OFFSET 0x0000
58#define OMAP4430_CM_CLKSEL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0000)
59#define OMAP4_CM_CLKSEL_ABE_OFFSET 0x0008
60#define OMAP4430_CM_CLKSEL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0008)
61#define OMAP4_CM_DLL_CTRL_OFFSET 0x0010
62#define OMAP4430_CM_DLL_CTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0010)
63#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET 0x0020
64#define OMAP4430_CM_CLKMODE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0020)
65#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET 0x0024
66#define OMAP4430_CM_IDLEST_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0024)
67#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET 0x0028
68#define OMAP4430_CM_AUTOIDLE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0028)
69#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET 0x002c
70#define OMAP4430_CM_CLKSEL_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x002c)
71#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET 0x0030
72#define OMAP4430_CM_DIV_M2_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0030)
73#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET 0x0034
74#define OMAP4430_CM_DIV_M3_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0034)
75#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET 0x0038
76#define OMAP4430_CM_DIV_M4_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0038)
77#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET 0x003c
78#define OMAP4430_CM_DIV_M5_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x003c)
79#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET 0x0040
80#define OMAP4430_CM_DIV_M6_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0040)
81#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET 0x0044
82#define OMAP4430_CM_DIV_M7_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0044)
83#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET 0x0048
84#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0048)
85#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_CORE_OFFSET 0x004c
86#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x004c)
87#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET 0x0050
88#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0050)
89#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET 0x0060
90#define OMAP4430_CM_CLKMODE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0060)
91#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET 0x0064
92#define OMAP4430_CM_IDLEST_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0064)
93#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET 0x0068
94#define OMAP4430_CM_AUTOIDLE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0068)
95#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET 0x006c
96#define OMAP4430_CM_CLKSEL_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x006c)
97#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET 0x0070
98#define OMAP4430_CM_DIV_M2_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0070)
99#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET 0x0088
100#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0088)
101#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_MPU_OFFSET 0x008c
102#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x008c)
103#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET 0x009c
104#define OMAP4430_CM_BYPCLK_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x009c)
105#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET 0x00a0
106#define OMAP4430_CM_CLKMODE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a0)
107#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET 0x00a4
108#define OMAP4430_CM_IDLEST_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a4)
109#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET 0x00a8
110#define OMAP4430_CM_AUTOIDLE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a8)
111#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET 0x00ac
112#define OMAP4430_CM_CLKSEL_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00ac)
113#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET 0x00b8
114#define OMAP4430_CM_DIV_M4_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00b8)
115#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET 0x00bc
116#define OMAP4430_CM_DIV_M5_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00bc)
117#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET 0x00c8
118#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00c8)
119#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_IVA_OFFSET 0x00cc
120#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00cc)
121#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET 0x00dc
122#define OMAP4430_CM_BYPCLK_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00dc)
123#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET 0x00e0
124#define OMAP4430_CM_CLKMODE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e0)
125#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET 0x00e4
126#define OMAP4430_CM_IDLEST_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e4)
127#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET 0x00e8
128#define OMAP4430_CM_AUTOIDLE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e8)
129#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET 0x00ec
130#define OMAP4430_CM_CLKSEL_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00ec)
131#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET 0x00f0
132#define OMAP4430_CM_DIV_M2_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00f0)
133#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET 0x00f4
134#define OMAP4430_CM_DIV_M3_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00f4)
135#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET 0x0108
136#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0108)
137#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_ABE_OFFSET 0x010c
138#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x010c)
139#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET 0x0120
140#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0120)
141#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET 0x0124
142#define OMAP4430_CM_IDLEST_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0124)
143#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET 0x0128
144#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0128)
145#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET 0x012c
146#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x012c)
147#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET 0x0130
148#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0130)
149#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET 0x0138
150#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0138)
151#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET 0x013c
152#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x013c)
153#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET 0x0140
154#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0140)
155#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET 0x0148
156#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0148)
157#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_DDRPHY_OFFSET 0x014c
158#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x014c)
159#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET 0x0160
160#define OMAP4430_CM_SHADOW_FREQ_CONFIG1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0160)
161#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET 0x0164
162#define OMAP4430_CM_SHADOW_FREQ_CONFIG2 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0164)
163#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET 0x0170
164#define OMAP4430_CM_DYN_DEP_PRESCAL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0170)
165#define OMAP4_CM_RESTORE_ST_OFFSET 0x0180
166#define OMAP4430_CM_RESTORE_ST OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0180)
167
168/* CM1.MPU_CM1 register offsets */
169#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET 0x0000
170#define OMAP4430_CM_MPU_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0000)
171#define OMAP4_CM_MPU_STATICDEP_OFFSET 0x0004
172#define OMAP4430_CM_MPU_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0004)
173#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET 0x0008
174#define OMAP4430_CM_MPU_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0008)
175#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET 0x0020
176#define OMAP4430_CM_MPU_MPU_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0020)
177
178/* CM1.TESLA_CM1 register offsets */
179#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET 0x0000
180#define OMAP4430_CM_TESLA_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0000)
181#define OMAP4_CM_TESLA_STATICDEP_OFFSET 0x0004
182#define OMAP4430_CM_TESLA_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0004)
183#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET 0x0008
184#define OMAP4430_CM_TESLA_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0008)
185#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET 0x0020
186#define OMAP4430_CM_TESLA_TESLA_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0020)
187
188/* CM1.ABE_CM1 register offsets */
189#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET 0x0000
190#define OMAP4430_CM1_ABE_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0000)
191#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET 0x0020
192#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0020)
193#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET 0x0028
194#define OMAP4430_CM1_ABE_AESS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0028)
195#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET 0x0030
196#define OMAP4430_CM1_ABE_PDM_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0030)
197#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET 0x0038
198#define OMAP4430_CM1_ABE_DMIC_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0038)
199#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET 0x0040
200#define OMAP4430_CM1_ABE_MCASP_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0040)
201#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET 0x0048
202#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0048)
203#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET 0x0050
204#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0050)
205#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET 0x0058
206#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0058)
207#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET 0x0060
208#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0060)
209#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET 0x0068
210#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0068)
211#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET 0x0070
212#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0070)
213#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET 0x0078
214#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0078)
215#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET 0x0080
216#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0080)
217#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET 0x0088
218#define OMAP4430_CM1_ABE_WDT3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0088)
219
220/* CM1.RESTORE_CM1 register offsets */
221#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET 0x0000
222#define OMAP4430_CM_CLKSEL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0000)
223#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET 0x0004
224#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0004)
225#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET 0x0008
226#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0008)
227#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET 0x000c
228#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x000c)
229#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET 0x0010
230#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0010)
231#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET 0x0014
232#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0014)
233#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET 0x0018
234#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0018)
235#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET 0x001c
236#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x001c)
237#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET 0x0020
238#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0020)
239#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_CORE_RESTORE_OFFSET 0x0024
240#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0024)
241#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET 0x0028
242#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0028)
243#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET 0x002c
244#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x002c)
245#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET 0x0030
246#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0030)
247#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET 0x0034
248#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0034)
249#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET 0x0038
250#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0038)
251#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET 0x003c
252#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x003c)
253#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET 0x0040
254#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0040)
255
256/* Function prototypes */
257extern u32 omap4_cm1_read_inst_reg(s16 inst, u16 idx);
258extern void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 idx);
259extern u32 omap4_cm1_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
260
261#endif
diff --git a/arch/arm/mach-omap2/cm2_44xx.h b/arch/arm/mach-omap2/cm2_44xx.h
new file mode 100644
index 000000000000..aa4745044065
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2_44xx.h
@@ -0,0 +1,508 @@
1/*
2 * OMAP44xx CM2 instance offset macros
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
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 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2_CM2_44XX_H
26#define __ARCH_ARM_MACH_OMAP2_CM2_44XX_H
27
28/* CM2 base address */
29#define OMAP4430_CM2_BASE 0x4a008000
30
31#define OMAP44XX_CM2_REGADDR(inst, reg) \
32 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (inst) + (reg))
33
34/* CM2 instances */
35#define OMAP4430_CM2_OCP_SOCKET_INST 0x0000
36#define OMAP4430_CM2_CKGEN_INST 0x0100
37#define OMAP4430_CM2_ALWAYS_ON_INST 0x0600
38#define OMAP4430_CM2_CORE_INST 0x0700
39#define OMAP4430_CM2_IVAHD_INST 0x0f00
40#define OMAP4430_CM2_CAM_INST 0x1000
41#define OMAP4430_CM2_DSS_INST 0x1100
42#define OMAP4430_CM2_GFX_INST 0x1200
43#define OMAP4430_CM2_L3INIT_INST 0x1300
44#define OMAP4430_CM2_L4PER_INST 0x1400
45#define OMAP4430_CM2_CEFUSE_INST 0x1600
46#define OMAP4430_CM2_RESTORE_INST 0x1e00
47#define OMAP4430_CM2_INSTR_INST 0x1f00
48
49/* CM2 clockdomain register offsets (from instance start) */
50#define OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS 0x0000
51#define OMAP4430_CM2_CORE_L3_1_CDOFFS 0x0000
52#define OMAP4430_CM2_CORE_L3_2_CDOFFS 0x0100
53#define OMAP4430_CM2_CORE_DUCATI_CDOFFS 0x0200
54#define OMAP4430_CM2_CORE_SDMA_CDOFFS 0x0300
55#define OMAP4430_CM2_CORE_MEMIF_CDOFFS 0x0400
56#define OMAP4430_CM2_CORE_D2D_CDOFFS 0x0500
57#define OMAP4430_CM2_CORE_L4CFG_CDOFFS 0x0600
58#define OMAP4430_CM2_CORE_L3INSTR_CDOFFS 0x0700
59#define OMAP4430_CM2_IVAHD_IVAHD_CDOFFS 0x0000
60#define OMAP4430_CM2_CAM_CAM_CDOFFS 0x0000
61#define OMAP4430_CM2_DSS_DSS_CDOFFS 0x0000
62#define OMAP4430_CM2_GFX_GFX_CDOFFS 0x0000
63#define OMAP4430_CM2_L3INIT_L3INIT_CDOFFS 0x0000
64#define OMAP4430_CM2_L4PER_L4PER_CDOFFS 0x0000
65#define OMAP4430_CM2_L4PER_L4SEC_CDOFFS 0x0180
66#define OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS 0x0000
67
68
69/* CM2 */
70
71/* CM2.OCP_SOCKET_CM2 register offsets */
72#define OMAP4_REVISION_CM2_OFFSET 0x0000
73#define OMAP4430_REVISION_CM2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_INST, 0x0000)
74#define OMAP4_CM_CM2_PROFILING_CLKCTRL_OFFSET 0x0040
75#define OMAP4430_CM_CM2_PROFILING_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_INST, 0x0040)
76
77/* CM2.CKGEN_CM2 register offsets */
78#define OMAP4_CM_CLKSEL_DUCATI_ISS_ROOT_OFFSET 0x0000
79#define OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0000)
80#define OMAP4_CM_CLKSEL_USB_60MHZ_OFFSET 0x0004
81#define OMAP4430_CM_CLKSEL_USB_60MHZ OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0004)
82#define OMAP4_CM_SCALE_FCLK_OFFSET 0x0008
83#define OMAP4430_CM_SCALE_FCLK OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0008)
84#define OMAP4_CM_CORE_DVFS_PERF1_OFFSET 0x0010
85#define OMAP4430_CM_CORE_DVFS_PERF1 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0010)
86#define OMAP4_CM_CORE_DVFS_PERF2_OFFSET 0x0014
87#define OMAP4430_CM_CORE_DVFS_PERF2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0014)
88#define OMAP4_CM_CORE_DVFS_PERF3_OFFSET 0x0018
89#define OMAP4430_CM_CORE_DVFS_PERF3 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0018)
90#define OMAP4_CM_CORE_DVFS_PERF4_OFFSET 0x001c
91#define OMAP4430_CM_CORE_DVFS_PERF4 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x001c)
92#define OMAP4_CM_CORE_DVFS_CURRENT_OFFSET 0x0024
93#define OMAP4430_CM_CORE_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0024)
94#define OMAP4_CM_IVA_DVFS_PERF_TESLA_OFFSET 0x0028
95#define OMAP4430_CM_IVA_DVFS_PERF_TESLA OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0028)
96#define OMAP4_CM_IVA_DVFS_PERF_IVAHD_OFFSET 0x002c
97#define OMAP4430_CM_IVA_DVFS_PERF_IVAHD OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x002c)
98#define OMAP4_CM_IVA_DVFS_PERF_ABE_OFFSET 0x0030
99#define OMAP4430_CM_IVA_DVFS_PERF_ABE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0030)
100#define OMAP4_CM_IVA_DVFS_CURRENT_OFFSET 0x0038
101#define OMAP4430_CM_IVA_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0038)
102#define OMAP4_CM_CLKMODE_DPLL_PER_OFFSET 0x0040
103#define OMAP4430_CM_CLKMODE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0040)
104#define OMAP4_CM_IDLEST_DPLL_PER_OFFSET 0x0044
105#define OMAP4430_CM_IDLEST_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0044)
106#define OMAP4_CM_AUTOIDLE_DPLL_PER_OFFSET 0x0048
107#define OMAP4430_CM_AUTOIDLE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0048)
108#define OMAP4_CM_CLKSEL_DPLL_PER_OFFSET 0x004c
109#define OMAP4430_CM_CLKSEL_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x004c)
110#define OMAP4_CM_DIV_M2_DPLL_PER_OFFSET 0x0050
111#define OMAP4430_CM_DIV_M2_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0050)
112#define OMAP4_CM_DIV_M3_DPLL_PER_OFFSET 0x0054
113#define OMAP4430_CM_DIV_M3_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0054)
114#define OMAP4_CM_DIV_M4_DPLL_PER_OFFSET 0x0058
115#define OMAP4430_CM_DIV_M4_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0058)
116#define OMAP4_CM_DIV_M5_DPLL_PER_OFFSET 0x005c
117#define OMAP4430_CM_DIV_M5_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x005c)
118#define OMAP4_CM_DIV_M6_DPLL_PER_OFFSET 0x0060
119#define OMAP4430_CM_DIV_M6_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0060)
120#define OMAP4_CM_DIV_M7_DPLL_PER_OFFSET 0x0064
121#define OMAP4430_CM_DIV_M7_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0064)
122#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_PER_OFFSET 0x0068
123#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0068)
124#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_PER_OFFSET 0x006c
125#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x006c)
126#define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET 0x0080
127#define OMAP4430_CM_CLKMODE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0080)
128#define OMAP4_CM_IDLEST_DPLL_USB_OFFSET 0x0084
129#define OMAP4430_CM_IDLEST_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0084)
130#define OMAP4_CM_AUTOIDLE_DPLL_USB_OFFSET 0x0088
131#define OMAP4430_CM_AUTOIDLE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0088)
132#define OMAP4_CM_CLKSEL_DPLL_USB_OFFSET 0x008c
133#define OMAP4430_CM_CLKSEL_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x008c)
134#define OMAP4_CM_DIV_M2_DPLL_USB_OFFSET 0x0090
135#define OMAP4430_CM_DIV_M2_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0090)
136#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_USB_OFFSET 0x00a8
137#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00a8)
138#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_USB_OFFSET 0x00ac
139#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00ac)
140#define OMAP4_CM_CLKDCOLDO_DPLL_USB_OFFSET 0x00b4
141#define OMAP4430_CM_CLKDCOLDO_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00b4)
142#define OMAP4_CM_CLKMODE_DPLL_UNIPRO_OFFSET 0x00c0
143#define OMAP4430_CM_CLKMODE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00c0)
144#define OMAP4_CM_IDLEST_DPLL_UNIPRO_OFFSET 0x00c4
145#define OMAP4430_CM_IDLEST_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00c4)
146#define OMAP4_CM_AUTOIDLE_DPLL_UNIPRO_OFFSET 0x00c8
147#define OMAP4430_CM_AUTOIDLE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00c8)
148#define OMAP4_CM_CLKSEL_DPLL_UNIPRO_OFFSET 0x00cc
149#define OMAP4430_CM_CLKSEL_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00cc)
150#define OMAP4_CM_DIV_M2_DPLL_UNIPRO_OFFSET 0x00d0
151#define OMAP4430_CM_DIV_M2_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00d0)
152#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_UNIPRO_OFFSET 0x00e8
153#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00e8)
154#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_UNIPRO_OFFSET 0x00ec
155#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00ec)
156
157/* CM2.ALWAYS_ON_CM2 register offsets */
158#define OMAP4_CM_ALWON_CLKSTCTRL_OFFSET 0x0000
159#define OMAP4430_CM_ALWON_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0000)
160#define OMAP4_CM_ALWON_MDMINTC_CLKCTRL_OFFSET 0x0020
161#define OMAP4430_CM_ALWON_MDMINTC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0020)
162#define OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET 0x0028
163#define OMAP4430_CM_ALWON_SR_MPU_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0028)
164#define OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET 0x0030
165#define OMAP4430_CM_ALWON_SR_IVA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0030)
166#define OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET 0x0038
167#define OMAP4430_CM_ALWON_SR_CORE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0038)
168#define OMAP4_CM_ALWON_USBPHY_CLKCTRL_OFFSET 0x0040
169#define OMAP4430_CM_ALWON_USBPHY_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0040)
170
171/* CM2.CORE_CM2 register offsets */
172#define OMAP4_CM_L3_1_CLKSTCTRL_OFFSET 0x0000
173#define OMAP4430_CM_L3_1_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0000)
174#define OMAP4_CM_L3_1_DYNAMICDEP_OFFSET 0x0008
175#define OMAP4430_CM_L3_1_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0008)
176#define OMAP4_CM_L3_1_L3_1_CLKCTRL_OFFSET 0x0020
177#define OMAP4430_CM_L3_1_L3_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0020)
178#define OMAP4_CM_L3_2_CLKSTCTRL_OFFSET 0x0100
179#define OMAP4430_CM_L3_2_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0100)
180#define OMAP4_CM_L3_2_DYNAMICDEP_OFFSET 0x0108
181#define OMAP4430_CM_L3_2_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0108)
182#define OMAP4_CM_L3_2_L3_2_CLKCTRL_OFFSET 0x0120
183#define OMAP4430_CM_L3_2_L3_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0120)
184#define OMAP4_CM_L3_2_GPMC_CLKCTRL_OFFSET 0x0128
185#define OMAP4430_CM_L3_2_GPMC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0128)
186#define OMAP4_CM_L3_2_OCMC_RAM_CLKCTRL_OFFSET 0x0130
187#define OMAP4430_CM_L3_2_OCMC_RAM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0130)
188#define OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET 0x0200
189#define OMAP4430_CM_DUCATI_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0200)
190#define OMAP4_CM_DUCATI_STATICDEP_OFFSET 0x0204
191#define OMAP4430_CM_DUCATI_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0204)
192#define OMAP4_CM_DUCATI_DYNAMICDEP_OFFSET 0x0208
193#define OMAP4430_CM_DUCATI_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0208)
194#define OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET 0x0220
195#define OMAP4430_CM_DUCATI_DUCATI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0220)
196#define OMAP4_CM_SDMA_CLKSTCTRL_OFFSET 0x0300
197#define OMAP4430_CM_SDMA_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0300)
198#define OMAP4_CM_SDMA_STATICDEP_OFFSET 0x0304
199#define OMAP4430_CM_SDMA_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0304)
200#define OMAP4_CM_SDMA_DYNAMICDEP_OFFSET 0x0308
201#define OMAP4430_CM_SDMA_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0308)
202#define OMAP4_CM_SDMA_SDMA_CLKCTRL_OFFSET 0x0320
203#define OMAP4430_CM_SDMA_SDMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0320)
204#define OMAP4_CM_MEMIF_CLKSTCTRL_OFFSET 0x0400
205#define OMAP4430_CM_MEMIF_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0400)
206#define OMAP4_CM_MEMIF_DMM_CLKCTRL_OFFSET 0x0420
207#define OMAP4430_CM_MEMIF_DMM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0420)
208#define OMAP4_CM_MEMIF_EMIF_FW_CLKCTRL_OFFSET 0x0428
209#define OMAP4430_CM_MEMIF_EMIF_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0428)
210#define OMAP4_CM_MEMIF_EMIF_1_CLKCTRL_OFFSET 0x0430
211#define OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0430)
212#define OMAP4_CM_MEMIF_EMIF_2_CLKCTRL_OFFSET 0x0438
213#define OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0438)
214#define OMAP4_CM_MEMIF_DLL_CLKCTRL_OFFSET 0x0440
215#define OMAP4430_CM_MEMIF_DLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0440)
216#define OMAP4_CM_MEMIF_EMIF_H1_CLKCTRL_OFFSET 0x0450
217#define OMAP4430_CM_MEMIF_EMIF_H1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0450)
218#define OMAP4_CM_MEMIF_EMIF_H2_CLKCTRL_OFFSET 0x0458
219#define OMAP4430_CM_MEMIF_EMIF_H2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0458)
220#define OMAP4_CM_MEMIF_DLL_H_CLKCTRL_OFFSET 0x0460
221#define OMAP4430_CM_MEMIF_DLL_H_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0460)
222#define OMAP4_CM_D2D_CLKSTCTRL_OFFSET 0x0500
223#define OMAP4430_CM_D2D_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0500)
224#define OMAP4_CM_D2D_STATICDEP_OFFSET 0x0504
225#define OMAP4430_CM_D2D_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0504)
226#define OMAP4_CM_D2D_DYNAMICDEP_OFFSET 0x0508
227#define OMAP4430_CM_D2D_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0508)
228#define OMAP4_CM_D2D_SAD2D_CLKCTRL_OFFSET 0x0520
229#define OMAP4430_CM_D2D_SAD2D_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0520)
230#define OMAP4_CM_D2D_INSTEM_ICR_CLKCTRL_OFFSET 0x0528
231#define OMAP4430_CM_D2D_INSTEM_ICR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0528)
232#define OMAP4_CM_D2D_SAD2D_FW_CLKCTRL_OFFSET 0x0530
233#define OMAP4430_CM_D2D_SAD2D_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0530)
234#define OMAP4_CM_L4CFG_CLKSTCTRL_OFFSET 0x0600
235#define OMAP4430_CM_L4CFG_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0600)
236#define OMAP4_CM_L4CFG_DYNAMICDEP_OFFSET 0x0608
237#define OMAP4430_CM_L4CFG_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0608)
238#define OMAP4_CM_L4CFG_L4_CFG_CLKCTRL_OFFSET 0x0620
239#define OMAP4430_CM_L4CFG_L4_CFG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0620)
240#define OMAP4_CM_L4CFG_HW_SEM_CLKCTRL_OFFSET 0x0628
241#define OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0628)
242#define OMAP4_CM_L4CFG_MAILBOX_CLKCTRL_OFFSET 0x0630
243#define OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0630)
244#define OMAP4_CM_L4CFG_SAR_ROM_CLKCTRL_OFFSET 0x0638
245#define OMAP4430_CM_L4CFG_SAR_ROM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0638)
246#define OMAP4_CM_L3INSTR_CLKSTCTRL_OFFSET 0x0700
247#define OMAP4430_CM_L3INSTR_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0700)
248#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_OFFSET 0x0720
249#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0720)
250#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_OFFSET 0x0728
251#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0728)
252#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_OFFSET 0x0740
253#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0740)
254
255/* CM2.IVAHD_CM2 register offsets */
256#define OMAP4_CM_IVAHD_CLKSTCTRL_OFFSET 0x0000
257#define OMAP4430_CM_IVAHD_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0000)
258#define OMAP4_CM_IVAHD_STATICDEP_OFFSET 0x0004
259#define OMAP4430_CM_IVAHD_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0004)
260#define OMAP4_CM_IVAHD_DYNAMICDEP_OFFSET 0x0008
261#define OMAP4430_CM_IVAHD_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0008)
262#define OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET 0x0020
263#define OMAP4430_CM_IVAHD_IVAHD_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0020)
264#define OMAP4_CM_IVAHD_SL2_CLKCTRL_OFFSET 0x0028
265#define OMAP4430_CM_IVAHD_SL2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0028)
266
267/* CM2.CAM_CM2 register offsets */
268#define OMAP4_CM_CAM_CLKSTCTRL_OFFSET 0x0000
269#define OMAP4430_CM_CAM_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0000)
270#define OMAP4_CM_CAM_STATICDEP_OFFSET 0x0004
271#define OMAP4430_CM_CAM_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0004)
272#define OMAP4_CM_CAM_DYNAMICDEP_OFFSET 0x0008
273#define OMAP4430_CM_CAM_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0008)
274#define OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET 0x0020
275#define OMAP4430_CM_CAM_ISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0020)
276#define OMAP4_CM_CAM_FDIF_CLKCTRL_OFFSET 0x0028
277#define OMAP4430_CM_CAM_FDIF_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0028)
278
279/* CM2.DSS_CM2 register offsets */
280#define OMAP4_CM_DSS_CLKSTCTRL_OFFSET 0x0000
281#define OMAP4430_CM_DSS_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0000)
282#define OMAP4_CM_DSS_STATICDEP_OFFSET 0x0004
283#define OMAP4430_CM_DSS_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0004)
284#define OMAP4_CM_DSS_DYNAMICDEP_OFFSET 0x0008
285#define OMAP4430_CM_DSS_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0008)
286#define OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET 0x0020
287#define OMAP4430_CM_DSS_DSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0020)
288#define OMAP4_CM_DSS_DEISS_CLKCTRL_OFFSET 0x0028
289#define OMAP4430_CM_DSS_DEISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0028)
290
291/* CM2.GFX_CM2 register offsets */
292#define OMAP4_CM_GFX_CLKSTCTRL_OFFSET 0x0000
293#define OMAP4430_CM_GFX_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0000)
294#define OMAP4_CM_GFX_STATICDEP_OFFSET 0x0004
295#define OMAP4430_CM_GFX_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0004)
296#define OMAP4_CM_GFX_DYNAMICDEP_OFFSET 0x0008
297#define OMAP4430_CM_GFX_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0008)
298#define OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET 0x0020
299#define OMAP4430_CM_GFX_GFX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0020)
300
301/* CM2.L3INIT_CM2 register offsets */
302#define OMAP4_CM_L3INIT_CLKSTCTRL_OFFSET 0x0000
303#define OMAP4430_CM_L3INIT_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0000)
304#define OMAP4_CM_L3INIT_STATICDEP_OFFSET 0x0004
305#define OMAP4430_CM_L3INIT_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0004)
306#define OMAP4_CM_L3INIT_DYNAMICDEP_OFFSET 0x0008
307#define OMAP4430_CM_L3INIT_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0008)
308#define OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET 0x0028
309#define OMAP4430_CM_L3INIT_MMC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0028)
310#define OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET 0x0030
311#define OMAP4430_CM_L3INIT_MMC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0030)
312#define OMAP4_CM_L3INIT_HSI_CLKCTRL_OFFSET 0x0038
313#define OMAP4430_CM_L3INIT_HSI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0038)
314#define OMAP4_CM_L3INIT_UNIPRO1_CLKCTRL_OFFSET 0x0040
315#define OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0040)
316#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET 0x0058
317#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0058)
318#define OMAP4_CM_L3INIT_USB_OTG_CLKCTRL_OFFSET 0x0060
319#define OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0060)
320#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET 0x0068
321#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0068)
322#define OMAP4_CM_L3INIT_P1500_CLKCTRL_OFFSET 0x0078
323#define OMAP4430_CM_L3INIT_P1500_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0078)
324#define OMAP4_CM_L3INIT_EMAC_CLKCTRL_OFFSET 0x0080
325#define OMAP4430_CM_L3INIT_EMAC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0080)
326#define OMAP4_CM_L3INIT_SATA_CLKCTRL_OFFSET 0x0088
327#define OMAP4430_CM_L3INIT_SATA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0088)
328#define OMAP4_CM_L3INIT_TPPSS_CLKCTRL_OFFSET 0x0090
329#define OMAP4430_CM_L3INIT_TPPSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0090)
330#define OMAP4_CM_L3INIT_PCIESS_CLKCTRL_OFFSET 0x0098
331#define OMAP4430_CM_L3INIT_PCIESS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0098)
332#define OMAP4_CM_L3INIT_CCPTX_CLKCTRL_OFFSET 0x00a8
333#define OMAP4430_CM_L3INIT_CCPTX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00a8)
334#define OMAP4_CM_L3INIT_XHPI_CLKCTRL_OFFSET 0x00c0
335#define OMAP4430_CM_L3INIT_XHPI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00c0)
336#define OMAP4_CM_L3INIT_MMC6_CLKCTRL_OFFSET 0x00c8
337#define OMAP4430_CM_L3INIT_MMC6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00c8)
338#define OMAP4_CM_L3INIT_USB_HOST_FS_CLKCTRL_OFFSET 0x00d0
339#define OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00d0)
340#define OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET 0x00e0
341#define OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00e0)
342
343/* CM2.L4PER_CM2 register offsets */
344#define OMAP4_CM_L4PER_CLKSTCTRL_OFFSET 0x0000
345#define OMAP4430_CM_L4PER_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0000)
346#define OMAP4_CM_L4PER_DYNAMICDEP_OFFSET 0x0008
347#define OMAP4430_CM_L4PER_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0008)
348#define OMAP4_CM_L4PER_ADC_CLKCTRL_OFFSET 0x0020
349#define OMAP4430_CM_L4PER_ADC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0020)
350#define OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET 0x0028
351#define OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0028)
352#define OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET 0x0030
353#define OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0030)
354#define OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET 0x0038
355#define OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0038)
356#define OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET 0x0040
357#define OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0040)
358#define OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET 0x0048
359#define OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0048)
360#define OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET 0x0050
361#define OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0050)
362#define OMAP4_CM_L4PER_ELM_CLKCTRL_OFFSET 0x0058
363#define OMAP4430_CM_L4PER_ELM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0058)
364#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET 0x0060
365#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0060)
366#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET 0x0068
367#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0068)
368#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET 0x0070
369#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0070)
370#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET 0x0078
371#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0078)
372#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET 0x0080
373#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0080)
374#define OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET 0x0088
375#define OMAP4430_CM_L4PER_HDQ1W_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0088)
376#define OMAP4_CM_L4PER_HECC1_CLKCTRL_OFFSET 0x0090
377#define OMAP4430_CM_L4PER_HECC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0090)
378#define OMAP4_CM_L4PER_HECC2_CLKCTRL_OFFSET 0x0098
379#define OMAP4430_CM_L4PER_HECC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0098)
380#define OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET 0x00a0
381#define OMAP4430_CM_L4PER_I2C1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00a0)
382#define OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET 0x00a8
383#define OMAP4430_CM_L4PER_I2C2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00a8)
384#define OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET 0x00b0
385#define OMAP4430_CM_L4PER_I2C3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00b0)
386#define OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET 0x00b8
387#define OMAP4430_CM_L4PER_I2C4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00b8)
388#define OMAP4_CM_L4PER_L4PER_CLKCTRL_OFFSET 0x00c0
389#define OMAP4430_CM_L4PER_L4PER_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00c0)
390#define OMAP4_CM_L4PER_MCASP2_CLKCTRL_OFFSET 0x00d0
391#define OMAP4430_CM_L4PER_MCASP2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00d0)
392#define OMAP4_CM_L4PER_MCASP3_CLKCTRL_OFFSET 0x00d8
393#define OMAP4430_CM_L4PER_MCASP3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00d8)
394#define OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET 0x00e0
395#define OMAP4430_CM_L4PER_MCBSP4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00e0)
396#define OMAP4_CM_L4PER_MGATE_CLKCTRL_OFFSET 0x00e8
397#define OMAP4430_CM_L4PER_MGATE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00e8)
398#define OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET 0x00f0
399#define OMAP4430_CM_L4PER_MCSPI1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00f0)
400#define OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET 0x00f8
401#define OMAP4430_CM_L4PER_MCSPI2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00f8)
402#define OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET 0x0100
403#define OMAP4430_CM_L4PER_MCSPI3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0100)
404#define OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET 0x0108
405#define OMAP4430_CM_L4PER_MCSPI4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0108)
406#define OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET 0x0120
407#define OMAP4430_CM_L4PER_MMCSD3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0120)
408#define OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET 0x0128
409#define OMAP4430_CM_L4PER_MMCSD4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0128)
410#define OMAP4_CM_L4PER_MSPROHG_CLKCTRL_OFFSET 0x0130
411#define OMAP4430_CM_L4PER_MSPROHG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0130)
412#define OMAP4_CM_L4PER_SLIMBUS2_CLKCTRL_OFFSET 0x0138
413#define OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0138)
414#define OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET 0x0140
415#define OMAP4430_CM_L4PER_UART1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0140)
416#define OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET 0x0148
417#define OMAP4430_CM_L4PER_UART2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0148)
418#define OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET 0x0150
419#define OMAP4430_CM_L4PER_UART3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0150)
420#define OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET 0x0158
421#define OMAP4430_CM_L4PER_UART4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0158)
422#define OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET 0x0160
423#define OMAP4430_CM_L4PER_MMCSD5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0160)
424#define OMAP4_CM_L4PER_I2C5_CLKCTRL_OFFSET 0x0168
425#define OMAP4430_CM_L4PER_I2C5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0168)
426#define OMAP4_CM_L4SEC_CLKSTCTRL_OFFSET 0x0180
427#define OMAP4430_CM_L4SEC_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0180)
428#define OMAP4_CM_L4SEC_STATICDEP_OFFSET 0x0184
429#define OMAP4430_CM_L4SEC_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0184)
430#define OMAP4_CM_L4SEC_DYNAMICDEP_OFFSET 0x0188
431#define OMAP4430_CM_L4SEC_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0188)
432#define OMAP4_CM_L4SEC_AES1_CLKCTRL_OFFSET 0x01a0
433#define OMAP4430_CM_L4SEC_AES1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01a0)
434#define OMAP4_CM_L4SEC_AES2_CLKCTRL_OFFSET 0x01a8
435#define OMAP4430_CM_L4SEC_AES2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01a8)
436#define OMAP4_CM_L4SEC_DES3DES_CLKCTRL_OFFSET 0x01b0
437#define OMAP4430_CM_L4SEC_DES3DES_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01b0)
438#define OMAP4_CM_L4SEC_PKAEIP29_CLKCTRL_OFFSET 0x01b8
439#define OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01b8)
440#define OMAP4_CM_L4SEC_RNG_CLKCTRL_OFFSET 0x01c0
441#define OMAP4430_CM_L4SEC_RNG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01c0)
442#define OMAP4_CM_L4SEC_SHA2MD51_CLKCTRL_OFFSET 0x01c8
443#define OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01c8)
444#define OMAP4_CM_L4SEC_CRYPTODMA_CLKCTRL_OFFSET 0x01d8
445#define OMAP4430_CM_L4SEC_CRYPTODMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01d8)
446
447/* CM2.CEFUSE_CM2 register offsets */
448#define OMAP4_CM_CEFUSE_CLKSTCTRL_OFFSET 0x0000
449#define OMAP4430_CM_CEFUSE_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_INST, 0x0000)
450#define OMAP4_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET 0x0020
451#define OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_INST, 0x0020)
452
453/* CM2.RESTORE_CM2 register offsets */
454#define OMAP4_CM_L3_1_CLKSTCTRL_RESTORE_OFFSET 0x0000
455#define OMAP4430_CM_L3_1_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0000)
456#define OMAP4_CM_L3_2_CLKSTCTRL_RESTORE_OFFSET 0x0004
457#define OMAP4430_CM_L3_2_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0004)
458#define OMAP4_CM_L4CFG_CLKSTCTRL_RESTORE_OFFSET 0x0008
459#define OMAP4430_CM_L4CFG_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0008)
460#define OMAP4_CM_MEMIF_CLKSTCTRL_RESTORE_OFFSET 0x000c
461#define OMAP4430_CM_MEMIF_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x000c)
462#define OMAP4_CM_L4PER_CLKSTCTRL_RESTORE_OFFSET 0x0010
463#define OMAP4430_CM_L4PER_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0010)
464#define OMAP4_CM_L3INIT_CLKSTCTRL_RESTORE_OFFSET 0x0014
465#define OMAP4430_CM_L3INIT_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0014)
466#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_RESTORE_OFFSET 0x0018
467#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0018)
468#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE_OFFSET 0x001c
469#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x001c)
470#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE_OFFSET 0x0020
471#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0020)
472#define OMAP4_CM_CM2_PROFILING_CLKCTRL_RESTORE_OFFSET 0x0024
473#define OMAP4430_CM_CM2_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0024)
474#define OMAP4_CM_D2D_STATICDEP_RESTORE_OFFSET 0x0028
475#define OMAP4430_CM_D2D_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0028)
476#define OMAP4_CM_L3_1_DYNAMICDEP_RESTORE_OFFSET 0x002c
477#define OMAP4430_CM_L3_1_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x002c)
478#define OMAP4_CM_L3_2_DYNAMICDEP_RESTORE_OFFSET 0x0030
479#define OMAP4430_CM_L3_2_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0030)
480#define OMAP4_CM_D2D_DYNAMICDEP_RESTORE_OFFSET 0x0034
481#define OMAP4430_CM_D2D_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0034)
482#define OMAP4_CM_L4CFG_DYNAMICDEP_RESTORE_OFFSET 0x0038
483#define OMAP4430_CM_L4CFG_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0038)
484#define OMAP4_CM_L4PER_DYNAMICDEP_RESTORE_OFFSET 0x003c
485#define OMAP4430_CM_L4PER_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x003c)
486#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_RESTORE_OFFSET 0x0040
487#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0040)
488#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_RESTORE_OFFSET 0x0044
489#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0044)
490#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_RESTORE_OFFSET 0x0048
491#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0048)
492#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_RESTORE_OFFSET 0x004c
493#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x004c)
494#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_RESTORE_OFFSET 0x0050
495#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0050)
496#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE_OFFSET 0x0054
497#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0054)
498#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE_OFFSET 0x0058
499#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0058)
500#define OMAP4_CM_SDMA_STATICDEP_RESTORE_OFFSET 0x005c
501#define OMAP4430_CM_SDMA_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x005c)
502
503/* Function prototypes */
504extern u32 omap4_cm2_read_inst_reg(s16 inst, u16 idx);
505extern void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 idx);
506extern u32 omap4_cm2_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
507
508#endif
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
new file mode 100644
index 000000000000..96954aa48671
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -0,0 +1,471 @@
1/*
2 * OMAP2/3 CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/delay.h>
15#include <linux/spinlock.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/io.h>
20
21#include <plat/common.h>
22
23#include "cm.h"
24#include "cm2xxx_3xxx.h"
25#include "cm-regbits-24xx.h"
26#include "cm-regbits-34xx.h"
27
28static const u8 cm_idlest_offs[] = {
29 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
30};
31
32u32 omap2_cm_read_mod_reg(s16 module, u16 idx)
33{
34 return __raw_readl(cm_base + module + idx);
35}
36
37void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx)
38{
39 __raw_writel(val, cm_base + module + idx);
40}
41
42/* Read-modify-write a register in a CM module. Caller must lock */
43u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
44{
45 u32 v;
46
47 v = omap2_cm_read_mod_reg(module, idx);
48 v &= ~mask;
49 v |= bits;
50 omap2_cm_write_mod_reg(v, module, idx);
51
52 return v;
53}
54
55u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
56{
57 return omap2_cm_rmw_mod_reg_bits(bits, bits, module, idx);
58}
59
60u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
61{
62 return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
63}
64
65/*
66 *
67 */
68
69static void _write_clktrctrl(u8 c, s16 module, u32 mask)
70{
71 u32 v;
72
73 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
74 v &= ~mask;
75 v |= c << __ffs(mask);
76 omap2_cm_write_mod_reg(v, module, OMAP2_CM_CLKSTCTRL);
77}
78
79bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask)
80{
81 u32 v;
82 bool ret = 0;
83
84 BUG_ON(!cpu_is_omap24xx() && !cpu_is_omap34xx());
85
86 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
87 v &= mask;
88 v >>= __ffs(mask);
89
90 if (cpu_is_omap24xx())
91 ret = (v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
92 else
93 ret = (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
94
95 return ret;
96}
97
98void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
99{
100 _write_clktrctrl(OMAP24XX_CLKSTCTRL_ENABLE_AUTO, module, mask);
101}
102
103void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask)
104{
105 _write_clktrctrl(OMAP24XX_CLKSTCTRL_DISABLE_AUTO, module, mask);
106}
107
108void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
109{
110 _write_clktrctrl(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, module, mask);
111}
112
113void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask)
114{
115 _write_clktrctrl(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, module, mask);
116}
117
118void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask)
119{
120 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, module, mask);
121}
122
123void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask)
124{
125 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask);
126}
127
128
129/*
130 *
131 */
132
133/**
134 * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
135 * @prcm_mod: PRCM module offset
136 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
137 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
138 *
139 * XXX document
140 */
141int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
142{
143 int ena = 0, i = 0;
144 u8 cm_idlest_reg;
145 u32 mask;
146
147 if (!idlest_id || (idlest_id > ARRAY_SIZE(cm_idlest_offs)))
148 return -EINVAL;
149
150 cm_idlest_reg = cm_idlest_offs[idlest_id - 1];
151
152 mask = 1 << idlest_shift;
153
154 if (cpu_is_omap24xx())
155 ena = mask;
156 else if (cpu_is_omap34xx())
157 ena = 0;
158 else
159 BUG();
160
161 omap_test_timeout(((omap2_cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
162 MAX_MODULE_READY_TIME, i);
163
164 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
165}
166
167/*
168 * Context save/restore code - OMAP3 only
169 */
170#ifdef CONFIG_ARCH_OMAP3
171struct omap3_cm_regs {
172 u32 iva2_cm_clksel1;
173 u32 iva2_cm_clksel2;
174 u32 cm_sysconfig;
175 u32 sgx_cm_clksel;
176 u32 dss_cm_clksel;
177 u32 cam_cm_clksel;
178 u32 per_cm_clksel;
179 u32 emu_cm_clksel;
180 u32 emu_cm_clkstctrl;
181 u32 pll_cm_autoidle2;
182 u32 pll_cm_clksel4;
183 u32 pll_cm_clksel5;
184 u32 pll_cm_clken2;
185 u32 cm_polctrl;
186 u32 iva2_cm_fclken;
187 u32 iva2_cm_clken_pll;
188 u32 core_cm_fclken1;
189 u32 core_cm_fclken3;
190 u32 sgx_cm_fclken;
191 u32 wkup_cm_fclken;
192 u32 dss_cm_fclken;
193 u32 cam_cm_fclken;
194 u32 per_cm_fclken;
195 u32 usbhost_cm_fclken;
196 u32 core_cm_iclken1;
197 u32 core_cm_iclken2;
198 u32 core_cm_iclken3;
199 u32 sgx_cm_iclken;
200 u32 wkup_cm_iclken;
201 u32 dss_cm_iclken;
202 u32 cam_cm_iclken;
203 u32 per_cm_iclken;
204 u32 usbhost_cm_iclken;
205 u32 iva2_cm_autoidle2;
206 u32 mpu_cm_autoidle2;
207 u32 iva2_cm_clkstctrl;
208 u32 mpu_cm_clkstctrl;
209 u32 core_cm_clkstctrl;
210 u32 sgx_cm_clkstctrl;
211 u32 dss_cm_clkstctrl;
212 u32 cam_cm_clkstctrl;
213 u32 per_cm_clkstctrl;
214 u32 neon_cm_clkstctrl;
215 u32 usbhost_cm_clkstctrl;
216 u32 core_cm_autoidle1;
217 u32 core_cm_autoidle2;
218 u32 core_cm_autoidle3;
219 u32 wkup_cm_autoidle;
220 u32 dss_cm_autoidle;
221 u32 cam_cm_autoidle;
222 u32 per_cm_autoidle;
223 u32 usbhost_cm_autoidle;
224 u32 sgx_cm_sleepdep;
225 u32 dss_cm_sleepdep;
226 u32 cam_cm_sleepdep;
227 u32 per_cm_sleepdep;
228 u32 usbhost_cm_sleepdep;
229 u32 cm_clkout_ctrl;
230};
231
232static struct omap3_cm_regs cm_context;
233
234void omap3_cm_save_context(void)
235{
236 cm_context.iva2_cm_clksel1 =
237 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
238 cm_context.iva2_cm_clksel2 =
239 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL2);
240 cm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
241 cm_context.sgx_cm_clksel =
242 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
243 cm_context.dss_cm_clksel =
244 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
245 cm_context.cam_cm_clksel =
246 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSEL);
247 cm_context.per_cm_clksel =
248 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSEL);
249 cm_context.emu_cm_clksel =
250 omap2_cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
251 cm_context.emu_cm_clkstctrl =
252 omap2_cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
253 cm_context.pll_cm_autoidle2 =
254 omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
255 cm_context.pll_cm_clksel4 =
256 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
257 cm_context.pll_cm_clksel5 =
258 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
259 cm_context.pll_cm_clken2 =
260 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
261 cm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
262 cm_context.iva2_cm_fclken =
263 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_FCLKEN);
264 cm_context.iva2_cm_clken_pll =
265 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL);
266 cm_context.core_cm_fclken1 =
267 omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
268 cm_context.core_cm_fclken3 =
269 omap2_cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
270 cm_context.sgx_cm_fclken =
271 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_FCLKEN);
272 cm_context.wkup_cm_fclken =
273 omap2_cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
274 cm_context.dss_cm_fclken =
275 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_FCLKEN);
276 cm_context.cam_cm_fclken =
277 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_FCLKEN);
278 cm_context.per_cm_fclken =
279 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
280 cm_context.usbhost_cm_fclken =
281 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
282 cm_context.core_cm_iclken1 =
283 omap2_cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
284 cm_context.core_cm_iclken2 =
285 omap2_cm_read_mod_reg(CORE_MOD, CM_ICLKEN2);
286 cm_context.core_cm_iclken3 =
287 omap2_cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
288 cm_context.sgx_cm_iclken =
289 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_ICLKEN);
290 cm_context.wkup_cm_iclken =
291 omap2_cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
292 cm_context.dss_cm_iclken =
293 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_ICLKEN);
294 cm_context.cam_cm_iclken =
295 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_ICLKEN);
296 cm_context.per_cm_iclken =
297 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
298 cm_context.usbhost_cm_iclken =
299 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
300 cm_context.iva2_cm_autoidle2 =
301 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
302 cm_context.mpu_cm_autoidle2 =
303 omap2_cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
304 cm_context.iva2_cm_clkstctrl =
305 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
306 cm_context.mpu_cm_clkstctrl =
307 omap2_cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL);
308 cm_context.core_cm_clkstctrl =
309 omap2_cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL);
310 cm_context.sgx_cm_clkstctrl =
311 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP2_CM_CLKSTCTRL);
312 cm_context.dss_cm_clkstctrl =
313 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL);
314 cm_context.cam_cm_clkstctrl =
315 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL);
316 cm_context.per_cm_clkstctrl =
317 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL);
318 cm_context.neon_cm_clkstctrl =
319 omap2_cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL);
320 cm_context.usbhost_cm_clkstctrl =
321 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
322 OMAP2_CM_CLKSTCTRL);
323 cm_context.core_cm_autoidle1 =
324 omap2_cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
325 cm_context.core_cm_autoidle2 =
326 omap2_cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE2);
327 cm_context.core_cm_autoidle3 =
328 omap2_cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE3);
329 cm_context.wkup_cm_autoidle =
330 omap2_cm_read_mod_reg(WKUP_MOD, CM_AUTOIDLE);
331 cm_context.dss_cm_autoidle =
332 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_AUTOIDLE);
333 cm_context.cam_cm_autoidle =
334 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_AUTOIDLE);
335 cm_context.per_cm_autoidle =
336 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
337 cm_context.usbhost_cm_autoidle =
338 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
339 cm_context.sgx_cm_sleepdep =
340 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
341 OMAP3430_CM_SLEEPDEP);
342 cm_context.dss_cm_sleepdep =
343 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP3430_CM_SLEEPDEP);
344 cm_context.cam_cm_sleepdep =
345 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP3430_CM_SLEEPDEP);
346 cm_context.per_cm_sleepdep =
347 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_CM_SLEEPDEP);
348 cm_context.usbhost_cm_sleepdep =
349 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
350 OMAP3430_CM_SLEEPDEP);
351 cm_context.cm_clkout_ctrl =
352 omap2_cm_read_mod_reg(OMAP3430_CCR_MOD,
353 OMAP3_CM_CLKOUT_CTRL_OFFSET);
354}
355
356void omap3_cm_restore_context(void)
357{
358 omap2_cm_write_mod_reg(cm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
359 CM_CLKSEL1);
360 omap2_cm_write_mod_reg(cm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
361 CM_CLKSEL2);
362 __raw_writel(cm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
363 omap2_cm_write_mod_reg(cm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
364 CM_CLKSEL);
365 omap2_cm_write_mod_reg(cm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
366 CM_CLKSEL);
367 omap2_cm_write_mod_reg(cm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
368 CM_CLKSEL);
369 omap2_cm_write_mod_reg(cm_context.per_cm_clksel, OMAP3430_PER_MOD,
370 CM_CLKSEL);
371 omap2_cm_write_mod_reg(cm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
372 CM_CLKSEL1);
373 omap2_cm_write_mod_reg(cm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
374 OMAP2_CM_CLKSTCTRL);
375 omap2_cm_write_mod_reg(cm_context.pll_cm_autoidle2, PLL_MOD,
376 CM_AUTOIDLE2);
377 omap2_cm_write_mod_reg(cm_context.pll_cm_clksel4, PLL_MOD,
378 OMAP3430ES2_CM_CLKSEL4);
379 omap2_cm_write_mod_reg(cm_context.pll_cm_clksel5, PLL_MOD,
380 OMAP3430ES2_CM_CLKSEL5);
381 omap2_cm_write_mod_reg(cm_context.pll_cm_clken2, PLL_MOD,
382 OMAP3430ES2_CM_CLKEN2);
383 __raw_writel(cm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
384 omap2_cm_write_mod_reg(cm_context.iva2_cm_fclken, OMAP3430_IVA2_MOD,
385 CM_FCLKEN);
386 omap2_cm_write_mod_reg(cm_context.iva2_cm_clken_pll, OMAP3430_IVA2_MOD,
387 OMAP3430_CM_CLKEN_PLL);
388 omap2_cm_write_mod_reg(cm_context.core_cm_fclken1, CORE_MOD,
389 CM_FCLKEN1);
390 omap2_cm_write_mod_reg(cm_context.core_cm_fclken3, CORE_MOD,
391 OMAP3430ES2_CM_FCLKEN3);
392 omap2_cm_write_mod_reg(cm_context.sgx_cm_fclken, OMAP3430ES2_SGX_MOD,
393 CM_FCLKEN);
394 omap2_cm_write_mod_reg(cm_context.wkup_cm_fclken, WKUP_MOD, CM_FCLKEN);
395 omap2_cm_write_mod_reg(cm_context.dss_cm_fclken, OMAP3430_DSS_MOD,
396 CM_FCLKEN);
397 omap2_cm_write_mod_reg(cm_context.cam_cm_fclken, OMAP3430_CAM_MOD,
398 CM_FCLKEN);
399 omap2_cm_write_mod_reg(cm_context.per_cm_fclken, OMAP3430_PER_MOD,
400 CM_FCLKEN);
401 omap2_cm_write_mod_reg(cm_context.usbhost_cm_fclken,
402 OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
403 omap2_cm_write_mod_reg(cm_context.core_cm_iclken1, CORE_MOD,
404 CM_ICLKEN1);
405 omap2_cm_write_mod_reg(cm_context.core_cm_iclken2, CORE_MOD,
406 CM_ICLKEN2);
407 omap2_cm_write_mod_reg(cm_context.core_cm_iclken3, CORE_MOD,
408 CM_ICLKEN3);
409 omap2_cm_write_mod_reg(cm_context.sgx_cm_iclken, OMAP3430ES2_SGX_MOD,
410 CM_ICLKEN);
411 omap2_cm_write_mod_reg(cm_context.wkup_cm_iclken, WKUP_MOD, CM_ICLKEN);
412 omap2_cm_write_mod_reg(cm_context.dss_cm_iclken, OMAP3430_DSS_MOD,
413 CM_ICLKEN);
414 omap2_cm_write_mod_reg(cm_context.cam_cm_iclken, OMAP3430_CAM_MOD,
415 CM_ICLKEN);
416 omap2_cm_write_mod_reg(cm_context.per_cm_iclken, OMAP3430_PER_MOD,
417 CM_ICLKEN);
418 omap2_cm_write_mod_reg(cm_context.usbhost_cm_iclken,
419 OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
420 omap2_cm_write_mod_reg(cm_context.iva2_cm_autoidle2, OMAP3430_IVA2_MOD,
421 CM_AUTOIDLE2);
422 omap2_cm_write_mod_reg(cm_context.mpu_cm_autoidle2, MPU_MOD,
423 CM_AUTOIDLE2);
424 omap2_cm_write_mod_reg(cm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
425 OMAP2_CM_CLKSTCTRL);
426 omap2_cm_write_mod_reg(cm_context.mpu_cm_clkstctrl, MPU_MOD,
427 OMAP2_CM_CLKSTCTRL);
428 omap2_cm_write_mod_reg(cm_context.core_cm_clkstctrl, CORE_MOD,
429 OMAP2_CM_CLKSTCTRL);
430 omap2_cm_write_mod_reg(cm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
431 OMAP2_CM_CLKSTCTRL);
432 omap2_cm_write_mod_reg(cm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
433 OMAP2_CM_CLKSTCTRL);
434 omap2_cm_write_mod_reg(cm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
435 OMAP2_CM_CLKSTCTRL);
436 omap2_cm_write_mod_reg(cm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
437 OMAP2_CM_CLKSTCTRL);
438 omap2_cm_write_mod_reg(cm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
439 OMAP2_CM_CLKSTCTRL);
440 omap2_cm_write_mod_reg(cm_context.usbhost_cm_clkstctrl,
441 OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
442 omap2_cm_write_mod_reg(cm_context.core_cm_autoidle1, CORE_MOD,
443 CM_AUTOIDLE1);
444 omap2_cm_write_mod_reg(cm_context.core_cm_autoidle2, CORE_MOD,
445 CM_AUTOIDLE2);
446 omap2_cm_write_mod_reg(cm_context.core_cm_autoidle3, CORE_MOD,
447 CM_AUTOIDLE3);
448 omap2_cm_write_mod_reg(cm_context.wkup_cm_autoidle, WKUP_MOD,
449 CM_AUTOIDLE);
450 omap2_cm_write_mod_reg(cm_context.dss_cm_autoidle, OMAP3430_DSS_MOD,
451 CM_AUTOIDLE);
452 omap2_cm_write_mod_reg(cm_context.cam_cm_autoidle, OMAP3430_CAM_MOD,
453 CM_AUTOIDLE);
454 omap2_cm_write_mod_reg(cm_context.per_cm_autoidle, OMAP3430_PER_MOD,
455 CM_AUTOIDLE);
456 omap2_cm_write_mod_reg(cm_context.usbhost_cm_autoidle,
457 OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
458 omap2_cm_write_mod_reg(cm_context.sgx_cm_sleepdep, OMAP3430ES2_SGX_MOD,
459 OMAP3430_CM_SLEEPDEP);
460 omap2_cm_write_mod_reg(cm_context.dss_cm_sleepdep, OMAP3430_DSS_MOD,
461 OMAP3430_CM_SLEEPDEP);
462 omap2_cm_write_mod_reg(cm_context.cam_cm_sleepdep, OMAP3430_CAM_MOD,
463 OMAP3430_CM_SLEEPDEP);
464 omap2_cm_write_mod_reg(cm_context.per_cm_sleepdep, OMAP3430_PER_MOD,
465 OMAP3430_CM_SLEEPDEP);
466 omap2_cm_write_mod_reg(cm_context.usbhost_cm_sleepdep,
467 OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
468 omap2_cm_write_mod_reg(cm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
469 OMAP3_CM_CLKOUT_CTRL_OFFSET);
470}
471#endif
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
new file mode 100644
index 000000000000..5e9ea5bd60b9
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -0,0 +1,147 @@
1/*
2 * OMAP2/3 Clock Management (CM) register definitions
3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation
6 * Paul Walmsley
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 * The CM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The CM modules/instances on OMAP4 are quite different, so
14 * they are handled in a separate file.
15 */
16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
18
19#include "prcm-common.h"
20
21#define OMAP2420_CM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
23#define OMAP2430_CM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
25#define OMAP34XX_CM_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
27
28
29/*
30 * OMAP3-specific global CM registers
31 * Use cm_{read,write}_reg() with these registers.
32 * These registers appear once per CM module.
33 */
34
35#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
36#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
37#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
38
39#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
40#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
41
42/*
43 * Module specific CM register offsets from CM_BASE + domain offset
44 * Use cm_{read,write}_mod_reg() with these registers.
45 * These register offsets generally appear in more than one PRCM submodule.
46 */
47
48/* Common between OMAP2 and OMAP3 */
49
50#define CM_FCLKEN 0x0000
51#define CM_FCLKEN1 CM_FCLKEN
52#define CM_CLKEN CM_FCLKEN
53#define CM_ICLKEN 0x0010
54#define CM_ICLKEN1 CM_ICLKEN
55#define CM_ICLKEN2 0x0014
56#define CM_ICLKEN3 0x0018
57#define CM_IDLEST 0x0020
58#define CM_IDLEST1 CM_IDLEST
59#define CM_IDLEST2 0x0024
60#define CM_AUTOIDLE 0x0030
61#define CM_AUTOIDLE1 CM_AUTOIDLE
62#define CM_AUTOIDLE2 0x0034
63#define CM_AUTOIDLE3 0x0038
64#define CM_CLKSEL 0x0040
65#define CM_CLKSEL1 CM_CLKSEL
66#define CM_CLKSEL2 0x0044
67#define OMAP2_CM_CLKSTCTRL 0x0048
68
69/* OMAP2-specific register offsets */
70
71#define OMAP24XX_CM_FCLKEN2 0x0004
72#define OMAP24XX_CM_ICLKEN4 0x001c
73#define OMAP24XX_CM_AUTOIDLE4 0x003c
74
75#define OMAP2430_CM_IDLEST3 0x0028
76
77/* OMAP3-specific register offsets */
78
79#define OMAP3430_CM_CLKEN_PLL 0x0004
80#define OMAP3430ES2_CM_CLKEN2 0x0004
81#define OMAP3430ES2_CM_FCLKEN3 0x0008
82#define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
83#define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
84#define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
85#define OMAP3430_CM_CLKSEL1 CM_CLKSEL
86#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
87#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
88#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
89#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
90#define OMAP3430_CM_CLKSTST 0x004c
91#define OMAP3430ES2_CM_CLKSEL4 0x004c
92#define OMAP3430ES2_CM_CLKSEL5 0x0050
93#define OMAP3430_CM_CLKSEL2_EMU 0x0050
94#define OMAP3430_CM_CLKSEL3_EMU 0x0054
95
96
97/* CM_IDLEST bit field values to indicate deasserted IdleReq */
98
99#define OMAP24XX_CM_IDLEST_VAL 0
100#define OMAP34XX_CM_IDLEST_VAL 1
101
102
103/* Clock management domain register get/set */
104
105#ifndef __ASSEMBLER__
106
107extern u32 omap2_cm_read_mod_reg(s16 module, u16 idx);
108extern void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx);
109extern u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
110
111extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
112 u8 idlest_shift);
113extern u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx);
114extern u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
115
116extern bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask);
117extern void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
118extern void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
119
120extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
121extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
122extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
123extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
124
125#endif
126
127/* CM register bits shared between 24XX and 3430 */
128
129/* CM_CLKSEL_GFX */
130#define OMAP_CLKSEL_GFX_SHIFT 0
131#define OMAP_CLKSEL_GFX_MASK (0x7 << 0)
132
133/* CM_ICLKEN_GFX */
134#define OMAP_EN_GFX_SHIFT 0
135#define OMAP_EN_GFX_MASK (1 << 0)
136
137/* CM_IDLEST_GFX */
138#define OMAP_ST_GFX_MASK (1 << 0)
139
140
141/* Function prototypes */
142# ifndef __ASSEMBLER__
143extern void omap3_cm_save_context(void);
144extern void omap3_cm_restore_context(void);
145# endif
146
147#endif
diff --git a/arch/arm/mach-omap2/cm44xx.c b/arch/arm/mach-omap2/cm44xx.c
new file mode 100644
index 000000000000..e96f53ea01a1
--- /dev/null
+++ b/arch/arm/mach-omap2/cm44xx.c
@@ -0,0 +1,52 @@
1/*
2 * OMAP4 CM1, CM2 module low-level functions
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 * Paul Walmsley
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 * These functions are intended to be used only by the cminst44xx.c file.
12 * XXX Perhaps we should just move them there and make them static.
13 */
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/io.h>
20
21#include <plat/common.h>
22
23#include "cm.h"
24#include "cm1_44xx.h"
25#include "cm2_44xx.h"
26#include "cm-regbits-44xx.h"
27
28/* CM1 hardware module low-level functions */
29
30/* Read a register in CM1 */
31u32 omap4_cm1_read_inst_reg(s16 inst, u16 reg)
32{
33 return __raw_readl(OMAP44XX_CM1_REGADDR(inst, reg));
34}
35
36/* Write into a register in CM1 */
37void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 reg)
38{
39 __raw_writel(val, OMAP44XX_CM1_REGADDR(inst, reg));
40}
41
42/* Read a register in CM2 */
43u32 omap4_cm2_read_inst_reg(s16 inst, u16 reg)
44{
45 return __raw_readl(OMAP44XX_CM2_REGADDR(inst, reg));
46}
47
48/* Write into a register in CM2 */
49void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 reg)
50{
51 __raw_writel(val, OMAP44XX_CM2_REGADDR(inst, reg));
52}
diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h
index 3c35a87cb90c..48fc3f426fbd 100644
--- a/arch/arm/mach-omap2/cm44xx.h
+++ b/arch/arm/mach-omap2/cm44xx.h
@@ -1,667 +1,31 @@
1/* 1/*
2 * OMAP44xx CM1 & CM2 instance offset macros 2 * OMAP4 Clock Management (CM) definitions
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
6 * 6 *
7 * Paul Walmsley (paul@pwsan.com) 7 * Written by Paul Walmsley
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 * 8 *
17 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * OMAP4 has two separate CM blocks, CM1 and CM2. This file contains
14 * macros and function prototypes that are applicable to both.
20 */ 15 */
16#ifndef __ARCH_ASM_MACH_OMAP2_CM44XX_H
17#define __ARCH_ASM_MACH_OMAP2_CM44XX_H
21 18
22#ifndef __ARCH_ARM_MACH_OMAP2_CM44XX_H
23#define __ARCH_ARM_MACH_OMAP2_CM44XX_H
24
25
26/* CM1 */
27
28/* CM1.OCP_SOCKET_CM1 register offsets */
29#define OMAP4_REVISION_CM1_OFFSET 0x0000
30#define OMAP4430_REVISION_CM1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0000)
31#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET 0x0040
32#define OMAP4430_CM_CM1_PROFILING_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0040)
33
34/* CM1.CKGEN_CM1 register offsets */
35#define OMAP4_CM_CLKSEL_CORE_OFFSET 0x0000
36#define OMAP4430_CM_CLKSEL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0000)
37#define OMAP4_CM_CLKSEL_ABE_OFFSET 0x0008
38#define OMAP4430_CM_CLKSEL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0008)
39#define OMAP4_CM_DLL_CTRL_OFFSET 0x0010
40#define OMAP4430_CM_DLL_CTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0010)
41#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET 0x0020
42#define OMAP4430_CM_CLKMODE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0020)
43#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET 0x0024
44#define OMAP4430_CM_IDLEST_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0024)
45#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET 0x0028
46#define OMAP4430_CM_AUTOIDLE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0028)
47#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET 0x002c
48#define OMAP4430_CM_CLKSEL_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x002c)
49#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET 0x0030
50#define OMAP4430_CM_DIV_M2_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0030)
51#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET 0x0034
52#define OMAP4430_CM_DIV_M3_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0034)
53#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET 0x0038
54#define OMAP4430_CM_DIV_M4_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0038)
55#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET 0x003c
56#define OMAP4430_CM_DIV_M5_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x003c)
57#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET 0x0040
58#define OMAP4430_CM_DIV_M6_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0040)
59#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET 0x0044
60#define OMAP4430_CM_DIV_M7_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0044)
61#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET 0x0048
62#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0048)
63#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_OFFSET 0x004c
64#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x004c)
65#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET 0x0050
66#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0050)
67#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET 0x0060
68#define OMAP4430_CM_CLKMODE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0060)
69#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET 0x0064
70#define OMAP4430_CM_IDLEST_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0064)
71#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET 0x0068
72#define OMAP4430_CM_AUTOIDLE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0068)
73#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET 0x006c
74#define OMAP4430_CM_CLKSEL_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x006c)
75#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET 0x0070
76#define OMAP4430_CM_DIV_M2_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0070)
77#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET 0x0088
78#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0088)
79#define OMAP4_CM_SSC_MODFREQDIV_DPLL_MPU_OFFSET 0x008c
80#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x008c)
81#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET 0x009c
82#define OMAP4430_CM_BYPCLK_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x009c)
83#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET 0x00a0
84#define OMAP4430_CM_CLKMODE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a0)
85#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET 0x00a4
86#define OMAP4430_CM_IDLEST_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a4)
87#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET 0x00a8
88#define OMAP4430_CM_AUTOIDLE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a8)
89#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET 0x00ac
90#define OMAP4430_CM_CLKSEL_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ac)
91#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET 0x00b8
92#define OMAP4430_CM_DIV_M4_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00b8)
93#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET 0x00bc
94#define OMAP4430_CM_DIV_M5_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00bc)
95#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET 0x00c8
96#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00c8)
97#define OMAP4_CM_SSC_MODFREQDIV_DPLL_IVA_OFFSET 0x00cc
98#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00cc)
99#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET 0x00dc
100#define OMAP4430_CM_BYPCLK_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00dc)
101#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET 0x00e0
102#define OMAP4430_CM_CLKMODE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e0)
103#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET 0x00e4
104#define OMAP4430_CM_IDLEST_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e4)
105#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET 0x00e8
106#define OMAP4430_CM_AUTOIDLE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e8)
107#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET 0x00ec
108#define OMAP4430_CM_CLKSEL_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ec)
109#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET 0x00f0
110#define OMAP4430_CM_DIV_M2_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f0)
111#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET 0x00f4
112#define OMAP4430_CM_DIV_M3_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f4)
113#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET 0x0108
114#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0108)
115#define OMAP4_CM_SSC_MODFREQDIV_DPLL_ABE_OFFSET 0x010c
116#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x010c)
117#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET 0x0120
118#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0120)
119#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET 0x0124
120#define OMAP4430_CM_IDLEST_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0124)
121#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET 0x0128
122#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0128)
123#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET 0x012c
124#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x012c)
125#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET 0x0130
126#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0130)
127#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET 0x0138
128#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0138)
129#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET 0x013c
130#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x013c)
131#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET 0x0140
132#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0140)
133#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET 0x0148
134#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0148)
135#define OMAP4_CM_SSC_MODFREQDIV_DPLL_DDRPHY_OFFSET 0x014c
136#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x014c)
137#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET 0x0160
138#define OMAP4430_CM_SHADOW_FREQ_CONFIG1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0160)
139#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET 0x0164
140#define OMAP4430_CM_SHADOW_FREQ_CONFIG2 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0164)
141#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET 0x0170
142#define OMAP4430_CM_DYN_DEP_PRESCAL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0170)
143#define OMAP4_CM_RESTORE_ST_OFFSET 0x0180
144#define OMAP4430_CM_RESTORE_ST OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0180)
145
146/* CM1.MPU_CM1 register offsets */
147#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET 0x0000
148#define OMAP4430_CM_MPU_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0000)
149#define OMAP4_CM_MPU_STATICDEP_OFFSET 0x0004
150#define OMAP4430_CM_MPU_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0004)
151#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET 0x0008
152#define OMAP4430_CM_MPU_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0008)
153#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET 0x0020
154#define OMAP4430_CM_MPU_MPU_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0020)
155
156/* CM1.TESLA_CM1 register offsets */
157#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET 0x0000
158#define OMAP4430_CM_TESLA_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0000)
159#define OMAP4_CM_TESLA_STATICDEP_OFFSET 0x0004
160#define OMAP4430_CM_TESLA_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0004)
161#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET 0x0008
162#define OMAP4430_CM_TESLA_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0008)
163#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET 0x0020
164#define OMAP4430_CM_TESLA_TESLA_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0020)
165
166/* CM1.ABE_CM1 register offsets */
167#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET 0x0000
168#define OMAP4430_CM1_ABE_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0000)
169#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET 0x0020
170#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0020)
171#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET 0x0028
172#define OMAP4430_CM1_ABE_AESS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0028)
173#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET 0x0030
174#define OMAP4430_CM1_ABE_PDM_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0030)
175#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET 0x0038
176#define OMAP4430_CM1_ABE_DMIC_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0038)
177#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET 0x0040
178#define OMAP4430_CM1_ABE_MCASP_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0040)
179#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET 0x0048
180#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0048)
181#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET 0x0050
182#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0050)
183#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET 0x0058
184#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0058)
185#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET 0x0060
186#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0060)
187#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET 0x0068
188#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0068)
189#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET 0x0070
190#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0070)
191#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET 0x0078
192#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0078)
193#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET 0x0080
194#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0080)
195#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET 0x0088
196#define OMAP4430_CM1_ABE_WDT3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088)
197
198/* CM1.RESTORE_CM1 register offsets */
199#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET 0x0000
200#define OMAP4430_CM_CLKSEL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0000)
201#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET 0x0004
202#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004)
203#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET 0x0008
204#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008)
205#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET 0x000c
206#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c)
207#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET 0x0010
208#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010)
209#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET 0x0014
210#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014)
211#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET 0x0018
212#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018)
213#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET 0x001c
214#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c)
215#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET 0x0020
216#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020)
217#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET 0x0024
218#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024)
219#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET 0x0028
220#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028)
221#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET 0x002c
222#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c)
223#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET 0x0030
224#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030)
225#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET 0x0034
226#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034)
227#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET 0x0038
228#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038)
229#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET 0x003c
230#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c)
231#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET 0x0040
232#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040)
233
234/* CM2 */
235
236/* CM2.OCP_SOCKET_CM2 register offsets */
237#define OMAP4_REVISION_CM2_OFFSET 0x0000
238#define OMAP4430_REVISION_CM2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_MOD, 0x0000)
239#define OMAP4_CM_CM2_PROFILING_CLKCTRL_OFFSET 0x0040
240#define OMAP4430_CM_CM2_PROFILING_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_MOD, 0x0040)
241
242/* CM2.CKGEN_CM2 register offsets */
243#define OMAP4_CM_CLKSEL_DUCATI_ISS_ROOT_OFFSET 0x0000
244#define OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0000)
245#define OMAP4_CM_CLKSEL_USB_60MHZ_OFFSET 0x0004
246#define OMAP4430_CM_CLKSEL_USB_60MHZ OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0004)
247#define OMAP4_CM_SCALE_FCLK_OFFSET 0x0008
248#define OMAP4430_CM_SCALE_FCLK OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0008)
249#define OMAP4_CM_CORE_DVFS_PERF1_OFFSET 0x0010
250#define OMAP4430_CM_CORE_DVFS_PERF1 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0010)
251#define OMAP4_CM_CORE_DVFS_PERF2_OFFSET 0x0014
252#define OMAP4430_CM_CORE_DVFS_PERF2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0014)
253#define OMAP4_CM_CORE_DVFS_PERF3_OFFSET 0x0018
254#define OMAP4430_CM_CORE_DVFS_PERF3 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0018)
255#define OMAP4_CM_CORE_DVFS_PERF4_OFFSET 0x001c
256#define OMAP4430_CM_CORE_DVFS_PERF4 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x001c)
257#define OMAP4_CM_CORE_DVFS_CURRENT_OFFSET 0x0024
258#define OMAP4430_CM_CORE_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0024)
259#define OMAP4_CM_IVA_DVFS_PERF_TESLA_OFFSET 0x0028
260#define OMAP4430_CM_IVA_DVFS_PERF_TESLA OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0028)
261#define OMAP4_CM_IVA_DVFS_PERF_IVAHD_OFFSET 0x002c
262#define OMAP4430_CM_IVA_DVFS_PERF_IVAHD OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x002c)
263#define OMAP4_CM_IVA_DVFS_PERF_ABE_OFFSET 0x0030
264#define OMAP4430_CM_IVA_DVFS_PERF_ABE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0030)
265#define OMAP4_CM_IVA_DVFS_CURRENT_OFFSET 0x0038
266#define OMAP4430_CM_IVA_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0038)
267#define OMAP4_CM_CLKMODE_DPLL_PER_OFFSET 0x0040
268#define OMAP4430_CM_CLKMODE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0040)
269#define OMAP4_CM_IDLEST_DPLL_PER_OFFSET 0x0044
270#define OMAP4430_CM_IDLEST_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0044)
271#define OMAP4_CM_AUTOIDLE_DPLL_PER_OFFSET 0x0048
272#define OMAP4430_CM_AUTOIDLE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0048)
273#define OMAP4_CM_CLKSEL_DPLL_PER_OFFSET 0x004c
274#define OMAP4430_CM_CLKSEL_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x004c)
275#define OMAP4_CM_DIV_M2_DPLL_PER_OFFSET 0x0050
276#define OMAP4430_CM_DIV_M2_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0050)
277#define OMAP4_CM_DIV_M3_DPLL_PER_OFFSET 0x0054
278#define OMAP4430_CM_DIV_M3_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0054)
279#define OMAP4_CM_DIV_M4_DPLL_PER_OFFSET 0x0058
280#define OMAP4430_CM_DIV_M4_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0058)
281#define OMAP4_CM_DIV_M5_DPLL_PER_OFFSET 0x005c
282#define OMAP4430_CM_DIV_M5_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x005c)
283#define OMAP4_CM_DIV_M6_DPLL_PER_OFFSET 0x0060
284#define OMAP4430_CM_DIV_M6_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0060)
285#define OMAP4_CM_DIV_M7_DPLL_PER_OFFSET 0x0064
286#define OMAP4430_CM_DIV_M7_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0064)
287#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_PER_OFFSET 0x0068
288#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0068)
289#define OMAP4_CM_SSC_MODFREQDIV_DPLL_PER_OFFSET 0x006c
290#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x006c)
291#define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET 0x0080
292#define OMAP4430_CM_CLKMODE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0080)
293#define OMAP4_CM_IDLEST_DPLL_USB_OFFSET 0x0084
294#define OMAP4430_CM_IDLEST_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0084)
295#define OMAP4_CM_AUTOIDLE_DPLL_USB_OFFSET 0x0088
296#define OMAP4430_CM_AUTOIDLE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0088)
297#define OMAP4_CM_CLKSEL_DPLL_USB_OFFSET 0x008c
298#define OMAP4430_CM_CLKSEL_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x008c)
299#define OMAP4_CM_DIV_M2_DPLL_USB_OFFSET 0x0090
300#define OMAP4430_CM_DIV_M2_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0090)
301#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_USB_OFFSET 0x00a8
302#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00a8)
303#define OMAP4_CM_SSC_MODFREQDIV_DPLL_USB_OFFSET 0x00ac
304#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00ac)
305#define OMAP4_CM_CLKDCOLDO_DPLL_USB_OFFSET 0x00b4
306#define OMAP4430_CM_CLKDCOLDO_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00b4)
307#define OMAP4_CM_CLKMODE_DPLL_UNIPRO_OFFSET 0x00c0
308#define OMAP4430_CM_CLKMODE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c0)
309#define OMAP4_CM_IDLEST_DPLL_UNIPRO_OFFSET 0x00c4
310#define OMAP4430_CM_IDLEST_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c4)
311#define OMAP4_CM_AUTOIDLE_DPLL_UNIPRO_OFFSET 0x00c8
312#define OMAP4430_CM_AUTOIDLE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c8)
313#define OMAP4_CM_CLKSEL_DPLL_UNIPRO_OFFSET 0x00cc
314#define OMAP4430_CM_CLKSEL_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00cc)
315#define OMAP4_CM_DIV_M2_DPLL_UNIPRO_OFFSET 0x00d0
316#define OMAP4430_CM_DIV_M2_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00d0)
317#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_UNIPRO_OFFSET 0x00e8
318#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00e8)
319#define OMAP4_CM_SSC_MODFREQDIV_DPLL_UNIPRO_OFFSET 0x00ec
320#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00ec)
321
322/* CM2.ALWAYS_ON_CM2 register offsets */
323#define OMAP4_CM_ALWON_CLKSTCTRL_OFFSET 0x0000
324#define OMAP4430_CM_ALWON_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0000)
325#define OMAP4_CM_ALWON_MDMINTC_CLKCTRL_OFFSET 0x0020
326#define OMAP4430_CM_ALWON_MDMINTC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0020)
327#define OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET 0x0028
328#define OMAP4430_CM_ALWON_SR_MPU_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0028)
329#define OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET 0x0030
330#define OMAP4430_CM_ALWON_SR_IVA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0030)
331#define OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET 0x0038
332#define OMAP4430_CM_ALWON_SR_CORE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0038)
333#define OMAP4_CM_ALWON_USBPHY_CLKCTRL_OFFSET 0x0040
334#define OMAP4430_CM_ALWON_USBPHY_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0040)
335
336/* CM2.CORE_CM2 register offsets */
337#define OMAP4_CM_L3_1_CLKSTCTRL_OFFSET 0x0000
338#define OMAP4430_CM_L3_1_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0000)
339#define OMAP4_CM_L3_1_DYNAMICDEP_OFFSET 0x0008
340#define OMAP4430_CM_L3_1_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0008)
341#define OMAP4_CM_L3_1_L3_1_CLKCTRL_OFFSET 0x0020
342#define OMAP4430_CM_L3_1_L3_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0020)
343#define OMAP4_CM_L3_2_CLKSTCTRL_OFFSET 0x0100
344#define OMAP4430_CM_L3_2_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0100)
345#define OMAP4_CM_L3_2_DYNAMICDEP_OFFSET 0x0108
346#define OMAP4430_CM_L3_2_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0108)
347#define OMAP4_CM_L3_2_L3_2_CLKCTRL_OFFSET 0x0120
348#define OMAP4430_CM_L3_2_L3_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0120)
349#define OMAP4_CM_L3_2_GPMC_CLKCTRL_OFFSET 0x0128
350#define OMAP4430_CM_L3_2_GPMC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0128)
351#define OMAP4_CM_L3_2_OCMC_RAM_CLKCTRL_OFFSET 0x0130
352#define OMAP4430_CM_L3_2_OCMC_RAM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0130)
353#define OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET 0x0200
354#define OMAP4430_CM_DUCATI_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0200)
355#define OMAP4_CM_DUCATI_STATICDEP_OFFSET 0x0204
356#define OMAP4430_CM_DUCATI_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0204)
357#define OMAP4_CM_DUCATI_DYNAMICDEP_OFFSET 0x0208
358#define OMAP4430_CM_DUCATI_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0208)
359#define OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET 0x0220
360#define OMAP4430_CM_DUCATI_DUCATI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0220)
361#define OMAP4_CM_SDMA_CLKSTCTRL_OFFSET 0x0300
362#define OMAP4430_CM_SDMA_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0300)
363#define OMAP4_CM_SDMA_STATICDEP_OFFSET 0x0304
364#define OMAP4430_CM_SDMA_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0304)
365#define OMAP4_CM_SDMA_DYNAMICDEP_OFFSET 0x0308
366#define OMAP4430_CM_SDMA_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0308)
367#define OMAP4_CM_SDMA_SDMA_CLKCTRL_OFFSET 0x0320
368#define OMAP4430_CM_SDMA_SDMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0320)
369#define OMAP4_CM_MEMIF_CLKSTCTRL_OFFSET 0x0400
370#define OMAP4430_CM_MEMIF_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0400)
371#define OMAP4_CM_MEMIF_DMM_CLKCTRL_OFFSET 0x0420
372#define OMAP4430_CM_MEMIF_DMM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0420)
373#define OMAP4_CM_MEMIF_EMIF_FW_CLKCTRL_OFFSET 0x0428
374#define OMAP4430_CM_MEMIF_EMIF_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0428)
375#define OMAP4_CM_MEMIF_EMIF_1_CLKCTRL_OFFSET 0x0430
376#define OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0430)
377#define OMAP4_CM_MEMIF_EMIF_2_CLKCTRL_OFFSET 0x0438
378#define OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0438)
379#define OMAP4_CM_MEMIF_DLL_CLKCTRL_OFFSET 0x0440
380#define OMAP4430_CM_MEMIF_DLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0440)
381#define OMAP4_CM_MEMIF_EMIF_H1_CLKCTRL_OFFSET 0x0450
382#define OMAP4430_CM_MEMIF_EMIF_H1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0450)
383#define OMAP4_CM_MEMIF_EMIF_H2_CLKCTRL_OFFSET 0x0458
384#define OMAP4430_CM_MEMIF_EMIF_H2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0458)
385#define OMAP4_CM_MEMIF_DLL_H_CLKCTRL_OFFSET 0x0460
386#define OMAP4430_CM_MEMIF_DLL_H_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0460)
387#define OMAP4_CM_D2D_CLKSTCTRL_OFFSET 0x0500
388#define OMAP4430_CM_D2D_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0500)
389#define OMAP4_CM_D2D_STATICDEP_OFFSET 0x0504
390#define OMAP4430_CM_D2D_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0504)
391#define OMAP4_CM_D2D_DYNAMICDEP_OFFSET 0x0508
392#define OMAP4430_CM_D2D_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0508)
393#define OMAP4_CM_D2D_SAD2D_CLKCTRL_OFFSET 0x0520
394#define OMAP4430_CM_D2D_SAD2D_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0520)
395#define OMAP4_CM_D2D_MODEM_ICR_CLKCTRL_OFFSET 0x0528
396#define OMAP4430_CM_D2D_MODEM_ICR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0528)
397#define OMAP4_CM_D2D_SAD2D_FW_CLKCTRL_OFFSET 0x0530
398#define OMAP4430_CM_D2D_SAD2D_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0530)
399#define OMAP4_CM_L4CFG_CLKSTCTRL_OFFSET 0x0600
400#define OMAP4430_CM_L4CFG_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0600)
401#define OMAP4_CM_L4CFG_DYNAMICDEP_OFFSET 0x0608
402#define OMAP4430_CM_L4CFG_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0608)
403#define OMAP4_CM_L4CFG_L4_CFG_CLKCTRL_OFFSET 0x0620
404#define OMAP4430_CM_L4CFG_L4_CFG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0620)
405#define OMAP4_CM_L4CFG_HW_SEM_CLKCTRL_OFFSET 0x0628
406#define OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0628)
407#define OMAP4_CM_L4CFG_MAILBOX_CLKCTRL_OFFSET 0x0630
408#define OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0630)
409#define OMAP4_CM_L4CFG_SAR_ROM_CLKCTRL_OFFSET 0x0638
410#define OMAP4430_CM_L4CFG_SAR_ROM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0638)
411#define OMAP4_CM_L3INSTR_CLKSTCTRL_OFFSET 0x0700
412#define OMAP4430_CM_L3INSTR_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0700)
413#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_OFFSET 0x0720
414#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0720)
415#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_OFFSET 0x0728
416#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0728)
417#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_OFFSET 0x0740
418#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0740)
419
420/* CM2.IVAHD_CM2 register offsets */
421#define OMAP4_CM_IVAHD_CLKSTCTRL_OFFSET 0x0000
422#define OMAP4430_CM_IVAHD_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0000)
423#define OMAP4_CM_IVAHD_STATICDEP_OFFSET 0x0004
424#define OMAP4430_CM_IVAHD_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0004)
425#define OMAP4_CM_IVAHD_DYNAMICDEP_OFFSET 0x0008
426#define OMAP4430_CM_IVAHD_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0008)
427#define OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET 0x0020
428#define OMAP4430_CM_IVAHD_IVAHD_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0020)
429#define OMAP4_CM_IVAHD_SL2_CLKCTRL_OFFSET 0x0028
430#define OMAP4430_CM_IVAHD_SL2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0028)
431
432/* CM2.CAM_CM2 register offsets */
433#define OMAP4_CM_CAM_CLKSTCTRL_OFFSET 0x0000
434#define OMAP4430_CM_CAM_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0000)
435#define OMAP4_CM_CAM_STATICDEP_OFFSET 0x0004
436#define OMAP4430_CM_CAM_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0004)
437#define OMAP4_CM_CAM_DYNAMICDEP_OFFSET 0x0008
438#define OMAP4430_CM_CAM_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0008)
439#define OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET 0x0020
440#define OMAP4430_CM_CAM_ISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0020)
441#define OMAP4_CM_CAM_FDIF_CLKCTRL_OFFSET 0x0028
442#define OMAP4430_CM_CAM_FDIF_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0028)
443
444/* CM2.DSS_CM2 register offsets */
445#define OMAP4_CM_DSS_CLKSTCTRL_OFFSET 0x0000
446#define OMAP4430_CM_DSS_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0000)
447#define OMAP4_CM_DSS_STATICDEP_OFFSET 0x0004
448#define OMAP4430_CM_DSS_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0004)
449#define OMAP4_CM_DSS_DYNAMICDEP_OFFSET 0x0008
450#define OMAP4430_CM_DSS_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0008)
451#define OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET 0x0020
452#define OMAP4430_CM_DSS_DSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0020)
453#define OMAP4_CM_DSS_DEISS_CLKCTRL_OFFSET 0x0028
454#define OMAP4430_CM_DSS_DEISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0028)
455 19
456/* CM2.GFX_CM2 register offsets */ 20#include "prcm-common.h"
457#define OMAP4_CM_GFX_CLKSTCTRL_OFFSET 0x0000 21#include "cm.h"
458#define OMAP4430_CM_GFX_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0000)
459#define OMAP4_CM_GFX_STATICDEP_OFFSET 0x0004
460#define OMAP4430_CM_GFX_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0004)
461#define OMAP4_CM_GFX_DYNAMICDEP_OFFSET 0x0008
462#define OMAP4430_CM_GFX_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0008)
463#define OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET 0x0020
464#define OMAP4430_CM_GFX_GFX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0020)
465 22
466/* CM2.L3INIT_CM2 register offsets */ 23#define OMAP4_CM_CLKSTCTRL 0x0000
467#define OMAP4_CM_L3INIT_CLKSTCTRL_OFFSET 0x0000
468#define OMAP4430_CM_L3INIT_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0000)
469#define OMAP4_CM_L3INIT_STATICDEP_OFFSET 0x0004
470#define OMAP4430_CM_L3INIT_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0004)
471#define OMAP4_CM_L3INIT_DYNAMICDEP_OFFSET 0x0008
472#define OMAP4430_CM_L3INIT_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0008)
473#define OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET 0x0028
474#define OMAP4430_CM_L3INIT_MMC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0028)
475#define OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET 0x0030
476#define OMAP4430_CM_L3INIT_MMC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0030)
477#define OMAP4_CM_L3INIT_HSI_CLKCTRL_OFFSET 0x0038
478#define OMAP4430_CM_L3INIT_HSI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0038)
479#define OMAP4_CM_L3INIT_UNIPRO1_CLKCTRL_OFFSET 0x0040
480#define OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0040)
481#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET 0x0058
482#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0058)
483#define OMAP4_CM_L3INIT_USB_OTG_CLKCTRL_OFFSET 0x0060
484#define OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0060)
485#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET 0x0068
486#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0068)
487#define OMAP4_CM_L3INIT_P1500_CLKCTRL_OFFSET 0x0078
488#define OMAP4430_CM_L3INIT_P1500_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0078)
489#define OMAP4_CM_L3INIT_EMAC_CLKCTRL_OFFSET 0x0080
490#define OMAP4430_CM_L3INIT_EMAC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0080)
491#define OMAP4_CM_L3INIT_SATA_CLKCTRL_OFFSET 0x0088
492#define OMAP4430_CM_L3INIT_SATA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0088)
493#define OMAP4_CM_L3INIT_TPPSS_CLKCTRL_OFFSET 0x0090
494#define OMAP4430_CM_L3INIT_TPPSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0090)
495#define OMAP4_CM_L3INIT_PCIESS_CLKCTRL_OFFSET 0x0098
496#define OMAP4430_CM_L3INIT_PCIESS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0098)
497#define OMAP4_CM_L3INIT_CCPTX_CLKCTRL_OFFSET 0x00a8
498#define OMAP4430_CM_L3INIT_CCPTX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00a8)
499#define OMAP4_CM_L3INIT_XHPI_CLKCTRL_OFFSET 0x00c0
500#define OMAP4430_CM_L3INIT_XHPI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00c0)
501#define OMAP4_CM_L3INIT_MMC6_CLKCTRL_OFFSET 0x00c8
502#define OMAP4430_CM_L3INIT_MMC6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00c8)
503#define OMAP4_CM_L3INIT_USB_HOST_FS_CLKCTRL_OFFSET 0x00d0
504#define OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00d0)
505#define OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET 0x00e0
506#define OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00e0)
507 24
508/* CM2.L4PER_CM2 register offsets */ 25/* Function prototypes */
509#define OMAP4_CM_L4PER_CLKSTCTRL_OFFSET 0x0000 26# ifndef __ASSEMBLER__
510#define OMAP4430_CM_L4PER_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0000)
511#define OMAP4_CM_L4PER_DYNAMICDEP_OFFSET 0x0008
512#define OMAP4430_CM_L4PER_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0008)
513#define OMAP4_CM_L4PER_ADC_CLKCTRL_OFFSET 0x0020
514#define OMAP4430_CM_L4PER_ADC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0020)
515#define OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET 0x0028
516#define OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0028)
517#define OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET 0x0030
518#define OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0030)
519#define OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET 0x0038
520#define OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0038)
521#define OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET 0x0040
522#define OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0040)
523#define OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET 0x0048
524#define OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0048)
525#define OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET 0x0050
526#define OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0050)
527#define OMAP4_CM_L4PER_ELM_CLKCTRL_OFFSET 0x0058
528#define OMAP4430_CM_L4PER_ELM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0058)
529#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET 0x0060
530#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0060)
531#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET 0x0068
532#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0068)
533#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET 0x0070
534#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0070)
535#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET 0x0078
536#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0078)
537#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET 0x0080
538#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0080)
539#define OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET 0x0088
540#define OMAP4430_CM_L4PER_HDQ1W_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0088)
541#define OMAP4_CM_L4PER_HECC1_CLKCTRL_OFFSET 0x0090
542#define OMAP4430_CM_L4PER_HECC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0090)
543#define OMAP4_CM_L4PER_HECC2_CLKCTRL_OFFSET 0x0098
544#define OMAP4430_CM_L4PER_HECC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0098)
545#define OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET 0x00a0
546#define OMAP4430_CM_L4PER_I2C1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00a0)
547#define OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET 0x00a8
548#define OMAP4430_CM_L4PER_I2C2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00a8)
549#define OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET 0x00b0
550#define OMAP4430_CM_L4PER_I2C3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00b0)
551#define OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET 0x00b8
552#define OMAP4430_CM_L4PER_I2C4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00b8)
553#define OMAP4_CM_L4PER_L4PER_CLKCTRL_OFFSET 0x00c0
554#define OMAP4430_CM_L4PER_L4PER_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00c0)
555#define OMAP4_CM_L4PER_MCASP2_CLKCTRL_OFFSET 0x00d0
556#define OMAP4430_CM_L4PER_MCASP2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00d0)
557#define OMAP4_CM_L4PER_MCASP3_CLKCTRL_OFFSET 0x00d8
558#define OMAP4430_CM_L4PER_MCASP3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00d8)
559#define OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET 0x00e0
560#define OMAP4430_CM_L4PER_MCBSP4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00e0)
561#define OMAP4_CM_L4PER_MGATE_CLKCTRL_OFFSET 0x00e8
562#define OMAP4430_CM_L4PER_MGATE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00e8)
563#define OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET 0x00f0
564#define OMAP4430_CM_L4PER_MCSPI1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00f0)
565#define OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET 0x00f8
566#define OMAP4430_CM_L4PER_MCSPI2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00f8)
567#define OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET 0x0100
568#define OMAP4430_CM_L4PER_MCSPI3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0100)
569#define OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET 0x0108
570#define OMAP4430_CM_L4PER_MCSPI4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0108)
571#define OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET 0x0120
572#define OMAP4430_CM_L4PER_MMCSD3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0120)
573#define OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET 0x0128
574#define OMAP4430_CM_L4PER_MMCSD4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0128)
575#define OMAP4_CM_L4PER_MSPROHG_CLKCTRL_OFFSET 0x0130
576#define OMAP4430_CM_L4PER_MSPROHG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0130)
577#define OMAP4_CM_L4PER_SLIMBUS2_CLKCTRL_OFFSET 0x0138
578#define OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0138)
579#define OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET 0x0140
580#define OMAP4430_CM_L4PER_UART1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0140)
581#define OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET 0x0148
582#define OMAP4430_CM_L4PER_UART2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0148)
583#define OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET 0x0150
584#define OMAP4430_CM_L4PER_UART3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0150)
585#define OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET 0x0158
586#define OMAP4430_CM_L4PER_UART4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0158)
587#define OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET 0x0160
588#define OMAP4430_CM_L4PER_MMCSD5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0160)
589#define OMAP4_CM_L4PER_I2C5_CLKCTRL_OFFSET 0x0168
590#define OMAP4430_CM_L4PER_I2C5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0168)
591#define OMAP4_CM_L4SEC_CLKSTCTRL_OFFSET 0x0180
592#define OMAP4430_CM_L4SEC_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0180)
593#define OMAP4_CM_L4SEC_STATICDEP_OFFSET 0x0184
594#define OMAP4430_CM_L4SEC_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0184)
595#define OMAP4_CM_L4SEC_DYNAMICDEP_OFFSET 0x0188
596#define OMAP4430_CM_L4SEC_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0188)
597#define OMAP4_CM_L4SEC_AES1_CLKCTRL_OFFSET 0x01a0
598#define OMAP4430_CM_L4SEC_AES1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01a0)
599#define OMAP4_CM_L4SEC_AES2_CLKCTRL_OFFSET 0x01a8
600#define OMAP4430_CM_L4SEC_AES2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01a8)
601#define OMAP4_CM_L4SEC_DES3DES_CLKCTRL_OFFSET 0x01b0
602#define OMAP4430_CM_L4SEC_DES3DES_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01b0)
603#define OMAP4_CM_L4SEC_PKAEIP29_CLKCTRL_OFFSET 0x01b8
604#define OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01b8)
605#define OMAP4_CM_L4SEC_RNG_CLKCTRL_OFFSET 0x01c0
606#define OMAP4430_CM_L4SEC_RNG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01c0)
607#define OMAP4_CM_L4SEC_SHA2MD51_CLKCTRL_OFFSET 0x01c8
608#define OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01c8)
609#define OMAP4_CM_L4SEC_CRYPTODMA_CLKCTRL_OFFSET 0x01d8
610#define OMAP4430_CM_L4SEC_CRYPTODMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01d8)
611 27
612/* CM2.CEFUSE_CM2 register offsets */ 28extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
613#define OMAP4_CM_CEFUSE_CLKSTCTRL_OFFSET 0x0000
614#define OMAP4430_CM_CEFUSE_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_MOD, 0x0000)
615#define OMAP4_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET 0x0020
616#define OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_MOD, 0x0020)
617 29
618/* CM2.RESTORE_CM2 register offsets */ 30# endif
619#define OMAP4_CM_L3_1_CLKSTCTRL_RESTORE_OFFSET 0x0000
620#define OMAP4430_CM_L3_1_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0000)
621#define OMAP4_CM_L3_2_CLKSTCTRL_RESTORE_OFFSET 0x0004
622#define OMAP4430_CM_L3_2_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0004)
623#define OMAP4_CM_L4CFG_CLKSTCTRL_RESTORE_OFFSET 0x0008
624#define OMAP4430_CM_L4CFG_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0008)
625#define OMAP4_CM_MEMIF_CLKSTCTRL_RESTORE_OFFSET 0x000c
626#define OMAP4430_CM_MEMIF_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x000c)
627#define OMAP4_CM_L4PER_CLKSTCTRL_RESTORE_OFFSET 0x0010
628#define OMAP4430_CM_L4PER_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0010)
629#define OMAP4_CM_L3INIT_CLKSTCTRL_RESTORE_OFFSET 0x0014
630#define OMAP4430_CM_L3INIT_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0014)
631#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_RESTORE_OFFSET 0x0018
632#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0018)
633#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE_OFFSET 0x001c
634#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x001c)
635#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE_OFFSET 0x0020
636#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0020)
637#define OMAP4_CM_CM2_PROFILING_CLKCTRL_RESTORE_OFFSET 0x0024
638#define OMAP4430_CM_CM2_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0024)
639#define OMAP4_CM_D2D_STATICDEP_RESTORE_OFFSET 0x0028
640#define OMAP4430_CM_D2D_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0028)
641#define OMAP4_CM_L3_1_DYNAMICDEP_RESTORE_OFFSET 0x002c
642#define OMAP4430_CM_L3_1_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x002c)
643#define OMAP4_CM_L3_2_DYNAMICDEP_RESTORE_OFFSET 0x0030
644#define OMAP4430_CM_L3_2_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0030)
645#define OMAP4_CM_D2D_DYNAMICDEP_RESTORE_OFFSET 0x0034
646#define OMAP4430_CM_D2D_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0034)
647#define OMAP4_CM_L4CFG_DYNAMICDEP_RESTORE_OFFSET 0x0038
648#define OMAP4430_CM_L4CFG_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0038)
649#define OMAP4_CM_L4PER_DYNAMICDEP_RESTORE_OFFSET 0x003c
650#define OMAP4430_CM_L4PER_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x003c)
651#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_RESTORE_OFFSET 0x0040
652#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0040)
653#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_RESTORE_OFFSET 0x0044
654#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0044)
655#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_RESTORE_OFFSET 0x0048
656#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0048)
657#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_RESTORE_OFFSET 0x004c
658#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x004c)
659#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_RESTORE_OFFSET 0x0050
660#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0050)
661#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE_OFFSET 0x0054
662#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0054)
663#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE_OFFSET 0x0058
664#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0058)
665#define OMAP4_CM_SDMA_STATICDEP_RESTORE_OFFSET 0x005c
666#define OMAP4430_CM_SDMA_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x005c)
667#endif 31#endif
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c
deleted file mode 100644
index f8a660a1a4a6..000000000000
--- a/arch/arm/mach-omap2/cm4xxx.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * OMAP4 CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
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/module.h>
14#include <linux/types.h>
15#include <linux/delay.h>
16#include <linux/spinlock.h>
17#include <linux/list.h>
18#include <linux/errno.h>
19#include <linux/err.h>
20#include <linux/io.h>
21
22#include <asm/atomic.h>
23
24#include <plat/common.h>
25
26#include "cm.h"
27#include "cm-regbits-44xx.h"
28
29/**
30 * omap4_cm_wait_module_ready - wait for a module to be in 'func' state
31 * @clkctrl_reg: CLKCTRL module address
32 *
33 * Wait for the module IDLEST to be functional. If the idle state is in any
34 * the non functional state (trans, idle or disabled), module and thus the
35 * sysconfig cannot be accessed and will probably lead to an "imprecise
36 * external abort"
37 *
38 * Module idle state:
39 * 0x0 func: Module is fully functional, including OCP
40 * 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
41 * abortion
42 * 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
43 * using separate functional clock
44 * 0x3 disabled: Module is disabled and cannot be accessed
45 *
46 */
47int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
48{
49 int i = 0;
50
51 if (!clkctrl_reg)
52 return 0;
53
54 omap_test_timeout((
55 ((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
56 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
57 OMAP4430_IDLEST_SHIFT) == 0x2)),
58 MAX_MODULE_READY_TIME, i);
59
60 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
61}
62
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
new file mode 100644
index 000000000000..c04bbbea17a5
--- /dev/null
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -0,0 +1,214 @@
1/*
2 * OMAP4 CM instance functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This is needed since CM instances can be in the PRM, PRCM_MPU, CM1,
12 * or CM2 hardware modules. For example, the EMU_CM CM instance is in
13 * the PRM hardware module. What a mess...
14 */
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/errno.h>
19#include <linux/err.h>
20#include <linux/io.h>
21
22#include <plat/common.h>
23
24#include "cm.h"
25#include "cm1_44xx.h"
26#include "cm2_44xx.h"
27#include "cm44xx.h"
28#include "cminst44xx.h"
29#include "cm-regbits-34xx.h"
30#include "cm-regbits-44xx.h"
31#include "prcm44xx.h"
32#include "prm44xx.h"
33#include "prcm_mpu44xx.h"
34
35static u32 _cm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
36 [OMAP4430_INVALID_PRCM_PARTITION] = 0,
37 [OMAP4430_PRM_PARTITION] = OMAP4430_PRM_BASE,
38 [OMAP4430_CM1_PARTITION] = OMAP4430_CM1_BASE,
39 [OMAP4430_CM2_PARTITION] = OMAP4430_CM2_BASE,
40 [OMAP4430_SCRM_PARTITION] = 0,
41 [OMAP4430_PRCM_MPU_PARTITION] = OMAP4430_PRCM_MPU_BASE,
42};
43
44/* Read a register in a CM instance */
45u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx)
46{
47 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
48 part == OMAP4430_INVALID_PRCM_PARTITION ||
49 !_cm_bases[part]);
50 return __raw_readl(OMAP2_L4_IO_ADDRESS(_cm_bases[part] + inst + idx));
51}
52
53/* Write into a register in a CM instance */
54void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx)
55{
56 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
57 part == OMAP4430_INVALID_PRCM_PARTITION ||
58 !_cm_bases[part]);
59 __raw_writel(val, OMAP2_L4_IO_ADDRESS(_cm_bases[part] + inst + idx));
60}
61
62/* Read-modify-write a register in CM1. Caller must lock */
63u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
64 s16 idx)
65{
66 u32 v;
67
68 v = omap4_cminst_read_inst_reg(part, inst, idx);
69 v &= ~mask;
70 v |= bits;
71 omap4_cminst_write_inst_reg(v, part, inst, idx);
72
73 return v;
74}
75
76/*
77 *
78 */
79
80/**
81 * _clktrctrl_write - write @c to a CM_CLKSTCTRL.CLKTRCTRL register bitfield
82 * @c: CLKTRCTRL register bitfield (LSB = bit 0, i.e., unshifted)
83 * @part: PRCM partition ID that the CM_CLKSTCTRL register exists in
84 * @inst: CM instance register offset (*_INST macro)
85 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
86 *
87 * @c must be the unshifted value for CLKTRCTRL - i.e., this function
88 * will handle the shift itself.
89 */
90static void _clktrctrl_write(u8 c, u8 part, s16 inst, u16 cdoffs)
91{
92 u32 v;
93
94 v = omap4_cminst_read_inst_reg(part, inst, cdoffs + OMAP4_CM_CLKSTCTRL);
95 v &= ~OMAP4430_CLKTRCTRL_MASK;
96 v |= c << OMAP4430_CLKTRCTRL_SHIFT;
97 omap4_cminst_write_inst_reg(v, part, inst, cdoffs + OMAP4_CM_CLKSTCTRL);
98}
99
100/**
101 * omap4_cminst_is_clkdm_in_hwsup - is a clockdomain in hwsup idle mode?
102 * @part: PRCM partition ID that the CM_CLKSTCTRL register exists in
103 * @inst: CM instance register offset (*_INST macro)
104 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
105 *
106 * Returns true if the clockdomain referred to by (@part, @inst, @cdoffs)
107 * is in hardware-supervised idle mode, or 0 otherwise.
108 */
109bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs)
110{
111 u32 v;
112
113 v = omap4_cminst_read_inst_reg(part, inst, cdoffs + OMAP4_CM_CLKSTCTRL);
114 v &= OMAP4430_CLKTRCTRL_MASK;
115 v >>= OMAP4430_CLKTRCTRL_SHIFT;
116
117 return (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? true : false;
118}
119
120/**
121 * omap4_cminst_clkdm_enable_hwsup - put a clockdomain in hwsup-idle mode
122 * @part: PRCM partition ID that the clockdomain registers exist in
123 * @inst: CM instance register offset (*_INST macro)
124 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
125 *
126 * Put a clockdomain referred to by (@part, @inst, @cdoffs) into
127 * hardware-supervised idle mode. No return value.
128 */
129void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs)
130{
131 _clktrctrl_write(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, part, inst, cdoffs);
132}
133
134/**
135 * omap4_cminst_clkdm_disable_hwsup - put a clockdomain in swsup-idle mode
136 * @part: PRCM partition ID that the clockdomain registers exist in
137 * @inst: CM instance register offset (*_INST macro)
138 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
139 *
140 * Put a clockdomain referred to by (@part, @inst, @cdoffs) into
141 * software-supervised idle mode, i.e., controlled manually by the
142 * Linux OMAP clockdomain code. No return value.
143 */
144void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs)
145{
146 _clktrctrl_write(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, part, inst, cdoffs);
147}
148
149/**
150 * omap4_cminst_clkdm_force_sleep - try to put a clockdomain into idle
151 * @part: PRCM partition ID that the clockdomain registers exist in
152 * @inst: CM instance register offset (*_INST macro)
153 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
154 *
155 * Put a clockdomain referred to by (@part, @inst, @cdoffs) into idle
156 * No return value.
157 */
158void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs)
159{
160 _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs);
161}
162
163/**
164 * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle
165 * @part: PRCM partition ID that the clockdomain registers exist in
166 * @inst: CM instance register offset (*_INST macro)
167 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
168 *
169 * Take a clockdomain referred to by (@part, @inst, @cdoffs) out of idle,
170 * waking it up. No return value.
171 */
172void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs)
173{
174 _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, part, inst, cdoffs);
175}
176
177/*
178 *
179 */
180
181/**
182 * omap4_cm_wait_module_ready - wait for a module to be in 'func' state
183 * @clkctrl_reg: CLKCTRL module address
184 *
185 * Wait for the module IDLEST to be functional. If the idle state is in any
186 * the non functional state (trans, idle or disabled), module and thus the
187 * sysconfig cannot be accessed and will probably lead to an "imprecise
188 * external abort"
189 *
190 * Module idle state:
191 * 0x0 func: Module is fully functional, including OCP
192 * 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
193 * abortion
194 * 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
195 * using separate functional clock
196 * 0x3 disabled: Module is disabled and cannot be accessed
197 *
198 */
199int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
200{
201 int i = 0;
202
203 if (!clkctrl_reg)
204 return 0;
205
206 omap_test_timeout((
207 ((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
208 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
209 OMAP4430_IDLEST_SHIFT) == 0x2)),
210 MAX_MODULE_READY_TIME, i);
211
212 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
213}
214
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
new file mode 100644
index 000000000000..a6abd0a8cb82
--- /dev/null
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -0,0 +1,31 @@
1/*
2 * OMAP4 Clock Management (CM) function prototypes
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 * Paul Walmsley
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_ASM_MACH_OMAP2_CMINST44XX_H
12#define __ARCH_ASM_MACH_OMAP2_CMINST44XX_H
13
14extern bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs);
15extern void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs);
16extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs);
17extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs);
18extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs);
19
20/*
21 * In an ideal world, we would not export these low-level functions,
22 * but this will probably take some time to fix properly
23 */
24extern u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx);
25extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx);
26extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part,
27 s16 inst, s16 idx);
28
29extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
30
31#endif
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 1fa3294b6048..695279419020 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -20,12 +20,16 @@
20 20
21#include "cm-regbits-34xx.h" 21#include "cm-regbits-34xx.h"
22#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
23#include "cm.h" 23#include "prm2xxx_3xxx.h"
24#include "prm.h" 24#include "cm2xxx_3xxx.h"
25#include "sdrc.h" 25#include "sdrc.h"
26#include "pm.h" 26#include "pm.h"
27#include "control.h" 27#include "control.h"
28 28
29/* Used by omap3_ctrl_save_padconf() */
30#define START_PADCONF_SAVE 0x2
31#define PADCONF_SAVE_DONE 0x1
32
29static void __iomem *omap2_ctrl_base; 33static void __iomem *omap2_ctrl_base;
30static void __iomem *omap4_ctrl_pad_base; 34static void __iomem *omap4_ctrl_pad_base;
31 35
@@ -134,6 +138,7 @@ struct omap3_control_regs {
134 u32 sramldo4; 138 u32 sramldo4;
135 u32 sramldo5; 139 u32 sramldo5;
136 u32 csi; 140 u32 csi;
141 u32 padconf_sys_nirq;
137}; 142};
138 143
139static struct omap3_control_regs control_context; 144static struct omap3_control_regs control_context;
@@ -209,6 +214,37 @@ void omap4_ctrl_pad_writel(u32 val, u16 offset)
209 __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset)); 214 __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset));
210} 215}
211 216
217#ifdef CONFIG_ARCH_OMAP3
218
219/**
220 * omap3_ctrl_write_boot_mode - set scratchpad boot mode for the next boot
221 * @bootmode: 8-bit value to pass to some boot code
222 *
223 * Set the bootmode in the scratchpad RAM. This is used after the
224 * system restarts. Not sure what actually uses this - it may be the
225 * bootloader, rather than the boot ROM - contrary to the preserved
226 * comment below. No return value.
227 */
228void omap3_ctrl_write_boot_mode(u8 bootmode)
229{
230 u32 l;
231
232 l = ('B' << 24) | ('M' << 16) | bootmode;
233
234 /*
235 * Reserve the first word in scratchpad for communicating
236 * with the boot ROM. A pointer to a data structure
237 * describing the boot process can be stored there,
238 * cf. OMAP34xx TRM, Initialization / Software Booting
239 * Configuration.
240 *
241 * XXX This should use some omap_ctrl_writel()-type function
242 */
243 __raw_writel(l, OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD + 4));
244}
245
246#endif
247
212#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 248#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
213/* 249/*
214 * Clears the scratchpad contents in case of cold boot- 250 * Clears the scratchpad contents in case of cold boot-
@@ -220,13 +256,13 @@ void omap3_clear_scratchpad_contents(void)
220 void __iomem *v_addr; 256 void __iomem *v_addr;
221 u32 offset = 0; 257 u32 offset = 0;
222 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); 258 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM);
223 if (prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) & 259 if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) &
224 OMAP3430_GLOBAL_COLD_RST_MASK) { 260 OMAP3430_GLOBAL_COLD_RST_MASK) {
225 for ( ; offset <= max_offset; offset += 0x4) 261 for ( ; offset <= max_offset; offset += 0x4)
226 __raw_writel(0x0, (v_addr + offset)); 262 __raw_writel(0x0, (v_addr + offset));
227 prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK, 263 omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK,
228 OMAP3430_GR_MOD, 264 OMAP3430_GR_MOD,
229 OMAP3_PRM_RSTST_OFFSET); 265 OMAP3_PRM_RSTST_OFFSET);
230 } 266 }
231} 267}
232 268
@@ -239,9 +275,19 @@ void omap3_save_scratchpad_contents(void)
239 struct omap3_scratchpad_prcm_block prcm_block_contents; 275 struct omap3_scratchpad_prcm_block prcm_block_contents;
240 struct omap3_scratchpad_sdrc_block sdrc_block_contents; 276 struct omap3_scratchpad_sdrc_block sdrc_block_contents;
241 277
242 /* Populate the Scratchpad contents */ 278 /*
279 * Populate the Scratchpad contents
280 *
281 * The "get_*restore_pointer" functions are used to provide a
282 * physical restore address where the ROM code jumps while waking
283 * up from MPU OFF/OSWR state.
284 * The restore pointer is stored into the scratchpad.
285 */
243 scratchpad_contents.boot_config_ptr = 0x0; 286 scratchpad_contents.boot_config_ptr = 0x0;
244 if (omap_rev() != OMAP3430_REV_ES3_0 && 287 if (cpu_is_omap3630())
288 scratchpad_contents.public_restore_ptr =
289 virt_to_phys(get_omap3630_restore_pointer());
290 else if (omap_rev() != OMAP3430_REV_ES3_0 &&
245 omap_rev() != OMAP3430_REV_ES3_1) 291 omap_rev() != OMAP3430_REV_ES3_1)
246 scratchpad_contents.public_restore_ptr = 292 scratchpad_contents.public_restore_ptr =
247 virt_to_phys(get_restore_pointer()); 293 virt_to_phys(get_restore_pointer());
@@ -258,32 +304,34 @@ void omap3_save_scratchpad_contents(void)
258 scratchpad_contents.sdrc_block_offset = 0x64; 304 scratchpad_contents.sdrc_block_offset = 0x64;
259 305
260 /* Populate the PRCM block contents */ 306 /* Populate the PRCM block contents */
261 prcm_block_contents.prm_clksrc_ctrl = prm_read_mod_reg(OMAP3430_GR_MOD, 307 prcm_block_contents.prm_clksrc_ctrl =
262 OMAP3_PRM_CLKSRC_CTRL_OFFSET); 308 omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
263 prcm_block_contents.prm_clksel = prm_read_mod_reg(OMAP3430_CCR_MOD, 309 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
264 OMAP3_PRM_CLKSEL_OFFSET); 310 prcm_block_contents.prm_clksel =
311 omap2_prm_read_mod_reg(OMAP3430_CCR_MOD,
312 OMAP3_PRM_CLKSEL_OFFSET);
265 prcm_block_contents.cm_clksel_core = 313 prcm_block_contents.cm_clksel_core =
266 cm_read_mod_reg(CORE_MOD, CM_CLKSEL); 314 omap2_cm_read_mod_reg(CORE_MOD, CM_CLKSEL);
267 prcm_block_contents.cm_clksel_wkup = 315 prcm_block_contents.cm_clksel_wkup =
268 cm_read_mod_reg(WKUP_MOD, CM_CLKSEL); 316 omap2_cm_read_mod_reg(WKUP_MOD, CM_CLKSEL);
269 prcm_block_contents.cm_clken_pll = 317 prcm_block_contents.cm_clken_pll =
270 cm_read_mod_reg(PLL_MOD, CM_CLKEN); 318 omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
271 prcm_block_contents.cm_autoidle_pll = 319 prcm_block_contents.cm_autoidle_pll =
272 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_AUTOIDLE_PLL); 320 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_AUTOIDLE_PLL);
273 prcm_block_contents.cm_clksel1_pll = 321 prcm_block_contents.cm_clksel1_pll =
274 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL1_PLL); 322 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL1_PLL);
275 prcm_block_contents.cm_clksel2_pll = 323 prcm_block_contents.cm_clksel2_pll =
276 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL2_PLL); 324 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL2_PLL);
277 prcm_block_contents.cm_clksel3_pll = 325 prcm_block_contents.cm_clksel3_pll =
278 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL3); 326 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL3);
279 prcm_block_contents.cm_clken_pll_mpu = 327 prcm_block_contents.cm_clken_pll_mpu =
280 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKEN_PLL); 328 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKEN_PLL);
281 prcm_block_contents.cm_autoidle_pll_mpu = 329 prcm_block_contents.cm_autoidle_pll_mpu =
282 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL); 330 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL);
283 prcm_block_contents.cm_clksel1_pll_mpu = 331 prcm_block_contents.cm_clksel1_pll_mpu =
284 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL); 332 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL);
285 prcm_block_contents.cm_clksel2_pll_mpu = 333 prcm_block_contents.cm_clksel2_pll_mpu =
286 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL); 334 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL);
287 prcm_block_contents.prcm_block_size = 0x0; 335 prcm_block_contents.prcm_block_size = 0x0;
288 336
289 /* Populate the SDRC block contents */ 337 /* Populate the SDRC block contents */
@@ -416,6 +464,8 @@ void omap3_control_save_context(void)
416 control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4); 464 control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4);
417 control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5); 465 control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5);
418 control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI); 466 control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI);
467 control_context.padconf_sys_nirq =
468 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
419 return; 469 return;
420} 470}
421 471
@@ -472,6 +522,43 @@ void omap3_control_restore_context(void)
472 omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4); 522 omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4);
473 omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5); 523 omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5);
474 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI); 524 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI);
525 omap_ctrl_writel(control_context.padconf_sys_nirq,
526 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
475 return; 527 return;
476} 528}
529
530void omap3630_ctrl_disable_rta(void)
531{
532 if (!cpu_is_omap3630())
533 return;
534 omap_ctrl_writel(OMAP36XX_RTA_DISABLE, OMAP36XX_CONTROL_MEM_RTA_CTRL);
535}
536
537/**
538 * omap3_ctrl_save_padconf - save padconf registers to scratchpad RAM
539 *
540 * Tell the SCM to start saving the padconf registers, then wait for
541 * the process to complete. Returns 0 unconditionally, although it
542 * should also eventually be able to return -ETIMEDOUT, if the save
543 * does not complete.
544 *
545 * XXX This function is missing a timeout. What should it be?
546 */
547int omap3_ctrl_save_padconf(void)
548{
549 u32 cpo;
550
551 /* Save the padconf registers */
552 cpo = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
553 cpo |= START_PADCONF_SAVE;
554 omap_ctrl_writel(cpo, OMAP343X_CONTROL_PADCONF_OFF);
555
556 /* wait for the save to complete */
557 while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
558 & PADCONF_SAVE_DONE))
559 udelay(1);
560
561 return 0;
562}
563
477#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ 564#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index b6c6b7c450b3..f0629ae04102 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -148,6 +148,15 @@
148#define OMAP343X_CONTROL_TEST_KEY_11 (OMAP2_CONTROL_GENERAL + 0x00f4) 148#define OMAP343X_CONTROL_TEST_KEY_11 (OMAP2_CONTROL_GENERAL + 0x00f4)
149#define OMAP343X_CONTROL_TEST_KEY_12 (OMAP2_CONTROL_GENERAL + 0x00f8) 149#define OMAP343X_CONTROL_TEST_KEY_12 (OMAP2_CONTROL_GENERAL + 0x00f8)
150#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc) 150#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc)
151#define OMAP343X_CONTROL_FUSE_OPP1_VDD1 (OMAP2_CONTROL_GENERAL + 0x0110)
152#define OMAP343X_CONTROL_FUSE_OPP2_VDD1 (OMAP2_CONTROL_GENERAL + 0x0114)
153#define OMAP343X_CONTROL_FUSE_OPP3_VDD1 (OMAP2_CONTROL_GENERAL + 0x0118)
154#define OMAP343X_CONTROL_FUSE_OPP4_VDD1 (OMAP2_CONTROL_GENERAL + 0x011c)
155#define OMAP343X_CONTROL_FUSE_OPP5_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120)
156#define OMAP343X_CONTROL_FUSE_OPP1_VDD2 (OMAP2_CONTROL_GENERAL + 0x0124)
157#define OMAP343X_CONTROL_FUSE_OPP2_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)
158#define OMAP343X_CONTROL_FUSE_OPP3_VDD2 (OMAP2_CONTROL_GENERAL + 0x012c)
159#define OMAP343X_CONTROL_FUSE_SR (OMAP2_CONTROL_GENERAL + 0x0130)
151#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) 160#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
152#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) 161#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
153#define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \ 162#define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \
@@ -164,6 +173,26 @@
164#define OMAP343X_CONTROL_SRAMLDO5 (OMAP2_CONTROL_GENERAL + 0x02C0) 173#define OMAP343X_CONTROL_SRAMLDO5 (OMAP2_CONTROL_GENERAL + 0x02C0)
165#define OMAP343X_CONTROL_CSI (OMAP2_CONTROL_GENERAL + 0x02C4) 174#define OMAP343X_CONTROL_CSI (OMAP2_CONTROL_GENERAL + 0x02C4)
166 175
176/* OMAP3630 only CONTROL_GENERAL register offsets */
177#define OMAP3630_CONTROL_FUSE_OPP1G_VDD1 (OMAP2_CONTROL_GENERAL + 0x0110)
178#define OMAP3630_CONTROL_FUSE_OPP50_VDD1 (OMAP2_CONTROL_GENERAL + 0x0114)
179#define OMAP3630_CONTROL_FUSE_OPP100_VDD1 (OMAP2_CONTROL_GENERAL + 0x0118)
180#define OMAP3630_CONTROL_FUSE_OPP120_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120)
181#define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)
182#define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL + 0x012C)
183
184/* OMAP44xx control efuse offsets */
185#define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C
186#define OMAP44XX_CONTROL_FUSE_IVA_OPP100 0x22F
187#define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO 0x232
188#define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO 0x235
189#define OMAP44XX_CONTROL_FUSE_MPU_OPP50 0x240
190#define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243
191#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246
192#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249
193#define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254
194#define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257
195
167/* AM35XX only CONTROL_GENERAL register offsets */ 196/* AM35XX only CONTROL_GENERAL register offsets */
168#define AM35XX_CONTROL_MSUSPENDMUX_6 (OMAP2_CONTROL_GENERAL + 0x0038) 197#define AM35XX_CONTROL_MSUSPENDMUX_6 (OMAP2_CONTROL_GENERAL + 0x0038)
169#define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310) 198#define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310)
@@ -204,6 +233,10 @@
204#define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014) 233#define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014)
205#define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018) 234#define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018)
206 235
236/* 36xx-only RTA - Retention till Accesss control registers and bits */
237#define OMAP36XX_CONTROL_MEM_RTA_CTRL 0x40C
238#define OMAP36XX_RTA_DISABLE 0x0
239
207/* 34xx D2D idle-related pins, handled by PM core */ 240/* 34xx D2D idle-related pins, handled by PM core */
208#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 241#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
209#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 242#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
@@ -270,6 +303,8 @@
270#define OMAP343X_SCRATCHPAD_ROM (OMAP343X_CTRL_BASE + 0x860) 303#define OMAP343X_SCRATCHPAD_ROM (OMAP343X_CTRL_BASE + 0x860)
271#define OMAP343X_SCRATCHPAD (OMAP343X_CTRL_BASE + 0x910) 304#define OMAP343X_SCRATCHPAD (OMAP343X_CTRL_BASE + 0x910)
272#define OMAP343X_SCRATCHPAD_ROM_OFFSET 0x19C 305#define OMAP343X_SCRATCHPAD_ROM_OFFSET 0x19C
306#define OMAP343X_SCRATCHPAD_REGADDR(reg) OMAP2_L4_IO_ADDRESS(\
307 OMAP343X_SCRATCHPAD + reg)
273 308
274/* AM35XX_CONTROL_IPSS_CLK_CTRL bits */ 309/* AM35XX_CONTROL_IPSS_CLK_CTRL bits */
275#define AM35XX_USBOTG_VBUSP_CLK_SHIFT 0 310#define AM35XX_USBOTG_VBUSP_CLK_SHIFT 0
@@ -309,7 +344,7 @@
309#define FEAT_SGX_NONE 2 344#define FEAT_SGX_NONE 2
310 345
311#define OMAP3_IVA_SHIFT 12 346#define OMAP3_IVA_SHIFT 12
312#define OMAP3_IVA_MASK (1 << OMAP3_SGX_SHIFT) 347#define OMAP3_IVA_MASK (1 << OMAP3_IVA_SHIFT)
313#define FEAT_IVA 0 348#define FEAT_IVA 0
314#define FEAT_IVA_NONE 1 349#define FEAT_IVA_NONE 1
315 350
@@ -347,10 +382,13 @@ extern void omap3_save_scratchpad_contents(void);
347extern void omap3_clear_scratchpad_contents(void); 382extern void omap3_clear_scratchpad_contents(void);
348extern u32 *get_restore_pointer(void); 383extern u32 *get_restore_pointer(void);
349extern u32 *get_es3_restore_pointer(void); 384extern u32 *get_es3_restore_pointer(void);
385extern u32 *get_omap3630_restore_pointer(void);
350extern u32 omap3_arm_context[128]; 386extern u32 omap3_arm_context[128];
351extern void omap3_control_save_context(void); 387extern void omap3_control_save_context(void);
352extern void omap3_control_restore_context(void); 388extern void omap3_control_restore_context(void);
353 389extern void omap3_ctrl_write_boot_mode(u8 bootmode);
390extern void omap3630_ctrl_disable_rta(void);
391extern int omap3_ctrl_save_padconf(void);
354#else 392#else
355#define omap_ctrl_base_get() 0 393#define omap_ctrl_base_get() 0
356#define omap_ctrl_readb(x) 0 394#define omap_ctrl_readb(x) 0
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 0d50b45d041c..f3e043fe5eb8 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -27,8 +27,8 @@
27 27
28#include <plat/prcm.h> 28#include <plat/prcm.h>
29#include <plat/irqs.h> 29#include <plat/irqs.h>
30#include <plat/powerdomain.h> 30#include "powerdomain.h"
31#include <plat/clockdomain.h> 31#include "clockdomain.h"
32#include <plat/serial.h> 32#include <plat/serial.h>
33 33
34#include "pm.h" 34#include "pm.h"
@@ -293,25 +293,26 @@ select_state:
293DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); 293DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
294 294
295/** 295/**
296 * omap3_cpuidle_update_states - Update the cpuidle states. 296 * omap3_cpuidle_update_states() - Update the cpuidle states
297 * @mpu_deepest_state: Enable states upto and including this for mpu domain
298 * @core_deepest_state: Enable states upto and including this for core domain
297 * 299 *
298 * Currently, this function toggles the validity of idle states based upon 300 * This goes through the list of states available and enables and disables the
299 * the flag 'enable_off_mode'. When the flag is set all states are valid. 301 * validity of C states based on deepest state that can be achieved for the
300 * Else, states leading to OFF state set to be invalid. 302 * variable domain
301 */ 303 */
302void omap3_cpuidle_update_states(void) 304void omap3_cpuidle_update_states(u32 mpu_deepest_state, u32 core_deepest_state)
303{ 305{
304 int i; 306 int i;
305 307
306 for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { 308 for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) {
307 struct omap3_processor_cx *cx = &omap3_power_states[i]; 309 struct omap3_processor_cx *cx = &omap3_power_states[i];
308 310
309 if (enable_off_mode) { 311 if ((cx->mpu_state >= mpu_deepest_state) &&
312 (cx->core_state >= core_deepest_state)) {
310 cx->valid = 1; 313 cx->valid = 1;
311 } else { 314 } else {
312 if ((cx->mpu_state == PWRDM_POWER_OFF) || 315 cx->valid = 0;
313 (cx->core_state == PWRDM_POWER_OFF))
314 cx->valid = 0;
315 } 316 }
316 } 317 }
317} 318}
@@ -452,6 +453,18 @@ void omap_init_power_states(void)
452 omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; 453 omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF;
453 omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | 454 omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID |
454 CPUIDLE_FLAG_CHECK_BM; 455 CPUIDLE_FLAG_CHECK_BM;
456
457 /*
458 * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot
459 * enable OFF mode in a stable form for previous revisions.
460 * we disable C7 state as a result.
461 */
462 if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) {
463 omap3_power_states[OMAP3_STATE_C7].valid = 0;
464 cpuidle_params_table[OMAP3_STATE_C7].valid = 0;
465 WARN_ONCE(1, "%s: core off state C7 disabled due to i583\n",
466 __func__);
467 }
455} 468}
456 469
457struct cpuidle_driver omap3_idle_driver = { 470struct cpuidle_driver omap3_idle_driver = {
@@ -504,7 +517,10 @@ int __init omap3_idle_init(void)
504 return -EINVAL; 517 return -EINVAL;
505 dev->state_count = count; 518 dev->state_count = count;
506 519
507 omap3_cpuidle_update_states(); 520 if (enable_off_mode)
521 omap3_cpuidle_update_states(PWRDM_POWER_OFF, PWRDM_POWER_OFF);
522 else
523 omap3_cpuidle_update_states(PWRDM_POWER_RET, PWRDM_POWER_RET);
508 524
509 if (cpuidle_register_device(dev)) { 525 if (cpuidle_register_device(dev)) {
510 printk(KERN_ERR "%s: CPUidle register device failed\n", 526 printk(KERN_ERR "%s: CPUidle register device failed\n",
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 5a0c148e23bc..381f4eb92352 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -638,6 +638,7 @@ static struct platform_device dummy_pdev = {
638static void __init omap_hsmmc_reset(void) 638static void __init omap_hsmmc_reset(void)
639{ 639{
640 u32 i, nr_controllers; 640 u32 i, nr_controllers;
641 struct clk *iclk, *fclk;
641 642
642 if (cpu_is_omap242x()) 643 if (cpu_is_omap242x())
643 return; 644 return;
@@ -647,7 +648,6 @@ static void __init omap_hsmmc_reset(void)
647 648
648 for (i = 0; i < nr_controllers; i++) { 649 for (i = 0; i < nr_controllers; i++) {
649 u32 v, base = 0; 650 u32 v, base = 0;
650 struct clk *iclk, *fclk;
651 struct device *dev = &dummy_pdev.dev; 651 struct device *dev = &dummy_pdev.dev;
652 652
653 switch (i) { 653 switch (i) {
@@ -678,19 +678,16 @@ static void __init omap_hsmmc_reset(void)
678 dummy_pdev.id = i; 678 dummy_pdev.id = i;
679 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); 679 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
680 iclk = clk_get(dev, "ick"); 680 iclk = clk_get(dev, "ick");
681 if (iclk && clk_enable(iclk)) 681 if (IS_ERR(iclk))
682 iclk = NULL; 682 goto err1;
683 if (clk_enable(iclk))
684 goto err2;
683 685
684 fclk = clk_get(dev, "fck"); 686 fclk = clk_get(dev, "fck");
685 if (fclk && clk_enable(fclk)) 687 if (IS_ERR(fclk))
686 fclk = NULL; 688 goto err3;
687 689 if (clk_enable(fclk))
688 if (!iclk || !fclk) { 690 goto err4;
689 printk(KERN_WARNING
690 "%s: Unable to enable clocks for MMC%d, "
691 "cannot reset.\n", __func__, i);
692 break;
693 }
694 691
695 omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG); 692 omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG);
696 v = omap_readl(base + MMCHS_SYSSTATUS); 693 v = omap_readl(base + MMCHS_SYSSTATUS);
@@ -698,15 +695,22 @@ static void __init omap_hsmmc_reset(void)
698 MMCHS_SYSSTATUS_RESETDONE)) 695 MMCHS_SYSSTATUS_RESETDONE))
699 cpu_relax(); 696 cpu_relax();
700 697
701 if (fclk) { 698 clk_disable(fclk);
702 clk_disable(fclk); 699 clk_put(fclk);
703 clk_put(fclk); 700 clk_disable(iclk);
704 } 701 clk_put(iclk);
705 if (iclk) {
706 clk_disable(iclk);
707 clk_put(iclk);
708 }
709 } 702 }
703 return;
704
705err4:
706 clk_put(fclk);
707err3:
708 clk_disable(iclk);
709err2:
710 clk_put(iclk);
711err1:
712 printk(KERN_WARNING "%s: Unable to enable clocks for MMC%d, "
713 "cannot reset.\n", __func__, i);
710} 714}
711#else 715#else
712static inline void omap_hsmmc_reset(void) {} 716static inline void omap_hsmmc_reset(void) {}
@@ -951,72 +955,12 @@ static inline void omap_init_vout(void) {}
951 955
952/*-------------------------------------------------------------------------*/ 956/*-------------------------------------------------------------------------*/
953 957
954/*
955 * Inorder to avoid any assumptions from bootloader regarding WDT
956 * settings, WDT module is reset during init. This enables the watchdog
957 * timer. Hence it is required to disable the watchdog after the WDT reset
958 * during init. Otherwise the system would reboot as per the default
959 * watchdog timer registers settings.
960 */
961#define OMAP_WDT_WPS (0x34)
962#define OMAP_WDT_SPR (0x48)
963
964static int omap2_disable_wdt(struct omap_hwmod *oh, void *unused)
965{
966 void __iomem *base;
967 int ret;
968
969 if (!oh) {
970 pr_err("%s: Could not look up wdtimer_hwmod\n", __func__);
971 return -EINVAL;
972 }
973
974 base = omap_hwmod_get_mpu_rt_va(oh);
975 if (!base) {
976 pr_err("%s: Could not get the base address for %s\n",
977 oh->name, __func__);
978 return -EINVAL;
979 }
980
981 /* Enable the clocks before accessing the WDT registers */
982 ret = omap_hwmod_enable(oh);
983 if (ret) {
984 pr_err("%s: Could not enable clocks for %s\n",
985 oh->name, __func__);
986 return ret;
987 }
988
989 /* sequence required to disable watchdog */
990 __raw_writel(0xAAAA, base + OMAP_WDT_SPR);
991 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
992 cpu_relax();
993
994 __raw_writel(0x5555, base + OMAP_WDT_SPR);
995 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
996 cpu_relax();
997
998 ret = omap_hwmod_idle(oh);
999 if (ret)
1000 pr_err("%s: Could not disable clocks for %s\n",
1001 oh->name, __func__);
1002
1003 return ret;
1004}
1005
1006static void __init omap_disable_wdt(void)
1007{
1008 if (cpu_class_is_omap2())
1009 omap_hwmod_for_each_by_class("wd_timer",
1010 omap2_disable_wdt, NULL);
1011 return;
1012}
1013
1014static int __init omap2_init_devices(void) 958static int __init omap2_init_devices(void)
1015{ 959{
1016 /* please keep these calls, and their implementations above, 960 /*
961 * please keep these calls, and their implementations above,
1017 * in alphabetical order so they're easier to sort through. 962 * in alphabetical order so they're easier to sort through.
1018 */ 963 */
1019 omap_disable_wdt();
1020 omap_hsmmc_reset(); 964 omap_hsmmc_reset();
1021 omap_init_audio(); 965 omap_init_audio();
1022 omap_init_camera(); 966 omap_init_camera();
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
new file mode 100644
index 000000000000..d2f15f5cfd36
--- /dev/null
+++ b/arch/arm/mach-omap2/dma.c
@@ -0,0 +1,297 @@
1/*
2 * OMAP2+ DMA driver
3 *
4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
10 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
11 *
12 * Copyright (C) 2009 Texas Instruments
13 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
14 *
15 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
16 * Converted DMA library into platform driver
17 * - G, Manjunath Kondaiah <manjugk@ti.com>
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License version 2 as
21 * published by the Free Software Foundation.
22 */
23
24#include <linux/err.h>
25#include <linux/io.h>
26#include <linux/slab.h>
27#include <linux/module.h>
28#include <linux/init.h>
29#include <linux/device.h>
30
31#include <plat/omap_hwmod.h>
32#include <plat/omap_device.h>
33#include <plat/dma.h>
34
35#define OMAP2_DMA_STRIDE 0x60
36
37static u32 errata;
38static u8 dma_stride;
39
40static struct omap_dma_dev_attr *d;
41
42static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end;
43
44static u16 reg_map[] = {
45 [REVISION] = 0x00,
46 [GCR] = 0x78,
47 [IRQSTATUS_L0] = 0x08,
48 [IRQSTATUS_L1] = 0x0c,
49 [IRQSTATUS_L2] = 0x10,
50 [IRQSTATUS_L3] = 0x14,
51 [IRQENABLE_L0] = 0x18,
52 [IRQENABLE_L1] = 0x1c,
53 [IRQENABLE_L2] = 0x20,
54 [IRQENABLE_L3] = 0x24,
55 [SYSSTATUS] = 0x28,
56 [OCP_SYSCONFIG] = 0x2c,
57 [CAPS_0] = 0x64,
58 [CAPS_2] = 0x6c,
59 [CAPS_3] = 0x70,
60 [CAPS_4] = 0x74,
61
62 /* Common register offsets */
63 [CCR] = 0x80,
64 [CLNK_CTRL] = 0x84,
65 [CICR] = 0x88,
66 [CSR] = 0x8c,
67 [CSDP] = 0x90,
68 [CEN] = 0x94,
69 [CFN] = 0x98,
70 [CSEI] = 0xa4,
71 [CSFI] = 0xa8,
72 [CDEI] = 0xac,
73 [CDFI] = 0xb0,
74 [CSAC] = 0xb4,
75 [CDAC] = 0xb8,
76
77 /* Channel specific register offsets */
78 [CSSA] = 0x9c,
79 [CDSA] = 0xa0,
80 [CCEN] = 0xbc,
81 [CCFN] = 0xc0,
82 [COLOR] = 0xc4,
83
84 /* OMAP4 specific registers */
85 [CDP] = 0xd0,
86 [CNDP] = 0xd4,
87 [CCDN] = 0xd8,
88};
89
90static struct omap_device_pm_latency omap2_dma_latency[] = {
91 {
92 .deactivate_func = omap_device_idle_hwmods,
93 .activate_func = omap_device_enable_hwmods,
94 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
95 },
96};
97
98static void __iomem *dma_base;
99static inline void dma_write(u32 val, int reg, int lch)
100{
101 u8 stride;
102 u32 offset;
103
104 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
105 offset = reg_map[reg] + (stride * lch);
106 __raw_writel(val, dma_base + offset);
107}
108
109static inline u32 dma_read(int reg, int lch)
110{
111 u8 stride;
112 u32 offset, val;
113
114 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
115 offset = reg_map[reg] + (stride * lch);
116 val = __raw_readl(dma_base + offset);
117 return val;
118}
119
120static inline void omap2_disable_irq_lch(int lch)
121{
122 u32 val;
123
124 val = dma_read(IRQENABLE_L0, lch);
125 val &= ~(1 << lch);
126 dma_write(val, IRQENABLE_L0, lch);
127}
128
129static void omap2_clear_dma(int lch)
130{
131 int i = dma_common_ch_start;
132
133 for (; i <= dma_common_ch_end; i += 1)
134 dma_write(0, i, lch);
135}
136
137static void omap2_show_dma_caps(void)
138{
139 u8 revision = dma_read(REVISION, 0) & 0xff;
140 printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n",
141 revision >> 4, revision & 0xf);
142 return;
143}
144
145static u32 configure_dma_errata(void)
146{
147
148 /*
149 * Errata applicable for OMAP2430ES1.0 and all omap2420
150 *
151 * I.
152 * Erratum ID: Not Available
153 * Inter Frame DMA buffering issue DMA will wrongly
154 * buffer elements if packing and bursting is enabled. This might
155 * result in data gets stalled in FIFO at the end of the block.
156 * Workaround: DMA channels must have BUFFERING_DISABLED bit set to
157 * guarantee no data will stay in the DMA FIFO in case inter frame
158 * buffering occurs
159 *
160 * II.
161 * Erratum ID: Not Available
162 * DMA may hang when several channels are used in parallel
163 * In the following configuration, DMA channel hanging can occur:
164 * a. Channel i, hardware synchronized, is enabled
165 * b. Another channel (Channel x), software synchronized, is enabled.
166 * c. Channel i is disabled before end of transfer
167 * d. Channel i is reenabled.
168 * e. Steps 1 to 4 are repeated a certain number of times.
169 * f. A third channel (Channel y), software synchronized, is enabled.
170 * Channel x and Channel y may hang immediately after step 'f'.
171 * Workaround:
172 * For any channel used - make sure NextLCH_ID is set to the value j.
173 */
174 if (cpu_is_omap2420() || (cpu_is_omap2430() &&
175 (omap_type() == OMAP2430_REV_ES1_0))) {
176
177 SET_DMA_ERRATA(DMA_ERRATA_IFRAME_BUFFERING);
178 SET_DMA_ERRATA(DMA_ERRATA_PARALLEL_CHANNELS);
179 }
180
181 /*
182 * Erratum ID: i378: OMAP2+: sDMA Channel is not disabled
183 * after a transaction error.
184 * Workaround: SW should explicitely disable the channel.
185 */
186 if (cpu_class_is_omap2())
187 SET_DMA_ERRATA(DMA_ERRATA_i378);
188
189 /*
190 * Erratum ID: i541: sDMA FIFO draining does not finish
191 * If sDMA channel is disabled on the fly, sDMA enters standby even
192 * through FIFO Drain is still in progress
193 * Workaround: Put sDMA in NoStandby more before a logical channel is
194 * disabled, then put it back to SmartStandby right after the channel
195 * finishes FIFO draining.
196 */
197 if (cpu_is_omap34xx())
198 SET_DMA_ERRATA(DMA_ERRATA_i541);
199
200 /*
201 * Erratum ID: i88 : Special programming model needed to disable DMA
202 * before end of block.
203 * Workaround: software must ensure that the DMA is configured in No
204 * Standby mode(DMAx_OCP_SYSCONFIG.MIDLEMODE = "01")
205 */
206 if (omap_type() == OMAP3430_REV_ES1_0)
207 SET_DMA_ERRATA(DMA_ERRATA_i88);
208
209 /*
210 * Erratum 3.2/3.3: sometimes 0 is returned if CSAC/CDAC is
211 * read before the DMA controller finished disabling the channel.
212 */
213 SET_DMA_ERRATA(DMA_ERRATA_3_3);
214
215 /*
216 * Erratum ID: Not Available
217 * A bug in ROM code leaves IRQ status for channels 0 and 1 uncleared
218 * after secure sram context save and restore.
219 * Work around: Hence we need to manually clear those IRQs to avoid
220 * spurious interrupts. This affects only secure devices.
221 */
222 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
223 SET_DMA_ERRATA(DMA_ROMCODE_BUG);
224
225 return errata;
226}
227
228/* One time initializations */
229static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
230{
231 struct omap_device *od;
232 struct omap_system_dma_plat_info *p;
233 struct resource *mem;
234 char *name = "omap_dma_system";
235
236 dma_stride = OMAP2_DMA_STRIDE;
237 dma_common_ch_start = CSDP;
238 if (cpu_is_omap3630() || cpu_is_omap4430())
239 dma_common_ch_end = CCDN;
240 else
241 dma_common_ch_end = CCFN;
242
243 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
244 if (!p) {
245 pr_err("%s: Unable to allocate pdata for %s:%s\n",
246 __func__, name, oh->name);
247 return -ENOMEM;
248 }
249
250 p->dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr;
251 p->disable_irq_lch = omap2_disable_irq_lch;
252 p->show_dma_caps = omap2_show_dma_caps;
253 p->clear_dma = omap2_clear_dma;
254 p->dma_write = dma_write;
255 p->dma_read = dma_read;
256
257 p->clear_lch_regs = NULL;
258
259 p->errata = configure_dma_errata();
260
261 od = omap_device_build(name, 0, oh, p, sizeof(*p),
262 omap2_dma_latency, ARRAY_SIZE(omap2_dma_latency), 0);
263 kfree(p);
264 if (IS_ERR(od)) {
265 pr_err("%s: Cant build omap_device for %s:%s.\n",
266 __func__, name, oh->name);
267 return IS_ERR(od);
268 }
269
270 mem = platform_get_resource(&od->pdev, IORESOURCE_MEM, 0);
271 if (!mem) {
272 dev_err(&od->pdev.dev, "%s: no mem resource\n", __func__);
273 return -EINVAL;
274 }
275 dma_base = ioremap(mem->start, resource_size(mem));
276 if (!dma_base) {
277 dev_err(&od->pdev.dev, "%s: ioremap fail\n", __func__);
278 return -ENOMEM;
279 }
280
281 d = oh->dev_attr;
282 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
283 (d->lch_count), GFP_KERNEL);
284
285 if (!d->chan) {
286 dev_err(&od->pdev.dev, "%s: kzalloc fail\n", __func__);
287 return -ENOMEM;
288 }
289 return 0;
290}
291
292static int __init omap2_system_dma_init(void)
293{
294 return omap_hwmod_for_each_by_class("dma",
295 omap2_system_dma_init_dev, NULL);
296}
297arch_initcall(omap2_system_dma_init);
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index ebb888f59365..f77022be783d 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -32,9 +32,7 @@
32#include <plat/clock.h> 32#include <plat/clock.h>
33 33
34#include "clock.h" 34#include "clock.h"
35#include "prm.h" 35#include "cm2xxx_3xxx.h"
36#include "prm-regbits-34xx.h"
37#include "cm.h"
38#include "cm-regbits-34xx.h" 36#include "cm-regbits-34xx.h"
39 37
40/* CM_AUTOIDLE_PLL*.AUTO_* bit values */ 38/* CM_AUTOIDLE_PLL*.AUTO_* bit values */
@@ -225,10 +223,9 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
225} 223}
226 224
227/** 225/**
228 * lookup_dco_sddiv - Set j-type DPLL4 compensation variables 226 * _lookup_dco - Lookup DCO used by j-type DPLL
229 * @clk: pointer to a DPLL struct clk 227 * @clk: pointer to a DPLL struct clk
230 * @dco: digital control oscillator selector 228 * @dco: digital control oscillator selector
231 * @sd_div: target sigma-delta divider
232 * @m: DPLL multiplier to set 229 * @m: DPLL multiplier to set
233 * @n: DPLL divider to set 230 * @n: DPLL divider to set
234 * 231 *
@@ -237,11 +234,9 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
237 * XXX This code is not needed for 3430/AM35xx; can it be optimized 234 * XXX This code is not needed for 3430/AM35xx; can it be optimized
238 * out in non-multi-OMAP builds for those chips? 235 * out in non-multi-OMAP builds for those chips?
239 */ 236 */
240static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m, 237static void _lookup_dco(struct clk *clk, u8 *dco, u16 m, u8 n)
241 u8 n)
242{ 238{
243 unsigned long fint, clkinp, sd; /* watch out for overflow */ 239 unsigned long fint, clkinp; /* watch out for overflow */
244 int mod1, mod2;
245 240
246 clkinp = clk->parent->rate; 241 clkinp = clk->parent->rate;
247 fint = (clkinp / n) * m; 242 fint = (clkinp / n) * m;
@@ -250,6 +245,27 @@ static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m,
250 *dco = 2; 245 *dco = 2;
251 else 246 else
252 *dco = 4; 247 *dco = 4;
248}
249
250/**
251 * _lookup_sddiv - Calculate sigma delta divider for j-type DPLL
252 * @clk: pointer to a DPLL struct clk
253 * @sd_div: target sigma-delta divider
254 * @m: DPLL multiplier to set
255 * @n: DPLL divider to set
256 *
257 * See 36xx TRM section 3.5.3.3.3.2 "Type B DPLL (Low-Jitter)"
258 *
259 * XXX This code is not needed for 3430/AM35xx; can it be optimized
260 * out in non-multi-OMAP builds for those chips?
261 */
262static void _lookup_sddiv(struct clk *clk, u8 *sd_div, u16 m, u8 n)
263{
264 unsigned long clkinp, sd; /* watch out for overflow */
265 int mod1, mod2;
266
267 clkinp = clk->parent->rate;
268
253 /* 269 /*
254 * target sigma-delta to near 250MHz 270 * target sigma-delta to near 250MHz
255 * sd = ceil[(m/(n+1)) * (clkinp_MHz / 250)] 271 * sd = ceil[(m/(n+1)) * (clkinp_MHz / 250)]
@@ -278,6 +294,7 @@ static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m,
278static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel) 294static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel)
279{ 295{
280 struct dpll_data *dd = clk->dpll_data; 296 struct dpll_data *dd = clk->dpll_data;
297 u8 dco, sd_div;
281 u32 v; 298 u32 v;
282 299
283 /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */ 300 /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */
@@ -300,18 +317,16 @@ static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel)
300 v |= m << __ffs(dd->mult_mask); 317 v |= m << __ffs(dd->mult_mask);
301 v |= (n - 1) << __ffs(dd->div1_mask); 318 v |= (n - 1) << __ffs(dd->div1_mask);
302 319
303 /* 320 /* Configure dco and sd_div for dplls that have these fields */
304 * XXX This code is not needed for 3430/AM35XX; can it be optimized 321 if (dd->dco_mask) {
305 * out in non-multi-OMAP builds for those chips? 322 _lookup_dco(clk, &dco, m, n);
306 */ 323 v &= ~(dd->dco_mask);
307 if ((dd->flags & DPLL_J_TYPE) && !(dd->flags & DPLL_NO_DCO_SEL)) { 324 v |= dco << __ffs(dd->dco_mask);
308 u8 dco, sd_div; 325 }
309 lookup_dco_sddiv(clk, &dco, &sd_div, m, n); 326 if (dd->sddiv_mask) {
310 /* XXX This probably will need revision for OMAP4 */ 327 _lookup_sddiv(clk, &sd_div, m, n);
311 v &= ~(OMAP3630_PERIPH_DPLL_DCO_SEL_MASK 328 v &= ~(dd->sddiv_mask);
312 | OMAP3630_PERIPH_DPLL_SD_DIV_MASK); 329 v |= sd_div << __ffs(dd->sddiv_mask);
313 v |= dco << __ffs(OMAP3630_PERIPH_DPLL_DCO_SEL_MASK);
314 v |= sd_div << __ffs(OMAP3630_PERIPH_DPLL_SD_DIV_MASK);
315 } 330 }
316 331
317 __raw_writel(v, dd->mult_div1_reg); 332 __raw_writel(v, dd->mult_div1_reg);
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index 6feeeae6c21b..911cd2e68d46 100644
--- a/arch/arm/mach-omap2/dsp.c
+++ b/arch/arm/mach-omap2/dsp.c
@@ -11,9 +11,16 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14/*
15 * XXX The function pointers to the PRM/CM functions are incorrect and
16 * should be removed. No device driver should be changing PRM/CM bits
17 * directly; that's a layering violation -- those bits are the responsibility
18 * of the OMAP PM core code.
19 */
20
14#include <linux/platform_device.h> 21#include <linux/platform_device.h>
15#include "prm.h" 22#include "cm2xxx_3xxx.h"
16#include "cm.h" 23#include "prm2xxx_3xxx.h"
17#ifdef CONFIG_BRIDGE_DVFS 24#ifdef CONFIG_BRIDGE_DVFS
18#include <plat/omap-pm.h> 25#include <plat/omap-pm.h>
19#endif 26#endif
@@ -31,12 +38,12 @@ static struct omap_dsp_platform_data omap_dsp_pdata __initdata = {
31 .cpu_set_freq = omap_pm_cpu_set_freq, 38 .cpu_set_freq = omap_pm_cpu_set_freq,
32 .cpu_get_freq = omap_pm_cpu_get_freq, 39 .cpu_get_freq = omap_pm_cpu_get_freq,
33#endif 40#endif
34 .dsp_prm_read = prm_read_mod_reg, 41 .dsp_prm_read = omap2_prm_read_mod_reg,
35 .dsp_prm_write = prm_write_mod_reg, 42 .dsp_prm_write = omap2_prm_write_mod_reg,
36 .dsp_prm_rmw_bits = prm_rmw_mod_reg_bits, 43 .dsp_prm_rmw_bits = omap2_prm_rmw_mod_reg_bits,
37 .dsp_cm_read = cm_read_mod_reg, 44 .dsp_cm_read = omap2_cm_read_mod_reg,
38 .dsp_cm_write = cm_write_mod_reg, 45 .dsp_cm_write = omap2_cm_write_mod_reg,
39 .dsp_cm_rmw_bits = cm_rmw_mod_reg_bits, 46 .dsp_cm_rmw_bits = omap2_cm_rmw_mod_reg_bits,
40}; 47};
41 48
42static int __init omap_dsp_init(void) 49static int __init omap_dsp_init(void)
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
new file mode 100644
index 000000000000..413de18c1d2b
--- /dev/null
+++ b/arch/arm/mach-omap2/gpio.c
@@ -0,0 +1,104 @@
1/*
2 * OMAP2+ specific gpio initialization
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20#include <linux/err.h>
21#include <linux/slab.h>
22#include <linux/interrupt.h>
23
24#include <plat/omap_hwmod.h>
25#include <plat/omap_device.h>
26
27static struct omap_device_pm_latency omap_gpio_latency[] = {
28 [0] = {
29 .deactivate_func = omap_device_idle_hwmods,
30 .activate_func = omap_device_enable_hwmods,
31 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
32 },
33};
34
35static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
36{
37 struct omap_device *od;
38 struct omap_gpio_platform_data *pdata;
39 struct omap_gpio_dev_attr *dev_attr;
40 char *name = "omap_gpio";
41 int id;
42
43 /*
44 * extract the device id from name field available in the
45 * hwmod database and use the same for constructing ids for
46 * gpio devices.
47 * CAUTION: Make sure the name in the hwmod database does
48 * not change. If changed, make corresponding change here
49 * or make use of static variable mechanism to handle this.
50 */
51 sscanf(oh->name, "gpio%d", &id);
52
53 pdata = kzalloc(sizeof(struct omap_gpio_platform_data), GFP_KERNEL);
54 if (!pdata) {
55 pr_err("gpio%d: Memory allocation failed\n", id);
56 return -ENOMEM;
57 }
58
59 dev_attr = (struct omap_gpio_dev_attr *)oh->dev_attr;
60 pdata->bank_width = dev_attr->bank_width;
61 pdata->dbck_flag = dev_attr->dbck_flag;
62 pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1);
63
64 switch (oh->class->rev) {
65 case 0:
66 case 1:
67 pdata->bank_type = METHOD_GPIO_24XX;
68 break;
69 case 2:
70 pdata->bank_type = METHOD_GPIO_44XX;
71 break;
72 default:
73 WARN(1, "Invalid gpio bank_type\n");
74 kfree(pdata);
75 return -EINVAL;
76 }
77
78 od = omap_device_build(name, id - 1, oh, pdata,
79 sizeof(*pdata), omap_gpio_latency,
80 ARRAY_SIZE(omap_gpio_latency),
81 false);
82 kfree(pdata);
83
84 if (IS_ERR(od)) {
85 WARN(1, "Cant build omap_device for %s:%s.\n",
86 name, oh->name);
87 return PTR_ERR(od);
88 }
89
90 gpio_bank_count++;
91 return 0;
92}
93
94/*
95 * gpio_init needs to be done before
96 * machine_init functions access gpio APIs.
97 * Hence gpio_init is a postcore_initcall.
98 */
99static int __init omap2_gpio_init(void)
100{
101 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init,
102 NULL);
103}
104postcore_initcall(omap2_gpio_init);
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 722209601927..2bb29c160702 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -41,7 +41,7 @@ static int omap2_nand_gpmc_retime(void)
41 return 0; 41 return 0;
42 42
43 memset(&t, 0, sizeof(t)); 43 memset(&t, 0, sizeof(t));
44 t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->sync_clk); 44 t.sync_clk = gpmc_nand_data->gpmc_t->sync_clk;
45 t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on); 45 t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on);
46 t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on); 46 t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on);
47 47
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 7bb69220adfa..3a7d25fb00ef 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -173,8 +173,17 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
173 } 173 }
174 174
175 switch (freq) { 175 switch (freq) {
176 case 104:
177 min_gpmc_clk_period = 9600; /* 104 MHz */
178 t_ces = 3;
179 t_avds = 4;
180 t_avdh = 2;
181 t_ach = 3;
182 t_aavdh = 6;
183 t_rdyo = 9;
184 break;
176 case 83: 185 case 83:
177 min_gpmc_clk_period = 12; /* 83 MHz */ 186 min_gpmc_clk_period = 12000; /* 83 MHz */
178 t_ces = 5; 187 t_ces = 5;
179 t_avds = 4; 188 t_avds = 4;
180 t_avdh = 2; 189 t_avdh = 2;
@@ -183,7 +192,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
183 t_rdyo = 9; 192 t_rdyo = 9;
184 break; 193 break;
185 case 66: 194 case 66:
186 min_gpmc_clk_period = 15; /* 66 MHz */ 195 min_gpmc_clk_period = 15000; /* 66 MHz */
187 t_ces = 6; 196 t_ces = 6;
188 t_avds = 5; 197 t_avds = 5;
189 t_avdh = 2; 198 t_avdh = 2;
@@ -192,7 +201,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
192 t_rdyo = 11; 201 t_rdyo = 11;
193 break; 202 break;
194 default: 203 default:
195 min_gpmc_clk_period = 18; /* 54 MHz */ 204 min_gpmc_clk_period = 18500; /* 54 MHz */
196 t_ces = 7; 205 t_ces = 7;
197 t_avds = 7; 206 t_avds = 7;
198 t_avdh = 7; 207 t_avdh = 7;
@@ -271,8 +280,8 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
271 t.wr_cycle = t.rd_cycle; 280 t.wr_cycle = t.rd_cycle;
272 if (cpu_is_omap34xx()) { 281 if (cpu_is_omap34xx()) {
273 t.wr_data_mux_bus = gpmc_ticks_to_ns(fclk_offset + 282 t.wr_data_mux_bus = gpmc_ticks_to_ns(fclk_offset +
274 gpmc_ns_to_ticks(min_gpmc_clk_period + 283 gpmc_ps_to_ticks(min_gpmc_clk_period +
275 t_rdyo)); 284 t_rdyo * 1000));
276 t.wr_access = t.access; 285 t.wr_access = t.access;
277 } 286 }
278 } else { 287 } else {
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index f46933bc9373..1b7b3e7d02f7 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -168,6 +168,16 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
168 return (time_ns * 1000 + tick_ps - 1) / tick_ps; 168 return (time_ns * 1000 + tick_ps - 1) / tick_ps;
169} 169}
170 170
171unsigned int gpmc_ps_to_ticks(unsigned int time_ps)
172{
173 unsigned long tick_ps;
174
175 /* Calculate in picosecs to yield more exact results */
176 tick_ps = gpmc_get_fclk_period();
177
178 return (time_ps + tick_ps - 1) / tick_ps;
179}
180
171unsigned int gpmc_ticks_to_ns(unsigned int ticks) 181unsigned int gpmc_ticks_to_ns(unsigned int ticks)
172{ 182{
173 return ticks * gpmc_get_fclk_period() / 1000; 183 return ticks * gpmc_get_fclk_period() / 1000;
@@ -235,7 +245,7 @@ int gpmc_cs_calc_divider(int cs, unsigned int sync_clk)
235 int div; 245 int div;
236 u32 l; 246 u32 l;
237 247
238 l = sync_clk * 1000 + (gpmc_get_fclk_period() - 1); 248 l = sync_clk + (gpmc_get_fclk_period() - 1);
239 div = l / gpmc_get_fclk_period(); 249 div = l / gpmc_get_fclk_period();
240 if (div > 4) 250 if (div > 4)
241 return -1; 251 return -1;
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index d54c4f89a8bd..befa321c4c13 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -38,41 +38,27 @@
38 */ 38 */
39 39
40#ifdef MULTI_OMAP2 40#ifdef MULTI_OMAP2
41
42/*
43 * We use __glue to avoid errors with multiple definitions of
44 * .globl omap_irq_base as it's included from entry-armv.S but not
45 * from entry-common.S.
46 */
47#ifdef __glue
41 .pushsection .data 48 .pushsection .data
42omap_irq_base: .word 0 49 .globl omap_irq_base
50omap_irq_base:
51 .word 0
43 .popsection 52 .popsection
53#endif
44 54
45 /* Configure the interrupt base on the first interrupt */ 55 /*
56 * Configure the interrupt base on the first interrupt.
57 * See also omap_irq_base_init for setting omap_irq_base.
58 */
46 .macro get_irqnr_preamble, base, tmp 59 .macro get_irqnr_preamble, base, tmp
479:
48 ldr \base, =omap_irq_base @ irq base address 60 ldr \base, =omap_irq_base @ irq base address
49 ldr \base, [\base, #0] @ irq base value 61 ldr \base, [\base, #0] @ irq base value
50 cmp \base, #0 @ already configured?
51 bne 9997f @ nothing to do
52
53 mrc p15, 0, \tmp, c0, c0, 0 @ get processor revision
54 and \tmp, \tmp, #0x000f0000 @ only check architecture
55 cmp \tmp, #0x00070000 @ is v6?
56 beq 2400f @ found v6 so it's omap24xx
57 mrc p15, 0, \tmp, c0, c0, 0 @ get processor revision
58 and \tmp, \tmp, #0x000000f0 @ check cortex 8 or 9
59 cmp \tmp, #0x00000080 @ cortex A-8?
60 beq 3400f @ found A-8 so it's omap34xx
61 cmp \tmp, #0x00000090 @ cortex A-9?
62 beq 4400f @ found A-9 so it's omap44xx
632400: ldr \base, =OMAP2_IRQ_BASE
64 ldr \tmp, =omap_irq_base
65 str \base, [\tmp, #0]
66 b 9b
673400: ldr \base, =OMAP3_IRQ_BASE
68 ldr \tmp, =omap_irq_base
69 str \base, [\tmp, #0]
70 b 9b
714400: ldr \base, =OMAP4_IRQ_BASE
72 ldr \tmp, =omap_irq_base
73 str \base, [\tmp, #0]
74 b 9b
759997:
76 .endm 62 .endm
77 63
78 /* Check the pending interrupts. Note that base already set */ 64 /* Check the pending interrupts. Note that base already set */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a1939b1e6f82..e66687b0b9de 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -39,13 +39,11 @@
39#include "io.h" 39#include "io.h"
40 40
41#include <plat/omap-pm.h> 41#include <plat/omap-pm.h>
42#include <plat/powerdomain.h> 42#include "powerdomain.h"
43#include "powerdomains.h"
44
45#include <plat/clockdomain.h>
46#include "clockdomains.h"
47 43
44#include "clockdomain.h"
48#include <plat/omap_hwmod.h> 45#include <plat/omap_hwmod.h>
46#include <plat/multi.h>
49 47
50/* 48/*
51 * The machine specific code may provide the extra mapping besides the 49 * The machine specific code may provide the extra mapping besides the
@@ -311,24 +309,81 @@ static int __init _omap2_init_reprogram_sdrc(void)
311 return v; 309 return v;
312} 310}
313 311
314void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, 312static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
315 struct omap_sdrc_params *sdrc_cs1) 313{
314 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
315}
316
317/*
318 * Initialize asm_irq_base for entry-macro.S
319 */
320static inline void omap_irq_base_init(void)
321{
322 extern void __iomem *omap_irq_base;
323
324#ifdef MULTI_OMAP2
325 if (cpu_is_omap24xx())
326 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE);
327 else if (cpu_is_omap34xx())
328 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE);
329 else if (cpu_is_omap44xx())
330 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE);
331 else
332 pr_err("Could not initialize omap_irq_base\n");
333#endif
334}
335
336void __init omap2_init_common_infrastructure(void)
316{ 337{
317 u8 skip_setup_idle = 0; 338 u8 postsetup_state;
318 339
319 pwrdm_init(powerdomains_omap); 340 if (cpu_is_omap242x()) {
320 clkdm_init(clockdomains_omap, clkdm_autodeps); 341 omap2xxx_powerdomains_init();
321 if (cpu_is_omap242x()) 342 omap2_clockdomains_init();
322 omap2420_hwmod_init(); 343 omap2420_hwmod_init();
323 else if (cpu_is_omap243x()) 344 } else if (cpu_is_omap243x()) {
345 omap2xxx_powerdomains_init();
346 omap2_clockdomains_init();
324 omap2430_hwmod_init(); 347 omap2430_hwmod_init();
325 else if (cpu_is_omap34xx()) 348 } else if (cpu_is_omap34xx()) {
349 omap3xxx_powerdomains_init();
350 omap2_clockdomains_init();
326 omap3xxx_hwmod_init(); 351 omap3xxx_hwmod_init();
327 else if (cpu_is_omap44xx()) 352 } else if (cpu_is_omap44xx()) {
353 omap44xx_powerdomains_init();
354 omap44xx_clockdomains_init();
328 omap44xx_hwmod_init(); 355 omap44xx_hwmod_init();
356 } else {
357 pr_err("Could not init hwmod data - unknown SoC\n");
358 }
359
360 /* Set the default postsetup state for all hwmods */
361#ifdef CONFIG_PM_RUNTIME
362 postsetup_state = _HWMOD_STATE_IDLE;
363#else
364 postsetup_state = _HWMOD_STATE_ENABLED;
365#endif
366 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
367
368 /*
369 * Set the default postsetup state for unusual modules (like
370 * MPU WDT).
371 *
372 * The postsetup_state is not actually used until
373 * omap_hwmod_late_init(), so boards that desire full watchdog
374 * coverage of kernel initialization can reprogram the
375 * postsetup_state between the calls to
376 * omap2_init_common_infra() and omap2_init_common_devices().
377 *
378 * XXX ideally we could detect whether the MPU WDT was currently
379 * enabled here and make this conditional
380 */
381 postsetup_state = _HWMOD_STATE_DISABLED;
382 omap_hwmod_for_each_by_class("wd_timer",
383 _set_hwmod_postsetup_state,
384 &postsetup_state);
329 385
330 /* The OPP tables have to be registered before a clk init */ 386 omap_pm_if_early_init();
331 omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
332 387
333 if (cpu_is_omap2420()) 388 if (cpu_is_omap2420())
334 omap2420_clk_init(); 389 omap2420_clk_init();
@@ -339,17 +394,61 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
339 else if (cpu_is_omap44xx()) 394 else if (cpu_is_omap44xx())
340 omap4xxx_clk_init(); 395 omap4xxx_clk_init();
341 else 396 else
342 pr_err("Could not init clock framework - unknown CPU\n"); 397 pr_err("Could not init clock framework - unknown SoC\n");
398}
343 399
400void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
401 struct omap_sdrc_params *sdrc_cs1)
402{
344 omap_serial_early_init(); 403 omap_serial_early_init();
345 404
346#ifndef CONFIG_PM_RUNTIME 405 omap_hwmod_late_init();
347 skip_setup_idle = 1; 406
348#endif
349 omap_hwmod_late_init(skip_setup_idle);
350 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 407 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
351 omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 408 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
352 _omap2_init_reprogram_sdrc(); 409 _omap2_init_reprogram_sdrc();
353 } 410 }
354 gpmc_init(); 411 gpmc_init();
412
413 omap_irq_base_init();
414}
415
416/*
417 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
418 */
419
420u8 omap_readb(u32 pa)
421{
422 return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
423}
424EXPORT_SYMBOL(omap_readb);
425
426u16 omap_readw(u32 pa)
427{
428 return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
429}
430EXPORT_SYMBOL(omap_readw);
431
432u32 omap_readl(u32 pa)
433{
434 return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
435}
436EXPORT_SYMBOL(omap_readl);
437
438void omap_writeb(u8 v, u32 pa)
439{
440 __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
441}
442EXPORT_SYMBOL(omap_writeb);
443
444void omap_writew(u16 v, u32 pa)
445{
446 __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
447}
448EXPORT_SYMBOL(omap_writew);
449
450void omap_writel(u32 v, u32 pa)
451{
452 __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
355} 453}
454EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 32eeabe9d2ab..85bf8ca95fd3 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -284,7 +284,10 @@ void omap3_intc_suspend(void)
284 284
285void omap3_intc_prepare_idle(void) 285void omap3_intc_prepare_idle(void)
286{ 286{
287 /* Disable autoidle as it can stall interrupt controller */ 287 /*
288 * Disable autoidle as it can stall interrupt controller,
289 * cf. errata ID i540 for 3430 (all revisions up to 3.1.x)
290 */
288 intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG); 291 intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG);
289} 292}
290 293
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 40ddecab93a9..394413dc7deb 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -281,7 +281,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
281 281
282/* FIXME: the following structs should be filled automatically by the user id */ 282/* FIXME: the following structs should be filled automatically by the user id */
283 283
284#if defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_ARCH_OMAP2420) 284#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2)
285/* DSP */ 285/* DSP */
286static struct omap_mbox2_priv omap2_mbox_dsp_priv = { 286static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
287 .tx_fifo = { 287 .tx_fifo = {
@@ -306,7 +306,7 @@ struct omap_mbox mbox_dsp_info = {
306}; 306};
307#endif 307#endif
308 308
309#if defined(CONFIG_ARCH_OMAP3430) 309#if defined(CONFIG_ARCH_OMAP3)
310struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; 310struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
311#endif 311#endif
312 312
@@ -394,15 +394,19 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
394 394
395 if (false) 395 if (false)
396 ; 396 ;
397#if defined(CONFIG_ARCH_OMAP3430) 397#if defined(CONFIG_ARCH_OMAP3)
398 else if (cpu_is_omap3430()) { 398 else if (cpu_is_omap34xx()) {
399 list = omap3_mboxes; 399 list = omap3_mboxes;
400 400
401 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 401 list[0]->irq = platform_get_irq_byname(pdev, "dsp");
402 } 402 }
403#endif 403#endif
404#if defined(CONFIG_ARCH_OMAP2420) 404#if defined(CONFIG_ARCH_OMAP2)
405 else if (cpu_is_omap2420()) { 405 else if (cpu_is_omap2430()) {
406 list = omap2_mboxes;
407
408 list[0]->irq = platform_get_irq_byname(pdev, "dsp");
409 } else if (cpu_is_omap2420()) {
406 list = omap2_mboxes; 410 list = omap2_mboxes;
407 411
408 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 412 list[0]->irq = platform_get_irq_byname(pdev, "dsp");
@@ -432,9 +436,8 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
432 iounmap(mbox_base); 436 iounmap(mbox_base);
433 return ret; 437 return ret;
434 } 438 }
435 return 0;
436 439
437 return ret; 440 return 0;
438} 441}
439 442
440static int __devexit omap2_mbox_remove(struct platform_device *pdev) 443static int __devexit omap2_mbox_remove(struct platform_device *pdev)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 074536ae401f..17bd6394d224 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/mux.c 2 * linux/arch/arm/mach-omap2/mux.c
3 * 3 *
4 * OMAP2 and OMAP3 pin multiplexing configurations 4 * OMAP2, OMAP3 and OMAP4 pin multiplexing configurations
5 * 5 *
6 * Copyright (C) 2004 - 2008 Texas Instruments Inc. 6 * Copyright (C) 2004 - 2010 Texas Instruments Inc.
7 * Copyright (C) 2003 - 2008 Nokia Corporation 7 * Copyright (C) 2003 - 2008 Nokia Corporation
8 * 8 *
9 * Written by Tony Lindgren 9 * Written by Tony Lindgren
@@ -35,65 +35,79 @@
35 35
36#include <asm/system.h> 36#include <asm/system.h>
37 37
38#include <plat/omap_hwmod.h>
39
38#include "control.h" 40#include "control.h"
39#include "mux.h" 41#include "mux.h"
40 42
41#define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ 43#define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */
42#define OMAP_MUX_BASE_SZ 0x5ca 44#define OMAP_MUX_BASE_SZ 0x5ca
43#define MUXABLE_GPIO_MODE3 BIT(0)
44 45
45struct omap_mux_entry { 46struct omap_mux_entry {
46 struct omap_mux mux; 47 struct omap_mux mux;
47 struct list_head node; 48 struct list_head node;
48}; 49};
49 50
50static unsigned long mux_phys; 51static LIST_HEAD(mux_partitions);
51static void __iomem *mux_base; 52static DEFINE_MUTEX(muxmode_mutex);
52static u8 omap_mux_flags; 53
54struct omap_mux_partition *omap_mux_get(const char *name)
55{
56 struct omap_mux_partition *partition;
57
58 list_for_each_entry(partition, &mux_partitions, node) {
59 if (!strcmp(name, partition->name))
60 return partition;
61 }
62
63 return NULL;
64}
53 65
54u16 omap_mux_read(u16 reg) 66u16 omap_mux_read(struct omap_mux_partition *partition, u16 reg)
55{ 67{
56 if (cpu_is_omap24xx()) 68 if (partition->flags & OMAP_MUX_REG_8BIT)
57 return __raw_readb(mux_base + reg); 69 return __raw_readb(partition->base + reg);
58 else 70 else
59 return __raw_readw(mux_base + reg); 71 return __raw_readw(partition->base + reg);
60} 72}
61 73
62void omap_mux_write(u16 val, u16 reg) 74void omap_mux_write(struct omap_mux_partition *partition, u16 val,
75 u16 reg)
63{ 76{
64 if (cpu_is_omap24xx()) 77 if (partition->flags & OMAP_MUX_REG_8BIT)
65 __raw_writeb(val, mux_base + reg); 78 __raw_writeb(val, partition->base + reg);
66 else 79 else
67 __raw_writew(val, mux_base + reg); 80 __raw_writew(val, partition->base + reg);
68} 81}
69 82
70void omap_mux_write_array(struct omap_board_mux *board_mux) 83void omap_mux_write_array(struct omap_mux_partition *partition,
84 struct omap_board_mux *board_mux)
71{ 85{
72 while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) { 86 while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) {
73 omap_mux_write(board_mux->value, board_mux->reg_offset); 87 omap_mux_write(partition, board_mux->value,
88 board_mux->reg_offset);
74 board_mux++; 89 board_mux++;
75 } 90 }
76} 91}
77 92
78static LIST_HEAD(muxmodes);
79static DEFINE_MUTEX(muxmode_mutex);
80
81#ifdef CONFIG_OMAP_MUX 93#ifdef CONFIG_OMAP_MUX
82 94
83static char *omap_mux_options; 95static char *omap_mux_options;
84 96
85int __init omap_mux_init_gpio(int gpio, int val) 97static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition,
98 int gpio, int val)
86{ 99{
87 struct omap_mux_entry *e; 100 struct omap_mux_entry *e;
88 struct omap_mux *gpio_mux = NULL; 101 struct omap_mux *gpio_mux = NULL;
89 u16 old_mode; 102 u16 old_mode;
90 u16 mux_mode; 103 u16 mux_mode;
91 int found = 0; 104 int found = 0;
105 struct list_head *muxmodes = &partition->muxmodes;
92 106
93 if (!gpio) 107 if (!gpio)
94 return -EINVAL; 108 return -EINVAL;
95 109
96 list_for_each_entry(e, &muxmodes, node) { 110 list_for_each_entry(e, muxmodes, node) {
97 struct omap_mux *m = &e->mux; 111 struct omap_mux *m = &e->mux;
98 if (gpio == m->gpio) { 112 if (gpio == m->gpio) {
99 gpio_mux = m; 113 gpio_mux = m;
@@ -102,34 +116,52 @@ int __init omap_mux_init_gpio(int gpio, int val)
102 } 116 }
103 117
104 if (found == 0) { 118 if (found == 0) {
105 printk(KERN_ERR "mux: Could not set gpio%i\n", gpio); 119 pr_err("%s: Could not set gpio%i\n", __func__, gpio);
106 return -ENODEV; 120 return -ENODEV;
107 } 121 }
108 122
109 if (found > 1) { 123 if (found > 1) {
110 printk(KERN_INFO "mux: Multiple gpio paths (%d) for gpio%i\n", 124 pr_info("%s: Multiple gpio paths (%d) for gpio%i\n", __func__,
111 found, gpio); 125 found, gpio);
112 return -EINVAL; 126 return -EINVAL;
113 } 127 }
114 128
115 old_mode = omap_mux_read(gpio_mux->reg_offset); 129 old_mode = omap_mux_read(partition, gpio_mux->reg_offset);
116 mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); 130 mux_mode = val & ~(OMAP_MUX_NR_MODES - 1);
117 if (omap_mux_flags & MUXABLE_GPIO_MODE3) 131 if (partition->flags & OMAP_MUX_GPIO_IN_MODE3)
118 mux_mode |= OMAP_MUX_MODE3; 132 mux_mode |= OMAP_MUX_MODE3;
119 else 133 else
120 mux_mode |= OMAP_MUX_MODE4; 134 mux_mode |= OMAP_MUX_MODE4;
121 printk(KERN_DEBUG "mux: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", 135 pr_debug("%s: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", __func__,
122 gpio_mux->muxnames[0], gpio, old_mode, mux_mode); 136 gpio_mux->muxnames[0], gpio, old_mode, mux_mode);
123 omap_mux_write(mux_mode, gpio_mux->reg_offset); 137 omap_mux_write(partition, mux_mode, gpio_mux->reg_offset);
124 138
125 return 0; 139 return 0;
126} 140}
127 141
128int __init omap_mux_init_signal(const char *muxname, int val) 142int __init omap_mux_init_gpio(int gpio, int val)
143{
144 struct omap_mux_partition *partition;
145 int ret;
146
147 list_for_each_entry(partition, &mux_partitions, node) {
148 ret = _omap_mux_init_gpio(partition, gpio, val);
149 if (!ret)
150 return ret;
151 }
152
153 return -ENODEV;
154}
155
156static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
157 const char *muxname,
158 struct omap_mux **found_mux)
129{ 159{
160 struct omap_mux *mux = NULL;
130 struct omap_mux_entry *e; 161 struct omap_mux_entry *e;
131 const char *mode_name; 162 const char *mode_name;
132 int found = 0, mode0_len = 0; 163 int found = 0, found_mode, mode0_len = 0;
164 struct list_head *muxmodes = &partition->muxmodes;
133 165
134 mode_name = strchr(muxname, '.'); 166 mode_name = strchr(muxname, '.');
135 if (mode_name) { 167 if (mode_name) {
@@ -139,51 +171,200 @@ int __init omap_mux_init_signal(const char *muxname, int val)
139 mode_name = muxname; 171 mode_name = muxname;
140 } 172 }
141 173
142 list_for_each_entry(e, &muxmodes, node) { 174 list_for_each_entry(e, muxmodes, node) {
143 struct omap_mux *m = &e->mux; 175 char *m0_entry;
144 char *m0_entry = m->muxnames[0];
145 int i; 176 int i;
146 177
178 mux = &e->mux;
179 m0_entry = mux->muxnames[0];
180
147 /* First check for full name in mode0.muxmode format */ 181 /* First check for full name in mode0.muxmode format */
148 if (mode0_len && strncmp(muxname, m0_entry, mode0_len)) 182 if (mode0_len && strncmp(muxname, m0_entry, mode0_len))
149 continue; 183 continue;
150 184
151 /* Then check for muxmode only */ 185 /* Then check for muxmode only */
152 for (i = 0; i < OMAP_MUX_NR_MODES; i++) { 186 for (i = 0; i < OMAP_MUX_NR_MODES; i++) {
153 char *mode_cur = m->muxnames[i]; 187 char *mode_cur = mux->muxnames[i];
154 188
155 if (!mode_cur) 189 if (!mode_cur)
156 continue; 190 continue;
157 191
158 if (!strcmp(mode_name, mode_cur)) { 192 if (!strcmp(mode_name, mode_cur)) {
159 u16 old_mode; 193 *found_mux = mux;
160 u16 mux_mode;
161
162 old_mode = omap_mux_read(m->reg_offset);
163 mux_mode = val | i;
164 printk(KERN_DEBUG "mux: Setting signal "
165 "%s.%s 0x%04x -> 0x%04x\n",
166 m0_entry, muxname, old_mode, mux_mode);
167 omap_mux_write(mux_mode, m->reg_offset);
168 found++; 194 found++;
195 found_mode = i;
169 } 196 }
170 } 197 }
171 } 198 }
172 199
173 if (found == 1) 200 if (found == 1) {
174 return 0; 201 return found_mode;
202 }
175 203
176 if (found > 1) { 204 if (found > 1) {
177 printk(KERN_ERR "mux: Multiple signal paths (%i) for %s\n", 205 pr_err("%s: Multiple signal paths (%i) for %s\n", __func__,
178 found, muxname); 206 found, muxname);
179 return -EINVAL; 207 return -EINVAL;
180 } 208 }
181 209
182 printk(KERN_ERR "mux: Could not set signal %s\n", muxname); 210 pr_err("%s: Could not find signal %s\n", __func__, muxname);
183 211
184 return -ENODEV; 212 return -ENODEV;
185} 213}
186 214
215static int __init
216omap_mux_get_by_name(const char *muxname,
217 struct omap_mux_partition **found_partition,
218 struct omap_mux **found_mux)
219{
220 struct omap_mux_partition *partition;
221
222 list_for_each_entry(partition, &mux_partitions, node) {
223 struct omap_mux *mux = NULL;
224 int mux_mode = _omap_mux_get_by_name(partition, muxname, &mux);
225 if (mux_mode < 0)
226 continue;
227
228 *found_partition = partition;
229 *found_mux = mux;
230
231 return mux_mode;
232 }
233
234 return -ENODEV;
235}
236
237int __init omap_mux_init_signal(const char *muxname, int val)
238{
239 struct omap_mux_partition *partition = NULL;
240 struct omap_mux *mux = NULL;
241 u16 old_mode;
242 int mux_mode;
243
244 mux_mode = omap_mux_get_by_name(muxname, &partition, &mux);
245 if (mux_mode < 0)
246 return mux_mode;
247
248 old_mode = omap_mux_read(partition, mux->reg_offset);
249 mux_mode |= val;
250 pr_debug("%s: Setting signal %s 0x%04x -> 0x%04x\n",
251 __func__, muxname, old_mode, mux_mode);
252 omap_mux_write(partition, mux_mode, mux->reg_offset);
253
254 return 0;
255}
256
257struct omap_hwmod_mux_info * __init
258omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads)
259{
260 struct omap_hwmod_mux_info *hmux;
261 int i;
262
263 if (!bpads || nr_pads < 1)
264 return NULL;
265
266 hmux = kzalloc(sizeof(struct omap_hwmod_mux_info), GFP_KERNEL);
267 if (!hmux)
268 goto err1;
269
270 hmux->nr_pads = nr_pads;
271
272 hmux->pads = kzalloc(sizeof(struct omap_device_pad) *
273 nr_pads, GFP_KERNEL);
274 if (!hmux->pads)
275 goto err2;
276
277 for (i = 0; i < hmux->nr_pads; i++) {
278 struct omap_mux_partition *partition;
279 struct omap_device_pad *bpad = &bpads[i], *pad = &hmux->pads[i];
280 struct omap_mux *mux;
281 int mux_mode;
282
283 mux_mode = omap_mux_get_by_name(bpad->name, &partition, &mux);
284 if (mux_mode < 0)
285 goto err3;
286 if (!pad->partition)
287 pad->partition = partition;
288 if (!pad->mux)
289 pad->mux = mux;
290
291 pad->name = kzalloc(strlen(bpad->name) + 1, GFP_KERNEL);
292 if (!pad->name) {
293 int j;
294
295 for (j = i - 1; j >= 0; j--)
296 kfree(hmux->pads[j].name);
297 goto err3;
298 }
299 strcpy(pad->name, bpad->name);
300
301 pad->flags = bpad->flags;
302 pad->enable = bpad->enable;
303 pad->idle = bpad->idle;
304 pad->off = bpad->off;
305 pr_debug("%s: Initialized %s\n", __func__, pad->name);
306 }
307
308 return hmux;
309
310err3:
311 kfree(hmux->pads);
312err2:
313 kfree(hmux);
314err1:
315 pr_err("%s: Could not allocate device mux entry\n", __func__);
316
317 return NULL;
318}
319
320/* Assumes the calling function takes care of locking */
321void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
322{
323 int i;
324
325 for (i = 0; i < hmux->nr_pads; i++) {
326 struct omap_device_pad *pad = &hmux->pads[i];
327 int flags, val = -EINVAL;
328
329 flags = pad->flags;
330
331 switch (state) {
332 case _HWMOD_STATE_ENABLED:
333 if (flags & OMAP_DEVICE_PAD_ENABLED)
334 break;
335 flags |= OMAP_DEVICE_PAD_ENABLED;
336 val = pad->enable;
337 pr_debug("%s: Enabling %s %x\n", __func__,
338 pad->name, val);
339 break;
340 case _HWMOD_STATE_IDLE:
341 if (!(flags & OMAP_DEVICE_PAD_REMUX))
342 break;
343 flags &= ~OMAP_DEVICE_PAD_ENABLED;
344 val = pad->idle;
345 pr_debug("%s: Idling %s %x\n", __func__,
346 pad->name, val);
347 break;
348 case _HWMOD_STATE_DISABLED:
349 default:
350 /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */
351 if (flags & OMAP_DEVICE_PAD_REMUX)
352 val = pad->off;
353 else
354 val = OMAP_MUX_MODE7;
355 flags &= ~OMAP_DEVICE_PAD_ENABLED;
356 pr_debug("%s: Disabling %s %x\n", __func__,
357 pad->name, val);
358 };
359
360 if (val >= 0) {
361 omap_mux_write(pad->partition, val,
362 pad->mux->reg_offset);
363 pad->flags = flags;
364 }
365 }
366}
367
187#ifdef CONFIG_DEBUG_FS 368#ifdef CONFIG_DEBUG_FS
188 369
189#define OMAP_MUX_MAX_NR_FLAGS 10 370#define OMAP_MUX_MAX_NR_FLAGS 10
@@ -248,13 +429,15 @@ static inline void omap_mux_decode(struct seq_file *s, u16 val)
248 } while (i-- > 0); 429 } while (i-- > 0);
249} 430}
250 431
251#define OMAP_MUX_DEFNAME_LEN 16 432#define OMAP_MUX_DEFNAME_LEN 32
252 433
253static int omap_mux_dbg_board_show(struct seq_file *s, void *unused) 434static int omap_mux_dbg_board_show(struct seq_file *s, void *unused)
254{ 435{
436 struct omap_mux_partition *partition = s->private;
255 struct omap_mux_entry *e; 437 struct omap_mux_entry *e;
438 u8 omap_gen = omap_rev() >> 28;
256 439
257 list_for_each_entry(e, &muxmodes, node) { 440 list_for_each_entry(e, &partition->muxmodes, node) {
258 struct omap_mux *m = &e->mux; 441 struct omap_mux *m = &e->mux;
259 char m0_def[OMAP_MUX_DEFNAME_LEN]; 442 char m0_def[OMAP_MUX_DEFNAME_LEN];
260 char *m0_name = m->muxnames[0]; 443 char *m0_name = m->muxnames[0];
@@ -272,11 +455,16 @@ static int omap_mux_dbg_board_show(struct seq_file *s, void *unused)
272 } 455 }
273 m0_def[i] = toupper(m0_name[i]); 456 m0_def[i] = toupper(m0_name[i]);
274 } 457 }
275 val = omap_mux_read(m->reg_offset); 458 val = omap_mux_read(partition, m->reg_offset);
276 mode = val & OMAP_MUX_MODE7; 459 mode = val & OMAP_MUX_MODE7;
277 460 if (mode != 0)
278 seq_printf(s, "OMAP%i_MUX(%s, ", 461 seq_printf(s, "/* %s */\n", m->muxnames[mode]);
279 cpu_is_omap34xx() ? 3 : 0, m0_def); 462
463 /*
464 * XXX: Might be revisited to support differences accross
465 * same OMAP generation.
466 */
467 seq_printf(s, "OMAP%d_MUX(%s, ", omap_gen, m0_def);
280 omap_mux_decode(s, val); 468 omap_mux_decode(s, val);
281 seq_printf(s, "),\n"); 469 seq_printf(s, "),\n");
282 } 470 }
@@ -286,7 +474,7 @@ static int omap_mux_dbg_board_show(struct seq_file *s, void *unused)
286 474
287static int omap_mux_dbg_board_open(struct inode *inode, struct file *file) 475static int omap_mux_dbg_board_open(struct inode *inode, struct file *file)
288{ 476{
289 return single_open(file, omap_mux_dbg_board_show, &inode->i_private); 477 return single_open(file, omap_mux_dbg_board_show, inode->i_private);
290} 478}
291 479
292static const struct file_operations omap_mux_dbg_board_fops = { 480static const struct file_operations omap_mux_dbg_board_fops = {
@@ -296,19 +484,43 @@ static const struct file_operations omap_mux_dbg_board_fops = {
296 .release = single_release, 484 .release = single_release,
297}; 485};
298 486
487static struct omap_mux_partition *omap_mux_get_partition(struct omap_mux *mux)
488{
489 struct omap_mux_partition *partition;
490
491 list_for_each_entry(partition, &mux_partitions, node) {
492 struct list_head *muxmodes = &partition->muxmodes;
493 struct omap_mux_entry *e;
494
495 list_for_each_entry(e, muxmodes, node) {
496 struct omap_mux *m = &e->mux;
497
498 if (m == mux)
499 return partition;
500 }
501 }
502
503 return NULL;
504}
505
299static int omap_mux_dbg_signal_show(struct seq_file *s, void *unused) 506static int omap_mux_dbg_signal_show(struct seq_file *s, void *unused)
300{ 507{
301 struct omap_mux *m = s->private; 508 struct omap_mux *m = s->private;
509 struct omap_mux_partition *partition;
302 const char *none = "NA"; 510 const char *none = "NA";
303 u16 val; 511 u16 val;
304 int mode; 512 int mode;
305 513
306 val = omap_mux_read(m->reg_offset); 514 partition = omap_mux_get_partition(m);
515 if (!partition)
516 return 0;
517
518 val = omap_mux_read(partition, m->reg_offset);
307 mode = val & OMAP_MUX_MODE7; 519 mode = val & OMAP_MUX_MODE7;
308 520
309 seq_printf(s, "name: %s.%s (0x%08lx/0x%03x = 0x%04x), b %s, t %s\n", 521 seq_printf(s, "name: %s.%s (0x%08x/0x%03x = 0x%04x), b %s, t %s\n",
310 m->muxnames[0], m->muxnames[mode], 522 m->muxnames[0], m->muxnames[mode],
311 mux_phys + m->reg_offset, m->reg_offset, val, 523 partition->phys + m->reg_offset, m->reg_offset, val,
312 m->balls[0] ? m->balls[0] : none, 524 m->balls[0] ? m->balls[0] : none,
313 m->balls[1] ? m->balls[1] : none); 525 m->balls[1] ? m->balls[1] : none);
314 seq_printf(s, "mode: "); 526 seq_printf(s, "mode: ");
@@ -330,14 +542,15 @@ static int omap_mux_dbg_signal_show(struct seq_file *s, void *unused)
330#define OMAP_MUX_MAX_ARG_CHAR 7 542#define OMAP_MUX_MAX_ARG_CHAR 7
331 543
332static ssize_t omap_mux_dbg_signal_write(struct file *file, 544static ssize_t omap_mux_dbg_signal_write(struct file *file,
333 const char __user *user_buf, 545 const char __user *user_buf,
334 size_t count, loff_t *ppos) 546 size_t count, loff_t *ppos)
335{ 547{
336 char buf[OMAP_MUX_MAX_ARG_CHAR]; 548 char buf[OMAP_MUX_MAX_ARG_CHAR];
337 struct seq_file *seqf; 549 struct seq_file *seqf;
338 struct omap_mux *m; 550 struct omap_mux *m;
339 unsigned long val; 551 unsigned long val;
340 int buf_size, ret; 552 int buf_size, ret;
553 struct omap_mux_partition *partition;
341 554
342 if (count > OMAP_MUX_MAX_ARG_CHAR) 555 if (count > OMAP_MUX_MAX_ARG_CHAR)
343 return -EINVAL; 556 return -EINVAL;
@@ -358,7 +571,11 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file,
358 seqf = file->private_data; 571 seqf = file->private_data;
359 m = seqf->private; 572 m = seqf->private;
360 573
361 omap_mux_write((u16)val, m->reg_offset); 574 partition = omap_mux_get_partition(m);
575 if (!partition)
576 return -ENODEV;
577
578 omap_mux_write(partition, (u16)val, m->reg_offset);
362 *ppos += count; 579 *ppos += count;
363 580
364 return count; 581 return count;
@@ -379,22 +596,38 @@ static const struct file_operations omap_mux_dbg_signal_fops = {
379 596
380static struct dentry *mux_dbg_dir; 597static struct dentry *mux_dbg_dir;
381 598
382static void __init omap_mux_dbg_init(void) 599static void __init omap_mux_dbg_create_entry(
600 struct omap_mux_partition *partition,
601 struct dentry *mux_dbg_dir)
383{ 602{
384 struct omap_mux_entry *e; 603 struct omap_mux_entry *e;
385 604
605 list_for_each_entry(e, &partition->muxmodes, node) {
606 struct omap_mux *m = &e->mux;
607
608 (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir,
609 m, &omap_mux_dbg_signal_fops);
610 }
611}
612
613static void __init omap_mux_dbg_init(void)
614{
615 struct omap_mux_partition *partition;
616 static struct dentry *mux_dbg_board_dir;
617
386 mux_dbg_dir = debugfs_create_dir("omap_mux", NULL); 618 mux_dbg_dir = debugfs_create_dir("omap_mux", NULL);
387 if (!mux_dbg_dir) 619 if (!mux_dbg_dir)
388 return; 620 return;
389 621
390 (void)debugfs_create_file("board", S_IRUGO, mux_dbg_dir, 622 mux_dbg_board_dir = debugfs_create_dir("board", mux_dbg_dir);
391 NULL, &omap_mux_dbg_board_fops); 623 if (!mux_dbg_board_dir)
392 624 return;
393 list_for_each_entry(e, &muxmodes, node) {
394 struct omap_mux *m = &e->mux;
395 625
396 (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, 626 list_for_each_entry(partition, &mux_partitions, node) {
397 m, &omap_mux_dbg_signal_fops); 627 omap_mux_dbg_create_entry(partition, mux_dbg_dir);
628 (void)debugfs_create_file(partition->name, S_IRUGO,
629 mux_dbg_board_dir, partition,
630 &omap_mux_dbg_board_fops);
398 } 631 }
399} 632}
400 633
@@ -421,23 +654,25 @@ static void __init omap_mux_free_names(struct omap_mux *m)
421/* Free all data except for GPIO pins unless CONFIG_DEBUG_FS is set */ 654/* Free all data except for GPIO pins unless CONFIG_DEBUG_FS is set */
422static int __init omap_mux_late_init(void) 655static int __init omap_mux_late_init(void)
423{ 656{
424 struct omap_mux_entry *e, *tmp; 657 struct omap_mux_partition *partition;
425 658
426 list_for_each_entry_safe(e, tmp, &muxmodes, node) { 659 list_for_each_entry(partition, &mux_partitions, node) {
427 struct omap_mux *m = &e->mux; 660 struct omap_mux_entry *e, *tmp;
428 u16 mode = omap_mux_read(m->reg_offset); 661 list_for_each_entry_safe(e, tmp, &partition->muxmodes, node) {
662 struct omap_mux *m = &e->mux;
663 u16 mode = omap_mux_read(partition, m->reg_offset);
429 664
430 if (OMAP_MODE_GPIO(mode)) 665 if (OMAP_MODE_GPIO(mode))
431 continue; 666 continue;
432 667
433#ifndef CONFIG_DEBUG_FS 668#ifndef CONFIG_DEBUG_FS
434 mutex_lock(&muxmode_mutex); 669 mutex_lock(&muxmode_mutex);
435 list_del(&e->node); 670 list_del(&e->node);
436 mutex_unlock(&muxmode_mutex); 671 mutex_unlock(&muxmode_mutex);
437 omap_mux_free_names(m); 672 omap_mux_free_names(m);
438 kfree(m); 673 kfree(m);
439#endif 674#endif
440 675 }
441 } 676 }
442 677
443 omap_mux_dbg_init(); 678 omap_mux_dbg_init();
@@ -462,8 +697,8 @@ static void __init omap_mux_package_fixup(struct omap_mux *p,
462 s++; 697 s++;
463 } 698 }
464 if (!found) 699 if (!found)
465 printk(KERN_ERR "mux: Unknown entry offset 0x%x\n", 700 pr_err("%s: Unknown entry offset 0x%x\n", __func__,
466 p->reg_offset); 701 p->reg_offset);
467 p++; 702 p++;
468 } 703 }
469} 704}
@@ -487,8 +722,8 @@ static void __init omap_mux_package_init_balls(struct omap_ball *b,
487 s++; 722 s++;
488 } 723 }
489 if (!found) 724 if (!found)
490 printk(KERN_ERR "mux: Unknown ball offset 0x%x\n", 725 pr_err("%s: Unknown ball offset 0x%x\n", __func__,
491 b->reg_offset); 726 b->reg_offset);
492 b++; 727 b++;
493 } 728 }
494} 729}
@@ -554,7 +789,7 @@ static void __init omap_mux_set_cmdline_signals(void)
554} 789}
555 790
556static int __init omap_mux_copy_names(struct omap_mux *src, 791static int __init omap_mux_copy_names(struct omap_mux *src,
557 struct omap_mux *dst) 792 struct omap_mux *dst)
558{ 793{
559 int i; 794 int i;
560 795
@@ -592,51 +827,63 @@ free:
592 827
593#endif /* CONFIG_OMAP_MUX */ 828#endif /* CONFIG_OMAP_MUX */
594 829
595static u16 omap_mux_get_by_gpio(int gpio) 830static struct omap_mux *omap_mux_get_by_gpio(
831 struct omap_mux_partition *partition,
832 int gpio)
596{ 833{
597 struct omap_mux_entry *e; 834 struct omap_mux_entry *e;
598 u16 offset = OMAP_MUX_TERMINATOR; 835 struct omap_mux *ret = NULL;
599 836
600 list_for_each_entry(e, &muxmodes, node) { 837 list_for_each_entry(e, &partition->muxmodes, node) {
601 struct omap_mux *m = &e->mux; 838 struct omap_mux *m = &e->mux;
602 if (m->gpio == gpio) { 839 if (m->gpio == gpio) {
603 offset = m->reg_offset; 840 ret = m;
604 break; 841 break;
605 } 842 }
606 } 843 }
607 844
608 return offset; 845 return ret;
609} 846}
610 847
611/* Needed for dynamic muxing of GPIO pins for off-idle */ 848/* Needed for dynamic muxing of GPIO pins for off-idle */
612u16 omap_mux_get_gpio(int gpio) 849u16 omap_mux_get_gpio(int gpio)
613{ 850{
614 u16 offset; 851 struct omap_mux_partition *partition;
852 struct omap_mux *m;
615 853
616 offset = omap_mux_get_by_gpio(gpio); 854 list_for_each_entry(partition, &mux_partitions, node) {
617 if (offset == OMAP_MUX_TERMINATOR) { 855 m = omap_mux_get_by_gpio(partition, gpio);
618 printk(KERN_ERR "mux: Could not get gpio%i\n", gpio); 856 if (m)
619 return offset; 857 return omap_mux_read(partition, m->reg_offset);
620 } 858 }
621 859
622 return omap_mux_read(offset); 860 if (!m || m->reg_offset == OMAP_MUX_TERMINATOR)
861 pr_err("%s: Could not get gpio%i\n", __func__, gpio);
862
863 return OMAP_MUX_TERMINATOR;
623} 864}
624 865
625/* Needed for dynamic muxing of GPIO pins for off-idle */ 866/* Needed for dynamic muxing of GPIO pins for off-idle */
626void omap_mux_set_gpio(u16 val, int gpio) 867void omap_mux_set_gpio(u16 val, int gpio)
627{ 868{
628 u16 offset; 869 struct omap_mux_partition *partition;
870 struct omap_mux *m = NULL;
629 871
630 offset = omap_mux_get_by_gpio(gpio); 872 list_for_each_entry(partition, &mux_partitions, node) {
631 if (offset == OMAP_MUX_TERMINATOR) { 873 m = omap_mux_get_by_gpio(partition, gpio);
632 printk(KERN_ERR "mux: Could not set gpio%i\n", gpio); 874 if (m) {
633 return; 875 omap_mux_write(partition, val, m->reg_offset);
876 return;
877 }
634 } 878 }
635 879
636 omap_mux_write(val, offset); 880 if (!m || m->reg_offset == OMAP_MUX_TERMINATOR)
881 pr_err("%s: Could not set gpio%i\n", __func__, gpio);
637} 882}
638 883
639static struct omap_mux * __init omap_mux_list_add(struct omap_mux *src) 884static struct omap_mux * __init omap_mux_list_add(
885 struct omap_mux_partition *partition,
886 struct omap_mux *src)
640{ 887{
641 struct omap_mux_entry *entry; 888 struct omap_mux_entry *entry;
642 struct omap_mux *m; 889 struct omap_mux *m;
@@ -656,7 +903,7 @@ static struct omap_mux * __init omap_mux_list_add(struct omap_mux *src)
656#endif 903#endif
657 904
658 mutex_lock(&muxmode_mutex); 905 mutex_lock(&muxmode_mutex);
659 list_add_tail(&entry->node, &muxmodes); 906 list_add_tail(&entry->node, &partition->muxmodes);
660 mutex_unlock(&muxmode_mutex); 907 mutex_unlock(&muxmode_mutex);
661 908
662 return m; 909 return m;
@@ -667,7 +914,8 @@ static struct omap_mux * __init omap_mux_list_add(struct omap_mux *src)
667 * the GPIO to mux offset mapping that is needed for dynamic muxing 914 * the GPIO to mux offset mapping that is needed for dynamic muxing
668 * of GPIO pins for off-idle. 915 * of GPIO pins for off-idle.
669 */ 916 */
670static void __init omap_mux_init_list(struct omap_mux *superset) 917static void __init omap_mux_init_list(struct omap_mux_partition *partition,
918 struct omap_mux *superset)
671{ 919{
672 while (superset->reg_offset != OMAP_MUX_TERMINATOR) { 920 while (superset->reg_offset != OMAP_MUX_TERMINATOR) {
673 struct omap_mux *entry; 921 struct omap_mux *entry;
@@ -679,15 +927,16 @@ static void __init omap_mux_init_list(struct omap_mux *superset)
679 } 927 }
680#else 928#else
681 /* Skip pins that are not muxed as GPIO by bootloader */ 929 /* Skip pins that are not muxed as GPIO by bootloader */
682 if (!OMAP_MODE_GPIO(omap_mux_read(superset->reg_offset))) { 930 if (!OMAP_MODE_GPIO(omap_mux_read(partition,
931 superset->reg_offset))) {
683 superset++; 932 superset++;
684 continue; 933 continue;
685 } 934 }
686#endif 935#endif
687 936
688 entry = omap_mux_list_add(superset); 937 entry = omap_mux_list_add(partition, superset);
689 if (!entry) { 938 if (!entry) {
690 printk(KERN_ERR "mux: Could not add entry\n"); 939 pr_err("%s: Could not add entry\n", __func__);
691 return; 940 return;
692 } 941 }
693 superset++; 942 superset++;
@@ -706,10 +955,11 @@ static void omap_mux_init_package(struct omap_mux *superset,
706 omap_mux_package_init_balls(package_balls, superset); 955 omap_mux_package_init_balls(package_balls, superset);
707} 956}
708 957
709static void omap_mux_init_signals(struct omap_board_mux *board_mux) 958static void omap_mux_init_signals(struct omap_mux_partition *partition,
959 struct omap_board_mux *board_mux)
710{ 960{
711 omap_mux_set_cmdline_signals(); 961 omap_mux_set_cmdline_signals();
712 omap_mux_write_array(board_mux); 962 omap_mux_write_array(partition, board_mux);
713} 963}
714 964
715#else 965#else
@@ -720,34 +970,49 @@ static void omap_mux_init_package(struct omap_mux *superset,
720{ 970{
721} 971}
722 972
723static void omap_mux_init_signals(struct omap_board_mux *board_mux) 973static void omap_mux_init_signals(struct omap_mux_partition *partition,
974 struct omap_board_mux *board_mux)
724{ 975{
725} 976}
726 977
727#endif 978#endif
728 979
729int __init omap_mux_init(u32 mux_pbase, u32 mux_size, 980static u32 mux_partitions_cnt;
730 struct omap_mux *superset,
731 struct omap_mux *package_subset,
732 struct omap_board_mux *board_mux,
733 struct omap_ball *package_balls)
734{
735 if (mux_base)
736 return -EBUSY;
737 981
738 mux_phys = mux_pbase; 982int __init omap_mux_init(const char *name, u32 flags,
739 mux_base = ioremap(mux_pbase, mux_size); 983 u32 mux_pbase, u32 mux_size,
740 if (!mux_base) { 984 struct omap_mux *superset,
741 printk(KERN_ERR "mux: Could not ioremap\n"); 985 struct omap_mux *package_subset,
986 struct omap_board_mux *board_mux,
987 struct omap_ball *package_balls)
988{
989 struct omap_mux_partition *partition;
990
991 partition = kzalloc(sizeof(struct omap_mux_partition), GFP_KERNEL);
992 if (!partition)
993 return -ENOMEM;
994
995 partition->name = name;
996 partition->flags = flags;
997 partition->size = mux_size;
998 partition->phys = mux_pbase;
999 partition->base = ioremap(mux_pbase, mux_size);
1000 if (!partition->base) {
1001 pr_err("%s: Could not ioremap mux partition at 0x%08x\n",
1002 __func__, partition->phys);
742 return -ENODEV; 1003 return -ENODEV;
743 } 1004 }
744 1005
745 if (cpu_is_omap24xx()) 1006 INIT_LIST_HEAD(&partition->muxmodes);
746 omap_mux_flags = MUXABLE_GPIO_MODE3; 1007
1008 list_add_tail(&partition->node, &mux_partitions);
1009 mux_partitions_cnt++;
1010 pr_info("%s: Add partition: #%d: %s, flags: %x\n", __func__,
1011 mux_partitions_cnt, partition->name, partition->flags);
747 1012
748 omap_mux_init_package(superset, package_subset, package_balls); 1013 omap_mux_init_package(superset, package_subset, package_balls);
749 omap_mux_init_list(superset); 1014 omap_mux_init_list(partition, superset);
750 omap_mux_init_signals(board_mux); 1015 omap_mux_init_signals(partition, board_mux);
751 1016
752 return 0; 1017 return 0;
753} 1018}
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 350c04f27383..a4ab17a737a6 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Nokia 2 * Copyright (C) 2009 Nokia
3 * Copyright (C) 2009 Texas Instruments 3 * Copyright (C) 2009-2010 Texas Instruments
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 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 6 * it under the terms of the GNU General Public License version 2 as
@@ -10,6 +10,7 @@
10#include "mux2420.h" 10#include "mux2420.h"
11#include "mux2430.h" 11#include "mux2430.h"
12#include "mux34xx.h" 12#include "mux34xx.h"
13#include "mux44xx.h"
13 14
14#define OMAP_MUX_TERMINATOR 0xffff 15#define OMAP_MUX_TERMINATOR 0xffff
15 16
@@ -37,6 +38,9 @@
37#define OMAP_OFF_PULL_UP (1 << 13) 38#define OMAP_OFF_PULL_UP (1 << 13)
38#define OMAP_WAKEUP_EN (1 << 14) 39#define OMAP_WAKEUP_EN (1 << 14)
39 40
41/* 44xx specific mux bit defines */
42#define OMAP_WAKEUP_EVENT (1 << 15)
43
40/* Active pin states */ 44/* Active pin states */
41#define OMAP_PIN_OUTPUT 0 45#define OMAP_PIN_OUTPUT 0
42#define OMAP_PIN_INPUT OMAP_INPUT_EN 46#define OMAP_PIN_INPUT OMAP_INPUT_EN
@@ -56,8 +60,10 @@
56 60
57#define OMAP_MODE_GPIO(x) (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE4) 61#define OMAP_MODE_GPIO(x) (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE4)
58 62
59/* Flags for omap_mux_init */ 63/* Flags for omapX_mux_init */
60#define OMAP_PACKAGE_MASK 0xffff 64#define OMAP_PACKAGE_MASK 0xffff
65#define OMAP_PACKAGE_CBS 8 /* 547-pin 0.40 0.40 */
66#define OMAP_PACKAGE_CBL 7 /* 547-pin 0.40 0.40 */
61#define OMAP_PACKAGE_CBP 6 /* 515-pin 0.40 0.50 */ 67#define OMAP_PACKAGE_CBP 6 /* 515-pin 0.40 0.50 */
62#define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */ 68#define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */
63#define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */ 69#define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */
@@ -66,14 +72,61 @@
66#define OMAP_PACKAGE_ZAF 1 /* 2420 447-pin SIP */ 72#define OMAP_PACKAGE_ZAF 1 /* 2420 447-pin SIP */
67 73
68 74
69#define OMAP_MUX_NR_MODES 8 /* Available modes */ 75#define OMAP_MUX_NR_MODES 8 /* Available modes */
70#define OMAP_MUX_NR_SIDES 2 /* Bottom & top */ 76#define OMAP_MUX_NR_SIDES 2 /* Bottom & top */
77
78/*
79 * omap_mux_init flags definition:
80 *
81 * OMAP_MUX_REG_8BIT: Ensure that access to padconf is done in 8 bits.
82 * The default value is 16 bits.
83 * OMAP_MUX_GPIO_IN_MODE3: The GPIO is selected in mode3.
84 * The default is mode4.
85 */
86#define OMAP_MUX_REG_8BIT (1 << 0)
87#define OMAP_MUX_GPIO_IN_MODE3 (1 << 1)
88
89/**
90 * struct omap_board_data - board specific device data
91 * @id: instance id
92 * @flags: additional flags for platform init code
93 * @pads: array of device specific pads
94 * @pads_cnt: ARRAY_SIZE() of pads
95 */
96struct omap_board_data {
97 int id;
98 u32 flags;
99 struct omap_device_pad *pads;
100 int pads_cnt;
101};
102
103/**
104 * struct mux_partition - contain partition related information
105 * @name: name of the current partition
106 * @flags: flags specific to this partition
107 * @phys: physical address
108 * @size: partition size
109 * @base: virtual address after ioremap
110 * @muxmodes: list of nodes that belong to a partition
111 * @node: list node for the partitions linked list
112 */
113struct omap_mux_partition {
114 const char *name;
115 u32 flags;
116 u32 phys;
117 u32 size;
118 void __iomem *base;
119 struct list_head muxmodes;
120 struct list_head node;
121};
71 122
72/** 123/**
73 * struct omap_mux - data for omap mux register offset and it's value 124 * struct omap_mux - data for omap mux register offset and it's value
74 * @reg_offset: mux register offset from the mux base 125 * @reg_offset: mux register offset from the mux base
75 * @gpio: GPIO number 126 * @gpio: GPIO number
76 * @muxnames: available signal modes for a ball 127 * @muxnames: available signal modes for a ball
128 * @balls: available balls on the package
129 * @partition: mux partition
77 */ 130 */
78struct omap_mux { 131struct omap_mux {
79 u16 reg_offset; 132 u16 reg_offset;
@@ -106,6 +159,34 @@ struct omap_board_mux {
106 u16 value; 159 u16 value;
107}; 160};
108 161
162#define OMAP_DEVICE_PAD_ENABLED BIT(7) /* Not needed for board-*.c */
163#define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad,
164 needs enable, idle and off
165 values */
166#define OMAP_DEVICE_PAD_WAKEUP BIT(0) /* Pad is wake-up capable */
167
168/**
169 * struct omap_device_pad - device specific pad configuration
170 * @name: signal name
171 * @flags: pad specific runtime flags
172 * @enable: runtime value for a pad
173 * @idle: idle value for a pad
174 * @off: off value for a pad, defaults to safe mode
175 * @partition: mux partition
176 * @mux: mux register
177 */
178struct omap_device_pad {
179 char *name;
180 u8 flags;
181 u16 enable;
182 u16 idle;
183 u16 off;
184 struct omap_mux_partition *partition;
185 struct omap_mux *mux;
186};
187
188struct omap_hwmod_mux_info;
189
109#if defined(CONFIG_OMAP_MUX) 190#if defined(CONFIG_OMAP_MUX)
110 191
111/** 192/**
@@ -122,6 +203,23 @@ int omap_mux_init_gpio(int gpio, int val);
122 */ 203 */
123int omap_mux_init_signal(const char *muxname, int val); 204int omap_mux_init_signal(const char *muxname, int val);
124 205
206/**
207 * omap_hwmod_mux_init - initialize hwmod specific mux data
208 * @bpads: Board specific device signal names
209 * @nr_pads: Number of signal names for the device
210 */
211extern struct omap_hwmod_mux_info *
212omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads);
213
214/**
215 * omap_hwmod_mux - omap hwmod specific pin muxing
216 * @hmux: Pads for a hwmod
217 * @state: Desired _HWMOD_STATE
218 *
219 * Called only from omap_hwmod.c, do not use.
220 */
221void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state);
222
125#else 223#else
126 224
127static inline int omap_mux_init_gpio(int gpio, int val) 225static inline int omap_mux_init_gpio(int gpio, int val)
@@ -133,6 +231,18 @@ static inline int omap_mux_init_signal(char *muxname, int val)
133 return 0; 231 return 0;
134} 232}
135 233
234static inline struct omap_hwmod_mux_info *
235omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads)
236{
237 return NULL;
238}
239
240static inline void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
241{
242}
243
244static struct omap_board_mux *board_mux __initdata __maybe_unused;
245
136#endif 246#endif
137 247
138/** 248/**
@@ -151,28 +261,39 @@ u16 omap_mux_get_gpio(int gpio);
151void omap_mux_set_gpio(u16 val, int gpio); 261void omap_mux_set_gpio(u16 val, int gpio);
152 262
153/** 263/**
264 * omap_mux_get() - get a mux partition by name
265 * @name: Name of the mux partition
266 *
267 */
268struct omap_mux_partition *omap_mux_get(const char *name);
269
270/**
154 * omap_mux_read() - read mux register 271 * omap_mux_read() - read mux register
272 * @partition: Mux partition
155 * @mux_offset: Offset of the mux register 273 * @mux_offset: Offset of the mux register
156 * 274 *
157 */ 275 */
158u16 omap_mux_read(u16 mux_offset); 276u16 omap_mux_read(struct omap_mux_partition *p, u16 mux_offset);
159 277
160/** 278/**
161 * omap_mux_write() - write mux register 279 * omap_mux_write() - write mux register
280 * @partition: Mux partition
162 * @val: New mux register value 281 * @val: New mux register value
163 * @mux_offset: Offset of the mux register 282 * @mux_offset: Offset of the mux register
164 * 283 *
165 * This should be only needed for dynamic remuxing of non-gpio signals. 284 * This should be only needed for dynamic remuxing of non-gpio signals.
166 */ 285 */
167void omap_mux_write(u16 val, u16 mux_offset); 286void omap_mux_write(struct omap_mux_partition *p, u16 val, u16 mux_offset);
168 287
169/** 288/**
170 * omap_mux_write_array() - write an array of mux registers 289 * omap_mux_write_array() - write an array of mux registers
290 * @partition: Mux partition
171 * @board_mux: Array of mux registers terminated by MAP_MUX_TERMINATOR 291 * @board_mux: Array of mux registers terminated by MAP_MUX_TERMINATOR
172 * 292 *
173 * This should be only needed for dynamic remuxing of non-gpio signals. 293 * This should be only needed for dynamic remuxing of non-gpio signals.
174 */ 294 */
175void omap_mux_write_array(struct omap_board_mux *board_mux); 295void omap_mux_write_array(struct omap_mux_partition *p,
296 struct omap_board_mux *board_mux);
176 297
177/** 298/**
178 * omap2420_mux_init() - initialize mux system with board specific set 299 * omap2420_mux_init() - initialize mux system with board specific set
@@ -196,10 +317,19 @@ int omap2430_mux_init(struct omap_board_mux *board_mux, int flags);
196int omap3_mux_init(struct omap_board_mux *board_mux, int flags); 317int omap3_mux_init(struct omap_board_mux *board_mux, int flags);
197 318
198/** 319/**
320 * omap4_mux_init() - initialize mux system with board specific set
321 * @board_mux: Board specific mux table
322 * @flags: OMAP package type used for the board
323 */
324int omap4_mux_init(struct omap_board_mux *board_mux, int flags);
325
326/**
199 * omap_mux_init - private mux init function, do not call 327 * omap_mux_init - private mux init function, do not call
200 */ 328 */
201int omap_mux_init(u32 mux_pbase, u32 mux_size, 329int omap_mux_init(const char *name, u32 flags,
202 struct omap_mux *superset, 330 u32 mux_pbase, u32 mux_size,
203 struct omap_mux *package_subset, 331 struct omap_mux *superset,
204 struct omap_board_mux *board_mux, 332 struct omap_mux *package_subset,
205 struct omap_ball *package_balls); 333 struct omap_board_mux *board_mux,
334 struct omap_ball *package_balls);
335
diff --git a/arch/arm/mach-omap2/mux2420.c b/arch/arm/mach-omap2/mux2420.c
index 414af5434456..cf6de0971c6c 100644
--- a/arch/arm/mach-omap2/mux2420.c
+++ b/arch/arm/mach-omap2/mux2420.c
@@ -678,11 +678,13 @@ int __init omap2420_mux_init(struct omap_board_mux *board_subset, int flags)
678 case OMAP_PACKAGE_ZAF: 678 case OMAP_PACKAGE_ZAF:
679 /* REVISIT: Please add data */ 679 /* REVISIT: Please add data */
680 default: 680 default:
681 pr_warning("mux: No ball data available for omap2420 package\n"); 681 pr_warning("%s: No ball data available for omap2420 package\n",
682 __func__);
682 } 683 }
683 684
684 return omap_mux_init(OMAP2420_CONTROL_PADCONF_MUX_PBASE, 685 return omap_mux_init("core", OMAP_MUX_REG_8BIT | OMAP_MUX_GPIO_IN_MODE3,
686 OMAP2420_CONTROL_PADCONF_MUX_PBASE,
685 OMAP2420_CONTROL_PADCONF_MUX_SIZE, 687 OMAP2420_CONTROL_PADCONF_MUX_SIZE,
686 omap2420_muxmodes, NULL, board_subset, 688 omap2420_muxmodes, NULL, board_subset,
687 package_balls); 689 package_balls);
688} 690}
diff --git a/arch/arm/mach-omap2/mux2430.c b/arch/arm/mach-omap2/mux2430.c
index 84d2c5a7ecd7..4185f92553db 100644
--- a/arch/arm/mach-omap2/mux2430.c
+++ b/arch/arm/mach-omap2/mux2430.c
@@ -781,11 +781,13 @@ int __init omap2430_mux_init(struct omap_board_mux *board_subset, int flags)
781 package_balls = omap2430_pop_ball; 781 package_balls = omap2430_pop_ball;
782 break; 782 break;
783 default: 783 default:
784 pr_warning("mux: No ball data available for omap2420 package\n"); 784 pr_warning("%s: No ball data available for omap2420 package\n",
785 __func__);
785 } 786 }
786 787
787 return omap_mux_init(OMAP2430_CONTROL_PADCONF_MUX_PBASE, 788 return omap_mux_init("core", OMAP_MUX_REG_8BIT | OMAP_MUX_GPIO_IN_MODE3,
789 OMAP2430_CONTROL_PADCONF_MUX_PBASE,
788 OMAP2430_CONTROL_PADCONF_MUX_SIZE, 790 OMAP2430_CONTROL_PADCONF_MUX_SIZE,
789 omap2430_muxmodes, NULL, board_subset, 791 omap2430_muxmodes, NULL, board_subset,
790 package_balls); 792 package_balls);
791} 793}
diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c
index 574e54ea3ab7..440c98e9a510 100644
--- a/arch/arm/mach-omap2/mux34xx.c
+++ b/arch/arm/mach-omap2/mux34xx.c
@@ -2049,12 +2049,13 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)
2049 package_balls = omap36xx_cbp_ball; 2049 package_balls = omap36xx_cbp_ball;
2050 break; 2050 break;
2051 default: 2051 default:
2052 printk(KERN_ERR "mux: Unknown omap package, mux disabled\n"); 2052 pr_err("%s Unknown omap package, mux disabled\n", __func__);
2053 return -EINVAL; 2053 return -EINVAL;
2054 } 2054 }
2055 2055
2056 return omap_mux_init(OMAP3_CONTROL_PADCONF_MUX_PBASE, 2056 return omap_mux_init("core", 0,
2057 OMAP3_CONTROL_PADCONF_MUX_PBASE,
2057 OMAP3_CONTROL_PADCONF_MUX_SIZE, 2058 OMAP3_CONTROL_PADCONF_MUX_SIZE,
2058 omap3_muxmodes, package_subset, board_subset, 2059 omap3_muxmodes, package_subset, board_subset,
2059 package_balls); 2060 package_balls);
2060} 2061}
diff --git a/arch/arm/mach-omap2/mux44xx.c b/arch/arm/mach-omap2/mux44xx.c
new file mode 100644
index 000000000000..980f11d45c79
--- /dev/null
+++ b/arch/arm/mach-omap2/mux44xx.c
@@ -0,0 +1,1625 @@
1/*
2 * OMAP44xx ES1.0 pin mux definition
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 *
6 * Benoit Cousson (b-cousson@ti.com)
7 *
8 * - Based on mux34xx.c done by Tony Lindgren <tony@atomide.com>
9 *
10 * This file is automatically generated from the OMAP hardware databases.
11 * We respectfully ask that any modifications to this file be coordinated
12 * with the public linux-omap@vger.kernel.org mailing list and the
13 * authors above to ensure that the autogeneration scripts are kept
14 * up-to-date with the file contents.
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#include <linux/module.h>
21#include <linux/init.h>
22
23#include "mux.h"
24
25#ifdef CONFIG_OMAP_MUX
26
27#define _OMAP4_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
28{ \
29 .reg_offset = (OMAP4_CTRL_MODULE_PAD_##M0##_OFFSET), \
30 .gpio = (g), \
31 .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \
32}
33
34#else
35
36#define _OMAP4_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
37{ \
38 .reg_offset = (OMAP4_CTRL_MODULE_PAD_##M0##_OFFSET), \
39 .gpio = (g), \
40}
41
42#endif
43
44#define _OMAP4_BALLENTRY(M0, bb, bt) \
45{ \
46 .reg_offset = (OMAP4_CTRL_MODULE_PAD_##M0##_OFFSET), \
47 .balls = { bb, bt }, \
48}
49
50/*
51 * Superset of all mux modes for omap4 ES1.0
52 */
53static struct omap_mux __initdata omap4_core_muxmodes[] = {
54 _OMAP4_MUXENTRY(GPMC_AD0, 0, "gpmc_ad0", "sdmmc2_dat0", NULL, NULL,
55 NULL, NULL, NULL, NULL),
56 _OMAP4_MUXENTRY(GPMC_AD1, 0, "gpmc_ad1", "sdmmc2_dat1", NULL, NULL,
57 NULL, NULL, NULL, NULL),
58 _OMAP4_MUXENTRY(GPMC_AD2, 0, "gpmc_ad2", "sdmmc2_dat2", NULL, NULL,
59 NULL, NULL, NULL, NULL),
60 _OMAP4_MUXENTRY(GPMC_AD3, 0, "gpmc_ad3", "sdmmc2_dat3", NULL, NULL,
61 NULL, NULL, NULL, NULL),
62 _OMAP4_MUXENTRY(GPMC_AD4, 0, "gpmc_ad4", "sdmmc2_dat4",
63 "sdmmc2_dir_dat0", NULL, NULL, NULL, NULL, NULL),
64 _OMAP4_MUXENTRY(GPMC_AD5, 0, "gpmc_ad5", "sdmmc2_dat5",
65 "sdmmc2_dir_dat1", NULL, NULL, NULL, NULL, NULL),
66 _OMAP4_MUXENTRY(GPMC_AD6, 0, "gpmc_ad6", "sdmmc2_dat6",
67 "sdmmc2_dir_cmd", NULL, NULL, NULL, NULL, NULL),
68 _OMAP4_MUXENTRY(GPMC_AD7, 0, "gpmc_ad7", "sdmmc2_dat7",
69 "sdmmc2_clk_fdbk", NULL, NULL, NULL, NULL, NULL),
70 _OMAP4_MUXENTRY(GPMC_AD8, 32, "gpmc_ad8", "kpd_row0", "c2c_data15",
71 "gpio_32", NULL, NULL, NULL, NULL),
72 _OMAP4_MUXENTRY(GPMC_AD9, 33, "gpmc_ad9", "kpd_row1", "c2c_data14",
73 "gpio_33", NULL, NULL, NULL, NULL),
74 _OMAP4_MUXENTRY(GPMC_AD10, 34, "gpmc_ad10", "kpd_row2", "c2c_data13",
75 "gpio_34", NULL, NULL, NULL, NULL),
76 _OMAP4_MUXENTRY(GPMC_AD11, 35, "gpmc_ad11", "kpd_row3", "c2c_data12",
77 "gpio_35", NULL, NULL, NULL, NULL),
78 _OMAP4_MUXENTRY(GPMC_AD12, 36, "gpmc_ad12", "kpd_col0", "c2c_data11",
79 "gpio_36", NULL, NULL, NULL, NULL),
80 _OMAP4_MUXENTRY(GPMC_AD13, 37, "gpmc_ad13", "kpd_col1", "c2c_data10",
81 "gpio_37", NULL, NULL, NULL, NULL),
82 _OMAP4_MUXENTRY(GPMC_AD14, 38, "gpmc_ad14", "kpd_col2", "c2c_data9",
83 "gpio_38", NULL, NULL, NULL, NULL),
84 _OMAP4_MUXENTRY(GPMC_AD15, 39, "gpmc_ad15", "kpd_col3", "c2c_data8",
85 "gpio_39", NULL, NULL, NULL, NULL),
86 _OMAP4_MUXENTRY(GPMC_A16, 40, "gpmc_a16", "kpd_row4", "c2c_datain0",
87 "gpio_40", "venc_656_data0", NULL, NULL, NULL),
88 _OMAP4_MUXENTRY(GPMC_A17, 41, "gpmc_a17", "kpd_row5", "c2c_datain1",
89 "gpio_41", "venc_656_data1", NULL, NULL, "safe_mode"),
90 _OMAP4_MUXENTRY(GPMC_A18, 42, "gpmc_a18", "kpd_row6", "c2c_datain2",
91 "gpio_42", "venc_656_data2", NULL, NULL, "safe_mode"),
92 _OMAP4_MUXENTRY(GPMC_A19, 43, "gpmc_a19", "kpd_row7", "c2c_datain3",
93 "gpio_43", "venc_656_data3", NULL, NULL, "safe_mode"),
94 _OMAP4_MUXENTRY(GPMC_A20, 44, "gpmc_a20", "kpd_col4", "c2c_datain4",
95 "gpio_44", "venc_656_data4", NULL, NULL, "safe_mode"),
96 _OMAP4_MUXENTRY(GPMC_A21, 45, "gpmc_a21", "kpd_col5", "c2c_datain5",
97 "gpio_45", "venc_656_data5", NULL, NULL, "safe_mode"),
98 _OMAP4_MUXENTRY(GPMC_A22, 46, "gpmc_a22", "kpd_col6", "c2c_datain6",
99 "gpio_46", "venc_656_data6", NULL, NULL, "safe_mode"),
100 _OMAP4_MUXENTRY(GPMC_A23, 47, "gpmc_a23", "kpd_col7", "c2c_datain7",
101 "gpio_47", "venc_656_data7", NULL, NULL, "safe_mode"),
102 _OMAP4_MUXENTRY(GPMC_A24, 48, "gpmc_a24", NULL, "c2c_clkout0",
103 "gpio_48", NULL, NULL, NULL, "safe_mode"),
104 _OMAP4_MUXENTRY(GPMC_A25, 49, "gpmc_a25", NULL, "c2c_clkout1",
105 "gpio_49", NULL, NULL, NULL, "safe_mode"),
106 _OMAP4_MUXENTRY(GPMC_NCS0, 50, "gpmc_ncs0", NULL, NULL, "gpio_50",
107 "sys_ndmareq0", NULL, NULL, NULL),
108 _OMAP4_MUXENTRY(GPMC_NCS1, 51, "gpmc_ncs1", NULL, "c2c_dataout6",
109 "gpio_51", NULL, NULL, NULL, "safe_mode"),
110 _OMAP4_MUXENTRY(GPMC_NCS2, 52, "gpmc_ncs2", NULL, "c2c_dataout7",
111 "gpio_52", NULL, NULL, NULL, "safe_mode"),
112 _OMAP4_MUXENTRY(GPMC_NCS3, 53, "gpmc_ncs3", "gpmc_dir",
113 "c2c_dataout4", "gpio_53", NULL, NULL, NULL,
114 "safe_mode"),
115 _OMAP4_MUXENTRY(GPMC_NWP, 54, "gpmc_nwp", "dsi1_te0", NULL, "gpio_54",
116 "sys_ndmareq1", NULL, NULL, NULL),
117 _OMAP4_MUXENTRY(GPMC_CLK, 55, "gpmc_clk", NULL, NULL, "gpio_55",
118 "sys_ndmareq2", NULL, NULL, NULL),
119 _OMAP4_MUXENTRY(GPMC_NADV_ALE, 56, "gpmc_nadv_ale", "dsi1_te1", NULL,
120 "gpio_56", "sys_ndmareq3", NULL, NULL, NULL),
121 _OMAP4_MUXENTRY(GPMC_NOE, 0, "gpmc_noe", "sdmmc2_clk", NULL, NULL,
122 NULL, NULL, NULL, NULL),
123 _OMAP4_MUXENTRY(GPMC_NWE, 0, "gpmc_nwe", "sdmmc2_cmd", NULL, NULL,
124 NULL, NULL, NULL, NULL),
125 _OMAP4_MUXENTRY(GPMC_NBE0_CLE, 59, "gpmc_nbe0_cle", "dsi2_te0", NULL,
126 "gpio_59", NULL, NULL, NULL, NULL),
127 _OMAP4_MUXENTRY(GPMC_NBE1, 60, "gpmc_nbe1", NULL, "c2c_dataout5",
128 "gpio_60", NULL, NULL, NULL, "safe_mode"),
129 _OMAP4_MUXENTRY(GPMC_WAIT0, 61, "gpmc_wait0", "dsi2_te1", NULL,
130 "gpio_61", NULL, NULL, NULL, NULL),
131 _OMAP4_MUXENTRY(GPMC_WAIT1, 62, "gpmc_wait1", NULL, "c2c_dataout2",
132 "gpio_62", NULL, NULL, NULL, "safe_mode"),
133 _OMAP4_MUXENTRY(C2C_DATA11, 100, "c2c_data11", "usbc1_icusb_txen",
134 "c2c_dataout3", "gpio_100", "sys_ndmareq0", NULL,
135 NULL, "safe_mode"),
136 _OMAP4_MUXENTRY(C2C_DATA12, 101, "c2c_data12", "dsi1_te0",
137 "c2c_clkin0", "gpio_101", "sys_ndmareq1", NULL, NULL,
138 "safe_mode"),
139 _OMAP4_MUXENTRY(C2C_DATA13, 102, "c2c_data13", "dsi1_te1",
140 "c2c_clkin1", "gpio_102", "sys_ndmareq2", NULL, NULL,
141 "safe_mode"),
142 _OMAP4_MUXENTRY(C2C_DATA14, 103, "c2c_data14", "dsi2_te0",
143 "c2c_dataout0", "gpio_103", "sys_ndmareq3", NULL,
144 NULL, "safe_mode"),
145 _OMAP4_MUXENTRY(C2C_DATA15, 104, "c2c_data15", "dsi2_te1",
146 "c2c_dataout1", "gpio_104", NULL, NULL, NULL,
147 "safe_mode"),
148 _OMAP4_MUXENTRY(HDMI_HPD, 63, "hdmi_hpd", NULL, NULL, "gpio_63", NULL,
149 NULL, NULL, "safe_mode"),
150 _OMAP4_MUXENTRY(HDMI_CEC, 64, "hdmi_cec", NULL, NULL, "gpio_64", NULL,
151 NULL, NULL, "safe_mode"),
152 _OMAP4_MUXENTRY(HDMI_DDC_SCL, 65, "hdmi_ddc_scl", NULL, NULL,
153 "gpio_65", NULL, NULL, NULL, "safe_mode"),
154 _OMAP4_MUXENTRY(HDMI_DDC_SDA, 66, "hdmi_ddc_sda", NULL, NULL,
155 "gpio_66", NULL, NULL, NULL, "safe_mode"),
156 _OMAP4_MUXENTRY(CSI21_DX0, 0, "csi21_dx0", NULL, NULL, "gpi_67", NULL,
157 NULL, NULL, "safe_mode"),
158 _OMAP4_MUXENTRY(CSI21_DY0, 0, "csi21_dy0", NULL, NULL, "gpi_68", NULL,
159 NULL, NULL, "safe_mode"),
160 _OMAP4_MUXENTRY(CSI21_DX1, 0, "csi21_dx1", NULL, NULL, "gpi_69", NULL,
161 NULL, NULL, "safe_mode"),
162 _OMAP4_MUXENTRY(CSI21_DY1, 0, "csi21_dy1", NULL, NULL, "gpi_70", NULL,
163 NULL, NULL, "safe_mode"),
164 _OMAP4_MUXENTRY(CSI21_DX2, 0, "csi21_dx2", NULL, NULL, "gpi_71", NULL,
165 NULL, NULL, "safe_mode"),
166 _OMAP4_MUXENTRY(CSI21_DY2, 0, "csi21_dy2", NULL, NULL, "gpi_72", NULL,
167 NULL, NULL, "safe_mode"),
168 _OMAP4_MUXENTRY(CSI21_DX3, 0, "csi21_dx3", NULL, NULL, "gpi_73", NULL,
169 NULL, NULL, "safe_mode"),
170 _OMAP4_MUXENTRY(CSI21_DY3, 0, "csi21_dy3", NULL, NULL, "gpi_74", NULL,
171 NULL, NULL, "safe_mode"),
172 _OMAP4_MUXENTRY(CSI21_DX4, 0, "csi21_dx4", NULL, NULL, "gpi_75", NULL,
173 NULL, NULL, "safe_mode"),
174 _OMAP4_MUXENTRY(CSI21_DY4, 0, "csi21_dy4", NULL, NULL, "gpi_76", NULL,
175 NULL, NULL, "safe_mode"),
176 _OMAP4_MUXENTRY(CSI22_DX0, 0, "csi22_dx0", NULL, NULL, "gpi_77", NULL,
177 NULL, NULL, "safe_mode"),
178 _OMAP4_MUXENTRY(CSI22_DY0, 0, "csi22_dy0", NULL, NULL, "gpi_78", NULL,
179 NULL, NULL, "safe_mode"),
180 _OMAP4_MUXENTRY(CSI22_DX1, 0, "csi22_dx1", NULL, NULL, "gpi_79", NULL,
181 NULL, NULL, "safe_mode"),
182 _OMAP4_MUXENTRY(CSI22_DY1, 0, "csi22_dy1", NULL, NULL, "gpi_80", NULL,
183 NULL, NULL, "safe_mode"),
184 _OMAP4_MUXENTRY(CAM_SHUTTER, 81, "cam_shutter", NULL, NULL, "gpio_81",
185 NULL, NULL, NULL, "safe_mode"),
186 _OMAP4_MUXENTRY(CAM_STROBE, 82, "cam_strobe", NULL, NULL, "gpio_82",
187 NULL, NULL, NULL, "safe_mode"),
188 _OMAP4_MUXENTRY(CAM_GLOBALRESET, 83, "cam_globalreset", NULL, NULL,
189 "gpio_83", NULL, NULL, NULL, "safe_mode"),
190 _OMAP4_MUXENTRY(USBB1_ULPITLL_CLK, 84, "usbb1_ulpitll_clk",
191 "hsi1_cawake", NULL, "gpio_84", "usbb1_ulpiphy_clk",
192 NULL, "hw_dbg20", "safe_mode"),
193 _OMAP4_MUXENTRY(USBB1_ULPITLL_STP, 85, "usbb1_ulpitll_stp",
194 "hsi1_cadata", "mcbsp4_clkr", "gpio_85",
195 "usbb1_ulpiphy_stp", "usbb1_mm_rxdp", "hw_dbg21",
196 "safe_mode"),
197 _OMAP4_MUXENTRY(USBB1_ULPITLL_DIR, 86, "usbb1_ulpitll_dir",
198 "hsi1_caflag", "mcbsp4_fsr", "gpio_86",
199 "usbb1_ulpiphy_dir", NULL, "hw_dbg22", "safe_mode"),
200 _OMAP4_MUXENTRY(USBB1_ULPITLL_NXT, 87, "usbb1_ulpitll_nxt",
201 "hsi1_acready", "mcbsp4_fsx", "gpio_87",
202 "usbb1_ulpiphy_nxt", "usbb1_mm_rxdm", "hw_dbg23",
203 "safe_mode"),
204 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT0, 88, "usbb1_ulpitll_dat0",
205 "hsi1_acwake", "mcbsp4_clkx", "gpio_88",
206 "usbb1_ulpiphy_dat0", "usbb1_mm_rxrcv", "hw_dbg24",
207 "safe_mode"),
208 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT1, 89, "usbb1_ulpitll_dat1",
209 "hsi1_acdata", "mcbsp4_dx", "gpio_89",
210 "usbb1_ulpiphy_dat1", "usbb1_mm_txse0", "hw_dbg25",
211 "safe_mode"),
212 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT2, 90, "usbb1_ulpitll_dat2",
213 "hsi1_acflag", "mcbsp4_dr", "gpio_90",
214 "usbb1_ulpiphy_dat2", "usbb1_mm_txdat", "hw_dbg26",
215 "safe_mode"),
216 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT3, 91, "usbb1_ulpitll_dat3",
217 "hsi1_caready", NULL, "gpio_91", "usbb1_ulpiphy_dat3",
218 "usbb1_mm_txen", "hw_dbg27", "safe_mode"),
219 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT4, 92, "usbb1_ulpitll_dat4",
220 "dmtimer8_pwm_evt", "abe_mcbsp3_dr", "gpio_92",
221 "usbb1_ulpiphy_dat4", NULL, "hw_dbg28", "safe_mode"),
222 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT5, 93, "usbb1_ulpitll_dat5",
223 "dmtimer9_pwm_evt", "abe_mcbsp3_dx", "gpio_93",
224 "usbb1_ulpiphy_dat5", NULL, "hw_dbg29", "safe_mode"),
225 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT6, 94, "usbb1_ulpitll_dat6",
226 "dmtimer10_pwm_evt", "abe_mcbsp3_clkx", "gpio_94",
227 "usbb1_ulpiphy_dat6", "abe_dmic_din3", "hw_dbg30",
228 "safe_mode"),
229 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT7, 95, "usbb1_ulpitll_dat7",
230 "dmtimer11_pwm_evt", "abe_mcbsp3_fsx", "gpio_95",
231 "usbb1_ulpiphy_dat7", "abe_dmic_clk3", "hw_dbg31",
232 "safe_mode"),
233 _OMAP4_MUXENTRY(USBB1_HSIC_DATA, 96, "usbb1_hsic_data", NULL, NULL,
234 "gpio_96", NULL, NULL, NULL, "safe_mode"),
235 _OMAP4_MUXENTRY(USBB1_HSIC_STROBE, 97, "usbb1_hsic_strobe", NULL,
236 NULL, "gpio_97", NULL, NULL, NULL, "safe_mode"),
237 _OMAP4_MUXENTRY(USBC1_ICUSB_DP, 98, "usbc1_icusb_dp", NULL, NULL,
238 "gpio_98", NULL, NULL, NULL, "safe_mode"),
239 _OMAP4_MUXENTRY(USBC1_ICUSB_DM, 99, "usbc1_icusb_dm", NULL, NULL,
240 "gpio_99", NULL, NULL, NULL, "safe_mode"),
241 _OMAP4_MUXENTRY(SDMMC1_CLK, 100, "sdmmc1_clk", NULL, "dpm_emu19",
242 "gpio_100", NULL, NULL, NULL, "safe_mode"),
243 _OMAP4_MUXENTRY(SDMMC1_CMD, 101, "sdmmc1_cmd", NULL, "uart1_rx",
244 "gpio_101", NULL, NULL, NULL, "safe_mode"),
245 _OMAP4_MUXENTRY(SDMMC1_DAT0, 102, "sdmmc1_dat0", NULL, "dpm_emu18",
246 "gpio_102", NULL, NULL, NULL, "safe_mode"),
247 _OMAP4_MUXENTRY(SDMMC1_DAT1, 103, "sdmmc1_dat1", NULL, "dpm_emu17",
248 "gpio_103", NULL, NULL, NULL, "safe_mode"),
249 _OMAP4_MUXENTRY(SDMMC1_DAT2, 104, "sdmmc1_dat2", NULL, "dpm_emu16",
250 "gpio_104", "jtag_tms_tmsc", NULL, NULL, "safe_mode"),
251 _OMAP4_MUXENTRY(SDMMC1_DAT3, 105, "sdmmc1_dat3", NULL, "dpm_emu15",
252 "gpio_105", "jtag_tck", NULL, NULL, "safe_mode"),
253 _OMAP4_MUXENTRY(SDMMC1_DAT4, 106, "sdmmc1_dat4", NULL, NULL,
254 "gpio_106", NULL, NULL, NULL, "safe_mode"),
255 _OMAP4_MUXENTRY(SDMMC1_DAT5, 107, "sdmmc1_dat5", NULL, NULL,
256 "gpio_107", NULL, NULL, NULL, "safe_mode"),
257 _OMAP4_MUXENTRY(SDMMC1_DAT6, 108, "sdmmc1_dat6", NULL, NULL,
258 "gpio_108", NULL, NULL, NULL, "safe_mode"),
259 _OMAP4_MUXENTRY(SDMMC1_DAT7, 109, "sdmmc1_dat7", NULL, NULL,
260 "gpio_109", NULL, NULL, NULL, "safe_mode"),
261 _OMAP4_MUXENTRY(ABE_MCBSP2_CLKX, 110, "abe_mcbsp2_clkx", "mcspi2_clk",
262 "abe_mcasp_ahclkx", "gpio_110", "usbb2_mm_rxdm",
263 NULL, NULL, "safe_mode"),
264 _OMAP4_MUXENTRY(ABE_MCBSP2_DR, 111, "abe_mcbsp2_dr", "mcspi2_somi",
265 "abe_mcasp_axr", "gpio_111", "usbb2_mm_rxdp", NULL,
266 NULL, "safe_mode"),
267 _OMAP4_MUXENTRY(ABE_MCBSP2_DX, 112, "abe_mcbsp2_dx", "mcspi2_simo",
268 "abe_mcasp_amute", "gpio_112", "usbb2_mm_rxrcv", NULL,
269 NULL, "safe_mode"),
270 _OMAP4_MUXENTRY(ABE_MCBSP2_FSX, 113, "abe_mcbsp2_fsx", "mcspi2_cs0",
271 "abe_mcasp_afsx", "gpio_113", "usbb2_mm_txen", NULL,
272 NULL, "safe_mode"),
273 _OMAP4_MUXENTRY(ABE_MCBSP1_CLKX, 114, "abe_mcbsp1_clkx",
274 "abe_slimbus1_clock", NULL, "gpio_114", NULL, NULL,
275 NULL, "safe_mode"),
276 _OMAP4_MUXENTRY(ABE_MCBSP1_DR, 115, "abe_mcbsp1_dr",
277 "abe_slimbus1_data", NULL, "gpio_115", NULL, NULL,
278 NULL, "safe_mode"),
279 _OMAP4_MUXENTRY(ABE_MCBSP1_DX, 116, "abe_mcbsp1_dx", "sdmmc3_dat2",
280 "abe_mcasp_aclkx", "gpio_116", NULL, NULL, NULL,
281 "safe_mode"),
282 _OMAP4_MUXENTRY(ABE_MCBSP1_FSX, 117, "abe_mcbsp1_fsx", "sdmmc3_dat3",
283 "abe_mcasp_amutein", "gpio_117", NULL, NULL, NULL,
284 "safe_mode"),
285 _OMAP4_MUXENTRY(ABE_PDM_UL_DATA, 0, "abe_pdm_ul_data",
286 "abe_mcbsp3_dr", NULL, NULL, NULL, NULL, NULL,
287 "safe_mode"),
288 _OMAP4_MUXENTRY(ABE_PDM_DL_DATA, 0, "abe_pdm_dl_data",
289 "abe_mcbsp3_dx", NULL, NULL, NULL, NULL, NULL,
290 "safe_mode"),
291 _OMAP4_MUXENTRY(ABE_PDM_FRAME, 0, "abe_pdm_frame", "abe_mcbsp3_clkx",
292 NULL, NULL, NULL, NULL, NULL, "safe_mode"),
293 _OMAP4_MUXENTRY(ABE_PDM_LB_CLK, 0, "abe_pdm_lb_clk", "abe_mcbsp3_fsx",
294 NULL, NULL, NULL, NULL, NULL, "safe_mode"),
295 _OMAP4_MUXENTRY(ABE_CLKS, 118, "abe_clks", NULL, NULL, "gpio_118",
296 NULL, NULL, NULL, "safe_mode"),
297 _OMAP4_MUXENTRY(ABE_DMIC_CLK1, 119, "abe_dmic_clk1", NULL, NULL,
298 "gpio_119", "usbb2_mm_txse0", NULL, NULL,
299 "safe_mode"),
300 _OMAP4_MUXENTRY(ABE_DMIC_DIN1, 120, "abe_dmic_din1", NULL, NULL,
301 "gpio_120", "usbb2_mm_txdat", NULL, NULL,
302 "safe_mode"),
303 _OMAP4_MUXENTRY(ABE_DMIC_DIN2, 121, "abe_dmic_din2", "slimbus2_clock",
304 NULL, "gpio_121", NULL, NULL, NULL, "safe_mode"),
305 _OMAP4_MUXENTRY(ABE_DMIC_DIN3, 122, "abe_dmic_din3", "slimbus2_data",
306 "abe_dmic_clk2", "gpio_122", NULL, NULL, NULL,
307 "safe_mode"),
308 _OMAP4_MUXENTRY(UART2_CTS, 123, "uart2_cts", "sdmmc3_clk", NULL,
309 "gpio_123", NULL, NULL, NULL, "safe_mode"),
310 _OMAP4_MUXENTRY(UART2_RTS, 124, "uart2_rts", "sdmmc3_cmd", NULL,
311 "gpio_124", NULL, NULL, NULL, "safe_mode"),
312 _OMAP4_MUXENTRY(UART2_RX, 125, "uart2_rx", "sdmmc3_dat0", NULL,
313 "gpio_125", NULL, NULL, NULL, "safe_mode"),
314 _OMAP4_MUXENTRY(UART2_TX, 126, "uart2_tx", "sdmmc3_dat1", NULL,
315 "gpio_126", NULL, NULL, NULL, "safe_mode"),
316 _OMAP4_MUXENTRY(HDQ_SIO, 127, "hdq_sio", "i2c3_sccb", "i2c2_sccb",
317 "gpio_127", NULL, NULL, NULL, "safe_mode"),
318 _OMAP4_MUXENTRY(I2C1_SCL, 0, "i2c1_scl", NULL, NULL, NULL, NULL, NULL,
319 NULL, NULL),
320 _OMAP4_MUXENTRY(I2C1_SDA, 0, "i2c1_sda", NULL, NULL, NULL, NULL, NULL,
321 NULL, NULL),
322 _OMAP4_MUXENTRY(I2C2_SCL, 128, "i2c2_scl", "uart1_rx", NULL,
323 "gpio_128", NULL, NULL, NULL, "safe_mode"),
324 _OMAP4_MUXENTRY(I2C2_SDA, 129, "i2c2_sda", "uart1_tx", NULL,
325 "gpio_129", NULL, NULL, NULL, "safe_mode"),
326 _OMAP4_MUXENTRY(I2C3_SCL, 130, "i2c3_scl", NULL, NULL, "gpio_130",
327 NULL, NULL, NULL, "safe_mode"),
328 _OMAP4_MUXENTRY(I2C3_SDA, 131, "i2c3_sda", NULL, NULL, "gpio_131",
329 NULL, NULL, NULL, "safe_mode"),
330 _OMAP4_MUXENTRY(I2C4_SCL, 132, "i2c4_scl", NULL, NULL, "gpio_132",
331 NULL, NULL, NULL, "safe_mode"),
332 _OMAP4_MUXENTRY(I2C4_SDA, 133, "i2c4_sda", NULL, NULL, "gpio_133",
333 NULL, NULL, NULL, "safe_mode"),
334 _OMAP4_MUXENTRY(MCSPI1_CLK, 134, "mcspi1_clk", NULL, NULL, "gpio_134",
335 NULL, NULL, NULL, "safe_mode"),
336 _OMAP4_MUXENTRY(MCSPI1_SOMI, 135, "mcspi1_somi", NULL, NULL,
337 "gpio_135", NULL, NULL, NULL, "safe_mode"),
338 _OMAP4_MUXENTRY(MCSPI1_SIMO, 136, "mcspi1_simo", NULL, NULL,
339 "gpio_136", NULL, NULL, NULL, "safe_mode"),
340 _OMAP4_MUXENTRY(MCSPI1_CS0, 137, "mcspi1_cs0", NULL, NULL, "gpio_137",
341 NULL, NULL, NULL, "safe_mode"),
342 _OMAP4_MUXENTRY(MCSPI1_CS1, 138, "mcspi1_cs1", "uart1_rx", NULL,
343 "gpio_138", NULL, NULL, NULL, "safe_mode"),
344 _OMAP4_MUXENTRY(MCSPI1_CS2, 139, "mcspi1_cs2", "uart1_cts",
345 "slimbus2_clock", "gpio_139", NULL, NULL, NULL,
346 "safe_mode"),
347 _OMAP4_MUXENTRY(MCSPI1_CS3, 140, "mcspi1_cs3", "uart1_rts",
348 "slimbus2_data", "gpio_140", NULL, NULL, NULL,
349 "safe_mode"),
350 _OMAP4_MUXENTRY(UART3_CTS_RCTX, 141, "uart3_cts_rctx", "uart1_tx",
351 NULL, "gpio_141", NULL, NULL, NULL, "safe_mode"),
352 _OMAP4_MUXENTRY(UART3_RTS_SD, 142, "uart3_rts_sd", NULL, NULL,
353 "gpio_142", NULL, NULL, NULL, "safe_mode"),
354 _OMAP4_MUXENTRY(UART3_RX_IRRX, 143, "uart3_rx_irrx",
355 "dmtimer8_pwm_evt", NULL, "gpio_143", NULL, NULL,
356 NULL, "safe_mode"),
357 _OMAP4_MUXENTRY(UART3_TX_IRTX, 144, "uart3_tx_irtx",
358 "dmtimer9_pwm_evt", NULL, "gpio_144", NULL, NULL,
359 NULL, "safe_mode"),
360 _OMAP4_MUXENTRY(SDMMC5_CLK, 145, "sdmmc5_clk", "mcspi2_clk",
361 "usbc1_icusb_dp", "gpio_145", NULL, NULL, NULL,
362 "safe_mode"),
363 _OMAP4_MUXENTRY(SDMMC5_CMD, 146, "sdmmc5_cmd", "mcspi2_simo",
364 "usbc1_icusb_dm", "gpio_146", NULL, NULL, NULL,
365 "safe_mode"),
366 _OMAP4_MUXENTRY(SDMMC5_DAT0, 147, "sdmmc5_dat0", "mcspi2_somi",
367 "usbc1_icusb_rcv", "gpio_147", NULL, NULL, NULL,
368 "safe_mode"),
369 _OMAP4_MUXENTRY(SDMMC5_DAT1, 148, "sdmmc5_dat1", NULL,
370 "usbc1_icusb_txen", "gpio_148", NULL, NULL, NULL,
371 "safe_mode"),
372 _OMAP4_MUXENTRY(SDMMC5_DAT2, 149, "sdmmc5_dat2", "mcspi2_cs1", NULL,
373 "gpio_149", NULL, NULL, NULL, "safe_mode"),
374 _OMAP4_MUXENTRY(SDMMC5_DAT3, 150, "sdmmc5_dat3", "mcspi2_cs0", NULL,
375 "gpio_150", NULL, NULL, NULL, "safe_mode"),
376 _OMAP4_MUXENTRY(MCSPI4_CLK, 151, "mcspi4_clk", "sdmmc4_clk", NULL,
377 "gpio_151", NULL, NULL, NULL, "safe_mode"),
378 _OMAP4_MUXENTRY(MCSPI4_SIMO, 152, "mcspi4_simo", "sdmmc4_cmd", NULL,
379 "gpio_152", NULL, NULL, NULL, "safe_mode"),
380 _OMAP4_MUXENTRY(MCSPI4_SOMI, 153, "mcspi4_somi", "sdmmc4_dat0", NULL,
381 "gpio_153", NULL, NULL, NULL, "safe_mode"),
382 _OMAP4_MUXENTRY(MCSPI4_CS0, 154, "mcspi4_cs0", "sdmmc4_dat3", NULL,
383 "gpio_154", NULL, NULL, NULL, "safe_mode"),
384 _OMAP4_MUXENTRY(UART4_RX, 155, "uart4_rx", "sdmmc4_dat2", NULL,
385 "gpio_155", NULL, NULL, NULL, "safe_mode"),
386 _OMAP4_MUXENTRY(UART4_TX, 156, "uart4_tx", "sdmmc4_dat1", NULL,
387 "gpio_156", NULL, NULL, NULL, "safe_mode"),
388 _OMAP4_MUXENTRY(USBB2_ULPITLL_CLK, 157, "usbb2_ulpitll_clk",
389 "usbb2_ulpiphy_clk", "sdmmc4_cmd", "gpio_157",
390 "hsi2_cawake", NULL, NULL, "safe_mode"),
391 _OMAP4_MUXENTRY(USBB2_ULPITLL_STP, 158, "usbb2_ulpitll_stp",
392 "usbb2_ulpiphy_stp", "sdmmc4_clk", "gpio_158",
393 "hsi2_cadata", "dispc2_data23", NULL, "reserved"),
394 _OMAP4_MUXENTRY(USBB2_ULPITLL_DIR, 159, "usbb2_ulpitll_dir",
395 "usbb2_ulpiphy_dir", "sdmmc4_dat0", "gpio_159",
396 "hsi2_caflag", "dispc2_data22", NULL, "reserved"),
397 _OMAP4_MUXENTRY(USBB2_ULPITLL_NXT, 160, "usbb2_ulpitll_nxt",
398 "usbb2_ulpiphy_nxt", "sdmmc4_dat1", "gpio_160",
399 "hsi2_acready", "dispc2_data21", NULL, "reserved"),
400 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT0, 161, "usbb2_ulpitll_dat0",
401 "usbb2_ulpiphy_dat0", "sdmmc4_dat2", "gpio_161",
402 "hsi2_acwake", "dispc2_data20", NULL, "reserved"),
403 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT1, 162, "usbb2_ulpitll_dat1",
404 "usbb2_ulpiphy_dat1", "sdmmc4_dat3", "gpio_162",
405 "hsi2_acdata", "dispc2_data19", NULL, "reserved"),
406 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT2, 163, "usbb2_ulpitll_dat2",
407 "usbb2_ulpiphy_dat2", "sdmmc3_dat2", "gpio_163",
408 "hsi2_acflag", "dispc2_data18", NULL, "reserved"),
409 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT3, 164, "usbb2_ulpitll_dat3",
410 "usbb2_ulpiphy_dat3", "sdmmc3_dat1", "gpio_164",
411 "hsi2_caready", "dispc2_data15", NULL, "reserved"),
412 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT4, 165, "usbb2_ulpitll_dat4",
413 "usbb2_ulpiphy_dat4", "sdmmc3_dat0", "gpio_165",
414 "mcspi3_somi", "dispc2_data14", NULL, "reserved"),
415 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT5, 166, "usbb2_ulpitll_dat5",
416 "usbb2_ulpiphy_dat5", "sdmmc3_dat3", "gpio_166",
417 "mcspi3_cs0", "dispc2_data13", NULL, "reserved"),
418 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT6, 167, "usbb2_ulpitll_dat6",
419 "usbb2_ulpiphy_dat6", "sdmmc3_cmd", "gpio_167",
420 "mcspi3_simo", "dispc2_data12", NULL, "reserved"),
421 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT7, 168, "usbb2_ulpitll_dat7",
422 "usbb2_ulpiphy_dat7", "sdmmc3_clk", "gpio_168",
423 "mcspi3_clk", "dispc2_data11", NULL, "reserved"),
424 _OMAP4_MUXENTRY(USBB2_HSIC_DATA, 169, "usbb2_hsic_data", NULL, NULL,
425 "gpio_169", NULL, NULL, NULL, "safe_mode"),
426 _OMAP4_MUXENTRY(USBB2_HSIC_STROBE, 170, "usbb2_hsic_strobe", NULL,
427 NULL, "gpio_170", NULL, NULL, NULL, "safe_mode"),
428 _OMAP4_MUXENTRY(UNIPRO_TX0, 171, "unipro_tx0", "kpd_col0", NULL,
429 "gpio_171", NULL, NULL, NULL, "safe_mode"),
430 _OMAP4_MUXENTRY(UNIPRO_TY0, 172, "unipro_ty0", "kpd_col1", NULL,
431 "gpio_172", NULL, NULL, NULL, "safe_mode"),
432 _OMAP4_MUXENTRY(UNIPRO_TX1, 173, "unipro_tx1", "kpd_col2", NULL,
433 "gpio_173", NULL, NULL, NULL, "safe_mode"),
434 _OMAP4_MUXENTRY(UNIPRO_TY1, 174, "unipro_ty1", "kpd_col3", NULL,
435 "gpio_174", NULL, NULL, NULL, "safe_mode"),
436 _OMAP4_MUXENTRY(UNIPRO_TX2, 0, "unipro_tx2", "kpd_col4", NULL,
437 "gpio_0", NULL, NULL, NULL, "safe_mode"),
438 _OMAP4_MUXENTRY(UNIPRO_TY2, 1, "unipro_ty2", "kpd_col5", NULL,
439 "gpio_1", NULL, NULL, NULL, "safe_mode"),
440 _OMAP4_MUXENTRY(UNIPRO_RX0, 0, "unipro_rx0", "kpd_row0", NULL,
441 "gpi_175", NULL, NULL, NULL, "safe_mode"),
442 _OMAP4_MUXENTRY(UNIPRO_RY0, 0, "unipro_ry0", "kpd_row1", NULL,
443 "gpi_176", NULL, NULL, NULL, "safe_mode"),
444 _OMAP4_MUXENTRY(UNIPRO_RX1, 0, "unipro_rx1", "kpd_row2", NULL,
445 "gpi_177", NULL, NULL, NULL, "safe_mode"),
446 _OMAP4_MUXENTRY(UNIPRO_RY1, 0, "unipro_ry1", "kpd_row3", NULL,
447 "gpi_178", NULL, NULL, NULL, "safe_mode"),
448 _OMAP4_MUXENTRY(UNIPRO_RX2, 0, "unipro_rx2", "kpd_row4", NULL,
449 "gpi_2", NULL, NULL, NULL, "safe_mode"),
450 _OMAP4_MUXENTRY(UNIPRO_RY2, 0, "unipro_ry2", "kpd_row5", NULL,
451 "gpi_3", NULL, NULL, NULL, "safe_mode"),
452 _OMAP4_MUXENTRY(USBA0_OTG_CE, 0, "usba0_otg_ce", NULL, NULL, NULL,
453 NULL, NULL, NULL, NULL),
454 _OMAP4_MUXENTRY(USBA0_OTG_DP, 179, "usba0_otg_dp", "uart3_rx_irrx",
455 "uart2_rx", "gpio_179", NULL, NULL, NULL,
456 "safe_mode"),
457 _OMAP4_MUXENTRY(USBA0_OTG_DM, 180, "usba0_otg_dm", "uart3_tx_irtx",
458 "uart2_tx", "gpio_180", NULL, NULL, NULL,
459 "safe_mode"),
460 _OMAP4_MUXENTRY(FREF_CLK1_OUT, 181, "fref_clk1_out", NULL, NULL,
461 "gpio_181", NULL, NULL, NULL, "safe_mode"),
462 _OMAP4_MUXENTRY(FREF_CLK2_OUT, 182, "fref_clk2_out", NULL, NULL,
463 "gpio_182", NULL, NULL, NULL, "safe_mode"),
464 _OMAP4_MUXENTRY(SYS_NIRQ1, 0, "sys_nirq1", NULL, NULL, NULL, NULL,
465 NULL, NULL, "safe_mode"),
466 _OMAP4_MUXENTRY(SYS_NIRQ2, 183, "sys_nirq2", NULL, NULL, "gpio_183",
467 NULL, NULL, NULL, "safe_mode"),
468 _OMAP4_MUXENTRY(SYS_BOOT0, 184, "sys_boot0", NULL, NULL, "gpio_184",
469 NULL, NULL, NULL, "safe_mode"),
470 _OMAP4_MUXENTRY(SYS_BOOT1, 185, "sys_boot1", NULL, NULL, "gpio_185",
471 NULL, NULL, NULL, "safe_mode"),
472 _OMAP4_MUXENTRY(SYS_BOOT2, 186, "sys_boot2", NULL, NULL, "gpio_186",
473 NULL, NULL, NULL, "safe_mode"),
474 _OMAP4_MUXENTRY(SYS_BOOT3, 187, "sys_boot3", NULL, NULL, "gpio_187",
475 NULL, NULL, NULL, "safe_mode"),
476 _OMAP4_MUXENTRY(SYS_BOOT4, 188, "sys_boot4", NULL, NULL, "gpio_188",
477 NULL, NULL, NULL, "safe_mode"),
478 _OMAP4_MUXENTRY(SYS_BOOT5, 189, "sys_boot5", NULL, NULL, "gpio_189",
479 NULL, NULL, NULL, "safe_mode"),
480 _OMAP4_MUXENTRY(DPM_EMU0, 11, "dpm_emu0", NULL, NULL, "gpio_11", NULL,
481 NULL, "hw_dbg0", "safe_mode"),
482 _OMAP4_MUXENTRY(DPM_EMU1, 12, "dpm_emu1", NULL, NULL, "gpio_12", NULL,
483 NULL, "hw_dbg1", "safe_mode"),
484 _OMAP4_MUXENTRY(DPM_EMU2, 13, "dpm_emu2", "usba0_ulpiphy_clk", NULL,
485 "gpio_13", NULL, "dispc2_fid", "hw_dbg2", "reserved"),
486 _OMAP4_MUXENTRY(DPM_EMU3, 14, "dpm_emu3", "usba0_ulpiphy_stp", NULL,
487 "gpio_14", NULL, "dispc2_data10", "hw_dbg3",
488 "reserved"),
489 _OMAP4_MUXENTRY(DPM_EMU4, 15, "dpm_emu4", "usba0_ulpiphy_dir", NULL,
490 "gpio_15", NULL, "dispc2_data9", "hw_dbg4",
491 "reserved"),
492 _OMAP4_MUXENTRY(DPM_EMU5, 16, "dpm_emu5", "usba0_ulpiphy_nxt", NULL,
493 "gpio_16", "rfbi_te_vsync0", "dispc2_data16",
494 "hw_dbg5", "reserved"),
495 _OMAP4_MUXENTRY(DPM_EMU6, 17, "dpm_emu6", "usba0_ulpiphy_dat0",
496 "uart3_tx_irtx", "gpio_17", "rfbi_hsync0",
497 "dispc2_data17", "hw_dbg6", "reserved"),
498 _OMAP4_MUXENTRY(DPM_EMU7, 18, "dpm_emu7", "usba0_ulpiphy_dat1",
499 "uart3_rx_irrx", "gpio_18", "rfbi_cs0",
500 "dispc2_hsync", "hw_dbg7", "reserved"),
501 _OMAP4_MUXENTRY(DPM_EMU8, 19, "dpm_emu8", "usba0_ulpiphy_dat2",
502 "uart3_rts_sd", "gpio_19", "rfbi_re", "dispc2_pclk",
503 "hw_dbg8", "reserved"),
504 _OMAP4_MUXENTRY(DPM_EMU9, 20, "dpm_emu9", "usba0_ulpiphy_dat3",
505 "uart3_cts_rctx", "gpio_20", "rfbi_we",
506 "dispc2_vsync", "hw_dbg9", "reserved"),
507 _OMAP4_MUXENTRY(DPM_EMU10, 21, "dpm_emu10", "usba0_ulpiphy_dat4",
508 NULL, "gpio_21", "rfbi_a0", "dispc2_de", "hw_dbg10",
509 "reserved"),
510 _OMAP4_MUXENTRY(DPM_EMU11, 22, "dpm_emu11", "usba0_ulpiphy_dat5",
511 NULL, "gpio_22", "rfbi_data8", "dispc2_data8",
512 "hw_dbg11", "reserved"),
513 _OMAP4_MUXENTRY(DPM_EMU12, 23, "dpm_emu12", "usba0_ulpiphy_dat6",
514 NULL, "gpio_23", "rfbi_data7", "dispc2_data7",
515 "hw_dbg12", "reserved"),
516 _OMAP4_MUXENTRY(DPM_EMU13, 24, "dpm_emu13", "usba0_ulpiphy_dat7",
517 NULL, "gpio_24", "rfbi_data6", "dispc2_data6",
518 "hw_dbg13", "reserved"),
519 _OMAP4_MUXENTRY(DPM_EMU14, 25, "dpm_emu14", "sys_drm_msecure",
520 "uart1_rx", "gpio_25", "rfbi_data5", "dispc2_data5",
521 "hw_dbg14", "reserved"),
522 _OMAP4_MUXENTRY(DPM_EMU15, 26, "dpm_emu15", "sys_secure_indicator",
523 NULL, "gpio_26", "rfbi_data4", "dispc2_data4",
524 "hw_dbg15", "reserved"),
525 _OMAP4_MUXENTRY(DPM_EMU16, 27, "dpm_emu16", "dmtimer8_pwm_evt",
526 "dsi1_te0", "gpio_27", "rfbi_data3", "dispc2_data3",
527 "hw_dbg16", "reserved"),
528 _OMAP4_MUXENTRY(DPM_EMU17, 28, "dpm_emu17", "dmtimer9_pwm_evt",
529 "dsi1_te1", "gpio_28", "rfbi_data2", "dispc2_data2",
530 "hw_dbg17", "reserved"),
531 _OMAP4_MUXENTRY(DPM_EMU18, 190, "dpm_emu18", "dmtimer10_pwm_evt",
532 "dsi2_te0", "gpio_190", "rfbi_data1", "dispc2_data1",
533 "hw_dbg18", "reserved"),
534 _OMAP4_MUXENTRY(DPM_EMU19, 191, "dpm_emu19", "dmtimer11_pwm_evt",
535 "dsi2_te1", "gpio_191", "rfbi_data0", "dispc2_data0",
536 "hw_dbg19", "reserved"),
537 { .reg_offset = OMAP_MUX_TERMINATOR },
538};
539
540/*
541 * Balls for 44XX CBL package
542 * 547-pin CBL ES1.0 S-FPGA-N547, 0.40mm Ball Pitch (Top),
543 * 0.40mm Ball Pitch (Bottom)
544 */
545#if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS) \
546 && defined(CONFIG_OMAP_PACKAGE_CBL)
547struct omap_ball __initdata omap4_core_cbl_ball[] = {
548 _OMAP4_BALLENTRY(GPMC_AD0, "c12", NULL),
549 _OMAP4_BALLENTRY(GPMC_AD1, "d12", NULL),
550 _OMAP4_BALLENTRY(GPMC_AD2, "c13", NULL),
551 _OMAP4_BALLENTRY(GPMC_AD3, "d13", NULL),
552 _OMAP4_BALLENTRY(GPMC_AD4, "c15", NULL),
553 _OMAP4_BALLENTRY(GPMC_AD5, "d15", NULL),
554 _OMAP4_BALLENTRY(GPMC_AD6, "a16", NULL),
555 _OMAP4_BALLENTRY(GPMC_AD7, "b16", NULL),
556 _OMAP4_BALLENTRY(GPMC_AD8, "c16", NULL),
557 _OMAP4_BALLENTRY(GPMC_AD9, "d16", NULL),
558 _OMAP4_BALLENTRY(GPMC_AD10, "c17", NULL),
559 _OMAP4_BALLENTRY(GPMC_AD11, "d17", NULL),
560 _OMAP4_BALLENTRY(GPMC_AD12, "c18", NULL),
561 _OMAP4_BALLENTRY(GPMC_AD13, "d18", NULL),
562 _OMAP4_BALLENTRY(GPMC_AD14, "c19", NULL),
563 _OMAP4_BALLENTRY(GPMC_AD15, "d19", NULL),
564 _OMAP4_BALLENTRY(GPMC_A16, "b17", NULL),
565 _OMAP4_BALLENTRY(GPMC_A17, "a18", NULL),
566 _OMAP4_BALLENTRY(GPMC_A18, "b18", NULL),
567 _OMAP4_BALLENTRY(GPMC_A19, "a19", NULL),
568 _OMAP4_BALLENTRY(GPMC_A20, "b19", NULL),
569 _OMAP4_BALLENTRY(GPMC_A21, "b20", NULL),
570 _OMAP4_BALLENTRY(GPMC_A22, "a21", NULL),
571 _OMAP4_BALLENTRY(GPMC_A23, "b21", NULL),
572 _OMAP4_BALLENTRY(GPMC_A24, "c20", NULL),
573 _OMAP4_BALLENTRY(GPMC_A25, "d20", NULL),
574 _OMAP4_BALLENTRY(GPMC_NCS0, "b25", NULL),
575 _OMAP4_BALLENTRY(GPMC_NCS1, "c21", NULL),
576 _OMAP4_BALLENTRY(GPMC_NCS2, "d21", NULL),
577 _OMAP4_BALLENTRY(GPMC_NCS3, "c22", NULL),
578 _OMAP4_BALLENTRY(GPMC_NWP, "c25", NULL),
579 _OMAP4_BALLENTRY(GPMC_CLK, "b22", NULL),
580 _OMAP4_BALLENTRY(GPMC_NADV_ALE, "d25", NULL),
581 _OMAP4_BALLENTRY(GPMC_NOE, "b11", NULL),
582 _OMAP4_BALLENTRY(GPMC_NWE, "b12", NULL),
583 _OMAP4_BALLENTRY(GPMC_NBE0_CLE, "c23", NULL),
584 _OMAP4_BALLENTRY(GPMC_NBE1, "d22", NULL),
585 _OMAP4_BALLENTRY(GPMC_WAIT0, "b26", NULL),
586 _OMAP4_BALLENTRY(GPMC_WAIT1, "b23", NULL),
587 _OMAP4_BALLENTRY(C2C_DATA11, "d23", NULL),
588 _OMAP4_BALLENTRY(C2C_DATA12, "a24", NULL),
589 _OMAP4_BALLENTRY(C2C_DATA13, "b24", NULL),
590 _OMAP4_BALLENTRY(C2C_DATA14, "c24", NULL),
591 _OMAP4_BALLENTRY(C2C_DATA15, "d24", NULL),
592 _OMAP4_BALLENTRY(HDMI_HPD, "b9", NULL),
593 _OMAP4_BALLENTRY(HDMI_CEC, "b10", NULL),
594 _OMAP4_BALLENTRY(HDMI_DDC_SCL, "a8", NULL),
595 _OMAP4_BALLENTRY(HDMI_DDC_SDA, "b8", NULL),
596 _OMAP4_BALLENTRY(CSI21_DX0, "r26", NULL),
597 _OMAP4_BALLENTRY(CSI21_DY0, "r25", NULL),
598 _OMAP4_BALLENTRY(CSI21_DX1, "t26", NULL),
599 _OMAP4_BALLENTRY(CSI21_DY1, "t25", NULL),
600 _OMAP4_BALLENTRY(CSI21_DX2, "u26", NULL),
601 _OMAP4_BALLENTRY(CSI21_DY2, "u25", NULL),
602 _OMAP4_BALLENTRY(CSI21_DX3, "v26", NULL),
603 _OMAP4_BALLENTRY(CSI21_DY3, "v25", NULL),
604 _OMAP4_BALLENTRY(CSI21_DX4, "w26", NULL),
605 _OMAP4_BALLENTRY(CSI21_DY4, "w25", NULL),
606 _OMAP4_BALLENTRY(CSI22_DX0, "m26", NULL),
607 _OMAP4_BALLENTRY(CSI22_DY0, "m25", NULL),
608 _OMAP4_BALLENTRY(CSI22_DX1, "n26", NULL),
609 _OMAP4_BALLENTRY(CSI22_DY1, "n25", NULL),
610 _OMAP4_BALLENTRY(CAM_SHUTTER, "t27", NULL),
611 _OMAP4_BALLENTRY(CAM_STROBE, "u27", NULL),
612 _OMAP4_BALLENTRY(CAM_GLOBALRESET, "v27", NULL),
613 _OMAP4_BALLENTRY(USBB1_ULPITLL_CLK, "ae18", NULL),
614 _OMAP4_BALLENTRY(USBB1_ULPITLL_STP, "ag19", NULL),
615 _OMAP4_BALLENTRY(USBB1_ULPITLL_DIR, "af19", NULL),
616 _OMAP4_BALLENTRY(USBB1_ULPITLL_NXT, "ae19", NULL),
617 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT0, "af18", NULL),
618 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT1, "ag18", NULL),
619 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT2, "ae17", NULL),
620 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT3, "af17", NULL),
621 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT4, "ah17", NULL),
622 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT5, "ae16", NULL),
623 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT6, "af16", NULL),
624 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT7, "ag16", NULL),
625 _OMAP4_BALLENTRY(USBB1_HSIC_DATA, "af14", NULL),
626 _OMAP4_BALLENTRY(USBB1_HSIC_STROBE, "ae14", NULL),
627 _OMAP4_BALLENTRY(USBC1_ICUSB_DP, "h2", NULL),
628 _OMAP4_BALLENTRY(USBC1_ICUSB_DM, "h3", NULL),
629 _OMAP4_BALLENTRY(SDMMC1_CLK, "d2", NULL),
630 _OMAP4_BALLENTRY(SDMMC1_CMD, "e3", NULL),
631 _OMAP4_BALLENTRY(SDMMC1_DAT0, "e4", NULL),
632 _OMAP4_BALLENTRY(SDMMC1_DAT1, "e2", NULL),
633 _OMAP4_BALLENTRY(SDMMC1_DAT2, "e1", NULL),
634 _OMAP4_BALLENTRY(SDMMC1_DAT3, "f4", NULL),
635 _OMAP4_BALLENTRY(SDMMC1_DAT4, "f3", NULL),
636 _OMAP4_BALLENTRY(SDMMC1_DAT5, "f1", NULL),
637 _OMAP4_BALLENTRY(SDMMC1_DAT6, "g4", NULL),
638 _OMAP4_BALLENTRY(SDMMC1_DAT7, "g3", NULL),
639 _OMAP4_BALLENTRY(ABE_MCBSP2_CLKX, "ad27", NULL),
640 _OMAP4_BALLENTRY(ABE_MCBSP2_DR, "ad26", NULL),
641 _OMAP4_BALLENTRY(ABE_MCBSP2_DX, "ad25", NULL),
642 _OMAP4_BALLENTRY(ABE_MCBSP2_FSX, "ac28", NULL),
643 _OMAP4_BALLENTRY(ABE_MCBSP1_CLKX, "ac26", NULL),
644 _OMAP4_BALLENTRY(ABE_MCBSP1_DR, "ac25", NULL),
645 _OMAP4_BALLENTRY(ABE_MCBSP1_DX, "ab25", NULL),
646 _OMAP4_BALLENTRY(ABE_MCBSP1_FSX, "ac27", NULL),
647 _OMAP4_BALLENTRY(ABE_PDM_UL_DATA, "ag25", NULL),
648 _OMAP4_BALLENTRY(ABE_PDM_DL_DATA, "af25", NULL),
649 _OMAP4_BALLENTRY(ABE_PDM_FRAME, "ae25", NULL),
650 _OMAP4_BALLENTRY(ABE_PDM_LB_CLK, "af26", NULL),
651 _OMAP4_BALLENTRY(ABE_CLKS, "ah26", NULL),
652 _OMAP4_BALLENTRY(ABE_DMIC_CLK1, "ae24", NULL),
653 _OMAP4_BALLENTRY(ABE_DMIC_DIN1, "af24", NULL),
654 _OMAP4_BALLENTRY(ABE_DMIC_DIN2, "ag24", NULL),
655 _OMAP4_BALLENTRY(ABE_DMIC_DIN3, "ah24", NULL),
656 _OMAP4_BALLENTRY(UART2_CTS, "ab26", NULL),
657 _OMAP4_BALLENTRY(UART2_RTS, "ab27", NULL),
658 _OMAP4_BALLENTRY(UART2_RX, "aa25", NULL),
659 _OMAP4_BALLENTRY(UART2_TX, "aa26", NULL),
660 _OMAP4_BALLENTRY(HDQ_SIO, "aa27", NULL),
661 _OMAP4_BALLENTRY(I2C1_SCL, "ae28", NULL),
662 _OMAP4_BALLENTRY(I2C1_SDA, "ae26", NULL),
663 _OMAP4_BALLENTRY(I2C2_SCL, "c26", NULL),
664 _OMAP4_BALLENTRY(I2C2_SDA, "d26", NULL),
665 _OMAP4_BALLENTRY(I2C3_SCL, "w27", NULL),
666 _OMAP4_BALLENTRY(I2C3_SDA, "y27", NULL),
667 _OMAP4_BALLENTRY(I2C4_SCL, "ag21", NULL),
668 _OMAP4_BALLENTRY(I2C4_SDA, "ah22", NULL),
669 _OMAP4_BALLENTRY(MCSPI1_CLK, "af22", NULL),
670 _OMAP4_BALLENTRY(MCSPI1_SOMI, "ae22", NULL),
671 _OMAP4_BALLENTRY(MCSPI1_SIMO, "ag22", NULL),
672 _OMAP4_BALLENTRY(MCSPI1_CS0, "ae23", NULL),
673 _OMAP4_BALLENTRY(MCSPI1_CS1, "af23", NULL),
674 _OMAP4_BALLENTRY(MCSPI1_CS2, "ag23", NULL),
675 _OMAP4_BALLENTRY(MCSPI1_CS3, "ah23", NULL),
676 _OMAP4_BALLENTRY(UART3_CTS_RCTX, "f27", NULL),
677 _OMAP4_BALLENTRY(UART3_RTS_SD, "f28", NULL),
678 _OMAP4_BALLENTRY(UART3_RX_IRRX, "g27", NULL),
679 _OMAP4_BALLENTRY(UART3_TX_IRTX, "g28", NULL),
680 _OMAP4_BALLENTRY(SDMMC5_CLK, "ae5", NULL),
681 _OMAP4_BALLENTRY(SDMMC5_CMD, "af5", NULL),
682 _OMAP4_BALLENTRY(SDMMC5_DAT0, "ae4", NULL),
683 _OMAP4_BALLENTRY(SDMMC5_DAT1, "af4", NULL),
684 _OMAP4_BALLENTRY(SDMMC5_DAT2, "ag3", NULL),
685 _OMAP4_BALLENTRY(SDMMC5_DAT3, "af3", NULL),
686 _OMAP4_BALLENTRY(MCSPI4_CLK, "ae21", NULL),
687 _OMAP4_BALLENTRY(MCSPI4_SIMO, "af20", NULL),
688 _OMAP4_BALLENTRY(MCSPI4_SOMI, "af21", NULL),
689 _OMAP4_BALLENTRY(MCSPI4_CS0, "ae20", NULL),
690 _OMAP4_BALLENTRY(UART4_RX, "ag20", NULL),
691 _OMAP4_BALLENTRY(UART4_TX, "ah19", NULL),
692 _OMAP4_BALLENTRY(USBB2_ULPITLL_CLK, "ag12", NULL),
693 _OMAP4_BALLENTRY(USBB2_ULPITLL_STP, "af12", NULL),
694 _OMAP4_BALLENTRY(USBB2_ULPITLL_DIR, "ae12", NULL),
695 _OMAP4_BALLENTRY(USBB2_ULPITLL_NXT, "ag13", NULL),
696 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT0, "ae11", NULL),
697 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT1, "af11", NULL),
698 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT2, "ag11", NULL),
699 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT3, "ah11", NULL),
700 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT4, "ae10", NULL),
701 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT5, "af10", NULL),
702 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT6, "ag10", NULL),
703 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT7, "ae9", NULL),
704 _OMAP4_BALLENTRY(USBB2_HSIC_DATA, "af13", NULL),
705 _OMAP4_BALLENTRY(USBB2_HSIC_STROBE, "ae13", NULL),
706 _OMAP4_BALLENTRY(UNIPRO_TX0, "g26", NULL),
707 _OMAP4_BALLENTRY(UNIPRO_TY0, "g25", NULL),
708 _OMAP4_BALLENTRY(UNIPRO_TX1, "h26", NULL),
709 _OMAP4_BALLENTRY(UNIPRO_TY1, "h25", NULL),
710 _OMAP4_BALLENTRY(UNIPRO_TX2, "j27", NULL),
711 _OMAP4_BALLENTRY(UNIPRO_TY2, "h27", NULL),
712 _OMAP4_BALLENTRY(UNIPRO_RX0, "j26", NULL),
713 _OMAP4_BALLENTRY(UNIPRO_RY0, "j25", NULL),
714 _OMAP4_BALLENTRY(UNIPRO_RX1, "k26", NULL),
715 _OMAP4_BALLENTRY(UNIPRO_RY1, "k25", NULL),
716 _OMAP4_BALLENTRY(UNIPRO_RX2, "l27", NULL),
717 _OMAP4_BALLENTRY(UNIPRO_RY2, "k27", NULL),
718 _OMAP4_BALLENTRY(USBA0_OTG_CE, "c3", NULL),
719 _OMAP4_BALLENTRY(USBA0_OTG_DP, "b5", NULL),
720 _OMAP4_BALLENTRY(USBA0_OTG_DM, "b4", NULL),
721 _OMAP4_BALLENTRY(FREF_CLK1_OUT, "aa28", NULL),
722 _OMAP4_BALLENTRY(FREF_CLK2_OUT, "y28", NULL),
723 _OMAP4_BALLENTRY(SYS_NIRQ1, "ae6", NULL),
724 _OMAP4_BALLENTRY(SYS_NIRQ2, "af6", NULL),
725 _OMAP4_BALLENTRY(SYS_BOOT0, "f26", NULL),
726 _OMAP4_BALLENTRY(SYS_BOOT1, "e27", NULL),
727 _OMAP4_BALLENTRY(SYS_BOOT2, "e26", NULL),
728 _OMAP4_BALLENTRY(SYS_BOOT3, "e25", NULL),
729 _OMAP4_BALLENTRY(SYS_BOOT4, "d28", NULL),
730 _OMAP4_BALLENTRY(SYS_BOOT5, "d27", NULL),
731 _OMAP4_BALLENTRY(DPM_EMU0, "m2", NULL),
732 _OMAP4_BALLENTRY(DPM_EMU1, "n2", NULL),
733 _OMAP4_BALLENTRY(DPM_EMU2, "p2", NULL),
734 _OMAP4_BALLENTRY(DPM_EMU3, "v1", NULL),
735 _OMAP4_BALLENTRY(DPM_EMU4, "v2", NULL),
736 _OMAP4_BALLENTRY(DPM_EMU5, "w1", NULL),
737 _OMAP4_BALLENTRY(DPM_EMU6, "w2", NULL),
738 _OMAP4_BALLENTRY(DPM_EMU7, "w3", NULL),
739 _OMAP4_BALLENTRY(DPM_EMU8, "w4", NULL),
740 _OMAP4_BALLENTRY(DPM_EMU9, "y2", NULL),
741 _OMAP4_BALLENTRY(DPM_EMU10, "y3", NULL),
742 _OMAP4_BALLENTRY(DPM_EMU11, "y4", NULL),
743 _OMAP4_BALLENTRY(DPM_EMU12, "aa1", NULL),
744 _OMAP4_BALLENTRY(DPM_EMU13, "aa2", NULL),
745 _OMAP4_BALLENTRY(DPM_EMU14, "aa3", NULL),
746 _OMAP4_BALLENTRY(DPM_EMU15, "aa4", NULL),
747 _OMAP4_BALLENTRY(DPM_EMU16, "ab2", NULL),
748 _OMAP4_BALLENTRY(DPM_EMU17, "ab3", NULL),
749 _OMAP4_BALLENTRY(DPM_EMU18, "ab4", NULL),
750 _OMAP4_BALLENTRY(DPM_EMU19, "ac4", NULL),
751 { .reg_offset = OMAP_MUX_TERMINATOR },
752};
753#else
754#define omap4_core_cbl_ball NULL
755#endif
756
757/*
758 * Superset of all mux modes for omap4 ES2.0
759 */
760static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
761 _OMAP4_MUXENTRY(GPMC_AD0, 0, "gpmc_ad0", "sdmmc2_dat0", NULL, NULL,
762 NULL, NULL, NULL, NULL),
763 _OMAP4_MUXENTRY(GPMC_AD1, 0, "gpmc_ad1", "sdmmc2_dat1", NULL, NULL,
764 NULL, NULL, NULL, NULL),
765 _OMAP4_MUXENTRY(GPMC_AD2, 0, "gpmc_ad2", "sdmmc2_dat2", NULL, NULL,
766 NULL, NULL, NULL, NULL),
767 _OMAP4_MUXENTRY(GPMC_AD3, 0, "gpmc_ad3", "sdmmc2_dat3", NULL, NULL,
768 NULL, NULL, NULL, NULL),
769 _OMAP4_MUXENTRY(GPMC_AD4, 0, "gpmc_ad4", "sdmmc2_dat4",
770 "sdmmc2_dir_dat0", NULL, NULL, NULL, NULL, NULL),
771 _OMAP4_MUXENTRY(GPMC_AD5, 0, "gpmc_ad5", "sdmmc2_dat5",
772 "sdmmc2_dir_dat1", NULL, NULL, NULL, NULL, NULL),
773 _OMAP4_MUXENTRY(GPMC_AD6, 0, "gpmc_ad6", "sdmmc2_dat6",
774 "sdmmc2_dir_cmd", NULL, NULL, NULL, NULL, NULL),
775 _OMAP4_MUXENTRY(GPMC_AD7, 0, "gpmc_ad7", "sdmmc2_dat7",
776 "sdmmc2_clk_fdbk", NULL, NULL, NULL, NULL, NULL),
777 _OMAP4_MUXENTRY(GPMC_AD8, 32, "gpmc_ad8", "kpd_row0", "c2c_data15",
778 "gpio_32", NULL, "sdmmc1_dat0", NULL, NULL),
779 _OMAP4_MUXENTRY(GPMC_AD9, 33, "gpmc_ad9", "kpd_row1", "c2c_data14",
780 "gpio_33", NULL, "sdmmc1_dat1", NULL, NULL),
781 _OMAP4_MUXENTRY(GPMC_AD10, 34, "gpmc_ad10", "kpd_row2", "c2c_data13",
782 "gpio_34", NULL, "sdmmc1_dat2", NULL, NULL),
783 _OMAP4_MUXENTRY(GPMC_AD11, 35, "gpmc_ad11", "kpd_row3", "c2c_data12",
784 "gpio_35", NULL, "sdmmc1_dat3", NULL, NULL),
785 _OMAP4_MUXENTRY(GPMC_AD12, 36, "gpmc_ad12", "kpd_col0", "c2c_data11",
786 "gpio_36", NULL, "sdmmc1_dat4", NULL, NULL),
787 _OMAP4_MUXENTRY(GPMC_AD13, 37, "gpmc_ad13", "kpd_col1", "c2c_data10",
788 "gpio_37", NULL, "sdmmc1_dat5", NULL, NULL),
789 _OMAP4_MUXENTRY(GPMC_AD14, 38, "gpmc_ad14", "kpd_col2", "c2c_data9",
790 "gpio_38", NULL, "sdmmc1_dat6", NULL, NULL),
791 _OMAP4_MUXENTRY(GPMC_AD15, 39, "gpmc_ad15", "kpd_col3", "c2c_data8",
792 "gpio_39", NULL, "sdmmc1_dat7", NULL, NULL),
793 _OMAP4_MUXENTRY(GPMC_A16, 40, "gpmc_a16", "kpd_row4", "c2c_datain0",
794 "gpio_40", "venc_656_data0", NULL, NULL, "safe_mode"),
795 _OMAP4_MUXENTRY(GPMC_A17, 41, "gpmc_a17", "kpd_row5", "c2c_datain1",
796 "gpio_41", "venc_656_data1", NULL, NULL, "safe_mode"),
797 _OMAP4_MUXENTRY(GPMC_A18, 42, "gpmc_a18", "kpd_row6", "c2c_datain2",
798 "gpio_42", "venc_656_data2", NULL, NULL, "safe_mode"),
799 _OMAP4_MUXENTRY(GPMC_A19, 43, "gpmc_a19", "kpd_row7", "c2c_datain3",
800 "gpio_43", "venc_656_data3", NULL, NULL, "safe_mode"),
801 _OMAP4_MUXENTRY(GPMC_A20, 44, "gpmc_a20", "kpd_col4", "c2c_datain4",
802 "gpio_44", "venc_656_data4", NULL, NULL, "safe_mode"),
803 _OMAP4_MUXENTRY(GPMC_A21, 45, "gpmc_a21", "kpd_col5", "c2c_datain5",
804 "gpio_45", "venc_656_data5", NULL, NULL, "safe_mode"),
805 _OMAP4_MUXENTRY(GPMC_A22, 46, "gpmc_a22", "kpd_col6", "c2c_datain6",
806 "gpio_46", "venc_656_data6", NULL, NULL, "safe_mode"),
807 _OMAP4_MUXENTRY(GPMC_A23, 47, "gpmc_a23", "kpd_col7", "c2c_datain7",
808 "gpio_47", "venc_656_data7", NULL, NULL, "safe_mode"),
809 _OMAP4_MUXENTRY(GPMC_A24, 48, "gpmc_a24", "kpd_col8", "c2c_clkout0",
810 "gpio_48", NULL, NULL, NULL, "safe_mode"),
811 _OMAP4_MUXENTRY(GPMC_A25, 49, "gpmc_a25", NULL, "c2c_clkout1",
812 "gpio_49", NULL, NULL, NULL, "safe_mode"),
813 _OMAP4_MUXENTRY(GPMC_NCS0, 50, "gpmc_ncs0", NULL, NULL, "gpio_50",
814 "sys_ndmareq0", NULL, NULL, NULL),
815 _OMAP4_MUXENTRY(GPMC_NCS1, 51, "gpmc_ncs1", NULL, "c2c_dataout6",
816 "gpio_51", NULL, NULL, NULL, "safe_mode"),
817 _OMAP4_MUXENTRY(GPMC_NCS2, 52, "gpmc_ncs2", "kpd_row8",
818 "c2c_dataout7", "gpio_52", NULL, NULL, NULL,
819 "safe_mode"),
820 _OMAP4_MUXENTRY(GPMC_NCS3, 53, "gpmc_ncs3", "gpmc_dir",
821 "c2c_dataout4", "gpio_53", NULL, NULL, NULL,
822 "safe_mode"),
823 _OMAP4_MUXENTRY(GPMC_NWP, 54, "gpmc_nwp", "dsi1_te0", NULL, "gpio_54",
824 "sys_ndmareq1", NULL, NULL, NULL),
825 _OMAP4_MUXENTRY(GPMC_CLK, 55, "gpmc_clk", NULL, NULL, "gpio_55",
826 "sys_ndmareq2", "sdmmc1_cmd", NULL, NULL),
827 _OMAP4_MUXENTRY(GPMC_NADV_ALE, 56, "gpmc_nadv_ale", "dsi1_te1", NULL,
828 "gpio_56", "sys_ndmareq3", "sdmmc1_clk", NULL, NULL),
829 _OMAP4_MUXENTRY(GPMC_NOE, 0, "gpmc_noe", "sdmmc2_clk", NULL, NULL,
830 NULL, NULL, NULL, NULL),
831 _OMAP4_MUXENTRY(GPMC_NWE, 0, "gpmc_nwe", "sdmmc2_cmd", NULL, NULL,
832 NULL, NULL, NULL, NULL),
833 _OMAP4_MUXENTRY(GPMC_NBE0_CLE, 59, "gpmc_nbe0_cle", "dsi2_te0", NULL,
834 "gpio_59", NULL, NULL, NULL, NULL),
835 _OMAP4_MUXENTRY(GPMC_NBE1, 60, "gpmc_nbe1", NULL, "c2c_dataout5",
836 "gpio_60", NULL, NULL, NULL, "safe_mode"),
837 _OMAP4_MUXENTRY(GPMC_WAIT0, 61, "gpmc_wait0", "dsi2_te1", NULL,
838 "gpio_61", NULL, NULL, NULL, NULL),
839 _OMAP4_MUXENTRY(GPMC_WAIT1, 62, "gpmc_wait1", NULL, "c2c_dataout2",
840 "gpio_62", NULL, NULL, NULL, "safe_mode"),
841 _OMAP4_MUXENTRY(GPMC_WAIT2, 100, "gpmc_wait2", "usbc1_icusb_txen",
842 "c2c_dataout3", "gpio_100", "sys_ndmareq0", NULL,
843 NULL, "safe_mode"),
844 _OMAP4_MUXENTRY(GPMC_NCS4, 101, "gpmc_ncs4", "dsi1_te0", "c2c_clkin0",
845 "gpio_101", "sys_ndmareq1", NULL, NULL, "safe_mode"),
846 _OMAP4_MUXENTRY(GPMC_NCS5, 102, "gpmc_ncs5", "dsi1_te1", "c2c_clkin1",
847 "gpio_102", "sys_ndmareq2", NULL, NULL, "safe_mode"),
848 _OMAP4_MUXENTRY(GPMC_NCS6, 103, "gpmc_ncs6", "dsi2_te0",
849 "c2c_dataout0", "gpio_103", "sys_ndmareq3", NULL,
850 NULL, "safe_mode"),
851 _OMAP4_MUXENTRY(GPMC_NCS7, 104, "gpmc_ncs7", "dsi2_te1",
852 "c2c_dataout1", "gpio_104", NULL, NULL, NULL,
853 "safe_mode"),
854 _OMAP4_MUXENTRY(HDMI_HPD, 63, "hdmi_hpd", NULL, NULL, "gpio_63", NULL,
855 NULL, NULL, "safe_mode"),
856 _OMAP4_MUXENTRY(HDMI_CEC, 64, "hdmi_cec", NULL, NULL, "gpio_64", NULL,
857 NULL, NULL, "safe_mode"),
858 _OMAP4_MUXENTRY(HDMI_DDC_SCL, 65, "hdmi_ddc_scl", NULL, NULL,
859 "gpio_65", NULL, NULL, NULL, "safe_mode"),
860 _OMAP4_MUXENTRY(HDMI_DDC_SDA, 66, "hdmi_ddc_sda", NULL, NULL,
861 "gpio_66", NULL, NULL, NULL, "safe_mode"),
862 _OMAP4_MUXENTRY(CSI21_DX0, 0, "csi21_dx0", NULL, NULL, "gpi_67", NULL,
863 NULL, NULL, "safe_mode"),
864 _OMAP4_MUXENTRY(CSI21_DY0, 0, "csi21_dy0", NULL, NULL, "gpi_68", NULL,
865 NULL, NULL, "safe_mode"),
866 _OMAP4_MUXENTRY(CSI21_DX1, 0, "csi21_dx1", NULL, NULL, "gpi_69", NULL,
867 NULL, NULL, "safe_mode"),
868 _OMAP4_MUXENTRY(CSI21_DY1, 0, "csi21_dy1", NULL, NULL, "gpi_70", NULL,
869 NULL, NULL, "safe_mode"),
870 _OMAP4_MUXENTRY(CSI21_DX2, 0, "csi21_dx2", NULL, NULL, "gpi_71", NULL,
871 NULL, NULL, "safe_mode"),
872 _OMAP4_MUXENTRY(CSI21_DY2, 0, "csi21_dy2", NULL, NULL, "gpi_72", NULL,
873 NULL, NULL, "safe_mode"),
874 _OMAP4_MUXENTRY(CSI21_DX3, 0, "csi21_dx3", NULL, NULL, "gpi_73", NULL,
875 NULL, NULL, "safe_mode"),
876 _OMAP4_MUXENTRY(CSI21_DY3, 0, "csi21_dy3", NULL, NULL, "gpi_74", NULL,
877 NULL, NULL, "safe_mode"),
878 _OMAP4_MUXENTRY(CSI21_DX4, 0, "csi21_dx4", NULL, NULL, "gpi_75", NULL,
879 NULL, NULL, "safe_mode"),
880 _OMAP4_MUXENTRY(CSI21_DY4, 0, "csi21_dy4", NULL, NULL, "gpi_76", NULL,
881 NULL, NULL, "safe_mode"),
882 _OMAP4_MUXENTRY(CSI22_DX0, 0, "csi22_dx0", NULL, NULL, "gpi_77", NULL,
883 NULL, NULL, "safe_mode"),
884 _OMAP4_MUXENTRY(CSI22_DY0, 0, "csi22_dy0", NULL, NULL, "gpi_78", NULL,
885 NULL, NULL, "safe_mode"),
886 _OMAP4_MUXENTRY(CSI22_DX1, 0, "csi22_dx1", NULL, NULL, "gpi_79", NULL,
887 NULL, NULL, "safe_mode"),
888 _OMAP4_MUXENTRY(CSI22_DY1, 0, "csi22_dy1", NULL, NULL, "gpi_80", NULL,
889 NULL, NULL, "safe_mode"),
890 _OMAP4_MUXENTRY(CAM_SHUTTER, 81, "cam_shutter", NULL, NULL, "gpio_81",
891 NULL, NULL, NULL, "safe_mode"),
892 _OMAP4_MUXENTRY(CAM_STROBE, 82, "cam_strobe", NULL, NULL, "gpio_82",
893 NULL, NULL, NULL, "safe_mode"),
894 _OMAP4_MUXENTRY(CAM_GLOBALRESET, 83, "cam_globalreset", NULL, NULL,
895 "gpio_83", NULL, NULL, NULL, "safe_mode"),
896 _OMAP4_MUXENTRY(USBB1_ULPITLL_CLK, 84, "usbb1_ulpitll_clk",
897 "hsi1_cawake", NULL, "gpio_84", "usbb1_ulpiphy_clk",
898 NULL, "hw_dbg20", "safe_mode"),
899 _OMAP4_MUXENTRY(USBB1_ULPITLL_STP, 85, "usbb1_ulpitll_stp",
900 "hsi1_cadata", "mcbsp4_clkr", "gpio_85",
901 "usbb1_ulpiphy_stp", "usbb1_mm_rxdp", "hw_dbg21",
902 "safe_mode"),
903 _OMAP4_MUXENTRY(USBB1_ULPITLL_DIR, 86, "usbb1_ulpitll_dir",
904 "hsi1_caflag", "mcbsp4_fsr", "gpio_86",
905 "usbb1_ulpiphy_dir", NULL, "hw_dbg22", "safe_mode"),
906 _OMAP4_MUXENTRY(USBB1_ULPITLL_NXT, 87, "usbb1_ulpitll_nxt",
907 "hsi1_acready", "mcbsp4_fsx", "gpio_87",
908 "usbb1_ulpiphy_nxt", "usbb1_mm_rxdm", "hw_dbg23",
909 "safe_mode"),
910 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT0, 88, "usbb1_ulpitll_dat0",
911 "hsi1_acwake", "mcbsp4_clkx", "gpio_88",
912 "usbb1_ulpiphy_dat0", "usbb1_mm_txen", "hw_dbg24",
913 "safe_mode"),
914 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT1, 89, "usbb1_ulpitll_dat1",
915 "hsi1_acdata", "mcbsp4_dx", "gpio_89",
916 "usbb1_ulpiphy_dat1", "usbb1_mm_txdat", "hw_dbg25",
917 "safe_mode"),
918 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT2, 90, "usbb1_ulpitll_dat2",
919 "hsi1_acflag", "mcbsp4_dr", "gpio_90",
920 "usbb1_ulpiphy_dat2", "usbb1_mm_txse0", "hw_dbg26",
921 "safe_mode"),
922 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT3, 91, "usbb1_ulpitll_dat3",
923 "hsi1_caready", NULL, "gpio_91", "usbb1_ulpiphy_dat3",
924 "usbb1_mm_rxrcv", "hw_dbg27", "safe_mode"),
925 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT4, 92, "usbb1_ulpitll_dat4",
926 "dmtimer8_pwm_evt", "abe_mcbsp3_dr", "gpio_92",
927 "usbb1_ulpiphy_dat4", NULL, "hw_dbg28", "safe_mode"),
928 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT5, 93, "usbb1_ulpitll_dat5",
929 "dmtimer9_pwm_evt", "abe_mcbsp3_dx", "gpio_93",
930 "usbb1_ulpiphy_dat5", NULL, "hw_dbg29", "safe_mode"),
931 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT6, 94, "usbb1_ulpitll_dat6",
932 "dmtimer10_pwm_evt", "abe_mcbsp3_clkx", "gpio_94",
933 "usbb1_ulpiphy_dat6", "abe_dmic_din3", "hw_dbg30",
934 "safe_mode"),
935 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT7, 95, "usbb1_ulpitll_dat7",
936 "dmtimer11_pwm_evt", "abe_mcbsp3_fsx", "gpio_95",
937 "usbb1_ulpiphy_dat7", "abe_dmic_clk3", "hw_dbg31",
938 "safe_mode"),
939 _OMAP4_MUXENTRY(USBB1_HSIC_DATA, 96, "usbb1_hsic_data", NULL, NULL,
940 "gpio_96", NULL, NULL, NULL, "safe_mode"),
941 _OMAP4_MUXENTRY(USBB1_HSIC_STROBE, 97, "usbb1_hsic_strobe", NULL,
942 NULL, "gpio_97", NULL, NULL, NULL, "safe_mode"),
943 _OMAP4_MUXENTRY(USBC1_ICUSB_DP, 98, "usbc1_icusb_dp", NULL, NULL,
944 "gpio_98", NULL, NULL, NULL, "safe_mode"),
945 _OMAP4_MUXENTRY(USBC1_ICUSB_DM, 99, "usbc1_icusb_dm", NULL, NULL,
946 "gpio_99", NULL, NULL, NULL, "safe_mode"),
947 _OMAP4_MUXENTRY(SDMMC1_CLK, 100, "sdmmc1_clk", NULL, "dpm_emu19",
948 "gpio_100", NULL, NULL, NULL, "safe_mode"),
949 _OMAP4_MUXENTRY(SDMMC1_CMD, 101, "sdmmc1_cmd", NULL, "uart1_rx",
950 "gpio_101", NULL, NULL, NULL, "safe_mode"),
951 _OMAP4_MUXENTRY(SDMMC1_DAT0, 102, "sdmmc1_dat0", NULL, "dpm_emu18",
952 "gpio_102", NULL, NULL, NULL, "safe_mode"),
953 _OMAP4_MUXENTRY(SDMMC1_DAT1, 103, "sdmmc1_dat1", NULL, "dpm_emu17",
954 "gpio_103", NULL, NULL, NULL, "safe_mode"),
955 _OMAP4_MUXENTRY(SDMMC1_DAT2, 104, "sdmmc1_dat2", NULL, "dpm_emu16",
956 "gpio_104", "jtag_tms_tmsc", NULL, NULL, "safe_mode"),
957 _OMAP4_MUXENTRY(SDMMC1_DAT3, 105, "sdmmc1_dat3", NULL, "dpm_emu15",
958 "gpio_105", "jtag_tck", NULL, NULL, "safe_mode"),
959 _OMAP4_MUXENTRY(SDMMC1_DAT4, 106, "sdmmc1_dat4", NULL, NULL,
960 "gpio_106", NULL, NULL, NULL, "safe_mode"),
961 _OMAP4_MUXENTRY(SDMMC1_DAT5, 107, "sdmmc1_dat5", NULL, NULL,
962 "gpio_107", NULL, NULL, NULL, "safe_mode"),
963 _OMAP4_MUXENTRY(SDMMC1_DAT6, 108, "sdmmc1_dat6", NULL, NULL,
964 "gpio_108", NULL, NULL, NULL, "safe_mode"),
965 _OMAP4_MUXENTRY(SDMMC1_DAT7, 109, "sdmmc1_dat7", NULL, NULL,
966 "gpio_109", NULL, NULL, NULL, "safe_mode"),
967 _OMAP4_MUXENTRY(ABE_MCBSP2_CLKX, 110, "abe_mcbsp2_clkx", "mcspi2_clk",
968 "abe_mcasp_ahclkx", "gpio_110", "usbb2_mm_rxdm",
969 NULL, NULL, "safe_mode"),
970 _OMAP4_MUXENTRY(ABE_MCBSP2_DR, 111, "abe_mcbsp2_dr", "mcspi2_somi",
971 "abe_mcasp_axr", "gpio_111", "usbb2_mm_rxdp", NULL,
972 NULL, "safe_mode"),
973 _OMAP4_MUXENTRY(ABE_MCBSP2_DX, 112, "abe_mcbsp2_dx", "mcspi2_simo",
974 "abe_mcasp_amute", "gpio_112", "usbb2_mm_rxrcv", NULL,
975 NULL, "safe_mode"),
976 _OMAP4_MUXENTRY(ABE_MCBSP2_FSX, 113, "abe_mcbsp2_fsx", "mcspi2_cs0",
977 "abe_mcasp_afsx", "gpio_113", "usbb2_mm_txen", NULL,
978 NULL, "safe_mode"),
979 _OMAP4_MUXENTRY(ABE_MCBSP1_CLKX, 114, "abe_mcbsp1_clkx",
980 "abe_slimbus1_clock", NULL, "gpio_114", NULL, NULL,
981 NULL, "safe_mode"),
982 _OMAP4_MUXENTRY(ABE_MCBSP1_DR, 115, "abe_mcbsp1_dr",
983 "abe_slimbus1_data", NULL, "gpio_115", NULL, NULL,
984 NULL, "safe_mode"),
985 _OMAP4_MUXENTRY(ABE_MCBSP1_DX, 116, "abe_mcbsp1_dx", "sdmmc3_dat2",
986 "abe_mcasp_aclkx", "gpio_116", NULL, NULL, NULL,
987 "safe_mode"),
988 _OMAP4_MUXENTRY(ABE_MCBSP1_FSX, 117, "abe_mcbsp1_fsx", "sdmmc3_dat3",
989 "abe_mcasp_amutein", "gpio_117", NULL, NULL, NULL,
990 "safe_mode"),
991 _OMAP4_MUXENTRY(ABE_PDM_UL_DATA, 0, "abe_pdm_ul_data",
992 "abe_mcbsp3_dr", NULL, NULL, NULL, NULL, NULL,
993 "safe_mode"),
994 _OMAP4_MUXENTRY(ABE_PDM_DL_DATA, 0, "abe_pdm_dl_data",
995 "abe_mcbsp3_dx", NULL, NULL, NULL, NULL, NULL,
996 "safe_mode"),
997 _OMAP4_MUXENTRY(ABE_PDM_FRAME, 0, "abe_pdm_frame", "abe_mcbsp3_clkx",
998 NULL, NULL, NULL, NULL, NULL, "safe_mode"),
999 _OMAP4_MUXENTRY(ABE_PDM_LB_CLK, 0, "abe_pdm_lb_clk", "abe_mcbsp3_fsx",
1000 NULL, NULL, NULL, NULL, NULL, "safe_mode"),
1001 _OMAP4_MUXENTRY(ABE_CLKS, 118, "abe_clks", NULL, NULL, "gpio_118",
1002 NULL, NULL, NULL, "safe_mode"),
1003 _OMAP4_MUXENTRY(ABE_DMIC_CLK1, 119, "abe_dmic_clk1", NULL, NULL,
1004 "gpio_119", "usbb2_mm_txse0", "uart4_cts", NULL,
1005 "safe_mode"),
1006 _OMAP4_MUXENTRY(ABE_DMIC_DIN1, 120, "abe_dmic_din1", NULL, NULL,
1007 "gpio_120", "usbb2_mm_txdat", "uart4_rts", NULL,
1008 "safe_mode"),
1009 _OMAP4_MUXENTRY(ABE_DMIC_DIN2, 121, "abe_dmic_din2", "slimbus2_clock",
1010 "abe_mcasp_axr", "gpio_121", NULL,
1011 "dmtimer11_pwm_evt", NULL, "safe_mode"),
1012 _OMAP4_MUXENTRY(ABE_DMIC_DIN3, 122, "abe_dmic_din3", "slimbus2_data",
1013 "abe_dmic_clk2", "gpio_122", NULL, "dmtimer9_pwm_evt",
1014 NULL, "safe_mode"),
1015 _OMAP4_MUXENTRY(UART2_CTS, 123, "uart2_cts", "sdmmc3_clk", NULL,
1016 "gpio_123", NULL, NULL, NULL, "safe_mode"),
1017 _OMAP4_MUXENTRY(UART2_RTS, 124, "uart2_rts", "sdmmc3_cmd", NULL,
1018 "gpio_124", NULL, NULL, NULL, "safe_mode"),
1019 _OMAP4_MUXENTRY(UART2_RX, 125, "uart2_rx", "sdmmc3_dat0", NULL,
1020 "gpio_125", NULL, NULL, NULL, "safe_mode"),
1021 _OMAP4_MUXENTRY(UART2_TX, 126, "uart2_tx", "sdmmc3_dat1", NULL,
1022 "gpio_126", NULL, NULL, NULL, "safe_mode"),
1023 _OMAP4_MUXENTRY(HDQ_SIO, 127, "hdq_sio", "i2c3_sccb", "i2c2_sccb",
1024 "gpio_127", NULL, NULL, NULL, "safe_mode"),
1025 _OMAP4_MUXENTRY(I2C1_SCL, 0, "i2c1_scl", NULL, NULL, NULL, NULL, NULL,
1026 NULL, NULL),
1027 _OMAP4_MUXENTRY(I2C1_SDA, 0, "i2c1_sda", NULL, NULL, NULL, NULL, NULL,
1028 NULL, NULL),
1029 _OMAP4_MUXENTRY(I2C2_SCL, 128, "i2c2_scl", "uart1_rx", NULL,
1030 "gpio_128", NULL, NULL, NULL, "safe_mode"),
1031 _OMAP4_MUXENTRY(I2C2_SDA, 129, "i2c2_sda", "uart1_tx", NULL,
1032 "gpio_129", NULL, NULL, NULL, "safe_mode"),
1033 _OMAP4_MUXENTRY(I2C3_SCL, 130, "i2c3_scl", NULL, NULL, "gpio_130",
1034 NULL, NULL, NULL, "safe_mode"),
1035 _OMAP4_MUXENTRY(I2C3_SDA, 131, "i2c3_sda", NULL, NULL, "gpio_131",
1036 NULL, NULL, NULL, "safe_mode"),
1037 _OMAP4_MUXENTRY(I2C4_SCL, 132, "i2c4_scl", NULL, NULL, "gpio_132",
1038 NULL, NULL, NULL, "safe_mode"),
1039 _OMAP4_MUXENTRY(I2C4_SDA, 133, "i2c4_sda", NULL, NULL, "gpio_133",
1040 NULL, NULL, NULL, "safe_mode"),
1041 _OMAP4_MUXENTRY(MCSPI1_CLK, 134, "mcspi1_clk", NULL, NULL, "gpio_134",
1042 NULL, NULL, NULL, "safe_mode"),
1043 _OMAP4_MUXENTRY(MCSPI1_SOMI, 135, "mcspi1_somi", NULL, NULL,
1044 "gpio_135", NULL, NULL, NULL, "safe_mode"),
1045 _OMAP4_MUXENTRY(MCSPI1_SIMO, 136, "mcspi1_simo", NULL, NULL,
1046 "gpio_136", NULL, NULL, NULL, "safe_mode"),
1047 _OMAP4_MUXENTRY(MCSPI1_CS0, 137, "mcspi1_cs0", NULL, NULL, "gpio_137",
1048 NULL, NULL, NULL, "safe_mode"),
1049 _OMAP4_MUXENTRY(MCSPI1_CS1, 138, "mcspi1_cs1", "uart1_rx", NULL,
1050 "gpio_138", NULL, NULL, NULL, "safe_mode"),
1051 _OMAP4_MUXENTRY(MCSPI1_CS2, 139, "mcspi1_cs2", "uart1_cts",
1052 "slimbus2_clock", "gpio_139", NULL, NULL, NULL,
1053 "safe_mode"),
1054 _OMAP4_MUXENTRY(MCSPI1_CS3, 140, "mcspi1_cs3", "uart1_rts",
1055 "slimbus2_data", "gpio_140", NULL, NULL, NULL,
1056 "safe_mode"),
1057 _OMAP4_MUXENTRY(UART3_CTS_RCTX, 141, "uart3_cts_rctx", "uart1_tx",
1058 NULL, "gpio_141", NULL, NULL, NULL, "safe_mode"),
1059 _OMAP4_MUXENTRY(UART3_RTS_SD, 142, "uart3_rts_sd", NULL, NULL,
1060 "gpio_142", NULL, NULL, NULL, "safe_mode"),
1061 _OMAP4_MUXENTRY(UART3_RX_IRRX, 143, "uart3_rx_irrx",
1062 "dmtimer8_pwm_evt", NULL, "gpio_143", NULL, NULL,
1063 NULL, "safe_mode"),
1064 _OMAP4_MUXENTRY(UART3_TX_IRTX, 144, "uart3_tx_irtx",
1065 "dmtimer9_pwm_evt", NULL, "gpio_144", NULL, NULL,
1066 NULL, "safe_mode"),
1067 _OMAP4_MUXENTRY(SDMMC5_CLK, 145, "sdmmc5_clk", "mcspi2_clk",
1068 "usbc1_icusb_dp", "gpio_145", NULL, "sdmmc2_clk",
1069 NULL, "safe_mode"),
1070 _OMAP4_MUXENTRY(SDMMC5_CMD, 146, "sdmmc5_cmd", "mcspi2_simo",
1071 "usbc1_icusb_dm", "gpio_146", NULL, "sdmmc2_cmd",
1072 NULL, "safe_mode"),
1073 _OMAP4_MUXENTRY(SDMMC5_DAT0, 147, "sdmmc5_dat0", "mcspi2_somi",
1074 "usbc1_icusb_rcv", "gpio_147", NULL, "sdmmc2_dat0",
1075 NULL, "safe_mode"),
1076 _OMAP4_MUXENTRY(SDMMC5_DAT1, 148, "sdmmc5_dat1", NULL,
1077 "usbc1_icusb_txen", "gpio_148", NULL, "sdmmc2_dat1",
1078 NULL, "safe_mode"),
1079 _OMAP4_MUXENTRY(SDMMC5_DAT2, 149, "sdmmc5_dat2", "mcspi2_cs1", NULL,
1080 "gpio_149", NULL, "sdmmc2_dat2", NULL, "safe_mode"),
1081 _OMAP4_MUXENTRY(SDMMC5_DAT3, 150, "sdmmc5_dat3", "mcspi2_cs0", NULL,
1082 "gpio_150", NULL, "sdmmc2_dat3", NULL, "safe_mode"),
1083 _OMAP4_MUXENTRY(MCSPI4_CLK, 151, "mcspi4_clk", "sdmmc4_clk",
1084 "kpd_col6", "gpio_151", NULL, NULL, NULL,
1085 "safe_mode"),
1086 _OMAP4_MUXENTRY(MCSPI4_SIMO, 152, "mcspi4_simo", "sdmmc4_cmd",
1087 "kpd_col7", "gpio_152", NULL, NULL, NULL,
1088 "safe_mode"),
1089 _OMAP4_MUXENTRY(MCSPI4_SOMI, 153, "mcspi4_somi", "sdmmc4_dat0",
1090 "kpd_row6", "gpio_153", NULL, NULL, NULL,
1091 "safe_mode"),
1092 _OMAP4_MUXENTRY(MCSPI4_CS0, 154, "mcspi4_cs0", "sdmmc4_dat3",
1093 "kpd_row7", "gpio_154", NULL, NULL, NULL,
1094 "safe_mode"),
1095 _OMAP4_MUXENTRY(UART4_RX, 155, "uart4_rx", "sdmmc4_dat2", "kpd_row8",
1096 "gpio_155", NULL, NULL, NULL, "safe_mode"),
1097 _OMAP4_MUXENTRY(UART4_TX, 156, "uart4_tx", "sdmmc4_dat1", "kpd_col8",
1098 "gpio_156", NULL, NULL, NULL, "safe_mode"),
1099 _OMAP4_MUXENTRY(USBB2_ULPITLL_CLK, 157, "usbb2_ulpitll_clk",
1100 "usbb2_ulpiphy_clk", "sdmmc4_cmd", "gpio_157",
1101 "hsi2_cawake", NULL, NULL, "safe_mode"),
1102 _OMAP4_MUXENTRY(USBB2_ULPITLL_STP, 158, "usbb2_ulpitll_stp",
1103 "usbb2_ulpiphy_stp", "sdmmc4_clk", "gpio_158",
1104 "hsi2_cadata", "dispc2_data23", NULL, "safe_mode"),
1105 _OMAP4_MUXENTRY(USBB2_ULPITLL_DIR, 159, "usbb2_ulpitll_dir",
1106 "usbb2_ulpiphy_dir", "sdmmc4_dat0", "gpio_159",
1107 "hsi2_caflag", "dispc2_data22", NULL, "safe_mode"),
1108 _OMAP4_MUXENTRY(USBB2_ULPITLL_NXT, 160, "usbb2_ulpitll_nxt",
1109 "usbb2_ulpiphy_nxt", "sdmmc4_dat1", "gpio_160",
1110 "hsi2_acready", "dispc2_data21", NULL, "safe_mode"),
1111 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT0, 161, "usbb2_ulpitll_dat0",
1112 "usbb2_ulpiphy_dat0", "sdmmc4_dat2", "gpio_161",
1113 "hsi2_acwake", "dispc2_data20", "usbb2_mm_txen",
1114 "safe_mode"),
1115 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT1, 162, "usbb2_ulpitll_dat1",
1116 "usbb2_ulpiphy_dat1", "sdmmc4_dat3", "gpio_162",
1117 "hsi2_acdata", "dispc2_data19", "usbb2_mm_txdat",
1118 "safe_mode"),
1119 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT2, 163, "usbb2_ulpitll_dat2",
1120 "usbb2_ulpiphy_dat2", "sdmmc3_dat2", "gpio_163",
1121 "hsi2_acflag", "dispc2_data18", "usbb2_mm_txse0",
1122 "safe_mode"),
1123 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT3, 164, "usbb2_ulpitll_dat3",
1124 "usbb2_ulpiphy_dat3", "sdmmc3_dat1", "gpio_164",
1125 "hsi2_caready", "dispc2_data15", "rfbi_data15",
1126 "safe_mode"),
1127 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT4, 165, "usbb2_ulpitll_dat4",
1128 "usbb2_ulpiphy_dat4", "sdmmc3_dat0", "gpio_165",
1129 "mcspi3_somi", "dispc2_data14", "rfbi_data14",
1130 "safe_mode"),
1131 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT5, 166, "usbb2_ulpitll_dat5",
1132 "usbb2_ulpiphy_dat5", "sdmmc3_dat3", "gpio_166",
1133 "mcspi3_cs0", "dispc2_data13", "rfbi_data13",
1134 "safe_mode"),
1135 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT6, 167, "usbb2_ulpitll_dat6",
1136 "usbb2_ulpiphy_dat6", "sdmmc3_cmd", "gpio_167",
1137 "mcspi3_simo", "dispc2_data12", "rfbi_data12",
1138 "safe_mode"),
1139 _OMAP4_MUXENTRY(USBB2_ULPITLL_DAT7, 168, "usbb2_ulpitll_dat7",
1140 "usbb2_ulpiphy_dat7", "sdmmc3_clk", "gpio_168",
1141 "mcspi3_clk", "dispc2_data11", "rfbi_data11",
1142 "safe_mode"),
1143 _OMAP4_MUXENTRY(USBB2_HSIC_DATA, 169, "usbb2_hsic_data", NULL, NULL,
1144 "gpio_169", NULL, NULL, NULL, "safe_mode"),
1145 _OMAP4_MUXENTRY(USBB2_HSIC_STROBE, 170, "usbb2_hsic_strobe", NULL,
1146 NULL, "gpio_170", NULL, NULL, NULL, "safe_mode"),
1147 _OMAP4_MUXENTRY(KPD_COL3, 171, "kpd_col3", "kpd_col0", NULL,
1148 "gpio_171", NULL, NULL, NULL, "safe_mode"),
1149 _OMAP4_MUXENTRY(KPD_COL4, 172, "kpd_col4", "kpd_col1", NULL,
1150 "gpio_172", NULL, NULL, NULL, "safe_mode"),
1151 _OMAP4_MUXENTRY(KPD_COL5, 173, "kpd_col5", "kpd_col2", NULL,
1152 "gpio_173", NULL, NULL, NULL, "safe_mode"),
1153 _OMAP4_MUXENTRY(KPD_COL0, 174, "kpd_col0", "kpd_col3", NULL,
1154 "gpio_174", NULL, NULL, NULL, "safe_mode"),
1155 _OMAP4_MUXENTRY(KPD_COL1, 0, "kpd_col1", "kpd_col4", NULL, "gpio_0",
1156 NULL, NULL, NULL, "safe_mode"),
1157 _OMAP4_MUXENTRY(KPD_COL2, 1, "kpd_col2", "kpd_col5", NULL, "gpio_1",
1158 NULL, NULL, NULL, "safe_mode"),
1159 _OMAP4_MUXENTRY(KPD_ROW3, 175, "kpd_row3", "kpd_row0", NULL,
1160 "gpio_175", NULL, NULL, NULL, "safe_mode"),
1161 _OMAP4_MUXENTRY(KPD_ROW4, 176, "kpd_row4", "kpd_row1", NULL,
1162 "gpio_176", NULL, NULL, NULL, "safe_mode"),
1163 _OMAP4_MUXENTRY(KPD_ROW5, 177, "kpd_row5", "kpd_row2", NULL,
1164 "gpio_177", NULL, NULL, NULL, "safe_mode"),
1165 _OMAP4_MUXENTRY(KPD_ROW0, 178, "kpd_row0", "kpd_row3", NULL,
1166 "gpio_178", NULL, NULL, NULL, "safe_mode"),
1167 _OMAP4_MUXENTRY(KPD_ROW1, 2, "kpd_row1", "kpd_row4", NULL, "gpio_2",
1168 NULL, NULL, NULL, "safe_mode"),
1169 _OMAP4_MUXENTRY(KPD_ROW2, 3, "kpd_row2", "kpd_row5", NULL, "gpio_3",
1170 NULL, NULL, NULL, "safe_mode"),
1171 _OMAP4_MUXENTRY(USBA0_OTG_CE, 0, "usba0_otg_ce", NULL, NULL, NULL,
1172 NULL, NULL, NULL, NULL),
1173 _OMAP4_MUXENTRY(USBA0_OTG_DP, 0, "usba0_otg_dp", "uart3_rx_irrx",
1174 "uart2_rx", NULL, NULL, NULL, NULL, "safe_mode"),
1175 _OMAP4_MUXENTRY(USBA0_OTG_DM, 0, "usba0_otg_dm", "uart3_tx_irtx",
1176 "uart2_tx", NULL, NULL, NULL, NULL, "safe_mode"),
1177 _OMAP4_MUXENTRY(FREF_CLK1_OUT, 181, "fref_clk1_out", NULL, NULL,
1178 "gpio_181", NULL, NULL, NULL, "safe_mode"),
1179 _OMAP4_MUXENTRY(FREF_CLK2_OUT, 182, "fref_clk2_out", NULL, NULL,
1180 "gpio_182", NULL, NULL, NULL, "safe_mode"),
1181 _OMAP4_MUXENTRY(SYS_NIRQ1, 0, "sys_nirq1", NULL, NULL, NULL, NULL,
1182 NULL, NULL, "safe_mode"),
1183 _OMAP4_MUXENTRY(SYS_NIRQ2, 183, "sys_nirq2", NULL, NULL, "gpio_183",
1184 NULL, NULL, NULL, "safe_mode"),
1185 _OMAP4_MUXENTRY(SYS_BOOT0, 184, "sys_boot0", NULL, NULL, "gpio_184",
1186 NULL, NULL, NULL, "safe_mode"),
1187 _OMAP4_MUXENTRY(SYS_BOOT1, 185, "sys_boot1", NULL, NULL, "gpio_185",
1188 NULL, NULL, NULL, "safe_mode"),
1189 _OMAP4_MUXENTRY(SYS_BOOT2, 186, "sys_boot2", NULL, NULL, "gpio_186",
1190 NULL, NULL, NULL, "safe_mode"),
1191 _OMAP4_MUXENTRY(SYS_BOOT3, 187, "sys_boot3", NULL, NULL, "gpio_187",
1192 NULL, NULL, NULL, "safe_mode"),
1193 _OMAP4_MUXENTRY(SYS_BOOT4, 188, "sys_boot4", NULL, NULL, "gpio_188",
1194 NULL, NULL, NULL, "safe_mode"),
1195 _OMAP4_MUXENTRY(SYS_BOOT5, 189, "sys_boot5", NULL, NULL, "gpio_189",
1196 NULL, NULL, NULL, "safe_mode"),
1197 _OMAP4_MUXENTRY(DPM_EMU0, 11, "dpm_emu0", NULL, NULL, "gpio_11", NULL,
1198 NULL, "hw_dbg0", "safe_mode"),
1199 _OMAP4_MUXENTRY(DPM_EMU1, 12, "dpm_emu1", NULL, NULL, "gpio_12", NULL,
1200 NULL, "hw_dbg1", "safe_mode"),
1201 _OMAP4_MUXENTRY(DPM_EMU2, 13, "dpm_emu2", "usba0_ulpiphy_clk", NULL,
1202 "gpio_13", NULL, "dispc2_fid", "hw_dbg2",
1203 "safe_mode"),
1204 _OMAP4_MUXENTRY(DPM_EMU3, 14, "dpm_emu3", "usba0_ulpiphy_stp", NULL,
1205 "gpio_14", "rfbi_data10", "dispc2_data10", "hw_dbg3",
1206 "safe_mode"),
1207 _OMAP4_MUXENTRY(DPM_EMU4, 15, "dpm_emu4", "usba0_ulpiphy_dir", NULL,
1208 "gpio_15", "rfbi_data9", "dispc2_data9", "hw_dbg4",
1209 "safe_mode"),
1210 _OMAP4_MUXENTRY(DPM_EMU5, 16, "dpm_emu5", "usba0_ulpiphy_nxt", NULL,
1211 "gpio_16", "rfbi_te_vsync0", "dispc2_data16",
1212 "hw_dbg5", "safe_mode"),
1213 _OMAP4_MUXENTRY(DPM_EMU6, 17, "dpm_emu6", "usba0_ulpiphy_dat0",
1214 "uart3_tx_irtx", "gpio_17", "rfbi_hsync0",
1215 "dispc2_data17", "hw_dbg6", "safe_mode"),
1216 _OMAP4_MUXENTRY(DPM_EMU7, 18, "dpm_emu7", "usba0_ulpiphy_dat1",
1217 "uart3_rx_irrx", "gpio_18", "rfbi_cs0",
1218 "dispc2_hsync", "hw_dbg7", "safe_mode"),
1219 _OMAP4_MUXENTRY(DPM_EMU8, 19, "dpm_emu8", "usba0_ulpiphy_dat2",
1220 "uart3_rts_sd", "gpio_19", "rfbi_re", "dispc2_pclk",
1221 "hw_dbg8", "safe_mode"),
1222 _OMAP4_MUXENTRY(DPM_EMU9, 20, "dpm_emu9", "usba0_ulpiphy_dat3",
1223 "uart3_cts_rctx", "gpio_20", "rfbi_we",
1224 "dispc2_vsync", "hw_dbg9", "safe_mode"),
1225 _OMAP4_MUXENTRY(DPM_EMU10, 21, "dpm_emu10", "usba0_ulpiphy_dat4",
1226 NULL, "gpio_21", "rfbi_a0", "dispc2_de", "hw_dbg10",
1227 "safe_mode"),
1228 _OMAP4_MUXENTRY(DPM_EMU11, 22, "dpm_emu11", "usba0_ulpiphy_dat5",
1229 NULL, "gpio_22", "rfbi_data8", "dispc2_data8",
1230 "hw_dbg11", "safe_mode"),
1231 _OMAP4_MUXENTRY(DPM_EMU12, 23, "dpm_emu12", "usba0_ulpiphy_dat6",
1232 NULL, "gpio_23", "rfbi_data7", "dispc2_data7",
1233 "hw_dbg12", "safe_mode"),
1234 _OMAP4_MUXENTRY(DPM_EMU13, 24, "dpm_emu13", "usba0_ulpiphy_dat7",
1235 NULL, "gpio_24", "rfbi_data6", "dispc2_data6",
1236 "hw_dbg13", "safe_mode"),
1237 _OMAP4_MUXENTRY(DPM_EMU14, 25, "dpm_emu14", "sys_drm_msecure",
1238 "uart1_rx", "gpio_25", "rfbi_data5", "dispc2_data5",
1239 "hw_dbg14", "safe_mode"),
1240 _OMAP4_MUXENTRY(DPM_EMU15, 26, "dpm_emu15", "sys_secure_indicator",
1241 NULL, "gpio_26", "rfbi_data4", "dispc2_data4",
1242 "hw_dbg15", "safe_mode"),
1243 _OMAP4_MUXENTRY(DPM_EMU16, 27, "dpm_emu16", "dmtimer8_pwm_evt",
1244 "dsi1_te0", "gpio_27", "rfbi_data3", "dispc2_data3",
1245 "hw_dbg16", "safe_mode"),
1246 _OMAP4_MUXENTRY(DPM_EMU17, 28, "dpm_emu17", "dmtimer9_pwm_evt",
1247 "dsi1_te1", "gpio_28", "rfbi_data2", "dispc2_data2",
1248 "hw_dbg17", "safe_mode"),
1249 _OMAP4_MUXENTRY(DPM_EMU18, 190, "dpm_emu18", "dmtimer10_pwm_evt",
1250 "dsi2_te0", "gpio_190", "rfbi_data1", "dispc2_data1",
1251 "hw_dbg18", "safe_mode"),
1252 _OMAP4_MUXENTRY(DPM_EMU19, 191, "dpm_emu19", "dmtimer11_pwm_evt",
1253 "dsi2_te1", "gpio_191", "rfbi_data0", "dispc2_data0",
1254 "hw_dbg19", "safe_mode"),
1255 { .reg_offset = OMAP_MUX_TERMINATOR },
1256};
1257
1258/*
1259 * Balls for 44XX CBS package
1260 * 547-pin CBL ES2.0 S-FPGA-N547, 0.40mm Ball Pitch (Top),
1261 * 0.40mm Ball Pitch (Bottom)
1262 */
1263#if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS) \
1264 && defined(CONFIG_OMAP_PACKAGE_CBS)
1265struct omap_ball __initdata omap4_core_cbs_ball[] = {
1266 _OMAP4_BALLENTRY(GPMC_AD0, "c12", NULL),
1267 _OMAP4_BALLENTRY(GPMC_AD1, "d12", NULL),
1268 _OMAP4_BALLENTRY(GPMC_AD2, "c13", NULL),
1269 _OMAP4_BALLENTRY(GPMC_AD3, "d13", NULL),
1270 _OMAP4_BALLENTRY(GPMC_AD4, "c15", NULL),
1271 _OMAP4_BALLENTRY(GPMC_AD5, "d15", NULL),
1272 _OMAP4_BALLENTRY(GPMC_AD6, "a16", NULL),
1273 _OMAP4_BALLENTRY(GPMC_AD7, "b16", NULL),
1274 _OMAP4_BALLENTRY(GPMC_AD8, "c16", NULL),
1275 _OMAP4_BALLENTRY(GPMC_AD9, "d16", NULL),
1276 _OMAP4_BALLENTRY(GPMC_AD10, "c17", NULL),
1277 _OMAP4_BALLENTRY(GPMC_AD11, "d17", NULL),
1278 _OMAP4_BALLENTRY(GPMC_AD12, "c18", NULL),
1279 _OMAP4_BALLENTRY(GPMC_AD13, "d18", NULL),
1280 _OMAP4_BALLENTRY(GPMC_AD14, "c19", NULL),
1281 _OMAP4_BALLENTRY(GPMC_AD15, "d19", NULL),
1282 _OMAP4_BALLENTRY(GPMC_A16, "b17", NULL),
1283 _OMAP4_BALLENTRY(GPMC_A17, "a18", NULL),
1284 _OMAP4_BALLENTRY(GPMC_A18, "b18", NULL),
1285 _OMAP4_BALLENTRY(GPMC_A19, "a19", NULL),
1286 _OMAP4_BALLENTRY(GPMC_A20, "b19", NULL),
1287 _OMAP4_BALLENTRY(GPMC_A21, "b20", NULL),
1288 _OMAP4_BALLENTRY(GPMC_A22, "a21", NULL),
1289 _OMAP4_BALLENTRY(GPMC_A23, "b21", NULL),
1290 _OMAP4_BALLENTRY(GPMC_A24, "c20", NULL),
1291 _OMAP4_BALLENTRY(GPMC_A25, "d20", NULL),
1292 _OMAP4_BALLENTRY(GPMC_NCS0, "b25", NULL),
1293 _OMAP4_BALLENTRY(GPMC_NCS1, "c21", NULL),
1294 _OMAP4_BALLENTRY(GPMC_NCS2, "d21", NULL),
1295 _OMAP4_BALLENTRY(GPMC_NCS3, "c22", NULL),
1296 _OMAP4_BALLENTRY(GPMC_NWP, "c25", NULL),
1297 _OMAP4_BALLENTRY(GPMC_CLK, "b22", NULL),
1298 _OMAP4_BALLENTRY(GPMC_NADV_ALE, "d25", NULL),
1299 _OMAP4_BALLENTRY(GPMC_NOE, "b11", NULL),
1300 _OMAP4_BALLENTRY(GPMC_NWE, "b12", NULL),
1301 _OMAP4_BALLENTRY(GPMC_NBE0_CLE, "c23", NULL),
1302 _OMAP4_BALLENTRY(GPMC_NBE1, "d22", NULL),
1303 _OMAP4_BALLENTRY(GPMC_WAIT0, "b26", NULL),
1304 _OMAP4_BALLENTRY(GPMC_WAIT1, "b23", NULL),
1305 _OMAP4_BALLENTRY(GPMC_WAIT2, "d23", NULL),
1306 _OMAP4_BALLENTRY(GPMC_NCS4, "a24", NULL),
1307 _OMAP4_BALLENTRY(GPMC_NCS5, "b24", NULL),
1308 _OMAP4_BALLENTRY(GPMC_NCS6, "c24", NULL),
1309 _OMAP4_BALLENTRY(GPMC_NCS7, "d24", NULL),
1310 _OMAP4_BALLENTRY(HDMI_HPD, "b9", NULL),
1311 _OMAP4_BALLENTRY(HDMI_CEC, "b10", NULL),
1312 _OMAP4_BALLENTRY(HDMI_DDC_SCL, "a8", NULL),
1313 _OMAP4_BALLENTRY(HDMI_DDC_SDA, "b8", NULL),
1314 _OMAP4_BALLENTRY(CSI21_DX0, "r26", NULL),
1315 _OMAP4_BALLENTRY(CSI21_DY0, "r25", NULL),
1316 _OMAP4_BALLENTRY(CSI21_DX1, "t26", NULL),
1317 _OMAP4_BALLENTRY(CSI21_DY1, "t25", NULL),
1318 _OMAP4_BALLENTRY(CSI21_DX2, "u26", NULL),
1319 _OMAP4_BALLENTRY(CSI21_DY2, "u25", NULL),
1320 _OMAP4_BALLENTRY(CSI21_DX3, "v26", NULL),
1321 _OMAP4_BALLENTRY(CSI21_DY3, "v25", NULL),
1322 _OMAP4_BALLENTRY(CSI21_DX4, "w26", NULL),
1323 _OMAP4_BALLENTRY(CSI21_DY4, "w25", NULL),
1324 _OMAP4_BALLENTRY(CSI22_DX0, "m26", NULL),
1325 _OMAP4_BALLENTRY(CSI22_DY0, "m25", NULL),
1326 _OMAP4_BALLENTRY(CSI22_DX1, "n26", NULL),
1327 _OMAP4_BALLENTRY(CSI22_DY1, "n25", NULL),
1328 _OMAP4_BALLENTRY(CAM_SHUTTER, "t27", NULL),
1329 _OMAP4_BALLENTRY(CAM_STROBE, "u27", NULL),
1330 _OMAP4_BALLENTRY(CAM_GLOBALRESET, "v27", NULL),
1331 _OMAP4_BALLENTRY(USBB1_ULPITLL_CLK, "ae18", NULL),
1332 _OMAP4_BALLENTRY(USBB1_ULPITLL_STP, "ag19", NULL),
1333 _OMAP4_BALLENTRY(USBB1_ULPITLL_DIR, "af19", NULL),
1334 _OMAP4_BALLENTRY(USBB1_ULPITLL_NXT, "ae19", NULL),
1335 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT0, "af18", NULL),
1336 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT1, "ag18", NULL),
1337 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT2, "ae17", NULL),
1338 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT3, "af17", NULL),
1339 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT4, "ah17", NULL),
1340 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT5, "ae16", NULL),
1341 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT6, "af16", NULL),
1342 _OMAP4_BALLENTRY(USBB1_ULPITLL_DAT7, "ag16", NULL),
1343 _OMAP4_BALLENTRY(USBB1_HSIC_DATA, "af14", NULL),
1344 _OMAP4_BALLENTRY(USBB1_HSIC_STROBE, "ae14", NULL),
1345 _OMAP4_BALLENTRY(USBC1_ICUSB_DP, "h2", NULL),
1346 _OMAP4_BALLENTRY(USBC1_ICUSB_DM, "h3", NULL),
1347 _OMAP4_BALLENTRY(SDMMC1_CLK, "d2", NULL),
1348 _OMAP4_BALLENTRY(SDMMC1_CMD, "e3", NULL),
1349 _OMAP4_BALLENTRY(SDMMC1_DAT0, "e4", NULL),
1350 _OMAP4_BALLENTRY(SDMMC1_DAT1, "e2", NULL),
1351 _OMAP4_BALLENTRY(SDMMC1_DAT2, "e1", NULL),
1352 _OMAP4_BALLENTRY(SDMMC1_DAT3, "f4", NULL),
1353 _OMAP4_BALLENTRY(SDMMC1_DAT4, "f3", NULL),
1354 _OMAP4_BALLENTRY(SDMMC1_DAT5, "f1", NULL),
1355 _OMAP4_BALLENTRY(SDMMC1_DAT6, "g4", NULL),
1356 _OMAP4_BALLENTRY(SDMMC1_DAT7, "g3", NULL),
1357 _OMAP4_BALLENTRY(ABE_MCBSP2_CLKX, "ad27", NULL),
1358 _OMAP4_BALLENTRY(ABE_MCBSP2_DR, "ad26", NULL),
1359 _OMAP4_BALLENTRY(ABE_MCBSP2_DX, "ad25", NULL),
1360 _OMAP4_BALLENTRY(ABE_MCBSP2_FSX, "ac28", NULL),
1361 _OMAP4_BALLENTRY(ABE_MCBSP1_CLKX, "ac26", NULL),
1362 _OMAP4_BALLENTRY(ABE_MCBSP1_DR, "ac25", NULL),
1363 _OMAP4_BALLENTRY(ABE_MCBSP1_DX, "ab25", NULL),
1364 _OMAP4_BALLENTRY(ABE_MCBSP1_FSX, "ac27", NULL),
1365 _OMAP4_BALLENTRY(ABE_PDM_UL_DATA, "ag25", NULL),
1366 _OMAP4_BALLENTRY(ABE_PDM_DL_DATA, "af25", NULL),
1367 _OMAP4_BALLENTRY(ABE_PDM_FRAME, "ae25", NULL),
1368 _OMAP4_BALLENTRY(ABE_PDM_LB_CLK, "af26", NULL),
1369 _OMAP4_BALLENTRY(ABE_CLKS, "ah26", NULL),
1370 _OMAP4_BALLENTRY(ABE_DMIC_CLK1, "ae24", NULL),
1371 _OMAP4_BALLENTRY(ABE_DMIC_DIN1, "af24", NULL),
1372 _OMAP4_BALLENTRY(ABE_DMIC_DIN2, "ag24", NULL),
1373 _OMAP4_BALLENTRY(ABE_DMIC_DIN3, "ah24", NULL),
1374 _OMAP4_BALLENTRY(UART2_CTS, "ab26", NULL),
1375 _OMAP4_BALLENTRY(UART2_RTS, "ab27", NULL),
1376 _OMAP4_BALLENTRY(UART2_RX, "aa25", NULL),
1377 _OMAP4_BALLENTRY(UART2_TX, "aa26", NULL),
1378 _OMAP4_BALLENTRY(HDQ_SIO, "aa27", NULL),
1379 _OMAP4_BALLENTRY(I2C1_SCL, "ae28", NULL),
1380 _OMAP4_BALLENTRY(I2C1_SDA, "ae26", NULL),
1381 _OMAP4_BALLENTRY(I2C2_SCL, "c26", NULL),
1382 _OMAP4_BALLENTRY(I2C2_SDA, "d26", NULL),
1383 _OMAP4_BALLENTRY(I2C3_SCL, "w27", NULL),
1384 _OMAP4_BALLENTRY(I2C3_SDA, "y27", NULL),
1385 _OMAP4_BALLENTRY(I2C4_SCL, "ag21", NULL),
1386 _OMAP4_BALLENTRY(I2C4_SDA, "ah22", NULL),
1387 _OMAP4_BALLENTRY(MCSPI1_CLK, "af22", NULL),
1388 _OMAP4_BALLENTRY(MCSPI1_SOMI, "ae22", NULL),
1389 _OMAP4_BALLENTRY(MCSPI1_SIMO, "ag22", NULL),
1390 _OMAP4_BALLENTRY(MCSPI1_CS0, "ae23", NULL),
1391 _OMAP4_BALLENTRY(MCSPI1_CS1, "af23", NULL),
1392 _OMAP4_BALLENTRY(MCSPI1_CS2, "ag23", NULL),
1393 _OMAP4_BALLENTRY(MCSPI1_CS3, "ah23", NULL),
1394 _OMAP4_BALLENTRY(UART3_CTS_RCTX, "f27", NULL),
1395 _OMAP4_BALLENTRY(UART3_RTS_SD, "f28", NULL),
1396 _OMAP4_BALLENTRY(UART3_RX_IRRX, "g27", NULL),
1397 _OMAP4_BALLENTRY(UART3_TX_IRTX, "g28", NULL),
1398 _OMAP4_BALLENTRY(SDMMC5_CLK, "ae5", NULL),
1399 _OMAP4_BALLENTRY(SDMMC5_CMD, "af5", NULL),
1400 _OMAP4_BALLENTRY(SDMMC5_DAT0, "ae4", NULL),
1401 _OMAP4_BALLENTRY(SDMMC5_DAT1, "af4", NULL),
1402 _OMAP4_BALLENTRY(SDMMC5_DAT2, "ag3", NULL),
1403 _OMAP4_BALLENTRY(SDMMC5_DAT3, "af3", NULL),
1404 _OMAP4_BALLENTRY(MCSPI4_CLK, "ae21", NULL),
1405 _OMAP4_BALLENTRY(MCSPI4_SIMO, "af20", NULL),
1406 _OMAP4_BALLENTRY(MCSPI4_SOMI, "af21", NULL),
1407 _OMAP4_BALLENTRY(MCSPI4_CS0, "ae20", NULL),
1408 _OMAP4_BALLENTRY(UART4_RX, "ag20", NULL),
1409 _OMAP4_BALLENTRY(UART4_TX, "ah19", NULL),
1410 _OMAP4_BALLENTRY(USBB2_ULPITLL_CLK, "ag12", NULL),
1411 _OMAP4_BALLENTRY(USBB2_ULPITLL_STP, "af12", NULL),
1412 _OMAP4_BALLENTRY(USBB2_ULPITLL_DIR, "ae12", NULL),
1413 _OMAP4_BALLENTRY(USBB2_ULPITLL_NXT, "ag13", NULL),
1414 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT0, "ae11", NULL),
1415 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT1, "af11", NULL),
1416 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT2, "ag11", NULL),
1417 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT3, "ah11", NULL),
1418 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT4, "ae10", NULL),
1419 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT5, "af10", NULL),
1420 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT6, "ag10", NULL),
1421 _OMAP4_BALLENTRY(USBB2_ULPITLL_DAT7, "ae9", NULL),
1422 _OMAP4_BALLENTRY(USBB2_HSIC_DATA, "af13", NULL),
1423 _OMAP4_BALLENTRY(USBB2_HSIC_STROBE, "ae13", NULL),
1424 _OMAP4_BALLENTRY(KPD_COL3, "g26", NULL),
1425 _OMAP4_BALLENTRY(KPD_COL4, "g25", NULL),
1426 _OMAP4_BALLENTRY(KPD_COL5, "h26", NULL),
1427 _OMAP4_BALLENTRY(KPD_COL0, "h25", NULL),
1428 _OMAP4_BALLENTRY(KPD_COL1, "j27", NULL),
1429 _OMAP4_BALLENTRY(KPD_COL2, "h27", NULL),
1430 _OMAP4_BALLENTRY(KPD_ROW3, "j26", NULL),
1431 _OMAP4_BALLENTRY(KPD_ROW4, "j25", NULL),
1432 _OMAP4_BALLENTRY(KPD_ROW5, "k26", NULL),
1433 _OMAP4_BALLENTRY(KPD_ROW0, "k25", NULL),
1434 _OMAP4_BALLENTRY(KPD_ROW1, "l27", NULL),
1435 _OMAP4_BALLENTRY(KPD_ROW2, "k27", NULL),
1436 _OMAP4_BALLENTRY(USBA0_OTG_CE, "c3", NULL),
1437 _OMAP4_BALLENTRY(USBA0_OTG_DP, "b5", NULL),
1438 _OMAP4_BALLENTRY(USBA0_OTG_DM, "b4", NULL),
1439 _OMAP4_BALLENTRY(FREF_CLK1_OUT, "aa28", NULL),
1440 _OMAP4_BALLENTRY(FREF_CLK2_OUT, "y28", NULL),
1441 _OMAP4_BALLENTRY(SYS_NIRQ1, "ae6", NULL),
1442 _OMAP4_BALLENTRY(SYS_NIRQ2, "af6", NULL),
1443 _OMAP4_BALLENTRY(SYS_BOOT0, "f26", NULL),
1444 _OMAP4_BALLENTRY(SYS_BOOT1, "e27", NULL),
1445 _OMAP4_BALLENTRY(SYS_BOOT2, "e26", NULL),
1446 _OMAP4_BALLENTRY(SYS_BOOT3, "e25", NULL),
1447 _OMAP4_BALLENTRY(SYS_BOOT4, "d28", NULL),
1448 _OMAP4_BALLENTRY(SYS_BOOT5, "d27", NULL),
1449 _OMAP4_BALLENTRY(DPM_EMU0, "m2", NULL),
1450 _OMAP4_BALLENTRY(DPM_EMU1, "n2", NULL),
1451 _OMAP4_BALLENTRY(DPM_EMU2, "p2", NULL),
1452 _OMAP4_BALLENTRY(DPM_EMU3, "v1", NULL),
1453 _OMAP4_BALLENTRY(DPM_EMU4, "v2", NULL),
1454 _OMAP4_BALLENTRY(DPM_EMU5, "w1", NULL),
1455 _OMAP4_BALLENTRY(DPM_EMU6, "w2", NULL),
1456 _OMAP4_BALLENTRY(DPM_EMU7, "w3", NULL),
1457 _OMAP4_BALLENTRY(DPM_EMU8, "w4", NULL),
1458 _OMAP4_BALLENTRY(DPM_EMU9, "y2", NULL),
1459 _OMAP4_BALLENTRY(DPM_EMU10, "y3", NULL),
1460 _OMAP4_BALLENTRY(DPM_EMU11, "y4", NULL),
1461 _OMAP4_BALLENTRY(DPM_EMU12, "aa1", NULL),
1462 _OMAP4_BALLENTRY(DPM_EMU13, "aa2", NULL),
1463 _OMAP4_BALLENTRY(DPM_EMU14, "aa3", NULL),
1464 _OMAP4_BALLENTRY(DPM_EMU15, "aa4", NULL),
1465 _OMAP4_BALLENTRY(DPM_EMU16, "ab2", NULL),
1466 _OMAP4_BALLENTRY(DPM_EMU17, "ab3", NULL),
1467 _OMAP4_BALLENTRY(DPM_EMU18, "ab4", NULL),
1468 _OMAP4_BALLENTRY(DPM_EMU19, "ac4", NULL),
1469 { .reg_offset = OMAP_MUX_TERMINATOR },
1470};
1471#else
1472#define omap4_core_cbs_ball NULL
1473#endif
1474
1475/*
1476 * Superset of all mux modes for omap4
1477 */
1478static struct omap_mux __initdata omap4_wkup_muxmodes[] = {
1479 _OMAP4_MUXENTRY(SIM_IO, 0, "sim_io", NULL, NULL, "gpio_wk0", NULL,
1480 NULL, NULL, "safe_mode"),
1481 _OMAP4_MUXENTRY(SIM_CLK, 1, "sim_clk", NULL, NULL, "gpio_wk1", NULL,
1482 NULL, NULL, "safe_mode"),
1483 _OMAP4_MUXENTRY(SIM_RESET, 2, "sim_reset", NULL, NULL, "gpio_wk2",
1484 NULL, NULL, NULL, "safe_mode"),
1485 _OMAP4_MUXENTRY(SIM_CD, 3, "sim_cd", NULL, NULL, "gpio_wk3", NULL,
1486 NULL, NULL, "safe_mode"),
1487 _OMAP4_MUXENTRY(SIM_PWRCTRL, 4, "sim_pwrctrl", NULL, NULL, "gpio_wk4",
1488 NULL, NULL, NULL, "safe_mode"),
1489 _OMAP4_MUXENTRY(SR_SCL, 0, "sr_scl", NULL, NULL, NULL, NULL, NULL,
1490 NULL, NULL),
1491 _OMAP4_MUXENTRY(SR_SDA, 0, "sr_sda", NULL, NULL, NULL, NULL, NULL,
1492 NULL, NULL),
1493 _OMAP4_MUXENTRY(FREF_XTAL_IN, 0, "fref_xtal_in", NULL, NULL, NULL,
1494 "c2c_wakereqin", NULL, NULL, NULL),
1495 _OMAP4_MUXENTRY(FREF_SLICER_IN, 0, "fref_slicer_in", NULL, NULL,
1496 "gpi_wk5", "c2c_wakereqin", NULL, NULL, "safe_mode"),
1497 _OMAP4_MUXENTRY(FREF_CLK_IOREQ, 0, "fref_clk_ioreq", NULL, NULL, NULL,
1498 NULL, NULL, NULL, NULL),
1499 _OMAP4_MUXENTRY(FREF_CLK0_OUT, 6, "fref_clk0_out", "fref_clk1_req",
1500 "sys_drm_msecure", "gpio_wk6", NULL, NULL, NULL,
1501 "safe_mode"),
1502 _OMAP4_MUXENTRY(FREF_CLK3_REQ, 30, "fref_clk3_req", "fref_clk1_req",
1503 "sys_drm_msecure", "gpio_wk30", "c2c_wakereqin", NULL,
1504 NULL, "safe_mode"),
1505 _OMAP4_MUXENTRY(FREF_CLK3_OUT, 31, "fref_clk3_out", "fref_clk2_req",
1506 "sys_secure_indicator", "gpio_wk31", "c2c_wakereqout",
1507 NULL, NULL, "safe_mode"),
1508 _OMAP4_MUXENTRY(FREF_CLK4_REQ, 7, "fref_clk4_req", "fref_clk5_out",
1509 NULL, "gpio_wk7", NULL, NULL, NULL, NULL),
1510 _OMAP4_MUXENTRY(FREF_CLK4_OUT, 8, "fref_clk4_out", NULL, NULL,
1511 "gpio_wk8", NULL, NULL, NULL, NULL),
1512 _OMAP4_MUXENTRY(SYS_32K, 0, "sys_32k", NULL, NULL, NULL, NULL, NULL,
1513 NULL, NULL),
1514 _OMAP4_MUXENTRY(SYS_NRESPWRON, 0, "sys_nrespwron", NULL, NULL, NULL,
1515 NULL, NULL, NULL, NULL),
1516 _OMAP4_MUXENTRY(SYS_NRESWARM, 0, "sys_nreswarm", NULL, NULL, NULL,
1517 NULL, NULL, NULL, NULL),
1518 _OMAP4_MUXENTRY(SYS_PWR_REQ, 0, "sys_pwr_req", NULL, NULL, NULL, NULL,
1519 NULL, NULL, NULL),
1520 _OMAP4_MUXENTRY(SYS_PWRON_RESET_OUT, 29, "sys_pwron_reset_out", NULL,
1521 NULL, "gpio_wk29", NULL, NULL, NULL, NULL),
1522 _OMAP4_MUXENTRY(SYS_BOOT6, 9, "sys_boot6", "dpm_emu18", NULL,
1523 "gpio_wk9", "c2c_wakereqout", NULL, NULL,
1524 "safe_mode"),
1525 _OMAP4_MUXENTRY(SYS_BOOT7, 10, "sys_boot7", "dpm_emu19", NULL,
1526 "gpio_wk10", NULL, NULL, NULL, "safe_mode"),
1527 _OMAP4_MUXENTRY(JTAG_NTRST, 0, "jtag_ntrst", NULL, NULL, NULL, NULL,
1528 NULL, NULL, NULL),
1529 _OMAP4_MUXENTRY(JTAG_TCK, 0, "jtag_tck", NULL, NULL, NULL, NULL, NULL,
1530 NULL, "safe_mode"),
1531 _OMAP4_MUXENTRY(JTAG_RTCK, 0, "jtag_rtck", NULL, NULL, NULL, NULL,
1532 NULL, NULL, NULL),
1533 _OMAP4_MUXENTRY(JTAG_TMS_TMSC, 0, "jtag_tms_tmsc", NULL, NULL, NULL,
1534 NULL, NULL, NULL, "safe_mode"),
1535 _OMAP4_MUXENTRY(JTAG_TDI, 0, "jtag_tdi", NULL, NULL, NULL, NULL, NULL,
1536 NULL, NULL),
1537 _OMAP4_MUXENTRY(JTAG_TDO, 0, "jtag_tdo", NULL, NULL, NULL, NULL, NULL,
1538 NULL, NULL),
1539 { .reg_offset = OMAP_MUX_TERMINATOR },
1540};
1541
1542/*
1543 * Balls for 44XX CBL & CBS package - wakeup partition
1544 * 547-pin CBL ES1.0 S-FPGA-N547, 0.40mm Ball Pitch (Top),
1545 * 0.40mm Ball Pitch (Bottom)
1546 */
1547#if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS) \
1548 && defined(CONFIG_OMAP_PACKAGE_CBL)
1549struct omap_ball __initdata omap4_wkup_cbl_cbs_ball[] = {
1550 _OMAP4_BALLENTRY(SIM_IO, "h4", NULL),
1551 _OMAP4_BALLENTRY(SIM_CLK, "j2", NULL),
1552 _OMAP4_BALLENTRY(SIM_RESET, "g2", NULL),
1553 _OMAP4_BALLENTRY(SIM_CD, "j1", NULL),
1554 _OMAP4_BALLENTRY(SIM_PWRCTRL, "k1", NULL),
1555 _OMAP4_BALLENTRY(SR_SCL, "ag9", NULL),
1556 _OMAP4_BALLENTRY(SR_SDA, "af9", NULL),
1557 _OMAP4_BALLENTRY(FREF_XTAL_IN, "ah6", NULL),
1558 _OMAP4_BALLENTRY(FREF_SLICER_IN, "ag8", NULL),
1559 _OMAP4_BALLENTRY(FREF_CLK_IOREQ, "ad1", NULL),
1560 _OMAP4_BALLENTRY(FREF_CLK0_OUT, "ad2", NULL),
1561 _OMAP4_BALLENTRY(FREF_CLK3_REQ, "ad3", NULL),
1562 _OMAP4_BALLENTRY(FREF_CLK3_OUT, "ad4", NULL),
1563 _OMAP4_BALLENTRY(FREF_CLK4_REQ, "ac2", NULL),
1564 _OMAP4_BALLENTRY(FREF_CLK4_OUT, "ac3", NULL),
1565 _OMAP4_BALLENTRY(SYS_32K, "ag7", NULL),
1566 _OMAP4_BALLENTRY(SYS_NRESPWRON, "ae7", NULL),
1567 _OMAP4_BALLENTRY(SYS_NRESWARM, "af7", NULL),
1568 _OMAP4_BALLENTRY(SYS_PWR_REQ, "ah7", NULL),
1569 _OMAP4_BALLENTRY(SYS_PWRON_RESET_OUT, "ag6", NULL),
1570 _OMAP4_BALLENTRY(SYS_BOOT6, "af8", NULL),
1571 _OMAP4_BALLENTRY(SYS_BOOT7, "ae8", NULL),
1572 _OMAP4_BALLENTRY(JTAG_NTRST, "ah2", NULL),
1573 _OMAP4_BALLENTRY(JTAG_TCK, "ag1", NULL),
1574 _OMAP4_BALLENTRY(JTAG_RTCK, "ae3", NULL),
1575 _OMAP4_BALLENTRY(JTAG_TMS_TMSC, "ah1", NULL),
1576 _OMAP4_BALLENTRY(JTAG_TDI, "ae1", NULL),
1577 _OMAP4_BALLENTRY(JTAG_TDO, "ae2", NULL),
1578 { .reg_offset = OMAP_MUX_TERMINATOR },
1579};
1580#else
1581#define omap4_wkup_cbl_cbs_ball NULL
1582#endif
1583
1584int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags)
1585{
1586 struct omap_ball *package_balls_core;
1587 struct omap_ball *package_balls_wkup = omap4_wkup_cbl_cbs_ball;
1588 struct omap_mux *core_muxmodes;
1589 int ret;
1590
1591 switch (flags & OMAP_PACKAGE_MASK) {
1592 case OMAP_PACKAGE_CBL:
1593 pr_debug("%s: OMAP4430 ES1.0 -> OMAP_PACKAGE_CBL\n", __func__);
1594 package_balls_core = omap4_core_cbl_ball;
1595 core_muxmodes = omap4_core_muxmodes;
1596 break;
1597 case OMAP_PACKAGE_CBS:
1598 pr_debug("%s: OMAP4430 ES2.X -> OMAP_PACKAGE_CBS\n", __func__);
1599 package_balls_core = omap4_core_cbs_ball;
1600 core_muxmodes = omap4_es2_core_muxmodes;
1601 break;
1602 default:
1603 pr_err("%s: Unknown omap package, mux disabled\n", __func__);
1604 return -EINVAL;
1605 }
1606
1607 ret = omap_mux_init("core",
1608 OMAP_MUX_GPIO_IN_MODE3,
1609 OMAP4_CTRL_MODULE_PAD_CORE_MUX_PBASE,
1610 OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE,
1611 core_muxmodes, NULL, board_subset,
1612 package_balls_core);
1613 if (ret)
1614 return ret;
1615
1616 ret = omap_mux_init("wkup",
1617 OMAP_MUX_GPIO_IN_MODE3,
1618 OMAP4_CTRL_MODULE_PAD_WKUP_MUX_PBASE,
1619 OMAP4_CTRL_MODULE_PAD_WKUP_MUX_SIZE,
1620 omap4_wkup_muxmodes, NULL, board_subset,
1621 package_balls_wkup);
1622
1623 return ret;
1624}
1625
diff --git a/arch/arm/mach-omap2/mux44xx.h b/arch/arm/mach-omap2/mux44xx.h
new file mode 100644
index 000000000000..c635026cd7e9
--- /dev/null
+++ b/arch/arm/mach-omap2/mux44xx.h
@@ -0,0 +1,298 @@
1/*
2 * OMAP44xx MUX registers and bitfields
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 *
6 * Benoit Cousson (b-cousson@ti.com)
7 *
8 * This file is automatically generated from the OMAP hardware databases.
9 * We respectfully ask that any modifications to this file be coordinated
10 * with the public linux-omap@vger.kernel.org mailing list and the
11 * authors above to ensure that the autogeneration scripts are kept
12 * up-to-date with the file contents.
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#ifndef __ARCH_ARM_MACH_OMAP2_MUX_44XX_H
20#define __ARCH_ARM_MACH_OMAP2_MUX_44XX_H
21
22#define OMAP4_MUX(M0, mux_value) \
23{ \
24 .reg_offset = (OMAP4_CTRL_MODULE_PAD_##M0##_OFFSET), \
25 .value = (mux_value), \
26}
27
28/* ctrl_module_pad_core base address */
29#define OMAP4_CTRL_MODULE_PAD_CORE_MUX_PBASE 0x4a100000
30
31/* ctrl_module_pad_core registers offset */
32#define OMAP4_CTRL_MODULE_PAD_GPMC_AD0_OFFSET 0x0040
33#define OMAP4_CTRL_MODULE_PAD_GPMC_AD1_OFFSET 0x0042
34#define OMAP4_CTRL_MODULE_PAD_GPMC_AD2_OFFSET 0x0044
35#define OMAP4_CTRL_MODULE_PAD_GPMC_AD3_OFFSET 0x0046
36#define OMAP4_CTRL_MODULE_PAD_GPMC_AD4_OFFSET 0x0048
37#define OMAP4_CTRL_MODULE_PAD_GPMC_AD5_OFFSET 0x004a
38#define OMAP4_CTRL_MODULE_PAD_GPMC_AD6_OFFSET 0x004c
39#define OMAP4_CTRL_MODULE_PAD_GPMC_AD7_OFFSET 0x004e
40#define OMAP4_CTRL_MODULE_PAD_GPMC_AD8_OFFSET 0x0050
41#define OMAP4_CTRL_MODULE_PAD_GPMC_AD9_OFFSET 0x0052
42#define OMAP4_CTRL_MODULE_PAD_GPMC_AD10_OFFSET 0x0054
43#define OMAP4_CTRL_MODULE_PAD_GPMC_AD11_OFFSET 0x0056
44#define OMAP4_CTRL_MODULE_PAD_GPMC_AD12_OFFSET 0x0058
45#define OMAP4_CTRL_MODULE_PAD_GPMC_AD13_OFFSET 0x005a
46#define OMAP4_CTRL_MODULE_PAD_GPMC_AD14_OFFSET 0x005c
47#define OMAP4_CTRL_MODULE_PAD_GPMC_AD15_OFFSET 0x005e
48#define OMAP4_CTRL_MODULE_PAD_GPMC_A16_OFFSET 0x0060
49#define OMAP4_CTRL_MODULE_PAD_GPMC_A17_OFFSET 0x0062
50#define OMAP4_CTRL_MODULE_PAD_GPMC_A18_OFFSET 0x0064
51#define OMAP4_CTRL_MODULE_PAD_GPMC_A19_OFFSET 0x0066
52#define OMAP4_CTRL_MODULE_PAD_GPMC_A20_OFFSET 0x0068
53#define OMAP4_CTRL_MODULE_PAD_GPMC_A21_OFFSET 0x006a
54#define OMAP4_CTRL_MODULE_PAD_GPMC_A22_OFFSET 0x006c
55#define OMAP4_CTRL_MODULE_PAD_GPMC_A23_OFFSET 0x006e
56#define OMAP4_CTRL_MODULE_PAD_GPMC_A24_OFFSET 0x0070
57#define OMAP4_CTRL_MODULE_PAD_GPMC_A25_OFFSET 0x0072
58#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS0_OFFSET 0x0074
59#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS1_OFFSET 0x0076
60#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS2_OFFSET 0x0078
61#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS3_OFFSET 0x007a
62#define OMAP4_CTRL_MODULE_PAD_GPMC_NWP_OFFSET 0x007c
63#define OMAP4_CTRL_MODULE_PAD_GPMC_CLK_OFFSET 0x007e
64#define OMAP4_CTRL_MODULE_PAD_GPMC_NADV_ALE_OFFSET 0x0080
65#define OMAP4_CTRL_MODULE_PAD_GPMC_NOE_OFFSET 0x0082
66#define OMAP4_CTRL_MODULE_PAD_GPMC_NWE_OFFSET 0x0084
67#define OMAP4_CTRL_MODULE_PAD_GPMC_NBE0_CLE_OFFSET 0x0086
68#define OMAP4_CTRL_MODULE_PAD_GPMC_NBE1_OFFSET 0x0088
69#define OMAP4_CTRL_MODULE_PAD_GPMC_WAIT0_OFFSET 0x008a
70#define OMAP4_CTRL_MODULE_PAD_GPMC_WAIT1_OFFSET 0x008c
71#define OMAP4_CTRL_MODULE_PAD_C2C_DATA11_OFFSET 0x008e
72#define OMAP4_CTRL_MODULE_PAD_C2C_DATA12_OFFSET 0x0090
73#define OMAP4_CTRL_MODULE_PAD_C2C_DATA13_OFFSET 0x0092
74#define OMAP4_CTRL_MODULE_PAD_C2C_DATA14_OFFSET 0x0094
75#define OMAP4_CTRL_MODULE_PAD_C2C_DATA15_OFFSET 0x0096
76#define OMAP4_CTRL_MODULE_PAD_HDMI_HPD_OFFSET 0x0098
77#define OMAP4_CTRL_MODULE_PAD_HDMI_CEC_OFFSET 0x009a
78#define OMAP4_CTRL_MODULE_PAD_HDMI_DDC_SCL_OFFSET 0x009c
79#define OMAP4_CTRL_MODULE_PAD_HDMI_DDC_SDA_OFFSET 0x009e
80#define OMAP4_CTRL_MODULE_PAD_CSI21_DX0_OFFSET 0x00a0
81#define OMAP4_CTRL_MODULE_PAD_CSI21_DY0_OFFSET 0x00a2
82#define OMAP4_CTRL_MODULE_PAD_CSI21_DX1_OFFSET 0x00a4
83#define OMAP4_CTRL_MODULE_PAD_CSI21_DY1_OFFSET 0x00a6
84#define OMAP4_CTRL_MODULE_PAD_CSI21_DX2_OFFSET 0x00a8
85#define OMAP4_CTRL_MODULE_PAD_CSI21_DY2_OFFSET 0x00aa
86#define OMAP4_CTRL_MODULE_PAD_CSI21_DX3_OFFSET 0x00ac
87#define OMAP4_CTRL_MODULE_PAD_CSI21_DY3_OFFSET 0x00ae
88#define OMAP4_CTRL_MODULE_PAD_CSI21_DX4_OFFSET 0x00b0
89#define OMAP4_CTRL_MODULE_PAD_CSI21_DY4_OFFSET 0x00b2
90#define OMAP4_CTRL_MODULE_PAD_CSI22_DX0_OFFSET 0x00b4
91#define OMAP4_CTRL_MODULE_PAD_CSI22_DY0_OFFSET 0x00b6
92#define OMAP4_CTRL_MODULE_PAD_CSI22_DX1_OFFSET 0x00b8
93#define OMAP4_CTRL_MODULE_PAD_CSI22_DY1_OFFSET 0x00ba
94#define OMAP4_CTRL_MODULE_PAD_CAM_SHUTTER_OFFSET 0x00bc
95#define OMAP4_CTRL_MODULE_PAD_CAM_STROBE_OFFSET 0x00be
96#define OMAP4_CTRL_MODULE_PAD_CAM_GLOBALRESET_OFFSET 0x00c0
97#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_CLK_OFFSET 0x00c2
98#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_STP_OFFSET 0x00c4
99#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DIR_OFFSET 0x00c6
100#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_NXT_OFFSET 0x00c8
101#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT0_OFFSET 0x00ca
102#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT1_OFFSET 0x00cc
103#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT2_OFFSET 0x00ce
104#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT3_OFFSET 0x00d0
105#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT4_OFFSET 0x00d2
106#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT5_OFFSET 0x00d4
107#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT6_OFFSET 0x00d6
108#define OMAP4_CTRL_MODULE_PAD_USBB1_ULPITLL_DAT7_OFFSET 0x00d8
109#define OMAP4_CTRL_MODULE_PAD_USBB1_HSIC_DATA_OFFSET 0x00da
110#define OMAP4_CTRL_MODULE_PAD_USBB1_HSIC_STROBE_OFFSET 0x00dc
111#define OMAP4_CTRL_MODULE_PAD_USBC1_ICUSB_DP_OFFSET 0x00de
112#define OMAP4_CTRL_MODULE_PAD_USBC1_ICUSB_DM_OFFSET 0x00e0
113#define OMAP4_CTRL_MODULE_PAD_SDMMC1_CLK_OFFSET 0x00e2
114#define OMAP4_CTRL_MODULE_PAD_SDMMC1_CMD_OFFSET 0x00e4
115#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT0_OFFSET 0x00e6
116#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT1_OFFSET 0x00e8
117#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT2_OFFSET 0x00ea
118#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT3_OFFSET 0x00ec
119#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT4_OFFSET 0x00ee
120#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT5_OFFSET 0x00f0
121#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT6_OFFSET 0x00f2
122#define OMAP4_CTRL_MODULE_PAD_SDMMC1_DAT7_OFFSET 0x00f4
123#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP2_CLKX_OFFSET 0x00f6
124#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP2_DR_OFFSET 0x00f8
125#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP2_DX_OFFSET 0x00fa
126#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP2_FSX_OFFSET 0x00fc
127#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP1_CLKX_OFFSET 0x00fe
128#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP1_DR_OFFSET 0x0100
129#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP1_DX_OFFSET 0x0102
130#define OMAP4_CTRL_MODULE_PAD_ABE_MCBSP1_FSX_OFFSET 0x0104
131#define OMAP4_CTRL_MODULE_PAD_ABE_PDM_UL_DATA_OFFSET 0x0106
132#define OMAP4_CTRL_MODULE_PAD_ABE_PDM_DL_DATA_OFFSET 0x0108
133#define OMAP4_CTRL_MODULE_PAD_ABE_PDM_FRAME_OFFSET 0x010a
134#define OMAP4_CTRL_MODULE_PAD_ABE_PDM_LB_CLK_OFFSET 0x010c
135#define OMAP4_CTRL_MODULE_PAD_ABE_CLKS_OFFSET 0x010e
136#define OMAP4_CTRL_MODULE_PAD_ABE_DMIC_CLK1_OFFSET 0x0110
137#define OMAP4_CTRL_MODULE_PAD_ABE_DMIC_DIN1_OFFSET 0x0112
138#define OMAP4_CTRL_MODULE_PAD_ABE_DMIC_DIN2_OFFSET 0x0114
139#define OMAP4_CTRL_MODULE_PAD_ABE_DMIC_DIN3_OFFSET 0x0116
140#define OMAP4_CTRL_MODULE_PAD_UART2_CTS_OFFSET 0x0118
141#define OMAP4_CTRL_MODULE_PAD_UART2_RTS_OFFSET 0x011a
142#define OMAP4_CTRL_MODULE_PAD_UART2_RX_OFFSET 0x011c
143#define OMAP4_CTRL_MODULE_PAD_UART2_TX_OFFSET 0x011e
144#define OMAP4_CTRL_MODULE_PAD_HDQ_SIO_OFFSET 0x0120
145#define OMAP4_CTRL_MODULE_PAD_I2C1_SCL_OFFSET 0x0122
146#define OMAP4_CTRL_MODULE_PAD_I2C1_SDA_OFFSET 0x0124
147#define OMAP4_CTRL_MODULE_PAD_I2C2_SCL_OFFSET 0x0126
148#define OMAP4_CTRL_MODULE_PAD_I2C2_SDA_OFFSET 0x0128
149#define OMAP4_CTRL_MODULE_PAD_I2C3_SCL_OFFSET 0x012a
150#define OMAP4_CTRL_MODULE_PAD_I2C3_SDA_OFFSET 0x012c
151#define OMAP4_CTRL_MODULE_PAD_I2C4_SCL_OFFSET 0x012e
152#define OMAP4_CTRL_MODULE_PAD_I2C4_SDA_OFFSET 0x0130
153#define OMAP4_CTRL_MODULE_PAD_MCSPI1_CLK_OFFSET 0x0132
154#define OMAP4_CTRL_MODULE_PAD_MCSPI1_SOMI_OFFSET 0x0134
155#define OMAP4_CTRL_MODULE_PAD_MCSPI1_SIMO_OFFSET 0x0136
156#define OMAP4_CTRL_MODULE_PAD_MCSPI1_CS0_OFFSET 0x0138
157#define OMAP4_CTRL_MODULE_PAD_MCSPI1_CS1_OFFSET 0x013a
158#define OMAP4_CTRL_MODULE_PAD_MCSPI1_CS2_OFFSET 0x013c
159#define OMAP4_CTRL_MODULE_PAD_MCSPI1_CS3_OFFSET 0x013e
160#define OMAP4_CTRL_MODULE_PAD_UART3_CTS_RCTX_OFFSET 0x0140
161#define OMAP4_CTRL_MODULE_PAD_UART3_RTS_SD_OFFSET 0x0142
162#define OMAP4_CTRL_MODULE_PAD_UART3_RX_IRRX_OFFSET 0x0144
163#define OMAP4_CTRL_MODULE_PAD_UART3_TX_IRTX_OFFSET 0x0146
164#define OMAP4_CTRL_MODULE_PAD_SDMMC5_CLK_OFFSET 0x0148
165#define OMAP4_CTRL_MODULE_PAD_SDMMC5_CMD_OFFSET 0x014a
166#define OMAP4_CTRL_MODULE_PAD_SDMMC5_DAT0_OFFSET 0x014c
167#define OMAP4_CTRL_MODULE_PAD_SDMMC5_DAT1_OFFSET 0x014e
168#define OMAP4_CTRL_MODULE_PAD_SDMMC5_DAT2_OFFSET 0x0150
169#define OMAP4_CTRL_MODULE_PAD_SDMMC5_DAT3_OFFSET 0x0152
170#define OMAP4_CTRL_MODULE_PAD_MCSPI4_CLK_OFFSET 0x0154
171#define OMAP4_CTRL_MODULE_PAD_MCSPI4_SIMO_OFFSET 0x0156
172#define OMAP4_CTRL_MODULE_PAD_MCSPI4_SOMI_OFFSET 0x0158
173#define OMAP4_CTRL_MODULE_PAD_MCSPI4_CS0_OFFSET 0x015a
174#define OMAP4_CTRL_MODULE_PAD_UART4_RX_OFFSET 0x015c
175#define OMAP4_CTRL_MODULE_PAD_UART4_TX_OFFSET 0x015e
176#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_CLK_OFFSET 0x0160
177#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_STP_OFFSET 0x0162
178#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DIR_OFFSET 0x0164
179#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_NXT_OFFSET 0x0166
180#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT0_OFFSET 0x0168
181#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT1_OFFSET 0x016a
182#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT2_OFFSET 0x016c
183#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT3_OFFSET 0x016e
184#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT4_OFFSET 0x0170
185#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT5_OFFSET 0x0172
186#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT6_OFFSET 0x0174
187#define OMAP4_CTRL_MODULE_PAD_USBB2_ULPITLL_DAT7_OFFSET 0x0176
188#define OMAP4_CTRL_MODULE_PAD_USBB2_HSIC_DATA_OFFSET 0x0178
189#define OMAP4_CTRL_MODULE_PAD_USBB2_HSIC_STROBE_OFFSET 0x017a
190#define OMAP4_CTRL_MODULE_PAD_UNIPRO_TX0_OFFSET 0x017c
191#define OMAP4_CTRL_MODULE_PAD_UNIPRO_TY0_OFFSET 0x017e
192#define OMAP4_CTRL_MODULE_PAD_UNIPRO_TX1_OFFSET 0x0180
193#define OMAP4_CTRL_MODULE_PAD_UNIPRO_TY1_OFFSET 0x0182
194#define OMAP4_CTRL_MODULE_PAD_UNIPRO_TX2_OFFSET 0x0184
195#define OMAP4_CTRL_MODULE_PAD_UNIPRO_TY2_OFFSET 0x0186
196#define OMAP4_CTRL_MODULE_PAD_UNIPRO_RX0_OFFSET 0x0188
197#define OMAP4_CTRL_MODULE_PAD_UNIPRO_RY0_OFFSET 0x018a
198#define OMAP4_CTRL_MODULE_PAD_UNIPRO_RX1_OFFSET 0x018c
199#define OMAP4_CTRL_MODULE_PAD_UNIPRO_RY1_OFFSET 0x018e
200#define OMAP4_CTRL_MODULE_PAD_UNIPRO_RX2_OFFSET 0x0190
201#define OMAP4_CTRL_MODULE_PAD_UNIPRO_RY2_OFFSET 0x0192
202#define OMAP4_CTRL_MODULE_PAD_USBA0_OTG_CE_OFFSET 0x0194
203#define OMAP4_CTRL_MODULE_PAD_USBA0_OTG_DP_OFFSET 0x0196
204#define OMAP4_CTRL_MODULE_PAD_USBA0_OTG_DM_OFFSET 0x0198
205#define OMAP4_CTRL_MODULE_PAD_FREF_CLK1_OUT_OFFSET 0x019a
206#define OMAP4_CTRL_MODULE_PAD_FREF_CLK2_OUT_OFFSET 0x019c
207#define OMAP4_CTRL_MODULE_PAD_SYS_NIRQ1_OFFSET 0x019e
208#define OMAP4_CTRL_MODULE_PAD_SYS_NIRQ2_OFFSET 0x01a0
209#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT0_OFFSET 0x01a2
210#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT1_OFFSET 0x01a4
211#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT2_OFFSET 0x01a6
212#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT3_OFFSET 0x01a8
213#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT4_OFFSET 0x01aa
214#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT5_OFFSET 0x01ac
215#define OMAP4_CTRL_MODULE_PAD_DPM_EMU0_OFFSET 0x01ae
216#define OMAP4_CTRL_MODULE_PAD_DPM_EMU1_OFFSET 0x01b0
217#define OMAP4_CTRL_MODULE_PAD_DPM_EMU2_OFFSET 0x01b2
218#define OMAP4_CTRL_MODULE_PAD_DPM_EMU3_OFFSET 0x01b4
219#define OMAP4_CTRL_MODULE_PAD_DPM_EMU4_OFFSET 0x01b6
220#define OMAP4_CTRL_MODULE_PAD_DPM_EMU5_OFFSET 0x01b8
221#define OMAP4_CTRL_MODULE_PAD_DPM_EMU6_OFFSET 0x01ba
222#define OMAP4_CTRL_MODULE_PAD_DPM_EMU7_OFFSET 0x01bc
223#define OMAP4_CTRL_MODULE_PAD_DPM_EMU8_OFFSET 0x01be
224#define OMAP4_CTRL_MODULE_PAD_DPM_EMU9_OFFSET 0x01c0
225#define OMAP4_CTRL_MODULE_PAD_DPM_EMU10_OFFSET 0x01c2
226#define OMAP4_CTRL_MODULE_PAD_DPM_EMU11_OFFSET 0x01c4
227#define OMAP4_CTRL_MODULE_PAD_DPM_EMU12_OFFSET 0x01c6
228#define OMAP4_CTRL_MODULE_PAD_DPM_EMU13_OFFSET 0x01c8
229#define OMAP4_CTRL_MODULE_PAD_DPM_EMU14_OFFSET 0x01ca
230#define OMAP4_CTRL_MODULE_PAD_DPM_EMU15_OFFSET 0x01cc
231#define OMAP4_CTRL_MODULE_PAD_DPM_EMU16_OFFSET 0x01ce
232#define OMAP4_CTRL_MODULE_PAD_DPM_EMU17_OFFSET 0x01d0
233#define OMAP4_CTRL_MODULE_PAD_DPM_EMU18_OFFSET 0x01d2
234#define OMAP4_CTRL_MODULE_PAD_DPM_EMU19_OFFSET 0x01d4
235
236/* ES2.0 only */
237#define OMAP4_CTRL_MODULE_PAD_GPMC_WAIT2_OFFSET 0x008e
238#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS4_OFFSET 0x0090
239#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS5_OFFSET 0x0092
240#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS6_OFFSET 0x0094
241#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS7_OFFSET 0x0096
242
243#define OMAP4_CTRL_MODULE_PAD_KPD_COL3_OFFSET 0x017c
244#define OMAP4_CTRL_MODULE_PAD_KPD_COL4_OFFSET 0x017e
245#define OMAP4_CTRL_MODULE_PAD_KPD_COL5_OFFSET 0x0180
246#define OMAP4_CTRL_MODULE_PAD_KPD_COL0_OFFSET 0x0182
247#define OMAP4_CTRL_MODULE_PAD_KPD_COL1_OFFSET 0x0184
248#define OMAP4_CTRL_MODULE_PAD_KPD_COL2_OFFSET 0x0186
249#define OMAP4_CTRL_MODULE_PAD_KPD_ROW3_OFFSET 0x0188
250#define OMAP4_CTRL_MODULE_PAD_KPD_ROW4_OFFSET 0x018a
251#define OMAP4_CTRL_MODULE_PAD_KPD_ROW5_OFFSET 0x018c
252#define OMAP4_CTRL_MODULE_PAD_KPD_ROW0_OFFSET 0x018e
253#define OMAP4_CTRL_MODULE_PAD_KPD_ROW1_OFFSET 0x0190
254#define OMAP4_CTRL_MODULE_PAD_KPD_ROW2_OFFSET 0x0192
255
256
257#define OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE \
258 (OMAP4_CTRL_MODULE_PAD_DPM_EMU19_OFFSET \
259 - OMAP4_CTRL_MODULE_PAD_GPMC_AD0_OFFSET + 2)
260
261/* ctrl_module_pad_wkup base address */
262#define OMAP4_CTRL_MODULE_PAD_WKUP_MUX_PBASE 0x4a31e000
263
264/* ctrl_module_pad_wkup registers offset */
265#define OMAP4_CTRL_MODULE_PAD_SIM_IO_OFFSET 0x0040
266#define OMAP4_CTRL_MODULE_PAD_SIM_CLK_OFFSET 0x0042
267#define OMAP4_CTRL_MODULE_PAD_SIM_RESET_OFFSET 0x0044
268#define OMAP4_CTRL_MODULE_PAD_SIM_CD_OFFSET 0x0046
269#define OMAP4_CTRL_MODULE_PAD_SIM_PWRCTRL_OFFSET 0x0048
270#define OMAP4_CTRL_MODULE_PAD_SR_SCL_OFFSET 0x004a
271#define OMAP4_CTRL_MODULE_PAD_SR_SDA_OFFSET 0x004c
272#define OMAP4_CTRL_MODULE_PAD_FREF_XTAL_IN_OFFSET 0x004e
273#define OMAP4_CTRL_MODULE_PAD_FREF_SLICER_IN_OFFSET 0x0050
274#define OMAP4_CTRL_MODULE_PAD_FREF_CLK_IOREQ_OFFSET 0x0052
275#define OMAP4_CTRL_MODULE_PAD_FREF_CLK0_OUT_OFFSET 0x0054
276#define OMAP4_CTRL_MODULE_PAD_FREF_CLK3_REQ_OFFSET 0x0056
277#define OMAP4_CTRL_MODULE_PAD_FREF_CLK3_OUT_OFFSET 0x0058
278#define OMAP4_CTRL_MODULE_PAD_FREF_CLK4_REQ_OFFSET 0x005a
279#define OMAP4_CTRL_MODULE_PAD_FREF_CLK4_OUT_OFFSET 0x005c
280#define OMAP4_CTRL_MODULE_PAD_SYS_32K_OFFSET 0x005e
281#define OMAP4_CTRL_MODULE_PAD_SYS_NRESPWRON_OFFSET 0x0060
282#define OMAP4_CTRL_MODULE_PAD_SYS_NRESWARM_OFFSET 0x0062
283#define OMAP4_CTRL_MODULE_PAD_SYS_PWR_REQ_OFFSET 0x0064
284#define OMAP4_CTRL_MODULE_PAD_SYS_PWRON_RESET_OUT_OFFSET 0x0066
285#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT6_OFFSET 0x0068
286#define OMAP4_CTRL_MODULE_PAD_SYS_BOOT7_OFFSET 0x006a
287#define OMAP4_CTRL_MODULE_PAD_JTAG_NTRST_OFFSET 0x006c
288#define OMAP4_CTRL_MODULE_PAD_JTAG_TCK_OFFSET 0x006e
289#define OMAP4_CTRL_MODULE_PAD_JTAG_RTCK_OFFSET 0x0070
290#define OMAP4_CTRL_MODULE_PAD_JTAG_TMS_TMSC_OFFSET 0x0072
291#define OMAP4_CTRL_MODULE_PAD_JTAG_TDI_OFFSET 0x0074
292#define OMAP4_CTRL_MODULE_PAD_JTAG_TDO_OFFSET 0x0076
293
294#define OMAP4_CTRL_MODULE_PAD_WKUP_MUX_SIZE \
295 (OMAP4_CTRL_MODULE_PAD_JTAG_TDO_OFFSET \
296 - OMAP4_CTRL_MODULE_PAD_SIM_IO_OFFSET + 2)
297
298#endif
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index f5a1aad1a5c0..3fc5dc7233da 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -33,9 +33,11 @@ static struct iommu_device omap3_devices[] = {
33 .name = "isp", 33 .name = "isp",
34 .nr_tlb_entries = 8, 34 .nr_tlb_entries = 8,
35 .clk_name = "cam_ick", 35 .clk_name = "cam_ick",
36 .da_start = 0x0,
37 .da_end = 0xFFFFF000,
36 }, 38 },
37 }, 39 },
38#if defined(CONFIG_MPU_BRIDGE_IOMMU) 40#if defined(CONFIG_OMAP_IOMMU_IVA2)
39 { 41 {
40 .base = 0x5d000000, 42 .base = 0x5d000000,
41 .irq = 28, 43 .irq = 28,
@@ -43,6 +45,8 @@ static struct iommu_device omap3_devices[] = {
43 .name = "iva2", 45 .name = "iva2",
44 .nr_tlb_entries = 32, 46 .nr_tlb_entries = 32,
45 .clk_name = "iva2_ck", 47 .clk_name = "iva2_ck",
48 .da_start = 0x11000000,
49 .da_end = 0xFFFFF000,
46 }, 50 },
47 }, 51 },
48#endif 52#endif
@@ -64,6 +68,8 @@ static struct iommu_device omap4_devices[] = {
64 .name = "ducati", 68 .name = "ducati",
65 .nr_tlb_entries = 32, 69 .nr_tlb_entries = 32,
66 .clk_name = "ducati_ick", 70 .clk_name = "ducati_ick",
71 .da_start = 0x0,
72 .da_end = 0xFFFFF000,
67 }, 73 },
68 }, 74 },
69#if defined(CONFIG_MPU_TESLA_IOMMU) 75#if defined(CONFIG_MPU_TESLA_IOMMU)
@@ -74,6 +80,8 @@ static struct iommu_device omap4_devices[] = {
74 .name = "tesla", 80 .name = "tesla",
75 .nr_tlb_entries = 32, 81 .nr_tlb_entries = 32,
76 .clk_name = "tesla_ick", 82 .clk_name = "tesla_ick",
83 .da_start = 0x0,
84 .da_end = 0xFFFFF000,
77 }, 85 },
78 }, 86 },
79#endif 87#endif
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 666e852988d5..19268647ce36 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -54,6 +54,8 @@ static void omap4_l2x0_disable(void)
54 54
55static int __init omap_l2_cache_init(void) 55static int __init omap_l2_cache_init(void)
56{ 56{
57 u32 aux_ctrl = 0;
58
57 /* 59 /*
58 * To avoid code running on other OMAPs in 60 * To avoid code running on other OMAPs in
59 * multi-omap builds 61 * multi-omap builds
@@ -65,18 +67,32 @@ static int __init omap_l2_cache_init(void)
65 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); 67 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
66 BUG_ON(!l2cache_base); 68 BUG_ON(!l2cache_base);
67 69
68 /* Enable PL310 L2 Cache controller */
69 omap_smc1(0x102, 0x1);
70
71 /* 70 /*
72 * 16-way associativity, parity disabled 71 * 16-way associativity, parity disabled
73 * Way size - 32KB (es1.0) 72 * Way size - 32KB (es1.0)
74 * Way size - 64KB (es2.0 +) 73 * Way size - 64KB (es2.0 +)
75 */ 74 */
76 if (omap_rev() == OMAP4430_REV_ES1_0) 75 aux_ctrl = ((1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT) |
77 l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff); 76 (0x1 << 25) |
78 else 77 (0x1 << L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT) |
79 l2x0_init(l2cache_base, 0x0e070000, 0xc0000fff); 78 (0x1 << L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT));
79
80 if (omap_rev() == OMAP4430_REV_ES1_0) {
81 aux_ctrl |= 0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT;
82 } else {
83 aux_ctrl |= ((0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) |
84 (1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) |
85 (1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) |
86 (1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) |
87 (1 << L2X0_AUX_CTRL_EARLY_BRESP_SHIFT));
88 }
89 if (omap_rev() != OMAP4430_REV_ES1_0)
90 omap_smc1(0x109, aux_ctrl);
91
92 /* Enable PL310 L2 Cache controller */
93 omap_smc1(0x102, 0x1);
94
95 l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);
80 96
81 /* 97 /*
82 * Override default outer_cache.disable with a OMAP4 98 * Override default outer_cache.disable with a OMAP4
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5a30658444d0..e282e35769fd 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -116,7 +116,6 @@
116 * - Open Core Protocol Specification 2.2 116 * - Open Core Protocol Specification 2.2
117 * 117 *
118 * To do: 118 * To do:
119 * - pin mux handling
120 * - handle IO mapping 119 * - handle IO mapping
121 * - bus throughput & module latency measurement code 120 * - bus throughput & module latency measurement code
122 * 121 *
@@ -135,17 +134,21 @@
135#include <linux/err.h> 134#include <linux/err.h>
136#include <linux/list.h> 135#include <linux/list.h>
137#include <linux/mutex.h> 136#include <linux/mutex.h>
137#include <linux/spinlock.h>
138 138
139#include <plat/common.h> 139#include <plat/common.h>
140#include <plat/cpu.h> 140#include <plat/cpu.h>
141#include <plat/clockdomain.h> 141#include "clockdomain.h"
142#include <plat/powerdomain.h> 142#include "powerdomain.h"
143#include <plat/clock.h> 143#include <plat/clock.h>
144#include <plat/omap_hwmod.h> 144#include <plat/omap_hwmod.h>
145#include <plat/prcm.h> 145#include <plat/prcm.h>
146 146
147#include "cm.h" 147#include "cm2xxx_3xxx.h"
148#include "prm.h" 148#include "cm44xx.h"
149#include "prm2xxx_3xxx.h"
150#include "prm44xx.h"
151#include "mux.h"
149 152
150/* Maximum microseconds to wait for OMAP module to softreset */ 153/* Maximum microseconds to wait for OMAP module to softreset */
151#define MAX_MODULE_SOFTRESET_WAIT 10000 154#define MAX_MODULE_SOFTRESET_WAIT 10000
@@ -156,8 +159,6 @@
156/* omap_hwmod_list contains all registered struct omap_hwmods */ 159/* omap_hwmod_list contains all registered struct omap_hwmods */
157static LIST_HEAD(omap_hwmod_list); 160static LIST_HEAD(omap_hwmod_list);
158 161
159static DEFINE_MUTEX(omap_hwmod_mutex);
160
161/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 162/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
162static struct omap_hwmod *mpu_oh; 163static struct omap_hwmod *mpu_oh;
163 164
@@ -209,10 +210,9 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh)
209 210
210 /* XXX ensure module interface clock is up */ 211 /* XXX ensure module interface clock is up */
211 212
212 if (oh->_sysc_cache != v) { 213 /* Module might have lost context, always update cache and register */
213 oh->_sysc_cache = v; 214 oh->_sysc_cache = v;
214 omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs); 215 omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
215 }
216} 216}
217 217
218/** 218/**
@@ -388,12 +388,13 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
388 * Allow the hardware module @oh to send wakeups. Returns -EINVAL 388 * Allow the hardware module @oh to send wakeups. Returns -EINVAL
389 * upon error or 0 upon success. 389 * upon error or 0 upon success.
390 */ 390 */
391static int _enable_wakeup(struct omap_hwmod *oh) 391static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
392{ 392{
393 u32 v, wakeup_mask; 393 u32 wakeup_mask;
394 394
395 if (!oh->class->sysc || 395 if (!oh->class->sysc ||
396 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 396 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
397 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)))
397 return -EINVAL; 398 return -EINVAL;
398 399
399 if (!oh->class->sysc->sysc_fields) { 400 if (!oh->class->sysc->sysc_fields) {
@@ -403,9 +404,10 @@ static int _enable_wakeup(struct omap_hwmod *oh)
403 404
404 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); 405 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift);
405 406
406 v = oh->_sysc_cache; 407 *v |= wakeup_mask;
407 v |= wakeup_mask; 408
408 _write_sysconfig(v, oh); 409 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
410 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
409 411
410 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 412 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
411 413
@@ -421,12 +423,13 @@ static int _enable_wakeup(struct omap_hwmod *oh)
421 * Prevent the hardware module @oh to send wakeups. Returns -EINVAL 423 * Prevent the hardware module @oh to send wakeups. Returns -EINVAL
422 * upon error or 0 upon success. 424 * upon error or 0 upon success.
423 */ 425 */
424static int _disable_wakeup(struct omap_hwmod *oh) 426static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
425{ 427{
426 u32 v, wakeup_mask; 428 u32 wakeup_mask;
427 429
428 if (!oh->class->sysc || 430 if (!oh->class->sysc ||
429 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 431 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
432 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)))
430 return -EINVAL; 433 return -EINVAL;
431 434
432 if (!oh->class->sysc->sysc_fields) { 435 if (!oh->class->sysc->sysc_fields) {
@@ -436,9 +439,10 @@ static int _disable_wakeup(struct omap_hwmod *oh)
436 439
437 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); 440 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift);
438 441
439 v = oh->_sysc_cache; 442 *v &= ~wakeup_mask;
440 v &= ~wakeup_mask; 443
441 _write_sysconfig(v, oh); 444 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
445 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v);
442 446
443 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 447 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
444 448
@@ -675,7 +679,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
675 * Returns the array index of the OCP slave port that the MPU 679 * Returns the array index of the OCP slave port that the MPU
676 * addresses the device on, or -EINVAL upon error or not found. 680 * addresses the device on, or -EINVAL upon error or not found.
677 */ 681 */
678static int _find_mpu_port_index(struct omap_hwmod *oh) 682static int __init _find_mpu_port_index(struct omap_hwmod *oh)
679{ 683{
680 int i; 684 int i;
681 int found = 0; 685 int found = 0;
@@ -709,7 +713,7 @@ static int _find_mpu_port_index(struct omap_hwmod *oh)
709 * Return the virtual address of the base of the register target of 713 * Return the virtual address of the base of the register target of
710 * device @oh, or NULL on error. 714 * device @oh, or NULL on error.
711 */ 715 */
712static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index) 716static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
713{ 717{
714 struct omap_hwmod_ocp_if *os; 718 struct omap_hwmod_ocp_if *os;
715 struct omap_hwmod_addr_space *mem; 719 struct omap_hwmod_addr_space *mem;
@@ -786,11 +790,11 @@ static void _enable_sysc(struct omap_hwmod *oh)
786 (sf & SYSC_HAS_CLOCKACTIVITY)) 790 (sf & SYSC_HAS_CLOCKACTIVITY))
787 _set_clockactivity(oh, oh->class->sysc->clockact, &v); 791 _set_clockactivity(oh, oh->class->sysc->clockact, &v);
788 792
789 _write_sysconfig(v, oh);
790
791 /* If slave is in SMARTIDLE, also enable wakeup */ 793 /* If slave is in SMARTIDLE, also enable wakeup */
792 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE)) 794 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE))
793 _enable_wakeup(oh); 795 _enable_wakeup(oh, &v);
796
797 _write_sysconfig(v, oh);
794 798
795 /* 799 /*
796 * Set the autoidle bit only after setting the smartidle bit 800 * Set the autoidle bit only after setting the smartidle bit
@@ -836,6 +840,10 @@ static void _idle_sysc(struct omap_hwmod *oh)
836 _set_master_standbymode(oh, idlemode, &v); 840 _set_master_standbymode(oh, idlemode, &v);
837 } 841 }
838 842
843 /* If slave is in SMARTIDLE, also enable wakeup */
844 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE))
845 _enable_wakeup(oh, &v);
846
839 _write_sysconfig(v, oh); 847 _write_sysconfig(v, oh);
840} 848}
841 849
@@ -874,7 +882,6 @@ static void _shutdown_sysc(struct omap_hwmod *oh)
874 * @name: find an omap_hwmod by name 882 * @name: find an omap_hwmod by name
875 * 883 *
876 * Return a pointer to an omap_hwmod by name, or NULL if not found. 884 * Return a pointer to an omap_hwmod by name, or NULL if not found.
877 * Caller must hold omap_hwmod_mutex.
878 */ 885 */
879static struct omap_hwmod *_lookup(const char *name) 886static struct omap_hwmod *_lookup(const char *name)
880{ 887{
@@ -1089,7 +1096,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1089} 1096}
1090 1097
1091/** 1098/**
1092 * _reset - reset an omap_hwmod 1099 * _ocp_softreset - reset an omap_hwmod via the OCP_SYSCONFIG bit
1093 * @oh: struct omap_hwmod * 1100 * @oh: struct omap_hwmod *
1094 * 1101 *
1095 * Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be 1102 * Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be
@@ -1098,12 +1105,13 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1098 * the module did not reset in time, or 0 upon success. 1105 * the module did not reset in time, or 0 upon success.
1099 * 1106 *
1100 * In OMAP3 a specific SYSSTATUS register is used to get the reset status. 1107 * In OMAP3 a specific SYSSTATUS register is used to get the reset status.
1101 * Starting in OMAP4, some IPs does not have SYSSTATUS register and instead 1108 * Starting in OMAP4, some IPs do not have SYSSTATUS registers and instead
1102 * use the SYSCONFIG softreset bit to provide the status. 1109 * use the SYSCONFIG softreset bit to provide the status.
1103 * 1110 *
1104 * Note that some IP like McBSP does have a reset control but no reset status. 1111 * Note that some IP like McBSP do have reset control but don't have
1112 * reset status.
1105 */ 1113 */
1106static int _reset(struct omap_hwmod *oh) 1114static int _ocp_softreset(struct omap_hwmod *oh)
1107{ 1115{
1108 u32 v; 1116 u32 v;
1109 int c = 0; 1117 int c = 0;
@@ -1124,7 +1132,7 @@ static int _reset(struct omap_hwmod *oh)
1124 if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) 1132 if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
1125 _enable_optional_clocks(oh); 1133 _enable_optional_clocks(oh);
1126 1134
1127 pr_debug("omap_hwmod: %s: resetting\n", oh->name); 1135 pr_debug("omap_hwmod: %s: resetting via OCP SOFTRESET\n", oh->name);
1128 1136
1129 v = oh->_sysc_cache; 1137 v = oh->_sysc_cache;
1130 ret = _set_softreset(oh, &v); 1138 ret = _set_softreset(oh, &v);
@@ -1164,17 +1172,41 @@ dis_opt_clks:
1164} 1172}
1165 1173
1166/** 1174/**
1167 * _omap_hwmod_enable - enable an omap_hwmod 1175 * _reset - reset an omap_hwmod
1176 * @oh: struct omap_hwmod *
1177 *
1178 * Resets an omap_hwmod @oh. The default software reset mechanism for
1179 * most OMAP IP blocks is triggered via the OCP_SYSCONFIG.SOFTRESET
1180 * bit. However, some hwmods cannot be reset via this method: some
1181 * are not targets and therefore have no OCP header registers to
1182 * access; others (like the IVA) have idiosyncratic reset sequences.
1183 * So for these relatively rare cases, custom reset code can be
1184 * supplied in the struct omap_hwmod_class .reset function pointer.
1185 * Passes along the return value from either _reset() or the custom
1186 * reset function - these must return -EINVAL if the hwmod cannot be
1187 * reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if
1188 * the module did not reset in time, or 0 upon success.
1189 */
1190static int _reset(struct omap_hwmod *oh)
1191{
1192 int ret;
1193
1194 pr_debug("omap_hwmod: %s: resetting\n", oh->name);
1195
1196 ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);
1197
1198 return ret;
1199}
1200
1201/**
1202 * _enable - enable an omap_hwmod
1168 * @oh: struct omap_hwmod * 1203 * @oh: struct omap_hwmod *
1169 * 1204 *
1170 * Enables an omap_hwmod @oh such that the MPU can access the hwmod's 1205 * Enables an omap_hwmod @oh such that the MPU can access the hwmod's
1171 * register target. (This function has a full name -- 1206 * register target. Returns -EINVAL if the hwmod is in the wrong
1172 * _omap_hwmod_enable() rather than simply _enable() -- because it is 1207 * state or passes along the return value of _wait_target_ready().
1173 * currently required by the pm34xx.c idle loop.) Returns -EINVAL if
1174 * the hwmod is in the wrong state or passes along the return value of
1175 * _wait_target_ready().
1176 */ 1208 */
1177int _omap_hwmod_enable(struct omap_hwmod *oh) 1209static int _enable(struct omap_hwmod *oh)
1178{ 1210{
1179 int r; 1211 int r;
1180 1212
@@ -1197,7 +1229,9 @@ int _omap_hwmod_enable(struct omap_hwmod *oh)
1197 oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1) 1229 oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1)
1198 _deassert_hardreset(oh, oh->rst_lines[0].name); 1230 _deassert_hardreset(oh, oh->rst_lines[0].name);
1199 1231
1200 /* XXX mux balls */ 1232 /* Mux pins for device runtime if populated */
1233 if (oh->mux)
1234 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
1201 1235
1202 _add_initiator_dep(oh, mpu_oh); 1236 _add_initiator_dep(oh, mpu_oh);
1203 _enable_clocks(oh); 1237 _enable_clocks(oh);
@@ -1213,6 +1247,7 @@ int _omap_hwmod_enable(struct omap_hwmod *oh)
1213 _enable_sysc(oh); 1247 _enable_sysc(oh);
1214 } 1248 }
1215 } else { 1249 } else {
1250 _disable_clocks(oh);
1216 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", 1251 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
1217 oh->name, r); 1252 oh->name, r);
1218 } 1253 }
@@ -1221,16 +1256,14 @@ int _omap_hwmod_enable(struct omap_hwmod *oh)
1221} 1256}
1222 1257
1223/** 1258/**
1224 * _omap_hwmod_idle - idle an omap_hwmod 1259 * _idle - idle an omap_hwmod
1225 * @oh: struct omap_hwmod * 1260 * @oh: struct omap_hwmod *
1226 * 1261 *
1227 * Idles an omap_hwmod @oh. This should be called once the hwmod has 1262 * Idles an omap_hwmod @oh. This should be called once the hwmod has
1228 * no further work. (This function has a full name -- 1263 * no further work. Returns -EINVAL if the hwmod is in the wrong
1229 * _omap_hwmod_idle() rather than simply _idle() -- because it is 1264 * state or returns 0.
1230 * currently required by the pm34xx.c idle loop.) Returns -EINVAL if
1231 * the hwmod is in the wrong state or returns 0.
1232 */ 1265 */
1233int _omap_hwmod_idle(struct omap_hwmod *oh) 1266static int _idle(struct omap_hwmod *oh)
1234{ 1267{
1235 if (oh->_state != _HWMOD_STATE_ENABLED) { 1268 if (oh->_state != _HWMOD_STATE_ENABLED) {
1236 WARN(1, "omap_hwmod: %s: idle state can only be entered from " 1269 WARN(1, "omap_hwmod: %s: idle state can only be entered from "
@@ -1245,6 +1278,10 @@ int _omap_hwmod_idle(struct omap_hwmod *oh)
1245 _del_initiator_dep(oh, mpu_oh); 1278 _del_initiator_dep(oh, mpu_oh);
1246 _disable_clocks(oh); 1279 _disable_clocks(oh);
1247 1280
1281 /* Mux pins for device idle if populated */
1282 if (oh->mux)
1283 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE);
1284
1248 oh->_state = _HWMOD_STATE_IDLE; 1285 oh->_state = _HWMOD_STATE_IDLE;
1249 1286
1250 return 0; 1287 return 0;
@@ -1261,6 +1298,9 @@ int _omap_hwmod_idle(struct omap_hwmod *oh)
1261 */ 1298 */
1262static int _shutdown(struct omap_hwmod *oh) 1299static int _shutdown(struct omap_hwmod *oh)
1263{ 1300{
1301 int ret;
1302 u8 prev_state;
1303
1264 if (oh->_state != _HWMOD_STATE_IDLE && 1304 if (oh->_state != _HWMOD_STATE_IDLE &&
1265 oh->_state != _HWMOD_STATE_ENABLED) { 1305 oh->_state != _HWMOD_STATE_ENABLED) {
1266 WARN(1, "omap_hwmod: %s: disabled state can only be entered " 1306 WARN(1, "omap_hwmod: %s: disabled state can only be entered "
@@ -1270,6 +1310,18 @@ static int _shutdown(struct omap_hwmod *oh)
1270 1310
1271 pr_debug("omap_hwmod: %s: disabling\n", oh->name); 1311 pr_debug("omap_hwmod: %s: disabling\n", oh->name);
1272 1312
1313 if (oh->class->pre_shutdown) {
1314 prev_state = oh->_state;
1315 if (oh->_state == _HWMOD_STATE_IDLE)
1316 _enable(oh);
1317 ret = oh->class->pre_shutdown(oh);
1318 if (ret) {
1319 if (prev_state == _HWMOD_STATE_IDLE)
1320 _idle(oh);
1321 return ret;
1322 }
1323 }
1324
1273 if (oh->class->sysc) 1325 if (oh->class->sysc)
1274 _shutdown_sysc(oh); 1326 _shutdown_sysc(oh);
1275 1327
@@ -1288,7 +1340,9 @@ static int _shutdown(struct omap_hwmod *oh)
1288 } 1340 }
1289 /* XXX Should this code also force-disable the optional clocks? */ 1341 /* XXX Should this code also force-disable the optional clocks? */
1290 1342
1291 /* XXX mux any associated balls to safe mode */ 1343 /* Mux pins to safe mode or use populated off mode values */
1344 if (oh->mux)
1345 omap_hwmod_mux(oh->mux, _HWMOD_STATE_DISABLED);
1292 1346
1293 oh->_state = _HWMOD_STATE_DISABLED; 1347 oh->_state = _HWMOD_STATE_DISABLED;
1294 1348
@@ -1298,23 +1352,15 @@ static int _shutdown(struct omap_hwmod *oh)
1298/** 1352/**
1299 * _setup - do initial configuration of omap_hwmod 1353 * _setup - do initial configuration of omap_hwmod
1300 * @oh: struct omap_hwmod * 1354 * @oh: struct omap_hwmod *
1301 * @skip_setup_idle_p: do not idle hwmods at the end of the fn if 1
1302 * 1355 *
1303 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh 1356 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh
1304 * OCP_SYSCONFIG register. @skip_setup_idle is intended to be used on 1357 * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the
1305 * a system that will not call omap_hwmod_enable() to enable devices 1358 * wrong state or returns 0.
1306 * (e.g., a system without PM runtime). Returns -EINVAL if the hwmod
1307 * is in the wrong state or returns 0.
1308 */ 1359 */
1309static int _setup(struct omap_hwmod *oh, void *data) 1360static int _setup(struct omap_hwmod *oh, void *data)
1310{ 1361{
1311 int i, r; 1362 int i, r;
1312 u8 skip_setup_idle; 1363 u8 postsetup_state;
1313
1314 if (!oh || !data)
1315 return -EINVAL;
1316
1317 skip_setup_idle = *(u8 *)data;
1318 1364
1319 /* Set iclk autoidle mode */ 1365 /* Set iclk autoidle mode */
1320 if (oh->slaves_cnt > 0) { 1366 if (oh->slaves_cnt > 0) {
@@ -1334,7 +1380,6 @@ static int _setup(struct omap_hwmod *oh, void *data)
1334 } 1380 }
1335 } 1381 }
1336 1382
1337 mutex_init(&oh->_mutex);
1338 oh->_state = _HWMOD_STATE_INITIALIZED; 1383 oh->_state = _HWMOD_STATE_INITIALIZED;
1339 1384
1340 /* 1385 /*
@@ -1347,7 +1392,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1347 if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1) 1392 if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1)
1348 return 0; 1393 return 0;
1349 1394
1350 r = _omap_hwmod_enable(oh); 1395 r = _enable(oh);
1351 if (r) { 1396 if (r) {
1352 pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n", 1397 pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n",
1353 oh->name, oh->_state); 1398 oh->name, oh->_state);
@@ -1359,7 +1404,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1359 1404
1360 /* 1405 /*
1361 * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. 1406 * OCP_SYSCONFIG bits need to be reprogrammed after a softreset.
1362 * The _omap_hwmod_enable() function should be split to 1407 * The _enable() function should be split to
1363 * avoid the rewrite of the OCP_SYSCONFIG register. 1408 * avoid the rewrite of the OCP_SYSCONFIG register.
1364 */ 1409 */
1365 if (oh->class->sysc) { 1410 if (oh->class->sysc) {
@@ -1368,12 +1413,77 @@ static int _setup(struct omap_hwmod *oh, void *data)
1368 } 1413 }
1369 } 1414 }
1370 1415
1371 if (!(oh->flags & HWMOD_INIT_NO_IDLE) && !skip_setup_idle) 1416 postsetup_state = oh->_postsetup_state;
1372 _omap_hwmod_idle(oh); 1417 if (postsetup_state == _HWMOD_STATE_UNKNOWN)
1418 postsetup_state = _HWMOD_STATE_ENABLED;
1419
1420 /*
1421 * XXX HWMOD_INIT_NO_IDLE does not belong in hwmod data -
1422 * it should be set by the core code as a runtime flag during startup
1423 */
1424 if ((oh->flags & HWMOD_INIT_NO_IDLE) &&
1425 (postsetup_state == _HWMOD_STATE_IDLE))
1426 postsetup_state = _HWMOD_STATE_ENABLED;
1427
1428 if (postsetup_state == _HWMOD_STATE_IDLE)
1429 _idle(oh);
1430 else if (postsetup_state == _HWMOD_STATE_DISABLED)
1431 _shutdown(oh);
1432 else if (postsetup_state != _HWMOD_STATE_ENABLED)
1433 WARN(1, "hwmod: %s: unknown postsetup state %d! defaulting to enabled\n",
1434 oh->name, postsetup_state);
1373 1435
1374 return 0; 1436 return 0;
1375} 1437}
1376 1438
1439/**
1440 * _register - register a struct omap_hwmod
1441 * @oh: struct omap_hwmod *
1442 *
1443 * Registers the omap_hwmod @oh. Returns -EEXIST if an omap_hwmod
1444 * already has been registered by the same name; -EINVAL if the
1445 * omap_hwmod is in the wrong state, if @oh is NULL, if the
1446 * omap_hwmod's class field is NULL; if the omap_hwmod is missing a
1447 * name, or if the omap_hwmod's class is missing a name; or 0 upon
1448 * success.
1449 *
1450 * XXX The data should be copied into bootmem, so the original data
1451 * should be marked __initdata and freed after init. This would allow
1452 * unneeded omap_hwmods to be freed on multi-OMAP configurations. Note
1453 * that the copy process would be relatively complex due to the large number
1454 * of substructures.
1455 */
1456static int __init _register(struct omap_hwmod *oh)
1457{
1458 int ret, ms_id;
1459
1460 if (!oh || !oh->name || !oh->class || !oh->class->name ||
1461 (oh->_state != _HWMOD_STATE_UNKNOWN))
1462 return -EINVAL;
1463
1464 pr_debug("omap_hwmod: %s: registering\n", oh->name);
1465
1466 if (_lookup(oh->name))
1467 return -EEXIST;
1468
1469 ms_id = _find_mpu_port_index(oh);
1470 if (!IS_ERR_VALUE(ms_id)) {
1471 oh->_mpu_port_index = ms_id;
1472 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1473 } else {
1474 oh->_int_flags |= _HWMOD_NO_MPU_PORT;
1475 }
1476
1477 list_add_tail(&oh->node, &omap_hwmod_list);
1478
1479 spin_lock_init(&oh->_lock);
1480
1481 oh->_state = _HWMOD_STATE_REGISTERED;
1482
1483 ret = 0;
1484
1485 return ret;
1486}
1377 1487
1378 1488
1379/* Public functions */ 1489/* Public functions */
@@ -1427,59 +1537,6 @@ int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode)
1427} 1537}
1428 1538
1429/** 1539/**
1430 * omap_hwmod_register - register a struct omap_hwmod
1431 * @oh: struct omap_hwmod *
1432 *
1433 * Registers the omap_hwmod @oh. Returns -EEXIST if an omap_hwmod
1434 * already has been registered by the same name; -EINVAL if the
1435 * omap_hwmod is in the wrong state, if @oh is NULL, if the
1436 * omap_hwmod's class field is NULL; if the omap_hwmod is missing a
1437 * name, or if the omap_hwmod's class is missing a name; or 0 upon
1438 * success.
1439 *
1440 * XXX The data should be copied into bootmem, so the original data
1441 * should be marked __initdata and freed after init. This would allow
1442 * unneeded omap_hwmods to be freed on multi-OMAP configurations. Note
1443 * that the copy process would be relatively complex due to the large number
1444 * of substructures.
1445 */
1446int omap_hwmod_register(struct omap_hwmod *oh)
1447{
1448 int ret, ms_id;
1449
1450 if (!oh || !oh->name || !oh->class || !oh->class->name ||
1451 (oh->_state != _HWMOD_STATE_UNKNOWN))
1452 return -EINVAL;
1453
1454 mutex_lock(&omap_hwmod_mutex);
1455
1456 pr_debug("omap_hwmod: %s: registering\n", oh->name);
1457
1458 if (_lookup(oh->name)) {
1459 ret = -EEXIST;
1460 goto ohr_unlock;
1461 }
1462
1463 ms_id = _find_mpu_port_index(oh);
1464 if (!IS_ERR_VALUE(ms_id)) {
1465 oh->_mpu_port_index = ms_id;
1466 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1467 } else {
1468 oh->_int_flags |= _HWMOD_NO_MPU_PORT;
1469 }
1470
1471 list_add_tail(&oh->node, &omap_hwmod_list);
1472
1473 oh->_state = _HWMOD_STATE_REGISTERED;
1474
1475 ret = 0;
1476
1477ohr_unlock:
1478 mutex_unlock(&omap_hwmod_mutex);
1479 return ret;
1480}
1481
1482/**
1483 * omap_hwmod_lookup - look up a registered omap_hwmod by name 1540 * omap_hwmod_lookup - look up a registered omap_hwmod by name
1484 * @name: name of the omap_hwmod to look up 1541 * @name: name of the omap_hwmod to look up
1485 * 1542 *
@@ -1493,9 +1550,7 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name)
1493 if (!name) 1550 if (!name)
1494 return NULL; 1551 return NULL;
1495 1552
1496 mutex_lock(&omap_hwmod_mutex);
1497 oh = _lookup(name); 1553 oh = _lookup(name);
1498 mutex_unlock(&omap_hwmod_mutex);
1499 1554
1500 return oh; 1555 return oh;
1501} 1556}
@@ -1521,13 +1576,11 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1521 if (!fn) 1576 if (!fn)
1522 return -EINVAL; 1577 return -EINVAL;
1523 1578
1524 mutex_lock(&omap_hwmod_mutex);
1525 list_for_each_entry(temp_oh, &omap_hwmod_list, node) { 1579 list_for_each_entry(temp_oh, &omap_hwmod_list, node) {
1526 ret = (*fn)(temp_oh, data); 1580 ret = (*fn)(temp_oh, data);
1527 if (ret) 1581 if (ret)
1528 break; 1582 break;
1529 } 1583 }
1530 mutex_unlock(&omap_hwmod_mutex);
1531 1584
1532 return ret; 1585 return ret;
1533} 1586}
@@ -1542,7 +1595,7 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1542 * listed in @ohs that are valid for this chip. Returns -EINVAL if 1595 * listed in @ohs that are valid for this chip. Returns -EINVAL if
1543 * omap_hwmod_init() has already been called or 0 otherwise. 1596 * omap_hwmod_init() has already been called or 0 otherwise.
1544 */ 1597 */
1545int omap_hwmod_init(struct omap_hwmod **ohs) 1598int __init omap_hwmod_init(struct omap_hwmod **ohs)
1546{ 1599{
1547 struct omap_hwmod *oh; 1600 struct omap_hwmod *oh;
1548 int r; 1601 int r;
@@ -1558,8 +1611,8 @@ int omap_hwmod_init(struct omap_hwmod **ohs)
1558 oh = *ohs; 1611 oh = *ohs;
1559 while (oh) { 1612 while (oh) {
1560 if (omap_chip_is(oh->omap_chip)) { 1613 if (omap_chip_is(oh->omap_chip)) {
1561 r = omap_hwmod_register(oh); 1614 r = _register(oh);
1562 WARN(r, "omap_hwmod: %s: omap_hwmod_register returned " 1615 WARN(r, "omap_hwmod: %s: _register returned "
1563 "%d\n", oh->name, r); 1616 "%d\n", oh->name, r);
1564 } 1617 }
1565 oh = *++ohs; 1618 oh = *++ohs;
@@ -1570,13 +1623,12 @@ int omap_hwmod_init(struct omap_hwmod **ohs)
1570 1623
1571/** 1624/**
1572 * omap_hwmod_late_init - do some post-clock framework initialization 1625 * omap_hwmod_late_init - do some post-clock framework initialization
1573 * @skip_setup_idle: if 1, do not idle hwmods in _setup()
1574 * 1626 *
1575 * Must be called after omap2_clk_init(). Resolves the struct clk names 1627 * Must be called after omap2_clk_init(). Resolves the struct clk names
1576 * to struct clk pointers for each registered omap_hwmod. Also calls 1628 * to struct clk pointers for each registered omap_hwmod. Also calls
1577 * _setup() on each hwmod. Returns 0. 1629 * _setup() on each hwmod. Returns 0.
1578 */ 1630 */
1579int omap_hwmod_late_init(u8 skip_setup_idle) 1631int omap_hwmod_late_init(void)
1580{ 1632{
1581 int r; 1633 int r;
1582 1634
@@ -1588,36 +1640,7 @@ int omap_hwmod_late_init(u8 skip_setup_idle)
1588 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", 1640 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n",
1589 MPU_INITIATOR_NAME); 1641 MPU_INITIATOR_NAME);
1590 1642
1591 if (skip_setup_idle) 1643 omap_hwmod_for_each(_setup, NULL);
1592 pr_debug("omap_hwmod: will leave hwmods enabled during setup\n");
1593
1594 omap_hwmod_for_each(_setup, &skip_setup_idle);
1595
1596 return 0;
1597}
1598
1599/**
1600 * omap_hwmod_unregister - unregister an omap_hwmod
1601 * @oh: struct omap_hwmod *
1602 *
1603 * Unregisters a previously-registered omap_hwmod @oh. There's probably
1604 * no use case for this, so it is likely to be removed in a later version.
1605 *
1606 * XXX Free all of the bootmem-allocated structures here when that is
1607 * implemented. Make it clear that core code is the only code that is
1608 * expected to unregister modules.
1609 */
1610int omap_hwmod_unregister(struct omap_hwmod *oh)
1611{
1612 if (!oh)
1613 return -EINVAL;
1614
1615 pr_debug("omap_hwmod: %s: unregistering\n", oh->name);
1616
1617 mutex_lock(&omap_hwmod_mutex);
1618 iounmap(oh->_mpu_rt_va);
1619 list_del(&oh->node);
1620 mutex_unlock(&omap_hwmod_mutex);
1621 1644
1622 return 0; 1645 return 0;
1623} 1646}
@@ -1632,18 +1655,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
1632int omap_hwmod_enable(struct omap_hwmod *oh) 1655int omap_hwmod_enable(struct omap_hwmod *oh)
1633{ 1656{
1634 int r; 1657 int r;
1658 unsigned long flags;
1635 1659
1636 if (!oh) 1660 if (!oh)
1637 return -EINVAL; 1661 return -EINVAL;
1638 1662
1639 mutex_lock(&oh->_mutex); 1663 spin_lock_irqsave(&oh->_lock, flags);
1640 r = _omap_hwmod_enable(oh); 1664 r = _enable(oh);
1641 mutex_unlock(&oh->_mutex); 1665 spin_unlock_irqrestore(&oh->_lock, flags);
1642 1666
1643 return r; 1667 return r;
1644} 1668}
1645 1669
1646
1647/** 1670/**
1648 * omap_hwmod_idle - idle an omap_hwmod 1671 * omap_hwmod_idle - idle an omap_hwmod
1649 * @oh: struct omap_hwmod * 1672 * @oh: struct omap_hwmod *
@@ -1653,12 +1676,14 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
1653 */ 1676 */
1654int omap_hwmod_idle(struct omap_hwmod *oh) 1677int omap_hwmod_idle(struct omap_hwmod *oh)
1655{ 1678{
1679 unsigned long flags;
1680
1656 if (!oh) 1681 if (!oh)
1657 return -EINVAL; 1682 return -EINVAL;
1658 1683
1659 mutex_lock(&oh->_mutex); 1684 spin_lock_irqsave(&oh->_lock, flags);
1660 _omap_hwmod_idle(oh); 1685 _idle(oh);
1661 mutex_unlock(&oh->_mutex); 1686 spin_unlock_irqrestore(&oh->_lock, flags);
1662 1687
1663 return 0; 1688 return 0;
1664} 1689}
@@ -1673,12 +1698,14 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
1673 */ 1698 */
1674int omap_hwmod_shutdown(struct omap_hwmod *oh) 1699int omap_hwmod_shutdown(struct omap_hwmod *oh)
1675{ 1700{
1701 unsigned long flags;
1702
1676 if (!oh) 1703 if (!oh)
1677 return -EINVAL; 1704 return -EINVAL;
1678 1705
1679 mutex_lock(&oh->_mutex); 1706 spin_lock_irqsave(&oh->_lock, flags);
1680 _shutdown(oh); 1707 _shutdown(oh);
1681 mutex_unlock(&oh->_mutex); 1708 spin_unlock_irqrestore(&oh->_lock, flags);
1682 1709
1683 return 0; 1710 return 0;
1684} 1711}
@@ -1691,9 +1718,11 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh)
1691 */ 1718 */
1692int omap_hwmod_enable_clocks(struct omap_hwmod *oh) 1719int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
1693{ 1720{
1694 mutex_lock(&oh->_mutex); 1721 unsigned long flags;
1722
1723 spin_lock_irqsave(&oh->_lock, flags);
1695 _enable_clocks(oh); 1724 _enable_clocks(oh);
1696 mutex_unlock(&oh->_mutex); 1725 spin_unlock_irqrestore(&oh->_lock, flags);
1697 1726
1698 return 0; 1727 return 0;
1699} 1728}
@@ -1706,9 +1735,11 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
1706 */ 1735 */
1707int omap_hwmod_disable_clocks(struct omap_hwmod *oh) 1736int omap_hwmod_disable_clocks(struct omap_hwmod *oh)
1708{ 1737{
1709 mutex_lock(&oh->_mutex); 1738 unsigned long flags;
1739
1740 spin_lock_irqsave(&oh->_lock, flags);
1710 _disable_clocks(oh); 1741 _disable_clocks(oh);
1711 mutex_unlock(&oh->_mutex); 1742 spin_unlock_irqrestore(&oh->_lock, flags);
1712 1743
1713 return 0; 1744 return 0;
1714} 1745}
@@ -1752,13 +1783,14 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh)
1752int omap_hwmod_reset(struct omap_hwmod *oh) 1783int omap_hwmod_reset(struct omap_hwmod *oh)
1753{ 1784{
1754 int r; 1785 int r;
1786 unsigned long flags;
1755 1787
1756 if (!oh) 1788 if (!oh)
1757 return -EINVAL; 1789 return -EINVAL;
1758 1790
1759 mutex_lock(&oh->_mutex); 1791 spin_lock_irqsave(&oh->_lock, flags);
1760 r = _reset(oh); 1792 r = _reset(oh);
1761 mutex_unlock(&oh->_mutex); 1793 spin_unlock_irqrestore(&oh->_lock, flags);
1762 1794
1763 return r; 1795 return r;
1764} 1796}
@@ -1955,13 +1987,18 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
1955 */ 1987 */
1956int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) 1988int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
1957{ 1989{
1990 unsigned long flags;
1991 u32 v;
1992
1958 if (!oh->class->sysc || 1993 if (!oh->class->sysc ||
1959 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 1994 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
1960 return -EINVAL; 1995 return -EINVAL;
1961 1996
1962 mutex_lock(&oh->_mutex); 1997 spin_lock_irqsave(&oh->_lock, flags);
1963 _enable_wakeup(oh); 1998 v = oh->_sysc_cache;
1964 mutex_unlock(&oh->_mutex); 1999 _enable_wakeup(oh, &v);
2000 _write_sysconfig(v, oh);
2001 spin_unlock_irqrestore(&oh->_lock, flags);
1965 2002
1966 return 0; 2003 return 0;
1967} 2004}
@@ -1980,13 +2017,18 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
1980 */ 2017 */
1981int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) 2018int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
1982{ 2019{
2020 unsigned long flags;
2021 u32 v;
2022
1983 if (!oh->class->sysc || 2023 if (!oh->class->sysc ||
1984 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 2024 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
1985 return -EINVAL; 2025 return -EINVAL;
1986 2026
1987 mutex_lock(&oh->_mutex); 2027 spin_lock_irqsave(&oh->_lock, flags);
1988 _disable_wakeup(oh); 2028 v = oh->_sysc_cache;
1989 mutex_unlock(&oh->_mutex); 2029 _disable_wakeup(oh, &v);
2030 _write_sysconfig(v, oh);
2031 spin_unlock_irqrestore(&oh->_lock, flags);
1990 2032
1991 return 0; 2033 return 0;
1992} 2034}
@@ -2006,13 +2048,14 @@ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
2006int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name) 2048int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name)
2007{ 2049{
2008 int ret; 2050 int ret;
2051 unsigned long flags;
2009 2052
2010 if (!oh) 2053 if (!oh)
2011 return -EINVAL; 2054 return -EINVAL;
2012 2055
2013 mutex_lock(&oh->_mutex); 2056 spin_lock_irqsave(&oh->_lock, flags);
2014 ret = _assert_hardreset(oh, name); 2057 ret = _assert_hardreset(oh, name);
2015 mutex_unlock(&oh->_mutex); 2058 spin_unlock_irqrestore(&oh->_lock, flags);
2016 2059
2017 return ret; 2060 return ret;
2018} 2061}
@@ -2032,13 +2075,14 @@ int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name)
2032int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name) 2075int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
2033{ 2076{
2034 int ret; 2077 int ret;
2078 unsigned long flags;
2035 2079
2036 if (!oh) 2080 if (!oh)
2037 return -EINVAL; 2081 return -EINVAL;
2038 2082
2039 mutex_lock(&oh->_mutex); 2083 spin_lock_irqsave(&oh->_lock, flags);
2040 ret = _deassert_hardreset(oh, name); 2084 ret = _deassert_hardreset(oh, name);
2041 mutex_unlock(&oh->_mutex); 2085 spin_unlock_irqrestore(&oh->_lock, flags);
2042 2086
2043 return ret; 2087 return ret;
2044} 2088}
@@ -2057,13 +2101,14 @@ int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
2057int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name) 2101int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
2058{ 2102{
2059 int ret; 2103 int ret;
2104 unsigned long flags;
2060 2105
2061 if (!oh) 2106 if (!oh)
2062 return -EINVAL; 2107 return -EINVAL;
2063 2108
2064 mutex_lock(&oh->_mutex); 2109 spin_lock_irqsave(&oh->_lock, flags);
2065 ret = _read_hardreset(oh, name); 2110 ret = _read_hardreset(oh, name);
2066 mutex_unlock(&oh->_mutex); 2111 spin_unlock_irqrestore(&oh->_lock, flags);
2067 2112
2068 return ret; 2113 return ret;
2069} 2114}
@@ -2075,9 +2120,8 @@ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
2075 * @fn: callback function pointer to call for each hwmod in class @classname 2120 * @fn: callback function pointer to call for each hwmod in class @classname
2076 * @user: arbitrary context data to pass to the callback function 2121 * @user: arbitrary context data to pass to the callback function
2077 * 2122 *
2078 * For each omap_hwmod of class @classname, call @fn. Takes 2123 * For each omap_hwmod of class @classname, call @fn.
2079 * omap_hwmod_mutex to prevent the hwmod list from changing during the 2124 * If the callback function returns something other than
2080 * iteration. If the callback function returns something other than
2081 * zero, the iterator is terminated, and the callback function's return 2125 * zero, the iterator is terminated, and the callback function's return
2082 * value is passed back to the caller. Returns 0 upon success, -EINVAL 2126 * value is passed back to the caller. Returns 0 upon success, -EINVAL
2083 * if @classname or @fn are NULL, or passes back the error code from @fn. 2127 * if @classname or @fn are NULL, or passes back the error code from @fn.
@@ -2096,8 +2140,6 @@ int omap_hwmod_for_each_by_class(const char *classname,
2096 pr_debug("omap_hwmod: %s: looking for modules of class %s\n", 2140 pr_debug("omap_hwmod: %s: looking for modules of class %s\n",
2097 __func__, classname); 2141 __func__, classname);
2098 2142
2099 mutex_lock(&omap_hwmod_mutex);
2100
2101 list_for_each_entry(temp_oh, &omap_hwmod_list, node) { 2143 list_for_each_entry(temp_oh, &omap_hwmod_list, node) {
2102 if (!strcmp(temp_oh->class->name, classname)) { 2144 if (!strcmp(temp_oh->class->name, classname)) {
2103 pr_debug("omap_hwmod: %s: %s: calling callback fn\n", 2145 pr_debug("omap_hwmod: %s: %s: calling callback fn\n",
@@ -2108,8 +2150,6 @@ int omap_hwmod_for_each_by_class(const char *classname,
2108 } 2150 }
2109 } 2151 }
2110 2152
2111 mutex_unlock(&omap_hwmod_mutex);
2112
2113 if (ret) 2153 if (ret)
2114 pr_debug("omap_hwmod: %s: iterator terminated early: %d\n", 2154 pr_debug("omap_hwmod: %s: iterator terminated early: %d\n",
2115 __func__, ret); 2155 __func__, ret);
@@ -2117,3 +2157,64 @@ int omap_hwmod_for_each_by_class(const char *classname,
2117 return ret; 2157 return ret;
2118} 2158}
2119 2159
2160/**
2161 * omap_hwmod_set_postsetup_state - set the post-_setup() state for this hwmod
2162 * @oh: struct omap_hwmod *
2163 * @state: state that _setup() should leave the hwmod in
2164 *
2165 * Sets the hwmod state that @oh will enter at the end of _setup() (called by
2166 * omap_hwmod_late_init()). Only valid to call between calls to
2167 * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or
2168 * -EINVAL if there is a problem with the arguments or if the hwmod is
2169 * in the wrong state.
2170 */
2171int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
2172{
2173 int ret;
2174 unsigned long flags;
2175
2176 if (!oh)
2177 return -EINVAL;
2178
2179 if (state != _HWMOD_STATE_DISABLED &&
2180 state != _HWMOD_STATE_ENABLED &&
2181 state != _HWMOD_STATE_IDLE)
2182 return -EINVAL;
2183
2184 spin_lock_irqsave(&oh->_lock, flags);
2185
2186 if (oh->_state != _HWMOD_STATE_REGISTERED) {
2187 ret = -EINVAL;
2188 goto ohsps_unlock;
2189 }
2190
2191 oh->_postsetup_state = state;
2192 ret = 0;
2193
2194ohsps_unlock:
2195 spin_unlock_irqrestore(&oh->_lock, flags);
2196
2197 return ret;
2198}
2199
2200/**
2201 * omap_hwmod_get_context_loss_count - get lost context count
2202 * @oh: struct omap_hwmod *
2203 *
2204 * Query the powerdomain of of @oh to get the context loss
2205 * count for this device.
2206 *
2207 * Returns the context loss count of the powerdomain assocated with @oh
2208 * upon success, or zero if no powerdomain exists for @oh.
2209 */
2210u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
2211{
2212 struct powerdomain *pwrdm;
2213 int ret = 0;
2214
2215 pwrdm = omap_hwmod_get_pwrdm(oh);
2216 if (pwrdm)
2217 ret = pwrdm_get_context_loss_count(pwrdm);
2218
2219 return ret;
2220}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index adf6e3632a2b..b85c630b64d6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -16,11 +16,14 @@
16#include <plat/cpu.h> 16#include <plat/cpu.h>
17#include <plat/dma.h> 17#include <plat/dma.h>
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h>
20#include <plat/gpio.h>
19 21
20#include "omap_hwmod_common_data.h" 22#include "omap_hwmod_common_data.h"
21 23
22#include "prm-regbits-24xx.h"
23#include "cm-regbits-24xx.h" 24#include "cm-regbits-24xx.h"
25#include "prm-regbits-24xx.h"
26#include "wd_timer.h"
24 27
25/* 28/*
26 * OMAP2420 hardware module integration data 29 * OMAP2420 hardware module integration data
@@ -36,6 +39,11 @@ static struct omap_hwmod omap2420_iva_hwmod;
36static struct omap_hwmod omap2420_l3_main_hwmod; 39static struct omap_hwmod omap2420_l3_main_hwmod;
37static struct omap_hwmod omap2420_l4_core_hwmod; 40static struct omap_hwmod omap2420_l4_core_hwmod;
38static struct omap_hwmod omap2420_wd_timer2_hwmod; 41static struct omap_hwmod omap2420_wd_timer2_hwmod;
42static struct omap_hwmod omap2420_gpio1_hwmod;
43static struct omap_hwmod omap2420_gpio2_hwmod;
44static struct omap_hwmod omap2420_gpio3_hwmod;
45static struct omap_hwmod omap2420_gpio4_hwmod;
46static struct omap_hwmod omap2420_dma_system_hwmod;
39 47
40/* L3 -> L4_CORE interface */ 48/* L3 -> L4_CORE interface */
41static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { 49static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
@@ -77,6 +85,8 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod;
77static struct omap_hwmod omap2420_uart1_hwmod; 85static struct omap_hwmod omap2420_uart1_hwmod;
78static struct omap_hwmod omap2420_uart2_hwmod; 86static struct omap_hwmod omap2420_uart2_hwmod;
79static struct omap_hwmod omap2420_uart3_hwmod; 87static struct omap_hwmod omap2420_uart3_hwmod;
88static struct omap_hwmod omap2420_i2c1_hwmod;
89static struct omap_hwmod omap2420_i2c2_hwmod;
80 90
81/* L4_CORE -> L4_WKUP interface */ 91/* L4_CORE -> L4_WKUP interface */
82static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { 92static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
@@ -139,6 +149,45 @@ static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
139 .user = OCP_USER_MPU | OCP_USER_SDMA, 149 .user = OCP_USER_MPU | OCP_USER_SDMA,
140}; 150};
141 151
152/* I2C IP block address space length (in bytes) */
153#define OMAP2_I2C_AS_LEN 128
154
155/* L4 CORE -> I2C1 interface */
156static struct omap_hwmod_addr_space omap2420_i2c1_addr_space[] = {
157 {
158 .pa_start = 0x48070000,
159 .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
160 .flags = ADDR_TYPE_RT,
161 },
162};
163
164static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
165 .master = &omap2420_l4_core_hwmod,
166 .slave = &omap2420_i2c1_hwmod,
167 .clk = "i2c1_ick",
168 .addr = omap2420_i2c1_addr_space,
169 .addr_cnt = ARRAY_SIZE(omap2420_i2c1_addr_space),
170 .user = OCP_USER_MPU | OCP_USER_SDMA,
171};
172
173/* L4 CORE -> I2C2 interface */
174static struct omap_hwmod_addr_space omap2420_i2c2_addr_space[] = {
175 {
176 .pa_start = 0x48072000,
177 .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
178 .flags = ADDR_TYPE_RT,
179 },
180};
181
182static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
183 .master = &omap2420_l4_core_hwmod,
184 .slave = &omap2420_i2c2_hwmod,
185 .clk = "i2c2_ick",
186 .addr = omap2420_i2c2_addr_space,
187 .addr_cnt = ARRAY_SIZE(omap2420_i2c2_addr_space),
188 .user = OCP_USER_MPU | OCP_USER_SDMA,
189};
190
142/* Slave interfaces on the L4_CORE interconnect */ 191/* Slave interfaces on the L4_CORE interconnect */
143static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = { 192static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
144 &omap2420_l3_main__l4_core, 193 &omap2420_l3_main__l4_core,
@@ -150,6 +199,8 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
150 &omap2_l4_core__uart1, 199 &omap2_l4_core__uart1,
151 &omap2_l4_core__uart2, 200 &omap2_l4_core__uart2,
152 &omap2_l4_core__uart3, 201 &omap2_l4_core__uart3,
202 &omap2420_l4_core__i2c1,
203 &omap2420_l4_core__i2c2
153}; 204};
154 205
155/* L4 CORE */ 206/* L4 CORE */
@@ -262,8 +313,9 @@ static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
262}; 313};
263 314
264static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = { 315static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
265 .name = "wd_timer", 316 .name = "wd_timer",
266 .sysc = &omap2420_wd_timer_sysc, 317 .sysc = &omap2420_wd_timer_sysc,
318 .pre_shutdown = &omap2_wd_timer_disable
267}; 319};
268 320
269/* wd_timer2 */ 321/* wd_timer2 */
@@ -418,6 +470,400 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
418 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 470 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
419}; 471};
420 472
473/* I2C common */
474static struct omap_hwmod_class_sysconfig i2c_sysc = {
475 .rev_offs = 0x00,
476 .sysc_offs = 0x20,
477 .syss_offs = 0x10,
478 .sysc_flags = SYSC_HAS_SOFTRESET,
479 .sysc_fields = &omap_hwmod_sysc_type1,
480};
481
482static struct omap_hwmod_class i2c_class = {
483 .name = "i2c",
484 .sysc = &i2c_sysc,
485};
486
487static struct omap_i2c_dev_attr i2c_dev_attr;
488
489/* I2C1 */
490
491static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
492 { .irq = INT_24XX_I2C1_IRQ, },
493};
494
495static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
496 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
497 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
498};
499
500static struct omap_hwmod_ocp_if *omap2420_i2c1_slaves[] = {
501 &omap2420_l4_core__i2c1,
502};
503
504static struct omap_hwmod omap2420_i2c1_hwmod = {
505 .name = "i2c1",
506 .mpu_irqs = i2c1_mpu_irqs,
507 .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
508 .sdma_reqs = i2c1_sdma_reqs,
509 .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
510 .main_clk = "i2c1_fck",
511 .prcm = {
512 .omap2 = {
513 .module_offs = CORE_MOD,
514 .prcm_reg_id = 1,
515 .module_bit = OMAP2420_EN_I2C1_SHIFT,
516 .idlest_reg_id = 1,
517 .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
518 },
519 },
520 .slaves = omap2420_i2c1_slaves,
521 .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves),
522 .class = &i2c_class,
523 .dev_attr = &i2c_dev_attr,
524 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
525 .flags = HWMOD_16BIT_REG,
526};
527
528/* I2C2 */
529
530static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
531 { .irq = INT_24XX_I2C2_IRQ, },
532};
533
534static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
535 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
536 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
537};
538
539static struct omap_hwmod_ocp_if *omap2420_i2c2_slaves[] = {
540 &omap2420_l4_core__i2c2,
541};
542
543static struct omap_hwmod omap2420_i2c2_hwmod = {
544 .name = "i2c2",
545 .mpu_irqs = i2c2_mpu_irqs,
546 .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
547 .sdma_reqs = i2c2_sdma_reqs,
548 .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
549 .main_clk = "i2c2_fck",
550 .prcm = {
551 .omap2 = {
552 .module_offs = CORE_MOD,
553 .prcm_reg_id = 1,
554 .module_bit = OMAP2420_EN_I2C2_SHIFT,
555 .idlest_reg_id = 1,
556 .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
557 },
558 },
559 .slaves = omap2420_i2c2_slaves,
560 .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves),
561 .class = &i2c_class,
562 .dev_attr = &i2c_dev_attr,
563 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
564 .flags = HWMOD_16BIT_REG,
565};
566
567/* l4_wkup -> gpio1 */
568static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
569 {
570 .pa_start = 0x48018000,
571 .pa_end = 0x480181ff,
572 .flags = ADDR_TYPE_RT
573 },
574};
575
576static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
577 .master = &omap2420_l4_wkup_hwmod,
578 .slave = &omap2420_gpio1_hwmod,
579 .clk = "gpios_ick",
580 .addr = omap2420_gpio1_addr_space,
581 .addr_cnt = ARRAY_SIZE(omap2420_gpio1_addr_space),
582 .user = OCP_USER_MPU | OCP_USER_SDMA,
583};
584
585/* l4_wkup -> gpio2 */
586static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
587 {
588 .pa_start = 0x4801a000,
589 .pa_end = 0x4801a1ff,
590 .flags = ADDR_TYPE_RT
591 },
592};
593
594static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
595 .master = &omap2420_l4_wkup_hwmod,
596 .slave = &omap2420_gpio2_hwmod,
597 .clk = "gpios_ick",
598 .addr = omap2420_gpio2_addr_space,
599 .addr_cnt = ARRAY_SIZE(omap2420_gpio2_addr_space),
600 .user = OCP_USER_MPU | OCP_USER_SDMA,
601};
602
603/* l4_wkup -> gpio3 */
604static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
605 {
606 .pa_start = 0x4801c000,
607 .pa_end = 0x4801c1ff,
608 .flags = ADDR_TYPE_RT
609 },
610};
611
612static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
613 .master = &omap2420_l4_wkup_hwmod,
614 .slave = &omap2420_gpio3_hwmod,
615 .clk = "gpios_ick",
616 .addr = omap2420_gpio3_addr_space,
617 .addr_cnt = ARRAY_SIZE(omap2420_gpio3_addr_space),
618 .user = OCP_USER_MPU | OCP_USER_SDMA,
619};
620
621/* l4_wkup -> gpio4 */
622static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
623 {
624 .pa_start = 0x4801e000,
625 .pa_end = 0x4801e1ff,
626 .flags = ADDR_TYPE_RT
627 },
628};
629
630static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
631 .master = &omap2420_l4_wkup_hwmod,
632 .slave = &omap2420_gpio4_hwmod,
633 .clk = "gpios_ick",
634 .addr = omap2420_gpio4_addr_space,
635 .addr_cnt = ARRAY_SIZE(omap2420_gpio4_addr_space),
636 .user = OCP_USER_MPU | OCP_USER_SDMA,
637};
638
639/* gpio dev_attr */
640static struct omap_gpio_dev_attr gpio_dev_attr = {
641 .bank_width = 32,
642 .dbck_flag = false,
643};
644
645static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
646 .rev_offs = 0x0000,
647 .sysc_offs = 0x0010,
648 .syss_offs = 0x0014,
649 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
650 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
651 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
652 .sysc_fields = &omap_hwmod_sysc_type1,
653};
654
655/*
656 * 'gpio' class
657 * general purpose io module
658 */
659static struct omap_hwmod_class omap242x_gpio_hwmod_class = {
660 .name = "gpio",
661 .sysc = &omap242x_gpio_sysc,
662 .rev = 0,
663};
664
665/* gpio1 */
666static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = {
667 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
668};
669
670static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = {
671 &omap2420_l4_wkup__gpio1,
672};
673
674static struct omap_hwmod omap2420_gpio1_hwmod = {
675 .name = "gpio1",
676 .mpu_irqs = omap242x_gpio1_irqs,
677 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio1_irqs),
678 .main_clk = "gpios_fck",
679 .prcm = {
680 .omap2 = {
681 .prcm_reg_id = 1,
682 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
683 .module_offs = WKUP_MOD,
684 .idlest_reg_id = 1,
685 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
686 },
687 },
688 .slaves = omap2420_gpio1_slaves,
689 .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
690 .class = &omap242x_gpio_hwmod_class,
691 .dev_attr = &gpio_dev_attr,
692 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
693};
694
695/* gpio2 */
696static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = {
697 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
698};
699
700static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = {
701 &omap2420_l4_wkup__gpio2,
702};
703
704static struct omap_hwmod omap2420_gpio2_hwmod = {
705 .name = "gpio2",
706 .mpu_irqs = omap242x_gpio2_irqs,
707 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio2_irqs),
708 .main_clk = "gpios_fck",
709 .prcm = {
710 .omap2 = {
711 .prcm_reg_id = 1,
712 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
713 .module_offs = WKUP_MOD,
714 .idlest_reg_id = 1,
715 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
716 },
717 },
718 .slaves = omap2420_gpio2_slaves,
719 .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
720 .class = &omap242x_gpio_hwmod_class,
721 .dev_attr = &gpio_dev_attr,
722 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
723};
724
725/* gpio3 */
726static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = {
727 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
728};
729
730static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = {
731 &omap2420_l4_wkup__gpio3,
732};
733
734static struct omap_hwmod omap2420_gpio3_hwmod = {
735 .name = "gpio3",
736 .mpu_irqs = omap242x_gpio3_irqs,
737 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio3_irqs),
738 .main_clk = "gpios_fck",
739 .prcm = {
740 .omap2 = {
741 .prcm_reg_id = 1,
742 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
743 .module_offs = WKUP_MOD,
744 .idlest_reg_id = 1,
745 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
746 },
747 },
748 .slaves = omap2420_gpio3_slaves,
749 .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
750 .class = &omap242x_gpio_hwmod_class,
751 .dev_attr = &gpio_dev_attr,
752 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
753};
754
755/* gpio4 */
756static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = {
757 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
758};
759
760static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = {
761 &omap2420_l4_wkup__gpio4,
762};
763
764static struct omap_hwmod omap2420_gpio4_hwmod = {
765 .name = "gpio4",
766 .mpu_irqs = omap242x_gpio4_irqs,
767 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio4_irqs),
768 .main_clk = "gpios_fck",
769 .prcm = {
770 .omap2 = {
771 .prcm_reg_id = 1,
772 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
773 .module_offs = WKUP_MOD,
774 .idlest_reg_id = 1,
775 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
776 },
777 },
778 .slaves = omap2420_gpio4_slaves,
779 .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
780 .class = &omap242x_gpio_hwmod_class,
781 .dev_attr = &gpio_dev_attr,
782 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
783};
784
785/* system dma */
786static struct omap_hwmod_class_sysconfig omap2420_dma_sysc = {
787 .rev_offs = 0x0000,
788 .sysc_offs = 0x002c,
789 .syss_offs = 0x0028,
790 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
791 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
792 SYSC_HAS_AUTOIDLE),
793 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
794 .sysc_fields = &omap_hwmod_sysc_type1,
795};
796
797static struct omap_hwmod_class omap2420_dma_hwmod_class = {
798 .name = "dma",
799 .sysc = &omap2420_dma_sysc,
800};
801
802/* dma attributes */
803static struct omap_dma_dev_attr dma_dev_attr = {
804 .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
805 IS_CSSA_32 | IS_CDSA_32,
806 .lch_count = 32,
807};
808
809static struct omap_hwmod_irq_info omap2420_dma_system_irqs[] = {
810 { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
811 { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
812 { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
813 { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
814};
815
816static struct omap_hwmod_addr_space omap2420_dma_system_addrs[] = {
817 {
818 .pa_start = 0x48056000,
819 .pa_end = 0x4a0560ff,
820 .flags = ADDR_TYPE_RT
821 },
822};
823
824/* dma_system -> L3 */
825static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = {
826 .master = &omap2420_dma_system_hwmod,
827 .slave = &omap2420_l3_main_hwmod,
828 .clk = "core_l3_ck",
829 .user = OCP_USER_MPU | OCP_USER_SDMA,
830};
831
832/* dma_system master ports */
833static struct omap_hwmod_ocp_if *omap2420_dma_system_masters[] = {
834 &omap2420_dma_system__l3,
835};
836
837/* l4_core -> dma_system */
838static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
839 .master = &omap2420_l4_core_hwmod,
840 .slave = &omap2420_dma_system_hwmod,
841 .clk = "sdma_ick",
842 .addr = omap2420_dma_system_addrs,
843 .addr_cnt = ARRAY_SIZE(omap2420_dma_system_addrs),
844 .user = OCP_USER_MPU | OCP_USER_SDMA,
845};
846
847/* dma_system slave ports */
848static struct omap_hwmod_ocp_if *omap2420_dma_system_slaves[] = {
849 &omap2420_l4_core__dma_system,
850};
851
852static struct omap_hwmod omap2420_dma_system_hwmod = {
853 .name = "dma",
854 .class = &omap2420_dma_hwmod_class,
855 .mpu_irqs = omap2420_dma_system_irqs,
856 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dma_system_irqs),
857 .main_clk = "core_l3_ck",
858 .slaves = omap2420_dma_system_slaves,
859 .slaves_cnt = ARRAY_SIZE(omap2420_dma_system_slaves),
860 .masters = omap2420_dma_system_masters,
861 .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters),
862 .dev_attr = &dma_dev_attr,
863 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
864 .flags = HWMOD_NO_IDLEST,
865};
866
421static __initdata struct omap_hwmod *omap2420_hwmods[] = { 867static __initdata struct omap_hwmod *omap2420_hwmods[] = {
422 &omap2420_l3_main_hwmod, 868 &omap2420_l3_main_hwmod,
423 &omap2420_l4_core_hwmod, 869 &omap2420_l4_core_hwmod,
@@ -428,6 +874,17 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
428 &omap2420_uart1_hwmod, 874 &omap2420_uart1_hwmod,
429 &omap2420_uart2_hwmod, 875 &omap2420_uart2_hwmod,
430 &omap2420_uart3_hwmod, 876 &omap2420_uart3_hwmod,
877 &omap2420_i2c1_hwmod,
878 &omap2420_i2c2_hwmod,
879
880 /* gpio class */
881 &omap2420_gpio1_hwmod,
882 &omap2420_gpio2_hwmod,
883 &omap2420_gpio3_hwmod,
884 &omap2420_gpio4_hwmod,
885
886 /* dma_system class*/
887 &omap2420_dma_system_hwmod,
431 NULL, 888 NULL,
432}; 889};
433 890
@@ -435,5 +892,3 @@ int __init omap2420_hwmod_init(void)
435{ 892{
436 return omap_hwmod_init(omap2420_hwmods); 893 return omap_hwmod_init(omap2420_hwmods);
437} 894}
438
439
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 12d939e456cf..8ecfbcde13ba 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -16,11 +16,14 @@
16#include <plat/cpu.h> 16#include <plat/cpu.h>
17#include <plat/dma.h> 17#include <plat/dma.h>
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h>
20#include <plat/gpio.h>
19 21
20#include "omap_hwmod_common_data.h" 22#include "omap_hwmod_common_data.h"
21 23
22#include "prm-regbits-24xx.h" 24#include "prm-regbits-24xx.h"
23#include "cm-regbits-24xx.h" 25#include "cm-regbits-24xx.h"
26#include "wd_timer.h"
24 27
25/* 28/*
26 * OMAP2430 hardware module integration data 29 * OMAP2430 hardware module integration data
@@ -36,6 +39,12 @@ static struct omap_hwmod omap2430_iva_hwmod;
36static struct omap_hwmod omap2430_l3_main_hwmod; 39static struct omap_hwmod omap2430_l3_main_hwmod;
37static struct omap_hwmod omap2430_l4_core_hwmod; 40static struct omap_hwmod omap2430_l4_core_hwmod;
38static struct omap_hwmod omap2430_wd_timer2_hwmod; 41static struct omap_hwmod omap2430_wd_timer2_hwmod;
42static struct omap_hwmod omap2430_gpio1_hwmod;
43static struct omap_hwmod omap2430_gpio2_hwmod;
44static struct omap_hwmod omap2430_gpio3_hwmod;
45static struct omap_hwmod omap2430_gpio4_hwmod;
46static struct omap_hwmod omap2430_gpio5_hwmod;
47static struct omap_hwmod omap2430_dma_system_hwmod;
39 48
40/* L3 -> L4_CORE interface */ 49/* L3 -> L4_CORE interface */
41static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { 50static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
@@ -77,6 +86,47 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod;
77static struct omap_hwmod omap2430_uart1_hwmod; 86static struct omap_hwmod omap2430_uart1_hwmod;
78static struct omap_hwmod omap2430_uart2_hwmod; 87static struct omap_hwmod omap2430_uart2_hwmod;
79static struct omap_hwmod omap2430_uart3_hwmod; 88static struct omap_hwmod omap2430_uart3_hwmod;
89static struct omap_hwmod omap2430_i2c1_hwmod;
90static struct omap_hwmod omap2430_i2c2_hwmod;
91
92/* I2C IP block address space length (in bytes) */
93#define OMAP2_I2C_AS_LEN 128
94
95/* L4 CORE -> I2C1 interface */
96static struct omap_hwmod_addr_space omap2430_i2c1_addr_space[] = {
97 {
98 .pa_start = 0x48070000,
99 .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
100 .flags = ADDR_TYPE_RT,
101 },
102};
103
104static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = {
105 .master = &omap2430_l4_core_hwmod,
106 .slave = &omap2430_i2c1_hwmod,
107 .clk = "i2c1_ick",
108 .addr = omap2430_i2c1_addr_space,
109 .addr_cnt = ARRAY_SIZE(omap2430_i2c1_addr_space),
110 .user = OCP_USER_MPU | OCP_USER_SDMA,
111};
112
113/* L4 CORE -> I2C2 interface */
114static struct omap_hwmod_addr_space omap2430_i2c2_addr_space[] = {
115 {
116 .pa_start = 0x48072000,
117 .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
118 .flags = ADDR_TYPE_RT,
119 },
120};
121
122static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = {
123 .master = &omap2430_l4_core_hwmod,
124 .slave = &omap2430_i2c2_hwmod,
125 .clk = "i2c2_ick",
126 .addr = omap2430_i2c2_addr_space,
127 .addr_cnt = ARRAY_SIZE(omap2430_i2c2_addr_space),
128 .user = OCP_USER_MPU | OCP_USER_SDMA,
129};
80 130
81/* L4_CORE -> L4_WKUP interface */ 131/* L4_CORE -> L4_WKUP interface */
82static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { 132static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
@@ -262,8 +312,9 @@ static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
262}; 312};
263 313
264static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = { 314static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = {
265 .name = "wd_timer", 315 .name = "wd_timer",
266 .sysc = &omap2430_wd_timer_sysc, 316 .sysc = &omap2430_wd_timer_sysc,
317 .pre_shutdown = &omap2_wd_timer_disable
267}; 318};
268 319
269/* wd_timer2 */ 320/* wd_timer2 */
@@ -418,6 +469,456 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
418 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 469 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
419}; 470};
420 471
472/* I2C common */
473static struct omap_hwmod_class_sysconfig i2c_sysc = {
474 .rev_offs = 0x00,
475 .sysc_offs = 0x20,
476 .syss_offs = 0x10,
477 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
478 .sysc_fields = &omap_hwmod_sysc_type1,
479};
480
481static struct omap_hwmod_class i2c_class = {
482 .name = "i2c",
483 .sysc = &i2c_sysc,
484};
485
486static struct omap_i2c_dev_attr i2c_dev_attr = {
487 .fifo_depth = 8, /* bytes */
488};
489
490/* I2C1 */
491
492static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
493 { .irq = INT_24XX_I2C1_IRQ, },
494};
495
496static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
497 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
498 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
499};
500
501static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = {
502 &omap2430_l4_core__i2c1,
503};
504
505static struct omap_hwmod omap2430_i2c1_hwmod = {
506 .name = "i2c1",
507 .mpu_irqs = i2c1_mpu_irqs,
508 .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
509 .sdma_reqs = i2c1_sdma_reqs,
510 .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
511 .main_clk = "i2chs1_fck",
512 .prcm = {
513 .omap2 = {
514 /*
515 * NOTE: The CM_FCLKEN* and CM_ICLKEN* for
516 * I2CHS IP's do not follow the usual pattern.
517 * prcm_reg_id alone cannot be used to program
518 * the iclk and fclk. Needs to be handled using
519 * additonal flags when clk handling is moved
520 * to hwmod framework.
521 */
522 .module_offs = CORE_MOD,
523 .prcm_reg_id = 1,
524 .module_bit = OMAP2430_EN_I2CHS1_SHIFT,
525 .idlest_reg_id = 1,
526 .idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
527 },
528 },
529 .slaves = omap2430_i2c1_slaves,
530 .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
531 .class = &i2c_class,
532 .dev_attr = &i2c_dev_attr,
533 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
534};
535
536/* I2C2 */
537
538static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
539 { .irq = INT_24XX_I2C2_IRQ, },
540};
541
542static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
543 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
544 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
545};
546
547static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = {
548 &omap2430_l4_core__i2c2,
549};
550
551static struct omap_hwmod omap2430_i2c2_hwmod = {
552 .name = "i2c2",
553 .mpu_irqs = i2c2_mpu_irqs,
554 .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
555 .sdma_reqs = i2c2_sdma_reqs,
556 .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
557 .main_clk = "i2chs2_fck",
558 .prcm = {
559 .omap2 = {
560 .module_offs = CORE_MOD,
561 .prcm_reg_id = 1,
562 .module_bit = OMAP2430_EN_I2CHS2_SHIFT,
563 .idlest_reg_id = 1,
564 .idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
565 },
566 },
567 .slaves = omap2430_i2c2_slaves,
568 .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
569 .class = &i2c_class,
570 .dev_attr = &i2c_dev_attr,
571 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
572};
573
574/* l4_wkup -> gpio1 */
575static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
576 {
577 .pa_start = 0x4900C000,
578 .pa_end = 0x4900C1ff,
579 .flags = ADDR_TYPE_RT
580 },
581};
582
583static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
584 .master = &omap2430_l4_wkup_hwmod,
585 .slave = &omap2430_gpio1_hwmod,
586 .clk = "gpios_ick",
587 .addr = omap2430_gpio1_addr_space,
588 .addr_cnt = ARRAY_SIZE(omap2430_gpio1_addr_space),
589 .user = OCP_USER_MPU | OCP_USER_SDMA,
590};
591
592/* l4_wkup -> gpio2 */
593static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
594 {
595 .pa_start = 0x4900E000,
596 .pa_end = 0x4900E1ff,
597 .flags = ADDR_TYPE_RT
598 },
599};
600
601static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
602 .master = &omap2430_l4_wkup_hwmod,
603 .slave = &omap2430_gpio2_hwmod,
604 .clk = "gpios_ick",
605 .addr = omap2430_gpio2_addr_space,
606 .addr_cnt = ARRAY_SIZE(omap2430_gpio2_addr_space),
607 .user = OCP_USER_MPU | OCP_USER_SDMA,
608};
609
610/* l4_wkup -> gpio3 */
611static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
612 {
613 .pa_start = 0x49010000,
614 .pa_end = 0x490101ff,
615 .flags = ADDR_TYPE_RT
616 },
617};
618
619static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
620 .master = &omap2430_l4_wkup_hwmod,
621 .slave = &omap2430_gpio3_hwmod,
622 .clk = "gpios_ick",
623 .addr = omap2430_gpio3_addr_space,
624 .addr_cnt = ARRAY_SIZE(omap2430_gpio3_addr_space),
625 .user = OCP_USER_MPU | OCP_USER_SDMA,
626};
627
628/* l4_wkup -> gpio4 */
629static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
630 {
631 .pa_start = 0x49012000,
632 .pa_end = 0x490121ff,
633 .flags = ADDR_TYPE_RT
634 },
635};
636
637static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
638 .master = &omap2430_l4_wkup_hwmod,
639 .slave = &omap2430_gpio4_hwmod,
640 .clk = "gpios_ick",
641 .addr = omap2430_gpio4_addr_space,
642 .addr_cnt = ARRAY_SIZE(omap2430_gpio4_addr_space),
643 .user = OCP_USER_MPU | OCP_USER_SDMA,
644};
645
646/* l4_core -> gpio5 */
647static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
648 {
649 .pa_start = 0x480B6000,
650 .pa_end = 0x480B61ff,
651 .flags = ADDR_TYPE_RT
652 },
653};
654
655static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
656 .master = &omap2430_l4_core_hwmod,
657 .slave = &omap2430_gpio5_hwmod,
658 .clk = "gpio5_ick",
659 .addr = omap2430_gpio5_addr_space,
660 .addr_cnt = ARRAY_SIZE(omap2430_gpio5_addr_space),
661 .user = OCP_USER_MPU | OCP_USER_SDMA,
662};
663
664/* gpio dev_attr */
665static struct omap_gpio_dev_attr gpio_dev_attr = {
666 .bank_width = 32,
667 .dbck_flag = false,
668};
669
670static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
671 .rev_offs = 0x0000,
672 .sysc_offs = 0x0010,
673 .syss_offs = 0x0014,
674 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
675 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
676 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
677 .sysc_fields = &omap_hwmod_sysc_type1,
678};
679
680/*
681 * 'gpio' class
682 * general purpose io module
683 */
684static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
685 .name = "gpio",
686 .sysc = &omap243x_gpio_sysc,
687 .rev = 0,
688};
689
690/* gpio1 */
691static struct omap_hwmod_irq_info omap243x_gpio1_irqs[] = {
692 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
693};
694
695static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = {
696 &omap2430_l4_wkup__gpio1,
697};
698
699static struct omap_hwmod omap2430_gpio1_hwmod = {
700 .name = "gpio1",
701 .mpu_irqs = omap243x_gpio1_irqs,
702 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio1_irqs),
703 .main_clk = "gpios_fck",
704 .prcm = {
705 .omap2 = {
706 .prcm_reg_id = 1,
707 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
708 .module_offs = WKUP_MOD,
709 .idlest_reg_id = 1,
710 .idlest_idle_bit = OMAP24XX_EN_GPIOS_SHIFT,
711 },
712 },
713 .slaves = omap2430_gpio1_slaves,
714 .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
715 .class = &omap243x_gpio_hwmod_class,
716 .dev_attr = &gpio_dev_attr,
717 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
718};
719
720/* gpio2 */
721static struct omap_hwmod_irq_info omap243x_gpio2_irqs[] = {
722 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
723};
724
725static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = {
726 &omap2430_l4_wkup__gpio2,
727};
728
729static struct omap_hwmod omap2430_gpio2_hwmod = {
730 .name = "gpio2",
731 .mpu_irqs = omap243x_gpio2_irqs,
732 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio2_irqs),
733 .main_clk = "gpios_fck",
734 .prcm = {
735 .omap2 = {
736 .prcm_reg_id = 1,
737 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
738 .module_offs = WKUP_MOD,
739 .idlest_reg_id = 1,
740 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
741 },
742 },
743 .slaves = omap2430_gpio2_slaves,
744 .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
745 .class = &omap243x_gpio_hwmod_class,
746 .dev_attr = &gpio_dev_attr,
747 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
748};
749
750/* gpio3 */
751static struct omap_hwmod_irq_info omap243x_gpio3_irqs[] = {
752 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
753};
754
755static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = {
756 &omap2430_l4_wkup__gpio3,
757};
758
759static struct omap_hwmod omap2430_gpio3_hwmod = {
760 .name = "gpio3",
761 .mpu_irqs = omap243x_gpio3_irqs,
762 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio3_irqs),
763 .main_clk = "gpios_fck",
764 .prcm = {
765 .omap2 = {
766 .prcm_reg_id = 1,
767 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
768 .module_offs = WKUP_MOD,
769 .idlest_reg_id = 1,
770 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
771 },
772 },
773 .slaves = omap2430_gpio3_slaves,
774 .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
775 .class = &omap243x_gpio_hwmod_class,
776 .dev_attr = &gpio_dev_attr,
777 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
778};
779
780/* gpio4 */
781static struct omap_hwmod_irq_info omap243x_gpio4_irqs[] = {
782 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
783};
784
785static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = {
786 &omap2430_l4_wkup__gpio4,
787};
788
789static struct omap_hwmod omap2430_gpio4_hwmod = {
790 .name = "gpio4",
791 .mpu_irqs = omap243x_gpio4_irqs,
792 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio4_irqs),
793 .main_clk = "gpios_fck",
794 .prcm = {
795 .omap2 = {
796 .prcm_reg_id = 1,
797 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
798 .module_offs = WKUP_MOD,
799 .idlest_reg_id = 1,
800 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
801 },
802 },
803 .slaves = omap2430_gpio4_slaves,
804 .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
805 .class = &omap243x_gpio_hwmod_class,
806 .dev_attr = &gpio_dev_attr,
807 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
808};
809
810/* gpio5 */
811static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
812 { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
813};
814
815static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = {
816 &omap2430_l4_core__gpio5,
817};
818
819static struct omap_hwmod omap2430_gpio5_hwmod = {
820 .name = "gpio5",
821 .mpu_irqs = omap243x_gpio5_irqs,
822 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio5_irqs),
823 .main_clk = "gpio5_fck",
824 .prcm = {
825 .omap2 = {
826 .prcm_reg_id = 2,
827 .module_bit = OMAP2430_EN_GPIO5_SHIFT,
828 .module_offs = CORE_MOD,
829 .idlest_reg_id = 2,
830 .idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
831 },
832 },
833 .slaves = omap2430_gpio5_slaves,
834 .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
835 .class = &omap243x_gpio_hwmod_class,
836 .dev_attr = &gpio_dev_attr,
837 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
838};
839
840/* dma_system */
841static struct omap_hwmod_class_sysconfig omap2430_dma_sysc = {
842 .rev_offs = 0x0000,
843 .sysc_offs = 0x002c,
844 .syss_offs = 0x0028,
845 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
846 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
847 SYSC_HAS_AUTOIDLE),
848 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
849 .sysc_fields = &omap_hwmod_sysc_type1,
850};
851
852static struct omap_hwmod_class omap2430_dma_hwmod_class = {
853 .name = "dma",
854 .sysc = &omap2430_dma_sysc,
855};
856
857/* dma attributes */
858static struct omap_dma_dev_attr dma_dev_attr = {
859 .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
860 IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
861 .lch_count = 32,
862};
863
864static struct omap_hwmod_irq_info omap2430_dma_system_irqs[] = {
865 { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
866 { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
867 { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
868 { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
869};
870
871static struct omap_hwmod_addr_space omap2430_dma_system_addrs[] = {
872 {
873 .pa_start = 0x48056000,
874 .pa_end = 0x4a0560ff,
875 .flags = ADDR_TYPE_RT
876 },
877};
878
879/* dma_system -> L3 */
880static struct omap_hwmod_ocp_if omap2430_dma_system__l3 = {
881 .master = &omap2430_dma_system_hwmod,
882 .slave = &omap2430_l3_main_hwmod,
883 .clk = "core_l3_ck",
884 .user = OCP_USER_MPU | OCP_USER_SDMA,
885};
886
887/* dma_system master ports */
888static struct omap_hwmod_ocp_if *omap2430_dma_system_masters[] = {
889 &omap2430_dma_system__l3,
890};
891
892/* l4_core -> dma_system */
893static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = {
894 .master = &omap2430_l4_core_hwmod,
895 .slave = &omap2430_dma_system_hwmod,
896 .clk = "sdma_ick",
897 .addr = omap2430_dma_system_addrs,
898 .addr_cnt = ARRAY_SIZE(omap2430_dma_system_addrs),
899 .user = OCP_USER_MPU | OCP_USER_SDMA,
900};
901
902/* dma_system slave ports */
903static struct omap_hwmod_ocp_if *omap2430_dma_system_slaves[] = {
904 &omap2430_l4_core__dma_system,
905};
906
907static struct omap_hwmod omap2430_dma_system_hwmod = {
908 .name = "dma",
909 .class = &omap2430_dma_hwmod_class,
910 .mpu_irqs = omap2430_dma_system_irqs,
911 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_dma_system_irqs),
912 .main_clk = "core_l3_ck",
913 .slaves = omap2430_dma_system_slaves,
914 .slaves_cnt = ARRAY_SIZE(omap2430_dma_system_slaves),
915 .masters = omap2430_dma_system_masters,
916 .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters),
917 .dev_attr = &dma_dev_attr,
918 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
919 .flags = HWMOD_NO_IDLEST,
920};
921
421static __initdata struct omap_hwmod *omap2430_hwmods[] = { 922static __initdata struct omap_hwmod *omap2430_hwmods[] = {
422 &omap2430_l3_main_hwmod, 923 &omap2430_l3_main_hwmod,
423 &omap2430_l4_core_hwmod, 924 &omap2430_l4_core_hwmod,
@@ -428,6 +929,18 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
428 &omap2430_uart1_hwmod, 929 &omap2430_uart1_hwmod,
429 &omap2430_uart2_hwmod, 930 &omap2430_uart2_hwmod,
430 &omap2430_uart3_hwmod, 931 &omap2430_uart3_hwmod,
932 &omap2430_i2c1_hwmod,
933 &omap2430_i2c2_hwmod,
934
935 /* gpio class */
936 &omap2430_gpio1_hwmod,
937 &omap2430_gpio2_hwmod,
938 &omap2430_gpio3_hwmod,
939 &omap2430_gpio4_hwmod,
940 &omap2430_gpio5_hwmod,
941
942 /* dma_system class*/
943 &omap2430_dma_system_hwmod,
431 NULL, 944 NULL,
432}; 945};
433 946
@@ -435,5 +948,3 @@ int __init omap2430_hwmod_init(void)
435{ 948{
436 return omap_hwmod_init(omap2430_hwmods); 949 return omap_hwmod_init(omap2430_hwmods);
437} 950}
438
439
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index cb97ecf0a3f6..8d8181334f86 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -18,11 +18,16 @@
18#include <plat/cpu.h> 18#include <plat/cpu.h>
19#include <plat/dma.h> 19#include <plat/dma.h>
20#include <plat/serial.h> 20#include <plat/serial.h>
21#include <plat/l4_3xxx.h>
22#include <plat/i2c.h>
23#include <plat/gpio.h>
24#include <plat/smartreflex.h>
21 25
22#include "omap_hwmod_common_data.h" 26#include "omap_hwmod_common_data.h"
23 27
24#include "prm-regbits-34xx.h" 28#include "prm-regbits-34xx.h"
25#include "cm-regbits-34xx.h" 29#include "cm-regbits-34xx.h"
30#include "wd_timer.h"
26 31
27/* 32/*
28 * OMAP3xxx hardware module integration data 33 * OMAP3xxx hardware module integration data
@@ -39,6 +44,19 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
39static struct omap_hwmod omap3xxx_l4_core_hwmod; 44static struct omap_hwmod omap3xxx_l4_core_hwmod;
40static struct omap_hwmod omap3xxx_l4_per_hwmod; 45static struct omap_hwmod omap3xxx_l4_per_hwmod;
41static struct omap_hwmod omap3xxx_wd_timer2_hwmod; 46static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
47static struct omap_hwmod omap3xxx_i2c1_hwmod;
48static struct omap_hwmod omap3xxx_i2c2_hwmod;
49static struct omap_hwmod omap3xxx_i2c3_hwmod;
50static struct omap_hwmod omap3xxx_gpio1_hwmod;
51static struct omap_hwmod omap3xxx_gpio2_hwmod;
52static struct omap_hwmod omap3xxx_gpio3_hwmod;
53static struct omap_hwmod omap3xxx_gpio4_hwmod;
54static struct omap_hwmod omap3xxx_gpio5_hwmod;
55static struct omap_hwmod omap3xxx_gpio6_hwmod;
56static struct omap_hwmod omap34xx_sr1_hwmod;
57static struct omap_hwmod omap34xx_sr2_hwmod;
58
59static struct omap_hwmod omap3xxx_dma_system_hwmod;
42 60
43/* L3 -> L4_CORE interface */ 61/* L3 -> L4_CORE interface */
44static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { 62static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
@@ -169,9 +187,125 @@ static struct omap_hwmod_ocp_if omap3_l4_per__uart4 = {
169 .user = OCP_USER_MPU | OCP_USER_SDMA, 187 .user = OCP_USER_MPU | OCP_USER_SDMA,
170}; 188};
171 189
190/* I2C IP block address space length (in bytes) */
191#define OMAP2_I2C_AS_LEN 128
192
193/* L4 CORE -> I2C1 interface */
194static struct omap_hwmod_addr_space omap3xxx_i2c1_addr_space[] = {
195 {
196 .pa_start = 0x48070000,
197 .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
198 .flags = ADDR_TYPE_RT,
199 },
200};
201
202static struct omap_hwmod_ocp_if omap3_l4_core__i2c1 = {
203 .master = &omap3xxx_l4_core_hwmod,
204 .slave = &omap3xxx_i2c1_hwmod,
205 .clk = "i2c1_ick",
206 .addr = omap3xxx_i2c1_addr_space,
207 .addr_cnt = ARRAY_SIZE(omap3xxx_i2c1_addr_space),
208 .fw = {
209 .omap2 = {
210 .l4_fw_region = OMAP3_L4_CORE_FW_I2C1_REGION,
211 .l4_prot_group = 7,
212 .flags = OMAP_FIREWALL_L4,
213 }
214 },
215 .user = OCP_USER_MPU | OCP_USER_SDMA,
216};
217
218/* L4 CORE -> I2C2 interface */
219static struct omap_hwmod_addr_space omap3xxx_i2c2_addr_space[] = {
220 {
221 .pa_start = 0x48072000,
222 .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
223 .flags = ADDR_TYPE_RT,
224 },
225};
226
227static struct omap_hwmod_ocp_if omap3_l4_core__i2c2 = {
228 .master = &omap3xxx_l4_core_hwmod,
229 .slave = &omap3xxx_i2c2_hwmod,
230 .clk = "i2c2_ick",
231 .addr = omap3xxx_i2c2_addr_space,
232 .addr_cnt = ARRAY_SIZE(omap3xxx_i2c2_addr_space),
233 .fw = {
234 .omap2 = {
235 .l4_fw_region = OMAP3_L4_CORE_FW_I2C2_REGION,
236 .l4_prot_group = 7,
237 .flags = OMAP_FIREWALL_L4,
238 }
239 },
240 .user = OCP_USER_MPU | OCP_USER_SDMA,
241};
242
243/* L4 CORE -> I2C3 interface */
244static struct omap_hwmod_addr_space omap3xxx_i2c3_addr_space[] = {
245 {
246 .pa_start = 0x48060000,
247 .pa_end = 0x48060000 + OMAP2_I2C_AS_LEN - 1,
248 .flags = ADDR_TYPE_RT,
249 },
250};
251
252static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = {
253 .master = &omap3xxx_l4_core_hwmod,
254 .slave = &omap3xxx_i2c3_hwmod,
255 .clk = "i2c3_ick",
256 .addr = omap3xxx_i2c3_addr_space,
257 .addr_cnt = ARRAY_SIZE(omap3xxx_i2c3_addr_space),
258 .fw = {
259 .omap2 = {
260 .l4_fw_region = OMAP3_L4_CORE_FW_I2C3_REGION,
261 .l4_prot_group = 7,
262 .flags = OMAP_FIREWALL_L4,
263 }
264 },
265 .user = OCP_USER_MPU | OCP_USER_SDMA,
266};
267
268/* L4 CORE -> SR1 interface */
269static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
270 {
271 .pa_start = OMAP34XX_SR1_BASE,
272 .pa_end = OMAP34XX_SR1_BASE + SZ_1K - 1,
273 .flags = ADDR_TYPE_RT,
274 },
275};
276
277static struct omap_hwmod_ocp_if omap3_l4_core__sr1 = {
278 .master = &omap3xxx_l4_core_hwmod,
279 .slave = &omap34xx_sr1_hwmod,
280 .clk = "sr_l4_ick",
281 .addr = omap3_sr1_addr_space,
282 .addr_cnt = ARRAY_SIZE(omap3_sr1_addr_space),
283 .user = OCP_USER_MPU,
284};
285
286/* L4 CORE -> SR1 interface */
287static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = {
288 {
289 .pa_start = OMAP34XX_SR2_BASE,
290 .pa_end = OMAP34XX_SR2_BASE + SZ_1K - 1,
291 .flags = ADDR_TYPE_RT,
292 },
293};
294
295static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = {
296 .master = &omap3xxx_l4_core_hwmod,
297 .slave = &omap34xx_sr2_hwmod,
298 .clk = "sr_l4_ick",
299 .addr = omap3_sr2_addr_space,
300 .addr_cnt = ARRAY_SIZE(omap3_sr2_addr_space),
301 .user = OCP_USER_MPU,
302};
303
172/* Slave interfaces on the L4_CORE interconnect */ 304/* Slave interfaces on the L4_CORE interconnect */
173static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { 305static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = {
174 &omap3xxx_l3_main__l4_core, 306 &omap3xxx_l3_main__l4_core,
307 &omap3_l4_core__sr1,
308 &omap3_l4_core__sr2,
175}; 309};
176 310
177/* Master interfaces on the L4_CORE interconnect */ 311/* Master interfaces on the L4_CORE interconnect */
@@ -179,6 +313,9 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {
179 &omap3xxx_l4_core__l4_wkup, 313 &omap3xxx_l4_core__l4_wkup,
180 &omap3_l4_core__uart1, 314 &omap3_l4_core__uart1,
181 &omap3_l4_core__uart2, 315 &omap3_l4_core__uart2,
316 &omap3_l4_core__i2c1,
317 &omap3_l4_core__i2c2,
318 &omap3_l4_core__i2c3,
182}; 319};
183 320
184/* L4 CORE */ 321/* L4 CORE */
@@ -315,9 +452,22 @@ static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = {
315 .sysc_fields = &omap_hwmod_sysc_type1, 452 .sysc_fields = &omap_hwmod_sysc_type1,
316}; 453};
317 454
455/* I2C common */
456static struct omap_hwmod_class_sysconfig i2c_sysc = {
457 .rev_offs = 0x00,
458 .sysc_offs = 0x20,
459 .syss_offs = 0x10,
460 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
461 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
462 SYSC_HAS_AUTOIDLE),
463 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
464 .sysc_fields = &omap_hwmod_sysc_type1,
465};
466
318static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = { 467static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = {
319 .name = "wd_timer", 468 .name = "wd_timer",
320 .sysc = &omap3xxx_wd_timer_sysc, 469 .sysc = &omap3xxx_wd_timer_sysc,
470 .pre_shutdown = &omap2_wd_timer_disable
321}; 471};
322 472
323/* wd_timer2 */ 473/* wd_timer2 */
@@ -509,6 +659,703 @@ static struct omap_hwmod omap3xxx_uart4_hwmod = {
509 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), 659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
510}; 660};
511 661
662static struct omap_hwmod_class i2c_class = {
663 .name = "i2c",
664 .sysc = &i2c_sysc,
665};
666
667/* I2C1 */
668
669static struct omap_i2c_dev_attr i2c1_dev_attr = {
670 .fifo_depth = 8, /* bytes */
671};
672
673static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
674 { .irq = INT_24XX_I2C1_IRQ, },
675};
676
677static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
678 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
679 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
680};
681
682static struct omap_hwmod_ocp_if *omap3xxx_i2c1_slaves[] = {
683 &omap3_l4_core__i2c1,
684};
685
686static struct omap_hwmod omap3xxx_i2c1_hwmod = {
687 .name = "i2c1",
688 .mpu_irqs = i2c1_mpu_irqs,
689 .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
690 .sdma_reqs = i2c1_sdma_reqs,
691 .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
692 .main_clk = "i2c1_fck",
693 .prcm = {
694 .omap2 = {
695 .module_offs = CORE_MOD,
696 .prcm_reg_id = 1,
697 .module_bit = OMAP3430_EN_I2C1_SHIFT,
698 .idlest_reg_id = 1,
699 .idlest_idle_bit = OMAP3430_ST_I2C1_SHIFT,
700 },
701 },
702 .slaves = omap3xxx_i2c1_slaves,
703 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c1_slaves),
704 .class = &i2c_class,
705 .dev_attr = &i2c1_dev_attr,
706 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
707};
708
709/* I2C2 */
710
711static struct omap_i2c_dev_attr i2c2_dev_attr = {
712 .fifo_depth = 8, /* bytes */
713};
714
715static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
716 { .irq = INT_24XX_I2C2_IRQ, },
717};
718
719static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
720 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
721 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
722};
723
724static struct omap_hwmod_ocp_if *omap3xxx_i2c2_slaves[] = {
725 &omap3_l4_core__i2c2,
726};
727
728static struct omap_hwmod omap3xxx_i2c2_hwmod = {
729 .name = "i2c2",
730 .mpu_irqs = i2c2_mpu_irqs,
731 .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
732 .sdma_reqs = i2c2_sdma_reqs,
733 .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
734 .main_clk = "i2c2_fck",
735 .prcm = {
736 .omap2 = {
737 .module_offs = CORE_MOD,
738 .prcm_reg_id = 1,
739 .module_bit = OMAP3430_EN_I2C2_SHIFT,
740 .idlest_reg_id = 1,
741 .idlest_idle_bit = OMAP3430_ST_I2C2_SHIFT,
742 },
743 },
744 .slaves = omap3xxx_i2c2_slaves,
745 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c2_slaves),
746 .class = &i2c_class,
747 .dev_attr = &i2c2_dev_attr,
748 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
749};
750
751/* I2C3 */
752
753static struct omap_i2c_dev_attr i2c3_dev_attr = {
754 .fifo_depth = 64, /* bytes */
755};
756
757static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = {
758 { .irq = INT_34XX_I2C3_IRQ, },
759};
760
761static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = {
762 { .name = "tx", .dma_req = OMAP34XX_DMA_I2C3_TX },
763 { .name = "rx", .dma_req = OMAP34XX_DMA_I2C3_RX },
764};
765
766static struct omap_hwmod_ocp_if *omap3xxx_i2c3_slaves[] = {
767 &omap3_l4_core__i2c3,
768};
769
770static struct omap_hwmod omap3xxx_i2c3_hwmod = {
771 .name = "i2c3",
772 .mpu_irqs = i2c3_mpu_irqs,
773 .mpu_irqs_cnt = ARRAY_SIZE(i2c3_mpu_irqs),
774 .sdma_reqs = i2c3_sdma_reqs,
775 .sdma_reqs_cnt = ARRAY_SIZE(i2c3_sdma_reqs),
776 .main_clk = "i2c3_fck",
777 .prcm = {
778 .omap2 = {
779 .module_offs = CORE_MOD,
780 .prcm_reg_id = 1,
781 .module_bit = OMAP3430_EN_I2C3_SHIFT,
782 .idlest_reg_id = 1,
783 .idlest_idle_bit = OMAP3430_ST_I2C3_SHIFT,
784 },
785 },
786 .slaves = omap3xxx_i2c3_slaves,
787 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c3_slaves),
788 .class = &i2c_class,
789 .dev_attr = &i2c3_dev_attr,
790 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
791};
792
793/* l4_wkup -> gpio1 */
794static struct omap_hwmod_addr_space omap3xxx_gpio1_addrs[] = {
795 {
796 .pa_start = 0x48310000,
797 .pa_end = 0x483101ff,
798 .flags = ADDR_TYPE_RT
799 },
800};
801
802static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__gpio1 = {
803 .master = &omap3xxx_l4_wkup_hwmod,
804 .slave = &omap3xxx_gpio1_hwmod,
805 .addr = omap3xxx_gpio1_addrs,
806 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio1_addrs),
807 .user = OCP_USER_MPU | OCP_USER_SDMA,
808};
809
810/* l4_per -> gpio2 */
811static struct omap_hwmod_addr_space omap3xxx_gpio2_addrs[] = {
812 {
813 .pa_start = 0x49050000,
814 .pa_end = 0x490501ff,
815 .flags = ADDR_TYPE_RT
816 },
817};
818
819static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio2 = {
820 .master = &omap3xxx_l4_per_hwmod,
821 .slave = &omap3xxx_gpio2_hwmod,
822 .addr = omap3xxx_gpio2_addrs,
823 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio2_addrs),
824 .user = OCP_USER_MPU | OCP_USER_SDMA,
825};
826
827/* l4_per -> gpio3 */
828static struct omap_hwmod_addr_space omap3xxx_gpio3_addrs[] = {
829 {
830 .pa_start = 0x49052000,
831 .pa_end = 0x490521ff,
832 .flags = ADDR_TYPE_RT
833 },
834};
835
836static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio3 = {
837 .master = &omap3xxx_l4_per_hwmod,
838 .slave = &omap3xxx_gpio3_hwmod,
839 .addr = omap3xxx_gpio3_addrs,
840 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio3_addrs),
841 .user = OCP_USER_MPU | OCP_USER_SDMA,
842};
843
844/* l4_per -> gpio4 */
845static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = {
846 {
847 .pa_start = 0x49054000,
848 .pa_end = 0x490541ff,
849 .flags = ADDR_TYPE_RT
850 },
851};
852
853static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio4 = {
854 .master = &omap3xxx_l4_per_hwmod,
855 .slave = &omap3xxx_gpio4_hwmod,
856 .addr = omap3xxx_gpio4_addrs,
857 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio4_addrs),
858 .user = OCP_USER_MPU | OCP_USER_SDMA,
859};
860
861/* l4_per -> gpio5 */
862static struct omap_hwmod_addr_space omap3xxx_gpio5_addrs[] = {
863 {
864 .pa_start = 0x49056000,
865 .pa_end = 0x490561ff,
866 .flags = ADDR_TYPE_RT
867 },
868};
869
870static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio5 = {
871 .master = &omap3xxx_l4_per_hwmod,
872 .slave = &omap3xxx_gpio5_hwmod,
873 .addr = omap3xxx_gpio5_addrs,
874 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio5_addrs),
875 .user = OCP_USER_MPU | OCP_USER_SDMA,
876};
877
878/* l4_per -> gpio6 */
879static struct omap_hwmod_addr_space omap3xxx_gpio6_addrs[] = {
880 {
881 .pa_start = 0x49058000,
882 .pa_end = 0x490581ff,
883 .flags = ADDR_TYPE_RT
884 },
885};
886
887static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio6 = {
888 .master = &omap3xxx_l4_per_hwmod,
889 .slave = &omap3xxx_gpio6_hwmod,
890 .addr = omap3xxx_gpio6_addrs,
891 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio6_addrs),
892 .user = OCP_USER_MPU | OCP_USER_SDMA,
893};
894
895/*
896 * 'gpio' class
897 * general purpose io module
898 */
899
900static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
901 .rev_offs = 0x0000,
902 .sysc_offs = 0x0010,
903 .syss_offs = 0x0014,
904 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
905 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
906 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
907 .sysc_fields = &omap_hwmod_sysc_type1,
908};
909
910static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
911 .name = "gpio",
912 .sysc = &omap3xxx_gpio_sysc,
913 .rev = 1,
914};
915
916/* gpio_dev_attr*/
917static struct omap_gpio_dev_attr gpio_dev_attr = {
918 .bank_width = 32,
919 .dbck_flag = true,
920};
921
922/* gpio1 */
923static struct omap_hwmod_irq_info omap3xxx_gpio1_irqs[] = {
924 { .irq = 29 }, /* INT_34XX_GPIO_BANK1 */
925};
926
927static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
928 { .role = "dbclk", .clk = "gpio1_dbck", },
929};
930
931static struct omap_hwmod_ocp_if *omap3xxx_gpio1_slaves[] = {
932 &omap3xxx_l4_wkup__gpio1,
933};
934
935static struct omap_hwmod omap3xxx_gpio1_hwmod = {
936 .name = "gpio1",
937 .mpu_irqs = omap3xxx_gpio1_irqs,
938 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio1_irqs),
939 .main_clk = "gpio1_ick",
940 .opt_clks = gpio1_opt_clks,
941 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
942 .prcm = {
943 .omap2 = {
944 .prcm_reg_id = 1,
945 .module_bit = OMAP3430_EN_GPIO1_SHIFT,
946 .module_offs = WKUP_MOD,
947 .idlest_reg_id = 1,
948 .idlest_idle_bit = OMAP3430_ST_GPIO1_SHIFT,
949 },
950 },
951 .slaves = omap3xxx_gpio1_slaves,
952 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio1_slaves),
953 .class = &omap3xxx_gpio_hwmod_class,
954 .dev_attr = &gpio_dev_attr,
955 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
956};
957
958/* gpio2 */
959static struct omap_hwmod_irq_info omap3xxx_gpio2_irqs[] = {
960 { .irq = 30 }, /* INT_34XX_GPIO_BANK2 */
961};
962
963static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
964 { .role = "dbclk", .clk = "gpio2_dbck", },
965};
966
967static struct omap_hwmod_ocp_if *omap3xxx_gpio2_slaves[] = {
968 &omap3xxx_l4_per__gpio2,
969};
970
971static struct omap_hwmod omap3xxx_gpio2_hwmod = {
972 .name = "gpio2",
973 .mpu_irqs = omap3xxx_gpio2_irqs,
974 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio2_irqs),
975 .main_clk = "gpio2_ick",
976 .opt_clks = gpio2_opt_clks,
977 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
978 .prcm = {
979 .omap2 = {
980 .prcm_reg_id = 1,
981 .module_bit = OMAP3430_EN_GPIO2_SHIFT,
982 .module_offs = OMAP3430_PER_MOD,
983 .idlest_reg_id = 1,
984 .idlest_idle_bit = OMAP3430_ST_GPIO2_SHIFT,
985 },
986 },
987 .slaves = omap3xxx_gpio2_slaves,
988 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio2_slaves),
989 .class = &omap3xxx_gpio_hwmod_class,
990 .dev_attr = &gpio_dev_attr,
991 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
992};
993
994/* gpio3 */
995static struct omap_hwmod_irq_info omap3xxx_gpio3_irqs[] = {
996 { .irq = 31 }, /* INT_34XX_GPIO_BANK3 */
997};
998
999static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
1000 { .role = "dbclk", .clk = "gpio3_dbck", },
1001};
1002
1003static struct omap_hwmod_ocp_if *omap3xxx_gpio3_slaves[] = {
1004 &omap3xxx_l4_per__gpio3,
1005};
1006
1007static struct omap_hwmod omap3xxx_gpio3_hwmod = {
1008 .name = "gpio3",
1009 .mpu_irqs = omap3xxx_gpio3_irqs,
1010 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio3_irqs),
1011 .main_clk = "gpio3_ick",
1012 .opt_clks = gpio3_opt_clks,
1013 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
1014 .prcm = {
1015 .omap2 = {
1016 .prcm_reg_id = 1,
1017 .module_bit = OMAP3430_EN_GPIO3_SHIFT,
1018 .module_offs = OMAP3430_PER_MOD,
1019 .idlest_reg_id = 1,
1020 .idlest_idle_bit = OMAP3430_ST_GPIO3_SHIFT,
1021 },
1022 },
1023 .slaves = omap3xxx_gpio3_slaves,
1024 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio3_slaves),
1025 .class = &omap3xxx_gpio_hwmod_class,
1026 .dev_attr = &gpio_dev_attr,
1027 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1028};
1029
1030/* gpio4 */
1031static struct omap_hwmod_irq_info omap3xxx_gpio4_irqs[] = {
1032 { .irq = 32 }, /* INT_34XX_GPIO_BANK4 */
1033};
1034
1035static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
1036 { .role = "dbclk", .clk = "gpio4_dbck", },
1037};
1038
1039static struct omap_hwmod_ocp_if *omap3xxx_gpio4_slaves[] = {
1040 &omap3xxx_l4_per__gpio4,
1041};
1042
1043static struct omap_hwmod omap3xxx_gpio4_hwmod = {
1044 .name = "gpio4",
1045 .mpu_irqs = omap3xxx_gpio4_irqs,
1046 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio4_irqs),
1047 .main_clk = "gpio4_ick",
1048 .opt_clks = gpio4_opt_clks,
1049 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
1050 .prcm = {
1051 .omap2 = {
1052 .prcm_reg_id = 1,
1053 .module_bit = OMAP3430_EN_GPIO4_SHIFT,
1054 .module_offs = OMAP3430_PER_MOD,
1055 .idlest_reg_id = 1,
1056 .idlest_idle_bit = OMAP3430_ST_GPIO4_SHIFT,
1057 },
1058 },
1059 .slaves = omap3xxx_gpio4_slaves,
1060 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio4_slaves),
1061 .class = &omap3xxx_gpio_hwmod_class,
1062 .dev_attr = &gpio_dev_attr,
1063 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1064};
1065
1066/* gpio5 */
1067static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = {
1068 { .irq = 33 }, /* INT_34XX_GPIO_BANK5 */
1069};
1070
1071static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
1072 { .role = "dbclk", .clk = "gpio5_dbck", },
1073};
1074
1075static struct omap_hwmod_ocp_if *omap3xxx_gpio5_slaves[] = {
1076 &omap3xxx_l4_per__gpio5,
1077};
1078
1079static struct omap_hwmod omap3xxx_gpio5_hwmod = {
1080 .name = "gpio5",
1081 .mpu_irqs = omap3xxx_gpio5_irqs,
1082 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio5_irqs),
1083 .main_clk = "gpio5_ick",
1084 .opt_clks = gpio5_opt_clks,
1085 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
1086 .prcm = {
1087 .omap2 = {
1088 .prcm_reg_id = 1,
1089 .module_bit = OMAP3430_EN_GPIO5_SHIFT,
1090 .module_offs = OMAP3430_PER_MOD,
1091 .idlest_reg_id = 1,
1092 .idlest_idle_bit = OMAP3430_ST_GPIO5_SHIFT,
1093 },
1094 },
1095 .slaves = omap3xxx_gpio5_slaves,
1096 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio5_slaves),
1097 .class = &omap3xxx_gpio_hwmod_class,
1098 .dev_attr = &gpio_dev_attr,
1099 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1100};
1101
1102/* gpio6 */
1103static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = {
1104 { .irq = 34 }, /* INT_34XX_GPIO_BANK6 */
1105};
1106
1107static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
1108 { .role = "dbclk", .clk = "gpio6_dbck", },
1109};
1110
1111static struct omap_hwmod_ocp_if *omap3xxx_gpio6_slaves[] = {
1112 &omap3xxx_l4_per__gpio6,
1113};
1114
1115static struct omap_hwmod omap3xxx_gpio6_hwmod = {
1116 .name = "gpio6",
1117 .mpu_irqs = omap3xxx_gpio6_irqs,
1118 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio6_irqs),
1119 .main_clk = "gpio6_ick",
1120 .opt_clks = gpio6_opt_clks,
1121 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1122 .prcm = {
1123 .omap2 = {
1124 .prcm_reg_id = 1,
1125 .module_bit = OMAP3430_EN_GPIO6_SHIFT,
1126 .module_offs = OMAP3430_PER_MOD,
1127 .idlest_reg_id = 1,
1128 .idlest_idle_bit = OMAP3430_ST_GPIO6_SHIFT,
1129 },
1130 },
1131 .slaves = omap3xxx_gpio6_slaves,
1132 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio6_slaves),
1133 .class = &omap3xxx_gpio_hwmod_class,
1134 .dev_attr = &gpio_dev_attr,
1135 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1136};
1137
1138/* dma_system -> L3 */
1139static struct omap_hwmod_ocp_if omap3xxx_dma_system__l3 = {
1140 .master = &omap3xxx_dma_system_hwmod,
1141 .slave = &omap3xxx_l3_main_hwmod,
1142 .clk = "core_l3_ick",
1143 .user = OCP_USER_MPU | OCP_USER_SDMA,
1144};
1145
1146/* dma attributes */
1147static struct omap_dma_dev_attr dma_dev_attr = {
1148 .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
1149 IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
1150 .lch_count = 32,
1151};
1152
1153static struct omap_hwmod_class_sysconfig omap3xxx_dma_sysc = {
1154 .rev_offs = 0x0000,
1155 .sysc_offs = 0x002c,
1156 .syss_offs = 0x0028,
1157 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1158 SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
1159 SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE),
1160 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1161 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1162 .sysc_fields = &omap_hwmod_sysc_type1,
1163};
1164
1165static struct omap_hwmod_class omap3xxx_dma_hwmod_class = {
1166 .name = "dma",
1167 .sysc = &omap3xxx_dma_sysc,
1168};
1169
1170/* dma_system */
1171static struct omap_hwmod_irq_info omap3xxx_dma_system_irqs[] = {
1172 { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
1173 { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
1174 { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
1175 { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
1176};
1177
1178static struct omap_hwmod_addr_space omap3xxx_dma_system_addrs[] = {
1179 {
1180 .pa_start = 0x48056000,
1181 .pa_end = 0x4a0560ff,
1182 .flags = ADDR_TYPE_RT
1183 },
1184};
1185
1186/* dma_system master ports */
1187static struct omap_hwmod_ocp_if *omap3xxx_dma_system_masters[] = {
1188 &omap3xxx_dma_system__l3,
1189};
1190
1191/* l4_cfg -> dma_system */
1192static struct omap_hwmod_ocp_if omap3xxx_l4_core__dma_system = {
1193 .master = &omap3xxx_l4_core_hwmod,
1194 .slave = &omap3xxx_dma_system_hwmod,
1195 .clk = "core_l4_ick",
1196 .addr = omap3xxx_dma_system_addrs,
1197 .addr_cnt = ARRAY_SIZE(omap3xxx_dma_system_addrs),
1198 .user = OCP_USER_MPU | OCP_USER_SDMA,
1199};
1200
1201/* dma_system slave ports */
1202static struct omap_hwmod_ocp_if *omap3xxx_dma_system_slaves[] = {
1203 &omap3xxx_l4_core__dma_system,
1204};
1205
1206static struct omap_hwmod omap3xxx_dma_system_hwmod = {
1207 .name = "dma",
1208 .class = &omap3xxx_dma_hwmod_class,
1209 .mpu_irqs = omap3xxx_dma_system_irqs,
1210 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dma_system_irqs),
1211 .main_clk = "core_l3_ick",
1212 .prcm = {
1213 .omap2 = {
1214 .module_offs = CORE_MOD,
1215 .prcm_reg_id = 1,
1216 .module_bit = OMAP3430_ST_SDMA_SHIFT,
1217 .idlest_reg_id = 1,
1218 .idlest_idle_bit = OMAP3430_ST_SDMA_SHIFT,
1219 },
1220 },
1221 .slaves = omap3xxx_dma_system_slaves,
1222 .slaves_cnt = ARRAY_SIZE(omap3xxx_dma_system_slaves),
1223 .masters = omap3xxx_dma_system_masters,
1224 .masters_cnt = ARRAY_SIZE(omap3xxx_dma_system_masters),
1225 .dev_attr = &dma_dev_attr,
1226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1227 .flags = HWMOD_NO_IDLEST,
1228};
1229
1230/* SR common */
1231static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = {
1232 .clkact_shift = 20,
1233};
1234
1235static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = {
1236 .sysc_offs = 0x24,
1237 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_NO_CACHE),
1238 .clockact = CLOCKACT_TEST_ICLK,
1239 .sysc_fields = &omap34xx_sr_sysc_fields,
1240};
1241
1242static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = {
1243 .name = "smartreflex",
1244 .sysc = &omap34xx_sr_sysc,
1245 .rev = 1,
1246};
1247
1248static struct omap_hwmod_sysc_fields omap36xx_sr_sysc_fields = {
1249 .sidle_shift = 24,
1250 .enwkup_shift = 26
1251};
1252
1253static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
1254 .sysc_offs = 0x38,
1255 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1256 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
1257 SYSC_NO_CACHE),
1258 .sysc_fields = &omap36xx_sr_sysc_fields,
1259};
1260
1261static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
1262 .name = "smartreflex",
1263 .sysc = &omap36xx_sr_sysc,
1264 .rev = 2,
1265};
1266
1267/* SR1 */
1268static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = {
1269 &omap3_l4_core__sr1,
1270};
1271
1272static struct omap_hwmod omap34xx_sr1_hwmod = {
1273 .name = "sr1_hwmod",
1274 .class = &omap34xx_smartreflex_hwmod_class,
1275 .main_clk = "sr1_fck",
1276 .vdd_name = "mpu",
1277 .prcm = {
1278 .omap2 = {
1279 .prcm_reg_id = 1,
1280 .module_bit = OMAP3430_EN_SR1_SHIFT,
1281 .module_offs = WKUP_MOD,
1282 .idlest_reg_id = 1,
1283 .idlest_idle_bit = OMAP3430_EN_SR1_SHIFT,
1284 },
1285 },
1286 .slaves = omap3_sr1_slaves,
1287 .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
1288 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
1289 CHIP_IS_OMAP3430ES3_0 |
1290 CHIP_IS_OMAP3430ES3_1),
1291 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
1292};
1293
1294static struct omap_hwmod omap36xx_sr1_hwmod = {
1295 .name = "sr1_hwmod",
1296 .class = &omap36xx_smartreflex_hwmod_class,
1297 .main_clk = "sr1_fck",
1298 .vdd_name = "mpu",
1299 .prcm = {
1300 .omap2 = {
1301 .prcm_reg_id = 1,
1302 .module_bit = OMAP3430_EN_SR1_SHIFT,
1303 .module_offs = WKUP_MOD,
1304 .idlest_reg_id = 1,
1305 .idlest_idle_bit = OMAP3430_EN_SR1_SHIFT,
1306 },
1307 },
1308 .slaves = omap3_sr1_slaves,
1309 .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
1310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
1311};
1312
1313/* SR2 */
1314static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = {
1315 &omap3_l4_core__sr2,
1316};
1317
1318static struct omap_hwmod omap34xx_sr2_hwmod = {
1319 .name = "sr2_hwmod",
1320 .class = &omap34xx_smartreflex_hwmod_class,
1321 .main_clk = "sr2_fck",
1322 .vdd_name = "core",
1323 .prcm = {
1324 .omap2 = {
1325 .prcm_reg_id = 1,
1326 .module_bit = OMAP3430_EN_SR2_SHIFT,
1327 .module_offs = WKUP_MOD,
1328 .idlest_reg_id = 1,
1329 .idlest_idle_bit = OMAP3430_EN_SR2_SHIFT,
1330 },
1331 },
1332 .slaves = omap3_sr2_slaves,
1333 .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
1334 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
1335 CHIP_IS_OMAP3430ES3_0 |
1336 CHIP_IS_OMAP3430ES3_1),
1337 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
1338};
1339
1340static struct omap_hwmod omap36xx_sr2_hwmod = {
1341 .name = "sr2_hwmod",
1342 .class = &omap36xx_smartreflex_hwmod_class,
1343 .main_clk = "sr2_fck",
1344 .vdd_name = "core",
1345 .prcm = {
1346 .omap2 = {
1347 .prcm_reg_id = 1,
1348 .module_bit = OMAP3430_EN_SR2_SHIFT,
1349 .module_offs = WKUP_MOD,
1350 .idlest_reg_id = 1,
1351 .idlest_idle_bit = OMAP3430_EN_SR2_SHIFT,
1352 },
1353 },
1354 .slaves = omap3_sr2_slaves,
1355 .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
1356 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
1357};
1358
512static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { 1359static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
513 &omap3xxx_l3_main_hwmod, 1360 &omap3xxx_l3_main_hwmod,
514 &omap3xxx_l4_core_hwmod, 1361 &omap3xxx_l4_core_hwmod,
@@ -521,6 +1368,25 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
521 &omap3xxx_uart2_hwmod, 1368 &omap3xxx_uart2_hwmod,
522 &omap3xxx_uart3_hwmod, 1369 &omap3xxx_uart3_hwmod,
523 &omap3xxx_uart4_hwmod, 1370 &omap3xxx_uart4_hwmod,
1371 &omap3xxx_i2c1_hwmod,
1372 &omap3xxx_i2c2_hwmod,
1373 &omap3xxx_i2c3_hwmod,
1374 &omap34xx_sr1_hwmod,
1375 &omap34xx_sr2_hwmod,
1376 &omap36xx_sr1_hwmod,
1377 &omap36xx_sr2_hwmod,
1378
1379
1380 /* gpio class */
1381 &omap3xxx_gpio1_hwmod,
1382 &omap3xxx_gpio2_hwmod,
1383 &omap3xxx_gpio3_hwmod,
1384 &omap3xxx_gpio4_hwmod,
1385 &omap3xxx_gpio5_hwmod,
1386 &omap3xxx_gpio6_hwmod,
1387
1388 /* dma_system class*/
1389 &omap3xxx_dma_system_hwmod,
524 NULL, 1390 NULL,
525}; 1391};
526 1392
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 7274db4de487..c2806bd11fbf 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -22,11 +22,16 @@
22 22
23#include <plat/omap_hwmod.h> 23#include <plat/omap_hwmod.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25#include <plat/gpio.h>
26#include <plat/dma.h>
25 27
26#include "omap_hwmod_common_data.h" 28#include "omap_hwmod_common_data.h"
27 29
28#include "cm.h" 30#include "cm1_44xx.h"
31#include "cm2_44xx.h"
32#include "prm44xx.h"
29#include "prm-regbits-44xx.h" 33#include "prm-regbits-44xx.h"
34#include "wd_timer.h"
30 35
31/* Base offset for all OMAP4 interrupts external to MPUSS */ 36/* Base offset for all OMAP4 interrupts external to MPUSS */
32#define OMAP44XX_IRQ_GIC_START 32 37#define OMAP44XX_IRQ_GIC_START 32
@@ -35,8 +40,11 @@
35#define OMAP44XX_DMA_REQ_START 1 40#define OMAP44XX_DMA_REQ_START 1
36 41
37/* Backward references (IPs with Bus Master capability) */ 42/* Backward references (IPs with Bus Master capability) */
43static struct omap_hwmod omap44xx_dma_system_hwmod;
38static struct omap_hwmod omap44xx_dmm_hwmod; 44static struct omap_hwmod omap44xx_dmm_hwmod;
45static struct omap_hwmod omap44xx_dsp_hwmod;
39static struct omap_hwmod omap44xx_emif_fw_hwmod; 46static struct omap_hwmod omap44xx_emif_fw_hwmod;
47static struct omap_hwmod omap44xx_iva_hwmod;
40static struct omap_hwmod omap44xx_l3_instr_hwmod; 48static struct omap_hwmod omap44xx_l3_instr_hwmod;
41static struct omap_hwmod omap44xx_l3_main_1_hwmod; 49static struct omap_hwmod omap44xx_l3_main_1_hwmod;
42static struct omap_hwmod omap44xx_l3_main_2_hwmod; 50static struct omap_hwmod omap44xx_l3_main_2_hwmod;
@@ -58,7 +66,7 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod;
58 * instance(s): dmm 66 * instance(s): dmm
59 */ 67 */
60static struct omap_hwmod_class omap44xx_dmm_hwmod_class = { 68static struct omap_hwmod_class omap44xx_dmm_hwmod_class = {
61 .name = "dmm", 69 .name = "dmm",
62}; 70};
63 71
64/* dmm interface data */ 72/* dmm interface data */
@@ -67,7 +75,15 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_1__dmm = {
67 .master = &omap44xx_l3_main_1_hwmod, 75 .master = &omap44xx_l3_main_1_hwmod,
68 .slave = &omap44xx_dmm_hwmod, 76 .slave = &omap44xx_dmm_hwmod,
69 .clk = "l3_div_ck", 77 .clk = "l3_div_ck",
70 .user = OCP_USER_MPU | OCP_USER_SDMA, 78 .user = OCP_USER_SDMA,
79};
80
81static struct omap_hwmod_addr_space omap44xx_dmm_addrs[] = {
82 {
83 .pa_start = 0x4e000000,
84 .pa_end = 0x4e0007ff,
85 .flags = ADDR_TYPE_RT
86 },
71}; 87};
72 88
73/* mpu -> dmm */ 89/* mpu -> dmm */
@@ -75,7 +91,9 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__dmm = {
75 .master = &omap44xx_mpu_hwmod, 91 .master = &omap44xx_mpu_hwmod,
76 .slave = &omap44xx_dmm_hwmod, 92 .slave = &omap44xx_dmm_hwmod,
77 .clk = "l3_div_ck", 93 .clk = "l3_div_ck",
78 .user = OCP_USER_MPU | OCP_USER_SDMA, 94 .addr = omap44xx_dmm_addrs,
95 .addr_cnt = ARRAY_SIZE(omap44xx_dmm_addrs),
96 .user = OCP_USER_MPU,
79}; 97};
80 98
81/* dmm slave ports */ 99/* dmm slave ports */
@@ -103,7 +121,7 @@ static struct omap_hwmod omap44xx_dmm_hwmod = {
103 * instance(s): emif_fw 121 * instance(s): emif_fw
104 */ 122 */
105static struct omap_hwmod_class omap44xx_emif_fw_hwmod_class = { 123static struct omap_hwmod_class omap44xx_emif_fw_hwmod_class = {
106 .name = "emif_fw", 124 .name = "emif_fw",
107}; 125};
108 126
109/* emif_fw interface data */ 127/* emif_fw interface data */
@@ -115,12 +133,22 @@ static struct omap_hwmod_ocp_if omap44xx_dmm__emif_fw = {
115 .user = OCP_USER_MPU | OCP_USER_SDMA, 133 .user = OCP_USER_MPU | OCP_USER_SDMA,
116}; 134};
117 135
136static struct omap_hwmod_addr_space omap44xx_emif_fw_addrs[] = {
137 {
138 .pa_start = 0x4a20c000,
139 .pa_end = 0x4a20c0ff,
140 .flags = ADDR_TYPE_RT
141 },
142};
143
118/* l4_cfg -> emif_fw */ 144/* l4_cfg -> emif_fw */
119static struct omap_hwmod_ocp_if omap44xx_l4_cfg__emif_fw = { 145static struct omap_hwmod_ocp_if omap44xx_l4_cfg__emif_fw = {
120 .master = &omap44xx_l4_cfg_hwmod, 146 .master = &omap44xx_l4_cfg_hwmod,
121 .slave = &omap44xx_emif_fw_hwmod, 147 .slave = &omap44xx_emif_fw_hwmod,
122 .clk = "l4_div_ck", 148 .clk = "l4_div_ck",
123 .user = OCP_USER_MPU | OCP_USER_SDMA, 149 .addr = omap44xx_emif_fw_addrs,
150 .addr_cnt = ARRAY_SIZE(omap44xx_emif_fw_addrs),
151 .user = OCP_USER_MPU,
124}; 152};
125 153
126/* emif_fw slave ports */ 154/* emif_fw slave ports */
@@ -142,10 +170,18 @@ static struct omap_hwmod omap44xx_emif_fw_hwmod = {
142 * instance(s): l3_instr, l3_main_1, l3_main_2, l3_main_3 170 * instance(s): l3_instr, l3_main_1, l3_main_2, l3_main_3
143 */ 171 */
144static struct omap_hwmod_class omap44xx_l3_hwmod_class = { 172static struct omap_hwmod_class omap44xx_l3_hwmod_class = {
145 .name = "l3", 173 .name = "l3",
146}; 174};
147 175
148/* l3_instr interface data */ 176/* l3_instr interface data */
177/* iva -> l3_instr */
178static struct omap_hwmod_ocp_if omap44xx_iva__l3_instr = {
179 .master = &omap44xx_iva_hwmod,
180 .slave = &omap44xx_l3_instr_hwmod,
181 .clk = "l3_div_ck",
182 .user = OCP_USER_MPU | OCP_USER_SDMA,
183};
184
149/* l3_main_3 -> l3_instr */ 185/* l3_main_3 -> l3_instr */
150static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = { 186static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = {
151 .master = &omap44xx_l3_main_3_hwmod, 187 .master = &omap44xx_l3_main_3_hwmod,
@@ -156,6 +192,7 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = {
156 192
157/* l3_instr slave ports */ 193/* l3_instr slave ports */
158static struct omap_hwmod_ocp_if *omap44xx_l3_instr_slaves[] = { 194static struct omap_hwmod_ocp_if *omap44xx_l3_instr_slaves[] = {
195 &omap44xx_iva__l3_instr,
159 &omap44xx_l3_main_3__l3_instr, 196 &omap44xx_l3_main_3__l3_instr,
160}; 197};
161 198
@@ -167,6 +204,15 @@ static struct omap_hwmod omap44xx_l3_instr_hwmod = {
167 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 204 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
168}; 205};
169 206
207/* l3_main_1 interface data */
208/* dsp -> l3_main_1 */
209static struct omap_hwmod_ocp_if omap44xx_dsp__l3_main_1 = {
210 .master = &omap44xx_dsp_hwmod,
211 .slave = &omap44xx_l3_main_1_hwmod,
212 .clk = "l3_div_ck",
213 .user = OCP_USER_MPU | OCP_USER_SDMA,
214};
215
170/* l3_main_2 -> l3_main_1 */ 216/* l3_main_2 -> l3_main_1 */
171static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { 217static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = {
172 .master = &omap44xx_l3_main_2_hwmod, 218 .master = &omap44xx_l3_main_2_hwmod,
@@ -193,6 +239,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = {
193 239
194/* l3_main_1 slave ports */ 240/* l3_main_1 slave ports */
195static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { 241static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = {
242 &omap44xx_dsp__l3_main_1,
196 &omap44xx_l3_main_2__l3_main_1, 243 &omap44xx_l3_main_2__l3_main_1,
197 &omap44xx_l4_cfg__l3_main_1, 244 &omap44xx_l4_cfg__l3_main_1,
198 &omap44xx_mpu__l3_main_1, 245 &omap44xx_mpu__l3_main_1,
@@ -207,6 +254,22 @@ static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
207}; 254};
208 255
209/* l3_main_2 interface data */ 256/* l3_main_2 interface data */
257/* dma_system -> l3_main_2 */
258static struct omap_hwmod_ocp_if omap44xx_dma_system__l3_main_2 = {
259 .master = &omap44xx_dma_system_hwmod,
260 .slave = &omap44xx_l3_main_2_hwmod,
261 .clk = "l3_div_ck",
262 .user = OCP_USER_MPU | OCP_USER_SDMA,
263};
264
265/* iva -> l3_main_2 */
266static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = {
267 .master = &omap44xx_iva_hwmod,
268 .slave = &omap44xx_l3_main_2_hwmod,
269 .clk = "l3_div_ck",
270 .user = OCP_USER_MPU | OCP_USER_SDMA,
271};
272
210/* l3_main_1 -> l3_main_2 */ 273/* l3_main_1 -> l3_main_2 */
211static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { 274static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = {
212 .master = &omap44xx_l3_main_1_hwmod, 275 .master = &omap44xx_l3_main_1_hwmod,
@@ -225,6 +288,8 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_2 = {
225 288
226/* l3_main_2 slave ports */ 289/* l3_main_2 slave ports */
227static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { 290static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = {
291 &omap44xx_dma_system__l3_main_2,
292 &omap44xx_iva__l3_main_2,
228 &omap44xx_l3_main_1__l3_main_2, 293 &omap44xx_l3_main_1__l3_main_2,
229 &omap44xx_l4_cfg__l3_main_2, 294 &omap44xx_l4_cfg__l3_main_2,
230}; 295};
@@ -282,10 +347,18 @@ static struct omap_hwmod omap44xx_l3_main_3_hwmod = {
282 * instance(s): l4_abe, l4_cfg, l4_per, l4_wkup 347 * instance(s): l4_abe, l4_cfg, l4_per, l4_wkup
283 */ 348 */
284static struct omap_hwmod_class omap44xx_l4_hwmod_class = { 349static struct omap_hwmod_class omap44xx_l4_hwmod_class = {
285 .name = "l4", 350 .name = "l4",
286}; 351};
287 352
288/* l4_abe interface data */ 353/* l4_abe interface data */
354/* dsp -> l4_abe */
355static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = {
356 .master = &omap44xx_dsp_hwmod,
357 .slave = &omap44xx_l4_abe_hwmod,
358 .clk = "ocp_abe_iclk",
359 .user = OCP_USER_MPU | OCP_USER_SDMA,
360};
361
289/* l3_main_1 -> l4_abe */ 362/* l3_main_1 -> l4_abe */
290static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l4_abe = { 363static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l4_abe = {
291 .master = &omap44xx_l3_main_1_hwmod, 364 .master = &omap44xx_l3_main_1_hwmod,
@@ -304,6 +377,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l4_abe = {
304 377
305/* l4_abe slave ports */ 378/* l4_abe slave ports */
306static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { 379static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = {
380 &omap44xx_dsp__l4_abe,
307 &omap44xx_l3_main_1__l4_abe, 381 &omap44xx_l3_main_1__l4_abe,
308 &omap44xx_mpu__l4_abe, 382 &omap44xx_mpu__l4_abe,
309}; 383};
@@ -387,7 +461,7 @@ static struct omap_hwmod omap44xx_l4_wkup_hwmod = {
387 * instance(s): mpu_private 461 * instance(s): mpu_private
388 */ 462 */
389static struct omap_hwmod_class omap44xx_mpu_bus_hwmod_class = { 463static struct omap_hwmod_class omap44xx_mpu_bus_hwmod_class = {
390 .name = "mpu_bus", 464 .name = "mpu_bus",
391}; 465};
392 466
393/* mpu_private interface data */ 467/* mpu_private interface data */
@@ -413,12 +487,960 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
413}; 487};
414 488
415/* 489/*
490 * Modules omap_hwmod structures
491 *
492 * The following IPs are excluded for the moment because:
493 * - They do not need an explicit SW control using omap_hwmod API.
494 * - They still need to be validated with the driver
495 * properly adapted to omap_hwmod / omap_device
496 *
497 * aess
498 * bandgap
499 * c2c
500 * c2c_target_fw
501 * cm_core
502 * cm_core_aon
503 * counter_32k
504 * ctrl_module_core
505 * ctrl_module_pad_core
506 * ctrl_module_pad_wkup
507 * ctrl_module_wkup
508 * debugss
509 * dmic
510 * dss
511 * dss_dispc
512 * dss_dsi1
513 * dss_dsi2
514 * dss_hdmi
515 * dss_rfbi
516 * dss_venc
517 * efuse_ctrl_cust
518 * efuse_ctrl_std
519 * elm
520 * emif1
521 * emif2
522 * fdif
523 * gpmc
524 * gpu
525 * hdq1w
526 * hsi
527 * ipu
528 * iss
529 * kbd
530 * mailbox
531 * mcasp
532 * mcbsp1
533 * mcbsp2
534 * mcbsp3
535 * mcbsp4
536 * mcpdm
537 * mcspi1
538 * mcspi2
539 * mcspi3
540 * mcspi4
541 * mmc1
542 * mmc2
543 * mmc3
544 * mmc4
545 * mmc5
546 * mpu_c0
547 * mpu_c1
548 * ocmc_ram
549 * ocp2scp_usb_phy
550 * ocp_wp_noc
551 * prcm
552 * prcm_mpu
553 * prm
554 * scrm
555 * sl2if
556 * slimbus1
557 * slimbus2
558 * spinlock
559 * timer1
560 * timer10
561 * timer11
562 * timer2
563 * timer3
564 * timer4
565 * timer5
566 * timer6
567 * timer7
568 * timer8
569 * timer9
570 * usb_host_fs
571 * usb_host_hs
572 * usb_otg_hs
573 * usb_phy_cm
574 * usb_tll_hs
575 * usim
576 */
577
578/*
579 * 'dma' class
580 * dma controller for data exchange between memory to memory (i.e. internal or
581 * external memory) and gp peripherals to memory or memory to gp peripherals
582 */
583
584static struct omap_hwmod_class_sysconfig omap44xx_dma_sysc = {
585 .rev_offs = 0x0000,
586 .sysc_offs = 0x002c,
587 .syss_offs = 0x0028,
588 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
589 SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE |
590 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
591 SYSS_HAS_RESET_STATUS),
592 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
593 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
594 .sysc_fields = &omap_hwmod_sysc_type1,
595};
596
597static struct omap_hwmod_class omap44xx_dma_hwmod_class = {
598 .name = "dma",
599 .sysc = &omap44xx_dma_sysc,
600};
601
602/* dma dev_attr */
603static struct omap_dma_dev_attr dma_dev_attr = {
604 .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
605 IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
606 .lch_count = 32,
607};
608
609/* dma_system */
610static struct omap_hwmod_irq_info omap44xx_dma_system_irqs[] = {
611 { .name = "0", .irq = 12 + OMAP44XX_IRQ_GIC_START },
612 { .name = "1", .irq = 13 + OMAP44XX_IRQ_GIC_START },
613 { .name = "2", .irq = 14 + OMAP44XX_IRQ_GIC_START },
614 { .name = "3", .irq = 15 + OMAP44XX_IRQ_GIC_START },
615};
616
617/* dma_system master ports */
618static struct omap_hwmod_ocp_if *omap44xx_dma_system_masters[] = {
619 &omap44xx_dma_system__l3_main_2,
620};
621
622static struct omap_hwmod_addr_space omap44xx_dma_system_addrs[] = {
623 {
624 .pa_start = 0x4a056000,
625 .pa_end = 0x4a0560ff,
626 .flags = ADDR_TYPE_RT
627 },
628};
629
630/* l4_cfg -> dma_system */
631static struct omap_hwmod_ocp_if omap44xx_l4_cfg__dma_system = {
632 .master = &omap44xx_l4_cfg_hwmod,
633 .slave = &omap44xx_dma_system_hwmod,
634 .clk = "l4_div_ck",
635 .addr = omap44xx_dma_system_addrs,
636 .addr_cnt = ARRAY_SIZE(omap44xx_dma_system_addrs),
637 .user = OCP_USER_MPU | OCP_USER_SDMA,
638};
639
640/* dma_system slave ports */
641static struct omap_hwmod_ocp_if *omap44xx_dma_system_slaves[] = {
642 &omap44xx_l4_cfg__dma_system,
643};
644
645static struct omap_hwmod omap44xx_dma_system_hwmod = {
646 .name = "dma_system",
647 .class = &omap44xx_dma_hwmod_class,
648 .mpu_irqs = omap44xx_dma_system_irqs,
649 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dma_system_irqs),
650 .main_clk = "l3_div_ck",
651 .prcm = {
652 .omap4 = {
653 .clkctrl_reg = OMAP4430_CM_SDMA_SDMA_CLKCTRL,
654 },
655 },
656 .dev_attr = &dma_dev_attr,
657 .slaves = omap44xx_dma_system_slaves,
658 .slaves_cnt = ARRAY_SIZE(omap44xx_dma_system_slaves),
659 .masters = omap44xx_dma_system_masters,
660 .masters_cnt = ARRAY_SIZE(omap44xx_dma_system_masters),
661 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
662};
663
664/*
665 * 'dsp' class
666 * dsp sub-system
667 */
668
669static struct omap_hwmod_class omap44xx_dsp_hwmod_class = {
670 .name = "dsp",
671};
672
673/* dsp */
674static struct omap_hwmod_irq_info omap44xx_dsp_irqs[] = {
675 { .irq = 28 + OMAP44XX_IRQ_GIC_START },
676};
677
678static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = {
679 { .name = "mmu_cache", .rst_shift = 1 },
680};
681
682static struct omap_hwmod_rst_info omap44xx_dsp_c0_resets[] = {
683 { .name = "dsp", .rst_shift = 0 },
684};
685
686/* dsp -> iva */
687static struct omap_hwmod_ocp_if omap44xx_dsp__iva = {
688 .master = &omap44xx_dsp_hwmod,
689 .slave = &omap44xx_iva_hwmod,
690 .clk = "dpll_iva_m5x2_ck",
691};
692
693/* dsp master ports */
694static struct omap_hwmod_ocp_if *omap44xx_dsp_masters[] = {
695 &omap44xx_dsp__l3_main_1,
696 &omap44xx_dsp__l4_abe,
697 &omap44xx_dsp__iva,
698};
699
700/* l4_cfg -> dsp */
701static struct omap_hwmod_ocp_if omap44xx_l4_cfg__dsp = {
702 .master = &omap44xx_l4_cfg_hwmod,
703 .slave = &omap44xx_dsp_hwmod,
704 .clk = "l4_div_ck",
705 .user = OCP_USER_MPU | OCP_USER_SDMA,
706};
707
708/* dsp slave ports */
709static struct omap_hwmod_ocp_if *omap44xx_dsp_slaves[] = {
710 &omap44xx_l4_cfg__dsp,
711};
712
713/* Pseudo hwmod for reset control purpose only */
714static struct omap_hwmod omap44xx_dsp_c0_hwmod = {
715 .name = "dsp_c0",
716 .class = &omap44xx_dsp_hwmod_class,
717 .flags = HWMOD_INIT_NO_RESET,
718 .rst_lines = omap44xx_dsp_c0_resets,
719 .rst_lines_cnt = ARRAY_SIZE(omap44xx_dsp_c0_resets),
720 .prcm = {
721 .omap4 = {
722 .rstctrl_reg = OMAP4430_RM_TESLA_RSTCTRL,
723 },
724 },
725 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
726};
727
728static struct omap_hwmod omap44xx_dsp_hwmod = {
729 .name = "dsp",
730 .class = &omap44xx_dsp_hwmod_class,
731 .mpu_irqs = omap44xx_dsp_irqs,
732 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dsp_irqs),
733 .rst_lines = omap44xx_dsp_resets,
734 .rst_lines_cnt = ARRAY_SIZE(omap44xx_dsp_resets),
735 .main_clk = "dsp_fck",
736 .prcm = {
737 .omap4 = {
738 .clkctrl_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL,
739 .rstctrl_reg = OMAP4430_RM_TESLA_RSTCTRL,
740 },
741 },
742 .slaves = omap44xx_dsp_slaves,
743 .slaves_cnt = ARRAY_SIZE(omap44xx_dsp_slaves),
744 .masters = omap44xx_dsp_masters,
745 .masters_cnt = ARRAY_SIZE(omap44xx_dsp_masters),
746 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
747};
748
749/*
750 * 'gpio' class
751 * general purpose io module
752 */
753
754static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
755 .rev_offs = 0x0000,
756 .sysc_offs = 0x0010,
757 .syss_offs = 0x0114,
758 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
759 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
760 SYSS_HAS_RESET_STATUS),
761 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
762 SIDLE_SMART_WKUP),
763 .sysc_fields = &omap_hwmod_sysc_type1,
764};
765
766static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
767 .name = "gpio",
768 .sysc = &omap44xx_gpio_sysc,
769 .rev = 2,
770};
771
772/* gpio dev_attr */
773static struct omap_gpio_dev_attr gpio_dev_attr = {
774 .bank_width = 32,
775 .dbck_flag = true,
776};
777
778/* gpio1 */
779static struct omap_hwmod omap44xx_gpio1_hwmod;
780static struct omap_hwmod_irq_info omap44xx_gpio1_irqs[] = {
781 { .irq = 29 + OMAP44XX_IRQ_GIC_START },
782};
783
784static struct omap_hwmod_addr_space omap44xx_gpio1_addrs[] = {
785 {
786 .pa_start = 0x4a310000,
787 .pa_end = 0x4a3101ff,
788 .flags = ADDR_TYPE_RT
789 },
790};
791
792/* l4_wkup -> gpio1 */
793static struct omap_hwmod_ocp_if omap44xx_l4_wkup__gpio1 = {
794 .master = &omap44xx_l4_wkup_hwmod,
795 .slave = &omap44xx_gpio1_hwmod,
796 .clk = "l4_wkup_clk_mux_ck",
797 .addr = omap44xx_gpio1_addrs,
798 .addr_cnt = ARRAY_SIZE(omap44xx_gpio1_addrs),
799 .user = OCP_USER_MPU | OCP_USER_SDMA,
800};
801
802/* gpio1 slave ports */
803static struct omap_hwmod_ocp_if *omap44xx_gpio1_slaves[] = {
804 &omap44xx_l4_wkup__gpio1,
805};
806
807static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
808 { .role = "dbclk", .clk = "gpio1_dbclk" },
809};
810
811static struct omap_hwmod omap44xx_gpio1_hwmod = {
812 .name = "gpio1",
813 .class = &omap44xx_gpio_hwmod_class,
814 .mpu_irqs = omap44xx_gpio1_irqs,
815 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio1_irqs),
816 .main_clk = "gpio1_ick",
817 .prcm = {
818 .omap4 = {
819 .clkctrl_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
820 },
821 },
822 .opt_clks = gpio1_opt_clks,
823 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
824 .dev_attr = &gpio_dev_attr,
825 .slaves = omap44xx_gpio1_slaves,
826 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves),
827 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
828};
829
830/* gpio2 */
831static struct omap_hwmod omap44xx_gpio2_hwmod;
832static struct omap_hwmod_irq_info omap44xx_gpio2_irqs[] = {
833 { .irq = 30 + OMAP44XX_IRQ_GIC_START },
834};
835
836static struct omap_hwmod_addr_space omap44xx_gpio2_addrs[] = {
837 {
838 .pa_start = 0x48055000,
839 .pa_end = 0x480551ff,
840 .flags = ADDR_TYPE_RT
841 },
842};
843
844/* l4_per -> gpio2 */
845static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio2 = {
846 .master = &omap44xx_l4_per_hwmod,
847 .slave = &omap44xx_gpio2_hwmod,
848 .clk = "l4_div_ck",
849 .addr = omap44xx_gpio2_addrs,
850 .addr_cnt = ARRAY_SIZE(omap44xx_gpio2_addrs),
851 .user = OCP_USER_MPU | OCP_USER_SDMA,
852};
853
854/* gpio2 slave ports */
855static struct omap_hwmod_ocp_if *omap44xx_gpio2_slaves[] = {
856 &omap44xx_l4_per__gpio2,
857};
858
859static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
860 { .role = "dbclk", .clk = "gpio2_dbclk" },
861};
862
863static struct omap_hwmod omap44xx_gpio2_hwmod = {
864 .name = "gpio2",
865 .class = &omap44xx_gpio_hwmod_class,
866 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
867 .mpu_irqs = omap44xx_gpio2_irqs,
868 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio2_irqs),
869 .main_clk = "gpio2_ick",
870 .prcm = {
871 .omap4 = {
872 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
873 },
874 },
875 .opt_clks = gpio2_opt_clks,
876 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
877 .dev_attr = &gpio_dev_attr,
878 .slaves = omap44xx_gpio2_slaves,
879 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves),
880 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
881};
882
883/* gpio3 */
884static struct omap_hwmod omap44xx_gpio3_hwmod;
885static struct omap_hwmod_irq_info omap44xx_gpio3_irqs[] = {
886 { .irq = 31 + OMAP44XX_IRQ_GIC_START },
887};
888
889static struct omap_hwmod_addr_space omap44xx_gpio3_addrs[] = {
890 {
891 .pa_start = 0x48057000,
892 .pa_end = 0x480571ff,
893 .flags = ADDR_TYPE_RT
894 },
895};
896
897/* l4_per -> gpio3 */
898static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio3 = {
899 .master = &omap44xx_l4_per_hwmod,
900 .slave = &omap44xx_gpio3_hwmod,
901 .clk = "l4_div_ck",
902 .addr = omap44xx_gpio3_addrs,
903 .addr_cnt = ARRAY_SIZE(omap44xx_gpio3_addrs),
904 .user = OCP_USER_MPU | OCP_USER_SDMA,
905};
906
907/* gpio3 slave ports */
908static struct omap_hwmod_ocp_if *omap44xx_gpio3_slaves[] = {
909 &omap44xx_l4_per__gpio3,
910};
911
912static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
913 { .role = "dbclk", .clk = "gpio3_dbclk" },
914};
915
916static struct omap_hwmod omap44xx_gpio3_hwmod = {
917 .name = "gpio3",
918 .class = &omap44xx_gpio_hwmod_class,
919 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
920 .mpu_irqs = omap44xx_gpio3_irqs,
921 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio3_irqs),
922 .main_clk = "gpio3_ick",
923 .prcm = {
924 .omap4 = {
925 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
926 },
927 },
928 .opt_clks = gpio3_opt_clks,
929 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
930 .dev_attr = &gpio_dev_attr,
931 .slaves = omap44xx_gpio3_slaves,
932 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves),
933 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
934};
935
936/* gpio4 */
937static struct omap_hwmod omap44xx_gpio4_hwmod;
938static struct omap_hwmod_irq_info omap44xx_gpio4_irqs[] = {
939 { .irq = 32 + OMAP44XX_IRQ_GIC_START },
940};
941
942static struct omap_hwmod_addr_space omap44xx_gpio4_addrs[] = {
943 {
944 .pa_start = 0x48059000,
945 .pa_end = 0x480591ff,
946 .flags = ADDR_TYPE_RT
947 },
948};
949
950/* l4_per -> gpio4 */
951static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio4 = {
952 .master = &omap44xx_l4_per_hwmod,
953 .slave = &omap44xx_gpio4_hwmod,
954 .clk = "l4_div_ck",
955 .addr = omap44xx_gpio4_addrs,
956 .addr_cnt = ARRAY_SIZE(omap44xx_gpio4_addrs),
957 .user = OCP_USER_MPU | OCP_USER_SDMA,
958};
959
960/* gpio4 slave ports */
961static struct omap_hwmod_ocp_if *omap44xx_gpio4_slaves[] = {
962 &omap44xx_l4_per__gpio4,
963};
964
965static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
966 { .role = "dbclk", .clk = "gpio4_dbclk" },
967};
968
969static struct omap_hwmod omap44xx_gpio4_hwmod = {
970 .name = "gpio4",
971 .class = &omap44xx_gpio_hwmod_class,
972 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
973 .mpu_irqs = omap44xx_gpio4_irqs,
974 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio4_irqs),
975 .main_clk = "gpio4_ick",
976 .prcm = {
977 .omap4 = {
978 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
979 },
980 },
981 .opt_clks = gpio4_opt_clks,
982 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
983 .dev_attr = &gpio_dev_attr,
984 .slaves = omap44xx_gpio4_slaves,
985 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves),
986 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
987};
988
989/* gpio5 */
990static struct omap_hwmod omap44xx_gpio5_hwmod;
991static struct omap_hwmod_irq_info omap44xx_gpio5_irqs[] = {
992 { .irq = 33 + OMAP44XX_IRQ_GIC_START },
993};
994
995static struct omap_hwmod_addr_space omap44xx_gpio5_addrs[] = {
996 {
997 .pa_start = 0x4805b000,
998 .pa_end = 0x4805b1ff,
999 .flags = ADDR_TYPE_RT
1000 },
1001};
1002
1003/* l4_per -> gpio5 */
1004static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio5 = {
1005 .master = &omap44xx_l4_per_hwmod,
1006 .slave = &omap44xx_gpio5_hwmod,
1007 .clk = "l4_div_ck",
1008 .addr = omap44xx_gpio5_addrs,
1009 .addr_cnt = ARRAY_SIZE(omap44xx_gpio5_addrs),
1010 .user = OCP_USER_MPU | OCP_USER_SDMA,
1011};
1012
1013/* gpio5 slave ports */
1014static struct omap_hwmod_ocp_if *omap44xx_gpio5_slaves[] = {
1015 &omap44xx_l4_per__gpio5,
1016};
1017
1018static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
1019 { .role = "dbclk", .clk = "gpio5_dbclk" },
1020};
1021
1022static struct omap_hwmod omap44xx_gpio5_hwmod = {
1023 .name = "gpio5",
1024 .class = &omap44xx_gpio_hwmod_class,
1025 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1026 .mpu_irqs = omap44xx_gpio5_irqs,
1027 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio5_irqs),
1028 .main_clk = "gpio5_ick",
1029 .prcm = {
1030 .omap4 = {
1031 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
1032 },
1033 },
1034 .opt_clks = gpio5_opt_clks,
1035 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
1036 .dev_attr = &gpio_dev_attr,
1037 .slaves = omap44xx_gpio5_slaves,
1038 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves),
1039 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1040};
1041
1042/* gpio6 */
1043static struct omap_hwmod omap44xx_gpio6_hwmod;
1044static struct omap_hwmod_irq_info omap44xx_gpio6_irqs[] = {
1045 { .irq = 34 + OMAP44XX_IRQ_GIC_START },
1046};
1047
1048static struct omap_hwmod_addr_space omap44xx_gpio6_addrs[] = {
1049 {
1050 .pa_start = 0x4805d000,
1051 .pa_end = 0x4805d1ff,
1052 .flags = ADDR_TYPE_RT
1053 },
1054};
1055
1056/* l4_per -> gpio6 */
1057static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio6 = {
1058 .master = &omap44xx_l4_per_hwmod,
1059 .slave = &omap44xx_gpio6_hwmod,
1060 .clk = "l4_div_ck",
1061 .addr = omap44xx_gpio6_addrs,
1062 .addr_cnt = ARRAY_SIZE(omap44xx_gpio6_addrs),
1063 .user = OCP_USER_MPU | OCP_USER_SDMA,
1064};
1065
1066/* gpio6 slave ports */
1067static struct omap_hwmod_ocp_if *omap44xx_gpio6_slaves[] = {
1068 &omap44xx_l4_per__gpio6,
1069};
1070
1071static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
1072 { .role = "dbclk", .clk = "gpio6_dbclk" },
1073};
1074
1075static struct omap_hwmod omap44xx_gpio6_hwmod = {
1076 .name = "gpio6",
1077 .class = &omap44xx_gpio_hwmod_class,
1078 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1079 .mpu_irqs = omap44xx_gpio6_irqs,
1080 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio6_irqs),
1081 .main_clk = "gpio6_ick",
1082 .prcm = {
1083 .omap4 = {
1084 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
1085 },
1086 },
1087 .opt_clks = gpio6_opt_clks,
1088 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1089 .dev_attr = &gpio_dev_attr,
1090 .slaves = omap44xx_gpio6_slaves,
1091 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves),
1092 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1093};
1094
1095/*
1096 * 'i2c' class
1097 * multimaster high-speed i2c controller
1098 */
1099
1100static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = {
1101 .sysc_offs = 0x0010,
1102 .syss_offs = 0x0090,
1103 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1104 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1105 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1106 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1107 SIDLE_SMART_WKUP),
1108 .sysc_fields = &omap_hwmod_sysc_type1,
1109};
1110
1111static struct omap_hwmod_class omap44xx_i2c_hwmod_class = {
1112 .name = "i2c",
1113 .sysc = &omap44xx_i2c_sysc,
1114};
1115
1116/* i2c1 */
1117static struct omap_hwmod omap44xx_i2c1_hwmod;
1118static struct omap_hwmod_irq_info omap44xx_i2c1_irqs[] = {
1119 { .irq = 56 + OMAP44XX_IRQ_GIC_START },
1120};
1121
1122static struct omap_hwmod_dma_info omap44xx_i2c1_sdma_reqs[] = {
1123 { .name = "tx", .dma_req = 26 + OMAP44XX_DMA_REQ_START },
1124 { .name = "rx", .dma_req = 27 + OMAP44XX_DMA_REQ_START },
1125};
1126
1127static struct omap_hwmod_addr_space omap44xx_i2c1_addrs[] = {
1128 {
1129 .pa_start = 0x48070000,
1130 .pa_end = 0x480700ff,
1131 .flags = ADDR_TYPE_RT
1132 },
1133};
1134
1135/* l4_per -> i2c1 */
1136static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c1 = {
1137 .master = &omap44xx_l4_per_hwmod,
1138 .slave = &omap44xx_i2c1_hwmod,
1139 .clk = "l4_div_ck",
1140 .addr = omap44xx_i2c1_addrs,
1141 .addr_cnt = ARRAY_SIZE(omap44xx_i2c1_addrs),
1142 .user = OCP_USER_MPU | OCP_USER_SDMA,
1143};
1144
1145/* i2c1 slave ports */
1146static struct omap_hwmod_ocp_if *omap44xx_i2c1_slaves[] = {
1147 &omap44xx_l4_per__i2c1,
1148};
1149
1150static struct omap_hwmod omap44xx_i2c1_hwmod = {
1151 .name = "i2c1",
1152 .class = &omap44xx_i2c_hwmod_class,
1153 .flags = HWMOD_INIT_NO_RESET,
1154 .mpu_irqs = omap44xx_i2c1_irqs,
1155 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_i2c1_irqs),
1156 .sdma_reqs = omap44xx_i2c1_sdma_reqs,
1157 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_i2c1_sdma_reqs),
1158 .main_clk = "i2c1_fck",
1159 .prcm = {
1160 .omap4 = {
1161 .clkctrl_reg = OMAP4430_CM_L4PER_I2C1_CLKCTRL,
1162 },
1163 },
1164 .slaves = omap44xx_i2c1_slaves,
1165 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c1_slaves),
1166 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1167};
1168
1169/* i2c2 */
1170static struct omap_hwmod omap44xx_i2c2_hwmod;
1171static struct omap_hwmod_irq_info omap44xx_i2c2_irqs[] = {
1172 { .irq = 57 + OMAP44XX_IRQ_GIC_START },
1173};
1174
1175static struct omap_hwmod_dma_info omap44xx_i2c2_sdma_reqs[] = {
1176 { .name = "tx", .dma_req = 28 + OMAP44XX_DMA_REQ_START },
1177 { .name = "rx", .dma_req = 29 + OMAP44XX_DMA_REQ_START },
1178};
1179
1180static struct omap_hwmod_addr_space omap44xx_i2c2_addrs[] = {
1181 {
1182 .pa_start = 0x48072000,
1183 .pa_end = 0x480720ff,
1184 .flags = ADDR_TYPE_RT
1185 },
1186};
1187
1188/* l4_per -> i2c2 */
1189static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c2 = {
1190 .master = &omap44xx_l4_per_hwmod,
1191 .slave = &omap44xx_i2c2_hwmod,
1192 .clk = "l4_div_ck",
1193 .addr = omap44xx_i2c2_addrs,
1194 .addr_cnt = ARRAY_SIZE(omap44xx_i2c2_addrs),
1195 .user = OCP_USER_MPU | OCP_USER_SDMA,
1196};
1197
1198/* i2c2 slave ports */
1199static struct omap_hwmod_ocp_if *omap44xx_i2c2_slaves[] = {
1200 &omap44xx_l4_per__i2c2,
1201};
1202
1203static struct omap_hwmod omap44xx_i2c2_hwmod = {
1204 .name = "i2c2",
1205 .class = &omap44xx_i2c_hwmod_class,
1206 .flags = HWMOD_INIT_NO_RESET,
1207 .mpu_irqs = omap44xx_i2c2_irqs,
1208 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_i2c2_irqs),
1209 .sdma_reqs = omap44xx_i2c2_sdma_reqs,
1210 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_i2c2_sdma_reqs),
1211 .main_clk = "i2c2_fck",
1212 .prcm = {
1213 .omap4 = {
1214 .clkctrl_reg = OMAP4430_CM_L4PER_I2C2_CLKCTRL,
1215 },
1216 },
1217 .slaves = omap44xx_i2c2_slaves,
1218 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c2_slaves),
1219 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1220};
1221
1222/* i2c3 */
1223static struct omap_hwmod omap44xx_i2c3_hwmod;
1224static struct omap_hwmod_irq_info omap44xx_i2c3_irqs[] = {
1225 { .irq = 61 + OMAP44XX_IRQ_GIC_START },
1226};
1227
1228static struct omap_hwmod_dma_info omap44xx_i2c3_sdma_reqs[] = {
1229 { .name = "tx", .dma_req = 24 + OMAP44XX_DMA_REQ_START },
1230 { .name = "rx", .dma_req = 25 + OMAP44XX_DMA_REQ_START },
1231};
1232
1233static struct omap_hwmod_addr_space omap44xx_i2c3_addrs[] = {
1234 {
1235 .pa_start = 0x48060000,
1236 .pa_end = 0x480600ff,
1237 .flags = ADDR_TYPE_RT
1238 },
1239};
1240
1241/* l4_per -> i2c3 */
1242static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c3 = {
1243 .master = &omap44xx_l4_per_hwmod,
1244 .slave = &omap44xx_i2c3_hwmod,
1245 .clk = "l4_div_ck",
1246 .addr = omap44xx_i2c3_addrs,
1247 .addr_cnt = ARRAY_SIZE(omap44xx_i2c3_addrs),
1248 .user = OCP_USER_MPU | OCP_USER_SDMA,
1249};
1250
1251/* i2c3 slave ports */
1252static struct omap_hwmod_ocp_if *omap44xx_i2c3_slaves[] = {
1253 &omap44xx_l4_per__i2c3,
1254};
1255
1256static struct omap_hwmod omap44xx_i2c3_hwmod = {
1257 .name = "i2c3",
1258 .class = &omap44xx_i2c_hwmod_class,
1259 .flags = HWMOD_INIT_NO_RESET,
1260 .mpu_irqs = omap44xx_i2c3_irqs,
1261 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_i2c3_irqs),
1262 .sdma_reqs = omap44xx_i2c3_sdma_reqs,
1263 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_i2c3_sdma_reqs),
1264 .main_clk = "i2c3_fck",
1265 .prcm = {
1266 .omap4 = {
1267 .clkctrl_reg = OMAP4430_CM_L4PER_I2C3_CLKCTRL,
1268 },
1269 },
1270 .slaves = omap44xx_i2c3_slaves,
1271 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c3_slaves),
1272 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1273};
1274
1275/* i2c4 */
1276static struct omap_hwmod omap44xx_i2c4_hwmod;
1277static struct omap_hwmod_irq_info omap44xx_i2c4_irqs[] = {
1278 { .irq = 62 + OMAP44XX_IRQ_GIC_START },
1279};
1280
1281static struct omap_hwmod_dma_info omap44xx_i2c4_sdma_reqs[] = {
1282 { .name = "tx", .dma_req = 123 + OMAP44XX_DMA_REQ_START },
1283 { .name = "rx", .dma_req = 124 + OMAP44XX_DMA_REQ_START },
1284};
1285
1286static struct omap_hwmod_addr_space omap44xx_i2c4_addrs[] = {
1287 {
1288 .pa_start = 0x48350000,
1289 .pa_end = 0x483500ff,
1290 .flags = ADDR_TYPE_RT
1291 },
1292};
1293
1294/* l4_per -> i2c4 */
1295static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c4 = {
1296 .master = &omap44xx_l4_per_hwmod,
1297 .slave = &omap44xx_i2c4_hwmod,
1298 .clk = "l4_div_ck",
1299 .addr = omap44xx_i2c4_addrs,
1300 .addr_cnt = ARRAY_SIZE(omap44xx_i2c4_addrs),
1301 .user = OCP_USER_MPU | OCP_USER_SDMA,
1302};
1303
1304/* i2c4 slave ports */
1305static struct omap_hwmod_ocp_if *omap44xx_i2c4_slaves[] = {
1306 &omap44xx_l4_per__i2c4,
1307};
1308
1309static struct omap_hwmod omap44xx_i2c4_hwmod = {
1310 .name = "i2c4",
1311 .class = &omap44xx_i2c_hwmod_class,
1312 .flags = HWMOD_INIT_NO_RESET,
1313 .mpu_irqs = omap44xx_i2c4_irqs,
1314 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_i2c4_irqs),
1315 .sdma_reqs = omap44xx_i2c4_sdma_reqs,
1316 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_i2c4_sdma_reqs),
1317 .main_clk = "i2c4_fck",
1318 .prcm = {
1319 .omap4 = {
1320 .clkctrl_reg = OMAP4430_CM_L4PER_I2C4_CLKCTRL,
1321 },
1322 },
1323 .slaves = omap44xx_i2c4_slaves,
1324 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c4_slaves),
1325 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1326};
1327
1328/*
1329 * 'iva' class
1330 * multi-standard video encoder/decoder hardware accelerator
1331 */
1332
1333static struct omap_hwmod_class omap44xx_iva_hwmod_class = {
1334 .name = "iva",
1335};
1336
1337/* iva */
1338static struct omap_hwmod_irq_info omap44xx_iva_irqs[] = {
1339 { .name = "sync_1", .irq = 103 + OMAP44XX_IRQ_GIC_START },
1340 { .name = "sync_0", .irq = 104 + OMAP44XX_IRQ_GIC_START },
1341 { .name = "mailbox_0", .irq = 107 + OMAP44XX_IRQ_GIC_START },
1342};
1343
1344static struct omap_hwmod_rst_info omap44xx_iva_resets[] = {
1345 { .name = "logic", .rst_shift = 2 },
1346};
1347
1348static struct omap_hwmod_rst_info omap44xx_iva_seq0_resets[] = {
1349 { .name = "seq0", .rst_shift = 0 },
1350};
1351
1352static struct omap_hwmod_rst_info omap44xx_iva_seq1_resets[] = {
1353 { .name = "seq1", .rst_shift = 1 },
1354};
1355
1356/* iva master ports */
1357static struct omap_hwmod_ocp_if *omap44xx_iva_masters[] = {
1358 &omap44xx_iva__l3_main_2,
1359 &omap44xx_iva__l3_instr,
1360};
1361
1362static struct omap_hwmod_addr_space omap44xx_iva_addrs[] = {
1363 {
1364 .pa_start = 0x5a000000,
1365 .pa_end = 0x5a07ffff,
1366 .flags = ADDR_TYPE_RT
1367 },
1368};
1369
1370/* l3_main_2 -> iva */
1371static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iva = {
1372 .master = &omap44xx_l3_main_2_hwmod,
1373 .slave = &omap44xx_iva_hwmod,
1374 .clk = "l3_div_ck",
1375 .addr = omap44xx_iva_addrs,
1376 .addr_cnt = ARRAY_SIZE(omap44xx_iva_addrs),
1377 .user = OCP_USER_MPU,
1378};
1379
1380/* iva slave ports */
1381static struct omap_hwmod_ocp_if *omap44xx_iva_slaves[] = {
1382 &omap44xx_dsp__iva,
1383 &omap44xx_l3_main_2__iva,
1384};
1385
1386/* Pseudo hwmod for reset control purpose only */
1387static struct omap_hwmod omap44xx_iva_seq0_hwmod = {
1388 .name = "iva_seq0",
1389 .class = &omap44xx_iva_hwmod_class,
1390 .flags = HWMOD_INIT_NO_RESET,
1391 .rst_lines = omap44xx_iva_seq0_resets,
1392 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_seq0_resets),
1393 .prcm = {
1394 .omap4 = {
1395 .rstctrl_reg = OMAP4430_RM_IVAHD_RSTCTRL,
1396 },
1397 },
1398 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1399};
1400
1401/* Pseudo hwmod for reset control purpose only */
1402static struct omap_hwmod omap44xx_iva_seq1_hwmod = {
1403 .name = "iva_seq1",
1404 .class = &omap44xx_iva_hwmod_class,
1405 .flags = HWMOD_INIT_NO_RESET,
1406 .rst_lines = omap44xx_iva_seq1_resets,
1407 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_seq1_resets),
1408 .prcm = {
1409 .omap4 = {
1410 .rstctrl_reg = OMAP4430_RM_IVAHD_RSTCTRL,
1411 },
1412 },
1413 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1414};
1415
1416static struct omap_hwmod omap44xx_iva_hwmod = {
1417 .name = "iva",
1418 .class = &omap44xx_iva_hwmod_class,
1419 .mpu_irqs = omap44xx_iva_irqs,
1420 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_iva_irqs),
1421 .rst_lines = omap44xx_iva_resets,
1422 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_resets),
1423 .main_clk = "iva_fck",
1424 .prcm = {
1425 .omap4 = {
1426 .clkctrl_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
1427 .rstctrl_reg = OMAP4430_RM_IVAHD_RSTCTRL,
1428 },
1429 },
1430 .slaves = omap44xx_iva_slaves,
1431 .slaves_cnt = ARRAY_SIZE(omap44xx_iva_slaves),
1432 .masters = omap44xx_iva_masters,
1433 .masters_cnt = ARRAY_SIZE(omap44xx_iva_masters),
1434 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1435};
1436
1437/*
416 * 'mpu' class 1438 * 'mpu' class
417 * mpu sub-system 1439 * mpu sub-system
418 */ 1440 */
419 1441
420static struct omap_hwmod_class omap44xx_mpu_hwmod_class = { 1442static struct omap_hwmod_class omap44xx_mpu_hwmod_class = {
421 .name = "mpu", 1443 .name = "mpu",
422}; 1444};
423 1445
424/* mpu */ 1446/* mpu */
@@ -453,58 +1475,189 @@ static struct omap_hwmod omap44xx_mpu_hwmod = {
453}; 1475};
454 1476
455/* 1477/*
456 * 'wd_timer' class 1478 * 'smartreflex' class
457 * 32-bit watchdog upward counter that generates a pulse on the reset pin on 1479 * smartreflex module (monitor silicon performance and outputs a measure of
458 * overflow condition 1480 * performance error)
459 */ 1481 */
460 1482
461static struct omap_hwmod_class_sysconfig omap44xx_wd_timer_sysc = { 1483/* The IP is not compliant to type1 / type2 scheme */
462 .rev_offs = 0x0000, 1484static struct omap_hwmod_sysc_fields omap_hwmod_sysc_type_smartreflex = {
463 .sysc_offs = 0x0010, 1485 .sidle_shift = 24,
464 .syss_offs = 0x0014, 1486 .enwkup_shift = 26,
465 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
466 SYSC_HAS_SOFTRESET),
467 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
468 .sysc_fields = &omap_hwmod_sysc_type1,
469}; 1487};
470 1488
471/* 1489static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {
472 * 'uart' class 1490 .sysc_offs = 0x0038,
473 * universal asynchronous receiver/transmitter (uart) 1491 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE),
474 */ 1492 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1493 SIDLE_SMART_WKUP),
1494 .sysc_fields = &omap_hwmod_sysc_type_smartreflex,
1495};
475 1496
476static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = { 1497static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
477 .rev_offs = 0x0050, 1498 .name = "smartreflex",
478 .sysc_offs = 0x0054, 1499 .sysc = &omap44xx_smartreflex_sysc,
479 .syss_offs = 0x0058, 1500 .rev = 2,
480 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
481 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
482 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
483 .sysc_fields = &omap_hwmod_sysc_type1,
484}; 1501};
485 1502
486static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = { 1503/* smartreflex_core */
487 .name = "wd_timer", 1504static struct omap_hwmod omap44xx_smartreflex_core_hwmod;
488 .sysc = &omap44xx_wd_timer_sysc, 1505static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = {
1506 { .irq = 19 + OMAP44XX_IRQ_GIC_START },
489}; 1507};
490 1508
491/* wd_timer2 */ 1509static struct omap_hwmod_addr_space omap44xx_smartreflex_core_addrs[] = {
492static struct omap_hwmod omap44xx_wd_timer2_hwmod; 1510 {
493static struct omap_hwmod_irq_info omap44xx_wd_timer2_irqs[] = { 1511 .pa_start = 0x4a0dd000,
494 { .irq = 80 + OMAP44XX_IRQ_GIC_START }, 1512 .pa_end = 0x4a0dd03f,
1513 .flags = ADDR_TYPE_RT
1514 },
495}; 1515};
496 1516
497static struct omap_hwmod_addr_space omap44xx_wd_timer2_addrs[] = { 1517/* l4_cfg -> smartreflex_core */
1518static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_core = {
1519 .master = &omap44xx_l4_cfg_hwmod,
1520 .slave = &omap44xx_smartreflex_core_hwmod,
1521 .clk = "l4_div_ck",
1522 .addr = omap44xx_smartreflex_core_addrs,
1523 .addr_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_addrs),
1524 .user = OCP_USER_MPU | OCP_USER_SDMA,
1525};
1526
1527/* smartreflex_core slave ports */
1528static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = {
1529 &omap44xx_l4_cfg__smartreflex_core,
1530};
1531
1532static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
1533 .name = "smartreflex_core",
1534 .class = &omap44xx_smartreflex_hwmod_class,
1535 .mpu_irqs = omap44xx_smartreflex_core_irqs,
1536 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_irqs),
1537 .main_clk = "smartreflex_core_fck",
1538 .vdd_name = "core",
1539 .prcm = {
1540 .omap4 = {
1541 .clkctrl_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
1542 },
1543 },
1544 .slaves = omap44xx_smartreflex_core_slaves,
1545 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
1546 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1547};
1548
1549/* smartreflex_iva */
1550static struct omap_hwmod omap44xx_smartreflex_iva_hwmod;
1551static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = {
1552 { .irq = 102 + OMAP44XX_IRQ_GIC_START },
1553};
1554
1555static struct omap_hwmod_addr_space omap44xx_smartreflex_iva_addrs[] = {
498 { 1556 {
499 .pa_start = 0x4a314000, 1557 .pa_start = 0x4a0db000,
500 .pa_end = 0x4a31407f, 1558 .pa_end = 0x4a0db03f,
501 .flags = ADDR_TYPE_RT 1559 .flags = ADDR_TYPE_RT
502 }, 1560 },
503}; 1561};
504 1562
1563/* l4_cfg -> smartreflex_iva */
1564static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_iva = {
1565 .master = &omap44xx_l4_cfg_hwmod,
1566 .slave = &omap44xx_smartreflex_iva_hwmod,
1567 .clk = "l4_div_ck",
1568 .addr = omap44xx_smartreflex_iva_addrs,
1569 .addr_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_addrs),
1570 .user = OCP_USER_MPU | OCP_USER_SDMA,
1571};
1572
1573/* smartreflex_iva slave ports */
1574static struct omap_hwmod_ocp_if *omap44xx_smartreflex_iva_slaves[] = {
1575 &omap44xx_l4_cfg__smartreflex_iva,
1576};
1577
1578static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
1579 .name = "smartreflex_iva",
1580 .class = &omap44xx_smartreflex_hwmod_class,
1581 .mpu_irqs = omap44xx_smartreflex_iva_irqs,
1582 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_irqs),
1583 .main_clk = "smartreflex_iva_fck",
1584 .vdd_name = "iva",
1585 .prcm = {
1586 .omap4 = {
1587 .clkctrl_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
1588 },
1589 },
1590 .slaves = omap44xx_smartreflex_iva_slaves,
1591 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
1592 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1593};
1594
1595/* smartreflex_mpu */
1596static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod;
1597static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = {
1598 { .irq = 18 + OMAP44XX_IRQ_GIC_START },
1599};
1600
1601static struct omap_hwmod_addr_space omap44xx_smartreflex_mpu_addrs[] = {
1602 {
1603 .pa_start = 0x4a0d9000,
1604 .pa_end = 0x4a0d903f,
1605 .flags = ADDR_TYPE_RT
1606 },
1607};
1608
1609/* l4_cfg -> smartreflex_mpu */
1610static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_mpu = {
1611 .master = &omap44xx_l4_cfg_hwmod,
1612 .slave = &omap44xx_smartreflex_mpu_hwmod,
1613 .clk = "l4_div_ck",
1614 .addr = omap44xx_smartreflex_mpu_addrs,
1615 .addr_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_addrs),
1616 .user = OCP_USER_MPU | OCP_USER_SDMA,
1617};
1618
1619/* smartreflex_mpu slave ports */
1620static struct omap_hwmod_ocp_if *omap44xx_smartreflex_mpu_slaves[] = {
1621 &omap44xx_l4_cfg__smartreflex_mpu,
1622};
1623
1624static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
1625 .name = "smartreflex_mpu",
1626 .class = &omap44xx_smartreflex_hwmod_class,
1627 .mpu_irqs = omap44xx_smartreflex_mpu_irqs,
1628 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_irqs),
1629 .main_clk = "smartreflex_mpu_fck",
1630 .vdd_name = "mpu",
1631 .prcm = {
1632 .omap4 = {
1633 .clkctrl_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
1634 },
1635 },
1636 .slaves = omap44xx_smartreflex_mpu_slaves,
1637 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
1638 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1639};
1640
1641/*
1642 * 'uart' class
1643 * universal asynchronous receiver/transmitter (uart)
1644 */
1645
1646static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = {
1647 .rev_offs = 0x0050,
1648 .sysc_offs = 0x0054,
1649 .syss_offs = 0x0058,
1650 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
1651 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1652 SYSS_HAS_RESET_STATUS),
1653 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1654 SIDLE_SMART_WKUP),
1655 .sysc_fields = &omap_hwmod_sysc_type1,
1656};
1657
505static struct omap_hwmod_class omap44xx_uart_hwmod_class = { 1658static struct omap_hwmod_class omap44xx_uart_hwmod_class = {
506 .name = "uart", 1659 .name = "uart",
507 .sysc = &omap44xx_uart_sysc, 1660 .sysc = &omap44xx_uart_sysc,
508}; 1661};
509 1662
510/* uart1 */ 1663/* uart1 */
@@ -578,51 +1731,6 @@ static struct omap_hwmod_addr_space omap44xx_uart2_addrs[] = {
578 }, 1731 },
579}; 1732};
580 1733
581/* l4_wkup -> wd_timer2 */
582static struct omap_hwmod_ocp_if omap44xx_l4_wkup__wd_timer2 = {
583 .master = &omap44xx_l4_wkup_hwmod,
584 .slave = &omap44xx_wd_timer2_hwmod,
585 .clk = "l4_wkup_clk_mux_ck",
586 .addr = omap44xx_wd_timer2_addrs,
587 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer2_addrs),
588 .user = OCP_USER_MPU | OCP_USER_SDMA,
589};
590
591/* wd_timer2 slave ports */
592static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = {
593 &omap44xx_l4_wkup__wd_timer2,
594};
595
596static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
597 .name = "wd_timer2",
598 .class = &omap44xx_wd_timer_hwmod_class,
599 .mpu_irqs = omap44xx_wd_timer2_irqs,
600 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer2_irqs),
601 .main_clk = "wd_timer2_fck",
602 .prcm = {
603 .omap4 = {
604 .clkctrl_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL,
605 },
606 },
607 .slaves = omap44xx_wd_timer2_slaves,
608 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves),
609 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
610};
611
612/* wd_timer3 */
613static struct omap_hwmod omap44xx_wd_timer3_hwmod;
614static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = {
615 { .irq = 36 + OMAP44XX_IRQ_GIC_START },
616};
617
618static struct omap_hwmod_addr_space omap44xx_wd_timer3_addrs[] = {
619 {
620 .pa_start = 0x40130000,
621 .pa_end = 0x4013007f,
622 .flags = ADDR_TYPE_RT
623 },
624};
625
626/* l4_per -> uart2 */ 1734/* l4_per -> uart2 */
627static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = { 1735static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = {
628 .master = &omap44xx_l4_per_hwmod, 1736 .master = &omap44xx_l4_per_hwmod,
@@ -675,25 +1783,6 @@ static struct omap_hwmod_addr_space omap44xx_uart3_addrs[] = {
675 }, 1783 },
676}; 1784};
677 1785
678/* l4_abe -> wd_timer3 */
679static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = {
680 .master = &omap44xx_l4_abe_hwmod,
681 .slave = &omap44xx_wd_timer3_hwmod,
682 .clk = "ocp_abe_iclk",
683 .addr = omap44xx_wd_timer3_addrs,
684 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_addrs),
685 .user = OCP_USER_MPU,
686};
687
688/* l4_abe -> wd_timer3 (dma) */
689static struct omap_hwmod_addr_space omap44xx_wd_timer3_dma_addrs[] = {
690 {
691 .pa_start = 0x49030000,
692 .pa_end = 0x4903007f,
693 .flags = ADDR_TYPE_RT
694 },
695};
696
697/* l4_per -> uart3 */ 1786/* l4_per -> uart3 */
698static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = { 1787static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = {
699 .master = &omap44xx_l4_per_hwmod, 1788 .master = &omap44xx_l4_per_hwmod,
@@ -747,37 +1836,6 @@ static struct omap_hwmod_addr_space omap44xx_uart4_addrs[] = {
747 }, 1836 },
748}; 1837};
749 1838
750static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = {
751 .master = &omap44xx_l4_abe_hwmod,
752 .slave = &omap44xx_wd_timer3_hwmod,
753 .clk = "ocp_abe_iclk",
754 .addr = omap44xx_wd_timer3_dma_addrs,
755 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_dma_addrs),
756 .user = OCP_USER_SDMA,
757};
758
759/* wd_timer3 slave ports */
760static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = {
761 &omap44xx_l4_abe__wd_timer3,
762 &omap44xx_l4_abe__wd_timer3_dma,
763};
764
765static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
766 .name = "wd_timer3",
767 .class = &omap44xx_wd_timer_hwmod_class,
768 .mpu_irqs = omap44xx_wd_timer3_irqs,
769 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer3_irqs),
770 .main_clk = "wd_timer3_fck",
771 .prcm = {
772 .omap4 = {
773 .clkctrl_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL,
774 },
775 },
776 .slaves = omap44xx_wd_timer3_slaves,
777 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves),
778 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
779};
780
781/* l4_per -> uart4 */ 1839/* l4_per -> uart4 */
782static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = { 1840static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = {
783 .master = &omap44xx_l4_per_hwmod, 1841 .master = &omap44xx_l4_per_hwmod,
@@ -811,35 +1869,205 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
811 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 1869 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
812}; 1870};
813 1871
1872/*
1873 * 'wd_timer' class
1874 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
1875 * overflow condition
1876 */
1877
1878static struct omap_hwmod_class_sysconfig omap44xx_wd_timer_sysc = {
1879 .rev_offs = 0x0000,
1880 .sysc_offs = 0x0010,
1881 .syss_offs = 0x0014,
1882 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SIDLEMODE |
1883 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1884 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1885 SIDLE_SMART_WKUP),
1886 .sysc_fields = &omap_hwmod_sysc_type1,
1887};
1888
1889static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = {
1890 .name = "wd_timer",
1891 .sysc = &omap44xx_wd_timer_sysc,
1892 .pre_shutdown = &omap2_wd_timer_disable,
1893};
1894
1895/* wd_timer2 */
1896static struct omap_hwmod omap44xx_wd_timer2_hwmod;
1897static struct omap_hwmod_irq_info omap44xx_wd_timer2_irqs[] = {
1898 { .irq = 80 + OMAP44XX_IRQ_GIC_START },
1899};
1900
1901static struct omap_hwmod_addr_space omap44xx_wd_timer2_addrs[] = {
1902 {
1903 .pa_start = 0x4a314000,
1904 .pa_end = 0x4a31407f,
1905 .flags = ADDR_TYPE_RT
1906 },
1907};
1908
1909/* l4_wkup -> wd_timer2 */
1910static struct omap_hwmod_ocp_if omap44xx_l4_wkup__wd_timer2 = {
1911 .master = &omap44xx_l4_wkup_hwmod,
1912 .slave = &omap44xx_wd_timer2_hwmod,
1913 .clk = "l4_wkup_clk_mux_ck",
1914 .addr = omap44xx_wd_timer2_addrs,
1915 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer2_addrs),
1916 .user = OCP_USER_MPU | OCP_USER_SDMA,
1917};
1918
1919/* wd_timer2 slave ports */
1920static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = {
1921 &omap44xx_l4_wkup__wd_timer2,
1922};
1923
1924static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
1925 .name = "wd_timer2",
1926 .class = &omap44xx_wd_timer_hwmod_class,
1927 .mpu_irqs = omap44xx_wd_timer2_irqs,
1928 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer2_irqs),
1929 .main_clk = "wd_timer2_fck",
1930 .prcm = {
1931 .omap4 = {
1932 .clkctrl_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL,
1933 },
1934 },
1935 .slaves = omap44xx_wd_timer2_slaves,
1936 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves),
1937 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1938};
1939
1940/* wd_timer3 */
1941static struct omap_hwmod omap44xx_wd_timer3_hwmod;
1942static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = {
1943 { .irq = 36 + OMAP44XX_IRQ_GIC_START },
1944};
1945
1946static struct omap_hwmod_addr_space omap44xx_wd_timer3_addrs[] = {
1947 {
1948 .pa_start = 0x40130000,
1949 .pa_end = 0x4013007f,
1950 .flags = ADDR_TYPE_RT
1951 },
1952};
1953
1954/* l4_abe -> wd_timer3 */
1955static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = {
1956 .master = &omap44xx_l4_abe_hwmod,
1957 .slave = &omap44xx_wd_timer3_hwmod,
1958 .clk = "ocp_abe_iclk",
1959 .addr = omap44xx_wd_timer3_addrs,
1960 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_addrs),
1961 .user = OCP_USER_MPU,
1962};
1963
1964static struct omap_hwmod_addr_space omap44xx_wd_timer3_dma_addrs[] = {
1965 {
1966 .pa_start = 0x49030000,
1967 .pa_end = 0x4903007f,
1968 .flags = ADDR_TYPE_RT
1969 },
1970};
1971
1972/* l4_abe -> wd_timer3 (dma) */
1973static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = {
1974 .master = &omap44xx_l4_abe_hwmod,
1975 .slave = &omap44xx_wd_timer3_hwmod,
1976 .clk = "ocp_abe_iclk",
1977 .addr = omap44xx_wd_timer3_dma_addrs,
1978 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_dma_addrs),
1979 .user = OCP_USER_SDMA,
1980};
1981
1982/* wd_timer3 slave ports */
1983static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = {
1984 &omap44xx_l4_abe__wd_timer3,
1985 &omap44xx_l4_abe__wd_timer3_dma,
1986};
1987
1988static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
1989 .name = "wd_timer3",
1990 .class = &omap44xx_wd_timer_hwmod_class,
1991 .mpu_irqs = omap44xx_wd_timer3_irqs,
1992 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer3_irqs),
1993 .main_clk = "wd_timer3_fck",
1994 .prcm = {
1995 .omap4 = {
1996 .clkctrl_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL,
1997 },
1998 },
1999 .slaves = omap44xx_wd_timer3_slaves,
2000 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves),
2001 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2002};
2003
814static __initdata struct omap_hwmod *omap44xx_hwmods[] = { 2004static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2005
815 /* dmm class */ 2006 /* dmm class */
816 &omap44xx_dmm_hwmod, 2007 &omap44xx_dmm_hwmod,
2008
817 /* emif_fw class */ 2009 /* emif_fw class */
818 &omap44xx_emif_fw_hwmod, 2010 &omap44xx_emif_fw_hwmod,
2011
819 /* l3 class */ 2012 /* l3 class */
820 &omap44xx_l3_instr_hwmod, 2013 &omap44xx_l3_instr_hwmod,
821 &omap44xx_l3_main_1_hwmod, 2014 &omap44xx_l3_main_1_hwmod,
822 &omap44xx_l3_main_2_hwmod, 2015 &omap44xx_l3_main_2_hwmod,
823 &omap44xx_l3_main_3_hwmod, 2016 &omap44xx_l3_main_3_hwmod,
2017
824 /* l4 class */ 2018 /* l4 class */
825 &omap44xx_l4_abe_hwmod, 2019 &omap44xx_l4_abe_hwmod,
826 &omap44xx_l4_cfg_hwmod, 2020 &omap44xx_l4_cfg_hwmod,
827 &omap44xx_l4_per_hwmod, 2021 &omap44xx_l4_per_hwmod,
828 &omap44xx_l4_wkup_hwmod, 2022 &omap44xx_l4_wkup_hwmod,
2023
829 /* mpu_bus class */ 2024 /* mpu_bus class */
830 &omap44xx_mpu_private_hwmod, 2025 &omap44xx_mpu_private_hwmod,
831 2026
2027 /* dma class */
2028 &omap44xx_dma_system_hwmod,
2029
2030 /* dsp class */
2031 &omap44xx_dsp_hwmod,
2032 &omap44xx_dsp_c0_hwmod,
2033
2034 /* gpio class */
2035 &omap44xx_gpio1_hwmod,
2036 &omap44xx_gpio2_hwmod,
2037 &omap44xx_gpio3_hwmod,
2038 &omap44xx_gpio4_hwmod,
2039 &omap44xx_gpio5_hwmod,
2040 &omap44xx_gpio6_hwmod,
2041
2042 /* i2c class */
2043 &omap44xx_i2c1_hwmod,
2044 &omap44xx_i2c2_hwmod,
2045 &omap44xx_i2c3_hwmod,
2046 &omap44xx_i2c4_hwmod,
2047
2048 /* iva class */
2049 &omap44xx_iva_hwmod,
2050 &omap44xx_iva_seq0_hwmod,
2051 &omap44xx_iva_seq1_hwmod,
2052
832 /* mpu class */ 2053 /* mpu class */
833 &omap44xx_mpu_hwmod, 2054 &omap44xx_mpu_hwmod,
834 /* wd_timer class */ 2055
835 &omap44xx_wd_timer2_hwmod, 2056 /* smartreflex class */
836 &omap44xx_wd_timer3_hwmod, 2057 &omap44xx_smartreflex_core_hwmod,
2058 &omap44xx_smartreflex_iva_hwmod,
2059 &omap44xx_smartreflex_mpu_hwmod,
837 2060
838 /* uart class */ 2061 /* uart class */
839 &omap44xx_uart1_hwmod, 2062 &omap44xx_uart1_hwmod,
840 &omap44xx_uart2_hwmod, 2063 &omap44xx_uart2_hwmod,
841 &omap44xx_uart3_hwmod, 2064 &omap44xx_uart3_hwmod,
842 &omap44xx_uart4_hwmod, 2065 &omap44xx_uart4_hwmod,
2066
2067 /* wd_timer class */
2068 &omap44xx_wd_timer2_hwmod,
2069 &omap44xx_wd_timer3_hwmod,
2070
843 NULL, 2071 NULL,
844}; 2072};
845 2073
diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
new file mode 100644
index 000000000000..46ac27dd6c84
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -0,0 +1,72 @@
1/*
2 * OMAP SoC specific OPP Data helpers
3 *
4 * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Nishanth Menon
6 * Kevin Hilman
7 * Copyright (C) 2010 Nokia Corporation.
8 * Eduardo Valentin
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 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
15 * kind, whether express or implied; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
20#define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
21
22#include <plat/omap_hwmod.h>
23
24/*
25 * *BIG FAT WARNING*:
26 * USE the following ONLY in opp data initialization common to an SoC.
27 * DO NOT USE these in board files/pm core etc.
28 */
29
30/**
31 * struct omap_opp_def - OMAP OPP Definition
32 * @hwmod_name: Name of the hwmod for this domain
33 * @freq: Frequency in hertz corresponding to this OPP
34 * @u_volt: Nominal voltage in microvolts corresponding to this OPP
35 * @default_available: True/false - is this OPP available by default
36 *
37 * OMAP SOCs have a standard set of tuples consisting of frequency and voltage
38 * pairs that the device will support per voltage domain. This is called
39 * Operating Points or OPP. The actual definitions of OMAP Operating Points
40 * varies over silicon within the same family of devices. For a specific
41 * domain, you can have a set of {frequency, voltage} pairs and this is denoted
42 * by an array of omap_opp_def. As the kernel boots and more information is
43 * available, a set of these are activated based on the precise nature of
44 * device the kernel boots up on. It is interesting to remember that each IP
45 * which belongs to a voltage domain may define their own set of OPPs on top
46 * of this - but this is handled by the appropriate driver.
47 */
48struct omap_opp_def {
49 char *hwmod_name;
50
51 unsigned long freq;
52 unsigned long u_volt;
53
54 bool default_available;
55};
56
57/*
58 * Initialization wrapper used to define an OPP for OMAP variants.
59 */
60#define OPP_INITIALIZER(_hwmod_name, _enabled, _freq, _uv) \
61{ \
62 .hwmod_name = _hwmod_name, \
63 .default_available = _enabled, \
64 .freq = _freq, \
65 .u_volt = _uv, \
66}
67
68/* Use this to initialize the default table */
69extern int __init omap_init_opp_table(struct omap_opp_def *opp_def,
70 u32 opp_def_size);
71
72#endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
new file mode 100644
index 000000000000..15f8c6c1bb0f
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -0,0 +1,277 @@
1/**
2 * OMAP and TWL PMIC specific intializations.
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated.
5 * Thara Gopinath
6 * Copyright (C) 2009 Texas Instruments Incorporated.
7 * Nishanth Menon
8 * Copyright (C) 2009 Nokia Corporation
9 * Paul Walmsley
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/err.h>
17#include <linux/io.h>
18#include <linux/kernel.h>
19#include <linux/i2c/twl.h>
20
21#include <plat/voltage.h>
22
23#define OMAP3_SRI2C_SLAVE_ADDR 0x12
24#define OMAP3_VDD_MPU_SR_CONTROL_REG 0x00
25#define OMAP3_VDD_CORE_SR_CONTROL_REG 0x01
26#define OMAP3_VP_CONFIG_ERROROFFSET 0x00
27#define OMAP3_VP_VSTEPMIN_VSTEPMIN 0x1
28#define OMAP3_VP_VSTEPMAX_VSTEPMAX 0x04
29#define OMAP3_VP_VLIMITTO_TIMEOUT_US 200
30
31#define OMAP3430_VP1_VLIMITTO_VDDMIN 0x14
32#define OMAP3430_VP1_VLIMITTO_VDDMAX 0x42
33#define OMAP3430_VP2_VLIMITTO_VDDMIN 0x18
34#define OMAP3430_VP2_VLIMITTO_VDDMAX 0x2c
35
36#define OMAP3630_VP1_VLIMITTO_VDDMIN 0x18
37#define OMAP3630_VP1_VLIMITTO_VDDMAX 0x3c
38#define OMAP3630_VP2_VLIMITTO_VDDMIN 0x18
39#define OMAP3630_VP2_VLIMITTO_VDDMAX 0x30
40
41#define OMAP4_SRI2C_SLAVE_ADDR 0x12
42#define OMAP4_VDD_MPU_SR_VOLT_REG 0x55
43#define OMAP4_VDD_IVA_SR_VOLT_REG 0x5B
44#define OMAP4_VDD_CORE_SR_VOLT_REG 0x61
45
46#define OMAP4_VP_CONFIG_ERROROFFSET 0x00
47#define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01
48#define OMAP4_VP_VSTEPMAX_VSTEPMAX 0x04
49#define OMAP4_VP_VLIMITTO_TIMEOUT_US 200
50
51#define OMAP4_VP_MPU_VLIMITTO_VDDMIN 0xA
52#define OMAP4_VP_MPU_VLIMITTO_VDDMAX 0x39
53#define OMAP4_VP_IVA_VLIMITTO_VDDMIN 0xA
54#define OMAP4_VP_IVA_VLIMITTO_VDDMAX 0x2D
55#define OMAP4_VP_CORE_VLIMITTO_VDDMIN 0xA
56#define OMAP4_VP_CORE_VLIMITTO_VDDMAX 0x28
57
58static bool is_offset_valid;
59static u8 smps_offset;
60
61#define REG_SMPS_OFFSET 0xE0
62
63unsigned long twl4030_vsel_to_uv(const u8 vsel)
64{
65 return (((vsel * 125) + 6000)) * 100;
66}
67
68u8 twl4030_uv_to_vsel(unsigned long uv)
69{
70 return DIV_ROUND_UP(uv - 600000, 12500);
71}
72
73unsigned long twl6030_vsel_to_uv(const u8 vsel)
74{
75 /*
76 * In TWL6030 depending on the value of SMPS_OFFSET
77 * efuse register the voltage range supported in
78 * standard mode can be either between 0.6V - 1.3V or
79 * 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse
80 * is programmed to all 0's where as starting from
81 * TWL6030 ES1.1 the efuse is programmed to 1
82 */
83 if (!is_offset_valid) {
84 twl_i2c_read_u8(TWL6030_MODULE_ID0, &smps_offset,
85 REG_SMPS_OFFSET);
86 is_offset_valid = true;
87 }
88
89 /*
90 * There is no specific formula for voltage to vsel
91 * conversion above 1.3V. There are special hardcoded
92 * values for voltages above 1.3V. Currently we are
93 * hardcoding only for 1.35 V which is used for 1GH OPP for
94 * OMAP4430.
95 */
96 if (vsel == 0x3A)
97 return 1350000;
98
99 if (smps_offset & 0x8)
100 return ((((vsel - 1) * 125) + 7000)) * 100;
101 else
102 return ((((vsel - 1) * 125) + 6000)) * 100;
103}
104
105u8 twl6030_uv_to_vsel(unsigned long uv)
106{
107 /*
108 * In TWL6030 depending on the value of SMPS_OFFSET
109 * efuse register the voltage range supported in
110 * standard mode can be either between 0.6V - 1.3V or
111 * 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse
112 * is programmed to all 0's where as starting from
113 * TWL6030 ES1.1 the efuse is programmed to 1
114 */
115 if (!is_offset_valid) {
116 twl_i2c_read_u8(TWL6030_MODULE_ID0, &smps_offset,
117 REG_SMPS_OFFSET);
118 is_offset_valid = true;
119 }
120
121 /*
122 * There is no specific formula for voltage to vsel
123 * conversion above 1.3V. There are special hardcoded
124 * values for voltages above 1.3V. Currently we are
125 * hardcoding only for 1.35 V which is used for 1GH OPP for
126 * OMAP4430.
127 */
128 if (uv == 1350000)
129 return 0x3A;
130
131 if (smps_offset & 0x8)
132 return DIV_ROUND_UP(uv - 700000, 12500) + 1;
133 else
134 return DIV_ROUND_UP(uv - 600000, 12500) + 1;
135}
136
137static struct omap_volt_pmic_info omap3_mpu_volt_info = {
138 .slew_rate = 4000,
139 .step_size = 12500,
140 .on_volt = 1200000,
141 .onlp_volt = 1000000,
142 .ret_volt = 975000,
143 .off_volt = 600000,
144 .volt_setup_time = 0xfff,
145 .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET,
146 .vp_vstepmin = OMAP3_VP_VSTEPMIN_VSTEPMIN,
147 .vp_vstepmax = OMAP3_VP_VSTEPMAX_VSTEPMAX,
148 .vp_vddmin = OMAP3430_VP1_VLIMITTO_VDDMIN,
149 .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX,
150 .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
151 .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
152 .pmic_reg = OMAP3_VDD_MPU_SR_CONTROL_REG,
153 .vsel_to_uv = twl4030_vsel_to_uv,
154 .uv_to_vsel = twl4030_uv_to_vsel,
155};
156
157static struct omap_volt_pmic_info omap3_core_volt_info = {
158 .slew_rate = 4000,
159 .step_size = 12500,
160 .on_volt = 1200000,
161 .onlp_volt = 1000000,
162 .ret_volt = 975000,
163 .off_volt = 600000,
164 .volt_setup_time = 0xfff,
165 .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET,
166 .vp_vstepmin = OMAP3_VP_VSTEPMIN_VSTEPMIN,
167 .vp_vstepmax = OMAP3_VP_VSTEPMAX_VSTEPMAX,
168 .vp_vddmin = OMAP3430_VP2_VLIMITTO_VDDMIN,
169 .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX,
170 .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
171 .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
172 .pmic_reg = OMAP3_VDD_CORE_SR_CONTROL_REG,
173 .vsel_to_uv = twl4030_vsel_to_uv,
174 .uv_to_vsel = twl4030_uv_to_vsel,
175};
176
177static struct omap_volt_pmic_info omap4_mpu_volt_info = {
178 .slew_rate = 4000,
179 .step_size = 12500,
180 .on_volt = 1350000,
181 .onlp_volt = 1350000,
182 .ret_volt = 837500,
183 .off_volt = 600000,
184 .volt_setup_time = 0,
185 .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
186 .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
187 .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
188 .vp_vddmin = OMAP4_VP_MPU_VLIMITTO_VDDMIN,
189 .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX,
190 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
191 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
192 .pmic_reg = OMAP4_VDD_MPU_SR_VOLT_REG,
193 .vsel_to_uv = twl6030_vsel_to_uv,
194 .uv_to_vsel = twl6030_uv_to_vsel,
195};
196
197static struct omap_volt_pmic_info omap4_iva_volt_info = {
198 .slew_rate = 4000,
199 .step_size = 12500,
200 .on_volt = 1100000,
201 .onlp_volt = 1100000,
202 .ret_volt = 837500,
203 .off_volt = 600000,
204 .volt_setup_time = 0,
205 .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
206 .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
207 .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
208 .vp_vddmin = OMAP4_VP_IVA_VLIMITTO_VDDMIN,
209 .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX,
210 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
211 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
212 .pmic_reg = OMAP4_VDD_IVA_SR_VOLT_REG,
213 .vsel_to_uv = twl6030_vsel_to_uv,
214 .uv_to_vsel = twl6030_uv_to_vsel,
215};
216
217static struct omap_volt_pmic_info omap4_core_volt_info = {
218 .slew_rate = 4000,
219 .step_size = 12500,
220 .on_volt = 1100000,
221 .onlp_volt = 1100000,
222 .ret_volt = 837500,
223 .off_volt = 600000,
224 .volt_setup_time = 0,
225 .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
226 .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
227 .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
228 .vp_vddmin = OMAP4_VP_CORE_VLIMITTO_VDDMIN,
229 .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX,
230 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
231 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
232 .pmic_reg = OMAP4_VDD_CORE_SR_VOLT_REG,
233 .vsel_to_uv = twl6030_vsel_to_uv,
234 .uv_to_vsel = twl6030_uv_to_vsel,
235};
236
237int __init omap4_twl_init(void)
238{
239 struct voltagedomain *voltdm;
240
241 if (!cpu_is_omap44xx())
242 return -ENODEV;
243
244 voltdm = omap_voltage_domain_lookup("mpu");
245 omap_voltage_register_pmic(voltdm, &omap4_mpu_volt_info);
246
247 voltdm = omap_voltage_domain_lookup("iva");
248 omap_voltage_register_pmic(voltdm, &omap4_iva_volt_info);
249
250 voltdm = omap_voltage_domain_lookup("core");
251 omap_voltage_register_pmic(voltdm, &omap4_core_volt_info);
252
253 return 0;
254}
255
256int __init omap3_twl_init(void)
257{
258 struct voltagedomain *voltdm;
259
260 if (!cpu_is_omap34xx())
261 return -ENODEV;
262
263 if (cpu_is_omap3630()) {
264 omap3_mpu_volt_info.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN;
265 omap3_mpu_volt_info.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX;
266 omap3_core_volt_info.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN;
267 omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
268 }
269
270 voltdm = omap_voltage_domain_lookup("mpu");
271 omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info);
272
273 voltdm = omap_voltage_domain_lookup("core");
274 omap_voltage_register_pmic(voltdm, &omap3_core_volt_info);
275
276 return 0;
277}
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
new file mode 100644
index 000000000000..ab8b35b780b5
--- /dev/null
+++ b/arch/arm/mach-omap2/opp.c
@@ -0,0 +1,93 @@
1/*
2 * OMAP SoC specific OPP wrapper function
3 *
4 * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Nishanth Menon
6 * Kevin Hilman
7 * Copyright (C) 2010 Nokia Corporation.
8 * Eduardo Valentin
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 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
15 * kind, whether express or implied; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19#include <linux/module.h>
20#include <linux/opp.h>
21
22#include <plat/omap_device.h>
23
24#include "omap_opp_data.h"
25
26/* Temp variable to allow multiple calls */
27static u8 __initdata omap_table_init;
28
29/**
30 * omap_init_opp_table() - Initialize opp table as per the CPU type
31 * @opp_def: opp default list for this silicon
32 * @opp_def_size: number of opp entries for this silicon
33 *
34 * Register the initial OPP table with the OPP library based on the CPU
35 * type. This is meant to be used only by SoC specific registration.
36 */
37int __init omap_init_opp_table(struct omap_opp_def *opp_def,
38 u32 opp_def_size)
39{
40 int i, r;
41
42 if (!opp_def || !opp_def_size) {
43 pr_err("%s: invalid params!\n", __func__);
44 return -EINVAL;
45 }
46
47 /*
48 * Initialize only if not already initialized even if the previous
49 * call failed, because, no reason we'd succeed again.
50 */
51 if (omap_table_init)
52 return -EEXIST;
53 omap_table_init = 1;
54
55 /* Lets now register with OPP library */
56 for (i = 0; i < opp_def_size; i++) {
57 struct omap_hwmod *oh;
58 struct device *dev;
59
60 if (!opp_def->hwmod_name) {
61 pr_err("%s: NULL name of omap_hwmod, failing [%d].\n",
62 __func__, i);
63 return -EINVAL;
64 }
65 oh = omap_hwmod_lookup(opp_def->hwmod_name);
66 if (!oh || !oh->od) {
67 pr_warn("%s: no hwmod or odev for %s, [%d] "
68 "cannot add OPPs.\n", __func__,
69 opp_def->hwmod_name, i);
70 return -EINVAL;
71 }
72 dev = &oh->od->pdev.dev;
73
74 r = opp_add(dev, opp_def->freq, opp_def->u_volt);
75 if (r) {
76 dev_err(dev, "%s: add OPP %ld failed for %s [%d] "
77 "result=%d\n",
78 __func__, opp_def->freq,
79 opp_def->hwmod_name, i, r);
80 } else {
81 if (!opp_def->default_available)
82 r = opp_disable(dev, opp_def->freq);
83 if (r)
84 dev_err(dev, "%s: disable %ld failed for %s "
85 "[%d] result=%d\n",
86 __func__, opp_def->freq,
87 opp_def->hwmod_name, i, r);
88 }
89 opp_def++;
90 }
91
92 return 0;
93}
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
new file mode 100644
index 000000000000..0486fce8a92c
--- /dev/null
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -0,0 +1,107 @@
1/*
2 * OMAP3 OPP table definitions.
3 *
4 * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Nishanth Menon
6 * Kevin Hilman
7 * Copyright (C) 2010 Nokia Corporation.
8 * Eduardo Valentin
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 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
15 * kind, whether express or implied; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19#include <linux/module.h>
20
21#include <plat/cpu.h>
22
23#include "omap_opp_data.h"
24
25static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
26 /* MPU OPP1 */
27 OPP_INITIALIZER("mpu", true, 125000000, 975000),
28 /* MPU OPP2 */
29 OPP_INITIALIZER("mpu", true, 250000000, 1075000),
30 /* MPU OPP3 */
31 OPP_INITIALIZER("mpu", true, 500000000, 1200000),
32 /* MPU OPP4 */
33 OPP_INITIALIZER("mpu", true, 550000000, 1270000),
34 /* MPU OPP5 */
35 OPP_INITIALIZER("mpu", true, 600000000, 1350000),
36
37 /*
38 * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
39 * almost the same than the one at 83MHz thus providing very little
40 * gain for the power point of view. In term of energy it will even
41 * increase the consumption due to the very negative performance
42 * impact that frequency will do to the MPU and the whole system in
43 * general.
44 */
45 OPP_INITIALIZER("l3_main", false, 41500000, 975000),
46 /* L3 OPP2 */
47 OPP_INITIALIZER("l3_main", true, 83000000, 1050000),
48 /* L3 OPP3 */
49 OPP_INITIALIZER("l3_main", true, 166000000, 1150000),
50
51 /* DSP OPP1 */
52 OPP_INITIALIZER("iva", true, 90000000, 975000),
53 /* DSP OPP2 */
54 OPP_INITIALIZER("iva", true, 180000000, 1075000),
55 /* DSP OPP3 */
56 OPP_INITIALIZER("iva", true, 360000000, 1200000),
57 /* DSP OPP4 */
58 OPP_INITIALIZER("iva", true, 400000000, 1270000),
59 /* DSP OPP5 */
60 OPP_INITIALIZER("iva", true, 430000000, 1350000),
61};
62
63static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
64 /* MPU OPP1 - OPP50 */
65 OPP_INITIALIZER("mpu", true, 300000000, 1012500),
66 /* MPU OPP2 - OPP100 */
67 OPP_INITIALIZER("mpu", true, 600000000, 1200000),
68 /* MPU OPP3 - OPP-Turbo */
69 OPP_INITIALIZER("mpu", false, 800000000, 1325000),
70 /* MPU OPP4 - OPP-SB */
71 OPP_INITIALIZER("mpu", false, 1000000000, 1375000),
72
73 /* L3 OPP1 - OPP50 */
74 OPP_INITIALIZER("l3_main", true, 100000000, 1000000),
75 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
76 OPP_INITIALIZER("l3_main", true, 200000000, 1200000),
77
78 /* DSP OPP1 - OPP50 */
79 OPP_INITIALIZER("iva", true, 260000000, 1012500),
80 /* DSP OPP2 - OPP100 */
81 OPP_INITIALIZER("iva", true, 520000000, 1200000),
82 /* DSP OPP3 - OPP-Turbo */
83 OPP_INITIALIZER("iva", false, 660000000, 1325000),
84 /* DSP OPP4 - OPP-SB */
85 OPP_INITIALIZER("iva", false, 800000000, 1375000),
86};
87
88/**
89 * omap3_opp_init() - initialize omap3 opp table
90 */
91static int __init omap3_opp_init(void)
92{
93 int r = -ENODEV;
94
95 if (!cpu_is_omap34xx())
96 return r;
97
98 if (cpu_is_omap3630())
99 r = omap_init_opp_table(omap36xx_opp_def_list,
100 ARRAY_SIZE(omap36xx_opp_def_list));
101 else
102 r = omap_init_opp_table(omap34xx_opp_def_list,
103 ARRAY_SIZE(omap34xx_opp_def_list));
104
105 return r;
106}
107device_initcall(omap3_opp_init);
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
new file mode 100644
index 000000000000..a11fa566d8ee
--- /dev/null
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -0,0 +1,57 @@
1/*
2 * OMAP4 OPP table definitions.
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Nishanth Menon
6 * Kevin Hilman
7 * Thara Gopinath
8 * Copyright (C) 2010 Nokia Corporation.
9 * Eduardo Valentin
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
16 * kind, whether express or implied; without even the implied warranty
17 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 */
20#include <linux/module.h>
21
22#include <plat/cpu.h>
23
24#include "omap_opp_data.h"
25
26static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
27 /* MPU OPP1 - OPP50 */
28 OPP_INITIALIZER("mpu", true, 300000000, 1100000),
29 /* MPU OPP2 - OPP100 */
30 OPP_INITIALIZER("mpu", true, 600000000, 1200000),
31 /* MPU OPP3 - OPP-Turbo */
32 OPP_INITIALIZER("mpu", false, 800000000, 1260000),
33 /* MPU OPP4 - OPP-SB */
34 OPP_INITIALIZER("mpu", false, 1008000000, 1350000),
35 /* L3 OPP1 - OPP50 */
36 OPP_INITIALIZER("l3_main_1", true, 100000000, 930000),
37 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
38 OPP_INITIALIZER("l3_main_1", true, 200000000, 1100000),
39 /* TODO: add IVA, DSP, aess, fdif, gpu */
40};
41
42/**
43 * omap4_opp_init() - initialize omap4 opp table
44 */
45static int __init omap4_opp_init(void)
46{
47 int r = -ENODEV;
48
49 if (!cpu_is_omap44xx())
50 return r;
51
52 r = omap_init_opp_table(omap44xx_opp_def_list,
53 ARRAY_SIZE(omap44xx_opp_def_list));
54
55 return r;
56}
57device_initcall(omap4_opp_init);
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index a8afb610c7d8..125f56591fb5 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -29,12 +29,13 @@
29 29
30#include <plat/clock.h> 30#include <plat/clock.h>
31#include <plat/board.h> 31#include <plat/board.h>
32#include <plat/powerdomain.h> 32#include "powerdomain.h"
33#include <plat/clockdomain.h> 33#include "clockdomain.h"
34#include <plat/dmtimer.h> 34#include <plat/dmtimer.h>
35#include <plat/omap-pm.h>
35 36
36#include "prm.h" 37#include "cm2xxx_3xxx.h"
37#include "cm.h" 38#include "prm2xxx_3xxx.h"
38#include "pm.h" 39#include "pm.h"
39 40
40int omap2_pm_debug; 41int omap2_pm_debug;
@@ -45,10 +46,10 @@ u32 wakeup_timer_milliseconds;
45 46
46#define DUMP_PRM_MOD_REG(mod, reg) \ 47#define DUMP_PRM_MOD_REG(mod, reg) \
47 regs[reg_count].name = #mod "." #reg; \ 48 regs[reg_count].name = #mod "." #reg; \
48 regs[reg_count++].val = prm_read_mod_reg(mod, reg) 49 regs[reg_count++].val = omap2_prm_read_mod_reg(mod, reg)
49#define DUMP_CM_MOD_REG(mod, reg) \ 50#define DUMP_CM_MOD_REG(mod, reg) \
50 regs[reg_count].name = #mod "." #reg; \ 51 regs[reg_count].name = #mod "." #reg; \
51 regs[reg_count++].val = cm_read_mod_reg(mod, reg) 52 regs[reg_count++].val = omap2_cm_read_mod_reg(mod, reg)
52#define DUMP_PRM_REG(reg) \ 53#define DUMP_PRM_REG(reg) \
53 regs[reg_count].name = #reg; \ 54 regs[reg_count].name = #reg; \
54 regs[reg_count++].val = __raw_readl(reg) 55 regs[reg_count++].val = __raw_readl(reg)
@@ -328,10 +329,10 @@ static void pm_dbg_regset_store(u32 *ptr)
328 for (j = pm_dbg_reg_modules[i].low; 329 for (j = pm_dbg_reg_modules[i].low;
329 j <= pm_dbg_reg_modules[i].high; j += 4) { 330 j <= pm_dbg_reg_modules[i].high; j += 4) {
330 if (pm_dbg_reg_modules[i].type == MOD_CM) 331 if (pm_dbg_reg_modules[i].type == MOD_CM)
331 val = cm_read_mod_reg( 332 val = omap2_cm_read_mod_reg(
332 pm_dbg_reg_modules[i].offset, j); 333 pm_dbg_reg_modules[i].offset, j);
333 else 334 else
334 val = prm_read_mod_reg( 335 val = omap2_prm_read_mod_reg(
335 pm_dbg_reg_modules[i].offset, j); 336 pm_dbg_reg_modules[i].offset, j);
336 *(ptr++) = val; 337 *(ptr++) = val;
337 } 338 }
@@ -581,6 +582,10 @@ static int option_set(void *data, u64 val)
581 *option = val; 582 *option = val;
582 583
583 if (option == &enable_off_mode) { 584 if (option == &enable_off_mode) {
585 if (val)
586 omap_pm_enable_off_mode();
587 else
588 omap_pm_disable_off_mode();
584 if (cpu_is_omap34xx()) 589 if (cpu_is_omap34xx())
585 omap3_pm_off_mode_enable(val); 590 omap3_pm_off_mode_enable(val);
586 } 591 }
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 59ca03b0e691..d5a102c71989 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -13,13 +13,16 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/opp.h>
16 17
17#include <plat/omap-pm.h> 18#include <plat/omap-pm.h>
18#include <plat/omap_device.h> 19#include <plat/omap_device.h>
19#include <plat/common.h> 20#include <plat/common.h>
21#include <plat/voltage.h>
20 22
21#include <plat/powerdomain.h> 23#include "powerdomain.h"
22#include <plat/clockdomain.h> 24#include "clockdomain.h"
25#include "pm.h"
23 26
24static struct omap_device_pm_latency *pm_lats; 27static struct omap_device_pm_latency *pm_lats;
25 28
@@ -89,10 +92,13 @@ static void omap2_init_processor_devices(void)
89 } 92 }
90} 93}
91 94
95/* Types of sleep_switch used in omap_set_pwrdm_state */
96#define FORCEWAKEUP_SWITCH 0
97#define LOWPOWERSTATE_SWITCH 1
98
92/* 99/*
93 * This sets pwrdm state (other than mpu & core. Currently only ON & 100 * This sets pwrdm state (other than mpu & core. Currently only ON &
94 * RET are supported. Function is assuming that clkdm doesn't have 101 * RET are supported.
95 * hw_sup mode enabled.
96 */ 102 */
97int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) 103int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
98{ 104{
@@ -114,9 +120,14 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
114 return ret; 120 return ret;
115 121
116 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) { 122 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) {
117 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 123 if ((pwrdm_read_pwrst(pwrdm) > state) &&
118 sleep_switch = 1; 124 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
119 pwrdm_wait_transition(pwrdm); 125 sleep_switch = LOWPOWERSTATE_SWITCH;
126 } else {
127 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
128 pwrdm_wait_transition(pwrdm);
129 sleep_switch = FORCEWAKEUP_SWITCH;
130 }
120 } 131 }
121 132
122 ret = pwrdm_set_next_pwrst(pwrdm, state); 133 ret = pwrdm_set_next_pwrst(pwrdm, state);
@@ -126,16 +137,106 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
126 goto err; 137 goto err;
127 } 138 }
128 139
129 if (sleep_switch) { 140 switch (sleep_switch) {
130 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); 141 case FORCEWAKEUP_SWITCH:
131 pwrdm_wait_transition(pwrdm); 142 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO)
132 pwrdm_state_switch(pwrdm); 143 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
144 else
145 omap2_clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
146 break;
147 case LOWPOWERSTATE_SWITCH:
148 pwrdm_set_lowpwrstchange(pwrdm);
149 break;
150 default:
151 return ret;
133 } 152 }
134 153
154 pwrdm_wait_transition(pwrdm);
155 pwrdm_state_switch(pwrdm);
135err: 156err:
136 return ret; 157 return ret;
137} 158}
138 159
160/*
161 * This API is to be called during init to put the various voltage
162 * domains to the voltage as per the opp table. Typically we boot up
163 * at the nominal voltage. So this function finds out the rate of
164 * the clock associated with the voltage domain, finds out the correct
165 * opp entry and puts the voltage domain to the voltage specifies
166 * in the opp entry
167 */
168static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
169 struct device *dev)
170{
171 struct voltagedomain *voltdm;
172 struct clk *clk;
173 struct opp *opp;
174 unsigned long freq, bootup_volt;
175
176 if (!vdd_name || !clk_name || !dev) {
177 printk(KERN_ERR "%s: Invalid parameters!\n", __func__);
178 goto exit;
179 }
180
181 voltdm = omap_voltage_domain_lookup(vdd_name);
182 if (IS_ERR(voltdm)) {
183 printk(KERN_ERR "%s: Unable to get vdd pointer for vdd_%s\n",
184 __func__, vdd_name);
185 goto exit;
186 }
187
188 clk = clk_get(NULL, clk_name);
189 if (IS_ERR(clk)) {
190 printk(KERN_ERR "%s: unable to get clk %s\n",
191 __func__, clk_name);
192 goto exit;
193 }
194
195 freq = clk->rate;
196 clk_put(clk);
197
198 opp = opp_find_freq_ceil(dev, &freq);
199 if (IS_ERR(opp)) {
200 printk(KERN_ERR "%s: unable to find boot up OPP for vdd_%s\n",
201 __func__, vdd_name);
202 goto exit;
203 }
204
205 bootup_volt = opp_get_voltage(opp);
206 if (!bootup_volt) {
207 printk(KERN_ERR "%s: unable to find voltage corresponding"
208 "to the bootup OPP for vdd_%s\n", __func__, vdd_name);
209 goto exit;
210 }
211
212 omap_voltage_scale_vdd(voltdm, bootup_volt);
213 return 0;
214
215exit:
216 printk(KERN_ERR "%s: Unable to put vdd_%s to its init voltage\n\n",
217 __func__, vdd_name);
218 return -EINVAL;
219}
220
221static void __init omap3_init_voltages(void)
222{
223 if (!cpu_is_omap34xx())
224 return;
225
226 omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev);
227 omap2_set_init_voltage("core", "l3_ick", l3_dev);
228}
229
230static void __init omap4_init_voltages(void)
231{
232 if (!cpu_is_omap44xx())
233 return;
234
235 omap2_set_init_voltage("mpu", "dpll_mpu_ck", mpu_dev);
236 omap2_set_init_voltage("core", "l3_div_ck", l3_dev);
237 omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", iva_dev);
238}
239
139static int __init omap2_common_pm_init(void) 240static int __init omap2_common_pm_init(void)
140{ 241{
141 omap2_init_processor_devices(); 242 omap2_init_processor_devices();
@@ -143,5 +244,24 @@ static int __init omap2_common_pm_init(void)
143 244
144 return 0; 245 return 0;
145} 246}
146device_initcall(omap2_common_pm_init); 247postcore_initcall(omap2_common_pm_init);
248
249static int __init omap2_common_pm_late_init(void)
250{
251 /* Init the OMAP TWL parameters */
252 omap3_twl_init();
253 omap4_twl_init();
254
255 /* Init the voltage layer */
256 omap_voltage_late_init();
147 257
258 /* Initialize the voltages */
259 omap3_init_voltages();
260 omap4_init_voltages();
261
262 /* Smartreflex device init */
263 omap_devinit_smartreflex();
264
265 return 0;
266}
267late_initcall(omap2_common_pm_late_init);
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 0d75bfd1fdbe..1c1b0ab5b978 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -11,7 +11,9 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H 11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H
12#define __ARCH_ARM_MACH_OMAP2_PM_H 12#define __ARCH_ARM_MACH_OMAP2_PM_H
13 13
14#include <plat/powerdomain.h> 14#include <linux/err.h>
15
16#include "powerdomain.h"
15 17
16extern void *omap3_secure_ram_storage; 18extern void *omap3_secure_ram_storage;
17extern void omap3_pm_off_mode_enable(int); 19extern void omap3_pm_off_mode_enable(int);
@@ -20,6 +22,20 @@ extern int omap3_can_sleep(void);
20extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state); 22extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
21extern int omap3_idle_init(void); 23extern int omap3_idle_init(void);
22 24
25#if defined(CONFIG_PM_OPP)
26extern int omap3_opp_init(void);
27extern int omap4_opp_init(void);
28#else
29static inline int omap3_opp_init(void)
30{
31 return -EINVAL;
32}
33static inline int omap4_opp_init(void)
34{
35 return -EINVAL;
36}
37#endif
38
23struct cpuidle_params { 39struct cpuidle_params {
24 u8 valid; 40 u8 valid;
25 u32 sleep_latency; 41 u32 sleep_latency;
@@ -58,7 +74,7 @@ extern u32 sleep_while_idle;
58#endif 74#endif
59 75
60#if defined(CONFIG_CPU_IDLE) 76#if defined(CONFIG_CPU_IDLE)
61extern void omap3_cpuidle_update_states(void); 77extern void omap3_cpuidle_update_states(u32, u32);
62#endif 78#endif
63 79
64#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 80#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
@@ -80,9 +96,46 @@ extern void save_secure_ram_context(u32 *addr);
80extern void omap3_save_scratchpad_contents(void); 96extern void omap3_save_scratchpad_contents(void);
81 97
82extern unsigned int omap24xx_idle_loop_suspend_sz; 98extern unsigned int omap24xx_idle_loop_suspend_sz;
83extern unsigned int omap34xx_suspend_sz;
84extern unsigned int save_secure_ram_context_sz; 99extern unsigned int save_secure_ram_context_sz;
85extern unsigned int omap24xx_cpu_suspend_sz; 100extern unsigned int omap24xx_cpu_suspend_sz;
86extern unsigned int omap34xx_cpu_suspend_sz; 101extern unsigned int omap34xx_cpu_suspend_sz;
87 102
103#define PM_RTA_ERRATUM_i608 (1 << 0)
104#define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1)
105
106#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
107extern u16 pm34xx_errata;
108#define IS_PM34XX_ERRATUM(id) (pm34xx_errata & (id))
109extern void enable_omap3630_toggle_l2_on_restore(void);
110#else
111#define IS_PM34XX_ERRATUM(id) 0
112static inline void enable_omap3630_toggle_l2_on_restore(void) { }
113#endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */
114
115#ifdef CONFIG_OMAP_SMARTREFLEX
116extern int omap_devinit_smartreflex(void);
117extern void omap_enable_smartreflex_on_init(void);
118#else
119static inline int omap_devinit_smartreflex(void)
120{
121 return -EINVAL;
122}
123
124static inline void omap_enable_smartreflex_on_init(void) {}
125#endif
126
127#ifdef CONFIG_TWL4030_CORE
128extern int omap3_twl_init(void);
129extern int omap4_twl_init(void);
130#else
131static inline int omap3_twl_init(void)
132{
133 return -EINVAL;
134}
135static inline int omap4_twl_init(void)
136{
137 return -EINVAL;
138}
139#endif
140
88#endif 141#endif
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index aaeea49b9bdd..dac2d1d9987d 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -42,16 +42,16 @@
42#include <plat/dma.h> 42#include <plat/dma.h>
43#include <plat/board.h> 43#include <plat/board.h>
44 44
45#include "prm.h" 45#include "prm2xxx_3xxx.h"
46#include "prm-regbits-24xx.h" 46#include "prm-regbits-24xx.h"
47#include "cm.h" 47#include "cm2xxx_3xxx.h"
48#include "cm-regbits-24xx.h" 48#include "cm-regbits-24xx.h"
49#include "sdrc.h" 49#include "sdrc.h"
50#include "pm.h" 50#include "pm.h"
51#include "control.h" 51#include "control.h"
52 52
53#include <plat/powerdomain.h> 53#include "powerdomain.h"
54#include <plat/clockdomain.h> 54#include "clockdomain.h"
55 55
56#ifdef CONFIG_SUSPEND 56#ifdef CONFIG_SUSPEND
57static suspend_state_t suspend_state = PM_SUSPEND_ON; 57static suspend_state_t suspend_state = PM_SUSPEND_ON;
@@ -79,8 +79,8 @@ static int omap2_fclks_active(void)
79{ 79{
80 u32 f1, f2; 80 u32 f1, f2;
81 81
82 f1 = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 82 f1 = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
83 f2 = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2); 83 f2 = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
84 84
85 /* Ignore UART clocks. These are handled by UART core (serial.c) */ 85 /* Ignore UART clocks. These are handled by UART core (serial.c) */
86 f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK); 86 f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK);
@@ -105,9 +105,9 @@ static void omap2_enter_full_retention(void)
105 105
106 /* Clear old wake-up events */ 106 /* Clear old wake-up events */
107 /* REVISIT: These write to reserved bits? */ 107 /* REVISIT: These write to reserved bits? */
108 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1); 108 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
109 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 109 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
110 prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); 110 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
111 111
112 /* 112 /*
113 * Set MPU powerdomain's next power state to RETENTION; 113 * Set MPU powerdomain's next power state to RETENTION;
@@ -120,7 +120,7 @@ static void omap2_enter_full_retention(void)
120 l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL; 120 l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL;
121 omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0); 121 omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0);
122 122
123 omap2_gpio_prepare_for_idle(PWRDM_POWER_RET); 123 omap2_gpio_prepare_for_idle(0);
124 124
125 if (omap2_pm_debug) { 125 if (omap2_pm_debug) {
126 omap2_pm_dump(0, 0, 0); 126 omap2_pm_dump(0, 0, 0);
@@ -167,30 +167,30 @@ no_sleep:
167 clk_enable(osc_ck); 167 clk_enable(osc_ck);
168 168
169 /* clear CORE wake-up events */ 169 /* clear CORE wake-up events */
170 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1); 170 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
171 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 171 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
172 172
173 /* wakeup domain events - bit 1: GPT1, bit5 GPIO */ 173 /* wakeup domain events - bit 1: GPT1, bit5 GPIO */
174 prm_clear_mod_reg_bits(0x4 | 0x1, WKUP_MOD, PM_WKST); 174 omap2_prm_clear_mod_reg_bits(0x4 | 0x1, WKUP_MOD, PM_WKST);
175 175
176 /* MPU domain wake events */ 176 /* MPU domain wake events */
177 l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 177 l = omap2_prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
178 if (l & 0x01) 178 if (l & 0x01)
179 prm_write_mod_reg(0x01, OCP_MOD, 179 omap2_prm_write_mod_reg(0x01, OCP_MOD,
180 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 180 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
181 if (l & 0x20) 181 if (l & 0x20)
182 prm_write_mod_reg(0x20, OCP_MOD, 182 omap2_prm_write_mod_reg(0x20, OCP_MOD,
183 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 183 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
184 184
185 /* Mask future PRCM-to-MPU interrupts */ 185 /* Mask future PRCM-to-MPU interrupts */
186 prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 186 omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
187} 187}
188 188
189static int omap2_i2c_active(void) 189static int omap2_i2c_active(void)
190{ 190{
191 u32 l; 191 u32 l;
192 192
193 l = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 193 l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
194 return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK); 194 return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK);
195} 195}
196 196
@@ -201,13 +201,13 @@ static int omap2_allow_mpu_retention(void)
201 u32 l; 201 u32 l;
202 202
203 /* Check for MMC, UART2, UART1, McSPI2, McSPI1 and DSS1. */ 203 /* Check for MMC, UART2, UART1, McSPI2, McSPI1 and DSS1. */
204 l = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 204 l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
205 if (l & (OMAP2420_EN_MMC_MASK | OMAP24XX_EN_UART2_MASK | 205 if (l & (OMAP2420_EN_MMC_MASK | OMAP24XX_EN_UART2_MASK |
206 OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_MCSPI2_MASK | 206 OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_MCSPI2_MASK |
207 OMAP24XX_EN_MCSPI1_MASK | OMAP24XX_EN_DSS1_MASK)) 207 OMAP24XX_EN_MCSPI1_MASK | OMAP24XX_EN_DSS1_MASK))
208 return 0; 208 return 0;
209 /* Check for UART3. */ 209 /* Check for UART3. */
210 l = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2); 210 l = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
211 if (l & OMAP24XX_EN_UART3_MASK) 211 if (l & OMAP24XX_EN_UART3_MASK)
212 return 0; 212 return 0;
213 if (sti_console_enabled) 213 if (sti_console_enabled)
@@ -230,18 +230,18 @@ static void omap2_enter_mpu_retention(void)
230 * it is in retention mode. */ 230 * it is in retention mode. */
231 if (omap2_allow_mpu_retention()) { 231 if (omap2_allow_mpu_retention()) {
232 /* REVISIT: These write to reserved bits? */ 232 /* REVISIT: These write to reserved bits? */
233 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1); 233 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
234 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 234 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
235 prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); 235 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
236 236
237 /* Try to enter MPU retention */ 237 /* Try to enter MPU retention */
238 prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | 238 omap2_prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) |
239 OMAP_LOGICRETSTATE_MASK, 239 OMAP_LOGICRETSTATE_MASK,
240 MPU_MOD, OMAP2_PM_PWSTCTRL); 240 MPU_MOD, OMAP2_PM_PWSTCTRL);
241 } else { 241 } else {
242 /* Block MPU retention */ 242 /* Block MPU retention */
243 243
244 prm_write_mod_reg(OMAP_LOGICRETSTATE_MASK, MPU_MOD, 244 omap2_prm_write_mod_reg(OMAP_LOGICRETSTATE_MASK, MPU_MOD,
245 OMAP2_PM_PWSTCTRL); 245 OMAP2_PM_PWSTCTRL);
246 only_idle = 1; 246 only_idle = 1;
247 } 247 }
@@ -299,16 +299,11 @@ out:
299 local_irq_enable(); 299 local_irq_enable();
300} 300}
301 301
302#ifdef CONFIG_SUSPEND
302static int omap2_pm_begin(suspend_state_t state) 303static int omap2_pm_begin(suspend_state_t state)
303{ 304{
304 suspend_state = state;
305 return 0;
306}
307
308static int omap2_pm_prepare(void)
309{
310 /* We cannot sleep in idle until we have resumed */
311 disable_hlt(); 305 disable_hlt();
306 suspend_state = state;
312 return 0; 307 return 0;
313} 308}
314 309
@@ -316,9 +311,9 @@ static int omap2_pm_suspend(void)
316{ 311{
317 u32 wken_wkup, mir1; 312 u32 wken_wkup, mir1;
318 313
319 wken_wkup = prm_read_mod_reg(WKUP_MOD, PM_WKEN); 314 wken_wkup = omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN);
320 wken_wkup &= ~OMAP24XX_EN_GPT1_MASK; 315 wken_wkup &= ~OMAP24XX_EN_GPT1_MASK;
321 prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN); 316 omap2_prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN);
322 317
323 /* Mask GPT1 */ 318 /* Mask GPT1 */
324 mir1 = omap_readl(0x480fe0a4); 319 mir1 = omap_readl(0x480fe0a4);
@@ -328,7 +323,7 @@ static int omap2_pm_suspend(void)
328 omap2_enter_full_retention(); 323 omap2_enter_full_retention();
329 324
330 omap_writel(mir1, 0x480fe0a4); 325 omap_writel(mir1, 0x480fe0a4);
331 prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN); 326 omap2_prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN);
332 327
333 return 0; 328 return 0;
334} 329}
@@ -349,24 +344,21 @@ static int omap2_pm_enter(suspend_state_t state)
349 return ret; 344 return ret;
350} 345}
351 346
352static void omap2_pm_finish(void)
353{
354 enable_hlt();
355}
356
357static void omap2_pm_end(void) 347static void omap2_pm_end(void)
358{ 348{
359 suspend_state = PM_SUSPEND_ON; 349 suspend_state = PM_SUSPEND_ON;
350 enable_hlt();
360} 351}
361 352
362static struct platform_suspend_ops omap_pm_ops = { 353static struct platform_suspend_ops omap_pm_ops = {
363 .begin = omap2_pm_begin, 354 .begin = omap2_pm_begin,
364 .prepare = omap2_pm_prepare,
365 .enter = omap2_pm_enter, 355 .enter = omap2_pm_enter,
366 .finish = omap2_pm_finish,
367 .end = omap2_pm_end, 356 .end = omap2_pm_end,
368 .valid = suspend_valid_only_mem, 357 .valid = suspend_valid_only_mem,
369}; 358};
359#else
360static const struct platform_suspend_ops __initdata omap_pm_ops;
361#endif /* CONFIG_SUSPEND */
370 362
371/* XXX This function should be shareable between OMAP2xxx and OMAP3 */ 363/* XXX This function should be shareable between OMAP2xxx and OMAP3 */
372static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) 364static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
@@ -388,7 +380,7 @@ static void __init prcm_setup_regs(void)
388 struct powerdomain *pwrdm; 380 struct powerdomain *pwrdm;
389 381
390 /* Enable autoidle */ 382 /* Enable autoidle */
391 prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, 383 omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD,
392 OMAP2_PRCM_SYSCONFIG_OFFSET); 384 OMAP2_PRCM_SYSCONFIG_OFFSET);
393 385
394 /* 386 /*
@@ -427,87 +419,87 @@ static void __init prcm_setup_regs(void)
427 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); 419 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm);
428 420
429 /* Enable clock autoidle for all domains */ 421 /* Enable clock autoidle for all domains */
430 cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK | 422 omap2_cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK |
431 OMAP24XX_AUTO_MAILBOXES_MASK | 423 OMAP24XX_AUTO_MAILBOXES_MASK |
432 OMAP24XX_AUTO_WDT4_MASK | 424 OMAP24XX_AUTO_WDT4_MASK |
433 OMAP2420_AUTO_WDT3_MASK | 425 OMAP2420_AUTO_WDT3_MASK |
434 OMAP24XX_AUTO_MSPRO_MASK | 426 OMAP24XX_AUTO_MSPRO_MASK |
435 OMAP2420_AUTO_MMC_MASK | 427 OMAP2420_AUTO_MMC_MASK |
436 OMAP24XX_AUTO_FAC_MASK | 428 OMAP24XX_AUTO_FAC_MASK |
437 OMAP2420_AUTO_EAC_MASK | 429 OMAP2420_AUTO_EAC_MASK |
438 OMAP24XX_AUTO_HDQ_MASK | 430 OMAP24XX_AUTO_HDQ_MASK |
439 OMAP24XX_AUTO_UART2_MASK | 431 OMAP24XX_AUTO_UART2_MASK |
440 OMAP24XX_AUTO_UART1_MASK | 432 OMAP24XX_AUTO_UART1_MASK |
441 OMAP24XX_AUTO_I2C2_MASK | 433 OMAP24XX_AUTO_I2C2_MASK |
442 OMAP24XX_AUTO_I2C1_MASK | 434 OMAP24XX_AUTO_I2C1_MASK |
443 OMAP24XX_AUTO_MCSPI2_MASK | 435 OMAP24XX_AUTO_MCSPI2_MASK |
444 OMAP24XX_AUTO_MCSPI1_MASK | 436 OMAP24XX_AUTO_MCSPI1_MASK |
445 OMAP24XX_AUTO_MCBSP2_MASK | 437 OMAP24XX_AUTO_MCBSP2_MASK |
446 OMAP24XX_AUTO_MCBSP1_MASK | 438 OMAP24XX_AUTO_MCBSP1_MASK |
447 OMAP24XX_AUTO_GPT12_MASK | 439 OMAP24XX_AUTO_GPT12_MASK |
448 OMAP24XX_AUTO_GPT11_MASK | 440 OMAP24XX_AUTO_GPT11_MASK |
449 OMAP24XX_AUTO_GPT10_MASK | 441 OMAP24XX_AUTO_GPT10_MASK |
450 OMAP24XX_AUTO_GPT9_MASK | 442 OMAP24XX_AUTO_GPT9_MASK |
451 OMAP24XX_AUTO_GPT8_MASK | 443 OMAP24XX_AUTO_GPT8_MASK |
452 OMAP24XX_AUTO_GPT7_MASK | 444 OMAP24XX_AUTO_GPT7_MASK |
453 OMAP24XX_AUTO_GPT6_MASK | 445 OMAP24XX_AUTO_GPT6_MASK |
454 OMAP24XX_AUTO_GPT5_MASK | 446 OMAP24XX_AUTO_GPT5_MASK |
455 OMAP24XX_AUTO_GPT4_MASK | 447 OMAP24XX_AUTO_GPT4_MASK |
456 OMAP24XX_AUTO_GPT3_MASK | 448 OMAP24XX_AUTO_GPT3_MASK |
457 OMAP24XX_AUTO_GPT2_MASK | 449 OMAP24XX_AUTO_GPT2_MASK |
458 OMAP2420_AUTO_VLYNQ_MASK | 450 OMAP2420_AUTO_VLYNQ_MASK |
459 OMAP24XX_AUTO_DSS_MASK, 451 OMAP24XX_AUTO_DSS_MASK,
460 CORE_MOD, CM_AUTOIDLE1); 452 CORE_MOD, CM_AUTOIDLE1);
461 cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK | 453 omap2_cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK |
462 OMAP24XX_AUTO_SSI_MASK | 454 OMAP24XX_AUTO_SSI_MASK |
463 OMAP24XX_AUTO_USB_MASK, 455 OMAP24XX_AUTO_USB_MASK,
464 CORE_MOD, CM_AUTOIDLE2); 456 CORE_MOD, CM_AUTOIDLE2);
465 cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK | 457 omap2_cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK |
466 OMAP24XX_AUTO_GPMC_MASK | 458 OMAP24XX_AUTO_GPMC_MASK |
467 OMAP24XX_AUTO_SDMA_MASK, 459 OMAP24XX_AUTO_SDMA_MASK,
468 CORE_MOD, CM_AUTOIDLE3); 460 CORE_MOD, CM_AUTOIDLE3);
469 cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK | 461 omap2_cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK |
470 OMAP24XX_AUTO_AES_MASK | 462 OMAP24XX_AUTO_AES_MASK |
471 OMAP24XX_AUTO_RNG_MASK | 463 OMAP24XX_AUTO_RNG_MASK |
472 OMAP24XX_AUTO_SHA_MASK | 464 OMAP24XX_AUTO_SHA_MASK |
473 OMAP24XX_AUTO_DES_MASK, 465 OMAP24XX_AUTO_DES_MASK,
474 CORE_MOD, OMAP24XX_CM_AUTOIDLE4); 466 CORE_MOD, OMAP24XX_CM_AUTOIDLE4);
475 467
476 cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD, 468 omap2_cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD,
477 CM_AUTOIDLE); 469 CM_AUTOIDLE);
478 470
479 /* Put DPLL and both APLLs into autoidle mode */ 471 /* Put DPLL and both APLLs into autoidle mode */
480 cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) | 472 omap2_cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) |
481 (0x03 << OMAP24XX_AUTO_96M_SHIFT) | 473 (0x03 << OMAP24XX_AUTO_96M_SHIFT) |
482 (0x03 << OMAP24XX_AUTO_54M_SHIFT), 474 (0x03 << OMAP24XX_AUTO_54M_SHIFT),
483 PLL_MOD, CM_AUTOIDLE); 475 PLL_MOD, CM_AUTOIDLE);
484 476
485 cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK | 477 omap2_cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK |
486 OMAP24XX_AUTO_WDT1_MASK | 478 OMAP24XX_AUTO_WDT1_MASK |
487 OMAP24XX_AUTO_MPU_WDT_MASK | 479 OMAP24XX_AUTO_MPU_WDT_MASK |
488 OMAP24XX_AUTO_GPIOS_MASK | 480 OMAP24XX_AUTO_GPIOS_MASK |
489 OMAP24XX_AUTO_32KSYNC_MASK | 481 OMAP24XX_AUTO_32KSYNC_MASK |
490 OMAP24XX_AUTO_GPT1_MASK, 482 OMAP24XX_AUTO_GPT1_MASK,
491 WKUP_MOD, CM_AUTOIDLE); 483 WKUP_MOD, CM_AUTOIDLE);
492 484
493 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk 485 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk
494 * stabilisation */ 486 * stabilisation */
495 prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, 487 omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
496 OMAP2_PRCM_CLKSSETUP_OFFSET); 488 OMAP2_PRCM_CLKSSETUP_OFFSET);
497 489
498 /* Configure automatic voltage transition */ 490 /* Configure automatic voltage transition */
499 prm_write_mod_reg(2 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, 491 omap2_prm_write_mod_reg(2 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
500 OMAP2_PRCM_VOLTSETUP_OFFSET); 492 OMAP2_PRCM_VOLTSETUP_OFFSET);
501 prm_write_mod_reg(OMAP24XX_AUTO_EXTVOLT_MASK | 493 omap2_prm_write_mod_reg(OMAP24XX_AUTO_EXTVOLT_MASK |
502 (0x1 << OMAP24XX_SETOFF_LEVEL_SHIFT) | 494 (0x1 << OMAP24XX_SETOFF_LEVEL_SHIFT) |
503 OMAP24XX_MEMRETCTRL_MASK | 495 OMAP24XX_MEMRETCTRL_MASK |
504 (0x1 << OMAP24XX_SETRET_LEVEL_SHIFT) | 496 (0x1 << OMAP24XX_SETRET_LEVEL_SHIFT) |
505 (0x0 << OMAP24XX_VOLT_LEVEL_SHIFT), 497 (0x0 << OMAP24XX_VOLT_LEVEL_SHIFT),
506 OMAP24XX_GR_MOD, OMAP2_PRCM_VOLTCTRL_OFFSET); 498 OMAP24XX_GR_MOD, OMAP2_PRCM_VOLTCTRL_OFFSET);
507 499
508 /* Enable wake-up events */ 500 /* Enable wake-up events */
509 prm_write_mod_reg(OMAP24XX_EN_GPIOS_MASK | OMAP24XX_EN_GPT1_MASK, 501 omap2_prm_write_mod_reg(OMAP24XX_EN_GPIOS_MASK | OMAP24XX_EN_GPT1_MASK,
510 WKUP_MOD, PM_WKEN); 502 WKUP_MOD, PM_WKEN);
511} 503}
512 504
513static int __init omap2_pm_init(void) 505static int __init omap2_pm_init(void)
@@ -518,7 +510,7 @@ static int __init omap2_pm_init(void)
518 return -ENODEV; 510 return -ENODEV;
519 511
520 printk(KERN_INFO "Power Management for OMAP2 initializing\n"); 512 printk(KERN_INFO "Power Management for OMAP2 initializing\n");
521 l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET); 513 l = omap2_prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET);
522 printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); 514 printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
523 515
524 /* Look up important powerdomains */ 516 /* Look up important powerdomains */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 648b8c50d024..5b323f28da2d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -31,8 +31,8 @@
31#include <linux/console.h> 31#include <linux/console.h>
32 32
33#include <plat/sram.h> 33#include <plat/sram.h>
34#include <plat/clockdomain.h> 34#include "clockdomain.h"
35#include <plat/powerdomain.h> 35#include "powerdomain.h"
36#include <plat/serial.h> 36#include <plat/serial.h>
37#include <plat/sdrc.h> 37#include <plat/sdrc.h>
38#include <plat/prcm.h> 38#include <plat/prcm.h>
@@ -41,11 +41,11 @@
41 41
42#include <asm/tlbflush.h> 42#include <asm/tlbflush.h>
43 43
44#include "cm.h" 44#include "cm2xxx_3xxx.h"
45#include "cm-regbits-34xx.h" 45#include "cm-regbits-34xx.h"
46#include "prm-regbits-34xx.h" 46#include "prm-regbits-34xx.h"
47 47
48#include "prm.h" 48#include "prm2xxx_3xxx.h"
49#include "pm.h" 49#include "pm.h"
50#include "sdrc.h" 50#include "sdrc.h"
51#include "control.h" 51#include "control.h"
@@ -68,6 +68,9 @@ static inline bool is_suspending(void)
68#define OMAP343X_TABLE_VALUE_OFFSET 0xc0 68#define OMAP343X_TABLE_VALUE_OFFSET 0xc0
69#define OMAP343X_CONTROL_REG_VALUE_OFFSET 0xc8 69#define OMAP343X_CONTROL_REG_VALUE_OFFSET 0xc8
70 70
71/* pm34xx errata defined in pm.h */
72u16 pm34xx_errata;
73
71struct power_state { 74struct power_state {
72 struct powerdomain *pwrdm; 75 struct powerdomain *pwrdm;
73 u32 next_state; 76 u32 next_state;
@@ -102,12 +105,12 @@ static void omap3_enable_io_chain(void)
102 int timeout = 0; 105 int timeout = 0;
103 106
104 if (omap_rev() >= OMAP3430_REV_ES3_1) { 107 if (omap_rev() >= OMAP3430_REV_ES3_1) {
105 prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, 108 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
106 PM_WKEN); 109 PM_WKEN);
107 /* Do a readback to assure write has been done */ 110 /* Do a readback to assure write has been done */
108 prm_read_mod_reg(WKUP_MOD, PM_WKEN); 111 omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN);
109 112
110 while (!(prm_read_mod_reg(WKUP_MOD, PM_WKEN) & 113 while (!(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN) &
111 OMAP3430_ST_IO_CHAIN_MASK)) { 114 OMAP3430_ST_IO_CHAIN_MASK)) {
112 timeout++; 115 timeout++;
113 if (timeout > 1000) { 116 if (timeout > 1000) {
@@ -115,7 +118,7 @@ static void omap3_enable_io_chain(void)
115 "activation failed.\n"); 118 "activation failed.\n");
116 return; 119 return;
117 } 120 }
118 prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, 121 omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK,
119 WKUP_MOD, PM_WKEN); 122 WKUP_MOD, PM_WKEN);
120 } 123 }
121 } 124 }
@@ -124,26 +127,17 @@ static void omap3_enable_io_chain(void)
124static void omap3_disable_io_chain(void) 127static void omap3_disable_io_chain(void)
125{ 128{
126 if (omap_rev() >= OMAP3430_REV_ES3_1) 129 if (omap_rev() >= OMAP3430_REV_ES3_1)
127 prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, 130 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
128 PM_WKEN); 131 PM_WKEN);
129} 132}
130 133
131static void omap3_core_save_context(void) 134static void omap3_core_save_context(void)
132{ 135{
133 u32 control_padconf_off; 136 omap3_ctrl_save_padconf();
134
135 /* Save the padconf registers */
136 control_padconf_off = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
137 control_padconf_off |= START_PADCONF_SAVE;
138 omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF);
139 /* wait for the save to complete */
140 while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
141 & PADCONF_SAVE_DONE))
142 udelay(1);
143 137
144 /* 138 /*
145 * Force write last pad into memory, as this can fail in some 139 * Force write last pad into memory, as this can fail in some
146 * cases according to erratas 1.157, 1.185 140 * cases according to errata 1.157, 1.185
147 */ 141 */
148 omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14), 142 omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
149 OMAP343X_CONTROL_MEM_WKUP + 0x2a0); 143 OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
@@ -218,27 +212,27 @@ static int prcm_clear_mod_irqs(s16 module, u8 regs)
218 OMAP3430ES2_PM_MPUGRPSEL3 : OMAP3430_PM_MPUGRPSEL; 212 OMAP3430ES2_PM_MPUGRPSEL3 : OMAP3430_PM_MPUGRPSEL;
219 int c = 0; 213 int c = 0;
220 214
221 wkst = prm_read_mod_reg(module, wkst_off); 215 wkst = omap2_prm_read_mod_reg(module, wkst_off);
222 wkst &= prm_read_mod_reg(module, grpsel_off); 216 wkst &= omap2_prm_read_mod_reg(module, grpsel_off);
223 if (wkst) { 217 if (wkst) {
224 iclk = cm_read_mod_reg(module, iclk_off); 218 iclk = omap2_cm_read_mod_reg(module, iclk_off);
225 fclk = cm_read_mod_reg(module, fclk_off); 219 fclk = omap2_cm_read_mod_reg(module, fclk_off);
226 while (wkst) { 220 while (wkst) {
227 clken = wkst; 221 clken = wkst;
228 cm_set_mod_reg_bits(clken, module, iclk_off); 222 omap2_cm_set_mod_reg_bits(clken, module, iclk_off);
229 /* 223 /*
230 * For USBHOST, we don't know whether HOST1 or 224 * For USBHOST, we don't know whether HOST1 or
231 * HOST2 woke us up, so enable both f-clocks 225 * HOST2 woke us up, so enable both f-clocks
232 */ 226 */
233 if (module == OMAP3430ES2_USBHOST_MOD) 227 if (module == OMAP3430ES2_USBHOST_MOD)
234 clken |= 1 << OMAP3430ES2_EN_USBHOST2_SHIFT; 228 clken |= 1 << OMAP3430ES2_EN_USBHOST2_SHIFT;
235 cm_set_mod_reg_bits(clken, module, fclk_off); 229 omap2_cm_set_mod_reg_bits(clken, module, fclk_off);
236 prm_write_mod_reg(wkst, module, wkst_off); 230 omap2_prm_write_mod_reg(wkst, module, wkst_off);
237 wkst = prm_read_mod_reg(module, wkst_off); 231 wkst = omap2_prm_read_mod_reg(module, wkst_off);
238 c++; 232 c++;
239 } 233 }
240 cm_write_mod_reg(iclk, module, iclk_off); 234 omap2_cm_write_mod_reg(iclk, module, iclk_off);
241 cm_write_mod_reg(fclk, module, fclk_off); 235 omap2_cm_write_mod_reg(fclk, module, fclk_off);
242 } 236 }
243 237
244 return c; 238 return c;
@@ -281,9 +275,9 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
281 u32 irqenable_mpu, irqstatus_mpu; 275 u32 irqenable_mpu, irqstatus_mpu;
282 int c = 0; 276 int c = 0;
283 277
284 irqenable_mpu = prm_read_mod_reg(OCP_MOD, 278 irqenable_mpu = omap2_prm_read_mod_reg(OCP_MOD,
285 OMAP3_PRM_IRQENABLE_MPU_OFFSET); 279 OMAP3_PRM_IRQENABLE_MPU_OFFSET);
286 irqstatus_mpu = prm_read_mod_reg(OCP_MOD, 280 irqstatus_mpu = omap2_prm_read_mod_reg(OCP_MOD,
287 OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 281 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
288 irqstatus_mpu &= irqenable_mpu; 282 irqstatus_mpu &= irqenable_mpu;
289 283
@@ -304,10 +298,10 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
304 "no code to handle it (%08x)\n", irqstatus_mpu); 298 "no code to handle it (%08x)\n", irqstatus_mpu);
305 } 299 }
306 300
307 prm_write_mod_reg(irqstatus_mpu, OCP_MOD, 301 omap2_prm_write_mod_reg(irqstatus_mpu, OCP_MOD,
308 OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 302 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
309 303
310 irqstatus_mpu = prm_read_mod_reg(OCP_MOD, 304 irqstatus_mpu = omap2_prm_read_mod_reg(OCP_MOD,
311 OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 305 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
312 irqstatus_mpu &= irqenable_mpu; 306 irqstatus_mpu &= irqenable_mpu;
313 307
@@ -357,6 +351,7 @@ void omap_sram_idle(void)
357 int mpu_next_state = PWRDM_POWER_ON; 351 int mpu_next_state = PWRDM_POWER_ON;
358 int per_next_state = PWRDM_POWER_ON; 352 int per_next_state = PWRDM_POWER_ON;
359 int core_next_state = PWRDM_POWER_ON; 353 int core_next_state = PWRDM_POWER_ON;
354 int per_going_off;
360 int core_prev_state, per_prev_state; 355 int core_prev_state, per_prev_state;
361 u32 sdrc_pwr = 0; 356 u32 sdrc_pwr = 0;
362 357
@@ -395,7 +390,7 @@ void omap_sram_idle(void)
395 if (omap3_has_io_wakeup() && 390 if (omap3_has_io_wakeup() &&
396 (per_next_state < PWRDM_POWER_ON || 391 (per_next_state < PWRDM_POWER_ON ||
397 core_next_state < PWRDM_POWER_ON)) { 392 core_next_state < PWRDM_POWER_ON)) {
398 prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); 393 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
399 omap3_enable_io_chain(); 394 omap3_enable_io_chain();
400 } 395 }
401 396
@@ -408,9 +403,10 @@ void omap_sram_idle(void)
408 403
409 /* PER */ 404 /* PER */
410 if (per_next_state < PWRDM_POWER_ON) { 405 if (per_next_state < PWRDM_POWER_ON) {
406 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
411 omap_uart_prepare_idle(2); 407 omap_uart_prepare_idle(2);
412 omap_uart_prepare_idle(3); 408 omap_uart_prepare_idle(3);
413 omap2_gpio_prepare_for_idle(per_next_state); 409 omap2_gpio_prepare_for_idle(per_going_off);
414 if (per_next_state == PWRDM_POWER_OFF) 410 if (per_next_state == PWRDM_POWER_OFF)
415 omap3_per_save_context(); 411 omap3_per_save_context();
416 } 412 }
@@ -421,7 +417,7 @@ void omap_sram_idle(void)
421 omap_uart_prepare_idle(1); 417 omap_uart_prepare_idle(1);
422 if (core_next_state == PWRDM_POWER_OFF) { 418 if (core_next_state == PWRDM_POWER_OFF) {
423 omap3_core_save_context(); 419 omap3_core_save_context();
424 omap3_prcm_save_context(); 420 omap3_cm_save_context();
425 } 421 }
426 } 422 }
427 423
@@ -430,7 +426,7 @@ void omap_sram_idle(void)
430 /* 426 /*
431 * On EMU/HS devices ROM code restores a SRDC value 427 * On EMU/HS devices ROM code restores a SRDC value
432 * from scratchpad which has automatic self refresh on timeout 428 * from scratchpad which has automatic self refresh on timeout
433 * of AUTO_CNT = 1 enabled. This takes care of errata 1.142. 429 * of AUTO_CNT = 1 enabled. This takes care of erratum ID i443.
434 * Hence store/restore the SDRC_POWER register here. 430 * Hence store/restore the SDRC_POWER register here.
435 */ 431 */
436 if (omap_rev() >= OMAP3430_REV_ES3_0 && 432 if (omap_rev() >= OMAP3430_REV_ES3_0 &&
@@ -461,14 +457,14 @@ void omap_sram_idle(void)
461 core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm); 457 core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
462 if (core_prev_state == PWRDM_POWER_OFF) { 458 if (core_prev_state == PWRDM_POWER_OFF) {
463 omap3_core_restore_context(); 459 omap3_core_restore_context();
464 omap3_prcm_restore_context(); 460 omap3_cm_restore_context();
465 omap3_sram_restore_context(); 461 omap3_sram_restore_context();
466 omap2_sms_restore_context(); 462 omap2_sms_restore_context();
467 } 463 }
468 omap_uart_resume_idle(0); 464 omap_uart_resume_idle(0);
469 omap_uart_resume_idle(1); 465 omap_uart_resume_idle(1);
470 if (core_next_state == PWRDM_POWER_OFF) 466 if (core_next_state == PWRDM_POWER_OFF)
471 prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, 467 omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK,
472 OMAP3430_GR_MOD, 468 OMAP3430_GR_MOD,
473 OMAP3_PRM_VOLTCTRL_OFFSET); 469 OMAP3_PRM_VOLTCTRL_OFFSET);
474 } 470 }
@@ -492,7 +488,8 @@ console_still_active:
492 if (omap3_has_io_wakeup() && 488 if (omap3_has_io_wakeup() &&
493 (per_next_state < PWRDM_POWER_ON || 489 (per_next_state < PWRDM_POWER_ON ||
494 core_next_state < PWRDM_POWER_ON)) { 490 core_next_state < PWRDM_POWER_ON)) {
495 prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); 491 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
492 PM_WKEN);
496 omap3_disable_io_chain(); 493 omap3_disable_io_chain();
497 } 494 }
498 495
@@ -529,12 +526,6 @@ out:
529} 526}
530 527
531#ifdef CONFIG_SUSPEND 528#ifdef CONFIG_SUSPEND
532static int omap3_pm_prepare(void)
533{
534 disable_hlt();
535 return 0;
536}
537
538static int omap3_pm_suspend(void) 529static int omap3_pm_suspend(void)
539{ 530{
540 struct power_state *pwrst; 531 struct power_state *pwrst;
@@ -597,14 +588,10 @@ static int omap3_pm_enter(suspend_state_t unused)
597 return ret; 588 return ret;
598} 589}
599 590
600static void omap3_pm_finish(void)
601{
602 enable_hlt();
603}
604
605/* Hooks to enable / disable UART interrupts during suspend */ 591/* Hooks to enable / disable UART interrupts during suspend */
606static int omap3_pm_begin(suspend_state_t state) 592static int omap3_pm_begin(suspend_state_t state)
607{ 593{
594 disable_hlt();
608 suspend_state = state; 595 suspend_state = state;
609 omap_uart_enable_irqs(0); 596 omap_uart_enable_irqs(0);
610 return 0; 597 return 0;
@@ -614,15 +601,14 @@ static void omap3_pm_end(void)
614{ 601{
615 suspend_state = PM_SUSPEND_ON; 602 suspend_state = PM_SUSPEND_ON;
616 omap_uart_enable_irqs(1); 603 omap_uart_enable_irqs(1);
604 enable_hlt();
617 return; 605 return;
618} 606}
619 607
620static struct platform_suspend_ops omap_pm_ops = { 608static struct platform_suspend_ops omap_pm_ops = {
621 .begin = omap3_pm_begin, 609 .begin = omap3_pm_begin,
622 .end = omap3_pm_end, 610 .end = omap3_pm_end,
623 .prepare = omap3_pm_prepare,
624 .enter = omap3_pm_enter, 611 .enter = omap3_pm_enter,
625 .finish = omap3_pm_finish,
626 .valid = suspend_valid_only_mem, 612 .valid = suspend_valid_only_mem,
627}; 613};
628#endif /* CONFIG_SUSPEND */ 614#endif /* CONFIG_SUSPEND */
@@ -641,21 +627,21 @@ static struct platform_suspend_ops omap_pm_ops = {
641static void __init omap3_iva_idle(void) 627static void __init omap3_iva_idle(void)
642{ 628{
643 /* ensure IVA2 clock is disabled */ 629 /* ensure IVA2 clock is disabled */
644 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); 630 omap2_cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
645 631
646 /* if no clock activity, nothing else to do */ 632 /* if no clock activity, nothing else to do */
647 if (!(cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) & 633 if (!(omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) &
648 OMAP3430_CLKACTIVITY_IVA2_MASK)) 634 OMAP3430_CLKACTIVITY_IVA2_MASK))
649 return; 635 return;
650 636
651 /* Reset IVA2 */ 637 /* Reset IVA2 */
652 prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK | 638 omap2_prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK |
653 OMAP3430_RST2_IVA2_MASK | 639 OMAP3430_RST2_IVA2_MASK |
654 OMAP3430_RST3_IVA2_MASK, 640 OMAP3430_RST3_IVA2_MASK,
655 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); 641 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
656 642
657 /* Enable IVA2 clock */ 643 /* Enable IVA2 clock */
658 cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK, 644 omap2_cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK,
659 OMAP3430_IVA2_MOD, CM_FCLKEN); 645 OMAP3430_IVA2_MOD, CM_FCLKEN);
660 646
661 /* Set IVA2 boot mode to 'idle' */ 647 /* Set IVA2 boot mode to 'idle' */
@@ -663,13 +649,13 @@ static void __init omap3_iva_idle(void)
663 OMAP343X_CONTROL_IVA2_BOOTMOD); 649 OMAP343X_CONTROL_IVA2_BOOTMOD);
664 650
665 /* Un-reset IVA2 */ 651 /* Un-reset IVA2 */
666 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); 652 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
667 653
668 /* Disable IVA2 clock */ 654 /* Disable IVA2 clock */
669 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); 655 omap2_cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
670 656
671 /* Reset IVA2 */ 657 /* Reset IVA2 */
672 prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK | 658 omap2_prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK |
673 OMAP3430_RST2_IVA2_MASK | 659 OMAP3430_RST2_IVA2_MASK |
674 OMAP3430_RST3_IVA2_MASK, 660 OMAP3430_RST3_IVA2_MASK,
675 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); 661 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
@@ -693,10 +679,10 @@ static void __init omap3_d2d_idle(void)
693 omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK); 679 omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
694 680
695 /* reset modem */ 681 /* reset modem */
696 prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON_MASK | 682 omap2_prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON_MASK |
697 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST_MASK, 683 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST_MASK,
698 CORE_MOD, OMAP2_RM_RSTCTRL); 684 CORE_MOD, OMAP2_RM_RSTCTRL);
699 prm_write_mod_reg(0, CORE_MOD, OMAP2_RM_RSTCTRL); 685 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP2_RM_RSTCTRL);
700} 686}
701 687
702static void __init prcm_setup_regs(void) 688static void __init prcm_setup_regs(void)
@@ -711,23 +697,23 @@ static void __init prcm_setup_regs(void)
711 697
712 /* XXX Reset all wkdeps. This should be done when initializing 698 /* XXX Reset all wkdeps. This should be done when initializing
713 * powerdomains */ 699 * powerdomains */
714 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); 700 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
715 prm_write_mod_reg(0, MPU_MOD, PM_WKDEP); 701 omap2_prm_write_mod_reg(0, MPU_MOD, PM_WKDEP);
716 prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP); 702 omap2_prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP);
717 prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP); 703 omap2_prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP);
718 prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP); 704 omap2_prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP);
719 prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP); 705 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP);
720 if (omap_rev() > OMAP3430_REV_ES1_0) { 706 if (omap_rev() > OMAP3430_REV_ES1_0) {
721 prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP); 707 omap2_prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP);
722 prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP); 708 omap2_prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
723 } else 709 } else
724 prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); 710 omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
725 711
726 /* 712 /*
727 * Enable interface clock autoidle for all modules. 713 * Enable interface clock autoidle for all modules.
728 * Note that in the long run this should be done by clockfw 714 * Note that in the long run this should be done by clockfw
729 */ 715 */
730 cm_write_mod_reg( 716 omap2_cm_write_mod_reg(
731 OMAP3430_AUTO_MODEM_MASK | 717 OMAP3430_AUTO_MODEM_MASK |
732 OMAP3430ES2_AUTO_MMC3_MASK | 718 OMAP3430ES2_AUTO_MMC3_MASK |
733 OMAP3430ES2_AUTO_ICR_MASK | 719 OMAP3430ES2_AUTO_ICR_MASK |
@@ -760,7 +746,7 @@ static void __init prcm_setup_regs(void)
760 OMAP3430_AUTO_SSI_MASK, 746 OMAP3430_AUTO_SSI_MASK,
761 CORE_MOD, CM_AUTOIDLE1); 747 CORE_MOD, CM_AUTOIDLE1);
762 748
763 cm_write_mod_reg( 749 omap2_cm_write_mod_reg(
764 OMAP3430_AUTO_PKA_MASK | 750 OMAP3430_AUTO_PKA_MASK |
765 OMAP3430_AUTO_AES1_MASK | 751 OMAP3430_AUTO_AES1_MASK |
766 OMAP3430_AUTO_RNG_MASK | 752 OMAP3430_AUTO_RNG_MASK |
@@ -769,13 +755,13 @@ static void __init prcm_setup_regs(void)
769 CORE_MOD, CM_AUTOIDLE2); 755 CORE_MOD, CM_AUTOIDLE2);
770 756
771 if (omap_rev() > OMAP3430_REV_ES1_0) { 757 if (omap_rev() > OMAP3430_REV_ES1_0) {
772 cm_write_mod_reg( 758 omap2_cm_write_mod_reg(
773 OMAP3430_AUTO_MAD2D_MASK | 759 OMAP3430_AUTO_MAD2D_MASK |
774 OMAP3430ES2_AUTO_USBTLL_MASK, 760 OMAP3430ES2_AUTO_USBTLL_MASK,
775 CORE_MOD, CM_AUTOIDLE3); 761 CORE_MOD, CM_AUTOIDLE3);
776 } 762 }
777 763
778 cm_write_mod_reg( 764 omap2_cm_write_mod_reg(
779 OMAP3430_AUTO_WDT2_MASK | 765 OMAP3430_AUTO_WDT2_MASK |
780 OMAP3430_AUTO_WDT1_MASK | 766 OMAP3430_AUTO_WDT1_MASK |
781 OMAP3430_AUTO_GPIO1_MASK | 767 OMAP3430_AUTO_GPIO1_MASK |
@@ -784,17 +770,17 @@ static void __init prcm_setup_regs(void)
784 OMAP3430_AUTO_GPT1_MASK, 770 OMAP3430_AUTO_GPT1_MASK,
785 WKUP_MOD, CM_AUTOIDLE); 771 WKUP_MOD, CM_AUTOIDLE);
786 772
787 cm_write_mod_reg( 773 omap2_cm_write_mod_reg(
788 OMAP3430_AUTO_DSS_MASK, 774 OMAP3430_AUTO_DSS_MASK,
789 OMAP3430_DSS_MOD, 775 OMAP3430_DSS_MOD,
790 CM_AUTOIDLE); 776 CM_AUTOIDLE);
791 777
792 cm_write_mod_reg( 778 omap2_cm_write_mod_reg(
793 OMAP3430_AUTO_CAM_MASK, 779 OMAP3430_AUTO_CAM_MASK,
794 OMAP3430_CAM_MOD, 780 OMAP3430_CAM_MOD,
795 CM_AUTOIDLE); 781 CM_AUTOIDLE);
796 782
797 cm_write_mod_reg( 783 omap2_cm_write_mod_reg(
798 omap3630_auto_uart4_mask | 784 omap3630_auto_uart4_mask |
799 OMAP3430_AUTO_GPIO6_MASK | 785 OMAP3430_AUTO_GPIO6_MASK |
800 OMAP3430_AUTO_GPIO5_MASK | 786 OMAP3430_AUTO_GPIO5_MASK |
@@ -818,7 +804,7 @@ static void __init prcm_setup_regs(void)
818 CM_AUTOIDLE); 804 CM_AUTOIDLE);
819 805
820 if (omap_rev() > OMAP3430_REV_ES1_0) { 806 if (omap_rev() > OMAP3430_REV_ES1_0) {
821 cm_write_mod_reg( 807 omap2_cm_write_mod_reg(
822 OMAP3430ES2_AUTO_USBHOST_MASK, 808 OMAP3430ES2_AUTO_USBHOST_MASK,
823 OMAP3430ES2_USBHOST_MOD, 809 OMAP3430ES2_USBHOST_MOD,
824 CM_AUTOIDLE); 810 CM_AUTOIDLE);
@@ -830,16 +816,16 @@ static void __init prcm_setup_regs(void)
830 * Set all plls to autoidle. This is needed until autoidle is 816 * Set all plls to autoidle. This is needed until autoidle is
831 * enabled by clockfw 817 * enabled by clockfw
832 */ 818 */
833 cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT, 819 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT,
834 OMAP3430_IVA2_MOD, CM_AUTOIDLE2); 820 OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
835 cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT, 821 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT,
836 MPU_MOD, 822 MPU_MOD,
837 CM_AUTOIDLE2); 823 CM_AUTOIDLE2);
838 cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) | 824 omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) |
839 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT), 825 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT),
840 PLL_MOD, 826 PLL_MOD,
841 CM_AUTOIDLE); 827 CM_AUTOIDLE);
842 cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT, 828 omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT,
843 PLL_MOD, 829 PLL_MOD,
844 CM_AUTOIDLE2); 830 CM_AUTOIDLE2);
845 831
@@ -848,31 +834,31 @@ static void __init prcm_setup_regs(void)
848 * sys_clkreq. In the long run clock framework should 834 * sys_clkreq. In the long run clock framework should
849 * take care of this. 835 * take care of this.
850 */ 836 */
851 prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK, 837 omap2_prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK,
852 1 << OMAP_AUTOEXTCLKMODE_SHIFT, 838 1 << OMAP_AUTOEXTCLKMODE_SHIFT,
853 OMAP3430_GR_MOD, 839 OMAP3430_GR_MOD,
854 OMAP3_PRM_CLKSRC_CTRL_OFFSET); 840 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
855 841
856 /* setup wakup source */ 842 /* setup wakup source */
857 prm_write_mod_reg(OMAP3430_EN_IO_MASK | OMAP3430_EN_GPIO1_MASK | 843 omap2_prm_write_mod_reg(OMAP3430_EN_IO_MASK | OMAP3430_EN_GPIO1_MASK |
858 OMAP3430_EN_GPT1_MASK | OMAP3430_EN_GPT12_MASK, 844 OMAP3430_EN_GPT1_MASK | OMAP3430_EN_GPT12_MASK,
859 WKUP_MOD, PM_WKEN); 845 WKUP_MOD, PM_WKEN);
860 /* No need to write EN_IO, that is always enabled */ 846 /* No need to write EN_IO, that is always enabled */
861 prm_write_mod_reg(OMAP3430_GRPSEL_GPIO1_MASK | 847 omap2_prm_write_mod_reg(OMAP3430_GRPSEL_GPIO1_MASK |
862 OMAP3430_GRPSEL_GPT1_MASK | 848 OMAP3430_GRPSEL_GPT1_MASK |
863 OMAP3430_GRPSEL_GPT12_MASK, 849 OMAP3430_GRPSEL_GPT12_MASK,
864 WKUP_MOD, OMAP3430_PM_MPUGRPSEL); 850 WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
865 /* For some reason IO doesn't generate wakeup event even if 851 /* For some reason IO doesn't generate wakeup event even if
866 * it is selected to mpu wakeup goup */ 852 * it is selected to mpu wakeup goup */
867 prm_write_mod_reg(OMAP3430_IO_EN_MASK | OMAP3430_WKUP_EN_MASK, 853 omap2_prm_write_mod_reg(OMAP3430_IO_EN_MASK | OMAP3430_WKUP_EN_MASK,
868 OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); 854 OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
869 855
870 /* Enable PM_WKEN to support DSS LPR */ 856 /* Enable PM_WKEN to support DSS LPR */
871 prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS_MASK, 857 omap2_prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS_MASK,
872 OMAP3430_DSS_MOD, PM_WKEN); 858 OMAP3430_DSS_MOD, PM_WKEN);
873 859
874 /* Enable wakeups in PER */ 860 /* Enable wakeups in PER */
875 prm_write_mod_reg(omap3630_en_uart4_mask | 861 omap2_prm_write_mod_reg(omap3630_en_uart4_mask |
876 OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK | 862 OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK |
877 OMAP3430_EN_GPIO4_MASK | OMAP3430_EN_GPIO5_MASK | 863 OMAP3430_EN_GPIO4_MASK | OMAP3430_EN_GPIO5_MASK |
878 OMAP3430_EN_GPIO6_MASK | OMAP3430_EN_UART3_MASK | 864 OMAP3430_EN_GPIO6_MASK | OMAP3430_EN_UART3_MASK |
@@ -880,7 +866,7 @@ static void __init prcm_setup_regs(void)
880 OMAP3430_EN_MCBSP4_MASK, 866 OMAP3430_EN_MCBSP4_MASK,
881 OMAP3430_PER_MOD, PM_WKEN); 867 OMAP3430_PER_MOD, PM_WKEN);
882 /* and allow them to wake up MPU */ 868 /* and allow them to wake up MPU */
883 prm_write_mod_reg(omap3630_grpsel_uart4_mask | 869 omap2_prm_write_mod_reg(omap3630_grpsel_uart4_mask |
884 OMAP3430_GRPSEL_GPIO2_MASK | 870 OMAP3430_GRPSEL_GPIO2_MASK |
885 OMAP3430_GRPSEL_GPIO3_MASK | 871 OMAP3430_GRPSEL_GPIO3_MASK |
886 OMAP3430_GRPSEL_GPIO4_MASK | 872 OMAP3430_GRPSEL_GPIO4_MASK |
@@ -893,22 +879,22 @@ static void __init prcm_setup_regs(void)
893 OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL); 879 OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
894 880
895 /* Don't attach IVA interrupts */ 881 /* Don't attach IVA interrupts */
896 prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL); 882 omap2_prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
897 prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1); 883 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
898 prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3); 884 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
899 prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); 885 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
900 886
901 /* Clear any pending 'reset' flags */ 887 /* Clear any pending 'reset' flags */
902 prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST); 888 omap2_prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST);
903 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST); 889 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST);
904 prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST); 890 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST);
905 prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST); 891 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST);
906 prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST); 892 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST);
907 prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST); 893 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST);
908 prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST); 894 omap2_prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST);
909 895
910 /* Clear any pending PRCM interrupts */ 896 /* Clear any pending PRCM interrupts */
911 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 897 omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
912 898
913 omap3_iva_idle(); 899 omap3_iva_idle();
914 omap3_d2d_idle(); 900 omap3_d2d_idle();
@@ -925,12 +911,29 @@ void omap3_pm_off_mode_enable(int enable)
925 state = PWRDM_POWER_RET; 911 state = PWRDM_POWER_RET;
926 912
927#ifdef CONFIG_CPU_IDLE 913#ifdef CONFIG_CPU_IDLE
928 omap3_cpuidle_update_states(); 914 /*
915 * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot
916 * enable OFF mode in a stable form for previous revisions, restrict
917 * instead to RET
918 */
919 if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583))
920 omap3_cpuidle_update_states(state, PWRDM_POWER_RET);
921 else
922 omap3_cpuidle_update_states(state, state);
929#endif 923#endif
930 924
931 list_for_each_entry(pwrst, &pwrst_list, node) { 925 list_for_each_entry(pwrst, &pwrst_list, node) {
932 pwrst->next_state = state; 926 if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583) &&
933 omap_set_pwrdm_state(pwrst->pwrdm, state); 927 pwrst->pwrdm == core_pwrdm &&
928 state == PWRDM_POWER_OFF) {
929 pwrst->next_state = PWRDM_POWER_RET;
930 WARN_ONCE(1,
931 "%s: Core OFF disabled due to errata i583\n",
932 __func__);
933 } else {
934 pwrst->next_state = state;
935 }
936 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
934 } 937 }
935} 938}
936 939
@@ -1002,6 +1005,17 @@ void omap_push_sram_idle(void)
1002 save_secure_ram_context_sz); 1005 save_secure_ram_context_sz);
1003} 1006}
1004 1007
1008static void __init pm_errata_configure(void)
1009{
1010 if (cpu_is_omap3630()) {
1011 pm34xx_errata |= PM_RTA_ERRATUM_i608;
1012 /* Enable the l2 cache toggling in sleep logic */
1013 enable_omap3630_toggle_l2_on_restore();
1014 if (omap_rev() < OMAP3630_REV_ES1_2)
1015 pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583;
1016 }
1017}
1018
1005static int __init omap3_pm_init(void) 1019static int __init omap3_pm_init(void)
1006{ 1020{
1007 struct power_state *pwrst, *tmp; 1021 struct power_state *pwrst, *tmp;
@@ -1011,6 +1025,8 @@ static int __init omap3_pm_init(void)
1011 if (!cpu_is_omap34xx()) 1025 if (!cpu_is_omap34xx())
1012 return -ENODEV; 1026 return -ENODEV;
1013 1027
1028 pm_errata_configure();
1029
1014 printk(KERN_ERR "Power Management for TI OMAP3.\n"); 1030 printk(KERN_ERR "Power Management for TI OMAP3.\n");
1015 1031
1016 /* XXX prcm_setup_regs needs to be before enabling hw 1032 /* XXX prcm_setup_regs needs to be before enabling hw
@@ -1058,6 +1074,14 @@ static int __init omap3_pm_init(void)
1058 pm_idle = omap3_pm_idle; 1074 pm_idle = omap3_pm_idle;
1059 omap3_idle_init(); 1075 omap3_idle_init();
1060 1076
1077 /*
1078 * RTA is disabled during initialization as per erratum i608
1079 * it is safer to disable RTA by the bootloader, but we would like
1080 * to be doubly sure here and prevent any mishaps.
1081 */
1082 if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608))
1083 omap3630_ctrl_disable_rta();
1084
1061 clkdm_add_wkdep(neon_clkdm, mpu_clkdm); 1085 clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
1062 if (omap_type() != OMAP2_DEVICE_TYPE_GP) { 1086 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
1063 omap3_secure_ram_storage = 1087 omap3_secure_ram_storage =
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 54544b4fc76b..e9f4862c4de4 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -16,7 +16,7 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18 18
19#include <plat/powerdomain.h> 19#include "powerdomain.h"
20#include <mach/omap4-common.h> 20#include <mach/omap4-common.h>
21 21
22struct power_state { 22struct power_state {
@@ -31,12 +31,6 @@ struct power_state {
31static LIST_HEAD(pwrst_list); 31static LIST_HEAD(pwrst_list);
32 32
33#ifdef CONFIG_SUSPEND 33#ifdef CONFIG_SUSPEND
34static int omap4_pm_prepare(void)
35{
36 disable_hlt();
37 return 0;
38}
39
40static int omap4_pm_suspend(void) 34static int omap4_pm_suspend(void)
41{ 35{
42 do_wfi(); 36 do_wfi();
@@ -59,28 +53,22 @@ static int omap4_pm_enter(suspend_state_t suspend_state)
59 return ret; 53 return ret;
60} 54}
61 55
62static void omap4_pm_finish(void)
63{
64 enable_hlt();
65 return;
66}
67
68static int omap4_pm_begin(suspend_state_t state) 56static int omap4_pm_begin(suspend_state_t state)
69{ 57{
58 disable_hlt();
70 return 0; 59 return 0;
71} 60}
72 61
73static void omap4_pm_end(void) 62static void omap4_pm_end(void)
74{ 63{
64 enable_hlt();
75 return; 65 return;
76} 66}
77 67
78static struct platform_suspend_ops omap_pm_ops = { 68static struct platform_suspend_ops omap_pm_ops = {
79 .begin = omap4_pm_begin, 69 .begin = omap4_pm_begin,
80 .end = omap4_pm_end, 70 .end = omap4_pm_end,
81 .prepare = omap4_pm_prepare,
82 .enter = omap4_pm_enter, 71 .enter = omap4_pm_enter,
83 .finish = omap4_pm_finish,
84 .valid = suspend_valid_only_mem, 72 .valid = suspend_valid_only_mem,
85}; 73};
86#endif /* CONFIG_SUSPEND */ 74#endif /* CONFIG_SUSPEND */
diff --git a/arch/arm/mach-omap2/powerdomain-common.c b/arch/arm/mach-omap2/powerdomain-common.c
new file mode 100644
index 000000000000..171fccd208c7
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain-common.c
@@ -0,0 +1,110 @@
1/*
2 * linux/arch/arm/mach-omap2/powerdomain-common.c
3 * Contains common powerdomain framework functions
4 *
5 * Copyright (C) 2010 Texas Instruments, Inc.
6 * Copyright (C) 2010 Nokia Corporation
7 *
8 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
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/errno.h>
16#include <linux/kernel.h>
17#include "pm.h"
18#include "cm.h"
19#include "cm-regbits-34xx.h"
20#include "cm-regbits-44xx.h"
21#include "prm-regbits-34xx.h"
22#include "prm-regbits-44xx.h"
23
24/*
25 * OMAP3 and OMAP4 specific register bit initialisations
26 * Notice that the names here are not according to each power
27 * domain but the bit mapping used applies to all of them
28 */
29/* OMAP3 and OMAP4 Memory Onstate Masks (common across all power domains) */
30#define OMAP_MEM0_ONSTATE_MASK OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK
31#define OMAP_MEM1_ONSTATE_MASK OMAP3430_L1FLATMEMONSTATE_MASK
32#define OMAP_MEM2_ONSTATE_MASK OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK
33#define OMAP_MEM3_ONSTATE_MASK OMAP3430_L2FLATMEMONSTATE_MASK
34#define OMAP_MEM4_ONSTATE_MASK OMAP4430_OCP_NRET_BANK_ONSTATE_MASK
35
36/* OMAP3 and OMAP4 Memory Retstate Masks (common across all power domains) */
37#define OMAP_MEM0_RETSTATE_MASK OMAP3430_SHAREDL1CACHEFLATRETSTATE_MASK
38#define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE_MASK
39#define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE_MASK
40#define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE_MASK
41#define OMAP_MEM4_RETSTATE_MASK OMAP4430_OCP_NRET_BANK_RETSTATE_MASK
42
43/* OMAP3 and OMAP4 Memory Status bits */
44#define OMAP_MEM0_STATEST_MASK OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK
45#define OMAP_MEM1_STATEST_MASK OMAP3430_L1FLATMEMSTATEST_MASK
46#define OMAP_MEM2_STATEST_MASK OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK
47#define OMAP_MEM3_STATEST_MASK OMAP3430_L2FLATMEMSTATEST_MASK
48#define OMAP_MEM4_STATEST_MASK OMAP4430_OCP_NRET_BANK_STATEST_MASK
49
50/* Common Internal functions used across OMAP rev's*/
51u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank)
52{
53 switch (bank) {
54 case 0:
55 return OMAP_MEM0_ONSTATE_MASK;
56 case 1:
57 return OMAP_MEM1_ONSTATE_MASK;
58 case 2:
59 return OMAP_MEM2_ONSTATE_MASK;
60 case 3:
61 return OMAP_MEM3_ONSTATE_MASK;
62 case 4:
63 return OMAP_MEM4_ONSTATE_MASK;
64 default:
65 WARN_ON(1); /* should never happen */
66 return -EEXIST;
67 }
68 return 0;
69}
70
71u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank)
72{
73 switch (bank) {
74 case 0:
75 return OMAP_MEM0_RETSTATE_MASK;
76 case 1:
77 return OMAP_MEM1_RETSTATE_MASK;
78 case 2:
79 return OMAP_MEM2_RETSTATE_MASK;
80 case 3:
81 return OMAP_MEM3_RETSTATE_MASK;
82 case 4:
83 return OMAP_MEM4_RETSTATE_MASK;
84 default:
85 WARN_ON(1); /* should never happen */
86 return -EEXIST;
87 }
88 return 0;
89}
90
91u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank)
92{
93 switch (bank) {
94 case 0:
95 return OMAP_MEM0_STATEST_MASK;
96 case 1:
97 return OMAP_MEM1_STATEST_MASK;
98 case 2:
99 return OMAP_MEM2_STATEST_MASK;
100 case 3:
101 return OMAP_MEM3_STATEST_MASK;
102 case 4:
103 return OMAP_MEM4_STATEST_MASK;
104 default:
105 WARN_ON(1); /* should never happen */
106 return -EEXIST;
107 }
108 return 0;
109}
110
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 6527ec30dc17..eaed0df16699 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -15,27 +15,19 @@
15#undef DEBUG 15#undef DEBUG
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/delay.h>
21#include <linux/spinlock.h>
22#include <linux/list.h> 19#include <linux/list.h>
23#include <linux/errno.h> 20#include <linux/errno.h>
24#include <linux/err.h> 21#include <linux/string.h>
25#include <linux/io.h> 22#include "cm2xxx_3xxx.h"
26 23#include "prcm44xx.h"
27#include <asm/atomic.h> 24#include "cm44xx.h"
28 25#include "prm2xxx_3xxx.h"
29#include "cm.h" 26#include "prm44xx.h"
30#include "cm-regbits-34xx.h"
31#include "cm-regbits-44xx.h"
32#include "prm.h"
33#include "prm-regbits-34xx.h"
34#include "prm-regbits-44xx.h"
35 27
36#include <plat/cpu.h> 28#include <plat/cpu.h>
37#include <plat/powerdomain.h> 29#include "powerdomain.h"
38#include <plat/clockdomain.h> 30#include "clockdomain.h"
39#include <plat/prcm.h> 31#include <plat/prcm.h>
40 32
41#include "pm.h" 33#include "pm.h"
@@ -45,41 +37,12 @@ enum {
45 PWRDM_STATE_PREV, 37 PWRDM_STATE_PREV,
46}; 38};
47 39
48/* Variable holding value of the CPU dependent PWRSTCTRL Register Offset */
49static u16 pwrstctrl_reg_offs;
50
51/* Variable holding value of the CPU dependent PWRSTST Register Offset */
52static u16 pwrstst_reg_offs;
53
54/* OMAP3 and OMAP4 specific register bit initialisations
55 * Notice that the names here are not according to each power
56 * domain but the bit mapping used applies to all of them
57 */
58
59/* OMAP3 and OMAP4 Memory Onstate Masks (common across all power domains) */
60#define OMAP_MEM0_ONSTATE_MASK OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK
61#define OMAP_MEM1_ONSTATE_MASK OMAP3430_L1FLATMEMONSTATE_MASK
62#define OMAP_MEM2_ONSTATE_MASK OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK
63#define OMAP_MEM3_ONSTATE_MASK OMAP3430_L2FLATMEMONSTATE_MASK
64#define OMAP_MEM4_ONSTATE_MASK OMAP4430_OCP_NRET_BANK_ONSTATE_MASK
65
66/* OMAP3 and OMAP4 Memory Retstate Masks (common across all power domains) */
67#define OMAP_MEM0_RETSTATE_MASK OMAP3430_SHAREDL1CACHEFLATRETSTATE_MASK
68#define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE_MASK
69#define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE_MASK
70#define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE_MASK
71#define OMAP_MEM4_RETSTATE_MASK OMAP4430_OCP_NRET_BANK_RETSTATE_MASK
72
73/* OMAP3 and OMAP4 Memory Status bits */
74#define OMAP_MEM0_STATEST_MASK OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK
75#define OMAP_MEM1_STATEST_MASK OMAP3430_L1FLATMEMSTATEST_MASK
76#define OMAP_MEM2_STATEST_MASK OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK
77#define OMAP_MEM3_STATEST_MASK OMAP3430_L2FLATMEMSTATEST_MASK
78#define OMAP_MEM4_STATEST_MASK OMAP4430_OCP_NRET_BANK_STATEST_MASK
79 40
80/* pwrdm_list contains all registered struct powerdomains */ 41/* pwrdm_list contains all registered struct powerdomains */
81static LIST_HEAD(pwrdm_list); 42static LIST_HEAD(pwrdm_list);
82 43
44static struct pwrdm_ops *arch_pwrdm;
45
83/* Private functions */ 46/* Private functions */
84 47
85static struct powerdomain *_pwrdm_lookup(const char *name) 48static struct powerdomain *_pwrdm_lookup(const char *name)
@@ -110,12 +73,19 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
110{ 73{
111 int i; 74 int i;
112 75
113 if (!pwrdm) 76 if (!pwrdm || !pwrdm->name)
114 return -EINVAL; 77 return -EINVAL;
115 78
116 if (!omap_chip_is(pwrdm->omap_chip)) 79 if (!omap_chip_is(pwrdm->omap_chip))
117 return -EINVAL; 80 return -EINVAL;
118 81
82 if (cpu_is_omap44xx() &&
83 pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) {
84 pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n",
85 pwrdm->name);
86 return -EINVAL;
87 }
88
119 if (_pwrdm_lookup(pwrdm->name)) 89 if (_pwrdm_lookup(pwrdm->name))
120 return -EEXIST; 90 return -EEXIST;
121 91
@@ -211,6 +181,7 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
211/** 181/**
212 * pwrdm_init - set up the powerdomain layer 182 * pwrdm_init - set up the powerdomain layer
213 * @pwrdm_list: array of struct powerdomain pointers to register 183 * @pwrdm_list: array of struct powerdomain pointers to register
184 * @custom_funcs: func pointers for arch specfic implementations
214 * 185 *
215 * Loop through the array of powerdomains @pwrdm_list, registering all 186 * Loop through the array of powerdomains @pwrdm_list, registering all
216 * that are available on the current CPU. If pwrdm_list is supplied 187 * that are available on the current CPU. If pwrdm_list is supplied
@@ -218,21 +189,14 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
218 * registered. No return value. XXX pwrdm_list is not really a 189 * registered. No return value. XXX pwrdm_list is not really a
219 * "list"; it is an array. Rename appropriately. 190 * "list"; it is an array. Rename appropriately.
220 */ 191 */
221void pwrdm_init(struct powerdomain **pwrdm_list) 192void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs)
222{ 193{
223 struct powerdomain **p = NULL; 194 struct powerdomain **p = NULL;
224 195
225 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 196 if (!custom_funcs)
226 pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL; 197 WARN(1, "powerdomain: No custom pwrdm functions registered\n");
227 pwrstst_reg_offs = OMAP2_PM_PWSTST; 198 else
228 } else if (cpu_is_omap44xx()) { 199 arch_pwrdm = custom_funcs;
229 pwrstctrl_reg_offs = OMAP4_PM_PWSTCTRL;
230 pwrstst_reg_offs = OMAP4_PM_PWSTST;
231 } else {
232 printk(KERN_ERR "Power Domain struct not supported for " \
233 "this CPU\n");
234 return;
235 }
236 200
237 if (pwrdm_list) { 201 if (pwrdm_list) {
238 for (p = pwrdm_list; *p; p++) 202 for (p = pwrdm_list; *p; p++)
@@ -431,6 +395,8 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm)
431 */ 395 */
432int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) 396int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
433{ 397{
398 int ret = -EINVAL;
399
434 if (!pwrdm) 400 if (!pwrdm)
435 return -EINVAL; 401 return -EINVAL;
436 402
@@ -440,11 +406,10 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
440 pr_debug("powerdomain: setting next powerstate for %s to %0x\n", 406 pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
441 pwrdm->name, pwrst); 407 pwrdm->name, pwrst);
442 408
443 prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, 409 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
444 (pwrst << OMAP_POWERSTATE_SHIFT), 410 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
445 pwrdm->prcm_offs, pwrstctrl_reg_offs);
446 411
447 return 0; 412 return ret;
448} 413}
449 414
450/** 415/**
@@ -457,11 +422,15 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
457 */ 422 */
458int pwrdm_read_next_pwrst(struct powerdomain *pwrdm) 423int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
459{ 424{
425 int ret = -EINVAL;
426
460 if (!pwrdm) 427 if (!pwrdm)
461 return -EINVAL; 428 return -EINVAL;
462 429
463 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 430 if (arch_pwrdm && arch_pwrdm->pwrdm_read_next_pwrst)
464 pwrstctrl_reg_offs, OMAP_POWERSTATE_MASK); 431 ret = arch_pwrdm->pwrdm_read_next_pwrst(pwrdm);
432
433 return ret;
465} 434}
466 435
467/** 436/**
@@ -474,11 +443,15 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
474 */ 443 */
475int pwrdm_read_pwrst(struct powerdomain *pwrdm) 444int pwrdm_read_pwrst(struct powerdomain *pwrdm)
476{ 445{
446 int ret = -EINVAL;
447
477 if (!pwrdm) 448 if (!pwrdm)
478 return -EINVAL; 449 return -EINVAL;
479 450
480 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 451 if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
481 pwrstst_reg_offs, OMAP_POWERSTATEST_MASK); 452 ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
453
454 return ret;
482} 455}
483 456
484/** 457/**
@@ -491,11 +464,15 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
491 */ 464 */
492int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) 465int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
493{ 466{
467 int ret = -EINVAL;
468
494 if (!pwrdm) 469 if (!pwrdm)
495 return -EINVAL; 470 return -EINVAL;
496 471
497 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST, 472 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_pwrst)
498 OMAP3430_LASTPOWERSTATEENTERED_MASK); 473 ret = arch_pwrdm->pwrdm_read_prev_pwrst(pwrdm);
474
475 return ret;
499} 476}
500 477
501/** 478/**
@@ -511,7 +488,7 @@ int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
511 */ 488 */
512int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) 489int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
513{ 490{
514 u32 v; 491 int ret = -EINVAL;
515 492
516 if (!pwrdm) 493 if (!pwrdm)
517 return -EINVAL; 494 return -EINVAL;
@@ -522,17 +499,10 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
522 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n", 499 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n",
523 pwrdm->name, pwrst); 500 pwrdm->name, pwrst);
524 501
525 /* 502 if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst)
526 * The register bit names below may not correspond to the 503 ret = arch_pwrdm->pwrdm_set_logic_retst(pwrdm, pwrst);
527 * actual names of the bits in each powerdomain's register,
528 * but the type of value returned is the same for each
529 * powerdomain.
530 */
531 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
532 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
533 pwrdm->prcm_offs, pwrstctrl_reg_offs);
534 504
535 return 0; 505 return ret;
536} 506}
537 507
538/** 508/**
@@ -552,7 +522,7 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
552 */ 522 */
553int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) 523int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
554{ 524{
555 u32 m; 525 int ret = -EINVAL;
556 526
557 if (!pwrdm) 527 if (!pwrdm)
558 return -EINVAL; 528 return -EINVAL;
@@ -566,37 +536,10 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
566 pr_debug("powerdomain: setting next memory powerstate for domain %s " 536 pr_debug("powerdomain: setting next memory powerstate for domain %s "
567 "bank %0x while pwrdm-ON to %0x\n", pwrdm->name, bank, pwrst); 537 "bank %0x while pwrdm-ON to %0x\n", pwrdm->name, bank, pwrst);
568 538
569 /* 539 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_onst)
570 * The register bit names below may not correspond to the 540 ret = arch_pwrdm->pwrdm_set_mem_onst(pwrdm, bank, pwrst);
571 * actual names of the bits in each powerdomain's register,
572 * but the type of value returned is the same for each
573 * powerdomain.
574 */
575 switch (bank) {
576 case 0:
577 m = OMAP_MEM0_ONSTATE_MASK;
578 break;
579 case 1:
580 m = OMAP_MEM1_ONSTATE_MASK;
581 break;
582 case 2:
583 m = OMAP_MEM2_ONSTATE_MASK;
584 break;
585 case 3:
586 m = OMAP_MEM3_ONSTATE_MASK;
587 break;
588 case 4:
589 m = OMAP_MEM4_ONSTATE_MASK;
590 break;
591 default:
592 WARN_ON(1); /* should never happen */
593 return -EEXIST;
594 }
595 541
596 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), 542 return ret;
597 pwrdm->prcm_offs, pwrstctrl_reg_offs);
598
599 return 0;
600} 543}
601 544
602/** 545/**
@@ -617,7 +560,7 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
617 */ 560 */
618int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) 561int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
619{ 562{
620 u32 m; 563 int ret = -EINVAL;
621 564
622 if (!pwrdm) 565 if (!pwrdm)
623 return -EINVAL; 566 return -EINVAL;
@@ -631,37 +574,10 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
631 pr_debug("powerdomain: setting next memory powerstate for domain %s " 574 pr_debug("powerdomain: setting next memory powerstate for domain %s "
632 "bank %0x while pwrdm-RET to %0x\n", pwrdm->name, bank, pwrst); 575 "bank %0x while pwrdm-RET to %0x\n", pwrdm->name, bank, pwrst);
633 576
634 /* 577 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_retst)
635 * The register bit names below may not correspond to the 578 ret = arch_pwrdm->pwrdm_set_mem_retst(pwrdm, bank, pwrst);
636 * actual names of the bits in each powerdomain's register,
637 * but the type of value returned is the same for each
638 * powerdomain.
639 */
640 switch (bank) {
641 case 0:
642 m = OMAP_MEM0_RETSTATE_MASK;
643 break;
644 case 1:
645 m = OMAP_MEM1_RETSTATE_MASK;
646 break;
647 case 2:
648 m = OMAP_MEM2_RETSTATE_MASK;
649 break;
650 case 3:
651 m = OMAP_MEM3_RETSTATE_MASK;
652 break;
653 case 4:
654 m = OMAP_MEM4_RETSTATE_MASK;
655 break;
656 default:
657 WARN_ON(1); /* should never happen */
658 return -EEXIST;
659 }
660
661 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
662 pwrstctrl_reg_offs);
663 579
664 return 0; 580 return ret;
665} 581}
666 582
667/** 583/**
@@ -675,11 +591,15 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
675 */ 591 */
676int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) 592int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
677{ 593{
594 int ret = -EINVAL;
595
678 if (!pwrdm) 596 if (!pwrdm)
679 return -EINVAL; 597 return -EINVAL;
680 598
681 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstst_reg_offs, 599 if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_pwrst)
682 OMAP3430_LOGICSTATEST_MASK); 600 ret = arch_pwrdm->pwrdm_read_logic_pwrst(pwrdm);
601
602 return ret;
683} 603}
684 604
685/** 605/**
@@ -692,17 +612,15 @@ int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
692 */ 612 */
693int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) 613int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
694{ 614{
615 int ret = -EINVAL;
616
695 if (!pwrdm) 617 if (!pwrdm)
696 return -EINVAL; 618 return -EINVAL;
697 619
698 /* 620 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_logic_pwrst)
699 * The register bit names below may not correspond to the 621 ret = arch_pwrdm->pwrdm_read_prev_logic_pwrst(pwrdm);
700 * actual names of the bits in each powerdomain's register, 622
701 * but the type of value returned is the same for each 623 return ret;
702 * powerdomain.
703 */
704 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
705 OMAP3430_LASTLOGICSTATEENTERED_MASK);
706} 624}
707 625
708/** 626/**
@@ -715,17 +633,15 @@ int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
715 */ 633 */
716int pwrdm_read_logic_retst(struct powerdomain *pwrdm) 634int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
717{ 635{
636 int ret = -EINVAL;
637
718 if (!pwrdm) 638 if (!pwrdm)
719 return -EINVAL; 639 return -EINVAL;
720 640
721 /* 641 if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_retst)
722 * The register bit names below may not correspond to the 642 ret = arch_pwrdm->pwrdm_read_logic_retst(pwrdm);
723 * actual names of the bits in each powerdomain's register, 643
724 * but the type of value returned is the same for each 644 return ret;
725 * powerdomain.
726 */
727 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs,
728 OMAP3430_LOGICSTATEST_MASK);
729} 645}
730 646
731/** 647/**
@@ -740,46 +656,21 @@ int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
740 */ 656 */
741int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank) 657int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
742{ 658{
743 u32 m; 659 int ret = -EINVAL;
744 660
745 if (!pwrdm) 661 if (!pwrdm)
746 return -EINVAL; 662 return ret;
747 663
748 if (pwrdm->banks < (bank + 1)) 664 if (pwrdm->banks < (bank + 1))
749 return -EEXIST; 665 return ret;
750 666
751 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK) 667 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
752 bank = 1; 668 bank = 1;
753 669
754 /* 670 if (arch_pwrdm && arch_pwrdm->pwrdm_read_mem_pwrst)
755 * The register bit names below may not correspond to the 671 ret = arch_pwrdm->pwrdm_read_mem_pwrst(pwrdm, bank);
756 * actual names of the bits in each powerdomain's register,
757 * but the type of value returned is the same for each
758 * powerdomain.
759 */
760 switch (bank) {
761 case 0:
762 m = OMAP_MEM0_STATEST_MASK;
763 break;
764 case 1:
765 m = OMAP_MEM1_STATEST_MASK;
766 break;
767 case 2:
768 m = OMAP_MEM2_STATEST_MASK;
769 break;
770 case 3:
771 m = OMAP_MEM3_STATEST_MASK;
772 break;
773 case 4:
774 m = OMAP_MEM4_STATEST_MASK;
775 break;
776 default:
777 WARN_ON(1); /* should never happen */
778 return -EEXIST;
779 }
780 672
781 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 673 return ret;
782 pwrstst_reg_offs, m);
783} 674}
784 675
785/** 676/**
@@ -795,43 +686,21 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
795 */ 686 */
796int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank) 687int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
797{ 688{
798 u32 m; 689 int ret = -EINVAL;
799 690
800 if (!pwrdm) 691 if (!pwrdm)
801 return -EINVAL; 692 return ret;
802 693
803 if (pwrdm->banks < (bank + 1)) 694 if (pwrdm->banks < (bank + 1))
804 return -EEXIST; 695 return ret;
805 696
806 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK) 697 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
807 bank = 1; 698 bank = 1;
808 699
809 /* 700 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_mem_pwrst)
810 * The register bit names below may not correspond to the 701 ret = arch_pwrdm->pwrdm_read_prev_mem_pwrst(pwrdm, bank);
811 * actual names of the bits in each powerdomain's register,
812 * but the type of value returned is the same for each
813 * powerdomain.
814 */
815 switch (bank) {
816 case 0:
817 m = OMAP3430_LASTMEM1STATEENTERED_MASK;
818 break;
819 case 1:
820 m = OMAP3430_LASTMEM2STATEENTERED_MASK;
821 break;
822 case 2:
823 m = OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK;
824 break;
825 case 3:
826 m = OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK;
827 break;
828 default:
829 WARN_ON(1); /* should never happen */
830 return -EEXIST;
831 }
832 702
833 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 703 return ret;
834 OMAP3430_PM_PREPWSTST, m);
835} 704}
836 705
837/** 706/**
@@ -846,43 +715,18 @@ int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
846 */ 715 */
847int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank) 716int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
848{ 717{
849 u32 m; 718 int ret = -EINVAL;
850 719
851 if (!pwrdm) 720 if (!pwrdm)
852 return -EINVAL; 721 return ret;
853 722
854 if (pwrdm->banks < (bank + 1)) 723 if (pwrdm->banks < (bank + 1))
855 return -EEXIST; 724 return ret;
856 725
857 /* 726 if (arch_pwrdm && arch_pwrdm->pwrdm_read_mem_retst)
858 * The register bit names below may not correspond to the 727 ret = arch_pwrdm->pwrdm_read_mem_retst(pwrdm, bank);
859 * actual names of the bits in each powerdomain's register,
860 * but the type of value returned is the same for each
861 * powerdomain.
862 */
863 switch (bank) {
864 case 0:
865 m = OMAP_MEM0_RETSTATE_MASK;
866 break;
867 case 1:
868 m = OMAP_MEM1_RETSTATE_MASK;
869 break;
870 case 2:
871 m = OMAP_MEM2_RETSTATE_MASK;
872 break;
873 case 3:
874 m = OMAP_MEM3_RETSTATE_MASK;
875 break;
876 case 4:
877 m = OMAP_MEM4_RETSTATE_MASK;
878 break;
879 default:
880 WARN_ON(1); /* should never happen */
881 return -EEXIST;
882 }
883 728
884 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 729 return ret;
885 pwrstctrl_reg_offs, m);
886} 730}
887 731
888/** 732/**
@@ -896,8 +740,10 @@ int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
896 */ 740 */
897int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) 741int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
898{ 742{
743 int ret = -EINVAL;
744
899 if (!pwrdm) 745 if (!pwrdm)
900 return -EINVAL; 746 return ret;
901 747
902 /* 748 /*
903 * XXX should get the powerdomain's current state here; 749 * XXX should get the powerdomain's current state here;
@@ -907,9 +753,10 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
907 pr_debug("powerdomain: clearing previous power state reg for %s\n", 753 pr_debug("powerdomain: clearing previous power state reg for %s\n",
908 pwrdm->name); 754 pwrdm->name);
909 755
910 prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST); 756 if (arch_pwrdm && arch_pwrdm->pwrdm_clear_all_prev_pwrst)
757 ret = arch_pwrdm->pwrdm_clear_all_prev_pwrst(pwrdm);
911 758
912 return 0; 759 return ret;
913} 760}
914 761
915/** 762/**
@@ -925,19 +772,21 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
925 */ 772 */
926int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) 773int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
927{ 774{
775 int ret = -EINVAL;
776
928 if (!pwrdm) 777 if (!pwrdm)
929 return -EINVAL; 778 return ret;
930 779
931 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) 780 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR))
932 return -EINVAL; 781 return ret;
933 782
934 pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n", 783 pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n",
935 pwrdm->name); 784 pwrdm->name);
936 785
937 prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 786 if (arch_pwrdm && arch_pwrdm->pwrdm_enable_hdwr_sar)
938 pwrdm->prcm_offs, pwrstctrl_reg_offs); 787 ret = arch_pwrdm->pwrdm_enable_hdwr_sar(pwrdm);
939 788
940 return 0; 789 return ret;
941} 790}
942 791
943/** 792/**
@@ -953,19 +802,21 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
953 */ 802 */
954int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) 803int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
955{ 804{
805 int ret = -EINVAL;
806
956 if (!pwrdm) 807 if (!pwrdm)
957 return -EINVAL; 808 return ret;
958 809
959 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) 810 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR))
960 return -EINVAL; 811 return ret;
961 812
962 pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n", 813 pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n",
963 pwrdm->name); 814 pwrdm->name);
964 815
965 prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0, 816 if (arch_pwrdm && arch_pwrdm->pwrdm_disable_hdwr_sar)
966 pwrdm->prcm_offs, pwrstctrl_reg_offs); 817 ret = arch_pwrdm->pwrdm_disable_hdwr_sar(pwrdm);
967 818
968 return 0; 819 return ret;
969} 820}
970 821
971/** 822/**
@@ -992,6 +843,8 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
992 */ 843 */
993int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm) 844int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
994{ 845{
846 int ret = -EINVAL;
847
995 if (!pwrdm) 848 if (!pwrdm)
996 return -EINVAL; 849 return -EINVAL;
997 850
@@ -1001,11 +854,10 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
1001 pr_debug("powerdomain: %s: setting LOWPOWERSTATECHANGE bit\n", 854 pr_debug("powerdomain: %s: setting LOWPOWERSTATECHANGE bit\n",
1002 pwrdm->name); 855 pwrdm->name);
1003 856
1004 prm_rmw_mod_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK, 857 if (arch_pwrdm && arch_pwrdm->pwrdm_set_lowpwrstchange)
1005 (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT), 858 ret = arch_pwrdm->pwrdm_set_lowpwrstchange(pwrdm);
1006 pwrdm->prcm_offs, pwrstctrl_reg_offs);
1007 859
1008 return 0; 860 return ret;
1009} 861}
1010 862
1011/** 863/**
@@ -1020,32 +872,15 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
1020 */ 872 */
1021int pwrdm_wait_transition(struct powerdomain *pwrdm) 873int pwrdm_wait_transition(struct powerdomain *pwrdm)
1022{ 874{
1023 u32 c = 0; 875 int ret = -EINVAL;
1024 876
1025 if (!pwrdm) 877 if (!pwrdm)
1026 return -EINVAL; 878 return -EINVAL;
1027 879
1028 /* 880 if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition)
1029 * REVISIT: pwrdm_wait_transition() may be better implemented 881 ret = arch_pwrdm->pwrdm_wait_transition(pwrdm);
1030 * via a callback and a periodic timer check -- how long do we expect
1031 * powerdomain transitions to take?
1032 */
1033
1034 /* XXX Is this udelay() value meaningful? */
1035 while ((prm_read_mod_reg(pwrdm->prcm_offs, pwrstst_reg_offs) &
1036 OMAP_INTRANSITION_MASK) &&
1037 (c++ < PWRDM_TRANSITION_BAILOUT))
1038 udelay(1);
1039
1040 if (c > PWRDM_TRANSITION_BAILOUT) {
1041 printk(KERN_ERR "powerdomain: waited too long for "
1042 "powerdomain %s to complete transition\n", pwrdm->name);
1043 return -EAGAIN;
1044 }
1045
1046 pr_debug("powerdomain: completed transition in %d loops\n", c);
1047 882
1048 return 0; 883 return ret;
1049} 884}
1050 885
1051int pwrdm_state_switch(struct powerdomain *pwrdm) 886int pwrdm_state_switch(struct powerdomain *pwrdm)
@@ -1075,3 +910,31 @@ int pwrdm_post_transition(void)
1075 return 0; 910 return 0;
1076} 911}
1077 912
913/**
914 * pwrdm_get_context_loss_count - get powerdomain's context loss count
915 * @pwrdm: struct powerdomain * to wait for
916 *
917 * Context loss count is the sum of powerdomain off-mode counter, the
918 * logic off counter and the per-bank memory off counter. Returns 0
919 * (and WARNs) upon error, otherwise, returns the context loss count.
920 */
921u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
922{
923 int i, count;
924
925 if (!pwrdm) {
926 WARN(1, "powerdomain: %s: pwrdm is null\n", __func__);
927 return 0;
928 }
929
930 count = pwrdm->state_counter[PWRDM_POWER_OFF];
931 count += pwrdm->ret_logic_off_counter;
932
933 for (i = 0; i < pwrdm->banks; i++)
934 count += pwrdm->ret_mem_off_counter[i];
935
936 pr_debug("powerdomain: %s: context loss count = %u\n",
937 pwrdm->name, count);
938
939 return count;
940}
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 9ca420dcd2f8..c66431edfeb7 100644
--- a/arch/arm/plat-omap/include/plat/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -1,27 +1,29 @@
1/* 1/*
2 * OMAP2/3 powerdomain control 2 * OMAP2/3/4 powerdomain control
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * XXX This should be moved to the mach-omap2/ directory at the earliest
14 * opportunity.
12 */ 15 */
13 16
14#ifndef ASM_ARM_ARCH_OMAP_POWERDOMAIN 17#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H
15#define ASM_ARM_ARCH_OMAP_POWERDOMAIN 18#define __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H
16 19
17#include <linux/types.h> 20#include <linux/types.h>
18#include <linux/list.h> 21#include <linux/list.h>
19 22
20#include <asm/atomic.h> 23#include <linux/atomic.h>
21 24
22#include <plat/cpu.h> 25#include <plat/cpu.h>
23 26
24
25/* Powerdomain basic power states */ 27/* Powerdomain basic power states */
26#define PWRDM_POWER_OFF 0x0 28#define PWRDM_POWER_OFF 0x0
27#define PWRDM_POWER_RET 0x1 29#define PWRDM_POWER_RET 0x1
@@ -81,6 +83,7 @@ struct powerdomain;
81 * @name: Powerdomain name 83 * @name: Powerdomain name
82 * @omap_chip: represents the OMAP chip types containing this pwrdm 84 * @omap_chip: represents the OMAP chip types containing this pwrdm
83 * @prcm_offs: the address offset from CM_BASE/PRM_BASE 85 * @prcm_offs: the address offset from CM_BASE/PRM_BASE
86 * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs
84 * @pwrsts: Possible powerdomain power states 87 * @pwrsts: Possible powerdomain power states
85 * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION 88 * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION
86 * @flags: Powerdomain flags 89 * @flags: Powerdomain flags
@@ -93,6 +96,8 @@ struct powerdomain;
93 * @state_counter: 96 * @state_counter:
94 * @timer: 97 * @timer:
95 * @state_timer: 98 * @state_timer:
99 *
100 * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h.
96 */ 101 */
97struct powerdomain { 102struct powerdomain {
98 const char *name; 103 const char *name;
@@ -104,6 +109,7 @@ struct powerdomain {
104 const u8 banks; 109 const u8 banks;
105 const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; 110 const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS];
106 const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; 111 const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS];
112 const u8 prcm_partition;
107 struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; 113 struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS];
108 struct list_head node; 114 struct list_head node;
109 int state; 115 int state;
@@ -117,8 +123,50 @@ struct powerdomain {
117#endif 123#endif
118}; 124};
119 125
126/**
127 * struct pwrdm_ops - Arch specfic function implementations
128 * @pwrdm_set_next_pwrst: Set the target power state for a pd
129 * @pwrdm_read_next_pwrst: Read the target power state set for a pd
130 * @pwrdm_read_pwrst: Read the current power state of a pd
131 * @pwrdm_read_prev_pwrst: Read the prev power state entered by the pd
132 * @pwrdm_set_logic_retst: Set the logic state in RET for a pd
133 * @pwrdm_set_mem_onst: Set the Memory state in ON for a pd
134 * @pwrdm_set_mem_retst: Set the Memory state in RET for a pd
135 * @pwrdm_read_logic_pwrst: Read the current logic state of a pd
136 * @pwrdm_read_prev_logic_pwrst: Read the previous logic state entered by a pd
137 * @pwrdm_read_logic_retst: Read the logic state in RET for a pd
138 * @pwrdm_read_mem_pwrst: Read the current memory state of a pd
139 * @pwrdm_read_prev_mem_pwrst: Read the previous memory state entered by a pd
140 * @pwrdm_read_mem_retst: Read the memory state in RET for a pd
141 * @pwrdm_clear_all_prev_pwrst: Clear all previous power states logged for a pd
142 * @pwrdm_enable_hdwr_sar: Enable Hardware Save-Restore feature for the pd
143 * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd
144 * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep
145 * @pwrdm_wait_transition: Wait for a pd state transition to complete
146 */
147struct pwrdm_ops {
148 int (*pwrdm_set_next_pwrst)(struct powerdomain *pwrdm, u8 pwrst);
149 int (*pwrdm_read_next_pwrst)(struct powerdomain *pwrdm);
150 int (*pwrdm_read_pwrst)(struct powerdomain *pwrdm);
151 int (*pwrdm_read_prev_pwrst)(struct powerdomain *pwrdm);
152 int (*pwrdm_set_logic_retst)(struct powerdomain *pwrdm, u8 pwrst);
153 int (*pwrdm_set_mem_onst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst);
154 int (*pwrdm_set_mem_retst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst);
155 int (*pwrdm_read_logic_pwrst)(struct powerdomain *pwrdm);
156 int (*pwrdm_read_prev_logic_pwrst)(struct powerdomain *pwrdm);
157 int (*pwrdm_read_logic_retst)(struct powerdomain *pwrdm);
158 int (*pwrdm_read_mem_pwrst)(struct powerdomain *pwrdm, u8 bank);
159 int (*pwrdm_read_prev_mem_pwrst)(struct powerdomain *pwrdm, u8 bank);
160 int (*pwrdm_read_mem_retst)(struct powerdomain *pwrdm, u8 bank);
161 int (*pwrdm_clear_all_prev_pwrst)(struct powerdomain *pwrdm);
162 int (*pwrdm_enable_hdwr_sar)(struct powerdomain *pwrdm);
163 int (*pwrdm_disable_hdwr_sar)(struct powerdomain *pwrdm);
164 int (*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm);
165 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm);
166};
120 167
121void pwrdm_init(struct powerdomain **pwrdm_list); 168void pwrdm_fw_init(void);
169void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs);
122 170
123struct powerdomain *pwrdm_lookup(const char *name); 171struct powerdomain *pwrdm_lookup(const char *name);
124 172
@@ -163,5 +211,23 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm);
163int pwrdm_pre_transition(void); 211int pwrdm_pre_transition(void);
164int pwrdm_post_transition(void); 212int pwrdm_post_transition(void);
165int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); 213int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
214u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
215
216extern void omap2xxx_powerdomains_init(void);
217extern void omap3xxx_powerdomains_init(void);
218extern void omap44xx_powerdomains_init(void);
219
220extern struct pwrdm_ops omap2_pwrdm_operations;
221extern struct pwrdm_ops omap3_pwrdm_operations;
222extern struct pwrdm_ops omap4_pwrdm_operations;
223
224/* Common Internal functions used across OMAP rev's */
225extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank);
226extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank);
227extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
228
229extern struct powerdomain wkup_omap2_pwrdm;
230extern struct powerdomain gfx_omap2_pwrdm;
231
166 232
167#endif 233#endif
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
new file mode 100644
index 000000000000..d5233890370c
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
@@ -0,0 +1,242 @@
1/*
2 * OMAP2 and OMAP3 powerdomain control
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation
6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/io.h>
16#include <linux/errno.h>
17#include <linux/delay.h>
18
19#include <plat/prcm.h>
20
21#include "powerdomain.h"
22#include "prm-regbits-34xx.h"
23#include "prm.h"
24#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h"
26
27
28/* Common functions across OMAP2 and OMAP3 */
29static int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
30{
31 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
32 (pwrst << OMAP_POWERSTATE_SHIFT),
33 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
34 return 0;
35}
36
37static int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
38{
39 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
40 OMAP2_PM_PWSTCTRL,
41 OMAP_POWERSTATE_MASK);
42}
43
44static int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
45{
46 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
47 OMAP2_PM_PWSTST,
48 OMAP_POWERSTATEST_MASK);
49}
50
51static int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
52 u8 pwrst)
53{
54 u32 m;
55
56 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
57
58 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
59 OMAP2_PM_PWSTCTRL);
60
61 return 0;
62}
63
64static int omap2_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
65 u8 pwrst)
66{
67 u32 m;
68
69 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
70
71 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
72 OMAP2_PM_PWSTCTRL);
73
74 return 0;
75}
76
77static int omap2_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
78{
79 u32 m;
80
81 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
82
83 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
84 m);
85}
86
87static int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
88{
89 u32 m;
90
91 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
92
93 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
94 OMAP2_PM_PWSTCTRL, m);
95}
96
97static int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
98{
99 u32 v;
100
101 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
102 omap2_prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
103 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
104
105 return 0;
106}
107
108static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
109{
110 u32 c = 0;
111
112 /*
113 * REVISIT: pwrdm_wait_transition() may be better implemented
114 * via a callback and a periodic timer check -- how long do we expect
115 * powerdomain transitions to take?
116 */
117
118 /* XXX Is this udelay() value meaningful? */
119 while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
120 OMAP_INTRANSITION_MASK) &&
121 (c++ < PWRDM_TRANSITION_BAILOUT))
122 udelay(1);
123
124 if (c > PWRDM_TRANSITION_BAILOUT) {
125 printk(KERN_ERR "powerdomain: waited too long for "
126 "powerdomain %s to complete transition\n", pwrdm->name);
127 return -EAGAIN;
128 }
129
130 pr_debug("powerdomain: completed transition in %d loops\n", c);
131
132 return 0;
133}
134
135/* Applicable only for OMAP3. Not supported on OMAP2 */
136static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
137{
138 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
139 OMAP3430_PM_PREPWSTST,
140 OMAP3430_LASTPOWERSTATEENTERED_MASK);
141}
142
143static int omap3_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
144{
145 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
146 OMAP2_PM_PWSTST,
147 OMAP3430_LOGICSTATEST_MASK);
148}
149
150static int omap3_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
151{
152 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
153 OMAP2_PM_PWSTCTRL,
154 OMAP3430_LOGICSTATEST_MASK);
155}
156
157static int omap3_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
158{
159 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
160 OMAP3430_PM_PREPWSTST,
161 OMAP3430_LASTLOGICSTATEENTERED_MASK);
162}
163
164static int omap3_get_mem_bank_lastmemst_mask(u8 bank)
165{
166 switch (bank) {
167 case 0:
168 return OMAP3430_LASTMEM1STATEENTERED_MASK;
169 case 1:
170 return OMAP3430_LASTMEM2STATEENTERED_MASK;
171 case 2:
172 return OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK;
173 case 3:
174 return OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK;
175 default:
176 WARN_ON(1); /* should never happen */
177 return -EEXIST;
178 }
179 return 0;
180}
181
182static int omap3_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
183{
184 u32 m;
185
186 m = omap3_get_mem_bank_lastmemst_mask(bank);
187
188 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
189 OMAP3430_PM_PREPWSTST, m);
190}
191
192static int omap3_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
193{
194 omap2_prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST);
195 return 0;
196}
197
198static int omap3_pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
199{
200 return omap2_prm_rmw_mod_reg_bits(0,
201 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
202 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
203}
204
205static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
206{
207 return omap2_prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
208 0, pwrdm->prcm_offs,
209 OMAP2_PM_PWSTCTRL);
210}
211
212struct pwrdm_ops omap2_pwrdm_operations = {
213 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
214 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
215 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
216 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
217 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
218 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
219 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
220 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
221 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
222};
223
224struct pwrdm_ops omap3_pwrdm_operations = {
225 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
226 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
227 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
228 .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst,
229 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
230 .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
231 .pwrdm_read_logic_retst = omap3_pwrdm_read_logic_retst,
232 .pwrdm_read_prev_logic_pwrst = omap3_pwrdm_read_prev_logic_pwrst,
233 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
234 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
235 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
236 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
237 .pwrdm_read_prev_mem_pwrst = omap3_pwrdm_read_prev_mem_pwrst,
238 .pwrdm_clear_all_prev_pwrst = omap3_pwrdm_clear_all_prev_pwrst,
239 .pwrdm_enable_hdwr_sar = omap3_pwrdm_enable_hdwr_sar,
240 .pwrdm_disable_hdwr_sar = omap3_pwrdm_disable_hdwr_sar,
241 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
242};
diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c
new file mode 100644
index 000000000000..a7880af4b3d9
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain44xx.c
@@ -0,0 +1,225 @@
1/*
2 * OMAP4 powerdomain control
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation
6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/io.h>
16#include <linux/errno.h>
17#include <linux/delay.h>
18
19#include "powerdomain.h"
20#include <plat/prcm.h>
21#include "prm2xxx_3xxx.h"
22#include "prm44xx.h"
23#include "prminst44xx.h"
24#include "prm-regbits-44xx.h"
25
26static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
27{
28 omap4_prminst_rmw_inst_reg_bits(OMAP_POWERSTATE_MASK,
29 (pwrst << OMAP_POWERSTATE_SHIFT),
30 pwrdm->prcm_partition,
31 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
32 return 0;
33}
34
35static int omap4_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
36{
37 u32 v;
38
39 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
40 OMAP4_PM_PWSTCTRL);
41 v &= OMAP_POWERSTATE_MASK;
42 v >>= OMAP_POWERSTATE_SHIFT;
43
44 return v;
45}
46
47static int omap4_pwrdm_read_pwrst(struct powerdomain *pwrdm)
48{
49 u32 v;
50
51 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
52 OMAP4_PM_PWSTST);
53 v &= OMAP_POWERSTATEST_MASK;
54 v >>= OMAP_POWERSTATEST_SHIFT;
55
56 return v;
57}
58
59static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
60{
61 u32 v;
62
63 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
64 OMAP4_PM_PWSTST);
65 v &= OMAP4430_LASTPOWERSTATEENTERED_MASK;
66 v >>= OMAP4430_LASTPOWERSTATEENTERED_SHIFT;
67
68 return v;
69}
70
71static int omap4_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
72{
73 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK,
74 (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT),
75 pwrdm->prcm_partition,
76 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
77 return 0;
78}
79
80static int omap4_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
81{
82 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LASTPOWERSTATEENTERED_MASK,
83 OMAP4430_LASTPOWERSTATEENTERED_MASK,
84 pwrdm->prcm_partition,
85 pwrdm->prcm_offs, OMAP4_PM_PWSTST);
86 return 0;
87}
88
89static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
90{
91 u32 v;
92
93 v = pwrst << __ffs(OMAP4430_LOGICRETSTATE_MASK);
94 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOGICRETSTATE_MASK, v,
95 pwrdm->prcm_partition, pwrdm->prcm_offs,
96 OMAP4_PM_PWSTCTRL);
97
98 return 0;
99}
100
101static int omap4_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
102 u8 pwrst)
103{
104 u32 m;
105
106 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
107
108 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
109 pwrdm->prcm_partition, pwrdm->prcm_offs,
110 OMAP4_PM_PWSTCTRL);
111
112 return 0;
113}
114
115static int omap4_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
116 u8 pwrst)
117{
118 u32 m;
119
120 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
121
122 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
123 pwrdm->prcm_partition, pwrdm->prcm_offs,
124 OMAP4_PM_PWSTCTRL);
125
126 return 0;
127}
128
129static int omap4_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
130{
131 u32 v;
132
133 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
134 OMAP4_PM_PWSTST);
135 v &= OMAP4430_LOGICSTATEST_MASK;
136 v >>= OMAP4430_LOGICSTATEST_SHIFT;
137
138 return v;
139}
140
141static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
142{
143 u32 v;
144
145 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
146 OMAP4_PM_PWSTCTRL);
147 v &= OMAP4430_LOGICRETSTATE_MASK;
148 v >>= OMAP4430_LOGICRETSTATE_SHIFT;
149
150 return v;
151}
152
153static int omap4_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
154{
155 u32 m, v;
156
157 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
158
159 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
160 OMAP4_PM_PWSTST);
161 v &= m;
162 v >>= __ffs(m);
163
164 return v;
165}
166
167static int omap4_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
168{
169 u32 m, v;
170
171 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
172
173 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
174 OMAP4_PM_PWSTCTRL);
175 v &= m;
176 v >>= __ffs(m);
177
178 return v;
179}
180
181static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
182{
183 u32 c = 0;
184
185 /*
186 * REVISIT: pwrdm_wait_transition() may be better implemented
187 * via a callback and a periodic timer check -- how long do we expect
188 * powerdomain transitions to take?
189 */
190
191 /* XXX Is this udelay() value meaningful? */
192 while ((omap4_prminst_read_inst_reg(pwrdm->prcm_partition,
193 pwrdm->prcm_offs,
194 OMAP4_PM_PWSTST) &
195 OMAP_INTRANSITION_MASK) &&
196 (c++ < PWRDM_TRANSITION_BAILOUT))
197 udelay(1);
198
199 if (c > PWRDM_TRANSITION_BAILOUT) {
200 printk(KERN_ERR "powerdomain: waited too long for "
201 "powerdomain %s to complete transition\n", pwrdm->name);
202 return -EAGAIN;
203 }
204
205 pr_debug("powerdomain: completed transition in %d loops\n", c);
206
207 return 0;
208}
209
210struct pwrdm_ops omap4_pwrdm_operations = {
211 .pwrdm_set_next_pwrst = omap4_pwrdm_set_next_pwrst,
212 .pwrdm_read_next_pwrst = omap4_pwrdm_read_next_pwrst,
213 .pwrdm_read_pwrst = omap4_pwrdm_read_pwrst,
214 .pwrdm_read_prev_pwrst = omap4_pwrdm_read_prev_pwrst,
215 .pwrdm_set_lowpwrstchange = omap4_pwrdm_set_lowpwrstchange,
216 .pwrdm_clear_all_prev_pwrst = omap4_pwrdm_clear_all_prev_pwrst,
217 .pwrdm_set_logic_retst = omap4_pwrdm_set_logic_retst,
218 .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst,
219 .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst,
220 .pwrdm_read_mem_pwrst = omap4_pwrdm_read_mem_pwrst,
221 .pwrdm_read_mem_retst = omap4_pwrdm_read_mem_retst,
222 .pwrdm_set_mem_onst = omap4_pwrdm_set_mem_onst,
223 .pwrdm_set_mem_retst = omap4_pwrdm_set_mem_retst,
224 .pwrdm_wait_transition = omap4_pwrdm_wait_transition,
225};
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index 105cbcaefd3b..5b4dd971320a 100644
--- a/arch/arm/mach-omap2/powerdomains.h
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -2,10 +2,9 @@
2 * OMAP2/3 common powerdomain definitions 2 * OMAP2/3 common powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley, Jouni Högander
8 * Debugging and integration fixes by Jouni Högander
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -18,9 +17,6 @@
18 * Clock Domain Framework 17 * Clock Domain Framework
19 */ 18 */
20 19
21#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
22#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
23
24/* 20/*
25 * This file contains all of the powerdomains that have some element 21 * This file contains all of the powerdomains that have some element
26 * of software control for the OMAP24xx and OMAP34xx chips. 22 * of software control for the OMAP24xx and OMAP34xx chips.
@@ -49,24 +45,18 @@
49 * address offset is different between the C55 and C64 DSPs. 45 * address offset is different between the C55 and C64 DSPs.
50 */ 46 */
51 47
52#include <plat/powerdomain.h> 48#include "powerdomain.h"
53 49
54#include "prcm-common.h" 50#include "prcm-common.h"
55#include "prm.h" 51#include "prm.h"
56#include "cm.h"
57#include "powerdomains24xx.h"
58#include "powerdomains34xx.h"
59#include "powerdomains44xx.h"
60 52
61/* OMAP2/3-common powerdomains */ 53/* OMAP2/3-common powerdomains */
62 54
63#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
64
65/* 55/*
66 * The GFX powerdomain is not present on 3430ES2, but currently we do not 56 * The GFX powerdomain is not present on 3430ES2, but currently we do not
67 * have a macro to filter it out at compile-time. 57 * have a macro to filter it out at compile-time.
68 */ 58 */
69static struct powerdomain gfx_omap2_pwrdm = { 59struct powerdomain gfx_omap2_pwrdm = {
70 .name = "gfx_pwrdm", 60 .name = "gfx_pwrdm",
71 .prcm_offs = GFX_MOD, 61 .prcm_offs = GFX_MOD,
72 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | 62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
@@ -82,72 +72,8 @@ static struct powerdomain gfx_omap2_pwrdm = {
82 }, 72 },
83}; 73};
84 74
85static struct powerdomain wkup_omap2_pwrdm = { 75struct powerdomain wkup_omap2_pwrdm = {
86 .name = "wkup_pwrdm", 76 .name = "wkup_pwrdm",
87 .prcm_offs = WKUP_MOD, 77 .prcm_offs = WKUP_MOD,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
89}; 79};
90
91#endif
92
93
94/* As powerdomains are added or removed above, this list must also be changed */
95static struct powerdomain *powerdomains_omap[] __initdata = {
96
97#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
98 &wkup_omap2_pwrdm,
99 &gfx_omap2_pwrdm,
100#endif
101
102#ifdef CONFIG_ARCH_OMAP2
103 &dsp_pwrdm,
104 &mpu_24xx_pwrdm,
105 &core_24xx_pwrdm,
106#endif
107
108#ifdef CONFIG_ARCH_OMAP2430
109 &mdm_pwrdm,
110#endif
111
112#ifdef CONFIG_ARCH_OMAP3
113 &iva2_pwrdm,
114 &mpu_3xxx_pwrdm,
115 &neon_pwrdm,
116 &core_3xxx_pre_es3_1_pwrdm,
117 &core_3xxx_es3_1_pwrdm,
118 &cam_pwrdm,
119 &dss_pwrdm,
120 &per_pwrdm,
121 &emu_pwrdm,
122 &sgx_pwrdm,
123 &usbhost_pwrdm,
124 &dpll1_pwrdm,
125 &dpll2_pwrdm,
126 &dpll3_pwrdm,
127 &dpll4_pwrdm,
128 &dpll5_pwrdm,
129#endif
130
131#ifdef CONFIG_ARCH_OMAP4
132 &core_44xx_pwrdm,
133 &gfx_44xx_pwrdm,
134 &abe_44xx_pwrdm,
135 &dss_44xx_pwrdm,
136 &tesla_44xx_pwrdm,
137 &wkup_44xx_pwrdm,
138 &cpu0_44xx_pwrdm,
139 &cpu1_44xx_pwrdm,
140 &emu_44xx_pwrdm,
141 &mpu_44xx_pwrdm,
142 &ivahd_44xx_pwrdm,
143 &cam_44xx_pwrdm,
144 &l3init_44xx_pwrdm,
145 &l4per_44xx_pwrdm,
146 &always_on_core_44xx_pwrdm,
147 &cefuse_44xx_pwrdm,
148#endif
149 NULL
150};
151
152
153#endif
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
new file mode 100644
index 000000000000..fa311669d53d
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
@@ -0,0 +1,22 @@
1/*
2 * OMAP2/3 common powerdomains - prototypes
3 *
4 * Copyright (C) 2008 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 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_POWERDOMAINS2XXX_3XXX_DATA_H
15#define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
16
17#include "powerdomain.h"
18
19extern struct powerdomain gfx_omap2_pwrdm;
20extern struct powerdomain wkup_omap2_pwrdm;
21
22#endif
diff --git a/arch/arm/mach-omap2/powerdomains24xx.h b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index 775093add9b6..9b1a33500577 100644
--- a/arch/arm/mach-omap2/powerdomains24xx.h
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -1,37 +1,28 @@
1/* 1/*
2 * OMAP24XX powerdomain definitions 2 * OMAP2XXX powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley, Jouni Högander
8 * Debugging and integration fixes by Jouni Högander
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
13 */ 12 */
14 13
15#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS24XX 14#include <linux/kernel.h>
16#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS24XX 15#include <linux/init.h>
17 16
18/* 17#include "powerdomain.h"
19 * N.B. If powerdomains are added or removed from this file, update 18#include "powerdomains2xxx_3xxx_data.h"
20 * the array in mach-omap2/powerdomains.h.
21 */
22
23#include <plat/powerdomain.h>
24 19
25#include "prcm-common.h" 20#include "prcm-common.h"
26#include "prm.h" 21#include "prm2xxx_3xxx.h"
27#include "prm-regbits-24xx.h" 22#include "prm-regbits-24xx.h"
28#include "cm.h"
29#include "cm-regbits-24xx.h"
30 23
31/* 24XX powerdomains and dependencies */ 24/* 24XX powerdomains and dependencies */
32 25
33#ifdef CONFIG_ARCH_OMAP2
34
35/* Powerdomains */ 26/* Powerdomains */
36 27
37static struct powerdomain dsp_pwrdm = { 28static struct powerdomain dsp_pwrdm = {
@@ -82,9 +73,6 @@ static struct powerdomain core_24xx_pwrdm = {
82 }, 73 },
83}; 74};
84 75
85#endif /* CONFIG_ARCH_OMAP2 */
86
87
88 76
89/* 77/*
90 * 2430-specific powerdomains 78 * 2430-specific powerdomains
@@ -111,5 +99,25 @@ static struct powerdomain mdm_pwrdm = {
111 99
112#endif /* CONFIG_ARCH_OMAP2430 */ 100#endif /* CONFIG_ARCH_OMAP2430 */
113 101
102/* As powerdomains are added or removed above, this list must also be changed */
103static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
114 104
105 &wkup_omap2_pwrdm,
106 &gfx_omap2_pwrdm,
107
108#ifdef CONFIG_ARCH_OMAP2
109 &dsp_pwrdm,
110 &mpu_24xx_pwrdm,
111 &core_24xx_pwrdm,
115#endif 112#endif
113
114#ifdef CONFIG_ARCH_OMAP2430
115 &mdm_pwrdm,
116#endif
117 NULL
118};
119
120void __init omap2xxx_powerdomains_init(void)
121{
122 pwrdm_init(powerdomains_omap2xxx, &omap2_pwrdm_operations);
123}
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index fa904861668b..e1bec562625b 100644
--- a/arch/arm/mach-omap2/powerdomains34xx.h
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -4,28 +4,23 @@
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley, Jouni Högander
8 * Debugging and integration fixes by Jouni Högander
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
13 */ 12 */
14 13
15#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS34XX 14#include <linux/kernel.h>
16#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS34XX 15#include <linux/init.h>
17 16
18/* 17#include "powerdomain.h"
19 * N.B. If powerdomains are added or removed from this file, update 18#include "powerdomains2xxx_3xxx_data.h"
20 * the array in mach-omap2/powerdomains.h.
21 */
22
23#include <plat/powerdomain.h>
24 19
25#include "prcm-common.h" 20#include "prcm-common.h"
26#include "prm.h" 21#include "prm2xxx_3xxx.h"
27#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
28#include "cm.h" 23#include "cm2xxx_3xxx.h"
29#include "cm-regbits-34xx.h" 24#include "cm-regbits-34xx.h"
30 25
31/* 26/*
@@ -80,6 +75,10 @@ static struct powerdomain mpu_3xxx_pwrdm = {
80 * 3430s upto ES3.0 and 3630ES1.0. Hence this feature 75 * 3430s upto ES3.0 and 3630ES1.0. Hence this feature
81 * needs to be disabled on these chips. 76 * needs to be disabled on these chips.
82 * Refer: 3430 errata ID i459 and 3630 errata ID i579 77 * Refer: 3430 errata ID i459 and 3630 errata ID i579
78 *
79 * Note: setting the SAR flag could help for errata ID i478
80 * which applies to 3430 <= ES3.1, but since the SAR feature
81 * is broken, do not use it.
83 */ 82 */
84static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { 83static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
85 .name = "core_pwrdm", 84 .name = "core_pwrdm",
@@ -108,6 +107,10 @@ static struct powerdomain core_3xxx_es3_1_pwrdm = {
108 CHIP_GE_OMAP3630ES1_1), 107 CHIP_GE_OMAP3630ES1_1),
109 .pwrsts = PWRSTS_OFF_RET_ON, 108 .pwrsts = PWRSTS_OFF_RET_ON,
110 .pwrsts_logic_ret = PWRSTS_OFF_RET, 109 .pwrsts_logic_ret = PWRSTS_OFF_RET,
110 /*
111 * Setting the SAR flag for errata ID i478 which applies
112 * to 3430 <= ES3.1
113 */
111 .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */ 114 .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
112 .banks = 2, 115 .banks = 2,
113 .pwrsts_mem_ret = { 116 .pwrsts_mem_ret = {
@@ -252,8 +255,33 @@ static struct powerdomain dpll5_pwrdm = {
252 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 255 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
253}; 256};
254 257
258/* As powerdomains are added or removed above, this list must also be changed */
259static struct powerdomain *powerdomains_omap3xxx[] __initdata = {
255 260
256#endif /* CONFIG_ARCH_OMAP3 */ 261 &wkup_omap2_pwrdm,
262 &gfx_omap2_pwrdm,
263 &iva2_pwrdm,
264 &mpu_3xxx_pwrdm,
265 &neon_pwrdm,
266 &core_3xxx_pre_es3_1_pwrdm,
267 &core_3xxx_es3_1_pwrdm,
268 &cam_pwrdm,
269 &dss_pwrdm,
270 &per_pwrdm,
271 &emu_pwrdm,
272 &sgx_pwrdm,
273 &usbhost_pwrdm,
274 &dpll1_pwrdm,
275 &dpll2_pwrdm,
276 &dpll3_pwrdm,
277 &dpll4_pwrdm,
278 &dpll5_pwrdm,
279#endif
280 NULL
281};
257 282
258 283
259#endif 284void __init omap3xxx_powerdomains_init(void)
285{
286 pwrdm_init(powerdomains_omap3xxx, &omap3_pwrdm_operations);
287}
diff --git a/arch/arm/mach-omap2/powerdomains44xx.h b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 9c01b55d6102..26d7641076d7 100644
--- a/arch/arm/mach-omap2/powerdomains44xx.h
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -19,23 +19,22 @@
19 * published by the Free Software Foundation. 19 * published by the Free Software Foundation.
20 */ 20 */
21 21
22#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H 22#include <linux/kernel.h>
23#define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H 23#include <linux/init.h>
24 24
25#include <plat/powerdomain.h> 25#include "powerdomain.h"
26 26
27#include "prcm-common.h" 27#include "prcm-common.h"
28#include "cm.h" 28#include "prcm44xx.h"
29#include "cm-regbits-44xx.h"
30#include "prm.h"
31#include "prm-regbits-44xx.h" 29#include "prm-regbits-44xx.h"
32 30#include "prm44xx.h"
33#if defined(CONFIG_ARCH_OMAP4) 31#include "prcm_mpu44xx.h"
34 32
35/* core_44xx_pwrdm: CORE power domain */ 33/* core_44xx_pwrdm: CORE power domain */
36static struct powerdomain core_44xx_pwrdm = { 34static struct powerdomain core_44xx_pwrdm = {
37 .name = "core_pwrdm", 35 .name = "core_pwrdm",
38 .prcm_offs = OMAP4430_PRM_CORE_MOD, 36 .prcm_offs = OMAP4430_PRM_CORE_INST,
37 .prcm_partition = OMAP4430_PRM_PARTITION,
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
40 .pwrsts = PWRSTS_RET_ON, 39 .pwrsts = PWRSTS_RET_ON,
41 .pwrsts_logic_ret = PWRSTS_OFF_RET, 40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -60,7 +59,8 @@ static struct powerdomain core_44xx_pwrdm = {
60/* gfx_44xx_pwrdm: 3D accelerator power domain */ 59/* gfx_44xx_pwrdm: 3D accelerator power domain */
61static struct powerdomain gfx_44xx_pwrdm = { 60static struct powerdomain gfx_44xx_pwrdm = {
62 .name = "gfx_pwrdm", 61 .name = "gfx_pwrdm",
63 .prcm_offs = OMAP4430_PRM_GFX_MOD, 62 .prcm_offs = OMAP4430_PRM_GFX_INST,
63 .prcm_partition = OMAP4430_PRM_PARTITION,
64 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 64 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
65 .pwrsts = PWRSTS_OFF_ON, 65 .pwrsts = PWRSTS_OFF_ON,
66 .banks = 1, 66 .banks = 1,
@@ -76,7 +76,8 @@ static struct powerdomain gfx_44xx_pwrdm = {
76/* abe_44xx_pwrdm: Audio back end power domain */ 76/* abe_44xx_pwrdm: Audio back end power domain */
77static struct powerdomain abe_44xx_pwrdm = { 77static struct powerdomain abe_44xx_pwrdm = {
78 .name = "abe_pwrdm", 78 .name = "abe_pwrdm",
79 .prcm_offs = OMAP4430_PRM_ABE_MOD, 79 .prcm_offs = OMAP4430_PRM_ABE_INST,
80 .prcm_partition = OMAP4430_PRM_PARTITION,
80 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
81 .pwrsts = PWRSTS_OFF_RET_ON, 82 .pwrsts = PWRSTS_OFF_RET_ON,
82 .pwrsts_logic_ret = PWRDM_POWER_OFF, 83 .pwrsts_logic_ret = PWRDM_POWER_OFF,
@@ -95,7 +96,8 @@ static struct powerdomain abe_44xx_pwrdm = {
95/* dss_44xx_pwrdm: Display subsystem power domain */ 96/* dss_44xx_pwrdm: Display subsystem power domain */
96static struct powerdomain dss_44xx_pwrdm = { 97static struct powerdomain dss_44xx_pwrdm = {
97 .name = "dss_pwrdm", 98 .name = "dss_pwrdm",
98 .prcm_offs = OMAP4430_PRM_DSS_MOD, 99 .prcm_offs = OMAP4430_PRM_DSS_INST,
100 .prcm_partition = OMAP4430_PRM_PARTITION,
99 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
100 .pwrsts = PWRSTS_OFF_RET_ON, 102 .pwrsts = PWRSTS_OFF_RET_ON,
101 .pwrsts_logic_ret = PWRSTS_OFF, 103 .pwrsts_logic_ret = PWRSTS_OFF,
@@ -112,7 +114,8 @@ static struct powerdomain dss_44xx_pwrdm = {
112/* tesla_44xx_pwrdm: Tesla processor power domain */ 114/* tesla_44xx_pwrdm: Tesla processor power domain */
113static struct powerdomain tesla_44xx_pwrdm = { 115static struct powerdomain tesla_44xx_pwrdm = {
114 .name = "tesla_pwrdm", 116 .name = "tesla_pwrdm",
115 .prcm_offs = OMAP4430_PRM_TESLA_MOD, 117 .prcm_offs = OMAP4430_PRM_TESLA_INST,
118 .prcm_partition = OMAP4430_PRM_PARTITION,
116 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
117 .pwrsts = PWRSTS_OFF_RET_ON, 120 .pwrsts = PWRSTS_OFF_RET_ON,
118 .pwrsts_logic_ret = PWRSTS_OFF_RET, 121 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -133,7 +136,8 @@ static struct powerdomain tesla_44xx_pwrdm = {
133/* wkup_44xx_pwrdm: Wake-up power domain */ 136/* wkup_44xx_pwrdm: Wake-up power domain */
134static struct powerdomain wkup_44xx_pwrdm = { 137static struct powerdomain wkup_44xx_pwrdm = {
135 .name = "wkup_pwrdm", 138 .name = "wkup_pwrdm",
136 .prcm_offs = OMAP4430_PRM_WKUP_MOD, 139 .prcm_offs = OMAP4430_PRM_WKUP_INST,
140 .prcm_partition = OMAP4430_PRM_PARTITION,
137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 141 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
138 .pwrsts = PWRSTS_ON, 142 .pwrsts = PWRSTS_ON,
139 .banks = 1, 143 .banks = 1,
@@ -148,7 +152,8 @@ static struct powerdomain wkup_44xx_pwrdm = {
148/* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */ 152/* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */
149static struct powerdomain cpu0_44xx_pwrdm = { 153static struct powerdomain cpu0_44xx_pwrdm = {
150 .name = "cpu0_pwrdm", 154 .name = "cpu0_pwrdm",
151 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_MOD, 155 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST,
156 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
153 .pwrsts = PWRSTS_OFF_RET_ON, 158 .pwrsts = PWRSTS_OFF_RET_ON,
154 .pwrsts_logic_ret = PWRSTS_OFF_RET, 159 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -164,7 +169,8 @@ static struct powerdomain cpu0_44xx_pwrdm = {
164/* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */ 169/* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */
165static struct powerdomain cpu1_44xx_pwrdm = { 170static struct powerdomain cpu1_44xx_pwrdm = {
166 .name = "cpu1_pwrdm", 171 .name = "cpu1_pwrdm",
167 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_MOD, 172 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST,
173 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
168 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 174 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
169 .pwrsts = PWRSTS_OFF_RET_ON, 175 .pwrsts = PWRSTS_OFF_RET_ON,
170 .pwrsts_logic_ret = PWRSTS_OFF_RET, 176 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -180,7 +186,8 @@ static struct powerdomain cpu1_44xx_pwrdm = {
180/* emu_44xx_pwrdm: Emulation power domain */ 186/* emu_44xx_pwrdm: Emulation power domain */
181static struct powerdomain emu_44xx_pwrdm = { 187static struct powerdomain emu_44xx_pwrdm = {
182 .name = "emu_pwrdm", 188 .name = "emu_pwrdm",
183 .prcm_offs = OMAP4430_PRM_EMU_MOD, 189 .prcm_offs = OMAP4430_PRM_EMU_INST,
190 .prcm_partition = OMAP4430_PRM_PARTITION,
184 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
185 .pwrsts = PWRSTS_OFF_ON, 192 .pwrsts = PWRSTS_OFF_ON,
186 .banks = 1, 193 .banks = 1,
@@ -195,7 +202,8 @@ static struct powerdomain emu_44xx_pwrdm = {
195/* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */ 202/* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */
196static struct powerdomain mpu_44xx_pwrdm = { 203static struct powerdomain mpu_44xx_pwrdm = {
197 .name = "mpu_pwrdm", 204 .name = "mpu_pwrdm",
198 .prcm_offs = OMAP4430_PRM_MPU_MOD, 205 .prcm_offs = OMAP4430_PRM_MPU_INST,
206 .prcm_partition = OMAP4430_PRM_PARTITION,
199 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
200 .pwrsts = PWRSTS_OFF_RET_ON, 208 .pwrsts = PWRSTS_OFF_RET_ON,
201 .pwrsts_logic_ret = PWRSTS_OFF_RET, 209 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -215,7 +223,8 @@ static struct powerdomain mpu_44xx_pwrdm = {
215/* ivahd_44xx_pwrdm: IVA-HD power domain */ 223/* ivahd_44xx_pwrdm: IVA-HD power domain */
216static struct powerdomain ivahd_44xx_pwrdm = { 224static struct powerdomain ivahd_44xx_pwrdm = {
217 .name = "ivahd_pwrdm", 225 .name = "ivahd_pwrdm",
218 .prcm_offs = OMAP4430_PRM_IVAHD_MOD, 226 .prcm_offs = OMAP4430_PRM_IVAHD_INST,
227 .prcm_partition = OMAP4430_PRM_PARTITION,
219 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
220 .pwrsts = PWRSTS_OFF_RET_ON, 229 .pwrsts = PWRSTS_OFF_RET_ON,
221 .pwrsts_logic_ret = PWRDM_POWER_OFF, 230 .pwrsts_logic_ret = PWRDM_POWER_OFF,
@@ -238,7 +247,8 @@ static struct powerdomain ivahd_44xx_pwrdm = {
238/* cam_44xx_pwrdm: Camera subsystem power domain */ 247/* cam_44xx_pwrdm: Camera subsystem power domain */
239static struct powerdomain cam_44xx_pwrdm = { 248static struct powerdomain cam_44xx_pwrdm = {
240 .name = "cam_pwrdm", 249 .name = "cam_pwrdm",
241 .prcm_offs = OMAP4430_PRM_CAM_MOD, 250 .prcm_offs = OMAP4430_PRM_CAM_INST,
251 .prcm_partition = OMAP4430_PRM_PARTITION,
242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
243 .pwrsts = PWRSTS_OFF_ON, 253 .pwrsts = PWRSTS_OFF_ON,
244 .banks = 1, 254 .banks = 1,
@@ -254,9 +264,10 @@ static struct powerdomain cam_44xx_pwrdm = {
254/* l3init_44xx_pwrdm: L3 initators pheripherals power domain */ 264/* l3init_44xx_pwrdm: L3 initators pheripherals power domain */
255static struct powerdomain l3init_44xx_pwrdm = { 265static struct powerdomain l3init_44xx_pwrdm = {
256 .name = "l3init_pwrdm", 266 .name = "l3init_pwrdm",
257 .prcm_offs = OMAP4430_PRM_L3INIT_MOD, 267 .prcm_offs = OMAP4430_PRM_L3INIT_INST,
268 .prcm_partition = OMAP4430_PRM_PARTITION,
258 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 269 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
259 .pwrsts = PWRSTS_OFF_RET_ON, 270 .pwrsts = PWRSTS_RET_ON,
260 .pwrsts_logic_ret = PWRSTS_OFF_RET, 271 .pwrsts_logic_ret = PWRSTS_OFF_RET,
261 .banks = 1, 272 .banks = 1,
262 .pwrsts_mem_ret = { 273 .pwrsts_mem_ret = {
@@ -271,9 +282,10 @@ static struct powerdomain l3init_44xx_pwrdm = {
271/* l4per_44xx_pwrdm: Target peripherals power domain */ 282/* l4per_44xx_pwrdm: Target peripherals power domain */
272static struct powerdomain l4per_44xx_pwrdm = { 283static struct powerdomain l4per_44xx_pwrdm = {
273 .name = "l4per_pwrdm", 284 .name = "l4per_pwrdm",
274 .prcm_offs = OMAP4430_PRM_L4PER_MOD, 285 .prcm_offs = OMAP4430_PRM_L4PER_INST,
286 .prcm_partition = OMAP4430_PRM_PARTITION,
275 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 287 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
276 .pwrsts = PWRSTS_OFF_RET_ON, 288 .pwrsts = PWRSTS_RET_ON,
277 .pwrsts_logic_ret = PWRSTS_OFF_RET, 289 .pwrsts_logic_ret = PWRSTS_OFF_RET,
278 .banks = 2, 290 .banks = 2,
279 .pwrsts_mem_ret = { 291 .pwrsts_mem_ret = {
@@ -293,7 +305,8 @@ static struct powerdomain l4per_44xx_pwrdm = {
293 */ 305 */
294static struct powerdomain always_on_core_44xx_pwrdm = { 306static struct powerdomain always_on_core_44xx_pwrdm = {
295 .name = "always_on_core_pwrdm", 307 .name = "always_on_core_pwrdm",
296 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_MOD, 308 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST,
309 .prcm_partition = OMAP4430_PRM_PARTITION,
297 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
298 .pwrsts = PWRSTS_ON, 311 .pwrsts = PWRSTS_ON,
299}; 312};
@@ -301,7 +314,8 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
301/* cefuse_44xx_pwrdm: Customer efuse controller power domain */ 314/* cefuse_44xx_pwrdm: Customer efuse controller power domain */
302static struct powerdomain cefuse_44xx_pwrdm = { 315static struct powerdomain cefuse_44xx_pwrdm = {
303 .name = "cefuse_pwrdm", 316 .name = "cefuse_pwrdm",
304 .prcm_offs = OMAP4430_PRM_CEFUSE_MOD, 317 .prcm_offs = OMAP4430_PRM_CEFUSE_INST,
318 .prcm_partition = OMAP4430_PRM_PARTITION,
305 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
306 .pwrsts = PWRSTS_OFF_ON, 320 .pwrsts = PWRSTS_OFF_ON,
307}; 321};
@@ -314,6 +328,28 @@ static struct powerdomain cefuse_44xx_pwrdm = {
314 * stdefuse 328 * stdefuse
315 */ 329 */
316 330
317#endif 331/* As powerdomains are added or removed above, this list must also be changed */
332static struct powerdomain *powerdomains_omap44xx[] __initdata = {
333 &core_44xx_pwrdm,
334 &gfx_44xx_pwrdm,
335 &abe_44xx_pwrdm,
336 &dss_44xx_pwrdm,
337 &tesla_44xx_pwrdm,
338 &wkup_44xx_pwrdm,
339 &cpu0_44xx_pwrdm,
340 &cpu1_44xx_pwrdm,
341 &emu_44xx_pwrdm,
342 &mpu_44xx_pwrdm,
343 &ivahd_44xx_pwrdm,
344 &cam_44xx_pwrdm,
345 &l3init_44xx_pwrdm,
346 &l4per_44xx_pwrdm,
347 &always_on_core_44xx_pwrdm,
348 &cefuse_44xx_pwrdm,
349 NULL
350};
318 351
319#endif 352void __init omap44xx_powerdomains_init(void)
353{
354 pwrdm_init(powerdomains_omap44xx, &omap4_pwrdm_operations);
355}
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index f81acee4738d..87486f559784 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -8,15 +8,12 @@
8 * Copyright (C) 2007-2009 Nokia Corporation 8 * Copyright (C) 2007-2009 Nokia Corporation
9 * 9 *
10 * Written by Paul Walmsley 10 * Written by Paul Walmsley
11 * OMAP4 defines in this file are automatically generated from the OMAP hardware
12 * databases.
13 * 11 *
14 * 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
15 * 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
16 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
17 */ 15 */
18 16
19
20/* Module offsets from both CM_BASE & PRM_BASE */ 17/* Module offsets from both CM_BASE & PRM_BASE */
21 18
22/* 19/*
@@ -51,75 +48,6 @@
51#define OMAP3430_NEON_MOD 0xb00 48#define OMAP3430_NEON_MOD 0xb00
52#define OMAP3430ES2_USBHOST_MOD 0xc00 49#define OMAP3430ES2_USBHOST_MOD 0xc00
53 50
54#define BITS(n_bit) \
55 (((1 << n_bit) - 1) | (1 << n_bit))
56
57#define BITFIELD(l_bit, u_bit) \
58 (BITS(u_bit) & ~((BITS(l_bit)) >> 1))
59
60/* OMAP44XX specific module offsets */
61
62/* CM1 instances */
63
64#define OMAP4430_CM1_OCP_SOCKET_MOD 0x0000
65#define OMAP4430_CM1_CKGEN_MOD 0x0100
66#define OMAP4430_CM1_MPU_MOD 0x0300
67#define OMAP4430_CM1_TESLA_MOD 0x0400
68#define OMAP4430_CM1_ABE_MOD 0x0500
69#define OMAP4430_CM1_RESTORE_MOD 0x0e00
70#define OMAP4430_CM1_INSTR_MOD 0x0f00
71
72/* CM2 instances */
73
74#define OMAP4430_CM2_OCP_SOCKET_MOD 0x0000
75#define OMAP4430_CM2_CKGEN_MOD 0x0100
76#define OMAP4430_CM2_ALWAYS_ON_MOD 0x0600
77#define OMAP4430_CM2_CORE_MOD 0x0700
78#define OMAP4430_CM2_IVAHD_MOD 0x0f00
79#define OMAP4430_CM2_CAM_MOD 0x1000
80#define OMAP4430_CM2_DSS_MOD 0x1100
81#define OMAP4430_CM2_GFX_MOD 0x1200
82#define OMAP4430_CM2_L3INIT_MOD 0x1300
83#define OMAP4430_CM2_L4PER_MOD 0x1400
84#define OMAP4430_CM2_CEFUSE_MOD 0x1600
85#define OMAP4430_CM2_RESTORE_MOD 0x1e00
86#define OMAP4430_CM2_INSTR_MOD 0x1f00
87
88/* PRM instances */
89
90#define OMAP4430_PRM_OCP_SOCKET_MOD 0x0000
91#define OMAP4430_PRM_CKGEN_MOD 0x0100
92#define OMAP4430_PRM_MPU_MOD 0x0300
93#define OMAP4430_PRM_TESLA_MOD 0x0400
94#define OMAP4430_PRM_ABE_MOD 0x0500
95#define OMAP4430_PRM_ALWAYS_ON_MOD 0x0600
96#define OMAP4430_PRM_CORE_MOD 0x0700
97#define OMAP4430_PRM_IVAHD_MOD 0x0f00
98#define OMAP4430_PRM_CAM_MOD 0x1000
99#define OMAP4430_PRM_DSS_MOD 0x1100
100#define OMAP4430_PRM_GFX_MOD 0x1200
101#define OMAP4430_PRM_L3INIT_MOD 0x1300
102#define OMAP4430_PRM_L4PER_MOD 0x1400
103#define OMAP4430_PRM_CEFUSE_MOD 0x1600
104#define OMAP4430_PRM_WKUP_MOD 0x1700
105#define OMAP4430_PRM_WKUP_CM_MOD 0x1800
106#define OMAP4430_PRM_EMU_MOD 0x1900
107#define OMAP4430_PRM_EMU_CM_MOD 0x1a00
108#define OMAP4430_PRM_DEVICE_MOD 0x1b00
109#define OMAP4430_PRM_INSTR_MOD 0x1f00
110
111/* SCRM instances */
112
113#define OMAP4430_SCRM_SCRM_MOD 0x0000
114
115/* PRCM_MPU instances */
116
117#define OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD 0x0000
118#define OMAP4430_PRCM_MPU_DEVICE_PRM_MOD 0x0200
119#define OMAP4430_PRCM_MPU_CPU0_MOD 0x0400
120#define OMAP4430_PRCM_MPU_CPU1_MOD 0x0800
121
122
123/* 24XX register bits shared between CM & PRM registers */ 51/* 24XX register bits shared between CM & PRM registers */
124 52
125/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ 53/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
@@ -461,5 +389,18 @@
461#define OMAP3430_EN_CORE_SHIFT 0 389#define OMAP3430_EN_CORE_SHIFT 0
462#define OMAP3430_EN_CORE_MASK (1 << 0) 390#define OMAP3430_EN_CORE_MASK (1 << 0)
463 391
392
393/*
394 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
395 * submodule to exit hardreset
396 */
397#define MAX_MODULE_HARDRESET_WAIT 10000
398
399# ifndef __ASSEMBLER__
400extern void __iomem *prm_base;
401extern void __iomem *cm_base;
402extern void __iomem *cm2_base;
403# endif
404
464#endif 405#endif
465 406
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index a51846e3a6fa..679bcd28576e 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -17,7 +17,8 @@
17 * it under the terms of the GNU General Public License version 2 as 17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation. 18 * published by the Free Software Foundation.
19 */ 19 */
20#include <linux/module.h> 20
21#include <linux/kernel.h>
21#include <linux/init.h> 22#include <linux/init.h>
22#include <linux/clk.h> 23#include <linux/clk.h>
23#include <linux/io.h> 24#include <linux/io.h>
@@ -29,105 +30,27 @@
29 30
30#include "clock.h" 31#include "clock.h"
31#include "clock2xxx.h" 32#include "clock2xxx.h"
32#include "cm.h" 33#include "cm2xxx_3xxx.h"
33#include "prm.h" 34#include "prm2xxx_3xxx.h"
35#include "prm44xx.h"
36#include "prminst44xx.h"
34#include "prm-regbits-24xx.h" 37#include "prm-regbits-24xx.h"
35#include "prm-regbits-44xx.h" 38#include "prm-regbits-44xx.h"
36#include "control.h" 39#include "control.h"
37 40
38static void __iomem *prm_base; 41void __iomem *prm_base;
39static void __iomem *cm_base; 42void __iomem *cm_base;
40static void __iomem *cm2_base; 43void __iomem *cm2_base;
41 44
42#define MAX_MODULE_ENABLE_WAIT 100000 45#define MAX_MODULE_ENABLE_WAIT 100000
43 46
44struct omap3_prcm_regs {
45 u32 control_padconf_sys_nirq;
46 u32 iva2_cm_clksel1;
47 u32 iva2_cm_clksel2;
48 u32 cm_sysconfig;
49 u32 sgx_cm_clksel;
50 u32 dss_cm_clksel;
51 u32 cam_cm_clksel;
52 u32 per_cm_clksel;
53 u32 emu_cm_clksel;
54 u32 emu_cm_clkstctrl;
55 u32 pll_cm_autoidle2;
56 u32 pll_cm_clksel4;
57 u32 pll_cm_clksel5;
58 u32 pll_cm_clken2;
59 u32 cm_polctrl;
60 u32 iva2_cm_fclken;
61 u32 iva2_cm_clken_pll;
62 u32 core_cm_fclken1;
63 u32 core_cm_fclken3;
64 u32 sgx_cm_fclken;
65 u32 wkup_cm_fclken;
66 u32 dss_cm_fclken;
67 u32 cam_cm_fclken;
68 u32 per_cm_fclken;
69 u32 usbhost_cm_fclken;
70 u32 core_cm_iclken1;
71 u32 core_cm_iclken2;
72 u32 core_cm_iclken3;
73 u32 sgx_cm_iclken;
74 u32 wkup_cm_iclken;
75 u32 dss_cm_iclken;
76 u32 cam_cm_iclken;
77 u32 per_cm_iclken;
78 u32 usbhost_cm_iclken;
79 u32 iva2_cm_autiidle2;
80 u32 mpu_cm_autoidle2;
81 u32 iva2_cm_clkstctrl;
82 u32 mpu_cm_clkstctrl;
83 u32 core_cm_clkstctrl;
84 u32 sgx_cm_clkstctrl;
85 u32 dss_cm_clkstctrl;
86 u32 cam_cm_clkstctrl;
87 u32 per_cm_clkstctrl;
88 u32 neon_cm_clkstctrl;
89 u32 usbhost_cm_clkstctrl;
90 u32 core_cm_autoidle1;
91 u32 core_cm_autoidle2;
92 u32 core_cm_autoidle3;
93 u32 wkup_cm_autoidle;
94 u32 dss_cm_autoidle;
95 u32 cam_cm_autoidle;
96 u32 per_cm_autoidle;
97 u32 usbhost_cm_autoidle;
98 u32 sgx_cm_sleepdep;
99 u32 dss_cm_sleepdep;
100 u32 cam_cm_sleepdep;
101 u32 per_cm_sleepdep;
102 u32 usbhost_cm_sleepdep;
103 u32 cm_clkout_ctrl;
104 u32 prm_clkout_ctrl;
105 u32 sgx_pm_wkdep;
106 u32 dss_pm_wkdep;
107 u32 cam_pm_wkdep;
108 u32 per_pm_wkdep;
109 u32 neon_pm_wkdep;
110 u32 usbhost_pm_wkdep;
111 u32 core_pm_mpugrpsel1;
112 u32 iva2_pm_ivagrpsel1;
113 u32 core_pm_mpugrpsel3;
114 u32 core_pm_ivagrpsel3;
115 u32 wkup_pm_mpugrpsel;
116 u32 wkup_pm_ivagrpsel;
117 u32 per_pm_mpugrpsel;
118 u32 per_pm_ivagrpsel;
119 u32 wkup_pm_wken;
120};
121
122static struct omap3_prcm_regs prcm_context;
123
124u32 omap_prcm_get_reset_sources(void) 47u32 omap_prcm_get_reset_sources(void)
125{ 48{
126 /* XXX This presumably needs modification for 34XX */ 49 /* XXX This presumably needs modification for 34XX */
127 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 50 if (cpu_is_omap24xx() || cpu_is_omap34xx())
128 return prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f; 51 return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
129 if (cpu_is_omap44xx()) 52 if (cpu_is_omap44xx())
130 return prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f; 53 return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
131 54
132 return 0; 55 return 0;
133} 56}
@@ -143,126 +66,46 @@ void omap_prcm_arch_reset(char mode, const char *cmd)
143 66
144 prcm_offs = WKUP_MOD; 67 prcm_offs = WKUP_MOD;
145 } else if (cpu_is_omap34xx()) { 68 } else if (cpu_is_omap34xx()) {
146 u32 l;
147
148 prcm_offs = OMAP3430_GR_MOD; 69 prcm_offs = OMAP3430_GR_MOD;
149 l = ('B' << 24) | ('M' << 16) | (cmd ? (u8)*cmd : 0); 70 omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
150 /* Reserve the first word in scratchpad for communicating 71 } else if (cpu_is_omap44xx()) {
151 * with the boot ROM. A pointer to a data structure 72 omap4_prm_global_warm_sw_reset(); /* never returns */
152 * describing the boot process can be stored there, 73 } else {
153 * cf. OMAP34xx TRM, Initialization / Software Booting
154 * Configuration. */
155 omap_writel(l, OMAP343X_SCRATCHPAD + 4);
156 } else if (cpu_is_omap44xx())
157 prcm_offs = OMAP4430_PRM_DEVICE_MOD;
158 else
159 WARN_ON(1); 74 WARN_ON(1);
75 }
160 76
161 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 77 /*
162 prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs, 78 * As per Errata i520, in some cases, user will not be able to
163 OMAP2_RM_RSTCTRL); 79 * access DDR memory after warm-reset.
164 if (cpu_is_omap44xx()) 80 * This situation occurs while the warm-reset happens during a read
165 prm_set_mod_reg_bits(OMAP4430_RST_GLOBAL_WARM_SW_MASK, 81 * access to DDR memory. In that particular condition, DDR memory
166 prcm_offs, OMAP4_RM_RSTCTRL); 82 * does not respond to a corrupted read command due to the warm
167} 83 * reset occurrence but SDRC is waiting for read completion.
168 84 * SDRC is not sensitive to the warm reset, but the interconnect is
169static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) 85 * reset on the fly, thus causing a misalignment between SDRC logic,
170{ 86 * interconnect logic and DDR memory state.
171 BUG_ON(!base); 87 * WORKAROUND:
172 return __raw_readl(base + module + reg); 88 * Steps to perform before a Warm reset is trigged:
173} 89 * 1. enable self-refresh on idle request
174 90 * 2. put SDRC in idle
175static inline void __omap_prcm_write(u32 value, void __iomem *base, 91 * 3. wait until SDRC goes to idle
176 s16 module, u16 reg) 92 * 4. generate SW reset (Global SW reset)
177{ 93 *
178 BUG_ON(!base); 94 * Steps to be performed after warm reset occurs (in bootloader):
179 __raw_writel(value, base + module + reg); 95 * if HW warm reset is the source, apply below steps before any
180} 96 * accesses to SDRAM:
181 97 * 1. Reset SMS and SDRC and wait till reset is complete
182/* Read a register in a PRM module */ 98 * 2. Re-initialize SMS, SDRC and memory
183u32 prm_read_mod_reg(s16 module, u16 idx) 99 *
184{ 100 * NOTE: Above work around is required only if arch reset is implemented
185 return __omap_prcm_read(prm_base, module, idx); 101 * using Global SW reset(GLOBAL_SW_RST). DPLL3 reset does not need
186} 102 * the WA since it resets SDRC as well as part of cold reset.
187 103 */
188/* Write into a register in a PRM module */ 104
189void prm_write_mod_reg(u32 val, s16 module, u16 idx) 105 /* XXX should be moved to some OMAP2/3 specific code */
190{ 106 omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs,
191 __omap_prcm_write(val, prm_base, module, idx); 107 OMAP2_RM_RSTCTRL);
192} 108 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
193
194/* Read-modify-write a register in a PRM module. Caller must lock */
195u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
196{
197 u32 v;
198
199 v = prm_read_mod_reg(module, idx);
200 v &= ~mask;
201 v |= bits;
202 prm_write_mod_reg(v, module, idx);
203
204 return v;
205}
206
207/* Read a PRM register, AND it, and shift the result down to bit 0 */
208u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
209{
210 u32 v;
211
212 v = prm_read_mod_reg(domain, idx);
213 v &= mask;
214 v >>= __ffs(mask);
215
216 return v;
217}
218
219/* Read a PRM register, AND it, and shift the result down to bit 0 */
220u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
221{
222 u32 v;
223
224 v = __raw_readl(reg);
225 v &= mask;
226 v >>= __ffs(mask);
227
228 return v;
229}
230
231/* Read-modify-write a register in a PRM module. Caller must lock */
232u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
233{
234 u32 v;
235
236 v = __raw_readl(reg);
237 v &= ~mask;
238 v |= bits;
239 __raw_writel(v, reg);
240
241 return v;
242}
243/* Read a register in a CM module */
244u32 cm_read_mod_reg(s16 module, u16 idx)
245{
246 return __omap_prcm_read(cm_base, module, idx);
247}
248
249/* Write into a register in a CM module */
250void cm_write_mod_reg(u32 val, s16 module, u16 idx)
251{
252 __omap_prcm_write(val, cm_base, module, idx);
253}
254
255/* Read-modify-write a register in a CM module. Caller must lock */
256u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
257{
258 u32 v;
259
260 v = cm_read_mod_reg(module, idx);
261 v &= ~mask;
262 v |= bits;
263 cm_write_mod_reg(v, module, idx);
264
265 return v;
266} 109}
267 110
268/** 111/**
@@ -274,6 +117,9 @@ u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
274 * 117 *
275 * Returns 1 if the module indicated readiness in time, or 0 if it 118 * Returns 1 if the module indicated readiness in time, or 0 if it
276 * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. 119 * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds.
120 *
121 * XXX This function is deprecated. It should be removed once the
122 * hwmod conversion is complete.
277 */ 123 */
278int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, 124int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
279 const char *name) 125 const char *name)
@@ -316,303 +162,3 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
316 WARN_ON(!cm2_base); 162 WARN_ON(!cm2_base);
317 } 163 }
318} 164}
319
320#ifdef CONFIG_ARCH_OMAP3
321void omap3_prcm_save_context(void)
322{
323 prcm_context.control_padconf_sys_nirq =
324 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
325 prcm_context.iva2_cm_clksel1 =
326 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
327 prcm_context.iva2_cm_clksel2 =
328 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL2);
329 prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
330 prcm_context.sgx_cm_clksel =
331 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
332 prcm_context.dss_cm_clksel =
333 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
334 prcm_context.cam_cm_clksel =
335 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSEL);
336 prcm_context.per_cm_clksel =
337 cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSEL);
338 prcm_context.emu_cm_clksel =
339 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
340 prcm_context.emu_cm_clkstctrl =
341 cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
342 prcm_context.pll_cm_autoidle2 =
343 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
344 prcm_context.pll_cm_clksel4 =
345 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
346 prcm_context.pll_cm_clksel5 =
347 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
348 prcm_context.pll_cm_clken2 =
349 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
350 prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
351 prcm_context.iva2_cm_fclken =
352 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_FCLKEN);
353 prcm_context.iva2_cm_clken_pll = cm_read_mod_reg(OMAP3430_IVA2_MOD,
354 OMAP3430_CM_CLKEN_PLL);
355 prcm_context.core_cm_fclken1 =
356 cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
357 prcm_context.core_cm_fclken3 =
358 cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
359 prcm_context.sgx_cm_fclken =
360 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_FCLKEN);
361 prcm_context.wkup_cm_fclken =
362 cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
363 prcm_context.dss_cm_fclken =
364 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_FCLKEN);
365 prcm_context.cam_cm_fclken =
366 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_FCLKEN);
367 prcm_context.per_cm_fclken =
368 cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
369 prcm_context.usbhost_cm_fclken =
370 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
371 prcm_context.core_cm_iclken1 =
372 cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
373 prcm_context.core_cm_iclken2 =
374 cm_read_mod_reg(CORE_MOD, CM_ICLKEN2);
375 prcm_context.core_cm_iclken3 =
376 cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
377 prcm_context.sgx_cm_iclken =
378 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_ICLKEN);
379 prcm_context.wkup_cm_iclken =
380 cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
381 prcm_context.dss_cm_iclken =
382 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_ICLKEN);
383 prcm_context.cam_cm_iclken =
384 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_ICLKEN);
385 prcm_context.per_cm_iclken =
386 cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
387 prcm_context.usbhost_cm_iclken =
388 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
389 prcm_context.iva2_cm_autiidle2 =
390 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
391 prcm_context.mpu_cm_autoidle2 =
392 cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
393 prcm_context.iva2_cm_clkstctrl =
394 cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
395 prcm_context.mpu_cm_clkstctrl =
396 cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL);
397 prcm_context.core_cm_clkstctrl =
398 cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL);
399 prcm_context.sgx_cm_clkstctrl =
400 cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
401 OMAP2_CM_CLKSTCTRL);
402 prcm_context.dss_cm_clkstctrl =
403 cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL);
404 prcm_context.cam_cm_clkstctrl =
405 cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL);
406 prcm_context.per_cm_clkstctrl =
407 cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL);
408 prcm_context.neon_cm_clkstctrl =
409 cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL);
410 prcm_context.usbhost_cm_clkstctrl =
411 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
412 OMAP2_CM_CLKSTCTRL);
413 prcm_context.core_cm_autoidle1 =
414 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
415 prcm_context.core_cm_autoidle2 =
416 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE2);
417 prcm_context.core_cm_autoidle3 =
418 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE3);
419 prcm_context.wkup_cm_autoidle =
420 cm_read_mod_reg(WKUP_MOD, CM_AUTOIDLE);
421 prcm_context.dss_cm_autoidle =
422 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_AUTOIDLE);
423 prcm_context.cam_cm_autoidle =
424 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_AUTOIDLE);
425 prcm_context.per_cm_autoidle =
426 cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
427 prcm_context.usbhost_cm_autoidle =
428 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
429 prcm_context.sgx_cm_sleepdep =
430 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP3430_CM_SLEEPDEP);
431 prcm_context.dss_cm_sleepdep =
432 cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP3430_CM_SLEEPDEP);
433 prcm_context.cam_cm_sleepdep =
434 cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP3430_CM_SLEEPDEP);
435 prcm_context.per_cm_sleepdep =
436 cm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_CM_SLEEPDEP);
437 prcm_context.usbhost_cm_sleepdep =
438 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
439 prcm_context.cm_clkout_ctrl = cm_read_mod_reg(OMAP3430_CCR_MOD,
440 OMAP3_CM_CLKOUT_CTRL_OFFSET);
441 prcm_context.prm_clkout_ctrl = prm_read_mod_reg(OMAP3430_CCR_MOD,
442 OMAP3_PRM_CLKOUT_CTRL_OFFSET);
443 prcm_context.sgx_pm_wkdep =
444 prm_read_mod_reg(OMAP3430ES2_SGX_MOD, PM_WKDEP);
445 prcm_context.dss_pm_wkdep =
446 prm_read_mod_reg(OMAP3430_DSS_MOD, PM_WKDEP);
447 prcm_context.cam_pm_wkdep =
448 prm_read_mod_reg(OMAP3430_CAM_MOD, PM_WKDEP);
449 prcm_context.per_pm_wkdep =
450 prm_read_mod_reg(OMAP3430_PER_MOD, PM_WKDEP);
451 prcm_context.neon_pm_wkdep =
452 prm_read_mod_reg(OMAP3430_NEON_MOD, PM_WKDEP);
453 prcm_context.usbhost_pm_wkdep =
454 prm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
455 prcm_context.core_pm_mpugrpsel1 =
456 prm_read_mod_reg(CORE_MOD, OMAP3430_PM_MPUGRPSEL1);
457 prcm_context.iva2_pm_ivagrpsel1 =
458 prm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_PM_IVAGRPSEL1);
459 prcm_context.core_pm_mpugrpsel3 =
460 prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_MPUGRPSEL3);
461 prcm_context.core_pm_ivagrpsel3 =
462 prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
463 prcm_context.wkup_pm_mpugrpsel =
464 prm_read_mod_reg(WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
465 prcm_context.wkup_pm_ivagrpsel =
466 prm_read_mod_reg(WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
467 prcm_context.per_pm_mpugrpsel =
468 prm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
469 prcm_context.per_pm_ivagrpsel =
470 prm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
471 prcm_context.wkup_pm_wken = prm_read_mod_reg(WKUP_MOD, PM_WKEN);
472 return;
473}
474
475void omap3_prcm_restore_context(void)
476{
477 omap_ctrl_writel(prcm_context.control_padconf_sys_nirq,
478 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
479 cm_write_mod_reg(prcm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
480 CM_CLKSEL1);
481 cm_write_mod_reg(prcm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
482 CM_CLKSEL2);
483 __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
484 cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
485 CM_CLKSEL);
486 cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
487 CM_CLKSEL);
488 cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
489 CM_CLKSEL);
490 cm_write_mod_reg(prcm_context.per_cm_clksel, OMAP3430_PER_MOD,
491 CM_CLKSEL);
492 cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
493 CM_CLKSEL1);
494 cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
495 OMAP2_CM_CLKSTCTRL);
496 cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD,
497 CM_AUTOIDLE2);
498 cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD,
499 OMAP3430ES2_CM_CLKSEL4);
500 cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD,
501 OMAP3430ES2_CM_CLKSEL5);
502 cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD,
503 OMAP3430ES2_CM_CLKEN2);
504 __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
505 cm_write_mod_reg(prcm_context.iva2_cm_fclken, OMAP3430_IVA2_MOD,
506 CM_FCLKEN);
507 cm_write_mod_reg(prcm_context.iva2_cm_clken_pll, OMAP3430_IVA2_MOD,
508 OMAP3430_CM_CLKEN_PLL);
509 cm_write_mod_reg(prcm_context.core_cm_fclken1, CORE_MOD, CM_FCLKEN1);
510 cm_write_mod_reg(prcm_context.core_cm_fclken3, CORE_MOD,
511 OMAP3430ES2_CM_FCLKEN3);
512 cm_write_mod_reg(prcm_context.sgx_cm_fclken, OMAP3430ES2_SGX_MOD,
513 CM_FCLKEN);
514 cm_write_mod_reg(prcm_context.wkup_cm_fclken, WKUP_MOD, CM_FCLKEN);
515 cm_write_mod_reg(prcm_context.dss_cm_fclken, OMAP3430_DSS_MOD,
516 CM_FCLKEN);
517 cm_write_mod_reg(prcm_context.cam_cm_fclken, OMAP3430_CAM_MOD,
518 CM_FCLKEN);
519 cm_write_mod_reg(prcm_context.per_cm_fclken, OMAP3430_PER_MOD,
520 CM_FCLKEN);
521 cm_write_mod_reg(prcm_context.usbhost_cm_fclken,
522 OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
523 cm_write_mod_reg(prcm_context.core_cm_iclken1, CORE_MOD, CM_ICLKEN1);
524 cm_write_mod_reg(prcm_context.core_cm_iclken2, CORE_MOD, CM_ICLKEN2);
525 cm_write_mod_reg(prcm_context.core_cm_iclken3, CORE_MOD, CM_ICLKEN3);
526 cm_write_mod_reg(prcm_context.sgx_cm_iclken, OMAP3430ES2_SGX_MOD,
527 CM_ICLKEN);
528 cm_write_mod_reg(prcm_context.wkup_cm_iclken, WKUP_MOD, CM_ICLKEN);
529 cm_write_mod_reg(prcm_context.dss_cm_iclken, OMAP3430_DSS_MOD,
530 CM_ICLKEN);
531 cm_write_mod_reg(prcm_context.cam_cm_iclken, OMAP3430_CAM_MOD,
532 CM_ICLKEN);
533 cm_write_mod_reg(prcm_context.per_cm_iclken, OMAP3430_PER_MOD,
534 CM_ICLKEN);
535 cm_write_mod_reg(prcm_context.usbhost_cm_iclken,
536 OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
537 cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD,
538 CM_AUTOIDLE2);
539 cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2);
540 cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
541 OMAP2_CM_CLKSTCTRL);
542 cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD,
543 OMAP2_CM_CLKSTCTRL);
544 cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD,
545 OMAP2_CM_CLKSTCTRL);
546 cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
547 OMAP2_CM_CLKSTCTRL);
548 cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
549 OMAP2_CM_CLKSTCTRL);
550 cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
551 OMAP2_CM_CLKSTCTRL);
552 cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
553 OMAP2_CM_CLKSTCTRL);
554 cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
555 OMAP2_CM_CLKSTCTRL);
556 cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl,
557 OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
558 cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD,
559 CM_AUTOIDLE1);
560 cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD,
561 CM_AUTOIDLE2);
562 cm_write_mod_reg(prcm_context.core_cm_autoidle3, CORE_MOD,
563 CM_AUTOIDLE3);
564 cm_write_mod_reg(prcm_context.wkup_cm_autoidle, WKUP_MOD, CM_AUTOIDLE);
565 cm_write_mod_reg(prcm_context.dss_cm_autoidle, OMAP3430_DSS_MOD,
566 CM_AUTOIDLE);
567 cm_write_mod_reg(prcm_context.cam_cm_autoidle, OMAP3430_CAM_MOD,
568 CM_AUTOIDLE);
569 cm_write_mod_reg(prcm_context.per_cm_autoidle, OMAP3430_PER_MOD,
570 CM_AUTOIDLE);
571 cm_write_mod_reg(prcm_context.usbhost_cm_autoidle,
572 OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
573 cm_write_mod_reg(prcm_context.sgx_cm_sleepdep, OMAP3430ES2_SGX_MOD,
574 OMAP3430_CM_SLEEPDEP);
575 cm_write_mod_reg(prcm_context.dss_cm_sleepdep, OMAP3430_DSS_MOD,
576 OMAP3430_CM_SLEEPDEP);
577 cm_write_mod_reg(prcm_context.cam_cm_sleepdep, OMAP3430_CAM_MOD,
578 OMAP3430_CM_SLEEPDEP);
579 cm_write_mod_reg(prcm_context.per_cm_sleepdep, OMAP3430_PER_MOD,
580 OMAP3430_CM_SLEEPDEP);
581 cm_write_mod_reg(prcm_context.usbhost_cm_sleepdep,
582 OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
583 cm_write_mod_reg(prcm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
584 OMAP3_CM_CLKOUT_CTRL_OFFSET);
585 prm_write_mod_reg(prcm_context.prm_clkout_ctrl, OMAP3430_CCR_MOD,
586 OMAP3_PRM_CLKOUT_CTRL_OFFSET);
587 prm_write_mod_reg(prcm_context.sgx_pm_wkdep, OMAP3430ES2_SGX_MOD,
588 PM_WKDEP);
589 prm_write_mod_reg(prcm_context.dss_pm_wkdep, OMAP3430_DSS_MOD,
590 PM_WKDEP);
591 prm_write_mod_reg(prcm_context.cam_pm_wkdep, OMAP3430_CAM_MOD,
592 PM_WKDEP);
593 prm_write_mod_reg(prcm_context.per_pm_wkdep, OMAP3430_PER_MOD,
594 PM_WKDEP);
595 prm_write_mod_reg(prcm_context.neon_pm_wkdep, OMAP3430_NEON_MOD,
596 PM_WKDEP);
597 prm_write_mod_reg(prcm_context.usbhost_pm_wkdep,
598 OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
599 prm_write_mod_reg(prcm_context.core_pm_mpugrpsel1, CORE_MOD,
600 OMAP3430_PM_MPUGRPSEL1);
601 prm_write_mod_reg(prcm_context.iva2_pm_ivagrpsel1, OMAP3430_IVA2_MOD,
602 OMAP3430_PM_IVAGRPSEL1);
603 prm_write_mod_reg(prcm_context.core_pm_mpugrpsel3, CORE_MOD,
604 OMAP3430ES2_PM_MPUGRPSEL3);
605 prm_write_mod_reg(prcm_context.core_pm_ivagrpsel3, CORE_MOD,
606 OMAP3430ES2_PM_IVAGRPSEL3);
607 prm_write_mod_reg(prcm_context.wkup_pm_mpugrpsel, WKUP_MOD,
608 OMAP3430_PM_MPUGRPSEL);
609 prm_write_mod_reg(prcm_context.wkup_pm_ivagrpsel, WKUP_MOD,
610 OMAP3430_PM_IVAGRPSEL);
611 prm_write_mod_reg(prcm_context.per_pm_mpugrpsel, OMAP3430_PER_MOD,
612 OMAP3430_PM_MPUGRPSEL);
613 prm_write_mod_reg(prcm_context.per_pm_ivagrpsel, OMAP3430_PER_MOD,
614 OMAP3430_PM_IVAGRPSEL);
615 prm_write_mod_reg(prcm_context.wkup_pm_wken, WKUP_MOD, PM_WKEN);
616 return;
617}
618#endif
diff --git a/arch/arm/mach-omap2/prcm44xx.h b/arch/arm/mach-omap2/prcm44xx.h
new file mode 100644
index 000000000000..7334ffb9d2c1
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm44xx.h
@@ -0,0 +1,42 @@
1/*
2 * OMAP4 PRCM definitions
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Copyright (C) 2010 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 * This file contains macros and functions that are common to all of
14 * the PRM/CM/PRCM blocks on the OMAP4 devices: PRM, CM1, CM2,
15 * PRCM_MPU, SCRM
16 */
17
18#ifndef __ARCH_ARM_MACH_OMAP2_PRCM44XX_H
19#define __ARCH_ARM_MACH_OMAP2_PRCM44XX_H
20
21/*
22 * OMAP4 PRCM partition IDs
23 *
24 * The numbers and order are arbitrary, but 0 is reserved for the
25 * 'invalid' partition in case someone forgets to add a
26 * .prcm_partition field.
27 */
28#define OMAP4430_INVALID_PRCM_PARTITION 0
29#define OMAP4430_PRM_PARTITION 1
30#define OMAP4430_CM1_PARTITION 2
31#define OMAP4430_CM2_PARTITION 3
32#define OMAP4430_SCRM_PARTITION 4
33#define OMAP4430_PRCM_MPU_PARTITION 5
34
35/*
36 * OMAP4_MAX_PRCM_PARTITIONS: set to the highest value of the PRCM partition
37 * IDs, plus one
38 */
39#define OMAP4_MAX_PRCM_PARTITIONS 6
40
41
42#endif
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.c b/arch/arm/mach-omap2/prcm_mpu44xx.c
new file mode 100644
index 000000000000..171fe171a749
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.c
@@ -0,0 +1,45 @@
1/*
2 * OMAP4 PRCM_MPU module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/io.h>
17
18#include <plat/common.h>
19
20#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h"
22
23/* PRCM_MPU low-level functions */
24
25u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
26{
27 return __raw_readl(OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
28}
29
30void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 reg)
31{
32 __raw_writel(val, OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
33}
34
35u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
36{
37 u32 v;
38
39 v = omap4_prcm_mpu_read_inst_reg(inst, reg);
40 v &= ~mask;
41 v |= bits;
42 omap4_prcm_mpu_write_inst_reg(v, inst, reg);
43
44 return v;
45}
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h
new file mode 100644
index 000000000000..729a644ce852
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.h
@@ -0,0 +1,104 @@
1/*
2 * OMAP44xx PRCM MPU instance offset macros
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
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 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
26#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
27
28#define OMAP4430_PRCM_MPU_BASE 0x48243000
29
30#define OMAP44XX_PRCM_MPU_REGADDR(inst, reg) \
31 OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (inst) + (reg))
32
33/* PRCM_MPU instances */
34
35#define OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_INST 0x0000
36#define OMAP4430_PRCM_MPU_DEVICE_PRM_INST 0x0200
37#define OMAP4430_PRCM_MPU_CPU0_INST 0x0400
38#define OMAP4430_PRCM_MPU_CPU1_INST 0x0800
39
40/* PRCM_MPU clockdomain register offsets (from instance start) */
41#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0000
42#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0000
43
44
45/*
46 * PRCM_MPU
47 *
48 * The PRCM_MPU is a local PRCM inside the MPU subsystem. For the PRCM (global)
49 * point of view the PRCM_MPU is a single entity. It shares the same
50 * programming model as the global PRCM and thus can be assimilate as two new
51 * MOD inside the PRCM
52 */
53
54/* PRCM_MPU.OCP_SOCKET_PRCM register offsets */
55#define OMAP4_REVISION_PRCM_OFFSET 0x0000
56#define OMAP4430_REVISION_PRCM OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_INST, 0x0000)
57
58/* PRCM_MPU.DEVICE_PRM register offsets */
59#define OMAP4_PRCM_MPU_PRM_RSTST_OFFSET 0x0000
60#define OMAP4430_PRCM_MPU_PRM_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_INST, 0x0000)
61#define OMAP4_PRCM_MPU_PRM_PSCON_COUNT_OFFSET 0x0004
62#define OMAP4430_PRCM_MPU_PRM_PSCON_COUNT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_INST, 0x0004)
63
64/* PRCM_MPU.CPU0 register offsets */
65#define OMAP4_PM_CPU0_PWRSTCTRL_OFFSET 0x0000
66#define OMAP4430_PM_CPU0_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0000)
67#define OMAP4_PM_CPU0_PWRSTST_OFFSET 0x0004
68#define OMAP4430_PM_CPU0_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0004)
69#define OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET 0x0008
70#define OMAP4430_RM_CPU0_CPU0_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0008)
71#define OMAP4_RM_CPU0_CPU0_RSTCTRL_OFFSET 0x000c
72#define OMAP4430_RM_CPU0_CPU0_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x000c)
73#define OMAP4_RM_CPU0_CPU0_RSTST_OFFSET 0x0010
74#define OMAP4430_RM_CPU0_CPU0_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0010)
75#define OMAP4_CM_CPU0_CPU0_CLKCTRL_OFFSET 0x0014
76#define OMAP4430_CM_CPU0_CPU0_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0014)
77#define OMAP4_CM_CPU0_CLKSTCTRL_OFFSET 0x0018
78#define OMAP4430_CM_CPU0_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0018)
79
80/* PRCM_MPU.CPU1 register offsets */
81#define OMAP4_PM_CPU1_PWRSTCTRL_OFFSET 0x0000
82#define OMAP4430_PM_CPU1_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0000)
83#define OMAP4_PM_CPU1_PWRSTST_OFFSET 0x0004
84#define OMAP4430_PM_CPU1_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0004)
85#define OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET 0x0008
86#define OMAP4430_RM_CPU1_CPU1_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0008)
87#define OMAP4_RM_CPU1_CPU1_RSTCTRL_OFFSET 0x000c
88#define OMAP4430_RM_CPU1_CPU1_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x000c)
89#define OMAP4_RM_CPU1_CPU1_RSTST_OFFSET 0x0010
90#define OMAP4430_RM_CPU1_CPU1_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0010)
91#define OMAP4_CM_CPU1_CPU1_CLKCTRL_OFFSET 0x0014
92#define OMAP4430_CM_CPU1_CPU1_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0014)
93#define OMAP4_CM_CPU1_CLKSTCTRL_OFFSET 0x0018
94#define OMAP4430_CM_CPU1_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0018)
95
96/* Function prototypes */
97# ifndef __ASSEMBLER__
98extern u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 idx);
99extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx);
100extern u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst,
101 s16 idx);
102# endif
103
104#endif
diff --git a/arch/arm/mach-omap2/prm-regbits-24xx.h b/arch/arm/mach-omap2/prm-regbits-24xx.h
index 0b188ffa710e..6ac966103f34 100644
--- a/arch/arm/mach-omap2/prm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-24xx.h
@@ -14,7 +14,7 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "prm.h" 17#include "prm2xxx_3xxx.h"
18 18
19/* Bits shared between registers */ 19/* Bits shared between registers */
20 20
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
index 9e63cb743a97..64c087af6a8b 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -1,6 +1,3 @@
1#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
2#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
3
4/* 1/*
5 * OMAP3430 Power/Reset Management register bits 2 * OMAP3430 Power/Reset Management register bits
6 * 3 *
@@ -13,8 +10,11 @@
13 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
15 */ 12 */
13#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
14#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
15
16 16
17#include "prm.h" 17#include "prm2xxx_3xxx.h"
18 18
19/* Shared register bits */ 19/* Shared register bits */
20 20
@@ -101,8 +101,11 @@
101#define OMAP3430_GRPSEL_MCSPI3_MASK (1 << 20) 101#define OMAP3430_GRPSEL_MCSPI3_MASK (1 << 20)
102#define OMAP3430_GRPSEL_MCSPI2_MASK (1 << 19) 102#define OMAP3430_GRPSEL_MCSPI2_MASK (1 << 19)
103#define OMAP3430_GRPSEL_MCSPI1_MASK (1 << 18) 103#define OMAP3430_GRPSEL_MCSPI1_MASK (1 << 18)
104#define OMAP3430_GRPSEL_I2C3_SHIFT 17
104#define OMAP3430_GRPSEL_I2C3_MASK (1 << 17) 105#define OMAP3430_GRPSEL_I2C3_MASK (1 << 17)
106#define OMAP3430_GRPSEL_I2C2_SHIFT 16
105#define OMAP3430_GRPSEL_I2C2_MASK (1 << 16) 107#define OMAP3430_GRPSEL_I2C2_MASK (1 << 16)
108#define OMAP3430_GRPSEL_I2C1_SHIFT 15
106#define OMAP3430_GRPSEL_I2C1_MASK (1 << 15) 109#define OMAP3430_GRPSEL_I2C1_MASK (1 << 15)
107#define OMAP3430_GRPSEL_UART2_MASK (1 << 14) 110#define OMAP3430_GRPSEL_UART2_MASK (1 << 14)
108#define OMAP3430_GRPSEL_UART1_MASK (1 << 13) 111#define OMAP3430_GRPSEL_UART1_MASK (1 << 13)
diff --git a/arch/arm/mach-omap2/prm-regbits-44xx.h b/arch/arm/mach-omap2/prm-regbits-44xx.h
index 25b19b610177..6d2776f6fc08 100644
--- a/arch/arm/mach-omap2/prm-regbits-44xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-44xx.h
@@ -22,8 +22,6 @@
22#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H 22#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
23#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H 23#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
24 24
25#include "prm.h"
26
27 25
28/* 26/*
29 * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, 27 * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 7be040b2fdab..39d562169d18 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -1,321 +1,20 @@
1#ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
2#define __ARCH_ARM_MACH_OMAP2_PRM_H
3
4/* 1/*
5 * OMAP2/3 Power/Reset Management (PRM) register definitions 2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions
6 * 3 *
7 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
8 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
9 * 6 *
10 * Written by Paul Walmsley 7 * Paul Walmsley
11 * 8 *
12 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
15 */ 12 */
13#ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
14#define __ARCH_ARM_MACH_OMAP2_PRM_H
16 15
17#include "prcm-common.h" 16#include "prcm-common.h"
18 17
19#define OMAP2420_PRM_REGADDR(module, reg) \
20 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
21#define OMAP2430_PRM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
23#define OMAP34XX_PRM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
25#define OMAP44XX_PRM_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg))
27#define OMAP44XX_PRCM_MPU_REGADDR(module, reg) \
28 OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (module) + (reg))
29
30#include "prm44xx.h"
31
32/*
33 * Architecture-specific global PRM registers
34 * Use __raw_{read,write}l() with these registers.
35 *
36 * With a few exceptions, these are the register names beginning with
37 * PRCM_* on 24xx, and PRM_* on 34xx. (The exceptions are the
38 * IRQSTATUS and IRQENABLE bits.)
39 *
40 */
41
42#define OMAP2_PRCM_REVISION_OFFSET 0x0000
43#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
44#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
45#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
46
47#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
48#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
49#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
50#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
51
52#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
53#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
54#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
55#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
56#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
57#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
58#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
59#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
60#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
61#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
62#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
63#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
64#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
65#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
66#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
67#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
68#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
69#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
70#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
71#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
72
73#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
74#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
75
76#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
77#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
78
79#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
80#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
81#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
82#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
83#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
84#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
85#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
86#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
87#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
88#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
89
90#define OMAP3_PRM_REVISION_OFFSET 0x0004
91#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
92#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
93#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
94
95#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
96#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
97#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
98#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
99
100
101#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
102#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
103#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
104#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
105#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
106#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
107#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
108#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
109#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
110#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
111#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
112#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
113#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
114#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
115#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
116#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
117#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
118#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
119#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
120#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
121#define OMAP3_PRM_RSTST_OFFSET 0x0058
122#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
123#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
124#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
125#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
126#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
127#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
128#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
129#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
130#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
131#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
132#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
133#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
134#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
135#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
136#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
137#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
138#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
139#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
140#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
141#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
142#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
143#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
144#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
145#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
146#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
147#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
148#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
149#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
150#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
151#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
152#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
153#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
154#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
155#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
156#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
157#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
158#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
159#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
160#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
161#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
162#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
163
164#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
165#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
166#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
167#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
168
169/*
170 * Module specific PRM registers from PRM_BASE + domain offset
171 *
172 * Use prm_{read,write}_mod_reg() with these registers.
173 *
174 * With a few exceptions, these are the register names beginning with
175 * {PM,RM}_* on both architectures. (The exceptions are the IRQSTATUS
176 * and IRQENABLE bits.)
177 *
178 */
179
180/* Registers appearing on both 24xx and 34xx */
181
182#define OMAP2_RM_RSTCTRL 0x0050
183#define OMAP2_RM_RSTTIME 0x0054
184#define OMAP2_RM_RSTST 0x0058
185#define OMAP2_PM_PWSTCTRL 0x00e0
186#define OMAP2_PM_PWSTST 0x00e4
187
188#define PM_WKEN 0x00a0
189#define PM_WKEN1 PM_WKEN
190#define PM_WKST 0x00b0
191#define PM_WKST1 PM_WKST
192#define PM_WKDEP 0x00c8
193#define PM_EVGENCTRL 0x00d4
194#define PM_EVGENONTIM 0x00d8
195#define PM_EVGENOFFTIM 0x00dc
196
197/* Omap2 specific registers */
198#define OMAP24XX_PM_WKEN2 0x00a4
199#define OMAP24XX_PM_WKST2 0x00b4
200
201#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
202#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
203#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
204#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
205
206/* Omap3 specific registers */
207#define OMAP3430ES2_PM_WKEN3 0x00f0
208#define OMAP3430ES2_PM_WKST3 0x00b8
209
210#define OMAP3430_PM_MPUGRPSEL 0x00a4
211#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
212#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
213
214#define OMAP3430_PM_IVAGRPSEL 0x00a8
215#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
216#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
217
218#define OMAP3430_PM_PREPWSTST 0x00e8
219
220#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
221#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
222
223/* Omap4 specific registers */
224#define OMAP4_RM_RSTCTRL 0x0000
225#define OMAP4_RM_RSTTIME 0x0004
226#define OMAP4_RM_RSTST 0x0008
227#define OMAP4_PM_PWSTCTRL 0x0000
228#define OMAP4_PM_PWSTST 0x0004
229
230
231#ifndef __ASSEMBLER__
232
233/* Power/reset management domain register get/set */
234extern u32 prm_read_mod_reg(s16 module, u16 idx);
235extern void prm_write_mod_reg(u32 val, s16 module, u16 idx);
236extern u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
237
238/* Read-modify-write bits in a PRM register (by domain) */
239static inline u32 prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
240{
241 return prm_rmw_mod_reg_bits(bits, bits, module, idx);
242}
243
244static inline u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
245{
246 return prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
247}
248
249/* These omap2_ PRM functions apply to both OMAP2 and 3 */
250int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
251int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
252int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift);
253
254int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
255int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
256int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
257
258#endif
259
260/*
261 * Bits common to specific registers
262 *
263 * The 3430 register and bit names are generally used,
264 * since they tend to make more sense
265 */
266
267/* PM_EVGENONTIM_MPU */
268/* Named PM_EVEGENONTIM_MPU on the 24XX */
269#define OMAP_ONTIMEVAL_SHIFT 0
270#define OMAP_ONTIMEVAL_MASK (0xffffffff << 0)
271
272/* PM_EVGENOFFTIM_MPU */
273/* Named PM_EVEGENOFFTIM_MPU on the 24XX */
274#define OMAP_OFFTIMEVAL_SHIFT 0
275#define OMAP_OFFTIMEVAL_MASK (0xffffffff << 0)
276
277/* PRM_CLKSETUP and PRCM_VOLTSETUP */
278/* Named PRCM_CLKSSETUP on the 24XX */
279#define OMAP_SETUP_TIME_SHIFT 0
280#define OMAP_SETUP_TIME_MASK (0xffff << 0)
281
282/* PRM_CLKSRC_CTRL */
283/* Named PRCM_CLKSRC_CTRL on the 24XX */
284#define OMAP_SYSCLKDIV_SHIFT 6
285#define OMAP_SYSCLKDIV_MASK (0x3 << 6)
286#define OMAP_AUTOEXTCLKMODE_SHIFT 3
287#define OMAP_AUTOEXTCLKMODE_MASK (0x3 << 3)
288#define OMAP_SYSCLKSEL_SHIFT 0
289#define OMAP_SYSCLKSEL_MASK (0x3 << 0)
290
291/* PM_EVGENCTRL_MPU */
292#define OMAP_OFFLOADMODE_SHIFT 3
293#define OMAP_OFFLOADMODE_MASK (0x3 << 3)
294#define OMAP_ONLOADMODE_SHIFT 1
295#define OMAP_ONLOADMODE_MASK (0x3 << 1)
296#define OMAP_ENABLE_MASK (1 << 0)
297
298/* PRM_RSTTIME */
299/* Named RM_RSTTIME_WKUP on the 24xx */
300#define OMAP_RSTTIME2_SHIFT 8
301#define OMAP_RSTTIME2_MASK (0x1f << 8)
302#define OMAP_RSTTIME1_SHIFT 0
303#define OMAP_RSTTIME1_MASK (0xff << 0)
304
305/* PRM_RSTCTRL */
306/* Named RM_RSTCTRL_WKUP on the 24xx */
307/* 2420 calls RST_DPLL3 'RST_DPLL' */
308#define OMAP_RST_DPLL3_MASK (1 << 2)
309#define OMAP_RST_GS_MASK (1 << 1)
310
311
312/*
313 * Bits common to module-shared registers
314 *
315 * Not all registers of a particular type support all of these bits -
316 * check TRM if you are unsure
317 */
318
319/* 18/*
320 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP 19 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
321 * 20 *
@@ -341,59 +40,6 @@ int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
341#define OMAP_POWERSTATEST_MASK (0x3 << 0) 40#define OMAP_POWERSTATEST_MASK (0x3 << 0)
342 41
343/* 42/*
344 * 24XX: RM_RSTST_MPU and RM_RSTST_DSP - on 24XX, 'COREDOMAINWKUP_RST' is
345 * called 'COREWKUP_RST'
346 *
347 * 3430: RM_RSTST_IVA2, RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSS,
348 * RM_RSTST_CAM, RM_RSTST_PER, RM_RSTST_NEON
349 */
350#define OMAP_COREDOMAINWKUP_RST_MASK (1 << 3)
351
352/*
353 * 24XX: RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSP
354 *
355 * 2430: RM_RSTST_MDM
356 *
357 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
358 */
359#define OMAP_DOMAINWKUP_RST_MASK (1 << 2)
360
361/*
362 * 24XX: RM_RSTST_MPU, RM_RSTST_WKUP, RM_RSTST_DSP
363 * On 24XX, 'GLOBALWARM_RST' is called 'GLOBALWMPU_RST'.
364 *
365 * 2430: RM_RSTST_MDM
366 *
367 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
368 */
369#define OMAP_GLOBALWARM_RST_MASK (1 << 1)
370#define OMAP_GLOBALCOLD_RST_MASK (1 << 0)
371
372/*
373 * 24XX: PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_CORE, PM_WKDEP_DSP
374 * 2420 TRM sometimes uses "EN_WAKEUP" instead of "EN_WKUP"
375 *
376 * 2430: PM_WKDEP_MDM
377 *
378 * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM,
379 * PM_WKDEP_PER
380 */
381#define OMAP_EN_WKUP_SHIFT 4
382#define OMAP_EN_WKUP_MASK (1 << 4)
383
384/*
385 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
386 * PM_PWSTCTRL_DSP
387 *
388 * 2430: PM_PWSTCTRL_MDM
389 *
390 * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
391 * PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
392 * PM_PWSTCTRL_NEON
393 */
394#define OMAP_LOGICRETSTATE_MASK (1 << 2)
395
396/*
397 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX, 43 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
398 * PM_PWSTCTRL_DSP, PM_PWSTST_MPU 44 * PM_PWSTCTRL_DSP, PM_PWSTST_MPU
399 * 45 *
@@ -407,11 +53,4 @@ int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
407#define OMAP_POWERSTATE_MASK (0x3 << 0) 53#define OMAP_POWERSTATE_MASK (0x3 << 0)
408 54
409 55
410/*
411 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
412 * submodule to exit hardreset
413 */
414#define MAX_MODULE_HARDRESET_WAIT 10000
415
416
417#endif 56#endif
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 421771eee450..ec0362574b5e 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -12,18 +12,65 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/delay.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
17#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h>
18 18
19#include <plat/common.h> 19#include <plat/common.h>
20#include <plat/cpu.h> 20#include <plat/cpu.h>
21#include <plat/prcm.h> 21#include <plat/prcm.h>
22 22
23#include "prm.h" 23#include "prm2xxx_3xxx.h"
24#include "cm2xxx_3xxx.h"
24#include "prm-regbits-24xx.h" 25#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h" 26#include "prm-regbits-34xx.h"
26 27
28u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
29{
30 return __raw_readl(prm_base + module + idx);
31}
32
33void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx)
34{
35 __raw_writel(val, prm_base + module + idx);
36}
37
38/* Read-modify-write a register in a PRM module. Caller must lock */
39u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
40{
41 u32 v;
42
43 v = omap2_prm_read_mod_reg(module, idx);
44 v &= ~mask;
45 v |= bits;
46 omap2_prm_write_mod_reg(v, module, idx);
47
48 return v;
49}
50
51/* Read a PRM register, AND it, and shift the result down to bit 0 */
52u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
53{
54 u32 v;
55
56 v = omap2_prm_read_mod_reg(domain, idx);
57 v &= mask;
58 v >>= __ffs(mask);
59
60 return v;
61}
62
63u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
64{
65 return omap2_prm_rmw_mod_reg_bits(bits, bits, module, idx);
66}
67
68u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
69{
70 return omap2_prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
71}
72
73
27/** 74/**
28 * omap2_prm_is_hardreset_asserted - read the HW reset line state of 75 * omap2_prm_is_hardreset_asserted - read the HW reset line state of
29 * submodules contained in the hwmod module 76 * submodules contained in the hwmod module
@@ -39,7 +86,7 @@ int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift)
39 if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) 86 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
40 return -EINVAL; 87 return -EINVAL;
41 88
42 return prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, 89 return omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL,
43 (1 << shift)); 90 (1 << shift));
44} 91}
45 92
@@ -63,7 +110,7 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
63 return -EINVAL; 110 return -EINVAL;
64 111
65 mask = 1 << shift; 112 mask = 1 << shift;
66 prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL); 113 omap2_prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL);
67 114
68 return 0; 115 return 0;
69} 116}
@@ -93,18 +140,17 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift)
93 mask = 1 << shift; 140 mask = 1 << shift;
94 141
95 /* Check the current status to avoid de-asserting the line twice */ 142 /* Check the current status to avoid de-asserting the line twice */
96 if (prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0) 143 if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0)
97 return -EEXIST; 144 return -EEXIST;
98 145
99 /* Clear the reset status by writing 1 to the status bit */ 146 /* Clear the reset status by writing 1 to the status bit */
100 prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST); 147 omap2_prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST);
101 /* de-assert the reset control line */ 148 /* de-assert the reset control line */
102 prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL); 149 omap2_prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL);
103 /* wait the status to be set */ 150 /* wait the status to be set */
104 omap_test_timeout(prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, 151 omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST,
105 mask), 152 mask),
106 MAX_MODULE_HARDRESET_WAIT, c); 153 MAX_MODULE_HARDRESET_WAIT, c);
107 154
108 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 155 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
109} 156}
110
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h
new file mode 100644
index 000000000000..53d44f6e3736
--- /dev/null
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
@@ -0,0 +1,367 @@
1/*
2 * OMAP2/3 Power/Reset Management (PRM) register definitions
3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley
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 * The PRM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The PRM on OMAP4 has a new register layout, and is handled
14 * in a separate file.
15 */
16#ifndef __ARCH_ARM_MACH_OMAP2_PRM2XXX_3XXX_H
17#define __ARCH_ARM_MACH_OMAP2_PRM2XXX_3XXX_H
18
19#include "prcm-common.h"
20#include "prm.h"
21
22#define OMAP2420_PRM_REGADDR(module, reg) \
23 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
24#define OMAP2430_PRM_REGADDR(module, reg) \
25 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
26#define OMAP34XX_PRM_REGADDR(module, reg) \
27 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
28
29
30/*
31 * OMAP2-specific global PRM registers
32 * Use __raw_{read,write}l() with these registers.
33 *
34 * With a few exceptions, these are the register names beginning with
35 * PRCM_* on 24xx. (The exceptions are the IRQSTATUS and IRQENABLE
36 * bits.)
37 *
38 */
39
40#define OMAP2_PRCM_REVISION_OFFSET 0x0000
41#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
42#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
43#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
44
45#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
46#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
47#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
48#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
49
50#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
51#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
52#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
53#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
54#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
55#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
56#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
57#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
58#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
59#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
60#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
61#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
62#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
63#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
64#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
65#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
66#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
67#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
68#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
69#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
70
71#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
72#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
73
74#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
75#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
76
77#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
78#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
79#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
80#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
81#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
82#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
83#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
84#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
85#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
86#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
87
88/*
89 * OMAP3-specific global PRM registers
90 * Use __raw_{read,write}l() with these registers.
91 *
92 * With a few exceptions, these are the register names beginning with
93 * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE
94 * bits.)
95 */
96
97#define OMAP3_PRM_REVISION_OFFSET 0x0004
98#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
99#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
100#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
101
102#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
103#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
104#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
105#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
106
107
108#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
109#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
110#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
111#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
112#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
113#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
114#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
115#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
116#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
117#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
118#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
119#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
120#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
121#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
122#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
123#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
124#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
125#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
126#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
127#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
128#define OMAP3_PRM_RSTST_OFFSET 0x0058
129#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
130#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
131#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
132#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
133#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
134#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
135#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
136#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
137#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
138#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
139#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
140#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
141#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
142#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
143#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
144#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
145#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
146#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
147#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
148#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
149#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
150#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
151#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
152#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
153#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
154#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
155#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
156#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
157#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
158#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
159#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
160#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
161#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
162#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
163#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
164#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
165#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
166#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
167#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
168#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
169#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
170
171#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
172#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
173#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
174#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
175
176/*
177 * Module specific PRM register offsets from PRM_BASE + domain offset
178 *
179 * Use prm_{read,write}_mod_reg() with these registers.
180 *
181 * With a few exceptions, these are the register names beginning with
182 * {PM,RM}_* on both OMAP2/3 SoC families.. (The exceptions are the
183 * IRQSTATUS and IRQENABLE bits.)
184 */
185
186/* Register offsets appearing on both OMAP2 and OMAP3 */
187
188#define OMAP2_RM_RSTCTRL 0x0050
189#define OMAP2_RM_RSTTIME 0x0054
190#define OMAP2_RM_RSTST 0x0058
191#define OMAP2_PM_PWSTCTRL 0x00e0
192#define OMAP2_PM_PWSTST 0x00e4
193
194#define PM_WKEN 0x00a0
195#define PM_WKEN1 PM_WKEN
196#define PM_WKST 0x00b0
197#define PM_WKST1 PM_WKST
198#define PM_WKDEP 0x00c8
199#define PM_EVGENCTRL 0x00d4
200#define PM_EVGENONTIM 0x00d8
201#define PM_EVGENOFFTIM 0x00dc
202
203/* OMAP2xxx specific register offsets */
204#define OMAP24XX_PM_WKEN2 0x00a4
205#define OMAP24XX_PM_WKST2 0x00b4
206
207#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
208#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
209#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
210#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
211
212/* OMAP3 specific register offsets */
213#define OMAP3430ES2_PM_WKEN3 0x00f0
214#define OMAP3430ES2_PM_WKST3 0x00b8
215
216#define OMAP3430_PM_MPUGRPSEL 0x00a4
217#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
218#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
219
220#define OMAP3430_PM_IVAGRPSEL 0x00a8
221#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
222#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
223
224#define OMAP3430_PM_PREPWSTST 0x00e8
225
226#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
227#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
228
229
230#ifndef __ASSEMBLER__
231
232/* Power/reset management domain register get/set */
233extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx);
234extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx);
235extern u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
236extern u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx);
237extern u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
238extern u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
239
240/* These omap2_ PRM functions apply to both OMAP2 and 3 */
241extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
242extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
243extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift);
244
245#endif
246
247/*
248 * Bits common to specific registers
249 *
250 * The 3430 register and bit names are generally used,
251 * since they tend to make more sense
252 */
253
254/* PM_EVGENONTIM_MPU */
255/* Named PM_EVEGENONTIM_MPU on the 24XX */
256#define OMAP_ONTIMEVAL_SHIFT 0
257#define OMAP_ONTIMEVAL_MASK (0xffffffff << 0)
258
259/* PM_EVGENOFFTIM_MPU */
260/* Named PM_EVEGENOFFTIM_MPU on the 24XX */
261#define OMAP_OFFTIMEVAL_SHIFT 0
262#define OMAP_OFFTIMEVAL_MASK (0xffffffff << 0)
263
264/* PRM_CLKSETUP and PRCM_VOLTSETUP */
265/* Named PRCM_CLKSSETUP on the 24XX */
266#define OMAP_SETUP_TIME_SHIFT 0
267#define OMAP_SETUP_TIME_MASK (0xffff << 0)
268
269/* PRM_CLKSRC_CTRL */
270/* Named PRCM_CLKSRC_CTRL on the 24XX */
271#define OMAP_SYSCLKDIV_SHIFT 6
272#define OMAP_SYSCLKDIV_MASK (0x3 << 6)
273#define OMAP_AUTOEXTCLKMODE_SHIFT 3
274#define OMAP_AUTOEXTCLKMODE_MASK (0x3 << 3)
275#define OMAP_SYSCLKSEL_SHIFT 0
276#define OMAP_SYSCLKSEL_MASK (0x3 << 0)
277
278/* PM_EVGENCTRL_MPU */
279#define OMAP_OFFLOADMODE_SHIFT 3
280#define OMAP_OFFLOADMODE_MASK (0x3 << 3)
281#define OMAP_ONLOADMODE_SHIFT 1
282#define OMAP_ONLOADMODE_MASK (0x3 << 1)
283#define OMAP_ENABLE_MASK (1 << 0)
284
285/* PRM_RSTTIME */
286/* Named RM_RSTTIME_WKUP on the 24xx */
287#define OMAP_RSTTIME2_SHIFT 8
288#define OMAP_RSTTIME2_MASK (0x1f << 8)
289#define OMAP_RSTTIME1_SHIFT 0
290#define OMAP_RSTTIME1_MASK (0xff << 0)
291
292/* PRM_RSTCTRL */
293/* Named RM_RSTCTRL_WKUP on the 24xx */
294/* 2420 calls RST_DPLL3 'RST_DPLL' */
295#define OMAP_RST_DPLL3_MASK (1 << 2)
296#define OMAP_RST_GS_MASK (1 << 1)
297
298
299/*
300 * Bits common to module-shared registers
301 *
302 * Not all registers of a particular type support all of these bits -
303 * check TRM if you are unsure
304 */
305
306/*
307 * 24XX: RM_RSTST_MPU and RM_RSTST_DSP - on 24XX, 'COREDOMAINWKUP_RST' is
308 * called 'COREWKUP_RST'
309 *
310 * 3430: RM_RSTST_IVA2, RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSS,
311 * RM_RSTST_CAM, RM_RSTST_PER, RM_RSTST_NEON
312 */
313#define OMAP_COREDOMAINWKUP_RST_MASK (1 << 3)
314
315/*
316 * 24XX: RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSP
317 *
318 * 2430: RM_RSTST_MDM
319 *
320 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
321 */
322#define OMAP_DOMAINWKUP_RST_MASK (1 << 2)
323
324/*
325 * 24XX: RM_RSTST_MPU, RM_RSTST_WKUP, RM_RSTST_DSP
326 * On 24XX, 'GLOBALWARM_RST' is called 'GLOBALWMPU_RST'.
327 *
328 * 2430: RM_RSTST_MDM
329 *
330 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
331 */
332#define OMAP_GLOBALWARM_RST_MASK (1 << 1)
333#define OMAP_GLOBALCOLD_RST_MASK (1 << 0)
334
335/*
336 * 24XX: PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_CORE, PM_WKDEP_DSP
337 * 2420 TRM sometimes uses "EN_WAKEUP" instead of "EN_WKUP"
338 *
339 * 2430: PM_WKDEP_MDM
340 *
341 * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM,
342 * PM_WKDEP_PER
343 */
344#define OMAP_EN_WKUP_SHIFT 4
345#define OMAP_EN_WKUP_MASK (1 << 4)
346
347/*
348 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
349 * PM_PWSTCTRL_DSP
350 *
351 * 2430: PM_PWSTCTRL_MDM
352 *
353 * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
354 * PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
355 * PM_PWSTCTRL_NEON
356 */
357#define OMAP_LOGICRETSTATE_MASK (1 << 2)
358
359
360/*
361 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
362 * submodule to exit hardreset
363 */
364#define MAX_MODULE_HARDRESET_WAIT 10000
365
366
367#endif
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index a1ff918d9bed..a2a04bfa9628 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -15,12 +15,13 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/io.h>
18 19
19#include <plat/common.h> 20#include <plat/common.h>
20#include <plat/cpu.h> 21#include <plat/cpu.h>
21#include <plat/prcm.h> 22#include <plat/prcm.h>
22 23
23#include "prm.h" 24#include "prm44xx.h"
24#include "prm-regbits-44xx.h" 25#include "prm-regbits-44xx.h"
25 26
26/* 27/*
@@ -29,6 +30,70 @@
29 */ 30 */
30#define OMAP4_RST_CTRL_ST_OFFSET 4 31#define OMAP4_RST_CTRL_ST_OFFSET 4
31 32
33/* PRM low-level functions */
34
35/* Read a register in a CM/PRM instance in the PRM module */
36u32 omap4_prm_read_inst_reg(s16 inst, u16 reg)
37{
38 return __raw_readl(OMAP44XX_PRM_REGADDR(inst, reg));
39}
40
41/* Write into a register in a CM/PRM instance in the PRM module */
42void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 reg)
43{
44 __raw_writel(val, OMAP44XX_PRM_REGADDR(inst, reg));
45}
46
47/* Read-modify-write a register in a PRM module. Caller must lock */
48u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
49{
50 u32 v;
51
52 v = omap4_prm_read_inst_reg(inst, reg);
53 v &= ~mask;
54 v |= bits;
55 omap4_prm_write_inst_reg(v, inst, reg);
56
57 return v;
58}
59
60/* Read a PRM register, AND it, and shift the result down to bit 0 */
61/* XXX deprecated */
62u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
63{
64 u32 v;
65
66 v = __raw_readl(reg);
67 v &= mask;
68 v >>= __ffs(mask);
69
70 return v;
71}
72
73/* Read-modify-write a register in a PRM module. Caller must lock */
74/* XXX deprecated */
75u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
76{
77 u32 v;
78
79 v = __raw_readl(reg);
80 v &= ~mask;
81 v |= bits;
82 __raw_writel(v, reg);
83
84 return v;
85}
86
87u32 omap4_prm_set_inst_reg_bits(u32 bits, s16 inst, s16 reg)
88{
89 return omap4_prm_rmw_inst_reg_bits(bits, bits, inst, reg);
90}
91
92u32 omap4_prm_clear_inst_reg_bits(u32 bits, s16 inst, s16 reg)
93{
94 return omap4_prm_rmw_inst_reg_bits(bits, 0x0, inst, reg);
95}
96
32/** 97/**
33 * omap4_prm_is_hardreset_asserted - read the HW reset line state of 98 * omap4_prm_is_hardreset_asserted - read the HW reset line state of
34 * submodules contained in the hwmod module 99 * submodules contained in the hwmod module
@@ -114,3 +179,17 @@ int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift)
114 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 179 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
115} 180}
116 181
182void omap4_prm_global_warm_sw_reset(void)
183{
184 u32 v;
185
186 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
187 OMAP4_RM_RSTCTRL);
188 v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
189 omap4_prm_write_inst_reg(v, OMAP4430_PRM_DEVICE_INST,
190 OMAP4_RM_RSTCTRL);
191
192 /* OCP barrier */
193 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
194 OMAP4_RM_RSTCTRL);
195}
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index 59839dbabd84..67a0d3feb3f6 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -17,736 +17,762 @@
17 * This program is free software; you can redistribute it and/or modify 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 18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation. 19 * published by the Free Software Foundation.
20 *
21 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
20 */ 23 */
21 24
22#ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_H 25#ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_H
23#define __ARCH_ARM_MACH_OMAP2_PRM44XX_H 26#define __ARCH_ARM_MACH_OMAP2_PRM44XX_H
24 27
28#include "prcm-common.h"
29#include "prm.h"
30
31#define OMAP4430_PRM_BASE 0x4a306000
32
33#define OMAP44XX_PRM_REGADDR(inst, reg) \
34 OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (inst) + (reg))
35
36
37/* PRM instances */
38#define OMAP4430_PRM_OCP_SOCKET_INST 0x0000
39#define OMAP4430_PRM_CKGEN_INST 0x0100
40#define OMAP4430_PRM_MPU_INST 0x0300
41#define OMAP4430_PRM_TESLA_INST 0x0400
42#define OMAP4430_PRM_ABE_INST 0x0500
43#define OMAP4430_PRM_ALWAYS_ON_INST 0x0600
44#define OMAP4430_PRM_CORE_INST 0x0700
45#define OMAP4430_PRM_IVAHD_INST 0x0f00
46#define OMAP4430_PRM_CAM_INST 0x1000
47#define OMAP4430_PRM_DSS_INST 0x1100
48#define OMAP4430_PRM_GFX_INST 0x1200
49#define OMAP4430_PRM_L3INIT_INST 0x1300
50#define OMAP4430_PRM_L4PER_INST 0x1400
51#define OMAP4430_PRM_CEFUSE_INST 0x1600
52#define OMAP4430_PRM_WKUP_INST 0x1700
53#define OMAP4430_PRM_WKUP_CM_INST 0x1800
54#define OMAP4430_PRM_EMU_INST 0x1900
55#define OMAP4430_PRM_EMU_CM_INST 0x1a00
56#define OMAP4430_PRM_DEVICE_INST 0x1b00
57#define OMAP4430_PRM_INSTR_INST 0x1f00
58
59/* PRM clockdomain register offsets (from instance start) */
60#define OMAP4430_PRM_MPU_MPU_CDOFFS 0x0000
61#define OMAP4430_PRM_TESLA_TESLA_CDOFFS 0x0000
62#define OMAP4430_PRM_ABE_ABE_CDOFFS 0x0000
63#define OMAP4430_PRM_CORE_CORE_CDOFFS 0x0000
64#define OMAP4430_PRM_IVAHD_IVAHD_CDOFFS 0x0000
65#define OMAP4430_PRM_CAM_CAM_CDOFFS 0x0000
66#define OMAP4430_PRM_DSS_DSS_CDOFFS 0x0000
67#define OMAP4430_PRM_GFX_GFX_CDOFFS 0x0000
68#define OMAP4430_PRM_L3INIT_L3INIT_CDOFFS 0x0000
69#define OMAP4430_PRM_L4PER_L4PER_CDOFFS 0x0000
70#define OMAP4430_PRM_CEFUSE_CEFUSE_CDOFFS 0x0000
71#define OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS 0x0000
72#define OMAP4430_PRM_EMU_EMU_CDOFFS 0x0000
73#define OMAP4430_PRM_EMU_CM_EMU_CDOFFS 0x0000
74
75/* OMAP4 specific register offsets */
76#define OMAP4_RM_RSTCTRL 0x0000
77#define OMAP4_RM_RSTTIME 0x0004
78#define OMAP4_RM_RSTST 0x0008
79#define OMAP4_PM_PWSTCTRL 0x0000
80#define OMAP4_PM_PWSTST 0x0004
81
25 82
26/* PRM */ 83/* PRM */
27 84
28/* PRM.OCP_SOCKET_PRM register offsets */ 85/* PRM.OCP_SOCKET_PRM register offsets */
29#define OMAP4_REVISION_PRM_OFFSET 0x0000 86#define OMAP4_REVISION_PRM_OFFSET 0x0000
30#define OMAP4430_REVISION_PRM OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0000) 87#define OMAP4430_REVISION_PRM OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0000)
31#define OMAP4_PRM_IRQSTATUS_MPU_OFFSET 0x0010 88#define OMAP4_PRM_IRQSTATUS_MPU_OFFSET 0x0010
32#define OMAP4430_PRM_IRQSTATUS_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0010) 89#define OMAP4430_PRM_IRQSTATUS_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0010)
33#define OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET 0x0014 90#define OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET 0x0014
34#define OMAP4430_PRM_IRQSTATUS_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0014) 91#define OMAP4430_PRM_IRQSTATUS_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0014)
35#define OMAP4_PRM_IRQENABLE_MPU_OFFSET 0x0018 92#define OMAP4_PRM_IRQENABLE_MPU_OFFSET 0x0018
36#define OMAP4430_PRM_IRQENABLE_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0018) 93#define OMAP4430_PRM_IRQENABLE_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0018)
37#define OMAP4_PRM_IRQENABLE_MPU_2_OFFSET 0x001c 94#define OMAP4_PRM_IRQENABLE_MPU_2_OFFSET 0x001c
38#define OMAP4430_PRM_IRQENABLE_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x001c) 95#define OMAP4430_PRM_IRQENABLE_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x001c)
39#define OMAP4_PRM_IRQSTATUS_DUCATI_OFFSET 0x0020 96#define OMAP4_PRM_IRQSTATUS_DUCATI_OFFSET 0x0020
40#define OMAP4430_PRM_IRQSTATUS_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0020) 97#define OMAP4430_PRM_IRQSTATUS_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0020)
41#define OMAP4_PRM_IRQENABLE_DUCATI_OFFSET 0x0028 98#define OMAP4_PRM_IRQENABLE_DUCATI_OFFSET 0x0028
42#define OMAP4430_PRM_IRQENABLE_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0028) 99#define OMAP4430_PRM_IRQENABLE_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0028)
43#define OMAP4_PRM_IRQSTATUS_TESLA_OFFSET 0x0030 100#define OMAP4_PRM_IRQSTATUS_TESLA_OFFSET 0x0030
44#define OMAP4430_PRM_IRQSTATUS_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0030) 101#define OMAP4430_PRM_IRQSTATUS_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0030)
45#define OMAP4_PRM_IRQENABLE_TESLA_OFFSET 0x0038 102#define OMAP4_PRM_IRQENABLE_TESLA_OFFSET 0x0038
46#define OMAP4430_PRM_IRQENABLE_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0038) 103#define OMAP4430_PRM_IRQENABLE_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0038)
47#define OMAP4_CM_PRM_PROFILING_CLKCTRL_OFFSET 0x0040 104#define OMAP4_CM_PRM_PROFILING_CLKCTRL_OFFSET 0x0040
48#define OMAP4430_CM_PRM_PROFILING_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0040) 105#define OMAP4430_CM_PRM_PROFILING_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0040)
49 106
50/* PRM.CKGEN_PRM register offsets */ 107/* PRM.CKGEN_PRM register offsets */
51#define OMAP4_CM_ABE_DSS_SYS_CLKSEL_OFFSET 0x0000 108#define OMAP4_CM_ABE_DSS_SYS_CLKSEL_OFFSET 0x0000
52#define OMAP4430_CM_ABE_DSS_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x0000) 109#define OMAP4430_CM_ABE_DSS_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x0000)
53#define OMAP4_CM_L4_WKUP_CLKSEL_OFFSET 0x0008 110#define OMAP4_CM_L4_WKUP_CLKSEL_OFFSET 0x0008
54#define OMAP4430_CM_L4_WKUP_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x0008) 111#define OMAP4430_CM_L4_WKUP_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x0008)
55#define OMAP4_CM_ABE_PLL_REF_CLKSEL_OFFSET 0x000c 112#define OMAP4_CM_ABE_PLL_REF_CLKSEL_OFFSET 0x000c
56#define OMAP4430_CM_ABE_PLL_REF_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x000c) 113#define OMAP4430_CM_ABE_PLL_REF_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x000c)
57#define OMAP4_CM_SYS_CLKSEL_OFFSET 0x0010 114#define OMAP4_CM_SYS_CLKSEL_OFFSET 0x0010
58#define OMAP4430_CM_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x0010) 115#define OMAP4430_CM_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x0010)
59 116
60/* PRM.MPU_PRM register offsets */ 117/* PRM.MPU_PRM register offsets */
61#define OMAP4_PM_MPU_PWRSTCTRL_OFFSET 0x0000 118#define OMAP4_PM_MPU_PWRSTCTRL_OFFSET 0x0000
62#define OMAP4430_PM_MPU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0000) 119#define OMAP4430_PM_MPU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0000)
63#define OMAP4_PM_MPU_PWRSTST_OFFSET 0x0004 120#define OMAP4_PM_MPU_PWRSTST_OFFSET 0x0004
64#define OMAP4430_PM_MPU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0004) 121#define OMAP4430_PM_MPU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0004)
65#define OMAP4_RM_MPU_RSTST_OFFSET 0x0014 122#define OMAP4_RM_MPU_RSTST_OFFSET 0x0014
66#define OMAP4430_RM_MPU_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0014) 123#define OMAP4430_RM_MPU_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0014)
67#define OMAP4_RM_MPU_MPU_CONTEXT_OFFSET 0x0024 124#define OMAP4_RM_MPU_MPU_CONTEXT_OFFSET 0x0024
68#define OMAP4430_RM_MPU_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0024) 125#define OMAP4430_RM_MPU_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0024)
69 126
70/* PRM.TESLA_PRM register offsets */ 127/* PRM.TESLA_PRM register offsets */
71#define OMAP4_PM_TESLA_PWRSTCTRL_OFFSET 0x0000 128#define OMAP4_PM_TESLA_PWRSTCTRL_OFFSET 0x0000
72#define OMAP4430_PM_TESLA_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0000) 129#define OMAP4430_PM_TESLA_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0000)
73#define OMAP4_PM_TESLA_PWRSTST_OFFSET 0x0004 130#define OMAP4_PM_TESLA_PWRSTST_OFFSET 0x0004
74#define OMAP4430_PM_TESLA_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0004) 131#define OMAP4430_PM_TESLA_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0004)
75#define OMAP4_RM_TESLA_RSTCTRL_OFFSET 0x0010 132#define OMAP4_RM_TESLA_RSTCTRL_OFFSET 0x0010
76#define OMAP4430_RM_TESLA_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0010) 133#define OMAP4430_RM_TESLA_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0010)
77#define OMAP4_RM_TESLA_RSTST_OFFSET 0x0014 134#define OMAP4_RM_TESLA_RSTST_OFFSET 0x0014
78#define OMAP4430_RM_TESLA_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0014) 135#define OMAP4430_RM_TESLA_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0014)
79#define OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET 0x0024 136#define OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET 0x0024
80#define OMAP4430_RM_TESLA_TESLA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0024) 137#define OMAP4430_RM_TESLA_TESLA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0024)
81 138
82/* PRM.ABE_PRM register offsets */ 139/* PRM.ABE_PRM register offsets */
83#define OMAP4_PM_ABE_PWRSTCTRL_OFFSET 0x0000 140#define OMAP4_PM_ABE_PWRSTCTRL_OFFSET 0x0000
84#define OMAP4430_PM_ABE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0000) 141#define OMAP4430_PM_ABE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0000)
85#define OMAP4_PM_ABE_PWRSTST_OFFSET 0x0004 142#define OMAP4_PM_ABE_PWRSTST_OFFSET 0x0004
86#define OMAP4430_PM_ABE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0004) 143#define OMAP4430_PM_ABE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0004)
87#define OMAP4_RM_ABE_AESS_CONTEXT_OFFSET 0x002c 144#define OMAP4_RM_ABE_AESS_CONTEXT_OFFSET 0x002c
88#define OMAP4430_RM_ABE_AESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x002c) 145#define OMAP4430_RM_ABE_AESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x002c)
89#define OMAP4_PM_ABE_PDM_WKDEP_OFFSET 0x0030 146#define OMAP4_PM_ABE_PDM_WKDEP_OFFSET 0x0030
90#define OMAP4430_PM_ABE_PDM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0030) 147#define OMAP4430_PM_ABE_PDM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0030)
91#define OMAP4_RM_ABE_PDM_CONTEXT_OFFSET 0x0034 148#define OMAP4_RM_ABE_PDM_CONTEXT_OFFSET 0x0034
92#define OMAP4430_RM_ABE_PDM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0034) 149#define OMAP4430_RM_ABE_PDM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0034)
93#define OMAP4_PM_ABE_DMIC_WKDEP_OFFSET 0x0038 150#define OMAP4_PM_ABE_DMIC_WKDEP_OFFSET 0x0038
94#define OMAP4430_PM_ABE_DMIC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0038) 151#define OMAP4430_PM_ABE_DMIC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0038)
95#define OMAP4_RM_ABE_DMIC_CONTEXT_OFFSET 0x003c 152#define OMAP4_RM_ABE_DMIC_CONTEXT_OFFSET 0x003c
96#define OMAP4430_RM_ABE_DMIC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x003c) 153#define OMAP4430_RM_ABE_DMIC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x003c)
97#define OMAP4_PM_ABE_MCASP_WKDEP_OFFSET 0x0040 154#define OMAP4_PM_ABE_MCASP_WKDEP_OFFSET 0x0040
98#define OMAP4430_PM_ABE_MCASP_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0040) 155#define OMAP4430_PM_ABE_MCASP_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0040)
99#define OMAP4_RM_ABE_MCASP_CONTEXT_OFFSET 0x0044 156#define OMAP4_RM_ABE_MCASP_CONTEXT_OFFSET 0x0044
100#define OMAP4430_RM_ABE_MCASP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0044) 157#define OMAP4430_RM_ABE_MCASP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0044)
101#define OMAP4_PM_ABE_MCBSP1_WKDEP_OFFSET 0x0048 158#define OMAP4_PM_ABE_MCBSP1_WKDEP_OFFSET 0x0048
102#define OMAP4430_PM_ABE_MCBSP1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0048) 159#define OMAP4430_PM_ABE_MCBSP1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0048)
103#define OMAP4_RM_ABE_MCBSP1_CONTEXT_OFFSET 0x004c 160#define OMAP4_RM_ABE_MCBSP1_CONTEXT_OFFSET 0x004c
104#define OMAP4430_RM_ABE_MCBSP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x004c) 161#define OMAP4430_RM_ABE_MCBSP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x004c)
105#define OMAP4_PM_ABE_MCBSP2_WKDEP_OFFSET 0x0050 162#define OMAP4_PM_ABE_MCBSP2_WKDEP_OFFSET 0x0050
106#define OMAP4430_PM_ABE_MCBSP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0050) 163#define OMAP4430_PM_ABE_MCBSP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0050)
107#define OMAP4_RM_ABE_MCBSP2_CONTEXT_OFFSET 0x0054 164#define OMAP4_RM_ABE_MCBSP2_CONTEXT_OFFSET 0x0054
108#define OMAP4430_RM_ABE_MCBSP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0054) 165#define OMAP4430_RM_ABE_MCBSP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0054)
109#define OMAP4_PM_ABE_MCBSP3_WKDEP_OFFSET 0x0058 166#define OMAP4_PM_ABE_MCBSP3_WKDEP_OFFSET 0x0058
110#define OMAP4430_PM_ABE_MCBSP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0058) 167#define OMAP4430_PM_ABE_MCBSP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0058)
111#define OMAP4_RM_ABE_MCBSP3_CONTEXT_OFFSET 0x005c 168#define OMAP4_RM_ABE_MCBSP3_CONTEXT_OFFSET 0x005c
112#define OMAP4430_RM_ABE_MCBSP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x005c) 169#define OMAP4430_RM_ABE_MCBSP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x005c)
113#define OMAP4_PM_ABE_SLIMBUS_WKDEP_OFFSET 0x0060 170#define OMAP4_PM_ABE_SLIMBUS_WKDEP_OFFSET 0x0060
114#define OMAP4430_PM_ABE_SLIMBUS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0060) 171#define OMAP4430_PM_ABE_SLIMBUS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0060)
115#define OMAP4_RM_ABE_SLIMBUS_CONTEXT_OFFSET 0x0064 172#define OMAP4_RM_ABE_SLIMBUS_CONTEXT_OFFSET 0x0064
116#define OMAP4430_RM_ABE_SLIMBUS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0064) 173#define OMAP4430_RM_ABE_SLIMBUS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0064)
117#define OMAP4_PM_ABE_TIMER5_WKDEP_OFFSET 0x0068 174#define OMAP4_PM_ABE_TIMER5_WKDEP_OFFSET 0x0068
118#define OMAP4430_PM_ABE_TIMER5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0068) 175#define OMAP4430_PM_ABE_TIMER5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0068)
119#define OMAP4_RM_ABE_TIMER5_CONTEXT_OFFSET 0x006c 176#define OMAP4_RM_ABE_TIMER5_CONTEXT_OFFSET 0x006c
120#define OMAP4430_RM_ABE_TIMER5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x006c) 177#define OMAP4430_RM_ABE_TIMER5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x006c)
121#define OMAP4_PM_ABE_TIMER6_WKDEP_OFFSET 0x0070 178#define OMAP4_PM_ABE_TIMER6_WKDEP_OFFSET 0x0070
122#define OMAP4430_PM_ABE_TIMER6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0070) 179#define OMAP4430_PM_ABE_TIMER6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0070)
123#define OMAP4_RM_ABE_TIMER6_CONTEXT_OFFSET 0x0074 180#define OMAP4_RM_ABE_TIMER6_CONTEXT_OFFSET 0x0074
124#define OMAP4430_RM_ABE_TIMER6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0074) 181#define OMAP4430_RM_ABE_TIMER6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0074)
125#define OMAP4_PM_ABE_TIMER7_WKDEP_OFFSET 0x0078 182#define OMAP4_PM_ABE_TIMER7_WKDEP_OFFSET 0x0078
126#define OMAP4430_PM_ABE_TIMER7_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0078) 183#define OMAP4430_PM_ABE_TIMER7_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0078)
127#define OMAP4_RM_ABE_TIMER7_CONTEXT_OFFSET 0x007c 184#define OMAP4_RM_ABE_TIMER7_CONTEXT_OFFSET 0x007c
128#define OMAP4430_RM_ABE_TIMER7_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x007c) 185#define OMAP4430_RM_ABE_TIMER7_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x007c)
129#define OMAP4_PM_ABE_TIMER8_WKDEP_OFFSET 0x0080 186#define OMAP4_PM_ABE_TIMER8_WKDEP_OFFSET 0x0080
130#define OMAP4430_PM_ABE_TIMER8_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0080) 187#define OMAP4430_PM_ABE_TIMER8_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0080)
131#define OMAP4_RM_ABE_TIMER8_CONTEXT_OFFSET 0x0084 188#define OMAP4_RM_ABE_TIMER8_CONTEXT_OFFSET 0x0084
132#define OMAP4430_RM_ABE_TIMER8_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0084) 189#define OMAP4430_RM_ABE_TIMER8_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0084)
133#define OMAP4_PM_ABE_WDT3_WKDEP_OFFSET 0x0088 190#define OMAP4_PM_ABE_WDT3_WKDEP_OFFSET 0x0088
134#define OMAP4430_PM_ABE_WDT3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0088) 191#define OMAP4430_PM_ABE_WDT3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0088)
135#define OMAP4_RM_ABE_WDT3_CONTEXT_OFFSET 0x008c 192#define OMAP4_RM_ABE_WDT3_CONTEXT_OFFSET 0x008c
136#define OMAP4430_RM_ABE_WDT3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x008c) 193#define OMAP4430_RM_ABE_WDT3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x008c)
137 194
138/* PRM.ALWAYS_ON_PRM register offsets */ 195/* PRM.ALWAYS_ON_PRM register offsets */
139#define OMAP4_RM_ALWON_MDMINTC_CONTEXT_OFFSET 0x0024 196#define OMAP4_RM_ALWON_MDMINTC_CONTEXT_OFFSET 0x0024
140#define OMAP4430_RM_ALWON_MDMINTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0024) 197#define OMAP4430_RM_ALWON_MDMINTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0024)
141#define OMAP4_PM_ALWON_SR_MPU_WKDEP_OFFSET 0x0028 198#define OMAP4_PM_ALWON_SR_MPU_WKDEP_OFFSET 0x0028
142#define OMAP4430_PM_ALWON_SR_MPU_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0028) 199#define OMAP4430_PM_ALWON_SR_MPU_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0028)
143#define OMAP4_RM_ALWON_SR_MPU_CONTEXT_OFFSET 0x002c 200#define OMAP4_RM_ALWON_SR_MPU_CONTEXT_OFFSET 0x002c
144#define OMAP4430_RM_ALWON_SR_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x002c) 201#define OMAP4430_RM_ALWON_SR_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x002c)
145#define OMAP4_PM_ALWON_SR_IVA_WKDEP_OFFSET 0x0030 202#define OMAP4_PM_ALWON_SR_IVA_WKDEP_OFFSET 0x0030
146#define OMAP4430_PM_ALWON_SR_IVA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0030) 203#define OMAP4430_PM_ALWON_SR_IVA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0030)
147#define OMAP4_RM_ALWON_SR_IVA_CONTEXT_OFFSET 0x0034 204#define OMAP4_RM_ALWON_SR_IVA_CONTEXT_OFFSET 0x0034
148#define OMAP4430_RM_ALWON_SR_IVA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0034) 205#define OMAP4430_RM_ALWON_SR_IVA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0034)
149#define OMAP4_PM_ALWON_SR_CORE_WKDEP_OFFSET 0x0038 206#define OMAP4_PM_ALWON_SR_CORE_WKDEP_OFFSET 0x0038
150#define OMAP4430_PM_ALWON_SR_CORE_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0038) 207#define OMAP4430_PM_ALWON_SR_CORE_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0038)
151#define OMAP4_RM_ALWON_SR_CORE_CONTEXT_OFFSET 0x003c 208#define OMAP4_RM_ALWON_SR_CORE_CONTEXT_OFFSET 0x003c
152#define OMAP4430_RM_ALWON_SR_CORE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x003c) 209#define OMAP4430_RM_ALWON_SR_CORE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x003c)
153 210
154/* PRM.CORE_PRM register offsets */ 211/* PRM.CORE_PRM register offsets */
155#define OMAP4_PM_CORE_PWRSTCTRL_OFFSET 0x0000 212#define OMAP4_PM_CORE_PWRSTCTRL_OFFSET 0x0000
156#define OMAP4430_PM_CORE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0000) 213#define OMAP4430_PM_CORE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0000)
157#define OMAP4_PM_CORE_PWRSTST_OFFSET 0x0004 214#define OMAP4_PM_CORE_PWRSTST_OFFSET 0x0004
158#define OMAP4430_PM_CORE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0004) 215#define OMAP4430_PM_CORE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0004)
159#define OMAP4_RM_L3_1_L3_1_CONTEXT_OFFSET 0x0024 216#define OMAP4_RM_L3_1_L3_1_CONTEXT_OFFSET 0x0024
160#define OMAP4430_RM_L3_1_L3_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0024) 217#define OMAP4430_RM_L3_1_L3_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0024)
161#define OMAP4_RM_L3_2_L3_2_CONTEXT_OFFSET 0x0124 218#define OMAP4_RM_L3_2_L3_2_CONTEXT_OFFSET 0x0124
162#define OMAP4430_RM_L3_2_L3_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0124) 219#define OMAP4430_RM_L3_2_L3_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0124)
163#define OMAP4_RM_L3_2_GPMC_CONTEXT_OFFSET 0x012c 220#define OMAP4_RM_L3_2_GPMC_CONTEXT_OFFSET 0x012c
164#define OMAP4430_RM_L3_2_GPMC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x012c) 221#define OMAP4430_RM_L3_2_GPMC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x012c)
165#define OMAP4_RM_L3_2_OCMC_RAM_CONTEXT_OFFSET 0x0134 222#define OMAP4_RM_L3_2_OCMC_RAM_CONTEXT_OFFSET 0x0134
166#define OMAP4430_RM_L3_2_OCMC_RAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0134) 223#define OMAP4430_RM_L3_2_OCMC_RAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0134)
167#define OMAP4_RM_DUCATI_RSTCTRL_OFFSET 0x0210 224#define OMAP4_RM_DUCATI_RSTCTRL_OFFSET 0x0210
168#define OMAP4430_RM_DUCATI_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0210) 225#define OMAP4430_RM_DUCATI_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0210)
169#define OMAP4_RM_DUCATI_RSTST_OFFSET 0x0214 226#define OMAP4_RM_DUCATI_RSTST_OFFSET 0x0214
170#define OMAP4430_RM_DUCATI_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0214) 227#define OMAP4430_RM_DUCATI_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0214)
171#define OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET 0x0224 228#define OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET 0x0224
172#define OMAP4430_RM_DUCATI_DUCATI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0224) 229#define OMAP4430_RM_DUCATI_DUCATI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0224)
173#define OMAP4_RM_SDMA_SDMA_CONTEXT_OFFSET 0x0324 230#define OMAP4_RM_SDMA_SDMA_CONTEXT_OFFSET 0x0324
174#define OMAP4430_RM_SDMA_SDMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0324) 231#define OMAP4430_RM_SDMA_SDMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0324)
175#define OMAP4_RM_MEMIF_DMM_CONTEXT_OFFSET 0x0424 232#define OMAP4_RM_MEMIF_DMM_CONTEXT_OFFSET 0x0424
176#define OMAP4430_RM_MEMIF_DMM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0424) 233#define OMAP4430_RM_MEMIF_DMM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0424)
177#define OMAP4_RM_MEMIF_EMIF_FW_CONTEXT_OFFSET 0x042c 234#define OMAP4_RM_MEMIF_EMIF_FW_CONTEXT_OFFSET 0x042c
178#define OMAP4430_RM_MEMIF_EMIF_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x042c) 235#define OMAP4430_RM_MEMIF_EMIF_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x042c)
179#define OMAP4_RM_MEMIF_EMIF_1_CONTEXT_OFFSET 0x0434 236#define OMAP4_RM_MEMIF_EMIF_1_CONTEXT_OFFSET 0x0434
180#define OMAP4430_RM_MEMIF_EMIF_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0434) 237#define OMAP4430_RM_MEMIF_EMIF_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0434)
181#define OMAP4_RM_MEMIF_EMIF_2_CONTEXT_OFFSET 0x043c 238#define OMAP4_RM_MEMIF_EMIF_2_CONTEXT_OFFSET 0x043c
182#define OMAP4430_RM_MEMIF_EMIF_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x043c) 239#define OMAP4430_RM_MEMIF_EMIF_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x043c)
183#define OMAP4_RM_MEMIF_DLL_CONTEXT_OFFSET 0x0444 240#define OMAP4_RM_MEMIF_DLL_CONTEXT_OFFSET 0x0444
184#define OMAP4430_RM_MEMIF_DLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0444) 241#define OMAP4430_RM_MEMIF_DLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0444)
185#define OMAP4_RM_MEMIF_EMIF_H1_CONTEXT_OFFSET 0x0454 242#define OMAP4_RM_MEMIF_EMIF_H1_CONTEXT_OFFSET 0x0454
186#define OMAP4430_RM_MEMIF_EMIF_H1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0454) 243#define OMAP4430_RM_MEMIF_EMIF_H1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0454)
187#define OMAP4_RM_MEMIF_EMIF_H2_CONTEXT_OFFSET 0x045c 244#define OMAP4_RM_MEMIF_EMIF_H2_CONTEXT_OFFSET 0x045c
188#define OMAP4430_RM_MEMIF_EMIF_H2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x045c) 245#define OMAP4430_RM_MEMIF_EMIF_H2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x045c)
189#define OMAP4_RM_MEMIF_DLL_H_CONTEXT_OFFSET 0x0464 246#define OMAP4_RM_MEMIF_DLL_H_CONTEXT_OFFSET 0x0464
190#define OMAP4430_RM_MEMIF_DLL_H_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0464) 247#define OMAP4430_RM_MEMIF_DLL_H_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0464)
191#define OMAP4_RM_D2D_SAD2D_CONTEXT_OFFSET 0x0524 248#define OMAP4_RM_D2D_SAD2D_CONTEXT_OFFSET 0x0524
192#define OMAP4430_RM_D2D_SAD2D_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0524) 249#define OMAP4430_RM_D2D_SAD2D_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0524)
193#define OMAP4_RM_D2D_MODEM_ICR_CONTEXT_OFFSET 0x052c 250#define OMAP4_RM_D2D_INSTEM_ICR_CONTEXT_OFFSET 0x052c
194#define OMAP4430_RM_D2D_MODEM_ICR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x052c) 251#define OMAP4430_RM_D2D_INSTEM_ICR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x052c)
195#define OMAP4_RM_D2D_SAD2D_FW_CONTEXT_OFFSET 0x0534 252#define OMAP4_RM_D2D_SAD2D_FW_CONTEXT_OFFSET 0x0534
196#define OMAP4430_RM_D2D_SAD2D_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0534) 253#define OMAP4430_RM_D2D_SAD2D_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0534)
197#define OMAP4_RM_L4CFG_L4_CFG_CONTEXT_OFFSET 0x0624 254#define OMAP4_RM_L4CFG_L4_CFG_CONTEXT_OFFSET 0x0624
198#define OMAP4430_RM_L4CFG_L4_CFG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0624) 255#define OMAP4430_RM_L4CFG_L4_CFG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0624)
199#define OMAP4_RM_L4CFG_HW_SEM_CONTEXT_OFFSET 0x062c 256#define OMAP4_RM_L4CFG_HW_SEM_CONTEXT_OFFSET 0x062c
200#define OMAP4430_RM_L4CFG_HW_SEM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x062c) 257#define OMAP4430_RM_L4CFG_HW_SEM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x062c)
201#define OMAP4_RM_L4CFG_MAILBOX_CONTEXT_OFFSET 0x0634 258#define OMAP4_RM_L4CFG_MAILBOX_CONTEXT_OFFSET 0x0634
202#define OMAP4430_RM_L4CFG_MAILBOX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0634) 259#define OMAP4430_RM_L4CFG_MAILBOX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0634)
203#define OMAP4_RM_L4CFG_SAR_ROM_CONTEXT_OFFSET 0x063c 260#define OMAP4_RM_L4CFG_SAR_ROM_CONTEXT_OFFSET 0x063c
204#define OMAP4430_RM_L4CFG_SAR_ROM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x063c) 261#define OMAP4430_RM_L4CFG_SAR_ROM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x063c)
205#define OMAP4_RM_L3INSTR_L3_3_CONTEXT_OFFSET 0x0724 262#define OMAP4_RM_L3INSTR_L3_3_CONTEXT_OFFSET 0x0724
206#define OMAP4430_RM_L3INSTR_L3_3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0724) 263#define OMAP4430_RM_L3INSTR_L3_3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0724)
207#define OMAP4_RM_L3INSTR_L3_INSTR_CONTEXT_OFFSET 0x072c 264#define OMAP4_RM_L3INSTR_L3_INSTR_CONTEXT_OFFSET 0x072c
208#define OMAP4430_RM_L3INSTR_L3_INSTR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x072c) 265#define OMAP4430_RM_L3INSTR_L3_INSTR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x072c)
209#define OMAP4_RM_L3INSTR_OCP_WP1_CONTEXT_OFFSET 0x0744 266#define OMAP4_RM_L3INSTR_OCP_WP1_CONTEXT_OFFSET 0x0744
210#define OMAP4430_RM_L3INSTR_OCP_WP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0744) 267#define OMAP4430_RM_L3INSTR_OCP_WP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0744)
211 268
212/* PRM.IVAHD_PRM register offsets */ 269/* PRM.IVAHD_PRM register offsets */
213#define OMAP4_PM_IVAHD_PWRSTCTRL_OFFSET 0x0000 270#define OMAP4_PM_IVAHD_PWRSTCTRL_OFFSET 0x0000
214#define OMAP4430_PM_IVAHD_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0000) 271#define OMAP4430_PM_IVAHD_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0000)
215#define OMAP4_PM_IVAHD_PWRSTST_OFFSET 0x0004 272#define OMAP4_PM_IVAHD_PWRSTST_OFFSET 0x0004
216#define OMAP4430_PM_IVAHD_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0004) 273#define OMAP4430_PM_IVAHD_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0004)
217#define OMAP4_RM_IVAHD_RSTCTRL_OFFSET 0x0010 274#define OMAP4_RM_IVAHD_RSTCTRL_OFFSET 0x0010
218#define OMAP4430_RM_IVAHD_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0010) 275#define OMAP4430_RM_IVAHD_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0010)
219#define OMAP4_RM_IVAHD_RSTST_OFFSET 0x0014 276#define OMAP4_RM_IVAHD_RSTST_OFFSET 0x0014
220#define OMAP4430_RM_IVAHD_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0014) 277#define OMAP4430_RM_IVAHD_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0014)
221#define OMAP4_RM_IVAHD_IVAHD_CONTEXT_OFFSET 0x0024 278#define OMAP4_RM_IVAHD_IVAHD_CONTEXT_OFFSET 0x0024
222#define OMAP4430_RM_IVAHD_IVAHD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0024) 279#define OMAP4430_RM_IVAHD_IVAHD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0024)
223#define OMAP4_RM_IVAHD_SL2_CONTEXT_OFFSET 0x002c 280#define OMAP4_RM_IVAHD_SL2_CONTEXT_OFFSET 0x002c
224#define OMAP4430_RM_IVAHD_SL2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x002c) 281#define OMAP4430_RM_IVAHD_SL2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x002c)
225 282
226/* PRM.CAM_PRM register offsets */ 283/* PRM.CAM_PRM register offsets */
227#define OMAP4_PM_CAM_PWRSTCTRL_OFFSET 0x0000 284#define OMAP4_PM_CAM_PWRSTCTRL_OFFSET 0x0000
228#define OMAP4430_PM_CAM_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x0000) 285#define OMAP4430_PM_CAM_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x0000)
229#define OMAP4_PM_CAM_PWRSTST_OFFSET 0x0004 286#define OMAP4_PM_CAM_PWRSTST_OFFSET 0x0004
230#define OMAP4430_PM_CAM_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x0004) 287#define OMAP4430_PM_CAM_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x0004)
231#define OMAP4_RM_CAM_ISS_CONTEXT_OFFSET 0x0024 288#define OMAP4_RM_CAM_ISS_CONTEXT_OFFSET 0x0024
232#define OMAP4430_RM_CAM_ISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x0024) 289#define OMAP4430_RM_CAM_ISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x0024)
233#define OMAP4_RM_CAM_FDIF_CONTEXT_OFFSET 0x002c 290#define OMAP4_RM_CAM_FDIF_CONTEXT_OFFSET 0x002c
234#define OMAP4430_RM_CAM_FDIF_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x002c) 291#define OMAP4430_RM_CAM_FDIF_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x002c)
235 292
236/* PRM.DSS_PRM register offsets */ 293/* PRM.DSS_PRM register offsets */
237#define OMAP4_PM_DSS_PWRSTCTRL_OFFSET 0x0000 294#define OMAP4_PM_DSS_PWRSTCTRL_OFFSET 0x0000
238#define OMAP4430_PM_DSS_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0000) 295#define OMAP4430_PM_DSS_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0000)
239#define OMAP4_PM_DSS_PWRSTST_OFFSET 0x0004 296#define OMAP4_PM_DSS_PWRSTST_OFFSET 0x0004
240#define OMAP4430_PM_DSS_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0004) 297#define OMAP4430_PM_DSS_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0004)
241#define OMAP4_PM_DSS_DSS_WKDEP_OFFSET 0x0020 298#define OMAP4_PM_DSS_DSS_WKDEP_OFFSET 0x0020
242#define OMAP4430_PM_DSS_DSS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0020) 299#define OMAP4430_PM_DSS_DSS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0020)
243#define OMAP4_RM_DSS_DSS_CONTEXT_OFFSET 0x0024 300#define OMAP4_RM_DSS_DSS_CONTEXT_OFFSET 0x0024
244#define OMAP4430_RM_DSS_DSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0024) 301#define OMAP4430_RM_DSS_DSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0024)
245#define OMAP4_RM_DSS_DEISS_CONTEXT_OFFSET 0x002c 302#define OMAP4_RM_DSS_DEISS_CONTEXT_OFFSET 0x002c
246#define OMAP4430_RM_DSS_DEISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x002c) 303#define OMAP4430_RM_DSS_DEISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x002c)
247 304
248/* PRM.GFX_PRM register offsets */ 305/* PRM.GFX_PRM register offsets */
249#define OMAP4_PM_GFX_PWRSTCTRL_OFFSET 0x0000 306#define OMAP4_PM_GFX_PWRSTCTRL_OFFSET 0x0000
250#define OMAP4430_PM_GFX_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_MOD, 0x0000) 307#define OMAP4430_PM_GFX_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_INST, 0x0000)
251#define OMAP4_PM_GFX_PWRSTST_OFFSET 0x0004 308#define OMAP4_PM_GFX_PWRSTST_OFFSET 0x0004
252#define OMAP4430_PM_GFX_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_MOD, 0x0004) 309#define OMAP4430_PM_GFX_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_INST, 0x0004)
253#define OMAP4_RM_GFX_GFX_CONTEXT_OFFSET 0x0024 310#define OMAP4_RM_GFX_GFX_CONTEXT_OFFSET 0x0024
254#define OMAP4430_RM_GFX_GFX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_MOD, 0x0024) 311#define OMAP4430_RM_GFX_GFX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_INST, 0x0024)
255 312
256/* PRM.L3INIT_PRM register offsets */ 313/* PRM.L3INIT_PRM register offsets */
257#define OMAP4_PM_L3INIT_PWRSTCTRL_OFFSET 0x0000 314#define OMAP4_PM_L3INIT_PWRSTCTRL_OFFSET 0x0000
258#define OMAP4430_PM_L3INIT_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0000) 315#define OMAP4430_PM_L3INIT_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0000)
259#define OMAP4_PM_L3INIT_PWRSTST_OFFSET 0x0004 316#define OMAP4_PM_L3INIT_PWRSTST_OFFSET 0x0004
260#define OMAP4430_PM_L3INIT_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0004) 317#define OMAP4430_PM_L3INIT_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0004)
261#define OMAP4_PM_L3INIT_MMC1_WKDEP_OFFSET 0x0028 318#define OMAP4_PM_L3INIT_MMC1_WKDEP_OFFSET 0x0028
262#define OMAP4430_PM_L3INIT_MMC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0028) 319#define OMAP4430_PM_L3INIT_MMC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0028)
263#define OMAP4_RM_L3INIT_MMC1_CONTEXT_OFFSET 0x002c 320#define OMAP4_RM_L3INIT_MMC1_CONTEXT_OFFSET 0x002c
264#define OMAP4430_RM_L3INIT_MMC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x002c) 321#define OMAP4430_RM_L3INIT_MMC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x002c)
265#define OMAP4_PM_L3INIT_MMC2_WKDEP_OFFSET 0x0030 322#define OMAP4_PM_L3INIT_MMC2_WKDEP_OFFSET 0x0030
266#define OMAP4430_PM_L3INIT_MMC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0030) 323#define OMAP4430_PM_L3INIT_MMC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0030)
267#define OMAP4_RM_L3INIT_MMC2_CONTEXT_OFFSET 0x0034 324#define OMAP4_RM_L3INIT_MMC2_CONTEXT_OFFSET 0x0034
268#define OMAP4430_RM_L3INIT_MMC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0034) 325#define OMAP4430_RM_L3INIT_MMC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0034)
269#define OMAP4_PM_L3INIT_HSI_WKDEP_OFFSET 0x0038 326#define OMAP4_PM_L3INIT_HSI_WKDEP_OFFSET 0x0038
270#define OMAP4430_PM_L3INIT_HSI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0038) 327#define OMAP4430_PM_L3INIT_HSI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0038)
271#define OMAP4_RM_L3INIT_HSI_CONTEXT_OFFSET 0x003c 328#define OMAP4_RM_L3INIT_HSI_CONTEXT_OFFSET 0x003c
272#define OMAP4430_RM_L3INIT_HSI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x003c) 329#define OMAP4430_RM_L3INIT_HSI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x003c)
273#define OMAP4_PM_L3INIT_UNIPRO1_WKDEP_OFFSET 0x0040 330#define OMAP4_PM_L3INIT_UNIPRO1_WKDEP_OFFSET 0x0040
274#define OMAP4430_PM_L3INIT_UNIPRO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0040) 331#define OMAP4430_PM_L3INIT_UNIPRO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0040)
275#define OMAP4_RM_L3INIT_UNIPRO1_CONTEXT_OFFSET 0x0044 332#define OMAP4_RM_L3INIT_UNIPRO1_CONTEXT_OFFSET 0x0044
276#define OMAP4430_RM_L3INIT_UNIPRO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0044) 333#define OMAP4430_RM_L3INIT_UNIPRO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0044)
277#define OMAP4_PM_L3INIT_USB_HOST_WKDEP_OFFSET 0x0058 334#define OMAP4_PM_L3INIT_USB_HOST_WKDEP_OFFSET 0x0058
278#define OMAP4430_PM_L3INIT_USB_HOST_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0058) 335#define OMAP4430_PM_L3INIT_USB_HOST_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0058)
279#define OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET 0x005c 336#define OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET 0x005c
280#define OMAP4430_RM_L3INIT_USB_HOST_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x005c) 337#define OMAP4430_RM_L3INIT_USB_HOST_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x005c)
281#define OMAP4_PM_L3INIT_USB_OTG_WKDEP_OFFSET 0x0060 338#define OMAP4_PM_L3INIT_USB_OTG_WKDEP_OFFSET 0x0060
282#define OMAP4430_PM_L3INIT_USB_OTG_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0060) 339#define OMAP4430_PM_L3INIT_USB_OTG_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0060)
283#define OMAP4_RM_L3INIT_USB_OTG_CONTEXT_OFFSET 0x0064 340#define OMAP4_RM_L3INIT_USB_OTG_CONTEXT_OFFSET 0x0064
284#define OMAP4430_RM_L3INIT_USB_OTG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0064) 341#define OMAP4430_RM_L3INIT_USB_OTG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0064)
285#define OMAP4_PM_L3INIT_USB_TLL_WKDEP_OFFSET 0x0068 342#define OMAP4_PM_L3INIT_USB_TLL_WKDEP_OFFSET 0x0068
286#define OMAP4430_PM_L3INIT_USB_TLL_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0068) 343#define OMAP4430_PM_L3INIT_USB_TLL_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0068)
287#define OMAP4_RM_L3INIT_USB_TLL_CONTEXT_OFFSET 0x006c 344#define OMAP4_RM_L3INIT_USB_TLL_CONTEXT_OFFSET 0x006c
288#define OMAP4430_RM_L3INIT_USB_TLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x006c) 345#define OMAP4430_RM_L3INIT_USB_TLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x006c)
289#define OMAP4_RM_L3INIT_P1500_CONTEXT_OFFSET 0x007c 346#define OMAP4_RM_L3INIT_P1500_CONTEXT_OFFSET 0x007c
290#define OMAP4430_RM_L3INIT_P1500_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x007c) 347#define OMAP4430_RM_L3INIT_P1500_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x007c)
291#define OMAP4_RM_L3INIT_EMAC_CONTEXT_OFFSET 0x0084 348#define OMAP4_RM_L3INIT_EMAC_CONTEXT_OFFSET 0x0084
292#define OMAP4430_RM_L3INIT_EMAC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0084) 349#define OMAP4430_RM_L3INIT_EMAC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0084)
293#define OMAP4_PM_L3INIT_SATA_WKDEP_OFFSET 0x0088 350#define OMAP4_PM_L3INIT_SATA_WKDEP_OFFSET 0x0088
294#define OMAP4430_PM_L3INIT_SATA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0088) 351#define OMAP4430_PM_L3INIT_SATA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0088)
295#define OMAP4_RM_L3INIT_SATA_CONTEXT_OFFSET 0x008c 352#define OMAP4_RM_L3INIT_SATA_CONTEXT_OFFSET 0x008c
296#define OMAP4430_RM_L3INIT_SATA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x008c) 353#define OMAP4430_RM_L3INIT_SATA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x008c)
297#define OMAP4_RM_L3INIT_TPPSS_CONTEXT_OFFSET 0x0094 354#define OMAP4_RM_L3INIT_TPPSS_CONTEXT_OFFSET 0x0094
298#define OMAP4430_RM_L3INIT_TPPSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0094) 355#define OMAP4430_RM_L3INIT_TPPSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0094)
299#define OMAP4_PM_L3INIT_PCIESS_WKDEP_OFFSET 0x0098 356#define OMAP4_PM_L3INIT_PCIESS_WKDEP_OFFSET 0x0098
300#define OMAP4430_PM_L3INIT_PCIESS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0098) 357#define OMAP4430_PM_L3INIT_PCIESS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0098)
301#define OMAP4_RM_L3INIT_PCIESS_CONTEXT_OFFSET 0x009c 358#define OMAP4_RM_L3INIT_PCIESS_CONTEXT_OFFSET 0x009c
302#define OMAP4430_RM_L3INIT_PCIESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x009c) 359#define OMAP4430_RM_L3INIT_PCIESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x009c)
303#define OMAP4_RM_L3INIT_CCPTX_CONTEXT_OFFSET 0x00ac 360#define OMAP4_RM_L3INIT_CCPTX_CONTEXT_OFFSET 0x00ac
304#define OMAP4430_RM_L3INIT_CCPTX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00ac) 361#define OMAP4430_RM_L3INIT_CCPTX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00ac)
305#define OMAP4_PM_L3INIT_XHPI_WKDEP_OFFSET 0x00c0 362#define OMAP4_PM_L3INIT_XHPI_WKDEP_OFFSET 0x00c0
306#define OMAP4430_PM_L3INIT_XHPI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00c0) 363#define OMAP4430_PM_L3INIT_XHPI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00c0)
307#define OMAP4_RM_L3INIT_XHPI_CONTEXT_OFFSET 0x00c4 364#define OMAP4_RM_L3INIT_XHPI_CONTEXT_OFFSET 0x00c4
308#define OMAP4430_RM_L3INIT_XHPI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00c4) 365#define OMAP4430_RM_L3INIT_XHPI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00c4)
309#define OMAP4_PM_L3INIT_MMC6_WKDEP_OFFSET 0x00c8 366#define OMAP4_PM_L3INIT_MMC6_WKDEP_OFFSET 0x00c8
310#define OMAP4430_PM_L3INIT_MMC6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00c8) 367#define OMAP4430_PM_L3INIT_MMC6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00c8)
311#define OMAP4_RM_L3INIT_MMC6_CONTEXT_OFFSET 0x00cc 368#define OMAP4_RM_L3INIT_MMC6_CONTEXT_OFFSET 0x00cc
312#define OMAP4430_RM_L3INIT_MMC6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00cc) 369#define OMAP4430_RM_L3INIT_MMC6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00cc)
313#define OMAP4_PM_L3INIT_USB_HOST_FS_WKDEP_OFFSET 0x00d0 370#define OMAP4_PM_L3INIT_USB_HOST_FS_WKDEP_OFFSET 0x00d0
314#define OMAP4430_PM_L3INIT_USB_HOST_FS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00d0) 371#define OMAP4430_PM_L3INIT_USB_HOST_FS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00d0)
315#define OMAP4_RM_L3INIT_USB_HOST_FS_CONTEXT_OFFSET 0x00d4 372#define OMAP4_RM_L3INIT_USB_HOST_FS_CONTEXT_OFFSET 0x00d4
316#define OMAP4430_RM_L3INIT_USB_HOST_FS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00d4) 373#define OMAP4430_RM_L3INIT_USB_HOST_FS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00d4)
317#define OMAP4_RM_L3INIT_USBPHYOCP2SCP_CONTEXT_OFFSET 0x00e4 374#define OMAP4_RM_L3INIT_USBPHYOCP2SCP_CONTEXT_OFFSET 0x00e4
318#define OMAP4430_RM_L3INIT_USBPHYOCP2SCP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00e4) 375#define OMAP4430_RM_L3INIT_USBPHYOCP2SCP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00e4)
319 376
320/* PRM.L4PER_PRM register offsets */ 377/* PRM.L4PER_PRM register offsets */
321#define OMAP4_PM_L4PER_PWRSTCTRL_OFFSET 0x0000 378#define OMAP4_PM_L4PER_PWRSTCTRL_OFFSET 0x0000
322#define OMAP4430_PM_L4PER_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0000) 379#define OMAP4430_PM_L4PER_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0000)
323#define OMAP4_PM_L4PER_PWRSTST_OFFSET 0x0004 380#define OMAP4_PM_L4PER_PWRSTST_OFFSET 0x0004
324#define OMAP4430_PM_L4PER_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0004) 381#define OMAP4430_PM_L4PER_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0004)
325#define OMAP4_RM_L4PER_ADC_CONTEXT_OFFSET 0x0024 382#define OMAP4_RM_L4PER_ADC_CONTEXT_OFFSET 0x0024
326#define OMAP4430_RM_L4PER_ADC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0024) 383#define OMAP4430_RM_L4PER_ADC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0024)
327#define OMAP4_PM_L4PER_DMTIMER10_WKDEP_OFFSET 0x0028 384#define OMAP4_PM_L4PER_DMTIMER10_WKDEP_OFFSET 0x0028
328#define OMAP4430_PM_L4PER_DMTIMER10_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0028) 385#define OMAP4430_PM_L4PER_DMTIMER10_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0028)
329#define OMAP4_RM_L4PER_DMTIMER10_CONTEXT_OFFSET 0x002c 386#define OMAP4_RM_L4PER_DMTIMER10_CONTEXT_OFFSET 0x002c
330#define OMAP4430_RM_L4PER_DMTIMER10_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x002c) 387#define OMAP4430_RM_L4PER_DMTIMER10_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x002c)
331#define OMAP4_PM_L4PER_DMTIMER11_WKDEP_OFFSET 0x0030 388#define OMAP4_PM_L4PER_DMTIMER11_WKDEP_OFFSET 0x0030
332#define OMAP4430_PM_L4PER_DMTIMER11_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0030) 389#define OMAP4430_PM_L4PER_DMTIMER11_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0030)
333#define OMAP4_RM_L4PER_DMTIMER11_CONTEXT_OFFSET 0x0034 390#define OMAP4_RM_L4PER_DMTIMER11_CONTEXT_OFFSET 0x0034
334#define OMAP4430_RM_L4PER_DMTIMER11_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0034) 391#define OMAP4430_RM_L4PER_DMTIMER11_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0034)
335#define OMAP4_PM_L4PER_DMTIMER2_WKDEP_OFFSET 0x0038 392#define OMAP4_PM_L4PER_DMTIMER2_WKDEP_OFFSET 0x0038
336#define OMAP4430_PM_L4PER_DMTIMER2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0038) 393#define OMAP4430_PM_L4PER_DMTIMER2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0038)
337#define OMAP4_RM_L4PER_DMTIMER2_CONTEXT_OFFSET 0x003c 394#define OMAP4_RM_L4PER_DMTIMER2_CONTEXT_OFFSET 0x003c
338#define OMAP4430_RM_L4PER_DMTIMER2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x003c) 395#define OMAP4430_RM_L4PER_DMTIMER2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x003c)
339#define OMAP4_PM_L4PER_DMTIMER3_WKDEP_OFFSET 0x0040 396#define OMAP4_PM_L4PER_DMTIMER3_WKDEP_OFFSET 0x0040
340#define OMAP4430_PM_L4PER_DMTIMER3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0040) 397#define OMAP4430_PM_L4PER_DMTIMER3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0040)
341#define OMAP4_RM_L4PER_DMTIMER3_CONTEXT_OFFSET 0x0044 398#define OMAP4_RM_L4PER_DMTIMER3_CONTEXT_OFFSET 0x0044
342#define OMAP4430_RM_L4PER_DMTIMER3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0044) 399#define OMAP4430_RM_L4PER_DMTIMER3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0044)
343#define OMAP4_PM_L4PER_DMTIMER4_WKDEP_OFFSET 0x0048 400#define OMAP4_PM_L4PER_DMTIMER4_WKDEP_OFFSET 0x0048
344#define OMAP4430_PM_L4PER_DMTIMER4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0048) 401#define OMAP4430_PM_L4PER_DMTIMER4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0048)
345#define OMAP4_RM_L4PER_DMTIMER4_CONTEXT_OFFSET 0x004c 402#define OMAP4_RM_L4PER_DMTIMER4_CONTEXT_OFFSET 0x004c
346#define OMAP4430_RM_L4PER_DMTIMER4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x004c) 403#define OMAP4430_RM_L4PER_DMTIMER4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x004c)
347#define OMAP4_PM_L4PER_DMTIMER9_WKDEP_OFFSET 0x0050 404#define OMAP4_PM_L4PER_DMTIMER9_WKDEP_OFFSET 0x0050
348#define OMAP4430_PM_L4PER_DMTIMER9_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0050) 405#define OMAP4430_PM_L4PER_DMTIMER9_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0050)
349#define OMAP4_RM_L4PER_DMTIMER9_CONTEXT_OFFSET 0x0054 406#define OMAP4_RM_L4PER_DMTIMER9_CONTEXT_OFFSET 0x0054
350#define OMAP4430_RM_L4PER_DMTIMER9_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0054) 407#define OMAP4430_RM_L4PER_DMTIMER9_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0054)
351#define OMAP4_RM_L4PER_ELM_CONTEXT_OFFSET 0x005c 408#define OMAP4_RM_L4PER_ELM_CONTEXT_OFFSET 0x005c
352#define OMAP4430_RM_L4PER_ELM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x005c) 409#define OMAP4430_RM_L4PER_ELM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x005c)
353#define OMAP4_PM_L4PER_GPIO2_WKDEP_OFFSET 0x0060 410#define OMAP4_PM_L4PER_GPIO2_WKDEP_OFFSET 0x0060
354#define OMAP4430_PM_L4PER_GPIO2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0060) 411#define OMAP4430_PM_L4PER_GPIO2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0060)
355#define OMAP4_RM_L4PER_GPIO2_CONTEXT_OFFSET 0x0064 412#define OMAP4_RM_L4PER_GPIO2_CONTEXT_OFFSET 0x0064
356#define OMAP4430_RM_L4PER_GPIO2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0064) 413#define OMAP4430_RM_L4PER_GPIO2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0064)
357#define OMAP4_PM_L4PER_GPIO3_WKDEP_OFFSET 0x0068 414#define OMAP4_PM_L4PER_GPIO3_WKDEP_OFFSET 0x0068
358#define OMAP4430_PM_L4PER_GPIO3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0068) 415#define OMAP4430_PM_L4PER_GPIO3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0068)
359#define OMAP4_RM_L4PER_GPIO3_CONTEXT_OFFSET 0x006c 416#define OMAP4_RM_L4PER_GPIO3_CONTEXT_OFFSET 0x006c
360#define OMAP4430_RM_L4PER_GPIO3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x006c) 417#define OMAP4430_RM_L4PER_GPIO3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x006c)
361#define OMAP4_PM_L4PER_GPIO4_WKDEP_OFFSET 0x0070 418#define OMAP4_PM_L4PER_GPIO4_WKDEP_OFFSET 0x0070
362#define OMAP4430_PM_L4PER_GPIO4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0070) 419#define OMAP4430_PM_L4PER_GPIO4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0070)
363#define OMAP4_RM_L4PER_GPIO4_CONTEXT_OFFSET 0x0074 420#define OMAP4_RM_L4PER_GPIO4_CONTEXT_OFFSET 0x0074
364#define OMAP4430_RM_L4PER_GPIO4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0074) 421#define OMAP4430_RM_L4PER_GPIO4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0074)
365#define OMAP4_PM_L4PER_GPIO5_WKDEP_OFFSET 0x0078 422#define OMAP4_PM_L4PER_GPIO5_WKDEP_OFFSET 0x0078
366#define OMAP4430_PM_L4PER_GPIO5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0078) 423#define OMAP4430_PM_L4PER_GPIO5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0078)
367#define OMAP4_RM_L4PER_GPIO5_CONTEXT_OFFSET 0x007c 424#define OMAP4_RM_L4PER_GPIO5_CONTEXT_OFFSET 0x007c
368#define OMAP4430_RM_L4PER_GPIO5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x007c) 425#define OMAP4430_RM_L4PER_GPIO5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x007c)
369#define OMAP4_PM_L4PER_GPIO6_WKDEP_OFFSET 0x0080 426#define OMAP4_PM_L4PER_GPIO6_WKDEP_OFFSET 0x0080
370#define OMAP4430_PM_L4PER_GPIO6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0080) 427#define OMAP4430_PM_L4PER_GPIO6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0080)
371#define OMAP4_RM_L4PER_GPIO6_CONTEXT_OFFSET 0x0084 428#define OMAP4_RM_L4PER_GPIO6_CONTEXT_OFFSET 0x0084
372#define OMAP4430_RM_L4PER_GPIO6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0084) 429#define OMAP4430_RM_L4PER_GPIO6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0084)
373#define OMAP4_RM_L4PER_HDQ1W_CONTEXT_OFFSET 0x008c 430#define OMAP4_RM_L4PER_HDQ1W_CONTEXT_OFFSET 0x008c
374#define OMAP4430_RM_L4PER_HDQ1W_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x008c) 431#define OMAP4430_RM_L4PER_HDQ1W_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x008c)
375#define OMAP4_PM_L4PER_HECC1_WKDEP_OFFSET 0x0090 432#define OMAP4_PM_L4PER_HECC1_WKDEP_OFFSET 0x0090
376#define OMAP4430_PM_L4PER_HECC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0090) 433#define OMAP4430_PM_L4PER_HECC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0090)
377#define OMAP4_RM_L4PER_HECC1_CONTEXT_OFFSET 0x0094 434#define OMAP4_RM_L4PER_HECC1_CONTEXT_OFFSET 0x0094
378#define OMAP4430_RM_L4PER_HECC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0094) 435#define OMAP4430_RM_L4PER_HECC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0094)
379#define OMAP4_PM_L4PER_HECC2_WKDEP_OFFSET 0x0098 436#define OMAP4_PM_L4PER_HECC2_WKDEP_OFFSET 0x0098
380#define OMAP4430_PM_L4PER_HECC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0098) 437#define OMAP4430_PM_L4PER_HECC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0098)
381#define OMAP4_RM_L4PER_HECC2_CONTEXT_OFFSET 0x009c 438#define OMAP4_RM_L4PER_HECC2_CONTEXT_OFFSET 0x009c
382#define OMAP4430_RM_L4PER_HECC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x009c) 439#define OMAP4430_RM_L4PER_HECC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x009c)
383#define OMAP4_PM_L4PER_I2C1_WKDEP_OFFSET 0x00a0 440#define OMAP4_PM_L4PER_I2C1_WKDEP_OFFSET 0x00a0
384#define OMAP4430_PM_L4PER_I2C1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00a0) 441#define OMAP4430_PM_L4PER_I2C1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00a0)
385#define OMAP4_RM_L4PER_I2C1_CONTEXT_OFFSET 0x00a4 442#define OMAP4_RM_L4PER_I2C1_CONTEXT_OFFSET 0x00a4
386#define OMAP4430_RM_L4PER_I2C1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00a4) 443#define OMAP4430_RM_L4PER_I2C1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00a4)
387#define OMAP4_PM_L4PER_I2C2_WKDEP_OFFSET 0x00a8 444#define OMAP4_PM_L4PER_I2C2_WKDEP_OFFSET 0x00a8
388#define OMAP4430_PM_L4PER_I2C2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00a8) 445#define OMAP4430_PM_L4PER_I2C2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00a8)
389#define OMAP4_RM_L4PER_I2C2_CONTEXT_OFFSET 0x00ac 446#define OMAP4_RM_L4PER_I2C2_CONTEXT_OFFSET 0x00ac
390#define OMAP4430_RM_L4PER_I2C2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00ac) 447#define OMAP4430_RM_L4PER_I2C2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00ac)
391#define OMAP4_PM_L4PER_I2C3_WKDEP_OFFSET 0x00b0 448#define OMAP4_PM_L4PER_I2C3_WKDEP_OFFSET 0x00b0
392#define OMAP4430_PM_L4PER_I2C3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00b0) 449#define OMAP4430_PM_L4PER_I2C3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00b0)
393#define OMAP4_RM_L4PER_I2C3_CONTEXT_OFFSET 0x00b4 450#define OMAP4_RM_L4PER_I2C3_CONTEXT_OFFSET 0x00b4
394#define OMAP4430_RM_L4PER_I2C3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00b4) 451#define OMAP4430_RM_L4PER_I2C3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00b4)
395#define OMAP4_PM_L4PER_I2C4_WKDEP_OFFSET 0x00b8 452#define OMAP4_PM_L4PER_I2C4_WKDEP_OFFSET 0x00b8
396#define OMAP4430_PM_L4PER_I2C4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00b8) 453#define OMAP4430_PM_L4PER_I2C4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00b8)
397#define OMAP4_RM_L4PER_I2C4_CONTEXT_OFFSET 0x00bc 454#define OMAP4_RM_L4PER_I2C4_CONTEXT_OFFSET 0x00bc
398#define OMAP4430_RM_L4PER_I2C4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00bc) 455#define OMAP4430_RM_L4PER_I2C4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00bc)
399#define OMAP4_RM_L4PER_L4_PER_CONTEXT_OFFSET 0x00c0 456#define OMAP4_RM_L4PER_L4_PER_CONTEXT_OFFSET 0x00c0
400#define OMAP4430_RM_L4PER_L4_PER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00c0) 457#define OMAP4430_RM_L4PER_L4_PER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00c0)
401#define OMAP4_PM_L4PER_MCASP2_WKDEP_OFFSET 0x00d0 458#define OMAP4_PM_L4PER_MCASP2_WKDEP_OFFSET 0x00d0
402#define OMAP4430_PM_L4PER_MCASP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00d0) 459#define OMAP4430_PM_L4PER_MCASP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00d0)
403#define OMAP4_RM_L4PER_MCASP2_CONTEXT_OFFSET 0x00d4 460#define OMAP4_RM_L4PER_MCASP2_CONTEXT_OFFSET 0x00d4
404#define OMAP4430_RM_L4PER_MCASP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00d4) 461#define OMAP4430_RM_L4PER_MCASP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00d4)
405#define OMAP4_PM_L4PER_MCASP3_WKDEP_OFFSET 0x00d8 462#define OMAP4_PM_L4PER_MCASP3_WKDEP_OFFSET 0x00d8
406#define OMAP4430_PM_L4PER_MCASP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00d8) 463#define OMAP4430_PM_L4PER_MCASP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00d8)
407#define OMAP4_RM_L4PER_MCASP3_CONTEXT_OFFSET 0x00dc 464#define OMAP4_RM_L4PER_MCASP3_CONTEXT_OFFSET 0x00dc
408#define OMAP4430_RM_L4PER_MCASP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00dc) 465#define OMAP4430_RM_L4PER_MCASP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00dc)
409#define OMAP4_PM_L4PER_MCBSP4_WKDEP_OFFSET 0x00e0 466#define OMAP4_PM_L4PER_MCBSP4_WKDEP_OFFSET 0x00e0
410#define OMAP4430_PM_L4PER_MCBSP4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00e0) 467#define OMAP4430_PM_L4PER_MCBSP4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00e0)
411#define OMAP4_RM_L4PER_MCBSP4_CONTEXT_OFFSET 0x00e4 468#define OMAP4_RM_L4PER_MCBSP4_CONTEXT_OFFSET 0x00e4
412#define OMAP4430_RM_L4PER_MCBSP4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00e4) 469#define OMAP4430_RM_L4PER_MCBSP4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00e4)
413#define OMAP4_RM_L4PER_MGATE_CONTEXT_OFFSET 0x00ec 470#define OMAP4_RM_L4PER_MGATE_CONTEXT_OFFSET 0x00ec
414#define OMAP4430_RM_L4PER_MGATE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00ec) 471#define OMAP4430_RM_L4PER_MGATE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00ec)
415#define OMAP4_PM_L4PER_MCSPI1_WKDEP_OFFSET 0x00f0 472#define OMAP4_PM_L4PER_MCSPI1_WKDEP_OFFSET 0x00f0
416#define OMAP4430_PM_L4PER_MCSPI1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00f0) 473#define OMAP4430_PM_L4PER_MCSPI1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00f0)
417#define OMAP4_RM_L4PER_MCSPI1_CONTEXT_OFFSET 0x00f4 474#define OMAP4_RM_L4PER_MCSPI1_CONTEXT_OFFSET 0x00f4
418#define OMAP4430_RM_L4PER_MCSPI1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00f4) 475#define OMAP4430_RM_L4PER_MCSPI1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00f4)
419#define OMAP4_PM_L4PER_MCSPI2_WKDEP_OFFSET 0x00f8 476#define OMAP4_PM_L4PER_MCSPI2_WKDEP_OFFSET 0x00f8
420#define OMAP4430_PM_L4PER_MCSPI2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00f8) 477#define OMAP4430_PM_L4PER_MCSPI2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00f8)
421#define OMAP4_RM_L4PER_MCSPI2_CONTEXT_OFFSET 0x00fc 478#define OMAP4_RM_L4PER_MCSPI2_CONTEXT_OFFSET 0x00fc
422#define OMAP4430_RM_L4PER_MCSPI2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00fc) 479#define OMAP4430_RM_L4PER_MCSPI2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00fc)
423#define OMAP4_PM_L4PER_MCSPI3_WKDEP_OFFSET 0x0100 480#define OMAP4_PM_L4PER_MCSPI3_WKDEP_OFFSET 0x0100
424#define OMAP4430_PM_L4PER_MCSPI3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0100) 481#define OMAP4430_PM_L4PER_MCSPI3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0100)
425#define OMAP4_RM_L4PER_MCSPI3_CONTEXT_OFFSET 0x0104 482#define OMAP4_RM_L4PER_MCSPI3_CONTEXT_OFFSET 0x0104
426#define OMAP4430_RM_L4PER_MCSPI3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0104) 483#define OMAP4430_RM_L4PER_MCSPI3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0104)
427#define OMAP4_PM_L4PER_MCSPI4_WKDEP_OFFSET 0x0108 484#define OMAP4_PM_L4PER_MCSPI4_WKDEP_OFFSET 0x0108
428#define OMAP4430_PM_L4PER_MCSPI4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0108) 485#define OMAP4430_PM_L4PER_MCSPI4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0108)
429#define OMAP4_RM_L4PER_MCSPI4_CONTEXT_OFFSET 0x010c 486#define OMAP4_RM_L4PER_MCSPI4_CONTEXT_OFFSET 0x010c
430#define OMAP4430_RM_L4PER_MCSPI4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x010c) 487#define OMAP4430_RM_L4PER_MCSPI4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x010c)
431#define OMAP4_PM_L4PER_MMCSD3_WKDEP_OFFSET 0x0120 488#define OMAP4_PM_L4PER_MMCSD3_WKDEP_OFFSET 0x0120
432#define OMAP4430_PM_L4PER_MMCSD3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0120) 489#define OMAP4430_PM_L4PER_MMCSD3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0120)
433#define OMAP4_RM_L4PER_MMCSD3_CONTEXT_OFFSET 0x0124 490#define OMAP4_RM_L4PER_MMCSD3_CONTEXT_OFFSET 0x0124
434#define OMAP4430_RM_L4PER_MMCSD3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0124) 491#define OMAP4430_RM_L4PER_MMCSD3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0124)
435#define OMAP4_PM_L4PER_MMCSD4_WKDEP_OFFSET 0x0128 492#define OMAP4_PM_L4PER_MMCSD4_WKDEP_OFFSET 0x0128
436#define OMAP4430_PM_L4PER_MMCSD4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0128) 493#define OMAP4430_PM_L4PER_MMCSD4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0128)
437#define OMAP4_RM_L4PER_MMCSD4_CONTEXT_OFFSET 0x012c 494#define OMAP4_RM_L4PER_MMCSD4_CONTEXT_OFFSET 0x012c
438#define OMAP4430_RM_L4PER_MMCSD4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x012c) 495#define OMAP4430_RM_L4PER_MMCSD4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x012c)
439#define OMAP4_RM_L4PER_MSPROHG_CONTEXT_OFFSET 0x0134 496#define OMAP4_RM_L4PER_MSPROHG_CONTEXT_OFFSET 0x0134
440#define OMAP4430_RM_L4PER_MSPROHG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0134) 497#define OMAP4430_RM_L4PER_MSPROHG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0134)
441#define OMAP4_PM_L4PER_SLIMBUS2_WKDEP_OFFSET 0x0138 498#define OMAP4_PM_L4PER_SLIMBUS2_WKDEP_OFFSET 0x0138
442#define OMAP4430_PM_L4PER_SLIMBUS2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0138) 499#define OMAP4430_PM_L4PER_SLIMBUS2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0138)
443#define OMAP4_RM_L4PER_SLIMBUS2_CONTEXT_OFFSET 0x013c 500#define OMAP4_RM_L4PER_SLIMBUS2_CONTEXT_OFFSET 0x013c
444#define OMAP4430_RM_L4PER_SLIMBUS2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x013c) 501#define OMAP4430_RM_L4PER_SLIMBUS2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x013c)
445#define OMAP4_PM_L4PER_UART1_WKDEP_OFFSET 0x0140 502#define OMAP4_PM_L4PER_UART1_WKDEP_OFFSET 0x0140
446#define OMAP4430_PM_L4PER_UART1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0140) 503#define OMAP4430_PM_L4PER_UART1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0140)
447#define OMAP4_RM_L4PER_UART1_CONTEXT_OFFSET 0x0144 504#define OMAP4_RM_L4PER_UART1_CONTEXT_OFFSET 0x0144
448#define OMAP4430_RM_L4PER_UART1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0144) 505#define OMAP4430_RM_L4PER_UART1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0144)
449#define OMAP4_PM_L4PER_UART2_WKDEP_OFFSET 0x0148 506#define OMAP4_PM_L4PER_UART2_WKDEP_OFFSET 0x0148
450#define OMAP4430_PM_L4PER_UART2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0148) 507#define OMAP4430_PM_L4PER_UART2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0148)
451#define OMAP4_RM_L4PER_UART2_CONTEXT_OFFSET 0x014c 508#define OMAP4_RM_L4PER_UART2_CONTEXT_OFFSET 0x014c
452#define OMAP4430_RM_L4PER_UART2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x014c) 509#define OMAP4430_RM_L4PER_UART2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x014c)
453#define OMAP4_PM_L4PER_UART3_WKDEP_OFFSET 0x0150 510#define OMAP4_PM_L4PER_UART3_WKDEP_OFFSET 0x0150
454#define OMAP4430_PM_L4PER_UART3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0150) 511#define OMAP4430_PM_L4PER_UART3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0150)
455#define OMAP4_RM_L4PER_UART3_CONTEXT_OFFSET 0x0154 512#define OMAP4_RM_L4PER_UART3_CONTEXT_OFFSET 0x0154
456#define OMAP4430_RM_L4PER_UART3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0154) 513#define OMAP4430_RM_L4PER_UART3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0154)
457#define OMAP4_PM_L4PER_UART4_WKDEP_OFFSET 0x0158 514#define OMAP4_PM_L4PER_UART4_WKDEP_OFFSET 0x0158
458#define OMAP4430_PM_L4PER_UART4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0158) 515#define OMAP4430_PM_L4PER_UART4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0158)
459#define OMAP4_RM_L4PER_UART4_CONTEXT_OFFSET 0x015c 516#define OMAP4_RM_L4PER_UART4_CONTEXT_OFFSET 0x015c
460#define OMAP4430_RM_L4PER_UART4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x015c) 517#define OMAP4430_RM_L4PER_UART4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x015c)
461#define OMAP4_PM_L4PER_MMCSD5_WKDEP_OFFSET 0x0160 518#define OMAP4_PM_L4PER_MMCSD5_WKDEP_OFFSET 0x0160
462#define OMAP4430_PM_L4PER_MMCSD5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0160) 519#define OMAP4430_PM_L4PER_MMCSD5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0160)
463#define OMAP4_RM_L4PER_MMCSD5_CONTEXT_OFFSET 0x0164 520#define OMAP4_RM_L4PER_MMCSD5_CONTEXT_OFFSET 0x0164
464#define OMAP4430_RM_L4PER_MMCSD5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0164) 521#define OMAP4430_RM_L4PER_MMCSD5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0164)
465#define OMAP4_PM_L4PER_I2C5_WKDEP_OFFSET 0x0168 522#define OMAP4_PM_L4PER_I2C5_WKDEP_OFFSET 0x0168
466#define OMAP4430_PM_L4PER_I2C5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0168) 523#define OMAP4430_PM_L4PER_I2C5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0168)
467#define OMAP4_RM_L4PER_I2C5_CONTEXT_OFFSET 0x016c 524#define OMAP4_RM_L4PER_I2C5_CONTEXT_OFFSET 0x016c
468#define OMAP4430_RM_L4PER_I2C5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x016c) 525#define OMAP4430_RM_L4PER_I2C5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x016c)
469#define OMAP4_RM_L4SEC_AES1_CONTEXT_OFFSET 0x01a4 526#define OMAP4_RM_L4SEC_AES1_CONTEXT_OFFSET 0x01a4
470#define OMAP4430_RM_L4SEC_AES1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01a4) 527#define OMAP4430_RM_L4SEC_AES1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01a4)
471#define OMAP4_RM_L4SEC_AES2_CONTEXT_OFFSET 0x01ac 528#define OMAP4_RM_L4SEC_AES2_CONTEXT_OFFSET 0x01ac
472#define OMAP4430_RM_L4SEC_AES2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01ac) 529#define OMAP4430_RM_L4SEC_AES2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01ac)
473#define OMAP4_RM_L4SEC_DES3DES_CONTEXT_OFFSET 0x01b4 530#define OMAP4_RM_L4SEC_DES3DES_CONTEXT_OFFSET 0x01b4
474#define OMAP4430_RM_L4SEC_DES3DES_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01b4) 531#define OMAP4430_RM_L4SEC_DES3DES_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01b4)
475#define OMAP4_RM_L4SEC_PKAEIP29_CONTEXT_OFFSET 0x01bc 532#define OMAP4_RM_L4SEC_PKAEIP29_CONTEXT_OFFSET 0x01bc
476#define OMAP4430_RM_L4SEC_PKAEIP29_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01bc) 533#define OMAP4430_RM_L4SEC_PKAEIP29_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01bc)
477#define OMAP4_RM_L4SEC_RNG_CONTEXT_OFFSET 0x01c4 534#define OMAP4_RM_L4SEC_RNG_CONTEXT_OFFSET 0x01c4
478#define OMAP4430_RM_L4SEC_RNG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01c4) 535#define OMAP4430_RM_L4SEC_RNG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01c4)
479#define OMAP4_RM_L4SEC_SHA2MD51_CONTEXT_OFFSET 0x01cc 536#define OMAP4_RM_L4SEC_SHA2MD51_CONTEXT_OFFSET 0x01cc
480#define OMAP4430_RM_L4SEC_SHA2MD51_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01cc) 537#define OMAP4430_RM_L4SEC_SHA2MD51_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01cc)
481#define OMAP4_RM_L4SEC_CRYPTODMA_CONTEXT_OFFSET 0x01dc 538#define OMAP4_RM_L4SEC_CRYPTODMA_CONTEXT_OFFSET 0x01dc
482#define OMAP4430_RM_L4SEC_CRYPTODMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01dc) 539#define OMAP4430_RM_L4SEC_CRYPTODMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01dc)
483 540
484/* PRM.CEFUSE_PRM register offsets */ 541/* PRM.CEFUSE_PRM register offsets */
485#define OMAP4_PM_CEFUSE_PWRSTCTRL_OFFSET 0x0000 542#define OMAP4_PM_CEFUSE_PWRSTCTRL_OFFSET 0x0000
486#define OMAP4430_PM_CEFUSE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_MOD, 0x0000) 543#define OMAP4430_PM_CEFUSE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_INST, 0x0000)
487#define OMAP4_PM_CEFUSE_PWRSTST_OFFSET 0x0004 544#define OMAP4_PM_CEFUSE_PWRSTST_OFFSET 0x0004
488#define OMAP4430_PM_CEFUSE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_MOD, 0x0004) 545#define OMAP4430_PM_CEFUSE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_INST, 0x0004)
489#define OMAP4_RM_CEFUSE_CEFUSE_CONTEXT_OFFSET 0x0024 546#define OMAP4_RM_CEFUSE_CEFUSE_CONTEXT_OFFSET 0x0024
490#define OMAP4430_RM_CEFUSE_CEFUSE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_MOD, 0x0024) 547#define OMAP4430_RM_CEFUSE_CEFUSE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_INST, 0x0024)
491 548
492/* PRM.WKUP_PRM register offsets */ 549/* PRM.WKUP_PRM register offsets */
493#define OMAP4_RM_WKUP_L4WKUP_CONTEXT_OFFSET 0x0024 550#define OMAP4_RM_WKUP_L4WKUP_CONTEXT_OFFSET 0x0024
494#define OMAP4430_RM_WKUP_L4WKUP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0024) 551#define OMAP4430_RM_WKUP_L4WKUP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0024)
495#define OMAP4_RM_WKUP_WDT1_CONTEXT_OFFSET 0x002c 552#define OMAP4_RM_WKUP_WDT1_CONTEXT_OFFSET 0x002c
496#define OMAP4430_RM_WKUP_WDT1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x002c) 553#define OMAP4430_RM_WKUP_WDT1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x002c)
497#define OMAP4_PM_WKUP_WDT2_WKDEP_OFFSET 0x0030 554#define OMAP4_PM_WKUP_WDT2_WKDEP_OFFSET 0x0030
498#define OMAP4430_PM_WKUP_WDT2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0030) 555#define OMAP4430_PM_WKUP_WDT2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0030)
499#define OMAP4_RM_WKUP_WDT2_CONTEXT_OFFSET 0x0034 556#define OMAP4_RM_WKUP_WDT2_CONTEXT_OFFSET 0x0034
500#define OMAP4430_RM_WKUP_WDT2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0034) 557#define OMAP4430_RM_WKUP_WDT2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0034)
501#define OMAP4_PM_WKUP_GPIO1_WKDEP_OFFSET 0x0038 558#define OMAP4_PM_WKUP_GPIO1_WKDEP_OFFSET 0x0038
502#define OMAP4430_PM_WKUP_GPIO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0038) 559#define OMAP4430_PM_WKUP_GPIO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0038)
503#define OMAP4_RM_WKUP_GPIO1_CONTEXT_OFFSET 0x003c 560#define OMAP4_RM_WKUP_GPIO1_CONTEXT_OFFSET 0x003c
504#define OMAP4430_RM_WKUP_GPIO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x003c) 561#define OMAP4430_RM_WKUP_GPIO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x003c)
505#define OMAP4_PM_WKUP_TIMER1_WKDEP_OFFSET 0x0040 562#define OMAP4_PM_WKUP_TIMER1_WKDEP_OFFSET 0x0040
506#define OMAP4430_PM_WKUP_TIMER1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0040) 563#define OMAP4430_PM_WKUP_TIMER1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0040)
507#define OMAP4_RM_WKUP_TIMER1_CONTEXT_OFFSET 0x0044 564#define OMAP4_RM_WKUP_TIMER1_CONTEXT_OFFSET 0x0044
508#define OMAP4430_RM_WKUP_TIMER1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0044) 565#define OMAP4430_RM_WKUP_TIMER1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0044)
509#define OMAP4_PM_WKUP_TIMER12_WKDEP_OFFSET 0x0048 566#define OMAP4_PM_WKUP_TIMER12_WKDEP_OFFSET 0x0048
510#define OMAP4430_PM_WKUP_TIMER12_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0048) 567#define OMAP4430_PM_WKUP_TIMER12_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0048)
511#define OMAP4_RM_WKUP_TIMER12_CONTEXT_OFFSET 0x004c 568#define OMAP4_RM_WKUP_TIMER12_CONTEXT_OFFSET 0x004c
512#define OMAP4430_RM_WKUP_TIMER12_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x004c) 569#define OMAP4430_RM_WKUP_TIMER12_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x004c)
513#define OMAP4_RM_WKUP_SYNCTIMER_CONTEXT_OFFSET 0x0054 570#define OMAP4_RM_WKUP_SYNCTIMER_CONTEXT_OFFSET 0x0054
514#define OMAP4430_RM_WKUP_SYNCTIMER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0054) 571#define OMAP4430_RM_WKUP_SYNCTIMER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0054)
515#define OMAP4_PM_WKUP_USIM_WKDEP_OFFSET 0x0058 572#define OMAP4_PM_WKUP_USIM_WKDEP_OFFSET 0x0058
516#define OMAP4430_PM_WKUP_USIM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0058) 573#define OMAP4430_PM_WKUP_USIM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0058)
517#define OMAP4_RM_WKUP_USIM_CONTEXT_OFFSET 0x005c 574#define OMAP4_RM_WKUP_USIM_CONTEXT_OFFSET 0x005c
518#define OMAP4430_RM_WKUP_USIM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x005c) 575#define OMAP4430_RM_WKUP_USIM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x005c)
519#define OMAP4_RM_WKUP_SARRAM_CONTEXT_OFFSET 0x0064 576#define OMAP4_RM_WKUP_SARRAM_CONTEXT_OFFSET 0x0064
520#define OMAP4430_RM_WKUP_SARRAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0064) 577#define OMAP4430_RM_WKUP_SARRAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0064)
521#define OMAP4_PM_WKUP_KEYBOARD_WKDEP_OFFSET 0x0078 578#define OMAP4_PM_WKUP_KEYBOARD_WKDEP_OFFSET 0x0078
522#define OMAP4430_PM_WKUP_KEYBOARD_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0078) 579#define OMAP4430_PM_WKUP_KEYBOARD_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0078)
523#define OMAP4_RM_WKUP_KEYBOARD_CONTEXT_OFFSET 0x007c 580#define OMAP4_RM_WKUP_KEYBOARD_CONTEXT_OFFSET 0x007c
524#define OMAP4430_RM_WKUP_KEYBOARD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x007c) 581#define OMAP4430_RM_WKUP_KEYBOARD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x007c)
525#define OMAP4_PM_WKUP_RTC_WKDEP_OFFSET 0x0080 582#define OMAP4_PM_WKUP_RTC_WKDEP_OFFSET 0x0080
526#define OMAP4430_PM_WKUP_RTC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0080) 583#define OMAP4430_PM_WKUP_RTC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0080)
527#define OMAP4_RM_WKUP_RTC_CONTEXT_OFFSET 0x0084 584#define OMAP4_RM_WKUP_RTC_CONTEXT_OFFSET 0x0084
528#define OMAP4430_RM_WKUP_RTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0084) 585#define OMAP4430_RM_WKUP_RTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0084)
529 586
530/* PRM.WKUP_CM register offsets */ 587/* PRM.WKUP_CM register offsets */
531#define OMAP4_CM_WKUP_CLKSTCTRL_OFFSET 0x0000 588#define OMAP4_CM_WKUP_CLKSTCTRL_OFFSET 0x0000
532#define OMAP4430_CM_WKUP_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0000) 589#define OMAP4430_CM_WKUP_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0000)
533#define OMAP4_CM_WKUP_L4WKUP_CLKCTRL_OFFSET 0x0020 590#define OMAP4_CM_WKUP_L4WKUP_CLKCTRL_OFFSET 0x0020
534#define OMAP4430_CM_WKUP_L4WKUP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0020) 591#define OMAP4430_CM_WKUP_L4WKUP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0020)
535#define OMAP4_CM_WKUP_WDT1_CLKCTRL_OFFSET 0x0028 592#define OMAP4_CM_WKUP_WDT1_CLKCTRL_OFFSET 0x0028
536#define OMAP4430_CM_WKUP_WDT1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0028) 593#define OMAP4430_CM_WKUP_WDT1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0028)
537#define OMAP4_CM_WKUP_WDT2_CLKCTRL_OFFSET 0x0030 594#define OMAP4_CM_WKUP_WDT2_CLKCTRL_OFFSET 0x0030
538#define OMAP4430_CM_WKUP_WDT2_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0030) 595#define OMAP4430_CM_WKUP_WDT2_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0030)
539#define OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET 0x0038 596#define OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET 0x0038
540#define OMAP4430_CM_WKUP_GPIO1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0038) 597#define OMAP4430_CM_WKUP_GPIO1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0038)
541#define OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET 0x0040 598#define OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET 0x0040
542#define OMAP4430_CM_WKUP_TIMER1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0040) 599#define OMAP4430_CM_WKUP_TIMER1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0040)
543#define OMAP4_CM_WKUP_TIMER12_CLKCTRL_OFFSET 0x0048 600#define OMAP4_CM_WKUP_TIMER12_CLKCTRL_OFFSET 0x0048
544#define OMAP4430_CM_WKUP_TIMER12_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0048) 601#define OMAP4430_CM_WKUP_TIMER12_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0048)
545#define OMAP4_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET 0x0050 602#define OMAP4_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET 0x0050
546#define OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0050) 603#define OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0050)
547#define OMAP4_CM_WKUP_USIM_CLKCTRL_OFFSET 0x0058 604#define OMAP4_CM_WKUP_USIM_CLKCTRL_OFFSET 0x0058
548#define OMAP4430_CM_WKUP_USIM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0058) 605#define OMAP4430_CM_WKUP_USIM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0058)
549#define OMAP4_CM_WKUP_SARRAM_CLKCTRL_OFFSET 0x0060 606#define OMAP4_CM_WKUP_SARRAM_CLKCTRL_OFFSET 0x0060
550#define OMAP4430_CM_WKUP_SARRAM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0060) 607#define OMAP4430_CM_WKUP_SARRAM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0060)
551#define OMAP4_CM_WKUP_KEYBOARD_CLKCTRL_OFFSET 0x0078 608#define OMAP4_CM_WKUP_KEYBOARD_CLKCTRL_OFFSET 0x0078
552#define OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0078) 609#define OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0078)
553#define OMAP4_CM_WKUP_RTC_CLKCTRL_OFFSET 0x0080 610#define OMAP4_CM_WKUP_RTC_CLKCTRL_OFFSET 0x0080
554#define OMAP4430_CM_WKUP_RTC_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0080) 611#define OMAP4430_CM_WKUP_RTC_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0080)
555#define OMAP4_CM_WKUP_BANDGAP_CLKCTRL_OFFSET 0x0088 612#define OMAP4_CM_WKUP_BANDGAP_CLKCTRL_OFFSET 0x0088
556#define OMAP4430_CM_WKUP_BANDGAP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0088) 613#define OMAP4430_CM_WKUP_BANDGAP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0088)
557 614
558/* PRM.EMU_PRM register offsets */ 615/* PRM.EMU_PRM register offsets */
559#define OMAP4_PM_EMU_PWRSTCTRL_OFFSET 0x0000 616#define OMAP4_PM_EMU_PWRSTCTRL_OFFSET 0x0000
560#define OMAP4430_PM_EMU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_MOD, 0x0000) 617#define OMAP4430_PM_EMU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_INST, 0x0000)
561#define OMAP4_PM_EMU_PWRSTST_OFFSET 0x0004 618#define OMAP4_PM_EMU_PWRSTST_OFFSET 0x0004
562#define OMAP4430_PM_EMU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_MOD, 0x0004) 619#define OMAP4430_PM_EMU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_INST, 0x0004)
563#define OMAP4_RM_EMU_DEBUGSS_CONTEXT_OFFSET 0x0024 620#define OMAP4_RM_EMU_DEBUGSS_CONTEXT_OFFSET 0x0024
564#define OMAP4430_RM_EMU_DEBUGSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_MOD, 0x0024) 621#define OMAP4430_RM_EMU_DEBUGSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_INST, 0x0024)
565 622
566/* PRM.EMU_CM register offsets */ 623/* PRM.EMU_CM register offsets */
567#define OMAP4_CM_EMU_CLKSTCTRL_OFFSET 0x0000 624#define OMAP4_CM_EMU_CLKSTCTRL_OFFSET 0x0000
568#define OMAP4430_CM_EMU_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_MOD, 0x0000) 625#define OMAP4430_CM_EMU_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_INST, 0x0000)
569#define OMAP4_CM_EMU_DYNAMICDEP_OFFSET 0x0008 626#define OMAP4_CM_EMU_DYNAMICDEP_OFFSET 0x0008
570#define OMAP4430_CM_EMU_DYNAMICDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_MOD, 0x0008) 627#define OMAP4430_CM_EMU_DYNAMICDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_INST, 0x0008)
571#define OMAP4_CM_EMU_DEBUGSS_CLKCTRL_OFFSET 0x0020 628#define OMAP4_CM_EMU_DEBUGSS_CLKCTRL_OFFSET 0x0020
572#define OMAP4430_CM_EMU_DEBUGSS_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_MOD, 0x0020) 629#define OMAP4430_CM_EMU_DEBUGSS_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_INST, 0x0020)
573 630
574/* PRM.DEVICE_PRM register offsets */ 631/* PRM.DEVICE_PRM register offsets */
575#define OMAP4_PRM_RSTCTRL_OFFSET 0x0000 632#define OMAP4_PRM_RSTCTRL_OFFSET 0x0000
576#define OMAP4430_PRM_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0000) 633#define OMAP4430_PRM_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0000)
577#define OMAP4_PRM_RSTST_OFFSET 0x0004 634#define OMAP4_PRM_RSTST_OFFSET 0x0004
578#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0004) 635#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0004)
579#define OMAP4_PRM_RSTTIME_OFFSET 0x0008 636#define OMAP4_PRM_RSTTIME_OFFSET 0x0008
580#define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0008) 637#define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0008)
581#define OMAP4_PRM_CLKREQCTRL_OFFSET 0x000c 638#define OMAP4_PRM_CLKREQCTRL_OFFSET 0x000c
582#define OMAP4430_PRM_CLKREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x000c) 639#define OMAP4430_PRM_CLKREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x000c)
583#define OMAP4_PRM_VOLTCTRL_OFFSET 0x0010 640#define OMAP4_PRM_VOLTCTRL_OFFSET 0x0010
584#define OMAP4430_PRM_VOLTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0010) 641#define OMAP4430_PRM_VOLTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0010)
585#define OMAP4_PRM_PWRREQCTRL_OFFSET 0x0014 642#define OMAP4_PRM_PWRREQCTRL_OFFSET 0x0014
586#define OMAP4430_PRM_PWRREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0014) 643#define OMAP4430_PRM_PWRREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0014)
587#define OMAP4_PRM_PSCON_COUNT_OFFSET 0x0018 644#define OMAP4_PRM_PSCON_COUNT_OFFSET 0x0018
588#define OMAP4430_PRM_PSCON_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0018) 645#define OMAP4430_PRM_PSCON_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0018)
589#define OMAP4_PRM_IO_COUNT_OFFSET 0x001c 646#define OMAP4_PRM_IO_COUNT_OFFSET 0x001c
590#define OMAP4430_PRM_IO_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x001c) 647#define OMAP4430_PRM_IO_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x001c)
591#define OMAP4_PRM_IO_PMCTRL_OFFSET 0x0020 648#define OMAP4_PRM_IO_PMCTRL_OFFSET 0x0020
592#define OMAP4430_PRM_IO_PMCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0020) 649#define OMAP4430_PRM_IO_PMCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0020)
593#define OMAP4_PRM_VOLTSETUP_WARMRESET_OFFSET 0x0024 650#define OMAP4_PRM_VOLTSETUP_WARMRESET_OFFSET 0x0024
594#define OMAP4430_PRM_VOLTSETUP_WARMRESET OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0024) 651#define OMAP4430_PRM_VOLTSETUP_WARMRESET OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0024)
595#define OMAP4_PRM_VOLTSETUP_CORE_OFF_OFFSET 0x0028 652#define OMAP4_PRM_VOLTSETUP_CORE_OFF_OFFSET 0x0028
596#define OMAP4430_PRM_VOLTSETUP_CORE_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0028) 653#define OMAP4430_PRM_VOLTSETUP_CORE_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0028)
597#define OMAP4_PRM_VOLTSETUP_MPU_OFF_OFFSET 0x002c 654#define OMAP4_PRM_VOLTSETUP_MPU_OFF_OFFSET 0x002c
598#define OMAP4430_PRM_VOLTSETUP_MPU_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x002c) 655#define OMAP4430_PRM_VOLTSETUP_MPU_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x002c)
599#define OMAP4_PRM_VOLTSETUP_IVA_OFF_OFFSET 0x0030 656#define OMAP4_PRM_VOLTSETUP_IVA_OFF_OFFSET 0x0030
600#define OMAP4430_PRM_VOLTSETUP_IVA_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0030) 657#define OMAP4430_PRM_VOLTSETUP_IVA_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0030)
601#define OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET 0x0034 658#define OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET 0x0034
602#define OMAP4430_PRM_VOLTSETUP_CORE_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0034) 659#define OMAP4430_PRM_VOLTSETUP_CORE_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0034)
603#define OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET 0x0038 660#define OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET 0x0038
604#define OMAP4430_PRM_VOLTSETUP_MPU_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0038) 661#define OMAP4430_PRM_VOLTSETUP_MPU_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0038)
605#define OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET 0x003c 662#define OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET 0x003c
606#define OMAP4430_PRM_VOLTSETUP_IVA_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x003c) 663#define OMAP4430_PRM_VOLTSETUP_IVA_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x003c)
607#define OMAP4_PRM_VP_CORE_CONFIG_OFFSET 0x0040 664#define OMAP4_PRM_VP_CORE_CONFIG_OFFSET 0x0040
608#define OMAP4430_PRM_VP_CORE_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0040) 665#define OMAP4430_PRM_VP_CORE_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0040)
609#define OMAP4_PRM_VP_CORE_STATUS_OFFSET 0x0044 666#define OMAP4_PRM_VP_CORE_STATUS_OFFSET 0x0044
610#define OMAP4430_PRM_VP_CORE_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0044) 667#define OMAP4430_PRM_VP_CORE_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0044)
611#define OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET 0x0048 668#define OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET 0x0048
612#define OMAP4430_PRM_VP_CORE_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0048) 669#define OMAP4430_PRM_VP_CORE_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0048)
613#define OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET 0x004c 670#define OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET 0x004c
614#define OMAP4430_PRM_VP_CORE_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x004c) 671#define OMAP4430_PRM_VP_CORE_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x004c)
615#define OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET 0x0050 672#define OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET 0x0050
616#define OMAP4430_PRM_VP_CORE_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0050) 673#define OMAP4430_PRM_VP_CORE_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0050)
617#define OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET 0x0054 674#define OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET 0x0054
618#define OMAP4430_PRM_VP_CORE_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0054) 675#define OMAP4430_PRM_VP_CORE_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0054)
619#define OMAP4_PRM_VP_MPU_CONFIG_OFFSET 0x0058 676#define OMAP4_PRM_VP_MPU_CONFIG_OFFSET 0x0058
620#define OMAP4430_PRM_VP_MPU_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0058) 677#define OMAP4430_PRM_VP_MPU_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0058)
621#define OMAP4_PRM_VP_MPU_STATUS_OFFSET 0x005c 678#define OMAP4_PRM_VP_MPU_STATUS_OFFSET 0x005c
622#define OMAP4430_PRM_VP_MPU_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x005c) 679#define OMAP4430_PRM_VP_MPU_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x005c)
623#define OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET 0x0060 680#define OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET 0x0060
624#define OMAP4430_PRM_VP_MPU_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0060) 681#define OMAP4430_PRM_VP_MPU_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0060)
625#define OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET 0x0064 682#define OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET 0x0064
626#define OMAP4430_PRM_VP_MPU_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0064) 683#define OMAP4430_PRM_VP_MPU_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0064)
627#define OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET 0x0068 684#define OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET 0x0068
628#define OMAP4430_PRM_VP_MPU_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0068) 685#define OMAP4430_PRM_VP_MPU_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0068)
629#define OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET 0x006c 686#define OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET 0x006c
630#define OMAP4430_PRM_VP_MPU_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x006c) 687#define OMAP4430_PRM_VP_MPU_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x006c)
631#define OMAP4_PRM_VP_IVA_CONFIG_OFFSET 0x0070 688#define OMAP4_PRM_VP_IVA_CONFIG_OFFSET 0x0070
632#define OMAP4430_PRM_VP_IVA_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0070) 689#define OMAP4430_PRM_VP_IVA_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0070)
633#define OMAP4_PRM_VP_IVA_STATUS_OFFSET 0x0074 690#define OMAP4_PRM_VP_IVA_STATUS_OFFSET 0x0074
634#define OMAP4430_PRM_VP_IVA_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0074) 691#define OMAP4430_PRM_VP_IVA_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0074)
635#define OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET 0x0078 692#define OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET 0x0078
636#define OMAP4430_PRM_VP_IVA_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0078) 693#define OMAP4430_PRM_VP_IVA_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0078)
637#define OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET 0x007c 694#define OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET 0x007c
638#define OMAP4430_PRM_VP_IVA_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x007c) 695#define OMAP4430_PRM_VP_IVA_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x007c)
639#define OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET 0x0080 696#define OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET 0x0080
640#define OMAP4430_PRM_VP_IVA_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0080) 697#define OMAP4430_PRM_VP_IVA_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0080)
641#define OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET 0x0084 698#define OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET 0x0084
642#define OMAP4430_PRM_VP_IVA_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0084) 699#define OMAP4430_PRM_VP_IVA_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0084)
643#define OMAP4_PRM_VC_SMPS_SA_OFFSET 0x0088 700#define OMAP4_PRM_VC_SMPS_SA_OFFSET 0x0088
644#define OMAP4430_PRM_VC_SMPS_SA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0088) 701#define OMAP4430_PRM_VC_SMPS_SA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0088)
645#define OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET 0x008c 702#define OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET 0x008c
646#define OMAP4430_PRM_VC_VAL_SMPS_RA_VOL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x008c) 703#define OMAP4430_PRM_VC_VAL_SMPS_RA_VOL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x008c)
647#define OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET 0x0090 704#define OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET 0x0090
648#define OMAP4430_PRM_VC_VAL_SMPS_RA_CMD OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0090) 705#define OMAP4430_PRM_VC_VAL_SMPS_RA_CMD OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0090)
649#define OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET 0x0094 706#define OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET 0x0094
650#define OMAP4430_PRM_VC_VAL_CMD_VDD_CORE_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0094) 707#define OMAP4430_PRM_VC_VAL_CMD_VDD_CORE_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0094)
651#define OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET 0x0098 708#define OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET 0x0098
652#define OMAP4430_PRM_VC_VAL_CMD_VDD_MPU_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0098) 709#define OMAP4430_PRM_VC_VAL_CMD_VDD_MPU_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0098)
653#define OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET 0x009c 710#define OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET 0x009c
654#define OMAP4430_PRM_VC_VAL_CMD_VDD_IVA_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x009c) 711#define OMAP4430_PRM_VC_VAL_CMD_VDD_IVA_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x009c)
655#define OMAP4_PRM_VC_VAL_BYPASS_OFFSET 0x00a0 712#define OMAP4_PRM_VC_VAL_BYPASS_OFFSET 0x00a0
656#define OMAP4430_PRM_VC_VAL_BYPASS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00a0) 713#define OMAP4430_PRM_VC_VAL_BYPASS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00a0)
657#define OMAP4_PRM_VC_CFG_CHANNEL_OFFSET 0x00a4 714#define OMAP4_PRM_VC_CFG_CHANNEL_OFFSET 0x00a4
658#define OMAP4430_PRM_VC_CFG_CHANNEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00a4) 715#define OMAP4430_PRM_VC_CFG_CHANNEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00a4)
659#define OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET 0x00a8 716#define OMAP4_PRM_VC_CFG_I2C_INSTE_OFFSET 0x00a8
660#define OMAP4430_PRM_VC_CFG_I2C_MODE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00a8) 717#define OMAP4430_PRM_VC_CFG_I2C_INSTE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00a8)
661#define OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET 0x00ac 718#define OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET 0x00ac
662#define OMAP4430_PRM_VC_CFG_I2C_CLK OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00ac) 719#define OMAP4430_PRM_VC_CFG_I2C_CLK OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00ac)
663#define OMAP4_PRM_SRAM_COUNT_OFFSET 0x00b0 720#define OMAP4_PRM_SRAM_COUNT_OFFSET 0x00b0
664#define OMAP4430_PRM_SRAM_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00b0) 721#define OMAP4430_PRM_SRAM_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00b0)
665#define OMAP4_PRM_SRAM_WKUP_SETUP_OFFSET 0x00b4 722#define OMAP4_PRM_SRAM_WKUP_SETUP_OFFSET 0x00b4
666#define OMAP4430_PRM_SRAM_WKUP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00b4) 723#define OMAP4430_PRM_SRAM_WKUP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00b4)
667#define OMAP4_PRM_LDO_SRAM_CORE_SETUP_OFFSET 0x00b8 724#define OMAP4_PRM_LDO_SRAM_CORE_SETUP_OFFSET 0x00b8
668#define OMAP4430_PRM_LDO_SRAM_CORE_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00b8) 725#define OMAP4430_PRM_LDO_SRAM_CORE_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00b8)
669#define OMAP4_PRM_LDO_SRAM_CORE_CTRL_OFFSET 0x00bc 726#define OMAP4_PRM_LDO_SRAM_CORE_CTRL_OFFSET 0x00bc
670#define OMAP4430_PRM_LDO_SRAM_CORE_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00bc) 727#define OMAP4430_PRM_LDO_SRAM_CORE_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00bc)
671#define OMAP4_PRM_LDO_SRAM_MPU_SETUP_OFFSET 0x00c0 728#define OMAP4_PRM_LDO_SRAM_MPU_SETUP_OFFSET 0x00c0
672#define OMAP4430_PRM_LDO_SRAM_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00c0) 729#define OMAP4430_PRM_LDO_SRAM_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00c0)
673#define OMAP4_PRM_LDO_SRAM_MPU_CTRL_OFFSET 0x00c4 730#define OMAP4_PRM_LDO_SRAM_MPU_CTRL_OFFSET 0x00c4
674#define OMAP4430_PRM_LDO_SRAM_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00c4) 731#define OMAP4430_PRM_LDO_SRAM_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00c4)
675#define OMAP4_PRM_LDO_SRAM_IVA_SETUP_OFFSET 0x00c8 732#define OMAP4_PRM_LDO_SRAM_IVA_SETUP_OFFSET 0x00c8
676#define OMAP4430_PRM_LDO_SRAM_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00c8) 733#define OMAP4430_PRM_LDO_SRAM_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00c8)
677#define OMAP4_PRM_LDO_SRAM_IVA_CTRL_OFFSET 0x00cc 734#define OMAP4_PRM_LDO_SRAM_IVA_CTRL_OFFSET 0x00cc
678#define OMAP4430_PRM_LDO_SRAM_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00cc) 735#define OMAP4430_PRM_LDO_SRAM_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00cc)
679#define OMAP4_PRM_LDO_ABB_MPU_SETUP_OFFSET 0x00d0 736#define OMAP4_PRM_LDO_ABB_MPU_SETUP_OFFSET 0x00d0
680#define OMAP4430_PRM_LDO_ABB_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00d0) 737#define OMAP4430_PRM_LDO_ABB_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00d0)
681#define OMAP4_PRM_LDO_ABB_MPU_CTRL_OFFSET 0x00d4 738#define OMAP4_PRM_LDO_ABB_MPU_CTRL_OFFSET 0x00d4
682#define OMAP4430_PRM_LDO_ABB_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00d4) 739#define OMAP4430_PRM_LDO_ABB_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00d4)
683#define OMAP4_PRM_LDO_ABB_IVA_SETUP_OFFSET 0x00d8 740#define OMAP4_PRM_LDO_ABB_IVA_SETUP_OFFSET 0x00d8
684#define OMAP4430_PRM_LDO_ABB_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00d8) 741#define OMAP4430_PRM_LDO_ABB_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00d8)
685#define OMAP4_PRM_LDO_ABB_IVA_CTRL_OFFSET 0x00dc 742#define OMAP4_PRM_LDO_ABB_IVA_CTRL_OFFSET 0x00dc
686#define OMAP4430_PRM_LDO_ABB_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00dc) 743#define OMAP4430_PRM_LDO_ABB_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00dc)
687#define OMAP4_PRM_LDO_BANDGAP_SETUP_OFFSET 0x00e0 744#define OMAP4_PRM_LDO_BANDGAP_SETUP_OFFSET 0x00e0
688#define OMAP4430_PRM_LDO_BANDGAP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00e0) 745#define OMAP4430_PRM_LDO_BANDGAP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00e0)
689#define OMAP4_PRM_DEVICE_OFF_CTRL_OFFSET 0x00e4 746#define OMAP4_PRM_DEVICE_OFF_CTRL_OFFSET 0x00e4
690#define OMAP4430_PRM_DEVICE_OFF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00e4) 747#define OMAP4430_PRM_DEVICE_OFF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00e4)
691#define OMAP4_PRM_PHASE1_CNDP_OFFSET 0x00e8 748#define OMAP4_PRM_PHASE1_CNDP_OFFSET 0x00e8
692#define OMAP4430_PRM_PHASE1_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00e8) 749#define OMAP4430_PRM_PHASE1_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00e8)
693#define OMAP4_PRM_PHASE2A_CNDP_OFFSET 0x00ec 750#define OMAP4_PRM_PHASE2A_CNDP_OFFSET 0x00ec
694#define OMAP4430_PRM_PHASE2A_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00ec) 751#define OMAP4430_PRM_PHASE2A_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00ec)
695#define OMAP4_PRM_PHASE2B_CNDP_OFFSET 0x00f0 752#define OMAP4_PRM_PHASE2B_CNDP_OFFSET 0x00f0
696#define OMAP4430_PRM_PHASE2B_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f0) 753#define OMAP4430_PRM_PHASE2B_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00f0)
697#define OMAP4_PRM_MODEM_IF_CTRL_OFFSET 0x00f4 754#define OMAP4_PRM_INSTEM_IF_CTRL_OFFSET 0x00f4
698#define OMAP4430_PRM_MODEM_IF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f4) 755#define OMAP4430_PRM_INSTEM_IF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00f4)
699#define OMAP4_PRM_VC_ERRST_OFFSET 0x00f8 756#define OMAP4_PRM_VC_ERRST_OFFSET 0x00f8
700#define OMAP4430_PRM_VC_ERRST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f8) 757#define OMAP4430_PRM_VC_ERRST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00f8)
701 758
702/* 759/* Function prototypes */
703 * PRCM_MPU 760# ifndef __ASSEMBLER__
704 * 761
705 * The PRCM_MPU is a local PRCM inside the MPU subsystem. For the PRCM (global) 762extern u32 omap4_prm_read_inst_reg(s16 inst, u16 idx);
706 * point of view the PRCM_MPU is a single entity. It shares the same 763extern void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 idx);
707 * programming model as the global PRCM and thus can be assimilate as two new 764extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
708 * MOD inside the PRCM 765extern u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
709 */ 766extern u32 omap4_prm_set_inst_reg_bits(u32 bits, s16 inst, s16 idx);
767extern u32 omap4_prm_clear_inst_reg_bits(u32 bits, s16 inst, s16 idx);
768extern u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
769
770extern int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
771extern int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
772extern int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
773
774extern void omap4_prm_global_warm_sw_reset(void);
775
776# endif
710 777
711/* PRCM_MPU.OCP_SOCKET_PRCM register offsets */
712#define OMAP4_REVISION_PRCM_OFFSET 0x0000
713#define OMAP4430_REVISION_PRCM OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD, 0x0000)
714
715/* PRCM_MPU.DEVICE_PRM register offsets */
716#define OMAP4_PRCM_MPU_PRM_RSTST_OFFSET 0x0000
717#define OMAP4430_PRCM_MPU_PRM_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0000)
718#define OMAP4_PRCM_MPU_PRM_PSCON_COUNT_OFFSET 0x0004
719#define OMAP4430_PRCM_MPU_PRM_PSCON_COUNT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0004)
720
721/* PRCM_MPU.CPU0 register offsets */
722#define OMAP4_PM_CPU0_PWRSTCTRL_OFFSET 0x0000
723#define OMAP4430_PM_CPU0_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0000)
724#define OMAP4_PM_CPU0_PWRSTST_OFFSET 0x0004
725#define OMAP4430_PM_CPU0_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0004)
726#define OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET 0x0008
727#define OMAP4430_RM_CPU0_CPU0_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0008)
728#define OMAP4_RM_CPU0_CPU0_RSTCTRL_OFFSET 0x000c
729#define OMAP4430_RM_CPU0_CPU0_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x000c)
730#define OMAP4_RM_CPU0_CPU0_RSTST_OFFSET 0x0010
731#define OMAP4430_RM_CPU0_CPU0_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0010)
732#define OMAP4_CM_CPU0_CPU0_CLKCTRL_OFFSET 0x0014
733#define OMAP4430_CM_CPU0_CPU0_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0014)
734#define OMAP4_CM_CPU0_CLKSTCTRL_OFFSET 0x0018
735#define OMAP4430_CM_CPU0_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0018)
736
737/* PRCM_MPU.CPU1 register offsets */
738#define OMAP4_PM_CPU1_PWRSTCTRL_OFFSET 0x0000
739#define OMAP4430_PM_CPU1_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0000)
740#define OMAP4_PM_CPU1_PWRSTST_OFFSET 0x0004
741#define OMAP4430_PM_CPU1_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0004)
742#define OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET 0x0008
743#define OMAP4430_RM_CPU1_CPU1_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0008)
744#define OMAP4_RM_CPU1_CPU1_RSTCTRL_OFFSET 0x000c
745#define OMAP4430_RM_CPU1_CPU1_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x000c)
746#define OMAP4_RM_CPU1_CPU1_RSTST_OFFSET 0x0010
747#define OMAP4430_RM_CPU1_CPU1_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0010)
748#define OMAP4_CM_CPU1_CPU1_CLKCTRL_OFFSET 0x0014
749#define OMAP4430_CM_CPU1_CPU1_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0014)
750#define OMAP4_CM_CPU1_CLKSTCTRL_OFFSET 0x0018
751#define OMAP4430_CM_CPU1_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0018)
752#endif 778#endif
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
new file mode 100644
index 000000000000..a30324297278
--- /dev/null
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -0,0 +1,66 @@
1/*
2 * OMAP4 PRM instance functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/io.h>
17
18#include <plat/common.h>
19
20#include "prm44xx.h"
21#include "prminst44xx.h"
22#include "prm-regbits-44xx.h"
23#include "prcm44xx.h"
24#include "prcm_mpu44xx.h"
25
26static u32 _prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
27 [OMAP4430_INVALID_PRCM_PARTITION] = 0,
28 [OMAP4430_PRM_PARTITION] = OMAP4430_PRM_BASE,
29 [OMAP4430_CM1_PARTITION] = 0,
30 [OMAP4430_CM2_PARTITION] = 0,
31 [OMAP4430_SCRM_PARTITION] = 0,
32 [OMAP4430_PRCM_MPU_PARTITION] = OMAP4430_PRCM_MPU_BASE,
33};
34
35/* Read a register in a PRM instance */
36u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx)
37{
38 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
39 part == OMAP4430_INVALID_PRCM_PARTITION ||
40 !_prm_bases[part]);
41 return __raw_readl(OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst +
42 idx));
43}
44
45/* Write into a register in a PRM instance */
46void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx)
47{
48 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
49 part == OMAP4430_INVALID_PRCM_PARTITION ||
50 !_prm_bases[part]);
51 __raw_writel(val, OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst + idx));
52}
53
54/* Read-modify-write a register in PRM. Caller must lock */
55u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
56 s16 idx)
57{
58 u32 v;
59
60 v = omap4_prminst_read_inst_reg(part, inst, idx);
61 v &= ~mask;
62 v |= bits;
63 omap4_prminst_write_inst_reg(v, part, inst, idx);
64
65 return v;
66}
diff --git a/arch/arm/mach-omap2/prminst44xx.h b/arch/arm/mach-omap2/prminst44xx.h
new file mode 100644
index 000000000000..02dd66ddda8b
--- /dev/null
+++ b/arch/arm/mach-omap2/prminst44xx.h
@@ -0,0 +1,25 @@
1/*
2 * OMAP4 Power/Reset Management (PRM) function prototypes
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 * Paul Walmsley
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_ASM_MACH_OMAP2_PRMINST44XX_H
12#define __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H
13
14/*
15 * In an ideal world, we would not export these low-level functions,
16 * but this will probably take some time to fix properly
17 */
18extern u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx);
19extern void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx);
20extern u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part,
21 s16 inst, s16 idx);
22
23extern void omap4_prm_global_warm_sw_reset(void);
24
25#endif
diff --git a/arch/arm/mach-omap2/scrm44xx.h b/arch/arm/mach-omap2/scrm44xx.h
new file mode 100644
index 000000000000..701bf2d32949
--- /dev/null
+++ b/arch/arm/mach-omap2/scrm44xx.h
@@ -0,0 +1,175 @@
1/*
2 * OMAP44xx SCRM registers and bitfields
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 *
6 * Benoit Cousson (b-cousson@ti.com)
7 *
8 * This file is automatically generated from the OMAP hardware databases.
9 * We respectfully ask that any modifications to this file be coordinated
10 * with the public linux-omap@vger.kernel.org mailing list and the
11 * authors above to ensure that the autogeneration scripts are kept
12 * up-to-date with the file contents.
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#ifndef __ARCH_ARM_MACH_OMAP2_SCRM_44XX_H
20#define __ARCH_ARM_MACH_OMAP2_SCRM_44XX_H
21
22#define OMAP4_SCRM_BASE 0x4a30a000
23
24#define OMAP44XX_SCRM_REGADDR(reg) \
25 OMAP2_L4_IO_ADDRESS(OMAP4_SCRM_BASE + (reg))
26
27/* Registers offset */
28#define OMAP4_SCRM_REVISION_SCRM_OFFSET 0x0000
29#define OMAP4_SCRM_REVISION_SCRM OMAP44XX_SCRM_REGADDR(0x0000)
30#define OMAP4_SCRM_CLKSETUPTIME_OFFSET 0x0100
31#define OMAP4_SCRM_CLKSETUPTIME OMAP44XX_SCRM_REGADDR(0x0100)
32#define OMAP4_SCRM_PMICSETUPTIME_OFFSET 0x0104
33#define OMAP4_SCRM_PMICSETUPTIME OMAP44XX_SCRM_REGADDR(0x0104)
34#define OMAP4_SCRM_ALTCLKSRC_OFFSET 0x0110
35#define OMAP4_SCRM_ALTCLKSRC OMAP44XX_SCRM_REGADDR(0x0110)
36#define OMAP4_SCRM_MODEMCLKM_OFFSET 0x0118
37#define OMAP4_SCRM_MODEMCLKM OMAP44XX_SCRM_REGADDR(0x0118)
38#define OMAP4_SCRM_D2DCLKM_OFFSET 0x011c
39#define OMAP4_SCRM_D2DCLKM OMAP44XX_SCRM_REGADDR(0x011c)
40#define OMAP4_SCRM_EXTCLKREQ_OFFSET 0x0200
41#define OMAP4_SCRM_EXTCLKREQ OMAP44XX_SCRM_REGADDR(0x0200)
42#define OMAP4_SCRM_ACCCLKREQ_OFFSET 0x0204
43#define OMAP4_SCRM_ACCCLKREQ OMAP44XX_SCRM_REGADDR(0x0204)
44#define OMAP4_SCRM_PWRREQ_OFFSET 0x0208
45#define OMAP4_SCRM_PWRREQ OMAP44XX_SCRM_REGADDR(0x0208)
46#define OMAP4_SCRM_AUXCLKREQ0_OFFSET 0x0210
47#define OMAP4_SCRM_AUXCLKREQ0 OMAP44XX_SCRM_REGADDR(0x0210)
48#define OMAP4_SCRM_AUXCLKREQ1_OFFSET 0x0214
49#define OMAP4_SCRM_AUXCLKREQ1 OMAP44XX_SCRM_REGADDR(0x0214)
50#define OMAP4_SCRM_AUXCLKREQ2_OFFSET 0x0218
51#define OMAP4_SCRM_AUXCLKREQ2 OMAP44XX_SCRM_REGADDR(0x0218)
52#define OMAP4_SCRM_AUXCLKREQ3_OFFSET 0x021c
53#define OMAP4_SCRM_AUXCLKREQ3 OMAP44XX_SCRM_REGADDR(0x021c)
54#define OMAP4_SCRM_AUXCLKREQ4_OFFSET 0x0220
55#define OMAP4_SCRM_AUXCLKREQ4 OMAP44XX_SCRM_REGADDR(0x0220)
56#define OMAP4_SCRM_AUXCLKREQ5_OFFSET 0x0224
57#define OMAP4_SCRM_AUXCLKREQ5 OMAP44XX_SCRM_REGADDR(0x0224)
58#define OMAP4_SCRM_D2DCLKREQ_OFFSET 0x0234
59#define OMAP4_SCRM_D2DCLKREQ OMAP44XX_SCRM_REGADDR(0x0234)
60#define OMAP4_SCRM_AUXCLK0_OFFSET 0x0310
61#define OMAP4_SCRM_AUXCLK0 OMAP44XX_SCRM_REGADDR(0x0310)
62#define OMAP4_SCRM_AUXCLK1_OFFSET 0x0314
63#define OMAP4_SCRM_AUXCLK1 OMAP44XX_SCRM_REGADDR(0x0314)
64#define OMAP4_SCRM_AUXCLK2_OFFSET 0x0318
65#define OMAP4_SCRM_AUXCLK2 OMAP44XX_SCRM_REGADDR(0x0318)
66#define OMAP4_SCRM_AUXCLK3_OFFSET 0x031c
67#define OMAP4_SCRM_AUXCLK3 OMAP44XX_SCRM_REGADDR(0x031c)
68#define OMAP4_SCRM_AUXCLK4_OFFSET 0x0320
69#define OMAP4_SCRM_AUXCLK4 OMAP44XX_SCRM_REGADDR(0x0320)
70#define OMAP4_SCRM_AUXCLK5_OFFSET 0x0324
71#define OMAP4_SCRM_AUXCLK5 OMAP44XX_SCRM_REGADDR(0x0324)
72#define OMAP4_SCRM_RSTTIME_OFFSET 0x0400
73#define OMAP4_SCRM_RSTTIME OMAP44XX_SCRM_REGADDR(0x0400)
74#define OMAP4_SCRM_MODEMRSTCTRL_OFFSET 0x0418
75#define OMAP4_SCRM_MODEMRSTCTRL OMAP44XX_SCRM_REGADDR(0x0418)
76#define OMAP4_SCRM_D2DRSTCTRL_OFFSET 0x041c
77#define OMAP4_SCRM_D2DRSTCTRL OMAP44XX_SCRM_REGADDR(0x041c)
78#define OMAP4_SCRM_EXTPWRONRSTCTRL_OFFSET 0x0420
79#define OMAP4_SCRM_EXTPWRONRSTCTRL OMAP44XX_SCRM_REGADDR(0x0420)
80#define OMAP4_SCRM_EXTWARMRSTST_OFFSET 0x0510
81#define OMAP4_SCRM_EXTWARMRSTST OMAP44XX_SCRM_REGADDR(0x0510)
82#define OMAP4_SCRM_APEWARMRSTST_OFFSET 0x0514
83#define OMAP4_SCRM_APEWARMRSTST OMAP44XX_SCRM_REGADDR(0x0514)
84#define OMAP4_SCRM_MODEMWARMRSTST_OFFSET 0x0518
85#define OMAP4_SCRM_MODEMWARMRSTST OMAP44XX_SCRM_REGADDR(0x0518)
86#define OMAP4_SCRM_D2DWARMRSTST_OFFSET 0x051c
87#define OMAP4_SCRM_D2DWARMRSTST OMAP44XX_SCRM_REGADDR(0x051c)
88
89/* Registers shifts and masks */
90
91/* REVISION_SCRM */
92#define OMAP4_REV_SHIFT 0
93#define OMAP4_REV_MASK (0xff << 0)
94
95/* CLKSETUPTIME */
96#define OMAP4_DOWNTIME_SHIFT 16
97#define OMAP4_DOWNTIME_MASK (0x3f << 16)
98#define OMAP4_SETUPTIME_SHIFT 0
99#define OMAP4_SETUPTIME_MASK (0xfff << 0)
100
101/* PMICSETUPTIME */
102#define OMAP4_WAKEUPTIME_SHIFT 16
103#define OMAP4_WAKEUPTIME_MASK (0x3f << 16)
104#define OMAP4_SLEEPTIME_SHIFT 0
105#define OMAP4_SLEEPTIME_MASK (0x3f << 0)
106
107/* ALTCLKSRC */
108#define OMAP4_ENABLE_EXT_SHIFT 3
109#define OMAP4_ENABLE_EXT_MASK (1 << 3)
110#define OMAP4_ENABLE_INT_SHIFT 2
111#define OMAP4_ENABLE_INT_MASK (1 << 2)
112#define OMAP4_ALTCLKSRC_MODE_SHIFT 0
113#define OMAP4_ALTCLKSRC_MODE_MASK (0x3 << 0)
114
115/* MODEMCLKM */
116#define OMAP4_CLK_32KHZ_SHIFT 0
117#define OMAP4_CLK_32KHZ_MASK (1 << 0)
118
119/* D2DCLKM */
120#define OMAP4_SYSCLK_SHIFT 1
121#define OMAP4_SYSCLK_MASK (1 << 1)
122
123/* EXTCLKREQ */
124#define OMAP4_POLARITY_SHIFT 0
125#define OMAP4_POLARITY_MASK (1 << 0)
126
127/* AUXCLKREQ0 */
128#define OMAP4_MAPPING_SHIFT 2
129#define OMAP4_MAPPING_MASK (0x7 << 2)
130#define OMAP4_ACCURACY_SHIFT 1
131#define OMAP4_ACCURACY_MASK (1 << 1)
132
133/* AUXCLK0 */
134#define OMAP4_CLKDIV_SHIFT 16
135#define OMAP4_CLKDIV_MASK (0xf << 16)
136#define OMAP4_DISABLECLK_SHIFT 9
137#define OMAP4_DISABLECLK_MASK (1 << 9)
138#define OMAP4_ENABLE_SHIFT 8
139#define OMAP4_ENABLE_MASK (1 << 8)
140#define OMAP4_SRCSELECT_SHIFT 1
141#define OMAP4_SRCSELECT_MASK (0x3 << 1)
142
143/* RSTTIME */
144#define OMAP4_RSTTIME_SHIFT 0
145#define OMAP4_RSTTIME_MASK (0xf << 0)
146
147/* MODEMRSTCTRL */
148#define OMAP4_WARMRST_SHIFT 1
149#define OMAP4_WARMRST_MASK (1 << 1)
150#define OMAP4_COLDRST_SHIFT 0
151#define OMAP4_COLDRST_MASK (1 << 0)
152
153/* EXTPWRONRSTCTRL */
154#define OMAP4_PWRONRST_SHIFT 1
155#define OMAP4_PWRONRST_MASK (1 << 1)
156#define OMAP4_ENABLE_EXTPWRONRSTCTRL_SHIFT 0
157#define OMAP4_ENABLE_EXTPWRONRSTCTRL_MASK (1 << 0)
158
159/* EXTWARMRSTST */
160#define OMAP4_EXTWARMRSTST_SHIFT 0
161#define OMAP4_EXTWARMRSTST_MASK (1 << 0)
162
163/* APEWARMRSTST */
164#define OMAP4_APEWARMRSTST_SHIFT 1
165#define OMAP4_APEWARMRSTST_MASK (1 << 1)
166
167/* MODEMWARMRSTST */
168#define OMAP4_MODEMWARMRSTST_SHIFT 2
169#define OMAP4_MODEMWARMRSTST_MASK (1 << 2)
170
171/* D2DWARMRSTST */
172#define OMAP4_D2DWARMRSTST_SHIFT 3
173#define OMAP4_D2DWARMRSTST_MASK (1 << 3)
174
175#endif
diff --git a/arch/arm/mach-omap2/board-rx51-sdram.c b/arch/arm/mach-omap2/sdram-nokia.c
index a43b2c5c838b..14caa228bc0d 100644
--- a/arch/arm/mach-omap2/board-rx51-sdram.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SDRC register values for RX51 2 * SDRC register values for Nokia boards
3 * 3 *
4 * Copyright (C) 2008 Nokia Corporation 4 * Copyright (C) 2008, 2010 Nokia Corporation
5 * 5 *
6 * Lauri Leukkunen <lauri.leukkunen@nokia.com> 6 * Lauri Leukkunen <lauri.leukkunen@nokia.com>
7 * 7 *
@@ -22,6 +22,7 @@
22#include <plat/clock.h> 22#include <plat/clock.h>
23#include <plat/sdrc.h> 23#include <plat/sdrc.h>
24 24
25#include "sdram-nokia.h"
25 26
26/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */ 27/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */
27struct sdram_timings { 28struct sdram_timings {
@@ -43,9 +44,28 @@ struct sdram_timings {
43 u32 tWTR; 44 u32 tWTR;
44}; 45};
45 46
46static struct omap_sdrc_params rx51_sdrc_params[4]; 47static const struct sdram_timings nokia_97dot6mhz_timings[] = {
48 {
49 .casl = 3,
50 .tDAL = 30725,
51 .tDPL = 15362,
52 .tRRD = 10241,
53 .tRCD = 20483,
54 .tRP = 15362,
55 .tRAS = 40967,
56 .tRC = 56330,
57 .tRFC = 138266,
58 .tXSR = 204839,
59
60 .tREF = 7798,
61
62 .tXP = 2,
63 .tCKE = 4,
64 .tWTR = 2,
65 },
66};
47 67
48static const struct sdram_timings rx51_timings[] = { 68static const struct sdram_timings nokia_166mhz_timings[] = {
49 { 69 {
50 .casl = 3, 70 .casl = 3,
51 .tDAL = 33000, 71 .tDAL = 33000,
@@ -66,6 +86,38 @@ static const struct sdram_timings rx51_timings[] = {
66 }, 86 },
67}; 87};
68 88
89static const struct sdram_timings nokia_195dot2mhz_timings[] = {
90 {
91 .casl = 3,
92 .tDAL = 30725,
93 .tDPL = 15362,
94 .tRRD = 10241,
95 .tRCD = 20483,
96 .tRP = 15362,
97 .tRAS = 40967,
98 .tRC = 56330,
99 .tRFC = 138266,
100 .tXSR = 204839,
101
102 .tREF = 7752,
103
104 .tXP = 2,
105 .tCKE = 4,
106 .tWTR = 2,
107 },
108};
109
110static const struct {
111 long rate;
112 struct sdram_timings const *data;
113} nokia_timings[] = {
114 { 83000000, nokia_166mhz_timings },
115 { 97600000, nokia_97dot6mhz_timings },
116 { 166000000, nokia_166mhz_timings },
117 { 195200000, nokia_195dot2mhz_timings },
118};
119static struct omap_sdrc_params nokia_sdrc_params[ARRAY_SIZE(nokia_timings) + 1];
120
69static unsigned long sdrc_get_fclk_period(long rate) 121static unsigned long sdrc_get_fclk_period(long rate)
70{ 122{
71 /* In picoseconds */ 123 /* In picoseconds */
@@ -110,12 +162,12 @@ static int set_sdrc_timing_regval(u32 *regval, int st_bit, int end_bit,
110#ifdef DEBUG 162#ifdef DEBUG
111#define SDRC_SET_ONE(reg, st, end, field, rate) \ 163#define SDRC_SET_ONE(reg, st, end, field, rate) \
112 if (set_sdrc_timing_regval((reg), (st), (end), \ 164 if (set_sdrc_timing_regval((reg), (st), (end), \
113 rx51_timings->field, (rate), #field) < 0) \ 165 memory_timings->field, (rate), #field) < 0) \
114 err = -1; 166 err = -1;
115#else 167#else
116#define SDRC_SET_ONE(reg, st, end, field, rate) \ 168#define SDRC_SET_ONE(reg, st, end, field, rate) \
117 if (set_sdrc_timing_regval((reg), (st), (end), \ 169 if (set_sdrc_timing_regval((reg), (st), (end), \
118 rx51_timings->field) < 0) \ 170 memory_timings->field) < 0) \
119 err = -1; 171 err = -1;
120#endif 172#endif
121 173
@@ -148,18 +200,19 @@ static int set_sdrc_timing_regval_ps(u32 *regval, int st_bit, int end_bit,
148#ifdef DEBUG 200#ifdef DEBUG
149#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \ 201#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \
150 if (set_sdrc_timing_regval_ps((reg), (st), (end), \ 202 if (set_sdrc_timing_regval_ps((reg), (st), (end), \
151 rx51_timings->field, \ 203 memory_timings->field, \
152 (rate), #field) < 0) \ 204 (rate), #field) < 0) \
153 err = -1; 205 err = -1;
154 206
155#else 207#else
156#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \ 208#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \
157 if (set_sdrc_timing_regval_ps((reg), (st), (end), \ 209 if (set_sdrc_timing_regval_ps((reg), (st), (end), \
158 rx51_timings->field, (rate)) < 0) \ 210 memory_timings->field, (rate)) < 0) \
159 err = -1; 211 err = -1;
160#endif 212#endif
161 213
162static int sdrc_timings(int id, long rate) 214static int sdrc_timings(int id, long rate,
215 const struct sdram_timings *memory_timings)
163{ 216{
164 u32 ticks_per_ms; 217 u32 ticks_per_ms;
165 u32 rfr, l; 218 u32 rfr, l;
@@ -184,7 +237,7 @@ static int sdrc_timings(int id, long rate)
184 SDRC_SET_ONE(&actim_ctrlb, 16, 17, tWTR, l3_rate); 237 SDRC_SET_ONE(&actim_ctrlb, 16, 17, tWTR, l3_rate);
185 238
186 ticks_per_ms = l3_rate; 239 ticks_per_ms = l3_rate;
187 rfr = rx51_timings[0].tREF * ticks_per_ms / 1000000; 240 rfr = memory_timings[0].tREF * ticks_per_ms / 1000000;
188 if (rfr > 65535 + 50) 241 if (rfr > 65535 + 50)
189 rfr = 65535; 242 rfr = 65535;
190 else 243 else
@@ -197,25 +250,30 @@ static int sdrc_timings(int id, long rate)
197 l = rfr << 8; 250 l = rfr << 8;
198 rfr_ctrl = l | 0x1; /* autorefresh, reload counter with 1xARCV */ 251 rfr_ctrl = l | 0x1; /* autorefresh, reload counter with 1xARCV */
199 252
200 rx51_sdrc_params[id].rate = rate; 253 nokia_sdrc_params[id].rate = rate;
201 rx51_sdrc_params[id].actim_ctrla = actim_ctrla; 254 nokia_sdrc_params[id].actim_ctrla = actim_ctrla;
202 rx51_sdrc_params[id].actim_ctrlb = actim_ctrlb; 255 nokia_sdrc_params[id].actim_ctrlb = actim_ctrlb;
203 rx51_sdrc_params[id].rfr_ctrl = rfr_ctrl; 256 nokia_sdrc_params[id].rfr_ctrl = rfr_ctrl;
204 rx51_sdrc_params[id].mr = 0x32; 257 nokia_sdrc_params[id].mr = 0x32;
205 258
206 rx51_sdrc_params[id + 1].rate = 0; 259 nokia_sdrc_params[id + 1].rate = 0;
207 260
208 return err; 261 return err;
209} 262}
210 263
211struct omap_sdrc_params *rx51_get_sdram_timings(void) 264struct omap_sdrc_params *nokia_get_sdram_timings(void)
212{ 265{
213 int err; 266 int err = 0;
267 int i;
214 268
215 err = sdrc_timings(0, 41500000); 269 for (i = 0; i < ARRAY_SIZE(nokia_timings); i++) {
216 err |= sdrc_timings(1, 83000000); 270 err |= sdrc_timings(i, nokia_timings[i].rate,
217 err |= sdrc_timings(2, 166000000); 271 nokia_timings[i].data);
272 if (err)
273 pr_err("%s: error with rate %ld: %d\n", __func__,
274 nokia_timings[i].rate, err);
275 }
218 276
219 return &rx51_sdrc_params[0]; 277 return err ? NULL : nokia_sdrc_params;
220} 278}
221 279
diff --git a/arch/arm/mach-omap2/sdram-nokia.h b/arch/arm/mach-omap2/sdram-nokia.h
new file mode 100644
index 000000000000..ee63da5f8df0
--- /dev/null
+++ b/arch/arm/mach-omap2/sdram-nokia.h
@@ -0,0 +1,12 @@
1/*
2 * SDRC register values for Nokia boards
3 *
4 * Copyright (C) 2010 Nokia
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
11struct omap_sdrc_params *nokia_get_sdram_timings(void);
12
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 4c65f5628b39..da6f3a63b5d5 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -27,8 +27,6 @@
27#include <plat/clock.h> 27#include <plat/clock.h>
28#include <plat/sram.h> 28#include <plat/sram.h>
29 29
30#include "prm.h"
31
32#include <plat/sdrc.h> 30#include <plat/sdrc.h>
33#include "sdrc.h" 31#include "sdrc.h"
34 32
diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h
index 68f57bb67fc5..b3f83799e6cf 100644
--- a/arch/arm/mach-omap2/sdrc.h
+++ b/arch/arm/mach-omap2/sdrc.h
@@ -74,5 +74,4 @@ static inline u32 sms_read_reg(u16 reg)
74 */ 74 */
75#define SDRC_MPURATE_LOOPS 96 75#define SDRC_MPURATE_LOOPS 96
76 76
77
78#endif 77#endif
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 0f4d27aef44d..ccdb010f169d 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -28,7 +28,7 @@
28#include <plat/clock.h> 28#include <plat/clock.h>
29#include <plat/sram.h> 29#include <plat/sram.h>
30 30
31#include "prm.h" 31#include "prm2xxx_3xxx.h"
32#include "clock.h" 32#include "clock.h"
33#include <plat/sdrc.h> 33#include <plat/sdrc.h>
34#include "sdrc.h" 34#include "sdrc.h"
@@ -99,6 +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 /*
103 * XXX These calls should be abstracted out through a
104 * prm2xxx.c function
105 */
102 if (cpu_is_omap2420()) 106 if (cpu_is_omap2420())
103 __raw_writel(0xffff, OMAP2420_PRCM_VOLTSETUP); 107 __raw_writel(0xffff, OMAP2420_PRCM_VOLTSETUP);
104 else 108 else
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index d17960a1be25..c64578853a8d 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -40,11 +40,12 @@
40#include <plat/omap_hwmod.h> 40#include <plat/omap_hwmod.h>
41#include <plat/omap_device.h> 41#include <plat/omap_device.h>
42 42
43#include "prm.h" 43#include "prm2xxx_3xxx.h"
44#include "pm.h" 44#include "pm.h"
45#include "cm.h" 45#include "cm2xxx_3xxx.h"
46#include "prm-regbits-34xx.h" 46#include "prm-regbits-34xx.h"
47#include "control.h" 47#include "control.h"
48#include "mux.h"
48 49
49#define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 50#define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
50#define UART_OMAP_WER 0x17 /* Wake-up enable register */ 51#define UART_OMAP_WER 0x17 /* Wake-up enable register */
@@ -106,21 +107,16 @@ struct omap_uart_state {
106static LIST_HEAD(uart_list); 107static LIST_HEAD(uart_list);
107static u8 num_uarts; 108static u8 num_uarts;
108 109
109/*
110 * Since these idle/enable hooks are used in the idle path itself
111 * which has interrupts disabled, use the non-locking versions of
112 * the hwmod enable/disable functions.
113 */
114static int uart_idle_hwmod(struct omap_device *od) 110static int uart_idle_hwmod(struct omap_device *od)
115{ 111{
116 _omap_hwmod_idle(od->hwmods[0]); 112 omap_hwmod_idle(od->hwmods[0]);
117 113
118 return 0; 114 return 0;
119} 115}
120 116
121static int uart_enable_hwmod(struct omap_device *od) 117static int uart_enable_hwmod(struct omap_device *od)
122{ 118{
123 _omap_hwmod_enable(od->hwmods[0]); 119 omap_hwmod_enable(od->hwmods[0]);
124 120
125 return 0; 121 return 0;
126} 122}
@@ -169,9 +165,9 @@ static inline void serial_write_reg(struct omap_uart_state *uart, int offset,
169 165
170static inline void __init omap_uart_reset(struct omap_uart_state *uart) 166static inline void __init omap_uart_reset(struct omap_uart_state *uart)
171{ 167{
172 serial_write_reg(uart, UART_OMAP_MDR1, 0x07); 168 serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE);
173 serial_write_reg(uart, UART_OMAP_SCR, 0x08); 169 serial_write_reg(uart, UART_OMAP_SCR, 0x08);
174 serial_write_reg(uart, UART_OMAP_MDR1, 0x00); 170 serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE);
175} 171}
176 172
177#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) 173#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
@@ -219,7 +215,7 @@ static void omap_uart_save_context(struct omap_uart_state *uart)
219 return; 215 return;
220 216
221 lcr = serial_read_reg(uart, UART_LCR); 217 lcr = serial_read_reg(uart, UART_LCR);
222 serial_write_reg(uart, UART_LCR, 0xBF); 218 serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B);
223 uart->dll = serial_read_reg(uart, UART_DLL); 219 uart->dll = serial_read_reg(uart, UART_DLL);
224 uart->dlh = serial_read_reg(uart, UART_DLM); 220 uart->dlh = serial_read_reg(uart, UART_DLM);
225 serial_write_reg(uart, UART_LCR, lcr); 221 serial_write_reg(uart, UART_LCR, lcr);
@@ -227,7 +223,7 @@ static void omap_uart_save_context(struct omap_uart_state *uart)
227 uart->sysc = serial_read_reg(uart, UART_OMAP_SYSC); 223 uart->sysc = serial_read_reg(uart, UART_OMAP_SYSC);
228 uart->scr = serial_read_reg(uart, UART_OMAP_SCR); 224 uart->scr = serial_read_reg(uart, UART_OMAP_SCR);
229 uart->wer = serial_read_reg(uart, UART_OMAP_WER); 225 uart->wer = serial_read_reg(uart, UART_OMAP_WER);
230 serial_write_reg(uart, UART_LCR, 0x80); 226 serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_A);
231 uart->mcr = serial_read_reg(uart, UART_MCR); 227 uart->mcr = serial_read_reg(uart, UART_MCR);
232 serial_write_reg(uart, UART_LCR, lcr); 228 serial_write_reg(uart, UART_LCR, lcr);
233 229
@@ -247,32 +243,35 @@ static void omap_uart_restore_context(struct omap_uart_state *uart)
247 uart->context_valid = 0; 243 uart->context_valid = 0;
248 244
249 if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) 245 if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS)
250 omap_uart_mdr1_errataset(uart, 0x07, 0xA0); 246 omap_uart_mdr1_errataset(uart, UART_OMAP_MDR1_DISABLE, 0xA0);
251 else 247 else
252 serial_write_reg(uart, UART_OMAP_MDR1, 0x7); 248 serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE);
253 serial_write_reg(uart, UART_LCR, 0xBF); /* Config B mode */ 249
250 serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B);
254 efr = serial_read_reg(uart, UART_EFR); 251 efr = serial_read_reg(uart, UART_EFR);
255 serial_write_reg(uart, UART_EFR, UART_EFR_ECB); 252 serial_write_reg(uart, UART_EFR, UART_EFR_ECB);
256 serial_write_reg(uart, UART_LCR, 0x0); /* Operational mode */ 253 serial_write_reg(uart, UART_LCR, 0x0); /* Operational mode */
257 serial_write_reg(uart, UART_IER, 0x0); 254 serial_write_reg(uart, UART_IER, 0x0);
258 serial_write_reg(uart, UART_LCR, 0xBF); /* Config B mode */ 255 serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B);
259 serial_write_reg(uart, UART_DLL, uart->dll); 256 serial_write_reg(uart, UART_DLL, uart->dll);
260 serial_write_reg(uart, UART_DLM, uart->dlh); 257 serial_write_reg(uart, UART_DLM, uart->dlh);
261 serial_write_reg(uart, UART_LCR, 0x0); /* Operational mode */ 258 serial_write_reg(uart, UART_LCR, 0x0); /* Operational mode */
262 serial_write_reg(uart, UART_IER, uart->ier); 259 serial_write_reg(uart, UART_IER, uart->ier);
263 serial_write_reg(uart, UART_LCR, 0x80); 260 serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_A);
264 serial_write_reg(uart, UART_MCR, uart->mcr); 261 serial_write_reg(uart, UART_MCR, uart->mcr);
265 serial_write_reg(uart, UART_LCR, 0xBF); /* Config B mode */ 262 serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B);
266 serial_write_reg(uart, UART_EFR, efr); 263 serial_write_reg(uart, UART_EFR, efr);
267 serial_write_reg(uart, UART_LCR, UART_LCR_WLEN8); 264 serial_write_reg(uart, UART_LCR, UART_LCR_WLEN8);
268 serial_write_reg(uart, UART_OMAP_SCR, uart->scr); 265 serial_write_reg(uart, UART_OMAP_SCR, uart->scr);
269 serial_write_reg(uart, UART_OMAP_WER, uart->wer); 266 serial_write_reg(uart, UART_OMAP_WER, uart->wer);
270 serial_write_reg(uart, UART_OMAP_SYSC, uart->sysc); 267 serial_write_reg(uart, UART_OMAP_SYSC, uart->sysc);
268
271 if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) 269 if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS)
272 omap_uart_mdr1_errataset(uart, 0x00, 0xA1); 270 omap_uart_mdr1_errataset(uart, UART_OMAP_MDR1_16X_MODE, 0xA1);
273 else 271 else
274 /* UART 16x mode */ 272 /* UART 16x mode */
275 serial_write_reg(uart, UART_OMAP_MDR1, 0x00); 273 serial_write_reg(uart, UART_OMAP_MDR1,
274 UART_OMAP_MDR1_16X_MODE);
276} 275}
277#else 276#else
278static inline void omap_uart_save_context(struct omap_uart_state *uart) {} 277static inline void omap_uart_save_context(struct omap_uart_state *uart) {}
@@ -492,6 +491,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
492 u32 wk_mask = 0; 491 u32 wk_mask = 0;
493 u32 padconf = 0; 492 u32 padconf = 0;
494 493
494 /* XXX These PRM accesses do not belong here */
495 uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1); 495 uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
496 uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1); 496 uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
497 switch (uart->num) { 497 switch (uart->num) {
@@ -695,16 +695,16 @@ void __init omap_serial_early_init(void)
695 695
696/** 696/**
697 * omap_serial_init_port() - initialize single serial port 697 * omap_serial_init_port() - initialize single serial port
698 * @port: serial port number (0-3) 698 * @bdata: port specific board data pointer
699 * 699 *
700 * This function initialies serial driver for given @port only. 700 * This function initialies serial driver for given port only.
701 * Platforms can call this function instead of omap_serial_init() 701 * Platforms can call this function instead of omap_serial_init()
702 * if they don't plan to use all available UARTs as serial ports. 702 * if they don't plan to use all available UARTs as serial ports.
703 * 703 *
704 * Don't mix calls to omap_serial_init_port() and omap_serial_init(), 704 * Don't mix calls to omap_serial_init_port() and omap_serial_init(),
705 * use only one of the two. 705 * use only one of the two.
706 */ 706 */
707void __init omap_serial_init_port(int port) 707void __init omap_serial_init_port(struct omap_board_data *bdata)
708{ 708{
709 struct omap_uart_state *uart; 709 struct omap_uart_state *uart;
710 struct omap_hwmod *oh; 710 struct omap_hwmod *oh;
@@ -722,13 +722,15 @@ void __init omap_serial_init_port(int port)
722 struct omap_uart_port_info omap_up; 722 struct omap_uart_port_info omap_up;
723#endif 723#endif
724 724
725 if (WARN_ON(port < 0)) 725 if (WARN_ON(!bdata))
726 return;
727 if (WARN_ON(bdata->id < 0))
726 return; 728 return;
727 if (WARN_ON(port >= num_uarts)) 729 if (WARN_ON(bdata->id >= num_uarts))
728 return; 730 return;
729 731
730 list_for_each_entry(uart, &uart_list, node) 732 list_for_each_entry(uart, &uart_list, node)
731 if (port == uart->num) 733 if (bdata->id == uart->num)
732 break; 734 break;
733 735
734 oh = uart->oh; 736 oh = uart->oh;
@@ -800,6 +802,8 @@ void __init omap_serial_init_port(int port)
800 WARN(IS_ERR(od), "Could not build omap_device for %s: %s.\n", 802 WARN(IS_ERR(od), "Could not build omap_device for %s: %s.\n",
801 name, oh->name); 803 name, oh->name);
802 804
805 oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
806
803 uart->irq = oh->mpu_irqs[0].irq; 807 uart->irq = oh->mpu_irqs[0].irq;
804 uart->regshift = 2; 808 uart->regshift = 2;
805 uart->mapbase = oh->slaves[0]->addr->pa_start; 809 uart->mapbase = oh->slaves[0]->addr->pa_start;
@@ -857,7 +861,14 @@ void __init omap_serial_init_port(int port)
857void __init omap_serial_init(void) 861void __init omap_serial_init(void)
858{ 862{
859 struct omap_uart_state *uart; 863 struct omap_uart_state *uart;
864 struct omap_board_data bdata;
860 865
861 list_for_each_entry(uart, &uart_list, node) 866 list_for_each_entry(uart, &uart_list, node) {
862 omap_serial_init_port(uart->num); 867 bdata.id = uart->num;
868 bdata.flags = 0;
869 bdata.pads = NULL;
870 bdata.pads_cnt = 0;
871 omap_serial_init_port(&bdata);
872
873 }
863} 874}
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 2fb205a7f285..98d8232808b8 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/sleep.S
3 *
4 * (C) Copyright 2007 2 * (C) Copyright 2007
5 * Texas Instruments 3 * Texas Instruments
6 * Karthik Dasu <karthik-dp@ti.com> 4 * Karthik Dasu <karthik-dp@ti.com>
@@ -26,28 +24,35 @@
26 */ 24 */
27#include <linux/linkage.h> 25#include <linux/linkage.h>
28#include <asm/assembler.h> 26#include <asm/assembler.h>
27#include <plat/sram.h>
29#include <mach/io.h> 28#include <mach/io.h>
30 29
31#include "cm.h" 30#include "cm2xxx_3xxx.h"
32#include "prm.h" 31#include "prm2xxx_3xxx.h"
33#include "sdrc.h" 32#include "sdrc.h"
34#include "control.h" 33#include "control.h"
35 34
36#define SDRC_SCRATCHPAD_SEM_V 0xfa00291c 35/*
37 36 * Registers access definitions
38#define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ 37 */
39 OMAP3430_PM_PREPWSTST) 38#define SDRC_SCRATCHPAD_SEM_OFFS 0xc
40#define PM_PREPWSTST_CORE_P 0x48306AE8 39#define SDRC_SCRATCHPAD_SEM_V OMAP343X_SCRATCHPAD_REGADDR\
41#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ 40 (SDRC_SCRATCHPAD_SEM_OFFS)
42 OMAP3430_PM_PREPWSTST) 41#define PM_PREPWSTST_CORE_P OMAP3430_PRM_BASE + CORE_MOD +\
42 OMAP3430_PM_PREPWSTST
43#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL 43#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
44#define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1) 44#define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
45#define SRAM_BASE_P 0x40200000 45#define CM_IDLEST_CKGEN_V OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
46#define CONTROL_STAT 0x480022F0 46#define SRAM_BASE_P OMAP3_SRAM_PA
47#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is 47#define CONTROL_STAT OMAP343X_CTRL_BASE + OMAP343X_CONTROL_STATUS
48 * available */ 48#define CONTROL_MEM_RTA_CTRL (OMAP343X_CTRL_BASE +\
49#define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\ 49 OMAP36XX_CONTROL_MEM_RTA_CTRL)
50 + SCRATCHPAD_MEM_OFFS) 50
51/* Move this as correct place is available */
52#define SCRATCHPAD_MEM_OFFS 0x310
53#define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE +\
54 OMAP343X_CONTROL_MEM_WKUP +\
55 SCRATCHPAD_MEM_OFFS)
51#define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER) 56#define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER)
52#define SDRC_SYSCONFIG_P (OMAP343X_SDRC_BASE + SDRC_SYSCONFIG) 57#define SDRC_SYSCONFIG_P (OMAP343X_SDRC_BASE + SDRC_SYSCONFIG)
53#define SDRC_MR_0_P (OMAP343X_SDRC_BASE + SDRC_MR_0) 58#define SDRC_MR_0_P (OMAP343X_SDRC_BASE + SDRC_MR_0)
@@ -59,48 +64,38 @@
59#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) 64#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
60#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) 65#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
61 66
62 .text 67
63/* Function to acquire the semaphore in scratchpad */ 68/*
64ENTRY(lock_scratchpad_sem) 69 * API functions
65 stmfd sp!, {lr} @ save registers on stack 70 */
66wait_sem: 71
67 mov r0,#1 72/*
68 ldr r1, sdrc_scratchpad_sem 73 * The "get_*restore_pointer" functions are used to provide a
69wait_loop: 74 * physical restore address where the ROM code jumps while waking
70 ldr r2, [r1] @ load the lock value 75 * up from MPU OFF/OSWR state.
71 cmp r2, r0 @ is the lock free ? 76 * The restore pointer is stored into the scratchpad.
72 beq wait_loop @ not free... 77 */
73 swp r2, r0, [r1] @ semaphore free so lock it and proceed
74 cmp r2, r0 @ did we succeed ?
75 beq wait_sem @ no - try again
76 ldmfd sp!, {pc} @ restore regs and return
77sdrc_scratchpad_sem:
78 .word SDRC_SCRATCHPAD_SEM_V
79ENTRY(lock_scratchpad_sem_sz)
80 .word . - lock_scratchpad_sem
81
82 .text
83/* Function to release the scratchpad semaphore */
84ENTRY(unlock_scratchpad_sem)
85 stmfd sp!, {lr} @ save registers on stack
86 ldr r3, sdrc_scratchpad_sem
87 mov r2,#0
88 str r2,[r3]
89 ldmfd sp!, {pc} @ restore regs and return
90ENTRY(unlock_scratchpad_sem_sz)
91 .word . - unlock_scratchpad_sem
92 78
93 .text 79 .text
94/* Function call to get the restore pointer for resume from OFF */ 80/* Function call to get the restore pointer for resume from OFF */
95ENTRY(get_restore_pointer) 81ENTRY(get_restore_pointer)
96 stmfd sp!, {lr} @ save registers on stack 82 stmfd sp!, {lr} @ save registers on stack
97 adr r0, restore 83 adr r0, restore
98 ldmfd sp!, {pc} @ restore regs and return 84 ldmfd sp!, {pc} @ restore regs and return
99ENTRY(get_restore_pointer_sz) 85ENTRY(get_restore_pointer_sz)
100 .word . - get_restore_pointer 86 .word . - get_restore_pointer
101 87
102 .text 88 .text
103/* Function call to get the restore pointer for for ES3 to resume from OFF */ 89/* Function call to get the restore pointer for 3630 resume from OFF */
90ENTRY(get_omap3630_restore_pointer)
91 stmfd sp!, {lr} @ save registers on stack
92 adr r0, restore_3630
93 ldmfd sp!, {pc} @ restore regs and return
94ENTRY(get_omap3630_restore_pointer_sz)
95 .word . - get_omap3630_restore_pointer
96
97 .text
98/* Function call to get the restore pointer for ES3 to resume from OFF */
104ENTRY(get_es3_restore_pointer) 99ENTRY(get_es3_restore_pointer)
105 stmfd sp!, {lr} @ save registers on stack 100 stmfd sp!, {lr} @ save registers on stack
106 adr r0, restore_es3 101 adr r0, restore_es3
@@ -108,54 +103,23 @@ ENTRY(get_es3_restore_pointer)
108ENTRY(get_es3_restore_pointer_sz) 103ENTRY(get_es3_restore_pointer_sz)
109 .word . - get_es3_restore_pointer 104 .word . - get_es3_restore_pointer
110 105
111ENTRY(es3_sdrc_fix) 106 .text
112 ldr r4, sdrc_syscfg @ get config addr 107/*
113 ldr r5, [r4] @ get value 108 * L2 cache needs to be toggled for stable OFF mode functionality on 3630.
114 tst r5, #0x100 @ is part access blocked 109 * This function sets up a flag that will allow for this toggling to take
115 it eq 110 * place on 3630. Hopefully some version in the future may not need this.
116 biceq r5, r5, #0x100 @ clear bit if set 111 */
117 str r5, [r4] @ write back change 112ENTRY(enable_omap3630_toggle_l2_on_restore)
118 ldr r4, sdrc_mr_0 @ get config addr 113 stmfd sp!, {lr} @ save registers on stack
119 ldr r5, [r4] @ get value 114 /* Setup so that we will disable and enable l2 */
120 str r5, [r4] @ write back change 115 mov r1, #0x1
121 ldr r4, sdrc_emr2_0 @ get config addr 116 str r1, l2dis_3630
122 ldr r5, [r4] @ get value 117 ldmfd sp!, {pc} @ restore regs and return
123 str r5, [r4] @ write back change
124 ldr r4, sdrc_manual_0 @ get config addr
125 mov r5, #0x2 @ autorefresh command
126 str r5, [r4] @ kick off refreshes
127 ldr r4, sdrc_mr_1 @ get config addr
128 ldr r5, [r4] @ get value
129 str r5, [r4] @ write back change
130 ldr r4, sdrc_emr2_1 @ get config addr
131 ldr r5, [r4] @ get value
132 str r5, [r4] @ write back change
133 ldr r4, sdrc_manual_1 @ get config addr
134 mov r5, #0x2 @ autorefresh command
135 str r5, [r4] @ kick off refreshes
136 bx lr
137sdrc_syscfg:
138 .word SDRC_SYSCONFIG_P
139sdrc_mr_0:
140 .word SDRC_MR_0_P
141sdrc_emr2_0:
142 .word SDRC_EMR2_0_P
143sdrc_manual_0:
144 .word SDRC_MANUAL_0_P
145sdrc_mr_1:
146 .word SDRC_MR_1_P
147sdrc_emr2_1:
148 .word SDRC_EMR2_1_P
149sdrc_manual_1:
150 .word SDRC_MANUAL_1_P
151ENTRY(es3_sdrc_fix_sz)
152 .word . - es3_sdrc_fix
153 118
119 .text
154/* Function to call rom code to save secure ram context */ 120/* Function to call rom code to save secure ram context */
155ENTRY(save_secure_ram_context) 121ENTRY(save_secure_ram_context)
156 stmfd sp!, {r1-r12, lr} @ save registers on stack 122 stmfd sp!, {r1-r12, lr} @ save registers on stack
157save_secure_ram_debug:
158 /* b save_secure_ram_debug */ @ enable to debug save code
159 adr r3, api_params @ r3 points to parameters 123 adr r3, api_params @ r3 points to parameters
160 str r0, [r3,#0x4] @ r0 has sdram address 124 str r0, [r3,#0x4] @ r0 has sdram address
161 ldr r12, high_mask 125 ldr r12, high_mask
@@ -185,35 +149,162 @@ ENTRY(save_secure_ram_context_sz)
185 .word . - save_secure_ram_context 149 .word . - save_secure_ram_context
186 150
187/* 151/*
152 * ======================
153 * == Idle entry point ==
154 * ======================
155 */
156
157/*
188 * Forces OMAP into idle state 158 * Forces OMAP into idle state
189 * 159 *
190 * omap34xx_suspend() - This bit of code just executes the WFI 160 * omap34xx_cpu_suspend() - This bit of code saves the CPU context if needed
191 * for normal idles. 161 * and executes the WFI instruction. Calling WFI effectively changes the
162 * power domains states to the desired target power states.
163 *
192 * 164 *
193 * Note: This code get's copied to internal SRAM at boot. When the OMAP 165 * Notes:
194 * wakes up it continues execution at the point it went to sleep. 166 * - this code gets copied to internal SRAM at boot and after wake-up
167 * from OFF mode. The execution pointer in SRAM is _omap_sram_idle.
168 * - when the OMAP wakes up it continues at different execution points
169 * depending on the low power mode (non-OFF vs OFF modes),
170 * cf. 'Resume path for xxx mode' comments.
195 */ 171 */
196ENTRY(omap34xx_cpu_suspend) 172ENTRY(omap34xx_cpu_suspend)
197 stmfd sp!, {r0-r12, lr} @ save registers on stack 173 stmfd sp!, {r0-r12, lr} @ save registers on stack
198loop:
199 /*b loop*/ @Enable to debug by stepping through code
200 /* r0 contains restore pointer in sdram */
201 /* r1 contains information about saving context */
202 ldr r4, sdrc_power @ read the SDRC_POWER register
203 ldr r5, [r4] @ read the contents of SDRC_POWER
204 orr r5, r5, #0x40 @ enable self refresh on idle req
205 str r5, [r4] @ write back to SDRC_POWER register
206 174
175 /*
176 * r0 contains restore pointer in sdram
177 * r1 contains information about saving context:
178 * 0 - No context lost
179 * 1 - Only L1 and logic lost
180 * 2 - Only L2 lost
181 * 3 - Both L1 and L2 lost
182 */
183
184 /* Directly jump to WFI is the context save is not required */
207 cmp r1, #0x0 185 cmp r1, #0x0
208 /* If context save is required, do that and execute wfi */ 186 beq omap3_do_wfi
209 bne save_context_wfi 187
188 /* Otherwise fall through to the save context code */
189save_context_wfi:
190 mov r8, r0 @ Store SDRAM address in r8
191 mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register
192 mov r4, #0x1 @ Number of parameters for restore call
193 stmia r8!, {r4-r5} @ Push parameters for restore call
194 mrc p15, 1, r5, c9, c0, 2 @ Read L2 AUX ctrl register
195 stmia r8!, {r4-r5} @ Push parameters for restore call
196
197 /* Check what that target sleep state is from r1 */
198 cmp r1, #0x2 @ Only L2 lost, no need to save context
199 beq clean_caches
200
201l1_logic_lost:
202 /* Store sp and spsr to SDRAM */
203 mov r4, sp
204 mrs r5, spsr
205 mov r6, lr
206 stmia r8!, {r4-r6}
207 /* Save all ARM registers */
208 /* Coprocessor access control register */
209 mrc p15, 0, r6, c1, c0, 2
210 stmia r8!, {r6}
211 /* TTBR0, TTBR1 and Translation table base control */
212 mrc p15, 0, r4, c2, c0, 0
213 mrc p15, 0, r5, c2, c0, 1
214 mrc p15, 0, r6, c2, c0, 2
215 stmia r8!, {r4-r6}
216 /*
217 * Domain access control register, data fault status register,
218 * and instruction fault status register
219 */
220 mrc p15, 0, r4, c3, c0, 0
221 mrc p15, 0, r5, c5, c0, 0
222 mrc p15, 0, r6, c5, c0, 1
223 stmia r8!, {r4-r6}
224 /*
225 * Data aux fault status register, instruction aux fault status,
226 * data fault address register and instruction fault address register
227 */
228 mrc p15, 0, r4, c5, c1, 0
229 mrc p15, 0, r5, c5, c1, 1
230 mrc p15, 0, r6, c6, c0, 0
231 mrc p15, 0, r7, c6, c0, 2
232 stmia r8!, {r4-r7}
233 /*
234 * user r/w thread and process ID, user r/o thread and process ID,
235 * priv only thread and process ID, cache size selection
236 */
237 mrc p15, 0, r4, c13, c0, 2
238 mrc p15, 0, r5, c13, c0, 3
239 mrc p15, 0, r6, c13, c0, 4
240 mrc p15, 2, r7, c0, c0, 0
241 stmia r8!, {r4-r7}
242 /* Data TLB lockdown, instruction TLB lockdown registers */
243 mrc p15, 0, r5, c10, c0, 0
244 mrc p15, 0, r6, c10, c0, 1
245 stmia r8!, {r5-r6}
246 /* Secure or non secure vector base address, FCSE PID, Context PID*/
247 mrc p15, 0, r4, c12, c0, 0
248 mrc p15, 0, r5, c13, c0, 0
249 mrc p15, 0, r6, c13, c0, 1
250 stmia r8!, {r4-r6}
251 /* Primary remap, normal remap registers */
252 mrc p15, 0, r4, c10, c2, 0
253 mrc p15, 0, r5, c10, c2, 1
254 stmia r8!,{r4-r5}
255
256 /* Store current cpsr*/
257 mrs r2, cpsr
258 stmia r8!, {r2}
259
260 mrc p15, 0, r4, c1, c0, 0
261 /* save control register */
262 stmia r8!, {r4}
263
264clean_caches:
265 /*
266 * Clean Data or unified cache to POU
267 * How to invalidate only L1 cache???? - #FIX_ME#
268 * mcr p15, 0, r11, c7, c11, 1
269 */
270 cmp r1, #0x1 @ Check whether L2 inval is required
271 beq omap3_do_wfi
272
273clean_l2:
274 /*
275 * jump out to kernel flush routine
276 * - reuse that code is better
277 * - it executes in a cached space so is faster than refetch per-block
278 * - should be faster and will change with kernel
279 * - 'might' have to copy address, load and jump to it
280 */
281 ldr r1, kernel_flush
282 mov lr, pc
283 bx r1
284
285omap3_do_wfi:
286 ldr r4, sdrc_power @ read the SDRC_POWER register
287 ldr r5, [r4] @ read the contents of SDRC_POWER
288 orr r5, r5, #0x40 @ enable self refresh on idle req
289 str r5, [r4] @ write back to SDRC_POWER register
290
210 /* Data memory barrier and Data sync barrier */ 291 /* Data memory barrier and Data sync barrier */
211 mov r1, #0 292 mov r1, #0
212 mcr p15, 0, r1, c7, c10, 4 293 mcr p15, 0, r1, c7, c10, 4
213 mcr p15, 0, r1, c7, c10, 5 294 mcr p15, 0, r1, c7, c10, 5
214 295
296/*
297 * ===================================
298 * == WFI instruction => Enter idle ==
299 * ===================================
300 */
215 wfi @ wait for interrupt 301 wfi @ wait for interrupt
216 302
303/*
304 * ===================================
305 * == Resume path for non-OFF modes ==
306 * ===================================
307 */
217 nop 308 nop
218 nop 309 nop
219 nop 310 nop
@@ -226,9 +317,30 @@ loop:
226 nop 317 nop
227 bl wait_sdrc_ok 318 bl wait_sdrc_ok
228 319
229 ldmfd sp!, {r0-r12, pc} @ restore regs and return 320/*
321 * ===================================
322 * == Exit point from non-OFF modes ==
323 * ===================================
324 */
325 ldmfd sp!, {r0-r12, pc} @ restore regs and return
326
327
328/*
329 * ==============================
330 * == Resume path for OFF mode ==
331 * ==============================
332 */
333
334/*
335 * The restore_* functions are called by the ROM code
336 * when back from WFI in OFF mode.
337 * Cf. the get_*restore_pointer functions.
338 *
339 * restore_es3: applies to 34xx >= ES3.0
340 * restore_3630: applies to 36xx
341 * restore: common code for 3xxx
342 */
230restore_es3: 343restore_es3:
231 /*b restore_es3*/ @ Enable to debug restore code
232 ldr r5, pm_prepwstst_core_p 344 ldr r5, pm_prepwstst_core_p
233 ldr r4, [r5] 345 ldr r4, [r5]
234 and r4, r4, #0x3 346 and r4, r4, #0x3
@@ -245,82 +357,117 @@ copy_to_sram:
245 bne copy_to_sram 357 bne copy_to_sram
246 ldr r1, sram_base 358 ldr r1, sram_base
247 blx r1 359 blx r1
360 b restore
361
362restore_3630:
363 ldr r1, pm_prepwstst_core_p
364 ldr r2, [r1]
365 and r2, r2, #0x3
366 cmp r2, #0x0 @ Check if previous power state of CORE is OFF
367 bne restore
368 /* Disable RTA before giving control */
369 ldr r1, control_mem_rta
370 mov r2, #OMAP36XX_RTA_DISABLE
371 str r2, [r1]
372
373 /* Fall through to common code for the remaining logic */
374
248restore: 375restore:
249 /* b restore*/ @ Enable to debug restore code 376 /*
250 /* Check what was the reason for mpu reset and store the reason in r9*/ 377 * Check what was the reason for mpu reset and store the reason in r9:
251 /* 1 - Only L1 and logic lost */ 378 * 0 - No context lost
252 /* 2 - Only L2 lost - In this case, we wont be here */ 379 * 1 - Only L1 and logic lost
253 /* 3 - Both L1 and L2 lost */ 380 * 2 - Only L2 lost - In this case, we wont be here
254 ldr r1, pm_pwstctrl_mpu 381 * 3 - Both L1 and L2 lost
382 */
383 ldr r1, pm_pwstctrl_mpu
255 ldr r2, [r1] 384 ldr r2, [r1]
256 and r2, r2, #0x3 385 and r2, r2, #0x3
257 cmp r2, #0x0 @ Check if target power state was OFF or RET 386 cmp r2, #0x0 @ Check if target power state was OFF or RET
258 moveq r9, #0x3 @ MPU OFF => L1 and L2 lost 387 moveq r9, #0x3 @ MPU OFF => L1 and L2 lost
259 movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation 388 movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation
260 bne logic_l1_restore 389 bne logic_l1_restore
390
391 ldr r0, l2dis_3630
392 cmp r0, #0x1 @ should we disable L2 on 3630?
393 bne skipl2dis
394 mrc p15, 0, r0, c1, c0, 1
395 bic r0, r0, #2 @ disable L2 cache
396 mcr p15, 0, r0, c1, c0, 1
397skipl2dis:
261 ldr r0, control_stat 398 ldr r0, control_stat
262 ldr r1, [r0] 399 ldr r1, [r0]
263 and r1, #0x700 400 and r1, #0x700
264 cmp r1, #0x300 401 cmp r1, #0x300
265 beq l2_inv_gp 402 beq l2_inv_gp
266 mov r0, #40 @ set service ID for PPA 403 mov r0, #40 @ set service ID for PPA
267 mov r12, r0 @ copy secure Service ID in r12 404 mov r12, r0 @ copy secure Service ID in r12
268 mov r1, #0 @ set task id for ROM code in r1 405 mov r1, #0 @ set task id for ROM code in r1
269 mov r2, #4 @ set some flags in r2, r6 406 mov r2, #4 @ set some flags in r2, r6
270 mov r6, #0xff 407 mov r6, #0xff
271 adr r3, l2_inv_api_params @ r3 points to dummy parameters 408 adr r3, l2_inv_api_params @ r3 points to dummy parameters
272 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 409 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
273 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 410 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier
274 .word 0xE1600071 @ call SMI monitor (smi #1) 411 .word 0xE1600071 @ call SMI monitor (smi #1)
275 /* Write to Aux control register to set some bits */ 412 /* Write to Aux control register to set some bits */
276 mov r0, #42 @ set service ID for PPA 413 mov r0, #42 @ set service ID for PPA
277 mov r12, r0 @ copy secure Service ID in r12 414 mov r12, r0 @ copy secure Service ID in r12
278 mov r1, #0 @ set task id for ROM code in r1 415 mov r1, #0 @ set task id for ROM code in r1
279 mov r2, #4 @ set some flags in r2, r6 416 mov r2, #4 @ set some flags in r2, r6
280 mov r6, #0xff 417 mov r6, #0xff
281 ldr r4, scratchpad_base 418 ldr r4, scratchpad_base
282 ldr r3, [r4, #0xBC] @ r3 points to parameters 419 ldr r3, [r4, #0xBC] @ r3 points to parameters
283 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 420 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
284 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 421 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier
285 .word 0xE1600071 @ call SMI monitor (smi #1) 422 .word 0xE1600071 @ call SMI monitor (smi #1)
286 423
287#ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE 424#ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE
288 /* Restore L2 aux control register */ 425 /* Restore L2 aux control register */
289 @ set service ID for PPA 426 @ set service ID for PPA
290 mov r0, #CONFIG_OMAP3_L2_AUX_SECURE_SERVICE_SET_ID 427 mov r0, #CONFIG_OMAP3_L2_AUX_SECURE_SERVICE_SET_ID
291 mov r12, r0 @ copy service ID in r12 428 mov r12, r0 @ copy service ID in r12
292 mov r1, #0 @ set task ID for ROM code in r1 429 mov r1, #0 @ set task ID for ROM code in r1
293 mov r2, #4 @ set some flags in r2, r6 430 mov r2, #4 @ set some flags in r2, r6
294 mov r6, #0xff 431 mov r6, #0xff
295 ldr r4, scratchpad_base 432 ldr r4, scratchpad_base
296 ldr r3, [r4, #0xBC] 433 ldr r3, [r4, #0xBC]
297 adds r3, r3, #8 @ r3 points to parameters 434 adds r3, r3, #8 @ r3 points to parameters
298 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 435 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
299 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 436 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier
300 .word 0xE1600071 @ call SMI monitor (smi #1) 437 .word 0xE1600071 @ call SMI monitor (smi #1)
301#endif 438#endif
302 b logic_l1_restore 439 b logic_l1_restore
440
303l2_inv_api_params: 441l2_inv_api_params:
304 .word 0x1, 0x00 442 .word 0x1, 0x00
305l2_inv_gp: 443l2_inv_gp:
306 /* Execute smi to invalidate L2 cache */ 444 /* Execute smi to invalidate L2 cache */
307 mov r12, #0x1 @ set up to invalide L2 445 mov r12, #0x1 @ set up to invalidate L2
308smi: .word 0xE1600070 @ Call SMI monitor (smieq) 446 .word 0xE1600070 @ Call SMI monitor (smieq)
309 /* Write to Aux control register to set some bits */ 447 /* Write to Aux control register to set some bits */
310 ldr r4, scratchpad_base 448 ldr r4, scratchpad_base
311 ldr r3, [r4,#0xBC] 449 ldr r3, [r4,#0xBC]
312 ldr r0, [r3,#4] 450 ldr r0, [r3,#4]
313 mov r12, #0x3 451 mov r12, #0x3
314 .word 0xE1600070 @ Call SMI monitor (smieq) 452 .word 0xE1600070 @ Call SMI monitor (smieq)
315 ldr r4, scratchpad_base 453 ldr r4, scratchpad_base
316 ldr r3, [r4,#0xBC] 454 ldr r3, [r4,#0xBC]
317 ldr r0, [r3,#12] 455 ldr r0, [r3,#12]
318 mov r12, #0x2 456 mov r12, #0x2
319 .word 0xE1600070 @ Call SMI monitor (smieq) 457 .word 0xE1600070 @ Call SMI monitor (smieq)
320logic_l1_restore: 458logic_l1_restore:
459 ldr r1, l2dis_3630
460 cmp r1, #0x1 @ Test if L2 re-enable needed on 3630
461 bne skipl2reen
462 mrc p15, 0, r1, c1, c0, 1
463 orr r1, r1, #2 @ re-enable L2 cache
464 mcr p15, 0, r1, c1, c0, 1
465skipl2reen:
321 mov r1, #0 466 mov r1, #0
322 /* Invalidate all instruction caches to PoU 467 /*
323 * and flush branch target cache */ 468 * Invalidate all instruction caches to PoU
469 * and flush branch target cache
470 */
324 mcr p15, 0, r1, c7, c5, 0 471 mcr p15, 0, r1, c7, c5, 0
325 472
326 ldr r4, scratchpad_base 473 ldr r4, scratchpad_base
@@ -341,33 +488,33 @@ logic_l1_restore:
341 MCR p15, 0, r6, c2, c0, 1 488 MCR p15, 0, r6, c2, c0, 1
342 /* Translation table base control register */ 489 /* Translation table base control register */
343 MCR p15, 0, r7, c2, c0, 2 490 MCR p15, 0, r7, c2, c0, 2
344 /*domain access Control Register */ 491 /* Domain access Control Register */
345 MCR p15, 0, r8, c3, c0, 0 492 MCR p15, 0, r8, c3, c0, 0
346 /* data fault status Register */ 493 /* Data fault status Register */
347 MCR p15, 0, r9, c5, c0, 0 494 MCR p15, 0, r9, c5, c0, 0
348 495
349 ldmia r3!,{r4-r8} 496 ldmia r3!,{r4-r8}
350 /* instruction fault status Register */ 497 /* Instruction fault status Register */
351 MCR p15, 0, r4, c5, c0, 1 498 MCR p15, 0, r4, c5, c0, 1
352 /*Data Auxiliary Fault Status Register */ 499 /* Data Auxiliary Fault Status Register */
353 MCR p15, 0, r5, c5, c1, 0 500 MCR p15, 0, r5, c5, c1, 0
354 /*Instruction Auxiliary Fault Status Register*/ 501 /* Instruction Auxiliary Fault Status Register*/
355 MCR p15, 0, r6, c5, c1, 1 502 MCR p15, 0, r6, c5, c1, 1
356 /*Data Fault Address Register */ 503 /* Data Fault Address Register */
357 MCR p15, 0, r7, c6, c0, 0 504 MCR p15, 0, r7, c6, c0, 0
358 /*Instruction Fault Address Register*/ 505 /* Instruction Fault Address Register*/
359 MCR p15, 0, r8, c6, c0, 2 506 MCR p15, 0, r8, c6, c0, 2
360 ldmia r3!,{r4-r7} 507 ldmia r3!,{r4-r7}
361 508
362 /* user r/w thread and process ID */ 509 /* User r/w thread and process ID */
363 MCR p15, 0, r4, c13, c0, 2 510 MCR p15, 0, r4, c13, c0, 2
364 /* user ro thread and process ID */ 511 /* User ro thread and process ID */
365 MCR p15, 0, r5, c13, c0, 3 512 MCR p15, 0, r5, c13, c0, 3
366 /*Privileged only thread and process ID */ 513 /* Privileged only thread and process ID */
367 MCR p15, 0, r6, c13, c0, 4 514 MCR p15, 0, r6, c13, c0, 4
368 /* cache size selection */ 515 /* Cache size selection */
369 MCR p15, 2, r7, c0, c0, 0 516 MCR p15, 2, r7, c0, c0, 0
370 ldmia r3!,{r4-r8} 517 ldmia r3!,{r4-r8}
371 /* Data TLB lockdown registers */ 518 /* Data TLB lockdown registers */
372 MCR p15, 0, r4, c10, c0, 0 519 MCR p15, 0, r4, c10, c0, 0
373 /* Instruction TLB lockdown registers */ 520 /* Instruction TLB lockdown registers */
@@ -379,26 +526,27 @@ logic_l1_restore:
379 /* Context PID */ 526 /* Context PID */
380 MCR p15, 0, r8, c13, c0, 1 527 MCR p15, 0, r8, c13, c0, 1
381 528
382 ldmia r3!,{r4-r5} 529 ldmia r3!,{r4-r5}
383 /* primary memory remap register */ 530 /* Primary memory remap register */
384 MCR p15, 0, r4, c10, c2, 0 531 MCR p15, 0, r4, c10, c2, 0
385 /*normal memory remap register */ 532 /* Normal memory remap register */
386 MCR p15, 0, r5, c10, c2, 1 533 MCR p15, 0, r5, c10, c2, 1
387 534
388 /* Restore cpsr */ 535 /* Restore cpsr */
389 ldmia r3!,{r4} /*load CPSR from SDRAM*/ 536 ldmia r3!,{r4} @ load CPSR from SDRAM
390 msr cpsr, r4 /*store cpsr */ 537 msr cpsr, r4 @ store cpsr
391 538
392 /* Enabling MMU here */ 539 /* Enabling MMU here */
393 mrc p15, 0, r7, c2, c0, 2 /* Read TTBRControl */ 540 mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl
394 /* Extract N (0:2) bits and decide whether to use TTBR0 or TTBR1*/ 541 /* Extract N (0:2) bits and decide whether to use TTBR0 or TTBR1 */
395 and r7, #0x7 542 and r7, #0x7
396 cmp r7, #0x0 543 cmp r7, #0x0
397 beq usettbr0 544 beq usettbr0
398ttbr_error: 545ttbr_error:
399 /* More work needs to be done to support N[0:2] value other than 0 546 /*
400 * So looping here so that the error can be detected 547 * More work needs to be done to support N[0:2] value other than 0
401 */ 548 * So looping here so that the error can be detected
549 */
402 b ttbr_error 550 b ttbr_error
403usettbr0: 551usettbr0:
404 mrc p15, 0, r2, c2, c0, 0 552 mrc p15, 0, r2, c2, c0, 0
@@ -406,21 +554,25 @@ usettbr0:
406 and r2, r5 554 and r2, r5
407 mov r4, pc 555 mov r4, pc
408 ldr r5, table_index_mask 556 ldr r5, table_index_mask
409 and r4, r5 /* r4 = 31 to 20 bits of pc */ 557 and r4, r5 @ r4 = 31 to 20 bits of pc
410 /* Extract the value to be written to table entry */ 558 /* Extract the value to be written to table entry */
411 ldr r1, table_entry 559 ldr r1, table_entry
412 add r1, r1, r4 /* r1 has value to be written to table entry*/ 560 /* r1 has the value to be written to table entry*/
561 add r1, r1, r4
413 /* Getting the address of table entry to modify */ 562 /* Getting the address of table entry to modify */
414 lsr r4, #18 563 lsr r4, #18
415 add r2, r4 /* r2 has the location which needs to be modified */ 564 /* r2 has the location which needs to be modified */
565 add r2, r4
416 /* Storing previous entry of location being modified */ 566 /* Storing previous entry of location being modified */
417 ldr r5, scratchpad_base 567 ldr r5, scratchpad_base
418 ldr r4, [r2] 568 ldr r4, [r2]
419 str r4, [r5, #0xC0] 569 str r4, [r5, #0xC0]
420 /* Modify the table entry */ 570 /* Modify the table entry */
421 str r1, [r2] 571 str r1, [r2]
422 /* Storing address of entry being modified 572 /*
423 * - will be restored after enabling MMU */ 573 * Storing address of entry being modified
574 * - will be restored after enabling MMU
575 */
424 ldr r5, scratchpad_base 576 ldr r5, scratchpad_base
425 str r2, [r5, #0xC4] 577 str r2, [r5, #0xC4]
426 578
@@ -429,8 +581,11 @@ usettbr0:
429 mcr p15, 0, r0, c7, c5, 6 @ Invalidate branch predictor array 581 mcr p15, 0, r0, c7, c5, 6 @ Invalidate branch predictor array
430 mcr p15, 0, r0, c8, c5, 0 @ Invalidate instruction TLB 582 mcr p15, 0, r0, c8, c5, 0 @ Invalidate instruction TLB
431 mcr p15, 0, r0, c8, c6, 0 @ Invalidate data TLB 583 mcr p15, 0, r0, c8, c6, 0 @ Invalidate data TLB
432 /* Restore control register but dont enable caches here*/ 584 /*
433 /* Caches will be enabled after restoring MMU table entry */ 585 * Restore control register. This enables the MMU.
586 * The caches and prediction are not enabled here, they
587 * will be enabled after restoring the MMU table entry.
588 */
434 ldmia r3!, {r4} 589 ldmia r3!, {r4}
435 /* Store previous value of control register in scratchpad */ 590 /* Store previous value of control register in scratchpad */
436 str r4, [r5, #0xC8] 591 str r4, [r5, #0xC8]
@@ -438,212 +593,144 @@ usettbr0:
438 and r4, r2 593 and r4, r2
439 mcr p15, 0, r4, c1, c0, 0 594 mcr p15, 0, r4, c1, c0, 0
440 595
441 ldmfd sp!, {r0-r12, pc} @ restore regs and return 596/*
442save_context_wfi: 597 * ==============================
443 /*b save_context_wfi*/ @ enable to debug save code 598 * == Exit point from OFF mode ==
444 mov r8, r0 /* Store SDRAM address in r8 */ 599 * ==============================
445 mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register 600 */
446 mov r4, #0x1 @ Number of parameters for restore call 601 ldmfd sp!, {r0-r12, pc} @ restore regs and return
447 stmia r8!, {r4-r5} @ Push parameters for restore call
448 mrc p15, 1, r5, c9, c0, 2 @ Read L2 AUX ctrl register
449 stmia r8!, {r4-r5} @ Push parameters for restore call
450 /* Check what that target sleep state is:stored in r1*/
451 /* 1 - Only L1 and logic lost */
452 /* 2 - Only L2 lost */
453 /* 3 - Both L1 and L2 lost */
454 cmp r1, #0x2 /* Only L2 lost */
455 beq clean_l2
456 cmp r1, #0x1 /* L2 retained */
457 /* r9 stores whether to clean L2 or not*/
458 moveq r9, #0x0 /* Dont Clean L2 */
459 movne r9, #0x1 /* Clean L2 */
460l1_logic_lost:
461 /* Store sp and spsr to SDRAM */
462 mov r4, sp
463 mrs r5, spsr
464 mov r6, lr
465 stmia r8!, {r4-r6}
466 /* Save all ARM registers */
467 /* Coprocessor access control register */
468 mrc p15, 0, r6, c1, c0, 2
469 stmia r8!, {r6}
470 /* TTBR0, TTBR1 and Translation table base control */
471 mrc p15, 0, r4, c2, c0, 0
472 mrc p15, 0, r5, c2, c0, 1
473 mrc p15, 0, r6, c2, c0, 2
474 stmia r8!, {r4-r6}
475 /* Domain access control register, data fault status register,
476 and instruction fault status register */
477 mrc p15, 0, r4, c3, c0, 0
478 mrc p15, 0, r5, c5, c0, 0
479 mrc p15, 0, r6, c5, c0, 1
480 stmia r8!, {r4-r6}
481 /* Data aux fault status register, instruction aux fault status,
482 datat fault address register and instruction fault address register*/
483 mrc p15, 0, r4, c5, c1, 0
484 mrc p15, 0, r5, c5, c1, 1
485 mrc p15, 0, r6, c6, c0, 0
486 mrc p15, 0, r7, c6, c0, 2
487 stmia r8!, {r4-r7}
488 /* user r/w thread and process ID, user r/o thread and process ID,
489 priv only thread and process ID, cache size selection */
490 mrc p15, 0, r4, c13, c0, 2
491 mrc p15, 0, r5, c13, c0, 3
492 mrc p15, 0, r6, c13, c0, 4
493 mrc p15, 2, r7, c0, c0, 0
494 stmia r8!, {r4-r7}
495 /* Data TLB lockdown, instruction TLB lockdown registers */
496 mrc p15, 0, r5, c10, c0, 0
497 mrc p15, 0, r6, c10, c0, 1
498 stmia r8!, {r5-r6}
499 /* Secure or non secure vector base address, FCSE PID, Context PID*/
500 mrc p15, 0, r4, c12, c0, 0
501 mrc p15, 0, r5, c13, c0, 0
502 mrc p15, 0, r6, c13, c0, 1
503 stmia r8!, {r4-r6}
504 /* Primary remap, normal remap registers */
505 mrc p15, 0, r4, c10, c2, 0
506 mrc p15, 0, r5, c10, c2, 1
507 stmia r8!,{r4-r5}
508 602
509 /* Store current cpsr*/
510 mrs r2, cpsr
511 stmia r8!, {r2}
512 603
513 mrc p15, 0, r4, c1, c0, 0 604/*
514 /* save control register */ 605 * Internal functions
515 stmia r8!, {r4} 606 */
516clean_caches:
517 /* Clean Data or unified cache to POU*/
518 /* How to invalidate only L1 cache???? - #FIX_ME# */
519 /* mcr p15, 0, r11, c7, c11, 1 */
520 cmp r9, #1 /* Check whether L2 inval is required or not*/
521 bne skip_l2_inval
522clean_l2:
523 /* read clidr */
524 mrc p15, 1, r0, c0, c0, 1
525 /* extract loc from clidr */
526 ands r3, r0, #0x7000000
527 /* left align loc bit field */
528 mov r3, r3, lsr #23
529 /* if loc is 0, then no need to clean */
530 beq finished
531 /* start clean at cache level 0 */
532 mov r10, #0
533loop1:
534 /* work out 3x current cache level */
535 add r2, r10, r10, lsr #1
536 /* extract cache type bits from clidr*/
537 mov r1, r0, lsr r2
538 /* mask of the bits for current cache only */
539 and r1, r1, #7
540 /* see what cache we have at this level */
541 cmp r1, #2
542 /* skip if no cache, or just i-cache */
543 blt skip
544 /* select current cache level in cssr */
545 mcr p15, 2, r10, c0, c0, 0
546 /* isb to sych the new cssr&csidr */
547 isb
548 /* read the new csidr */
549 mrc p15, 1, r1, c0, c0, 0
550 /* extract the length of the cache lines */
551 and r2, r1, #7
552 /* add 4 (line length offset) */
553 add r2, r2, #4
554 ldr r4, assoc_mask
555 /* find maximum number on the way size */
556 ands r4, r4, r1, lsr #3
557 /* find bit position of way size increment */
558 clz r5, r4
559 ldr r7, numset_mask
560 /* extract max number of the index size*/
561 ands r7, r7, r1, lsr #13
562loop2:
563 mov r9, r4
564 /* create working copy of max way size*/
565loop3:
566 /* factor way and cache number into r11 */
567 orr r11, r10, r9, lsl r5
568 /* factor index number into r11 */
569 orr r11, r11, r7, lsl r2
570 /*clean & invalidate by set/way */
571 mcr p15, 0, r11, c7, c10, 2
572 /* decrement the way*/
573 subs r9, r9, #1
574 bge loop3
575 /*decrement the index */
576 subs r7, r7, #1
577 bge loop2
578skip:
579 add r10, r10, #2
580 /* increment cache number */
581 cmp r3, r10
582 bgt loop1
583finished:
584 /*swith back to cache level 0 */
585 mov r10, #0
586 /* select current cache level in cssr */
587 mcr p15, 2, r10, c0, c0, 0
588 isb
589skip_l2_inval:
590 /* Data memory barrier and Data sync barrier */
591 mov r1, #0
592 mcr p15, 0, r1, c7, c10, 4
593 mcr p15, 0, r1, c7, c10, 5
594 607
595 wfi @ wait for interrupt 608/* This function implements the erratum ID i443 WA, applies to 34xx >= ES3.0 */
596 nop 609 .text
597 nop 610ENTRY(es3_sdrc_fix)
598 nop 611 ldr r4, sdrc_syscfg @ get config addr
599 nop 612 ldr r5, [r4] @ get value
600 nop 613 tst r5, #0x100 @ is part access blocked
601 nop 614 it eq
602 nop 615 biceq r5, r5, #0x100 @ clear bit if set
603 nop 616 str r5, [r4] @ write back change
604 nop 617 ldr r4, sdrc_mr_0 @ get config addr
605 nop 618 ldr r5, [r4] @ get value
606 bl wait_sdrc_ok 619 str r5, [r4] @ write back change
607 /* restore regs and return */ 620 ldr r4, sdrc_emr2_0 @ get config addr
608 ldmfd sp!, {r0-r12, pc} 621 ldr r5, [r4] @ get value
622 str r5, [r4] @ write back change
623 ldr r4, sdrc_manual_0 @ get config addr
624 mov r5, #0x2 @ autorefresh command
625 str r5, [r4] @ kick off refreshes
626 ldr r4, sdrc_mr_1 @ get config addr
627 ldr r5, [r4] @ get value
628 str r5, [r4] @ write back change
629 ldr r4, sdrc_emr2_1 @ get config addr
630 ldr r5, [r4] @ get value
631 str r5, [r4] @ write back change
632 ldr r4, sdrc_manual_1 @ get config addr
633 mov r5, #0x2 @ autorefresh command
634 str r5, [r4] @ kick off refreshes
635 bx lr
636
637sdrc_syscfg:
638 .word SDRC_SYSCONFIG_P
639sdrc_mr_0:
640 .word SDRC_MR_0_P
641sdrc_emr2_0:
642 .word SDRC_EMR2_0_P
643sdrc_manual_0:
644 .word SDRC_MANUAL_0_P
645sdrc_mr_1:
646 .word SDRC_MR_1_P
647sdrc_emr2_1:
648 .word SDRC_EMR2_1_P
649sdrc_manual_1:
650 .word SDRC_MANUAL_1_P
651ENTRY(es3_sdrc_fix_sz)
652 .word . - es3_sdrc_fix
653
654/*
655 * This function implements the erratum ID i581 WA:
656 * SDRC state restore before accessing the SDRAM
657 *
658 * Only used at return from non-OFF mode. For OFF
659 * mode the ROM code configures the SDRC and
660 * the DPLL before calling the restore code directly
661 * from DDR.
662 */
609 663
610/* Make sure SDRC accesses are ok */ 664/* Make sure SDRC accesses are ok */
611wait_sdrc_ok: 665wait_sdrc_ok:
612 ldr r4, cm_idlest1_core 666
613 ldr r5, [r4] 667/* DPLL3 must be locked before accessing the SDRC. Maybe the HW ensures this */
614 and r5, r5, #0x2 668 ldr r4, cm_idlest_ckgen
615 cmp r5, #0 669wait_dpll3_lock:
616 bne wait_sdrc_ok 670 ldr r5, [r4]
617 ldr r4, sdrc_power 671 tst r5, #1
618 ldr r5, [r4] 672 beq wait_dpll3_lock
619 bic r5, r5, #0x40 673
620 str r5, [r4] 674 ldr r4, cm_idlest1_core
675wait_sdrc_ready:
676 ldr r5, [r4]
677 tst r5, #0x2
678 bne wait_sdrc_ready
679 /* allow DLL powerdown upon hw idle req */
680 ldr r4, sdrc_power
681 ldr r5, [r4]
682 bic r5, r5, #0x40
683 str r5, [r4]
684
685is_dll_in_lock_mode:
686 /* Is dll in lock mode? */
687 ldr r4, sdrc_dlla_ctrl
688 ldr r5, [r4]
689 tst r5, #0x4
690 bxne lr @ Return if locked
691 /* wait till dll locks */
692wait_dll_lock_timed:
693 ldr r4, wait_dll_lock_counter
694 add r4, r4, #1
695 str r4, wait_dll_lock_counter
696 ldr r4, sdrc_dlla_status
697 /* Wait 20uS for lock */
698 mov r6, #8
621wait_dll_lock: 699wait_dll_lock:
622 /* Is dll in lock mode? */ 700 subs r6, r6, #0x1
623 ldr r4, sdrc_dlla_ctrl 701 beq kick_dll
624 ldr r5, [r4] 702 ldr r5, [r4]
625 tst r5, #0x4 703 and r5, r5, #0x4
626 bxne lr 704 cmp r5, #0x4
627 /* wait till dll locks */ 705 bne wait_dll_lock
628 ldr r4, sdrc_dlla_status 706 bx lr @ Return when locked
629 ldr r5, [r4] 707
630 and r5, r5, #0x4 708 /* disable/reenable DLL if not locked */
631 cmp r5, #0x4 709kick_dll:
632 bne wait_dll_lock 710 ldr r4, sdrc_dlla_ctrl
633 bx lr 711 ldr r5, [r4]
712 mov r6, r5
713 bic r6, #(1<<3) @ disable dll
714 str r6, [r4]
715 dsb
716 orr r6, r6, #(1<<3) @ enable dll
717 str r6, [r4]
718 dsb
719 ldr r4, kick_counter
720 add r4, r4, #1
721 str r4, kick_counter
722 b wait_dll_lock_timed
634 723
635cm_idlest1_core: 724cm_idlest1_core:
636 .word CM_IDLEST1_CORE_V 725 .word CM_IDLEST1_CORE_V
726cm_idlest_ckgen:
727 .word CM_IDLEST_CKGEN_V
637sdrc_dlla_status: 728sdrc_dlla_status:
638 .word SDRC_DLLA_STATUS_V 729 .word SDRC_DLLA_STATUS_V
639sdrc_dlla_ctrl: 730sdrc_dlla_ctrl:
640 .word SDRC_DLLA_CTRL_V 731 .word SDRC_DLLA_CTRL_V
641pm_prepwstst_core:
642 .word PM_PREPWSTST_CORE_V
643pm_prepwstst_core_p: 732pm_prepwstst_core_p:
644 .word PM_PREPWSTST_CORE_P 733 .word PM_PREPWSTST_CORE_P
645pm_prepwstst_mpu:
646 .word PM_PREPWSTST_MPU_V
647pm_pwstctrl_mpu: 734pm_pwstctrl_mpu:
648 .word PM_PWSTCTRL_MPU_P 735 .word PM_PWSTCTRL_MPU_P
649scratchpad_base: 736scratchpad_base:
@@ -651,13 +738,7 @@ scratchpad_base:
651sram_base: 738sram_base:
652 .word SRAM_BASE_P + 0x8000 739 .word SRAM_BASE_P + 0x8000
653sdrc_power: 740sdrc_power:
654 .word SDRC_POWER_V 741 .word SDRC_POWER_V
655clk_stabilize_delay:
656 .word 0x000001FF
657assoc_mask:
658 .word 0x3ff
659numset_mask:
660 .word 0x7fff
661ttbrbit_mask: 742ttbrbit_mask:
662 .word 0xFFFFC000 743 .word 0xFFFFC000
663table_index_mask: 744table_index_mask:
@@ -668,5 +749,20 @@ cache_pred_disable_mask:
668 .word 0xFFFFE7FB 749 .word 0xFFFFE7FB
669control_stat: 750control_stat:
670 .word CONTROL_STAT 751 .word CONTROL_STAT
752control_mem_rta:
753 .word CONTROL_MEM_RTA_CTRL
754kernel_flush:
755 .word v7_flush_dcache_all
756l2dis_3630:
757 .word 0
758 /*
759 * When exporting to userspace while the counters are in SRAM,
760 * these 2 words need to be at the end to facilitate retrival!
761 */
762kick_counter:
763 .word 0
764wait_dll_lock_counter:
765 .word 0
766
671ENTRY(omap34xx_cpu_suspend_sz) 767ENTRY(omap34xx_cpu_suspend_sz)
672 .word . - omap34xx_cpu_suspend 768 .word . - omap34xx_cpu_suspend
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
new file mode 100644
index 000000000000..60e70552b4c5
--- /dev/null
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -0,0 +1,59 @@
1/*
2 * Smart reflex Class 3 specific implementations
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 * Thara Gopinath <thara@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
14#include <plat/smartreflex.h>
15
16static int sr_class3_enable(struct voltagedomain *voltdm)
17{
18 unsigned long volt = omap_voltage_get_nom_volt(voltdm);
19
20 if (!volt) {
21 pr_warning("%s: Curr voltage unknown. Cannot enable sr_%s\n",
22 __func__, voltdm->name);
23 return -ENODATA;
24 }
25
26 omap_vp_enable(voltdm);
27 return sr_enable(voltdm, volt);
28}
29
30static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset)
31{
32 omap_vp_disable(voltdm);
33 sr_disable(voltdm);
34 if (is_volt_reset)
35 omap_voltage_reset(voltdm);
36
37 return 0;
38}
39
40static int sr_class3_configure(struct voltagedomain *voltdm)
41{
42 return sr_configure_errgen(voltdm);
43}
44
45/* SR class3 structure */
46static struct omap_sr_class_data class3_data = {
47 .enable = sr_class3_enable,
48 .disable = sr_class3_disable,
49 .configure = sr_class3_configure,
50 .class_type = SR_CLASS3,
51};
52
53/* Smartreflex Class3 init API to be called from board file */
54static int __init sr_class3_init(void)
55{
56 pr_info("SmartReflex Class3 initialized\n");
57 return sr_register_class(&class3_data);
58}
59late_initcall(sr_class3_init);
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
new file mode 100644
index 000000000000..77ecebf3fae2
--- /dev/null
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -0,0 +1,1029 @@
1/*
2 * OMAP SmartReflex Voltage Control
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008 Nokia Corporation
10 * Kalle Jokiniemi
11 *
12 * Copyright (C) 2007 Texas Instruments, Inc.
13 * Lesly A M <x0080970@ti.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
19
20#include <linux/interrupt.h>
21#include <linux/clk.h>
22#include <linux/io.h>
23#include <linux/debugfs.h>
24#include <linux/delay.h>
25#include <linux/slab.h>
26#include <linux/pm_runtime.h>
27
28#include <plat/common.h>
29#include <plat/smartreflex.h>
30
31#include "pm.h"
32
33#define SMARTREFLEX_NAME_LEN 16
34#define NVALUE_NAME_LEN 40
35#define SR_DISABLE_TIMEOUT 200
36
37struct omap_sr {
38 int srid;
39 int ip_type;
40 int nvalue_count;
41 bool autocomp_active;
42 u32 clk_length;
43 u32 err_weight;
44 u32 err_minlimit;
45 u32 err_maxlimit;
46 u32 accum_data;
47 u32 senn_avgweight;
48 u32 senp_avgweight;
49 u32 senp_mod;
50 u32 senn_mod;
51 unsigned int irq;
52 void __iomem *base;
53 struct platform_device *pdev;
54 struct list_head node;
55 struct omap_sr_nvalue_table *nvalue_table;
56 struct voltagedomain *voltdm;
57};
58
59/* sr_list contains all the instances of smartreflex module */
60static LIST_HEAD(sr_list);
61
62static struct omap_sr_class_data *sr_class;
63static struct omap_sr_pmic_data *sr_pmic_data;
64
65static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value)
66{
67 __raw_writel(value, (sr->base + offset));
68}
69
70static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask,
71 u32 value)
72{
73 u32 reg_val;
74 u32 errconfig_offs = 0, errconfig_mask = 0;
75
76 reg_val = __raw_readl(sr->base + offset);
77 reg_val &= ~mask;
78
79 /*
80 * Smartreflex error config register is special as it contains
81 * certain status bits which if written a 1 into means a clear
82 * of those bits. So in order to make sure no accidental write of
83 * 1 happens to those status bits, do a clear of them in the read
84 * value. This mean this API doesn't rewrite values in these bits
85 * if they are currently set, but does allow the caller to write
86 * those bits.
87 */
88 if (sr->ip_type == SR_TYPE_V1) {
89 errconfig_offs = ERRCONFIG_V1;
90 errconfig_mask = ERRCONFIG_STATUS_V1_MASK;
91 } else if (sr->ip_type == SR_TYPE_V2) {
92 errconfig_offs = ERRCONFIG_V2;
93 errconfig_mask = ERRCONFIG_VPBOUNDINTST_V2;
94 }
95
96 if (offset == errconfig_offs)
97 reg_val &= ~errconfig_mask;
98
99 reg_val |= value;
100
101 __raw_writel(reg_val, (sr->base + offset));
102}
103
104static inline u32 sr_read_reg(struct omap_sr *sr, unsigned offset)
105{
106 return __raw_readl(sr->base + offset);
107}
108
109static struct omap_sr *_sr_lookup(struct voltagedomain *voltdm)
110{
111 struct omap_sr *sr_info;
112
113 if (!voltdm) {
114 pr_err("%s: Null voltage domain passed!\n", __func__);
115 return ERR_PTR(-EINVAL);
116 }
117
118 list_for_each_entry(sr_info, &sr_list, node) {
119 if (voltdm == sr_info->voltdm)
120 return sr_info;
121 }
122
123 return ERR_PTR(-ENODATA);
124}
125
126static irqreturn_t sr_interrupt(int irq, void *data)
127{
128 struct omap_sr *sr_info = (struct omap_sr *)data;
129 u32 status = 0;
130
131 if (sr_info->ip_type == SR_TYPE_V1) {
132 /* Read the status bits */
133 status = sr_read_reg(sr_info, ERRCONFIG_V1);
134
135 /* Clear them by writing back */
136 sr_write_reg(sr_info, ERRCONFIG_V1, status);
137 } else if (sr_info->ip_type == SR_TYPE_V2) {
138 /* Read the status bits */
139 sr_read_reg(sr_info, IRQSTATUS);
140
141 /* Clear them by writing back */
142 sr_write_reg(sr_info, IRQSTATUS, status);
143 }
144
145 if (sr_class->class_type == SR_CLASS2 && sr_class->notify)
146 sr_class->notify(sr_info->voltdm, status);
147
148 return IRQ_HANDLED;
149}
150
151static void sr_set_clk_length(struct omap_sr *sr)
152{
153 struct clk *sys_ck;
154 u32 sys_clk_speed;
155
156 if (cpu_is_omap34xx())
157 sys_ck = clk_get(NULL, "sys_ck");
158 else
159 sys_ck = clk_get(NULL, "sys_clkin_ck");
160
161 if (IS_ERR(sys_ck)) {
162 dev_err(&sr->pdev->dev, "%s: unable to get sys clk\n",
163 __func__);
164 return;
165 }
166 sys_clk_speed = clk_get_rate(sys_ck);
167 clk_put(sys_ck);
168
169 switch (sys_clk_speed) {
170 case 12000000:
171 sr->clk_length = SRCLKLENGTH_12MHZ_SYSCLK;
172 break;
173 case 13000000:
174 sr->clk_length = SRCLKLENGTH_13MHZ_SYSCLK;
175 break;
176 case 19200000:
177 sr->clk_length = SRCLKLENGTH_19MHZ_SYSCLK;
178 break;
179 case 26000000:
180 sr->clk_length = SRCLKLENGTH_26MHZ_SYSCLK;
181 break;
182 case 38400000:
183 sr->clk_length = SRCLKLENGTH_38MHZ_SYSCLK;
184 break;
185 default:
186 dev_err(&sr->pdev->dev, "%s: Invalid sysclk value: %d\n",
187 __func__, sys_clk_speed);
188 break;
189 }
190}
191
192static void sr_set_regfields(struct omap_sr *sr)
193{
194 /*
195 * For time being these values are defined in smartreflex.h
196 * and populated during init. May be they can be moved to board
197 * file or pmic specific data structure. In that case these structure
198 * fields will have to be populated using the pdata or pmic structure.
199 */
200 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
201 sr->err_weight = OMAP3430_SR_ERRWEIGHT;
202 sr->err_maxlimit = OMAP3430_SR_ERRMAXLIMIT;
203 sr->accum_data = OMAP3430_SR_ACCUMDATA;
204 if (!(strcmp(sr->voltdm->name, "mpu"))) {
205 sr->senn_avgweight = OMAP3430_SR1_SENNAVGWEIGHT;
206 sr->senp_avgweight = OMAP3430_SR1_SENPAVGWEIGHT;
207 } else {
208 sr->senn_avgweight = OMAP3430_SR2_SENNAVGWEIGHT;
209 sr->senp_avgweight = OMAP3430_SR2_SENPAVGWEIGHT;
210 }
211 }
212}
213
214static void sr_start_vddautocomp(struct omap_sr *sr)
215{
216 if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) {
217 dev_warn(&sr->pdev->dev,
218 "%s: smartreflex class driver not registered\n",
219 __func__);
220 return;
221 }
222
223 if (!sr_class->enable(sr->voltdm))
224 sr->autocomp_active = true;
225}
226
227static void sr_stop_vddautocomp(struct omap_sr *sr)
228{
229 if (!sr_class || !(sr_class->disable)) {
230 dev_warn(&sr->pdev->dev,
231 "%s: smartreflex class driver not registered\n",
232 __func__);
233 return;
234 }
235
236 if (sr->autocomp_active) {
237 sr_class->disable(sr->voltdm, 1);
238 sr->autocomp_active = false;
239 }
240}
241
242/*
243 * This function handles the intializations which have to be done
244 * only when both sr device and class driver regiter has
245 * completed. This will be attempted to be called from both sr class
246 * driver register and sr device intializtion API's. Only one call
247 * will ultimately succeed.
248 *
249 * Currenly this function registers interrrupt handler for a particular SR
250 * if smartreflex class driver is already registered and has
251 * requested for interrupts and the SR interrupt line in present.
252 */
253static int sr_late_init(struct omap_sr *sr_info)
254{
255 char *name;
256 struct omap_sr_data *pdata = sr_info->pdev->dev.platform_data;
257 struct resource *mem;
258 int ret = 0;
259
260 if (sr_class->class_type == SR_CLASS2 &&
261 sr_class->notify_flags && sr_info->irq) {
262
263 name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL);
264 strcpy(name, "sr_");
265 strcat(name, sr_info->voltdm->name);
266 ret = request_irq(sr_info->irq, sr_interrupt,
267 0, name, (void *)sr_info);
268 if (ret)
269 goto error;
270 }
271
272 if (pdata && pdata->enable_on_init)
273 sr_start_vddautocomp(sr_info);
274
275 return ret;
276
277error:
278 iounmap(sr_info->base);
279 mem = platform_get_resource(sr_info->pdev, IORESOURCE_MEM, 0);
280 release_mem_region(mem->start, resource_size(mem));
281 list_del(&sr_info->node);
282 dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
283 "interrupt handler. Smartreflex will"
284 "not function as desired\n", __func__);
285 kfree(sr_info);
286 return ret;
287}
288
289static void sr_v1_disable(struct omap_sr *sr)
290{
291 int timeout = 0;
292
293 /* Enable MCUDisableAcknowledge interrupt */
294 sr_modify_reg(sr, ERRCONFIG_V1,
295 ERRCONFIG_MCUDISACKINTEN, ERRCONFIG_MCUDISACKINTEN);
296
297 /* SRCONFIG - disable SR */
298 sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, 0x0);
299
300 /* Disable all other SR interrupts and clear the status */
301 sr_modify_reg(sr, ERRCONFIG_V1,
302 (ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUVALIDINTEN |
303 ERRCONFIG_MCUBOUNDINTEN | ERRCONFIG_VPBOUNDINTEN_V1),
304 (ERRCONFIG_MCUACCUMINTST | ERRCONFIG_MCUVALIDINTST |
305 ERRCONFIG_MCUBOUNDINTST |
306 ERRCONFIG_VPBOUNDINTST_V1));
307
308 /*
309 * Wait for SR to be disabled.
310 * wait until ERRCONFIG.MCUDISACKINTST = 1. Typical latency is 1us.
311 */
312 omap_test_timeout((sr_read_reg(sr, ERRCONFIG_V1) &
313 ERRCONFIG_MCUDISACKINTST), SR_DISABLE_TIMEOUT,
314 timeout);
315
316 if (timeout >= SR_DISABLE_TIMEOUT)
317 dev_warn(&sr->pdev->dev, "%s: Smartreflex disable timedout\n",
318 __func__);
319
320 /* Disable MCUDisableAcknowledge interrupt & clear pending interrupt */
321 sr_modify_reg(sr, ERRCONFIG_V1, ERRCONFIG_MCUDISACKINTEN,
322 ERRCONFIG_MCUDISACKINTST);
323}
324
325static void sr_v2_disable(struct omap_sr *sr)
326{
327 int timeout = 0;
328
329 /* Enable MCUDisableAcknowledge interrupt */
330 sr_write_reg(sr, IRQENABLE_SET, IRQENABLE_MCUDISABLEACKINT);
331
332 /* SRCONFIG - disable SR */
333 sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, 0x0);
334
335 /* Disable all other SR interrupts and clear the status */
336 sr_modify_reg(sr, ERRCONFIG_V2, ERRCONFIG_VPBOUNDINTEN_V2,
337 ERRCONFIG_VPBOUNDINTST_V2);
338 sr_write_reg(sr, IRQENABLE_CLR, (IRQENABLE_MCUACCUMINT |
339 IRQENABLE_MCUVALIDINT |
340 IRQENABLE_MCUBOUNDSINT));
341 sr_write_reg(sr, IRQSTATUS, (IRQSTATUS_MCUACCUMINT |
342 IRQSTATUS_MCVALIDINT |
343 IRQSTATUS_MCBOUNDSINT));
344
345 /*
346 * Wait for SR to be disabled.
347 * wait until IRQSTATUS.MCUDISACKINTST = 1. Typical latency is 1us.
348 */
349 omap_test_timeout((sr_read_reg(sr, IRQSTATUS) &
350 IRQSTATUS_MCUDISABLEACKINT), SR_DISABLE_TIMEOUT,
351 timeout);
352
353 if (timeout >= SR_DISABLE_TIMEOUT)
354 dev_warn(&sr->pdev->dev, "%s: Smartreflex disable timedout\n",
355 __func__);
356
357 /* Disable MCUDisableAcknowledge interrupt & clear pending interrupt */
358 sr_write_reg(sr, IRQENABLE_CLR, IRQENABLE_MCUDISABLEACKINT);
359 sr_write_reg(sr, IRQSTATUS, IRQSTATUS_MCUDISABLEACKINT);
360}
361
362static u32 sr_retrieve_nvalue(struct omap_sr *sr, u32 efuse_offs)
363{
364 int i;
365
366 if (!sr->nvalue_table) {
367 dev_warn(&sr->pdev->dev, "%s: Missing ntarget value table\n",
368 __func__);
369 return 0;
370 }
371
372 for (i = 0; i < sr->nvalue_count; i++) {
373 if (sr->nvalue_table[i].efuse_offs == efuse_offs)
374 return sr->nvalue_table[i].nvalue;
375 }
376
377 return 0;
378}
379
380/* Public Functions */
381
382/**
383 * sr_configure_errgen() - Configures the smrtreflex to perform AVS using the
384 * error generator module.
385 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
386 *
387 * This API is to be called from the smartreflex class driver to
388 * configure the error generator module inside the smartreflex module.
389 * SR settings if using the ERROR module inside Smartreflex.
390 * SR CLASS 3 by default uses only the ERROR module where as
391 * SR CLASS 2 can choose between ERROR module and MINMAXAVG
392 * module. Returns 0 on success and error value in case of failure.
393 */
394int sr_configure_errgen(struct voltagedomain *voltdm)
395{
396 u32 sr_config, sr_errconfig, errconfig_offs, vpboundint_en;
397 u32 vpboundint_st, senp_en = 0, senn_en = 0;
398 u8 senp_shift, senn_shift;
399 struct omap_sr *sr = _sr_lookup(voltdm);
400
401 if (IS_ERR(sr)) {
402 pr_warning("%s: omap_sr struct for sr_%s not found\n",
403 __func__, voltdm->name);
404 return -EINVAL;
405 }
406
407 if (!sr->clk_length)
408 sr_set_clk_length(sr);
409
410 senp_en = sr->senp_mod;
411 senn_en = sr->senn_mod;
412
413 sr_config = (sr->clk_length << SRCONFIG_SRCLKLENGTH_SHIFT) |
414 SRCONFIG_SENENABLE | SRCONFIG_ERRGEN_EN;
415
416 if (sr->ip_type == SR_TYPE_V1) {
417 sr_config |= SRCONFIG_DELAYCTRL;
418 senn_shift = SRCONFIG_SENNENABLE_V1_SHIFT;
419 senp_shift = SRCONFIG_SENPENABLE_V1_SHIFT;
420 errconfig_offs = ERRCONFIG_V1;
421 vpboundint_en = ERRCONFIG_VPBOUNDINTEN_V1;
422 vpboundint_st = ERRCONFIG_VPBOUNDINTST_V1;
423 } else if (sr->ip_type == SR_TYPE_V2) {
424 senn_shift = SRCONFIG_SENNENABLE_V2_SHIFT;
425 senp_shift = SRCONFIG_SENPENABLE_V2_SHIFT;
426 errconfig_offs = ERRCONFIG_V2;
427 vpboundint_en = ERRCONFIG_VPBOUNDINTEN_V2;
428 vpboundint_st = ERRCONFIG_VPBOUNDINTST_V2;
429 } else {
430 dev_err(&sr->pdev->dev, "%s: Trying to Configure smartreflex"
431 "module without specifying the ip\n", __func__);
432 return -EINVAL;
433 }
434
435 sr_config |= ((senn_en << senn_shift) | (senp_en << senp_shift));
436 sr_write_reg(sr, SRCONFIG, sr_config);
437 sr_errconfig = (sr->err_weight << ERRCONFIG_ERRWEIGHT_SHIFT) |
438 (sr->err_maxlimit << ERRCONFIG_ERRMAXLIMIT_SHIFT) |
439 (sr->err_minlimit << ERRCONFIG_ERRMINLIMIT_SHIFT);
440 sr_modify_reg(sr, errconfig_offs, (SR_ERRWEIGHT_MASK |
441 SR_ERRMAXLIMIT_MASK | SR_ERRMINLIMIT_MASK),
442 sr_errconfig);
443
444 /* Enabling the interrupts if the ERROR module is used */
445 sr_modify_reg(sr, errconfig_offs,
446 vpboundint_en, (vpboundint_en | vpboundint_st));
447
448 return 0;
449}
450
451/**
452 * sr_configure_minmax() - Configures the smrtreflex to perform AVS using the
453 * minmaxavg module.
454 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
455 *
456 * This API is to be called from the smartreflex class driver to
457 * configure the minmaxavg module inside the smartreflex module.
458 * SR settings if using the ERROR module inside Smartreflex.
459 * SR CLASS 3 by default uses only the ERROR module where as
460 * SR CLASS 2 can choose between ERROR module and MINMAXAVG
461 * module. Returns 0 on success and error value in case of failure.
462 */
463int sr_configure_minmax(struct voltagedomain *voltdm)
464{
465 u32 sr_config, sr_avgwt;
466 u32 senp_en = 0, senn_en = 0;
467 u8 senp_shift, senn_shift;
468 struct omap_sr *sr = _sr_lookup(voltdm);
469
470 if (IS_ERR(sr)) {
471 pr_warning("%s: omap_sr struct for sr_%s not found\n",
472 __func__, voltdm->name);
473 return -EINVAL;
474 }
475
476 if (!sr->clk_length)
477 sr_set_clk_length(sr);
478
479 senp_en = sr->senp_mod;
480 senn_en = sr->senn_mod;
481
482 sr_config = (sr->clk_length << SRCONFIG_SRCLKLENGTH_SHIFT) |
483 SRCONFIG_SENENABLE |
484 (sr->accum_data << SRCONFIG_ACCUMDATA_SHIFT);
485
486 if (sr->ip_type == SR_TYPE_V1) {
487 sr_config |= SRCONFIG_DELAYCTRL;
488 senn_shift = SRCONFIG_SENNENABLE_V1_SHIFT;
489 senp_shift = SRCONFIG_SENPENABLE_V1_SHIFT;
490 } else if (sr->ip_type == SR_TYPE_V2) {
491 senn_shift = SRCONFIG_SENNENABLE_V2_SHIFT;
492 senp_shift = SRCONFIG_SENPENABLE_V2_SHIFT;
493 } else {
494 dev_err(&sr->pdev->dev, "%s: Trying to Configure smartreflex"
495 "module without specifying the ip\n", __func__);
496 return -EINVAL;
497 }
498
499 sr_config |= ((senn_en << senn_shift) | (senp_en << senp_shift));
500 sr_write_reg(sr, SRCONFIG, sr_config);
501 sr_avgwt = (sr->senp_avgweight << AVGWEIGHT_SENPAVGWEIGHT_SHIFT) |
502 (sr->senn_avgweight << AVGWEIGHT_SENNAVGWEIGHT_SHIFT);
503 sr_write_reg(sr, AVGWEIGHT, sr_avgwt);
504
505 /*
506 * Enabling the interrupts if MINMAXAVG module is used.
507 * TODO: check if all the interrupts are mandatory
508 */
509 if (sr->ip_type == SR_TYPE_V1) {
510 sr_modify_reg(sr, ERRCONFIG_V1,
511 (ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUVALIDINTEN |
512 ERRCONFIG_MCUBOUNDINTEN),
513 (ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUACCUMINTST |
514 ERRCONFIG_MCUVALIDINTEN | ERRCONFIG_MCUVALIDINTST |
515 ERRCONFIG_MCUBOUNDINTEN | ERRCONFIG_MCUBOUNDINTST));
516 } else if (sr->ip_type == SR_TYPE_V2) {
517 sr_write_reg(sr, IRQSTATUS,
518 IRQSTATUS_MCUACCUMINT | IRQSTATUS_MCVALIDINT |
519 IRQSTATUS_MCBOUNDSINT | IRQSTATUS_MCUDISABLEACKINT);
520 sr_write_reg(sr, IRQENABLE_SET,
521 IRQENABLE_MCUACCUMINT | IRQENABLE_MCUVALIDINT |
522 IRQENABLE_MCUBOUNDSINT | IRQENABLE_MCUDISABLEACKINT);
523 }
524
525 return 0;
526}
527
528/**
529 * sr_enable() - Enables the smartreflex module.
530 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
531 * @volt: The voltage at which the Voltage domain associated with
532 * the smartreflex module is operating at.
533 * This is required only to program the correct Ntarget value.
534 *
535 * This API is to be called from the smartreflex class driver to
536 * enable a smartreflex module. Returns 0 on success. Returns error
537 * value if the voltage passed is wrong or if ntarget value is wrong.
538 */
539int sr_enable(struct voltagedomain *voltdm, unsigned long volt)
540{
541 u32 nvalue_reciprocal;
542 struct omap_volt_data *volt_data;
543 struct omap_sr *sr = _sr_lookup(voltdm);
544 int ret;
545
546 if (IS_ERR(sr)) {
547 pr_warning("%s: omap_sr struct for sr_%s not found\n",
548 __func__, voltdm->name);
549 return -EINVAL;
550 }
551
552 volt_data = omap_voltage_get_voltdata(sr->voltdm, volt);
553
554 if (IS_ERR(volt_data)) {
555 dev_warn(&sr->pdev->dev, "%s: Unable to get voltage table"
556 "for nominal voltage %ld\n", __func__, volt);
557 return -ENODATA;
558 }
559
560 nvalue_reciprocal = sr_retrieve_nvalue(sr, volt_data->sr_efuse_offs);
561
562 if (!nvalue_reciprocal) {
563 dev_warn(&sr->pdev->dev, "%s: NVALUE = 0 at voltage %ld\n",
564 __func__, volt);
565 return -ENODATA;
566 }
567
568 /* errminlimit is opp dependent and hence linked to voltage */
569 sr->err_minlimit = volt_data->sr_errminlimit;
570
571 pm_runtime_get_sync(&sr->pdev->dev);
572
573 /* Check if SR is already enabled. If yes do nothing */
574 if (sr_read_reg(sr, SRCONFIG) & SRCONFIG_SRENABLE)
575 return 0;
576
577 /* Configure SR */
578 ret = sr_class->configure(voltdm);
579 if (ret)
580 return ret;
581
582 sr_write_reg(sr, NVALUERECIPROCAL, nvalue_reciprocal);
583
584 /* SRCONFIG - enable SR */
585 sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, SRCONFIG_SRENABLE);
586 return 0;
587}
588
589/**
590 * sr_disable() - Disables the smartreflex module.
591 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
592 *
593 * This API is to be called from the smartreflex class driver to
594 * disable a smartreflex module.
595 */
596void sr_disable(struct voltagedomain *voltdm)
597{
598 struct omap_sr *sr = _sr_lookup(voltdm);
599
600 if (IS_ERR(sr)) {
601 pr_warning("%s: omap_sr struct for sr_%s not found\n",
602 __func__, voltdm->name);
603 return;
604 }
605
606 /* Check if SR clocks are already disabled. If yes do nothing */
607 if (pm_runtime_suspended(&sr->pdev->dev))
608 return;
609
610 /*
611 * Disable SR if only it is indeed enabled. Else just
612 * disable the clocks.
613 */
614 if (sr_read_reg(sr, SRCONFIG) & SRCONFIG_SRENABLE) {
615 if (sr->ip_type == SR_TYPE_V1)
616 sr_v1_disable(sr);
617 else if (sr->ip_type == SR_TYPE_V2)
618 sr_v2_disable(sr);
619 }
620
621 pm_runtime_put_sync(&sr->pdev->dev);
622}
623
624/**
625 * sr_register_class() - API to register a smartreflex class parameters.
626 * @class_data: The structure containing various sr class specific data.
627 *
628 * This API is to be called by the smartreflex class driver to register itself
629 * with the smartreflex driver during init. Returns 0 on success else the
630 * error value.
631 */
632int sr_register_class(struct omap_sr_class_data *class_data)
633{
634 struct omap_sr *sr_info;
635
636 if (!class_data) {
637 pr_warning("%s:, Smartreflex class data passed is NULL\n",
638 __func__);
639 return -EINVAL;
640 }
641
642 if (sr_class) {
643 pr_warning("%s: Smartreflex class driver already registered\n",
644 __func__);
645 return -EBUSY;
646 }
647
648 sr_class = class_data;
649
650 /*
651 * Call into late init to do intializations that require
652 * both sr driver and sr class driver to be initiallized.
653 */
654 list_for_each_entry(sr_info, &sr_list, node)
655 sr_late_init(sr_info);
656
657 return 0;
658}
659
660/**
661 * omap_sr_enable() - API to enable SR clocks and to call into the
662 * registered smartreflex class enable API.
663 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
664 *
665 * This API is to be called from the kernel in order to enable
666 * a particular smartreflex module. This API will do the initial
667 * configurations to turn on the smartreflex module and in turn call
668 * into the registered smartreflex class enable API.
669 */
670void omap_sr_enable(struct voltagedomain *voltdm)
671{
672 struct omap_sr *sr = _sr_lookup(voltdm);
673
674 if (IS_ERR(sr)) {
675 pr_warning("%s: omap_sr struct for sr_%s not found\n",
676 __func__, voltdm->name);
677 return;
678 }
679
680 if (!sr->autocomp_active)
681 return;
682
683 if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) {
684 dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not"
685 "registered\n", __func__);
686 return;
687 }
688
689 sr_class->enable(voltdm);
690}
691
692/**
693 * omap_sr_disable() - API to disable SR without resetting the voltage
694 * processor voltage
695 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
696 *
697 * This API is to be called from the kernel in order to disable
698 * a particular smartreflex module. This API will in turn call
699 * into the registered smartreflex class disable API. This API will tell
700 * the smartreflex class disable not to reset the VP voltage after
701 * disabling smartreflex.
702 */
703void omap_sr_disable(struct voltagedomain *voltdm)
704{
705 struct omap_sr *sr = _sr_lookup(voltdm);
706
707 if (IS_ERR(sr)) {
708 pr_warning("%s: omap_sr struct for sr_%s not found\n",
709 __func__, voltdm->name);
710 return;
711 }
712
713 if (!sr->autocomp_active)
714 return;
715
716 if (!sr_class || !(sr_class->disable)) {
717 dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not"
718 "registered\n", __func__);
719 return;
720 }
721
722 sr_class->disable(voltdm, 0);
723}
724
725/**
726 * omap_sr_disable_reset_volt() - API to disable SR and reset the
727 * voltage processor voltage
728 * @voltdm: VDD pointer to which the SR module to be configured belongs to.
729 *
730 * This API is to be called from the kernel in order to disable
731 * a particular smartreflex module. This API will in turn call
732 * into the registered smartreflex class disable API. This API will tell
733 * the smartreflex class disable to reset the VP voltage after
734 * disabling smartreflex.
735 */
736void omap_sr_disable_reset_volt(struct voltagedomain *voltdm)
737{
738 struct omap_sr *sr = _sr_lookup(voltdm);
739
740 if (IS_ERR(sr)) {
741 pr_warning("%s: omap_sr struct for sr_%s not found\n",
742 __func__, voltdm->name);
743 return;
744 }
745
746 if (!sr->autocomp_active)
747 return;
748
749 if (!sr_class || !(sr_class->disable)) {
750 dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not"
751 "registered\n", __func__);
752 return;
753 }
754
755 sr_class->disable(voltdm, 1);
756}
757
758/**
759 * omap_sr_register_pmic() - API to register pmic specific info.
760 * @pmic_data: The structure containing pmic specific data.
761 *
762 * This API is to be called from the PMIC specific code to register with
763 * smartreflex driver pmic specific info. Currently the only info required
764 * is the smartreflex init on the PMIC side.
765 */
766void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data)
767{
768 if (!pmic_data) {
769 pr_warning("%s: Trying to register NULL PMIC data structure"
770 "with smartreflex\n", __func__);
771 return;
772 }
773
774 sr_pmic_data = pmic_data;
775}
776
777/* PM Debug Fs enteries to enable disable smartreflex. */
778static int omap_sr_autocomp_show(void *data, u64 *val)
779{
780 struct omap_sr *sr_info = (struct omap_sr *) data;
781
782 if (!sr_info) {
783 pr_warning("%s: omap_sr struct for sr_%s not found\n",
784 __func__, sr_info->voltdm->name);
785 return -EINVAL;
786 }
787
788 *val = sr_info->autocomp_active;
789
790 return 0;
791}
792
793static int omap_sr_autocomp_store(void *data, u64 val)
794{
795 struct omap_sr *sr_info = (struct omap_sr *) data;
796
797 if (!sr_info) {
798 pr_warning("%s: omap_sr struct for sr_%s not found\n",
799 __func__, sr_info->voltdm->name);
800 return -EINVAL;
801 }
802
803 /* Sanity check */
804 if (val && (val != 1)) {
805 pr_warning("%s: Invalid argument %lld\n", __func__, val);
806 return -EINVAL;
807 }
808
809 if (!val)
810 sr_stop_vddautocomp(sr_info);
811 else
812 sr_start_vddautocomp(sr_info);
813
814 return 0;
815}
816
817DEFINE_SIMPLE_ATTRIBUTE(pm_sr_fops, omap_sr_autocomp_show,
818 omap_sr_autocomp_store, "%llu\n");
819
820static int __init omap_sr_probe(struct platform_device *pdev)
821{
822 struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
823 struct omap_sr_data *pdata = pdev->dev.platform_data;
824 struct resource *mem, *irq;
825 struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
826 struct omap_volt_data *volt_data;
827 int i, ret = 0;
828
829 if (!sr_info) {
830 dev_err(&pdev->dev, "%s: unable to allocate sr_info\n",
831 __func__);
832 return -ENOMEM;
833 }
834
835 if (!pdata) {
836 dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
837 return -EINVAL;
838 }
839
840 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
841 if (!mem) {
842 dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
843 ret = -ENODEV;
844 goto err_free_devinfo;
845 }
846
847 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
848
849 pm_runtime_enable(&pdev->dev);
850
851 sr_info->pdev = pdev;
852 sr_info->srid = pdev->id;
853 sr_info->voltdm = pdata->voltdm;
854 sr_info->nvalue_table = pdata->nvalue_table;
855 sr_info->nvalue_count = pdata->nvalue_count;
856 sr_info->senn_mod = pdata->senn_mod;
857 sr_info->senp_mod = pdata->senp_mod;
858 sr_info->autocomp_active = false;
859 sr_info->ip_type = pdata->ip_type;
860 sr_info->base = ioremap(mem->start, resource_size(mem));
861 if (!sr_info->base) {
862 dev_err(&pdev->dev, "%s: ioremap fail\n", __func__);
863 ret = -ENOMEM;
864 goto err_release_region;
865 }
866
867 if (irq)
868 sr_info->irq = irq->start;
869
870 sr_set_clk_length(sr_info);
871 sr_set_regfields(sr_info);
872
873 list_add(&sr_info->node, &sr_list);
874
875 /*
876 * Call into late init to do intializations that require
877 * both sr driver and sr class driver to be initiallized.
878 */
879 if (sr_class) {
880 ret = sr_late_init(sr_info);
881 if (ret) {
882 pr_warning("%s: Error in SR late init\n", __func__);
883 return ret;
884 }
885 }
886
887 dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__);
888
889 /*
890 * If the voltage domain debugfs directory is not created, do
891 * not try to create rest of the debugfs entries.
892 */
893 vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
894 if (!vdd_dbg_dir)
895 return -EINVAL;
896
897 dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
898 if (IS_ERR(dbg_dir)) {
899 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
900 __func__);
901 return PTR_ERR(dbg_dir);
902 }
903
904 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
905 (void *)sr_info, &pm_sr_fops);
906 (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
907 &sr_info->err_weight);
908 (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
909 &sr_info->err_maxlimit);
910 (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
911 &sr_info->err_minlimit);
912
913 nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
914 if (IS_ERR(nvalue_dir)) {
915 dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
916 "for n-values\n", __func__);
917 return PTR_ERR(nvalue_dir);
918 }
919
920 omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
921 if (!volt_data) {
922 dev_warn(&pdev->dev, "%s: No Voltage table for the"
923 " corresponding vdd vdd_%s. Cannot create debugfs"
924 "entries for n-values\n",
925 __func__, sr_info->voltdm->name);
926 return -ENODATA;
927 }
928
929 for (i = 0; i < sr_info->nvalue_count; i++) {
930 char *name;
931 char volt_name[32];
932
933 name = kzalloc(NVALUE_NAME_LEN + 1, GFP_KERNEL);
934 if (!name) {
935 dev_err(&pdev->dev, "%s: Unable to allocate memory"
936 " for n-value directory name\n", __func__);
937 return -ENOMEM;
938 }
939
940 strcpy(name, "volt_");
941 sprintf(volt_name, "%d", volt_data[i].volt_nominal);
942 strcat(name, volt_name);
943 (void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir,
944 &(sr_info->nvalue_table[i].nvalue));
945 }
946
947 return ret;
948
949err_release_region:
950 release_mem_region(mem->start, resource_size(mem));
951err_free_devinfo:
952 kfree(sr_info);
953
954 return ret;
955}
956
957static int __devexit omap_sr_remove(struct platform_device *pdev)
958{
959 struct omap_sr_data *pdata = pdev->dev.platform_data;
960 struct omap_sr *sr_info;
961 struct resource *mem;
962
963 if (!pdata) {
964 dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
965 return -EINVAL;
966 }
967
968 sr_info = _sr_lookup(pdata->voltdm);
969 if (!sr_info) {
970 dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
971 __func__);
972 return -EINVAL;
973 }
974
975 if (sr_info->autocomp_active)
976 sr_stop_vddautocomp(sr_info);
977
978 list_del(&sr_info->node);
979 iounmap(sr_info->base);
980 kfree(sr_info);
981 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
982 release_mem_region(mem->start, resource_size(mem));
983
984 return 0;
985}
986
987static struct platform_driver smartreflex_driver = {
988 .remove = omap_sr_remove,
989 .driver = {
990 .name = "smartreflex",
991 },
992};
993
994static int __init sr_init(void)
995{
996 int ret = 0;
997
998 /*
999 * sr_init is a late init. If by then a pmic specific API is not
1000 * registered either there is no need for anything to be done on
1001 * the PMIC side or somebody has forgotten to register a PMIC
1002 * handler. Warn for the second condition.
1003 */
1004 if (sr_pmic_data && sr_pmic_data->sr_pmic_init)
1005 sr_pmic_data->sr_pmic_init();
1006 else
1007 pr_warning("%s: No PMIC hook to init smartreflex\n", __func__);
1008
1009 ret = platform_driver_probe(&smartreflex_driver, omap_sr_probe);
1010 if (ret) {
1011 pr_err("%s: platform driver register failed for SR\n",
1012 __func__);
1013 return ret;
1014 }
1015
1016 return 0;
1017}
1018
1019static void __exit sr_exit(void)
1020{
1021 platform_driver_unregister(&smartreflex_driver);
1022}
1023late_initcall(sr_init);
1024module_exit(sr_exit);
1025
1026MODULE_DESCRIPTION("OMAP Smartreflex Driver");
1027MODULE_LICENSE("GPL");
1028MODULE_ALIAS("platform:" DRIVER_NAME);
1029MODULE_AUTHOR("Texas Instruments Inc");
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
new file mode 100644
index 000000000000..786d685c09a9
--- /dev/null
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -0,0 +1,146 @@
1/*
2 * OMAP3/OMAP4 smartreflex device file
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Based originally on code from smartreflex.c
7 * Copyright (C) 2010 Texas Instruments, Inc.
8 * Thara Gopinath <thara@ti.com>
9 *
10 * Copyright (C) 2008 Nokia Corporation
11 * Kalle Jokiniemi
12 *
13 * Copyright (C) 2007 Texas Instruments, Inc.
14 * Lesly A M <x0080970@ti.com>
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/err.h>
22#include <linux/slab.h>
23#include <linux/io.h>
24
25#include <plat/omap_device.h>
26#include <plat/smartreflex.h>
27#include <plat/voltage.h>
28
29#include "control.h"
30
31static bool sr_enable_on_init;
32
33static struct omap_device_pm_latency omap_sr_latency[] = {
34 {
35 .deactivate_func = omap_device_idle_hwmods,
36 .activate_func = omap_device_enable_hwmods,
37 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST
38 },
39};
40
41/* Read EFUSE values from control registers for OMAP3430 */
42static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
43 struct omap_sr_data *sr_data)
44{
45 struct omap_sr_nvalue_table *nvalue_table;
46 int i, count = 0;
47
48 while (volt_data[count].volt_nominal)
49 count++;
50
51 nvalue_table = kzalloc(sizeof(struct omap_sr_nvalue_table)*count,
52 GFP_KERNEL);
53
54 for (i = 0; i < count; i++) {
55 u32 v;
56 /*
57 * In OMAP4 the efuse registers are 24 bit aligned.
58 * A __raw_readl will fail for non-32 bit aligned address
59 * and hence the 8-bit read and shift.
60 */
61 if (cpu_is_omap44xx()) {
62 u16 offset = volt_data[i].sr_efuse_offs;
63
64 v = omap_ctrl_readb(offset) |
65 omap_ctrl_readb(offset + 1) << 8 |
66 omap_ctrl_readb(offset + 2) << 16;
67 } else {
68 v = omap_ctrl_readl(volt_data[i].sr_efuse_offs);
69 }
70
71 nvalue_table[i].efuse_offs = volt_data[i].sr_efuse_offs;
72 nvalue_table[i].nvalue = v;
73 }
74
75 sr_data->nvalue_table = nvalue_table;
76 sr_data->nvalue_count = count;
77}
78
79static int sr_dev_init(struct omap_hwmod *oh, void *user)
80{
81 struct omap_sr_data *sr_data;
82 struct omap_device *od;
83 struct omap_volt_data *volt_data;
84 char *name = "smartreflex";
85 static int i;
86
87 sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL);
88 if (!sr_data) {
89 pr_err("%s: Unable to allocate memory for %s sr_data.Error!\n",
90 __func__, oh->name);
91 return -ENOMEM;
92 }
93
94 if (!oh->vdd_name) {
95 pr_err("%s: No voltage domain specified for %s."
96 "Cannot initialize\n", __func__, oh->name);
97 goto exit;
98 }
99
100 sr_data->ip_type = oh->class->rev;
101 sr_data->senn_mod = 0x1;
102 sr_data->senp_mod = 0x1;
103
104 sr_data->voltdm = omap_voltage_domain_lookup(oh->vdd_name);
105 if (IS_ERR(sr_data->voltdm)) {
106 pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
107 __func__, oh->vdd_name);
108 goto exit;
109 }
110
111 omap_voltage_get_volttable(sr_data->voltdm, &volt_data);
112 if (!volt_data) {
113 pr_warning("%s: No Voltage table registerd fo VDD%d."
114 "Something really wrong\n\n", __func__, i + 1);
115 goto exit;
116 }
117
118 sr_set_nvalues(volt_data, sr_data);
119
120 sr_data->enable_on_init = sr_enable_on_init;
121
122 od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
123 omap_sr_latency,
124 ARRAY_SIZE(omap_sr_latency), 0);
125 if (IS_ERR(od))
126 pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
127 __func__, name, oh->name);
128exit:
129 i++;
130 kfree(sr_data);
131 return 0;
132}
133
134/*
135 * API to be called from board files to enable smartreflex
136 * autocompensation at init.
137 */
138void __init omap_enable_smartreflex_on_init(void)
139{
140 sr_enable_on_init = true;
141}
142
143int __init omap_devinit_smartreflex(void)
144{
145 return omap_hwmod_for_each_by_class("smartreflex", sr_dev_init, NULL);
146}
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index 92e6e1a12af8..055310cc77de 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -21,14 +21,20 @@
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA 23 * MA 02111-1307 USA
24 *
25 * Richard Woodruff notes that any changes to this code must be carefully
26 * audited and tested to ensure that they don't cause a TLB miss while
27 * the SDRAM is inaccessible. Such a situation will crash the system
28 * since it will cause the ARM MMU to attempt to walk the page tables.
29 * These crashes may be intermittent.
24 */ 30 */
25#include <linux/linkage.h> 31#include <linux/linkage.h>
26#include <asm/assembler.h> 32#include <asm/assembler.h>
27#include <mach/io.h> 33#include <mach/io.h>
28#include <mach/hardware.h> 34#include <mach/hardware.h>
29 35
30#include "prm.h" 36#include "prm2xxx_3xxx.h"
31#include "cm.h" 37#include "cm2xxx_3xxx.h"
32#include "sdrc.h" 38#include "sdrc.h"
33 39
34 .text 40 .text
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index ab4973695c71..f9007580aea3 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -21,14 +21,20 @@
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA 23 * MA 02111-1307 USA
24 *
25 * Richard Woodruff notes that any changes to this code must be carefully
26 * audited and tested to ensure that they don't cause a TLB miss while
27 * the SDRAM is inaccessible. Such a situation will crash the system
28 * since it will cause the ARM MMU to attempt to walk the page tables.
29 * These crashes may be intermittent.
24 */ 30 */
25#include <linux/linkage.h> 31#include <linux/linkage.h>
26#include <asm/assembler.h> 32#include <asm/assembler.h>
27#include <mach/io.h> 33#include <mach/io.h>
28#include <mach/hardware.h> 34#include <mach/hardware.h>
29 35
30#include "prm.h" 36#include "prm2xxx_3xxx.h"
31#include "cm.h" 37#include "cm2xxx_3xxx.h"
32#include "sdrc.h" 38#include "sdrc.h"
33 39
34 .text 40 .text
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 3637274af5be..7f893a29d500 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -32,7 +32,7 @@
32#include <mach/io.h> 32#include <mach/io.h>
33 33
34#include "sdrc.h" 34#include "sdrc.h"
35#include "cm.h" 35#include "cm2xxx_3xxx.h"
36 36
37 .text 37 .text
38 38
@@ -104,6 +104,12 @@
104 * touching the SDRAM. Until that time, users who know that their use case 104 * touching the SDRAM. Until that time, users who know that their use case
105 * can satisfy the above requirement can enable the CONFIG_OMAP3_SDRC_AC_TIMING 105 * can satisfy the above requirement can enable the CONFIG_OMAP3_SDRC_AC_TIMING
106 * option. 106 * option.
107 *
108 * Richard Woodruff notes that any changes to this code must be carefully
109 * audited and tested to ensure that they don't cause a TLB miss while
110 * the SDRAM is inaccessible. Such a situation will crash the system
111 * since it will cause the ARM MMU to attempt to walk the page tables.
112 * These crashes may be intermittent.
107 */ 113 */
108ENTRY(omap3_sram_configure_core_dpll) 114ENTRY(omap3_sram_configure_core_dpll)
109 stmfd sp!, {r1-r12, lr} @ store regs to stack 115 stmfd sp!, {r1-r12, lr} @ store regs to stack
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index a7816dbdc6b1..4e48e786bec7 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -202,7 +202,7 @@ static struct clocksource clocksource_gpt = {
202static void __init omap2_gp_clocksource_init(void) 202static void __init omap2_gp_clocksource_init(void)
203{ 203{
204 static struct omap_dm_timer *gpt; 204 static struct omap_dm_timer *gpt;
205 u32 tick_rate, tick_period; 205 u32 tick_rate;
206 static char err1[] __initdata = KERN_ERR 206 static char err1[] __initdata = KERN_ERR
207 "%s: failed to request dm-timer\n"; 207 "%s: failed to request dm-timer\n";
208 static char err2[] __initdata = KERN_ERR 208 static char err2[] __initdata = KERN_ERR
@@ -215,7 +215,6 @@ static void __init omap2_gp_clocksource_init(void)
215 215
216 omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK); 216 omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK);
217 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); 217 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt));
218 tick_period = (tick_rate / HZ) - 1;
219 218
220 omap_dm_timer_set_load_start(gpt, 1, 0); 219 omap_dm_timer_set_load_start(gpt, 1, 0);
221 220
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index 64a0112b70a5..30f112bd3e4d 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -120,8 +120,8 @@ static int tusb_set_sync_mode(unsigned sysclk_ps, unsigned fclk_ps)
120 t.adv_on = next_clk(t.cs_on, t_scsnh_advnh - 7000, fclk_ps); 120 t.adv_on = next_clk(t.cs_on, t_scsnh_advnh - 7000, fclk_ps);
121 121
122 /* GPMC_CLK rate = fclk rate / div */ 122 /* GPMC_CLK rate = fclk rate / div */
123 t.sync_clk = 12 /* 11.1 nsec */; 123 t.sync_clk = 11100 /* 11.1 nsec */;
124 tmp = (t.sync_clk * 1000 + fclk_ps - 1) / fclk_ps; 124 tmp = (t.sync_clk + fclk_ps - 1) / fclk_ps;
125 if (tmp > 4) 125 if (tmp > 4)
126 return -ERANGE; 126 return -ERANGE;
127 if (tmp <= 0) 127 if (tmp <= 0)
@@ -216,6 +216,7 @@ static struct resource tusb_resources[] = {
216 .flags = IORESOURCE_MEM, 216 .flags = IORESOURCE_MEM,
217 }, 217 },
218 { /* IRQ */ 218 { /* IRQ */
219 .name = "mc",
219 .flags = IORESOURCE_IRQ, 220 .flags = IORESOURCE_IRQ,
220 }, 221 },
221}; 222};
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
new file mode 100644
index 000000000000..ed6079c94c57
--- /dev/null
+++ b/arch/arm/mach-omap2/voltage.c
@@ -0,0 +1,1571 @@
1/*
2 * OMAP3/OMAP4 Voltage Management Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2007 Texas Instruments, Inc.
7 * Rajendra Nayak <rnayak@ti.com>
8 * Lesly A M <x0080970@ti.com>
9 *
10 * Copyright (C) 2008 Nokia Corporation
11 * Kalle Jokiniemi
12 *
13 * Copyright (C) 2010 Texas Instruments, Inc.
14 * Thara Gopinath <thara@ti.com>
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/delay.h>
22#include <linux/io.h>
23#include <linux/clk.h>
24#include <linux/err.h>
25#include <linux/debugfs.h>
26#include <linux/slab.h>
27
28#include <plat/common.h>
29#include <plat/voltage.h>
30
31#include "prm-regbits-34xx.h"
32#include "prm-regbits-44xx.h"
33#include "prm44xx.h"
34#include "prcm44xx.h"
35#include "prminst44xx.h"
36#include "control.h"
37
38#define VP_IDLE_TIMEOUT 200
39#define VP_TRANXDONE_TIMEOUT 300
40#define VOLTAGE_DIR_SIZE 16
41
42/* Voltage processor register offsets */
43struct vp_reg_offs {
44 u8 vpconfig;
45 u8 vstepmin;
46 u8 vstepmax;
47 u8 vlimitto;
48 u8 vstatus;
49 u8 voltage;
50};
51
52/* Voltage Processor bit field values, shifts and masks */
53struct vp_reg_val {
54 /* PRM module */
55 u16 prm_mod;
56 /* VPx_VPCONFIG */
57 u32 vpconfig_erroroffset;
58 u16 vpconfig_errorgain;
59 u32 vpconfig_errorgain_mask;
60 u8 vpconfig_errorgain_shift;
61 u32 vpconfig_initvoltage_mask;
62 u8 vpconfig_initvoltage_shift;
63 u32 vpconfig_timeouten;
64 u32 vpconfig_initvdd;
65 u32 vpconfig_forceupdate;
66 u32 vpconfig_vpenable;
67 /* VPx_VSTEPMIN */
68 u8 vstepmin_stepmin;
69 u16 vstepmin_smpswaittimemin;
70 u8 vstepmin_stepmin_shift;
71 u8 vstepmin_smpswaittimemin_shift;
72 /* VPx_VSTEPMAX */
73 u8 vstepmax_stepmax;
74 u16 vstepmax_smpswaittimemax;
75 u8 vstepmax_stepmax_shift;
76 u8 vstepmax_smpswaittimemax_shift;
77 /* VPx_VLIMITTO */
78 u8 vlimitto_vddmin;
79 u8 vlimitto_vddmax;
80 u16 vlimitto_timeout;
81 u8 vlimitto_vddmin_shift;
82 u8 vlimitto_vddmax_shift;
83 u8 vlimitto_timeout_shift;
84 /* PRM_IRQSTATUS*/
85 u32 tranxdone_status;
86};
87
88/* Voltage controller registers and offsets */
89struct vc_reg_info {
90 /* PRM module */
91 u16 prm_mod;
92 /* VC register offsets */
93 u8 smps_sa_reg;
94 u8 smps_volra_reg;
95 u8 bypass_val_reg;
96 u8 cmdval_reg;
97 u8 voltsetup_reg;
98 /*VC_SMPS_SA*/
99 u8 smps_sa_shift;
100 u32 smps_sa_mask;
101 /* VC_SMPS_VOL_RA */
102 u8 smps_volra_shift;
103 u32 smps_volra_mask;
104 /* VC_BYPASS_VAL */
105 u8 data_shift;
106 u8 slaveaddr_shift;
107 u8 regaddr_shift;
108 u32 valid;
109 /* VC_CMD_VAL */
110 u8 cmd_on_shift;
111 u8 cmd_onlp_shift;
112 u8 cmd_ret_shift;
113 u8 cmd_off_shift;
114 u32 cmd_on_mask;
115 /* PRM_VOLTSETUP */
116 u8 voltsetup_shift;
117 u32 voltsetup_mask;
118};
119
120/**
121 * omap_vdd_info - Per Voltage Domain info
122 *
123 * @volt_data : voltage table having the distinct voltages supported
124 * by the domain and other associated per voltage data.
125 * @pmic_info : pmic specific parameters which should be populted by
126 * the pmic drivers.
127 * @vp_offs : structure containing the offsets for various
128 * vp registers
129 * @vp_reg : the register values, shifts, masks for various
130 * vp registers
131 * @vc_reg : structure containing various various vc registers,
132 * shifts, masks etc.
133 * @voltdm : pointer to the voltage domain structure
134 * @debug_dir : debug directory for this voltage domain.
135 * @curr_volt : current voltage for this vdd.
136 * @ocp_mod : The prm module for accessing the prm irqstatus reg.
137 * @prm_irqst_reg : prm irqstatus register.
138 * @vp_enabled : flag to keep track of whether vp is enabled or not
139 * @volt_scale : API to scale the voltage of the vdd.
140 */
141struct omap_vdd_info {
142 struct omap_volt_data *volt_data;
143 struct omap_volt_pmic_info *pmic_info;
144 struct vp_reg_offs vp_offs;
145 struct vp_reg_val vp_reg;
146 struct vc_reg_info vc_reg;
147 struct voltagedomain voltdm;
148 struct dentry *debug_dir;
149 u32 curr_volt;
150 u16 ocp_mod;
151 u8 prm_irqst_reg;
152 bool vp_enabled;
153 u32 (*read_reg) (u16 mod, u8 offset);
154 void (*write_reg) (u32 val, u16 mod, u8 offset);
155 int (*volt_scale) (struct omap_vdd_info *vdd,
156 unsigned long target_volt);
157};
158
159static struct omap_vdd_info *vdd_info;
160/*
161 * Number of scalable voltage domains.
162 */
163static int nr_scalable_vdd;
164
165/* OMAP3 VDD sturctures */
166static struct omap_vdd_info omap3_vdd_info[] = {
167 {
168 .vp_offs = {
169 .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET,
170 .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET,
171 .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET,
172 .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET,
173 .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET,
174 .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET,
175 },
176 .voltdm = {
177 .name = "mpu",
178 },
179 },
180 {
181 .vp_offs = {
182 .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET,
183 .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET,
184 .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET,
185 .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET,
186 .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET,
187 .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET,
188 },
189 .voltdm = {
190 .name = "core",
191 },
192 },
193};
194
195#define OMAP3_NR_SCALABLE_VDD ARRAY_SIZE(omap3_vdd_info)
196
197/* OMAP4 VDD sturctures */
198static struct omap_vdd_info omap4_vdd_info[] = {
199 {
200 .vp_offs = {
201 .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET,
202 .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET,
203 .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET,
204 .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET,
205 .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET,
206 .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET,
207 },
208 .voltdm = {
209 .name = "mpu",
210 },
211 },
212 {
213 .vp_offs = {
214 .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET,
215 .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET,
216 .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET,
217 .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET,
218 .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET,
219 .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET,
220 },
221 .voltdm = {
222 .name = "iva",
223 },
224 },
225 {
226 .vp_offs = {
227 .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET,
228 .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET,
229 .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET,
230 .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET,
231 .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET,
232 .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET,
233 },
234 .voltdm = {
235 .name = "core",
236 },
237 },
238};
239
240#define OMAP4_NR_SCALABLE_VDD ARRAY_SIZE(omap4_vdd_info)
241
242/*
243 * Structures containing OMAP3430/OMAP3630 voltage supported and various
244 * voltage dependent data for each VDD.
245 */
246#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \
247{ \
248 .volt_nominal = _v_nom, \
249 .sr_efuse_offs = _efuse_offs, \
250 .sr_errminlimit = _errminlimit, \
251 .vp_errgain = _errgain \
252}
253
254/* VDD1 */
255static struct omap_volt_data omap34xx_vddmpu_volt_data[] = {
256 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c),
257 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c),
258 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18),
259 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18),
260 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18),
261 VOLT_DATA_DEFINE(0, 0, 0, 0),
262};
263
264static struct omap_volt_data omap36xx_vddmpu_volt_data[] = {
265 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c),
266 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16),
267 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23),
268 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27),
269 VOLT_DATA_DEFINE(0, 0, 0, 0),
270};
271
272/* VDD2 */
273static struct omap_volt_data omap34xx_vddcore_volt_data[] = {
274 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c),
275 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c),
276 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18),
277 VOLT_DATA_DEFINE(0, 0, 0, 0),
278};
279
280static struct omap_volt_data omap36xx_vddcore_volt_data[] = {
281 VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c),
282 VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16),
283 VOLT_DATA_DEFINE(0, 0, 0, 0),
284};
285
286/*
287 * Structures containing OMAP4430 voltage supported and various
288 * voltage dependent data for each VDD.
289 */
290static struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
291 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
292 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
293 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
294 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
295 VOLT_DATA_DEFINE(0, 0, 0, 0),
296};
297
298static struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
299 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
300 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
301 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
302 VOLT_DATA_DEFINE(0, 0, 0, 0),
303};
304
305static struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
306 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
307 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
308 VOLT_DATA_DEFINE(0, 0, 0, 0),
309};
310
311static struct dentry *voltage_dir;
312
313/* Init function pointers */
314static void (*vc_init) (struct omap_vdd_info *vdd);
315static int (*vdd_data_configure) (struct omap_vdd_info *vdd);
316
317static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
318{
319 return omap2_prm_read_mod_reg(mod, offset);
320}
321
322static void omap3_voltage_write_reg(u32 val, u16 mod, u8 offset)
323{
324 omap2_prm_write_mod_reg(val, mod, offset);
325}
326
327static u32 omap4_voltage_read_reg(u16 mod, u8 offset)
328{
329 return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
330 mod, offset);
331}
332
333static void omap4_voltage_write_reg(u32 val, u16 mod, u8 offset)
334{
335 omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, mod, offset);
336}
337
338/* Voltage debugfs support */
339static int vp_volt_debug_get(void *data, u64 *val)
340{
341 struct omap_vdd_info *vdd = (struct omap_vdd_info *) data;
342 u8 vsel;
343
344 if (!vdd) {
345 pr_warning("Wrong paramater passed\n");
346 return -EINVAL;
347 }
348
349 vsel = vdd->read_reg(vdd->vp_reg.prm_mod, vdd->vp_offs.voltage);
350 pr_notice("curr_vsel = %x\n", vsel);
351
352 if (!vdd->pmic_info->vsel_to_uv) {
353 pr_warning("PMIC function to convert vsel to voltage"
354 "in uV not registerd\n");
355 return -EINVAL;
356 }
357
358 *val = vdd->pmic_info->vsel_to_uv(vsel);
359 return 0;
360}
361
362static int nom_volt_debug_get(void *data, u64 *val)
363{
364 struct omap_vdd_info *vdd = (struct omap_vdd_info *) data;
365
366 if (!vdd) {
367 pr_warning("Wrong paramater passed\n");
368 return -EINVAL;
369 }
370
371 *val = omap_voltage_get_nom_volt(&vdd->voltdm);
372
373 return 0;
374}
375
376DEFINE_SIMPLE_ATTRIBUTE(vp_volt_debug_fops, vp_volt_debug_get, NULL, "%llu\n");
377DEFINE_SIMPLE_ATTRIBUTE(nom_volt_debug_fops, nom_volt_debug_get, NULL,
378 "%llu\n");
379static void vp_latch_vsel(struct omap_vdd_info *vdd)
380{
381 u32 vpconfig;
382 u16 mod;
383 unsigned long uvdc;
384 char vsel;
385
386 uvdc = omap_voltage_get_nom_volt(&vdd->voltdm);
387 if (!uvdc) {
388 pr_warning("%s: unable to find current voltage for vdd_%s\n",
389 __func__, vdd->voltdm.name);
390 return;
391 }
392
393 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
394 pr_warning("%s: PMIC function to convert voltage in uV to"
395 " vsel not registered\n", __func__);
396 return;
397 }
398
399 mod = vdd->vp_reg.prm_mod;
400
401 vsel = vdd->pmic_info->uv_to_vsel(uvdc);
402
403 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig);
404 vpconfig &= ~(vdd->vp_reg.vpconfig_initvoltage_mask |
405 vdd->vp_reg.vpconfig_initvdd);
406 vpconfig |= vsel << vdd->vp_reg.vpconfig_initvoltage_shift;
407
408 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
409
410 /* Trigger initVDD value copy to voltage processor */
411 vdd->write_reg((vpconfig | vdd->vp_reg.vpconfig_initvdd), mod,
412 vdd->vp_offs.vpconfig);
413
414 /* Clear initVDD copy trigger bit */
415 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
416}
417
418/* Generic voltage init functions */
419static void __init vp_init(struct omap_vdd_info *vdd)
420{
421 u32 vp_val;
422 u16 mod;
423
424 if (!vdd->read_reg || !vdd->write_reg) {
425 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
426 __func__, vdd->voltdm.name);
427 return;
428 }
429
430 mod = vdd->vp_reg.prm_mod;
431
432 vp_val = vdd->vp_reg.vpconfig_erroroffset |
433 (vdd->vp_reg.vpconfig_errorgain <<
434 vdd->vp_reg.vpconfig_errorgain_shift) |
435 vdd->vp_reg.vpconfig_timeouten;
436 vdd->write_reg(vp_val, mod, vdd->vp_offs.vpconfig);
437
438 vp_val = ((vdd->vp_reg.vstepmin_smpswaittimemin <<
439 vdd->vp_reg.vstepmin_smpswaittimemin_shift) |
440 (vdd->vp_reg.vstepmin_stepmin <<
441 vdd->vp_reg.vstepmin_stepmin_shift));
442 vdd->write_reg(vp_val, mod, vdd->vp_offs.vstepmin);
443
444 vp_val = ((vdd->vp_reg.vstepmax_smpswaittimemax <<
445 vdd->vp_reg.vstepmax_smpswaittimemax_shift) |
446 (vdd->vp_reg.vstepmax_stepmax <<
447 vdd->vp_reg.vstepmax_stepmax_shift));
448 vdd->write_reg(vp_val, mod, vdd->vp_offs.vstepmax);
449
450 vp_val = ((vdd->vp_reg.vlimitto_vddmax <<
451 vdd->vp_reg.vlimitto_vddmax_shift) |
452 (vdd->vp_reg.vlimitto_vddmin <<
453 vdd->vp_reg.vlimitto_vddmin_shift) |
454 (vdd->vp_reg.vlimitto_timeout <<
455 vdd->vp_reg.vlimitto_timeout_shift));
456 vdd->write_reg(vp_val, mod, vdd->vp_offs.vlimitto);
457}
458
459static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
460{
461 char *name;
462
463 name = kzalloc(VOLTAGE_DIR_SIZE, GFP_KERNEL);
464 if (!name) {
465 pr_warning("%s: Unable to allocate memory for debugfs"
466 " directory name for vdd_%s",
467 __func__, vdd->voltdm.name);
468 return;
469 }
470 strcpy(name, "vdd_");
471 strcat(name, vdd->voltdm.name);
472
473 vdd->debug_dir = debugfs_create_dir(name, voltage_dir);
474 if (IS_ERR(vdd->debug_dir)) {
475 pr_warning("%s: Unable to create debugfs directory for"
476 " vdd_%s\n", __func__, vdd->voltdm.name);
477 vdd->debug_dir = NULL;
478 return;
479 }
480
481 (void) debugfs_create_x16("vp_errorgain", S_IRUGO, vdd->debug_dir,
482 &(vdd->vp_reg.vpconfig_errorgain));
483 (void) debugfs_create_x16("vp_smpswaittimemin", S_IRUGO,
484 vdd->debug_dir,
485 &(vdd->vp_reg.vstepmin_smpswaittimemin));
486 (void) debugfs_create_x8("vp_stepmin", S_IRUGO, vdd->debug_dir,
487 &(vdd->vp_reg.vstepmin_stepmin));
488 (void) debugfs_create_x16("vp_smpswaittimemax", S_IRUGO,
489 vdd->debug_dir,
490 &(vdd->vp_reg.vstepmax_smpswaittimemax));
491 (void) debugfs_create_x8("vp_stepmax", S_IRUGO, vdd->debug_dir,
492 &(vdd->vp_reg.vstepmax_stepmax));
493 (void) debugfs_create_x8("vp_vddmax", S_IRUGO, vdd->debug_dir,
494 &(vdd->vp_reg.vlimitto_vddmax));
495 (void) debugfs_create_x8("vp_vddmin", S_IRUGO, vdd->debug_dir,
496 &(vdd->vp_reg.vlimitto_vddmin));
497 (void) debugfs_create_x16("vp_timeout", S_IRUGO, vdd->debug_dir,
498 &(vdd->vp_reg.vlimitto_timeout));
499 (void) debugfs_create_file("curr_vp_volt", S_IRUGO, vdd->debug_dir,
500 (void *) vdd, &vp_volt_debug_fops);
501 (void) debugfs_create_file("curr_nominal_volt", S_IRUGO,
502 vdd->debug_dir, (void *) vdd,
503 &nom_volt_debug_fops);
504}
505
506/* Voltage scale and accessory APIs */
507static int _pre_volt_scale(struct omap_vdd_info *vdd,
508 unsigned long target_volt, u8 *target_vsel, u8 *current_vsel)
509{
510 struct omap_volt_data *volt_data;
511 u32 vc_cmdval, vp_errgain_val;
512 u16 vp_mod, vc_mod;
513
514 /* Check if suffiecient pmic info is available for this vdd */
515 if (!vdd->pmic_info) {
516 pr_err("%s: Insufficient pmic info to scale the vdd_%s\n",
517 __func__, vdd->voltdm.name);
518 return -EINVAL;
519 }
520
521 if (!vdd->pmic_info->uv_to_vsel) {
522 pr_err("%s: PMIC function to convert voltage in uV to"
523 "vsel not registered. Hence unable to scale voltage"
524 "for vdd_%s\n", __func__, vdd->voltdm.name);
525 return -ENODATA;
526 }
527
528 if (!vdd->read_reg || !vdd->write_reg) {
529 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
530 __func__, vdd->voltdm.name);
531 return -EINVAL;
532 }
533
534 vp_mod = vdd->vp_reg.prm_mod;
535 vc_mod = vdd->vc_reg.prm_mod;
536
537 /* Get volt_data corresponding to target_volt */
538 volt_data = omap_voltage_get_voltdata(&vdd->voltdm, target_volt);
539 if (IS_ERR(volt_data))
540 volt_data = NULL;
541
542 *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt);
543 *current_vsel = vdd->read_reg(vp_mod, vdd->vp_offs.voltage);
544
545 /* Setting the ON voltage to the new target voltage */
546 vc_cmdval = vdd->read_reg(vc_mod, vdd->vc_reg.cmdval_reg);
547 vc_cmdval &= ~vdd->vc_reg.cmd_on_mask;
548 vc_cmdval |= (*target_vsel << vdd->vc_reg.cmd_on_shift);
549 vdd->write_reg(vc_cmdval, vc_mod, vdd->vc_reg.cmdval_reg);
550
551 /* Setting vp errorgain based on the voltage */
552 if (volt_data) {
553 vp_errgain_val = vdd->read_reg(vp_mod,
554 vdd->vp_offs.vpconfig);
555 vdd->vp_reg.vpconfig_errorgain = volt_data->vp_errgain;
556 vp_errgain_val &= ~vdd->vp_reg.vpconfig_errorgain_mask;
557 vp_errgain_val |= vdd->vp_reg.vpconfig_errorgain <<
558 vdd->vp_reg.vpconfig_errorgain_shift;
559 vdd->write_reg(vp_errgain_val, vp_mod,
560 vdd->vp_offs.vpconfig);
561 }
562
563 return 0;
564}
565
566static void _post_volt_scale(struct omap_vdd_info *vdd,
567 unsigned long target_volt, u8 target_vsel, u8 current_vsel)
568{
569 u32 smps_steps = 0, smps_delay = 0;
570
571 smps_steps = abs(target_vsel - current_vsel);
572 /* SMPS slew rate / step size. 2us added as buffer. */
573 smps_delay = ((smps_steps * vdd->pmic_info->step_size) /
574 vdd->pmic_info->slew_rate) + 2;
575 udelay(smps_delay);
576
577 vdd->curr_volt = target_volt;
578}
579
580/* vc_bypass_scale_voltage - VC bypass method of voltage scaling */
581static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd,
582 unsigned long target_volt)
583{
584 u32 loop_cnt = 0, retries_cnt = 0;
585 u32 vc_valid, vc_bypass_val_reg, vc_bypass_value;
586 u16 mod;
587 u8 target_vsel, current_vsel;
588 int ret;
589
590 ret = _pre_volt_scale(vdd, target_volt, &target_vsel, &current_vsel);
591 if (ret)
592 return ret;
593
594 mod = vdd->vc_reg.prm_mod;
595
596 vc_valid = vdd->vc_reg.valid;
597 vc_bypass_val_reg = vdd->vc_reg.bypass_val_reg;
598 vc_bypass_value = (target_vsel << vdd->vc_reg.data_shift) |
599 (vdd->pmic_info->pmic_reg <<
600 vdd->vc_reg.regaddr_shift) |
601 (vdd->pmic_info->i2c_slave_addr <<
602 vdd->vc_reg.slaveaddr_shift);
603
604 vdd->write_reg(vc_bypass_value, mod, vc_bypass_val_reg);
605 vdd->write_reg(vc_bypass_value | vc_valid, mod, vc_bypass_val_reg);
606
607 vc_bypass_value = vdd->read_reg(mod, vc_bypass_val_reg);
608 /*
609 * Loop till the bypass command is acknowledged from the SMPS.
610 * NOTE: This is legacy code. The loop count and retry count needs
611 * to be revisited.
612 */
613 while (!(vc_bypass_value & vc_valid)) {
614 loop_cnt++;
615
616 if (retries_cnt > 10) {
617 pr_warning("%s: Retry count exceeded\n", __func__);
618 return -ETIMEDOUT;
619 }
620
621 if (loop_cnt > 50) {
622 retries_cnt++;
623 loop_cnt = 0;
624 udelay(10);
625 }
626 vc_bypass_value = vdd->read_reg(mod, vc_bypass_val_reg);
627 }
628
629 _post_volt_scale(vdd, target_volt, target_vsel, current_vsel);
630 return 0;
631}
632
633/* VP force update method of voltage scaling */
634static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
635 unsigned long target_volt)
636{
637 u32 vpconfig;
638 u16 mod, ocp_mod;
639 u8 target_vsel, current_vsel, prm_irqst_reg;
640 int ret, timeout = 0;
641
642 ret = _pre_volt_scale(vdd, target_volt, &target_vsel, &current_vsel);
643 if (ret)
644 return ret;
645
646 mod = vdd->vp_reg.prm_mod;
647 ocp_mod = vdd->ocp_mod;
648 prm_irqst_reg = vdd->prm_irqst_reg;
649
650 /*
651 * Clear all pending TransactionDone interrupt/status. Typical latency
652 * is <3us
653 */
654 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
655 vdd->write_reg(vdd->vp_reg.tranxdone_status,
656 ocp_mod, prm_irqst_reg);
657 if (!(vdd->read_reg(ocp_mod, prm_irqst_reg) &
658 vdd->vp_reg.tranxdone_status))
659 break;
660 udelay(1);
661 }
662 if (timeout >= VP_TRANXDONE_TIMEOUT) {
663 pr_warning("%s: vdd_%s TRANXDONE timeout exceeded."
664 "Voltage change aborted", __func__, vdd->voltdm.name);
665 return -ETIMEDOUT;
666 }
667
668 /* Configure for VP-Force Update */
669 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig);
670 vpconfig &= ~(vdd->vp_reg.vpconfig_initvdd |
671 vdd->vp_reg.vpconfig_forceupdate |
672 vdd->vp_reg.vpconfig_initvoltage_mask);
673 vpconfig |= ((target_vsel <<
674 vdd->vp_reg.vpconfig_initvoltage_shift));
675 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
676
677 /* Trigger initVDD value copy to voltage processor */
678 vpconfig |= vdd->vp_reg.vpconfig_initvdd;
679 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
680
681 /* Force update of voltage */
682 vpconfig |= vdd->vp_reg.vpconfig_forceupdate;
683 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
684
685 /*
686 * Wait for TransactionDone. Typical latency is <200us.
687 * Depends on SMPSWAITTIMEMIN/MAX and voltage change
688 */
689 timeout = 0;
690 omap_test_timeout((vdd->read_reg(ocp_mod, prm_irqst_reg) &
691 vdd->vp_reg.tranxdone_status),
692 VP_TRANXDONE_TIMEOUT, timeout);
693 if (timeout >= VP_TRANXDONE_TIMEOUT)
694 pr_err("%s: vdd_%s TRANXDONE timeout exceeded."
695 "TRANXDONE never got set after the voltage update\n",
696 __func__, vdd->voltdm.name);
697
698 _post_volt_scale(vdd, target_volt, target_vsel, current_vsel);
699
700 /*
701 * Disable TransactionDone interrupt , clear all status, clear
702 * control registers
703 */
704 timeout = 0;
705 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
706 vdd->write_reg(vdd->vp_reg.tranxdone_status,
707 ocp_mod, prm_irqst_reg);
708 if (!(vdd->read_reg(ocp_mod, prm_irqst_reg) &
709 vdd->vp_reg.tranxdone_status))
710 break;
711 udelay(1);
712 }
713
714 if (timeout >= VP_TRANXDONE_TIMEOUT)
715 pr_warning("%s: vdd_%s TRANXDONE timeout exceeded while trying"
716 "to clear the TRANXDONE status\n",
717 __func__, vdd->voltdm.name);
718
719 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig);
720 /* Clear initVDD copy trigger bit */
721 vpconfig &= ~vdd->vp_reg.vpconfig_initvdd;;
722 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
723 /* Clear force bit */
724 vpconfig &= ~vdd->vp_reg.vpconfig_forceupdate;
725 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
726
727 return 0;
728}
729
730/* OMAP3 specific voltage init functions */
731
732/*
733 * Intializes the voltage controller registers with the PMIC and board
734 * specific parameters and voltage setup times for OMAP3.
735 */
736static void __init omap3_vc_init(struct omap_vdd_info *vdd)
737{
738 u32 vc_val;
739 u16 mod;
740 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
741 static bool is_initialized;
742
743 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
744 pr_err("%s: PMIC info requried to configure vc for"
745 "vdd_%s not populated.Hence cannot initialize vc\n",
746 __func__, vdd->voltdm.name);
747 return;
748 }
749
750 if (!vdd->read_reg || !vdd->write_reg) {
751 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
752 __func__, vdd->voltdm.name);
753 return;
754 }
755
756 mod = vdd->vc_reg.prm_mod;
757
758 /* Set up the SMPS_SA(i2c slave address in VC */
759 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_sa_reg);
760 vc_val &= ~vdd->vc_reg.smps_sa_mask;
761 vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_reg.smps_sa_shift;
762 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_sa_reg);
763
764 /* Setup the VOLRA(pmic reg addr) in VC */
765 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_volra_reg);
766 vc_val &= ~vdd->vc_reg.smps_volra_mask;
767 vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_reg.smps_volra_shift;
768 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_volra_reg);
769
770 /*Configure the setup times */
771 vc_val = vdd->read_reg(mod, vdd->vc_reg.voltsetup_reg);
772 vc_val &= ~vdd->vc_reg.voltsetup_mask;
773 vc_val |= vdd->pmic_info->volt_setup_time <<
774 vdd->vc_reg.voltsetup_shift;
775 vdd->write_reg(vc_val, mod, vdd->vc_reg.voltsetup_reg);
776
777 /* Set up the on, inactive, retention and off voltage */
778 on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt);
779 onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt);
780 ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt);
781 off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt);
782 vc_val = ((on_vsel << vdd->vc_reg.cmd_on_shift) |
783 (onlp_vsel << vdd->vc_reg.cmd_onlp_shift) |
784 (ret_vsel << vdd->vc_reg.cmd_ret_shift) |
785 (off_vsel << vdd->vc_reg.cmd_off_shift));
786 vdd->write_reg(vc_val, mod, vdd->vc_reg.cmdval_reg);
787
788 if (is_initialized)
789 return;
790
791 /* Generic VC parameters init */
792 vdd->write_reg(OMAP3430_CMD1_MASK | OMAP3430_RAV1_MASK, mod,
793 OMAP3_PRM_VC_CH_CONF_OFFSET);
794 vdd->write_reg(OMAP3430_MCODE_SHIFT | OMAP3430_HSEN_MASK, mod,
795 OMAP3_PRM_VC_I2C_CFG_OFFSET);
796 vdd->write_reg(OMAP3_CLKSETUP, mod, OMAP3_PRM_CLKSETUP_OFFSET);
797 vdd->write_reg(OMAP3_VOLTOFFSET, mod, OMAP3_PRM_VOLTOFFSET_OFFSET);
798 vdd->write_reg(OMAP3_VOLTSETUP2, mod, OMAP3_PRM_VOLTSETUP2_OFFSET);
799 is_initialized = true;
800}
801
802/* Sets up all the VDD related info for OMAP3 */
803static int __init omap3_vdd_data_configure(struct omap_vdd_info *vdd)
804{
805 struct clk *sys_ck;
806 u32 sys_clk_speed, timeout_val, waittime;
807
808 if (!vdd->pmic_info) {
809 pr_err("%s: PMIC info requried to configure vdd_%s not"
810 "populated.Hence cannot initialize vdd_%s\n",
811 __func__, vdd->voltdm.name, vdd->voltdm.name);
812 return -EINVAL;
813 }
814
815 if (!strcmp(vdd->voltdm.name, "mpu")) {
816 if (cpu_is_omap3630())
817 vdd->volt_data = omap36xx_vddmpu_volt_data;
818 else
819 vdd->volt_data = omap34xx_vddmpu_volt_data;
820
821 vdd->vp_reg.tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK;
822 vdd->vc_reg.cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET;
823 vdd->vc_reg.smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT;
824 vdd->vc_reg.smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK;
825 vdd->vc_reg.smps_volra_shift = OMAP3430_VOLRA0_SHIFT;
826 vdd->vc_reg.smps_volra_mask = OMAP3430_VOLRA0_MASK;
827 vdd->vc_reg.voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT;
828 vdd->vc_reg.voltsetup_mask = OMAP3430_SETUP_TIME1_MASK;
829 } else if (!strcmp(vdd->voltdm.name, "core")) {
830 if (cpu_is_omap3630())
831 vdd->volt_data = omap36xx_vddcore_volt_data;
832 else
833 vdd->volt_data = omap34xx_vddcore_volt_data;
834
835 vdd->vp_reg.tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK;
836 vdd->vc_reg.cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET;
837 vdd->vc_reg.smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT;
838 vdd->vc_reg.smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK;
839 vdd->vc_reg.smps_volra_shift = OMAP3430_VOLRA1_SHIFT;
840 vdd->vc_reg.smps_volra_mask = OMAP3430_VOLRA1_MASK;
841 vdd->vc_reg.voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT;
842 vdd->vc_reg.voltsetup_mask = OMAP3430_SETUP_TIME2_MASK;
843 } else {
844 pr_warning("%s: vdd_%s does not exisit in OMAP3\n",
845 __func__, vdd->voltdm.name);
846 return -EINVAL;
847 }
848
849 /*
850 * Sys clk rate is require to calculate vp timeout value and
851 * smpswaittimemin and smpswaittimemax.
852 */
853 sys_ck = clk_get(NULL, "sys_ck");
854 if (IS_ERR(sys_ck)) {
855 pr_warning("%s: Could not get the sys clk to calculate"
856 "various vdd_%s params\n", __func__, vdd->voltdm.name);
857 return -EINVAL;
858 }
859 sys_clk_speed = clk_get_rate(sys_ck);
860 clk_put(sys_ck);
861 /* Divide to avoid overflow */
862 sys_clk_speed /= 1000;
863
864 /* Generic voltage parameters */
865 vdd->curr_volt = 1200000;
866 vdd->ocp_mod = OCP_MOD;
867 vdd->prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET;
868 vdd->read_reg = omap3_voltage_read_reg;
869 vdd->write_reg = omap3_voltage_write_reg;
870 vdd->volt_scale = vp_forceupdate_scale_voltage;
871 vdd->vp_enabled = false;
872
873 /* VC parameters */
874 vdd->vc_reg.prm_mod = OMAP3430_GR_MOD;
875 vdd->vc_reg.smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET;
876 vdd->vc_reg.smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET;
877 vdd->vc_reg.bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET;
878 vdd->vc_reg.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET;
879 vdd->vc_reg.data_shift = OMAP3430_DATA_SHIFT;
880 vdd->vc_reg.slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT;
881 vdd->vc_reg.regaddr_shift = OMAP3430_REGADDR_SHIFT;
882 vdd->vc_reg.valid = OMAP3430_VALID_MASK;
883 vdd->vc_reg.cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT;
884 vdd->vc_reg.cmd_on_mask = OMAP3430_VC_CMD_ON_MASK;
885 vdd->vc_reg.cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT;
886 vdd->vc_reg.cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT;
887 vdd->vc_reg.cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT;
888
889 vdd->vp_reg.prm_mod = OMAP3430_GR_MOD;
890
891 /* VPCONFIG bit fields */
892 vdd->vp_reg.vpconfig_erroroffset = (vdd->pmic_info->vp_erroroffset <<
893 OMAP3430_ERROROFFSET_SHIFT);
894 vdd->vp_reg.vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK;
895 vdd->vp_reg.vpconfig_errorgain_shift = OMAP3430_ERRORGAIN_SHIFT;
896 vdd->vp_reg.vpconfig_initvoltage_shift = OMAP3430_INITVOLTAGE_SHIFT;
897 vdd->vp_reg.vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK;
898 vdd->vp_reg.vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK;
899 vdd->vp_reg.vpconfig_initvdd = OMAP3430_INITVDD_MASK;
900 vdd->vp_reg.vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK;
901 vdd->vp_reg.vpconfig_vpenable = OMAP3430_VPENABLE_MASK;
902
903 /* VSTEPMIN VSTEPMAX bit fields */
904 waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) *
905 sys_clk_speed) / 1000;
906 vdd->vp_reg.vstepmin_smpswaittimemin = waittime;
907 vdd->vp_reg.vstepmax_smpswaittimemax = waittime;
908 vdd->vp_reg.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin;
909 vdd->vp_reg.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax;
910 vdd->vp_reg.vstepmin_smpswaittimemin_shift =
911 OMAP3430_SMPSWAITTIMEMIN_SHIFT;
912 vdd->vp_reg.vstepmax_smpswaittimemax_shift =
913 OMAP3430_SMPSWAITTIMEMAX_SHIFT;
914 vdd->vp_reg.vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT;
915 vdd->vp_reg.vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT;
916
917 /* VLIMITTO bit fields */
918 timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000;
919 vdd->vp_reg.vlimitto_timeout = timeout_val;
920 vdd->vp_reg.vlimitto_vddmin = vdd->pmic_info->vp_vddmin;
921 vdd->vp_reg.vlimitto_vddmax = vdd->pmic_info->vp_vddmax;
922 vdd->vp_reg.vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT;
923 vdd->vp_reg.vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT;
924 vdd->vp_reg.vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT;
925
926 return 0;
927}
928
929/* OMAP4 specific voltage init functions */
930static void __init omap4_vc_init(struct omap_vdd_info *vdd)
931{
932 u32 vc_val;
933 u16 mod;
934 static bool is_initialized;
935
936 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
937 pr_err("%s: PMIC info requried to configure vc for"
938 "vdd_%s not populated.Hence cannot initialize vc\n",
939 __func__, vdd->voltdm.name);
940 return;
941 }
942
943 if (!vdd->read_reg || !vdd->write_reg) {
944 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
945 __func__, vdd->voltdm.name);
946 return;
947 }
948
949 mod = vdd->vc_reg.prm_mod;
950
951 /* Set up the SMPS_SA(i2c slave address in VC */
952 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_sa_reg);
953 vc_val &= ~vdd->vc_reg.smps_sa_mask;
954 vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_reg.smps_sa_shift;
955 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_sa_reg);
956
957 /* Setup the VOLRA(pmic reg addr) in VC */
958 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_volra_reg);
959 vc_val &= ~vdd->vc_reg.smps_volra_mask;
960 vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_reg.smps_volra_shift;
961 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_volra_reg);
962
963 /* TODO: Configure setup times and CMD_VAL values*/
964
965 if (is_initialized)
966 return;
967
968 /* Generic VC parameters init */
969 vc_val = (OMAP4430_RAV_VDD_MPU_L_MASK | OMAP4430_CMD_VDD_MPU_L_MASK |
970 OMAP4430_RAV_VDD_IVA_L_MASK | OMAP4430_CMD_VDD_IVA_L_MASK |
971 OMAP4430_RAV_VDD_CORE_L_MASK | OMAP4430_CMD_VDD_CORE_L_MASK);
972 vdd->write_reg(vc_val, mod, OMAP4_PRM_VC_CFG_CHANNEL_OFFSET);
973
974 vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT);
975 vdd->write_reg(vc_val, mod, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET);
976
977 is_initialized = true;
978}
979
980/* Sets up all the VDD related info for OMAP4 */
981static int __init omap4_vdd_data_configure(struct omap_vdd_info *vdd)
982{
983 struct clk *sys_ck;
984 u32 sys_clk_speed, timeout_val, waittime;
985
986 if (!vdd->pmic_info) {
987 pr_err("%s: PMIC info requried to configure vdd_%s not"
988 "populated.Hence cannot initialize vdd_%s\n",
989 __func__, vdd->voltdm.name, vdd->voltdm.name);
990 return -EINVAL;
991 }
992
993 if (!strcmp(vdd->voltdm.name, "mpu")) {
994 vdd->volt_data = omap44xx_vdd_mpu_volt_data;
995 vdd->vp_reg.tranxdone_status =
996 OMAP4430_VP_MPU_TRANXDONE_ST_MASK;
997 vdd->vc_reg.cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET;
998 vdd->vc_reg.smps_sa_shift =
999 OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT;
1000 vdd->vc_reg.smps_sa_mask =
1001 OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK;
1002 vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_MPU_L_SHIFT;
1003 vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK;
1004 vdd->vc_reg.voltsetup_reg =
1005 OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET;
1006 vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET;
1007 } else if (!strcmp(vdd->voltdm.name, "core")) {
1008 vdd->volt_data = omap44xx_vdd_core_volt_data;
1009 vdd->vp_reg.tranxdone_status =
1010 OMAP4430_VP_CORE_TRANXDONE_ST_MASK;
1011 vdd->vc_reg.cmdval_reg =
1012 OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET;
1013 vdd->vc_reg.smps_sa_shift = OMAP4430_SA_VDD_CORE_L_0_6_SHIFT;
1014 vdd->vc_reg.smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK;
1015 vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_CORE_L_SHIFT;
1016 vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK;
1017 vdd->vc_reg.voltsetup_reg =
1018 OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET;
1019 vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET;
1020 } else if (!strcmp(vdd->voltdm.name, "iva")) {
1021 vdd->volt_data = omap44xx_vdd_iva_volt_data;
1022 vdd->vp_reg.tranxdone_status =
1023 OMAP4430_VP_IVA_TRANXDONE_ST_MASK;
1024 vdd->vc_reg.cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET;
1025 vdd->vc_reg.smps_sa_shift =
1026 OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT;
1027 vdd->vc_reg.smps_sa_mask =
1028 OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK;
1029 vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_IVA_L_SHIFT;
1030 vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK;
1031 vdd->vc_reg.voltsetup_reg =
1032 OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET;
1033 vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET;
1034 } else {
1035 pr_warning("%s: vdd_%s does not exisit in OMAP4\n",
1036 __func__, vdd->voltdm.name);
1037 return -EINVAL;
1038 }
1039
1040 /*
1041 * Sys clk rate is require to calculate vp timeout value and
1042 * smpswaittimemin and smpswaittimemax.
1043 */
1044 sys_ck = clk_get(NULL, "sys_clkin_ck");
1045 if (IS_ERR(sys_ck)) {
1046 pr_warning("%s: Could not get the sys clk to calculate"
1047 "various vdd_%s params\n", __func__, vdd->voltdm.name);
1048 return -EINVAL;
1049 }
1050 sys_clk_speed = clk_get_rate(sys_ck);
1051 clk_put(sys_ck);
1052 /* Divide to avoid overflow */
1053 sys_clk_speed /= 1000;
1054
1055 /* Generic voltage parameters */
1056 vdd->curr_volt = 1200000;
1057 vdd->ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST;
1058 vdd->read_reg = omap4_voltage_read_reg;
1059 vdd->write_reg = omap4_voltage_write_reg;
1060 vdd->volt_scale = vp_forceupdate_scale_voltage;
1061 vdd->vp_enabled = false;
1062
1063 /* VC parameters */
1064 vdd->vc_reg.prm_mod = OMAP4430_PRM_DEVICE_INST;
1065 vdd->vc_reg.smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET;
1066 vdd->vc_reg.smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET;
1067 vdd->vc_reg.bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET;
1068 vdd->vc_reg.data_shift = OMAP4430_DATA_SHIFT;
1069 vdd->vc_reg.slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT;
1070 vdd->vc_reg.regaddr_shift = OMAP4430_REGADDR_SHIFT;
1071 vdd->vc_reg.valid = OMAP4430_VALID_MASK;
1072 vdd->vc_reg.cmd_on_shift = OMAP4430_ON_SHIFT;
1073 vdd->vc_reg.cmd_on_mask = OMAP4430_ON_MASK;
1074 vdd->vc_reg.cmd_onlp_shift = OMAP4430_ONLP_SHIFT;
1075 vdd->vc_reg.cmd_ret_shift = OMAP4430_RET_SHIFT;
1076 vdd->vc_reg.cmd_off_shift = OMAP4430_OFF_SHIFT;
1077
1078 vdd->vp_reg.prm_mod = OMAP4430_PRM_DEVICE_INST;
1079
1080 /* VPCONFIG bit fields */
1081 vdd->vp_reg.vpconfig_erroroffset = (vdd->pmic_info->vp_erroroffset <<
1082 OMAP4430_ERROROFFSET_SHIFT);
1083 vdd->vp_reg.vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK;
1084 vdd->vp_reg.vpconfig_errorgain_shift = OMAP4430_ERRORGAIN_SHIFT;
1085 vdd->vp_reg.vpconfig_initvoltage_shift = OMAP4430_INITVOLTAGE_SHIFT;
1086 vdd->vp_reg.vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK;
1087 vdd->vp_reg.vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK;
1088 vdd->vp_reg.vpconfig_initvdd = OMAP4430_INITVDD_MASK;
1089 vdd->vp_reg.vpconfig_forceupdate = OMAP4430_FORCEUPDATE_MASK;
1090 vdd->vp_reg.vpconfig_vpenable = OMAP4430_VPENABLE_MASK;
1091
1092 /* VSTEPMIN VSTEPMAX bit fields */
1093 waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) *
1094 sys_clk_speed) / 1000;
1095 vdd->vp_reg.vstepmin_smpswaittimemin = waittime;
1096 vdd->vp_reg.vstepmax_smpswaittimemax = waittime;
1097 vdd->vp_reg.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin;
1098 vdd->vp_reg.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax;
1099 vdd->vp_reg.vstepmin_smpswaittimemin_shift =
1100 OMAP4430_SMPSWAITTIMEMIN_SHIFT;
1101 vdd->vp_reg.vstepmax_smpswaittimemax_shift =
1102 OMAP4430_SMPSWAITTIMEMAX_SHIFT;
1103 vdd->vp_reg.vstepmin_stepmin_shift = OMAP4430_VSTEPMIN_SHIFT;
1104 vdd->vp_reg.vstepmax_stepmax_shift = OMAP4430_VSTEPMAX_SHIFT;
1105
1106 /* VLIMITTO bit fields */
1107 timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000;
1108 vdd->vp_reg.vlimitto_timeout = timeout_val;
1109 vdd->vp_reg.vlimitto_vddmin = vdd->pmic_info->vp_vddmin;
1110 vdd->vp_reg.vlimitto_vddmax = vdd->pmic_info->vp_vddmax;
1111 vdd->vp_reg.vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT;
1112 vdd->vp_reg.vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT;
1113 vdd->vp_reg.vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT;
1114
1115 return 0;
1116}
1117
1118/* Public functions */
1119/**
1120 * omap_voltage_get_nom_volt() - Gets the current non-auto-compensated voltage
1121 * @voltdm: pointer to the VDD for which current voltage info is needed
1122 *
1123 * API to get the current non-auto-compensated voltage for a VDD.
1124 * Returns 0 in case of error else returns the current voltage for the VDD.
1125 */
1126unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm)
1127{
1128 struct omap_vdd_info *vdd;
1129
1130 if (!voltdm || IS_ERR(voltdm)) {
1131 pr_warning("%s: VDD specified does not exist!\n", __func__);
1132 return 0;
1133 }
1134
1135 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1136
1137 return vdd->curr_volt;
1138}
1139
1140/**
1141 * omap_vp_get_curr_volt() - API to get the current vp voltage.
1142 * @voltdm: pointer to the VDD.
1143 *
1144 * This API returns the current voltage for the specified voltage processor
1145 */
1146unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm)
1147{
1148 struct omap_vdd_info *vdd;
1149 u8 curr_vsel;
1150
1151 if (!voltdm || IS_ERR(voltdm)) {
1152 pr_warning("%s: VDD specified does not exist!\n", __func__);
1153 return 0;
1154 }
1155
1156 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1157 if (!vdd->read_reg) {
1158 pr_err("%s: No read API for reading vdd_%s regs\n",
1159 __func__, voltdm->name);
1160 return 0;
1161 }
1162
1163 curr_vsel = vdd->read_reg(vdd->vp_reg.prm_mod,
1164 vdd->vp_offs.voltage);
1165
1166 if (!vdd->pmic_info || !vdd->pmic_info->vsel_to_uv) {
1167 pr_warning("%s: PMIC function to convert vsel to voltage"
1168 "in uV not registerd\n", __func__);
1169 return 0;
1170 }
1171
1172 return vdd->pmic_info->vsel_to_uv(curr_vsel);
1173}
1174
1175/**
1176 * omap_vp_enable() - API to enable a particular VP
1177 * @voltdm: pointer to the VDD whose VP is to be enabled.
1178 *
1179 * This API enables a particular voltage processor. Needed by the smartreflex
1180 * class drivers.
1181 */
1182void omap_vp_enable(struct voltagedomain *voltdm)
1183{
1184 struct omap_vdd_info *vdd;
1185 u32 vpconfig;
1186 u16 mod;
1187
1188 if (!voltdm || IS_ERR(voltdm)) {
1189 pr_warning("%s: VDD specified does not exist!\n", __func__);
1190 return;
1191 }
1192
1193 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1194 if (!vdd->read_reg || !vdd->write_reg) {
1195 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
1196 __func__, voltdm->name);
1197 return;
1198 }
1199
1200 mod = vdd->vp_reg.prm_mod;
1201
1202 /* If VP is already enabled, do nothing. Return */
1203 if (vdd->vp_enabled)
1204 return;
1205
1206 vp_latch_vsel(vdd);
1207
1208 /* Enable VP */
1209 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig);
1210 vpconfig |= vdd->vp_reg.vpconfig_vpenable;
1211 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
1212 vdd->vp_enabled = true;
1213}
1214
1215/**
1216 * omap_vp_disable() - API to disable a particular VP
1217 * @voltdm: pointer to the VDD whose VP is to be disabled.
1218 *
1219 * This API disables a particular voltage processor. Needed by the smartreflex
1220 * class drivers.
1221 */
1222void omap_vp_disable(struct voltagedomain *voltdm)
1223{
1224 struct omap_vdd_info *vdd;
1225 u32 vpconfig;
1226 u16 mod;
1227 int timeout;
1228
1229 if (!voltdm || IS_ERR(voltdm)) {
1230 pr_warning("%s: VDD specified does not exist!\n", __func__);
1231 return;
1232 }
1233
1234 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1235 if (!vdd->read_reg || !vdd->write_reg) {
1236 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
1237 __func__, voltdm->name);
1238 return;
1239 }
1240
1241 mod = vdd->vp_reg.prm_mod;
1242
1243 /* If VP is already disabled, do nothing. Return */
1244 if (!vdd->vp_enabled) {
1245 pr_warning("%s: Trying to disable VP for vdd_%s when"
1246 "it is already disabled\n", __func__, voltdm->name);
1247 return;
1248 }
1249
1250 /* Disable VP */
1251 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig);
1252 vpconfig &= ~vdd->vp_reg.vpconfig_vpenable;
1253 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig);
1254
1255 /*
1256 * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us
1257 */
1258 omap_test_timeout((vdd->read_reg(mod, vdd->vp_offs.vstatus)),
1259 VP_IDLE_TIMEOUT, timeout);
1260
1261 if (timeout >= VP_IDLE_TIMEOUT)
1262 pr_warning("%s: vdd_%s idle timedout\n",
1263 __func__, voltdm->name);
1264
1265 vdd->vp_enabled = false;
1266
1267 return;
1268}
1269
1270/**
1271 * omap_voltage_scale_vdd() - API to scale voltage of a particular
1272 * voltage domain.
1273 * @voltdm: pointer to the VDD which is to be scaled.
1274 * @target_volt: The target voltage of the voltage domain
1275 *
1276 * This API should be called by the kernel to do the voltage scaling
1277 * for a particular voltage domain during dvfs or any other situation.
1278 */
1279int omap_voltage_scale_vdd(struct voltagedomain *voltdm,
1280 unsigned long target_volt)
1281{
1282 struct omap_vdd_info *vdd;
1283
1284 if (!voltdm || IS_ERR(voltdm)) {
1285 pr_warning("%s: VDD specified does not exist!\n", __func__);
1286 return -EINVAL;
1287 }
1288
1289 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1290
1291 if (!vdd->volt_scale) {
1292 pr_err("%s: No voltage scale API registered for vdd_%s\n",
1293 __func__, voltdm->name);
1294 return -ENODATA;
1295 }
1296
1297 return vdd->volt_scale(vdd, target_volt);
1298}
1299
1300/**
1301 * omap_voltage_reset() - Resets the voltage of a particular voltage domain
1302 * to that of the current OPP.
1303 * @voltdm: pointer to the VDD whose voltage is to be reset.
1304 *
1305 * This API finds out the correct voltage the voltage domain is supposed
1306 * to be at and resets the voltage to that level. Should be used expecially
1307 * while disabling any voltage compensation modules.
1308 */
1309void omap_voltage_reset(struct voltagedomain *voltdm)
1310{
1311 unsigned long target_uvdc;
1312
1313 if (!voltdm || IS_ERR(voltdm)) {
1314 pr_warning("%s: VDD specified does not exist!\n", __func__);
1315 return;
1316 }
1317
1318 target_uvdc = omap_voltage_get_nom_volt(voltdm);
1319 if (!target_uvdc) {
1320 pr_err("%s: unable to find current voltage for vdd_%s\n",
1321 __func__, voltdm->name);
1322 return;
1323 }
1324
1325 omap_voltage_scale_vdd(voltdm, target_uvdc);
1326}
1327
1328/**
1329 * omap_voltage_get_volttable() - API to get the voltage table associated with a
1330 * particular voltage domain.
1331 * @voltdm: pointer to the VDD for which the voltage table is required
1332 * @volt_data: the voltage table for the particular vdd which is to be
1333 * populated by this API
1334 *
1335 * This API populates the voltage table associated with a VDD into the
1336 * passed parameter pointer. Returns the count of distinct voltages
1337 * supported by this vdd.
1338 *
1339 */
1340void omap_voltage_get_volttable(struct voltagedomain *voltdm,
1341 struct omap_volt_data **volt_data)
1342{
1343 struct omap_vdd_info *vdd;
1344
1345 if (!voltdm || IS_ERR(voltdm)) {
1346 pr_warning("%s: VDD specified does not exist!\n", __func__);
1347 return;
1348 }
1349
1350 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1351
1352 *volt_data = vdd->volt_data;
1353}
1354
1355/**
1356 * omap_voltage_get_voltdata() - API to get the voltage table entry for a
1357 * particular voltage
1358 * @voltdm: pointer to the VDD whose voltage table has to be searched
1359 * @volt: the voltage to be searched in the voltage table
1360 *
1361 * This API searches through the voltage table for the required voltage
1362 * domain and tries to find a matching entry for the passed voltage volt.
1363 * If a matching entry is found volt_data is populated with that entry.
1364 * This API searches only through the non-compensated voltages int the
1365 * voltage table.
1366 * Returns pointer to the voltage table entry corresponding to volt on
1367 * sucess. Returns -ENODATA if no voltage table exisits for the passed voltage
1368 * domain or if there is no matching entry.
1369 */
1370struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
1371 unsigned long volt)
1372{
1373 struct omap_vdd_info *vdd;
1374 int i;
1375
1376 if (!voltdm || IS_ERR(voltdm)) {
1377 pr_warning("%s: VDD specified does not exist!\n", __func__);
1378 return ERR_PTR(-EINVAL);
1379 }
1380
1381 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1382
1383 if (!vdd->volt_data) {
1384 pr_warning("%s: voltage table does not exist for vdd_%s\n",
1385 __func__, voltdm->name);
1386 return ERR_PTR(-ENODATA);
1387 }
1388
1389 for (i = 0; vdd->volt_data[i].volt_nominal != 0; i++) {
1390 if (vdd->volt_data[i].volt_nominal == volt)
1391 return &vdd->volt_data[i];
1392 }
1393
1394 pr_notice("%s: Unable to match the current voltage with the voltage"
1395 "table for vdd_%s\n", __func__, voltdm->name);
1396
1397 return ERR_PTR(-ENODATA);
1398}
1399
1400/**
1401 * omap_voltage_register_pmic() - API to register PMIC specific data
1402 * @voltdm: pointer to the VDD for which the PMIC specific data is
1403 * to be registered
1404 * @pmic_info: the structure containing pmic info
1405 *
1406 * This API is to be called by the SOC/PMIC file to specify the
1407 * pmic specific info as present in omap_volt_pmic_info structure.
1408 */
1409int omap_voltage_register_pmic(struct voltagedomain *voltdm,
1410 struct omap_volt_pmic_info *pmic_info)
1411{
1412 struct omap_vdd_info *vdd;
1413
1414 if (!voltdm || IS_ERR(voltdm)) {
1415 pr_warning("%s: VDD specified does not exist!\n", __func__);
1416 return -EINVAL;
1417 }
1418
1419 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1420
1421 vdd->pmic_info = pmic_info;
1422
1423 return 0;
1424}
1425
1426/**
1427 * omap_voltage_get_dbgdir() - API to get pointer to the debugfs directory
1428 * corresponding to a voltage domain.
1429 *
1430 * @voltdm: pointer to the VDD whose debug directory is required.
1431 *
1432 * This API returns pointer to the debugfs directory corresponding
1433 * to the voltage domain. Should be used by drivers requiring to
1434 * add any debug entry for a particular voltage domain. Returns NULL
1435 * in case of error.
1436 */
1437struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm)
1438{
1439 struct omap_vdd_info *vdd;
1440
1441 if (!voltdm || IS_ERR(voltdm)) {
1442 pr_warning("%s: VDD specified does not exist!\n", __func__);
1443 return NULL;
1444 }
1445
1446 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1447
1448 return vdd->debug_dir;
1449}
1450
1451/**
1452 * omap_change_voltscale_method() - API to change the voltage scaling method.
1453 * @voltdm: pointer to the VDD whose voltage scaling method
1454 * has to be changed.
1455 * @voltscale_method: the method to be used for voltage scaling.
1456 *
1457 * This API can be used by the board files to change the method of voltage
1458 * scaling between vpforceupdate and vcbypass. The parameter values are
1459 * defined in voltage.h
1460 */
1461void omap_change_voltscale_method(struct voltagedomain *voltdm,
1462 int voltscale_method)
1463{
1464 struct omap_vdd_info *vdd;
1465
1466 if (!voltdm || IS_ERR(voltdm)) {
1467 pr_warning("%s: VDD specified does not exist!\n", __func__);
1468 return;
1469 }
1470
1471 vdd = container_of(voltdm, struct omap_vdd_info, voltdm);
1472
1473 switch (voltscale_method) {
1474 case VOLTSCALE_VPFORCEUPDATE:
1475 vdd->volt_scale = vp_forceupdate_scale_voltage;
1476 return;
1477 case VOLTSCALE_VCBYPASS:
1478 vdd->volt_scale = vc_bypass_scale_voltage;
1479 return;
1480 default:
1481 pr_warning("%s: Trying to change the method of voltage scaling"
1482 "to an unsupported one!\n", __func__);
1483 }
1484}
1485
1486/**
1487 * omap_voltage_domain_lookup() - API to get the voltage domain pointer
1488 * @name: Name of the voltage domain
1489 *
1490 * This API looks up in the global vdd_info struct for the
1491 * existence of voltage domain <name>. If it exists, the API returns
1492 * a pointer to the voltage domain structure corresponding to the
1493 * VDD<name>. Else retuns error pointer.
1494 */
1495struct voltagedomain *omap_voltage_domain_lookup(char *name)
1496{
1497 int i;
1498
1499 if (!vdd_info) {
1500 pr_err("%s: Voltage driver init not yet happened.Faulting!\n",
1501 __func__);
1502 return ERR_PTR(-EINVAL);
1503 }
1504
1505 if (!name) {
1506 pr_err("%s: No name to get the votage domain!\n", __func__);
1507 return ERR_PTR(-EINVAL);
1508 }
1509
1510 for (i = 0; i < nr_scalable_vdd; i++) {
1511 if (!(strcmp(name, vdd_info[i].voltdm.name)))
1512 return &vdd_info[i].voltdm;
1513 }
1514
1515 return ERR_PTR(-EINVAL);
1516}
1517
1518/**
1519 * omap_voltage_late_init() - Init the various voltage parameters
1520 *
1521 * This API is to be called in the later stages of the
1522 * system boot to init the voltage controller and
1523 * voltage processors.
1524 */
1525int __init omap_voltage_late_init(void)
1526{
1527 int i;
1528
1529 if (!vdd_info) {
1530 pr_err("%s: Voltage driver support not added\n",
1531 __func__);
1532 return -EINVAL;
1533 }
1534
1535 voltage_dir = debugfs_create_dir("voltage", NULL);
1536 if (IS_ERR(voltage_dir))
1537 pr_err("%s: Unable to create voltage debugfs main dir\n",
1538 __func__);
1539 for (i = 0; i < nr_scalable_vdd; i++) {
1540 if (vdd_data_configure(&vdd_info[i]))
1541 continue;
1542 vc_init(&vdd_info[i]);
1543 vp_init(&vdd_info[i]);
1544 vdd_debugfs_init(&vdd_info[i]);
1545 }
1546
1547 return 0;
1548}
1549
1550/**
1551 * omap_voltage_early_init()- Volatage driver early init
1552 */
1553static int __init omap_voltage_early_init(void)
1554{
1555 if (cpu_is_omap34xx()) {
1556 vdd_info = omap3_vdd_info;
1557 nr_scalable_vdd = OMAP3_NR_SCALABLE_VDD;
1558 vc_init = omap3_vc_init;
1559 vdd_data_configure = omap3_vdd_data_configure;
1560 } else if (cpu_is_omap44xx()) {
1561 vdd_info = omap4_vdd_info;
1562 nr_scalable_vdd = OMAP4_NR_SCALABLE_VDD;
1563 vc_init = omap4_vc_init;
1564 vdd_data_configure = omap4_vdd_data_configure;
1565 } else {
1566 pr_warning("%s: voltage driver support not added\n", __func__);
1567 }
1568
1569 return 0;
1570}
1571core_initcall(omap_voltage_early_init);
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
new file mode 100644
index 000000000000..b0c4907ab3ca
--- /dev/null
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -0,0 +1,54 @@
1/*
2 * OMAP2+ MPU WD_TIMER-specific code
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
10#include <linux/kernel.h>
11#include <linux/io.h>
12#include <linux/err.h>
13
14#include <plat/omap_hwmod.h>
15
16/*
17 * In order to avoid any assumptions from bootloader regarding WDT
18 * settings, WDT module is reset during init. This enables the watchdog
19 * timer. Hence it is required to disable the watchdog after the WDT reset
20 * during init. Otherwise the system would reboot as per the default
21 * watchdog timer registers settings.
22 */
23#define OMAP_WDT_WPS 0x34
24#define OMAP_WDT_SPR 0x48
25
26
27int omap2_wd_timer_disable(struct omap_hwmod *oh)
28{
29 void __iomem *base;
30
31 if (!oh) {
32 pr_err("%s: Could not look up wdtimer_hwmod\n", __func__);
33 return -EINVAL;
34 }
35
36 base = omap_hwmod_get_mpu_rt_va(oh);
37 if (!base) {
38 pr_err("%s: Could not get the base address for %s\n",
39 oh->name, __func__);
40 return -EINVAL;
41 }
42
43 /* sequence required to disable watchdog */
44 __raw_writel(0xAAAA, base + OMAP_WDT_SPR);
45 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
46 cpu_relax();
47
48 __raw_writel(0x5555, base + OMAP_WDT_SPR);
49 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
50 cpu_relax();
51
52 return 0;
53}
54
diff --git a/arch/arm/mach-omap2/wd_timer.h b/arch/arm/mach-omap2/wd_timer.h
new file mode 100644
index 000000000000..e0054a2d5505
--- /dev/null
+++ b/arch/arm/mach-omap2/wd_timer.h
@@ -0,0 +1,17 @@
1/*
2 * OMAP2+ MPU WD_TIMER-specific function prototypes
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
10#ifndef __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
11#define __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
12
13#include <plat/omap_hwmod.h>
14
15extern int omap2_wd_timer_disable(struct omap_hwmod *oh);
16
17#endif
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index c9408434a855..18fe3cb195dc 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -18,6 +18,7 @@ config ARCH_OMAP1
18config ARCH_OMAP2PLUS 18config ARCH_OMAP2PLUS
19 bool "TI OMAP2/3/4" 19 bool "TI OMAP2/3/4"
20 select CLKDEV_LOOKUP 20 select CLKDEV_LOOKUP
21 select OMAP_DM_TIMER
21 help 22 help
22 "Systems based on OMAP2, OMAP3 or OMAP4" 23 "Systems based on OMAP2, OMAP3 or OMAP4"
23 24
@@ -35,6 +36,37 @@ config OMAP_DEBUG_LEDS
35 depends on OMAP_DEBUG_DEVICES 36 depends on OMAP_DEBUG_DEVICES
36 default y if LEDS_CLASS 37 default y if LEDS_CLASS
37 38
39config OMAP_SMARTREFLEX
40 bool "SmartReflex support"
41 depends on (ARCH_OMAP3 || ARCH_OMAP4) && PM
42 help
43 Say Y if you want to enable SmartReflex.
44
45 SmartReflex can perform continuous dynamic voltage
46 scaling around the nominal operating point voltage
47 according to silicon characteristics and operating
48 conditions. Enabling SmartReflex reduces power
49 consumption.
50
51 Please note, that by default SmartReflex is only
52 initialized. To enable the automatic voltage
53 compensation for vdd mpu and vdd core from user space,
54 user must write 1 to
55 /debug/voltage/vdd_<X>/smartreflex/autocomp,
56 where X is mpu or core for OMAP3.
57 Optionallly autocompensation can be enabled in the kernel
58 by default during system init via the enable_on_init flag
59 which an be passed as platform data to the smartreflex driver.
60
61config OMAP_SMARTREFLEX_CLASS3
62 bool "Class 3 mode of Smartreflex Implementation"
63 depends on OMAP_SMARTREFLEX && TWL4030_CORE
64 help
65 Say Y to enable Class 3 implementation of Smartreflex
66
67 Class 3 implementation of Smartreflex employs continuous hardware
68 voltage calibration.
69
38config OMAP_RESET_CLOCKS 70config OMAP_RESET_CLOCKS
39 bool "Reset unused clocks during boot" 71 bool "Reset unused clocks during boot"
40 depends on ARCH_OMAP 72 depends on ARCH_OMAP
@@ -109,6 +141,9 @@ config OMAP_IOMMU_DEBUG
109 141
110 Say N unless you know you need this. 142 Say N unless you know you need this.
111 143
144config OMAP_IOMMU_IVA2
145 bool
146
112choice 147choice
113 prompt "System timer" 148 prompt "System timer"
114 default OMAP_32K_TIMER if !ARCH_OMAP15XX 149 default OMAP_32K_TIMER if !ARCH_OMAP15XX
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index fc819120978d..10245b837c10 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -232,46 +232,6 @@ static void omap_init_uwire(void)
232static inline void omap_init_uwire(void) {} 232static inline void omap_init_uwire(void) {}
233#endif 233#endif
234 234
235/*-------------------------------------------------------------------------*/
236
237#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
238
239static struct resource wdt_resources[] = {
240 {
241 .flags = IORESOURCE_MEM,
242 },
243};
244
245static struct platform_device omap_wdt_device = {
246 .name = "omap_wdt",
247 .id = -1,
248 .num_resources = ARRAY_SIZE(wdt_resources),
249 .resource = wdt_resources,
250};
251
252static void omap_init_wdt(void)
253{
254 if (cpu_is_omap16xx())
255 wdt_resources[0].start = 0xfffeb000;
256 else if (cpu_is_omap2420())
257 wdt_resources[0].start = 0x48022000; /* WDT2 */
258 else if (cpu_is_omap2430())
259 wdt_resources[0].start = 0x49016000; /* WDT2 */
260 else if (cpu_is_omap343x())
261 wdt_resources[0].start = 0x48314000; /* WDT2 */
262 else if (cpu_is_omap44xx())
263 wdt_resources[0].start = 0x4a314000;
264 else
265 return;
266
267 wdt_resources[0].end = wdt_resources[0].start + 0x4f;
268
269 (void) platform_device_register(&omap_wdt_device);
270}
271#else
272static inline void omap_init_wdt(void) {}
273#endif
274
275#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) 235#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
276 236
277static phys_addr_t omap_dsp_phys_mempool_base; 237static phys_addr_t omap_dsp_phys_mempool_base;
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 2c2826571d45..c4b2b478b1a5 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -15,6 +15,10 @@
15 * 15 *
16 * Support functions for the OMAP internal DMA channels. 16 * Support functions for the OMAP internal DMA channels.
17 * 17 *
18 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
19 * Converted DMA library into DMA platform driver.
20 * - G, Manjunath Kondaiah <manjugk@ti.com>
21 *
18 * This program is free software; you can redistribute it and/or modify 22 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as 23 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation. 24 * published by the Free Software Foundation.
@@ -53,7 +57,11 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED };
53 57
54#define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec) 58#define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec)
55 59
60static struct omap_system_dma_plat_info *p;
61static struct omap_dma_dev_attr *d;
62
56static int enable_1510_mode; 63static int enable_1510_mode;
64static u32 errata;
57 65
58static struct omap_dma_global_context_registers { 66static struct omap_dma_global_context_registers {
59 u32 dma_irqenable_l0; 67 u32 dma_irqenable_l0;
@@ -61,27 +69,6 @@ static struct omap_dma_global_context_registers {
61 u32 dma_gcr; 69 u32 dma_gcr;
62} omap_dma_global_context; 70} omap_dma_global_context;
63 71
64struct omap_dma_lch {
65 int next_lch;
66 int dev_id;
67 u16 saved_csr;
68 u16 enabled_irqs;
69 const char *dev_name;
70 void (*callback)(int lch, u16 ch_status, void *data);
71 void *data;
72
73#ifndef CONFIG_ARCH_OMAP1
74 /* required for Dynamic chaining */
75 int prev_linked_ch;
76 int next_linked_ch;
77 int state;
78 int chain_id;
79
80 int status;
81#endif
82 long flags;
83};
84
85struct dma_link_info { 72struct dma_link_info {
86 int *linked_dmach_q; 73 int *linked_dmach_q;
87 int no_of_lchs_linked; 74 int no_of_lchs_linked;
@@ -137,15 +124,6 @@ static int omap_dma_reserve_channels;
137 124
138static spinlock_t dma_chan_lock; 125static spinlock_t dma_chan_lock;
139static struct omap_dma_lch *dma_chan; 126static struct omap_dma_lch *dma_chan;
140static void __iomem *omap_dma_base;
141
142static const u8 omap1_dma_irq[OMAP1_LOGICAL_DMA_CH_COUNT] = {
143 INT_DMA_CH0_6, INT_DMA_CH1_7, INT_DMA_CH2_8, INT_DMA_CH3,
144 INT_DMA_CH4, INT_DMA_CH5, INT_1610_DMA_CH6, INT_1610_DMA_CH7,
145 INT_1610_DMA_CH8, INT_1610_DMA_CH9, INT_1610_DMA_CH10,
146 INT_1610_DMA_CH11, INT_1610_DMA_CH12, INT_1610_DMA_CH13,
147 INT_1610_DMA_CH14, INT_1610_DMA_CH15, INT_DMA_LCD
148};
149 127
150static inline void disable_lnk(int lch); 128static inline void disable_lnk(int lch);
151static void omap_disable_channel_irq(int lch); 129static void omap_disable_channel_irq(int lch);
@@ -154,24 +132,6 @@ static inline void omap_enable_channel_irq(int lch);
154#define REVISIT_24XX() printk(KERN_ERR "FIXME: no %s on 24xx\n", \ 132#define REVISIT_24XX() printk(KERN_ERR "FIXME: no %s on 24xx\n", \
155 __func__); 133 __func__);
156 134
157#define dma_read(reg) \
158({ \
159 u32 __val; \
160 if (cpu_class_is_omap1()) \
161 __val = __raw_readw(omap_dma_base + OMAP1_DMA_##reg); \
162 else \
163 __val = __raw_readl(omap_dma_base + OMAP_DMA4_##reg); \
164 __val; \
165})
166
167#define dma_write(val, reg) \
168({ \
169 if (cpu_class_is_omap1()) \
170 __raw_writew((u16)(val), omap_dma_base + OMAP1_DMA_##reg); \
171 else \
172 __raw_writel((val), omap_dma_base + OMAP_DMA4_##reg); \
173})
174
175#ifdef CONFIG_ARCH_OMAP15XX 135#ifdef CONFIG_ARCH_OMAP15XX
176/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ 136/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
177int omap_dma_in_1510_mode(void) 137int omap_dma_in_1510_mode(void)
@@ -206,16 +166,6 @@ static inline void set_gdma_dev(int req, int dev)
206#define set_gdma_dev(req, dev) do {} while (0) 166#define set_gdma_dev(req, dev) do {} while (0)
207#endif 167#endif
208 168
209/* Omap1 only */
210static void clear_lch_regs(int lch)
211{
212 int i;
213 void __iomem *lch_base = omap_dma_base + OMAP1_DMA_CH_BASE(lch);
214
215 for (i = 0; i < 0x2c; i += 2)
216 __raw_writew(0, lch_base + i);
217}
218
219void omap_set_dma_priority(int lch, int dst_port, int priority) 169void omap_set_dma_priority(int lch, int dst_port, int priority)
220{ 170{
221 unsigned long reg; 171 unsigned long reg;
@@ -248,12 +198,12 @@ void omap_set_dma_priority(int lch, int dst_port, int priority)
248 if (cpu_class_is_omap2()) { 198 if (cpu_class_is_omap2()) {
249 u32 ccr; 199 u32 ccr;
250 200
251 ccr = dma_read(CCR(lch)); 201 ccr = p->dma_read(CCR, lch);
252 if (priority) 202 if (priority)
253 ccr |= (1 << 6); 203 ccr |= (1 << 6);
254 else 204 else
255 ccr &= ~(1 << 6); 205 ccr &= ~(1 << 6);
256 dma_write(ccr, CCR(lch)); 206 p->dma_write(ccr, CCR, lch);
257 } 207 }
258} 208}
259EXPORT_SYMBOL(omap_set_dma_priority); 209EXPORT_SYMBOL(omap_set_dma_priority);
@@ -264,31 +214,31 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
264{ 214{
265 u32 l; 215 u32 l;
266 216
267 l = dma_read(CSDP(lch)); 217 l = p->dma_read(CSDP, lch);
268 l &= ~0x03; 218 l &= ~0x03;
269 l |= data_type; 219 l |= data_type;
270 dma_write(l, CSDP(lch)); 220 p->dma_write(l, CSDP, lch);
271 221
272 if (cpu_class_is_omap1()) { 222 if (cpu_class_is_omap1()) {
273 u16 ccr; 223 u16 ccr;
274 224
275 ccr = dma_read(CCR(lch)); 225 ccr = p->dma_read(CCR, lch);
276 ccr &= ~(1 << 5); 226 ccr &= ~(1 << 5);
277 if (sync_mode == OMAP_DMA_SYNC_FRAME) 227 if (sync_mode == OMAP_DMA_SYNC_FRAME)
278 ccr |= 1 << 5; 228 ccr |= 1 << 5;
279 dma_write(ccr, CCR(lch)); 229 p->dma_write(ccr, CCR, lch);
280 230
281 ccr = dma_read(CCR2(lch)); 231 ccr = p->dma_read(CCR2, lch);
282 ccr &= ~(1 << 2); 232 ccr &= ~(1 << 2);
283 if (sync_mode == OMAP_DMA_SYNC_BLOCK) 233 if (sync_mode == OMAP_DMA_SYNC_BLOCK)
284 ccr |= 1 << 2; 234 ccr |= 1 << 2;
285 dma_write(ccr, CCR2(lch)); 235 p->dma_write(ccr, CCR2, lch);
286 } 236 }
287 237
288 if (cpu_class_is_omap2() && dma_trigger) { 238 if (cpu_class_is_omap2() && dma_trigger) {
289 u32 val; 239 u32 val;
290 240
291 val = dma_read(CCR(lch)); 241 val = p->dma_read(CCR, lch);
292 242
293 /* DMA_SYNCHRO_CONTROL_UPPER depends on the channel number */ 243 /* DMA_SYNCHRO_CONTROL_UPPER depends on the channel number */
294 val &= ~((1 << 23) | (3 << 19) | 0x1f); 244 val &= ~((1 << 23) | (3 << 19) | 0x1f);
@@ -313,11 +263,11 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
313 } else { 263 } else {
314 val &= ~(1 << 24); /* dest synch */ 264 val &= ~(1 << 24); /* dest synch */
315 } 265 }
316 dma_write(val, CCR(lch)); 266 p->dma_write(val, CCR, lch);
317 } 267 }
318 268
319 dma_write(elem_count, CEN(lch)); 269 p->dma_write(elem_count, CEN, lch);
320 dma_write(frame_count, CFN(lch)); 270 p->dma_write(frame_count, CFN, lch);
321} 271}
322EXPORT_SYMBOL(omap_set_dma_transfer_params); 272EXPORT_SYMBOL(omap_set_dma_transfer_params);
323 273
@@ -328,7 +278,7 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
328 if (cpu_class_is_omap1()) { 278 if (cpu_class_is_omap1()) {
329 u16 w; 279 u16 w;
330 280
331 w = dma_read(CCR2(lch)); 281 w = p->dma_read(CCR2, lch);
332 w &= ~0x03; 282 w &= ~0x03;
333 283
334 switch (mode) { 284 switch (mode) {
@@ -343,23 +293,22 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
343 default: 293 default:
344 BUG(); 294 BUG();
345 } 295 }
346 dma_write(w, CCR2(lch)); 296 p->dma_write(w, CCR2, lch);
347 297
348 w = dma_read(LCH_CTRL(lch)); 298 w = p->dma_read(LCH_CTRL, lch);
349 w &= ~0x0f; 299 w &= ~0x0f;
350 /* Default is channel type 2D */ 300 /* Default is channel type 2D */
351 if (mode) { 301 if (mode) {
352 dma_write((u16)color, COLOR_L(lch)); 302 p->dma_write(color, COLOR, lch);
353 dma_write((u16)(color >> 16), COLOR_U(lch));
354 w |= 1; /* Channel type G */ 303 w |= 1; /* Channel type G */
355 } 304 }
356 dma_write(w, LCH_CTRL(lch)); 305 p->dma_write(w, LCH_CTRL, lch);
357 } 306 }
358 307
359 if (cpu_class_is_omap2()) { 308 if (cpu_class_is_omap2()) {
360 u32 val; 309 u32 val;
361 310
362 val = dma_read(CCR(lch)); 311 val = p->dma_read(CCR, lch);
363 val &= ~((1 << 17) | (1 << 16)); 312 val &= ~((1 << 17) | (1 << 16));
364 313
365 switch (mode) { 314 switch (mode) {
@@ -374,10 +323,10 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
374 default: 323 default:
375 BUG(); 324 BUG();
376 } 325 }
377 dma_write(val, CCR(lch)); 326 p->dma_write(val, CCR, lch);
378 327
379 color &= 0xffffff; 328 color &= 0xffffff;
380 dma_write(color, COLOR(lch)); 329 p->dma_write(color, COLOR, lch);
381 } 330 }
382} 331}
383EXPORT_SYMBOL(omap_set_dma_color_mode); 332EXPORT_SYMBOL(omap_set_dma_color_mode);
@@ -387,10 +336,10 @@ void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode)
387 if (cpu_class_is_omap2()) { 336 if (cpu_class_is_omap2()) {
388 u32 csdp; 337 u32 csdp;
389 338
390 csdp = dma_read(CSDP(lch)); 339 csdp = p->dma_read(CSDP, lch);
391 csdp &= ~(0x3 << 16); 340 csdp &= ~(0x3 << 16);
392 csdp |= (mode << 16); 341 csdp |= (mode << 16);
393 dma_write(csdp, CSDP(lch)); 342 p->dma_write(csdp, CSDP, lch);
394 } 343 }
395} 344}
396EXPORT_SYMBOL(omap_set_dma_write_mode); 345EXPORT_SYMBOL(omap_set_dma_write_mode);
@@ -400,10 +349,10 @@ void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode)
400 if (cpu_class_is_omap1() && !cpu_is_omap15xx()) { 349 if (cpu_class_is_omap1() && !cpu_is_omap15xx()) {
401 u32 l; 350 u32 l;
402 351
403 l = dma_read(LCH_CTRL(lch)); 352 l = p->dma_read(LCH_CTRL, lch);
404 l &= ~0x7; 353 l &= ~0x7;
405 l |= mode; 354 l |= mode;
406 dma_write(l, LCH_CTRL(lch)); 355 p->dma_write(l, LCH_CTRL, lch);
407 } 356 }
408} 357}
409EXPORT_SYMBOL(omap_set_dma_channel_mode); 358EXPORT_SYMBOL(omap_set_dma_channel_mode);
@@ -418,27 +367,21 @@ void omap_set_dma_src_params(int lch, int src_port, int src_amode,
418 if (cpu_class_is_omap1()) { 367 if (cpu_class_is_omap1()) {
419 u16 w; 368 u16 w;
420 369
421 w = dma_read(CSDP(lch)); 370 w = p->dma_read(CSDP, lch);
422 w &= ~(0x1f << 2); 371 w &= ~(0x1f << 2);
423 w |= src_port << 2; 372 w |= src_port << 2;
424 dma_write(w, CSDP(lch)); 373 p->dma_write(w, CSDP, lch);
425 } 374 }
426 375
427 l = dma_read(CCR(lch)); 376 l = p->dma_read(CCR, lch);
428 l &= ~(0x03 << 12); 377 l &= ~(0x03 << 12);
429 l |= src_amode << 12; 378 l |= src_amode << 12;
430 dma_write(l, CCR(lch)); 379 p->dma_write(l, CCR, lch);
431
432 if (cpu_class_is_omap1()) {
433 dma_write(src_start >> 16, CSSA_U(lch));
434 dma_write((u16)src_start, CSSA_L(lch));
435 }
436 380
437 if (cpu_class_is_omap2()) 381 p->dma_write(src_start, CSSA, lch);
438 dma_write(src_start, CSSA(lch));
439 382
440 dma_write(src_ei, CSEI(lch)); 383 p->dma_write(src_ei, CSEI, lch);
441 dma_write(src_fi, CSFI(lch)); 384 p->dma_write(src_fi, CSFI, lch);
442} 385}
443EXPORT_SYMBOL(omap_set_dma_src_params); 386EXPORT_SYMBOL(omap_set_dma_src_params);
444 387
@@ -466,8 +409,8 @@ void omap_set_dma_src_index(int lch, int eidx, int fidx)
466 if (cpu_class_is_omap2()) 409 if (cpu_class_is_omap2())
467 return; 410 return;
468 411
469 dma_write(eidx, CSEI(lch)); 412 p->dma_write(eidx, CSEI, lch);
470 dma_write(fidx, CSFI(lch)); 413 p->dma_write(fidx, CSFI, lch);
471} 414}
472EXPORT_SYMBOL(omap_set_dma_src_index); 415EXPORT_SYMBOL(omap_set_dma_src_index);
473 416
@@ -475,11 +418,11 @@ void omap_set_dma_src_data_pack(int lch, int enable)
475{ 418{
476 u32 l; 419 u32 l;
477 420
478 l = dma_read(CSDP(lch)); 421 l = p->dma_read(CSDP, lch);
479 l &= ~(1 << 6); 422 l &= ~(1 << 6);
480 if (enable) 423 if (enable)
481 l |= (1 << 6); 424 l |= (1 << 6);
482 dma_write(l, CSDP(lch)); 425 p->dma_write(l, CSDP, lch);
483} 426}
484EXPORT_SYMBOL(omap_set_dma_src_data_pack); 427EXPORT_SYMBOL(omap_set_dma_src_data_pack);
485 428
@@ -488,7 +431,7 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
488 unsigned int burst = 0; 431 unsigned int burst = 0;
489 u32 l; 432 u32 l;
490 433
491 l = dma_read(CSDP(lch)); 434 l = p->dma_read(CSDP, lch);
492 l &= ~(0x03 << 7); 435 l &= ~(0x03 << 7);
493 436
494 switch (burst_mode) { 437 switch (burst_mode) {
@@ -524,7 +467,7 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
524 } 467 }
525 468
526 l |= (burst << 7); 469 l |= (burst << 7);
527 dma_write(l, CSDP(lch)); 470 p->dma_write(l, CSDP, lch);
528} 471}
529EXPORT_SYMBOL(omap_set_dma_src_burst_mode); 472EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
530 473
@@ -536,27 +479,21 @@ void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
536 u32 l; 479 u32 l;
537 480
538 if (cpu_class_is_omap1()) { 481 if (cpu_class_is_omap1()) {
539 l = dma_read(CSDP(lch)); 482 l = p->dma_read(CSDP, lch);
540 l &= ~(0x1f << 9); 483 l &= ~(0x1f << 9);
541 l |= dest_port << 9; 484 l |= dest_port << 9;
542 dma_write(l, CSDP(lch)); 485 p->dma_write(l, CSDP, lch);
543 } 486 }
544 487
545 l = dma_read(CCR(lch)); 488 l = p->dma_read(CCR, lch);
546 l &= ~(0x03 << 14); 489 l &= ~(0x03 << 14);
547 l |= dest_amode << 14; 490 l |= dest_amode << 14;
548 dma_write(l, CCR(lch)); 491 p->dma_write(l, CCR, lch);
549
550 if (cpu_class_is_omap1()) {
551 dma_write(dest_start >> 16, CDSA_U(lch));
552 dma_write(dest_start, CDSA_L(lch));
553 }
554 492
555 if (cpu_class_is_omap2()) 493 p->dma_write(dest_start, CDSA, lch);
556 dma_write(dest_start, CDSA(lch));
557 494
558 dma_write(dst_ei, CDEI(lch)); 495 p->dma_write(dst_ei, CDEI, lch);
559 dma_write(dst_fi, CDFI(lch)); 496 p->dma_write(dst_fi, CDFI, lch);
560} 497}
561EXPORT_SYMBOL(omap_set_dma_dest_params); 498EXPORT_SYMBOL(omap_set_dma_dest_params);
562 499
@@ -565,8 +502,8 @@ void omap_set_dma_dest_index(int lch, int eidx, int fidx)
565 if (cpu_class_is_omap2()) 502 if (cpu_class_is_omap2())
566 return; 503 return;
567 504
568 dma_write(eidx, CDEI(lch)); 505 p->dma_write(eidx, CDEI, lch);
569 dma_write(fidx, CDFI(lch)); 506 p->dma_write(fidx, CDFI, lch);
570} 507}
571EXPORT_SYMBOL(omap_set_dma_dest_index); 508EXPORT_SYMBOL(omap_set_dma_dest_index);
572 509
@@ -574,11 +511,11 @@ void omap_set_dma_dest_data_pack(int lch, int enable)
574{ 511{
575 u32 l; 512 u32 l;
576 513
577 l = dma_read(CSDP(lch)); 514 l = p->dma_read(CSDP, lch);
578 l &= ~(1 << 13); 515 l &= ~(1 << 13);
579 if (enable) 516 if (enable)
580 l |= 1 << 13; 517 l |= 1 << 13;
581 dma_write(l, CSDP(lch)); 518 p->dma_write(l, CSDP, lch);
582} 519}
583EXPORT_SYMBOL(omap_set_dma_dest_data_pack); 520EXPORT_SYMBOL(omap_set_dma_dest_data_pack);
584 521
@@ -587,7 +524,7 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
587 unsigned int burst = 0; 524 unsigned int burst = 0;
588 u32 l; 525 u32 l;
589 526
590 l = dma_read(CSDP(lch)); 527 l = p->dma_read(CSDP, lch);
591 l &= ~(0x03 << 14); 528 l &= ~(0x03 << 14);
592 529
593 switch (burst_mode) { 530 switch (burst_mode) {
@@ -620,7 +557,7 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
620 return; 557 return;
621 } 558 }
622 l |= (burst << 14); 559 l |= (burst << 14);
623 dma_write(l, CSDP(lch)); 560 p->dma_write(l, CSDP, lch);
624} 561}
625EXPORT_SYMBOL(omap_set_dma_dest_burst_mode); 562EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
626 563
@@ -630,18 +567,18 @@ static inline void omap_enable_channel_irq(int lch)
630 567
631 /* Clear CSR */ 568 /* Clear CSR */
632 if (cpu_class_is_omap1()) 569 if (cpu_class_is_omap1())
633 status = dma_read(CSR(lch)); 570 status = p->dma_read(CSR, lch);
634 else if (cpu_class_is_omap2()) 571 else if (cpu_class_is_omap2())
635 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(lch)); 572 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
636 573
637 /* Enable some nice interrupts. */ 574 /* Enable some nice interrupts. */
638 dma_write(dma_chan[lch].enabled_irqs, CICR(lch)); 575 p->dma_write(dma_chan[lch].enabled_irqs, CICR, lch);
639} 576}
640 577
641static void omap_disable_channel_irq(int lch) 578static void omap_disable_channel_irq(int lch)
642{ 579{
643 if (cpu_class_is_omap2()) 580 if (cpu_class_is_omap2())
644 dma_write(0, CICR(lch)); 581 p->dma_write(0, CICR, lch);
645} 582}
646 583
647void omap_enable_dma_irq(int lch, u16 bits) 584void omap_enable_dma_irq(int lch, u16 bits)
@@ -660,7 +597,7 @@ static inline void enable_lnk(int lch)
660{ 597{
661 u32 l; 598 u32 l;
662 599
663 l = dma_read(CLNK_CTRL(lch)); 600 l = p->dma_read(CLNK_CTRL, lch);
664 601
665 if (cpu_class_is_omap1()) 602 if (cpu_class_is_omap1())
666 l &= ~(1 << 14); 603 l &= ~(1 << 14);
@@ -675,18 +612,18 @@ static inline void enable_lnk(int lch)
675 l = dma_chan[lch].next_linked_ch | (1 << 15); 612 l = dma_chan[lch].next_linked_ch | (1 << 15);
676#endif 613#endif
677 614
678 dma_write(l, CLNK_CTRL(lch)); 615 p->dma_write(l, CLNK_CTRL, lch);
679} 616}
680 617
681static inline void disable_lnk(int lch) 618static inline void disable_lnk(int lch)
682{ 619{
683 u32 l; 620 u32 l;
684 621
685 l = dma_read(CLNK_CTRL(lch)); 622 l = p->dma_read(CLNK_CTRL, lch);
686 623
687 /* Disable interrupts */ 624 /* Disable interrupts */
688 if (cpu_class_is_omap1()) { 625 if (cpu_class_is_omap1()) {
689 dma_write(0, CICR(lch)); 626 p->dma_write(0, CICR, lch);
690 /* Set the STOP_LNK bit */ 627 /* Set the STOP_LNK bit */
691 l |= 1 << 14; 628 l |= 1 << 14;
692 } 629 }
@@ -697,7 +634,7 @@ static inline void disable_lnk(int lch)
697 l &= ~(1 << 15); 634 l &= ~(1 << 15);
698 } 635 }
699 636
700 dma_write(l, CLNK_CTRL(lch)); 637 p->dma_write(l, CLNK_CTRL, lch);
701 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE; 638 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
702} 639}
703 640
@@ -710,9 +647,9 @@ static inline void omap2_enable_irq_lch(int lch)
710 return; 647 return;
711 648
712 spin_lock_irqsave(&dma_chan_lock, flags); 649 spin_lock_irqsave(&dma_chan_lock, flags);
713 val = dma_read(IRQENABLE_L0); 650 val = p->dma_read(IRQENABLE_L0, lch);
714 val |= 1 << lch; 651 val |= 1 << lch;
715 dma_write(val, IRQENABLE_L0); 652 p->dma_write(val, IRQENABLE_L0, lch);
716 spin_unlock_irqrestore(&dma_chan_lock, flags); 653 spin_unlock_irqrestore(&dma_chan_lock, flags);
717} 654}
718 655
@@ -725,9 +662,9 @@ static inline void omap2_disable_irq_lch(int lch)
725 return; 662 return;
726 663
727 spin_lock_irqsave(&dma_chan_lock, flags); 664 spin_lock_irqsave(&dma_chan_lock, flags);
728 val = dma_read(IRQENABLE_L0); 665 val = p->dma_read(IRQENABLE_L0, lch);
729 val &= ~(1 << lch); 666 val &= ~(1 << lch);
730 dma_write(val, IRQENABLE_L0); 667 p->dma_write(val, IRQENABLE_L0, lch);
731 spin_unlock_irqrestore(&dma_chan_lock, flags); 668 spin_unlock_irqrestore(&dma_chan_lock, flags);
732} 669}
733 670
@@ -754,8 +691,8 @@ int omap_request_dma(int dev_id, const char *dev_name,
754 chan = dma_chan + free_ch; 691 chan = dma_chan + free_ch;
755 chan->dev_id = dev_id; 692 chan->dev_id = dev_id;
756 693
757 if (cpu_class_is_omap1()) 694 if (p->clear_lch_regs)
758 clear_lch_regs(free_ch); 695 p->clear_lch_regs(free_ch);
759 696
760 if (cpu_class_is_omap2()) 697 if (cpu_class_is_omap2())
761 omap_clear_dma(free_ch); 698 omap_clear_dma(free_ch);
@@ -792,17 +729,17 @@ int omap_request_dma(int dev_id, const char *dev_name,
792 * Disable the 1510 compatibility mode and set the sync device 729 * Disable the 1510 compatibility mode and set the sync device
793 * id. 730 * id.
794 */ 731 */
795 dma_write(dev_id | (1 << 10), CCR(free_ch)); 732 p->dma_write(dev_id | (1 << 10), CCR, free_ch);
796 } else if (cpu_is_omap7xx() || cpu_is_omap15xx()) { 733 } else if (cpu_is_omap7xx() || cpu_is_omap15xx()) {
797 dma_write(dev_id, CCR(free_ch)); 734 p->dma_write(dev_id, CCR, free_ch);
798 } 735 }
799 736
800 if (cpu_class_is_omap2()) { 737 if (cpu_class_is_omap2()) {
801 omap2_enable_irq_lch(free_ch); 738 omap2_enable_irq_lch(free_ch);
802 omap_enable_channel_irq(free_ch); 739 omap_enable_channel_irq(free_ch);
803 /* Clear the CSR register and IRQ status register */ 740 /* Clear the CSR register and IRQ status register */
804 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(free_ch)); 741 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, free_ch);
805 dma_write(1 << free_ch, IRQSTATUS_L0); 742 p->dma_write(1 << free_ch, IRQSTATUS_L0, 0);
806 } 743 }
807 744
808 *dma_ch_out = free_ch; 745 *dma_ch_out = free_ch;
@@ -823,23 +760,23 @@ void omap_free_dma(int lch)
823 760
824 if (cpu_class_is_omap1()) { 761 if (cpu_class_is_omap1()) {
825 /* Disable all DMA interrupts for the channel. */ 762 /* Disable all DMA interrupts for the channel. */
826 dma_write(0, CICR(lch)); 763 p->dma_write(0, CICR, lch);
827 /* Make sure the DMA transfer is stopped. */ 764 /* Make sure the DMA transfer is stopped. */
828 dma_write(0, CCR(lch)); 765 p->dma_write(0, CCR, lch);
829 } 766 }
830 767
831 if (cpu_class_is_omap2()) { 768 if (cpu_class_is_omap2()) {
832 omap2_disable_irq_lch(lch); 769 omap2_disable_irq_lch(lch);
833 770
834 /* Clear the CSR register and IRQ status register */ 771 /* Clear the CSR register and IRQ status register */
835 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(lch)); 772 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
836 dma_write(1 << lch, IRQSTATUS_L0); 773 p->dma_write(1 << lch, IRQSTATUS_L0, lch);
837 774
838 /* Disable all DMA interrupts for the channel. */ 775 /* Disable all DMA interrupts for the channel. */
839 dma_write(0, CICR(lch)); 776 p->dma_write(0, CICR, lch);
840 777
841 /* Make sure the DMA transfer is stopped. */ 778 /* Make sure the DMA transfer is stopped. */
842 dma_write(0, CCR(lch)); 779 p->dma_write(0, CCR, lch);
843 omap_clear_dma(lch); 780 omap_clear_dma(lch);
844 } 781 }
845 782
@@ -880,7 +817,7 @@ omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams)
880 reg |= (0x3 & tparams) << 12; 817 reg |= (0x3 & tparams) << 12;
881 reg |= (arb_rate & 0xff) << 16; 818 reg |= (arb_rate & 0xff) << 16;
882 819
883 dma_write(reg, GCR); 820 p->dma_write(reg, GCR, 0);
884} 821}
885EXPORT_SYMBOL(omap_dma_set_global_params); 822EXPORT_SYMBOL(omap_dma_set_global_params);
886 823
@@ -903,14 +840,14 @@ omap_dma_set_prio_lch(int lch, unsigned char read_prio,
903 printk(KERN_ERR "Invalid channel id\n"); 840 printk(KERN_ERR "Invalid channel id\n");
904 return -EINVAL; 841 return -EINVAL;
905 } 842 }
906 l = dma_read(CCR(lch)); 843 l = p->dma_read(CCR, lch);
907 l &= ~((1 << 6) | (1 << 26)); 844 l &= ~((1 << 6) | (1 << 26));
908 if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) 845 if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx())
909 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26); 846 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
910 else 847 else
911 l |= ((read_prio & 0x1) << 6); 848 l |= ((read_prio & 0x1) << 6);
912 849
913 dma_write(l, CCR(lch)); 850 p->dma_write(l, CCR, lch);
914 851
915 return 0; 852 return 0;
916} 853}
@@ -925,25 +862,7 @@ void omap_clear_dma(int lch)
925 unsigned long flags; 862 unsigned long flags;
926 863
927 local_irq_save(flags); 864 local_irq_save(flags);
928 865 p->clear_dma(lch);
929 if (cpu_class_is_omap1()) {
930 u32 l;
931
932 l = dma_read(CCR(lch));
933 l &= ~OMAP_DMA_CCR_EN;
934 dma_write(l, CCR(lch));
935
936 /* Clear pending interrupts */
937 l = dma_read(CSR(lch));
938 }
939
940 if (cpu_class_is_omap2()) {
941 int i;
942 void __iomem *lch_base = omap_dma_base + OMAP_DMA4_CH_BASE(lch);
943 for (i = 0; i < 0x44; i += 4)
944 __raw_writel(0, lch_base + i);
945 }
946
947 local_irq_restore(flags); 866 local_irq_restore(flags);
948} 867}
949EXPORT_SYMBOL(omap_clear_dma); 868EXPORT_SYMBOL(omap_clear_dma);
@@ -957,13 +876,13 @@ void omap_start_dma(int lch)
957 * before starting dma transfer. 876 * before starting dma transfer.
958 */ 877 */
959 if (cpu_is_omap15xx()) 878 if (cpu_is_omap15xx())
960 dma_write(0, CPC(lch)); 879 p->dma_write(0, CPC, lch);
961 else 880 else
962 dma_write(0, CDAC(lch)); 881 p->dma_write(0, CDAC, lch);
963 882
964 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) { 883 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
965 int next_lch, cur_lch; 884 int next_lch, cur_lch;
966 char dma_chan_link_map[OMAP_DMA4_LOGICAL_DMA_CH_COUNT]; 885 char dma_chan_link_map[dma_lch_count];
967 886
968 dma_chan_link_map[lch] = 1; 887 dma_chan_link_map[lch] = 1;
969 /* Set the link register of the first channel */ 888 /* Set the link register of the first channel */
@@ -985,32 +904,18 @@ void omap_start_dma(int lch)
985 904
986 cur_lch = next_lch; 905 cur_lch = next_lch;
987 } while (next_lch != -1); 906 } while (next_lch != -1);
988 } else if (cpu_is_omap242x() || 907 } else if (IS_DMA_ERRATA(DMA_ERRATA_PARALLEL_CHANNELS))
989 (cpu_is_omap243x() && omap_type() <= OMAP2430_REV_ES1_0)) { 908 p->dma_write(lch, CLNK_CTRL, lch);
990
991 /* Errata: Need to write lch even if not using chaining */
992 dma_write(lch, CLNK_CTRL(lch));
993 }
994 909
995 omap_enable_channel_irq(lch); 910 omap_enable_channel_irq(lch);
996 911
997 l = dma_read(CCR(lch)); 912 l = p->dma_read(CCR, lch);
998
999 /*
1000 * Errata: Inter Frame DMA buffering issue (All OMAP2420 and
1001 * OMAP2430ES1.0): DMA will wrongly buffer elements if packing and
1002 * bursting is enabled. This might result in data gets stalled in
1003 * FIFO at the end of the block.
1004 * Workaround: DMA channels must have BUFFERING_DISABLED bit set to
1005 * guarantee no data will stay in the DMA FIFO in case inter frame
1006 * buffering occurs.
1007 */
1008 if (cpu_is_omap2420() ||
1009 (cpu_is_omap2430() && (omap_type() == OMAP2430_REV_ES1_0)))
1010 l |= OMAP_DMA_CCR_BUFFERING_DISABLE;
1011 913
914 if (IS_DMA_ERRATA(DMA_ERRATA_IFRAME_BUFFERING))
915 l |= OMAP_DMA_CCR_BUFFERING_DISABLE;
1012 l |= OMAP_DMA_CCR_EN; 916 l |= OMAP_DMA_CCR_EN;
1013 dma_write(l, CCR(lch)); 917
918 p->dma_write(l, CCR, lch);
1014 919
1015 dma_chan[lch].flags |= OMAP_DMA_ACTIVE; 920 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
1016} 921}
@@ -1022,46 +927,46 @@ void omap_stop_dma(int lch)
1022 927
1023 /* Disable all interrupts on the channel */ 928 /* Disable all interrupts on the channel */
1024 if (cpu_class_is_omap1()) 929 if (cpu_class_is_omap1())
1025 dma_write(0, CICR(lch)); 930 p->dma_write(0, CICR, lch);
1026 931
1027 l = dma_read(CCR(lch)); 932 l = p->dma_read(CCR, lch);
1028 /* OMAP3 Errata i541: sDMA FIFO draining does not finish */ 933 if (IS_DMA_ERRATA(DMA_ERRATA_i541) &&
1029 if (cpu_is_omap34xx() && (l & OMAP_DMA_CCR_SEL_SRC_DST_SYNC)) { 934 (l & OMAP_DMA_CCR_SEL_SRC_DST_SYNC)) {
1030 int i = 0; 935 int i = 0;
1031 u32 sys_cf; 936 u32 sys_cf;
1032 937
1033 /* Configure No-Standby */ 938 /* Configure No-Standby */
1034 l = dma_read(OCP_SYSCONFIG); 939 l = p->dma_read(OCP_SYSCONFIG, lch);
1035 sys_cf = l; 940 sys_cf = l;
1036 l &= ~DMA_SYSCONFIG_MIDLEMODE_MASK; 941 l &= ~DMA_SYSCONFIG_MIDLEMODE_MASK;
1037 l |= DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_NO_IDLE); 942 l |= DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_NO_IDLE);
1038 dma_write(l , OCP_SYSCONFIG); 943 p->dma_write(l , OCP_SYSCONFIG, 0);
1039 944
1040 l = dma_read(CCR(lch)); 945 l = p->dma_read(CCR, lch);
1041 l &= ~OMAP_DMA_CCR_EN; 946 l &= ~OMAP_DMA_CCR_EN;
1042 dma_write(l, CCR(lch)); 947 p->dma_write(l, CCR, lch);
1043 948
1044 /* Wait for sDMA FIFO drain */ 949 /* Wait for sDMA FIFO drain */
1045 l = dma_read(CCR(lch)); 950 l = p->dma_read(CCR, lch);
1046 while (i < 100 && (l & (OMAP_DMA_CCR_RD_ACTIVE | 951 while (i < 100 && (l & (OMAP_DMA_CCR_RD_ACTIVE |
1047 OMAP_DMA_CCR_WR_ACTIVE))) { 952 OMAP_DMA_CCR_WR_ACTIVE))) {
1048 udelay(5); 953 udelay(5);
1049 i++; 954 i++;
1050 l = dma_read(CCR(lch)); 955 l = p->dma_read(CCR, lch);
1051 } 956 }
1052 if (i >= 100) 957 if (i >= 100)
1053 printk(KERN_ERR "DMA drain did not complete on " 958 printk(KERN_ERR "DMA drain did not complete on "
1054 "lch %d\n", lch); 959 "lch %d\n", lch);
1055 /* Restore OCP_SYSCONFIG */ 960 /* Restore OCP_SYSCONFIG */
1056 dma_write(sys_cf, OCP_SYSCONFIG); 961 p->dma_write(sys_cf, OCP_SYSCONFIG, lch);
1057 } else { 962 } else {
1058 l &= ~OMAP_DMA_CCR_EN; 963 l &= ~OMAP_DMA_CCR_EN;
1059 dma_write(l, CCR(lch)); 964 p->dma_write(l, CCR, lch);
1060 } 965 }
1061 966
1062 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) { 967 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
1063 int next_lch, cur_lch = lch; 968 int next_lch, cur_lch = lch;
1064 char dma_chan_link_map[OMAP_DMA4_LOGICAL_DMA_CH_COUNT]; 969 char dma_chan_link_map[dma_lch_count];
1065 970
1066 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map)); 971 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
1067 do { 972 do {
@@ -1122,19 +1027,15 @@ dma_addr_t omap_get_dma_src_pos(int lch)
1122 dma_addr_t offset = 0; 1027 dma_addr_t offset = 0;
1123 1028
1124 if (cpu_is_omap15xx()) 1029 if (cpu_is_omap15xx())
1125 offset = dma_read(CPC(lch)); 1030 offset = p->dma_read(CPC, lch);
1126 else 1031 else
1127 offset = dma_read(CSAC(lch)); 1032 offset = p->dma_read(CSAC, lch);
1128 1033
1129 /* 1034 if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0)
1130 * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 1035 offset = p->dma_read(CSAC, lch);
1131 * read before the DMA controller finished disabling the channel.
1132 */
1133 if (!cpu_is_omap15xx() && offset == 0)
1134 offset = dma_read(CSAC(lch));
1135 1036
1136 if (cpu_class_is_omap1()) 1037 if (cpu_class_is_omap1())
1137 offset |= (dma_read(CSSA_U(lch)) << 16); 1038 offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000);
1138 1039
1139 return offset; 1040 return offset;
1140} 1041}
@@ -1153,19 +1054,19 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
1153 dma_addr_t offset = 0; 1054 dma_addr_t offset = 0;
1154 1055
1155 if (cpu_is_omap15xx()) 1056 if (cpu_is_omap15xx())
1156 offset = dma_read(CPC(lch)); 1057 offset = p->dma_read(CPC, lch);
1157 else 1058 else
1158 offset = dma_read(CDAC(lch)); 1059 offset = p->dma_read(CDAC, lch);
1159 1060
1160 /* 1061 /*
1161 * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 1062 * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is
1162 * read before the DMA controller finished disabling the channel. 1063 * read before the DMA controller finished disabling the channel.
1163 */ 1064 */
1164 if (!cpu_is_omap15xx() && offset == 0) 1065 if (!cpu_is_omap15xx() && offset == 0)
1165 offset = dma_read(CDAC(lch)); 1066 offset = p->dma_read(CDAC, lch);
1166 1067
1167 if (cpu_class_is_omap1()) 1068 if (cpu_class_is_omap1())
1168 offset |= (dma_read(CDSA_U(lch)) << 16); 1069 offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000);
1169 1070
1170 return offset; 1071 return offset;
1171} 1072}
@@ -1173,7 +1074,7 @@ EXPORT_SYMBOL(omap_get_dma_dst_pos);
1173 1074
1174int omap_get_dma_active_status(int lch) 1075int omap_get_dma_active_status(int lch)
1175{ 1076{
1176 return (dma_read(CCR(lch)) & OMAP_DMA_CCR_EN) != 0; 1077 return (p->dma_read(CCR, lch) & OMAP_DMA_CCR_EN) != 0;
1177} 1078}
1178EXPORT_SYMBOL(omap_get_dma_active_status); 1079EXPORT_SYMBOL(omap_get_dma_active_status);
1179 1080
@@ -1186,7 +1087,7 @@ int omap_dma_running(void)
1186 return 1; 1087 return 1;
1187 1088
1188 for (lch = 0; lch < dma_chan_count; lch++) 1089 for (lch = 0; lch < dma_chan_count; lch++)
1189 if (dma_read(CCR(lch)) & OMAP_DMA_CCR_EN) 1090 if (p->dma_read(CCR, lch) & OMAP_DMA_CCR_EN)
1190 return 1; 1091 return 1;
1191 1092
1192 return 0; 1093 return 0;
@@ -1201,8 +1102,8 @@ void omap_dma_link_lch(int lch_head, int lch_queue)
1201{ 1102{
1202 if (omap_dma_in_1510_mode()) { 1103 if (omap_dma_in_1510_mode()) {
1203 if (lch_head == lch_queue) { 1104 if (lch_head == lch_queue) {
1204 dma_write(dma_read(CCR(lch_head)) | (3 << 8), 1105 p->dma_write(p->dma_read(CCR, lch_head) | (3 << 8),
1205 CCR(lch_head)); 1106 CCR, lch_head);
1206 return; 1107 return;
1207 } 1108 }
1208 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n"); 1109 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
@@ -1228,8 +1129,8 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue)
1228{ 1129{
1229 if (omap_dma_in_1510_mode()) { 1130 if (omap_dma_in_1510_mode()) {
1230 if (lch_head == lch_queue) { 1131 if (lch_head == lch_queue) {
1231 dma_write(dma_read(CCR(lch_head)) & ~(3 << 8), 1132 p->dma_write(p->dma_read(CCR, lch_head) & ~(3 << 8),
1232 CCR(lch_head)); 1133 CCR, lch_head);
1233 return; 1134 return;
1234 } 1135 }
1235 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n"); 1136 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
@@ -1255,8 +1156,6 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue)
1255} 1156}
1256EXPORT_SYMBOL(omap_dma_unlink_lch); 1157EXPORT_SYMBOL(omap_dma_unlink_lch);
1257 1158
1258/*----------------------------------------------------------------------------*/
1259
1260#ifndef CONFIG_ARCH_OMAP1 1159#ifndef CONFIG_ARCH_OMAP1
1261/* Create chain of DMA channesls */ 1160/* Create chain of DMA channesls */
1262static void create_dma_lch_chain(int lch_head, int lch_queue) 1161static void create_dma_lch_chain(int lch_head, int lch_queue)
@@ -1281,15 +1180,15 @@ static void create_dma_lch_chain(int lch_head, int lch_queue)
1281 lch_queue; 1180 lch_queue;
1282 } 1181 }
1283 1182
1284 l = dma_read(CLNK_CTRL(lch_head)); 1183 l = p->dma_read(CLNK_CTRL, lch_head);
1285 l &= ~(0x1f); 1184 l &= ~(0x1f);
1286 l |= lch_queue; 1185 l |= lch_queue;
1287 dma_write(l, CLNK_CTRL(lch_head)); 1186 p->dma_write(l, CLNK_CTRL, lch_head);
1288 1187
1289 l = dma_read(CLNK_CTRL(lch_queue)); 1188 l = p->dma_read(CLNK_CTRL, lch_queue);
1290 l &= ~(0x1f); 1189 l &= ~(0x1f);
1291 l |= (dma_chan[lch_queue].next_linked_ch); 1190 l |= (dma_chan[lch_queue].next_linked_ch);
1292 dma_write(l, CLNK_CTRL(lch_queue)); 1191 p->dma_write(l, CLNK_CTRL, lch_queue);
1293} 1192}
1294 1193
1295/** 1194/**
@@ -1565,13 +1464,13 @@ int omap_dma_chain_a_transfer(int chain_id, int src_start, int dest_start,
1565 1464
1566 /* Set the params to the free channel */ 1465 /* Set the params to the free channel */
1567 if (src_start != 0) 1466 if (src_start != 0)
1568 dma_write(src_start, CSSA(lch)); 1467 p->dma_write(src_start, CSSA, lch);
1569 if (dest_start != 0) 1468 if (dest_start != 0)
1570 dma_write(dest_start, CDSA(lch)); 1469 p->dma_write(dest_start, CDSA, lch);
1571 1470
1572 /* Write the buffer size */ 1471 /* Write the buffer size */
1573 dma_write(elem_count, CEN(lch)); 1472 p->dma_write(elem_count, CEN, lch);
1574 dma_write(frame_count, CFN(lch)); 1473 p->dma_write(frame_count, CFN, lch);
1575 1474
1576 /* 1475 /*
1577 * If the chain is dynamically linked, 1476 * If the chain is dynamically linked,
@@ -1604,8 +1503,8 @@ int omap_dma_chain_a_transfer(int chain_id, int src_start, int dest_start,
1604 enable_lnk(dma_chan[lch].prev_linked_ch); 1503 enable_lnk(dma_chan[lch].prev_linked_ch);
1605 dma_chan[lch].state = DMA_CH_QUEUED; 1504 dma_chan[lch].state = DMA_CH_QUEUED;
1606 start_dma = 0; 1505 start_dma = 0;
1607 if (0 == ((1 << 7) & dma_read( 1506 if (0 == ((1 << 7) & p->dma_read(
1608 CCR(dma_chan[lch].prev_linked_ch)))) { 1507 CCR, dma_chan[lch].prev_linked_ch))) {
1609 disable_lnk(dma_chan[lch]. 1508 disable_lnk(dma_chan[lch].
1610 prev_linked_ch); 1509 prev_linked_ch);
1611 pr_debug("\n prev ch is stopped\n"); 1510 pr_debug("\n prev ch is stopped\n");
@@ -1621,7 +1520,7 @@ int omap_dma_chain_a_transfer(int chain_id, int src_start, int dest_start,
1621 } 1520 }
1622 omap_enable_channel_irq(lch); 1521 omap_enable_channel_irq(lch);
1623 1522
1624 l = dma_read(CCR(lch)); 1523 l = p->dma_read(CCR, lch);
1625 1524
1626 if ((0 == (l & (1 << 24)))) 1525 if ((0 == (l & (1 << 24))))
1627 l &= ~(1 << 25); 1526 l &= ~(1 << 25);
@@ -1632,12 +1531,12 @@ int omap_dma_chain_a_transfer(int chain_id, int src_start, int dest_start,
1632 l |= (1 << 7); 1531 l |= (1 << 7);
1633 dma_chan[lch].state = DMA_CH_STARTED; 1532 dma_chan[lch].state = DMA_CH_STARTED;
1634 pr_debug("starting %d\n", lch); 1533 pr_debug("starting %d\n", lch);
1635 dma_write(l, CCR(lch)); 1534 p->dma_write(l, CCR, lch);
1636 } else 1535 } else
1637 start_dma = 0; 1536 start_dma = 0;
1638 } else { 1537 } else {
1639 if (0 == (l & (1 << 7))) 1538 if (0 == (l & (1 << 7)))
1640 dma_write(l, CCR(lch)); 1539 p->dma_write(l, CCR, lch);
1641 } 1540 }
1642 dma_chan[lch].flags |= OMAP_DMA_ACTIVE; 1541 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
1643 } 1542 }
@@ -1682,7 +1581,7 @@ int omap_start_dma_chain_transfers(int chain_id)
1682 omap_enable_channel_irq(channels[0]); 1581 omap_enable_channel_irq(channels[0]);
1683 } 1582 }
1684 1583
1685 l = dma_read(CCR(channels[0])); 1584 l = p->dma_read(CCR, channels[0]);
1686 l |= (1 << 7); 1585 l |= (1 << 7);
1687 dma_linked_lch[chain_id].chain_state = DMA_CHAIN_STARTED; 1586 dma_linked_lch[chain_id].chain_state = DMA_CHAIN_STARTED;
1688 dma_chan[channels[0]].state = DMA_CH_STARTED; 1587 dma_chan[channels[0]].state = DMA_CH_STARTED;
@@ -1691,7 +1590,7 @@ int omap_start_dma_chain_transfers(int chain_id)
1691 l &= ~(1 << 25); 1590 l &= ~(1 << 25);
1692 else 1591 else
1693 l |= (1 << 25); 1592 l |= (1 << 25);
1694 dma_write(l, CCR(channels[0])); 1593 p->dma_write(l, CCR, channels[0]);
1695 1594
1696 dma_chan[channels[0]].flags |= OMAP_DMA_ACTIVE; 1595 dma_chan[channels[0]].flags |= OMAP_DMA_ACTIVE;
1697 1596
@@ -1711,7 +1610,7 @@ int omap_stop_dma_chain_transfers(int chain_id)
1711{ 1610{
1712 int *channels; 1611 int *channels;
1713 u32 l, i; 1612 u32 l, i;
1714 u32 sys_cf; 1613 u32 sys_cf = 0;
1715 1614
1716 /* Check for input params */ 1615 /* Check for input params */
1717 if (unlikely((chain_id < 0 || chain_id >= dma_lch_count))) { 1616 if (unlikely((chain_id < 0 || chain_id >= dma_lch_count))) {
@@ -1726,22 +1625,20 @@ int omap_stop_dma_chain_transfers(int chain_id)
1726 } 1625 }
1727 channels = dma_linked_lch[chain_id].linked_dmach_q; 1626 channels = dma_linked_lch[chain_id].linked_dmach_q;
1728 1627
1729 /* 1628 if (IS_DMA_ERRATA(DMA_ERRATA_i88)) {
1730 * DMA Errata: 1629 sys_cf = p->dma_read(OCP_SYSCONFIG, 0);
1731 * Special programming model needed to disable DMA before end of block 1630 l = sys_cf;
1732 */ 1631 /* Middle mode reg set no Standby */
1733 sys_cf = dma_read(OCP_SYSCONFIG); 1632 l &= ~((1 << 12)|(1 << 13));
1734 l = sys_cf; 1633 p->dma_write(l, OCP_SYSCONFIG, 0);
1735 /* Middle mode reg set no Standby */ 1634 }
1736 l &= ~((1 << 12)|(1 << 13));
1737 dma_write(l, OCP_SYSCONFIG);
1738 1635
1739 for (i = 0; i < dma_linked_lch[chain_id].no_of_lchs_linked; i++) { 1636 for (i = 0; i < dma_linked_lch[chain_id].no_of_lchs_linked; i++) {
1740 1637
1741 /* Stop the Channel transmission */ 1638 /* Stop the Channel transmission */
1742 l = dma_read(CCR(channels[i])); 1639 l = p->dma_read(CCR, channels[i]);
1743 l &= ~(1 << 7); 1640 l &= ~(1 << 7);
1744 dma_write(l, CCR(channels[i])); 1641 p->dma_write(l, CCR, channels[i]);
1745 1642
1746 /* Disable the link in all the channels */ 1643 /* Disable the link in all the channels */
1747 disable_lnk(channels[i]); 1644 disable_lnk(channels[i]);
@@ -1753,8 +1650,8 @@ int omap_stop_dma_chain_transfers(int chain_id)
1753 /* Reset the Queue pointers */ 1650 /* Reset the Queue pointers */
1754 OMAP_DMA_CHAIN_QINIT(chain_id); 1651 OMAP_DMA_CHAIN_QINIT(chain_id);
1755 1652
1756 /* Errata - put in the old value */ 1653 if (IS_DMA_ERRATA(DMA_ERRATA_i88))
1757 dma_write(sys_cf, OCP_SYSCONFIG); 1654 p->dma_write(sys_cf, OCP_SYSCONFIG, 0);
1758 1655
1759 return 0; 1656 return 0;
1760} 1657}
@@ -1796,8 +1693,8 @@ int omap_get_dma_chain_index(int chain_id, int *ei, int *fi)
1796 /* Get the current channel */ 1693 /* Get the current channel */
1797 lch = channels[dma_linked_lch[chain_id].q_head]; 1694 lch = channels[dma_linked_lch[chain_id].q_head];
1798 1695
1799 *ei = dma_read(CCEN(lch)); 1696 *ei = p->dma_read(CCEN, lch);
1800 *fi = dma_read(CCFN(lch)); 1697 *fi = p->dma_read(CCFN, lch);
1801 1698
1802 return 0; 1699 return 0;
1803} 1700}
@@ -1834,7 +1731,7 @@ int omap_get_dma_chain_dst_pos(int chain_id)
1834 /* Get the current channel */ 1731 /* Get the current channel */
1835 lch = channels[dma_linked_lch[chain_id].q_head]; 1732 lch = channels[dma_linked_lch[chain_id].q_head];
1836 1733
1837 return dma_read(CDAC(lch)); 1734 return p->dma_read(CDAC, lch);
1838} 1735}
1839EXPORT_SYMBOL(omap_get_dma_chain_dst_pos); 1736EXPORT_SYMBOL(omap_get_dma_chain_dst_pos);
1840 1737
@@ -1868,7 +1765,7 @@ int omap_get_dma_chain_src_pos(int chain_id)
1868 /* Get the current channel */ 1765 /* Get the current channel */
1869 lch = channels[dma_linked_lch[chain_id].q_head]; 1766 lch = channels[dma_linked_lch[chain_id].q_head];
1870 1767
1871 return dma_read(CSAC(lch)); 1768 return p->dma_read(CSAC, lch);
1872} 1769}
1873EXPORT_SYMBOL(omap_get_dma_chain_src_pos); 1770EXPORT_SYMBOL(omap_get_dma_chain_src_pos);
1874#endif /* ifndef CONFIG_ARCH_OMAP1 */ 1771#endif /* ifndef CONFIG_ARCH_OMAP1 */
@@ -1885,7 +1782,7 @@ static int omap1_dma_handle_ch(int ch)
1885 csr = dma_chan[ch].saved_csr; 1782 csr = dma_chan[ch].saved_csr;
1886 dma_chan[ch].saved_csr = 0; 1783 dma_chan[ch].saved_csr = 0;
1887 } else 1784 } else
1888 csr = dma_read(CSR(ch)); 1785 csr = p->dma_read(CSR, ch);
1889 if (enable_1510_mode && ch <= 2 && (csr >> 7) != 0) { 1786 if (enable_1510_mode && ch <= 2 && (csr >> 7) != 0) {
1890 dma_chan[ch + 6].saved_csr = csr >> 7; 1787 dma_chan[ch + 6].saved_csr = csr >> 7;
1891 csr &= 0x7f; 1788 csr &= 0x7f;
@@ -1938,13 +1835,13 @@ static irqreturn_t omap1_dma_irq_handler(int irq, void *dev_id)
1938 1835
1939static int omap2_dma_handle_ch(int ch) 1836static int omap2_dma_handle_ch(int ch)
1940{ 1837{
1941 u32 status = dma_read(CSR(ch)); 1838 u32 status = p->dma_read(CSR, ch);
1942 1839
1943 if (!status) { 1840 if (!status) {
1944 if (printk_ratelimit()) 1841 if (printk_ratelimit())
1945 printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", 1842 printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n",
1946 ch); 1843 ch);
1947 dma_write(1 << ch, IRQSTATUS_L0); 1844 p->dma_write(1 << ch, IRQSTATUS_L0, ch);
1948 return 0; 1845 return 0;
1949 } 1846 }
1950 if (unlikely(dma_chan[ch].dev_id == -1)) { 1847 if (unlikely(dma_chan[ch].dev_id == -1)) {
@@ -1960,17 +1857,12 @@ static int omap2_dma_handle_ch(int ch)
1960 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { 1857 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) {
1961 printk(KERN_INFO "DMA transaction error with device %d\n", 1858 printk(KERN_INFO "DMA transaction error with device %d\n",
1962 dma_chan[ch].dev_id); 1859 dma_chan[ch].dev_id);
1963 if (cpu_class_is_omap2()) { 1860 if (IS_DMA_ERRATA(DMA_ERRATA_i378)) {
1964 /*
1965 * Errata: sDMA Channel is not disabled
1966 * after a transaction error. So we explicitely
1967 * disable the channel
1968 */
1969 u32 ccr; 1861 u32 ccr;
1970 1862
1971 ccr = dma_read(CCR(ch)); 1863 ccr = p->dma_read(CCR, ch);
1972 ccr &= ~OMAP_DMA_CCR_EN; 1864 ccr &= ~OMAP_DMA_CCR_EN;
1973 dma_write(ccr, CCR(ch)); 1865 p->dma_write(ccr, CCR, ch);
1974 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; 1866 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE;
1975 } 1867 }
1976 } 1868 }
@@ -1981,16 +1873,16 @@ static int omap2_dma_handle_ch(int ch)
1981 printk(KERN_INFO "DMA misaligned error with device %d\n", 1873 printk(KERN_INFO "DMA misaligned error with device %d\n",
1982 dma_chan[ch].dev_id); 1874 dma_chan[ch].dev_id);
1983 1875
1984 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch)); 1876 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, ch);
1985 dma_write(1 << ch, IRQSTATUS_L0); 1877 p->dma_write(1 << ch, IRQSTATUS_L0, ch);
1986 /* read back the register to flush the write */ 1878 /* read back the register to flush the write */
1987 dma_read(IRQSTATUS_L0); 1879 p->dma_read(IRQSTATUS_L0, ch);
1988 1880
1989 /* If the ch is not chained then chain_id will be -1 */ 1881 /* If the ch is not chained then chain_id will be -1 */
1990 if (dma_chan[ch].chain_id != -1) { 1882 if (dma_chan[ch].chain_id != -1) {
1991 int chain_id = dma_chan[ch].chain_id; 1883 int chain_id = dma_chan[ch].chain_id;
1992 dma_chan[ch].state = DMA_CH_NOTSTARTED; 1884 dma_chan[ch].state = DMA_CH_NOTSTARTED;
1993 if (dma_read(CLNK_CTRL(ch)) & (1 << 15)) 1885 if (p->dma_read(CLNK_CTRL, ch) & (1 << 15))
1994 dma_chan[dma_chan[ch].next_linked_ch].state = 1886 dma_chan[dma_chan[ch].next_linked_ch].state =
1995 DMA_CH_STARTED; 1887 DMA_CH_STARTED;
1996 if (dma_linked_lch[chain_id].chain_mode == 1888 if (dma_linked_lch[chain_id].chain_mode ==
@@ -2000,10 +1892,10 @@ static int omap2_dma_handle_ch(int ch)
2000 if (!OMAP_DMA_CHAIN_QEMPTY(chain_id)) 1892 if (!OMAP_DMA_CHAIN_QEMPTY(chain_id))
2001 OMAP_DMA_CHAIN_INCQHEAD(chain_id); 1893 OMAP_DMA_CHAIN_INCQHEAD(chain_id);
2002 1894
2003 status = dma_read(CSR(ch)); 1895 status = p->dma_read(CSR, ch);
2004 } 1896 }
2005 1897
2006 dma_write(status, CSR(ch)); 1898 p->dma_write(status, CSR, ch);
2007 1899
2008 if (likely(dma_chan[ch].callback != NULL)) 1900 if (likely(dma_chan[ch].callback != NULL))
2009 dma_chan[ch].callback(ch, status, dma_chan[ch].data); 1901 dma_chan[ch].callback(ch, status, dma_chan[ch].data);
@@ -2017,13 +1909,13 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id)
2017 u32 val, enable_reg; 1909 u32 val, enable_reg;
2018 int i; 1910 int i;
2019 1911
2020 val = dma_read(IRQSTATUS_L0); 1912 val = p->dma_read(IRQSTATUS_L0, 0);
2021 if (val == 0) { 1913 if (val == 0) {
2022 if (printk_ratelimit()) 1914 if (printk_ratelimit())
2023 printk(KERN_WARNING "Spurious DMA IRQ\n"); 1915 printk(KERN_WARNING "Spurious DMA IRQ\n");
2024 return IRQ_HANDLED; 1916 return IRQ_HANDLED;
2025 } 1917 }
2026 enable_reg = dma_read(IRQENABLE_L0); 1918 enable_reg = p->dma_read(IRQENABLE_L0, 0);
2027 val &= enable_reg; /* Dispatch only relevant interrupts */ 1919 val &= enable_reg; /* Dispatch only relevant interrupts */
2028 for (i = 0; i < dma_lch_count && val != 0; i++) { 1920 for (i = 0; i < dma_lch_count && val != 0; i++) {
2029 if (val & 1) 1921 if (val & 1)
@@ -2049,119 +1941,66 @@ static struct irqaction omap24xx_dma_irq;
2049void omap_dma_global_context_save(void) 1941void omap_dma_global_context_save(void)
2050{ 1942{
2051 omap_dma_global_context.dma_irqenable_l0 = 1943 omap_dma_global_context.dma_irqenable_l0 =
2052 dma_read(IRQENABLE_L0); 1944 p->dma_read(IRQENABLE_L0, 0);
2053 omap_dma_global_context.dma_ocp_sysconfig = 1945 omap_dma_global_context.dma_ocp_sysconfig =
2054 dma_read(OCP_SYSCONFIG); 1946 p->dma_read(OCP_SYSCONFIG, 0);
2055 omap_dma_global_context.dma_gcr = dma_read(GCR); 1947 omap_dma_global_context.dma_gcr = p->dma_read(GCR, 0);
2056} 1948}
2057 1949
2058void omap_dma_global_context_restore(void) 1950void omap_dma_global_context_restore(void)
2059{ 1951{
2060 int ch; 1952 int ch;
2061 1953
2062 dma_write(omap_dma_global_context.dma_gcr, GCR); 1954 p->dma_write(omap_dma_global_context.dma_gcr, GCR, 0);
2063 dma_write(omap_dma_global_context.dma_ocp_sysconfig, 1955 p->dma_write(omap_dma_global_context.dma_ocp_sysconfig,
2064 OCP_SYSCONFIG); 1956 OCP_SYSCONFIG, 0);
2065 dma_write(omap_dma_global_context.dma_irqenable_l0, 1957 p->dma_write(omap_dma_global_context.dma_irqenable_l0,
2066 IRQENABLE_L0); 1958 IRQENABLE_L0, 0);
2067 1959
2068 /* 1960 if (IS_DMA_ERRATA(DMA_ROMCODE_BUG))
2069 * A bug in ROM code leaves IRQ status for channels 0 and 1 uncleared 1961 p->dma_write(0x3 , IRQSTATUS_L0, 0);
2070 * after secure sram context save and restore. Hence we need to
2071 * manually clear those IRQs to avoid spurious interrupts. This
2072 * affects only secure devices.
2073 */
2074 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
2075 dma_write(0x3 , IRQSTATUS_L0);
2076 1962
2077 for (ch = 0; ch < dma_chan_count; ch++) 1963 for (ch = 0; ch < dma_chan_count; ch++)
2078 if (dma_chan[ch].dev_id != -1) 1964 if (dma_chan[ch].dev_id != -1)
2079 omap_clear_dma(ch); 1965 omap_clear_dma(ch);
2080} 1966}
2081 1967
2082/*----------------------------------------------------------------------------*/ 1968static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2083
2084static int __init omap_init_dma(void)
2085{ 1969{
2086 unsigned long base; 1970 int ch, ret = 0;
2087 int ch, r; 1971 int dma_irq;
2088 1972 char irq_name[4];
2089 if (cpu_class_is_omap1()) { 1973 int irq_rel;
2090 base = OMAP1_DMA_BASE; 1974
2091 dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; 1975 p = pdev->dev.platform_data;
2092 } else if (cpu_is_omap24xx()) { 1976 if (!p) {
2093 base = OMAP24XX_DMA4_BASE; 1977 dev_err(&pdev->dev, "%s: System DMA initialized without"
2094 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; 1978 "platform data\n", __func__);
2095 } else if (cpu_is_omap34xx()) { 1979 return -EINVAL;
2096 base = OMAP34XX_DMA4_BASE;
2097 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2098 } else if (cpu_is_omap44xx()) {
2099 base = OMAP44XX_DMA4_BASE;
2100 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2101 } else {
2102 pr_err("DMA init failed for unsupported omap\n");
2103 return -ENODEV;
2104 } 1980 }
2105 1981
2106 omap_dma_base = ioremap(base, SZ_4K); 1982 d = p->dma_attr;
2107 BUG_ON(!omap_dma_base); 1983 errata = p->errata;
2108 1984
2109 if (cpu_class_is_omap2() && omap_dma_reserve_channels 1985 if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels
2110 && (omap_dma_reserve_channels <= dma_lch_count)) 1986 && (omap_dma_reserve_channels <= dma_lch_count))
2111 dma_lch_count = omap_dma_reserve_channels; 1987 d->lch_count = omap_dma_reserve_channels;
2112 1988
2113 dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count, 1989 dma_lch_count = d->lch_count;
2114 GFP_KERNEL); 1990 dma_chan_count = dma_lch_count;
2115 if (!dma_chan) { 1991 dma_chan = d->chan;
2116 r = -ENOMEM; 1992 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
2117 goto out_unmap;
2118 }
2119 1993
2120 if (cpu_class_is_omap2()) { 1994 if (cpu_class_is_omap2()) {
2121 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * 1995 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
2122 dma_lch_count, GFP_KERNEL); 1996 dma_lch_count, GFP_KERNEL);
2123 if (!dma_linked_lch) { 1997 if (!dma_linked_lch) {
2124 r = -ENOMEM; 1998 ret = -ENOMEM;
2125 goto out_free; 1999 goto exit_dma_lch_fail;
2126 } 2000 }
2127 } 2001 }
2128 2002
2129 if (cpu_is_omap15xx()) {
2130 printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
2131 dma_chan_count = 9;
2132 enable_1510_mode = 1;
2133 } else if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
2134 printk(KERN_INFO "OMAP DMA hardware version %d\n",
2135 dma_read(HW_ID));
2136 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
2137 (dma_read(CAPS_0_U) << 16) |
2138 dma_read(CAPS_0_L),
2139 (dma_read(CAPS_1_U) << 16) |
2140 dma_read(CAPS_1_L),
2141 dma_read(CAPS_2), dma_read(CAPS_3),
2142 dma_read(CAPS_4));
2143 if (!enable_1510_mode) {
2144 u16 w;
2145
2146 /* Disable OMAP 3.0/3.1 compatibility mode. */
2147 w = dma_read(GSCR);
2148 w |= 1 << 3;
2149 dma_write(w, GSCR);
2150 dma_chan_count = 16;
2151 } else
2152 dma_chan_count = 9;
2153 } else if (cpu_class_is_omap2()) {
2154 u8 revision = dma_read(REVISION) & 0xff;
2155 printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n",
2156 revision >> 4, revision & 0xf);
2157 dma_chan_count = dma_lch_count;
2158 } else {
2159 dma_chan_count = 0;
2160 return 0;
2161 }
2162
2163 spin_lock_init(&dma_chan_lock); 2003 spin_lock_init(&dma_chan_lock);
2164
2165 for (ch = 0; ch < dma_chan_count; ch++) { 2004 for (ch = 0; ch < dma_chan_count; ch++) {
2166 omap_clear_dma(ch); 2005 omap_clear_dma(ch);
2167 if (cpu_class_is_omap2()) 2006 if (cpu_class_is_omap2())
@@ -2178,20 +2017,23 @@ static int __init omap_init_dma(void)
2178 * request_irq() doesn't like dev_id (ie. ch) being 2017 * request_irq() doesn't like dev_id (ie. ch) being
2179 * zero, so we have to kludge around this. 2018 * zero, so we have to kludge around this.
2180 */ 2019 */
2181 r = request_irq(omap1_dma_irq[ch], 2020 sprintf(&irq_name[0], "%d", ch);
2021 dma_irq = platform_get_irq_byname(pdev, irq_name);
2022
2023 if (dma_irq < 0) {
2024 ret = dma_irq;
2025 goto exit_dma_irq_fail;
2026 }
2027
2028 /* INT_DMA_LCD is handled in lcd_dma.c */
2029 if (dma_irq == INT_DMA_LCD)
2030 continue;
2031
2032 ret = request_irq(dma_irq,
2182 omap1_dma_irq_handler, 0, "DMA", 2033 omap1_dma_irq_handler, 0, "DMA",
2183 (void *) (ch + 1)); 2034 (void *) (ch + 1));
2184 if (r != 0) { 2035 if (ret != 0)
2185 int i; 2036 goto exit_dma_irq_fail;
2186
2187 printk(KERN_ERR "unable to request IRQ %d "
2188 "for DMA (error %d)\n",
2189 omap1_dma_irq[ch], r);
2190 for (i = 0; i < ch; i++)
2191 free_irq(omap1_dma_irq[i],
2192 (void *) (i + 1));
2193 goto out_free;
2194 }
2195 } 2037 }
2196 } 2038 }
2197 2039
@@ -2200,46 +2042,91 @@ static int __init omap_init_dma(void)
2200 DMA_DEFAULT_FIFO_DEPTH, 0); 2042 DMA_DEFAULT_FIFO_DEPTH, 0);
2201 2043
2202 if (cpu_class_is_omap2()) { 2044 if (cpu_class_is_omap2()) {
2203 int irq; 2045 strcpy(irq_name, "0");
2204 if (cpu_is_omap44xx()) 2046 dma_irq = platform_get_irq_byname(pdev, irq_name);
2205 irq = OMAP44XX_IRQ_SDMA_0; 2047 if (dma_irq < 0) {
2206 else 2048 dev_err(&pdev->dev, "failed: request IRQ %d", dma_irq);
2207 irq = INT_24XX_SDMA_IRQ0; 2049 goto exit_dma_lch_fail;
2208 setup_irq(irq, &omap24xx_dma_irq); 2050 }
2209 } 2051 ret = setup_irq(dma_irq, &omap24xx_dma_irq);
2210 2052 if (ret) {
2211 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 2053 dev_err(&pdev->dev, "set_up failed for IRQ %d"
2212 /* Enable smartidle idlemodes and autoidle */ 2054 "for DMA (error %d)\n", dma_irq, ret);
2213 u32 v = dma_read(OCP_SYSCONFIG); 2055 goto exit_dma_lch_fail;
2214 v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK |
2215 DMA_SYSCONFIG_SIDLEMODE_MASK |
2216 DMA_SYSCONFIG_AUTOIDLE);
2217 v |= (DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2218 DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2219 DMA_SYSCONFIG_AUTOIDLE);
2220 dma_write(v , OCP_SYSCONFIG);
2221 /* reserve dma channels 0 and 1 in high security devices */
2222 if (cpu_is_omap34xx() &&
2223 (omap_type() != OMAP2_DEVICE_TYPE_GP)) {
2224 printk(KERN_INFO "Reserving DMA channels 0 and 1 for "
2225 "HS ROM code\n");
2226 dma_chan[0].dev_id = 0;
2227 dma_chan[1].dev_id = 1;
2228 } 2056 }
2229 } 2057 }
2230 2058
2059 /* reserve dma channels 0 and 1 in high security devices */
2060 if (cpu_is_omap34xx() &&
2061 (omap_type() != OMAP2_DEVICE_TYPE_GP)) {
2062 printk(KERN_INFO "Reserving DMA channels 0 and 1 for "
2063 "HS ROM code\n");
2064 dma_chan[0].dev_id = 0;
2065 dma_chan[1].dev_id = 1;
2066 }
2067 p->show_dma_caps();
2231 return 0; 2068 return 0;
2232 2069
2233out_free: 2070exit_dma_irq_fail:
2071 dev_err(&pdev->dev, "unable to request IRQ %d"
2072 "for DMA (error %d)\n", dma_irq, ret);
2073 for (irq_rel = 0; irq_rel < ch; irq_rel++) {
2074 dma_irq = platform_get_irq(pdev, irq_rel);
2075 free_irq(dma_irq, (void *)(irq_rel + 1));
2076 }
2077
2078exit_dma_lch_fail:
2079 kfree(p);
2080 kfree(d);
2234 kfree(dma_chan); 2081 kfree(dma_chan);
2082 return ret;
2083}
2235 2084
2236out_unmap: 2085static int __devexit omap_system_dma_remove(struct platform_device *pdev)
2237 iounmap(omap_dma_base); 2086{
2087 int dma_irq;
2238 2088
2239 return r; 2089 if (cpu_class_is_omap2()) {
2090 char irq_name[4];
2091 strcpy(irq_name, "0");
2092 dma_irq = platform_get_irq_byname(pdev, irq_name);
2093 remove_irq(dma_irq, &omap24xx_dma_irq);
2094 } else {
2095 int irq_rel = 0;
2096 for ( ; irq_rel < dma_chan_count; irq_rel++) {
2097 dma_irq = platform_get_irq(pdev, irq_rel);
2098 free_irq(dma_irq, (void *)(irq_rel + 1));
2099 }
2100 }
2101 kfree(p);
2102 kfree(d);
2103 kfree(dma_chan);
2104 return 0;
2105}
2106
2107static struct platform_driver omap_system_dma_driver = {
2108 .probe = omap_system_dma_probe,
2109 .remove = omap_system_dma_remove,
2110 .driver = {
2111 .name = "omap_dma_system"
2112 },
2113};
2114
2115static int __init omap_system_dma_init(void)
2116{
2117 return platform_driver_register(&omap_system_dma_driver);
2118}
2119arch_initcall(omap_system_dma_init);
2120
2121static void __exit omap_system_dma_exit(void)
2122{
2123 platform_driver_unregister(&omap_system_dma_driver);
2240} 2124}
2241 2125
2242arch_initcall(omap_init_dma); 2126MODULE_DESCRIPTION("OMAP SYSTEM DMA DRIVER");
2127MODULE_LICENSE("GPL");
2128MODULE_ALIAS("platform:" DRIVER_NAME);
2129MODULE_AUTHOR("Texas Instruments Inc");
2243 2130
2244/* 2131/*
2245 * Reserve the omap SDMA channels using cmdline bootarg 2132 * Reserve the omap SDMA channels using cmdline bootarg
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index c05c653d1674..1f98e0b94847 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -21,18 +21,18 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/slab.h>
25#include <linux/pm_runtime.h>
24 26
25#include <mach/hardware.h> 27#include <mach/hardware.h>
26#include <asm/irq.h> 28#include <asm/irq.h>
27#include <mach/irqs.h> 29#include <mach/irqs.h>
28#include <mach/gpio.h> 30#include <mach/gpio.h>
29#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
30#include <plat/powerdomain.h>
31 32
32/* 33/*
33 * OMAP1510 GPIO registers 34 * OMAP1510 GPIO registers
34 */ 35 */
35#define OMAP1510_GPIO_BASE 0xfffce000
36#define OMAP1510_GPIO_DATA_INPUT 0x00 36#define OMAP1510_GPIO_DATA_INPUT 0x00
37#define OMAP1510_GPIO_DATA_OUTPUT 0x04 37#define OMAP1510_GPIO_DATA_OUTPUT 0x04
38#define OMAP1510_GPIO_DIR_CONTROL 0x08 38#define OMAP1510_GPIO_DIR_CONTROL 0x08
@@ -46,10 +46,6 @@
46/* 46/*
47 * OMAP1610 specific GPIO registers 47 * OMAP1610 specific GPIO registers
48 */ 48 */
49#define OMAP1610_GPIO1_BASE 0xfffbe400
50#define OMAP1610_GPIO2_BASE 0xfffbec00
51#define OMAP1610_GPIO3_BASE 0xfffbb400
52#define OMAP1610_GPIO4_BASE 0xfffbbc00
53#define OMAP1610_GPIO_REVISION 0x0000 49#define OMAP1610_GPIO_REVISION 0x0000
54#define OMAP1610_GPIO_SYSCONFIG 0x0010 50#define OMAP1610_GPIO_SYSCONFIG 0x0010
55#define OMAP1610_GPIO_SYSSTATUS 0x0014 51#define OMAP1610_GPIO_SYSSTATUS 0x0014
@@ -71,12 +67,6 @@
71/* 67/*
72 * OMAP7XX specific GPIO registers 68 * OMAP7XX specific GPIO registers
73 */ 69 */
74#define OMAP7XX_GPIO1_BASE 0xfffbc000
75#define OMAP7XX_GPIO2_BASE 0xfffbc800
76#define OMAP7XX_GPIO3_BASE 0xfffbd000
77#define OMAP7XX_GPIO4_BASE 0xfffbd800
78#define OMAP7XX_GPIO5_BASE 0xfffbe000
79#define OMAP7XX_GPIO6_BASE 0xfffbe800
80#define OMAP7XX_GPIO_DATA_INPUT 0x00 70#define OMAP7XX_GPIO_DATA_INPUT 0x00
81#define OMAP7XX_GPIO_DATA_OUTPUT 0x04 71#define OMAP7XX_GPIO_DATA_OUTPUT 0x04
82#define OMAP7XX_GPIO_DIR_CONTROL 0x08 72#define OMAP7XX_GPIO_DIR_CONTROL 0x08
@@ -84,25 +74,10 @@
84#define OMAP7XX_GPIO_INT_MASK 0x10 74#define OMAP7XX_GPIO_INT_MASK 0x10
85#define OMAP7XX_GPIO_INT_STATUS 0x14 75#define OMAP7XX_GPIO_INT_STATUS 0x14
86 76
87#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
88
89/* 77/*
90 * omap24xx specific GPIO registers 78 * omap2+ specific GPIO registers
91 */ 79 */
92#define OMAP242X_GPIO1_BASE 0x48018000
93#define OMAP242X_GPIO2_BASE 0x4801a000
94#define OMAP242X_GPIO3_BASE 0x4801c000
95#define OMAP242X_GPIO4_BASE 0x4801e000
96
97#define OMAP243X_GPIO1_BASE 0x4900C000
98#define OMAP243X_GPIO2_BASE 0x4900E000
99#define OMAP243X_GPIO3_BASE 0x49010000
100#define OMAP243X_GPIO4_BASE 0x49012000
101#define OMAP243X_GPIO5_BASE 0x480B6000
102
103#define OMAP24XX_GPIO_REVISION 0x0000 80#define OMAP24XX_GPIO_REVISION 0x0000
104#define OMAP24XX_GPIO_SYSCONFIG 0x0010
105#define OMAP24XX_GPIO_SYSSTATUS 0x0014
106#define OMAP24XX_GPIO_IRQSTATUS1 0x0018 81#define OMAP24XX_GPIO_IRQSTATUS1 0x0018
107#define OMAP24XX_GPIO_IRQSTATUS2 0x0028 82#define OMAP24XX_GPIO_IRQSTATUS2 0x0028
108#define OMAP24XX_GPIO_IRQENABLE2 0x002c 83#define OMAP24XX_GPIO_IRQENABLE2 0x002c
@@ -126,7 +101,6 @@
126#define OMAP24XX_GPIO_SETDATAOUT 0x0094 101#define OMAP24XX_GPIO_SETDATAOUT 0x0094
127 102
128#define OMAP4_GPIO_REVISION 0x0000 103#define OMAP4_GPIO_REVISION 0x0000
129#define OMAP4_GPIO_SYSCONFIG 0x0010
130#define OMAP4_GPIO_EOI 0x0020 104#define OMAP4_GPIO_EOI 0x0020
131#define OMAP4_GPIO_IRQSTATUSRAW0 0x0024 105#define OMAP4_GPIO_IRQSTATUSRAW0 0x0024
132#define OMAP4_GPIO_IRQSTATUSRAW1 0x0028 106#define OMAP4_GPIO_IRQSTATUSRAW1 0x0028
@@ -138,7 +112,6 @@
138#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040 112#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040
139#define OMAP4_GPIO_IRQWAKEN0 0x0044 113#define OMAP4_GPIO_IRQWAKEN0 0x0044
140#define OMAP4_GPIO_IRQWAKEN1 0x0048 114#define OMAP4_GPIO_IRQWAKEN1 0x0048
141#define OMAP4_GPIO_SYSSTATUS 0x0114
142#define OMAP4_GPIO_IRQENABLE1 0x011c 115#define OMAP4_GPIO_IRQENABLE1 0x011c
143#define OMAP4_GPIO_WAKE_EN 0x0120 116#define OMAP4_GPIO_WAKE_EN 0x0120
144#define OMAP4_GPIO_IRQSTATUS2 0x0128 117#define OMAP4_GPIO_IRQSTATUS2 0x0128
@@ -159,26 +132,6 @@
159#define OMAP4_GPIO_SETWKUENA 0x0184 132#define OMAP4_GPIO_SETWKUENA 0x0184
160#define OMAP4_GPIO_CLEARDATAOUT 0x0190 133#define OMAP4_GPIO_CLEARDATAOUT 0x0190
161#define OMAP4_GPIO_SETDATAOUT 0x0194 134#define OMAP4_GPIO_SETDATAOUT 0x0194
162/*
163 * omap34xx specific GPIO registers
164 */
165
166#define OMAP34XX_GPIO1_BASE 0x48310000
167#define OMAP34XX_GPIO2_BASE 0x49050000
168#define OMAP34XX_GPIO3_BASE 0x49052000
169#define OMAP34XX_GPIO4_BASE 0x49054000
170#define OMAP34XX_GPIO5_BASE 0x49056000
171#define OMAP34XX_GPIO6_BASE 0x49058000
172
173/*
174 * OMAP44XX specific GPIO registers
175 */
176#define OMAP44XX_GPIO1_BASE 0x4a310000
177#define OMAP44XX_GPIO2_BASE 0x48055000
178#define OMAP44XX_GPIO3_BASE 0x48057000
179#define OMAP44XX_GPIO4_BASE 0x48059000
180#define OMAP44XX_GPIO5_BASE 0x4805B000
181#define OMAP44XX_GPIO6_BASE 0x4805D000
182 135
183struct gpio_bank { 136struct gpio_bank {
184 unsigned long pbase; 137 unsigned long pbase;
@@ -190,14 +143,12 @@ struct gpio_bank {
190 u32 suspend_wakeup; 143 u32 suspend_wakeup;
191 u32 saved_wakeup; 144 u32 saved_wakeup;
192#endif 145#endif
193#ifdef CONFIG_ARCH_OMAP2PLUS
194 u32 non_wakeup_gpios; 146 u32 non_wakeup_gpios;
195 u32 enabled_non_wakeup_gpios; 147 u32 enabled_non_wakeup_gpios;
196 148
197 u32 saved_datain; 149 u32 saved_datain;
198 u32 saved_fallingdetect; 150 u32 saved_fallingdetect;
199 u32 saved_risingdetect; 151 u32 saved_risingdetect;
200#endif
201 u32 level_mask; 152 u32 level_mask;
202 u32 toggle_mask; 153 u32 toggle_mask;
203 spinlock_t lock; 154 spinlock_t lock;
@@ -205,104 +156,13 @@ struct gpio_bank {
205 struct clk *dbck; 156 struct clk *dbck;
206 u32 mod_usage; 157 u32 mod_usage;
207 u32 dbck_enable_mask; 158 u32 dbck_enable_mask;
159 struct device *dev;
160 bool dbck_flag;
161 int stride;
208}; 162};
209 163
210#define METHOD_MPUIO 0
211#define METHOD_GPIO_1510 1
212#define METHOD_GPIO_1610 2
213#define METHOD_GPIO_7XX 3
214#define METHOD_GPIO_24XX 5
215#define METHOD_GPIO_44XX 6
216
217#ifdef CONFIG_ARCH_OMAP16XX
218static struct gpio_bank gpio_bank_1610[5] = {
219 { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE,
220 METHOD_MPUIO },
221 { OMAP1610_GPIO1_BASE, NULL, INT_GPIO_BANK1, IH_GPIO_BASE,
222 METHOD_GPIO_1610 },
223 { OMAP1610_GPIO2_BASE, NULL, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16,
224 METHOD_GPIO_1610 },
225 { OMAP1610_GPIO3_BASE, NULL, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32,
226 METHOD_GPIO_1610 },
227 { OMAP1610_GPIO4_BASE, NULL, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48,
228 METHOD_GPIO_1610 },
229};
230#endif
231
232#ifdef CONFIG_ARCH_OMAP15XX
233static struct gpio_bank gpio_bank_1510[2] = {
234 { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE,
235 METHOD_MPUIO },
236 { OMAP1510_GPIO_BASE, NULL, INT_GPIO_BANK1, IH_GPIO_BASE,
237 METHOD_GPIO_1510 }
238};
239#endif
240
241#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
242static struct gpio_bank gpio_bank_7xx[7] = {
243 { OMAP1_MPUIO_VBASE, NULL, INT_7XX_MPUIO, IH_MPUIO_BASE,
244 METHOD_MPUIO },
245 { OMAP7XX_GPIO1_BASE, NULL, INT_7XX_GPIO_BANK1, IH_GPIO_BASE,
246 METHOD_GPIO_7XX },
247 { OMAP7XX_GPIO2_BASE, NULL, INT_7XX_GPIO_BANK2, IH_GPIO_BASE + 32,
248 METHOD_GPIO_7XX },
249 { OMAP7XX_GPIO3_BASE, NULL, INT_7XX_GPIO_BANK3, IH_GPIO_BASE + 64,
250 METHOD_GPIO_7XX },
251 { OMAP7XX_GPIO4_BASE, NULL, INT_7XX_GPIO_BANK4, IH_GPIO_BASE + 96,
252 METHOD_GPIO_7XX },
253 { OMAP7XX_GPIO5_BASE, NULL, INT_7XX_GPIO_BANK5, IH_GPIO_BASE + 128,
254 METHOD_GPIO_7XX },
255 { OMAP7XX_GPIO6_BASE, NULL, INT_7XX_GPIO_BANK6, IH_GPIO_BASE + 160,
256 METHOD_GPIO_7XX },
257};
258#endif
259
260#ifdef CONFIG_ARCH_OMAP2
261
262static struct gpio_bank gpio_bank_242x[4] = {
263 { OMAP242X_GPIO1_BASE, NULL, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,
264 METHOD_GPIO_24XX },
265 { OMAP242X_GPIO2_BASE, NULL, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,
266 METHOD_GPIO_24XX },
267 { OMAP242X_GPIO3_BASE, NULL, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,
268 METHOD_GPIO_24XX },
269 { OMAP242X_GPIO4_BASE, NULL, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,
270 METHOD_GPIO_24XX },
271};
272
273static struct gpio_bank gpio_bank_243x[5] = {
274 { OMAP243X_GPIO1_BASE, NULL, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,
275 METHOD_GPIO_24XX },
276 { OMAP243X_GPIO2_BASE, NULL, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,
277 METHOD_GPIO_24XX },
278 { OMAP243X_GPIO3_BASE, NULL, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,
279 METHOD_GPIO_24XX },
280 { OMAP243X_GPIO4_BASE, NULL, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,
281 METHOD_GPIO_24XX },
282 { OMAP243X_GPIO5_BASE, NULL, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128,
283 METHOD_GPIO_24XX },
284};
285
286#endif
287
288#ifdef CONFIG_ARCH_OMAP3 164#ifdef CONFIG_ARCH_OMAP3
289static struct gpio_bank gpio_bank_34xx[6] = {
290 { OMAP34XX_GPIO1_BASE, NULL, INT_34XX_GPIO_BANK1, IH_GPIO_BASE,
291 METHOD_GPIO_24XX },
292 { OMAP34XX_GPIO2_BASE, NULL, INT_34XX_GPIO_BANK2, IH_GPIO_BASE + 32,
293 METHOD_GPIO_24XX },
294 { OMAP34XX_GPIO3_BASE, NULL, INT_34XX_GPIO_BANK3, IH_GPIO_BASE + 64,
295 METHOD_GPIO_24XX },
296 { OMAP34XX_GPIO4_BASE, NULL, INT_34XX_GPIO_BANK4, IH_GPIO_BASE + 96,
297 METHOD_GPIO_24XX },
298 { OMAP34XX_GPIO5_BASE, NULL, INT_34XX_GPIO_BANK5, IH_GPIO_BASE + 128,
299 METHOD_GPIO_24XX },
300 { OMAP34XX_GPIO6_BASE, NULL, INT_34XX_GPIO_BANK6, IH_GPIO_BASE + 160,
301 METHOD_GPIO_24XX },
302};
303
304struct omap3_gpio_regs { 165struct omap3_gpio_regs {
305 u32 sysconfig;
306 u32 irqenable1; 166 u32 irqenable1;
307 u32 irqenable2; 167 u32 irqenable2;
308 u32 wake_en; 168 u32 wake_en;
@@ -318,26 +178,16 @@ struct omap3_gpio_regs {
318static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS]; 178static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS];
319#endif 179#endif
320 180
321#ifdef CONFIG_ARCH_OMAP4 181/*
322static struct gpio_bank gpio_bank_44xx[6] = { 182 * TODO: Cleanup gpio_bank usage as it is having information
323 { OMAP44XX_GPIO1_BASE, NULL, OMAP44XX_IRQ_GPIO1, IH_GPIO_BASE, 183 * related to all instances of the device
324 METHOD_GPIO_44XX }, 184 */
325 { OMAP44XX_GPIO2_BASE, NULL, OMAP44XX_IRQ_GPIO2, IH_GPIO_BASE + 32, 185static struct gpio_bank *gpio_bank;
326 METHOD_GPIO_44XX },
327 { OMAP44XX_GPIO3_BASE, NULL, OMAP44XX_IRQ_GPIO3, IH_GPIO_BASE + 64,
328 METHOD_GPIO_44XX },
329 { OMAP44XX_GPIO4_BASE, NULL, OMAP44XX_IRQ_GPIO4, IH_GPIO_BASE + 96,
330 METHOD_GPIO_44XX },
331 { OMAP44XX_GPIO5_BASE, NULL, OMAP44XX_IRQ_GPIO5, IH_GPIO_BASE + 128,
332 METHOD_GPIO_44XX },
333 { OMAP44XX_GPIO6_BASE, NULL, OMAP44XX_IRQ_GPIO6, IH_GPIO_BASE + 160,
334 METHOD_GPIO_44XX },
335};
336 186
337#endif 187static int bank_width;
338 188
339static struct gpio_bank *gpio_bank; 189/* TODO: Analyze removing gpio_bank_count usage from driver code */
340static int gpio_bank_count; 190int gpio_bank_count;
341 191
342static inline struct gpio_bank *get_gpio_bank(int gpio) 192static inline struct gpio_bank *get_gpio_bank(int gpio)
343{ 193{
@@ -417,7 +267,7 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
417 switch (bank->method) { 267 switch (bank->method) {
418#ifdef CONFIG_ARCH_OMAP1 268#ifdef CONFIG_ARCH_OMAP1
419 case METHOD_MPUIO: 269 case METHOD_MPUIO:
420 reg += OMAP_MPUIO_IO_CNTL; 270 reg += OMAP_MPUIO_IO_CNTL / bank->stride;
421 break; 271 break;
422#endif 272#endif
423#ifdef CONFIG_ARCH_OMAP15XX 273#ifdef CONFIG_ARCH_OMAP15XX
@@ -465,7 +315,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
465 switch (bank->method) { 315 switch (bank->method) {
466#ifdef CONFIG_ARCH_OMAP1 316#ifdef CONFIG_ARCH_OMAP1
467 case METHOD_MPUIO: 317 case METHOD_MPUIO:
468 reg += OMAP_MPUIO_OUTPUT; 318 reg += OMAP_MPUIO_OUTPUT / bank->stride;
469 l = __raw_readl(reg); 319 l = __raw_readl(reg);
470 if (enable) 320 if (enable)
471 l |= 1 << gpio; 321 l |= 1 << gpio;
@@ -537,7 +387,7 @@ static int _get_gpio_datain(struct gpio_bank *bank, int gpio)
537 switch (bank->method) { 387 switch (bank->method) {
538#ifdef CONFIG_ARCH_OMAP1 388#ifdef CONFIG_ARCH_OMAP1
539 case METHOD_MPUIO: 389 case METHOD_MPUIO:
540 reg += OMAP_MPUIO_INPUT_LATCH; 390 reg += OMAP_MPUIO_INPUT_LATCH / bank->stride;
541 break; 391 break;
542#endif 392#endif
543#ifdef CONFIG_ARCH_OMAP15XX 393#ifdef CONFIG_ARCH_OMAP15XX
@@ -583,7 +433,7 @@ static int _get_gpio_dataout(struct gpio_bank *bank, int gpio)
583 switch (bank->method) { 433 switch (bank->method) {
584#ifdef CONFIG_ARCH_OMAP1 434#ifdef CONFIG_ARCH_OMAP1
585 case METHOD_MPUIO: 435 case METHOD_MPUIO:
586 reg += OMAP_MPUIO_OUTPUT; 436 reg += OMAP_MPUIO_OUTPUT / bank->stride;
587 break; 437 break;
588#endif 438#endif
589#ifdef CONFIG_ARCH_OMAP15XX 439#ifdef CONFIG_ARCH_OMAP15XX
@@ -642,6 +492,9 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
642 u32 val; 492 u32 val;
643 u32 l; 493 u32 l;
644 494
495 if (!bank->dbck_flag)
496 return;
497
645 if (debounce < 32) 498 if (debounce < 32)
646 debounce = 0x01; 499 debounce = 0x01;
647 else if (debounce > 7936) 500 else if (debounce > 7936)
@@ -651,7 +504,7 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
651 504
652 l = 1 << get_gpio_index(gpio); 505 l = 1 << get_gpio_index(gpio);
653 506
654 if (cpu_is_omap44xx()) 507 if (bank->method == METHOD_GPIO_44XX)
655 reg += OMAP4_GPIO_DEBOUNCINGTIME; 508 reg += OMAP4_GPIO_DEBOUNCINGTIME;
656 else 509 else
657 reg += OMAP24XX_GPIO_DEBOUNCE_VAL; 510 reg += OMAP24XX_GPIO_DEBOUNCE_VAL;
@@ -659,7 +512,7 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
659 __raw_writel(debounce, reg); 512 __raw_writel(debounce, reg);
660 513
661 reg = bank->base; 514 reg = bank->base;
662 if (cpu_is_omap44xx()) 515 if (bank->method == METHOD_GPIO_44XX)
663 reg += OMAP4_GPIO_DEBOUNCENABLE; 516 reg += OMAP4_GPIO_DEBOUNCENABLE;
664 else 517 else
665 reg += OMAP24XX_GPIO_DEBOUNCE_EN; 518 reg += OMAP24XX_GPIO_DEBOUNCE_EN;
@@ -668,12 +521,10 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
668 521
669 if (debounce) { 522 if (debounce) {
670 val |= l; 523 val |= l;
671 if (cpu_is_omap34xx() || cpu_is_omap44xx()) 524 clk_enable(bank->dbck);
672 clk_enable(bank->dbck);
673 } else { 525 } else {
674 val &= ~l; 526 val &= ~l;
675 if (cpu_is_omap34xx() || cpu_is_omap44xx()) 527 clk_disable(bank->dbck);
676 clk_disable(bank->dbck);
677 } 528 }
678 bank->dbck_enable_mask = val; 529 bank->dbck_enable_mask = val;
679 530
@@ -769,7 +620,7 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio)
769 620
770 switch (bank->method) { 621 switch (bank->method) {
771 case METHOD_MPUIO: 622 case METHOD_MPUIO:
772 reg += OMAP_MPUIO_GPIO_INT_EDGE; 623 reg += OMAP_MPUIO_GPIO_INT_EDGE / bank->stride;
773 break; 624 break;
774#ifdef CONFIG_ARCH_OMAP15XX 625#ifdef CONFIG_ARCH_OMAP15XX
775 case METHOD_GPIO_1510: 626 case METHOD_GPIO_1510:
@@ -803,7 +654,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
803 switch (bank->method) { 654 switch (bank->method) {
804#ifdef CONFIG_ARCH_OMAP1 655#ifdef CONFIG_ARCH_OMAP1
805 case METHOD_MPUIO: 656 case METHOD_MPUIO:
806 reg += OMAP_MPUIO_GPIO_INT_EDGE; 657 reg += OMAP_MPUIO_GPIO_INT_EDGE / bank->stride;
807 l = __raw_readl(reg); 658 l = __raw_readl(reg);
808 if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) 659 if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
809 bank->toggle_mask |= 1 << gpio; 660 bank->toggle_mask |= 1 << gpio;
@@ -989,7 +840,7 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
989 switch (bank->method) { 840 switch (bank->method) {
990#ifdef CONFIG_ARCH_OMAP1 841#ifdef CONFIG_ARCH_OMAP1
991 case METHOD_MPUIO: 842 case METHOD_MPUIO:
992 reg += OMAP_MPUIO_GPIO_MASKIT; 843 reg += OMAP_MPUIO_GPIO_MASKIT / bank->stride;
993 mask = 0xffff; 844 mask = 0xffff;
994 inv = 1; 845 inv = 1;
995 break; 846 break;
@@ -1046,7 +897,7 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
1046 switch (bank->method) { 897 switch (bank->method) {
1047#ifdef CONFIG_ARCH_OMAP1 898#ifdef CONFIG_ARCH_OMAP1
1048 case METHOD_MPUIO: 899 case METHOD_MPUIO:
1049 reg += OMAP_MPUIO_GPIO_MASKIT; 900 reg += OMAP_MPUIO_GPIO_MASKIT / bank->stride;
1050 l = __raw_readl(reg); 901 l = __raw_readl(reg);
1051 if (enable) 902 if (enable)
1052 l &= ~(gpio_mask); 903 l &= ~(gpio_mask);
@@ -1296,7 +1147,8 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1296 bank = get_irq_data(irq); 1147 bank = get_irq_data(irq);
1297#ifdef CONFIG_ARCH_OMAP1 1148#ifdef CONFIG_ARCH_OMAP1
1298 if (bank->method == METHOD_MPUIO) 1149 if (bank->method == METHOD_MPUIO)
1299 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT; 1150 isr_reg = bank->base +
1151 OMAP_MPUIO_GPIO_INT / bank->stride;
1300#endif 1152#endif
1301#ifdef CONFIG_ARCH_OMAP15XX 1153#ifdef CONFIG_ARCH_OMAP15XX
1302 if (bank->method == METHOD_GPIO_1510) 1154 if (bank->method == METHOD_GPIO_1510)
@@ -1318,6 +1170,10 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1318 if (bank->method == METHOD_GPIO_44XX) 1170 if (bank->method == METHOD_GPIO_44XX)
1319 isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0; 1171 isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
1320#endif 1172#endif
1173
1174 if (WARN_ON(!isr_reg))
1175 goto exit;
1176
1321 while(1) { 1177 while(1) {
1322 u32 isr_saved, level_mask = 0; 1178 u32 isr_saved, level_mask = 0;
1323 u32 enabled; 1179 u32 enabled;
@@ -1377,6 +1233,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1377 configured, we must unmask the bank interrupt only after 1233 configured, we must unmask the bank interrupt only after
1378 handler(s) are executed in order to avoid spurious bank 1234 handler(s) are executed in order to avoid spurious bank
1379 interrupt */ 1235 interrupt */
1236exit:
1380 if (!unmasked) 1237 if (!unmasked)
1381 desc->chip->unmask(irq); 1238 desc->chip->unmask(irq);
1382 1239
@@ -1489,7 +1346,8 @@ static int omap_mpuio_suspend_noirq(struct device *dev)
1489{ 1346{
1490 struct platform_device *pdev = to_platform_device(dev); 1347 struct platform_device *pdev = to_platform_device(dev);
1491 struct gpio_bank *bank = platform_get_drvdata(pdev); 1348 struct gpio_bank *bank = platform_get_drvdata(pdev);
1492 void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT; 1349 void __iomem *mask_reg = bank->base +
1350 OMAP_MPUIO_GPIO_MASKIT / bank->stride;
1493 unsigned long flags; 1351 unsigned long flags;
1494 1352
1495 spin_lock_irqsave(&bank->lock, flags); 1353 spin_lock_irqsave(&bank->lock, flags);
@@ -1504,7 +1362,8 @@ static int omap_mpuio_resume_noirq(struct device *dev)
1504{ 1362{
1505 struct platform_device *pdev = to_platform_device(dev); 1363 struct platform_device *pdev = to_platform_device(dev);
1506 struct gpio_bank *bank = platform_get_drvdata(pdev); 1364 struct gpio_bank *bank = platform_get_drvdata(pdev);
1507 void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT; 1365 void __iomem *mask_reg = bank->base +
1366 OMAP_MPUIO_GPIO_MASKIT / bank->stride;
1508 unsigned long flags; 1367 unsigned long flags;
1509 1368
1510 spin_lock_irqsave(&bank->lock, flags); 1369 spin_lock_irqsave(&bank->lock, flags);
@@ -1540,7 +1399,8 @@ static struct platform_device omap_mpuio_device = {
1540 1399
1541static inline void mpuio_init(void) 1400static inline void mpuio_init(void)
1542{ 1401{
1543 platform_set_drvdata(&omap_mpuio_device, &gpio_bank_1610[0]); 1402 struct gpio_bank *bank = get_gpio_bank(OMAP_MPUIO(0));
1403 platform_set_drvdata(&omap_mpuio_device, bank);
1544 1404
1545 if (platform_driver_register(&omap_mpuio_driver) == 0) 1405 if (platform_driver_register(&omap_mpuio_driver) == 0)
1546 (void) platform_device_register(&omap_mpuio_device); 1406 (void) platform_device_register(&omap_mpuio_device);
@@ -1583,7 +1443,7 @@ static int gpio_is_input(struct gpio_bank *bank, int mask)
1583 1443
1584 switch (bank->method) { 1444 switch (bank->method) {
1585 case METHOD_MPUIO: 1445 case METHOD_MPUIO:
1586 reg += OMAP_MPUIO_IO_CNTL; 1446 reg += OMAP_MPUIO_IO_CNTL / bank->stride;
1587 break; 1447 break;
1588 case METHOD_GPIO_1510: 1448 case METHOD_GPIO_1510:
1589 reg += OMAP1510_GPIO_DIR_CONTROL; 1449 reg += OMAP1510_GPIO_DIR_CONTROL;
@@ -1645,6 +1505,13 @@ static int gpio_debounce(struct gpio_chip *chip, unsigned offset,
1645 unsigned long flags; 1505 unsigned long flags;
1646 1506
1647 bank = container_of(chip, struct gpio_bank, chip); 1507 bank = container_of(chip, struct gpio_bank, chip);
1508
1509 if (!bank->dbck) {
1510 bank->dbck = clk_get(bank->dev, "dbclk");
1511 if (IS_ERR(bank->dbck))
1512 dev_err(bank->dev, "Could not get gpio dbck\n");
1513 }
1514
1648 spin_lock_irqsave(&bank->lock, flags); 1515 spin_lock_irqsave(&bank->lock, flags);
1649 _set_gpio_debounce(bank, offset, debounce); 1516 _set_gpio_debounce(bank, offset, debounce);
1650 spin_unlock_irqrestore(&bank->lock, flags); 1517 spin_unlock_irqrestore(&bank->lock, flags);
@@ -1673,34 +1540,16 @@ static int gpio_2irq(struct gpio_chip *chip, unsigned offset)
1673 1540
1674/*---------------------------------------------------------------------*/ 1541/*---------------------------------------------------------------------*/
1675 1542
1676static int initialized; 1543static void __init omap_gpio_show_rev(struct gpio_bank *bank)
1677#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2)
1678static struct clk * gpio_ick;
1679#endif
1680
1681#if defined(CONFIG_ARCH_OMAP2)
1682static struct clk * gpio_fck;
1683#endif
1684
1685#if defined(CONFIG_ARCH_OMAP2430)
1686static struct clk * gpio5_ick;
1687static struct clk * gpio5_fck;
1688#endif
1689
1690#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
1691static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS];
1692#endif
1693
1694static void __init omap_gpio_show_rev(void)
1695{ 1544{
1696 u32 rev; 1545 u32 rev;
1697 1546
1698 if (cpu_is_omap16xx()) 1547 if (cpu_is_omap16xx() && !(bank->method != METHOD_MPUIO))
1699 rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION); 1548 rev = __raw_readw(bank->base + OMAP1610_GPIO_REVISION);
1700 else if (cpu_is_omap24xx() || cpu_is_omap34xx()) 1549 else if (cpu_is_omap24xx() || cpu_is_omap34xx())
1701 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); 1550 rev = __raw_readl(bank->base + OMAP24XX_GPIO_REVISION);
1702 else if (cpu_is_omap44xx()) 1551 else if (cpu_is_omap44xx())
1703 rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION); 1552 rev = __raw_readl(bank->base + OMAP4_GPIO_REVISION);
1704 else 1553 else
1705 return; 1554 return;
1706 1555
@@ -1713,250 +1562,190 @@ static void __init omap_gpio_show_rev(void)
1713 */ 1562 */
1714static struct lock_class_key gpio_lock_class; 1563static struct lock_class_key gpio_lock_class;
1715 1564
1716static int __init _omap_gpio_init(void) 1565static inline int init_gpio_info(struct platform_device *pdev)
1717{ 1566{
1718 int i; 1567 /* TODO: Analyze removing gpio_bank_count usage from driver code */
1719 int gpio = 0; 1568 gpio_bank = kzalloc(gpio_bank_count * sizeof(struct gpio_bank),
1720 struct gpio_bank *bank; 1569 GFP_KERNEL);
1721 int bank_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */ 1570 if (!gpio_bank) {
1722 char clk_name[11]; 1571 dev_err(&pdev->dev, "Memory alloc failed for gpio_bank\n");
1723 1572 return -ENOMEM;
1724 initialized = 1;
1725
1726#if defined(CONFIG_ARCH_OMAP1)
1727 if (cpu_is_omap15xx()) {
1728 gpio_ick = clk_get(NULL, "arm_gpio_ck");
1729 if (IS_ERR(gpio_ick))
1730 printk("Could not get arm_gpio_ck\n");
1731 else
1732 clk_enable(gpio_ick);
1733 } 1573 }
1734#endif 1574 return 0;
1735#if defined(CONFIG_ARCH_OMAP2) 1575}
1736 if (cpu_class_is_omap2()) {
1737 gpio_ick = clk_get(NULL, "gpios_ick");
1738 if (IS_ERR(gpio_ick))
1739 printk("Could not get gpios_ick\n");
1740 else
1741 clk_enable(gpio_ick);
1742 gpio_fck = clk_get(NULL, "gpios_fck");
1743 if (IS_ERR(gpio_fck))
1744 printk("Could not get gpios_fck\n");
1745 else
1746 clk_enable(gpio_fck);
1747 1576
1748 /* 1577/* TODO: Cleanup cpu_is_* checks */
1749 * On 2430 & 3430 GPIO 5 uses CORE L4 ICLK 1578static void omap_gpio_mod_init(struct gpio_bank *bank, int id)
1750 */ 1579{
1751#if defined(CONFIG_ARCH_OMAP2430) 1580 if (cpu_class_is_omap2()) {
1752 if (cpu_is_omap2430()) { 1581 if (cpu_is_omap44xx()) {
1753 gpio5_ick = clk_get(NULL, "gpio5_ick"); 1582 __raw_writel(0xffffffff, bank->base +
1754 if (IS_ERR(gpio5_ick)) 1583 OMAP4_GPIO_IRQSTATUSCLR0);
1755 printk("Could not get gpio5_ick\n"); 1584 __raw_writel(0x00000000, bank->base +
1756 else 1585 OMAP4_GPIO_DEBOUNCENABLE);
1757 clk_enable(gpio5_ick); 1586 /* Initialize interface clk ungated, module enabled */
1758 gpio5_fck = clk_get(NULL, "gpio5_fck"); 1587 __raw_writel(0, bank->base + OMAP4_GPIO_CTRL);
1759 if (IS_ERR(gpio5_fck)) 1588 } else if (cpu_is_omap34xx()) {
1760 printk("Could not get gpio5_fck\n"); 1589 __raw_writel(0x00000000, bank->base +
1761 else 1590 OMAP24XX_GPIO_IRQENABLE1);
1762 clk_enable(gpio5_fck); 1591 __raw_writel(0xffffffff, bank->base +
1592 OMAP24XX_GPIO_IRQSTATUS1);
1593 __raw_writel(0x00000000, bank->base +
1594 OMAP24XX_GPIO_DEBOUNCE_EN);
1595
1596 /* Initialize interface clk ungated, module enabled */
1597 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
1598 } else if (cpu_is_omap24xx()) {
1599 static const u32 non_wakeup_gpios[] = {
1600 0xe203ffc0, 0x08700040
1601 };
1602 if (id < ARRAY_SIZE(non_wakeup_gpios))
1603 bank->non_wakeup_gpios = non_wakeup_gpios[id];
1763 } 1604 }
1764#endif 1605 } else if (cpu_class_is_omap1()) {
1765 } 1606 if (bank_is_mpuio(bank))
1766#endif 1607 __raw_writew(0xffff, bank->base +
1608 OMAP_MPUIO_GPIO_MASKIT / bank->stride);
1609 if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) {
1610 __raw_writew(0xffff, bank->base
1611 + OMAP1510_GPIO_INT_MASK);
1612 __raw_writew(0x0000, bank->base
1613 + OMAP1510_GPIO_INT_STATUS);
1614 }
1615 if (cpu_is_omap16xx() && bank->method == METHOD_GPIO_1610) {
1616 __raw_writew(0x0000, bank->base
1617 + OMAP1610_GPIO_IRQENABLE1);
1618 __raw_writew(0xffff, bank->base
1619 + OMAP1610_GPIO_IRQSTATUS1);
1620 __raw_writew(0x0014, bank->base
1621 + OMAP1610_GPIO_SYSCONFIG);
1767 1622
1768#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 1623 /*
1769 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 1624 * Enable system clock for GPIO module.
1770 for (i = 0; i < OMAP34XX_NR_GPIOS; i++) { 1625 * The CAM_CLK_CTRL *is* really the right place.
1771 sprintf(clk_name, "gpio%d_ick", i + 1); 1626 */
1772 gpio_iclks[i] = clk_get(NULL, clk_name); 1627 omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04,
1773 if (IS_ERR(gpio_iclks[i])) 1628 ULPD_CAM_CLK_CTRL);
1774 printk(KERN_ERR "Could not get %s\n", clk_name); 1629 }
1775 else 1630 if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_7XX) {
1776 clk_enable(gpio_iclks[i]); 1631 __raw_writel(0xffffffff, bank->base
1632 + OMAP7XX_GPIO_INT_MASK);
1633 __raw_writel(0x00000000, bank->base
1634 + OMAP7XX_GPIO_INT_STATUS);
1777 } 1635 }
1778 } 1636 }
1779#endif 1637}
1780 1638
1639static void __init omap_gpio_chip_init(struct gpio_bank *bank)
1640{
1641 int j;
1642 static int gpio;
1781 1643
1782#ifdef CONFIG_ARCH_OMAP15XX 1644 bank->mod_usage = 0;
1783 if (cpu_is_omap15xx()) { 1645 /*
1784 gpio_bank_count = 2; 1646 * REVISIT eventually switch from OMAP-specific gpio structs
1785 gpio_bank = gpio_bank_1510; 1647 * over to the generic ones
1786 bank_size = SZ_2K; 1648 */
1787 } 1649 bank->chip.request = omap_gpio_request;
1788#endif 1650 bank->chip.free = omap_gpio_free;
1789#if defined(CONFIG_ARCH_OMAP16XX) 1651 bank->chip.direction_input = gpio_input;
1790 if (cpu_is_omap16xx()) { 1652 bank->chip.get = gpio_get;
1791 gpio_bank_count = 5; 1653 bank->chip.direction_output = gpio_output;
1792 gpio_bank = gpio_bank_1610; 1654 bank->chip.set_debounce = gpio_debounce;
1793 bank_size = SZ_2K; 1655 bank->chip.set = gpio_set;
1794 } 1656 bank->chip.to_irq = gpio_2irq;
1795#endif 1657 if (bank_is_mpuio(bank)) {
1796#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 1658 bank->chip.label = "mpuio";
1797 if (cpu_is_omap7xx()) { 1659#ifdef CONFIG_ARCH_OMAP16XX
1798 gpio_bank_count = 7; 1660 bank->chip.dev = &omap_mpuio_device.dev;
1799 gpio_bank = gpio_bank_7xx;
1800 bank_size = SZ_2K;
1801 }
1802#endif
1803#ifdef CONFIG_ARCH_OMAP2
1804 if (cpu_is_omap242x()) {
1805 gpio_bank_count = 4;
1806 gpio_bank = gpio_bank_242x;
1807 }
1808 if (cpu_is_omap243x()) {
1809 gpio_bank_count = 5;
1810 gpio_bank = gpio_bank_243x;
1811 }
1812#endif 1661#endif
1813#ifdef CONFIG_ARCH_OMAP3 1662 bank->chip.base = OMAP_MPUIO(0);
1814 if (cpu_is_omap34xx()) { 1663 } else {
1815 gpio_bank_count = OMAP34XX_NR_GPIOS; 1664 bank->chip.label = "gpio";
1816 gpio_bank = gpio_bank_34xx; 1665 bank->chip.base = gpio;
1666 gpio += bank_width;
1817 } 1667 }
1818#endif 1668 bank->chip.ngpio = bank_width;
1819#ifdef CONFIG_ARCH_OMAP4 1669
1820 if (cpu_is_omap44xx()) { 1670 gpiochip_add(&bank->chip);
1821 gpio_bank_count = OMAP34XX_NR_GPIOS; 1671
1822 gpio_bank = gpio_bank_44xx; 1672 for (j = bank->virtual_irq_start;
1673 j < bank->virtual_irq_start + bank_width; j++) {
1674 lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class);
1675 set_irq_chip_data(j, bank);
1676 if (bank_is_mpuio(bank))
1677 set_irq_chip(j, &mpuio_irq_chip);
1678 else
1679 set_irq_chip(j, &gpio_irq_chip);
1680 set_irq_handler(j, handle_simple_irq);
1681 set_irq_flags(j, IRQF_VALID);
1823 } 1682 }
1824#endif 1683 set_irq_chained_handler(bank->irq, gpio_irq_handler);
1825 for (i = 0; i < gpio_bank_count; i++) { 1684 set_irq_data(bank->irq, bank);
1826 int j, gpio_count = 16; 1685}
1686
1687static int __devinit omap_gpio_probe(struct platform_device *pdev)
1688{
1689 static int gpio_init_done;
1690 struct omap_gpio_platform_data *pdata;
1691 struct resource *res;
1692 int id;
1693 struct gpio_bank *bank;
1827 1694
1828 bank = &gpio_bank[i]; 1695 if (!pdev->dev.platform_data)
1829 spin_lock_init(&bank->lock); 1696 return -EINVAL;
1830 1697
1831 /* Static mapping, never released */ 1698 pdata = pdev->dev.platform_data;
1832 bank->base = ioremap(bank->pbase, bank_size);
1833 if (!bank->base) {
1834 printk(KERN_ERR "Could not ioremap gpio bank%i\n", i);
1835 continue;
1836 }
1837 1699
1838 if (bank_is_mpuio(bank)) 1700 if (!gpio_init_done) {
1839 __raw_writew(0xffff, bank->base + OMAP_MPUIO_GPIO_MASKIT); 1701 int ret;
1840 if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) {
1841 __raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
1842 __raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
1843 }
1844 if (cpu_is_omap16xx() && bank->method == METHOD_GPIO_1610) {
1845 __raw_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
1846 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
1847 __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG);
1848 }
1849 if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_7XX) {
1850 __raw_writel(0xffffffff, bank->base + OMAP7XX_GPIO_INT_MASK);
1851 __raw_writel(0x00000000, bank->base + OMAP7XX_GPIO_INT_STATUS);
1852 1702
1853 gpio_count = 32; /* 7xx has 32-bit GPIOs */ 1703 ret = init_gpio_info(pdev);
1854 } 1704 if (ret)
1705 return ret;
1706 }
1855 1707
1856#ifdef CONFIG_ARCH_OMAP2PLUS 1708 id = pdev->id;
1857 if ((bank->method == METHOD_GPIO_24XX) || 1709 bank = &gpio_bank[id];
1858 (bank->method == METHOD_GPIO_44XX)) {
1859 static const u32 non_wakeup_gpios[] = {
1860 0xe203ffc0, 0x08700040
1861 };
1862 1710
1863 if (cpu_is_omap44xx()) { 1711 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1864 __raw_writel(0xffffffff, bank->base + 1712 if (unlikely(!res)) {
1865 OMAP4_GPIO_IRQSTATUSCLR0); 1713 dev_err(&pdev->dev, "GPIO Bank %i Invalid IRQ resource\n", id);
1866 __raw_writew(0x0015, bank->base + 1714 return -ENODEV;
1867 OMAP4_GPIO_SYSCONFIG); 1715 }
1868 __raw_writel(0x00000000, bank->base +
1869 OMAP4_GPIO_DEBOUNCENABLE);
1870 /*
1871 * Initialize interface clock ungated,
1872 * module enabled
1873 */
1874 __raw_writel(0, bank->base + OMAP4_GPIO_CTRL);
1875 } else {
1876 __raw_writel(0x00000000, bank->base +
1877 OMAP24XX_GPIO_IRQENABLE1);
1878 __raw_writel(0xffffffff, bank->base +
1879 OMAP24XX_GPIO_IRQSTATUS1);
1880 __raw_writew(0x0015, bank->base +
1881 OMAP24XX_GPIO_SYSCONFIG);
1882 __raw_writel(0x00000000, bank->base +
1883 OMAP24XX_GPIO_DEBOUNCE_EN);
1884
1885 /*
1886 * Initialize interface clock ungated,
1887 * module enabled
1888 */
1889 __raw_writel(0, bank->base +
1890 OMAP24XX_GPIO_CTRL);
1891 }
1892 if (cpu_is_omap24xx() &&
1893 i < ARRAY_SIZE(non_wakeup_gpios))
1894 bank->non_wakeup_gpios = non_wakeup_gpios[i];
1895 gpio_count = 32;
1896 }
1897#endif
1898 1716
1899 bank->mod_usage = 0; 1717 bank->irq = res->start;
1900 /* REVISIT eventually switch from OMAP-specific gpio structs 1718 bank->virtual_irq_start = pdata->virtual_irq_start;
1901 * over to the generic ones 1719 bank->method = pdata->bank_type;
1902 */ 1720 bank->dev = &pdev->dev;
1903 bank->chip.request = omap_gpio_request; 1721 bank->dbck_flag = pdata->dbck_flag;
1904 bank->chip.free = omap_gpio_free; 1722 bank->stride = pdata->bank_stride;
1905 bank->chip.direction_input = gpio_input; 1723 bank_width = pdata->bank_width;
1906 bank->chip.get = gpio_get;
1907 bank->chip.direction_output = gpio_output;
1908 bank->chip.set_debounce = gpio_debounce;
1909 bank->chip.set = gpio_set;
1910 bank->chip.to_irq = gpio_2irq;
1911 if (bank_is_mpuio(bank)) {
1912 bank->chip.label = "mpuio";
1913#ifdef CONFIG_ARCH_OMAP16XX
1914 bank->chip.dev = &omap_mpuio_device.dev;
1915#endif
1916 bank->chip.base = OMAP_MPUIO(0);
1917 } else {
1918 bank->chip.label = "gpio";
1919 bank->chip.base = gpio;
1920 gpio += gpio_count;
1921 }
1922 bank->chip.ngpio = gpio_count;
1923 1724
1924 gpiochip_add(&bank->chip); 1725 spin_lock_init(&bank->lock);
1925 1726
1926 for (j = bank->virtual_irq_start; 1727 /* Static mapping, never released */
1927 j < bank->virtual_irq_start + gpio_count; j++) { 1728 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1928 lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class); 1729 if (unlikely(!res)) {
1929 set_irq_chip_data(j, bank); 1730 dev_err(&pdev->dev, "GPIO Bank %i Invalid mem resource\n", id);
1930 if (bank_is_mpuio(bank)) 1731 return -ENODEV;
1931 set_irq_chip(j, &mpuio_irq_chip);
1932 else
1933 set_irq_chip(j, &gpio_irq_chip);
1934 set_irq_handler(j, handle_simple_irq);
1935 set_irq_flags(j, IRQF_VALID);
1936 }
1937 set_irq_chained_handler(bank->irq, gpio_irq_handler);
1938 set_irq_data(bank->irq, bank);
1939
1940 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
1941 sprintf(clk_name, "gpio%d_dbck", i + 1);
1942 bank->dbck = clk_get(NULL, clk_name);
1943 if (IS_ERR(bank->dbck))
1944 printk(KERN_ERR "Could not get %s\n", clk_name);
1945 }
1946 } 1732 }
1947 1733
1948 /* Enable system clock for GPIO module. 1734 bank->base = ioremap(res->start, resource_size(res));
1949 * The CAM_CLK_CTRL *is* really the right place. */ 1735 if (!bank->base) {
1950 if (cpu_is_omap16xx()) 1736 dev_err(&pdev->dev, "Could not ioremap gpio bank%i\n", id);
1951 omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, ULPD_CAM_CLK_CTRL); 1737 return -ENOMEM;
1738 }
1952 1739
1953 /* Enable autoidle for the OCP interface */ 1740 pm_runtime_enable(bank->dev);
1954 if (cpu_is_omap24xx()) 1741 pm_runtime_get_sync(bank->dev);
1955 omap_writel(1 << 0, 0x48019010); 1742
1956 if (cpu_is_omap34xx()) 1743 omap_gpio_mod_init(bank, id);
1957 omap_writel(1 << 0, 0x48306814); 1744 omap_gpio_chip_init(bank);
1745 omap_gpio_show_rev(bank);
1958 1746
1959 omap_gpio_show_rev(); 1747 if (!gpio_init_done)
1748 gpio_init_done = 1;
1960 1749
1961 return 0; 1750 return 0;
1962} 1751}
@@ -2074,7 +1863,7 @@ static struct sys_device omap_gpio_device = {
2074 1863
2075static int workaround_enabled; 1864static int workaround_enabled;
2076 1865
2077void omap2_gpio_prepare_for_idle(int power_state) 1866void omap2_gpio_prepare_for_idle(int off_mode)
2078{ 1867{
2079 int i, c = 0; 1868 int i, c = 0;
2080 int min = 0; 1869 int min = 0;
@@ -2090,7 +1879,7 @@ void omap2_gpio_prepare_for_idle(int power_state)
2090 for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) 1879 for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
2091 clk_disable(bank->dbck); 1880 clk_disable(bank->dbck);
2092 1881
2093 if (power_state > PWRDM_POWER_OFF) 1882 if (!off_mode)
2094 continue; 1883 continue;
2095 1884
2096 /* If going to OFF, remove triggering for all 1885 /* If going to OFF, remove triggering for all
@@ -2251,8 +2040,6 @@ void omap_gpio_save_context(void)
2251 /* saving banks from 2-6 only since GPIO1 is in WKUP */ 2040 /* saving banks from 2-6 only since GPIO1 is in WKUP */
2252 for (i = 1; i < gpio_bank_count; i++) { 2041 for (i = 1; i < gpio_bank_count; i++) {
2253 struct gpio_bank *bank = &gpio_bank[i]; 2042 struct gpio_bank *bank = &gpio_bank[i];
2254 gpio_context[i].sysconfig =
2255 __raw_readl(bank->base + OMAP24XX_GPIO_SYSCONFIG);
2256 gpio_context[i].irqenable1 = 2043 gpio_context[i].irqenable1 =
2257 __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1); 2044 __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1);
2258 gpio_context[i].irqenable2 = 2045 gpio_context[i].irqenable2 =
@@ -2283,8 +2070,6 @@ void omap_gpio_restore_context(void)
2283 2070
2284 for (i = 1; i < gpio_bank_count; i++) { 2071 for (i = 1; i < gpio_bank_count; i++) {
2285 struct gpio_bank *bank = &gpio_bank[i]; 2072 struct gpio_bank *bank = &gpio_bank[i];
2286 __raw_writel(gpio_context[i].sysconfig,
2287 bank->base + OMAP24XX_GPIO_SYSCONFIG);
2288 __raw_writel(gpio_context[i].irqenable1, 2073 __raw_writel(gpio_context[i].irqenable1,
2289 bank->base + OMAP24XX_GPIO_IRQENABLE1); 2074 bank->base + OMAP24XX_GPIO_IRQENABLE1);
2290 __raw_writel(gpio_context[i].irqenable2, 2075 __raw_writel(gpio_context[i].irqenable2,
@@ -2309,25 +2094,28 @@ void omap_gpio_restore_context(void)
2309} 2094}
2310#endif 2095#endif
2311 2096
2097static struct platform_driver omap_gpio_driver = {
2098 .probe = omap_gpio_probe,
2099 .driver = {
2100 .name = "omap_gpio",
2101 },
2102};
2103
2312/* 2104/*
2313 * This may get called early from board specific init 2105 * gpio driver register needs to be done before
2314 * for boards that have interrupts routed via FPGA. 2106 * machine_init functions access gpio APIs.
2107 * Hence omap_gpio_drv_reg() is a postcore_initcall.
2315 */ 2108 */
2316int __init omap_gpio_init(void) 2109static int __init omap_gpio_drv_reg(void)
2317{ 2110{
2318 if (!initialized) 2111 return platform_driver_register(&omap_gpio_driver);
2319 return _omap_gpio_init();
2320 else
2321 return 0;
2322} 2112}
2113postcore_initcall(omap_gpio_drv_reg);
2323 2114
2324static int __init omap_gpio_sysinit(void) 2115static int __init omap_gpio_sysinit(void)
2325{ 2116{
2326 int ret = 0; 2117 int ret = 0;
2327 2118
2328 if (!initialized)
2329 ret = _omap_gpio_init();
2330
2331 mpuio_init(); 2119 mpuio_init();
2332 2120
2333#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 2121#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index a5ce4f0aad35..a4f8003de664 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -27,20 +27,20 @@
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/i2c-omap.h> 29#include <linux/i2c-omap.h>
30#include <linux/slab.h>
31#include <linux/err.h>
32#include <linux/clk.h>
30 33
31#include <mach/irqs.h> 34#include <mach/irqs.h>
32#include <plat/mux.h> 35#include <plat/mux.h>
33#include <plat/i2c.h> 36#include <plat/i2c.h>
34#include <plat/omap-pm.h> 37#include <plat/omap-pm.h>
38#include <plat/omap_device.h>
35 39
36#define OMAP_I2C_SIZE 0x3f 40#define OMAP_I2C_SIZE 0x3f
37#define OMAP1_I2C_BASE 0xfffb3800 41#define OMAP1_I2C_BASE 0xfffb3800
38#define OMAP2_I2C_BASE1 0x48070000
39#define OMAP2_I2C_BASE2 0x48072000
40#define OMAP2_I2C_BASE3 0x48060000
41#define OMAP4_I2C_BASE4 0x48350000
42 42
43static const char name[] = "i2c_omap"; 43static const char name[] = "omap_i2c";
44 44
45#define I2C_RESOURCE_BUILDER(base, irq) \ 45#define I2C_RESOURCE_BUILDER(base, irq) \
46 { \ 46 { \
@@ -55,15 +55,6 @@ static const char name[] = "i2c_omap";
55 55
56static struct resource i2c_resources[][2] = { 56static struct resource i2c_resources[][2] = {
57 { I2C_RESOURCE_BUILDER(0, 0) }, 57 { I2C_RESOURCE_BUILDER(0, 0) },
58#if defined(CONFIG_ARCH_OMAP2PLUS)
59 { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE2, 0) },
60#endif
61#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
62 { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE3, 0) },
63#endif
64#if defined(CONFIG_ARCH_OMAP4)
65 { I2C_RESOURCE_BUILDER(OMAP4_I2C_BASE4, 0) },
66#endif
67}; 58};
68 59
69#define I2C_DEV_BUILDER(bus_id, res, data) \ 60#define I2C_DEV_BUILDER(bus_id, res, data) \
@@ -77,18 +68,11 @@ static struct resource i2c_resources[][2] = {
77 }, \ 68 }, \
78 } 69 }
79 70
80static struct omap_i2c_bus_platform_data i2c_pdata[ARRAY_SIZE(i2c_resources)]; 71#define MAX_OMAP_I2C_HWMOD_NAME_LEN 16
72#define OMAP_I2C_MAX_CONTROLLERS 4
73static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS];
81static struct platform_device omap_i2c_devices[] = { 74static struct platform_device omap_i2c_devices[] = {
82 I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]), 75 I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]),
83#if defined(CONFIG_ARCH_OMAP2PLUS)
84 I2C_DEV_BUILDER(2, i2c_resources[1], &i2c_pdata[1]),
85#endif
86#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
87 I2C_DEV_BUILDER(3, i2c_resources[2], &i2c_pdata[2]),
88#endif
89#if defined(CONFIG_ARCH_OMAP4)
90 I2C_DEV_BUILDER(4, i2c_resources[3], &i2c_pdata[3]),
91#endif
92}; 76};
93 77
94#define OMAP_I2C_CMDLINE_SETUP (BIT(31)) 78#define OMAP_I2C_CMDLINE_SETUP (BIT(31))
@@ -109,35 +93,25 @@ static int __init omap_i2c_nr_ports(void)
109 return ports; 93 return ports;
110} 94}
111 95
112/* Shared between omap2 and 3 */ 96static inline int omap1_i2c_add_bus(int bus_id)
113static resource_size_t omap2_i2c_irq[3] __initdata = {
114 INT_24XX_I2C1_IRQ,
115 INT_24XX_I2C2_IRQ,
116 INT_34XX_I2C3_IRQ,
117};
118
119static resource_size_t omap4_i2c_irq[4] __initdata = {
120 OMAP44XX_IRQ_I2C1,
121 OMAP44XX_IRQ_I2C2,
122 OMAP44XX_IRQ_I2C3,
123 OMAP44XX_IRQ_I2C4,
124};
125
126static inline int omap1_i2c_add_bus(struct platform_device *pdev, int bus_id)
127{ 97{
128 struct omap_i2c_bus_platform_data *pd; 98 struct platform_device *pdev;
99 struct omap_i2c_bus_platform_data *pdata;
129 struct resource *res; 100 struct resource *res;
130 101
131 pd = pdev->dev.platform_data; 102 omap1_i2c_mux_pins(bus_id);
103
104 pdev = &omap_i2c_devices[bus_id - 1];
132 res = pdev->resource; 105 res = pdev->resource;
133 res[0].start = OMAP1_I2C_BASE; 106 res[0].start = OMAP1_I2C_BASE;
134 res[0].end = res[0].start + OMAP_I2C_SIZE; 107 res[0].end = res[0].start + OMAP_I2C_SIZE;
135 res[1].start = INT_I2C; 108 res[1].start = INT_I2C;
136 omap1_i2c_mux_pins(bus_id); 109 pdata = &i2c_pdata[bus_id - 1];
137 110
138 return platform_device_register(pdev); 111 return platform_device_register(pdev);
139} 112}
140 113
114
141/* 115/*
142 * XXX This function is a temporary compatibility wrapper - only 116 * XXX This function is a temporary compatibility wrapper - only
143 * needed until the I2C driver can be converted to call 117 * needed until the I2C driver can be converted to call
@@ -148,52 +122,64 @@ static void omap_pm_set_max_mpu_wakeup_lat_compat(struct device *dev, long t)
148 omap_pm_set_max_mpu_wakeup_lat(dev, t); 122 omap_pm_set_max_mpu_wakeup_lat(dev, t);
149} 123}
150 124
151static inline int omap2_i2c_add_bus(struct platform_device *pdev, int bus_id) 125static struct omap_device_pm_latency omap_i2c_latency[] = {
152{ 126 [0] = {
153 struct resource *res; 127 .deactivate_func = omap_device_idle_hwmods,
154 resource_size_t *irq; 128 .activate_func = omap_device_enable_hwmods,
129 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
130 },
131};
155 132
156 res = pdev->resource; 133#ifdef CONFIG_ARCH_OMAP2PLUS
134static inline int omap2_i2c_add_bus(int bus_id)
135{
136 int l;
137 struct omap_hwmod *oh;
138 struct omap_device *od;
139 char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN];
140 struct omap_i2c_bus_platform_data *pdata;
157 141
158 if (!cpu_is_omap44xx()) 142 omap2_i2c_mux_pins(bus_id);
159 irq = omap2_i2c_irq;
160 else
161 irq = omap4_i2c_irq;
162 143
163 if (bus_id == 1) { 144 l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id);
164 res[0].start = OMAP2_I2C_BASE1; 145 WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN,
165 res[0].end = res[0].start + OMAP_I2C_SIZE; 146 "String buffer overflow in I2C%d device setup\n", bus_id);
147 oh = omap_hwmod_lookup(oh_name);
148 if (!oh) {
149 pr_err("Could not look up %s\n", oh_name);
150 return -EEXIST;
166 } 151 }
167 152
168 res[1].start = irq[bus_id - 1]; 153 pdata = &i2c_pdata[bus_id - 1];
169 omap2_i2c_mux_pins(bus_id);
170
171 /* 154 /*
172 * When waiting for completion of a i2c transfer, we need to 155 * When waiting for completion of a i2c transfer, we need to
173 * set a wake up latency constraint for the MPU. This is to 156 * set a wake up latency constraint for the MPU. This is to
174 * ensure quick enough wakeup from idle, when transfer 157 * ensure quick enough wakeup from idle, when transfer
175 * completes. 158 * completes.
159 * Only omap3 has support for constraints
176 */ 160 */
177 if (cpu_is_omap34xx()) { 161 if (cpu_is_omap34xx())
178 struct omap_i2c_bus_platform_data *pd; 162 pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
179 163 od = omap_device_build(name, bus_id, oh, pdata,
180 pd = pdev->dev.platform_data; 164 sizeof(struct omap_i2c_bus_platform_data),
181 pd->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat; 165 omap_i2c_latency, ARRAY_SIZE(omap_i2c_latency), 0);
182 } 166 WARN(IS_ERR(od), "Could not build omap_device for %s\n", name);
183 167
184 return platform_device_register(pdev); 168 return PTR_ERR(od);
185} 169}
170#else
171static inline int omap2_i2c_add_bus(int bus_id)
172{
173 return 0;
174}
175#endif
186 176
187static int __init omap_i2c_add_bus(int bus_id) 177static int __init omap_i2c_add_bus(int bus_id)
188{ 178{
189 struct platform_device *pdev;
190
191 pdev = &omap_i2c_devices[bus_id - 1];
192
193 if (cpu_class_is_omap1()) 179 if (cpu_class_is_omap1())
194 return omap1_i2c_add_bus(pdev, bus_id); 180 return omap1_i2c_add_bus(bus_id);
195 else 181 else
196 return omap2_i2c_add_bus(pdev, bus_id); 182 return omap2_i2c_add_bus(bus_id);
197} 183}
198 184
199/** 185/**
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 4b2028ab4d2b..256ab3f1ec8f 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -31,18 +31,18 @@ struct omap_clk {
31#define CK_1510 (1 << 2) 31#define CK_1510 (1 << 2)
32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */ 32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */
33#define CK_242X (1 << 4) 33#define CK_242X (1 << 4)
34#define CK_243X (1 << 5) 34#define CK_243X (1 << 5) /* 243x, 253x */
35#define CK_3XXX (1 << 6) /* OMAP3 + AM3 common clocks*/ 35#define CK_3430ES1 (1 << 6) /* 34xxES1 only */
36#define CK_343X (1 << 7) /* OMAP34xx common clocks */ 36#define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */
37#define CK_3430ES1 (1 << 8) /* 34xxES1 only */ 37#define CK_3505 (1 << 8)
38#define CK_3430ES2 (1 << 9) /* 34xxES2, ES3, non-Sitara 35xx only */ 38#define CK_3517 (1 << 9)
39#define CK_3505 (1 << 10) 39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
40#define CK_3517 (1 << 11) 40#define CK_443X (1 << 11)
41#define CK_36XX (1 << 12) /* OMAP36xx/37xx-specific clocks */
42#define CK_443X (1 << 13)
43 41
44#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
45 42
43#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
44#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
45#define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX)
46 46
47 47
48#endif 48#endif
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index fef4696dcf67..8eb0adab19ea 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -49,13 +49,18 @@ struct clkops {
49/* struct clksel_rate.flags possibilities */ 49/* struct clksel_rate.flags possibilities */
50#define RATE_IN_242X (1 << 0) 50#define RATE_IN_242X (1 << 0)
51#define RATE_IN_243X (1 << 1) 51#define RATE_IN_243X (1 << 1)
52#define RATE_IN_3XXX (1 << 2) /* rates common to all OMAP3 */ 52#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
53#define RATE_IN_3430ES2 (1 << 3) /* 3430ES2 rates only */ 53#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
54#define RATE_IN_36XX (1 << 4) 54#define RATE_IN_36XX (1 << 4)
55#define RATE_IN_4430 (1 << 5) 55#define RATE_IN_4430 (1 << 5)
56 56
57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
58#define RATE_IN_3430ES2PLUS (RATE_IN_3430ES2 | RATE_IN_36XX) 58#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
59#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
60
61/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
62#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
63
59 64
60/** 65/**
61 * struct clksel_rate - register bitfield values corresponding to clk divisors 66 * struct clksel_rate - register bitfield values corresponding to clk divisors
@@ -119,8 +124,7 @@ struct clksel {
119 * 124 *
120 * Possible values for @flags: 125 * Possible values for @flags:
121 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs) 126 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
122 * NO_DCO_SEL: don't program DCO (only for some J-type DPLLs) 127 *
123
124 * @freqsel_mask is only used on the OMAP34xx family and AM35xx. 128 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
125 * 129 *
126 * XXX Some DPLLs have multiple bypass inputs, so it's not technically 130 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
@@ -156,6 +160,8 @@ struct dpll_data {
156 u32 autoidle_mask; 160 u32 autoidle_mask;
157 u32 freqsel_mask; 161 u32 freqsel_mask;
158 u32 idlest_mask; 162 u32 idlest_mask;
163 u32 dco_mask;
164 u32 sddiv_mask;
159 u8 auto_recal_bit; 165 u8 auto_recal_bit;
160 u8 recal_en_bit; 166 u8 recal_en_bit;
161 u8 recal_st_bit; 167 u8 recal_st_bit;
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index a9d69a09920d..6b8088ec74af 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -27,6 +27,8 @@
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H 27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H 28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29 29
30#include <linux/delay.h>
31
30#include <plat/i2c.h> 32#include <plat/i2c.h>
31 33
32struct sys_timer; 34struct sys_timer;
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index 0cce4ca83aa0..d1c916fcf770 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -21,141 +21,15 @@
21#ifndef __ASM_ARCH_DMA_H 21#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H 22#define __ASM_ARCH_DMA_H
23 23
24/* Move omap4 specific defines to dma-44xx.h */ 24#include <linux/platform_device.h>
25#include "dma-44xx.h"
26 25
27/* Hardware registers for omap1 */ 26/*
28#define OMAP1_DMA_BASE (0xfffed800) 27 * TODO: These dma channel defines should go away once all
29 28 * the omap drivers hwmod adapted.
30#define OMAP1_DMA_GCR 0x400 29 */
31#define OMAP1_DMA_GSCR 0x404
32#define OMAP1_DMA_GRST 0x408
33#define OMAP1_DMA_HW_ID 0x442
34#define OMAP1_DMA_PCH2_ID 0x444
35#define OMAP1_DMA_PCH0_ID 0x446
36#define OMAP1_DMA_PCH1_ID 0x448
37#define OMAP1_DMA_PCHG_ID 0x44a
38#define OMAP1_DMA_PCHD_ID 0x44c
39#define OMAP1_DMA_CAPS_0_U 0x44e
40#define OMAP1_DMA_CAPS_0_L 0x450
41#define OMAP1_DMA_CAPS_1_U 0x452
42#define OMAP1_DMA_CAPS_1_L 0x454
43#define OMAP1_DMA_CAPS_2 0x456
44#define OMAP1_DMA_CAPS_3 0x458
45#define OMAP1_DMA_CAPS_4 0x45a
46#define OMAP1_DMA_PCH2_SR 0x460
47#define OMAP1_DMA_PCH0_SR 0x480
48#define OMAP1_DMA_PCH1_SR 0x482
49#define OMAP1_DMA_PCHD_SR 0x4c0
50
51/* Hardware registers for omap2 and omap3 */
52#define OMAP24XX_DMA4_BASE (L4_24XX_BASE + 0x56000)
53#define OMAP34XX_DMA4_BASE (L4_34XX_BASE + 0x56000)
54#define OMAP44XX_DMA4_BASE (L4_44XX_BASE + 0x56000)
55
56#define OMAP_DMA4_REVISION 0x00
57#define OMAP_DMA4_GCR 0x78
58#define OMAP_DMA4_IRQSTATUS_L0 0x08
59#define OMAP_DMA4_IRQSTATUS_L1 0x0c
60#define OMAP_DMA4_IRQSTATUS_L2 0x10
61#define OMAP_DMA4_IRQSTATUS_L3 0x14
62#define OMAP_DMA4_IRQENABLE_L0 0x18
63#define OMAP_DMA4_IRQENABLE_L1 0x1c
64#define OMAP_DMA4_IRQENABLE_L2 0x20
65#define OMAP_DMA4_IRQENABLE_L3 0x24
66#define OMAP_DMA4_SYSSTATUS 0x28
67#define OMAP_DMA4_OCP_SYSCONFIG 0x2c
68#define OMAP_DMA4_CAPS_0 0x64
69#define OMAP_DMA4_CAPS_2 0x6c
70#define OMAP_DMA4_CAPS_3 0x70
71#define OMAP_DMA4_CAPS_4 0x74
72
73#define OMAP1_LOGICAL_DMA_CH_COUNT 17
74#define OMAP_DMA4_LOGICAL_DMA_CH_COUNT 32 /* REVISIT: Is this 32 + 2? */
75
76/* Common channel specific registers for omap1 */
77#define OMAP1_DMA_CH_BASE(n) (0x40 * (n) + 0x00)
78#define OMAP1_DMA_CSDP(n) (0x40 * (n) + 0x00)
79#define OMAP1_DMA_CCR(n) (0x40 * (n) + 0x02)
80#define OMAP1_DMA_CICR(n) (0x40 * (n) + 0x04)
81#define OMAP1_DMA_CSR(n) (0x40 * (n) + 0x06)
82#define OMAP1_DMA_CEN(n) (0x40 * (n) + 0x10)
83#define OMAP1_DMA_CFN(n) (0x40 * (n) + 0x12)
84#define OMAP1_DMA_CSFI(n) (0x40 * (n) + 0x14)
85#define OMAP1_DMA_CSEI(n) (0x40 * (n) + 0x16)
86#define OMAP1_DMA_CPC(n) (0x40 * (n) + 0x18) /* 15xx only */
87#define OMAP1_DMA_CSAC(n) (0x40 * (n) + 0x18)
88#define OMAP1_DMA_CDAC(n) (0x40 * (n) + 0x1a)
89#define OMAP1_DMA_CDEI(n) (0x40 * (n) + 0x1c)
90#define OMAP1_DMA_CDFI(n) (0x40 * (n) + 0x1e)
91#define OMAP1_DMA_CLNK_CTRL(n) (0x40 * (n) + 0x28)
92
93/* Common channel specific registers for omap2 */
94#define OMAP_DMA4_CH_BASE(n) (0x60 * (n) + 0x80)
95#define OMAP_DMA4_CCR(n) (0x60 * (n) + 0x80)
96#define OMAP_DMA4_CLNK_CTRL(n) (0x60 * (n) + 0x84)
97#define OMAP_DMA4_CICR(n) (0x60 * (n) + 0x88)
98#define OMAP_DMA4_CSR(n) (0x60 * (n) + 0x8c)
99#define OMAP_DMA4_CSDP(n) (0x60 * (n) + 0x90)
100#define OMAP_DMA4_CEN(n) (0x60 * (n) + 0x94)
101#define OMAP_DMA4_CFN(n) (0x60 * (n) + 0x98)
102#define OMAP_DMA4_CSEI(n) (0x60 * (n) + 0xa4)
103#define OMAP_DMA4_CSFI(n) (0x60 * (n) + 0xa8)
104#define OMAP_DMA4_CDEI(n) (0x60 * (n) + 0xac)
105#define OMAP_DMA4_CDFI(n) (0x60 * (n) + 0xb0)
106#define OMAP_DMA4_CSAC(n) (0x60 * (n) + 0xb4)
107#define OMAP_DMA4_CDAC(n) (0x60 * (n) + 0xb8)
108
109/* Channel specific registers only on omap1 */
110#define OMAP1_DMA_CSSA_L(n) (0x40 * (n) + 0x08)
111#define OMAP1_DMA_CSSA_U(n) (0x40 * (n) + 0x0a)
112#define OMAP1_DMA_CDSA_L(n) (0x40 * (n) + 0x0c)
113#define OMAP1_DMA_CDSA_U(n) (0x40 * (n) + 0x0e)
114#define OMAP1_DMA_COLOR_L(n) (0x40 * (n) + 0x20)
115#define OMAP1_DMA_COLOR_U(n) (0x40 * (n) + 0x22)
116#define OMAP1_DMA_CCR2(n) (0x40 * (n) + 0x24)
117#define OMAP1_DMA_LCH_CTRL(n) (0x40 * (n) + 0x2a) /* not on 15xx */
118#define OMAP1_DMA_CCEN(n) 0
119#define OMAP1_DMA_CCFN(n) 0
120
121/* Channel specific registers only on omap2 */
122#define OMAP_DMA4_CSSA(n) (0x60 * (n) + 0x9c)
123#define OMAP_DMA4_CDSA(n) (0x60 * (n) + 0xa0)
124#define OMAP_DMA4_CCEN(n) (0x60 * (n) + 0xbc)
125#define OMAP_DMA4_CCFN(n) (0x60 * (n) + 0xc0)
126#define OMAP_DMA4_COLOR(n) (0x60 * (n) + 0xc4)
127
128/* Additional registers available on OMAP4 */
129#define OMAP_DMA4_CDP(n) (0x60 * (n) + 0xd0)
130#define OMAP_DMA4_CNDP(n) (0x60 * (n) + 0xd4)
131#define OMAP_DMA4_CCDN(n) (0x60 * (n) + 0xd8)
132
133/* Dummy defines to keep multi-omap compiles happy */
134#define OMAP1_DMA_REVISION 0
135#define OMAP1_DMA_IRQSTATUS_L0 0
136#define OMAP1_DMA_IRQENABLE_L0 0
137#define OMAP1_DMA_OCP_SYSCONFIG 0
138#define OMAP_DMA4_HW_ID 0
139#define OMAP_DMA4_CAPS_0_L 0
140#define OMAP_DMA4_CAPS_0_U 0
141#define OMAP_DMA4_CAPS_1_L 0
142#define OMAP_DMA4_CAPS_1_U 0
143#define OMAP_DMA4_GSCR 0
144#define OMAP_DMA4_CPC(n) 0
145
146#define OMAP_DMA4_LCH_CTRL(n) 0
147#define OMAP_DMA4_COLOR_L(n) 0
148#define OMAP_DMA4_COLOR_U(n) 0
149#define OMAP_DMA4_CCR2(n) 0
150#define OMAP1_DMA_CSSA(n) 0
151#define OMAP1_DMA_CDSA(n) 0
152#define OMAP_DMA4_CSSA_L(n) 0
153#define OMAP_DMA4_CSSA_U(n) 0
154#define OMAP_DMA4_CDSA_L(n) 0
155#define OMAP_DMA4_CDSA_U(n) 0
156#define OMAP1_DMA_COLOR(n) 0
157 30
158/*----------------------------------------------------------------------------*/ 31/* Move omap4 specific defines to dma-44xx.h */
32#include "dma-44xx.h"
159 33
160/* DMA channels for omap1 */ 34/* DMA channels for omap1 */
161#define OMAP_DMA_NO_DEVICE 0 35#define OMAP_DMA_NO_DEVICE 0
@@ -405,6 +279,63 @@
405#define DMA_CH_PRIO_HIGH 0x1 279#define DMA_CH_PRIO_HIGH 0x1
406#define DMA_CH_PRIO_LOW 0x0 /* Def */ 280#define DMA_CH_PRIO_LOW 0x0 /* Def */
407 281
282/* Errata handling */
283#define IS_DMA_ERRATA(id) (errata & (id))
284#define SET_DMA_ERRATA(id) (errata |= (id))
285
286#define DMA_ERRATA_IFRAME_BUFFERING BIT(0x0)
287#define DMA_ERRATA_PARALLEL_CHANNELS BIT(0x1)
288#define DMA_ERRATA_i378 BIT(0x2)
289#define DMA_ERRATA_i541 BIT(0x3)
290#define DMA_ERRATA_i88 BIT(0x4)
291#define DMA_ERRATA_3_3 BIT(0x5)
292#define DMA_ROMCODE_BUG BIT(0x6)
293
294/* Attributes for OMAP DMA Contrller */
295#define DMA_LINKED_LCH BIT(0x0)
296#define GLOBAL_PRIORITY BIT(0x1)
297#define RESERVE_CHANNEL BIT(0x2)
298#define IS_CSSA_32 BIT(0x3)
299#define IS_CDSA_32 BIT(0x4)
300#define IS_RW_PRIORITY BIT(0x5)
301#define ENABLE_1510_MODE BIT(0x6)
302#define SRC_PORT BIT(0x7)
303#define DST_PORT BIT(0x8)
304#define SRC_INDEX BIT(0x9)
305#define DST_INDEX BIT(0xA)
306#define IS_BURST_ONLY4 BIT(0xB)
307#define CLEAR_CSR_ON_READ BIT(0xC)
308#define IS_WORD_16 BIT(0xD)
309
310enum omap_reg_offsets {
311
312GCR, GSCR, GRST1, HW_ID,
313PCH2_ID, PCH0_ID, PCH1_ID, PCHG_ID,
314PCHD_ID, CAPS_0, CAPS_1, CAPS_2,
315CAPS_3, CAPS_4, PCH2_SR, PCH0_SR,
316PCH1_SR, PCHD_SR, REVISION, IRQSTATUS_L0,
317IRQSTATUS_L1, IRQSTATUS_L2, IRQSTATUS_L3, IRQENABLE_L0,
318IRQENABLE_L1, IRQENABLE_L2, IRQENABLE_L3, SYSSTATUS,
319OCP_SYSCONFIG,
320
321/* omap1+ specific */
322CPC, CCR2, LCH_CTRL,
323
324/* Common registers for all omap's */
325CSDP, CCR, CICR, CSR,
326CEN, CFN, CSFI, CSEI,
327CSAC, CDAC, CDEI,
328CDFI, CLNK_CTRL,
329
330/* Channel specific registers */
331CSSA, CDSA, COLOR,
332CCEN, CCFN,
333
334/* omap3630 and omap4 specific */
335CDP, CNDP, CCDN,
336
337};
338
408enum omap_dma_burst_mode { 339enum omap_dma_burst_mode {
409 OMAP_DMA_DATA_BURST_DIS = 0, 340 OMAP_DMA_DATA_BURST_DIS = 0,
410 OMAP_DMA_DATA_BURST_4, 341 OMAP_DMA_DATA_BURST_4,
@@ -470,6 +401,41 @@ struct omap_dma_channel_params {
470#endif 401#endif
471}; 402};
472 403
404struct omap_dma_lch {
405 int next_lch;
406 int dev_id;
407 u16 saved_csr;
408 u16 enabled_irqs;
409 const char *dev_name;
410 void (*callback)(int lch, u16 ch_status, void *data);
411 void *data;
412 long flags;
413 /* required for Dynamic chaining */
414 int prev_linked_ch;
415 int next_linked_ch;
416 int state;
417 int chain_id;
418 int status;
419};
420
421struct omap_dma_dev_attr {
422 u32 dev_caps;
423 u16 lch_count;
424 u16 chan_count;
425 struct omap_dma_lch *chan;
426};
427
428/* System DMA platform data structure */
429struct omap_system_dma_plat_info {
430 struct omap_dma_dev_attr *dma_attr;
431 u32 errata;
432 void (*disable_irq_lch)(int lch);
433 void (*show_dma_caps)(void);
434 void (*clear_lch_regs)(int lch);
435 void (*clear_dma)(int lch);
436 void (*dma_write)(u32 val, int reg, int lch);
437 u32 (*dma_read)(int reg, int lch);
438};
473 439
474extern void omap_set_dma_priority(int lch, int dst_port, int priority); 440extern void omap_set_dma_priority(int lch, int dst_port, int priority);
475extern int omap_request_dma(int dev_id, const char *dev_name, 441extern int omap_request_dma(int dev_id, const char *dev_name,
diff --git a/arch/arm/plat-omap/include/plat/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
index f1864a652f7a..ae39bcb3f5ba 100644
--- a/arch/arm/plat-omap/include/plat/fpga.h
+++ b/arch/arm/plat-omap/include/plat/fpga.h
@@ -19,11 +19,7 @@
19#ifndef __ASM_ARCH_OMAP_FPGA_H 19#ifndef __ASM_ARCH_OMAP_FPGA_H
20#define __ASM_ARCH_OMAP_FPGA_H 20#define __ASM_ARCH_OMAP_FPGA_H
21 21
22#if defined(CONFIG_MACH_OMAP_INNOVATOR) && defined(CONFIG_ARCH_OMAP15XX)
23extern void omap1510_fpga_init_irq(void); 22extern void omap1510_fpga_init_irq(void);
24#else
25#define omap1510_fpga_init_irq() (0)
26#endif
27 23
28#define fpga_read(reg) __raw_readb(reg) 24#define fpga_read(reg) __raw_readb(reg)
29#define fpga_write(val, reg) __raw_writeb(val, reg) 25#define fpga_write(val, reg) __raw_writeb(val, reg)
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index de1c604962eb..d6f9fa0f62af 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -27,26 +27,15 @@
27#define __ASM_ARCH_OMAP_GPIO_H 27#define __ASM_ARCH_OMAP_GPIO_H
28 28
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/platform_device.h>
30#include <mach/irqs.h> 31#include <mach/irqs.h>
31 32
32#define OMAP1_MPUIO_BASE 0xfffb5000 33#define OMAP1_MPUIO_BASE 0xfffb5000
33 34
34#if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)) 35/*
35 36 * These are the omap15xx/16xx offsets. The omap7xx offset are
36#define OMAP_MPUIO_INPUT_LATCH 0x00 37 * OMAP_MPUIO_ / 2 offsets below.
37#define OMAP_MPUIO_OUTPUT 0x02 38 */
38#define OMAP_MPUIO_IO_CNTL 0x04
39#define OMAP_MPUIO_KBR_LATCH 0x08
40#define OMAP_MPUIO_KBC 0x0a
41#define OMAP_MPUIO_GPIO_EVENT_MODE 0x0c
42#define OMAP_MPUIO_GPIO_INT_EDGE 0x0e
43#define OMAP_MPUIO_KBD_INT 0x10
44#define OMAP_MPUIO_GPIO_INT 0x12
45#define OMAP_MPUIO_KBD_MASKIT 0x14
46#define OMAP_MPUIO_GPIO_MASKIT 0x16
47#define OMAP_MPUIO_GPIO_DEBOUNCING 0x18
48#define OMAP_MPUIO_LATCH 0x1a
49#else
50#define OMAP_MPUIO_INPUT_LATCH 0x00 39#define OMAP_MPUIO_INPUT_LATCH 0x00
51#define OMAP_MPUIO_OUTPUT 0x04 40#define OMAP_MPUIO_OUTPUT 0x04
52#define OMAP_MPUIO_IO_CNTL 0x08 41#define OMAP_MPUIO_IO_CNTL 0x08
@@ -60,7 +49,6 @@
60#define OMAP_MPUIO_GPIO_MASKIT 0x2c 49#define OMAP_MPUIO_GPIO_MASKIT 0x2c
61#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30 50#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
62#define OMAP_MPUIO_LATCH 0x34 51#define OMAP_MPUIO_LATCH 0x34
63#endif
64 52
65#define OMAP34XX_NR_GPIOS 6 53#define OMAP34XX_NR_GPIOS 6
66 54
@@ -71,8 +59,30 @@
71 IH_MPUIO_BASE + ((nr) & 0x0f) : \ 59 IH_MPUIO_BASE + ((nr) & 0x0f) : \
72 IH_GPIO_BASE + (nr)) 60 IH_GPIO_BASE + (nr))
73 61
74extern int omap_gpio_init(void); /* Call from board init only */ 62#define METHOD_MPUIO 0
75extern void omap2_gpio_prepare_for_idle(int power_state); 63#define METHOD_GPIO_1510 1
64#define METHOD_GPIO_1610 2
65#define METHOD_GPIO_7XX 3
66#define METHOD_GPIO_24XX 5
67#define METHOD_GPIO_44XX 6
68
69struct omap_gpio_dev_attr {
70 int bank_width; /* GPIO bank width */
71 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
72};
73
74struct omap_gpio_platform_data {
75 u16 virtual_irq_start;
76 int bank_type;
77 int bank_width; /* GPIO bank width */
78 int bank_stride; /* Only needed for omap1 MPUIO */
79 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
80};
81
82/* TODO: Analyze removing gpio_bank_count usage from driver code */
83extern int gpio_bank_count;
84
85extern void omap2_gpio_prepare_for_idle(int off_mode);
76extern void omap2_gpio_resume_after_idle(void); 86extern void omap2_gpio_resume_after_idle(void);
77extern void omap_set_gpio_debounce(int gpio, int enable); 87extern void omap_set_gpio_debounce(int gpio, int enable);
78extern void omap_set_gpio_debounce_time(int gpio, int enable); 88extern void omap_set_gpio_debounce_time(int gpio, int enable);
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 9fd99b9e40ab..85ded598853e 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -80,12 +80,12 @@
80#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) 80#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
81 81
82/* 82/*
83 * Note that all values in this struct are in nanoseconds, while 83 * Note that all values in this struct are in nanoseconds except sync_clk
84 * the register values are in gpmc_fck cycles. 84 * (which is in picoseconds), while the register values are in gpmc_fck cycles.
85 */ 85 */
86struct gpmc_timings { 86struct gpmc_timings {
87 /* Minimum clock period for synchronous mode */ 87 /* Minimum clock period for synchronous mode (in picoseconds) */
88 u16 sync_clk; 88 u32 sync_clk;
89 89
90 /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */ 90 /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
91 u16 cs_on; /* Assertion time */ 91 u16 cs_on; /* Assertion time */
@@ -117,6 +117,7 @@ struct gpmc_timings {
117}; 117};
118 118
119extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); 119extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
120extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
120extern unsigned int gpmc_ticks_to_ns(unsigned int ticks); 121extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
121extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns); 122extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
122extern unsigned long gpmc_get_fclk_period(void); 123extern unsigned long gpmc_get_fclk_period(void);
diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h
index 36a0befd6168..878d632c4092 100644
--- a/arch/arm/plat-omap/include/plat/i2c.h
+++ b/arch/arm/plat-omap/include/plat/i2c.h
@@ -36,6 +36,19 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
36} 36}
37#endif 37#endif
38 38
39/**
40 * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod
41 * @fifo_depth: total controller FIFO size (in bytes)
42 * @flags: differences in hardware support capability
43 *
44 * @fifo_depth represents what exists on the hardware, not what is
45 * actually configured at runtime by the device driver.
46 */
47struct omap_i2c_dev_attr {
48 u8 fifo_depth;
49 u8 flags;
50};
51
39void __init omap1_i2c_mux_pins(int bus_id); 52void __init omap1_i2c_mux_pins(int bus_id);
40void __init omap2_i2c_mux_pins(int bus_id); 53void __init omap2_i2c_mux_pins(int bus_id);
41 54
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 204865f91d93..ef4106c13183 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -291,8 +291,9 @@ static inline void omap44xx_map_common_io(void)
291} 291}
292#endif 292#endif
293 293
294extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, 294extern void omap2_init_common_infrastructure(void);
295 struct omap_sdrc_params *sdrc_cs1); 295extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
296 struct omap_sdrc_params *sdrc_cs1);
296 297
297#define __arch_ioremap omap_ioremap 298#define __arch_ioremap omap_ioremap
298#define __arch_iounmap omap_iounmap 299#define __arch_iounmap omap_iounmap
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index 33c7d41cb6a5..69230d685538 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -50,6 +50,8 @@ struct iommu {
50 int (*isr)(struct iommu *obj); 50 int (*isr)(struct iommu *obj);
51 51
52 void *ctx; /* iommu context: registres saved area */ 52 void *ctx; /* iommu context: registres saved area */
53 u32 da_start;
54 u32 da_end;
53}; 55};
54 56
55struct cr_regs { 57struct cr_regs {
@@ -103,6 +105,8 @@ struct iommu_platform_data {
103 const char *name; 105 const char *name;
104 const char *clk_name; 106 const char *clk_name;
105 const int nr_tlb_entries; 107 const int nr_tlb_entries;
108 u32 da_start;
109 u32 da_end;
106}; 110};
107 111
108#if defined(CONFIG_ARCH_OMAP1) 112#if defined(CONFIG_ARCH_OMAP1)
@@ -152,6 +156,7 @@ extern void flush_iotlb_all(struct iommu *obj);
152extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e); 156extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e);
153extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova); 157extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova);
154 158
159extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end);
155extern struct iommu *iommu_get(const char *name); 160extern struct iommu *iommu_get(const char *name);
156extern void iommu_put(struct iommu *obj); 161extern void iommu_put(struct iommu *obj);
157 162
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 65e20a686713..2910de921c52 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -77,7 +77,7 @@
77/* 77/*
78 * OMAP-1610 specific IRQ numbers for interrupt handler 1 78 * OMAP-1610 specific IRQ numbers for interrupt handler 1
79 */ 79 */
80#define INT_1610_IH2_IRQ 0 80#define INT_1610_IH2_IRQ INT_1510_IH2_IRQ
81#define INT_1610_IH2_FIQ 2 81#define INT_1610_IH2_FIQ 2
82#define INT_1610_McBSP2_TX 4 82#define INT_1610_McBSP2_TX 4
83#define INT_1610_McBSP2_RX 5 83#define INT_1610_McBSP2_RX 5
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
index 3ae52ccc793c..793ce9d53294 100644
--- a/arch/arm/plat-omap/include/plat/keypad.h
+++ b/arch/arm/plat-omap/include/plat/keypad.h
@@ -10,16 +10,18 @@
10#ifndef ASMARM_ARCH_KEYPAD_H 10#ifndef ASMARM_ARCH_KEYPAD_H
11#define ASMARM_ARCH_KEYPAD_H 11#define ASMARM_ARCH_KEYPAD_H
12 12
13#warning: Please update the board to use matrix_keypad.h instead 13#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver
15#endif
16#include <linux/input/matrix_keypad.h>
14 17
15struct omap_kp_platform_data { 18struct omap_kp_platform_data {
16 int rows; 19 int rows;
17 int cols; 20 int cols;
18 int *keymap; 21 const struct matrix_keymap_data *keymap_data;
19 unsigned int keymapsize; 22 bool rep;
20 unsigned int rep:1;
21 unsigned long delay; 23 unsigned long delay;
22 unsigned int dbounce:1; 24 bool dbounce;
23 /* specific to OMAP242x*/ 25 /* specific to OMAP242x*/
24 unsigned int *row_gpios; 26 unsigned int *row_gpios;
25 unsigned int *col_gpios; 27 unsigned int *col_gpios;
@@ -28,18 +30,21 @@ struct omap_kp_platform_data {
28/* Group (0..3) -- when multiple keys are pressed, only the 30/* Group (0..3) -- when multiple keys are pressed, only the
29 * keys pressed in the same group are considered as pressed. This is 31 * keys pressed in the same group are considered as pressed. This is
30 * in order to workaround certain crappy HW designs that produce ghost 32 * in order to workaround certain crappy HW designs that produce ghost
31 * keypresses. */ 33 * keypresses. Two free bits, not used by neither row/col nor keynum,
32#define GROUP_0 (0 << 16) 34 * must be available for use as group bits. The below GROUP_SHIFT
33#define GROUP_1 (1 << 16) 35 * macro definition is based on some prior knowledge of the
34#define GROUP_2 (2 << 16) 36 * matrix_keypad defined KEY() macro internals.
35#define GROUP_3 (3 << 16) 37 */
38#define GROUP_SHIFT 14
39#define GROUP_0 (0 << GROUP_SHIFT)
40#define GROUP_1 (1 << GROUP_SHIFT)
41#define GROUP_2 (2 << GROUP_SHIFT)
42#define GROUP_3 (3 << GROUP_SHIFT)
36#define GROUP_MASK GROUP_3 43#define GROUP_MASK GROUP_3
44#if KEY_MAX & GROUP_MASK
45#error Group bits in conflict with keynum bits
46#endif
37 47
38#define KEY_PERSISTENT 0x00800000
39#define KEYNUM_MASK 0x00EFFFFF
40#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val))
41#define PERSISTENT_KEY(col, row) (((col) << 28) | ((row) << 24) | \
42 KEY_PERSISTENT)
43 48
44#endif 49#endif
45 50
diff --git a/arch/arm/plat-omap/include/plat/l4_3xxx.h b/arch/arm/plat-omap/include/plat/l4_3xxx.h
new file mode 100644
index 000000000000..5e1949375422
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l4_3xxx.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-omap/include/mach/l4_3xxx.h - L4 firewall definitions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
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 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_L4_3XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_L4_3XXX_H
15
16/* L4 CORE */
17#define OMAP3_L4_CORE_FW_I2C1_REGION 21
18#define OMAP3_L4_CORE_FW_I2C1_TA_REGION 22
19#define OMAP3_L4_CORE_FW_I2C2_REGION 23
20#define OMAP3_L4_CORE_FW_I2C2_TA_REGION 24
21#define OMAP3_L4_CORE_FW_I2C3_REGION 73
22#define OMAP3_L4_CORE_FW_I2C3_TA_REGION 74
23
24#endif
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index 997656552109..cc3921e9059c 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -46,8 +46,8 @@ struct omap_mbox_queue {
46 struct kfifo fifo; 46 struct kfifo fifo;
47 struct work_struct work; 47 struct work_struct work;
48 struct tasklet_struct tasklet; 48 struct tasklet_struct tasklet;
49 int (*callback)(void *);
50 struct omap_mbox *mbox; 49 struct omap_mbox *mbox;
50 bool full;
51}; 51};
52 52
53struct omap_mbox { 53struct omap_mbox {
@@ -57,13 +57,15 @@ struct omap_mbox {
57 struct omap_mbox_ops *ops; 57 struct omap_mbox_ops *ops;
58 struct device *dev; 58 struct device *dev;
59 void *priv; 59 void *priv;
60 int use_count;
61 struct blocking_notifier_head notifier;
60}; 62};
61 63
62int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); 64int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
63void omap_mbox_init_seq(struct omap_mbox *); 65void omap_mbox_init_seq(struct omap_mbox *);
64 66
65struct omap_mbox *omap_mbox_get(const char *); 67struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb);
66void omap_mbox_put(struct omap_mbox *); 68void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb);
67 69
68int omap_mbox_register(struct device *parent, struct omap_mbox **); 70int omap_mbox_register(struct device *parent, struct omap_mbox **);
69int omap_mbox_unregister(void); 71int omap_mbox_unregister(void);
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
index 728fbb9dd549..c0a752053039 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -17,26 +17,7 @@
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20 20#include <linux/opp.h>
21#include "powerdomain.h"
22
23/**
24 * struct omap_opp - clock frequency-to-OPP ID table for DSP, MPU
25 * @rate: target clock rate
26 * @opp_id: OPP ID
27 * @min_vdd: minimum VDD1 voltage (in millivolts) for this OPP
28 *
29 * Operating performance point data. Can vary by OMAP chip and board.
30 */
31struct omap_opp {
32 unsigned long rate;
33 u8 opp_id;
34 u16 min_vdd;
35};
36
37extern struct omap_opp *mpu_opps;
38extern struct omap_opp *dsp_opps;
39extern struct omap_opp *l3_opps;
40 21
41/* 22/*
42 * agent_id values for use with omap_pm_set_min_bus_tput(): 23 * agent_id values for use with omap_pm_set_min_bus_tput():
@@ -59,9 +40,11 @@ extern struct omap_opp *l3_opps;
59 * framework starts. The "_if_" is to avoid name collisions with the 40 * framework starts. The "_if_" is to avoid name collisions with the
60 * PM idle-loop code. 41 * PM idle-loop code.
61 */ 42 */
62int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table, 43#ifdef CONFIG_OMAP_PM_NONE
63 struct omap_opp *dsp_opp_table, 44#define omap_pm_if_early_init() 0
64 struct omap_opp *l3_opp_table); 45#else
46int __init omap_pm_if_early_init(void);
47#endif
65 48
66/** 49/**
67 * omap_pm_if_init - OMAP PM init code called after clock fw init 50 * omap_pm_if_init - OMAP PM init code called after clock fw init
@@ -69,7 +52,11 @@ int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
69 * The main initialization code. OPP tables are passed in here. The 52 * The main initialization code. OPP tables are passed in here. The
70 * "_if_" is to avoid name collisions with the PM idle-loop code. 53 * "_if_" is to avoid name collisions with the PM idle-loop code.
71 */ 54 */
55#ifdef CONFIG_OMAP_PM_NONE
56#define omap_pm_if_init() 0
57#else
72int __init omap_pm_if_init(void); 58int __init omap_pm_if_init(void);
59#endif
73 60
74/** 61/**
75 * omap_pm_if_exit - OMAP PM exit code 62 * omap_pm_if_exit - OMAP PM exit code
@@ -363,9 +350,11 @@ unsigned long omap_pm_cpu_get_freq(void);
363 * driver must restore device context. If the number of context losses 350 * driver must restore device context. If the number of context losses
364 * exceeds the maximum positive integer, the function will wrap to 0 and 351 * exceeds the maximum positive integer, the function will wrap to 0 and
365 * continue counting. Returns the number of context losses for this device, 352 * continue counting. Returns the number of context losses for this device,
366 * or -EINVAL upon error. 353 * or zero upon error.
367 */ 354 */
368int omap_pm_get_dev_context_loss_count(struct device *dev); 355u32 omap_pm_get_dev_context_loss_count(struct device *dev);
369 356
357void omap_pm_enable_off_mode(void);
358void omap_pm_disable_off_mode(void);
370 359
371#endif 360#endif
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index c8dae02f0704..2682043f5a5b 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -22,7 +22,7 @@
22 22
23#include <plat/mux.h> 23#include <plat/mux.h>
24 24
25#define DRIVER_NAME "omap-hsuart" 25#define DRIVER_NAME "omap_uart"
26 26
27/* 27/*
28 * Use tty device name as ttyO, [O -> OMAP] 28 * Use tty device name as ttyO, [O -> OMAP]
@@ -31,20 +31,8 @@
31 */ 31 */
32#define OMAP_SERIAL_NAME "ttyO" 32#define OMAP_SERIAL_NAME "ttyO"
33 33
34#define OMAP_MDR1_DISABLE 0x07
35#define OMAP_MDR1_MODE13X 0x03
36#define OMAP_MDR1_MODE16X 0x00
37#define OMAP_MODE13X_SPEED 230400 34#define OMAP_MODE13X_SPEED 230400
38 35
39/*
40 * LCR = 0XBF: Switch to Configuration Mode B.
41 * In configuration mode b allow access
42 * to EFR,DLL,DLH.
43 * Reference OMAP TRM Chapter 17
44 * Section: 1.4.3 Mode Selection
45 */
46#define OMAP_UART_LCR_CONF_MDB 0XBF
47
48/* WER = 0x7F 36/* WER = 0x7F
49 * Enable module level wakeup in WER reg 37 * Enable module level wakeup in WER reg
50 */ 38 */
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 28e2d1a78433..e4c349ff9fd8 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -107,6 +107,7 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od);
107int omap_device_align_pm_lat(struct platform_device *pdev, 107int omap_device_align_pm_lat(struct platform_device *pdev,
108 u32 new_wakeup_lat_limit); 108 u32 new_wakeup_lat_limit);
109struct powerdomain *omap_device_get_pwrdm(struct omap_device *od); 109struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
110u32 omap_device_get_context_loss_count(struct platform_device *pdev);
110 111
111/* Other */ 112/* Other */
112 113
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 7eaa8edf3b14..6864a997f2ca 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -23,7 +23,7 @@
23 * - add pinmuxing 23 * - add pinmuxing
24 * - init_conn_id_bit (CONNID_BIT_VECTOR) 24 * - init_conn_id_bit (CONNID_BIT_VECTOR)
25 * - implement default hwmod SMS/SDRC flags? 25 * - implement default hwmod SMS/SDRC flags?
26 * - remove unused fields 26 * - move Linux-specific data ("non-ROM data") out
27 * 27 *
28 */ 28 */
29#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H 29#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
@@ -32,8 +32,9 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/ioport.h> 34#include <linux/ioport.h>
35#include <linux/mutex.h> 35#include <linux/spinlock.h>
36#include <plat/cpu.h> 36#include <plat/cpu.h>
37#include <plat/voltage.h>
37 38
38struct omap_device; 39struct omap_device;
39 40
@@ -76,6 +77,20 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
76#define HWMOD_IDLEMODE_FORCE (1 << 0) 77#define HWMOD_IDLEMODE_FORCE (1 << 0)
77#define HWMOD_IDLEMODE_NO (1 << 1) 78#define HWMOD_IDLEMODE_NO (1 << 1)
78#define HWMOD_IDLEMODE_SMART (1 << 2) 79#define HWMOD_IDLEMODE_SMART (1 << 2)
80/* Slave idle mode flag only */
81#define HWMOD_IDLEMODE_SMART_WKUP (1 << 3)
82
83/**
84 * struct omap_hwmod_mux_info - hwmod specific mux configuration
85 * @pads: array of omap_device_pad entries
86 * @nr_pads: number of omap_device_pad entries
87 *
88 * Note that this is currently built during init as needed.
89 */
90struct omap_hwmod_mux_info {
91 int nr_pads;
92 struct omap_device_pad *pads;
93};
79 94
80/** 95/**
81 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod 96 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
@@ -159,7 +174,7 @@ struct omap_hwmod_omap2_firewall {
159 * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init. 174 * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
160 * ADDR_TYPE_RT: Address space contains module register target data. 175 * ADDR_TYPE_RT: Address space contains module register target data.
161 */ 176 */
162#define ADDR_MAP_ON_INIT (1 << 0) 177#define ADDR_MAP_ON_INIT (1 << 0) /* XXX does not belong */
163#define ADDR_TYPE_RT (1 << 1) 178#define ADDR_TYPE_RT (1 << 1)
164 179
165/** 180/**
@@ -200,8 +215,6 @@ struct omap_hwmod_addr_space {
200 * @fw: interface firewall data 215 * @fw: interface firewall data
201 * @addr_cnt: ARRAY_SIZE(@addr) 216 * @addr_cnt: ARRAY_SIZE(@addr)
202 * @width: OCP data width 217 * @width: OCP data width
203 * @thread_cnt: number of threads
204 * @max_burst_len: maximum burst length in @width sized words (0 if unlimited)
205 * @user: initiators using this interface (see OCP_USER_* macros above) 218 * @user: initiators using this interface (see OCP_USER_* macros above)
206 * @flags: OCP interface flags (see OCPIF_* macros above) 219 * @flags: OCP interface flags (see OCPIF_* macros above)
207 * 220 *
@@ -221,8 +234,6 @@ struct omap_hwmod_ocp_if {
221 } fw; 234 } fw;
222 u8 addr_cnt; 235 u8 addr_cnt;
223 u8 width; 236 u8 width;
224 u8 thread_cnt;
225 u8 max_burst_len;
226 u8 user; 237 u8 user;
227 u8 flags; 238 u8 flags;
228}; 239};
@@ -231,11 +242,12 @@ struct omap_hwmod_ocp_if {
231/* Macros for use in struct omap_hwmod_sysconfig */ 242/* Macros for use in struct omap_hwmod_sysconfig */
232 243
233/* Flags for use in omap_hwmod_sysconfig.idlemodes */ 244/* Flags for use in omap_hwmod_sysconfig.idlemodes */
234#define MASTER_STANDBY_SHIFT 2 245#define MASTER_STANDBY_SHIFT 4
235#define SLAVE_IDLE_SHIFT 0 246#define SLAVE_IDLE_SHIFT 0
236#define SIDLE_FORCE (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT) 247#define SIDLE_FORCE (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
237#define SIDLE_NO (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT) 248#define SIDLE_NO (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
238#define SIDLE_SMART (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT) 249#define SIDLE_SMART (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
250#define SIDLE_SMART_WKUP (HWMOD_IDLEMODE_SMART_WKUP << SLAVE_IDLE_SHIFT)
239#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT) 251#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
240#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT) 252#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
241#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT) 253#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
@@ -357,14 +369,14 @@ struct omap_hwmod_omap4_prcm {
357 * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out 369 * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
358 * of standby, rather than relying on module smart-standby 370 * of standby, rather than relying on module smart-standby
359 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 371 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
360 * SDRAM controller, etc. 372 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
361 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM 373 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
362 * controller, etc. 374 * controller, etc. XXX probably belongs outside the main hwmod file
363 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) 375 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
364 * when module is enabled, rather than the default, which is to 376 * when module is enabled, rather than the default, which is to
365 * enable autoidle 377 * enable autoidle
366 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup 378 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
367 * HWMOD_NO_IDLEST : this module does not have idle status - this is the case 379 * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
368 * only for few initiator modules on OMAP2 & 3. 380 * only for few initiator modules on OMAP2 & 3.
369 * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset. 381 * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
370 * This is needed for devices like DSS that require optional clocks enabled 382 * This is needed for devices like DSS that require optional clocks enabled
@@ -415,14 +427,31 @@ struct omap_hwmod_omap4_prcm {
415 * @name: name of the hwmod_class 427 * @name: name of the hwmod_class
416 * @sysc: device SYSCONFIG/SYSSTATUS register data 428 * @sysc: device SYSCONFIG/SYSSTATUS register data
417 * @rev: revision of the IP class 429 * @rev: revision of the IP class
430 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
431 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
418 * 432 *
419 * Represent the class of a OMAP hardware "modules" (e.g. timer, 433 * Represent the class of a OMAP hardware "modules" (e.g. timer,
420 * smartreflex, gpio, uart...) 434 * smartreflex, gpio, uart...)
435 *
436 * @pre_shutdown is a function that will be run immediately before
437 * hwmod clocks are disabled, etc. It is intended for use for hwmods
438 * like the MPU watchdog, which cannot be disabled with the standard
439 * omap_hwmod_shutdown(). The function should return 0 upon success,
440 * or some negative error upon failure. Returning an error will cause
441 * omap_hwmod_shutdown() to abort the device shutdown and return an
442 * error.
443 *
444 * If @reset is defined, then the function it points to will be
445 * executed in place of the standard hwmod _reset() code in
446 * mach-omap2/omap_hwmod.c. This is needed for IP blocks which have
447 * unusual reset sequences - usually processor IP blocks like the IVA.
421 */ 448 */
422struct omap_hwmod_class { 449struct omap_hwmod_class {
423 const char *name; 450 const char *name;
424 struct omap_hwmod_class_sysconfig *sysc; 451 struct omap_hwmod_class_sysconfig *sysc;
425 u32 rev; 452 u32 rev;
453 int (*pre_shutdown)(struct omap_hwmod *oh);
454 int (*reset)(struct omap_hwmod *oh);
426}; 455};
427 456
428/** 457/**
@@ -436,14 +465,14 @@ struct omap_hwmod_class {
436 * @main_clk: main clock: OMAP clock name 465 * @main_clk: main clock: OMAP clock name
437 * @_clk: pointer to the main struct clk (filled in at runtime) 466 * @_clk: pointer to the main struct clk (filled in at runtime)
438 * @opt_clks: other device clocks that drivers can request (0..*) 467 * @opt_clks: other device clocks that drivers can request (0..*)
468 * @vdd_name: voltage domain name
469 * @voltdm: pointer to voltage domain (filled in at runtime)
439 * @masters: ptr to array of OCP ifs that this hwmod can initiate on 470 * @masters: ptr to array of OCP ifs that this hwmod can initiate on
440 * @slaves: ptr to array of OCP ifs that this hwmod can respond on 471 * @slaves: ptr to array of OCP ifs that this hwmod can respond on
441 * @dev_attr: arbitrary device attributes that can be passed to the driver 472 * @dev_attr: arbitrary device attributes that can be passed to the driver
442 * @_sysc_cache: internal-use hwmod flags 473 * @_sysc_cache: internal-use hwmod flags
443 * @_mpu_rt_va: cached register target start address (internal use) 474 * @_mpu_rt_va: cached register target start address (internal use)
444 * @_mpu_port_index: cached MPU register target slave ID (internal use) 475 * @_mpu_port_index: cached MPU register target slave ID (internal use)
445 * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6)
446 * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift
447 * @mpu_irqs_cnt: number of @mpu_irqs 476 * @mpu_irqs_cnt: number of @mpu_irqs
448 * @sdma_reqs_cnt: number of @sdma_reqs 477 * @sdma_reqs_cnt: number of @sdma_reqs
449 * @opt_clks_cnt: number of @opt_clks 478 * @opt_clks_cnt: number of @opt_clks
@@ -452,9 +481,10 @@ struct omap_hwmod_class {
452 * @response_lat: device OCP response latency (in interface clock cycles) 481 * @response_lat: device OCP response latency (in interface clock cycles)
453 * @_int_flags: internal-use hwmod flags 482 * @_int_flags: internal-use hwmod flags
454 * @_state: internal-use hwmod state 483 * @_state: internal-use hwmod state
484 * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
455 * @flags: hwmod flags (documented below) 485 * @flags: hwmod flags (documented below)
456 * @omap_chip: OMAP chips this hwmod is present on 486 * @omap_chip: OMAP chips this hwmod is present on
457 * @_mutex: mutex serializing operations on this hwmod 487 * @_lock: spinlock serializing operations on this hwmod
458 * @node: list node for hwmod list (internal use) 488 * @node: list node for hwmod list (internal use)
459 * 489 *
460 * @main_clk refers to this module's "main clock," which for our 490 * @main_clk refers to this module's "main clock," which for our
@@ -469,6 +499,7 @@ struct omap_hwmod {
469 const char *name; 499 const char *name;
470 struct omap_hwmod_class *class; 500 struct omap_hwmod_class *class;
471 struct omap_device *od; 501 struct omap_device *od;
502 struct omap_hwmod_mux_info *mux;
472 struct omap_hwmod_irq_info *mpu_irqs; 503 struct omap_hwmod_irq_info *mpu_irqs;
473 struct omap_hwmod_dma_info *sdma_reqs; 504 struct omap_hwmod_dma_info *sdma_reqs;
474 struct omap_hwmod_rst_info *rst_lines; 505 struct omap_hwmod_rst_info *rst_lines;
@@ -479,17 +510,17 @@ struct omap_hwmod {
479 const char *main_clk; 510 const char *main_clk;
480 struct clk *_clk; 511 struct clk *_clk;
481 struct omap_hwmod_opt_clk *opt_clks; 512 struct omap_hwmod_opt_clk *opt_clks;
513 char *vdd_name;
514 struct voltagedomain *voltdm;
482 struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ 515 struct omap_hwmod_ocp_if **masters; /* connect to *_IA */
483 struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ 516 struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */
484 void *dev_attr; 517 void *dev_attr;
485 u32 _sysc_cache; 518 u32 _sysc_cache;
486 void __iomem *_mpu_rt_va; 519 void __iomem *_mpu_rt_va;
487 struct mutex _mutex; 520 spinlock_t _lock;
488 struct list_head node; 521 struct list_head node;
489 u16 flags; 522 u16 flags;
490 u8 _mpu_port_index; 523 u8 _mpu_port_index;
491 u8 msuspendmux_reg_id;
492 u8 msuspendmux_shift;
493 u8 response_lat; 524 u8 response_lat;
494 u8 mpu_irqs_cnt; 525 u8 mpu_irqs_cnt;
495 u8 sdma_reqs_cnt; 526 u8 sdma_reqs_cnt;
@@ -500,16 +531,15 @@ struct omap_hwmod {
500 u8 hwmods_cnt; 531 u8 hwmods_cnt;
501 u8 _int_flags; 532 u8 _int_flags;
502 u8 _state; 533 u8 _state;
534 u8 _postsetup_state;
503 const struct omap_chip_id omap_chip; 535 const struct omap_chip_id omap_chip;
504}; 536};
505 537
506int omap_hwmod_init(struct omap_hwmod **ohs); 538int omap_hwmod_init(struct omap_hwmod **ohs);
507int omap_hwmod_register(struct omap_hwmod *oh);
508int omap_hwmod_unregister(struct omap_hwmod *oh);
509struct omap_hwmod *omap_hwmod_lookup(const char *name); 539struct omap_hwmod *omap_hwmod_lookup(const char *name);
510int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), 540int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
511 void *data); 541 void *data);
512int omap_hwmod_late_init(u8 skip_setup_idle); 542int omap_hwmod_late_init(void);
513 543
514int omap_hwmod_enable(struct omap_hwmod *oh); 544int omap_hwmod_enable(struct omap_hwmod *oh);
515int _omap_hwmod_enable(struct omap_hwmod *oh); 545int _omap_hwmod_enable(struct omap_hwmod *oh);
@@ -556,6 +586,9 @@ int omap_hwmod_for_each_by_class(const char *classname,
556 void *user), 586 void *user),
557 void *user); 587 void *user);
558 588
589int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
590u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
591
559/* 592/*
560 * Chip variant-specific hwmod init routines - XXX should be converted 593 * Chip variant-specific hwmod init routines - XXX should be converted
561 * to use initcalls once the initial boot ordering is straightened out 594 * to use initcalls once the initial boot ordering is straightened out
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
index ab77442e42ab..2fdf8c80d390 100644
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -18,6 +18,10 @@
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * XXX This file is deprecated. The PRCM is an OMAP2+-only subsystem,
23 * so this file doesn't belong in plat-omap/include/plat. Please
24 * do not add anything new to this file.
21 */ 25 */
22 26
23#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H 27#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
@@ -28,22 +32,6 @@ void omap_prcm_arch_reset(char mode, const char *cmd);
28int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, 32int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
29 const char *name); 33 const char *name);
30 34
31#define START_PADCONF_SAVE 0x2
32#define PADCONF_SAVE_DONE 0x1
33
34void omap3_prcm_save_context(void);
35void omap3_prcm_restore_context(void);
36
37u32 prm_read_mod_reg(s16 module, u16 idx);
38void prm_write_mod_reg(u32 val, s16 module, u16 idx);
39u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
40u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
41u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
42u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
43u32 cm_read_mod_reg(s16 module, u16 idx);
44void cm_write_mod_reg(u32 val, s16 module, u16 idx);
45u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
46
47#endif 35#endif
48 36
49 37
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 19145f5c32ba..cec5d56db2eb 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -93,9 +93,12 @@
93 }) 93 })
94 94
95#ifndef __ASSEMBLER__ 95#ifndef __ASSEMBLER__
96
97struct omap_board_data;
98
96extern void __init omap_serial_early_init(void); 99extern void __init omap_serial_early_init(void);
97extern void omap_serial_init(void); 100extern void omap_serial_init(void);
98extern void omap_serial_init_port(int port); 101extern void omap_serial_init_port(struct omap_board_data *bdata);
99extern int omap_uart_can_sleep(void); 102extern int omap_uart_can_sleep(void);
100extern void omap_uart_check_wakeup(void); 103extern void omap_uart_check_wakeup(void);
101extern void omap_uart_prepare_suspend(void); 104extern void omap_uart_prepare_suspend(void);
diff --git a/arch/arm/plat-omap/include/plat/smartreflex.h b/arch/arm/plat-omap/include/plat/smartreflex.h
new file mode 100644
index 000000000000..6568c885f37a
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/smartreflex.h
@@ -0,0 +1,245 @@
1/*
2 * OMAP Smartreflex Defines and Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008 Nokia Corporation
10 * Kalle Jokiniemi
11 *
12 * Copyright (C) 2007 Texas Instruments, Inc.
13 * Lesly A M <x0080970@ti.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
19
20#ifndef __ASM_ARM_OMAP_SMARTREFLEX_H
21#define __ASM_ARM_OMAP_SMARTREFLEX_H
22
23#include <linux/platform_device.h>
24#include <plat/voltage.h>
25
26/*
27 * Different Smartreflex IPs version. The v1 is the 65nm version used in
28 * OMAP3430. The v2 is the update for the 45nm version of the IP
29 * used in OMAP3630 and OMAP4430
30 */
31#define SR_TYPE_V1 1
32#define SR_TYPE_V2 2
33
34/* SMART REFLEX REG ADDRESS OFFSET */
35#define SRCONFIG 0x00
36#define SRSTATUS 0x04
37#define SENVAL 0x08
38#define SENMIN 0x0C
39#define SENMAX 0x10
40#define SENAVG 0x14
41#define AVGWEIGHT 0x18
42#define NVALUERECIPROCAL 0x1c
43#define SENERROR_V1 0x20
44#define ERRCONFIG_V1 0x24
45#define IRQ_EOI 0x20
46#define IRQSTATUS_RAW 0x24
47#define IRQSTATUS 0x28
48#define IRQENABLE_SET 0x2C
49#define IRQENABLE_CLR 0x30
50#define SENERROR_V2 0x34
51#define ERRCONFIG_V2 0x38
52
53/* Bit/Shift Positions */
54
55/* SRCONFIG */
56#define SRCONFIG_ACCUMDATA_SHIFT 22
57#define SRCONFIG_SRCLKLENGTH_SHIFT 12
58#define SRCONFIG_SENNENABLE_V1_SHIFT 5
59#define SRCONFIG_SENPENABLE_V1_SHIFT 3
60#define SRCONFIG_SENNENABLE_V2_SHIFT 1
61#define SRCONFIG_SENPENABLE_V2_SHIFT 0
62#define SRCONFIG_CLKCTRL_SHIFT 0
63
64#define SRCONFIG_ACCUMDATA_MASK (0x3ff << 22)
65
66#define SRCONFIG_SRENABLE BIT(11)
67#define SRCONFIG_SENENABLE BIT(10)
68#define SRCONFIG_ERRGEN_EN BIT(9)
69#define SRCONFIG_MINMAXAVG_EN BIT(8)
70#define SRCONFIG_DELAYCTRL BIT(2)
71
72/* AVGWEIGHT */
73#define AVGWEIGHT_SENPAVGWEIGHT_SHIFT 2
74#define AVGWEIGHT_SENNAVGWEIGHT_SHIFT 0
75
76/* NVALUERECIPROCAL */
77#define NVALUERECIPROCAL_SENPGAIN_SHIFT 20
78#define NVALUERECIPROCAL_SENNGAIN_SHIFT 16
79#define NVALUERECIPROCAL_RNSENP_SHIFT 8
80#define NVALUERECIPROCAL_RNSENN_SHIFT 0
81
82/* ERRCONFIG */
83#define ERRCONFIG_ERRWEIGHT_SHIFT 16
84#define ERRCONFIG_ERRMAXLIMIT_SHIFT 8
85#define ERRCONFIG_ERRMINLIMIT_SHIFT 0
86
87#define SR_ERRWEIGHT_MASK (0x07 << 16)
88#define SR_ERRMAXLIMIT_MASK (0xff << 8)
89#define SR_ERRMINLIMIT_MASK (0xff << 0)
90
91#define ERRCONFIG_VPBOUNDINTEN_V1 BIT(31)
92#define ERRCONFIG_VPBOUNDINTST_V1 BIT(30)
93#define ERRCONFIG_MCUACCUMINTEN BIT(29)
94#define ERRCONFIG_MCUACCUMINTST BIT(28)
95#define ERRCONFIG_MCUVALIDINTEN BIT(27)
96#define ERRCONFIG_MCUVALIDINTST BIT(26)
97#define ERRCONFIG_MCUBOUNDINTEN BIT(25)
98#define ERRCONFIG_MCUBOUNDINTST BIT(24)
99#define ERRCONFIG_MCUDISACKINTEN BIT(23)
100#define ERRCONFIG_VPBOUNDINTST_V2 BIT(23)
101#define ERRCONFIG_MCUDISACKINTST BIT(22)
102#define ERRCONFIG_VPBOUNDINTEN_V2 BIT(22)
103
104#define ERRCONFIG_STATUS_V1_MASK (ERRCONFIG_VPBOUNDINTST_V1 | \
105 ERRCONFIG_MCUACCUMINTST | \
106 ERRCONFIG_MCUVALIDINTST | \
107 ERRCONFIG_MCUBOUNDINTST | \
108 ERRCONFIG_MCUDISACKINTST)
109/* IRQSTATUS */
110#define IRQSTATUS_MCUACCUMINT BIT(3)
111#define IRQSTATUS_MCVALIDINT BIT(2)
112#define IRQSTATUS_MCBOUNDSINT BIT(1)
113#define IRQSTATUS_MCUDISABLEACKINT BIT(0)
114
115/* IRQENABLE_SET and IRQENABLE_CLEAR */
116#define IRQENABLE_MCUACCUMINT BIT(3)
117#define IRQENABLE_MCUVALIDINT BIT(2)
118#define IRQENABLE_MCUBOUNDSINT BIT(1)
119#define IRQENABLE_MCUDISABLEACKINT BIT(0)
120
121/* Common Bit values */
122
123#define SRCLKLENGTH_12MHZ_SYSCLK 0x3c
124#define SRCLKLENGTH_13MHZ_SYSCLK 0x41
125#define SRCLKLENGTH_19MHZ_SYSCLK 0x60
126#define SRCLKLENGTH_26MHZ_SYSCLK 0x82
127#define SRCLKLENGTH_38MHZ_SYSCLK 0xC0
128
129/*
130 * 3430 specific values. Maybe these should be passed from board file or
131 * pmic structures.
132 */
133#define OMAP3430_SR_ACCUMDATA 0x1f4
134
135#define OMAP3430_SR1_SENPAVGWEIGHT 0x03
136#define OMAP3430_SR1_SENNAVGWEIGHT 0x03
137
138#define OMAP3430_SR2_SENPAVGWEIGHT 0x01
139#define OMAP3430_SR2_SENNAVGWEIGHT 0x01
140
141#define OMAP3430_SR_ERRWEIGHT 0x04
142#define OMAP3430_SR_ERRMAXLIMIT 0x02
143
144/**
145 * struct omap_sr_pmic_data - Strucutre to be populated by pmic code to pass
146 * pmic specific info to smartreflex driver
147 *
148 * @sr_pmic_init: API to initialize smartreflex on the PMIC side.
149 */
150struct omap_sr_pmic_data {
151 void (*sr_pmic_init) (void);
152};
153
154#ifdef CONFIG_OMAP_SMARTREFLEX
155/*
156 * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
157 * The smartreflex class driver should pass the class type.
158 * Should be used to populate the class_type field of the
159 * omap_smartreflex_class_data structure.
160 */
161#define SR_CLASS1 0x1
162#define SR_CLASS2 0x2
163#define SR_CLASS3 0x3
164
165/**
166 * struct omap_sr_class_data - Smartreflex class driver info
167 *
168 * @enable: API to enable a particular class smaartreflex.
169 * @disable: API to disable a particular class smartreflex.
170 * @configure: API to configure a particular class smartreflex.
171 * @notify: API to notify the class driver about an event in SR.
172 * Not needed for class3.
173 * @notify_flags: specify the events to be notified to the class driver
174 * @class_type: specify which smartreflex class.
175 * Can be used by the SR driver to take any class
176 * based decisions.
177 */
178struct omap_sr_class_data {
179 int (*enable)(struct voltagedomain *voltdm);
180 int (*disable)(struct voltagedomain *voltdm, int is_volt_reset);
181 int (*configure)(struct voltagedomain *voltdm);
182 int (*notify)(struct voltagedomain *voltdm, u32 status);
183 u8 notify_flags;
184 u8 class_type;
185};
186
187/**
188 * struct omap_sr_nvalue_table - Smartreflex n-target value info
189 *
190 * @efuse_offs: The offset of the efuse where n-target values are stored.
191 * @nvalue: The n-target value.
192 */
193struct omap_sr_nvalue_table {
194 u32 efuse_offs;
195 u32 nvalue;
196};
197
198/**
199 * struct omap_sr_data - Smartreflex platform data.
200 *
201 * @ip_type: Smartreflex IP type.
202 * @senp_mod: SENPENABLE value for the sr
203 * @senn_mod: SENNENABLE value for sr
204 * @nvalue_count: Number of distinct nvalues in the nvalue table
205 * @enable_on_init: whether this sr module needs to enabled at
206 * boot up or not.
207 * @nvalue_table: table containing the efuse offsets and nvalues
208 * corresponding to them.
209 * @voltdm: Pointer to the voltage domain associated with the SR
210 */
211struct omap_sr_data {
212 int ip_type;
213 u32 senp_mod;
214 u32 senn_mod;
215 int nvalue_count;
216 bool enable_on_init;
217 struct omap_sr_nvalue_table *nvalue_table;
218 struct voltagedomain *voltdm;
219};
220
221/* Smartreflex module enable/disable interface */
222void omap_sr_enable(struct voltagedomain *voltdm);
223void omap_sr_disable(struct voltagedomain *voltdm);
224void omap_sr_disable_reset_volt(struct voltagedomain *voltdm);
225
226/* API to register the pmic specific data with the smartreflex driver. */
227void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data);
228
229/* Smartreflex driver hooks to be called from Smartreflex class driver */
230int sr_enable(struct voltagedomain *voltdm, unsigned long volt);
231void sr_disable(struct voltagedomain *voltdm);
232int sr_configure_errgen(struct voltagedomain *voltdm);
233int sr_configure_minmax(struct voltagedomain *voltdm);
234
235/* API to register the smartreflex class driver with the smartreflex driver */
236int sr_register_class(struct omap_sr_class_data *class_data);
237#else
238static inline void omap_sr_enable(struct voltagedomain *voltdm) {}
239static inline void omap_sr_disable(struct voltagedomain *voltdm) {}
240static inline void omap_sr_disable_reset_volt(
241 struct voltagedomain *voltdm) {}
242static inline void omap_sr_register_pmic(
243 struct omap_sr_pmic_data *pmic_data) {}
244#endif
245#endif
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
index 5905100b29a1..9967d5e855c7 100644
--- a/arch/arm/plat-omap/include/plat/sram.h
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -11,6 +11,7 @@
11#ifndef __ARCH_ARM_OMAP_SRAM_H 11#ifndef __ARCH_ARM_OMAP_SRAM_H
12#define __ARCH_ARM_OMAP_SRAM_H 12#define __ARCH_ARM_OMAP_SRAM_H
13 13
14#ifndef __ASSEMBLY__
14extern void * omap_sram_push(void * start, unsigned long size); 15extern void * omap_sram_push(void * start, unsigned long size);
15extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); 16extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
16 17
@@ -74,4 +75,14 @@ extern void omap_push_sram_idle(void);
74static inline void omap_push_sram_idle(void) {} 75static inline void omap_push_sram_idle(void) {}
75#endif /* CONFIG_PM */ 76#endif /* CONFIG_PM */
76 77
78#endif /* __ASSEMBLY__ */
79
80/*
81 * OMAP2+: define the SRAM PA addresses.
82 * Used by the SRAM management code and the idle sleep code.
83 */
84#define OMAP2_SRAM_PA 0x40200000
85#define OMAP3_SRAM_PA 0x40200000
86#define OMAP4_SRAM_PA 0x40300000
87
77#endif 88#endif
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 9036e374e0ac..ad98b85cae21 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -145,8 +145,11 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
145 /* omap3 based boards using UART3 */ 145 /* omap3 based boards using UART3 */
146 DEBUG_LL_OMAP3(3, cm_t35); 146 DEBUG_LL_OMAP3(3, cm_t35);
147 DEBUG_LL_OMAP3(3, cm_t3517); 147 DEBUG_LL_OMAP3(3, cm_t3517);
148 DEBUG_LL_OMAP3(3, craneboard);
149 DEBUG_LL_OMAP3(3, devkit8000);
148 DEBUG_LL_OMAP3(3, igep0020); 150 DEBUG_LL_OMAP3(3, igep0020);
149 DEBUG_LL_OMAP3(3, igep0030); 151 DEBUG_LL_OMAP3(3, igep0030);
152 DEBUG_LL_OMAP3(3, nokia_rm680);
150 DEBUG_LL_OMAP3(3, nokia_rx51); 153 DEBUG_LL_OMAP3(3, nokia_rx51);
151 DEBUG_LL_OMAP3(3, omap3517evm); 154 DEBUG_LL_OMAP3(3, omap3517evm);
152 DEBUG_LL_OMAP3(3, omap3_beagle); 155 DEBUG_LL_OMAP3(3, omap3_beagle);
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/plat-omap/include/plat/voltage.h
new file mode 100644
index 000000000000..0ff123399f3b
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/voltage.h
@@ -0,0 +1,146 @@
1/*
2 * OMAP Voltage Management Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2009 Texas Instruments, Inc.
7 * Thara Gopinath <thara@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
14#ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
15#define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
16
17#define VOLTSCALE_VPFORCEUPDATE 1
18#define VOLTSCALE_VCBYPASS 2
19
20/*
21 * OMAP3 GENERIC setup times. Revisit to see if these needs to be
22 * passed from board or PMIC file
23 */
24#define OMAP3_CLKSETUP 0xff
25#define OMAP3_VOLTOFFSET 0xff
26#define OMAP3_VOLTSETUP2 0xff
27
28/* Voltage value defines */
29#define OMAP3430_VDD_MPU_OPP1_UV 975000
30#define OMAP3430_VDD_MPU_OPP2_UV 1075000
31#define OMAP3430_VDD_MPU_OPP3_UV 1200000
32#define OMAP3430_VDD_MPU_OPP4_UV 1270000
33#define OMAP3430_VDD_MPU_OPP5_UV 1350000
34
35#define OMAP3430_VDD_CORE_OPP1_UV 975000
36#define OMAP3430_VDD_CORE_OPP2_UV 1050000
37#define OMAP3430_VDD_CORE_OPP3_UV 1150000
38
39#define OMAP3630_VDD_MPU_OPP50_UV 1012500
40#define OMAP3630_VDD_MPU_OPP100_UV 1200000
41#define OMAP3630_VDD_MPU_OPP120_UV 1325000
42#define OMAP3630_VDD_MPU_OPP1G_UV 1375000
43
44#define OMAP3630_VDD_CORE_OPP50_UV 1000000
45#define OMAP3630_VDD_CORE_OPP100_UV 1200000
46
47#define OMAP4430_VDD_MPU_OPP50_UV 930000
48#define OMAP4430_VDD_MPU_OPP100_UV 1100000
49#define OMAP4430_VDD_MPU_OPPTURBO_UV 1260000
50#define OMAP4430_VDD_MPU_OPPNITRO_UV 1350000
51
52#define OMAP4430_VDD_IVA_OPP50_UV 930000
53#define OMAP4430_VDD_IVA_OPP100_UV 1100000
54#define OMAP4430_VDD_IVA_OPPTURBO_UV 1260000
55
56#define OMAP4430_VDD_CORE_OPP50_UV 930000
57#define OMAP4430_VDD_CORE_OPP100_UV 1100000
58
59/**
60 * struct voltagedomain - omap voltage domain global structure.
61 * @name: Name of the voltage domain which can be used as a unique
62 * identifier.
63 */
64struct voltagedomain {
65 char *name;
66};
67
68/* API to get the voltagedomain pointer */
69struct voltagedomain *omap_voltage_domain_lookup(char *name);
70
71/**
72 * struct omap_volt_data - Omap voltage specific data.
73 * @voltage_nominal: The possible voltage value in uV
74 * @sr_efuse_offs: The offset of the efuse register(from system
75 * control module base address) from where to read
76 * the n-target value for the smartreflex module.
77 * @sr_errminlimit: Error min limit value for smartreflex. This value
78 * differs at differnet opp and thus is linked
79 * with voltage.
80 * @vp_errorgain: Error gain value for the voltage processor. This
81 * field also differs according to the voltage/opp.
82 */
83struct omap_volt_data {
84 u32 volt_nominal;
85 u32 sr_efuse_offs;
86 u8 sr_errminlimit;
87 u8 vp_errgain;
88};
89
90/**
91 * struct omap_volt_pmic_info - PMIC specific data required by voltage driver.
92 * @slew_rate: PMIC slew rate (in uv/us)
93 * @step_size: PMIC voltage step size (in uv)
94 * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV.
95 * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value.
96 */
97struct omap_volt_pmic_info {
98 int slew_rate;
99 int step_size;
100 u32 on_volt;
101 u32 onlp_volt;
102 u32 ret_volt;
103 u32 off_volt;
104 u16 volt_setup_time;
105 u8 vp_erroroffset;
106 u8 vp_vstepmin;
107 u8 vp_vstepmax;
108 u8 vp_vddmin;
109 u8 vp_vddmax;
110 u8 vp_timeout_us;
111 u8 i2c_slave_addr;
112 u8 pmic_reg;
113 unsigned long (*vsel_to_uv) (const u8 vsel);
114 u8 (*uv_to_vsel) (unsigned long uV);
115};
116
117unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm);
118void omap_vp_enable(struct voltagedomain *voltdm);
119void omap_vp_disable(struct voltagedomain *voltdm);
120int omap_voltage_scale_vdd(struct voltagedomain *voltdm,
121 unsigned long target_volt);
122void omap_voltage_reset(struct voltagedomain *voltdm);
123void omap_voltage_get_volttable(struct voltagedomain *voltdm,
124 struct omap_volt_data **volt_data);
125struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
126 unsigned long volt);
127unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm);
128struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm);
129#ifdef CONFIG_PM
130int omap_voltage_register_pmic(struct voltagedomain *voltdm,
131 struct omap_volt_pmic_info *pmic_info);
132void omap_change_voltscale_method(struct voltagedomain *voltdm,
133 int voltscale_method);
134int omap_voltage_late_init(void);
135#else
136static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm,
137 struct omap_volt_pmic_info *pmic_info) {}
138static inline void omap_change_voltscale_method(struct voltagedomain *voltdm,
139 int voltscale_method) {}
140static inline int omap_voltage_late_init(void)
141{
142 return -EINVAL;
143}
144#endif
145
146#endif
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index b0078cf96281..f1295fafcd31 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -136,61 +136,3 @@ void omap_iounmap(volatile void __iomem *addr)
136 __iounmap(addr); 136 __iounmap(addr);
137} 137}
138EXPORT_SYMBOL(omap_iounmap); 138EXPORT_SYMBOL(omap_iounmap);
139
140/*
141 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
142 */
143
144u8 omap_readb(u32 pa)
145{
146 if (cpu_class_is_omap1())
147 return __raw_readb(OMAP1_IO_ADDRESS(pa));
148 else
149 return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
150}
151EXPORT_SYMBOL(omap_readb);
152
153u16 omap_readw(u32 pa)
154{
155 if (cpu_class_is_omap1())
156 return __raw_readw(OMAP1_IO_ADDRESS(pa));
157 else
158 return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
159}
160EXPORT_SYMBOL(omap_readw);
161
162u32 omap_readl(u32 pa)
163{
164 if (cpu_class_is_omap1())
165 return __raw_readl(OMAP1_IO_ADDRESS(pa));
166 else
167 return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
168}
169EXPORT_SYMBOL(omap_readl);
170
171void omap_writeb(u8 v, u32 pa)
172{
173 if (cpu_class_is_omap1())
174 __raw_writeb(v, OMAP1_IO_ADDRESS(pa));
175 else
176 __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
177}
178EXPORT_SYMBOL(omap_writeb);
179
180void omap_writew(u16 v, u32 pa)
181{
182 if (cpu_class_is_omap1())
183 __raw_writew(v, OMAP1_IO_ADDRESS(pa));
184 else
185 __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
186}
187EXPORT_SYMBOL(omap_writew);
188
189void omap_writel(u32 v, u32 pa)
190{
191 if (cpu_class_is_omap1())
192 __raw_writel(v, OMAP1_IO_ADDRESS(pa));
193 else
194 __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
195}
196EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 6cd151b31bc5..b1107c08da56 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -830,6 +830,28 @@ static int device_match_by_alias(struct device *dev, void *data)
830} 830}
831 831
832/** 832/**
833 * iommu_set_da_range - Set a valid device address range
834 * @obj: target iommu
835 * @start Start of valid range
836 * @end End of valid range
837 **/
838int iommu_set_da_range(struct iommu *obj, u32 start, u32 end)
839{
840
841 if (!obj)
842 return -EFAULT;
843
844 if (end < start || !PAGE_ALIGN(start | end))
845 return -EINVAL;
846
847 obj->da_start = start;
848 obj->da_end = end;
849
850 return 0;
851}
852EXPORT_SYMBOL_GPL(iommu_set_da_range);
853
854/**
833 * iommu_get - Get iommu handler 855 * iommu_get - Get iommu handler
834 * @name: target iommu name 856 * @name: target iommu name
835 **/ 857 **/
@@ -922,6 +944,8 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
922 obj->name = pdata->name; 944 obj->name = pdata->name;
923 obj->dev = &pdev->dev; 945 obj->dev = &pdev->dev;
924 obj->ctx = (void *)obj + sizeof(*obj); 946 obj->ctx = (void *)obj + sizeof(*obj);
947 obj->da_start = pdata->da_start;
948 obj->da_end = pdata->da_end;
925 949
926 mutex_init(&obj->iommu_lock); 950 mutex_init(&obj->iommu_lock);
927 mutex_init(&obj->mmap_lock); 951 mutex_init(&obj->mmap_lock);
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 8ce0de247c71..6dc1296c8c77 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -87,35 +87,43 @@ static size_t sgtable_len(const struct sg_table *sgt)
87} 87}
88#define sgtable_ok(x) (!!sgtable_len(x)) 88#define sgtable_ok(x) (!!sgtable_len(x))
89 89
90static unsigned max_alignment(u32 addr)
91{
92 int i;
93 unsigned pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
94 for (i = 0; i < ARRAY_SIZE(pagesize) && addr & (pagesize[i] - 1); i++)
95 ;
96 return (i < ARRAY_SIZE(pagesize)) ? pagesize[i] : 0;
97}
98
90/* 99/*
91 * calculate the optimal number sg elements from total bytes based on 100 * calculate the optimal number sg elements from total bytes based on
92 * iommu superpages 101 * iommu superpages
93 */ 102 */
94static unsigned int sgtable_nents(size_t bytes) 103static unsigned sgtable_nents(size_t bytes, u32 da, u32 pa)
95{ 104{
96 int i; 105 unsigned nr_entries = 0, ent_sz;
97 unsigned int nr_entries;
98 const unsigned long pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
99 106
100 if (!IS_ALIGNED(bytes, PAGE_SIZE)) { 107 if (!IS_ALIGNED(bytes, PAGE_SIZE)) {
101 pr_err("%s: wrong size %08x\n", __func__, bytes); 108 pr_err("%s: wrong size %08x\n", __func__, bytes);
102 return 0; 109 return 0;
103 } 110 }
104 111
105 nr_entries = 0; 112 while (bytes) {
106 for (i = 0; i < ARRAY_SIZE(pagesize); i++) { 113 ent_sz = max_alignment(da | pa);
107 if (bytes >= pagesize[i]) { 114 ent_sz = min_t(unsigned, ent_sz, iopgsz_max(bytes));
108 nr_entries += (bytes / pagesize[i]); 115 nr_entries++;
109 bytes %= pagesize[i]; 116 da += ent_sz;
110 } 117 pa += ent_sz;
118 bytes -= ent_sz;
111 } 119 }
112 BUG_ON(bytes);
113 120
114 return nr_entries; 121 return nr_entries;
115} 122}
116 123
117/* allocate and initialize sg_table header(a kind of 'superblock') */ 124/* allocate and initialize sg_table header(a kind of 'superblock') */
118static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags) 125static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags,
126 u32 da, u32 pa)
119{ 127{
120 unsigned int nr_entries; 128 unsigned int nr_entries;
121 int err; 129 int err;
@@ -127,9 +135,8 @@ static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags)
127 if (!IS_ALIGNED(bytes, PAGE_SIZE)) 135 if (!IS_ALIGNED(bytes, PAGE_SIZE))
128 return ERR_PTR(-EINVAL); 136 return ERR_PTR(-EINVAL);
129 137
130 /* FIXME: IOVMF_DA_FIXED should support 'superpages' */ 138 if (flags & IOVMF_LINEAR) {
131 if ((flags & IOVMF_LINEAR) && (flags & IOVMF_DA_ANON)) { 139 nr_entries = sgtable_nents(bytes, da, pa);
132 nr_entries = sgtable_nents(bytes);
133 if (!nr_entries) 140 if (!nr_entries)
134 return ERR_PTR(-EINVAL); 141 return ERR_PTR(-EINVAL);
135 } else 142 } else
@@ -273,13 +280,14 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
273 alignement = PAGE_SIZE; 280 alignement = PAGE_SIZE;
274 281
275 if (flags & IOVMF_DA_ANON) { 282 if (flags & IOVMF_DA_ANON) {
276 /* 283 start = obj->da_start;
277 * Reserve the first page for NULL 284
278 */
279 start = PAGE_SIZE;
280 if (flags & IOVMF_LINEAR) 285 if (flags & IOVMF_LINEAR)
281 alignement = iopgsz_max(bytes); 286 alignement = iopgsz_max(bytes);
282 start = roundup(start, alignement); 287 start = roundup(start, alignement);
288 } else if (start < obj->da_start || start > obj->da_end ||
289 obj->da_end - start < bytes) {
290 return ERR_PTR(-EINVAL);
283 } 291 }
284 292
285 tmp = NULL; 293 tmp = NULL;
@@ -289,19 +297,19 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
289 prev_end = 0; 297 prev_end = 0;
290 list_for_each_entry(tmp, &obj->mmap, list) { 298 list_for_each_entry(tmp, &obj->mmap, list) {
291 299
292 if (prev_end >= start) 300 if (prev_end > start)
293 break; 301 break;
294 302
295 if (start + bytes < tmp->da_start) 303 if (tmp->da_start > start && (tmp->da_start - start) >= bytes)
296 goto found; 304 goto found;
297 305
298 if (flags & IOVMF_DA_ANON) 306 if (tmp->da_end >= start && flags & IOVMF_DA_ANON)
299 start = roundup(tmp->da_end + 1, alignement); 307 start = roundup(tmp->da_end + 1, alignement);
300 308
301 prev_end = tmp->da_end; 309 prev_end = tmp->da_end;
302 } 310 }
303 311
304 if ((start > prev_end) && (ULONG_MAX - start >= bytes)) 312 if ((start >= prev_end) && (obj->da_end - start >= bytes))
305 goto found; 313 goto found;
306 314
307 dev_dbg(obj->dev, "%s: no space to fit %08x(%x) flags: %08x\n", 315 dev_dbg(obj->dev, "%s: no space to fit %08x(%x) flags: %08x\n",
@@ -409,7 +417,8 @@ static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
409 BUG_ON(!sgt); 417 BUG_ON(!sgt);
410} 418}
411 419
412static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len) 420static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, u32 da,
421 size_t len)
413{ 422{
414 unsigned int i; 423 unsigned int i;
415 struct scatterlist *sg; 424 struct scatterlist *sg;
@@ -418,9 +427,10 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
418 va = phys_to_virt(pa); 427 va = phys_to_virt(pa);
419 428
420 for_each_sg(sgt->sgl, sg, sgt->nents, i) { 429 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
421 size_t bytes; 430 unsigned bytes;
422 431
423 bytes = iopgsz_max(len); 432 bytes = max_alignment(da | pa);
433 bytes = min_t(unsigned, bytes, iopgsz_max(len));
424 434
425 BUG_ON(!iopgsz_ok(bytes)); 435 BUG_ON(!iopgsz_ok(bytes));
426 436
@@ -429,6 +439,7 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
429 * 'pa' is cotinuous(linear). 439 * 'pa' is cotinuous(linear).
430 */ 440 */
431 pa += bytes; 441 pa += bytes;
442 da += bytes;
432 len -= bytes; 443 len -= bytes;
433 } 444 }
434 BUG_ON(len); 445 BUG_ON(len);
@@ -695,18 +706,18 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
695 if (!va) 706 if (!va)
696 return -ENOMEM; 707 return -ENOMEM;
697 708
698 sgt = sgtable_alloc(bytes, flags); 709 flags &= IOVMF_HW_MASK;
710 flags |= IOVMF_DISCONT;
711 flags |= IOVMF_ALLOC;
712 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
713
714 sgt = sgtable_alloc(bytes, flags, da, 0);
699 if (IS_ERR(sgt)) { 715 if (IS_ERR(sgt)) {
700 da = PTR_ERR(sgt); 716 da = PTR_ERR(sgt);
701 goto err_sgt_alloc; 717 goto err_sgt_alloc;
702 } 718 }
703 sgtable_fill_vmalloc(sgt, va); 719 sgtable_fill_vmalloc(sgt, va);
704 720
705 flags &= IOVMF_HW_MASK;
706 flags |= IOVMF_DISCONT;
707 flags |= IOVMF_ALLOC;
708 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
709
710 da = __iommu_vmap(obj, da, sgt, va, bytes, flags); 721 da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
711 if (IS_ERR_VALUE(da)) 722 if (IS_ERR_VALUE(da))
712 goto err_iommu_vmap; 723 goto err_iommu_vmap;
@@ -746,11 +757,11 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va,
746{ 757{
747 struct sg_table *sgt; 758 struct sg_table *sgt;
748 759
749 sgt = sgtable_alloc(bytes, flags); 760 sgt = sgtable_alloc(bytes, flags, da, pa);
750 if (IS_ERR(sgt)) 761 if (IS_ERR(sgt))
751 return PTR_ERR(sgt); 762 return PTR_ERR(sgt);
752 763
753 sgtable_fill_kmalloc(sgt, pa, bytes); 764 sgtable_fill_kmalloc(sgt, pa, da, bytes);
754 765
755 da = map_iommu_region(obj, da, sgt, va, bytes, flags); 766 da = map_iommu_region(obj, da, sgt, va, bytes, flags);
756 if (IS_ERR_VALUE(da)) { 767 if (IS_ERR_VALUE(da)) {
@@ -811,7 +822,7 @@ void iommu_kunmap(struct iommu *obj, u32 da)
811 struct sg_table *sgt; 822 struct sg_table *sgt;
812 typedef void (*func_t)(const void *); 823 typedef void (*func_t)(const void *);
813 824
814 sgt = unmap_vm_area(obj, da, (func_t)__iounmap, 825 sgt = unmap_vm_area(obj, da, (func_t)iounmap,
815 IOVMF_LINEAR | IOVMF_MMIO); 826 IOVMF_LINEAR | IOVMF_MMIO);
816 if (!sgt) 827 if (!sgt)
817 dev_dbg(obj->dev, "%s: No sgt\n", __func__); 828 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index d2fafb892f7f..459b319a9fad 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -28,12 +28,12 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/kfifo.h> 29#include <linux/kfifo.h>
30#include <linux/err.h> 30#include <linux/err.h>
31#include <linux/notifier.h>
31 32
32#include <plat/mailbox.h> 33#include <plat/mailbox.h>
33 34
34static struct workqueue_struct *mboxd; 35static struct workqueue_struct *mboxd;
35static struct omap_mbox **mboxes; 36static struct omap_mbox **mboxes;
36static bool rq_full;
37 37
38static int mbox_configured; 38static int mbox_configured;
39static DEFINE_MUTEX(mbox_configured_lock); 39static DEFINE_MUTEX(mbox_configured_lock);
@@ -93,20 +93,25 @@ int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
93 struct omap_mbox_queue *mq = mbox->txq; 93 struct omap_mbox_queue *mq = mbox->txq;
94 int ret = 0, len; 94 int ret = 0, len;
95 95
96 spin_lock(&mq->lock); 96 spin_lock_bh(&mq->lock);
97 97
98 if (kfifo_avail(&mq->fifo) < sizeof(msg)) { 98 if (kfifo_avail(&mq->fifo) < sizeof(msg)) {
99 ret = -ENOMEM; 99 ret = -ENOMEM;
100 goto out; 100 goto out;
101 } 101 }
102 102
103 if (kfifo_is_empty(&mq->fifo) && !__mbox_poll_for_space(mbox)) {
104 mbox_fifo_write(mbox, msg);
105 goto out;
106 }
107
103 len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg)); 108 len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
104 WARN_ON(len != sizeof(msg)); 109 WARN_ON(len != sizeof(msg));
105 110
106 tasklet_schedule(&mbox->txq->tasklet); 111 tasklet_schedule(&mbox->txq->tasklet);
107 112
108out: 113out:
109 spin_unlock(&mq->lock); 114 spin_unlock_bh(&mq->lock);
110 return ret; 115 return ret;
111} 116}
112EXPORT_SYMBOL(omap_mbox_msg_send); 117EXPORT_SYMBOL(omap_mbox_msg_send);
@@ -146,8 +151,14 @@ static void mbox_rx_work(struct work_struct *work)
146 len = kfifo_out(&mq->fifo, (unsigned char *)&msg, sizeof(msg)); 151 len = kfifo_out(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
147 WARN_ON(len != sizeof(msg)); 152 WARN_ON(len != sizeof(msg));
148 153
149 if (mq->callback) 154 blocking_notifier_call_chain(&mq->mbox->notifier, len,
150 mq->callback((void *)msg); 155 (void *)msg);
156 spin_lock_irq(&mq->lock);
157 if (mq->full) {
158 mq->full = false;
159 omap_mbox_enable_irq(mq->mbox, IRQ_RX);
160 }
161 spin_unlock_irq(&mq->lock);
151 } 162 }
152} 163}
153 164
@@ -170,7 +181,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
170 while (!mbox_fifo_empty(mbox)) { 181 while (!mbox_fifo_empty(mbox)) {
171 if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) { 182 if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) {
172 omap_mbox_disable_irq(mbox, IRQ_RX); 183 omap_mbox_disable_irq(mbox, IRQ_RX);
173 rq_full = true; 184 mq->full = true;
174 goto nomem; 185 goto nomem;
175 } 186 }
176 187
@@ -239,73 +250,77 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
239 int ret = 0; 250 int ret = 0;
240 struct omap_mbox_queue *mq; 251 struct omap_mbox_queue *mq;
241 252
242 if (mbox->ops->startup) { 253 mutex_lock(&mbox_configured_lock);
243 mutex_lock(&mbox_configured_lock); 254 if (!mbox_configured++) {
244 if (!mbox_configured) 255 if (likely(mbox->ops->startup)) {
245 ret = mbox->ops->startup(mbox); 256 ret = mbox->ops->startup(mbox);
246 257 if (unlikely(ret))
247 if (ret) { 258 goto fail_startup;
248 mutex_unlock(&mbox_configured_lock); 259 } else
249 return ret; 260 goto fail_startup;
250 }
251 mbox_configured++;
252 mutex_unlock(&mbox_configured_lock);
253 }
254
255 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
256 mbox->name, mbox);
257 if (ret) {
258 printk(KERN_ERR
259 "failed to register mailbox interrupt:%d\n", ret);
260 goto fail_request_irq;
261 } 261 }
262 262
263 mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet); 263 if (!mbox->use_count++) {
264 if (!mq) { 264 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
265 ret = -ENOMEM; 265 mbox->name, mbox);
266 goto fail_alloc_txq; 266 if (unlikely(ret)) {
267 } 267 pr_err("failed to register mailbox interrupt:%d\n",
268 mbox->txq = mq; 268 ret);
269 goto fail_request_irq;
270 }
271 mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet);
272 if (!mq) {
273 ret = -ENOMEM;
274 goto fail_alloc_txq;
275 }
276 mbox->txq = mq;
269 277
270 mq = mbox_queue_alloc(mbox, mbox_rx_work, NULL); 278 mq = mbox_queue_alloc(mbox, mbox_rx_work, NULL);
271 if (!mq) { 279 if (!mq) {
272 ret = -ENOMEM; 280 ret = -ENOMEM;
273 goto fail_alloc_rxq; 281 goto fail_alloc_rxq;
282 }
283 mbox->rxq = mq;
284 mq->mbox = mbox;
274 } 285 }
275 mbox->rxq = mq; 286 mutex_unlock(&mbox_configured_lock);
276
277 return 0; 287 return 0;
278 288
279 fail_alloc_rxq: 289fail_alloc_rxq:
280 mbox_queue_free(mbox->txq); 290 mbox_queue_free(mbox->txq);
281 fail_alloc_txq: 291fail_alloc_txq:
282 free_irq(mbox->irq, mbox); 292 free_irq(mbox->irq, mbox);
283 fail_request_irq: 293fail_request_irq:
284 if (mbox->ops->shutdown) 294 if (mbox->ops->shutdown)
285 mbox->ops->shutdown(mbox); 295 mbox->ops->shutdown(mbox);
286 296 mbox->use_count--;
297fail_startup:
298 mbox_configured--;
299 mutex_unlock(&mbox_configured_lock);
287 return ret; 300 return ret;
288} 301}
289 302
290static void omap_mbox_fini(struct omap_mbox *mbox) 303static void omap_mbox_fini(struct omap_mbox *mbox)
291{ 304{
292 free_irq(mbox->irq, mbox); 305 mutex_lock(&mbox_configured_lock);
293 tasklet_kill(&mbox->txq->tasklet); 306
294 flush_work(&mbox->rxq->work); 307 if (!--mbox->use_count) {
295 mbox_queue_free(mbox->txq); 308 free_irq(mbox->irq, mbox);
296 mbox_queue_free(mbox->rxq); 309 tasklet_kill(&mbox->txq->tasklet);
310 flush_work(&mbox->rxq->work);
311 mbox_queue_free(mbox->txq);
312 mbox_queue_free(mbox->rxq);
313 }
297 314
298 if (mbox->ops->shutdown) { 315 if (likely(mbox->ops->shutdown)) {
299 mutex_lock(&mbox_configured_lock); 316 if (!--mbox_configured)
300 if (mbox_configured > 0)
301 mbox_configured--;
302 if (!mbox_configured)
303 mbox->ops->shutdown(mbox); 317 mbox->ops->shutdown(mbox);
304 mutex_unlock(&mbox_configured_lock);
305 } 318 }
319
320 mutex_unlock(&mbox_configured_lock);
306} 321}
307 322
308struct omap_mbox *omap_mbox_get(const char *name) 323struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
309{ 324{
310 struct omap_mbox *mbox; 325 struct omap_mbox *mbox;
311 int ret; 326 int ret;
@@ -324,12 +339,16 @@ struct omap_mbox *omap_mbox_get(const char *name)
324 if (ret) 339 if (ret)
325 return ERR_PTR(-ENODEV); 340 return ERR_PTR(-ENODEV);
326 341
342 if (nb)
343 blocking_notifier_chain_register(&mbox->notifier, nb);
344
327 return mbox; 345 return mbox;
328} 346}
329EXPORT_SYMBOL(omap_mbox_get); 347EXPORT_SYMBOL(omap_mbox_get);
330 348
331void omap_mbox_put(struct omap_mbox *mbox) 349void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb)
332{ 350{
351 blocking_notifier_chain_unregister(&mbox->notifier, nb);
333 omap_mbox_fini(mbox); 352 omap_mbox_fini(mbox);
334} 353}
335EXPORT_SYMBOL(omap_mbox_put); 354EXPORT_SYMBOL(omap_mbox_put);
@@ -353,6 +372,8 @@ int omap_mbox_register(struct device *parent, struct omap_mbox **list)
353 ret = PTR_ERR(mbox->dev); 372 ret = PTR_ERR(mbox->dev);
354 goto err_out; 373 goto err_out;
355 } 374 }
375
376 BLOCKING_INIT_NOTIFIER_HEAD(&mbox->notifier);
356 } 377 }
357 return 0; 378 return 0;
358 379
@@ -391,7 +412,8 @@ static int __init omap_mbox_init(void)
391 412
392 /* kfifo size sanity check: alignment and minimal size */ 413 /* kfifo size sanity check: alignment and minimal size */
393 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t)); 414 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
394 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(mbox_msg_t)); 415 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size,
416 sizeof(mbox_msg_t));
395 417
396 return 0; 418 return 0;
397} 419}
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index eac4b978e9fd..b5a6e178a7f9 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -28,6 +28,8 @@
28#include <plat/dma.h> 28#include <plat/dma.h>
29#include <plat/mcbsp.h> 29#include <plat/mcbsp.h>
30 30
31/* XXX These "sideways" includes are a sign that something is wrong */
32#include "../mach-omap2/cm2xxx_3xxx.h"
31#include "../mach-omap2/cm-regbits-34xx.h" 33#include "../mach-omap2/cm-regbits-34xx.h"
32 34
33struct omap_mcbsp **mcbsp_ptr; 35struct omap_mcbsp **mcbsp_ptr;
@@ -234,9 +236,9 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
234 * Sidetone uses McBSP ICLK - which must not idle when sidetones 236 * Sidetone uses McBSP ICLK - which must not idle when sidetones
235 * are enabled or sidetones start sounding ugly. 237 * are enabled or sidetones start sounding ugly.
236 */ 238 */
237 w = cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE); 239 w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
238 w &= ~(1 << (mcbsp->id - 2)); 240 w &= ~(1 << (mcbsp->id - 2));
239 cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE); 241 omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
240 242
241 /* Enable McBSP Sidetone */ 243 /* Enable McBSP Sidetone */
242 w = MCBSP_READ(mcbsp, SSELCR); 244 w = MCBSP_READ(mcbsp, SSELCR);
@@ -263,9 +265,9 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
263 w = MCBSP_READ(mcbsp, SSELCR); 265 w = MCBSP_READ(mcbsp, SSELCR);
264 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); 266 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
265 267
266 w = cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE); 268 w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
267 w |= 1 << (mcbsp->id - 2); 269 w |= 1 << (mcbsp->id - 2);
268 cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE); 270 omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
269} 271}
270 272
271static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) 273static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
@@ -755,7 +757,7 @@ int omap_mcbsp_request(unsigned int id)
755 goto err_kfree; 757 goto err_kfree;
756 } 758 }
757 759
758 mcbsp->free = 0; 760 mcbsp->free = false;
759 mcbsp->reg_cache = reg_cache; 761 mcbsp->reg_cache = reg_cache;
760 spin_unlock(&mcbsp->lock); 762 spin_unlock(&mcbsp->lock);
761 763
@@ -815,7 +817,7 @@ err_clk_disable:
815 clk_disable(mcbsp->iclk); 817 clk_disable(mcbsp->iclk);
816 818
817 spin_lock(&mcbsp->lock); 819 spin_lock(&mcbsp->lock);
818 mcbsp->free = 1; 820 mcbsp->free = true;
819 mcbsp->reg_cache = NULL; 821 mcbsp->reg_cache = NULL;
820err_kfree: 822err_kfree:
821 spin_unlock(&mcbsp->lock); 823 spin_unlock(&mcbsp->lock);
@@ -858,7 +860,7 @@ void omap_mcbsp_free(unsigned int id)
858 if (mcbsp->free) 860 if (mcbsp->free)
859 dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id); 861 dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
860 else 862 else
861 mcbsp->free = 1; 863 mcbsp->free = true;
862 mcbsp->reg_cache = NULL; 864 mcbsp->reg_cache = NULL;
863 spin_unlock(&mcbsp->lock); 865 spin_unlock(&mcbsp->lock);
864 866
@@ -1771,7 +1773,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
1771 1773
1772 spin_lock_init(&mcbsp->lock); 1774 spin_lock_init(&mcbsp->lock);
1773 mcbsp->id = id + 1; 1775 mcbsp->id = id + 1;
1774 mcbsp->free = 1; 1776 mcbsp->free = true;
1775 mcbsp->dma_tx_lch = -1; 1777 mcbsp->dma_tx_lch = -1;
1776 mcbsp->dma_rx_lch = -1; 1778 mcbsp->dma_rx_lch = -1;
1777 1779
@@ -1836,17 +1838,11 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
1836 1838
1837 omap34xx_device_exit(mcbsp); 1839 omap34xx_device_exit(mcbsp);
1838 1840
1839 clk_disable(mcbsp->fclk);
1840 clk_disable(mcbsp->iclk);
1841 clk_put(mcbsp->fclk); 1841 clk_put(mcbsp->fclk);
1842 clk_put(mcbsp->iclk); 1842 clk_put(mcbsp->iclk);
1843 1843
1844 iounmap(mcbsp->io_base); 1844 iounmap(mcbsp->io_base);
1845 1845 kfree(mcbsp);
1846 mcbsp->fclk = NULL;
1847 mcbsp->iclk = NULL;
1848 mcbsp->free = 0;
1849 mcbsp->dev = NULL;
1850 } 1846 }
1851 1847
1852 return 0; 1848 return 0;
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index e129ce80c53b..b0471bb2d47d 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -20,15 +20,14 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/cpufreq.h> 21#include <linux/cpufreq.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/platform_device.h>
23 24
24/* Interface documentation is in mach/omap-pm.h */ 25/* Interface documentation is in mach/omap-pm.h */
25#include <plat/omap-pm.h> 26#include <plat/omap-pm.h>
27#include <plat/omap_device.h>
26 28
27#include <plat/powerdomain.h> 29static bool off_mode_enabled;
28 30static u32 dummy_context_loss_counter;
29struct omap_opp *dsp_opps;
30struct omap_opp *mpu_opps;
31struct omap_opp *l3_opps;
32 31
33/* 32/*
34 * Device-driver-originated constraints (via board-*.c files) 33 * Device-driver-originated constraints (via board-*.c files)
@@ -284,37 +283,70 @@ unsigned long omap_pm_cpu_get_freq(void)
284 return 0; 283 return 0;
285} 284}
286 285
286/**
287 * omap_pm_enable_off_mode - notify OMAP PM that off-mode is enabled
288 *
289 * Intended for use only by OMAP PM core code to notify this layer
290 * that off mode has been enabled.
291 */
292void omap_pm_enable_off_mode(void)
293{
294 off_mode_enabled = true;
295}
296
297/**
298 * omap_pm_disable_off_mode - notify OMAP PM that off-mode is disabled
299 *
300 * Intended for use only by OMAP PM core code to notify this layer
301 * that off mode has been disabled.
302 */
303void omap_pm_disable_off_mode(void)
304{
305 off_mode_enabled = false;
306}
307
287/* 308/*
288 * Device context loss tracking 309 * Device context loss tracking
289 */ 310 */
290 311
291int omap_pm_get_dev_context_loss_count(struct device *dev) 312#ifdef CONFIG_ARCH_OMAP2PLUS
313
314u32 omap_pm_get_dev_context_loss_count(struct device *dev)
292{ 315{
293 if (!dev) { 316 struct platform_device *pdev = to_platform_device(dev);
294 WARN_ON(1); 317 u32 count;
295 return -EINVAL; 318
296 }; 319 if (WARN_ON(!dev))
320 return 0;
321
322 if (dev->parent == &omap_device_parent) {
323 count = omap_device_get_context_loss_count(pdev);
324 } else {
325 WARN_ONCE(off_mode_enabled, "omap_pm: using dummy context loss counter; device %s should be converted to omap_device",
326 dev_name(dev));
327 if (off_mode_enabled)
328 dummy_context_loss_counter++;
329 count = dummy_context_loss_counter;
330 }
297 331
298 pr_debug("OMAP PM: returning context loss count for dev %s\n", 332 pr_debug("OMAP PM: context loss count for dev %s = %d\n",
299 dev_name(dev)); 333 dev_name(dev), count);
300 334
301 /* 335 return count;
302 * Map the device to the powerdomain. Return the powerdomain 336}
303 * off counter.
304 */
305 337
306 return 0; 338#else
339
340u32 omap_pm_get_dev_context_loss_count(struct device *dev)
341{
342 return dummy_context_loss_counter;
307} 343}
308 344
345#endif
309 346
310/* Should be called before clk framework init */ 347/* Should be called before clk framework init */
311int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table, 348int __init omap_pm_if_early_init(void)
312 struct omap_opp *dsp_opp_table,
313 struct omap_opp *l3_opp_table)
314{ 349{
315 mpu_opps = mpu_opp_table;
316 dsp_opps = dsp_opp_table;
317 l3_opps = l3_opp_table;
318 return 0; 350 return 0;
319} 351}
320 352
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index abe933cd8f09..57adb270767b 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -280,6 +280,34 @@ static void _add_optional_clock_alias(struct omap_device *od,
280/* Public functions for use by core code */ 280/* Public functions for use by core code */
281 281
282/** 282/**
283 * omap_device_get_context_loss_count - get lost context count
284 * @od: struct omap_device *
285 *
286 * Using the primary hwmod, query the context loss count for this
287 * device.
288 *
289 * Callers should consider context for this device lost any time this
290 * function returns a value different than the value the caller got
291 * the last time it called this function.
292 *
293 * If any hwmods exist for the omap_device assoiated with @pdev,
294 * return the context loss counter for that hwmod, otherwise return
295 * zero.
296 */
297u32 omap_device_get_context_loss_count(struct platform_device *pdev)
298{
299 struct omap_device *od;
300 u32 ret = 0;
301
302 od = _find_by_pdev(pdev);
303
304 if (od->hwmods_cnt)
305 ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
306
307 return ret;
308}
309
310/**
283 * omap_device_count_resources - count number of struct resource entries needed 311 * omap_device_count_resources - count number of struct resource entries needed
284 * @od: struct omap_device * 312 * @od: struct omap_device *
285 * 313 *
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 74dac419d328..e26e50487d60 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -33,23 +33,21 @@
33 33
34#include "sram.h" 34#include "sram.h"
35#include "fb.h" 35#include "fb.h"
36
37/* XXX These "sideways" includes are a sign that something is wrong */
36#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 38#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
37# include "../mach-omap2/prm.h" 39# include "../mach-omap2/prm2xxx_3xxx.h"
38# include "../mach-omap2/cm.h"
39# include "../mach-omap2/sdrc.h" 40# include "../mach-omap2/sdrc.h"
40#endif 41#endif
41 42
42#define OMAP1_SRAM_PA 0x20000000 43#define OMAP1_SRAM_PA 0x20000000
43#define OMAP1_SRAM_VA VMALLOC_END 44#define OMAP1_SRAM_VA VMALLOC_END
44#define OMAP2_SRAM_PA 0x40200000 45#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800)
45#define OMAP2_SRAM_PUB_PA 0x4020f800
46#define OMAP2_SRAM_VA 0xfe400000 46#define OMAP2_SRAM_VA 0xfe400000
47#define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800) 47#define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800)
48#define OMAP3_SRAM_PA 0x40200000
49#define OMAP3_SRAM_VA 0xfe400000 48#define OMAP3_SRAM_VA 0xfe400000
50#define OMAP3_SRAM_PUB_PA 0x40208000 49#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000)
51#define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000) 50#define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000)
52#define OMAP4_SRAM_PA 0x40300000
53#define OMAP4_SRAM_VA 0xfe400000 51#define OMAP4_SRAM_VA 0xfe400000
54#define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000) 52#define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000)
55#define OMAP4_SRAM_PUB_VA (OMAP4_SRAM_VA + 0x4000) 53#define OMAP4_SRAM_PUB_VA (OMAP4_SRAM_VA + 0x4000)
@@ -270,7 +268,7 @@ void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
270 _omap_sram_reprogram_clock(dpllctl, ckctl); 268 _omap_sram_reprogram_clock(dpllctl, ckctl);
271} 269}
272 270
273int __init omap1_sram_init(void) 271static int __init omap1_sram_init(void)
274{ 272{
275 _omap_sram_reprogram_clock = 273 _omap_sram_reprogram_clock =
276 omap_sram_push(omap1_sram_reprogram_clock, 274 omap_sram_push(omap1_sram_reprogram_clock,
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index b33c78586bfc..9d090833e245 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -39,6 +39,7 @@
39#include <linux/io.h> 39#include <linux/io.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/i2c-omap.h> 41#include <linux/i2c-omap.h>
42#include <linux/pm_runtime.h>
42 43
43/* I2C controller revisions */ 44/* I2C controller revisions */
44#define OMAP_I2C_REV_2 0x20 45#define OMAP_I2C_REV_2 0x20
@@ -175,8 +176,6 @@ struct omap_i2c_dev {
175 void __iomem *base; /* virtual */ 176 void __iomem *base; /* virtual */
176 int irq; 177 int irq;
177 int reg_shift; /* bit shift for I2C register addresses */ 178 int reg_shift; /* bit shift for I2C register addresses */
178 struct clk *iclk; /* Interface clock */
179 struct clk *fclk; /* Functional clock */
180 struct completion cmd_complete; 179 struct completion cmd_complete;
181 struct resource *ioarea; 180 struct resource *ioarea;
182 u32 latency; /* maximum mpu wkup latency */ 181 u32 latency; /* maximum mpu wkup latency */
@@ -265,45 +264,18 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg)
265 (i2c_dev->regs[reg] << i2c_dev->reg_shift)); 264 (i2c_dev->regs[reg] << i2c_dev->reg_shift));
266} 265}
267 266
268static int __init omap_i2c_get_clocks(struct omap_i2c_dev *dev) 267static void omap_i2c_unidle(struct omap_i2c_dev *dev)
269{ 268{
270 int ret; 269 struct platform_device *pdev;
270 struct omap_i2c_bus_platform_data *pdata;
271 271
272 dev->iclk = clk_get(dev->dev, "ick"); 272 WARN_ON(!dev->idle);
273 if (IS_ERR(dev->iclk)) {
274 ret = PTR_ERR(dev->iclk);
275 dev->iclk = NULL;
276 return ret;
277 }
278 273
279 dev->fclk = clk_get(dev->dev, "fck"); 274 pdev = to_platform_device(dev->dev);
280 if (IS_ERR(dev->fclk)) { 275 pdata = pdev->dev.platform_data;
281 ret = PTR_ERR(dev->fclk);
282 if (dev->iclk != NULL) {
283 clk_put(dev->iclk);
284 dev->iclk = NULL;
285 }
286 dev->fclk = NULL;
287 return ret;
288 }
289 276
290 return 0; 277 pm_runtime_get_sync(&pdev->dev);
291}
292 278
293static void omap_i2c_put_clocks(struct omap_i2c_dev *dev)
294{
295 clk_put(dev->fclk);
296 dev->fclk = NULL;
297 clk_put(dev->iclk);
298 dev->iclk = NULL;
299}
300
301static void omap_i2c_unidle(struct omap_i2c_dev *dev)
302{
303 WARN_ON(!dev->idle);
304
305 clk_enable(dev->iclk);
306 clk_enable(dev->fclk);
307 if (cpu_is_omap34xx()) { 279 if (cpu_is_omap34xx()) {
308 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); 280 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
309 omap_i2c_write_reg(dev, OMAP_I2C_PSC_REG, dev->pscstate); 281 omap_i2c_write_reg(dev, OMAP_I2C_PSC_REG, dev->pscstate);
@@ -326,10 +298,15 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
326 298
327static void omap_i2c_idle(struct omap_i2c_dev *dev) 299static void omap_i2c_idle(struct omap_i2c_dev *dev)
328{ 300{
301 struct platform_device *pdev;
302 struct omap_i2c_bus_platform_data *pdata;
329 u16 iv; 303 u16 iv;
330 304
331 WARN_ON(dev->idle); 305 WARN_ON(dev->idle);
332 306
307 pdev = to_platform_device(dev->dev);
308 pdata = pdev->dev.platform_data;
309
333 dev->iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG); 310 dev->iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
334 if (dev->rev >= OMAP_I2C_REV_ON_4430) 311 if (dev->rev >= OMAP_I2C_REV_ON_4430)
335 omap_i2c_write_reg(dev, OMAP_I2C_IRQENABLE_CLR, 1); 312 omap_i2c_write_reg(dev, OMAP_I2C_IRQENABLE_CLR, 1);
@@ -345,8 +322,8 @@ static void omap_i2c_idle(struct omap_i2c_dev *dev)
345 omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); 322 omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
346 } 323 }
347 dev->idle = 1; 324 dev->idle = 1;
348 clk_disable(dev->fclk); 325
349 clk_disable(dev->iclk); 326 pm_runtime_put_sync(&pdev->dev);
350} 327}
351 328
352static int omap_i2c_init(struct omap_i2c_dev *dev) 329static int omap_i2c_init(struct omap_i2c_dev *dev)
@@ -356,6 +333,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
356 unsigned long fclk_rate = 12000000; 333 unsigned long fclk_rate = 12000000;
357 unsigned long timeout; 334 unsigned long timeout;
358 unsigned long internal_clk = 0; 335 unsigned long internal_clk = 0;
336 struct clk *fclk;
359 337
360 if (dev->rev >= OMAP_I2C_REV_2) { 338 if (dev->rev >= OMAP_I2C_REV_2) {
361 /* Disable I2C controller before soft reset */ 339 /* Disable I2C controller before soft reset */
@@ -414,7 +392,9 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
414 * always returns 12MHz for the functional clock, we can 392 * always returns 12MHz for the functional clock, we can
415 * do this bit unconditionally. 393 * do this bit unconditionally.
416 */ 394 */
417 fclk_rate = clk_get_rate(dev->fclk); 395 fclk = clk_get(dev->dev, "fck");
396 fclk_rate = clk_get_rate(fclk);
397 clk_put(fclk);
418 398
419 /* TRM for 5912 says the I2C clock must be prescaled to be 399 /* TRM for 5912 says the I2C clock must be prescaled to be
420 * between 7 - 12 MHz. The XOR input clock is typically 400 * between 7 - 12 MHz. The XOR input clock is typically
@@ -443,7 +423,9 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
443 internal_clk = 9600; 423 internal_clk = 9600;
444 else 424 else
445 internal_clk = 4000; 425 internal_clk = 4000;
446 fclk_rate = clk_get_rate(dev->fclk) / 1000; 426 fclk = clk_get(dev->dev, "fck");
427 fclk_rate = clk_get_rate(fclk) / 1000;
428 clk_put(fclk);
447 429
448 /* Compute prescaler divisor */ 430 /* Compute prescaler divisor */
449 psc = fclk_rate / internal_clk; 431 psc = fclk_rate / internal_clk;
@@ -1048,14 +1030,12 @@ omap_i2c_probe(struct platform_device *pdev)
1048 else 1030 else
1049 dev->reg_shift = 2; 1031 dev->reg_shift = 2;
1050 1032
1051 if ((r = omap_i2c_get_clocks(dev)) != 0)
1052 goto err_iounmap;
1053
1054 if (cpu_is_omap44xx()) 1033 if (cpu_is_omap44xx())
1055 dev->regs = (u8 *) omap4_reg_map; 1034 dev->regs = (u8 *) omap4_reg_map;
1056 else 1035 else
1057 dev->regs = (u8 *) reg_map; 1036 dev->regs = (u8 *) reg_map;
1058 1037
1038 pm_runtime_enable(&pdev->dev);
1059 omap_i2c_unidle(dev); 1039 omap_i2c_unidle(dev);
1060 1040
1061 dev->rev = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) & 0xff; 1041 dev->rev = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) & 0xff;
@@ -1127,8 +1107,6 @@ err_free_irq:
1127err_unuse_clocks: 1107err_unuse_clocks:
1128 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); 1108 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
1129 omap_i2c_idle(dev); 1109 omap_i2c_idle(dev);
1130 omap_i2c_put_clocks(dev);
1131err_iounmap:
1132 iounmap(dev->base); 1110 iounmap(dev->base);
1133err_free_mem: 1111err_free_mem:
1134 platform_set_drvdata(pdev, NULL); 1112 platform_set_drvdata(pdev, NULL);
@@ -1150,7 +1128,6 @@ omap_i2c_remove(struct platform_device *pdev)
1150 free_irq(dev->irq, dev); 1128 free_irq(dev->irq, dev);
1151 i2c_del_adapter(&dev->adapter); 1129 i2c_del_adapter(&dev->adapter);
1152 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); 1130 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
1153 omap_i2c_put_clocks(dev);
1154 iounmap(dev->base); 1131 iounmap(dev->base);
1155 kfree(dev); 1132 kfree(dev);
1156 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1133 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1162,7 +1139,7 @@ static struct platform_driver omap_i2c_driver = {
1162 .probe = omap_i2c_probe, 1139 .probe = omap_i2c_probe,
1163 .remove = omap_i2c_remove, 1140 .remove = omap_i2c_remove,
1164 .driver = { 1141 .driver = {
1165 .name = "i2c_omap", 1142 .name = "omap_i2c",
1166 .owner = THIS_MODULE, 1143 .owner = THIS_MODULE,
1167 }, 1144 },
1168}; 1145};
@@ -1184,4 +1161,4 @@ module_exit(omap_i2c_exit_driver);
1184MODULE_AUTHOR("MontaVista Software, Inc. (and others)"); 1161MODULE_AUTHOR("MontaVista Software, Inc. (and others)");
1185MODULE_DESCRIPTION("TI OMAP I2C bus adapter"); 1162MODULE_DESCRIPTION("TI OMAP I2C bus adapter");
1186MODULE_LICENSE("GPL"); 1163MODULE_LICENSE("GPL");
1187MODULE_ALIAS("platform:i2c_omap"); 1164MODULE_ALIAS("platform:omap_i2c");
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index a72e61ddca91..0e2a19cb43d8 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -65,7 +65,6 @@ struct omap_kp {
65 65
66static DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0); 66static DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0);
67 67
68static int *keymap;
69static unsigned int *row_gpios; 68static unsigned int *row_gpios;
70static unsigned int *col_gpios; 69static unsigned int *col_gpios;
71 70
@@ -162,20 +161,11 @@ static void omap_kp_scan_keypad(struct omap_kp *omap_kp, unsigned char *state)
162 } 161 }
163} 162}
164 163
165static inline int omap_kp_find_key(int col, int row)
166{
167 int i, key;
168
169 key = KEY(col, row, 0);
170 for (i = 0; keymap[i] != 0; i++)
171 if ((keymap[i] & 0xff000000) == key)
172 return keymap[i] & 0x00ffffff;
173 return -1;
174}
175
176static void omap_kp_tasklet(unsigned long data) 164static void omap_kp_tasklet(unsigned long data)
177{ 165{
178 struct omap_kp *omap_kp_data = (struct omap_kp *) data; 166 struct omap_kp *omap_kp_data = (struct omap_kp *) data;
167 unsigned short *keycodes = omap_kp_data->input->keycode;
168 unsigned int row_shift = get_count_order(omap_kp_data->cols);
179 unsigned char new_state[8], changed, key_down = 0; 169 unsigned char new_state[8], changed, key_down = 0;
180 int col, row; 170 int col, row;
181 int spurious = 0; 171 int spurious = 0;
@@ -199,7 +189,7 @@ static void omap_kp_tasklet(unsigned long data)
199 row, (new_state[col] & (1 << row)) ? 189 row, (new_state[col] & (1 << row)) ?
200 "pressed" : "released"); 190 "pressed" : "released");
201#else 191#else
202 key = omap_kp_find_key(col, row); 192 key = keycodes[MATRIX_SCAN_CODE(row, col, row_shift)];
203 if (key < 0) { 193 if (key < 0) {
204 printk(KERN_WARNING 194 printk(KERN_WARNING
205 "omap-keypad: Spurious key event %d-%d\n", 195 "omap-keypad: Spurious key event %d-%d\n",
@@ -298,13 +288,18 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)
298 struct input_dev *input_dev; 288 struct input_dev *input_dev;
299 struct omap_kp_platform_data *pdata = pdev->dev.platform_data; 289 struct omap_kp_platform_data *pdata = pdev->dev.platform_data;
300 int i, col_idx, row_idx, irq_idx, ret; 290 int i, col_idx, row_idx, irq_idx, ret;
291 unsigned int row_shift, keycodemax;
301 292
302 if (!pdata->rows || !pdata->cols || !pdata->keymap) { 293 if (!pdata->rows || !pdata->cols || !pdata->keymap_data) {
303 printk(KERN_ERR "No rows, cols or keymap from pdata\n"); 294 printk(KERN_ERR "No rows, cols or keymap_data from pdata\n");
304 return -EINVAL; 295 return -EINVAL;
305 } 296 }
306 297
307 omap_kp = kzalloc(sizeof(struct omap_kp), GFP_KERNEL); 298 row_shift = get_count_order(pdata->cols);
299 keycodemax = pdata->rows << row_shift;
300
301 omap_kp = kzalloc(sizeof(struct omap_kp) +
302 keycodemax * sizeof(unsigned short), GFP_KERNEL);
308 input_dev = input_allocate_device(); 303 input_dev = input_allocate_device();
309 if (!omap_kp || !input_dev) { 304 if (!omap_kp || !input_dev) {
310 kfree(omap_kp); 305 kfree(omap_kp);
@@ -320,7 +315,9 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)
320 if (!cpu_is_omap24xx()) 315 if (!cpu_is_omap24xx())
321 omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); 316 omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);
322 317
323 keymap = pdata->keymap; 318 input_dev->keycode = &omap_kp[1];
319 input_dev->keycodesize = sizeof(unsigned short);
320 input_dev->keycodemax = keycodemax;
324 321
325 if (pdata->rep) 322 if (pdata->rep)
326 __set_bit(EV_REP, input_dev->evbit); 323 __set_bit(EV_REP, input_dev->evbit);
@@ -374,8 +371,8 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)
374 371
375 /* setup input device */ 372 /* setup input device */
376 __set_bit(EV_KEY, input_dev->evbit); 373 __set_bit(EV_KEY, input_dev->evbit);
377 for (i = 0; keymap[i] != 0; i++) 374 matrix_keypad_build_keymap(pdata->keymap_data, row_shift,
378 __set_bit(keymap[i] & KEY_MAX, input_dev->keybit); 375 input_dev->keycode, input_dev->keybit);
379 input_dev->name = "omap-keypad"; 376 input_dev->name = "omap-keypad";
380 input_dev->phys = "omap-keypad/input0"; 377 input_dev->phys = "omap-keypad/input0";
381 input_dev->dev.parent = &pdev->dev; 378 input_dev->dev.parent = &pdev->dev;
@@ -416,7 +413,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)
416 return 0; 413 return 0;
417err5: 414err5:
418 for (i = irq_idx - 1; i >=0; i--) 415 for (i = irq_idx - 1; i >=0; i--)
419 free_irq(row_gpios[i], 0); 416 free_irq(row_gpios[i], NULL);
420err4: 417err4:
421 input_unregister_device(omap_kp->input); 418 input_unregister_device(omap_kp->input);
422 input_dev = NULL; 419 input_dev = NULL;
@@ -447,11 +444,11 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)
447 gpio_free(col_gpios[i]); 444 gpio_free(col_gpios[i]);
448 for (i = 0; i < omap_kp->rows; i++) { 445 for (i = 0; i < omap_kp->rows; i++) {
449 gpio_free(row_gpios[i]); 446 gpio_free(row_gpios[i]);
450 free_irq(gpio_to_irq(row_gpios[i]), 0); 447 free_irq(gpio_to_irq(row_gpios[i]), NULL);
451 } 448 }
452 } else { 449 } else {
453 omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); 450 omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);
454 free_irq(omap_kp->irq, 0); 451 free_irq(omap_kp->irq, NULL);
455 } 452 }
456 453
457 del_timer_sync(&omap_kp->timer); 454 del_timer_sync(&omap_kp->timer);
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 6256233d2bfb..bcb1fdedb595 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -214,7 +214,6 @@ config SERIO_AMS_DELTA
214 tristate "Amstrad Delta (E3) mailboard support" 214 tristate "Amstrad Delta (E3) mailboard support"
215 depends on MACH_AMS_DELTA 215 depends on MACH_AMS_DELTA
216 default y 216 default y
217 select AMS_DELTA_FIQ
218 ---help--- 217 ---help---
219 Say Y here if you have an E3 and want to use its mailboard, 218 Say Y here if you have an E3 and want to use its mailboard,
220 or any standard AT keyboard connected to the mailboard port. 219 or any standard AT keyboard connected to the mailboard port.
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 9f322f1a7f22..d0894ca7798b 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -721,6 +721,9 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
721 case 3: 721 case 3:
722 c->freq = 83; 722 c->freq = 83;
723 break; 723 break;
724 case 4:
725 c->freq = 104;
726 break;
724 } 727 }
725 728
726#ifdef CONFIG_MTD_PARTITIONS 729#ifdef CONFIG_MTD_PARTITIONS
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 09a550860dcf..ee74c934de89 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -653,13 +653,13 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
653{ 653{
654 if (p->capabilities & UART_CAP_SLEEP) { 654 if (p->capabilities & UART_CAP_SLEEP) {
655 if (p->capabilities & UART_CAP_EFR) { 655 if (p->capabilities & UART_CAP_EFR) {
656 serial_outp(p, UART_LCR, 0xBF); 656 serial_outp(p, UART_LCR, UART_LCR_CONF_MODE_B);
657 serial_outp(p, UART_EFR, UART_EFR_ECB); 657 serial_outp(p, UART_EFR, UART_EFR_ECB);
658 serial_outp(p, UART_LCR, 0); 658 serial_outp(p, UART_LCR, 0);
659 } 659 }
660 serial_outp(p, UART_IER, sleep ? UART_IERX_SLEEP : 0); 660 serial_outp(p, UART_IER, sleep ? UART_IERX_SLEEP : 0);
661 if (p->capabilities & UART_CAP_EFR) { 661 if (p->capabilities & UART_CAP_EFR) {
662 serial_outp(p, UART_LCR, 0xBF); 662 serial_outp(p, UART_LCR, UART_LCR_CONF_MODE_B);
663 serial_outp(p, UART_EFR, 0); 663 serial_outp(p, UART_EFR, 0);
664 serial_outp(p, UART_LCR, 0); 664 serial_outp(p, UART_LCR, 0);
665 } 665 }
@@ -752,7 +752,7 @@ static int size_fifo(struct uart_8250_port *up)
752 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | 752 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO |
753 UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); 753 UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
754 serial_outp(up, UART_MCR, UART_MCR_LOOP); 754 serial_outp(up, UART_MCR, UART_MCR_LOOP);
755 serial_outp(up, UART_LCR, UART_LCR_DLAB); 755 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
756 old_dl = serial_dl_read(up); 756 old_dl = serial_dl_read(up);
757 serial_dl_write(up, 0x0001); 757 serial_dl_write(up, 0x0001);
758 serial_outp(up, UART_LCR, 0x03); 758 serial_outp(up, UART_LCR, 0x03);
@@ -764,7 +764,7 @@ static int size_fifo(struct uart_8250_port *up)
764 serial_inp(up, UART_RX); 764 serial_inp(up, UART_RX);
765 serial_outp(up, UART_FCR, old_fcr); 765 serial_outp(up, UART_FCR, old_fcr);
766 serial_outp(up, UART_MCR, old_mcr); 766 serial_outp(up, UART_MCR, old_mcr);
767 serial_outp(up, UART_LCR, UART_LCR_DLAB); 767 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
768 serial_dl_write(up, old_dl); 768 serial_dl_write(up, old_dl);
769 serial_outp(up, UART_LCR, old_lcr); 769 serial_outp(up, UART_LCR, old_lcr);
770 770
@@ -782,7 +782,7 @@ static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
782 unsigned int id; 782 unsigned int id;
783 783
784 old_lcr = serial_inp(p, UART_LCR); 784 old_lcr = serial_inp(p, UART_LCR);
785 serial_outp(p, UART_LCR, UART_LCR_DLAB); 785 serial_outp(p, UART_LCR, UART_LCR_CONF_MODE_A);
786 786
787 old_dll = serial_inp(p, UART_DLL); 787 old_dll = serial_inp(p, UART_DLL);
788 old_dlm = serial_inp(p, UART_DLM); 788 old_dlm = serial_inp(p, UART_DLM);
@@ -836,7 +836,7 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
836 * recommended for new designs). 836 * recommended for new designs).
837 */ 837 */
838 up->acr = 0; 838 up->acr = 0;
839 serial_out(up, UART_LCR, 0xBF); 839 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
840 serial_out(up, UART_EFR, UART_EFR_ECB); 840 serial_out(up, UART_EFR, UART_EFR_ECB);
841 serial_out(up, UART_LCR, 0x00); 841 serial_out(up, UART_LCR, 0x00);
842 id1 = serial_icr_read(up, UART_ID1); 842 id1 = serial_icr_read(up, UART_ID1);
@@ -945,7 +945,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
945 * Check for presence of the EFR when DLAB is set. 945 * Check for presence of the EFR when DLAB is set.
946 * Only ST16C650V1 UARTs pass this test. 946 * Only ST16C650V1 UARTs pass this test.
947 */ 947 */
948 serial_outp(up, UART_LCR, UART_LCR_DLAB); 948 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
949 if (serial_in(up, UART_EFR) == 0) { 949 if (serial_in(up, UART_EFR) == 0) {
950 serial_outp(up, UART_EFR, 0xA8); 950 serial_outp(up, UART_EFR, 0xA8);
951 if (serial_in(up, UART_EFR) != 0) { 951 if (serial_in(up, UART_EFR) != 0) {
@@ -963,7 +963,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
963 * Maybe it requires 0xbf to be written to the LCR. 963 * Maybe it requires 0xbf to be written to the LCR.
964 * (other ST16C650V2 UARTs, TI16C752A, etc) 964 * (other ST16C650V2 UARTs, TI16C752A, etc)
965 */ 965 */
966 serial_outp(up, UART_LCR, 0xBF); 966 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
967 if (serial_in(up, UART_EFR) == 0 && !broken_efr(up)) { 967 if (serial_in(up, UART_EFR) == 0 && !broken_efr(up)) {
968 DEBUG_AUTOCONF("EFRv2 "); 968 DEBUG_AUTOCONF("EFRv2 ");
969 autoconfig_has_efr(up); 969 autoconfig_has_efr(up);
@@ -1024,7 +1024,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
1024 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); 1024 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
1025 status1 = serial_in(up, UART_IIR) >> 5; 1025 status1 = serial_in(up, UART_IIR) >> 5;
1026 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO); 1026 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
1027 serial_outp(up, UART_LCR, UART_LCR_DLAB); 1027 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
1028 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); 1028 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
1029 status2 = serial_in(up, UART_IIR) >> 5; 1029 status2 = serial_in(up, UART_IIR) >> 5;
1030 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO); 1030 serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
@@ -1183,7 +1183,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
1183 * We also initialise the EFR (if any) to zero for later. The 1183 * We also initialise the EFR (if any) to zero for later. The
1184 * EFR occupies the same register location as the FCR and IIR. 1184 * EFR occupies the same register location as the FCR and IIR.
1185 */ 1185 */
1186 serial_outp(up, UART_LCR, 0xBF); 1186 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
1187 serial_outp(up, UART_EFR, 0); 1187 serial_outp(up, UART_EFR, 0);
1188 serial_outp(up, UART_LCR, 0); 1188 serial_outp(up, UART_LCR, 0);
1189 1189
@@ -1952,7 +1952,7 @@ static int serial8250_startup(struct uart_port *port)
1952 if (up->port.type == PORT_16C950) { 1952 if (up->port.type == PORT_16C950) {
1953 /* Wake up and initialize UART */ 1953 /* Wake up and initialize UART */
1954 up->acr = 0; 1954 up->acr = 0;
1955 serial_outp(up, UART_LCR, 0xBF); 1955 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
1956 serial_outp(up, UART_EFR, UART_EFR_ECB); 1956 serial_outp(up, UART_EFR, UART_EFR_ECB);
1957 serial_outp(up, UART_IER, 0); 1957 serial_outp(up, UART_IER, 0);
1958 serial_outp(up, UART_LCR, 0); 1958 serial_outp(up, UART_LCR, 0);
@@ -2002,7 +2002,7 @@ static int serial8250_startup(struct uart_port *port)
2002 if (up->port.type == PORT_16850) { 2002 if (up->port.type == PORT_16850) {
2003 unsigned char fctr; 2003 unsigned char fctr;
2004 2004
2005 serial_outp(up, UART_LCR, 0xbf); 2005 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
2006 2006
2007 fctr = serial_inp(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX); 2007 fctr = serial_inp(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX);
2008 serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX); 2008 serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX);
@@ -2363,7 +2363,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
2363 if (termios->c_cflag & CRTSCTS) 2363 if (termios->c_cflag & CRTSCTS)
2364 efr |= UART_EFR_CTS; 2364 efr |= UART_EFR_CTS;
2365 2365
2366 serial_outp(up, UART_LCR, 0xBF); 2366 serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
2367 serial_outp(up, UART_EFR, efr); 2367 serial_outp(up, UART_EFR, efr);
2368 } 2368 }
2369 2369
diff --git a/drivers/serial/omap-serial.c b/drivers/serial/omap-serial.c
index 14365f72b664..1201eff1831e 100644
--- a/drivers/serial/omap-serial.c
+++ b/drivers/serial/omap-serial.c
@@ -570,7 +570,7 @@ serial_omap_configure_xonxoff
570 unsigned char efr = 0; 570 unsigned char efr = 0;
571 571
572 up->lcr = serial_in(up, UART_LCR); 572 up->lcr = serial_in(up, UART_LCR);
573 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 573 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
574 up->efr = serial_in(up, UART_EFR); 574 up->efr = serial_in(up, UART_EFR);
575 serial_out(up, UART_EFR, up->efr & ~UART_EFR_ECB); 575 serial_out(up, UART_EFR, up->efr & ~UART_EFR_ECB);
576 576
@@ -598,7 +598,7 @@ serial_omap_configure_xonxoff
598 efr |= OMAP_UART_SW_RX; 598 efr |= OMAP_UART_SW_RX;
599 599
600 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); 600 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
601 serial_out(up, UART_LCR, UART_LCR_DLAB); 601 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
602 602
603 up->mcr = serial_in(up, UART_MCR); 603 up->mcr = serial_in(up, UART_MCR);
604 604
@@ -612,14 +612,14 @@ serial_omap_configure_xonxoff
612 up->mcr |= UART_MCR_XONANY; 612 up->mcr |= UART_MCR_XONANY;
613 613
614 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); 614 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
615 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 615 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
616 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); 616 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
617 /* Enable special char function UARTi.EFR_REG[5] and 617 /* Enable special char function UARTi.EFR_REG[5] and
618 * load the new software flow control mode IXON or IXOFF 618 * load the new software flow control mode IXON or IXOFF
619 * and restore the UARTi.EFR_REG[4] ENHANCED_EN value. 619 * and restore the UARTi.EFR_REG[4] ENHANCED_EN value.
620 */ 620 */
621 serial_out(up, UART_EFR, efr | UART_EFR_SCD); 621 serial_out(up, UART_EFR, efr | UART_EFR_SCD);
622 serial_out(up, UART_LCR, UART_LCR_DLAB); 622 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
623 623
624 serial_out(up, UART_MCR, up->mcr & ~UART_MCR_TCRTLR); 624 serial_out(up, UART_MCR, up->mcr & ~UART_MCR_TCRTLR);
625 serial_out(up, UART_LCR, up->lcr); 625 serial_out(up, UART_LCR, up->lcr);
@@ -724,22 +724,22 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
724 * baud clock is not running 724 * baud clock is not running
725 * DLL_REG and DLH_REG set to 0. 725 * DLL_REG and DLH_REG set to 0.
726 */ 726 */
727 serial_out(up, UART_LCR, UART_LCR_DLAB); 727 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
728 serial_out(up, UART_DLL, 0); 728 serial_out(up, UART_DLL, 0);
729 serial_out(up, UART_DLM, 0); 729 serial_out(up, UART_DLM, 0);
730 serial_out(up, UART_LCR, 0); 730 serial_out(up, UART_LCR, 0);
731 731
732 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 732 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
733 733
734 up->efr = serial_in(up, UART_EFR); 734 up->efr = serial_in(up, UART_EFR);
735 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); 735 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
736 736
737 serial_out(up, UART_LCR, UART_LCR_DLAB); 737 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
738 up->mcr = serial_in(up, UART_MCR); 738 up->mcr = serial_in(up, UART_MCR);
739 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); 739 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
740 /* FIFO ENABLE, DMA MODE */ 740 /* FIFO ENABLE, DMA MODE */
741 serial_out(up, UART_FCR, up->fcr); 741 serial_out(up, UART_FCR, up->fcr);
742 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 742 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
743 743
744 if (up->use_dma) { 744 if (up->use_dma) {
745 serial_out(up, UART_TI752_TLR, 0); 745 serial_out(up, UART_TI752_TLR, 0);
@@ -748,52 +748,52 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
748 } 748 }
749 749
750 serial_out(up, UART_EFR, up->efr); 750 serial_out(up, UART_EFR, up->efr);
751 serial_out(up, UART_LCR, UART_LCR_DLAB); 751 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
752 serial_out(up, UART_MCR, up->mcr); 752 serial_out(up, UART_MCR, up->mcr);
753 753
754 /* Protocol, Baud Rate, and Interrupt Settings */ 754 /* Protocol, Baud Rate, and Interrupt Settings */
755 755
756 serial_out(up, UART_OMAP_MDR1, OMAP_MDR1_DISABLE); 756 serial_out(up, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE);
757 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 757 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
758 758
759 up->efr = serial_in(up, UART_EFR); 759 up->efr = serial_in(up, UART_EFR);
760 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); 760 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
761 761
762 serial_out(up, UART_LCR, 0); 762 serial_out(up, UART_LCR, 0);
763 serial_out(up, UART_IER, 0); 763 serial_out(up, UART_IER, 0);
764 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 764 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
765 765
766 serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */ 766 serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */
767 serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */ 767 serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */
768 768
769 serial_out(up, UART_LCR, 0); 769 serial_out(up, UART_LCR, 0);
770 serial_out(up, UART_IER, up->ier); 770 serial_out(up, UART_IER, up->ier);
771 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 771 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
772 772
773 serial_out(up, UART_EFR, up->efr); 773 serial_out(up, UART_EFR, up->efr);
774 serial_out(up, UART_LCR, cval); 774 serial_out(up, UART_LCR, cval);
775 775
776 if (baud > 230400 && baud != 3000000) 776 if (baud > 230400 && baud != 3000000)
777 serial_out(up, UART_OMAP_MDR1, OMAP_MDR1_MODE13X); 777 serial_out(up, UART_OMAP_MDR1, UART_OMAP_MDR1_13X_MODE);
778 else 778 else
779 serial_out(up, UART_OMAP_MDR1, OMAP_MDR1_MODE16X); 779 serial_out(up, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE);
780 780
781 /* Hardware Flow Control Configuration */ 781 /* Hardware Flow Control Configuration */
782 782
783 if (termios->c_cflag & CRTSCTS) { 783 if (termios->c_cflag & CRTSCTS) {
784 efr |= (UART_EFR_CTS | UART_EFR_RTS); 784 efr |= (UART_EFR_CTS | UART_EFR_RTS);
785 serial_out(up, UART_LCR, UART_LCR_DLAB); 785 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
786 786
787 up->mcr = serial_in(up, UART_MCR); 787 up->mcr = serial_in(up, UART_MCR);
788 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); 788 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
789 789
790 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 790 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
791 up->efr = serial_in(up, UART_EFR); 791 up->efr = serial_in(up, UART_EFR);
792 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); 792 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
793 793
794 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); 794 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
795 serial_out(up, UART_EFR, efr); /* Enable AUTORTS and AUTOCTS */ 795 serial_out(up, UART_EFR, efr); /* Enable AUTORTS and AUTOCTS */
796 serial_out(up, UART_LCR, UART_LCR_DLAB); 796 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
797 serial_out(up, UART_MCR, up->mcr | UART_MCR_RTS); 797 serial_out(up, UART_MCR, up->mcr | UART_MCR_RTS);
798 serial_out(up, UART_LCR, cval); 798 serial_out(up, UART_LCR, cval);
799 } 799 }
@@ -815,13 +815,13 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
815 unsigned char efr; 815 unsigned char efr;
816 816
817 dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->pdev->id); 817 dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->pdev->id);
818 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 818 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
819 efr = serial_in(up, UART_EFR); 819 efr = serial_in(up, UART_EFR);
820 serial_out(up, UART_EFR, efr | UART_EFR_ECB); 820 serial_out(up, UART_EFR, efr | UART_EFR_ECB);
821 serial_out(up, UART_LCR, 0); 821 serial_out(up, UART_LCR, 0);
822 822
823 serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0); 823 serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0);
824 serial_out(up, UART_LCR, OMAP_UART_LCR_CONF_MDB); 824 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
825 serial_out(up, UART_EFR, efr); 825 serial_out(up, UART_EFR, efr);
826 serial_out(up, UART_LCR, 0); 826 serial_out(up, UART_LCR, 0);
827 /* Enable module level wake up */ 827 /* Enable module level wake up */
diff --git a/drivers/staging/tidspbridge/core/_tiomap.h b/drivers/staging/tidspbridge/core/_tiomap.h
index 1c1f157e167a..1159a500f49d 100644
--- a/drivers/staging/tidspbridge/core/_tiomap.h
+++ b/drivers/staging/tidspbridge/core/_tiomap.h
@@ -19,8 +19,19 @@
19#ifndef _TIOMAP_ 19#ifndef _TIOMAP_
20#define _TIOMAP_ 20#define _TIOMAP_
21 21
22#include <plat/powerdomain.h> 22/*
23#include <plat/clockdomain.h> 23 * XXX These powerdomain.h/clockdomain.h includes are wrong and should
24 * be removed. No driver should call pwrdm_* or clkdm_* functions
25 * directly; they should rely on OMAP core code to do this.
26 */
27#include <mach-omap2/powerdomain.h>
28#include <mach-omap2/clockdomain.h>
29/*
30 * XXX These mach-omap2/ includes are wrong and should be removed. No
31 * driver should read or write to PRM/CM registers directly; they
32 * should rely on OMAP core code to do this.
33 */
34#include <mach-omap2/cm2xxx_3xxx.h>
24#include <mach-omap2/prm-regbits-34xx.h> 35#include <mach-omap2/prm-regbits-34xx.h>
25#include <mach-omap2/cm-regbits-34xx.h> 36#include <mach-omap2/cm-regbits-34xx.h>
26#include <dspbridge/devdefs.h> 37#include <dspbridge/devdefs.h>
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 78ebf507ce56..7472449cbb74 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -1,9 +1,14 @@
1#ifndef __I2C_OMAP_H__ 1#ifndef __I2C_OMAP_H__
2#define __I2C_OMAP_H__ 2#define __I2C_OMAP_H__
3 3
4#include <linux/platform_device.h>
5
4struct omap_i2c_bus_platform_data { 6struct omap_i2c_bus_platform_data {
5 u32 clkrate; 7 u32 clkrate;
6 void (*set_mpu_wkup_lat)(struct device *dev, long set); 8 void (*set_mpu_wkup_lat)(struct device *dev, long set);
9 int (*device_enable) (struct platform_device *pdev);
10 int (*device_shutdown) (struct platform_device *pdev);
11 int (*device_idle) (struct platform_device *pdev);
7}; 12};
8 13
9#endif 14#endif
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index 80352ad6581a..697474691749 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -9,7 +9,7 @@
9 9
10#define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ 10#define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\
11 (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ 11 (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\
12 (val & 0xffff)) 12 ((val) & 0xffff))
13 13
14#define KEY_ROW(k) (((k) >> 24) & 0xff) 14#define KEY_ROW(k) (((k) >> 24) & 0xff)
15#define KEY_COL(k) (((k) >> 16) & 0xff) 15#define KEY_COL(k) (((k) >> 16) & 0xff)
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index c7a0ce11cd47..3ecb71a9e505 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -99,6 +99,13 @@
99#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ 99#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
100#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ 100#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
101 101
102/*
103 * Access to some registers depends on register access / configuration
104 * mode.
105 */
106#define UART_LCR_CONF_MODE_A UART_LCR_DLAB /* Configutation mode A */
107#define UART_LCR_CONF_MODE_B 0xBF /* Configutation mode B */
108
102#define UART_MCR 4 /* Out: Modem Control Register */ 109#define UART_MCR 4 /* Out: Modem Control Register */
103#define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */ 110#define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */
104#define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */ 111#define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */
@@ -341,5 +348,17 @@
341#define UART_OMAP_SYSS 0x16 /* System status register */ 348#define UART_OMAP_SYSS 0x16 /* System status register */
342#define UART_OMAP_WER 0x17 /* Wake-up enable register */ 349#define UART_OMAP_WER 0x17 /* Wake-up enable register */
343 350
351/*
352 * These are the definitions for the MDR1 register
353 */
354#define UART_OMAP_MDR1_16X_MODE 0x00 /* UART 16x mode */
355#define UART_OMAP_MDR1_SIR_MODE 0x01 /* SIR mode */
356#define UART_OMAP_MDR1_16X_ABAUD_MODE 0x02 /* UART 16x auto-baud */
357#define UART_OMAP_MDR1_13X_MODE 0x03 /* UART 13x mode */
358#define UART_OMAP_MDR1_MIR_MODE 0x04 /* MIR mode */
359#define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
360#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
361#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
362
344#endif /* _LINUX_SERIAL_REG_H */ 363#endif /* _LINUX_SERIAL_REG_H */
345 364