diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 22:13:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 22:13:58 -0500 |
commit | 01539ba2a706ab7d35fc0667dff919ade7f87d63 (patch) | |
tree | 5a4bd0cf78007d06690fe4ac06bbd49a5a70bc47 /arch/arm/mach-omap2 | |
parent | 9e9bc9736756f25d6c47b4eba0ebf25b20a6f153 (diff) | |
parent | dc69d1af9e8d9cbbabff88bb35a6782187a22229 (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
Diffstat (limited to 'arch/arm/mach-omap2')
151 files changed, 17509 insertions, 5132 deletions
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 | ||
39 | config ARCH_OMAP4 | 41 | config 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 | ||
48 | comment "OMAP Core Type" | 52 | comment "OMAP Core Type" |
49 | depends on ARCH_OMAP2 | 53 | depends on ARCH_OMAP2 |
@@ -85,6 +89,12 @@ config OMAP_PACKAGE_CUS | |||
85 | config OMAP_PACKAGE_CBP | 89 | config OMAP_PACKAGE_CBP |
86 | bool | 90 | bool |
87 | 91 | ||
92 | config OMAP_PACKAGE_CBL | ||
93 | bool | ||
94 | |||
95 | config OMAP_PACKAGE_CBS | ||
96 | bool | ||
97 | |||
88 | comment "OMAP Board Type" | 98 | comment "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 | ||
133 | config MACH_OMAP_LDP | 142 | config 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 | ||
186 | config MACH_CRANEBOARD | ||
187 | bool "AM3517/05 CRANE board" | ||
188 | depends on ARCH_OMAP3 | ||
189 | select OMAP_PACKAGE_CBB | ||
190 | |||
177 | config MACH_OMAP3_PANDORA | 191 | config 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 | ||
183 | config MACH_OMAP3_TOUCHBOOK | 198 | config 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 | ||
228 | config MACH_NOKIA_RM680 | ||
229 | bool "Nokia RM-680 board" | ||
230 | depends on ARCH_OMAP3 | ||
231 | default y | ||
232 | select OMAP_PACKAGE_CBB | ||
233 | |||
213 | config MACH_NOKIA_RX51 | 234 | config 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 | ||
228 | config MACH_OMAP_ZOOM3 | 250 | config 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 | ||
237 | config MACH_CM_T35 | 260 | config 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 | ||
244 | config MACH_CM_T3517 | 266 | config 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 | ||
251 | config MACH_IGEP0020 | 272 | config 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 | ||
270 | config MACH_OMAP_3630SDP | 290 | config 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 | ||
281 | config MACH_OMAP4_PANDA | 303 | config 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 | ||
286 | config OMAP3_EMU | 310 | config 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 |
6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \ | 6 | obj-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 | ||
9 | omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o | 9 | omap-2-3-common = irq.o sdrc.o |
10 | hwmod-common = omap_hwmod.o \ | 10 | hwmod-common = omap_hwmod.o \ |
11 | omap_hwmod_common_data.o | 11 | omap_hwmod_common_data.o |
12 | prcm-common = prcm.o powerdomain.o | ||
13 | clock-common = clock.o clock_common_data.o \ | 12 | clock-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 | ||
17 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) | 15 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) |
18 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) | 16 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) |
19 | obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) prm44xx.o $(hwmod-common) | 17 | obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) |
20 | 18 | ||
21 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | 19 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o |
22 | 20 | ||
21 | obj-$(CONFIG_TWL4030_CORE) += omap_twl.o | ||
22 | |||
23 | # SMP support ONLY available for OMAP4 | 23 | # SMP support ONLY available for OMAP4 |
24 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o | 24 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o |
25 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o | 25 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o |
26 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o | 26 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o |
27 | obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o | 27 | obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o |
28 | 28 | ||
29 | AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a | 29 | plus_sec := $(call as-instr,.arch_extension sec,+sec) |
30 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a | 30 | AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) |
31 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec) | ||
31 | 32 | ||
32 | # Functions loaded to SRAM | 33 | # Functions loaded to SRAM |
33 | obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o | 34 | obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o |
@@ -42,18 +43,29 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a | |||
42 | obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o | 43 | obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o |
43 | obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o | 44 | obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o |
44 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o | 45 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o |
46 | obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o | ||
45 | 47 | ||
46 | # SMS/SDRC | 48 | # SMS/SDRC |
47 | obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o | 49 | obj-$(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 | ||
53 | ifeq ($(CONFIG_PM_OPP),y) | ||
54 | obj-y += opp.o | ||
55 | obj-$(CONFIG_ARCH_OMAP3) += opp3xxx_data.o | ||
56 | obj-$(CONFIG_ARCH_OMAP4) += opp4xxx_data.o | ||
57 | endif | ||
58 | |||
50 | # Power Management | 59 | # Power Management |
51 | ifeq ($(CONFIG_PM),y) | 60 | ifeq ($(CONFIG_PM),y) |
52 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o | 61 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o |
53 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o | 62 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o voltage.o |
54 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o pm_bus.o | 63 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ |
55 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o | 64 | cpuidle34xx.o pm_bus.o |
65 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o | ||
56 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o | 66 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o |
67 | obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o | ||
68 | obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o | ||
57 | 69 | ||
58 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 | 70 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 |
59 | AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a | 71 | AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a |
@@ -65,10 +77,36 @@ endif | |||
65 | endif | 77 | endif |
66 | 78 | ||
67 | # PRCM | 79 | # PRCM |
68 | obj-$(CONFIG_ARCH_OMAP2) += cm.o | 80 | obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o |
69 | obj-$(CONFIG_ARCH_OMAP3) += cm.o | 81 | obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o |
70 | obj-$(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. | ||
85 | obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ | ||
86 | cm44xx.o prcm_mpu44xx.o \ | ||
87 | prminst44xx.o | ||
88 | |||
89 | # OMAP powerdomain framework | ||
90 | powerdomain-common += powerdomain.o powerdomain-common.o | ||
91 | obj-$(CONFIG_ARCH_OMAP2) += $(powerdomain-common) \ | ||
92 | powerdomain2xxx_3xxx.o \ | ||
93 | powerdomains2xxx_data.o \ | ||
94 | powerdomains2xxx_3xxx_data.o | ||
95 | obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common) \ | ||
96 | powerdomain2xxx_3xxx.o \ | ||
97 | powerdomains3xxx_data.o \ | ||
98 | powerdomains2xxx_3xxx_data.o | ||
99 | obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \ | ||
100 | powerdomain44xx.o \ | ||
101 | powerdomains44xx_data.o | ||
102 | |||
103 | # PRCM clockdomain control | ||
104 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ | ||
105 | clockdomains2xxx_3xxx_data.o | ||
106 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ | ||
107 | clockdomains2xxx_3xxx_data.o | ||
108 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ | ||
109 | clockdomains44xx_data.o | ||
72 | # Clock framework | 110 | # Clock framework |
73 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ | 111 | obj-$(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 |
141 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o | 179 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o |
180 | obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \ | ||
181 | sdram-nokia.o \ | ||
182 | hsmmc.o | ||
142 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | 183 | obj-$(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 |
147 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ | 188 | obj-$(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 |
152 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ | 193 | obj-$(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 | ||
175 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o | 216 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o |
176 | 217 | ||
218 | obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o | ||
219 | |||
177 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ | 220 | obj-$(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 | ||
138 | static struct omap_board_config_kernel sdp2430_config[] = { | 138 | static 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 | ||
151 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { | 151 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { |
@@ -218,8 +218,6 @@ static struct omap_usb_config sdp2430_usb_config __initdata = { | |||
218 | static struct omap_board_mux board_mux[] __initdata = { | 218 | static 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 | ||
225 | static void __init omap_2430sdp_init(void) | 223 | static 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 | ||
334 | static int sdp3430_batt_table[] = { | 334 | static int sdp3430_batt_table[] = { |
@@ -663,8 +663,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
663 | static struct omap_board_mux board_mux[] __initdata = { | 663 | static 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 |
83 | static struct omap_board_mux board_mux[] __initdata = { | 83 | static 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 | ||
101 | static 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 | |||
110 | static struct led_pwm_platform_data sdp4430_pwm_data = { | ||
111 | .num_leds = ARRAY_SIZE(sdp4430_pwm_leds), | ||
112 | .leds = sdp4430_pwm_leds, | ||
113 | }; | ||
114 | |||
115 | static struct platform_device sdp4430_leds_pwm = { | ||
116 | .name = "leds_pwm", | ||
117 | .id = -1, | ||
118 | .dev = { | ||
119 | .platform_data = &sdp4430_pwm_data, | ||
120 | }, | ||
121 | }; | ||
122 | |||
99 | static int omap_prox_activate(struct device *dev) | 123 | static 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 | ||
208 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { | 233 | static 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 | ||
228 | static struct omap_musb_board_data musb_board_data = { | 253 | static 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 | }; |
468 | static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { | 496 | static 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 | ||
537 | static struct omap_board_mux board_mux[] __initdata = { | ||
538 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
539 | }; | ||
540 | #else | ||
541 | #define board_mux NULL | ||
542 | #endif | ||
543 | |||
508 | static void __init omap_4430sdp_init(void) | 544 | static 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 */ | ||
41 | static struct omap_board_config_kernel am3517_crane_config[] __initdata = { | ||
42 | }; | ||
43 | |||
44 | #ifdef CONFIG_OMAP_MUX | ||
45 | static struct omap_board_mux board_mux[] __initdata = { | ||
46 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
47 | }; | ||
48 | #else | ||
49 | #define board_mux NULL | ||
50 | #endif | ||
51 | |||
52 | static 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 | |||
62 | static 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 | |||
73 | static 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 | |||
109 | MACHINE_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, | ||
116 | MACHINE_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 | ||
398 | static struct omap_musb_board_data musb_board_data = { | 397 | static 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 | ||
273 | static struct omap_board_config_kernel apollon_config[] = { | 273 | static 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 | ||
287 | static void __init apollon_led_init(void) | 286 | static void __init apollon_led_init(void) |
@@ -314,8 +313,6 @@ static void __init apollon_usb_init(void) | |||
314 | static struct omap_board_mux board_mux[] __initdata = { | 313 | static 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 | ||
321 | static void __init omap_apollon_init(void) | 318 | static 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 | ||
692 | static struct omap_board_mux board_mux[] __initdata = { | 686 | static 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 | ||
810 | MACHINE_START(CM_T35, "Compulab CM-T35") | 805 | MACHINE_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 | ||
256 | static struct omap_board_mux board_mux[] __initdata = { | 256 | static 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 | ||
125 | static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) | 125 | static 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 | ||
131 | static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev) | 131 | static 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 | ||
138 | static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) | 138 | static 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 | ||
144 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = | 144 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = |
@@ -444,13 +444,13 @@ static struct platform_device keys_gpio = { | |||
444 | 444 | ||
445 | static void __init devkit8000_init_irq(void) | 445 | static 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 | ||
456 | static void __init devkit8000_ads7846_init(void) | 456 | static 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 @@ | |||
51 | static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; | 51 | static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; |
52 | static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; | 52 | static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; |
53 | 53 | ||
54 | static int h4_keymap[] = { | 54 | static 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 | ||
88 | static struct mtd_partition h4_partitions[] = { | 87 | static 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 | ||
138 | static const struct matrix_keymap_data h4_keymap_data = { | ||
139 | .keymap = h4_keymap, | ||
140 | .keymap_size = ARRAY_SIZE(h4_keymap), | ||
141 | }; | ||
142 | |||
139 | static struct omap_kp_platform_data h4_kp_data = { | 143 | static 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 | ||
286 | static struct omap_board_config_kernel h4_config[] = { | 289 | static 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[] = { | |||
321 | static struct omap_board_mux board_mux[] __initdata = { | 324 | static 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 | ||
328 | static void __init omap_h4_init(void) | 329 | static 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 | ||
139 | static 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 | |||
145 | static struct omap_onenand_platform_data igep2_onenand_data = { | 140 | static 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 | ||
160 | static void __init igep2_flash_init(void) | 154 | static 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) | |||
254 | static inline void __init igep2_init_smsc911x(void) { } | 247 | static inline void __init igep2_init_smsc911x(void) { } |
255 | #endif | 248 | #endif |
256 | 249 | ||
257 | static struct omap_board_config_kernel igep2_config[] __initdata = { | 250 | static struct regulator_consumer_supply igep2_vmmc1_supply = |
258 | }; | 251 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); |
259 | |||
260 | static 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 */ |
265 | static struct regulator_init_data igep2_vmmc1 = { | 254 | static 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 | ||
268 | static struct regulator_consumer_supply igep2_vio_supply = | ||
269 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | ||
270 | |||
271 | static 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 | |||
286 | static struct regulator_consumer_supply igep2_vmmc2_supply = | ||
287 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | ||
288 | |||
289 | static 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 | |||
298 | static 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 | |||
306 | static struct platform_device igep2_vwlan_device = { | ||
307 | .name = "reg-fixed-voltage", | ||
308 | .id = 0, | ||
309 | .dev = { | ||
310 | .platform_data = &igep2_vwlan, | ||
311 | }, | ||
312 | }; | ||
313 | |||
279 | static struct omap2_hsmmc_info mmc[] = { | 314 | static 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) | |||
342 | static inline void igep2_leds_init(void) | 378 | static 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 | ||
490 | static struct platform_device *igep2_devices[] __initdata = { | 516 | static struct platform_device *igep2_devices[] __initdata = { |
491 | &igep2_dss_device, | 517 | &igep2_dss_device, |
518 | &igep2_vwlan_device, | ||
492 | }; | 519 | }; |
493 | 520 | ||
494 | static void __init igep2_init_irq(void) | 521 | static 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 | ||
503 | static struct twl4030_codec_audio_data igep2_audio_data = { | 529 | static 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 | ||
525 | static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = { | 551 | static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = { |
@@ -577,8 +603,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
577 | static struct omap_board_mux board_mux[] __initdata = { | 603 | static 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 | ||
290 | static void __init igep3_init_irq(void) | 290 | static 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 | ||
297 | static struct twl4030_platform_data igep3_twl4030_pdata = { | 298 | static struct twl4030_platform_data igep3_twl4030_pdata = { |
@@ -366,8 +367,6 @@ void __init igep3_wifi_bt_init(void) {} | |||
366 | static struct omap_board_mux board_mux[] __initdata = { | 367 | static 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 | ||
373 | static void __init igep3_init(void) | 372 | static 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 | ||
301 | static struct twl4030_usb_data ldp_usb_data = { | 300 | static struct twl4030_usb_data ldp_usb_data = { |
@@ -381,8 +380,6 @@ static struct platform_device *ldp_devices[] __initdata = { | |||
381 | static struct omap_board_mux board_mux[] __initdata = { | 380 | static 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 | ||
388 | static struct omap_musb_board_data musb_board_data = { | 385 | static struct omap_musb_board_data musb_board_data = { |
@@ -426,6 +423,7 @@ static struct mtd_partition ldp_nand_partitions[] = { | |||
426 | static void __init omap_ldp_init(void) | 423 | static 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 | ||
187 | static struct omap_onenand_platform_data board_onenand_data = { | 187 | static 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 | |||
195 | static void __init n8x0_onenand_init(void) | ||
196 | { | ||
197 | gpmc_onenand_init(&board_onenand_data); | ||
198 | } | ||
199 | |||
200 | #else | ||
201 | |||
202 | static 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 | ||
640 | static void __init n8x0_init_irq(void) | 632 | static 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 | |||
649 | static 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 | |||
658 | static 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 | |
680 | static inline void board_serial_init(void) | ||
681 | { | ||
682 | omap_serial_init(); | ||
683 | } | ||
684 | |||
658 | #endif | 685 | #endif |
659 | 686 | ||
660 | static void __init n8x0_init_machine(void) | 687 | static 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 | ||
485 | static void __init omap3_beagle_init_irq(void) | 485 | static 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 | ||
496 | static struct platform_device *omap3_beagle_devices[] __initdata = { | 496 | static struct platform_device *omap3_beagle_devices[] __initdata = { |
@@ -548,8 +548,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
548 | static struct omap_board_mux board_mux[] __initdata = { | 548 | static 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 | ||
555 | static struct omap_musb_board_data musb_board_data = { | 553 | static 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 | ||
631 | static struct platform_device *omap3_evm_devices[] __initdata = { | 631 | static 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 | ||
661 | static struct omap_musb_board_data musb_board_data = { | 659 | static 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 | ||
198 | static void __init omap3logic_init_irq(void) | 198 | static 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 |
206 | static struct omap_board_mux board_mux[] __initdata = { | 206 | static 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 | ||
213 | static void __init omap3logic_init(void) | 211 | static 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 | ||
637 | static void __init omap3pandora_init_irq(void) | 637 | static 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 | ||
645 | static void __init pandora_wl1251_init(void) | 645 | static void __init pandora_wl1251_init(void) |
@@ -697,8 +697,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
697 | static struct omap_board_mux board_mux[] __initdata = { | 697 | static 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 | ||
704 | static struct omap_musb_board_data musb_board_data = { | 702 | static 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 | ||
595 | static struct platform_device *omap3_stalker_devices[] __initdata = { | 595 | static 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 | ||
623 | static struct omap_musb_board_data musb_board_data = { | 621 | static 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 = { | |||
413 | static struct omap_board_mux board_mux[] __initdata = { | 413 | static 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 | ||
420 | static void __init omap3_touchbook_init_irq(void) | 418 | static 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 | ||
434 | static struct platform_device *omap3_touchbook_devices[] __initdata = { | 432 | static 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 | ||
77 | static void __init omap4_panda_init_irq(void) | 78 | static 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 | ||
84 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 85 | static 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 | ||
375 | static struct omap_board_mux board_mux[] __initdata = { | ||
376 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
377 | }; | ||
378 | #else | ||
379 | #define board_mux NULL | ||
380 | #endif | ||
381 | |||
371 | static void __init omap4_panda_init(void) | 382 | static 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) | |||
391 | MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") | 408 | MACHINE_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 | ||
422 | static struct platform_device *overo_devices[] __initdata = { | 422 | static struct platform_device *overo_devices[] __initdata = { |
@@ -438,8 +438,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
438 | static struct omap_board_mux board_mux[] __initdata = { | 438 | static 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 | ||
445 | static struct omap_musb_board_data musb_board_data = { | 443 | static 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 | |||
35 | static struct regulator_consumer_supply rm680_vemmc_consumers[] = { | ||
36 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), | ||
37 | }; | ||
38 | |||
39 | /* Fixed regulator for internal eMMC */ | ||
40 | static 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 | |||
55 | static 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 | |||
64 | static struct platform_device rm680_vemmc_device = { | ||
65 | .name = "reg-fixed-voltage", | ||
66 | .dev = { | ||
67 | .platform_data = &rm680_vemmc_config, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | static struct platform_device *rm680_peripherals_devices[] __initdata = { | ||
72 | &rm680_vemmc_device, | ||
73 | }; | ||
74 | |||
75 | /* TWL */ | ||
76 | static 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 | |||
84 | static struct twl4030_usb_data rm680_usb_data = { | ||
85 | .usb_mode = T2_USB_MODE_ULPI, | ||
86 | }; | ||
87 | |||
88 | static 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 | |||
96 | static 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 | |||
105 | static 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) | ||
115 | static 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 */ | ||
124 | static 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 | |||
135 | static 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 | |||
144 | static 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 | ||
155 | static struct omap_board_mux board_mux[] __initdata = { | ||
156 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
157 | }; | ||
158 | #endif | ||
159 | |||
160 | static struct omap_musb_board_data rm680_musb_data = { | ||
161 | .interface_type = MUSB_INTERFACE_ULPI, | ||
162 | .mode = MUSB_PERIPHERAL, | ||
163 | .power = 100, | ||
164 | }; | ||
165 | |||
166 | static 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 | |||
174 | static void __init rm680_map_io(void) | ||
175 | { | ||
176 | omap2_set_globals_3xxx(); | ||
177 | omap34xx_map_common_io(); | ||
178 | } | ||
179 | |||
180 | MACHINE_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, | ||
187 | MACHINE_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 | ||
295 | static 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[] = { | |||
300 | static void rx51_mmc2_remux(struct device *dev, int slot, int power_on) | 301 | static 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 | ||
308 | static struct omap2_hsmmc_info mmc[] __initdata = { | 309 | static 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) | ||
358 | extern struct platform_device rx51_display_device; | ||
359 | #endif | ||
360 | |||
361 | static struct regulator_consumer_supply rx51_vaux1_consumers[] = { | 362 | static 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, | 366 | static struct regulator_consumer_supply rx51_vdac_supply[] = { |
366 | }, | 367 | REGULATOR_SUPPLY("vdda_dac", "omapdss"), |
367 | #endif | ||
368 | }; | 368 | }; |
369 | 369 | ||
370 | static struct regulator_init_data rx51_vaux1 = { | 370 | static struct regulator_init_data rx51_vaux1 = { |
@@ -484,14 +484,17 @@ static struct regulator_init_data rx51_vsim = { | |||
484 | 484 | ||
485 | static struct regulator_init_data rx51_vdac = { | 485 | static 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 | ||
497 | static struct regulator_init_data rx51_vio = { | 500 | static 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 | ||
720 | static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata = { | 723 | static 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 | ||
748 | static struct aic3x_pdata rx51_aic3x_data2 = { | ||
749 | .gpio_reset = 60, | ||
750 | }; | ||
751 | |||
745 | static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { | 752 | static 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 | ||
818 | static struct omap_onenand_platform_data board_onenand_data = { | 829 | static 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 | |||
826 | static void __init board_onenand_init(void) | ||
827 | { | ||
828 | gpmc_onenand_init(&board_onenand_data); | ||
829 | } | ||
830 | |||
831 | #else | ||
832 | |||
833 | static 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: | |||
916 | void __init rx51_peripherals_init(void) | 917 | void __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 | ||
51 | static 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 | |||
52 | static struct omap_dss_device *rx51_dss_devices[] = { | 58 | static struct omap_dss_device *rx51_dss_devices[] = { |
53 | &rx51_lcd_device, | 59 | &rx51_lcd_device, |
60 | &rx51_tv_device, | ||
54 | }; | 61 | }; |
55 | 62 | ||
56 | static struct omap_dss_board_info rx51_dss_board_info = { | 63 | static 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 | ||
38 | struct omap_sdrc_params *rx51_get_sdram_timings(void); | ||
39 | extern void rx51_video_mem_init(void); | 39 | extern void rx51_video_mem_init(void); |
40 | 40 | ||
41 | static struct gpio_led gpio_leds[] = { | 41 | static 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 | ||
114 | extern void __init rx51_peripherals_init(void); | 114 | extern void __init rx51_peripherals_init(void); |
@@ -117,8 +117,6 @@ extern void __init rx51_peripherals_init(void); | |||
117 | static struct omap_board_mux board_mux[] __initdata = { | 117 | static 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 | ||
124 | static struct omap_musb_board_data musb_board_data = { | 122 | static 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 | ||
199 | static struct omap2_hsmmc_info mmc[] __initdata = { | 199 | static 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 | ||
29 | static struct omap_board_config_kernel zoom_config[] __initdata = { | 34 | #define ZOOM3_EHCI_RESET_GPIO 64 |
35 | |||
36 | static 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 | ||
50 | static 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 | ||
32 | static struct mtd_partition zoom_nand_partitions[] = { | 68 | static 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 | ||
73 | static 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 | ||
84 | static 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 | |||
104 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 109 | static 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 | ||
114 | static void __init omap_zoom_init(void) | 119 | static 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 | ||
135 | MACHINE_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, | ||
142 | MACHINE_END | ||
143 | |||
126 | MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") | 144 | MACHINE_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 | |||
31 | static 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 | ||
40 | static 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 | |||
60 | static 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 | |||
101 | static 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 | |||
110 | MACHINE_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, | ||
117 | MACHINE_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 | ||
33 | static int omap2_enable_osc_ck(struct clk *clk) | 33 | static 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 | ||
32 | void __iomem *prcm_clksrc_ctrl; | 32 | void __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 | ||
46 | const struct prcm_config *curr_prcm_set; | 46 | const 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 | ||
54 | int omap2_clk_enable(struct clk *clk); | 53 | int omap2_clk_enable(struct clk *clk); |
55 | void omap2_clk_disable(struct clk *clk); | 54 | void 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 | ||
818 | static struct clk dss_54m_fck = { /* Alt clk used in power management */ | 818 | static 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 | ||
806 | static struct clk dss_54m_fck = { /* Alt clk used in power management */ | 806 | static 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 | ||
122 | static const struct clksel_rate osc_sys_16_8m_rates[] = { | 122 | static 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 = { | |||
452 | static const struct clksel_rate div31_dpll3_rates[] = { | 452 | static 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 | ||
1563 | static struct clk mcspi3_fck = { | 1566 | static 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 | ||
1572 | static struct clk mcspi2_fck = { | 1576 | static 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 | ||
1581 | static struct clk mcspi1_fck = { | 1586 | static 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 | ||
1590 | static struct clk uart2_fck = { | 1596 | static 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[] = { | |||
3447 | int __init omap3xxx_clk_init(void) | 3455 | int __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 = { | |||
47 | static struct clk pad_clks_ck = { | 54 | static 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 | ||
53 | static struct clk pad_slimbus_core_clks_ck = { | 62 | static struct clk pad_slimbus_core_clks_ck = { |
@@ -65,7 +74,9 @@ static struct clk secure_32k_clk_src_ck = { | |||
65 | static struct clk slimbus_clk = { | 74 | static 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 | ||
71 | static struct clk sys_32k_ck = { | 82 | static 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 | ||
279 | static 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 | |||
286 | static 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 | |||
321 | static const struct clksel dpll_abe_m2x2_div[] = { | ||
322 | { .parent = &dpll_abe_x2_ck, .rates = div31_1to31_rates }, | ||
323 | { .parent = NULL }, | ||
324 | }; | ||
325 | |||
268 | static struct clk dpll_abe_m2x2_ck = { | 326 | static 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 | ||
275 | static struct clk abe_24m_fclk = { | 338 | static 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 | ||
282 | static const struct clksel_rate div3_1to4_rates[] = { | 346 | static 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 | ||
329 | static const struct clksel_rate div31_1to31_rates[] = { | 393 | static 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 | |||
364 | static const struct clksel dpll_abe_m3_div[] = { | ||
365 | { .parent = &dpll_abe_ck, .rates = div31_1to31_rates }, | ||
366 | { .parent = NULL }, | ||
367 | }; | ||
368 | |||
369 | static 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 | ||
381 | static const struct clksel core_hsd_byp_clk_mux_sel[] = { | 405 | static 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 | ||
427 | static const struct clksel dpll_core_m6_div[] = { | 451 | static 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 | |||
458 | static 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 | ||
432 | static struct clk dpll_core_m6_ck = { | 463 | static 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 | ||
444 | static const struct clksel dbgclk_mux_sel[] = { | 475 | static 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 | ||
488 | static const struct clksel dpll_core_m2_div[] = { | ||
489 | { .parent = &dpll_core_ck, .rates = div31_1to31_rates }, | ||
490 | { .parent = NULL }, | ||
491 | }; | ||
492 | |||
457 | static struct clk dpll_core_m2_ck = { | 493 | static 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 | ||
476 | static struct clk dpll_core_m5_ck = { | 513 | static 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 | ||
488 | static const struct clksel div_core_div[] = { | 525 | static 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 | ||
493 | static struct clk div_core_ck = { | 530 | static 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 | ||
513 | static const struct clksel div_iva_hs_clk_div[] = { | 550 | static 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 | ||
518 | static struct clk div_iva_hs_clk = { | 555 | static 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 | ||
530 | static struct clk div_mpu_hs_clk = { | 567 | static 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 | ||
542 | static struct clk dpll_core_m4_ck = { | 579 | static 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 | ||
554 | static struct clk dll_clk_div_ck = { | 591 | static 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 | |||
599 | static const struct clksel dpll_abe_m2_div[] = { | ||
600 | { .parent = &dpll_abe_ck, .rates = div31_1to31_rates }, | ||
601 | { .parent = NULL }, | ||
559 | }; | 602 | }; |
560 | 603 | ||
561 | static struct clk dpll_abe_m2_ck = { | 604 | static 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 | ||
573 | static struct clk dpll_core_m3_ck = { | 616 | static 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 | ||
585 | static struct clk dpll_core_m7_ck = { | 630 | static 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[] = { | |||
603 | static struct clk iva_hsd_byp_clk_mux_ck = { | 648 | static 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 | ||
641 | static const struct clksel dpll_iva_m4_div[] = { | 690 | static 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 | |||
697 | static 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 | ||
646 | static struct clk dpll_iva_m4_ck = { | 702 | static 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 | ||
658 | static struct clk dpll_iva_m5_ck = { | 714 | static 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 | ||
718 | static struct clk per_hs_clk_div_ck = { | 774 | static 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 | ||
725 | static const struct clksel per_hsd_byp_clk_mux_sel[] = { | 782 | static 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 | ||
847 | static 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 | |||
854 | static const struct clksel dpll_per_m2x2_div[] = { | ||
855 | { .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates }, | ||
856 | { .parent = NULL }, | ||
857 | }; | ||
858 | |||
790 | static struct clk dpll_per_m2x2_ck = { | 859 | static 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 | ||
797 | static struct clk dpll_per_m3_ck = { | 871 | static 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 | ||
809 | static struct clk dpll_per_m4_ck = { | 885 | static 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 | ||
821 | static struct clk dpll_per_m5_ck = { | 897 | static 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 | ||
833 | static struct clk dpll_per_m6_ck = { | 909 | static 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 | ||
845 | static struct clk dpll_per_m7_ck = { | 921 | static 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 | ||
965 | static 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 | |||
888 | static const struct clksel dpll_unipro_m2x2_div[] = { | 972 | static 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 | ||
893 | static struct clk dpll_unipro_m2x2_ck = { | 977 | static 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 | ||
905 | static struct clk usb_hs_clk_div_ck = { | 989 | static 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 */ |
913 | static struct dpll_data dpll_usb_dd = { | 998 | static 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 | ||
968 | static const struct clksel ducati_clk_mux_sel[] = { | 1053 | static 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 | ||
992 | static struct clk func_24m_clk = { | 1078 | static 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 | ||
999 | static struct clk func_24mc_fclk = { | 1086 | static 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 | ||
1006 | static const struct clksel_rate div2_4to8_rates[] = { | 1094 | static 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 | ||
1036 | static const struct clksel_rate div2_2to4_rates[] = { | 1125 | static const struct clksel_rate div2_2to4_rates[] = { |
@@ -1040,13 +1129,13 @@ static const struct clksel_rate div2_2to4_rates[] = { | |||
1040 | }; | 1129 | }; |
1041 | 1130 | ||
1042 | static const struct clksel func_64m_fclk_div[] = { | 1131 | static 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 | ||
1047 | static struct clk func_64m_fclk = { | 1136 | static 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 | ||
1153 | static const struct clksel l4_wkup_clk_mux_sel[] = { | 1243 | static 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 | ||
1221 | static const struct clksel pmd_stm_clock_mux_sel[] = { | 1312 | static 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 | ||
1443 | static const struct clksel fdif_fclk_div[] = { | 1534 | static 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 */ |
1449 | static struct clk fdif_fck = { | 1540 | static 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 | ||
1604 | static const struct clksel sgx_clk_mux_sel[] = { | 1695 | static 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 */ |
1611 | static struct clk gpu_fck = { | 1702 | static 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 | ||
2441 | static 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 | |||
2451 | static 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 | |||
2461 | static 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 | |||
2471 | static const struct clksel utmi_p1_gfclk_sel[] = { | 2535 | static 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 | ||
2589 | static 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 | |||
2525 | static struct clk usb_host_hs_hsic480m_p1_clk = { | 2599 | static 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 | ||
2609 | static 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 | |||
2619 | static 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 | |||
2535 | static struct clk usb_host_hs_hsic480m_p2_clk = { | 2629 | static 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 | ||
2658 | static const struct clksel usim_fclk_div[] = { | 2752 | static 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 | ||
2663 | static struct clk usim_ck = { | 2757 | static 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 | |||
2846 | static 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 | |||
2853 | static 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 | |||
2866 | static 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 | |||
2879 | static 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 | }; | ||
2891 | static 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 | |||
2904 | static 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 | |||
2917 | static 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 | |||
2930 | static 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 | |||
2940 | static 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 | |||
2951 | static 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 | |||
2962 | static 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 | |||
2973 | static 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 | |||
2984 | static 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 | |||
2995 | static 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 | ||
3002 | int __init omap4xxx_clk_init(void) | 3276 | int __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 | */ |
145 | static void _autodep_lookup(struct clkdm_autodep *autodep) | 150 | static 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 | */ |
172 | static void _clkdm_add_autodeps(struct clockdomain *clkdm) | 180 | static 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 | */ |
203 | static void _clkdm_del_autodeps(struct clockdomain *clkdm) | 214 | static 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 | */ |
234 | static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable) | 247 | static 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 | */ | ||
273 | static 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 | */ | ||
694 | static 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 | */ |
892 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | 900 | int 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 | */ |
947 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | 965 | int 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/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h new file mode 100644 index 000000000000..de3faa20b46b --- /dev/null +++ b/arch/arm/mach-omap2/clockdomain.h | |||
@@ -0,0 +1,149 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/clockdomain.h | ||
3 | * | ||
4 | * OMAP2/3 clockdomain framework functions | ||
5 | * | ||
6 | * Copyright (C) 2008 Texas Instruments, Inc. | ||
7 | * Copyright (C) 2008-2010 Nokia Corporation | ||
8 | * | ||
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 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H | ||
17 | #define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H | ||
18 | |||
19 | #include <linux/init.h> | ||
20 | |||
21 | #include "powerdomain.h" | ||
22 | #include <plat/clock.h> | ||
23 | #include <plat/cpu.h> | ||
24 | |||
25 | /* Clockdomain capability flags */ | ||
26 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | ||
27 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) | ||
28 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) | ||
29 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) | ||
30 | |||
31 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) | ||
32 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) | ||
33 | #define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP) | ||
34 | |||
35 | /** | ||
36 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode | ||
37 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only | ||
38 | * @omap_chip: OMAP chip types that this autodep is valid on | ||
39 | * | ||
40 | * A clockdomain that should have wkdeps and sleepdeps added when a | ||
41 | * clockdomain should stay active in hwsup mode; and conversely, | ||
42 | * removed when the clockdomain should be allowed to go inactive in | ||
43 | * hwsup mode. | ||
44 | * | ||
45 | * Autodeps are deprecated and should be removed after | ||
46 | * omap_hwmod-based fine-grained module idle control is added. | ||
47 | */ | ||
48 | struct clkdm_autodep { | ||
49 | union { | ||
50 | const char *name; | ||
51 | struct clockdomain *ptr; | ||
52 | } clkdm; | ||
53 | const struct omap_chip_id omap_chip; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * struct clkdm_dep - encode dependencies between clockdomains | ||
58 | * @clkdm_name: clockdomain name | ||
59 | * @clkdm: pointer to the struct clockdomain of @clkdm_name | ||
60 | * @omap_chip: OMAP chip types that this dependency is valid on | ||
61 | * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake | ||
62 | * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle | ||
63 | * | ||
64 | * Statically defined. @clkdm is resolved from @clkdm_name at runtime and | ||
65 | * should not be pre-initialized. | ||
66 | * | ||
67 | * XXX Should also include hardware (fixed) dependencies. | ||
68 | */ | ||
69 | struct clkdm_dep { | ||
70 | const char *clkdm_name; | ||
71 | struct clockdomain *clkdm; | ||
72 | atomic_t wkdep_usecount; | ||
73 | atomic_t sleepdep_usecount; | ||
74 | const struct omap_chip_id omap_chip; | ||
75 | }; | ||
76 | |||
77 | /** | ||
78 | * struct clockdomain - OMAP clockdomain | ||
79 | * @name: clockdomain name | ||
80 | * @pwrdm: powerdomain containing this clockdomain | ||
81 | * @clktrctrl_reg: CLKSTCTRL reg for the given clock domain | ||
82 | * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg | ||
83 | * @flags: Clockdomain capability flags | ||
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 | ||
88 | * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up | ||
89 | * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact | ||
90 | * @omap_chip: OMAP chip types that this clockdomain is valid on | ||
91 | * @usecount: Usecount tracking | ||
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) | ||
99 | */ | ||
100 | struct clockdomain { | ||
101 | const char *name; | ||
102 | union { | ||
103 | const char *name; | ||
104 | struct powerdomain *ptr; | ||
105 | } pwrdm; | ||
106 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
107 | const u16 clktrctrl_mask; | ||
108 | #endif | ||
109 | const u8 flags; | ||
110 | const u8 dep_bit; | ||
111 | const u8 prcm_partition; | ||
112 | const s16 cm_inst; | ||
113 | const u16 clkdm_offs; | ||
114 | struct clkdm_dep *wkdep_srcs; | ||
115 | struct clkdm_dep *sleepdep_srcs; | ||
116 | const struct omap_chip_id omap_chip; | ||
117 | atomic_t usecount; | ||
118 | struct list_head node; | ||
119 | }; | ||
120 | |||
121 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); | ||
122 | struct clockdomain *clkdm_lookup(const char *name); | ||
123 | |||
124 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), | ||
125 | void *user); | ||
126 | struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm); | ||
127 | |||
128 | int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
129 | int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
130 | int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
131 | int clkdm_clear_all_wkdeps(struct clockdomain *clkdm); | ||
132 | int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
133 | int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
134 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
135 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); | ||
136 | |||
137 | void omap2_clkdm_allow_idle(struct clockdomain *clkdm); | ||
138 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm); | ||
139 | |||
140 | int omap2_clkdm_wakeup(struct clockdomain *clkdm); | ||
141 | int omap2_clkdm_sleep(struct clockdomain *clkdm); | ||
142 | |||
143 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); | ||
144 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); | ||
145 | |||
146 | extern void __init omap2_clockdomains_init(void); | ||
147 | extern void __init omap44xx_clockdomains_init(void); | ||
148 | |||
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 */ |
431 | static struct clockdomain wkup_clkdm = { | 430 | static 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 | /* | 809 | static struct clockdomain *clockdomains_omap2[] __initdata = { |
855 | * List of clockdomain pointers per platform | ||
856 | */ | ||
857 | |||
858 | static 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 | 857 | void __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 | ||
33 | static struct clockdomain l4_cefuse_44xx_clkdm = { | 41 | static 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 = { | |||
42 | static struct clockdomain l4_cfg_44xx_clkdm = { | 51 | static 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 = { | |||
51 | static struct clockdomain tesla_44xx_clkdm = { | 61 | static 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 = { | |||
60 | static struct clockdomain l3_gfx_44xx_clkdm = { | 71 | static 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 = { | |||
69 | static struct clockdomain ivahd_44xx_clkdm = { | 81 | static 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 = { | |||
78 | static struct clockdomain l4_secure_44xx_clkdm = { | 91 | static 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 = { | |||
87 | static struct clockdomain l4_per_44xx_clkdm = { | 101 | static 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 = { | |||
96 | static struct clockdomain abe_44xx_clkdm = { | 111 | static 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 = { | |||
105 | static struct clockdomain l3_instr_44xx_clkdm = { | 121 | static 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 | ||
113 | static struct clockdomain l3_init_44xx_clkdm = { | 130 | static 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 = { | |||
122 | static struct clockdomain mpuss_44xx_clkdm = { | 140 | static 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 = { | |||
131 | static struct clockdomain mpu0_44xx_clkdm = { | 150 | static 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 = { | |||
140 | static struct clockdomain mpu1_44xx_clkdm = { | 160 | static 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 = { | |||
149 | static struct clockdomain l3_emif_44xx_clkdm = { | 170 | static 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 = { | |||
158 | static struct clockdomain l4_ao_44xx_clkdm = { | 180 | static 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 = { | |||
167 | static struct clockdomain ducati_44xx_clkdm = { | 190 | static 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 = { | |||
176 | static struct clockdomain l3_2_44xx_clkdm = { | 200 | static 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 = { | |||
185 | static struct clockdomain l3_1_44xx_clkdm = { | 210 | static 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 = { | |||
194 | static struct clockdomain l3_d2d_44xx_clkdm = { | 220 | static 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 = { | |||
203 | static struct clockdomain iss_44xx_clkdm = { | 230 | static 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 = { | |||
212 | static struct clockdomain l3_dss_44xx_clkdm = { | 240 | static 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 = { | |||
221 | static struct clockdomain l4_wkup_44xx_clkdm = { | 250 | static 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 = { | |||
230 | static struct clockdomain emu_sys_44xx_clkdm = { | 260 | static 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 = { | |||
239 | static struct clockdomain l3_dma_44xx_clkdm = { | 270 | static 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 | 280 | static 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 | 308 | void __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 | |||
30 | static 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 | */ | ||
42 | int 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 | |||
109 | extern u32 cm_read_mod_reg(s16 module, u16 idx); | ||
110 | extern void cm_write_mod_reg(u32 val, s16 module, u16 idx); | ||
111 | extern u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx); | ||
112 | |||
113 | extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, | ||
114 | u8 idlest_shift); | ||
115 | extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg); | ||
116 | |||
117 | static 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 | |||
122 | static 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 */ | ||
257 | extern u32 omap4_cm1_read_inst_reg(s16 inst, u16 idx); | ||
258 | extern void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 idx); | ||
259 | extern 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 */ | ||
504 | extern u32 omap4_cm2_read_inst_reg(s16 inst, u16 idx); | ||
505 | extern void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 idx); | ||
506 | extern 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 | |||
28 | static const u8 cm_idlest_offs[] = { | ||
29 | CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 | ||
30 | }; | ||
31 | |||
32 | u32 omap2_cm_read_mod_reg(s16 module, u16 idx) | ||
33 | { | ||
34 | return __raw_readl(cm_base + module + idx); | ||
35 | } | ||
36 | |||
37 | void 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 */ | ||
43 | u32 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 | |||
55 | u32 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 | |||
60 | u32 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 | |||
69 | static 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 | |||
79 | bool 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 | |||
98 | void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask) | ||
99 | { | ||
100 | _write_clktrctrl(OMAP24XX_CLKSTCTRL_ENABLE_AUTO, module, mask); | ||
101 | } | ||
102 | |||
103 | void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask) | ||
104 | { | ||
105 | _write_clktrctrl(OMAP24XX_CLKSTCTRL_DISABLE_AUTO, module, mask); | ||
106 | } | ||
107 | |||
108 | void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask) | ||
109 | { | ||
110 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, module, mask); | ||
111 | } | ||
112 | |||
113 | void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask) | ||
114 | { | ||
115 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, module, mask); | ||
116 | } | ||
117 | |||
118 | void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask) | ||
119 | { | ||
120 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, module, mask); | ||
121 | } | ||
122 | |||
123 | void 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 | */ | ||
141 | int 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 | ||
171 | struct 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 | |||
232 | static struct omap3_cm_regs cm_context; | ||
233 | |||
234 | void 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 | |||
356 | void 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 | |||
107 | extern u32 omap2_cm_read_mod_reg(s16 module, u16 idx); | ||
108 | extern void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx); | ||
109 | extern u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx); | ||
110 | |||
111 | extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, | ||
112 | u8 idlest_shift); | ||
113 | extern u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx); | ||
114 | extern u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx); | ||
115 | |||
116 | extern bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask); | ||
117 | extern void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask); | ||
118 | extern void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); | ||
119 | |||
120 | extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask); | ||
121 | extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); | ||
122 | extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); | ||
123 | extern 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__ | ||
143 | extern void omap3_cm_save_context(void); | ||
144 | extern 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 */ | ||
31 | u32 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 */ | ||
37 | void 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 */ | ||
43 | u32 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 */ | ||
49 | void 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 */ | 28 | extern 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 | */ | ||
47 | int 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 | |||
35 | static 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 */ | ||
45 | u32 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 */ | ||
54 | void 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 */ | ||
63 | u32 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 | */ | ||
90 | static 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 | */ | ||
109 | bool 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 | */ | ||
129 | void 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 | */ | ||
144 | void 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 | */ | ||
158 | void 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 | */ | ||
172 | void 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 | */ | ||
199 | int 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 | |||
14 | extern bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs); | ||
15 | extern void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs); | ||
16 | extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs); | ||
17 | extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs); | ||
18 | extern 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 | */ | ||
24 | extern u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx); | ||
25 | extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx); | ||
26 | extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, | ||
27 | s16 inst, s16 idx); | ||
28 | |||
29 | extern 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 | |||
29 | static void __iomem *omap2_ctrl_base; | 33 | static void __iomem *omap2_ctrl_base; |
30 | static void __iomem *omap4_ctrl_pad_base; | 34 | static 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 | ||
139 | static struct omap3_control_regs control_context; | 144 | static 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 | */ | ||
228 | void 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 | |||
530 | void 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 | */ | ||
547 | int 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); | |||
347 | extern void omap3_clear_scratchpad_contents(void); | 382 | extern void omap3_clear_scratchpad_contents(void); |
348 | extern u32 *get_restore_pointer(void); | 383 | extern u32 *get_restore_pointer(void); |
349 | extern u32 *get_es3_restore_pointer(void); | 384 | extern u32 *get_es3_restore_pointer(void); |
385 | extern u32 *get_omap3630_restore_pointer(void); | ||
350 | extern u32 omap3_arm_context[128]; | 386 | extern u32 omap3_arm_context[128]; |
351 | extern void omap3_control_save_context(void); | 387 | extern void omap3_control_save_context(void); |
352 | extern void omap3_control_restore_context(void); | 388 | extern void omap3_control_restore_context(void); |
353 | 389 | extern void omap3_ctrl_write_boot_mode(u8 bootmode); | |
390 | extern void omap3630_ctrl_disable_rta(void); | ||
391 | extern 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: | |||
293 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | 293 | DEFINE_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 | */ |
302 | void omap3_cpuidle_update_states(void) | 304 | void 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 | ||
457 | struct cpuidle_driver omap3_idle_driver = { | 470 | struct 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 = { | |||
638 | static void __init omap_hsmmc_reset(void) | 638 | static 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 | |||
705 | err4: | ||
706 | clk_put(fclk); | ||
707 | err3: | ||
708 | clk_disable(iclk); | ||
709 | err2: | ||
710 | clk_put(iclk); | ||
711 | err1: | ||
712 | printk(KERN_WARNING "%s: Unable to enable clocks for MMC%d, " | ||
713 | "cannot reset.\n", __func__, i); | ||
710 | } | 714 | } |
711 | #else | 715 | #else |
712 | static inline void omap_hsmmc_reset(void) {} | 716 | static 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 | |||
964 | static 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 | |||
1006 | static 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 | |||
1014 | static int __init omap2_init_devices(void) | 958 | static 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 | |||
37 | static u32 errata; | ||
38 | static u8 dma_stride; | ||
39 | |||
40 | static struct omap_dma_dev_attr *d; | ||
41 | |||
42 | static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end; | ||
43 | |||
44 | static 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 | |||
90 | static 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 | |||
98 | static void __iomem *dma_base; | ||
99 | static 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 | |||
109 | static 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 | |||
120 | static 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 | |||
129 | static 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 | |||
137 | static 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 | |||
145 | static 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 */ | ||
229 | static 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 | |||
292 | static 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 | } | ||
297 | arch_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 | */ |
240 | static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m, | 237 | static 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 | */ | ||
262 | static 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, | |||
278 | static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel) | 294 | static 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 | ||
42 | static int __init omap_dsp_init(void) | 49 | static 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 | |||
27 | static 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 | |||
35 | static 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 | */ | ||
99 | static int __init omap2_gpio_init(void) | ||
100 | { | ||
101 | return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, | ||
102 | NULL); | ||
103 | } | ||
104 | postcore_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 | ||
171 | unsigned 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 | |||
171 | unsigned int gpmc_ticks_to_ns(unsigned int ticks) | 181 | unsigned 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 |
42 | omap_irq_base: .word 0 | 49 | .globl omap_irq_base |
50 | omap_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 |
47 | 9: | ||
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 | ||
63 | 2400: ldr \base, =OMAP2_IRQ_BASE | ||
64 | ldr \tmp, =omap_irq_base | ||
65 | str \base, [\tmp, #0] | ||
66 | b 9b | ||
67 | 3400: ldr \base, =OMAP3_IRQ_BASE | ||
68 | ldr \tmp, =omap_irq_base | ||
69 | str \base, [\tmp, #0] | ||
70 | b 9b | ||
71 | 4400: ldr \base, =OMAP4_IRQ_BASE | ||
72 | ldr \tmp, =omap_irq_base | ||
73 | str \base, [\tmp, #0] | ||
74 | b 9b | ||
75 | 9997: | ||
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 | ||
314 | void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | 312 | static 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 | */ | ||
320 | static 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 | |||
336 | void __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 | ||
400 | void __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 | |||
420 | u8 omap_readb(u32 pa) | ||
421 | { | ||
422 | return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); | ||
423 | } | ||
424 | EXPORT_SYMBOL(omap_readb); | ||
425 | |||
426 | u16 omap_readw(u32 pa) | ||
427 | { | ||
428 | return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); | ||
429 | } | ||
430 | EXPORT_SYMBOL(omap_readw); | ||
431 | |||
432 | u32 omap_readl(u32 pa) | ||
433 | { | ||
434 | return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); | ||
435 | } | ||
436 | EXPORT_SYMBOL(omap_readl); | ||
437 | |||
438 | void omap_writeb(u8 v, u32 pa) | ||
439 | { | ||
440 | __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); | ||
441 | } | ||
442 | EXPORT_SYMBOL(omap_writeb); | ||
443 | |||
444 | void omap_writew(u16 v, u32 pa) | ||
445 | { | ||
446 | __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); | ||
447 | } | ||
448 | EXPORT_SYMBOL(omap_writew); | ||
449 | |||
450 | void omap_writel(u32 v, u32 pa) | ||
451 | { | ||
452 | __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); | ||
355 | } | 453 | } |
454 | EXPORT_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 | ||
285 | void omap3_intc_prepare_idle(void) | 285 | void 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 */ |
286 | static struct omap_mbox2_priv omap2_mbox_dsp_priv = { | 286 | static 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) |
310 | struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; | 310 | struct 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 | ||
440 | static int __devexit omap2_mbox_remove(struct platform_device *pdev) | 443 | static 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 | ||
45 | struct omap_mux_entry { | 46 | struct 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 | ||
50 | static unsigned long mux_phys; | 51 | static LIST_HEAD(mux_partitions); |
51 | static void __iomem *mux_base; | 52 | static DEFINE_MUTEX(muxmode_mutex); |
52 | static u8 omap_mux_flags; | 53 | |
54 | struct 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 | ||
54 | u16 omap_mux_read(u16 reg) | 66 | u16 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 | ||
62 | void omap_mux_write(u16 val, u16 reg) | 74 | void 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 | ||
70 | void omap_mux_write_array(struct omap_board_mux *board_mux) | 83 | void 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 | ||
78 | static LIST_HEAD(muxmodes); | ||
79 | static DEFINE_MUTEX(muxmode_mutex); | ||
80 | |||
81 | #ifdef CONFIG_OMAP_MUX | 93 | #ifdef CONFIG_OMAP_MUX |
82 | 94 | ||
83 | static char *omap_mux_options; | 95 | static char *omap_mux_options; |
84 | 96 | ||
85 | int __init omap_mux_init_gpio(int gpio, int val) | 97 | static 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 | ||
128 | int __init omap_mux_init_signal(const char *muxname, int val) | 142 | int __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 | |||
156 | static 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 | ||
215 | static int __init | ||
216 | omap_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 | |||
237 | int __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 | |||
257 | struct omap_hwmod_mux_info * __init | ||
258 | omap_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 | |||
310 | err3: | ||
311 | kfree(hmux->pads); | ||
312 | err2: | ||
313 | kfree(hmux); | ||
314 | err1: | ||
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 */ | ||
321 | void 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 | ||
253 | static int omap_mux_dbg_board_show(struct seq_file *s, void *unused) | 434 | static 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 | ||
287 | static int omap_mux_dbg_board_open(struct inode *inode, struct file *file) | 475 | static 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 | ||
292 | static const struct file_operations omap_mux_dbg_board_fops = { | 480 | static 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 | ||
487 | static 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 | |||
299 | static int omap_mux_dbg_signal_show(struct seq_file *s, void *unused) | 506 | static 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 | ||
332 | static ssize_t omap_mux_dbg_signal_write(struct file *file, | 544 | static 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 | ||
380 | static struct dentry *mux_dbg_dir; | 597 | static struct dentry *mux_dbg_dir; |
381 | 598 | ||
382 | static void __init omap_mux_dbg_init(void) | 599 | static 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 | |||
613 | static 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 */ |
422 | static int __init omap_mux_late_init(void) | 655 | static 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 | ||
556 | static int __init omap_mux_copy_names(struct omap_mux *src, | 791 | static 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 | ||
595 | static u16 omap_mux_get_by_gpio(int gpio) | 830 | static 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 */ |
612 | u16 omap_mux_get_gpio(int gpio) | 849 | u16 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 */ |
626 | void omap_mux_set_gpio(u16 val, int gpio) | 867 | void 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 | ||
639 | static struct omap_mux * __init omap_mux_list_add(struct omap_mux *src) | 884 | static 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 | */ |
670 | static void __init omap_mux_init_list(struct omap_mux *superset) | 917 | static 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 | ||
709 | static void omap_mux_init_signals(struct omap_board_mux *board_mux) | 958 | static 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 | ||
723 | static void omap_mux_init_signals(struct omap_board_mux *board_mux) | 973 | static 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 | ||
729 | int __init omap_mux_init(u32 mux_pbase, u32 mux_size, | 980 | static 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; | 982 | int __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 | */ | ||
96 | struct 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 | */ | ||
113 | struct 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 | */ |
78 | struct omap_mux { | 131 | struct 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 | */ | ||
178 | struct 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 | |||
188 | struct 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 | */ |
123 | int omap_mux_init_signal(const char *muxname, int val); | 204 | int 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 | */ | ||
211 | extern struct omap_hwmod_mux_info * | ||
212 | omap_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 | */ | ||
221 | void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state); | ||
222 | |||
125 | #else | 223 | #else |
126 | 224 | ||
127 | static inline int omap_mux_init_gpio(int gpio, int val) | 225 | static 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 | ||
234 | static inline struct omap_hwmod_mux_info * | ||
235 | omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) | ||
236 | { | ||
237 | return NULL; | ||
238 | } | ||
239 | |||
240 | static inline void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) | ||
241 | { | ||
242 | } | ||
243 | |||
244 | static 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); | |||
151 | void omap_mux_set_gpio(u16 val, int gpio); | 261 | void 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 | */ | ||
268 | struct 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 | */ |
158 | u16 omap_mux_read(u16 mux_offset); | 276 | u16 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 | */ |
167 | void omap_mux_write(u16 val, u16 mux_offset); | 286 | void 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 | */ |
175 | void omap_mux_write_array(struct omap_board_mux *board_mux); | 295 | void 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); | |||
196 | int omap3_mux_init(struct omap_board_mux *board_mux, int flags); | 317 | int 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 | */ | ||
324 | int 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 | */ |
201 | int omap_mux_init(u32 mux_pbase, u32 mux_size, | 329 | int 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 | */ | ||
53 | static 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) | ||
547 | struct 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 | */ | ||
760 | static 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) | ||
1265 | struct 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 | */ | ||
1478 | static 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) | ||
1549 | struct 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 | |||
1584 | int __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 | ||
55 | static int __init omap_l2_cache_init(void) | 55 | static 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 */ |
157 | static LIST_HEAD(omap_hwmod_list); | 160 | static LIST_HEAD(omap_hwmod_list); |
158 | 161 | ||
159 | static 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 */ |
162 | static struct omap_hwmod *mpu_oh; | 163 | static 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 | */ |
391 | static int _enable_wakeup(struct omap_hwmod *oh) | 391 | static 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 | */ |
424 | static int _disable_wakeup(struct omap_hwmod *oh) | 426 | static 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 | */ |
678 | static int _find_mpu_port_index(struct omap_hwmod *oh) | 682 | static 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 | */ |
712 | static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index) | 716 | static 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 | */ |
879 | static struct omap_hwmod *_lookup(const char *name) | 886 | static 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 | */ |
1106 | static int _reset(struct omap_hwmod *oh) | 1114 | static 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 | */ | ||
1190 | static 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 | */ |
1177 | int _omap_hwmod_enable(struct omap_hwmod *oh) | 1209 | static 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 | */ |
1233 | int _omap_hwmod_idle(struct omap_hwmod *oh) | 1266 | static 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 | */ |
1262 | static int _shutdown(struct omap_hwmod *oh) | 1299 | static 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 | */ |
1309 | static int _setup(struct omap_hwmod *oh, void *data) | 1360 | static 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 | */ | ||
1456 | static 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 | */ | ||
1446 | int 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 | |||
1477 | ohr_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 | */ |
1545 | int omap_hwmod_init(struct omap_hwmod **ohs) | 1598 | int __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 | */ |
1579 | int omap_hwmod_late_init(u8 skip_setup_idle) | 1631 | int 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 | */ | ||
1610 | int 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) | |||
1632 | int omap_hwmod_enable(struct omap_hwmod *oh) | 1655 | int 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 | */ |
1654 | int omap_hwmod_idle(struct omap_hwmod *oh) | 1677 | int 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 | */ |
1674 | int omap_hwmod_shutdown(struct omap_hwmod *oh) | 1699 | int 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 | */ |
1692 | int omap_hwmod_enable_clocks(struct omap_hwmod *oh) | 1719 | int 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 | */ |
1707 | int omap_hwmod_disable_clocks(struct omap_hwmod *oh) | 1736 | int 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) | |||
1752 | int omap_hwmod_reset(struct omap_hwmod *oh) | 1783 | int 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 | */ |
1956 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | 1988 | int 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 | */ |
1981 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) | 2018 | int 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) | |||
2006 | int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name) | 2048 | int 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) | |||
2032 | int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name) | 2075 | int 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) | |||
2057 | int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name) | 2101 | int 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 | */ | ||
2171 | int 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 | |||
2194 | ohsps_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 | */ | ||
2210 | u32 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; | |||
36 | static struct omap_hwmod omap2420_l3_main_hwmod; | 39 | static struct omap_hwmod omap2420_l3_main_hwmod; |
37 | static struct omap_hwmod omap2420_l4_core_hwmod; | 40 | static struct omap_hwmod omap2420_l4_core_hwmod; |
38 | static struct omap_hwmod omap2420_wd_timer2_hwmod; | 41 | static struct omap_hwmod omap2420_wd_timer2_hwmod; |
42 | static struct omap_hwmod omap2420_gpio1_hwmod; | ||
43 | static struct omap_hwmod omap2420_gpio2_hwmod; | ||
44 | static struct omap_hwmod omap2420_gpio3_hwmod; | ||
45 | static struct omap_hwmod omap2420_gpio4_hwmod; | ||
46 | static struct omap_hwmod omap2420_dma_system_hwmod; | ||
39 | 47 | ||
40 | /* L3 -> L4_CORE interface */ | 48 | /* L3 -> L4_CORE interface */ |
41 | static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { | 49 | static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { |
@@ -77,6 +85,8 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod; | |||
77 | static struct omap_hwmod omap2420_uart1_hwmod; | 85 | static struct omap_hwmod omap2420_uart1_hwmod; |
78 | static struct omap_hwmod omap2420_uart2_hwmod; | 86 | static struct omap_hwmod omap2420_uart2_hwmod; |
79 | static struct omap_hwmod omap2420_uart3_hwmod; | 87 | static struct omap_hwmod omap2420_uart3_hwmod; |
88 | static struct omap_hwmod omap2420_i2c1_hwmod; | ||
89 | static struct omap_hwmod omap2420_i2c2_hwmod; | ||
80 | 90 | ||
81 | /* L4_CORE -> L4_WKUP interface */ | 91 | /* L4_CORE -> L4_WKUP interface */ |
82 | static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { | 92 | static 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 */ | ||
156 | static 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 | |||
164 | static 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 */ | ||
174 | static 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 | |||
182 | static 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 */ |
143 | static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = { | 192 | static 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 | ||
264 | static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = { | 315 | static 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 */ | ||
474 | static 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 | |||
482 | static struct omap_hwmod_class i2c_class = { | ||
483 | .name = "i2c", | ||
484 | .sysc = &i2c_sysc, | ||
485 | }; | ||
486 | |||
487 | static struct omap_i2c_dev_attr i2c_dev_attr; | ||
488 | |||
489 | /* I2C1 */ | ||
490 | |||
491 | static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = { | ||
492 | { .irq = INT_24XX_I2C1_IRQ, }, | ||
493 | }; | ||
494 | |||
495 | static 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 | |||
500 | static struct omap_hwmod_ocp_if *omap2420_i2c1_slaves[] = { | ||
501 | &omap2420_l4_core__i2c1, | ||
502 | }; | ||
503 | |||
504 | static 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 | |||
530 | static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = { | ||
531 | { .irq = INT_24XX_I2C2_IRQ, }, | ||
532 | }; | ||
533 | |||
534 | static 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 | |||
539 | static struct omap_hwmod_ocp_if *omap2420_i2c2_slaves[] = { | ||
540 | &omap2420_l4_core__i2c2, | ||
541 | }; | ||
542 | |||
543 | static 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 */ | ||
568 | static 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 | |||
576 | static 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 */ | ||
586 | static 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 | |||
594 | static 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 */ | ||
604 | static 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 | |||
612 | static 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 */ | ||
622 | static 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 | |||
630 | static 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 */ | ||
640 | static struct omap_gpio_dev_attr gpio_dev_attr = { | ||
641 | .bank_width = 32, | ||
642 | .dbck_flag = false, | ||
643 | }; | ||
644 | |||
645 | static 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 | */ | ||
659 | static struct omap_hwmod_class omap242x_gpio_hwmod_class = { | ||
660 | .name = "gpio", | ||
661 | .sysc = &omap242x_gpio_sysc, | ||
662 | .rev = 0, | ||
663 | }; | ||
664 | |||
665 | /* gpio1 */ | ||
666 | static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = { | ||
667 | { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */ | ||
668 | }; | ||
669 | |||
670 | static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = { | ||
671 | &omap2420_l4_wkup__gpio1, | ||
672 | }; | ||
673 | |||
674 | static 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 */ | ||
696 | static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = { | ||
697 | { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */ | ||
698 | }; | ||
699 | |||
700 | static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = { | ||
701 | &omap2420_l4_wkup__gpio2, | ||
702 | }; | ||
703 | |||
704 | static 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 */ | ||
726 | static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = { | ||
727 | { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */ | ||
728 | }; | ||
729 | |||
730 | static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = { | ||
731 | &omap2420_l4_wkup__gpio3, | ||
732 | }; | ||
733 | |||
734 | static 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 */ | ||
756 | static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = { | ||
757 | { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */ | ||
758 | }; | ||
759 | |||
760 | static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = { | ||
761 | &omap2420_l4_wkup__gpio4, | ||
762 | }; | ||
763 | |||
764 | static 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 */ | ||
786 | static 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 | |||
797 | static struct omap_hwmod_class omap2420_dma_hwmod_class = { | ||
798 | .name = "dma", | ||
799 | .sysc = &omap2420_dma_sysc, | ||
800 | }; | ||
801 | |||
802 | /* dma attributes */ | ||
803 | static 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 | |||
809 | static 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 | |||
816 | static 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 */ | ||
825 | static 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 */ | ||
833 | static struct omap_hwmod_ocp_if *omap2420_dma_system_masters[] = { | ||
834 | &omap2420_dma_system__l3, | ||
835 | }; | ||
836 | |||
837 | /* l4_core -> dma_system */ | ||
838 | static 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 */ | ||
848 | static struct omap_hwmod_ocp_if *omap2420_dma_system_slaves[] = { | ||
849 | &omap2420_l4_core__dma_system, | ||
850 | }; | ||
851 | |||
852 | static 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 | |||
421 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { | 867 | static __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; | |||
36 | static struct omap_hwmod omap2430_l3_main_hwmod; | 39 | static struct omap_hwmod omap2430_l3_main_hwmod; |
37 | static struct omap_hwmod omap2430_l4_core_hwmod; | 40 | static struct omap_hwmod omap2430_l4_core_hwmod; |
38 | static struct omap_hwmod omap2430_wd_timer2_hwmod; | 41 | static struct omap_hwmod omap2430_wd_timer2_hwmod; |
42 | static struct omap_hwmod omap2430_gpio1_hwmod; | ||
43 | static struct omap_hwmod omap2430_gpio2_hwmod; | ||
44 | static struct omap_hwmod omap2430_gpio3_hwmod; | ||
45 | static struct omap_hwmod omap2430_gpio4_hwmod; | ||
46 | static struct omap_hwmod omap2430_gpio5_hwmod; | ||
47 | static struct omap_hwmod omap2430_dma_system_hwmod; | ||
39 | 48 | ||
40 | /* L3 -> L4_CORE interface */ | 49 | /* L3 -> L4_CORE interface */ |
41 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { | 50 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { |
@@ -77,6 +86,47 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod; | |||
77 | static struct omap_hwmod omap2430_uart1_hwmod; | 86 | static struct omap_hwmod omap2430_uart1_hwmod; |
78 | static struct omap_hwmod omap2430_uart2_hwmod; | 87 | static struct omap_hwmod omap2430_uart2_hwmod; |
79 | static struct omap_hwmod omap2430_uart3_hwmod; | 88 | static struct omap_hwmod omap2430_uart3_hwmod; |
89 | static struct omap_hwmod omap2430_i2c1_hwmod; | ||
90 | static 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 */ | ||
96 | static 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 | |||
104 | static 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 */ | ||
114 | static 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 | |||
122 | static 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 */ |
82 | static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { | 132 | static 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 | ||
264 | static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = { | 314 | static 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 */ | ||
473 | static 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 | |||
481 | static struct omap_hwmod_class i2c_class = { | ||
482 | .name = "i2c", | ||
483 | .sysc = &i2c_sysc, | ||
484 | }; | ||
485 | |||
486 | static struct omap_i2c_dev_attr i2c_dev_attr = { | ||
487 | .fifo_depth = 8, /* bytes */ | ||
488 | }; | ||
489 | |||
490 | /* I2C1 */ | ||
491 | |||
492 | static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = { | ||
493 | { .irq = INT_24XX_I2C1_IRQ, }, | ||
494 | }; | ||
495 | |||
496 | static 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 | |||
501 | static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = { | ||
502 | &omap2430_l4_core__i2c1, | ||
503 | }; | ||
504 | |||
505 | static 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 | |||
538 | static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = { | ||
539 | { .irq = INT_24XX_I2C2_IRQ, }, | ||
540 | }; | ||
541 | |||
542 | static 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 | |||
547 | static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = { | ||
548 | &omap2430_l4_core__i2c2, | ||
549 | }; | ||
550 | |||
551 | static 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 */ | ||
575 | static 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 | |||
583 | static 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 */ | ||
593 | static 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 | |||
601 | static 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 */ | ||
611 | static 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 | |||
619 | static 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 */ | ||
629 | static 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 | |||
637 | static 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 */ | ||
647 | static 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 | |||
655 | static 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 */ | ||
665 | static struct omap_gpio_dev_attr gpio_dev_attr = { | ||
666 | .bank_width = 32, | ||
667 | .dbck_flag = false, | ||
668 | }; | ||
669 | |||
670 | static 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 | */ | ||
684 | static struct omap_hwmod_class omap243x_gpio_hwmod_class = { | ||
685 | .name = "gpio", | ||
686 | .sysc = &omap243x_gpio_sysc, | ||
687 | .rev = 0, | ||
688 | }; | ||
689 | |||
690 | /* gpio1 */ | ||
691 | static struct omap_hwmod_irq_info omap243x_gpio1_irqs[] = { | ||
692 | { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */ | ||
693 | }; | ||
694 | |||
695 | static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = { | ||
696 | &omap2430_l4_wkup__gpio1, | ||
697 | }; | ||
698 | |||
699 | static 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 */ | ||
721 | static struct omap_hwmod_irq_info omap243x_gpio2_irqs[] = { | ||
722 | { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */ | ||
723 | }; | ||
724 | |||
725 | static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = { | ||
726 | &omap2430_l4_wkup__gpio2, | ||
727 | }; | ||
728 | |||
729 | static 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 */ | ||
751 | static struct omap_hwmod_irq_info omap243x_gpio3_irqs[] = { | ||
752 | { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */ | ||
753 | }; | ||
754 | |||
755 | static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = { | ||
756 | &omap2430_l4_wkup__gpio3, | ||
757 | }; | ||
758 | |||
759 | static 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 */ | ||
781 | static struct omap_hwmod_irq_info omap243x_gpio4_irqs[] = { | ||
782 | { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */ | ||
783 | }; | ||
784 | |||
785 | static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = { | ||
786 | &omap2430_l4_wkup__gpio4, | ||
787 | }; | ||
788 | |||
789 | static 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 */ | ||
811 | static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = { | ||
812 | { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */ | ||
813 | }; | ||
814 | |||
815 | static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = { | ||
816 | &omap2430_l4_core__gpio5, | ||
817 | }; | ||
818 | |||
819 | static 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 */ | ||
841 | static 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 | |||
852 | static struct omap_hwmod_class omap2430_dma_hwmod_class = { | ||
853 | .name = "dma", | ||
854 | .sysc = &omap2430_dma_sysc, | ||
855 | }; | ||
856 | |||
857 | /* dma attributes */ | ||
858 | static 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 | |||
864 | static 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 | |||
871 | static 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 */ | ||
880 | static 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 */ | ||
888 | static struct omap_hwmod_ocp_if *omap2430_dma_system_masters[] = { | ||
889 | &omap2430_dma_system__l3, | ||
890 | }; | ||
891 | |||
892 | /* l4_core -> dma_system */ | ||
893 | static 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 */ | ||
903 | static struct omap_hwmod_ocp_if *omap2430_dma_system_slaves[] = { | ||
904 | &omap2430_l4_core__dma_system, | ||
905 | }; | ||
906 | |||
907 | static 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 | |||
421 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { | 922 | static __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; | |||
39 | static struct omap_hwmod omap3xxx_l4_core_hwmod; | 44 | static struct omap_hwmod omap3xxx_l4_core_hwmod; |
40 | static struct omap_hwmod omap3xxx_l4_per_hwmod; | 45 | static struct omap_hwmod omap3xxx_l4_per_hwmod; |
41 | static struct omap_hwmod omap3xxx_wd_timer2_hwmod; | 46 | static struct omap_hwmod omap3xxx_wd_timer2_hwmod; |
47 | static struct omap_hwmod omap3xxx_i2c1_hwmod; | ||
48 | static struct omap_hwmod omap3xxx_i2c2_hwmod; | ||
49 | static struct omap_hwmod omap3xxx_i2c3_hwmod; | ||
50 | static struct omap_hwmod omap3xxx_gpio1_hwmod; | ||
51 | static struct omap_hwmod omap3xxx_gpio2_hwmod; | ||
52 | static struct omap_hwmod omap3xxx_gpio3_hwmod; | ||
53 | static struct omap_hwmod omap3xxx_gpio4_hwmod; | ||
54 | static struct omap_hwmod omap3xxx_gpio5_hwmod; | ||
55 | static struct omap_hwmod omap3xxx_gpio6_hwmod; | ||
56 | static struct omap_hwmod omap34xx_sr1_hwmod; | ||
57 | static struct omap_hwmod omap34xx_sr2_hwmod; | ||
58 | |||
59 | static struct omap_hwmod omap3xxx_dma_system_hwmod; | ||
42 | 60 | ||
43 | /* L3 -> L4_CORE interface */ | 61 | /* L3 -> L4_CORE interface */ |
44 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { | 62 | static 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 */ | ||
194 | static 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 | |||
202 | static 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 */ | ||
219 | static 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 | |||
227 | static 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 */ | ||
244 | static 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 | |||
252 | static 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 */ | ||
269 | static 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 | |||
277 | static 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 */ | ||
287 | static 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 | |||
295 | static 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 */ |
173 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { | 305 | static 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 */ | ||
456 | static 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 | |||
318 | static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = { | 467 | static 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 | ||
662 | static struct omap_hwmod_class i2c_class = { | ||
663 | .name = "i2c", | ||
664 | .sysc = &i2c_sysc, | ||
665 | }; | ||
666 | |||
667 | /* I2C1 */ | ||
668 | |||
669 | static struct omap_i2c_dev_attr i2c1_dev_attr = { | ||
670 | .fifo_depth = 8, /* bytes */ | ||
671 | }; | ||
672 | |||
673 | static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = { | ||
674 | { .irq = INT_24XX_I2C1_IRQ, }, | ||
675 | }; | ||
676 | |||
677 | static 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 | |||
682 | static struct omap_hwmod_ocp_if *omap3xxx_i2c1_slaves[] = { | ||
683 | &omap3_l4_core__i2c1, | ||
684 | }; | ||
685 | |||
686 | static 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 | |||
711 | static struct omap_i2c_dev_attr i2c2_dev_attr = { | ||
712 | .fifo_depth = 8, /* bytes */ | ||
713 | }; | ||
714 | |||
715 | static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = { | ||
716 | { .irq = INT_24XX_I2C2_IRQ, }, | ||
717 | }; | ||
718 | |||
719 | static 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 | |||
724 | static struct omap_hwmod_ocp_if *omap3xxx_i2c2_slaves[] = { | ||
725 | &omap3_l4_core__i2c2, | ||
726 | }; | ||
727 | |||
728 | static 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 | |||
753 | static struct omap_i2c_dev_attr i2c3_dev_attr = { | ||
754 | .fifo_depth = 64, /* bytes */ | ||
755 | }; | ||
756 | |||
757 | static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = { | ||
758 | { .irq = INT_34XX_I2C3_IRQ, }, | ||
759 | }; | ||
760 | |||
761 | static 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 | |||
766 | static struct omap_hwmod_ocp_if *omap3xxx_i2c3_slaves[] = { | ||
767 | &omap3_l4_core__i2c3, | ||
768 | }; | ||
769 | |||
770 | static 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 */ | ||
794 | static 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 | |||
802 | static 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 */ | ||
811 | static 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 | |||
819 | static 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 */ | ||
828 | static 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 | |||
836 | static 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 */ | ||
845 | static 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 | |||
853 | static 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 */ | ||
862 | static 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 | |||
870 | static 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 */ | ||
879 | static 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 | |||
887 | static 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 | |||
900 | static 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 | |||
910 | static 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*/ | ||
917 | static struct omap_gpio_dev_attr gpio_dev_attr = { | ||
918 | .bank_width = 32, | ||
919 | .dbck_flag = true, | ||
920 | }; | ||
921 | |||
922 | /* gpio1 */ | ||
923 | static struct omap_hwmod_irq_info omap3xxx_gpio1_irqs[] = { | ||
924 | { .irq = 29 }, /* INT_34XX_GPIO_BANK1 */ | ||
925 | }; | ||
926 | |||
927 | static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { | ||
928 | { .role = "dbclk", .clk = "gpio1_dbck", }, | ||
929 | }; | ||
930 | |||
931 | static struct omap_hwmod_ocp_if *omap3xxx_gpio1_slaves[] = { | ||
932 | &omap3xxx_l4_wkup__gpio1, | ||
933 | }; | ||
934 | |||
935 | static 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 */ | ||
959 | static struct omap_hwmod_irq_info omap3xxx_gpio2_irqs[] = { | ||
960 | { .irq = 30 }, /* INT_34XX_GPIO_BANK2 */ | ||
961 | }; | ||
962 | |||
963 | static struct omap_hwmod_opt_clk gpio2_opt_clks[] = { | ||
964 | { .role = "dbclk", .clk = "gpio2_dbck", }, | ||
965 | }; | ||
966 | |||
967 | static struct omap_hwmod_ocp_if *omap3xxx_gpio2_slaves[] = { | ||
968 | &omap3xxx_l4_per__gpio2, | ||
969 | }; | ||
970 | |||
971 | static 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 */ | ||
995 | static struct omap_hwmod_irq_info omap3xxx_gpio3_irqs[] = { | ||
996 | { .irq = 31 }, /* INT_34XX_GPIO_BANK3 */ | ||
997 | }; | ||
998 | |||
999 | static struct omap_hwmod_opt_clk gpio3_opt_clks[] = { | ||
1000 | { .role = "dbclk", .clk = "gpio3_dbck", }, | ||
1001 | }; | ||
1002 | |||
1003 | static struct omap_hwmod_ocp_if *omap3xxx_gpio3_slaves[] = { | ||
1004 | &omap3xxx_l4_per__gpio3, | ||
1005 | }; | ||
1006 | |||
1007 | static 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 */ | ||
1031 | static struct omap_hwmod_irq_info omap3xxx_gpio4_irqs[] = { | ||
1032 | { .irq = 32 }, /* INT_34XX_GPIO_BANK4 */ | ||
1033 | }; | ||
1034 | |||
1035 | static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { | ||
1036 | { .role = "dbclk", .clk = "gpio4_dbck", }, | ||
1037 | }; | ||
1038 | |||
1039 | static struct omap_hwmod_ocp_if *omap3xxx_gpio4_slaves[] = { | ||
1040 | &omap3xxx_l4_per__gpio4, | ||
1041 | }; | ||
1042 | |||
1043 | static 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 */ | ||
1067 | static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = { | ||
1068 | { .irq = 33 }, /* INT_34XX_GPIO_BANK5 */ | ||
1069 | }; | ||
1070 | |||
1071 | static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { | ||
1072 | { .role = "dbclk", .clk = "gpio5_dbck", }, | ||
1073 | }; | ||
1074 | |||
1075 | static struct omap_hwmod_ocp_if *omap3xxx_gpio5_slaves[] = { | ||
1076 | &omap3xxx_l4_per__gpio5, | ||
1077 | }; | ||
1078 | |||
1079 | static 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 */ | ||
1103 | static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = { | ||
1104 | { .irq = 34 }, /* INT_34XX_GPIO_BANK6 */ | ||
1105 | }; | ||
1106 | |||
1107 | static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { | ||
1108 | { .role = "dbclk", .clk = "gpio6_dbck", }, | ||
1109 | }; | ||
1110 | |||
1111 | static struct omap_hwmod_ocp_if *omap3xxx_gpio6_slaves[] = { | ||
1112 | &omap3xxx_l4_per__gpio6, | ||
1113 | }; | ||
1114 | |||
1115 | static 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 */ | ||
1139 | static 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 */ | ||
1147 | static 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 | |||
1153 | static 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 | |||
1165 | static struct omap_hwmod_class omap3xxx_dma_hwmod_class = { | ||
1166 | .name = "dma", | ||
1167 | .sysc = &omap3xxx_dma_sysc, | ||
1168 | }; | ||
1169 | |||
1170 | /* dma_system */ | ||
1171 | static 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 | |||
1178 | static 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 */ | ||
1187 | static struct omap_hwmod_ocp_if *omap3xxx_dma_system_masters[] = { | ||
1188 | &omap3xxx_dma_system__l3, | ||
1189 | }; | ||
1190 | |||
1191 | /* l4_cfg -> dma_system */ | ||
1192 | static 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 */ | ||
1202 | static struct omap_hwmod_ocp_if *omap3xxx_dma_system_slaves[] = { | ||
1203 | &omap3xxx_l4_core__dma_system, | ||
1204 | }; | ||
1205 | |||
1206 | static 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 */ | ||
1231 | static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { | ||
1232 | .clkact_shift = 20, | ||
1233 | }; | ||
1234 | |||
1235 | static 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 | |||
1242 | static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = { | ||
1243 | .name = "smartreflex", | ||
1244 | .sysc = &omap34xx_sr_sysc, | ||
1245 | .rev = 1, | ||
1246 | }; | ||
1247 | |||
1248 | static struct omap_hwmod_sysc_fields omap36xx_sr_sysc_fields = { | ||
1249 | .sidle_shift = 24, | ||
1250 | .enwkup_shift = 26 | ||
1251 | }; | ||
1252 | |||
1253 | static 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 | |||
1261 | static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = { | ||
1262 | .name = "smartreflex", | ||
1263 | .sysc = &omap36xx_sr_sysc, | ||
1264 | .rev = 2, | ||
1265 | }; | ||
1266 | |||
1267 | /* SR1 */ | ||
1268 | static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = { | ||
1269 | &omap3_l4_core__sr1, | ||
1270 | }; | ||
1271 | |||
1272 | static 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 | |||
1294 | static 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 */ | ||
1314 | static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = { | ||
1315 | &omap3_l4_core__sr2, | ||
1316 | }; | ||
1317 | |||
1318 | static 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 | |||
1340 | static 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 | |||
512 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 1359 | static __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) */ |
43 | static struct omap_hwmod omap44xx_dma_system_hwmod; | ||
38 | static struct omap_hwmod omap44xx_dmm_hwmod; | 44 | static struct omap_hwmod omap44xx_dmm_hwmod; |
45 | static struct omap_hwmod omap44xx_dsp_hwmod; | ||
39 | static struct omap_hwmod omap44xx_emif_fw_hwmod; | 46 | static struct omap_hwmod omap44xx_emif_fw_hwmod; |
47 | static struct omap_hwmod omap44xx_iva_hwmod; | ||
40 | static struct omap_hwmod omap44xx_l3_instr_hwmod; | 48 | static struct omap_hwmod omap44xx_l3_instr_hwmod; |
41 | static struct omap_hwmod omap44xx_l3_main_1_hwmod; | 49 | static struct omap_hwmod omap44xx_l3_main_1_hwmod; |
42 | static struct omap_hwmod omap44xx_l3_main_2_hwmod; | 50 | static 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 | */ |
60 | static struct omap_hwmod_class omap44xx_dmm_hwmod_class = { | 68 | static 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 | |||
81 | static 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 | */ |
105 | static struct omap_hwmod_class omap44xx_emif_fw_hwmod_class = { | 123 | static 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 | ||
136 | static 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 */ |
119 | static struct omap_hwmod_ocp_if omap44xx_l4_cfg__emif_fw = { | 145 | static 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 | */ |
144 | static struct omap_hwmod_class omap44xx_l3_hwmod_class = { | 172 | static 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 */ | ||
178 | static 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 */ |
150 | static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = { | 186 | static 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 */ |
158 | static struct omap_hwmod_ocp_if *omap44xx_l3_instr_slaves[] = { | 194 | static 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 */ | ||
209 | static 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 */ |
171 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { | 217 | static 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 */ |
195 | static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { | 241 | static 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 */ | ||
258 | static 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 */ | ||
266 | static 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 */ |
211 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { | 274 | static 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 */ |
227 | static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { | 290 | static 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 | */ |
284 | static struct omap_hwmod_class omap44xx_l4_hwmod_class = { | 349 | static 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 */ | ||
355 | static 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 */ |
290 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l4_abe = { | 363 | static 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 */ |
306 | static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { | 379 | static 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 | */ |
389 | static struct omap_hwmod_class omap44xx_mpu_bus_hwmod_class = { | 463 | static 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 | |||
584 | static 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 | |||
597 | static struct omap_hwmod_class omap44xx_dma_hwmod_class = { | ||
598 | .name = "dma", | ||
599 | .sysc = &omap44xx_dma_sysc, | ||
600 | }; | ||
601 | |||
602 | /* dma dev_attr */ | ||
603 | static 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 */ | ||
610 | static 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 */ | ||
618 | static struct omap_hwmod_ocp_if *omap44xx_dma_system_masters[] = { | ||
619 | &omap44xx_dma_system__l3_main_2, | ||
620 | }; | ||
621 | |||
622 | static 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 */ | ||
631 | static 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 */ | ||
641 | static struct omap_hwmod_ocp_if *omap44xx_dma_system_slaves[] = { | ||
642 | &omap44xx_l4_cfg__dma_system, | ||
643 | }; | ||
644 | |||
645 | static 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 | |||
669 | static struct omap_hwmod_class omap44xx_dsp_hwmod_class = { | ||
670 | .name = "dsp", | ||
671 | }; | ||
672 | |||
673 | /* dsp */ | ||
674 | static struct omap_hwmod_irq_info omap44xx_dsp_irqs[] = { | ||
675 | { .irq = 28 + OMAP44XX_IRQ_GIC_START }, | ||
676 | }; | ||
677 | |||
678 | static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = { | ||
679 | { .name = "mmu_cache", .rst_shift = 1 }, | ||
680 | }; | ||
681 | |||
682 | static struct omap_hwmod_rst_info omap44xx_dsp_c0_resets[] = { | ||
683 | { .name = "dsp", .rst_shift = 0 }, | ||
684 | }; | ||
685 | |||
686 | /* dsp -> iva */ | ||
687 | static 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 */ | ||
694 | static 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 */ | ||
701 | static 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 */ | ||
709 | static struct omap_hwmod_ocp_if *omap44xx_dsp_slaves[] = { | ||
710 | &omap44xx_l4_cfg__dsp, | ||
711 | }; | ||
712 | |||
713 | /* Pseudo hwmod for reset control purpose only */ | ||
714 | static 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 | |||
728 | static 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 | |||
754 | static 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 | |||
766 | static 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 */ | ||
773 | static struct omap_gpio_dev_attr gpio_dev_attr = { | ||
774 | .bank_width = 32, | ||
775 | .dbck_flag = true, | ||
776 | }; | ||
777 | |||
778 | /* gpio1 */ | ||
779 | static struct omap_hwmod omap44xx_gpio1_hwmod; | ||
780 | static struct omap_hwmod_irq_info omap44xx_gpio1_irqs[] = { | ||
781 | { .irq = 29 + OMAP44XX_IRQ_GIC_START }, | ||
782 | }; | ||
783 | |||
784 | static 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 */ | ||
793 | static 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 */ | ||
803 | static struct omap_hwmod_ocp_if *omap44xx_gpio1_slaves[] = { | ||
804 | &omap44xx_l4_wkup__gpio1, | ||
805 | }; | ||
806 | |||
807 | static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { | ||
808 | { .role = "dbclk", .clk = "gpio1_dbclk" }, | ||
809 | }; | ||
810 | |||
811 | static 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 */ | ||
831 | static struct omap_hwmod omap44xx_gpio2_hwmod; | ||
832 | static struct omap_hwmod_irq_info omap44xx_gpio2_irqs[] = { | ||
833 | { .irq = 30 + OMAP44XX_IRQ_GIC_START }, | ||
834 | }; | ||
835 | |||
836 | static 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 */ | ||
845 | static 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 */ | ||
855 | static struct omap_hwmod_ocp_if *omap44xx_gpio2_slaves[] = { | ||
856 | &omap44xx_l4_per__gpio2, | ||
857 | }; | ||
858 | |||
859 | static struct omap_hwmod_opt_clk gpio2_opt_clks[] = { | ||
860 | { .role = "dbclk", .clk = "gpio2_dbclk" }, | ||
861 | }; | ||
862 | |||
863 | static 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 */ | ||
884 | static struct omap_hwmod omap44xx_gpio3_hwmod; | ||
885 | static struct omap_hwmod_irq_info omap44xx_gpio3_irqs[] = { | ||
886 | { .irq = 31 + OMAP44XX_IRQ_GIC_START }, | ||
887 | }; | ||
888 | |||
889 | static 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 */ | ||
898 | static 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 */ | ||
908 | static struct omap_hwmod_ocp_if *omap44xx_gpio3_slaves[] = { | ||
909 | &omap44xx_l4_per__gpio3, | ||
910 | }; | ||
911 | |||
912 | static struct omap_hwmod_opt_clk gpio3_opt_clks[] = { | ||
913 | { .role = "dbclk", .clk = "gpio3_dbclk" }, | ||
914 | }; | ||
915 | |||
916 | static 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 */ | ||
937 | static struct omap_hwmod omap44xx_gpio4_hwmod; | ||
938 | static struct omap_hwmod_irq_info omap44xx_gpio4_irqs[] = { | ||
939 | { .irq = 32 + OMAP44XX_IRQ_GIC_START }, | ||
940 | }; | ||
941 | |||
942 | static 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 */ | ||
951 | static 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 */ | ||
961 | static struct omap_hwmod_ocp_if *omap44xx_gpio4_slaves[] = { | ||
962 | &omap44xx_l4_per__gpio4, | ||
963 | }; | ||
964 | |||
965 | static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { | ||
966 | { .role = "dbclk", .clk = "gpio4_dbclk" }, | ||
967 | }; | ||
968 | |||
969 | static 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 */ | ||
990 | static struct omap_hwmod omap44xx_gpio5_hwmod; | ||
991 | static struct omap_hwmod_irq_info omap44xx_gpio5_irqs[] = { | ||
992 | { .irq = 33 + OMAP44XX_IRQ_GIC_START }, | ||
993 | }; | ||
994 | |||
995 | static 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 */ | ||
1004 | static 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 */ | ||
1014 | static struct omap_hwmod_ocp_if *omap44xx_gpio5_slaves[] = { | ||
1015 | &omap44xx_l4_per__gpio5, | ||
1016 | }; | ||
1017 | |||
1018 | static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { | ||
1019 | { .role = "dbclk", .clk = "gpio5_dbclk" }, | ||
1020 | }; | ||
1021 | |||
1022 | static 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 */ | ||
1043 | static struct omap_hwmod omap44xx_gpio6_hwmod; | ||
1044 | static struct omap_hwmod_irq_info omap44xx_gpio6_irqs[] = { | ||
1045 | { .irq = 34 + OMAP44XX_IRQ_GIC_START }, | ||
1046 | }; | ||
1047 | |||
1048 | static 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 */ | ||
1057 | static 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 */ | ||
1067 | static struct omap_hwmod_ocp_if *omap44xx_gpio6_slaves[] = { | ||
1068 | &omap44xx_l4_per__gpio6, | ||
1069 | }; | ||
1070 | |||
1071 | static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { | ||
1072 | { .role = "dbclk", .clk = "gpio6_dbclk" }, | ||
1073 | }; | ||
1074 | |||
1075 | static 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 | |||
1100 | static 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 | |||
1111 | static struct omap_hwmod_class omap44xx_i2c_hwmod_class = { | ||
1112 | .name = "i2c", | ||
1113 | .sysc = &omap44xx_i2c_sysc, | ||
1114 | }; | ||
1115 | |||
1116 | /* i2c1 */ | ||
1117 | static struct omap_hwmod omap44xx_i2c1_hwmod; | ||
1118 | static struct omap_hwmod_irq_info omap44xx_i2c1_irqs[] = { | ||
1119 | { .irq = 56 + OMAP44XX_IRQ_GIC_START }, | ||
1120 | }; | ||
1121 | |||
1122 | static 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 | |||
1127 | static 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 */ | ||
1136 | static 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 */ | ||
1146 | static struct omap_hwmod_ocp_if *omap44xx_i2c1_slaves[] = { | ||
1147 | &omap44xx_l4_per__i2c1, | ||
1148 | }; | ||
1149 | |||
1150 | static 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 */ | ||
1170 | static struct omap_hwmod omap44xx_i2c2_hwmod; | ||
1171 | static struct omap_hwmod_irq_info omap44xx_i2c2_irqs[] = { | ||
1172 | { .irq = 57 + OMAP44XX_IRQ_GIC_START }, | ||
1173 | }; | ||
1174 | |||
1175 | static 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 | |||
1180 | static 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 */ | ||
1189 | static 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 */ | ||
1199 | static struct omap_hwmod_ocp_if *omap44xx_i2c2_slaves[] = { | ||
1200 | &omap44xx_l4_per__i2c2, | ||
1201 | }; | ||
1202 | |||
1203 | static 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 */ | ||
1223 | static struct omap_hwmod omap44xx_i2c3_hwmod; | ||
1224 | static struct omap_hwmod_irq_info omap44xx_i2c3_irqs[] = { | ||
1225 | { .irq = 61 + OMAP44XX_IRQ_GIC_START }, | ||
1226 | }; | ||
1227 | |||
1228 | static 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 | |||
1233 | static 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 */ | ||
1242 | static 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 */ | ||
1252 | static struct omap_hwmod_ocp_if *omap44xx_i2c3_slaves[] = { | ||
1253 | &omap44xx_l4_per__i2c3, | ||
1254 | }; | ||
1255 | |||
1256 | static 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 */ | ||
1276 | static struct omap_hwmod omap44xx_i2c4_hwmod; | ||
1277 | static struct omap_hwmod_irq_info omap44xx_i2c4_irqs[] = { | ||
1278 | { .irq = 62 + OMAP44XX_IRQ_GIC_START }, | ||
1279 | }; | ||
1280 | |||
1281 | static 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 | |||
1286 | static 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 */ | ||
1295 | static 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 */ | ||
1305 | static struct omap_hwmod_ocp_if *omap44xx_i2c4_slaves[] = { | ||
1306 | &omap44xx_l4_per__i2c4, | ||
1307 | }; | ||
1308 | |||
1309 | static 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 | |||
1333 | static struct omap_hwmod_class omap44xx_iva_hwmod_class = { | ||
1334 | .name = "iva", | ||
1335 | }; | ||
1336 | |||
1337 | /* iva */ | ||
1338 | static 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 | |||
1344 | static struct omap_hwmod_rst_info omap44xx_iva_resets[] = { | ||
1345 | { .name = "logic", .rst_shift = 2 }, | ||
1346 | }; | ||
1347 | |||
1348 | static struct omap_hwmod_rst_info omap44xx_iva_seq0_resets[] = { | ||
1349 | { .name = "seq0", .rst_shift = 0 }, | ||
1350 | }; | ||
1351 | |||
1352 | static struct omap_hwmod_rst_info omap44xx_iva_seq1_resets[] = { | ||
1353 | { .name = "seq1", .rst_shift = 1 }, | ||
1354 | }; | ||
1355 | |||
1356 | /* iva master ports */ | ||
1357 | static struct omap_hwmod_ocp_if *omap44xx_iva_masters[] = { | ||
1358 | &omap44xx_iva__l3_main_2, | ||
1359 | &omap44xx_iva__l3_instr, | ||
1360 | }; | ||
1361 | |||
1362 | static 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 */ | ||
1371 | static 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 */ | ||
1381 | static 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 */ | ||
1387 | static 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 */ | ||
1402 | static 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 | |||
1416 | static 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 | ||
420 | static struct omap_hwmod_class omap44xx_mpu_hwmod_class = { | 1442 | static 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 | ||
461 | static struct omap_hwmod_class_sysconfig omap44xx_wd_timer_sysc = { | 1483 | /* The IP is not compliant to type1 / type2 scheme */ |
462 | .rev_offs = 0x0000, | 1484 | static 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 | /* | 1489 | static 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 | ||
476 | static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = { | 1497 | static 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 | ||
486 | static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = { | 1503 | /* smartreflex_core */ |
487 | .name = "wd_timer", | 1504 | static struct omap_hwmod omap44xx_smartreflex_core_hwmod; |
488 | .sysc = &omap44xx_wd_timer_sysc, | 1505 | static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = { |
1506 | { .irq = 19 + OMAP44XX_IRQ_GIC_START }, | ||
489 | }; | 1507 | }; |
490 | 1508 | ||
491 | /* wd_timer2 */ | 1509 | static struct omap_hwmod_addr_space omap44xx_smartreflex_core_addrs[] = { |
492 | static struct omap_hwmod omap44xx_wd_timer2_hwmod; | 1510 | { |
493 | static 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 | ||
497 | static struct omap_hwmod_addr_space omap44xx_wd_timer2_addrs[] = { | 1517 | /* l4_cfg -> smartreflex_core */ |
1518 | static 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 */ | ||
1528 | static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { | ||
1529 | &omap44xx_l4_cfg__smartreflex_core, | ||
1530 | }; | ||
1531 | |||
1532 | static 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 */ | ||
1550 | static struct omap_hwmod omap44xx_smartreflex_iva_hwmod; | ||
1551 | static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = { | ||
1552 | { .irq = 102 + OMAP44XX_IRQ_GIC_START }, | ||
1553 | }; | ||
1554 | |||
1555 | static 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 */ | ||
1564 | static 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 */ | ||
1574 | static struct omap_hwmod_ocp_if *omap44xx_smartreflex_iva_slaves[] = { | ||
1575 | &omap44xx_l4_cfg__smartreflex_iva, | ||
1576 | }; | ||
1577 | |||
1578 | static 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 */ | ||
1596 | static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod; | ||
1597 | static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = { | ||
1598 | { .irq = 18 + OMAP44XX_IRQ_GIC_START }, | ||
1599 | }; | ||
1600 | |||
1601 | static 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 */ | ||
1610 | static 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 */ | ||
1620 | static struct omap_hwmod_ocp_if *omap44xx_smartreflex_mpu_slaves[] = { | ||
1621 | &omap44xx_l4_cfg__smartreflex_mpu, | ||
1622 | }; | ||
1623 | |||
1624 | static 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 | |||
1646 | static 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 | |||
505 | static struct omap_hwmod_class omap44xx_uart_hwmod_class = { | 1658 | static 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 */ | ||
582 | static 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 */ | ||
592 | static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = { | ||
593 | &omap44xx_l4_wkup__wd_timer2, | ||
594 | }; | ||
595 | |||
596 | static 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 */ | ||
613 | static struct omap_hwmod omap44xx_wd_timer3_hwmod; | ||
614 | static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = { | ||
615 | { .irq = 36 + OMAP44XX_IRQ_GIC_START }, | ||
616 | }; | ||
617 | |||
618 | static 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 */ |
627 | static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = { | 1735 | static 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 */ | ||
679 | static 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) */ | ||
689 | static 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 */ |
698 | static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = { | 1787 | static 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 | ||
750 | static 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 */ | ||
760 | static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = { | ||
761 | &omap44xx_l4_abe__wd_timer3, | ||
762 | &omap44xx_l4_abe__wd_timer3_dma, | ||
763 | }; | ||
764 | |||
765 | static 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 */ |
782 | static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = { | 1840 | static 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 | |||
1878 | static 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 | |||
1889 | static 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 */ | ||
1896 | static struct omap_hwmod omap44xx_wd_timer2_hwmod; | ||
1897 | static struct omap_hwmod_irq_info omap44xx_wd_timer2_irqs[] = { | ||
1898 | { .irq = 80 + OMAP44XX_IRQ_GIC_START }, | ||
1899 | }; | ||
1900 | |||
1901 | static 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 */ | ||
1910 | static 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 */ | ||
1920 | static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = { | ||
1921 | &omap44xx_l4_wkup__wd_timer2, | ||
1922 | }; | ||
1923 | |||
1924 | static 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 */ | ||
1941 | static struct omap_hwmod omap44xx_wd_timer3_hwmod; | ||
1942 | static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = { | ||
1943 | { .irq = 36 + OMAP44XX_IRQ_GIC_START }, | ||
1944 | }; | ||
1945 | |||
1946 | static 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 */ | ||
1955 | static 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 | |||
1964 | static 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) */ | ||
1973 | static 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 */ | ||
1983 | static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = { | ||
1984 | &omap44xx_l4_abe__wd_timer3, | ||
1985 | &omap44xx_l4_abe__wd_timer3_dma, | ||
1986 | }; | ||
1987 | |||
1988 | static 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 | |||
814 | static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | 2004 | static __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 | */ | ||
48 | struct 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 */ | ||
69 | extern 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 | |||
58 | static bool is_offset_valid; | ||
59 | static u8 smps_offset; | ||
60 | |||
61 | #define REG_SMPS_OFFSET 0xE0 | ||
62 | |||
63 | unsigned long twl4030_vsel_to_uv(const u8 vsel) | ||
64 | { | ||
65 | return (((vsel * 125) + 6000)) * 100; | ||
66 | } | ||
67 | |||
68 | u8 twl4030_uv_to_vsel(unsigned long uv) | ||
69 | { | ||
70 | return DIV_ROUND_UP(uv - 600000, 12500); | ||
71 | } | ||
72 | |||
73 | unsigned 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 | |||
105 | u8 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 | |||
137 | static 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 | |||
157 | static 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 | |||
177 | static 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 | |||
197 | static 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 | |||
217 | static 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 | |||
237 | int __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 | |||
256 | int __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 */ | ||
27 | static 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 | */ | ||
37 | int __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 | |||
25 | static 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 | |||
63 | static 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 | */ | ||
91 | static 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 | } | ||
107 | device_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 | |||
26 | static 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 | */ | ||
45 | static 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 | } | ||
57 | device_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 | ||
40 | int omap2_pm_debug; | 41 | int 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 | ||
24 | static struct omap_device_pm_latency *pm_lats; | 27 | static 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 | */ |
97 | int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | 103 | int 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); | ||
135 | err: | 156 | err: |
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 | */ | ||
168 | static 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 | |||
215 | exit: | ||
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 | |||
221 | static 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 | |||
230 | static 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 | |||
139 | static int __init omap2_common_pm_init(void) | 240 | static 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 | } |
146 | device_initcall(omap2_common_pm_init); | 247 | postcore_initcall(omap2_common_pm_init); |
248 | |||
249 | static 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 | } | ||
267 | late_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 | ||
16 | extern void *omap3_secure_ram_storage; | 18 | extern void *omap3_secure_ram_storage; |
17 | extern void omap3_pm_off_mode_enable(int); | 19 | extern void omap3_pm_off_mode_enable(int); |
@@ -20,6 +22,20 @@ extern int omap3_can_sleep(void); | |||
20 | extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state); | 22 | extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state); |
21 | extern int omap3_idle_init(void); | 23 | extern int omap3_idle_init(void); |
22 | 24 | ||
25 | #if defined(CONFIG_PM_OPP) | ||
26 | extern int omap3_opp_init(void); | ||
27 | extern int omap4_opp_init(void); | ||
28 | #else | ||
29 | static inline int omap3_opp_init(void) | ||
30 | { | ||
31 | return -EINVAL; | ||
32 | } | ||
33 | static inline int omap4_opp_init(void) | ||
34 | { | ||
35 | return -EINVAL; | ||
36 | } | ||
37 | #endif | ||
38 | |||
23 | struct cpuidle_params { | 39 | struct 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) |
61 | extern void omap3_cpuidle_update_states(void); | 77 | extern 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); | |||
80 | extern void omap3_save_scratchpad_contents(void); | 96 | extern void omap3_save_scratchpad_contents(void); |
81 | 97 | ||
82 | extern unsigned int omap24xx_idle_loop_suspend_sz; | 98 | extern unsigned int omap24xx_idle_loop_suspend_sz; |
83 | extern unsigned int omap34xx_suspend_sz; | ||
84 | extern unsigned int save_secure_ram_context_sz; | 99 | extern unsigned int save_secure_ram_context_sz; |
85 | extern unsigned int omap24xx_cpu_suspend_sz; | 100 | extern unsigned int omap24xx_cpu_suspend_sz; |
86 | extern unsigned int omap34xx_cpu_suspend_sz; | 101 | extern 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) | ||
107 | extern u16 pm34xx_errata; | ||
108 | #define IS_PM34XX_ERRATUM(id) (pm34xx_errata & (id)) | ||
109 | extern void enable_omap3630_toggle_l2_on_restore(void); | ||
110 | #else | ||
111 | #define IS_PM34XX_ERRATUM(id) 0 | ||
112 | static inline void enable_omap3630_toggle_l2_on_restore(void) { } | ||
113 | #endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */ | ||
114 | |||
115 | #ifdef CONFIG_OMAP_SMARTREFLEX | ||
116 | extern int omap_devinit_smartreflex(void); | ||
117 | extern void omap_enable_smartreflex_on_init(void); | ||
118 | #else | ||
119 | static inline int omap_devinit_smartreflex(void) | ||
120 | { | ||
121 | return -EINVAL; | ||
122 | } | ||
123 | |||
124 | static inline void omap_enable_smartreflex_on_init(void) {} | ||
125 | #endif | ||
126 | |||
127 | #ifdef CONFIG_TWL4030_CORE | ||
128 | extern int omap3_twl_init(void); | ||
129 | extern int omap4_twl_init(void); | ||
130 | #else | ||
131 | static inline int omap3_twl_init(void) | ||
132 | { | ||
133 | return -EINVAL; | ||
134 | } | ||
135 | static 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 |
57 | static suspend_state_t suspend_state = PM_SUSPEND_ON; | 57 | static 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 | ||
189 | static int omap2_i2c_active(void) | 189 | static 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 | ||
302 | static int omap2_pm_begin(suspend_state_t state) | 303 | static int omap2_pm_begin(suspend_state_t state) |
303 | { | 304 | { |
304 | suspend_state = state; | ||
305 | return 0; | ||
306 | } | ||
307 | |||
308 | static 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 | ||
352 | static void omap2_pm_finish(void) | ||
353 | { | ||
354 | enable_hlt(); | ||
355 | } | ||
356 | |||
357 | static void omap2_pm_end(void) | 347 | static 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 | ||
362 | static struct platform_suspend_ops omap_pm_ops = { | 353 | static 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 | ||
360 | static 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 */ |
372 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | 364 | static 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 | ||
513 | static int __init omap2_pm_init(void) | 505 | static 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 */ | ||
72 | u16 pm34xx_errata; | ||
73 | |||
71 | struct power_state { | 74 | struct 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) | |||
124 | static void omap3_disable_io_chain(void) | 127 | static 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 | ||
131 | static void omap3_core_save_context(void) | 134 | static 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 |
532 | static int omap3_pm_prepare(void) | ||
533 | { | ||
534 | disable_hlt(); | ||
535 | return 0; | ||
536 | } | ||
537 | |||
538 | static int omap3_pm_suspend(void) | 529 | static 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 | ||
600 | static 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 */ |
606 | static int omap3_pm_begin(suspend_state_t state) | 592 | static 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 | ||
620 | static struct platform_suspend_ops omap_pm_ops = { | 608 | static 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 = { | |||
641 | static void __init omap3_iva_idle(void) | 627 | static 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 | ||
702 | static void __init prcm_setup_regs(void) | 688 | static 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 | ||
1008 | static 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 | |||
1005 | static int __init omap3_pm_init(void) | 1019 | static 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 | ||
22 | struct power_state { | 22 | struct power_state { |
@@ -31,12 +31,6 @@ struct power_state { | |||
31 | static LIST_HEAD(pwrst_list); | 31 | static LIST_HEAD(pwrst_list); |
32 | 32 | ||
33 | #ifdef CONFIG_SUSPEND | 33 | #ifdef CONFIG_SUSPEND |
34 | static int omap4_pm_prepare(void) | ||
35 | { | ||
36 | disable_hlt(); | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static int omap4_pm_suspend(void) | 34 | static 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 | ||
62 | static void omap4_pm_finish(void) | ||
63 | { | ||
64 | enable_hlt(); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | static int omap4_pm_begin(suspend_state_t state) | 56 | static int omap4_pm_begin(suspend_state_t state) |
69 | { | 57 | { |
58 | disable_hlt(); | ||
70 | return 0; | 59 | return 0; |
71 | } | 60 | } |
72 | 61 | ||
73 | static void omap4_pm_end(void) | 62 | static void omap4_pm_end(void) |
74 | { | 63 | { |
64 | enable_hlt(); | ||
75 | return; | 65 | return; |
76 | } | 66 | } |
77 | 67 | ||
78 | static struct platform_suspend_ops omap_pm_ops = { | 68 | static 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*/ | ||
51 | u32 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 | |||
71 | u32 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 | |||
91 | u32 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 */ | ||
49 | static u16 pwrstctrl_reg_offs; | ||
50 | |||
51 | /* Variable holding value of the CPU dependent PWRSTST Register Offset */ | ||
52 | static 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 */ |
81 | static LIST_HEAD(pwrdm_list); | 42 | static LIST_HEAD(pwrdm_list); |
82 | 43 | ||
44 | static struct pwrdm_ops *arch_pwrdm; | ||
45 | |||
83 | /* Private functions */ | 46 | /* Private functions */ |
84 | 47 | ||
85 | static struct powerdomain *_pwrdm_lookup(const char *name) | 48 | static 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 | */ |
221 | void pwrdm_init(struct powerdomain **pwrdm_list) | 192 | void 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 | */ |
432 | int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) | 396 | int 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 | */ |
458 | int pwrdm_read_next_pwrst(struct powerdomain *pwrdm) | 423 | int 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 | */ |
475 | int pwrdm_read_pwrst(struct powerdomain *pwrdm) | 444 | int 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 | */ |
492 | int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) | 465 | int 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 | */ |
512 | int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) | 489 | int 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 | */ |
553 | int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | 523 | int 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 | */ |
618 | int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | 561 | int 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 | */ |
676 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) | 592 | int 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 | */ |
693 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) | 613 | int 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 | */ |
716 | int pwrdm_read_logic_retst(struct powerdomain *pwrdm) | 634 | int 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 | */ |
741 | int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank) | 657 | int 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 | */ |
796 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank) | 687 | int 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 | */ |
847 | int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank) | 716 | int 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 | */ |
897 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) | 741 | int 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 | */ |
926 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) | 773 | int 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 | */ |
954 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) | 803 | int 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 | */ |
993 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm) | 844 | int 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 | */ |
1021 | int pwrdm_wait_transition(struct powerdomain *pwrdm) | 873 | int 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 | ||
1051 | int pwrdm_state_switch(struct powerdomain *pwrdm) | 886 | int 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 | */ | ||
921 | u32 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/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h new file mode 100644 index 000000000000..c66431edfeb7 --- /dev/null +++ b/arch/arm/mach-omap2/powerdomain.h | |||
@@ -0,0 +1,233 @@ | |||
1 | /* | ||
2 | * OMAP2/3/4 powerdomain control | ||
3 | * | ||
4 | * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2007-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 | * XXX This should be moved to the mach-omap2/ directory at the earliest | ||
14 | * opportunity. | ||
15 | */ | ||
16 | |||
17 | #ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H | ||
18 | #define __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | #include <linux/list.h> | ||
22 | |||
23 | #include <linux/atomic.h> | ||
24 | |||
25 | #include <plat/cpu.h> | ||
26 | |||
27 | /* Powerdomain basic power states */ | ||
28 | #define PWRDM_POWER_OFF 0x0 | ||
29 | #define PWRDM_POWER_RET 0x1 | ||
30 | #define PWRDM_POWER_INACTIVE 0x2 | ||
31 | #define PWRDM_POWER_ON 0x3 | ||
32 | |||
33 | #define PWRDM_MAX_PWRSTS 4 | ||
34 | |||
35 | /* Powerdomain allowable state bitfields */ | ||
36 | #define PWRSTS_ON (1 << PWRDM_POWER_ON) | ||
37 | #define PWRSTS_OFF (1 << PWRDM_POWER_OFF) | ||
38 | #define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \ | ||
39 | (1 << PWRDM_POWER_ON)) | ||
40 | |||
41 | #define PWRSTS_OFF_RET ((1 << PWRDM_POWER_OFF) | \ | ||
42 | (1 << PWRDM_POWER_RET)) | ||
43 | |||
44 | #define PWRSTS_RET_ON ((1 << PWRDM_POWER_RET) | \ | ||
45 | (1 << PWRDM_POWER_ON)) | ||
46 | |||
47 | #define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | (1 << PWRDM_POWER_ON)) | ||
48 | |||
49 | |||
50 | /* Powerdomain flags */ | ||
51 | #define PWRDM_HAS_HDWR_SAR (1 << 0) /* hardware save-and-restore support */ | ||
52 | #define PWRDM_HAS_MPU_QUIRK (1 << 1) /* MPU pwr domain has MEM bank 0 bits | ||
53 | * in MEM bank 1 position. This is | ||
54 | * true for OMAP3430 | ||
55 | */ | ||
56 | #define PWRDM_HAS_LOWPOWERSTATECHANGE (1 << 2) /* | ||
57 | * support to transition from a | ||
58 | * sleep state to a lower sleep | ||
59 | * state without waking up the | ||
60 | * powerdomain | ||
61 | */ | ||
62 | |||
63 | /* | ||
64 | * Number of memory banks that are power-controllable. On OMAP4430, the | ||
65 | * maximum is 5. | ||
66 | */ | ||
67 | #define PWRDM_MAX_MEM_BANKS 5 | ||
68 | |||
69 | /* | ||
70 | * Maximum number of clockdomains that can be associated with a powerdomain. | ||
71 | * CORE powerdomain on OMAP4 is the worst case | ||
72 | */ | ||
73 | #define PWRDM_MAX_CLKDMS 9 | ||
74 | |||
75 | /* XXX A completely arbitrary number. What is reasonable here? */ | ||
76 | #define PWRDM_TRANSITION_BAILOUT 100000 | ||
77 | |||
78 | struct clockdomain; | ||
79 | struct powerdomain; | ||
80 | |||
81 | /** | ||
82 | * struct powerdomain - OMAP powerdomain | ||
83 | * @name: Powerdomain name | ||
84 | * @omap_chip: represents the OMAP chip types containing this pwrdm | ||
85 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE | ||
86 | * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs | ||
87 | * @pwrsts: Possible powerdomain power states | ||
88 | * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION | ||
89 | * @flags: Powerdomain flags | ||
90 | * @banks: Number of software-controllable memory banks in this powerdomain | ||
91 | * @pwrsts_mem_ret: Possible memory bank pwrstates when pwrdm in RETENTION | ||
92 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON | ||
93 | * @pwrdm_clkdms: Clockdomains in this powerdomain | ||
94 | * @node: list_head linking all powerdomains | ||
95 | * @state: | ||
96 | * @state_counter: | ||
97 | * @timer: | ||
98 | * @state_timer: | ||
99 | * | ||
100 | * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h. | ||
101 | */ | ||
102 | struct powerdomain { | ||
103 | const char *name; | ||
104 | const struct omap_chip_id omap_chip; | ||
105 | const s16 prcm_offs; | ||
106 | const u8 pwrsts; | ||
107 | const u8 pwrsts_logic_ret; | ||
108 | const u8 flags; | ||
109 | const u8 banks; | ||
110 | const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; | ||
111 | const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; | ||
112 | const u8 prcm_partition; | ||
113 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; | ||
114 | struct list_head node; | ||
115 | int state; | ||
116 | unsigned state_counter[PWRDM_MAX_PWRSTS]; | ||
117 | unsigned ret_logic_off_counter; | ||
118 | unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS]; | ||
119 | |||
120 | #ifdef CONFIG_PM_DEBUG | ||
121 | s64 timer; | ||
122 | s64 state_timer[PWRDM_MAX_PWRSTS]; | ||
123 | #endif | ||
124 | }; | ||
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 | */ | ||
147 | struct 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 | }; | ||
167 | |||
168 | void pwrdm_fw_init(void); | ||
169 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); | ||
170 | |||
171 | struct powerdomain *pwrdm_lookup(const char *name); | ||
172 | |||
173 | int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), | ||
174 | void *user); | ||
175 | int pwrdm_for_each_nolock(int (*fn)(struct powerdomain *pwrdm, void *user), | ||
176 | void *user); | ||
177 | |||
178 | int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); | ||
179 | int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); | ||
180 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, | ||
181 | int (*fn)(struct powerdomain *pwrdm, | ||
182 | struct clockdomain *clkdm)); | ||
183 | |||
184 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); | ||
185 | |||
186 | int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst); | ||
187 | int pwrdm_read_next_pwrst(struct powerdomain *pwrdm); | ||
188 | int pwrdm_read_pwrst(struct powerdomain *pwrdm); | ||
189 | int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm); | ||
190 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm); | ||
191 | |||
192 | int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst); | ||
193 | int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); | ||
194 | int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); | ||
195 | |||
196 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm); | ||
197 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm); | ||
198 | int pwrdm_read_logic_retst(struct powerdomain *pwrdm); | ||
199 | int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank); | ||
200 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank); | ||
201 | int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank); | ||
202 | |||
203 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm); | ||
204 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm); | ||
205 | bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm); | ||
206 | |||
207 | int pwrdm_wait_transition(struct powerdomain *pwrdm); | ||
208 | |||
209 | int pwrdm_state_switch(struct powerdomain *pwrdm); | ||
210 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm); | ||
211 | int pwrdm_pre_transition(void); | ||
212 | int pwrdm_post_transition(void); | ||
213 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); | ||
214 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); | ||
215 | |||
216 | extern void omap2xxx_powerdomains_init(void); | ||
217 | extern void omap3xxx_powerdomains_init(void); | ||
218 | extern void omap44xx_powerdomains_init(void); | ||
219 | |||
220 | extern struct pwrdm_ops omap2_pwrdm_operations; | ||
221 | extern struct pwrdm_ops omap3_pwrdm_operations; | ||
222 | extern struct pwrdm_ops omap4_pwrdm_operations; | ||
223 | |||
224 | /* Common Internal functions used across OMAP rev's */ | ||
225 | extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank); | ||
226 | extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank); | ||
227 | extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank); | ||
228 | |||
229 | extern struct powerdomain wkup_omap2_pwrdm; | ||
230 | extern struct powerdomain gfx_omap2_pwrdm; | ||
231 | |||
232 | |||
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 */ | ||
29 | static 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 | |||
37 | static 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 | |||
44 | static 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 | |||
51 | static 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 | |||
64 | static 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 | |||
77 | static 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 | |||
87 | static 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 | |||
97 | static 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 | |||
108 | static 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 */ | ||
136 | static 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 | |||
143 | static 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 | |||
150 | static 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 | |||
157 | static 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 | |||
164 | static 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 | |||
182 | static 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 | |||
192 | static 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 | |||
198 | static 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 | |||
205 | static 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 | |||
212 | struct 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 | |||
224 | struct 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 | |||
26 | static 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 | |||
35 | static 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 | |||
47 | static 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 | |||
59 | static 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 | |||
71 | static 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 | |||
80 | static 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 | |||
89 | static 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 | |||
101 | static 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 | |||
115 | static 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 | |||
129 | static 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 | |||
141 | static 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 | |||
153 | static 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 | |||
167 | static 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 | |||
181 | static 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 | |||
210 | struct 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 | */ |
69 | static struct powerdomain gfx_omap2_pwrdm = { | 59 | struct 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 | ||
85 | static struct powerdomain wkup_omap2_pwrdm = { | 75 | struct 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 */ | ||
95 | static 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 | |||
19 | extern struct powerdomain gfx_omap2_pwrdm; | ||
20 | extern 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 | ||
37 | static struct powerdomain dsp_pwrdm = { | 28 | static 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 */ | ||
103 | static 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 | |||
120 | void __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 | */ |
84 | static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { | 83 | static 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 */ | ||
259 | static 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 | 284 | void __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 */ |
36 | static struct powerdomain core_44xx_pwrdm = { | 34 | static 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 */ |
61 | static struct powerdomain gfx_44xx_pwrdm = { | 60 | static 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 */ |
77 | static struct powerdomain abe_44xx_pwrdm = { | 77 | static 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 */ |
96 | static struct powerdomain dss_44xx_pwrdm = { | 97 | static 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 */ |
113 | static struct powerdomain tesla_44xx_pwrdm = { | 115 | static 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 */ |
134 | static struct powerdomain wkup_44xx_pwrdm = { | 137 | static 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 */ |
149 | static struct powerdomain cpu0_44xx_pwrdm = { | 153 | static 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 */ |
165 | static struct powerdomain cpu1_44xx_pwrdm = { | 170 | static 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 */ |
181 | static struct powerdomain emu_44xx_pwrdm = { | 187 | static 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 */ |
196 | static struct powerdomain mpu_44xx_pwrdm = { | 203 | static 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 */ |
216 | static struct powerdomain ivahd_44xx_pwrdm = { | 224 | static 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 */ |
239 | static struct powerdomain cam_44xx_pwrdm = { | 248 | static 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 */ |
255 | static struct powerdomain l3init_44xx_pwrdm = { | 265 | static 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 */ |
272 | static struct powerdomain l4per_44xx_pwrdm = { | 283 | static 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 | */ |
294 | static struct powerdomain always_on_core_44xx_pwrdm = { | 306 | static 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 */ |
302 | static struct powerdomain cefuse_44xx_pwrdm = { | 315 | static 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 */ |
332 | static 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 | 352 | void __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__ | ||
400 | extern void __iomem *prm_base; | ||
401 | extern void __iomem *cm_base; | ||
402 | extern 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 | ||
38 | static void __iomem *prm_base; | 41 | void __iomem *prm_base; |
39 | static void __iomem *cm_base; | 42 | void __iomem *cm_base; |
40 | static void __iomem *cm2_base; | 43 | void __iomem *cm2_base; |
41 | 44 | ||
42 | #define MAX_MODULE_ENABLE_WAIT 100000 | 45 | #define MAX_MODULE_ENABLE_WAIT 100000 |
43 | 46 | ||
44 | struct 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 | |||
122 | static struct omap3_prcm_regs prcm_context; | ||
123 | |||
124 | u32 omap_prcm_get_reset_sources(void) | 47 | u32 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 | |
169 | static 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 | |
175 | static 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 |
183 | u32 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 | |
189 | void 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 */ | ||
195 | u32 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 */ | ||
208 | u32 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 */ | ||
220 | u32 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 */ | ||
232 | u32 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 */ | ||
244 | u32 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 */ | ||
250 | void 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 */ | ||
256 | u32 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 | */ |
278 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, | 124 | int 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 | ||
321 | void 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 | |||
475 | void 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 | |||
25 | u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg) | ||
26 | { | ||
27 | return __raw_readl(OMAP44XX_PRCM_MPU_REGADDR(inst, reg)); | ||
28 | } | ||
29 | |||
30 | void 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 | |||
35 | u32 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__ | ||
98 | extern u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 idx); | ||
99 | extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx); | ||
100 | extern 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 */ | ||
234 | extern u32 prm_read_mod_reg(s16 module, u16 idx); | ||
235 | extern void prm_write_mod_reg(u32 val, s16 module, u16 idx); | ||
236 | extern 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) */ | ||
239 | static 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 | |||
244 | static 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 */ | ||
250 | int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); | ||
251 | int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); | ||
252 | int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift); | ||
253 | |||
254 | int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift); | ||
255 | int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift); | ||
256 | int 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 | ||
28 | u32 omap2_prm_read_mod_reg(s16 module, u16 idx) | ||
29 | { | ||
30 | return __raw_readl(prm_base + module + idx); | ||
31 | } | ||
32 | |||
33 | void 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 */ | ||
39 | u32 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 */ | ||
52 | u32 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 | |||
63 | u32 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 | |||
68 | u32 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 */ | ||
233 | extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx); | ||
234 | extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx); | ||
235 | extern u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx); | ||
236 | extern u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx); | ||
237 | extern u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx); | ||
238 | extern 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 */ | ||
241 | extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); | ||
242 | extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); | ||
243 | extern 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 */ | ||
36 | u32 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 */ | ||
42 | void 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 */ | ||
48 | u32 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 */ | ||
62 | u32 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 */ | ||
75 | u32 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 | |||
87 | u32 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 | |||
92 | u32 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 | ||
182 | void 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) | 762 | extern 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 | 763 | extern 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 | 764 | extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); |
708 | * MOD inside the PRCM | 765 | extern u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg); |
709 | */ | 766 | extern u32 omap4_prm_set_inst_reg_bits(u32 bits, s16 inst, s16 idx); |
767 | extern u32 omap4_prm_clear_inst_reg_bits(u32 bits, s16 inst, s16 idx); | ||
768 | extern u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask); | ||
769 | |||
770 | extern int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift); | ||
771 | extern int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift); | ||
772 | extern int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift); | ||
773 | |||
774 | extern 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 | |||
26 | static 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 */ | ||
36 | u32 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 */ | ||
46 | void 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 */ | ||
55 | u32 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 | */ | ||
18 | extern u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx); | ||
19 | extern void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx); | ||
20 | extern u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, | ||
21 | s16 inst, s16 idx); | ||
22 | |||
23 | extern 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) */ |
27 | struct sdram_timings { | 28 | struct sdram_timings { |
@@ -43,9 +44,28 @@ struct sdram_timings { | |||
43 | u32 tWTR; | 44 | u32 tWTR; |
44 | }; | 45 | }; |
45 | 46 | ||
46 | static struct omap_sdrc_params rx51_sdrc_params[4]; | 47 | static 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 | ||
48 | static const struct sdram_timings rx51_timings[] = { | 68 | static 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 | ||
89 | static 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 | |||
110 | static 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 | }; | ||
119 | static struct omap_sdrc_params nokia_sdrc_params[ARRAY_SIZE(nokia_timings) + 1]; | ||
120 | |||
69 | static unsigned long sdrc_get_fclk_period(long rate) | 121 | static 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 | ||
162 | static int sdrc_timings(int id, long rate) | 214 | static 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 | ||
211 | struct omap_sdrc_params *rx51_get_sdram_timings(void) | 264 | struct 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 | |||
11 | struct 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 { | |||
106 | static LIST_HEAD(uart_list); | 107 | static LIST_HEAD(uart_list); |
107 | static u8 num_uarts; | 108 | static 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 | */ | ||
114 | static int uart_idle_hwmod(struct omap_device *od) | 110 | static 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 | ||
121 | static int uart_enable_hwmod(struct omap_device *od) | 117 | static 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 | ||
170 | static inline void __init omap_uart_reset(struct omap_uart_state *uart) | 166 | static 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 |
278 | static inline void omap_uart_save_context(struct omap_uart_state *uart) {} | 277 | static 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 | */ |
707 | void __init omap_serial_init_port(int port) | 707 | void __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) | |||
857 | void __init omap_serial_init(void) | 861 | void __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 | /* |
64 | ENTRY(lock_scratchpad_sem) | 69 | * API functions |
65 | stmfd sp!, {lr} @ save registers on stack | 70 | */ |
66 | wait_sem: | 71 | |
67 | mov r0,#1 | 72 | /* |
68 | ldr r1, sdrc_scratchpad_sem | 73 | * The "get_*restore_pointer" functions are used to provide a |
69 | wait_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 | ||
77 | sdrc_scratchpad_sem: | ||
78 | .word SDRC_SCRATCHPAD_SEM_V | ||
79 | ENTRY(lock_scratchpad_sem_sz) | ||
80 | .word . - lock_scratchpad_sem | ||
81 | |||
82 | .text | ||
83 | /* Function to release the scratchpad semaphore */ | ||
84 | ENTRY(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 | ||
90 | ENTRY(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 */ |
95 | ENTRY(get_restore_pointer) | 81 | ENTRY(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 |
99 | ENTRY(get_restore_pointer_sz) | 85 | ENTRY(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 */ |
90 | ENTRY(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 | ||
94 | ENTRY(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 */ | ||
104 | ENTRY(get_es3_restore_pointer) | 99 | ENTRY(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) | |||
108 | ENTRY(get_es3_restore_pointer_sz) | 103 | ENTRY(get_es3_restore_pointer_sz) |
109 | .word . - get_es3_restore_pointer | 104 | .word . - get_es3_restore_pointer |
110 | 105 | ||
111 | ENTRY(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 | 112 | ENTRY(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 | ||
137 | sdrc_syscfg: | ||
138 | .word SDRC_SYSCONFIG_P | ||
139 | sdrc_mr_0: | ||
140 | .word SDRC_MR_0_P | ||
141 | sdrc_emr2_0: | ||
142 | .word SDRC_EMR2_0_P | ||
143 | sdrc_manual_0: | ||
144 | .word SDRC_MANUAL_0_P | ||
145 | sdrc_mr_1: | ||
146 | .word SDRC_MR_1_P | ||
147 | sdrc_emr2_1: | ||
148 | .word SDRC_EMR2_1_P | ||
149 | sdrc_manual_1: | ||
150 | .word SDRC_MANUAL_1_P | ||
151 | ENTRY(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 */ |
155 | ENTRY(save_secure_ram_context) | 121 | ENTRY(save_secure_ram_context) |
156 | stmfd sp!, {r1-r12, lr} @ save registers on stack | 122 | stmfd sp!, {r1-r12, lr} @ save registers on stack |
157 | save_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 | */ |
196 | ENTRY(omap34xx_cpu_suspend) | 172 | ENTRY(omap34xx_cpu_suspend) |
197 | stmfd sp!, {r0-r12, lr} @ save registers on stack | 173 | stmfd sp!, {r0-r12, lr} @ save registers on stack |
198 | loop: | ||
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 */ | ||
189 | save_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 | |||
201 | l1_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 | |||
264 | clean_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 | |||
273 | clean_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 | |||
285 | omap3_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 | */ | ||
230 | restore_es3: | 343 | restore_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 | |||
362 | restore_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 | |||
248 | restore: | 375 | restore: |
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 | ||
397 | skipl2dis: | ||
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 | |||
303 | l2_inv_api_params: | 441 | l2_inv_api_params: |
304 | .word 0x1, 0x00 | 442 | .word 0x1, 0x00 |
305 | l2_inv_gp: | 443 | l2_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 |
308 | smi: .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) |
320 | logic_l1_restore: | 458 | logic_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 | ||
465 | skipl2reen: | ||
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 |
398 | ttbr_error: | 545 | ttbr_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 |
403 | usettbr0: | 551 | usettbr0: |
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 | /* |
442 | save_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 */ | ||
460 | l1_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 | */ |
516 | clean_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 | ||
522 | clean_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 | ||
533 | loop1: | ||
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 | ||
562 | loop2: | ||
563 | mov r9, r4 | ||
564 | /* create working copy of max way size*/ | ||
565 | loop3: | ||
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 | ||
578 | skip: | ||
579 | add r10, r10, #2 | ||
580 | /* increment cache number */ | ||
581 | cmp r3, r10 | ||
582 | bgt loop1 | ||
583 | finished: | ||
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 | ||
589 | skip_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 | 610 | ENTRY(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 | |||
637 | sdrc_syscfg: | ||
638 | .word SDRC_SYSCONFIG_P | ||
639 | sdrc_mr_0: | ||
640 | .word SDRC_MR_0_P | ||
641 | sdrc_emr2_0: | ||
642 | .word SDRC_EMR2_0_P | ||
643 | sdrc_manual_0: | ||
644 | .word SDRC_MANUAL_0_P | ||
645 | sdrc_mr_1: | ||
646 | .word SDRC_MR_1_P | ||
647 | sdrc_emr2_1: | ||
648 | .word SDRC_EMR2_1_P | ||
649 | sdrc_manual_1: | ||
650 | .word SDRC_MANUAL_1_P | ||
651 | ENTRY(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 */ |
611 | wait_sdrc_ok: | 665 | wait_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 | 669 | wait_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 |
675 | wait_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 | |||
685 | is_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 */ | ||
692 | wait_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 | ||
621 | wait_dll_lock: | 699 | wait_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 | 709 | kick_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 | ||
635 | cm_idlest1_core: | 724 | cm_idlest1_core: |
636 | .word CM_IDLEST1_CORE_V | 725 | .word CM_IDLEST1_CORE_V |
726 | cm_idlest_ckgen: | ||
727 | .word CM_IDLEST_CKGEN_V | ||
637 | sdrc_dlla_status: | 728 | sdrc_dlla_status: |
638 | .word SDRC_DLLA_STATUS_V | 729 | .word SDRC_DLLA_STATUS_V |
639 | sdrc_dlla_ctrl: | 730 | sdrc_dlla_ctrl: |
640 | .word SDRC_DLLA_CTRL_V | 731 | .word SDRC_DLLA_CTRL_V |
641 | pm_prepwstst_core: | ||
642 | .word PM_PREPWSTST_CORE_V | ||
643 | pm_prepwstst_core_p: | 732 | pm_prepwstst_core_p: |
644 | .word PM_PREPWSTST_CORE_P | 733 | .word PM_PREPWSTST_CORE_P |
645 | pm_prepwstst_mpu: | ||
646 | .word PM_PREPWSTST_MPU_V | ||
647 | pm_pwstctrl_mpu: | 734 | pm_pwstctrl_mpu: |
648 | .word PM_PWSTCTRL_MPU_P | 735 | .word PM_PWSTCTRL_MPU_P |
649 | scratchpad_base: | 736 | scratchpad_base: |
@@ -651,13 +738,7 @@ scratchpad_base: | |||
651 | sram_base: | 738 | sram_base: |
652 | .word SRAM_BASE_P + 0x8000 | 739 | .word SRAM_BASE_P + 0x8000 |
653 | sdrc_power: | 740 | sdrc_power: |
654 | .word SDRC_POWER_V | 741 | .word SDRC_POWER_V |
655 | clk_stabilize_delay: | ||
656 | .word 0x000001FF | ||
657 | assoc_mask: | ||
658 | .word 0x3ff | ||
659 | numset_mask: | ||
660 | .word 0x7fff | ||
661 | ttbrbit_mask: | 742 | ttbrbit_mask: |
662 | .word 0xFFFFC000 | 743 | .word 0xFFFFC000 |
663 | table_index_mask: | 744 | table_index_mask: |
@@ -668,5 +749,20 @@ cache_pred_disable_mask: | |||
668 | .word 0xFFFFE7FB | 749 | .word 0xFFFFE7FB |
669 | control_stat: | 750 | control_stat: |
670 | .word CONTROL_STAT | 751 | .word CONTROL_STAT |
752 | control_mem_rta: | ||
753 | .word CONTROL_MEM_RTA_CTRL | ||
754 | kernel_flush: | ||
755 | .word v7_flush_dcache_all | ||
756 | l2dis_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 | */ | ||
762 | kick_counter: | ||
763 | .word 0 | ||
764 | wait_dll_lock_counter: | ||
765 | .word 0 | ||
766 | |||
671 | ENTRY(omap34xx_cpu_suspend_sz) | 767 | ENTRY(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 | |||
16 | static 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 | |||
30 | static 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 | |||
40 | static int sr_class3_configure(struct voltagedomain *voltdm) | ||
41 | { | ||
42 | return sr_configure_errgen(voltdm); | ||
43 | } | ||
44 | |||
45 | /* SR class3 structure */ | ||
46 | static 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 */ | ||
54 | static int __init sr_class3_init(void) | ||
55 | { | ||
56 | pr_info("SmartReflex Class3 initialized\n"); | ||
57 | return sr_register_class(&class3_data); | ||
58 | } | ||
59 | late_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 | |||
37 | struct 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 */ | ||
60 | static LIST_HEAD(sr_list); | ||
61 | |||
62 | static struct omap_sr_class_data *sr_class; | ||
63 | static struct omap_sr_pmic_data *sr_pmic_data; | ||
64 | |||
65 | static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) | ||
66 | { | ||
67 | __raw_writel(value, (sr->base + offset)); | ||
68 | } | ||
69 | |||
70 | static 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 | |||
104 | static inline u32 sr_read_reg(struct omap_sr *sr, unsigned offset) | ||
105 | { | ||
106 | return __raw_readl(sr->base + offset); | ||
107 | } | ||
108 | |||
109 | static 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 | |||
126 | static 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 | |||
151 | static 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 | |||
192 | static 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 | |||
214 | static 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 | |||
227 | static 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 | */ | ||
253 | static 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 | |||
277 | error: | ||
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 | |||
289 | static 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 | |||
325 | static 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 | |||
362 | static 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 | */ | ||
394 | int 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 | */ | ||
463 | int 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 | */ | ||
539 | int 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 | */ | ||
596 | void 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 | */ | ||
632 | int 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 | */ | ||
670 | void 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 | */ | ||
703 | void 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 | */ | ||
736 | void 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 | */ | ||
766 | void 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. */ | ||
778 | static 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 | |||
793 | static 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 | |||
817 | DEFINE_SIMPLE_ATTRIBUTE(pm_sr_fops, omap_sr_autocomp_show, | ||
818 | omap_sr_autocomp_store, "%llu\n"); | ||
819 | |||
820 | static 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 | |||
949 | err_release_region: | ||
950 | release_mem_region(mem->start, resource_size(mem)); | ||
951 | err_free_devinfo: | ||
952 | kfree(sr_info); | ||
953 | |||
954 | return ret; | ||
955 | } | ||
956 | |||
957 | static 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 | |||
987 | static struct platform_driver smartreflex_driver = { | ||
988 | .remove = omap_sr_remove, | ||
989 | .driver = { | ||
990 | .name = "smartreflex", | ||
991 | }, | ||
992 | }; | ||
993 | |||
994 | static 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 | |||
1019 | static void __exit sr_exit(void) | ||
1020 | { | ||
1021 | platform_driver_unregister(&smartreflex_driver); | ||
1022 | } | ||
1023 | late_initcall(sr_init); | ||
1024 | module_exit(sr_exit); | ||
1025 | |||
1026 | MODULE_DESCRIPTION("OMAP Smartreflex Driver"); | ||
1027 | MODULE_LICENSE("GPL"); | ||
1028 | MODULE_ALIAS("platform:" DRIVER_NAME); | ||
1029 | MODULE_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 | |||
31 | static bool sr_enable_on_init; | ||
32 | |||
33 | static 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 */ | ||
42 | static 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 | |||
79 | static 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); | ||
128 | exit: | ||
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 | */ | ||
138 | void __init omap_enable_smartreflex_on_init(void) | ||
139 | { | ||
140 | sr_enable_on_init = true; | ||
141 | } | ||
142 | |||
143 | int __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 | */ |
108 | ENTRY(omap3_sram_configure_core_dpll) | 114 | ENTRY(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 = { | |||
202 | static void __init omap2_gp_clocksource_init(void) | 202 | static 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 */ | ||
43 | struct 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 */ | ||
53 | struct 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 */ | ||
89 | struct 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 | */ | ||
141 | struct 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 | |||
159 | static struct omap_vdd_info *vdd_info; | ||
160 | /* | ||
161 | * Number of scalable voltage domains. | ||
162 | */ | ||
163 | static int nr_scalable_vdd; | ||
164 | |||
165 | /* OMAP3 VDD sturctures */ | ||
166 | static 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 */ | ||
198 | static 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 */ | ||
255 | static 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 | |||
264 | static 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 */ | ||
273 | static 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 | |||
280 | static 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 | */ | ||
290 | static 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 | |||
298 | static 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 | |||
305 | static 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 | |||
311 | static struct dentry *voltage_dir; | ||
312 | |||
313 | /* Init function pointers */ | ||
314 | static void (*vc_init) (struct omap_vdd_info *vdd); | ||
315 | static int (*vdd_data_configure) (struct omap_vdd_info *vdd); | ||
316 | |||
317 | static u32 omap3_voltage_read_reg(u16 mod, u8 offset) | ||
318 | { | ||
319 | return omap2_prm_read_mod_reg(mod, offset); | ||
320 | } | ||
321 | |||
322 | static void omap3_voltage_write_reg(u32 val, u16 mod, u8 offset) | ||
323 | { | ||
324 | omap2_prm_write_mod_reg(val, mod, offset); | ||
325 | } | ||
326 | |||
327 | static 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 | |||
333 | static 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 */ | ||
339 | static 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 | |||
362 | static 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 | |||
376 | DEFINE_SIMPLE_ATTRIBUTE(vp_volt_debug_fops, vp_volt_debug_get, NULL, "%llu\n"); | ||
377 | DEFINE_SIMPLE_ATTRIBUTE(nom_volt_debug_fops, nom_volt_debug_get, NULL, | ||
378 | "%llu\n"); | ||
379 | static 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 */ | ||
419 | static 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 | |||
459 | static 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 */ | ||
507 | static 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 | |||
566 | static 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 */ | ||
581 | static 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, ¤t_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 */ | ||
634 | static 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, ¤t_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 | */ | ||
736 | static 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 */ | ||
803 | static 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 */ | ||
930 | static 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 */ | ||
981 | static 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 | */ | ||
1126 | unsigned 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 | */ | ||
1146 | unsigned 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 | */ | ||
1182 | void 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 | */ | ||
1222 | void 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 | */ | ||
1279 | int 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 | */ | ||
1309 | void 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 | */ | ||
1340 | void 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 | */ | ||
1370 | struct 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 | */ | ||
1409 | int 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 | */ | ||
1437 | struct 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 | */ | ||
1461 | void 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 | */ | ||
1495 | struct 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 | */ | ||
1525 | int __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 | */ | ||
1553 | static 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 | } | ||
1571 | core_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 | |||
27 | int 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 | |||
15 | extern int omap2_wd_timer_disable(struct omap_hwmod *oh); | ||
16 | |||
17 | #endif | ||