diff options
Diffstat (limited to 'arch/arm/mach-omap2')
140 files changed, 16234 insertions, 4111 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index b69fa0a0299e..eeab35dea07e 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -54,25 +54,30 @@ config ARCH_OMAP4 | |||
54 | comment "OMAP Core Type" | 54 | comment "OMAP Core Type" |
55 | depends on ARCH_OMAP2 | 55 | depends on ARCH_OMAP2 |
56 | 56 | ||
57 | config ARCH_OMAP2420 | 57 | config SOC_OMAP2420 |
58 | bool "OMAP2420 support" | 58 | bool "OMAP2420 support" |
59 | depends on ARCH_OMAP2 | 59 | depends on ARCH_OMAP2 |
60 | default y | 60 | default y |
61 | select OMAP_DM_TIMER | 61 | select OMAP_DM_TIMER |
62 | select ARCH_OMAP_OTG | 62 | select ARCH_OMAP_OTG |
63 | 63 | ||
64 | config ARCH_OMAP2430 | 64 | config SOC_OMAP2430 |
65 | bool "OMAP2430 support" | 65 | bool "OMAP2430 support" |
66 | depends on ARCH_OMAP2 | 66 | depends on ARCH_OMAP2 |
67 | default y | 67 | default y |
68 | select ARCH_OMAP_OTG | 68 | select ARCH_OMAP_OTG |
69 | 69 | ||
70 | config ARCH_OMAP3430 | 70 | config SOC_OMAP3430 |
71 | bool "OMAP3430 support" | 71 | bool "OMAP3430 support" |
72 | depends on ARCH_OMAP3 | 72 | depends on ARCH_OMAP3 |
73 | default y | 73 | default y |
74 | select ARCH_OMAP_OTG | 74 | select ARCH_OMAP_OTG |
75 | 75 | ||
76 | config SOC_OMAPTI816X | ||
77 | bool "TI816X support" | ||
78 | depends on ARCH_OMAP3 | ||
79 | default y | ||
80 | |||
76 | config OMAP_PACKAGE_ZAF | 81 | config OMAP_PACKAGE_ZAF |
77 | bool | 82 | bool |
78 | 83 | ||
@@ -107,25 +112,25 @@ config MACH_OMAP_GENERIC | |||
107 | 112 | ||
108 | config MACH_OMAP2_TUSB6010 | 113 | config MACH_OMAP2_TUSB6010 |
109 | bool | 114 | bool |
110 | depends on ARCH_OMAP2 && ARCH_OMAP2420 | 115 | depends on ARCH_OMAP2 && SOC_OMAP2420 |
111 | default y if MACH_NOKIA_N8X0 | 116 | default y if MACH_NOKIA_N8X0 |
112 | 117 | ||
113 | config MACH_OMAP_H4 | 118 | config MACH_OMAP_H4 |
114 | bool "OMAP 2420 H4 board" | 119 | bool "OMAP 2420 H4 board" |
115 | depends on ARCH_OMAP2420 | 120 | depends on SOC_OMAP2420 |
116 | default y | 121 | default y |
117 | select OMAP_PACKAGE_ZAF | 122 | select OMAP_PACKAGE_ZAF |
118 | select OMAP_DEBUG_DEVICES | 123 | select OMAP_DEBUG_DEVICES |
119 | 124 | ||
120 | config MACH_OMAP_APOLLON | 125 | config MACH_OMAP_APOLLON |
121 | bool "OMAP 2420 Apollon board" | 126 | bool "OMAP 2420 Apollon board" |
122 | depends on ARCH_OMAP2420 | 127 | depends on SOC_OMAP2420 |
123 | default y | 128 | default y |
124 | select OMAP_PACKAGE_ZAC | 129 | select OMAP_PACKAGE_ZAC |
125 | 130 | ||
126 | config MACH_OMAP_2430SDP | 131 | config MACH_OMAP_2430SDP |
127 | bool "OMAP 2430 SDP board" | 132 | bool "OMAP 2430 SDP board" |
128 | depends on ARCH_OMAP2430 | 133 | depends on SOC_OMAP2430 |
129 | default y | 134 | default y |
130 | select OMAP_PACKAGE_ZAC | 135 | select OMAP_PACKAGE_ZAC |
131 | 136 | ||
@@ -220,7 +225,7 @@ config MACH_NOKIA_N810_WIMAX | |||
220 | 225 | ||
221 | config MACH_NOKIA_N8X0 | 226 | config MACH_NOKIA_N8X0 |
222 | bool "Nokia N800/N810" | 227 | bool "Nokia N800/N810" |
223 | depends on ARCH_OMAP2420 | 228 | depends on SOC_OMAP2420 |
224 | default y | 229 | default y |
225 | select OMAP_PACKAGE_ZAC | 230 | select OMAP_PACKAGE_ZAC |
226 | select MACH_NOKIA_N800 | 231 | select MACH_NOKIA_N800 |
@@ -295,12 +300,18 @@ config MACH_OMAP_3630SDP | |||
295 | default y | 300 | default y |
296 | select OMAP_PACKAGE_CBP | 301 | select OMAP_PACKAGE_CBP |
297 | 302 | ||
303 | config MACH_TI8168EVM | ||
304 | bool "TI8168 Evaluation Module" | ||
305 | depends on SOC_OMAPTI816X | ||
306 | default y | ||
307 | |||
298 | config MACH_OMAP_4430SDP | 308 | config MACH_OMAP_4430SDP |
299 | bool "OMAP 4430 SDP board" | 309 | bool "OMAP 4430 SDP board" |
300 | default y | 310 | default y |
301 | depends on ARCH_OMAP4 | 311 | depends on ARCH_OMAP4 |
302 | select OMAP_PACKAGE_CBL | 312 | select OMAP_PACKAGE_CBL |
303 | select OMAP_PACKAGE_CBS | 313 | select OMAP_PACKAGE_CBS |
314 | select REGULATOR_FIXED_VOLTAGE | ||
304 | 315 | ||
305 | config MACH_OMAP4_PANDA | 316 | config MACH_OMAP4_PANDA |
306 | bool "OMAP4 Panda Board" | 317 | bool "OMAP4 Panda Board" |
@@ -308,6 +319,7 @@ config MACH_OMAP4_PANDA | |||
308 | depends on ARCH_OMAP4 | 319 | depends on ARCH_OMAP4 |
309 | select OMAP_PACKAGE_CBL | 320 | select OMAP_PACKAGE_CBL |
310 | select OMAP_PACKAGE_CBS | 321 | select OMAP_PACKAGE_CBS |
322 | select REGULATOR_FIXED_VOLTAGE | ||
311 | 323 | ||
312 | config OMAP3_EMU | 324 | config OMAP3_EMU |
313 | bool "OMAP3 debugging peripherals" | 325 | bool "OMAP3 debugging peripherals" |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 64dc4176407b..a45cd6409686 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -31,8 +31,8 @@ AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) | |||
31 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec) | 31 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec) |
32 | 32 | ||
33 | # Functions loaded to SRAM | 33 | # Functions loaded to SRAM |
34 | obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o | 34 | obj-$(CONFIG_SOC_OMAP2420) += sram242x.o |
35 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o | 35 | obj-$(CONFIG_SOC_OMAP2430) += sram243x.o |
36 | obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o | 36 | obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o |
37 | 37 | ||
38 | AFLAGS_sram242x.o :=-Wa,-march=armv6 | 38 | AFLAGS_sram242x.o :=-Wa,-march=armv6 |
@@ -40,8 +40,8 @@ AFLAGS_sram243x.o :=-Wa,-march=armv6 | |||
40 | AFLAGS_sram34xx.o :=-Wa,-march=armv7-a | 40 | AFLAGS_sram34xx.o :=-Wa,-march=armv7-a |
41 | 41 | ||
42 | # Pin multiplexing | 42 | # Pin multiplexing |
43 | obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o | 43 | obj-$(CONFIG_SOC_OMAP2420) += mux2420.o |
44 | obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o | 44 | obj-$(CONFIG_SOC_OMAP2430) += mux2430.o |
45 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o | 45 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o |
46 | obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o | 46 | obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o |
47 | 47 | ||
@@ -59,10 +59,10 @@ endif | |||
59 | # Power Management | 59 | # Power Management |
60 | ifeq ($(CONFIG_PM),y) | 60 | ifeq ($(CONFIG_PM),y) |
61 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o | 61 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o |
62 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o voltage.o | 62 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o |
63 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ | 63 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o \ |
64 | cpuidle34xx.o pm_bus.o | 64 | cpuidle34xx.o pm_bus.o |
65 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o | 65 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o |
66 | 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 | 67 | obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o |
68 | obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o | 68 | obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o |
@@ -78,13 +78,25 @@ endif | |||
78 | 78 | ||
79 | # PRCM | 79 | # PRCM |
80 | obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o | 80 | obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o |
81 | obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o | 81 | obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \ |
82 | vc3xxx_data.o vp3xxx_data.o | ||
82 | # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and | 83 | # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and |
83 | # will be removed once the OMAP4 part of the codebase is converted to | 84 | # will be removed once the OMAP4 part of the codebase is converted to |
84 | # use OMAP4-specific PRCM functions. | 85 | # use OMAP4-specific PRCM functions. |
85 | obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ | 86 | obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ |
86 | cm44xx.o prcm_mpu44xx.o \ | 87 | cm44xx.o prcm_mpu44xx.o \ |
87 | prminst44xx.o | 88 | prminst44xx.o vc44xx_data.o \ |
89 | vp44xx_data.o | ||
90 | |||
91 | # OMAP voltage domains | ||
92 | ifeq ($(CONFIG_PM),y) | ||
93 | voltagedomain-common := voltage.o | ||
94 | obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) | ||
95 | obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \ | ||
96 | voltagedomains3xxx_data.o | ||
97 | obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) \ | ||
98 | voltagedomains44xx_data.o | ||
99 | endif | ||
88 | 100 | ||
89 | # OMAP powerdomain framework | 101 | # OMAP powerdomain framework |
90 | powerdomain-common += powerdomain.o powerdomain-common.o | 102 | powerdomain-common += powerdomain.o powerdomain-common.o |
@@ -102,39 +114,49 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \ | |||
102 | 114 | ||
103 | # PRCM clockdomain control | 115 | # PRCM clockdomain control |
104 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ | 116 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ |
117 | clockdomain2xxx_3xxx.o \ | ||
105 | clockdomains2xxx_3xxx_data.o | 118 | clockdomains2xxx_3xxx_data.o |
106 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ | 119 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ |
120 | clockdomain2xxx_3xxx.o \ | ||
107 | clockdomains2xxx_3xxx_data.o | 121 | clockdomains2xxx_3xxx_data.o |
108 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ | 122 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ |
123 | clockdomain44xx.o \ | ||
109 | clockdomains44xx_data.o | 124 | clockdomains44xx_data.o |
125 | |||
110 | # Clock framework | 126 | # Clock framework |
111 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ | 127 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ |
112 | clkt2xxx_sys.o \ | 128 | clkt2xxx_sys.o \ |
113 | clkt2xxx_dpllcore.o \ | 129 | clkt2xxx_dpllcore.o \ |
114 | clkt2xxx_virt_prcm_set.o \ | 130 | clkt2xxx_virt_prcm_set.o \ |
115 | clkt2xxx_apll.o clkt2xxx_osc.o | 131 | clkt2xxx_apll.o clkt2xxx_osc.o \ |
116 | obj-$(CONFIG_ARCH_OMAP2420) += clock2420_data.o | 132 | clkt2xxx_dpll.o clkt_iclk.o |
117 | obj-$(CONFIG_ARCH_OMAP2430) += clock2430.o clock2430_data.o | 133 | obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o |
134 | obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o | ||
118 | obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ | 135 | obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ |
119 | clock34xx.o clkt34xx_dpll3m2.o \ | 136 | clock34xx.o clkt34xx_dpll3m2.o \ |
120 | clock3517.o clock36xx.o \ | 137 | clock3517.o clock36xx.o \ |
121 | dpll3xxx.o clock3xxx_data.o | 138 | dpll3xxx.o clock3xxx_data.o \ |
139 | clkt_iclk.o | ||
122 | obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ | 140 | obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ |
123 | dpll3xxx.o | 141 | dpll3xxx.o dpll44xx.o |
124 | 142 | ||
125 | # OMAP2 clock rate set data (old "OPP" data) | 143 | # OMAP2 clock rate set data (old "OPP" data) |
126 | obj-$(CONFIG_ARCH_OMAP2420) += opp2420_data.o | 144 | obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o |
127 | obj-$(CONFIG_ARCH_OMAP2430) += opp2430_data.o | 145 | obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o |
128 | 146 | ||
129 | # hwmod data | 147 | # hwmod data |
130 | obj-$(CONFIG_ARCH_OMAP2420) += omap_hwmod_2420_data.o | 148 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o |
131 | obj-$(CONFIG_ARCH_OMAP2430) += omap_hwmod_2430_data.o | 149 | obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o |
132 | obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o | 150 | obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o |
133 | obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o | 151 | obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o |
134 | 152 | ||
135 | # EMU peripherals | 153 | # EMU peripherals |
136 | obj-$(CONFIG_OMAP3_EMU) += emu.o | 154 | obj-$(CONFIG_OMAP3_EMU) += emu.o |
137 | 155 | ||
156 | # L3 interconnect | ||
157 | obj-$(CONFIG_ARCH_OMAP3) += omap_l3_smx.o | ||
158 | obj-$(CONFIG_ARCH_OMAP4) += omap_l3_noc.o | ||
159 | |||
138 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o | 160 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o |
139 | mailbox_mach-objs := mailbox.o | 161 | mailbox_mach-objs := mailbox.o |
140 | 162 | ||
@@ -218,12 +240,14 @@ obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ | |||
218 | hsmmc.o \ | 240 | hsmmc.o \ |
219 | omap_phy_internal.o | 241 | omap_phy_internal.o |
220 | 242 | ||
221 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o | 243 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \ |
244 | omap_phy_internal.o \ | ||
222 | 245 | ||
223 | obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o | 246 | obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o |
224 | 247 | ||
225 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ | 248 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ |
226 | hsmmc.o | 249 | hsmmc.o |
250 | obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o | ||
227 | # Platform specific device init code | 251 | # Platform specific device init code |
228 | usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o | 252 | usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o |
229 | obj-y += $(usbfs-m) $(usbfs-y) | 253 | obj-y += $(usbfs-m) $(usbfs-y) |
@@ -242,3 +266,7 @@ obj-y += $(smc91x-m) $(smc91x-y) | |||
242 | 266 | ||
243 | smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o | 267 | smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o |
244 | obj-y += $(smsc911x-m) $(smsc911x-y) | 268 | obj-y += $(smsc911x-m) $(smsc911x-y) |
269 | obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o | ||
270 | |||
271 | disp-$(CONFIG_OMAP2_DSS) := display.o | ||
272 | obj-y += $(disp-m) $(disp-y) | ||
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index e0661777f599..1fa6bb896f41 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/mmc/host.h> | 22 | #include <linux/mmc/host.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/i2c/twl.h> | 24 | #include <linux/i2c/twl.h> |
25 | #include <linux/regulator/machine.h> | ||
25 | #include <linux/err.h> | 26 | #include <linux/err.h> |
26 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
27 | #include <linux/io.h> | 28 | #include <linux/io.h> |
@@ -139,15 +140,31 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = { | |||
139 | {OMAP_TAG_LCD, &sdp2430_lcd_config}, | 140 | {OMAP_TAG_LCD, &sdp2430_lcd_config}, |
140 | }; | 141 | }; |
141 | 142 | ||
142 | static void __init omap_2430sdp_init_irq(void) | 143 | static void __init omap_2430sdp_init_early(void) |
143 | { | 144 | { |
144 | omap_board_config = sdp2430_config; | ||
145 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | ||
146 | omap2_init_common_infrastructure(); | 145 | omap2_init_common_infrastructure(); |
147 | omap2_init_common_devices(NULL, NULL); | 146 | omap2_init_common_devices(NULL, NULL); |
148 | omap_init_irq(); | ||
149 | } | 147 | } |
150 | 148 | ||
149 | static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { | ||
150 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | ||
151 | }; | ||
152 | |||
153 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | ||
154 | static struct regulator_init_data sdp2430_vmmc1 = { | ||
155 | .constraints = { | ||
156 | .min_uV = 1850000, | ||
157 | .max_uV = 3150000, | ||
158 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
159 | | REGULATOR_MODE_STANDBY, | ||
160 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
161 | | REGULATOR_CHANGE_MODE | ||
162 | | REGULATOR_CHANGE_STATUS, | ||
163 | }, | ||
164 | .num_consumer_supplies = ARRAY_SIZE(sdp2430_vmmc1_supplies), | ||
165 | .consumer_supplies = &sdp2430_vmmc1_supplies[0], | ||
166 | }; | ||
167 | |||
151 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { | 168 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { |
152 | .gpio_base = OMAP_MAX_GPIO_LINES, | 169 | .gpio_base = OMAP_MAX_GPIO_LINES, |
153 | .irq_base = TWL4030_GPIO_IRQ_BASE, | 170 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
@@ -160,6 +177,7 @@ static struct twl4030_platform_data sdp2430_twldata = { | |||
160 | 177 | ||
161 | /* platform_data for children goes here */ | 178 | /* platform_data for children goes here */ |
162 | .gpio = &sdp2430_gpio_data, | 179 | .gpio = &sdp2430_gpio_data, |
180 | .vmmc1 = &sdp2430_vmmc1, | ||
163 | }; | 181 | }; |
164 | 182 | ||
165 | static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { | 183 | static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { |
@@ -226,6 +244,9 @@ static void __init omap_2430sdp_init(void) | |||
226 | 244 | ||
227 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 245 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
228 | 246 | ||
247 | omap_board_config = sdp2430_config; | ||
248 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | ||
249 | |||
229 | omap2430_i2c_init(); | 250 | omap2430_i2c_init(); |
230 | 251 | ||
231 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 252 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
@@ -253,9 +274,10 @@ static void __init omap_2430sdp_map_io(void) | |||
253 | MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") | 274 | MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") |
254 | /* Maintainer: Syed Khasim - Texas Instruments Inc */ | 275 | /* Maintainer: Syed Khasim - Texas Instruments Inc */ |
255 | .boot_params = 0x80000100, | 276 | .boot_params = 0x80000100, |
256 | .map_io = omap_2430sdp_map_io, | ||
257 | .reserve = omap_reserve, | 277 | .reserve = omap_reserve, |
258 | .init_irq = omap_2430sdp_init_irq, | 278 | .map_io = omap_2430sdp_map_io, |
279 | .init_early = omap_2430sdp_init_early, | ||
280 | .init_irq = omap_init_irq, | ||
259 | .init_machine = omap_2430sdp_init, | 281 | .init_machine = omap_2430sdp_init, |
260 | .timer = &omap_timer, | 282 | .timer = &omap_timer, |
261 | MACHINE_END | 283 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 7542ba59f2b8..c06eb423c4e4 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -307,34 +307,16 @@ static struct omap_dss_board_info sdp3430_dss_data = { | |||
307 | .default_device = &sdp3430_lcd_device, | 307 | .default_device = &sdp3430_lcd_device, |
308 | }; | 308 | }; |
309 | 309 | ||
310 | static struct platform_device sdp3430_dss_device = { | 310 | static struct regulator_consumer_supply sdp3430_vdda_dac_supply = |
311 | .name = "omapdss", | 311 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
312 | .id = -1, | ||
313 | .dev = { | ||
314 | .platform_data = &sdp3430_dss_data, | ||
315 | }, | ||
316 | }; | ||
317 | |||
318 | static struct regulator_consumer_supply sdp3430_vdda_dac_supply = { | ||
319 | .supply = "vdda_dac", | ||
320 | .dev = &sdp3430_dss_device.dev, | ||
321 | }; | ||
322 | |||
323 | static struct platform_device *sdp3430_devices[] __initdata = { | ||
324 | &sdp3430_dss_device, | ||
325 | }; | ||
326 | 312 | ||
327 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { | 313 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { |
328 | }; | 314 | }; |
329 | 315 | ||
330 | static void __init omap_3430sdp_init_irq(void) | 316 | static void __init omap_3430sdp_init_early(void) |
331 | { | 317 | { |
332 | omap_board_config = sdp3430_config; | ||
333 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); | ||
334 | omap3_pm_init_cpuidle(omap3_cpuidle_params_table); | ||
335 | omap2_init_common_infrastructure(); | 318 | omap2_init_common_infrastructure(); |
336 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); | 319 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); |
337 | omap_init_irq(); | ||
338 | } | 320 | } |
339 | 321 | ||
340 | static int sdp3430_batt_table[] = { | 322 | static int sdp3430_batt_table[] = { |
@@ -370,18 +352,6 @@ static struct omap2_hsmmc_info mmc[] = { | |||
370 | {} /* Terminator */ | 352 | {} /* Terminator */ |
371 | }; | 353 | }; |
372 | 354 | ||
373 | static struct regulator_consumer_supply sdp3430_vmmc1_supply = { | ||
374 | .supply = "vmmc", | ||
375 | }; | ||
376 | |||
377 | static struct regulator_consumer_supply sdp3430_vsim_supply = { | ||
378 | .supply = "vmmc_aux", | ||
379 | }; | ||
380 | |||
381 | static struct regulator_consumer_supply sdp3430_vmmc2_supply = { | ||
382 | .supply = "vmmc", | ||
383 | }; | ||
384 | |||
385 | static int sdp3430_twl_gpio_setup(struct device *dev, | 355 | static int sdp3430_twl_gpio_setup(struct device *dev, |
386 | unsigned gpio, unsigned ngpio) | 356 | unsigned gpio, unsigned ngpio) |
387 | { | 357 | { |
@@ -392,13 +362,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev, | |||
392 | mmc[1].gpio_cd = gpio + 1; | 362 | mmc[1].gpio_cd = gpio + 1; |
393 | omap2_hsmmc_init(mmc); | 363 | omap2_hsmmc_init(mmc); |
394 | 364 | ||
395 | /* link regulators to MMC adapters ... we "know" the | ||
396 | * regulators will be set up only *after* we return. | ||
397 | */ | ||
398 | sdp3430_vmmc1_supply.dev = mmc[0].dev; | ||
399 | sdp3430_vsim_supply.dev = mmc[0].dev; | ||
400 | sdp3430_vmmc2_supply.dev = mmc[1].dev; | ||
401 | |||
402 | /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ | 365 | /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ |
403 | gpio_request(gpio + 7, "sub_lcd_en_bkl"); | 366 | gpio_request(gpio + 7, "sub_lcd_en_bkl"); |
404 | gpio_direction_output(gpio + 7, 0); | 367 | gpio_direction_output(gpio + 7, 0); |
@@ -427,6 +390,34 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = { | |||
427 | .irq_line = 1, | 390 | .irq_line = 1, |
428 | }; | 391 | }; |
429 | 392 | ||
393 | /* regulator consumer mappings */ | ||
394 | |||
395 | /* ads7846 on SPI */ | ||
396 | static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = { | ||
397 | REGULATOR_SUPPLY("vcc", "spi1.0"), | ||
398 | }; | ||
399 | |||
400 | static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = { | ||
401 | REGULATOR_SUPPLY("vdda_dac", "omapdss"), | ||
402 | }; | ||
403 | |||
404 | /* VPLL2 for digital video outputs */ | ||
405 | static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = { | ||
406 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), | ||
407 | }; | ||
408 | |||
409 | static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = { | ||
410 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | ||
411 | }; | ||
412 | |||
413 | static struct regulator_consumer_supply sdp3430_vsim_supplies[] = { | ||
414 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), | ||
415 | }; | ||
416 | |||
417 | static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = { | ||
418 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), | ||
419 | }; | ||
420 | |||
430 | /* | 421 | /* |
431 | * Apply all the fixed voltages since most versions of U-Boot | 422 | * Apply all the fixed voltages since most versions of U-Boot |
432 | * don't bother with that initialization. | 423 | * don't bother with that initialization. |
@@ -469,6 +460,8 @@ static struct regulator_init_data sdp3430_vaux3 = { | |||
469 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 460 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
470 | | REGULATOR_CHANGE_STATUS, | 461 | | REGULATOR_CHANGE_STATUS, |
471 | }, | 462 | }, |
463 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux3_supplies), | ||
464 | .consumer_supplies = sdp3430_vaux3_supplies, | ||
472 | }; | 465 | }; |
473 | 466 | ||
474 | /* VAUX4 for OMAP VDD_CSI2 (camera) */ | 467 | /* VAUX4 for OMAP VDD_CSI2 (camera) */ |
@@ -495,8 +488,8 @@ static struct regulator_init_data sdp3430_vmmc1 = { | |||
495 | | REGULATOR_CHANGE_MODE | 488 | | REGULATOR_CHANGE_MODE |
496 | | REGULATOR_CHANGE_STATUS, | 489 | | REGULATOR_CHANGE_STATUS, |
497 | }, | 490 | }, |
498 | .num_consumer_supplies = 1, | 491 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc1_supplies), |
499 | .consumer_supplies = &sdp3430_vmmc1_supply, | 492 | .consumer_supplies = sdp3430_vmmc1_supplies, |
500 | }; | 493 | }; |
501 | 494 | ||
502 | /* VMMC2 for MMC2 card */ | 495 | /* VMMC2 for MMC2 card */ |
@@ -510,8 +503,8 @@ static struct regulator_init_data sdp3430_vmmc2 = { | |||
510 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 503 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
511 | | REGULATOR_CHANGE_STATUS, | 504 | | REGULATOR_CHANGE_STATUS, |
512 | }, | 505 | }, |
513 | .num_consumer_supplies = 1, | 506 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc2_supplies), |
514 | .consumer_supplies = &sdp3430_vmmc2_supply, | 507 | .consumer_supplies = sdp3430_vmmc2_supplies, |
515 | }; | 508 | }; |
516 | 509 | ||
517 | /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ | 510 | /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ |
@@ -525,8 +518,8 @@ static struct regulator_init_data sdp3430_vsim = { | |||
525 | | REGULATOR_CHANGE_MODE | 518 | | REGULATOR_CHANGE_MODE |
526 | | REGULATOR_CHANGE_STATUS, | 519 | | REGULATOR_CHANGE_STATUS, |
527 | }, | 520 | }, |
528 | .num_consumer_supplies = 1, | 521 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vsim_supplies), |
529 | .consumer_supplies = &sdp3430_vsim_supply, | 522 | .consumer_supplies = sdp3430_vsim_supplies, |
530 | }; | 523 | }; |
531 | 524 | ||
532 | /* VDAC for DSS driving S-Video */ | 525 | /* VDAC for DSS driving S-Video */ |
@@ -540,16 +533,8 @@ static struct regulator_init_data sdp3430_vdac = { | |||
540 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 533 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
541 | | REGULATOR_CHANGE_STATUS, | 534 | | REGULATOR_CHANGE_STATUS, |
542 | }, | 535 | }, |
543 | .num_consumer_supplies = 1, | 536 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies), |
544 | .consumer_supplies = &sdp3430_vdda_dac_supply, | 537 | .consumer_supplies = sdp3430_vdda_dac_supplies, |
545 | }; | ||
546 | |||
547 | /* VPLL2 for digital video outputs */ | ||
548 | static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = { | ||
549 | { | ||
550 | .supply = "vdds_dsi", | ||
551 | .dev = &sdp3430_dss_device.dev, | ||
552 | } | ||
553 | }; | 538 | }; |
554 | 539 | ||
555 | static struct regulator_init_data sdp3430_vpll2 = { | 540 | static struct regulator_init_data sdp3430_vpll2 = { |
@@ -567,9 +552,7 @@ static struct regulator_init_data sdp3430_vpll2 = { | |||
567 | .consumer_supplies = sdp3430_vpll2_supplies, | 552 | .consumer_supplies = sdp3430_vpll2_supplies, |
568 | }; | 553 | }; |
569 | 554 | ||
570 | static struct twl4030_codec_audio_data sdp3430_audio = { | 555 | static struct twl4030_codec_audio_data sdp3430_audio; |
571 | .audio_mclk = 26000000, | ||
572 | }; | ||
573 | 556 | ||
574 | static struct twl4030_codec_data sdp3430_codec = { | 557 | static struct twl4030_codec_data sdp3430_codec = { |
575 | .audio_mclk = 26000000, | 558 | .audio_mclk = 26000000, |
@@ -669,6 +652,106 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
669 | static struct omap_board_mux board_mux[] __initdata = { | 652 | static struct omap_board_mux board_mux[] __initdata = { |
670 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 653 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
671 | }; | 654 | }; |
655 | |||
656 | static struct omap_device_pad serial1_pads[] __initdata = { | ||
657 | /* | ||
658 | * Note that off output enable is an active low | ||
659 | * signal. So setting this means pin is a | ||
660 | * input enabled in off mode | ||
661 | */ | ||
662 | OMAP_MUX_STATIC("uart1_cts.uart1_cts", | ||
663 | OMAP_PIN_INPUT | | ||
664 | OMAP_PIN_OFF_INPUT_PULLDOWN | | ||
665 | OMAP_OFFOUT_EN | | ||
666 | OMAP_MUX_MODE0), | ||
667 | OMAP_MUX_STATIC("uart1_rts.uart1_rts", | ||
668 | OMAP_PIN_OUTPUT | | ||
669 | OMAP_OFF_EN | | ||
670 | OMAP_MUX_MODE0), | ||
671 | OMAP_MUX_STATIC("uart1_rx.uart1_rx", | ||
672 | OMAP_PIN_INPUT | | ||
673 | OMAP_PIN_OFF_INPUT_PULLDOWN | | ||
674 | OMAP_OFFOUT_EN | | ||
675 | OMAP_MUX_MODE0), | ||
676 | OMAP_MUX_STATIC("uart1_tx.uart1_tx", | ||
677 | OMAP_PIN_OUTPUT | | ||
678 | OMAP_OFF_EN | | ||
679 | OMAP_MUX_MODE0), | ||
680 | }; | ||
681 | |||
682 | static struct omap_device_pad serial2_pads[] __initdata = { | ||
683 | OMAP_MUX_STATIC("uart2_cts.uart2_cts", | ||
684 | OMAP_PIN_INPUT_PULLUP | | ||
685 | OMAP_PIN_OFF_INPUT_PULLDOWN | | ||
686 | OMAP_OFFOUT_EN | | ||
687 | OMAP_MUX_MODE0), | ||
688 | OMAP_MUX_STATIC("uart2_rts.uart2_rts", | ||
689 | OMAP_PIN_OUTPUT | | ||
690 | OMAP_OFF_EN | | ||
691 | OMAP_MUX_MODE0), | ||
692 | OMAP_MUX_STATIC("uart2_rx.uart2_rx", | ||
693 | OMAP_PIN_INPUT | | ||
694 | OMAP_PIN_OFF_INPUT_PULLDOWN | | ||
695 | OMAP_OFFOUT_EN | | ||
696 | OMAP_MUX_MODE0), | ||
697 | OMAP_MUX_STATIC("uart2_tx.uart2_tx", | ||
698 | OMAP_PIN_OUTPUT | | ||
699 | OMAP_OFF_EN | | ||
700 | OMAP_MUX_MODE0), | ||
701 | }; | ||
702 | |||
703 | static struct omap_device_pad serial3_pads[] __initdata = { | ||
704 | OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx", | ||
705 | OMAP_PIN_INPUT_PULLDOWN | | ||
706 | OMAP_PIN_OFF_INPUT_PULLDOWN | | ||
707 | OMAP_OFFOUT_EN | | ||
708 | OMAP_MUX_MODE0), | ||
709 | OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd", | ||
710 | OMAP_PIN_OUTPUT | | ||
711 | OMAP_OFF_EN | | ||
712 | OMAP_MUX_MODE0), | ||
713 | OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx", | ||
714 | OMAP_PIN_INPUT | | ||
715 | OMAP_PIN_OFF_INPUT_PULLDOWN | | ||
716 | OMAP_OFFOUT_EN | | ||
717 | OMAP_MUX_MODE0), | ||
718 | OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx", | ||
719 | OMAP_PIN_OUTPUT | | ||
720 | OMAP_OFF_EN | | ||
721 | OMAP_MUX_MODE0), | ||
722 | }; | ||
723 | |||
724 | static struct omap_board_data serial1_data = { | ||
725 | .id = 0, | ||
726 | .pads = serial1_pads, | ||
727 | .pads_cnt = ARRAY_SIZE(serial1_pads), | ||
728 | }; | ||
729 | |||
730 | static struct omap_board_data serial2_data = { | ||
731 | .id = 1, | ||
732 | .pads = serial2_pads, | ||
733 | .pads_cnt = ARRAY_SIZE(serial2_pads), | ||
734 | }; | ||
735 | |||
736 | static struct omap_board_data serial3_data = { | ||
737 | .id = 2, | ||
738 | .pads = serial3_pads, | ||
739 | .pads_cnt = ARRAY_SIZE(serial3_pads), | ||
740 | }; | ||
741 | |||
742 | static inline void board_serial_init(void) | ||
743 | { | ||
744 | omap_serial_init_port(&serial1_data); | ||
745 | omap_serial_init_port(&serial2_data); | ||
746 | omap_serial_init_port(&serial3_data); | ||
747 | } | ||
748 | #else | ||
749 | #define board_mux NULL | ||
750 | |||
751 | static inline void board_serial_init(void) | ||
752 | { | ||
753 | omap_serial_init(); | ||
754 | } | ||
672 | #endif | 755 | #endif |
673 | 756 | ||
674 | /* | 757 | /* |
@@ -800,8 +883,11 @@ static struct omap_musb_board_data musb_board_data = { | |||
800 | static void __init omap_3430sdp_init(void) | 883 | static void __init omap_3430sdp_init(void) |
801 | { | 884 | { |
802 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 885 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
886 | omap_board_config = sdp3430_config; | ||
887 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); | ||
888 | omap3_pm_init_cpuidle(omap3_cpuidle_params_table); | ||
803 | omap3430_i2c_init(); | 889 | omap3430_i2c_init(); |
804 | platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); | 890 | omap_display_init(&sdp3430_dss_data); |
805 | if (omap_rev() > OMAP3430_REV_ES1_0) | 891 | if (omap_rev() > OMAP3430_REV_ES1_0) |
806 | ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; | 892 | ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; |
807 | else | 893 | else |
@@ -810,10 +896,10 @@ static void __init omap_3430sdp_init(void) | |||
810 | spi_register_board_info(sdp3430_spi_board_info, | 896 | spi_register_board_info(sdp3430_spi_board_info, |
811 | ARRAY_SIZE(sdp3430_spi_board_info)); | 897 | ARRAY_SIZE(sdp3430_spi_board_info)); |
812 | ads7846_dev_init(); | 898 | ads7846_dev_init(); |
813 | omap_serial_init(); | 899 | board_serial_init(); |
814 | usb_musb_init(&musb_board_data); | 900 | usb_musb_init(&musb_board_data); |
815 | board_smc91x_init(); | 901 | board_smc91x_init(); |
816 | board_flash_init(sdp_flash_partitions, chip_sel_3430); | 902 | board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); |
817 | sdp3430_display_init(); | 903 | sdp3430_display_init(); |
818 | enable_board_wakeup_source(); | 904 | enable_board_wakeup_source(); |
819 | usbhs_init(&usbhs_bdata); | 905 | usbhs_init(&usbhs_bdata); |
@@ -822,9 +908,10 @@ static void __init omap_3430sdp_init(void) | |||
822 | MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") | 908 | MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") |
823 | /* Maintainer: Syed Khasim - Texas Instruments Inc */ | 909 | /* Maintainer: Syed Khasim - Texas Instruments Inc */ |
824 | .boot_params = 0x80000100, | 910 | .boot_params = 0x80000100, |
825 | .map_io = omap3_map_io, | ||
826 | .reserve = omap_reserve, | 911 | .reserve = omap_reserve, |
827 | .init_irq = omap_3430sdp_init_irq, | 912 | .map_io = omap3_map_io, |
913 | .init_early = omap_3430sdp_init_early, | ||
914 | .init_irq = omap_init_irq, | ||
828 | .init_machine = omap_3430sdp_init, | 915 | .init_machine = omap_3430sdp_init, |
829 | .timer = &omap_timer, | 916 | .timer = &omap_timer, |
830 | MACHINE_END | 917 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index deed2db32c53..a5933cc15caa 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
13 | #include <linux/gpio.h> | 13 | #include <linux/gpio.h> |
14 | #include <linux/mtd/nand.h> | ||
14 | 15 | ||
15 | #include <asm/mach-types.h> | 16 | #include <asm/mach-types.h> |
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
@@ -69,14 +70,11 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
69 | static struct omap_board_config_kernel sdp_config[] __initdata = { | 70 | static struct omap_board_config_kernel sdp_config[] __initdata = { |
70 | }; | 71 | }; |
71 | 72 | ||
72 | static void __init omap_sdp_init_irq(void) | 73 | static void __init omap_sdp_init_early(void) |
73 | { | 74 | { |
74 | omap_board_config = sdp_config; | ||
75 | omap_board_config_size = ARRAY_SIZE(sdp_config); | ||
76 | omap2_init_common_infrastructure(); | 75 | omap2_init_common_infrastructure(); |
77 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, | 76 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, |
78 | h8mbx00u0mer0em_sdrc_params); | 77 | h8mbx00u0mer0em_sdrc_params); |
79 | omap_init_irq(); | ||
80 | } | 78 | } |
81 | 79 | ||
82 | #ifdef CONFIG_OMAP_MUX | 80 | #ifdef CONFIG_OMAP_MUX |
@@ -206,19 +204,22 @@ static struct flash_partitions sdp_flash_partitions[] = { | |||
206 | static void __init omap_sdp_init(void) | 204 | static void __init omap_sdp_init(void) |
207 | { | 205 | { |
208 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); | 206 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
207 | omap_board_config = sdp_config; | ||
208 | omap_board_config_size = ARRAY_SIZE(sdp_config); | ||
209 | zoom_peripherals_init(); | 209 | zoom_peripherals_init(); |
210 | zoom_display_init(); | 210 | zoom_display_init(); |
211 | board_smc91x_init(); | 211 | board_smc91x_init(); |
212 | board_flash_init(sdp_flash_partitions, chip_sel_sdp); | 212 | board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); |
213 | enable_board_wakeup_source(); | 213 | enable_board_wakeup_source(); |
214 | usbhs_init(&usbhs_bdata); | 214 | usbhs_init(&usbhs_bdata); |
215 | } | 215 | } |
216 | 216 | ||
217 | MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") | 217 | MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") |
218 | .boot_params = 0x80000100, | 218 | .boot_params = 0x80000100, |
219 | .map_io = omap3_map_io, | ||
220 | .reserve = omap_reserve, | 219 | .reserve = omap_reserve, |
221 | .init_irq = omap_sdp_init_irq, | 220 | .map_io = omap3_map_io, |
221 | .init_early = omap_sdp_init_early, | ||
222 | .init_irq = omap_init_irq, | ||
222 | .init_machine = omap_sdp_init, | 223 | .init_machine = omap_sdp_init, |
223 | .timer = &omap_timer, | 224 | .timer = &omap_timer, |
224 | MACHINE_END | 225 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index f603f3b04cb8..333ceb2c8fb0 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <plat/common.h> | 35 | #include <plat/common.h> |
36 | #include <plat/usb.h> | 36 | #include <plat/usb.h> |
37 | #include <plat/mmc.h> | 37 | #include <plat/mmc.h> |
38 | #include <plat/omap4-keypad.h> | ||
38 | 39 | ||
39 | #include "mux.h" | 40 | #include "mux.h" |
40 | #include "hsmmc.h" | 41 | #include "hsmmc.h" |
@@ -47,6 +48,90 @@ | |||
47 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 | 48 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 |
48 | #define OMAP4_SFH7741_ENABLE_GPIO 188 | 49 | #define OMAP4_SFH7741_ENABLE_GPIO 188 |
49 | 50 | ||
51 | static const int sdp4430_keymap[] = { | ||
52 | KEY(0, 0, KEY_E), | ||
53 | KEY(0, 1, KEY_R), | ||
54 | KEY(0, 2, KEY_T), | ||
55 | KEY(0, 3, KEY_HOME), | ||
56 | KEY(0, 4, KEY_F5), | ||
57 | KEY(0, 5, KEY_UNKNOWN), | ||
58 | KEY(0, 6, KEY_I), | ||
59 | KEY(0, 7, KEY_LEFTSHIFT), | ||
60 | |||
61 | KEY(1, 0, KEY_D), | ||
62 | KEY(1, 1, KEY_F), | ||
63 | KEY(1, 2, KEY_G), | ||
64 | KEY(1, 3, KEY_SEND), | ||
65 | KEY(1, 4, KEY_F6), | ||
66 | KEY(1, 5, KEY_UNKNOWN), | ||
67 | KEY(1, 6, KEY_K), | ||
68 | KEY(1, 7, KEY_ENTER), | ||
69 | |||
70 | KEY(2, 0, KEY_X), | ||
71 | KEY(2, 1, KEY_C), | ||
72 | KEY(2, 2, KEY_V), | ||
73 | KEY(2, 3, KEY_END), | ||
74 | KEY(2, 4, KEY_F7), | ||
75 | KEY(2, 5, KEY_UNKNOWN), | ||
76 | KEY(2, 6, KEY_DOT), | ||
77 | KEY(2, 7, KEY_CAPSLOCK), | ||
78 | |||
79 | KEY(3, 0, KEY_Z), | ||
80 | KEY(3, 1, KEY_KPPLUS), | ||
81 | KEY(3, 2, KEY_B), | ||
82 | KEY(3, 3, KEY_F1), | ||
83 | KEY(3, 4, KEY_F8), | ||
84 | KEY(3, 5, KEY_UNKNOWN), | ||
85 | KEY(3, 6, KEY_O), | ||
86 | KEY(3, 7, KEY_SPACE), | ||
87 | |||
88 | KEY(4, 0, KEY_W), | ||
89 | KEY(4, 1, KEY_Y), | ||
90 | KEY(4, 2, KEY_U), | ||
91 | KEY(4, 3, KEY_F2), | ||
92 | KEY(4, 4, KEY_VOLUMEUP), | ||
93 | KEY(4, 5, KEY_UNKNOWN), | ||
94 | KEY(4, 6, KEY_L), | ||
95 | KEY(4, 7, KEY_LEFT), | ||
96 | |||
97 | KEY(5, 0, KEY_S), | ||
98 | KEY(5, 1, KEY_H), | ||
99 | KEY(5, 2, KEY_J), | ||
100 | KEY(5, 3, KEY_F3), | ||
101 | KEY(5, 4, KEY_F9), | ||
102 | KEY(5, 5, KEY_VOLUMEDOWN), | ||
103 | KEY(5, 6, KEY_M), | ||
104 | KEY(5, 7, KEY_RIGHT), | ||
105 | |||
106 | KEY(6, 0, KEY_Q), | ||
107 | KEY(6, 1, KEY_A), | ||
108 | KEY(6, 2, KEY_N), | ||
109 | KEY(6, 3, KEY_BACK), | ||
110 | KEY(6, 4, KEY_BACKSPACE), | ||
111 | KEY(6, 5, KEY_UNKNOWN), | ||
112 | KEY(6, 6, KEY_P), | ||
113 | KEY(6, 7, KEY_UP), | ||
114 | |||
115 | KEY(7, 0, KEY_PROG1), | ||
116 | KEY(7, 1, KEY_PROG2), | ||
117 | KEY(7, 2, KEY_PROG3), | ||
118 | KEY(7, 3, KEY_PROG4), | ||
119 | KEY(7, 4, KEY_F4), | ||
120 | KEY(7, 5, KEY_UNKNOWN), | ||
121 | KEY(7, 6, KEY_OK), | ||
122 | KEY(7, 7, KEY_DOWN), | ||
123 | }; | ||
124 | |||
125 | static struct matrix_keymap_data sdp4430_keymap_data = { | ||
126 | .keymap = sdp4430_keymap, | ||
127 | .keymap_size = ARRAY_SIZE(sdp4430_keymap), | ||
128 | }; | ||
129 | |||
130 | static struct omap4_keypad_platform_data sdp4430_keypad_data = { | ||
131 | .keymap_data = &sdp4430_keymap_data, | ||
132 | .rows = 8, | ||
133 | .cols = 8, | ||
134 | }; | ||
50 | static struct gpio_led sdp4430_gpio_leds[] = { | 135 | static struct gpio_led sdp4430_gpio_leds[] = { |
51 | { | 136 | { |
52 | .name = "omap4:green:debug0", | 137 | .name = "omap4:green:debug0", |
@@ -238,16 +323,13 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = { | |||
238 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, | 323 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, |
239 | }; | 324 | }; |
240 | 325 | ||
241 | static void __init omap_4430sdp_init_irq(void) | 326 | static void __init omap_4430sdp_init_early(void) |
242 | { | 327 | { |
243 | omap_board_config = sdp4430_config; | ||
244 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); | ||
245 | omap2_init_common_infrastructure(); | 328 | omap2_init_common_infrastructure(); |
246 | omap2_init_common_devices(NULL, NULL); | 329 | omap2_init_common_devices(NULL, NULL); |
247 | #ifdef CONFIG_OMAP_32K_TIMER | 330 | #ifdef CONFIG_OMAP_32K_TIMER |
248 | omap2_gp_clockevent_set_gptimer(1); | 331 | omap2_gp_clockevent_set_gptimer(1); |
249 | #endif | 332 | #endif |
250 | gic_init_irq(); | ||
251 | } | 333 | } |
252 | 334 | ||
253 | static struct omap_musb_board_data musb_board_data = { | 335 | static struct omap_musb_board_data musb_board_data = { |
@@ -266,11 +348,6 @@ static struct twl4030_usb_data omap4_usbphy_data = { | |||
266 | 348 | ||
267 | static struct omap2_hsmmc_info mmc[] = { | 349 | static struct omap2_hsmmc_info mmc[] = { |
268 | { | 350 | { |
269 | .mmc = 1, | ||
270 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
271 | .gpio_wp = -EINVAL, | ||
272 | }, | ||
273 | { | ||
274 | .mmc = 2, | 351 | .mmc = 2, |
275 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | 352 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
276 | .gpio_cd = -EINVAL, | 353 | .gpio_cd = -EINVAL, |
@@ -278,19 +355,24 @@ static struct omap2_hsmmc_info mmc[] = { | |||
278 | .nonremovable = true, | 355 | .nonremovable = true, |
279 | .ocr_mask = MMC_VDD_29_30, | 356 | .ocr_mask = MMC_VDD_29_30, |
280 | }, | 357 | }, |
358 | { | ||
359 | .mmc = 1, | ||
360 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
361 | .gpio_wp = -EINVAL, | ||
362 | }, | ||
281 | {} /* Terminator */ | 363 | {} /* Terminator */ |
282 | }; | 364 | }; |
283 | 365 | ||
284 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { | 366 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
285 | { | 367 | { |
286 | .supply = "vmmc", | 368 | .supply = "vmmc", |
287 | .dev_name = "mmci-omap-hs.1", | 369 | .dev_name = "omap_hsmmc.1", |
288 | }, | 370 | }, |
289 | }; | 371 | }; |
290 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | 372 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { |
291 | { | 373 | { |
292 | .supply = "vmmc", | 374 | .supply = "vmmc", |
293 | .dev_name = "mmci-omap-hs.0", | 375 | .dev_name = "omap_hsmmc.0", |
294 | }, | 376 | }, |
295 | }; | 377 | }; |
296 | 378 | ||
@@ -424,7 +506,6 @@ static struct regulator_init_data sdp4430_vana = { | |||
424 | .constraints = { | 506 | .constraints = { |
425 | .min_uV = 2100000, | 507 | .min_uV = 2100000, |
426 | .max_uV = 2100000, | 508 | .max_uV = 2100000, |
427 | .apply_uV = true, | ||
428 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 509 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
429 | | REGULATOR_MODE_STANDBY, | 510 | | REGULATOR_MODE_STANDBY, |
430 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 511 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -436,7 +517,6 @@ static struct regulator_init_data sdp4430_vcxio = { | |||
436 | .constraints = { | 517 | .constraints = { |
437 | .min_uV = 1800000, | 518 | .min_uV = 1800000, |
438 | .max_uV = 1800000, | 519 | .max_uV = 1800000, |
439 | .apply_uV = true, | ||
440 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 520 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
441 | | REGULATOR_MODE_STANDBY, | 521 | | REGULATOR_MODE_STANDBY, |
442 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 522 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -448,7 +528,6 @@ static struct regulator_init_data sdp4430_vdac = { | |||
448 | .constraints = { | 528 | .constraints = { |
449 | .min_uV = 1800000, | 529 | .min_uV = 1800000, |
450 | .max_uV = 1800000, | 530 | .max_uV = 1800000, |
451 | .apply_uV = true, | ||
452 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 531 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
453 | | REGULATOR_MODE_STANDBY, | 532 | | REGULATOR_MODE_STANDBY, |
454 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 533 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -547,9 +626,76 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
547 | OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 626 | OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
548 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 627 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
549 | }; | 628 | }; |
629 | |||
630 | static struct omap_device_pad serial2_pads[] __initdata = { | ||
631 | OMAP_MUX_STATIC("uart2_cts.uart2_cts", | ||
632 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
633 | OMAP_MUX_STATIC("uart2_rts.uart2_rts", | ||
634 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
635 | OMAP_MUX_STATIC("uart2_rx.uart2_rx", | ||
636 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
637 | OMAP_MUX_STATIC("uart2_tx.uart2_tx", | ||
638 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
639 | }; | ||
640 | |||
641 | static struct omap_device_pad serial3_pads[] __initdata = { | ||
642 | OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx", | ||
643 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
644 | OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd", | ||
645 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
646 | OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx", | ||
647 | OMAP_PIN_INPUT | OMAP_MUX_MODE0), | ||
648 | OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx", | ||
649 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
650 | }; | ||
651 | |||
652 | static struct omap_device_pad serial4_pads[] __initdata = { | ||
653 | OMAP_MUX_STATIC("uart4_rx.uart4_rx", | ||
654 | OMAP_PIN_INPUT | OMAP_MUX_MODE0), | ||
655 | OMAP_MUX_STATIC("uart4_tx.uart4_tx", | ||
656 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
657 | }; | ||
658 | |||
659 | static struct omap_board_data serial2_data = { | ||
660 | .id = 1, | ||
661 | .pads = serial2_pads, | ||
662 | .pads_cnt = ARRAY_SIZE(serial2_pads), | ||
663 | }; | ||
664 | |||
665 | static struct omap_board_data serial3_data = { | ||
666 | .id = 2, | ||
667 | .pads = serial3_pads, | ||
668 | .pads_cnt = ARRAY_SIZE(serial3_pads), | ||
669 | }; | ||
670 | |||
671 | static struct omap_board_data serial4_data = { | ||
672 | .id = 3, | ||
673 | .pads = serial4_pads, | ||
674 | .pads_cnt = ARRAY_SIZE(serial4_pads), | ||
675 | }; | ||
676 | |||
677 | static inline void board_serial_init(void) | ||
678 | { | ||
679 | struct omap_board_data bdata; | ||
680 | bdata.flags = 0; | ||
681 | bdata.pads = NULL; | ||
682 | bdata.pads_cnt = 0; | ||
683 | bdata.id = 0; | ||
684 | /* pass dummy data for UART1 */ | ||
685 | omap_serial_init_port(&bdata); | ||
686 | |||
687 | omap_serial_init_port(&serial2_data); | ||
688 | omap_serial_init_port(&serial3_data); | ||
689 | omap_serial_init_port(&serial4_data); | ||
690 | } | ||
550 | #else | 691 | #else |
551 | #define board_mux NULL | 692 | #define board_mux NULL |
552 | #endif | 693 | |
694 | static inline void board_serial_init(void) | ||
695 | { | ||
696 | omap_serial_init(); | ||
697 | } | ||
698 | #endif | ||
553 | 699 | ||
554 | static void __init omap_4430sdp_init(void) | 700 | static void __init omap_4430sdp_init(void) |
555 | { | 701 | { |
@@ -560,10 +706,13 @@ static void __init omap_4430sdp_init(void) | |||
560 | package = OMAP_PACKAGE_CBL; | 706 | package = OMAP_PACKAGE_CBL; |
561 | omap4_mux_init(board_mux, package); | 707 | omap4_mux_init(board_mux, package); |
562 | 708 | ||
709 | omap_board_config = sdp4430_config; | ||
710 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); | ||
711 | |||
563 | omap4_i2c_init(); | 712 | omap4_i2c_init(); |
564 | omap_sfh7741prox_init(); | 713 | omap_sfh7741prox_init(); |
565 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 714 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
566 | omap_serial_init(); | 715 | board_serial_init(); |
567 | omap4_twl6030_hsmmc_init(mmc); | 716 | omap4_twl6030_hsmmc_init(mmc); |
568 | 717 | ||
569 | usb_musb_init(&musb_board_data); | 718 | usb_musb_init(&musb_board_data); |
@@ -576,6 +725,10 @@ static void __init omap_4430sdp_init(void) | |||
576 | spi_register_board_info(sdp4430_spi_board_info, | 725 | spi_register_board_info(sdp4430_spi_board_info, |
577 | ARRAY_SIZE(sdp4430_spi_board_info)); | 726 | ARRAY_SIZE(sdp4430_spi_board_info)); |
578 | } | 727 | } |
728 | |||
729 | status = omap4_keyboard_init(&sdp4430_keypad_data); | ||
730 | if (status) | ||
731 | pr_err("Keypad initialization failed: %d\n", status); | ||
579 | } | 732 | } |
580 | 733 | ||
581 | static void __init omap_4430sdp_map_io(void) | 734 | static void __init omap_4430sdp_map_io(void) |
@@ -587,9 +740,10 @@ static void __init omap_4430sdp_map_io(void) | |||
587 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") | 740 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") |
588 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ | 741 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ |
589 | .boot_params = 0x80000100, | 742 | .boot_params = 0x80000100, |
590 | .map_io = omap_4430sdp_map_io, | ||
591 | .reserve = omap_reserve, | 743 | .reserve = omap_reserve, |
592 | .init_irq = omap_4430sdp_init_irq, | 744 | .map_io = omap_4430sdp_map_io, |
745 | .init_early = omap_4430sdp_init_early, | ||
746 | .init_irq = gic_init_irq, | ||
593 | .init_machine = omap_4430sdp_init, | 747 | .init_machine = omap_4430sdp_init, |
594 | .timer = &omap_timer, | 748 | .timer = &omap_timer, |
595 | MACHINE_END | 749 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index e3a194f6b13f..a890d244fec6 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c | |||
@@ -49,14 +49,10 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
49 | #define board_mux NULL | 49 | #define board_mux NULL |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | static void __init am3517_crane_init_irq(void) | 52 | static void __init am3517_crane_init_early(void) |
53 | { | 53 | { |
54 | omap_board_config = am3517_crane_config; | ||
55 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); | ||
56 | |||
57 | omap2_init_common_infrastructure(); | 54 | omap2_init_common_infrastructure(); |
58 | omap2_init_common_devices(NULL, NULL); | 55 | omap2_init_common_devices(NULL, NULL); |
59 | omap_init_irq(); | ||
60 | } | 56 | } |
61 | 57 | ||
62 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { | 58 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { |
@@ -77,6 +73,9 @@ static void __init am3517_crane_init(void) | |||
77 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 73 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
78 | omap_serial_init(); | 74 | omap_serial_init(); |
79 | 75 | ||
76 | omap_board_config = am3517_crane_config; | ||
77 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); | ||
78 | |||
80 | /* Configure GPIO for EHCI port */ | 79 | /* Configure GPIO for EHCI port */ |
81 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { | 80 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { |
82 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", | 81 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", |
@@ -108,9 +107,10 @@ static void __init am3517_crane_init(void) | |||
108 | 107 | ||
109 | MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") | 108 | MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") |
110 | .boot_params = 0x80000100, | 109 | .boot_params = 0x80000100, |
111 | .map_io = omap3_map_io, | ||
112 | .reserve = omap_reserve, | 110 | .reserve = omap_reserve, |
113 | .init_irq = am3517_crane_init_irq, | 111 | .map_io = omap3_map_io, |
112 | .init_early = am3517_crane_init_early, | ||
113 | .init_irq = omap_init_irq, | ||
114 | .init_machine = am3517_crane_init, | 114 | .init_machine = am3517_crane_init, |
115 | .timer = &omap_timer, | 115 | .timer = &omap_timer, |
116 | MACHINE_END | 116 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 913538ad17d8..ce7d5e6e4150 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -200,6 +200,9 @@ static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = { | |||
200 | }; | 200 | }; |
201 | static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { | 201 | static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { |
202 | { | 202 | { |
203 | I2C_BOARD_INFO("tlv320aic23", 0x1A), | ||
204 | }, | ||
205 | { | ||
203 | I2C_BOARD_INFO("tca6416", 0x21), | 206 | I2C_BOARD_INFO("tca6416", 0x21), |
204 | .platform_data = &am3517evm_gpio_expander_info_0, | 207 | .platform_data = &am3517evm_gpio_expander_info_0, |
205 | }, | 208 | }, |
@@ -378,37 +381,23 @@ static struct omap_dss_board_info am3517_evm_dss_data = { | |||
378 | .default_device = &am3517_evm_lcd_device, | 381 | .default_device = &am3517_evm_lcd_device, |
379 | }; | 382 | }; |
380 | 383 | ||
381 | static struct platform_device am3517_evm_dss_device = { | ||
382 | .name = "omapdss", | ||
383 | .id = -1, | ||
384 | .dev = { | ||
385 | .platform_data = &am3517_evm_dss_data, | ||
386 | }, | ||
387 | }; | ||
388 | |||
389 | /* | 384 | /* |
390 | * Board initialization | 385 | * Board initialization |
391 | */ | 386 | */ |
392 | static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | 387 | static void __init am3517_evm_init_early(void) |
393 | }; | ||
394 | |||
395 | static struct platform_device *am3517_evm_devices[] __initdata = { | ||
396 | &am3517_evm_dss_device, | ||
397 | }; | ||
398 | |||
399 | static void __init am3517_evm_init_irq(void) | ||
400 | { | 388 | { |
401 | omap_board_config = am3517_evm_config; | ||
402 | omap_board_config_size = ARRAY_SIZE(am3517_evm_config); | ||
403 | omap2_init_common_infrastructure(); | 389 | omap2_init_common_infrastructure(); |
404 | omap2_init_common_devices(NULL, NULL); | 390 | omap2_init_common_devices(NULL, NULL); |
405 | omap_init_irq(); | ||
406 | } | 391 | } |
407 | 392 | ||
408 | static struct omap_musb_board_data musb_board_data = { | 393 | static struct omap_musb_board_data musb_board_data = { |
409 | .interface_type = MUSB_INTERFACE_ULPI, | 394 | .interface_type = MUSB_INTERFACE_ULPI, |
410 | .mode = MUSB_OTG, | 395 | .mode = MUSB_OTG, |
411 | .power = 500, | 396 | .power = 500, |
397 | .set_phy_power = am35x_musb_phy_power, | ||
398 | .clear_irq = am35x_musb_clear_irq, | ||
399 | .set_mode = am35x_musb_set_mode, | ||
400 | .reset = am35x_musb_reset, | ||
412 | }; | 401 | }; |
413 | 402 | ||
414 | static __init void am3517_evm_musb_init(void) | 403 | static __init void am3517_evm_musb_init(void) |
@@ -490,14 +479,17 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) | |||
490 | platform_device_register(&am3517_hecc_device); | 479 | platform_device_register(&am3517_hecc_device); |
491 | } | 480 | } |
492 | 481 | ||
482 | static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | ||
483 | }; | ||
484 | |||
493 | static void __init am3517_evm_init(void) | 485 | static void __init am3517_evm_init(void) |
494 | { | 486 | { |
487 | omap_board_config = am3517_evm_config; | ||
488 | omap_board_config_size = ARRAY_SIZE(am3517_evm_config); | ||
495 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 489 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
496 | 490 | ||
497 | am3517_evm_i2c_init(); | 491 | am3517_evm_i2c_init(); |
498 | platform_add_devices(am3517_evm_devices, | 492 | omap_display_init(&am3517_evm_dss_data); |
499 | ARRAY_SIZE(am3517_evm_devices)); | ||
500 | |||
501 | omap_serial_init(); | 493 | omap_serial_init(); |
502 | 494 | ||
503 | /* Configure GPIO for EHCI port */ | 495 | /* Configure GPIO for EHCI port */ |
@@ -521,9 +513,10 @@ static void __init am3517_evm_init(void) | |||
521 | 513 | ||
522 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") | 514 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") |
523 | .boot_params = 0x80000100, | 515 | .boot_params = 0x80000100, |
524 | .map_io = omap3_map_io, | ||
525 | .reserve = omap_reserve, | 516 | .reserve = omap_reserve, |
526 | .init_irq = am3517_evm_init_irq, | 517 | .map_io = omap3_map_io, |
518 | .init_early = am3517_evm_init_early, | ||
519 | .init_irq = omap_init_irq, | ||
527 | .init_machine = am3517_evm_init, | 520 | .init_machine = am3517_evm_init, |
528 | .timer = &omap_timer, | 521 | .timer = &omap_timer, |
529 | MACHINE_END | 522 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 9f55b68687f7..f4f8374a0298 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -274,13 +274,10 @@ 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 | ||
277 | static void __init omap_apollon_init_irq(void) | 277 | static void __init omap_apollon_init_early(void) |
278 | { | 278 | { |
279 | omap_board_config = apollon_config; | ||
280 | omap_board_config_size = ARRAY_SIZE(apollon_config); | ||
281 | omap2_init_common_infrastructure(); | 279 | omap2_init_common_infrastructure(); |
282 | omap2_init_common_devices(NULL, NULL); | 280 | omap2_init_common_devices(NULL, NULL); |
283 | omap_init_irq(); | ||
284 | } | 281 | } |
285 | 282 | ||
286 | static void __init apollon_led_init(void) | 283 | static void __init apollon_led_init(void) |
@@ -320,6 +317,8 @@ static void __init omap_apollon_init(void) | |||
320 | u32 v; | 317 | u32 v; |
321 | 318 | ||
322 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 319 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
320 | omap_board_config = apollon_config; | ||
321 | omap_board_config_size = ARRAY_SIZE(apollon_config); | ||
323 | 322 | ||
324 | apollon_init_smc91x(); | 323 | apollon_init_smc91x(); |
325 | apollon_led_init(); | 324 | apollon_led_init(); |
@@ -355,9 +354,10 @@ static void __init omap_apollon_map_io(void) | |||
355 | MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") | 354 | MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") |
356 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ | 355 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ |
357 | .boot_params = 0x80000100, | 356 | .boot_params = 0x80000100, |
358 | .map_io = omap_apollon_map_io, | ||
359 | .reserve = omap_reserve, | 357 | .reserve = omap_reserve, |
360 | .init_irq = omap_apollon_init_irq, | 358 | .map_io = omap_apollon_map_io, |
359 | .init_early = omap_apollon_init_early, | ||
360 | .init_irq = omap_init_irq, | ||
361 | .init_machine = omap_apollon_init, | 361 | .init_machine = omap_apollon_init, |
362 | .timer = &omap_timer, | 362 | .timer = &omap_timer, |
363 | MACHINE_END | 363 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 9be7289cbb56..7b5647954c13 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = { | |||
401 | .default_device = &cm_t35_dvi_device, | 401 | .default_device = &cm_t35_dvi_device, |
402 | }; | 402 | }; |
403 | 403 | ||
404 | static struct platform_device cm_t35_dss_device = { | ||
405 | .name = "omapdss", | ||
406 | .id = -1, | ||
407 | .dev = { | ||
408 | .platform_data = &cm_t35_dss_data, | ||
409 | }, | ||
410 | }; | ||
411 | |||
412 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { | 404 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { |
413 | .turbo_mode = 0, | 405 | .turbo_mode = 0, |
414 | .single_channel = 1, /* 0: slave, 1: master */ | 406 | .single_channel = 1, /* 0: slave, 1: master */ |
@@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void) | |||
468 | msleep(50); | 460 | msleep(50); |
469 | gpio_set_value(lcd_en_gpio, 1); | 461 | gpio_set_value(lcd_en_gpio, 1); |
470 | 462 | ||
471 | err = platform_device_register(&cm_t35_dss_device); | 463 | err = omap_display_init(&cm_t35_dss_data); |
472 | if (err) { | 464 | if (err) { |
473 | pr_err("CM-T35: failed to register DSS device\n"); | 465 | pr_err("CM-T35: failed to register DSS device\n"); |
474 | goto err_dev_reg; | 466 | goto err_dev_reg; |
@@ -495,15 +487,11 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = { | |||
495 | .supply = "vmmc_aux", | 487 | .supply = "vmmc_aux", |
496 | }; | 488 | }; |
497 | 489 | ||
498 | static struct regulator_consumer_supply cm_t35_vdac_supply = { | 490 | static struct regulator_consumer_supply cm_t35_vdac_supply = |
499 | .supply = "vdda_dac", | 491 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
500 | .dev = &cm_t35_dss_device.dev, | ||
501 | }; | ||
502 | 492 | ||
503 | static struct regulator_consumer_supply cm_t35_vdvi_supply = { | 493 | static struct regulator_consumer_supply cm_t35_vdvi_supply = |
504 | .supply = "vdvi", | 494 | REGULATOR_SUPPLY("vdvi", "omapdss"); |
505 | .dev = &cm_t35_dss_device.dev, | ||
506 | }; | ||
507 | 495 | ||
508 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 496 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
509 | static struct regulator_init_data cm_t35_vmmc1 = { | 497 | static struct regulator_init_data cm_t35_vmmc1 = { |
@@ -680,20 +668,14 @@ static void __init cm_t35_init_i2c(void) | |||
680 | ARRAY_SIZE(cm_t35_i2c_boardinfo)); | 668 | ARRAY_SIZE(cm_t35_i2c_boardinfo)); |
681 | } | 669 | } |
682 | 670 | ||
683 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { | 671 | static void __init cm_t35_init_early(void) |
684 | }; | ||
685 | |||
686 | static void __init cm_t35_init_irq(void) | ||
687 | { | 672 | { |
688 | omap_board_config = cm_t35_config; | ||
689 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | ||
690 | |||
691 | omap2_init_common_infrastructure(); | 673 | omap2_init_common_infrastructure(); |
692 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 674 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
693 | mt46h32m32lf6_sdrc_params); | 675 | mt46h32m32lf6_sdrc_params); |
694 | omap_init_irq(); | ||
695 | } | 676 | } |
696 | 677 | ||
678 | #ifdef CONFIG_OMAP_MUX | ||
697 | static struct omap_board_mux board_mux[] __initdata = { | 679 | static struct omap_board_mux board_mux[] __initdata = { |
698 | /* nCS and IRQ for CM-T35 ethernet */ | 680 | /* nCS and IRQ for CM-T35 ethernet */ |
699 | OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0), | 681 | OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0), |
@@ -791,6 +773,7 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
791 | 773 | ||
792 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 774 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
793 | }; | 775 | }; |
776 | #endif | ||
794 | 777 | ||
795 | static struct omap_musb_board_data musb_board_data = { | 778 | static struct omap_musb_board_data musb_board_data = { |
796 | .interface_type = MUSB_INTERFACE_ULPI, | 779 | .interface_type = MUSB_INTERFACE_ULPI, |
@@ -798,8 +781,13 @@ static struct omap_musb_board_data musb_board_data = { | |||
798 | .power = 100, | 781 | .power = 100, |
799 | }; | 782 | }; |
800 | 783 | ||
784 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { | ||
785 | }; | ||
786 | |||
801 | static void __init cm_t35_init(void) | 787 | static void __init cm_t35_init(void) |
802 | { | 788 | { |
789 | omap_board_config = cm_t35_config; | ||
790 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | ||
803 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 791 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
804 | omap_serial_init(); | 792 | omap_serial_init(); |
805 | cm_t35_init_i2c(); | 793 | cm_t35_init_i2c(); |
@@ -815,9 +803,10 @@ static void __init cm_t35_init(void) | |||
815 | 803 | ||
816 | MACHINE_START(CM_T35, "Compulab CM-T35") | 804 | MACHINE_START(CM_T35, "Compulab CM-T35") |
817 | .boot_params = 0x80000100, | 805 | .boot_params = 0x80000100, |
818 | .map_io = omap3_map_io, | ||
819 | .reserve = omap_reserve, | 806 | .reserve = omap_reserve, |
820 | .init_irq = cm_t35_init_irq, | 807 | .map_io = omap3_map_io, |
808 | .init_early = cm_t35_init_early, | ||
809 | .init_irq = omap_init_irq, | ||
821 | .init_machine = cm_t35_init, | 810 | .init_machine = cm_t35_init, |
822 | .timer = &omap_timer, | 811 | .timer = &omap_timer, |
823 | MACHINE_END | 812 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 8e18dc76b11e..a27e3eee8292 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -254,16 +254,13 @@ static inline void cm_t3517_init_nand(void) {} | |||
254 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | 254 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { |
255 | }; | 255 | }; |
256 | 256 | ||
257 | static void __init cm_t3517_init_irq(void) | 257 | static void __init cm_t3517_init_early(void) |
258 | { | 258 | { |
259 | omap_board_config = cm_t3517_config; | ||
260 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
261 | |||
262 | omap2_init_common_infrastructure(); | 259 | omap2_init_common_infrastructure(); |
263 | omap2_init_common_devices(NULL, NULL); | 260 | omap2_init_common_devices(NULL, NULL); |
264 | omap_init_irq(); | ||
265 | } | 261 | } |
266 | 262 | ||
263 | #ifdef CONFIG_OMAP_MUX | ||
267 | static struct omap_board_mux board_mux[] __initdata = { | 264 | static struct omap_board_mux board_mux[] __initdata = { |
268 | /* GPIO186 - Green LED */ | 265 | /* GPIO186 - Green LED */ |
269 | OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 266 | OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
@@ -289,11 +286,14 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
289 | 286 | ||
290 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 287 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
291 | }; | 288 | }; |
289 | #endif | ||
292 | 290 | ||
293 | static void __init cm_t3517_init(void) | 291 | static void __init cm_t3517_init(void) |
294 | { | 292 | { |
295 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 293 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
296 | omap_serial_init(); | 294 | omap_serial_init(); |
295 | omap_board_config = cm_t3517_config; | ||
296 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
297 | cm_t3517_init_leds(); | 297 | cm_t3517_init_leds(); |
298 | cm_t3517_init_nand(); | 298 | cm_t3517_init_nand(); |
299 | cm_t3517_init_rtc(); | 299 | cm_t3517_init_rtc(); |
@@ -303,9 +303,10 @@ static void __init cm_t3517_init(void) | |||
303 | 303 | ||
304 | MACHINE_START(CM_T3517, "Compulab CM-T3517") | 304 | MACHINE_START(CM_T3517, "Compulab CM-T3517") |
305 | .boot_params = 0x80000100, | 305 | .boot_params = 0x80000100, |
306 | .map_io = omap3_map_io, | ||
307 | .reserve = omap_reserve, | 306 | .reserve = omap_reserve, |
308 | .init_irq = cm_t3517_init_irq, | 307 | .map_io = omap3_map_io, |
308 | .init_early = cm_t3517_init_early, | ||
309 | .init_irq = omap_init_irq, | ||
309 | .init_machine = cm_t3517_init, | 310 | .init_machine = cm_t3517_init, |
310 | .timer = &omap_timer, | 311 | .timer = &omap_timer, |
311 | MACHINE_END | 312 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index bc0141b98694..aa27483c493e 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -140,7 +140,7 @@ static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) | |||
140 | } | 140 | } |
141 | 141 | ||
142 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = | 142 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = |
143 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 143 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
144 | 144 | ||
145 | 145 | ||
146 | /* ads7846 on SPI */ | 146 | /* ads7846 on SPI */ |
@@ -195,14 +195,6 @@ static struct omap_dss_board_info devkit8000_dss_data = { | |||
195 | .default_device = &devkit8000_lcd_device, | 195 | .default_device = &devkit8000_lcd_device, |
196 | }; | 196 | }; |
197 | 197 | ||
198 | static struct platform_device devkit8000_dss_device = { | ||
199 | .name = "omapdss", | ||
200 | .id = -1, | ||
201 | .dev = { | ||
202 | .platform_data = &devkit8000_dss_data, | ||
203 | }, | ||
204 | }; | ||
205 | |||
206 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = | 198 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = |
207 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 199 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
208 | 200 | ||
@@ -350,9 +342,7 @@ static struct twl4030_usb_data devkit8000_usb_data = { | |||
350 | .usb_mode = T2_USB_MODE_ULPI, | 342 | .usb_mode = T2_USB_MODE_ULPI, |
351 | }; | 343 | }; |
352 | 344 | ||
353 | static struct twl4030_codec_audio_data devkit8000_audio_data = { | 345 | static struct twl4030_codec_audio_data devkit8000_audio_data; |
354 | .audio_mclk = 26000000, | ||
355 | }; | ||
356 | 346 | ||
357 | static struct twl4030_codec_data devkit8000_codec_data = { | 347 | static struct twl4030_codec_data devkit8000_codec_data = { |
358 | .audio_mclk = 26000000, | 348 | .audio_mclk = 26000000, |
@@ -456,11 +446,15 @@ static struct platform_device keys_gpio = { | |||
456 | }; | 446 | }; |
457 | 447 | ||
458 | 448 | ||
459 | static void __init devkit8000_init_irq(void) | 449 | static void __init devkit8000_init_early(void) |
460 | { | 450 | { |
461 | omap2_init_common_infrastructure(); | 451 | omap2_init_common_infrastructure(); |
462 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 452 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
463 | mt46h32m32lf6_sdrc_params); | 453 | mt46h32m32lf6_sdrc_params); |
454 | } | ||
455 | |||
456 | static void __init devkit8000_init_irq(void) | ||
457 | { | ||
464 | omap_init_irq(); | 458 | omap_init_irq(); |
465 | #ifdef CONFIG_OMAP_32K_TIMER | 459 | #ifdef CONFIG_OMAP_32K_TIMER |
466 | omap2_gp_clockevent_set_gptimer(12); | 460 | omap2_gp_clockevent_set_gptimer(12); |
@@ -575,7 +569,6 @@ static void __init omap_dm9000_init(void) | |||
575 | } | 569 | } |
576 | 570 | ||
577 | static struct platform_device *devkit8000_devices[] __initdata = { | 571 | static struct platform_device *devkit8000_devices[] __initdata = { |
578 | &devkit8000_dss_device, | ||
579 | &leds_gpio, | 572 | &leds_gpio, |
580 | &keys_gpio, | 573 | &keys_gpio, |
581 | &omap_dm9000_dev, | 574 | &omap_dm9000_dev, |
@@ -632,6 +625,7 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
632 | .reset_gpio_port[2] = -EINVAL | 625 | .reset_gpio_port[2] = -EINVAL |
633 | }; | 626 | }; |
634 | 627 | ||
628 | #ifdef CONFIG_OMAP_MUX | ||
635 | static struct omap_board_mux board_mux[] __initdata = { | 629 | static struct omap_board_mux board_mux[] __initdata = { |
636 | /* nCS and IRQ for Devkit8000 ethernet */ | 630 | /* nCS and IRQ for Devkit8000 ethernet */ |
637 | OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE0), | 631 | OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE0), |
@@ -785,6 +779,7 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
785 | 779 | ||
786 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 780 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
787 | }; | 781 | }; |
782 | #endif | ||
788 | 783 | ||
789 | static void __init devkit8000_init(void) | 784 | static void __init devkit8000_init(void) |
790 | { | 785 | { |
@@ -797,6 +792,7 @@ static void __init devkit8000_init(void) | |||
797 | platform_add_devices(devkit8000_devices, | 792 | platform_add_devices(devkit8000_devices, |
798 | ARRAY_SIZE(devkit8000_devices)); | 793 | ARRAY_SIZE(devkit8000_devices)); |
799 | 794 | ||
795 | omap_display_init(&devkit8000_dss_data); | ||
800 | spi_register_board_info(devkit8000_spi_board_info, | 796 | spi_register_board_info(devkit8000_spi_board_info, |
801 | ARRAY_SIZE(devkit8000_spi_board_info)); | 797 | ARRAY_SIZE(devkit8000_spi_board_info)); |
802 | 798 | ||
@@ -813,8 +809,9 @@ static void __init devkit8000_init(void) | |||
813 | 809 | ||
814 | MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") | 810 | MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") |
815 | .boot_params = 0x80000100, | 811 | .boot_params = 0x80000100, |
816 | .map_io = omap3_map_io, | ||
817 | .reserve = omap_reserve, | 812 | .reserve = omap_reserve, |
813 | .map_io = omap3_map_io, | ||
814 | .init_early = devkit8000_init_early, | ||
818 | .init_irq = devkit8000_init_irq, | 815 | .init_irq = devkit8000_init_irq, |
819 | .init_machine = devkit8000_init, | 816 | .init_machine = devkit8000_init, |
820 | .timer = &omap_timer, | 817 | .timer = &omap_timer, |
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index fd38c05bb47f..729892fdcf2e 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * board-sdp-flash.c | 2 | * board-flash.c |
3 | * Modified from mach-omap2/board-3430sdp-flash.c | 3 | * Modified from mach-omap2/board-3430sdp-flash.c |
4 | * | 4 | * |
5 | * Copyright (C) 2009 Nokia Corporation | 5 | * Copyright (C) 2009 Nokia Corporation |
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <plat/irqs.h> | ||
19 | 20 | ||
20 | #include <plat/gpmc.h> | 21 | #include <plat/gpmc.h> |
21 | #include <plat/nand.h> | 22 | #include <plat/nand.h> |
@@ -73,11 +74,11 @@ __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) | |||
73 | + FLASH_SIZE_SDPV1 - 1; | 74 | + FLASH_SIZE_SDPV1 - 1; |
74 | } | 75 | } |
75 | if (err < 0) { | 76 | if (err < 0) { |
76 | printk(KERN_ERR "NOR: Can't request GPMC CS\n"); | 77 | pr_err("NOR: Can't request GPMC CS\n"); |
77 | return; | 78 | return; |
78 | } | 79 | } |
79 | if (platform_device_register(&board_nor_device) < 0) | 80 | if (platform_device_register(&board_nor_device) < 0) |
80 | printk(KERN_ERR "Unable to register NOR device\n"); | 81 | pr_err("Unable to register NOR device\n"); |
81 | } | 82 | } |
82 | 83 | ||
83 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | 84 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ |
@@ -139,17 +140,21 @@ static struct omap_nand_platform_data board_nand_data = { | |||
139 | }; | 140 | }; |
140 | 141 | ||
141 | void | 142 | void |
142 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) | 143 | __init board_nand_init(struct mtd_partition *nand_parts, |
144 | u8 nr_parts, u8 cs, int nand_type) | ||
143 | { | 145 | { |
144 | board_nand_data.cs = cs; | 146 | board_nand_data.cs = cs; |
145 | board_nand_data.parts = nand_parts; | 147 | board_nand_data.parts = nand_parts; |
146 | board_nand_data.nr_parts = nr_parts; | 148 | board_nand_data.nr_parts = nr_parts; |
149 | board_nand_data.devsize = nand_type; | ||
147 | 150 | ||
151 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; | ||
152 | board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs; | ||
148 | gpmc_nand_init(&board_nand_data); | 153 | gpmc_nand_init(&board_nand_data); |
149 | } | 154 | } |
150 | #else | 155 | #else |
151 | void | 156 | void |
152 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) | 157 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type) |
153 | { | 158 | { |
154 | } | 159 | } |
155 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | 160 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ |
@@ -189,12 +194,12 @@ unmap: | |||
189 | } | 194 | } |
190 | 195 | ||
191 | /** | 196 | /** |
192 | * sdp3430_flash_init - Identify devices connected to GPMC and register. | 197 | * board_flash_init - Identify devices connected to GPMC and register. |
193 | * | 198 | * |
194 | * @return - void. | 199 | * @return - void. |
195 | */ | 200 | */ |
196 | void board_flash_init(struct flash_partitions partition_info[], | 201 | void board_flash_init(struct flash_partitions partition_info[], |
197 | char chip_sel_board[][GPMC_CS_NUM]) | 202 | char chip_sel_board[][GPMC_CS_NUM], int nand_type) |
198 | { | 203 | { |
199 | u8 cs = 0; | 204 | u8 cs = 0; |
200 | u8 norcs = GPMC_CS_NUM + 1; | 205 | u8 norcs = GPMC_CS_NUM + 1; |
@@ -208,7 +213,7 @@ void board_flash_init(struct flash_partitions partition_info[], | |||
208 | */ | 213 | */ |
209 | idx = get_gpmc0_type(); | 214 | idx = get_gpmc0_type(); |
210 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { | 215 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { |
211 | printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); | 216 | pr_err("%s: Invalid chip select: %d\n", __func__, cs); |
212 | return; | 217 | return; |
213 | } | 218 | } |
214 | config_sel = (unsigned char *)(chip_sel_board[idx]); | 219 | config_sel = (unsigned char *)(chip_sel_board[idx]); |
@@ -232,23 +237,20 @@ void board_flash_init(struct flash_partitions partition_info[], | |||
232 | } | 237 | } |
233 | 238 | ||
234 | if (norcs > GPMC_CS_NUM) | 239 | if (norcs > GPMC_CS_NUM) |
235 | printk(KERN_INFO "NOR: Unable to find configuration " | 240 | pr_err("NOR: Unable to find configuration in GPMC\n"); |
236 | "in GPMC\n"); | ||
237 | else | 241 | else |
238 | board_nor_init(partition_info[0].parts, | 242 | board_nor_init(partition_info[0].parts, |
239 | partition_info[0].nr_parts, norcs); | 243 | partition_info[0].nr_parts, norcs); |
240 | 244 | ||
241 | if (onenandcs > GPMC_CS_NUM) | 245 | if (onenandcs > GPMC_CS_NUM) |
242 | printk(KERN_INFO "OneNAND: Unable to find configuration " | 246 | pr_err("OneNAND: Unable to find configuration in GPMC\n"); |
243 | "in GPMC\n"); | ||
244 | else | 247 | else |
245 | board_onenand_init(partition_info[1].parts, | 248 | board_onenand_init(partition_info[1].parts, |
246 | partition_info[1].nr_parts, onenandcs); | 249 | partition_info[1].nr_parts, onenandcs); |
247 | 250 | ||
248 | if (nandcs > GPMC_CS_NUM) | 251 | if (nandcs > GPMC_CS_NUM) |
249 | printk(KERN_INFO "NAND: Unable to find configuration " | 252 | pr_err("NAND: Unable to find configuration in GPMC\n"); |
250 | "in GPMC\n"); | ||
251 | else | 253 | else |
252 | board_nand_init(partition_info[2].parts, | 254 | board_nand_init(partition_info[2].parts, |
253 | partition_info[2].nr_parts, nandcs); | 255 | partition_info[2].nr_parts, nandcs, nand_type); |
254 | } | 256 | } |
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h index 69befe00dd2f..c240a3f8d163 100644 --- a/arch/arm/mach-omap2/board-flash.h +++ b/arch/arm/mach-omap2/board-flash.h | |||
@@ -25,6 +25,6 @@ struct flash_partitions { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | extern void board_flash_init(struct flash_partitions [], | 27 | extern void board_flash_init(struct flash_partitions [], |
28 | char chip_sel[][GPMC_CS_NUM]); | 28 | char chip_sel[][GPMC_CS_NUM], int nand_type); |
29 | extern void board_nand_init(struct mtd_partition *nand_parts, | 29 | extern void board_nand_init(struct mtd_partition *nand_parts, |
30 | u8 nr_parts, u8 cs); | 30 | u8 nr_parts, u8 cs, int nand_type); |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 0e3d81e09f89..73e3c31e8508 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -33,18 +33,17 @@ | |||
33 | static struct omap_board_config_kernel generic_config[] = { | 33 | static struct omap_board_config_kernel generic_config[] = { |
34 | }; | 34 | }; |
35 | 35 | ||
36 | static void __init omap_generic_init_irq(void) | 36 | static void __init omap_generic_init_early(void) |
37 | { | 37 | { |
38 | omap_board_config = generic_config; | ||
39 | omap_board_config_size = ARRAY_SIZE(generic_config); | ||
40 | omap2_init_common_infrastructure(); | 38 | omap2_init_common_infrastructure(); |
41 | omap2_init_common_devices(NULL, NULL); | 39 | omap2_init_common_devices(NULL, NULL); |
42 | omap_init_irq(); | ||
43 | } | 40 | } |
44 | 41 | ||
45 | static void __init omap_generic_init(void) | 42 | static void __init omap_generic_init(void) |
46 | { | 43 | { |
47 | omap_serial_init(); | 44 | omap_serial_init(); |
45 | omap_board_config = generic_config; | ||
46 | omap_board_config_size = ARRAY_SIZE(generic_config); | ||
48 | } | 47 | } |
49 | 48 | ||
50 | static void __init omap_generic_map_io(void) | 49 | static void __init omap_generic_map_io(void) |
@@ -68,9 +67,10 @@ static void __init omap_generic_map_io(void) | |||
68 | MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") | 67 | MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") |
69 | /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ | 68 | /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ |
70 | .boot_params = 0x80000100, | 69 | .boot_params = 0x80000100, |
71 | .map_io = omap_generic_map_io, | ||
72 | .reserve = omap_reserve, | 70 | .reserve = omap_reserve, |
73 | .init_irq = omap_generic_init_irq, | 71 | .map_io = omap_generic_map_io, |
72 | .init_early = omap_generic_init_early, | ||
73 | .init_irq = omap_init_irq, | ||
74 | .init_machine = omap_generic_init, | 74 | .init_machine = omap_generic_init, |
75 | .timer = &omap_timer, | 75 | .timer = &omap_timer, |
76 | MACHINE_END | 76 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 25cc9dad4b02..bac7933b8cbb 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -290,14 +290,15 @@ static struct omap_board_config_kernel h4_config[] __initdata = { | |||
290 | { OMAP_TAG_LCD, &h4_lcd_config }, | 290 | { OMAP_TAG_LCD, &h4_lcd_config }, |
291 | }; | 291 | }; |
292 | 292 | ||
293 | static void __init omap_h4_init_irq(void) | 293 | static void __init omap_h4_init_early(void) |
294 | { | 294 | { |
295 | omap_board_config = h4_config; | ||
296 | omap_board_config_size = ARRAY_SIZE(h4_config); | ||
297 | omap2_init_common_infrastructure(); | 295 | omap2_init_common_infrastructure(); |
298 | omap2_init_common_devices(NULL, NULL); | 296 | omap2_init_common_devices(NULL, NULL); |
297 | } | ||
298 | |||
299 | static void __init omap_h4_init_irq(void) | ||
300 | { | ||
299 | omap_init_irq(); | 301 | omap_init_irq(); |
300 | h4_init_flash(); | ||
301 | } | 302 | } |
302 | 303 | ||
303 | static struct at24_platform_data m24c01 = { | 304 | static struct at24_platform_data m24c01 = { |
@@ -330,6 +331,9 @@ static void __init omap_h4_init(void) | |||
330 | { | 331 | { |
331 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); | 332 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); |
332 | 333 | ||
334 | omap_board_config = h4_config; | ||
335 | omap_board_config_size = ARRAY_SIZE(h4_config); | ||
336 | |||
333 | /* | 337 | /* |
334 | * Make sure the serial ports are muxed on at this point. | 338 | * Make sure the serial ports are muxed on at this point. |
335 | * You have to mux them off in device drivers later on | 339 | * You have to mux them off in device drivers later on |
@@ -367,6 +371,7 @@ static void __init omap_h4_init(void) | |||
367 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); | 371 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); |
368 | omap2_usbfs_init(&h4_usb_config); | 372 | omap2_usbfs_init(&h4_usb_config); |
369 | omap_serial_init(); | 373 | omap_serial_init(); |
374 | h4_init_flash(); | ||
370 | } | 375 | } |
371 | 376 | ||
372 | static void __init omap_h4_map_io(void) | 377 | static void __init omap_h4_map_io(void) |
@@ -378,8 +383,9 @@ static void __init omap_h4_map_io(void) | |||
378 | MACHINE_START(OMAP_H4, "OMAP2420 H4 board") | 383 | MACHINE_START(OMAP_H4, "OMAP2420 H4 board") |
379 | /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ | 384 | /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ |
380 | .boot_params = 0x80000100, | 385 | .boot_params = 0x80000100, |
381 | .map_io = omap_h4_map_io, | ||
382 | .reserve = omap_reserve, | 386 | .reserve = omap_reserve, |
387 | .map_io = omap_h4_map_io, | ||
388 | .init_early = omap_h4_init_early, | ||
383 | .init_irq = omap_h4_init_irq, | 389 | .init_irq = omap_h4_init_irq, |
384 | .init_machine = omap_h4_init, | 390 | .init_machine = omap_h4_init, |
385 | .timer = &omap_timer, | 391 | .timer = &omap_timer, |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index f9f534419311..d3199b4ecdb6 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -250,7 +250,7 @@ static inline void __init igep2_init_smsc911x(void) { } | |||
250 | #endif | 250 | #endif |
251 | 251 | ||
252 | static struct regulator_consumer_supply igep2_vmmc1_supply = | 252 | static struct regulator_consumer_supply igep2_vmmc1_supply = |
253 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 253 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
254 | 254 | ||
255 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 255 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
256 | static struct regulator_init_data igep2_vmmc1 = { | 256 | static struct regulator_init_data igep2_vmmc1 = { |
@@ -268,7 +268,7 @@ static struct regulator_init_data igep2_vmmc1 = { | |||
268 | }; | 268 | }; |
269 | 269 | ||
270 | static struct regulator_consumer_supply igep2_vio_supply = | 270 | static struct regulator_consumer_supply igep2_vio_supply = |
271 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | 271 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); |
272 | 272 | ||
273 | static struct regulator_init_data igep2_vio = { | 273 | static struct regulator_init_data igep2_vio = { |
274 | .constraints = { | 274 | .constraints = { |
@@ -286,7 +286,7 @@ static struct regulator_init_data igep2_vio = { | |||
286 | }; | 286 | }; |
287 | 287 | ||
288 | static struct regulator_consumer_supply igep2_vmmc2_supply = | 288 | static struct regulator_consumer_supply igep2_vmmc2_supply = |
289 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 289 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
290 | 290 | ||
291 | static struct regulator_init_data igep2_vmmc2 = { | 291 | static struct regulator_init_data igep2_vmmc2 = { |
292 | .constraints = { | 292 | .constraints = { |
@@ -485,18 +485,8 @@ static struct omap_dss_board_info igep2_dss_data = { | |||
485 | .default_device = &igep2_dvi_device, | 485 | .default_device = &igep2_dvi_device, |
486 | }; | 486 | }; |
487 | 487 | ||
488 | static struct platform_device igep2_dss_device = { | 488 | static struct regulator_consumer_supply igep2_vpll2_supply = |
489 | .name = "omapdss", | 489 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); |
490 | .id = -1, | ||
491 | .dev = { | ||
492 | .platform_data = &igep2_dss_data, | ||
493 | }, | ||
494 | }; | ||
495 | |||
496 | static struct regulator_consumer_supply igep2_vpll2_supply = { | ||
497 | .supply = "vdds_dsi", | ||
498 | .dev = &igep2_dss_device.dev, | ||
499 | }; | ||
500 | 490 | ||
501 | static struct regulator_init_data igep2_vpll2 = { | 491 | static struct regulator_init_data igep2_vpll2 = { |
502 | .constraints = { | 492 | .constraints = { |
@@ -521,21 +511,17 @@ static void __init igep2_display_init(void) | |||
521 | } | 511 | } |
522 | 512 | ||
523 | static struct platform_device *igep2_devices[] __initdata = { | 513 | static struct platform_device *igep2_devices[] __initdata = { |
524 | &igep2_dss_device, | ||
525 | &igep2_vwlan_device, | 514 | &igep2_vwlan_device, |
526 | }; | 515 | }; |
527 | 516 | ||
528 | static void __init igep2_init_irq(void) | 517 | static void __init igep2_init_early(void) |
529 | { | 518 | { |
530 | omap2_init_common_infrastructure(); | 519 | omap2_init_common_infrastructure(); |
531 | omap2_init_common_devices(m65kxxxxam_sdrc_params, | 520 | omap2_init_common_devices(m65kxxxxam_sdrc_params, |
532 | m65kxxxxam_sdrc_params); | 521 | m65kxxxxam_sdrc_params); |
533 | omap_init_irq(); | ||
534 | } | 522 | } |
535 | 523 | ||
536 | static struct twl4030_codec_audio_data igep2_audio_data = { | 524 | static struct twl4030_codec_audio_data igep2_audio_data; |
537 | .audio_mclk = 26000000, | ||
538 | }; | ||
539 | 525 | ||
540 | static struct twl4030_codec_data igep2_codec_data = { | 526 | static struct twl4030_codec_data igep2_codec_data = { |
541 | .audio_mclk = 26000000, | 527 | .audio_mclk = 26000000, |
@@ -697,6 +683,7 @@ static void __init igep2_init(void) | |||
697 | /* Register I2C busses and drivers */ | 683 | /* Register I2C busses and drivers */ |
698 | igep2_i2c_init(); | 684 | igep2_i2c_init(); |
699 | platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); | 685 | platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); |
686 | omap_display_init(&igep2_dss_data); | ||
700 | omap_serial_init(); | 687 | omap_serial_init(); |
701 | usb_musb_init(&musb_board_data); | 688 | usb_musb_init(&musb_board_data); |
702 | usbhs_init(&usbhs_bdata); | 689 | usbhs_init(&usbhs_bdata); |
@@ -716,9 +703,10 @@ static void __init igep2_init(void) | |||
716 | 703 | ||
717 | MACHINE_START(IGEP0020, "IGEP v2 board") | 704 | MACHINE_START(IGEP0020, "IGEP v2 board") |
718 | .boot_params = 0x80000100, | 705 | .boot_params = 0x80000100, |
719 | .map_io = omap3_map_io, | ||
720 | .reserve = omap_reserve, | 706 | .reserve = omap_reserve, |
721 | .init_irq = igep2_init_irq, | 707 | .map_io = omap3_map_io, |
708 | .init_early = igep2_init_early, | ||
709 | .init_irq = omap_init_irq, | ||
722 | .init_machine = igep2_init, | 710 | .init_machine = igep2_init, |
723 | .timer = &omap_timer, | 711 | .timer = &omap_timer, |
724 | MACHINE_END | 712 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c index 579fc2d2525f..b10db0e6ee62 100644 --- a/arch/arm/mach-omap2/board-igep0030.c +++ b/arch/arm/mach-omap2/board-igep0030.c | |||
@@ -142,7 +142,7 @@ static void __init igep3_flash_init(void) {} | |||
142 | #endif | 142 | #endif |
143 | 143 | ||
144 | static struct regulator_consumer_supply igep3_vmmc1_supply = | 144 | static struct regulator_consumer_supply igep3_vmmc1_supply = |
145 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 145 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
146 | 146 | ||
147 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 147 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
148 | static struct regulator_init_data igep3_vmmc1 = { | 148 | static struct regulator_init_data igep3_vmmc1 = { |
@@ -160,7 +160,7 @@ static struct regulator_init_data igep3_vmmc1 = { | |||
160 | }; | 160 | }; |
161 | 161 | ||
162 | static struct regulator_consumer_supply igep3_vio_supply = | 162 | static struct regulator_consumer_supply igep3_vio_supply = |
163 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | 163 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); |
164 | 164 | ||
165 | static struct regulator_init_data igep3_vio = { | 165 | static struct regulator_init_data igep3_vio = { |
166 | .constraints = { | 166 | .constraints = { |
@@ -178,7 +178,7 @@ static struct regulator_init_data igep3_vio = { | |||
178 | }; | 178 | }; |
179 | 179 | ||
180 | static struct regulator_consumer_supply igep3_vmmc2_supply = | 180 | static struct regulator_consumer_supply igep3_vmmc2_supply = |
181 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 181 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
182 | 182 | ||
183 | static struct regulator_init_data igep3_vmmc2 = { | 183 | static struct regulator_init_data igep3_vmmc2 = { |
184 | .constraints = { | 184 | .constraints = { |
@@ -331,12 +331,11 @@ static struct platform_device *igep3_devices[] __initdata = { | |||
331 | &igep3_vwlan_device, | 331 | &igep3_vwlan_device, |
332 | }; | 332 | }; |
333 | 333 | ||
334 | static void __init igep3_init_irq(void) | 334 | static void __init igep3_init_early(void) |
335 | { | 335 | { |
336 | omap2_init_common_infrastructure(); | 336 | omap2_init_common_infrastructure(); |
337 | omap2_init_common_devices(m65kxxxxam_sdrc_params, | 337 | omap2_init_common_devices(m65kxxxxam_sdrc_params, |
338 | m65kxxxxam_sdrc_params); | 338 | m65kxxxxam_sdrc_params); |
339 | omap_init_irq(); | ||
340 | } | 339 | } |
341 | 340 | ||
342 | static struct twl4030_platform_data igep3_twl4030_pdata = { | 341 | static struct twl4030_platform_data igep3_twl4030_pdata = { |
@@ -452,7 +451,8 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module") | |||
452 | .boot_params = 0x80000100, | 451 | .boot_params = 0x80000100, |
453 | .reserve = omap_reserve, | 452 | .reserve = omap_reserve, |
454 | .map_io = omap3_map_io, | 453 | .map_io = omap3_map_io, |
455 | .init_irq = igep3_init_irq, | 454 | .init_early = igep3_init_early, |
455 | .init_irq = omap_init_irq, | ||
456 | .init_machine = igep3_init, | 456 | .init_machine = igep3_init, |
457 | .timer = &omap_timer, | 457 | .timer = &omap_timer, |
458 | MACHINE_END | 458 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index e5dc74875f9d..e2ba77957a8c 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -288,13 +288,10 @@ static struct omap_board_config_kernel ldp_config[] __initdata = { | |||
288 | { OMAP_TAG_LCD, &ldp_lcd_config }, | 288 | { OMAP_TAG_LCD, &ldp_lcd_config }, |
289 | }; | 289 | }; |
290 | 290 | ||
291 | static void __init omap_ldp_init_irq(void) | 291 | static void __init omap_ldp_init_early(void) |
292 | { | 292 | { |
293 | omap_board_config = ldp_config; | ||
294 | omap_board_config_size = ARRAY_SIZE(ldp_config); | ||
295 | omap2_init_common_infrastructure(); | 293 | omap2_init_common_infrastructure(); |
296 | omap2_init_common_devices(NULL, NULL); | 294 | omap2_init_common_devices(NULL, NULL); |
297 | omap_init_irq(); | ||
298 | } | 295 | } |
299 | 296 | ||
300 | static struct twl4030_usb_data ldp_usb_data = { | 297 | static struct twl4030_usb_data ldp_usb_data = { |
@@ -330,6 +327,26 @@ static struct regulator_init_data ldp_vmmc1 = { | |||
330 | .consumer_supplies = &ldp_vmmc1_supply, | 327 | .consumer_supplies = &ldp_vmmc1_supply, |
331 | }; | 328 | }; |
332 | 329 | ||
330 | /* ads7846 on SPI */ | ||
331 | static struct regulator_consumer_supply ldp_vaux1_supplies[] = { | ||
332 | REGULATOR_SUPPLY("vcc", "spi1.0"), | ||
333 | }; | ||
334 | |||
335 | /* VAUX1 */ | ||
336 | static struct regulator_init_data ldp_vaux1 = { | ||
337 | .constraints = { | ||
338 | .min_uV = 3000000, | ||
339 | .max_uV = 3000000, | ||
340 | .apply_uV = true, | ||
341 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
342 | | REGULATOR_MODE_STANDBY, | ||
343 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
344 | | REGULATOR_CHANGE_STATUS, | ||
345 | }, | ||
346 | .num_consumer_supplies = ARRAY_SIZE(ldp_vaux1_supplies), | ||
347 | .consumer_supplies = ldp_vaux1_supplies, | ||
348 | }; | ||
349 | |||
333 | static struct twl4030_platform_data ldp_twldata = { | 350 | static struct twl4030_platform_data ldp_twldata = { |
334 | .irq_base = TWL4030_IRQ_BASE, | 351 | .irq_base = TWL4030_IRQ_BASE, |
335 | .irq_end = TWL4030_IRQ_END, | 352 | .irq_end = TWL4030_IRQ_END, |
@@ -338,6 +355,7 @@ static struct twl4030_platform_data ldp_twldata = { | |||
338 | .madc = &ldp_madc_data, | 355 | .madc = &ldp_madc_data, |
339 | .usb = &ldp_usb_data, | 356 | .usb = &ldp_usb_data, |
340 | .vmmc1 = &ldp_vmmc1, | 357 | .vmmc1 = &ldp_vmmc1, |
358 | .vaux1 = &ldp_vaux1, | ||
341 | .gpio = &ldp_gpio_data, | 359 | .gpio = &ldp_gpio_data, |
342 | .keypad = &ldp_kp_twl4030_data, | 360 | .keypad = &ldp_kp_twl4030_data, |
343 | }; | 361 | }; |
@@ -423,6 +441,8 @@ static struct mtd_partition ldp_nand_partitions[] = { | |||
423 | static void __init omap_ldp_init(void) | 441 | static void __init omap_ldp_init(void) |
424 | { | 442 | { |
425 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 443 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
444 | omap_board_config = ldp_config; | ||
445 | omap_board_config_size = ARRAY_SIZE(ldp_config); | ||
426 | ldp_init_smsc911x(); | 446 | ldp_init_smsc911x(); |
427 | omap_i2c_init(); | 447 | omap_i2c_init(); |
428 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); | 448 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); |
@@ -434,7 +454,7 @@ static void __init omap_ldp_init(void) | |||
434 | omap_serial_init(); | 454 | omap_serial_init(); |
435 | usb_musb_init(&musb_board_data); | 455 | usb_musb_init(&musb_board_data); |
436 | board_nand_init(ldp_nand_partitions, | 456 | board_nand_init(ldp_nand_partitions, |
437 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS); | 457 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); |
438 | 458 | ||
439 | omap2_hsmmc_init(mmc); | 459 | omap2_hsmmc_init(mmc); |
440 | /* link regulators to MMC adapters */ | 460 | /* link regulators to MMC adapters */ |
@@ -443,9 +463,10 @@ static void __init omap_ldp_init(void) | |||
443 | 463 | ||
444 | MACHINE_START(OMAP_LDP, "OMAP LDP board") | 464 | MACHINE_START(OMAP_LDP, "OMAP LDP board") |
445 | .boot_params = 0x80000100, | 465 | .boot_params = 0x80000100, |
446 | .map_io = omap3_map_io, | ||
447 | .reserve = omap_reserve, | 466 | .reserve = omap_reserve, |
448 | .init_irq = omap_ldp_init_irq, | 467 | .map_io = omap3_map_io, |
468 | .init_early = omap_ldp_init_early, | ||
469 | .init_irq = omap_init_irq, | ||
449 | .init_machine = omap_ldp_init, | 470 | .init_machine = omap_ldp_init, |
450 | .timer = &omap_timer, | 471 | .timer = &omap_timer, |
451 | MACHINE_END | 472 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index f396756872b7..e710cd9e079b 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -536,7 +536,7 @@ static void __init n8x0_mmc_init(void) | |||
536 | } | 536 | } |
537 | 537 | ||
538 | mmc_data[0] = &mmc1_data; | 538 | mmc_data[0] = &mmc1_data; |
539 | omap2_init_mmc(mmc_data, OMAP24XX_NR_MMC); | 539 | omap242x_init_mmc(mmc_data); |
540 | } | 540 | } |
541 | #else | 541 | #else |
542 | 542 | ||
@@ -628,11 +628,10 @@ static void __init n8x0_map_io(void) | |||
628 | omap242x_map_common_io(); | 628 | omap242x_map_common_io(); |
629 | } | 629 | } |
630 | 630 | ||
631 | static void __init n8x0_init_irq(void) | 631 | static void __init n8x0_init_early(void) |
632 | { | 632 | { |
633 | omap2_init_common_infrastructure(); | 633 | omap2_init_common_infrastructure(); |
634 | omap2_init_common_devices(NULL, NULL); | 634 | omap2_init_common_devices(NULL, NULL); |
635 | omap_init_irq(); | ||
636 | } | 635 | } |
637 | 636 | ||
638 | #ifdef CONFIG_OMAP_MUX | 637 | #ifdef CONFIG_OMAP_MUX |
@@ -703,27 +702,30 @@ static void __init n8x0_init_machine(void) | |||
703 | 702 | ||
704 | MACHINE_START(NOKIA_N800, "Nokia N800") | 703 | MACHINE_START(NOKIA_N800, "Nokia N800") |
705 | .boot_params = 0x80000100, | 704 | .boot_params = 0x80000100, |
706 | .map_io = n8x0_map_io, | ||
707 | .reserve = omap_reserve, | 705 | .reserve = omap_reserve, |
708 | .init_irq = n8x0_init_irq, | 706 | .map_io = n8x0_map_io, |
707 | .init_early = n8x0_init_early, | ||
708 | .init_irq = omap_init_irq, | ||
709 | .init_machine = n8x0_init_machine, | 709 | .init_machine = n8x0_init_machine, |
710 | .timer = &omap_timer, | 710 | .timer = &omap_timer, |
711 | MACHINE_END | 711 | MACHINE_END |
712 | 712 | ||
713 | MACHINE_START(NOKIA_N810, "Nokia N810") | 713 | MACHINE_START(NOKIA_N810, "Nokia N810") |
714 | .boot_params = 0x80000100, | 714 | .boot_params = 0x80000100, |
715 | .map_io = n8x0_map_io, | ||
716 | .reserve = omap_reserve, | 715 | .reserve = omap_reserve, |
717 | .init_irq = n8x0_init_irq, | 716 | .map_io = n8x0_map_io, |
717 | .init_early = n8x0_init_early, | ||
718 | .init_irq = omap_init_irq, | ||
718 | .init_machine = n8x0_init_machine, | 719 | .init_machine = n8x0_init_machine, |
719 | .timer = &omap_timer, | 720 | .timer = &omap_timer, |
720 | MACHINE_END | 721 | MACHINE_END |
721 | 722 | ||
722 | MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") | 723 | MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") |
723 | .boot_params = 0x80000100, | 724 | .boot_params = 0x80000100, |
724 | .map_io = n8x0_map_io, | ||
725 | .reserve = omap_reserve, | 725 | .reserve = omap_reserve, |
726 | .init_irq = n8x0_init_irq, | 726 | .map_io = n8x0_map_io, |
727 | .init_early = n8x0_init_early, | ||
728 | .init_irq = omap_init_irq, | ||
727 | .init_machine = n8x0_init_machine, | 729 | .init_machine = n8x0_init_machine, |
728 | .timer = &omap_timer, | 730 | .timer = &omap_timer, |
729 | MACHINE_END | 731 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index f0963b6e4627..7640c054f43b 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | #include <linux/opp.h> | ||
26 | 27 | ||
27 | #include <linux/mtd/mtd.h> | 28 | #include <linux/mtd/mtd.h> |
28 | #include <linux/mtd/partitions.h> | 29 | #include <linux/mtd/partitions.h> |
@@ -45,10 +46,12 @@ | |||
45 | #include <plat/gpmc.h> | 46 | #include <plat/gpmc.h> |
46 | #include <plat/nand.h> | 47 | #include <plat/nand.h> |
47 | #include <plat/usb.h> | 48 | #include <plat/usb.h> |
49 | #include <plat/omap_device.h> | ||
48 | 50 | ||
49 | #include "mux.h" | 51 | #include "mux.h" |
50 | #include "hsmmc.h" | 52 | #include "hsmmc.h" |
51 | #include "timer-gp.h" | 53 | #include "timer-gp.h" |
54 | #include "pm.h" | ||
52 | 55 | ||
53 | #define NAND_BLOCK_SIZE SZ_128K | 56 | #define NAND_BLOCK_SIZE SZ_128K |
54 | 57 | ||
@@ -228,14 +231,6 @@ static struct omap_dss_board_info beagle_dss_data = { | |||
228 | .default_device = &beagle_dvi_device, | 231 | .default_device = &beagle_dvi_device, |
229 | }; | 232 | }; |
230 | 233 | ||
231 | static struct platform_device beagle_dss_device = { | ||
232 | .name = "omapdss", | ||
233 | .id = -1, | ||
234 | .dev = { | ||
235 | .platform_data = &beagle_dss_data, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct regulator_consumer_supply beagle_vdac_supply = | 234 | static struct regulator_consumer_supply beagle_vdac_supply = |
240 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 235 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
241 | 236 | ||
@@ -435,9 +430,7 @@ static struct twl4030_usb_data beagle_usb_data = { | |||
435 | .usb_mode = T2_USB_MODE_ULPI, | 430 | .usb_mode = T2_USB_MODE_ULPI, |
436 | }; | 431 | }; |
437 | 432 | ||
438 | static struct twl4030_codec_audio_data beagle_audio_data = { | 433 | static struct twl4030_codec_audio_data beagle_audio_data; |
439 | .audio_mclk = 26000000, | ||
440 | }; | ||
441 | 434 | ||
442 | static struct twl4030_codec_data beagle_codec_data = { | 435 | static struct twl4030_codec_data beagle_codec_data = { |
443 | .audio_mclk = 26000000, | 436 | .audio_mclk = 26000000, |
@@ -536,11 +529,15 @@ static struct platform_device keys_gpio = { | |||
536 | }, | 529 | }, |
537 | }; | 530 | }; |
538 | 531 | ||
539 | static void __init omap3_beagle_init_irq(void) | 532 | static void __init omap3_beagle_init_early(void) |
540 | { | 533 | { |
541 | omap2_init_common_infrastructure(); | 534 | omap2_init_common_infrastructure(); |
542 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 535 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
543 | mt46h32m32lf6_sdrc_params); | 536 | mt46h32m32lf6_sdrc_params); |
537 | } | ||
538 | |||
539 | static void __init omap3_beagle_init_irq(void) | ||
540 | { | ||
544 | omap_init_irq(); | 541 | omap_init_irq(); |
545 | #ifdef CONFIG_OMAP_32K_TIMER | 542 | #ifdef CONFIG_OMAP_32K_TIMER |
546 | omap2_gp_clockevent_set_gptimer(12); | 543 | omap2_gp_clockevent_set_gptimer(12); |
@@ -550,7 +547,6 @@ static void __init omap3_beagle_init_irq(void) | |||
550 | static struct platform_device *omap3_beagle_devices[] __initdata = { | 547 | static struct platform_device *omap3_beagle_devices[] __initdata = { |
551 | &leds_gpio, | 548 | &leds_gpio, |
552 | &keys_gpio, | 549 | &keys_gpio, |
553 | &beagle_dss_device, | ||
554 | }; | 550 | }; |
555 | 551 | ||
556 | static void __init omap3beagle_flash_init(void) | 552 | static void __init omap3beagle_flash_init(void) |
@@ -610,6 +606,52 @@ static struct omap_musb_board_data musb_board_data = { | |||
610 | .power = 100, | 606 | .power = 100, |
611 | }; | 607 | }; |
612 | 608 | ||
609 | static void __init beagle_opp_init(void) | ||
610 | { | ||
611 | int r = 0; | ||
612 | |||
613 | /* Initialize the omap3 opp table */ | ||
614 | if (omap3_opp_init()) { | ||
615 | pr_err("%s: opp default init failed\n", __func__); | ||
616 | return; | ||
617 | } | ||
618 | |||
619 | /* Custom OPP enabled for XM */ | ||
620 | if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { | ||
621 | struct omap_hwmod *mh = omap_hwmod_lookup("mpu"); | ||
622 | struct omap_hwmod *dh = omap_hwmod_lookup("iva"); | ||
623 | struct device *dev; | ||
624 | |||
625 | if (!mh || !dh) { | ||
626 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | ||
627 | __func__, mh, dh); | ||
628 | return; | ||
629 | } | ||
630 | /* Enable MPU 1GHz and lower opps */ | ||
631 | dev = &mh->od->pdev.dev; | ||
632 | r = opp_enable(dev, 800000000); | ||
633 | /* TODO: MPU 1GHz needs SR and ABB */ | ||
634 | |||
635 | /* Enable IVA 800MHz and lower opps */ | ||
636 | dev = &dh->od->pdev.dev; | ||
637 | r |= opp_enable(dev, 660000000); | ||
638 | /* TODO: DSP 800MHz needs SR and ABB */ | ||
639 | if (r) { | ||
640 | pr_err("%s: failed to enable higher opp %d\n", | ||
641 | __func__, r); | ||
642 | /* | ||
643 | * Cleanup - disable the higher freqs - we dont care | ||
644 | * about the results | ||
645 | */ | ||
646 | dev = &mh->od->pdev.dev; | ||
647 | opp_disable(dev, 800000000); | ||
648 | dev = &dh->od->pdev.dev; | ||
649 | opp_disable(dev, 660000000); | ||
650 | } | ||
651 | } | ||
652 | return; | ||
653 | } | ||
654 | |||
613 | static void __init omap3_beagle_init(void) | 655 | static void __init omap3_beagle_init(void) |
614 | { | 656 | { |
615 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 657 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -617,6 +659,7 @@ static void __init omap3_beagle_init(void) | |||
617 | omap3_beagle_i2c_init(); | 659 | omap3_beagle_i2c_init(); |
618 | platform_add_devices(omap3_beagle_devices, | 660 | platform_add_devices(omap3_beagle_devices, |
619 | ARRAY_SIZE(omap3_beagle_devices)); | 661 | ARRAY_SIZE(omap3_beagle_devices)); |
662 | omap_display_init(&beagle_dss_data); | ||
620 | omap_serial_init(); | 663 | omap_serial_init(); |
621 | 664 | ||
622 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | 665 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); |
@@ -633,13 +676,15 @@ static void __init omap3_beagle_init(void) | |||
633 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 676 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
634 | 677 | ||
635 | beagle_display_init(); | 678 | beagle_display_init(); |
679 | beagle_opp_init(); | ||
636 | } | 680 | } |
637 | 681 | ||
638 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 682 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
639 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ | 683 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ |
640 | .boot_params = 0x80000100, | 684 | .boot_params = 0x80000100, |
641 | .map_io = omap3_map_io, | ||
642 | .reserve = omap_reserve, | 685 | .reserve = omap_reserve, |
686 | .map_io = omap3_map_io, | ||
687 | .init_early = omap3_beagle_init_early, | ||
643 | .init_irq = omap3_beagle_init_irq, | 688 | .init_irq = omap3_beagle_init_irq, |
644 | .init_machine = omap3_beagle_init, | 689 | .init_machine = omap3_beagle_init, |
645 | .timer = &omap_timer, | 690 | .timer = &omap_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 38a2d91790c0..0fa2c7b208b1 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/usb/otg.h> | 30 | #include <linux/usb/otg.h> |
31 | #include <linux/smsc911x.h> | 31 | #include <linux/smsc911x.h> |
32 | 32 | ||
33 | #include <linux/wl12xx.h> | ||
34 | #include <linux/regulator/fixed.h> | ||
33 | #include <linux/regulator/machine.h> | 35 | #include <linux/regulator/machine.h> |
34 | #include <linux/mmc/host.h> | 36 | #include <linux/mmc/host.h> |
35 | 37 | ||
@@ -58,6 +60,13 @@ | |||
58 | #define OMAP3EVM_ETHR_ID_REV 0x50 | 60 | #define OMAP3EVM_ETHR_ID_REV 0x50 |
59 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 | 61 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 |
60 | #define OMAP3EVM_SMSC911X_CS 5 | 62 | #define OMAP3EVM_SMSC911X_CS 5 |
63 | /* | ||
64 | * Eth Reset signal | ||
65 | * 64 = Generation 1 (<=RevD) | ||
66 | * 7 = Generation 2 (>=RevE) | ||
67 | */ | ||
68 | #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 | ||
69 | #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 | ||
61 | 70 | ||
62 | static u8 omap3_evm_version; | 71 | static u8 omap3_evm_version; |
63 | 72 | ||
@@ -124,10 +133,15 @@ static struct platform_device omap3evm_smsc911x_device = { | |||
124 | 133 | ||
125 | static inline void __init omap3evm_init_smsc911x(void) | 134 | static inline void __init omap3evm_init_smsc911x(void) |
126 | { | 135 | { |
127 | int eth_cs; | 136 | int eth_cs, eth_rst; |
128 | struct clk *l3ck; | 137 | struct clk *l3ck; |
129 | unsigned int rate; | 138 | unsigned int rate; |
130 | 139 | ||
140 | if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) | ||
141 | eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST; | ||
142 | else | ||
143 | eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST; | ||
144 | |||
131 | eth_cs = OMAP3EVM_SMSC911X_CS; | 145 | eth_cs = OMAP3EVM_SMSC911X_CS; |
132 | 146 | ||
133 | l3ck = clk_get(NULL, "l3_ck"); | 147 | l3ck = clk_get(NULL, "l3_ck"); |
@@ -136,6 +150,27 @@ static inline void __init omap3evm_init_smsc911x(void) | |||
136 | else | 150 | else |
137 | rate = clk_get_rate(l3ck); | 151 | rate = clk_get_rate(l3ck); |
138 | 152 | ||
153 | /* Configure ethernet controller reset gpio */ | ||
154 | if (cpu_is_omap3430()) { | ||
155 | if (gpio_request(eth_rst, "SMSC911x gpio") < 0) { | ||
156 | pr_err(KERN_ERR "Failed to request %d for smsc911x\n", | ||
157 | eth_rst); | ||
158 | return; | ||
159 | } | ||
160 | |||
161 | if (gpio_direction_output(eth_rst, 1) < 0) { | ||
162 | pr_err(KERN_ERR "Failed to set direction of %d for" \ | ||
163 | " smsc911x\n", eth_rst); | ||
164 | return; | ||
165 | } | ||
166 | /* reset pulse to ethernet controller*/ | ||
167 | usleep_range(150, 220); | ||
168 | gpio_set_value(eth_rst, 0); | ||
169 | usleep_range(150, 220); | ||
170 | gpio_set_value(eth_rst, 1); | ||
171 | usleep_range(1, 2); | ||
172 | } | ||
173 | |||
139 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { | 174 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { |
140 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", | 175 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
141 | OMAP3EVM_ETHR_GPIO_IRQ); | 176 | OMAP3EVM_ETHR_GPIO_IRQ); |
@@ -235,9 +270,9 @@ static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | |||
235 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | 270 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); |
236 | 271 | ||
237 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | 272 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
238 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | 273 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
239 | else | 274 | else |
240 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | 275 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
241 | 276 | ||
242 | lcd_enabled = 1; | 277 | lcd_enabled = 1; |
243 | return 0; | 278 | return 0; |
@@ -248,9 +283,9 @@ static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | |||
248 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | 283 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); |
249 | 284 | ||
250 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | 285 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
251 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | 286 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
252 | else | 287 | else |
253 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | 288 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
254 | 289 | ||
255 | lcd_enabled = 0; | 290 | lcd_enabled = 0; |
256 | } | 291 | } |
@@ -289,7 +324,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | |||
289 | return -EINVAL; | 324 | return -EINVAL; |
290 | } | 325 | } |
291 | 326 | ||
292 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); | 327 | gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); |
293 | 328 | ||
294 | dvi_enabled = 1; | 329 | dvi_enabled = 1; |
295 | return 0; | 330 | return 0; |
@@ -297,7 +332,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | |||
297 | 332 | ||
298 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) | 333 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) |
299 | { | 334 | { |
300 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); | 335 | gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); |
301 | 336 | ||
302 | dvi_enabled = 0; | 337 | dvi_enabled = 0; |
303 | } | 338 | } |
@@ -328,14 +363,6 @@ static struct omap_dss_board_info omap3_evm_dss_data = { | |||
328 | .default_device = &omap3_evm_lcd_device, | 363 | .default_device = &omap3_evm_lcd_device, |
329 | }; | 364 | }; |
330 | 365 | ||
331 | static struct platform_device omap3_evm_dss_device = { | ||
332 | .name = "omapdss", | ||
333 | .id = -1, | ||
334 | .dev = { | ||
335 | .platform_data = &omap3_evm_dss_data, | ||
336 | }, | ||
337 | }; | ||
338 | |||
339 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | 366 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { |
340 | .supply = "vmmc", | 367 | .supply = "vmmc", |
341 | }; | 368 | }; |
@@ -381,6 +408,16 @@ static struct omap2_hsmmc_info mmc[] = { | |||
381 | .gpio_cd = -EINVAL, | 408 | .gpio_cd = -EINVAL, |
382 | .gpio_wp = 63, | 409 | .gpio_wp = 63, |
383 | }, | 410 | }, |
411 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
412 | { | ||
413 | .name = "wl1271", | ||
414 | .mmc = 2, | ||
415 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
416 | .gpio_wp = -EINVAL, | ||
417 | .gpio_cd = -EINVAL, | ||
418 | .nonremovable = true, | ||
419 | }, | ||
420 | #endif | ||
384 | {} /* Terminator */ | 421 | {} /* Terminator */ |
385 | }; | 422 | }; |
386 | 423 | ||
@@ -411,6 +448,8 @@ static struct platform_device leds_gpio = { | |||
411 | static int omap3evm_twl_gpio_setup(struct device *dev, | 448 | static int omap3evm_twl_gpio_setup(struct device *dev, |
412 | unsigned gpio, unsigned ngpio) | 449 | unsigned gpio, unsigned ngpio) |
413 | { | 450 | { |
451 | int r; | ||
452 | |||
414 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 453 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
415 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); | 454 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); |
416 | mmc[0].gpio_cd = gpio + 0; | 455 | mmc[0].gpio_cd = gpio + 0; |
@@ -426,8 +465,12 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
426 | */ | 465 | */ |
427 | 466 | ||
428 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ | 467 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ |
429 | gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); | 468 | r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); |
430 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | 469 | if (!r) |
470 | r = gpio_direction_output(gpio + TWL4030_GPIO_MAX, | ||
471 | (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) ? 1 : 0); | ||
472 | if (r) | ||
473 | printk(KERN_ERR "failed to get/set lcd_bkl gpio\n"); | ||
431 | 474 | ||
432 | /* gpio + 7 == DVI Enable */ | 475 | /* gpio + 7 == DVI Enable */ |
433 | gpio_request(gpio + 7, "EN_DVI"); | 476 | gpio_request(gpio + 7, "EN_DVI"); |
@@ -491,19 +534,15 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = { | |||
491 | .irq_line = 1, | 534 | .irq_line = 1, |
492 | }; | 535 | }; |
493 | 536 | ||
494 | static struct twl4030_codec_audio_data omap3evm_audio_data = { | 537 | static struct twl4030_codec_audio_data omap3evm_audio_data; |
495 | .audio_mclk = 26000000, | ||
496 | }; | ||
497 | 538 | ||
498 | static struct twl4030_codec_data omap3evm_codec_data = { | 539 | static struct twl4030_codec_data omap3evm_codec_data = { |
499 | .audio_mclk = 26000000, | 540 | .audio_mclk = 26000000, |
500 | .audio = &omap3evm_audio_data, | 541 | .audio = &omap3evm_audio_data, |
501 | }; | 542 | }; |
502 | 543 | ||
503 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { | 544 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = |
504 | .supply = "vdda_dac", | 545 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
505 | .dev = &omap3_evm_dss_device.dev, | ||
506 | }; | ||
507 | 546 | ||
508 | /* VDAC for DSS driving S-Video */ | 547 | /* VDAC for DSS driving S-Video */ |
509 | static struct regulator_init_data omap3_evm_vdac = { | 548 | static struct regulator_init_data omap3_evm_vdac = { |
@@ -538,6 +577,66 @@ static struct regulator_init_data omap3_evm_vpll2 = { | |||
538 | .consumer_supplies = &omap3_evm_vpll2_supply, | 577 | .consumer_supplies = &omap3_evm_vpll2_supply, |
539 | }; | 578 | }; |
540 | 579 | ||
580 | /* ads7846 on SPI */ | ||
581 | static struct regulator_consumer_supply omap3evm_vio_supply = | ||
582 | REGULATOR_SUPPLY("vcc", "spi1.0"); | ||
583 | |||
584 | /* VIO for ads7846 */ | ||
585 | static struct regulator_init_data omap3evm_vio = { | ||
586 | .constraints = { | ||
587 | .min_uV = 1800000, | ||
588 | .max_uV = 1800000, | ||
589 | .apply_uV = true, | ||
590 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
591 | | REGULATOR_MODE_STANDBY, | ||
592 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
593 | | REGULATOR_CHANGE_STATUS, | ||
594 | }, | ||
595 | .num_consumer_supplies = 1, | ||
596 | .consumer_supplies = &omap3evm_vio_supply, | ||
597 | }; | ||
598 | |||
599 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
600 | |||
601 | #define OMAP3EVM_WLAN_PMENA_GPIO (150) | ||
602 | #define OMAP3EVM_WLAN_IRQ_GPIO (149) | ||
603 | |||
604 | static struct regulator_consumer_supply omap3evm_vmmc2_supply = | ||
605 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); | ||
606 | |||
607 | /* VMMC2 for driving the WL12xx module */ | ||
608 | static struct regulator_init_data omap3evm_vmmc2 = { | ||
609 | .constraints = { | ||
610 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
611 | }, | ||
612 | .num_consumer_supplies = 1, | ||
613 | .consumer_supplies = &omap3evm_vmmc2_supply, | ||
614 | }; | ||
615 | |||
616 | static struct fixed_voltage_config omap3evm_vwlan = { | ||
617 | .supply_name = "vwl1271", | ||
618 | .microvolts = 1800000, /* 1.80V */ | ||
619 | .gpio = OMAP3EVM_WLAN_PMENA_GPIO, | ||
620 | .startup_delay = 70000, /* 70ms */ | ||
621 | .enable_high = 1, | ||
622 | .enabled_at_boot = 0, | ||
623 | .init_data = &omap3evm_vmmc2, | ||
624 | }; | ||
625 | |||
626 | static struct platform_device omap3evm_wlan_regulator = { | ||
627 | .name = "reg-fixed-voltage", | ||
628 | .id = 1, | ||
629 | .dev = { | ||
630 | .platform_data = &omap3evm_vwlan, | ||
631 | }, | ||
632 | }; | ||
633 | |||
634 | struct wl12xx_platform_data omap3evm_wlan_data __initdata = { | ||
635 | .irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO), | ||
636 | .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */ | ||
637 | }; | ||
638 | #endif | ||
639 | |||
541 | static struct twl4030_platform_data omap3evm_twldata = { | 640 | static struct twl4030_platform_data omap3evm_twldata = { |
542 | .irq_base = TWL4030_IRQ_BASE, | 641 | .irq_base = TWL4030_IRQ_BASE, |
543 | .irq_end = TWL4030_IRQ_END, | 642 | .irq_end = TWL4030_IRQ_END, |
@@ -550,6 +649,7 @@ static struct twl4030_platform_data omap3evm_twldata = { | |||
550 | .codec = &omap3evm_codec_data, | 649 | .codec = &omap3evm_codec_data, |
551 | .vdac = &omap3_evm_vdac, | 650 | .vdac = &omap3_evm_vdac, |
552 | .vpll2 = &omap3_evm_vpll2, | 651 | .vpll2 = &omap3_evm_vpll2, |
652 | .vio = &omap3evm_vio, | ||
553 | }; | 653 | }; |
554 | 654 | ||
555 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { | 655 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { |
@@ -625,19 +725,12 @@ static struct spi_board_info omap3evm_spi_board_info[] = { | |||
625 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | 725 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { |
626 | }; | 726 | }; |
627 | 727 | ||
628 | static void __init omap3_evm_init_irq(void) | 728 | static void __init omap3_evm_init_early(void) |
629 | { | 729 | { |
630 | omap_board_config = omap3_evm_config; | ||
631 | omap_board_config_size = ARRAY_SIZE(omap3_evm_config); | ||
632 | omap2_init_common_infrastructure(); | 730 | omap2_init_common_infrastructure(); |
633 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); | 731 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); |
634 | omap_init_irq(); | ||
635 | } | 732 | } |
636 | 733 | ||
637 | static struct platform_device *omap3_evm_devices[] __initdata = { | ||
638 | &omap3_evm_dss_device, | ||
639 | }; | ||
640 | |||
641 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { | 734 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { |
642 | 735 | ||
643 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, | 736 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, |
@@ -652,14 +745,76 @@ static struct usbhs_omap_board_data usbhs_bdata __initdata = { | |||
652 | }; | 745 | }; |
653 | 746 | ||
654 | #ifdef CONFIG_OMAP_MUX | 747 | #ifdef CONFIG_OMAP_MUX |
655 | static struct omap_board_mux board_mux[] __initdata = { | 748 | static struct omap_board_mux omap35x_board_mux[] __initdata = { |
749 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | | ||
750 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | | ||
751 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
752 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
753 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | | ||
754 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
755 | OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
756 | OMAP_PIN_OFF_NONE), | ||
757 | OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
758 | OMAP_PIN_OFF_NONE), | ||
759 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
760 | /* WLAN IRQ - GPIO 149 */ | ||
761 | OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
762 | |||
763 | /* WLAN POWER ENABLE - GPIO 150 */ | ||
764 | OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
765 | |||
766 | /* MMC2 SDIO pin muxes for WL12xx */ | ||
767 | OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
768 | OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
769 | OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
770 | OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
771 | OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
772 | OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
773 | #endif | ||
774 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
775 | }; | ||
776 | |||
777 | static struct omap_board_mux omap36x_board_mux[] __initdata = { | ||
656 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | | 778 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | |
657 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | | 779 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | |
658 | OMAP_PIN_OFF_WAKEUPENABLE), | 780 | OMAP_PIN_OFF_WAKEUPENABLE), |
659 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | 781 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | |
660 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), | 782 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | |
783 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
784 | /* AM/DM37x EVM: DSS data bus muxed with sys_boot */ | ||
785 | OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
786 | OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
787 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
788 | OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
789 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
790 | OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
791 | OMAP3_MUX(SYS_BOOT0, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
792 | OMAP3_MUX(SYS_BOOT1, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
793 | OMAP3_MUX(SYS_BOOT3, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
794 | OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
795 | OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
796 | OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
797 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
798 | /* WLAN IRQ - GPIO 149 */ | ||
799 | OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
800 | |||
801 | /* WLAN POWER ENABLE - GPIO 150 */ | ||
802 | OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
803 | |||
804 | /* MMC2 SDIO pin muxes for WL12xx */ | ||
805 | OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
806 | OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
807 | OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
808 | OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
809 | OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
810 | OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
811 | #endif | ||
812 | |||
661 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 813 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
662 | }; | 814 | }; |
815 | #else | ||
816 | #define omap35x_board_mux NULL | ||
817 | #define omap36x_board_mux NULL | ||
663 | #endif | 818 | #endif |
664 | 819 | ||
665 | static struct omap_musb_board_data musb_board_data = { | 820 | static struct omap_musb_board_data musb_board_data = { |
@@ -671,11 +826,18 @@ static struct omap_musb_board_data musb_board_data = { | |||
671 | static void __init omap3_evm_init(void) | 826 | static void __init omap3_evm_init(void) |
672 | { | 827 | { |
673 | omap3_evm_get_revision(); | 828 | omap3_evm_get_revision(); |
674 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 829 | |
830 | if (cpu_is_omap3630()) | ||
831 | omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB); | ||
832 | else | ||
833 | omap3_mux_init(omap35x_board_mux, OMAP_PACKAGE_CBB); | ||
834 | |||
835 | omap_board_config = omap3_evm_config; | ||
836 | omap_board_config_size = ARRAY_SIZE(omap3_evm_config); | ||
675 | 837 | ||
676 | omap3_evm_i2c_init(); | 838 | omap3_evm_i2c_init(); |
677 | 839 | ||
678 | platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); | 840 | omap_display_init(&omap3_evm_dss_data); |
679 | 841 | ||
680 | spi_register_board_info(omap3evm_spi_board_info, | 842 | spi_register_board_info(omap3evm_spi_board_info, |
681 | ARRAY_SIZE(omap3evm_spi_board_info)); | 843 | ARRAY_SIZE(omap3evm_spi_board_info)); |
@@ -715,14 +877,22 @@ static void __init omap3_evm_init(void) | |||
715 | ads7846_dev_init(); | 877 | ads7846_dev_init(); |
716 | omap3evm_init_smsc911x(); | 878 | omap3evm_init_smsc911x(); |
717 | omap3_evm_display_init(); | 879 | omap3_evm_display_init(); |
880 | |||
881 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
882 | /* WL12xx WLAN Init */ | ||
883 | if (wl12xx_set_platform_data(&omap3evm_wlan_data)) | ||
884 | pr_err("error setting wl12xx data\n"); | ||
885 | platform_device_register(&omap3evm_wlan_regulator); | ||
886 | #endif | ||
718 | } | 887 | } |
719 | 888 | ||
720 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") | 889 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") |
721 | /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ | 890 | /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ |
722 | .boot_params = 0x80000100, | 891 | .boot_params = 0x80000100, |
723 | .map_io = omap3_map_io, | ||
724 | .reserve = omap_reserve, | 892 | .reserve = omap_reserve, |
725 | .init_irq = omap3_evm_init_irq, | 893 | .map_io = omap3_map_io, |
894 | .init_early = omap3_evm_init_early, | ||
895 | .init_irq = omap_init_irq, | ||
726 | .init_machine = omap3_evm_init, | 896 | .init_machine = omap3_evm_init, |
727 | .timer = &omap_timer, | 897 | .timer = &omap_timer, |
728 | MACHINE_END | 898 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index 15e4b08e99ba..b726943d7c93 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -195,11 +195,10 @@ static inline void __init board_smsc911x_init(void) | |||
195 | gpmc_smsc911x_init(&board_smsc911x_data); | 195 | gpmc_smsc911x_init(&board_smsc911x_data); |
196 | } | 196 | } |
197 | 197 | ||
198 | static void __init omap3logic_init_irq(void) | 198 | static void __init omap3logic_init_early(void) |
199 | { | 199 | { |
200 | omap2_init_common_infrastructure(); | 200 | omap2_init_common_infrastructure(); |
201 | omap2_init_common_devices(NULL, NULL); | 201 | omap2_init_common_devices(NULL, NULL); |
202 | omap_init_irq(); | ||
203 | } | 202 | } |
204 | 203 | ||
205 | #ifdef CONFIG_OMAP_MUX | 204 | #ifdef CONFIG_OMAP_MUX |
@@ -225,7 +224,8 @@ static void __init omap3logic_init(void) | |||
225 | MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") | 224 | MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") |
226 | .boot_params = 0x80000100, | 225 | .boot_params = 0x80000100, |
227 | .map_io = omap3_map_io, | 226 | .map_io = omap3_map_io, |
228 | .init_irq = omap3logic_init_irq, | 227 | .init_early = omap3logic_init_early, |
228 | .init_irq = omap_init_irq, | ||
229 | .init_machine = omap3logic_init, | 229 | .init_machine = omap3logic_init, |
230 | .timer = &omap_timer, | 230 | .timer = &omap_timer, |
231 | MACHINE_END | 231 | MACHINE_END |
@@ -233,7 +233,8 @@ MACHINE_END | |||
233 | MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") | 233 | MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") |
234 | .boot_params = 0x80000100, | 234 | .boot_params = 0x80000100, |
235 | .map_io = omap3_map_io, | 235 | .map_io = omap3_map_io, |
236 | .init_irq = omap3logic_init_irq, | 236 | .init_early = omap3logic_init_early, |
237 | .init_irq = omap_init_irq, | ||
237 | .init_machine = omap3logic_init, | 238 | .init_machine = omap3logic_init, |
238 | .timer = &omap_timer, | 239 | .timer = &omap_timer, |
239 | MACHINE_END | 240 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index aa05f2e46a61..2e5dc21e3477 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -253,14 +253,6 @@ static struct omap_dss_board_info pandora_dss_data = { | |||
253 | .default_device = &pandora_lcd_device, | 253 | .default_device = &pandora_lcd_device, |
254 | }; | 254 | }; |
255 | 255 | ||
256 | static struct platform_device pandora_dss_device = { | ||
257 | .name = "omapdss", | ||
258 | .id = -1, | ||
259 | .dev = { | ||
260 | .platform_data = &pandora_dss_data, | ||
261 | }, | ||
262 | }; | ||
263 | |||
264 | static void pandora_wl1251_init_card(struct mmc_card *card) | 256 | static void pandora_wl1251_init_card(struct mmc_card *card) |
265 | { | 257 | { |
266 | /* | 258 | /* |
@@ -341,13 +333,13 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | |||
341 | }; | 333 | }; |
342 | 334 | ||
343 | static struct regulator_consumer_supply pandora_vmmc1_supply = | 335 | static struct regulator_consumer_supply pandora_vmmc1_supply = |
344 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 336 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
345 | 337 | ||
346 | static struct regulator_consumer_supply pandora_vmmc2_supply = | 338 | static struct regulator_consumer_supply pandora_vmmc2_supply = |
347 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 339 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
348 | 340 | ||
349 | static struct regulator_consumer_supply pandora_vmmc3_supply = | 341 | static struct regulator_consumer_supply pandora_vmmc3_supply = |
350 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2"); | 342 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"); |
351 | 343 | ||
352 | static struct regulator_consumer_supply pandora_vdda_dac_supply = | 344 | static struct regulator_consumer_supply pandora_vdda_dac_supply = |
353 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 345 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
@@ -524,9 +516,7 @@ static struct twl4030_usb_data omap3pandora_usb_data = { | |||
524 | .usb_mode = T2_USB_MODE_ULPI, | 516 | .usb_mode = T2_USB_MODE_ULPI, |
525 | }; | 517 | }; |
526 | 518 | ||
527 | static struct twl4030_codec_audio_data omap3pandora_audio_data = { | 519 | static struct twl4030_codec_audio_data omap3pandora_audio_data; |
528 | .audio_mclk = 26000000, | ||
529 | }; | ||
530 | 520 | ||
531 | static struct twl4030_codec_data omap3pandora_codec_data = { | 521 | static struct twl4030_codec_data omap3pandora_codec_data = { |
532 | .audio_mclk = 26000000, | 522 | .audio_mclk = 26000000, |
@@ -634,12 +624,11 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { | |||
634 | } | 624 | } |
635 | }; | 625 | }; |
636 | 626 | ||
637 | static void __init omap3pandora_init_irq(void) | 627 | static void __init omap3pandora_init_early(void) |
638 | { | 628 | { |
639 | omap2_init_common_infrastructure(); | 629 | omap2_init_common_infrastructure(); |
640 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 630 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
641 | mt46h32m32lf6_sdrc_params); | 631 | mt46h32m32lf6_sdrc_params); |
642 | omap_init_irq(); | ||
643 | } | 632 | } |
644 | 633 | ||
645 | static void __init pandora_wl1251_init(void) | 634 | static void __init pandora_wl1251_init(void) |
@@ -677,7 +666,6 @@ fail: | |||
677 | static struct platform_device *omap3pandora_devices[] __initdata = { | 666 | static struct platform_device *omap3pandora_devices[] __initdata = { |
678 | &pandora_leds_gpio, | 667 | &pandora_leds_gpio, |
679 | &pandora_keys_gpio, | 668 | &pandora_keys_gpio, |
680 | &pandora_dss_device, | ||
681 | &pandora_vwlan_device, | 669 | &pandora_vwlan_device, |
682 | }; | 670 | }; |
683 | 671 | ||
@@ -712,6 +700,7 @@ static void __init omap3pandora_init(void) | |||
712 | pandora_wl1251_init(); | 700 | pandora_wl1251_init(); |
713 | platform_add_devices(omap3pandora_devices, | 701 | platform_add_devices(omap3pandora_devices, |
714 | ARRAY_SIZE(omap3pandora_devices)); | 702 | ARRAY_SIZE(omap3pandora_devices)); |
703 | omap_display_init(&pandora_dss_data); | ||
715 | omap_serial_init(); | 704 | omap_serial_init(); |
716 | spi_register_board_info(omap3pandora_spi_board_info, | 705 | spi_register_board_info(omap3pandora_spi_board_info, |
717 | ARRAY_SIZE(omap3pandora_spi_board_info)); | 706 | ARRAY_SIZE(omap3pandora_spi_board_info)); |
@@ -727,9 +716,10 @@ static void __init omap3pandora_init(void) | |||
727 | 716 | ||
728 | MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") | 717 | MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") |
729 | .boot_params = 0x80000100, | 718 | .boot_params = 0x80000100, |
730 | .map_io = omap3_map_io, | ||
731 | .reserve = omap_reserve, | 719 | .reserve = omap_reserve, |
732 | .init_irq = omap3pandora_init_irq, | 720 | .map_io = omap3_map_io, |
721 | .init_early = omap3pandora_init_early, | ||
722 | .init_irq = omap_init_irq, | ||
733 | .init_machine = omap3pandora_init, | 723 | .init_machine = omap3pandora_init, |
734 | .timer = &omap_timer, | 724 | .timer = &omap_timer, |
735 | MACHINE_END | 725 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index f6c87787cd4f..8ebdbc38b9de 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -240,14 +240,6 @@ static struct omap_dss_board_info omap3_stalker_dss_data = { | |||
240 | .default_device = &omap3_stalker_dvi_device, | 240 | .default_device = &omap3_stalker_dvi_device, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static struct platform_device omap3_stalker_dss_device = { | ||
244 | .name = "omapdss", | ||
245 | .id = -1, | ||
246 | .dev = { | ||
247 | .platform_data = &omap3_stalker_dss_data, | ||
248 | }, | ||
249 | }; | ||
250 | |||
251 | static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { | 243 | static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { |
252 | .supply = "vmmc", | 244 | .supply = "vmmc", |
253 | }; | 245 | }; |
@@ -439,19 +431,15 @@ static struct twl4030_madc_platform_data omap3stalker_madc_data = { | |||
439 | .irq_line = 1, | 431 | .irq_line = 1, |
440 | }; | 432 | }; |
441 | 433 | ||
442 | static struct twl4030_codec_audio_data omap3stalker_audio_data = { | 434 | static struct twl4030_codec_audio_data omap3stalker_audio_data; |
443 | .audio_mclk = 26000000, | ||
444 | }; | ||
445 | 435 | ||
446 | static struct twl4030_codec_data omap3stalker_codec_data = { | 436 | static struct twl4030_codec_data omap3stalker_codec_data = { |
447 | .audio_mclk = 26000000, | 437 | .audio_mclk = 26000000, |
448 | .audio = &omap3stalker_audio_data, | 438 | .audio = &omap3stalker_audio_data, |
449 | }; | 439 | }; |
450 | 440 | ||
451 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = { | 441 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = |
452 | .supply = "vdda_dac", | 442 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
453 | .dev = &omap3_stalker_dss_device.dev, | ||
454 | }; | ||
455 | 443 | ||
456 | /* VDAC for DSS driving S-Video */ | 444 | /* VDAC for DSS driving S-Video */ |
457 | static struct regulator_init_data omap3_stalker_vdac = { | 445 | static struct regulator_init_data omap3_stalker_vdac = { |
@@ -469,10 +457,8 @@ static struct regulator_init_data omap3_stalker_vdac = { | |||
469 | }; | 457 | }; |
470 | 458 | ||
471 | /* VPLL2 for digital video outputs */ | 459 | /* VPLL2 for digital video outputs */ |
472 | static struct regulator_consumer_supply omap3_stalker_vpll2_supply = { | 460 | static struct regulator_consumer_supply omap3_stalker_vpll2_supply = |
473 | .supply = "vdds_dsi", | 461 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); |
474 | .dev = &omap3_stalker_lcd_device.dev, | ||
475 | }; | ||
476 | 462 | ||
477 | static struct regulator_init_data omap3_stalker_vpll2 = { | 463 | static struct regulator_init_data omap3_stalker_vpll2 = { |
478 | .constraints = { | 464 | .constraints = { |
@@ -591,12 +577,14 @@ static struct spi_board_info omap3stalker_spi_board_info[] = { | |||
591 | static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { | 577 | static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { |
592 | }; | 578 | }; |
593 | 579 | ||
594 | static void __init omap3_stalker_init_irq(void) | 580 | static void __init omap3_stalker_init_early(void) |
595 | { | 581 | { |
596 | omap_board_config = omap3_stalker_config; | ||
597 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); | ||
598 | omap2_init_common_infrastructure(); | 582 | omap2_init_common_infrastructure(); |
599 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); | 583 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); |
584 | } | ||
585 | |||
586 | static void __init omap3_stalker_init_irq(void) | ||
587 | { | ||
600 | omap_init_irq(); | 588 | omap_init_irq(); |
601 | #ifdef CONFIG_OMAP_32K_TIMER | 589 | #ifdef CONFIG_OMAP_32K_TIMER |
602 | omap2_gp_clockevent_set_gptimer(12); | 590 | omap2_gp_clockevent_set_gptimer(12); |
@@ -604,7 +592,6 @@ static void __init omap3_stalker_init_irq(void) | |||
604 | } | 592 | } |
605 | 593 | ||
606 | static struct platform_device *omap3_stalker_devices[] __initdata = { | 594 | static struct platform_device *omap3_stalker_devices[] __initdata = { |
607 | &omap3_stalker_dss_device, | ||
608 | &keys_gpio, | 595 | &keys_gpio, |
609 | }; | 596 | }; |
610 | 597 | ||
@@ -638,12 +625,15 @@ static struct omap_musb_board_data musb_board_data = { | |||
638 | static void __init omap3_stalker_init(void) | 625 | static void __init omap3_stalker_init(void) |
639 | { | 626 | { |
640 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 627 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
628 | omap_board_config = omap3_stalker_config; | ||
629 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); | ||
641 | 630 | ||
642 | omap3_stalker_i2c_init(); | 631 | omap3_stalker_i2c_init(); |
643 | 632 | ||
644 | platform_add_devices(omap3_stalker_devices, | 633 | platform_add_devices(omap3_stalker_devices, |
645 | ARRAY_SIZE(omap3_stalker_devices)); | 634 | ARRAY_SIZE(omap3_stalker_devices)); |
646 | 635 | ||
636 | omap_display_init(&omap3_stalker_dss_data); | ||
647 | spi_register_board_info(omap3stalker_spi_board_info, | 637 | spi_register_board_info(omap3stalker_spi_board_info, |
648 | ARRAY_SIZE(omap3stalker_spi_board_info)); | 638 | ARRAY_SIZE(omap3stalker_spi_board_info)); |
649 | 639 | ||
@@ -666,6 +656,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER") | |||
666 | /* Maintainer: Jason Lam -lzg@ema-tech.com */ | 656 | /* Maintainer: Jason Lam -lzg@ema-tech.com */ |
667 | .boot_params = 0x80000100, | 657 | .boot_params = 0x80000100, |
668 | .map_io = omap3_map_io, | 658 | .map_io = omap3_map_io, |
659 | .init_early = omap3_stalker_init_early, | ||
669 | .init_irq = omap3_stalker_init_irq, | 660 | .init_irq = omap3_stalker_init_irq, |
670 | .init_machine = omap3_stalker_init, | 661 | .init_machine = omap3_stalker_init, |
671 | .timer = &omap_timer, | 662 | .timer = &omap_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 84cfddb19a74..127cb1752bdd 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -252,9 +252,7 @@ static struct twl4030_usb_data touchbook_usb_data = { | |||
252 | .usb_mode = T2_USB_MODE_ULPI, | 252 | .usb_mode = T2_USB_MODE_ULPI, |
253 | }; | 253 | }; |
254 | 254 | ||
255 | static struct twl4030_codec_audio_data touchbook_audio_data = { | 255 | static struct twl4030_codec_audio_data touchbook_audio_data; |
256 | .audio_mclk = 26000000, | ||
257 | }; | ||
258 | 256 | ||
259 | static struct twl4030_codec_data touchbook_codec_data = { | 257 | static struct twl4030_codec_data touchbook_codec_data = { |
260 | .audio_mclk = 26000000, | 258 | .audio_mclk = 26000000, |
@@ -415,14 +413,15 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
415 | }; | 413 | }; |
416 | #endif | 414 | #endif |
417 | 415 | ||
418 | static void __init omap3_touchbook_init_irq(void) | 416 | static void __init omap3_touchbook_init_early(void) |
419 | { | 417 | { |
420 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
421 | omap_board_config = omap3_touchbook_config; | ||
422 | omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); | ||
423 | omap2_init_common_infrastructure(); | 418 | omap2_init_common_infrastructure(); |
424 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 419 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
425 | mt46h32m32lf6_sdrc_params); | 420 | mt46h32m32lf6_sdrc_params); |
421 | } | ||
422 | |||
423 | static void __init omap3_touchbook_init_irq(void) | ||
424 | { | ||
426 | omap_init_irq(); | 425 | omap_init_irq(); |
427 | #ifdef CONFIG_OMAP_32K_TIMER | 426 | #ifdef CONFIG_OMAP_32K_TIMER |
428 | omap2_gp_clockevent_set_gptimer(12); | 427 | omap2_gp_clockevent_set_gptimer(12); |
@@ -510,6 +509,10 @@ static struct omap_musb_board_data musb_board_data = { | |||
510 | 509 | ||
511 | static void __init omap3_touchbook_init(void) | 510 | static void __init omap3_touchbook_init(void) |
512 | { | 511 | { |
512 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
513 | omap_board_config = omap3_touchbook_config; | ||
514 | omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); | ||
515 | |||
513 | pm_power_off = omap3_touchbook_poweroff; | 516 | pm_power_off = omap3_touchbook_poweroff; |
514 | 517 | ||
515 | omap3_touchbook_i2c_init(); | 518 | omap3_touchbook_i2c_init(); |
@@ -538,8 +541,9 @@ static void __init omap3_touchbook_init(void) | |||
538 | MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") | 541 | MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") |
539 | /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */ | 542 | /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */ |
540 | .boot_params = 0x80000100, | 543 | .boot_params = 0x80000100, |
541 | .map_io = omap3_map_io, | ||
542 | .reserve = omap_reserve, | 544 | .reserve = omap_reserve, |
545 | .map_io = omap3_map_io, | ||
546 | .init_early = omap3_touchbook_init_early, | ||
543 | .init_irq = omap3_touchbook_init_irq, | 547 | .init_irq = omap3_touchbook_init_irq, |
544 | .init_machine = omap3_touchbook_init, | 548 | .init_machine = omap3_touchbook_init, |
545 | .timer = &omap_timer, | 549 | .timer = &omap_timer, |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index ed61c1f5d5e6..0f4d8a762a70 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/usb/otg.h> | 26 | #include <linux/usb/otg.h> |
27 | #include <linux/i2c/twl.h> | 27 | #include <linux/i2c/twl.h> |
28 | #include <linux/regulator/machine.h> | 28 | #include <linux/regulator/machine.h> |
29 | #include <linux/regulator/fixed.h> | ||
30 | #include <linux/wl12xx.h> | ||
29 | 31 | ||
30 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
31 | #include <mach/omap4-common.h> | 33 | #include <mach/omap4-common.h> |
@@ -45,6 +47,18 @@ | |||
45 | 47 | ||
46 | #define GPIO_HUB_POWER 1 | 48 | #define GPIO_HUB_POWER 1 |
47 | #define GPIO_HUB_NRESET 62 | 49 | #define GPIO_HUB_NRESET 62 |
50 | #define GPIO_WIFI_PMENA 43 | ||
51 | #define GPIO_WIFI_IRQ 53 | ||
52 | |||
53 | /* wl127x BT, FM, GPS connectivity chip */ | ||
54 | static int wl1271_gpios[] = {46, -1, -1}; | ||
55 | static struct platform_device wl1271_device = { | ||
56 | .name = "kim", | ||
57 | .id = -1, | ||
58 | .dev = { | ||
59 | .platform_data = &wl1271_gpios, | ||
60 | }, | ||
61 | }; | ||
48 | 62 | ||
49 | static struct gpio_led gpio_leds[] = { | 63 | static struct gpio_led gpio_leds[] = { |
50 | { | 64 | { |
@@ -74,13 +88,13 @@ static struct platform_device leds_gpio = { | |||
74 | 88 | ||
75 | static struct platform_device *panda_devices[] __initdata = { | 89 | static struct platform_device *panda_devices[] __initdata = { |
76 | &leds_gpio, | 90 | &leds_gpio, |
91 | &wl1271_device, | ||
77 | }; | 92 | }; |
78 | 93 | ||
79 | static void __init omap4_panda_init_irq(void) | 94 | static void __init omap4_panda_init_early(void) |
80 | { | 95 | { |
81 | omap2_init_common_infrastructure(); | 96 | omap2_init_common_infrastructure(); |
82 | omap2_init_common_devices(NULL, NULL); | 97 | omap2_init_common_devices(NULL, NULL); |
83 | gic_init_irq(); | ||
84 | } | 98 | } |
85 | 99 | ||
86 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 100 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
@@ -163,16 +177,62 @@ static struct omap2_hsmmc_info mmc[] = { | |||
163 | .gpio_wp = -EINVAL, | 177 | .gpio_wp = -EINVAL, |
164 | .gpio_cd = -EINVAL, | 178 | .gpio_cd = -EINVAL, |
165 | }, | 179 | }, |
180 | { | ||
181 | .name = "wl1271", | ||
182 | .mmc = 5, | ||
183 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
184 | .gpio_wp = -EINVAL, | ||
185 | .gpio_cd = -EINVAL, | ||
186 | .ocr_mask = MMC_VDD_165_195, | ||
187 | .nonremovable = true, | ||
188 | }, | ||
166 | {} /* Terminator */ | 189 | {} /* Terminator */ |
167 | }; | 190 | }; |
168 | 191 | ||
169 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { | 192 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { |
170 | { | 193 | { |
171 | .supply = "vmmc", | 194 | .supply = "vmmc", |
172 | .dev_name = "mmci-omap-hs.0", | 195 | .dev_name = "omap_hsmmc.0", |
173 | }, | 196 | }, |
174 | }; | 197 | }; |
175 | 198 | ||
199 | static struct regulator_consumer_supply omap4_panda_vmmc5_supply = { | ||
200 | .supply = "vmmc", | ||
201 | .dev_name = "omap_hsmmc.4", | ||
202 | }; | ||
203 | |||
204 | static struct regulator_init_data panda_vmmc5 = { | ||
205 | .constraints = { | ||
206 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
207 | }, | ||
208 | .num_consumer_supplies = 1, | ||
209 | .consumer_supplies = &omap4_panda_vmmc5_supply, | ||
210 | }; | ||
211 | |||
212 | static struct fixed_voltage_config panda_vwlan = { | ||
213 | .supply_name = "vwl1271", | ||
214 | .microvolts = 1800000, /* 1.8V */ | ||
215 | .gpio = GPIO_WIFI_PMENA, | ||
216 | .startup_delay = 70000, /* 70msec */ | ||
217 | .enable_high = 1, | ||
218 | .enabled_at_boot = 0, | ||
219 | .init_data = &panda_vmmc5, | ||
220 | }; | ||
221 | |||
222 | static struct platform_device omap_vwlan_device = { | ||
223 | .name = "reg-fixed-voltage", | ||
224 | .id = 1, | ||
225 | .dev = { | ||
226 | .platform_data = &panda_vwlan, | ||
227 | }, | ||
228 | }; | ||
229 | |||
230 | struct wl12xx_platform_data omap_panda_wlan_data __initdata = { | ||
231 | .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ), | ||
232 | /* PANDA ref clock is 38.4 MHz */ | ||
233 | .board_ref_clock = 2, | ||
234 | }; | ||
235 | |||
176 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 236 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
177 | { | 237 | { |
178 | int ret = 0; | 238 | int ret = 0; |
@@ -306,7 +366,6 @@ static struct regulator_init_data omap4_panda_vana = { | |||
306 | .constraints = { | 366 | .constraints = { |
307 | .min_uV = 2100000, | 367 | .min_uV = 2100000, |
308 | .max_uV = 2100000, | 368 | .max_uV = 2100000, |
309 | .apply_uV = true, | ||
310 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 369 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
311 | | REGULATOR_MODE_STANDBY, | 370 | | REGULATOR_MODE_STANDBY, |
312 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 371 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -318,7 +377,6 @@ static struct regulator_init_data omap4_panda_vcxio = { | |||
318 | .constraints = { | 377 | .constraints = { |
319 | .min_uV = 1800000, | 378 | .min_uV = 1800000, |
320 | .max_uV = 1800000, | 379 | .max_uV = 1800000, |
321 | .apply_uV = true, | ||
322 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 380 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
323 | | REGULATOR_MODE_STANDBY, | 381 | | REGULATOR_MODE_STANDBY, |
324 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 382 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -330,7 +388,6 @@ static struct regulator_init_data omap4_panda_vdac = { | |||
330 | .constraints = { | 388 | .constraints = { |
331 | .min_uV = 1800000, | 389 | .min_uV = 1800000, |
332 | .max_uV = 1800000, | 390 | .max_uV = 1800000, |
333 | .apply_uV = true, | ||
334 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 391 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
335 | | REGULATOR_MODE_STANDBY, | 392 | | REGULATOR_MODE_STANDBY, |
336 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 393 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -392,10 +449,90 @@ static int __init omap4_panda_i2c_init(void) | |||
392 | 449 | ||
393 | #ifdef CONFIG_OMAP_MUX | 450 | #ifdef CONFIG_OMAP_MUX |
394 | static struct omap_board_mux board_mux[] __initdata = { | 451 | static struct omap_board_mux board_mux[] __initdata = { |
452 | /* WLAN IRQ - GPIO 53 */ | ||
453 | OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT), | ||
454 | /* WLAN POWER ENABLE - GPIO 43 */ | ||
455 | OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT), | ||
456 | /* WLAN SDIO: MMC5 CMD */ | ||
457 | OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
458 | /* WLAN SDIO: MMC5 CLK */ | ||
459 | OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
460 | /* WLAN SDIO: MMC5 DAT[0-3] */ | ||
461 | OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
462 | OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
463 | OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
464 | OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
395 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 465 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
396 | }; | 466 | }; |
467 | |||
468 | static struct omap_device_pad serial2_pads[] __initdata = { | ||
469 | OMAP_MUX_STATIC("uart2_cts.uart2_cts", | ||
470 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
471 | OMAP_MUX_STATIC("uart2_rts.uart2_rts", | ||
472 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
473 | OMAP_MUX_STATIC("uart2_rx.uart2_rx", | ||
474 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
475 | OMAP_MUX_STATIC("uart2_tx.uart2_tx", | ||
476 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
477 | }; | ||
478 | |||
479 | static struct omap_device_pad serial3_pads[] __initdata = { | ||
480 | OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx", | ||
481 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
482 | OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd", | ||
483 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
484 | OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx", | ||
485 | OMAP_PIN_INPUT | OMAP_MUX_MODE0), | ||
486 | OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx", | ||
487 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
488 | }; | ||
489 | |||
490 | static struct omap_device_pad serial4_pads[] __initdata = { | ||
491 | OMAP_MUX_STATIC("uart4_rx.uart4_rx", | ||
492 | OMAP_PIN_INPUT | OMAP_MUX_MODE0), | ||
493 | OMAP_MUX_STATIC("uart4_tx.uart4_tx", | ||
494 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), | ||
495 | }; | ||
496 | |||
497 | static struct omap_board_data serial2_data = { | ||
498 | .id = 1, | ||
499 | .pads = serial2_pads, | ||
500 | .pads_cnt = ARRAY_SIZE(serial2_pads), | ||
501 | }; | ||
502 | |||
503 | static struct omap_board_data serial3_data = { | ||
504 | .id = 2, | ||
505 | .pads = serial3_pads, | ||
506 | .pads_cnt = ARRAY_SIZE(serial3_pads), | ||
507 | }; | ||
508 | |||
509 | static struct omap_board_data serial4_data = { | ||
510 | .id = 3, | ||
511 | .pads = serial4_pads, | ||
512 | .pads_cnt = ARRAY_SIZE(serial4_pads), | ||
513 | }; | ||
514 | |||
515 | static inline void board_serial_init(void) | ||
516 | { | ||
517 | struct omap_board_data bdata; | ||
518 | bdata.flags = 0; | ||
519 | bdata.pads = NULL; | ||
520 | bdata.pads_cnt = 0; | ||
521 | bdata.id = 0; | ||
522 | /* pass dummy data for UART1 */ | ||
523 | omap_serial_init_port(&bdata); | ||
524 | |||
525 | omap_serial_init_port(&serial2_data); | ||
526 | omap_serial_init_port(&serial3_data); | ||
527 | omap_serial_init_port(&serial4_data); | ||
528 | } | ||
397 | #else | 529 | #else |
398 | #define board_mux NULL | 530 | #define board_mux NULL |
531 | |||
532 | static inline void board_serial_init(void) | ||
533 | { | ||
534 | omap_serial_init(); | ||
535 | } | ||
399 | #endif | 536 | #endif |
400 | 537 | ||
401 | static void __init omap4_panda_init(void) | 538 | static void __init omap4_panda_init(void) |
@@ -406,9 +543,13 @@ static void __init omap4_panda_init(void) | |||
406 | package = OMAP_PACKAGE_CBL; | 543 | package = OMAP_PACKAGE_CBL; |
407 | omap4_mux_init(board_mux, package); | 544 | omap4_mux_init(board_mux, package); |
408 | 545 | ||
546 | if (wl12xx_set_platform_data(&omap_panda_wlan_data)) | ||
547 | pr_err("error setting wl12xx data\n"); | ||
548 | |||
409 | omap4_panda_i2c_init(); | 549 | omap4_panda_i2c_init(); |
410 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); | 550 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); |
411 | omap_serial_init(); | 551 | platform_device_register(&omap_vwlan_device); |
552 | board_serial_init(); | ||
412 | omap4_twl6030_hsmmc_init(mmc); | 553 | omap4_twl6030_hsmmc_init(mmc); |
413 | omap4_ehci_init(); | 554 | omap4_ehci_init(); |
414 | usb_musb_init(&musb_board_data); | 555 | usb_musb_init(&musb_board_data); |
@@ -425,7 +566,8 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") | |||
425 | .boot_params = 0x80000100, | 566 | .boot_params = 0x80000100, |
426 | .reserve = omap_reserve, | 567 | .reserve = omap_reserve, |
427 | .map_io = omap4_panda_map_io, | 568 | .map_io = omap4_panda_map_io, |
428 | .init_irq = omap4_panda_init_irq, | 569 | .init_early = omap4_panda_init_early, |
570 | .init_irq = gic_init_irq, | ||
429 | .init_machine = omap4_panda_init, | 571 | .init_machine = omap4_panda_init, |
430 | .timer = &omap_timer, | 572 | .timer = &omap_timer, |
431 | MACHINE_END | 573 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 08770ccec0f3..d0961945c65a 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -358,9 +358,7 @@ static struct regulator_init_data overo_vmmc1 = { | |||
358 | .consumer_supplies = &overo_vmmc1_supply, | 358 | .consumer_supplies = &overo_vmmc1_supply, |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static struct twl4030_codec_audio_data overo_audio_data = { | 361 | static struct twl4030_codec_audio_data overo_audio_data; |
362 | .audio_mclk = 26000000, | ||
363 | }; | ||
364 | 362 | ||
365 | static struct twl4030_codec_data overo_codec_data = { | 363 | static struct twl4030_codec_data overo_codec_data = { |
366 | .audio_mclk = 26000000, | 364 | .audio_mclk = 26000000, |
@@ -409,14 +407,11 @@ static struct omap_board_config_kernel overo_config[] __initdata = { | |||
409 | { OMAP_TAG_LCD, &overo_lcd_config }, | 407 | { OMAP_TAG_LCD, &overo_lcd_config }, |
410 | }; | 408 | }; |
411 | 409 | ||
412 | static void __init overo_init_irq(void) | 410 | static void __init overo_init_early(void) |
413 | { | 411 | { |
414 | omap_board_config = overo_config; | ||
415 | omap_board_config_size = ARRAY_SIZE(overo_config); | ||
416 | omap2_init_common_infrastructure(); | 412 | omap2_init_common_infrastructure(); |
417 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 413 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
418 | mt46h32m32lf6_sdrc_params); | 414 | mt46h32m32lf6_sdrc_params); |
419 | omap_init_irq(); | ||
420 | } | 415 | } |
421 | 416 | ||
422 | static struct platform_device *overo_devices[] __initdata = { | 417 | static struct platform_device *overo_devices[] __initdata = { |
@@ -449,6 +444,8 @@ static struct omap_musb_board_data musb_board_data = { | |||
449 | static void __init overo_init(void) | 444 | static void __init overo_init(void) |
450 | { | 445 | { |
451 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 446 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
447 | omap_board_config = overo_config; | ||
448 | omap_board_config_size = ARRAY_SIZE(overo_config); | ||
452 | overo_i2c_init(); | 449 | overo_i2c_init(); |
453 | platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); | 450 | platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); |
454 | omap_serial_init(); | 451 | omap_serial_init(); |
@@ -501,9 +498,10 @@ static void __init overo_init(void) | |||
501 | 498 | ||
502 | MACHINE_START(OVERO, "Gumstix Overo") | 499 | MACHINE_START(OVERO, "Gumstix Overo") |
503 | .boot_params = 0x80000100, | 500 | .boot_params = 0x80000100, |
504 | .map_io = omap3_map_io, | ||
505 | .reserve = omap_reserve, | 501 | .reserve = omap_reserve, |
506 | .init_irq = overo_init_irq, | 502 | .map_io = omap3_map_io, |
503 | .init_early = overo_init_early, | ||
504 | .init_irq = omap_init_irq, | ||
507 | .init_machine = overo_init, | 505 | .init_machine = overo_init, |
508 | .timer = &omap_timer, | 506 | .timer = &omap_timer, |
509 | MACHINE_END | 507 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index 39a71bb8a308..2af8b05e786d 100644 --- a/arch/arm/mach-omap2/board-rm680.c +++ b/arch/arm/mach-omap2/board-rm680.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "sdram-nokia.h" | 33 | #include "sdram-nokia.h" |
34 | 34 | ||
35 | static struct regulator_consumer_supply rm680_vemmc_consumers[] = { | 35 | static struct regulator_consumer_supply rm680_vemmc_consumers[] = { |
36 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), | 36 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
37 | }; | 37 | }; |
38 | 38 | ||
39 | /* Fixed regulator for internal eMMC */ | 39 | /* Fixed regulator for internal eMMC */ |
@@ -138,14 +138,13 @@ static void __init rm680_peripherals_init(void) | |||
138 | omap2_hsmmc_init(mmc); | 138 | omap2_hsmmc_init(mmc); |
139 | } | 139 | } |
140 | 140 | ||
141 | static void __init rm680_init_irq(void) | 141 | static void __init rm680_init_early(void) |
142 | { | 142 | { |
143 | struct omap_sdrc_params *sdrc_params; | 143 | struct omap_sdrc_params *sdrc_params; |
144 | 144 | ||
145 | omap2_init_common_infrastructure(); | 145 | omap2_init_common_infrastructure(); |
146 | sdrc_params = nokia_get_sdram_timings(); | 146 | sdrc_params = nokia_get_sdram_timings(); |
147 | omap2_init_common_devices(sdrc_params, sdrc_params); | 147 | omap2_init_common_devices(sdrc_params, sdrc_params); |
148 | omap_init_irq(); | ||
149 | } | 148 | } |
150 | 149 | ||
151 | #ifdef CONFIG_OMAP_MUX | 150 | #ifdef CONFIG_OMAP_MUX |
@@ -176,9 +175,10 @@ static void __init rm680_map_io(void) | |||
176 | 175 | ||
177 | MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") | 176 | MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") |
178 | .boot_params = 0x80000100, | 177 | .boot_params = 0x80000100, |
179 | .map_io = rm680_map_io, | ||
180 | .reserve = omap_reserve, | 178 | .reserve = omap_reserve, |
181 | .init_irq = rm680_init_irq, | 179 | .map_io = rm680_map_io, |
180 | .init_early = rm680_init_early, | ||
181 | .init_irq = omap_init_irq, | ||
182 | .init_machine = rm680_init, | 182 | .init_machine = rm680_init, |
183 | .timer = &omap_timer, | 183 | .timer = &omap_timer, |
184 | MACHINE_END | 184 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index e75e240cad67..5f1900c532ec 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #include <sound/tlv320aic3x.h> | 37 | #include <sound/tlv320aic3x.h> |
38 | #include <sound/tpa6130a2-plat.h> | 38 | #include <sound/tpa6130a2-plat.h> |
39 | #include <media/radio-si4713.h> | ||
40 | #include <media/si4713.h> | ||
39 | 41 | ||
40 | #include <../drivers/staging/iio/light/tsl2563.h> | 42 | #include <../drivers/staging/iio/light/tsl2563.h> |
41 | 43 | ||
@@ -47,6 +49,8 @@ | |||
47 | 49 | ||
48 | #define RX51_WL1251_POWER_GPIO 87 | 50 | #define RX51_WL1251_POWER_GPIO 87 |
49 | #define RX51_WL1251_IRQ_GPIO 42 | 51 | #define RX51_WL1251_IRQ_GPIO 42 |
52 | #define RX51_FMTX_RESET_GPIO 163 | ||
53 | #define RX51_FMTX_IRQ 53 | ||
50 | 54 | ||
51 | /* list all spi devices here */ | 55 | /* list all spi devices here */ |
52 | enum { | 56 | enum { |
@@ -331,13 +335,13 @@ static struct omap2_hsmmc_info mmc[] __initdata = { | |||
331 | }; | 335 | }; |
332 | 336 | ||
333 | static struct regulator_consumer_supply rx51_vmmc1_supply = | 337 | static struct regulator_consumer_supply rx51_vmmc1_supply = |
334 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 338 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
335 | 339 | ||
336 | static struct regulator_consumer_supply rx51_vaux3_supply = | 340 | static struct regulator_consumer_supply rx51_vaux3_supply = |
337 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 341 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
338 | 342 | ||
339 | static struct regulator_consumer_supply rx51_vsim_supply = | 343 | static struct regulator_consumer_supply rx51_vsim_supply = |
340 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | 344 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); |
341 | 345 | ||
342 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { | 346 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { |
343 | /* tlv320aic3x analog supplies */ | 347 | /* tlv320aic3x analog supplies */ |
@@ -348,7 +352,7 @@ static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { | |||
348 | /* tpa6130a2 */ | 352 | /* tpa6130a2 */ |
349 | REGULATOR_SUPPLY("Vdd", "2-0060"), | 353 | REGULATOR_SUPPLY("Vdd", "2-0060"), |
350 | /* Keep vmmc as last item. It is not iterated for newer boards */ | 354 | /* Keep vmmc as last item. It is not iterated for newer boards */ |
351 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), | 355 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
352 | }; | 356 | }; |
353 | 357 | ||
354 | static struct regulator_consumer_supply rx51_vio_supplies[] = { | 358 | static struct regulator_consumer_supply rx51_vio_supplies[] = { |
@@ -357,10 +361,14 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = { | |||
357 | REGULATOR_SUPPLY("DVDD", "2-0018"), | 361 | REGULATOR_SUPPLY("DVDD", "2-0018"), |
358 | REGULATOR_SUPPLY("IOVDD", "2-0019"), | 362 | REGULATOR_SUPPLY("IOVDD", "2-0019"), |
359 | REGULATOR_SUPPLY("DVDD", "2-0019"), | 363 | REGULATOR_SUPPLY("DVDD", "2-0019"), |
364 | /* Si4713 IO supply */ | ||
365 | REGULATOR_SUPPLY("vio", "2-0063"), | ||
360 | }; | 366 | }; |
361 | 367 | ||
362 | static struct regulator_consumer_supply rx51_vaux1_consumers[] = { | 368 | static struct regulator_consumer_supply rx51_vaux1_consumers[] = { |
363 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), | 369 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), |
370 | /* Si4713 supply */ | ||
371 | REGULATOR_SUPPLY("vdd", "2-0063"), | ||
364 | }; | 372 | }; |
365 | 373 | ||
366 | static struct regulator_consumer_supply rx51_vdac_supply[] = { | 374 | static struct regulator_consumer_supply rx51_vdac_supply[] = { |
@@ -511,6 +519,41 @@ static struct regulator_init_data rx51_vio = { | |||
511 | .consumer_supplies = rx51_vio_supplies, | 519 | .consumer_supplies = rx51_vio_supplies, |
512 | }; | 520 | }; |
513 | 521 | ||
522 | static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { | ||
523 | .gpio_reset = RX51_FMTX_RESET_GPIO, | ||
524 | }; | ||
525 | |||
526 | static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = { | ||
527 | I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH), | ||
528 | .platform_data = &rx51_si4713_i2c_data, | ||
529 | }; | ||
530 | |||
531 | static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = { | ||
532 | .i2c_bus = 2, | ||
533 | .subdev_board_info = &rx51_si4713_board_info, | ||
534 | }; | ||
535 | |||
536 | static struct platform_device rx51_si4713_dev __initdata_or_module = { | ||
537 | .name = "radio-si4713", | ||
538 | .id = -1, | ||
539 | .dev = { | ||
540 | .platform_data = &rx51_si4713_data, | ||
541 | }, | ||
542 | }; | ||
543 | |||
544 | static __init void rx51_init_si4713(void) | ||
545 | { | ||
546 | int err; | ||
547 | |||
548 | err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq"); | ||
549 | if (err) { | ||
550 | printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err); | ||
551 | return; | ||
552 | } | ||
553 | rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ); | ||
554 | platform_device_register(&rx51_si4713_dev); | ||
555 | } | ||
556 | |||
514 | static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) | 557 | static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) |
515 | { | 558 | { |
516 | /* FIXME this gpio setup is just a placeholder for now */ | 559 | /* FIXME this gpio setup is just a placeholder for now */ |
@@ -699,6 +742,14 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = { | |||
699 | .resource_config = twl4030_rconfig, | 742 | .resource_config = twl4030_rconfig, |
700 | }; | 743 | }; |
701 | 744 | ||
745 | struct twl4030_codec_vibra_data rx51_vibra_data __initdata = { | ||
746 | .coexist = 0, | ||
747 | }; | ||
748 | |||
749 | struct twl4030_codec_data rx51_codec_data __initdata = { | ||
750 | .audio_mclk = 26000000, | ||
751 | .vibra = &rx51_vibra_data, | ||
752 | }; | ||
702 | 753 | ||
703 | static struct twl4030_platform_data rx51_twldata __initdata = { | 754 | static struct twl4030_platform_data rx51_twldata __initdata = { |
704 | .irq_base = TWL4030_IRQ_BASE, | 755 | .irq_base = TWL4030_IRQ_BASE, |
@@ -710,6 +761,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = { | |||
710 | .madc = &rx51_madc_data, | 761 | .madc = &rx51_madc_data, |
711 | .usb = &rx51_usb_data, | 762 | .usb = &rx51_usb_data, |
712 | .power = &rx51_t2scripts_data, | 763 | .power = &rx51_t2scripts_data, |
764 | .codec = &rx51_codec_data, | ||
713 | 765 | ||
714 | .vaux1 = &rx51_vaux1, | 766 | .vaux1 = &rx51_vaux1, |
715 | .vaux2 = &rx51_vaux2, | 767 | .vaux2 = &rx51_vaux2, |
@@ -921,6 +973,7 @@ void __init rx51_peripherals_init(void) | |||
921 | board_smc91x_init(); | 973 | board_smc91x_init(); |
922 | rx51_add_gpio_keys(); | 974 | rx51_add_gpio_keys(); |
923 | rx51_init_wl1251(); | 975 | rx51_init_wl1251(); |
976 | rx51_init_si4713(); | ||
924 | spi_register_board_info(rx51_peripherals_spi_board_info, | 977 | spi_register_board_info(rx51_peripherals_spi_board_info, |
925 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); | 978 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); |
926 | 979 | ||
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c index acd670054d9a..89a66db8b77d 100644 --- a/arch/arm/mach-omap2/board-rx51-video.c +++ b/arch/arm/mach-omap2/board-rx51-video.c | |||
@@ -66,18 +66,6 @@ static struct omap_dss_board_info rx51_dss_board_info = { | |||
66 | .default_device = &rx51_lcd_device, | 66 | .default_device = &rx51_lcd_device, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct platform_device rx51_display_device = { | ||
70 | .name = "omapdss", | ||
71 | .id = -1, | ||
72 | .dev = { | ||
73 | .platform_data = &rx51_dss_board_info, | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | static struct platform_device *rx51_video_devices[] __initdata = { | ||
78 | &rx51_display_device, | ||
79 | }; | ||
80 | |||
81 | static int __init rx51_video_init(void) | 69 | static int __init rx51_video_init(void) |
82 | { | 70 | { |
83 | if (!machine_is_nokia_rx51()) | 71 | if (!machine_is_nokia_rx51()) |
@@ -95,8 +83,7 @@ static int __init rx51_video_init(void) | |||
95 | 83 | ||
96 | gpio_direction_output(RX51_LCD_RESET_GPIO, 1); | 84 | gpio_direction_output(RX51_LCD_RESET_GPIO, 1); |
97 | 85 | ||
98 | platform_add_devices(rx51_video_devices, | 86 | omap_display_init(&rx51_dss_board_info); |
99 | ARRAY_SIZE(rx51_video_devices)); | ||
100 | return 0; | 87 | return 0; |
101 | } | 88 | } |
102 | 89 | ||
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index f53fc551c58f..e964895b80e8 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
@@ -98,17 +98,13 @@ static struct omap_board_config_kernel rx51_config[] = { | |||
98 | { OMAP_TAG_LCD, &rx51_lcd_config }, | 98 | { OMAP_TAG_LCD, &rx51_lcd_config }, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | static void __init rx51_init_irq(void) | 101 | static void __init rx51_init_early(void) |
102 | { | 102 | { |
103 | struct omap_sdrc_params *sdrc_params; | 103 | struct omap_sdrc_params *sdrc_params; |
104 | 104 | ||
105 | omap_board_config = rx51_config; | ||
106 | omap_board_config_size = ARRAY_SIZE(rx51_config); | ||
107 | omap3_pm_init_cpuidle(rx51_cpuidle_params); | ||
108 | omap2_init_common_infrastructure(); | 105 | omap2_init_common_infrastructure(); |
109 | sdrc_params = nokia_get_sdram_timings(); | 106 | sdrc_params = nokia_get_sdram_timings(); |
110 | omap2_init_common_devices(sdrc_params, sdrc_params); | 107 | omap2_init_common_devices(sdrc_params, sdrc_params); |
111 | omap_init_irq(); | ||
112 | } | 108 | } |
113 | 109 | ||
114 | extern void __init rx51_peripherals_init(void); | 110 | extern void __init rx51_peripherals_init(void); |
@@ -128,6 +124,9 @@ static struct omap_musb_board_data musb_board_data = { | |||
128 | static void __init rx51_init(void) | 124 | static void __init rx51_init(void) |
129 | { | 125 | { |
130 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 126 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
127 | omap_board_config = rx51_config; | ||
128 | omap_board_config_size = ARRAY_SIZE(rx51_config); | ||
129 | omap3_pm_init_cpuidle(rx51_cpuidle_params); | ||
131 | omap_serial_init(); | 130 | omap_serial_init(); |
132 | usb_musb_init(&musb_board_data); | 131 | usb_musb_init(&musb_board_data); |
133 | rx51_peripherals_init(); | 132 | rx51_peripherals_init(); |
@@ -149,9 +148,10 @@ static void __init rx51_map_io(void) | |||
149 | MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") | 148 | MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") |
150 | /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */ | 149 | /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */ |
151 | .boot_params = 0x80000100, | 150 | .boot_params = 0x80000100, |
152 | .map_io = rx51_map_io, | ||
153 | .reserve = omap_reserve, | 151 | .reserve = omap_reserve, |
154 | .init_irq = rx51_init_irq, | 152 | .map_io = rx51_map_io, |
153 | .init_early = rx51_init_early, | ||
154 | .init_irq = omap_init_irq, | ||
155 | .init_machine = rx51_init, | 155 | .init_machine = rx51_init, |
156 | .timer = &omap_timer, | 156 | .timer = &omap_timer, |
157 | MACHINE_END | 157 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c new file mode 100644 index 000000000000..09fa7bfff8d6 --- /dev/null +++ b/arch/arm/mach-omap2/board-ti8168evm.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Code for TI8168 EVM. | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | |||
18 | #include <mach/hardware.h> | ||
19 | #include <asm/mach-types.h> | ||
20 | #include <asm/mach/arch.h> | ||
21 | #include <asm/mach/map.h> | ||
22 | |||
23 | #include <plat/irqs.h> | ||
24 | #include <plat/board.h> | ||
25 | #include <plat/common.h> | ||
26 | |||
27 | static struct omap_board_config_kernel ti8168_evm_config[] __initdata = { | ||
28 | }; | ||
29 | |||
30 | static void __init ti8168_init_early(void) | ||
31 | { | ||
32 | omap2_init_common_infrastructure(); | ||
33 | omap2_init_common_devices(NULL, NULL); | ||
34 | } | ||
35 | |||
36 | static void __init ti8168_evm_init_irq(void) | ||
37 | { | ||
38 | omap_init_irq(); | ||
39 | } | ||
40 | |||
41 | static void __init ti8168_evm_init(void) | ||
42 | { | ||
43 | omap_serial_init(); | ||
44 | omap_board_config = ti8168_evm_config; | ||
45 | omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); | ||
46 | } | ||
47 | |||
48 | static void __init ti8168_evm_map_io(void) | ||
49 | { | ||
50 | omap2_set_globals_ti816x(); | ||
51 | omapti816x_map_common_io(); | ||
52 | } | ||
53 | |||
54 | MACHINE_START(TI8168EVM, "ti8168evm") | ||
55 | /* Maintainer: Texas Instruments */ | ||
56 | .boot_params = 0x80000100, | ||
57 | .map_io = ti8168_evm_map_io, | ||
58 | .init_early = ti8168_init_early, | ||
59 | .init_irq = ti8168_evm_init_irq, | ||
60 | .timer = &omap_timer, | ||
61 | .init_machine = ti8168_evm_init, | ||
62 | MACHINE_END | ||
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c index 6bcd43657aed..37b84c2b850f 100644 --- a/arch/arm/mach-omap2/board-zoom-display.c +++ b/arch/arm/mach-omap2/board-zoom-display.c | |||
@@ -130,14 +130,6 @@ static struct omap_dss_board_info zoom_dss_data = { | |||
130 | .default_device = &zoom_lcd_device, | 130 | .default_device = &zoom_lcd_device, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static struct platform_device zoom_dss_device = { | ||
134 | .name = "omapdss", | ||
135 | .id = -1, | ||
136 | .dev = { | ||
137 | .platform_data = &zoom_dss_data, | ||
138 | }, | ||
139 | }; | ||
140 | |||
141 | static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { | 133 | static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { |
142 | .turbo_mode = 1, | 134 | .turbo_mode = 1, |
143 | .single_channel = 1, /* 0: slave, 1: master */ | 135 | .single_channel = 1, /* 0: slave, 1: master */ |
@@ -153,14 +145,9 @@ static struct spi_board_info nec_8048_spi_board_info[] __initdata = { | |||
153 | }, | 145 | }, |
154 | }; | 146 | }; |
155 | 147 | ||
156 | static struct platform_device *zoom_display_devices[] __initdata = { | ||
157 | &zoom_dss_device, | ||
158 | }; | ||
159 | |||
160 | void __init zoom_display_init(void) | 148 | void __init zoom_display_init(void) |
161 | { | 149 | { |
162 | platform_add_devices(zoom_display_devices, | 150 | omap_display_init(&zoom_dss_data); |
163 | ARRAY_SIZE(zoom_display_devices)); | ||
164 | spi_register_board_info(nec_8048_spi_board_info, | 151 | spi_register_board_info(nec_8048_spi_board_info, |
165 | ARRAY_SIZE(nec_8048_spi_board_info)); | 152 | ARRAY_SIZE(nec_8048_spi_board_info)); |
166 | zoom_lcd_panel_init(); | 153 | zoom_lcd_panel_init(); |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index e0e040f34c68..448ab60195d5 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -118,7 +118,7 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = { | |||
118 | 118 | ||
119 | static struct regulator_consumer_supply zoom_vmmc3_supply = { | 119 | static struct regulator_consumer_supply zoom_vmmc3_supply = { |
120 | .supply = "vmmc", | 120 | .supply = "vmmc", |
121 | .dev_name = "mmci-omap-hs.2", | 121 | .dev_name = "omap_hsmmc.2", |
122 | }; | 122 | }; |
123 | 123 | ||
124 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 124 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
@@ -322,9 +322,7 @@ static struct twl4030_madc_platform_data zoom_madc_data = { | |||
322 | .irq_line = 1, | 322 | .irq_line = 1, |
323 | }; | 323 | }; |
324 | 324 | ||
325 | static struct twl4030_codec_audio_data zoom_audio_data = { | 325 | static struct twl4030_codec_audio_data zoom_audio_data; |
326 | .audio_mclk = 26000000, | ||
327 | }; | ||
328 | 326 | ||
329 | static struct twl4030_codec_data zoom_codec_data = { | 327 | static struct twl4030_codec_data zoom_codec_data = { |
330 | .audio_mclk = 26000000, | 328 | .audio_mclk = 26000000, |
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c index 1dd195afa396..4b133d75c935 100644 --- a/arch/arm/mach-omap2/board-zoom.c +++ b/arch/arm/mach-omap2/board-zoom.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/i2c/twl.h> | 18 | #include <linux/i2c/twl.h> |
19 | #include <linux/mtd/nand.h> | ||
19 | 20 | ||
20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -33,7 +34,7 @@ | |||
33 | 34 | ||
34 | #define ZOOM3_EHCI_RESET_GPIO 64 | 35 | #define ZOOM3_EHCI_RESET_GPIO 64 |
35 | 36 | ||
36 | static void __init omap_zoom_init_irq(void) | 37 | static void __init omap_zoom_init_early(void) |
37 | { | 38 | { |
38 | omap2_init_common_infrastructure(); | 39 | omap2_init_common_infrastructure(); |
39 | if (machine_is_omap_zoom2()) | 40 | if (machine_is_omap_zoom2()) |
@@ -42,14 +43,12 @@ static void __init omap_zoom_init_irq(void) | |||
42 | else if (machine_is_omap_zoom3()) | 43 | else if (machine_is_omap_zoom3()) |
43 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, | 44 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, |
44 | h8mbx00u0mer0em_sdrc_params); | 45 | h8mbx00u0mer0em_sdrc_params); |
45 | |||
46 | omap_init_irq(); | ||
47 | } | 46 | } |
48 | 47 | ||
49 | #ifdef CONFIG_OMAP_MUX | 48 | #ifdef CONFIG_OMAP_MUX |
50 | static struct omap_board_mux board_mux[] __initdata = { | 49 | static struct omap_board_mux board_mux[] __initdata = { |
51 | /* WLAN IRQ - GPIO 162 */ | 50 | /* WLAN IRQ - GPIO 162 */ |
52 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), | 51 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
53 | /* WLAN POWER ENABLE - GPIO 101 */ | 52 | /* WLAN POWER ENABLE - GPIO 101 */ |
54 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 53 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
55 | /* WLAN SDIO: MMC3 CMD */ | 54 | /* WLAN SDIO: MMC3 CMD */ |
@@ -126,8 +125,8 @@ static void __init omap_zoom_init(void) | |||
126 | usbhs_init(&usbhs_bdata); | 125 | usbhs_init(&usbhs_bdata); |
127 | } | 126 | } |
128 | 127 | ||
129 | board_nand_init(zoom_nand_partitions, | 128 | board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions), |
130 | ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); | 129 | ZOOM_NAND_CS, NAND_BUSWIDTH_16); |
131 | zoom_debugboard_init(); | 130 | zoom_debugboard_init(); |
132 | zoom_peripherals_init(); | 131 | zoom_peripherals_init(); |
133 | zoom_display_init(); | 132 | zoom_display_init(); |
@@ -135,18 +134,20 @@ static void __init omap_zoom_init(void) | |||
135 | 134 | ||
136 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") | 135 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") |
137 | .boot_params = 0x80000100, | 136 | .boot_params = 0x80000100, |
138 | .map_io = omap3_map_io, | ||
139 | .reserve = omap_reserve, | 137 | .reserve = omap_reserve, |
140 | .init_irq = omap_zoom_init_irq, | 138 | .map_io = omap3_map_io, |
139 | .init_early = omap_zoom_init_early, | ||
140 | .init_irq = omap_init_irq, | ||
141 | .init_machine = omap_zoom_init, | 141 | .init_machine = omap_zoom_init, |
142 | .timer = &omap_timer, | 142 | .timer = &omap_timer, |
143 | MACHINE_END | 143 | MACHINE_END |
144 | 144 | ||
145 | MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") | 145 | MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") |
146 | .boot_params = 0x80000100, | 146 | .boot_params = 0x80000100, |
147 | .map_io = omap3_map_io, | ||
148 | .reserve = omap_reserve, | 147 | .reserve = omap_reserve, |
149 | .init_irq = omap_zoom_init_irq, | 148 | .map_io = omap3_map_io, |
149 | .init_early = omap_zoom_init_early, | ||
150 | .init_irq = omap_init_irq, | ||
150 | .init_machine = omap_zoom_init, | 151 | .init_machine = omap_zoom_init, |
151 | .timer = &omap_timer, | 152 | .timer = &omap_timer, |
152 | MACHINE_END | 153 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index f51cffd1fc53..b19a1f7234ae 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c | |||
@@ -78,6 +78,26 @@ static int omap2_clk_apll54_enable(struct clk *clk) | |||
78 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); | 78 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); |
79 | } | 79 | } |
80 | 80 | ||
81 | static void _apll96_allow_idle(struct clk *clk) | ||
82 | { | ||
83 | omap2xxx_cm_set_apll96_auto_low_power_stop(); | ||
84 | } | ||
85 | |||
86 | static void _apll96_deny_idle(struct clk *clk) | ||
87 | { | ||
88 | omap2xxx_cm_set_apll96_disable_autoidle(); | ||
89 | } | ||
90 | |||
91 | static void _apll54_allow_idle(struct clk *clk) | ||
92 | { | ||
93 | omap2xxx_cm_set_apll54_auto_low_power_stop(); | ||
94 | } | ||
95 | |||
96 | static void _apll54_deny_idle(struct clk *clk) | ||
97 | { | ||
98 | omap2xxx_cm_set_apll54_disable_autoidle(); | ||
99 | } | ||
100 | |||
81 | /* Stop APLL */ | 101 | /* Stop APLL */ |
82 | static void omap2_clk_apll_disable(struct clk *clk) | 102 | static void omap2_clk_apll_disable(struct clk *clk) |
83 | { | 103 | { |
@@ -93,11 +113,15 @@ static void omap2_clk_apll_disable(struct clk *clk) | |||
93 | const struct clkops clkops_apll96 = { | 113 | const struct clkops clkops_apll96 = { |
94 | .enable = omap2_clk_apll96_enable, | 114 | .enable = omap2_clk_apll96_enable, |
95 | .disable = omap2_clk_apll_disable, | 115 | .disable = omap2_clk_apll_disable, |
116 | .allow_idle = _apll96_allow_idle, | ||
117 | .deny_idle = _apll96_deny_idle, | ||
96 | }; | 118 | }; |
97 | 119 | ||
98 | const struct clkops clkops_apll54 = { | 120 | const struct clkops clkops_apll54 = { |
99 | .enable = omap2_clk_apll54_enable, | 121 | .enable = omap2_clk_apll54_enable, |
100 | .disable = omap2_clk_apll_disable, | 122 | .disable = omap2_clk_apll_disable, |
123 | .allow_idle = _apll54_allow_idle, | ||
124 | .deny_idle = _apll54_deny_idle, | ||
101 | }; | 125 | }; |
102 | 126 | ||
103 | /* Public functions */ | 127 | /* Public functions */ |
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpll.c b/arch/arm/mach-omap2/clkt2xxx_dpll.c new file mode 100644 index 000000000000..1502a7bc20bb --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_dpll.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * OMAP2-specific DPLL control functions | ||
3 | * | ||
4 | * Copyright (C) 2011 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/errno.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/io.h> | ||
16 | |||
17 | #include <plat/clock.h> | ||
18 | |||
19 | #include "clock.h" | ||
20 | #include "cm2xxx_3xxx.h" | ||
21 | #include "cm-regbits-24xx.h" | ||
22 | |||
23 | /* Private functions */ | ||
24 | |||
25 | /** | ||
26 | * _allow_idle - enable DPLL autoidle bits | ||
27 | * @clk: struct clk * of the DPLL to operate on | ||
28 | * | ||
29 | * Enable DPLL automatic idle control. The DPLL will enter low-power | ||
30 | * stop when its downstream clocks are gated. No return value. | ||
31 | * REVISIT: DPLL can optionally enter low-power bypass by writing 0x1 | ||
32 | * instead. Add some mechanism to optionally enter this mode. | ||
33 | */ | ||
34 | static void _allow_idle(struct clk *clk) | ||
35 | { | ||
36 | if (!clk || !clk->dpll_data) | ||
37 | return; | ||
38 | |||
39 | omap2xxx_cm_set_dpll_auto_low_power_stop(); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * _deny_idle - prevent DPLL from automatically idling | ||
44 | * @clk: struct clk * of the DPLL to operate on | ||
45 | * | ||
46 | * Disable DPLL automatic idle control. No return value. | ||
47 | */ | ||
48 | static void _deny_idle(struct clk *clk) | ||
49 | { | ||
50 | if (!clk || !clk->dpll_data) | ||
51 | return; | ||
52 | |||
53 | omap2xxx_cm_set_dpll_disable_autoidle(); | ||
54 | } | ||
55 | |||
56 | |||
57 | /* Public data */ | ||
58 | |||
59 | const struct clkops clkops_omap2xxx_dpll_ops = { | ||
60 | .allow_idle = _allow_idle, | ||
61 | .deny_idle = _deny_idle, | ||
62 | }; | ||
63 | |||
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c index df7b80506483..c3460928b5e0 100644 --- a/arch/arm/mach-omap2/clkt2xxx_osc.c +++ b/arch/arm/mach-omap2/clkt2xxx_osc.c | |||
@@ -30,6 +30,13 @@ | |||
30 | #include "prm2xxx_3xxx.h" | 30 | #include "prm2xxx_3xxx.h" |
31 | #include "prm-regbits-24xx.h" | 31 | #include "prm-regbits-24xx.h" |
32 | 32 | ||
33 | /* | ||
34 | * XXX This does not actually enable the osc_ck, since the osc_ck must | ||
35 | * be running for this function to be called. Instead, this function | ||
36 | * is used to disable an autoidle mode on the osc_ck. The existing | ||
37 | * clk_enable/clk_disable()-based usecounting for osc_ck should be | ||
38 | * replaced with autoidle-based usecounting. | ||
39 | */ | ||
33 | static int omap2_enable_osc_ck(struct clk *clk) | 40 | static int omap2_enable_osc_ck(struct clk *clk) |
34 | { | 41 | { |
35 | u32 pcc; | 42 | u32 pcc; |
@@ -41,6 +48,13 @@ static int omap2_enable_osc_ck(struct clk *clk) | |||
41 | return 0; | 48 | return 0; |
42 | } | 49 | } |
43 | 50 | ||
51 | /* | ||
52 | * XXX This does not actually disable the osc_ck, since doing so would | ||
53 | * immediately halt the system. Instead, this function is used to | ||
54 | * enable an autoidle mode on the osc_ck. The existing | ||
55 | * clk_enable/clk_disable()-based usecounting for osc_ck should be | ||
56 | * replaced with autoidle-based usecounting. | ||
57 | */ | ||
44 | static void omap2_disable_osc_ck(struct clk *clk) | 58 | static void omap2_disable_osc_ck(struct clk *clk) |
45 | { | 59 | { |
46 | u32 pcc; | 60 | u32 pcc; |
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c index a781cd6795a4..e25364de028a 100644 --- a/arch/arm/mach-omap2/clkt_clksel.c +++ b/arch/arm/mach-omap2/clkt_clksel.c | |||
@@ -97,7 +97,7 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk, | |||
97 | u32 *field_val) | 97 | u32 *field_val) |
98 | { | 98 | { |
99 | const struct clksel *clks; | 99 | const struct clksel *clks; |
100 | const struct clksel_rate *clkr, *max_clkr; | 100 | const struct clksel_rate *clkr, *max_clkr = NULL; |
101 | u8 max_div = 0; | 101 | u8 max_div = 0; |
102 | 102 | ||
103 | clks = _get_clksel_by_parent(clk, src_clk); | 103 | clks = _get_clksel_by_parent(clk, src_clk); |
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index acb7ae5b0a25..bcffee001bfa 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -178,12 +178,11 @@ void omap2_init_dpll_parent(struct clk *clk) | |||
178 | if (!dd) | 178 | if (!dd) |
179 | return; | 179 | return; |
180 | 180 | ||
181 | /* Return bypass rate if DPLL is bypassed */ | ||
182 | v = __raw_readl(dd->control_reg); | 181 | v = __raw_readl(dd->control_reg); |
183 | v &= dd->enable_mask; | 182 | v &= dd->enable_mask; |
184 | v >>= __ffs(dd->enable_mask); | 183 | v >>= __ffs(dd->enable_mask); |
185 | 184 | ||
186 | /* Reparent in case the dpll is in bypass */ | 185 | /* Reparent the struct clk in case the dpll is in bypass */ |
187 | if (cpu_is_omap24xx()) { | 186 | if (cpu_is_omap24xx()) { |
188 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | 187 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || |
189 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | 188 | v == OMAP2XXX_EN_DPLL_FRBYPASS) |
@@ -260,50 +259,22 @@ u32 omap2_get_dpll_rate(struct clk *clk) | |||
260 | /* DPLL rate rounding code */ | 259 | /* DPLL rate rounding code */ |
261 | 260 | ||
262 | /** | 261 | /** |
263 | * omap2_dpll_set_rate_tolerance: set the error tolerance during rate rounding | ||
264 | * @clk: struct clk * of the DPLL | ||
265 | * @tolerance: maximum rate error tolerance | ||
266 | * | ||
267 | * Set the maximum DPLL rate error tolerance for the rate rounding | ||
268 | * algorithm. The rate tolerance is an attempt to balance DPLL power | ||
269 | * saving (the least divider value "n") vs. rate fidelity (the least | ||
270 | * difference between the desired DPLL target rate and the rounded | ||
271 | * rate out of the algorithm). So, increasing the tolerance is likely | ||
272 | * to decrease DPLL power consumption and increase DPLL rate error. | ||
273 | * Returns -EINVAL if provided a null clock ptr or a clk that is not a | ||
274 | * DPLL; or 0 upon success. | ||
275 | */ | ||
276 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance) | ||
277 | { | ||
278 | if (!clk || !clk->dpll_data) | ||
279 | return -EINVAL; | ||
280 | |||
281 | clk->dpll_data->rate_tolerance = tolerance; | ||
282 | |||
283 | return 0; | ||
284 | } | ||
285 | |||
286 | /** | ||
287 | * omap2_dpll_round_rate - round a target rate for an OMAP DPLL | 262 | * omap2_dpll_round_rate - round a target rate for an OMAP DPLL |
288 | * @clk: struct clk * for a DPLL | 263 | * @clk: struct clk * for a DPLL |
289 | * @target_rate: desired DPLL clock rate | 264 | * @target_rate: desired DPLL clock rate |
290 | * | 265 | * |
291 | * Given a DPLL, a desired target rate, and a rate tolerance, round | 266 | * Given a DPLL and a desired target rate, round the target rate to a |
292 | * the target rate to a possible, programmable rate for this DPLL. | 267 | * possible, programmable rate for this DPLL. Attempts to select the |
293 | * Rate tolerance is assumed to be set by the caller before this | 268 | * minimum possible n. Stores the computed (m, n) in the DPLL's |
294 | * function is called. Attempts to select the minimum possible n | 269 | * dpll_data structure so set_rate() will not need to call this |
295 | * within the tolerance to reduce power consumption. Stores the | 270 | * (expensive) function again. Returns ~0 if the target rate cannot |
296 | * computed (m, n) in the DPLL's dpll_data structure so set_rate() | 271 | * be rounded, or the rounded rate upon success. |
297 | * will not need to call this (expensive) function again. Returns ~0 | ||
298 | * if the target rate cannot be rounded, either because the rate is | ||
299 | * too low or because the rate tolerance is set too tightly; or the | ||
300 | * rounded rate upon success. | ||
301 | */ | 272 | */ |
302 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | 273 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) |
303 | { | 274 | { |
304 | int m, n, r, e, scaled_max_m; | 275 | int m, n, r, scaled_max_m; |
305 | unsigned long scaled_rt_rp, new_rate; | 276 | unsigned long scaled_rt_rp; |
306 | int min_e = -1, min_e_m = -1, min_e_n = -1; | 277 | unsigned long new_rate = 0; |
307 | struct dpll_data *dd; | 278 | struct dpll_data *dd; |
308 | 279 | ||
309 | if (!clk || !clk->dpll_data) | 280 | if (!clk || !clk->dpll_data) |
@@ -311,8 +282,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | |||
311 | 282 | ||
312 | dd = clk->dpll_data; | 283 | dd = clk->dpll_data; |
313 | 284 | ||
314 | pr_debug("clock: starting DPLL round_rate for clock %s, target rate " | 285 | pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", |
315 | "%ld\n", clk->name, target_rate); | 286 | clk->name, target_rate); |
316 | 287 | ||
317 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); | 288 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); |
318 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; | 289 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; |
@@ -347,39 +318,23 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | |||
347 | if (r == DPLL_MULT_UNDERFLOW) | 318 | if (r == DPLL_MULT_UNDERFLOW) |
348 | continue; | 319 | continue; |
349 | 320 | ||
350 | e = target_rate - new_rate; | 321 | pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n", |
351 | pr_debug("clock: n = %d: m = %d: rate error is %d " | 322 | clk->name, m, n, new_rate); |
352 | "(new_rate = %ld)\n", n, m, e, new_rate); | ||
353 | |||
354 | if (min_e == -1 || | ||
355 | min_e >= (int)(abs(e) - dd->rate_tolerance)) { | ||
356 | min_e = e; | ||
357 | min_e_m = m; | ||
358 | min_e_n = n; | ||
359 | |||
360 | pr_debug("clock: found new least error %d\n", min_e); | ||
361 | 323 | ||
362 | /* We found good settings -- bail out now */ | 324 | if (target_rate == new_rate) { |
363 | if (min_e <= dd->rate_tolerance) | 325 | dd->last_rounded_m = m; |
364 | break; | 326 | dd->last_rounded_n = n; |
327 | dd->last_rounded_rate = target_rate; | ||
328 | break; | ||
365 | } | 329 | } |
366 | } | 330 | } |
367 | 331 | ||
368 | if (min_e < 0) { | 332 | if (target_rate != new_rate) { |
369 | pr_debug("clock: error: target rate or tolerance too low\n"); | 333 | pr_debug("clock: %s: cannot round to rate %ld\n", clk->name, |
334 | target_rate); | ||
370 | return ~0; | 335 | return ~0; |
371 | } | 336 | } |
372 | 337 | ||
373 | dd->last_rounded_m = min_e_m; | 338 | return target_rate; |
374 | dd->last_rounded_n = min_e_n; | ||
375 | dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate, | ||
376 | min_e_m, min_e_n); | ||
377 | |||
378 | pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", | ||
379 | min_e, min_e_m, min_e_n); | ||
380 | pr_debug("clock: final rate: %ld (target rate: %ld)\n", | ||
381 | dd->last_rounded_rate, target_rate); | ||
382 | |||
383 | return dd->last_rounded_rate; | ||
384 | } | 339 | } |
385 | 340 | ||
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c new file mode 100644 index 000000000000..3d43fba2542f --- /dev/null +++ b/arch/arm/mach-omap2/clkt_iclk.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * OMAP2/3 interface clock control | ||
3 | * | ||
4 | * Copyright (C) 2011 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 | #undef DEBUG | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/io.h> | ||
16 | |||
17 | #include <plat/clock.h> | ||
18 | #include <plat/prcm.h> | ||
19 | |||
20 | #include "clock.h" | ||
21 | #include "clock2xxx.h" | ||
22 | #include "cm2xxx_3xxx.h" | ||
23 | #include "cm-regbits-24xx.h" | ||
24 | |||
25 | /* Private functions */ | ||
26 | |||
27 | /* XXX */ | ||
28 | void omap2_clkt_iclk_allow_idle(struct clk *clk) | ||
29 | { | ||
30 | u32 v, r; | ||
31 | |||
32 | r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); | ||
33 | |||
34 | v = __raw_readl((__force void __iomem *)r); | ||
35 | v |= (1 << clk->enable_bit); | ||
36 | __raw_writel(v, (__force void __iomem *)r); | ||
37 | } | ||
38 | |||
39 | /* XXX */ | ||
40 | void omap2_clkt_iclk_deny_idle(struct clk *clk) | ||
41 | { | ||
42 | u32 v, r; | ||
43 | |||
44 | r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); | ||
45 | |||
46 | v = __raw_readl((__force void __iomem *)r); | ||
47 | v &= ~(1 << clk->enable_bit); | ||
48 | __raw_writel(v, (__force void __iomem *)r); | ||
49 | } | ||
50 | |||
51 | /* Public data */ | ||
52 | |||
53 | const struct clkops clkops_omap2_iclk_dflt_wait = { | ||
54 | .enable = omap2_dflt_clk_enable, | ||
55 | .disable = omap2_dflt_clk_disable, | ||
56 | .find_companion = omap2_clk_dflt_find_companion, | ||
57 | .find_idlest = omap2_clk_dflt_find_idlest, | ||
58 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
59 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
60 | }; | ||
61 | |||
62 | const struct clkops clkops_omap2_iclk_dflt = { | ||
63 | .enable = omap2_dflt_clk_enable, | ||
64 | .disable = omap2_dflt_clk_disable, | ||
65 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
66 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
67 | }; | ||
68 | |||
69 | const struct clkops clkops_omap2_iclk_idle_only = { | ||
70 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
71 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
72 | }; | ||
73 | |||
74 | const struct clkops clkops_omap2_mdmclk_dflt_wait = { | ||
75 | .enable = omap2_dflt_clk_enable, | ||
76 | .disable = omap2_dflt_clk_disable, | ||
77 | .find_companion = omap2_clk_dflt_find_companion, | ||
78 | .find_idlest = omap2_clk_dflt_find_idlest, | ||
79 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
80 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
81 | }; | ||
82 | |||
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 2a2f15213add..180299e4a838 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -22,7 +22,9 @@ | |||
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
25 | #include <trace/events/power.h> | ||
25 | 26 | ||
27 | #include <asm/cpu.h> | ||
26 | #include <plat/clock.h> | 28 | #include <plat/clock.h> |
27 | #include "clockdomain.h" | 29 | #include "clockdomain.h" |
28 | #include <plat/cpu.h> | 30 | #include <plat/cpu.h> |
@@ -261,10 +263,13 @@ void omap2_clk_disable(struct clk *clk) | |||
261 | 263 | ||
262 | pr_debug("clock: %s: disabling in hardware\n", clk->name); | 264 | pr_debug("clock: %s: disabling in hardware\n", clk->name); |
263 | 265 | ||
264 | clk->ops->disable(clk); | 266 | if (clk->ops && clk->ops->disable) { |
267 | trace_clock_disable(clk->name, 0, smp_processor_id()); | ||
268 | clk->ops->disable(clk); | ||
269 | } | ||
265 | 270 | ||
266 | if (clk->clkdm) | 271 | if (clk->clkdm) |
267 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 272 | clkdm_clk_disable(clk->clkdm, clk); |
268 | 273 | ||
269 | if (clk->parent) | 274 | if (clk->parent) |
270 | omap2_clk_disable(clk->parent); | 275 | omap2_clk_disable(clk->parent); |
@@ -304,7 +309,7 @@ int omap2_clk_enable(struct clk *clk) | |||
304 | } | 309 | } |
305 | 310 | ||
306 | if (clk->clkdm) { | 311 | if (clk->clkdm) { |
307 | ret = omap2_clkdm_clk_enable(clk->clkdm, clk); | 312 | ret = clkdm_clk_enable(clk->clkdm, clk); |
308 | if (ret) { | 313 | if (ret) { |
309 | WARN(1, "clock: %s: could not enable clockdomain %s: " | 314 | WARN(1, "clock: %s: could not enable clockdomain %s: " |
310 | "%d\n", clk->name, clk->clkdm->name, ret); | 315 | "%d\n", clk->name, clk->clkdm->name, ret); |
@@ -312,17 +317,21 @@ int omap2_clk_enable(struct clk *clk) | |||
312 | } | 317 | } |
313 | } | 318 | } |
314 | 319 | ||
315 | ret = clk->ops->enable(clk); | 320 | if (clk->ops && clk->ops->enable) { |
316 | if (ret) { | 321 | trace_clock_enable(clk->name, 1, smp_processor_id()); |
317 | WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); | 322 | ret = clk->ops->enable(clk); |
318 | goto oce_err3; | 323 | if (ret) { |
324 | WARN(1, "clock: %s: could not enable: %d\n", | ||
325 | clk->name, ret); | ||
326 | goto oce_err3; | ||
327 | } | ||
319 | } | 328 | } |
320 | 329 | ||
321 | return 0; | 330 | return 0; |
322 | 331 | ||
323 | oce_err3: | 332 | oce_err3: |
324 | if (clk->clkdm) | 333 | if (clk->clkdm) |
325 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 334 | clkdm_clk_disable(clk->clkdm, clk); |
326 | oce_err2: | 335 | oce_err2: |
327 | if (clk->parent) | 336 | if (clk->parent) |
328 | omap2_clk_disable(clk->parent); | 337 | omap2_clk_disable(clk->parent); |
@@ -349,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | |||
349 | pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); | 358 | pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); |
350 | 359 | ||
351 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ | 360 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ |
352 | if (clk->set_rate) | 361 | if (clk->set_rate) { |
362 | trace_clock_set_rate(clk->name, rate, smp_processor_id()); | ||
353 | ret = clk->set_rate(clk, rate); | 363 | ret = clk->set_rate(clk, rate); |
364 | } | ||
354 | 365 | ||
355 | return ret; | 366 | return ret; |
356 | } | 367 | } |
@@ -373,10 +384,16 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
373 | const struct clkops clkops_omap3_noncore_dpll_ops = { | 384 | const struct clkops clkops_omap3_noncore_dpll_ops = { |
374 | .enable = omap3_noncore_dpll_enable, | 385 | .enable = omap3_noncore_dpll_enable, |
375 | .disable = omap3_noncore_dpll_disable, | 386 | .disable = omap3_noncore_dpll_disable, |
387 | .allow_idle = omap3_dpll_allow_idle, | ||
388 | .deny_idle = omap3_dpll_deny_idle, | ||
376 | }; | 389 | }; |
377 | 390 | ||
378 | #endif | 391 | const struct clkops clkops_omap3_core_dpll_ops = { |
392 | .allow_idle = omap3_dpll_allow_idle, | ||
393 | .deny_idle = omap3_dpll_deny_idle, | ||
394 | }; | ||
379 | 395 | ||
396 | #endif | ||
380 | 397 | ||
381 | /* | 398 | /* |
382 | * OMAP2+ clock reset and init functions | 399 | * OMAP2+ clock reset and init functions |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 896584e3c4ab..e10ff2b54844 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * linux/arch/arm/mach-omap2/clock.h | 2 | * linux/arch/arm/mach-omap2/clock.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2009 Nokia Corporation | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Contacts: | 7 | * Contacts: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
@@ -18,9 +18,6 @@ | |||
18 | 18 | ||
19 | #include <plat/clock.h> | 19 | #include <plat/clock.h> |
20 | 20 | ||
21 | /* The maximum error between a target DPLL rate and the rounded rate in Hz */ | ||
22 | #define DEFAULT_DPLL_RATE_TOLERANCE 50000 | ||
23 | |||
24 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ | 21 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ |
25 | #define CORE_CLK_SRC_32K 0x0 | 22 | #define CORE_CLK_SRC_32K 0x0 |
26 | #define CORE_CLK_SRC_DPLL 0x1 | 23 | #define CORE_CLK_SRC_DPLL 0x1 |
@@ -55,7 +52,6 @@ void omap2_clk_disable(struct clk *clk); | |||
55 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); | 52 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); |
56 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate); | 53 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate); |
57 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); | 54 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); |
58 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance); | ||
59 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); | 55 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); |
60 | unsigned long omap3_dpll_recalc(struct clk *clk); | 56 | unsigned long omap3_dpll_recalc(struct clk *clk); |
61 | unsigned long omap3_clkoutx2_recalc(struct clk *clk); | 57 | unsigned long omap3_clkoutx2_recalc(struct clk *clk); |
@@ -65,6 +61,9 @@ u32 omap3_dpll_autoidle_read(struct clk *clk); | |||
65 | int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); | 61 | int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); |
66 | int omap3_noncore_dpll_enable(struct clk *clk); | 62 | int omap3_noncore_dpll_enable(struct clk *clk); |
67 | void omap3_noncore_dpll_disable(struct clk *clk); | 63 | void omap3_noncore_dpll_disable(struct clk *clk); |
64 | int omap4_dpllmx_gatectrl_read(struct clk *clk); | ||
65 | void omap4_dpllmx_allow_gatectrl(struct clk *clk); | ||
66 | void omap4_dpllmx_deny_gatectrl(struct clk *clk); | ||
68 | 67 | ||
69 | #ifdef CONFIG_OMAP_RESET_CLOCKS | 68 | #ifdef CONFIG_OMAP_RESET_CLOCKS |
70 | void omap2_clk_disable_unused(struct clk *clk); | 69 | void omap2_clk_disable_unused(struct clk *clk); |
@@ -83,6 +82,10 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); | |||
83 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); | 82 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); |
84 | int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); | 83 | int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); |
85 | 84 | ||
85 | /* clkt_iclk.c public functions */ | ||
86 | extern void omap2_clkt_iclk_allow_idle(struct clk *clk); | ||
87 | extern void omap2_clkt_iclk_deny_idle(struct clk *clk); | ||
88 | |||
86 | u32 omap2_get_dpll_rate(struct clk *clk); | 89 | u32 omap2_get_dpll_rate(struct clk *clk); |
87 | void omap2_init_dpll_parent(struct clk *clk); | 90 | void omap2_init_dpll_parent(struct clk *clk); |
88 | 91 | ||
@@ -136,6 +139,7 @@ extern struct clk *vclk, *sclk; | |||
136 | extern const struct clksel_rate gpt_32k_rates[]; | 139 | extern const struct clksel_rate gpt_32k_rates[]; |
137 | extern const struct clksel_rate gpt_sys_rates[]; | 140 | extern const struct clksel_rate gpt_sys_rates[]; |
138 | extern const struct clksel_rate gfx_l3_rates[]; | 141 | extern const struct clksel_rate gfx_l3_rates[]; |
142 | extern const struct clksel_rate dsp_ick_rates[]; | ||
139 | 143 | ||
140 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) | 144 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) |
141 | extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | 145 | extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); |
@@ -145,6 +149,13 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) | |||
145 | #define omap2_clk_exit_cpufreq_table 0 | 149 | #define omap2_clk_exit_cpufreq_table 0 |
146 | #endif | 150 | #endif |
147 | 151 | ||
152 | extern const struct clkops clkops_omap2_iclk_dflt_wait; | ||
153 | extern const struct clkops clkops_omap2_iclk_dflt; | ||
154 | extern const struct clkops clkops_omap2_iclk_idle_only; | ||
155 | extern const struct clkops clkops_omap2_mdmclk_dflt_wait; | ||
156 | extern const struct clkops clkops_omap2xxx_dpll_ops; | ||
148 | extern const struct clkops clkops_omap3_noncore_dpll_ops; | 157 | extern const struct clkops clkops_omap3_noncore_dpll_ops; |
158 | extern const struct clkops clkops_omap3_core_dpll_ops; | ||
159 | extern const struct clkops clkops_omap4_dpllmx_ops; | ||
149 | 160 | ||
150 | #endif | 161 | #endif |
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index 0a992bc8d0d8..b6f65d4ac97d 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/clock2420_data.c | 2 | * OMAP2420 clock data |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2010 Nokia Corporation | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Contacts: | 7 | * Contacts: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
9 | * Paul Walmsley | 9 | * Paul Walmsley |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
@@ -34,18 +34,15 @@ | |||
34 | /* | 34 | /* |
35 | * 2420 clock tree. | 35 | * 2420 clock tree. |
36 | * | 36 | * |
37 | * NOTE:In many cases here we are assigning a 'default' parent. In many | 37 | * NOTE:In many cases here we are assigning a 'default' parent. In |
38 | * cases the parent is selectable. The get/set parent calls will also | 38 | * many cases the parent is selectable. The set parent calls will |
39 | * switch sources. | 39 | * also switch sources. |
40 | * | ||
41 | * Many some clocks say always_enabled, but they can be auto idled for | ||
42 | * power savings. They will always be available upon clock request. | ||
43 | * | 40 | * |
44 | * Several sources are given initial rates which may be wrong, this will | 41 | * Several sources are given initial rates which may be wrong, this will |
45 | * be fixed up in the init func. | 42 | * be fixed up in the init func. |
46 | * | 43 | * |
47 | * Things are broadly separated below by clock domains. It is | 44 | * Things are broadly separated below by clock domains. It is |
48 | * noteworthy that most periferals have dependencies on multiple clock | 45 | * noteworthy that most peripherals have dependencies on multiple clock |
49 | * domains. Many get their interface clocks from the L4 domain, but get | 46 | * domains. Many get their interface clocks from the L4 domain, but get |
50 | * functional clocks from fixed sources or other core domain derived | 47 | * functional clocks from fixed sources or other core domain derived |
51 | * clocks. | 48 | * clocks. |
@@ -55,7 +52,7 @@ | |||
55 | static struct clk func_32k_ck = { | 52 | static struct clk func_32k_ck = { |
56 | .name = "func_32k_ck", | 53 | .name = "func_32k_ck", |
57 | .ops = &clkops_null, | 54 | .ops = &clkops_null, |
58 | .rate = 32000, | 55 | .rate = 32768, |
59 | .clkdm_name = "wkup_clkdm", | 56 | .clkdm_name = "wkup_clkdm", |
60 | }; | 57 | }; |
61 | 58 | ||
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = { | |||
116 | .max_multiplier = 1023, | 113 | .max_multiplier = 1023, |
117 | .min_divider = 1, | 114 | .min_divider = 1, |
118 | .max_divider = 16, | 115 | .max_divider = 16, |
119 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
120 | }; | 116 | }; |
121 | 117 | ||
122 | /* | 118 | /* |
@@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = { | |||
125 | */ | 121 | */ |
126 | static struct clk dpll_ck = { | 122 | static struct clk dpll_ck = { |
127 | .name = "dpll_ck", | 123 | .name = "dpll_ck", |
128 | .ops = &clkops_null, | 124 | .ops = &clkops_omap2xxx_dpll_ops, |
129 | .parent = &sys_ck, /* Can be func_32k also */ | 125 | .parent = &sys_ck, /* Can be func_32k also */ |
130 | .dpll_data = &dpll_dd, | 126 | .dpll_data = &dpll_dd, |
131 | .clkdm_name = "wkup_clkdm", | 127 | .clkdm_name = "wkup_clkdm", |
@@ -455,36 +451,22 @@ static struct clk dsp_fck = { | |||
455 | .recalc = &omap2_clksel_recalc, | 451 | .recalc = &omap2_clksel_recalc, |
456 | }; | 452 | }; |
457 | 453 | ||
458 | /* DSP interface clock */ | 454 | static const struct clksel dsp_ick_clksel[] = { |
459 | static const struct clksel_rate dsp_irate_ick_rates[] = { | 455 | { .parent = &dsp_fck, .rates = dsp_ick_rates }, |
460 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
461 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
462 | { .div = 0 }, | ||
463 | }; | ||
464 | |||
465 | static const struct clksel dsp_irate_ick_clksel[] = { | ||
466 | { .parent = &dsp_fck, .rates = dsp_irate_ick_rates }, | ||
467 | { .parent = NULL } | 456 | { .parent = NULL } |
468 | }; | 457 | }; |
469 | 458 | ||
470 | /* This clock does not exist as such in the TRM. */ | ||
471 | static struct clk dsp_irate_ick = { | ||
472 | .name = "dsp_irate_ick", | ||
473 | .ops = &clkops_null, | ||
474 | .parent = &dsp_fck, | ||
475 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
476 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
477 | .clksel = dsp_irate_ick_clksel, | ||
478 | .recalc = &omap2_clksel_recalc, | ||
479 | }; | ||
480 | |||
481 | /* 2420 only */ | ||
482 | static struct clk dsp_ick = { | 459 | static struct clk dsp_ick = { |
483 | .name = "dsp_ick", /* apparently ipi and isp */ | 460 | .name = "dsp_ick", /* apparently ipi and isp */ |
484 | .ops = &clkops_omap2_dflt_wait, | 461 | .ops = &clkops_omap2_iclk_dflt_wait, |
485 | .parent = &dsp_irate_ick, | 462 | .parent = &dsp_fck, |
463 | .clkdm_name = "dsp_clkdm", | ||
486 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), | 464 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), |
487 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ | 465 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ |
466 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
467 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
468 | .clksel = dsp_ick_clksel, | ||
469 | .recalc = &omap2_clksel_recalc, | ||
488 | }; | 470 | }; |
489 | 471 | ||
490 | /* | 472 | /* |
@@ -579,7 +561,7 @@ static const struct clksel usb_l4_ick_clksel[] = { | |||
579 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ | 561 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ |
580 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ | 562 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ |
581 | .name = "usb_l4_ick", | 563 | .name = "usb_l4_ick", |
582 | .ops = &clkops_omap2_dflt_wait, | 564 | .ops = &clkops_omap2_iclk_dflt_wait, |
583 | .parent = &core_l3_ck, | 565 | .parent = &core_l3_ck, |
584 | .clkdm_name = "core_l4_clkdm", | 566 | .clkdm_name = "core_l4_clkdm", |
585 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 567 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -661,7 +643,7 @@ static struct clk ssi_ssr_sst_fck = { | |||
661 | */ | 643 | */ |
662 | static struct clk ssi_l4_ick = { | 644 | static struct clk ssi_l4_ick = { |
663 | .name = "ssi_l4_ick", | 645 | .name = "ssi_l4_ick", |
664 | .ops = &clkops_omap2_dflt_wait, | 646 | .ops = &clkops_omap2_iclk_dflt_wait, |
665 | .parent = &l4_ck, | 647 | .parent = &l4_ck, |
666 | .clkdm_name = "core_l4_clkdm", | 648 | .clkdm_name = "core_l4_clkdm", |
667 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 649 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -716,6 +698,7 @@ static struct clk gfx_2d_fck = { | |||
716 | .recalc = &omap2_clksel_recalc, | 698 | .recalc = &omap2_clksel_recalc, |
717 | }; | 699 | }; |
718 | 700 | ||
701 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
719 | static struct clk gfx_ick = { | 702 | static struct clk gfx_ick = { |
720 | .name = "gfx_ick", /* From l3 */ | 703 | .name = "gfx_ick", /* From l3 */ |
721 | .ops = &clkops_omap2_dflt_wait, | 704 | .ops = &clkops_omap2_dflt_wait, |
@@ -763,7 +746,7 @@ static const struct clksel dss1_fck_clksel[] = { | |||
763 | 746 | ||
764 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | 747 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ |
765 | .name = "dss_ick", | 748 | .name = "dss_ick", |
766 | .ops = &clkops_omap2_dflt, | 749 | .ops = &clkops_omap2_iclk_dflt, |
767 | .parent = &l4_ck, /* really both l3 and l4 */ | 750 | .parent = &l4_ck, /* really both l3 and l4 */ |
768 | .clkdm_name = "dss_clkdm", | 751 | .clkdm_name = "dss_clkdm", |
769 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 752 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -825,6 +808,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */ | |||
825 | .recalc = &followparent_recalc, | 808 | .recalc = &followparent_recalc, |
826 | }; | 809 | }; |
827 | 810 | ||
811 | static struct clk wu_l4_ick = { | ||
812 | .name = "wu_l4_ick", | ||
813 | .ops = &clkops_null, | ||
814 | .parent = &sys_ck, | ||
815 | .clkdm_name = "wkup_clkdm", | ||
816 | .recalc = &followparent_recalc, | ||
817 | }; | ||
818 | |||
828 | /* | 819 | /* |
829 | * CORE power domain ICLK & FCLK defines. | 820 | * CORE power domain ICLK & FCLK defines. |
830 | * Many of the these can have more than one possible parent. Entries | 821 | * Many of the these can have more than one possible parent. Entries |
@@ -845,9 +836,9 @@ static const struct clksel omap24xx_gpt_clksel[] = { | |||
845 | 836 | ||
846 | static struct clk gpt1_ick = { | 837 | static struct clk gpt1_ick = { |
847 | .name = "gpt1_ick", | 838 | .name = "gpt1_ick", |
848 | .ops = &clkops_omap2_dflt_wait, | 839 | .ops = &clkops_omap2_iclk_dflt_wait, |
849 | .parent = &l4_ck, | 840 | .parent = &wu_l4_ick, |
850 | .clkdm_name = "core_l4_clkdm", | 841 | .clkdm_name = "wkup_clkdm", |
851 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 842 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
852 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | 843 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
853 | .recalc = &followparent_recalc, | 844 | .recalc = &followparent_recalc, |
@@ -871,7 +862,7 @@ static struct clk gpt1_fck = { | |||
871 | 862 | ||
872 | static struct clk gpt2_ick = { | 863 | static struct clk gpt2_ick = { |
873 | .name = "gpt2_ick", | 864 | .name = "gpt2_ick", |
874 | .ops = &clkops_omap2_dflt_wait, | 865 | .ops = &clkops_omap2_iclk_dflt_wait, |
875 | .parent = &l4_ck, | 866 | .parent = &l4_ck, |
876 | .clkdm_name = "core_l4_clkdm", | 867 | .clkdm_name = "core_l4_clkdm", |
877 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 868 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -895,7 +886,7 @@ static struct clk gpt2_fck = { | |||
895 | 886 | ||
896 | static struct clk gpt3_ick = { | 887 | static struct clk gpt3_ick = { |
897 | .name = "gpt3_ick", | 888 | .name = "gpt3_ick", |
898 | .ops = &clkops_omap2_dflt_wait, | 889 | .ops = &clkops_omap2_iclk_dflt_wait, |
899 | .parent = &l4_ck, | 890 | .parent = &l4_ck, |
900 | .clkdm_name = "core_l4_clkdm", | 891 | .clkdm_name = "core_l4_clkdm", |
901 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 892 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -919,7 +910,7 @@ static struct clk gpt3_fck = { | |||
919 | 910 | ||
920 | static struct clk gpt4_ick = { | 911 | static struct clk gpt4_ick = { |
921 | .name = "gpt4_ick", | 912 | .name = "gpt4_ick", |
922 | .ops = &clkops_omap2_dflt_wait, | 913 | .ops = &clkops_omap2_iclk_dflt_wait, |
923 | .parent = &l4_ck, | 914 | .parent = &l4_ck, |
924 | .clkdm_name = "core_l4_clkdm", | 915 | .clkdm_name = "core_l4_clkdm", |
925 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 916 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -943,7 +934,7 @@ static struct clk gpt4_fck = { | |||
943 | 934 | ||
944 | static struct clk gpt5_ick = { | 935 | static struct clk gpt5_ick = { |
945 | .name = "gpt5_ick", | 936 | .name = "gpt5_ick", |
946 | .ops = &clkops_omap2_dflt_wait, | 937 | .ops = &clkops_omap2_iclk_dflt_wait, |
947 | .parent = &l4_ck, | 938 | .parent = &l4_ck, |
948 | .clkdm_name = "core_l4_clkdm", | 939 | .clkdm_name = "core_l4_clkdm", |
949 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 940 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -967,7 +958,7 @@ static struct clk gpt5_fck = { | |||
967 | 958 | ||
968 | static struct clk gpt6_ick = { | 959 | static struct clk gpt6_ick = { |
969 | .name = "gpt6_ick", | 960 | .name = "gpt6_ick", |
970 | .ops = &clkops_omap2_dflt_wait, | 961 | .ops = &clkops_omap2_iclk_dflt_wait, |
971 | .parent = &l4_ck, | 962 | .parent = &l4_ck, |
972 | .clkdm_name = "core_l4_clkdm", | 963 | .clkdm_name = "core_l4_clkdm", |
973 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 964 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -991,8 +982,9 @@ static struct clk gpt6_fck = { | |||
991 | 982 | ||
992 | static struct clk gpt7_ick = { | 983 | static struct clk gpt7_ick = { |
993 | .name = "gpt7_ick", | 984 | .name = "gpt7_ick", |
994 | .ops = &clkops_omap2_dflt_wait, | 985 | .ops = &clkops_omap2_iclk_dflt_wait, |
995 | .parent = &l4_ck, | 986 | .parent = &l4_ck, |
987 | .clkdm_name = "core_l4_clkdm", | ||
996 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 988 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
997 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | 989 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
998 | .recalc = &followparent_recalc, | 990 | .recalc = &followparent_recalc, |
@@ -1014,7 +1006,7 @@ static struct clk gpt7_fck = { | |||
1014 | 1006 | ||
1015 | static struct clk gpt8_ick = { | 1007 | static struct clk gpt8_ick = { |
1016 | .name = "gpt8_ick", | 1008 | .name = "gpt8_ick", |
1017 | .ops = &clkops_omap2_dflt_wait, | 1009 | .ops = &clkops_omap2_iclk_dflt_wait, |
1018 | .parent = &l4_ck, | 1010 | .parent = &l4_ck, |
1019 | .clkdm_name = "core_l4_clkdm", | 1011 | .clkdm_name = "core_l4_clkdm", |
1020 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1012 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1038,7 +1030,7 @@ static struct clk gpt8_fck = { | |||
1038 | 1030 | ||
1039 | static struct clk gpt9_ick = { | 1031 | static struct clk gpt9_ick = { |
1040 | .name = "gpt9_ick", | 1032 | .name = "gpt9_ick", |
1041 | .ops = &clkops_omap2_dflt_wait, | 1033 | .ops = &clkops_omap2_iclk_dflt_wait, |
1042 | .parent = &l4_ck, | 1034 | .parent = &l4_ck, |
1043 | .clkdm_name = "core_l4_clkdm", | 1035 | .clkdm_name = "core_l4_clkdm", |
1044 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1036 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1062,7 +1054,7 @@ static struct clk gpt9_fck = { | |||
1062 | 1054 | ||
1063 | static struct clk gpt10_ick = { | 1055 | static struct clk gpt10_ick = { |
1064 | .name = "gpt10_ick", | 1056 | .name = "gpt10_ick", |
1065 | .ops = &clkops_omap2_dflt_wait, | 1057 | .ops = &clkops_omap2_iclk_dflt_wait, |
1066 | .parent = &l4_ck, | 1058 | .parent = &l4_ck, |
1067 | .clkdm_name = "core_l4_clkdm", | 1059 | .clkdm_name = "core_l4_clkdm", |
1068 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1060 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1086,7 +1078,7 @@ static struct clk gpt10_fck = { | |||
1086 | 1078 | ||
1087 | static struct clk gpt11_ick = { | 1079 | static struct clk gpt11_ick = { |
1088 | .name = "gpt11_ick", | 1080 | .name = "gpt11_ick", |
1089 | .ops = &clkops_omap2_dflt_wait, | 1081 | .ops = &clkops_omap2_iclk_dflt_wait, |
1090 | .parent = &l4_ck, | 1082 | .parent = &l4_ck, |
1091 | .clkdm_name = "core_l4_clkdm", | 1083 | .clkdm_name = "core_l4_clkdm", |
1092 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1084 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1110,7 +1102,7 @@ static struct clk gpt11_fck = { | |||
1110 | 1102 | ||
1111 | static struct clk gpt12_ick = { | 1103 | static struct clk gpt12_ick = { |
1112 | .name = "gpt12_ick", | 1104 | .name = "gpt12_ick", |
1113 | .ops = &clkops_omap2_dflt_wait, | 1105 | .ops = &clkops_omap2_iclk_dflt_wait, |
1114 | .parent = &l4_ck, | 1106 | .parent = &l4_ck, |
1115 | .clkdm_name = "core_l4_clkdm", | 1107 | .clkdm_name = "core_l4_clkdm", |
1116 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1108 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1134,7 +1126,7 @@ static struct clk gpt12_fck = { | |||
1134 | 1126 | ||
1135 | static struct clk mcbsp1_ick = { | 1127 | static struct clk mcbsp1_ick = { |
1136 | .name = "mcbsp1_ick", | 1128 | .name = "mcbsp1_ick", |
1137 | .ops = &clkops_omap2_dflt_wait, | 1129 | .ops = &clkops_omap2_iclk_dflt_wait, |
1138 | .parent = &l4_ck, | 1130 | .parent = &l4_ck, |
1139 | .clkdm_name = "core_l4_clkdm", | 1131 | .clkdm_name = "core_l4_clkdm", |
1140 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1132 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1174,7 +1166,7 @@ static struct clk mcbsp1_fck = { | |||
1174 | 1166 | ||
1175 | static struct clk mcbsp2_ick = { | 1167 | static struct clk mcbsp2_ick = { |
1176 | .name = "mcbsp2_ick", | 1168 | .name = "mcbsp2_ick", |
1177 | .ops = &clkops_omap2_dflt_wait, | 1169 | .ops = &clkops_omap2_iclk_dflt_wait, |
1178 | .parent = &l4_ck, | 1170 | .parent = &l4_ck, |
1179 | .clkdm_name = "core_l4_clkdm", | 1171 | .clkdm_name = "core_l4_clkdm", |
1180 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1172 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1198,7 +1190,7 @@ static struct clk mcbsp2_fck = { | |||
1198 | 1190 | ||
1199 | static struct clk mcspi1_ick = { | 1191 | static struct clk mcspi1_ick = { |
1200 | .name = "mcspi1_ick", | 1192 | .name = "mcspi1_ick", |
1201 | .ops = &clkops_omap2_dflt_wait, | 1193 | .ops = &clkops_omap2_iclk_dflt_wait, |
1202 | .parent = &l4_ck, | 1194 | .parent = &l4_ck, |
1203 | .clkdm_name = "core_l4_clkdm", | 1195 | .clkdm_name = "core_l4_clkdm", |
1204 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1196 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1218,7 +1210,7 @@ static struct clk mcspi1_fck = { | |||
1218 | 1210 | ||
1219 | static struct clk mcspi2_ick = { | 1211 | static struct clk mcspi2_ick = { |
1220 | .name = "mcspi2_ick", | 1212 | .name = "mcspi2_ick", |
1221 | .ops = &clkops_omap2_dflt_wait, | 1213 | .ops = &clkops_omap2_iclk_dflt_wait, |
1222 | .parent = &l4_ck, | 1214 | .parent = &l4_ck, |
1223 | .clkdm_name = "core_l4_clkdm", | 1215 | .clkdm_name = "core_l4_clkdm", |
1224 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1216 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1238,7 +1230,7 @@ static struct clk mcspi2_fck = { | |||
1238 | 1230 | ||
1239 | static struct clk uart1_ick = { | 1231 | static struct clk uart1_ick = { |
1240 | .name = "uart1_ick", | 1232 | .name = "uart1_ick", |
1241 | .ops = &clkops_omap2_dflt_wait, | 1233 | .ops = &clkops_omap2_iclk_dflt_wait, |
1242 | .parent = &l4_ck, | 1234 | .parent = &l4_ck, |
1243 | .clkdm_name = "core_l4_clkdm", | 1235 | .clkdm_name = "core_l4_clkdm", |
1244 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1236 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1258,7 +1250,7 @@ static struct clk uart1_fck = { | |||
1258 | 1250 | ||
1259 | static struct clk uart2_ick = { | 1251 | static struct clk uart2_ick = { |
1260 | .name = "uart2_ick", | 1252 | .name = "uart2_ick", |
1261 | .ops = &clkops_omap2_dflt_wait, | 1253 | .ops = &clkops_omap2_iclk_dflt_wait, |
1262 | .parent = &l4_ck, | 1254 | .parent = &l4_ck, |
1263 | .clkdm_name = "core_l4_clkdm", | 1255 | .clkdm_name = "core_l4_clkdm", |
1264 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1256 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1278,7 +1270,7 @@ static struct clk uart2_fck = { | |||
1278 | 1270 | ||
1279 | static struct clk uart3_ick = { | 1271 | static struct clk uart3_ick = { |
1280 | .name = "uart3_ick", | 1272 | .name = "uart3_ick", |
1281 | .ops = &clkops_omap2_dflt_wait, | 1273 | .ops = &clkops_omap2_iclk_dflt_wait, |
1282 | .parent = &l4_ck, | 1274 | .parent = &l4_ck, |
1283 | .clkdm_name = "core_l4_clkdm", | 1275 | .clkdm_name = "core_l4_clkdm", |
1284 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1276 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1298,9 +1290,9 @@ static struct clk uart3_fck = { | |||
1298 | 1290 | ||
1299 | static struct clk gpios_ick = { | 1291 | static struct clk gpios_ick = { |
1300 | .name = "gpios_ick", | 1292 | .name = "gpios_ick", |
1301 | .ops = &clkops_omap2_dflt_wait, | 1293 | .ops = &clkops_omap2_iclk_dflt_wait, |
1302 | .parent = &l4_ck, | 1294 | .parent = &wu_l4_ick, |
1303 | .clkdm_name = "core_l4_clkdm", | 1295 | .clkdm_name = "wkup_clkdm", |
1304 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1296 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1305 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | 1297 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
1306 | .recalc = &followparent_recalc, | 1298 | .recalc = &followparent_recalc, |
@@ -1318,9 +1310,9 @@ static struct clk gpios_fck = { | |||
1318 | 1310 | ||
1319 | static struct clk mpu_wdt_ick = { | 1311 | static struct clk mpu_wdt_ick = { |
1320 | .name = "mpu_wdt_ick", | 1312 | .name = "mpu_wdt_ick", |
1321 | .ops = &clkops_omap2_dflt_wait, | 1313 | .ops = &clkops_omap2_iclk_dflt_wait, |
1322 | .parent = &l4_ck, | 1314 | .parent = &wu_l4_ick, |
1323 | .clkdm_name = "core_l4_clkdm", | 1315 | .clkdm_name = "wkup_clkdm", |
1324 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1316 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1325 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | 1317 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
1326 | .recalc = &followparent_recalc, | 1318 | .recalc = &followparent_recalc, |
@@ -1338,10 +1330,10 @@ static struct clk mpu_wdt_fck = { | |||
1338 | 1330 | ||
1339 | static struct clk sync_32k_ick = { | 1331 | static struct clk sync_32k_ick = { |
1340 | .name = "sync_32k_ick", | 1332 | .name = "sync_32k_ick", |
1341 | .ops = &clkops_omap2_dflt_wait, | 1333 | .ops = &clkops_omap2_iclk_dflt_wait, |
1342 | .parent = &l4_ck, | 1334 | .parent = &wu_l4_ick, |
1335 | .clkdm_name = "wkup_clkdm", | ||
1343 | .flags = ENABLE_ON_INIT, | 1336 | .flags = ENABLE_ON_INIT, |
1344 | .clkdm_name = "core_l4_clkdm", | ||
1345 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1337 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1346 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, | 1338 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, |
1347 | .recalc = &followparent_recalc, | 1339 | .recalc = &followparent_recalc, |
@@ -1349,9 +1341,9 @@ static struct clk sync_32k_ick = { | |||
1349 | 1341 | ||
1350 | static struct clk wdt1_ick = { | 1342 | static struct clk wdt1_ick = { |
1351 | .name = "wdt1_ick", | 1343 | .name = "wdt1_ick", |
1352 | .ops = &clkops_omap2_dflt_wait, | 1344 | .ops = &clkops_omap2_iclk_dflt_wait, |
1353 | .parent = &l4_ck, | 1345 | .parent = &wu_l4_ick, |
1354 | .clkdm_name = "core_l4_clkdm", | 1346 | .clkdm_name = "wkup_clkdm", |
1355 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1347 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1356 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, | 1348 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, |
1357 | .recalc = &followparent_recalc, | 1349 | .recalc = &followparent_recalc, |
@@ -1359,10 +1351,10 @@ static struct clk wdt1_ick = { | |||
1359 | 1351 | ||
1360 | static struct clk omapctrl_ick = { | 1352 | static struct clk omapctrl_ick = { |
1361 | .name = "omapctrl_ick", | 1353 | .name = "omapctrl_ick", |
1362 | .ops = &clkops_omap2_dflt_wait, | 1354 | .ops = &clkops_omap2_iclk_dflt_wait, |
1363 | .parent = &l4_ck, | 1355 | .parent = &wu_l4_ick, |
1356 | .clkdm_name = "wkup_clkdm", | ||
1364 | .flags = ENABLE_ON_INIT, | 1357 | .flags = ENABLE_ON_INIT, |
1365 | .clkdm_name = "core_l4_clkdm", | ||
1366 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1358 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1367 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, | 1359 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, |
1368 | .recalc = &followparent_recalc, | 1360 | .recalc = &followparent_recalc, |
@@ -1370,7 +1362,7 @@ static struct clk omapctrl_ick = { | |||
1370 | 1362 | ||
1371 | static struct clk cam_ick = { | 1363 | static struct clk cam_ick = { |
1372 | .name = "cam_ick", | 1364 | .name = "cam_ick", |
1373 | .ops = &clkops_omap2_dflt, | 1365 | .ops = &clkops_omap2_iclk_dflt, |
1374 | .parent = &l4_ck, | 1366 | .parent = &l4_ck, |
1375 | .clkdm_name = "core_l4_clkdm", | 1367 | .clkdm_name = "core_l4_clkdm", |
1376 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1368 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1395,7 +1387,7 @@ static struct clk cam_fck = { | |||
1395 | 1387 | ||
1396 | static struct clk mailboxes_ick = { | 1388 | static struct clk mailboxes_ick = { |
1397 | .name = "mailboxes_ick", | 1389 | .name = "mailboxes_ick", |
1398 | .ops = &clkops_omap2_dflt_wait, | 1390 | .ops = &clkops_omap2_iclk_dflt_wait, |
1399 | .parent = &l4_ck, | 1391 | .parent = &l4_ck, |
1400 | .clkdm_name = "core_l4_clkdm", | 1392 | .clkdm_name = "core_l4_clkdm", |
1401 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1393 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1405,7 +1397,7 @@ static struct clk mailboxes_ick = { | |||
1405 | 1397 | ||
1406 | static struct clk wdt4_ick = { | 1398 | static struct clk wdt4_ick = { |
1407 | .name = "wdt4_ick", | 1399 | .name = "wdt4_ick", |
1408 | .ops = &clkops_omap2_dflt_wait, | 1400 | .ops = &clkops_omap2_iclk_dflt_wait, |
1409 | .parent = &l4_ck, | 1401 | .parent = &l4_ck, |
1410 | .clkdm_name = "core_l4_clkdm", | 1402 | .clkdm_name = "core_l4_clkdm", |
1411 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1403 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1425,7 +1417,7 @@ static struct clk wdt4_fck = { | |||
1425 | 1417 | ||
1426 | static struct clk wdt3_ick = { | 1418 | static struct clk wdt3_ick = { |
1427 | .name = "wdt3_ick", | 1419 | .name = "wdt3_ick", |
1428 | .ops = &clkops_omap2_dflt_wait, | 1420 | .ops = &clkops_omap2_iclk_dflt_wait, |
1429 | .parent = &l4_ck, | 1421 | .parent = &l4_ck, |
1430 | .clkdm_name = "core_l4_clkdm", | 1422 | .clkdm_name = "core_l4_clkdm", |
1431 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1423 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1445,7 +1437,7 @@ static struct clk wdt3_fck = { | |||
1445 | 1437 | ||
1446 | static struct clk mspro_ick = { | 1438 | static struct clk mspro_ick = { |
1447 | .name = "mspro_ick", | 1439 | .name = "mspro_ick", |
1448 | .ops = &clkops_omap2_dflt_wait, | 1440 | .ops = &clkops_omap2_iclk_dflt_wait, |
1449 | .parent = &l4_ck, | 1441 | .parent = &l4_ck, |
1450 | .clkdm_name = "core_l4_clkdm", | 1442 | .clkdm_name = "core_l4_clkdm", |
1451 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1443 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1465,7 +1457,7 @@ static struct clk mspro_fck = { | |||
1465 | 1457 | ||
1466 | static struct clk mmc_ick = { | 1458 | static struct clk mmc_ick = { |
1467 | .name = "mmc_ick", | 1459 | .name = "mmc_ick", |
1468 | .ops = &clkops_omap2_dflt_wait, | 1460 | .ops = &clkops_omap2_iclk_dflt_wait, |
1469 | .parent = &l4_ck, | 1461 | .parent = &l4_ck, |
1470 | .clkdm_name = "core_l4_clkdm", | 1462 | .clkdm_name = "core_l4_clkdm", |
1471 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1463 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1485,7 +1477,7 @@ static struct clk mmc_fck = { | |||
1485 | 1477 | ||
1486 | static struct clk fac_ick = { | 1478 | static struct clk fac_ick = { |
1487 | .name = "fac_ick", | 1479 | .name = "fac_ick", |
1488 | .ops = &clkops_omap2_dflt_wait, | 1480 | .ops = &clkops_omap2_iclk_dflt_wait, |
1489 | .parent = &l4_ck, | 1481 | .parent = &l4_ck, |
1490 | .clkdm_name = "core_l4_clkdm", | 1482 | .clkdm_name = "core_l4_clkdm", |
1491 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1483 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1505,7 +1497,7 @@ static struct clk fac_fck = { | |||
1505 | 1497 | ||
1506 | static struct clk eac_ick = { | 1498 | static struct clk eac_ick = { |
1507 | .name = "eac_ick", | 1499 | .name = "eac_ick", |
1508 | .ops = &clkops_omap2_dflt_wait, | 1500 | .ops = &clkops_omap2_iclk_dflt_wait, |
1509 | .parent = &l4_ck, | 1501 | .parent = &l4_ck, |
1510 | .clkdm_name = "core_l4_clkdm", | 1502 | .clkdm_name = "core_l4_clkdm", |
1511 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1503 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1525,7 +1517,7 @@ static struct clk eac_fck = { | |||
1525 | 1517 | ||
1526 | static struct clk hdq_ick = { | 1518 | static struct clk hdq_ick = { |
1527 | .name = "hdq_ick", | 1519 | .name = "hdq_ick", |
1528 | .ops = &clkops_omap2_dflt_wait, | 1520 | .ops = &clkops_omap2_iclk_dflt_wait, |
1529 | .parent = &l4_ck, | 1521 | .parent = &l4_ck, |
1530 | .clkdm_name = "core_l4_clkdm", | 1522 | .clkdm_name = "core_l4_clkdm", |
1531 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1523 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1545,7 +1537,7 @@ static struct clk hdq_fck = { | |||
1545 | 1537 | ||
1546 | static struct clk i2c2_ick = { | 1538 | static struct clk i2c2_ick = { |
1547 | .name = "i2c2_ick", | 1539 | .name = "i2c2_ick", |
1548 | .ops = &clkops_omap2_dflt_wait, | 1540 | .ops = &clkops_omap2_iclk_dflt_wait, |
1549 | .parent = &l4_ck, | 1541 | .parent = &l4_ck, |
1550 | .clkdm_name = "core_l4_clkdm", | 1542 | .clkdm_name = "core_l4_clkdm", |
1551 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1543 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1565,7 +1557,7 @@ static struct clk i2c2_fck = { | |||
1565 | 1557 | ||
1566 | static struct clk i2c1_ick = { | 1558 | static struct clk i2c1_ick = { |
1567 | .name = "i2c1_ick", | 1559 | .name = "i2c1_ick", |
1568 | .ops = &clkops_omap2_dflt_wait, | 1560 | .ops = &clkops_omap2_iclk_dflt_wait, |
1569 | .parent = &l4_ck, | 1561 | .parent = &l4_ck, |
1570 | .clkdm_name = "core_l4_clkdm", | 1562 | .clkdm_name = "core_l4_clkdm", |
1571 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1563 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1583,12 +1575,18 @@ static struct clk i2c1_fck = { | |||
1583 | .recalc = &followparent_recalc, | 1575 | .recalc = &followparent_recalc, |
1584 | }; | 1576 | }; |
1585 | 1577 | ||
1578 | /* | ||
1579 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
1580 | * accesses derived from this data. | ||
1581 | */ | ||
1586 | static struct clk gpmc_fck = { | 1582 | static struct clk gpmc_fck = { |
1587 | .name = "gpmc_fck", | 1583 | .name = "gpmc_fck", |
1588 | .ops = &clkops_null, /* RMK: missing? */ | 1584 | .ops = &clkops_omap2_iclk_idle_only, |
1589 | .parent = &core_l3_ck, | 1585 | .parent = &core_l3_ck, |
1590 | .flags = ENABLE_ON_INIT, | 1586 | .flags = ENABLE_ON_INIT, |
1591 | .clkdm_name = "core_l3_clkdm", | 1587 | .clkdm_name = "core_l3_clkdm", |
1588 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
1589 | .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT, | ||
1592 | .recalc = &followparent_recalc, | 1590 | .recalc = &followparent_recalc, |
1593 | }; | 1591 | }; |
1594 | 1592 | ||
@@ -1600,17 +1598,38 @@ static struct clk sdma_fck = { | |||
1600 | .recalc = &followparent_recalc, | 1598 | .recalc = &followparent_recalc, |
1601 | }; | 1599 | }; |
1602 | 1600 | ||
1601 | /* | ||
1602 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
1603 | * accesses derived from this data. | ||
1604 | */ | ||
1603 | static struct clk sdma_ick = { | 1605 | static struct clk sdma_ick = { |
1604 | .name = "sdma_ick", | 1606 | .name = "sdma_ick", |
1605 | .ops = &clkops_null, /* RMK: missing? */ | 1607 | .ops = &clkops_omap2_iclk_idle_only, |
1606 | .parent = &l4_ck, | 1608 | .parent = &core_l3_ck, |
1609 | .clkdm_name = "core_l3_clkdm", | ||
1610 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
1611 | .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT, | ||
1612 | .recalc = &followparent_recalc, | ||
1613 | }; | ||
1614 | |||
1615 | /* | ||
1616 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
1617 | * accesses derived from this data. | ||
1618 | */ | ||
1619 | static struct clk sdrc_ick = { | ||
1620 | .name = "sdrc_ick", | ||
1621 | .ops = &clkops_omap2_iclk_idle_only, | ||
1622 | .parent = &core_l3_ck, | ||
1623 | .flags = ENABLE_ON_INIT, | ||
1607 | .clkdm_name = "core_l3_clkdm", | 1624 | .clkdm_name = "core_l3_clkdm", |
1625 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
1626 | .enable_bit = OMAP24XX_AUTO_SDRC_SHIFT, | ||
1608 | .recalc = &followparent_recalc, | 1627 | .recalc = &followparent_recalc, |
1609 | }; | 1628 | }; |
1610 | 1629 | ||
1611 | static struct clk vlynq_ick = { | 1630 | static struct clk vlynq_ick = { |
1612 | .name = "vlynq_ick", | 1631 | .name = "vlynq_ick", |
1613 | .ops = &clkops_omap2_dflt_wait, | 1632 | .ops = &clkops_omap2_iclk_dflt_wait, |
1614 | .parent = &core_l3_ck, | 1633 | .parent = &core_l3_ck, |
1615 | .clkdm_name = "core_l3_clkdm", | 1634 | .clkdm_name = "core_l3_clkdm", |
1616 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1635 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1659,7 +1678,7 @@ static struct clk vlynq_fck = { | |||
1659 | 1678 | ||
1660 | static struct clk des_ick = { | 1679 | static struct clk des_ick = { |
1661 | .name = "des_ick", | 1680 | .name = "des_ick", |
1662 | .ops = &clkops_omap2_dflt_wait, | 1681 | .ops = &clkops_omap2_iclk_dflt_wait, |
1663 | .parent = &l4_ck, | 1682 | .parent = &l4_ck, |
1664 | .clkdm_name = "core_l4_clkdm", | 1683 | .clkdm_name = "core_l4_clkdm", |
1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1684 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1669,7 +1688,7 @@ static struct clk des_ick = { | |||
1669 | 1688 | ||
1670 | static struct clk sha_ick = { | 1689 | static struct clk sha_ick = { |
1671 | .name = "sha_ick", | 1690 | .name = "sha_ick", |
1672 | .ops = &clkops_omap2_dflt_wait, | 1691 | .ops = &clkops_omap2_iclk_dflt_wait, |
1673 | .parent = &l4_ck, | 1692 | .parent = &l4_ck, |
1674 | .clkdm_name = "core_l4_clkdm", | 1693 | .clkdm_name = "core_l4_clkdm", |
1675 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1694 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1679,7 +1698,7 @@ static struct clk sha_ick = { | |||
1679 | 1698 | ||
1680 | static struct clk rng_ick = { | 1699 | static struct clk rng_ick = { |
1681 | .name = "rng_ick", | 1700 | .name = "rng_ick", |
1682 | .ops = &clkops_omap2_dflt_wait, | 1701 | .ops = &clkops_omap2_iclk_dflt_wait, |
1683 | .parent = &l4_ck, | 1702 | .parent = &l4_ck, |
1684 | .clkdm_name = "core_l4_clkdm", | 1703 | .clkdm_name = "core_l4_clkdm", |
1685 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1704 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1689,7 +1708,7 @@ static struct clk rng_ick = { | |||
1689 | 1708 | ||
1690 | static struct clk aes_ick = { | 1709 | static struct clk aes_ick = { |
1691 | .name = "aes_ick", | 1710 | .name = "aes_ick", |
1692 | .ops = &clkops_omap2_dflt_wait, | 1711 | .ops = &clkops_omap2_iclk_dflt_wait, |
1693 | .parent = &l4_ck, | 1712 | .parent = &l4_ck, |
1694 | .clkdm_name = "core_l4_clkdm", | 1713 | .clkdm_name = "core_l4_clkdm", |
1695 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1714 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1699,7 +1718,7 @@ static struct clk aes_ick = { | |||
1699 | 1718 | ||
1700 | static struct clk pka_ick = { | 1719 | static struct clk pka_ick = { |
1701 | .name = "pka_ick", | 1720 | .name = "pka_ick", |
1702 | .ops = &clkops_omap2_dflt_wait, | 1721 | .ops = &clkops_omap2_iclk_dflt_wait, |
1703 | .parent = &l4_ck, | 1722 | .parent = &l4_ck, |
1704 | .clkdm_name = "core_l4_clkdm", | 1723 | .clkdm_name = "core_l4_clkdm", |
1705 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1724 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1777,7 +1796,6 @@ static struct omap_clk omap2420_clks[] = { | |||
1777 | CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), | 1796 | CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), |
1778 | /* dsp domain clocks */ | 1797 | /* dsp domain clocks */ |
1779 | CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), | 1798 | CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), |
1780 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_242X), | ||
1781 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), | 1799 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), |
1782 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), | 1800 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), |
1783 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), | 1801 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), |
@@ -1797,6 +1815,7 @@ static struct omap_clk omap2420_clks[] = { | |||
1797 | /* L4 domain clocks */ | 1815 | /* L4 domain clocks */ |
1798 | CLK(NULL, "l4_ck", &l4_ck, CK_242X), | 1816 | CLK(NULL, "l4_ck", &l4_ck, CK_242X), |
1799 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), | 1817 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), |
1818 | CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_242X), | ||
1800 | /* virtual meta-group clock */ | 1819 | /* virtual meta-group clock */ |
1801 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), | 1820 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), |
1802 | /* general l4 interface ck, multi-parent functional clk */ | 1821 | /* general l4 interface ck, multi-parent functional clk */ |
@@ -1869,6 +1888,7 @@ static struct omap_clk omap2420_clks[] = { | |||
1869 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), | 1888 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), |
1870 | CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), | 1889 | CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), |
1871 | CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), | 1890 | CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), |
1891 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_242X), | ||
1872 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), | 1892 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), |
1873 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), | 1893 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), |
1874 | CLK(NULL, "des_ick", &des_ick, CK_242X), | 1894 | CLK(NULL, "des_ick", &des_ick, CK_242X), |
@@ -1913,6 +1933,9 @@ int __init omap2420_clk_init(void) | |||
1913 | omap2_init_clk_clkdm(c->lk.clk); | 1933 | omap2_init_clk_clkdm(c->lk.clk); |
1914 | } | 1934 | } |
1915 | 1935 | ||
1936 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
1937 | omap_clk_disable_autoidle_all(); | ||
1938 | |||
1916 | /* Check the MPU rate set by bootloader */ | 1939 | /* Check the MPU rate set by bootloader */ |
1917 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); | 1940 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
1918 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 1941 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index c047dcd007e5..bba018331a71 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/clock2430_data.c | 2 | * OMAP2430 clock data |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2010 Nokia Corporation | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Contacts: | 7 | * Contacts: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
9 | * Paul Walmsley | 9 | * Paul Walmsley |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
@@ -34,18 +34,15 @@ | |||
34 | /* | 34 | /* |
35 | * 2430 clock tree. | 35 | * 2430 clock tree. |
36 | * | 36 | * |
37 | * NOTE:In many cases here we are assigning a 'default' parent. In many | 37 | * NOTE:In many cases here we are assigning a 'default' parent. In |
38 | * cases the parent is selectable. The get/set parent calls will also | 38 | * many cases the parent is selectable. The set parent calls will |
39 | * switch sources. | 39 | * also switch sources. |
40 | * | ||
41 | * Many some clocks say always_enabled, but they can be auto idled for | ||
42 | * power savings. They will always be available upon clock request. | ||
43 | * | 40 | * |
44 | * Several sources are given initial rates which may be wrong, this will | 41 | * Several sources are given initial rates which may be wrong, this will |
45 | * be fixed up in the init func. | 42 | * be fixed up in the init func. |
46 | * | 43 | * |
47 | * Things are broadly separated below by clock domains. It is | 44 | * Things are broadly separated below by clock domains. It is |
48 | * noteworthy that most periferals have dependencies on multiple clock | 45 | * noteworthy that most peripherals have dependencies on multiple clock |
49 | * domains. Many get their interface clocks from the L4 domain, but get | 46 | * domains. Many get their interface clocks from the L4 domain, but get |
50 | * functional clocks from fixed sources or other core domain derived | 47 | * functional clocks from fixed sources or other core domain derived |
51 | * clocks. | 48 | * clocks. |
@@ -55,7 +52,7 @@ | |||
55 | static struct clk func_32k_ck = { | 52 | static struct clk func_32k_ck = { |
56 | .name = "func_32k_ck", | 53 | .name = "func_32k_ck", |
57 | .ops = &clkops_null, | 54 | .ops = &clkops_null, |
58 | .rate = 32000, | 55 | .rate = 32768, |
59 | .clkdm_name = "wkup_clkdm", | 56 | .clkdm_name = "wkup_clkdm", |
60 | }; | 57 | }; |
61 | 58 | ||
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = { | |||
116 | .max_multiplier = 1023, | 113 | .max_multiplier = 1023, |
117 | .min_divider = 1, | 114 | .min_divider = 1, |
118 | .max_divider = 16, | 115 | .max_divider = 16, |
119 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
120 | }; | 116 | }; |
121 | 117 | ||
122 | /* | 118 | /* |
@@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = { | |||
125 | */ | 121 | */ |
126 | static struct clk dpll_ck = { | 122 | static struct clk dpll_ck = { |
127 | .name = "dpll_ck", | 123 | .name = "dpll_ck", |
128 | .ops = &clkops_null, | 124 | .ops = &clkops_omap2xxx_dpll_ops, |
129 | .parent = &sys_ck, /* Can be func_32k also */ | 125 | .parent = &sys_ck, /* Can be func_32k also */ |
130 | .dpll_data = &dpll_dd, | 126 | .dpll_data = &dpll_dd, |
131 | .clkdm_name = "wkup_clkdm", | 127 | .clkdm_name = "wkup_clkdm", |
@@ -434,37 +430,23 @@ static struct clk dsp_fck = { | |||
434 | .recalc = &omap2_clksel_recalc, | 430 | .recalc = &omap2_clksel_recalc, |
435 | }; | 431 | }; |
436 | 432 | ||
437 | /* DSP interface clock */ | 433 | static const struct clksel dsp_ick_clksel[] = { |
438 | static const struct clksel_rate dsp_irate_ick_rates[] = { | 434 | { .parent = &dsp_fck, .rates = dsp_ick_rates }, |
439 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
440 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
441 | { .div = 3, .val = 3, .flags = RATE_IN_243X }, | ||
442 | { .div = 0 }, | ||
443 | }; | ||
444 | |||
445 | static const struct clksel dsp_irate_ick_clksel[] = { | ||
446 | { .parent = &dsp_fck, .rates = dsp_irate_ick_rates }, | ||
447 | { .parent = NULL } | 435 | { .parent = NULL } |
448 | }; | 436 | }; |
449 | 437 | ||
450 | /* This clock does not exist as such in the TRM. */ | ||
451 | static struct clk dsp_irate_ick = { | ||
452 | .name = "dsp_irate_ick", | ||
453 | .ops = &clkops_null, | ||
454 | .parent = &dsp_fck, | ||
455 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
456 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
457 | .clksel = dsp_irate_ick_clksel, | ||
458 | .recalc = &omap2_clksel_recalc, | ||
459 | }; | ||
460 | |||
461 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ | 438 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ |
462 | static struct clk iva2_1_ick = { | 439 | static struct clk iva2_1_ick = { |
463 | .name = "iva2_1_ick", | 440 | .name = "iva2_1_ick", |
464 | .ops = &clkops_omap2_dflt_wait, | 441 | .ops = &clkops_omap2_dflt_wait, |
465 | .parent = &dsp_irate_ick, | 442 | .parent = &dsp_fck, |
443 | .clkdm_name = "dsp_clkdm", | ||
466 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 444 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
467 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | 445 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
446 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
447 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
448 | .clksel = dsp_ick_clksel, | ||
449 | .recalc = &omap2_clksel_recalc, | ||
468 | }; | 450 | }; |
469 | 451 | ||
470 | /* | 452 | /* |
@@ -525,7 +507,7 @@ static const struct clksel usb_l4_ick_clksel[] = { | |||
525 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ | 507 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ |
526 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ | 508 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ |
527 | .name = "usb_l4_ick", | 509 | .name = "usb_l4_ick", |
528 | .ops = &clkops_omap2_dflt_wait, | 510 | .ops = &clkops_omap2_iclk_dflt_wait, |
529 | .parent = &core_l3_ck, | 511 | .parent = &core_l3_ck, |
530 | .clkdm_name = "core_l4_clkdm", | 512 | .clkdm_name = "core_l4_clkdm", |
531 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 513 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -606,7 +588,7 @@ static struct clk ssi_ssr_sst_fck = { | |||
606 | */ | 588 | */ |
607 | static struct clk ssi_l4_ick = { | 589 | static struct clk ssi_l4_ick = { |
608 | .name = "ssi_l4_ick", | 590 | .name = "ssi_l4_ick", |
609 | .ops = &clkops_omap2_dflt_wait, | 591 | .ops = &clkops_omap2_iclk_dflt_wait, |
610 | .parent = &l4_ck, | 592 | .parent = &l4_ck, |
611 | .clkdm_name = "core_l4_clkdm", | 593 | .clkdm_name = "core_l4_clkdm", |
612 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 594 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -661,6 +643,7 @@ static struct clk gfx_2d_fck = { | |||
661 | .recalc = &omap2_clksel_recalc, | 643 | .recalc = &omap2_clksel_recalc, |
662 | }; | 644 | }; |
663 | 645 | ||
646 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
664 | static struct clk gfx_ick = { | 647 | static struct clk gfx_ick = { |
665 | .name = "gfx_ick", /* From l3 */ | 648 | .name = "gfx_ick", /* From l3 */ |
666 | .ops = &clkops_omap2_dflt_wait, | 649 | .ops = &clkops_omap2_dflt_wait, |
@@ -693,7 +676,7 @@ static const struct clksel mdm_ick_clksel[] = { | |||
693 | 676 | ||
694 | static struct clk mdm_ick = { /* used both as a ick and fck */ | 677 | static struct clk mdm_ick = { /* used both as a ick and fck */ |
695 | .name = "mdm_ick", | 678 | .name = "mdm_ick", |
696 | .ops = &clkops_omap2_dflt_wait, | 679 | .ops = &clkops_omap2_iclk_dflt_wait, |
697 | .parent = &core_ck, | 680 | .parent = &core_ck, |
698 | .clkdm_name = "mdm_clkdm", | 681 | .clkdm_name = "mdm_clkdm", |
699 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), | 682 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), |
@@ -706,7 +689,7 @@ static struct clk mdm_ick = { /* used both as a ick and fck */ | |||
706 | 689 | ||
707 | static struct clk mdm_osc_ck = { | 690 | static struct clk mdm_osc_ck = { |
708 | .name = "mdm_osc_ck", | 691 | .name = "mdm_osc_ck", |
709 | .ops = &clkops_omap2_dflt_wait, | 692 | .ops = &clkops_omap2_mdmclk_dflt_wait, |
710 | .parent = &osc_ck, | 693 | .parent = &osc_ck, |
711 | .clkdm_name = "mdm_clkdm", | 694 | .clkdm_name = "mdm_clkdm", |
712 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), | 695 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), |
@@ -751,7 +734,7 @@ static const struct clksel dss1_fck_clksel[] = { | |||
751 | 734 | ||
752 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | 735 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ |
753 | .name = "dss_ick", | 736 | .name = "dss_ick", |
754 | .ops = &clkops_omap2_dflt, | 737 | .ops = &clkops_omap2_iclk_dflt, |
755 | .parent = &l4_ck, /* really both l3 and l4 */ | 738 | .parent = &l4_ck, /* really both l3 and l4 */ |
756 | .clkdm_name = "dss_clkdm", | 739 | .clkdm_name = "dss_clkdm", |
757 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 740 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -813,6 +796,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */ | |||
813 | .recalc = &followparent_recalc, | 796 | .recalc = &followparent_recalc, |
814 | }; | 797 | }; |
815 | 798 | ||
799 | static struct clk wu_l4_ick = { | ||
800 | .name = "wu_l4_ick", | ||
801 | .ops = &clkops_null, | ||
802 | .parent = &sys_ck, | ||
803 | .clkdm_name = "wkup_clkdm", | ||
804 | .recalc = &followparent_recalc, | ||
805 | }; | ||
806 | |||
816 | /* | 807 | /* |
817 | * CORE power domain ICLK & FCLK defines. | 808 | * CORE power domain ICLK & FCLK defines. |
818 | * Many of the these can have more than one possible parent. Entries | 809 | * Many of the these can have more than one possible parent. Entries |
@@ -833,9 +824,9 @@ static const struct clksel omap24xx_gpt_clksel[] = { | |||
833 | 824 | ||
834 | static struct clk gpt1_ick = { | 825 | static struct clk gpt1_ick = { |
835 | .name = "gpt1_ick", | 826 | .name = "gpt1_ick", |
836 | .ops = &clkops_omap2_dflt_wait, | 827 | .ops = &clkops_omap2_iclk_dflt_wait, |
837 | .parent = &l4_ck, | 828 | .parent = &wu_l4_ick, |
838 | .clkdm_name = "core_l4_clkdm", | 829 | .clkdm_name = "wkup_clkdm", |
839 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 830 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
840 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | 831 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
841 | .recalc = &followparent_recalc, | 832 | .recalc = &followparent_recalc, |
@@ -859,7 +850,7 @@ static struct clk gpt1_fck = { | |||
859 | 850 | ||
860 | static struct clk gpt2_ick = { | 851 | static struct clk gpt2_ick = { |
861 | .name = "gpt2_ick", | 852 | .name = "gpt2_ick", |
862 | .ops = &clkops_omap2_dflt_wait, | 853 | .ops = &clkops_omap2_iclk_dflt_wait, |
863 | .parent = &l4_ck, | 854 | .parent = &l4_ck, |
864 | .clkdm_name = "core_l4_clkdm", | 855 | .clkdm_name = "core_l4_clkdm", |
865 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 856 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -883,7 +874,7 @@ static struct clk gpt2_fck = { | |||
883 | 874 | ||
884 | static struct clk gpt3_ick = { | 875 | static struct clk gpt3_ick = { |
885 | .name = "gpt3_ick", | 876 | .name = "gpt3_ick", |
886 | .ops = &clkops_omap2_dflt_wait, | 877 | .ops = &clkops_omap2_iclk_dflt_wait, |
887 | .parent = &l4_ck, | 878 | .parent = &l4_ck, |
888 | .clkdm_name = "core_l4_clkdm", | 879 | .clkdm_name = "core_l4_clkdm", |
889 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 880 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -907,7 +898,7 @@ static struct clk gpt3_fck = { | |||
907 | 898 | ||
908 | static struct clk gpt4_ick = { | 899 | static struct clk gpt4_ick = { |
909 | .name = "gpt4_ick", | 900 | .name = "gpt4_ick", |
910 | .ops = &clkops_omap2_dflt_wait, | 901 | .ops = &clkops_omap2_iclk_dflt_wait, |
911 | .parent = &l4_ck, | 902 | .parent = &l4_ck, |
912 | .clkdm_name = "core_l4_clkdm", | 903 | .clkdm_name = "core_l4_clkdm", |
913 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 904 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -931,7 +922,7 @@ static struct clk gpt4_fck = { | |||
931 | 922 | ||
932 | static struct clk gpt5_ick = { | 923 | static struct clk gpt5_ick = { |
933 | .name = "gpt5_ick", | 924 | .name = "gpt5_ick", |
934 | .ops = &clkops_omap2_dflt_wait, | 925 | .ops = &clkops_omap2_iclk_dflt_wait, |
935 | .parent = &l4_ck, | 926 | .parent = &l4_ck, |
936 | .clkdm_name = "core_l4_clkdm", | 927 | .clkdm_name = "core_l4_clkdm", |
937 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 928 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -955,7 +946,7 @@ static struct clk gpt5_fck = { | |||
955 | 946 | ||
956 | static struct clk gpt6_ick = { | 947 | static struct clk gpt6_ick = { |
957 | .name = "gpt6_ick", | 948 | .name = "gpt6_ick", |
958 | .ops = &clkops_omap2_dflt_wait, | 949 | .ops = &clkops_omap2_iclk_dflt_wait, |
959 | .parent = &l4_ck, | 950 | .parent = &l4_ck, |
960 | .clkdm_name = "core_l4_clkdm", | 951 | .clkdm_name = "core_l4_clkdm", |
961 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 952 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -979,8 +970,9 @@ static struct clk gpt6_fck = { | |||
979 | 970 | ||
980 | static struct clk gpt7_ick = { | 971 | static struct clk gpt7_ick = { |
981 | .name = "gpt7_ick", | 972 | .name = "gpt7_ick", |
982 | .ops = &clkops_omap2_dflt_wait, | 973 | .ops = &clkops_omap2_iclk_dflt_wait, |
983 | .parent = &l4_ck, | 974 | .parent = &l4_ck, |
975 | .clkdm_name = "core_l4_clkdm", | ||
984 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 976 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
985 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | 977 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
986 | .recalc = &followparent_recalc, | 978 | .recalc = &followparent_recalc, |
@@ -1002,7 +994,7 @@ static struct clk gpt7_fck = { | |||
1002 | 994 | ||
1003 | static struct clk gpt8_ick = { | 995 | static struct clk gpt8_ick = { |
1004 | .name = "gpt8_ick", | 996 | .name = "gpt8_ick", |
1005 | .ops = &clkops_omap2_dflt_wait, | 997 | .ops = &clkops_omap2_iclk_dflt_wait, |
1006 | .parent = &l4_ck, | 998 | .parent = &l4_ck, |
1007 | .clkdm_name = "core_l4_clkdm", | 999 | .clkdm_name = "core_l4_clkdm", |
1008 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1000 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1026,7 +1018,7 @@ static struct clk gpt8_fck = { | |||
1026 | 1018 | ||
1027 | static struct clk gpt9_ick = { | 1019 | static struct clk gpt9_ick = { |
1028 | .name = "gpt9_ick", | 1020 | .name = "gpt9_ick", |
1029 | .ops = &clkops_omap2_dflt_wait, | 1021 | .ops = &clkops_omap2_iclk_dflt_wait, |
1030 | .parent = &l4_ck, | 1022 | .parent = &l4_ck, |
1031 | .clkdm_name = "core_l4_clkdm", | 1023 | .clkdm_name = "core_l4_clkdm", |
1032 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1024 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1050,7 +1042,7 @@ static struct clk gpt9_fck = { | |||
1050 | 1042 | ||
1051 | static struct clk gpt10_ick = { | 1043 | static struct clk gpt10_ick = { |
1052 | .name = "gpt10_ick", | 1044 | .name = "gpt10_ick", |
1053 | .ops = &clkops_omap2_dflt_wait, | 1045 | .ops = &clkops_omap2_iclk_dflt_wait, |
1054 | .parent = &l4_ck, | 1046 | .parent = &l4_ck, |
1055 | .clkdm_name = "core_l4_clkdm", | 1047 | .clkdm_name = "core_l4_clkdm", |
1056 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1048 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1074,7 +1066,7 @@ static struct clk gpt10_fck = { | |||
1074 | 1066 | ||
1075 | static struct clk gpt11_ick = { | 1067 | static struct clk gpt11_ick = { |
1076 | .name = "gpt11_ick", | 1068 | .name = "gpt11_ick", |
1077 | .ops = &clkops_omap2_dflt_wait, | 1069 | .ops = &clkops_omap2_iclk_dflt_wait, |
1078 | .parent = &l4_ck, | 1070 | .parent = &l4_ck, |
1079 | .clkdm_name = "core_l4_clkdm", | 1071 | .clkdm_name = "core_l4_clkdm", |
1080 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1072 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1098,7 +1090,7 @@ static struct clk gpt11_fck = { | |||
1098 | 1090 | ||
1099 | static struct clk gpt12_ick = { | 1091 | static struct clk gpt12_ick = { |
1100 | .name = "gpt12_ick", | 1092 | .name = "gpt12_ick", |
1101 | .ops = &clkops_omap2_dflt_wait, | 1093 | .ops = &clkops_omap2_iclk_dflt_wait, |
1102 | .parent = &l4_ck, | 1094 | .parent = &l4_ck, |
1103 | .clkdm_name = "core_l4_clkdm", | 1095 | .clkdm_name = "core_l4_clkdm", |
1104 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1096 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1122,7 +1114,7 @@ static struct clk gpt12_fck = { | |||
1122 | 1114 | ||
1123 | static struct clk mcbsp1_ick = { | 1115 | static struct clk mcbsp1_ick = { |
1124 | .name = "mcbsp1_ick", | 1116 | .name = "mcbsp1_ick", |
1125 | .ops = &clkops_omap2_dflt_wait, | 1117 | .ops = &clkops_omap2_iclk_dflt_wait, |
1126 | .parent = &l4_ck, | 1118 | .parent = &l4_ck, |
1127 | .clkdm_name = "core_l4_clkdm", | 1119 | .clkdm_name = "core_l4_clkdm", |
1128 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1120 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1162,7 +1154,7 @@ static struct clk mcbsp1_fck = { | |||
1162 | 1154 | ||
1163 | static struct clk mcbsp2_ick = { | 1155 | static struct clk mcbsp2_ick = { |
1164 | .name = "mcbsp2_ick", | 1156 | .name = "mcbsp2_ick", |
1165 | .ops = &clkops_omap2_dflt_wait, | 1157 | .ops = &clkops_omap2_iclk_dflt_wait, |
1166 | .parent = &l4_ck, | 1158 | .parent = &l4_ck, |
1167 | .clkdm_name = "core_l4_clkdm", | 1159 | .clkdm_name = "core_l4_clkdm", |
1168 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1160 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1186,7 +1178,7 @@ static struct clk mcbsp2_fck = { | |||
1186 | 1178 | ||
1187 | static struct clk mcbsp3_ick = { | 1179 | static struct clk mcbsp3_ick = { |
1188 | .name = "mcbsp3_ick", | 1180 | .name = "mcbsp3_ick", |
1189 | .ops = &clkops_omap2_dflt_wait, | 1181 | .ops = &clkops_omap2_iclk_dflt_wait, |
1190 | .parent = &l4_ck, | 1182 | .parent = &l4_ck, |
1191 | .clkdm_name = "core_l4_clkdm", | 1183 | .clkdm_name = "core_l4_clkdm", |
1192 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1184 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1210,7 +1202,7 @@ static struct clk mcbsp3_fck = { | |||
1210 | 1202 | ||
1211 | static struct clk mcbsp4_ick = { | 1203 | static struct clk mcbsp4_ick = { |
1212 | .name = "mcbsp4_ick", | 1204 | .name = "mcbsp4_ick", |
1213 | .ops = &clkops_omap2_dflt_wait, | 1205 | .ops = &clkops_omap2_iclk_dflt_wait, |
1214 | .parent = &l4_ck, | 1206 | .parent = &l4_ck, |
1215 | .clkdm_name = "core_l4_clkdm", | 1207 | .clkdm_name = "core_l4_clkdm", |
1216 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1208 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1234,7 +1226,7 @@ static struct clk mcbsp4_fck = { | |||
1234 | 1226 | ||
1235 | static struct clk mcbsp5_ick = { | 1227 | static struct clk mcbsp5_ick = { |
1236 | .name = "mcbsp5_ick", | 1228 | .name = "mcbsp5_ick", |
1237 | .ops = &clkops_omap2_dflt_wait, | 1229 | .ops = &clkops_omap2_iclk_dflt_wait, |
1238 | .parent = &l4_ck, | 1230 | .parent = &l4_ck, |
1239 | .clkdm_name = "core_l4_clkdm", | 1231 | .clkdm_name = "core_l4_clkdm", |
1240 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1232 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1258,7 +1250,7 @@ static struct clk mcbsp5_fck = { | |||
1258 | 1250 | ||
1259 | static struct clk mcspi1_ick = { | 1251 | static struct clk mcspi1_ick = { |
1260 | .name = "mcspi1_ick", | 1252 | .name = "mcspi1_ick", |
1261 | .ops = &clkops_omap2_dflt_wait, | 1253 | .ops = &clkops_omap2_iclk_dflt_wait, |
1262 | .parent = &l4_ck, | 1254 | .parent = &l4_ck, |
1263 | .clkdm_name = "core_l4_clkdm", | 1255 | .clkdm_name = "core_l4_clkdm", |
1264 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1256 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1278,7 +1270,7 @@ static struct clk mcspi1_fck = { | |||
1278 | 1270 | ||
1279 | static struct clk mcspi2_ick = { | 1271 | static struct clk mcspi2_ick = { |
1280 | .name = "mcspi2_ick", | 1272 | .name = "mcspi2_ick", |
1281 | .ops = &clkops_omap2_dflt_wait, | 1273 | .ops = &clkops_omap2_iclk_dflt_wait, |
1282 | .parent = &l4_ck, | 1274 | .parent = &l4_ck, |
1283 | .clkdm_name = "core_l4_clkdm", | 1275 | .clkdm_name = "core_l4_clkdm", |
1284 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1276 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1298,7 +1290,7 @@ static struct clk mcspi2_fck = { | |||
1298 | 1290 | ||
1299 | static struct clk mcspi3_ick = { | 1291 | static struct clk mcspi3_ick = { |
1300 | .name = "mcspi3_ick", | 1292 | .name = "mcspi3_ick", |
1301 | .ops = &clkops_omap2_dflt_wait, | 1293 | .ops = &clkops_omap2_iclk_dflt_wait, |
1302 | .parent = &l4_ck, | 1294 | .parent = &l4_ck, |
1303 | .clkdm_name = "core_l4_clkdm", | 1295 | .clkdm_name = "core_l4_clkdm", |
1304 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1296 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1318,7 +1310,7 @@ static struct clk mcspi3_fck = { | |||
1318 | 1310 | ||
1319 | static struct clk uart1_ick = { | 1311 | static struct clk uart1_ick = { |
1320 | .name = "uart1_ick", | 1312 | .name = "uart1_ick", |
1321 | .ops = &clkops_omap2_dflt_wait, | 1313 | .ops = &clkops_omap2_iclk_dflt_wait, |
1322 | .parent = &l4_ck, | 1314 | .parent = &l4_ck, |
1323 | .clkdm_name = "core_l4_clkdm", | 1315 | .clkdm_name = "core_l4_clkdm", |
1324 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1316 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1338,7 +1330,7 @@ static struct clk uart1_fck = { | |||
1338 | 1330 | ||
1339 | static struct clk uart2_ick = { | 1331 | static struct clk uart2_ick = { |
1340 | .name = "uart2_ick", | 1332 | .name = "uart2_ick", |
1341 | .ops = &clkops_omap2_dflt_wait, | 1333 | .ops = &clkops_omap2_iclk_dflt_wait, |
1342 | .parent = &l4_ck, | 1334 | .parent = &l4_ck, |
1343 | .clkdm_name = "core_l4_clkdm", | 1335 | .clkdm_name = "core_l4_clkdm", |
1344 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1336 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1358,7 +1350,7 @@ static struct clk uart2_fck = { | |||
1358 | 1350 | ||
1359 | static struct clk uart3_ick = { | 1351 | static struct clk uart3_ick = { |
1360 | .name = "uart3_ick", | 1352 | .name = "uart3_ick", |
1361 | .ops = &clkops_omap2_dflt_wait, | 1353 | .ops = &clkops_omap2_iclk_dflt_wait, |
1362 | .parent = &l4_ck, | 1354 | .parent = &l4_ck, |
1363 | .clkdm_name = "core_l4_clkdm", | 1355 | .clkdm_name = "core_l4_clkdm", |
1364 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1356 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1378,9 +1370,9 @@ static struct clk uart3_fck = { | |||
1378 | 1370 | ||
1379 | static struct clk gpios_ick = { | 1371 | static struct clk gpios_ick = { |
1380 | .name = "gpios_ick", | 1372 | .name = "gpios_ick", |
1381 | .ops = &clkops_omap2_dflt_wait, | 1373 | .ops = &clkops_omap2_iclk_dflt_wait, |
1382 | .parent = &l4_ck, | 1374 | .parent = &wu_l4_ick, |
1383 | .clkdm_name = "core_l4_clkdm", | 1375 | .clkdm_name = "wkup_clkdm", |
1384 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1376 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1385 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | 1377 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
1386 | .recalc = &followparent_recalc, | 1378 | .recalc = &followparent_recalc, |
@@ -1398,9 +1390,9 @@ static struct clk gpios_fck = { | |||
1398 | 1390 | ||
1399 | static struct clk mpu_wdt_ick = { | 1391 | static struct clk mpu_wdt_ick = { |
1400 | .name = "mpu_wdt_ick", | 1392 | .name = "mpu_wdt_ick", |
1401 | .ops = &clkops_omap2_dflt_wait, | 1393 | .ops = &clkops_omap2_iclk_dflt_wait, |
1402 | .parent = &l4_ck, | 1394 | .parent = &wu_l4_ick, |
1403 | .clkdm_name = "core_l4_clkdm", | 1395 | .clkdm_name = "wkup_clkdm", |
1404 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1396 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1405 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | 1397 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
1406 | .recalc = &followparent_recalc, | 1398 | .recalc = &followparent_recalc, |
@@ -1418,10 +1410,10 @@ static struct clk mpu_wdt_fck = { | |||
1418 | 1410 | ||
1419 | static struct clk sync_32k_ick = { | 1411 | static struct clk sync_32k_ick = { |
1420 | .name = "sync_32k_ick", | 1412 | .name = "sync_32k_ick", |
1421 | .ops = &clkops_omap2_dflt_wait, | 1413 | .ops = &clkops_omap2_iclk_dflt_wait, |
1422 | .parent = &l4_ck, | ||
1423 | .flags = ENABLE_ON_INIT, | 1414 | .flags = ENABLE_ON_INIT, |
1424 | .clkdm_name = "core_l4_clkdm", | 1415 | .parent = &wu_l4_ick, |
1416 | .clkdm_name = "wkup_clkdm", | ||
1425 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1417 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1426 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, | 1418 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, |
1427 | .recalc = &followparent_recalc, | 1419 | .recalc = &followparent_recalc, |
@@ -1429,9 +1421,9 @@ static struct clk sync_32k_ick = { | |||
1429 | 1421 | ||
1430 | static struct clk wdt1_ick = { | 1422 | static struct clk wdt1_ick = { |
1431 | .name = "wdt1_ick", | 1423 | .name = "wdt1_ick", |
1432 | .ops = &clkops_omap2_dflt_wait, | 1424 | .ops = &clkops_omap2_iclk_dflt_wait, |
1433 | .parent = &l4_ck, | 1425 | .parent = &wu_l4_ick, |
1434 | .clkdm_name = "core_l4_clkdm", | 1426 | .clkdm_name = "wkup_clkdm", |
1435 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1427 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1436 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, | 1428 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, |
1437 | .recalc = &followparent_recalc, | 1429 | .recalc = &followparent_recalc, |
@@ -1439,10 +1431,10 @@ static struct clk wdt1_ick = { | |||
1439 | 1431 | ||
1440 | static struct clk omapctrl_ick = { | 1432 | static struct clk omapctrl_ick = { |
1441 | .name = "omapctrl_ick", | 1433 | .name = "omapctrl_ick", |
1442 | .ops = &clkops_omap2_dflt_wait, | 1434 | .ops = &clkops_omap2_iclk_dflt_wait, |
1443 | .parent = &l4_ck, | ||
1444 | .flags = ENABLE_ON_INIT, | 1435 | .flags = ENABLE_ON_INIT, |
1445 | .clkdm_name = "core_l4_clkdm", | 1436 | .parent = &wu_l4_ick, |
1437 | .clkdm_name = "wkup_clkdm", | ||
1446 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1438 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1447 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, | 1439 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, |
1448 | .recalc = &followparent_recalc, | 1440 | .recalc = &followparent_recalc, |
@@ -1450,9 +1442,9 @@ static struct clk omapctrl_ick = { | |||
1450 | 1442 | ||
1451 | static struct clk icr_ick = { | 1443 | static struct clk icr_ick = { |
1452 | .name = "icr_ick", | 1444 | .name = "icr_ick", |
1453 | .ops = &clkops_omap2_dflt_wait, | 1445 | .ops = &clkops_omap2_iclk_dflt_wait, |
1454 | .parent = &l4_ck, | 1446 | .parent = &wu_l4_ick, |
1455 | .clkdm_name = "core_l4_clkdm", | 1447 | .clkdm_name = "wkup_clkdm", |
1456 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1448 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1457 | .enable_bit = OMAP2430_EN_ICR_SHIFT, | 1449 | .enable_bit = OMAP2430_EN_ICR_SHIFT, |
1458 | .recalc = &followparent_recalc, | 1450 | .recalc = &followparent_recalc, |
@@ -1460,7 +1452,7 @@ static struct clk icr_ick = { | |||
1460 | 1452 | ||
1461 | static struct clk cam_ick = { | 1453 | static struct clk cam_ick = { |
1462 | .name = "cam_ick", | 1454 | .name = "cam_ick", |
1463 | .ops = &clkops_omap2_dflt, | 1455 | .ops = &clkops_omap2_iclk_dflt, |
1464 | .parent = &l4_ck, | 1456 | .parent = &l4_ck, |
1465 | .clkdm_name = "core_l4_clkdm", | 1457 | .clkdm_name = "core_l4_clkdm", |
1466 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1458 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1485,7 +1477,7 @@ static struct clk cam_fck = { | |||
1485 | 1477 | ||
1486 | static struct clk mailboxes_ick = { | 1478 | static struct clk mailboxes_ick = { |
1487 | .name = "mailboxes_ick", | 1479 | .name = "mailboxes_ick", |
1488 | .ops = &clkops_omap2_dflt_wait, | 1480 | .ops = &clkops_omap2_iclk_dflt_wait, |
1489 | .parent = &l4_ck, | 1481 | .parent = &l4_ck, |
1490 | .clkdm_name = "core_l4_clkdm", | 1482 | .clkdm_name = "core_l4_clkdm", |
1491 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1483 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1495,7 +1487,7 @@ static struct clk mailboxes_ick = { | |||
1495 | 1487 | ||
1496 | static struct clk wdt4_ick = { | 1488 | static struct clk wdt4_ick = { |
1497 | .name = "wdt4_ick", | 1489 | .name = "wdt4_ick", |
1498 | .ops = &clkops_omap2_dflt_wait, | 1490 | .ops = &clkops_omap2_iclk_dflt_wait, |
1499 | .parent = &l4_ck, | 1491 | .parent = &l4_ck, |
1500 | .clkdm_name = "core_l4_clkdm", | 1492 | .clkdm_name = "core_l4_clkdm", |
1501 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1493 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1515,7 +1507,7 @@ static struct clk wdt4_fck = { | |||
1515 | 1507 | ||
1516 | static struct clk mspro_ick = { | 1508 | static struct clk mspro_ick = { |
1517 | .name = "mspro_ick", | 1509 | .name = "mspro_ick", |
1518 | .ops = &clkops_omap2_dflt_wait, | 1510 | .ops = &clkops_omap2_iclk_dflt_wait, |
1519 | .parent = &l4_ck, | 1511 | .parent = &l4_ck, |
1520 | .clkdm_name = "core_l4_clkdm", | 1512 | .clkdm_name = "core_l4_clkdm", |
1521 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1513 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1535,7 +1527,7 @@ static struct clk mspro_fck = { | |||
1535 | 1527 | ||
1536 | static struct clk fac_ick = { | 1528 | static struct clk fac_ick = { |
1537 | .name = "fac_ick", | 1529 | .name = "fac_ick", |
1538 | .ops = &clkops_omap2_dflt_wait, | 1530 | .ops = &clkops_omap2_iclk_dflt_wait, |
1539 | .parent = &l4_ck, | 1531 | .parent = &l4_ck, |
1540 | .clkdm_name = "core_l4_clkdm", | 1532 | .clkdm_name = "core_l4_clkdm", |
1541 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1533 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1555,7 +1547,7 @@ static struct clk fac_fck = { | |||
1555 | 1547 | ||
1556 | static struct clk hdq_ick = { | 1548 | static struct clk hdq_ick = { |
1557 | .name = "hdq_ick", | 1549 | .name = "hdq_ick", |
1558 | .ops = &clkops_omap2_dflt_wait, | 1550 | .ops = &clkops_omap2_iclk_dflt_wait, |
1559 | .parent = &l4_ck, | 1551 | .parent = &l4_ck, |
1560 | .clkdm_name = "core_l4_clkdm", | 1552 | .clkdm_name = "core_l4_clkdm", |
1561 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1553 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1579,7 +1571,7 @@ static struct clk hdq_fck = { | |||
1579 | */ | 1571 | */ |
1580 | static struct clk i2c2_ick = { | 1572 | static struct clk i2c2_ick = { |
1581 | .name = "i2c2_ick", | 1573 | .name = "i2c2_ick", |
1582 | .ops = &clkops_omap2_dflt_wait, | 1574 | .ops = &clkops_omap2_iclk_dflt_wait, |
1583 | .parent = &l4_ck, | 1575 | .parent = &l4_ck, |
1584 | .clkdm_name = "core_l4_clkdm", | 1576 | .clkdm_name = "core_l4_clkdm", |
1585 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1577 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1603,7 +1595,7 @@ static struct clk i2chs2_fck = { | |||
1603 | */ | 1595 | */ |
1604 | static struct clk i2c1_ick = { | 1596 | static struct clk i2c1_ick = { |
1605 | .name = "i2c1_ick", | 1597 | .name = "i2c1_ick", |
1606 | .ops = &clkops_omap2_dflt_wait, | 1598 | .ops = &clkops_omap2_iclk_dflt_wait, |
1607 | .parent = &l4_ck, | 1599 | .parent = &l4_ck, |
1608 | .clkdm_name = "core_l4_clkdm", | 1600 | .clkdm_name = "core_l4_clkdm", |
1609 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1601 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1621,12 +1613,18 @@ static struct clk i2chs1_fck = { | |||
1621 | .recalc = &followparent_recalc, | 1613 | .recalc = &followparent_recalc, |
1622 | }; | 1614 | }; |
1623 | 1615 | ||
1616 | /* | ||
1617 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
1618 | * accesses derived from this data. | ||
1619 | */ | ||
1624 | static struct clk gpmc_fck = { | 1620 | static struct clk gpmc_fck = { |
1625 | .name = "gpmc_fck", | 1621 | .name = "gpmc_fck", |
1626 | .ops = &clkops_null, /* RMK: missing? */ | 1622 | .ops = &clkops_omap2_iclk_idle_only, |
1627 | .parent = &core_l3_ck, | 1623 | .parent = &core_l3_ck, |
1628 | .flags = ENABLE_ON_INIT, | 1624 | .flags = ENABLE_ON_INIT, |
1629 | .clkdm_name = "core_l3_clkdm", | 1625 | .clkdm_name = "core_l3_clkdm", |
1626 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
1627 | .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT, | ||
1630 | .recalc = &followparent_recalc, | 1628 | .recalc = &followparent_recalc, |
1631 | }; | 1629 | }; |
1632 | 1630 | ||
@@ -1638,20 +1636,26 @@ static struct clk sdma_fck = { | |||
1638 | .recalc = &followparent_recalc, | 1636 | .recalc = &followparent_recalc, |
1639 | }; | 1637 | }; |
1640 | 1638 | ||
1639 | /* | ||
1640 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
1641 | * accesses derived from this data. | ||
1642 | */ | ||
1641 | static struct clk sdma_ick = { | 1643 | static struct clk sdma_ick = { |
1642 | .name = "sdma_ick", | 1644 | .name = "sdma_ick", |
1643 | .ops = &clkops_null, /* RMK: missing? */ | 1645 | .ops = &clkops_omap2_iclk_idle_only, |
1644 | .parent = &l4_ck, | 1646 | .parent = &core_l3_ck, |
1645 | .clkdm_name = "core_l3_clkdm", | 1647 | .clkdm_name = "core_l3_clkdm", |
1648 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
1649 | .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT, | ||
1646 | .recalc = &followparent_recalc, | 1650 | .recalc = &followparent_recalc, |
1647 | }; | 1651 | }; |
1648 | 1652 | ||
1649 | static struct clk sdrc_ick = { | 1653 | static struct clk sdrc_ick = { |
1650 | .name = "sdrc_ick", | 1654 | .name = "sdrc_ick", |
1651 | .ops = &clkops_omap2_dflt_wait, | 1655 | .ops = &clkops_omap2_iclk_idle_only, |
1652 | .parent = &l4_ck, | 1656 | .parent = &core_l3_ck, |
1653 | .flags = ENABLE_ON_INIT, | 1657 | .flags = ENABLE_ON_INIT, |
1654 | .clkdm_name = "core_l4_clkdm", | 1658 | .clkdm_name = "core_l3_clkdm", |
1655 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1659 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
1656 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, | 1660 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, |
1657 | .recalc = &followparent_recalc, | 1661 | .recalc = &followparent_recalc, |
@@ -1659,7 +1663,7 @@ static struct clk sdrc_ick = { | |||
1659 | 1663 | ||
1660 | static struct clk des_ick = { | 1664 | static struct clk des_ick = { |
1661 | .name = "des_ick", | 1665 | .name = "des_ick", |
1662 | .ops = &clkops_omap2_dflt_wait, | 1666 | .ops = &clkops_omap2_iclk_dflt_wait, |
1663 | .parent = &l4_ck, | 1667 | .parent = &l4_ck, |
1664 | .clkdm_name = "core_l4_clkdm", | 1668 | .clkdm_name = "core_l4_clkdm", |
1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1669 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1669,7 +1673,7 @@ static struct clk des_ick = { | |||
1669 | 1673 | ||
1670 | static struct clk sha_ick = { | 1674 | static struct clk sha_ick = { |
1671 | .name = "sha_ick", | 1675 | .name = "sha_ick", |
1672 | .ops = &clkops_omap2_dflt_wait, | 1676 | .ops = &clkops_omap2_iclk_dflt_wait, |
1673 | .parent = &l4_ck, | 1677 | .parent = &l4_ck, |
1674 | .clkdm_name = "core_l4_clkdm", | 1678 | .clkdm_name = "core_l4_clkdm", |
1675 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1679 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1679,7 +1683,7 @@ static struct clk sha_ick = { | |||
1679 | 1683 | ||
1680 | static struct clk rng_ick = { | 1684 | static struct clk rng_ick = { |
1681 | .name = "rng_ick", | 1685 | .name = "rng_ick", |
1682 | .ops = &clkops_omap2_dflt_wait, | 1686 | .ops = &clkops_omap2_iclk_dflt_wait, |
1683 | .parent = &l4_ck, | 1687 | .parent = &l4_ck, |
1684 | .clkdm_name = "core_l4_clkdm", | 1688 | .clkdm_name = "core_l4_clkdm", |
1685 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1689 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1689,7 +1693,7 @@ static struct clk rng_ick = { | |||
1689 | 1693 | ||
1690 | static struct clk aes_ick = { | 1694 | static struct clk aes_ick = { |
1691 | .name = "aes_ick", | 1695 | .name = "aes_ick", |
1692 | .ops = &clkops_omap2_dflt_wait, | 1696 | .ops = &clkops_omap2_iclk_dflt_wait, |
1693 | .parent = &l4_ck, | 1697 | .parent = &l4_ck, |
1694 | .clkdm_name = "core_l4_clkdm", | 1698 | .clkdm_name = "core_l4_clkdm", |
1695 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1699 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1699,7 +1703,7 @@ static struct clk aes_ick = { | |||
1699 | 1703 | ||
1700 | static struct clk pka_ick = { | 1704 | static struct clk pka_ick = { |
1701 | .name = "pka_ick", | 1705 | .name = "pka_ick", |
1702 | .ops = &clkops_omap2_dflt_wait, | 1706 | .ops = &clkops_omap2_iclk_dflt_wait, |
1703 | .parent = &l4_ck, | 1707 | .parent = &l4_ck, |
1704 | .clkdm_name = "core_l4_clkdm", | 1708 | .clkdm_name = "core_l4_clkdm", |
1705 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1709 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
@@ -1719,7 +1723,7 @@ static struct clk usb_fck = { | |||
1719 | 1723 | ||
1720 | static struct clk usbhs_ick = { | 1724 | static struct clk usbhs_ick = { |
1721 | .name = "usbhs_ick", | 1725 | .name = "usbhs_ick", |
1722 | .ops = &clkops_omap2_dflt_wait, | 1726 | .ops = &clkops_omap2_iclk_dflt_wait, |
1723 | .parent = &core_l3_ck, | 1727 | .parent = &core_l3_ck, |
1724 | .clkdm_name = "core_l3_clkdm", | 1728 | .clkdm_name = "core_l3_clkdm", |
1725 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1729 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1729,7 +1733,7 @@ static struct clk usbhs_ick = { | |||
1729 | 1733 | ||
1730 | static struct clk mmchs1_ick = { | 1734 | static struct clk mmchs1_ick = { |
1731 | .name = "mmchs1_ick", | 1735 | .name = "mmchs1_ick", |
1732 | .ops = &clkops_omap2_dflt_wait, | 1736 | .ops = &clkops_omap2_iclk_dflt_wait, |
1733 | .parent = &l4_ck, | 1737 | .parent = &l4_ck, |
1734 | .clkdm_name = "core_l4_clkdm", | 1738 | .clkdm_name = "core_l4_clkdm", |
1735 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1739 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1741,7 +1745,7 @@ static struct clk mmchs1_fck = { | |||
1741 | .name = "mmchs1_fck", | 1745 | .name = "mmchs1_fck", |
1742 | .ops = &clkops_omap2_dflt_wait, | 1746 | .ops = &clkops_omap2_dflt_wait, |
1743 | .parent = &func_96m_ck, | 1747 | .parent = &func_96m_ck, |
1744 | .clkdm_name = "core_l3_clkdm", | 1748 | .clkdm_name = "core_l4_clkdm", |
1745 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1749 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1746 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, | 1750 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, |
1747 | .recalc = &followparent_recalc, | 1751 | .recalc = &followparent_recalc, |
@@ -1749,7 +1753,7 @@ static struct clk mmchs1_fck = { | |||
1749 | 1753 | ||
1750 | static struct clk mmchs2_ick = { | 1754 | static struct clk mmchs2_ick = { |
1751 | .name = "mmchs2_ick", | 1755 | .name = "mmchs2_ick", |
1752 | .ops = &clkops_omap2_dflt_wait, | 1756 | .ops = &clkops_omap2_iclk_dflt_wait, |
1753 | .parent = &l4_ck, | 1757 | .parent = &l4_ck, |
1754 | .clkdm_name = "core_l4_clkdm", | 1758 | .clkdm_name = "core_l4_clkdm", |
1755 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1759 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1761,6 +1765,7 @@ static struct clk mmchs2_fck = { | |||
1761 | .name = "mmchs2_fck", | 1765 | .name = "mmchs2_fck", |
1762 | .ops = &clkops_omap2_dflt_wait, | 1766 | .ops = &clkops_omap2_dflt_wait, |
1763 | .parent = &func_96m_ck, | 1767 | .parent = &func_96m_ck, |
1768 | .clkdm_name = "core_l4_clkdm", | ||
1764 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1769 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1765 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, | 1770 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
1766 | .recalc = &followparent_recalc, | 1771 | .recalc = &followparent_recalc, |
@@ -1768,7 +1773,7 @@ static struct clk mmchs2_fck = { | |||
1768 | 1773 | ||
1769 | static struct clk gpio5_ick = { | 1774 | static struct clk gpio5_ick = { |
1770 | .name = "gpio5_ick", | 1775 | .name = "gpio5_ick", |
1771 | .ops = &clkops_omap2_dflt_wait, | 1776 | .ops = &clkops_omap2_iclk_dflt_wait, |
1772 | .parent = &l4_ck, | 1777 | .parent = &l4_ck, |
1773 | .clkdm_name = "core_l4_clkdm", | 1778 | .clkdm_name = "core_l4_clkdm", |
1774 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1779 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1788,7 +1793,7 @@ static struct clk gpio5_fck = { | |||
1788 | 1793 | ||
1789 | static struct clk mdm_intc_ick = { | 1794 | static struct clk mdm_intc_ick = { |
1790 | .name = "mdm_intc_ick", | 1795 | .name = "mdm_intc_ick", |
1791 | .ops = &clkops_omap2_dflt_wait, | 1796 | .ops = &clkops_omap2_iclk_dflt_wait, |
1792 | .parent = &l4_ck, | 1797 | .parent = &l4_ck, |
1793 | .clkdm_name = "core_l4_clkdm", | 1798 | .clkdm_name = "core_l4_clkdm", |
1794 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1799 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1880,7 +1885,6 @@ static struct omap_clk omap2430_clks[] = { | |||
1880 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), | 1885 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), |
1881 | /* dsp domain clocks */ | 1886 | /* dsp domain clocks */ |
1882 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), | 1887 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), |
1883 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X), | ||
1884 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), | 1888 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), |
1885 | /* GFX domain clocks */ | 1889 | /* GFX domain clocks */ |
1886 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), | 1890 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), |
@@ -1901,6 +1905,7 @@ static struct omap_clk omap2430_clks[] = { | |||
1901 | /* L4 domain clocks */ | 1905 | /* L4 domain clocks */ |
1902 | CLK(NULL, "l4_ck", &l4_ck, CK_243X), | 1906 | CLK(NULL, "l4_ck", &l4_ck, CK_243X), |
1903 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), | 1907 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), |
1908 | CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X), | ||
1904 | /* virtual meta-group clock */ | 1909 | /* virtual meta-group clock */ |
1905 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), | 1910 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), |
1906 | /* general l4 interface ck, multi-parent functional clk */ | 1911 | /* general l4 interface ck, multi-parent functional clk */ |
@@ -1984,15 +1989,15 @@ static struct omap_clk omap2430_clks[] = { | |||
1984 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), | 1989 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), |
1985 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), | 1990 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), |
1986 | CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), | 1991 | CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), |
1987 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), | 1992 | CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X), |
1988 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), | 1993 | CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_243X), |
1989 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), | 1994 | CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X), |
1990 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X), | 1995 | CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_243X), |
1991 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), | 1996 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), |
1992 | CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), | 1997 | CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), |
1993 | CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), | 1998 | CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), |
1994 | CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), | 1999 | CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), |
1995 | CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), | 2000 | CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), |
1996 | }; | 2001 | }; |
1997 | 2002 | ||
1998 | /* | 2003 | /* |
@@ -2028,6 +2033,9 @@ int __init omap2430_clk_init(void) | |||
2028 | omap2_init_clk_clkdm(c->lk.clk); | 2033 | omap2_init_clk_clkdm(c->lk.clk); |
2029 | } | 2034 | } |
2030 | 2035 | ||
2036 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
2037 | omap_clk_disable_autoidle_all(); | ||
2038 | |||
2031 | /* Check the MPU rate set by bootloader */ | 2039 | /* Check the MPU rate set by bootloader */ |
2032 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); | 2040 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
2033 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 2041 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h index 6a658b890c17..cb6df8ca9e4a 100644 --- a/arch/arm/mach-omap2/clock2xxx.h +++ b/arch/arm/mach-omap2/clock2xxx.h | |||
@@ -20,16 +20,16 @@ u32 omap2xxx_get_apll_clkin(void); | |||
20 | u32 omap2xxx_get_sysclkdiv(void); | 20 | u32 omap2xxx_get_sysclkdiv(void); |
21 | void omap2xxx_clk_prepare_for_reboot(void); | 21 | void omap2xxx_clk_prepare_for_reboot(void); |
22 | 22 | ||
23 | #ifdef CONFIG_ARCH_OMAP2420 | 23 | #ifdef CONFIG_SOC_OMAP2420 |
24 | int omap2420_clk_init(void); | 24 | int omap2420_clk_init(void); |
25 | #else | 25 | #else |
26 | #define omap2420_clk_init() 0 | 26 | #define omap2420_clk_init() do { } while(0) |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | #ifdef CONFIG_ARCH_OMAP2430 | 29 | #ifdef CONFIG_SOC_OMAP2430 |
30 | int omap2430_clk_init(void); | 30 | int omap2430_clk_init(void); |
31 | #else | 31 | #else |
32 | #define omap2430_clk_init() 0 | 32 | #define omap2430_clk_init() do { } while(0) |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; | 35 | extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; |
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index 287abc480924..1fc96b9ee330 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP3-specific clock framework functions | 2 | * OMAP3-specific clock framework functions |
3 | * | 3 | * |
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-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley | 7 | * Paul Walmsley |
8 | * Jouni Högander | 8 | * Jouni Högander |
@@ -59,6 +59,15 @@ const struct clkops clkops_omap3430es2_ssi_wait = { | |||
59 | .find_companion = omap2_clk_dflt_find_companion, | 59 | .find_companion = omap2_clk_dflt_find_companion, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | const struct clkops clkops_omap3430es2_iclk_ssi_wait = { | ||
63 | .enable = omap2_dflt_clk_enable, | ||
64 | .disable = omap2_dflt_clk_disable, | ||
65 | .find_idlest = omap3430es2_clk_ssi_find_idlest, | ||
66 | .find_companion = omap2_clk_dflt_find_companion, | ||
67 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
68 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
69 | }; | ||
70 | |||
62 | /** | 71 | /** |
63 | * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST | 72 | * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST |
64 | * @clk: struct clk * being enabled | 73 | * @clk: struct clk * being enabled |
@@ -94,6 +103,15 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | |||
94 | .find_companion = omap2_clk_dflt_find_companion, | 103 | .find_companion = omap2_clk_dflt_find_companion, |
95 | }; | 104 | }; |
96 | 105 | ||
106 | const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait = { | ||
107 | .enable = omap2_dflt_clk_enable, | ||
108 | .disable = omap2_dflt_clk_disable, | ||
109 | .find_idlest = omap3430es2_clk_dss_usbhost_find_idlest, | ||
110 | .find_companion = omap2_clk_dflt_find_companion, | ||
111 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
112 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
113 | }; | ||
114 | |||
97 | /** | 115 | /** |
98 | * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB | 116 | * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB |
99 | * @clk: struct clk * being enabled | 117 | * @clk: struct clk * being enabled |
@@ -124,3 +142,12 @@ const struct clkops clkops_omap3430es2_hsotgusb_wait = { | |||
124 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, | 142 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, |
125 | .find_companion = omap2_clk_dflt_find_companion, | 143 | .find_companion = omap2_clk_dflt_find_companion, |
126 | }; | 144 | }; |
145 | |||
146 | const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait = { | ||
147 | .enable = omap2_dflt_clk_enable, | ||
148 | .disable = omap2_dflt_clk_disable, | ||
149 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, | ||
150 | .find_companion = omap2_clk_dflt_find_companion, | ||
151 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
152 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
153 | }; | ||
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index 628e8de57680..084ba71b2b31 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
@@ -2,14 +2,17 @@ | |||
2 | * OMAP34xx clock function prototypes and macros | 2 | * OMAP34xx clock function prototypes and macros |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H | 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H |
9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H | 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H |
10 | 10 | ||
11 | extern const struct clkops clkops_omap3430es2_ssi_wait; | 11 | extern const struct clkops clkops_omap3430es2_ssi_wait; |
12 | extern const struct clkops clkops_omap3430es2_iclk_ssi_wait; | ||
12 | extern const struct clkops clkops_omap3430es2_hsotgusb_wait; | 13 | extern const struct clkops clkops_omap3430es2_hsotgusb_wait; |
14 | extern const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait; | ||
13 | extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; | 15 | extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; |
16 | extern const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait; | ||
14 | 17 | ||
15 | #endif | 18 | #endif |
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c index 74116a3cf099..2e97d08f0e56 100644 --- a/arch/arm/mach-omap2/clock3517.c +++ b/arch/arm/mach-omap2/clock3517.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP3517/3505-specific clock framework functions | 2 | * OMAP3517/3505-specific clock framework functions |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2010 Nokia Corporation | 5 | * Copyright (C) 2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Ranjith Lohithakshan | 7 | * Ranjith Lohithakshan |
8 | * Paul Walmsley | 8 | * Paul Walmsley |
@@ -119,6 +119,8 @@ const struct clkops clkops_am35xx_ipss_wait = { | |||
119 | .disable = omap2_dflt_clk_disable, | 119 | .disable = omap2_dflt_clk_disable, |
120 | .find_idlest = am35xx_clk_ipss_find_idlest, | 120 | .find_idlest = am35xx_clk_ipss_find_idlest, |
121 | .find_companion = omap2_clk_dflt_find_companion, | 121 | .find_companion = omap2_clk_dflt_find_companion, |
122 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
123 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | 126 | ||
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c index e9f66b6dec18..952c3e01c9eb 100644 --- a/arch/arm/mach-omap2/clock3xxx.c +++ b/arch/arm/mach-omap2/clock3xxx.c | |||
@@ -65,9 +65,6 @@ void __init omap3_clk_lock_dpll5(void) | |||
65 | clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); | 65 | clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); |
66 | clk_enable(dpll5_clk); | 66 | clk_enable(dpll5_clk); |
67 | 67 | ||
68 | /* Enable autoidle to allow it to enter low power bypass */ | ||
69 | omap3_dpll_allow_idle(dpll5_clk); | ||
70 | |||
71 | /* Program dpll5_m2_clk divider for no division */ | 68 | /* Program dpll5_m2_clk divider for no division */ |
72 | dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); | 69 | dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); |
73 | clk_enable(dpll5_m2_clk); | 70 | clk_enable(dpll5_m2_clk); |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index fbb1e30a73dc..fcb321a64f13 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP3 clock data | 2 | * OMAP3 clock data |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * With many device clock fixes by Kevin Hilman and Jouni Högander | 8 | * With many device clock fixes by Kevin Hilman and Jouni Högander |
@@ -291,12 +291,11 @@ static struct dpll_data dpll1_dd = { | |||
291 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 291 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
292 | .min_divider = 1, | 292 | .min_divider = 1, |
293 | .max_divider = OMAP3_MAX_DPLL_DIV, | 293 | .max_divider = OMAP3_MAX_DPLL_DIV, |
294 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
295 | }; | 294 | }; |
296 | 295 | ||
297 | static struct clk dpll1_ck = { | 296 | static struct clk dpll1_ck = { |
298 | .name = "dpll1_ck", | 297 | .name = "dpll1_ck", |
299 | .ops = &clkops_null, | 298 | .ops = &clkops_omap3_noncore_dpll_ops, |
300 | .parent = &sys_ck, | 299 | .parent = &sys_ck, |
301 | .dpll_data = &dpll1_dd, | 300 | .dpll_data = &dpll1_dd, |
302 | .round_rate = &omap2_dpll_round_rate, | 301 | .round_rate = &omap2_dpll_round_rate, |
@@ -364,7 +363,6 @@ static struct dpll_data dpll2_dd = { | |||
364 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 363 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
365 | .min_divider = 1, | 364 | .min_divider = 1, |
366 | .max_divider = OMAP3_MAX_DPLL_DIV, | 365 | .max_divider = OMAP3_MAX_DPLL_DIV, |
367 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
368 | }; | 366 | }; |
369 | 367 | ||
370 | static struct clk dpll2_ck = { | 368 | static struct clk dpll2_ck = { |
@@ -424,12 +422,11 @@ static struct dpll_data dpll3_dd = { | |||
424 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 422 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
425 | .min_divider = 1, | 423 | .min_divider = 1, |
426 | .max_divider = OMAP3_MAX_DPLL_DIV, | 424 | .max_divider = OMAP3_MAX_DPLL_DIV, |
427 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
428 | }; | 425 | }; |
429 | 426 | ||
430 | static struct clk dpll3_ck = { | 427 | static struct clk dpll3_ck = { |
431 | .name = "dpll3_ck", | 428 | .name = "dpll3_ck", |
432 | .ops = &clkops_null, | 429 | .ops = &clkops_omap3_core_dpll_ops, |
433 | .parent = &sys_ck, | 430 | .parent = &sys_ck, |
434 | .dpll_data = &dpll3_dd, | 431 | .dpll_data = &dpll3_dd, |
435 | .round_rate = &omap2_dpll_round_rate, | 432 | .round_rate = &omap2_dpll_round_rate, |
@@ -583,7 +580,6 @@ static struct dpll_data dpll4_dd_34xx __initdata = { | |||
583 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 580 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
584 | .min_divider = 1, | 581 | .min_divider = 1, |
585 | .max_divider = OMAP3_MAX_DPLL_DIV, | 582 | .max_divider = OMAP3_MAX_DPLL_DIV, |
586 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
587 | }; | 583 | }; |
588 | 584 | ||
589 | static struct dpll_data dpll4_dd_3630 __initdata = { | 585 | static struct dpll_data dpll4_dd_3630 __initdata = { |
@@ -607,7 +603,6 @@ static struct dpll_data dpll4_dd_3630 __initdata = { | |||
607 | .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, | 603 | .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, |
608 | .min_divider = 1, | 604 | .min_divider = 1, |
609 | .max_divider = OMAP3_MAX_DPLL_DIV, | 605 | .max_divider = OMAP3_MAX_DPLL_DIV, |
610 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE, | ||
611 | .flags = DPLL_J_TYPE | 606 | .flags = DPLL_J_TYPE |
612 | }; | 607 | }; |
613 | 608 | ||
@@ -939,7 +934,6 @@ static struct dpll_data dpll5_dd = { | |||
939 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 934 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
940 | .min_divider = 1, | 935 | .min_divider = 1, |
941 | .max_divider = OMAP3_MAX_DPLL_DIV, | 936 | .max_divider = OMAP3_MAX_DPLL_DIV, |
942 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
943 | }; | 937 | }; |
944 | 938 | ||
945 | static struct clk dpll5_ck = { | 939 | static struct clk dpll5_ck = { |
@@ -1205,7 +1199,10 @@ static const struct clksel gfx_l3_clksel[] = { | |||
1205 | { .parent = NULL } | 1199 | { .parent = NULL } |
1206 | }; | 1200 | }; |
1207 | 1201 | ||
1208 | /* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ | 1202 | /* |
1203 | * Virtual parent clock for gfx_l3_ick and gfx_l3_fck | ||
1204 | * This interface clock does not have a CM_AUTOIDLE bit | ||
1205 | */ | ||
1209 | static struct clk gfx_l3_ck = { | 1206 | static struct clk gfx_l3_ck = { |
1210 | .name = "gfx_l3_ck", | 1207 | .name = "gfx_l3_ck", |
1211 | .ops = &clkops_omap2_dflt_wait, | 1208 | .ops = &clkops_omap2_dflt_wait, |
@@ -1304,6 +1301,7 @@ static struct clk sgx_fck = { | |||
1304 | .round_rate = &omap2_clksel_round_rate | 1301 | .round_rate = &omap2_clksel_round_rate |
1305 | }; | 1302 | }; |
1306 | 1303 | ||
1304 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
1307 | static struct clk sgx_ick = { | 1305 | static struct clk sgx_ick = { |
1308 | .name = "sgx_ick", | 1306 | .name = "sgx_ick", |
1309 | .ops = &clkops_omap2_dflt_wait, | 1307 | .ops = &clkops_omap2_dflt_wait, |
@@ -1328,7 +1326,7 @@ static struct clk d2d_26m_fck = { | |||
1328 | 1326 | ||
1329 | static struct clk modem_fck = { | 1327 | static struct clk modem_fck = { |
1330 | .name = "modem_fck", | 1328 | .name = "modem_fck", |
1331 | .ops = &clkops_omap2_dflt_wait, | 1329 | .ops = &clkops_omap2_mdmclk_dflt_wait, |
1332 | .parent = &sys_ck, | 1330 | .parent = &sys_ck, |
1333 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1331 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1334 | .enable_bit = OMAP3430_EN_MODEM_SHIFT, | 1332 | .enable_bit = OMAP3430_EN_MODEM_SHIFT, |
@@ -1338,7 +1336,7 @@ static struct clk modem_fck = { | |||
1338 | 1336 | ||
1339 | static struct clk sad2d_ick = { | 1337 | static struct clk sad2d_ick = { |
1340 | .name = "sad2d_ick", | 1338 | .name = "sad2d_ick", |
1341 | .ops = &clkops_omap2_dflt_wait, | 1339 | .ops = &clkops_omap2_iclk_dflt_wait, |
1342 | .parent = &l3_ick, | 1340 | .parent = &l3_ick, |
1343 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1341 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1344 | .enable_bit = OMAP3430_EN_SAD2D_SHIFT, | 1342 | .enable_bit = OMAP3430_EN_SAD2D_SHIFT, |
@@ -1348,7 +1346,7 @@ static struct clk sad2d_ick = { | |||
1348 | 1346 | ||
1349 | static struct clk mad2d_ick = { | 1347 | static struct clk mad2d_ick = { |
1350 | .name = "mad2d_ick", | 1348 | .name = "mad2d_ick", |
1351 | .ops = &clkops_omap2_dflt_wait, | 1349 | .ops = &clkops_omap2_iclk_dflt_wait, |
1352 | .parent = &l3_ick, | 1350 | .parent = &l3_ick, |
1353 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1351 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
1354 | .enable_bit = OMAP3430_EN_MAD2D_SHIFT, | 1352 | .enable_bit = OMAP3430_EN_MAD2D_SHIFT, |
@@ -1718,7 +1716,7 @@ static struct clk core_l3_ick = { | |||
1718 | 1716 | ||
1719 | static struct clk hsotgusb_ick_3430es1 = { | 1717 | static struct clk hsotgusb_ick_3430es1 = { |
1720 | .name = "hsotgusb_ick", | 1718 | .name = "hsotgusb_ick", |
1721 | .ops = &clkops_omap2_dflt, | 1719 | .ops = &clkops_omap2_iclk_dflt, |
1722 | .parent = &core_l3_ick, | 1720 | .parent = &core_l3_ick, |
1723 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1721 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1724 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | 1722 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, |
@@ -1728,7 +1726,7 @@ static struct clk hsotgusb_ick_3430es1 = { | |||
1728 | 1726 | ||
1729 | static struct clk hsotgusb_ick_3430es2 = { | 1727 | static struct clk hsotgusb_ick_3430es2 = { |
1730 | .name = "hsotgusb_ick", | 1728 | .name = "hsotgusb_ick", |
1731 | .ops = &clkops_omap3430es2_hsotgusb_wait, | 1729 | .ops = &clkops_omap3430es2_iclk_hsotgusb_wait, |
1732 | .parent = &core_l3_ick, | 1730 | .parent = &core_l3_ick, |
1733 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1731 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1734 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | 1732 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, |
@@ -1736,6 +1734,7 @@ static struct clk hsotgusb_ick_3430es2 = { | |||
1736 | .recalc = &followparent_recalc, | 1734 | .recalc = &followparent_recalc, |
1737 | }; | 1735 | }; |
1738 | 1736 | ||
1737 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
1739 | static struct clk sdrc_ick = { | 1738 | static struct clk sdrc_ick = { |
1740 | .name = "sdrc_ick", | 1739 | .name = "sdrc_ick", |
1741 | .ops = &clkops_omap2_dflt_wait, | 1740 | .ops = &clkops_omap2_dflt_wait, |
@@ -1767,7 +1766,7 @@ static struct clk security_l3_ick = { | |||
1767 | 1766 | ||
1768 | static struct clk pka_ick = { | 1767 | static struct clk pka_ick = { |
1769 | .name = "pka_ick", | 1768 | .name = "pka_ick", |
1770 | .ops = &clkops_omap2_dflt_wait, | 1769 | .ops = &clkops_omap2_iclk_dflt_wait, |
1771 | .parent = &security_l3_ick, | 1770 | .parent = &security_l3_ick, |
1772 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1771 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1773 | .enable_bit = OMAP3430_EN_PKA_SHIFT, | 1772 | .enable_bit = OMAP3430_EN_PKA_SHIFT, |
@@ -1786,7 +1785,7 @@ static struct clk core_l4_ick = { | |||
1786 | 1785 | ||
1787 | static struct clk usbtll_ick = { | 1786 | static struct clk usbtll_ick = { |
1788 | .name = "usbtll_ick", | 1787 | .name = "usbtll_ick", |
1789 | .ops = &clkops_omap2_dflt_wait, | 1788 | .ops = &clkops_omap2_iclk_dflt_wait, |
1790 | .parent = &core_l4_ick, | 1789 | .parent = &core_l4_ick, |
1791 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1790 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
1792 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1791 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
@@ -1796,7 +1795,7 @@ static struct clk usbtll_ick = { | |||
1796 | 1795 | ||
1797 | static struct clk mmchs3_ick = { | 1796 | static struct clk mmchs3_ick = { |
1798 | .name = "mmchs3_ick", | 1797 | .name = "mmchs3_ick", |
1799 | .ops = &clkops_omap2_dflt_wait, | 1798 | .ops = &clkops_omap2_iclk_dflt_wait, |
1800 | .parent = &core_l4_ick, | 1799 | .parent = &core_l4_ick, |
1801 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1800 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1802 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, | 1801 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, |
@@ -1807,7 +1806,7 @@ static struct clk mmchs3_ick = { | |||
1807 | /* Intersystem Communication Registers - chassis mode only */ | 1806 | /* Intersystem Communication Registers - chassis mode only */ |
1808 | static struct clk icr_ick = { | 1807 | static struct clk icr_ick = { |
1809 | .name = "icr_ick", | 1808 | .name = "icr_ick", |
1810 | .ops = &clkops_omap2_dflt_wait, | 1809 | .ops = &clkops_omap2_iclk_dflt_wait, |
1811 | .parent = &core_l4_ick, | 1810 | .parent = &core_l4_ick, |
1812 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1811 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1813 | .enable_bit = OMAP3430_EN_ICR_SHIFT, | 1812 | .enable_bit = OMAP3430_EN_ICR_SHIFT, |
@@ -1817,7 +1816,7 @@ static struct clk icr_ick = { | |||
1817 | 1816 | ||
1818 | static struct clk aes2_ick = { | 1817 | static struct clk aes2_ick = { |
1819 | .name = "aes2_ick", | 1818 | .name = "aes2_ick", |
1820 | .ops = &clkops_omap2_dflt_wait, | 1819 | .ops = &clkops_omap2_iclk_dflt_wait, |
1821 | .parent = &core_l4_ick, | 1820 | .parent = &core_l4_ick, |
1822 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1821 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1823 | .enable_bit = OMAP3430_EN_AES2_SHIFT, | 1822 | .enable_bit = OMAP3430_EN_AES2_SHIFT, |
@@ -1827,7 +1826,7 @@ static struct clk aes2_ick = { | |||
1827 | 1826 | ||
1828 | static struct clk sha12_ick = { | 1827 | static struct clk sha12_ick = { |
1829 | .name = "sha12_ick", | 1828 | .name = "sha12_ick", |
1830 | .ops = &clkops_omap2_dflt_wait, | 1829 | .ops = &clkops_omap2_iclk_dflt_wait, |
1831 | .parent = &core_l4_ick, | 1830 | .parent = &core_l4_ick, |
1832 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1831 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1833 | .enable_bit = OMAP3430_EN_SHA12_SHIFT, | 1832 | .enable_bit = OMAP3430_EN_SHA12_SHIFT, |
@@ -1837,7 +1836,7 @@ static struct clk sha12_ick = { | |||
1837 | 1836 | ||
1838 | static struct clk des2_ick = { | 1837 | static struct clk des2_ick = { |
1839 | .name = "des2_ick", | 1838 | .name = "des2_ick", |
1840 | .ops = &clkops_omap2_dflt_wait, | 1839 | .ops = &clkops_omap2_iclk_dflt_wait, |
1841 | .parent = &core_l4_ick, | 1840 | .parent = &core_l4_ick, |
1842 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1841 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1843 | .enable_bit = OMAP3430_EN_DES2_SHIFT, | 1842 | .enable_bit = OMAP3430_EN_DES2_SHIFT, |
@@ -1847,7 +1846,7 @@ static struct clk des2_ick = { | |||
1847 | 1846 | ||
1848 | static struct clk mmchs2_ick = { | 1847 | static struct clk mmchs2_ick = { |
1849 | .name = "mmchs2_ick", | 1848 | .name = "mmchs2_ick", |
1850 | .ops = &clkops_omap2_dflt_wait, | 1849 | .ops = &clkops_omap2_iclk_dflt_wait, |
1851 | .parent = &core_l4_ick, | 1850 | .parent = &core_l4_ick, |
1852 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1851 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1853 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, | 1852 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, |
@@ -1857,7 +1856,7 @@ static struct clk mmchs2_ick = { | |||
1857 | 1856 | ||
1858 | static struct clk mmchs1_ick = { | 1857 | static struct clk mmchs1_ick = { |
1859 | .name = "mmchs1_ick", | 1858 | .name = "mmchs1_ick", |
1860 | .ops = &clkops_omap2_dflt_wait, | 1859 | .ops = &clkops_omap2_iclk_dflt_wait, |
1861 | .parent = &core_l4_ick, | 1860 | .parent = &core_l4_ick, |
1862 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1861 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1863 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, | 1862 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, |
@@ -1867,7 +1866,7 @@ static struct clk mmchs1_ick = { | |||
1867 | 1866 | ||
1868 | static struct clk mspro_ick = { | 1867 | static struct clk mspro_ick = { |
1869 | .name = "mspro_ick", | 1868 | .name = "mspro_ick", |
1870 | .ops = &clkops_omap2_dflt_wait, | 1869 | .ops = &clkops_omap2_iclk_dflt_wait, |
1871 | .parent = &core_l4_ick, | 1870 | .parent = &core_l4_ick, |
1872 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1871 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1873 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, | 1872 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, |
@@ -1877,7 +1876,7 @@ static struct clk mspro_ick = { | |||
1877 | 1876 | ||
1878 | static struct clk hdq_ick = { | 1877 | static struct clk hdq_ick = { |
1879 | .name = "hdq_ick", | 1878 | .name = "hdq_ick", |
1880 | .ops = &clkops_omap2_dflt_wait, | 1879 | .ops = &clkops_omap2_iclk_dflt_wait, |
1881 | .parent = &core_l4_ick, | 1880 | .parent = &core_l4_ick, |
1882 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1881 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1883 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, | 1882 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, |
@@ -1887,7 +1886,7 @@ static struct clk hdq_ick = { | |||
1887 | 1886 | ||
1888 | static struct clk mcspi4_ick = { | 1887 | static struct clk mcspi4_ick = { |
1889 | .name = "mcspi4_ick", | 1888 | .name = "mcspi4_ick", |
1890 | .ops = &clkops_omap2_dflt_wait, | 1889 | .ops = &clkops_omap2_iclk_dflt_wait, |
1891 | .parent = &core_l4_ick, | 1890 | .parent = &core_l4_ick, |
1892 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1891 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1893 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, | 1892 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, |
@@ -1897,7 +1896,7 @@ static struct clk mcspi4_ick = { | |||
1897 | 1896 | ||
1898 | static struct clk mcspi3_ick = { | 1897 | static struct clk mcspi3_ick = { |
1899 | .name = "mcspi3_ick", | 1898 | .name = "mcspi3_ick", |
1900 | .ops = &clkops_omap2_dflt_wait, | 1899 | .ops = &clkops_omap2_iclk_dflt_wait, |
1901 | .parent = &core_l4_ick, | 1900 | .parent = &core_l4_ick, |
1902 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1901 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1903 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, | 1902 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, |
@@ -1907,7 +1906,7 @@ static struct clk mcspi3_ick = { | |||
1907 | 1906 | ||
1908 | static struct clk mcspi2_ick = { | 1907 | static struct clk mcspi2_ick = { |
1909 | .name = "mcspi2_ick", | 1908 | .name = "mcspi2_ick", |
1910 | .ops = &clkops_omap2_dflt_wait, | 1909 | .ops = &clkops_omap2_iclk_dflt_wait, |
1911 | .parent = &core_l4_ick, | 1910 | .parent = &core_l4_ick, |
1912 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1911 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1913 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, | 1912 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, |
@@ -1917,7 +1916,7 @@ static struct clk mcspi2_ick = { | |||
1917 | 1916 | ||
1918 | static struct clk mcspi1_ick = { | 1917 | static struct clk mcspi1_ick = { |
1919 | .name = "mcspi1_ick", | 1918 | .name = "mcspi1_ick", |
1920 | .ops = &clkops_omap2_dflt_wait, | 1919 | .ops = &clkops_omap2_iclk_dflt_wait, |
1921 | .parent = &core_l4_ick, | 1920 | .parent = &core_l4_ick, |
1922 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1921 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1923 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, | 1922 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, |
@@ -1927,7 +1926,7 @@ static struct clk mcspi1_ick = { | |||
1927 | 1926 | ||
1928 | static struct clk i2c3_ick = { | 1927 | static struct clk i2c3_ick = { |
1929 | .name = "i2c3_ick", | 1928 | .name = "i2c3_ick", |
1930 | .ops = &clkops_omap2_dflt_wait, | 1929 | .ops = &clkops_omap2_iclk_dflt_wait, |
1931 | .parent = &core_l4_ick, | 1930 | .parent = &core_l4_ick, |
1932 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1931 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1933 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, | 1932 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, |
@@ -1937,7 +1936,7 @@ static struct clk i2c3_ick = { | |||
1937 | 1936 | ||
1938 | static struct clk i2c2_ick = { | 1937 | static struct clk i2c2_ick = { |
1939 | .name = "i2c2_ick", | 1938 | .name = "i2c2_ick", |
1940 | .ops = &clkops_omap2_dflt_wait, | 1939 | .ops = &clkops_omap2_iclk_dflt_wait, |
1941 | .parent = &core_l4_ick, | 1940 | .parent = &core_l4_ick, |
1942 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1941 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1943 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, | 1942 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, |
@@ -1947,7 +1946,7 @@ static struct clk i2c2_ick = { | |||
1947 | 1946 | ||
1948 | static struct clk i2c1_ick = { | 1947 | static struct clk i2c1_ick = { |
1949 | .name = "i2c1_ick", | 1948 | .name = "i2c1_ick", |
1950 | .ops = &clkops_omap2_dflt_wait, | 1949 | .ops = &clkops_omap2_iclk_dflt_wait, |
1951 | .parent = &core_l4_ick, | 1950 | .parent = &core_l4_ick, |
1952 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1951 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1953 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, | 1952 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, |
@@ -1957,7 +1956,7 @@ static struct clk i2c1_ick = { | |||
1957 | 1956 | ||
1958 | static struct clk uart2_ick = { | 1957 | static struct clk uart2_ick = { |
1959 | .name = "uart2_ick", | 1958 | .name = "uart2_ick", |
1960 | .ops = &clkops_omap2_dflt_wait, | 1959 | .ops = &clkops_omap2_iclk_dflt_wait, |
1961 | .parent = &core_l4_ick, | 1960 | .parent = &core_l4_ick, |
1962 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1961 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1963 | .enable_bit = OMAP3430_EN_UART2_SHIFT, | 1962 | .enable_bit = OMAP3430_EN_UART2_SHIFT, |
@@ -1967,7 +1966,7 @@ static struct clk uart2_ick = { | |||
1967 | 1966 | ||
1968 | static struct clk uart1_ick = { | 1967 | static struct clk uart1_ick = { |
1969 | .name = "uart1_ick", | 1968 | .name = "uart1_ick", |
1970 | .ops = &clkops_omap2_dflt_wait, | 1969 | .ops = &clkops_omap2_iclk_dflt_wait, |
1971 | .parent = &core_l4_ick, | 1970 | .parent = &core_l4_ick, |
1972 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1971 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1973 | .enable_bit = OMAP3430_EN_UART1_SHIFT, | 1972 | .enable_bit = OMAP3430_EN_UART1_SHIFT, |
@@ -1977,7 +1976,7 @@ static struct clk uart1_ick = { | |||
1977 | 1976 | ||
1978 | static struct clk gpt11_ick = { | 1977 | static struct clk gpt11_ick = { |
1979 | .name = "gpt11_ick", | 1978 | .name = "gpt11_ick", |
1980 | .ops = &clkops_omap2_dflt_wait, | 1979 | .ops = &clkops_omap2_iclk_dflt_wait, |
1981 | .parent = &core_l4_ick, | 1980 | .parent = &core_l4_ick, |
1982 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1981 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1983 | .enable_bit = OMAP3430_EN_GPT11_SHIFT, | 1982 | .enable_bit = OMAP3430_EN_GPT11_SHIFT, |
@@ -1987,7 +1986,7 @@ static struct clk gpt11_ick = { | |||
1987 | 1986 | ||
1988 | static struct clk gpt10_ick = { | 1987 | static struct clk gpt10_ick = { |
1989 | .name = "gpt10_ick", | 1988 | .name = "gpt10_ick", |
1990 | .ops = &clkops_omap2_dflt_wait, | 1989 | .ops = &clkops_omap2_iclk_dflt_wait, |
1991 | .parent = &core_l4_ick, | 1990 | .parent = &core_l4_ick, |
1992 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1991 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1993 | .enable_bit = OMAP3430_EN_GPT10_SHIFT, | 1992 | .enable_bit = OMAP3430_EN_GPT10_SHIFT, |
@@ -1997,7 +1996,7 @@ static struct clk gpt10_ick = { | |||
1997 | 1996 | ||
1998 | static struct clk mcbsp5_ick = { | 1997 | static struct clk mcbsp5_ick = { |
1999 | .name = "mcbsp5_ick", | 1998 | .name = "mcbsp5_ick", |
2000 | .ops = &clkops_omap2_dflt_wait, | 1999 | .ops = &clkops_omap2_iclk_dflt_wait, |
2001 | .parent = &core_l4_ick, | 2000 | .parent = &core_l4_ick, |
2002 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2001 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2003 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, | 2002 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, |
@@ -2007,7 +2006,7 @@ static struct clk mcbsp5_ick = { | |||
2007 | 2006 | ||
2008 | static struct clk mcbsp1_ick = { | 2007 | static struct clk mcbsp1_ick = { |
2009 | .name = "mcbsp1_ick", | 2008 | .name = "mcbsp1_ick", |
2010 | .ops = &clkops_omap2_dflt_wait, | 2009 | .ops = &clkops_omap2_iclk_dflt_wait, |
2011 | .parent = &core_l4_ick, | 2010 | .parent = &core_l4_ick, |
2012 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2011 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2013 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, | 2012 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, |
@@ -2017,7 +2016,7 @@ static struct clk mcbsp1_ick = { | |||
2017 | 2016 | ||
2018 | static struct clk fac_ick = { | 2017 | static struct clk fac_ick = { |
2019 | .name = "fac_ick", | 2018 | .name = "fac_ick", |
2020 | .ops = &clkops_omap2_dflt_wait, | 2019 | .ops = &clkops_omap2_iclk_dflt_wait, |
2021 | .parent = &core_l4_ick, | 2020 | .parent = &core_l4_ick, |
2022 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2021 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2023 | .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, | 2022 | .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, |
@@ -2027,7 +2026,7 @@ static struct clk fac_ick = { | |||
2027 | 2026 | ||
2028 | static struct clk mailboxes_ick = { | 2027 | static struct clk mailboxes_ick = { |
2029 | .name = "mailboxes_ick", | 2028 | .name = "mailboxes_ick", |
2030 | .ops = &clkops_omap2_dflt_wait, | 2029 | .ops = &clkops_omap2_iclk_dflt_wait, |
2031 | .parent = &core_l4_ick, | 2030 | .parent = &core_l4_ick, |
2032 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2031 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2033 | .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, | 2032 | .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, |
@@ -2037,7 +2036,7 @@ static struct clk mailboxes_ick = { | |||
2037 | 2036 | ||
2038 | static struct clk omapctrl_ick = { | 2037 | static struct clk omapctrl_ick = { |
2039 | .name = "omapctrl_ick", | 2038 | .name = "omapctrl_ick", |
2040 | .ops = &clkops_omap2_dflt_wait, | 2039 | .ops = &clkops_omap2_iclk_dflt_wait, |
2041 | .parent = &core_l4_ick, | 2040 | .parent = &core_l4_ick, |
2042 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2041 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2043 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, | 2042 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, |
@@ -2057,7 +2056,7 @@ static struct clk ssi_l4_ick = { | |||
2057 | 2056 | ||
2058 | static struct clk ssi_ick_3430es1 = { | 2057 | static struct clk ssi_ick_3430es1 = { |
2059 | .name = "ssi_ick", | 2058 | .name = "ssi_ick", |
2060 | .ops = &clkops_omap2_dflt, | 2059 | .ops = &clkops_omap2_iclk_dflt, |
2061 | .parent = &ssi_l4_ick, | 2060 | .parent = &ssi_l4_ick, |
2062 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2061 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2063 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | 2062 | .enable_bit = OMAP3430_EN_SSI_SHIFT, |
@@ -2067,7 +2066,7 @@ static struct clk ssi_ick_3430es1 = { | |||
2067 | 2066 | ||
2068 | static struct clk ssi_ick_3430es2 = { | 2067 | static struct clk ssi_ick_3430es2 = { |
2069 | .name = "ssi_ick", | 2068 | .name = "ssi_ick", |
2070 | .ops = &clkops_omap3430es2_ssi_wait, | 2069 | .ops = &clkops_omap3430es2_iclk_ssi_wait, |
2071 | .parent = &ssi_l4_ick, | 2070 | .parent = &ssi_l4_ick, |
2072 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2071 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2073 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | 2072 | .enable_bit = OMAP3430_EN_SSI_SHIFT, |
@@ -2085,7 +2084,7 @@ static const struct clksel usb_l4_clksel[] = { | |||
2085 | 2084 | ||
2086 | static struct clk usb_l4_ick = { | 2085 | static struct clk usb_l4_ick = { |
2087 | .name = "usb_l4_ick", | 2086 | .name = "usb_l4_ick", |
2088 | .ops = &clkops_omap2_dflt_wait, | 2087 | .ops = &clkops_omap2_iclk_dflt_wait, |
2089 | .parent = &l4_ick, | 2088 | .parent = &l4_ick, |
2090 | .init = &omap2_init_clksel_parent, | 2089 | .init = &omap2_init_clksel_parent, |
2091 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2090 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -2107,7 +2106,7 @@ static struct clk security_l4_ick2 = { | |||
2107 | 2106 | ||
2108 | static struct clk aes1_ick = { | 2107 | static struct clk aes1_ick = { |
2109 | .name = "aes1_ick", | 2108 | .name = "aes1_ick", |
2110 | .ops = &clkops_omap2_dflt_wait, | 2109 | .ops = &clkops_omap2_iclk_dflt_wait, |
2111 | .parent = &security_l4_ick2, | 2110 | .parent = &security_l4_ick2, |
2112 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2111 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2113 | .enable_bit = OMAP3430_EN_AES1_SHIFT, | 2112 | .enable_bit = OMAP3430_EN_AES1_SHIFT, |
@@ -2116,7 +2115,7 @@ static struct clk aes1_ick = { | |||
2116 | 2115 | ||
2117 | static struct clk rng_ick = { | 2116 | static struct clk rng_ick = { |
2118 | .name = "rng_ick", | 2117 | .name = "rng_ick", |
2119 | .ops = &clkops_omap2_dflt_wait, | 2118 | .ops = &clkops_omap2_iclk_dflt_wait, |
2120 | .parent = &security_l4_ick2, | 2119 | .parent = &security_l4_ick2, |
2121 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2120 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2122 | .enable_bit = OMAP3430_EN_RNG_SHIFT, | 2121 | .enable_bit = OMAP3430_EN_RNG_SHIFT, |
@@ -2125,7 +2124,7 @@ static struct clk rng_ick = { | |||
2125 | 2124 | ||
2126 | static struct clk sha11_ick = { | 2125 | static struct clk sha11_ick = { |
2127 | .name = "sha11_ick", | 2126 | .name = "sha11_ick", |
2128 | .ops = &clkops_omap2_dflt_wait, | 2127 | .ops = &clkops_omap2_iclk_dflt_wait, |
2129 | .parent = &security_l4_ick2, | 2128 | .parent = &security_l4_ick2, |
2130 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2129 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2131 | .enable_bit = OMAP3430_EN_SHA11_SHIFT, | 2130 | .enable_bit = OMAP3430_EN_SHA11_SHIFT, |
@@ -2134,7 +2133,7 @@ static struct clk sha11_ick = { | |||
2134 | 2133 | ||
2135 | static struct clk des1_ick = { | 2134 | static struct clk des1_ick = { |
2136 | .name = "des1_ick", | 2135 | .name = "des1_ick", |
2137 | .ops = &clkops_omap2_dflt_wait, | 2136 | .ops = &clkops_omap2_iclk_dflt_wait, |
2138 | .parent = &security_l4_ick2, | 2137 | .parent = &security_l4_ick2, |
2139 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2138 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2140 | .enable_bit = OMAP3430_EN_DES1_SHIFT, | 2139 | .enable_bit = OMAP3430_EN_DES1_SHIFT, |
@@ -2195,7 +2194,7 @@ static struct clk dss2_alwon_fck = { | |||
2195 | static struct clk dss_ick_3430es1 = { | 2194 | static struct clk dss_ick_3430es1 = { |
2196 | /* Handles both L3 and L4 clocks */ | 2195 | /* Handles both L3 and L4 clocks */ |
2197 | .name = "dss_ick", | 2196 | .name = "dss_ick", |
2198 | .ops = &clkops_omap2_dflt, | 2197 | .ops = &clkops_omap2_iclk_dflt, |
2199 | .parent = &l4_ick, | 2198 | .parent = &l4_ick, |
2200 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), | 2199 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), |
2201 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, | 2200 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, |
@@ -2206,7 +2205,7 @@ static struct clk dss_ick_3430es1 = { | |||
2206 | static struct clk dss_ick_3430es2 = { | 2205 | static struct clk dss_ick_3430es2 = { |
2207 | /* Handles both L3 and L4 clocks */ | 2206 | /* Handles both L3 and L4 clocks */ |
2208 | .name = "dss_ick", | 2207 | .name = "dss_ick", |
2209 | .ops = &clkops_omap3430es2_dss_usbhost_wait, | 2208 | .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait, |
2210 | .parent = &l4_ick, | 2209 | .parent = &l4_ick, |
2211 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), | 2210 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), |
2212 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, | 2211 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, |
@@ -2229,7 +2228,7 @@ static struct clk cam_mclk = { | |||
2229 | static struct clk cam_ick = { | 2228 | static struct clk cam_ick = { |
2230 | /* Handles both L3 and L4 clocks */ | 2229 | /* Handles both L3 and L4 clocks */ |
2231 | .name = "cam_ick", | 2230 | .name = "cam_ick", |
2232 | .ops = &clkops_omap2_dflt, | 2231 | .ops = &clkops_omap2_iclk_dflt, |
2233 | .parent = &l4_ick, | 2232 | .parent = &l4_ick, |
2234 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), | 2233 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), |
2235 | .enable_bit = OMAP3430_EN_CAM_SHIFT, | 2234 | .enable_bit = OMAP3430_EN_CAM_SHIFT, |
@@ -2272,7 +2271,7 @@ static struct clk usbhost_48m_fck = { | |||
2272 | static struct clk usbhost_ick = { | 2271 | static struct clk usbhost_ick = { |
2273 | /* Handles both L3 and L4 clocks */ | 2272 | /* Handles both L3 and L4 clocks */ |
2274 | .name = "usbhost_ick", | 2273 | .name = "usbhost_ick", |
2275 | .ops = &clkops_omap3430es2_dss_usbhost_wait, | 2274 | .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait, |
2276 | .parent = &l4_ick, | 2275 | .parent = &l4_ick, |
2277 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), | 2276 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), |
2278 | .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, | 2277 | .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, |
@@ -2372,7 +2371,7 @@ static struct clk wkup_l4_ick = { | |||
2372 | /* Never specifically named in the TRM, so we have to infer a likely name */ | 2371 | /* Never specifically named in the TRM, so we have to infer a likely name */ |
2373 | static struct clk usim_ick = { | 2372 | static struct clk usim_ick = { |
2374 | .name = "usim_ick", | 2373 | .name = "usim_ick", |
2375 | .ops = &clkops_omap2_dflt_wait, | 2374 | .ops = &clkops_omap2_iclk_dflt_wait, |
2376 | .parent = &wkup_l4_ick, | 2375 | .parent = &wkup_l4_ick, |
2377 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2376 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2378 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, | 2377 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, |
@@ -2382,7 +2381,7 @@ static struct clk usim_ick = { | |||
2382 | 2381 | ||
2383 | static struct clk wdt2_ick = { | 2382 | static struct clk wdt2_ick = { |
2384 | .name = "wdt2_ick", | 2383 | .name = "wdt2_ick", |
2385 | .ops = &clkops_omap2_dflt_wait, | 2384 | .ops = &clkops_omap2_iclk_dflt_wait, |
2386 | .parent = &wkup_l4_ick, | 2385 | .parent = &wkup_l4_ick, |
2387 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2386 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2388 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, | 2387 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, |
@@ -2392,7 +2391,7 @@ static struct clk wdt2_ick = { | |||
2392 | 2391 | ||
2393 | static struct clk wdt1_ick = { | 2392 | static struct clk wdt1_ick = { |
2394 | .name = "wdt1_ick", | 2393 | .name = "wdt1_ick", |
2395 | .ops = &clkops_omap2_dflt_wait, | 2394 | .ops = &clkops_omap2_iclk_dflt_wait, |
2396 | .parent = &wkup_l4_ick, | 2395 | .parent = &wkup_l4_ick, |
2397 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2396 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2398 | .enable_bit = OMAP3430_EN_WDT1_SHIFT, | 2397 | .enable_bit = OMAP3430_EN_WDT1_SHIFT, |
@@ -2402,7 +2401,7 @@ static struct clk wdt1_ick = { | |||
2402 | 2401 | ||
2403 | static struct clk gpio1_ick = { | 2402 | static struct clk gpio1_ick = { |
2404 | .name = "gpio1_ick", | 2403 | .name = "gpio1_ick", |
2405 | .ops = &clkops_omap2_dflt_wait, | 2404 | .ops = &clkops_omap2_iclk_dflt_wait, |
2406 | .parent = &wkup_l4_ick, | 2405 | .parent = &wkup_l4_ick, |
2407 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2406 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2408 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, | 2407 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, |
@@ -2412,7 +2411,7 @@ static struct clk gpio1_ick = { | |||
2412 | 2411 | ||
2413 | static struct clk omap_32ksync_ick = { | 2412 | static struct clk omap_32ksync_ick = { |
2414 | .name = "omap_32ksync_ick", | 2413 | .name = "omap_32ksync_ick", |
2415 | .ops = &clkops_omap2_dflt_wait, | 2414 | .ops = &clkops_omap2_iclk_dflt_wait, |
2416 | .parent = &wkup_l4_ick, | 2415 | .parent = &wkup_l4_ick, |
2417 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2416 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2418 | .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, | 2417 | .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, |
@@ -2423,7 +2422,7 @@ static struct clk omap_32ksync_ick = { | |||
2423 | /* XXX This clock no longer exists in 3430 TRM rev F */ | 2422 | /* XXX This clock no longer exists in 3430 TRM rev F */ |
2424 | static struct clk gpt12_ick = { | 2423 | static struct clk gpt12_ick = { |
2425 | .name = "gpt12_ick", | 2424 | .name = "gpt12_ick", |
2426 | .ops = &clkops_omap2_dflt_wait, | 2425 | .ops = &clkops_omap2_iclk_dflt_wait, |
2427 | .parent = &wkup_l4_ick, | 2426 | .parent = &wkup_l4_ick, |
2428 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2427 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2429 | .enable_bit = OMAP3430_EN_GPT12_SHIFT, | 2428 | .enable_bit = OMAP3430_EN_GPT12_SHIFT, |
@@ -2433,7 +2432,7 @@ static struct clk gpt12_ick = { | |||
2433 | 2432 | ||
2434 | static struct clk gpt1_ick = { | 2433 | static struct clk gpt1_ick = { |
2435 | .name = "gpt1_ick", | 2434 | .name = "gpt1_ick", |
2436 | .ops = &clkops_omap2_dflt_wait, | 2435 | .ops = &clkops_omap2_iclk_dflt_wait, |
2437 | .parent = &wkup_l4_ick, | 2436 | .parent = &wkup_l4_ick, |
2438 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2437 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2439 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, | 2438 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, |
@@ -2663,7 +2662,7 @@ static struct clk per_l4_ick = { | |||
2663 | 2662 | ||
2664 | static struct clk gpio6_ick = { | 2663 | static struct clk gpio6_ick = { |
2665 | .name = "gpio6_ick", | 2664 | .name = "gpio6_ick", |
2666 | .ops = &clkops_omap2_dflt_wait, | 2665 | .ops = &clkops_omap2_iclk_dflt_wait, |
2667 | .parent = &per_l4_ick, | 2666 | .parent = &per_l4_ick, |
2668 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2667 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2669 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, | 2668 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, |
@@ -2673,7 +2672,7 @@ static struct clk gpio6_ick = { | |||
2673 | 2672 | ||
2674 | static struct clk gpio5_ick = { | 2673 | static struct clk gpio5_ick = { |
2675 | .name = "gpio5_ick", | 2674 | .name = "gpio5_ick", |
2676 | .ops = &clkops_omap2_dflt_wait, | 2675 | .ops = &clkops_omap2_iclk_dflt_wait, |
2677 | .parent = &per_l4_ick, | 2676 | .parent = &per_l4_ick, |
2678 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2677 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2679 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, | 2678 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, |
@@ -2683,7 +2682,7 @@ static struct clk gpio5_ick = { | |||
2683 | 2682 | ||
2684 | static struct clk gpio4_ick = { | 2683 | static struct clk gpio4_ick = { |
2685 | .name = "gpio4_ick", | 2684 | .name = "gpio4_ick", |
2686 | .ops = &clkops_omap2_dflt_wait, | 2685 | .ops = &clkops_omap2_iclk_dflt_wait, |
2687 | .parent = &per_l4_ick, | 2686 | .parent = &per_l4_ick, |
2688 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2687 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2689 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, | 2688 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, |
@@ -2693,7 +2692,7 @@ static struct clk gpio4_ick = { | |||
2693 | 2692 | ||
2694 | static struct clk gpio3_ick = { | 2693 | static struct clk gpio3_ick = { |
2695 | .name = "gpio3_ick", | 2694 | .name = "gpio3_ick", |
2696 | .ops = &clkops_omap2_dflt_wait, | 2695 | .ops = &clkops_omap2_iclk_dflt_wait, |
2697 | .parent = &per_l4_ick, | 2696 | .parent = &per_l4_ick, |
2698 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2697 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2699 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, | 2698 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, |
@@ -2703,7 +2702,7 @@ static struct clk gpio3_ick = { | |||
2703 | 2702 | ||
2704 | static struct clk gpio2_ick = { | 2703 | static struct clk gpio2_ick = { |
2705 | .name = "gpio2_ick", | 2704 | .name = "gpio2_ick", |
2706 | .ops = &clkops_omap2_dflt_wait, | 2705 | .ops = &clkops_omap2_iclk_dflt_wait, |
2707 | .parent = &per_l4_ick, | 2706 | .parent = &per_l4_ick, |
2708 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2707 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2709 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, | 2708 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, |
@@ -2713,7 +2712,7 @@ static struct clk gpio2_ick = { | |||
2713 | 2712 | ||
2714 | static struct clk wdt3_ick = { | 2713 | static struct clk wdt3_ick = { |
2715 | .name = "wdt3_ick", | 2714 | .name = "wdt3_ick", |
2716 | .ops = &clkops_omap2_dflt_wait, | 2715 | .ops = &clkops_omap2_iclk_dflt_wait, |
2717 | .parent = &per_l4_ick, | 2716 | .parent = &per_l4_ick, |
2718 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2717 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2719 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, | 2718 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, |
@@ -2723,7 +2722,7 @@ static struct clk wdt3_ick = { | |||
2723 | 2722 | ||
2724 | static struct clk uart3_ick = { | 2723 | static struct clk uart3_ick = { |
2725 | .name = "uart3_ick", | 2724 | .name = "uart3_ick", |
2726 | .ops = &clkops_omap2_dflt_wait, | 2725 | .ops = &clkops_omap2_iclk_dflt_wait, |
2727 | .parent = &per_l4_ick, | 2726 | .parent = &per_l4_ick, |
2728 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2727 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2729 | .enable_bit = OMAP3430_EN_UART3_SHIFT, | 2728 | .enable_bit = OMAP3430_EN_UART3_SHIFT, |
@@ -2733,7 +2732,7 @@ static struct clk uart3_ick = { | |||
2733 | 2732 | ||
2734 | static struct clk uart4_ick = { | 2733 | static struct clk uart4_ick = { |
2735 | .name = "uart4_ick", | 2734 | .name = "uart4_ick", |
2736 | .ops = &clkops_omap2_dflt_wait, | 2735 | .ops = &clkops_omap2_iclk_dflt_wait, |
2737 | .parent = &per_l4_ick, | 2736 | .parent = &per_l4_ick, |
2738 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2737 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2739 | .enable_bit = OMAP3630_EN_UART4_SHIFT, | 2738 | .enable_bit = OMAP3630_EN_UART4_SHIFT, |
@@ -2743,7 +2742,7 @@ static struct clk uart4_ick = { | |||
2743 | 2742 | ||
2744 | static struct clk gpt9_ick = { | 2743 | static struct clk gpt9_ick = { |
2745 | .name = "gpt9_ick", | 2744 | .name = "gpt9_ick", |
2746 | .ops = &clkops_omap2_dflt_wait, | 2745 | .ops = &clkops_omap2_iclk_dflt_wait, |
2747 | .parent = &per_l4_ick, | 2746 | .parent = &per_l4_ick, |
2748 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2747 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2749 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, | 2748 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, |
@@ -2753,7 +2752,7 @@ static struct clk gpt9_ick = { | |||
2753 | 2752 | ||
2754 | static struct clk gpt8_ick = { | 2753 | static struct clk gpt8_ick = { |
2755 | .name = "gpt8_ick", | 2754 | .name = "gpt8_ick", |
2756 | .ops = &clkops_omap2_dflt_wait, | 2755 | .ops = &clkops_omap2_iclk_dflt_wait, |
2757 | .parent = &per_l4_ick, | 2756 | .parent = &per_l4_ick, |
2758 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2757 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2759 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, | 2758 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, |
@@ -2763,7 +2762,7 @@ static struct clk gpt8_ick = { | |||
2763 | 2762 | ||
2764 | static struct clk gpt7_ick = { | 2763 | static struct clk gpt7_ick = { |
2765 | .name = "gpt7_ick", | 2764 | .name = "gpt7_ick", |
2766 | .ops = &clkops_omap2_dflt_wait, | 2765 | .ops = &clkops_omap2_iclk_dflt_wait, |
2767 | .parent = &per_l4_ick, | 2766 | .parent = &per_l4_ick, |
2768 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2767 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2769 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, | 2768 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, |
@@ -2773,7 +2772,7 @@ static struct clk gpt7_ick = { | |||
2773 | 2772 | ||
2774 | static struct clk gpt6_ick = { | 2773 | static struct clk gpt6_ick = { |
2775 | .name = "gpt6_ick", | 2774 | .name = "gpt6_ick", |
2776 | .ops = &clkops_omap2_dflt_wait, | 2775 | .ops = &clkops_omap2_iclk_dflt_wait, |
2777 | .parent = &per_l4_ick, | 2776 | .parent = &per_l4_ick, |
2778 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2777 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2779 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, | 2778 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, |
@@ -2783,7 +2782,7 @@ static struct clk gpt6_ick = { | |||
2783 | 2782 | ||
2784 | static struct clk gpt5_ick = { | 2783 | static struct clk gpt5_ick = { |
2785 | .name = "gpt5_ick", | 2784 | .name = "gpt5_ick", |
2786 | .ops = &clkops_omap2_dflt_wait, | 2785 | .ops = &clkops_omap2_iclk_dflt_wait, |
2787 | .parent = &per_l4_ick, | 2786 | .parent = &per_l4_ick, |
2788 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2787 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2789 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, | 2788 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, |
@@ -2793,7 +2792,7 @@ static struct clk gpt5_ick = { | |||
2793 | 2792 | ||
2794 | static struct clk gpt4_ick = { | 2793 | static struct clk gpt4_ick = { |
2795 | .name = "gpt4_ick", | 2794 | .name = "gpt4_ick", |
2796 | .ops = &clkops_omap2_dflt_wait, | 2795 | .ops = &clkops_omap2_iclk_dflt_wait, |
2797 | .parent = &per_l4_ick, | 2796 | .parent = &per_l4_ick, |
2798 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2797 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2799 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, | 2798 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, |
@@ -2803,7 +2802,7 @@ static struct clk gpt4_ick = { | |||
2803 | 2802 | ||
2804 | static struct clk gpt3_ick = { | 2803 | static struct clk gpt3_ick = { |
2805 | .name = "gpt3_ick", | 2804 | .name = "gpt3_ick", |
2806 | .ops = &clkops_omap2_dflt_wait, | 2805 | .ops = &clkops_omap2_iclk_dflt_wait, |
2807 | .parent = &per_l4_ick, | 2806 | .parent = &per_l4_ick, |
2808 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2807 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2809 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, | 2808 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, |
@@ -2813,7 +2812,7 @@ static struct clk gpt3_ick = { | |||
2813 | 2812 | ||
2814 | static struct clk gpt2_ick = { | 2813 | static struct clk gpt2_ick = { |
2815 | .name = "gpt2_ick", | 2814 | .name = "gpt2_ick", |
2816 | .ops = &clkops_omap2_dflt_wait, | 2815 | .ops = &clkops_omap2_iclk_dflt_wait, |
2817 | .parent = &per_l4_ick, | 2816 | .parent = &per_l4_ick, |
2818 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2817 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2819 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, | 2818 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, |
@@ -2823,7 +2822,7 @@ static struct clk gpt2_ick = { | |||
2823 | 2822 | ||
2824 | static struct clk mcbsp2_ick = { | 2823 | static struct clk mcbsp2_ick = { |
2825 | .name = "mcbsp2_ick", | 2824 | .name = "mcbsp2_ick", |
2826 | .ops = &clkops_omap2_dflt_wait, | 2825 | .ops = &clkops_omap2_iclk_dflt_wait, |
2827 | .parent = &per_l4_ick, | 2826 | .parent = &per_l4_ick, |
2828 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2827 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2829 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, | 2828 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, |
@@ -2833,7 +2832,7 @@ static struct clk mcbsp2_ick = { | |||
2833 | 2832 | ||
2834 | static struct clk mcbsp3_ick = { | 2833 | static struct clk mcbsp3_ick = { |
2835 | .name = "mcbsp3_ick", | 2834 | .name = "mcbsp3_ick", |
2836 | .ops = &clkops_omap2_dflt_wait, | 2835 | .ops = &clkops_omap2_iclk_dflt_wait, |
2837 | .parent = &per_l4_ick, | 2836 | .parent = &per_l4_ick, |
2838 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2837 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2839 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, | 2838 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, |
@@ -2843,7 +2842,7 @@ static struct clk mcbsp3_ick = { | |||
2843 | 2842 | ||
2844 | static struct clk mcbsp4_ick = { | 2843 | static struct clk mcbsp4_ick = { |
2845 | .name = "mcbsp4_ick", | 2844 | .name = "mcbsp4_ick", |
2846 | .ops = &clkops_omap2_dflt_wait, | 2845 | .ops = &clkops_omap2_iclk_dflt_wait, |
2847 | .parent = &per_l4_ick, | 2846 | .parent = &per_l4_ick, |
2848 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2847 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2849 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, | 2848 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, |
@@ -3186,7 +3185,7 @@ static struct clk vpfe_fck = { | |||
3186 | */ | 3185 | */ |
3187 | static struct clk uart4_ick_am35xx = { | 3186 | static struct clk uart4_ick_am35xx = { |
3188 | .name = "uart4_ick", | 3187 | .name = "uart4_ick", |
3189 | .ops = &clkops_omap2_dflt_wait, | 3188 | .ops = &clkops_omap2_iclk_dflt_wait, |
3190 | .parent = &core_l4_ick, | 3189 | .parent = &core_l4_ick, |
3191 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 3190 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
3192 | .enable_bit = AM35XX_EN_UART4_SHIFT, | 3191 | .enable_bit = AM35XX_EN_UART4_SHIFT, |
@@ -3290,10 +3289,10 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3290 | CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), | 3289 | CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), |
3291 | CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), | 3290 | CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), |
3292 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), | 3291 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), |
3293 | CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3292 | CLK("omap_hsmmc.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
3294 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), | 3293 | CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_3XXX), |
3295 | CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), | 3294 | CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), |
3296 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), | 3295 | CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_3XXX), |
3297 | CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), | 3296 | CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), |
3298 | CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), | 3297 | CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), |
3299 | CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), | 3298 | CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), |
@@ -3323,13 +3322,13 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3323 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), | 3322 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), |
3324 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3323 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
3325 | CLK("usbhs-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3324 | CLK("usbhs-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
3326 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3325 | CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
3327 | CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), | 3326 | CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), |
3328 | CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), | 3327 | CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), |
3329 | CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), | 3328 | CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), |
3330 | CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), | 3329 | CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), |
3331 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), | 3330 | CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX), |
3332 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), | 3331 | CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX), |
3333 | CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), | 3332 | CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), |
3334 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), | 3333 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), |
3335 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), | 3334 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), |
@@ -3480,6 +3479,9 @@ int __init omap3xxx_clk_init(void) | |||
3480 | } else if (cpu_is_omap3630()) { | 3479 | } else if (cpu_is_omap3630()) { |
3481 | cpu_mask = (RATE_IN_34XX | RATE_IN_36XX); | 3480 | cpu_mask = (RATE_IN_34XX | RATE_IN_36XX); |
3482 | cpu_clkflg = CK_36XX; | 3481 | cpu_clkflg = CK_36XX; |
3482 | } else if (cpu_is_ti816x()) { | ||
3483 | cpu_mask = RATE_IN_TI816X; | ||
3484 | cpu_clkflg = CK_TI816X; | ||
3483 | } else if (cpu_is_omap34xx()) { | 3485 | } else if (cpu_is_omap34xx()) { |
3484 | if (omap_rev() == OMAP3430_REV_ES1_0) { | 3486 | if (omap_rev() == OMAP3430_REV_ES1_0) { |
3485 | cpu_mask = RATE_IN_3430ES1; | 3487 | cpu_mask = RATE_IN_3430ES1; |
@@ -3544,6 +3546,9 @@ int __init omap3xxx_clk_init(void) | |||
3544 | omap2_init_clk_clkdm(c->lk.clk); | 3546 | omap2_init_clk_clkdm(c->lk.clk); |
3545 | } | 3547 | } |
3546 | 3548 | ||
3549 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
3550 | omap_clk_disable_autoidle_all(); | ||
3551 | |||
3547 | recalculate_root_clocks(); | 3552 | recalculate_root_clocks(); |
3548 | 3553 | ||
3549 | pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", | 3554 | pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", |
@@ -3557,9 +3562,10 @@ int __init omap3xxx_clk_init(void) | |||
3557 | clk_enable_init_clocks(); | 3562 | clk_enable_init_clocks(); |
3558 | 3563 | ||
3559 | /* | 3564 | /* |
3560 | * Lock DPLL5 and put it in autoidle. | 3565 | * Lock DPLL5 -- here only until other device init code can |
3566 | * handle this | ||
3561 | */ | 3567 | */ |
3562 | if (omap_rev() >= OMAP3430_REV_ES2_0) | 3568 | if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0)) |
3563 | omap3_clk_lock_dpll5(); | 3569 | omap3_clk_lock_dpll5(); |
3564 | 3570 | ||
3565 | /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */ | 3571 | /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */ |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 46fd3f674cac..d32ed979a8da 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -278,8 +278,10 @@ static struct clk dpll_abe_ck = { | |||
278 | static struct clk dpll_abe_x2_ck = { | 278 | static struct clk dpll_abe_x2_ck = { |
279 | .name = "dpll_abe_x2_ck", | 279 | .name = "dpll_abe_x2_ck", |
280 | .parent = &dpll_abe_ck, | 280 | .parent = &dpll_abe_ck, |
281 | .ops = &clkops_null, | 281 | .flags = CLOCK_CLKOUTX2, |
282 | .ops = &clkops_omap4_dpllmx_ops, | ||
282 | .recalc = &omap3_clkoutx2_recalc, | 283 | .recalc = &omap3_clkoutx2_recalc, |
284 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, | ||
283 | }; | 285 | }; |
284 | 286 | ||
285 | static const struct clksel_rate div31_1to31_rates[] = { | 287 | static const struct clksel_rate div31_1to31_rates[] = { |
@@ -328,7 +330,7 @@ static struct clk dpll_abe_m2x2_ck = { | |||
328 | .clksel = dpll_abe_m2x2_div, | 330 | .clksel = dpll_abe_m2x2_div, |
329 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, | 331 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, |
330 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 332 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
331 | .ops = &clkops_null, | 333 | .ops = &clkops_omap4_dpllmx_ops, |
332 | .recalc = &omap2_clksel_recalc, | 334 | .recalc = &omap2_clksel_recalc, |
333 | .round_rate = &omap2_clksel_round_rate, | 335 | .round_rate = &omap2_clksel_round_rate, |
334 | .set_rate = &omap2_clksel_set_rate, | 336 | .set_rate = &omap2_clksel_set_rate, |
@@ -395,7 +397,7 @@ static struct clk dpll_abe_m3x2_ck = { | |||
395 | .clksel = dpll_abe_m2x2_div, | 397 | .clksel = dpll_abe_m2x2_div, |
396 | .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, | 398 | .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, |
397 | .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, | 399 | .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, |
398 | .ops = &clkops_null, | 400 | .ops = &clkops_omap4_dpllmx_ops, |
399 | .recalc = &omap2_clksel_recalc, | 401 | .recalc = &omap2_clksel_recalc, |
400 | .round_rate = &omap2_clksel_round_rate, | 402 | .round_rate = &omap2_clksel_round_rate, |
401 | .set_rate = &omap2_clksel_set_rate, | 403 | .set_rate = &omap2_clksel_set_rate, |
@@ -443,13 +445,14 @@ static struct clk dpll_core_ck = { | |||
443 | .parent = &sys_clkin_ck, | 445 | .parent = &sys_clkin_ck, |
444 | .dpll_data = &dpll_core_dd, | 446 | .dpll_data = &dpll_core_dd, |
445 | .init = &omap2_init_dpll_parent, | 447 | .init = &omap2_init_dpll_parent, |
446 | .ops = &clkops_null, | 448 | .ops = &clkops_omap3_core_dpll_ops, |
447 | .recalc = &omap3_dpll_recalc, | 449 | .recalc = &omap3_dpll_recalc, |
448 | }; | 450 | }; |
449 | 451 | ||
450 | static struct clk dpll_core_x2_ck = { | 452 | static struct clk dpll_core_x2_ck = { |
451 | .name = "dpll_core_x2_ck", | 453 | .name = "dpll_core_x2_ck", |
452 | .parent = &dpll_core_ck, | 454 | .parent = &dpll_core_ck, |
455 | .flags = CLOCK_CLKOUTX2, | ||
453 | .ops = &clkops_null, | 456 | .ops = &clkops_null, |
454 | .recalc = &omap3_clkoutx2_recalc, | 457 | .recalc = &omap3_clkoutx2_recalc, |
455 | }; | 458 | }; |
@@ -465,7 +468,7 @@ static struct clk dpll_core_m6x2_ck = { | |||
465 | .clksel = dpll_core_m6x2_div, | 468 | .clksel = dpll_core_m6x2_div, |
466 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, | 469 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, |
467 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, | 470 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, |
468 | .ops = &clkops_null, | 471 | .ops = &clkops_omap4_dpllmx_ops, |
469 | .recalc = &omap2_clksel_recalc, | 472 | .recalc = &omap2_clksel_recalc, |
470 | .round_rate = &omap2_clksel_round_rate, | 473 | .round_rate = &omap2_clksel_round_rate, |
471 | .set_rate = &omap2_clksel_set_rate, | 474 | .set_rate = &omap2_clksel_set_rate, |
@@ -495,7 +498,7 @@ static struct clk dpll_core_m2_ck = { | |||
495 | .clksel = dpll_core_m2_div, | 498 | .clksel = dpll_core_m2_div, |
496 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, | 499 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, |
497 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 500 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
498 | .ops = &clkops_null, | 501 | .ops = &clkops_omap4_dpllmx_ops, |
499 | .recalc = &omap2_clksel_recalc, | 502 | .recalc = &omap2_clksel_recalc, |
500 | .round_rate = &omap2_clksel_round_rate, | 503 | .round_rate = &omap2_clksel_round_rate, |
501 | .set_rate = &omap2_clksel_set_rate, | 504 | .set_rate = &omap2_clksel_set_rate, |
@@ -515,7 +518,7 @@ static struct clk dpll_core_m5x2_ck = { | |||
515 | .clksel = dpll_core_m6x2_div, | 518 | .clksel = dpll_core_m6x2_div, |
516 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, | 519 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, |
517 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, | 520 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, |
518 | .ops = &clkops_null, | 521 | .ops = &clkops_omap4_dpllmx_ops, |
519 | .recalc = &omap2_clksel_recalc, | 522 | .recalc = &omap2_clksel_recalc, |
520 | .round_rate = &omap2_clksel_round_rate, | 523 | .round_rate = &omap2_clksel_round_rate, |
521 | .set_rate = &omap2_clksel_set_rate, | 524 | .set_rate = &omap2_clksel_set_rate, |
@@ -581,7 +584,7 @@ static struct clk dpll_core_m4x2_ck = { | |||
581 | .clksel = dpll_core_m6x2_div, | 584 | .clksel = dpll_core_m6x2_div, |
582 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, | 585 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, |
583 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, | 586 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, |
584 | .ops = &clkops_null, | 587 | .ops = &clkops_omap4_dpllmx_ops, |
585 | .recalc = &omap2_clksel_recalc, | 588 | .recalc = &omap2_clksel_recalc, |
586 | .round_rate = &omap2_clksel_round_rate, | 589 | .round_rate = &omap2_clksel_round_rate, |
587 | .set_rate = &omap2_clksel_set_rate, | 590 | .set_rate = &omap2_clksel_set_rate, |
@@ -606,7 +609,7 @@ static struct clk dpll_abe_m2_ck = { | |||
606 | .clksel = dpll_abe_m2_div, | 609 | .clksel = dpll_abe_m2_div, |
607 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, | 610 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, |
608 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 611 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
609 | .ops = &clkops_null, | 612 | .ops = &clkops_omap4_dpllmx_ops, |
610 | .recalc = &omap2_clksel_recalc, | 613 | .recalc = &omap2_clksel_recalc, |
611 | .round_rate = &omap2_clksel_round_rate, | 614 | .round_rate = &omap2_clksel_round_rate, |
612 | .set_rate = &omap2_clksel_set_rate, | 615 | .set_rate = &omap2_clksel_set_rate, |
@@ -632,7 +635,7 @@ static struct clk dpll_core_m7x2_ck = { | |||
632 | .clksel = dpll_core_m6x2_div, | 635 | .clksel = dpll_core_m6x2_div, |
633 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, | 636 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, |
634 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, | 637 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, |
635 | .ops = &clkops_null, | 638 | .ops = &clkops_omap4_dpllmx_ops, |
636 | .recalc = &omap2_clksel_recalc, | 639 | .recalc = &omap2_clksel_recalc, |
637 | .round_rate = &omap2_clksel_round_rate, | 640 | .round_rate = &omap2_clksel_round_rate, |
638 | .set_rate = &omap2_clksel_set_rate, | 641 | .set_rate = &omap2_clksel_set_rate, |
@@ -689,6 +692,7 @@ static struct clk dpll_iva_ck = { | |||
689 | static struct clk dpll_iva_x2_ck = { | 692 | static struct clk dpll_iva_x2_ck = { |
690 | .name = "dpll_iva_x2_ck", | 693 | .name = "dpll_iva_x2_ck", |
691 | .parent = &dpll_iva_ck, | 694 | .parent = &dpll_iva_ck, |
695 | .flags = CLOCK_CLKOUTX2, | ||
692 | .ops = &clkops_null, | 696 | .ops = &clkops_null, |
693 | .recalc = &omap3_clkoutx2_recalc, | 697 | .recalc = &omap3_clkoutx2_recalc, |
694 | }; | 698 | }; |
@@ -704,7 +708,7 @@ static struct clk dpll_iva_m4x2_ck = { | |||
704 | .clksel = dpll_iva_m4x2_div, | 708 | .clksel = dpll_iva_m4x2_div, |
705 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, | 709 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, |
706 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, | 710 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, |
707 | .ops = &clkops_null, | 711 | .ops = &clkops_omap4_dpllmx_ops, |
708 | .recalc = &omap2_clksel_recalc, | 712 | .recalc = &omap2_clksel_recalc, |
709 | .round_rate = &omap2_clksel_round_rate, | 713 | .round_rate = &omap2_clksel_round_rate, |
710 | .set_rate = &omap2_clksel_set_rate, | 714 | .set_rate = &omap2_clksel_set_rate, |
@@ -716,7 +720,7 @@ static struct clk dpll_iva_m5x2_ck = { | |||
716 | .clksel = dpll_iva_m4x2_div, | 720 | .clksel = dpll_iva_m4x2_div, |
717 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, | 721 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, |
718 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, | 722 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, |
719 | .ops = &clkops_null, | 723 | .ops = &clkops_omap4_dpllmx_ops, |
720 | .recalc = &omap2_clksel_recalc, | 724 | .recalc = &omap2_clksel_recalc, |
721 | .round_rate = &omap2_clksel_round_rate, | 725 | .round_rate = &omap2_clksel_round_rate, |
722 | .set_rate = &omap2_clksel_set_rate, | 726 | .set_rate = &omap2_clksel_set_rate, |
@@ -764,7 +768,7 @@ static struct clk dpll_mpu_m2_ck = { | |||
764 | .clksel = dpll_mpu_m2_div, | 768 | .clksel = dpll_mpu_m2_div, |
765 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU, | 769 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU, |
766 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 770 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
767 | .ops = &clkops_null, | 771 | .ops = &clkops_omap4_dpllmx_ops, |
768 | .recalc = &omap2_clksel_recalc, | 772 | .recalc = &omap2_clksel_recalc, |
769 | .round_rate = &omap2_clksel_round_rate, | 773 | .round_rate = &omap2_clksel_round_rate, |
770 | .set_rate = &omap2_clksel_set_rate, | 774 | .set_rate = &omap2_clksel_set_rate, |
@@ -837,7 +841,7 @@ static struct clk dpll_per_m2_ck = { | |||
837 | .clksel = dpll_per_m2_div, | 841 | .clksel = dpll_per_m2_div, |
838 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, | 842 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, |
839 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 843 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
840 | .ops = &clkops_null, | 844 | .ops = &clkops_omap4_dpllmx_ops, |
841 | .recalc = &omap2_clksel_recalc, | 845 | .recalc = &omap2_clksel_recalc, |
842 | .round_rate = &omap2_clksel_round_rate, | 846 | .round_rate = &omap2_clksel_round_rate, |
843 | .set_rate = &omap2_clksel_set_rate, | 847 | .set_rate = &omap2_clksel_set_rate, |
@@ -846,8 +850,10 @@ static struct clk dpll_per_m2_ck = { | |||
846 | static struct clk dpll_per_x2_ck = { | 850 | static struct clk dpll_per_x2_ck = { |
847 | .name = "dpll_per_x2_ck", | 851 | .name = "dpll_per_x2_ck", |
848 | .parent = &dpll_per_ck, | 852 | .parent = &dpll_per_ck, |
849 | .ops = &clkops_null, | 853 | .flags = CLOCK_CLKOUTX2, |
854 | .ops = &clkops_omap4_dpllmx_ops, | ||
850 | .recalc = &omap3_clkoutx2_recalc, | 855 | .recalc = &omap3_clkoutx2_recalc, |
856 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, | ||
851 | }; | 857 | }; |
852 | 858 | ||
853 | static const struct clksel dpll_per_m2x2_div[] = { | 859 | static const struct clksel dpll_per_m2x2_div[] = { |
@@ -861,7 +867,7 @@ static struct clk dpll_per_m2x2_ck = { | |||
861 | .clksel = dpll_per_m2x2_div, | 867 | .clksel = dpll_per_m2x2_div, |
862 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, | 868 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, |
863 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 869 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
864 | .ops = &clkops_null, | 870 | .ops = &clkops_omap4_dpllmx_ops, |
865 | .recalc = &omap2_clksel_recalc, | 871 | .recalc = &omap2_clksel_recalc, |
866 | .round_rate = &omap2_clksel_round_rate, | 872 | .round_rate = &omap2_clksel_round_rate, |
867 | .set_rate = &omap2_clksel_set_rate, | 873 | .set_rate = &omap2_clksel_set_rate, |
@@ -887,7 +893,7 @@ static struct clk dpll_per_m4x2_ck = { | |||
887 | .clksel = dpll_per_m2x2_div, | 893 | .clksel = dpll_per_m2x2_div, |
888 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, | 894 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, |
889 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, | 895 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, |
890 | .ops = &clkops_null, | 896 | .ops = &clkops_omap4_dpllmx_ops, |
891 | .recalc = &omap2_clksel_recalc, | 897 | .recalc = &omap2_clksel_recalc, |
892 | .round_rate = &omap2_clksel_round_rate, | 898 | .round_rate = &omap2_clksel_round_rate, |
893 | .set_rate = &omap2_clksel_set_rate, | 899 | .set_rate = &omap2_clksel_set_rate, |
@@ -899,7 +905,7 @@ static struct clk dpll_per_m5x2_ck = { | |||
899 | .clksel = dpll_per_m2x2_div, | 905 | .clksel = dpll_per_m2x2_div, |
900 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, | 906 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, |
901 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, | 907 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, |
902 | .ops = &clkops_null, | 908 | .ops = &clkops_omap4_dpllmx_ops, |
903 | .recalc = &omap2_clksel_recalc, | 909 | .recalc = &omap2_clksel_recalc, |
904 | .round_rate = &omap2_clksel_round_rate, | 910 | .round_rate = &omap2_clksel_round_rate, |
905 | .set_rate = &omap2_clksel_set_rate, | 911 | .set_rate = &omap2_clksel_set_rate, |
@@ -911,7 +917,7 @@ static struct clk dpll_per_m6x2_ck = { | |||
911 | .clksel = dpll_per_m2x2_div, | 917 | .clksel = dpll_per_m2x2_div, |
912 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, | 918 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, |
913 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, | 919 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, |
914 | .ops = &clkops_null, | 920 | .ops = &clkops_omap4_dpllmx_ops, |
915 | .recalc = &omap2_clksel_recalc, | 921 | .recalc = &omap2_clksel_recalc, |
916 | .round_rate = &omap2_clksel_round_rate, | 922 | .round_rate = &omap2_clksel_round_rate, |
917 | .set_rate = &omap2_clksel_set_rate, | 923 | .set_rate = &omap2_clksel_set_rate, |
@@ -923,7 +929,7 @@ static struct clk dpll_per_m7x2_ck = { | |||
923 | .clksel = dpll_per_m2x2_div, | 929 | .clksel = dpll_per_m2x2_div, |
924 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, | 930 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, |
925 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, | 931 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, |
926 | .ops = &clkops_null, | 932 | .ops = &clkops_omap4_dpllmx_ops, |
927 | .recalc = &omap2_clksel_recalc, | 933 | .recalc = &omap2_clksel_recalc, |
928 | .round_rate = &omap2_clksel_round_rate, | 934 | .round_rate = &omap2_clksel_round_rate, |
929 | .set_rate = &omap2_clksel_set_rate, | 935 | .set_rate = &omap2_clksel_set_rate, |
@@ -964,6 +970,7 @@ static struct clk dpll_unipro_ck = { | |||
964 | static struct clk dpll_unipro_x2_ck = { | 970 | static struct clk dpll_unipro_x2_ck = { |
965 | .name = "dpll_unipro_x2_ck", | 971 | .name = "dpll_unipro_x2_ck", |
966 | .parent = &dpll_unipro_ck, | 972 | .parent = &dpll_unipro_ck, |
973 | .flags = CLOCK_CLKOUTX2, | ||
967 | .ops = &clkops_null, | 974 | .ops = &clkops_null, |
968 | .recalc = &omap3_clkoutx2_recalc, | 975 | .recalc = &omap3_clkoutx2_recalc, |
969 | }; | 976 | }; |
@@ -979,7 +986,7 @@ static struct clk dpll_unipro_m2x2_ck = { | |||
979 | .clksel = dpll_unipro_m2x2_div, | 986 | .clksel = dpll_unipro_m2x2_div, |
980 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, | 987 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, |
981 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 988 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
982 | .ops = &clkops_null, | 989 | .ops = &clkops_omap4_dpllmx_ops, |
983 | .recalc = &omap2_clksel_recalc, | 990 | .recalc = &omap2_clksel_recalc, |
984 | .round_rate = &omap2_clksel_round_rate, | 991 | .round_rate = &omap2_clksel_round_rate, |
985 | .set_rate = &omap2_clksel_set_rate, | 992 | .set_rate = &omap2_clksel_set_rate, |
@@ -1028,7 +1035,8 @@ static struct clk dpll_usb_ck = { | |||
1028 | static struct clk dpll_usb_clkdcoldo_ck = { | 1035 | static struct clk dpll_usb_clkdcoldo_ck = { |
1029 | .name = "dpll_usb_clkdcoldo_ck", | 1036 | .name = "dpll_usb_clkdcoldo_ck", |
1030 | .parent = &dpll_usb_ck, | 1037 | .parent = &dpll_usb_ck, |
1031 | .ops = &clkops_null, | 1038 | .ops = &clkops_omap4_dpllmx_ops, |
1039 | .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB, | ||
1032 | .recalc = &followparent_recalc, | 1040 | .recalc = &followparent_recalc, |
1033 | }; | 1041 | }; |
1034 | 1042 | ||
@@ -1043,7 +1051,7 @@ static struct clk dpll_usb_m2_ck = { | |||
1043 | .clksel = dpll_usb_m2_div, | 1051 | .clksel = dpll_usb_m2_div, |
1044 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB, | 1052 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB, |
1045 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK, | 1053 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK, |
1046 | .ops = &clkops_null, | 1054 | .ops = &clkops_omap4_dpllmx_ops, |
1047 | .recalc = &omap2_clksel_recalc, | 1055 | .recalc = &omap2_clksel_recalc, |
1048 | .round_rate = &omap2_clksel_round_rate, | 1056 | .round_rate = &omap2_clksel_round_rate, |
1049 | .set_rate = &omap2_clksel_set_rate, | 1057 | .set_rate = &omap2_clksel_set_rate, |
@@ -3158,11 +3166,11 @@ static struct omap_clk omap44xx_clks[] = { | |||
3158 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), | 3166 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), |
3159 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), | 3167 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), |
3160 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), | 3168 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), |
3161 | CLK("mmci-omap-hs.0", "fck", &mmc1_fck, CK_443X), | 3169 | CLK("omap_hsmmc.0", "fck", &mmc1_fck, CK_443X), |
3162 | CLK("mmci-omap-hs.1", "fck", &mmc2_fck, CK_443X), | 3170 | CLK("omap_hsmmc.1", "fck", &mmc2_fck, CK_443X), |
3163 | CLK("mmci-omap-hs.2", "fck", &mmc3_fck, CK_443X), | 3171 | CLK("omap_hsmmc.2", "fck", &mmc3_fck, CK_443X), |
3164 | CLK("mmci-omap-hs.3", "fck", &mmc4_fck, CK_443X), | 3172 | CLK("omap_hsmmc.3", "fck", &mmc4_fck, CK_443X), |
3165 | CLK("mmci-omap-hs.4", "fck", &mmc5_fck, CK_443X), | 3173 | CLK("omap_hsmmc.4", "fck", &mmc5_fck, CK_443X), |
3166 | CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), | 3174 | CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), |
3167 | CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), | 3175 | CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), |
3168 | CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), | 3176 | CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), |
@@ -3245,11 +3253,11 @@ static struct omap_clk omap44xx_clks[] = { | |||
3245 | CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), | 3253 | CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), |
3246 | CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), | 3254 | CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), |
3247 | CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X), | 3255 | CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X), |
3248 | CLK("mmci-omap-hs.0", "ick", &dummy_ck, CK_443X), | 3256 | CLK("omap_hsmmc.0", "ick", &dummy_ck, CK_443X), |
3249 | CLK("mmci-omap-hs.1", "ick", &dummy_ck, CK_443X), | 3257 | CLK("omap_hsmmc.1", "ick", &dummy_ck, CK_443X), |
3250 | CLK("mmci-omap-hs.2", "ick", &dummy_ck, CK_443X), | 3258 | CLK("omap_hsmmc.2", "ick", &dummy_ck, CK_443X), |
3251 | CLK("mmci-omap-hs.3", "ick", &dummy_ck, CK_443X), | 3259 | CLK("omap_hsmmc.3", "ick", &dummy_ck, CK_443X), |
3252 | CLK("mmci-omap-hs.4", "ick", &dummy_ck, CK_443X), | 3260 | CLK("omap_hsmmc.4", "ick", &dummy_ck, CK_443X), |
3253 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), | 3261 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), |
3254 | CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), | 3262 | CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), |
3255 | CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), | 3263 | CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), |
@@ -3301,6 +3309,9 @@ int __init omap4xxx_clk_init(void) | |||
3301 | omap2_init_clk_clkdm(c->lk.clk); | 3309 | omap2_init_clk_clkdm(c->lk.clk); |
3302 | } | 3310 | } |
3303 | 3311 | ||
3312 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
3313 | omap_clk_disable_autoidle_all(); | ||
3314 | |||
3304 | recalculate_root_clocks(); | 3315 | recalculate_root_clocks(); |
3305 | 3316 | ||
3306 | /* | 3317 | /* |
diff --git a/arch/arm/mach-omap2/clock_common_data.c b/arch/arm/mach-omap2/clock_common_data.c index 1cf8131205fa..6424d46be14a 100644 --- a/arch/arm/mach-omap2/clock_common_data.c +++ b/arch/arm/mach-omap2/clock_common_data.c | |||
@@ -37,3 +37,9 @@ const struct clksel_rate gfx_l3_rates[] = { | |||
37 | { .div = 0 } | 37 | { .div = 0 } |
38 | }; | 38 | }; |
39 | 39 | ||
40 | const struct clksel_rate dsp_ick_rates[] = { | ||
41 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
42 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
43 | { .div = 3, .val = 3, .flags = RATE_IN_243X }, | ||
44 | { .div = 0 }, | ||
45 | }; | ||
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 58e42f76603f..ab878545bd9b 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -26,17 +26,8 @@ | |||
26 | 26 | ||
27 | #include <linux/bitops.h> | 27 | #include <linux/bitops.h> |
28 | 28 | ||
29 | #include "prm2xxx_3xxx.h" | ||
30 | #include "prm-regbits-24xx.h" | ||
31 | #include "cm2xxx_3xxx.h" | ||
32 | #include "cm-regbits-24xx.h" | ||
33 | #include "cminst44xx.h" | ||
34 | #include "prcm44xx.h" | ||
35 | |||
36 | #include <plat/clock.h> | 29 | #include <plat/clock.h> |
37 | #include "powerdomain.h" | ||
38 | #include "clockdomain.h" | 30 | #include "clockdomain.h" |
39 | #include <plat/prcm.h> | ||
40 | 31 | ||
41 | /* clkdm_list contains all registered struct clockdomains */ | 32 | /* clkdm_list contains all registered struct clockdomains */ |
42 | static LIST_HEAD(clkdm_list); | 33 | static LIST_HEAD(clkdm_list); |
@@ -44,6 +35,7 @@ static LIST_HEAD(clkdm_list); | |||
44 | /* array of clockdomain deps to be added/removed when clkdm in hwsup mode */ | 35 | /* array of clockdomain deps to be added/removed when clkdm in hwsup mode */ |
45 | static struct clkdm_autodep *autodeps; | 36 | static struct clkdm_autodep *autodeps; |
46 | 37 | ||
38 | static struct clkdm_ops *arch_clkdm; | ||
47 | 39 | ||
48 | /* Private functions */ | 40 | /* Private functions */ |
49 | 41 | ||
@@ -177,11 +169,11 @@ static void _autodep_lookup(struct clkdm_autodep *autodep) | |||
177 | * XXX autodeps are deprecated and should be removed at the earliest | 169 | * XXX autodeps are deprecated and should be removed at the earliest |
178 | * opportunity | 170 | * opportunity |
179 | */ | 171 | */ |
180 | static void _clkdm_add_autodeps(struct clockdomain *clkdm) | 172 | void _clkdm_add_autodeps(struct clockdomain *clkdm) |
181 | { | 173 | { |
182 | struct clkdm_autodep *autodep; | 174 | struct clkdm_autodep *autodep; |
183 | 175 | ||
184 | if (!autodeps) | 176 | if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS) |
185 | return; | 177 | return; |
186 | 178 | ||
187 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { | 179 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { |
@@ -211,11 +203,11 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
211 | * XXX autodeps are deprecated and should be removed at the earliest | 203 | * XXX autodeps are deprecated and should be removed at the earliest |
212 | * opportunity | 204 | * opportunity |
213 | */ | 205 | */ |
214 | static void _clkdm_del_autodeps(struct clockdomain *clkdm) | 206 | void _clkdm_del_autodeps(struct clockdomain *clkdm) |
215 | { | 207 | { |
216 | struct clkdm_autodep *autodep; | 208 | struct clkdm_autodep *autodep; |
217 | 209 | ||
218 | if (!autodeps) | 210 | if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS) |
219 | return; | 211 | return; |
220 | 212 | ||
221 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { | 213 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { |
@@ -235,55 +227,29 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
235 | } | 227 | } |
236 | 228 | ||
237 | /** | 229 | /** |
238 | * _enable_hwsup - place a clockdomain into hardware-supervised idle | 230 | * _resolve_clkdm_deps() - resolve clkdm_names in @clkdm_deps to clkdms |
239 | * @clkdm: struct clockdomain * | 231 | * @clkdm: clockdomain that we are resolving dependencies for |
240 | * | 232 | * @clkdm_deps: ptr to array of struct clkdm_deps to resolve |
241 | * Place the clockdomain into hardware-supervised idle mode. No return | ||
242 | * value. | ||
243 | * | 233 | * |
244 | * XXX Should this return an error if the clockdomain does not support | 234 | * Iterates through @clkdm_deps, looking up the struct clockdomain named by |
245 | * hardware-supervised idle mode? | 235 | * clkdm_name and storing the clockdomain pointer in the struct clkdm_dep. |
246 | */ | ||
247 | static void _enable_hwsup(struct clockdomain *clkdm) | ||
248 | { | ||
249 | if (cpu_is_omap24xx()) | ||
250 | omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
251 | clkdm->clktrctrl_mask); | ||
252 | else if (cpu_is_omap34xx()) | ||
253 | omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
254 | clkdm->clktrctrl_mask); | ||
255 | else if (cpu_is_omap44xx()) | ||
256 | return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, | ||
257 | clkdm->cm_inst, | ||
258 | clkdm->clkdm_offs); | ||
259 | else | ||
260 | BUG(); | ||
261 | } | ||
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. | 236 | * No return value. |
269 | * | ||
270 | * XXX Should this return an error if the clockdomain does not support | ||
271 | * software-supervised idle mode? | ||
272 | */ | 237 | */ |
273 | static void _disable_hwsup(struct clockdomain *clkdm) | 238 | static void _resolve_clkdm_deps(struct clockdomain *clkdm, |
239 | struct clkdm_dep *clkdm_deps) | ||
274 | { | 240 | { |
275 | if (cpu_is_omap24xx()) | 241 | struct clkdm_dep *cd; |
276 | omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | 242 | |
277 | clkdm->clktrctrl_mask); | 243 | for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) { |
278 | else if (cpu_is_omap34xx()) | 244 | if (!omap_chip_is(cd->omap_chip)) |
279 | omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | 245 | continue; |
280 | clkdm->clktrctrl_mask); | 246 | if (cd->clkdm) |
281 | else if (cpu_is_omap44xx()) | 247 | continue; |
282 | return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, | 248 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); |
283 | clkdm->cm_inst, | 249 | |
284 | clkdm->clkdm_offs); | 250 | WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s while resolving dependencies - should never happen", |
285 | else | 251 | clkdm->name, cd->clkdm_name); |
286 | BUG(); | 252 | } |
287 | } | 253 | } |
288 | 254 | ||
289 | /* Public functions */ | 255 | /* Public functions */ |
@@ -292,6 +258,7 @@ static void _disable_hwsup(struct clockdomain *clkdm) | |||
292 | * clkdm_init - set up the clockdomain layer | 258 | * clkdm_init - set up the clockdomain layer |
293 | * @clkdms: optional pointer to an array of clockdomains to register | 259 | * @clkdms: optional pointer to an array of clockdomains to register |
294 | * @init_autodeps: optional pointer to an array of autodeps to register | 260 | * @init_autodeps: optional pointer to an array of autodeps to register |
261 | * @custom_funcs: func pointers for arch specfic implementations | ||
295 | * | 262 | * |
296 | * Set up internal state. If a pointer to an array of clockdomains | 263 | * Set up internal state. If a pointer to an array of clockdomains |
297 | * @clkdms was supplied, loop through the list of clockdomains, | 264 | * @clkdms was supplied, loop through the list of clockdomains, |
@@ -300,12 +267,18 @@ static void _disable_hwsup(struct clockdomain *clkdm) | |||
300 | * @init_autodeps was provided, register those. No return value. | 267 | * @init_autodeps was provided, register those. No return value. |
301 | */ | 268 | */ |
302 | void clkdm_init(struct clockdomain **clkdms, | 269 | void clkdm_init(struct clockdomain **clkdms, |
303 | struct clkdm_autodep *init_autodeps) | 270 | struct clkdm_autodep *init_autodeps, |
271 | struct clkdm_ops *custom_funcs) | ||
304 | { | 272 | { |
305 | struct clockdomain **c = NULL; | 273 | struct clockdomain **c = NULL; |
306 | struct clockdomain *clkdm; | 274 | struct clockdomain *clkdm; |
307 | struct clkdm_autodep *autodep = NULL; | 275 | struct clkdm_autodep *autodep = NULL; |
308 | 276 | ||
277 | if (!custom_funcs) | ||
278 | WARN(1, "No custom clkdm functions registered\n"); | ||
279 | else | ||
280 | arch_clkdm = custom_funcs; | ||
281 | |||
309 | if (clkdms) | 282 | if (clkdms) |
310 | for (c = clkdms; *c; c++) | 283 | for (c = clkdms; *c; c++) |
311 | _clkdm_register(*c); | 284 | _clkdm_register(*c); |
@@ -321,11 +294,14 @@ void clkdm_init(struct clockdomain **clkdms, | |||
321 | */ | 294 | */ |
322 | list_for_each_entry(clkdm, &clkdm_list, node) { | 295 | list_for_each_entry(clkdm, &clkdm_list, node) { |
323 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | 296 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) |
324 | omap2_clkdm_wakeup(clkdm); | 297 | clkdm_wakeup(clkdm); |
325 | else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO) | 298 | else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO) |
326 | omap2_clkdm_deny_idle(clkdm); | 299 | clkdm_deny_idle(clkdm); |
327 | 300 | ||
301 | _resolve_clkdm_deps(clkdm, clkdm->wkdep_srcs); | ||
328 | clkdm_clear_all_wkdeps(clkdm); | 302 | clkdm_clear_all_wkdeps(clkdm); |
303 | |||
304 | _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs); | ||
329 | clkdm_clear_all_sleepdeps(clkdm); | 305 | clkdm_clear_all_sleepdeps(clkdm); |
330 | } | 306 | } |
331 | } | 307 | } |
@@ -422,32 +398,32 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm) | |||
422 | int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | 398 | int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) |
423 | { | 399 | { |
424 | struct clkdm_dep *cd; | 400 | struct clkdm_dep *cd; |
425 | 401 | int ret = 0; | |
426 | if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) { | ||
427 | pr_err("clockdomain: %s/%s: %s: not yet implemented\n", | ||
428 | clkdm1->name, clkdm2->name, __func__); | ||
429 | return -EINVAL; | ||
430 | } | ||
431 | 402 | ||
432 | if (!clkdm1 || !clkdm2) | 403 | if (!clkdm1 || !clkdm2) |
433 | return -EINVAL; | 404 | return -EINVAL; |
434 | 405 | ||
435 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); | 406 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); |
436 | if (IS_ERR(cd)) { | 407 | if (IS_ERR(cd)) |
408 | ret = PTR_ERR(cd); | ||
409 | |||
410 | if (!arch_clkdm || !arch_clkdm->clkdm_add_wkdep) | ||
411 | ret = -EINVAL; | ||
412 | |||
413 | if (ret) { | ||
437 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | 414 | pr_debug("clockdomain: hardware cannot set/clear wake up of " |
438 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | 415 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); |
439 | return PTR_ERR(cd); | 416 | return ret; |
440 | } | 417 | } |
441 | 418 | ||
442 | if (atomic_inc_return(&cd->wkdep_usecount) == 1) { | 419 | if (atomic_inc_return(&cd->wkdep_usecount) == 1) { |
443 | pr_debug("clockdomain: hardware will wake up %s when %s wakes " | 420 | pr_debug("clockdomain: hardware will wake up %s when %s wakes " |
444 | "up\n", clkdm1->name, clkdm2->name); | 421 | "up\n", clkdm1->name, clkdm2->name); |
445 | 422 | ||
446 | omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit), | 423 | ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2); |
447 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
448 | } | 424 | } |
449 | 425 | ||
450 | return 0; | 426 | return ret; |
451 | } | 427 | } |
452 | 428 | ||
453 | /** | 429 | /** |
@@ -463,32 +439,32 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
463 | int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | 439 | int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) |
464 | { | 440 | { |
465 | struct clkdm_dep *cd; | 441 | struct clkdm_dep *cd; |
466 | 442 | int ret = 0; | |
467 | if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) { | ||
468 | pr_err("clockdomain: %s/%s: %s: not yet implemented\n", | ||
469 | clkdm1->name, clkdm2->name, __func__); | ||
470 | return -EINVAL; | ||
471 | } | ||
472 | 443 | ||
473 | if (!clkdm1 || !clkdm2) | 444 | if (!clkdm1 || !clkdm2) |
474 | return -EINVAL; | 445 | return -EINVAL; |
475 | 446 | ||
476 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); | 447 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); |
477 | if (IS_ERR(cd)) { | 448 | if (IS_ERR(cd)) |
449 | ret = PTR_ERR(cd); | ||
450 | |||
451 | if (!arch_clkdm || !arch_clkdm->clkdm_del_wkdep) | ||
452 | ret = -EINVAL; | ||
453 | |||
454 | if (ret) { | ||
478 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | 455 | pr_debug("clockdomain: hardware cannot set/clear wake up of " |
479 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | 456 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); |
480 | return PTR_ERR(cd); | 457 | return ret; |
481 | } | 458 | } |
482 | 459 | ||
483 | if (atomic_dec_return(&cd->wkdep_usecount) == 0) { | 460 | if (atomic_dec_return(&cd->wkdep_usecount) == 0) { |
484 | pr_debug("clockdomain: hardware will no longer wake up %s " | 461 | pr_debug("clockdomain: hardware will no longer wake up %s " |
485 | "after %s wakes up\n", clkdm1->name, clkdm2->name); | 462 | "after %s wakes up\n", clkdm1->name, clkdm2->name); |
486 | 463 | ||
487 | omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | 464 | ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2); |
488 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
489 | } | 465 | } |
490 | 466 | ||
491 | return 0; | 467 | return ret; |
492 | } | 468 | } |
493 | 469 | ||
494 | /** | 470 | /** |
@@ -508,26 +484,26 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
508 | int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | 484 | int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) |
509 | { | 485 | { |
510 | struct clkdm_dep *cd; | 486 | struct clkdm_dep *cd; |
487 | int ret = 0; | ||
511 | 488 | ||
512 | if (!clkdm1 || !clkdm2) | 489 | if (!clkdm1 || !clkdm2) |
513 | return -EINVAL; | 490 | return -EINVAL; |
514 | 491 | ||
515 | if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) { | ||
516 | pr_err("clockdomain: %s/%s: %s: not yet implemented\n", | ||
517 | clkdm1->name, clkdm2->name, __func__); | ||
518 | return -EINVAL; | ||
519 | } | ||
520 | |||
521 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); | 492 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); |
522 | if (IS_ERR(cd)) { | 493 | if (IS_ERR(cd)) |
494 | ret = PTR_ERR(cd); | ||
495 | |||
496 | if (!arch_clkdm || !arch_clkdm->clkdm_read_wkdep) | ||
497 | ret = -EINVAL; | ||
498 | |||
499 | if (ret) { | ||
523 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | 500 | pr_debug("clockdomain: hardware cannot set/clear wake up of " |
524 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | 501 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); |
525 | return PTR_ERR(cd); | 502 | return ret; |
526 | } | 503 | } |
527 | 504 | ||
528 | /* XXX It's faster to return the atomic wkdep_usecount */ | 505 | /* XXX It's faster to return the atomic wkdep_usecount */ |
529 | return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP, | 506 | return arch_clkdm->clkdm_read_wkdep(clkdm1, clkdm2); |
530 | (1 << clkdm2->dep_bit)); | ||
531 | } | 507 | } |
532 | 508 | ||
533 | /** | 509 | /** |
@@ -542,33 +518,13 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
542 | */ | 518 | */ |
543 | int clkdm_clear_all_wkdeps(struct clockdomain *clkdm) | 519 | int clkdm_clear_all_wkdeps(struct clockdomain *clkdm) |
544 | { | 520 | { |
545 | struct clkdm_dep *cd; | ||
546 | u32 mask = 0; | ||
547 | |||
548 | if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) { | ||
549 | pr_err("clockdomain: %s: %s: not yet implemented\n", | ||
550 | clkdm->name, __func__); | ||
551 | return -EINVAL; | ||
552 | } | ||
553 | |||
554 | if (!clkdm) | 521 | if (!clkdm) |
555 | return -EINVAL; | 522 | return -EINVAL; |
556 | 523 | ||
557 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | 524 | if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_wkdeps) |
558 | if (!omap_chip_is(cd->omap_chip)) | 525 | return -EINVAL; |
559 | continue; | ||
560 | |||
561 | if (!cd->clkdm && cd->clkdm_name) | ||
562 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); | ||
563 | |||
564 | /* PRM accesses are slow, so minimize them */ | ||
565 | mask |= 1 << cd->clkdm->dep_bit; | ||
566 | atomic_set(&cd->wkdep_usecount, 0); | ||
567 | } | ||
568 | |||
569 | omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
570 | 526 | ||
571 | return 0; | 527 | return arch_clkdm->clkdm_clear_all_wkdeps(clkdm); |
572 | } | 528 | } |
573 | 529 | ||
574 | /** | 530 | /** |
@@ -586,31 +542,33 @@ int clkdm_clear_all_wkdeps(struct clockdomain *clkdm) | |||
586 | int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | 542 | int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) |
587 | { | 543 | { |
588 | struct clkdm_dep *cd; | 544 | struct clkdm_dep *cd; |
589 | 545 | int ret = 0; | |
590 | if (!cpu_is_omap34xx()) | ||
591 | return -EINVAL; | ||
592 | 546 | ||
593 | if (!clkdm1 || !clkdm2) | 547 | if (!clkdm1 || !clkdm2) |
594 | return -EINVAL; | 548 | return -EINVAL; |
595 | 549 | ||
596 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); | 550 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); |
597 | if (IS_ERR(cd)) { | 551 | if (IS_ERR(cd)) |
552 | ret = PTR_ERR(cd); | ||
553 | |||
554 | if (!arch_clkdm || !arch_clkdm->clkdm_add_sleepdep) | ||
555 | ret = -EINVAL; | ||
556 | |||
557 | if (ret) { | ||
598 | pr_debug("clockdomain: hardware cannot set/clear sleep " | 558 | pr_debug("clockdomain: hardware cannot set/clear sleep " |
599 | "dependency affecting %s from %s\n", clkdm1->name, | 559 | "dependency affecting %s from %s\n", clkdm1->name, |
600 | clkdm2->name); | 560 | clkdm2->name); |
601 | return PTR_ERR(cd); | 561 | return ret; |
602 | } | 562 | } |
603 | 563 | ||
604 | if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { | 564 | if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { |
605 | pr_debug("clockdomain: will prevent %s from sleeping if %s " | 565 | pr_debug("clockdomain: will prevent %s from sleeping if %s " |
606 | "is active\n", clkdm1->name, clkdm2->name); | 566 | "is active\n", clkdm1->name, clkdm2->name); |
607 | 567 | ||
608 | omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit), | 568 | ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2); |
609 | clkdm1->pwrdm.ptr->prcm_offs, | ||
610 | OMAP3430_CM_SLEEPDEP); | ||
611 | } | 569 | } |
612 | 570 | ||
613 | return 0; | 571 | return ret; |
614 | } | 572 | } |
615 | 573 | ||
616 | /** | 574 | /** |
@@ -628,19 +586,23 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
628 | int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | 586 | int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) |
629 | { | 587 | { |
630 | struct clkdm_dep *cd; | 588 | struct clkdm_dep *cd; |
631 | 589 | int ret = 0; | |
632 | if (!cpu_is_omap34xx()) | ||
633 | return -EINVAL; | ||
634 | 590 | ||
635 | if (!clkdm1 || !clkdm2) | 591 | if (!clkdm1 || !clkdm2) |
636 | return -EINVAL; | 592 | return -EINVAL; |
637 | 593 | ||
638 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); | 594 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); |
639 | if (IS_ERR(cd)) { | 595 | if (IS_ERR(cd)) |
596 | ret = PTR_ERR(cd); | ||
597 | |||
598 | if (!arch_clkdm || !arch_clkdm->clkdm_del_sleepdep) | ||
599 | ret = -EINVAL; | ||
600 | |||
601 | if (ret) { | ||
640 | pr_debug("clockdomain: hardware cannot set/clear sleep " | 602 | pr_debug("clockdomain: hardware cannot set/clear sleep " |
641 | "dependency affecting %s from %s\n", clkdm1->name, | 603 | "dependency affecting %s from %s\n", clkdm1->name, |
642 | clkdm2->name); | 604 | clkdm2->name); |
643 | return PTR_ERR(cd); | 605 | return ret; |
644 | } | 606 | } |
645 | 607 | ||
646 | if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { | 608 | if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { |
@@ -648,12 +610,10 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
648 | "sleeping if %s is active\n", clkdm1->name, | 610 | "sleeping if %s is active\n", clkdm1->name, |
649 | clkdm2->name); | 611 | clkdm2->name); |
650 | 612 | ||
651 | omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | 613 | ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2); |
652 | clkdm1->pwrdm.ptr->prcm_offs, | ||
653 | OMAP3430_CM_SLEEPDEP); | ||
654 | } | 614 | } |
655 | 615 | ||
656 | return 0; | 616 | return ret; |
657 | } | 617 | } |
658 | 618 | ||
659 | /** | 619 | /** |
@@ -675,25 +635,27 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
675 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | 635 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) |
676 | { | 636 | { |
677 | struct clkdm_dep *cd; | 637 | struct clkdm_dep *cd; |
678 | 638 | int ret = 0; | |
679 | if (!cpu_is_omap34xx()) | ||
680 | return -EINVAL; | ||
681 | 639 | ||
682 | if (!clkdm1 || !clkdm2) | 640 | if (!clkdm1 || !clkdm2) |
683 | return -EINVAL; | 641 | return -EINVAL; |
684 | 642 | ||
685 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); | 643 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); |
686 | if (IS_ERR(cd)) { | 644 | if (IS_ERR(cd)) |
645 | ret = PTR_ERR(cd); | ||
646 | |||
647 | if (!arch_clkdm || !arch_clkdm->clkdm_read_sleepdep) | ||
648 | ret = -EINVAL; | ||
649 | |||
650 | if (ret) { | ||
687 | pr_debug("clockdomain: hardware cannot set/clear sleep " | 651 | pr_debug("clockdomain: hardware cannot set/clear sleep " |
688 | "dependency affecting %s from %s\n", clkdm1->name, | 652 | "dependency affecting %s from %s\n", clkdm1->name, |
689 | clkdm2->name); | 653 | clkdm2->name); |
690 | return PTR_ERR(cd); | 654 | return ret; |
691 | } | 655 | } |
692 | 656 | ||
693 | /* XXX It's faster to return the atomic sleepdep_usecount */ | 657 | /* XXX It's faster to return the atomic sleepdep_usecount */ |
694 | return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, | 658 | return arch_clkdm->clkdm_read_sleepdep(clkdm1, clkdm2); |
695 | OMAP3430_CM_SLEEPDEP, | ||
696 | (1 << clkdm2->dep_bit)); | ||
697 | } | 659 | } |
698 | 660 | ||
699 | /** | 661 | /** |
@@ -708,35 +670,17 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
708 | */ | 670 | */ |
709 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | 671 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) |
710 | { | 672 | { |
711 | struct clkdm_dep *cd; | ||
712 | u32 mask = 0; | ||
713 | |||
714 | if (!cpu_is_omap34xx()) | ||
715 | return -EINVAL; | ||
716 | |||
717 | if (!clkdm) | 673 | if (!clkdm) |
718 | return -EINVAL; | 674 | return -EINVAL; |
719 | 675 | ||
720 | for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { | 676 | if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_sleepdeps) |
721 | if (!omap_chip_is(cd->omap_chip)) | 677 | return -EINVAL; |
722 | continue; | ||
723 | |||
724 | if (!cd->clkdm && cd->clkdm_name) | ||
725 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); | ||
726 | |||
727 | /* PRM accesses are slow, so minimize them */ | ||
728 | mask |= 1 << cd->clkdm->dep_bit; | ||
729 | atomic_set(&cd->sleepdep_usecount, 0); | ||
730 | } | ||
731 | |||
732 | omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, | ||
733 | OMAP3430_CM_SLEEPDEP); | ||
734 | 678 | ||
735 | return 0; | 679 | return arch_clkdm->clkdm_clear_all_sleepdeps(clkdm); |
736 | } | 680 | } |
737 | 681 | ||
738 | /** | 682 | /** |
739 | * omap2_clkdm_sleep - force clockdomain sleep transition | 683 | * clkdm_sleep - force clockdomain sleep transition |
740 | * @clkdm: struct clockdomain * | 684 | * @clkdm: struct clockdomain * |
741 | * | 685 | * |
742 | * Instruct the CM to force a sleep transition on the specified | 686 | * Instruct the CM to force a sleep transition on the specified |
@@ -744,7 +688,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | |||
744 | * clockdomain does not support software-initiated sleep; 0 upon | 688 | * clockdomain does not support software-initiated sleep; 0 upon |
745 | * success. | 689 | * success. |
746 | */ | 690 | */ |
747 | int omap2_clkdm_sleep(struct clockdomain *clkdm) | 691 | int clkdm_sleep(struct clockdomain *clkdm) |
748 | { | 692 | { |
749 | if (!clkdm) | 693 | if (!clkdm) |
750 | return -EINVAL; | 694 | return -EINVAL; |
@@ -755,33 +699,16 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
755 | return -EINVAL; | 699 | return -EINVAL; |
756 | } | 700 | } |
757 | 701 | ||
758 | pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); | 702 | if (!arch_clkdm || !arch_clkdm->clkdm_sleep) |
759 | 703 | return -EINVAL; | |
760 | if (cpu_is_omap24xx()) { | ||
761 | |||
762 | omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | ||
763 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | ||
764 | |||
765 | } else if (cpu_is_omap34xx()) { | ||
766 | |||
767 | omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, | ||
768 | clkdm->clktrctrl_mask); | ||
769 | |||
770 | } else if (cpu_is_omap44xx()) { | ||
771 | |||
772 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, | ||
773 | clkdm->cm_inst, | ||
774 | clkdm->clkdm_offs); | ||
775 | 704 | ||
776 | } else { | 705 | pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); |
777 | BUG(); | ||
778 | }; | ||
779 | 706 | ||
780 | return 0; | 707 | return arch_clkdm->clkdm_sleep(clkdm); |
781 | } | 708 | } |
782 | 709 | ||
783 | /** | 710 | /** |
784 | * omap2_clkdm_wakeup - force clockdomain wakeup transition | 711 | * clkdm_wakeup - force clockdomain wakeup transition |
785 | * @clkdm: struct clockdomain * | 712 | * @clkdm: struct clockdomain * |
786 | * | 713 | * |
787 | * Instruct the CM to force a wakeup transition on the specified | 714 | * Instruct the CM to force a wakeup transition on the specified |
@@ -789,7 +716,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
789 | * clockdomain does not support software-controlled wakeup; 0 upon | 716 | * clockdomain does not support software-controlled wakeup; 0 upon |
790 | * success. | 717 | * success. |
791 | */ | 718 | */ |
792 | int omap2_clkdm_wakeup(struct clockdomain *clkdm) | 719 | int clkdm_wakeup(struct clockdomain *clkdm) |
793 | { | 720 | { |
794 | if (!clkdm) | 721 | if (!clkdm) |
795 | return -EINVAL; | 722 | return -EINVAL; |
@@ -800,33 +727,16 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
800 | return -EINVAL; | 727 | return -EINVAL; |
801 | } | 728 | } |
802 | 729 | ||
803 | pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); | 730 | if (!arch_clkdm || !arch_clkdm->clkdm_wakeup) |
804 | 731 | return -EINVAL; | |
805 | if (cpu_is_omap24xx()) { | ||
806 | |||
807 | omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | ||
808 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | ||
809 | |||
810 | } else if (cpu_is_omap34xx()) { | ||
811 | |||
812 | omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, | ||
813 | clkdm->clktrctrl_mask); | ||
814 | |||
815 | } else if (cpu_is_omap44xx()) { | ||
816 | |||
817 | omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition, | ||
818 | clkdm->cm_inst, | ||
819 | clkdm->clkdm_offs); | ||
820 | 732 | ||
821 | } else { | 733 | pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); |
822 | BUG(); | ||
823 | }; | ||
824 | 734 | ||
825 | return 0; | 735 | return arch_clkdm->clkdm_wakeup(clkdm); |
826 | } | 736 | } |
827 | 737 | ||
828 | /** | 738 | /** |
829 | * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm | 739 | * clkdm_allow_idle - enable hwsup idle transitions for clkdm |
830 | * @clkdm: struct clockdomain * | 740 | * @clkdm: struct clockdomain * |
831 | * | 741 | * |
832 | * Allow the hardware to automatically switch the clockdomain @clkdm into | 742 | * Allow the hardware to automatically switch the clockdomain @clkdm into |
@@ -835,7 +745,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
835 | * framework, wkdep/sleepdep autodependencies are added; this is so | 745 | * framework, wkdep/sleepdep autodependencies are added; this is so |
836 | * device drivers can read and write to the device. No return value. | 746 | * device drivers can read and write to the device. No return value. |
837 | */ | 747 | */ |
838 | void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | 748 | void clkdm_allow_idle(struct clockdomain *clkdm) |
839 | { | 749 | { |
840 | if (!clkdm) | 750 | if (!clkdm) |
841 | return; | 751 | return; |
@@ -846,27 +756,18 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
846 | return; | 756 | return; |
847 | } | 757 | } |
848 | 758 | ||
759 | if (!arch_clkdm || !arch_clkdm->clkdm_allow_idle) | ||
760 | return; | ||
761 | |||
849 | pr_debug("clockdomain: enabling automatic idle transitions for %s\n", | 762 | pr_debug("clockdomain: enabling automatic idle transitions for %s\n", |
850 | clkdm->name); | 763 | clkdm->name); |
851 | 764 | ||
852 | /* | 765 | arch_clkdm->clkdm_allow_idle(clkdm); |
853 | * XXX This should be removed once TI adds wakeup/sleep | ||
854 | * dependency code and data for OMAP4. | ||
855 | */ | ||
856 | if (cpu_is_omap44xx()) { | ||
857 | pr_err("clockdomain: %s: OMAP4 wakeup/sleep dependency support: not yet implemented\n", clkdm->name); | ||
858 | } else { | ||
859 | if (atomic_read(&clkdm->usecount) > 0) | ||
860 | _clkdm_add_autodeps(clkdm); | ||
861 | } | ||
862 | |||
863 | _enable_hwsup(clkdm); | ||
864 | |||
865 | pwrdm_clkdm_state_switch(clkdm); | 766 | pwrdm_clkdm_state_switch(clkdm); |
866 | } | 767 | } |
867 | 768 | ||
868 | /** | 769 | /** |
869 | * omap2_clkdm_deny_idle - disable hwsup idle transitions for clkdm | 770 | * clkdm_deny_idle - disable hwsup idle transitions for clkdm |
870 | * @clkdm: struct clockdomain * | 771 | * @clkdm: struct clockdomain * |
871 | * | 772 | * |
872 | * Prevent the hardware from automatically switching the clockdomain | 773 | * Prevent the hardware from automatically switching the clockdomain |
@@ -874,7 +775,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
874 | * downstream clocks enabled in the clock framework, wkdep/sleepdep | 775 | * downstream clocks enabled in the clock framework, wkdep/sleepdep |
875 | * autodependencies are removed. No return value. | 776 | * autodependencies are removed. No return value. |
876 | */ | 777 | */ |
877 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | 778 | void clkdm_deny_idle(struct clockdomain *clkdm) |
878 | { | 779 | { |
879 | if (!clkdm) | 780 | if (!clkdm) |
880 | return; | 781 | return; |
@@ -885,28 +786,20 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
885 | return; | 786 | return; |
886 | } | 787 | } |
887 | 788 | ||
789 | if (!arch_clkdm || !arch_clkdm->clkdm_deny_idle) | ||
790 | return; | ||
791 | |||
888 | pr_debug("clockdomain: disabling automatic idle transitions for %s\n", | 792 | pr_debug("clockdomain: disabling automatic idle transitions for %s\n", |
889 | clkdm->name); | 793 | clkdm->name); |
890 | 794 | ||
891 | _disable_hwsup(clkdm); | 795 | arch_clkdm->clkdm_deny_idle(clkdm); |
892 | |||
893 | /* | ||
894 | * XXX This should be removed once TI adds wakeup/sleep | ||
895 | * dependency code and data for OMAP4. | ||
896 | */ | ||
897 | if (cpu_is_omap44xx()) { | ||
898 | pr_err("clockdomain: %s: OMAP4 wakeup/sleep dependency support: not yet implemented\n", clkdm->name); | ||
899 | } else { | ||
900 | if (atomic_read(&clkdm->usecount) > 0) | ||
901 | _clkdm_del_autodeps(clkdm); | ||
902 | } | ||
903 | } | 796 | } |
904 | 797 | ||
905 | 798 | ||
906 | /* Clockdomain-to-clock framework interface code */ | 799 | /* Clockdomain-to-clock framework interface code */ |
907 | 800 | ||
908 | /** | 801 | /** |
909 | * omap2_clkdm_clk_enable - add an enabled downstream clock to this clkdm | 802 | * clkdm_clk_enable - add an enabled downstream clock to this clkdm |
910 | * @clkdm: struct clockdomain * | 803 | * @clkdm: struct clockdomain * |
911 | * @clk: struct clk * of the enabled downstream clock | 804 | * @clk: struct clk * of the enabled downstream clock |
912 | * | 805 | * |
@@ -919,10 +812,8 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
919 | * by on-chip processors. Returns -EINVAL if passed null pointers; | 812 | * by on-chip processors. Returns -EINVAL if passed null pointers; |
920 | * returns 0 upon success or if the clockdomain is in hwsup idle mode. | 813 | * returns 0 upon success or if the clockdomain is in hwsup idle mode. |
921 | */ | 814 | */ |
922 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | 815 | int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) |
923 | { | 816 | { |
924 | bool hwsup = false; | ||
925 | |||
926 | /* | 817 | /* |
927 | * XXX Rewrite this code to maintain a list of enabled | 818 | * XXX Rewrite this code to maintain a list of enabled |
928 | * downstream clocks for debugging purposes? | 819 | * downstream clocks for debugging purposes? |
@@ -931,6 +822,9 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
931 | if (!clkdm || !clk) | 822 | if (!clkdm || !clk) |
932 | return -EINVAL; | 823 | return -EINVAL; |
933 | 824 | ||
825 | if (!arch_clkdm || !arch_clkdm->clkdm_clk_enable) | ||
826 | return -EINVAL; | ||
827 | |||
934 | if (atomic_inc_return(&clkdm->usecount) > 1) | 828 | if (atomic_inc_return(&clkdm->usecount) > 1) |
935 | return 0; | 829 | return 0; |
936 | 830 | ||
@@ -939,31 +833,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
939 | pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, | 833 | pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, |
940 | clk->name); | 834 | clk->name); |
941 | 835 | ||
942 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | 836 | arch_clkdm->clkdm_clk_enable(clkdm); |
943 | |||
944 | if (!clkdm->clktrctrl_mask) | ||
945 | return 0; | ||
946 | |||
947 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
948 | clkdm->clktrctrl_mask); | ||
949 | |||
950 | } else if (cpu_is_omap44xx()) { | ||
951 | |||
952 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
953 | clkdm->cm_inst, | ||
954 | clkdm->clkdm_offs); | ||
955 | |||
956 | } | ||
957 | |||
958 | if (hwsup) { | ||
959 | /* Disable HW transitions when we are changing deps */ | ||
960 | _disable_hwsup(clkdm); | ||
961 | _clkdm_add_autodeps(clkdm); | ||
962 | _enable_hwsup(clkdm); | ||
963 | } else { | ||
964 | omap2_clkdm_wakeup(clkdm); | ||
965 | } | ||
966 | |||
967 | pwrdm_wait_transition(clkdm->pwrdm.ptr); | 837 | pwrdm_wait_transition(clkdm->pwrdm.ptr); |
968 | pwrdm_clkdm_state_switch(clkdm); | 838 | pwrdm_clkdm_state_switch(clkdm); |
969 | 839 | ||
@@ -971,7 +841,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
971 | } | 841 | } |
972 | 842 | ||
973 | /** | 843 | /** |
974 | * omap2_clkdm_clk_disable - remove an enabled downstream clock from this clkdm | 844 | * clkdm_clk_disable - remove an enabled downstream clock from this clkdm |
975 | * @clkdm: struct clockdomain * | 845 | * @clkdm: struct clockdomain * |
976 | * @clk: struct clk * of the disabled downstream clock | 846 | * @clk: struct clk * of the disabled downstream clock |
977 | * | 847 | * |
@@ -984,10 +854,8 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
984 | * is enabled; or returns 0 upon success or if the clockdomain is in | 854 | * is enabled; or returns 0 upon success or if the clockdomain is in |
985 | * hwsup idle mode. | 855 | * hwsup idle mode. |
986 | */ | 856 | */ |
987 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | 857 | int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) |
988 | { | 858 | { |
989 | bool hwsup = false; | ||
990 | |||
991 | /* | 859 | /* |
992 | * XXX Rewrite this code to maintain a list of enabled | 860 | * XXX Rewrite this code to maintain a list of enabled |
993 | * downstream clocks for debugging purposes? | 861 | * downstream clocks for debugging purposes? |
@@ -996,6 +864,9 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | |||
996 | if (!clkdm || !clk) | 864 | if (!clkdm || !clk) |
997 | return -EINVAL; | 865 | return -EINVAL; |
998 | 866 | ||
867 | if (!arch_clkdm || !arch_clkdm->clkdm_clk_disable) | ||
868 | return -EINVAL; | ||
869 | |||
999 | #ifdef DEBUG | 870 | #ifdef DEBUG |
1000 | if (atomic_read(&clkdm->usecount) == 0) { | 871 | if (atomic_read(&clkdm->usecount) == 0) { |
1001 | WARN_ON(1); /* underflow */ | 872 | WARN_ON(1); /* underflow */ |
@@ -1011,31 +882,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | |||
1011 | pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, | 882 | pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, |
1012 | clk->name); | 883 | clk->name); |
1013 | 884 | ||
1014 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | 885 | arch_clkdm->clkdm_clk_disable(clkdm); |
1015 | |||
1016 | if (!clkdm->clktrctrl_mask) | ||
1017 | return 0; | ||
1018 | |||
1019 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
1020 | clkdm->clktrctrl_mask); | ||
1021 | |||
1022 | } else if (cpu_is_omap44xx()) { | ||
1023 | |||
1024 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
1025 | clkdm->cm_inst, | ||
1026 | clkdm->clkdm_offs); | ||
1027 | |||
1028 | } | ||
1029 | |||
1030 | if (hwsup) { | ||
1031 | /* Disable HW transitions when we are changing deps */ | ||
1032 | _disable_hwsup(clkdm); | ||
1033 | _clkdm_del_autodeps(clkdm); | ||
1034 | _enable_hwsup(clkdm); | ||
1035 | } else { | ||
1036 | omap2_clkdm_sleep(clkdm); | ||
1037 | } | ||
1038 | |||
1039 | pwrdm_clkdm_state_switch(clkdm); | 886 | pwrdm_clkdm_state_switch(clkdm); |
1040 | 887 | ||
1041 | return 0; | 888 | return 0; |
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index 9b459c26fb85..85b3dce65640 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * OMAP2/3 clockdomain framework functions | 4 | * OMAP2/3 clockdomain framework functions |
5 | * | 5 | * |
6 | * Copyright (C) 2008 Texas Instruments, Inc. | 6 | * Copyright (C) 2008 Texas Instruments, Inc. |
7 | * Copyright (C) 2008-2010 Nokia Corporation | 7 | * Copyright (C) 2008-2011 Nokia Corporation |
8 | * | 8 | * |
9 | * Paul Walmsley | 9 | * Paul Walmsley |
10 | * | 10 | * |
@@ -22,11 +22,19 @@ | |||
22 | #include <plat/clock.h> | 22 | #include <plat/clock.h> |
23 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
24 | 24 | ||
25 | /* Clockdomain capability flags */ | 25 | /* |
26 | * Clockdomain flags | ||
27 | * | ||
28 | * XXX Document CLKDM_CAN_* flags | ||
29 | * | ||
30 | * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this | ||
31 | * clockdomain. (Currently, this applies to OMAP3 clockdomains only.) | ||
32 | */ | ||
26 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | 33 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) |
27 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) | 34 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) |
28 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) | 35 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) |
29 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) | 36 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) |
37 | #define CLKDM_NO_AUTODEPS (1 << 4) | ||
30 | 38 | ||
31 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) | 39 | #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) | 40 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) |
@@ -116,7 +124,42 @@ struct clockdomain { | |||
116 | struct list_head node; | 124 | struct list_head node; |
117 | }; | 125 | }; |
118 | 126 | ||
119 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); | 127 | /** |
128 | * struct clkdm_ops - Arch specfic function implementations | ||
129 | * @clkdm_add_wkdep: Add a wakeup dependency between clk domains | ||
130 | * @clkdm_del_wkdep: Delete a wakeup dependency between clk domains | ||
131 | * @clkdm_read_wkdep: Read wakeup dependency state between clk domains | ||
132 | * @clkdm_clear_all_wkdeps: Remove all wakeup dependencies from the clk domain | ||
133 | * @clkdm_add_sleepdep: Add a sleep dependency between clk domains | ||
134 | * @clkdm_del_sleepdep: Delete a sleep dependency between clk domains | ||
135 | * @clkdm_read_sleepdep: Read sleep dependency state between clk domains | ||
136 | * @clkdm_clear_all_sleepdeps: Remove all sleep dependencies from the clk domain | ||
137 | * @clkdm_sleep: Force a clockdomain to sleep | ||
138 | * @clkdm_wakeup: Force a clockdomain to wakeup | ||
139 | * @clkdm_allow_idle: Enable hw supervised idle transitions for clock domain | ||
140 | * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain | ||
141 | * @clkdm_clk_enable: Put the clkdm in right state for a clock enable | ||
142 | * @clkdm_clk_disable: Put the clkdm in right state for a clock disable | ||
143 | */ | ||
144 | struct clkdm_ops { | ||
145 | int (*clkdm_add_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
146 | int (*clkdm_del_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
147 | int (*clkdm_read_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
148 | int (*clkdm_clear_all_wkdeps)(struct clockdomain *clkdm); | ||
149 | int (*clkdm_add_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
150 | int (*clkdm_del_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
151 | int (*clkdm_read_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
152 | int (*clkdm_clear_all_sleepdeps)(struct clockdomain *clkdm); | ||
153 | int (*clkdm_sleep)(struct clockdomain *clkdm); | ||
154 | int (*clkdm_wakeup)(struct clockdomain *clkdm); | ||
155 | void (*clkdm_allow_idle)(struct clockdomain *clkdm); | ||
156 | void (*clkdm_deny_idle)(struct clockdomain *clkdm); | ||
157 | int (*clkdm_clk_enable)(struct clockdomain *clkdm); | ||
158 | int (*clkdm_clk_disable)(struct clockdomain *clkdm); | ||
159 | }; | ||
160 | |||
161 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps, | ||
162 | struct clkdm_ops *custom_funcs); | ||
120 | struct clockdomain *clkdm_lookup(const char *name); | 163 | struct clockdomain *clkdm_lookup(const char *name); |
121 | 164 | ||
122 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), | 165 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), |
@@ -132,16 +175,23 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | |||
132 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | 175 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); |
133 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); | 176 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); |
134 | 177 | ||
135 | void omap2_clkdm_allow_idle(struct clockdomain *clkdm); | 178 | void clkdm_allow_idle(struct clockdomain *clkdm); |
136 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm); | 179 | void clkdm_deny_idle(struct clockdomain *clkdm); |
137 | 180 | ||
138 | int omap2_clkdm_wakeup(struct clockdomain *clkdm); | 181 | int clkdm_wakeup(struct clockdomain *clkdm); |
139 | int omap2_clkdm_sleep(struct clockdomain *clkdm); | 182 | int clkdm_sleep(struct clockdomain *clkdm); |
140 | 183 | ||
141 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); | 184 | int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); |
142 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); | 185 | int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); |
143 | 186 | ||
144 | extern void __init omap2_clockdomains_init(void); | 187 | extern void __init omap2xxx_clockdomains_init(void); |
188 | extern void __init omap3xxx_clockdomains_init(void); | ||
145 | extern void __init omap44xx_clockdomains_init(void); | 189 | extern void __init omap44xx_clockdomains_init(void); |
190 | extern void _clkdm_add_autodeps(struct clockdomain *clkdm); | ||
191 | extern void _clkdm_del_autodeps(struct clockdomain *clkdm); | ||
192 | |||
193 | extern struct clkdm_ops omap2_clkdm_operations; | ||
194 | extern struct clkdm_ops omap3_clkdm_operations; | ||
195 | extern struct clkdm_ops omap4_clkdm_operations; | ||
146 | 196 | ||
147 | #endif | 197 | #endif |
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c new file mode 100644 index 000000000000..48d0db7e6069 --- /dev/null +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | |||
@@ -0,0 +1,274 @@ | |||
1 | /* | ||
2 | * OMAP2 and OMAP3 clockdomain control | ||
3 | * | ||
4 | * Copyright (C) 2008-2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2008-2010 Nokia Corporation | ||
6 | * | ||
7 | * Derived from mach-omap2/clockdomain.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/types.h> | ||
16 | #include <plat/prcm.h> | ||
17 | #include "prm.h" | ||
18 | #include "prm2xxx_3xxx.h" | ||
19 | #include "cm.h" | ||
20 | #include "cm2xxx_3xxx.h" | ||
21 | #include "cm-regbits-24xx.h" | ||
22 | #include "cm-regbits-34xx.h" | ||
23 | #include "prm-regbits-24xx.h" | ||
24 | #include "clockdomain.h" | ||
25 | |||
26 | static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1, | ||
27 | struct clockdomain *clkdm2) | ||
28 | { | ||
29 | omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit), | ||
30 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | static int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1, | ||
35 | struct clockdomain *clkdm2) | ||
36 | { | ||
37 | omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | ||
38 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1, | ||
43 | struct clockdomain *clkdm2) | ||
44 | { | ||
45 | return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, | ||
46 | PM_WKDEP, (1 << clkdm2->dep_bit)); | ||
47 | } | ||
48 | |||
49 | static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm) | ||
50 | { | ||
51 | struct clkdm_dep *cd; | ||
52 | u32 mask = 0; | ||
53 | |||
54 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | ||
55 | if (!omap_chip_is(cd->omap_chip)) | ||
56 | continue; | ||
57 | if (!cd->clkdm) | ||
58 | continue; /* only happens if data is erroneous */ | ||
59 | |||
60 | /* PRM accesses are slow, so minimize them */ | ||
61 | mask |= 1 << cd->clkdm->dep_bit; | ||
62 | atomic_set(&cd->wkdep_usecount, 0); | ||
63 | } | ||
64 | |||
65 | omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, | ||
66 | PM_WKDEP); | ||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static int omap3_clkdm_add_sleepdep(struct clockdomain *clkdm1, | ||
71 | struct clockdomain *clkdm2) | ||
72 | { | ||
73 | omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit), | ||
74 | clkdm1->pwrdm.ptr->prcm_offs, | ||
75 | OMAP3430_CM_SLEEPDEP); | ||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | static int omap3_clkdm_del_sleepdep(struct clockdomain *clkdm1, | ||
80 | struct clockdomain *clkdm2) | ||
81 | { | ||
82 | omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | ||
83 | clkdm1->pwrdm.ptr->prcm_offs, | ||
84 | OMAP3430_CM_SLEEPDEP); | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | static int omap3_clkdm_read_sleepdep(struct clockdomain *clkdm1, | ||
89 | struct clockdomain *clkdm2) | ||
90 | { | ||
91 | return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, | ||
92 | OMAP3430_CM_SLEEPDEP, (1 << clkdm2->dep_bit)); | ||
93 | } | ||
94 | |||
95 | static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | ||
96 | { | ||
97 | struct clkdm_dep *cd; | ||
98 | u32 mask = 0; | ||
99 | |||
100 | for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { | ||
101 | if (!omap_chip_is(cd->omap_chip)) | ||
102 | continue; | ||
103 | if (!cd->clkdm) | ||
104 | continue; /* only happens if data is erroneous */ | ||
105 | |||
106 | /* PRM accesses are slow, so minimize them */ | ||
107 | mask |= 1 << cd->clkdm->dep_bit; | ||
108 | atomic_set(&cd->sleepdep_usecount, 0); | ||
109 | } | ||
110 | omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, | ||
111 | OMAP3430_CM_SLEEPDEP); | ||
112 | return 0; | ||
113 | } | ||
114 | |||
115 | static int omap2_clkdm_sleep(struct clockdomain *clkdm) | ||
116 | { | ||
117 | omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | ||
118 | clkdm->pwrdm.ptr->prcm_offs, | ||
119 | OMAP2_PM_PWSTCTRL); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | static int omap2_clkdm_wakeup(struct clockdomain *clkdm) | ||
124 | { | ||
125 | omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | ||
126 | clkdm->pwrdm.ptr->prcm_offs, | ||
127 | OMAP2_PM_PWSTCTRL); | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | static void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | ||
132 | { | ||
133 | if (atomic_read(&clkdm->usecount) > 0) | ||
134 | _clkdm_add_autodeps(clkdm); | ||
135 | |||
136 | omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
137 | clkdm->clktrctrl_mask); | ||
138 | } | ||
139 | |||
140 | static void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | ||
141 | { | ||
142 | omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
143 | clkdm->clktrctrl_mask); | ||
144 | |||
145 | if (atomic_read(&clkdm->usecount) > 0) | ||
146 | _clkdm_del_autodeps(clkdm); | ||
147 | } | ||
148 | |||
149 | static void _enable_hwsup(struct clockdomain *clkdm) | ||
150 | { | ||
151 | if (cpu_is_omap24xx()) | ||
152 | omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
153 | clkdm->clktrctrl_mask); | ||
154 | else if (cpu_is_omap34xx()) | ||
155 | omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
156 | clkdm->clktrctrl_mask); | ||
157 | } | ||
158 | |||
159 | static void _disable_hwsup(struct clockdomain *clkdm) | ||
160 | { | ||
161 | if (cpu_is_omap24xx()) | ||
162 | omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
163 | clkdm->clktrctrl_mask); | ||
164 | else if (cpu_is_omap34xx()) | ||
165 | omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
166 | clkdm->clktrctrl_mask); | ||
167 | } | ||
168 | |||
169 | |||
170 | static int omap2_clkdm_clk_enable(struct clockdomain *clkdm) | ||
171 | { | ||
172 | bool hwsup = false; | ||
173 | |||
174 | if (!clkdm->clktrctrl_mask) | ||
175 | return 0; | ||
176 | |||
177 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
178 | clkdm->clktrctrl_mask); | ||
179 | |||
180 | if (hwsup) { | ||
181 | /* Disable HW transitions when we are changing deps */ | ||
182 | _disable_hwsup(clkdm); | ||
183 | _clkdm_add_autodeps(clkdm); | ||
184 | _enable_hwsup(clkdm); | ||
185 | } else { | ||
186 | clkdm_wakeup(clkdm); | ||
187 | } | ||
188 | |||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | static int omap2_clkdm_clk_disable(struct clockdomain *clkdm) | ||
193 | { | ||
194 | bool hwsup = false; | ||
195 | |||
196 | if (!clkdm->clktrctrl_mask) | ||
197 | return 0; | ||
198 | |||
199 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
200 | clkdm->clktrctrl_mask); | ||
201 | |||
202 | if (hwsup) { | ||
203 | /* Disable HW transitions when we are changing deps */ | ||
204 | _disable_hwsup(clkdm); | ||
205 | _clkdm_del_autodeps(clkdm); | ||
206 | _enable_hwsup(clkdm); | ||
207 | } else { | ||
208 | clkdm_sleep(clkdm); | ||
209 | } | ||
210 | |||
211 | return 0; | ||
212 | } | ||
213 | |||
214 | static int omap3_clkdm_sleep(struct clockdomain *clkdm) | ||
215 | { | ||
216 | omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, | ||
217 | clkdm->clktrctrl_mask); | ||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | static int omap3_clkdm_wakeup(struct clockdomain *clkdm) | ||
222 | { | ||
223 | omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, | ||
224 | clkdm->clktrctrl_mask); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | static void omap3_clkdm_allow_idle(struct clockdomain *clkdm) | ||
229 | { | ||
230 | if (atomic_read(&clkdm->usecount) > 0) | ||
231 | _clkdm_add_autodeps(clkdm); | ||
232 | |||
233 | omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
234 | clkdm->clktrctrl_mask); | ||
235 | } | ||
236 | |||
237 | static void omap3_clkdm_deny_idle(struct clockdomain *clkdm) | ||
238 | { | ||
239 | omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
240 | clkdm->clktrctrl_mask); | ||
241 | |||
242 | if (atomic_read(&clkdm->usecount) > 0) | ||
243 | _clkdm_del_autodeps(clkdm); | ||
244 | } | ||
245 | |||
246 | struct clkdm_ops omap2_clkdm_operations = { | ||
247 | .clkdm_add_wkdep = omap2_clkdm_add_wkdep, | ||
248 | .clkdm_del_wkdep = omap2_clkdm_del_wkdep, | ||
249 | .clkdm_read_wkdep = omap2_clkdm_read_wkdep, | ||
250 | .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps, | ||
251 | .clkdm_sleep = omap2_clkdm_sleep, | ||
252 | .clkdm_wakeup = omap2_clkdm_wakeup, | ||
253 | .clkdm_allow_idle = omap2_clkdm_allow_idle, | ||
254 | .clkdm_deny_idle = omap2_clkdm_deny_idle, | ||
255 | .clkdm_clk_enable = omap2_clkdm_clk_enable, | ||
256 | .clkdm_clk_disable = omap2_clkdm_clk_disable, | ||
257 | }; | ||
258 | |||
259 | struct clkdm_ops omap3_clkdm_operations = { | ||
260 | .clkdm_add_wkdep = omap2_clkdm_add_wkdep, | ||
261 | .clkdm_del_wkdep = omap2_clkdm_del_wkdep, | ||
262 | .clkdm_read_wkdep = omap2_clkdm_read_wkdep, | ||
263 | .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps, | ||
264 | .clkdm_add_sleepdep = omap3_clkdm_add_sleepdep, | ||
265 | .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep, | ||
266 | .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep, | ||
267 | .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps, | ||
268 | .clkdm_sleep = omap3_clkdm_sleep, | ||
269 | .clkdm_wakeup = omap3_clkdm_wakeup, | ||
270 | .clkdm_allow_idle = omap3_clkdm_allow_idle, | ||
271 | .clkdm_deny_idle = omap3_clkdm_deny_idle, | ||
272 | .clkdm_clk_enable = omap2_clkdm_clk_enable, | ||
273 | .clkdm_clk_disable = omap2_clkdm_clk_disable, | ||
274 | }; | ||
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c new file mode 100644 index 000000000000..a1a4ecd26544 --- /dev/null +++ b/arch/arm/mach-omap2/clockdomain44xx.c | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | * OMAP4 clockdomain control | ||
3 | * | ||
4 | * Copyright (C) 2008-2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2008-2010 Nokia Corporation | ||
6 | * | ||
7 | * Derived from mach-omap2/clockdomain.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/kernel.h> | ||
16 | #include "clockdomain.h" | ||
17 | #include "cminst44xx.h" | ||
18 | #include "cm44xx.h" | ||
19 | |||
20 | static int omap4_clkdm_add_wkup_sleep_dep(struct clockdomain *clkdm1, | ||
21 | struct clockdomain *clkdm2) | ||
22 | { | ||
23 | omap4_cminst_set_inst_reg_bits((1 << clkdm2->dep_bit), | ||
24 | clkdm1->prcm_partition, | ||
25 | clkdm1->cm_inst, clkdm1->clkdm_offs + | ||
26 | OMAP4_CM_STATICDEP); | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | static int omap4_clkdm_del_wkup_sleep_dep(struct clockdomain *clkdm1, | ||
31 | struct clockdomain *clkdm2) | ||
32 | { | ||
33 | omap4_cminst_clear_inst_reg_bits((1 << clkdm2->dep_bit), | ||
34 | clkdm1->prcm_partition, | ||
35 | clkdm1->cm_inst, clkdm1->clkdm_offs + | ||
36 | OMAP4_CM_STATICDEP); | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static int omap4_clkdm_read_wkup_sleep_dep(struct clockdomain *clkdm1, | ||
41 | struct clockdomain *clkdm2) | ||
42 | { | ||
43 | return omap4_cminst_read_inst_reg_bits(clkdm1->prcm_partition, | ||
44 | clkdm1->cm_inst, clkdm1->clkdm_offs + | ||
45 | OMAP4_CM_STATICDEP, | ||
46 | (1 << clkdm2->dep_bit)); | ||
47 | } | ||
48 | |||
49 | static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) | ||
50 | { | ||
51 | struct clkdm_dep *cd; | ||
52 | u32 mask = 0; | ||
53 | |||
54 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | ||
55 | if (!omap_chip_is(cd->omap_chip)) | ||
56 | continue; | ||
57 | if (!cd->clkdm) | ||
58 | continue; /* only happens if data is erroneous */ | ||
59 | |||
60 | mask |= 1 << cd->clkdm->dep_bit; | ||
61 | atomic_set(&cd->wkdep_usecount, 0); | ||
62 | } | ||
63 | |||
64 | omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition, | ||
65 | clkdm->cm_inst, clkdm->clkdm_offs + | ||
66 | OMAP4_CM_STATICDEP); | ||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static int omap4_clkdm_sleep(struct clockdomain *clkdm) | ||
71 | { | ||
72 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, | ||
73 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | static int omap4_clkdm_wakeup(struct clockdomain *clkdm) | ||
78 | { | ||
79 | omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition, | ||
80 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static void omap4_clkdm_allow_idle(struct clockdomain *clkdm) | ||
85 | { | ||
86 | omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, | ||
87 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
88 | } | ||
89 | |||
90 | static void omap4_clkdm_deny_idle(struct clockdomain *clkdm) | ||
91 | { | ||
92 | omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, | ||
93 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
94 | } | ||
95 | |||
96 | static int omap4_clkdm_clk_enable(struct clockdomain *clkdm) | ||
97 | { | ||
98 | bool hwsup = false; | ||
99 | |||
100 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
101 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
102 | |||
103 | if (!hwsup) | ||
104 | clkdm_wakeup(clkdm); | ||
105 | |||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | static int omap4_clkdm_clk_disable(struct clockdomain *clkdm) | ||
110 | { | ||
111 | bool hwsup = false; | ||
112 | |||
113 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
114 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
115 | |||
116 | if (!hwsup) | ||
117 | clkdm_sleep(clkdm); | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | struct clkdm_ops omap4_clkdm_operations = { | ||
123 | .clkdm_add_wkdep = omap4_clkdm_add_wkup_sleep_dep, | ||
124 | .clkdm_del_wkdep = omap4_clkdm_del_wkup_sleep_dep, | ||
125 | .clkdm_read_wkdep = omap4_clkdm_read_wkup_sleep_dep, | ||
126 | .clkdm_clear_all_wkdeps = omap4_clkdm_clear_all_wkup_sleep_deps, | ||
127 | .clkdm_add_sleepdep = omap4_clkdm_add_wkup_sleep_dep, | ||
128 | .clkdm_del_sleepdep = omap4_clkdm_del_wkup_sleep_dep, | ||
129 | .clkdm_read_sleepdep = omap4_clkdm_read_wkup_sleep_dep, | ||
130 | .clkdm_clear_all_sleepdeps = omap4_clkdm_clear_all_wkup_sleep_deps, | ||
131 | .clkdm_sleep = omap4_clkdm_sleep, | ||
132 | .clkdm_wakeup = omap4_clkdm_wakeup, | ||
133 | .clkdm_allow_idle = omap4_clkdm_allow_idle, | ||
134 | .clkdm_deny_idle = omap4_clkdm_deny_idle, | ||
135 | .clkdm_clk_enable = omap4_clkdm_clk_enable, | ||
136 | .clkdm_clk_disable = omap4_clkdm_clk_disable, | ||
137 | }; | ||
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c index e4a7133ea3b3..13bde95b6790 100644 --- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | |||
@@ -89,6 +89,8 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = { | |||
89 | 89 | ||
90 | /* 24XX-specific possible dependencies */ | 90 | /* 24XX-specific possible dependencies */ |
91 | 91 | ||
92 | #ifdef CONFIG_ARCH_OMAP2 | ||
93 | |||
92 | /* Wakeup dependency source arrays */ | 94 | /* Wakeup dependency source arrays */ |
93 | 95 | ||
94 | /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ | 96 | /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ |
@@ -168,10 +170,11 @@ static struct clkdm_dep core_24xx_wkdeps[] = { | |||
168 | { NULL }, | 170 | { NULL }, |
169 | }; | 171 | }; |
170 | 172 | ||
173 | #endif /* CONFIG_ARCH_OMAP2 */ | ||
171 | 174 | ||
172 | /* 2430-specific possible wakeup dependencies */ | 175 | /* 2430-specific possible wakeup dependencies */ |
173 | 176 | ||
174 | #ifdef CONFIG_ARCH_OMAP2430 | 177 | #ifdef CONFIG_SOC_OMAP2430 |
175 | 178 | ||
176 | /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ | 179 | /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ |
177 | static struct clkdm_dep mdm_2430_wkdeps[] = { | 180 | static struct clkdm_dep mdm_2430_wkdeps[] = { |
@@ -194,7 +197,7 @@ static struct clkdm_dep mdm_2430_wkdeps[] = { | |||
194 | { NULL }, | 197 | { NULL }, |
195 | }; | 198 | }; |
196 | 199 | ||
197 | #endif /* CONFIG_ARCH_OMAP2430 */ | 200 | #endif /* CONFIG_SOC_OMAP2430 */ |
198 | 201 | ||
199 | 202 | ||
200 | /* OMAP3-specific possible dependencies */ | 203 | /* OMAP3-specific possible dependencies */ |
@@ -450,7 +453,7 @@ static struct clockdomain cm_clkdm = { | |||
450 | * 2420-only clockdomains | 453 | * 2420-only clockdomains |
451 | */ | 454 | */ |
452 | 455 | ||
453 | #if defined(CONFIG_ARCH_OMAP2420) | 456 | #if defined(CONFIG_SOC_OMAP2420) |
454 | 457 | ||
455 | static struct clockdomain mpu_2420_clkdm = { | 458 | static struct clockdomain mpu_2420_clkdm = { |
456 | .name = "mpu_clkdm", | 459 | .name = "mpu_clkdm", |
@@ -514,14 +517,14 @@ static struct clockdomain dss_2420_clkdm = { | |||
514 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 517 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
515 | }; | 518 | }; |
516 | 519 | ||
517 | #endif /* CONFIG_ARCH_OMAP2420 */ | 520 | #endif /* CONFIG_SOC_OMAP2420 */ |
518 | 521 | ||
519 | 522 | ||
520 | /* | 523 | /* |
521 | * 2430-only clockdomains | 524 | * 2430-only clockdomains |
522 | */ | 525 | */ |
523 | 526 | ||
524 | #if defined(CONFIG_ARCH_OMAP2430) | 527 | #if defined(CONFIG_SOC_OMAP2430) |
525 | 528 | ||
526 | static struct clockdomain mpu_2430_clkdm = { | 529 | static struct clockdomain mpu_2430_clkdm = { |
527 | .name = "mpu_clkdm", | 530 | .name = "mpu_clkdm", |
@@ -600,7 +603,7 @@ static struct clockdomain dss_2430_clkdm = { | |||
600 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 603 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
601 | }; | 604 | }; |
602 | 605 | ||
603 | #endif /* CONFIG_ARCH_OMAP2430 */ | 606 | #endif /* CONFIG_SOC_OMAP2430 */ |
604 | 607 | ||
605 | 608 | ||
606 | /* | 609 | /* |
@@ -811,7 +814,7 @@ static struct clockdomain *clockdomains_omap2[] __initdata = { | |||
811 | &cm_clkdm, | 814 | &cm_clkdm, |
812 | &prm_clkdm, | 815 | &prm_clkdm, |
813 | 816 | ||
814 | #ifdef CONFIG_ARCH_OMAP2420 | 817 | #ifdef CONFIG_SOC_OMAP2420 |
815 | &mpu_2420_clkdm, | 818 | &mpu_2420_clkdm, |
816 | &iva1_2420_clkdm, | 819 | &iva1_2420_clkdm, |
817 | &dsp_2420_clkdm, | 820 | &dsp_2420_clkdm, |
@@ -821,7 +824,7 @@ static struct clockdomain *clockdomains_omap2[] __initdata = { | |||
821 | &dss_2420_clkdm, | 824 | &dss_2420_clkdm, |
822 | #endif | 825 | #endif |
823 | 826 | ||
824 | #ifdef CONFIG_ARCH_OMAP2430 | 827 | #ifdef CONFIG_SOC_OMAP2430 |
825 | &mpu_2430_clkdm, | 828 | &mpu_2430_clkdm, |
826 | &mdm_clkdm, | 829 | &mdm_clkdm, |
827 | &dsp_2430_clkdm, | 830 | &dsp_2430_clkdm, |
@@ -854,7 +857,12 @@ static struct clockdomain *clockdomains_omap2[] __initdata = { | |||
854 | NULL, | 857 | NULL, |
855 | }; | 858 | }; |
856 | 859 | ||
857 | void __init omap2_clockdomains_init(void) | 860 | void __init omap2xxx_clockdomains_init(void) |
861 | { | ||
862 | clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap2_clkdm_operations); | ||
863 | } | ||
864 | |||
865 | void __init omap3xxx_clockdomains_init(void) | ||
858 | { | 866 | { |
859 | clkdm_init(clockdomains_omap2, clkdm_autodeps); | 867 | clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap3_clkdm_operations); |
860 | } | 868 | } |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index 10622c914abc..a607ec196e8b 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -18,11 +18,6 @@ | |||
18 | * published by the Free Software Foundation. | 18 | * published by the Free Software Foundation. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | ||
22 | * To-Do List | ||
23 | * -> Populate the Sleep/Wakeup dependencies for the domains | ||
24 | */ | ||
25 | |||
26 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
27 | #include <linux/io.h> | 22 | #include <linux/io.h> |
28 | 23 | ||
@@ -35,6 +30,355 @@ | |||
35 | #include "prcm44xx.h" | 30 | #include "prcm44xx.h" |
36 | #include "prcm_mpu44xx.h" | 31 | #include "prcm_mpu44xx.h" |
37 | 32 | ||
33 | /* Static Dependencies for OMAP4 Clock Domains */ | ||
34 | |||
35 | static struct clkdm_dep ducati_wkup_sleep_deps[] = { | ||
36 | { | ||
37 | .clkdm_name = "abe_clkdm", | ||
38 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
39 | }, | ||
40 | { | ||
41 | .clkdm_name = "ivahd_clkdm", | ||
42 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
43 | }, | ||
44 | { | ||
45 | .clkdm_name = "l3_1_clkdm", | ||
46 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
47 | }, | ||
48 | { | ||
49 | .clkdm_name = "l3_2_clkdm", | ||
50 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
51 | }, | ||
52 | { | ||
53 | .clkdm_name = "l3_dss_clkdm", | ||
54 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
55 | }, | ||
56 | { | ||
57 | .clkdm_name = "l3_emif_clkdm", | ||
58 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
59 | }, | ||
60 | { | ||
61 | .clkdm_name = "l3_gfx_clkdm", | ||
62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
63 | }, | ||
64 | { | ||
65 | .clkdm_name = "l3_init_clkdm", | ||
66 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
67 | }, | ||
68 | { | ||
69 | .clkdm_name = "l4_cfg_clkdm", | ||
70 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
71 | }, | ||
72 | { | ||
73 | .clkdm_name = "l4_per_clkdm", | ||
74 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
75 | }, | ||
76 | { | ||
77 | .clkdm_name = "l4_secure_clkdm", | ||
78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
79 | }, | ||
80 | { | ||
81 | .clkdm_name = "l4_wkup_clkdm", | ||
82 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
83 | }, | ||
84 | { | ||
85 | .clkdm_name = "tesla_clkdm", | ||
86 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
87 | }, | ||
88 | { NULL }, | ||
89 | }; | ||
90 | |||
91 | static struct clkdm_dep iss_wkup_sleep_deps[] = { | ||
92 | { | ||
93 | .clkdm_name = "ivahd_clkdm", | ||
94 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
95 | }, | ||
96 | { | ||
97 | .clkdm_name = "l3_1_clkdm", | ||
98 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
99 | }, | ||
100 | { | ||
101 | .clkdm_name = "l3_emif_clkdm", | ||
102 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
103 | }, | ||
104 | { NULL }, | ||
105 | }; | ||
106 | |||
107 | static struct clkdm_dep ivahd_wkup_sleep_deps[] = { | ||
108 | { | ||
109 | .clkdm_name = "l3_1_clkdm", | ||
110 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
111 | }, | ||
112 | { | ||
113 | .clkdm_name = "l3_emif_clkdm", | ||
114 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
115 | }, | ||
116 | { NULL }, | ||
117 | }; | ||
118 | |||
119 | static struct clkdm_dep l3_d2d_wkup_sleep_deps[] = { | ||
120 | { | ||
121 | .clkdm_name = "abe_clkdm", | ||
122 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
123 | }, | ||
124 | { | ||
125 | .clkdm_name = "ivahd_clkdm", | ||
126 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
127 | }, | ||
128 | { | ||
129 | .clkdm_name = "l3_1_clkdm", | ||
130 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
131 | }, | ||
132 | { | ||
133 | .clkdm_name = "l3_2_clkdm", | ||
134 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
135 | }, | ||
136 | { | ||
137 | .clkdm_name = "l3_emif_clkdm", | ||
138 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
139 | }, | ||
140 | { | ||
141 | .clkdm_name = "l3_init_clkdm", | ||
142 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
143 | }, | ||
144 | { | ||
145 | .clkdm_name = "l4_cfg_clkdm", | ||
146 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
147 | }, | ||
148 | { | ||
149 | .clkdm_name = "l4_per_clkdm", | ||
150 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
151 | }, | ||
152 | { NULL }, | ||
153 | }; | ||
154 | |||
155 | static struct clkdm_dep l3_dma_wkup_sleep_deps[] = { | ||
156 | { | ||
157 | .clkdm_name = "abe_clkdm", | ||
158 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
159 | }, | ||
160 | { | ||
161 | .clkdm_name = "ducati_clkdm", | ||
162 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
163 | }, | ||
164 | { | ||
165 | .clkdm_name = "ivahd_clkdm", | ||
166 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
167 | }, | ||
168 | { | ||
169 | .clkdm_name = "l3_1_clkdm", | ||
170 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
171 | }, | ||
172 | { | ||
173 | .clkdm_name = "l3_dss_clkdm", | ||
174 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
175 | }, | ||
176 | { | ||
177 | .clkdm_name = "l3_emif_clkdm", | ||
178 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
179 | }, | ||
180 | { | ||
181 | .clkdm_name = "l3_init_clkdm", | ||
182 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
183 | }, | ||
184 | { | ||
185 | .clkdm_name = "l4_cfg_clkdm", | ||
186 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
187 | }, | ||
188 | { | ||
189 | .clkdm_name = "l4_per_clkdm", | ||
190 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
191 | }, | ||
192 | { | ||
193 | .clkdm_name = "l4_secure_clkdm", | ||
194 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
195 | }, | ||
196 | { | ||
197 | .clkdm_name = "l4_wkup_clkdm", | ||
198 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
199 | }, | ||
200 | { NULL }, | ||
201 | }; | ||
202 | |||
203 | static struct clkdm_dep l3_dss_wkup_sleep_deps[] = { | ||
204 | { | ||
205 | .clkdm_name = "ivahd_clkdm", | ||
206 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
207 | }, | ||
208 | { | ||
209 | .clkdm_name = "l3_2_clkdm", | ||
210 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
211 | }, | ||
212 | { | ||
213 | .clkdm_name = "l3_emif_clkdm", | ||
214 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
215 | }, | ||
216 | { NULL }, | ||
217 | }; | ||
218 | |||
219 | static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = { | ||
220 | { | ||
221 | .clkdm_name = "ivahd_clkdm", | ||
222 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
223 | }, | ||
224 | { | ||
225 | .clkdm_name = "l3_1_clkdm", | ||
226 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
227 | }, | ||
228 | { | ||
229 | .clkdm_name = "l3_emif_clkdm", | ||
230 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
231 | }, | ||
232 | { NULL }, | ||
233 | }; | ||
234 | |||
235 | static struct clkdm_dep l3_init_wkup_sleep_deps[] = { | ||
236 | { | ||
237 | .clkdm_name = "abe_clkdm", | ||
238 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
239 | }, | ||
240 | { | ||
241 | .clkdm_name = "ivahd_clkdm", | ||
242 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
243 | }, | ||
244 | { | ||
245 | .clkdm_name = "l3_emif_clkdm", | ||
246 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
247 | }, | ||
248 | { | ||
249 | .clkdm_name = "l4_cfg_clkdm", | ||
250 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
251 | }, | ||
252 | { | ||
253 | .clkdm_name = "l4_per_clkdm", | ||
254 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
255 | }, | ||
256 | { | ||
257 | .clkdm_name = "l4_secure_clkdm", | ||
258 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
259 | }, | ||
260 | { | ||
261 | .clkdm_name = "l4_wkup_clkdm", | ||
262 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
263 | }, | ||
264 | { NULL }, | ||
265 | }; | ||
266 | |||
267 | static struct clkdm_dep l4_secure_wkup_sleep_deps[] = { | ||
268 | { | ||
269 | .clkdm_name = "l3_1_clkdm", | ||
270 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
271 | }, | ||
272 | { | ||
273 | .clkdm_name = "l3_emif_clkdm", | ||
274 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
275 | }, | ||
276 | { | ||
277 | .clkdm_name = "l4_per_clkdm", | ||
278 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
279 | }, | ||
280 | { NULL }, | ||
281 | }; | ||
282 | |||
283 | static struct clkdm_dep mpuss_wkup_sleep_deps[] = { | ||
284 | { | ||
285 | .clkdm_name = "abe_clkdm", | ||
286 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
287 | }, | ||
288 | { | ||
289 | .clkdm_name = "ducati_clkdm", | ||
290 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
291 | }, | ||
292 | { | ||
293 | .clkdm_name = "ivahd_clkdm", | ||
294 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
295 | }, | ||
296 | { | ||
297 | .clkdm_name = "l3_1_clkdm", | ||
298 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
299 | }, | ||
300 | { | ||
301 | .clkdm_name = "l3_2_clkdm", | ||
302 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
303 | }, | ||
304 | { | ||
305 | .clkdm_name = "l3_dss_clkdm", | ||
306 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
307 | }, | ||
308 | { | ||
309 | .clkdm_name = "l3_emif_clkdm", | ||
310 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
311 | }, | ||
312 | { | ||
313 | .clkdm_name = "l3_gfx_clkdm", | ||
314 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
315 | }, | ||
316 | { | ||
317 | .clkdm_name = "l3_init_clkdm", | ||
318 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
319 | }, | ||
320 | { | ||
321 | .clkdm_name = "l4_cfg_clkdm", | ||
322 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
323 | }, | ||
324 | { | ||
325 | .clkdm_name = "l4_per_clkdm", | ||
326 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
327 | }, | ||
328 | { | ||
329 | .clkdm_name = "l4_secure_clkdm", | ||
330 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
331 | }, | ||
332 | { | ||
333 | .clkdm_name = "l4_wkup_clkdm", | ||
334 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
335 | }, | ||
336 | { | ||
337 | .clkdm_name = "tesla_clkdm", | ||
338 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
339 | }, | ||
340 | { NULL }, | ||
341 | }; | ||
342 | |||
343 | static struct clkdm_dep tesla_wkup_sleep_deps[] = { | ||
344 | { | ||
345 | .clkdm_name = "abe_clkdm", | ||
346 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
347 | }, | ||
348 | { | ||
349 | .clkdm_name = "ivahd_clkdm", | ||
350 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
351 | }, | ||
352 | { | ||
353 | .clkdm_name = "l3_1_clkdm", | ||
354 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
355 | }, | ||
356 | { | ||
357 | .clkdm_name = "l3_2_clkdm", | ||
358 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
359 | }, | ||
360 | { | ||
361 | .clkdm_name = "l3_emif_clkdm", | ||
362 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
363 | }, | ||
364 | { | ||
365 | .clkdm_name = "l3_init_clkdm", | ||
366 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
367 | }, | ||
368 | { | ||
369 | .clkdm_name = "l4_cfg_clkdm", | ||
370 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
371 | }, | ||
372 | { | ||
373 | .clkdm_name = "l4_per_clkdm", | ||
374 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
375 | }, | ||
376 | { | ||
377 | .clkdm_name = "l4_wkup_clkdm", | ||
378 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
379 | }, | ||
380 | { NULL }, | ||
381 | }; | ||
38 | 382 | ||
39 | static struct clockdomain l4_cefuse_44xx_clkdm = { | 383 | static struct clockdomain l4_cefuse_44xx_clkdm = { |
40 | .name = "l4_cefuse_clkdm", | 384 | .name = "l4_cefuse_clkdm", |
@@ -52,6 +396,7 @@ static struct clockdomain l4_cfg_44xx_clkdm = { | |||
52 | .prcm_partition = OMAP4430_CM2_PARTITION, | 396 | .prcm_partition = OMAP4430_CM2_PARTITION, |
53 | .cm_inst = OMAP4430_CM2_CORE_INST, | 397 | .cm_inst = OMAP4430_CM2_CORE_INST, |
54 | .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, | 398 | .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, |
399 | .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT, | ||
55 | .flags = CLKDM_CAN_HWSUP, | 400 | .flags = CLKDM_CAN_HWSUP, |
56 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 401 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
57 | }; | 402 | }; |
@@ -62,6 +407,9 @@ static struct clockdomain tesla_44xx_clkdm = { | |||
62 | .prcm_partition = OMAP4430_CM1_PARTITION, | 407 | .prcm_partition = OMAP4430_CM1_PARTITION, |
63 | .cm_inst = OMAP4430_CM1_TESLA_INST, | 408 | .cm_inst = OMAP4430_CM1_TESLA_INST, |
64 | .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS, | 409 | .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS, |
410 | .dep_bit = OMAP4430_TESLA_STATDEP_SHIFT, | ||
411 | .wkdep_srcs = tesla_wkup_sleep_deps, | ||
412 | .sleepdep_srcs = tesla_wkup_sleep_deps, | ||
65 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 413 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
66 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 414 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
67 | }; | 415 | }; |
@@ -72,6 +420,9 @@ static struct clockdomain l3_gfx_44xx_clkdm = { | |||
72 | .prcm_partition = OMAP4430_CM2_PARTITION, | 420 | .prcm_partition = OMAP4430_CM2_PARTITION, |
73 | .cm_inst = OMAP4430_CM2_GFX_INST, | 421 | .cm_inst = OMAP4430_CM2_GFX_INST, |
74 | .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS, | 422 | .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS, |
423 | .dep_bit = OMAP4430_GFX_STATDEP_SHIFT, | ||
424 | .wkdep_srcs = l3_gfx_wkup_sleep_deps, | ||
425 | .sleepdep_srcs = l3_gfx_wkup_sleep_deps, | ||
75 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 426 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
76 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 427 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
77 | }; | 428 | }; |
@@ -82,6 +433,9 @@ static struct clockdomain ivahd_44xx_clkdm = { | |||
82 | .prcm_partition = OMAP4430_CM2_PARTITION, | 433 | .prcm_partition = OMAP4430_CM2_PARTITION, |
83 | .cm_inst = OMAP4430_CM2_IVAHD_INST, | 434 | .cm_inst = OMAP4430_CM2_IVAHD_INST, |
84 | .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS, | 435 | .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS, |
436 | .dep_bit = OMAP4430_IVAHD_STATDEP_SHIFT, | ||
437 | .wkdep_srcs = ivahd_wkup_sleep_deps, | ||
438 | .sleepdep_srcs = ivahd_wkup_sleep_deps, | ||
85 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 439 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
86 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 440 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
87 | }; | 441 | }; |
@@ -92,6 +446,9 @@ static struct clockdomain l4_secure_44xx_clkdm = { | |||
92 | .prcm_partition = OMAP4430_CM2_PARTITION, | 446 | .prcm_partition = OMAP4430_CM2_PARTITION, |
93 | .cm_inst = OMAP4430_CM2_L4PER_INST, | 447 | .cm_inst = OMAP4430_CM2_L4PER_INST, |
94 | .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS, | 448 | .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS, |
449 | .dep_bit = OMAP4430_L4SEC_STATDEP_SHIFT, | ||
450 | .wkdep_srcs = l4_secure_wkup_sleep_deps, | ||
451 | .sleepdep_srcs = l4_secure_wkup_sleep_deps, | ||
95 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 452 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
96 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 453 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
97 | }; | 454 | }; |
@@ -102,6 +459,7 @@ static struct clockdomain l4_per_44xx_clkdm = { | |||
102 | .prcm_partition = OMAP4430_CM2_PARTITION, | 459 | .prcm_partition = OMAP4430_CM2_PARTITION, |
103 | .cm_inst = OMAP4430_CM2_L4PER_INST, | 460 | .cm_inst = OMAP4430_CM2_L4PER_INST, |
104 | .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, | 461 | .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, |
462 | .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT, | ||
105 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 463 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
106 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 464 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
107 | }; | 465 | }; |
@@ -112,6 +470,7 @@ static struct clockdomain abe_44xx_clkdm = { | |||
112 | .prcm_partition = OMAP4430_CM1_PARTITION, | 470 | .prcm_partition = OMAP4430_CM1_PARTITION, |
113 | .cm_inst = OMAP4430_CM1_ABE_INST, | 471 | .cm_inst = OMAP4430_CM1_ABE_INST, |
114 | .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, | 472 | .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, |
473 | .dep_bit = OMAP4430_ABE_STATDEP_SHIFT, | ||
115 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 474 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
116 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 475 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
117 | }; | 476 | }; |
@@ -131,6 +490,9 @@ static struct clockdomain l3_init_44xx_clkdm = { | |||
131 | .prcm_partition = OMAP4430_CM2_PARTITION, | 490 | .prcm_partition = OMAP4430_CM2_PARTITION, |
132 | .cm_inst = OMAP4430_CM2_L3INIT_INST, | 491 | .cm_inst = OMAP4430_CM2_L3INIT_INST, |
133 | .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS, | 492 | .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS, |
493 | .dep_bit = OMAP4430_L3INIT_STATDEP_SHIFT, | ||
494 | .wkdep_srcs = l3_init_wkup_sleep_deps, | ||
495 | .sleepdep_srcs = l3_init_wkup_sleep_deps, | ||
134 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 496 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 497 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
136 | }; | 498 | }; |
@@ -141,6 +503,8 @@ static struct clockdomain mpuss_44xx_clkdm = { | |||
141 | .prcm_partition = OMAP4430_CM1_PARTITION, | 503 | .prcm_partition = OMAP4430_CM1_PARTITION, |
142 | .cm_inst = OMAP4430_CM1_MPU_INST, | 504 | .cm_inst = OMAP4430_CM1_MPU_INST, |
143 | .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS, | 505 | .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS, |
506 | .wkdep_srcs = mpuss_wkup_sleep_deps, | ||
507 | .sleepdep_srcs = mpuss_wkup_sleep_deps, | ||
144 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 508 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
145 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 509 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
146 | }; | 510 | }; |
@@ -150,7 +514,7 @@ static struct clockdomain mpu0_44xx_clkdm = { | |||
150 | .pwrdm = { .name = "cpu0_pwrdm" }, | 514 | .pwrdm = { .name = "cpu0_pwrdm" }, |
151 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, | 515 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
152 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, | 516 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, |
153 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS, | 517 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS, |
154 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 518 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
155 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 519 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
156 | }; | 520 | }; |
@@ -160,7 +524,7 @@ static struct clockdomain mpu1_44xx_clkdm = { | |||
160 | .pwrdm = { .name = "cpu1_pwrdm" }, | 524 | .pwrdm = { .name = "cpu1_pwrdm" }, |
161 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, | 525 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
162 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, | 526 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, |
163 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS, | 527 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS, |
164 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 528 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
165 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 529 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
166 | }; | 530 | }; |
@@ -171,6 +535,7 @@ static struct clockdomain l3_emif_44xx_clkdm = { | |||
171 | .prcm_partition = OMAP4430_CM2_PARTITION, | 535 | .prcm_partition = OMAP4430_CM2_PARTITION, |
172 | .cm_inst = OMAP4430_CM2_CORE_INST, | 536 | .cm_inst = OMAP4430_CM2_CORE_INST, |
173 | .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, | 537 | .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, |
538 | .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT, | ||
174 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 539 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
175 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 540 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
176 | }; | 541 | }; |
@@ -191,6 +556,9 @@ static struct clockdomain ducati_44xx_clkdm = { | |||
191 | .prcm_partition = OMAP4430_CM2_PARTITION, | 556 | .prcm_partition = OMAP4430_CM2_PARTITION, |
192 | .cm_inst = OMAP4430_CM2_CORE_INST, | 557 | .cm_inst = OMAP4430_CM2_CORE_INST, |
193 | .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS, | 558 | .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS, |
559 | .dep_bit = OMAP4430_DUCATI_STATDEP_SHIFT, | ||
560 | .wkdep_srcs = ducati_wkup_sleep_deps, | ||
561 | .sleepdep_srcs = ducati_wkup_sleep_deps, | ||
194 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 562 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
195 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 563 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
196 | }; | 564 | }; |
@@ -201,6 +569,7 @@ static struct clockdomain l3_2_44xx_clkdm = { | |||
201 | .prcm_partition = OMAP4430_CM2_PARTITION, | 569 | .prcm_partition = OMAP4430_CM2_PARTITION, |
202 | .cm_inst = OMAP4430_CM2_CORE_INST, | 570 | .cm_inst = OMAP4430_CM2_CORE_INST, |
203 | .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, | 571 | .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, |
572 | .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT, | ||
204 | .flags = CLKDM_CAN_HWSUP, | 573 | .flags = CLKDM_CAN_HWSUP, |
205 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 574 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
206 | }; | 575 | }; |
@@ -211,6 +580,7 @@ static struct clockdomain l3_1_44xx_clkdm = { | |||
211 | .prcm_partition = OMAP4430_CM2_PARTITION, | 580 | .prcm_partition = OMAP4430_CM2_PARTITION, |
212 | .cm_inst = OMAP4430_CM2_CORE_INST, | 581 | .cm_inst = OMAP4430_CM2_CORE_INST, |
213 | .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, | 582 | .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, |
583 | .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT, | ||
214 | .flags = CLKDM_CAN_HWSUP, | 584 | .flags = CLKDM_CAN_HWSUP, |
215 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 585 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
216 | }; | 586 | }; |
@@ -221,6 +591,8 @@ static struct clockdomain l3_d2d_44xx_clkdm = { | |||
221 | .prcm_partition = OMAP4430_CM2_PARTITION, | 591 | .prcm_partition = OMAP4430_CM2_PARTITION, |
222 | .cm_inst = OMAP4430_CM2_CORE_INST, | 592 | .cm_inst = OMAP4430_CM2_CORE_INST, |
223 | .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS, | 593 | .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS, |
594 | .wkdep_srcs = l3_d2d_wkup_sleep_deps, | ||
595 | .sleepdep_srcs = l3_d2d_wkup_sleep_deps, | ||
224 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 596 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
225 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 597 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
226 | }; | 598 | }; |
@@ -231,6 +603,8 @@ static struct clockdomain iss_44xx_clkdm = { | |||
231 | .prcm_partition = OMAP4430_CM2_PARTITION, | 603 | .prcm_partition = OMAP4430_CM2_PARTITION, |
232 | .cm_inst = OMAP4430_CM2_CAM_INST, | 604 | .cm_inst = OMAP4430_CM2_CAM_INST, |
233 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, | 605 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, |
606 | .wkdep_srcs = iss_wkup_sleep_deps, | ||
607 | .sleepdep_srcs = iss_wkup_sleep_deps, | ||
234 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 608 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
235 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 609 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
236 | }; | 610 | }; |
@@ -241,6 +615,9 @@ static struct clockdomain l3_dss_44xx_clkdm = { | |||
241 | .prcm_partition = OMAP4430_CM2_PARTITION, | 615 | .prcm_partition = OMAP4430_CM2_PARTITION, |
242 | .cm_inst = OMAP4430_CM2_DSS_INST, | 616 | .cm_inst = OMAP4430_CM2_DSS_INST, |
243 | .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS, | 617 | .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS, |
618 | .dep_bit = OMAP4430_DSS_STATDEP_SHIFT, | ||
619 | .wkdep_srcs = l3_dss_wkup_sleep_deps, | ||
620 | .sleepdep_srcs = l3_dss_wkup_sleep_deps, | ||
244 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 621 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
245 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 622 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
246 | }; | 623 | }; |
@@ -251,6 +628,7 @@ static struct clockdomain l4_wkup_44xx_clkdm = { | |||
251 | .prcm_partition = OMAP4430_PRM_PARTITION, | 628 | .prcm_partition = OMAP4430_PRM_PARTITION, |
252 | .cm_inst = OMAP4430_PRM_WKUP_CM_INST, | 629 | .cm_inst = OMAP4430_PRM_WKUP_CM_INST, |
253 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, | 630 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, |
631 | .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, | ||
254 | .flags = CLKDM_CAN_HWSUP, | 632 | .flags = CLKDM_CAN_HWSUP, |
255 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 633 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
256 | }; | 634 | }; |
@@ -271,6 +649,8 @@ static struct clockdomain l3_dma_44xx_clkdm = { | |||
271 | .prcm_partition = OMAP4430_CM2_PARTITION, | 649 | .prcm_partition = OMAP4430_CM2_PARTITION, |
272 | .cm_inst = OMAP4430_CM2_CORE_INST, | 650 | .cm_inst = OMAP4430_CM2_CORE_INST, |
273 | .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS, | 651 | .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS, |
652 | .wkdep_srcs = l3_dma_wkup_sleep_deps, | ||
653 | .sleepdep_srcs = l3_dma_wkup_sleep_deps, | ||
274 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 654 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
275 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 655 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
276 | }; | 656 | }; |
@@ -305,5 +685,5 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = { | |||
305 | 685 | ||
306 | void __init omap44xx_clockdomains_init(void) | 686 | void __init omap44xx_clockdomains_init(void) |
307 | { | 687 | { |
308 | clkdm_init(clockdomains_omap44xx, NULL); | 688 | clkdm_init(clockdomains_omap44xx, NULL, &omap4_clkdm_operations); |
309 | } | 689 | } |
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h index d70660e82fe6..686290437568 100644 --- a/arch/arm/mach-omap2/cm-regbits-24xx.h +++ b/arch/arm/mach-omap2/cm-regbits-24xx.h | |||
@@ -210,8 +210,11 @@ | |||
210 | #define OMAP24XX_AUTO_USB_MASK (1 << 0) | 210 | #define OMAP24XX_AUTO_USB_MASK (1 << 0) |
211 | 211 | ||
212 | /* CM_AUTOIDLE3_CORE */ | 212 | /* CM_AUTOIDLE3_CORE */ |
213 | #define OMAP24XX_AUTO_SDRC_SHIFT 2 | ||
213 | #define OMAP24XX_AUTO_SDRC_MASK (1 << 2) | 214 | #define OMAP24XX_AUTO_SDRC_MASK (1 << 2) |
215 | #define OMAP24XX_AUTO_GPMC_SHIFT 1 | ||
214 | #define OMAP24XX_AUTO_GPMC_MASK (1 << 1) | 216 | #define OMAP24XX_AUTO_GPMC_MASK (1 << 1) |
217 | #define OMAP24XX_AUTO_SDMA_SHIFT 0 | ||
215 | #define OMAP24XX_AUTO_SDMA_MASK (1 << 0) | 218 | #define OMAP24XX_AUTO_SDMA_MASK (1 << 0) |
216 | 219 | ||
217 | /* CM_AUTOIDLE4_CORE */ | 220 | /* CM_AUTOIDLE4_CORE */ |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c index 96954aa48671..9d0dec806e92 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c | |||
@@ -25,6 +25,14 @@ | |||
25 | #include "cm-regbits-24xx.h" | 25 | #include "cm-regbits-24xx.h" |
26 | #include "cm-regbits-34xx.h" | 26 | #include "cm-regbits-34xx.h" |
27 | 27 | ||
28 | /* CM_AUTOIDLE_PLL.AUTO_* bit values for DPLLs */ | ||
29 | #define DPLL_AUTOIDLE_DISABLE 0x0 | ||
30 | #define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3 | ||
31 | |||
32 | /* CM_AUTOIDLE_PLL.AUTO_* bit values for APLLs (OMAP2xxx only) */ | ||
33 | #define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0 | ||
34 | #define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3 | ||
35 | |||
28 | static const u8 cm_idlest_offs[] = { | 36 | static const u8 cm_idlest_offs[] = { |
29 | CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 | 37 | CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 |
30 | }; | 38 | }; |
@@ -125,6 +133,67 @@ void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask) | |||
125 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); | 133 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); |
126 | } | 134 | } |
127 | 135 | ||
136 | /* | ||
137 | * DPLL autoidle control | ||
138 | */ | ||
139 | |||
140 | static void _omap2xxx_set_dpll_autoidle(u8 m) | ||
141 | { | ||
142 | u32 v; | ||
143 | |||
144 | v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); | ||
145 | v &= ~OMAP24XX_AUTO_DPLL_MASK; | ||
146 | v |= m << OMAP24XX_AUTO_DPLL_SHIFT; | ||
147 | omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE); | ||
148 | } | ||
149 | |||
150 | void omap2xxx_cm_set_dpll_disable_autoidle(void) | ||
151 | { | ||
152 | _omap2xxx_set_dpll_autoidle(OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP); | ||
153 | } | ||
154 | |||
155 | void omap2xxx_cm_set_dpll_auto_low_power_stop(void) | ||
156 | { | ||
157 | _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE); | ||
158 | } | ||
159 | |||
160 | /* | ||
161 | * APLL autoidle control | ||
162 | */ | ||
163 | |||
164 | static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask) | ||
165 | { | ||
166 | u32 v; | ||
167 | |||
168 | v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); | ||
169 | v &= ~mask; | ||
170 | v |= m << __ffs(mask); | ||
171 | omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE); | ||
172 | } | ||
173 | |||
174 | void omap2xxx_cm_set_apll54_disable_autoidle(void) | ||
175 | { | ||
176 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, | ||
177 | OMAP24XX_AUTO_54M_MASK); | ||
178 | } | ||
179 | |||
180 | void omap2xxx_cm_set_apll54_auto_low_power_stop(void) | ||
181 | { | ||
182 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, | ||
183 | OMAP24XX_AUTO_54M_MASK); | ||
184 | } | ||
185 | |||
186 | void omap2xxx_cm_set_apll96_disable_autoidle(void) | ||
187 | { | ||
188 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, | ||
189 | OMAP24XX_AUTO_96M_MASK); | ||
190 | } | ||
191 | |||
192 | void omap2xxx_cm_set_apll96_auto_low_power_stop(void) | ||
193 | { | ||
194 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, | ||
195 | OMAP24XX_AUTO_96M_MASK); | ||
196 | } | ||
128 | 197 | ||
129 | /* | 198 | /* |
130 | * | 199 | * |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h index 5e9ea5bd60b9..088bbad73db5 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h | |||
@@ -122,6 +122,14 @@ extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); | |||
122 | extern void omap3xxx_cm_clkdm_force_sleep(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); | 123 | extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); |
124 | 124 | ||
125 | extern void omap2xxx_cm_set_dpll_disable_autoidle(void); | ||
126 | extern void omap2xxx_cm_set_dpll_auto_low_power_stop(void); | ||
127 | |||
128 | extern void omap2xxx_cm_set_apll54_disable_autoidle(void); | ||
129 | extern void omap2xxx_cm_set_apll54_auto_low_power_stop(void); | ||
130 | extern void omap2xxx_cm_set_apll96_disable_autoidle(void); | ||
131 | extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void); | ||
132 | |||
125 | #endif | 133 | #endif |
126 | 134 | ||
127 | /* CM register bits shared between 24XX and 3430 */ | 135 | /* CM register bits shared between 24XX and 3430 */ |
diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h index 48fc3f426fbd..0b87ec82b41c 100644 --- a/arch/arm/mach-omap2/cm44xx.h +++ b/arch/arm/mach-omap2/cm44xx.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "cm.h" | 21 | #include "cm.h" |
22 | 22 | ||
23 | #define OMAP4_CM_CLKSTCTRL 0x0000 | 23 | #define OMAP4_CM_CLKSTCTRL 0x0000 |
24 | #define OMAP4_CM_STATICDEP 0x0004 | ||
24 | 25 | ||
25 | /* Function prototypes */ | 26 | /* Function prototypes */ |
26 | # ifndef __ASSEMBLER__ | 27 | # ifndef __ASSEMBLER__ |
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index c04bbbea17a5..a482bfa0a954 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c | |||
@@ -73,6 +73,27 @@ u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst, | |||
73 | return v; | 73 | return v; |
74 | } | 74 | } |
75 | 75 | ||
76 | u32 omap4_cminst_set_inst_reg_bits(u32 bits, u8 part, s16 inst, s16 idx) | ||
77 | { | ||
78 | return omap4_cminst_rmw_inst_reg_bits(bits, bits, part, inst, idx); | ||
79 | } | ||
80 | |||
81 | u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst, s16 idx) | ||
82 | { | ||
83 | return omap4_cminst_rmw_inst_reg_bits(bits, 0x0, part, inst, idx); | ||
84 | } | ||
85 | |||
86 | u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx, u32 mask) | ||
87 | { | ||
88 | u32 v; | ||
89 | |||
90 | v = omap4_cminst_read_inst_reg(part, inst, idx); | ||
91 | v &= mask; | ||
92 | v >>= __ffs(mask); | ||
93 | |||
94 | return v; | ||
95 | } | ||
96 | |||
76 | /* | 97 | /* |
77 | * | 98 | * |
78 | */ | 99 | */ |
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h index a6abd0a8cb82..2b32c181a2ee 100644 --- a/arch/arm/mach-omap2/cminst44xx.h +++ b/arch/arm/mach-omap2/cminst44xx.h | |||
@@ -25,6 +25,12 @@ 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); | 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, | 26 | extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, |
27 | s16 inst, s16 idx); | 27 | s16 inst, s16 idx); |
28 | extern u32 omap4_cminst_set_inst_reg_bits(u32 bits, u8 part, s16 inst, | ||
29 | s16 idx); | ||
30 | extern u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst, | ||
31 | s16 idx); | ||
32 | extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx, | ||
33 | u32 mask); | ||
28 | 34 | ||
29 | extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg); | 35 | extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg); |
30 | 36 | ||
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c index 778929f7e92d..3f20cbb9967b 100644 --- a/arch/arm/mach-omap2/common.c +++ b/arch/arm/mach-omap2/common.c | |||
@@ -40,7 +40,7 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals) | |||
40 | 40 | ||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #if defined(CONFIG_ARCH_OMAP2420) | 43 | #if defined(CONFIG_SOC_OMAP2420) |
44 | 44 | ||
45 | static struct omap_globals omap242x_globals = { | 45 | static struct omap_globals omap242x_globals = { |
46 | .class = OMAP242X_CLASS, | 46 | .class = OMAP242X_CLASS, |
@@ -50,9 +50,6 @@ static struct omap_globals omap242x_globals = { | |||
50 | .ctrl = OMAP242X_CTRL_BASE, | 50 | .ctrl = OMAP242X_CTRL_BASE, |
51 | .prm = OMAP2420_PRM_BASE, | 51 | .prm = OMAP2420_PRM_BASE, |
52 | .cm = OMAP2420_CM_BASE, | 52 | .cm = OMAP2420_CM_BASE, |
53 | .uart1_phys = OMAP2_UART1_BASE, | ||
54 | .uart2_phys = OMAP2_UART2_BASE, | ||
55 | .uart3_phys = OMAP2_UART3_BASE, | ||
56 | }; | 53 | }; |
57 | 54 | ||
58 | void __init omap2_set_globals_242x(void) | 55 | void __init omap2_set_globals_242x(void) |
@@ -61,7 +58,7 @@ void __init omap2_set_globals_242x(void) | |||
61 | } | 58 | } |
62 | #endif | 59 | #endif |
63 | 60 | ||
64 | #if defined(CONFIG_ARCH_OMAP2430) | 61 | #if defined(CONFIG_SOC_OMAP2430) |
65 | 62 | ||
66 | static struct omap_globals omap243x_globals = { | 63 | static struct omap_globals omap243x_globals = { |
67 | .class = OMAP243X_CLASS, | 64 | .class = OMAP243X_CLASS, |
@@ -71,9 +68,6 @@ static struct omap_globals omap243x_globals = { | |||
71 | .ctrl = OMAP243X_CTRL_BASE, | 68 | .ctrl = OMAP243X_CTRL_BASE, |
72 | .prm = OMAP2430_PRM_BASE, | 69 | .prm = OMAP2430_PRM_BASE, |
73 | .cm = OMAP2430_CM_BASE, | 70 | .cm = OMAP2430_CM_BASE, |
74 | .uart1_phys = OMAP2_UART1_BASE, | ||
75 | .uart2_phys = OMAP2_UART2_BASE, | ||
76 | .uart3_phys = OMAP2_UART3_BASE, | ||
77 | }; | 71 | }; |
78 | 72 | ||
79 | void __init omap2_set_globals_243x(void) | 73 | void __init omap2_set_globals_243x(void) |
@@ -92,10 +86,6 @@ static struct omap_globals omap3_globals = { | |||
92 | .ctrl = OMAP343X_CTRL_BASE, | 86 | .ctrl = OMAP343X_CTRL_BASE, |
93 | .prm = OMAP3430_PRM_BASE, | 87 | .prm = OMAP3430_PRM_BASE, |
94 | .cm = OMAP3430_CM_BASE, | 88 | .cm = OMAP3430_CM_BASE, |
95 | .uart1_phys = OMAP3_UART1_BASE, | ||
96 | .uart2_phys = OMAP3_UART2_BASE, | ||
97 | .uart3_phys = OMAP3_UART3_BASE, | ||
98 | .uart4_phys = OMAP3_UART4_BASE, /* Only on 3630 */ | ||
99 | }; | 89 | }; |
100 | 90 | ||
101 | void __init omap2_set_globals_3xxx(void) | 91 | void __init omap2_set_globals_3xxx(void) |
@@ -108,6 +98,27 @@ void __init omap3_map_io(void) | |||
108 | omap2_set_globals_3xxx(); | 98 | omap2_set_globals_3xxx(); |
109 | omap34xx_map_common_io(); | 99 | omap34xx_map_common_io(); |
110 | } | 100 | } |
101 | |||
102 | /* | ||
103 | * Adjust TAP register base such that omap3_check_revision accesses the correct | ||
104 | * TI816X register for checking device ID (it adds 0x204 to tap base while | ||
105 | * TI816X DEVICE ID register is at offset 0x600 from control base). | ||
106 | */ | ||
107 | #define TI816X_TAP_BASE (TI816X_CTRL_BASE + \ | ||
108 | TI816X_CONTROL_DEVICE_ID - 0x204) | ||
109 | |||
110 | static struct omap_globals ti816x_globals = { | ||
111 | .class = OMAP343X_CLASS, | ||
112 | .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE), | ||
113 | .ctrl = TI816X_CTRL_BASE, | ||
114 | .prm = TI816X_PRCM_BASE, | ||
115 | .cm = TI816X_PRCM_BASE, | ||
116 | }; | ||
117 | |||
118 | void __init omap2_set_globals_ti816x(void) | ||
119 | { | ||
120 | __omap2_set_globals(&ti816x_globals); | ||
121 | } | ||
111 | #endif | 122 | #endif |
112 | 123 | ||
113 | #if defined(CONFIG_ARCH_OMAP4) | 124 | #if defined(CONFIG_ARCH_OMAP4) |
@@ -119,10 +130,6 @@ static struct omap_globals omap4_globals = { | |||
119 | .prm = OMAP4430_PRM_BASE, | 130 | .prm = OMAP4430_PRM_BASE, |
120 | .cm = OMAP4430_CM_BASE, | 131 | .cm = OMAP4430_CM_BASE, |
121 | .cm2 = OMAP4430_CM2_BASE, | 132 | .cm2 = OMAP4430_CM2_BASE, |
122 | .uart1_phys = OMAP4_UART1_BASE, | ||
123 | .uart2_phys = OMAP4_UART2_BASE, | ||
124 | .uart3_phys = OMAP4_UART3_BASE, | ||
125 | .uart4_phys = OMAP4_UART4_BASE, | ||
126 | }; | 133 | }; |
127 | 134 | ||
128 | void __init omap2_set_globals_443x(void) | 135 | void __init omap2_set_globals_443x(void) |
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index f0629ae04102..c2804c1c4efd 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h | |||
@@ -52,6 +52,9 @@ | |||
52 | #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00 | 52 | #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00 |
53 | #define OMAP343X_CONTROL_GENERAL_WKUP 0xa60 | 53 | #define OMAP343X_CONTROL_GENERAL_WKUP 0xa60 |
54 | 54 | ||
55 | /* TI816X spefic control submodules */ | ||
56 | #define TI816X_CONTROL_DEVCONF 0x600 | ||
57 | |||
55 | /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */ | 58 | /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */ |
56 | 59 | ||
57 | #define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10) | 60 | #define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10) |
@@ -241,6 +244,9 @@ | |||
241 | #define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 | 244 | #define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 |
242 | #define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 | 245 | #define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 |
243 | 246 | ||
247 | /* TI816X CONTROL_DEVCONF register offsets */ | ||
248 | #define TI816X_CONTROL_DEVICE_ID (TI816X_CONTROL_DEVCONF + 0x000) | ||
249 | |||
244 | /* | 250 | /* |
245 | * REVISIT: This list of registers is not comprehensive - there are more | 251 | * REVISIT: This list of registers is not comprehensive - there are more |
246 | * that should be added. | 252 | * that should be added. |
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index f7b22a16f385..a44c52303405 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -58,6 +58,7 @@ struct omap3_processor_cx { | |||
58 | u32 core_state; | 58 | u32 core_state; |
59 | u32 threshold; | 59 | u32 threshold; |
60 | u32 flags; | 60 | u32 flags; |
61 | const char *desc; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES]; | 64 | struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES]; |
@@ -99,14 +100,14 @@ static int omap3_idle_bm_check(void) | |||
99 | static int _cpuidle_allow_idle(struct powerdomain *pwrdm, | 100 | static int _cpuidle_allow_idle(struct powerdomain *pwrdm, |
100 | struct clockdomain *clkdm) | 101 | struct clockdomain *clkdm) |
101 | { | 102 | { |
102 | omap2_clkdm_allow_idle(clkdm); | 103 | clkdm_allow_idle(clkdm); |
103 | return 0; | 104 | return 0; |
104 | } | 105 | } |
105 | 106 | ||
106 | static int _cpuidle_deny_idle(struct powerdomain *pwrdm, | 107 | static int _cpuidle_deny_idle(struct powerdomain *pwrdm, |
107 | struct clockdomain *clkdm) | 108 | struct clockdomain *clkdm) |
108 | { | 109 | { |
109 | omap2_clkdm_deny_idle(clkdm); | 110 | clkdm_deny_idle(clkdm); |
110 | return 0; | 111 | return 0; |
111 | } | 112 | } |
112 | 113 | ||
@@ -365,6 +366,7 @@ void omap_init_power_states(void) | |||
365 | omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; | 366 | omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; |
366 | omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; | 367 | omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; |
367 | omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; | 368 | omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; |
369 | omap3_power_states[OMAP3_STATE_C1].desc = "MPU ON + CORE ON"; | ||
368 | 370 | ||
369 | /* C2 . MPU WFI + Core inactive */ | 371 | /* C2 . MPU WFI + Core inactive */ |
370 | omap3_power_states[OMAP3_STATE_C2].valid = | 372 | omap3_power_states[OMAP3_STATE_C2].valid = |
@@ -380,6 +382,7 @@ void omap_init_power_states(void) | |||
380 | omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; | 382 | omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; |
381 | omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID | | 383 | omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID | |
382 | CPUIDLE_FLAG_CHECK_BM; | 384 | CPUIDLE_FLAG_CHECK_BM; |
385 | omap3_power_states[OMAP3_STATE_C2].desc = "MPU ON + CORE ON"; | ||
383 | 386 | ||
384 | /* C3 . MPU CSWR + Core inactive */ | 387 | /* C3 . MPU CSWR + Core inactive */ |
385 | omap3_power_states[OMAP3_STATE_C3].valid = | 388 | omap3_power_states[OMAP3_STATE_C3].valid = |
@@ -395,6 +398,7 @@ void omap_init_power_states(void) | |||
395 | omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; | 398 | omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; |
396 | omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | | 399 | omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | |
397 | CPUIDLE_FLAG_CHECK_BM; | 400 | CPUIDLE_FLAG_CHECK_BM; |
401 | omap3_power_states[OMAP3_STATE_C3].desc = "MPU RET + CORE ON"; | ||
398 | 402 | ||
399 | /* C4 . MPU OFF + Core inactive */ | 403 | /* C4 . MPU OFF + Core inactive */ |
400 | omap3_power_states[OMAP3_STATE_C4].valid = | 404 | omap3_power_states[OMAP3_STATE_C4].valid = |
@@ -410,6 +414,7 @@ void omap_init_power_states(void) | |||
410 | omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; | 414 | omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; |
411 | omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | | 415 | omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | |
412 | CPUIDLE_FLAG_CHECK_BM; | 416 | CPUIDLE_FLAG_CHECK_BM; |
417 | omap3_power_states[OMAP3_STATE_C4].desc = "MPU OFF + CORE ON"; | ||
413 | 418 | ||
414 | /* C5 . MPU CSWR + Core CSWR*/ | 419 | /* C5 . MPU CSWR + Core CSWR*/ |
415 | omap3_power_states[OMAP3_STATE_C5].valid = | 420 | omap3_power_states[OMAP3_STATE_C5].valid = |
@@ -425,6 +430,7 @@ void omap_init_power_states(void) | |||
425 | omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; | 430 | omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; |
426 | omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | | 431 | omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | |
427 | CPUIDLE_FLAG_CHECK_BM; | 432 | CPUIDLE_FLAG_CHECK_BM; |
433 | omap3_power_states[OMAP3_STATE_C5].desc = "MPU RET + CORE RET"; | ||
428 | 434 | ||
429 | /* C6 . MPU OFF + Core CSWR */ | 435 | /* C6 . MPU OFF + Core CSWR */ |
430 | omap3_power_states[OMAP3_STATE_C6].valid = | 436 | omap3_power_states[OMAP3_STATE_C6].valid = |
@@ -440,6 +446,7 @@ void omap_init_power_states(void) | |||
440 | omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; | 446 | omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; |
441 | omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | | 447 | omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | |
442 | CPUIDLE_FLAG_CHECK_BM; | 448 | CPUIDLE_FLAG_CHECK_BM; |
449 | omap3_power_states[OMAP3_STATE_C6].desc = "MPU OFF + CORE RET"; | ||
443 | 450 | ||
444 | /* C7 . MPU OFF + Core OFF */ | 451 | /* C7 . MPU OFF + Core OFF */ |
445 | omap3_power_states[OMAP3_STATE_C7].valid = | 452 | omap3_power_states[OMAP3_STATE_C7].valid = |
@@ -455,6 +462,7 @@ void omap_init_power_states(void) | |||
455 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; | 462 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; |
456 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | | 463 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | |
457 | CPUIDLE_FLAG_CHECK_BM; | 464 | CPUIDLE_FLAG_CHECK_BM; |
465 | omap3_power_states[OMAP3_STATE_C7].desc = "MPU OFF + CORE OFF"; | ||
458 | 466 | ||
459 | /* | 467 | /* |
460 | * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot | 468 | * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot |
@@ -464,7 +472,7 @@ void omap_init_power_states(void) | |||
464 | if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) { | 472 | if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) { |
465 | omap3_power_states[OMAP3_STATE_C7].valid = 0; | 473 | omap3_power_states[OMAP3_STATE_C7].valid = 0; |
466 | cpuidle_params_table[OMAP3_STATE_C7].valid = 0; | 474 | cpuidle_params_table[OMAP3_STATE_C7].valid = 0; |
467 | WARN_ONCE(1, "%s: core off state C7 disabled due to i583\n", | 475 | pr_warn("%s: core off state C7 disabled due to i583\n", |
468 | __func__); | 476 | __func__); |
469 | } | 477 | } |
470 | } | 478 | } |
@@ -512,6 +520,7 @@ int __init omap3_idle_init(void) | |||
512 | if (cx->type == OMAP3_STATE_C1) | 520 | if (cx->type == OMAP3_STATE_C1) |
513 | dev->safe_state = state; | 521 | dev->safe_state = state; |
514 | sprintf(state->name, "C%d", count+1); | 522 | sprintf(state->name, "C%d", count+1); |
523 | strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); | ||
515 | count++; | 524 | count++; |
516 | } | 525 | } |
517 | 526 | ||
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2c9c912f2c42..0d2d6a9c303c 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/slab.h> | ||
18 | 19 | ||
19 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
20 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
@@ -30,10 +31,75 @@ | |||
30 | #include <plat/dma.h> | 31 | #include <plat/dma.h> |
31 | #include <plat/omap_hwmod.h> | 32 | #include <plat/omap_hwmod.h> |
32 | #include <plat/omap_device.h> | 33 | #include <plat/omap_device.h> |
34 | #include <plat/omap4-keypad.h> | ||
33 | 35 | ||
34 | #include "mux.h" | 36 | #include "mux.h" |
35 | #include "control.h" | 37 | #include "control.h" |
36 | 38 | ||
39 | #define L3_MODULES_MAX_LEN 12 | ||
40 | #define L3_MODULES 3 | ||
41 | |||
42 | static int __init omap3_l3_init(void) | ||
43 | { | ||
44 | int l; | ||
45 | struct omap_hwmod *oh; | ||
46 | struct omap_device *od; | ||
47 | char oh_name[L3_MODULES_MAX_LEN]; | ||
48 | |||
49 | /* | ||
50 | * To avoid code running on other OMAPs in | ||
51 | * multi-omap builds | ||
52 | */ | ||
53 | if (!(cpu_is_omap34xx())) | ||
54 | return -ENODEV; | ||
55 | |||
56 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main"); | ||
57 | |||
58 | oh = omap_hwmod_lookup(oh_name); | ||
59 | |||
60 | if (!oh) | ||
61 | pr_err("could not look up %s\n", oh_name); | ||
62 | |||
63 | od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0, | ||
64 | NULL, 0, 0); | ||
65 | |||
66 | WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); | ||
67 | |||
68 | return PTR_ERR(od); | ||
69 | } | ||
70 | postcore_initcall(omap3_l3_init); | ||
71 | |||
72 | static int __init omap4_l3_init(void) | ||
73 | { | ||
74 | int l, i; | ||
75 | struct omap_hwmod *oh[3]; | ||
76 | struct omap_device *od; | ||
77 | char oh_name[L3_MODULES_MAX_LEN]; | ||
78 | |||
79 | /* | ||
80 | * To avoid code running on other OMAPs in | ||
81 | * multi-omap builds | ||
82 | */ | ||
83 | if (!(cpu_is_omap44xx())) | ||
84 | return -ENODEV; | ||
85 | |||
86 | for (i = 0; i < L3_MODULES; i++) { | ||
87 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1); | ||
88 | |||
89 | oh[i] = omap_hwmod_lookup(oh_name); | ||
90 | if (!(oh[i])) | ||
91 | pr_err("could not look up %s\n", oh_name); | ||
92 | } | ||
93 | |||
94 | od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, | ||
95 | 0, NULL, 0, 0); | ||
96 | |||
97 | WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); | ||
98 | |||
99 | return PTR_ERR(od); | ||
100 | } | ||
101 | postcore_initcall(omap4_l3_init); | ||
102 | |||
37 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) | 103 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
38 | 104 | ||
39 | static struct resource cam_resources[] = { | 105 | static struct resource cam_resources[] = { |
@@ -141,96 +207,70 @@ static inline void omap_init_camera(void) | |||
141 | } | 207 | } |
142 | #endif | 208 | #endif |
143 | 209 | ||
144 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | 210 | struct omap_device_pm_latency omap_keyboard_latency[] = { |
145 | |||
146 | #define MBOX_REG_SIZE 0x120 | ||
147 | |||
148 | #ifdef CONFIG_ARCH_OMAP2 | ||
149 | static struct resource omap2_mbox_resources[] = { | ||
150 | { | ||
151 | .start = OMAP24XX_MAILBOX_BASE, | ||
152 | .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | ||
153 | .flags = IORESOURCE_MEM, | ||
154 | }, | ||
155 | { | ||
156 | .start = INT_24XX_MAIL_U0_MPU, | ||
157 | .flags = IORESOURCE_IRQ, | ||
158 | .name = "dsp", | ||
159 | }, | ||
160 | { | 211 | { |
161 | .start = INT_24XX_MAIL_U3_MPU, | 212 | .deactivate_func = omap_device_idle_hwmods, |
162 | .flags = IORESOURCE_IRQ, | 213 | .activate_func = omap_device_enable_hwmods, |
163 | .name = "iva", | 214 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, |
164 | }, | 215 | }, |
165 | }; | 216 | }; |
166 | static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources); | ||
167 | #else | ||
168 | #define omap2_mbox_resources NULL | ||
169 | #define omap2_mbox_resources_sz 0 | ||
170 | #endif | ||
171 | 217 | ||
172 | #ifdef CONFIG_ARCH_OMAP3 | 218 | int __init omap4_keyboard_init(struct omap4_keypad_platform_data |
173 | static struct resource omap3_mbox_resources[] = { | 219 | *sdp4430_keypad_data) |
174 | { | 220 | { |
175 | .start = OMAP34XX_MAILBOX_BASE, | 221 | struct omap_device *od; |
176 | .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | 222 | struct omap_hwmod *oh; |
177 | .flags = IORESOURCE_MEM, | 223 | struct omap4_keypad_platform_data *keypad_data; |
178 | }, | 224 | unsigned int id = -1; |
179 | { | 225 | char *oh_name = "kbd"; |
180 | .start = INT_24XX_MAIL_U0_MPU, | 226 | char *name = "omap4-keypad"; |
181 | .flags = IORESOURCE_IRQ, | ||
182 | .name = "dsp", | ||
183 | }, | ||
184 | }; | ||
185 | static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources); | ||
186 | #else | ||
187 | #define omap3_mbox_resources NULL | ||
188 | #define omap3_mbox_resources_sz 0 | ||
189 | #endif | ||
190 | 227 | ||
191 | #ifdef CONFIG_ARCH_OMAP4 | 228 | oh = omap_hwmod_lookup(oh_name); |
229 | if (!oh) { | ||
230 | pr_err("Could not look up %s\n", oh_name); | ||
231 | return -ENODEV; | ||
232 | } | ||
192 | 233 | ||
193 | #define OMAP4_MBOX_REG_SIZE 0x130 | 234 | keypad_data = sdp4430_keypad_data; |
194 | static struct resource omap4_mbox_resources[] = { | ||
195 | { | ||
196 | .start = OMAP44XX_MAILBOX_BASE, | ||
197 | .end = OMAP44XX_MAILBOX_BASE + | ||
198 | OMAP4_MBOX_REG_SIZE - 1, | ||
199 | .flags = IORESOURCE_MEM, | ||
200 | }, | ||
201 | { | ||
202 | .start = OMAP44XX_IRQ_MAIL_U0, | ||
203 | .flags = IORESOURCE_IRQ, | ||
204 | .name = "mbox", | ||
205 | }, | ||
206 | }; | ||
207 | static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources); | ||
208 | #else | ||
209 | #define omap4_mbox_resources NULL | ||
210 | #define omap4_mbox_resources_sz 0 | ||
211 | #endif | ||
212 | 235 | ||
213 | static struct platform_device mbox_device = { | 236 | od = omap_device_build(name, id, oh, keypad_data, |
214 | .name = "omap-mailbox", | 237 | sizeof(struct omap4_keypad_platform_data), |
215 | .id = -1, | 238 | omap_keyboard_latency, |
239 | ARRAY_SIZE(omap_keyboard_latency), 0); | ||
240 | |||
241 | if (IS_ERR(od)) { | ||
242 | WARN(1, "Cant build omap_device for %s:%s.\n", | ||
243 | name, oh->name); | ||
244 | return PTR_ERR(od); | ||
245 | } | ||
246 | |||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | ||
251 | static struct omap_device_pm_latency mbox_latencies[] = { | ||
252 | [0] = { | ||
253 | .activate_func = omap_device_enable_hwmods, | ||
254 | .deactivate_func = omap_device_idle_hwmods, | ||
255 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
256 | }, | ||
216 | }; | 257 | }; |
217 | 258 | ||
218 | static inline void omap_init_mbox(void) | 259 | static inline void omap_init_mbox(void) |
219 | { | 260 | { |
220 | if (cpu_is_omap24xx()) { | 261 | struct omap_hwmod *oh; |
221 | mbox_device.resource = omap2_mbox_resources; | 262 | struct omap_device *od; |
222 | mbox_device.num_resources = omap2_mbox_resources_sz; | 263 | |
223 | } else if (cpu_is_omap34xx()) { | 264 | oh = omap_hwmod_lookup("mailbox"); |
224 | mbox_device.resource = omap3_mbox_resources; | 265 | if (!oh) { |
225 | mbox_device.num_resources = omap3_mbox_resources_sz; | 266 | pr_err("%s: unable to find hwmod\n", __func__); |
226 | } else if (cpu_is_omap44xx()) { | ||
227 | mbox_device.resource = omap4_mbox_resources; | ||
228 | mbox_device.num_resources = omap4_mbox_resources_sz; | ||
229 | } else { | ||
230 | pr_err("%s: platform not supported\n", __func__); | ||
231 | return; | 267 | return; |
232 | } | 268 | } |
233 | platform_device_register(&mbox_device); | 269 | |
270 | od = omap_device_build("omap-mailbox", -1, oh, NULL, 0, | ||
271 | mbox_latencies, ARRAY_SIZE(mbox_latencies), 0); | ||
272 | WARN(IS_ERR(od), "%s: could not build device, err %ld\n", | ||
273 | __func__, PTR_ERR(od)); | ||
234 | } | 274 | } |
235 | #else | 275 | #else |
236 | static inline void omap_init_mbox(void) { } | 276 | static inline void omap_init_mbox(void) { } |
@@ -279,163 +319,55 @@ static inline void omap_init_audio(void) {} | |||
279 | 319 | ||
280 | #include <plat/mcspi.h> | 320 | #include <plat/mcspi.h> |
281 | 321 | ||
282 | #define OMAP2_MCSPI1_BASE 0x48098000 | 322 | struct omap_device_pm_latency omap_mcspi_latency[] = { |
283 | #define OMAP2_MCSPI2_BASE 0x4809a000 | 323 | [0] = { |
284 | #define OMAP2_MCSPI3_BASE 0x480b8000 | 324 | .deactivate_func = omap_device_idle_hwmods, |
285 | #define OMAP2_MCSPI4_BASE 0x480ba000 | 325 | .activate_func = omap_device_enable_hwmods, |
286 | 326 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | |
287 | #define OMAP4_MCSPI1_BASE 0x48098100 | ||
288 | #define OMAP4_MCSPI2_BASE 0x4809a100 | ||
289 | #define OMAP4_MCSPI3_BASE 0x480b8100 | ||
290 | #define OMAP4_MCSPI4_BASE 0x480ba100 | ||
291 | |||
292 | static struct omap2_mcspi_platform_config omap2_mcspi1_config = { | ||
293 | .num_cs = 4, | ||
294 | }; | ||
295 | |||
296 | static struct resource omap2_mcspi1_resources[] = { | ||
297 | { | ||
298 | .start = OMAP2_MCSPI1_BASE, | ||
299 | .end = OMAP2_MCSPI1_BASE + 0xff, | ||
300 | .flags = IORESOURCE_MEM, | ||
301 | }, | ||
302 | }; | ||
303 | |||
304 | static struct platform_device omap2_mcspi1 = { | ||
305 | .name = "omap2_mcspi", | ||
306 | .id = 1, | ||
307 | .num_resources = ARRAY_SIZE(omap2_mcspi1_resources), | ||
308 | .resource = omap2_mcspi1_resources, | ||
309 | .dev = { | ||
310 | .platform_data = &omap2_mcspi1_config, | ||
311 | }, | ||
312 | }; | ||
313 | |||
314 | static struct omap2_mcspi_platform_config omap2_mcspi2_config = { | ||
315 | .num_cs = 2, | ||
316 | }; | ||
317 | |||
318 | static struct resource omap2_mcspi2_resources[] = { | ||
319 | { | ||
320 | .start = OMAP2_MCSPI2_BASE, | ||
321 | .end = OMAP2_MCSPI2_BASE + 0xff, | ||
322 | .flags = IORESOURCE_MEM, | ||
323 | }, | ||
324 | }; | ||
325 | |||
326 | static struct platform_device omap2_mcspi2 = { | ||
327 | .name = "omap2_mcspi", | ||
328 | .id = 2, | ||
329 | .num_resources = ARRAY_SIZE(omap2_mcspi2_resources), | ||
330 | .resource = omap2_mcspi2_resources, | ||
331 | .dev = { | ||
332 | .platform_data = &omap2_mcspi2_config, | ||
333 | }, | ||
334 | }; | ||
335 | |||
336 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ | ||
337 | defined(CONFIG_ARCH_OMAP4) | ||
338 | static struct omap2_mcspi_platform_config omap2_mcspi3_config = { | ||
339 | .num_cs = 2, | ||
340 | }; | ||
341 | |||
342 | static struct resource omap2_mcspi3_resources[] = { | ||
343 | { | ||
344 | .start = OMAP2_MCSPI3_BASE, | ||
345 | .end = OMAP2_MCSPI3_BASE + 0xff, | ||
346 | .flags = IORESOURCE_MEM, | ||
347 | }, | ||
348 | }; | ||
349 | |||
350 | static struct platform_device omap2_mcspi3 = { | ||
351 | .name = "omap2_mcspi", | ||
352 | .id = 3, | ||
353 | .num_resources = ARRAY_SIZE(omap2_mcspi3_resources), | ||
354 | .resource = omap2_mcspi3_resources, | ||
355 | .dev = { | ||
356 | .platform_data = &omap2_mcspi3_config, | ||
357 | }, | ||
358 | }; | ||
359 | #endif | ||
360 | |||
361 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | ||
362 | static struct omap2_mcspi_platform_config omap2_mcspi4_config = { | ||
363 | .num_cs = 1, | ||
364 | }; | ||
365 | |||
366 | static struct resource omap2_mcspi4_resources[] = { | ||
367 | { | ||
368 | .start = OMAP2_MCSPI4_BASE, | ||
369 | .end = OMAP2_MCSPI4_BASE + 0xff, | ||
370 | .flags = IORESOURCE_MEM, | ||
371 | }, | ||
372 | }; | ||
373 | |||
374 | static struct platform_device omap2_mcspi4 = { | ||
375 | .name = "omap2_mcspi", | ||
376 | .id = 4, | ||
377 | .num_resources = ARRAY_SIZE(omap2_mcspi4_resources), | ||
378 | .resource = omap2_mcspi4_resources, | ||
379 | .dev = { | ||
380 | .platform_data = &omap2_mcspi4_config, | ||
381 | }, | 327 | }, |
382 | }; | 328 | }; |
383 | #endif | ||
384 | 329 | ||
385 | #ifdef CONFIG_ARCH_OMAP4 | 330 | static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) |
386 | static inline void omap4_mcspi_fixup(void) | ||
387 | { | 331 | { |
388 | omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; | 332 | struct omap_device *od; |
389 | omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; | 333 | char *name = "omap2_mcspi"; |
390 | omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; | 334 | struct omap2_mcspi_platform_config *pdata; |
391 | omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; | 335 | static int spi_num; |
392 | omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; | 336 | struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr; |
393 | omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; | 337 | |
394 | omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; | 338 | pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); |
395 | omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; | 339 | if (!pdata) { |
396 | } | 340 | pr_err("Memory allocation for McSPI device failed\n"); |
397 | #else | 341 | return -ENOMEM; |
398 | static inline void omap4_mcspi_fixup(void) | 342 | } |
399 | { | ||
400 | } | ||
401 | #endif | ||
402 | 343 | ||
403 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ | 344 | pdata->num_cs = mcspi_attrib->num_chipselect; |
404 | defined(CONFIG_ARCH_OMAP4) | 345 | switch (oh->class->rev) { |
405 | static inline void omap2_mcspi3_init(void) | 346 | case OMAP2_MCSPI_REV: |
406 | { | 347 | case OMAP3_MCSPI_REV: |
407 | platform_device_register(&omap2_mcspi3); | 348 | pdata->regs_offset = 0; |
408 | } | 349 | break; |
409 | #else | 350 | case OMAP4_MCSPI_REV: |
410 | static inline void omap2_mcspi3_init(void) | 351 | pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET; |
411 | { | 352 | break; |
412 | } | 353 | default: |
413 | #endif | 354 | pr_err("Invalid McSPI Revision value\n"); |
355 | return -EINVAL; | ||
356 | } | ||
414 | 357 | ||
415 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 358 | spi_num++; |
416 | static inline void omap2_mcspi4_init(void) | 359 | od = omap_device_build(name, spi_num, oh, pdata, |
417 | { | 360 | sizeof(*pdata), omap_mcspi_latency, |
418 | platform_device_register(&omap2_mcspi4); | 361 | ARRAY_SIZE(omap_mcspi_latency), 0); |
419 | } | 362 | WARN(IS_ERR(od), "Cant build omap_device for %s:%s\n", |
420 | #else | 363 | name, oh->name); |
421 | static inline void omap2_mcspi4_init(void) | 364 | kfree(pdata); |
422 | { | 365 | return 0; |
423 | } | 366 | } |
424 | #endif | ||
425 | 367 | ||
426 | static void omap_init_mcspi(void) | 368 | static void omap_init_mcspi(void) |
427 | { | 369 | { |
428 | if (cpu_is_omap44xx()) | 370 | omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL); |
429 | omap4_mcspi_fixup(); | ||
430 | |||
431 | platform_device_register(&omap2_mcspi1); | ||
432 | platform_device_register(&omap2_mcspi2); | ||
433 | |||
434 | if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) | ||
435 | omap2_mcspi3_init(); | ||
436 | |||
437 | if (cpu_is_omap343x() || cpu_is_omap44xx()) | ||
438 | omap2_mcspi4_init(); | ||
439 | } | 371 | } |
440 | 372 | ||
441 | #else | 373 | #else |
@@ -610,117 +542,10 @@ static inline void omap_init_aes(void) { } | |||
610 | 542 | ||
611 | /*-------------------------------------------------------------------------*/ | 543 | /*-------------------------------------------------------------------------*/ |
612 | 544 | ||
613 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 545 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) |
614 | |||
615 | #define MMCHS_SYSCONFIG 0x0010 | ||
616 | #define MMCHS_SYSCONFIG_SWRESET (1 << 1) | ||
617 | #define MMCHS_SYSSTATUS 0x0014 | ||
618 | #define MMCHS_SYSSTATUS_RESETDONE (1 << 0) | ||
619 | |||
620 | static struct platform_device dummy_pdev = { | ||
621 | .dev = { | ||
622 | .bus = &platform_bus_type, | ||
623 | }, | ||
624 | }; | ||
625 | |||
626 | /** | ||
627 | * omap_hsmmc_reset() - Full reset of each HS-MMC controller | ||
628 | * | ||
629 | * Ensure that each MMC controller is fully reset. Controllers | ||
630 | * left in an unknown state (by bootloader) may prevent retention | ||
631 | * or OFF-mode. This is especially important in cases where the | ||
632 | * MMC driver is not enabled, _or_ built as a module. | ||
633 | * | ||
634 | * In order for reset to work, interface, functional and debounce | ||
635 | * clocks must be enabled. The debounce clock comes from func_32k_clk | ||
636 | * and is not under SW control, so we only enable i- and f-clocks. | ||
637 | **/ | ||
638 | static void __init omap_hsmmc_reset(void) | ||
639 | { | ||
640 | u32 i, nr_controllers; | ||
641 | struct clk *iclk, *fclk; | ||
642 | |||
643 | if (cpu_is_omap242x()) | ||
644 | return; | ||
645 | |||
646 | nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : | ||
647 | (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); | ||
648 | 546 | ||
649 | for (i = 0; i < nr_controllers; i++) { | 547 | static inline void omap242x_mmc_mux(struct omap_mmc_platform_data |
650 | u32 v, base = 0; | 548 | *mmc_controller) |
651 | struct device *dev = &dummy_pdev.dev; | ||
652 | |||
653 | switch (i) { | ||
654 | case 0: | ||
655 | base = OMAP2_MMC1_BASE; | ||
656 | break; | ||
657 | case 1: | ||
658 | base = OMAP2_MMC2_BASE; | ||
659 | break; | ||
660 | case 2: | ||
661 | base = OMAP3_MMC3_BASE; | ||
662 | break; | ||
663 | case 3: | ||
664 | if (!cpu_is_omap44xx()) | ||
665 | return; | ||
666 | base = OMAP4_MMC4_BASE; | ||
667 | break; | ||
668 | case 4: | ||
669 | if (!cpu_is_omap44xx()) | ||
670 | return; | ||
671 | base = OMAP4_MMC5_BASE; | ||
672 | break; | ||
673 | } | ||
674 | |||
675 | if (cpu_is_omap44xx()) | ||
676 | base += OMAP4_MMC_REG_OFFSET; | ||
677 | |||
678 | dummy_pdev.id = i; | ||
679 | dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); | ||
680 | iclk = clk_get(dev, "ick"); | ||
681 | if (IS_ERR(iclk)) | ||
682 | goto err1; | ||
683 | if (clk_enable(iclk)) | ||
684 | goto err2; | ||
685 | |||
686 | fclk = clk_get(dev, "fck"); | ||
687 | if (IS_ERR(fclk)) | ||
688 | goto err3; | ||
689 | if (clk_enable(fclk)) | ||
690 | goto err4; | ||
691 | |||
692 | omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG); | ||
693 | v = omap_readl(base + MMCHS_SYSSTATUS); | ||
694 | while (!(omap_readl(base + MMCHS_SYSSTATUS) & | ||
695 | MMCHS_SYSSTATUS_RESETDONE)) | ||
696 | cpu_relax(); | ||
697 | |||
698 | clk_disable(fclk); | ||
699 | clk_put(fclk); | ||
700 | clk_disable(iclk); | ||
701 | clk_put(iclk); | ||
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); | ||
714 | } | ||
715 | #else | ||
716 | static inline void omap_hsmmc_reset(void) {} | ||
717 | #endif | ||
718 | |||
719 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ | ||
720 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | ||
721 | |||
722 | static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, | ||
723 | int controller_nr) | ||
724 | { | 549 | { |
725 | if ((mmc_controller->slots[0].switch_pin > 0) && \ | 550 | if ((mmc_controller->slots[0].switch_pin > 0) && \ |
726 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) | 551 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) |
@@ -731,163 +556,44 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, | |||
731 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, | 556 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, |
732 | OMAP_PIN_INPUT_PULLUP); | 557 | OMAP_PIN_INPUT_PULLUP); |
733 | 558 | ||
734 | if (cpu_is_omap2420() && controller_nr == 0) { | 559 | omap_mux_init_signal("sdmmc_cmd", 0); |
735 | omap_mux_init_signal("sdmmc_cmd", 0); | 560 | omap_mux_init_signal("sdmmc_clki", 0); |
736 | omap_mux_init_signal("sdmmc_clki", 0); | 561 | omap_mux_init_signal("sdmmc_clko", 0); |
737 | omap_mux_init_signal("sdmmc_clko", 0); | 562 | omap_mux_init_signal("sdmmc_dat0", 0); |
738 | omap_mux_init_signal("sdmmc_dat0", 0); | 563 | omap_mux_init_signal("sdmmc_dat_dir0", 0); |
739 | omap_mux_init_signal("sdmmc_dat_dir0", 0); | 564 | omap_mux_init_signal("sdmmc_cmd_dir", 0); |
740 | omap_mux_init_signal("sdmmc_cmd_dir", 0); | 565 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { |
741 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { | 566 | omap_mux_init_signal("sdmmc_dat1", 0); |
742 | omap_mux_init_signal("sdmmc_dat1", 0); | 567 | omap_mux_init_signal("sdmmc_dat2", 0); |
743 | omap_mux_init_signal("sdmmc_dat2", 0); | 568 | omap_mux_init_signal("sdmmc_dat3", 0); |
744 | omap_mux_init_signal("sdmmc_dat3", 0); | 569 | omap_mux_init_signal("sdmmc_dat_dir1", 0); |
745 | omap_mux_init_signal("sdmmc_dat_dir1", 0); | 570 | omap_mux_init_signal("sdmmc_dat_dir2", 0); |
746 | omap_mux_init_signal("sdmmc_dat_dir2", 0); | 571 | omap_mux_init_signal("sdmmc_dat_dir3", 0); |
747 | omap_mux_init_signal("sdmmc_dat_dir3", 0); | ||
748 | } | ||
749 | |||
750 | /* | ||
751 | * Use internal loop-back in MMC/SDIO Module Input Clock | ||
752 | * selection | ||
753 | */ | ||
754 | if (mmc_controller->slots[0].internal_clock) { | ||
755 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
756 | v |= (1 << 24); | ||
757 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); | ||
758 | } | ||
759 | } | 572 | } |
760 | 573 | ||
761 | if (cpu_is_omap34xx()) { | 574 | /* |
762 | if (controller_nr == 0) { | 575 | * Use internal loop-back in MMC/SDIO Module Input Clock |
763 | omap_mux_init_signal("sdmmc1_clk", | 576 | * selection |
764 | OMAP_PIN_INPUT_PULLUP); | 577 | */ |
765 | omap_mux_init_signal("sdmmc1_cmd", | 578 | if (mmc_controller->slots[0].internal_clock) { |
766 | OMAP_PIN_INPUT_PULLUP); | 579 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); |
767 | omap_mux_init_signal("sdmmc1_dat0", | 580 | v |= (1 << 24); |
768 | OMAP_PIN_INPUT_PULLUP); | 581 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); |
769 | if (mmc_controller->slots[0].caps & | ||
770 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
771 | omap_mux_init_signal("sdmmc1_dat1", | ||
772 | OMAP_PIN_INPUT_PULLUP); | ||
773 | omap_mux_init_signal("sdmmc1_dat2", | ||
774 | OMAP_PIN_INPUT_PULLUP); | ||
775 | omap_mux_init_signal("sdmmc1_dat3", | ||
776 | OMAP_PIN_INPUT_PULLUP); | ||
777 | } | ||
778 | if (mmc_controller->slots[0].caps & | ||
779 | MMC_CAP_8_BIT_DATA) { | ||
780 | omap_mux_init_signal("sdmmc1_dat4", | ||
781 | OMAP_PIN_INPUT_PULLUP); | ||
782 | omap_mux_init_signal("sdmmc1_dat5", | ||
783 | OMAP_PIN_INPUT_PULLUP); | ||
784 | omap_mux_init_signal("sdmmc1_dat6", | ||
785 | OMAP_PIN_INPUT_PULLUP); | ||
786 | omap_mux_init_signal("sdmmc1_dat7", | ||
787 | OMAP_PIN_INPUT_PULLUP); | ||
788 | } | ||
789 | } | ||
790 | if (controller_nr == 1) { | ||
791 | /* MMC2 */ | ||
792 | omap_mux_init_signal("sdmmc2_clk", | ||
793 | OMAP_PIN_INPUT_PULLUP); | ||
794 | omap_mux_init_signal("sdmmc2_cmd", | ||
795 | OMAP_PIN_INPUT_PULLUP); | ||
796 | omap_mux_init_signal("sdmmc2_dat0", | ||
797 | OMAP_PIN_INPUT_PULLUP); | ||
798 | |||
799 | /* | ||
800 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed | ||
801 | * in the board-*.c files | ||
802 | */ | ||
803 | if (mmc_controller->slots[0].caps & | ||
804 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
805 | omap_mux_init_signal("sdmmc2_dat1", | ||
806 | OMAP_PIN_INPUT_PULLUP); | ||
807 | omap_mux_init_signal("sdmmc2_dat2", | ||
808 | OMAP_PIN_INPUT_PULLUP); | ||
809 | omap_mux_init_signal("sdmmc2_dat3", | ||
810 | OMAP_PIN_INPUT_PULLUP); | ||
811 | } | ||
812 | if (mmc_controller->slots[0].caps & | ||
813 | MMC_CAP_8_BIT_DATA) { | ||
814 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", | ||
815 | OMAP_PIN_INPUT_PULLUP); | ||
816 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", | ||
817 | OMAP_PIN_INPUT_PULLUP); | ||
818 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", | ||
819 | OMAP_PIN_INPUT_PULLUP); | ||
820 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", | ||
821 | OMAP_PIN_INPUT_PULLUP); | ||
822 | } | ||
823 | } | ||
824 | |||
825 | /* | ||
826 | * For MMC3 the pins need to be muxed in the board-*.c files | ||
827 | */ | ||
828 | } | 582 | } |
829 | } | 583 | } |
830 | 584 | ||
831 | void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | 585 | void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) |
832 | int nr_controllers) | ||
833 | { | 586 | { |
834 | int i; | 587 | char *name = "mmci-omap"; |
835 | char *name; | ||
836 | 588 | ||
837 | for (i = 0; i < nr_controllers; i++) { | 589 | if (!mmc_data[0]) { |
838 | unsigned long base, size; | 590 | pr_err("%s fails: Incomplete platform data\n", __func__); |
839 | unsigned int irq = 0; | 591 | return; |
840 | 592 | } | |
841 | if (!mmc_data[i]) | ||
842 | continue; | ||
843 | |||
844 | omap2_mmc_mux(mmc_data[i], i); | ||
845 | 593 | ||
846 | switch (i) { | 594 | omap242x_mmc_mux(mmc_data[0]); |
847 | case 0: | 595 | omap_mmc_add(name, 0, OMAP2_MMC1_BASE, OMAP2420_MMC_SIZE, |
848 | base = OMAP2_MMC1_BASE; | 596 | INT_24XX_MMC_IRQ, mmc_data[0]); |
849 | irq = INT_24XX_MMC_IRQ; | ||
850 | break; | ||
851 | case 1: | ||
852 | base = OMAP2_MMC2_BASE; | ||
853 | irq = INT_24XX_MMC2_IRQ; | ||
854 | break; | ||
855 | case 2: | ||
856 | if (!cpu_is_omap44xx() && !cpu_is_omap34xx()) | ||
857 | return; | ||
858 | base = OMAP3_MMC3_BASE; | ||
859 | irq = INT_34XX_MMC3_IRQ; | ||
860 | break; | ||
861 | case 3: | ||
862 | if (!cpu_is_omap44xx()) | ||
863 | return; | ||
864 | base = OMAP4_MMC4_BASE; | ||
865 | irq = OMAP44XX_IRQ_MMC4; | ||
866 | break; | ||
867 | case 4: | ||
868 | if (!cpu_is_omap44xx()) | ||
869 | return; | ||
870 | base = OMAP4_MMC5_BASE; | ||
871 | irq = OMAP44XX_IRQ_MMC5; | ||
872 | break; | ||
873 | default: | ||
874 | continue; | ||
875 | } | ||
876 | |||
877 | if (cpu_is_omap2420()) { | ||
878 | size = OMAP2420_MMC_SIZE; | ||
879 | name = "mmci-omap"; | ||
880 | } else if (cpu_is_omap44xx()) { | ||
881 | if (i < 3) | ||
882 | irq += OMAP44XX_IRQ_GIC_START; | ||
883 | size = OMAP4_HSMMC_SIZE; | ||
884 | name = "mmci-omap-hs"; | ||
885 | } else { | ||
886 | size = OMAP3_HSMMC_SIZE; | ||
887 | name = "mmci-omap-hs"; | ||
888 | } | ||
889 | omap_mmc_add(name, i, base, size, irq, mmc_data[i]); | ||
890 | }; | ||
891 | } | 597 | } |
892 | 598 | ||
893 | #endif | 599 | #endif |
@@ -895,7 +601,7 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
895 | /*-------------------------------------------------------------------------*/ | 601 | /*-------------------------------------------------------------------------*/ |
896 | 602 | ||
897 | #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) | 603 | #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) |
898 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) | 604 | #if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430) |
899 | #define OMAP_HDQ_BASE 0x480B2000 | 605 | #define OMAP_HDQ_BASE 0x480B2000 |
900 | #endif | 606 | #endif |
901 | static struct resource omap_hdq_resources[] = { | 607 | static struct resource omap_hdq_resources[] = { |
@@ -961,7 +667,6 @@ static int __init omap2_init_devices(void) | |||
961 | * please keep these calls, and their implementations above, | 667 | * please keep these calls, and their implementations above, |
962 | * in alphabetical order so they're easier to sort through. | 668 | * in alphabetical order so they're easier to sort through. |
963 | */ | 669 | */ |
964 | omap_hsmmc_reset(); | ||
965 | omap_init_audio(); | 670 | omap_init_audio(); |
966 | omap_init_camera(); | 671 | omap_init_camera(); |
967 | omap_init_mbox(); | 672 | omap_init_mbox(); |
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c new file mode 100644 index 000000000000..b18db84b0349 --- /dev/null +++ b/arch/arm/mach-omap2/display.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * OMAP2plus display device setup / initialization. | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * Senthilvadivu Guruswamy | ||
6 | * Sumit Semwal | ||
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 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
13 | * kind, whether express or implied; without even the implied warranty | ||
14 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/err.h> | ||
24 | |||
25 | #include <plat/display.h> | ||
26 | |||
27 | static struct platform_device omap_display_device = { | ||
28 | .name = "omapdss", | ||
29 | .id = -1, | ||
30 | .dev = { | ||
31 | .platform_data = NULL, | ||
32 | }, | ||
33 | }; | ||
34 | |||
35 | int __init omap_display_init(struct omap_dss_board_info *board_data) | ||
36 | { | ||
37 | int r = 0; | ||
38 | omap_display_device.dev.platform_data = board_data; | ||
39 | |||
40 | r = platform_device_register(&omap_display_device); | ||
41 | if (r < 0) | ||
42 | printk(KERN_ERR "Unable to register OMAP-Display device\n"); | ||
43 | |||
44 | return r; | ||
45 | } | ||
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c new file mode 100644 index 000000000000..4e4da6160d05 --- /dev/null +++ b/arch/arm/mach-omap2/dpll44xx.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * OMAP4-specific DPLL control functions | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak | ||
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/errno.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/bitops.h> | ||
17 | |||
18 | #include <plat/cpu.h> | ||
19 | #include <plat/clock.h> | ||
20 | |||
21 | #include "clock.h" | ||
22 | #include "cm-regbits-44xx.h" | ||
23 | |||
24 | /* Supported only on OMAP4 */ | ||
25 | int omap4_dpllmx_gatectrl_read(struct clk *clk) | ||
26 | { | ||
27 | u32 v; | ||
28 | u32 mask; | ||
29 | |||
30 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | ||
31 | return -EINVAL; | ||
32 | |||
33 | mask = clk->flags & CLOCK_CLKOUTX2 ? | ||
34 | OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : | ||
35 | OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; | ||
36 | |||
37 | v = __raw_readl(clk->clksel_reg); | ||
38 | v &= mask; | ||
39 | v >>= __ffs(mask); | ||
40 | |||
41 | return v; | ||
42 | } | ||
43 | |||
44 | void omap4_dpllmx_allow_gatectrl(struct clk *clk) | ||
45 | { | ||
46 | u32 v; | ||
47 | u32 mask; | ||
48 | |||
49 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | ||
50 | return; | ||
51 | |||
52 | mask = clk->flags & CLOCK_CLKOUTX2 ? | ||
53 | OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : | ||
54 | OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; | ||
55 | |||
56 | v = __raw_readl(clk->clksel_reg); | ||
57 | /* Clear the bit to allow gatectrl */ | ||
58 | v &= ~mask; | ||
59 | __raw_writel(v, clk->clksel_reg); | ||
60 | } | ||
61 | |||
62 | void omap4_dpllmx_deny_gatectrl(struct clk *clk) | ||
63 | { | ||
64 | u32 v; | ||
65 | u32 mask; | ||
66 | |||
67 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | ||
68 | return; | ||
69 | |||
70 | mask = clk->flags & CLOCK_CLKOUTX2 ? | ||
71 | OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : | ||
72 | OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; | ||
73 | |||
74 | v = __raw_readl(clk->clksel_reg); | ||
75 | /* Set the bit to deny gatectrl */ | ||
76 | v |= mask; | ||
77 | __raw_writel(v, clk->clksel_reg); | ||
78 | } | ||
79 | |||
80 | const struct clkops clkops_omap4_dpllmx_ops = { | ||
81 | .allow_idle = omap4_dpllmx_allow_gatectrl, | ||
82 | .deny_idle = omap4_dpllmx_deny_gatectrl, | ||
83 | }; | ||
84 | |||
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 2bb29c160702..c1791d08ae56 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/mtd/nand.h> | ||
15 | 16 | ||
16 | #include <asm/mach/flash.h> | 17 | #include <asm/mach/flash.h> |
17 | 18 | ||
@@ -69,8 +70,10 @@ static int omap2_nand_gpmc_retime(void) | |||
69 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); | 70 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); |
70 | 71 | ||
71 | /* Configure GPMC */ | 72 | /* Configure GPMC */ |
72 | gpmc_cs_configure(gpmc_nand_data->cs, | 73 | if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) |
73 | GPMC_CONFIG_DEV_SIZE, gpmc_nand_data->devsize); | 74 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1); |
75 | else | ||
76 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0); | ||
74 | gpmc_cs_configure(gpmc_nand_data->cs, | 77 | gpmc_cs_configure(gpmc_nand_data->cs, |
75 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); | 78 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); |
76 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); | 79 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); |
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 3a7d25fb00ef..d776ded9830d 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c | |||
@@ -94,7 +94,7 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | static void set_onenand_cfg(void __iomem *onenand_base, int latency, | 96 | static void set_onenand_cfg(void __iomem *onenand_base, int latency, |
97 | int sync_read, int sync_write, int hf) | 97 | int sync_read, int sync_write, int hf, int vhf) |
98 | { | 98 | { |
99 | u32 reg; | 99 | u32 reg; |
100 | 100 | ||
@@ -114,12 +114,57 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency, | |||
114 | reg |= ONENAND_SYS_CFG1_HF; | 114 | reg |= ONENAND_SYS_CFG1_HF; |
115 | else | 115 | else |
116 | reg &= ~ONENAND_SYS_CFG1_HF; | 116 | reg &= ~ONENAND_SYS_CFG1_HF; |
117 | if (vhf) | ||
118 | reg |= ONENAND_SYS_CFG1_VHF; | ||
119 | else | ||
120 | reg &= ~ONENAND_SYS_CFG1_VHF; | ||
117 | writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); | 121 | writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); |
118 | } | 122 | } |
119 | 123 | ||
124 | static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg, | ||
125 | void __iomem *onenand_base, bool *clk_dep) | ||
126 | { | ||
127 | u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID); | ||
128 | int freq = 0; | ||
129 | |||
130 | if (cfg->get_freq) { | ||
131 | struct onenand_freq_info fi; | ||
132 | |||
133 | fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID); | ||
134 | fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID); | ||
135 | fi.ver_id = ver; | ||
136 | freq = cfg->get_freq(&fi, clk_dep); | ||
137 | if (freq) | ||
138 | return freq; | ||
139 | } | ||
140 | |||
141 | switch ((ver >> 4) & 0xf) { | ||
142 | case 0: | ||
143 | freq = 40; | ||
144 | break; | ||
145 | case 1: | ||
146 | freq = 54; | ||
147 | break; | ||
148 | case 2: | ||
149 | freq = 66; | ||
150 | break; | ||
151 | case 3: | ||
152 | freq = 83; | ||
153 | break; | ||
154 | case 4: | ||
155 | freq = 104; | ||
156 | break; | ||
157 | default: | ||
158 | freq = 54; | ||
159 | break; | ||
160 | } | ||
161 | |||
162 | return freq; | ||
163 | } | ||
164 | |||
120 | static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | 165 | static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, |
121 | void __iomem *onenand_base, | 166 | void __iomem *onenand_base, |
122 | int freq) | 167 | int *freq_ptr) |
123 | { | 168 | { |
124 | struct gpmc_timings t; | 169 | struct gpmc_timings t; |
125 | const int t_cer = 15; | 170 | const int t_cer = 15; |
@@ -130,10 +175,11 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
130 | const int t_wph = 30; | 175 | const int t_wph = 30; |
131 | int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; | 176 | int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; |
132 | int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; | 177 | int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; |
133 | int first_time = 0, hf = 0, sync_read = 0, sync_write = 0; | 178 | int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0; |
134 | int err, ticks_cez; | 179 | int err, ticks_cez; |
135 | int cs = cfg->cs; | 180 | int cs = cfg->cs, freq = *freq_ptr; |
136 | u32 reg; | 181 | u32 reg; |
182 | bool clk_dep = false; | ||
137 | 183 | ||
138 | if (cfg->flags & ONENAND_SYNC_READ) { | 184 | if (cfg->flags & ONENAND_SYNC_READ) { |
139 | sync_read = 1; | 185 | sync_read = 1; |
@@ -148,27 +194,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
148 | err = omap2_onenand_set_async_mode(cs, onenand_base); | 194 | err = omap2_onenand_set_async_mode(cs, onenand_base); |
149 | if (err) | 195 | if (err) |
150 | return err; | 196 | return err; |
151 | reg = readw(onenand_base + ONENAND_REG_VERSION_ID); | 197 | freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep); |
152 | switch ((reg >> 4) & 0xf) { | ||
153 | case 0: | ||
154 | freq = 40; | ||
155 | break; | ||
156 | case 1: | ||
157 | freq = 54; | ||
158 | break; | ||
159 | case 2: | ||
160 | freq = 66; | ||
161 | break; | ||
162 | case 3: | ||
163 | freq = 83; | ||
164 | break; | ||
165 | case 4: | ||
166 | freq = 104; | ||
167 | break; | ||
168 | default: | ||
169 | freq = 54; | ||
170 | break; | ||
171 | } | ||
172 | first_time = 1; | 198 | first_time = 1; |
173 | } | 199 | } |
174 | 200 | ||
@@ -180,7 +206,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
180 | t_avdh = 2; | 206 | t_avdh = 2; |
181 | t_ach = 3; | 207 | t_ach = 3; |
182 | t_aavdh = 6; | 208 | t_aavdh = 6; |
183 | t_rdyo = 9; | 209 | t_rdyo = 6; |
184 | break; | 210 | break; |
185 | case 83: | 211 | case 83: |
186 | min_gpmc_clk_period = 12000; /* 83 MHz */ | 212 | min_gpmc_clk_period = 12000; /* 83 MHz */ |
@@ -217,16 +243,36 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
217 | gpmc_clk_ns = gpmc_ticks_to_ns(div); | 243 | gpmc_clk_ns = gpmc_ticks_to_ns(div); |
218 | if (gpmc_clk_ns < 15) /* >66Mhz */ | 244 | if (gpmc_clk_ns < 15) /* >66Mhz */ |
219 | hf = 1; | 245 | hf = 1; |
220 | if (hf) | 246 | if (gpmc_clk_ns < 12) /* >83Mhz */ |
247 | vhf = 1; | ||
248 | if (vhf) | ||
249 | latency = 8; | ||
250 | else if (hf) | ||
221 | latency = 6; | 251 | latency = 6; |
222 | else if (gpmc_clk_ns >= 25) /* 40 MHz*/ | 252 | else if (gpmc_clk_ns >= 25) /* 40 MHz*/ |
223 | latency = 3; | 253 | latency = 3; |
224 | else | 254 | else |
225 | latency = 4; | 255 | latency = 4; |
226 | 256 | ||
257 | if (clk_dep) { | ||
258 | if (gpmc_clk_ns < 12) { /* >83Mhz */ | ||
259 | t_ces = 3; | ||
260 | t_avds = 4; | ||
261 | } else if (gpmc_clk_ns < 15) { /* >66Mhz */ | ||
262 | t_ces = 5; | ||
263 | t_avds = 4; | ||
264 | } else if (gpmc_clk_ns < 25) { /* >40Mhz */ | ||
265 | t_ces = 6; | ||
266 | t_avds = 5; | ||
267 | } else { | ||
268 | t_ces = 7; | ||
269 | t_avds = 7; | ||
270 | } | ||
271 | } | ||
272 | |||
227 | if (first_time) | 273 | if (first_time) |
228 | set_onenand_cfg(onenand_base, latency, | 274 | set_onenand_cfg(onenand_base, latency, |
229 | sync_read, sync_write, hf); | 275 | sync_read, sync_write, hf, vhf); |
230 | 276 | ||
231 | if (div == 1) { | 277 | if (div == 1) { |
232 | reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); | 278 | reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); |
@@ -264,6 +310,9 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
264 | /* Read */ | 310 | /* Read */ |
265 | t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh)); | 311 | t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh)); |
266 | t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach)); | 312 | t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach)); |
313 | /* Force at least 1 clk between AVD High to OE Low */ | ||
314 | if (t.oe_on <= t.adv_rd_off) | ||
315 | t.oe_on = t.adv_rd_off + gpmc_round_ns_to_ticks(1); | ||
267 | t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div); | 316 | t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div); |
268 | t.oe_off = t.access + gpmc_round_ns_to_ticks(1); | 317 | t.oe_off = t.access + gpmc_round_ns_to_ticks(1); |
269 | t.cs_rd_off = t.oe_off; | 318 | t.cs_rd_off = t.oe_off; |
@@ -317,18 +366,20 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
317 | if (err) | 366 | if (err) |
318 | return err; | 367 | return err; |
319 | 368 | ||
320 | set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf); | 369 | set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf); |
370 | |||
371 | *freq_ptr = freq; | ||
321 | 372 | ||
322 | return 0; | 373 | return 0; |
323 | } | 374 | } |
324 | 375 | ||
325 | static int gpmc_onenand_setup(void __iomem *onenand_base, int freq) | 376 | static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) |
326 | { | 377 | { |
327 | struct device *dev = &gpmc_onenand_device.dev; | 378 | struct device *dev = &gpmc_onenand_device.dev; |
328 | 379 | ||
329 | /* Set sync timings in GPMC */ | 380 | /* Set sync timings in GPMC */ |
330 | if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, | 381 | if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, |
331 | freq) < 0) { | 382 | freq_ptr) < 0) { |
332 | dev_err(dev, "Unable to set synchronous mode\n"); | 383 | dev_err(dev, "Unable to set synchronous mode\n"); |
333 | return -EINVAL; | 384 | return -EINVAL; |
334 | } | 385 | } |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 1b7b3e7d02f7..674174365f78 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | #undef DEBUG | 15 | #undef DEBUG |
16 | 16 | ||
17 | #include <linux/irq.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
19 | #include <linux/err.h> | 20 | #include <linux/err.h> |
@@ -22,6 +23,7 @@ | |||
22 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
24 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/interrupt.h> | ||
25 | 27 | ||
26 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
27 | #include <plat/gpmc.h> | 29 | #include <plat/gpmc.h> |
@@ -58,7 +60,6 @@ | |||
58 | #define GPMC_CHUNK_SHIFT 24 /* 16 MB */ | 60 | #define GPMC_CHUNK_SHIFT 24 /* 16 MB */ |
59 | #define GPMC_SECTION_SHIFT 28 /* 128 MB */ | 61 | #define GPMC_SECTION_SHIFT 28 /* 128 MB */ |
60 | 62 | ||
61 | #define PREFETCH_FIFOTHRESHOLD (0x40 << 8) | ||
62 | #define CS_NUM_SHIFT 24 | 63 | #define CS_NUM_SHIFT 24 |
63 | #define ENABLE_PREFETCH (0x1 << 7) | 64 | #define ENABLE_PREFETCH (0x1 << 7) |
64 | #define DMA_MPU_MODE 2 | 65 | #define DMA_MPU_MODE 2 |
@@ -100,6 +101,8 @@ static void __iomem *gpmc_base; | |||
100 | 101 | ||
101 | static struct clk *gpmc_l3_clk; | 102 | static struct clk *gpmc_l3_clk; |
102 | 103 | ||
104 | static irqreturn_t gpmc_handle_irq(int irq, void *dev); | ||
105 | |||
103 | static void gpmc_write_reg(int idx, u32 val) | 106 | static void gpmc_write_reg(int idx, u32 val) |
104 | { | 107 | { |
105 | __raw_writel(val, gpmc_base + idx); | 108 | __raw_writel(val, gpmc_base + idx); |
@@ -497,6 +500,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval) | |||
497 | u32 regval = 0; | 500 | u32 regval = 0; |
498 | 501 | ||
499 | switch (cmd) { | 502 | switch (cmd) { |
503 | case GPMC_ENABLE_IRQ: | ||
504 | gpmc_write_reg(GPMC_IRQENABLE, wval); | ||
505 | break; | ||
506 | |||
500 | case GPMC_SET_IRQ_STATUS: | 507 | case GPMC_SET_IRQ_STATUS: |
501 | gpmc_write_reg(GPMC_IRQSTATUS, wval); | 508 | gpmc_write_reg(GPMC_IRQSTATUS, wval); |
502 | break; | 509 | break; |
@@ -598,15 +605,19 @@ EXPORT_SYMBOL(gpmc_nand_write); | |||
598 | /** | 605 | /** |
599 | * gpmc_prefetch_enable - configures and starts prefetch transfer | 606 | * gpmc_prefetch_enable - configures and starts prefetch transfer |
600 | * @cs: cs (chip select) number | 607 | * @cs: cs (chip select) number |
608 | * @fifo_th: fifo threshold to be used for read/ write | ||
601 | * @dma_mode: dma mode enable (1) or disable (0) | 609 | * @dma_mode: dma mode enable (1) or disable (0) |
602 | * @u32_count: number of bytes to be transferred | 610 | * @u32_count: number of bytes to be transferred |
603 | * @is_write: prefetch read(0) or write post(1) mode | 611 | * @is_write: prefetch read(0) or write post(1) mode |
604 | */ | 612 | */ |
605 | int gpmc_prefetch_enable(int cs, int dma_mode, | 613 | int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode, |
606 | unsigned int u32_count, int is_write) | 614 | unsigned int u32_count, int is_write) |
607 | { | 615 | { |
608 | 616 | ||
609 | if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { | 617 | if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) { |
618 | pr_err("gpmc: fifo threshold is not supported\n"); | ||
619 | return -1; | ||
620 | } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { | ||
610 | /* Set the amount of bytes to be prefetched */ | 621 | /* Set the amount of bytes to be prefetched */ |
611 | gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); | 622 | gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); |
612 | 623 | ||
@@ -614,7 +625,7 @@ int gpmc_prefetch_enable(int cs, int dma_mode, | |||
614 | * enable the engine. Set which cs is has requested for. | 625 | * enable the engine. Set which cs is has requested for. |
615 | */ | 626 | */ |
616 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | | 627 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | |
617 | PREFETCH_FIFOTHRESHOLD | | 628 | PREFETCH_FIFOTHRESHOLD(fifo_th) | |
618 | ENABLE_PREFETCH | | 629 | ENABLE_PREFETCH | |
619 | (dma_mode << DMA_MPU_MODE) | | 630 | (dma_mode << DMA_MPU_MODE) | |
620 | (0x1 & is_write))); | 631 | (0x1 & is_write))); |
@@ -678,9 +689,10 @@ static void __init gpmc_mem_init(void) | |||
678 | } | 689 | } |
679 | } | 690 | } |
680 | 691 | ||
681 | void __init gpmc_init(void) | 692 | static int __init gpmc_init(void) |
682 | { | 693 | { |
683 | u32 l; | 694 | u32 l, irq; |
695 | int cs, ret = -EINVAL; | ||
684 | char *ck = NULL; | 696 | char *ck = NULL; |
685 | 697 | ||
686 | if (cpu_is_omap24xx()) { | 698 | if (cpu_is_omap24xx()) { |
@@ -698,7 +710,7 @@ void __init gpmc_init(void) | |||
698 | } | 710 | } |
699 | 711 | ||
700 | if (WARN_ON(!ck)) | 712 | if (WARN_ON(!ck)) |
701 | return; | 713 | return ret; |
702 | 714 | ||
703 | gpmc_l3_clk = clk_get(NULL, ck); | 715 | gpmc_l3_clk = clk_get(NULL, ck); |
704 | if (IS_ERR(gpmc_l3_clk)) { | 716 | if (IS_ERR(gpmc_l3_clk)) { |
@@ -723,6 +735,36 @@ void __init gpmc_init(void) | |||
723 | l |= (0x02 << 3) | (1 << 0); | 735 | l |= (0x02 << 3) | (1 << 0); |
724 | gpmc_write_reg(GPMC_SYSCONFIG, l); | 736 | gpmc_write_reg(GPMC_SYSCONFIG, l); |
725 | gpmc_mem_init(); | 737 | gpmc_mem_init(); |
738 | |||
739 | /* initalize the irq_chained */ | ||
740 | irq = OMAP_GPMC_IRQ_BASE; | ||
741 | for (cs = 0; cs < GPMC_CS_NUM; cs++) { | ||
742 | set_irq_handler(irq, handle_simple_irq); | ||
743 | set_irq_flags(irq, IRQF_VALID); | ||
744 | irq++; | ||
745 | } | ||
746 | |||
747 | ret = request_irq(INT_34XX_GPMC_IRQ, | ||
748 | gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base); | ||
749 | if (ret) | ||
750 | pr_err("gpmc: irq-%d could not claim: err %d\n", | ||
751 | INT_34XX_GPMC_IRQ, ret); | ||
752 | return ret; | ||
753 | } | ||
754 | postcore_initcall(gpmc_init); | ||
755 | |||
756 | static irqreturn_t gpmc_handle_irq(int irq, void *dev) | ||
757 | { | ||
758 | u8 cs; | ||
759 | |||
760 | if (irq != INT_34XX_GPMC_IRQ) | ||
761 | return IRQ_HANDLED; | ||
762 | /* check cs to invoke the irq */ | ||
763 | cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7; | ||
764 | if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END) | ||
765 | generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs); | ||
766 | |||
767 | return IRQ_HANDLED; | ||
726 | } | 768 | } |
727 | 769 | ||
728 | #ifdef CONFIG_ARCH_OMAP3 | 770 | #ifdef CONFIG_ARCH_OMAP3 |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 34272e4863fd..137e1a5f3d85 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -16,7 +16,10 @@ | |||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | #include <plat/mmc.h> | 17 | #include <plat/mmc.h> |
18 | #include <plat/omap-pm.h> | 18 | #include <plat/omap-pm.h> |
19 | #include <plat/mux.h> | ||
20 | #include <plat/omap_device.h> | ||
19 | 21 | ||
22 | #include "mux.h" | ||
20 | #include "hsmmc.h" | 23 | #include "hsmmc.h" |
21 | #include "control.h" | 24 | #include "control.h" |
22 | 25 | ||
@@ -28,10 +31,6 @@ static u16 control_mmc1; | |||
28 | 31 | ||
29 | #define HSMMC_NAME_LEN 9 | 32 | #define HSMMC_NAME_LEN 9 |
30 | 33 | ||
31 | static struct hsmmc_controller { | ||
32 | char name[HSMMC_NAME_LEN + 1]; | ||
33 | } hsmmc[OMAP34XX_NR_MMC]; | ||
34 | |||
35 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | 34 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
36 | 35 | ||
37 | static int hsmmc_get_context_loss(struct device *dev) | 36 | static int hsmmc_get_context_loss(struct device *dev) |
@@ -204,174 +203,312 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on, | |||
204 | return 0; | 203 | return 0; |
205 | } | 204 | } |
206 | 205 | ||
207 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; | 206 | static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller, |
208 | 207 | int controller_nr) | |
209 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
210 | { | 208 | { |
211 | struct omap2_hsmmc_info *c; | 209 | if ((mmc_controller->slots[0].switch_pin > 0) && \ |
212 | int nr_hsmmc = ARRAY_SIZE(hsmmc_data); | 210 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) |
213 | int i; | 211 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, |
214 | u32 reg; | 212 | OMAP_PIN_INPUT_PULLUP); |
215 | 213 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ | |
216 | if (!cpu_is_omap44xx()) { | 214 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) |
217 | if (cpu_is_omap2430()) { | 215 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, |
218 | control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; | 216 | OMAP_PIN_INPUT_PULLUP); |
219 | control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; | 217 | if (cpu_is_omap34xx()) { |
220 | } else { | 218 | if (controller_nr == 0) { |
221 | control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | 219 | omap_mux_init_signal("sdmmc1_clk", |
222 | control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; | 220 | OMAP_PIN_INPUT_PULLUP); |
223 | } | 221 | omap_mux_init_signal("sdmmc1_cmd", |
224 | } else { | 222 | OMAP_PIN_INPUT_PULLUP); |
225 | control_pbias_offset = | 223 | omap_mux_init_signal("sdmmc1_dat0", |
226 | OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; | 224 | OMAP_PIN_INPUT_PULLUP); |
227 | control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; | 225 | if (mmc_controller->slots[0].caps & |
228 | reg = omap4_ctrl_pad_readl(control_mmc1); | 226 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { |
229 | reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | | 227 | omap_mux_init_signal("sdmmc1_dat1", |
230 | OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); | 228 | OMAP_PIN_INPUT_PULLUP); |
231 | reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | | 229 | omap_mux_init_signal("sdmmc1_dat2", |
232 | OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); | 230 | OMAP_PIN_INPUT_PULLUP); |
233 | reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK| | 231 | omap_mux_init_signal("sdmmc1_dat3", |
234 | OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | | 232 | OMAP_PIN_INPUT_PULLUP); |
235 | OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); | 233 | } |
236 | omap4_ctrl_pad_writel(reg, control_mmc1); | 234 | if (mmc_controller->slots[0].caps & |
237 | } | 235 | MMC_CAP_8_BIT_DATA) { |
238 | 236 | omap_mux_init_signal("sdmmc1_dat4", | |
239 | for (c = controllers; c->mmc; c++) { | 237 | OMAP_PIN_INPUT_PULLUP); |
240 | struct hsmmc_controller *hc = hsmmc + c->mmc - 1; | 238 | omap_mux_init_signal("sdmmc1_dat5", |
241 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | 239 | OMAP_PIN_INPUT_PULLUP); |
242 | 240 | omap_mux_init_signal("sdmmc1_dat6", | |
243 | if (!c->mmc || c->mmc > nr_hsmmc) { | 241 | OMAP_PIN_INPUT_PULLUP); |
244 | pr_debug("MMC%d: no such controller\n", c->mmc); | 242 | omap_mux_init_signal("sdmmc1_dat7", |
245 | continue; | 243 | OMAP_PIN_INPUT_PULLUP); |
246 | } | 244 | } |
247 | if (mmc) { | ||
248 | pr_debug("MMC%d: already configured\n", c->mmc); | ||
249 | continue; | ||
250 | } | 245 | } |
251 | 246 | if (controller_nr == 1) { | |
252 | mmc = kzalloc(sizeof(struct omap_mmc_platform_data), | 247 | /* MMC2 */ |
253 | GFP_KERNEL); | 248 | omap_mux_init_signal("sdmmc2_clk", |
254 | if (!mmc) { | 249 | OMAP_PIN_INPUT_PULLUP); |
255 | pr_err("Cannot allocate memory for mmc device!\n"); | 250 | omap_mux_init_signal("sdmmc2_cmd", |
256 | goto done; | 251 | OMAP_PIN_INPUT_PULLUP); |
252 | omap_mux_init_signal("sdmmc2_dat0", | ||
253 | OMAP_PIN_INPUT_PULLUP); | ||
254 | |||
255 | /* | ||
256 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 | ||
257 | * need to be muxed in the board-*.c files | ||
258 | */ | ||
259 | if (mmc_controller->slots[0].caps & | ||
260 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
261 | omap_mux_init_signal("sdmmc2_dat1", | ||
262 | OMAP_PIN_INPUT_PULLUP); | ||
263 | omap_mux_init_signal("sdmmc2_dat2", | ||
264 | OMAP_PIN_INPUT_PULLUP); | ||
265 | omap_mux_init_signal("sdmmc2_dat3", | ||
266 | OMAP_PIN_INPUT_PULLUP); | ||
267 | } | ||
268 | if (mmc_controller->slots[0].caps & | ||
269 | MMC_CAP_8_BIT_DATA) { | ||
270 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", | ||
271 | OMAP_PIN_INPUT_PULLUP); | ||
272 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", | ||
273 | OMAP_PIN_INPUT_PULLUP); | ||
274 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", | ||
275 | OMAP_PIN_INPUT_PULLUP); | ||
276 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", | ||
277 | OMAP_PIN_INPUT_PULLUP); | ||
278 | } | ||
257 | } | 279 | } |
258 | 280 | ||
259 | if (c->name) | 281 | /* |
260 | strncpy(hc->name, c->name, HSMMC_NAME_LEN); | 282 | * For MMC3 the pins need to be muxed in the board-*.c files |
261 | else | 283 | */ |
262 | snprintf(hc->name, ARRAY_SIZE(hc->name), | 284 | } |
263 | "mmc%islot%i", c->mmc, 1); | 285 | } |
264 | mmc->slots[0].name = hc->name; | ||
265 | mmc->nr_slots = 1; | ||
266 | mmc->slots[0].caps = c->caps; | ||
267 | mmc->slots[0].internal_clock = !c->ext_clock; | ||
268 | mmc->dma_mask = 0xffffffff; | ||
269 | if (cpu_is_omap44xx()) | ||
270 | mmc->reg_offset = OMAP4_MMC_REG_OFFSET; | ||
271 | else | ||
272 | mmc->reg_offset = 0; | ||
273 | 286 | ||
274 | mmc->get_context_loss_count = hsmmc_get_context_loss; | 287 | static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, |
288 | struct omap_mmc_platform_data *mmc) | ||
289 | { | ||
290 | char *hc_name; | ||
275 | 291 | ||
276 | mmc->slots[0].switch_pin = c->gpio_cd; | 292 | hc_name = kzalloc(sizeof(char) * (HSMMC_NAME_LEN + 1), GFP_KERNEL); |
277 | mmc->slots[0].gpio_wp = c->gpio_wp; | 293 | if (!hc_name) { |
294 | pr_err("Cannot allocate memory for controller slot name\n"); | ||
295 | kfree(hc_name); | ||
296 | return -ENOMEM; | ||
297 | } | ||
278 | 298 | ||
279 | mmc->slots[0].remux = c->remux; | 299 | if (c->name) |
280 | mmc->slots[0].init_card = c->init_card; | 300 | strncpy(hc_name, c->name, HSMMC_NAME_LEN); |
301 | else | ||
302 | snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", | ||
303 | c->mmc, 1); | ||
304 | mmc->slots[0].name = hc_name; | ||
305 | mmc->nr_slots = 1; | ||
306 | mmc->slots[0].caps = c->caps; | ||
307 | mmc->slots[0].internal_clock = !c->ext_clock; | ||
308 | mmc->dma_mask = 0xffffffff; | ||
309 | if (cpu_is_omap44xx()) | ||
310 | mmc->reg_offset = OMAP4_MMC_REG_OFFSET; | ||
311 | else | ||
312 | mmc->reg_offset = 0; | ||
281 | 313 | ||
282 | if (c->cover_only) | 314 | mmc->get_context_loss_count = hsmmc_get_context_loss; |
283 | mmc->slots[0].cover = 1; | ||
284 | 315 | ||
285 | if (c->nonremovable) | 316 | mmc->slots[0].switch_pin = c->gpio_cd; |
286 | mmc->slots[0].nonremovable = 1; | 317 | mmc->slots[0].gpio_wp = c->gpio_wp; |
287 | 318 | ||
288 | if (c->power_saving) | 319 | mmc->slots[0].remux = c->remux; |
289 | mmc->slots[0].power_saving = 1; | 320 | mmc->slots[0].init_card = c->init_card; |
290 | 321 | ||
291 | if (c->no_off) | 322 | if (c->cover_only) |
292 | mmc->slots[0].no_off = 1; | 323 | mmc->slots[0].cover = 1; |
293 | 324 | ||
294 | if (c->vcc_aux_disable_is_sleep) | 325 | if (c->nonremovable) |
295 | mmc->slots[0].vcc_aux_disable_is_sleep = 1; | 326 | mmc->slots[0].nonremovable = 1; |
296 | 327 | ||
297 | /* NOTE: MMC slots should have a Vcc regulator set up. | 328 | if (c->power_saving) |
298 | * This may be from a TWL4030-family chip, another | 329 | mmc->slots[0].power_saving = 1; |
299 | * controllable regulator, or a fixed supply. | ||
300 | * | ||
301 | * temporary HACK: ocr_mask instead of fixed supply | ||
302 | */ | ||
303 | mmc->slots[0].ocr_mask = c->ocr_mask; | ||
304 | 330 | ||
305 | if (cpu_is_omap3517() || cpu_is_omap3505()) | 331 | if (c->no_off) |
306 | mmc->slots[0].set_power = nop_mmc_set_power; | 332 | mmc->slots[0].no_off = 1; |
307 | else | ||
308 | mmc->slots[0].features |= HSMMC_HAS_PBIAS; | ||
309 | 333 | ||
310 | if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) | 334 | if (c->vcc_aux_disable_is_sleep) |
311 | mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; | 335 | mmc->slots[0].vcc_aux_disable_is_sleep = 1; |
312 | 336 | ||
313 | switch (c->mmc) { | 337 | /* |
314 | case 1: | 338 | * NOTE: MMC slots should have a Vcc regulator set up. |
315 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | 339 | * This may be from a TWL4030-family chip, another |
316 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | 340 | * controllable regulator, or a fixed supply. |
317 | if (cpu_is_omap44xx()) { | 341 | * |
318 | mmc->slots[0].before_set_reg = | 342 | * temporary HACK: ocr_mask instead of fixed supply |
343 | */ | ||
344 | mmc->slots[0].ocr_mask = c->ocr_mask; | ||
345 | |||
346 | if (cpu_is_omap3517() || cpu_is_omap3505()) | ||
347 | mmc->slots[0].set_power = nop_mmc_set_power; | ||
348 | else | ||
349 | mmc->slots[0].features |= HSMMC_HAS_PBIAS; | ||
350 | |||
351 | if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) | ||
352 | mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; | ||
353 | |||
354 | switch (c->mmc) { | ||
355 | case 1: | ||
356 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | ||
357 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | ||
358 | if (cpu_is_omap44xx()) { | ||
359 | mmc->slots[0].before_set_reg = | ||
319 | omap4_hsmmc1_before_set_reg; | 360 | omap4_hsmmc1_before_set_reg; |
320 | mmc->slots[0].after_set_reg = | 361 | mmc->slots[0].after_set_reg = |
321 | omap4_hsmmc1_after_set_reg; | 362 | omap4_hsmmc1_after_set_reg; |
322 | } else { | 363 | } else { |
323 | mmc->slots[0].before_set_reg = | 364 | mmc->slots[0].before_set_reg = |
324 | omap_hsmmc1_before_set_reg; | 365 | omap_hsmmc1_before_set_reg; |
325 | mmc->slots[0].after_set_reg = | 366 | mmc->slots[0].after_set_reg = |
326 | omap_hsmmc1_after_set_reg; | 367 | omap_hsmmc1_after_set_reg; |
327 | } | ||
328 | } | 368 | } |
369 | } | ||
329 | 370 | ||
330 | /* Omap3630 HSMMC1 supports only 4-bit */ | 371 | /* OMAP3630 HSMMC1 supports only 4-bit */ |
331 | if (cpu_is_omap3630() && | 372 | if (cpu_is_omap3630() && |
332 | (c->caps & MMC_CAP_8_BIT_DATA)) { | 373 | (c->caps & MMC_CAP_8_BIT_DATA)) { |
333 | c->caps &= ~MMC_CAP_8_BIT_DATA; | 374 | c->caps &= ~MMC_CAP_8_BIT_DATA; |
334 | c->caps |= MMC_CAP_4_BIT_DATA; | 375 | c->caps |= MMC_CAP_4_BIT_DATA; |
335 | mmc->slots[0].caps = c->caps; | 376 | mmc->slots[0].caps = c->caps; |
336 | } | 377 | } |
337 | break; | 378 | break; |
338 | case 2: | 379 | case 2: |
339 | if (c->ext_clock) | 380 | if (c->ext_clock) |
340 | c->transceiver = 1; | 381 | c->transceiver = 1; |
341 | if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { | 382 | if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { |
342 | c->caps &= ~MMC_CAP_8_BIT_DATA; | 383 | c->caps &= ~MMC_CAP_8_BIT_DATA; |
343 | c->caps |= MMC_CAP_4_BIT_DATA; | 384 | c->caps |= MMC_CAP_4_BIT_DATA; |
344 | } | ||
345 | /* FALLTHROUGH */ | ||
346 | case 3: | ||
347 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | ||
348 | /* off-chip level shifting, or none */ | ||
349 | mmc->slots[0].before_set_reg = hsmmc23_before_set_reg; | ||
350 | mmc->slots[0].after_set_reg = NULL; | ||
351 | } | ||
352 | break; | ||
353 | default: | ||
354 | pr_err("MMC%d configuration not supported!\n", c->mmc); | ||
355 | kfree(mmc); | ||
356 | continue; | ||
357 | } | 385 | } |
358 | hsmmc_data[c->mmc - 1] = mmc; | 386 | /* FALLTHROUGH */ |
387 | case 3: | ||
388 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | ||
389 | /* off-chip level shifting, or none */ | ||
390 | mmc->slots[0].before_set_reg = hsmmc23_before_set_reg; | ||
391 | mmc->slots[0].after_set_reg = NULL; | ||
392 | } | ||
393 | break; | ||
394 | case 4: | ||
395 | case 5: | ||
396 | mmc->slots[0].before_set_reg = NULL; | ||
397 | mmc->slots[0].after_set_reg = NULL; | ||
398 | break; | ||
399 | default: | ||
400 | pr_err("MMC%d configuration not supported!\n", c->mmc); | ||
401 | kfree(hc_name); | ||
402 | return -ENODEV; | ||
403 | } | ||
404 | return 0; | ||
405 | } | ||
406 | |||
407 | static struct omap_device_pm_latency omap_hsmmc_latency[] = { | ||
408 | [0] = { | ||
409 | .deactivate_func = omap_device_idle_hwmods, | ||
410 | .activate_func = omap_device_enable_hwmods, | ||
411 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
412 | }, | ||
413 | /* | ||
414 | * XXX There should also be an entry here to power off/on the | ||
415 | * MMC regulators/PBIAS cells, etc. | ||
416 | */ | ||
417 | }; | ||
418 | |||
419 | #define MAX_OMAP_MMC_HWMOD_NAME_LEN 16 | ||
420 | |||
421 | void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) | ||
422 | { | ||
423 | struct omap_hwmod *oh; | ||
424 | struct omap_device *od; | ||
425 | struct omap_device_pm_latency *ohl; | ||
426 | char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN]; | ||
427 | struct omap_mmc_platform_data *mmc_data; | ||
428 | struct omap_mmc_dev_attr *mmc_dev_attr; | ||
429 | char *name; | ||
430 | int l; | ||
431 | int ohl_cnt = 0; | ||
432 | |||
433 | mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL); | ||
434 | if (!mmc_data) { | ||
435 | pr_err("Cannot allocate memory for mmc device!\n"); | ||
436 | goto done; | ||
359 | } | 437 | } |
360 | 438 | ||
361 | omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); | 439 | if (omap_hsmmc_pdata_init(hsmmcinfo, mmc_data) < 0) { |
440 | pr_err("%s fails!\n", __func__); | ||
441 | goto done; | ||
442 | } | ||
443 | omap_hsmmc_mux(mmc_data, (ctrl_nr - 1)); | ||
444 | |||
445 | name = "omap_hsmmc"; | ||
446 | ohl = omap_hsmmc_latency; | ||
447 | ohl_cnt = ARRAY_SIZE(omap_hsmmc_latency); | ||
448 | |||
449 | l = snprintf(oh_name, MAX_OMAP_MMC_HWMOD_NAME_LEN, | ||
450 | "mmc%d", ctrl_nr); | ||
451 | WARN(l >= MAX_OMAP_MMC_HWMOD_NAME_LEN, | ||
452 | "String buffer overflow in MMC%d device setup\n", ctrl_nr); | ||
453 | oh = omap_hwmod_lookup(oh_name); | ||
454 | if (!oh) { | ||
455 | pr_err("Could not look up %s\n", oh_name); | ||
456 | kfree(mmc_data->slots[0].name); | ||
457 | goto done; | ||
458 | } | ||
362 | 459 | ||
363 | /* pass the device nodes back to board setup code */ | 460 | if (oh->dev_attr != NULL) { |
364 | for (c = controllers; c->mmc; c++) { | 461 | mmc_dev_attr = oh->dev_attr; |
365 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | 462 | mmc_data->controller_flags = mmc_dev_attr->flags; |
463 | } | ||
366 | 464 | ||
367 | if (!c->mmc || c->mmc > nr_hsmmc) | 465 | od = omap_device_build(name, ctrl_nr - 1, oh, mmc_data, |
368 | continue; | 466 | sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false); |
369 | c->dev = mmc->dev; | 467 | if (IS_ERR(od)) { |
468 | WARN(1, "Cant build omap_device for %s:%s.\n", name, oh->name); | ||
469 | kfree(mmc_data->slots[0].name); | ||
470 | goto done; | ||
370 | } | 471 | } |
472 | /* | ||
473 | * return device handle to board setup code | ||
474 | * required to populate for regulator framework structure | ||
475 | */ | ||
476 | hsmmcinfo->dev = &od->pdev.dev; | ||
371 | 477 | ||
372 | done: | 478 | done: |
373 | for (i = 0; i < nr_hsmmc; i++) | 479 | kfree(mmc_data); |
374 | kfree(hsmmc_data[i]); | 480 | } |
481 | |||
482 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
483 | { | ||
484 | u32 reg; | ||
485 | |||
486 | if (!cpu_is_omap44xx()) { | ||
487 | if (cpu_is_omap2430()) { | ||
488 | control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; | ||
489 | control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; | ||
490 | } else { | ||
491 | control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | ||
492 | control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; | ||
493 | } | ||
494 | } else { | ||
495 | control_pbias_offset = | ||
496 | OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; | ||
497 | control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; | ||
498 | reg = omap4_ctrl_pad_readl(control_mmc1); | ||
499 | reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | | ||
500 | OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); | ||
501 | reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | | ||
502 | OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); | ||
503 | reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK| | ||
504 | OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | | ||
505 | OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); | ||
506 | omap4_ctrl_pad_writel(reg, control_mmc1); | ||
507 | } | ||
508 | |||
509 | for (; controllers->mmc; controllers++) | ||
510 | omap_init_hsmmc(controllers, controllers->mmc); | ||
511 | |||
375 | } | 512 | } |
376 | 513 | ||
377 | #endif | 514 | #endif |
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c new file mode 100644 index 000000000000..06d4a80660a5 --- /dev/null +++ b/arch/arm/mach-omap2/hwspinlock.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * OMAP hardware spinlock device initialization | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * | ||
6 | * Contact: Simon Que <sque@ti.com> | ||
7 | * Hari Kanigeri <h-kanigeri2@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 | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/err.h> | ||
22 | |||
23 | #include <plat/omap_hwmod.h> | ||
24 | #include <plat/omap_device.h> | ||
25 | |||
26 | struct omap_device_pm_latency omap_spinlock_latency[] = { | ||
27 | { | ||
28 | .deactivate_func = omap_device_idle_hwmods, | ||
29 | .activate_func = omap_device_enable_hwmods, | ||
30 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
31 | } | ||
32 | }; | ||
33 | |||
34 | int __init hwspinlocks_init(void) | ||
35 | { | ||
36 | int retval = 0; | ||
37 | struct omap_hwmod *oh; | ||
38 | struct omap_device *od; | ||
39 | const char *oh_name = "spinlock"; | ||
40 | const char *dev_name = "omap_hwspinlock"; | ||
41 | |||
42 | /* | ||
43 | * Hwmod lookup will fail in case our platform doesn't support the | ||
44 | * hardware spinlock module, so it is safe to run this initcall | ||
45 | * on all omaps | ||
46 | */ | ||
47 | oh = omap_hwmod_lookup(oh_name); | ||
48 | if (oh == NULL) | ||
49 | return -EINVAL; | ||
50 | |||
51 | od = omap_device_build(dev_name, 0, oh, NULL, 0, | ||
52 | omap_spinlock_latency, | ||
53 | ARRAY_SIZE(omap_spinlock_latency), false); | ||
54 | if (IS_ERR(od)) { | ||
55 | pr_err("Can't build omap_device for %s:%s\n", dev_name, | ||
56 | oh_name); | ||
57 | retval = PTR_ERR(od); | ||
58 | } | ||
59 | |||
60 | return retval; | ||
61 | } | ||
62 | /* early board code might need to reserve specific hwspinlock instances */ | ||
63 | postcore_initcall(hwspinlocks_init); | ||
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 5f9086c65e48..2537090aa33a 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (C) 2005 Nokia Corporation | 6 | * Copyright (C) 2005 Nokia Corporation |
7 | * Written by Tony Lindgren <tony@atomide.com> | 7 | * Written by Tony Lindgren <tony@atomide.com> |
8 | * | 8 | * |
9 | * Copyright (C) 2009 Texas Instruments | 9 | * Copyright (C) 2009-11 Texas Instruments |
10 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | 10 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> |
11 | * | 11 | * |
12 | * 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 |
@@ -84,6 +84,11 @@ EXPORT_SYMBOL(omap_type); | |||
84 | #define OMAP_TAP_DIE_ID_2 0x0220 | 84 | #define OMAP_TAP_DIE_ID_2 0x0220 |
85 | #define OMAP_TAP_DIE_ID_3 0x0224 | 85 | #define OMAP_TAP_DIE_ID_3 0x0224 |
86 | 86 | ||
87 | #define OMAP_TAP_DIE_ID_44XX_0 0x0200 | ||
88 | #define OMAP_TAP_DIE_ID_44XX_1 0x0208 | ||
89 | #define OMAP_TAP_DIE_ID_44XX_2 0x020c | ||
90 | #define OMAP_TAP_DIE_ID_44XX_3 0x0210 | ||
91 | |||
87 | #define read_tap_reg(reg) __raw_readl(tap_base + (reg)) | 92 | #define read_tap_reg(reg) __raw_readl(tap_base + (reg)) |
88 | 93 | ||
89 | struct omap_id { | 94 | struct omap_id { |
@@ -107,6 +112,14 @@ static u16 tap_prod_id; | |||
107 | 112 | ||
108 | void omap_get_die_id(struct omap_die_id *odi) | 113 | void omap_get_die_id(struct omap_die_id *odi) |
109 | { | 114 | { |
115 | if (cpu_is_omap44xx()) { | ||
116 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0); | ||
117 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1); | ||
118 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2); | ||
119 | odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_3); | ||
120 | |||
121 | return; | ||
122 | } | ||
110 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); | 123 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); |
111 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); | 124 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); |
112 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); | 125 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); |
@@ -191,12 +204,19 @@ static void __init omap3_check_features(void) | |||
191 | if (!cpu_is_omap3505() && !cpu_is_omap3517()) | 204 | if (!cpu_is_omap3505() && !cpu_is_omap3517()) |
192 | omap3_features |= OMAP3_HAS_IO_WAKEUP; | 205 | omap3_features |= OMAP3_HAS_IO_WAKEUP; |
193 | 206 | ||
207 | omap3_features |= OMAP3_HAS_SDRC; | ||
208 | |||
194 | /* | 209 | /* |
195 | * TODO: Get additional info (where applicable) | 210 | * TODO: Get additional info (where applicable) |
196 | * e.g. Size of L2 cache. | 211 | * e.g. Size of L2 cache. |
197 | */ | 212 | */ |
198 | } | 213 | } |
199 | 214 | ||
215 | static void __init ti816x_check_features(void) | ||
216 | { | ||
217 | omap3_features = OMAP3_HAS_NEON; | ||
218 | } | ||
219 | |||
200 | static void __init omap3_check_revision(void) | 220 | static void __init omap3_check_revision(void) |
201 | { | 221 | { |
202 | u32 cpuid, idcode; | 222 | u32 cpuid, idcode; |
@@ -287,6 +307,20 @@ static void __init omap3_check_revision(void) | |||
287 | omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; | 307 | omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; |
288 | } | 308 | } |
289 | break; | 309 | break; |
310 | case 0xb81e: | ||
311 | omap_chip.oc = CHIP_IS_TI816X; | ||
312 | |||
313 | switch (rev) { | ||
314 | case 0: | ||
315 | omap_revision = TI8168_REV_ES1_0; | ||
316 | break; | ||
317 | case 1: | ||
318 | omap_revision = TI8168_REV_ES1_1; | ||
319 | break; | ||
320 | default: | ||
321 | omap_revision = TI8168_REV_ES1_1; | ||
322 | } | ||
323 | break; | ||
290 | default: | 324 | default: |
291 | /* Unknown default to latest silicon rev as default*/ | 325 | /* Unknown default to latest silicon rev as default*/ |
292 | omap_revision = OMAP3630_REV_ES1_2; | 326 | omap_revision = OMAP3630_REV_ES1_2; |
@@ -307,7 +341,7 @@ static void __init omap4_check_revision(void) | |||
307 | */ | 341 | */ |
308 | idcode = read_tap_reg(OMAP_TAP_IDCODE); | 342 | idcode = read_tap_reg(OMAP_TAP_IDCODE); |
309 | hawkeye = (idcode >> 12) & 0xffff; | 343 | hawkeye = (idcode >> 12) & 0xffff; |
310 | rev = (idcode >> 28) & 0xff; | 344 | rev = (idcode >> 28) & 0xf; |
311 | 345 | ||
312 | /* | 346 | /* |
313 | * Few initial ES2.0 samples IDCODE is same as ES1.0 | 347 | * Few initial ES2.0 samples IDCODE is same as ES1.0 |
@@ -326,22 +360,31 @@ static void __init omap4_check_revision(void) | |||
326 | omap_chip.oc |= CHIP_IS_OMAP4430ES1; | 360 | omap_chip.oc |= CHIP_IS_OMAP4430ES1; |
327 | break; | 361 | break; |
328 | case 1: | 362 | case 1: |
363 | default: | ||
329 | omap_revision = OMAP4430_REV_ES2_0; | 364 | omap_revision = OMAP4430_REV_ES2_0; |
330 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | 365 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; |
366 | } | ||
367 | break; | ||
368 | case 0xb95c: | ||
369 | switch (rev) { | ||
370 | case 3: | ||
371 | omap_revision = OMAP4430_REV_ES2_1; | ||
372 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_1; | ||
331 | break; | 373 | break; |
374 | case 4: | ||
332 | default: | 375 | default: |
333 | omap_revision = OMAP4430_REV_ES2_0; | 376 | omap_revision = OMAP4430_REV_ES2_2; |
334 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | 377 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_2; |
335 | } | 378 | } |
336 | break; | 379 | break; |
337 | default: | 380 | default: |
338 | /* Unknown default to latest silicon rev as default*/ | 381 | /* Unknown default to latest silicon rev as default */ |
339 | omap_revision = OMAP4430_REV_ES2_0; | 382 | omap_revision = OMAP4430_REV_ES2_2; |
340 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | 383 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_2; |
341 | } | 384 | } |
342 | 385 | ||
343 | pr_info("OMAP%04x ES%d.0\n", | 386 | pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, |
344 | omap_rev() >> 16, ((omap_rev() >> 12) & 0xf) + 1); | 387 | ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); |
345 | } | 388 | } |
346 | 389 | ||
347 | #define OMAP3_SHOW_FEATURE(feat) \ | 390 | #define OMAP3_SHOW_FEATURE(feat) \ |
@@ -372,6 +415,8 @@ static void __init omap3_cpuinfo(void) | |||
372 | /* Already set in omap3_check_revision() */ | 415 | /* Already set in omap3_check_revision() */ |
373 | strcpy(cpu_name, "AM3505"); | 416 | strcpy(cpu_name, "AM3505"); |
374 | } | 417 | } |
418 | } else if (cpu_is_ti816x()) { | ||
419 | strcpy(cpu_name, "TI816X"); | ||
375 | } else if (omap3_has_iva() && omap3_has_sgx()) { | 420 | } else if (omap3_has_iva() && omap3_has_sgx()) { |
376 | /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ | 421 | /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ |
377 | strcpy(cpu_name, "OMAP3430/3530"); | 422 | strcpy(cpu_name, "OMAP3430/3530"); |
@@ -386,7 +431,7 @@ static void __init omap3_cpuinfo(void) | |||
386 | strcpy(cpu_name, "OMAP3503"); | 431 | strcpy(cpu_name, "OMAP3503"); |
387 | } | 432 | } |
388 | 433 | ||
389 | if (cpu_is_omap3630()) { | 434 | if (cpu_is_omap3630() || cpu_is_ti816x()) { |
390 | switch (rev) { | 435 | switch (rev) { |
391 | case OMAP_REVBITS_00: | 436 | case OMAP_REVBITS_00: |
392 | strcpy(cpu_rev, "1.0"); | 437 | strcpy(cpu_rev, "1.0"); |
@@ -462,7 +507,13 @@ void __init omap2_check_revision(void) | |||
462 | omap24xx_check_revision(); | 507 | omap24xx_check_revision(); |
463 | } else if (cpu_is_omap34xx()) { | 508 | } else if (cpu_is_omap34xx()) { |
464 | omap3_check_revision(); | 509 | omap3_check_revision(); |
465 | omap3_check_features(); | 510 | |
511 | /* TI816X doesn't have feature register */ | ||
512 | if (!cpu_is_ti816x()) | ||
513 | omap3_check_features(); | ||
514 | else | ||
515 | ti816x_check_features(); | ||
516 | |||
466 | omap3_cpuinfo(); | 517 | omap3_cpuinfo(); |
467 | return; | 518 | return; |
468 | } else if (cpu_is_omap44xx()) { | 519 | } else if (cpu_is_omap44xx()) { |
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S index 6049f465ec84..48adfe9fe4f3 100644 --- a/arch/arm/mach-omap2/include/mach/debug-macro.S +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S | |||
@@ -72,6 +72,12 @@ omap_uart_lsr: .word 0 | |||
72 | beq 34f @ configure OMAP3UART4 | 72 | beq 34f @ configure OMAP3UART4 |
73 | cmp \rp, #OMAP4UART4 @ only on 44xx | 73 | cmp \rp, #OMAP4UART4 @ only on 44xx |
74 | beq 44f @ configure OMAP4UART4 | 74 | beq 44f @ configure OMAP4UART4 |
75 | cmp \rp, #TI816XUART1 @ ti816x UART offsets different | ||
76 | beq 81f @ configure UART1 | ||
77 | cmp \rp, #TI816XUART2 @ ti816x UART offsets different | ||
78 | beq 82f @ configure UART2 | ||
79 | cmp \rp, #TI816XUART3 @ ti816x UART offsets different | ||
80 | beq 83f @ configure UART3 | ||
75 | cmp \rp, #ZOOM_UART @ only on zoom2/3 | 81 | cmp \rp, #ZOOM_UART @ only on zoom2/3 |
76 | beq 95f @ configure ZOOM_UART | 82 | beq 95f @ configure ZOOM_UART |
77 | 83 | ||
@@ -94,6 +100,12 @@ omap_uart_lsr: .word 0 | |||
94 | b 98f | 100 | b 98f |
95 | 44: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) | 101 | 44: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) |
96 | b 98f | 102 | b 98f |
103 | 81: mov \rp, #UART_OFFSET(TI816X_UART1_BASE) | ||
104 | b 98f | ||
105 | 82: mov \rp, #UART_OFFSET(TI816X_UART2_BASE) | ||
106 | b 98f | ||
107 | 83: mov \rp, #UART_OFFSET(TI816X_UART3_BASE) | ||
108 | b 98f | ||
97 | 95: ldr \rp, =ZOOM_UART_BASE | 109 | 95: ldr \rp, =ZOOM_UART_BASE |
98 | mrc p15, 0, \rv, c1, c0 | 110 | mrc p15, 0, \rv, c1, c0 |
99 | tst \rv, #1 @ MMU enabled? | 111 | tst \rv, #1 @ MMU enabled? |
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S index 81985a665cb3..a48690b90990 100644 --- a/arch/arm/mach-omap2/include/mach/entry-macro.S +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S | |||
@@ -61,6 +61,14 @@ | |||
61 | bne 9998f | 61 | bne 9998f |
62 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ | 62 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ |
63 | cmp \irqnr, #0x0 | 63 | cmp \irqnr, #0x0 |
64 | bne 9998f | ||
65 | |||
66 | /* | ||
67 | * ti816x has additional IRQ pending register. Checking this | ||
68 | * register on omap2 & omap3 has no effect (read as 0). | ||
69 | */ | ||
70 | ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */ | ||
71 | cmp \irqnr, #0x0 | ||
64 | 9998: | 72 | 9998: |
65 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] | 73 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] |
66 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ | 74 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ |
@@ -133,6 +141,11 @@ | |||
133 | bne 9999f | 141 | bne 9999f |
134 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ | 142 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ |
135 | cmp \irqnr, #0x0 | 143 | cmp \irqnr, #0x0 |
144 | #ifdef CONFIG_SOC_OMAPTI816X | ||
145 | bne 9999f | ||
146 | ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */ | ||
147 | cmp \irqnr, #0x0 | ||
148 | #endif | ||
136 | 9999: | 149 | 9999: |
137 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] | 150 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] |
138 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ | 151 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ |
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h index 5b0270b28934..de441c05a6a6 100644 --- a/arch/arm/mach-omap2/include/mach/omap4-common.h +++ b/arch/arm/mach-omap2/include/mach/omap4-common.h | |||
@@ -17,8 +17,12 @@ | |||
17 | * wfi used in low power code. Directly opcode is used instead | 17 | * wfi used in low power code. Directly opcode is used instead |
18 | * of instruction to avoid mulit-omap build break | 18 | * of instruction to avoid mulit-omap build break |
19 | */ | 19 | */ |
20 | #ifdef CONFIG_THUMB2_KERNEL | ||
21 | #define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory") | ||
22 | #else | ||
20 | #define do_wfi() \ | 23 | #define do_wfi() \ |
21 | __asm__ __volatile__ (".word 0xe320f003" : : : "memory") | 24 | __asm__ __volatile__ (".word 0xe320f003" : : : "memory") |
25 | #endif | ||
22 | 26 | ||
23 | #ifdef CONFIG_CACHE_L2X0 | 27 | #ifdef CONFIG_CACHE_L2X0 |
24 | extern void __iomem *l2cache_base; | 28 | extern void __iomem *l2cache_base; |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index c2032041d26f..441e79d043a7 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #include <plat/sram.h> | 31 | #include <plat/sram.h> |
32 | #include <plat/sdrc.h> | 32 | #include <plat/sdrc.h> |
33 | #include <plat/gpmc.h> | ||
34 | #include <plat/serial.h> | 33 | #include <plat/serial.h> |
35 | 34 | ||
36 | #include "clock2xxx.h" | 35 | #include "clock2xxx.h" |
@@ -66,7 +65,7 @@ static struct map_desc omap24xx_io_desc[] __initdata = { | |||
66 | }, | 65 | }, |
67 | }; | 66 | }; |
68 | 67 | ||
69 | #ifdef CONFIG_ARCH_OMAP2420 | 68 | #ifdef CONFIG_SOC_OMAP2420 |
70 | static struct map_desc omap242x_io_desc[] __initdata = { | 69 | static struct map_desc omap242x_io_desc[] __initdata = { |
71 | { | 70 | { |
72 | .virtual = DSP_MEM_2420_VIRT, | 71 | .virtual = DSP_MEM_2420_VIRT, |
@@ -90,7 +89,7 @@ static struct map_desc omap242x_io_desc[] __initdata = { | |||
90 | 89 | ||
91 | #endif | 90 | #endif |
92 | 91 | ||
93 | #ifdef CONFIG_ARCH_OMAP2430 | 92 | #ifdef CONFIG_SOC_OMAP2430 |
94 | static struct map_desc omap243x_io_desc[] __initdata = { | 93 | static struct map_desc omap243x_io_desc[] __initdata = { |
95 | { | 94 | { |
96 | .virtual = L4_WK_243X_VIRT, | 95 | .virtual = L4_WK_243X_VIRT, |
@@ -175,6 +174,18 @@ static struct map_desc omap34xx_io_desc[] __initdata = { | |||
175 | #endif | 174 | #endif |
176 | }; | 175 | }; |
177 | #endif | 176 | #endif |
177 | |||
178 | #ifdef CONFIG_SOC_OMAPTI816X | ||
179 | static struct map_desc omapti816x_io_desc[] __initdata = { | ||
180 | { | ||
181 | .virtual = L4_34XX_VIRT, | ||
182 | .pfn = __phys_to_pfn(L4_34XX_PHYS), | ||
183 | .length = L4_34XX_SIZE, | ||
184 | .type = MT_DEVICE | ||
185 | }, | ||
186 | }; | ||
187 | #endif | ||
188 | |||
178 | #ifdef CONFIG_ARCH_OMAP4 | 189 | #ifdef CONFIG_ARCH_OMAP4 |
179 | static struct map_desc omap44xx_io_desc[] __initdata = { | 190 | static struct map_desc omap44xx_io_desc[] __initdata = { |
180 | { | 191 | { |
@@ -241,7 +252,7 @@ static void __init _omap2_map_common_io(void) | |||
241 | omap_sram_init(); | 252 | omap_sram_init(); |
242 | } | 253 | } |
243 | 254 | ||
244 | #ifdef CONFIG_ARCH_OMAP2420 | 255 | #ifdef CONFIG_SOC_OMAP2420 |
245 | void __init omap242x_map_common_io(void) | 256 | void __init omap242x_map_common_io(void) |
246 | { | 257 | { |
247 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); | 258 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); |
@@ -250,7 +261,7 @@ void __init omap242x_map_common_io(void) | |||
250 | } | 261 | } |
251 | #endif | 262 | #endif |
252 | 263 | ||
253 | #ifdef CONFIG_ARCH_OMAP2430 | 264 | #ifdef CONFIG_SOC_OMAP2430 |
254 | void __init omap243x_map_common_io(void) | 265 | void __init omap243x_map_common_io(void) |
255 | { | 266 | { |
256 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); | 267 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); |
@@ -267,6 +278,14 @@ void __init omap34xx_map_common_io(void) | |||
267 | } | 278 | } |
268 | #endif | 279 | #endif |
269 | 280 | ||
281 | #ifdef CONFIG_SOC_OMAPTI816X | ||
282 | void __init omapti816x_map_common_io(void) | ||
283 | { | ||
284 | iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc)); | ||
285 | _omap2_map_common_io(); | ||
286 | } | ||
287 | #endif | ||
288 | |||
270 | #ifdef CONFIG_ARCH_OMAP4 | 289 | #ifdef CONFIG_ARCH_OMAP4 |
271 | void __init omap44xx_map_common_io(void) | 290 | void __init omap44xx_map_common_io(void) |
272 | { | 291 | { |
@@ -337,15 +356,15 @@ void __init omap2_init_common_infrastructure(void) | |||
337 | 356 | ||
338 | if (cpu_is_omap242x()) { | 357 | if (cpu_is_omap242x()) { |
339 | omap2xxx_powerdomains_init(); | 358 | omap2xxx_powerdomains_init(); |
340 | omap2_clockdomains_init(); | 359 | omap2xxx_clockdomains_init(); |
341 | omap2420_hwmod_init(); | 360 | omap2420_hwmod_init(); |
342 | } else if (cpu_is_omap243x()) { | 361 | } else if (cpu_is_omap243x()) { |
343 | omap2xxx_powerdomains_init(); | 362 | omap2xxx_powerdomains_init(); |
344 | omap2_clockdomains_init(); | 363 | omap2xxx_clockdomains_init(); |
345 | omap2430_hwmod_init(); | 364 | omap2430_hwmod_init(); |
346 | } else if (cpu_is_omap34xx()) { | 365 | } else if (cpu_is_omap34xx()) { |
347 | omap3xxx_powerdomains_init(); | 366 | omap3xxx_powerdomains_init(); |
348 | omap2_clockdomains_init(); | 367 | omap3xxx_clockdomains_init(); |
349 | omap3xxx_hwmod_init(); | 368 | omap3xxx_hwmod_init(); |
350 | } else if (cpu_is_omap44xx()) { | 369 | } else if (cpu_is_omap44xx()) { |
351 | omap44xx_powerdomains_init(); | 370 | omap44xx_powerdomains_init(); |
@@ -398,15 +417,10 @@ void __init omap2_init_common_infrastructure(void) | |||
398 | void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, | 417 | void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, |
399 | struct omap_sdrc_params *sdrc_cs1) | 418 | struct omap_sdrc_params *sdrc_cs1) |
400 | { | 419 | { |
401 | omap_serial_early_init(); | 420 | if (cpu_is_omap24xx() || omap3_has_sdrc()) { |
402 | |||
403 | omap_hwmod_late_init(); | ||
404 | |||
405 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | ||
406 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); | 421 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); |
407 | _omap2_init_reprogram_sdrc(); | 422 | _omap2_init_reprogram_sdrc(); |
408 | } | 423 | } |
409 | gpmc_init(); | ||
410 | 424 | ||
411 | omap_irq_base_init(); | 425 | omap_irq_base_init(); |
412 | } | 426 | } |
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 14ee686b6492..adb083e41acd 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c | |||
@@ -145,35 +145,32 @@ static void omap2_iommu_set_twl(struct iommu *obj, bool on) | |||
145 | 145 | ||
146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) | 146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) |
147 | { | 147 | { |
148 | int i; | ||
149 | u32 stat, da; | 148 | u32 stat, da; |
150 | const char *err_msg[] = { | 149 | u32 errs = 0; |
151 | "tlb miss", | ||
152 | "translation fault", | ||
153 | "emulation miss", | ||
154 | "table walk fault", | ||
155 | "multi hit fault", | ||
156 | }; | ||
157 | 150 | ||
158 | stat = iommu_read_reg(obj, MMU_IRQSTATUS); | 151 | stat = iommu_read_reg(obj, MMU_IRQSTATUS); |
159 | stat &= MMU_IRQ_MASK; | 152 | stat &= MMU_IRQ_MASK; |
160 | if (!stat) | 153 | if (!stat) { |
154 | *ra = 0; | ||
161 | return 0; | 155 | return 0; |
156 | } | ||
162 | 157 | ||
163 | da = iommu_read_reg(obj, MMU_FAULT_AD); | 158 | da = iommu_read_reg(obj, MMU_FAULT_AD); |
164 | *ra = da; | 159 | *ra = da; |
165 | 160 | ||
166 | dev_err(obj->dev, "%s:\tda:%08x ", __func__, da); | 161 | if (stat & MMU_IRQ_TLBMISS) |
167 | 162 | errs |= OMAP_IOMMU_ERR_TLB_MISS; | |
168 | for (i = 0; i < ARRAY_SIZE(err_msg); i++) { | 163 | if (stat & MMU_IRQ_TRANSLATIONFAULT) |
169 | if (stat & (1 << i)) | 164 | errs |= OMAP_IOMMU_ERR_TRANS_FAULT; |
170 | printk("%s ", err_msg[i]); | 165 | if (stat & MMU_IRQ_EMUMISS) |
171 | } | 166 | errs |= OMAP_IOMMU_ERR_EMU_MISS; |
172 | printk("\n"); | 167 | if (stat & MMU_IRQ_TABLEWALKFAULT) |
173 | 168 | errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT; | |
169 | if (stat & MMU_IRQ_MULTIHITFAULT) | ||
170 | errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT; | ||
174 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); | 171 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); |
175 | 172 | ||
176 | return stat; | 173 | return errs; |
177 | } | 174 | } |
178 | 175 | ||
179 | static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) | 176 | static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index 23049c487c47..bc524b94fd59 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
@@ -61,8 +61,6 @@ struct omap3_intc_regs { | |||
61 | u32 mir[INTCPS_NR_MIR_REGS]; | 61 | u32 mir[INTCPS_NR_MIR_REGS]; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; | ||
65 | |||
66 | /* INTC bank register get/set */ | 64 | /* INTC bank register get/set */ |
67 | 65 | ||
68 | static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg) | 66 | static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg) |
@@ -110,7 +108,7 @@ static void omap_mask_irq(struct irq_data *d) | |||
110 | unsigned int irq = d->irq; | 108 | unsigned int irq = d->irq; |
111 | int offset = irq & (~(IRQ_BITS_PER_REG - 1)); | 109 | int offset = irq & (~(IRQ_BITS_PER_REG - 1)); |
112 | 110 | ||
113 | if (cpu_is_omap34xx()) { | 111 | if (cpu_is_omap34xx() && !cpu_is_ti816x()) { |
114 | int spurious = 0; | 112 | int spurious = 0; |
115 | 113 | ||
116 | /* | 114 | /* |
@@ -205,6 +203,9 @@ void __init omap_init_irq(void) | |||
205 | 203 | ||
206 | BUG_ON(!base); | 204 | BUG_ON(!base); |
207 | 205 | ||
206 | if (cpu_is_ti816x()) | ||
207 | bank->nr_irqs = 128; | ||
208 | |||
208 | /* Static mapping, never released */ | 209 | /* Static mapping, never released */ |
209 | bank->base_reg = ioremap(base, SZ_4K); | 210 | bank->base_reg = ioremap(base, SZ_4K); |
210 | if (!bank->base_reg) { | 211 | if (!bank->base_reg) { |
@@ -229,6 +230,8 @@ void __init omap_init_irq(void) | |||
229 | } | 230 | } |
230 | 231 | ||
231 | #ifdef CONFIG_ARCH_OMAP3 | 232 | #ifdef CONFIG_ARCH_OMAP3 |
233 | static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; | ||
234 | |||
232 | void omap_intc_save_context(void) | 235 | void omap_intc_save_context(void) |
233 | { | 236 | { |
234 | int ind = 0, i = 0; | 237 | int ind = 0, i = 0; |
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 24b88504df0f..86d564a640bb 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
@@ -14,12 +14,11 @@ | |||
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/pm_runtime.h> | ||
17 | #include <plat/mailbox.h> | 18 | #include <plat/mailbox.h> |
18 | #include <mach/irqs.h> | 19 | #include <mach/irqs.h> |
19 | 20 | ||
20 | #define MAILBOX_REVISION 0x000 | 21 | #define MAILBOX_REVISION 0x000 |
21 | #define MAILBOX_SYSCONFIG 0x010 | ||
22 | #define MAILBOX_SYSSTATUS 0x014 | ||
23 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) | 22 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) |
24 | #define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) | 23 | #define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) |
25 | #define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) | 24 | #define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) |
@@ -33,17 +32,6 @@ | |||
33 | #define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) | 32 | #define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) |
34 | #define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) | 33 | #define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) |
35 | 34 | ||
36 | /* SYSCONFIG: register bit definition */ | ||
37 | #define AUTOIDLE (1 << 0) | ||
38 | #define SOFTRESET (1 << 1) | ||
39 | #define SMARTIDLE (2 << 3) | ||
40 | #define OMAP4_SOFTRESET (1 << 0) | ||
41 | #define OMAP4_NOIDLE (1 << 2) | ||
42 | #define OMAP4_SMARTIDLE (2 << 2) | ||
43 | |||
44 | /* SYSSTATUS: register bit definition */ | ||
45 | #define RESETDONE (1 << 0) | ||
46 | |||
47 | #define MBOX_REG_SIZE 0x120 | 35 | #define MBOX_REG_SIZE 0x120 |
48 | 36 | ||
49 | #define OMAP4_MBOX_REG_SIZE 0x130 | 37 | #define OMAP4_MBOX_REG_SIZE 0x130 |
@@ -70,8 +58,6 @@ struct omap_mbox2_priv { | |||
70 | unsigned long irqdisable; | 58 | unsigned long irqdisable; |
71 | }; | 59 | }; |
72 | 60 | ||
73 | static struct clk *mbox_ick_handle; | ||
74 | |||
75 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, | 61 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, |
76 | omap_mbox_type_t irq); | 62 | omap_mbox_type_t irq); |
77 | 63 | ||
@@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs) | |||
89 | static int omap2_mbox_startup(struct omap_mbox *mbox) | 75 | static int omap2_mbox_startup(struct omap_mbox *mbox) |
90 | { | 76 | { |
91 | u32 l; | 77 | u32 l; |
92 | unsigned long timeout; | ||
93 | 78 | ||
94 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); | 79 | pm_runtime_enable(mbox->dev->parent); |
95 | if (IS_ERR(mbox_ick_handle)) { | 80 | pm_runtime_get_sync(mbox->dev->parent); |
96 | printk(KERN_ERR "Could not get mailboxes_ick: %ld\n", | ||
97 | PTR_ERR(mbox_ick_handle)); | ||
98 | return PTR_ERR(mbox_ick_handle); | ||
99 | } | ||
100 | clk_enable(mbox_ick_handle); | ||
101 | |||
102 | if (cpu_is_omap44xx()) { | ||
103 | mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG); | ||
104 | timeout = jiffies + msecs_to_jiffies(20); | ||
105 | do { | ||
106 | l = mbox_read_reg(MAILBOX_SYSCONFIG); | ||
107 | if (!(l & OMAP4_SOFTRESET)) | ||
108 | break; | ||
109 | } while (!time_after(jiffies, timeout)); | ||
110 | |||
111 | if (l & OMAP4_SOFTRESET) { | ||
112 | pr_err("Can't take mailbox out of reset\n"); | ||
113 | return -ENODEV; | ||
114 | } | ||
115 | } else { | ||
116 | mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); | ||
117 | timeout = jiffies + msecs_to_jiffies(20); | ||
118 | do { | ||
119 | l = mbox_read_reg(MAILBOX_SYSSTATUS); | ||
120 | if (l & RESETDONE) | ||
121 | break; | ||
122 | } while (!time_after(jiffies, timeout)); | ||
123 | |||
124 | if (!(l & RESETDONE)) { | ||
125 | pr_err("Can't take mailbox out of reset\n"); | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | } | ||
129 | 81 | ||
130 | l = mbox_read_reg(MAILBOX_REVISION); | 82 | l = mbox_read_reg(MAILBOX_REVISION); |
131 | pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); | 83 | pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); |
132 | 84 | ||
133 | if (cpu_is_omap44xx()) | ||
134 | l = OMAP4_SMARTIDLE; | ||
135 | else | ||
136 | l = SMARTIDLE | AUTOIDLE; | ||
137 | mbox_write_reg(l, MAILBOX_SYSCONFIG); | ||
138 | |||
139 | omap2_mbox_enable_irq(mbox, IRQ_RX); | 85 | omap2_mbox_enable_irq(mbox, IRQ_RX); |
140 | 86 | ||
141 | return 0; | 87 | return 0; |
@@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox) | |||
143 | 89 | ||
144 | static void omap2_mbox_shutdown(struct omap_mbox *mbox) | 90 | static void omap2_mbox_shutdown(struct omap_mbox *mbox) |
145 | { | 91 | { |
146 | clk_disable(mbox_ick_handle); | 92 | pm_runtime_put_sync(mbox->dev->parent); |
147 | clk_put(mbox_ick_handle); | 93 | pm_runtime_disable(mbox->dev->parent); |
148 | mbox_ick_handle = NULL; | ||
149 | } | 94 | } |
150 | 95 | ||
151 | /* Mailbox FIFO handle functions */ | 96 | /* Mailbox FIFO handle functions */ |
@@ -312,7 +257,7 @@ struct omap_mbox mbox_dsp_info = { | |||
312 | struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; | 257 | struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; |
313 | #endif | 258 | #endif |
314 | 259 | ||
315 | #if defined(CONFIG_ARCH_OMAP2420) | 260 | #if defined(CONFIG_SOC_OMAP2420) |
316 | /* IVA */ | 261 | /* IVA */ |
317 | static struct omap_mbox2_priv omap2_mbox_iva_priv = { | 262 | static struct omap_mbox2_priv omap2_mbox_iva_priv = { |
318 | .tx_fifo = { | 263 | .tx_fifo = { |
@@ -400,14 +345,14 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) | |||
400 | else if (cpu_is_omap34xx()) { | 345 | else if (cpu_is_omap34xx()) { |
401 | list = omap3_mboxes; | 346 | list = omap3_mboxes; |
402 | 347 | ||
403 | list[0]->irq = platform_get_irq_byname(pdev, "dsp"); | 348 | list[0]->irq = platform_get_irq(pdev, 0); |
404 | } | 349 | } |
405 | #endif | 350 | #endif |
406 | #if defined(CONFIG_ARCH_OMAP2) | 351 | #if defined(CONFIG_ARCH_OMAP2) |
407 | else if (cpu_is_omap2430()) { | 352 | else if (cpu_is_omap2430()) { |
408 | list = omap2_mboxes; | 353 | list = omap2_mboxes; |
409 | 354 | ||
410 | list[0]->irq = platform_get_irq_byname(pdev, "dsp"); | 355 | list[0]->irq = platform_get_irq(pdev, 0); |
411 | } else if (cpu_is_omap2420()) { | 356 | } else if (cpu_is_omap2420()) { |
412 | list = omap2_mboxes; | 357 | list = omap2_mboxes; |
413 | 358 | ||
@@ -419,8 +364,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) | |||
419 | else if (cpu_is_omap44xx()) { | 364 | else if (cpu_is_omap44xx()) { |
420 | list = omap4_mboxes; | 365 | list = omap4_mboxes; |
421 | 366 | ||
422 | list[0]->irq = list[1]->irq = | 367 | list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0); |
423 | platform_get_irq_byname(pdev, "mbox"); | ||
424 | } | 368 | } |
425 | #endif | 369 | #endif |
426 | else { | 370 | else { |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index f9c9df5b5ff1..565b9064a328 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -22,10 +22,11 @@ | |||
22 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
23 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
24 | #include <plat/mcbsp.h> | 24 | #include <plat/mcbsp.h> |
25 | #include <plat/omap_device.h> | ||
26 | #include <linux/pm_runtime.h> | ||
25 | 27 | ||
26 | #include "control.h" | 28 | #include "control.h" |
27 | 29 | ||
28 | |||
29 | /* McBSP internal signal muxing functions */ | 30 | /* McBSP internal signal muxing functions */ |
30 | 31 | ||
31 | void omap2_mcbsp1_mux_clkr_src(u8 mux) | 32 | void omap2_mcbsp1_mux_clkr_src(u8 mux) |
@@ -83,7 +84,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id) | |||
83 | return -EINVAL; | 84 | return -EINVAL; |
84 | } | 85 | } |
85 | 86 | ||
86 | clk_disable(mcbsp->fclk); | 87 | pm_runtime_put_sync(mcbsp->dev); |
87 | 88 | ||
88 | r = clk_set_parent(mcbsp->fclk, fck_src); | 89 | r = clk_set_parent(mcbsp->fclk, fck_src); |
89 | if (IS_ERR_VALUE(r)) { | 90 | if (IS_ERR_VALUE(r)) { |
@@ -93,7 +94,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id) | |||
93 | return -EINVAL; | 94 | return -EINVAL; |
94 | } | 95 | } |
95 | 96 | ||
96 | clk_enable(mcbsp->fclk); | 97 | pm_runtime_get_sync(mcbsp->dev); |
97 | 98 | ||
98 | clk_put(fck_src); | 99 | clk_put(fck_src); |
99 | 100 | ||
@@ -101,196 +102,70 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id) | |||
101 | } | 102 | } |
102 | EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); | 103 | EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); |
103 | 104 | ||
104 | 105 | struct omap_device_pm_latency omap2_mcbsp_latency[] = { | |
105 | /* Platform data */ | ||
106 | |||
107 | #ifdef CONFIG_ARCH_OMAP2420 | ||
108 | static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | ||
109 | { | 106 | { |
110 | .phys_base = OMAP24XX_MCBSP1_BASE, | 107 | .deactivate_func = omap_device_idle_hwmods, |
111 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | 108 | .activate_func = omap_device_enable_hwmods, |
112 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | 109 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, |
113 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | ||
114 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
115 | }, | ||
116 | { | ||
117 | .phys_base = OMAP24XX_MCBSP2_BASE, | ||
118 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | ||
119 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | ||
120 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
121 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
122 | }, | 110 | }, |
123 | }; | 111 | }; |
124 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) | ||
125 | #define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
126 | #else | ||
127 | #define omap2420_mcbsp_pdata NULL | ||
128 | #define OMAP2420_MCBSP_PDATA_SZ 0 | ||
129 | #define OMAP2420_MCBSP_REG_NUM 0 | ||
130 | #endif | ||
131 | 112 | ||
132 | #ifdef CONFIG_ARCH_OMAP2430 | 113 | static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) |
133 | static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | 114 | { |
134 | { | 115 | int id, count = 1; |
135 | .phys_base = OMAP24XX_MCBSP1_BASE, | 116 | char *name = "omap-mcbsp"; |
136 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | 117 | struct omap_hwmod *oh_device[2]; |
137 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | 118 | struct omap_mcbsp_platform_data *pdata = NULL; |
138 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | 119 | struct omap_device *od; |
139 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
140 | }, | ||
141 | { | ||
142 | .phys_base = OMAP24XX_MCBSP2_BASE, | ||
143 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | ||
144 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | ||
145 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
146 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
147 | }, | ||
148 | { | ||
149 | .phys_base = OMAP2430_MCBSP3_BASE, | ||
150 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, | ||
151 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, | ||
152 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | ||
153 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | ||
154 | }, | ||
155 | { | ||
156 | .phys_base = OMAP2430_MCBSP4_BASE, | ||
157 | .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX, | ||
158 | .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX, | ||
159 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | ||
160 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | ||
161 | }, | ||
162 | { | ||
163 | .phys_base = OMAP2430_MCBSP5_BASE, | ||
164 | .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX, | ||
165 | .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX, | ||
166 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, | ||
167 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, | ||
168 | }, | ||
169 | }; | ||
170 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) | ||
171 | #define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
172 | #else | ||
173 | #define omap2430_mcbsp_pdata NULL | ||
174 | #define OMAP2430_MCBSP_PDATA_SZ 0 | ||
175 | #define OMAP2430_MCBSP_REG_NUM 0 | ||
176 | #endif | ||
177 | 120 | ||
178 | #ifdef CONFIG_ARCH_OMAP3 | 121 | sscanf(oh->name, "mcbsp%d", &id); |
179 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | ||
180 | { | ||
181 | .phys_base = OMAP34XX_MCBSP1_BASE, | ||
182 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | ||
183 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | ||
184 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | ||
185 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
186 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
187 | }, | ||
188 | { | ||
189 | .phys_base = OMAP34XX_MCBSP2_BASE, | ||
190 | .phys_base_st = OMAP34XX_MCBSP2_ST_BASE, | ||
191 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | ||
192 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | ||
193 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
194 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
195 | .buffer_size = 0x500, /* The FIFO has 1024 + 256 locations */ | ||
196 | }, | ||
197 | { | ||
198 | .phys_base = OMAP34XX_MCBSP3_BASE, | ||
199 | .phys_base_st = OMAP34XX_MCBSP3_ST_BASE, | ||
200 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, | ||
201 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, | ||
202 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | ||
203 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | ||
204 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
205 | }, | ||
206 | { | ||
207 | .phys_base = OMAP34XX_MCBSP4_BASE, | ||
208 | .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX, | ||
209 | .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX, | ||
210 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | ||
211 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | ||
212 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
213 | }, | ||
214 | { | ||
215 | .phys_base = OMAP34XX_MCBSP5_BASE, | ||
216 | .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX, | ||
217 | .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX, | ||
218 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, | ||
219 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, | ||
220 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
221 | }, | ||
222 | }; | ||
223 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) | ||
224 | #define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
225 | #else | ||
226 | #define omap34xx_mcbsp_pdata NULL | ||
227 | #define OMAP34XX_MCBSP_PDATA_SZ 0 | ||
228 | #define OMAP34XX_MCBSP_REG_NUM 0 | ||
229 | #endif | ||
230 | 122 | ||
231 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | 123 | pdata = kzalloc(sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL); |
232 | { | 124 | if (!pdata) { |
233 | .phys_base = OMAP44XX_MCBSP1_BASE, | 125 | pr_err("%s: No memory for mcbsp\n", __func__); |
234 | .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX, | 126 | return -ENOMEM; |
235 | .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX, | 127 | } |
236 | .tx_irq = OMAP44XX_IRQ_MCBSP1, | 128 | |
237 | }, | 129 | pdata->mcbsp_config_type = oh->class->rev; |
238 | { | 130 | |
239 | .phys_base = OMAP44XX_MCBSP2_BASE, | 131 | if (oh->class->rev == MCBSP_CONFIG_TYPE3) { |
240 | .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, | 132 | if (id == 2) |
241 | .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, | 133 | /* The FIFO has 1024 + 256 locations */ |
242 | .tx_irq = OMAP44XX_IRQ_MCBSP2, | 134 | pdata->buffer_size = 0x500; |
243 | }, | 135 | else |
244 | { | 136 | /* The FIFO has 128 locations */ |
245 | .phys_base = OMAP44XX_MCBSP3_BASE, | 137 | pdata->buffer_size = 0x80; |
246 | .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, | 138 | } |
247 | .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, | 139 | |
248 | .tx_irq = OMAP44XX_IRQ_MCBSP3, | 140 | oh_device[0] = oh; |
249 | }, | 141 | |
250 | { | 142 | if (oh->dev_attr) { |
251 | .phys_base = OMAP44XX_MCBSP4_BASE, | 143 | oh_device[1] = omap_hwmod_lookup(( |
252 | .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, | 144 | (struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone); |
253 | .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, | 145 | count++; |
254 | .tx_irq = OMAP44XX_IRQ_MCBSP4, | 146 | } |
255 | }, | 147 | od = omap_device_build_ss(name, id, oh_device, count, pdata, |
256 | }; | 148 | sizeof(*pdata), omap2_mcbsp_latency, |
257 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) | 149 | ARRAY_SIZE(omap2_mcbsp_latency), false); |
258 | #define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | 150 | kfree(pdata); |
151 | if (IS_ERR(od)) { | ||
152 | pr_err("%s: Cant build omap_device for %s:%s.\n", __func__, | ||
153 | name, oh->name); | ||
154 | return PTR_ERR(od); | ||
155 | } | ||
156 | omap_mcbsp_count++; | ||
157 | return 0; | ||
158 | } | ||
259 | 159 | ||
260 | static int __init omap2_mcbsp_init(void) | 160 | static int __init omap2_mcbsp_init(void) |
261 | { | 161 | { |
262 | if (cpu_is_omap2420()) { | 162 | omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL); |
263 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; | ||
264 | omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16); | ||
265 | } else if (cpu_is_omap2430()) { | ||
266 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; | ||
267 | omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32); | ||
268 | } else if (cpu_is_omap34xx()) { | ||
269 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; | ||
270 | omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32); | ||
271 | } else if (cpu_is_omap44xx()) { | ||
272 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; | ||
273 | omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32); | ||
274 | } | ||
275 | 163 | ||
276 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 164 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
277 | GFP_KERNEL); | 165 | GFP_KERNEL); |
278 | if (!mcbsp_ptr) | 166 | if (!mcbsp_ptr) |
279 | return -ENOMEM; | 167 | return -ENOMEM; |
280 | 168 | ||
281 | if (cpu_is_omap2420()) | ||
282 | omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata, | ||
283 | OMAP2420_MCBSP_PDATA_SZ); | ||
284 | if (cpu_is_omap2430()) | ||
285 | omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata, | ||
286 | OMAP2430_MCBSP_PDATA_SZ); | ||
287 | if (cpu_is_omap34xx()) | ||
288 | omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, | ||
289 | OMAP34XX_MCBSP_PDATA_SZ); | ||
290 | if (cpu_is_omap44xx()) | ||
291 | omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata, | ||
292 | OMAP44XX_MCBSP_PDATA_SZ); | ||
293 | |||
294 | return omap_mcbsp_init(); | 169 | return omap_mcbsp_init(); |
295 | } | 170 | } |
296 | arch_initcall(omap2_mcbsp_init); | 171 | arch_initcall(omap2_mcbsp_init); |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 6c84659cf846..bb043cbb3886 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -258,7 +258,7 @@ struct omap_hwmod_mux_info * __init | |||
258 | omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) | 258 | omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) |
259 | { | 259 | { |
260 | struct omap_hwmod_mux_info *hmux; | 260 | struct omap_hwmod_mux_info *hmux; |
261 | int i; | 261 | int i, nr_pads_dynamic = 0; |
262 | 262 | ||
263 | if (!bpads || nr_pads < 1) | 263 | if (!bpads || nr_pads < 1) |
264 | return NULL; | 264 | return NULL; |
@@ -302,9 +302,40 @@ omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) | |||
302 | pad->enable = bpad->enable; | 302 | pad->enable = bpad->enable; |
303 | pad->idle = bpad->idle; | 303 | pad->idle = bpad->idle; |
304 | pad->off = bpad->off; | 304 | pad->off = bpad->off; |
305 | |||
306 | if (pad->flags & OMAP_DEVICE_PAD_REMUX) | ||
307 | nr_pads_dynamic++; | ||
308 | |||
305 | pr_debug("%s: Initialized %s\n", __func__, pad->name); | 309 | pr_debug("%s: Initialized %s\n", __func__, pad->name); |
306 | } | 310 | } |
307 | 311 | ||
312 | if (!nr_pads_dynamic) | ||
313 | return hmux; | ||
314 | |||
315 | /* | ||
316 | * Add pads that need dynamic muxing into a separate list | ||
317 | */ | ||
318 | |||
319 | hmux->nr_pads_dynamic = nr_pads_dynamic; | ||
320 | hmux->pads_dynamic = kzalloc(sizeof(struct omap_device_pad *) * | ||
321 | nr_pads_dynamic, GFP_KERNEL); | ||
322 | if (!hmux->pads_dynamic) { | ||
323 | pr_err("%s: Could not allocate dynamic pads\n", __func__); | ||
324 | return hmux; | ||
325 | } | ||
326 | |||
327 | nr_pads_dynamic = 0; | ||
328 | for (i = 0; i < hmux->nr_pads; i++) { | ||
329 | struct omap_device_pad *pad = &hmux->pads[i]; | ||
330 | |||
331 | if (pad->flags & OMAP_DEVICE_PAD_REMUX) { | ||
332 | pr_debug("%s: pad %s tagged dynamic\n", | ||
333 | __func__, pad->name); | ||
334 | hmux->pads_dynamic[nr_pads_dynamic] = pad; | ||
335 | nr_pads_dynamic++; | ||
336 | } | ||
337 | } | ||
338 | |||
308 | return hmux; | 339 | return hmux; |
309 | 340 | ||
310 | err3: | 341 | err3: |
@@ -322,6 +353,36 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) | |||
322 | { | 353 | { |
323 | int i; | 354 | int i; |
324 | 355 | ||
356 | /* Runtime idling of dynamic pads */ | ||
357 | if (state == _HWMOD_STATE_IDLE && hmux->enabled) { | ||
358 | for (i = 0; i < hmux->nr_pads_dynamic; i++) { | ||
359 | struct omap_device_pad *pad = hmux->pads_dynamic[i]; | ||
360 | int val = -EINVAL; | ||
361 | |||
362 | val = pad->idle; | ||
363 | omap_mux_write(pad->partition, val, | ||
364 | pad->mux->reg_offset); | ||
365 | } | ||
366 | |||
367 | return; | ||
368 | } | ||
369 | |||
370 | /* Runtime enabling of dynamic pads */ | ||
371 | if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic | ||
372 | && hmux->enabled) { | ||
373 | for (i = 0; i < hmux->nr_pads_dynamic; i++) { | ||
374 | struct omap_device_pad *pad = hmux->pads_dynamic[i]; | ||
375 | int val = -EINVAL; | ||
376 | |||
377 | val = pad->enable; | ||
378 | omap_mux_write(pad->partition, val, | ||
379 | pad->mux->reg_offset); | ||
380 | } | ||
381 | |||
382 | return; | ||
383 | } | ||
384 | |||
385 | /* Enabling or disabling of all pads */ | ||
325 | for (i = 0; i < hmux->nr_pads; i++) { | 386 | for (i = 0; i < hmux->nr_pads; i++) { |
326 | struct omap_device_pad *pad = &hmux->pads[i]; | 387 | struct omap_device_pad *pad = &hmux->pads[i]; |
327 | int flags, val = -EINVAL; | 388 | int flags, val = -EINVAL; |
@@ -330,31 +391,22 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) | |||
330 | 391 | ||
331 | switch (state) { | 392 | switch (state) { |
332 | case _HWMOD_STATE_ENABLED: | 393 | case _HWMOD_STATE_ENABLED: |
333 | if (flags & OMAP_DEVICE_PAD_ENABLED) | ||
334 | break; | ||
335 | flags |= OMAP_DEVICE_PAD_ENABLED; | ||
336 | val = pad->enable; | 394 | val = pad->enable; |
337 | pr_debug("%s: Enabling %s %x\n", __func__, | 395 | pr_debug("%s: Enabling %s %x\n", __func__, |
338 | pad->name, val); | 396 | pad->name, val); |
339 | break; | 397 | 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: | 398 | case _HWMOD_STATE_DISABLED: |
349 | default: | ||
350 | /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */ | 399 | /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */ |
351 | if (flags & OMAP_DEVICE_PAD_REMUX) | 400 | if (flags & OMAP_DEVICE_PAD_REMUX) |
352 | val = pad->off; | 401 | val = pad->off; |
353 | else | 402 | else |
354 | val = OMAP_MUX_MODE7; | 403 | val = OMAP_MUX_MODE7; |
355 | flags &= ~OMAP_DEVICE_PAD_ENABLED; | ||
356 | pr_debug("%s: Disabling %s %x\n", __func__, | 404 | pr_debug("%s: Disabling %s %x\n", __func__, |
357 | pad->name, val); | 405 | pad->name, val); |
406 | break; | ||
407 | default: | ||
408 | /* Nothing to be done */ | ||
409 | break; | ||
358 | }; | 410 | }; |
359 | 411 | ||
360 | if (val >= 0) { | 412 | if (val >= 0) { |
@@ -363,6 +415,11 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) | |||
363 | pad->flags = flags; | 415 | pad->flags = flags; |
364 | } | 416 | } |
365 | } | 417 | } |
418 | |||
419 | if (state == _HWMOD_STATE_ENABLED) | ||
420 | hmux->enabled = true; | ||
421 | else | ||
422 | hmux->enabled = false; | ||
366 | } | 423 | } |
367 | 424 | ||
368 | #ifdef CONFIG_DEBUG_FS | 425 | #ifdef CONFIG_DEBUG_FS |
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index a4ab17a737a6..137f321c029f 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
@@ -159,7 +159,6 @@ struct omap_board_mux { | |||
159 | u16 value; | 159 | u16 value; |
160 | }; | 160 | }; |
161 | 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, | 162 | #define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad, |
164 | needs enable, idle and off | 163 | needs enable, idle and off |
165 | values */ | 164 | values */ |
@@ -187,6 +186,12 @@ struct omap_device_pad { | |||
187 | 186 | ||
188 | struct omap_hwmod_mux_info; | 187 | struct omap_hwmod_mux_info; |
189 | 188 | ||
189 | #define OMAP_MUX_STATIC(signal, mode) \ | ||
190 | { \ | ||
191 | .name = (signal), \ | ||
192 | .enable = (mode), \ | ||
193 | } | ||
194 | |||
190 | #if defined(CONFIG_OMAP_MUX) | 195 | #if defined(CONFIG_OMAP_MUX) |
191 | 196 | ||
192 | /** | 197 | /** |
diff --git a/arch/arm/mach-omap2/mux44xx.c b/arch/arm/mach-omap2/mux44xx.c index c322e7bdaa17..9a66445112ae 100644 --- a/arch/arm/mach-omap2/mux44xx.c +++ b/arch/arm/mach-omap2/mux44xx.c | |||
@@ -755,25 +755,9 @@ static struct omap_ball __initdata omap4_core_cbl_ball[] = { | |||
755 | #endif | 755 | #endif |
756 | 756 | ||
757 | /* | 757 | /* |
758 | * Superset of all mux modes for omap4 ES2.0 | 758 | * Signals different on ES2.0 compared to superset |
759 | */ | 759 | */ |
760 | static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | 760 | static struct omap_mux __initdata omap4_es2_core_subset[] = { |
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", | 761 | _OMAP4_MUXENTRY(GPMC_AD8, 32, "gpmc_ad8", "kpd_row0", "c2c_data15", |
778 | "gpio_32", NULL, "sdmmc1_dat0", NULL, NULL), | 762 | "gpio_32", NULL, "sdmmc1_dat0", NULL, NULL), |
779 | _OMAP4_MUXENTRY(GPMC_AD9, 33, "gpmc_ad9", "kpd_row1", "c2c_data14", | 763 | _OMAP4_MUXENTRY(GPMC_AD9, 33, "gpmc_ad9", "kpd_row1", "c2c_data14", |
@@ -792,52 +776,15 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
792 | "gpio_39", NULL, "sdmmc1_dat7", NULL, NULL), | 776 | "gpio_39", NULL, "sdmmc1_dat7", NULL, NULL), |
793 | _OMAP4_MUXENTRY(GPMC_A16, 40, "gpmc_a16", "kpd_row4", "c2c_datain0", | 777 | _OMAP4_MUXENTRY(GPMC_A16, 40, "gpmc_a16", "kpd_row4", "c2c_datain0", |
794 | "gpio_40", "venc_656_data0", NULL, NULL, "safe_mode"), | 778 | "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", | 779 | _OMAP4_MUXENTRY(GPMC_A24, 48, "gpmc_a24", "kpd_col8", "c2c_clkout0", |
810 | "gpio_48", NULL, NULL, NULL, "safe_mode"), | 780 | "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", | 781 | _OMAP4_MUXENTRY(GPMC_NCS2, 52, "gpmc_ncs2", "kpd_row8", |
818 | "c2c_dataout7", "gpio_52", NULL, NULL, NULL, | 782 | "c2c_dataout7", "gpio_52", NULL, NULL, NULL, |
819 | "safe_mode"), | 783 | "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", | 784 | _OMAP4_MUXENTRY(GPMC_CLK, 55, "gpmc_clk", NULL, NULL, "gpio_55", |
826 | "sys_ndmareq2", "sdmmc1_cmd", NULL, NULL), | 785 | "sys_ndmareq2", "sdmmc1_cmd", NULL, NULL), |
827 | _OMAP4_MUXENTRY(GPMC_NADV_ALE, 56, "gpmc_nadv_ale", "dsi1_te1", NULL, | 786 | _OMAP4_MUXENTRY(GPMC_NADV_ALE, 56, "gpmc_nadv_ale", "dsi1_te1", NULL, |
828 | "gpio_56", "sys_ndmareq3", "sdmmc1_clk", NULL, NULL), | 787 | "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", | 788 | _OMAP4_MUXENTRY(GPMC_WAIT2, 100, "gpmc_wait2", "usbc1_icusb_txen", |
842 | "c2c_dataout3", "gpio_100", "sys_ndmareq0", NULL, | 789 | "c2c_dataout3", "gpio_100", "sys_ndmareq0", NULL, |
843 | NULL, "safe_mode"), | 790 | NULL, "safe_mode"), |
@@ -851,62 +798,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
851 | _OMAP4_MUXENTRY(GPMC_NCS7, 104, "gpmc_ncs7", "dsi2_te1", | 798 | _OMAP4_MUXENTRY(GPMC_NCS7, 104, "gpmc_ncs7", "dsi2_te1", |
852 | "c2c_dataout1", "gpio_104", NULL, NULL, NULL, | 799 | "c2c_dataout1", "gpio_104", NULL, NULL, NULL, |
853 | "safe_mode"), | 800 | "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", | 801 | _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT0, 88, "usbb1_ulpitll_dat0", |
911 | "hsi1_acwake", "mcbsp4_clkx", "gpio_88", | 802 | "hsi1_acwake", "mcbsp4_clkx", "gpio_88", |
912 | "usbb1_ulpiphy_dat0", "usbb1_mm_txen", "hw_dbg24", | 803 | "usbb1_ulpiphy_dat0", "usbb1_mm_txen", "hw_dbg24", |
@@ -922,84 +813,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
922 | _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT3, 91, "usbb1_ulpitll_dat3", | 813 | _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT3, 91, "usbb1_ulpitll_dat3", |
923 | "hsi1_caready", NULL, "gpio_91", "usbb1_ulpiphy_dat3", | 814 | "hsi1_caready", NULL, "gpio_91", "usbb1_ulpiphy_dat3", |
924 | "usbb1_mm_rxrcv", "hw_dbg27", "safe_mode"), | 815 | "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, | 816 | _OMAP4_MUXENTRY(ABE_DMIC_CLK1, 119, "abe_dmic_clk1", NULL, NULL, |
1004 | "gpio_119", "usbb2_mm_txse0", "uart4_cts", NULL, | 817 | "gpio_119", "usbb2_mm_txse0", "uart4_cts", NULL, |
1005 | "safe_mode"), | 818 | "safe_mode"), |
@@ -1012,58 +825,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
1012 | _OMAP4_MUXENTRY(ABE_DMIC_DIN3, 122, "abe_dmic_din3", "slimbus2_data", | 825 | _OMAP4_MUXENTRY(ABE_DMIC_DIN3, 122, "abe_dmic_din3", "slimbus2_data", |
1013 | "abe_dmic_clk2", "gpio_122", NULL, "dmtimer9_pwm_evt", | 826 | "abe_dmic_clk2", "gpio_122", NULL, "dmtimer9_pwm_evt", |
1014 | NULL, "safe_mode"), | 827 | 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", | 828 | _OMAP4_MUXENTRY(SDMMC5_CLK, 145, "sdmmc5_clk", "mcspi2_clk", |
1068 | "usbc1_icusb_dp", "gpio_145", NULL, "sdmmc2_clk", | 829 | "usbc1_icusb_dp", "gpio_145", NULL, "sdmmc2_clk", |
1069 | NULL, "safe_mode"), | 830 | NULL, "safe_mode"), |
@@ -1096,9 +857,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
1096 | "gpio_155", NULL, NULL, NULL, "safe_mode"), | 857 | "gpio_155", NULL, NULL, NULL, "safe_mode"), |
1097 | _OMAP4_MUXENTRY(UART4_TX, 156, "uart4_tx", "sdmmc4_dat1", "kpd_col8", | 858 | _OMAP4_MUXENTRY(UART4_TX, 156, "uart4_tx", "sdmmc4_dat1", "kpd_col8", |
1098 | "gpio_156", NULL, NULL, NULL, "safe_mode"), | 859 | "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", | 860 | _OMAP4_MUXENTRY(USBB2_ULPITLL_STP, 158, "usbb2_ulpitll_stp", |
1103 | "usbb2_ulpiphy_stp", "sdmmc4_clk", "gpio_158", | 861 | "usbb2_ulpiphy_stp", "sdmmc4_clk", "gpio_158", |
1104 | "hsi2_cadata", "dispc2_data23", NULL, "safe_mode"), | 862 | "hsi2_cadata", "dispc2_data23", NULL, "safe_mode"), |
@@ -1140,10 +898,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
1140 | "usbb2_ulpiphy_dat7", "sdmmc3_clk", "gpio_168", | 898 | "usbb2_ulpiphy_dat7", "sdmmc3_clk", "gpio_168", |
1141 | "mcspi3_clk", "dispc2_data11", "rfbi_data11", | 899 | "mcspi3_clk", "dispc2_data11", "rfbi_data11", |
1142 | "safe_mode"), | 900 | "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, | 901 | _OMAP4_MUXENTRY(KPD_COL3, 171, "kpd_col3", "kpd_col0", NULL, |
1148 | "gpio_171", NULL, NULL, NULL, "safe_mode"), | 902 | "gpio_171", NULL, NULL, NULL, "safe_mode"), |
1149 | _OMAP4_MUXENTRY(KPD_COL4, 172, "kpd_col4", "kpd_col1", NULL, | 903 | _OMAP4_MUXENTRY(KPD_COL4, 172, "kpd_col4", "kpd_col1", NULL, |
@@ -1168,36 +922,10 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { | |||
1168 | NULL, NULL, NULL, "safe_mode"), | 922 | NULL, NULL, NULL, "safe_mode"), |
1169 | _OMAP4_MUXENTRY(KPD_ROW2, 3, "kpd_row2", "kpd_row5", NULL, "gpio_3", | 923 | _OMAP4_MUXENTRY(KPD_ROW2, 3, "kpd_row2", "kpd_row5", NULL, "gpio_3", |
1170 | NULL, NULL, NULL, "safe_mode"), | 924 | 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", | 925 | _OMAP4_MUXENTRY(USBA0_OTG_DP, 0, "usba0_otg_dp", "uart3_rx_irrx", |
1174 | "uart2_rx", NULL, NULL, NULL, NULL, "safe_mode"), | 926 | "uart2_rx", NULL, NULL, NULL, NULL, "safe_mode"), |
1175 | _OMAP4_MUXENTRY(USBA0_OTG_DM, 0, "usba0_otg_dm", "uart3_tx_irtx", | 927 | _OMAP4_MUXENTRY(USBA0_OTG_DM, 0, "usba0_otg_dm", "uart3_tx_irtx", |
1176 | "uart2_tx", NULL, NULL, NULL, NULL, "safe_mode"), | 928 | "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, | 929 | _OMAP4_MUXENTRY(DPM_EMU2, 13, "dpm_emu2", "usba0_ulpiphy_clk", NULL, |
1202 | "gpio_13", NULL, "dispc2_fid", "hw_dbg2", | 930 | "gpio_13", NULL, "dispc2_fid", "hw_dbg2", |
1203 | "safe_mode"), | 931 | "safe_mode"), |
@@ -1586,6 +1314,7 @@ int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags) | |||
1586 | struct omap_ball *package_balls_core; | 1314 | struct omap_ball *package_balls_core; |
1587 | struct omap_ball *package_balls_wkup = omap4_wkup_cbl_cbs_ball; | 1315 | struct omap_ball *package_balls_wkup = omap4_wkup_cbl_cbs_ball; |
1588 | struct omap_mux *core_muxmodes; | 1316 | struct omap_mux *core_muxmodes; |
1317 | struct omap_mux *core_subset = NULL; | ||
1589 | int ret; | 1318 | int ret; |
1590 | 1319 | ||
1591 | switch (flags & OMAP_PACKAGE_MASK) { | 1320 | switch (flags & OMAP_PACKAGE_MASK) { |
@@ -1597,7 +1326,8 @@ int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags) | |||
1597 | case OMAP_PACKAGE_CBS: | 1326 | case OMAP_PACKAGE_CBS: |
1598 | pr_debug("%s: OMAP4430 ES2.X -> OMAP_PACKAGE_CBS\n", __func__); | 1327 | pr_debug("%s: OMAP4430 ES2.X -> OMAP_PACKAGE_CBS\n", __func__); |
1599 | package_balls_core = omap4_core_cbs_ball; | 1328 | package_balls_core = omap4_core_cbs_ball; |
1600 | core_muxmodes = omap4_es2_core_muxmodes; | 1329 | core_muxmodes = omap4_core_muxmodes; |
1330 | core_subset = omap4_es2_core_subset; | ||
1601 | break; | 1331 | break; |
1602 | default: | 1332 | default: |
1603 | pr_err("%s: Unknown omap package, mux disabled\n", __func__); | 1333 | pr_err("%s: Unknown omap package, mux disabled\n", __func__); |
@@ -1608,7 +1338,7 @@ int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags) | |||
1608 | OMAP_MUX_GPIO_IN_MODE3, | 1338 | OMAP_MUX_GPIO_IN_MODE3, |
1609 | OMAP4_CTRL_MODULE_PAD_CORE_MUX_PBASE, | 1339 | OMAP4_CTRL_MODULE_PAD_CORE_MUX_PBASE, |
1610 | OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE, | 1340 | OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE, |
1611 | core_muxmodes, NULL, board_subset, | 1341 | core_muxmodes, core_subset, board_subset, |
1612 | package_balls_core); | 1342 | package_balls_core); |
1613 | if (ret) | 1343 | if (ret) |
1614 | return ret; | 1344 | return ret; |
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S index 6ae937a06cc1..4ee6aeca885a 100644 --- a/arch/arm/mach-omap2/omap-headsmp.S +++ b/arch/arm/mach-omap2/omap-headsmp.S | |||
@@ -45,5 +45,5 @@ hold: ldr r12,=0x103 | |||
45 | * should now contain the SVC stack for this core | 45 | * should now contain the SVC stack for this core |
46 | */ | 46 | */ |
47 | b secondary_startup | 47 | b secondary_startup |
48 | END(omap_secondary_startup) | 48 | ENDPROC(omap_secondary_startup) |
49 | 49 | ||
diff --git a/arch/arm/mach-omap2/omap44xx-smc.S b/arch/arm/mach-omap2/omap44xx-smc.S index 1980dc31a1a2..e69d37d95204 100644 --- a/arch/arm/mach-omap2/omap44xx-smc.S +++ b/arch/arm/mach-omap2/omap44xx-smc.S | |||
@@ -29,7 +29,7 @@ ENTRY(omap_smc1) | |||
29 | dsb | 29 | dsb |
30 | smc #0 | 30 | smc #0 |
31 | ldmfd sp!, {r2-r12, pc} | 31 | ldmfd sp!, {r2-r12, pc} |
32 | END(omap_smc1) | 32 | ENDPROC(omap_smc1) |
33 | 33 | ||
34 | ENTRY(omap_modify_auxcoreboot0) | 34 | ENTRY(omap_modify_auxcoreboot0) |
35 | stmfd sp!, {r1-r12, lr} | 35 | stmfd sp!, {r1-r12, lr} |
@@ -37,7 +37,7 @@ ENTRY(omap_modify_auxcoreboot0) | |||
37 | dsb | 37 | dsb |
38 | smc #0 | 38 | smc #0 |
39 | ldmfd sp!, {r1-r12, pc} | 39 | ldmfd sp!, {r1-r12, pc} |
40 | END(omap_modify_auxcoreboot0) | 40 | ENDPROC(omap_modify_auxcoreboot0) |
41 | 41 | ||
42 | ENTRY(omap_auxcoreboot_addr) | 42 | ENTRY(omap_auxcoreboot_addr) |
43 | stmfd sp!, {r2-r12, lr} | 43 | stmfd sp!, {r2-r12, lr} |
@@ -45,7 +45,7 @@ ENTRY(omap_auxcoreboot_addr) | |||
45 | dsb | 45 | dsb |
46 | smc #0 | 46 | smc #0 |
47 | ldmfd sp!, {r2-r12, pc} | 47 | ldmfd sp!, {r2-r12, pc} |
48 | END(omap_auxcoreboot_addr) | 48 | ENDPROC(omap_auxcoreboot_addr) |
49 | 49 | ||
50 | ENTRY(omap_read_auxcoreboot0) | 50 | ENTRY(omap_read_auxcoreboot0) |
51 | stmfd sp!, {r2-r12, lr} | 51 | stmfd sp!, {r2-r12, lr} |
@@ -54,4 +54,4 @@ ENTRY(omap_read_auxcoreboot0) | |||
54 | smc #0 | 54 | smc #0 |
55 | mov r0, r0, lsr #9 | 55 | mov r0, r0, lsr #9 |
56 | ldmfd sp!, {r2-r12, pc} | 56 | ldmfd sp!, {r2-r12, pc} |
57 | END(omap_read_auxcoreboot0) | 57 | ENDPROC(omap_read_auxcoreboot0) |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e282e35769fd..e03429453ce7 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * omap_hwmod implementation for OMAP2/3/4 | 2 | * omap_hwmod implementation for OMAP2/3/4 |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Nokia Corporation | 4 | * Copyright (C) 2009-2011 Nokia Corporation |
5 | * | 5 | * |
6 | * Paul Walmsley, Benoît Cousson, Kevin Hilman | 6 | * Paul Walmsley, Benoît Cousson, Kevin Hilman |
7 | * | 7 | * |
@@ -162,9 +162,6 @@ static LIST_HEAD(omap_hwmod_list); | |||
162 | /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ | 162 | /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ |
163 | static struct omap_hwmod *mpu_oh; | 163 | static struct omap_hwmod *mpu_oh; |
164 | 164 | ||
165 | /* inited: 0 if omap_hwmod_init() has not yet been called; 1 otherwise */ | ||
166 | static u8 inited; | ||
167 | |||
168 | 165 | ||
169 | /* Private functions */ | 166 | /* Private functions */ |
170 | 167 | ||
@@ -373,7 +370,7 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, | |||
373 | } | 370 | } |
374 | 371 | ||
375 | autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift; | 372 | autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift; |
376 | autoidle_mask = (0x3 << autoidle_shift); | 373 | autoidle_mask = (0x1 << autoidle_shift); |
377 | 374 | ||
378 | *v &= ~autoidle_mask; | 375 | *v &= ~autoidle_mask; |
379 | *v |= autoidle << autoidle_shift; | 376 | *v |= autoidle << autoidle_shift; |
@@ -460,14 +457,18 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) | |||
460 | * will be accessed by a particular initiator (e.g., if a module will | 457 | * will be accessed by a particular initiator (e.g., if a module will |
461 | * be accessed by the IVA, there should be a sleepdep between the IVA | 458 | * be accessed by the IVA, there should be a sleepdep between the IVA |
462 | * initiator and the module). Only applies to modules in smart-idle | 459 | * initiator and the module). Only applies to modules in smart-idle |
463 | * mode. Returns -EINVAL upon error or passes along | 460 | * mode. If the clockdomain is marked as not needing autodeps, return |
464 | * clkdm_add_sleepdep() value upon success. | 461 | * 0 without doing anything. Otherwise, returns -EINVAL upon error or |
462 | * passes along clkdm_add_sleepdep() value upon success. | ||
465 | */ | 463 | */ |
466 | static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | 464 | static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) |
467 | { | 465 | { |
468 | if (!oh->_clk) | 466 | if (!oh->_clk) |
469 | return -EINVAL; | 467 | return -EINVAL; |
470 | 468 | ||
469 | if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) | ||
470 | return 0; | ||
471 | |||
471 | return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); | 472 | return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); |
472 | } | 473 | } |
473 | 474 | ||
@@ -480,14 +481,18 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | |||
480 | * be accessed by a particular initiator (e.g., if a module will not | 481 | * be accessed by a particular initiator (e.g., if a module will not |
481 | * be accessed by the IVA, there should be no sleepdep between the IVA | 482 | * be accessed by the IVA, there should be no sleepdep between the IVA |
482 | * initiator and the module). Only applies to modules in smart-idle | 483 | * initiator and the module). Only applies to modules in smart-idle |
483 | * mode. Returns -EINVAL upon error or passes along | 484 | * mode. If the clockdomain is marked as not needing autodeps, return |
484 | * clkdm_del_sleepdep() value upon success. | 485 | * 0 without doing anything. Returns -EINVAL upon error or passes |
486 | * along clkdm_del_sleepdep() value upon success. | ||
485 | */ | 487 | */ |
486 | static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | 488 | static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) |
487 | { | 489 | { |
488 | if (!oh->_clk) | 490 | if (!oh->_clk) |
489 | return -EINVAL; | 491 | return -EINVAL; |
490 | 492 | ||
493 | if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) | ||
494 | return 0; | ||
495 | |||
491 | return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); | 496 | return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); |
492 | } | 497 | } |
493 | 498 | ||
@@ -904,18 +909,16 @@ static struct omap_hwmod *_lookup(const char *name) | |||
904 | * @oh: struct omap_hwmod * | 909 | * @oh: struct omap_hwmod * |
905 | * @data: not used; pass NULL | 910 | * @data: not used; pass NULL |
906 | * | 911 | * |
907 | * Called by omap_hwmod_late_init() (after omap2_clk_init()). | 912 | * Called by omap_hwmod_setup_*() (after omap2_clk_init()). |
908 | * Resolves all clock names embedded in the hwmod. Returns -EINVAL if | 913 | * Resolves all clock names embedded in the hwmod. Returns 0 on |
909 | * the omap_hwmod has not yet been registered or if the clocks have | 914 | * success, or a negative error code on failure. |
910 | * already been initialized, 0 on success, or a non-zero error on | ||
911 | * failure. | ||
912 | */ | 915 | */ |
913 | static int _init_clocks(struct omap_hwmod *oh, void *data) | 916 | static int _init_clocks(struct omap_hwmod *oh, void *data) |
914 | { | 917 | { |
915 | int ret = 0; | 918 | int ret = 0; |
916 | 919 | ||
917 | if (!oh || (oh->_state != _HWMOD_STATE_REGISTERED)) | 920 | if (oh->_state != _HWMOD_STATE_REGISTERED) |
918 | return -EINVAL; | 921 | return 0; |
919 | 922 | ||
920 | pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); | 923 | pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); |
921 | 924 | ||
@@ -926,7 +929,7 @@ static int _init_clocks(struct omap_hwmod *oh, void *data) | |||
926 | if (!ret) | 929 | if (!ret) |
927 | oh->_state = _HWMOD_STATE_CLKS_INITED; | 930 | oh->_state = _HWMOD_STATE_CLKS_INITED; |
928 | 931 | ||
929 | return 0; | 932 | return ret; |
930 | } | 933 | } |
931 | 934 | ||
932 | /** | 935 | /** |
@@ -972,25 +975,29 @@ static int _wait_target_ready(struct omap_hwmod *oh) | |||
972 | } | 975 | } |
973 | 976 | ||
974 | /** | 977 | /** |
975 | * _lookup_hardreset - return the register bit shift for this hwmod/reset line | 978 | * _lookup_hardreset - fill register bit info for this hwmod/reset line |
976 | * @oh: struct omap_hwmod * | 979 | * @oh: struct omap_hwmod * |
977 | * @name: name of the reset line in the context of this hwmod | 980 | * @name: name of the reset line in the context of this hwmod |
981 | * @ohri: struct omap_hwmod_rst_info * that this function will fill in | ||
978 | * | 982 | * |
979 | * Return the bit position of the reset line that match the | 983 | * Return the bit position of the reset line that match the |
980 | * input name. Return -ENOENT if not found. | 984 | * input name. Return -ENOENT if not found. |
981 | */ | 985 | */ |
982 | static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name) | 986 | static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name, |
987 | struct omap_hwmod_rst_info *ohri) | ||
983 | { | 988 | { |
984 | int i; | 989 | int i; |
985 | 990 | ||
986 | for (i = 0; i < oh->rst_lines_cnt; i++) { | 991 | for (i = 0; i < oh->rst_lines_cnt; i++) { |
987 | const char *rst_line = oh->rst_lines[i].name; | 992 | const char *rst_line = oh->rst_lines[i].name; |
988 | if (!strcmp(rst_line, name)) { | 993 | if (!strcmp(rst_line, name)) { |
989 | u8 shift = oh->rst_lines[i].rst_shift; | 994 | ohri->rst_shift = oh->rst_lines[i].rst_shift; |
990 | pr_debug("omap_hwmod: %s: _lookup_hardreset: %s: %d\n", | 995 | ohri->st_shift = oh->rst_lines[i].st_shift; |
991 | oh->name, rst_line, shift); | 996 | pr_debug("omap_hwmod: %s: %s: %s: rst %d st %d\n", |
997 | oh->name, __func__, rst_line, ohri->rst_shift, | ||
998 | ohri->st_shift); | ||
992 | 999 | ||
993 | return shift; | 1000 | return 0; |
994 | } | 1001 | } |
995 | } | 1002 | } |
996 | 1003 | ||
@@ -1009,21 +1016,22 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name) | |||
1009 | */ | 1016 | */ |
1010 | static int _assert_hardreset(struct omap_hwmod *oh, const char *name) | 1017 | static int _assert_hardreset(struct omap_hwmod *oh, const char *name) |
1011 | { | 1018 | { |
1012 | u8 shift; | 1019 | struct omap_hwmod_rst_info ohri; |
1020 | u8 ret; | ||
1013 | 1021 | ||
1014 | if (!oh) | 1022 | if (!oh) |
1015 | return -EINVAL; | 1023 | return -EINVAL; |
1016 | 1024 | ||
1017 | shift = _lookup_hardreset(oh, name); | 1025 | ret = _lookup_hardreset(oh, name, &ohri); |
1018 | if (IS_ERR_VALUE(shift)) | 1026 | if (IS_ERR_VALUE(ret)) |
1019 | return shift; | 1027 | return ret; |
1020 | 1028 | ||
1021 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) | 1029 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) |
1022 | return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs, | 1030 | return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs, |
1023 | shift); | 1031 | ohri.rst_shift); |
1024 | else if (cpu_is_omap44xx()) | 1032 | else if (cpu_is_omap44xx()) |
1025 | return omap4_prm_assert_hardreset(oh->prcm.omap4.rstctrl_reg, | 1033 | return omap4_prm_assert_hardreset(oh->prcm.omap4.rstctrl_reg, |
1026 | shift); | 1034 | ohri.rst_shift); |
1027 | else | 1035 | else |
1028 | return -EINVAL; | 1036 | return -EINVAL; |
1029 | } | 1037 | } |
@@ -1040,29 +1048,34 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name) | |||
1040 | */ | 1048 | */ |
1041 | static int _deassert_hardreset(struct omap_hwmod *oh, const char *name) | 1049 | static int _deassert_hardreset(struct omap_hwmod *oh, const char *name) |
1042 | { | 1050 | { |
1043 | u8 shift; | 1051 | struct omap_hwmod_rst_info ohri; |
1044 | int r; | 1052 | int ret; |
1045 | 1053 | ||
1046 | if (!oh) | 1054 | if (!oh) |
1047 | return -EINVAL; | 1055 | return -EINVAL; |
1048 | 1056 | ||
1049 | shift = _lookup_hardreset(oh, name); | 1057 | ret = _lookup_hardreset(oh, name, &ohri); |
1050 | if (IS_ERR_VALUE(shift)) | 1058 | if (IS_ERR_VALUE(ret)) |
1051 | return shift; | 1059 | return ret; |
1052 | 1060 | ||
1053 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) | 1061 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
1054 | r = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs, | 1062 | ret = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs, |
1055 | shift); | 1063 | ohri.rst_shift, |
1056 | else if (cpu_is_omap44xx()) | 1064 | ohri.st_shift); |
1057 | r = omap4_prm_deassert_hardreset(oh->prcm.omap4.rstctrl_reg, | 1065 | } else if (cpu_is_omap44xx()) { |
1058 | shift); | 1066 | if (ohri.st_shift) |
1059 | else | 1067 | pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n", |
1068 | oh->name, name); | ||
1069 | ret = omap4_prm_deassert_hardreset(oh->prcm.omap4.rstctrl_reg, | ||
1070 | ohri.rst_shift); | ||
1071 | } else { | ||
1060 | return -EINVAL; | 1072 | return -EINVAL; |
1073 | } | ||
1061 | 1074 | ||
1062 | if (r == -EBUSY) | 1075 | if (ret == -EBUSY) |
1063 | pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name); | 1076 | pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name); |
1064 | 1077 | ||
1065 | return r; | 1078 | return ret; |
1066 | } | 1079 | } |
1067 | 1080 | ||
1068 | /** | 1081 | /** |
@@ -1075,21 +1088,22 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name) | |||
1075 | */ | 1088 | */ |
1076 | static int _read_hardreset(struct omap_hwmod *oh, const char *name) | 1089 | static int _read_hardreset(struct omap_hwmod *oh, const char *name) |
1077 | { | 1090 | { |
1078 | u8 shift; | 1091 | struct omap_hwmod_rst_info ohri; |
1092 | u8 ret; | ||
1079 | 1093 | ||
1080 | if (!oh) | 1094 | if (!oh) |
1081 | return -EINVAL; | 1095 | return -EINVAL; |
1082 | 1096 | ||
1083 | shift = _lookup_hardreset(oh, name); | 1097 | ret = _lookup_hardreset(oh, name, &ohri); |
1084 | if (IS_ERR_VALUE(shift)) | 1098 | if (IS_ERR_VALUE(ret)) |
1085 | return shift; | 1099 | return ret; |
1086 | 1100 | ||
1087 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | 1101 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
1088 | return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs, | 1102 | return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs, |
1089 | shift); | 1103 | ohri.st_shift); |
1090 | } else if (cpu_is_omap44xx()) { | 1104 | } else if (cpu_is_omap44xx()) { |
1091 | return omap4_prm_is_hardreset_asserted(oh->prcm.omap4.rstctrl_reg, | 1105 | return omap4_prm_is_hardreset_asserted(oh->prcm.omap4.rstctrl_reg, |
1092 | shift); | 1106 | ohri.rst_shift); |
1093 | } else { | 1107 | } else { |
1094 | return -EINVAL; | 1108 | return -EINVAL; |
1095 | } | 1109 | } |
@@ -1230,7 +1244,9 @@ static int _enable(struct omap_hwmod *oh) | |||
1230 | _deassert_hardreset(oh, oh->rst_lines[0].name); | 1244 | _deassert_hardreset(oh, oh->rst_lines[0].name); |
1231 | 1245 | ||
1232 | /* Mux pins for device runtime if populated */ | 1246 | /* Mux pins for device runtime if populated */ |
1233 | if (oh->mux) | 1247 | if (oh->mux && (!oh->mux->enabled || |
1248 | ((oh->_state == _HWMOD_STATE_IDLE) && | ||
1249 | oh->mux->pads_dynamic))) | ||
1234 | omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED); | 1250 | omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED); |
1235 | 1251 | ||
1236 | _add_initiator_dep(oh, mpu_oh); | 1252 | _add_initiator_dep(oh, mpu_oh); |
@@ -1279,7 +1295,7 @@ static int _idle(struct omap_hwmod *oh) | |||
1279 | _disable_clocks(oh); | 1295 | _disable_clocks(oh); |
1280 | 1296 | ||
1281 | /* Mux pins for device idle if populated */ | 1297 | /* Mux pins for device idle if populated */ |
1282 | if (oh->mux) | 1298 | if (oh->mux && oh->mux->pads_dynamic) |
1283 | omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE); | 1299 | omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE); |
1284 | 1300 | ||
1285 | oh->_state = _HWMOD_STATE_IDLE; | 1301 | oh->_state = _HWMOD_STATE_IDLE; |
@@ -1288,6 +1304,42 @@ static int _idle(struct omap_hwmod *oh) | |||
1288 | } | 1304 | } |
1289 | 1305 | ||
1290 | /** | 1306 | /** |
1307 | * omap_hwmod_set_ocp_autoidle - set the hwmod's OCP autoidle bit | ||
1308 | * @oh: struct omap_hwmod * | ||
1309 | * @autoidle: desired AUTOIDLE bitfield value (0 or 1) | ||
1310 | * | ||
1311 | * Sets the IP block's OCP autoidle bit in hardware, and updates our | ||
1312 | * local copy. Intended to be used by drivers that require | ||
1313 | * direct manipulation of the AUTOIDLE bits. | ||
1314 | * Returns -EINVAL if @oh is null or is not in the ENABLED state, or passes | ||
1315 | * along the return value from _set_module_autoidle(). | ||
1316 | * | ||
1317 | * Any users of this function should be scrutinized carefully. | ||
1318 | */ | ||
1319 | int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle) | ||
1320 | { | ||
1321 | u32 v; | ||
1322 | int retval = 0; | ||
1323 | unsigned long flags; | ||
1324 | |||
1325 | if (!oh || oh->_state != _HWMOD_STATE_ENABLED) | ||
1326 | return -EINVAL; | ||
1327 | |||
1328 | spin_lock_irqsave(&oh->_lock, flags); | ||
1329 | |||
1330 | v = oh->_sysc_cache; | ||
1331 | |||
1332 | retval = _set_module_autoidle(oh, autoidle, &v); | ||
1333 | |||
1334 | if (!retval) | ||
1335 | _write_sysconfig(v, oh); | ||
1336 | |||
1337 | spin_unlock_irqrestore(&oh->_lock, flags); | ||
1338 | |||
1339 | return retval; | ||
1340 | } | ||
1341 | |||
1342 | /** | ||
1291 | * _shutdown - shutdown an omap_hwmod | 1343 | * _shutdown - shutdown an omap_hwmod |
1292 | * @oh: struct omap_hwmod * | 1344 | * @oh: struct omap_hwmod * |
1293 | * | 1345 | * |
@@ -1354,14 +1406,16 @@ static int _shutdown(struct omap_hwmod *oh) | |||
1354 | * @oh: struct omap_hwmod * | 1406 | * @oh: struct omap_hwmod * |
1355 | * | 1407 | * |
1356 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh | 1408 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh |
1357 | * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the | 1409 | * OCP_SYSCONFIG register. Returns 0. |
1358 | * wrong state or returns 0. | ||
1359 | */ | 1410 | */ |
1360 | static int _setup(struct omap_hwmod *oh, void *data) | 1411 | static int _setup(struct omap_hwmod *oh, void *data) |
1361 | { | 1412 | { |
1362 | int i, r; | 1413 | int i, r; |
1363 | u8 postsetup_state; | 1414 | u8 postsetup_state; |
1364 | 1415 | ||
1416 | if (oh->_state != _HWMOD_STATE_CLKS_INITED) | ||
1417 | return 0; | ||
1418 | |||
1365 | /* Set iclk autoidle mode */ | 1419 | /* Set iclk autoidle mode */ |
1366 | if (oh->slaves_cnt > 0) { | 1420 | if (oh->slaves_cnt > 0) { |
1367 | for (i = 0; i < oh->slaves_cnt; i++) { | 1421 | for (i = 0; i < oh->slaves_cnt; i++) { |
@@ -1455,7 +1509,7 @@ static int _setup(struct omap_hwmod *oh, void *data) | |||
1455 | */ | 1509 | */ |
1456 | static int __init _register(struct omap_hwmod *oh) | 1510 | static int __init _register(struct omap_hwmod *oh) |
1457 | { | 1511 | { |
1458 | int ret, ms_id; | 1512 | int ms_id; |
1459 | 1513 | ||
1460 | if (!oh || !oh->name || !oh->class || !oh->class->name || | 1514 | if (!oh || !oh->name || !oh->class || !oh->class->name || |
1461 | (oh->_state != _HWMOD_STATE_UNKNOWN)) | 1515 | (oh->_state != _HWMOD_STATE_UNKNOWN)) |
@@ -1467,12 +1521,10 @@ static int __init _register(struct omap_hwmod *oh) | |||
1467 | return -EEXIST; | 1521 | return -EEXIST; |
1468 | 1522 | ||
1469 | ms_id = _find_mpu_port_index(oh); | 1523 | ms_id = _find_mpu_port_index(oh); |
1470 | if (!IS_ERR_VALUE(ms_id)) { | 1524 | if (!IS_ERR_VALUE(ms_id)) |
1471 | oh->_mpu_port_index = ms_id; | 1525 | oh->_mpu_port_index = ms_id; |
1472 | oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); | 1526 | else |
1473 | } else { | ||
1474 | oh->_int_flags |= _HWMOD_NO_MPU_PORT; | 1527 | oh->_int_flags |= _HWMOD_NO_MPU_PORT; |
1475 | } | ||
1476 | 1528 | ||
1477 | list_add_tail(&oh->node, &omap_hwmod_list); | 1529 | list_add_tail(&oh->node, &omap_hwmod_list); |
1478 | 1530 | ||
@@ -1480,9 +1532,14 @@ static int __init _register(struct omap_hwmod *oh) | |||
1480 | 1532 | ||
1481 | oh->_state = _HWMOD_STATE_REGISTERED; | 1533 | oh->_state = _HWMOD_STATE_REGISTERED; |
1482 | 1534 | ||
1483 | ret = 0; | 1535 | /* |
1536 | * XXX Rather than doing a strcmp(), this should test a flag | ||
1537 | * set in the hwmod data, inserted by the autogenerator code. | ||
1538 | */ | ||
1539 | if (!strcmp(oh->name, MPU_INITIATOR_NAME)) | ||
1540 | mpu_oh = oh; | ||
1484 | 1541 | ||
1485 | return ret; | 1542 | return 0; |
1486 | } | 1543 | } |
1487 | 1544 | ||
1488 | 1545 | ||
@@ -1585,65 +1642,132 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), | |||
1585 | return ret; | 1642 | return ret; |
1586 | } | 1643 | } |
1587 | 1644 | ||
1588 | |||
1589 | /** | 1645 | /** |
1590 | * omap_hwmod_init - init omap_hwmod code and register hwmods | 1646 | * omap_hwmod_register - register an array of hwmods |
1591 | * @ohs: pointer to an array of omap_hwmods to register | 1647 | * @ohs: pointer to an array of omap_hwmods to register |
1592 | * | 1648 | * |
1593 | * Intended to be called early in boot before the clock framework is | 1649 | * Intended to be called early in boot before the clock framework is |
1594 | * initialized. If @ohs is not null, will register all omap_hwmods | 1650 | * initialized. If @ohs is not null, will register all omap_hwmods |
1595 | * listed in @ohs that are valid for this chip. Returns -EINVAL if | 1651 | * listed in @ohs that are valid for this chip. Returns 0. |
1596 | * omap_hwmod_init() has already been called or 0 otherwise. | ||
1597 | */ | 1652 | */ |
1598 | int __init omap_hwmod_init(struct omap_hwmod **ohs) | 1653 | int __init omap_hwmod_register(struct omap_hwmod **ohs) |
1654 | { | ||
1655 | int r, i; | ||
1656 | |||
1657 | if (!ohs) | ||
1658 | return 0; | ||
1659 | |||
1660 | i = 0; | ||
1661 | do { | ||
1662 | if (!omap_chip_is(ohs[i]->omap_chip)) | ||
1663 | continue; | ||
1664 | |||
1665 | r = _register(ohs[i]); | ||
1666 | WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, | ||
1667 | r); | ||
1668 | } while (ohs[++i]); | ||
1669 | |||
1670 | return 0; | ||
1671 | } | ||
1672 | |||
1673 | /* | ||
1674 | * _populate_mpu_rt_base - populate the virtual address for a hwmod | ||
1675 | * | ||
1676 | * Must be called only from omap_hwmod_setup_*() so ioremap works properly. | ||
1677 | * Assumes the caller takes care of locking if needed. | ||
1678 | */ | ||
1679 | static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data) | ||
1680 | { | ||
1681 | if (oh->_state != _HWMOD_STATE_REGISTERED) | ||
1682 | return 0; | ||
1683 | |||
1684 | if (oh->_int_flags & _HWMOD_NO_MPU_PORT) | ||
1685 | return 0; | ||
1686 | |||
1687 | oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); | ||
1688 | if (!oh->_mpu_rt_va) | ||
1689 | pr_warning("omap_hwmod: %s found no _mpu_rt_va for %s\n", | ||
1690 | __func__, oh->name); | ||
1691 | |||
1692 | return 0; | ||
1693 | } | ||
1694 | |||
1695 | /** | ||
1696 | * omap_hwmod_setup_one - set up a single hwmod | ||
1697 | * @oh_name: const char * name of the already-registered hwmod to set up | ||
1698 | * | ||
1699 | * Must be called after omap2_clk_init(). Resolves the struct clk | ||
1700 | * names to struct clk pointers for each registered omap_hwmod. Also | ||
1701 | * calls _setup() on each hwmod. Returns -EINVAL upon error or 0 upon | ||
1702 | * success. | ||
1703 | */ | ||
1704 | int __init omap_hwmod_setup_one(const char *oh_name) | ||
1599 | { | 1705 | { |
1600 | struct omap_hwmod *oh; | 1706 | struct omap_hwmod *oh; |
1601 | int r; | 1707 | int r; |
1602 | 1708 | ||
1603 | if (inited) | 1709 | pr_debug("omap_hwmod: %s: %s\n", oh_name, __func__); |
1710 | |||
1711 | if (!mpu_oh) { | ||
1712 | pr_err("omap_hwmod: %s: cannot setup_one: MPU initiator hwmod %s not yet registered\n", | ||
1713 | oh_name, MPU_INITIATOR_NAME); | ||
1604 | return -EINVAL; | 1714 | return -EINVAL; |
1715 | } | ||
1605 | 1716 | ||
1606 | inited = 1; | 1717 | oh = _lookup(oh_name); |
1718 | if (!oh) { | ||
1719 | WARN(1, "omap_hwmod: %s: hwmod not yet registered\n", oh_name); | ||
1720 | return -EINVAL; | ||
1721 | } | ||
1607 | 1722 | ||
1608 | if (!ohs) | 1723 | if (mpu_oh->_state == _HWMOD_STATE_REGISTERED && oh != mpu_oh) |
1609 | return 0; | 1724 | omap_hwmod_setup_one(MPU_INITIATOR_NAME); |
1610 | 1725 | ||
1611 | oh = *ohs; | 1726 | r = _populate_mpu_rt_base(oh, NULL); |
1612 | while (oh) { | 1727 | if (IS_ERR_VALUE(r)) { |
1613 | if (omap_chip_is(oh->omap_chip)) { | 1728 | WARN(1, "omap_hwmod: %s: couldn't set mpu_rt_base\n", oh_name); |
1614 | r = _register(oh); | 1729 | return -EINVAL; |
1615 | WARN(r, "omap_hwmod: %s: _register returned " | ||
1616 | "%d\n", oh->name, r); | ||
1617 | } | ||
1618 | oh = *++ohs; | ||
1619 | } | 1730 | } |
1620 | 1731 | ||
1732 | r = _init_clocks(oh, NULL); | ||
1733 | if (IS_ERR_VALUE(r)) { | ||
1734 | WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh_name); | ||
1735 | return -EINVAL; | ||
1736 | } | ||
1737 | |||
1738 | _setup(oh, NULL); | ||
1739 | |||
1621 | return 0; | 1740 | return 0; |
1622 | } | 1741 | } |
1623 | 1742 | ||
1624 | /** | 1743 | /** |
1625 | * omap_hwmod_late_init - do some post-clock framework initialization | 1744 | * omap_hwmod_setup - do some post-clock framework initialization |
1626 | * | 1745 | * |
1627 | * Must be called after omap2_clk_init(). Resolves the struct clk names | 1746 | * Must be called after omap2_clk_init(). Resolves the struct clk names |
1628 | * to struct clk pointers for each registered omap_hwmod. Also calls | 1747 | * to struct clk pointers for each registered omap_hwmod. Also calls |
1629 | * _setup() on each hwmod. Returns 0. | 1748 | * _setup() on each hwmod. Returns 0 upon success. |
1630 | */ | 1749 | */ |
1631 | int omap_hwmod_late_init(void) | 1750 | static int __init omap_hwmod_setup_all(void) |
1632 | { | 1751 | { |
1633 | int r; | 1752 | int r; |
1634 | 1753 | ||
1635 | /* XXX check return value */ | 1754 | if (!mpu_oh) { |
1636 | r = omap_hwmod_for_each(_init_clocks, NULL); | 1755 | pr_err("omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n", |
1637 | WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); | 1756 | __func__, MPU_INITIATOR_NAME); |
1757 | return -EINVAL; | ||
1758 | } | ||
1638 | 1759 | ||
1639 | mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); | 1760 | r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL); |
1640 | WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", | 1761 | |
1641 | MPU_INITIATOR_NAME); | 1762 | r = omap_hwmod_for_each(_init_clocks, NULL); |
1763 | WARN(IS_ERR_VALUE(r), | ||
1764 | "omap_hwmod: %s: _init_clocks failed\n", __func__); | ||
1642 | 1765 | ||
1643 | omap_hwmod_for_each(_setup, NULL); | 1766 | omap_hwmod_for_each(_setup, NULL); |
1644 | 1767 | ||
1645 | return 0; | 1768 | return 0; |
1646 | } | 1769 | } |
1770 | core_initcall(omap_hwmod_setup_all); | ||
1647 | 1771 | ||
1648 | /** | 1772 | /** |
1649 | * omap_hwmod_enable - enable an omap_hwmod | 1773 | * omap_hwmod_enable - enable an omap_hwmod |
@@ -1862,6 +1986,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) | |||
1862 | os = oh->slaves[i]; | 1986 | os = oh->slaves[i]; |
1863 | 1987 | ||
1864 | for (j = 0; j < os->addr_cnt; j++) { | 1988 | for (j = 0; j < os->addr_cnt; j++) { |
1989 | (res + r)->name = (os->addr + j)->name; | ||
1865 | (res + r)->start = (os->addr + j)->pa_start; | 1990 | (res + r)->start = (os->addr + j)->pa_start; |
1866 | (res + r)->end = (os->addr + j)->pa_end; | 1991 | (res + r)->end = (os->addr + j)->pa_end; |
1867 | (res + r)->flags = IORESOURCE_MEM; | 1992 | (res + r)->flags = IORESOURCE_MEM; |
@@ -2162,11 +2287,11 @@ int omap_hwmod_for_each_by_class(const char *classname, | |||
2162 | * @oh: struct omap_hwmod * | 2287 | * @oh: struct omap_hwmod * |
2163 | * @state: state that _setup() should leave the hwmod in | 2288 | * @state: state that _setup() should leave the hwmod in |
2164 | * | 2289 | * |
2165 | * Sets the hwmod state that @oh will enter at the end of _setup() (called by | 2290 | * Sets the hwmod state that @oh will enter at the end of _setup() |
2166 | * omap_hwmod_late_init()). Only valid to call between calls to | 2291 | * (called by omap_hwmod_setup_*()). Only valid to call between |
2167 | * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or | 2292 | * calling omap_hwmod_register() and omap_hwmod_setup_*(). Returns |
2168 | * -EINVAL if there is a problem with the arguments or if the hwmod is | 2293 | * 0 upon success or -EINVAL if there is a problem with the arguments |
2169 | * in the wrong state. | 2294 | * or if the hwmod is in the wrong state. |
2170 | */ | 2295 | */ |
2171 | int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) | 2296 | int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) |
2172 | { | 2297 | { |
@@ -2218,3 +2343,29 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh) | |||
2218 | 2343 | ||
2219 | return ret; | 2344 | return ret; |
2220 | } | 2345 | } |
2346 | |||
2347 | /** | ||
2348 | * omap_hwmod_no_setup_reset - prevent a hwmod from being reset upon setup | ||
2349 | * @oh: struct omap_hwmod * | ||
2350 | * | ||
2351 | * Prevent the hwmod @oh from being reset during the setup process. | ||
2352 | * Intended for use by board-*.c files on boards with devices that | ||
2353 | * cannot tolerate being reset. Must be called before the hwmod has | ||
2354 | * been set up. Returns 0 upon success or negative error code upon | ||
2355 | * failure. | ||
2356 | */ | ||
2357 | int omap_hwmod_no_setup_reset(struct omap_hwmod *oh) | ||
2358 | { | ||
2359 | if (!oh) | ||
2360 | return -EINVAL; | ||
2361 | |||
2362 | if (oh->_state != _HWMOD_STATE_REGISTERED) { | ||
2363 | pr_err("omap_hwmod: %s: cannot prevent setup reset; in wrong state\n", | ||
2364 | oh->name); | ||
2365 | return -EINVAL; | ||
2366 | } | ||
2367 | |||
2368 | oh->flags |= HWMOD_INIT_NO_RESET; | ||
2369 | |||
2370 | return 0; | ||
2371 | } | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index b85c630b64d6..62823467163b 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
@@ -18,6 +18,10 @@ | |||
18 | #include <plat/serial.h> | 18 | #include <plat/serial.h> |
19 | #include <plat/i2c.h> | 19 | #include <plat/i2c.h> |
20 | #include <plat/gpio.h> | 20 | #include <plat/gpio.h> |
21 | #include <plat/mcspi.h> | ||
22 | #include <plat/dmtimer.h> | ||
23 | #include <plat/l3_2xxx.h> | ||
24 | #include <plat/l4_2xxx.h> | ||
21 | 25 | ||
22 | #include "omap_hwmod_common_data.h" | 26 | #include "omap_hwmod_common_data.h" |
23 | 27 | ||
@@ -38,12 +42,18 @@ static struct omap_hwmod omap2420_mpu_hwmod; | |||
38 | static struct omap_hwmod omap2420_iva_hwmod; | 42 | static struct omap_hwmod omap2420_iva_hwmod; |
39 | static struct omap_hwmod omap2420_l3_main_hwmod; | 43 | static struct omap_hwmod omap2420_l3_main_hwmod; |
40 | static struct omap_hwmod omap2420_l4_core_hwmod; | 44 | static struct omap_hwmod omap2420_l4_core_hwmod; |
45 | static struct omap_hwmod omap2420_dss_core_hwmod; | ||
46 | static struct omap_hwmod omap2420_dss_dispc_hwmod; | ||
47 | static struct omap_hwmod omap2420_dss_rfbi_hwmod; | ||
48 | static struct omap_hwmod omap2420_dss_venc_hwmod; | ||
41 | static struct omap_hwmod omap2420_wd_timer2_hwmod; | 49 | static struct omap_hwmod omap2420_wd_timer2_hwmod; |
42 | static struct omap_hwmod omap2420_gpio1_hwmod; | 50 | static struct omap_hwmod omap2420_gpio1_hwmod; |
43 | static struct omap_hwmod omap2420_gpio2_hwmod; | 51 | static struct omap_hwmod omap2420_gpio2_hwmod; |
44 | static struct omap_hwmod omap2420_gpio3_hwmod; | 52 | static struct omap_hwmod omap2420_gpio3_hwmod; |
45 | static struct omap_hwmod omap2420_gpio4_hwmod; | 53 | static struct omap_hwmod omap2420_gpio4_hwmod; |
46 | static struct omap_hwmod omap2420_dma_system_hwmod; | 54 | static struct omap_hwmod omap2420_dma_system_hwmod; |
55 | static struct omap_hwmod omap2420_mcspi1_hwmod; | ||
56 | static struct omap_hwmod omap2420_mcspi2_hwmod; | ||
47 | 57 | ||
48 | /* L3 -> L4_CORE interface */ | 58 | /* L3 -> L4_CORE interface */ |
49 | static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { | 59 | static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { |
@@ -64,6 +74,19 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = { | |||
64 | &omap2420_mpu__l3_main, | 74 | &omap2420_mpu__l3_main, |
65 | }; | 75 | }; |
66 | 76 | ||
77 | /* DSS -> l3 */ | ||
78 | static struct omap_hwmod_ocp_if omap2420_dss__l3 = { | ||
79 | .master = &omap2420_dss_core_hwmod, | ||
80 | .slave = &omap2420_l3_main_hwmod, | ||
81 | .fw = { | ||
82 | .omap2 = { | ||
83 | .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS, | ||
84 | .flags = OMAP_FIREWALL_L3, | ||
85 | } | ||
86 | }, | ||
87 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
88 | }; | ||
89 | |||
67 | /* Master interfaces on the L3 interconnect */ | 90 | /* Master interfaces on the L3 interconnect */ |
68 | static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = { | 91 | static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = { |
69 | &omap2420_l3_main__l4_core, | 92 | &omap2420_l3_main__l4_core, |
@@ -87,6 +110,44 @@ static struct omap_hwmod omap2420_uart2_hwmod; | |||
87 | static struct omap_hwmod omap2420_uart3_hwmod; | 110 | static struct omap_hwmod omap2420_uart3_hwmod; |
88 | static struct omap_hwmod omap2420_i2c1_hwmod; | 111 | static struct omap_hwmod omap2420_i2c1_hwmod; |
89 | static struct omap_hwmod omap2420_i2c2_hwmod; | 112 | static struct omap_hwmod omap2420_i2c2_hwmod; |
113 | static struct omap_hwmod omap2420_mcbsp1_hwmod; | ||
114 | static struct omap_hwmod omap2420_mcbsp2_hwmod; | ||
115 | |||
116 | /* l4 core -> mcspi1 interface */ | ||
117 | static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = { | ||
118 | { | ||
119 | .pa_start = 0x48098000, | ||
120 | .pa_end = 0x480980ff, | ||
121 | .flags = ADDR_TYPE_RT, | ||
122 | }, | ||
123 | }; | ||
124 | |||
125 | static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi1 = { | ||
126 | .master = &omap2420_l4_core_hwmod, | ||
127 | .slave = &omap2420_mcspi1_hwmod, | ||
128 | .clk = "mcspi1_ick", | ||
129 | .addr = omap2420_mcspi1_addr_space, | ||
130 | .addr_cnt = ARRAY_SIZE(omap2420_mcspi1_addr_space), | ||
131 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
132 | }; | ||
133 | |||
134 | /* l4 core -> mcspi2 interface */ | ||
135 | static struct omap_hwmod_addr_space omap2420_mcspi2_addr_space[] = { | ||
136 | { | ||
137 | .pa_start = 0x4809a000, | ||
138 | .pa_end = 0x4809a0ff, | ||
139 | .flags = ADDR_TYPE_RT, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi2 = { | ||
144 | .master = &omap2420_l4_core_hwmod, | ||
145 | .slave = &omap2420_mcspi2_hwmod, | ||
146 | .clk = "mcspi2_ick", | ||
147 | .addr = omap2420_mcspi2_addr_space, | ||
148 | .addr_cnt = ARRAY_SIZE(omap2420_mcspi2_addr_space), | ||
149 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
150 | }; | ||
90 | 151 | ||
91 | /* L4_CORE -> L4_WKUP interface */ | 152 | /* L4_CORE -> L4_WKUP interface */ |
92 | static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { | 153 | static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { |
@@ -279,6 +340,625 @@ static struct omap_hwmod omap2420_iva_hwmod = { | |||
279 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | 340 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) |
280 | }; | 341 | }; |
281 | 342 | ||
343 | /* Timer Common */ | ||
344 | static struct omap_hwmod_class_sysconfig omap2420_timer_sysc = { | ||
345 | .rev_offs = 0x0000, | ||
346 | .sysc_offs = 0x0010, | ||
347 | .syss_offs = 0x0014, | ||
348 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
349 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
350 | SYSC_HAS_AUTOIDLE), | ||
351 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
352 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
353 | }; | ||
354 | |||
355 | static struct omap_hwmod_class omap2420_timer_hwmod_class = { | ||
356 | .name = "timer", | ||
357 | .sysc = &omap2420_timer_sysc, | ||
358 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
359 | }; | ||
360 | |||
361 | /* timer1 */ | ||
362 | static struct omap_hwmod omap2420_timer1_hwmod; | ||
363 | static struct omap_hwmod_irq_info omap2420_timer1_mpu_irqs[] = { | ||
364 | { .irq = 37, }, | ||
365 | }; | ||
366 | |||
367 | static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = { | ||
368 | { | ||
369 | .pa_start = 0x48028000, | ||
370 | .pa_end = 0x48028000 + SZ_1K - 1, | ||
371 | .flags = ADDR_TYPE_RT | ||
372 | }, | ||
373 | }; | ||
374 | |||
375 | /* l4_wkup -> timer1 */ | ||
376 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = { | ||
377 | .master = &omap2420_l4_wkup_hwmod, | ||
378 | .slave = &omap2420_timer1_hwmod, | ||
379 | .clk = "gpt1_ick", | ||
380 | .addr = omap2420_timer1_addrs, | ||
381 | .addr_cnt = ARRAY_SIZE(omap2420_timer1_addrs), | ||
382 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
383 | }; | ||
384 | |||
385 | /* timer1 slave port */ | ||
386 | static struct omap_hwmod_ocp_if *omap2420_timer1_slaves[] = { | ||
387 | &omap2420_l4_wkup__timer1, | ||
388 | }; | ||
389 | |||
390 | /* timer1 hwmod */ | ||
391 | static struct omap_hwmod omap2420_timer1_hwmod = { | ||
392 | .name = "timer1", | ||
393 | .mpu_irqs = omap2420_timer1_mpu_irqs, | ||
394 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer1_mpu_irqs), | ||
395 | .main_clk = "gpt1_fck", | ||
396 | .prcm = { | ||
397 | .omap2 = { | ||
398 | .prcm_reg_id = 1, | ||
399 | .module_bit = OMAP24XX_EN_GPT1_SHIFT, | ||
400 | .module_offs = WKUP_MOD, | ||
401 | .idlest_reg_id = 1, | ||
402 | .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, | ||
403 | }, | ||
404 | }, | ||
405 | .slaves = omap2420_timer1_slaves, | ||
406 | .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves), | ||
407 | .class = &omap2420_timer_hwmod_class, | ||
408 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
409 | }; | ||
410 | |||
411 | /* timer2 */ | ||
412 | static struct omap_hwmod omap2420_timer2_hwmod; | ||
413 | static struct omap_hwmod_irq_info omap2420_timer2_mpu_irqs[] = { | ||
414 | { .irq = 38, }, | ||
415 | }; | ||
416 | |||
417 | static struct omap_hwmod_addr_space omap2420_timer2_addrs[] = { | ||
418 | { | ||
419 | .pa_start = 0x4802a000, | ||
420 | .pa_end = 0x4802a000 + SZ_1K - 1, | ||
421 | .flags = ADDR_TYPE_RT | ||
422 | }, | ||
423 | }; | ||
424 | |||
425 | /* l4_core -> timer2 */ | ||
426 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer2 = { | ||
427 | .master = &omap2420_l4_core_hwmod, | ||
428 | .slave = &omap2420_timer2_hwmod, | ||
429 | .clk = "gpt2_ick", | ||
430 | .addr = omap2420_timer2_addrs, | ||
431 | .addr_cnt = ARRAY_SIZE(omap2420_timer2_addrs), | ||
432 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
433 | }; | ||
434 | |||
435 | /* timer2 slave port */ | ||
436 | static struct omap_hwmod_ocp_if *omap2420_timer2_slaves[] = { | ||
437 | &omap2420_l4_core__timer2, | ||
438 | }; | ||
439 | |||
440 | /* timer2 hwmod */ | ||
441 | static struct omap_hwmod omap2420_timer2_hwmod = { | ||
442 | .name = "timer2", | ||
443 | .mpu_irqs = omap2420_timer2_mpu_irqs, | ||
444 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer2_mpu_irqs), | ||
445 | .main_clk = "gpt2_fck", | ||
446 | .prcm = { | ||
447 | .omap2 = { | ||
448 | .prcm_reg_id = 1, | ||
449 | .module_bit = OMAP24XX_EN_GPT2_SHIFT, | ||
450 | .module_offs = CORE_MOD, | ||
451 | .idlest_reg_id = 1, | ||
452 | .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, | ||
453 | }, | ||
454 | }, | ||
455 | .slaves = omap2420_timer2_slaves, | ||
456 | .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves), | ||
457 | .class = &omap2420_timer_hwmod_class, | ||
458 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
459 | }; | ||
460 | |||
461 | /* timer3 */ | ||
462 | static struct omap_hwmod omap2420_timer3_hwmod; | ||
463 | static struct omap_hwmod_irq_info omap2420_timer3_mpu_irqs[] = { | ||
464 | { .irq = 39, }, | ||
465 | }; | ||
466 | |||
467 | static struct omap_hwmod_addr_space omap2420_timer3_addrs[] = { | ||
468 | { | ||
469 | .pa_start = 0x48078000, | ||
470 | .pa_end = 0x48078000 + SZ_1K - 1, | ||
471 | .flags = ADDR_TYPE_RT | ||
472 | }, | ||
473 | }; | ||
474 | |||
475 | /* l4_core -> timer3 */ | ||
476 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer3 = { | ||
477 | .master = &omap2420_l4_core_hwmod, | ||
478 | .slave = &omap2420_timer3_hwmod, | ||
479 | .clk = "gpt3_ick", | ||
480 | .addr = omap2420_timer3_addrs, | ||
481 | .addr_cnt = ARRAY_SIZE(omap2420_timer3_addrs), | ||
482 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
483 | }; | ||
484 | |||
485 | /* timer3 slave port */ | ||
486 | static struct omap_hwmod_ocp_if *omap2420_timer3_slaves[] = { | ||
487 | &omap2420_l4_core__timer3, | ||
488 | }; | ||
489 | |||
490 | /* timer3 hwmod */ | ||
491 | static struct omap_hwmod omap2420_timer3_hwmod = { | ||
492 | .name = "timer3", | ||
493 | .mpu_irqs = omap2420_timer3_mpu_irqs, | ||
494 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer3_mpu_irqs), | ||
495 | .main_clk = "gpt3_fck", | ||
496 | .prcm = { | ||
497 | .omap2 = { | ||
498 | .prcm_reg_id = 1, | ||
499 | .module_bit = OMAP24XX_EN_GPT3_SHIFT, | ||
500 | .module_offs = CORE_MOD, | ||
501 | .idlest_reg_id = 1, | ||
502 | .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, | ||
503 | }, | ||
504 | }, | ||
505 | .slaves = omap2420_timer3_slaves, | ||
506 | .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves), | ||
507 | .class = &omap2420_timer_hwmod_class, | ||
508 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
509 | }; | ||
510 | |||
511 | /* timer4 */ | ||
512 | static struct omap_hwmod omap2420_timer4_hwmod; | ||
513 | static struct omap_hwmod_irq_info omap2420_timer4_mpu_irqs[] = { | ||
514 | { .irq = 40, }, | ||
515 | }; | ||
516 | |||
517 | static struct omap_hwmod_addr_space omap2420_timer4_addrs[] = { | ||
518 | { | ||
519 | .pa_start = 0x4807a000, | ||
520 | .pa_end = 0x4807a000 + SZ_1K - 1, | ||
521 | .flags = ADDR_TYPE_RT | ||
522 | }, | ||
523 | }; | ||
524 | |||
525 | /* l4_core -> timer4 */ | ||
526 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer4 = { | ||
527 | .master = &omap2420_l4_core_hwmod, | ||
528 | .slave = &omap2420_timer4_hwmod, | ||
529 | .clk = "gpt4_ick", | ||
530 | .addr = omap2420_timer4_addrs, | ||
531 | .addr_cnt = ARRAY_SIZE(omap2420_timer4_addrs), | ||
532 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
533 | }; | ||
534 | |||
535 | /* timer4 slave port */ | ||
536 | static struct omap_hwmod_ocp_if *omap2420_timer4_slaves[] = { | ||
537 | &omap2420_l4_core__timer4, | ||
538 | }; | ||
539 | |||
540 | /* timer4 hwmod */ | ||
541 | static struct omap_hwmod omap2420_timer4_hwmod = { | ||
542 | .name = "timer4", | ||
543 | .mpu_irqs = omap2420_timer4_mpu_irqs, | ||
544 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer4_mpu_irqs), | ||
545 | .main_clk = "gpt4_fck", | ||
546 | .prcm = { | ||
547 | .omap2 = { | ||
548 | .prcm_reg_id = 1, | ||
549 | .module_bit = OMAP24XX_EN_GPT4_SHIFT, | ||
550 | .module_offs = CORE_MOD, | ||
551 | .idlest_reg_id = 1, | ||
552 | .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, | ||
553 | }, | ||
554 | }, | ||
555 | .slaves = omap2420_timer4_slaves, | ||
556 | .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves), | ||
557 | .class = &omap2420_timer_hwmod_class, | ||
558 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
559 | }; | ||
560 | |||
561 | /* timer5 */ | ||
562 | static struct omap_hwmod omap2420_timer5_hwmod; | ||
563 | static struct omap_hwmod_irq_info omap2420_timer5_mpu_irqs[] = { | ||
564 | { .irq = 41, }, | ||
565 | }; | ||
566 | |||
567 | static struct omap_hwmod_addr_space omap2420_timer5_addrs[] = { | ||
568 | { | ||
569 | .pa_start = 0x4807c000, | ||
570 | .pa_end = 0x4807c000 + SZ_1K - 1, | ||
571 | .flags = ADDR_TYPE_RT | ||
572 | }, | ||
573 | }; | ||
574 | |||
575 | /* l4_core -> timer5 */ | ||
576 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer5 = { | ||
577 | .master = &omap2420_l4_core_hwmod, | ||
578 | .slave = &omap2420_timer5_hwmod, | ||
579 | .clk = "gpt5_ick", | ||
580 | .addr = omap2420_timer5_addrs, | ||
581 | .addr_cnt = ARRAY_SIZE(omap2420_timer5_addrs), | ||
582 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
583 | }; | ||
584 | |||
585 | /* timer5 slave port */ | ||
586 | static struct omap_hwmod_ocp_if *omap2420_timer5_slaves[] = { | ||
587 | &omap2420_l4_core__timer5, | ||
588 | }; | ||
589 | |||
590 | /* timer5 hwmod */ | ||
591 | static struct omap_hwmod omap2420_timer5_hwmod = { | ||
592 | .name = "timer5", | ||
593 | .mpu_irqs = omap2420_timer5_mpu_irqs, | ||
594 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer5_mpu_irqs), | ||
595 | .main_clk = "gpt5_fck", | ||
596 | .prcm = { | ||
597 | .omap2 = { | ||
598 | .prcm_reg_id = 1, | ||
599 | .module_bit = OMAP24XX_EN_GPT5_SHIFT, | ||
600 | .module_offs = CORE_MOD, | ||
601 | .idlest_reg_id = 1, | ||
602 | .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, | ||
603 | }, | ||
604 | }, | ||
605 | .slaves = omap2420_timer5_slaves, | ||
606 | .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves), | ||
607 | .class = &omap2420_timer_hwmod_class, | ||
608 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
609 | }; | ||
610 | |||
611 | |||
612 | /* timer6 */ | ||
613 | static struct omap_hwmod omap2420_timer6_hwmod; | ||
614 | static struct omap_hwmod_irq_info omap2420_timer6_mpu_irqs[] = { | ||
615 | { .irq = 42, }, | ||
616 | }; | ||
617 | |||
618 | static struct omap_hwmod_addr_space omap2420_timer6_addrs[] = { | ||
619 | { | ||
620 | .pa_start = 0x4807e000, | ||
621 | .pa_end = 0x4807e000 + SZ_1K - 1, | ||
622 | .flags = ADDR_TYPE_RT | ||
623 | }, | ||
624 | }; | ||
625 | |||
626 | /* l4_core -> timer6 */ | ||
627 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer6 = { | ||
628 | .master = &omap2420_l4_core_hwmod, | ||
629 | .slave = &omap2420_timer6_hwmod, | ||
630 | .clk = "gpt6_ick", | ||
631 | .addr = omap2420_timer6_addrs, | ||
632 | .addr_cnt = ARRAY_SIZE(omap2420_timer6_addrs), | ||
633 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
634 | }; | ||
635 | |||
636 | /* timer6 slave port */ | ||
637 | static struct omap_hwmod_ocp_if *omap2420_timer6_slaves[] = { | ||
638 | &omap2420_l4_core__timer6, | ||
639 | }; | ||
640 | |||
641 | /* timer6 hwmod */ | ||
642 | static struct omap_hwmod omap2420_timer6_hwmod = { | ||
643 | .name = "timer6", | ||
644 | .mpu_irqs = omap2420_timer6_mpu_irqs, | ||
645 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer6_mpu_irqs), | ||
646 | .main_clk = "gpt6_fck", | ||
647 | .prcm = { | ||
648 | .omap2 = { | ||
649 | .prcm_reg_id = 1, | ||
650 | .module_bit = OMAP24XX_EN_GPT6_SHIFT, | ||
651 | .module_offs = CORE_MOD, | ||
652 | .idlest_reg_id = 1, | ||
653 | .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, | ||
654 | }, | ||
655 | }, | ||
656 | .slaves = omap2420_timer6_slaves, | ||
657 | .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves), | ||
658 | .class = &omap2420_timer_hwmod_class, | ||
659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
660 | }; | ||
661 | |||
662 | /* timer7 */ | ||
663 | static struct omap_hwmod omap2420_timer7_hwmod; | ||
664 | static struct omap_hwmod_irq_info omap2420_timer7_mpu_irqs[] = { | ||
665 | { .irq = 43, }, | ||
666 | }; | ||
667 | |||
668 | static struct omap_hwmod_addr_space omap2420_timer7_addrs[] = { | ||
669 | { | ||
670 | .pa_start = 0x48080000, | ||
671 | .pa_end = 0x48080000 + SZ_1K - 1, | ||
672 | .flags = ADDR_TYPE_RT | ||
673 | }, | ||
674 | }; | ||
675 | |||
676 | /* l4_core -> timer7 */ | ||
677 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer7 = { | ||
678 | .master = &omap2420_l4_core_hwmod, | ||
679 | .slave = &omap2420_timer7_hwmod, | ||
680 | .clk = "gpt7_ick", | ||
681 | .addr = omap2420_timer7_addrs, | ||
682 | .addr_cnt = ARRAY_SIZE(omap2420_timer7_addrs), | ||
683 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
684 | }; | ||
685 | |||
686 | /* timer7 slave port */ | ||
687 | static struct omap_hwmod_ocp_if *omap2420_timer7_slaves[] = { | ||
688 | &omap2420_l4_core__timer7, | ||
689 | }; | ||
690 | |||
691 | /* timer7 hwmod */ | ||
692 | static struct omap_hwmod omap2420_timer7_hwmod = { | ||
693 | .name = "timer7", | ||
694 | .mpu_irqs = omap2420_timer7_mpu_irqs, | ||
695 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer7_mpu_irqs), | ||
696 | .main_clk = "gpt7_fck", | ||
697 | .prcm = { | ||
698 | .omap2 = { | ||
699 | .prcm_reg_id = 1, | ||
700 | .module_bit = OMAP24XX_EN_GPT7_SHIFT, | ||
701 | .module_offs = CORE_MOD, | ||
702 | .idlest_reg_id = 1, | ||
703 | .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, | ||
704 | }, | ||
705 | }, | ||
706 | .slaves = omap2420_timer7_slaves, | ||
707 | .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves), | ||
708 | .class = &omap2420_timer_hwmod_class, | ||
709 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
710 | }; | ||
711 | |||
712 | /* timer8 */ | ||
713 | static struct omap_hwmod omap2420_timer8_hwmod; | ||
714 | static struct omap_hwmod_irq_info omap2420_timer8_mpu_irqs[] = { | ||
715 | { .irq = 44, }, | ||
716 | }; | ||
717 | |||
718 | static struct omap_hwmod_addr_space omap2420_timer8_addrs[] = { | ||
719 | { | ||
720 | .pa_start = 0x48082000, | ||
721 | .pa_end = 0x48082000 + SZ_1K - 1, | ||
722 | .flags = ADDR_TYPE_RT | ||
723 | }, | ||
724 | }; | ||
725 | |||
726 | /* l4_core -> timer8 */ | ||
727 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer8 = { | ||
728 | .master = &omap2420_l4_core_hwmod, | ||
729 | .slave = &omap2420_timer8_hwmod, | ||
730 | .clk = "gpt8_ick", | ||
731 | .addr = omap2420_timer8_addrs, | ||
732 | .addr_cnt = ARRAY_SIZE(omap2420_timer8_addrs), | ||
733 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
734 | }; | ||
735 | |||
736 | /* timer8 slave port */ | ||
737 | static struct omap_hwmod_ocp_if *omap2420_timer8_slaves[] = { | ||
738 | &omap2420_l4_core__timer8, | ||
739 | }; | ||
740 | |||
741 | /* timer8 hwmod */ | ||
742 | static struct omap_hwmod omap2420_timer8_hwmod = { | ||
743 | .name = "timer8", | ||
744 | .mpu_irqs = omap2420_timer8_mpu_irqs, | ||
745 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer8_mpu_irqs), | ||
746 | .main_clk = "gpt8_fck", | ||
747 | .prcm = { | ||
748 | .omap2 = { | ||
749 | .prcm_reg_id = 1, | ||
750 | .module_bit = OMAP24XX_EN_GPT8_SHIFT, | ||
751 | .module_offs = CORE_MOD, | ||
752 | .idlest_reg_id = 1, | ||
753 | .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, | ||
754 | }, | ||
755 | }, | ||
756 | .slaves = omap2420_timer8_slaves, | ||
757 | .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves), | ||
758 | .class = &omap2420_timer_hwmod_class, | ||
759 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
760 | }; | ||
761 | |||
762 | /* timer9 */ | ||
763 | static struct omap_hwmod omap2420_timer9_hwmod; | ||
764 | static struct omap_hwmod_irq_info omap2420_timer9_mpu_irqs[] = { | ||
765 | { .irq = 45, }, | ||
766 | }; | ||
767 | |||
768 | static struct omap_hwmod_addr_space omap2420_timer9_addrs[] = { | ||
769 | { | ||
770 | .pa_start = 0x48084000, | ||
771 | .pa_end = 0x48084000 + SZ_1K - 1, | ||
772 | .flags = ADDR_TYPE_RT | ||
773 | }, | ||
774 | }; | ||
775 | |||
776 | /* l4_core -> timer9 */ | ||
777 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer9 = { | ||
778 | .master = &omap2420_l4_core_hwmod, | ||
779 | .slave = &omap2420_timer9_hwmod, | ||
780 | .clk = "gpt9_ick", | ||
781 | .addr = omap2420_timer9_addrs, | ||
782 | .addr_cnt = ARRAY_SIZE(omap2420_timer9_addrs), | ||
783 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
784 | }; | ||
785 | |||
786 | /* timer9 slave port */ | ||
787 | static struct omap_hwmod_ocp_if *omap2420_timer9_slaves[] = { | ||
788 | &omap2420_l4_core__timer9, | ||
789 | }; | ||
790 | |||
791 | /* timer9 hwmod */ | ||
792 | static struct omap_hwmod omap2420_timer9_hwmod = { | ||
793 | .name = "timer9", | ||
794 | .mpu_irqs = omap2420_timer9_mpu_irqs, | ||
795 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer9_mpu_irqs), | ||
796 | .main_clk = "gpt9_fck", | ||
797 | .prcm = { | ||
798 | .omap2 = { | ||
799 | .prcm_reg_id = 1, | ||
800 | .module_bit = OMAP24XX_EN_GPT9_SHIFT, | ||
801 | .module_offs = CORE_MOD, | ||
802 | .idlest_reg_id = 1, | ||
803 | .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, | ||
804 | }, | ||
805 | }, | ||
806 | .slaves = omap2420_timer9_slaves, | ||
807 | .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves), | ||
808 | .class = &omap2420_timer_hwmod_class, | ||
809 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
810 | }; | ||
811 | |||
812 | /* timer10 */ | ||
813 | static struct omap_hwmod omap2420_timer10_hwmod; | ||
814 | static struct omap_hwmod_irq_info omap2420_timer10_mpu_irqs[] = { | ||
815 | { .irq = 46, }, | ||
816 | }; | ||
817 | |||
818 | static struct omap_hwmod_addr_space omap2420_timer10_addrs[] = { | ||
819 | { | ||
820 | .pa_start = 0x48086000, | ||
821 | .pa_end = 0x48086000 + SZ_1K - 1, | ||
822 | .flags = ADDR_TYPE_RT | ||
823 | }, | ||
824 | }; | ||
825 | |||
826 | /* l4_core -> timer10 */ | ||
827 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer10 = { | ||
828 | .master = &omap2420_l4_core_hwmod, | ||
829 | .slave = &omap2420_timer10_hwmod, | ||
830 | .clk = "gpt10_ick", | ||
831 | .addr = omap2420_timer10_addrs, | ||
832 | .addr_cnt = ARRAY_SIZE(omap2420_timer10_addrs), | ||
833 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
834 | }; | ||
835 | |||
836 | /* timer10 slave port */ | ||
837 | static struct omap_hwmod_ocp_if *omap2420_timer10_slaves[] = { | ||
838 | &omap2420_l4_core__timer10, | ||
839 | }; | ||
840 | |||
841 | /* timer10 hwmod */ | ||
842 | static struct omap_hwmod omap2420_timer10_hwmod = { | ||
843 | .name = "timer10", | ||
844 | .mpu_irqs = omap2420_timer10_mpu_irqs, | ||
845 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer10_mpu_irqs), | ||
846 | .main_clk = "gpt10_fck", | ||
847 | .prcm = { | ||
848 | .omap2 = { | ||
849 | .prcm_reg_id = 1, | ||
850 | .module_bit = OMAP24XX_EN_GPT10_SHIFT, | ||
851 | .module_offs = CORE_MOD, | ||
852 | .idlest_reg_id = 1, | ||
853 | .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, | ||
854 | }, | ||
855 | }, | ||
856 | .slaves = omap2420_timer10_slaves, | ||
857 | .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves), | ||
858 | .class = &omap2420_timer_hwmod_class, | ||
859 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
860 | }; | ||
861 | |||
862 | /* timer11 */ | ||
863 | static struct omap_hwmod omap2420_timer11_hwmod; | ||
864 | static struct omap_hwmod_irq_info omap2420_timer11_mpu_irqs[] = { | ||
865 | { .irq = 47, }, | ||
866 | }; | ||
867 | |||
868 | static struct omap_hwmod_addr_space omap2420_timer11_addrs[] = { | ||
869 | { | ||
870 | .pa_start = 0x48088000, | ||
871 | .pa_end = 0x48088000 + SZ_1K - 1, | ||
872 | .flags = ADDR_TYPE_RT | ||
873 | }, | ||
874 | }; | ||
875 | |||
876 | /* l4_core -> timer11 */ | ||
877 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer11 = { | ||
878 | .master = &omap2420_l4_core_hwmod, | ||
879 | .slave = &omap2420_timer11_hwmod, | ||
880 | .clk = "gpt11_ick", | ||
881 | .addr = omap2420_timer11_addrs, | ||
882 | .addr_cnt = ARRAY_SIZE(omap2420_timer11_addrs), | ||
883 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
884 | }; | ||
885 | |||
886 | /* timer11 slave port */ | ||
887 | static struct omap_hwmod_ocp_if *omap2420_timer11_slaves[] = { | ||
888 | &omap2420_l4_core__timer11, | ||
889 | }; | ||
890 | |||
891 | /* timer11 hwmod */ | ||
892 | static struct omap_hwmod omap2420_timer11_hwmod = { | ||
893 | .name = "timer11", | ||
894 | .mpu_irqs = omap2420_timer11_mpu_irqs, | ||
895 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer11_mpu_irqs), | ||
896 | .main_clk = "gpt11_fck", | ||
897 | .prcm = { | ||
898 | .omap2 = { | ||
899 | .prcm_reg_id = 1, | ||
900 | .module_bit = OMAP24XX_EN_GPT11_SHIFT, | ||
901 | .module_offs = CORE_MOD, | ||
902 | .idlest_reg_id = 1, | ||
903 | .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, | ||
904 | }, | ||
905 | }, | ||
906 | .slaves = omap2420_timer11_slaves, | ||
907 | .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves), | ||
908 | .class = &omap2420_timer_hwmod_class, | ||
909 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
910 | }; | ||
911 | |||
912 | /* timer12 */ | ||
913 | static struct omap_hwmod omap2420_timer12_hwmod; | ||
914 | static struct omap_hwmod_irq_info omap2420_timer12_mpu_irqs[] = { | ||
915 | { .irq = 48, }, | ||
916 | }; | ||
917 | |||
918 | static struct omap_hwmod_addr_space omap2420_timer12_addrs[] = { | ||
919 | { | ||
920 | .pa_start = 0x4808a000, | ||
921 | .pa_end = 0x4808a000 + SZ_1K - 1, | ||
922 | .flags = ADDR_TYPE_RT | ||
923 | }, | ||
924 | }; | ||
925 | |||
926 | /* l4_core -> timer12 */ | ||
927 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer12 = { | ||
928 | .master = &omap2420_l4_core_hwmod, | ||
929 | .slave = &omap2420_timer12_hwmod, | ||
930 | .clk = "gpt12_ick", | ||
931 | .addr = omap2420_timer12_addrs, | ||
932 | .addr_cnt = ARRAY_SIZE(omap2420_timer12_addrs), | ||
933 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
934 | }; | ||
935 | |||
936 | /* timer12 slave port */ | ||
937 | static struct omap_hwmod_ocp_if *omap2420_timer12_slaves[] = { | ||
938 | &omap2420_l4_core__timer12, | ||
939 | }; | ||
940 | |||
941 | /* timer12 hwmod */ | ||
942 | static struct omap_hwmod omap2420_timer12_hwmod = { | ||
943 | .name = "timer12", | ||
944 | .mpu_irqs = omap2420_timer12_mpu_irqs, | ||
945 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer12_mpu_irqs), | ||
946 | .main_clk = "gpt12_fck", | ||
947 | .prcm = { | ||
948 | .omap2 = { | ||
949 | .prcm_reg_id = 1, | ||
950 | .module_bit = OMAP24XX_EN_GPT12_SHIFT, | ||
951 | .module_offs = CORE_MOD, | ||
952 | .idlest_reg_id = 1, | ||
953 | .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, | ||
954 | }, | ||
955 | }, | ||
956 | .slaves = omap2420_timer12_slaves, | ||
957 | .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves), | ||
958 | .class = &omap2420_timer_hwmod_class, | ||
959 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
960 | }; | ||
961 | |||
282 | /* l4_wkup -> wd_timer2 */ | 962 | /* l4_wkup -> wd_timer2 */ |
283 | static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { | 963 | static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { |
284 | { | 964 | { |
@@ -308,7 +988,7 @@ static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = { | |||
308 | .sysc_offs = 0x0010, | 988 | .sysc_offs = 0x0010, |
309 | .syss_offs = 0x0014, | 989 | .syss_offs = 0x0014, |
310 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET | | 990 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET | |
311 | SYSC_HAS_AUTOIDLE), | 991 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
312 | .sysc_fields = &omap_hwmod_sysc_type1, | 992 | .sysc_fields = &omap_hwmod_sysc_type1, |
313 | }; | 993 | }; |
314 | 994 | ||
@@ -349,7 +1029,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = { | |||
349 | .syss_offs = 0x58, | 1029 | .syss_offs = 0x58, |
350 | .sysc_flags = (SYSC_HAS_SIDLEMODE | | 1030 | .sysc_flags = (SYSC_HAS_SIDLEMODE | |
351 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | 1031 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | |
352 | SYSC_HAS_AUTOIDLE), | 1032 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
353 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1033 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
354 | .sysc_fields = &omap_hwmod_sysc_type1, | 1034 | .sysc_fields = &omap_hwmod_sysc_type1, |
355 | }; | 1035 | }; |
@@ -470,12 +1150,298 @@ static struct omap_hwmod omap2420_uart3_hwmod = { | |||
470 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 1150 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
471 | }; | 1151 | }; |
472 | 1152 | ||
1153 | /* | ||
1154 | * 'dss' class | ||
1155 | * display sub-system | ||
1156 | */ | ||
1157 | |||
1158 | static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = { | ||
1159 | .rev_offs = 0x0000, | ||
1160 | .sysc_offs = 0x0010, | ||
1161 | .syss_offs = 0x0014, | ||
1162 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1163 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1164 | }; | ||
1165 | |||
1166 | static struct omap_hwmod_class omap2420_dss_hwmod_class = { | ||
1167 | .name = "dss", | ||
1168 | .sysc = &omap2420_dss_sysc, | ||
1169 | }; | ||
1170 | |||
1171 | /* dss */ | ||
1172 | static struct omap_hwmod_irq_info omap2420_dss_irqs[] = { | ||
1173 | { .irq = 25 }, | ||
1174 | }; | ||
1175 | |||
1176 | static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = { | ||
1177 | { .name = "dispc", .dma_req = 5 }, | ||
1178 | }; | ||
1179 | |||
1180 | /* dss */ | ||
1181 | /* dss master ports */ | ||
1182 | static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = { | ||
1183 | &omap2420_dss__l3, | ||
1184 | }; | ||
1185 | |||
1186 | static struct omap_hwmod_addr_space omap2420_dss_addrs[] = { | ||
1187 | { | ||
1188 | .pa_start = 0x48050000, | ||
1189 | .pa_end = 0x480503FF, | ||
1190 | .flags = ADDR_TYPE_RT | ||
1191 | }, | ||
1192 | }; | ||
1193 | |||
1194 | /* l4_core -> dss */ | ||
1195 | static struct omap_hwmod_ocp_if omap2420_l4_core__dss = { | ||
1196 | .master = &omap2420_l4_core_hwmod, | ||
1197 | .slave = &omap2420_dss_core_hwmod, | ||
1198 | .clk = "dss_ick", | ||
1199 | .addr = omap2420_dss_addrs, | ||
1200 | .addr_cnt = ARRAY_SIZE(omap2420_dss_addrs), | ||
1201 | .fw = { | ||
1202 | .omap2 = { | ||
1203 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION, | ||
1204 | .flags = OMAP_FIREWALL_L4, | ||
1205 | } | ||
1206 | }, | ||
1207 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1208 | }; | ||
1209 | |||
1210 | /* dss slave ports */ | ||
1211 | static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = { | ||
1212 | &omap2420_l4_core__dss, | ||
1213 | }; | ||
1214 | |||
1215 | static struct omap_hwmod_opt_clk dss_opt_clks[] = { | ||
1216 | { .role = "tv_clk", .clk = "dss_54m_fck" }, | ||
1217 | { .role = "sys_clk", .clk = "dss2_fck" }, | ||
1218 | }; | ||
1219 | |||
1220 | static struct omap_hwmod omap2420_dss_core_hwmod = { | ||
1221 | .name = "dss_core", | ||
1222 | .class = &omap2420_dss_hwmod_class, | ||
1223 | .main_clk = "dss1_fck", /* instead of dss_fck */ | ||
1224 | .mpu_irqs = omap2420_dss_irqs, | ||
1225 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dss_irqs), | ||
1226 | .sdma_reqs = omap2420_dss_sdma_chs, | ||
1227 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_dss_sdma_chs), | ||
1228 | .prcm = { | ||
1229 | .omap2 = { | ||
1230 | .prcm_reg_id = 1, | ||
1231 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1232 | .module_offs = CORE_MOD, | ||
1233 | .idlest_reg_id = 1, | ||
1234 | .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT, | ||
1235 | }, | ||
1236 | }, | ||
1237 | .opt_clks = dss_opt_clks, | ||
1238 | .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks), | ||
1239 | .slaves = omap2420_dss_slaves, | ||
1240 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves), | ||
1241 | .masters = omap2420_dss_masters, | ||
1242 | .masters_cnt = ARRAY_SIZE(omap2420_dss_masters), | ||
1243 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1244 | .flags = HWMOD_NO_IDLEST, | ||
1245 | }; | ||
1246 | |||
1247 | /* | ||
1248 | * 'dispc' class | ||
1249 | * display controller | ||
1250 | */ | ||
1251 | |||
1252 | static struct omap_hwmod_class_sysconfig omap2420_dispc_sysc = { | ||
1253 | .rev_offs = 0x0000, | ||
1254 | .sysc_offs = 0x0010, | ||
1255 | .syss_offs = 0x0014, | ||
1256 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE | | ||
1257 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1258 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
1259 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
1260 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1261 | }; | ||
1262 | |||
1263 | static struct omap_hwmod_class omap2420_dispc_hwmod_class = { | ||
1264 | .name = "dispc", | ||
1265 | .sysc = &omap2420_dispc_sysc, | ||
1266 | }; | ||
1267 | |||
1268 | static struct omap_hwmod_addr_space omap2420_dss_dispc_addrs[] = { | ||
1269 | { | ||
1270 | .pa_start = 0x48050400, | ||
1271 | .pa_end = 0x480507FF, | ||
1272 | .flags = ADDR_TYPE_RT | ||
1273 | }, | ||
1274 | }; | ||
1275 | |||
1276 | /* l4_core -> dss_dispc */ | ||
1277 | static struct omap_hwmod_ocp_if omap2420_l4_core__dss_dispc = { | ||
1278 | .master = &omap2420_l4_core_hwmod, | ||
1279 | .slave = &omap2420_dss_dispc_hwmod, | ||
1280 | .clk = "dss_ick", | ||
1281 | .addr = omap2420_dss_dispc_addrs, | ||
1282 | .addr_cnt = ARRAY_SIZE(omap2420_dss_dispc_addrs), | ||
1283 | .fw = { | ||
1284 | .omap2 = { | ||
1285 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION, | ||
1286 | .flags = OMAP_FIREWALL_L4, | ||
1287 | } | ||
1288 | }, | ||
1289 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1290 | }; | ||
1291 | |||
1292 | /* dss_dispc slave ports */ | ||
1293 | static struct omap_hwmod_ocp_if *omap2420_dss_dispc_slaves[] = { | ||
1294 | &omap2420_l4_core__dss_dispc, | ||
1295 | }; | ||
1296 | |||
1297 | static struct omap_hwmod omap2420_dss_dispc_hwmod = { | ||
1298 | .name = "dss_dispc", | ||
1299 | .class = &omap2420_dispc_hwmod_class, | ||
1300 | .main_clk = "dss1_fck", | ||
1301 | .prcm = { | ||
1302 | .omap2 = { | ||
1303 | .prcm_reg_id = 1, | ||
1304 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1305 | .module_offs = CORE_MOD, | ||
1306 | .idlest_reg_id = 1, | ||
1307 | .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT, | ||
1308 | }, | ||
1309 | }, | ||
1310 | .slaves = omap2420_dss_dispc_slaves, | ||
1311 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves), | ||
1312 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1313 | .flags = HWMOD_NO_IDLEST, | ||
1314 | }; | ||
1315 | |||
1316 | /* | ||
1317 | * 'rfbi' class | ||
1318 | * remote frame buffer interface | ||
1319 | */ | ||
1320 | |||
1321 | static struct omap_hwmod_class_sysconfig omap2420_rfbi_sysc = { | ||
1322 | .rev_offs = 0x0000, | ||
1323 | .sysc_offs = 0x0010, | ||
1324 | .syss_offs = 0x0014, | ||
1325 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | ||
1326 | SYSC_HAS_AUTOIDLE), | ||
1327 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1328 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1329 | }; | ||
1330 | |||
1331 | static struct omap_hwmod_class omap2420_rfbi_hwmod_class = { | ||
1332 | .name = "rfbi", | ||
1333 | .sysc = &omap2420_rfbi_sysc, | ||
1334 | }; | ||
1335 | |||
1336 | static struct omap_hwmod_addr_space omap2420_dss_rfbi_addrs[] = { | ||
1337 | { | ||
1338 | .pa_start = 0x48050800, | ||
1339 | .pa_end = 0x48050BFF, | ||
1340 | .flags = ADDR_TYPE_RT | ||
1341 | }, | ||
1342 | }; | ||
1343 | |||
1344 | /* l4_core -> dss_rfbi */ | ||
1345 | static struct omap_hwmod_ocp_if omap2420_l4_core__dss_rfbi = { | ||
1346 | .master = &omap2420_l4_core_hwmod, | ||
1347 | .slave = &omap2420_dss_rfbi_hwmod, | ||
1348 | .clk = "dss_ick", | ||
1349 | .addr = omap2420_dss_rfbi_addrs, | ||
1350 | .addr_cnt = ARRAY_SIZE(omap2420_dss_rfbi_addrs), | ||
1351 | .fw = { | ||
1352 | .omap2 = { | ||
1353 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION, | ||
1354 | .flags = OMAP_FIREWALL_L4, | ||
1355 | } | ||
1356 | }, | ||
1357 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1358 | }; | ||
1359 | |||
1360 | /* dss_rfbi slave ports */ | ||
1361 | static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = { | ||
1362 | &omap2420_l4_core__dss_rfbi, | ||
1363 | }; | ||
1364 | |||
1365 | static struct omap_hwmod omap2420_dss_rfbi_hwmod = { | ||
1366 | .name = "dss_rfbi", | ||
1367 | .class = &omap2420_rfbi_hwmod_class, | ||
1368 | .main_clk = "dss1_fck", | ||
1369 | .prcm = { | ||
1370 | .omap2 = { | ||
1371 | .prcm_reg_id = 1, | ||
1372 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1373 | .module_offs = CORE_MOD, | ||
1374 | }, | ||
1375 | }, | ||
1376 | .slaves = omap2420_dss_rfbi_slaves, | ||
1377 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves), | ||
1378 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1379 | .flags = HWMOD_NO_IDLEST, | ||
1380 | }; | ||
1381 | |||
1382 | /* | ||
1383 | * 'venc' class | ||
1384 | * video encoder | ||
1385 | */ | ||
1386 | |||
1387 | static struct omap_hwmod_class omap2420_venc_hwmod_class = { | ||
1388 | .name = "venc", | ||
1389 | }; | ||
1390 | |||
1391 | /* dss_venc */ | ||
1392 | static struct omap_hwmod_addr_space omap2420_dss_venc_addrs[] = { | ||
1393 | { | ||
1394 | .pa_start = 0x48050C00, | ||
1395 | .pa_end = 0x48050FFF, | ||
1396 | .flags = ADDR_TYPE_RT | ||
1397 | }, | ||
1398 | }; | ||
1399 | |||
1400 | /* l4_core -> dss_venc */ | ||
1401 | static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = { | ||
1402 | .master = &omap2420_l4_core_hwmod, | ||
1403 | .slave = &omap2420_dss_venc_hwmod, | ||
1404 | .clk = "dss_54m_fck", | ||
1405 | .addr = omap2420_dss_venc_addrs, | ||
1406 | .addr_cnt = ARRAY_SIZE(omap2420_dss_venc_addrs), | ||
1407 | .fw = { | ||
1408 | .omap2 = { | ||
1409 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION, | ||
1410 | .flags = OMAP_FIREWALL_L4, | ||
1411 | } | ||
1412 | }, | ||
1413 | .flags = OCPIF_SWSUP_IDLE, | ||
1414 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1415 | }; | ||
1416 | |||
1417 | /* dss_venc slave ports */ | ||
1418 | static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = { | ||
1419 | &omap2420_l4_core__dss_venc, | ||
1420 | }; | ||
1421 | |||
1422 | static struct omap_hwmod omap2420_dss_venc_hwmod = { | ||
1423 | .name = "dss_venc", | ||
1424 | .class = &omap2420_venc_hwmod_class, | ||
1425 | .main_clk = "dss1_fck", | ||
1426 | .prcm = { | ||
1427 | .omap2 = { | ||
1428 | .prcm_reg_id = 1, | ||
1429 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1430 | .module_offs = CORE_MOD, | ||
1431 | }, | ||
1432 | }, | ||
1433 | .slaves = omap2420_dss_venc_slaves, | ||
1434 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves), | ||
1435 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1436 | .flags = HWMOD_NO_IDLEST, | ||
1437 | }; | ||
1438 | |||
473 | /* I2C common */ | 1439 | /* I2C common */ |
474 | static struct omap_hwmod_class_sysconfig i2c_sysc = { | 1440 | static struct omap_hwmod_class_sysconfig i2c_sysc = { |
475 | .rev_offs = 0x00, | 1441 | .rev_offs = 0x00, |
476 | .sysc_offs = 0x20, | 1442 | .sysc_offs = 0x20, |
477 | .syss_offs = 0x10, | 1443 | .syss_offs = 0x10, |
478 | .sysc_flags = SYSC_HAS_SOFTRESET, | 1444 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), |
479 | .sysc_fields = &omap_hwmod_sysc_type1, | 1445 | .sysc_fields = &omap_hwmod_sysc_type1, |
480 | }; | 1446 | }; |
481 | 1447 | ||
@@ -647,7 +1613,8 @@ static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = { | |||
647 | .sysc_offs = 0x0010, | 1613 | .sysc_offs = 0x0010, |
648 | .syss_offs = 0x0014, | 1614 | .syss_offs = 0x0014, |
649 | .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | | 1615 | .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | |
650 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | 1616 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE | |
1617 | SYSS_HAS_RESET_STATUS), | ||
651 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1618 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
652 | .sysc_fields = &omap_hwmod_sysc_type1, | 1619 | .sysc_fields = &omap_hwmod_sysc_type1, |
653 | }; | 1620 | }; |
@@ -789,7 +1756,7 @@ static struct omap_hwmod_class_sysconfig omap2420_dma_sysc = { | |||
789 | .syss_offs = 0x0028, | 1756 | .syss_offs = 0x0028, |
790 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE | | 1757 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE | |
791 | SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE | | 1758 | SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE | |
792 | SYSC_HAS_AUTOIDLE), | 1759 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
793 | .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | 1760 | .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), |
794 | .sysc_fields = &omap_hwmod_sysc_type1, | 1761 | .sysc_fields = &omap_hwmod_sysc_type1, |
795 | }; | 1762 | }; |
@@ -864,16 +1831,342 @@ static struct omap_hwmod omap2420_dma_system_hwmod = { | |||
864 | .flags = HWMOD_NO_IDLEST, | 1831 | .flags = HWMOD_NO_IDLEST, |
865 | }; | 1832 | }; |
866 | 1833 | ||
1834 | /* | ||
1835 | * 'mailbox' class | ||
1836 | * mailbox module allowing communication between the on-chip processors | ||
1837 | * using a queued mailbox-interrupt mechanism. | ||
1838 | */ | ||
1839 | |||
1840 | static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = { | ||
1841 | .rev_offs = 0x000, | ||
1842 | .sysc_offs = 0x010, | ||
1843 | .syss_offs = 0x014, | ||
1844 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
1845 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1846 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1847 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1848 | }; | ||
1849 | |||
1850 | static struct omap_hwmod_class omap2420_mailbox_hwmod_class = { | ||
1851 | .name = "mailbox", | ||
1852 | .sysc = &omap2420_mailbox_sysc, | ||
1853 | }; | ||
1854 | |||
1855 | /* mailbox */ | ||
1856 | static struct omap_hwmod omap2420_mailbox_hwmod; | ||
1857 | static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { | ||
1858 | { .name = "dsp", .irq = 26 }, | ||
1859 | { .name = "iva", .irq = 34 }, | ||
1860 | }; | ||
1861 | |||
1862 | static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = { | ||
1863 | { | ||
1864 | .pa_start = 0x48094000, | ||
1865 | .pa_end = 0x480941ff, | ||
1866 | .flags = ADDR_TYPE_RT, | ||
1867 | }, | ||
1868 | }; | ||
1869 | |||
1870 | /* l4_core -> mailbox */ | ||
1871 | static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { | ||
1872 | .master = &omap2420_l4_core_hwmod, | ||
1873 | .slave = &omap2420_mailbox_hwmod, | ||
1874 | .addr = omap2420_mailbox_addrs, | ||
1875 | .addr_cnt = ARRAY_SIZE(omap2420_mailbox_addrs), | ||
1876 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1877 | }; | ||
1878 | |||
1879 | /* mailbox slave ports */ | ||
1880 | static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = { | ||
1881 | &omap2420_l4_core__mailbox, | ||
1882 | }; | ||
1883 | |||
1884 | static struct omap_hwmod omap2420_mailbox_hwmod = { | ||
1885 | .name = "mailbox", | ||
1886 | .class = &omap2420_mailbox_hwmod_class, | ||
1887 | .mpu_irqs = omap2420_mailbox_irqs, | ||
1888 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mailbox_irqs), | ||
1889 | .main_clk = "mailboxes_ick", | ||
1890 | .prcm = { | ||
1891 | .omap2 = { | ||
1892 | .prcm_reg_id = 1, | ||
1893 | .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT, | ||
1894 | .module_offs = CORE_MOD, | ||
1895 | .idlest_reg_id = 1, | ||
1896 | .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, | ||
1897 | }, | ||
1898 | }, | ||
1899 | .slaves = omap2420_mailbox_slaves, | ||
1900 | .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves), | ||
1901 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1902 | }; | ||
1903 | |||
1904 | /* | ||
1905 | * 'mcspi' class | ||
1906 | * multichannel serial port interface (mcspi) / master/slave synchronous serial | ||
1907 | * bus | ||
1908 | */ | ||
1909 | |||
1910 | static struct omap_hwmod_class_sysconfig omap2420_mcspi_sysc = { | ||
1911 | .rev_offs = 0x0000, | ||
1912 | .sysc_offs = 0x0010, | ||
1913 | .syss_offs = 0x0014, | ||
1914 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
1915 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
1916 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
1917 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1918 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1919 | }; | ||
1920 | |||
1921 | static struct omap_hwmod_class omap2420_mcspi_class = { | ||
1922 | .name = "mcspi", | ||
1923 | .sysc = &omap2420_mcspi_sysc, | ||
1924 | .rev = OMAP2_MCSPI_REV, | ||
1925 | }; | ||
1926 | |||
1927 | /* mcspi1 */ | ||
1928 | static struct omap_hwmod_irq_info omap2420_mcspi1_mpu_irqs[] = { | ||
1929 | { .irq = 65 }, | ||
1930 | }; | ||
1931 | |||
1932 | static struct omap_hwmod_dma_info omap2420_mcspi1_sdma_reqs[] = { | ||
1933 | { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */ | ||
1934 | { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */ | ||
1935 | { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */ | ||
1936 | { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */ | ||
1937 | { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */ | ||
1938 | { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */ | ||
1939 | { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */ | ||
1940 | { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */ | ||
1941 | }; | ||
1942 | |||
1943 | static struct omap_hwmod_ocp_if *omap2420_mcspi1_slaves[] = { | ||
1944 | &omap2420_l4_core__mcspi1, | ||
1945 | }; | ||
1946 | |||
1947 | static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = { | ||
1948 | .num_chipselect = 4, | ||
1949 | }; | ||
1950 | |||
1951 | static struct omap_hwmod omap2420_mcspi1_hwmod = { | ||
1952 | .name = "mcspi1_hwmod", | ||
1953 | .mpu_irqs = omap2420_mcspi1_mpu_irqs, | ||
1954 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi1_mpu_irqs), | ||
1955 | .sdma_reqs = omap2420_mcspi1_sdma_reqs, | ||
1956 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi1_sdma_reqs), | ||
1957 | .main_clk = "mcspi1_fck", | ||
1958 | .prcm = { | ||
1959 | .omap2 = { | ||
1960 | .module_offs = CORE_MOD, | ||
1961 | .prcm_reg_id = 1, | ||
1962 | .module_bit = OMAP24XX_EN_MCSPI1_SHIFT, | ||
1963 | .idlest_reg_id = 1, | ||
1964 | .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT, | ||
1965 | }, | ||
1966 | }, | ||
1967 | .slaves = omap2420_mcspi1_slaves, | ||
1968 | .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves), | ||
1969 | .class = &omap2420_mcspi_class, | ||
1970 | .dev_attr = &omap_mcspi1_dev_attr, | ||
1971 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1972 | }; | ||
1973 | |||
1974 | /* mcspi2 */ | ||
1975 | static struct omap_hwmod_irq_info omap2420_mcspi2_mpu_irqs[] = { | ||
1976 | { .irq = 66 }, | ||
1977 | }; | ||
1978 | |||
1979 | static struct omap_hwmod_dma_info omap2420_mcspi2_sdma_reqs[] = { | ||
1980 | { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */ | ||
1981 | { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */ | ||
1982 | { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */ | ||
1983 | { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */ | ||
1984 | }; | ||
1985 | |||
1986 | static struct omap_hwmod_ocp_if *omap2420_mcspi2_slaves[] = { | ||
1987 | &omap2420_l4_core__mcspi2, | ||
1988 | }; | ||
1989 | |||
1990 | static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = { | ||
1991 | .num_chipselect = 2, | ||
1992 | }; | ||
1993 | |||
1994 | static struct omap_hwmod omap2420_mcspi2_hwmod = { | ||
1995 | .name = "mcspi2_hwmod", | ||
1996 | .mpu_irqs = omap2420_mcspi2_mpu_irqs, | ||
1997 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi2_mpu_irqs), | ||
1998 | .sdma_reqs = omap2420_mcspi2_sdma_reqs, | ||
1999 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi2_sdma_reqs), | ||
2000 | .main_clk = "mcspi2_fck", | ||
2001 | .prcm = { | ||
2002 | .omap2 = { | ||
2003 | .module_offs = CORE_MOD, | ||
2004 | .prcm_reg_id = 1, | ||
2005 | .module_bit = OMAP24XX_EN_MCSPI2_SHIFT, | ||
2006 | .idlest_reg_id = 1, | ||
2007 | .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT, | ||
2008 | }, | ||
2009 | }, | ||
2010 | .slaves = omap2420_mcspi2_slaves, | ||
2011 | .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves), | ||
2012 | .class = &omap2420_mcspi_class, | ||
2013 | .dev_attr = &omap_mcspi2_dev_attr, | ||
2014 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
2015 | }; | ||
2016 | |||
2017 | /* | ||
2018 | * 'mcbsp' class | ||
2019 | * multi channel buffered serial port controller | ||
2020 | */ | ||
2021 | |||
2022 | static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = { | ||
2023 | .name = "mcbsp", | ||
2024 | }; | ||
2025 | |||
2026 | /* mcbsp1 */ | ||
2027 | static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { | ||
2028 | { .name = "tx", .irq = 59 }, | ||
2029 | { .name = "rx", .irq = 60 }, | ||
2030 | }; | ||
2031 | |||
2032 | static struct omap_hwmod_dma_info omap2420_mcbsp1_sdma_chs[] = { | ||
2033 | { .name = "rx", .dma_req = 32 }, | ||
2034 | { .name = "tx", .dma_req = 31 }, | ||
2035 | }; | ||
2036 | |||
2037 | static struct omap_hwmod_addr_space omap2420_mcbsp1_addrs[] = { | ||
2038 | { | ||
2039 | .name = "mpu", | ||
2040 | .pa_start = 0x48074000, | ||
2041 | .pa_end = 0x480740ff, | ||
2042 | .flags = ADDR_TYPE_RT | ||
2043 | }, | ||
2044 | }; | ||
2045 | |||
2046 | /* l4_core -> mcbsp1 */ | ||
2047 | static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = { | ||
2048 | .master = &omap2420_l4_core_hwmod, | ||
2049 | .slave = &omap2420_mcbsp1_hwmod, | ||
2050 | .clk = "mcbsp1_ick", | ||
2051 | .addr = omap2420_mcbsp1_addrs, | ||
2052 | .addr_cnt = ARRAY_SIZE(omap2420_mcbsp1_addrs), | ||
2053 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2054 | }; | ||
2055 | |||
2056 | /* mcbsp1 slave ports */ | ||
2057 | static struct omap_hwmod_ocp_if *omap2420_mcbsp1_slaves[] = { | ||
2058 | &omap2420_l4_core__mcbsp1, | ||
2059 | }; | ||
2060 | |||
2061 | static struct omap_hwmod omap2420_mcbsp1_hwmod = { | ||
2062 | .name = "mcbsp1", | ||
2063 | .class = &omap2420_mcbsp_hwmod_class, | ||
2064 | .mpu_irqs = omap2420_mcbsp1_irqs, | ||
2065 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_irqs), | ||
2066 | .sdma_reqs = omap2420_mcbsp1_sdma_chs, | ||
2067 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_sdma_chs), | ||
2068 | .main_clk = "mcbsp1_fck", | ||
2069 | .prcm = { | ||
2070 | .omap2 = { | ||
2071 | .prcm_reg_id = 1, | ||
2072 | .module_bit = OMAP24XX_EN_MCBSP1_SHIFT, | ||
2073 | .module_offs = CORE_MOD, | ||
2074 | .idlest_reg_id = 1, | ||
2075 | .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT, | ||
2076 | }, | ||
2077 | }, | ||
2078 | .slaves = omap2420_mcbsp1_slaves, | ||
2079 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves), | ||
2080 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
2081 | }; | ||
2082 | |||
2083 | /* mcbsp2 */ | ||
2084 | static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { | ||
2085 | { .name = "tx", .irq = 62 }, | ||
2086 | { .name = "rx", .irq = 63 }, | ||
2087 | }; | ||
2088 | |||
2089 | static struct omap_hwmod_dma_info omap2420_mcbsp2_sdma_chs[] = { | ||
2090 | { .name = "rx", .dma_req = 34 }, | ||
2091 | { .name = "tx", .dma_req = 33 }, | ||
2092 | }; | ||
2093 | |||
2094 | static struct omap_hwmod_addr_space omap2420_mcbsp2_addrs[] = { | ||
2095 | { | ||
2096 | .name = "mpu", | ||
2097 | .pa_start = 0x48076000, | ||
2098 | .pa_end = 0x480760ff, | ||
2099 | .flags = ADDR_TYPE_RT | ||
2100 | }, | ||
2101 | }; | ||
2102 | |||
2103 | /* l4_core -> mcbsp2 */ | ||
2104 | static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = { | ||
2105 | .master = &omap2420_l4_core_hwmod, | ||
2106 | .slave = &omap2420_mcbsp2_hwmod, | ||
2107 | .clk = "mcbsp2_ick", | ||
2108 | .addr = omap2420_mcbsp2_addrs, | ||
2109 | .addr_cnt = ARRAY_SIZE(omap2420_mcbsp2_addrs), | ||
2110 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2111 | }; | ||
2112 | |||
2113 | /* mcbsp2 slave ports */ | ||
2114 | static struct omap_hwmod_ocp_if *omap2420_mcbsp2_slaves[] = { | ||
2115 | &omap2420_l4_core__mcbsp2, | ||
2116 | }; | ||
2117 | |||
2118 | static struct omap_hwmod omap2420_mcbsp2_hwmod = { | ||
2119 | .name = "mcbsp2", | ||
2120 | .class = &omap2420_mcbsp_hwmod_class, | ||
2121 | .mpu_irqs = omap2420_mcbsp2_irqs, | ||
2122 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_irqs), | ||
2123 | .sdma_reqs = omap2420_mcbsp2_sdma_chs, | ||
2124 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_sdma_chs), | ||
2125 | .main_clk = "mcbsp2_fck", | ||
2126 | .prcm = { | ||
2127 | .omap2 = { | ||
2128 | .prcm_reg_id = 1, | ||
2129 | .module_bit = OMAP24XX_EN_MCBSP2_SHIFT, | ||
2130 | .module_offs = CORE_MOD, | ||
2131 | .idlest_reg_id = 1, | ||
2132 | .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT, | ||
2133 | }, | ||
2134 | }, | ||
2135 | .slaves = omap2420_mcbsp2_slaves, | ||
2136 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves), | ||
2137 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
2138 | }; | ||
2139 | |||
867 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { | 2140 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { |
868 | &omap2420_l3_main_hwmod, | 2141 | &omap2420_l3_main_hwmod, |
869 | &omap2420_l4_core_hwmod, | 2142 | &omap2420_l4_core_hwmod, |
870 | &omap2420_l4_wkup_hwmod, | 2143 | &omap2420_l4_wkup_hwmod, |
871 | &omap2420_mpu_hwmod, | 2144 | &omap2420_mpu_hwmod, |
872 | &omap2420_iva_hwmod, | 2145 | &omap2420_iva_hwmod, |
2146 | |||
2147 | &omap2420_timer1_hwmod, | ||
2148 | &omap2420_timer2_hwmod, | ||
2149 | &omap2420_timer3_hwmod, | ||
2150 | &omap2420_timer4_hwmod, | ||
2151 | &omap2420_timer5_hwmod, | ||
2152 | &omap2420_timer6_hwmod, | ||
2153 | &omap2420_timer7_hwmod, | ||
2154 | &omap2420_timer8_hwmod, | ||
2155 | &omap2420_timer9_hwmod, | ||
2156 | &omap2420_timer10_hwmod, | ||
2157 | &omap2420_timer11_hwmod, | ||
2158 | &omap2420_timer12_hwmod, | ||
2159 | |||
873 | &omap2420_wd_timer2_hwmod, | 2160 | &omap2420_wd_timer2_hwmod, |
874 | &omap2420_uart1_hwmod, | 2161 | &omap2420_uart1_hwmod, |
875 | &omap2420_uart2_hwmod, | 2162 | &omap2420_uart2_hwmod, |
876 | &omap2420_uart3_hwmod, | 2163 | &omap2420_uart3_hwmod, |
2164 | /* dss class */ | ||
2165 | &omap2420_dss_core_hwmod, | ||
2166 | &omap2420_dss_dispc_hwmod, | ||
2167 | &omap2420_dss_rfbi_hwmod, | ||
2168 | &omap2420_dss_venc_hwmod, | ||
2169 | /* i2c class */ | ||
877 | &omap2420_i2c1_hwmod, | 2170 | &omap2420_i2c1_hwmod, |
878 | &omap2420_i2c2_hwmod, | 2171 | &omap2420_i2c2_hwmod, |
879 | 2172 | ||
@@ -885,10 +2178,21 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = { | |||
885 | 2178 | ||
886 | /* dma_system class*/ | 2179 | /* dma_system class*/ |
887 | &omap2420_dma_system_hwmod, | 2180 | &omap2420_dma_system_hwmod, |
2181 | |||
2182 | /* mailbox class */ | ||
2183 | &omap2420_mailbox_hwmod, | ||
2184 | |||
2185 | /* mcbsp class */ | ||
2186 | &omap2420_mcbsp1_hwmod, | ||
2187 | &omap2420_mcbsp2_hwmod, | ||
2188 | |||
2189 | /* mcspi class */ | ||
2190 | &omap2420_mcspi1_hwmod, | ||
2191 | &omap2420_mcspi2_hwmod, | ||
888 | NULL, | 2192 | NULL, |
889 | }; | 2193 | }; |
890 | 2194 | ||
891 | int __init omap2420_hwmod_init(void) | 2195 | int __init omap2420_hwmod_init(void) |
892 | { | 2196 | { |
893 | return omap_hwmod_init(omap2420_hwmods); | 2197 | return omap_hwmod_register(omap2420_hwmods); |
894 | } | 2198 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 8ecfbcde13ba..0fdf2cabfb12 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -18,6 +18,11 @@ | |||
18 | #include <plat/serial.h> | 18 | #include <plat/serial.h> |
19 | #include <plat/i2c.h> | 19 | #include <plat/i2c.h> |
20 | #include <plat/gpio.h> | 20 | #include <plat/gpio.h> |
21 | #include <plat/mcbsp.h> | ||
22 | #include <plat/mcspi.h> | ||
23 | #include <plat/dmtimer.h> | ||
24 | #include <plat/mmc.h> | ||
25 | #include <plat/l3_2xxx.h> | ||
21 | 26 | ||
22 | #include "omap_hwmod_common_data.h" | 27 | #include "omap_hwmod_common_data.h" |
23 | 28 | ||
@@ -38,6 +43,10 @@ static struct omap_hwmod omap2430_mpu_hwmod; | |||
38 | static struct omap_hwmod omap2430_iva_hwmod; | 43 | static struct omap_hwmod omap2430_iva_hwmod; |
39 | static struct omap_hwmod omap2430_l3_main_hwmod; | 44 | static struct omap_hwmod omap2430_l3_main_hwmod; |
40 | static struct omap_hwmod omap2430_l4_core_hwmod; | 45 | static struct omap_hwmod omap2430_l4_core_hwmod; |
46 | static struct omap_hwmod omap2430_dss_core_hwmod; | ||
47 | static struct omap_hwmod omap2430_dss_dispc_hwmod; | ||
48 | static struct omap_hwmod omap2430_dss_rfbi_hwmod; | ||
49 | static struct omap_hwmod omap2430_dss_venc_hwmod; | ||
41 | static struct omap_hwmod omap2430_wd_timer2_hwmod; | 50 | static struct omap_hwmod omap2430_wd_timer2_hwmod; |
42 | static struct omap_hwmod omap2430_gpio1_hwmod; | 51 | static struct omap_hwmod omap2430_gpio1_hwmod; |
43 | static struct omap_hwmod omap2430_gpio2_hwmod; | 52 | static struct omap_hwmod omap2430_gpio2_hwmod; |
@@ -45,6 +54,16 @@ static struct omap_hwmod omap2430_gpio3_hwmod; | |||
45 | static struct omap_hwmod omap2430_gpio4_hwmod; | 54 | static struct omap_hwmod omap2430_gpio4_hwmod; |
46 | static struct omap_hwmod omap2430_gpio5_hwmod; | 55 | static struct omap_hwmod omap2430_gpio5_hwmod; |
47 | static struct omap_hwmod omap2430_dma_system_hwmod; | 56 | static struct omap_hwmod omap2430_dma_system_hwmod; |
57 | static struct omap_hwmod omap2430_mcbsp1_hwmod; | ||
58 | static struct omap_hwmod omap2430_mcbsp2_hwmod; | ||
59 | static struct omap_hwmod omap2430_mcbsp3_hwmod; | ||
60 | static struct omap_hwmod omap2430_mcbsp4_hwmod; | ||
61 | static struct omap_hwmod omap2430_mcbsp5_hwmod; | ||
62 | static struct omap_hwmod omap2430_mcspi1_hwmod; | ||
63 | static struct omap_hwmod omap2430_mcspi2_hwmod; | ||
64 | static struct omap_hwmod omap2430_mcspi3_hwmod; | ||
65 | static struct omap_hwmod omap2430_mmc1_hwmod; | ||
66 | static struct omap_hwmod omap2430_mmc2_hwmod; | ||
48 | 67 | ||
49 | /* L3 -> L4_CORE interface */ | 68 | /* L3 -> L4_CORE interface */ |
50 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { | 69 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { |
@@ -65,6 +84,19 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = { | |||
65 | &omap2430_mpu__l3_main, | 84 | &omap2430_mpu__l3_main, |
66 | }; | 85 | }; |
67 | 86 | ||
87 | /* DSS -> l3 */ | ||
88 | static struct omap_hwmod_ocp_if omap2430_dss__l3 = { | ||
89 | .master = &omap2430_dss_core_hwmod, | ||
90 | .slave = &omap2430_l3_main_hwmod, | ||
91 | .fw = { | ||
92 | .omap2 = { | ||
93 | .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS, | ||
94 | .flags = OMAP_FIREWALL_L3, | ||
95 | } | ||
96 | }, | ||
97 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
98 | }; | ||
99 | |||
68 | /* Master interfaces on the L3 interconnect */ | 100 | /* Master interfaces on the L3 interconnect */ |
69 | static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { | 101 | static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { |
70 | &omap2430_l3_main__l4_core, | 102 | &omap2430_l3_main__l4_core, |
@@ -89,6 +121,16 @@ static struct omap_hwmod omap2430_uart3_hwmod; | |||
89 | static struct omap_hwmod omap2430_i2c1_hwmod; | 121 | static struct omap_hwmod omap2430_i2c1_hwmod; |
90 | static struct omap_hwmod omap2430_i2c2_hwmod; | 122 | static struct omap_hwmod omap2430_i2c2_hwmod; |
91 | 123 | ||
124 | static struct omap_hwmod omap2430_usbhsotg_hwmod; | ||
125 | |||
126 | /* l3_core -> usbhsotg interface */ | ||
127 | static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = { | ||
128 | .master = &omap2430_usbhsotg_hwmod, | ||
129 | .slave = &omap2430_l3_main_hwmod, | ||
130 | .clk = "core_l3_ck", | ||
131 | .user = OCP_USER_MPU, | ||
132 | }; | ||
133 | |||
92 | /* I2C IP block address space length (in bytes) */ | 134 | /* I2C IP block address space length (in bytes) */ |
93 | #define OMAP2_I2C_AS_LEN 128 | 135 | #define OMAP2_I2C_AS_LEN 128 |
94 | 136 | ||
@@ -189,6 +231,71 @@ static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = { | |||
189 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 231 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
190 | }; | 232 | }; |
191 | 233 | ||
234 | /* | ||
235 | * usbhsotg interface data | ||
236 | */ | ||
237 | static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = { | ||
238 | { | ||
239 | .pa_start = OMAP243X_HS_BASE, | ||
240 | .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, | ||
241 | .flags = ADDR_TYPE_RT | ||
242 | }, | ||
243 | }; | ||
244 | |||
245 | /* l4_core ->usbhsotg interface */ | ||
246 | static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = { | ||
247 | .master = &omap2430_l4_core_hwmod, | ||
248 | .slave = &omap2430_usbhsotg_hwmod, | ||
249 | .clk = "usb_l4_ick", | ||
250 | .addr = omap2430_usbhsotg_addrs, | ||
251 | .addr_cnt = ARRAY_SIZE(omap2430_usbhsotg_addrs), | ||
252 | .user = OCP_USER_MPU, | ||
253 | }; | ||
254 | |||
255 | static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = { | ||
256 | &omap2430_usbhsotg__l3, | ||
257 | }; | ||
258 | |||
259 | static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = { | ||
260 | &omap2430_l4_core__usbhsotg, | ||
261 | }; | ||
262 | |||
263 | /* L4 CORE -> MMC1 interface */ | ||
264 | static struct omap_hwmod_addr_space omap2430_mmc1_addr_space[] = { | ||
265 | { | ||
266 | .pa_start = 0x4809c000, | ||
267 | .pa_end = 0x4809c1ff, | ||
268 | .flags = ADDR_TYPE_RT, | ||
269 | }, | ||
270 | }; | ||
271 | |||
272 | static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = { | ||
273 | .master = &omap2430_l4_core_hwmod, | ||
274 | .slave = &omap2430_mmc1_hwmod, | ||
275 | .clk = "mmchs1_ick", | ||
276 | .addr = omap2430_mmc1_addr_space, | ||
277 | .addr_cnt = ARRAY_SIZE(omap2430_mmc1_addr_space), | ||
278 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
279 | }; | ||
280 | |||
281 | /* L4 CORE -> MMC2 interface */ | ||
282 | static struct omap_hwmod_addr_space omap2430_mmc2_addr_space[] = { | ||
283 | { | ||
284 | .pa_start = 0x480b4000, | ||
285 | .pa_end = 0x480b41ff, | ||
286 | .flags = ADDR_TYPE_RT, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = { | ||
291 | .master = &omap2430_l4_core_hwmod, | ||
292 | .slave = &omap2430_mmc2_hwmod, | ||
293 | .addr = omap2430_mmc2_addr_space, | ||
294 | .clk = "mmchs2_ick", | ||
295 | .addr_cnt = ARRAY_SIZE(omap2430_mmc2_addr_space), | ||
296 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
297 | }; | ||
298 | |||
192 | /* Slave interfaces on the L4_CORE interconnect */ | 299 | /* Slave interfaces on the L4_CORE interconnect */ |
193 | static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { | 300 | static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { |
194 | &omap2430_l3_main__l4_core, | 301 | &omap2430_l3_main__l4_core, |
@@ -197,6 +304,8 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { | |||
197 | /* Master interfaces on the L4_CORE interconnect */ | 304 | /* Master interfaces on the L4_CORE interconnect */ |
198 | static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { | 305 | static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { |
199 | &omap2430_l4_core__l4_wkup, | 306 | &omap2430_l4_core__l4_wkup, |
307 | &omap2430_l4_core__mmc1, | ||
308 | &omap2430_l4_core__mmc2, | ||
200 | }; | 309 | }; |
201 | 310 | ||
202 | /* L4 CORE */ | 311 | /* L4 CORE */ |
@@ -223,6 +332,60 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = { | |||
223 | static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { | 332 | static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { |
224 | }; | 333 | }; |
225 | 334 | ||
335 | /* l4 core -> mcspi1 interface */ | ||
336 | static struct omap_hwmod_addr_space omap2430_mcspi1_addr_space[] = { | ||
337 | { | ||
338 | .pa_start = 0x48098000, | ||
339 | .pa_end = 0x480980ff, | ||
340 | .flags = ADDR_TYPE_RT, | ||
341 | }, | ||
342 | }; | ||
343 | |||
344 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi1 = { | ||
345 | .master = &omap2430_l4_core_hwmod, | ||
346 | .slave = &omap2430_mcspi1_hwmod, | ||
347 | .clk = "mcspi1_ick", | ||
348 | .addr = omap2430_mcspi1_addr_space, | ||
349 | .addr_cnt = ARRAY_SIZE(omap2430_mcspi1_addr_space), | ||
350 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
351 | }; | ||
352 | |||
353 | /* l4 core -> mcspi2 interface */ | ||
354 | static struct omap_hwmod_addr_space omap2430_mcspi2_addr_space[] = { | ||
355 | { | ||
356 | .pa_start = 0x4809a000, | ||
357 | .pa_end = 0x4809a0ff, | ||
358 | .flags = ADDR_TYPE_RT, | ||
359 | }, | ||
360 | }; | ||
361 | |||
362 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi2 = { | ||
363 | .master = &omap2430_l4_core_hwmod, | ||
364 | .slave = &omap2430_mcspi2_hwmod, | ||
365 | .clk = "mcspi2_ick", | ||
366 | .addr = omap2430_mcspi2_addr_space, | ||
367 | .addr_cnt = ARRAY_SIZE(omap2430_mcspi2_addr_space), | ||
368 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
369 | }; | ||
370 | |||
371 | /* l4 core -> mcspi3 interface */ | ||
372 | static struct omap_hwmod_addr_space omap2430_mcspi3_addr_space[] = { | ||
373 | { | ||
374 | .pa_start = 0x480b8000, | ||
375 | .pa_end = 0x480b80ff, | ||
376 | .flags = ADDR_TYPE_RT, | ||
377 | }, | ||
378 | }; | ||
379 | |||
380 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = { | ||
381 | .master = &omap2430_l4_core_hwmod, | ||
382 | .slave = &omap2430_mcspi3_hwmod, | ||
383 | .clk = "mcspi3_ick", | ||
384 | .addr = omap2430_mcspi3_addr_space, | ||
385 | .addr_cnt = ARRAY_SIZE(omap2430_mcspi3_addr_space), | ||
386 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
387 | }; | ||
388 | |||
226 | /* L4 WKUP */ | 389 | /* L4 WKUP */ |
227 | static struct omap_hwmod omap2430_l4_wkup_hwmod = { | 390 | static struct omap_hwmod omap2430_l4_wkup_hwmod = { |
228 | .name = "l4_wkup", | 391 | .name = "l4_wkup", |
@@ -278,6 +441,624 @@ static struct omap_hwmod omap2430_iva_hwmod = { | |||
278 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | 441 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) |
279 | }; | 442 | }; |
280 | 443 | ||
444 | /* Timer Common */ | ||
445 | static struct omap_hwmod_class_sysconfig omap2430_timer_sysc = { | ||
446 | .rev_offs = 0x0000, | ||
447 | .sysc_offs = 0x0010, | ||
448 | .syss_offs = 0x0014, | ||
449 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
450 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
451 | SYSC_HAS_AUTOIDLE), | ||
452 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
453 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
454 | }; | ||
455 | |||
456 | static struct omap_hwmod_class omap2430_timer_hwmod_class = { | ||
457 | .name = "timer", | ||
458 | .sysc = &omap2430_timer_sysc, | ||
459 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
460 | }; | ||
461 | |||
462 | /* timer1 */ | ||
463 | static struct omap_hwmod omap2430_timer1_hwmod; | ||
464 | static struct omap_hwmod_irq_info omap2430_timer1_mpu_irqs[] = { | ||
465 | { .irq = 37, }, | ||
466 | }; | ||
467 | |||
468 | static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = { | ||
469 | { | ||
470 | .pa_start = 0x49018000, | ||
471 | .pa_end = 0x49018000 + SZ_1K - 1, | ||
472 | .flags = ADDR_TYPE_RT | ||
473 | }, | ||
474 | }; | ||
475 | |||
476 | /* l4_wkup -> timer1 */ | ||
477 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = { | ||
478 | .master = &omap2430_l4_wkup_hwmod, | ||
479 | .slave = &omap2430_timer1_hwmod, | ||
480 | .clk = "gpt1_ick", | ||
481 | .addr = omap2430_timer1_addrs, | ||
482 | .addr_cnt = ARRAY_SIZE(omap2430_timer1_addrs), | ||
483 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
484 | }; | ||
485 | |||
486 | /* timer1 slave port */ | ||
487 | static struct omap_hwmod_ocp_if *omap2430_timer1_slaves[] = { | ||
488 | &omap2430_l4_wkup__timer1, | ||
489 | }; | ||
490 | |||
491 | /* timer1 hwmod */ | ||
492 | static struct omap_hwmod omap2430_timer1_hwmod = { | ||
493 | .name = "timer1", | ||
494 | .mpu_irqs = omap2430_timer1_mpu_irqs, | ||
495 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer1_mpu_irqs), | ||
496 | .main_clk = "gpt1_fck", | ||
497 | .prcm = { | ||
498 | .omap2 = { | ||
499 | .prcm_reg_id = 1, | ||
500 | .module_bit = OMAP24XX_EN_GPT1_SHIFT, | ||
501 | .module_offs = WKUP_MOD, | ||
502 | .idlest_reg_id = 1, | ||
503 | .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, | ||
504 | }, | ||
505 | }, | ||
506 | .slaves = omap2430_timer1_slaves, | ||
507 | .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves), | ||
508 | .class = &omap2430_timer_hwmod_class, | ||
509 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
510 | }; | ||
511 | |||
512 | /* timer2 */ | ||
513 | static struct omap_hwmod omap2430_timer2_hwmod; | ||
514 | static struct omap_hwmod_irq_info omap2430_timer2_mpu_irqs[] = { | ||
515 | { .irq = 38, }, | ||
516 | }; | ||
517 | |||
518 | static struct omap_hwmod_addr_space omap2430_timer2_addrs[] = { | ||
519 | { | ||
520 | .pa_start = 0x4802a000, | ||
521 | .pa_end = 0x4802a000 + SZ_1K - 1, | ||
522 | .flags = ADDR_TYPE_RT | ||
523 | }, | ||
524 | }; | ||
525 | |||
526 | /* l4_core -> timer2 */ | ||
527 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer2 = { | ||
528 | .master = &omap2430_l4_core_hwmod, | ||
529 | .slave = &omap2430_timer2_hwmod, | ||
530 | .clk = "gpt2_ick", | ||
531 | .addr = omap2430_timer2_addrs, | ||
532 | .addr_cnt = ARRAY_SIZE(omap2430_timer2_addrs), | ||
533 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
534 | }; | ||
535 | |||
536 | /* timer2 slave port */ | ||
537 | static struct omap_hwmod_ocp_if *omap2430_timer2_slaves[] = { | ||
538 | &omap2430_l4_core__timer2, | ||
539 | }; | ||
540 | |||
541 | /* timer2 hwmod */ | ||
542 | static struct omap_hwmod omap2430_timer2_hwmod = { | ||
543 | .name = "timer2", | ||
544 | .mpu_irqs = omap2430_timer2_mpu_irqs, | ||
545 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer2_mpu_irqs), | ||
546 | .main_clk = "gpt2_fck", | ||
547 | .prcm = { | ||
548 | .omap2 = { | ||
549 | .prcm_reg_id = 1, | ||
550 | .module_bit = OMAP24XX_EN_GPT2_SHIFT, | ||
551 | .module_offs = CORE_MOD, | ||
552 | .idlest_reg_id = 1, | ||
553 | .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, | ||
554 | }, | ||
555 | }, | ||
556 | .slaves = omap2430_timer2_slaves, | ||
557 | .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves), | ||
558 | .class = &omap2430_timer_hwmod_class, | ||
559 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
560 | }; | ||
561 | |||
562 | /* timer3 */ | ||
563 | static struct omap_hwmod omap2430_timer3_hwmod; | ||
564 | static struct omap_hwmod_irq_info omap2430_timer3_mpu_irqs[] = { | ||
565 | { .irq = 39, }, | ||
566 | }; | ||
567 | |||
568 | static struct omap_hwmod_addr_space omap2430_timer3_addrs[] = { | ||
569 | { | ||
570 | .pa_start = 0x48078000, | ||
571 | .pa_end = 0x48078000 + SZ_1K - 1, | ||
572 | .flags = ADDR_TYPE_RT | ||
573 | }, | ||
574 | }; | ||
575 | |||
576 | /* l4_core -> timer3 */ | ||
577 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer3 = { | ||
578 | .master = &omap2430_l4_core_hwmod, | ||
579 | .slave = &omap2430_timer3_hwmod, | ||
580 | .clk = "gpt3_ick", | ||
581 | .addr = omap2430_timer3_addrs, | ||
582 | .addr_cnt = ARRAY_SIZE(omap2430_timer3_addrs), | ||
583 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
584 | }; | ||
585 | |||
586 | /* timer3 slave port */ | ||
587 | static struct omap_hwmod_ocp_if *omap2430_timer3_slaves[] = { | ||
588 | &omap2430_l4_core__timer3, | ||
589 | }; | ||
590 | |||
591 | /* timer3 hwmod */ | ||
592 | static struct omap_hwmod omap2430_timer3_hwmod = { | ||
593 | .name = "timer3", | ||
594 | .mpu_irqs = omap2430_timer3_mpu_irqs, | ||
595 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer3_mpu_irqs), | ||
596 | .main_clk = "gpt3_fck", | ||
597 | .prcm = { | ||
598 | .omap2 = { | ||
599 | .prcm_reg_id = 1, | ||
600 | .module_bit = OMAP24XX_EN_GPT3_SHIFT, | ||
601 | .module_offs = CORE_MOD, | ||
602 | .idlest_reg_id = 1, | ||
603 | .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, | ||
604 | }, | ||
605 | }, | ||
606 | .slaves = omap2430_timer3_slaves, | ||
607 | .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves), | ||
608 | .class = &omap2430_timer_hwmod_class, | ||
609 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
610 | }; | ||
611 | |||
612 | /* timer4 */ | ||
613 | static struct omap_hwmod omap2430_timer4_hwmod; | ||
614 | static struct omap_hwmod_irq_info omap2430_timer4_mpu_irqs[] = { | ||
615 | { .irq = 40, }, | ||
616 | }; | ||
617 | |||
618 | static struct omap_hwmod_addr_space omap2430_timer4_addrs[] = { | ||
619 | { | ||
620 | .pa_start = 0x4807a000, | ||
621 | .pa_end = 0x4807a000 + SZ_1K - 1, | ||
622 | .flags = ADDR_TYPE_RT | ||
623 | }, | ||
624 | }; | ||
625 | |||
626 | /* l4_core -> timer4 */ | ||
627 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer4 = { | ||
628 | .master = &omap2430_l4_core_hwmod, | ||
629 | .slave = &omap2430_timer4_hwmod, | ||
630 | .clk = "gpt4_ick", | ||
631 | .addr = omap2430_timer4_addrs, | ||
632 | .addr_cnt = ARRAY_SIZE(omap2430_timer4_addrs), | ||
633 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
634 | }; | ||
635 | |||
636 | /* timer4 slave port */ | ||
637 | static struct omap_hwmod_ocp_if *omap2430_timer4_slaves[] = { | ||
638 | &omap2430_l4_core__timer4, | ||
639 | }; | ||
640 | |||
641 | /* timer4 hwmod */ | ||
642 | static struct omap_hwmod omap2430_timer4_hwmod = { | ||
643 | .name = "timer4", | ||
644 | .mpu_irqs = omap2430_timer4_mpu_irqs, | ||
645 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer4_mpu_irqs), | ||
646 | .main_clk = "gpt4_fck", | ||
647 | .prcm = { | ||
648 | .omap2 = { | ||
649 | .prcm_reg_id = 1, | ||
650 | .module_bit = OMAP24XX_EN_GPT4_SHIFT, | ||
651 | .module_offs = CORE_MOD, | ||
652 | .idlest_reg_id = 1, | ||
653 | .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, | ||
654 | }, | ||
655 | }, | ||
656 | .slaves = omap2430_timer4_slaves, | ||
657 | .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves), | ||
658 | .class = &omap2430_timer_hwmod_class, | ||
659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
660 | }; | ||
661 | |||
662 | /* timer5 */ | ||
663 | static struct omap_hwmod omap2430_timer5_hwmod; | ||
664 | static struct omap_hwmod_irq_info omap2430_timer5_mpu_irqs[] = { | ||
665 | { .irq = 41, }, | ||
666 | }; | ||
667 | |||
668 | static struct omap_hwmod_addr_space omap2430_timer5_addrs[] = { | ||
669 | { | ||
670 | .pa_start = 0x4807c000, | ||
671 | .pa_end = 0x4807c000 + SZ_1K - 1, | ||
672 | .flags = ADDR_TYPE_RT | ||
673 | }, | ||
674 | }; | ||
675 | |||
676 | /* l4_core -> timer5 */ | ||
677 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer5 = { | ||
678 | .master = &omap2430_l4_core_hwmod, | ||
679 | .slave = &omap2430_timer5_hwmod, | ||
680 | .clk = "gpt5_ick", | ||
681 | .addr = omap2430_timer5_addrs, | ||
682 | .addr_cnt = ARRAY_SIZE(omap2430_timer5_addrs), | ||
683 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
684 | }; | ||
685 | |||
686 | /* timer5 slave port */ | ||
687 | static struct omap_hwmod_ocp_if *omap2430_timer5_slaves[] = { | ||
688 | &omap2430_l4_core__timer5, | ||
689 | }; | ||
690 | |||
691 | /* timer5 hwmod */ | ||
692 | static struct omap_hwmod omap2430_timer5_hwmod = { | ||
693 | .name = "timer5", | ||
694 | .mpu_irqs = omap2430_timer5_mpu_irqs, | ||
695 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer5_mpu_irqs), | ||
696 | .main_clk = "gpt5_fck", | ||
697 | .prcm = { | ||
698 | .omap2 = { | ||
699 | .prcm_reg_id = 1, | ||
700 | .module_bit = OMAP24XX_EN_GPT5_SHIFT, | ||
701 | .module_offs = CORE_MOD, | ||
702 | .idlest_reg_id = 1, | ||
703 | .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, | ||
704 | }, | ||
705 | }, | ||
706 | .slaves = omap2430_timer5_slaves, | ||
707 | .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves), | ||
708 | .class = &omap2430_timer_hwmod_class, | ||
709 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
710 | }; | ||
711 | |||
712 | /* timer6 */ | ||
713 | static struct omap_hwmod omap2430_timer6_hwmod; | ||
714 | static struct omap_hwmod_irq_info omap2430_timer6_mpu_irqs[] = { | ||
715 | { .irq = 42, }, | ||
716 | }; | ||
717 | |||
718 | static struct omap_hwmod_addr_space omap2430_timer6_addrs[] = { | ||
719 | { | ||
720 | .pa_start = 0x4807e000, | ||
721 | .pa_end = 0x4807e000 + SZ_1K - 1, | ||
722 | .flags = ADDR_TYPE_RT | ||
723 | }, | ||
724 | }; | ||
725 | |||
726 | /* l4_core -> timer6 */ | ||
727 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer6 = { | ||
728 | .master = &omap2430_l4_core_hwmod, | ||
729 | .slave = &omap2430_timer6_hwmod, | ||
730 | .clk = "gpt6_ick", | ||
731 | .addr = omap2430_timer6_addrs, | ||
732 | .addr_cnt = ARRAY_SIZE(omap2430_timer6_addrs), | ||
733 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
734 | }; | ||
735 | |||
736 | /* timer6 slave port */ | ||
737 | static struct omap_hwmod_ocp_if *omap2430_timer6_slaves[] = { | ||
738 | &omap2430_l4_core__timer6, | ||
739 | }; | ||
740 | |||
741 | /* timer6 hwmod */ | ||
742 | static struct omap_hwmod omap2430_timer6_hwmod = { | ||
743 | .name = "timer6", | ||
744 | .mpu_irqs = omap2430_timer6_mpu_irqs, | ||
745 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer6_mpu_irqs), | ||
746 | .main_clk = "gpt6_fck", | ||
747 | .prcm = { | ||
748 | .omap2 = { | ||
749 | .prcm_reg_id = 1, | ||
750 | .module_bit = OMAP24XX_EN_GPT6_SHIFT, | ||
751 | .module_offs = CORE_MOD, | ||
752 | .idlest_reg_id = 1, | ||
753 | .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, | ||
754 | }, | ||
755 | }, | ||
756 | .slaves = omap2430_timer6_slaves, | ||
757 | .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves), | ||
758 | .class = &omap2430_timer_hwmod_class, | ||
759 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
760 | }; | ||
761 | |||
762 | /* timer7 */ | ||
763 | static struct omap_hwmod omap2430_timer7_hwmod; | ||
764 | static struct omap_hwmod_irq_info omap2430_timer7_mpu_irqs[] = { | ||
765 | { .irq = 43, }, | ||
766 | }; | ||
767 | |||
768 | static struct omap_hwmod_addr_space omap2430_timer7_addrs[] = { | ||
769 | { | ||
770 | .pa_start = 0x48080000, | ||
771 | .pa_end = 0x48080000 + SZ_1K - 1, | ||
772 | .flags = ADDR_TYPE_RT | ||
773 | }, | ||
774 | }; | ||
775 | |||
776 | /* l4_core -> timer7 */ | ||
777 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer7 = { | ||
778 | .master = &omap2430_l4_core_hwmod, | ||
779 | .slave = &omap2430_timer7_hwmod, | ||
780 | .clk = "gpt7_ick", | ||
781 | .addr = omap2430_timer7_addrs, | ||
782 | .addr_cnt = ARRAY_SIZE(omap2430_timer7_addrs), | ||
783 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
784 | }; | ||
785 | |||
786 | /* timer7 slave port */ | ||
787 | static struct omap_hwmod_ocp_if *omap2430_timer7_slaves[] = { | ||
788 | &omap2430_l4_core__timer7, | ||
789 | }; | ||
790 | |||
791 | /* timer7 hwmod */ | ||
792 | static struct omap_hwmod omap2430_timer7_hwmod = { | ||
793 | .name = "timer7", | ||
794 | .mpu_irqs = omap2430_timer7_mpu_irqs, | ||
795 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer7_mpu_irqs), | ||
796 | .main_clk = "gpt7_fck", | ||
797 | .prcm = { | ||
798 | .omap2 = { | ||
799 | .prcm_reg_id = 1, | ||
800 | .module_bit = OMAP24XX_EN_GPT7_SHIFT, | ||
801 | .module_offs = CORE_MOD, | ||
802 | .idlest_reg_id = 1, | ||
803 | .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, | ||
804 | }, | ||
805 | }, | ||
806 | .slaves = omap2430_timer7_slaves, | ||
807 | .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves), | ||
808 | .class = &omap2430_timer_hwmod_class, | ||
809 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
810 | }; | ||
811 | |||
812 | /* timer8 */ | ||
813 | static struct omap_hwmod omap2430_timer8_hwmod; | ||
814 | static struct omap_hwmod_irq_info omap2430_timer8_mpu_irqs[] = { | ||
815 | { .irq = 44, }, | ||
816 | }; | ||
817 | |||
818 | static struct omap_hwmod_addr_space omap2430_timer8_addrs[] = { | ||
819 | { | ||
820 | .pa_start = 0x48082000, | ||
821 | .pa_end = 0x48082000 + SZ_1K - 1, | ||
822 | .flags = ADDR_TYPE_RT | ||
823 | }, | ||
824 | }; | ||
825 | |||
826 | /* l4_core -> timer8 */ | ||
827 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer8 = { | ||
828 | .master = &omap2430_l4_core_hwmod, | ||
829 | .slave = &omap2430_timer8_hwmod, | ||
830 | .clk = "gpt8_ick", | ||
831 | .addr = omap2430_timer8_addrs, | ||
832 | .addr_cnt = ARRAY_SIZE(omap2430_timer8_addrs), | ||
833 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
834 | }; | ||
835 | |||
836 | /* timer8 slave port */ | ||
837 | static struct omap_hwmod_ocp_if *omap2430_timer8_slaves[] = { | ||
838 | &omap2430_l4_core__timer8, | ||
839 | }; | ||
840 | |||
841 | /* timer8 hwmod */ | ||
842 | static struct omap_hwmod omap2430_timer8_hwmod = { | ||
843 | .name = "timer8", | ||
844 | .mpu_irqs = omap2430_timer8_mpu_irqs, | ||
845 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer8_mpu_irqs), | ||
846 | .main_clk = "gpt8_fck", | ||
847 | .prcm = { | ||
848 | .omap2 = { | ||
849 | .prcm_reg_id = 1, | ||
850 | .module_bit = OMAP24XX_EN_GPT8_SHIFT, | ||
851 | .module_offs = CORE_MOD, | ||
852 | .idlest_reg_id = 1, | ||
853 | .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, | ||
854 | }, | ||
855 | }, | ||
856 | .slaves = omap2430_timer8_slaves, | ||
857 | .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves), | ||
858 | .class = &omap2430_timer_hwmod_class, | ||
859 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
860 | }; | ||
861 | |||
862 | /* timer9 */ | ||
863 | static struct omap_hwmod omap2430_timer9_hwmod; | ||
864 | static struct omap_hwmod_irq_info omap2430_timer9_mpu_irqs[] = { | ||
865 | { .irq = 45, }, | ||
866 | }; | ||
867 | |||
868 | static struct omap_hwmod_addr_space omap2430_timer9_addrs[] = { | ||
869 | { | ||
870 | .pa_start = 0x48084000, | ||
871 | .pa_end = 0x48084000 + SZ_1K - 1, | ||
872 | .flags = ADDR_TYPE_RT | ||
873 | }, | ||
874 | }; | ||
875 | |||
876 | /* l4_core -> timer9 */ | ||
877 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer9 = { | ||
878 | .master = &omap2430_l4_core_hwmod, | ||
879 | .slave = &omap2430_timer9_hwmod, | ||
880 | .clk = "gpt9_ick", | ||
881 | .addr = omap2430_timer9_addrs, | ||
882 | .addr_cnt = ARRAY_SIZE(omap2430_timer9_addrs), | ||
883 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
884 | }; | ||
885 | |||
886 | /* timer9 slave port */ | ||
887 | static struct omap_hwmod_ocp_if *omap2430_timer9_slaves[] = { | ||
888 | &omap2430_l4_core__timer9, | ||
889 | }; | ||
890 | |||
891 | /* timer9 hwmod */ | ||
892 | static struct omap_hwmod omap2430_timer9_hwmod = { | ||
893 | .name = "timer9", | ||
894 | .mpu_irqs = omap2430_timer9_mpu_irqs, | ||
895 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer9_mpu_irqs), | ||
896 | .main_clk = "gpt9_fck", | ||
897 | .prcm = { | ||
898 | .omap2 = { | ||
899 | .prcm_reg_id = 1, | ||
900 | .module_bit = OMAP24XX_EN_GPT9_SHIFT, | ||
901 | .module_offs = CORE_MOD, | ||
902 | .idlest_reg_id = 1, | ||
903 | .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, | ||
904 | }, | ||
905 | }, | ||
906 | .slaves = omap2430_timer9_slaves, | ||
907 | .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves), | ||
908 | .class = &omap2430_timer_hwmod_class, | ||
909 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
910 | }; | ||
911 | |||
912 | /* timer10 */ | ||
913 | static struct omap_hwmod omap2430_timer10_hwmod; | ||
914 | static struct omap_hwmod_irq_info omap2430_timer10_mpu_irqs[] = { | ||
915 | { .irq = 46, }, | ||
916 | }; | ||
917 | |||
918 | static struct omap_hwmod_addr_space omap2430_timer10_addrs[] = { | ||
919 | { | ||
920 | .pa_start = 0x48086000, | ||
921 | .pa_end = 0x48086000 + SZ_1K - 1, | ||
922 | .flags = ADDR_TYPE_RT | ||
923 | }, | ||
924 | }; | ||
925 | |||
926 | /* l4_core -> timer10 */ | ||
927 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer10 = { | ||
928 | .master = &omap2430_l4_core_hwmod, | ||
929 | .slave = &omap2430_timer10_hwmod, | ||
930 | .clk = "gpt10_ick", | ||
931 | .addr = omap2430_timer10_addrs, | ||
932 | .addr_cnt = ARRAY_SIZE(omap2430_timer10_addrs), | ||
933 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
934 | }; | ||
935 | |||
936 | /* timer10 slave port */ | ||
937 | static struct omap_hwmod_ocp_if *omap2430_timer10_slaves[] = { | ||
938 | &omap2430_l4_core__timer10, | ||
939 | }; | ||
940 | |||
941 | /* timer10 hwmod */ | ||
942 | static struct omap_hwmod omap2430_timer10_hwmod = { | ||
943 | .name = "timer10", | ||
944 | .mpu_irqs = omap2430_timer10_mpu_irqs, | ||
945 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer10_mpu_irqs), | ||
946 | .main_clk = "gpt10_fck", | ||
947 | .prcm = { | ||
948 | .omap2 = { | ||
949 | .prcm_reg_id = 1, | ||
950 | .module_bit = OMAP24XX_EN_GPT10_SHIFT, | ||
951 | .module_offs = CORE_MOD, | ||
952 | .idlest_reg_id = 1, | ||
953 | .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, | ||
954 | }, | ||
955 | }, | ||
956 | .slaves = omap2430_timer10_slaves, | ||
957 | .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves), | ||
958 | .class = &omap2430_timer_hwmod_class, | ||
959 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
960 | }; | ||
961 | |||
962 | /* timer11 */ | ||
963 | static struct omap_hwmod omap2430_timer11_hwmod; | ||
964 | static struct omap_hwmod_irq_info omap2430_timer11_mpu_irqs[] = { | ||
965 | { .irq = 47, }, | ||
966 | }; | ||
967 | |||
968 | static struct omap_hwmod_addr_space omap2430_timer11_addrs[] = { | ||
969 | { | ||
970 | .pa_start = 0x48088000, | ||
971 | .pa_end = 0x48088000 + SZ_1K - 1, | ||
972 | .flags = ADDR_TYPE_RT | ||
973 | }, | ||
974 | }; | ||
975 | |||
976 | /* l4_core -> timer11 */ | ||
977 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer11 = { | ||
978 | .master = &omap2430_l4_core_hwmod, | ||
979 | .slave = &omap2430_timer11_hwmod, | ||
980 | .clk = "gpt11_ick", | ||
981 | .addr = omap2430_timer11_addrs, | ||
982 | .addr_cnt = ARRAY_SIZE(omap2430_timer11_addrs), | ||
983 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
984 | }; | ||
985 | |||
986 | /* timer11 slave port */ | ||
987 | static struct omap_hwmod_ocp_if *omap2430_timer11_slaves[] = { | ||
988 | &omap2430_l4_core__timer11, | ||
989 | }; | ||
990 | |||
991 | /* timer11 hwmod */ | ||
992 | static struct omap_hwmod omap2430_timer11_hwmod = { | ||
993 | .name = "timer11", | ||
994 | .mpu_irqs = omap2430_timer11_mpu_irqs, | ||
995 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer11_mpu_irqs), | ||
996 | .main_clk = "gpt11_fck", | ||
997 | .prcm = { | ||
998 | .omap2 = { | ||
999 | .prcm_reg_id = 1, | ||
1000 | .module_bit = OMAP24XX_EN_GPT11_SHIFT, | ||
1001 | .module_offs = CORE_MOD, | ||
1002 | .idlest_reg_id = 1, | ||
1003 | .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, | ||
1004 | }, | ||
1005 | }, | ||
1006 | .slaves = omap2430_timer11_slaves, | ||
1007 | .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves), | ||
1008 | .class = &omap2430_timer_hwmod_class, | ||
1009 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
1010 | }; | ||
1011 | |||
1012 | /* timer12 */ | ||
1013 | static struct omap_hwmod omap2430_timer12_hwmod; | ||
1014 | static struct omap_hwmod_irq_info omap2430_timer12_mpu_irqs[] = { | ||
1015 | { .irq = 48, }, | ||
1016 | }; | ||
1017 | |||
1018 | static struct omap_hwmod_addr_space omap2430_timer12_addrs[] = { | ||
1019 | { | ||
1020 | .pa_start = 0x4808a000, | ||
1021 | .pa_end = 0x4808a000 + SZ_1K - 1, | ||
1022 | .flags = ADDR_TYPE_RT | ||
1023 | }, | ||
1024 | }; | ||
1025 | |||
1026 | /* l4_core -> timer12 */ | ||
1027 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer12 = { | ||
1028 | .master = &omap2430_l4_core_hwmod, | ||
1029 | .slave = &omap2430_timer12_hwmod, | ||
1030 | .clk = "gpt12_ick", | ||
1031 | .addr = omap2430_timer12_addrs, | ||
1032 | .addr_cnt = ARRAY_SIZE(omap2430_timer12_addrs), | ||
1033 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1034 | }; | ||
1035 | |||
1036 | /* timer12 slave port */ | ||
1037 | static struct omap_hwmod_ocp_if *omap2430_timer12_slaves[] = { | ||
1038 | &omap2430_l4_core__timer12, | ||
1039 | }; | ||
1040 | |||
1041 | /* timer12 hwmod */ | ||
1042 | static struct omap_hwmod omap2430_timer12_hwmod = { | ||
1043 | .name = "timer12", | ||
1044 | .mpu_irqs = omap2430_timer12_mpu_irqs, | ||
1045 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer12_mpu_irqs), | ||
1046 | .main_clk = "gpt12_fck", | ||
1047 | .prcm = { | ||
1048 | .omap2 = { | ||
1049 | .prcm_reg_id = 1, | ||
1050 | .module_bit = OMAP24XX_EN_GPT12_SHIFT, | ||
1051 | .module_offs = CORE_MOD, | ||
1052 | .idlest_reg_id = 1, | ||
1053 | .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, | ||
1054 | }, | ||
1055 | }, | ||
1056 | .slaves = omap2430_timer12_slaves, | ||
1057 | .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves), | ||
1058 | .class = &omap2430_timer_hwmod_class, | ||
1059 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
1060 | }; | ||
1061 | |||
281 | /* l4_wkup -> wd_timer2 */ | 1062 | /* l4_wkup -> wd_timer2 */ |
282 | static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { | 1063 | static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { |
283 | { | 1064 | { |
@@ -307,7 +1088,7 @@ static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = { | |||
307 | .sysc_offs = 0x0010, | 1088 | .sysc_offs = 0x0010, |
308 | .syss_offs = 0x0014, | 1089 | .syss_offs = 0x0014, |
309 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET | | 1090 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET | |
310 | SYSC_HAS_AUTOIDLE), | 1091 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
311 | .sysc_fields = &omap_hwmod_sysc_type1, | 1092 | .sysc_fields = &omap_hwmod_sysc_type1, |
312 | }; | 1093 | }; |
313 | 1094 | ||
@@ -348,7 +1129,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = { | |||
348 | .syss_offs = 0x58, | 1129 | .syss_offs = 0x58, |
349 | .sysc_flags = (SYSC_HAS_SIDLEMODE | | 1130 | .sysc_flags = (SYSC_HAS_SIDLEMODE | |
350 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | 1131 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | |
351 | SYSC_HAS_AUTOIDLE), | 1132 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
352 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1133 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
353 | .sysc_fields = &omap_hwmod_sysc_type1, | 1134 | .sysc_fields = &omap_hwmod_sysc_type1, |
354 | }; | 1135 | }; |
@@ -469,12 +1250,274 @@ static struct omap_hwmod omap2430_uart3_hwmod = { | |||
469 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 1250 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
470 | }; | 1251 | }; |
471 | 1252 | ||
1253 | /* | ||
1254 | * 'dss' class | ||
1255 | * display sub-system | ||
1256 | */ | ||
1257 | |||
1258 | static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = { | ||
1259 | .rev_offs = 0x0000, | ||
1260 | .sysc_offs = 0x0010, | ||
1261 | .syss_offs = 0x0014, | ||
1262 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1263 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1264 | }; | ||
1265 | |||
1266 | static struct omap_hwmod_class omap2430_dss_hwmod_class = { | ||
1267 | .name = "dss", | ||
1268 | .sysc = &omap2430_dss_sysc, | ||
1269 | }; | ||
1270 | |||
1271 | /* dss */ | ||
1272 | static struct omap_hwmod_irq_info omap2430_dss_irqs[] = { | ||
1273 | { .irq = 25 }, | ||
1274 | }; | ||
1275 | static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = { | ||
1276 | { .name = "dispc", .dma_req = 5 }, | ||
1277 | }; | ||
1278 | |||
1279 | /* dss */ | ||
1280 | /* dss master ports */ | ||
1281 | static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = { | ||
1282 | &omap2430_dss__l3, | ||
1283 | }; | ||
1284 | |||
1285 | static struct omap_hwmod_addr_space omap2430_dss_addrs[] = { | ||
1286 | { | ||
1287 | .pa_start = 0x48050000, | ||
1288 | .pa_end = 0x480503FF, | ||
1289 | .flags = ADDR_TYPE_RT | ||
1290 | }, | ||
1291 | }; | ||
1292 | |||
1293 | /* l4_core -> dss */ | ||
1294 | static struct omap_hwmod_ocp_if omap2430_l4_core__dss = { | ||
1295 | .master = &omap2430_l4_core_hwmod, | ||
1296 | .slave = &omap2430_dss_core_hwmod, | ||
1297 | .clk = "dss_ick", | ||
1298 | .addr = omap2430_dss_addrs, | ||
1299 | .addr_cnt = ARRAY_SIZE(omap2430_dss_addrs), | ||
1300 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1301 | }; | ||
1302 | |||
1303 | /* dss slave ports */ | ||
1304 | static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = { | ||
1305 | &omap2430_l4_core__dss, | ||
1306 | }; | ||
1307 | |||
1308 | static struct omap_hwmod_opt_clk dss_opt_clks[] = { | ||
1309 | { .role = "tv_clk", .clk = "dss_54m_fck" }, | ||
1310 | { .role = "sys_clk", .clk = "dss2_fck" }, | ||
1311 | }; | ||
1312 | |||
1313 | static struct omap_hwmod omap2430_dss_core_hwmod = { | ||
1314 | .name = "dss_core", | ||
1315 | .class = &omap2430_dss_hwmod_class, | ||
1316 | .main_clk = "dss1_fck", /* instead of dss_fck */ | ||
1317 | .mpu_irqs = omap2430_dss_irqs, | ||
1318 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_dss_irqs), | ||
1319 | .sdma_reqs = omap2430_dss_sdma_chs, | ||
1320 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_dss_sdma_chs), | ||
1321 | .prcm = { | ||
1322 | .omap2 = { | ||
1323 | .prcm_reg_id = 1, | ||
1324 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1325 | .module_offs = CORE_MOD, | ||
1326 | .idlest_reg_id = 1, | ||
1327 | .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT, | ||
1328 | }, | ||
1329 | }, | ||
1330 | .opt_clks = dss_opt_clks, | ||
1331 | .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks), | ||
1332 | .slaves = omap2430_dss_slaves, | ||
1333 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves), | ||
1334 | .masters = omap2430_dss_masters, | ||
1335 | .masters_cnt = ARRAY_SIZE(omap2430_dss_masters), | ||
1336 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1337 | .flags = HWMOD_NO_IDLEST, | ||
1338 | }; | ||
1339 | |||
1340 | /* | ||
1341 | * 'dispc' class | ||
1342 | * display controller | ||
1343 | */ | ||
1344 | |||
1345 | static struct omap_hwmod_class_sysconfig omap2430_dispc_sysc = { | ||
1346 | .rev_offs = 0x0000, | ||
1347 | .sysc_offs = 0x0010, | ||
1348 | .syss_offs = 0x0014, | ||
1349 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE | | ||
1350 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1351 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
1352 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
1353 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1354 | }; | ||
1355 | |||
1356 | static struct omap_hwmod_class omap2430_dispc_hwmod_class = { | ||
1357 | .name = "dispc", | ||
1358 | .sysc = &omap2430_dispc_sysc, | ||
1359 | }; | ||
1360 | |||
1361 | static struct omap_hwmod_addr_space omap2430_dss_dispc_addrs[] = { | ||
1362 | { | ||
1363 | .pa_start = 0x48050400, | ||
1364 | .pa_end = 0x480507FF, | ||
1365 | .flags = ADDR_TYPE_RT | ||
1366 | }, | ||
1367 | }; | ||
1368 | |||
1369 | /* l4_core -> dss_dispc */ | ||
1370 | static struct omap_hwmod_ocp_if omap2430_l4_core__dss_dispc = { | ||
1371 | .master = &omap2430_l4_core_hwmod, | ||
1372 | .slave = &omap2430_dss_dispc_hwmod, | ||
1373 | .clk = "dss_ick", | ||
1374 | .addr = omap2430_dss_dispc_addrs, | ||
1375 | .addr_cnt = ARRAY_SIZE(omap2430_dss_dispc_addrs), | ||
1376 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1377 | }; | ||
1378 | |||
1379 | /* dss_dispc slave ports */ | ||
1380 | static struct omap_hwmod_ocp_if *omap2430_dss_dispc_slaves[] = { | ||
1381 | &omap2430_l4_core__dss_dispc, | ||
1382 | }; | ||
1383 | |||
1384 | static struct omap_hwmod omap2430_dss_dispc_hwmod = { | ||
1385 | .name = "dss_dispc", | ||
1386 | .class = &omap2430_dispc_hwmod_class, | ||
1387 | .main_clk = "dss1_fck", | ||
1388 | .prcm = { | ||
1389 | .omap2 = { | ||
1390 | .prcm_reg_id = 1, | ||
1391 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1392 | .module_offs = CORE_MOD, | ||
1393 | .idlest_reg_id = 1, | ||
1394 | .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT, | ||
1395 | }, | ||
1396 | }, | ||
1397 | .slaves = omap2430_dss_dispc_slaves, | ||
1398 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves), | ||
1399 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1400 | .flags = HWMOD_NO_IDLEST, | ||
1401 | }; | ||
1402 | |||
1403 | /* | ||
1404 | * 'rfbi' class | ||
1405 | * remote frame buffer interface | ||
1406 | */ | ||
1407 | |||
1408 | static struct omap_hwmod_class_sysconfig omap2430_rfbi_sysc = { | ||
1409 | .rev_offs = 0x0000, | ||
1410 | .sysc_offs = 0x0010, | ||
1411 | .syss_offs = 0x0014, | ||
1412 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | ||
1413 | SYSC_HAS_AUTOIDLE), | ||
1414 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1415 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1416 | }; | ||
1417 | |||
1418 | static struct omap_hwmod_class omap2430_rfbi_hwmod_class = { | ||
1419 | .name = "rfbi", | ||
1420 | .sysc = &omap2430_rfbi_sysc, | ||
1421 | }; | ||
1422 | |||
1423 | static struct omap_hwmod_addr_space omap2430_dss_rfbi_addrs[] = { | ||
1424 | { | ||
1425 | .pa_start = 0x48050800, | ||
1426 | .pa_end = 0x48050BFF, | ||
1427 | .flags = ADDR_TYPE_RT | ||
1428 | }, | ||
1429 | }; | ||
1430 | |||
1431 | /* l4_core -> dss_rfbi */ | ||
1432 | static struct omap_hwmod_ocp_if omap2430_l4_core__dss_rfbi = { | ||
1433 | .master = &omap2430_l4_core_hwmod, | ||
1434 | .slave = &omap2430_dss_rfbi_hwmod, | ||
1435 | .clk = "dss_ick", | ||
1436 | .addr = omap2430_dss_rfbi_addrs, | ||
1437 | .addr_cnt = ARRAY_SIZE(omap2430_dss_rfbi_addrs), | ||
1438 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1439 | }; | ||
1440 | |||
1441 | /* dss_rfbi slave ports */ | ||
1442 | static struct omap_hwmod_ocp_if *omap2430_dss_rfbi_slaves[] = { | ||
1443 | &omap2430_l4_core__dss_rfbi, | ||
1444 | }; | ||
1445 | |||
1446 | static struct omap_hwmod omap2430_dss_rfbi_hwmod = { | ||
1447 | .name = "dss_rfbi", | ||
1448 | .class = &omap2430_rfbi_hwmod_class, | ||
1449 | .main_clk = "dss1_fck", | ||
1450 | .prcm = { | ||
1451 | .omap2 = { | ||
1452 | .prcm_reg_id = 1, | ||
1453 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1454 | .module_offs = CORE_MOD, | ||
1455 | }, | ||
1456 | }, | ||
1457 | .slaves = omap2430_dss_rfbi_slaves, | ||
1458 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves), | ||
1459 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1460 | .flags = HWMOD_NO_IDLEST, | ||
1461 | }; | ||
1462 | |||
1463 | /* | ||
1464 | * 'venc' class | ||
1465 | * video encoder | ||
1466 | */ | ||
1467 | |||
1468 | static struct omap_hwmod_class omap2430_venc_hwmod_class = { | ||
1469 | .name = "venc", | ||
1470 | }; | ||
1471 | |||
1472 | /* dss_venc */ | ||
1473 | static struct omap_hwmod_addr_space omap2430_dss_venc_addrs[] = { | ||
1474 | { | ||
1475 | .pa_start = 0x48050C00, | ||
1476 | .pa_end = 0x48050FFF, | ||
1477 | .flags = ADDR_TYPE_RT | ||
1478 | }, | ||
1479 | }; | ||
1480 | |||
1481 | /* l4_core -> dss_venc */ | ||
1482 | static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { | ||
1483 | .master = &omap2430_l4_core_hwmod, | ||
1484 | .slave = &omap2430_dss_venc_hwmod, | ||
1485 | .clk = "dss_54m_fck", | ||
1486 | .addr = omap2430_dss_venc_addrs, | ||
1487 | .addr_cnt = ARRAY_SIZE(omap2430_dss_venc_addrs), | ||
1488 | .flags = OCPIF_SWSUP_IDLE, | ||
1489 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1490 | }; | ||
1491 | |||
1492 | /* dss_venc slave ports */ | ||
1493 | static struct omap_hwmod_ocp_if *omap2430_dss_venc_slaves[] = { | ||
1494 | &omap2430_l4_core__dss_venc, | ||
1495 | }; | ||
1496 | |||
1497 | static struct omap_hwmod omap2430_dss_venc_hwmod = { | ||
1498 | .name = "dss_venc", | ||
1499 | .class = &omap2430_venc_hwmod_class, | ||
1500 | .main_clk = "dss1_fck", | ||
1501 | .prcm = { | ||
1502 | .omap2 = { | ||
1503 | .prcm_reg_id = 1, | ||
1504 | .module_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
1505 | .module_offs = CORE_MOD, | ||
1506 | }, | ||
1507 | }, | ||
1508 | .slaves = omap2430_dss_venc_slaves, | ||
1509 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves), | ||
1510 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1511 | .flags = HWMOD_NO_IDLEST, | ||
1512 | }; | ||
1513 | |||
472 | /* I2C common */ | 1514 | /* I2C common */ |
473 | static struct omap_hwmod_class_sysconfig i2c_sysc = { | 1515 | static struct omap_hwmod_class_sysconfig i2c_sysc = { |
474 | .rev_offs = 0x00, | 1516 | .rev_offs = 0x00, |
475 | .sysc_offs = 0x20, | 1517 | .sysc_offs = 0x20, |
476 | .syss_offs = 0x10, | 1518 | .syss_offs = 0x10, |
477 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | 1519 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE | |
1520 | SYSS_HAS_RESET_STATUS), | ||
478 | .sysc_fields = &omap_hwmod_sysc_type1, | 1521 | .sysc_fields = &omap_hwmod_sysc_type1, |
479 | }; | 1522 | }; |
480 | 1523 | ||
@@ -672,7 +1715,8 @@ static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = { | |||
672 | .sysc_offs = 0x0010, | 1715 | .sysc_offs = 0x0010, |
673 | .syss_offs = 0x0014, | 1716 | .syss_offs = 0x0014, |
674 | .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | | 1717 | .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | |
675 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | 1718 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE | |
1719 | SYSS_HAS_RESET_STATUS), | ||
676 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1720 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
677 | .sysc_fields = &omap_hwmod_sysc_type1, | 1721 | .sysc_fields = &omap_hwmod_sysc_type1, |
678 | }; | 1722 | }; |
@@ -844,7 +1888,7 @@ static struct omap_hwmod_class_sysconfig omap2430_dma_sysc = { | |||
844 | .syss_offs = 0x0028, | 1888 | .syss_offs = 0x0028, |
845 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE | | 1889 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE | |
846 | SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE | | 1890 | SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE | |
847 | SYSC_HAS_AUTOIDLE), | 1891 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
848 | .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | 1892 | .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), |
849 | .sysc_fields = &omap_hwmod_sysc_type1, | 1893 | .sysc_fields = &omap_hwmod_sysc_type1, |
850 | }; | 1894 | }; |
@@ -919,18 +1963,741 @@ static struct omap_hwmod omap2430_dma_system_hwmod = { | |||
919 | .flags = HWMOD_NO_IDLEST, | 1963 | .flags = HWMOD_NO_IDLEST, |
920 | }; | 1964 | }; |
921 | 1965 | ||
1966 | /* | ||
1967 | * 'mailbox' class | ||
1968 | * mailbox module allowing communication between the on-chip processors | ||
1969 | * using a queued mailbox-interrupt mechanism. | ||
1970 | */ | ||
1971 | |||
1972 | static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = { | ||
1973 | .rev_offs = 0x000, | ||
1974 | .sysc_offs = 0x010, | ||
1975 | .syss_offs = 0x014, | ||
1976 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
1977 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1978 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1979 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1980 | }; | ||
1981 | |||
1982 | static struct omap_hwmod_class omap2430_mailbox_hwmod_class = { | ||
1983 | .name = "mailbox", | ||
1984 | .sysc = &omap2430_mailbox_sysc, | ||
1985 | }; | ||
1986 | |||
1987 | /* mailbox */ | ||
1988 | static struct omap_hwmod omap2430_mailbox_hwmod; | ||
1989 | static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { | ||
1990 | { .irq = 26 }, | ||
1991 | }; | ||
1992 | |||
1993 | static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = { | ||
1994 | { | ||
1995 | .pa_start = 0x48094000, | ||
1996 | .pa_end = 0x480941ff, | ||
1997 | .flags = ADDR_TYPE_RT, | ||
1998 | }, | ||
1999 | }; | ||
2000 | |||
2001 | /* l4_core -> mailbox */ | ||
2002 | static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { | ||
2003 | .master = &omap2430_l4_core_hwmod, | ||
2004 | .slave = &omap2430_mailbox_hwmod, | ||
2005 | .addr = omap2430_mailbox_addrs, | ||
2006 | .addr_cnt = ARRAY_SIZE(omap2430_mailbox_addrs), | ||
2007 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2008 | }; | ||
2009 | |||
2010 | /* mailbox slave ports */ | ||
2011 | static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = { | ||
2012 | &omap2430_l4_core__mailbox, | ||
2013 | }; | ||
2014 | |||
2015 | static struct omap_hwmod omap2430_mailbox_hwmod = { | ||
2016 | .name = "mailbox", | ||
2017 | .class = &omap2430_mailbox_hwmod_class, | ||
2018 | .mpu_irqs = omap2430_mailbox_irqs, | ||
2019 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mailbox_irqs), | ||
2020 | .main_clk = "mailboxes_ick", | ||
2021 | .prcm = { | ||
2022 | .omap2 = { | ||
2023 | .prcm_reg_id = 1, | ||
2024 | .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT, | ||
2025 | .module_offs = CORE_MOD, | ||
2026 | .idlest_reg_id = 1, | ||
2027 | .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, | ||
2028 | }, | ||
2029 | }, | ||
2030 | .slaves = omap2430_mailbox_slaves, | ||
2031 | .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves), | ||
2032 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2033 | }; | ||
2034 | |||
2035 | /* | ||
2036 | * 'mcspi' class | ||
2037 | * multichannel serial port interface (mcspi) / master/slave synchronous serial | ||
2038 | * bus | ||
2039 | */ | ||
2040 | |||
2041 | static struct omap_hwmod_class_sysconfig omap2430_mcspi_sysc = { | ||
2042 | .rev_offs = 0x0000, | ||
2043 | .sysc_offs = 0x0010, | ||
2044 | .syss_offs = 0x0014, | ||
2045 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
2046 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
2047 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
2048 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
2049 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2050 | }; | ||
2051 | |||
2052 | static struct omap_hwmod_class omap2430_mcspi_class = { | ||
2053 | .name = "mcspi", | ||
2054 | .sysc = &omap2430_mcspi_sysc, | ||
2055 | .rev = OMAP2_MCSPI_REV, | ||
2056 | }; | ||
2057 | |||
2058 | /* mcspi1 */ | ||
2059 | static struct omap_hwmod_irq_info omap2430_mcspi1_mpu_irqs[] = { | ||
2060 | { .irq = 65 }, | ||
2061 | }; | ||
2062 | |||
2063 | static struct omap_hwmod_dma_info omap2430_mcspi1_sdma_reqs[] = { | ||
2064 | { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */ | ||
2065 | { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */ | ||
2066 | { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */ | ||
2067 | { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */ | ||
2068 | { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */ | ||
2069 | { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */ | ||
2070 | { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */ | ||
2071 | { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */ | ||
2072 | }; | ||
2073 | |||
2074 | static struct omap_hwmod_ocp_if *omap2430_mcspi1_slaves[] = { | ||
2075 | &omap2430_l4_core__mcspi1, | ||
2076 | }; | ||
2077 | |||
2078 | static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = { | ||
2079 | .num_chipselect = 4, | ||
2080 | }; | ||
2081 | |||
2082 | static struct omap_hwmod omap2430_mcspi1_hwmod = { | ||
2083 | .name = "mcspi1_hwmod", | ||
2084 | .mpu_irqs = omap2430_mcspi1_mpu_irqs, | ||
2085 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi1_mpu_irqs), | ||
2086 | .sdma_reqs = omap2430_mcspi1_sdma_reqs, | ||
2087 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi1_sdma_reqs), | ||
2088 | .main_clk = "mcspi1_fck", | ||
2089 | .prcm = { | ||
2090 | .omap2 = { | ||
2091 | .module_offs = CORE_MOD, | ||
2092 | .prcm_reg_id = 1, | ||
2093 | .module_bit = OMAP24XX_EN_MCSPI1_SHIFT, | ||
2094 | .idlest_reg_id = 1, | ||
2095 | .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT, | ||
2096 | }, | ||
2097 | }, | ||
2098 | .slaves = omap2430_mcspi1_slaves, | ||
2099 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves), | ||
2100 | .class = &omap2430_mcspi_class, | ||
2101 | .dev_attr = &omap_mcspi1_dev_attr, | ||
2102 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2103 | }; | ||
2104 | |||
2105 | /* mcspi2 */ | ||
2106 | static struct omap_hwmod_irq_info omap2430_mcspi2_mpu_irqs[] = { | ||
2107 | { .irq = 66 }, | ||
2108 | }; | ||
2109 | |||
2110 | static struct omap_hwmod_dma_info omap2430_mcspi2_sdma_reqs[] = { | ||
2111 | { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */ | ||
2112 | { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */ | ||
2113 | { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */ | ||
2114 | { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */ | ||
2115 | }; | ||
2116 | |||
2117 | static struct omap_hwmod_ocp_if *omap2430_mcspi2_slaves[] = { | ||
2118 | &omap2430_l4_core__mcspi2, | ||
2119 | }; | ||
2120 | |||
2121 | static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = { | ||
2122 | .num_chipselect = 2, | ||
2123 | }; | ||
2124 | |||
2125 | static struct omap_hwmod omap2430_mcspi2_hwmod = { | ||
2126 | .name = "mcspi2_hwmod", | ||
2127 | .mpu_irqs = omap2430_mcspi2_mpu_irqs, | ||
2128 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi2_mpu_irqs), | ||
2129 | .sdma_reqs = omap2430_mcspi2_sdma_reqs, | ||
2130 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi2_sdma_reqs), | ||
2131 | .main_clk = "mcspi2_fck", | ||
2132 | .prcm = { | ||
2133 | .omap2 = { | ||
2134 | .module_offs = CORE_MOD, | ||
2135 | .prcm_reg_id = 1, | ||
2136 | .module_bit = OMAP24XX_EN_MCSPI2_SHIFT, | ||
2137 | .idlest_reg_id = 1, | ||
2138 | .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT, | ||
2139 | }, | ||
2140 | }, | ||
2141 | .slaves = omap2430_mcspi2_slaves, | ||
2142 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves), | ||
2143 | .class = &omap2430_mcspi_class, | ||
2144 | .dev_attr = &omap_mcspi2_dev_attr, | ||
2145 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2146 | }; | ||
2147 | |||
2148 | /* mcspi3 */ | ||
2149 | static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = { | ||
2150 | { .irq = 91 }, | ||
2151 | }; | ||
2152 | |||
2153 | static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = { | ||
2154 | { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */ | ||
2155 | { .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */ | ||
2156 | { .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */ | ||
2157 | { .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */ | ||
2158 | }; | ||
2159 | |||
2160 | static struct omap_hwmod_ocp_if *omap2430_mcspi3_slaves[] = { | ||
2161 | &omap2430_l4_core__mcspi3, | ||
2162 | }; | ||
2163 | |||
2164 | static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = { | ||
2165 | .num_chipselect = 2, | ||
2166 | }; | ||
2167 | |||
2168 | static struct omap_hwmod omap2430_mcspi3_hwmod = { | ||
2169 | .name = "mcspi3_hwmod", | ||
2170 | .mpu_irqs = omap2430_mcspi3_mpu_irqs, | ||
2171 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi3_mpu_irqs), | ||
2172 | .sdma_reqs = omap2430_mcspi3_sdma_reqs, | ||
2173 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi3_sdma_reqs), | ||
2174 | .main_clk = "mcspi3_fck", | ||
2175 | .prcm = { | ||
2176 | .omap2 = { | ||
2177 | .module_offs = CORE_MOD, | ||
2178 | .prcm_reg_id = 2, | ||
2179 | .module_bit = OMAP2430_EN_MCSPI3_SHIFT, | ||
2180 | .idlest_reg_id = 2, | ||
2181 | .idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT, | ||
2182 | }, | ||
2183 | }, | ||
2184 | .slaves = omap2430_mcspi3_slaves, | ||
2185 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves), | ||
2186 | .class = &omap2430_mcspi_class, | ||
2187 | .dev_attr = &omap_mcspi3_dev_attr, | ||
2188 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2189 | }; | ||
2190 | |||
2191 | /* | ||
2192 | * usbhsotg | ||
2193 | */ | ||
2194 | static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = { | ||
2195 | .rev_offs = 0x0400, | ||
2196 | .sysc_offs = 0x0404, | ||
2197 | .syss_offs = 0x0408, | ||
2198 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE| | ||
2199 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
2200 | SYSC_HAS_AUTOIDLE), | ||
2201 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
2202 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
2203 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2204 | }; | ||
2205 | |||
2206 | static struct omap_hwmod_class usbotg_class = { | ||
2207 | .name = "usbotg", | ||
2208 | .sysc = &omap2430_usbhsotg_sysc, | ||
2209 | }; | ||
2210 | |||
2211 | /* usb_otg_hs */ | ||
2212 | static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = { | ||
2213 | |||
2214 | { .name = "mc", .irq = 92 }, | ||
2215 | { .name = "dma", .irq = 93 }, | ||
2216 | }; | ||
2217 | |||
2218 | static struct omap_hwmod omap2430_usbhsotg_hwmod = { | ||
2219 | .name = "usb_otg_hs", | ||
2220 | .mpu_irqs = omap2430_usbhsotg_mpu_irqs, | ||
2221 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs), | ||
2222 | .main_clk = "usbhs_ick", | ||
2223 | .prcm = { | ||
2224 | .omap2 = { | ||
2225 | .prcm_reg_id = 1, | ||
2226 | .module_bit = OMAP2430_EN_USBHS_MASK, | ||
2227 | .module_offs = CORE_MOD, | ||
2228 | .idlest_reg_id = 1, | ||
2229 | .idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT, | ||
2230 | }, | ||
2231 | }, | ||
2232 | .masters = omap2430_usbhsotg_masters, | ||
2233 | .masters_cnt = ARRAY_SIZE(omap2430_usbhsotg_masters), | ||
2234 | .slaves = omap2430_usbhsotg_slaves, | ||
2235 | .slaves_cnt = ARRAY_SIZE(omap2430_usbhsotg_slaves), | ||
2236 | .class = &usbotg_class, | ||
2237 | /* | ||
2238 | * Erratum ID: i479 idle_req / idle_ack mechanism potentially | ||
2239 | * broken when autoidle is enabled | ||
2240 | * workaround is to disable the autoidle bit at module level. | ||
2241 | */ | ||
2242 | .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE | ||
2243 | | HWMOD_SWSUP_MSTANDBY, | ||
2244 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
2245 | }; | ||
2246 | |||
2247 | /* | ||
2248 | * 'mcbsp' class | ||
2249 | * multi channel buffered serial port controller | ||
2250 | */ | ||
2251 | |||
2252 | static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = { | ||
2253 | .rev_offs = 0x007C, | ||
2254 | .sysc_offs = 0x008C, | ||
2255 | .sysc_flags = (SYSC_HAS_SOFTRESET), | ||
2256 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2257 | }; | ||
2258 | |||
2259 | static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = { | ||
2260 | .name = "mcbsp", | ||
2261 | .sysc = &omap2430_mcbsp_sysc, | ||
2262 | .rev = MCBSP_CONFIG_TYPE2, | ||
2263 | }; | ||
2264 | |||
2265 | /* mcbsp1 */ | ||
2266 | static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { | ||
2267 | { .name = "tx", .irq = 59 }, | ||
2268 | { .name = "rx", .irq = 60 }, | ||
2269 | { .name = "ovr", .irq = 61 }, | ||
2270 | { .name = "common", .irq = 64 }, | ||
2271 | }; | ||
2272 | |||
2273 | static struct omap_hwmod_dma_info omap2430_mcbsp1_sdma_chs[] = { | ||
2274 | { .name = "rx", .dma_req = 32 }, | ||
2275 | { .name = "tx", .dma_req = 31 }, | ||
2276 | }; | ||
2277 | |||
2278 | static struct omap_hwmod_addr_space omap2430_mcbsp1_addrs[] = { | ||
2279 | { | ||
2280 | .name = "mpu", | ||
2281 | .pa_start = 0x48074000, | ||
2282 | .pa_end = 0x480740ff, | ||
2283 | .flags = ADDR_TYPE_RT | ||
2284 | }, | ||
2285 | }; | ||
2286 | |||
2287 | /* l4_core -> mcbsp1 */ | ||
2288 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = { | ||
2289 | .master = &omap2430_l4_core_hwmod, | ||
2290 | .slave = &omap2430_mcbsp1_hwmod, | ||
2291 | .clk = "mcbsp1_ick", | ||
2292 | .addr = omap2430_mcbsp1_addrs, | ||
2293 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp1_addrs), | ||
2294 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2295 | }; | ||
2296 | |||
2297 | /* mcbsp1 slave ports */ | ||
2298 | static struct omap_hwmod_ocp_if *omap2430_mcbsp1_slaves[] = { | ||
2299 | &omap2430_l4_core__mcbsp1, | ||
2300 | }; | ||
2301 | |||
2302 | static struct omap_hwmod omap2430_mcbsp1_hwmod = { | ||
2303 | .name = "mcbsp1", | ||
2304 | .class = &omap2430_mcbsp_hwmod_class, | ||
2305 | .mpu_irqs = omap2430_mcbsp1_irqs, | ||
2306 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_irqs), | ||
2307 | .sdma_reqs = omap2430_mcbsp1_sdma_chs, | ||
2308 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_sdma_chs), | ||
2309 | .main_clk = "mcbsp1_fck", | ||
2310 | .prcm = { | ||
2311 | .omap2 = { | ||
2312 | .prcm_reg_id = 1, | ||
2313 | .module_bit = OMAP24XX_EN_MCBSP1_SHIFT, | ||
2314 | .module_offs = CORE_MOD, | ||
2315 | .idlest_reg_id = 1, | ||
2316 | .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT, | ||
2317 | }, | ||
2318 | }, | ||
2319 | .slaves = omap2430_mcbsp1_slaves, | ||
2320 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves), | ||
2321 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2322 | }; | ||
2323 | |||
2324 | /* mcbsp2 */ | ||
2325 | static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { | ||
2326 | { .name = "tx", .irq = 62 }, | ||
2327 | { .name = "rx", .irq = 63 }, | ||
2328 | { .name = "common", .irq = 16 }, | ||
2329 | }; | ||
2330 | |||
2331 | static struct omap_hwmod_dma_info omap2430_mcbsp2_sdma_chs[] = { | ||
2332 | { .name = "rx", .dma_req = 34 }, | ||
2333 | { .name = "tx", .dma_req = 33 }, | ||
2334 | }; | ||
2335 | |||
2336 | static struct omap_hwmod_addr_space omap2430_mcbsp2_addrs[] = { | ||
2337 | { | ||
2338 | .name = "mpu", | ||
2339 | .pa_start = 0x48076000, | ||
2340 | .pa_end = 0x480760ff, | ||
2341 | .flags = ADDR_TYPE_RT | ||
2342 | }, | ||
2343 | }; | ||
2344 | |||
2345 | /* l4_core -> mcbsp2 */ | ||
2346 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = { | ||
2347 | .master = &omap2430_l4_core_hwmod, | ||
2348 | .slave = &omap2430_mcbsp2_hwmod, | ||
2349 | .clk = "mcbsp2_ick", | ||
2350 | .addr = omap2430_mcbsp2_addrs, | ||
2351 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp2_addrs), | ||
2352 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2353 | }; | ||
2354 | |||
2355 | /* mcbsp2 slave ports */ | ||
2356 | static struct omap_hwmod_ocp_if *omap2430_mcbsp2_slaves[] = { | ||
2357 | &omap2430_l4_core__mcbsp2, | ||
2358 | }; | ||
2359 | |||
2360 | static struct omap_hwmod omap2430_mcbsp2_hwmod = { | ||
2361 | .name = "mcbsp2", | ||
2362 | .class = &omap2430_mcbsp_hwmod_class, | ||
2363 | .mpu_irqs = omap2430_mcbsp2_irqs, | ||
2364 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_irqs), | ||
2365 | .sdma_reqs = omap2430_mcbsp2_sdma_chs, | ||
2366 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_sdma_chs), | ||
2367 | .main_clk = "mcbsp2_fck", | ||
2368 | .prcm = { | ||
2369 | .omap2 = { | ||
2370 | .prcm_reg_id = 1, | ||
2371 | .module_bit = OMAP24XX_EN_MCBSP2_SHIFT, | ||
2372 | .module_offs = CORE_MOD, | ||
2373 | .idlest_reg_id = 1, | ||
2374 | .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT, | ||
2375 | }, | ||
2376 | }, | ||
2377 | .slaves = omap2430_mcbsp2_slaves, | ||
2378 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves), | ||
2379 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2380 | }; | ||
2381 | |||
2382 | /* mcbsp3 */ | ||
2383 | static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { | ||
2384 | { .name = "tx", .irq = 89 }, | ||
2385 | { .name = "rx", .irq = 90 }, | ||
2386 | { .name = "common", .irq = 17 }, | ||
2387 | }; | ||
2388 | |||
2389 | static struct omap_hwmod_dma_info omap2430_mcbsp3_sdma_chs[] = { | ||
2390 | { .name = "rx", .dma_req = 18 }, | ||
2391 | { .name = "tx", .dma_req = 17 }, | ||
2392 | }; | ||
2393 | |||
2394 | static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = { | ||
2395 | { | ||
2396 | .name = "mpu", | ||
2397 | .pa_start = 0x4808C000, | ||
2398 | .pa_end = 0x4808C0ff, | ||
2399 | .flags = ADDR_TYPE_RT | ||
2400 | }, | ||
2401 | }; | ||
2402 | |||
2403 | /* l4_core -> mcbsp3 */ | ||
2404 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = { | ||
2405 | .master = &omap2430_l4_core_hwmod, | ||
2406 | .slave = &omap2430_mcbsp3_hwmod, | ||
2407 | .clk = "mcbsp3_ick", | ||
2408 | .addr = omap2430_mcbsp3_addrs, | ||
2409 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp3_addrs), | ||
2410 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2411 | }; | ||
2412 | |||
2413 | /* mcbsp3 slave ports */ | ||
2414 | static struct omap_hwmod_ocp_if *omap2430_mcbsp3_slaves[] = { | ||
2415 | &omap2430_l4_core__mcbsp3, | ||
2416 | }; | ||
2417 | |||
2418 | static struct omap_hwmod omap2430_mcbsp3_hwmod = { | ||
2419 | .name = "mcbsp3", | ||
2420 | .class = &omap2430_mcbsp_hwmod_class, | ||
2421 | .mpu_irqs = omap2430_mcbsp3_irqs, | ||
2422 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_irqs), | ||
2423 | .sdma_reqs = omap2430_mcbsp3_sdma_chs, | ||
2424 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_sdma_chs), | ||
2425 | .main_clk = "mcbsp3_fck", | ||
2426 | .prcm = { | ||
2427 | .omap2 = { | ||
2428 | .prcm_reg_id = 1, | ||
2429 | .module_bit = OMAP2430_EN_MCBSP3_SHIFT, | ||
2430 | .module_offs = CORE_MOD, | ||
2431 | .idlest_reg_id = 2, | ||
2432 | .idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT, | ||
2433 | }, | ||
2434 | }, | ||
2435 | .slaves = omap2430_mcbsp3_slaves, | ||
2436 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves), | ||
2437 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2438 | }; | ||
2439 | |||
2440 | /* mcbsp4 */ | ||
2441 | static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { | ||
2442 | { .name = "tx", .irq = 54 }, | ||
2443 | { .name = "rx", .irq = 55 }, | ||
2444 | { .name = "common", .irq = 18 }, | ||
2445 | }; | ||
2446 | |||
2447 | static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { | ||
2448 | { .name = "rx", .dma_req = 20 }, | ||
2449 | { .name = "tx", .dma_req = 19 }, | ||
2450 | }; | ||
2451 | |||
2452 | static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = { | ||
2453 | { | ||
2454 | .name = "mpu", | ||
2455 | .pa_start = 0x4808E000, | ||
2456 | .pa_end = 0x4808E0ff, | ||
2457 | .flags = ADDR_TYPE_RT | ||
2458 | }, | ||
2459 | }; | ||
2460 | |||
2461 | /* l4_core -> mcbsp4 */ | ||
2462 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = { | ||
2463 | .master = &omap2430_l4_core_hwmod, | ||
2464 | .slave = &omap2430_mcbsp4_hwmod, | ||
2465 | .clk = "mcbsp4_ick", | ||
2466 | .addr = omap2430_mcbsp4_addrs, | ||
2467 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp4_addrs), | ||
2468 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2469 | }; | ||
2470 | |||
2471 | /* mcbsp4 slave ports */ | ||
2472 | static struct omap_hwmod_ocp_if *omap2430_mcbsp4_slaves[] = { | ||
2473 | &omap2430_l4_core__mcbsp4, | ||
2474 | }; | ||
2475 | |||
2476 | static struct omap_hwmod omap2430_mcbsp4_hwmod = { | ||
2477 | .name = "mcbsp4", | ||
2478 | .class = &omap2430_mcbsp_hwmod_class, | ||
2479 | .mpu_irqs = omap2430_mcbsp4_irqs, | ||
2480 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_irqs), | ||
2481 | .sdma_reqs = omap2430_mcbsp4_sdma_chs, | ||
2482 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_sdma_chs), | ||
2483 | .main_clk = "mcbsp4_fck", | ||
2484 | .prcm = { | ||
2485 | .omap2 = { | ||
2486 | .prcm_reg_id = 1, | ||
2487 | .module_bit = OMAP2430_EN_MCBSP4_SHIFT, | ||
2488 | .module_offs = CORE_MOD, | ||
2489 | .idlest_reg_id = 2, | ||
2490 | .idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT, | ||
2491 | }, | ||
2492 | }, | ||
2493 | .slaves = omap2430_mcbsp4_slaves, | ||
2494 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves), | ||
2495 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2496 | }; | ||
2497 | |||
2498 | /* mcbsp5 */ | ||
2499 | static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { | ||
2500 | { .name = "tx", .irq = 81 }, | ||
2501 | { .name = "rx", .irq = 82 }, | ||
2502 | { .name = "common", .irq = 19 }, | ||
2503 | }; | ||
2504 | |||
2505 | static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { | ||
2506 | { .name = "rx", .dma_req = 22 }, | ||
2507 | { .name = "tx", .dma_req = 21 }, | ||
2508 | }; | ||
2509 | |||
2510 | static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = { | ||
2511 | { | ||
2512 | .name = "mpu", | ||
2513 | .pa_start = 0x48096000, | ||
2514 | .pa_end = 0x480960ff, | ||
2515 | .flags = ADDR_TYPE_RT | ||
2516 | }, | ||
2517 | }; | ||
2518 | |||
2519 | /* l4_core -> mcbsp5 */ | ||
2520 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = { | ||
2521 | .master = &omap2430_l4_core_hwmod, | ||
2522 | .slave = &omap2430_mcbsp5_hwmod, | ||
2523 | .clk = "mcbsp5_ick", | ||
2524 | .addr = omap2430_mcbsp5_addrs, | ||
2525 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp5_addrs), | ||
2526 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2527 | }; | ||
2528 | |||
2529 | /* mcbsp5 slave ports */ | ||
2530 | static struct omap_hwmod_ocp_if *omap2430_mcbsp5_slaves[] = { | ||
2531 | &omap2430_l4_core__mcbsp5, | ||
2532 | }; | ||
2533 | |||
2534 | static struct omap_hwmod omap2430_mcbsp5_hwmod = { | ||
2535 | .name = "mcbsp5", | ||
2536 | .class = &omap2430_mcbsp_hwmod_class, | ||
2537 | .mpu_irqs = omap2430_mcbsp5_irqs, | ||
2538 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_irqs), | ||
2539 | .sdma_reqs = omap2430_mcbsp5_sdma_chs, | ||
2540 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_sdma_chs), | ||
2541 | .main_clk = "mcbsp5_fck", | ||
2542 | .prcm = { | ||
2543 | .omap2 = { | ||
2544 | .prcm_reg_id = 1, | ||
2545 | .module_bit = OMAP2430_EN_MCBSP5_SHIFT, | ||
2546 | .module_offs = CORE_MOD, | ||
2547 | .idlest_reg_id = 2, | ||
2548 | .idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT, | ||
2549 | }, | ||
2550 | }, | ||
2551 | .slaves = omap2430_mcbsp5_slaves, | ||
2552 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves), | ||
2553 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2554 | }; | ||
2555 | |||
2556 | /* MMC/SD/SDIO common */ | ||
2557 | |||
2558 | static struct omap_hwmod_class_sysconfig omap2430_mmc_sysc = { | ||
2559 | .rev_offs = 0x1fc, | ||
2560 | .sysc_offs = 0x10, | ||
2561 | .syss_offs = 0x14, | ||
2562 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
2563 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
2564 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
2565 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
2566 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2567 | }; | ||
2568 | |||
2569 | static struct omap_hwmod_class omap2430_mmc_class = { | ||
2570 | .name = "mmc", | ||
2571 | .sysc = &omap2430_mmc_sysc, | ||
2572 | }; | ||
2573 | |||
2574 | /* MMC/SD/SDIO1 */ | ||
2575 | |||
2576 | static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = { | ||
2577 | { .irq = 83 }, | ||
2578 | }; | ||
2579 | |||
2580 | static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = { | ||
2581 | { .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */ | ||
2582 | { .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */ | ||
2583 | }; | ||
2584 | |||
2585 | static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = { | ||
2586 | { .role = "dbck", .clk = "mmchsdb1_fck" }, | ||
2587 | }; | ||
2588 | |||
2589 | static struct omap_hwmod_ocp_if *omap2430_mmc1_slaves[] = { | ||
2590 | &omap2430_l4_core__mmc1, | ||
2591 | }; | ||
2592 | |||
2593 | static struct omap_mmc_dev_attr mmc1_dev_attr = { | ||
2594 | .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, | ||
2595 | }; | ||
2596 | |||
2597 | static struct omap_hwmod omap2430_mmc1_hwmod = { | ||
2598 | .name = "mmc1", | ||
2599 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | ||
2600 | .mpu_irqs = omap2430_mmc1_mpu_irqs, | ||
2601 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc1_mpu_irqs), | ||
2602 | .sdma_reqs = omap2430_mmc1_sdma_reqs, | ||
2603 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc1_sdma_reqs), | ||
2604 | .opt_clks = omap2430_mmc1_opt_clks, | ||
2605 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks), | ||
2606 | .main_clk = "mmchs1_fck", | ||
2607 | .prcm = { | ||
2608 | .omap2 = { | ||
2609 | .module_offs = CORE_MOD, | ||
2610 | .prcm_reg_id = 2, | ||
2611 | .module_bit = OMAP2430_EN_MMCHS1_SHIFT, | ||
2612 | .idlest_reg_id = 2, | ||
2613 | .idlest_idle_bit = OMAP2430_ST_MMCHS1_SHIFT, | ||
2614 | }, | ||
2615 | }, | ||
2616 | .dev_attr = &mmc1_dev_attr, | ||
2617 | .slaves = omap2430_mmc1_slaves, | ||
2618 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves), | ||
2619 | .class = &omap2430_mmc_class, | ||
2620 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2621 | }; | ||
2622 | |||
2623 | /* MMC/SD/SDIO2 */ | ||
2624 | |||
2625 | static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = { | ||
2626 | { .irq = 86 }, | ||
2627 | }; | ||
2628 | |||
2629 | static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = { | ||
2630 | { .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */ | ||
2631 | { .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */ | ||
2632 | }; | ||
2633 | |||
2634 | static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = { | ||
2635 | { .role = "dbck", .clk = "mmchsdb2_fck" }, | ||
2636 | }; | ||
2637 | |||
2638 | static struct omap_hwmod_ocp_if *omap2430_mmc2_slaves[] = { | ||
2639 | &omap2430_l4_core__mmc2, | ||
2640 | }; | ||
2641 | |||
2642 | static struct omap_hwmod omap2430_mmc2_hwmod = { | ||
2643 | .name = "mmc2", | ||
2644 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | ||
2645 | .mpu_irqs = omap2430_mmc2_mpu_irqs, | ||
2646 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc2_mpu_irqs), | ||
2647 | .sdma_reqs = omap2430_mmc2_sdma_reqs, | ||
2648 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc2_sdma_reqs), | ||
2649 | .opt_clks = omap2430_mmc2_opt_clks, | ||
2650 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks), | ||
2651 | .main_clk = "mmchs2_fck", | ||
2652 | .prcm = { | ||
2653 | .omap2 = { | ||
2654 | .module_offs = CORE_MOD, | ||
2655 | .prcm_reg_id = 2, | ||
2656 | .module_bit = OMAP2430_EN_MMCHS2_SHIFT, | ||
2657 | .idlest_reg_id = 2, | ||
2658 | .idlest_idle_bit = OMAP2430_ST_MMCHS2_SHIFT, | ||
2659 | }, | ||
2660 | }, | ||
2661 | .slaves = omap2430_mmc2_slaves, | ||
2662 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves), | ||
2663 | .class = &omap2430_mmc_class, | ||
2664 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2665 | }; | ||
2666 | |||
922 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { | 2667 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { |
923 | &omap2430_l3_main_hwmod, | 2668 | &omap2430_l3_main_hwmod, |
924 | &omap2430_l4_core_hwmod, | 2669 | &omap2430_l4_core_hwmod, |
925 | &omap2430_l4_wkup_hwmod, | 2670 | &omap2430_l4_wkup_hwmod, |
926 | &omap2430_mpu_hwmod, | 2671 | &omap2430_mpu_hwmod, |
927 | &omap2430_iva_hwmod, | 2672 | &omap2430_iva_hwmod, |
2673 | |||
2674 | &omap2430_timer1_hwmod, | ||
2675 | &omap2430_timer2_hwmod, | ||
2676 | &omap2430_timer3_hwmod, | ||
2677 | &omap2430_timer4_hwmod, | ||
2678 | &omap2430_timer5_hwmod, | ||
2679 | &omap2430_timer6_hwmod, | ||
2680 | &omap2430_timer7_hwmod, | ||
2681 | &omap2430_timer8_hwmod, | ||
2682 | &omap2430_timer9_hwmod, | ||
2683 | &omap2430_timer10_hwmod, | ||
2684 | &omap2430_timer11_hwmod, | ||
2685 | &omap2430_timer12_hwmod, | ||
2686 | |||
928 | &omap2430_wd_timer2_hwmod, | 2687 | &omap2430_wd_timer2_hwmod, |
929 | &omap2430_uart1_hwmod, | 2688 | &omap2430_uart1_hwmod, |
930 | &omap2430_uart2_hwmod, | 2689 | &omap2430_uart2_hwmod, |
931 | &omap2430_uart3_hwmod, | 2690 | &omap2430_uart3_hwmod, |
2691 | /* dss class */ | ||
2692 | &omap2430_dss_core_hwmod, | ||
2693 | &omap2430_dss_dispc_hwmod, | ||
2694 | &omap2430_dss_rfbi_hwmod, | ||
2695 | &omap2430_dss_venc_hwmod, | ||
2696 | /* i2c class */ | ||
932 | &omap2430_i2c1_hwmod, | 2697 | &omap2430_i2c1_hwmod, |
933 | &omap2430_i2c2_hwmod, | 2698 | &omap2430_i2c2_hwmod, |
2699 | &omap2430_mmc1_hwmod, | ||
2700 | &omap2430_mmc2_hwmod, | ||
934 | 2701 | ||
935 | /* gpio class */ | 2702 | /* gpio class */ |
936 | &omap2430_gpio1_hwmod, | 2703 | &omap2430_gpio1_hwmod, |
@@ -941,10 +2708,29 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { | |||
941 | 2708 | ||
942 | /* dma_system class*/ | 2709 | /* dma_system class*/ |
943 | &omap2430_dma_system_hwmod, | 2710 | &omap2430_dma_system_hwmod, |
2711 | |||
2712 | /* mcbsp class */ | ||
2713 | &omap2430_mcbsp1_hwmod, | ||
2714 | &omap2430_mcbsp2_hwmod, | ||
2715 | &omap2430_mcbsp3_hwmod, | ||
2716 | &omap2430_mcbsp4_hwmod, | ||
2717 | &omap2430_mcbsp5_hwmod, | ||
2718 | |||
2719 | /* mailbox class */ | ||
2720 | &omap2430_mailbox_hwmod, | ||
2721 | |||
2722 | /* mcspi class */ | ||
2723 | &omap2430_mcspi1_hwmod, | ||
2724 | &omap2430_mcspi2_hwmod, | ||
2725 | &omap2430_mcspi3_hwmod, | ||
2726 | |||
2727 | /* usbotg class*/ | ||
2728 | &omap2430_usbhsotg_hwmod, | ||
2729 | |||
944 | NULL, | 2730 | NULL, |
945 | }; | 2731 | }; |
946 | 2732 | ||
947 | int __init omap2430_hwmod_init(void) | 2733 | int __init omap2430_hwmod_init(void) |
948 | { | 2734 | { |
949 | return omap_hwmod_init(omap2430_hwmods); | 2735 | return omap_hwmod_register(omap2430_hwmods); |
950 | } | 2736 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 8d8181334f86..c819c306693a 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -18,16 +18,21 @@ | |||
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/l3_3xxx.h> | ||
21 | #include <plat/l4_3xxx.h> | 22 | #include <plat/l4_3xxx.h> |
22 | #include <plat/i2c.h> | 23 | #include <plat/i2c.h> |
23 | #include <plat/gpio.h> | 24 | #include <plat/gpio.h> |
24 | #include <plat/smartreflex.h> | 25 | #include <plat/mmc.h> |
26 | #include <plat/mcbsp.h> | ||
27 | #include <plat/mcspi.h> | ||
28 | #include <plat/dmtimer.h> | ||
25 | 29 | ||
26 | #include "omap_hwmod_common_data.h" | 30 | #include "omap_hwmod_common_data.h" |
27 | 31 | ||
28 | #include "prm-regbits-34xx.h" | 32 | #include "prm-regbits-34xx.h" |
29 | #include "cm-regbits-34xx.h" | 33 | #include "cm-regbits-34xx.h" |
30 | #include "wd_timer.h" | 34 | #include "wd_timer.h" |
35 | #include <mach/am35xx.h> | ||
31 | 36 | ||
32 | /* | 37 | /* |
33 | * OMAP3xxx hardware module integration data | 38 | * OMAP3xxx hardware module integration data |
@@ -44,6 +49,12 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod; | |||
44 | static struct omap_hwmod omap3xxx_l4_core_hwmod; | 49 | static struct omap_hwmod omap3xxx_l4_core_hwmod; |
45 | static struct omap_hwmod omap3xxx_l4_per_hwmod; | 50 | static struct omap_hwmod omap3xxx_l4_per_hwmod; |
46 | static struct omap_hwmod omap3xxx_wd_timer2_hwmod; | 51 | static struct omap_hwmod omap3xxx_wd_timer2_hwmod; |
52 | static struct omap_hwmod omap3430es1_dss_core_hwmod; | ||
53 | static struct omap_hwmod omap3xxx_dss_core_hwmod; | ||
54 | static struct omap_hwmod omap3xxx_dss_dispc_hwmod; | ||
55 | static struct omap_hwmod omap3xxx_dss_dsi1_hwmod; | ||
56 | static struct omap_hwmod omap3xxx_dss_rfbi_hwmod; | ||
57 | static struct omap_hwmod omap3xxx_dss_venc_hwmod; | ||
47 | static struct omap_hwmod omap3xxx_i2c1_hwmod; | 58 | static struct omap_hwmod omap3xxx_i2c1_hwmod; |
48 | static struct omap_hwmod omap3xxx_i2c2_hwmod; | 59 | static struct omap_hwmod omap3xxx_i2c2_hwmod; |
49 | static struct omap_hwmod omap3xxx_i2c3_hwmod; | 60 | static struct omap_hwmod omap3xxx_i2c3_hwmod; |
@@ -55,9 +66,25 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod; | |||
55 | static struct omap_hwmod omap3xxx_gpio6_hwmod; | 66 | static struct omap_hwmod omap3xxx_gpio6_hwmod; |
56 | static struct omap_hwmod omap34xx_sr1_hwmod; | 67 | static struct omap_hwmod omap34xx_sr1_hwmod; |
57 | static struct omap_hwmod omap34xx_sr2_hwmod; | 68 | static struct omap_hwmod omap34xx_sr2_hwmod; |
69 | static struct omap_hwmod omap34xx_mcspi1; | ||
70 | static struct omap_hwmod omap34xx_mcspi2; | ||
71 | static struct omap_hwmod omap34xx_mcspi3; | ||
72 | static struct omap_hwmod omap34xx_mcspi4; | ||
73 | static struct omap_hwmod omap3xxx_mmc1_hwmod; | ||
74 | static struct omap_hwmod omap3xxx_mmc2_hwmod; | ||
75 | static struct omap_hwmod omap3xxx_mmc3_hwmod; | ||
76 | static struct omap_hwmod am35xx_usbhsotg_hwmod; | ||
58 | 77 | ||
59 | static struct omap_hwmod omap3xxx_dma_system_hwmod; | 78 | static struct omap_hwmod omap3xxx_dma_system_hwmod; |
60 | 79 | ||
80 | static struct omap_hwmod omap3xxx_mcbsp1_hwmod; | ||
81 | static struct omap_hwmod omap3xxx_mcbsp2_hwmod; | ||
82 | static struct omap_hwmod omap3xxx_mcbsp3_hwmod; | ||
83 | static struct omap_hwmod omap3xxx_mcbsp4_hwmod; | ||
84 | static struct omap_hwmod omap3xxx_mcbsp5_hwmod; | ||
85 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod; | ||
86 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod; | ||
87 | |||
61 | /* L3 -> L4_CORE interface */ | 88 | /* L3 -> L4_CORE interface */ |
62 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { | 89 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { |
63 | .master = &omap3xxx_l3_main_hwmod, | 90 | .master = &omap3xxx_l3_main_hwmod, |
@@ -72,10 +99,26 @@ static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_per = { | |||
72 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 99 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
73 | }; | 100 | }; |
74 | 101 | ||
102 | /* L3 taret configuration and error log registers */ | ||
103 | static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = { | ||
104 | { .irq = INT_34XX_L3_DBG_IRQ }, | ||
105 | { .irq = INT_34XX_L3_APP_IRQ }, | ||
106 | }; | ||
107 | |||
108 | static struct omap_hwmod_addr_space omap3xxx_l3_main_addrs[] = { | ||
109 | { | ||
110 | .pa_start = 0x68000000, | ||
111 | .pa_end = 0x6800ffff, | ||
112 | .flags = ADDR_TYPE_RT, | ||
113 | }, | ||
114 | }; | ||
115 | |||
75 | /* MPU -> L3 interface */ | 116 | /* MPU -> L3 interface */ |
76 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { | 117 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { |
77 | .master = &omap3xxx_mpu_hwmod, | 118 | .master = &omap3xxx_mpu_hwmod, |
78 | .slave = &omap3xxx_l3_main_hwmod, | 119 | .slave = &omap3xxx_l3_main_hwmod, |
120 | .addr = omap3xxx_l3_main_addrs, | ||
121 | .addr_cnt = ARRAY_SIZE(omap3xxx_l3_main_addrs), | ||
79 | .user = OCP_USER_MPU, | 122 | .user = OCP_USER_MPU, |
80 | }; | 123 | }; |
81 | 124 | ||
@@ -84,6 +127,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = { | |||
84 | &omap3xxx_mpu__l3_main, | 127 | &omap3xxx_mpu__l3_main, |
85 | }; | 128 | }; |
86 | 129 | ||
130 | /* DSS -> l3 */ | ||
131 | static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = { | ||
132 | .master = &omap3xxx_dss_core_hwmod, | ||
133 | .slave = &omap3xxx_l3_main_hwmod, | ||
134 | .fw = { | ||
135 | .omap2 = { | ||
136 | .l3_perm_bit = OMAP3_L3_CORE_FW_INIT_ID_DSS, | ||
137 | .flags = OMAP_FIREWALL_L3, | ||
138 | } | ||
139 | }, | ||
140 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
141 | }; | ||
142 | |||
87 | /* Master interfaces on the L3 interconnect */ | 143 | /* Master interfaces on the L3 interconnect */ |
88 | static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { | 144 | static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { |
89 | &omap3xxx_l3_main__l4_core, | 145 | &omap3xxx_l3_main__l4_core, |
@@ -94,6 +150,8 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { | |||
94 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { | 150 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { |
95 | .name = "l3_main", | 151 | .name = "l3_main", |
96 | .class = &l3_hwmod_class, | 152 | .class = &l3_hwmod_class, |
153 | .mpu_irqs = omap3xxx_l3_main_irqs, | ||
154 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_l3_main_irqs), | ||
97 | .masters = omap3xxx_l3_main_masters, | 155 | .masters = omap3xxx_l3_main_masters, |
98 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), | 156 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), |
99 | .slaves = omap3xxx_l3_main_slaves, | 157 | .slaves = omap3xxx_l3_main_slaves, |
@@ -107,7 +165,23 @@ static struct omap_hwmod omap3xxx_uart1_hwmod; | |||
107 | static struct omap_hwmod omap3xxx_uart2_hwmod; | 165 | static struct omap_hwmod omap3xxx_uart2_hwmod; |
108 | static struct omap_hwmod omap3xxx_uart3_hwmod; | 166 | static struct omap_hwmod omap3xxx_uart3_hwmod; |
109 | static struct omap_hwmod omap3xxx_uart4_hwmod; | 167 | static struct omap_hwmod omap3xxx_uart4_hwmod; |
168 | static struct omap_hwmod omap3xxx_usbhsotg_hwmod; | ||
110 | 169 | ||
170 | /* l3_core -> usbhsotg interface */ | ||
171 | static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = { | ||
172 | .master = &omap3xxx_usbhsotg_hwmod, | ||
173 | .slave = &omap3xxx_l3_main_hwmod, | ||
174 | .clk = "core_l3_ick", | ||
175 | .user = OCP_USER_MPU, | ||
176 | }; | ||
177 | |||
178 | /* l3_core -> am35xx_usbhsotg interface */ | ||
179 | static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = { | ||
180 | .master = &am35xx_usbhsotg_hwmod, | ||
181 | .slave = &omap3xxx_l3_main_hwmod, | ||
182 | .clk = "core_l3_ick", | ||
183 | .user = OCP_USER_MPU, | ||
184 | }; | ||
111 | /* L4_CORE -> L4_WKUP interface */ | 185 | /* L4_CORE -> L4_WKUP interface */ |
112 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { | 186 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { |
113 | .master = &omap3xxx_l4_core_hwmod, | 187 | .master = &omap3xxx_l4_core_hwmod, |
@@ -115,6 +189,63 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { | |||
115 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 189 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
116 | }; | 190 | }; |
117 | 191 | ||
192 | /* L4 CORE -> MMC1 interface */ | ||
193 | static struct omap_hwmod_addr_space omap3xxx_mmc1_addr_space[] = { | ||
194 | { | ||
195 | .pa_start = 0x4809c000, | ||
196 | .pa_end = 0x4809c1ff, | ||
197 | .flags = ADDR_TYPE_RT, | ||
198 | }, | ||
199 | }; | ||
200 | |||
201 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc1 = { | ||
202 | .master = &omap3xxx_l4_core_hwmod, | ||
203 | .slave = &omap3xxx_mmc1_hwmod, | ||
204 | .clk = "mmchs1_ick", | ||
205 | .addr = omap3xxx_mmc1_addr_space, | ||
206 | .addr_cnt = ARRAY_SIZE(omap3xxx_mmc1_addr_space), | ||
207 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
208 | .flags = OMAP_FIREWALL_L4 | ||
209 | }; | ||
210 | |||
211 | /* L4 CORE -> MMC2 interface */ | ||
212 | static struct omap_hwmod_addr_space omap3xxx_mmc2_addr_space[] = { | ||
213 | { | ||
214 | .pa_start = 0x480b4000, | ||
215 | .pa_end = 0x480b41ff, | ||
216 | .flags = ADDR_TYPE_RT, | ||
217 | }, | ||
218 | }; | ||
219 | |||
220 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc2 = { | ||
221 | .master = &omap3xxx_l4_core_hwmod, | ||
222 | .slave = &omap3xxx_mmc2_hwmod, | ||
223 | .clk = "mmchs2_ick", | ||
224 | .addr = omap3xxx_mmc2_addr_space, | ||
225 | .addr_cnt = ARRAY_SIZE(omap3xxx_mmc2_addr_space), | ||
226 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
227 | .flags = OMAP_FIREWALL_L4 | ||
228 | }; | ||
229 | |||
230 | /* L4 CORE -> MMC3 interface */ | ||
231 | static struct omap_hwmod_addr_space omap3xxx_mmc3_addr_space[] = { | ||
232 | { | ||
233 | .pa_start = 0x480ad000, | ||
234 | .pa_end = 0x480ad1ff, | ||
235 | .flags = ADDR_TYPE_RT, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc3 = { | ||
240 | .master = &omap3xxx_l4_core_hwmod, | ||
241 | .slave = &omap3xxx_mmc3_hwmod, | ||
242 | .clk = "mmchs3_ick", | ||
243 | .addr = omap3xxx_mmc3_addr_space, | ||
244 | .addr_cnt = ARRAY_SIZE(omap3xxx_mmc3_addr_space), | ||
245 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
246 | .flags = OMAP_FIREWALL_L4 | ||
247 | }; | ||
248 | |||
118 | /* L4 CORE -> UART1 interface */ | 249 | /* L4 CORE -> UART1 interface */ |
119 | static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = { | 250 | static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = { |
120 | { | 251 | { |
@@ -301,29 +432,70 @@ static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = { | |||
301 | .user = OCP_USER_MPU, | 432 | .user = OCP_USER_MPU, |
302 | }; | 433 | }; |
303 | 434 | ||
435 | /* | ||
436 | * usbhsotg interface data | ||
437 | */ | ||
438 | |||
439 | static struct omap_hwmod_addr_space omap3xxx_usbhsotg_addrs[] = { | ||
440 | { | ||
441 | .pa_start = OMAP34XX_HSUSB_OTG_BASE, | ||
442 | .pa_end = OMAP34XX_HSUSB_OTG_BASE + SZ_4K - 1, | ||
443 | .flags = ADDR_TYPE_RT | ||
444 | }, | ||
445 | }; | ||
446 | |||
447 | /* l4_core -> usbhsotg */ | ||
448 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__usbhsotg = { | ||
449 | .master = &omap3xxx_l4_core_hwmod, | ||
450 | .slave = &omap3xxx_usbhsotg_hwmod, | ||
451 | .clk = "l4_ick", | ||
452 | .addr = omap3xxx_usbhsotg_addrs, | ||
453 | .addr_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_addrs), | ||
454 | .user = OCP_USER_MPU, | ||
455 | }; | ||
456 | |||
457 | static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_masters[] = { | ||
458 | &omap3xxx_usbhsotg__l3, | ||
459 | }; | ||
460 | |||
461 | static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_slaves[] = { | ||
462 | &omap3xxx_l4_core__usbhsotg, | ||
463 | }; | ||
464 | |||
465 | static struct omap_hwmod_addr_space am35xx_usbhsotg_addrs[] = { | ||
466 | { | ||
467 | .pa_start = AM35XX_IPSS_USBOTGSS_BASE, | ||
468 | .pa_end = AM35XX_IPSS_USBOTGSS_BASE + SZ_4K - 1, | ||
469 | .flags = ADDR_TYPE_RT | ||
470 | }, | ||
471 | }; | ||
472 | |||
473 | /* l4_core -> usbhsotg */ | ||
474 | static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = { | ||
475 | .master = &omap3xxx_l4_core_hwmod, | ||
476 | .slave = &am35xx_usbhsotg_hwmod, | ||
477 | .clk = "l4_ick", | ||
478 | .addr = am35xx_usbhsotg_addrs, | ||
479 | .addr_cnt = ARRAY_SIZE(am35xx_usbhsotg_addrs), | ||
480 | .user = OCP_USER_MPU, | ||
481 | }; | ||
482 | |||
483 | static struct omap_hwmod_ocp_if *am35xx_usbhsotg_masters[] = { | ||
484 | &am35xx_usbhsotg__l3, | ||
485 | }; | ||
486 | |||
487 | static struct omap_hwmod_ocp_if *am35xx_usbhsotg_slaves[] = { | ||
488 | &am35xx_l4_core__usbhsotg, | ||
489 | }; | ||
304 | /* Slave interfaces on the L4_CORE interconnect */ | 490 | /* Slave interfaces on the L4_CORE interconnect */ |
305 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { | 491 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { |
306 | &omap3xxx_l3_main__l4_core, | 492 | &omap3xxx_l3_main__l4_core, |
307 | &omap3_l4_core__sr1, | ||
308 | &omap3_l4_core__sr2, | ||
309 | }; | ||
310 | |||
311 | /* Master interfaces on the L4_CORE interconnect */ | ||
312 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = { | ||
313 | &omap3xxx_l4_core__l4_wkup, | ||
314 | &omap3_l4_core__uart1, | ||
315 | &omap3_l4_core__uart2, | ||
316 | &omap3_l4_core__i2c1, | ||
317 | &omap3_l4_core__i2c2, | ||
318 | &omap3_l4_core__i2c3, | ||
319 | }; | 493 | }; |
320 | 494 | ||
321 | /* L4 CORE */ | 495 | /* L4 CORE */ |
322 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { | 496 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { |
323 | .name = "l4_core", | 497 | .name = "l4_core", |
324 | .class = &l4_hwmod_class, | 498 | .class = &l4_hwmod_class, |
325 | .masters = omap3xxx_l4_core_masters, | ||
326 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters), | ||
327 | .slaves = omap3xxx_l4_core_slaves, | 499 | .slaves = omap3xxx_l4_core_slaves, |
328 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), | 500 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), |
329 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 501 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -335,18 +507,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = { | |||
335 | &omap3xxx_l3_main__l4_per, | 507 | &omap3xxx_l3_main__l4_per, |
336 | }; | 508 | }; |
337 | 509 | ||
338 | /* Master interfaces on the L4_PER interconnect */ | ||
339 | static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = { | ||
340 | &omap3_l4_per__uart3, | ||
341 | &omap3_l4_per__uart4, | ||
342 | }; | ||
343 | |||
344 | /* L4 PER */ | 510 | /* L4 PER */ |
345 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { | 511 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { |
346 | .name = "l4_per", | 512 | .name = "l4_per", |
347 | .class = &l4_hwmod_class, | 513 | .class = &l4_hwmod_class, |
348 | .masters = omap3xxx_l4_per_masters, | ||
349 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters), | ||
350 | .slaves = omap3xxx_l4_per_slaves, | 514 | .slaves = omap3xxx_l4_per_slaves, |
351 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), | 515 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), |
352 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 516 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -358,16 +522,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_slaves[] = { | |||
358 | &omap3xxx_l4_core__l4_wkup, | 522 | &omap3xxx_l4_core__l4_wkup, |
359 | }; | 523 | }; |
360 | 524 | ||
361 | /* Master interfaces on the L4_WKUP interconnect */ | ||
362 | static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = { | ||
363 | }; | ||
364 | |||
365 | /* L4 WKUP */ | 525 | /* L4 WKUP */ |
366 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { | 526 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { |
367 | .name = "l4_wkup", | 527 | .name = "l4_wkup", |
368 | .class = &l4_hwmod_class, | 528 | .class = &l4_hwmod_class, |
369 | .masters = omap3xxx_l4_wkup_masters, | ||
370 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters), | ||
371 | .slaves = omap3xxx_l4_wkup_slaves, | 529 | .slaves = omap3xxx_l4_wkup_slaves, |
372 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), | 530 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), |
373 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 531 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -417,6 +575,640 @@ static struct omap_hwmod omap3xxx_iva_hwmod = { | |||
417 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 575 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
418 | }; | 576 | }; |
419 | 577 | ||
578 | /* timer class */ | ||
579 | static struct omap_hwmod_class_sysconfig omap3xxx_timer_1ms_sysc = { | ||
580 | .rev_offs = 0x0000, | ||
581 | .sysc_offs = 0x0010, | ||
582 | .syss_offs = 0x0014, | ||
583 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
584 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
585 | SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE), | ||
586 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
587 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
588 | }; | ||
589 | |||
590 | static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = { | ||
591 | .name = "timer", | ||
592 | .sysc = &omap3xxx_timer_1ms_sysc, | ||
593 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
594 | }; | ||
595 | |||
596 | static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = { | ||
597 | .rev_offs = 0x0000, | ||
598 | .sysc_offs = 0x0010, | ||
599 | .syss_offs = 0x0014, | ||
600 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | | ||
601 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
602 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
603 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
604 | }; | ||
605 | |||
606 | static struct omap_hwmod_class omap3xxx_timer_hwmod_class = { | ||
607 | .name = "timer", | ||
608 | .sysc = &omap3xxx_timer_sysc, | ||
609 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
610 | }; | ||
611 | |||
612 | /* timer1 */ | ||
613 | static struct omap_hwmod omap3xxx_timer1_hwmod; | ||
614 | static struct omap_hwmod_irq_info omap3xxx_timer1_mpu_irqs[] = { | ||
615 | { .irq = 37, }, | ||
616 | }; | ||
617 | |||
618 | static struct omap_hwmod_addr_space omap3xxx_timer1_addrs[] = { | ||
619 | { | ||
620 | .pa_start = 0x48318000, | ||
621 | .pa_end = 0x48318000 + SZ_1K - 1, | ||
622 | .flags = ADDR_TYPE_RT | ||
623 | }, | ||
624 | }; | ||
625 | |||
626 | /* l4_wkup -> timer1 */ | ||
627 | static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__timer1 = { | ||
628 | .master = &omap3xxx_l4_wkup_hwmod, | ||
629 | .slave = &omap3xxx_timer1_hwmod, | ||
630 | .clk = "gpt1_ick", | ||
631 | .addr = omap3xxx_timer1_addrs, | ||
632 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer1_addrs), | ||
633 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
634 | }; | ||
635 | |||
636 | /* timer1 slave port */ | ||
637 | static struct omap_hwmod_ocp_if *omap3xxx_timer1_slaves[] = { | ||
638 | &omap3xxx_l4_wkup__timer1, | ||
639 | }; | ||
640 | |||
641 | /* timer1 hwmod */ | ||
642 | static struct omap_hwmod omap3xxx_timer1_hwmod = { | ||
643 | .name = "timer1", | ||
644 | .mpu_irqs = omap3xxx_timer1_mpu_irqs, | ||
645 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer1_mpu_irqs), | ||
646 | .main_clk = "gpt1_fck", | ||
647 | .prcm = { | ||
648 | .omap2 = { | ||
649 | .prcm_reg_id = 1, | ||
650 | .module_bit = OMAP3430_EN_GPT1_SHIFT, | ||
651 | .module_offs = WKUP_MOD, | ||
652 | .idlest_reg_id = 1, | ||
653 | .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT, | ||
654 | }, | ||
655 | }, | ||
656 | .slaves = omap3xxx_timer1_slaves, | ||
657 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves), | ||
658 | .class = &omap3xxx_timer_1ms_hwmod_class, | ||
659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
660 | }; | ||
661 | |||
662 | /* timer2 */ | ||
663 | static struct omap_hwmod omap3xxx_timer2_hwmod; | ||
664 | static struct omap_hwmod_irq_info omap3xxx_timer2_mpu_irqs[] = { | ||
665 | { .irq = 38, }, | ||
666 | }; | ||
667 | |||
668 | static struct omap_hwmod_addr_space omap3xxx_timer2_addrs[] = { | ||
669 | { | ||
670 | .pa_start = 0x49032000, | ||
671 | .pa_end = 0x49032000 + SZ_1K - 1, | ||
672 | .flags = ADDR_TYPE_RT | ||
673 | }, | ||
674 | }; | ||
675 | |||
676 | /* l4_per -> timer2 */ | ||
677 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer2 = { | ||
678 | .master = &omap3xxx_l4_per_hwmod, | ||
679 | .slave = &omap3xxx_timer2_hwmod, | ||
680 | .clk = "gpt2_ick", | ||
681 | .addr = omap3xxx_timer2_addrs, | ||
682 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer2_addrs), | ||
683 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
684 | }; | ||
685 | |||
686 | /* timer2 slave port */ | ||
687 | static struct omap_hwmod_ocp_if *omap3xxx_timer2_slaves[] = { | ||
688 | &omap3xxx_l4_per__timer2, | ||
689 | }; | ||
690 | |||
691 | /* timer2 hwmod */ | ||
692 | static struct omap_hwmod omap3xxx_timer2_hwmod = { | ||
693 | .name = "timer2", | ||
694 | .mpu_irqs = omap3xxx_timer2_mpu_irqs, | ||
695 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer2_mpu_irqs), | ||
696 | .main_clk = "gpt2_fck", | ||
697 | .prcm = { | ||
698 | .omap2 = { | ||
699 | .prcm_reg_id = 1, | ||
700 | .module_bit = OMAP3430_EN_GPT2_SHIFT, | ||
701 | .module_offs = OMAP3430_PER_MOD, | ||
702 | .idlest_reg_id = 1, | ||
703 | .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT, | ||
704 | }, | ||
705 | }, | ||
706 | .slaves = omap3xxx_timer2_slaves, | ||
707 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves), | ||
708 | .class = &omap3xxx_timer_1ms_hwmod_class, | ||
709 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
710 | }; | ||
711 | |||
712 | /* timer3 */ | ||
713 | static struct omap_hwmod omap3xxx_timer3_hwmod; | ||
714 | static struct omap_hwmod_irq_info omap3xxx_timer3_mpu_irqs[] = { | ||
715 | { .irq = 39, }, | ||
716 | }; | ||
717 | |||
718 | static struct omap_hwmod_addr_space omap3xxx_timer3_addrs[] = { | ||
719 | { | ||
720 | .pa_start = 0x49034000, | ||
721 | .pa_end = 0x49034000 + SZ_1K - 1, | ||
722 | .flags = ADDR_TYPE_RT | ||
723 | }, | ||
724 | }; | ||
725 | |||
726 | /* l4_per -> timer3 */ | ||
727 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer3 = { | ||
728 | .master = &omap3xxx_l4_per_hwmod, | ||
729 | .slave = &omap3xxx_timer3_hwmod, | ||
730 | .clk = "gpt3_ick", | ||
731 | .addr = omap3xxx_timer3_addrs, | ||
732 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer3_addrs), | ||
733 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
734 | }; | ||
735 | |||
736 | /* timer3 slave port */ | ||
737 | static struct omap_hwmod_ocp_if *omap3xxx_timer3_slaves[] = { | ||
738 | &omap3xxx_l4_per__timer3, | ||
739 | }; | ||
740 | |||
741 | /* timer3 hwmod */ | ||
742 | static struct omap_hwmod omap3xxx_timer3_hwmod = { | ||
743 | .name = "timer3", | ||
744 | .mpu_irqs = omap3xxx_timer3_mpu_irqs, | ||
745 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer3_mpu_irqs), | ||
746 | .main_clk = "gpt3_fck", | ||
747 | .prcm = { | ||
748 | .omap2 = { | ||
749 | .prcm_reg_id = 1, | ||
750 | .module_bit = OMAP3430_EN_GPT3_SHIFT, | ||
751 | .module_offs = OMAP3430_PER_MOD, | ||
752 | .idlest_reg_id = 1, | ||
753 | .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT, | ||
754 | }, | ||
755 | }, | ||
756 | .slaves = omap3xxx_timer3_slaves, | ||
757 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves), | ||
758 | .class = &omap3xxx_timer_hwmod_class, | ||
759 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
760 | }; | ||
761 | |||
762 | /* timer4 */ | ||
763 | static struct omap_hwmod omap3xxx_timer4_hwmod; | ||
764 | static struct omap_hwmod_irq_info omap3xxx_timer4_mpu_irqs[] = { | ||
765 | { .irq = 40, }, | ||
766 | }; | ||
767 | |||
768 | static struct omap_hwmod_addr_space omap3xxx_timer4_addrs[] = { | ||
769 | { | ||
770 | .pa_start = 0x49036000, | ||
771 | .pa_end = 0x49036000 + SZ_1K - 1, | ||
772 | .flags = ADDR_TYPE_RT | ||
773 | }, | ||
774 | }; | ||
775 | |||
776 | /* l4_per -> timer4 */ | ||
777 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer4 = { | ||
778 | .master = &omap3xxx_l4_per_hwmod, | ||
779 | .slave = &omap3xxx_timer4_hwmod, | ||
780 | .clk = "gpt4_ick", | ||
781 | .addr = omap3xxx_timer4_addrs, | ||
782 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer4_addrs), | ||
783 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
784 | }; | ||
785 | |||
786 | /* timer4 slave port */ | ||
787 | static struct omap_hwmod_ocp_if *omap3xxx_timer4_slaves[] = { | ||
788 | &omap3xxx_l4_per__timer4, | ||
789 | }; | ||
790 | |||
791 | /* timer4 hwmod */ | ||
792 | static struct omap_hwmod omap3xxx_timer4_hwmod = { | ||
793 | .name = "timer4", | ||
794 | .mpu_irqs = omap3xxx_timer4_mpu_irqs, | ||
795 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer4_mpu_irqs), | ||
796 | .main_clk = "gpt4_fck", | ||
797 | .prcm = { | ||
798 | .omap2 = { | ||
799 | .prcm_reg_id = 1, | ||
800 | .module_bit = OMAP3430_EN_GPT4_SHIFT, | ||
801 | .module_offs = OMAP3430_PER_MOD, | ||
802 | .idlest_reg_id = 1, | ||
803 | .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT, | ||
804 | }, | ||
805 | }, | ||
806 | .slaves = omap3xxx_timer4_slaves, | ||
807 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves), | ||
808 | .class = &omap3xxx_timer_hwmod_class, | ||
809 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
810 | }; | ||
811 | |||
812 | /* timer5 */ | ||
813 | static struct omap_hwmod omap3xxx_timer5_hwmod; | ||
814 | static struct omap_hwmod_irq_info omap3xxx_timer5_mpu_irqs[] = { | ||
815 | { .irq = 41, }, | ||
816 | }; | ||
817 | |||
818 | static struct omap_hwmod_addr_space omap3xxx_timer5_addrs[] = { | ||
819 | { | ||
820 | .pa_start = 0x49038000, | ||
821 | .pa_end = 0x49038000 + SZ_1K - 1, | ||
822 | .flags = ADDR_TYPE_RT | ||
823 | }, | ||
824 | }; | ||
825 | |||
826 | /* l4_per -> timer5 */ | ||
827 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer5 = { | ||
828 | .master = &omap3xxx_l4_per_hwmod, | ||
829 | .slave = &omap3xxx_timer5_hwmod, | ||
830 | .clk = "gpt5_ick", | ||
831 | .addr = omap3xxx_timer5_addrs, | ||
832 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer5_addrs), | ||
833 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
834 | }; | ||
835 | |||
836 | /* timer5 slave port */ | ||
837 | static struct omap_hwmod_ocp_if *omap3xxx_timer5_slaves[] = { | ||
838 | &omap3xxx_l4_per__timer5, | ||
839 | }; | ||
840 | |||
841 | /* timer5 hwmod */ | ||
842 | static struct omap_hwmod omap3xxx_timer5_hwmod = { | ||
843 | .name = "timer5", | ||
844 | .mpu_irqs = omap3xxx_timer5_mpu_irqs, | ||
845 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer5_mpu_irqs), | ||
846 | .main_clk = "gpt5_fck", | ||
847 | .prcm = { | ||
848 | .omap2 = { | ||
849 | .prcm_reg_id = 1, | ||
850 | .module_bit = OMAP3430_EN_GPT5_SHIFT, | ||
851 | .module_offs = OMAP3430_PER_MOD, | ||
852 | .idlest_reg_id = 1, | ||
853 | .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, | ||
854 | }, | ||
855 | }, | ||
856 | .slaves = omap3xxx_timer5_slaves, | ||
857 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves), | ||
858 | .class = &omap3xxx_timer_hwmod_class, | ||
859 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
860 | }; | ||
861 | |||
862 | /* timer6 */ | ||
863 | static struct omap_hwmod omap3xxx_timer6_hwmod; | ||
864 | static struct omap_hwmod_irq_info omap3xxx_timer6_mpu_irqs[] = { | ||
865 | { .irq = 42, }, | ||
866 | }; | ||
867 | |||
868 | static struct omap_hwmod_addr_space omap3xxx_timer6_addrs[] = { | ||
869 | { | ||
870 | .pa_start = 0x4903A000, | ||
871 | .pa_end = 0x4903A000 + SZ_1K - 1, | ||
872 | .flags = ADDR_TYPE_RT | ||
873 | }, | ||
874 | }; | ||
875 | |||
876 | /* l4_per -> timer6 */ | ||
877 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer6 = { | ||
878 | .master = &omap3xxx_l4_per_hwmod, | ||
879 | .slave = &omap3xxx_timer6_hwmod, | ||
880 | .clk = "gpt6_ick", | ||
881 | .addr = omap3xxx_timer6_addrs, | ||
882 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer6_addrs), | ||
883 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
884 | }; | ||
885 | |||
886 | /* timer6 slave port */ | ||
887 | static struct omap_hwmod_ocp_if *omap3xxx_timer6_slaves[] = { | ||
888 | &omap3xxx_l4_per__timer6, | ||
889 | }; | ||
890 | |||
891 | /* timer6 hwmod */ | ||
892 | static struct omap_hwmod omap3xxx_timer6_hwmod = { | ||
893 | .name = "timer6", | ||
894 | .mpu_irqs = omap3xxx_timer6_mpu_irqs, | ||
895 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer6_mpu_irqs), | ||
896 | .main_clk = "gpt6_fck", | ||
897 | .prcm = { | ||
898 | .omap2 = { | ||
899 | .prcm_reg_id = 1, | ||
900 | .module_bit = OMAP3430_EN_GPT6_SHIFT, | ||
901 | .module_offs = OMAP3430_PER_MOD, | ||
902 | .idlest_reg_id = 1, | ||
903 | .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, | ||
904 | }, | ||
905 | }, | ||
906 | .slaves = omap3xxx_timer6_slaves, | ||
907 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves), | ||
908 | .class = &omap3xxx_timer_hwmod_class, | ||
909 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
910 | }; | ||
911 | |||
912 | /* timer7 */ | ||
913 | static struct omap_hwmod omap3xxx_timer7_hwmod; | ||
914 | static struct omap_hwmod_irq_info omap3xxx_timer7_mpu_irqs[] = { | ||
915 | { .irq = 43, }, | ||
916 | }; | ||
917 | |||
918 | static struct omap_hwmod_addr_space omap3xxx_timer7_addrs[] = { | ||
919 | { | ||
920 | .pa_start = 0x4903C000, | ||
921 | .pa_end = 0x4903C000 + SZ_1K - 1, | ||
922 | .flags = ADDR_TYPE_RT | ||
923 | }, | ||
924 | }; | ||
925 | |||
926 | /* l4_per -> timer7 */ | ||
927 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer7 = { | ||
928 | .master = &omap3xxx_l4_per_hwmod, | ||
929 | .slave = &omap3xxx_timer7_hwmod, | ||
930 | .clk = "gpt7_ick", | ||
931 | .addr = omap3xxx_timer7_addrs, | ||
932 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer7_addrs), | ||
933 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
934 | }; | ||
935 | |||
936 | /* timer7 slave port */ | ||
937 | static struct omap_hwmod_ocp_if *omap3xxx_timer7_slaves[] = { | ||
938 | &omap3xxx_l4_per__timer7, | ||
939 | }; | ||
940 | |||
941 | /* timer7 hwmod */ | ||
942 | static struct omap_hwmod omap3xxx_timer7_hwmod = { | ||
943 | .name = "timer7", | ||
944 | .mpu_irqs = omap3xxx_timer7_mpu_irqs, | ||
945 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer7_mpu_irqs), | ||
946 | .main_clk = "gpt7_fck", | ||
947 | .prcm = { | ||
948 | .omap2 = { | ||
949 | .prcm_reg_id = 1, | ||
950 | .module_bit = OMAP3430_EN_GPT7_SHIFT, | ||
951 | .module_offs = OMAP3430_PER_MOD, | ||
952 | .idlest_reg_id = 1, | ||
953 | .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, | ||
954 | }, | ||
955 | }, | ||
956 | .slaves = omap3xxx_timer7_slaves, | ||
957 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves), | ||
958 | .class = &omap3xxx_timer_hwmod_class, | ||
959 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
960 | }; | ||
961 | |||
962 | /* timer8 */ | ||
963 | static struct omap_hwmod omap3xxx_timer8_hwmod; | ||
964 | static struct omap_hwmod_irq_info omap3xxx_timer8_mpu_irqs[] = { | ||
965 | { .irq = 44, }, | ||
966 | }; | ||
967 | |||
968 | static struct omap_hwmod_addr_space omap3xxx_timer8_addrs[] = { | ||
969 | { | ||
970 | .pa_start = 0x4903E000, | ||
971 | .pa_end = 0x4903E000 + SZ_1K - 1, | ||
972 | .flags = ADDR_TYPE_RT | ||
973 | }, | ||
974 | }; | ||
975 | |||
976 | /* l4_per -> timer8 */ | ||
977 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer8 = { | ||
978 | .master = &omap3xxx_l4_per_hwmod, | ||
979 | .slave = &omap3xxx_timer8_hwmod, | ||
980 | .clk = "gpt8_ick", | ||
981 | .addr = omap3xxx_timer8_addrs, | ||
982 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer8_addrs), | ||
983 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
984 | }; | ||
985 | |||
986 | /* timer8 slave port */ | ||
987 | static struct omap_hwmod_ocp_if *omap3xxx_timer8_slaves[] = { | ||
988 | &omap3xxx_l4_per__timer8, | ||
989 | }; | ||
990 | |||
991 | /* timer8 hwmod */ | ||
992 | static struct omap_hwmod omap3xxx_timer8_hwmod = { | ||
993 | .name = "timer8", | ||
994 | .mpu_irqs = omap3xxx_timer8_mpu_irqs, | ||
995 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer8_mpu_irqs), | ||
996 | .main_clk = "gpt8_fck", | ||
997 | .prcm = { | ||
998 | .omap2 = { | ||
999 | .prcm_reg_id = 1, | ||
1000 | .module_bit = OMAP3430_EN_GPT8_SHIFT, | ||
1001 | .module_offs = OMAP3430_PER_MOD, | ||
1002 | .idlest_reg_id = 1, | ||
1003 | .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT, | ||
1004 | }, | ||
1005 | }, | ||
1006 | .slaves = omap3xxx_timer8_slaves, | ||
1007 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves), | ||
1008 | .class = &omap3xxx_timer_hwmod_class, | ||
1009 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1010 | }; | ||
1011 | |||
1012 | /* timer9 */ | ||
1013 | static struct omap_hwmod omap3xxx_timer9_hwmod; | ||
1014 | static struct omap_hwmod_irq_info omap3xxx_timer9_mpu_irqs[] = { | ||
1015 | { .irq = 45, }, | ||
1016 | }; | ||
1017 | |||
1018 | static struct omap_hwmod_addr_space omap3xxx_timer9_addrs[] = { | ||
1019 | { | ||
1020 | .pa_start = 0x49040000, | ||
1021 | .pa_end = 0x49040000 + SZ_1K - 1, | ||
1022 | .flags = ADDR_TYPE_RT | ||
1023 | }, | ||
1024 | }; | ||
1025 | |||
1026 | /* l4_per -> timer9 */ | ||
1027 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer9 = { | ||
1028 | .master = &omap3xxx_l4_per_hwmod, | ||
1029 | .slave = &omap3xxx_timer9_hwmod, | ||
1030 | .clk = "gpt9_ick", | ||
1031 | .addr = omap3xxx_timer9_addrs, | ||
1032 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer9_addrs), | ||
1033 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1034 | }; | ||
1035 | |||
1036 | /* timer9 slave port */ | ||
1037 | static struct omap_hwmod_ocp_if *omap3xxx_timer9_slaves[] = { | ||
1038 | &omap3xxx_l4_per__timer9, | ||
1039 | }; | ||
1040 | |||
1041 | /* timer9 hwmod */ | ||
1042 | static struct omap_hwmod omap3xxx_timer9_hwmod = { | ||
1043 | .name = "timer9", | ||
1044 | .mpu_irqs = omap3xxx_timer9_mpu_irqs, | ||
1045 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer9_mpu_irqs), | ||
1046 | .main_clk = "gpt9_fck", | ||
1047 | .prcm = { | ||
1048 | .omap2 = { | ||
1049 | .prcm_reg_id = 1, | ||
1050 | .module_bit = OMAP3430_EN_GPT9_SHIFT, | ||
1051 | .module_offs = OMAP3430_PER_MOD, | ||
1052 | .idlest_reg_id = 1, | ||
1053 | .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT, | ||
1054 | }, | ||
1055 | }, | ||
1056 | .slaves = omap3xxx_timer9_slaves, | ||
1057 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves), | ||
1058 | .class = &omap3xxx_timer_hwmod_class, | ||
1059 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1060 | }; | ||
1061 | |||
1062 | /* timer10 */ | ||
1063 | static struct omap_hwmod omap3xxx_timer10_hwmod; | ||
1064 | static struct omap_hwmod_irq_info omap3xxx_timer10_mpu_irqs[] = { | ||
1065 | { .irq = 46, }, | ||
1066 | }; | ||
1067 | |||
1068 | static struct omap_hwmod_addr_space omap3xxx_timer10_addrs[] = { | ||
1069 | { | ||
1070 | .pa_start = 0x48086000, | ||
1071 | .pa_end = 0x48086000 + SZ_1K - 1, | ||
1072 | .flags = ADDR_TYPE_RT | ||
1073 | }, | ||
1074 | }; | ||
1075 | |||
1076 | /* l4_core -> timer10 */ | ||
1077 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer10 = { | ||
1078 | .master = &omap3xxx_l4_core_hwmod, | ||
1079 | .slave = &omap3xxx_timer10_hwmod, | ||
1080 | .clk = "gpt10_ick", | ||
1081 | .addr = omap3xxx_timer10_addrs, | ||
1082 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer10_addrs), | ||
1083 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1084 | }; | ||
1085 | |||
1086 | /* timer10 slave port */ | ||
1087 | static struct omap_hwmod_ocp_if *omap3xxx_timer10_slaves[] = { | ||
1088 | &omap3xxx_l4_core__timer10, | ||
1089 | }; | ||
1090 | |||
1091 | /* timer10 hwmod */ | ||
1092 | static struct omap_hwmod omap3xxx_timer10_hwmod = { | ||
1093 | .name = "timer10", | ||
1094 | .mpu_irqs = omap3xxx_timer10_mpu_irqs, | ||
1095 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer10_mpu_irqs), | ||
1096 | .main_clk = "gpt10_fck", | ||
1097 | .prcm = { | ||
1098 | .omap2 = { | ||
1099 | .prcm_reg_id = 1, | ||
1100 | .module_bit = OMAP3430_EN_GPT10_SHIFT, | ||
1101 | .module_offs = CORE_MOD, | ||
1102 | .idlest_reg_id = 1, | ||
1103 | .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT, | ||
1104 | }, | ||
1105 | }, | ||
1106 | .slaves = omap3xxx_timer10_slaves, | ||
1107 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves), | ||
1108 | .class = &omap3xxx_timer_1ms_hwmod_class, | ||
1109 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1110 | }; | ||
1111 | |||
1112 | /* timer11 */ | ||
1113 | static struct omap_hwmod omap3xxx_timer11_hwmod; | ||
1114 | static struct omap_hwmod_irq_info omap3xxx_timer11_mpu_irqs[] = { | ||
1115 | { .irq = 47, }, | ||
1116 | }; | ||
1117 | |||
1118 | static struct omap_hwmod_addr_space omap3xxx_timer11_addrs[] = { | ||
1119 | { | ||
1120 | .pa_start = 0x48088000, | ||
1121 | .pa_end = 0x48088000 + SZ_1K - 1, | ||
1122 | .flags = ADDR_TYPE_RT | ||
1123 | }, | ||
1124 | }; | ||
1125 | |||
1126 | /* l4_core -> timer11 */ | ||
1127 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer11 = { | ||
1128 | .master = &omap3xxx_l4_core_hwmod, | ||
1129 | .slave = &omap3xxx_timer11_hwmod, | ||
1130 | .clk = "gpt11_ick", | ||
1131 | .addr = omap3xxx_timer11_addrs, | ||
1132 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer11_addrs), | ||
1133 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1134 | }; | ||
1135 | |||
1136 | /* timer11 slave port */ | ||
1137 | static struct omap_hwmod_ocp_if *omap3xxx_timer11_slaves[] = { | ||
1138 | &omap3xxx_l4_core__timer11, | ||
1139 | }; | ||
1140 | |||
1141 | /* timer11 hwmod */ | ||
1142 | static struct omap_hwmod omap3xxx_timer11_hwmod = { | ||
1143 | .name = "timer11", | ||
1144 | .mpu_irqs = omap3xxx_timer11_mpu_irqs, | ||
1145 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer11_mpu_irqs), | ||
1146 | .main_clk = "gpt11_fck", | ||
1147 | .prcm = { | ||
1148 | .omap2 = { | ||
1149 | .prcm_reg_id = 1, | ||
1150 | .module_bit = OMAP3430_EN_GPT11_SHIFT, | ||
1151 | .module_offs = CORE_MOD, | ||
1152 | .idlest_reg_id = 1, | ||
1153 | .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT, | ||
1154 | }, | ||
1155 | }, | ||
1156 | .slaves = omap3xxx_timer11_slaves, | ||
1157 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves), | ||
1158 | .class = &omap3xxx_timer_hwmod_class, | ||
1159 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1160 | }; | ||
1161 | |||
1162 | /* timer12*/ | ||
1163 | static struct omap_hwmod omap3xxx_timer12_hwmod; | ||
1164 | static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = { | ||
1165 | { .irq = 95, }, | ||
1166 | }; | ||
1167 | |||
1168 | static struct omap_hwmod_addr_space omap3xxx_timer12_addrs[] = { | ||
1169 | { | ||
1170 | .pa_start = 0x48304000, | ||
1171 | .pa_end = 0x48304000 + SZ_1K - 1, | ||
1172 | .flags = ADDR_TYPE_RT | ||
1173 | }, | ||
1174 | }; | ||
1175 | |||
1176 | /* l4_core -> timer12 */ | ||
1177 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer12 = { | ||
1178 | .master = &omap3xxx_l4_core_hwmod, | ||
1179 | .slave = &omap3xxx_timer12_hwmod, | ||
1180 | .clk = "gpt12_ick", | ||
1181 | .addr = omap3xxx_timer12_addrs, | ||
1182 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer12_addrs), | ||
1183 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1184 | }; | ||
1185 | |||
1186 | /* timer12 slave port */ | ||
1187 | static struct omap_hwmod_ocp_if *omap3xxx_timer12_slaves[] = { | ||
1188 | &omap3xxx_l4_core__timer12, | ||
1189 | }; | ||
1190 | |||
1191 | /* timer12 hwmod */ | ||
1192 | static struct omap_hwmod omap3xxx_timer12_hwmod = { | ||
1193 | .name = "timer12", | ||
1194 | .mpu_irqs = omap3xxx_timer12_mpu_irqs, | ||
1195 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer12_mpu_irqs), | ||
1196 | .main_clk = "gpt12_fck", | ||
1197 | .prcm = { | ||
1198 | .omap2 = { | ||
1199 | .prcm_reg_id = 1, | ||
1200 | .module_bit = OMAP3430_EN_GPT12_SHIFT, | ||
1201 | .module_offs = WKUP_MOD, | ||
1202 | .idlest_reg_id = 1, | ||
1203 | .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT, | ||
1204 | }, | ||
1205 | }, | ||
1206 | .slaves = omap3xxx_timer12_slaves, | ||
1207 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves), | ||
1208 | .class = &omap3xxx_timer_hwmod_class, | ||
1209 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1210 | }; | ||
1211 | |||
420 | /* l4_wkup -> wd_timer2 */ | 1212 | /* l4_wkup -> wd_timer2 */ |
421 | static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = { | 1213 | static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = { |
422 | { | 1214 | { |
@@ -447,7 +1239,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = { | |||
447 | .syss_offs = 0x0014, | 1239 | .syss_offs = 0x0014, |
448 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE | | 1240 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE | |
449 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | 1241 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | |
450 | SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY), | 1242 | SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | |
1243 | SYSS_HAS_RESET_STATUS), | ||
451 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1244 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
452 | .sysc_fields = &omap_hwmod_sysc_type1, | 1245 | .sysc_fields = &omap_hwmod_sysc_type1, |
453 | }; | 1246 | }; |
@@ -459,7 +1252,7 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = { | |||
459 | .syss_offs = 0x10, | 1252 | .syss_offs = 0x10, |
460 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | 1253 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | |
461 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | 1254 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | |
462 | SYSC_HAS_AUTOIDLE), | 1255 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
463 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1256 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
464 | .sysc_fields = &omap_hwmod_sysc_type1, | 1257 | .sysc_fields = &omap_hwmod_sysc_type1, |
465 | }; | 1258 | }; |
@@ -491,6 +1284,11 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = { | |||
491 | .slaves = omap3xxx_wd_timer2_slaves, | 1284 | .slaves = omap3xxx_wd_timer2_slaves, |
492 | .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), | 1285 | .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), |
493 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 1286 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
1287 | /* | ||
1288 | * XXX: Use software supervised mode, HW supervised smartidle seems to | ||
1289 | * block CORE power domain idle transitions. Maybe a HW bug in wdt2? | ||
1290 | */ | ||
1291 | .flags = HWMOD_SWSUP_SIDLE, | ||
494 | }; | 1292 | }; |
495 | 1293 | ||
496 | /* UART common */ | 1294 | /* UART common */ |
@@ -501,7 +1299,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = { | |||
501 | .syss_offs = 0x58, | 1299 | .syss_offs = 0x58, |
502 | .sysc_flags = (SYSC_HAS_SIDLEMODE | | 1300 | .sysc_flags = (SYSC_HAS_SIDLEMODE | |
503 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | 1301 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | |
504 | SYSC_HAS_AUTOIDLE), | 1302 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), |
505 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 1303 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
506 | .sysc_fields = &omap_hwmod_sysc_type1, | 1304 | .sysc_fields = &omap_hwmod_sysc_type1, |
507 | }; | 1305 | }; |
@@ -664,6 +1462,411 @@ static struct omap_hwmod_class i2c_class = { | |||
664 | .sysc = &i2c_sysc, | 1462 | .sysc = &i2c_sysc, |
665 | }; | 1463 | }; |
666 | 1464 | ||
1465 | /* | ||
1466 | * 'dss' class | ||
1467 | * display sub-system | ||
1468 | */ | ||
1469 | |||
1470 | static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = { | ||
1471 | .rev_offs = 0x0000, | ||
1472 | .sysc_offs = 0x0010, | ||
1473 | .syss_offs = 0x0014, | ||
1474 | .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1475 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1476 | }; | ||
1477 | |||
1478 | static struct omap_hwmod_class omap3xxx_dss_hwmod_class = { | ||
1479 | .name = "dss", | ||
1480 | .sysc = &omap3xxx_dss_sysc, | ||
1481 | }; | ||
1482 | |||
1483 | /* dss */ | ||
1484 | static struct omap_hwmod_irq_info omap3xxx_dss_irqs[] = { | ||
1485 | { .irq = 25 }, | ||
1486 | }; | ||
1487 | |||
1488 | static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = { | ||
1489 | { .name = "dispc", .dma_req = 5 }, | ||
1490 | { .name = "dsi1", .dma_req = 74 }, | ||
1491 | }; | ||
1492 | |||
1493 | /* dss */ | ||
1494 | /* dss master ports */ | ||
1495 | static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = { | ||
1496 | &omap3xxx_dss__l3, | ||
1497 | }; | ||
1498 | |||
1499 | static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = { | ||
1500 | { | ||
1501 | .pa_start = 0x48050000, | ||
1502 | .pa_end = 0x480503FF, | ||
1503 | .flags = ADDR_TYPE_RT | ||
1504 | }, | ||
1505 | }; | ||
1506 | |||
1507 | /* l4_core -> dss */ | ||
1508 | static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = { | ||
1509 | .master = &omap3xxx_l4_core_hwmod, | ||
1510 | .slave = &omap3430es1_dss_core_hwmod, | ||
1511 | .clk = "dss_ick", | ||
1512 | .addr = omap3xxx_dss_addrs, | ||
1513 | .addr_cnt = ARRAY_SIZE(omap3xxx_dss_addrs), | ||
1514 | .fw = { | ||
1515 | .omap2 = { | ||
1516 | .l4_fw_region = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION, | ||
1517 | .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP, | ||
1518 | .flags = OMAP_FIREWALL_L4, | ||
1519 | } | ||
1520 | }, | ||
1521 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1522 | }; | ||
1523 | |||
1524 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = { | ||
1525 | .master = &omap3xxx_l4_core_hwmod, | ||
1526 | .slave = &omap3xxx_dss_core_hwmod, | ||
1527 | .clk = "dss_ick", | ||
1528 | .addr = omap3xxx_dss_addrs, | ||
1529 | .addr_cnt = ARRAY_SIZE(omap3xxx_dss_addrs), | ||
1530 | .fw = { | ||
1531 | .omap2 = { | ||
1532 | .l4_fw_region = OMAP3_L4_CORE_FW_DSS_CORE_REGION, | ||
1533 | .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP, | ||
1534 | .flags = OMAP_FIREWALL_L4, | ||
1535 | } | ||
1536 | }, | ||
1537 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1538 | }; | ||
1539 | |||
1540 | /* dss slave ports */ | ||
1541 | static struct omap_hwmod_ocp_if *omap3430es1_dss_slaves[] = { | ||
1542 | &omap3430es1_l4_core__dss, | ||
1543 | }; | ||
1544 | |||
1545 | static struct omap_hwmod_ocp_if *omap3xxx_dss_slaves[] = { | ||
1546 | &omap3xxx_l4_core__dss, | ||
1547 | }; | ||
1548 | |||
1549 | static struct omap_hwmod_opt_clk dss_opt_clks[] = { | ||
1550 | { .role = "tv_clk", .clk = "dss_tv_fck" }, | ||
1551 | { .role = "dssclk", .clk = "dss_96m_fck" }, | ||
1552 | { .role = "sys_clk", .clk = "dss2_alwon_fck" }, | ||
1553 | }; | ||
1554 | |||
1555 | static struct omap_hwmod omap3430es1_dss_core_hwmod = { | ||
1556 | .name = "dss_core", | ||
1557 | .class = &omap3xxx_dss_hwmod_class, | ||
1558 | .main_clk = "dss1_alwon_fck", /* instead of dss_fck */ | ||
1559 | .mpu_irqs = omap3xxx_dss_irqs, | ||
1560 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dss_irqs), | ||
1561 | .sdma_reqs = omap3xxx_dss_sdma_chs, | ||
1562 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_dss_sdma_chs), | ||
1563 | |||
1564 | .prcm = { | ||
1565 | .omap2 = { | ||
1566 | .prcm_reg_id = 1, | ||
1567 | .module_bit = OMAP3430_EN_DSS1_SHIFT, | ||
1568 | .module_offs = OMAP3430_DSS_MOD, | ||
1569 | .idlest_reg_id = 1, | ||
1570 | .idlest_stdby_bit = OMAP3430ES1_ST_DSS_SHIFT, | ||
1571 | }, | ||
1572 | }, | ||
1573 | .opt_clks = dss_opt_clks, | ||
1574 | .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks), | ||
1575 | .slaves = omap3430es1_dss_slaves, | ||
1576 | .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves), | ||
1577 | .masters = omap3xxx_dss_masters, | ||
1578 | .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), | ||
1579 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), | ||
1580 | .flags = HWMOD_NO_IDLEST, | ||
1581 | }; | ||
1582 | |||
1583 | static struct omap_hwmod omap3xxx_dss_core_hwmod = { | ||
1584 | .name = "dss_core", | ||
1585 | .class = &omap3xxx_dss_hwmod_class, | ||
1586 | .main_clk = "dss1_alwon_fck", /* instead of dss_fck */ | ||
1587 | .mpu_irqs = omap3xxx_dss_irqs, | ||
1588 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dss_irqs), | ||
1589 | .sdma_reqs = omap3xxx_dss_sdma_chs, | ||
1590 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_dss_sdma_chs), | ||
1591 | |||
1592 | .prcm = { | ||
1593 | .omap2 = { | ||
1594 | .prcm_reg_id = 1, | ||
1595 | .module_bit = OMAP3430_EN_DSS1_SHIFT, | ||
1596 | .module_offs = OMAP3430_DSS_MOD, | ||
1597 | .idlest_reg_id = 1, | ||
1598 | .idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT, | ||
1599 | .idlest_stdby_bit = OMAP3430ES2_ST_DSS_STDBY_SHIFT, | ||
1600 | }, | ||
1601 | }, | ||
1602 | .opt_clks = dss_opt_clks, | ||
1603 | .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks), | ||
1604 | .slaves = omap3xxx_dss_slaves, | ||
1605 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves), | ||
1606 | .masters = omap3xxx_dss_masters, | ||
1607 | .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), | ||
1608 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2 | | ||
1609 | CHIP_IS_OMAP3630ES1 | CHIP_GE_OMAP3630ES1_1), | ||
1610 | }; | ||
1611 | |||
1612 | /* | ||
1613 | * 'dispc' class | ||
1614 | * display controller | ||
1615 | */ | ||
1616 | |||
1617 | static struct omap_hwmod_class_sysconfig omap3xxx_dispc_sysc = { | ||
1618 | .rev_offs = 0x0000, | ||
1619 | .sysc_offs = 0x0010, | ||
1620 | .syss_offs = 0x0014, | ||
1621 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
1622 | SYSC_HAS_MIDLEMODE | SYSC_HAS_ENAWAKEUP | | ||
1623 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
1624 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
1625 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
1626 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1627 | }; | ||
1628 | |||
1629 | static struct omap_hwmod_class omap3xxx_dispc_hwmod_class = { | ||
1630 | .name = "dispc", | ||
1631 | .sysc = &omap3xxx_dispc_sysc, | ||
1632 | }; | ||
1633 | |||
1634 | static struct omap_hwmod_addr_space omap3xxx_dss_dispc_addrs[] = { | ||
1635 | { | ||
1636 | .pa_start = 0x48050400, | ||
1637 | .pa_end = 0x480507FF, | ||
1638 | .flags = ADDR_TYPE_RT | ||
1639 | }, | ||
1640 | }; | ||
1641 | |||
1642 | /* l4_core -> dss_dispc */ | ||
1643 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dispc = { | ||
1644 | .master = &omap3xxx_l4_core_hwmod, | ||
1645 | .slave = &omap3xxx_dss_dispc_hwmod, | ||
1646 | .clk = "dss_ick", | ||
1647 | .addr = omap3xxx_dss_dispc_addrs, | ||
1648 | .addr_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_addrs), | ||
1649 | .fw = { | ||
1650 | .omap2 = { | ||
1651 | .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DISPC_REGION, | ||
1652 | .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP, | ||
1653 | .flags = OMAP_FIREWALL_L4, | ||
1654 | } | ||
1655 | }, | ||
1656 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1657 | }; | ||
1658 | |||
1659 | /* dss_dispc slave ports */ | ||
1660 | static struct omap_hwmod_ocp_if *omap3xxx_dss_dispc_slaves[] = { | ||
1661 | &omap3xxx_l4_core__dss_dispc, | ||
1662 | }; | ||
1663 | |||
1664 | static struct omap_hwmod omap3xxx_dss_dispc_hwmod = { | ||
1665 | .name = "dss_dispc", | ||
1666 | .class = &omap3xxx_dispc_hwmod_class, | ||
1667 | .main_clk = "dss1_alwon_fck", | ||
1668 | .prcm = { | ||
1669 | .omap2 = { | ||
1670 | .prcm_reg_id = 1, | ||
1671 | .module_bit = OMAP3430_EN_DSS1_SHIFT, | ||
1672 | .module_offs = OMAP3430_DSS_MOD, | ||
1673 | }, | ||
1674 | }, | ||
1675 | .slaves = omap3xxx_dss_dispc_slaves, | ||
1676 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves), | ||
1677 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1678 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1679 | CHIP_GE_OMAP3630ES1_1), | ||
1680 | .flags = HWMOD_NO_IDLEST, | ||
1681 | }; | ||
1682 | |||
1683 | /* | ||
1684 | * 'dsi' class | ||
1685 | * display serial interface controller | ||
1686 | */ | ||
1687 | |||
1688 | static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = { | ||
1689 | .name = "dsi", | ||
1690 | }; | ||
1691 | |||
1692 | /* dss_dsi1 */ | ||
1693 | static struct omap_hwmod_addr_space omap3xxx_dss_dsi1_addrs[] = { | ||
1694 | { | ||
1695 | .pa_start = 0x4804FC00, | ||
1696 | .pa_end = 0x4804FFFF, | ||
1697 | .flags = ADDR_TYPE_RT | ||
1698 | }, | ||
1699 | }; | ||
1700 | |||
1701 | /* l4_core -> dss_dsi1 */ | ||
1702 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = { | ||
1703 | .master = &omap3xxx_l4_core_hwmod, | ||
1704 | .slave = &omap3xxx_dss_dsi1_hwmod, | ||
1705 | .addr = omap3xxx_dss_dsi1_addrs, | ||
1706 | .addr_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_addrs), | ||
1707 | .fw = { | ||
1708 | .omap2 = { | ||
1709 | .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DSI_REGION, | ||
1710 | .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP, | ||
1711 | .flags = OMAP_FIREWALL_L4, | ||
1712 | } | ||
1713 | }, | ||
1714 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1715 | }; | ||
1716 | |||
1717 | /* dss_dsi1 slave ports */ | ||
1718 | static struct omap_hwmod_ocp_if *omap3xxx_dss_dsi1_slaves[] = { | ||
1719 | &omap3xxx_l4_core__dss_dsi1, | ||
1720 | }; | ||
1721 | |||
1722 | static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = { | ||
1723 | .name = "dss_dsi1", | ||
1724 | .class = &omap3xxx_dsi_hwmod_class, | ||
1725 | .main_clk = "dss1_alwon_fck", | ||
1726 | .prcm = { | ||
1727 | .omap2 = { | ||
1728 | .prcm_reg_id = 1, | ||
1729 | .module_bit = OMAP3430_EN_DSS1_SHIFT, | ||
1730 | .module_offs = OMAP3430_DSS_MOD, | ||
1731 | }, | ||
1732 | }, | ||
1733 | .slaves = omap3xxx_dss_dsi1_slaves, | ||
1734 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves), | ||
1735 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1736 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1737 | CHIP_GE_OMAP3630ES1_1), | ||
1738 | .flags = HWMOD_NO_IDLEST, | ||
1739 | }; | ||
1740 | |||
1741 | /* | ||
1742 | * 'rfbi' class | ||
1743 | * remote frame buffer interface | ||
1744 | */ | ||
1745 | |||
1746 | static struct omap_hwmod_class_sysconfig omap3xxx_rfbi_sysc = { | ||
1747 | .rev_offs = 0x0000, | ||
1748 | .sysc_offs = 0x0010, | ||
1749 | .syss_offs = 0x0014, | ||
1750 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | ||
1751 | SYSC_HAS_AUTOIDLE), | ||
1752 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1753 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1754 | }; | ||
1755 | |||
1756 | static struct omap_hwmod_class omap3xxx_rfbi_hwmod_class = { | ||
1757 | .name = "rfbi", | ||
1758 | .sysc = &omap3xxx_rfbi_sysc, | ||
1759 | }; | ||
1760 | |||
1761 | static struct omap_hwmod_addr_space omap3xxx_dss_rfbi_addrs[] = { | ||
1762 | { | ||
1763 | .pa_start = 0x48050800, | ||
1764 | .pa_end = 0x48050BFF, | ||
1765 | .flags = ADDR_TYPE_RT | ||
1766 | }, | ||
1767 | }; | ||
1768 | |||
1769 | /* l4_core -> dss_rfbi */ | ||
1770 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_rfbi = { | ||
1771 | .master = &omap3xxx_l4_core_hwmod, | ||
1772 | .slave = &omap3xxx_dss_rfbi_hwmod, | ||
1773 | .clk = "dss_ick", | ||
1774 | .addr = omap3xxx_dss_rfbi_addrs, | ||
1775 | .addr_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_addrs), | ||
1776 | .fw = { | ||
1777 | .omap2 = { | ||
1778 | .l4_fw_region = OMAP3_L4_CORE_FW_DSS_RFBI_REGION, | ||
1779 | .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP , | ||
1780 | .flags = OMAP_FIREWALL_L4, | ||
1781 | } | ||
1782 | }, | ||
1783 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1784 | }; | ||
1785 | |||
1786 | /* dss_rfbi slave ports */ | ||
1787 | static struct omap_hwmod_ocp_if *omap3xxx_dss_rfbi_slaves[] = { | ||
1788 | &omap3xxx_l4_core__dss_rfbi, | ||
1789 | }; | ||
1790 | |||
1791 | static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = { | ||
1792 | .name = "dss_rfbi", | ||
1793 | .class = &omap3xxx_rfbi_hwmod_class, | ||
1794 | .main_clk = "dss1_alwon_fck", | ||
1795 | .prcm = { | ||
1796 | .omap2 = { | ||
1797 | .prcm_reg_id = 1, | ||
1798 | .module_bit = OMAP3430_EN_DSS1_SHIFT, | ||
1799 | .module_offs = OMAP3430_DSS_MOD, | ||
1800 | }, | ||
1801 | }, | ||
1802 | .slaves = omap3xxx_dss_rfbi_slaves, | ||
1803 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves), | ||
1804 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1805 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1806 | CHIP_GE_OMAP3630ES1_1), | ||
1807 | .flags = HWMOD_NO_IDLEST, | ||
1808 | }; | ||
1809 | |||
1810 | /* | ||
1811 | * 'venc' class | ||
1812 | * video encoder | ||
1813 | */ | ||
1814 | |||
1815 | static struct omap_hwmod_class omap3xxx_venc_hwmod_class = { | ||
1816 | .name = "venc", | ||
1817 | }; | ||
1818 | |||
1819 | /* dss_venc */ | ||
1820 | static struct omap_hwmod_addr_space omap3xxx_dss_venc_addrs[] = { | ||
1821 | { | ||
1822 | .pa_start = 0x48050C00, | ||
1823 | .pa_end = 0x48050FFF, | ||
1824 | .flags = ADDR_TYPE_RT | ||
1825 | }, | ||
1826 | }; | ||
1827 | |||
1828 | /* l4_core -> dss_venc */ | ||
1829 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = { | ||
1830 | .master = &omap3xxx_l4_core_hwmod, | ||
1831 | .slave = &omap3xxx_dss_venc_hwmod, | ||
1832 | .clk = "dss_tv_fck", | ||
1833 | .addr = omap3xxx_dss_venc_addrs, | ||
1834 | .addr_cnt = ARRAY_SIZE(omap3xxx_dss_venc_addrs), | ||
1835 | .fw = { | ||
1836 | .omap2 = { | ||
1837 | .l4_fw_region = OMAP3_L4_CORE_FW_DSS_VENC_REGION, | ||
1838 | .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP, | ||
1839 | .flags = OMAP_FIREWALL_L4, | ||
1840 | } | ||
1841 | }, | ||
1842 | .flags = OCPIF_SWSUP_IDLE, | ||
1843 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
1844 | }; | ||
1845 | |||
1846 | /* dss_venc slave ports */ | ||
1847 | static struct omap_hwmod_ocp_if *omap3xxx_dss_venc_slaves[] = { | ||
1848 | &omap3xxx_l4_core__dss_venc, | ||
1849 | }; | ||
1850 | |||
1851 | static struct omap_hwmod omap3xxx_dss_venc_hwmod = { | ||
1852 | .name = "dss_venc", | ||
1853 | .class = &omap3xxx_venc_hwmod_class, | ||
1854 | .main_clk = "dss1_alwon_fck", | ||
1855 | .prcm = { | ||
1856 | .omap2 = { | ||
1857 | .prcm_reg_id = 1, | ||
1858 | .module_bit = OMAP3430_EN_DSS1_SHIFT, | ||
1859 | .module_offs = OMAP3430_DSS_MOD, | ||
1860 | }, | ||
1861 | }, | ||
1862 | .slaves = omap3xxx_dss_venc_slaves, | ||
1863 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves), | ||
1864 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1865 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1866 | CHIP_GE_OMAP3630ES1_1), | ||
1867 | .flags = HWMOD_NO_IDLEST, | ||
1868 | }; | ||
1869 | |||
667 | /* I2C1 */ | 1870 | /* I2C1 */ |
668 | 1871 | ||
669 | static struct omap_i2c_dev_attr i2c1_dev_attr = { | 1872 | static struct omap_i2c_dev_attr i2c1_dev_attr = { |
@@ -902,7 +2105,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = { | |||
902 | .sysc_offs = 0x0010, | 2105 | .sysc_offs = 0x0010, |
903 | .syss_offs = 0x0014, | 2106 | .syss_offs = 0x0014, |
904 | .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | | 2107 | .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | |
905 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | 2108 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE | |
2109 | SYSS_HAS_RESET_STATUS), | ||
906 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | 2110 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
907 | .sysc_fields = &omap_hwmod_sysc_type1, | 2111 | .sysc_fields = &omap_hwmod_sysc_type1, |
908 | }; | 2112 | }; |
@@ -1156,7 +2360,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_dma_sysc = { | |||
1156 | .syss_offs = 0x0028, | 2360 | .syss_offs = 0x0028, |
1157 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | 2361 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | |
1158 | SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | 2362 | SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY | |
1159 | SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE), | 2363 | SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE | |
2364 | SYSS_HAS_RESET_STATUS), | ||
1160 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | 2365 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | |
1161 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | 2366 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), |
1162 | .sysc_fields = &omap_hwmod_sysc_type1, | 2367 | .sysc_fields = &omap_hwmod_sysc_type1, |
@@ -1227,6 +2432,437 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = { | |||
1227 | .flags = HWMOD_NO_IDLEST, | 2432 | .flags = HWMOD_NO_IDLEST, |
1228 | }; | 2433 | }; |
1229 | 2434 | ||
2435 | /* | ||
2436 | * 'mcbsp' class | ||
2437 | * multi channel buffered serial port controller | ||
2438 | */ | ||
2439 | |||
2440 | static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sysc = { | ||
2441 | .sysc_offs = 0x008c, | ||
2442 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP | | ||
2443 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
2444 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
2445 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2446 | .clockact = 0x2, | ||
2447 | }; | ||
2448 | |||
2449 | static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = { | ||
2450 | .name = "mcbsp", | ||
2451 | .sysc = &omap3xxx_mcbsp_sysc, | ||
2452 | .rev = MCBSP_CONFIG_TYPE3, | ||
2453 | }; | ||
2454 | |||
2455 | /* mcbsp1 */ | ||
2456 | static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { | ||
2457 | { .name = "irq", .irq = 16 }, | ||
2458 | { .name = "tx", .irq = 59 }, | ||
2459 | { .name = "rx", .irq = 60 }, | ||
2460 | }; | ||
2461 | |||
2462 | static struct omap_hwmod_dma_info omap3xxx_mcbsp1_sdma_chs[] = { | ||
2463 | { .name = "rx", .dma_req = 32 }, | ||
2464 | { .name = "tx", .dma_req = 31 }, | ||
2465 | }; | ||
2466 | |||
2467 | static struct omap_hwmod_addr_space omap3xxx_mcbsp1_addrs[] = { | ||
2468 | { | ||
2469 | .name = "mpu", | ||
2470 | .pa_start = 0x48074000, | ||
2471 | .pa_end = 0x480740ff, | ||
2472 | .flags = ADDR_TYPE_RT | ||
2473 | }, | ||
2474 | }; | ||
2475 | |||
2476 | /* l4_core -> mcbsp1 */ | ||
2477 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp1 = { | ||
2478 | .master = &omap3xxx_l4_core_hwmod, | ||
2479 | .slave = &omap3xxx_mcbsp1_hwmod, | ||
2480 | .clk = "mcbsp1_ick", | ||
2481 | .addr = omap3xxx_mcbsp1_addrs, | ||
2482 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_addrs), | ||
2483 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2484 | }; | ||
2485 | |||
2486 | /* mcbsp1 slave ports */ | ||
2487 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp1_slaves[] = { | ||
2488 | &omap3xxx_l4_core__mcbsp1, | ||
2489 | }; | ||
2490 | |||
2491 | static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { | ||
2492 | .name = "mcbsp1", | ||
2493 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
2494 | .mpu_irqs = omap3xxx_mcbsp1_irqs, | ||
2495 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_irqs), | ||
2496 | .sdma_reqs = omap3xxx_mcbsp1_sdma_chs, | ||
2497 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_sdma_chs), | ||
2498 | .main_clk = "mcbsp1_fck", | ||
2499 | .prcm = { | ||
2500 | .omap2 = { | ||
2501 | .prcm_reg_id = 1, | ||
2502 | .module_bit = OMAP3430_EN_MCBSP1_SHIFT, | ||
2503 | .module_offs = CORE_MOD, | ||
2504 | .idlest_reg_id = 1, | ||
2505 | .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT, | ||
2506 | }, | ||
2507 | }, | ||
2508 | .slaves = omap3xxx_mcbsp1_slaves, | ||
2509 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves), | ||
2510 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2511 | }; | ||
2512 | |||
2513 | /* mcbsp2 */ | ||
2514 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = { | ||
2515 | { .name = "irq", .irq = 17 }, | ||
2516 | { .name = "tx", .irq = 62 }, | ||
2517 | { .name = "rx", .irq = 63 }, | ||
2518 | }; | ||
2519 | |||
2520 | static struct omap_hwmod_dma_info omap3xxx_mcbsp2_sdma_chs[] = { | ||
2521 | { .name = "rx", .dma_req = 34 }, | ||
2522 | { .name = "tx", .dma_req = 33 }, | ||
2523 | }; | ||
2524 | |||
2525 | static struct omap_hwmod_addr_space omap3xxx_mcbsp2_addrs[] = { | ||
2526 | { | ||
2527 | .name = "mpu", | ||
2528 | .pa_start = 0x49022000, | ||
2529 | .pa_end = 0x490220ff, | ||
2530 | .flags = ADDR_TYPE_RT | ||
2531 | }, | ||
2532 | }; | ||
2533 | |||
2534 | /* l4_per -> mcbsp2 */ | ||
2535 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2 = { | ||
2536 | .master = &omap3xxx_l4_per_hwmod, | ||
2537 | .slave = &omap3xxx_mcbsp2_hwmod, | ||
2538 | .clk = "mcbsp2_ick", | ||
2539 | .addr = omap3xxx_mcbsp2_addrs, | ||
2540 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_addrs), | ||
2541 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2542 | }; | ||
2543 | |||
2544 | /* mcbsp2 slave ports */ | ||
2545 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_slaves[] = { | ||
2546 | &omap3xxx_l4_per__mcbsp2, | ||
2547 | }; | ||
2548 | |||
2549 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { | ||
2550 | .sidetone = "mcbsp2_sidetone", | ||
2551 | }; | ||
2552 | |||
2553 | static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { | ||
2554 | .name = "mcbsp2", | ||
2555 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
2556 | .mpu_irqs = omap3xxx_mcbsp2_irqs, | ||
2557 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_irqs), | ||
2558 | .sdma_reqs = omap3xxx_mcbsp2_sdma_chs, | ||
2559 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sdma_chs), | ||
2560 | .main_clk = "mcbsp2_fck", | ||
2561 | .prcm = { | ||
2562 | .omap2 = { | ||
2563 | .prcm_reg_id = 1, | ||
2564 | .module_bit = OMAP3430_EN_MCBSP2_SHIFT, | ||
2565 | .module_offs = OMAP3430_PER_MOD, | ||
2566 | .idlest_reg_id = 1, | ||
2567 | .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, | ||
2568 | }, | ||
2569 | }, | ||
2570 | .slaves = omap3xxx_mcbsp2_slaves, | ||
2571 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves), | ||
2572 | .dev_attr = &omap34xx_mcbsp2_dev_attr, | ||
2573 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2574 | }; | ||
2575 | |||
2576 | /* mcbsp3 */ | ||
2577 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = { | ||
2578 | { .name = "irq", .irq = 22 }, | ||
2579 | { .name = "tx", .irq = 89 }, | ||
2580 | { .name = "rx", .irq = 90 }, | ||
2581 | }; | ||
2582 | |||
2583 | static struct omap_hwmod_dma_info omap3xxx_mcbsp3_sdma_chs[] = { | ||
2584 | { .name = "rx", .dma_req = 18 }, | ||
2585 | { .name = "tx", .dma_req = 17 }, | ||
2586 | }; | ||
2587 | |||
2588 | static struct omap_hwmod_addr_space omap3xxx_mcbsp3_addrs[] = { | ||
2589 | { | ||
2590 | .name = "mpu", | ||
2591 | .pa_start = 0x49024000, | ||
2592 | .pa_end = 0x490240ff, | ||
2593 | .flags = ADDR_TYPE_RT | ||
2594 | }, | ||
2595 | }; | ||
2596 | |||
2597 | /* l4_per -> mcbsp3 */ | ||
2598 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3 = { | ||
2599 | .master = &omap3xxx_l4_per_hwmod, | ||
2600 | .slave = &omap3xxx_mcbsp3_hwmod, | ||
2601 | .clk = "mcbsp3_ick", | ||
2602 | .addr = omap3xxx_mcbsp3_addrs, | ||
2603 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_addrs), | ||
2604 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2605 | }; | ||
2606 | |||
2607 | /* mcbsp3 slave ports */ | ||
2608 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_slaves[] = { | ||
2609 | &omap3xxx_l4_per__mcbsp3, | ||
2610 | }; | ||
2611 | |||
2612 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { | ||
2613 | .sidetone = "mcbsp3_sidetone", | ||
2614 | }; | ||
2615 | |||
2616 | static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { | ||
2617 | .name = "mcbsp3", | ||
2618 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
2619 | .mpu_irqs = omap3xxx_mcbsp3_irqs, | ||
2620 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_irqs), | ||
2621 | .sdma_reqs = omap3xxx_mcbsp3_sdma_chs, | ||
2622 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sdma_chs), | ||
2623 | .main_clk = "mcbsp3_fck", | ||
2624 | .prcm = { | ||
2625 | .omap2 = { | ||
2626 | .prcm_reg_id = 1, | ||
2627 | .module_bit = OMAP3430_EN_MCBSP3_SHIFT, | ||
2628 | .module_offs = OMAP3430_PER_MOD, | ||
2629 | .idlest_reg_id = 1, | ||
2630 | .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, | ||
2631 | }, | ||
2632 | }, | ||
2633 | .slaves = omap3xxx_mcbsp3_slaves, | ||
2634 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves), | ||
2635 | .dev_attr = &omap34xx_mcbsp3_dev_attr, | ||
2636 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2637 | }; | ||
2638 | |||
2639 | /* mcbsp4 */ | ||
2640 | static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = { | ||
2641 | { .name = "irq", .irq = 23 }, | ||
2642 | { .name = "tx", .irq = 54 }, | ||
2643 | { .name = "rx", .irq = 55 }, | ||
2644 | }; | ||
2645 | |||
2646 | static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = { | ||
2647 | { .name = "rx", .dma_req = 20 }, | ||
2648 | { .name = "tx", .dma_req = 19 }, | ||
2649 | }; | ||
2650 | |||
2651 | static struct omap_hwmod_addr_space omap3xxx_mcbsp4_addrs[] = { | ||
2652 | { | ||
2653 | .name = "mpu", | ||
2654 | .pa_start = 0x49026000, | ||
2655 | .pa_end = 0x490260ff, | ||
2656 | .flags = ADDR_TYPE_RT | ||
2657 | }, | ||
2658 | }; | ||
2659 | |||
2660 | /* l4_per -> mcbsp4 */ | ||
2661 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp4 = { | ||
2662 | .master = &omap3xxx_l4_per_hwmod, | ||
2663 | .slave = &omap3xxx_mcbsp4_hwmod, | ||
2664 | .clk = "mcbsp4_ick", | ||
2665 | .addr = omap3xxx_mcbsp4_addrs, | ||
2666 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_addrs), | ||
2667 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2668 | }; | ||
2669 | |||
2670 | /* mcbsp4 slave ports */ | ||
2671 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp4_slaves[] = { | ||
2672 | &omap3xxx_l4_per__mcbsp4, | ||
2673 | }; | ||
2674 | |||
2675 | static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { | ||
2676 | .name = "mcbsp4", | ||
2677 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
2678 | .mpu_irqs = omap3xxx_mcbsp4_irqs, | ||
2679 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_irqs), | ||
2680 | .sdma_reqs = omap3xxx_mcbsp4_sdma_chs, | ||
2681 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_sdma_chs), | ||
2682 | .main_clk = "mcbsp4_fck", | ||
2683 | .prcm = { | ||
2684 | .omap2 = { | ||
2685 | .prcm_reg_id = 1, | ||
2686 | .module_bit = OMAP3430_EN_MCBSP4_SHIFT, | ||
2687 | .module_offs = OMAP3430_PER_MOD, | ||
2688 | .idlest_reg_id = 1, | ||
2689 | .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT, | ||
2690 | }, | ||
2691 | }, | ||
2692 | .slaves = omap3xxx_mcbsp4_slaves, | ||
2693 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves), | ||
2694 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2695 | }; | ||
2696 | |||
2697 | /* mcbsp5 */ | ||
2698 | static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = { | ||
2699 | { .name = "irq", .irq = 27 }, | ||
2700 | { .name = "tx", .irq = 81 }, | ||
2701 | { .name = "rx", .irq = 82 }, | ||
2702 | }; | ||
2703 | |||
2704 | static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = { | ||
2705 | { .name = "rx", .dma_req = 22 }, | ||
2706 | { .name = "tx", .dma_req = 21 }, | ||
2707 | }; | ||
2708 | |||
2709 | static struct omap_hwmod_addr_space omap3xxx_mcbsp5_addrs[] = { | ||
2710 | { | ||
2711 | .name = "mpu", | ||
2712 | .pa_start = 0x48096000, | ||
2713 | .pa_end = 0x480960ff, | ||
2714 | .flags = ADDR_TYPE_RT | ||
2715 | }, | ||
2716 | }; | ||
2717 | |||
2718 | /* l4_core -> mcbsp5 */ | ||
2719 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp5 = { | ||
2720 | .master = &omap3xxx_l4_core_hwmod, | ||
2721 | .slave = &omap3xxx_mcbsp5_hwmod, | ||
2722 | .clk = "mcbsp5_ick", | ||
2723 | .addr = omap3xxx_mcbsp5_addrs, | ||
2724 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_addrs), | ||
2725 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2726 | }; | ||
2727 | |||
2728 | /* mcbsp5 slave ports */ | ||
2729 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp5_slaves[] = { | ||
2730 | &omap3xxx_l4_core__mcbsp5, | ||
2731 | }; | ||
2732 | |||
2733 | static struct omap_hwmod omap3xxx_mcbsp5_hwmod = { | ||
2734 | .name = "mcbsp5", | ||
2735 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
2736 | .mpu_irqs = omap3xxx_mcbsp5_irqs, | ||
2737 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_irqs), | ||
2738 | .sdma_reqs = omap3xxx_mcbsp5_sdma_chs, | ||
2739 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_sdma_chs), | ||
2740 | .main_clk = "mcbsp5_fck", | ||
2741 | .prcm = { | ||
2742 | .omap2 = { | ||
2743 | .prcm_reg_id = 1, | ||
2744 | .module_bit = OMAP3430_EN_MCBSP5_SHIFT, | ||
2745 | .module_offs = CORE_MOD, | ||
2746 | .idlest_reg_id = 1, | ||
2747 | .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT, | ||
2748 | }, | ||
2749 | }, | ||
2750 | .slaves = omap3xxx_mcbsp5_slaves, | ||
2751 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves), | ||
2752 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2753 | }; | ||
2754 | /* 'mcbsp sidetone' class */ | ||
2755 | |||
2756 | static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sidetone_sysc = { | ||
2757 | .sysc_offs = 0x0010, | ||
2758 | .sysc_flags = SYSC_HAS_AUTOIDLE, | ||
2759 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2760 | }; | ||
2761 | |||
2762 | static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = { | ||
2763 | .name = "mcbsp_sidetone", | ||
2764 | .sysc = &omap3xxx_mcbsp_sidetone_sysc, | ||
2765 | }; | ||
2766 | |||
2767 | /* mcbsp2_sidetone */ | ||
2768 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = { | ||
2769 | { .name = "irq", .irq = 4 }, | ||
2770 | }; | ||
2771 | |||
2772 | static struct omap_hwmod_addr_space omap3xxx_mcbsp2_sidetone_addrs[] = { | ||
2773 | { | ||
2774 | .name = "sidetone", | ||
2775 | .pa_start = 0x49028000, | ||
2776 | .pa_end = 0x490280ff, | ||
2777 | .flags = ADDR_TYPE_RT | ||
2778 | }, | ||
2779 | }; | ||
2780 | |||
2781 | /* l4_per -> mcbsp2_sidetone */ | ||
2782 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2_sidetone = { | ||
2783 | .master = &omap3xxx_l4_per_hwmod, | ||
2784 | .slave = &omap3xxx_mcbsp2_sidetone_hwmod, | ||
2785 | .clk = "mcbsp2_ick", | ||
2786 | .addr = omap3xxx_mcbsp2_sidetone_addrs, | ||
2787 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_addrs), | ||
2788 | .user = OCP_USER_MPU, | ||
2789 | }; | ||
2790 | |||
2791 | /* mcbsp2_sidetone slave ports */ | ||
2792 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_sidetone_slaves[] = { | ||
2793 | &omap3xxx_l4_per__mcbsp2_sidetone, | ||
2794 | }; | ||
2795 | |||
2796 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { | ||
2797 | .name = "mcbsp2_sidetone", | ||
2798 | .class = &omap3xxx_mcbsp_sidetone_hwmod_class, | ||
2799 | .mpu_irqs = omap3xxx_mcbsp2_sidetone_irqs, | ||
2800 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_irqs), | ||
2801 | .main_clk = "mcbsp2_fck", | ||
2802 | .prcm = { | ||
2803 | .omap2 = { | ||
2804 | .prcm_reg_id = 1, | ||
2805 | .module_bit = OMAP3430_EN_MCBSP2_SHIFT, | ||
2806 | .module_offs = OMAP3430_PER_MOD, | ||
2807 | .idlest_reg_id = 1, | ||
2808 | .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, | ||
2809 | }, | ||
2810 | }, | ||
2811 | .slaves = omap3xxx_mcbsp2_sidetone_slaves, | ||
2812 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves), | ||
2813 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2814 | }; | ||
2815 | |||
2816 | /* mcbsp3_sidetone */ | ||
2817 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = { | ||
2818 | { .name = "irq", .irq = 5 }, | ||
2819 | }; | ||
2820 | |||
2821 | static struct omap_hwmod_addr_space omap3xxx_mcbsp3_sidetone_addrs[] = { | ||
2822 | { | ||
2823 | .name = "sidetone", | ||
2824 | .pa_start = 0x4902A000, | ||
2825 | .pa_end = 0x4902A0ff, | ||
2826 | .flags = ADDR_TYPE_RT | ||
2827 | }, | ||
2828 | }; | ||
2829 | |||
2830 | /* l4_per -> mcbsp3_sidetone */ | ||
2831 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = { | ||
2832 | .master = &omap3xxx_l4_per_hwmod, | ||
2833 | .slave = &omap3xxx_mcbsp3_sidetone_hwmod, | ||
2834 | .clk = "mcbsp3_ick", | ||
2835 | .addr = omap3xxx_mcbsp3_sidetone_addrs, | ||
2836 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_addrs), | ||
2837 | .user = OCP_USER_MPU, | ||
2838 | }; | ||
2839 | |||
2840 | /* mcbsp3_sidetone slave ports */ | ||
2841 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_sidetone_slaves[] = { | ||
2842 | &omap3xxx_l4_per__mcbsp3_sidetone, | ||
2843 | }; | ||
2844 | |||
2845 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { | ||
2846 | .name = "mcbsp3_sidetone", | ||
2847 | .class = &omap3xxx_mcbsp_sidetone_hwmod_class, | ||
2848 | .mpu_irqs = omap3xxx_mcbsp3_sidetone_irqs, | ||
2849 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_irqs), | ||
2850 | .main_clk = "mcbsp3_fck", | ||
2851 | .prcm = { | ||
2852 | .omap2 = { | ||
2853 | .prcm_reg_id = 1, | ||
2854 | .module_bit = OMAP3430_EN_MCBSP3_SHIFT, | ||
2855 | .module_offs = OMAP3430_PER_MOD, | ||
2856 | .idlest_reg_id = 1, | ||
2857 | .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, | ||
2858 | }, | ||
2859 | }, | ||
2860 | .slaves = omap3xxx_mcbsp3_sidetone_slaves, | ||
2861 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves), | ||
2862 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2863 | }; | ||
2864 | |||
2865 | |||
1230 | /* SR common */ | 2866 | /* SR common */ |
1231 | static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { | 2867 | static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { |
1232 | .clkact_shift = 20, | 2868 | .clkact_shift = 20, |
@@ -1356,18 +2992,617 @@ static struct omap_hwmod omap36xx_sr2_hwmod = { | |||
1356 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), | 2992 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), |
1357 | }; | 2993 | }; |
1358 | 2994 | ||
2995 | /* | ||
2996 | * 'mailbox' class | ||
2997 | * mailbox module allowing communication between the on-chip processors | ||
2998 | * using a queued mailbox-interrupt mechanism. | ||
2999 | */ | ||
3000 | |||
3001 | static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = { | ||
3002 | .rev_offs = 0x000, | ||
3003 | .sysc_offs = 0x010, | ||
3004 | .syss_offs = 0x014, | ||
3005 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
3006 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
3007 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
3008 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3009 | }; | ||
3010 | |||
3011 | static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = { | ||
3012 | .name = "mailbox", | ||
3013 | .sysc = &omap3xxx_mailbox_sysc, | ||
3014 | }; | ||
3015 | |||
3016 | static struct omap_hwmod omap3xxx_mailbox_hwmod; | ||
3017 | static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { | ||
3018 | { .irq = 26 }, | ||
3019 | }; | ||
3020 | |||
3021 | static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = { | ||
3022 | { | ||
3023 | .pa_start = 0x48094000, | ||
3024 | .pa_end = 0x480941ff, | ||
3025 | .flags = ADDR_TYPE_RT, | ||
3026 | }, | ||
3027 | }; | ||
3028 | |||
3029 | /* l4_core -> mailbox */ | ||
3030 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = { | ||
3031 | .master = &omap3xxx_l4_core_hwmod, | ||
3032 | .slave = &omap3xxx_mailbox_hwmod, | ||
3033 | .addr = omap3xxx_mailbox_addrs, | ||
3034 | .addr_cnt = ARRAY_SIZE(omap3xxx_mailbox_addrs), | ||
3035 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3036 | }; | ||
3037 | |||
3038 | /* mailbox slave ports */ | ||
3039 | static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = { | ||
3040 | &omap3xxx_l4_core__mailbox, | ||
3041 | }; | ||
3042 | |||
3043 | static struct omap_hwmod omap3xxx_mailbox_hwmod = { | ||
3044 | .name = "mailbox", | ||
3045 | .class = &omap3xxx_mailbox_hwmod_class, | ||
3046 | .mpu_irqs = omap3xxx_mailbox_irqs, | ||
3047 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mailbox_irqs), | ||
3048 | .main_clk = "mailboxes_ick", | ||
3049 | .prcm = { | ||
3050 | .omap2 = { | ||
3051 | .prcm_reg_id = 1, | ||
3052 | .module_bit = OMAP3430_EN_MAILBOXES_SHIFT, | ||
3053 | .module_offs = CORE_MOD, | ||
3054 | .idlest_reg_id = 1, | ||
3055 | .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT, | ||
3056 | }, | ||
3057 | }, | ||
3058 | .slaves = omap3xxx_mailbox_slaves, | ||
3059 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves), | ||
3060 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3061 | }; | ||
3062 | |||
3063 | /* l4 core -> mcspi1 interface */ | ||
3064 | static struct omap_hwmod_addr_space omap34xx_mcspi1_addr_space[] = { | ||
3065 | { | ||
3066 | .pa_start = 0x48098000, | ||
3067 | .pa_end = 0x480980ff, | ||
3068 | .flags = ADDR_TYPE_RT, | ||
3069 | }, | ||
3070 | }; | ||
3071 | |||
3072 | static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi1 = { | ||
3073 | .master = &omap3xxx_l4_core_hwmod, | ||
3074 | .slave = &omap34xx_mcspi1, | ||
3075 | .clk = "mcspi1_ick", | ||
3076 | .addr = omap34xx_mcspi1_addr_space, | ||
3077 | .addr_cnt = ARRAY_SIZE(omap34xx_mcspi1_addr_space), | ||
3078 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3079 | }; | ||
3080 | |||
3081 | /* l4 core -> mcspi2 interface */ | ||
3082 | static struct omap_hwmod_addr_space omap34xx_mcspi2_addr_space[] = { | ||
3083 | { | ||
3084 | .pa_start = 0x4809a000, | ||
3085 | .pa_end = 0x4809a0ff, | ||
3086 | .flags = ADDR_TYPE_RT, | ||
3087 | }, | ||
3088 | }; | ||
3089 | |||
3090 | static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi2 = { | ||
3091 | .master = &omap3xxx_l4_core_hwmod, | ||
3092 | .slave = &omap34xx_mcspi2, | ||
3093 | .clk = "mcspi2_ick", | ||
3094 | .addr = omap34xx_mcspi2_addr_space, | ||
3095 | .addr_cnt = ARRAY_SIZE(omap34xx_mcspi2_addr_space), | ||
3096 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3097 | }; | ||
3098 | |||
3099 | /* l4 core -> mcspi3 interface */ | ||
3100 | static struct omap_hwmod_addr_space omap34xx_mcspi3_addr_space[] = { | ||
3101 | { | ||
3102 | .pa_start = 0x480b8000, | ||
3103 | .pa_end = 0x480b80ff, | ||
3104 | .flags = ADDR_TYPE_RT, | ||
3105 | }, | ||
3106 | }; | ||
3107 | |||
3108 | static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi3 = { | ||
3109 | .master = &omap3xxx_l4_core_hwmod, | ||
3110 | .slave = &omap34xx_mcspi3, | ||
3111 | .clk = "mcspi3_ick", | ||
3112 | .addr = omap34xx_mcspi3_addr_space, | ||
3113 | .addr_cnt = ARRAY_SIZE(omap34xx_mcspi3_addr_space), | ||
3114 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3115 | }; | ||
3116 | |||
3117 | /* l4 core -> mcspi4 interface */ | ||
3118 | static struct omap_hwmod_addr_space omap34xx_mcspi4_addr_space[] = { | ||
3119 | { | ||
3120 | .pa_start = 0x480ba000, | ||
3121 | .pa_end = 0x480ba0ff, | ||
3122 | .flags = ADDR_TYPE_RT, | ||
3123 | }, | ||
3124 | }; | ||
3125 | |||
3126 | static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi4 = { | ||
3127 | .master = &omap3xxx_l4_core_hwmod, | ||
3128 | .slave = &omap34xx_mcspi4, | ||
3129 | .clk = "mcspi4_ick", | ||
3130 | .addr = omap34xx_mcspi4_addr_space, | ||
3131 | .addr_cnt = ARRAY_SIZE(omap34xx_mcspi4_addr_space), | ||
3132 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3133 | }; | ||
3134 | |||
3135 | /* | ||
3136 | * 'mcspi' class | ||
3137 | * multichannel serial port interface (mcspi) / master/slave synchronous serial | ||
3138 | * bus | ||
3139 | */ | ||
3140 | |||
3141 | static struct omap_hwmod_class_sysconfig omap34xx_mcspi_sysc = { | ||
3142 | .rev_offs = 0x0000, | ||
3143 | .sysc_offs = 0x0010, | ||
3144 | .syss_offs = 0x0014, | ||
3145 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
3146 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
3147 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
3148 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
3149 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3150 | }; | ||
3151 | |||
3152 | static struct omap_hwmod_class omap34xx_mcspi_class = { | ||
3153 | .name = "mcspi", | ||
3154 | .sysc = &omap34xx_mcspi_sysc, | ||
3155 | .rev = OMAP3_MCSPI_REV, | ||
3156 | }; | ||
3157 | |||
3158 | /* mcspi1 */ | ||
3159 | static struct omap_hwmod_irq_info omap34xx_mcspi1_mpu_irqs[] = { | ||
3160 | { .name = "irq", .irq = 65 }, | ||
3161 | }; | ||
3162 | |||
3163 | static struct omap_hwmod_dma_info omap34xx_mcspi1_sdma_reqs[] = { | ||
3164 | { .name = "tx0", .dma_req = 35 }, | ||
3165 | { .name = "rx0", .dma_req = 36 }, | ||
3166 | { .name = "tx1", .dma_req = 37 }, | ||
3167 | { .name = "rx1", .dma_req = 38 }, | ||
3168 | { .name = "tx2", .dma_req = 39 }, | ||
3169 | { .name = "rx2", .dma_req = 40 }, | ||
3170 | { .name = "tx3", .dma_req = 41 }, | ||
3171 | { .name = "rx3", .dma_req = 42 }, | ||
3172 | }; | ||
3173 | |||
3174 | static struct omap_hwmod_ocp_if *omap34xx_mcspi1_slaves[] = { | ||
3175 | &omap34xx_l4_core__mcspi1, | ||
3176 | }; | ||
3177 | |||
3178 | static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = { | ||
3179 | .num_chipselect = 4, | ||
3180 | }; | ||
3181 | |||
3182 | static struct omap_hwmod omap34xx_mcspi1 = { | ||
3183 | .name = "mcspi1", | ||
3184 | .mpu_irqs = omap34xx_mcspi1_mpu_irqs, | ||
3185 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi1_mpu_irqs), | ||
3186 | .sdma_reqs = omap34xx_mcspi1_sdma_reqs, | ||
3187 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi1_sdma_reqs), | ||
3188 | .main_clk = "mcspi1_fck", | ||
3189 | .prcm = { | ||
3190 | .omap2 = { | ||
3191 | .module_offs = CORE_MOD, | ||
3192 | .prcm_reg_id = 1, | ||
3193 | .module_bit = OMAP3430_EN_MCSPI1_SHIFT, | ||
3194 | .idlest_reg_id = 1, | ||
3195 | .idlest_idle_bit = OMAP3430_ST_MCSPI1_SHIFT, | ||
3196 | }, | ||
3197 | }, | ||
3198 | .slaves = omap34xx_mcspi1_slaves, | ||
3199 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves), | ||
3200 | .class = &omap34xx_mcspi_class, | ||
3201 | .dev_attr = &omap_mcspi1_dev_attr, | ||
3202 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3203 | }; | ||
3204 | |||
3205 | /* mcspi2 */ | ||
3206 | static struct omap_hwmod_irq_info omap34xx_mcspi2_mpu_irqs[] = { | ||
3207 | { .name = "irq", .irq = 66 }, | ||
3208 | }; | ||
3209 | |||
3210 | static struct omap_hwmod_dma_info omap34xx_mcspi2_sdma_reqs[] = { | ||
3211 | { .name = "tx0", .dma_req = 43 }, | ||
3212 | { .name = "rx0", .dma_req = 44 }, | ||
3213 | { .name = "tx1", .dma_req = 45 }, | ||
3214 | { .name = "rx1", .dma_req = 46 }, | ||
3215 | }; | ||
3216 | |||
3217 | static struct omap_hwmod_ocp_if *omap34xx_mcspi2_slaves[] = { | ||
3218 | &omap34xx_l4_core__mcspi2, | ||
3219 | }; | ||
3220 | |||
3221 | static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = { | ||
3222 | .num_chipselect = 2, | ||
3223 | }; | ||
3224 | |||
3225 | static struct omap_hwmod omap34xx_mcspi2 = { | ||
3226 | .name = "mcspi2", | ||
3227 | .mpu_irqs = omap34xx_mcspi2_mpu_irqs, | ||
3228 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi2_mpu_irqs), | ||
3229 | .sdma_reqs = omap34xx_mcspi2_sdma_reqs, | ||
3230 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi2_sdma_reqs), | ||
3231 | .main_clk = "mcspi2_fck", | ||
3232 | .prcm = { | ||
3233 | .omap2 = { | ||
3234 | .module_offs = CORE_MOD, | ||
3235 | .prcm_reg_id = 1, | ||
3236 | .module_bit = OMAP3430_EN_MCSPI2_SHIFT, | ||
3237 | .idlest_reg_id = 1, | ||
3238 | .idlest_idle_bit = OMAP3430_ST_MCSPI2_SHIFT, | ||
3239 | }, | ||
3240 | }, | ||
3241 | .slaves = omap34xx_mcspi2_slaves, | ||
3242 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves), | ||
3243 | .class = &omap34xx_mcspi_class, | ||
3244 | .dev_attr = &omap_mcspi2_dev_attr, | ||
3245 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3246 | }; | ||
3247 | |||
3248 | /* mcspi3 */ | ||
3249 | static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = { | ||
3250 | { .name = "irq", .irq = 91 }, /* 91 */ | ||
3251 | }; | ||
3252 | |||
3253 | static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = { | ||
3254 | { .name = "tx0", .dma_req = 15 }, | ||
3255 | { .name = "rx0", .dma_req = 16 }, | ||
3256 | { .name = "tx1", .dma_req = 23 }, | ||
3257 | { .name = "rx1", .dma_req = 24 }, | ||
3258 | }; | ||
3259 | |||
3260 | static struct omap_hwmod_ocp_if *omap34xx_mcspi3_slaves[] = { | ||
3261 | &omap34xx_l4_core__mcspi3, | ||
3262 | }; | ||
3263 | |||
3264 | static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = { | ||
3265 | .num_chipselect = 2, | ||
3266 | }; | ||
3267 | |||
3268 | static struct omap_hwmod omap34xx_mcspi3 = { | ||
3269 | .name = "mcspi3", | ||
3270 | .mpu_irqs = omap34xx_mcspi3_mpu_irqs, | ||
3271 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi3_mpu_irqs), | ||
3272 | .sdma_reqs = omap34xx_mcspi3_sdma_reqs, | ||
3273 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi3_sdma_reqs), | ||
3274 | .main_clk = "mcspi3_fck", | ||
3275 | .prcm = { | ||
3276 | .omap2 = { | ||
3277 | .module_offs = CORE_MOD, | ||
3278 | .prcm_reg_id = 1, | ||
3279 | .module_bit = OMAP3430_EN_MCSPI3_SHIFT, | ||
3280 | .idlest_reg_id = 1, | ||
3281 | .idlest_idle_bit = OMAP3430_ST_MCSPI3_SHIFT, | ||
3282 | }, | ||
3283 | }, | ||
3284 | .slaves = omap34xx_mcspi3_slaves, | ||
3285 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves), | ||
3286 | .class = &omap34xx_mcspi_class, | ||
3287 | .dev_attr = &omap_mcspi3_dev_attr, | ||
3288 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3289 | }; | ||
3290 | |||
3291 | /* SPI4 */ | ||
3292 | static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = { | ||
3293 | { .name = "irq", .irq = INT_34XX_SPI4_IRQ }, /* 48 */ | ||
3294 | }; | ||
3295 | |||
3296 | static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = { | ||
3297 | { .name = "tx0", .dma_req = 70 }, /* DMA_SPI4_TX0 */ | ||
3298 | { .name = "rx0", .dma_req = 71 }, /* DMA_SPI4_RX0 */ | ||
3299 | }; | ||
3300 | |||
3301 | static struct omap_hwmod_ocp_if *omap34xx_mcspi4_slaves[] = { | ||
3302 | &omap34xx_l4_core__mcspi4, | ||
3303 | }; | ||
3304 | |||
3305 | static struct omap2_mcspi_dev_attr omap_mcspi4_dev_attr = { | ||
3306 | .num_chipselect = 1, | ||
3307 | }; | ||
3308 | |||
3309 | static struct omap_hwmod omap34xx_mcspi4 = { | ||
3310 | .name = "mcspi4", | ||
3311 | .mpu_irqs = omap34xx_mcspi4_mpu_irqs, | ||
3312 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi4_mpu_irqs), | ||
3313 | .sdma_reqs = omap34xx_mcspi4_sdma_reqs, | ||
3314 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi4_sdma_reqs), | ||
3315 | .main_clk = "mcspi4_fck", | ||
3316 | .prcm = { | ||
3317 | .omap2 = { | ||
3318 | .module_offs = CORE_MOD, | ||
3319 | .prcm_reg_id = 1, | ||
3320 | .module_bit = OMAP3430_EN_MCSPI4_SHIFT, | ||
3321 | .idlest_reg_id = 1, | ||
3322 | .idlest_idle_bit = OMAP3430_ST_MCSPI4_SHIFT, | ||
3323 | }, | ||
3324 | }, | ||
3325 | .slaves = omap34xx_mcspi4_slaves, | ||
3326 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves), | ||
3327 | .class = &omap34xx_mcspi_class, | ||
3328 | .dev_attr = &omap_mcspi4_dev_attr, | ||
3329 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3330 | }; | ||
3331 | |||
3332 | /* | ||
3333 | * usbhsotg | ||
3334 | */ | ||
3335 | static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = { | ||
3336 | .rev_offs = 0x0400, | ||
3337 | .sysc_offs = 0x0404, | ||
3338 | .syss_offs = 0x0408, | ||
3339 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE| | ||
3340 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
3341 | SYSC_HAS_AUTOIDLE), | ||
3342 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
3343 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
3344 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3345 | }; | ||
3346 | |||
3347 | static struct omap_hwmod_class usbotg_class = { | ||
3348 | .name = "usbotg", | ||
3349 | .sysc = &omap3xxx_usbhsotg_sysc, | ||
3350 | }; | ||
3351 | /* usb_otg_hs */ | ||
3352 | static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = { | ||
3353 | |||
3354 | { .name = "mc", .irq = 92 }, | ||
3355 | { .name = "dma", .irq = 93 }, | ||
3356 | }; | ||
3357 | |||
3358 | static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { | ||
3359 | .name = "usb_otg_hs", | ||
3360 | .mpu_irqs = omap3xxx_usbhsotg_mpu_irqs, | ||
3361 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_mpu_irqs), | ||
3362 | .main_clk = "hsotgusb_ick", | ||
3363 | .prcm = { | ||
3364 | .omap2 = { | ||
3365 | .prcm_reg_id = 1, | ||
3366 | .module_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | ||
3367 | .module_offs = CORE_MOD, | ||
3368 | .idlest_reg_id = 1, | ||
3369 | .idlest_idle_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT, | ||
3370 | .idlest_stdby_bit = OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT | ||
3371 | }, | ||
3372 | }, | ||
3373 | .masters = omap3xxx_usbhsotg_masters, | ||
3374 | .masters_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_masters), | ||
3375 | .slaves = omap3xxx_usbhsotg_slaves, | ||
3376 | .slaves_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_slaves), | ||
3377 | .class = &usbotg_class, | ||
3378 | |||
3379 | /* | ||
3380 | * Erratum ID: i479 idle_req / idle_ack mechanism potentially | ||
3381 | * broken when autoidle is enabled | ||
3382 | * workaround is to disable the autoidle bit at module level. | ||
3383 | */ | ||
3384 | .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE | ||
3385 | | HWMOD_SWSUP_MSTANDBY, | ||
3386 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
3387 | }; | ||
3388 | |||
3389 | /* usb_otg_hs */ | ||
3390 | static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = { | ||
3391 | |||
3392 | { .name = "mc", .irq = 71 }, | ||
3393 | }; | ||
3394 | |||
3395 | static struct omap_hwmod_class am35xx_usbotg_class = { | ||
3396 | .name = "am35xx_usbotg", | ||
3397 | .sysc = NULL, | ||
3398 | }; | ||
3399 | |||
3400 | static struct omap_hwmod am35xx_usbhsotg_hwmod = { | ||
3401 | .name = "am35x_otg_hs", | ||
3402 | .mpu_irqs = am35xx_usbhsotg_mpu_irqs, | ||
3403 | .mpu_irqs_cnt = ARRAY_SIZE(am35xx_usbhsotg_mpu_irqs), | ||
3404 | .main_clk = NULL, | ||
3405 | .prcm = { | ||
3406 | .omap2 = { | ||
3407 | }, | ||
3408 | }, | ||
3409 | .masters = am35xx_usbhsotg_masters, | ||
3410 | .masters_cnt = ARRAY_SIZE(am35xx_usbhsotg_masters), | ||
3411 | .slaves = am35xx_usbhsotg_slaves, | ||
3412 | .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves), | ||
3413 | .class = &am35xx_usbotg_class, | ||
3414 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1) | ||
3415 | }; | ||
3416 | |||
3417 | /* MMC/SD/SDIO common */ | ||
3418 | |||
3419 | static struct omap_hwmod_class_sysconfig omap34xx_mmc_sysc = { | ||
3420 | .rev_offs = 0x1fc, | ||
3421 | .sysc_offs = 0x10, | ||
3422 | .syss_offs = 0x14, | ||
3423 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
3424 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
3425 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
3426 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
3427 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3428 | }; | ||
3429 | |||
3430 | static struct omap_hwmod_class omap34xx_mmc_class = { | ||
3431 | .name = "mmc", | ||
3432 | .sysc = &omap34xx_mmc_sysc, | ||
3433 | }; | ||
3434 | |||
3435 | /* MMC/SD/SDIO1 */ | ||
3436 | |||
3437 | static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = { | ||
3438 | { .irq = 83, }, | ||
3439 | }; | ||
3440 | |||
3441 | static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = { | ||
3442 | { .name = "tx", .dma_req = 61, }, | ||
3443 | { .name = "rx", .dma_req = 62, }, | ||
3444 | }; | ||
3445 | |||
3446 | static struct omap_hwmod_opt_clk omap34xx_mmc1_opt_clks[] = { | ||
3447 | { .role = "dbck", .clk = "omap_32k_fck", }, | ||
3448 | }; | ||
3449 | |||
3450 | static struct omap_hwmod_ocp_if *omap3xxx_mmc1_slaves[] = { | ||
3451 | &omap3xxx_l4_core__mmc1, | ||
3452 | }; | ||
3453 | |||
3454 | static struct omap_mmc_dev_attr mmc1_dev_attr = { | ||
3455 | .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, | ||
3456 | }; | ||
3457 | |||
3458 | static struct omap_hwmod omap3xxx_mmc1_hwmod = { | ||
3459 | .name = "mmc1", | ||
3460 | .mpu_irqs = omap34xx_mmc1_mpu_irqs, | ||
3461 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc1_mpu_irqs), | ||
3462 | .sdma_reqs = omap34xx_mmc1_sdma_reqs, | ||
3463 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc1_sdma_reqs), | ||
3464 | .opt_clks = omap34xx_mmc1_opt_clks, | ||
3465 | .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks), | ||
3466 | .main_clk = "mmchs1_fck", | ||
3467 | .prcm = { | ||
3468 | .omap2 = { | ||
3469 | .module_offs = CORE_MOD, | ||
3470 | .prcm_reg_id = 1, | ||
3471 | .module_bit = OMAP3430_EN_MMC1_SHIFT, | ||
3472 | .idlest_reg_id = 1, | ||
3473 | .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT, | ||
3474 | }, | ||
3475 | }, | ||
3476 | .dev_attr = &mmc1_dev_attr, | ||
3477 | .slaves = omap3xxx_mmc1_slaves, | ||
3478 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves), | ||
3479 | .class = &omap34xx_mmc_class, | ||
3480 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3481 | }; | ||
3482 | |||
3483 | /* MMC/SD/SDIO2 */ | ||
3484 | |||
3485 | static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = { | ||
3486 | { .irq = INT_24XX_MMC2_IRQ, }, | ||
3487 | }; | ||
3488 | |||
3489 | static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = { | ||
3490 | { .name = "tx", .dma_req = 47, }, | ||
3491 | { .name = "rx", .dma_req = 48, }, | ||
3492 | }; | ||
3493 | |||
3494 | static struct omap_hwmod_opt_clk omap34xx_mmc2_opt_clks[] = { | ||
3495 | { .role = "dbck", .clk = "omap_32k_fck", }, | ||
3496 | }; | ||
3497 | |||
3498 | static struct omap_hwmod_ocp_if *omap3xxx_mmc2_slaves[] = { | ||
3499 | &omap3xxx_l4_core__mmc2, | ||
3500 | }; | ||
3501 | |||
3502 | static struct omap_hwmod omap3xxx_mmc2_hwmod = { | ||
3503 | .name = "mmc2", | ||
3504 | .mpu_irqs = omap34xx_mmc2_mpu_irqs, | ||
3505 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc2_mpu_irqs), | ||
3506 | .sdma_reqs = omap34xx_mmc2_sdma_reqs, | ||
3507 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc2_sdma_reqs), | ||
3508 | .opt_clks = omap34xx_mmc2_opt_clks, | ||
3509 | .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks), | ||
3510 | .main_clk = "mmchs2_fck", | ||
3511 | .prcm = { | ||
3512 | .omap2 = { | ||
3513 | .module_offs = CORE_MOD, | ||
3514 | .prcm_reg_id = 1, | ||
3515 | .module_bit = OMAP3430_EN_MMC2_SHIFT, | ||
3516 | .idlest_reg_id = 1, | ||
3517 | .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT, | ||
3518 | }, | ||
3519 | }, | ||
3520 | .slaves = omap3xxx_mmc2_slaves, | ||
3521 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves), | ||
3522 | .class = &omap34xx_mmc_class, | ||
3523 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3524 | }; | ||
3525 | |||
3526 | /* MMC/SD/SDIO3 */ | ||
3527 | |||
3528 | static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = { | ||
3529 | { .irq = 94, }, | ||
3530 | }; | ||
3531 | |||
3532 | static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = { | ||
3533 | { .name = "tx", .dma_req = 77, }, | ||
3534 | { .name = "rx", .dma_req = 78, }, | ||
3535 | }; | ||
3536 | |||
3537 | static struct omap_hwmod_opt_clk omap34xx_mmc3_opt_clks[] = { | ||
3538 | { .role = "dbck", .clk = "omap_32k_fck", }, | ||
3539 | }; | ||
3540 | |||
3541 | static struct omap_hwmod_ocp_if *omap3xxx_mmc3_slaves[] = { | ||
3542 | &omap3xxx_l4_core__mmc3, | ||
3543 | }; | ||
3544 | |||
3545 | static struct omap_hwmod omap3xxx_mmc3_hwmod = { | ||
3546 | .name = "mmc3", | ||
3547 | .mpu_irqs = omap34xx_mmc3_mpu_irqs, | ||
3548 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc3_mpu_irqs), | ||
3549 | .sdma_reqs = omap34xx_mmc3_sdma_reqs, | ||
3550 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc3_sdma_reqs), | ||
3551 | .opt_clks = omap34xx_mmc3_opt_clks, | ||
3552 | .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc3_opt_clks), | ||
3553 | .main_clk = "mmchs3_fck", | ||
3554 | .prcm = { | ||
3555 | .omap2 = { | ||
3556 | .prcm_reg_id = 1, | ||
3557 | .module_bit = OMAP3430_EN_MMC3_SHIFT, | ||
3558 | .idlest_reg_id = 1, | ||
3559 | .idlest_idle_bit = OMAP3430_ST_MMC3_SHIFT, | ||
3560 | }, | ||
3561 | }, | ||
3562 | .slaves = omap3xxx_mmc3_slaves, | ||
3563 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves), | ||
3564 | .class = &omap34xx_mmc_class, | ||
3565 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3566 | }; | ||
3567 | |||
1359 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 3568 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { |
1360 | &omap3xxx_l3_main_hwmod, | 3569 | &omap3xxx_l3_main_hwmod, |
1361 | &omap3xxx_l4_core_hwmod, | 3570 | &omap3xxx_l4_core_hwmod, |
1362 | &omap3xxx_l4_per_hwmod, | 3571 | &omap3xxx_l4_per_hwmod, |
1363 | &omap3xxx_l4_wkup_hwmod, | 3572 | &omap3xxx_l4_wkup_hwmod, |
3573 | &omap3xxx_mmc1_hwmod, | ||
3574 | &omap3xxx_mmc2_hwmod, | ||
3575 | &omap3xxx_mmc3_hwmod, | ||
1364 | &omap3xxx_mpu_hwmod, | 3576 | &omap3xxx_mpu_hwmod, |
1365 | &omap3xxx_iva_hwmod, | 3577 | &omap3xxx_iva_hwmod, |
3578 | |||
3579 | &omap3xxx_timer1_hwmod, | ||
3580 | &omap3xxx_timer2_hwmod, | ||
3581 | &omap3xxx_timer3_hwmod, | ||
3582 | &omap3xxx_timer4_hwmod, | ||
3583 | &omap3xxx_timer5_hwmod, | ||
3584 | &omap3xxx_timer6_hwmod, | ||
3585 | &omap3xxx_timer7_hwmod, | ||
3586 | &omap3xxx_timer8_hwmod, | ||
3587 | &omap3xxx_timer9_hwmod, | ||
3588 | &omap3xxx_timer10_hwmod, | ||
3589 | &omap3xxx_timer11_hwmod, | ||
3590 | &omap3xxx_timer12_hwmod, | ||
3591 | |||
1366 | &omap3xxx_wd_timer2_hwmod, | 3592 | &omap3xxx_wd_timer2_hwmod, |
1367 | &omap3xxx_uart1_hwmod, | 3593 | &omap3xxx_uart1_hwmod, |
1368 | &omap3xxx_uart2_hwmod, | 3594 | &omap3xxx_uart2_hwmod, |
1369 | &omap3xxx_uart3_hwmod, | 3595 | &omap3xxx_uart3_hwmod, |
1370 | &omap3xxx_uart4_hwmod, | 3596 | &omap3xxx_uart4_hwmod, |
3597 | /* dss class */ | ||
3598 | &omap3430es1_dss_core_hwmod, | ||
3599 | &omap3xxx_dss_core_hwmod, | ||
3600 | &omap3xxx_dss_dispc_hwmod, | ||
3601 | &omap3xxx_dss_dsi1_hwmod, | ||
3602 | &omap3xxx_dss_rfbi_hwmod, | ||
3603 | &omap3xxx_dss_venc_hwmod, | ||
3604 | |||
3605 | /* i2c class */ | ||
1371 | &omap3xxx_i2c1_hwmod, | 3606 | &omap3xxx_i2c1_hwmod, |
1372 | &omap3xxx_i2c2_hwmod, | 3607 | &omap3xxx_i2c2_hwmod, |
1373 | &omap3xxx_i2c3_hwmod, | 3608 | &omap3xxx_i2c3_hwmod, |
@@ -1387,10 +3622,35 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
1387 | 3622 | ||
1388 | /* dma_system class*/ | 3623 | /* dma_system class*/ |
1389 | &omap3xxx_dma_system_hwmod, | 3624 | &omap3xxx_dma_system_hwmod, |
3625 | |||
3626 | /* mcbsp class */ | ||
3627 | &omap3xxx_mcbsp1_hwmod, | ||
3628 | &omap3xxx_mcbsp2_hwmod, | ||
3629 | &omap3xxx_mcbsp3_hwmod, | ||
3630 | &omap3xxx_mcbsp4_hwmod, | ||
3631 | &omap3xxx_mcbsp5_hwmod, | ||
3632 | &omap3xxx_mcbsp2_sidetone_hwmod, | ||
3633 | &omap3xxx_mcbsp3_sidetone_hwmod, | ||
3634 | |||
3635 | /* mailbox class */ | ||
3636 | &omap3xxx_mailbox_hwmod, | ||
3637 | |||
3638 | /* mcspi class */ | ||
3639 | &omap34xx_mcspi1, | ||
3640 | &omap34xx_mcspi2, | ||
3641 | &omap34xx_mcspi3, | ||
3642 | &omap34xx_mcspi4, | ||
3643 | |||
3644 | /* usbotg class */ | ||
3645 | &omap3xxx_usbhsotg_hwmod, | ||
3646 | |||
3647 | /* usbotg for am35x */ | ||
3648 | &am35xx_usbhsotg_hwmod, | ||
3649 | |||
1390 | NULL, | 3650 | NULL, |
1391 | }; | 3651 | }; |
1392 | 3652 | ||
1393 | int __init omap3xxx_hwmod_init(void) | 3653 | int __init omap3xxx_hwmod_init(void) |
1394 | { | 3654 | { |
1395 | return omap_hwmod_init(omap3xxx_hwmods); | 3655 | return omap_hwmod_register(omap3xxx_hwmods); |
1396 | } | 3656 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index c2806bd11fbf..3e88dd3f8ef3 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Hardware modules present on the OMAP44xx chips | 2 | * Hardware modules present on the OMAP44xx chips |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2009-2010 Nokia Corporation | 5 | * Copyright (C) 2009-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley | 7 | * Paul Walmsley |
@@ -24,6 +24,9 @@ | |||
24 | #include <plat/cpu.h> | 24 | #include <plat/cpu.h> |
25 | #include <plat/gpio.h> | 25 | #include <plat/gpio.h> |
26 | #include <plat/dma.h> | 26 | #include <plat/dma.h> |
27 | #include <plat/mcspi.h> | ||
28 | #include <plat/mcbsp.h> | ||
29 | #include <plat/mmc.h> | ||
27 | 30 | ||
28 | #include "omap_hwmod_common_data.h" | 31 | #include "omap_hwmod_common_data.h" |
29 | 32 | ||
@@ -40,10 +43,15 @@ | |||
40 | #define OMAP44XX_DMA_REQ_START 1 | 43 | #define OMAP44XX_DMA_REQ_START 1 |
41 | 44 | ||
42 | /* Backward references (IPs with Bus Master capability) */ | 45 | /* Backward references (IPs with Bus Master capability) */ |
46 | static struct omap_hwmod omap44xx_aess_hwmod; | ||
43 | static struct omap_hwmod omap44xx_dma_system_hwmod; | 47 | static struct omap_hwmod omap44xx_dma_system_hwmod; |
44 | static struct omap_hwmod omap44xx_dmm_hwmod; | 48 | static struct omap_hwmod omap44xx_dmm_hwmod; |
45 | static struct omap_hwmod omap44xx_dsp_hwmod; | 49 | static struct omap_hwmod omap44xx_dsp_hwmod; |
50 | static struct omap_hwmod omap44xx_dss_hwmod; | ||
46 | static struct omap_hwmod omap44xx_emif_fw_hwmod; | 51 | static struct omap_hwmod omap44xx_emif_fw_hwmod; |
52 | static struct omap_hwmod omap44xx_hsi_hwmod; | ||
53 | static struct omap_hwmod omap44xx_ipu_hwmod; | ||
54 | static struct omap_hwmod omap44xx_iss_hwmod; | ||
47 | static struct omap_hwmod omap44xx_iva_hwmod; | 55 | static struct omap_hwmod omap44xx_iva_hwmod; |
48 | static struct omap_hwmod omap44xx_l3_instr_hwmod; | 56 | static struct omap_hwmod omap44xx_l3_instr_hwmod; |
49 | static struct omap_hwmod omap44xx_l3_main_1_hwmod; | 57 | static struct omap_hwmod omap44xx_l3_main_1_hwmod; |
@@ -53,8 +61,11 @@ static struct omap_hwmod omap44xx_l4_abe_hwmod; | |||
53 | static struct omap_hwmod omap44xx_l4_cfg_hwmod; | 61 | static struct omap_hwmod omap44xx_l4_cfg_hwmod; |
54 | static struct omap_hwmod omap44xx_l4_per_hwmod; | 62 | static struct omap_hwmod omap44xx_l4_per_hwmod; |
55 | static struct omap_hwmod omap44xx_l4_wkup_hwmod; | 63 | static struct omap_hwmod omap44xx_l4_wkup_hwmod; |
64 | static struct omap_hwmod omap44xx_mmc1_hwmod; | ||
65 | static struct omap_hwmod omap44xx_mmc2_hwmod; | ||
56 | static struct omap_hwmod omap44xx_mpu_hwmod; | 66 | static struct omap_hwmod omap44xx_mpu_hwmod; |
57 | static struct omap_hwmod omap44xx_mpu_private_hwmod; | 67 | static struct omap_hwmod omap44xx_mpu_private_hwmod; |
68 | static struct omap_hwmod omap44xx_usb_otg_hs_hwmod; | ||
58 | 69 | ||
59 | /* | 70 | /* |
60 | * Interconnects omap_hwmod structures | 71 | * Interconnects omap_hwmod structures |
@@ -213,6 +224,14 @@ static struct omap_hwmod_ocp_if omap44xx_dsp__l3_main_1 = { | |||
213 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 224 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
214 | }; | 225 | }; |
215 | 226 | ||
227 | /* dss -> l3_main_1 */ | ||
228 | static struct omap_hwmod_ocp_if omap44xx_dss__l3_main_1 = { | ||
229 | .master = &omap44xx_dss_hwmod, | ||
230 | .slave = &omap44xx_l3_main_1_hwmod, | ||
231 | .clk = "l3_div_ck", | ||
232 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
233 | }; | ||
234 | |||
216 | /* l3_main_2 -> l3_main_1 */ | 235 | /* l3_main_2 -> l3_main_1 */ |
217 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { | 236 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { |
218 | .master = &omap44xx_l3_main_2_hwmod, | 237 | .master = &omap44xx_l3_main_2_hwmod, |
@@ -229,25 +248,62 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_1 = { | |||
229 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 248 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
230 | }; | 249 | }; |
231 | 250 | ||
251 | /* mmc1 -> l3_main_1 */ | ||
252 | static struct omap_hwmod_ocp_if omap44xx_mmc1__l3_main_1 = { | ||
253 | .master = &omap44xx_mmc1_hwmod, | ||
254 | .slave = &omap44xx_l3_main_1_hwmod, | ||
255 | .clk = "l3_div_ck", | ||
256 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
257 | }; | ||
258 | |||
259 | /* mmc2 -> l3_main_1 */ | ||
260 | static struct omap_hwmod_ocp_if omap44xx_mmc2__l3_main_1 = { | ||
261 | .master = &omap44xx_mmc2_hwmod, | ||
262 | .slave = &omap44xx_l3_main_1_hwmod, | ||
263 | .clk = "l3_div_ck", | ||
264 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
265 | }; | ||
266 | |||
267 | /* L3 target configuration and error log registers */ | ||
268 | static struct omap_hwmod_irq_info omap44xx_l3_targ_irqs[] = { | ||
269 | { .irq = 9 + OMAP44XX_IRQ_GIC_START }, | ||
270 | { .irq = 10 + OMAP44XX_IRQ_GIC_START }, | ||
271 | }; | ||
272 | |||
273 | static struct omap_hwmod_addr_space omap44xx_l3_main_1_addrs[] = { | ||
274 | { | ||
275 | .pa_start = 0x44000000, | ||
276 | .pa_end = 0x44000fff, | ||
277 | .flags = ADDR_TYPE_RT, | ||
278 | }, | ||
279 | }; | ||
280 | |||
232 | /* mpu -> l3_main_1 */ | 281 | /* mpu -> l3_main_1 */ |
233 | static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { | 282 | static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { |
234 | .master = &omap44xx_mpu_hwmod, | 283 | .master = &omap44xx_mpu_hwmod, |
235 | .slave = &omap44xx_l3_main_1_hwmod, | 284 | .slave = &omap44xx_l3_main_1_hwmod, |
236 | .clk = "l3_div_ck", | 285 | .clk = "l3_div_ck", |
286 | .addr = omap44xx_l3_main_1_addrs, | ||
287 | .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_1_addrs), | ||
237 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 288 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
238 | }; | 289 | }; |
239 | 290 | ||
240 | /* l3_main_1 slave ports */ | 291 | /* l3_main_1 slave ports */ |
241 | static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { | 292 | static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { |
242 | &omap44xx_dsp__l3_main_1, | 293 | &omap44xx_dsp__l3_main_1, |
294 | &omap44xx_dss__l3_main_1, | ||
243 | &omap44xx_l3_main_2__l3_main_1, | 295 | &omap44xx_l3_main_2__l3_main_1, |
244 | &omap44xx_l4_cfg__l3_main_1, | 296 | &omap44xx_l4_cfg__l3_main_1, |
297 | &omap44xx_mmc1__l3_main_1, | ||
298 | &omap44xx_mmc2__l3_main_1, | ||
245 | &omap44xx_mpu__l3_main_1, | 299 | &omap44xx_mpu__l3_main_1, |
246 | }; | 300 | }; |
247 | 301 | ||
248 | static struct omap_hwmod omap44xx_l3_main_1_hwmod = { | 302 | static struct omap_hwmod omap44xx_l3_main_1_hwmod = { |
249 | .name = "l3_main_1", | 303 | .name = "l3_main_1", |
250 | .class = &omap44xx_l3_hwmod_class, | 304 | .class = &omap44xx_l3_hwmod_class, |
305 | .mpu_irqs = omap44xx_l3_targ_irqs, | ||
306 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_l3_targ_irqs), | ||
251 | .slaves = omap44xx_l3_main_1_slaves, | 307 | .slaves = omap44xx_l3_main_1_slaves, |
252 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), | 308 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), |
253 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 309 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
@@ -262,6 +318,30 @@ static struct omap_hwmod_ocp_if omap44xx_dma_system__l3_main_2 = { | |||
262 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 318 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
263 | }; | 319 | }; |
264 | 320 | ||
321 | /* hsi -> l3_main_2 */ | ||
322 | static struct omap_hwmod_ocp_if omap44xx_hsi__l3_main_2 = { | ||
323 | .master = &omap44xx_hsi_hwmod, | ||
324 | .slave = &omap44xx_l3_main_2_hwmod, | ||
325 | .clk = "l3_div_ck", | ||
326 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
327 | }; | ||
328 | |||
329 | /* ipu -> l3_main_2 */ | ||
330 | static struct omap_hwmod_ocp_if omap44xx_ipu__l3_main_2 = { | ||
331 | .master = &omap44xx_ipu_hwmod, | ||
332 | .slave = &omap44xx_l3_main_2_hwmod, | ||
333 | .clk = "l3_div_ck", | ||
334 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
335 | }; | ||
336 | |||
337 | /* iss -> l3_main_2 */ | ||
338 | static struct omap_hwmod_ocp_if omap44xx_iss__l3_main_2 = { | ||
339 | .master = &omap44xx_iss_hwmod, | ||
340 | .slave = &omap44xx_l3_main_2_hwmod, | ||
341 | .clk = "l3_div_ck", | ||
342 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
343 | }; | ||
344 | |||
265 | /* iva -> l3_main_2 */ | 345 | /* iva -> l3_main_2 */ |
266 | static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = { | 346 | static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = { |
267 | .master = &omap44xx_iva_hwmod, | 347 | .master = &omap44xx_iva_hwmod, |
@@ -270,11 +350,21 @@ static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = { | |||
270 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 350 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
271 | }; | 351 | }; |
272 | 352 | ||
353 | static struct omap_hwmod_addr_space omap44xx_l3_main_2_addrs[] = { | ||
354 | { | ||
355 | .pa_start = 0x44800000, | ||
356 | .pa_end = 0x44801fff, | ||
357 | .flags = ADDR_TYPE_RT, | ||
358 | }, | ||
359 | }; | ||
360 | |||
273 | /* l3_main_1 -> l3_main_2 */ | 361 | /* l3_main_1 -> l3_main_2 */ |
274 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { | 362 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { |
275 | .master = &omap44xx_l3_main_1_hwmod, | 363 | .master = &omap44xx_l3_main_1_hwmod, |
276 | .slave = &omap44xx_l3_main_2_hwmod, | 364 | .slave = &omap44xx_l3_main_2_hwmod, |
277 | .clk = "l3_div_ck", | 365 | .clk = "l3_div_ck", |
366 | .addr = omap44xx_l3_main_2_addrs, | ||
367 | .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_2_addrs), | ||
278 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 368 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
279 | }; | 369 | }; |
280 | 370 | ||
@@ -286,12 +376,24 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_2 = { | |||
286 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 376 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
287 | }; | 377 | }; |
288 | 378 | ||
379 | /* usb_otg_hs -> l3_main_2 */ | ||
380 | static struct omap_hwmod_ocp_if omap44xx_usb_otg_hs__l3_main_2 = { | ||
381 | .master = &omap44xx_usb_otg_hs_hwmod, | ||
382 | .slave = &omap44xx_l3_main_2_hwmod, | ||
383 | .clk = "l3_div_ck", | ||
384 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
385 | }; | ||
386 | |||
289 | /* l3_main_2 slave ports */ | 387 | /* l3_main_2 slave ports */ |
290 | static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { | 388 | static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { |
291 | &omap44xx_dma_system__l3_main_2, | 389 | &omap44xx_dma_system__l3_main_2, |
390 | &omap44xx_hsi__l3_main_2, | ||
391 | &omap44xx_ipu__l3_main_2, | ||
392 | &omap44xx_iss__l3_main_2, | ||
292 | &omap44xx_iva__l3_main_2, | 393 | &omap44xx_iva__l3_main_2, |
293 | &omap44xx_l3_main_1__l3_main_2, | 394 | &omap44xx_l3_main_1__l3_main_2, |
294 | &omap44xx_l4_cfg__l3_main_2, | 395 | &omap44xx_l4_cfg__l3_main_2, |
396 | &omap44xx_usb_otg_hs__l3_main_2, | ||
295 | }; | 397 | }; |
296 | 398 | ||
297 | static struct omap_hwmod omap44xx_l3_main_2_hwmod = { | 399 | static struct omap_hwmod omap44xx_l3_main_2_hwmod = { |
@@ -303,11 +405,21 @@ static struct omap_hwmod omap44xx_l3_main_2_hwmod = { | |||
303 | }; | 405 | }; |
304 | 406 | ||
305 | /* l3_main_3 interface data */ | 407 | /* l3_main_3 interface data */ |
408 | static struct omap_hwmod_addr_space omap44xx_l3_main_3_addrs[] = { | ||
409 | { | ||
410 | .pa_start = 0x45000000, | ||
411 | .pa_end = 0x45000fff, | ||
412 | .flags = ADDR_TYPE_RT, | ||
413 | }, | ||
414 | }; | ||
415 | |||
306 | /* l3_main_1 -> l3_main_3 */ | 416 | /* l3_main_1 -> l3_main_3 */ |
307 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = { | 417 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = { |
308 | .master = &omap44xx_l3_main_1_hwmod, | 418 | .master = &omap44xx_l3_main_1_hwmod, |
309 | .slave = &omap44xx_l3_main_3_hwmod, | 419 | .slave = &omap44xx_l3_main_3_hwmod, |
310 | .clk = "l3_div_ck", | 420 | .clk = "l3_div_ck", |
421 | .addr = omap44xx_l3_main_3_addrs, | ||
422 | .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_3_addrs), | ||
311 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 423 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
312 | }; | 424 | }; |
313 | 425 | ||
@@ -351,6 +463,14 @@ static struct omap_hwmod_class omap44xx_l4_hwmod_class = { | |||
351 | }; | 463 | }; |
352 | 464 | ||
353 | /* l4_abe interface data */ | 465 | /* l4_abe interface data */ |
466 | /* aess -> l4_abe */ | ||
467 | static struct omap_hwmod_ocp_if omap44xx_aess__l4_abe = { | ||
468 | .master = &omap44xx_aess_hwmod, | ||
469 | .slave = &omap44xx_l4_abe_hwmod, | ||
470 | .clk = "ocp_abe_iclk", | ||
471 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
472 | }; | ||
473 | |||
354 | /* dsp -> l4_abe */ | 474 | /* dsp -> l4_abe */ |
355 | static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = { | 475 | static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = { |
356 | .master = &omap44xx_dsp_hwmod, | 476 | .master = &omap44xx_dsp_hwmod, |
@@ -377,6 +497,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l4_abe = { | |||
377 | 497 | ||
378 | /* l4_abe slave ports */ | 498 | /* l4_abe slave ports */ |
379 | static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { | 499 | static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { |
500 | &omap44xx_aess__l4_abe, | ||
380 | &omap44xx_dsp__l4_abe, | 501 | &omap44xx_dsp__l4_abe, |
381 | &omap44xx_l3_main_1__l4_abe, | 502 | &omap44xx_l3_main_1__l4_abe, |
382 | &omap44xx_mpu__l4_abe, | 503 | &omap44xx_mpu__l4_abe, |
@@ -494,26 +615,15 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = { | |||
494 | * - They still need to be validated with the driver | 615 | * - They still need to be validated with the driver |
495 | * properly adapted to omap_hwmod / omap_device | 616 | * properly adapted to omap_hwmod / omap_device |
496 | * | 617 | * |
497 | * aess | ||
498 | * bandgap | ||
499 | * c2c | 618 | * c2c |
500 | * c2c_target_fw | 619 | * c2c_target_fw |
501 | * cm_core | 620 | * cm_core |
502 | * cm_core_aon | 621 | * cm_core_aon |
503 | * counter_32k | ||
504 | * ctrl_module_core | 622 | * ctrl_module_core |
505 | * ctrl_module_pad_core | 623 | * ctrl_module_pad_core |
506 | * ctrl_module_pad_wkup | 624 | * ctrl_module_pad_wkup |
507 | * ctrl_module_wkup | 625 | * ctrl_module_wkup |
508 | * debugss | 626 | * 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 | 627 | * efuse_ctrl_cust |
518 | * efuse_ctrl_std | 628 | * efuse_ctrl_std |
519 | * elm | 629 | * elm |
@@ -524,58 +634,211 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = { | |||
524 | * gpu | 634 | * gpu |
525 | * hdq1w | 635 | * hdq1w |
526 | * hsi | 636 | * 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 | 637 | * ocmc_ram |
549 | * ocp2scp_usb_phy | 638 | * ocp2scp_usb_phy |
550 | * ocp_wp_noc | 639 | * ocp_wp_noc |
551 | * prcm | ||
552 | * prcm_mpu | 640 | * prcm_mpu |
553 | * prm | 641 | * prm |
554 | * scrm | 642 | * scrm |
555 | * sl2if | 643 | * sl2if |
556 | * slimbus1 | 644 | * slimbus1 |
557 | * slimbus2 | 645 | * 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 | 646 | * usb_host_fs |
571 | * usb_host_hs | 647 | * usb_host_hs |
572 | * usb_otg_hs | ||
573 | * usb_phy_cm | 648 | * usb_phy_cm |
574 | * usb_tll_hs | 649 | * usb_tll_hs |
575 | * usim | 650 | * usim |
576 | */ | 651 | */ |
577 | 652 | ||
578 | /* | 653 | /* |
654 | * 'aess' class | ||
655 | * audio engine sub system | ||
656 | */ | ||
657 | |||
658 | static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = { | ||
659 | .rev_offs = 0x0000, | ||
660 | .sysc_offs = 0x0010, | ||
661 | .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), | ||
662 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
663 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
664 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
665 | }; | ||
666 | |||
667 | static struct omap_hwmod_class omap44xx_aess_hwmod_class = { | ||
668 | .name = "aess", | ||
669 | .sysc = &omap44xx_aess_sysc, | ||
670 | }; | ||
671 | |||
672 | /* aess */ | ||
673 | static struct omap_hwmod_irq_info omap44xx_aess_irqs[] = { | ||
674 | { .irq = 99 + OMAP44XX_IRQ_GIC_START }, | ||
675 | }; | ||
676 | |||
677 | static struct omap_hwmod_dma_info omap44xx_aess_sdma_reqs[] = { | ||
678 | { .name = "fifo0", .dma_req = 100 + OMAP44XX_DMA_REQ_START }, | ||
679 | { .name = "fifo1", .dma_req = 101 + OMAP44XX_DMA_REQ_START }, | ||
680 | { .name = "fifo2", .dma_req = 102 + OMAP44XX_DMA_REQ_START }, | ||
681 | { .name = "fifo3", .dma_req = 103 + OMAP44XX_DMA_REQ_START }, | ||
682 | { .name = "fifo4", .dma_req = 104 + OMAP44XX_DMA_REQ_START }, | ||
683 | { .name = "fifo5", .dma_req = 105 + OMAP44XX_DMA_REQ_START }, | ||
684 | { .name = "fifo6", .dma_req = 106 + OMAP44XX_DMA_REQ_START }, | ||
685 | { .name = "fifo7", .dma_req = 107 + OMAP44XX_DMA_REQ_START }, | ||
686 | }; | ||
687 | |||
688 | /* aess master ports */ | ||
689 | static struct omap_hwmod_ocp_if *omap44xx_aess_masters[] = { | ||
690 | &omap44xx_aess__l4_abe, | ||
691 | }; | ||
692 | |||
693 | static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = { | ||
694 | { | ||
695 | .pa_start = 0x401f1000, | ||
696 | .pa_end = 0x401f13ff, | ||
697 | .flags = ADDR_TYPE_RT | ||
698 | }, | ||
699 | }; | ||
700 | |||
701 | /* l4_abe -> aess */ | ||
702 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__aess = { | ||
703 | .master = &omap44xx_l4_abe_hwmod, | ||
704 | .slave = &omap44xx_aess_hwmod, | ||
705 | .clk = "ocp_abe_iclk", | ||
706 | .addr = omap44xx_aess_addrs, | ||
707 | .addr_cnt = ARRAY_SIZE(omap44xx_aess_addrs), | ||
708 | .user = OCP_USER_MPU, | ||
709 | }; | ||
710 | |||
711 | static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = { | ||
712 | { | ||
713 | .pa_start = 0x490f1000, | ||
714 | .pa_end = 0x490f13ff, | ||
715 | .flags = ADDR_TYPE_RT | ||
716 | }, | ||
717 | }; | ||
718 | |||
719 | /* l4_abe -> aess (dma) */ | ||
720 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__aess_dma = { | ||
721 | .master = &omap44xx_l4_abe_hwmod, | ||
722 | .slave = &omap44xx_aess_hwmod, | ||
723 | .clk = "ocp_abe_iclk", | ||
724 | .addr = omap44xx_aess_dma_addrs, | ||
725 | .addr_cnt = ARRAY_SIZE(omap44xx_aess_dma_addrs), | ||
726 | .user = OCP_USER_SDMA, | ||
727 | }; | ||
728 | |||
729 | /* aess slave ports */ | ||
730 | static struct omap_hwmod_ocp_if *omap44xx_aess_slaves[] = { | ||
731 | &omap44xx_l4_abe__aess, | ||
732 | &omap44xx_l4_abe__aess_dma, | ||
733 | }; | ||
734 | |||
735 | static struct omap_hwmod omap44xx_aess_hwmod = { | ||
736 | .name = "aess", | ||
737 | .class = &omap44xx_aess_hwmod_class, | ||
738 | .mpu_irqs = omap44xx_aess_irqs, | ||
739 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_aess_irqs), | ||
740 | .sdma_reqs = omap44xx_aess_sdma_reqs, | ||
741 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_aess_sdma_reqs), | ||
742 | .main_clk = "aess_fck", | ||
743 | .prcm = { | ||
744 | .omap4 = { | ||
745 | .clkctrl_reg = OMAP4430_CM1_ABE_AESS_CLKCTRL, | ||
746 | }, | ||
747 | }, | ||
748 | .slaves = omap44xx_aess_slaves, | ||
749 | .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves), | ||
750 | .masters = omap44xx_aess_masters, | ||
751 | .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters), | ||
752 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
753 | }; | ||
754 | |||
755 | /* | ||
756 | * 'bandgap' class | ||
757 | * bangap reference for ldo regulators | ||
758 | */ | ||
759 | |||
760 | static struct omap_hwmod_class omap44xx_bandgap_hwmod_class = { | ||
761 | .name = "bandgap", | ||
762 | }; | ||
763 | |||
764 | /* bandgap */ | ||
765 | static struct omap_hwmod_opt_clk bandgap_opt_clks[] = { | ||
766 | { .role = "fclk", .clk = "bandgap_fclk" }, | ||
767 | }; | ||
768 | |||
769 | static struct omap_hwmod omap44xx_bandgap_hwmod = { | ||
770 | .name = "bandgap", | ||
771 | .class = &omap44xx_bandgap_hwmod_class, | ||
772 | .prcm = { | ||
773 | .omap4 = { | ||
774 | .clkctrl_reg = OMAP4430_CM_WKUP_BANDGAP_CLKCTRL, | ||
775 | }, | ||
776 | }, | ||
777 | .opt_clks = bandgap_opt_clks, | ||
778 | .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks), | ||
779 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
780 | }; | ||
781 | |||
782 | /* | ||
783 | * 'counter' class | ||
784 | * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock | ||
785 | */ | ||
786 | |||
787 | static struct omap_hwmod_class_sysconfig omap44xx_counter_sysc = { | ||
788 | .rev_offs = 0x0000, | ||
789 | .sysc_offs = 0x0004, | ||
790 | .sysc_flags = SYSC_HAS_SIDLEMODE, | ||
791 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
792 | SIDLE_SMART_WKUP), | ||
793 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
794 | }; | ||
795 | |||
796 | static struct omap_hwmod_class omap44xx_counter_hwmod_class = { | ||
797 | .name = "counter", | ||
798 | .sysc = &omap44xx_counter_sysc, | ||
799 | }; | ||
800 | |||
801 | /* counter_32k */ | ||
802 | static struct omap_hwmod omap44xx_counter_32k_hwmod; | ||
803 | static struct omap_hwmod_addr_space omap44xx_counter_32k_addrs[] = { | ||
804 | { | ||
805 | .pa_start = 0x4a304000, | ||
806 | .pa_end = 0x4a30401f, | ||
807 | .flags = ADDR_TYPE_RT | ||
808 | }, | ||
809 | }; | ||
810 | |||
811 | /* l4_wkup -> counter_32k */ | ||
812 | static struct omap_hwmod_ocp_if omap44xx_l4_wkup__counter_32k = { | ||
813 | .master = &omap44xx_l4_wkup_hwmod, | ||
814 | .slave = &omap44xx_counter_32k_hwmod, | ||
815 | .clk = "l4_wkup_clk_mux_ck", | ||
816 | .addr = omap44xx_counter_32k_addrs, | ||
817 | .addr_cnt = ARRAY_SIZE(omap44xx_counter_32k_addrs), | ||
818 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
819 | }; | ||
820 | |||
821 | /* counter_32k slave ports */ | ||
822 | static struct omap_hwmod_ocp_if *omap44xx_counter_32k_slaves[] = { | ||
823 | &omap44xx_l4_wkup__counter_32k, | ||
824 | }; | ||
825 | |||
826 | static struct omap_hwmod omap44xx_counter_32k_hwmod = { | ||
827 | .name = "counter_32k", | ||
828 | .class = &omap44xx_counter_hwmod_class, | ||
829 | .flags = HWMOD_SWSUP_SIDLE, | ||
830 | .main_clk = "sys_32k_ck", | ||
831 | .prcm = { | ||
832 | .omap4 = { | ||
833 | .clkctrl_reg = OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL, | ||
834 | }, | ||
835 | }, | ||
836 | .slaves = omap44xx_counter_32k_slaves, | ||
837 | .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves), | ||
838 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
839 | }; | ||
840 | |||
841 | /* | ||
579 | * 'dma' class | 842 | * 'dma' class |
580 | * dma controller for data exchange between memory to memory (i.e. internal or | 843 | * 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 | 844 | * external memory) and gp peripherals to memory or memory to gp peripherals |
@@ -662,6 +925,96 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = { | |||
662 | }; | 925 | }; |
663 | 926 | ||
664 | /* | 927 | /* |
928 | * 'dmic' class | ||
929 | * digital microphone controller | ||
930 | */ | ||
931 | |||
932 | static struct omap_hwmod_class_sysconfig omap44xx_dmic_sysc = { | ||
933 | .rev_offs = 0x0000, | ||
934 | .sysc_offs = 0x0010, | ||
935 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS | | ||
936 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
937 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
938 | SIDLE_SMART_WKUP), | ||
939 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
940 | }; | ||
941 | |||
942 | static struct omap_hwmod_class omap44xx_dmic_hwmod_class = { | ||
943 | .name = "dmic", | ||
944 | .sysc = &omap44xx_dmic_sysc, | ||
945 | }; | ||
946 | |||
947 | /* dmic */ | ||
948 | static struct omap_hwmod omap44xx_dmic_hwmod; | ||
949 | static struct omap_hwmod_irq_info omap44xx_dmic_irqs[] = { | ||
950 | { .irq = 114 + OMAP44XX_IRQ_GIC_START }, | ||
951 | }; | ||
952 | |||
953 | static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = { | ||
954 | { .dma_req = 66 + OMAP44XX_DMA_REQ_START }, | ||
955 | }; | ||
956 | |||
957 | static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = { | ||
958 | { | ||
959 | .pa_start = 0x4012e000, | ||
960 | .pa_end = 0x4012e07f, | ||
961 | .flags = ADDR_TYPE_RT | ||
962 | }, | ||
963 | }; | ||
964 | |||
965 | /* l4_abe -> dmic */ | ||
966 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = { | ||
967 | .master = &omap44xx_l4_abe_hwmod, | ||
968 | .slave = &omap44xx_dmic_hwmod, | ||
969 | .clk = "ocp_abe_iclk", | ||
970 | .addr = omap44xx_dmic_addrs, | ||
971 | .addr_cnt = ARRAY_SIZE(omap44xx_dmic_addrs), | ||
972 | .user = OCP_USER_MPU, | ||
973 | }; | ||
974 | |||
975 | static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = { | ||
976 | { | ||
977 | .pa_start = 0x4902e000, | ||
978 | .pa_end = 0x4902e07f, | ||
979 | .flags = ADDR_TYPE_RT | ||
980 | }, | ||
981 | }; | ||
982 | |||
983 | /* l4_abe -> dmic (dma) */ | ||
984 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic_dma = { | ||
985 | .master = &omap44xx_l4_abe_hwmod, | ||
986 | .slave = &omap44xx_dmic_hwmod, | ||
987 | .clk = "ocp_abe_iclk", | ||
988 | .addr = omap44xx_dmic_dma_addrs, | ||
989 | .addr_cnt = ARRAY_SIZE(omap44xx_dmic_dma_addrs), | ||
990 | .user = OCP_USER_SDMA, | ||
991 | }; | ||
992 | |||
993 | /* dmic slave ports */ | ||
994 | static struct omap_hwmod_ocp_if *omap44xx_dmic_slaves[] = { | ||
995 | &omap44xx_l4_abe__dmic, | ||
996 | &omap44xx_l4_abe__dmic_dma, | ||
997 | }; | ||
998 | |||
999 | static struct omap_hwmod omap44xx_dmic_hwmod = { | ||
1000 | .name = "dmic", | ||
1001 | .class = &omap44xx_dmic_hwmod_class, | ||
1002 | .mpu_irqs = omap44xx_dmic_irqs, | ||
1003 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dmic_irqs), | ||
1004 | .sdma_reqs = omap44xx_dmic_sdma_reqs, | ||
1005 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dmic_sdma_reqs), | ||
1006 | .main_clk = "dmic_fck", | ||
1007 | .prcm = { | ||
1008 | .omap4 = { | ||
1009 | .clkctrl_reg = OMAP4430_CM1_ABE_DMIC_CLKCTRL, | ||
1010 | }, | ||
1011 | }, | ||
1012 | .slaves = omap44xx_dmic_slaves, | ||
1013 | .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves), | ||
1014 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1015 | }; | ||
1016 | |||
1017 | /* | ||
665 | * 'dsp' class | 1018 | * 'dsp' class |
666 | * dsp sub-system | 1019 | * dsp sub-system |
667 | */ | 1020 | */ |
@@ -747,6 +1100,590 @@ static struct omap_hwmod omap44xx_dsp_hwmod = { | |||
747 | }; | 1100 | }; |
748 | 1101 | ||
749 | /* | 1102 | /* |
1103 | * 'dss' class | ||
1104 | * display sub-system | ||
1105 | */ | ||
1106 | |||
1107 | static struct omap_hwmod_class_sysconfig omap44xx_dss_sysc = { | ||
1108 | .rev_offs = 0x0000, | ||
1109 | .syss_offs = 0x0014, | ||
1110 | .sysc_flags = SYSS_HAS_RESET_STATUS, | ||
1111 | }; | ||
1112 | |||
1113 | static struct omap_hwmod_class omap44xx_dss_hwmod_class = { | ||
1114 | .name = "dss", | ||
1115 | .sysc = &omap44xx_dss_sysc, | ||
1116 | }; | ||
1117 | |||
1118 | /* dss */ | ||
1119 | /* dss master ports */ | ||
1120 | static struct omap_hwmod_ocp_if *omap44xx_dss_masters[] = { | ||
1121 | &omap44xx_dss__l3_main_1, | ||
1122 | }; | ||
1123 | |||
1124 | static struct omap_hwmod_addr_space omap44xx_dss_dma_addrs[] = { | ||
1125 | { | ||
1126 | .pa_start = 0x58000000, | ||
1127 | .pa_end = 0x5800007f, | ||
1128 | .flags = ADDR_TYPE_RT | ||
1129 | }, | ||
1130 | }; | ||
1131 | |||
1132 | /* l3_main_2 -> dss */ | ||
1133 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss = { | ||
1134 | .master = &omap44xx_l3_main_2_hwmod, | ||
1135 | .slave = &omap44xx_dss_hwmod, | ||
1136 | .clk = "l3_div_ck", | ||
1137 | .addr = omap44xx_dss_dma_addrs, | ||
1138 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dma_addrs), | ||
1139 | .user = OCP_USER_SDMA, | ||
1140 | }; | ||
1141 | |||
1142 | static struct omap_hwmod_addr_space omap44xx_dss_addrs[] = { | ||
1143 | { | ||
1144 | .pa_start = 0x48040000, | ||
1145 | .pa_end = 0x4804007f, | ||
1146 | .flags = ADDR_TYPE_RT | ||
1147 | }, | ||
1148 | }; | ||
1149 | |||
1150 | /* l4_per -> dss */ | ||
1151 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss = { | ||
1152 | .master = &omap44xx_l4_per_hwmod, | ||
1153 | .slave = &omap44xx_dss_hwmod, | ||
1154 | .clk = "l4_div_ck", | ||
1155 | .addr = omap44xx_dss_addrs, | ||
1156 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_addrs), | ||
1157 | .user = OCP_USER_MPU, | ||
1158 | }; | ||
1159 | |||
1160 | /* dss slave ports */ | ||
1161 | static struct omap_hwmod_ocp_if *omap44xx_dss_slaves[] = { | ||
1162 | &omap44xx_l3_main_2__dss, | ||
1163 | &omap44xx_l4_per__dss, | ||
1164 | }; | ||
1165 | |||
1166 | static struct omap_hwmod_opt_clk dss_opt_clks[] = { | ||
1167 | { .role = "sys_clk", .clk = "dss_sys_clk" }, | ||
1168 | { .role = "tv_clk", .clk = "dss_tv_clk" }, | ||
1169 | { .role = "dss_clk", .clk = "dss_dss_clk" }, | ||
1170 | { .role = "video_clk", .clk = "dss_48mhz_clk" }, | ||
1171 | }; | ||
1172 | |||
1173 | static struct omap_hwmod omap44xx_dss_hwmod = { | ||
1174 | .name = "dss_core", | ||
1175 | .class = &omap44xx_dss_hwmod_class, | ||
1176 | .main_clk = "dss_fck", | ||
1177 | .prcm = { | ||
1178 | .omap4 = { | ||
1179 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1180 | }, | ||
1181 | }, | ||
1182 | .opt_clks = dss_opt_clks, | ||
1183 | .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks), | ||
1184 | .slaves = omap44xx_dss_slaves, | ||
1185 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves), | ||
1186 | .masters = omap44xx_dss_masters, | ||
1187 | .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters), | ||
1188 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1189 | }; | ||
1190 | |||
1191 | /* | ||
1192 | * 'dispc' class | ||
1193 | * display controller | ||
1194 | */ | ||
1195 | |||
1196 | static struct omap_hwmod_class_sysconfig omap44xx_dispc_sysc = { | ||
1197 | .rev_offs = 0x0000, | ||
1198 | .sysc_offs = 0x0010, | ||
1199 | .syss_offs = 0x0014, | ||
1200 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | | ||
1201 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_MIDLEMODE | | ||
1202 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | ||
1203 | SYSS_HAS_RESET_STATUS), | ||
1204 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
1205 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
1206 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1207 | }; | ||
1208 | |||
1209 | static struct omap_hwmod_class omap44xx_dispc_hwmod_class = { | ||
1210 | .name = "dispc", | ||
1211 | .sysc = &omap44xx_dispc_sysc, | ||
1212 | }; | ||
1213 | |||
1214 | /* dss_dispc */ | ||
1215 | static struct omap_hwmod omap44xx_dss_dispc_hwmod; | ||
1216 | static struct omap_hwmod_irq_info omap44xx_dss_dispc_irqs[] = { | ||
1217 | { .irq = 25 + OMAP44XX_IRQ_GIC_START }, | ||
1218 | }; | ||
1219 | |||
1220 | static struct omap_hwmod_dma_info omap44xx_dss_dispc_sdma_reqs[] = { | ||
1221 | { .dma_req = 5 + OMAP44XX_DMA_REQ_START }, | ||
1222 | }; | ||
1223 | |||
1224 | static struct omap_hwmod_addr_space omap44xx_dss_dispc_dma_addrs[] = { | ||
1225 | { | ||
1226 | .pa_start = 0x58001000, | ||
1227 | .pa_end = 0x58001fff, | ||
1228 | .flags = ADDR_TYPE_RT | ||
1229 | }, | ||
1230 | }; | ||
1231 | |||
1232 | /* l3_main_2 -> dss_dispc */ | ||
1233 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = { | ||
1234 | .master = &omap44xx_l3_main_2_hwmod, | ||
1235 | .slave = &omap44xx_dss_dispc_hwmod, | ||
1236 | .clk = "l3_div_ck", | ||
1237 | .addr = omap44xx_dss_dispc_dma_addrs, | ||
1238 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dispc_dma_addrs), | ||
1239 | .user = OCP_USER_SDMA, | ||
1240 | }; | ||
1241 | |||
1242 | static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = { | ||
1243 | { | ||
1244 | .pa_start = 0x48041000, | ||
1245 | .pa_end = 0x48041fff, | ||
1246 | .flags = ADDR_TYPE_RT | ||
1247 | }, | ||
1248 | }; | ||
1249 | |||
1250 | /* l4_per -> dss_dispc */ | ||
1251 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = { | ||
1252 | .master = &omap44xx_l4_per_hwmod, | ||
1253 | .slave = &omap44xx_dss_dispc_hwmod, | ||
1254 | .clk = "l4_div_ck", | ||
1255 | .addr = omap44xx_dss_dispc_addrs, | ||
1256 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dispc_addrs), | ||
1257 | .user = OCP_USER_MPU, | ||
1258 | }; | ||
1259 | |||
1260 | /* dss_dispc slave ports */ | ||
1261 | static struct omap_hwmod_ocp_if *omap44xx_dss_dispc_slaves[] = { | ||
1262 | &omap44xx_l3_main_2__dss_dispc, | ||
1263 | &omap44xx_l4_per__dss_dispc, | ||
1264 | }; | ||
1265 | |||
1266 | static struct omap_hwmod omap44xx_dss_dispc_hwmod = { | ||
1267 | .name = "dss_dispc", | ||
1268 | .class = &omap44xx_dispc_hwmod_class, | ||
1269 | .mpu_irqs = omap44xx_dss_dispc_irqs, | ||
1270 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dispc_irqs), | ||
1271 | .sdma_reqs = omap44xx_dss_dispc_sdma_reqs, | ||
1272 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dispc_sdma_reqs), | ||
1273 | .main_clk = "dss_fck", | ||
1274 | .prcm = { | ||
1275 | .omap4 = { | ||
1276 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1277 | }, | ||
1278 | }, | ||
1279 | .slaves = omap44xx_dss_dispc_slaves, | ||
1280 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves), | ||
1281 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1282 | }; | ||
1283 | |||
1284 | /* | ||
1285 | * 'dsi' class | ||
1286 | * display serial interface controller | ||
1287 | */ | ||
1288 | |||
1289 | static struct omap_hwmod_class_sysconfig omap44xx_dsi_sysc = { | ||
1290 | .rev_offs = 0x0000, | ||
1291 | .sysc_offs = 0x0010, | ||
1292 | .syss_offs = 0x0014, | ||
1293 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | | ||
1294 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | | ||
1295 | SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), | ||
1296 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1297 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1298 | }; | ||
1299 | |||
1300 | static struct omap_hwmod_class omap44xx_dsi_hwmod_class = { | ||
1301 | .name = "dsi", | ||
1302 | .sysc = &omap44xx_dsi_sysc, | ||
1303 | }; | ||
1304 | |||
1305 | /* dss_dsi1 */ | ||
1306 | static struct omap_hwmod omap44xx_dss_dsi1_hwmod; | ||
1307 | static struct omap_hwmod_irq_info omap44xx_dss_dsi1_irqs[] = { | ||
1308 | { .irq = 53 + OMAP44XX_IRQ_GIC_START }, | ||
1309 | }; | ||
1310 | |||
1311 | static struct omap_hwmod_dma_info omap44xx_dss_dsi1_sdma_reqs[] = { | ||
1312 | { .dma_req = 74 + OMAP44XX_DMA_REQ_START }, | ||
1313 | }; | ||
1314 | |||
1315 | static struct omap_hwmod_addr_space omap44xx_dss_dsi1_dma_addrs[] = { | ||
1316 | { | ||
1317 | .pa_start = 0x58004000, | ||
1318 | .pa_end = 0x580041ff, | ||
1319 | .flags = ADDR_TYPE_RT | ||
1320 | }, | ||
1321 | }; | ||
1322 | |||
1323 | /* l3_main_2 -> dss_dsi1 */ | ||
1324 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi1 = { | ||
1325 | .master = &omap44xx_l3_main_2_hwmod, | ||
1326 | .slave = &omap44xx_dss_dsi1_hwmod, | ||
1327 | .clk = "l3_div_ck", | ||
1328 | .addr = omap44xx_dss_dsi1_dma_addrs, | ||
1329 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_dma_addrs), | ||
1330 | .user = OCP_USER_SDMA, | ||
1331 | }; | ||
1332 | |||
1333 | static struct omap_hwmod_addr_space omap44xx_dss_dsi1_addrs[] = { | ||
1334 | { | ||
1335 | .pa_start = 0x48044000, | ||
1336 | .pa_end = 0x480441ff, | ||
1337 | .flags = ADDR_TYPE_RT | ||
1338 | }, | ||
1339 | }; | ||
1340 | |||
1341 | /* l4_per -> dss_dsi1 */ | ||
1342 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi1 = { | ||
1343 | .master = &omap44xx_l4_per_hwmod, | ||
1344 | .slave = &omap44xx_dss_dsi1_hwmod, | ||
1345 | .clk = "l4_div_ck", | ||
1346 | .addr = omap44xx_dss_dsi1_addrs, | ||
1347 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_addrs), | ||
1348 | .user = OCP_USER_MPU, | ||
1349 | }; | ||
1350 | |||
1351 | /* dss_dsi1 slave ports */ | ||
1352 | static struct omap_hwmod_ocp_if *omap44xx_dss_dsi1_slaves[] = { | ||
1353 | &omap44xx_l3_main_2__dss_dsi1, | ||
1354 | &omap44xx_l4_per__dss_dsi1, | ||
1355 | }; | ||
1356 | |||
1357 | static struct omap_hwmod omap44xx_dss_dsi1_hwmod = { | ||
1358 | .name = "dss_dsi1", | ||
1359 | .class = &omap44xx_dsi_hwmod_class, | ||
1360 | .mpu_irqs = omap44xx_dss_dsi1_irqs, | ||
1361 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_irqs), | ||
1362 | .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs, | ||
1363 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_sdma_reqs), | ||
1364 | .main_clk = "dss_fck", | ||
1365 | .prcm = { | ||
1366 | .omap4 = { | ||
1367 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1368 | }, | ||
1369 | }, | ||
1370 | .slaves = omap44xx_dss_dsi1_slaves, | ||
1371 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves), | ||
1372 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1373 | }; | ||
1374 | |||
1375 | /* dss_dsi2 */ | ||
1376 | static struct omap_hwmod omap44xx_dss_dsi2_hwmod; | ||
1377 | static struct omap_hwmod_irq_info omap44xx_dss_dsi2_irqs[] = { | ||
1378 | { .irq = 84 + OMAP44XX_IRQ_GIC_START }, | ||
1379 | }; | ||
1380 | |||
1381 | static struct omap_hwmod_dma_info omap44xx_dss_dsi2_sdma_reqs[] = { | ||
1382 | { .dma_req = 83 + OMAP44XX_DMA_REQ_START }, | ||
1383 | }; | ||
1384 | |||
1385 | static struct omap_hwmod_addr_space omap44xx_dss_dsi2_dma_addrs[] = { | ||
1386 | { | ||
1387 | .pa_start = 0x58005000, | ||
1388 | .pa_end = 0x580051ff, | ||
1389 | .flags = ADDR_TYPE_RT | ||
1390 | }, | ||
1391 | }; | ||
1392 | |||
1393 | /* l3_main_2 -> dss_dsi2 */ | ||
1394 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi2 = { | ||
1395 | .master = &omap44xx_l3_main_2_hwmod, | ||
1396 | .slave = &omap44xx_dss_dsi2_hwmod, | ||
1397 | .clk = "l3_div_ck", | ||
1398 | .addr = omap44xx_dss_dsi2_dma_addrs, | ||
1399 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_dma_addrs), | ||
1400 | .user = OCP_USER_SDMA, | ||
1401 | }; | ||
1402 | |||
1403 | static struct omap_hwmod_addr_space omap44xx_dss_dsi2_addrs[] = { | ||
1404 | { | ||
1405 | .pa_start = 0x48045000, | ||
1406 | .pa_end = 0x480451ff, | ||
1407 | .flags = ADDR_TYPE_RT | ||
1408 | }, | ||
1409 | }; | ||
1410 | |||
1411 | /* l4_per -> dss_dsi2 */ | ||
1412 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi2 = { | ||
1413 | .master = &omap44xx_l4_per_hwmod, | ||
1414 | .slave = &omap44xx_dss_dsi2_hwmod, | ||
1415 | .clk = "l4_div_ck", | ||
1416 | .addr = omap44xx_dss_dsi2_addrs, | ||
1417 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_addrs), | ||
1418 | .user = OCP_USER_MPU, | ||
1419 | }; | ||
1420 | |||
1421 | /* dss_dsi2 slave ports */ | ||
1422 | static struct omap_hwmod_ocp_if *omap44xx_dss_dsi2_slaves[] = { | ||
1423 | &omap44xx_l3_main_2__dss_dsi2, | ||
1424 | &omap44xx_l4_per__dss_dsi2, | ||
1425 | }; | ||
1426 | |||
1427 | static struct omap_hwmod omap44xx_dss_dsi2_hwmod = { | ||
1428 | .name = "dss_dsi2", | ||
1429 | .class = &omap44xx_dsi_hwmod_class, | ||
1430 | .mpu_irqs = omap44xx_dss_dsi2_irqs, | ||
1431 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_irqs), | ||
1432 | .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs, | ||
1433 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_sdma_reqs), | ||
1434 | .main_clk = "dss_fck", | ||
1435 | .prcm = { | ||
1436 | .omap4 = { | ||
1437 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1438 | }, | ||
1439 | }, | ||
1440 | .slaves = omap44xx_dss_dsi2_slaves, | ||
1441 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves), | ||
1442 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1443 | }; | ||
1444 | |||
1445 | /* | ||
1446 | * 'hdmi' class | ||
1447 | * hdmi controller | ||
1448 | */ | ||
1449 | |||
1450 | static struct omap_hwmod_class_sysconfig omap44xx_hdmi_sysc = { | ||
1451 | .rev_offs = 0x0000, | ||
1452 | .sysc_offs = 0x0010, | ||
1453 | .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE | | ||
1454 | SYSC_HAS_SOFTRESET), | ||
1455 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
1456 | SIDLE_SMART_WKUP), | ||
1457 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
1458 | }; | ||
1459 | |||
1460 | static struct omap_hwmod_class omap44xx_hdmi_hwmod_class = { | ||
1461 | .name = "hdmi", | ||
1462 | .sysc = &omap44xx_hdmi_sysc, | ||
1463 | }; | ||
1464 | |||
1465 | /* dss_hdmi */ | ||
1466 | static struct omap_hwmod omap44xx_dss_hdmi_hwmod; | ||
1467 | static struct omap_hwmod_irq_info omap44xx_dss_hdmi_irqs[] = { | ||
1468 | { .irq = 101 + OMAP44XX_IRQ_GIC_START }, | ||
1469 | }; | ||
1470 | |||
1471 | static struct omap_hwmod_dma_info omap44xx_dss_hdmi_sdma_reqs[] = { | ||
1472 | { .dma_req = 75 + OMAP44XX_DMA_REQ_START }, | ||
1473 | }; | ||
1474 | |||
1475 | static struct omap_hwmod_addr_space omap44xx_dss_hdmi_dma_addrs[] = { | ||
1476 | { | ||
1477 | .pa_start = 0x58006000, | ||
1478 | .pa_end = 0x58006fff, | ||
1479 | .flags = ADDR_TYPE_RT | ||
1480 | }, | ||
1481 | }; | ||
1482 | |||
1483 | /* l3_main_2 -> dss_hdmi */ | ||
1484 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_hdmi = { | ||
1485 | .master = &omap44xx_l3_main_2_hwmod, | ||
1486 | .slave = &omap44xx_dss_hdmi_hwmod, | ||
1487 | .clk = "l3_div_ck", | ||
1488 | .addr = omap44xx_dss_hdmi_dma_addrs, | ||
1489 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_dma_addrs), | ||
1490 | .user = OCP_USER_SDMA, | ||
1491 | }; | ||
1492 | |||
1493 | static struct omap_hwmod_addr_space omap44xx_dss_hdmi_addrs[] = { | ||
1494 | { | ||
1495 | .pa_start = 0x48046000, | ||
1496 | .pa_end = 0x48046fff, | ||
1497 | .flags = ADDR_TYPE_RT | ||
1498 | }, | ||
1499 | }; | ||
1500 | |||
1501 | /* l4_per -> dss_hdmi */ | ||
1502 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_hdmi = { | ||
1503 | .master = &omap44xx_l4_per_hwmod, | ||
1504 | .slave = &omap44xx_dss_hdmi_hwmod, | ||
1505 | .clk = "l4_div_ck", | ||
1506 | .addr = omap44xx_dss_hdmi_addrs, | ||
1507 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_addrs), | ||
1508 | .user = OCP_USER_MPU, | ||
1509 | }; | ||
1510 | |||
1511 | /* dss_hdmi slave ports */ | ||
1512 | static struct omap_hwmod_ocp_if *omap44xx_dss_hdmi_slaves[] = { | ||
1513 | &omap44xx_l3_main_2__dss_hdmi, | ||
1514 | &omap44xx_l4_per__dss_hdmi, | ||
1515 | }; | ||
1516 | |||
1517 | static struct omap_hwmod omap44xx_dss_hdmi_hwmod = { | ||
1518 | .name = "dss_hdmi", | ||
1519 | .class = &omap44xx_hdmi_hwmod_class, | ||
1520 | .mpu_irqs = omap44xx_dss_hdmi_irqs, | ||
1521 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_irqs), | ||
1522 | .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs, | ||
1523 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_sdma_reqs), | ||
1524 | .main_clk = "dss_fck", | ||
1525 | .prcm = { | ||
1526 | .omap4 = { | ||
1527 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1528 | }, | ||
1529 | }, | ||
1530 | .slaves = omap44xx_dss_hdmi_slaves, | ||
1531 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves), | ||
1532 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1533 | }; | ||
1534 | |||
1535 | /* | ||
1536 | * 'rfbi' class | ||
1537 | * remote frame buffer interface | ||
1538 | */ | ||
1539 | |||
1540 | static struct omap_hwmod_class_sysconfig omap44xx_rfbi_sysc = { | ||
1541 | .rev_offs = 0x0000, | ||
1542 | .sysc_offs = 0x0010, | ||
1543 | .syss_offs = 0x0014, | ||
1544 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE | | ||
1545 | SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), | ||
1546 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
1547 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
1548 | }; | ||
1549 | |||
1550 | static struct omap_hwmod_class omap44xx_rfbi_hwmod_class = { | ||
1551 | .name = "rfbi", | ||
1552 | .sysc = &omap44xx_rfbi_sysc, | ||
1553 | }; | ||
1554 | |||
1555 | /* dss_rfbi */ | ||
1556 | static struct omap_hwmod omap44xx_dss_rfbi_hwmod; | ||
1557 | static struct omap_hwmod_dma_info omap44xx_dss_rfbi_sdma_reqs[] = { | ||
1558 | { .dma_req = 13 + OMAP44XX_DMA_REQ_START }, | ||
1559 | }; | ||
1560 | |||
1561 | static struct omap_hwmod_addr_space omap44xx_dss_rfbi_dma_addrs[] = { | ||
1562 | { | ||
1563 | .pa_start = 0x58002000, | ||
1564 | .pa_end = 0x580020ff, | ||
1565 | .flags = ADDR_TYPE_RT | ||
1566 | }, | ||
1567 | }; | ||
1568 | |||
1569 | /* l3_main_2 -> dss_rfbi */ | ||
1570 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_rfbi = { | ||
1571 | .master = &omap44xx_l3_main_2_hwmod, | ||
1572 | .slave = &omap44xx_dss_rfbi_hwmod, | ||
1573 | .clk = "l3_div_ck", | ||
1574 | .addr = omap44xx_dss_rfbi_dma_addrs, | ||
1575 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_dma_addrs), | ||
1576 | .user = OCP_USER_SDMA, | ||
1577 | }; | ||
1578 | |||
1579 | static struct omap_hwmod_addr_space omap44xx_dss_rfbi_addrs[] = { | ||
1580 | { | ||
1581 | .pa_start = 0x48042000, | ||
1582 | .pa_end = 0x480420ff, | ||
1583 | .flags = ADDR_TYPE_RT | ||
1584 | }, | ||
1585 | }; | ||
1586 | |||
1587 | /* l4_per -> dss_rfbi */ | ||
1588 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_rfbi = { | ||
1589 | .master = &omap44xx_l4_per_hwmod, | ||
1590 | .slave = &omap44xx_dss_rfbi_hwmod, | ||
1591 | .clk = "l4_div_ck", | ||
1592 | .addr = omap44xx_dss_rfbi_addrs, | ||
1593 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_addrs), | ||
1594 | .user = OCP_USER_MPU, | ||
1595 | }; | ||
1596 | |||
1597 | /* dss_rfbi slave ports */ | ||
1598 | static struct omap_hwmod_ocp_if *omap44xx_dss_rfbi_slaves[] = { | ||
1599 | &omap44xx_l3_main_2__dss_rfbi, | ||
1600 | &omap44xx_l4_per__dss_rfbi, | ||
1601 | }; | ||
1602 | |||
1603 | static struct omap_hwmod omap44xx_dss_rfbi_hwmod = { | ||
1604 | .name = "dss_rfbi", | ||
1605 | .class = &omap44xx_rfbi_hwmod_class, | ||
1606 | .sdma_reqs = omap44xx_dss_rfbi_sdma_reqs, | ||
1607 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_sdma_reqs), | ||
1608 | .main_clk = "dss_fck", | ||
1609 | .prcm = { | ||
1610 | .omap4 = { | ||
1611 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1612 | }, | ||
1613 | }, | ||
1614 | .slaves = omap44xx_dss_rfbi_slaves, | ||
1615 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves), | ||
1616 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1617 | }; | ||
1618 | |||
1619 | /* | ||
1620 | * 'venc' class | ||
1621 | * video encoder | ||
1622 | */ | ||
1623 | |||
1624 | static struct omap_hwmod_class omap44xx_venc_hwmod_class = { | ||
1625 | .name = "venc", | ||
1626 | }; | ||
1627 | |||
1628 | /* dss_venc */ | ||
1629 | static struct omap_hwmod omap44xx_dss_venc_hwmod; | ||
1630 | static struct omap_hwmod_addr_space omap44xx_dss_venc_dma_addrs[] = { | ||
1631 | { | ||
1632 | .pa_start = 0x58003000, | ||
1633 | .pa_end = 0x580030ff, | ||
1634 | .flags = ADDR_TYPE_RT | ||
1635 | }, | ||
1636 | }; | ||
1637 | |||
1638 | /* l3_main_2 -> dss_venc */ | ||
1639 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_venc = { | ||
1640 | .master = &omap44xx_l3_main_2_hwmod, | ||
1641 | .slave = &omap44xx_dss_venc_hwmod, | ||
1642 | .clk = "l3_div_ck", | ||
1643 | .addr = omap44xx_dss_venc_dma_addrs, | ||
1644 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_venc_dma_addrs), | ||
1645 | .user = OCP_USER_SDMA, | ||
1646 | }; | ||
1647 | |||
1648 | static struct omap_hwmod_addr_space omap44xx_dss_venc_addrs[] = { | ||
1649 | { | ||
1650 | .pa_start = 0x48043000, | ||
1651 | .pa_end = 0x480430ff, | ||
1652 | .flags = ADDR_TYPE_RT | ||
1653 | }, | ||
1654 | }; | ||
1655 | |||
1656 | /* l4_per -> dss_venc */ | ||
1657 | static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_venc = { | ||
1658 | .master = &omap44xx_l4_per_hwmod, | ||
1659 | .slave = &omap44xx_dss_venc_hwmod, | ||
1660 | .clk = "l4_div_ck", | ||
1661 | .addr = omap44xx_dss_venc_addrs, | ||
1662 | .addr_cnt = ARRAY_SIZE(omap44xx_dss_venc_addrs), | ||
1663 | .user = OCP_USER_MPU, | ||
1664 | }; | ||
1665 | |||
1666 | /* dss_venc slave ports */ | ||
1667 | static struct omap_hwmod_ocp_if *omap44xx_dss_venc_slaves[] = { | ||
1668 | &omap44xx_l3_main_2__dss_venc, | ||
1669 | &omap44xx_l4_per__dss_venc, | ||
1670 | }; | ||
1671 | |||
1672 | static struct omap_hwmod omap44xx_dss_venc_hwmod = { | ||
1673 | .name = "dss_venc", | ||
1674 | .class = &omap44xx_venc_hwmod_class, | ||
1675 | .main_clk = "dss_fck", | ||
1676 | .prcm = { | ||
1677 | .omap4 = { | ||
1678 | .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | ||
1679 | }, | ||
1680 | }, | ||
1681 | .slaves = omap44xx_dss_venc_slaves, | ||
1682 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves), | ||
1683 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1684 | }; | ||
1685 | |||
1686 | /* | ||
750 | * 'gpio' class | 1687 | * 'gpio' class |
751 | * general purpose io module | 1688 | * general purpose io module |
752 | */ | 1689 | */ |
@@ -1093,6 +2030,83 @@ static struct omap_hwmod omap44xx_gpio6_hwmod = { | |||
1093 | }; | 2030 | }; |
1094 | 2031 | ||
1095 | /* | 2032 | /* |
2033 | * 'hsi' class | ||
2034 | * mipi high-speed synchronous serial interface (multichannel and full-duplex | ||
2035 | * serial if) | ||
2036 | */ | ||
2037 | |||
2038 | static struct omap_hwmod_class_sysconfig omap44xx_hsi_sysc = { | ||
2039 | .rev_offs = 0x0000, | ||
2040 | .sysc_offs = 0x0010, | ||
2041 | .syss_offs = 0x0014, | ||
2042 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE | | ||
2043 | SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE | | ||
2044 | SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), | ||
2045 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
2046 | SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | | ||
2047 | MSTANDBY_SMART), | ||
2048 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2049 | }; | ||
2050 | |||
2051 | static struct omap_hwmod_class omap44xx_hsi_hwmod_class = { | ||
2052 | .name = "hsi", | ||
2053 | .sysc = &omap44xx_hsi_sysc, | ||
2054 | }; | ||
2055 | |||
2056 | /* hsi */ | ||
2057 | static struct omap_hwmod_irq_info omap44xx_hsi_irqs[] = { | ||
2058 | { .name = "mpu_p1", .irq = 67 + OMAP44XX_IRQ_GIC_START }, | ||
2059 | { .name = "mpu_p2", .irq = 68 + OMAP44XX_IRQ_GIC_START }, | ||
2060 | { .name = "mpu_dma", .irq = 71 + OMAP44XX_IRQ_GIC_START }, | ||
2061 | }; | ||
2062 | |||
2063 | /* hsi master ports */ | ||
2064 | static struct omap_hwmod_ocp_if *omap44xx_hsi_masters[] = { | ||
2065 | &omap44xx_hsi__l3_main_2, | ||
2066 | }; | ||
2067 | |||
2068 | static struct omap_hwmod_addr_space omap44xx_hsi_addrs[] = { | ||
2069 | { | ||
2070 | .pa_start = 0x4a058000, | ||
2071 | .pa_end = 0x4a05bfff, | ||
2072 | .flags = ADDR_TYPE_RT | ||
2073 | }, | ||
2074 | }; | ||
2075 | |||
2076 | /* l4_cfg -> hsi */ | ||
2077 | static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = { | ||
2078 | .master = &omap44xx_l4_cfg_hwmod, | ||
2079 | .slave = &omap44xx_hsi_hwmod, | ||
2080 | .clk = "l4_div_ck", | ||
2081 | .addr = omap44xx_hsi_addrs, | ||
2082 | .addr_cnt = ARRAY_SIZE(omap44xx_hsi_addrs), | ||
2083 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2084 | }; | ||
2085 | |||
2086 | /* hsi slave ports */ | ||
2087 | static struct omap_hwmod_ocp_if *omap44xx_hsi_slaves[] = { | ||
2088 | &omap44xx_l4_cfg__hsi, | ||
2089 | }; | ||
2090 | |||
2091 | static struct omap_hwmod omap44xx_hsi_hwmod = { | ||
2092 | .name = "hsi", | ||
2093 | .class = &omap44xx_hsi_hwmod_class, | ||
2094 | .mpu_irqs = omap44xx_hsi_irqs, | ||
2095 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_hsi_irqs), | ||
2096 | .main_clk = "hsi_fck", | ||
2097 | .prcm = { | ||
2098 | .omap4 = { | ||
2099 | .clkctrl_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL, | ||
2100 | }, | ||
2101 | }, | ||
2102 | .slaves = omap44xx_hsi_slaves, | ||
2103 | .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves), | ||
2104 | .masters = omap44xx_hsi_masters, | ||
2105 | .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters), | ||
2106 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2107 | }; | ||
2108 | |||
2109 | /* | ||
1096 | * 'i2c' class | 2110 | * 'i2c' class |
1097 | * multimaster high-speed i2c controller | 2111 | * multimaster high-speed i2c controller |
1098 | */ | 2112 | */ |
@@ -1326,6 +2340,188 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = { | |||
1326 | }; | 2340 | }; |
1327 | 2341 | ||
1328 | /* | 2342 | /* |
2343 | * 'ipu' class | ||
2344 | * imaging processor unit | ||
2345 | */ | ||
2346 | |||
2347 | static struct omap_hwmod_class omap44xx_ipu_hwmod_class = { | ||
2348 | .name = "ipu", | ||
2349 | }; | ||
2350 | |||
2351 | /* ipu */ | ||
2352 | static struct omap_hwmod_irq_info omap44xx_ipu_irqs[] = { | ||
2353 | { .irq = 100 + OMAP44XX_IRQ_GIC_START }, | ||
2354 | }; | ||
2355 | |||
2356 | static struct omap_hwmod_rst_info omap44xx_ipu_c0_resets[] = { | ||
2357 | { .name = "cpu0", .rst_shift = 0 }, | ||
2358 | }; | ||
2359 | |||
2360 | static struct omap_hwmod_rst_info omap44xx_ipu_c1_resets[] = { | ||
2361 | { .name = "cpu1", .rst_shift = 1 }, | ||
2362 | }; | ||
2363 | |||
2364 | static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = { | ||
2365 | { .name = "mmu_cache", .rst_shift = 2 }, | ||
2366 | }; | ||
2367 | |||
2368 | /* ipu master ports */ | ||
2369 | static struct omap_hwmod_ocp_if *omap44xx_ipu_masters[] = { | ||
2370 | &omap44xx_ipu__l3_main_2, | ||
2371 | }; | ||
2372 | |||
2373 | /* l3_main_2 -> ipu */ | ||
2374 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ipu = { | ||
2375 | .master = &omap44xx_l3_main_2_hwmod, | ||
2376 | .slave = &omap44xx_ipu_hwmod, | ||
2377 | .clk = "l3_div_ck", | ||
2378 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2379 | }; | ||
2380 | |||
2381 | /* ipu slave ports */ | ||
2382 | static struct omap_hwmod_ocp_if *omap44xx_ipu_slaves[] = { | ||
2383 | &omap44xx_l3_main_2__ipu, | ||
2384 | }; | ||
2385 | |||
2386 | /* Pseudo hwmod for reset control purpose only */ | ||
2387 | static struct omap_hwmod omap44xx_ipu_c0_hwmod = { | ||
2388 | .name = "ipu_c0", | ||
2389 | .class = &omap44xx_ipu_hwmod_class, | ||
2390 | .flags = HWMOD_INIT_NO_RESET, | ||
2391 | .rst_lines = omap44xx_ipu_c0_resets, | ||
2392 | .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_c0_resets), | ||
2393 | .prcm = { | ||
2394 | .omap4 = { | ||
2395 | .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL, | ||
2396 | }, | ||
2397 | }, | ||
2398 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2399 | }; | ||
2400 | |||
2401 | /* Pseudo hwmod for reset control purpose only */ | ||
2402 | static struct omap_hwmod omap44xx_ipu_c1_hwmod = { | ||
2403 | .name = "ipu_c1", | ||
2404 | .class = &omap44xx_ipu_hwmod_class, | ||
2405 | .flags = HWMOD_INIT_NO_RESET, | ||
2406 | .rst_lines = omap44xx_ipu_c1_resets, | ||
2407 | .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_c1_resets), | ||
2408 | .prcm = { | ||
2409 | .omap4 = { | ||
2410 | .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL, | ||
2411 | }, | ||
2412 | }, | ||
2413 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2414 | }; | ||
2415 | |||
2416 | static struct omap_hwmod omap44xx_ipu_hwmod = { | ||
2417 | .name = "ipu", | ||
2418 | .class = &omap44xx_ipu_hwmod_class, | ||
2419 | .mpu_irqs = omap44xx_ipu_irqs, | ||
2420 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_ipu_irqs), | ||
2421 | .rst_lines = omap44xx_ipu_resets, | ||
2422 | .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_resets), | ||
2423 | .main_clk = "ipu_fck", | ||
2424 | .prcm = { | ||
2425 | .omap4 = { | ||
2426 | .clkctrl_reg = OMAP4430_CM_DUCATI_DUCATI_CLKCTRL, | ||
2427 | .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL, | ||
2428 | }, | ||
2429 | }, | ||
2430 | .slaves = omap44xx_ipu_slaves, | ||
2431 | .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves), | ||
2432 | .masters = omap44xx_ipu_masters, | ||
2433 | .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters), | ||
2434 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2435 | }; | ||
2436 | |||
2437 | /* | ||
2438 | * 'iss' class | ||
2439 | * external images sensor pixel data processor | ||
2440 | */ | ||
2441 | |||
2442 | static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = { | ||
2443 | .rev_offs = 0x0000, | ||
2444 | .sysc_offs = 0x0010, | ||
2445 | .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS | | ||
2446 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
2447 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
2448 | SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | | ||
2449 | MSTANDBY_SMART), | ||
2450 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
2451 | }; | ||
2452 | |||
2453 | static struct omap_hwmod_class omap44xx_iss_hwmod_class = { | ||
2454 | .name = "iss", | ||
2455 | .sysc = &omap44xx_iss_sysc, | ||
2456 | }; | ||
2457 | |||
2458 | /* iss */ | ||
2459 | static struct omap_hwmod_irq_info omap44xx_iss_irqs[] = { | ||
2460 | { .irq = 24 + OMAP44XX_IRQ_GIC_START }, | ||
2461 | }; | ||
2462 | |||
2463 | static struct omap_hwmod_dma_info omap44xx_iss_sdma_reqs[] = { | ||
2464 | { .name = "1", .dma_req = 8 + OMAP44XX_DMA_REQ_START }, | ||
2465 | { .name = "2", .dma_req = 9 + OMAP44XX_DMA_REQ_START }, | ||
2466 | { .name = "3", .dma_req = 11 + OMAP44XX_DMA_REQ_START }, | ||
2467 | { .name = "4", .dma_req = 12 + OMAP44XX_DMA_REQ_START }, | ||
2468 | }; | ||
2469 | |||
2470 | /* iss master ports */ | ||
2471 | static struct omap_hwmod_ocp_if *omap44xx_iss_masters[] = { | ||
2472 | &omap44xx_iss__l3_main_2, | ||
2473 | }; | ||
2474 | |||
2475 | static struct omap_hwmod_addr_space omap44xx_iss_addrs[] = { | ||
2476 | { | ||
2477 | .pa_start = 0x52000000, | ||
2478 | .pa_end = 0x520000ff, | ||
2479 | .flags = ADDR_TYPE_RT | ||
2480 | }, | ||
2481 | }; | ||
2482 | |||
2483 | /* l3_main_2 -> iss */ | ||
2484 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = { | ||
2485 | .master = &omap44xx_l3_main_2_hwmod, | ||
2486 | .slave = &omap44xx_iss_hwmod, | ||
2487 | .clk = "l3_div_ck", | ||
2488 | .addr = omap44xx_iss_addrs, | ||
2489 | .addr_cnt = ARRAY_SIZE(omap44xx_iss_addrs), | ||
2490 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2491 | }; | ||
2492 | |||
2493 | /* iss slave ports */ | ||
2494 | static struct omap_hwmod_ocp_if *omap44xx_iss_slaves[] = { | ||
2495 | &omap44xx_l3_main_2__iss, | ||
2496 | }; | ||
2497 | |||
2498 | static struct omap_hwmod_opt_clk iss_opt_clks[] = { | ||
2499 | { .role = "ctrlclk", .clk = "iss_ctrlclk" }, | ||
2500 | }; | ||
2501 | |||
2502 | static struct omap_hwmod omap44xx_iss_hwmod = { | ||
2503 | .name = "iss", | ||
2504 | .class = &omap44xx_iss_hwmod_class, | ||
2505 | .mpu_irqs = omap44xx_iss_irqs, | ||
2506 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_iss_irqs), | ||
2507 | .sdma_reqs = omap44xx_iss_sdma_reqs, | ||
2508 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_iss_sdma_reqs), | ||
2509 | .main_clk = "iss_fck", | ||
2510 | .prcm = { | ||
2511 | .omap4 = { | ||
2512 | .clkctrl_reg = OMAP4430_CM_CAM_ISS_CLKCTRL, | ||
2513 | }, | ||
2514 | }, | ||
2515 | .opt_clks = iss_opt_clks, | ||
2516 | .opt_clks_cnt = ARRAY_SIZE(iss_opt_clks), | ||
2517 | .slaves = omap44xx_iss_slaves, | ||
2518 | .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves), | ||
2519 | .masters = omap44xx_iss_masters, | ||
2520 | .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters), | ||
2521 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2522 | }; | ||
2523 | |||
2524 | /* | ||
1329 | * 'iva' class | 2525 | * 'iva' class |
1330 | * multi-standard video encoder/decoder hardware accelerator | 2526 | * multi-standard video encoder/decoder hardware accelerator |
1331 | */ | 2527 | */ |
@@ -1435,6 +2631,1084 @@ static struct omap_hwmod omap44xx_iva_hwmod = { | |||
1435 | }; | 2631 | }; |
1436 | 2632 | ||
1437 | /* | 2633 | /* |
2634 | * 'kbd' class | ||
2635 | * keyboard controller | ||
2636 | */ | ||
2637 | |||
2638 | static struct omap_hwmod_class_sysconfig omap44xx_kbd_sysc = { | ||
2639 | .rev_offs = 0x0000, | ||
2640 | .sysc_offs = 0x0010, | ||
2641 | .syss_offs = 0x0014, | ||
2642 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | | ||
2643 | SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP | | ||
2644 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | ||
2645 | SYSS_HAS_RESET_STATUS), | ||
2646 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
2647 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2648 | }; | ||
2649 | |||
2650 | static struct omap_hwmod_class omap44xx_kbd_hwmod_class = { | ||
2651 | .name = "kbd", | ||
2652 | .sysc = &omap44xx_kbd_sysc, | ||
2653 | }; | ||
2654 | |||
2655 | /* kbd */ | ||
2656 | static struct omap_hwmod omap44xx_kbd_hwmod; | ||
2657 | static struct omap_hwmod_irq_info omap44xx_kbd_irqs[] = { | ||
2658 | { .irq = 120 + OMAP44XX_IRQ_GIC_START }, | ||
2659 | }; | ||
2660 | |||
2661 | static struct omap_hwmod_addr_space omap44xx_kbd_addrs[] = { | ||
2662 | { | ||
2663 | .pa_start = 0x4a31c000, | ||
2664 | .pa_end = 0x4a31c07f, | ||
2665 | .flags = ADDR_TYPE_RT | ||
2666 | }, | ||
2667 | }; | ||
2668 | |||
2669 | /* l4_wkup -> kbd */ | ||
2670 | static struct omap_hwmod_ocp_if omap44xx_l4_wkup__kbd = { | ||
2671 | .master = &omap44xx_l4_wkup_hwmod, | ||
2672 | .slave = &omap44xx_kbd_hwmod, | ||
2673 | .clk = "l4_wkup_clk_mux_ck", | ||
2674 | .addr = omap44xx_kbd_addrs, | ||
2675 | .addr_cnt = ARRAY_SIZE(omap44xx_kbd_addrs), | ||
2676 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2677 | }; | ||
2678 | |||
2679 | /* kbd slave ports */ | ||
2680 | static struct omap_hwmod_ocp_if *omap44xx_kbd_slaves[] = { | ||
2681 | &omap44xx_l4_wkup__kbd, | ||
2682 | }; | ||
2683 | |||
2684 | static struct omap_hwmod omap44xx_kbd_hwmod = { | ||
2685 | .name = "kbd", | ||
2686 | .class = &omap44xx_kbd_hwmod_class, | ||
2687 | .mpu_irqs = omap44xx_kbd_irqs, | ||
2688 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_kbd_irqs), | ||
2689 | .main_clk = "kbd_fck", | ||
2690 | .prcm = { | ||
2691 | .omap4 = { | ||
2692 | .clkctrl_reg = OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL, | ||
2693 | }, | ||
2694 | }, | ||
2695 | .slaves = omap44xx_kbd_slaves, | ||
2696 | .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves), | ||
2697 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2698 | }; | ||
2699 | |||
2700 | /* | ||
2701 | * 'mailbox' class | ||
2702 | * mailbox module allowing communication between the on-chip processors using a | ||
2703 | * queued mailbox-interrupt mechanism. | ||
2704 | */ | ||
2705 | |||
2706 | static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = { | ||
2707 | .rev_offs = 0x0000, | ||
2708 | .sysc_offs = 0x0010, | ||
2709 | .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE | | ||
2710 | SYSC_HAS_SOFTRESET), | ||
2711 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
2712 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
2713 | }; | ||
2714 | |||
2715 | static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = { | ||
2716 | .name = "mailbox", | ||
2717 | .sysc = &omap44xx_mailbox_sysc, | ||
2718 | }; | ||
2719 | |||
2720 | /* mailbox */ | ||
2721 | static struct omap_hwmod omap44xx_mailbox_hwmod; | ||
2722 | static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = { | ||
2723 | { .irq = 26 + OMAP44XX_IRQ_GIC_START }, | ||
2724 | }; | ||
2725 | |||
2726 | static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = { | ||
2727 | { | ||
2728 | .pa_start = 0x4a0f4000, | ||
2729 | .pa_end = 0x4a0f41ff, | ||
2730 | .flags = ADDR_TYPE_RT | ||
2731 | }, | ||
2732 | }; | ||
2733 | |||
2734 | /* l4_cfg -> mailbox */ | ||
2735 | static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = { | ||
2736 | .master = &omap44xx_l4_cfg_hwmod, | ||
2737 | .slave = &omap44xx_mailbox_hwmod, | ||
2738 | .clk = "l4_div_ck", | ||
2739 | .addr = omap44xx_mailbox_addrs, | ||
2740 | .addr_cnt = ARRAY_SIZE(omap44xx_mailbox_addrs), | ||
2741 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
2742 | }; | ||
2743 | |||
2744 | /* mailbox slave ports */ | ||
2745 | static struct omap_hwmod_ocp_if *omap44xx_mailbox_slaves[] = { | ||
2746 | &omap44xx_l4_cfg__mailbox, | ||
2747 | }; | ||
2748 | |||
2749 | static struct omap_hwmod omap44xx_mailbox_hwmod = { | ||
2750 | .name = "mailbox", | ||
2751 | .class = &omap44xx_mailbox_hwmod_class, | ||
2752 | .mpu_irqs = omap44xx_mailbox_irqs, | ||
2753 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mailbox_irqs), | ||
2754 | .prcm = { | ||
2755 | .omap4 = { | ||
2756 | .clkctrl_reg = OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL, | ||
2757 | }, | ||
2758 | }, | ||
2759 | .slaves = omap44xx_mailbox_slaves, | ||
2760 | .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves), | ||
2761 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2762 | }; | ||
2763 | |||
2764 | /* | ||
2765 | * 'mcbsp' class | ||
2766 | * multi channel buffered serial port controller | ||
2767 | */ | ||
2768 | |||
2769 | static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = { | ||
2770 | .sysc_offs = 0x008c, | ||
2771 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP | | ||
2772 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
2773 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
2774 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
2775 | }; | ||
2776 | |||
2777 | static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = { | ||
2778 | .name = "mcbsp", | ||
2779 | .sysc = &omap44xx_mcbsp_sysc, | ||
2780 | .rev = MCBSP_CONFIG_TYPE4, | ||
2781 | }; | ||
2782 | |||
2783 | /* mcbsp1 */ | ||
2784 | static struct omap_hwmod omap44xx_mcbsp1_hwmod; | ||
2785 | static struct omap_hwmod_irq_info omap44xx_mcbsp1_irqs[] = { | ||
2786 | { .irq = 17 + OMAP44XX_IRQ_GIC_START }, | ||
2787 | }; | ||
2788 | |||
2789 | static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = { | ||
2790 | { .name = "tx", .dma_req = 32 + OMAP44XX_DMA_REQ_START }, | ||
2791 | { .name = "rx", .dma_req = 33 + OMAP44XX_DMA_REQ_START }, | ||
2792 | }; | ||
2793 | |||
2794 | static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = { | ||
2795 | { | ||
2796 | .name = "mpu", | ||
2797 | .pa_start = 0x40122000, | ||
2798 | .pa_end = 0x401220ff, | ||
2799 | .flags = ADDR_TYPE_RT | ||
2800 | }, | ||
2801 | }; | ||
2802 | |||
2803 | /* l4_abe -> mcbsp1 */ | ||
2804 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = { | ||
2805 | .master = &omap44xx_l4_abe_hwmod, | ||
2806 | .slave = &omap44xx_mcbsp1_hwmod, | ||
2807 | .clk = "ocp_abe_iclk", | ||
2808 | .addr = omap44xx_mcbsp1_addrs, | ||
2809 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_addrs), | ||
2810 | .user = OCP_USER_MPU, | ||
2811 | }; | ||
2812 | |||
2813 | static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = { | ||
2814 | { | ||
2815 | .name = "dma", | ||
2816 | .pa_start = 0x49022000, | ||
2817 | .pa_end = 0x490220ff, | ||
2818 | .flags = ADDR_TYPE_RT | ||
2819 | }, | ||
2820 | }; | ||
2821 | |||
2822 | /* l4_abe -> mcbsp1 (dma) */ | ||
2823 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1_dma = { | ||
2824 | .master = &omap44xx_l4_abe_hwmod, | ||
2825 | .slave = &omap44xx_mcbsp1_hwmod, | ||
2826 | .clk = "ocp_abe_iclk", | ||
2827 | .addr = omap44xx_mcbsp1_dma_addrs, | ||
2828 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_dma_addrs), | ||
2829 | .user = OCP_USER_SDMA, | ||
2830 | }; | ||
2831 | |||
2832 | /* mcbsp1 slave ports */ | ||
2833 | static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = { | ||
2834 | &omap44xx_l4_abe__mcbsp1, | ||
2835 | &omap44xx_l4_abe__mcbsp1_dma, | ||
2836 | }; | ||
2837 | |||
2838 | static struct omap_hwmod omap44xx_mcbsp1_hwmod = { | ||
2839 | .name = "mcbsp1", | ||
2840 | .class = &omap44xx_mcbsp_hwmod_class, | ||
2841 | .mpu_irqs = omap44xx_mcbsp1_irqs, | ||
2842 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_irqs), | ||
2843 | .sdma_reqs = omap44xx_mcbsp1_sdma_reqs, | ||
2844 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_sdma_reqs), | ||
2845 | .main_clk = "mcbsp1_fck", | ||
2846 | .prcm = { | ||
2847 | .omap4 = { | ||
2848 | .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP1_CLKCTRL, | ||
2849 | }, | ||
2850 | }, | ||
2851 | .slaves = omap44xx_mcbsp1_slaves, | ||
2852 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), | ||
2853 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2854 | }; | ||
2855 | |||
2856 | /* mcbsp2 */ | ||
2857 | static struct omap_hwmod omap44xx_mcbsp2_hwmod; | ||
2858 | static struct omap_hwmod_irq_info omap44xx_mcbsp2_irqs[] = { | ||
2859 | { .irq = 22 + OMAP44XX_IRQ_GIC_START }, | ||
2860 | }; | ||
2861 | |||
2862 | static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = { | ||
2863 | { .name = "tx", .dma_req = 16 + OMAP44XX_DMA_REQ_START }, | ||
2864 | { .name = "rx", .dma_req = 17 + OMAP44XX_DMA_REQ_START }, | ||
2865 | }; | ||
2866 | |||
2867 | static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = { | ||
2868 | { | ||
2869 | .name = "mpu", | ||
2870 | .pa_start = 0x40124000, | ||
2871 | .pa_end = 0x401240ff, | ||
2872 | .flags = ADDR_TYPE_RT | ||
2873 | }, | ||
2874 | }; | ||
2875 | |||
2876 | /* l4_abe -> mcbsp2 */ | ||
2877 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = { | ||
2878 | .master = &omap44xx_l4_abe_hwmod, | ||
2879 | .slave = &omap44xx_mcbsp2_hwmod, | ||
2880 | .clk = "ocp_abe_iclk", | ||
2881 | .addr = omap44xx_mcbsp2_addrs, | ||
2882 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_addrs), | ||
2883 | .user = OCP_USER_MPU, | ||
2884 | }; | ||
2885 | |||
2886 | static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = { | ||
2887 | { | ||
2888 | .name = "dma", | ||
2889 | .pa_start = 0x49024000, | ||
2890 | .pa_end = 0x490240ff, | ||
2891 | .flags = ADDR_TYPE_RT | ||
2892 | }, | ||
2893 | }; | ||
2894 | |||
2895 | /* l4_abe -> mcbsp2 (dma) */ | ||
2896 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2_dma = { | ||
2897 | .master = &omap44xx_l4_abe_hwmod, | ||
2898 | .slave = &omap44xx_mcbsp2_hwmod, | ||
2899 | .clk = "ocp_abe_iclk", | ||
2900 | .addr = omap44xx_mcbsp2_dma_addrs, | ||
2901 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_dma_addrs), | ||
2902 | .user = OCP_USER_SDMA, | ||
2903 | }; | ||
2904 | |||
2905 | /* mcbsp2 slave ports */ | ||
2906 | static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = { | ||
2907 | &omap44xx_l4_abe__mcbsp2, | ||
2908 | &omap44xx_l4_abe__mcbsp2_dma, | ||
2909 | }; | ||
2910 | |||
2911 | static struct omap_hwmod omap44xx_mcbsp2_hwmod = { | ||
2912 | .name = "mcbsp2", | ||
2913 | .class = &omap44xx_mcbsp_hwmod_class, | ||
2914 | .mpu_irqs = omap44xx_mcbsp2_irqs, | ||
2915 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_irqs), | ||
2916 | .sdma_reqs = omap44xx_mcbsp2_sdma_reqs, | ||
2917 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_sdma_reqs), | ||
2918 | .main_clk = "mcbsp2_fck", | ||
2919 | .prcm = { | ||
2920 | .omap4 = { | ||
2921 | .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP2_CLKCTRL, | ||
2922 | }, | ||
2923 | }, | ||
2924 | .slaves = omap44xx_mcbsp2_slaves, | ||
2925 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), | ||
2926 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2927 | }; | ||
2928 | |||
2929 | /* mcbsp3 */ | ||
2930 | static struct omap_hwmod omap44xx_mcbsp3_hwmod; | ||
2931 | static struct omap_hwmod_irq_info omap44xx_mcbsp3_irqs[] = { | ||
2932 | { .irq = 23 + OMAP44XX_IRQ_GIC_START }, | ||
2933 | }; | ||
2934 | |||
2935 | static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = { | ||
2936 | { .name = "tx", .dma_req = 18 + OMAP44XX_DMA_REQ_START }, | ||
2937 | { .name = "rx", .dma_req = 19 + OMAP44XX_DMA_REQ_START }, | ||
2938 | }; | ||
2939 | |||
2940 | static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = { | ||
2941 | { | ||
2942 | .name = "mpu", | ||
2943 | .pa_start = 0x40126000, | ||
2944 | .pa_end = 0x401260ff, | ||
2945 | .flags = ADDR_TYPE_RT | ||
2946 | }, | ||
2947 | }; | ||
2948 | |||
2949 | /* l4_abe -> mcbsp3 */ | ||
2950 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = { | ||
2951 | .master = &omap44xx_l4_abe_hwmod, | ||
2952 | .slave = &omap44xx_mcbsp3_hwmod, | ||
2953 | .clk = "ocp_abe_iclk", | ||
2954 | .addr = omap44xx_mcbsp3_addrs, | ||
2955 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_addrs), | ||
2956 | .user = OCP_USER_MPU, | ||
2957 | }; | ||
2958 | |||
2959 | static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = { | ||
2960 | { | ||
2961 | .name = "dma", | ||
2962 | .pa_start = 0x49026000, | ||
2963 | .pa_end = 0x490260ff, | ||
2964 | .flags = ADDR_TYPE_RT | ||
2965 | }, | ||
2966 | }; | ||
2967 | |||
2968 | /* l4_abe -> mcbsp3 (dma) */ | ||
2969 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3_dma = { | ||
2970 | .master = &omap44xx_l4_abe_hwmod, | ||
2971 | .slave = &omap44xx_mcbsp3_hwmod, | ||
2972 | .clk = "ocp_abe_iclk", | ||
2973 | .addr = omap44xx_mcbsp3_dma_addrs, | ||
2974 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_dma_addrs), | ||
2975 | .user = OCP_USER_SDMA, | ||
2976 | }; | ||
2977 | |||
2978 | /* mcbsp3 slave ports */ | ||
2979 | static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = { | ||
2980 | &omap44xx_l4_abe__mcbsp3, | ||
2981 | &omap44xx_l4_abe__mcbsp3_dma, | ||
2982 | }; | ||
2983 | |||
2984 | static struct omap_hwmod omap44xx_mcbsp3_hwmod = { | ||
2985 | .name = "mcbsp3", | ||
2986 | .class = &omap44xx_mcbsp_hwmod_class, | ||
2987 | .mpu_irqs = omap44xx_mcbsp3_irqs, | ||
2988 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_irqs), | ||
2989 | .sdma_reqs = omap44xx_mcbsp3_sdma_reqs, | ||
2990 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_sdma_reqs), | ||
2991 | .main_clk = "mcbsp3_fck", | ||
2992 | .prcm = { | ||
2993 | .omap4 = { | ||
2994 | .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP3_CLKCTRL, | ||
2995 | }, | ||
2996 | }, | ||
2997 | .slaves = omap44xx_mcbsp3_slaves, | ||
2998 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), | ||
2999 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3000 | }; | ||
3001 | |||
3002 | /* mcbsp4 */ | ||
3003 | static struct omap_hwmod omap44xx_mcbsp4_hwmod; | ||
3004 | static struct omap_hwmod_irq_info omap44xx_mcbsp4_irqs[] = { | ||
3005 | { .irq = 16 + OMAP44XX_IRQ_GIC_START }, | ||
3006 | }; | ||
3007 | |||
3008 | static struct omap_hwmod_dma_info omap44xx_mcbsp4_sdma_reqs[] = { | ||
3009 | { .name = "tx", .dma_req = 30 + OMAP44XX_DMA_REQ_START }, | ||
3010 | { .name = "rx", .dma_req = 31 + OMAP44XX_DMA_REQ_START }, | ||
3011 | }; | ||
3012 | |||
3013 | static struct omap_hwmod_addr_space omap44xx_mcbsp4_addrs[] = { | ||
3014 | { | ||
3015 | .pa_start = 0x48096000, | ||
3016 | .pa_end = 0x480960ff, | ||
3017 | .flags = ADDR_TYPE_RT | ||
3018 | }, | ||
3019 | }; | ||
3020 | |||
3021 | /* l4_per -> mcbsp4 */ | ||
3022 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mcbsp4 = { | ||
3023 | .master = &omap44xx_l4_per_hwmod, | ||
3024 | .slave = &omap44xx_mcbsp4_hwmod, | ||
3025 | .clk = "l4_div_ck", | ||
3026 | .addr = omap44xx_mcbsp4_addrs, | ||
3027 | .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp4_addrs), | ||
3028 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3029 | }; | ||
3030 | |||
3031 | /* mcbsp4 slave ports */ | ||
3032 | static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = { | ||
3033 | &omap44xx_l4_per__mcbsp4, | ||
3034 | }; | ||
3035 | |||
3036 | static struct omap_hwmod omap44xx_mcbsp4_hwmod = { | ||
3037 | .name = "mcbsp4", | ||
3038 | .class = &omap44xx_mcbsp_hwmod_class, | ||
3039 | .mpu_irqs = omap44xx_mcbsp4_irqs, | ||
3040 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_irqs), | ||
3041 | .sdma_reqs = omap44xx_mcbsp4_sdma_reqs, | ||
3042 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_sdma_reqs), | ||
3043 | .main_clk = "mcbsp4_fck", | ||
3044 | .prcm = { | ||
3045 | .omap4 = { | ||
3046 | .clkctrl_reg = OMAP4430_CM_L4PER_MCBSP4_CLKCTRL, | ||
3047 | }, | ||
3048 | }, | ||
3049 | .slaves = omap44xx_mcbsp4_slaves, | ||
3050 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), | ||
3051 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3052 | }; | ||
3053 | |||
3054 | /* | ||
3055 | * 'mcpdm' class | ||
3056 | * multi channel pdm controller (proprietary interface with phoenix power | ||
3057 | * ic) | ||
3058 | */ | ||
3059 | |||
3060 | static struct omap_hwmod_class_sysconfig omap44xx_mcpdm_sysc = { | ||
3061 | .rev_offs = 0x0000, | ||
3062 | .sysc_offs = 0x0010, | ||
3063 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS | | ||
3064 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
3065 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
3066 | SIDLE_SMART_WKUP), | ||
3067 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
3068 | }; | ||
3069 | |||
3070 | static struct omap_hwmod_class omap44xx_mcpdm_hwmod_class = { | ||
3071 | .name = "mcpdm", | ||
3072 | .sysc = &omap44xx_mcpdm_sysc, | ||
3073 | }; | ||
3074 | |||
3075 | /* mcpdm */ | ||
3076 | static struct omap_hwmod omap44xx_mcpdm_hwmod; | ||
3077 | static struct omap_hwmod_irq_info omap44xx_mcpdm_irqs[] = { | ||
3078 | { .irq = 112 + OMAP44XX_IRQ_GIC_START }, | ||
3079 | }; | ||
3080 | |||
3081 | static struct omap_hwmod_dma_info omap44xx_mcpdm_sdma_reqs[] = { | ||
3082 | { .name = "up_link", .dma_req = 64 + OMAP44XX_DMA_REQ_START }, | ||
3083 | { .name = "dn_link", .dma_req = 65 + OMAP44XX_DMA_REQ_START }, | ||
3084 | }; | ||
3085 | |||
3086 | static struct omap_hwmod_addr_space omap44xx_mcpdm_addrs[] = { | ||
3087 | { | ||
3088 | .pa_start = 0x40132000, | ||
3089 | .pa_end = 0x4013207f, | ||
3090 | .flags = ADDR_TYPE_RT | ||
3091 | }, | ||
3092 | }; | ||
3093 | |||
3094 | /* l4_abe -> mcpdm */ | ||
3095 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm = { | ||
3096 | .master = &omap44xx_l4_abe_hwmod, | ||
3097 | .slave = &omap44xx_mcpdm_hwmod, | ||
3098 | .clk = "ocp_abe_iclk", | ||
3099 | .addr = omap44xx_mcpdm_addrs, | ||
3100 | .addr_cnt = ARRAY_SIZE(omap44xx_mcpdm_addrs), | ||
3101 | .user = OCP_USER_MPU, | ||
3102 | }; | ||
3103 | |||
3104 | static struct omap_hwmod_addr_space omap44xx_mcpdm_dma_addrs[] = { | ||
3105 | { | ||
3106 | .pa_start = 0x49032000, | ||
3107 | .pa_end = 0x4903207f, | ||
3108 | .flags = ADDR_TYPE_RT | ||
3109 | }, | ||
3110 | }; | ||
3111 | |||
3112 | /* l4_abe -> mcpdm (dma) */ | ||
3113 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm_dma = { | ||
3114 | .master = &omap44xx_l4_abe_hwmod, | ||
3115 | .slave = &omap44xx_mcpdm_hwmod, | ||
3116 | .clk = "ocp_abe_iclk", | ||
3117 | .addr = omap44xx_mcpdm_dma_addrs, | ||
3118 | .addr_cnt = ARRAY_SIZE(omap44xx_mcpdm_dma_addrs), | ||
3119 | .user = OCP_USER_SDMA, | ||
3120 | }; | ||
3121 | |||
3122 | /* mcpdm slave ports */ | ||
3123 | static struct omap_hwmod_ocp_if *omap44xx_mcpdm_slaves[] = { | ||
3124 | &omap44xx_l4_abe__mcpdm, | ||
3125 | &omap44xx_l4_abe__mcpdm_dma, | ||
3126 | }; | ||
3127 | |||
3128 | static struct omap_hwmod omap44xx_mcpdm_hwmod = { | ||
3129 | .name = "mcpdm", | ||
3130 | .class = &omap44xx_mcpdm_hwmod_class, | ||
3131 | .mpu_irqs = omap44xx_mcpdm_irqs, | ||
3132 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcpdm_irqs), | ||
3133 | .sdma_reqs = omap44xx_mcpdm_sdma_reqs, | ||
3134 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcpdm_sdma_reqs), | ||
3135 | .main_clk = "mcpdm_fck", | ||
3136 | .prcm = { | ||
3137 | .omap4 = { | ||
3138 | .clkctrl_reg = OMAP4430_CM1_ABE_PDM_CLKCTRL, | ||
3139 | }, | ||
3140 | }, | ||
3141 | .slaves = omap44xx_mcpdm_slaves, | ||
3142 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves), | ||
3143 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3144 | }; | ||
3145 | |||
3146 | /* | ||
3147 | * 'mcspi' class | ||
3148 | * multichannel serial port interface (mcspi) / master/slave synchronous serial | ||
3149 | * bus | ||
3150 | */ | ||
3151 | |||
3152 | static struct omap_hwmod_class_sysconfig omap44xx_mcspi_sysc = { | ||
3153 | .rev_offs = 0x0000, | ||
3154 | .sysc_offs = 0x0010, | ||
3155 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS | | ||
3156 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
3157 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
3158 | SIDLE_SMART_WKUP), | ||
3159 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
3160 | }; | ||
3161 | |||
3162 | static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = { | ||
3163 | .name = "mcspi", | ||
3164 | .sysc = &omap44xx_mcspi_sysc, | ||
3165 | .rev = OMAP4_MCSPI_REV, | ||
3166 | }; | ||
3167 | |||
3168 | /* mcspi1 */ | ||
3169 | static struct omap_hwmod omap44xx_mcspi1_hwmod; | ||
3170 | static struct omap_hwmod_irq_info omap44xx_mcspi1_irqs[] = { | ||
3171 | { .irq = 65 + OMAP44XX_IRQ_GIC_START }, | ||
3172 | }; | ||
3173 | |||
3174 | static struct omap_hwmod_dma_info omap44xx_mcspi1_sdma_reqs[] = { | ||
3175 | { .name = "tx0", .dma_req = 34 + OMAP44XX_DMA_REQ_START }, | ||
3176 | { .name = "rx0", .dma_req = 35 + OMAP44XX_DMA_REQ_START }, | ||
3177 | { .name = "tx1", .dma_req = 36 + OMAP44XX_DMA_REQ_START }, | ||
3178 | { .name = "rx1", .dma_req = 37 + OMAP44XX_DMA_REQ_START }, | ||
3179 | { .name = "tx2", .dma_req = 38 + OMAP44XX_DMA_REQ_START }, | ||
3180 | { .name = "rx2", .dma_req = 39 + OMAP44XX_DMA_REQ_START }, | ||
3181 | { .name = "tx3", .dma_req = 40 + OMAP44XX_DMA_REQ_START }, | ||
3182 | { .name = "rx3", .dma_req = 41 + OMAP44XX_DMA_REQ_START }, | ||
3183 | }; | ||
3184 | |||
3185 | static struct omap_hwmod_addr_space omap44xx_mcspi1_addrs[] = { | ||
3186 | { | ||
3187 | .pa_start = 0x48098000, | ||
3188 | .pa_end = 0x480981ff, | ||
3189 | .flags = ADDR_TYPE_RT | ||
3190 | }, | ||
3191 | }; | ||
3192 | |||
3193 | /* l4_per -> mcspi1 */ | ||
3194 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi1 = { | ||
3195 | .master = &omap44xx_l4_per_hwmod, | ||
3196 | .slave = &omap44xx_mcspi1_hwmod, | ||
3197 | .clk = "l4_div_ck", | ||
3198 | .addr = omap44xx_mcspi1_addrs, | ||
3199 | .addr_cnt = ARRAY_SIZE(omap44xx_mcspi1_addrs), | ||
3200 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3201 | }; | ||
3202 | |||
3203 | /* mcspi1 slave ports */ | ||
3204 | static struct omap_hwmod_ocp_if *omap44xx_mcspi1_slaves[] = { | ||
3205 | &omap44xx_l4_per__mcspi1, | ||
3206 | }; | ||
3207 | |||
3208 | /* mcspi1 dev_attr */ | ||
3209 | static struct omap2_mcspi_dev_attr mcspi1_dev_attr = { | ||
3210 | .num_chipselect = 4, | ||
3211 | }; | ||
3212 | |||
3213 | static struct omap_hwmod omap44xx_mcspi1_hwmod = { | ||
3214 | .name = "mcspi1", | ||
3215 | .class = &omap44xx_mcspi_hwmod_class, | ||
3216 | .mpu_irqs = omap44xx_mcspi1_irqs, | ||
3217 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi1_irqs), | ||
3218 | .sdma_reqs = omap44xx_mcspi1_sdma_reqs, | ||
3219 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi1_sdma_reqs), | ||
3220 | .main_clk = "mcspi1_fck", | ||
3221 | .prcm = { | ||
3222 | .omap4 = { | ||
3223 | .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI1_CLKCTRL, | ||
3224 | }, | ||
3225 | }, | ||
3226 | .dev_attr = &mcspi1_dev_attr, | ||
3227 | .slaves = omap44xx_mcspi1_slaves, | ||
3228 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves), | ||
3229 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3230 | }; | ||
3231 | |||
3232 | /* mcspi2 */ | ||
3233 | static struct omap_hwmod omap44xx_mcspi2_hwmod; | ||
3234 | static struct omap_hwmod_irq_info omap44xx_mcspi2_irqs[] = { | ||
3235 | { .irq = 66 + OMAP44XX_IRQ_GIC_START }, | ||
3236 | }; | ||
3237 | |||
3238 | static struct omap_hwmod_dma_info omap44xx_mcspi2_sdma_reqs[] = { | ||
3239 | { .name = "tx0", .dma_req = 42 + OMAP44XX_DMA_REQ_START }, | ||
3240 | { .name = "rx0", .dma_req = 43 + OMAP44XX_DMA_REQ_START }, | ||
3241 | { .name = "tx1", .dma_req = 44 + OMAP44XX_DMA_REQ_START }, | ||
3242 | { .name = "rx1", .dma_req = 45 + OMAP44XX_DMA_REQ_START }, | ||
3243 | }; | ||
3244 | |||
3245 | static struct omap_hwmod_addr_space omap44xx_mcspi2_addrs[] = { | ||
3246 | { | ||
3247 | .pa_start = 0x4809a000, | ||
3248 | .pa_end = 0x4809a1ff, | ||
3249 | .flags = ADDR_TYPE_RT | ||
3250 | }, | ||
3251 | }; | ||
3252 | |||
3253 | /* l4_per -> mcspi2 */ | ||
3254 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi2 = { | ||
3255 | .master = &omap44xx_l4_per_hwmod, | ||
3256 | .slave = &omap44xx_mcspi2_hwmod, | ||
3257 | .clk = "l4_div_ck", | ||
3258 | .addr = omap44xx_mcspi2_addrs, | ||
3259 | .addr_cnt = ARRAY_SIZE(omap44xx_mcspi2_addrs), | ||
3260 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3261 | }; | ||
3262 | |||
3263 | /* mcspi2 slave ports */ | ||
3264 | static struct omap_hwmod_ocp_if *omap44xx_mcspi2_slaves[] = { | ||
3265 | &omap44xx_l4_per__mcspi2, | ||
3266 | }; | ||
3267 | |||
3268 | /* mcspi2 dev_attr */ | ||
3269 | static struct omap2_mcspi_dev_attr mcspi2_dev_attr = { | ||
3270 | .num_chipselect = 2, | ||
3271 | }; | ||
3272 | |||
3273 | static struct omap_hwmod omap44xx_mcspi2_hwmod = { | ||
3274 | .name = "mcspi2", | ||
3275 | .class = &omap44xx_mcspi_hwmod_class, | ||
3276 | .mpu_irqs = omap44xx_mcspi2_irqs, | ||
3277 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi2_irqs), | ||
3278 | .sdma_reqs = omap44xx_mcspi2_sdma_reqs, | ||
3279 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi2_sdma_reqs), | ||
3280 | .main_clk = "mcspi2_fck", | ||
3281 | .prcm = { | ||
3282 | .omap4 = { | ||
3283 | .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI2_CLKCTRL, | ||
3284 | }, | ||
3285 | }, | ||
3286 | .dev_attr = &mcspi2_dev_attr, | ||
3287 | .slaves = omap44xx_mcspi2_slaves, | ||
3288 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves), | ||
3289 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3290 | }; | ||
3291 | |||
3292 | /* mcspi3 */ | ||
3293 | static struct omap_hwmod omap44xx_mcspi3_hwmod; | ||
3294 | static struct omap_hwmod_irq_info omap44xx_mcspi3_irqs[] = { | ||
3295 | { .irq = 91 + OMAP44XX_IRQ_GIC_START }, | ||
3296 | }; | ||
3297 | |||
3298 | static struct omap_hwmod_dma_info omap44xx_mcspi3_sdma_reqs[] = { | ||
3299 | { .name = "tx0", .dma_req = 14 + OMAP44XX_DMA_REQ_START }, | ||
3300 | { .name = "rx0", .dma_req = 15 + OMAP44XX_DMA_REQ_START }, | ||
3301 | { .name = "tx1", .dma_req = 22 + OMAP44XX_DMA_REQ_START }, | ||
3302 | { .name = "rx1", .dma_req = 23 + OMAP44XX_DMA_REQ_START }, | ||
3303 | }; | ||
3304 | |||
3305 | static struct omap_hwmod_addr_space omap44xx_mcspi3_addrs[] = { | ||
3306 | { | ||
3307 | .pa_start = 0x480b8000, | ||
3308 | .pa_end = 0x480b81ff, | ||
3309 | .flags = ADDR_TYPE_RT | ||
3310 | }, | ||
3311 | }; | ||
3312 | |||
3313 | /* l4_per -> mcspi3 */ | ||
3314 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi3 = { | ||
3315 | .master = &omap44xx_l4_per_hwmod, | ||
3316 | .slave = &omap44xx_mcspi3_hwmod, | ||
3317 | .clk = "l4_div_ck", | ||
3318 | .addr = omap44xx_mcspi3_addrs, | ||
3319 | .addr_cnt = ARRAY_SIZE(omap44xx_mcspi3_addrs), | ||
3320 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3321 | }; | ||
3322 | |||
3323 | /* mcspi3 slave ports */ | ||
3324 | static struct omap_hwmod_ocp_if *omap44xx_mcspi3_slaves[] = { | ||
3325 | &omap44xx_l4_per__mcspi3, | ||
3326 | }; | ||
3327 | |||
3328 | /* mcspi3 dev_attr */ | ||
3329 | static struct omap2_mcspi_dev_attr mcspi3_dev_attr = { | ||
3330 | .num_chipselect = 2, | ||
3331 | }; | ||
3332 | |||
3333 | static struct omap_hwmod omap44xx_mcspi3_hwmod = { | ||
3334 | .name = "mcspi3", | ||
3335 | .class = &omap44xx_mcspi_hwmod_class, | ||
3336 | .mpu_irqs = omap44xx_mcspi3_irqs, | ||
3337 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi3_irqs), | ||
3338 | .sdma_reqs = omap44xx_mcspi3_sdma_reqs, | ||
3339 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi3_sdma_reqs), | ||
3340 | .main_clk = "mcspi3_fck", | ||
3341 | .prcm = { | ||
3342 | .omap4 = { | ||
3343 | .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI3_CLKCTRL, | ||
3344 | }, | ||
3345 | }, | ||
3346 | .dev_attr = &mcspi3_dev_attr, | ||
3347 | .slaves = omap44xx_mcspi3_slaves, | ||
3348 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves), | ||
3349 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3350 | }; | ||
3351 | |||
3352 | /* mcspi4 */ | ||
3353 | static struct omap_hwmod omap44xx_mcspi4_hwmod; | ||
3354 | static struct omap_hwmod_irq_info omap44xx_mcspi4_irqs[] = { | ||
3355 | { .irq = 48 + OMAP44XX_IRQ_GIC_START }, | ||
3356 | }; | ||
3357 | |||
3358 | static struct omap_hwmod_dma_info omap44xx_mcspi4_sdma_reqs[] = { | ||
3359 | { .name = "tx0", .dma_req = 69 + OMAP44XX_DMA_REQ_START }, | ||
3360 | { .name = "rx0", .dma_req = 70 + OMAP44XX_DMA_REQ_START }, | ||
3361 | }; | ||
3362 | |||
3363 | static struct omap_hwmod_addr_space omap44xx_mcspi4_addrs[] = { | ||
3364 | { | ||
3365 | .pa_start = 0x480ba000, | ||
3366 | .pa_end = 0x480ba1ff, | ||
3367 | .flags = ADDR_TYPE_RT | ||
3368 | }, | ||
3369 | }; | ||
3370 | |||
3371 | /* l4_per -> mcspi4 */ | ||
3372 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi4 = { | ||
3373 | .master = &omap44xx_l4_per_hwmod, | ||
3374 | .slave = &omap44xx_mcspi4_hwmod, | ||
3375 | .clk = "l4_div_ck", | ||
3376 | .addr = omap44xx_mcspi4_addrs, | ||
3377 | .addr_cnt = ARRAY_SIZE(omap44xx_mcspi4_addrs), | ||
3378 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3379 | }; | ||
3380 | |||
3381 | /* mcspi4 slave ports */ | ||
3382 | static struct omap_hwmod_ocp_if *omap44xx_mcspi4_slaves[] = { | ||
3383 | &omap44xx_l4_per__mcspi4, | ||
3384 | }; | ||
3385 | |||
3386 | /* mcspi4 dev_attr */ | ||
3387 | static struct omap2_mcspi_dev_attr mcspi4_dev_attr = { | ||
3388 | .num_chipselect = 1, | ||
3389 | }; | ||
3390 | |||
3391 | static struct omap_hwmod omap44xx_mcspi4_hwmod = { | ||
3392 | .name = "mcspi4", | ||
3393 | .class = &omap44xx_mcspi_hwmod_class, | ||
3394 | .mpu_irqs = omap44xx_mcspi4_irqs, | ||
3395 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi4_irqs), | ||
3396 | .sdma_reqs = omap44xx_mcspi4_sdma_reqs, | ||
3397 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi4_sdma_reqs), | ||
3398 | .main_clk = "mcspi4_fck", | ||
3399 | .prcm = { | ||
3400 | .omap4 = { | ||
3401 | .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI4_CLKCTRL, | ||
3402 | }, | ||
3403 | }, | ||
3404 | .dev_attr = &mcspi4_dev_attr, | ||
3405 | .slaves = omap44xx_mcspi4_slaves, | ||
3406 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves), | ||
3407 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3408 | }; | ||
3409 | |||
3410 | /* | ||
3411 | * 'mmc' class | ||
3412 | * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller | ||
3413 | */ | ||
3414 | |||
3415 | static struct omap_hwmod_class_sysconfig omap44xx_mmc_sysc = { | ||
3416 | .rev_offs = 0x0000, | ||
3417 | .sysc_offs = 0x0010, | ||
3418 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE | | ||
3419 | SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE | | ||
3420 | SYSC_HAS_SOFTRESET), | ||
3421 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
3422 | SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | | ||
3423 | MSTANDBY_SMART), | ||
3424 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
3425 | }; | ||
3426 | |||
3427 | static struct omap_hwmod_class omap44xx_mmc_hwmod_class = { | ||
3428 | .name = "mmc", | ||
3429 | .sysc = &omap44xx_mmc_sysc, | ||
3430 | }; | ||
3431 | |||
3432 | /* mmc1 */ | ||
3433 | |||
3434 | static struct omap_hwmod_irq_info omap44xx_mmc1_irqs[] = { | ||
3435 | { .irq = 83 + OMAP44XX_IRQ_GIC_START }, | ||
3436 | }; | ||
3437 | |||
3438 | static struct omap_hwmod_dma_info omap44xx_mmc1_sdma_reqs[] = { | ||
3439 | { .name = "tx", .dma_req = 60 + OMAP44XX_DMA_REQ_START }, | ||
3440 | { .name = "rx", .dma_req = 61 + OMAP44XX_DMA_REQ_START }, | ||
3441 | }; | ||
3442 | |||
3443 | /* mmc1 master ports */ | ||
3444 | static struct omap_hwmod_ocp_if *omap44xx_mmc1_masters[] = { | ||
3445 | &omap44xx_mmc1__l3_main_1, | ||
3446 | }; | ||
3447 | |||
3448 | static struct omap_hwmod_addr_space omap44xx_mmc1_addrs[] = { | ||
3449 | { | ||
3450 | .pa_start = 0x4809c000, | ||
3451 | .pa_end = 0x4809c3ff, | ||
3452 | .flags = ADDR_TYPE_RT | ||
3453 | }, | ||
3454 | }; | ||
3455 | |||
3456 | /* l4_per -> mmc1 */ | ||
3457 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc1 = { | ||
3458 | .master = &omap44xx_l4_per_hwmod, | ||
3459 | .slave = &omap44xx_mmc1_hwmod, | ||
3460 | .clk = "l4_div_ck", | ||
3461 | .addr = omap44xx_mmc1_addrs, | ||
3462 | .addr_cnt = ARRAY_SIZE(omap44xx_mmc1_addrs), | ||
3463 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3464 | }; | ||
3465 | |||
3466 | /* mmc1 slave ports */ | ||
3467 | static struct omap_hwmod_ocp_if *omap44xx_mmc1_slaves[] = { | ||
3468 | &omap44xx_l4_per__mmc1, | ||
3469 | }; | ||
3470 | |||
3471 | /* mmc1 dev_attr */ | ||
3472 | static struct omap_mmc_dev_attr mmc1_dev_attr = { | ||
3473 | .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, | ||
3474 | }; | ||
3475 | |||
3476 | static struct omap_hwmod omap44xx_mmc1_hwmod = { | ||
3477 | .name = "mmc1", | ||
3478 | .class = &omap44xx_mmc_hwmod_class, | ||
3479 | .mpu_irqs = omap44xx_mmc1_irqs, | ||
3480 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc1_irqs), | ||
3481 | .sdma_reqs = omap44xx_mmc1_sdma_reqs, | ||
3482 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc1_sdma_reqs), | ||
3483 | .main_clk = "mmc1_fck", | ||
3484 | .prcm = { | ||
3485 | .omap4 = { | ||
3486 | .clkctrl_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL, | ||
3487 | }, | ||
3488 | }, | ||
3489 | .dev_attr = &mmc1_dev_attr, | ||
3490 | .slaves = omap44xx_mmc1_slaves, | ||
3491 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves), | ||
3492 | .masters = omap44xx_mmc1_masters, | ||
3493 | .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters), | ||
3494 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3495 | }; | ||
3496 | |||
3497 | /* mmc2 */ | ||
3498 | static struct omap_hwmod_irq_info omap44xx_mmc2_irqs[] = { | ||
3499 | { .irq = 86 + OMAP44XX_IRQ_GIC_START }, | ||
3500 | }; | ||
3501 | |||
3502 | static struct omap_hwmod_dma_info omap44xx_mmc2_sdma_reqs[] = { | ||
3503 | { .name = "tx", .dma_req = 46 + OMAP44XX_DMA_REQ_START }, | ||
3504 | { .name = "rx", .dma_req = 47 + OMAP44XX_DMA_REQ_START }, | ||
3505 | }; | ||
3506 | |||
3507 | /* mmc2 master ports */ | ||
3508 | static struct omap_hwmod_ocp_if *omap44xx_mmc2_masters[] = { | ||
3509 | &omap44xx_mmc2__l3_main_1, | ||
3510 | }; | ||
3511 | |||
3512 | static struct omap_hwmod_addr_space omap44xx_mmc2_addrs[] = { | ||
3513 | { | ||
3514 | .pa_start = 0x480b4000, | ||
3515 | .pa_end = 0x480b43ff, | ||
3516 | .flags = ADDR_TYPE_RT | ||
3517 | }, | ||
3518 | }; | ||
3519 | |||
3520 | /* l4_per -> mmc2 */ | ||
3521 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc2 = { | ||
3522 | .master = &omap44xx_l4_per_hwmod, | ||
3523 | .slave = &omap44xx_mmc2_hwmod, | ||
3524 | .clk = "l4_div_ck", | ||
3525 | .addr = omap44xx_mmc2_addrs, | ||
3526 | .addr_cnt = ARRAY_SIZE(omap44xx_mmc2_addrs), | ||
3527 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3528 | }; | ||
3529 | |||
3530 | /* mmc2 slave ports */ | ||
3531 | static struct omap_hwmod_ocp_if *omap44xx_mmc2_slaves[] = { | ||
3532 | &omap44xx_l4_per__mmc2, | ||
3533 | }; | ||
3534 | |||
3535 | static struct omap_hwmod omap44xx_mmc2_hwmod = { | ||
3536 | .name = "mmc2", | ||
3537 | .class = &omap44xx_mmc_hwmod_class, | ||
3538 | .mpu_irqs = omap44xx_mmc2_irqs, | ||
3539 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc2_irqs), | ||
3540 | .sdma_reqs = omap44xx_mmc2_sdma_reqs, | ||
3541 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc2_sdma_reqs), | ||
3542 | .main_clk = "mmc2_fck", | ||
3543 | .prcm = { | ||
3544 | .omap4 = { | ||
3545 | .clkctrl_reg = OMAP4430_CM_L3INIT_MMC2_CLKCTRL, | ||
3546 | }, | ||
3547 | }, | ||
3548 | .slaves = omap44xx_mmc2_slaves, | ||
3549 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves), | ||
3550 | .masters = omap44xx_mmc2_masters, | ||
3551 | .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters), | ||
3552 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3553 | }; | ||
3554 | |||
3555 | /* mmc3 */ | ||
3556 | static struct omap_hwmod omap44xx_mmc3_hwmod; | ||
3557 | static struct omap_hwmod_irq_info omap44xx_mmc3_irqs[] = { | ||
3558 | { .irq = 94 + OMAP44XX_IRQ_GIC_START }, | ||
3559 | }; | ||
3560 | |||
3561 | static struct omap_hwmod_dma_info omap44xx_mmc3_sdma_reqs[] = { | ||
3562 | { .name = "tx", .dma_req = 76 + OMAP44XX_DMA_REQ_START }, | ||
3563 | { .name = "rx", .dma_req = 77 + OMAP44XX_DMA_REQ_START }, | ||
3564 | }; | ||
3565 | |||
3566 | static struct omap_hwmod_addr_space omap44xx_mmc3_addrs[] = { | ||
3567 | { | ||
3568 | .pa_start = 0x480ad000, | ||
3569 | .pa_end = 0x480ad3ff, | ||
3570 | .flags = ADDR_TYPE_RT | ||
3571 | }, | ||
3572 | }; | ||
3573 | |||
3574 | /* l4_per -> mmc3 */ | ||
3575 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc3 = { | ||
3576 | .master = &omap44xx_l4_per_hwmod, | ||
3577 | .slave = &omap44xx_mmc3_hwmod, | ||
3578 | .clk = "l4_div_ck", | ||
3579 | .addr = omap44xx_mmc3_addrs, | ||
3580 | .addr_cnt = ARRAY_SIZE(omap44xx_mmc3_addrs), | ||
3581 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3582 | }; | ||
3583 | |||
3584 | /* mmc3 slave ports */ | ||
3585 | static struct omap_hwmod_ocp_if *omap44xx_mmc3_slaves[] = { | ||
3586 | &omap44xx_l4_per__mmc3, | ||
3587 | }; | ||
3588 | |||
3589 | static struct omap_hwmod omap44xx_mmc3_hwmod = { | ||
3590 | .name = "mmc3", | ||
3591 | .class = &omap44xx_mmc_hwmod_class, | ||
3592 | .mpu_irqs = omap44xx_mmc3_irqs, | ||
3593 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc3_irqs), | ||
3594 | .sdma_reqs = omap44xx_mmc3_sdma_reqs, | ||
3595 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc3_sdma_reqs), | ||
3596 | .main_clk = "mmc3_fck", | ||
3597 | .prcm = { | ||
3598 | .omap4 = { | ||
3599 | .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD3_CLKCTRL, | ||
3600 | }, | ||
3601 | }, | ||
3602 | .slaves = omap44xx_mmc3_slaves, | ||
3603 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves), | ||
3604 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3605 | }; | ||
3606 | |||
3607 | /* mmc4 */ | ||
3608 | static struct omap_hwmod omap44xx_mmc4_hwmod; | ||
3609 | static struct omap_hwmod_irq_info omap44xx_mmc4_irqs[] = { | ||
3610 | { .irq = 96 + OMAP44XX_IRQ_GIC_START }, | ||
3611 | }; | ||
3612 | |||
3613 | static struct omap_hwmod_dma_info omap44xx_mmc4_sdma_reqs[] = { | ||
3614 | { .name = "tx", .dma_req = 56 + OMAP44XX_DMA_REQ_START }, | ||
3615 | { .name = "rx", .dma_req = 57 + OMAP44XX_DMA_REQ_START }, | ||
3616 | }; | ||
3617 | |||
3618 | static struct omap_hwmod_addr_space omap44xx_mmc4_addrs[] = { | ||
3619 | { | ||
3620 | .pa_start = 0x480d1000, | ||
3621 | .pa_end = 0x480d13ff, | ||
3622 | .flags = ADDR_TYPE_RT | ||
3623 | }, | ||
3624 | }; | ||
3625 | |||
3626 | /* l4_per -> mmc4 */ | ||
3627 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc4 = { | ||
3628 | .master = &omap44xx_l4_per_hwmod, | ||
3629 | .slave = &omap44xx_mmc4_hwmod, | ||
3630 | .clk = "l4_div_ck", | ||
3631 | .addr = omap44xx_mmc4_addrs, | ||
3632 | .addr_cnt = ARRAY_SIZE(omap44xx_mmc4_addrs), | ||
3633 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3634 | }; | ||
3635 | |||
3636 | /* mmc4 slave ports */ | ||
3637 | static struct omap_hwmod_ocp_if *omap44xx_mmc4_slaves[] = { | ||
3638 | &omap44xx_l4_per__mmc4, | ||
3639 | }; | ||
3640 | |||
3641 | static struct omap_hwmod omap44xx_mmc4_hwmod = { | ||
3642 | .name = "mmc4", | ||
3643 | .class = &omap44xx_mmc_hwmod_class, | ||
3644 | .mpu_irqs = omap44xx_mmc4_irqs, | ||
3645 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc4_irqs), | ||
3646 | .sdma_reqs = omap44xx_mmc4_sdma_reqs, | ||
3647 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc4_sdma_reqs), | ||
3648 | .main_clk = "mmc4_fck", | ||
3649 | .prcm = { | ||
3650 | .omap4 = { | ||
3651 | .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD4_CLKCTRL, | ||
3652 | }, | ||
3653 | }, | ||
3654 | .slaves = omap44xx_mmc4_slaves, | ||
3655 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves), | ||
3656 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3657 | }; | ||
3658 | |||
3659 | /* mmc5 */ | ||
3660 | static struct omap_hwmod omap44xx_mmc5_hwmod; | ||
3661 | static struct omap_hwmod_irq_info omap44xx_mmc5_irqs[] = { | ||
3662 | { .irq = 59 + OMAP44XX_IRQ_GIC_START }, | ||
3663 | }; | ||
3664 | |||
3665 | static struct omap_hwmod_dma_info omap44xx_mmc5_sdma_reqs[] = { | ||
3666 | { .name = "tx", .dma_req = 58 + OMAP44XX_DMA_REQ_START }, | ||
3667 | { .name = "rx", .dma_req = 59 + OMAP44XX_DMA_REQ_START }, | ||
3668 | }; | ||
3669 | |||
3670 | static struct omap_hwmod_addr_space omap44xx_mmc5_addrs[] = { | ||
3671 | { | ||
3672 | .pa_start = 0x480d5000, | ||
3673 | .pa_end = 0x480d53ff, | ||
3674 | .flags = ADDR_TYPE_RT | ||
3675 | }, | ||
3676 | }; | ||
3677 | |||
3678 | /* l4_per -> mmc5 */ | ||
3679 | static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc5 = { | ||
3680 | .master = &omap44xx_l4_per_hwmod, | ||
3681 | .slave = &omap44xx_mmc5_hwmod, | ||
3682 | .clk = "l4_div_ck", | ||
3683 | .addr = omap44xx_mmc5_addrs, | ||
3684 | .addr_cnt = ARRAY_SIZE(omap44xx_mmc5_addrs), | ||
3685 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3686 | }; | ||
3687 | |||
3688 | /* mmc5 slave ports */ | ||
3689 | static struct omap_hwmod_ocp_if *omap44xx_mmc5_slaves[] = { | ||
3690 | &omap44xx_l4_per__mmc5, | ||
3691 | }; | ||
3692 | |||
3693 | static struct omap_hwmod omap44xx_mmc5_hwmod = { | ||
3694 | .name = "mmc5", | ||
3695 | .class = &omap44xx_mmc_hwmod_class, | ||
3696 | .mpu_irqs = omap44xx_mmc5_irqs, | ||
3697 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc5_irqs), | ||
3698 | .sdma_reqs = omap44xx_mmc5_sdma_reqs, | ||
3699 | .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc5_sdma_reqs), | ||
3700 | .main_clk = "mmc5_fck", | ||
3701 | .prcm = { | ||
3702 | .omap4 = { | ||
3703 | .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD5_CLKCTRL, | ||
3704 | }, | ||
3705 | }, | ||
3706 | .slaves = omap44xx_mmc5_slaves, | ||
3707 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves), | ||
3708 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3709 | }; | ||
3710 | |||
3711 | /* | ||
1438 | * 'mpu' class | 3712 | * 'mpu' class |
1439 | * mpu sub-system | 3713 | * mpu sub-system |
1440 | */ | 3714 | */ |
@@ -1639,6 +3913,676 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { | |||
1639 | }; | 3913 | }; |
1640 | 3914 | ||
1641 | /* | 3915 | /* |
3916 | * 'spinlock' class | ||
3917 | * spinlock provides hardware assistance for synchronizing the processes | ||
3918 | * running on multiple processors | ||
3919 | */ | ||
3920 | |||
3921 | static struct omap_hwmod_class_sysconfig omap44xx_spinlock_sysc = { | ||
3922 | .rev_offs = 0x0000, | ||
3923 | .sysc_offs = 0x0010, | ||
3924 | .syss_offs = 0x0014, | ||
3925 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | | ||
3926 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | | ||
3927 | SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), | ||
3928 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
3929 | SIDLE_SMART_WKUP), | ||
3930 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3931 | }; | ||
3932 | |||
3933 | static struct omap_hwmod_class omap44xx_spinlock_hwmod_class = { | ||
3934 | .name = "spinlock", | ||
3935 | .sysc = &omap44xx_spinlock_sysc, | ||
3936 | }; | ||
3937 | |||
3938 | /* spinlock */ | ||
3939 | static struct omap_hwmod omap44xx_spinlock_hwmod; | ||
3940 | static struct omap_hwmod_addr_space omap44xx_spinlock_addrs[] = { | ||
3941 | { | ||
3942 | .pa_start = 0x4a0f6000, | ||
3943 | .pa_end = 0x4a0f6fff, | ||
3944 | .flags = ADDR_TYPE_RT | ||
3945 | }, | ||
3946 | }; | ||
3947 | |||
3948 | /* l4_cfg -> spinlock */ | ||
3949 | static struct omap_hwmod_ocp_if omap44xx_l4_cfg__spinlock = { | ||
3950 | .master = &omap44xx_l4_cfg_hwmod, | ||
3951 | .slave = &omap44xx_spinlock_hwmod, | ||
3952 | .clk = "l4_div_ck", | ||
3953 | .addr = omap44xx_spinlock_addrs, | ||
3954 | .addr_cnt = ARRAY_SIZE(omap44xx_spinlock_addrs), | ||
3955 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3956 | }; | ||
3957 | |||
3958 | /* spinlock slave ports */ | ||
3959 | static struct omap_hwmod_ocp_if *omap44xx_spinlock_slaves[] = { | ||
3960 | &omap44xx_l4_cfg__spinlock, | ||
3961 | }; | ||
3962 | |||
3963 | static struct omap_hwmod omap44xx_spinlock_hwmod = { | ||
3964 | .name = "spinlock", | ||
3965 | .class = &omap44xx_spinlock_hwmod_class, | ||
3966 | .prcm = { | ||
3967 | .omap4 = { | ||
3968 | .clkctrl_reg = OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL, | ||
3969 | }, | ||
3970 | }, | ||
3971 | .slaves = omap44xx_spinlock_slaves, | ||
3972 | .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves), | ||
3973 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3974 | }; | ||
3975 | |||
3976 | /* | ||
3977 | * 'timer' class | ||
3978 | * general purpose timer module with accurate 1ms tick | ||
3979 | * This class contains several variants: ['timer_1ms', 'timer'] | ||
3980 | */ | ||
3981 | |||
3982 | static struct omap_hwmod_class_sysconfig omap44xx_timer_1ms_sysc = { | ||
3983 | .rev_offs = 0x0000, | ||
3984 | .sysc_offs = 0x0010, | ||
3985 | .syss_offs = 0x0014, | ||
3986 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | | ||
3987 | SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP | | ||
3988 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | | ||
3989 | SYSS_HAS_RESET_STATUS), | ||
3990 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
3991 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3992 | }; | ||
3993 | |||
3994 | static struct omap_hwmod_class omap44xx_timer_1ms_hwmod_class = { | ||
3995 | .name = "timer", | ||
3996 | .sysc = &omap44xx_timer_1ms_sysc, | ||
3997 | }; | ||
3998 | |||
3999 | static struct omap_hwmod_class_sysconfig omap44xx_timer_sysc = { | ||
4000 | .rev_offs = 0x0000, | ||
4001 | .sysc_offs = 0x0010, | ||
4002 | .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS | | ||
4003 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
4004 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
4005 | SIDLE_SMART_WKUP), | ||
4006 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
4007 | }; | ||
4008 | |||
4009 | static struct omap_hwmod_class omap44xx_timer_hwmod_class = { | ||
4010 | .name = "timer", | ||
4011 | .sysc = &omap44xx_timer_sysc, | ||
4012 | }; | ||
4013 | |||
4014 | /* timer1 */ | ||
4015 | static struct omap_hwmod omap44xx_timer1_hwmod; | ||
4016 | static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = { | ||
4017 | { .irq = 37 + OMAP44XX_IRQ_GIC_START }, | ||
4018 | }; | ||
4019 | |||
4020 | static struct omap_hwmod_addr_space omap44xx_timer1_addrs[] = { | ||
4021 | { | ||
4022 | .pa_start = 0x4a318000, | ||
4023 | .pa_end = 0x4a31807f, | ||
4024 | .flags = ADDR_TYPE_RT | ||
4025 | }, | ||
4026 | }; | ||
4027 | |||
4028 | /* l4_wkup -> timer1 */ | ||
4029 | static struct omap_hwmod_ocp_if omap44xx_l4_wkup__timer1 = { | ||
4030 | .master = &omap44xx_l4_wkup_hwmod, | ||
4031 | .slave = &omap44xx_timer1_hwmod, | ||
4032 | .clk = "l4_wkup_clk_mux_ck", | ||
4033 | .addr = omap44xx_timer1_addrs, | ||
4034 | .addr_cnt = ARRAY_SIZE(omap44xx_timer1_addrs), | ||
4035 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4036 | }; | ||
4037 | |||
4038 | /* timer1 slave ports */ | ||
4039 | static struct omap_hwmod_ocp_if *omap44xx_timer1_slaves[] = { | ||
4040 | &omap44xx_l4_wkup__timer1, | ||
4041 | }; | ||
4042 | |||
4043 | static struct omap_hwmod omap44xx_timer1_hwmod = { | ||
4044 | .name = "timer1", | ||
4045 | .class = &omap44xx_timer_1ms_hwmod_class, | ||
4046 | .mpu_irqs = omap44xx_timer1_irqs, | ||
4047 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer1_irqs), | ||
4048 | .main_clk = "timer1_fck", | ||
4049 | .prcm = { | ||
4050 | .omap4 = { | ||
4051 | .clkctrl_reg = OMAP4430_CM_WKUP_TIMER1_CLKCTRL, | ||
4052 | }, | ||
4053 | }, | ||
4054 | .slaves = omap44xx_timer1_slaves, | ||
4055 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves), | ||
4056 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4057 | }; | ||
4058 | |||
4059 | /* timer2 */ | ||
4060 | static struct omap_hwmod omap44xx_timer2_hwmod; | ||
4061 | static struct omap_hwmod_irq_info omap44xx_timer2_irqs[] = { | ||
4062 | { .irq = 38 + OMAP44XX_IRQ_GIC_START }, | ||
4063 | }; | ||
4064 | |||
4065 | static struct omap_hwmod_addr_space omap44xx_timer2_addrs[] = { | ||
4066 | { | ||
4067 | .pa_start = 0x48032000, | ||
4068 | .pa_end = 0x4803207f, | ||
4069 | .flags = ADDR_TYPE_RT | ||
4070 | }, | ||
4071 | }; | ||
4072 | |||
4073 | /* l4_per -> timer2 */ | ||
4074 | static struct omap_hwmod_ocp_if omap44xx_l4_per__timer2 = { | ||
4075 | .master = &omap44xx_l4_per_hwmod, | ||
4076 | .slave = &omap44xx_timer2_hwmod, | ||
4077 | .clk = "l4_div_ck", | ||
4078 | .addr = omap44xx_timer2_addrs, | ||
4079 | .addr_cnt = ARRAY_SIZE(omap44xx_timer2_addrs), | ||
4080 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4081 | }; | ||
4082 | |||
4083 | /* timer2 slave ports */ | ||
4084 | static struct omap_hwmod_ocp_if *omap44xx_timer2_slaves[] = { | ||
4085 | &omap44xx_l4_per__timer2, | ||
4086 | }; | ||
4087 | |||
4088 | static struct omap_hwmod omap44xx_timer2_hwmod = { | ||
4089 | .name = "timer2", | ||
4090 | .class = &omap44xx_timer_1ms_hwmod_class, | ||
4091 | .mpu_irqs = omap44xx_timer2_irqs, | ||
4092 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer2_irqs), | ||
4093 | .main_clk = "timer2_fck", | ||
4094 | .prcm = { | ||
4095 | .omap4 = { | ||
4096 | .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, | ||
4097 | }, | ||
4098 | }, | ||
4099 | .slaves = omap44xx_timer2_slaves, | ||
4100 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves), | ||
4101 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4102 | }; | ||
4103 | |||
4104 | /* timer3 */ | ||
4105 | static struct omap_hwmod omap44xx_timer3_hwmod; | ||
4106 | static struct omap_hwmod_irq_info omap44xx_timer3_irqs[] = { | ||
4107 | { .irq = 39 + OMAP44XX_IRQ_GIC_START }, | ||
4108 | }; | ||
4109 | |||
4110 | static struct omap_hwmod_addr_space omap44xx_timer3_addrs[] = { | ||
4111 | { | ||
4112 | .pa_start = 0x48034000, | ||
4113 | .pa_end = 0x4803407f, | ||
4114 | .flags = ADDR_TYPE_RT | ||
4115 | }, | ||
4116 | }; | ||
4117 | |||
4118 | /* l4_per -> timer3 */ | ||
4119 | static struct omap_hwmod_ocp_if omap44xx_l4_per__timer3 = { | ||
4120 | .master = &omap44xx_l4_per_hwmod, | ||
4121 | .slave = &omap44xx_timer3_hwmod, | ||
4122 | .clk = "l4_div_ck", | ||
4123 | .addr = omap44xx_timer3_addrs, | ||
4124 | .addr_cnt = ARRAY_SIZE(omap44xx_timer3_addrs), | ||
4125 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4126 | }; | ||
4127 | |||
4128 | /* timer3 slave ports */ | ||
4129 | static struct omap_hwmod_ocp_if *omap44xx_timer3_slaves[] = { | ||
4130 | &omap44xx_l4_per__timer3, | ||
4131 | }; | ||
4132 | |||
4133 | static struct omap_hwmod omap44xx_timer3_hwmod = { | ||
4134 | .name = "timer3", | ||
4135 | .class = &omap44xx_timer_hwmod_class, | ||
4136 | .mpu_irqs = omap44xx_timer3_irqs, | ||
4137 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer3_irqs), | ||
4138 | .main_clk = "timer3_fck", | ||
4139 | .prcm = { | ||
4140 | .omap4 = { | ||
4141 | .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL, | ||
4142 | }, | ||
4143 | }, | ||
4144 | .slaves = omap44xx_timer3_slaves, | ||
4145 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves), | ||
4146 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4147 | }; | ||
4148 | |||
4149 | /* timer4 */ | ||
4150 | static struct omap_hwmod omap44xx_timer4_hwmod; | ||
4151 | static struct omap_hwmod_irq_info omap44xx_timer4_irqs[] = { | ||
4152 | { .irq = 40 + OMAP44XX_IRQ_GIC_START }, | ||
4153 | }; | ||
4154 | |||
4155 | static struct omap_hwmod_addr_space omap44xx_timer4_addrs[] = { | ||
4156 | { | ||
4157 | .pa_start = 0x48036000, | ||
4158 | .pa_end = 0x4803607f, | ||
4159 | .flags = ADDR_TYPE_RT | ||
4160 | }, | ||
4161 | }; | ||
4162 | |||
4163 | /* l4_per -> timer4 */ | ||
4164 | static struct omap_hwmod_ocp_if omap44xx_l4_per__timer4 = { | ||
4165 | .master = &omap44xx_l4_per_hwmod, | ||
4166 | .slave = &omap44xx_timer4_hwmod, | ||
4167 | .clk = "l4_div_ck", | ||
4168 | .addr = omap44xx_timer4_addrs, | ||
4169 | .addr_cnt = ARRAY_SIZE(omap44xx_timer4_addrs), | ||
4170 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4171 | }; | ||
4172 | |||
4173 | /* timer4 slave ports */ | ||
4174 | static struct omap_hwmod_ocp_if *omap44xx_timer4_slaves[] = { | ||
4175 | &omap44xx_l4_per__timer4, | ||
4176 | }; | ||
4177 | |||
4178 | static struct omap_hwmod omap44xx_timer4_hwmod = { | ||
4179 | .name = "timer4", | ||
4180 | .class = &omap44xx_timer_hwmod_class, | ||
4181 | .mpu_irqs = omap44xx_timer4_irqs, | ||
4182 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer4_irqs), | ||
4183 | .main_clk = "timer4_fck", | ||
4184 | .prcm = { | ||
4185 | .omap4 = { | ||
4186 | .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL, | ||
4187 | }, | ||
4188 | }, | ||
4189 | .slaves = omap44xx_timer4_slaves, | ||
4190 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves), | ||
4191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4192 | }; | ||
4193 | |||
4194 | /* timer5 */ | ||
4195 | static struct omap_hwmod omap44xx_timer5_hwmod; | ||
4196 | static struct omap_hwmod_irq_info omap44xx_timer5_irqs[] = { | ||
4197 | { .irq = 41 + OMAP44XX_IRQ_GIC_START }, | ||
4198 | }; | ||
4199 | |||
4200 | static struct omap_hwmod_addr_space omap44xx_timer5_addrs[] = { | ||
4201 | { | ||
4202 | .pa_start = 0x40138000, | ||
4203 | .pa_end = 0x4013807f, | ||
4204 | .flags = ADDR_TYPE_RT | ||
4205 | }, | ||
4206 | }; | ||
4207 | |||
4208 | /* l4_abe -> timer5 */ | ||
4209 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer5 = { | ||
4210 | .master = &omap44xx_l4_abe_hwmod, | ||
4211 | .slave = &omap44xx_timer5_hwmod, | ||
4212 | .clk = "ocp_abe_iclk", | ||
4213 | .addr = omap44xx_timer5_addrs, | ||
4214 | .addr_cnt = ARRAY_SIZE(omap44xx_timer5_addrs), | ||
4215 | .user = OCP_USER_MPU, | ||
4216 | }; | ||
4217 | |||
4218 | static struct omap_hwmod_addr_space omap44xx_timer5_dma_addrs[] = { | ||
4219 | { | ||
4220 | .pa_start = 0x49038000, | ||
4221 | .pa_end = 0x4903807f, | ||
4222 | .flags = ADDR_TYPE_RT | ||
4223 | }, | ||
4224 | }; | ||
4225 | |||
4226 | /* l4_abe -> timer5 (dma) */ | ||
4227 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer5_dma = { | ||
4228 | .master = &omap44xx_l4_abe_hwmod, | ||
4229 | .slave = &omap44xx_timer5_hwmod, | ||
4230 | .clk = "ocp_abe_iclk", | ||
4231 | .addr = omap44xx_timer5_dma_addrs, | ||
4232 | .addr_cnt = ARRAY_SIZE(omap44xx_timer5_dma_addrs), | ||
4233 | .user = OCP_USER_SDMA, | ||
4234 | }; | ||
4235 | |||
4236 | /* timer5 slave ports */ | ||
4237 | static struct omap_hwmod_ocp_if *omap44xx_timer5_slaves[] = { | ||
4238 | &omap44xx_l4_abe__timer5, | ||
4239 | &omap44xx_l4_abe__timer5_dma, | ||
4240 | }; | ||
4241 | |||
4242 | static struct omap_hwmod omap44xx_timer5_hwmod = { | ||
4243 | .name = "timer5", | ||
4244 | .class = &omap44xx_timer_hwmod_class, | ||
4245 | .mpu_irqs = omap44xx_timer5_irqs, | ||
4246 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer5_irqs), | ||
4247 | .main_clk = "timer5_fck", | ||
4248 | .prcm = { | ||
4249 | .omap4 = { | ||
4250 | .clkctrl_reg = OMAP4430_CM1_ABE_TIMER5_CLKCTRL, | ||
4251 | }, | ||
4252 | }, | ||
4253 | .slaves = omap44xx_timer5_slaves, | ||
4254 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves), | ||
4255 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4256 | }; | ||
4257 | |||
4258 | /* timer6 */ | ||
4259 | static struct omap_hwmod omap44xx_timer6_hwmod; | ||
4260 | static struct omap_hwmod_irq_info omap44xx_timer6_irqs[] = { | ||
4261 | { .irq = 42 + OMAP44XX_IRQ_GIC_START }, | ||
4262 | }; | ||
4263 | |||
4264 | static struct omap_hwmod_addr_space omap44xx_timer6_addrs[] = { | ||
4265 | { | ||
4266 | .pa_start = 0x4013a000, | ||
4267 | .pa_end = 0x4013a07f, | ||
4268 | .flags = ADDR_TYPE_RT | ||
4269 | }, | ||
4270 | }; | ||
4271 | |||
4272 | /* l4_abe -> timer6 */ | ||
4273 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer6 = { | ||
4274 | .master = &omap44xx_l4_abe_hwmod, | ||
4275 | .slave = &omap44xx_timer6_hwmod, | ||
4276 | .clk = "ocp_abe_iclk", | ||
4277 | .addr = omap44xx_timer6_addrs, | ||
4278 | .addr_cnt = ARRAY_SIZE(omap44xx_timer6_addrs), | ||
4279 | .user = OCP_USER_MPU, | ||
4280 | }; | ||
4281 | |||
4282 | static struct omap_hwmod_addr_space omap44xx_timer6_dma_addrs[] = { | ||
4283 | { | ||
4284 | .pa_start = 0x4903a000, | ||
4285 | .pa_end = 0x4903a07f, | ||
4286 | .flags = ADDR_TYPE_RT | ||
4287 | }, | ||
4288 | }; | ||
4289 | |||
4290 | /* l4_abe -> timer6 (dma) */ | ||
4291 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer6_dma = { | ||
4292 | .master = &omap44xx_l4_abe_hwmod, | ||
4293 | .slave = &omap44xx_timer6_hwmod, | ||
4294 | .clk = "ocp_abe_iclk", | ||
4295 | .addr = omap44xx_timer6_dma_addrs, | ||
4296 | .addr_cnt = ARRAY_SIZE(omap44xx_timer6_dma_addrs), | ||
4297 | .user = OCP_USER_SDMA, | ||
4298 | }; | ||
4299 | |||
4300 | /* timer6 slave ports */ | ||
4301 | static struct omap_hwmod_ocp_if *omap44xx_timer6_slaves[] = { | ||
4302 | &omap44xx_l4_abe__timer6, | ||
4303 | &omap44xx_l4_abe__timer6_dma, | ||
4304 | }; | ||
4305 | |||
4306 | static struct omap_hwmod omap44xx_timer6_hwmod = { | ||
4307 | .name = "timer6", | ||
4308 | .class = &omap44xx_timer_hwmod_class, | ||
4309 | .mpu_irqs = omap44xx_timer6_irqs, | ||
4310 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer6_irqs), | ||
4311 | .main_clk = "timer6_fck", | ||
4312 | .prcm = { | ||
4313 | .omap4 = { | ||
4314 | .clkctrl_reg = OMAP4430_CM1_ABE_TIMER6_CLKCTRL, | ||
4315 | }, | ||
4316 | }, | ||
4317 | .slaves = omap44xx_timer6_slaves, | ||
4318 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves), | ||
4319 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4320 | }; | ||
4321 | |||
4322 | /* timer7 */ | ||
4323 | static struct omap_hwmod omap44xx_timer7_hwmod; | ||
4324 | static struct omap_hwmod_irq_info omap44xx_timer7_irqs[] = { | ||
4325 | { .irq = 43 + OMAP44XX_IRQ_GIC_START }, | ||
4326 | }; | ||
4327 | |||
4328 | static struct omap_hwmod_addr_space omap44xx_timer7_addrs[] = { | ||
4329 | { | ||
4330 | .pa_start = 0x4013c000, | ||
4331 | .pa_end = 0x4013c07f, | ||
4332 | .flags = ADDR_TYPE_RT | ||
4333 | }, | ||
4334 | }; | ||
4335 | |||
4336 | /* l4_abe -> timer7 */ | ||
4337 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer7 = { | ||
4338 | .master = &omap44xx_l4_abe_hwmod, | ||
4339 | .slave = &omap44xx_timer7_hwmod, | ||
4340 | .clk = "ocp_abe_iclk", | ||
4341 | .addr = omap44xx_timer7_addrs, | ||
4342 | .addr_cnt = ARRAY_SIZE(omap44xx_timer7_addrs), | ||
4343 | .user = OCP_USER_MPU, | ||
4344 | }; | ||
4345 | |||
4346 | static struct omap_hwmod_addr_space omap44xx_timer7_dma_addrs[] = { | ||
4347 | { | ||
4348 | .pa_start = 0x4903c000, | ||
4349 | .pa_end = 0x4903c07f, | ||
4350 | .flags = ADDR_TYPE_RT | ||
4351 | }, | ||
4352 | }; | ||
4353 | |||
4354 | /* l4_abe -> timer7 (dma) */ | ||
4355 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer7_dma = { | ||
4356 | .master = &omap44xx_l4_abe_hwmod, | ||
4357 | .slave = &omap44xx_timer7_hwmod, | ||
4358 | .clk = "ocp_abe_iclk", | ||
4359 | .addr = omap44xx_timer7_dma_addrs, | ||
4360 | .addr_cnt = ARRAY_SIZE(omap44xx_timer7_dma_addrs), | ||
4361 | .user = OCP_USER_SDMA, | ||
4362 | }; | ||
4363 | |||
4364 | /* timer7 slave ports */ | ||
4365 | static struct omap_hwmod_ocp_if *omap44xx_timer7_slaves[] = { | ||
4366 | &omap44xx_l4_abe__timer7, | ||
4367 | &omap44xx_l4_abe__timer7_dma, | ||
4368 | }; | ||
4369 | |||
4370 | static struct omap_hwmod omap44xx_timer7_hwmod = { | ||
4371 | .name = "timer7", | ||
4372 | .class = &omap44xx_timer_hwmod_class, | ||
4373 | .mpu_irqs = omap44xx_timer7_irqs, | ||
4374 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer7_irqs), | ||
4375 | .main_clk = "timer7_fck", | ||
4376 | .prcm = { | ||
4377 | .omap4 = { | ||
4378 | .clkctrl_reg = OMAP4430_CM1_ABE_TIMER7_CLKCTRL, | ||
4379 | }, | ||
4380 | }, | ||
4381 | .slaves = omap44xx_timer7_slaves, | ||
4382 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves), | ||
4383 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4384 | }; | ||
4385 | |||
4386 | /* timer8 */ | ||
4387 | static struct omap_hwmod omap44xx_timer8_hwmod; | ||
4388 | static struct omap_hwmod_irq_info omap44xx_timer8_irqs[] = { | ||
4389 | { .irq = 44 + OMAP44XX_IRQ_GIC_START }, | ||
4390 | }; | ||
4391 | |||
4392 | static struct omap_hwmod_addr_space omap44xx_timer8_addrs[] = { | ||
4393 | { | ||
4394 | .pa_start = 0x4013e000, | ||
4395 | .pa_end = 0x4013e07f, | ||
4396 | .flags = ADDR_TYPE_RT | ||
4397 | }, | ||
4398 | }; | ||
4399 | |||
4400 | /* l4_abe -> timer8 */ | ||
4401 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer8 = { | ||
4402 | .master = &omap44xx_l4_abe_hwmod, | ||
4403 | .slave = &omap44xx_timer8_hwmod, | ||
4404 | .clk = "ocp_abe_iclk", | ||
4405 | .addr = omap44xx_timer8_addrs, | ||
4406 | .addr_cnt = ARRAY_SIZE(omap44xx_timer8_addrs), | ||
4407 | .user = OCP_USER_MPU, | ||
4408 | }; | ||
4409 | |||
4410 | static struct omap_hwmod_addr_space omap44xx_timer8_dma_addrs[] = { | ||
4411 | { | ||
4412 | .pa_start = 0x4903e000, | ||
4413 | .pa_end = 0x4903e07f, | ||
4414 | .flags = ADDR_TYPE_RT | ||
4415 | }, | ||
4416 | }; | ||
4417 | |||
4418 | /* l4_abe -> timer8 (dma) */ | ||
4419 | static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer8_dma = { | ||
4420 | .master = &omap44xx_l4_abe_hwmod, | ||
4421 | .slave = &omap44xx_timer8_hwmod, | ||
4422 | .clk = "ocp_abe_iclk", | ||
4423 | .addr = omap44xx_timer8_dma_addrs, | ||
4424 | .addr_cnt = ARRAY_SIZE(omap44xx_timer8_dma_addrs), | ||
4425 | .user = OCP_USER_SDMA, | ||
4426 | }; | ||
4427 | |||
4428 | /* timer8 slave ports */ | ||
4429 | static struct omap_hwmod_ocp_if *omap44xx_timer8_slaves[] = { | ||
4430 | &omap44xx_l4_abe__timer8, | ||
4431 | &omap44xx_l4_abe__timer8_dma, | ||
4432 | }; | ||
4433 | |||
4434 | static struct omap_hwmod omap44xx_timer8_hwmod = { | ||
4435 | .name = "timer8", | ||
4436 | .class = &omap44xx_timer_hwmod_class, | ||
4437 | .mpu_irqs = omap44xx_timer8_irqs, | ||
4438 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer8_irqs), | ||
4439 | .main_clk = "timer8_fck", | ||
4440 | .prcm = { | ||
4441 | .omap4 = { | ||
4442 | .clkctrl_reg = OMAP4430_CM1_ABE_TIMER8_CLKCTRL, | ||
4443 | }, | ||
4444 | }, | ||
4445 | .slaves = omap44xx_timer8_slaves, | ||
4446 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves), | ||
4447 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4448 | }; | ||
4449 | |||
4450 | /* timer9 */ | ||
4451 | static struct omap_hwmod omap44xx_timer9_hwmod; | ||
4452 | static struct omap_hwmod_irq_info omap44xx_timer9_irqs[] = { | ||
4453 | { .irq = 45 + OMAP44XX_IRQ_GIC_START }, | ||
4454 | }; | ||
4455 | |||
4456 | static struct omap_hwmod_addr_space omap44xx_timer9_addrs[] = { | ||
4457 | { | ||
4458 | .pa_start = 0x4803e000, | ||
4459 | .pa_end = 0x4803e07f, | ||
4460 | .flags = ADDR_TYPE_RT | ||
4461 | }, | ||
4462 | }; | ||
4463 | |||
4464 | /* l4_per -> timer9 */ | ||
4465 | static struct omap_hwmod_ocp_if omap44xx_l4_per__timer9 = { | ||
4466 | .master = &omap44xx_l4_per_hwmod, | ||
4467 | .slave = &omap44xx_timer9_hwmod, | ||
4468 | .clk = "l4_div_ck", | ||
4469 | .addr = omap44xx_timer9_addrs, | ||
4470 | .addr_cnt = ARRAY_SIZE(omap44xx_timer9_addrs), | ||
4471 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4472 | }; | ||
4473 | |||
4474 | /* timer9 slave ports */ | ||
4475 | static struct omap_hwmod_ocp_if *omap44xx_timer9_slaves[] = { | ||
4476 | &omap44xx_l4_per__timer9, | ||
4477 | }; | ||
4478 | |||
4479 | static struct omap_hwmod omap44xx_timer9_hwmod = { | ||
4480 | .name = "timer9", | ||
4481 | .class = &omap44xx_timer_hwmod_class, | ||
4482 | .mpu_irqs = omap44xx_timer9_irqs, | ||
4483 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer9_irqs), | ||
4484 | .main_clk = "timer9_fck", | ||
4485 | .prcm = { | ||
4486 | .omap4 = { | ||
4487 | .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL, | ||
4488 | }, | ||
4489 | }, | ||
4490 | .slaves = omap44xx_timer9_slaves, | ||
4491 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves), | ||
4492 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4493 | }; | ||
4494 | |||
4495 | /* timer10 */ | ||
4496 | static struct omap_hwmod omap44xx_timer10_hwmod; | ||
4497 | static struct omap_hwmod_irq_info omap44xx_timer10_irqs[] = { | ||
4498 | { .irq = 46 + OMAP44XX_IRQ_GIC_START }, | ||
4499 | }; | ||
4500 | |||
4501 | static struct omap_hwmod_addr_space omap44xx_timer10_addrs[] = { | ||
4502 | { | ||
4503 | .pa_start = 0x48086000, | ||
4504 | .pa_end = 0x4808607f, | ||
4505 | .flags = ADDR_TYPE_RT | ||
4506 | }, | ||
4507 | }; | ||
4508 | |||
4509 | /* l4_per -> timer10 */ | ||
4510 | static struct omap_hwmod_ocp_if omap44xx_l4_per__timer10 = { | ||
4511 | .master = &omap44xx_l4_per_hwmod, | ||
4512 | .slave = &omap44xx_timer10_hwmod, | ||
4513 | .clk = "l4_div_ck", | ||
4514 | .addr = omap44xx_timer10_addrs, | ||
4515 | .addr_cnt = ARRAY_SIZE(omap44xx_timer10_addrs), | ||
4516 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4517 | }; | ||
4518 | |||
4519 | /* timer10 slave ports */ | ||
4520 | static struct omap_hwmod_ocp_if *omap44xx_timer10_slaves[] = { | ||
4521 | &omap44xx_l4_per__timer10, | ||
4522 | }; | ||
4523 | |||
4524 | static struct omap_hwmod omap44xx_timer10_hwmod = { | ||
4525 | .name = "timer10", | ||
4526 | .class = &omap44xx_timer_1ms_hwmod_class, | ||
4527 | .mpu_irqs = omap44xx_timer10_irqs, | ||
4528 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer10_irqs), | ||
4529 | .main_clk = "timer10_fck", | ||
4530 | .prcm = { | ||
4531 | .omap4 = { | ||
4532 | .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, | ||
4533 | }, | ||
4534 | }, | ||
4535 | .slaves = omap44xx_timer10_slaves, | ||
4536 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves), | ||
4537 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4538 | }; | ||
4539 | |||
4540 | /* timer11 */ | ||
4541 | static struct omap_hwmod omap44xx_timer11_hwmod; | ||
4542 | static struct omap_hwmod_irq_info omap44xx_timer11_irqs[] = { | ||
4543 | { .irq = 47 + OMAP44XX_IRQ_GIC_START }, | ||
4544 | }; | ||
4545 | |||
4546 | static struct omap_hwmod_addr_space omap44xx_timer11_addrs[] = { | ||
4547 | { | ||
4548 | .pa_start = 0x48088000, | ||
4549 | .pa_end = 0x4808807f, | ||
4550 | .flags = ADDR_TYPE_RT | ||
4551 | }, | ||
4552 | }; | ||
4553 | |||
4554 | /* l4_per -> timer11 */ | ||
4555 | static struct omap_hwmod_ocp_if omap44xx_l4_per__timer11 = { | ||
4556 | .master = &omap44xx_l4_per_hwmod, | ||
4557 | .slave = &omap44xx_timer11_hwmod, | ||
4558 | .clk = "l4_div_ck", | ||
4559 | .addr = omap44xx_timer11_addrs, | ||
4560 | .addr_cnt = ARRAY_SIZE(omap44xx_timer11_addrs), | ||
4561 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4562 | }; | ||
4563 | |||
4564 | /* timer11 slave ports */ | ||
4565 | static struct omap_hwmod_ocp_if *omap44xx_timer11_slaves[] = { | ||
4566 | &omap44xx_l4_per__timer11, | ||
4567 | }; | ||
4568 | |||
4569 | static struct omap_hwmod omap44xx_timer11_hwmod = { | ||
4570 | .name = "timer11", | ||
4571 | .class = &omap44xx_timer_hwmod_class, | ||
4572 | .mpu_irqs = omap44xx_timer11_irqs, | ||
4573 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer11_irqs), | ||
4574 | .main_clk = "timer11_fck", | ||
4575 | .prcm = { | ||
4576 | .omap4 = { | ||
4577 | .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, | ||
4578 | }, | ||
4579 | }, | ||
4580 | .slaves = omap44xx_timer11_slaves, | ||
4581 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves), | ||
4582 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4583 | }; | ||
4584 | |||
4585 | /* | ||
1642 | * 'uart' class | 4586 | * 'uart' class |
1643 | * universal asynchronous receiver/transmitter (uart) | 4587 | * universal asynchronous receiver/transmitter (uart) |
1644 | */ | 4588 | */ |
@@ -1870,6 +4814,88 @@ static struct omap_hwmod omap44xx_uart4_hwmod = { | |||
1870 | }; | 4814 | }; |
1871 | 4815 | ||
1872 | /* | 4816 | /* |
4817 | * 'usb_otg_hs' class | ||
4818 | * high-speed on-the-go universal serial bus (usb_otg_hs) controller | ||
4819 | */ | ||
4820 | |||
4821 | static struct omap_hwmod_class_sysconfig omap44xx_usb_otg_hs_sysc = { | ||
4822 | .rev_offs = 0x0400, | ||
4823 | .sysc_offs = 0x0404, | ||
4824 | .syss_offs = 0x0408, | ||
4825 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | | ||
4826 | SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE | | ||
4827 | SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), | ||
4828 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
4829 | SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | | ||
4830 | MSTANDBY_SMART), | ||
4831 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
4832 | }; | ||
4833 | |||
4834 | static struct omap_hwmod_class omap44xx_usb_otg_hs_hwmod_class = { | ||
4835 | .name = "usb_otg_hs", | ||
4836 | .sysc = &omap44xx_usb_otg_hs_sysc, | ||
4837 | }; | ||
4838 | |||
4839 | /* usb_otg_hs */ | ||
4840 | static struct omap_hwmod_irq_info omap44xx_usb_otg_hs_irqs[] = { | ||
4841 | { .name = "mc", .irq = 92 + OMAP44XX_IRQ_GIC_START }, | ||
4842 | { .name = "dma", .irq = 93 + OMAP44XX_IRQ_GIC_START }, | ||
4843 | }; | ||
4844 | |||
4845 | /* usb_otg_hs master ports */ | ||
4846 | static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_masters[] = { | ||
4847 | &omap44xx_usb_otg_hs__l3_main_2, | ||
4848 | }; | ||
4849 | |||
4850 | static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { | ||
4851 | { | ||
4852 | .pa_start = 0x4a0ab000, | ||
4853 | .pa_end = 0x4a0ab003, | ||
4854 | .flags = ADDR_TYPE_RT | ||
4855 | }, | ||
4856 | }; | ||
4857 | |||
4858 | /* l4_cfg -> usb_otg_hs */ | ||
4859 | static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_otg_hs = { | ||
4860 | .master = &omap44xx_l4_cfg_hwmod, | ||
4861 | .slave = &omap44xx_usb_otg_hs_hwmod, | ||
4862 | .clk = "l4_div_ck", | ||
4863 | .addr = omap44xx_usb_otg_hs_addrs, | ||
4864 | .addr_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_addrs), | ||
4865 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
4866 | }; | ||
4867 | |||
4868 | /* usb_otg_hs slave ports */ | ||
4869 | static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_slaves[] = { | ||
4870 | &omap44xx_l4_cfg__usb_otg_hs, | ||
4871 | }; | ||
4872 | |||
4873 | static struct omap_hwmod_opt_clk usb_otg_hs_opt_clks[] = { | ||
4874 | { .role = "xclk", .clk = "usb_otg_hs_xclk" }, | ||
4875 | }; | ||
4876 | |||
4877 | static struct omap_hwmod omap44xx_usb_otg_hs_hwmod = { | ||
4878 | .name = "usb_otg_hs", | ||
4879 | .class = &omap44xx_usb_otg_hs_hwmod_class, | ||
4880 | .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, | ||
4881 | .mpu_irqs = omap44xx_usb_otg_hs_irqs, | ||
4882 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_irqs), | ||
4883 | .main_clk = "usb_otg_hs_ick", | ||
4884 | .prcm = { | ||
4885 | .omap4 = { | ||
4886 | .clkctrl_reg = OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, | ||
4887 | }, | ||
4888 | }, | ||
4889 | .opt_clks = usb_otg_hs_opt_clks, | ||
4890 | .opt_clks_cnt = ARRAY_SIZE(usb_otg_hs_opt_clks), | ||
4891 | .slaves = omap44xx_usb_otg_hs_slaves, | ||
4892 | .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves), | ||
4893 | .masters = omap44xx_usb_otg_hs_masters, | ||
4894 | .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters), | ||
4895 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4896 | }; | ||
4897 | |||
4898 | /* | ||
1873 | * 'wd_timer' class | 4899 | * 'wd_timer' class |
1874 | * 32-bit watchdog upward counter that generates a pulse on the reset pin on | 4900 | * 32-bit watchdog upward counter that generates a pulse on the reset pin on |
1875 | * overflow condition | 4901 | * overflow condition |
@@ -2024,13 +5050,34 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | |||
2024 | /* mpu_bus class */ | 5050 | /* mpu_bus class */ |
2025 | &omap44xx_mpu_private_hwmod, | 5051 | &omap44xx_mpu_private_hwmod, |
2026 | 5052 | ||
5053 | /* aess class */ | ||
5054 | /* &omap44xx_aess_hwmod, */ | ||
5055 | |||
5056 | /* bandgap class */ | ||
5057 | &omap44xx_bandgap_hwmod, | ||
5058 | |||
5059 | /* counter class */ | ||
5060 | /* &omap44xx_counter_32k_hwmod, */ | ||
5061 | |||
2027 | /* dma class */ | 5062 | /* dma class */ |
2028 | &omap44xx_dma_system_hwmod, | 5063 | &omap44xx_dma_system_hwmod, |
2029 | 5064 | ||
5065 | /* dmic class */ | ||
5066 | &omap44xx_dmic_hwmod, | ||
5067 | |||
2030 | /* dsp class */ | 5068 | /* dsp class */ |
2031 | &omap44xx_dsp_hwmod, | 5069 | &omap44xx_dsp_hwmod, |
2032 | &omap44xx_dsp_c0_hwmod, | 5070 | &omap44xx_dsp_c0_hwmod, |
2033 | 5071 | ||
5072 | /* dss class */ | ||
5073 | &omap44xx_dss_hwmod, | ||
5074 | &omap44xx_dss_dispc_hwmod, | ||
5075 | &omap44xx_dss_dsi1_hwmod, | ||
5076 | &omap44xx_dss_dsi2_hwmod, | ||
5077 | &omap44xx_dss_hdmi_hwmod, | ||
5078 | &omap44xx_dss_rfbi_hwmod, | ||
5079 | &omap44xx_dss_venc_hwmod, | ||
5080 | |||
2034 | /* gpio class */ | 5081 | /* gpio class */ |
2035 | &omap44xx_gpio1_hwmod, | 5082 | &omap44xx_gpio1_hwmod, |
2036 | &omap44xx_gpio2_hwmod, | 5083 | &omap44xx_gpio2_hwmod, |
@@ -2039,17 +5086,56 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | |||
2039 | &omap44xx_gpio5_hwmod, | 5086 | &omap44xx_gpio5_hwmod, |
2040 | &omap44xx_gpio6_hwmod, | 5087 | &omap44xx_gpio6_hwmod, |
2041 | 5088 | ||
5089 | /* hsi class */ | ||
5090 | /* &omap44xx_hsi_hwmod, */ | ||
5091 | |||
2042 | /* i2c class */ | 5092 | /* i2c class */ |
2043 | &omap44xx_i2c1_hwmod, | 5093 | &omap44xx_i2c1_hwmod, |
2044 | &omap44xx_i2c2_hwmod, | 5094 | &omap44xx_i2c2_hwmod, |
2045 | &omap44xx_i2c3_hwmod, | 5095 | &omap44xx_i2c3_hwmod, |
2046 | &omap44xx_i2c4_hwmod, | 5096 | &omap44xx_i2c4_hwmod, |
2047 | 5097 | ||
5098 | /* ipu class */ | ||
5099 | &omap44xx_ipu_hwmod, | ||
5100 | &omap44xx_ipu_c0_hwmod, | ||
5101 | &omap44xx_ipu_c1_hwmod, | ||
5102 | |||
5103 | /* iss class */ | ||
5104 | /* &omap44xx_iss_hwmod, */ | ||
5105 | |||
2048 | /* iva class */ | 5106 | /* iva class */ |
2049 | &omap44xx_iva_hwmod, | 5107 | &omap44xx_iva_hwmod, |
2050 | &omap44xx_iva_seq0_hwmod, | 5108 | &omap44xx_iva_seq0_hwmod, |
2051 | &omap44xx_iva_seq1_hwmod, | 5109 | &omap44xx_iva_seq1_hwmod, |
2052 | 5110 | ||
5111 | /* kbd class */ | ||
5112 | /* &omap44xx_kbd_hwmod, */ | ||
5113 | |||
5114 | /* mailbox class */ | ||
5115 | &omap44xx_mailbox_hwmod, | ||
5116 | |||
5117 | /* mcbsp class */ | ||
5118 | &omap44xx_mcbsp1_hwmod, | ||
5119 | &omap44xx_mcbsp2_hwmod, | ||
5120 | &omap44xx_mcbsp3_hwmod, | ||
5121 | &omap44xx_mcbsp4_hwmod, | ||
5122 | |||
5123 | /* mcpdm class */ | ||
5124 | /* &omap44xx_mcpdm_hwmod, */ | ||
5125 | |||
5126 | /* mcspi class */ | ||
5127 | &omap44xx_mcspi1_hwmod, | ||
5128 | &omap44xx_mcspi2_hwmod, | ||
5129 | &omap44xx_mcspi3_hwmod, | ||
5130 | &omap44xx_mcspi4_hwmod, | ||
5131 | |||
5132 | /* mmc class */ | ||
5133 | &omap44xx_mmc1_hwmod, | ||
5134 | &omap44xx_mmc2_hwmod, | ||
5135 | &omap44xx_mmc3_hwmod, | ||
5136 | &omap44xx_mmc4_hwmod, | ||
5137 | &omap44xx_mmc5_hwmod, | ||
5138 | |||
2053 | /* mpu class */ | 5139 | /* mpu class */ |
2054 | &omap44xx_mpu_hwmod, | 5140 | &omap44xx_mpu_hwmod, |
2055 | 5141 | ||
@@ -2058,12 +5144,31 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | |||
2058 | &omap44xx_smartreflex_iva_hwmod, | 5144 | &omap44xx_smartreflex_iva_hwmod, |
2059 | &omap44xx_smartreflex_mpu_hwmod, | 5145 | &omap44xx_smartreflex_mpu_hwmod, |
2060 | 5146 | ||
5147 | /* spinlock class */ | ||
5148 | &omap44xx_spinlock_hwmod, | ||
5149 | |||
5150 | /* timer class */ | ||
5151 | &omap44xx_timer1_hwmod, | ||
5152 | &omap44xx_timer2_hwmod, | ||
5153 | &omap44xx_timer3_hwmod, | ||
5154 | &omap44xx_timer4_hwmod, | ||
5155 | &omap44xx_timer5_hwmod, | ||
5156 | &omap44xx_timer6_hwmod, | ||
5157 | &omap44xx_timer7_hwmod, | ||
5158 | &omap44xx_timer8_hwmod, | ||
5159 | &omap44xx_timer9_hwmod, | ||
5160 | &omap44xx_timer10_hwmod, | ||
5161 | &omap44xx_timer11_hwmod, | ||
5162 | |||
2061 | /* uart class */ | 5163 | /* uart class */ |
2062 | &omap44xx_uart1_hwmod, | 5164 | &omap44xx_uart1_hwmod, |
2063 | &omap44xx_uart2_hwmod, | 5165 | &omap44xx_uart2_hwmod, |
2064 | &omap44xx_uart3_hwmod, | 5166 | &omap44xx_uart3_hwmod, |
2065 | &omap44xx_uart4_hwmod, | 5167 | &omap44xx_uart4_hwmod, |
2066 | 5168 | ||
5169 | /* usb_otg_hs class */ | ||
5170 | &omap44xx_usb_otg_hs_hwmod, | ||
5171 | |||
2067 | /* wd_timer class */ | 5172 | /* wd_timer class */ |
2068 | &omap44xx_wd_timer2_hwmod, | 5173 | &omap44xx_wd_timer2_hwmod, |
2069 | &omap44xx_wd_timer3_hwmod, | 5174 | &omap44xx_wd_timer3_hwmod, |
@@ -2073,6 +5178,6 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | |||
2073 | 5178 | ||
2074 | int __init omap44xx_hwmod_init(void) | 5179 | int __init omap44xx_hwmod_init(void) |
2075 | { | 5180 | { |
2076 | return omap_hwmod_init(omap44xx_hwmods); | 5181 | return omap_hwmod_register(omap44xx_hwmods); |
2077 | } | 5182 | } |
2078 | 5183 | ||
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c new file mode 100644 index 000000000000..82632c24076f --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_noc.c | |||
@@ -0,0 +1,253 @@ | |||
1 | /* | ||
2 | * OMAP4XXX L3 Interconnect error handling driver | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Corporation | ||
5 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
6 | * Sricharan <r.sricharan@ti.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
21 | * USA | ||
22 | */ | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/io.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/slab.h> | ||
29 | |||
30 | #include "omap_l3_noc.h" | ||
31 | |||
32 | /* | ||
33 | * Interrupt Handler for L3 error detection. | ||
34 | * 1) Identify the L3 clockdomain partition to which the error belongs to. | ||
35 | * 2) Identify the slave where the error information is logged | ||
36 | * 3) Print the logged information. | ||
37 | * 4) Add dump stack to provide kernel trace. | ||
38 | * | ||
39 | * Two Types of errors : | ||
40 | * 1) Custom errors in L3 : | ||
41 | * Target like DMM/FW/EMIF generates SRESP=ERR error | ||
42 | * 2) Standard L3 error: | ||
43 | * - Unsupported CMD. | ||
44 | * L3 tries to access target while it is idle | ||
45 | * - OCP disconnect. | ||
46 | * - Address hole error: | ||
47 | * If DSS/ISS/FDIF/USBHOSTFS access a target where they | ||
48 | * do not have connectivity, the error is logged in | ||
49 | * their default target which is DMM2. | ||
50 | * | ||
51 | * On High Secure devices, firewall errors are possible and those | ||
52 | * can be trapped as well. But the trapping is implemented as part | ||
53 | * secure software and hence need not be implemented here. | ||
54 | */ | ||
55 | static irqreturn_t l3_interrupt_handler(int irq, void *_l3) | ||
56 | { | ||
57 | |||
58 | struct omap4_l3 *l3 = _l3; | ||
59 | int inttype, i, j; | ||
60 | int err_src = 0; | ||
61 | u32 std_err_main_addr, std_err_main, err_reg; | ||
62 | u32 base, slave_addr, clear; | ||
63 | char *source_name; | ||
64 | |||
65 | /* Get the Type of interrupt */ | ||
66 | if (irq == l3->app_irq) | ||
67 | inttype = L3_APPLICATION_ERROR; | ||
68 | else | ||
69 | inttype = L3_DEBUG_ERROR; | ||
70 | |||
71 | for (i = 0; i < L3_MODULES; i++) { | ||
72 | /* | ||
73 | * Read the regerr register of the clock domain | ||
74 | * to determine the source | ||
75 | */ | ||
76 | base = (u32)l3->l3_base[i]; | ||
77 | err_reg = readl(base + l3_flagmux[i] + (inttype << 3)); | ||
78 | |||
79 | /* Get the corresponding error and analyse */ | ||
80 | if (err_reg) { | ||
81 | /* Identify the source from control status register */ | ||
82 | for (j = 0; !(err_reg & (1 << j)); j++) | ||
83 | ; | ||
84 | |||
85 | err_src = j; | ||
86 | /* Read the stderrlog_main_source from clk domain */ | ||
87 | std_err_main_addr = base + (*(l3_targ[i] + err_src)); | ||
88 | std_err_main = readl(std_err_main_addr); | ||
89 | |||
90 | switch ((std_err_main & CUSTOM_ERROR)) { | ||
91 | case STANDARD_ERROR: | ||
92 | source_name = | ||
93 | l3_targ_stderrlog_main_name[i][err_src]; | ||
94 | |||
95 | slave_addr = std_err_main_addr + | ||
96 | L3_SLAVE_ADDRESS_OFFSET; | ||
97 | WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n", | ||
98 | source_name, readl(slave_addr)); | ||
99 | /* clear the std error log*/ | ||
100 | clear = std_err_main | CLEAR_STDERR_LOG; | ||
101 | writel(clear, std_err_main_addr); | ||
102 | break; | ||
103 | |||
104 | case CUSTOM_ERROR: | ||
105 | source_name = | ||
106 | l3_targ_stderrlog_main_name[i][err_src]; | ||
107 | |||
108 | WARN(true, "CUSTOM SRESP error with SOURCE:%s\n", | ||
109 | source_name); | ||
110 | /* clear the std error log*/ | ||
111 | clear = std_err_main | CLEAR_STDERR_LOG; | ||
112 | writel(clear, std_err_main_addr); | ||
113 | break; | ||
114 | |||
115 | default: | ||
116 | /* Nothing to be handled here as of now */ | ||
117 | break; | ||
118 | } | ||
119 | /* Error found so break the for loop */ | ||
120 | break; | ||
121 | } | ||
122 | } | ||
123 | return IRQ_HANDLED; | ||
124 | } | ||
125 | |||
126 | static int __init omap4_l3_probe(struct platform_device *pdev) | ||
127 | { | ||
128 | static struct omap4_l3 *l3; | ||
129 | struct resource *res; | ||
130 | int ret; | ||
131 | int irq; | ||
132 | |||
133 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); | ||
134 | if (!l3) | ||
135 | ret = -ENOMEM; | ||
136 | |||
137 | platform_set_drvdata(pdev, l3); | ||
138 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
139 | if (!res) { | ||
140 | dev_err(&pdev->dev, "couldn't find resource 0\n"); | ||
141 | ret = -ENODEV; | ||
142 | goto err1; | ||
143 | } | ||
144 | |||
145 | l3->l3_base[0] = ioremap(res->start, resource_size(res)); | ||
146 | if (!(l3->l3_base[0])) { | ||
147 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
148 | ret = -ENOMEM; | ||
149 | goto err2; | ||
150 | } | ||
151 | |||
152 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | ||
153 | if (!res) { | ||
154 | dev_err(&pdev->dev, "couldn't find resource 1\n"); | ||
155 | ret = -ENODEV; | ||
156 | goto err3; | ||
157 | } | ||
158 | |||
159 | l3->l3_base[1] = ioremap(res->start, resource_size(res)); | ||
160 | if (!(l3->l3_base[1])) { | ||
161 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
162 | ret = -ENOMEM; | ||
163 | goto err4; | ||
164 | } | ||
165 | |||
166 | res = platform_get_resource(pdev, IORESOURCE_MEM, 2); | ||
167 | if (!res) { | ||
168 | dev_err(&pdev->dev, "couldn't find resource 2\n"); | ||
169 | ret = -ENODEV; | ||
170 | goto err5; | ||
171 | } | ||
172 | |||
173 | l3->l3_base[2] = ioremap(res->start, resource_size(res)); | ||
174 | if (!(l3->l3_base[2])) { | ||
175 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
176 | ret = -ENOMEM; | ||
177 | goto err6; | ||
178 | } | ||
179 | |||
180 | /* | ||
181 | * Setup interrupt Handlers | ||
182 | */ | ||
183 | irq = platform_get_irq(pdev, 0); | ||
184 | ret = request_irq(irq, | ||
185 | l3_interrupt_handler, | ||
186 | IRQF_DISABLED, "l3-dbg-irq", l3); | ||
187 | if (ret) { | ||
188 | pr_crit("L3: request_irq failed to register for 0x%x\n", | ||
189 | OMAP44XX_IRQ_L3_DBG); | ||
190 | goto err7; | ||
191 | } | ||
192 | l3->debug_irq = irq; | ||
193 | |||
194 | irq = platform_get_irq(pdev, 1); | ||
195 | ret = request_irq(irq, | ||
196 | l3_interrupt_handler, | ||
197 | IRQF_DISABLED, "l3-app-irq", l3); | ||
198 | if (ret) { | ||
199 | pr_crit("L3: request_irq failed to register for 0x%x\n", | ||
200 | OMAP44XX_IRQ_L3_APP); | ||
201 | goto err8; | ||
202 | } | ||
203 | l3->app_irq = irq; | ||
204 | |||
205 | goto err0; | ||
206 | err8: | ||
207 | err7: | ||
208 | iounmap(l3->l3_base[2]); | ||
209 | err6: | ||
210 | err5: | ||
211 | iounmap(l3->l3_base[1]); | ||
212 | err4: | ||
213 | err3: | ||
214 | iounmap(l3->l3_base[0]); | ||
215 | err2: | ||
216 | err1: | ||
217 | kfree(l3); | ||
218 | err0: | ||
219 | return ret; | ||
220 | } | ||
221 | |||
222 | static int __exit omap4_l3_remove(struct platform_device *pdev) | ||
223 | { | ||
224 | struct omap4_l3 *l3 = platform_get_drvdata(pdev); | ||
225 | |||
226 | free_irq(l3->app_irq, l3); | ||
227 | free_irq(l3->debug_irq, l3); | ||
228 | iounmap(l3->l3_base[0]); | ||
229 | iounmap(l3->l3_base[1]); | ||
230 | iounmap(l3->l3_base[2]); | ||
231 | kfree(l3); | ||
232 | |||
233 | return 0; | ||
234 | } | ||
235 | |||
236 | static struct platform_driver omap4_l3_driver = { | ||
237 | .remove = __exit_p(omap4_l3_remove), | ||
238 | .driver = { | ||
239 | .name = "omap_l3_noc", | ||
240 | }, | ||
241 | }; | ||
242 | |||
243 | static int __init omap4_l3_init(void) | ||
244 | { | ||
245 | return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe); | ||
246 | } | ||
247 | postcore_initcall_sync(omap4_l3_init); | ||
248 | |||
249 | static void __exit omap4_l3_exit(void) | ||
250 | { | ||
251 | platform_driver_unregister(&omap4_l3_driver); | ||
252 | } | ||
253 | module_exit(omap4_l3_exit); | ||
diff --git a/arch/arm/mach-omap2/omap_l3_noc.h b/arch/arm/mach-omap2/omap_l3_noc.h new file mode 100644 index 000000000000..359b83348aed --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_noc.h | |||
@@ -0,0 +1,132 @@ | |||
1 | /* | ||
2 | * OMAP4XXX L3 Interconnect error handling driver header | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Corporation | ||
5 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
6 | * sricharan <r.sricharan@ti.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
21 | * USA | ||
22 | */ | ||
23 | #ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
24 | #define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
25 | |||
26 | /* | ||
27 | * L3 register offsets | ||
28 | */ | ||
29 | #define L3_MODULES 3 | ||
30 | #define CLEAR_STDERR_LOG (1 << 31) | ||
31 | #define CUSTOM_ERROR 0x2 | ||
32 | #define STANDARD_ERROR 0x0 | ||
33 | #define INBAND_ERROR 0x0 | ||
34 | #define EMIF_KERRLOG_OFFSET 0x10 | ||
35 | #define L3_SLAVE_ADDRESS_OFFSET 0x14 | ||
36 | #define LOGICAL_ADDR_ERRORLOG 0x4 | ||
37 | #define L3_APPLICATION_ERROR 0x0 | ||
38 | #define L3_DEBUG_ERROR 0x1 | ||
39 | |||
40 | u32 l3_flagmux[L3_MODULES] = { | ||
41 | 0x50C, | ||
42 | 0x100C, | ||
43 | 0X020C | ||
44 | }; | ||
45 | |||
46 | /* | ||
47 | * L3 Target standard Error register offsets | ||
48 | */ | ||
49 | u32 l3_targ_stderrlog_main_clk1[] = { | ||
50 | 0x148, /* DMM1 */ | ||
51 | 0x248, /* DMM2 */ | ||
52 | 0x348, /* ABE */ | ||
53 | 0x448, /* L4CFG */ | ||
54 | 0x648 /* CLK2 PWR DISC */ | ||
55 | }; | ||
56 | |||
57 | u32 l3_targ_stderrlog_main_clk2[] = { | ||
58 | 0x548, /* CORTEX M3 */ | ||
59 | 0x348, /* DSS */ | ||
60 | 0x148, /* GPMC */ | ||
61 | 0x448, /* ISS */ | ||
62 | 0x748, /* IVAHD */ | ||
63 | 0xD48, /* missing in TRM corresponds to AES1*/ | ||
64 | 0x948, /* L4 PER0*/ | ||
65 | 0x248, /* OCMRAM */ | ||
66 | 0x148, /* missing in TRM corresponds to GPMC sERROR*/ | ||
67 | 0x648, /* SGX */ | ||
68 | 0x848, /* SL2 */ | ||
69 | 0x1648, /* C2C */ | ||
70 | 0x1148, /* missing in TRM corresponds PWR DISC CLK1*/ | ||
71 | 0xF48, /* missing in TRM corrsponds to SHA1*/ | ||
72 | 0xE48, /* missing in TRM corresponds to AES2*/ | ||
73 | 0xC48, /* L4 PER3 */ | ||
74 | 0xA48, /* L4 PER1*/ | ||
75 | 0xB48 /* L4 PER2*/ | ||
76 | }; | ||
77 | |||
78 | u32 l3_targ_stderrlog_main_clk3[] = { | ||
79 | 0x0148 /* EMUSS */ | ||
80 | }; | ||
81 | |||
82 | char *l3_targ_stderrlog_main_name[L3_MODULES][18] = { | ||
83 | { | ||
84 | "DMM1", | ||
85 | "DMM2", | ||
86 | "ABE", | ||
87 | "L4CFG", | ||
88 | "CLK2 PWR DISC", | ||
89 | }, | ||
90 | { | ||
91 | "CORTEX M3" , | ||
92 | "DSS ", | ||
93 | "GPMC ", | ||
94 | "ISS ", | ||
95 | "IVAHD ", | ||
96 | "AES1", | ||
97 | "L4 PER0", | ||
98 | "OCMRAM ", | ||
99 | "GPMC sERROR", | ||
100 | "SGX ", | ||
101 | "SL2 ", | ||
102 | "C2C ", | ||
103 | "PWR DISC CLK1", | ||
104 | "SHA1", | ||
105 | "AES2", | ||
106 | "L4 PER3", | ||
107 | "L4 PER1", | ||
108 | "L4 PER2", | ||
109 | }, | ||
110 | { | ||
111 | "EMUSS", | ||
112 | }, | ||
113 | }; | ||
114 | |||
115 | u32 *l3_targ[L3_MODULES] = { | ||
116 | l3_targ_stderrlog_main_clk1, | ||
117 | l3_targ_stderrlog_main_clk2, | ||
118 | l3_targ_stderrlog_main_clk3, | ||
119 | }; | ||
120 | |||
121 | struct omap4_l3 { | ||
122 | struct device *dev; | ||
123 | struct clk *ick; | ||
124 | |||
125 | /* memory base */ | ||
126 | void __iomem *l3_base[4]; | ||
127 | |||
128 | int debug_irq; | ||
129 | int app_irq; | ||
130 | }; | ||
131 | |||
132 | #endif | ||
diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c new file mode 100644 index 000000000000..265bff3acb9e --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_smx.c | |||
@@ -0,0 +1,314 @@ | |||
1 | /* | ||
2 | * OMAP3XXX L3 Interconnect Driver | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Corporation | ||
5 | * Felipe Balbi <balbi@ti.com> | ||
6 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
7 | * Sricharan <r.sricharan@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 as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
22 | * USA | ||
23 | */ | ||
24 | |||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/slab.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <linux/io.h> | ||
30 | #include "omap_l3_smx.h" | ||
31 | |||
32 | static inline u64 omap3_l3_readll(void __iomem *base, u16 reg) | ||
33 | { | ||
34 | return __raw_readll(base + reg); | ||
35 | } | ||
36 | |||
37 | static inline void omap3_l3_writell(void __iomem *base, u16 reg, u64 value) | ||
38 | { | ||
39 | __raw_writell(value, base + reg); | ||
40 | } | ||
41 | |||
42 | static inline enum omap3_l3_code omap3_l3_decode_error_code(u64 error) | ||
43 | { | ||
44 | return (error & 0x0f000000) >> L3_ERROR_LOG_CODE; | ||
45 | } | ||
46 | |||
47 | static inline u32 omap3_l3_decode_addr(u64 error_addr) | ||
48 | { | ||
49 | return error_addr & 0xffffffff; | ||
50 | } | ||
51 | |||
52 | static inline unsigned omap3_l3_decode_cmd(u64 error) | ||
53 | { | ||
54 | return (error & 0x07) >> L3_ERROR_LOG_CMD; | ||
55 | } | ||
56 | |||
57 | static inline enum omap3_l3_initiator_id omap3_l3_decode_initid(u64 error) | ||
58 | { | ||
59 | return (error & 0xff00) >> L3_ERROR_LOG_INITID; | ||
60 | } | ||
61 | |||
62 | static inline unsigned omap3_l3_decode_req_info(u64 error) | ||
63 | { | ||
64 | return (error >> 32) & 0xffff; | ||
65 | } | ||
66 | |||
67 | static char *omap3_l3_code_string(u8 code) | ||
68 | { | ||
69 | switch (code) { | ||
70 | case OMAP_L3_CODE_NOERROR: | ||
71 | return "No Error"; | ||
72 | case OMAP_L3_CODE_UNSUP_CMD: | ||
73 | return "Unsupported Command"; | ||
74 | case OMAP_L3_CODE_ADDR_HOLE: | ||
75 | return "Address Hole"; | ||
76 | case OMAP_L3_CODE_PROTECT_VIOLATION: | ||
77 | return "Protection Violation"; | ||
78 | case OMAP_L3_CODE_IN_BAND_ERR: | ||
79 | return "In-band Error"; | ||
80 | case OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT: | ||
81 | return "Request Timeout Not Accepted"; | ||
82 | case OMAP_L3_CODE_REQ_TOUT_NO_RESP: | ||
83 | return "Request Timeout, no response"; | ||
84 | default: | ||
85 | return "UNKNOWN error"; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | static char *omap3_l3_initiator_string(u8 initid) | ||
90 | { | ||
91 | switch (initid) { | ||
92 | case OMAP_L3_LCD: | ||
93 | return "LCD"; | ||
94 | case OMAP_L3_SAD2D: | ||
95 | return "SAD2D"; | ||
96 | case OMAP_L3_IA_MPU_SS_1: | ||
97 | case OMAP_L3_IA_MPU_SS_2: | ||
98 | case OMAP_L3_IA_MPU_SS_3: | ||
99 | case OMAP_L3_IA_MPU_SS_4: | ||
100 | case OMAP_L3_IA_MPU_SS_5: | ||
101 | return "MPU"; | ||
102 | case OMAP_L3_IA_IVA_SS_1: | ||
103 | case OMAP_L3_IA_IVA_SS_2: | ||
104 | case OMAP_L3_IA_IVA_SS_3: | ||
105 | return "IVA_SS"; | ||
106 | case OMAP_L3_IA_IVA_SS_DMA_1: | ||
107 | case OMAP_L3_IA_IVA_SS_DMA_2: | ||
108 | case OMAP_L3_IA_IVA_SS_DMA_3: | ||
109 | case OMAP_L3_IA_IVA_SS_DMA_4: | ||
110 | case OMAP_L3_IA_IVA_SS_DMA_5: | ||
111 | case OMAP_L3_IA_IVA_SS_DMA_6: | ||
112 | return "IVA_SS_DMA"; | ||
113 | case OMAP_L3_IA_SGX: | ||
114 | return "SGX"; | ||
115 | case OMAP_L3_IA_CAM_1: | ||
116 | case OMAP_L3_IA_CAM_2: | ||
117 | case OMAP_L3_IA_CAM_3: | ||
118 | return "CAM"; | ||
119 | case OMAP_L3_IA_DAP: | ||
120 | return "DAP"; | ||
121 | case OMAP_L3_SDMA_WR_1: | ||
122 | case OMAP_L3_SDMA_WR_2: | ||
123 | return "SDMA_WR"; | ||
124 | case OMAP_L3_SDMA_RD_1: | ||
125 | case OMAP_L3_SDMA_RD_2: | ||
126 | case OMAP_L3_SDMA_RD_3: | ||
127 | case OMAP_L3_SDMA_RD_4: | ||
128 | return "SDMA_RD"; | ||
129 | case OMAP_L3_USBOTG: | ||
130 | return "USB_OTG"; | ||
131 | case OMAP_L3_USBHOST: | ||
132 | return "USB_HOST"; | ||
133 | default: | ||
134 | return "UNKNOWN Initiator"; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * omap3_l3_block_irq - handles a register block's irq | ||
140 | * @l3: struct omap3_l3 * | ||
141 | * @base: register block base address | ||
142 | * @error: L3_ERROR_LOG register of our block | ||
143 | * | ||
144 | * Called in hard-irq context. Caller should take care of locking | ||
145 | * | ||
146 | * OMAP36xx TRM gives, on page 2001, Figure 9-10, the Typical Error | ||
147 | * Analysis Sequence, we are following that sequence here, please | ||
148 | * refer to that Figure for more information on the subject. | ||
149 | */ | ||
150 | static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3, | ||
151 | u64 error, int error_addr) | ||
152 | { | ||
153 | u8 code = omap3_l3_decode_error_code(error); | ||
154 | u8 initid = omap3_l3_decode_initid(error); | ||
155 | u8 multi = error & L3_ERROR_LOG_MULTI; | ||
156 | u32 address = omap3_l3_decode_addr(error_addr); | ||
157 | |||
158 | WARN(true, "%s Error seen by %s %s at address %x\n", | ||
159 | omap3_l3_code_string(code), | ||
160 | omap3_l3_initiator_string(initid), | ||
161 | multi ? "Multiple Errors" : "", | ||
162 | address); | ||
163 | |||
164 | return IRQ_HANDLED; | ||
165 | } | ||
166 | |||
167 | static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) | ||
168 | { | ||
169 | struct omap3_l3 *l3 = _l3; | ||
170 | |||
171 | u64 status, clear; | ||
172 | u64 error; | ||
173 | u64 error_addr; | ||
174 | u64 err_source = 0; | ||
175 | void __iomem *base; | ||
176 | int int_type; | ||
177 | |||
178 | irqreturn_t ret = IRQ_NONE; | ||
179 | |||
180 | if (irq == l3->app_irq) | ||
181 | int_type = L3_APPLICATION_ERROR; | ||
182 | else | ||
183 | int_type = L3_DEBUG_ERROR; | ||
184 | |||
185 | if (!int_type) { | ||
186 | status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0); | ||
187 | /* | ||
188 | * if we have a timeout error, there's nothing we can | ||
189 | * do besides rebooting the board. So let's BUG on any | ||
190 | * of such errors and handle the others. timeout error | ||
191 | * is severe and not expected to occur. | ||
192 | */ | ||
193 | BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK); | ||
194 | } else { | ||
195 | status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1); | ||
196 | /* No timeout error for debug sources */ | ||
197 | } | ||
198 | |||
199 | base = ((l3->rt) + (*(omap3_l3_bases[int_type] + err_source))); | ||
200 | |||
201 | /* identify the error source */ | ||
202 | for (err_source = 0; !(status & (1 << err_source)); err_source++) | ||
203 | ; | ||
204 | error = omap3_l3_readll(base, L3_ERROR_LOG); | ||
205 | |||
206 | if (error) { | ||
207 | error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR); | ||
208 | |||
209 | ret |= omap3_l3_block_irq(l3, error, error_addr); | ||
210 | } | ||
211 | |||
212 | /* Clear the status register */ | ||
213 | clear = ((L3_AGENT_STATUS_CLEAR_IA << int_type) | | ||
214 | (L3_AGENT_STATUS_CLEAR_TA)); | ||
215 | |||
216 | omap3_l3_writell(base, L3_AGENT_STATUS, clear); | ||
217 | |||
218 | /* clear the error log register */ | ||
219 | omap3_l3_writell(base, L3_ERROR_LOG, error); | ||
220 | |||
221 | return ret; | ||
222 | } | ||
223 | |||
224 | static int __init omap3_l3_probe(struct platform_device *pdev) | ||
225 | { | ||
226 | struct omap3_l3 *l3; | ||
227 | struct resource *res; | ||
228 | int ret; | ||
229 | int irq; | ||
230 | |||
231 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); | ||
232 | if (!l3) { | ||
233 | ret = -ENOMEM; | ||
234 | goto err0; | ||
235 | } | ||
236 | |||
237 | platform_set_drvdata(pdev, l3); | ||
238 | |||
239 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
240 | if (!res) { | ||
241 | dev_err(&pdev->dev, "couldn't find resource\n"); | ||
242 | ret = -ENODEV; | ||
243 | goto err1; | ||
244 | } | ||
245 | l3->rt = ioremap(res->start, resource_size(res)); | ||
246 | if (!(l3->rt)) { | ||
247 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
248 | ret = -ENOMEM; | ||
249 | goto err2; | ||
250 | } | ||
251 | |||
252 | irq = platform_get_irq(pdev, 0); | ||
253 | ret = request_irq(irq, omap3_l3_app_irq, | ||
254 | IRQF_DISABLED | IRQF_TRIGGER_RISING, | ||
255 | "l3-debug-irq", l3); | ||
256 | if (ret) { | ||
257 | dev_err(&pdev->dev, "couldn't request debug irq\n"); | ||
258 | goto err3; | ||
259 | } | ||
260 | l3->debug_irq = irq; | ||
261 | |||
262 | irq = platform_get_irq(pdev, 1); | ||
263 | ret = request_irq(irq, omap3_l3_app_irq, | ||
264 | IRQF_DISABLED | IRQF_TRIGGER_RISING, | ||
265 | "l3-app-irq", l3); | ||
266 | |||
267 | if (ret) { | ||
268 | dev_err(&pdev->dev, "couldn't request app irq\n"); | ||
269 | goto err4; | ||
270 | } | ||
271 | |||
272 | l3->app_irq = irq; | ||
273 | goto err0; | ||
274 | |||
275 | err4: | ||
276 | err3: | ||
277 | iounmap(l3->rt); | ||
278 | err2: | ||
279 | err1: | ||
280 | kfree(l3); | ||
281 | err0: | ||
282 | return ret; | ||
283 | } | ||
284 | |||
285 | static int __exit omap3_l3_remove(struct platform_device *pdev) | ||
286 | { | ||
287 | struct omap3_l3 *l3 = platform_get_drvdata(pdev); | ||
288 | |||
289 | free_irq(l3->app_irq, l3); | ||
290 | free_irq(l3->debug_irq, l3); | ||
291 | iounmap(l3->rt); | ||
292 | kfree(l3); | ||
293 | |||
294 | return 0; | ||
295 | } | ||
296 | |||
297 | static struct platform_driver omap3_l3_driver = { | ||
298 | .remove = __exit_p(omap3_l3_remove), | ||
299 | .driver = { | ||
300 | .name = "omap_l3_smx", | ||
301 | }, | ||
302 | }; | ||
303 | |||
304 | static int __init omap3_l3_init(void) | ||
305 | { | ||
306 | return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe); | ||
307 | } | ||
308 | postcore_initcall_sync(omap3_l3_init); | ||
309 | |||
310 | static void __exit omap3_l3_exit(void) | ||
311 | { | ||
312 | platform_driver_unregister(&omap3_l3_driver); | ||
313 | } | ||
314 | module_exit(omap3_l3_exit); | ||
diff --git a/arch/arm/mach-omap2/omap_l3_smx.h b/arch/arm/mach-omap2/omap_l3_smx.h new file mode 100644 index 000000000000..ba2ed9a850cc --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_smx.h | |||
@@ -0,0 +1,338 @@ | |||
1 | /* | ||
2 | * OMAP3XXX L3 Interconnect Driver header | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Corporation | ||
5 | * Felipe Balbi <balbi@ti.com> | ||
6 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
7 | * sricharan <r.sricharan@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 as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
22 | * USA | ||
23 | */ | ||
24 | #ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
25 | #define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
26 | |||
27 | /* Register definitions. All 64-bit wide */ | ||
28 | #define L3_COMPONENT 0x000 | ||
29 | #define L3_CORE 0x018 | ||
30 | #define L3_AGENT_CONTROL 0x020 | ||
31 | #define L3_AGENT_STATUS 0x028 | ||
32 | #define L3_ERROR_LOG 0x058 | ||
33 | |||
34 | #define L3_ERROR_LOG_MULTI (1 << 31) | ||
35 | #define L3_ERROR_LOG_SECONDARY (1 << 30) | ||
36 | |||
37 | #define L3_ERROR_LOG_ADDR 0x060 | ||
38 | |||
39 | /* Register definitions for Sideband Interconnect */ | ||
40 | #define L3_SI_CONTROL 0x020 | ||
41 | #define L3_SI_FLAG_STATUS_0 0x510 | ||
42 | |||
43 | const u64 shift = 1; | ||
44 | |||
45 | #define L3_STATUS_0_MPUIA_BRST (shift << 0) | ||
46 | #define L3_STATUS_0_MPUIA_RSP (shift << 1) | ||
47 | #define L3_STATUS_0_MPUIA_INBAND (shift << 2) | ||
48 | #define L3_STATUS_0_IVAIA_BRST (shift << 6) | ||
49 | #define L3_STATUS_0_IVAIA_RSP (shift << 7) | ||
50 | #define L3_STATUS_0_IVAIA_INBAND (shift << 8) | ||
51 | #define L3_STATUS_0_SGXIA_BRST (shift << 9) | ||
52 | #define L3_STATUS_0_SGXIA_RSP (shift << 10) | ||
53 | #define L3_STATUS_0_SGXIA_MERROR (shift << 11) | ||
54 | #define L3_STATUS_0_CAMIA_BRST (shift << 12) | ||
55 | #define L3_STATUS_0_CAMIA_RSP (shift << 13) | ||
56 | #define L3_STATUS_0_CAMIA_INBAND (shift << 14) | ||
57 | #define L3_STATUS_0_DISPIA_BRST (shift << 15) | ||
58 | #define L3_STATUS_0_DISPIA_RSP (shift << 16) | ||
59 | #define L3_STATUS_0_DMARDIA_BRST (shift << 18) | ||
60 | #define L3_STATUS_0_DMARDIA_RSP (shift << 19) | ||
61 | #define L3_STATUS_0_DMAWRIA_BRST (shift << 21) | ||
62 | #define L3_STATUS_0_DMAWRIA_RSP (shift << 22) | ||
63 | #define L3_STATUS_0_USBOTGIA_BRST (shift << 24) | ||
64 | #define L3_STATUS_0_USBOTGIA_RSP (shift << 25) | ||
65 | #define L3_STATUS_0_USBOTGIA_INBAND (shift << 26) | ||
66 | #define L3_STATUS_0_USBHOSTIA_BRST (shift << 27) | ||
67 | #define L3_STATUS_0_USBHOSTIA_INBAND (shift << 28) | ||
68 | #define L3_STATUS_0_SMSTA_REQ (shift << 48) | ||
69 | #define L3_STATUS_0_GPMCTA_REQ (shift << 49) | ||
70 | #define L3_STATUS_0_OCMRAMTA_REQ (shift << 50) | ||
71 | #define L3_STATUS_0_OCMROMTA_REQ (shift << 51) | ||
72 | #define L3_STATUS_0_IVATA_REQ (shift << 54) | ||
73 | #define L3_STATUS_0_SGXTA_REQ (shift << 55) | ||
74 | #define L3_STATUS_0_SGXTA_SERROR (shift << 56) | ||
75 | #define L3_STATUS_0_GPMCTA_SERROR (shift << 57) | ||
76 | #define L3_STATUS_0_L4CORETA_REQ (shift << 58) | ||
77 | #define L3_STATUS_0_L4PERTA_REQ (shift << 59) | ||
78 | #define L3_STATUS_0_L4EMUTA_REQ (shift << 60) | ||
79 | #define L3_STATUS_0_MAD2DTA_REQ (shift << 61) | ||
80 | |||
81 | #define L3_STATUS_0_TIMEOUT_MASK (L3_STATUS_0_MPUIA_BRST \ | ||
82 | | L3_STATUS_0_MPUIA_RSP \ | ||
83 | | L3_STATUS_0_IVAIA_BRST \ | ||
84 | | L3_STATUS_0_IVAIA_RSP \ | ||
85 | | L3_STATUS_0_SGXIA_BRST \ | ||
86 | | L3_STATUS_0_SGXIA_RSP \ | ||
87 | | L3_STATUS_0_CAMIA_BRST \ | ||
88 | | L3_STATUS_0_CAMIA_RSP \ | ||
89 | | L3_STATUS_0_DISPIA_BRST \ | ||
90 | | L3_STATUS_0_DISPIA_RSP \ | ||
91 | | L3_STATUS_0_DMARDIA_BRST \ | ||
92 | | L3_STATUS_0_DMARDIA_RSP \ | ||
93 | | L3_STATUS_0_DMAWRIA_BRST \ | ||
94 | | L3_STATUS_0_DMAWRIA_RSP \ | ||
95 | | L3_STATUS_0_USBOTGIA_BRST \ | ||
96 | | L3_STATUS_0_USBOTGIA_RSP \ | ||
97 | | L3_STATUS_0_USBHOSTIA_BRST \ | ||
98 | | L3_STATUS_0_SMSTA_REQ \ | ||
99 | | L3_STATUS_0_GPMCTA_REQ \ | ||
100 | | L3_STATUS_0_OCMRAMTA_REQ \ | ||
101 | | L3_STATUS_0_OCMROMTA_REQ \ | ||
102 | | L3_STATUS_0_IVATA_REQ \ | ||
103 | | L3_STATUS_0_SGXTA_REQ \ | ||
104 | | L3_STATUS_0_L4CORETA_REQ \ | ||
105 | | L3_STATUS_0_L4PERTA_REQ \ | ||
106 | | L3_STATUS_0_L4EMUTA_REQ \ | ||
107 | | L3_STATUS_0_MAD2DTA_REQ) | ||
108 | |||
109 | #define L3_SI_FLAG_STATUS_1 0x530 | ||
110 | |||
111 | #define L3_STATUS_1_MPU_DATAIA (1 << 0) | ||
112 | #define L3_STATUS_1_DAPIA0 (1 << 3) | ||
113 | #define L3_STATUS_1_DAPIA1 (1 << 4) | ||
114 | #define L3_STATUS_1_IVAIA (1 << 6) | ||
115 | |||
116 | #define L3_PM_ERROR_LOG 0x020 | ||
117 | #define L3_PM_CONTROL 0x028 | ||
118 | #define L3_PM_ERROR_CLEAR_SINGLE 0x030 | ||
119 | #define L3_PM_ERROR_CLEAR_MULTI 0x038 | ||
120 | #define L3_PM_REQ_INFO_PERMISSION(n) (0x048 + (0x020 * n)) | ||
121 | #define L3_PM_READ_PERMISSION(n) (0x050 + (0x020 * n)) | ||
122 | #define L3_PM_WRITE_PERMISSION(n) (0x058 + (0x020 * n)) | ||
123 | #define L3_PM_ADDR_MATCH(n) (0x060 + (0x020 * n)) | ||
124 | |||
125 | /* L3 error log bit fields. Common for IA and TA */ | ||
126 | #define L3_ERROR_LOG_CODE 24 | ||
127 | #define L3_ERROR_LOG_INITID 8 | ||
128 | #define L3_ERROR_LOG_CMD 0 | ||
129 | |||
130 | /* L3 agent status bit fields. */ | ||
131 | #define L3_AGENT_STATUS_CLEAR_IA 0x10000000 | ||
132 | #define L3_AGENT_STATUS_CLEAR_TA 0x01000000 | ||
133 | |||
134 | #define OMAP34xx_IRQ_L3_APP 10 | ||
135 | #define L3_APPLICATION_ERROR 0x0 | ||
136 | #define L3_DEBUG_ERROR 0x1 | ||
137 | |||
138 | enum omap3_l3_initiator_id { | ||
139 | /* LCD has 1 ID */ | ||
140 | OMAP_L3_LCD = 29, | ||
141 | /* SAD2D has 1 ID */ | ||
142 | OMAP_L3_SAD2D = 28, | ||
143 | /* MPU has 5 IDs */ | ||
144 | OMAP_L3_IA_MPU_SS_1 = 27, | ||
145 | OMAP_L3_IA_MPU_SS_2 = 26, | ||
146 | OMAP_L3_IA_MPU_SS_3 = 25, | ||
147 | OMAP_L3_IA_MPU_SS_4 = 24, | ||
148 | OMAP_L3_IA_MPU_SS_5 = 23, | ||
149 | /* IVA2.2 SS has 3 IDs*/ | ||
150 | OMAP_L3_IA_IVA_SS_1 = 22, | ||
151 | OMAP_L3_IA_IVA_SS_2 = 21, | ||
152 | OMAP_L3_IA_IVA_SS_3 = 20, | ||
153 | /* IVA 2.2 SS DMA has 6 IDS */ | ||
154 | OMAP_L3_IA_IVA_SS_DMA_1 = 19, | ||
155 | OMAP_L3_IA_IVA_SS_DMA_2 = 18, | ||
156 | OMAP_L3_IA_IVA_SS_DMA_3 = 17, | ||
157 | OMAP_L3_IA_IVA_SS_DMA_4 = 16, | ||
158 | OMAP_L3_IA_IVA_SS_DMA_5 = 15, | ||
159 | OMAP_L3_IA_IVA_SS_DMA_6 = 14, | ||
160 | /* SGX has 1 ID */ | ||
161 | OMAP_L3_IA_SGX = 13, | ||
162 | /* CAM has 3 ID */ | ||
163 | OMAP_L3_IA_CAM_1 = 12, | ||
164 | OMAP_L3_IA_CAM_2 = 11, | ||
165 | OMAP_L3_IA_CAM_3 = 10, | ||
166 | /* DAP has 1 ID */ | ||
167 | OMAP_L3_IA_DAP = 9, | ||
168 | /* SDMA WR has 2 IDs */ | ||
169 | OMAP_L3_SDMA_WR_1 = 8, | ||
170 | OMAP_L3_SDMA_WR_2 = 7, | ||
171 | /* SDMA RD has 4 IDs */ | ||
172 | OMAP_L3_SDMA_RD_1 = 6, | ||
173 | OMAP_L3_SDMA_RD_2 = 5, | ||
174 | OMAP_L3_SDMA_RD_3 = 4, | ||
175 | OMAP_L3_SDMA_RD_4 = 3, | ||
176 | /* HSUSB OTG has 1 ID */ | ||
177 | OMAP_L3_USBOTG = 2, | ||
178 | /* HSUSB HOST has 1 ID */ | ||
179 | OMAP_L3_USBHOST = 1, | ||
180 | }; | ||
181 | |||
182 | enum omap3_l3_code { | ||
183 | OMAP_L3_CODE_NOERROR = 0, | ||
184 | OMAP_L3_CODE_UNSUP_CMD = 1, | ||
185 | OMAP_L3_CODE_ADDR_HOLE = 2, | ||
186 | OMAP_L3_CODE_PROTECT_VIOLATION = 3, | ||
187 | OMAP_L3_CODE_IN_BAND_ERR = 4, | ||
188 | /* codes 5 and 6 are reserved */ | ||
189 | OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT = 7, | ||
190 | OMAP_L3_CODE_REQ_TOUT_NO_RESP = 8, | ||
191 | /* codes 9 - 15 are also reserved */ | ||
192 | }; | ||
193 | |||
194 | struct omap3_l3 { | ||
195 | struct device *dev; | ||
196 | struct clk *ick; | ||
197 | |||
198 | /* memory base*/ | ||
199 | void __iomem *rt; | ||
200 | |||
201 | int debug_irq; | ||
202 | int app_irq; | ||
203 | |||
204 | /* true when and inband functional error occurs */ | ||
205 | unsigned inband:1; | ||
206 | }; | ||
207 | |||
208 | /* offsets for l3 agents in order with the Flag status register */ | ||
209 | unsigned int __iomem omap3_l3_app_bases[] = { | ||
210 | /* MPU IA */ | ||
211 | 0x1400, | ||
212 | 0x1400, | ||
213 | 0x1400, | ||
214 | /* RESERVED */ | ||
215 | 0, | ||
216 | 0, | ||
217 | 0, | ||
218 | /* IVA 2.2 IA */ | ||
219 | 0x1800, | ||
220 | 0x1800, | ||
221 | 0x1800, | ||
222 | /* SGX IA */ | ||
223 | 0x1c00, | ||
224 | 0x1c00, | ||
225 | /* RESERVED */ | ||
226 | 0, | ||
227 | /* CAMERA IA */ | ||
228 | 0x5800, | ||
229 | 0x5800, | ||
230 | 0x5800, | ||
231 | /* DISPLAY IA */ | ||
232 | 0x5400, | ||
233 | 0x5400, | ||
234 | /* RESERVED */ | ||
235 | 0, | ||
236 | /*SDMA RD IA */ | ||
237 | 0x4c00, | ||
238 | 0x4c00, | ||
239 | /* RESERVED */ | ||
240 | 0, | ||
241 | /* SDMA WR IA */ | ||
242 | 0x5000, | ||
243 | 0x5000, | ||
244 | /* RESERVED */ | ||
245 | 0, | ||
246 | /* USB OTG IA */ | ||
247 | 0x4400, | ||
248 | 0x4400, | ||
249 | 0x4400, | ||
250 | /* USB HOST IA */ | ||
251 | 0x4000, | ||
252 | 0x4000, | ||
253 | /* RESERVED */ | ||
254 | 0, | ||
255 | 0, | ||
256 | 0, | ||
257 | 0, | ||
258 | /* SAD2D IA */ | ||
259 | 0x3000, | ||
260 | 0x3000, | ||
261 | 0x3000, | ||
262 | /* RESERVED */ | ||
263 | 0, | ||
264 | 0, | ||
265 | 0, | ||
266 | 0, | ||
267 | 0, | ||
268 | 0, | ||
269 | 0, | ||
270 | 0, | ||
271 | 0, | ||
272 | 0, | ||
273 | 0, | ||
274 | 0, | ||
275 | /* SMA TA */ | ||
276 | 0x2000, | ||
277 | /* GPMC TA */ | ||
278 | 0x2400, | ||
279 | /* OCM RAM TA */ | ||
280 | 0x2800, | ||
281 | /* OCM ROM TA */ | ||
282 | 0x2C00, | ||
283 | /* L4 CORE TA */ | ||
284 | 0x6800, | ||
285 | /* L4 PER TA */ | ||
286 | 0x6c00, | ||
287 | /* IVA 2.2 TA */ | ||
288 | 0x6000, | ||
289 | /* SGX TA */ | ||
290 | 0x6400, | ||
291 | /* L4 EMU TA */ | ||
292 | 0x7000, | ||
293 | /* GPMC TA */ | ||
294 | 0x2400, | ||
295 | /* L4 CORE TA */ | ||
296 | 0x6800, | ||
297 | /* L4 PER TA */ | ||
298 | 0x6c00, | ||
299 | /* L4 EMU TA */ | ||
300 | 0x7000, | ||
301 | /* MAD2D TA */ | ||
302 | 0x3400, | ||
303 | /* RESERVED */ | ||
304 | 0, | ||
305 | 0, | ||
306 | }; | ||
307 | |||
308 | unsigned int __iomem omap3_l3_debug_bases[] = { | ||
309 | /* MPU DATA IA */ | ||
310 | 0x1400, | ||
311 | /* RESERVED */ | ||
312 | 0, | ||
313 | 0, | ||
314 | /* DAP IA */ | ||
315 | 0x5c00, | ||
316 | 0x5c00, | ||
317 | /* RESERVED */ | ||
318 | 0, | ||
319 | /* IVA 2.2 IA */ | ||
320 | 0x1800, | ||
321 | /* REST RESERVED */ | ||
322 | }; | ||
323 | |||
324 | u32 *omap3_l3_bases[] = { | ||
325 | omap3_l3_app_bases, | ||
326 | omap3_l3_debug_bases, | ||
327 | }; | ||
328 | |||
329 | /* | ||
330 | * REVISIT define __raw_readll/__raw_writell here, but move them to | ||
331 | * <asm/io.h> at some point | ||
332 | */ | ||
333 | #define __raw_writell(v, a) (__chk_io_ptr(a), \ | ||
334 | *(volatile u64 __force *)(a) = (v)) | ||
335 | #define __raw_readll(a) (__chk_io_ptr(a), \ | ||
336 | *(volatile u64 __force *)(a)) | ||
337 | |||
338 | #endif | ||
diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h index 46ac27dd6c84..c784c12f98a1 100644 --- a/arch/arm/mach-omap2/omap_opp_data.h +++ b/arch/arm/mach-omap2/omap_opp_data.h | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include <plat/omap_hwmod.h> | 22 | #include <plat/omap_hwmod.h> |
23 | 23 | ||
24 | #include "voltage.h" | ||
25 | |||
24 | /* | 26 | /* |
25 | * *BIG FAT WARNING*: | 27 | * *BIG FAT WARNING*: |
26 | * USE the following ONLY in opp data initialization common to an SoC. | 28 | * USE the following ONLY in opp data initialization common to an SoC. |
@@ -65,8 +67,30 @@ struct omap_opp_def { | |||
65 | .u_volt = _uv, \ | 67 | .u_volt = _uv, \ |
66 | } | 68 | } |
67 | 69 | ||
70 | /* | ||
71 | * Initialization wrapper used to define SmartReflex process data | ||
72 | * XXX Is this needed? Just use C99 initializers in data files? | ||
73 | */ | ||
74 | #define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \ | ||
75 | { \ | ||
76 | .volt_nominal = _v_nom, \ | ||
77 | .sr_efuse_offs = _efuse_offs, \ | ||
78 | .sr_errminlimit = _errminlimit, \ | ||
79 | .vp_errgain = _errgain \ | ||
80 | } | ||
81 | |||
68 | /* Use this to initialize the default table */ | 82 | /* Use this to initialize the default table */ |
69 | extern int __init omap_init_opp_table(struct omap_opp_def *opp_def, | 83 | extern int __init omap_init_opp_table(struct omap_opp_def *opp_def, |
70 | u32 opp_def_size); | 84 | u32 opp_def_size); |
71 | 85 | ||
86 | |||
87 | extern struct omap_volt_data omap34xx_vddmpu_volt_data[]; | ||
88 | extern struct omap_volt_data omap34xx_vddcore_volt_data[]; | ||
89 | extern struct omap_volt_data omap36xx_vddmpu_volt_data[]; | ||
90 | extern struct omap_volt_data omap36xx_vddcore_volt_data[]; | ||
91 | |||
92 | extern struct omap_volt_data omap44xx_vdd_mpu_volt_data[]; | ||
93 | extern struct omap_volt_data omap44xx_vdd_iva_volt_data[]; | ||
94 | extern struct omap_volt_data omap44xx_vdd_core_volt_data[]; | ||
95 | |||
72 | #endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */ | 96 | #endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */ |
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index ebe33df708bd..e2e605fe9138 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/usb.h> | 29 | #include <linux/usb.h> |
30 | 30 | ||
31 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
32 | #include "control.h" | ||
32 | 33 | ||
33 | /* OMAP control module register for UTMI PHY */ | 34 | /* OMAP control module register for UTMI PHY */ |
34 | #define CONTROL_DEV_CONF 0x300 | 35 | #define CONTROL_DEV_CONF 0x300 |
@@ -162,3 +163,95 @@ int omap4430_phy_exit(struct device *dev) | |||
162 | 163 | ||
163 | return 0; | 164 | return 0; |
164 | } | 165 | } |
166 | |||
167 | void am35x_musb_reset(void) | ||
168 | { | ||
169 | u32 regval; | ||
170 | |||
171 | /* Reset the musb interface */ | ||
172 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
173 | |||
174 | regval |= AM35XX_USBOTGSS_SW_RST; | ||
175 | omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET); | ||
176 | |||
177 | regval &= ~AM35XX_USBOTGSS_SW_RST; | ||
178 | omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET); | ||
179 | |||
180 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
181 | } | ||
182 | |||
183 | void am35x_musb_phy_power(u8 on) | ||
184 | { | ||
185 | unsigned long timeout = jiffies + msecs_to_jiffies(100); | ||
186 | u32 devconf2; | ||
187 | |||
188 | if (on) { | ||
189 | /* | ||
190 | * Start the on-chip PHY and its PLL. | ||
191 | */ | ||
192 | devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
193 | |||
194 | devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN); | ||
195 | devconf2 |= CONF2_PHY_PLLON; | ||
196 | |||
197 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
198 | |||
199 | pr_info(KERN_INFO "Waiting for PHY clock good...\n"); | ||
200 | while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2) | ||
201 | & CONF2_PHYCLKGD)) { | ||
202 | cpu_relax(); | ||
203 | |||
204 | if (time_after(jiffies, timeout)) { | ||
205 | pr_err(KERN_ERR "musb PHY clock good timed out\n"); | ||
206 | break; | ||
207 | } | ||
208 | } | ||
209 | } else { | ||
210 | /* | ||
211 | * Power down the on-chip PHY. | ||
212 | */ | ||
213 | devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
214 | |||
215 | devconf2 &= ~CONF2_PHY_PLLON; | ||
216 | devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN; | ||
217 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
218 | } | ||
219 | } | ||
220 | |||
221 | void am35x_musb_clear_irq(void) | ||
222 | { | ||
223 | u32 regval; | ||
224 | |||
225 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
226 | regval |= AM35XX_USBOTGSS_INT_CLR; | ||
227 | omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
228 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
229 | } | ||
230 | |||
231 | void am35x_musb_set_mode(u8 musb_mode) | ||
232 | { | ||
233 | u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
234 | |||
235 | devconf2 &= ~CONF2_OTGMODE; | ||
236 | switch (musb_mode) { | ||
237 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
238 | case MUSB_HOST: /* Force VBUS valid, ID = 0 */ | ||
239 | devconf2 |= CONF2_FORCE_HOST; | ||
240 | break; | ||
241 | #endif | ||
242 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
243 | case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */ | ||
244 | devconf2 |= CONF2_FORCE_DEVICE; | ||
245 | break; | ||
246 | #endif | ||
247 | #ifdef CONFIG_USB_MUSB_OTG | ||
248 | case MUSB_OTG: /* Don't override the VBUS/ID comparators */ | ||
249 | devconf2 |= CONF2_NO_OVERRIDE; | ||
250 | break; | ||
251 | #endif | ||
252 | default: | ||
253 | pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode); | ||
254 | } | ||
255 | |||
256 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
257 | } | ||
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index 00e1d2b53683..0a8e74e3e811 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/i2c/twl.h> | 19 | #include <linux/i2c/twl.h> |
20 | 20 | ||
21 | #include <plat/voltage.h> | 21 | #include "voltage.h" |
22 | 22 | ||
23 | #include "pm.h" | 23 | #include "pm.h" |
24 | 24 | ||
@@ -59,8 +59,15 @@ | |||
59 | 59 | ||
60 | static bool is_offset_valid; | 60 | static bool is_offset_valid; |
61 | static u8 smps_offset; | 61 | static u8 smps_offset; |
62 | /* | ||
63 | * Flag to ensure Smartreflex bit in TWL | ||
64 | * being cleared in board file is not overwritten. | ||
65 | */ | ||
66 | static bool __initdata twl_sr_enable_autoinit; | ||
62 | 67 | ||
68 | #define TWL4030_DCDC_GLOBAL_CFG 0x06 | ||
63 | #define REG_SMPS_OFFSET 0xE0 | 69 | #define REG_SMPS_OFFSET 0xE0 |
70 | #define SMARTREFLEX_ENABLE BIT(3) | ||
64 | 71 | ||
65 | static unsigned long twl4030_vsel_to_uv(const u8 vsel) | 72 | static unsigned long twl4030_vsel_to_uv(const u8 vsel) |
66 | { | 73 | { |
@@ -269,6 +276,18 @@ int __init omap3_twl_init(void) | |||
269 | omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; | 276 | omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; |
270 | } | 277 | } |
271 | 278 | ||
279 | /* | ||
280 | * The smartreflex bit on twl4030 specifies if the setting of voltage | ||
281 | * is done over the I2C_SR path. Since this setting is independent of | ||
282 | * the actual usage of smartreflex AVS module, we enable TWL SR bit | ||
283 | * by default irrespective of whether smartreflex AVS module is enabled | ||
284 | * on the OMAP side or not. This is because without this bit enabled, | ||
285 | * the voltage scaling through vp forceupdate/bypass mechanism of | ||
286 | * voltage scaling will not function on TWL over I2C_SR. | ||
287 | */ | ||
288 | if (!twl_sr_enable_autoinit) | ||
289 | omap3_twl_set_sr_bit(true); | ||
290 | |||
272 | voltdm = omap_voltage_domain_lookup("mpu"); | 291 | voltdm = omap_voltage_domain_lookup("mpu"); |
273 | omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info); | 292 | omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info); |
274 | 293 | ||
@@ -277,3 +296,44 @@ int __init omap3_twl_init(void) | |||
277 | 296 | ||
278 | return 0; | 297 | return 0; |
279 | } | 298 | } |
299 | |||
300 | /** | ||
301 | * omap3_twl_set_sr_bit() - Set/Clear SR bit on TWL | ||
302 | * @enable: enable SR mode in twl or not | ||
303 | * | ||
304 | * If 'enable' is true, enables Smartreflex bit on TWL 4030 to make sure | ||
305 | * voltage scaling through OMAP SR works. Else, the smartreflex bit | ||
306 | * on twl4030 is cleared as there are platforms which use OMAP3 and T2 but | ||
307 | * use Synchronized Scaling Hardware Strategy (ENABLE_VMODE=1) and Direct | ||
308 | * Strategy Software Scaling Mode (ENABLE_VMODE=0), for setting the voltages, | ||
309 | * in those scenarios this bit is to be cleared (enable = false). | ||
310 | * | ||
311 | * Returns 0 on sucess, error is returned if I2C read/write fails. | ||
312 | */ | ||
313 | int __init omap3_twl_set_sr_bit(bool enable) | ||
314 | { | ||
315 | u8 temp; | ||
316 | int ret; | ||
317 | if (twl_sr_enable_autoinit) | ||
318 | pr_warning("%s: unexpected multiple calls\n", __func__); | ||
319 | |||
320 | ret = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &temp, | ||
321 | TWL4030_DCDC_GLOBAL_CFG); | ||
322 | if (ret) | ||
323 | goto err; | ||
324 | |||
325 | if (enable) | ||
326 | temp |= SMARTREFLEX_ENABLE; | ||
327 | else | ||
328 | temp &= ~SMARTREFLEX_ENABLE; | ||
329 | |||
330 | ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, temp, | ||
331 | TWL4030_DCDC_GLOBAL_CFG); | ||
332 | if (!ret) { | ||
333 | twl_sr_enable_autoinit = true; | ||
334 | return 0; | ||
335 | } | ||
336 | err: | ||
337 | pr_err("%s: Error access to TWL4030 (%d)\n", __func__, ret); | ||
338 | return ret; | ||
339 | } | ||
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h index 38b730550506..8affc66a92c2 100644 --- a/arch/arm/mach-omap2/opp2xxx.h +++ b/arch/arm/mach-omap2/opp2xxx.h | |||
@@ -418,7 +418,7 @@ struct prcm_config { | |||
418 | 418 | ||
419 | extern const struct prcm_config omap2420_rate_table[]; | 419 | extern const struct prcm_config omap2420_rate_table[]; |
420 | 420 | ||
421 | #ifdef CONFIG_ARCH_OMAP2430 | 421 | #ifdef CONFIG_SOC_OMAP2430 |
422 | extern const struct prcm_config omap2430_rate_table[]; | 422 | extern const struct prcm_config omap2430_rate_table[]; |
423 | #else | 423 | #else |
424 | #define omap2430_rate_table NULL | 424 | #define omap2430_rate_table NULL |
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c index 0486fce8a92c..d95f3f945d4a 100644 --- a/arch/arm/mach-omap2/opp3xxx_data.c +++ b/arch/arm/mach-omap2/opp3xxx_data.c | |||
@@ -4,8 +4,9 @@ | |||
4 | * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/ | 4 | * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/ |
5 | * Nishanth Menon | 5 | * Nishanth Menon |
6 | * Kevin Hilman | 6 | * Kevin Hilman |
7 | * Copyright (C) 2010 Nokia Corporation. | 7 | * Copyright (C) 2010-2011 Nokia Corporation. |
8 | * Eduardo Valentin | 8 | * Eduardo Valentin |
9 | * Paul Walmsley | ||
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
@@ -20,19 +21,83 @@ | |||
20 | 21 | ||
21 | #include <plat/cpu.h> | 22 | #include <plat/cpu.h> |
22 | 23 | ||
24 | #include "control.h" | ||
23 | #include "omap_opp_data.h" | 25 | #include "omap_opp_data.h" |
26 | #include "pm.h" | ||
27 | |||
28 | /* 34xx */ | ||
29 | |||
30 | /* VDD1 */ | ||
31 | |||
32 | #define OMAP3430_VDD_MPU_OPP1_UV 975000 | ||
33 | #define OMAP3430_VDD_MPU_OPP2_UV 1075000 | ||
34 | #define OMAP3430_VDD_MPU_OPP3_UV 1200000 | ||
35 | #define OMAP3430_VDD_MPU_OPP4_UV 1270000 | ||
36 | #define OMAP3430_VDD_MPU_OPP5_UV 1350000 | ||
37 | |||
38 | struct omap_volt_data omap34xx_vddmpu_volt_data[] = { | ||
39 | VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c), | ||
40 | VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c), | ||
41 | VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18), | ||
42 | VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18), | ||
43 | VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18), | ||
44 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
45 | }; | ||
46 | |||
47 | /* VDD2 */ | ||
48 | |||
49 | #define OMAP3430_VDD_CORE_OPP1_UV 975000 | ||
50 | #define OMAP3430_VDD_CORE_OPP2_UV 1050000 | ||
51 | #define OMAP3430_VDD_CORE_OPP3_UV 1150000 | ||
52 | |||
53 | struct omap_volt_data omap34xx_vddcore_volt_data[] = { | ||
54 | VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c), | ||
55 | VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c), | ||
56 | VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18), | ||
57 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
58 | }; | ||
59 | |||
60 | /* 36xx */ | ||
61 | |||
62 | /* VDD1 */ | ||
63 | |||
64 | #define OMAP3630_VDD_MPU_OPP50_UV 1012500 | ||
65 | #define OMAP3630_VDD_MPU_OPP100_UV 1200000 | ||
66 | #define OMAP3630_VDD_MPU_OPP120_UV 1325000 | ||
67 | #define OMAP3630_VDD_MPU_OPP1G_UV 1375000 | ||
68 | |||
69 | struct omap_volt_data omap36xx_vddmpu_volt_data[] = { | ||
70 | VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c), | ||
71 | VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16), | ||
72 | VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23), | ||
73 | VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27), | ||
74 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
75 | }; | ||
76 | |||
77 | /* VDD2 */ | ||
78 | |||
79 | #define OMAP3630_VDD_CORE_OPP50_UV 1000000 | ||
80 | #define OMAP3630_VDD_CORE_OPP100_UV 1200000 | ||
81 | |||
82 | struct omap_volt_data omap36xx_vddcore_volt_data[] = { | ||
83 | VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c), | ||
84 | VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16), | ||
85 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
86 | }; | ||
87 | |||
88 | /* OPP data */ | ||
24 | 89 | ||
25 | static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { | 90 | static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { |
26 | /* MPU OPP1 */ | 91 | /* MPU OPP1 */ |
27 | OPP_INITIALIZER("mpu", true, 125000000, 975000), | 92 | OPP_INITIALIZER("mpu", true, 125000000, OMAP3430_VDD_MPU_OPP1_UV), |
28 | /* MPU OPP2 */ | 93 | /* MPU OPP2 */ |
29 | OPP_INITIALIZER("mpu", true, 250000000, 1075000), | 94 | OPP_INITIALIZER("mpu", true, 250000000, OMAP3430_VDD_MPU_OPP2_UV), |
30 | /* MPU OPP3 */ | 95 | /* MPU OPP3 */ |
31 | OPP_INITIALIZER("mpu", true, 500000000, 1200000), | 96 | OPP_INITIALIZER("mpu", true, 500000000, OMAP3430_VDD_MPU_OPP3_UV), |
32 | /* MPU OPP4 */ | 97 | /* MPU OPP4 */ |
33 | OPP_INITIALIZER("mpu", true, 550000000, 1270000), | 98 | OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV), |
34 | /* MPU OPP5 */ | 99 | /* MPU OPP5 */ |
35 | OPP_INITIALIZER("mpu", true, 600000000, 1350000), | 100 | OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV), |
36 | 101 | ||
37 | /* | 102 | /* |
38 | * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is | 103 | * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is |
@@ -42,53 +107,53 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { | |||
42 | * impact that frequency will do to the MPU and the whole system in | 107 | * impact that frequency will do to the MPU and the whole system in |
43 | * general. | 108 | * general. |
44 | */ | 109 | */ |
45 | OPP_INITIALIZER("l3_main", false, 41500000, 975000), | 110 | OPP_INITIALIZER("l3_main", false, 41500000, OMAP3430_VDD_CORE_OPP1_UV), |
46 | /* L3 OPP2 */ | 111 | /* L3 OPP2 */ |
47 | OPP_INITIALIZER("l3_main", true, 83000000, 1050000), | 112 | OPP_INITIALIZER("l3_main", true, 83000000, OMAP3430_VDD_CORE_OPP2_UV), |
48 | /* L3 OPP3 */ | 113 | /* L3 OPP3 */ |
49 | OPP_INITIALIZER("l3_main", true, 166000000, 1150000), | 114 | OPP_INITIALIZER("l3_main", true, 166000000, OMAP3430_VDD_CORE_OPP3_UV), |
50 | 115 | ||
51 | /* DSP OPP1 */ | 116 | /* DSP OPP1 */ |
52 | OPP_INITIALIZER("iva", true, 90000000, 975000), | 117 | OPP_INITIALIZER("iva", true, 90000000, OMAP3430_VDD_MPU_OPP1_UV), |
53 | /* DSP OPP2 */ | 118 | /* DSP OPP2 */ |
54 | OPP_INITIALIZER("iva", true, 180000000, 1075000), | 119 | OPP_INITIALIZER("iva", true, 180000000, OMAP3430_VDD_MPU_OPP2_UV), |
55 | /* DSP OPP3 */ | 120 | /* DSP OPP3 */ |
56 | OPP_INITIALIZER("iva", true, 360000000, 1200000), | 121 | OPP_INITIALIZER("iva", true, 360000000, OMAP3430_VDD_MPU_OPP3_UV), |
57 | /* DSP OPP4 */ | 122 | /* DSP OPP4 */ |
58 | OPP_INITIALIZER("iva", true, 400000000, 1270000), | 123 | OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV), |
59 | /* DSP OPP5 */ | 124 | /* DSP OPP5 */ |
60 | OPP_INITIALIZER("iva", true, 430000000, 1350000), | 125 | OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV), |
61 | }; | 126 | }; |
62 | 127 | ||
63 | static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { | 128 | static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { |
64 | /* MPU OPP1 - OPP50 */ | 129 | /* MPU OPP1 - OPP50 */ |
65 | OPP_INITIALIZER("mpu", true, 300000000, 1012500), | 130 | OPP_INITIALIZER("mpu", true, 300000000, OMAP3630_VDD_MPU_OPP50_UV), |
66 | /* MPU OPP2 - OPP100 */ | 131 | /* MPU OPP2 - OPP100 */ |
67 | OPP_INITIALIZER("mpu", true, 600000000, 1200000), | 132 | OPP_INITIALIZER("mpu", true, 600000000, OMAP3630_VDD_MPU_OPP100_UV), |
68 | /* MPU OPP3 - OPP-Turbo */ | 133 | /* MPU OPP3 - OPP-Turbo */ |
69 | OPP_INITIALIZER("mpu", false, 800000000, 1325000), | 134 | OPP_INITIALIZER("mpu", false, 800000000, OMAP3630_VDD_MPU_OPP120_UV), |
70 | /* MPU OPP4 - OPP-SB */ | 135 | /* MPU OPP4 - OPP-SB */ |
71 | OPP_INITIALIZER("mpu", false, 1000000000, 1375000), | 136 | OPP_INITIALIZER("mpu", false, 1000000000, OMAP3630_VDD_MPU_OPP1G_UV), |
72 | 137 | ||
73 | /* L3 OPP1 - OPP50 */ | 138 | /* L3 OPP1 - OPP50 */ |
74 | OPP_INITIALIZER("l3_main", true, 100000000, 1000000), | 139 | OPP_INITIALIZER("l3_main", true, 100000000, OMAP3630_VDD_CORE_OPP50_UV), |
75 | /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ | 140 | /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ |
76 | OPP_INITIALIZER("l3_main", true, 200000000, 1200000), | 141 | OPP_INITIALIZER("l3_main", true, 200000000, OMAP3630_VDD_CORE_OPP100_UV), |
77 | 142 | ||
78 | /* DSP OPP1 - OPP50 */ | 143 | /* DSP OPP1 - OPP50 */ |
79 | OPP_INITIALIZER("iva", true, 260000000, 1012500), | 144 | OPP_INITIALIZER("iva", true, 260000000, OMAP3630_VDD_MPU_OPP50_UV), |
80 | /* DSP OPP2 - OPP100 */ | 145 | /* DSP OPP2 - OPP100 */ |
81 | OPP_INITIALIZER("iva", true, 520000000, 1200000), | 146 | OPP_INITIALIZER("iva", true, 520000000, OMAP3630_VDD_MPU_OPP100_UV), |
82 | /* DSP OPP3 - OPP-Turbo */ | 147 | /* DSP OPP3 - OPP-Turbo */ |
83 | OPP_INITIALIZER("iva", false, 660000000, 1325000), | 148 | OPP_INITIALIZER("iva", false, 660000000, OMAP3630_VDD_MPU_OPP120_UV), |
84 | /* DSP OPP4 - OPP-SB */ | 149 | /* DSP OPP4 - OPP-SB */ |
85 | OPP_INITIALIZER("iva", false, 800000000, 1375000), | 150 | OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV), |
86 | }; | 151 | }; |
87 | 152 | ||
88 | /** | 153 | /** |
89 | * omap3_opp_init() - initialize omap3 opp table | 154 | * omap3_opp_init() - initialize omap3 opp table |
90 | */ | 155 | */ |
91 | static int __init omap3_opp_init(void) | 156 | int __init omap3_opp_init(void) |
92 | { | 157 | { |
93 | int r = -ENODEV; | 158 | int r = -ENODEV; |
94 | 159 | ||
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c index a11fa566d8ee..2293ba27101b 100644 --- a/arch/arm/mach-omap2/opp4xxx_data.c +++ b/arch/arm/mach-omap2/opp4xxx_data.c | |||
@@ -5,8 +5,9 @@ | |||
5 | * Nishanth Menon | 5 | * Nishanth Menon |
6 | * Kevin Hilman | 6 | * Kevin Hilman |
7 | * Thara Gopinath | 7 | * Thara Gopinath |
8 | * Copyright (C) 2010 Nokia Corporation. | 8 | * Copyright (C) 2010-2011 Nokia Corporation. |
9 | * Eduardo Valentin | 9 | * Eduardo Valentin |
10 | * Paul Walmsley | ||
10 | * | 11 | * |
11 | * 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 |
12 | * 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 |
@@ -21,28 +22,75 @@ | |||
21 | 22 | ||
22 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
23 | 24 | ||
25 | #include "control.h" | ||
24 | #include "omap_opp_data.h" | 26 | #include "omap_opp_data.h" |
27 | #include "pm.h" | ||
28 | |||
29 | /* | ||
30 | * Structures containing OMAP4430 voltage supported and various | ||
31 | * voltage dependent data for each VDD. | ||
32 | */ | ||
33 | |||
34 | #define OMAP4430_VDD_MPU_OPP50_UV 1025000 | ||
35 | #define OMAP4430_VDD_MPU_OPP100_UV 1200000 | ||
36 | #define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000 | ||
37 | #define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000 | ||
38 | |||
39 | struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = { | ||
40 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c), | ||
41 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16), | ||
42 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23), | ||
43 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27), | ||
44 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
45 | }; | ||
46 | |||
47 | #define OMAP4430_VDD_IVA_OPP50_UV 1013000 | ||
48 | #define OMAP4430_VDD_IVA_OPP100_UV 1188000 | ||
49 | #define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000 | ||
50 | |||
51 | struct omap_volt_data omap44xx_vdd_iva_volt_data[] = { | ||
52 | VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c), | ||
53 | VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16), | ||
54 | VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23), | ||
55 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
56 | }; | ||
57 | |||
58 | #define OMAP4430_VDD_CORE_OPP50_UV 1025000 | ||
59 | #define OMAP4430_VDD_CORE_OPP100_UV 1200000 | ||
60 | |||
61 | struct omap_volt_data omap44xx_vdd_core_volt_data[] = { | ||
62 | VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c), | ||
63 | VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16), | ||
64 | VOLT_DATA_DEFINE(0, 0, 0, 0), | ||
65 | }; | ||
66 | |||
25 | 67 | ||
26 | static struct omap_opp_def __initdata omap44xx_opp_def_list[] = { | 68 | static struct omap_opp_def __initdata omap44xx_opp_def_list[] = { |
27 | /* MPU OPP1 - OPP50 */ | 69 | /* MPU OPP1 - OPP50 */ |
28 | OPP_INITIALIZER("mpu", true, 300000000, 1100000), | 70 | OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV), |
29 | /* MPU OPP2 - OPP100 */ | 71 | /* MPU OPP2 - OPP100 */ |
30 | OPP_INITIALIZER("mpu", true, 600000000, 1200000), | 72 | OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV), |
31 | /* MPU OPP3 - OPP-Turbo */ | 73 | /* MPU OPP3 - OPP-Turbo */ |
32 | OPP_INITIALIZER("mpu", false, 800000000, 1260000), | 74 | OPP_INITIALIZER("mpu", true, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV), |
33 | /* MPU OPP4 - OPP-SB */ | 75 | /* MPU OPP4 - OPP-SB */ |
34 | OPP_INITIALIZER("mpu", false, 1008000000, 1350000), | 76 | OPP_INITIALIZER("mpu", true, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV), |
35 | /* L3 OPP1 - OPP50 */ | 77 | /* L3 OPP1 - OPP50 */ |
36 | OPP_INITIALIZER("l3_main_1", true, 100000000, 930000), | 78 | OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV), |
37 | /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ | 79 | /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ |
38 | OPP_INITIALIZER("l3_main_1", true, 200000000, 1100000), | 80 | OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV), |
39 | /* TODO: add IVA, DSP, aess, fdif, gpu */ | 81 | /* IVA OPP1 - OPP50 */ |
82 | OPP_INITIALIZER("iva", true, 133000000, OMAP4430_VDD_IVA_OPP50_UV), | ||
83 | /* IVA OPP2 - OPP100 */ | ||
84 | OPP_INITIALIZER("iva", true, 266100000, OMAP4430_VDD_IVA_OPP100_UV), | ||
85 | /* IVA OPP3 - OPP-Turbo */ | ||
86 | OPP_INITIALIZER("iva", false, 332000000, OMAP4430_VDD_IVA_OPPTURBO_UV), | ||
87 | /* TODO: add DSP, aess, fdif, gpu */ | ||
40 | }; | 88 | }; |
41 | 89 | ||
42 | /** | 90 | /** |
43 | * omap4_opp_init() - initialize omap4 opp table | 91 | * omap4_opp_init() - initialize omap4 opp table |
44 | */ | 92 | */ |
45 | static int __init omap4_opp_init(void) | 93 | int __init omap4_opp_init(void) |
46 | { | 94 | { |
47 | int r = -ENODEV; | 95 | int r = -ENODEV; |
48 | 96 | ||
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index d5a102c71989..30af3351c2d6 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <plat/omap-pm.h> | 18 | #include <plat/omap-pm.h> |
19 | #include <plat/omap_device.h> | 19 | #include <plat/omap_device.h> |
20 | #include <plat/common.h> | 20 | #include <plat/common.h> |
21 | #include <plat/voltage.h> | ||
22 | 21 | ||
22 | #include "voltage.h" | ||
23 | #include "powerdomain.h" | 23 | #include "powerdomain.h" |
24 | #include "clockdomain.h" | 24 | #include "clockdomain.h" |
25 | #include "pm.h" | 25 | #include "pm.h" |
@@ -83,7 +83,9 @@ static int _init_omap_device(char *name, struct device **new_dev) | |||
83 | static void omap2_init_processor_devices(void) | 83 | static void omap2_init_processor_devices(void) |
84 | { | 84 | { |
85 | _init_omap_device("mpu", &mpu_dev); | 85 | _init_omap_device("mpu", &mpu_dev); |
86 | _init_omap_device("iva", &iva_dev); | 86 | if (omap3_has_iva()) |
87 | _init_omap_device("iva", &iva_dev); | ||
88 | |||
87 | if (cpu_is_omap44xx()) { | 89 | if (cpu_is_omap44xx()) { |
88 | _init_omap_device("l3_main_1", &l3_dev); | 90 | _init_omap_device("l3_main_1", &l3_dev); |
89 | _init_omap_device("dsp", &dsp_dev); | 91 | _init_omap_device("dsp", &dsp_dev); |
@@ -124,7 +126,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
124 | (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { | 126 | (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { |
125 | sleep_switch = LOWPOWERSTATE_SWITCH; | 127 | sleep_switch = LOWPOWERSTATE_SWITCH; |
126 | } else { | 128 | } else { |
127 | omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); | 129 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); |
128 | pwrdm_wait_transition(pwrdm); | 130 | pwrdm_wait_transition(pwrdm); |
129 | sleep_switch = FORCEWAKEUP_SWITCH; | 131 | sleep_switch = FORCEWAKEUP_SWITCH; |
130 | } | 132 | } |
@@ -140,9 +142,9 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
140 | switch (sleep_switch) { | 142 | switch (sleep_switch) { |
141 | case FORCEWAKEUP_SWITCH: | 143 | case FORCEWAKEUP_SWITCH: |
142 | if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO) | 144 | if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO) |
143 | omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); | 145 | clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); |
144 | else | 146 | else |
145 | omap2_clkdm_sleep(pwrdm->pwrdm_clkdms[0]); | 147 | clkdm_sleep(pwrdm->pwrdm_clkdms[0]); |
146 | break; | 148 | break; |
147 | case LOWPOWERSTATE_SWITCH: | 149 | case LOWPOWERSTATE_SWITCH: |
148 | pwrdm_set_lowpwrstchange(pwrdm); | 150 | pwrdm_set_lowpwrstchange(pwrdm); |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 39580e6060e8..797bfd12b643 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -127,6 +127,7 @@ static inline void omap_enable_smartreflex_on_init(void) {} | |||
127 | #ifdef CONFIG_TWL4030_CORE | 127 | #ifdef CONFIG_TWL4030_CORE |
128 | extern int omap3_twl_init(void); | 128 | extern int omap3_twl_init(void); |
129 | extern int omap4_twl_init(void); | 129 | extern int omap4_twl_init(void); |
130 | extern int omap3_twl_set_sr_bit(bool enable); | ||
130 | #else | 131 | #else |
131 | static inline int omap3_twl_init(void) | 132 | static inline int omap3_twl_init(void) |
132 | { | 133 | { |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 97feb3ab6a69..df3ded6fe194 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -363,14 +363,11 @@ static const struct platform_suspend_ops __initdata omap_pm_ops; | |||
363 | /* XXX This function should be shareable between OMAP2xxx and OMAP3 */ | 363 | /* XXX This function should be shareable between OMAP2xxx and OMAP3 */ |
364 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | 364 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) |
365 | { | 365 | { |
366 | clkdm_clear_all_wkdeps(clkdm); | ||
367 | clkdm_clear_all_sleepdeps(clkdm); | ||
368 | |||
369 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) | 366 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) |
370 | omap2_clkdm_allow_idle(clkdm); | 367 | clkdm_allow_idle(clkdm); |
371 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && | 368 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && |
372 | atomic_read(&clkdm->usecount) == 0) | 369 | atomic_read(&clkdm->usecount) == 0) |
373 | omap2_clkdm_sleep(clkdm); | 370 | clkdm_sleep(clkdm); |
374 | return 0; | 371 | return 0; |
375 | } | 372 | } |
376 | 373 | ||
@@ -379,7 +376,10 @@ static void __init prcm_setup_regs(void) | |||
379 | int i, num_mem_banks; | 376 | int i, num_mem_banks; |
380 | struct powerdomain *pwrdm; | 377 | struct powerdomain *pwrdm; |
381 | 378 | ||
382 | /* Enable autoidle */ | 379 | /* |
380 | * Enable autoidle | ||
381 | * XXX This should be handled by hwmod code or PRCM init code | ||
382 | */ | ||
383 | omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, | 383 | omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, |
384 | OMAP2_PRCM_SYSCONFIG_OFFSET); | 384 | OMAP2_PRCM_SYSCONFIG_OFFSET); |
385 | 385 | ||
@@ -405,83 +405,16 @@ static void __init prcm_setup_regs(void) | |||
405 | 405 | ||
406 | pwrdm = clkdm_get_pwrdm(dsp_clkdm); | 406 | pwrdm = clkdm_get_pwrdm(dsp_clkdm); |
407 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); | 407 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); |
408 | omap2_clkdm_sleep(dsp_clkdm); | 408 | clkdm_sleep(dsp_clkdm); |
409 | 409 | ||
410 | pwrdm = clkdm_get_pwrdm(gfx_clkdm); | 410 | pwrdm = clkdm_get_pwrdm(gfx_clkdm); |
411 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); | 411 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); |
412 | omap2_clkdm_sleep(gfx_clkdm); | 412 | clkdm_sleep(gfx_clkdm); |
413 | 413 | ||
414 | /* | 414 | /* Enable hardware-supervised idle for all clkdms */ |
415 | * Clear clockdomain wakeup dependencies and enable | ||
416 | * hardware-supervised idle for all clkdms | ||
417 | */ | ||
418 | clkdm_for_each(clkdms_setup, NULL); | 415 | clkdm_for_each(clkdms_setup, NULL); |
419 | clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); | 416 | clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); |
420 | 417 | ||
421 | /* Enable clock autoidle for all domains */ | ||
422 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK | | ||
423 | OMAP24XX_AUTO_MAILBOXES_MASK | | ||
424 | OMAP24XX_AUTO_WDT4_MASK | | ||
425 | OMAP2420_AUTO_WDT3_MASK | | ||
426 | OMAP24XX_AUTO_MSPRO_MASK | | ||
427 | OMAP2420_AUTO_MMC_MASK | | ||
428 | OMAP24XX_AUTO_FAC_MASK | | ||
429 | OMAP2420_AUTO_EAC_MASK | | ||
430 | OMAP24XX_AUTO_HDQ_MASK | | ||
431 | OMAP24XX_AUTO_UART2_MASK | | ||
432 | OMAP24XX_AUTO_UART1_MASK | | ||
433 | OMAP24XX_AUTO_I2C2_MASK | | ||
434 | OMAP24XX_AUTO_I2C1_MASK | | ||
435 | OMAP24XX_AUTO_MCSPI2_MASK | | ||
436 | OMAP24XX_AUTO_MCSPI1_MASK | | ||
437 | OMAP24XX_AUTO_MCBSP2_MASK | | ||
438 | OMAP24XX_AUTO_MCBSP1_MASK | | ||
439 | OMAP24XX_AUTO_GPT12_MASK | | ||
440 | OMAP24XX_AUTO_GPT11_MASK | | ||
441 | OMAP24XX_AUTO_GPT10_MASK | | ||
442 | OMAP24XX_AUTO_GPT9_MASK | | ||
443 | OMAP24XX_AUTO_GPT8_MASK | | ||
444 | OMAP24XX_AUTO_GPT7_MASK | | ||
445 | OMAP24XX_AUTO_GPT6_MASK | | ||
446 | OMAP24XX_AUTO_GPT5_MASK | | ||
447 | OMAP24XX_AUTO_GPT4_MASK | | ||
448 | OMAP24XX_AUTO_GPT3_MASK | | ||
449 | OMAP24XX_AUTO_GPT2_MASK | | ||
450 | OMAP2420_AUTO_VLYNQ_MASK | | ||
451 | OMAP24XX_AUTO_DSS_MASK, | ||
452 | CORE_MOD, CM_AUTOIDLE1); | ||
453 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK | | ||
454 | OMAP24XX_AUTO_SSI_MASK | | ||
455 | OMAP24XX_AUTO_USB_MASK, | ||
456 | CORE_MOD, CM_AUTOIDLE2); | ||
457 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK | | ||
458 | OMAP24XX_AUTO_GPMC_MASK | | ||
459 | OMAP24XX_AUTO_SDMA_MASK, | ||
460 | CORE_MOD, CM_AUTOIDLE3); | ||
461 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK | | ||
462 | OMAP24XX_AUTO_AES_MASK | | ||
463 | OMAP24XX_AUTO_RNG_MASK | | ||
464 | OMAP24XX_AUTO_SHA_MASK | | ||
465 | OMAP24XX_AUTO_DES_MASK, | ||
466 | CORE_MOD, OMAP24XX_CM_AUTOIDLE4); | ||
467 | |||
468 | omap2_cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD, | ||
469 | CM_AUTOIDLE); | ||
470 | |||
471 | /* Put DPLL and both APLLs into autoidle mode */ | ||
472 | omap2_cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) | | ||
473 | (0x03 << OMAP24XX_AUTO_96M_SHIFT) | | ||
474 | (0x03 << OMAP24XX_AUTO_54M_SHIFT), | ||
475 | PLL_MOD, CM_AUTOIDLE); | ||
476 | |||
477 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK | | ||
478 | OMAP24XX_AUTO_WDT1_MASK | | ||
479 | OMAP24XX_AUTO_MPU_WDT_MASK | | ||
480 | OMAP24XX_AUTO_GPIOS_MASK | | ||
481 | OMAP24XX_AUTO_32KSYNC_MASK | | ||
482 | OMAP24XX_AUTO_GPT1_MASK, | ||
483 | WKUP_MOD, CM_AUTOIDLE); | ||
484 | |||
485 | /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk | 418 | /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk |
486 | * stabilisation */ | 419 | * stabilisation */ |
487 | omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, | 420 | omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 2f864e4b085d..0c5e3a46a3ad 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/console.h> | 31 | #include <linux/console.h> |
32 | #include <trace/events/power.h> | ||
32 | 33 | ||
33 | #include <plat/sram.h> | 34 | #include <plat/sram.h> |
34 | #include "clockdomain.h" | 35 | #include "clockdomain.h" |
@@ -311,11 +312,6 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id) | |||
311 | return IRQ_HANDLED; | 312 | return IRQ_HANDLED; |
312 | } | 313 | } |
313 | 314 | ||
314 | static void restore_control_register(u32 val) | ||
315 | { | ||
316 | __asm__ __volatile__ ("mcr p15, 0, %0, c1, c0, 0" : : "r" (val)); | ||
317 | } | ||
318 | |||
319 | /* Function to restore the table entry that was modified for enabling MMU */ | 315 | /* Function to restore the table entry that was modified for enabling MMU */ |
320 | static void restore_table_entry(void) | 316 | static void restore_table_entry(void) |
321 | { | 317 | { |
@@ -337,7 +333,7 @@ static void restore_table_entry(void) | |||
337 | control_reg_value = __raw_readl(scratchpad_address | 333 | control_reg_value = __raw_readl(scratchpad_address |
338 | + OMAP343X_CONTROL_REG_VALUE_OFFSET); | 334 | + OMAP343X_CONTROL_REG_VALUE_OFFSET); |
339 | /* This will enable caches and prediction */ | 335 | /* This will enable caches and prediction */ |
340 | restore_control_register(control_reg_value); | 336 | set_cr(control_reg_value); |
341 | } | 337 | } |
342 | 338 | ||
343 | void omap_sram_idle(void) | 339 | void omap_sram_idle(void) |
@@ -496,7 +492,7 @@ console_still_active: | |||
496 | 492 | ||
497 | pwrdm_post_transition(); | 493 | pwrdm_post_transition(); |
498 | 494 | ||
499 | omap2_clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]); | 495 | clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]); |
500 | } | 496 | } |
501 | 497 | ||
502 | int omap3_can_sleep(void) | 498 | int omap3_can_sleep(void) |
@@ -519,8 +515,14 @@ static void omap3_pm_idle(void) | |||
519 | if (omap_irq_pending() || need_resched()) | 515 | if (omap_irq_pending() || need_resched()) |
520 | goto out; | 516 | goto out; |
521 | 517 | ||
518 | trace_power_start(POWER_CSTATE, 1, smp_processor_id()); | ||
519 | trace_cpu_idle(1, smp_processor_id()); | ||
520 | |||
522 | omap_sram_idle(); | 521 | omap_sram_idle(); |
523 | 522 | ||
523 | trace_power_end(smp_processor_id()); | ||
524 | trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); | ||
525 | |||
524 | out: | 526 | out: |
525 | local_fiq_enable(); | 527 | local_fiq_enable(); |
526 | local_irq_enable(); | 528 | local_irq_enable(); |
@@ -688,149 +690,15 @@ static void __init omap3_d2d_idle(void) | |||
688 | 690 | ||
689 | static void __init prcm_setup_regs(void) | 691 | static void __init prcm_setup_regs(void) |
690 | { | 692 | { |
691 | u32 omap3630_auto_uart4_mask = cpu_is_omap3630() ? | ||
692 | OMAP3630_AUTO_UART4_MASK : 0; | ||
693 | u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? | 693 | u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? |
694 | OMAP3630_EN_UART4_MASK : 0; | 694 | OMAP3630_EN_UART4_MASK : 0; |
695 | u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? | 695 | u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? |
696 | OMAP3630_GRPSEL_UART4_MASK : 0; | 696 | OMAP3630_GRPSEL_UART4_MASK : 0; |
697 | 697 | ||
698 | 698 | /* XXX This should be handled by hwmod code or SCM init code */ | |
699 | /* XXX Reset all wkdeps. This should be done when initializing | ||
700 | * powerdomains */ | ||
701 | omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); | ||
702 | omap2_prm_write_mod_reg(0, MPU_MOD, PM_WKDEP); | ||
703 | omap2_prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP); | ||
704 | omap2_prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP); | ||
705 | omap2_prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP); | ||
706 | omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP); | ||
707 | if (omap_rev() > OMAP3430_REV_ES1_0) { | ||
708 | omap2_prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP); | ||
709 | omap2_prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP); | ||
710 | } else | ||
711 | omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); | ||
712 | |||
713 | /* | ||
714 | * Enable interface clock autoidle for all modules. | ||
715 | * Note that in the long run this should be done by clockfw | ||
716 | */ | ||
717 | omap2_cm_write_mod_reg( | ||
718 | OMAP3430_AUTO_MODEM_MASK | | ||
719 | OMAP3430ES2_AUTO_MMC3_MASK | | ||
720 | OMAP3430ES2_AUTO_ICR_MASK | | ||
721 | OMAP3430_AUTO_AES2_MASK | | ||
722 | OMAP3430_AUTO_SHA12_MASK | | ||
723 | OMAP3430_AUTO_DES2_MASK | | ||
724 | OMAP3430_AUTO_MMC2_MASK | | ||
725 | OMAP3430_AUTO_MMC1_MASK | | ||
726 | OMAP3430_AUTO_MSPRO_MASK | | ||
727 | OMAP3430_AUTO_HDQ_MASK | | ||
728 | OMAP3430_AUTO_MCSPI4_MASK | | ||
729 | OMAP3430_AUTO_MCSPI3_MASK | | ||
730 | OMAP3430_AUTO_MCSPI2_MASK | | ||
731 | OMAP3430_AUTO_MCSPI1_MASK | | ||
732 | OMAP3430_AUTO_I2C3_MASK | | ||
733 | OMAP3430_AUTO_I2C2_MASK | | ||
734 | OMAP3430_AUTO_I2C1_MASK | | ||
735 | OMAP3430_AUTO_UART2_MASK | | ||
736 | OMAP3430_AUTO_UART1_MASK | | ||
737 | OMAP3430_AUTO_GPT11_MASK | | ||
738 | OMAP3430_AUTO_GPT10_MASK | | ||
739 | OMAP3430_AUTO_MCBSP5_MASK | | ||
740 | OMAP3430_AUTO_MCBSP1_MASK | | ||
741 | OMAP3430ES1_AUTO_FAC_MASK | /* This is es1 only */ | ||
742 | OMAP3430_AUTO_MAILBOXES_MASK | | ||
743 | OMAP3430_AUTO_OMAPCTRL_MASK | | ||
744 | OMAP3430ES1_AUTO_FSHOSTUSB_MASK | | ||
745 | OMAP3430_AUTO_HSOTGUSB_MASK | | ||
746 | OMAP3430_AUTO_SAD2D_MASK | | ||
747 | OMAP3430_AUTO_SSI_MASK, | ||
748 | CORE_MOD, CM_AUTOIDLE1); | ||
749 | |||
750 | omap2_cm_write_mod_reg( | ||
751 | OMAP3430_AUTO_PKA_MASK | | ||
752 | OMAP3430_AUTO_AES1_MASK | | ||
753 | OMAP3430_AUTO_RNG_MASK | | ||
754 | OMAP3430_AUTO_SHA11_MASK | | ||
755 | OMAP3430_AUTO_DES1_MASK, | ||
756 | CORE_MOD, CM_AUTOIDLE2); | ||
757 | |||
758 | if (omap_rev() > OMAP3430_REV_ES1_0) { | ||
759 | omap2_cm_write_mod_reg( | ||
760 | OMAP3430_AUTO_MAD2D_MASK | | ||
761 | OMAP3430ES2_AUTO_USBTLL_MASK, | ||
762 | CORE_MOD, CM_AUTOIDLE3); | ||
763 | } | ||
764 | |||
765 | omap2_cm_write_mod_reg( | ||
766 | OMAP3430_AUTO_WDT2_MASK | | ||
767 | OMAP3430_AUTO_WDT1_MASK | | ||
768 | OMAP3430_AUTO_GPIO1_MASK | | ||
769 | OMAP3430_AUTO_32KSYNC_MASK | | ||
770 | OMAP3430_AUTO_GPT12_MASK | | ||
771 | OMAP3430_AUTO_GPT1_MASK, | ||
772 | WKUP_MOD, CM_AUTOIDLE); | ||
773 | |||
774 | omap2_cm_write_mod_reg( | ||
775 | OMAP3430_AUTO_DSS_MASK, | ||
776 | OMAP3430_DSS_MOD, | ||
777 | CM_AUTOIDLE); | ||
778 | |||
779 | omap2_cm_write_mod_reg( | ||
780 | OMAP3430_AUTO_CAM_MASK, | ||
781 | OMAP3430_CAM_MOD, | ||
782 | CM_AUTOIDLE); | ||
783 | |||
784 | omap2_cm_write_mod_reg( | ||
785 | omap3630_auto_uart4_mask | | ||
786 | OMAP3430_AUTO_GPIO6_MASK | | ||
787 | OMAP3430_AUTO_GPIO5_MASK | | ||
788 | OMAP3430_AUTO_GPIO4_MASK | | ||
789 | OMAP3430_AUTO_GPIO3_MASK | | ||
790 | OMAP3430_AUTO_GPIO2_MASK | | ||
791 | OMAP3430_AUTO_WDT3_MASK | | ||
792 | OMAP3430_AUTO_UART3_MASK | | ||
793 | OMAP3430_AUTO_GPT9_MASK | | ||
794 | OMAP3430_AUTO_GPT8_MASK | | ||
795 | OMAP3430_AUTO_GPT7_MASK | | ||
796 | OMAP3430_AUTO_GPT6_MASK | | ||
797 | OMAP3430_AUTO_GPT5_MASK | | ||
798 | OMAP3430_AUTO_GPT4_MASK | | ||
799 | OMAP3430_AUTO_GPT3_MASK | | ||
800 | OMAP3430_AUTO_GPT2_MASK | | ||
801 | OMAP3430_AUTO_MCBSP4_MASK | | ||
802 | OMAP3430_AUTO_MCBSP3_MASK | | ||
803 | OMAP3430_AUTO_MCBSP2_MASK, | ||
804 | OMAP3430_PER_MOD, | ||
805 | CM_AUTOIDLE); | ||
806 | |||
807 | if (omap_rev() > OMAP3430_REV_ES1_0) { | ||
808 | omap2_cm_write_mod_reg( | ||
809 | OMAP3430ES2_AUTO_USBHOST_MASK, | ||
810 | OMAP3430ES2_USBHOST_MOD, | ||
811 | CM_AUTOIDLE); | ||
812 | } | ||
813 | |||
814 | omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); | 699 | omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); |
815 | 700 | ||
816 | /* | 701 | /* |
817 | * Set all plls to autoidle. This is needed until autoidle is | ||
818 | * enabled by clockfw | ||
819 | */ | ||
820 | omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT, | ||
821 | OMAP3430_IVA2_MOD, CM_AUTOIDLE2); | ||
822 | omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT, | ||
823 | MPU_MOD, | ||
824 | CM_AUTOIDLE2); | ||
825 | omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) | | ||
826 | (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT), | ||
827 | PLL_MOD, | ||
828 | CM_AUTOIDLE); | ||
829 | omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT, | ||
830 | PLL_MOD, | ||
831 | CM_AUTOIDLE2); | ||
832 | |||
833 | /* | ||
834 | * Enable control of expternal oscillator through | 702 | * Enable control of expternal oscillator through |
835 | * sys_clkreq. In the long run clock framework should | 703 | * sys_clkreq. In the long run clock framework should |
836 | * take care of this. | 704 | * take care of this. |
@@ -928,8 +796,7 @@ void omap3_pm_off_mode_enable(int enable) | |||
928 | pwrst->pwrdm == core_pwrdm && | 796 | pwrst->pwrdm == core_pwrdm && |
929 | state == PWRDM_POWER_OFF) { | 797 | state == PWRDM_POWER_OFF) { |
930 | pwrst->next_state = PWRDM_POWER_RET; | 798 | pwrst->next_state = PWRDM_POWER_RET; |
931 | WARN_ONCE(1, | 799 | pr_warn("%s: Core OFF disabled due to errata i583\n", |
932 | "%s: Core OFF disabled due to errata i583\n", | ||
933 | __func__); | 800 | __func__); |
934 | } else { | 801 | } else { |
935 | pwrst->next_state = state; | 802 | pwrst->next_state = state; |
@@ -990,10 +857,10 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | |||
990 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | 857 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) |
991 | { | 858 | { |
992 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) | 859 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) |
993 | omap2_clkdm_allow_idle(clkdm); | 860 | clkdm_allow_idle(clkdm); |
994 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && | 861 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && |
995 | atomic_read(&clkdm->usecount) == 0) | 862 | atomic_read(&clkdm->usecount) == 0) |
996 | omap2_clkdm_sleep(clkdm); | 863 | clkdm_sleep(clkdm); |
997 | return 0; | 864 | return 0; |
998 | } | 865 | } |
999 | 866 | ||
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index eaed0df16699..49c6513e90d8 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP powerdomain control | 2 | * OMAP powerdomain control |
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-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> | 8 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> |
@@ -19,12 +19,15 @@ | |||
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
22 | #include <trace/events/power.h> | ||
23 | |||
22 | #include "cm2xxx_3xxx.h" | 24 | #include "cm2xxx_3xxx.h" |
23 | #include "prcm44xx.h" | 25 | #include "prcm44xx.h" |
24 | #include "cm44xx.h" | 26 | #include "cm44xx.h" |
25 | #include "prm2xxx_3xxx.h" | 27 | #include "prm2xxx_3xxx.h" |
26 | #include "prm44xx.h" | 28 | #include "prm44xx.h" |
27 | 29 | ||
30 | #include <asm/cpu.h> | ||
28 | #include <plat/cpu.h> | 31 | #include <plat/cpu.h> |
29 | #include "powerdomain.h" | 32 | #include "powerdomain.h" |
30 | #include "clockdomain.h" | 33 | #include "clockdomain.h" |
@@ -32,6 +35,8 @@ | |||
32 | 35 | ||
33 | #include "pm.h" | 36 | #include "pm.h" |
34 | 37 | ||
38 | #define PWRDM_TRACE_STATES_FLAG (1<<31) | ||
39 | |||
35 | enum { | 40 | enum { |
36 | PWRDM_STATE_NOW = 0, | 41 | PWRDM_STATE_NOW = 0, |
37 | PWRDM_STATE_PREV, | 42 | PWRDM_STATE_PREV, |
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm) | |||
130 | static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) | 135 | static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) |
131 | { | 136 | { |
132 | 137 | ||
133 | int prev; | 138 | int prev, state, trace_state = 0; |
134 | int state; | ||
135 | 139 | ||
136 | if (pwrdm == NULL) | 140 | if (pwrdm == NULL) |
137 | return -EINVAL; | 141 | return -EINVAL; |
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) | |||
148 | pwrdm->state_counter[prev]++; | 152 | pwrdm->state_counter[prev]++; |
149 | if (prev == PWRDM_POWER_RET) | 153 | if (prev == PWRDM_POWER_RET) |
150 | _update_logic_membank_counters(pwrdm); | 154 | _update_logic_membank_counters(pwrdm); |
155 | /* | ||
156 | * If the power domain did not hit the desired state, | ||
157 | * generate a trace event with both the desired and hit states | ||
158 | */ | ||
159 | if (state != prev) { | ||
160 | trace_state = (PWRDM_TRACE_STATES_FLAG | | ||
161 | ((state & OMAP_POWERSTATE_MASK) << 8) | | ||
162 | ((prev & OMAP_POWERSTATE_MASK) << 0)); | ||
163 | trace_power_domain_target(pwrdm->name, trace_state, | ||
164 | smp_processor_id()); | ||
165 | } | ||
151 | break; | 166 | break; |
152 | default: | 167 | default: |
153 | return -EINVAL; | 168 | return -EINVAL; |
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) | |||
406 | pr_debug("powerdomain: setting next powerstate for %s to %0x\n", | 421 | pr_debug("powerdomain: setting next powerstate for %s to %0x\n", |
407 | pwrdm->name, pwrst); | 422 | pwrdm->name, pwrst); |
408 | 423 | ||
409 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) | 424 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) { |
425 | /* Trace the pwrdm desired target state */ | ||
426 | trace_power_domain_target(pwrdm->name, pwrst, | ||
427 | smp_processor_id()); | ||
428 | /* Program the pwrdm desired target state */ | ||
410 | ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); | 429 | ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); |
430 | } | ||
411 | 431 | ||
412 | return ret; | 432 | return ret; |
413 | } | 433 | } |
@@ -938,3 +958,44 @@ u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) | |||
938 | 958 | ||
939 | return count; | 959 | return count; |
940 | } | 960 | } |
961 | |||
962 | /** | ||
963 | * pwrdm_can_ever_lose_context - can this powerdomain ever lose context? | ||
964 | * @pwrdm: struct powerdomain * | ||
965 | * | ||
966 | * Given a struct powerdomain * @pwrdm, returns 1 if the powerdomain | ||
967 | * can lose either memory or logic context or if @pwrdm is invalid, or | ||
968 | * returns 0 otherwise. This function is not concerned with how the | ||
969 | * powerdomain registers are programmed (i.e., to go off or not); it's | ||
970 | * concerned with whether it's ever possible for this powerdomain to | ||
971 | * go off while some other part of the chip is active. This function | ||
972 | * assumes that every powerdomain can go to either ON or INACTIVE. | ||
973 | */ | ||
974 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm) | ||
975 | { | ||
976 | int i; | ||
977 | |||
978 | if (IS_ERR_OR_NULL(pwrdm)) { | ||
979 | pr_debug("powerdomain: %s: invalid powerdomain pointer\n", | ||
980 | __func__); | ||
981 | return 1; | ||
982 | } | ||
983 | |||
984 | if (pwrdm->pwrsts & PWRSTS_OFF) | ||
985 | return 1; | ||
986 | |||
987 | if (pwrdm->pwrsts & PWRSTS_RET) { | ||
988 | if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF) | ||
989 | return 1; | ||
990 | |||
991 | for (i = 0; i < pwrdm->banks; i++) | ||
992 | if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF) | ||
993 | return 1; | ||
994 | } | ||
995 | |||
996 | for (i = 0; i < pwrdm->banks; i++) | ||
997 | if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF) | ||
998 | return 1; | ||
999 | |||
1000 | return 0; | ||
1001 | } | ||
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index c66431edfeb7..027f40bd235d 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP2/3/4 powerdomain control | 2 | * OMAP2/3/4 powerdomain control |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley | 7 | * Paul Walmsley |
8 | * | 8 | * |
@@ -34,17 +34,14 @@ | |||
34 | 34 | ||
35 | /* Powerdomain allowable state bitfields */ | 35 | /* Powerdomain allowable state bitfields */ |
36 | #define PWRSTS_ON (1 << PWRDM_POWER_ON) | 36 | #define PWRSTS_ON (1 << PWRDM_POWER_ON) |
37 | #define PWRSTS_INACTIVE (1 << PWRDM_POWER_INACTIVE) | ||
38 | #define PWRSTS_RET (1 << PWRDM_POWER_RET) | ||
37 | #define PWRSTS_OFF (1 << PWRDM_POWER_OFF) | 39 | #define PWRSTS_OFF (1 << PWRDM_POWER_OFF) |
38 | #define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \ | ||
39 | (1 << PWRDM_POWER_ON)) | ||
40 | 40 | ||
41 | #define PWRSTS_OFF_RET ((1 << PWRDM_POWER_OFF) | \ | 41 | #define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON) |
42 | (1 << PWRDM_POWER_RET)) | 42 | #define PWRSTS_OFF_RET (PWRSTS_OFF | PWRSTS_RET) |
43 | 43 | #define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON) | |
44 | #define PWRSTS_RET_ON ((1 << PWRDM_POWER_RET) | \ | 44 | #define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON) |
45 | (1 << PWRDM_POWER_ON)) | ||
46 | |||
47 | #define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | (1 << PWRDM_POWER_ON)) | ||
48 | 45 | ||
49 | 46 | ||
50 | /* Powerdomain flags */ | 47 | /* Powerdomain flags */ |
@@ -165,7 +162,6 @@ struct pwrdm_ops { | |||
165 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); | 162 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); |
166 | }; | 163 | }; |
167 | 164 | ||
168 | void pwrdm_fw_init(void); | ||
169 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); | 165 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); |
170 | 166 | ||
171 | struct powerdomain *pwrdm_lookup(const char *name); | 167 | struct powerdomain *pwrdm_lookup(const char *name); |
@@ -212,6 +208,7 @@ int pwrdm_pre_transition(void); | |||
212 | int pwrdm_post_transition(void); | 208 | int pwrdm_post_transition(void); |
213 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); | 209 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); |
214 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); | 210 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); |
211 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); | ||
215 | 212 | ||
216 | extern void omap2xxx_powerdomains_init(void); | 213 | extern void omap2xxx_powerdomains_init(void); |
217 | extern void omap3xxx_powerdomains_init(void); | 214 | extern void omap3xxx_powerdomains_init(void); |
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c index 5b4dd971320a..4210c3399769 100644 --- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c | |||
@@ -2,7 +2,7 @@ | |||
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-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
8 | * | 8 | * |
@@ -62,13 +62,13 @@ struct powerdomain gfx_omap2_pwrdm = { | |||
62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | 62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | |
63 | CHIP_IS_OMAP3430ES1), | 63 | CHIP_IS_OMAP3430ES1), |
64 | .pwrsts = PWRSTS_OFF_RET_ON, | 64 | .pwrsts = PWRSTS_OFF_RET_ON, |
65 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 65 | .pwrsts_logic_ret = PWRSTS_RET, |
66 | .banks = 1, | 66 | .banks = 1, |
67 | .pwrsts_mem_ret = { | 67 | .pwrsts_mem_ret = { |
68 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 68 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
69 | }, | 69 | }, |
70 | .pwrsts_mem_on = { | 70 | .pwrsts_mem_on = { |
71 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 71 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
72 | }, | 72 | }, |
73 | }; | 73 | }; |
74 | 74 | ||
@@ -76,4 +76,5 @@ struct powerdomain wkup_omap2_pwrdm = { | |||
76 | .name = "wkup_pwrdm", | 76 | .name = "wkup_pwrdm", |
77 | .prcm_offs = WKUP_MOD, | 77 | .prcm_offs = WKUP_MOD, |
78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | 78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
79 | .pwrsts = PWRSTS_ON, | ||
79 | }; | 80 | }; |
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c index 9b1a33500577..cc389fb2005d 100644 --- a/arch/arm/mach-omap2/powerdomains2xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP2XXX 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-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
8 | * | 8 | * |
@@ -30,13 +30,13 @@ static struct powerdomain dsp_pwrdm = { | |||
30 | .prcm_offs = OMAP24XX_DSP_MOD, | 30 | .prcm_offs = OMAP24XX_DSP_MOD, |
31 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 31 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
32 | .pwrsts = PWRSTS_OFF_RET_ON, | 32 | .pwrsts = PWRSTS_OFF_RET_ON, |
33 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 33 | .pwrsts_logic_ret = PWRSTS_RET, |
34 | .banks = 1, | 34 | .banks = 1, |
35 | .pwrsts_mem_ret = { | 35 | .pwrsts_mem_ret = { |
36 | [0] = PWRDM_POWER_RET, | 36 | [0] = PWRSTS_RET, |
37 | }, | 37 | }, |
38 | .pwrsts_mem_on = { | 38 | .pwrsts_mem_on = { |
39 | [0] = PWRDM_POWER_ON, | 39 | [0] = PWRSTS_ON, |
40 | }, | 40 | }, |
41 | }; | 41 | }; |
42 | 42 | ||
@@ -48,10 +48,10 @@ static struct powerdomain mpu_24xx_pwrdm = { | |||
48 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 48 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
49 | .banks = 1, | 49 | .banks = 1, |
50 | .pwrsts_mem_ret = { | 50 | .pwrsts_mem_ret = { |
51 | [0] = PWRDM_POWER_RET, | 51 | [0] = PWRSTS_RET, |
52 | }, | 52 | }, |
53 | .pwrsts_mem_on = { | 53 | .pwrsts_mem_on = { |
54 | [0] = PWRDM_POWER_ON, | 54 | [0] = PWRSTS_ON, |
55 | }, | 55 | }, |
56 | }; | 56 | }; |
57 | 57 | ||
@@ -78,7 +78,7 @@ static struct powerdomain core_24xx_pwrdm = { | |||
78 | * 2430-specific powerdomains | 78 | * 2430-specific powerdomains |
79 | */ | 79 | */ |
80 | 80 | ||
81 | #ifdef CONFIG_ARCH_OMAP2430 | 81 | #ifdef CONFIG_SOC_OMAP2430 |
82 | 82 | ||
83 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ | 83 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
84 | 84 | ||
@@ -87,17 +87,17 @@ static struct powerdomain mdm_pwrdm = { | |||
87 | .prcm_offs = OMAP2430_MDM_MOD, | 87 | .prcm_offs = OMAP2430_MDM_MOD, |
88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
89 | .pwrsts = PWRSTS_OFF_RET_ON, | 89 | .pwrsts = PWRSTS_OFF_RET_ON, |
90 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 90 | .pwrsts_logic_ret = PWRSTS_RET, |
91 | .banks = 1, | 91 | .banks = 1, |
92 | .pwrsts_mem_ret = { | 92 | .pwrsts_mem_ret = { |
93 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 93 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
94 | }, | 94 | }, |
95 | .pwrsts_mem_on = { | 95 | .pwrsts_mem_on = { |
96 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 96 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
97 | }, | 97 | }, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | #endif /* CONFIG_ARCH_OMAP2430 */ | 100 | #endif /* CONFIG_SOC_OMAP2430 */ |
101 | 101 | ||
102 | /* As powerdomains are added or removed above, this list must also be changed */ | 102 | /* As powerdomains are added or removed above, this list must also be changed */ |
103 | static struct powerdomain *powerdomains_omap2xxx[] __initdata = { | 103 | static struct powerdomain *powerdomains_omap2xxx[] __initdata = { |
@@ -111,7 +111,7 @@ static struct powerdomain *powerdomains_omap2xxx[] __initdata = { | |||
111 | &core_24xx_pwrdm, | 111 | &core_24xx_pwrdm, |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #ifdef CONFIG_ARCH_OMAP2430 | 114 | #ifdef CONFIG_SOC_OMAP2430 |
115 | &mdm_pwrdm, | 115 | &mdm_pwrdm, |
116 | #endif | 116 | #endif |
117 | NULL | 117 | NULL |
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c index e1bec562625b..9c9c113788b9 100644 --- a/arch/arm/mach-omap2/powerdomains3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP3 powerdomain definitions | 2 | * OMAP3 powerdomain definitions |
3 | * | 3 | * |
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-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
8 | * | 8 | * |
@@ -47,10 +47,10 @@ static struct powerdomain iva2_pwrdm = { | |||
47 | [3] = PWRSTS_OFF_RET, | 47 | [3] = PWRSTS_OFF_RET, |
48 | }, | 48 | }, |
49 | .pwrsts_mem_on = { | 49 | .pwrsts_mem_on = { |
50 | [0] = PWRDM_POWER_ON, | 50 | [0] = PWRSTS_ON, |
51 | [1] = PWRDM_POWER_ON, | 51 | [1] = PWRSTS_ON, |
52 | [2] = PWRSTS_OFF_ON, | 52 | [2] = PWRSTS_OFF_ON, |
53 | [3] = PWRDM_POWER_ON, | 53 | [3] = PWRSTS_ON, |
54 | }, | 54 | }, |
55 | }; | 55 | }; |
56 | 56 | ||
@@ -128,13 +128,13 @@ static struct powerdomain dss_pwrdm = { | |||
128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
129 | .prcm_offs = OMAP3430_DSS_MOD, | 129 | .prcm_offs = OMAP3430_DSS_MOD, |
130 | .pwrsts = PWRSTS_OFF_RET_ON, | 130 | .pwrsts = PWRSTS_OFF_RET_ON, |
131 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 131 | .pwrsts_logic_ret = PWRSTS_RET, |
132 | .banks = 1, | 132 | .banks = 1, |
133 | .pwrsts_mem_ret = { | 133 | .pwrsts_mem_ret = { |
134 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 134 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
135 | }, | 135 | }, |
136 | .pwrsts_mem_on = { | 136 | .pwrsts_mem_on = { |
137 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 137 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
138 | }, | 138 | }, |
139 | }; | 139 | }; |
140 | 140 | ||
@@ -149,13 +149,13 @@ static struct powerdomain sgx_pwrdm = { | |||
149 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 149 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
150 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ | 150 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ |
151 | .pwrsts = PWRSTS_OFF_ON, | 151 | .pwrsts = PWRSTS_OFF_ON, |
152 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 152 | .pwrsts_logic_ret = PWRSTS_RET, |
153 | .banks = 1, | 153 | .banks = 1, |
154 | .pwrsts_mem_ret = { | 154 | .pwrsts_mem_ret = { |
155 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 155 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
156 | }, | 156 | }, |
157 | .pwrsts_mem_on = { | 157 | .pwrsts_mem_on = { |
158 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 158 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
159 | }, | 159 | }, |
160 | }; | 160 | }; |
161 | 161 | ||
@@ -164,13 +164,13 @@ static struct powerdomain cam_pwrdm = { | |||
164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
165 | .prcm_offs = OMAP3430_CAM_MOD, | 165 | .prcm_offs = OMAP3430_CAM_MOD, |
166 | .pwrsts = PWRSTS_OFF_RET_ON, | 166 | .pwrsts = PWRSTS_OFF_RET_ON, |
167 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 167 | .pwrsts_logic_ret = PWRSTS_RET, |
168 | .banks = 1, | 168 | .banks = 1, |
169 | .pwrsts_mem_ret = { | 169 | .pwrsts_mem_ret = { |
170 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 170 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
171 | }, | 171 | }, |
172 | .pwrsts_mem_on = { | 172 | .pwrsts_mem_on = { |
173 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 173 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
174 | }, | 174 | }, |
175 | }; | 175 | }; |
176 | 176 | ||
@@ -182,10 +182,10 @@ static struct powerdomain per_pwrdm = { | |||
182 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 182 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
183 | .banks = 1, | 183 | .banks = 1, |
184 | .pwrsts_mem_ret = { | 184 | .pwrsts_mem_ret = { |
185 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 185 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
186 | }, | 186 | }, |
187 | .pwrsts_mem_on = { | 187 | .pwrsts_mem_on = { |
188 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 188 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
189 | }, | 189 | }, |
190 | }; | 190 | }; |
191 | 191 | ||
@@ -200,7 +200,7 @@ static struct powerdomain neon_pwrdm = { | |||
200 | .prcm_offs = OMAP3430_NEON_MOD, | 200 | .prcm_offs = OMAP3430_NEON_MOD, |
201 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 201 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
202 | .pwrsts = PWRSTS_OFF_RET_ON, | 202 | .pwrsts = PWRSTS_OFF_RET_ON, |
203 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 203 | .pwrsts_logic_ret = PWRSTS_RET, |
204 | }; | 204 | }; |
205 | 205 | ||
206 | static struct powerdomain usbhost_pwrdm = { | 206 | static struct powerdomain usbhost_pwrdm = { |
@@ -208,7 +208,7 @@ static struct powerdomain usbhost_pwrdm = { | |||
208 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, | 208 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, |
209 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 209 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
210 | .pwrsts = PWRSTS_OFF_RET_ON, | 210 | .pwrsts = PWRSTS_OFF_RET_ON, |
211 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 211 | .pwrsts_logic_ret = PWRSTS_RET, |
212 | /* | 212 | /* |
213 | * REVISIT: Enabling usb host save and restore mechanism seems to | 213 | * REVISIT: Enabling usb host save and restore mechanism seems to |
214 | * leave the usb host domain permanently in ACTIVE mode after | 214 | * leave the usb host domain permanently in ACTIVE mode after |
@@ -218,10 +218,10 @@ static struct powerdomain usbhost_pwrdm = { | |||
218 | /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ | 218 | /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ |
219 | .banks = 1, | 219 | .banks = 1, |
220 | .pwrsts_mem_ret = { | 220 | .pwrsts_mem_ret = { |
221 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 221 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
222 | }, | 222 | }, |
223 | .pwrsts_mem_on = { | 223 | .pwrsts_mem_on = { |
224 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 224 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
225 | }, | 225 | }, |
226 | }; | 226 | }; |
227 | 227 | ||
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c index 26d7641076d7..c4222c7036a5 100644 --- a/arch/arm/mach-omap2/powerdomains44xx_data.c +++ b/arch/arm/mach-omap2/powerdomains44xx_data.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP4 Power domains framework | 2 | * OMAP4 Power domains framework |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2009-2010 Nokia Corporation | 5 | * Copyright (C) 2009-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Abhijit Pagare (abhijitpagare@ti.com) | 7 | * Abhijit Pagare (abhijitpagare@ti.com) |
8 | * Benoit Cousson (b-cousson@ti.com) | 8 | * Benoit Cousson (b-cousson@ti.com) |
@@ -40,18 +40,18 @@ static struct powerdomain core_44xx_pwrdm = { | |||
40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
41 | .banks = 5, | 41 | .banks = 5, |
42 | .pwrsts_mem_ret = { | 42 | .pwrsts_mem_ret = { |
43 | [0] = PWRDM_POWER_OFF, /* core_nret_bank */ | 43 | [0] = PWRSTS_OFF, /* core_nret_bank */ |
44 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ | 44 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ |
45 | [2] = PWRDM_POWER_RET, /* core_other_bank */ | 45 | [2] = PWRSTS_RET, /* core_other_bank */ |
46 | [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ | 46 | [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ |
47 | [4] = PWRSTS_OFF_RET, /* ducati_unicache */ | 47 | [4] = PWRSTS_OFF_RET, /* ducati_unicache */ |
48 | }, | 48 | }, |
49 | .pwrsts_mem_on = { | 49 | .pwrsts_mem_on = { |
50 | [0] = PWRDM_POWER_ON, /* core_nret_bank */ | 50 | [0] = PWRSTS_ON, /* core_nret_bank */ |
51 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ | 51 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ |
52 | [2] = PWRDM_POWER_ON, /* core_other_bank */ | 52 | [2] = PWRSTS_ON, /* core_other_bank */ |
53 | [3] = PWRDM_POWER_ON, /* ducati_l2ram */ | 53 | [3] = PWRSTS_ON, /* ducati_l2ram */ |
54 | [4] = PWRDM_POWER_ON, /* ducati_unicache */ | 54 | [4] = PWRSTS_ON, /* ducati_unicache */ |
55 | }, | 55 | }, |
56 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 56 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
57 | }; | 57 | }; |
@@ -65,10 +65,10 @@ static struct powerdomain gfx_44xx_pwrdm = { | |||
65 | .pwrsts = PWRSTS_OFF_ON, | 65 | .pwrsts = PWRSTS_OFF_ON, |
66 | .banks = 1, | 66 | .banks = 1, |
67 | .pwrsts_mem_ret = { | 67 | .pwrsts_mem_ret = { |
68 | [0] = PWRDM_POWER_OFF, /* gfx_mem */ | 68 | [0] = PWRSTS_OFF, /* gfx_mem */ |
69 | }, | 69 | }, |
70 | .pwrsts_mem_on = { | 70 | .pwrsts_mem_on = { |
71 | [0] = PWRDM_POWER_ON, /* gfx_mem */ | 71 | [0] = PWRSTS_ON, /* gfx_mem */ |
72 | }, | 72 | }, |
73 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 73 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
74 | }; | 74 | }; |
@@ -80,15 +80,15 @@ static struct powerdomain abe_44xx_pwrdm = { | |||
80 | .prcm_partition = OMAP4430_PRM_PARTITION, | 80 | .prcm_partition = OMAP4430_PRM_PARTITION, |
81 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 81 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
82 | .pwrsts = PWRSTS_OFF_RET_ON, | 82 | .pwrsts = PWRSTS_OFF_RET_ON, |
83 | .pwrsts_logic_ret = PWRDM_POWER_OFF, | 83 | .pwrsts_logic_ret = PWRSTS_OFF, |
84 | .banks = 2, | 84 | .banks = 2, |
85 | .pwrsts_mem_ret = { | 85 | .pwrsts_mem_ret = { |
86 | [0] = PWRDM_POWER_RET, /* aessmem */ | 86 | [0] = PWRSTS_RET, /* aessmem */ |
87 | [1] = PWRDM_POWER_OFF, /* periphmem */ | 87 | [1] = PWRSTS_OFF, /* periphmem */ |
88 | }, | 88 | }, |
89 | .pwrsts_mem_on = { | 89 | .pwrsts_mem_on = { |
90 | [0] = PWRDM_POWER_ON, /* aessmem */ | 90 | [0] = PWRSTS_ON, /* aessmem */ |
91 | [1] = PWRDM_POWER_ON, /* periphmem */ | 91 | [1] = PWRSTS_ON, /* periphmem */ |
92 | }, | 92 | }, |
93 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 93 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
94 | }; | 94 | }; |
@@ -103,10 +103,10 @@ static struct powerdomain dss_44xx_pwrdm = { | |||
103 | .pwrsts_logic_ret = PWRSTS_OFF, | 103 | .pwrsts_logic_ret = PWRSTS_OFF, |
104 | .banks = 1, | 104 | .banks = 1, |
105 | .pwrsts_mem_ret = { | 105 | .pwrsts_mem_ret = { |
106 | [0] = PWRDM_POWER_OFF, /* dss_mem */ | 106 | [0] = PWRSTS_OFF, /* dss_mem */ |
107 | }, | 107 | }, |
108 | .pwrsts_mem_on = { | 108 | .pwrsts_mem_on = { |
109 | [0] = PWRDM_POWER_ON, /* dss_mem */ | 109 | [0] = PWRSTS_ON, /* dss_mem */ |
110 | }, | 110 | }, |
111 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 111 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
112 | }; | 112 | }; |
@@ -121,14 +121,14 @@ static struct powerdomain tesla_44xx_pwrdm = { | |||
121 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 121 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
122 | .banks = 3, | 122 | .banks = 3, |
123 | .pwrsts_mem_ret = { | 123 | .pwrsts_mem_ret = { |
124 | [0] = PWRDM_POWER_RET, /* tesla_edma */ | 124 | [0] = PWRSTS_RET, /* tesla_edma */ |
125 | [1] = PWRSTS_OFF_RET, /* tesla_l1 */ | 125 | [1] = PWRSTS_OFF_RET, /* tesla_l1 */ |
126 | [2] = PWRSTS_OFF_RET, /* tesla_l2 */ | 126 | [2] = PWRSTS_OFF_RET, /* tesla_l2 */ |
127 | }, | 127 | }, |
128 | .pwrsts_mem_on = { | 128 | .pwrsts_mem_on = { |
129 | [0] = PWRDM_POWER_ON, /* tesla_edma */ | 129 | [0] = PWRSTS_ON, /* tesla_edma */ |
130 | [1] = PWRDM_POWER_ON, /* tesla_l1 */ | 130 | [1] = PWRSTS_ON, /* tesla_l1 */ |
131 | [2] = PWRDM_POWER_ON, /* tesla_l2 */ | 131 | [2] = PWRSTS_ON, /* tesla_l2 */ |
132 | }, | 132 | }, |
133 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 133 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
134 | }; | 134 | }; |
@@ -142,10 +142,10 @@ static struct powerdomain wkup_44xx_pwrdm = { | |||
142 | .pwrsts = PWRSTS_ON, | 142 | .pwrsts = PWRSTS_ON, |
143 | .banks = 1, | 143 | .banks = 1, |
144 | .pwrsts_mem_ret = { | 144 | .pwrsts_mem_ret = { |
145 | [0] = PWRDM_POWER_OFF, /* wkup_bank */ | 145 | [0] = PWRSTS_OFF, /* wkup_bank */ |
146 | }, | 146 | }, |
147 | .pwrsts_mem_on = { | 147 | .pwrsts_mem_on = { |
148 | [0] = PWRDM_POWER_ON, /* wkup_bank */ | 148 | [0] = PWRSTS_ON, /* wkup_bank */ |
149 | }, | 149 | }, |
150 | }; | 150 | }; |
151 | 151 | ||
@@ -162,7 +162,7 @@ static struct powerdomain cpu0_44xx_pwrdm = { | |||
162 | [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ | 162 | [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ |
163 | }, | 163 | }, |
164 | .pwrsts_mem_on = { | 164 | .pwrsts_mem_on = { |
165 | [0] = PWRDM_POWER_ON, /* cpu0_l1 */ | 165 | [0] = PWRSTS_ON, /* cpu0_l1 */ |
166 | }, | 166 | }, |
167 | }; | 167 | }; |
168 | 168 | ||
@@ -179,7 +179,7 @@ static struct powerdomain cpu1_44xx_pwrdm = { | |||
179 | [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ | 179 | [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ |
180 | }, | 180 | }, |
181 | .pwrsts_mem_on = { | 181 | .pwrsts_mem_on = { |
182 | [0] = PWRDM_POWER_ON, /* cpu1_l1 */ | 182 | [0] = PWRSTS_ON, /* cpu1_l1 */ |
183 | }, | 183 | }, |
184 | }; | 184 | }; |
185 | 185 | ||
@@ -192,10 +192,10 @@ static struct powerdomain emu_44xx_pwrdm = { | |||
192 | .pwrsts = PWRSTS_OFF_ON, | 192 | .pwrsts = PWRSTS_OFF_ON, |
193 | .banks = 1, | 193 | .banks = 1, |
194 | .pwrsts_mem_ret = { | 194 | .pwrsts_mem_ret = { |
195 | [0] = PWRDM_POWER_OFF, /* emu_bank */ | 195 | [0] = PWRSTS_OFF, /* emu_bank */ |
196 | }, | 196 | }, |
197 | .pwrsts_mem_on = { | 197 | .pwrsts_mem_on = { |
198 | [0] = PWRDM_POWER_ON, /* emu_bank */ | 198 | [0] = PWRSTS_ON, /* emu_bank */ |
199 | }, | 199 | }, |
200 | }; | 200 | }; |
201 | 201 | ||
@@ -211,12 +211,12 @@ static struct powerdomain mpu_44xx_pwrdm = { | |||
211 | .pwrsts_mem_ret = { | 211 | .pwrsts_mem_ret = { |
212 | [0] = PWRSTS_OFF_RET, /* mpu_l1 */ | 212 | [0] = PWRSTS_OFF_RET, /* mpu_l1 */ |
213 | [1] = PWRSTS_OFF_RET, /* mpu_l2 */ | 213 | [1] = PWRSTS_OFF_RET, /* mpu_l2 */ |
214 | [2] = PWRDM_POWER_RET, /* mpu_ram */ | 214 | [2] = PWRSTS_RET, /* mpu_ram */ |
215 | }, | 215 | }, |
216 | .pwrsts_mem_on = { | 216 | .pwrsts_mem_on = { |
217 | [0] = PWRDM_POWER_ON, /* mpu_l1 */ | 217 | [0] = PWRSTS_ON, /* mpu_l1 */ |
218 | [1] = PWRDM_POWER_ON, /* mpu_l2 */ | 218 | [1] = PWRSTS_ON, /* mpu_l2 */ |
219 | [2] = PWRDM_POWER_ON, /* mpu_ram */ | 219 | [2] = PWRSTS_ON, /* mpu_ram */ |
220 | }, | 220 | }, |
221 | }; | 221 | }; |
222 | 222 | ||
@@ -227,19 +227,19 @@ static struct powerdomain ivahd_44xx_pwrdm = { | |||
227 | .prcm_partition = OMAP4430_PRM_PARTITION, | 227 | .prcm_partition = OMAP4430_PRM_PARTITION, |
228 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 228 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
229 | .pwrsts = PWRSTS_OFF_RET_ON, | 229 | .pwrsts = PWRSTS_OFF_RET_ON, |
230 | .pwrsts_logic_ret = PWRDM_POWER_OFF, | 230 | .pwrsts_logic_ret = PWRSTS_OFF, |
231 | .banks = 4, | 231 | .banks = 4, |
232 | .pwrsts_mem_ret = { | 232 | .pwrsts_mem_ret = { |
233 | [0] = PWRDM_POWER_OFF, /* hwa_mem */ | 233 | [0] = PWRSTS_OFF, /* hwa_mem */ |
234 | [1] = PWRSTS_OFF_RET, /* sl2_mem */ | 234 | [1] = PWRSTS_OFF_RET, /* sl2_mem */ |
235 | [2] = PWRSTS_OFF_RET, /* tcm1_mem */ | 235 | [2] = PWRSTS_OFF_RET, /* tcm1_mem */ |
236 | [3] = PWRSTS_OFF_RET, /* tcm2_mem */ | 236 | [3] = PWRSTS_OFF_RET, /* tcm2_mem */ |
237 | }, | 237 | }, |
238 | .pwrsts_mem_on = { | 238 | .pwrsts_mem_on = { |
239 | [0] = PWRDM_POWER_ON, /* hwa_mem */ | 239 | [0] = PWRSTS_ON, /* hwa_mem */ |
240 | [1] = PWRDM_POWER_ON, /* sl2_mem */ | 240 | [1] = PWRSTS_ON, /* sl2_mem */ |
241 | [2] = PWRDM_POWER_ON, /* tcm1_mem */ | 241 | [2] = PWRSTS_ON, /* tcm1_mem */ |
242 | [3] = PWRDM_POWER_ON, /* tcm2_mem */ | 242 | [3] = PWRSTS_ON, /* tcm2_mem */ |
243 | }, | 243 | }, |
244 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 244 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
245 | }; | 245 | }; |
@@ -253,10 +253,10 @@ static struct powerdomain cam_44xx_pwrdm = { | |||
253 | .pwrsts = PWRSTS_OFF_ON, | 253 | .pwrsts = PWRSTS_OFF_ON, |
254 | .banks = 1, | 254 | .banks = 1, |
255 | .pwrsts_mem_ret = { | 255 | .pwrsts_mem_ret = { |
256 | [0] = PWRDM_POWER_OFF, /* cam_mem */ | 256 | [0] = PWRSTS_OFF, /* cam_mem */ |
257 | }, | 257 | }, |
258 | .pwrsts_mem_on = { | 258 | .pwrsts_mem_on = { |
259 | [0] = PWRDM_POWER_ON, /* cam_mem */ | 259 | [0] = PWRSTS_ON, /* cam_mem */ |
260 | }, | 260 | }, |
261 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 261 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
262 | }; | 262 | }; |
@@ -271,10 +271,10 @@ static struct powerdomain l3init_44xx_pwrdm = { | |||
271 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 271 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
272 | .banks = 1, | 272 | .banks = 1, |
273 | .pwrsts_mem_ret = { | 273 | .pwrsts_mem_ret = { |
274 | [0] = PWRDM_POWER_OFF, /* l3init_bank1 */ | 274 | [0] = PWRSTS_OFF, /* l3init_bank1 */ |
275 | }, | 275 | }, |
276 | .pwrsts_mem_on = { | 276 | .pwrsts_mem_on = { |
277 | [0] = PWRDM_POWER_ON, /* l3init_bank1 */ | 277 | [0] = PWRSTS_ON, /* l3init_bank1 */ |
278 | }, | 278 | }, |
279 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 279 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
280 | }; | 280 | }; |
@@ -289,12 +289,12 @@ static struct powerdomain l4per_44xx_pwrdm = { | |||
289 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 289 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
290 | .banks = 2, | 290 | .banks = 2, |
291 | .pwrsts_mem_ret = { | 291 | .pwrsts_mem_ret = { |
292 | [0] = PWRDM_POWER_OFF, /* nonretained_bank */ | 292 | [0] = PWRSTS_OFF, /* nonretained_bank */ |
293 | [1] = PWRDM_POWER_RET, /* retained_bank */ | 293 | [1] = PWRSTS_RET, /* retained_bank */ |
294 | }, | 294 | }, |
295 | .pwrsts_mem_on = { | 295 | .pwrsts_mem_on = { |
296 | [0] = PWRDM_POWER_ON, /* nonretained_bank */ | 296 | [0] = PWRSTS_ON, /* nonretained_bank */ |
297 | [1] = PWRDM_POWER_ON, /* retained_bank */ | 297 | [1] = PWRSTS_ON, /* retained_bank */ |
298 | }, | 298 | }, |
299 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 299 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
300 | }; | 300 | }; |
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 87486f559784..0363dcb0ef93 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -121,6 +121,10 @@ | |||
121 | #define OMAP24XX_ST_MCSPI2_MASK (1 << 18) | 121 | #define OMAP24XX_ST_MCSPI2_MASK (1 << 18) |
122 | #define OMAP24XX_ST_MCSPI1_SHIFT 17 | 122 | #define OMAP24XX_ST_MCSPI1_SHIFT 17 |
123 | #define OMAP24XX_ST_MCSPI1_MASK (1 << 17) | 123 | #define OMAP24XX_ST_MCSPI1_MASK (1 << 17) |
124 | #define OMAP24XX_ST_MCBSP2_SHIFT 16 | ||
125 | #define OMAP24XX_ST_MCBSP2_MASK (1 << 16) | ||
126 | #define OMAP24XX_ST_MCBSP1_SHIFT 15 | ||
127 | #define OMAP24XX_ST_MCBSP1_MASK (1 << 15) | ||
124 | #define OMAP24XX_ST_GPT12_SHIFT 14 | 128 | #define OMAP24XX_ST_GPT12_SHIFT 14 |
125 | #define OMAP24XX_ST_GPT12_MASK (1 << 14) | 129 | #define OMAP24XX_ST_GPT12_MASK (1 << 14) |
126 | #define OMAP24XX_ST_GPT11_SHIFT 13 | 130 | #define OMAP24XX_ST_GPT11_SHIFT 13 |
@@ -191,6 +195,8 @@ | |||
191 | #define OMAP3430_AUTOIDLE_MASK (1 << 0) | 195 | #define OMAP3430_AUTOIDLE_MASK (1 << 0) |
192 | 196 | ||
193 | /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ | 197 | /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ |
198 | #define OMAP3430_EN_MMC3_MASK (1 << 30) | ||
199 | #define OMAP3430_EN_MMC3_SHIFT 30 | ||
194 | #define OMAP3430_EN_MMC2_MASK (1 << 25) | 200 | #define OMAP3430_EN_MMC2_MASK (1 << 25) |
195 | #define OMAP3430_EN_MMC2_SHIFT 25 | 201 | #define OMAP3430_EN_MMC2_SHIFT 25 |
196 | #define OMAP3430_EN_MMC1_MASK (1 << 24) | 202 | #define OMAP3430_EN_MMC1_MASK (1 << 24) |
@@ -231,6 +237,8 @@ | |||
231 | #define OMAP3430_EN_HSOTGUSB_SHIFT 4 | 237 | #define OMAP3430_EN_HSOTGUSB_SHIFT 4 |
232 | 238 | ||
233 | /* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ | 239 | /* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ |
240 | #define OMAP3430_ST_MMC3_SHIFT 30 | ||
241 | #define OMAP3430_ST_MMC3_MASK (1 << 30) | ||
234 | #define OMAP3430_ST_MMC2_SHIFT 25 | 242 | #define OMAP3430_ST_MMC2_SHIFT 25 |
235 | #define OMAP3430_ST_MMC2_MASK (1 << 25) | 243 | #define OMAP3430_ST_MMC2_MASK (1 << 25) |
236 | #define OMAP3430_ST_MMC1_SHIFT 24 | 244 | #define OMAP3430_ST_MMC1_SHIFT 24 |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 679bcd28576e..6be14389e4f3 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | 26 | ||
27 | #include <mach/system.h> | ||
27 | #include <plat/common.h> | 28 | #include <plat/common.h> |
28 | #include <plat/prcm.h> | 29 | #include <plat/prcm.h> |
29 | #include <plat/irqs.h> | 30 | #include <plat/irqs.h> |
@@ -57,7 +58,7 @@ u32 omap_prcm_get_reset_sources(void) | |||
57 | EXPORT_SYMBOL(omap_prcm_get_reset_sources); | 58 | EXPORT_SYMBOL(omap_prcm_get_reset_sources); |
58 | 59 | ||
59 | /* Resets clock rates and reboots the system. Only called from system.h */ | 60 | /* Resets clock rates and reboots the system. Only called from system.h */ |
60 | void omap_prcm_arch_reset(char mode, const char *cmd) | 61 | static void omap_prcm_arch_reset(char mode, const char *cmd) |
61 | { | 62 | { |
62 | s16 prcm_offs = 0; | 63 | s16 prcm_offs = 0; |
63 | 64 | ||
@@ -108,6 +109,8 @@ void omap_prcm_arch_reset(char mode, const char *cmd) | |||
108 | omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */ | 109 | omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */ |
109 | } | 110 | } |
110 | 111 | ||
112 | void (*arch_reset)(char, const char *) = omap_prcm_arch_reset; | ||
113 | |||
111 | /** | 114 | /** |
112 | * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness | 115 | * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness |
113 | * @reg: physical address of module IDLEST register | 116 | * @reg: physical address of module IDLEST register |
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h index 3300ff6e3cfe..d22d1b43bccd 100644 --- a/arch/arm/mach-omap2/prcm_mpu44xx.h +++ b/arch/arm/mach-omap2/prcm_mpu44xx.h | |||
@@ -38,8 +38,8 @@ | |||
38 | #define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 | 38 | #define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 |
39 | 39 | ||
40 | /* PRCM_MPU clockdomain register offsets (from instance start) */ | 40 | /* PRCM_MPU clockdomain register offsets (from instance start) */ |
41 | #define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0018 | 41 | #define OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS 0x0018 |
42 | #define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0018 | 42 | #define OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS 0x0018 |
43 | 43 | ||
44 | 44 | ||
45 | /* | 45 | /* |
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index ec0362574b5e..051213fbc346 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -118,7 +118,8 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | |||
118 | /** | 118 | /** |
119 | * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait | 119 | * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait |
120 | * @prm_mod: PRM submodule base (e.g. CORE_MOD) | 120 | * @prm_mod: PRM submodule base (e.g. CORE_MOD) |
121 | * @shift: register bit shift corresponding to the reset line to deassert | 121 | * @rst_shift: register bit shift corresponding to the reset line to deassert |
122 | * @st_shift: register bit shift for the status of the deasserted submodule | ||
122 | * | 123 | * |
123 | * Some IPs like dsp or iva contain processors that require an HW | 124 | * Some IPs like dsp or iva contain processors that require an HW |
124 | * reset line to be asserted / deasserted in order to fully enable the | 125 | * reset line to be asserted / deasserted in order to fully enable the |
@@ -129,27 +130,28 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | |||
129 | * -EINVAL upon an argument error, -EEXIST if the submodule was already out | 130 | * -EINVAL upon an argument error, -EEXIST if the submodule was already out |
130 | * of reset, or -EBUSY if the submodule did not exit reset promptly. | 131 | * of reset, or -EBUSY if the submodule did not exit reset promptly. |
131 | */ | 132 | */ |
132 | int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift) | 133 | int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift) |
133 | { | 134 | { |
134 | u32 mask; | 135 | u32 rst, st; |
135 | int c; | 136 | int c; |
136 | 137 | ||
137 | if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) | 138 | if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) |
138 | return -EINVAL; | 139 | return -EINVAL; |
139 | 140 | ||
140 | mask = 1 << shift; | 141 | rst = 1 << rst_shift; |
142 | st = 1 << st_shift; | ||
141 | 143 | ||
142 | /* Check the current status to avoid de-asserting the line twice */ | 144 | /* Check the current status to avoid de-asserting the line twice */ |
143 | if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0) | 145 | if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, rst) == 0) |
144 | return -EEXIST; | 146 | return -EEXIST; |
145 | 147 | ||
146 | /* Clear the reset status by writing 1 to the status bit */ | 148 | /* Clear the reset status by writing 1 to the status bit */ |
147 | omap2_prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST); | 149 | omap2_prm_rmw_mod_reg_bits(0xffffffff, st, prm_mod, OMAP2_RM_RSTST); |
148 | /* de-assert the reset control line */ | 150 | /* de-assert the reset control line */ |
149 | omap2_prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL); | 151 | omap2_prm_rmw_mod_reg_bits(rst, 0, prm_mod, OMAP2_RM_RSTCTRL); |
150 | /* wait the status to be set */ | 152 | /* wait the status to be set */ |
151 | omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, | 153 | omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, |
152 | mask), | 154 | st), |
153 | MAX_MODULE_HARDRESET_WAIT, c); | 155 | MAX_MODULE_HARDRESET_WAIT, c); |
154 | 156 | ||
155 | return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; | 157 | return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; |
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h index 49654c8d18f5..a1fc62a39dbb 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h | |||
@@ -282,7 +282,8 @@ static inline int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | |||
282 | "not suppose to be used on omap4\n"); | 282 | "not suppose to be used on omap4\n"); |
283 | return 0; | 283 | return 0; |
284 | } | 284 | } |
285 | static inline int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift) | 285 | static inline int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, |
286 | u8 st_shift) | ||
286 | { | 287 | { |
287 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | 288 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " |
288 | "not suppose to be used on omap4\n"); | 289 | "not suppose to be used on omap4\n"); |
@@ -300,7 +301,7 @@ extern u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask); | |||
300 | /* These omap2_ PRM functions apply to both OMAP2 and 3 */ | 301 | /* These omap2_ PRM functions apply to both OMAP2 and 3 */ |
301 | extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); | 302 | extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); |
302 | extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); | 303 | extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); |
303 | extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift); | 304 | extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift); |
304 | 305 | ||
305 | #endif /* CONFIG_ARCH_OMAP4 */ | 306 | #endif /* CONFIG_ARCH_OMAP4 */ |
306 | #endif | 307 | #endif |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 32e91a9c8b6b..1ac361b7b8cb 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -486,7 +486,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart) | |||
486 | mod_timer(&uart->timer, jiffies + uart->timeout); | 486 | mod_timer(&uart->timer, jiffies + uart->timeout); |
487 | omap_uart_smart_idle_enable(uart, 0); | 487 | omap_uart_smart_idle_enable(uart, 0); |
488 | 488 | ||
489 | if (cpu_is_omap34xx()) { | 489 | if (cpu_is_omap34xx() && !cpu_is_ti816x()) { |
490 | u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; | 490 | u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; |
491 | u32 wk_mask = 0; | 491 | u32 wk_mask = 0; |
492 | u32 padconf = 0; | 492 | u32 padconf = 0; |
@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value) | |||
655 | } | 655 | } |
656 | #endif | 656 | #endif |
657 | 657 | ||
658 | void __init omap_serial_early_init(void) | 658 | static int __init omap_serial_early_init(void) |
659 | { | 659 | { |
660 | int i = 0; | 660 | int i = 0; |
661 | 661 | ||
@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void) | |||
672 | 672 | ||
673 | uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); | 673 | uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); |
674 | if (WARN_ON(!uart)) | 674 | if (WARN_ON(!uart)) |
675 | return; | 675 | return -ENODEV; |
676 | 676 | ||
677 | uart->oh = oh; | 677 | uart->oh = oh; |
678 | uart->num = i++; | 678 | uart->num = i++; |
@@ -680,7 +680,7 @@ void __init omap_serial_early_init(void) | |||
680 | num_uarts++; | 680 | num_uarts++; |
681 | 681 | ||
682 | /* | 682 | /* |
683 | * NOTE: omap_hwmod_init() has not yet been called, | 683 | * NOTE: omap_hwmod_setup*() has not yet been called, |
684 | * so no hwmod functions will work yet. | 684 | * so no hwmod functions will work yet. |
685 | */ | 685 | */ |
686 | 686 | ||
@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void) | |||
691 | */ | 691 | */ |
692 | uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; | 692 | uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; |
693 | } while (1); | 693 | } while (1); |
694 | |||
695 | return 0; | ||
694 | } | 696 | } |
697 | core_initcall(omap_serial_early_init); | ||
695 | 698 | ||
696 | /** | 699 | /** |
697 | * omap_serial_init_port() - initialize single serial port | 700 | * omap_serial_init_port() - initialize single serial port |
@@ -759,13 +762,13 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
759 | p->private_data = uart; | 762 | p->private_data = uart; |
760 | 763 | ||
761 | /* | 764 | /* |
762 | * omap44xx: Never read empty UART fifo | 765 | * omap44xx, ti816x: Never read empty UART fifo |
763 | * omap3xxx: Never read empty UART fifo on UARTs | 766 | * omap3xxx: Never read empty UART fifo on UARTs |
764 | * with IP rev >=0x52 | 767 | * with IP rev >=0x52 |
765 | */ | 768 | */ |
766 | uart->regshift = p->regshift; | 769 | uart->regshift = p->regshift; |
767 | uart->membase = p->membase; | 770 | uart->membase = p->membase; |
768 | if (cpu_is_omap44xx()) | 771 | if (cpu_is_omap44xx() || cpu_is_ti816x()) |
769 | uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; | 772 | uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; |
770 | else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF) | 773 | else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF) |
771 | >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) | 774 | >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) |
@@ -847,7 +850,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
847 | } | 850 | } |
848 | 851 | ||
849 | /* Enable the MDR1 errata for OMAP3 */ | 852 | /* Enable the MDR1 errata for OMAP3 */ |
850 | if (cpu_is_omap34xx()) | 853 | if (cpu_is_omap34xx() && !cpu_is_ti816x()) |
851 | uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; | 854 | uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; |
852 | } | 855 | } |
853 | 856 | ||
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 951a0be66cf7..63f10669571a 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -64,6 +64,11 @@ | |||
64 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) | 64 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) |
65 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) | 65 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) |
66 | 66 | ||
67 | /* | ||
68 | * This file needs be built unconditionally as ARM to interoperate correctly | ||
69 | * with non-Thumb-2-capable firmware. | ||
70 | */ | ||
71 | .arm | ||
67 | 72 | ||
68 | /* | 73 | /* |
69 | * API functions | 74 | * API functions |
@@ -82,6 +87,8 @@ ENTRY(get_restore_pointer) | |||
82 | stmfd sp!, {lr} @ save registers on stack | 87 | stmfd sp!, {lr} @ save registers on stack |
83 | adr r0, restore | 88 | adr r0, restore |
84 | ldmfd sp!, {pc} @ restore regs and return | 89 | ldmfd sp!, {pc} @ restore regs and return |
90 | ENDPROC(get_restore_pointer) | ||
91 | .align | ||
85 | ENTRY(get_restore_pointer_sz) | 92 | ENTRY(get_restore_pointer_sz) |
86 | .word . - get_restore_pointer | 93 | .word . - get_restore_pointer |
87 | 94 | ||
@@ -91,6 +98,8 @@ ENTRY(get_omap3630_restore_pointer) | |||
91 | stmfd sp!, {lr} @ save registers on stack | 98 | stmfd sp!, {lr} @ save registers on stack |
92 | adr r0, restore_3630 | 99 | adr r0, restore_3630 |
93 | ldmfd sp!, {pc} @ restore regs and return | 100 | ldmfd sp!, {pc} @ restore regs and return |
101 | ENDPROC(get_omap3630_restore_pointer) | ||
102 | .align | ||
94 | ENTRY(get_omap3630_restore_pointer_sz) | 103 | ENTRY(get_omap3630_restore_pointer_sz) |
95 | .word . - get_omap3630_restore_pointer | 104 | .word . - get_omap3630_restore_pointer |
96 | 105 | ||
@@ -100,6 +109,8 @@ ENTRY(get_es3_restore_pointer) | |||
100 | stmfd sp!, {lr} @ save registers on stack | 109 | stmfd sp!, {lr} @ save registers on stack |
101 | adr r0, restore_es3 | 110 | adr r0, restore_es3 |
102 | ldmfd sp!, {pc} @ restore regs and return | 111 | ldmfd sp!, {pc} @ restore regs and return |
112 | ENDPROC(get_es3_restore_pointer) | ||
113 | .align | ||
103 | ENTRY(get_es3_restore_pointer_sz) | 114 | ENTRY(get_es3_restore_pointer_sz) |
104 | .word . - get_es3_restore_pointer | 115 | .word . - get_es3_restore_pointer |
105 | 116 | ||
@@ -113,8 +124,10 @@ ENTRY(enable_omap3630_toggle_l2_on_restore) | |||
113 | stmfd sp!, {lr} @ save registers on stack | 124 | stmfd sp!, {lr} @ save registers on stack |
114 | /* Setup so that we will disable and enable l2 */ | 125 | /* Setup so that we will disable and enable l2 */ |
115 | mov r1, #0x1 | 126 | mov r1, #0x1 |
116 | str r1, l2dis_3630 | 127 | adrl r2, l2dis_3630 @ may be too distant for plain adr |
128 | str r1, [r2] | ||
117 | ldmfd sp!, {pc} @ restore regs and return | 129 | ldmfd sp!, {pc} @ restore regs and return |
130 | ENDPROC(enable_omap3630_toggle_l2_on_restore) | ||
118 | 131 | ||
119 | .text | 132 | .text |
120 | /* Function to call rom code to save secure ram context */ | 133 | /* Function to call rom code to save secure ram context */ |
@@ -132,20 +145,22 @@ ENTRY(save_secure_ram_context) | |||
132 | mov r1, #0 @ set task id for ROM code in r1 | 145 | mov r1, #0 @ set task id for ROM code in r1 |
133 | mov r2, #4 @ set some flags in r2, r6 | 146 | mov r2, #4 @ set some flags in r2, r6 |
134 | mov r6, #0xff | 147 | mov r6, #0xff |
135 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 148 | dsb @ data write barrier |
136 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | 149 | dmb @ data memory barrier |
137 | .word 0xE1600071 @ call SMI monitor (smi #1) | 150 | smc #1 @ call SMI monitor (smi #1) |
138 | nop | 151 | nop |
139 | nop | 152 | nop |
140 | nop | 153 | nop |
141 | nop | 154 | nop |
142 | ldmfd sp!, {r1-r12, pc} | 155 | ldmfd sp!, {r1-r12, pc} |
156 | .align | ||
143 | sram_phy_addr_mask: | 157 | sram_phy_addr_mask: |
144 | .word SRAM_BASE_P | 158 | .word SRAM_BASE_P |
145 | high_mask: | 159 | high_mask: |
146 | .word 0xffff | 160 | .word 0xffff |
147 | api_params: | 161 | api_params: |
148 | .word 0x4, 0x0, 0x0, 0x1, 0x1 | 162 | .word 0x4, 0x0, 0x0, 0x1, 0x1 |
163 | ENDPROC(save_secure_ram_context) | ||
149 | ENTRY(save_secure_ram_context_sz) | 164 | ENTRY(save_secure_ram_context_sz) |
150 | .word . - save_secure_ram_context | 165 | .word . - save_secure_ram_context |
151 | 166 | ||
@@ -175,12 +190,12 @@ ENTRY(omap34xx_cpu_suspend) | |||
175 | stmfd sp!, {r0-r12, lr} @ save registers on stack | 190 | stmfd sp!, {r0-r12, lr} @ save registers on stack |
176 | 191 | ||
177 | /* | 192 | /* |
178 | * r0 contains restore pointer in sdram | 193 | * r0 contains CPU context save/restore pointer in sdram |
179 | * r1 contains information about saving context: | 194 | * r1 contains information about saving context: |
180 | * 0 - No context lost | 195 | * 0 - No context lost |
181 | * 1 - Only L1 and logic lost | 196 | * 1 - Only L1 and logic lost |
182 | * 2 - Only L2 lost | 197 | * 2 - Only L2 lost (Even L1 is retained we clean it along with L2) |
183 | * 3 - Both L1 and L2 lost | 198 | * 3 - Both L1 and L2 lost and logic lost |
184 | */ | 199 | */ |
185 | 200 | ||
186 | /* Directly jump to WFI is the context save is not required */ | 201 | /* Directly jump to WFI is the context save is not required */ |
@@ -201,89 +216,74 @@ save_context_wfi: | |||
201 | beq clean_caches | 216 | beq clean_caches |
202 | 217 | ||
203 | l1_logic_lost: | 218 | l1_logic_lost: |
204 | /* Store sp and spsr to SDRAM */ | 219 | mov r4, sp @ Store sp |
205 | mov r4, sp | 220 | mrs r5, spsr @ Store spsr |
206 | mrs r5, spsr | 221 | mov r6, lr @ Store lr |
207 | mov r6, lr | ||
208 | stmia r8!, {r4-r6} | 222 | stmia r8!, {r4-r6} |
209 | /* Save all ARM registers */ | 223 | |
210 | /* Coprocessor access control register */ | 224 | mrc p15, 0, r4, c1, c0, 2 @ Coprocessor access control register |
211 | mrc p15, 0, r6, c1, c0, 2 | 225 | mrc p15, 0, r5, c2, c0, 0 @ TTBR0 |
212 | stmia r8!, {r6} | 226 | mrc p15, 0, r6, c2, c0, 1 @ TTBR1 |
213 | /* TTBR0, TTBR1 and Translation table base control */ | 227 | mrc p15, 0, r7, c2, c0, 2 @ TTBCR |
214 | mrc p15, 0, r4, c2, c0, 0 | ||
215 | mrc p15, 0, r5, c2, c0, 1 | ||
216 | mrc p15, 0, r6, c2, c0, 2 | ||
217 | stmia r8!, {r4-r6} | ||
218 | /* | ||
219 | * Domain access control register, data fault status register, | ||
220 | * and instruction fault status register | ||
221 | */ | ||
222 | mrc p15, 0, r4, c3, c0, 0 | ||
223 | mrc p15, 0, r5, c5, c0, 0 | ||
224 | mrc p15, 0, r6, c5, c0, 1 | ||
225 | stmia r8!, {r4-r6} | ||
226 | /* | ||
227 | * Data aux fault status register, instruction aux fault status, | ||
228 | * data fault address register and instruction fault address register | ||
229 | */ | ||
230 | mrc p15, 0, r4, c5, c1, 0 | ||
231 | mrc p15, 0, r5, c5, c1, 1 | ||
232 | mrc p15, 0, r6, c6, c0, 0 | ||
233 | mrc p15, 0, r7, c6, c0, 2 | ||
234 | stmia r8!, {r4-r7} | ||
235 | /* | ||
236 | * user r/w thread and process ID, user r/o thread and process ID, | ||
237 | * priv only thread and process ID, cache size selection | ||
238 | */ | ||
239 | mrc p15, 0, r4, c13, c0, 2 | ||
240 | mrc p15, 0, r5, c13, c0, 3 | ||
241 | mrc p15, 0, r6, c13, c0, 4 | ||
242 | mrc p15, 2, r7, c0, c0, 0 | ||
243 | stmia r8!, {r4-r7} | 228 | stmia r8!, {r4-r7} |
244 | /* Data TLB lockdown, instruction TLB lockdown registers */ | ||
245 | mrc p15, 0, r5, c10, c0, 0 | ||
246 | mrc p15, 0, r6, c10, c0, 1 | ||
247 | stmia r8!, {r5-r6} | ||
248 | /* Secure or non secure vector base address, FCSE PID, Context PID*/ | ||
249 | mrc p15, 0, r4, c12, c0, 0 | ||
250 | mrc p15, 0, r5, c13, c0, 0 | ||
251 | mrc p15, 0, r6, c13, c0, 1 | ||
252 | stmia r8!, {r4-r6} | ||
253 | /* Primary remap, normal remap registers */ | ||
254 | mrc p15, 0, r4, c10, c2, 0 | ||
255 | mrc p15, 0, r5, c10, c2, 1 | ||
256 | stmia r8!,{r4-r5} | ||
257 | 229 | ||
258 | /* Store current cpsr*/ | 230 | mrc p15, 0, r4, c3, c0, 0 @ Domain access Control Register |
259 | mrs r2, cpsr | 231 | mrc p15, 0, r5, c10, c2, 0 @ PRRR |
260 | stmia r8!, {r2} | 232 | mrc p15, 0, r6, c10, c2, 1 @ NMRR |
233 | stmia r8!,{r4-r6} | ||
261 | 234 | ||
262 | mrc p15, 0, r4, c1, c0, 0 | 235 | mrc p15, 0, r4, c13, c0, 1 @ Context ID |
263 | /* save control register */ | 236 | mrc p15, 0, r5, c13, c0, 2 @ User r/w thread and process ID |
237 | mrc p15, 0, r6, c12, c0, 0 @ Secure or NS vector base address | ||
238 | mrs r7, cpsr @ Store current cpsr | ||
239 | stmia r8!, {r4-r7} | ||
240 | |||
241 | mrc p15, 0, r4, c1, c0, 0 @ save control register | ||
264 | stmia r8!, {r4} | 242 | stmia r8!, {r4} |
265 | 243 | ||
266 | clean_caches: | 244 | clean_caches: |
267 | /* | 245 | /* |
268 | * Clean Data or unified cache to POU | ||
269 | * How to invalidate only L1 cache???? - #FIX_ME# | ||
270 | * mcr p15, 0, r11, c7, c11, 1 | ||
271 | */ | ||
272 | cmp r1, #0x1 @ Check whether L2 inval is required | ||
273 | beq omap3_do_wfi | ||
274 | |||
275 | clean_l2: | ||
276 | /* | ||
277 | * jump out to kernel flush routine | 246 | * jump out to kernel flush routine |
278 | * - reuse that code is better | 247 | * - reuse that code is better |
279 | * - it executes in a cached space so is faster than refetch per-block | 248 | * - it executes in a cached space so is faster than refetch per-block |
280 | * - should be faster and will change with kernel | 249 | * - should be faster and will change with kernel |
281 | * - 'might' have to copy address, load and jump to it | 250 | * - 'might' have to copy address, load and jump to it |
251 | * Flush all data from the L1 data cache before disabling | ||
252 | * SCTLR.C bit. | ||
282 | */ | 253 | */ |
283 | ldr r1, kernel_flush | 254 | ldr r1, kernel_flush |
284 | mov lr, pc | 255 | mov lr, pc |
285 | bx r1 | 256 | bx r1 |
286 | 257 | ||
258 | /* | ||
259 | * Clear the SCTLR.C bit to prevent further data cache | ||
260 | * allocation. Clearing SCTLR.C would make all the data accesses | ||
261 | * strongly ordered and would not hit the cache. | ||
262 | */ | ||
263 | mrc p15, 0, r0, c1, c0, 0 | ||
264 | bic r0, r0, #(1 << 2) @ Disable the C bit | ||
265 | mcr p15, 0, r0, c1, c0, 0 | ||
266 | isb | ||
267 | |||
268 | /* | ||
269 | * Invalidate L1 data cache. Even though only invalidate is | ||
270 | * necessary exported flush API is used here. Doing clean | ||
271 | * on already clean cache would be almost NOP. | ||
272 | */ | ||
273 | ldr r1, kernel_flush | ||
274 | blx r1 | ||
275 | /* | ||
276 | * The kernel doesn't interwork: v7_flush_dcache_all in particluar will | ||
277 | * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled. | ||
278 | * This sequence switches back to ARM. Note that .align may insert a | ||
279 | * nop: bx pc needs to be word-aligned in order to work. | ||
280 | */ | ||
281 | THUMB( .thumb ) | ||
282 | THUMB( .align ) | ||
283 | THUMB( bx pc ) | ||
284 | THUMB( nop ) | ||
285 | .arm | ||
286 | |||
287 | omap3_do_wfi: | 287 | omap3_do_wfi: |
288 | ldr r4, sdrc_power @ read the SDRC_POWER register | 288 | ldr r4, sdrc_power @ read the SDRC_POWER register |
289 | ldr r5, [r4] @ read the contents of SDRC_POWER | 289 | ldr r5, [r4] @ read the contents of SDRC_POWER |
@@ -291,9 +291,8 @@ omap3_do_wfi: | |||
291 | str r5, [r4] @ write back to SDRC_POWER register | 291 | str r5, [r4] @ write back to SDRC_POWER register |
292 | 292 | ||
293 | /* Data memory barrier and Data sync barrier */ | 293 | /* Data memory barrier and Data sync barrier */ |
294 | mov r1, #0 | 294 | dsb |
295 | mcr p15, 0, r1, c7, c10, 4 | 295 | dmb |
296 | mcr p15, 0, r1, c7, c10, 5 | ||
297 | 296 | ||
298 | /* | 297 | /* |
299 | * =================================== | 298 | * =================================== |
@@ -319,6 +318,12 @@ omap3_do_wfi: | |||
319 | nop | 318 | nop |
320 | bl wait_sdrc_ok | 319 | bl wait_sdrc_ok |
321 | 320 | ||
321 | mrc p15, 0, r0, c1, c0, 0 | ||
322 | tst r0, #(1 << 2) @ Check C bit enabled? | ||
323 | orreq r0, r0, #(1 << 2) @ Enable the C bit if cleared | ||
324 | mcreq p15, 0, r0, c1, c0, 0 | ||
325 | isb | ||
326 | |||
322 | /* | 327 | /* |
323 | * =================================== | 328 | * =================================== |
324 | * == Exit point from non-OFF modes == | 329 | * == Exit point from non-OFF modes == |
@@ -408,9 +413,9 @@ skipl2dis: | |||
408 | mov r2, #4 @ set some flags in r2, r6 | 413 | mov r2, #4 @ set some flags in r2, r6 |
409 | mov r6, #0xff | 414 | mov r6, #0xff |
410 | adr r3, l2_inv_api_params @ r3 points to dummy parameters | 415 | adr r3, l2_inv_api_params @ r3 points to dummy parameters |
411 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 416 | dsb @ data write barrier |
412 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | 417 | dmb @ data memory barrier |
413 | .word 0xE1600071 @ call SMI monitor (smi #1) | 418 | smc #1 @ call SMI monitor (smi #1) |
414 | /* Write to Aux control register to set some bits */ | 419 | /* Write to Aux control register to set some bits */ |
415 | mov r0, #42 @ set service ID for PPA | 420 | mov r0, #42 @ set service ID for PPA |
416 | mov r12, r0 @ copy secure Service ID in r12 | 421 | mov r12, r0 @ copy secure Service ID in r12 |
@@ -419,9 +424,9 @@ skipl2dis: | |||
419 | mov r6, #0xff | 424 | mov r6, #0xff |
420 | ldr r4, scratchpad_base | 425 | ldr r4, scratchpad_base |
421 | ldr r3, [r4, #0xBC] @ r3 points to parameters | 426 | ldr r3, [r4, #0xBC] @ r3 points to parameters |
422 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 427 | dsb @ data write barrier |
423 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | 428 | dmb @ data memory barrier |
424 | .word 0xE1600071 @ call SMI monitor (smi #1) | 429 | smc #1 @ call SMI monitor (smi #1) |
425 | 430 | ||
426 | #ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE | 431 | #ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE |
427 | /* Restore L2 aux control register */ | 432 | /* Restore L2 aux control register */ |
@@ -434,29 +439,30 @@ skipl2dis: | |||
434 | ldr r4, scratchpad_base | 439 | ldr r4, scratchpad_base |
435 | ldr r3, [r4, #0xBC] | 440 | ldr r3, [r4, #0xBC] |
436 | adds r3, r3, #8 @ r3 points to parameters | 441 | adds r3, r3, #8 @ r3 points to parameters |
437 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 442 | dsb @ data write barrier |
438 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | 443 | dmb @ data memory barrier |
439 | .word 0xE1600071 @ call SMI monitor (smi #1) | 444 | smc #1 @ call SMI monitor (smi #1) |
440 | #endif | 445 | #endif |
441 | b logic_l1_restore | 446 | b logic_l1_restore |
442 | 447 | ||
448 | .align | ||
443 | l2_inv_api_params: | 449 | l2_inv_api_params: |
444 | .word 0x1, 0x00 | 450 | .word 0x1, 0x00 |
445 | l2_inv_gp: | 451 | l2_inv_gp: |
446 | /* Execute smi to invalidate L2 cache */ | 452 | /* Execute smi to invalidate L2 cache */ |
447 | mov r12, #0x1 @ set up to invalidate L2 | 453 | mov r12, #0x1 @ set up to invalidate L2 |
448 | .word 0xE1600070 @ Call SMI monitor (smieq) | 454 | smc #0 @ Call SMI monitor (smieq) |
449 | /* Write to Aux control register to set some bits */ | 455 | /* Write to Aux control register to set some bits */ |
450 | ldr r4, scratchpad_base | 456 | ldr r4, scratchpad_base |
451 | ldr r3, [r4,#0xBC] | 457 | ldr r3, [r4,#0xBC] |
452 | ldr r0, [r3,#4] | 458 | ldr r0, [r3,#4] |
453 | mov r12, #0x3 | 459 | mov r12, #0x3 |
454 | .word 0xE1600070 @ Call SMI monitor (smieq) | 460 | smc #0 @ Call SMI monitor (smieq) |
455 | ldr r4, scratchpad_base | 461 | ldr r4, scratchpad_base |
456 | ldr r3, [r4,#0xBC] | 462 | ldr r3, [r4,#0xBC] |
457 | ldr r0, [r3,#12] | 463 | ldr r0, [r3,#12] |
458 | mov r12, #0x2 | 464 | mov r12, #0x2 |
459 | .word 0xE1600070 @ Call SMI monitor (smieq) | 465 | smc #0 @ Call SMI monitor (smieq) |
460 | logic_l1_restore: | 466 | logic_l1_restore: |
461 | ldr r1, l2dis_3630 | 467 | ldr r1, l2dis_3630 |
462 | cmp r1, #0x1 @ Test if L2 re-enable needed on 3630 | 468 | cmp r1, #0x1 @ Test if L2 re-enable needed on 3630 |
@@ -475,68 +481,29 @@ skipl2reen: | |||
475 | ldr r4, scratchpad_base | 481 | ldr r4, scratchpad_base |
476 | ldr r3, [r4,#0xBC] | 482 | ldr r3, [r4,#0xBC] |
477 | adds r3, r3, #16 | 483 | adds r3, r3, #16 |
484 | |||
478 | ldmia r3!, {r4-r6} | 485 | ldmia r3!, {r4-r6} |
479 | mov sp, r4 | 486 | mov sp, r4 @ Restore sp |
480 | msr spsr_cxsf, r5 | 487 | msr spsr_cxsf, r5 @ Restore spsr |
481 | mov lr, r6 | 488 | mov lr, r6 @ Restore lr |
482 | 489 | ||
483 | ldmia r3!, {r4-r9} | 490 | ldmia r3!, {r4-r7} |
484 | /* Coprocessor access Control Register */ | 491 | mcr p15, 0, r4, c1, c0, 2 @ Coprocessor access Control Register |
485 | mcr p15, 0, r4, c1, c0, 2 | 492 | mcr p15, 0, r5, c2, c0, 0 @ TTBR0 |
486 | 493 | mcr p15, 0, r6, c2, c0, 1 @ TTBR1 | |
487 | /* TTBR0 */ | 494 | mcr p15, 0, r7, c2, c0, 2 @ TTBCR |
488 | MCR p15, 0, r5, c2, c0, 0 | ||
489 | /* TTBR1 */ | ||
490 | MCR p15, 0, r6, c2, c0, 1 | ||
491 | /* Translation table base control register */ | ||
492 | MCR p15, 0, r7, c2, c0, 2 | ||
493 | /* Domain access Control Register */ | ||
494 | MCR p15, 0, r8, c3, c0, 0 | ||
495 | /* Data fault status Register */ | ||
496 | MCR p15, 0, r9, c5, c0, 0 | ||
497 | |||
498 | ldmia r3!,{r4-r8} | ||
499 | /* Instruction fault status Register */ | ||
500 | MCR p15, 0, r4, c5, c0, 1 | ||
501 | /* Data Auxiliary Fault Status Register */ | ||
502 | MCR p15, 0, r5, c5, c1, 0 | ||
503 | /* Instruction Auxiliary Fault Status Register*/ | ||
504 | MCR p15, 0, r6, c5, c1, 1 | ||
505 | /* Data Fault Address Register */ | ||
506 | MCR p15, 0, r7, c6, c0, 0 | ||
507 | /* Instruction Fault Address Register*/ | ||
508 | MCR p15, 0, r8, c6, c0, 2 | ||
509 | ldmia r3!,{r4-r7} | ||
510 | 495 | ||
511 | /* User r/w thread and process ID */ | 496 | ldmia r3!,{r4-r6} |
512 | MCR p15, 0, r4, c13, c0, 2 | 497 | mcr p15, 0, r4, c3, c0, 0 @ Domain access Control Register |
513 | /* User ro thread and process ID */ | 498 | mcr p15, 0, r5, c10, c2, 0 @ PRRR |
514 | MCR p15, 0, r5, c13, c0, 3 | 499 | mcr p15, 0, r6, c10, c2, 1 @ NMRR |
515 | /* Privileged only thread and process ID */ | 500 | |
516 | MCR p15, 0, r6, c13, c0, 4 | 501 | |
517 | /* Cache size selection */ | 502 | ldmia r3!,{r4-r7} |
518 | MCR p15, 2, r7, c0, c0, 0 | 503 | mcr p15, 0, r4, c13, c0, 1 @ Context ID |
519 | ldmia r3!,{r4-r8} | 504 | mcr p15, 0, r5, c13, c0, 2 @ User r/w thread and process ID |
520 | /* Data TLB lockdown registers */ | 505 | mrc p15, 0, r6, c12, c0, 0 @ Secure or NS vector base address |
521 | MCR p15, 0, r4, c10, c0, 0 | 506 | msr cpsr, r7 @ store cpsr |
522 | /* Instruction TLB lockdown registers */ | ||
523 | MCR p15, 0, r5, c10, c0, 1 | ||
524 | /* Secure or Nonsecure Vector Base Address */ | ||
525 | MCR p15, 0, r6, c12, c0, 0 | ||
526 | /* FCSE PID */ | ||
527 | MCR p15, 0, r7, c13, c0, 0 | ||
528 | /* Context PID */ | ||
529 | MCR p15, 0, r8, c13, c0, 1 | ||
530 | |||
531 | ldmia r3!,{r4-r5} | ||
532 | /* Primary memory remap register */ | ||
533 | MCR p15, 0, r4, c10, c2, 0 | ||
534 | /* Normal memory remap register */ | ||
535 | MCR p15, 0, r5, c10, c2, 1 | ||
536 | |||
537 | /* Restore cpsr */ | ||
538 | ldmia r3!,{r4} @ load CPSR from SDRAM | ||
539 | msr cpsr, r4 @ store cpsr | ||
540 | 507 | ||
541 | /* Enabling MMU here */ | 508 | /* Enabling MMU here */ |
542 | mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl | 509 | mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl |
@@ -594,12 +561,17 @@ usettbr0: | |||
594 | ldr r2, cache_pred_disable_mask | 561 | ldr r2, cache_pred_disable_mask |
595 | and r4, r2 | 562 | and r4, r2 |
596 | mcr p15, 0, r4, c1, c0, 0 | 563 | mcr p15, 0, r4, c1, c0, 0 |
564 | dsb | ||
565 | isb | ||
566 | ldr r0, =restoremmu_on | ||
567 | bx r0 | ||
597 | 568 | ||
598 | /* | 569 | /* |
599 | * ============================== | 570 | * ============================== |
600 | * == Exit point from OFF mode == | 571 | * == Exit point from OFF mode == |
601 | * ============================== | 572 | * ============================== |
602 | */ | 573 | */ |
574 | restoremmu_on: | ||
603 | ldmfd sp!, {r0-r12, pc} @ restore regs and return | 575 | ldmfd sp!, {r0-r12, pc} @ restore regs and return |
604 | 576 | ||
605 | 577 | ||
@@ -609,6 +581,7 @@ usettbr0: | |||
609 | 581 | ||
610 | /* This function implements the erratum ID i443 WA, applies to 34xx >= ES3.0 */ | 582 | /* This function implements the erratum ID i443 WA, applies to 34xx >= ES3.0 */ |
611 | .text | 583 | .text |
584 | .align 3 | ||
612 | ENTRY(es3_sdrc_fix) | 585 | ENTRY(es3_sdrc_fix) |
613 | ldr r4, sdrc_syscfg @ get config addr | 586 | ldr r4, sdrc_syscfg @ get config addr |
614 | ldr r5, [r4] @ get value | 587 | ldr r5, [r4] @ get value |
@@ -636,6 +609,7 @@ ENTRY(es3_sdrc_fix) | |||
636 | str r5, [r4] @ kick off refreshes | 609 | str r5, [r4] @ kick off refreshes |
637 | bx lr | 610 | bx lr |
638 | 611 | ||
612 | .align | ||
639 | sdrc_syscfg: | 613 | sdrc_syscfg: |
640 | .word SDRC_SYSCONFIG_P | 614 | .word SDRC_SYSCONFIG_P |
641 | sdrc_mr_0: | 615 | sdrc_mr_0: |
@@ -650,6 +624,7 @@ sdrc_emr2_1: | |||
650 | .word SDRC_EMR2_1_P | 624 | .word SDRC_EMR2_1_P |
651 | sdrc_manual_1: | 625 | sdrc_manual_1: |
652 | .word SDRC_MANUAL_1_P | 626 | .word SDRC_MANUAL_1_P |
627 | ENDPROC(es3_sdrc_fix) | ||
653 | ENTRY(es3_sdrc_fix_sz) | 628 | ENTRY(es3_sdrc_fix_sz) |
654 | .word . - es3_sdrc_fix | 629 | .word . - es3_sdrc_fix |
655 | 630 | ||
@@ -684,6 +659,12 @@ wait_sdrc_ready: | |||
684 | bic r5, r5, #0x40 | 659 | bic r5, r5, #0x40 |
685 | str r5, [r4] | 660 | str r5, [r4] |
686 | 661 | ||
662 | /* | ||
663 | * PC-relative stores lead to undefined behaviour in Thumb-2: use a r7 as a | ||
664 | * base instead. | ||
665 | * Be careful not to clobber r7 when maintaing this code. | ||
666 | */ | ||
667 | |||
687 | is_dll_in_lock_mode: | 668 | is_dll_in_lock_mode: |
688 | /* Is dll in lock mode? */ | 669 | /* Is dll in lock mode? */ |
689 | ldr r4, sdrc_dlla_ctrl | 670 | ldr r4, sdrc_dlla_ctrl |
@@ -691,10 +672,11 @@ is_dll_in_lock_mode: | |||
691 | tst r5, #0x4 | 672 | tst r5, #0x4 |
692 | bxne lr @ Return if locked | 673 | bxne lr @ Return if locked |
693 | /* wait till dll locks */ | 674 | /* wait till dll locks */ |
675 | adr r7, kick_counter | ||
694 | wait_dll_lock_timed: | 676 | wait_dll_lock_timed: |
695 | ldr r4, wait_dll_lock_counter | 677 | ldr r4, wait_dll_lock_counter |
696 | add r4, r4, #1 | 678 | add r4, r4, #1 |
697 | str r4, wait_dll_lock_counter | 679 | str r4, [r7, #wait_dll_lock_counter - kick_counter] |
698 | ldr r4, sdrc_dlla_status | 680 | ldr r4, sdrc_dlla_status |
699 | /* Wait 20uS for lock */ | 681 | /* Wait 20uS for lock */ |
700 | mov r6, #8 | 682 | mov r6, #8 |
@@ -720,9 +702,10 @@ kick_dll: | |||
720 | dsb | 702 | dsb |
721 | ldr r4, kick_counter | 703 | ldr r4, kick_counter |
722 | add r4, r4, #1 | 704 | add r4, r4, #1 |
723 | str r4, kick_counter | 705 | str r4, [r7] @ kick_counter |
724 | b wait_dll_lock_timed | 706 | b wait_dll_lock_timed |
725 | 707 | ||
708 | .align | ||
726 | cm_idlest1_core: | 709 | cm_idlest1_core: |
727 | .word CM_IDLEST1_CORE_V | 710 | .word CM_IDLEST1_CORE_V |
728 | cm_idlest_ckgen: | 711 | cm_idlest_ckgen: |
@@ -765,6 +748,7 @@ kick_counter: | |||
765 | .word 0 | 748 | .word 0 |
766 | wait_dll_lock_counter: | 749 | wait_dll_lock_counter: |
767 | .word 0 | 750 | .word 0 |
751 | ENDPROC(omap34xx_cpu_suspend) | ||
768 | 752 | ||
769 | ENTRY(omap34xx_cpu_suspend_sz) | 753 | ENTRY(omap34xx_cpu_suspend_sz) |
770 | .word . - omap34xx_cpu_suspend | 754 | .word . - omap34xx_cpu_suspend |
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c index 60e70552b4c5..f438cf4d847b 100644 --- a/arch/arm/mach-omap2/smartreflex-class3.c +++ b/arch/arm/mach-omap2/smartreflex-class3.c | |||
@@ -11,7 +11,7 @@ | |||
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <plat/smartreflex.h> | 14 | #include "smartreflex.h" |
15 | 15 | ||
16 | static int sr_class3_enable(struct voltagedomain *voltdm) | 16 | static int sr_class3_enable(struct voltagedomain *voltdm) |
17 | { | 17 | { |
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 1a777e34d0c2..8f674c9442bf 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
@@ -26,9 +26,9 @@ | |||
26 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
27 | 27 | ||
28 | #include <plat/common.h> | 28 | #include <plat/common.h> |
29 | #include <plat/smartreflex.h> | ||
30 | 29 | ||
31 | #include "pm.h" | 30 | #include "pm.h" |
31 | #include "smartreflex.h" | ||
32 | 32 | ||
33 | #define SMARTREFLEX_NAME_LEN 16 | 33 | #define SMARTREFLEX_NAME_LEN 16 |
34 | #define NVALUE_NAME_LEN 40 | 34 | #define NVALUE_NAME_LEN 40 |
@@ -54,6 +54,7 @@ struct omap_sr { | |||
54 | struct list_head node; | 54 | struct list_head node; |
55 | struct omap_sr_nvalue_table *nvalue_table; | 55 | struct omap_sr_nvalue_table *nvalue_table; |
56 | struct voltagedomain *voltdm; | 56 | struct voltagedomain *voltdm; |
57 | struct dentry *dbg_dir; | ||
57 | }; | 58 | }; |
58 | 59 | ||
59 | /* sr_list contains all the instances of smartreflex module */ | 60 | /* sr_list contains all the instances of smartreflex module */ |
@@ -260,9 +261,11 @@ static int sr_late_init(struct omap_sr *sr_info) | |||
260 | if (sr_class->class_type == SR_CLASS2 && | 261 | if (sr_class->class_type == SR_CLASS2 && |
261 | sr_class->notify_flags && sr_info->irq) { | 262 | sr_class->notify_flags && sr_info->irq) { |
262 | 263 | ||
263 | name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL); | 264 | name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name); |
264 | strcpy(name, "sr_"); | 265 | if (name == NULL) { |
265 | strcat(name, sr_info->voltdm->name); | 266 | ret = -ENOMEM; |
267 | goto error; | ||
268 | } | ||
266 | ret = request_irq(sr_info->irq, sr_interrupt, | 269 | ret = request_irq(sr_info->irq, sr_interrupt, |
267 | 0, name, (void *)sr_info); | 270 | 0, name, (void *)sr_info); |
268 | if (ret) | 271 | if (ret) |
@@ -821,7 +824,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
821 | struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); | 824 | struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); |
822 | struct omap_sr_data *pdata = pdev->dev.platform_data; | 825 | struct omap_sr_data *pdata = pdev->dev.platform_data; |
823 | struct resource *mem, *irq; | 826 | struct resource *mem, *irq; |
824 | struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir; | 827 | struct dentry *vdd_dbg_dir, *nvalue_dir; |
825 | struct omap_volt_data *volt_data; | 828 | struct omap_volt_data *volt_data; |
826 | int i, ret = 0; | 829 | int i, ret = 0; |
827 | 830 | ||
@@ -896,24 +899,24 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
896 | goto err_release_region; | 899 | goto err_release_region; |
897 | } | 900 | } |
898 | 901 | ||
899 | dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); | 902 | sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); |
900 | if (IS_ERR(dbg_dir)) { | 903 | if (IS_ERR(sr_info->dbg_dir)) { |
901 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", | 904 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", |
902 | __func__); | 905 | __func__); |
903 | ret = PTR_ERR(dbg_dir); | 906 | ret = PTR_ERR(sr_info->dbg_dir); |
904 | goto err_release_region; | 907 | goto err_release_region; |
905 | } | 908 | } |
906 | 909 | ||
907 | (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir, | 910 | (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, |
908 | (void *)sr_info, &pm_sr_fops); | 911 | sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops); |
909 | (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, | 912 | (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir, |
910 | &sr_info->err_weight); | 913 | &sr_info->err_weight); |
911 | (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir, | 914 | (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir, |
912 | &sr_info->err_maxlimit); | 915 | &sr_info->err_maxlimit); |
913 | (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir, | 916 | (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir, |
914 | &sr_info->err_minlimit); | 917 | &sr_info->err_minlimit); |
915 | 918 | ||
916 | nvalue_dir = debugfs_create_dir("nvalue", dbg_dir); | 919 | nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir); |
917 | if (IS_ERR(nvalue_dir)) { | 920 | if (IS_ERR(nvalue_dir)) { |
918 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory" | 921 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory" |
919 | "for n-values\n", __func__); | 922 | "for n-values\n", __func__); |
@@ -970,6 +973,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev) | |||
970 | 973 | ||
971 | if (sr_info->autocomp_active) | 974 | if (sr_info->autocomp_active) |
972 | sr_stop_vddautocomp(sr_info); | 975 | sr_stop_vddautocomp(sr_info); |
976 | if (sr_info->dbg_dir) | ||
977 | debugfs_remove_recursive(sr_info->dbg_dir); | ||
973 | 978 | ||
974 | list_del(&sr_info->node); | 979 | list_del(&sr_info->node); |
975 | iounmap(sr_info->base); | 980 | iounmap(sr_info->base); |
diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h new file mode 100644 index 000000000000..5f35b9e25556 --- /dev/null +++ b/arch/arm/mach-omap2/smartreflex.h | |||
@@ -0,0 +1,246 @@ | |||
1 | /* | ||
2 | * OMAP Smartreflex Defines and Routines | ||
3 | * | ||
4 | * Author: Thara Gopinath <thara@ti.com> | ||
5 | * | ||
6 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * | ||
12 | * Copyright (C) 2007 Texas Instruments, Inc. | ||
13 | * Lesly A M <x0080970@ti.com> | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License version 2 as | ||
17 | * published by the Free Software Foundation. | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_ARM_OMAP_SMARTREFLEX_H | ||
21 | #define __ASM_ARM_OMAP_SMARTREFLEX_H | ||
22 | |||
23 | #include <linux/platform_device.h> | ||
24 | |||
25 | #include "voltage.h" | ||
26 | |||
27 | /* | ||
28 | * Different Smartreflex IPs version. The v1 is the 65nm version used in | ||
29 | * OMAP3430. The v2 is the update for the 45nm version of the IP | ||
30 | * used in OMAP3630 and OMAP4430 | ||
31 | */ | ||
32 | #define SR_TYPE_V1 1 | ||
33 | #define SR_TYPE_V2 2 | ||
34 | |||
35 | /* SMART REFLEX REG ADDRESS OFFSET */ | ||
36 | #define SRCONFIG 0x00 | ||
37 | #define SRSTATUS 0x04 | ||
38 | #define SENVAL 0x08 | ||
39 | #define SENMIN 0x0C | ||
40 | #define SENMAX 0x10 | ||
41 | #define SENAVG 0x14 | ||
42 | #define AVGWEIGHT 0x18 | ||
43 | #define NVALUERECIPROCAL 0x1c | ||
44 | #define SENERROR_V1 0x20 | ||
45 | #define ERRCONFIG_V1 0x24 | ||
46 | #define IRQ_EOI 0x20 | ||
47 | #define IRQSTATUS_RAW 0x24 | ||
48 | #define IRQSTATUS 0x28 | ||
49 | #define IRQENABLE_SET 0x2C | ||
50 | #define IRQENABLE_CLR 0x30 | ||
51 | #define SENERROR_V2 0x34 | ||
52 | #define ERRCONFIG_V2 0x38 | ||
53 | |||
54 | /* Bit/Shift Positions */ | ||
55 | |||
56 | /* SRCONFIG */ | ||
57 | #define SRCONFIG_ACCUMDATA_SHIFT 22 | ||
58 | #define SRCONFIG_SRCLKLENGTH_SHIFT 12 | ||
59 | #define SRCONFIG_SENNENABLE_V1_SHIFT 5 | ||
60 | #define SRCONFIG_SENPENABLE_V1_SHIFT 3 | ||
61 | #define SRCONFIG_SENNENABLE_V2_SHIFT 1 | ||
62 | #define SRCONFIG_SENPENABLE_V2_SHIFT 0 | ||
63 | #define SRCONFIG_CLKCTRL_SHIFT 0 | ||
64 | |||
65 | #define SRCONFIG_ACCUMDATA_MASK (0x3ff << 22) | ||
66 | |||
67 | #define SRCONFIG_SRENABLE BIT(11) | ||
68 | #define SRCONFIG_SENENABLE BIT(10) | ||
69 | #define SRCONFIG_ERRGEN_EN BIT(9) | ||
70 | #define SRCONFIG_MINMAXAVG_EN BIT(8) | ||
71 | #define SRCONFIG_DELAYCTRL BIT(2) | ||
72 | |||
73 | /* AVGWEIGHT */ | ||
74 | #define AVGWEIGHT_SENPAVGWEIGHT_SHIFT 2 | ||
75 | #define AVGWEIGHT_SENNAVGWEIGHT_SHIFT 0 | ||
76 | |||
77 | /* NVALUERECIPROCAL */ | ||
78 | #define NVALUERECIPROCAL_SENPGAIN_SHIFT 20 | ||
79 | #define NVALUERECIPROCAL_SENNGAIN_SHIFT 16 | ||
80 | #define NVALUERECIPROCAL_RNSENP_SHIFT 8 | ||
81 | #define NVALUERECIPROCAL_RNSENN_SHIFT 0 | ||
82 | |||
83 | /* ERRCONFIG */ | ||
84 | #define ERRCONFIG_ERRWEIGHT_SHIFT 16 | ||
85 | #define ERRCONFIG_ERRMAXLIMIT_SHIFT 8 | ||
86 | #define ERRCONFIG_ERRMINLIMIT_SHIFT 0 | ||
87 | |||
88 | #define SR_ERRWEIGHT_MASK (0x07 << 16) | ||
89 | #define SR_ERRMAXLIMIT_MASK (0xff << 8) | ||
90 | #define SR_ERRMINLIMIT_MASK (0xff << 0) | ||
91 | |||
92 | #define ERRCONFIG_VPBOUNDINTEN_V1 BIT(31) | ||
93 | #define ERRCONFIG_VPBOUNDINTST_V1 BIT(30) | ||
94 | #define ERRCONFIG_MCUACCUMINTEN BIT(29) | ||
95 | #define ERRCONFIG_MCUACCUMINTST BIT(28) | ||
96 | #define ERRCONFIG_MCUVALIDINTEN BIT(27) | ||
97 | #define ERRCONFIG_MCUVALIDINTST BIT(26) | ||
98 | #define ERRCONFIG_MCUBOUNDINTEN BIT(25) | ||
99 | #define ERRCONFIG_MCUBOUNDINTST BIT(24) | ||
100 | #define ERRCONFIG_MCUDISACKINTEN BIT(23) | ||
101 | #define ERRCONFIG_VPBOUNDINTST_V2 BIT(23) | ||
102 | #define ERRCONFIG_MCUDISACKINTST BIT(22) | ||
103 | #define ERRCONFIG_VPBOUNDINTEN_V2 BIT(22) | ||
104 | |||
105 | #define ERRCONFIG_STATUS_V1_MASK (ERRCONFIG_VPBOUNDINTST_V1 | \ | ||
106 | ERRCONFIG_MCUACCUMINTST | \ | ||
107 | ERRCONFIG_MCUVALIDINTST | \ | ||
108 | ERRCONFIG_MCUBOUNDINTST | \ | ||
109 | ERRCONFIG_MCUDISACKINTST) | ||
110 | /* IRQSTATUS */ | ||
111 | #define IRQSTATUS_MCUACCUMINT BIT(3) | ||
112 | #define IRQSTATUS_MCVALIDINT BIT(2) | ||
113 | #define IRQSTATUS_MCBOUNDSINT BIT(1) | ||
114 | #define IRQSTATUS_MCUDISABLEACKINT BIT(0) | ||
115 | |||
116 | /* IRQENABLE_SET and IRQENABLE_CLEAR */ | ||
117 | #define IRQENABLE_MCUACCUMINT BIT(3) | ||
118 | #define IRQENABLE_MCUVALIDINT BIT(2) | ||
119 | #define IRQENABLE_MCUBOUNDSINT BIT(1) | ||
120 | #define IRQENABLE_MCUDISABLEACKINT BIT(0) | ||
121 | |||
122 | /* Common Bit values */ | ||
123 | |||
124 | #define SRCLKLENGTH_12MHZ_SYSCLK 0x3c | ||
125 | #define SRCLKLENGTH_13MHZ_SYSCLK 0x41 | ||
126 | #define SRCLKLENGTH_19MHZ_SYSCLK 0x60 | ||
127 | #define SRCLKLENGTH_26MHZ_SYSCLK 0x82 | ||
128 | #define SRCLKLENGTH_38MHZ_SYSCLK 0xC0 | ||
129 | |||
130 | /* | ||
131 | * 3430 specific values. Maybe these should be passed from board file or | ||
132 | * pmic structures. | ||
133 | */ | ||
134 | #define OMAP3430_SR_ACCUMDATA 0x1f4 | ||
135 | |||
136 | #define OMAP3430_SR1_SENPAVGWEIGHT 0x03 | ||
137 | #define OMAP3430_SR1_SENNAVGWEIGHT 0x03 | ||
138 | |||
139 | #define OMAP3430_SR2_SENPAVGWEIGHT 0x01 | ||
140 | #define OMAP3430_SR2_SENNAVGWEIGHT 0x01 | ||
141 | |||
142 | #define OMAP3430_SR_ERRWEIGHT 0x04 | ||
143 | #define OMAP3430_SR_ERRMAXLIMIT 0x02 | ||
144 | |||
145 | /** | ||
146 | * struct omap_sr_pmic_data - Strucutre to be populated by pmic code to pass | ||
147 | * pmic specific info to smartreflex driver | ||
148 | * | ||
149 | * @sr_pmic_init: API to initialize smartreflex on the PMIC side. | ||
150 | */ | ||
151 | struct omap_sr_pmic_data { | ||
152 | void (*sr_pmic_init) (void); | ||
153 | }; | ||
154 | |||
155 | #ifdef CONFIG_OMAP_SMARTREFLEX | ||
156 | /* | ||
157 | * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR. | ||
158 | * The smartreflex class driver should pass the class type. | ||
159 | * Should be used to populate the class_type field of the | ||
160 | * omap_smartreflex_class_data structure. | ||
161 | */ | ||
162 | #define SR_CLASS1 0x1 | ||
163 | #define SR_CLASS2 0x2 | ||
164 | #define SR_CLASS3 0x3 | ||
165 | |||
166 | /** | ||
167 | * struct omap_sr_class_data - Smartreflex class driver info | ||
168 | * | ||
169 | * @enable: API to enable a particular class smaartreflex. | ||
170 | * @disable: API to disable a particular class smartreflex. | ||
171 | * @configure: API to configure a particular class smartreflex. | ||
172 | * @notify: API to notify the class driver about an event in SR. | ||
173 | * Not needed for class3. | ||
174 | * @notify_flags: specify the events to be notified to the class driver | ||
175 | * @class_type: specify which smartreflex class. | ||
176 | * Can be used by the SR driver to take any class | ||
177 | * based decisions. | ||
178 | */ | ||
179 | struct omap_sr_class_data { | ||
180 | int (*enable)(struct voltagedomain *voltdm); | ||
181 | int (*disable)(struct voltagedomain *voltdm, int is_volt_reset); | ||
182 | int (*configure)(struct voltagedomain *voltdm); | ||
183 | int (*notify)(struct voltagedomain *voltdm, u32 status); | ||
184 | u8 notify_flags; | ||
185 | u8 class_type; | ||
186 | }; | ||
187 | |||
188 | /** | ||
189 | * struct omap_sr_nvalue_table - Smartreflex n-target value info | ||
190 | * | ||
191 | * @efuse_offs: The offset of the efuse where n-target values are stored. | ||
192 | * @nvalue: The n-target value. | ||
193 | */ | ||
194 | struct omap_sr_nvalue_table { | ||
195 | u32 efuse_offs; | ||
196 | u32 nvalue; | ||
197 | }; | ||
198 | |||
199 | /** | ||
200 | * struct omap_sr_data - Smartreflex platform data. | ||
201 | * | ||
202 | * @ip_type: Smartreflex IP type. | ||
203 | * @senp_mod: SENPENABLE value for the sr | ||
204 | * @senn_mod: SENNENABLE value for sr | ||
205 | * @nvalue_count: Number of distinct nvalues in the nvalue table | ||
206 | * @enable_on_init: whether this sr module needs to enabled at | ||
207 | * boot up or not. | ||
208 | * @nvalue_table: table containing the efuse offsets and nvalues | ||
209 | * corresponding to them. | ||
210 | * @voltdm: Pointer to the voltage domain associated with the SR | ||
211 | */ | ||
212 | struct omap_sr_data { | ||
213 | int ip_type; | ||
214 | u32 senp_mod; | ||
215 | u32 senn_mod; | ||
216 | int nvalue_count; | ||
217 | bool enable_on_init; | ||
218 | struct omap_sr_nvalue_table *nvalue_table; | ||
219 | struct voltagedomain *voltdm; | ||
220 | }; | ||
221 | |||
222 | /* Smartreflex module enable/disable interface */ | ||
223 | void omap_sr_enable(struct voltagedomain *voltdm); | ||
224 | void omap_sr_disable(struct voltagedomain *voltdm); | ||
225 | void omap_sr_disable_reset_volt(struct voltagedomain *voltdm); | ||
226 | |||
227 | /* API to register the pmic specific data with the smartreflex driver. */ | ||
228 | void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); | ||
229 | |||
230 | /* Smartreflex driver hooks to be called from Smartreflex class driver */ | ||
231 | int sr_enable(struct voltagedomain *voltdm, unsigned long volt); | ||
232 | void sr_disable(struct voltagedomain *voltdm); | ||
233 | int sr_configure_errgen(struct voltagedomain *voltdm); | ||
234 | int sr_configure_minmax(struct voltagedomain *voltdm); | ||
235 | |||
236 | /* API to register the smartreflex class driver with the smartreflex driver */ | ||
237 | int sr_register_class(struct omap_sr_class_data *class_data); | ||
238 | #else | ||
239 | static inline void omap_sr_enable(struct voltagedomain *voltdm) {} | ||
240 | static inline void omap_sr_disable(struct voltagedomain *voltdm) {} | ||
241 | static inline void omap_sr_disable_reset_volt( | ||
242 | struct voltagedomain *voltdm) {} | ||
243 | static inline void omap_sr_register_pmic( | ||
244 | struct omap_sr_pmic_data *pmic_data) {} | ||
245 | #endif | ||
246 | #endif | ||
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index b1e0af18a26a..10d3c5ee8018 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <plat/omap_device.h> | 25 | #include <plat/omap_device.h> |
26 | #include <plat/smartreflex.h> | ||
27 | #include <plat/voltage.h> | ||
28 | 26 | ||
27 | #include "smartreflex.h" | ||
28 | #include "voltage.h" | ||
29 | #include "control.h" | 29 | #include "control.h" |
30 | #include "pm.h" | 30 | #include "pm.h" |
31 | 31 | ||
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S index 25011ca2145d..6f5849aaa7c0 100644 --- a/arch/arm/mach-omap2/sram34xx.S +++ b/arch/arm/mach-omap2/sram34xx.S | |||
@@ -34,6 +34,12 @@ | |||
34 | #include "sdrc.h" | 34 | #include "sdrc.h" |
35 | #include "cm2xxx_3xxx.h" | 35 | #include "cm2xxx_3xxx.h" |
36 | 36 | ||
37 | /* | ||
38 | * This file needs be built unconditionally as ARM to interoperate correctly | ||
39 | * with non-Thumb-2-capable firmware. | ||
40 | */ | ||
41 | .arm | ||
42 | |||
37 | .text | 43 | .text |
38 | 44 | ||
39 | /* r1 parameters */ | 45 | /* r1 parameters */ |
@@ -117,24 +123,36 @@ ENTRY(omap3_sram_configure_core_dpll) | |||
117 | 123 | ||
118 | @ pull the extra args off the stack | 124 | @ pull the extra args off the stack |
119 | @ and store them in SRAM | 125 | @ and store them in SRAM |
126 | |||
127 | /* | ||
128 | * PC-relative stores are deprecated in ARMv7 and lead to undefined behaviour | ||
129 | * in Thumb-2: use a r7 as a base instead. | ||
130 | * Be careful not to clobber r7 when maintaing this file. | ||
131 | */ | ||
132 | THUMB( adr r7, omap3_sram_configure_core_dpll ) | ||
133 | .macro strtext Rt:req, label:req | ||
134 | ARM( str \Rt, \label ) | ||
135 | THUMB( str \Rt, [r7, \label - omap3_sram_configure_core_dpll] ) | ||
136 | .endm | ||
137 | |||
120 | ldr r4, [sp, #52] | 138 | ldr r4, [sp, #52] |
121 | str r4, omap_sdrc_rfr_ctrl_0_val | 139 | strtext r4, omap_sdrc_rfr_ctrl_0_val |
122 | ldr r4, [sp, #56] | 140 | ldr r4, [sp, #56] |
123 | str r4, omap_sdrc_actim_ctrl_a_0_val | 141 | strtext r4, omap_sdrc_actim_ctrl_a_0_val |
124 | ldr r4, [sp, #60] | 142 | ldr r4, [sp, #60] |
125 | str r4, omap_sdrc_actim_ctrl_b_0_val | 143 | strtext r4, omap_sdrc_actim_ctrl_b_0_val |
126 | ldr r4, [sp, #64] | 144 | ldr r4, [sp, #64] |
127 | str r4, omap_sdrc_mr_0_val | 145 | strtext r4, omap_sdrc_mr_0_val |
128 | ldr r4, [sp, #68] | 146 | ldr r4, [sp, #68] |
129 | str r4, omap_sdrc_rfr_ctrl_1_val | 147 | strtext r4, omap_sdrc_rfr_ctrl_1_val |
130 | cmp r4, #0 @ if SDRC_RFR_CTRL_1 is 0, | 148 | cmp r4, #0 @ if SDRC_RFR_CTRL_1 is 0, |
131 | beq skip_cs1_params @ do not use cs1 params | 149 | beq skip_cs1_params @ do not use cs1 params |
132 | ldr r4, [sp, #72] | 150 | ldr r4, [sp, #72] |
133 | str r4, omap_sdrc_actim_ctrl_a_1_val | 151 | strtext r4, omap_sdrc_actim_ctrl_a_1_val |
134 | ldr r4, [sp, #76] | 152 | ldr r4, [sp, #76] |
135 | str r4, omap_sdrc_actim_ctrl_b_1_val | 153 | strtext r4, omap_sdrc_actim_ctrl_b_1_val |
136 | ldr r4, [sp, #80] | 154 | ldr r4, [sp, #80] |
137 | str r4, omap_sdrc_mr_1_val | 155 | strtext r4, omap_sdrc_mr_1_val |
138 | skip_cs1_params: | 156 | skip_cs1_params: |
139 | mrc p15, 0, r8, c1, c0, 0 @ read ctrl register | 157 | mrc p15, 0, r8, c1, c0, 0 @ read ctrl register |
140 | bic r10, r8, #0x800 @ clear Z-bit, disable branch prediction | 158 | bic r10, r8, #0x800 @ clear Z-bit, disable branch prediction |
@@ -272,6 +290,7 @@ skip_cs1_prog: | |||
272 | ldr r12, [r11] @ posted-write barrier for SDRC | 290 | ldr r12, [r11] @ posted-write barrier for SDRC |
273 | bx lr | 291 | bx lr |
274 | 292 | ||
293 | .align | ||
275 | omap3_sdrc_power: | 294 | omap3_sdrc_power: |
276 | .word OMAP34XX_SDRC_REGADDR(SDRC_POWER) | 295 | .word OMAP34XX_SDRC_REGADDR(SDRC_POWER) |
277 | omap3_cm_clksel1_pll: | 296 | omap3_cm_clksel1_pll: |
@@ -320,6 +339,7 @@ omap3_sdrc_dlla_ctrl: | |||
320 | .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) | 339 | .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) |
321 | core_m2_mask_val: | 340 | core_m2_mask_val: |
322 | .word 0x07FFFFFF | 341 | .word 0x07FFFFFF |
342 | ENDPROC(omap3_sram_configure_core_dpll) | ||
323 | 343 | ||
324 | ENTRY(omap3_sram_configure_core_dpll_sz) | 344 | ENTRY(omap3_sram_configure_core_dpll_sz) |
325 | .word . - omap3_sram_configure_core_dpll | 345 | .word . - omap3_sram_configure_core_dpll |
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 0fc550e7e482..3b9cf85f4bb9 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
@@ -40,10 +40,11 @@ | |||
40 | #include <plat/dmtimer.h> | 40 | #include <plat/dmtimer.h> |
41 | #include <asm/localtimer.h> | 41 | #include <asm/localtimer.h> |
42 | #include <asm/sched_clock.h> | 42 | #include <asm/sched_clock.h> |
43 | #include <plat/common.h> | ||
44 | #include <plat/omap_hwmod.h> | ||
43 | 45 | ||
44 | #include "timer-gp.h" | 46 | #include "timer-gp.h" |
45 | 47 | ||
46 | #include <plat/common.h> | ||
47 | 48 | ||
48 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ | 49 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ |
49 | #define MAX_GPTIMER_ID 12 | 50 | #define MAX_GPTIMER_ID 12 |
@@ -133,9 +134,13 @@ static void __init omap2_gp_clockevent_init(void) | |||
133 | { | 134 | { |
134 | u32 tick_rate; | 135 | u32 tick_rate; |
135 | int src; | 136 | int src; |
137 | char clockevent_hwmod_name[8]; /* 8 = sizeof("timerXX0") */ | ||
136 | 138 | ||
137 | inited = 1; | 139 | inited = 1; |
138 | 140 | ||
141 | sprintf(clockevent_hwmod_name, "timer%d", gptimer_id); | ||
142 | omap_hwmod_setup_one(clockevent_hwmod_name); | ||
143 | |||
139 | gptimer = omap_dm_timer_request_specific(gptimer_id); | 144 | gptimer = omap_dm_timer_request_specific(gptimer_id); |
140 | BUG_ON(gptimer == NULL); | 145 | BUG_ON(gptimer == NULL); |
141 | gptimer_wakeup = gptimer; | 146 | gptimer_wakeup = gptimer; |
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 241fc94b4116..35559f77e2de 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -30,118 +30,11 @@ | |||
30 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
31 | #include <mach/am35xx.h> | 31 | #include <mach/am35xx.h> |
32 | #include <plat/usb.h> | 32 | #include <plat/usb.h> |
33 | #include "control.h" | 33 | #include <plat/omap_device.h> |
34 | #include "mux.h" | ||
34 | 35 | ||
35 | #if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X) | 36 | #if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X) |
36 | 37 | ||
37 | static void am35x_musb_reset(void) | ||
38 | { | ||
39 | u32 regval; | ||
40 | |||
41 | /* Reset the musb interface */ | ||
42 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
43 | |||
44 | regval |= AM35XX_USBOTGSS_SW_RST; | ||
45 | omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET); | ||
46 | |||
47 | regval &= ~AM35XX_USBOTGSS_SW_RST; | ||
48 | omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET); | ||
49 | |||
50 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
51 | } | ||
52 | |||
53 | static void am35x_musb_phy_power(u8 on) | ||
54 | { | ||
55 | unsigned long timeout = jiffies + msecs_to_jiffies(100); | ||
56 | u32 devconf2; | ||
57 | |||
58 | if (on) { | ||
59 | /* | ||
60 | * Start the on-chip PHY and its PLL. | ||
61 | */ | ||
62 | devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
63 | |||
64 | devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN); | ||
65 | devconf2 |= CONF2_PHY_PLLON; | ||
66 | |||
67 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
68 | |||
69 | pr_info(KERN_INFO "Waiting for PHY clock good...\n"); | ||
70 | while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2) | ||
71 | & CONF2_PHYCLKGD)) { | ||
72 | cpu_relax(); | ||
73 | |||
74 | if (time_after(jiffies, timeout)) { | ||
75 | pr_err(KERN_ERR "musb PHY clock good timed out\n"); | ||
76 | break; | ||
77 | } | ||
78 | } | ||
79 | } else { | ||
80 | /* | ||
81 | * Power down the on-chip PHY. | ||
82 | */ | ||
83 | devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
84 | |||
85 | devconf2 &= ~CONF2_PHY_PLLON; | ||
86 | devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN; | ||
87 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | static void am35x_musb_clear_irq(void) | ||
92 | { | ||
93 | u32 regval; | ||
94 | |||
95 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
96 | regval |= AM35XX_USBOTGSS_INT_CLR; | ||
97 | omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
98 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
99 | } | ||
100 | |||
101 | static void am35x_musb_set_mode(u8 musb_mode) | ||
102 | { | ||
103 | u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
104 | |||
105 | devconf2 &= ~CONF2_OTGMODE; | ||
106 | switch (musb_mode) { | ||
107 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
108 | case MUSB_HOST: /* Force VBUS valid, ID = 0 */ | ||
109 | devconf2 |= CONF2_FORCE_HOST; | ||
110 | break; | ||
111 | #endif | ||
112 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
113 | case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */ | ||
114 | devconf2 |= CONF2_FORCE_DEVICE; | ||
115 | break; | ||
116 | #endif | ||
117 | #ifdef CONFIG_USB_MUSB_OTG | ||
118 | case MUSB_OTG: /* Don't override the VBUS/ID comparators */ | ||
119 | devconf2 |= CONF2_NO_OVERRIDE; | ||
120 | break; | ||
121 | #endif | ||
122 | default: | ||
123 | pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode); | ||
124 | } | ||
125 | |||
126 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
127 | } | ||
128 | |||
129 | static struct resource musb_resources[] = { | ||
130 | [0] = { /* start and end set dynamically */ | ||
131 | .flags = IORESOURCE_MEM, | ||
132 | }, | ||
133 | [1] = { /* general IRQ */ | ||
134 | .start = INT_243X_HS_USB_MC, | ||
135 | .flags = IORESOURCE_IRQ, | ||
136 | .name = "mc", | ||
137 | }, | ||
138 | [2] = { /* DMA IRQ */ | ||
139 | .start = INT_243X_HS_USB_DMA, | ||
140 | .flags = IORESOURCE_IRQ, | ||
141 | .name = "dma", | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | static struct musb_hdrc_config musb_config = { | 38 | static struct musb_hdrc_config musb_config = { |
146 | .multipoint = 1, | 39 | .multipoint = 1, |
147 | .dyn_fifo = 1, | 40 | .dyn_fifo = 1, |
@@ -169,38 +62,65 @@ static struct musb_hdrc_platform_data musb_plat = { | |||
169 | 62 | ||
170 | static u64 musb_dmamask = DMA_BIT_MASK(32); | 63 | static u64 musb_dmamask = DMA_BIT_MASK(32); |
171 | 64 | ||
172 | static struct platform_device musb_device = { | 65 | static struct omap_device_pm_latency omap_musb_latency[] = { |
173 | .name = "musb-omap2430", | 66 | { |
174 | .id = -1, | 67 | .deactivate_func = omap_device_idle_hwmods, |
175 | .dev = { | 68 | .activate_func = omap_device_enable_hwmods, |
176 | .dma_mask = &musb_dmamask, | 69 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, |
177 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
178 | .platform_data = &musb_plat, | ||
179 | }, | 70 | }, |
180 | .num_resources = ARRAY_SIZE(musb_resources), | ||
181 | .resource = musb_resources, | ||
182 | }; | 71 | }; |
183 | 72 | ||
73 | static void usb_musb_mux_init(struct omap_musb_board_data *board_data) | ||
74 | { | ||
75 | switch (board_data->interface_type) { | ||
76 | case MUSB_INTERFACE_UTMI: | ||
77 | omap_mux_init_signal("usba0_otg_dp", OMAP_PIN_INPUT); | ||
78 | omap_mux_init_signal("usba0_otg_dm", OMAP_PIN_INPUT); | ||
79 | break; | ||
80 | case MUSB_INTERFACE_ULPI: | ||
81 | omap_mux_init_signal("usba0_ulpiphy_clk", | ||
82 | OMAP_PIN_INPUT_PULLDOWN); | ||
83 | omap_mux_init_signal("usba0_ulpiphy_stp", | ||
84 | OMAP_PIN_INPUT_PULLDOWN); | ||
85 | omap_mux_init_signal("usba0_ulpiphy_dir", | ||
86 | OMAP_PIN_INPUT_PULLDOWN); | ||
87 | omap_mux_init_signal("usba0_ulpiphy_nxt", | ||
88 | OMAP_PIN_INPUT_PULLDOWN); | ||
89 | omap_mux_init_signal("usba0_ulpiphy_dat0", | ||
90 | OMAP_PIN_INPUT_PULLDOWN); | ||
91 | omap_mux_init_signal("usba0_ulpiphy_dat1", | ||
92 | OMAP_PIN_INPUT_PULLDOWN); | ||
93 | omap_mux_init_signal("usba0_ulpiphy_dat2", | ||
94 | OMAP_PIN_INPUT_PULLDOWN); | ||
95 | omap_mux_init_signal("usba0_ulpiphy_dat3", | ||
96 | OMAP_PIN_INPUT_PULLDOWN); | ||
97 | omap_mux_init_signal("usba0_ulpiphy_dat4", | ||
98 | OMAP_PIN_INPUT_PULLDOWN); | ||
99 | omap_mux_init_signal("usba0_ulpiphy_dat5", | ||
100 | OMAP_PIN_INPUT_PULLDOWN); | ||
101 | omap_mux_init_signal("usba0_ulpiphy_dat6", | ||
102 | OMAP_PIN_INPUT_PULLDOWN); | ||
103 | omap_mux_init_signal("usba0_ulpiphy_dat7", | ||
104 | OMAP_PIN_INPUT_PULLDOWN); | ||
105 | break; | ||
106 | default: | ||
107 | break; | ||
108 | } | ||
109 | } | ||
110 | |||
184 | void __init usb_musb_init(struct omap_musb_board_data *board_data) | 111 | void __init usb_musb_init(struct omap_musb_board_data *board_data) |
185 | { | 112 | { |
186 | if (cpu_is_omap243x()) { | 113 | struct omap_hwmod *oh; |
187 | musb_resources[0].start = OMAP243X_HS_BASE; | 114 | struct omap_device *od; |
188 | } else if (cpu_is_omap3517() || cpu_is_omap3505()) { | 115 | struct platform_device *pdev; |
189 | musb_device.name = "musb-am35x"; | 116 | struct device *dev; |
190 | musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE; | 117 | int bus_id = -1; |
191 | musb_resources[1].start = INT_35XX_USBOTG_IRQ; | 118 | const char *oh_name, *name; |
192 | board_data->set_phy_power = am35x_musb_phy_power; | 119 | |
193 | board_data->clear_irq = am35x_musb_clear_irq; | 120 | if (cpu_is_omap3517() || cpu_is_omap3505()) { |
194 | board_data->set_mode = am35x_musb_set_mode; | ||
195 | board_data->reset = am35x_musb_reset; | ||
196 | } else if (cpu_is_omap34xx()) { | ||
197 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; | ||
198 | } else if (cpu_is_omap44xx()) { | 121 | } else if (cpu_is_omap44xx()) { |
199 | musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE; | 122 | usb_musb_mux_init(board_data); |
200 | musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N; | ||
201 | musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N; | ||
202 | } | 123 | } |
203 | musb_resources[0].end = musb_resources[0].start + SZ_4K - 1; | ||
204 | 124 | ||
205 | /* | 125 | /* |
206 | * REVISIT: This line can be removed once all the platforms using | 126 | * REVISIT: This line can be removed once all the platforms using |
@@ -212,12 +132,38 @@ void __init usb_musb_init(struct omap_musb_board_data *board_data) | |||
212 | musb_plat.mode = board_data->mode; | 132 | musb_plat.mode = board_data->mode; |
213 | musb_plat.extvbus = board_data->extvbus; | 133 | musb_plat.extvbus = board_data->extvbus; |
214 | 134 | ||
215 | if (platform_device_register(&musb_device) < 0) | ||
216 | printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); | ||
217 | |||
218 | if (cpu_is_omap44xx()) | 135 | if (cpu_is_omap44xx()) |
219 | omap4430_phy_init(dev); | 136 | omap4430_phy_init(dev); |
220 | 137 | ||
138 | if (cpu_is_omap3517() || cpu_is_omap3505()) { | ||
139 | oh_name = "am35x_otg_hs"; | ||
140 | name = "musb-am35x"; | ||
141 | } else { | ||
142 | oh_name = "usb_otg_hs"; | ||
143 | name = "musb-omap2430"; | ||
144 | } | ||
145 | |||
146 | oh = omap_hwmod_lookup(oh_name); | ||
147 | if (!oh) { | ||
148 | pr_err("Could not look up %s\n", oh_name); | ||
149 | return; | ||
150 | } | ||
151 | |||
152 | od = omap_device_build(name, bus_id, oh, &musb_plat, | ||
153 | sizeof(musb_plat), omap_musb_latency, | ||
154 | ARRAY_SIZE(omap_musb_latency), false); | ||
155 | if (IS_ERR(od)) { | ||
156 | pr_err("Could not build omap_device for %s %s\n", | ||
157 | name, oh_name); | ||
158 | return; | ||
159 | } | ||
160 | |||
161 | pdev = &od->pdev; | ||
162 | dev = &pdev->dev; | ||
163 | get_device(dev); | ||
164 | dev->dma_mask = &musb_dmamask; | ||
165 | dev->coherent_dma_mask = musb_dmamask; | ||
166 | put_device(dev); | ||
221 | } | 167 | } |
222 | 168 | ||
223 | #else | 169 | #else |
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h new file mode 100644 index 000000000000..e7767771de49 --- /dev/null +++ b/arch/arm/mach-omap2/vc.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * OMAP3/4 Voltage Controller (VC) structure and macro definitions | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License version | ||
15 | * 2 as published by the Free Software Foundation. | ||
16 | */ | ||
17 | #ifndef __ARCH_ARM_MACH_OMAP2_VC_H | ||
18 | #define __ARCH_ARM_MACH_OMAP2_VC_H | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | |||
22 | /** | ||
23 | * struct omap_vc_common_data - per-VC register/bitfield data | ||
24 | * @cmd_on_mask: ON bitmask in PRM_VC_CMD_VAL* register | ||
25 | * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register | ||
26 | * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start | ||
27 | * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start | ||
28 | * @bypass_val_reg: Offset of PRM_VC_BYPASS_VAL reg from PRM start | ||
29 | * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register | ||
30 | * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register | ||
31 | * @regaddr_shift: REGADDR field shift in PRM_VC_BYPASS_VAL register | ||
32 | * @cmd_on_shift: ON field shift in PRM_VC_CMD_VAL_* register | ||
33 | * @cmd_onlp_shift: ONLP field shift in PRM_VC_CMD_VAL_* register | ||
34 | * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register | ||
35 | * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register | ||
36 | * | ||
37 | * XXX One of cmd_on_mask and cmd_on_shift are not needed | ||
38 | * XXX VALID should probably be a shift, not a mask | ||
39 | */ | ||
40 | struct omap_vc_common_data { | ||
41 | u32 cmd_on_mask; | ||
42 | u32 valid; | ||
43 | u8 smps_sa_reg; | ||
44 | u8 smps_volra_reg; | ||
45 | u8 bypass_val_reg; | ||
46 | u8 data_shift; | ||
47 | u8 slaveaddr_shift; | ||
48 | u8 regaddr_shift; | ||
49 | u8 cmd_on_shift; | ||
50 | u8 cmd_onlp_shift; | ||
51 | u8 cmd_ret_shift; | ||
52 | u8 cmd_off_shift; | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * struct omap_vc_instance_data - VC per-instance data | ||
57 | * @vc_common: pointer to VC common data for this platform | ||
58 | * @smps_sa_mask: SA* bitmask in the PRM_VC_SMPS_SA register | ||
59 | * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register | ||
60 | * @smps_sa_shift: SA* field shift in the PRM_VC_SMPS_SA register | ||
61 | * @smps_volra_shift: VOLRA* field shift in the PRM_VC_VOL_RA register | ||
62 | * | ||
63 | * XXX It is not necessary to have both a *_mask and a *_shift - | ||
64 | * remove one | ||
65 | */ | ||
66 | struct omap_vc_instance_data { | ||
67 | const struct omap_vc_common_data *vc_common; | ||
68 | u32 smps_sa_mask; | ||
69 | u32 smps_volra_mask; | ||
70 | u8 cmdval_reg; | ||
71 | u8 smps_sa_shift; | ||
72 | u8 smps_volra_shift; | ||
73 | }; | ||
74 | |||
75 | extern struct omap_vc_instance_data omap3_vc1_data; | ||
76 | extern struct omap_vc_instance_data omap3_vc2_data; | ||
77 | |||
78 | extern struct omap_vc_instance_data omap4_vc_mpu_data; | ||
79 | extern struct omap_vc_instance_data omap4_vc_iva_data; | ||
80 | extern struct omap_vc_instance_data omap4_vc_core_data; | ||
81 | |||
82 | #endif | ||
83 | |||
diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c new file mode 100644 index 000000000000..f37dc4bc379a --- /dev/null +++ b/arch/arm/mach-omap2/vc3xxx_data.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * OMAP3 Voltage Controller (VC) data | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/err.h> | ||
19 | #include <linux/init.h> | ||
20 | |||
21 | #include <plat/common.h> | ||
22 | |||
23 | #include "prm-regbits-34xx.h" | ||
24 | #include "voltage.h" | ||
25 | |||
26 | #include "vc.h" | ||
27 | |||
28 | /* | ||
29 | * VC data common to 34xx/36xx chips | ||
30 | * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. | ||
31 | */ | ||
32 | static struct omap_vc_common_data omap3_vc_common = { | ||
33 | .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET, | ||
34 | .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET, | ||
35 | .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET, | ||
36 | .data_shift = OMAP3430_DATA_SHIFT, | ||
37 | .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT, | ||
38 | .regaddr_shift = OMAP3430_REGADDR_SHIFT, | ||
39 | .valid = OMAP3430_VALID_MASK, | ||
40 | .cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT, | ||
41 | .cmd_on_mask = OMAP3430_VC_CMD_ON_MASK, | ||
42 | .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT, | ||
43 | .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT, | ||
44 | .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT, | ||
45 | }; | ||
46 | |||
47 | struct omap_vc_instance_data omap3_vc1_data = { | ||
48 | .vc_common = &omap3_vc_common, | ||
49 | .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET, | ||
50 | .smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT, | ||
51 | .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK, | ||
52 | .smps_volra_shift = OMAP3430_VOLRA0_SHIFT, | ||
53 | .smps_volra_mask = OMAP3430_VOLRA0_MASK, | ||
54 | }; | ||
55 | |||
56 | struct omap_vc_instance_data omap3_vc2_data = { | ||
57 | .vc_common = &omap3_vc_common, | ||
58 | .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET, | ||
59 | .smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT, | ||
60 | .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK, | ||
61 | .smps_volra_shift = OMAP3430_VOLRA1_SHIFT, | ||
62 | .smps_volra_mask = OMAP3430_VOLRA1_MASK, | ||
63 | }; | ||
diff --git a/arch/arm/mach-omap2/vc44xx_data.c b/arch/arm/mach-omap2/vc44xx_data.c new file mode 100644 index 000000000000..a98da8ddec52 --- /dev/null +++ b/arch/arm/mach-omap2/vc44xx_data.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * OMAP4 Voltage Controller (VC) data | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/err.h> | ||
19 | #include <linux/init.h> | ||
20 | |||
21 | #include <plat/common.h> | ||
22 | |||
23 | #include "prm44xx.h" | ||
24 | #include "prm-regbits-44xx.h" | ||
25 | #include "voltage.h" | ||
26 | |||
27 | #include "vc.h" | ||
28 | |||
29 | /* | ||
30 | * VC data common to 44xx chips | ||
31 | * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. | ||
32 | */ | ||
33 | static const struct omap_vc_common_data omap4_vc_common = { | ||
34 | .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET, | ||
35 | .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET, | ||
36 | .bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET, | ||
37 | .data_shift = OMAP4430_DATA_SHIFT, | ||
38 | .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT, | ||
39 | .regaddr_shift = OMAP4430_REGADDR_SHIFT, | ||
40 | .valid = OMAP4430_VALID_MASK, | ||
41 | .cmd_on_shift = OMAP4430_ON_SHIFT, | ||
42 | .cmd_on_mask = OMAP4430_ON_MASK, | ||
43 | .cmd_onlp_shift = OMAP4430_ONLP_SHIFT, | ||
44 | .cmd_ret_shift = OMAP4430_RET_SHIFT, | ||
45 | .cmd_off_shift = OMAP4430_OFF_SHIFT, | ||
46 | }; | ||
47 | |||
48 | /* VC instance data for each controllable voltage line */ | ||
49 | struct omap_vc_instance_data omap4_vc_mpu_data = { | ||
50 | .vc_common = &omap4_vc_common, | ||
51 | .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET, | ||
52 | .smps_sa_shift = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT, | ||
53 | .smps_sa_mask = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK, | ||
54 | .smps_volra_shift = OMAP4430_VOLRA_VDD_MPU_L_SHIFT, | ||
55 | .smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK, | ||
56 | }; | ||
57 | |||
58 | struct omap_vc_instance_data omap4_vc_iva_data = { | ||
59 | .vc_common = &omap4_vc_common, | ||
60 | .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET, | ||
61 | .smps_sa_shift = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT, | ||
62 | .smps_sa_mask = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK, | ||
63 | .smps_volra_shift = OMAP4430_VOLRA_VDD_IVA_L_SHIFT, | ||
64 | .smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK, | ||
65 | }; | ||
66 | |||
67 | struct omap_vc_instance_data omap4_vc_core_data = { | ||
68 | .vc_common = &omap4_vc_common, | ||
69 | .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET, | ||
70 | .smps_sa_shift = OMAP4430_SA_VDD_CORE_L_0_6_SHIFT, | ||
71 | .smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK, | ||
72 | .smps_volra_shift = OMAP4430_VOLRA_VDD_CORE_L_SHIFT, | ||
73 | .smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK, | ||
74 | }; | ||
75 | |||
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 12be525b8df4..c6facf7becf8 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c | |||
@@ -7,8 +7,9 @@ | |||
7 | * Rajendra Nayak <rnayak@ti.com> | 7 | * Rajendra Nayak <rnayak@ti.com> |
8 | * Lesly A M <x0080970@ti.com> | 8 | * Lesly A M <x0080970@ti.com> |
9 | * | 9 | * |
10 | * Copyright (C) 2008 Nokia Corporation | 10 | * Copyright (C) 2008, 2011 Nokia Corporation |
11 | * Kalle Jokiniemi | 11 | * Kalle Jokiniemi |
12 | * Paul Walmsley | ||
12 | * | 13 | * |
13 | * Copyright (C) 2010 Texas Instruments, Inc. | 14 | * Copyright (C) 2010 Texas Instruments, Inc. |
14 | * Thara Gopinath <thara@ti.com> | 15 | * Thara Gopinath <thara@ti.com> |
@@ -26,7 +27,6 @@ | |||
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | 28 | ||
28 | #include <plat/common.h> | 29 | #include <plat/common.h> |
29 | #include <plat/voltage.h> | ||
30 | 30 | ||
31 | #include "prm-regbits-34xx.h" | 31 | #include "prm-regbits-34xx.h" |
32 | #include "prm-regbits-44xx.h" | 32 | #include "prm-regbits-44xx.h" |
@@ -35,284 +35,30 @@ | |||
35 | #include "prminst44xx.h" | 35 | #include "prminst44xx.h" |
36 | #include "control.h" | 36 | #include "control.h" |
37 | 37 | ||
38 | #define VP_IDLE_TIMEOUT 200 | 38 | #include "voltage.h" |
39 | #define VP_TRANXDONE_TIMEOUT 300 | 39 | |
40 | #include "vc.h" | ||
41 | #include "vp.h" | ||
42 | |||
40 | #define VOLTAGE_DIR_SIZE 16 | 43 | #define VOLTAGE_DIR_SIZE 16 |
41 | 44 | ||
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 | 45 | ||
120 | /** | 46 | static struct omap_vdd_info **vdd_info; |
121 | * omap_vdd_info - Per Voltage Domain info | 47 | |
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 | /* | 48 | /* |
161 | * Number of scalable voltage domains. | 49 | * Number of scalable voltage domains. |
162 | */ | 50 | */ |
163 | static int nr_scalable_vdd; | 51 | static int nr_scalable_vdd; |
164 | 52 | ||
165 | /* OMAP3 VDD sturctures */ | 53 | /* XXX document */ |
166 | static struct omap_vdd_info omap3_vdd_info[] = { | 54 | static s16 prm_mod_offs; |
167 | { | 55 | static s16 prm_irqst_ocp_mod_offs; |
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 | 56 | ||
311 | static struct dentry *voltage_dir; | 57 | static struct dentry *voltage_dir; |
312 | 58 | ||
313 | /* Init function pointers */ | 59 | /* Init function pointers */ |
314 | static void (*vc_init) (struct omap_vdd_info *vdd); | 60 | static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, |
315 | static int (*vdd_data_configure) (struct omap_vdd_info *vdd); | 61 | unsigned long target_volt); |
316 | 62 | ||
317 | static u32 omap3_voltage_read_reg(u16 mod, u8 offset) | 63 | static u32 omap3_voltage_read_reg(u16 mod, u8 offset) |
318 | { | 64 | { |
@@ -335,6 +81,62 @@ static void omap4_voltage_write_reg(u32 val, u16 mod, u8 offset) | |||
335 | omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, mod, offset); | 81 | omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, mod, offset); |
336 | } | 82 | } |
337 | 83 | ||
84 | static int __init _config_common_vdd_data(struct omap_vdd_info *vdd) | ||
85 | { | ||
86 | char *sys_ck_name; | ||
87 | struct clk *sys_ck; | ||
88 | u32 sys_clk_speed, timeout_val, waittime; | ||
89 | |||
90 | /* | ||
91 | * XXX Clockfw should handle this, or this should be in a | ||
92 | * struct record | ||
93 | */ | ||
94 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) | ||
95 | sys_ck_name = "sys_ck"; | ||
96 | else if (cpu_is_omap44xx()) | ||
97 | sys_ck_name = "sys_clkin_ck"; | ||
98 | else | ||
99 | return -EINVAL; | ||
100 | |||
101 | /* | ||
102 | * Sys clk rate is require to calculate vp timeout value and | ||
103 | * smpswaittimemin and smpswaittimemax. | ||
104 | */ | ||
105 | sys_ck = clk_get(NULL, sys_ck_name); | ||
106 | if (IS_ERR(sys_ck)) { | ||
107 | pr_warning("%s: Could not get the sys clk to calculate" | ||
108 | "various vdd_%s params\n", __func__, vdd->voltdm.name); | ||
109 | return -EINVAL; | ||
110 | } | ||
111 | sys_clk_speed = clk_get_rate(sys_ck); | ||
112 | clk_put(sys_ck); | ||
113 | /* Divide to avoid overflow */ | ||
114 | sys_clk_speed /= 1000; | ||
115 | |||
116 | /* Generic voltage parameters */ | ||
117 | vdd->curr_volt = 1200000; | ||
118 | vdd->volt_scale = vp_forceupdate_scale_voltage; | ||
119 | vdd->vp_enabled = false; | ||
120 | |||
121 | vdd->vp_rt_data.vpconfig_erroroffset = | ||
122 | (vdd->pmic_info->vp_erroroffset << | ||
123 | vdd->vp_data->vp_common->vpconfig_erroroffset_shift); | ||
124 | |||
125 | timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000; | ||
126 | vdd->vp_rt_data.vlimitto_timeout = timeout_val; | ||
127 | vdd->vp_rt_data.vlimitto_vddmin = vdd->pmic_info->vp_vddmin; | ||
128 | vdd->vp_rt_data.vlimitto_vddmax = vdd->pmic_info->vp_vddmax; | ||
129 | |||
130 | waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) * | ||
131 | sys_clk_speed) / 1000; | ||
132 | vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime; | ||
133 | vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime; | ||
134 | vdd->vp_rt_data.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin; | ||
135 | vdd->vp_rt_data.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax; | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | |||
338 | /* Voltage debugfs support */ | 140 | /* Voltage debugfs support */ |
339 | static int vp_volt_debug_get(void *data, u64 *val) | 141 | static int vp_volt_debug_get(void *data, u64 *val) |
340 | { | 142 | { |
@@ -346,7 +148,7 @@ static int vp_volt_debug_get(void *data, u64 *val) | |||
346 | return -EINVAL; | 148 | return -EINVAL; |
347 | } | 149 | } |
348 | 150 | ||
349 | vsel = vdd->read_reg(vdd->vp_reg.prm_mod, vdd->vp_offs.voltage); | 151 | vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage); |
350 | pr_notice("curr_vsel = %x\n", vsel); | 152 | pr_notice("curr_vsel = %x\n", vsel); |
351 | 153 | ||
352 | if (!vdd->pmic_info->vsel_to_uv) { | 154 | if (!vdd->pmic_info->vsel_to_uv) { |
@@ -379,7 +181,6 @@ DEFINE_SIMPLE_ATTRIBUTE(nom_volt_debug_fops, nom_volt_debug_get, NULL, | |||
379 | static void vp_latch_vsel(struct omap_vdd_info *vdd) | 181 | static void vp_latch_vsel(struct omap_vdd_info *vdd) |
380 | { | 182 | { |
381 | u32 vpconfig; | 183 | u32 vpconfig; |
382 | u16 mod; | ||
383 | unsigned long uvdc; | 184 | unsigned long uvdc; |
384 | char vsel; | 185 | char vsel; |
385 | 186 | ||
@@ -396,30 +197,27 @@ static void vp_latch_vsel(struct omap_vdd_info *vdd) | |||
396 | return; | 197 | return; |
397 | } | 198 | } |
398 | 199 | ||
399 | mod = vdd->vp_reg.prm_mod; | ||
400 | |||
401 | vsel = vdd->pmic_info->uv_to_vsel(uvdc); | 200 | vsel = vdd->pmic_info->uv_to_vsel(uvdc); |
402 | 201 | ||
403 | vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); | 202 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); |
404 | vpconfig &= ~(vdd->vp_reg.vpconfig_initvoltage_mask | | 203 | vpconfig &= ~(vdd->vp_data->vp_common->vpconfig_initvoltage_mask | |
405 | vdd->vp_reg.vpconfig_initvdd); | 204 | vdd->vp_data->vp_common->vpconfig_initvdd); |
406 | vpconfig |= vsel << vdd->vp_reg.vpconfig_initvoltage_shift; | 205 | vpconfig |= vsel << vdd->vp_data->vp_common->vpconfig_initvoltage_shift; |
407 | 206 | ||
408 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 207 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
409 | 208 | ||
410 | /* Trigger initVDD value copy to voltage processor */ | 209 | /* Trigger initVDD value copy to voltage processor */ |
411 | vdd->write_reg((vpconfig | vdd->vp_reg.vpconfig_initvdd), mod, | 210 | vdd->write_reg((vpconfig | vdd->vp_data->vp_common->vpconfig_initvdd), |
412 | vdd->vp_offs.vpconfig); | 211 | prm_mod_offs, vdd->vp_data->vpconfig); |
413 | 212 | ||
414 | /* Clear initVDD copy trigger bit */ | 213 | /* Clear initVDD copy trigger bit */ |
415 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 214 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
416 | } | 215 | } |
417 | 216 | ||
418 | /* Generic voltage init functions */ | 217 | /* Generic voltage init functions */ |
419 | static void __init vp_init(struct omap_vdd_info *vdd) | 218 | static void __init vp_init(struct omap_vdd_info *vdd) |
420 | { | 219 | { |
421 | u32 vp_val; | 220 | u32 vp_val; |
422 | u16 mod; | ||
423 | 221 | ||
424 | if (!vdd->read_reg || !vdd->write_reg) { | 222 | if (!vdd->read_reg || !vdd->write_reg) { |
425 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | 223 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", |
@@ -427,33 +225,31 @@ static void __init vp_init(struct omap_vdd_info *vdd) | |||
427 | return; | 225 | return; |
428 | } | 226 | } |
429 | 227 | ||
430 | mod = vdd->vp_reg.prm_mod; | 228 | vp_val = vdd->vp_rt_data.vpconfig_erroroffset | |
431 | 229 | (vdd->vp_rt_data.vpconfig_errorgain << | |
432 | vp_val = vdd->vp_reg.vpconfig_erroroffset | | 230 | vdd->vp_data->vp_common->vpconfig_errorgain_shift) | |
433 | (vdd->vp_reg.vpconfig_errorgain << | 231 | vdd->vp_data->vp_common->vpconfig_timeouten; |
434 | vdd->vp_reg.vpconfig_errorgain_shift) | | 232 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vpconfig); |
435 | vdd->vp_reg.vpconfig_timeouten; | 233 | |
436 | vdd->write_reg(vp_val, mod, vdd->vp_offs.vpconfig); | 234 | vp_val = ((vdd->vp_rt_data.vstepmin_smpswaittimemin << |
437 | 235 | vdd->vp_data->vp_common->vstepmin_smpswaittimemin_shift) | | |
438 | vp_val = ((vdd->vp_reg.vstepmin_smpswaittimemin << | 236 | (vdd->vp_rt_data.vstepmin_stepmin << |
439 | vdd->vp_reg.vstepmin_smpswaittimemin_shift) | | 237 | vdd->vp_data->vp_common->vstepmin_stepmin_shift)); |
440 | (vdd->vp_reg.vstepmin_stepmin << | 238 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vstepmin); |
441 | vdd->vp_reg.vstepmin_stepmin_shift)); | 239 | |
442 | vdd->write_reg(vp_val, mod, vdd->vp_offs.vstepmin); | 240 | vp_val = ((vdd->vp_rt_data.vstepmax_smpswaittimemax << |
443 | 241 | vdd->vp_data->vp_common->vstepmax_smpswaittimemax_shift) | | |
444 | vp_val = ((vdd->vp_reg.vstepmax_smpswaittimemax << | 242 | (vdd->vp_rt_data.vstepmax_stepmax << |
445 | vdd->vp_reg.vstepmax_smpswaittimemax_shift) | | 243 | vdd->vp_data->vp_common->vstepmax_stepmax_shift)); |
446 | (vdd->vp_reg.vstepmax_stepmax << | 244 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vstepmax); |
447 | vdd->vp_reg.vstepmax_stepmax_shift)); | 245 | |
448 | vdd->write_reg(vp_val, mod, vdd->vp_offs.vstepmax); | 246 | vp_val = ((vdd->vp_rt_data.vlimitto_vddmax << |
449 | 247 | vdd->vp_data->vp_common->vlimitto_vddmax_shift) | | |
450 | vp_val = ((vdd->vp_reg.vlimitto_vddmax << | 248 | (vdd->vp_rt_data.vlimitto_vddmin << |
451 | vdd->vp_reg.vlimitto_vddmax_shift) | | 249 | vdd->vp_data->vp_common->vlimitto_vddmin_shift) | |
452 | (vdd->vp_reg.vlimitto_vddmin << | 250 | (vdd->vp_rt_data.vlimitto_timeout << |
453 | vdd->vp_reg.vlimitto_vddmin_shift) | | 251 | vdd->vp_data->vp_common->vlimitto_timeout_shift)); |
454 | (vdd->vp_reg.vlimitto_timeout << | 252 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vlimitto); |
455 | vdd->vp_reg.vlimitto_timeout_shift)); | ||
456 | vdd->write_reg(vp_val, mod, vdd->vp_offs.vlimitto); | ||
457 | } | 253 | } |
458 | 254 | ||
459 | static void __init vdd_debugfs_init(struct omap_vdd_info *vdd) | 255 | static void __init vdd_debugfs_init(struct omap_vdd_info *vdd) |
@@ -480,23 +276,23 @@ static void __init vdd_debugfs_init(struct omap_vdd_info *vdd) | |||
480 | } | 276 | } |
481 | 277 | ||
482 | (void) debugfs_create_x16("vp_errorgain", S_IRUGO, vdd->debug_dir, | 278 | (void) debugfs_create_x16("vp_errorgain", S_IRUGO, vdd->debug_dir, |
483 | &(vdd->vp_reg.vpconfig_errorgain)); | 279 | &(vdd->vp_rt_data.vpconfig_errorgain)); |
484 | (void) debugfs_create_x16("vp_smpswaittimemin", S_IRUGO, | 280 | (void) debugfs_create_x16("vp_smpswaittimemin", S_IRUGO, |
485 | vdd->debug_dir, | 281 | vdd->debug_dir, |
486 | &(vdd->vp_reg.vstepmin_smpswaittimemin)); | 282 | &(vdd->vp_rt_data.vstepmin_smpswaittimemin)); |
487 | (void) debugfs_create_x8("vp_stepmin", S_IRUGO, vdd->debug_dir, | 283 | (void) debugfs_create_x8("vp_stepmin", S_IRUGO, vdd->debug_dir, |
488 | &(vdd->vp_reg.vstepmin_stepmin)); | 284 | &(vdd->vp_rt_data.vstepmin_stepmin)); |
489 | (void) debugfs_create_x16("vp_smpswaittimemax", S_IRUGO, | 285 | (void) debugfs_create_x16("vp_smpswaittimemax", S_IRUGO, |
490 | vdd->debug_dir, | 286 | vdd->debug_dir, |
491 | &(vdd->vp_reg.vstepmax_smpswaittimemax)); | 287 | &(vdd->vp_rt_data.vstepmax_smpswaittimemax)); |
492 | (void) debugfs_create_x8("vp_stepmax", S_IRUGO, vdd->debug_dir, | 288 | (void) debugfs_create_x8("vp_stepmax", S_IRUGO, vdd->debug_dir, |
493 | &(vdd->vp_reg.vstepmax_stepmax)); | 289 | &(vdd->vp_rt_data.vstepmax_stepmax)); |
494 | (void) debugfs_create_x8("vp_vddmax", S_IRUGO, vdd->debug_dir, | 290 | (void) debugfs_create_x8("vp_vddmax", S_IRUGO, vdd->debug_dir, |
495 | &(vdd->vp_reg.vlimitto_vddmax)); | 291 | &(vdd->vp_rt_data.vlimitto_vddmax)); |
496 | (void) debugfs_create_x8("vp_vddmin", S_IRUGO, vdd->debug_dir, | 292 | (void) debugfs_create_x8("vp_vddmin", S_IRUGO, vdd->debug_dir, |
497 | &(vdd->vp_reg.vlimitto_vddmin)); | 293 | &(vdd->vp_rt_data.vlimitto_vddmin)); |
498 | (void) debugfs_create_x16("vp_timeout", S_IRUGO, vdd->debug_dir, | 294 | (void) debugfs_create_x16("vp_timeout", S_IRUGO, vdd->debug_dir, |
499 | &(vdd->vp_reg.vlimitto_timeout)); | 295 | &(vdd->vp_rt_data.vlimitto_timeout)); |
500 | (void) debugfs_create_file("curr_vp_volt", S_IRUGO, vdd->debug_dir, | 296 | (void) debugfs_create_file("curr_vp_volt", S_IRUGO, vdd->debug_dir, |
501 | (void *) vdd, &vp_volt_debug_fops); | 297 | (void *) vdd, &vp_volt_debug_fops); |
502 | (void) debugfs_create_file("curr_nominal_volt", S_IRUGO, | 298 | (void) debugfs_create_file("curr_nominal_volt", S_IRUGO, |
@@ -509,8 +305,12 @@ static int _pre_volt_scale(struct omap_vdd_info *vdd, | |||
509 | unsigned long target_volt, u8 *target_vsel, u8 *current_vsel) | 305 | unsigned long target_volt, u8 *target_vsel, u8 *current_vsel) |
510 | { | 306 | { |
511 | struct omap_volt_data *volt_data; | 307 | struct omap_volt_data *volt_data; |
308 | const struct omap_vc_common_data *vc_common; | ||
309 | const struct omap_vp_common_data *vp_common; | ||
512 | u32 vc_cmdval, vp_errgain_val; | 310 | u32 vc_cmdval, vp_errgain_val; |
513 | u16 vp_mod, vc_mod; | 311 | |
312 | vc_common = vdd->vc_data->vc_common; | ||
313 | vp_common = vdd->vp_data->vp_common; | ||
514 | 314 | ||
515 | /* Check if suffiecient pmic info is available for this vdd */ | 315 | /* Check if suffiecient pmic info is available for this vdd */ |
516 | if (!vdd->pmic_info) { | 316 | if (!vdd->pmic_info) { |
@@ -532,33 +332,30 @@ static int _pre_volt_scale(struct omap_vdd_info *vdd, | |||
532 | return -EINVAL; | 332 | return -EINVAL; |
533 | } | 333 | } |
534 | 334 | ||
535 | vp_mod = vdd->vp_reg.prm_mod; | ||
536 | vc_mod = vdd->vc_reg.prm_mod; | ||
537 | |||
538 | /* Get volt_data corresponding to target_volt */ | 335 | /* Get volt_data corresponding to target_volt */ |
539 | volt_data = omap_voltage_get_voltdata(&vdd->voltdm, target_volt); | 336 | volt_data = omap_voltage_get_voltdata(&vdd->voltdm, target_volt); |
540 | if (IS_ERR(volt_data)) | 337 | if (IS_ERR(volt_data)) |
541 | volt_data = NULL; | 338 | volt_data = NULL; |
542 | 339 | ||
543 | *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt); | 340 | *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt); |
544 | *current_vsel = vdd->read_reg(vp_mod, vdd->vp_offs.voltage); | 341 | *current_vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage); |
545 | 342 | ||
546 | /* Setting the ON voltage to the new target voltage */ | 343 | /* Setting the ON voltage to the new target voltage */ |
547 | vc_cmdval = vdd->read_reg(vc_mod, vdd->vc_reg.cmdval_reg); | 344 | vc_cmdval = vdd->read_reg(prm_mod_offs, vdd->vc_data->cmdval_reg); |
548 | vc_cmdval &= ~vdd->vc_reg.cmd_on_mask; | 345 | vc_cmdval &= ~vc_common->cmd_on_mask; |
549 | vc_cmdval |= (*target_vsel << vdd->vc_reg.cmd_on_shift); | 346 | vc_cmdval |= (*target_vsel << vc_common->cmd_on_shift); |
550 | vdd->write_reg(vc_cmdval, vc_mod, vdd->vc_reg.cmdval_reg); | 347 | vdd->write_reg(vc_cmdval, prm_mod_offs, vdd->vc_data->cmdval_reg); |
551 | 348 | ||
552 | /* Setting vp errorgain based on the voltage */ | 349 | /* Setting vp errorgain based on the voltage */ |
553 | if (volt_data) { | 350 | if (volt_data) { |
554 | vp_errgain_val = vdd->read_reg(vp_mod, | 351 | vp_errgain_val = vdd->read_reg(prm_mod_offs, |
555 | vdd->vp_offs.vpconfig); | 352 | vdd->vp_data->vpconfig); |
556 | vdd->vp_reg.vpconfig_errorgain = volt_data->vp_errgain; | 353 | vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain; |
557 | vp_errgain_val &= ~vdd->vp_reg.vpconfig_errorgain_mask; | 354 | vp_errgain_val &= ~vp_common->vpconfig_errorgain_mask; |
558 | vp_errgain_val |= vdd->vp_reg.vpconfig_errorgain << | 355 | vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain << |
559 | vdd->vp_reg.vpconfig_errorgain_shift; | 356 | vp_common->vpconfig_errorgain_shift; |
560 | vdd->write_reg(vp_errgain_val, vp_mod, | 357 | vdd->write_reg(vp_errgain_val, prm_mod_offs, |
561 | vdd->vp_offs.vpconfig); | 358 | vdd->vp_data->vpconfig); |
562 | } | 359 | } |
563 | 360 | ||
564 | return 0; | 361 | return 0; |
@@ -584,7 +381,6 @@ static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd, | |||
584 | { | 381 | { |
585 | u32 loop_cnt = 0, retries_cnt = 0; | 382 | u32 loop_cnt = 0, retries_cnt = 0; |
586 | u32 vc_valid, vc_bypass_val_reg, vc_bypass_value; | 383 | u32 vc_valid, vc_bypass_val_reg, vc_bypass_value; |
587 | u16 mod; | ||
588 | u8 target_vsel, current_vsel; | 384 | u8 target_vsel, current_vsel; |
589 | int ret; | 385 | int ret; |
590 | 386 | ||
@@ -592,20 +388,19 @@ static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd, | |||
592 | if (ret) | 388 | if (ret) |
593 | return ret; | 389 | return ret; |
594 | 390 | ||
595 | mod = vdd->vc_reg.prm_mod; | 391 | vc_valid = vdd->vc_data->vc_common->valid; |
596 | 392 | vc_bypass_val_reg = vdd->vc_data->vc_common->bypass_val_reg; | |
597 | vc_valid = vdd->vc_reg.valid; | 393 | vc_bypass_value = (target_vsel << vdd->vc_data->vc_common->data_shift) | |
598 | vc_bypass_val_reg = vdd->vc_reg.bypass_val_reg; | ||
599 | vc_bypass_value = (target_vsel << vdd->vc_reg.data_shift) | | ||
600 | (vdd->pmic_info->pmic_reg << | 394 | (vdd->pmic_info->pmic_reg << |
601 | vdd->vc_reg.regaddr_shift) | | 395 | vdd->vc_data->vc_common->regaddr_shift) | |
602 | (vdd->pmic_info->i2c_slave_addr << | 396 | (vdd->pmic_info->i2c_slave_addr << |
603 | vdd->vc_reg.slaveaddr_shift); | 397 | vdd->vc_data->vc_common->slaveaddr_shift); |
604 | 398 | ||
605 | vdd->write_reg(vc_bypass_value, mod, vc_bypass_val_reg); | 399 | vdd->write_reg(vc_bypass_value, prm_mod_offs, vc_bypass_val_reg); |
606 | vdd->write_reg(vc_bypass_value | vc_valid, mod, vc_bypass_val_reg); | 400 | vdd->write_reg(vc_bypass_value | vc_valid, prm_mod_offs, |
401 | vc_bypass_val_reg); | ||
607 | 402 | ||
608 | vc_bypass_value = vdd->read_reg(mod, vc_bypass_val_reg); | 403 | vc_bypass_value = vdd->read_reg(prm_mod_offs, vc_bypass_val_reg); |
609 | /* | 404 | /* |
610 | * Loop till the bypass command is acknowledged from the SMPS. | 405 | * Loop till the bypass command is acknowledged from the SMPS. |
611 | * NOTE: This is legacy code. The loop count and retry count needs | 406 | * NOTE: This is legacy code. The loop count and retry count needs |
@@ -624,7 +419,8 @@ static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd, | |||
624 | loop_cnt = 0; | 419 | loop_cnt = 0; |
625 | udelay(10); | 420 | udelay(10); |
626 | } | 421 | } |
627 | vc_bypass_value = vdd->read_reg(mod, vc_bypass_val_reg); | 422 | vc_bypass_value = vdd->read_reg(prm_mod_offs, |
423 | vc_bypass_val_reg); | ||
628 | } | 424 | } |
629 | 425 | ||
630 | _post_volt_scale(vdd, target_volt, target_vsel, current_vsel); | 426 | _post_volt_scale(vdd, target_volt, target_vsel, current_vsel); |
@@ -636,7 +432,6 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | |||
636 | unsigned long target_volt) | 432 | unsigned long target_volt) |
637 | { | 433 | { |
638 | u32 vpconfig; | 434 | u32 vpconfig; |
639 | u16 mod, ocp_mod; | ||
640 | u8 target_vsel, current_vsel, prm_irqst_reg; | 435 | u8 target_vsel, current_vsel, prm_irqst_reg; |
641 | int ret, timeout = 0; | 436 | int ret, timeout = 0; |
642 | 437 | ||
@@ -644,20 +439,18 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | |||
644 | if (ret) | 439 | if (ret) |
645 | return ret; | 440 | return ret; |
646 | 441 | ||
647 | mod = vdd->vp_reg.prm_mod; | 442 | prm_irqst_reg = vdd->vp_data->prm_irqst_data->prm_irqst_reg; |
648 | ocp_mod = vdd->ocp_mod; | ||
649 | prm_irqst_reg = vdd->prm_irqst_reg; | ||
650 | 443 | ||
651 | /* | 444 | /* |
652 | * Clear all pending TransactionDone interrupt/status. Typical latency | 445 | * Clear all pending TransactionDone interrupt/status. Typical latency |
653 | * is <3us | 446 | * is <3us |
654 | */ | 447 | */ |
655 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { | 448 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { |
656 | vdd->write_reg(vdd->vp_reg.tranxdone_status, | 449 | vdd->write_reg(vdd->vp_data->prm_irqst_data->tranxdone_status, |
657 | ocp_mod, prm_irqst_reg); | 450 | prm_irqst_ocp_mod_offs, prm_irqst_reg); |
658 | if (!(vdd->read_reg(ocp_mod, prm_irqst_reg) & | 451 | if (!(vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) & |
659 | vdd->vp_reg.tranxdone_status)) | 452 | vdd->vp_data->prm_irqst_data->tranxdone_status)) |
660 | break; | 453 | break; |
661 | udelay(1); | 454 | udelay(1); |
662 | } | 455 | } |
663 | if (timeout >= VP_TRANXDONE_TIMEOUT) { | 456 | if (timeout >= VP_TRANXDONE_TIMEOUT) { |
@@ -667,30 +460,30 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | |||
667 | } | 460 | } |
668 | 461 | ||
669 | /* Configure for VP-Force Update */ | 462 | /* Configure for VP-Force Update */ |
670 | vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); | 463 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); |
671 | vpconfig &= ~(vdd->vp_reg.vpconfig_initvdd | | 464 | vpconfig &= ~(vdd->vp_data->vp_common->vpconfig_initvdd | |
672 | vdd->vp_reg.vpconfig_forceupdate | | 465 | vdd->vp_data->vp_common->vpconfig_forceupdate | |
673 | vdd->vp_reg.vpconfig_initvoltage_mask); | 466 | vdd->vp_data->vp_common->vpconfig_initvoltage_mask); |
674 | vpconfig |= ((target_vsel << | 467 | vpconfig |= ((target_vsel << |
675 | vdd->vp_reg.vpconfig_initvoltage_shift)); | 468 | vdd->vp_data->vp_common->vpconfig_initvoltage_shift)); |
676 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 469 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
677 | 470 | ||
678 | /* Trigger initVDD value copy to voltage processor */ | 471 | /* Trigger initVDD value copy to voltage processor */ |
679 | vpconfig |= vdd->vp_reg.vpconfig_initvdd; | 472 | vpconfig |= vdd->vp_data->vp_common->vpconfig_initvdd; |
680 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 473 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
681 | 474 | ||
682 | /* Force update of voltage */ | 475 | /* Force update of voltage */ |
683 | vpconfig |= vdd->vp_reg.vpconfig_forceupdate; | 476 | vpconfig |= vdd->vp_data->vp_common->vpconfig_forceupdate; |
684 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 477 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
685 | 478 | ||
686 | /* | 479 | /* |
687 | * Wait for TransactionDone. Typical latency is <200us. | 480 | * Wait for TransactionDone. Typical latency is <200us. |
688 | * Depends on SMPSWAITTIMEMIN/MAX and voltage change | 481 | * Depends on SMPSWAITTIMEMIN/MAX and voltage change |
689 | */ | 482 | */ |
690 | timeout = 0; | 483 | timeout = 0; |
691 | omap_test_timeout((vdd->read_reg(ocp_mod, prm_irqst_reg) & | 484 | omap_test_timeout((vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) & |
692 | vdd->vp_reg.tranxdone_status), | 485 | vdd->vp_data->prm_irqst_data->tranxdone_status), |
693 | VP_TRANXDONE_TIMEOUT, timeout); | 486 | VP_TRANXDONE_TIMEOUT, timeout); |
694 | if (timeout >= VP_TRANXDONE_TIMEOUT) | 487 | if (timeout >= VP_TRANXDONE_TIMEOUT) |
695 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded." | 488 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded." |
696 | "TRANXDONE never got set after the voltage update\n", | 489 | "TRANXDONE never got set after the voltage update\n", |
@@ -704,11 +497,11 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | |||
704 | */ | 497 | */ |
705 | timeout = 0; | 498 | timeout = 0; |
706 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { | 499 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { |
707 | vdd->write_reg(vdd->vp_reg.tranxdone_status, | 500 | vdd->write_reg(vdd->vp_data->prm_irqst_data->tranxdone_status, |
708 | ocp_mod, prm_irqst_reg); | 501 | prm_irqst_ocp_mod_offs, prm_irqst_reg); |
709 | if (!(vdd->read_reg(ocp_mod, prm_irqst_reg) & | 502 | if (!(vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) & |
710 | vdd->vp_reg.tranxdone_status)) | 503 | vdd->vp_data->prm_irqst_data->tranxdone_status)) |
711 | break; | 504 | break; |
712 | udelay(1); | 505 | udelay(1); |
713 | } | 506 | } |
714 | 507 | ||
@@ -717,222 +510,95 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | |||
717 | "to clear the TRANXDONE status\n", | 510 | "to clear the TRANXDONE status\n", |
718 | __func__, vdd->voltdm.name); | 511 | __func__, vdd->voltdm.name); |
719 | 512 | ||
720 | vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); | 513 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); |
721 | /* Clear initVDD copy trigger bit */ | 514 | /* Clear initVDD copy trigger bit */ |
722 | vpconfig &= ~vdd->vp_reg.vpconfig_initvdd;; | 515 | vpconfig &= ~vdd->vp_data->vp_common->vpconfig_initvdd; |
723 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 516 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
724 | /* Clear force bit */ | 517 | /* Clear force bit */ |
725 | vpconfig &= ~vdd->vp_reg.vpconfig_forceupdate; | 518 | vpconfig &= ~vdd->vp_data->vp_common->vpconfig_forceupdate; |
726 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 519 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
727 | 520 | ||
728 | return 0; | 521 | return 0; |
729 | } | 522 | } |
730 | 523 | ||
731 | /* OMAP3 specific voltage init functions */ | 524 | static void __init omap3_vfsm_init(struct omap_vdd_info *vdd) |
525 | { | ||
526 | /* | ||
527 | * Voltage Manager FSM parameters init | ||
528 | * XXX This data should be passed in from the board file | ||
529 | */ | ||
530 | vdd->write_reg(OMAP3_CLKSETUP, prm_mod_offs, OMAP3_PRM_CLKSETUP_OFFSET); | ||
531 | vdd->write_reg(OMAP3_VOLTOFFSET, prm_mod_offs, | ||
532 | OMAP3_PRM_VOLTOFFSET_OFFSET); | ||
533 | vdd->write_reg(OMAP3_VOLTSETUP2, prm_mod_offs, | ||
534 | OMAP3_PRM_VOLTSETUP2_OFFSET); | ||
535 | } | ||
732 | 536 | ||
733 | /* | ||
734 | * Intializes the voltage controller registers with the PMIC and board | ||
735 | * specific parameters and voltage setup times for OMAP3. | ||
736 | */ | ||
737 | static void __init omap3_vc_init(struct omap_vdd_info *vdd) | 537 | static void __init omap3_vc_init(struct omap_vdd_info *vdd) |
738 | { | 538 | { |
739 | u32 vc_val; | ||
740 | u16 mod; | ||
741 | u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; | ||
742 | static bool is_initialized; | 539 | static bool is_initialized; |
540 | u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; | ||
541 | u32 vc_val; | ||
743 | 542 | ||
744 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { | 543 | if (is_initialized) |
745 | pr_err("%s: PMIC info requried to configure vc for" | ||
746 | "vdd_%s not populated.Hence cannot initialize vc\n", | ||
747 | __func__, vdd->voltdm.name); | ||
748 | return; | ||
749 | } | ||
750 | |||
751 | if (!vdd->read_reg || !vdd->write_reg) { | ||
752 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
753 | __func__, vdd->voltdm.name); | ||
754 | return; | 544 | return; |
755 | } | ||
756 | |||
757 | mod = vdd->vc_reg.prm_mod; | ||
758 | |||
759 | /* Set up the SMPS_SA(i2c slave address in VC */ | ||
760 | vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_sa_reg); | ||
761 | vc_val &= ~vdd->vc_reg.smps_sa_mask; | ||
762 | vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_reg.smps_sa_shift; | ||
763 | vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_sa_reg); | ||
764 | |||
765 | /* Setup the VOLRA(pmic reg addr) in VC */ | ||
766 | vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_volra_reg); | ||
767 | vc_val &= ~vdd->vc_reg.smps_volra_mask; | ||
768 | vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_reg.smps_volra_shift; | ||
769 | vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_volra_reg); | ||
770 | |||
771 | /*Configure the setup times */ | ||
772 | vc_val = vdd->read_reg(mod, vdd->vc_reg.voltsetup_reg); | ||
773 | vc_val &= ~vdd->vc_reg.voltsetup_mask; | ||
774 | vc_val |= vdd->pmic_info->volt_setup_time << | ||
775 | vdd->vc_reg.voltsetup_shift; | ||
776 | vdd->write_reg(vc_val, mod, vdd->vc_reg.voltsetup_reg); | ||
777 | 545 | ||
778 | /* Set up the on, inactive, retention and off voltage */ | 546 | /* Set up the on, inactive, retention and off voltage */ |
779 | on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); | 547 | on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); |
780 | onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); | 548 | onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); |
781 | ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); | 549 | ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); |
782 | off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); | 550 | off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); |
783 | vc_val = ((on_vsel << vdd->vc_reg.cmd_on_shift) | | 551 | vc_val = ((on_vsel << vdd->vc_data->vc_common->cmd_on_shift) | |
784 | (onlp_vsel << vdd->vc_reg.cmd_onlp_shift) | | 552 | (onlp_vsel << vdd->vc_data->vc_common->cmd_onlp_shift) | |
785 | (ret_vsel << vdd->vc_reg.cmd_ret_shift) | | 553 | (ret_vsel << vdd->vc_data->vc_common->cmd_ret_shift) | |
786 | (off_vsel << vdd->vc_reg.cmd_off_shift)); | 554 | (off_vsel << vdd->vc_data->vc_common->cmd_off_shift)); |
787 | vdd->write_reg(vc_val, mod, vdd->vc_reg.cmdval_reg); | 555 | vdd->write_reg(vc_val, prm_mod_offs, vdd->vc_data->cmdval_reg); |
788 | |||
789 | if (is_initialized) | ||
790 | return; | ||
791 | 556 | ||
792 | /* Generic VC parameters init */ | 557 | /* |
793 | vdd->write_reg(OMAP3430_CMD1_MASK | OMAP3430_RAV1_MASK, mod, | 558 | * Generic VC parameters init |
559 | * XXX This data should be abstracted out | ||
560 | */ | ||
561 | vdd->write_reg(OMAP3430_CMD1_MASK | OMAP3430_RAV1_MASK, prm_mod_offs, | ||
794 | OMAP3_PRM_VC_CH_CONF_OFFSET); | 562 | OMAP3_PRM_VC_CH_CONF_OFFSET); |
795 | vdd->write_reg(OMAP3430_MCODE_SHIFT | OMAP3430_HSEN_MASK, mod, | 563 | vdd->write_reg(OMAP3430_MCODE_SHIFT | OMAP3430_HSEN_MASK, prm_mod_offs, |
796 | OMAP3_PRM_VC_I2C_CFG_OFFSET); | 564 | OMAP3_PRM_VC_I2C_CFG_OFFSET); |
797 | vdd->write_reg(OMAP3_CLKSETUP, mod, OMAP3_PRM_CLKSETUP_OFFSET); | 565 | |
798 | vdd->write_reg(OMAP3_VOLTOFFSET, mod, OMAP3_PRM_VOLTOFFSET_OFFSET); | 566 | omap3_vfsm_init(vdd); |
799 | vdd->write_reg(OMAP3_VOLTSETUP2, mod, OMAP3_PRM_VOLTSETUP2_OFFSET); | 567 | |
800 | is_initialized = true; | 568 | is_initialized = true; |
801 | } | 569 | } |
802 | 570 | ||
803 | /* Sets up all the VDD related info for OMAP3 */ | 571 | |
804 | static int __init omap3_vdd_data_configure(struct omap_vdd_info *vdd) | 572 | /* OMAP4 specific voltage init functions */ |
573 | static void __init omap4_vc_init(struct omap_vdd_info *vdd) | ||
805 | { | 574 | { |
806 | struct clk *sys_ck; | 575 | static bool is_initialized; |
807 | u32 sys_clk_speed, timeout_val, waittime; | 576 | u32 vc_val; |
808 | 577 | ||
809 | if (!vdd->pmic_info) { | 578 | if (is_initialized) |
810 | pr_err("%s: PMIC info requried to configure vdd_%s not" | 579 | return; |
811 | "populated.Hence cannot initialize vdd_%s\n", | ||
812 | __func__, vdd->voltdm.name, vdd->voltdm.name); | ||
813 | return -EINVAL; | ||
814 | } | ||
815 | 580 | ||
816 | if (!strcmp(vdd->voltdm.name, "mpu")) { | 581 | /* TODO: Configure setup times and CMD_VAL values*/ |
817 | if (cpu_is_omap3630()) | ||
818 | vdd->volt_data = omap36xx_vddmpu_volt_data; | ||
819 | else | ||
820 | vdd->volt_data = omap34xx_vddmpu_volt_data; | ||
821 | |||
822 | vdd->vp_reg.tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK; | ||
823 | vdd->vc_reg.cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET; | ||
824 | vdd->vc_reg.smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT; | ||
825 | vdd->vc_reg.smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK; | ||
826 | vdd->vc_reg.smps_volra_shift = OMAP3430_VOLRA0_SHIFT; | ||
827 | vdd->vc_reg.smps_volra_mask = OMAP3430_VOLRA0_MASK; | ||
828 | vdd->vc_reg.voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT; | ||
829 | vdd->vc_reg.voltsetup_mask = OMAP3430_SETUP_TIME1_MASK; | ||
830 | } else if (!strcmp(vdd->voltdm.name, "core")) { | ||
831 | if (cpu_is_omap3630()) | ||
832 | vdd->volt_data = omap36xx_vddcore_volt_data; | ||
833 | else | ||
834 | vdd->volt_data = omap34xx_vddcore_volt_data; | ||
835 | |||
836 | vdd->vp_reg.tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK; | ||
837 | vdd->vc_reg.cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET; | ||
838 | vdd->vc_reg.smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT; | ||
839 | vdd->vc_reg.smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK; | ||
840 | vdd->vc_reg.smps_volra_shift = OMAP3430_VOLRA1_SHIFT; | ||
841 | vdd->vc_reg.smps_volra_mask = OMAP3430_VOLRA1_MASK; | ||
842 | vdd->vc_reg.voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT; | ||
843 | vdd->vc_reg.voltsetup_mask = OMAP3430_SETUP_TIME2_MASK; | ||
844 | } else { | ||
845 | pr_warning("%s: vdd_%s does not exisit in OMAP3\n", | ||
846 | __func__, vdd->voltdm.name); | ||
847 | return -EINVAL; | ||
848 | } | ||
849 | 582 | ||
850 | /* | 583 | /* |
851 | * Sys clk rate is require to calculate vp timeout value and | 584 | * Generic VC parameters init |
852 | * smpswaittimemin and smpswaittimemax. | 585 | * XXX This data should be abstracted out |
853 | */ | 586 | */ |
854 | sys_ck = clk_get(NULL, "sys_ck"); | 587 | vc_val = (OMAP4430_RAV_VDD_MPU_L_MASK | OMAP4430_CMD_VDD_MPU_L_MASK | |
855 | if (IS_ERR(sys_ck)) { | 588 | OMAP4430_RAV_VDD_IVA_L_MASK | OMAP4430_CMD_VDD_IVA_L_MASK | |
856 | pr_warning("%s: Could not get the sys clk to calculate" | 589 | OMAP4430_RAV_VDD_CORE_L_MASK | OMAP4430_CMD_VDD_CORE_L_MASK); |
857 | "various vdd_%s params\n", __func__, vdd->voltdm.name); | 590 | vdd->write_reg(vc_val, prm_mod_offs, OMAP4_PRM_VC_CFG_CHANNEL_OFFSET); |
858 | return -EINVAL; | ||
859 | } | ||
860 | sys_clk_speed = clk_get_rate(sys_ck); | ||
861 | clk_put(sys_ck); | ||
862 | /* Divide to avoid overflow */ | ||
863 | sys_clk_speed /= 1000; | ||
864 | |||
865 | /* Generic voltage parameters */ | ||
866 | vdd->curr_volt = 1200000; | ||
867 | vdd->ocp_mod = OCP_MOD; | ||
868 | vdd->prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET; | ||
869 | vdd->read_reg = omap3_voltage_read_reg; | ||
870 | vdd->write_reg = omap3_voltage_write_reg; | ||
871 | vdd->volt_scale = vp_forceupdate_scale_voltage; | ||
872 | vdd->vp_enabled = false; | ||
873 | 591 | ||
874 | /* VC parameters */ | 592 | /* XXX These are magic numbers and do not belong! */ |
875 | vdd->vc_reg.prm_mod = OMAP3430_GR_MOD; | 593 | vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT); |
876 | vdd->vc_reg.smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET; | 594 | vdd->write_reg(vc_val, prm_mod_offs, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET); |
877 | vdd->vc_reg.smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET; | ||
878 | vdd->vc_reg.bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET; | ||
879 | vdd->vc_reg.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET; | ||
880 | vdd->vc_reg.data_shift = OMAP3430_DATA_SHIFT; | ||
881 | vdd->vc_reg.slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT; | ||
882 | vdd->vc_reg.regaddr_shift = OMAP3430_REGADDR_SHIFT; | ||
883 | vdd->vc_reg.valid = OMAP3430_VALID_MASK; | ||
884 | vdd->vc_reg.cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT; | ||
885 | vdd->vc_reg.cmd_on_mask = OMAP3430_VC_CMD_ON_MASK; | ||
886 | vdd->vc_reg.cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT; | ||
887 | vdd->vc_reg.cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT; | ||
888 | vdd->vc_reg.cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT; | ||
889 | |||
890 | vdd->vp_reg.prm_mod = OMAP3430_GR_MOD; | ||
891 | |||
892 | /* VPCONFIG bit fields */ | ||
893 | vdd->vp_reg.vpconfig_erroroffset = (vdd->pmic_info->vp_erroroffset << | ||
894 | OMAP3430_ERROROFFSET_SHIFT); | ||
895 | vdd->vp_reg.vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK; | ||
896 | vdd->vp_reg.vpconfig_errorgain_shift = OMAP3430_ERRORGAIN_SHIFT; | ||
897 | vdd->vp_reg.vpconfig_initvoltage_shift = OMAP3430_INITVOLTAGE_SHIFT; | ||
898 | vdd->vp_reg.vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK; | ||
899 | vdd->vp_reg.vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK; | ||
900 | vdd->vp_reg.vpconfig_initvdd = OMAP3430_INITVDD_MASK; | ||
901 | vdd->vp_reg.vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK; | ||
902 | vdd->vp_reg.vpconfig_vpenable = OMAP3430_VPENABLE_MASK; | ||
903 | |||
904 | /* VSTEPMIN VSTEPMAX bit fields */ | ||
905 | waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) * | ||
906 | sys_clk_speed) / 1000; | ||
907 | vdd->vp_reg.vstepmin_smpswaittimemin = waittime; | ||
908 | vdd->vp_reg.vstepmax_smpswaittimemax = waittime; | ||
909 | vdd->vp_reg.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin; | ||
910 | vdd->vp_reg.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax; | ||
911 | vdd->vp_reg.vstepmin_smpswaittimemin_shift = | ||
912 | OMAP3430_SMPSWAITTIMEMIN_SHIFT; | ||
913 | vdd->vp_reg.vstepmax_smpswaittimemax_shift = | ||
914 | OMAP3430_SMPSWAITTIMEMAX_SHIFT; | ||
915 | vdd->vp_reg.vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT; | ||
916 | vdd->vp_reg.vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT; | ||
917 | |||
918 | /* VLIMITTO bit fields */ | ||
919 | timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000; | ||
920 | vdd->vp_reg.vlimitto_timeout = timeout_val; | ||
921 | vdd->vp_reg.vlimitto_vddmin = vdd->pmic_info->vp_vddmin; | ||
922 | vdd->vp_reg.vlimitto_vddmax = vdd->pmic_info->vp_vddmax; | ||
923 | vdd->vp_reg.vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT; | ||
924 | vdd->vp_reg.vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT; | ||
925 | vdd->vp_reg.vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT; | ||
926 | 595 | ||
927 | return 0; | 596 | is_initialized = true; |
928 | } | 597 | } |
929 | 598 | ||
930 | /* OMAP4 specific voltage init functions */ | 599 | static void __init omap_vc_init(struct omap_vdd_info *vdd) |
931 | static void __init omap4_vc_init(struct omap_vdd_info *vdd) | ||
932 | { | 600 | { |
933 | u32 vc_val; | 601 | u32 vc_val; |
934 | u16 mod; | ||
935 | static bool is_initialized; | ||
936 | 602 | ||
937 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { | 603 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { |
938 | pr_err("%s: PMIC info requried to configure vc for" | 604 | pr_err("%s: PMIC info requried to configure vc for" |
@@ -947,173 +613,61 @@ static void __init omap4_vc_init(struct omap_vdd_info *vdd) | |||
947 | return; | 613 | return; |
948 | } | 614 | } |
949 | 615 | ||
950 | mod = vdd->vc_reg.prm_mod; | ||
951 | |||
952 | /* Set up the SMPS_SA(i2c slave address in VC */ | 616 | /* Set up the SMPS_SA(i2c slave address in VC */ |
953 | vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_sa_reg); | 617 | vc_val = vdd->read_reg(prm_mod_offs, |
954 | vc_val &= ~vdd->vc_reg.smps_sa_mask; | 618 | vdd->vc_data->vc_common->smps_sa_reg); |
955 | vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_reg.smps_sa_shift; | 619 | vc_val &= ~vdd->vc_data->smps_sa_mask; |
956 | vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_sa_reg); | 620 | vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_data->smps_sa_shift; |
621 | vdd->write_reg(vc_val, prm_mod_offs, | ||
622 | vdd->vc_data->vc_common->smps_sa_reg); | ||
957 | 623 | ||
958 | /* Setup the VOLRA(pmic reg addr) in VC */ | 624 | /* Setup the VOLRA(pmic reg addr) in VC */ |
959 | vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_volra_reg); | 625 | vc_val = vdd->read_reg(prm_mod_offs, |
960 | vc_val &= ~vdd->vc_reg.smps_volra_mask; | 626 | vdd->vc_data->vc_common->smps_volra_reg); |
961 | vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_reg.smps_volra_shift; | 627 | vc_val &= ~vdd->vc_data->smps_volra_mask; |
962 | vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_volra_reg); | 628 | vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_data->smps_volra_shift; |
963 | 629 | vdd->write_reg(vc_val, prm_mod_offs, | |
964 | /* TODO: Configure setup times and CMD_VAL values*/ | 630 | vdd->vc_data->vc_common->smps_volra_reg); |
965 | 631 | ||
966 | if (is_initialized) | 632 | /* Configure the setup times */ |
967 | return; | 633 | vc_val = vdd->read_reg(prm_mod_offs, vdd->vfsm->voltsetup_reg); |
968 | 634 | vc_val &= ~vdd->vfsm->voltsetup_mask; | |
969 | /* Generic VC parameters init */ | 635 | vc_val |= vdd->pmic_info->volt_setup_time << |
970 | vc_val = (OMAP4430_RAV_VDD_MPU_L_MASK | OMAP4430_CMD_VDD_MPU_L_MASK | | 636 | vdd->vfsm->voltsetup_shift; |
971 | OMAP4430_RAV_VDD_IVA_L_MASK | OMAP4430_CMD_VDD_IVA_L_MASK | | 637 | vdd->write_reg(vc_val, prm_mod_offs, vdd->vfsm->voltsetup_reg); |
972 | OMAP4430_RAV_VDD_CORE_L_MASK | OMAP4430_CMD_VDD_CORE_L_MASK); | ||
973 | vdd->write_reg(vc_val, mod, OMAP4_PRM_VC_CFG_CHANNEL_OFFSET); | ||
974 | |||
975 | vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT); | ||
976 | vdd->write_reg(vc_val, mod, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET); | ||
977 | 638 | ||
978 | is_initialized = true; | 639 | if (cpu_is_omap34xx()) |
640 | omap3_vc_init(vdd); | ||
641 | else if (cpu_is_omap44xx()) | ||
642 | omap4_vc_init(vdd); | ||
979 | } | 643 | } |
980 | 644 | ||
981 | /* Sets up all the VDD related info for OMAP4 */ | 645 | static int __init omap_vdd_data_configure(struct omap_vdd_info *vdd) |
982 | static int __init omap4_vdd_data_configure(struct omap_vdd_info *vdd) | ||
983 | { | 646 | { |
984 | struct clk *sys_ck; | 647 | int ret = -EINVAL; |
985 | u32 sys_clk_speed, timeout_val, waittime; | ||
986 | 648 | ||
987 | if (!vdd->pmic_info) { | 649 | if (!vdd->pmic_info) { |
988 | pr_err("%s: PMIC info requried to configure vdd_%s not" | 650 | pr_err("%s: PMIC info requried to configure vdd_%s not" |
989 | "populated.Hence cannot initialize vdd_%s\n", | 651 | "populated.Hence cannot initialize vdd_%s\n", |
990 | __func__, vdd->voltdm.name, vdd->voltdm.name); | 652 | __func__, vdd->voltdm.name, vdd->voltdm.name); |
991 | return -EINVAL; | 653 | goto ovdc_out; |
992 | } | 654 | } |
993 | 655 | ||
994 | if (!strcmp(vdd->voltdm.name, "mpu")) { | 656 | if (IS_ERR_VALUE(_config_common_vdd_data(vdd))) |
995 | vdd->volt_data = omap44xx_vdd_mpu_volt_data; | 657 | goto ovdc_out; |
996 | vdd->vp_reg.tranxdone_status = | ||
997 | OMAP4430_VP_MPU_TRANXDONE_ST_MASK; | ||
998 | vdd->vc_reg.cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET; | ||
999 | vdd->vc_reg.smps_sa_shift = | ||
1000 | OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT; | ||
1001 | vdd->vc_reg.smps_sa_mask = | ||
1002 | OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK; | ||
1003 | vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_MPU_L_SHIFT; | ||
1004 | vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK; | ||
1005 | vdd->vc_reg.voltsetup_reg = | ||
1006 | OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET; | ||
1007 | vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET; | ||
1008 | } else if (!strcmp(vdd->voltdm.name, "core")) { | ||
1009 | vdd->volt_data = omap44xx_vdd_core_volt_data; | ||
1010 | vdd->vp_reg.tranxdone_status = | ||
1011 | OMAP4430_VP_CORE_TRANXDONE_ST_MASK; | ||
1012 | vdd->vc_reg.cmdval_reg = | ||
1013 | OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET; | ||
1014 | vdd->vc_reg.smps_sa_shift = OMAP4430_SA_VDD_CORE_L_0_6_SHIFT; | ||
1015 | vdd->vc_reg.smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK; | ||
1016 | vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_CORE_L_SHIFT; | ||
1017 | vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK; | ||
1018 | vdd->vc_reg.voltsetup_reg = | ||
1019 | OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET; | ||
1020 | vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET; | ||
1021 | } else if (!strcmp(vdd->voltdm.name, "iva")) { | ||
1022 | vdd->volt_data = omap44xx_vdd_iva_volt_data; | ||
1023 | vdd->vp_reg.tranxdone_status = | ||
1024 | OMAP4430_VP_IVA_TRANXDONE_ST_MASK; | ||
1025 | vdd->vc_reg.cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET; | ||
1026 | vdd->vc_reg.smps_sa_shift = | ||
1027 | OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT; | ||
1028 | vdd->vc_reg.smps_sa_mask = | ||
1029 | OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK; | ||
1030 | vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_IVA_L_SHIFT; | ||
1031 | vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK; | ||
1032 | vdd->vc_reg.voltsetup_reg = | ||
1033 | OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET; | ||
1034 | vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET; | ||
1035 | } else { | ||
1036 | pr_warning("%s: vdd_%s does not exisit in OMAP4\n", | ||
1037 | __func__, vdd->voltdm.name); | ||
1038 | return -EINVAL; | ||
1039 | } | ||
1040 | 658 | ||
1041 | /* | 659 | if (cpu_is_omap34xx()) { |
1042 | * Sys clk rate is require to calculate vp timeout value and | 660 | vdd->read_reg = omap3_voltage_read_reg; |
1043 | * smpswaittimemin and smpswaittimemax. | 661 | vdd->write_reg = omap3_voltage_write_reg; |
1044 | */ | 662 | ret = 0; |
1045 | sys_ck = clk_get(NULL, "sys_clkin_ck"); | 663 | } else if (cpu_is_omap44xx()) { |
1046 | if (IS_ERR(sys_ck)) { | 664 | vdd->read_reg = omap4_voltage_read_reg; |
1047 | pr_warning("%s: Could not get the sys clk to calculate" | 665 | vdd->write_reg = omap4_voltage_write_reg; |
1048 | "various vdd_%s params\n", __func__, vdd->voltdm.name); | 666 | ret = 0; |
1049 | return -EINVAL; | ||
1050 | } | 667 | } |
1051 | sys_clk_speed = clk_get_rate(sys_ck); | ||
1052 | clk_put(sys_ck); | ||
1053 | /* Divide to avoid overflow */ | ||
1054 | sys_clk_speed /= 1000; | ||
1055 | |||
1056 | /* Generic voltage parameters */ | ||
1057 | vdd->curr_volt = 1200000; | ||
1058 | vdd->ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST; | ||
1059 | vdd->read_reg = omap4_voltage_read_reg; | ||
1060 | vdd->write_reg = omap4_voltage_write_reg; | ||
1061 | vdd->volt_scale = vp_forceupdate_scale_voltage; | ||
1062 | vdd->vp_enabled = false; | ||
1063 | 668 | ||
1064 | /* VC parameters */ | 669 | ovdc_out: |
1065 | vdd->vc_reg.prm_mod = OMAP4430_PRM_DEVICE_INST; | 670 | return ret; |
1066 | vdd->vc_reg.smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET; | ||
1067 | vdd->vc_reg.smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET; | ||
1068 | vdd->vc_reg.bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET; | ||
1069 | vdd->vc_reg.data_shift = OMAP4430_DATA_SHIFT; | ||
1070 | vdd->vc_reg.slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT; | ||
1071 | vdd->vc_reg.regaddr_shift = OMAP4430_REGADDR_SHIFT; | ||
1072 | vdd->vc_reg.valid = OMAP4430_VALID_MASK; | ||
1073 | vdd->vc_reg.cmd_on_shift = OMAP4430_ON_SHIFT; | ||
1074 | vdd->vc_reg.cmd_on_mask = OMAP4430_ON_MASK; | ||
1075 | vdd->vc_reg.cmd_onlp_shift = OMAP4430_ONLP_SHIFT; | ||
1076 | vdd->vc_reg.cmd_ret_shift = OMAP4430_RET_SHIFT; | ||
1077 | vdd->vc_reg.cmd_off_shift = OMAP4430_OFF_SHIFT; | ||
1078 | |||
1079 | vdd->vp_reg.prm_mod = OMAP4430_PRM_DEVICE_INST; | ||
1080 | |||
1081 | /* VPCONFIG bit fields */ | ||
1082 | vdd->vp_reg.vpconfig_erroroffset = (vdd->pmic_info->vp_erroroffset << | ||
1083 | OMAP4430_ERROROFFSET_SHIFT); | ||
1084 | vdd->vp_reg.vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK; | ||
1085 | vdd->vp_reg.vpconfig_errorgain_shift = OMAP4430_ERRORGAIN_SHIFT; | ||
1086 | vdd->vp_reg.vpconfig_initvoltage_shift = OMAP4430_INITVOLTAGE_SHIFT; | ||
1087 | vdd->vp_reg.vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK; | ||
1088 | vdd->vp_reg.vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK; | ||
1089 | vdd->vp_reg.vpconfig_initvdd = OMAP4430_INITVDD_MASK; | ||
1090 | vdd->vp_reg.vpconfig_forceupdate = OMAP4430_FORCEUPDATE_MASK; | ||
1091 | vdd->vp_reg.vpconfig_vpenable = OMAP4430_VPENABLE_MASK; | ||
1092 | |||
1093 | /* VSTEPMIN VSTEPMAX bit fields */ | ||
1094 | waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) * | ||
1095 | sys_clk_speed) / 1000; | ||
1096 | vdd->vp_reg.vstepmin_smpswaittimemin = waittime; | ||
1097 | vdd->vp_reg.vstepmax_smpswaittimemax = waittime; | ||
1098 | vdd->vp_reg.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin; | ||
1099 | vdd->vp_reg.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax; | ||
1100 | vdd->vp_reg.vstepmin_smpswaittimemin_shift = | ||
1101 | OMAP4430_SMPSWAITTIMEMIN_SHIFT; | ||
1102 | vdd->vp_reg.vstepmax_smpswaittimemax_shift = | ||
1103 | OMAP4430_SMPSWAITTIMEMAX_SHIFT; | ||
1104 | vdd->vp_reg.vstepmin_stepmin_shift = OMAP4430_VSTEPMIN_SHIFT; | ||
1105 | vdd->vp_reg.vstepmax_stepmax_shift = OMAP4430_VSTEPMAX_SHIFT; | ||
1106 | |||
1107 | /* VLIMITTO bit fields */ | ||
1108 | timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000; | ||
1109 | vdd->vp_reg.vlimitto_timeout = timeout_val; | ||
1110 | vdd->vp_reg.vlimitto_vddmin = vdd->pmic_info->vp_vddmin; | ||
1111 | vdd->vp_reg.vlimitto_vddmax = vdd->pmic_info->vp_vddmax; | ||
1112 | vdd->vp_reg.vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT; | ||
1113 | vdd->vp_reg.vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT; | ||
1114 | vdd->vp_reg.vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT; | ||
1115 | |||
1116 | return 0; | ||
1117 | } | 671 | } |
1118 | 672 | ||
1119 | /* Public functions */ | 673 | /* Public functions */ |
@@ -1161,8 +715,7 @@ unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm) | |||
1161 | return 0; | 715 | return 0; |
1162 | } | 716 | } |
1163 | 717 | ||
1164 | curr_vsel = vdd->read_reg(vdd->vp_reg.prm_mod, | 718 | curr_vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage); |
1165 | vdd->vp_offs.voltage); | ||
1166 | 719 | ||
1167 | if (!vdd->pmic_info || !vdd->pmic_info->vsel_to_uv) { | 720 | if (!vdd->pmic_info || !vdd->pmic_info->vsel_to_uv) { |
1168 | pr_warning("%s: PMIC function to convert vsel to voltage" | 721 | pr_warning("%s: PMIC function to convert vsel to voltage" |
@@ -1184,7 +737,6 @@ void omap_vp_enable(struct voltagedomain *voltdm) | |||
1184 | { | 737 | { |
1185 | struct omap_vdd_info *vdd; | 738 | struct omap_vdd_info *vdd; |
1186 | u32 vpconfig; | 739 | u32 vpconfig; |
1187 | u16 mod; | ||
1188 | 740 | ||
1189 | if (!voltdm || IS_ERR(voltdm)) { | 741 | if (!voltdm || IS_ERR(voltdm)) { |
1190 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 742 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
@@ -1198,8 +750,6 @@ void omap_vp_enable(struct voltagedomain *voltdm) | |||
1198 | return; | 750 | return; |
1199 | } | 751 | } |
1200 | 752 | ||
1201 | mod = vdd->vp_reg.prm_mod; | ||
1202 | |||
1203 | /* If VP is already enabled, do nothing. Return */ | 753 | /* If VP is already enabled, do nothing. Return */ |
1204 | if (vdd->vp_enabled) | 754 | if (vdd->vp_enabled) |
1205 | return; | 755 | return; |
@@ -1207,9 +757,9 @@ void omap_vp_enable(struct voltagedomain *voltdm) | |||
1207 | vp_latch_vsel(vdd); | 757 | vp_latch_vsel(vdd); |
1208 | 758 | ||
1209 | /* Enable VP */ | 759 | /* Enable VP */ |
1210 | vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); | 760 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); |
1211 | vpconfig |= vdd->vp_reg.vpconfig_vpenable; | 761 | vpconfig |= vdd->vp_data->vp_common->vpconfig_vpenable; |
1212 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 762 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
1213 | vdd->vp_enabled = true; | 763 | vdd->vp_enabled = true; |
1214 | } | 764 | } |
1215 | 765 | ||
@@ -1224,7 +774,6 @@ void omap_vp_disable(struct voltagedomain *voltdm) | |||
1224 | { | 774 | { |
1225 | struct omap_vdd_info *vdd; | 775 | struct omap_vdd_info *vdd; |
1226 | u32 vpconfig; | 776 | u32 vpconfig; |
1227 | u16 mod; | ||
1228 | int timeout; | 777 | int timeout; |
1229 | 778 | ||
1230 | if (!voltdm || IS_ERR(voltdm)) { | 779 | if (!voltdm || IS_ERR(voltdm)) { |
@@ -1239,8 +788,6 @@ void omap_vp_disable(struct voltagedomain *voltdm) | |||
1239 | return; | 788 | return; |
1240 | } | 789 | } |
1241 | 790 | ||
1242 | mod = vdd->vp_reg.prm_mod; | ||
1243 | |||
1244 | /* If VP is already disabled, do nothing. Return */ | 791 | /* If VP is already disabled, do nothing. Return */ |
1245 | if (!vdd->vp_enabled) { | 792 | if (!vdd->vp_enabled) { |
1246 | pr_warning("%s: Trying to disable VP for vdd_%s when" | 793 | pr_warning("%s: Trying to disable VP for vdd_%s when" |
@@ -1249,14 +796,14 @@ void omap_vp_disable(struct voltagedomain *voltdm) | |||
1249 | } | 796 | } |
1250 | 797 | ||
1251 | /* Disable VP */ | 798 | /* Disable VP */ |
1252 | vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); | 799 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); |
1253 | vpconfig &= ~vdd->vp_reg.vpconfig_vpenable; | 800 | vpconfig &= ~vdd->vp_data->vp_common->vpconfig_vpenable; |
1254 | vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); | 801 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); |
1255 | 802 | ||
1256 | /* | 803 | /* |
1257 | * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us | 804 | * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us |
1258 | */ | 805 | */ |
1259 | omap_test_timeout((vdd->read_reg(mod, vdd->vp_offs.vstatus)), | 806 | omap_test_timeout((vdd->read_reg(prm_mod_offs, vdd->vp_data->vstatus)), |
1260 | VP_IDLE_TIMEOUT, timeout); | 807 | VP_IDLE_TIMEOUT, timeout); |
1261 | 808 | ||
1262 | if (timeout >= VP_IDLE_TIMEOUT) | 809 | if (timeout >= VP_IDLE_TIMEOUT) |
@@ -1509,8 +1056,8 @@ struct voltagedomain *omap_voltage_domain_lookup(char *name) | |||
1509 | } | 1056 | } |
1510 | 1057 | ||
1511 | for (i = 0; i < nr_scalable_vdd; i++) { | 1058 | for (i = 0; i < nr_scalable_vdd; i++) { |
1512 | if (!(strcmp(name, vdd_info[i].voltdm.name))) | 1059 | if (!(strcmp(name, vdd_info[i]->voltdm.name))) |
1513 | return &vdd_info[i].voltdm; | 1060 | return &vdd_info[i]->voltdm; |
1514 | } | 1061 | } |
1515 | 1062 | ||
1516 | return ERR_PTR(-EINVAL); | 1063 | return ERR_PTR(-EINVAL); |
@@ -1538,35 +1085,24 @@ int __init omap_voltage_late_init(void) | |||
1538 | pr_err("%s: Unable to create voltage debugfs main dir\n", | 1085 | pr_err("%s: Unable to create voltage debugfs main dir\n", |
1539 | __func__); | 1086 | __func__); |
1540 | for (i = 0; i < nr_scalable_vdd; i++) { | 1087 | for (i = 0; i < nr_scalable_vdd; i++) { |
1541 | if (vdd_data_configure(&vdd_info[i])) | 1088 | if (omap_vdd_data_configure(vdd_info[i])) |
1542 | continue; | 1089 | continue; |
1543 | vc_init(&vdd_info[i]); | 1090 | omap_vc_init(vdd_info[i]); |
1544 | vp_init(&vdd_info[i]); | 1091 | vp_init(vdd_info[i]); |
1545 | vdd_debugfs_init(&vdd_info[i]); | 1092 | vdd_debugfs_init(vdd_info[i]); |
1546 | } | 1093 | } |
1547 | 1094 | ||
1548 | return 0; | 1095 | return 0; |
1549 | } | 1096 | } |
1550 | 1097 | ||
1551 | /** | 1098 | /* XXX document */ |
1552 | * omap_voltage_early_init()- Volatage driver early init | 1099 | int __init omap_voltage_early_init(s16 prm_mod, s16 prm_irqst_ocp_mod, |
1553 | */ | 1100 | struct omap_vdd_info *omap_vdd_array[], |
1554 | static int __init omap_voltage_early_init(void) | 1101 | u8 omap_vdd_count) |
1555 | { | 1102 | { |
1556 | if (cpu_is_omap34xx()) { | 1103 | prm_mod_offs = prm_mod; |
1557 | vdd_info = omap3_vdd_info; | 1104 | prm_irqst_ocp_mod_offs = prm_irqst_ocp_mod; |
1558 | nr_scalable_vdd = OMAP3_NR_SCALABLE_VDD; | 1105 | vdd_info = omap_vdd_array; |
1559 | vc_init = omap3_vc_init; | 1106 | nr_scalable_vdd = omap_vdd_count; |
1560 | vdd_data_configure = omap3_vdd_data_configure; | ||
1561 | } else if (cpu_is_omap44xx()) { | ||
1562 | vdd_info = omap4_vdd_info; | ||
1563 | nr_scalable_vdd = OMAP4_NR_SCALABLE_VDD; | ||
1564 | vc_init = omap4_vc_init; | ||
1565 | vdd_data_configure = omap4_vdd_data_configure; | ||
1566 | } else { | ||
1567 | pr_warning("%s: voltage driver support not added\n", __func__); | ||
1568 | } | ||
1569 | |||
1570 | return 0; | 1107 | return 0; |
1571 | } | 1108 | } |
1572 | core_initcall(omap_voltage_early_init); | ||
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h new file mode 100644 index 000000000000..e9f5408244e0 --- /dev/null +++ b/arch/arm/mach-omap2/voltage.h | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | * OMAP Voltage Management Routines | ||
3 | * | ||
4 | * Author: Thara Gopinath <thara@ti.com> | ||
5 | * | ||
6 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H | ||
15 | #define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H | ||
16 | |||
17 | #include <linux/err.h> | ||
18 | |||
19 | #include "vc.h" | ||
20 | #include "vp.h" | ||
21 | |||
22 | /* XXX document */ | ||
23 | #define VOLTSCALE_VPFORCEUPDATE 1 | ||
24 | #define VOLTSCALE_VCBYPASS 2 | ||
25 | |||
26 | /* | ||
27 | * OMAP3 GENERIC setup times. Revisit to see if these needs to be | ||
28 | * passed from board or PMIC file | ||
29 | */ | ||
30 | #define OMAP3_CLKSETUP 0xff | ||
31 | #define OMAP3_VOLTOFFSET 0xff | ||
32 | #define OMAP3_VOLTSETUP2 0xff | ||
33 | |||
34 | /** | ||
35 | * struct omap_vfsm_instance_data - per-voltage manager FSM register/bitfield | ||
36 | * data | ||
37 | * @voltsetup_mask: SETUP_TIME* bitmask in the PRM_VOLTSETUP* register | ||
38 | * @voltsetup_reg: register offset of PRM_VOLTSETUP from PRM base | ||
39 | * @voltsetup_shift: SETUP_TIME* field shift in the PRM_VOLTSETUP* register | ||
40 | * | ||
41 | * XXX What about VOLTOFFSET/VOLTCTRL? | ||
42 | * XXX It is not necessary to have both a _mask and a _shift for the same | ||
43 | * bitfield - remove one! | ||
44 | */ | ||
45 | struct omap_vfsm_instance_data { | ||
46 | u32 voltsetup_mask; | ||
47 | u8 voltsetup_reg; | ||
48 | u8 voltsetup_shift; | ||
49 | }; | ||
50 | |||
51 | /** | ||
52 | * struct voltagedomain - omap voltage domain global structure. | ||
53 | * @name: Name of the voltage domain which can be used as a unique | ||
54 | * identifier. | ||
55 | */ | ||
56 | struct voltagedomain { | ||
57 | char *name; | ||
58 | }; | ||
59 | |||
60 | /** | ||
61 | * struct omap_volt_data - Omap voltage specific data. | ||
62 | * @voltage_nominal: The possible voltage value in uV | ||
63 | * @sr_efuse_offs: The offset of the efuse register(from system | ||
64 | * control module base address) from where to read | ||
65 | * the n-target value for the smartreflex module. | ||
66 | * @sr_errminlimit: Error min limit value for smartreflex. This value | ||
67 | * differs at differnet opp and thus is linked | ||
68 | * with voltage. | ||
69 | * @vp_errorgain: Error gain value for the voltage processor. This | ||
70 | * field also differs according to the voltage/opp. | ||
71 | */ | ||
72 | struct omap_volt_data { | ||
73 | u32 volt_nominal; | ||
74 | u32 sr_efuse_offs; | ||
75 | u8 sr_errminlimit; | ||
76 | u8 vp_errgain; | ||
77 | }; | ||
78 | |||
79 | /** | ||
80 | * struct omap_volt_pmic_info - PMIC specific data required by voltage driver. | ||
81 | * @slew_rate: PMIC slew rate (in uv/us) | ||
82 | * @step_size: PMIC voltage step size (in uv) | ||
83 | * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV. | ||
84 | * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value. | ||
85 | */ | ||
86 | struct omap_volt_pmic_info { | ||
87 | int slew_rate; | ||
88 | int step_size; | ||
89 | u32 on_volt; | ||
90 | u32 onlp_volt; | ||
91 | u32 ret_volt; | ||
92 | u32 off_volt; | ||
93 | u16 volt_setup_time; | ||
94 | u8 vp_erroroffset; | ||
95 | u8 vp_vstepmin; | ||
96 | u8 vp_vstepmax; | ||
97 | u8 vp_vddmin; | ||
98 | u8 vp_vddmax; | ||
99 | u8 vp_timeout_us; | ||
100 | u8 i2c_slave_addr; | ||
101 | u8 pmic_reg; | ||
102 | unsigned long (*vsel_to_uv) (const u8 vsel); | ||
103 | u8 (*uv_to_vsel) (unsigned long uV); | ||
104 | }; | ||
105 | |||
106 | /** | ||
107 | * omap_vdd_info - Per Voltage Domain info | ||
108 | * | ||
109 | * @volt_data : voltage table having the distinct voltages supported | ||
110 | * by the domain and other associated per voltage data. | ||
111 | * @pmic_info : pmic specific parameters which should be populted by | ||
112 | * the pmic drivers. | ||
113 | * @vp_data : the register values, shifts, masks for various | ||
114 | * vp registers | ||
115 | * @vp_rt_data : VP data derived at runtime, not predefined | ||
116 | * @vc_data : structure containing various various vc registers, | ||
117 | * shifts, masks etc. | ||
118 | * @vfsm : voltage manager FSM data | ||
119 | * @voltdm : pointer to the voltage domain structure | ||
120 | * @debug_dir : debug directory for this voltage domain. | ||
121 | * @curr_volt : current voltage for this vdd. | ||
122 | * @vp_enabled : flag to keep track of whether vp is enabled or not | ||
123 | * @volt_scale : API to scale the voltage of the vdd. | ||
124 | */ | ||
125 | struct omap_vdd_info { | ||
126 | struct omap_volt_data *volt_data; | ||
127 | struct omap_volt_pmic_info *pmic_info; | ||
128 | struct omap_vp_instance_data *vp_data; | ||
129 | struct omap_vp_runtime_data vp_rt_data; | ||
130 | struct omap_vc_instance_data *vc_data; | ||
131 | const struct omap_vfsm_instance_data *vfsm; | ||
132 | struct voltagedomain voltdm; | ||
133 | struct dentry *debug_dir; | ||
134 | u32 curr_volt; | ||
135 | bool vp_enabled; | ||
136 | u32 (*read_reg) (u16 mod, u8 offset); | ||
137 | void (*write_reg) (u32 val, u16 mod, u8 offset); | ||
138 | int (*volt_scale) (struct omap_vdd_info *vdd, | ||
139 | unsigned long target_volt); | ||
140 | }; | ||
141 | |||
142 | unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm); | ||
143 | void omap_vp_enable(struct voltagedomain *voltdm); | ||
144 | void omap_vp_disable(struct voltagedomain *voltdm); | ||
145 | int omap_voltage_scale_vdd(struct voltagedomain *voltdm, | ||
146 | unsigned long target_volt); | ||
147 | void omap_voltage_reset(struct voltagedomain *voltdm); | ||
148 | void omap_voltage_get_volttable(struct voltagedomain *voltdm, | ||
149 | struct omap_volt_data **volt_data); | ||
150 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | ||
151 | unsigned long volt); | ||
152 | unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm); | ||
153 | struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm); | ||
154 | int __init omap_voltage_early_init(s16 prm_mod, s16 prm_irqst_mod, | ||
155 | struct omap_vdd_info *omap_vdd_array[], | ||
156 | u8 omap_vdd_count); | ||
157 | #ifdef CONFIG_PM | ||
158 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, | ||
159 | struct omap_volt_pmic_info *pmic_info); | ||
160 | void omap_change_voltscale_method(struct voltagedomain *voltdm, | ||
161 | int voltscale_method); | ||
162 | /* API to get the voltagedomain pointer */ | ||
163 | struct voltagedomain *omap_voltage_domain_lookup(char *name); | ||
164 | |||
165 | int omap_voltage_late_init(void); | ||
166 | #else | ||
167 | static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm, | ||
168 | struct omap_volt_pmic_info *pmic_info) | ||
169 | { | ||
170 | return -EINVAL; | ||
171 | } | ||
172 | static inline void omap_change_voltscale_method(struct voltagedomain *voltdm, | ||
173 | int voltscale_method) {} | ||
174 | static inline int omap_voltage_late_init(void) | ||
175 | { | ||
176 | return -EINVAL; | ||
177 | } | ||
178 | static inline struct voltagedomain *omap_voltage_domain_lookup(char *name) | ||
179 | { | ||
180 | return ERR_PTR(-EINVAL); | ||
181 | } | ||
182 | #endif | ||
183 | |||
184 | #endif | ||
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c new file mode 100644 index 000000000000..def230fd2fde --- /dev/null +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * OMAP3 voltage domain data | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/err.h> | ||
19 | #include <linux/init.h> | ||
20 | |||
21 | #include <plat/common.h> | ||
22 | #include <plat/cpu.h> | ||
23 | |||
24 | #include "prm-regbits-34xx.h" | ||
25 | #include "omap_opp_data.h" | ||
26 | #include "voltage.h" | ||
27 | #include "vc.h" | ||
28 | #include "vp.h" | ||
29 | |||
30 | /* | ||
31 | * VDD data | ||
32 | */ | ||
33 | |||
34 | static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = { | ||
35 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, | ||
36 | .voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT, | ||
37 | .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK, | ||
38 | }; | ||
39 | |||
40 | static struct omap_vdd_info omap3_vdd1_info = { | ||
41 | .vp_data = &omap3_vp1_data, | ||
42 | .vc_data = &omap3_vc1_data, | ||
43 | .vfsm = &omap3_vdd1_vfsm_data, | ||
44 | .voltdm = { | ||
45 | .name = "mpu", | ||
46 | }, | ||
47 | }; | ||
48 | |||
49 | static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = { | ||
50 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, | ||
51 | .voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT, | ||
52 | .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK, | ||
53 | }; | ||
54 | |||
55 | static struct omap_vdd_info omap3_vdd2_info = { | ||
56 | .vp_data = &omap3_vp2_data, | ||
57 | .vc_data = &omap3_vc2_data, | ||
58 | .vfsm = &omap3_vdd2_vfsm_data, | ||
59 | .voltdm = { | ||
60 | .name = "core", | ||
61 | }, | ||
62 | }; | ||
63 | |||
64 | /* OMAP3 VDD structures */ | ||
65 | static struct omap_vdd_info *omap3_vdd_info[] = { | ||
66 | &omap3_vdd1_info, | ||
67 | &omap3_vdd2_info, | ||
68 | }; | ||
69 | |||
70 | /* OMAP3 specific voltage init functions */ | ||
71 | static int __init omap3xxx_voltage_early_init(void) | ||
72 | { | ||
73 | s16 prm_mod = OMAP3430_GR_MOD; | ||
74 | s16 prm_irqst_ocp_mod = OCP_MOD; | ||
75 | |||
76 | if (!cpu_is_omap34xx()) | ||
77 | return 0; | ||
78 | |||
79 | /* | ||
80 | * XXX Will depend on the process, validation, and binning | ||
81 | * for the currently-running IC | ||
82 | */ | ||
83 | if (cpu_is_omap3630()) { | ||
84 | omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data; | ||
85 | omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data; | ||
86 | } else { | ||
87 | omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data; | ||
88 | omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data; | ||
89 | } | ||
90 | |||
91 | return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod, | ||
92 | omap3_vdd_info, | ||
93 | ARRAY_SIZE(omap3_vdd_info)); | ||
94 | }; | ||
95 | core_initcall(omap3xxx_voltage_early_init); | ||
diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c new file mode 100644 index 000000000000..cb64996de0e1 --- /dev/null +++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c | |||
@@ -0,0 +1,102 @@ | |||
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 | #include <linux/kernel.h> | ||
21 | #include <linux/err.h> | ||
22 | #include <linux/init.h> | ||
23 | |||
24 | #include <plat/common.h> | ||
25 | |||
26 | #include "prm-regbits-44xx.h" | ||
27 | #include "prm44xx.h" | ||
28 | #include "prcm44xx.h" | ||
29 | #include "prminst44xx.h" | ||
30 | #include "voltage.h" | ||
31 | #include "omap_opp_data.h" | ||
32 | #include "vc.h" | ||
33 | #include "vp.h" | ||
34 | |||
35 | static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = { | ||
36 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET, | ||
37 | }; | ||
38 | |||
39 | static struct omap_vdd_info omap4_vdd_mpu_info = { | ||
40 | .vp_data = &omap4_vp_mpu_data, | ||
41 | .vc_data = &omap4_vc_mpu_data, | ||
42 | .vfsm = &omap4_vdd_mpu_vfsm_data, | ||
43 | .voltdm = { | ||
44 | .name = "mpu", | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = { | ||
49 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET, | ||
50 | }; | ||
51 | |||
52 | static struct omap_vdd_info omap4_vdd_iva_info = { | ||
53 | .vp_data = &omap4_vp_iva_data, | ||
54 | .vc_data = &omap4_vc_iva_data, | ||
55 | .vfsm = &omap4_vdd_iva_vfsm_data, | ||
56 | .voltdm = { | ||
57 | .name = "iva", | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = { | ||
62 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET, | ||
63 | }; | ||
64 | |||
65 | static struct omap_vdd_info omap4_vdd_core_info = { | ||
66 | .vp_data = &omap4_vp_core_data, | ||
67 | .vc_data = &omap4_vc_core_data, | ||
68 | .vfsm = &omap4_vdd_core_vfsm_data, | ||
69 | .voltdm = { | ||
70 | .name = "core", | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | /* OMAP4 VDD structures */ | ||
75 | static struct omap_vdd_info *omap4_vdd_info[] = { | ||
76 | &omap4_vdd_mpu_info, | ||
77 | &omap4_vdd_iva_info, | ||
78 | &omap4_vdd_core_info, | ||
79 | }; | ||
80 | |||
81 | /* OMAP4 specific voltage init functions */ | ||
82 | static int __init omap44xx_voltage_early_init(void) | ||
83 | { | ||
84 | s16 prm_mod = OMAP4430_PRM_DEVICE_INST; | ||
85 | s16 prm_irqst_ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST; | ||
86 | |||
87 | if (!cpu_is_omap44xx()) | ||
88 | return 0; | ||
89 | |||
90 | /* | ||
91 | * XXX Will depend on the process, validation, and binning | ||
92 | * for the currently-running IC | ||
93 | */ | ||
94 | omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data; | ||
95 | omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data; | ||
96 | omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data; | ||
97 | |||
98 | return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod, | ||
99 | omap4_vdd_info, | ||
100 | ARRAY_SIZE(omap4_vdd_info)); | ||
101 | }; | ||
102 | core_initcall(omap44xx_voltage_early_init); | ||
diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h new file mode 100644 index 000000000000..7ce134f7de79 --- /dev/null +++ b/arch/arm/mach-omap2/vp.h | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | * OMAP3/4 Voltage Processor (VP) structure and macro definitions | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License version | ||
15 | * 2 as published by the Free Software Foundation. | ||
16 | */ | ||
17 | #ifndef __ARCH_ARM_MACH_OMAP2_VP_H | ||
18 | #define __ARCH_ARM_MACH_OMAP2_VP_H | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | |||
22 | /* XXX document */ | ||
23 | #define VP_IDLE_TIMEOUT 200 | ||
24 | #define VP_TRANXDONE_TIMEOUT 300 | ||
25 | |||
26 | |||
27 | /** | ||
28 | * struct omap_vp_common_data - register data common to all VDDs | ||
29 | * @vpconfig_errorgain_mask: ERRORGAIN bitmask in the PRM_VP*_CONFIG reg | ||
30 | * @vpconfig_initvoltage_mask: INITVOLTAGE bitmask in the PRM_VP*_CONFIG reg | ||
31 | * @vpconfig_timeouten_mask: TIMEOUT bitmask in the PRM_VP*_CONFIG reg | ||
32 | * @vpconfig_initvdd: INITVDD bitmask in the PRM_VP*_CONFIG reg | ||
33 | * @vpconfig_forceupdate: FORCEUPDATE bitmask in the PRM_VP*_CONFIG reg | ||
34 | * @vpconfig_vpenable: VPENABLE bitmask in the PRM_VP*_CONFIG reg | ||
35 | * @vpconfig_erroroffset_shift: ERROROFFSET field shift in PRM_VP*_CONFIG reg | ||
36 | * @vpconfig_errorgain_shift: ERRORGAIN field shift in PRM_VP*_CONFIG reg | ||
37 | * @vpconfig_initvoltage_shift: INITVOLTAGE field shift in PRM_VP*_CONFIG reg | ||
38 | * @vpconfig_stepmin_shift: VSTEPMIN field shift in the PRM_VP*_VSTEPMIN reg | ||
39 | * @vpconfig_smpswaittimemin_shift: SMPSWAITTIMEMIN field shift in PRM_VP*_VSTEPMIN reg | ||
40 | * @vpconfig_stepmax_shift: VSTEPMAX field shift in the PRM_VP*_VSTEPMAX reg | ||
41 | * @vpconfig_smpswaittimemax_shift: SMPSWAITTIMEMAX field shift in PRM_VP*_VSTEPMAX reg | ||
42 | * @vpconfig_vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg | ||
43 | * @vpconfig_vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg | ||
44 | * @vpconfig_vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg | ||
45 | * | ||
46 | * XXX It it not necessary to have both a mask and a shift for the same | ||
47 | * bitfield - remove one | ||
48 | * XXX Many of these fields are wrongly named -- e.g., vpconfig_smps* -- fix! | ||
49 | */ | ||
50 | struct omap_vp_common_data { | ||
51 | u32 vpconfig_errorgain_mask; | ||
52 | u32 vpconfig_initvoltage_mask; | ||
53 | u32 vpconfig_timeouten; | ||
54 | u32 vpconfig_initvdd; | ||
55 | u32 vpconfig_forceupdate; | ||
56 | u32 vpconfig_vpenable; | ||
57 | u8 vpconfig_erroroffset_shift; | ||
58 | u8 vpconfig_errorgain_shift; | ||
59 | u8 vpconfig_initvoltage_shift; | ||
60 | u8 vstepmin_stepmin_shift; | ||
61 | u8 vstepmin_smpswaittimemin_shift; | ||
62 | u8 vstepmax_stepmax_shift; | ||
63 | u8 vstepmax_smpswaittimemax_shift; | ||
64 | u8 vlimitto_vddmin_shift; | ||
65 | u8 vlimitto_vddmax_shift; | ||
66 | u8 vlimitto_timeout_shift; | ||
67 | }; | ||
68 | |||
69 | /** | ||
70 | * struct omap_vp_prm_irqst_data - PRM_IRQSTATUS_MPU.VP_TRANXDONE_ST data | ||
71 | * @prm_irqst_reg: reg offset for PRM_IRQSTATUS_MPU from top of PRM | ||
72 | * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg | ||
73 | * | ||
74 | * XXX prm_irqst_reg does not belong here | ||
75 | * XXX Note that on OMAP3, VP_TRANXDONE interrupt may not work due to a | ||
76 | * hardware bug | ||
77 | * XXX This structure is probably not needed | ||
78 | */ | ||
79 | struct omap_vp_prm_irqst_data { | ||
80 | u8 prm_irqst_reg; | ||
81 | u32 tranxdone_status; | ||
82 | }; | ||
83 | |||
84 | /** | ||
85 | * struct omap_vp_instance_data - VP register offsets (per-VDD) | ||
86 | * @vp_common: pointer to struct omap_vp_common_data * for this SoC | ||
87 | * @prm_irqst_data: pointer to struct omap_vp_prm_irqst_data for this VDD | ||
88 | * @vpconfig: PRM_VP*_CONFIG reg offset from PRM start | ||
89 | * @vstepmin: PRM_VP*_VSTEPMIN reg offset from PRM start | ||
90 | * @vlimitto: PRM_VP*_VLIMITTO reg offset from PRM start | ||
91 | * @vstatus: PRM_VP*_VSTATUS reg offset from PRM start | ||
92 | * @voltage: PRM_VP*_VOLTAGE reg offset from PRM start | ||
93 | * | ||
94 | * XXX vp_common is probably not needed since it is per-SoC | ||
95 | */ | ||
96 | struct omap_vp_instance_data { | ||
97 | const struct omap_vp_common_data *vp_common; | ||
98 | const struct omap_vp_prm_irqst_data *prm_irqst_data; | ||
99 | u8 vpconfig; | ||
100 | u8 vstepmin; | ||
101 | u8 vstepmax; | ||
102 | u8 vlimitto; | ||
103 | u8 vstatus; | ||
104 | u8 voltage; | ||
105 | }; | ||
106 | |||
107 | /** | ||
108 | * struct omap_vp_runtime_data - VP data populated at runtime by code | ||
109 | * @vpconfig_erroroffset: value of ERROROFFSET bitfield in PRM_VP*_CONFIG | ||
110 | * @vpconfig_errorgain: value of ERRORGAIN bitfield in PRM_VP*_CONFIG | ||
111 | * @vstepmin_smpswaittimemin: value of SMPSWAITTIMEMIN bitfield in PRM_VP*_VSTEPMIN | ||
112 | * @vstepmax_smpswaittimemax: value of SMPSWAITTIMEMAX bitfield in PRM_VP*_VSTEPMAX | ||
113 | * @vlimitto_timeout: value of TIMEOUT bitfield in PRM_VP*_VLIMITTO | ||
114 | * @vstepmin_stepmin: value of VSTEPMIN bitfield in PRM_VP*_VSTEPMIN | ||
115 | * @vstepmax_stepmax: value of VSTEPMAX bitfield in PRM_VP*_VSTEPMAX | ||
116 | * @vlimitto_vddmin: value of VDDMIN bitfield in PRM_VP*_VLIMITTO | ||
117 | * @vlimitto_vddmax: value of VDDMAX bitfield in PRM_VP*_VLIMITTO | ||
118 | * | ||
119 | * XXX Is this structure really needed? Why not just program the | ||
120 | * device directly? They are in PRM space, therefore in the WKUP | ||
121 | * powerdomain, so register contents should not be lost in off-mode. | ||
122 | * XXX Some of these fields are incorrectly named, e.g., vstep* | ||
123 | */ | ||
124 | struct omap_vp_runtime_data { | ||
125 | u32 vpconfig_erroroffset; | ||
126 | u16 vpconfig_errorgain; | ||
127 | u16 vstepmin_smpswaittimemin; | ||
128 | u16 vstepmax_smpswaittimemax; | ||
129 | u16 vlimitto_timeout; | ||
130 | u8 vstepmin_stepmin; | ||
131 | u8 vstepmax_stepmax; | ||
132 | u8 vlimitto_vddmin; | ||
133 | u8 vlimitto_vddmax; | ||
134 | }; | ||
135 | |||
136 | extern struct omap_vp_instance_data omap3_vp1_data; | ||
137 | extern struct omap_vp_instance_data omap3_vp2_data; | ||
138 | |||
139 | extern struct omap_vp_instance_data omap4_vp_mpu_data; | ||
140 | extern struct omap_vp_instance_data omap4_vp_iva_data; | ||
141 | extern struct omap_vp_instance_data omap4_vp_core_data; | ||
142 | |||
143 | #endif | ||
diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c new file mode 100644 index 000000000000..645217094e51 --- /dev/null +++ b/arch/arm/mach-omap2/vp3xxx_data.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * OMAP3 Voltage Processor (VP) data | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #include <linux/io.h> | ||
19 | #include <linux/err.h> | ||
20 | #include <linux/init.h> | ||
21 | |||
22 | #include <plat/common.h> | ||
23 | |||
24 | #include "prm-regbits-34xx.h" | ||
25 | #include "voltage.h" | ||
26 | |||
27 | #include "vp.h" | ||
28 | |||
29 | /* | ||
30 | * VP data common to 34xx/36xx chips | ||
31 | * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file. | ||
32 | */ | ||
33 | static const struct omap_vp_common_data omap3_vp_common = { | ||
34 | .vpconfig_erroroffset_shift = OMAP3430_ERROROFFSET_SHIFT, | ||
35 | .vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK, | ||
36 | .vpconfig_errorgain_shift = OMAP3430_ERRORGAIN_SHIFT, | ||
37 | .vpconfig_initvoltage_shift = OMAP3430_INITVOLTAGE_SHIFT, | ||
38 | .vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK, | ||
39 | .vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK, | ||
40 | .vpconfig_initvdd = OMAP3430_INITVDD_MASK, | ||
41 | .vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK, | ||
42 | .vpconfig_vpenable = OMAP3430_VPENABLE_MASK, | ||
43 | .vstepmin_smpswaittimemin_shift = OMAP3430_SMPSWAITTIMEMIN_SHIFT, | ||
44 | .vstepmax_smpswaittimemax_shift = OMAP3430_SMPSWAITTIMEMAX_SHIFT, | ||
45 | .vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT, | ||
46 | .vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT, | ||
47 | .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, | ||
48 | .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, | ||
49 | .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, | ||
50 | }; | ||
51 | |||
52 | static const struct omap_vp_prm_irqst_data omap3_vp1_prm_irqst_data = { | ||
53 | .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET, | ||
54 | .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, | ||
55 | }; | ||
56 | |||
57 | struct omap_vp_instance_data omap3_vp1_data = { | ||
58 | .vp_common = &omap3_vp_common, | ||
59 | .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET, | ||
60 | .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET, | ||
61 | .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET, | ||
62 | .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET, | ||
63 | .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET, | ||
64 | .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET, | ||
65 | .prm_irqst_data = &omap3_vp1_prm_irqst_data, | ||
66 | }; | ||
67 | |||
68 | static const struct omap_vp_prm_irqst_data omap3_vp2_prm_irqst_data = { | ||
69 | .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET, | ||
70 | .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK, | ||
71 | }; | ||
72 | |||
73 | struct omap_vp_instance_data omap3_vp2_data = { | ||
74 | .vp_common = &omap3_vp_common, | ||
75 | .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET, | ||
76 | .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET, | ||
77 | .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET, | ||
78 | .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET, | ||
79 | .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET, | ||
80 | .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET, | ||
81 | .prm_irqst_data = &omap3_vp2_prm_irqst_data, | ||
82 | }; | ||
diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c new file mode 100644 index 000000000000..65d1ad63800a --- /dev/null +++ b/arch/arm/mach-omap2/vp44xx_data.c | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * OMAP3 Voltage Processor (VP) data | ||
3 | * | ||
4 | * Copyright (C) 2007, 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
6 | * Lesly A M <x0080970@ti.com> | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2008, 2011 Nokia Corporation | ||
10 | * Kalle Jokiniemi | ||
11 | * Paul Walmsley | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #include <linux/io.h> | ||
19 | #include <linux/err.h> | ||
20 | #include <linux/init.h> | ||
21 | |||
22 | #include <plat/common.h> | ||
23 | |||
24 | #include "prm44xx.h" | ||
25 | #include "prm-regbits-44xx.h" | ||
26 | #include "voltage.h" | ||
27 | |||
28 | #include "vp.h" | ||
29 | |||
30 | /* | ||
31 | * VP data common to 44xx chips | ||
32 | * XXX This stuff presumably belongs in the vp44xx.c or vp.c file. | ||
33 | */ | ||
34 | static const struct omap_vp_common_data omap4_vp_common = { | ||
35 | .vpconfig_erroroffset_shift = OMAP4430_ERROROFFSET_SHIFT, | ||
36 | .vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK, | ||
37 | .vpconfig_errorgain_shift = OMAP4430_ERRORGAIN_SHIFT, | ||
38 | .vpconfig_initvoltage_shift = OMAP4430_INITVOLTAGE_SHIFT, | ||
39 | .vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK, | ||
40 | .vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK, | ||
41 | .vpconfig_initvdd = OMAP4430_INITVDD_MASK, | ||
42 | .vpconfig_forceupdate = OMAP4430_FORCEUPDATE_MASK, | ||
43 | .vpconfig_vpenable = OMAP4430_VPENABLE_MASK, | ||
44 | .vstepmin_smpswaittimemin_shift = OMAP4430_SMPSWAITTIMEMIN_SHIFT, | ||
45 | .vstepmax_smpswaittimemax_shift = OMAP4430_SMPSWAITTIMEMAX_SHIFT, | ||
46 | .vstepmin_stepmin_shift = OMAP4430_VSTEPMIN_SHIFT, | ||
47 | .vstepmax_stepmax_shift = OMAP4430_VSTEPMAX_SHIFT, | ||
48 | .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT, | ||
49 | .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT, | ||
50 | .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT, | ||
51 | }; | ||
52 | |||
53 | static const struct omap_vp_prm_irqst_data omap4_vp_mpu_prm_irqst_data = { | ||
54 | .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET, | ||
55 | .tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK, | ||
56 | }; | ||
57 | |||
58 | struct omap_vp_instance_data omap4_vp_mpu_data = { | ||
59 | .vp_common = &omap4_vp_common, | ||
60 | .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET, | ||
61 | .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET, | ||
62 | .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET, | ||
63 | .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET, | ||
64 | .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET, | ||
65 | .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET, | ||
66 | .prm_irqst_data = &omap4_vp_mpu_prm_irqst_data, | ||
67 | }; | ||
68 | |||
69 | static const struct omap_vp_prm_irqst_data omap4_vp_iva_prm_irqst_data = { | ||
70 | .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, | ||
71 | .tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK, | ||
72 | }; | ||
73 | |||
74 | struct omap_vp_instance_data omap4_vp_iva_data = { | ||
75 | .vp_common = &omap4_vp_common, | ||
76 | .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET, | ||
77 | .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET, | ||
78 | .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET, | ||
79 | .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET, | ||
80 | .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET, | ||
81 | .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET, | ||
82 | .prm_irqst_data = &omap4_vp_iva_prm_irqst_data, | ||
83 | }; | ||
84 | |||
85 | static const struct omap_vp_prm_irqst_data omap4_vp_core_prm_irqst_data = { | ||
86 | .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, | ||
87 | .tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK, | ||
88 | }; | ||
89 | |||
90 | struct omap_vp_instance_data omap4_vp_core_data = { | ||
91 | .vp_common = &omap4_vp_common, | ||
92 | .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET, | ||
93 | .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET, | ||
94 | .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET, | ||
95 | .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET, | ||
96 | .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET, | ||
97 | .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET, | ||
98 | .prm_irqst_data = &omap4_vp_core_prm_irqst_data, | ||
99 | }; | ||
100 | |||