diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-30 19:51:09 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-30 19:51:09 -0400 |
commit | 090ad104c5c59c7952d4b8d4cfb60559b38eb3e0 (patch) | |
tree | 9f5cdb5619ef2040b23acab17c5115c5bb1cbab0 | |
parent | 24469df4ed8943104980fa7405011870ede8105a (diff) | |
parent | eff11ba9ebba475f2aedee74eebc459789f99ab6 (diff) |
Merge branch 'omap/voltage' into next/pm
82 files changed, 3046 insertions, 3322 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index f34336560437..512978586b2b 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -89,14 +89,13 @@ obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ | |||
89 | vp44xx_data.o | 89 | vp44xx_data.o |
90 | 90 | ||
91 | # OMAP voltage domains | 91 | # OMAP voltage domains |
92 | ifeq ($(CONFIG_PM),y) | 92 | voltagedomain-common := voltage.o vc.o vp.o |
93 | voltagedomain-common := voltage.o | 93 | obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) \ |
94 | obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) | 94 | voltagedomains2xxx_data.o |
95 | obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \ | 95 | obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \ |
96 | voltagedomains3xxx_data.o | 96 | voltagedomains3xxx_data.o |
97 | obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) \ | 97 | obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) \ |
98 | voltagedomains44xx_data.o | 98 | voltagedomains44xx_data.o |
99 | endif | ||
100 | 99 | ||
101 | # OMAP powerdomain framework | 100 | # OMAP powerdomain framework |
102 | powerdomain-common += powerdomain.o powerdomain-common.o | 101 | powerdomain-common += powerdomain.o powerdomain-common.o |
@@ -116,9 +115,12 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \ | |||
116 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ | 115 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ |
117 | clockdomain2xxx_3xxx.o \ | 116 | clockdomain2xxx_3xxx.o \ |
118 | clockdomains2xxx_3xxx_data.o | 117 | clockdomains2xxx_3xxx_data.o |
118 | obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o | ||
119 | obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o | ||
119 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ | 120 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ |
120 | clockdomain2xxx_3xxx.o \ | 121 | clockdomain2xxx_3xxx.o \ |
121 | clockdomains2xxx_3xxx_data.o | 122 | clockdomains2xxx_3xxx_data.o \ |
123 | clockdomains3xxx_data.o | ||
122 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ | 124 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ |
123 | clockdomain44xx.o \ | 125 | clockdomain44xx.o \ |
124 | clockdomains44xx_data.o | 126 | clockdomains44xx_data.o |
@@ -185,78 +187,66 @@ endif | |||
185 | # Specific board support | 187 | # Specific board support |
186 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o | 188 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o |
187 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o | 189 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o |
188 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \ | 190 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o |
189 | hsmmc.o | ||
190 | obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o | 191 | obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o |
191 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ | 192 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o |
192 | hsmmc.o | 193 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o |
193 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \ | 194 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o |
194 | hsmmc.o | 195 | obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o |
195 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ | 196 | obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o |
196 | board-flash.o \ | 197 | obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o |
197 | hsmmc.o | 198 | obj-$(CONFIG_MACH_OVERO) += board-overo.o |
198 | obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o \ | 199 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o |
199 | hsmmc.o | 200 | obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o |
200 | obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o \ | 201 | obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o |
201 | hsmmc.o | ||
202 | obj-$(CONFIG_MACH_OVERO) += board-overo.o \ | ||
203 | hsmmc.o | ||
204 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \ | ||
205 | hsmmc.o | ||
206 | obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ | ||
207 | hsmmc.o | ||
208 | obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ | ||
209 | hsmmc.o \ | ||
210 | board-flash.o | ||
211 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o | 202 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o |
212 | obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \ | 203 | obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \ |
213 | sdram-nokia.o \ | 204 | sdram-nokia.o |
214 | hsmmc.o | ||
215 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | 205 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ |
216 | sdram-nokia.o \ | 206 | sdram-nokia.o \ |
217 | board-rx51-peripherals.o \ | 207 | board-rx51-peripherals.o \ |
218 | board-rx51-video.o \ | 208 | board-rx51-video.o |
219 | hsmmc.o | ||
220 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom.o \ | 209 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom.o \ |
221 | board-zoom-peripherals.o \ | 210 | board-zoom-peripherals.o \ |
222 | board-zoom-display.o \ | 211 | board-zoom-display.o \ |
223 | board-flash.o \ | ||
224 | hsmmc.o \ | ||
225 | board-zoom-debugboard.o | 212 | board-zoom-debugboard.o |
226 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom.o \ | 213 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom.o \ |
227 | board-zoom-peripherals.o \ | 214 | board-zoom-peripherals.o \ |
228 | board-zoom-display.o \ | 215 | board-zoom-display.o \ |
229 | board-flash.o \ | ||
230 | hsmmc.o \ | ||
231 | board-zoom-debugboard.o | 216 | board-zoom-debugboard.o |
232 | obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ | 217 | obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ |
233 | board-zoom-peripherals.o \ | 218 | board-zoom-peripherals.o \ |
234 | board-zoom-display.o \ | 219 | board-zoom-display.o |
235 | board-flash.o \ | 220 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o |
236 | hsmmc.o | ||
237 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ | ||
238 | hsmmc.o | ||
239 | obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o | 221 | obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o |
240 | obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \ | 222 | obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o |
241 | hsmmc.o | 223 | obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o |
242 | obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ | ||
243 | hsmmc.o | ||
244 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ | 224 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ |
245 | hsmmc.o \ | ||
246 | omap_phy_internal.o | 225 | omap_phy_internal.o |
247 | obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ | 226 | obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ |
248 | hsmmc.o \ | 227 | omap_phy_internal.o |
228 | |||
229 | obj-$(CONFIG_MACH_PCM049) += board-omap4pcm049.o \ | ||
249 | omap_phy_internal.o | 230 | omap_phy_internal.o |
250 | 231 | ||
251 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \ | 232 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \ |
252 | omap_phy_internal.o \ | 233 | omap_phy_internal.o |
253 | 234 | ||
254 | obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o | 235 | obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o |
255 | 236 | ||
256 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ | 237 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o |
257 | hsmmc.o | ||
258 | obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o | 238 | obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o |
239 | |||
259 | # Platform specific device init code | 240 | # Platform specific device init code |
241 | |||
242 | omap-flash-$(CONFIG_MTD_NAND_OMAP2) := board-flash.o | ||
243 | omap-flash-$(CONFIG_MTD_ONENAND_OMAP2) := board-flash.o | ||
244 | obj-y += $(omap-flash-y) $(omap-flash-m) | ||
245 | |||
246 | omap-hsmmc-$(CONFIG_MMC_OMAP_HS) := hsmmc.o | ||
247 | obj-y += $(omap-hsmmc-m) $(omap-hsmmc-y) | ||
248 | |||
249 | |||
260 | usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o | 250 | usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o |
261 | obj-y += $(usbfs-m) $(usbfs-y) | 251 | obj-y += $(usbfs-m) $(usbfs-y) |
262 | obj-y += usb-musb.o | 252 | obj-y += usb-musb.o |
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 2028464cf5b9..618216c8f742 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -141,12 +141,6 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = { | |||
141 | {OMAP_TAG_LCD, &sdp2430_lcd_config}, | 141 | {OMAP_TAG_LCD, &sdp2430_lcd_config}, |
142 | }; | 142 | }; |
143 | 143 | ||
144 | static void __init omap_2430sdp_init_early(void) | ||
145 | { | ||
146 | omap2_init_common_infrastructure(); | ||
147 | omap2_init_common_devices(NULL, NULL); | ||
148 | } | ||
149 | |||
150 | static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { | 144 | static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { |
151 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | 145 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
152 | }; | 146 | }; |
@@ -235,6 +229,7 @@ static void __init omap_2430sdp_init(void) | |||
235 | 229 | ||
236 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 230 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
237 | omap_serial_init(); | 231 | omap_serial_init(); |
232 | omap_sdrc_init(NULL, NULL); | ||
238 | omap2_hsmmc_init(mmc); | 233 | omap2_hsmmc_init(mmc); |
239 | omap2_usbfs_init(&sdp2430_usb_config); | 234 | omap2_usbfs_init(&sdp2430_usb_config); |
240 | 235 | ||
@@ -259,7 +254,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") | |||
259 | .boot_params = 0x80000100, | 254 | .boot_params = 0x80000100, |
260 | .reserve = omap_reserve, | 255 | .reserve = omap_reserve, |
261 | .map_io = omap_2430sdp_map_io, | 256 | .map_io = omap_2430sdp_map_io, |
262 | .init_early = omap_2430sdp_init_early, | 257 | .init_early = omap2430_init_early, |
263 | .init_irq = omap2_init_irq, | 258 | .init_irq = omap2_init_irq, |
264 | .init_machine = omap_2430sdp_init, | 259 | .init_machine = omap_2430sdp_init, |
265 | .timer = &omap2_timer, | 260 | .timer = &omap2_timer, |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index bd600cfb7f80..9bb48eaa4381 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -225,12 +225,6 @@ static struct omap_dss_board_info sdp3430_dss_data = { | |||
225 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { | 225 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { |
226 | }; | 226 | }; |
227 | 227 | ||
228 | static void __init omap_3430sdp_init_early(void) | ||
229 | { | ||
230 | omap2_init_common_infrastructure(); | ||
231 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); | ||
232 | } | ||
233 | |||
234 | static struct omap2_hsmmc_info mmc[] = { | 228 | static struct omap2_hsmmc_info mmc[] = { |
235 | { | 229 | { |
236 | .mmc = 1, | 230 | .mmc = 1, |
@@ -719,6 +713,7 @@ static void __init omap_3430sdp_init(void) | |||
719 | gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1; | 713 | gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1; |
720 | omap_ads7846_init(1, gpio_pendown, 310, NULL); | 714 | omap_ads7846_init(1, gpio_pendown, 310, NULL); |
721 | board_serial_init(); | 715 | board_serial_init(); |
716 | omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL); | ||
722 | usb_musb_init(NULL); | 717 | usb_musb_init(NULL); |
723 | board_smc91x_init(); | 718 | board_smc91x_init(); |
724 | board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); | 719 | board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); |
@@ -732,7 +727,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") | |||
732 | .boot_params = 0x80000100, | 727 | .boot_params = 0x80000100, |
733 | .reserve = omap_reserve, | 728 | .reserve = omap_reserve, |
734 | .map_io = omap3_map_io, | 729 | .map_io = omap3_map_io, |
735 | .init_early = omap_3430sdp_init_early, | 730 | .init_early = omap3430_init_early, |
736 | .init_irq = omap3_init_irq, | 731 | .init_irq = omap3_init_irq, |
737 | .init_machine = omap_3430sdp_init, | 732 | .init_machine = omap_3430sdp_init, |
738 | .timer = &omap3_timer, | 733 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index e4f37b57a0c4..94febc85d805 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
@@ -70,13 +70,6 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
70 | static struct omap_board_config_kernel sdp_config[] __initdata = { | 70 | static struct omap_board_config_kernel sdp_config[] __initdata = { |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static void __init omap_sdp_init_early(void) | ||
74 | { | ||
75 | omap2_init_common_infrastructure(); | ||
76 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, | ||
77 | h8mbx00u0mer0em_sdrc_params); | ||
78 | } | ||
79 | |||
80 | #ifdef CONFIG_OMAP_MUX | 73 | #ifdef CONFIG_OMAP_MUX |
81 | static struct omap_board_mux board_mux[] __initdata = { | 74 | static struct omap_board_mux board_mux[] __initdata = { |
82 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 75 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
@@ -207,6 +200,8 @@ static void __init omap_sdp_init(void) | |||
207 | omap_board_config = sdp_config; | 200 | omap_board_config = sdp_config; |
208 | omap_board_config_size = ARRAY_SIZE(sdp_config); | 201 | omap_board_config_size = ARRAY_SIZE(sdp_config); |
209 | zoom_peripherals_init(); | 202 | zoom_peripherals_init(); |
203 | omap_sdrc_init(h8mbx00u0mer0em_sdrc_params, | ||
204 | h8mbx00u0mer0em_sdrc_params); | ||
210 | zoom_display_init(); | 205 | zoom_display_init(); |
211 | board_smc91x_init(); | 206 | board_smc91x_init(); |
212 | board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); | 207 | board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); |
@@ -218,7 +213,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") | |||
218 | .boot_params = 0x80000100, | 213 | .boot_params = 0x80000100, |
219 | .reserve = omap_reserve, | 214 | .reserve = omap_reserve, |
220 | .map_io = omap3_map_io, | 215 | .map_io = omap3_map_io, |
221 | .init_early = omap_sdp_init_early, | 216 | .init_early = omap3630_init_early, |
222 | .init_irq = omap3_init_irq, | 217 | .init_irq = omap3_init_irq, |
223 | .init_machine = omap_sdp_init, | 218 | .init_machine = omap_sdp_init, |
224 | .timer = &omap3_timer, | 219 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index c7cef44c75d4..ab19d305f61e 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -389,12 +389,6 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = { | |||
389 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, | 389 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, |
390 | }; | 390 | }; |
391 | 391 | ||
392 | static void __init omap_4430sdp_init_early(void) | ||
393 | { | ||
394 | omap2_init_common_infrastructure(); | ||
395 | omap2_init_common_devices(NULL, NULL); | ||
396 | } | ||
397 | |||
398 | static struct omap_musb_board_data musb_board_data = { | 392 | static struct omap_musb_board_data musb_board_data = { |
399 | .interface_type = MUSB_INTERFACE_UTMI, | 393 | .interface_type = MUSB_INTERFACE_UTMI, |
400 | .mode = MUSB_OTG, | 394 | .mode = MUSB_OTG, |
@@ -809,6 +803,7 @@ static void __init omap_4430sdp_init(void) | |||
809 | omap_sfh7741prox_init(); | 803 | omap_sfh7741prox_init(); |
810 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 804 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
811 | board_serial_init(); | 805 | board_serial_init(); |
806 | omap_sdrc_init(NULL, NULL); | ||
812 | omap4_sdp4430_wifi_init(); | 807 | omap4_sdp4430_wifi_init(); |
813 | omap4_twl6030_hsmmc_init(mmc); | 808 | omap4_twl6030_hsmmc_init(mmc); |
814 | 809 | ||
@@ -841,7 +836,7 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") | |||
841 | .boot_params = 0x80000100, | 836 | .boot_params = 0x80000100, |
842 | .reserve = omap_reserve, | 837 | .reserve = omap_reserve, |
843 | .map_io = omap_4430sdp_map_io, | 838 | .map_io = omap_4430sdp_map_io, |
844 | .init_early = omap_4430sdp_init_early, | 839 | .init_early = omap4430_init_early, |
845 | .init_irq = gic_init_irq, | 840 | .init_irq = gic_init_irq, |
846 | .init_machine = omap_4430sdp_init, | 841 | .init_machine = omap_4430sdp_init, |
847 | .timer = &omap4_timer, | 842 | .timer = &omap4_timer, |
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index 933e9353cb37..9e1b2c248328 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c | |||
@@ -47,12 +47,6 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
47 | }; | 47 | }; |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | static void __init am3517_crane_init_early(void) | ||
51 | { | ||
52 | omap2_init_common_infrastructure(); | ||
53 | omap2_init_common_devices(NULL, NULL); | ||
54 | } | ||
55 | |||
56 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { | 50 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { |
57 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, | 51 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
58 | .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, | 52 | .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, |
@@ -70,6 +64,7 @@ static void __init am3517_crane_init(void) | |||
70 | 64 | ||
71 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 65 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
72 | omap_serial_init(); | 66 | omap_serial_init(); |
67 | omap_sdrc_init(NULL, NULL); | ||
73 | 68 | ||
74 | omap_board_config = am3517_crane_config; | 69 | omap_board_config = am3517_crane_config; |
75 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); | 70 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); |
@@ -101,7 +96,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") | |||
101 | .boot_params = 0x80000100, | 96 | .boot_params = 0x80000100, |
102 | .reserve = omap_reserve, | 97 | .reserve = omap_reserve, |
103 | .map_io = omap3_map_io, | 98 | .map_io = omap3_map_io, |
104 | .init_early = am3517_crane_init_early, | 99 | .init_early = am35xx_init_early, |
105 | .init_irq = omap3_init_irq, | 100 | .init_irq = omap3_init_irq, |
106 | .init_machine = am3517_crane_init, | 101 | .init_machine = am3517_crane_init, |
107 | .timer = &omap3_timer, | 102 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index f3006c304150..7d842940c252 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -362,11 +362,6 @@ static struct omap_dss_board_info am3517_evm_dss_data = { | |||
362 | /* | 362 | /* |
363 | * Board initialization | 363 | * Board initialization |
364 | */ | 364 | */ |
365 | static void __init am3517_evm_init_early(void) | ||
366 | { | ||
367 | omap2_init_common_infrastructure(); | ||
368 | omap2_init_common_devices(NULL, NULL); | ||
369 | } | ||
370 | 365 | ||
371 | static struct omap_musb_board_data musb_board_data = { | 366 | static struct omap_musb_board_data musb_board_data = { |
372 | .interface_type = MUSB_INTERFACE_ULPI, | 367 | .interface_type = MUSB_INTERFACE_ULPI, |
@@ -469,6 +464,7 @@ static void __init am3517_evm_init(void) | |||
469 | am3517_evm_i2c_init(); | 464 | am3517_evm_i2c_init(); |
470 | omap_display_init(&am3517_evm_dss_data); | 465 | omap_display_init(&am3517_evm_dss_data); |
471 | omap_serial_init(); | 466 | omap_serial_init(); |
467 | omap_sdrc_init(NULL, NULL); | ||
472 | 468 | ||
473 | /* Configure GPIO for EHCI port */ | 469 | /* Configure GPIO for EHCI port */ |
474 | omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); | 470 | omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); |
@@ -493,7 +489,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") | |||
493 | .boot_params = 0x80000100, | 489 | .boot_params = 0x80000100, |
494 | .reserve = omap_reserve, | 490 | .reserve = omap_reserve, |
495 | .map_io = omap3_map_io, | 491 | .map_io = omap3_map_io, |
496 | .init_early = am3517_evm_init_early, | 492 | .init_early = am35xx_init_early, |
497 | .init_irq = omap3_init_irq, | 493 | .init_irq = omap3_init_irq, |
498 | .init_machine = am3517_evm_init, | 494 | .init_machine = am3517_evm_init, |
499 | .timer = &omap3_timer, | 495 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 70211703ff9f..cf546f86014e 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -273,12 +273,6 @@ static struct omap_board_config_kernel apollon_config[] __initdata = { | |||
273 | { OMAP_TAG_LCD, &apollon_lcd_config }, | 273 | { OMAP_TAG_LCD, &apollon_lcd_config }, |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static void __init omap_apollon_init_early(void) | ||
277 | { | ||
278 | omap2_init_common_infrastructure(); | ||
279 | omap2_init_common_devices(NULL, NULL); | ||
280 | } | ||
281 | |||
282 | static struct gpio apollon_gpio_leds[] __initdata = { | 276 | static struct gpio apollon_gpio_leds[] __initdata = { |
283 | { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */ | 277 | { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */ |
284 | { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */ | 278 | { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */ |
@@ -340,6 +334,7 @@ static void __init omap_apollon_init(void) | |||
340 | */ | 334 | */ |
341 | platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); | 335 | platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); |
342 | omap_serial_init(); | 336 | omap_serial_init(); |
337 | omap_sdrc_init(NULL, NULL); | ||
343 | } | 338 | } |
344 | 339 | ||
345 | static void __init omap_apollon_map_io(void) | 340 | static void __init omap_apollon_map_io(void) |
@@ -353,7 +348,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") | |||
353 | .boot_params = 0x80000100, | 348 | .boot_params = 0x80000100, |
354 | .reserve = omap_reserve, | 349 | .reserve = omap_reserve, |
355 | .map_io = omap_apollon_map_io, | 350 | .map_io = omap_apollon_map_io, |
356 | .init_early = omap_apollon_init_early, | 351 | .init_early = omap2420_init_early, |
357 | .init_irq = omap2_init_irq, | 352 | .init_irq = omap2_init_irq, |
358 | .init_machine = omap_apollon_init, | 353 | .init_machine = omap_apollon_init, |
359 | .timer = &omap2_timer, | 354 | .timer = &omap2_timer, |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 3af8aab435b5..e15d39bffe79 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -471,13 +471,6 @@ static void __init cm_t35_init_i2c(void) | |||
471 | omap3_pmic_init("tps65930", &cm_t35_twldata); | 471 | omap3_pmic_init("tps65930", &cm_t35_twldata); |
472 | } | 472 | } |
473 | 473 | ||
474 | static void __init cm_t35_init_early(void) | ||
475 | { | ||
476 | omap2_init_common_infrastructure(); | ||
477 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
478 | mt46h32m32lf6_sdrc_params); | ||
479 | } | ||
480 | |||
481 | #ifdef CONFIG_OMAP_MUX | 474 | #ifdef CONFIG_OMAP_MUX |
482 | static struct omap_board_mux board_mux[] __initdata = { | 475 | static struct omap_board_mux board_mux[] __initdata = { |
483 | /* nCS and IRQ for CM-T35 ethernet */ | 476 | /* nCS and IRQ for CM-T35 ethernet */ |
@@ -610,6 +603,8 @@ static void __init cm_t3x_common_init(void) | |||
610 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | 603 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); |
611 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 604 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
612 | omap_serial_init(); | 605 | omap_serial_init(); |
606 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
607 | mt46h32m32lf6_sdrc_params); | ||
613 | cm_t35_init_i2c(); | 608 | cm_t35_init_i2c(); |
614 | omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL); | 609 | omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL); |
615 | cm_t35_init_ethernet(); | 610 | cm_t35_init_ethernet(); |
@@ -637,7 +632,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35") | |||
637 | .boot_params = 0x80000100, | 632 | .boot_params = 0x80000100, |
638 | .reserve = omap_reserve, | 633 | .reserve = omap_reserve, |
639 | .map_io = omap3_map_io, | 634 | .map_io = omap3_map_io, |
640 | .init_early = cm_t35_init_early, | 635 | .init_early = omap35xx_init_early, |
641 | .init_irq = omap3_init_irq, | 636 | .init_irq = omap3_init_irq, |
642 | .init_machine = cm_t35_init, | 637 | .init_machine = cm_t35_init, |
643 | .timer = &omap3_timer, | 638 | .timer = &omap3_timer, |
@@ -647,7 +642,7 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730") | |||
647 | .boot_params = 0x80000100, | 642 | .boot_params = 0x80000100, |
648 | .reserve = omap_reserve, | 643 | .reserve = omap_reserve, |
649 | .map_io = omap3_map_io, | 644 | .map_io = omap3_map_io, |
650 | .init_early = cm_t35_init_early, | 645 | .init_early = omap3630_init_early, |
651 | .init_irq = omap3_init_irq, | 646 | .init_irq = omap3_init_irq, |
652 | .init_machine = cm_t3730_init, | 647 | .init_machine = cm_t3730_init, |
653 | .timer = &omap3_timer, | 648 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 05c72f4c1b57..867bf671719c 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -251,12 +251,6 @@ static inline void cm_t3517_init_nand(void) {} | |||
251 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | 251 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { |
252 | }; | 252 | }; |
253 | 253 | ||
254 | static void __init cm_t3517_init_early(void) | ||
255 | { | ||
256 | omap2_init_common_infrastructure(); | ||
257 | omap2_init_common_devices(NULL, NULL); | ||
258 | } | ||
259 | |||
260 | #ifdef CONFIG_OMAP_MUX | 254 | #ifdef CONFIG_OMAP_MUX |
261 | static struct omap_board_mux board_mux[] __initdata = { | 255 | static struct omap_board_mux board_mux[] __initdata = { |
262 | /* GPIO186 - Green LED */ | 256 | /* GPIO186 - Green LED */ |
@@ -289,6 +283,7 @@ static void __init cm_t3517_init(void) | |||
289 | { | 283 | { |
290 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 284 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
291 | omap_serial_init(); | 285 | omap_serial_init(); |
286 | omap_sdrc_init(NULL, NULL); | ||
292 | omap_board_config = cm_t3517_config; | 287 | omap_board_config = cm_t3517_config; |
293 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | 288 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); |
294 | cm_t3517_init_leds(); | 289 | cm_t3517_init_leds(); |
@@ -302,7 +297,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517") | |||
302 | .boot_params = 0x80000100, | 297 | .boot_params = 0x80000100, |
303 | .reserve = omap_reserve, | 298 | .reserve = omap_reserve, |
304 | .map_io = omap3_map_io, | 299 | .map_io = omap3_map_io, |
305 | .init_early = cm_t3517_init_early, | 300 | .init_early = am35xx_init_early, |
306 | .init_irq = omap3_init_irq, | 301 | .init_irq = omap3_init_irq, |
307 | .init_machine = cm_t3517_init, | 302 | .init_machine = cm_t3517_init, |
308 | .timer = &omap3_timer, | 303 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index b6002ec31c6a..4b1f6c68c358 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -397,14 +397,6 @@ static struct platform_device keys_gpio = { | |||
397 | }, | 397 | }, |
398 | }; | 398 | }; |
399 | 399 | ||
400 | |||
401 | static void __init devkit8000_init_early(void) | ||
402 | { | ||
403 | omap2_init_common_infrastructure(); | ||
404 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
405 | mt46h32m32lf6_sdrc_params); | ||
406 | } | ||
407 | |||
408 | static void __init devkit8000_init_irq(void) | 400 | static void __init devkit8000_init_irq(void) |
409 | { | 401 | { |
410 | omap3_init_irq(); | 402 | omap3_init_irq(); |
@@ -645,6 +637,8 @@ static void __init devkit8000_init(void) | |||
645 | { | 637 | { |
646 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 638 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
647 | omap_serial_init(); | 639 | omap_serial_init(); |
640 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
641 | mt46h32m32lf6_sdrc_params); | ||
648 | 642 | ||
649 | omap_dm9000_init(); | 643 | omap_dm9000_init(); |
650 | 644 | ||
@@ -670,7 +664,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") | |||
670 | .boot_params = 0x80000100, | 664 | .boot_params = 0x80000100, |
671 | .reserve = omap_reserve, | 665 | .reserve = omap_reserve, |
672 | .map_io = omap3_map_io, | 666 | .map_io = omap3_map_io, |
673 | .init_early = devkit8000_init_early, | 667 | .init_early = omap35xx_init_early, |
674 | .init_irq = devkit8000_init_irq, | 668 | .init_irq = devkit8000_init_irq, |
675 | .init_machine = devkit8000_init, | 669 | .init_machine = devkit8000_init, |
676 | .timer = &omap3_secure_timer, | 670 | .timer = &omap3_secure_timer, |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 54db41a84a9b..5223898f50e4 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -36,12 +36,12 @@ static struct omap_board_config_kernel generic_config[] = { | |||
36 | static void __init omap_generic_init_early(void) | 36 | static void __init omap_generic_init_early(void) |
37 | { | 37 | { |
38 | omap2_init_common_infrastructure(); | 38 | omap2_init_common_infrastructure(); |
39 | omap2_init_common_devices(NULL, NULL); | ||
40 | } | 39 | } |
41 | 40 | ||
42 | static void __init omap_generic_init(void) | 41 | static void __init omap_generic_init(void) |
43 | { | 42 | { |
44 | omap_serial_init(); | 43 | omap_serial_init(); |
44 | omap_sdrc_init(NULL, NULL); | ||
45 | omap_board_config = generic_config; | 45 | omap_board_config = generic_config; |
46 | omap_board_config_size = ARRAY_SIZE(generic_config); | 46 | omap_board_config_size = ARRAY_SIZE(generic_config); |
47 | } | 47 | } |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 45de2b319ec9..948fde010c69 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -290,12 +290,6 @@ 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_early(void) | ||
294 | { | ||
295 | omap2_init_common_infrastructure(); | ||
296 | omap2_init_common_devices(NULL, NULL); | ||
297 | } | ||
298 | |||
299 | static void __init omap_h4_init_irq(void) | 293 | static void __init omap_h4_init_irq(void) |
300 | { | 294 | { |
301 | omap2_init_irq(); | 295 | omap2_init_irq(); |
@@ -371,6 +365,7 @@ static void __init omap_h4_init(void) | |||
371 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); | 365 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); |
372 | omap2_usbfs_init(&h4_usb_config); | 366 | omap2_usbfs_init(&h4_usb_config); |
373 | omap_serial_init(); | 367 | omap_serial_init(); |
368 | omap_sdrc_init(NULL, NULL); | ||
374 | h4_init_flash(); | 369 | h4_init_flash(); |
375 | } | 370 | } |
376 | 371 | ||
@@ -385,7 +380,7 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board") | |||
385 | .boot_params = 0x80000100, | 380 | .boot_params = 0x80000100, |
386 | .reserve = omap_reserve, | 381 | .reserve = omap_reserve, |
387 | .map_io = omap_h4_map_io, | 382 | .map_io = omap_h4_map_io, |
388 | .init_early = omap_h4_init_early, | 383 | .init_early = omap2420_init_early, |
389 | .init_irq = omap_h4_init_irq, | 384 | .init_irq = omap_h4_init_irq, |
390 | .init_machine = omap_h4_init, | 385 | .init_machine = omap_h4_init, |
391 | .timer = &omap2_timer, | 386 | .timer = &omap2_timer, |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 35be778caf1b..7b66338e451b 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -491,13 +491,6 @@ static struct platform_device *igep_devices[] __initdata = { | |||
491 | &igep_vwlan_device, | 491 | &igep_vwlan_device, |
492 | }; | 492 | }; |
493 | 493 | ||
494 | static void __init igep_init_early(void) | ||
495 | { | ||
496 | omap2_init_common_infrastructure(); | ||
497 | omap2_init_common_devices(m65kxxxxam_sdrc_params, | ||
498 | m65kxxxxam_sdrc_params); | ||
499 | } | ||
500 | |||
501 | static int igep2_keymap[] = { | 494 | static int igep2_keymap[] = { |
502 | KEY(0, 0, KEY_LEFT), | 495 | KEY(0, 0, KEY_LEFT), |
503 | KEY(0, 1, KEY_RIGHT), | 496 | KEY(0, 1, KEY_RIGHT), |
@@ -650,6 +643,8 @@ static void __init igep_init(void) | |||
650 | igep_i2c_init(); | 643 | igep_i2c_init(); |
651 | platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices)); | 644 | platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices)); |
652 | omap_serial_init(); | 645 | omap_serial_init(); |
646 | omap_sdrc_init(m65kxxxxam_sdrc_params, | ||
647 | m65kxxxxam_sdrc_params); | ||
653 | usb_musb_init(NULL); | 648 | usb_musb_init(NULL); |
654 | 649 | ||
655 | igep_flash_init(); | 650 | igep_flash_init(); |
@@ -675,7 +670,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board") | |||
675 | .boot_params = 0x80000100, | 670 | .boot_params = 0x80000100, |
676 | .reserve = omap_reserve, | 671 | .reserve = omap_reserve, |
677 | .map_io = omap3_map_io, | 672 | .map_io = omap3_map_io, |
678 | .init_early = igep_init_early, | 673 | .init_early = omap35xx_init_early, |
679 | .init_irq = omap3_init_irq, | 674 | .init_irq = omap3_init_irq, |
680 | .init_machine = igep_init, | 675 | .init_machine = igep_init, |
681 | .timer = &omap3_timer, | 676 | .timer = &omap3_timer, |
@@ -685,7 +680,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module") | |||
685 | .boot_params = 0x80000100, | 680 | .boot_params = 0x80000100, |
686 | .reserve = omap_reserve, | 681 | .reserve = omap_reserve, |
687 | .map_io = omap3_map_io, | 682 | .map_io = omap3_map_io, |
688 | .init_early = igep_init_early, | 683 | .init_early = omap35xx_init_early, |
689 | .init_irq = omap3_init_irq, | 684 | .init_irq = omap3_init_irq, |
690 | .init_machine = igep_init, | 685 | .init_machine = igep_init, |
691 | .timer = &omap3_timer, | 686 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 218764c9377e..401b9449f722 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -193,12 +193,6 @@ static struct omap_board_config_kernel ldp_config[] __initdata = { | |||
193 | { OMAP_TAG_LCD, &ldp_lcd_config }, | 193 | { OMAP_TAG_LCD, &ldp_lcd_config }, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | static void __init omap_ldp_init_early(void) | ||
197 | { | ||
198 | omap2_init_common_infrastructure(); | ||
199 | omap2_init_common_devices(NULL, NULL); | ||
200 | } | ||
201 | |||
202 | static struct twl4030_gpio_platform_data ldp_gpio_data = { | 196 | static struct twl4030_gpio_platform_data ldp_gpio_data = { |
203 | .gpio_base = OMAP_MAX_GPIO_LINES, | 197 | .gpio_base = OMAP_MAX_GPIO_LINES, |
204 | .irq_base = TWL4030_GPIO_IRQ_BASE, | 198 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
@@ -325,6 +319,7 @@ static void __init omap_ldp_init(void) | |||
325 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); | 319 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); |
326 | omap_ads7846_init(1, 54, 310, NULL); | 320 | omap_ads7846_init(1, 54, 310, NULL); |
327 | omap_serial_init(); | 321 | omap_serial_init(); |
322 | omap_sdrc_init(NULL, NULL); | ||
328 | usb_musb_init(NULL); | 323 | usb_musb_init(NULL); |
329 | board_nand_init(ldp_nand_partitions, | 324 | board_nand_init(ldp_nand_partitions, |
330 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); | 325 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); |
@@ -336,7 +331,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board") | |||
336 | .boot_params = 0x80000100, | 331 | .boot_params = 0x80000100, |
337 | .reserve = omap_reserve, | 332 | .reserve = omap_reserve, |
338 | .map_io = omap3_map_io, | 333 | .map_io = omap3_map_io, |
339 | .init_early = omap_ldp_init_early, | 334 | .init_early = omap3430_init_early, |
340 | .init_irq = omap3_init_irq, | 335 | .init_irq = omap3_init_irq, |
341 | .init_machine = omap_ldp_init, | 336 | .init_machine = omap_ldp_init, |
342 | .timer = &omap3_timer, | 337 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index e11f0c5d608a..77a4e19222e2 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -622,12 +622,6 @@ static void __init n8x0_map_io(void) | |||
622 | omap242x_map_common_io(); | 622 | omap242x_map_common_io(); |
623 | } | 623 | } |
624 | 624 | ||
625 | static void __init n8x0_init_early(void) | ||
626 | { | ||
627 | omap2_init_common_infrastructure(); | ||
628 | omap2_init_common_devices(NULL, NULL); | ||
629 | } | ||
630 | |||
631 | #ifdef CONFIG_OMAP_MUX | 625 | #ifdef CONFIG_OMAP_MUX |
632 | static struct omap_board_mux board_mux[] __initdata = { | 626 | static struct omap_board_mux board_mux[] __initdata = { |
633 | /* I2S codec port pins for McBSP block */ | 627 | /* I2S codec port pins for McBSP block */ |
@@ -689,6 +683,7 @@ static void __init n8x0_init_machine(void) | |||
689 | i2c_register_board_info(2, n810_i2c_board_info_2, | 683 | i2c_register_board_info(2, n810_i2c_board_info_2, |
690 | ARRAY_SIZE(n810_i2c_board_info_2)); | 684 | ARRAY_SIZE(n810_i2c_board_info_2)); |
691 | board_serial_init(); | 685 | board_serial_init(); |
686 | omap_sdrc_init(NULL, NULL); | ||
692 | gpmc_onenand_init(board_onenand_data); | 687 | gpmc_onenand_init(board_onenand_data); |
693 | n8x0_mmc_init(); | 688 | n8x0_mmc_init(); |
694 | n8x0_usb_init(); | 689 | n8x0_usb_init(); |
@@ -698,7 +693,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800") | |||
698 | .boot_params = 0x80000100, | 693 | .boot_params = 0x80000100, |
699 | .reserve = omap_reserve, | 694 | .reserve = omap_reserve, |
700 | .map_io = n8x0_map_io, | 695 | .map_io = n8x0_map_io, |
701 | .init_early = n8x0_init_early, | 696 | .init_early = omap2420_init_early, |
702 | .init_irq = omap2_init_irq, | 697 | .init_irq = omap2_init_irq, |
703 | .init_machine = n8x0_init_machine, | 698 | .init_machine = n8x0_init_machine, |
704 | .timer = &omap2_timer, | 699 | .timer = &omap2_timer, |
@@ -708,7 +703,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810") | |||
708 | .boot_params = 0x80000100, | 703 | .boot_params = 0x80000100, |
709 | .reserve = omap_reserve, | 704 | .reserve = omap_reserve, |
710 | .map_io = n8x0_map_io, | 705 | .map_io = n8x0_map_io, |
711 | .init_early = n8x0_init_early, | 706 | .init_early = omap2420_init_early, |
712 | .init_irq = omap2_init_irq, | 707 | .init_irq = omap2_init_irq, |
713 | .init_machine = n8x0_init_machine, | 708 | .init_machine = n8x0_init_machine, |
714 | .timer = &omap2_timer, | 709 | .timer = &omap2_timer, |
@@ -718,7 +713,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") | |||
718 | .boot_params = 0x80000100, | 713 | .boot_params = 0x80000100, |
719 | .reserve = omap_reserve, | 714 | .reserve = omap_reserve, |
720 | .map_io = n8x0_map_io, | 715 | .map_io = n8x0_map_io, |
721 | .init_early = n8x0_init_early, | 716 | .init_early = omap2420_init_early, |
722 | .init_irq = omap2_init_irq, | 717 | .init_irq = omap2_init_irq, |
723 | .init_machine = n8x0_init_machine, | 718 | .init_machine = n8x0_init_machine, |
724 | .timer = &omap2_timer, | 719 | .timer = &omap2_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 3ae16b4e3f52..ce3234d6a344 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -447,8 +447,6 @@ static struct platform_device keys_gpio = { | |||
447 | static void __init omap3_beagle_init_early(void) | 447 | static void __init omap3_beagle_init_early(void) |
448 | { | 448 | { |
449 | omap2_init_common_infrastructure(); | 449 | omap2_init_common_infrastructure(); |
450 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
451 | mt46h32m32lf6_sdrc_params); | ||
452 | } | 450 | } |
453 | 451 | ||
454 | static void __init omap3_beagle_init_irq(void) | 452 | static void __init omap3_beagle_init_irq(void) |
@@ -534,6 +532,8 @@ static void __init omap3_beagle_init(void) | |||
534 | ARRAY_SIZE(omap3_beagle_devices)); | 532 | ARRAY_SIZE(omap3_beagle_devices)); |
535 | omap_display_init(&beagle_dss_data); | 533 | omap_display_init(&beagle_dss_data); |
536 | omap_serial_init(); | 534 | omap_serial_init(); |
535 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
536 | mt46h32m32lf6_sdrc_params); | ||
537 | 537 | ||
538 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | 538 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); |
539 | /* REVISIT leave DVI powered down until it's needed ... */ | 539 | /* REVISIT leave DVI powered down until it's needed ... */ |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index c452b3f3331a..a1184b347aeb 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -520,12 +520,6 @@ static int __init omap3_evm_i2c_init(void) | |||
520 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | 520 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { |
521 | }; | 521 | }; |
522 | 522 | ||
523 | static void __init omap3_evm_init_early(void) | ||
524 | { | ||
525 | omap2_init_common_infrastructure(); | ||
526 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); | ||
527 | } | ||
528 | |||
529 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { | 523 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { |
530 | 524 | ||
531 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, | 525 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, |
@@ -640,6 +634,7 @@ static void __init omap3_evm_init(void) | |||
640 | omap_display_init(&omap3_evm_dss_data); | 634 | omap_display_init(&omap3_evm_dss_data); |
641 | 635 | ||
642 | omap_serial_init(); | 636 | omap_serial_init(); |
637 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL); | ||
643 | 638 | ||
644 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ | 639 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ |
645 | usb_nop_xceiv_register(); | 640 | usb_nop_xceiv_register(); |
@@ -684,7 +679,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM") | |||
684 | .boot_params = 0x80000100, | 679 | .boot_params = 0x80000100, |
685 | .reserve = omap_reserve, | 680 | .reserve = omap_reserve, |
686 | .map_io = omap3_map_io, | 681 | .map_io = omap3_map_io, |
687 | .init_early = omap3_evm_init_early, | 682 | .init_early = omap35xx_init_early, |
688 | .init_irq = omap3_init_irq, | 683 | .init_irq = omap3_init_irq, |
689 | .init_machine = omap3_evm_init, | 684 | .init_machine = omap3_evm_init, |
690 | .timer = &omap3_timer, | 685 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index 703aeb5b8fd4..3a1dd84faca0 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -182,12 +182,6 @@ static inline void __init board_smsc911x_init(void) | |||
182 | gpmc_smsc911x_init(&board_smsc911x_data); | 182 | gpmc_smsc911x_init(&board_smsc911x_data); |
183 | } | 183 | } |
184 | 184 | ||
185 | static void __init omap3logic_init_early(void) | ||
186 | { | ||
187 | omap2_init_common_infrastructure(); | ||
188 | omap2_init_common_devices(NULL, NULL); | ||
189 | } | ||
190 | |||
191 | #ifdef CONFIG_OMAP_MUX | 185 | #ifdef CONFIG_OMAP_MUX |
192 | static struct omap_board_mux board_mux[] __initdata = { | 186 | static struct omap_board_mux board_mux[] __initdata = { |
193 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 187 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
@@ -200,6 +194,7 @@ static void __init omap3logic_init(void) | |||
200 | omap3torpedo_fix_pbias_voltage(); | 194 | omap3torpedo_fix_pbias_voltage(); |
201 | omap3logic_i2c_init(); | 195 | omap3logic_i2c_init(); |
202 | omap_serial_init(); | 196 | omap_serial_init(); |
197 | omap_sdrc_init(NULL, NULL); | ||
203 | board_mmc_init(); | 198 | board_mmc_init(); |
204 | board_smsc911x_init(); | 199 | board_smsc911x_init(); |
205 | 200 | ||
@@ -211,7 +206,7 @@ static void __init omap3logic_init(void) | |||
211 | MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") | 206 | MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") |
212 | .boot_params = 0x80000100, | 207 | .boot_params = 0x80000100, |
213 | .map_io = omap3_map_io, | 208 | .map_io = omap3_map_io, |
214 | .init_early = omap3logic_init_early, | 209 | .init_early = omap35xx_init_early, |
215 | .init_irq = omap3_init_irq, | 210 | .init_irq = omap3_init_irq, |
216 | .init_machine = omap3logic_init, | 211 | .init_machine = omap3logic_init, |
217 | .timer = &omap3_timer, | 212 | .timer = &omap3_timer, |
@@ -220,7 +215,7 @@ MACHINE_END | |||
220 | MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") | 215 | MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") |
221 | .boot_params = 0x80000100, | 216 | .boot_params = 0x80000100, |
222 | .map_io = omap3_map_io, | 217 | .map_io = omap3_map_io, |
223 | .init_early = omap3logic_init_early, | 218 | .init_early = omap35xx_init_early, |
224 | .init_irq = omap3_init_irq, | 219 | .init_irq = omap3_init_irq, |
225 | .init_machine = omap3logic_init, | 220 | .init_machine = omap3logic_init, |
226 | .timer = &omap3_timer, | 221 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 080d7bd6795e..e46bf5249559 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -525,13 +525,6 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { | |||
525 | } | 525 | } |
526 | }; | 526 | }; |
527 | 527 | ||
528 | static void __init omap3pandora_init_early(void) | ||
529 | { | ||
530 | omap2_init_common_infrastructure(); | ||
531 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
532 | mt46h32m32lf6_sdrc_params); | ||
533 | } | ||
534 | |||
535 | static void __init pandora_wl1251_init(void) | 528 | static void __init pandora_wl1251_init(void) |
536 | { | 529 | { |
537 | struct wl12xx_platform_data pandora_wl1251_pdata; | 530 | struct wl12xx_platform_data pandora_wl1251_pdata; |
@@ -593,6 +586,8 @@ static void __init omap3pandora_init(void) | |||
593 | ARRAY_SIZE(omap3pandora_devices)); | 586 | ARRAY_SIZE(omap3pandora_devices)); |
594 | omap_display_init(&pandora_dss_data); | 587 | omap_display_init(&pandora_dss_data); |
595 | omap_serial_init(); | 588 | omap_serial_init(); |
589 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
590 | mt46h32m32lf6_sdrc_params); | ||
596 | spi_register_board_info(omap3pandora_spi_board_info, | 591 | spi_register_board_info(omap3pandora_spi_board_info, |
597 | ARRAY_SIZE(omap3pandora_spi_board_info)); | 592 | ARRAY_SIZE(omap3pandora_spi_board_info)); |
598 | omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); | 593 | omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); |
@@ -609,7 +604,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") | |||
609 | .boot_params = 0x80000100, | 604 | .boot_params = 0x80000100, |
610 | .reserve = omap_reserve, | 605 | .reserve = omap_reserve, |
611 | .map_io = omap3_map_io, | 606 | .map_io = omap3_map_io, |
612 | .init_early = omap3pandora_init_early, | 607 | .init_early = omap35xx_init_early, |
613 | .init_irq = omap3_init_irq, | 608 | .init_irq = omap3_init_irq, |
614 | .init_machine = omap3pandora_init, | 609 | .init_machine = omap3pandora_init, |
615 | .timer = &omap3_timer, | 610 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 8e104980ea26..807c27406792 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -428,12 +428,6 @@ static int __init omap3_stalker_i2c_init(void) | |||
428 | static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { | 428 | static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { |
429 | }; | 429 | }; |
430 | 430 | ||
431 | static void __init omap3_stalker_init_early(void) | ||
432 | { | ||
433 | omap2_init_common_infrastructure(); | ||
434 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); | ||
435 | } | ||
436 | |||
437 | static void __init omap3_stalker_init_irq(void) | 431 | static void __init omap3_stalker_init_irq(void) |
438 | { | 432 | { |
439 | omap3_init_irq(); | 433 | omap3_init_irq(); |
@@ -478,6 +472,7 @@ static void __init omap3_stalker_init(void) | |||
478 | omap_display_init(&omap3_stalker_dss_data); | 472 | omap_display_init(&omap3_stalker_dss_data); |
479 | 473 | ||
480 | omap_serial_init(); | 474 | omap_serial_init(); |
475 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL); | ||
481 | usb_musb_init(NULL); | 476 | usb_musb_init(NULL); |
482 | usbhs_init(&usbhs_bdata); | 477 | usbhs_init(&usbhs_bdata); |
483 | omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL); | 478 | omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL); |
@@ -496,7 +491,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER") | |||
496 | /* Maintainer: Jason Lam -lzg@ema-tech.com */ | 491 | /* Maintainer: Jason Lam -lzg@ema-tech.com */ |
497 | .boot_params = 0x80000100, | 492 | .boot_params = 0x80000100, |
498 | .map_io = omap3_map_io, | 493 | .map_io = omap3_map_io, |
499 | .init_early = omap3_stalker_init_early, | 494 | .init_early = omap35xx_init_early, |
500 | .init_irq = omap3_stalker_init_irq, | 495 | .init_irq = omap3_stalker_init_irq, |
501 | .init_machine = omap3_stalker_init, | 496 | .init_machine = omap3_stalker_init, |
502 | .timer = &omap3_secure_timer, | 497 | .timer = &omap3_secure_timer, |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 852ea0464057..f7f18092f36d 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -326,13 +326,6 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
326 | }; | 326 | }; |
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | static void __init omap3_touchbook_init_early(void) | ||
330 | { | ||
331 | omap2_init_common_infrastructure(); | ||
332 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
333 | mt46h32m32lf6_sdrc_params); | ||
334 | } | ||
335 | |||
336 | static void __init omap3_touchbook_init_irq(void) | 329 | static void __init omap3_touchbook_init_irq(void) |
337 | { | 330 | { |
338 | omap3_init_irq(); | 331 | omap3_init_irq(); |
@@ -385,6 +378,8 @@ static void __init omap3_touchbook_init(void) | |||
385 | platform_add_devices(omap3_touchbook_devices, | 378 | platform_add_devices(omap3_touchbook_devices, |
386 | ARRAY_SIZE(omap3_touchbook_devices)); | 379 | ARRAY_SIZE(omap3_touchbook_devices)); |
387 | omap_serial_init(); | 380 | omap_serial_init(); |
381 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
382 | mt46h32m32lf6_sdrc_params); | ||
388 | 383 | ||
389 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | 384 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); |
390 | /* REVISIT leave DVI powered down until it's needed ... */ | 385 | /* REVISIT leave DVI powered down until it's needed ... */ |
@@ -407,7 +402,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") | |||
407 | .boot_params = 0x80000100, | 402 | .boot_params = 0x80000100, |
408 | .reserve = omap_reserve, | 403 | .reserve = omap_reserve, |
409 | .map_io = omap3_map_io, | 404 | .map_io = omap3_map_io, |
410 | .init_early = omap3_touchbook_init_early, | 405 | .init_early = omap3430_init_early, |
411 | .init_irq = omap3_touchbook_init_irq, | 406 | .init_irq = omap3_touchbook_init_irq, |
412 | .init_machine = omap3_touchbook_init, | 407 | .init_machine = omap3_touchbook_init, |
413 | .timer = &omap3_secure_timer, | 408 | .timer = &omap3_secure_timer, |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 9aaa96057666..1bce76589784 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -95,12 +95,6 @@ static struct platform_device *panda_devices[] __initdata = { | |||
95 | &wl1271_device, | 95 | &wl1271_device, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static void __init omap4_panda_init_early(void) | ||
99 | { | ||
100 | omap2_init_common_infrastructure(); | ||
101 | omap2_init_common_devices(NULL, NULL); | ||
102 | } | ||
103 | |||
104 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 98 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
105 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, | 99 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
106 | .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, | 100 | .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, |
@@ -569,6 +563,7 @@ static void __init omap4_panda_init(void) | |||
569 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); | 563 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); |
570 | platform_device_register(&omap_vwlan_device); | 564 | platform_device_register(&omap_vwlan_device); |
571 | board_serial_init(); | 565 | board_serial_init(); |
566 | omap_sdrc_init(NULL, NULL); | ||
572 | omap4_twl6030_hsmmc_init(mmc); | 567 | omap4_twl6030_hsmmc_init(mmc); |
573 | omap4_ehci_init(); | 568 | omap4_ehci_init(); |
574 | usb_musb_init(&musb_board_data); | 569 | usb_musb_init(&musb_board_data); |
@@ -586,7 +581,7 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") | |||
586 | .boot_params = 0x80000100, | 581 | .boot_params = 0x80000100, |
587 | .reserve = omap_reserve, | 582 | .reserve = omap_reserve, |
588 | .map_io = omap4_panda_map_io, | 583 | .map_io = omap4_panda_map_io, |
589 | .init_early = omap4_panda_init_early, | 584 | .init_early = omap4430_init_early, |
590 | .init_irq = gic_init_irq, | 585 | .init_irq = gic_init_irq, |
591 | .init_machine = omap4_panda_init, | 586 | .init_machine = omap4_panda_init, |
592 | .timer = &omap4_timer, | 587 | .timer = &omap4_timer, |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index f949a9954d76..7228ae50802d 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -478,13 +478,6 @@ static int __init overo_spi_init(void) | |||
478 | return 0; | 478 | return 0; |
479 | } | 479 | } |
480 | 480 | ||
481 | static void __init overo_init_early(void) | ||
482 | { | ||
483 | omap2_init_common_infrastructure(); | ||
484 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
485 | mt46h32m32lf6_sdrc_params); | ||
486 | } | ||
487 | |||
488 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 481 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
489 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, | 482 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, |
490 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, | 483 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
@@ -514,6 +507,8 @@ static void __init overo_init(void) | |||
514 | overo_i2c_init(); | 507 | overo_i2c_init(); |
515 | omap_display_init(&overo_dss_data); | 508 | omap_display_init(&overo_dss_data); |
516 | omap_serial_init(); | 509 | omap_serial_init(); |
510 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
511 | mt46h32m32lf6_sdrc_params); | ||
517 | omap_nand_flash_init(0, overo_nand_partitions, | 512 | omap_nand_flash_init(0, overo_nand_partitions, |
518 | ARRAY_SIZE(overo_nand_partitions)); | 513 | ARRAY_SIZE(overo_nand_partitions)); |
519 | usb_musb_init(NULL); | 514 | usb_musb_init(NULL); |
@@ -564,7 +559,7 @@ MACHINE_START(OVERO, "Gumstix Overo") | |||
564 | .boot_params = 0x80000100, | 559 | .boot_params = 0x80000100, |
565 | .reserve = omap_reserve, | 560 | .reserve = omap_reserve, |
566 | .map_io = omap3_map_io, | 561 | .map_io = omap3_map_io, |
567 | .init_early = overo_init_early, | 562 | .init_early = omap35xx_init_early, |
568 | .init_irq = omap3_init_irq, | 563 | .init_irq = omap3_init_irq, |
569 | .init_machine = overo_init, | 564 | .init_machine = overo_init, |
570 | .timer = &omap3_timer, | 565 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index 7dfed24ee12e..a3182e846b14 100644 --- a/arch/arm/mach-omap2/board-rm680.c +++ b/arch/arm/mach-omap2/board-rm680.c | |||
@@ -123,15 +123,6 @@ static void __init rm680_peripherals_init(void) | |||
123 | omap2_hsmmc_init(mmc); | 123 | omap2_hsmmc_init(mmc); |
124 | } | 124 | } |
125 | 125 | ||
126 | static void __init rm680_init_early(void) | ||
127 | { | ||
128 | struct omap_sdrc_params *sdrc_params; | ||
129 | |||
130 | omap2_init_common_infrastructure(); | ||
131 | sdrc_params = nokia_get_sdram_timings(); | ||
132 | omap2_init_common_devices(sdrc_params, sdrc_params); | ||
133 | } | ||
134 | |||
135 | #ifdef CONFIG_OMAP_MUX | 126 | #ifdef CONFIG_OMAP_MUX |
136 | static struct omap_board_mux board_mux[] __initdata = { | 127 | static struct omap_board_mux board_mux[] __initdata = { |
137 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 128 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
@@ -140,8 +131,14 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
140 | 131 | ||
141 | static void __init rm680_init(void) | 132 | static void __init rm680_init(void) |
142 | { | 133 | { |
134 | struct omap_sdrc_params *sdrc_params; | ||
135 | |||
143 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 136 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
144 | omap_serial_init(); | 137 | omap_serial_init(); |
138 | |||
139 | sdrc_params = nokia_get_sdram_timings(); | ||
140 | omap_sdrc_init(sdrc_params, sdrc_params); | ||
141 | |||
145 | usb_musb_init(NULL); | 142 | usb_musb_init(NULL); |
146 | rm680_peripherals_init(); | 143 | rm680_peripherals_init(); |
147 | } | 144 | } |
@@ -156,7 +153,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") | |||
156 | .boot_params = 0x80000100, | 153 | .boot_params = 0x80000100, |
157 | .reserve = omap_reserve, | 154 | .reserve = omap_reserve, |
158 | .map_io = rm680_map_io, | 155 | .map_io = rm680_map_io, |
159 | .init_early = rm680_init_early, | 156 | .init_early = omap3630_init_early, |
160 | .init_irq = omap3_init_irq, | 157 | .init_irq = omap3_init_irq, |
161 | .init_machine = rm680_init, | 158 | .init_machine = rm680_init, |
162 | .timer = &omap3_timer, | 159 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 5ea142f9bc97..32a79e28379c 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
@@ -102,15 +102,6 @@ static struct omap_board_config_kernel rx51_config[] = { | |||
102 | { OMAP_TAG_LCD, &rx51_lcd_config }, | 102 | { OMAP_TAG_LCD, &rx51_lcd_config }, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | static void __init rx51_init_early(void) | ||
106 | { | ||
107 | struct omap_sdrc_params *sdrc_params; | ||
108 | |||
109 | omap2_init_common_infrastructure(); | ||
110 | sdrc_params = nokia_get_sdram_timings(); | ||
111 | omap2_init_common_devices(sdrc_params, sdrc_params); | ||
112 | } | ||
113 | |||
114 | extern void __init rx51_peripherals_init(void); | 105 | extern void __init rx51_peripherals_init(void); |
115 | 106 | ||
116 | #ifdef CONFIG_OMAP_MUX | 107 | #ifdef CONFIG_OMAP_MUX |
@@ -127,11 +118,17 @@ static struct omap_musb_board_data musb_board_data = { | |||
127 | 118 | ||
128 | static void __init rx51_init(void) | 119 | static void __init rx51_init(void) |
129 | { | 120 | { |
121 | struct omap_sdrc_params *sdrc_params; | ||
122 | |||
130 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 123 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
131 | omap_board_config = rx51_config; | 124 | omap_board_config = rx51_config; |
132 | omap_board_config_size = ARRAY_SIZE(rx51_config); | 125 | omap_board_config_size = ARRAY_SIZE(rx51_config); |
133 | omap3_pm_init_cpuidle(rx51_cpuidle_params); | 126 | omap3_pm_init_cpuidle(rx51_cpuidle_params); |
134 | omap_serial_init(); | 127 | omap_serial_init(); |
128 | |||
129 | sdrc_params = nokia_get_sdram_timings(); | ||
130 | omap_sdrc_init(sdrc_params, sdrc_params); | ||
131 | |||
135 | usb_musb_init(&musb_board_data); | 132 | usb_musb_init(&musb_board_data); |
136 | rx51_peripherals_init(); | 133 | rx51_peripherals_init(); |
137 | 134 | ||
@@ -159,7 +156,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") | |||
159 | .boot_params = 0x80000100, | 156 | .boot_params = 0x80000100, |
160 | .reserve = rx51_reserve, | 157 | .reserve = rx51_reserve, |
161 | .map_io = rx51_map_io, | 158 | .map_io = rx51_map_io, |
162 | .init_early = rx51_init_early, | 159 | .init_early = omap3430_init_early, |
163 | .init_irq = omap3_init_irq, | 160 | .init_irq = omap3_init_irq, |
164 | .init_machine = rx51_init, | 161 | .init_machine = rx51_init, |
165 | .timer = &omap3_timer, | 162 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c index a85d5b0b11da..981ca00d6e29 100644 --- a/arch/arm/mach-omap2/board-ti8168evm.c +++ b/arch/arm/mach-omap2/board-ti8168evm.c | |||
@@ -27,15 +27,10 @@ | |||
27 | static struct omap_board_config_kernel ti8168_evm_config[] __initdata = { | 27 | static struct omap_board_config_kernel ti8168_evm_config[] __initdata = { |
28 | }; | 28 | }; |
29 | 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(void) | 30 | static void __init ti8168_evm_init(void) |
37 | { | 31 | { |
38 | omap_serial_init(); | 32 | omap_serial_init(); |
33 | omap_sdrc_init(NULL, NULL); | ||
39 | omap_board_config = ti8168_evm_config; | 34 | omap_board_config = ti8168_evm_config; |
40 | omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); | 35 | omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); |
41 | } | 36 | } |
@@ -50,7 +45,7 @@ MACHINE_START(TI8168EVM, "ti8168evm") | |||
50 | /* Maintainer: Texas Instruments */ | 45 | /* Maintainer: Texas Instruments */ |
51 | .boot_params = 0x80000100, | 46 | .boot_params = 0x80000100, |
52 | .map_io = ti8168_evm_map_io, | 47 | .map_io = ti8168_evm_map_io, |
53 | .init_early = ti8168_init_early, | 48 | .init_early = ti816x_init_early, |
54 | .init_irq = ti816x_init_irq, | 49 | .init_irq = ti816x_init_irq, |
55 | .timer = &omap3_timer, | 50 | .timer = &omap3_timer, |
56 | .init_machine = ti8168_evm_init, | 51 | .init_machine = ti8168_evm_init, |
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c index 8a98c3c303fc..d56c79661038 100644 --- a/arch/arm/mach-omap2/board-zoom.c +++ b/arch/arm/mach-omap2/board-zoom.c | |||
@@ -34,17 +34,6 @@ | |||
34 | 34 | ||
35 | #define ZOOM3_EHCI_RESET_GPIO 64 | 35 | #define ZOOM3_EHCI_RESET_GPIO 64 |
36 | 36 | ||
37 | static void __init omap_zoom_init_early(void) | ||
38 | { | ||
39 | omap2_init_common_infrastructure(); | ||
40 | if (machine_is_omap_zoom2()) | ||
41 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
42 | mt46h32m32lf6_sdrc_params); | ||
43 | else if (machine_is_omap_zoom3()) | ||
44 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, | ||
45 | h8mbx00u0mer0em_sdrc_params); | ||
46 | } | ||
47 | |||
48 | #ifdef CONFIG_OMAP_MUX | 37 | #ifdef CONFIG_OMAP_MUX |
49 | static struct omap_board_mux board_mux[] __initdata = { | 38 | static struct omap_board_mux board_mux[] __initdata = { |
50 | /* WLAN IRQ - GPIO 162 */ | 39 | /* WLAN IRQ - GPIO 162 */ |
@@ -129,6 +118,14 @@ static void __init omap_zoom_init(void) | |||
129 | ZOOM_NAND_CS, NAND_BUSWIDTH_16); | 118 | ZOOM_NAND_CS, NAND_BUSWIDTH_16); |
130 | zoom_debugboard_init(); | 119 | zoom_debugboard_init(); |
131 | zoom_peripherals_init(); | 120 | zoom_peripherals_init(); |
121 | |||
122 | if (machine_is_omap_zoom2()) | ||
123 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | ||
124 | mt46h32m32lf6_sdrc_params); | ||
125 | else if (machine_is_omap_zoom3()) | ||
126 | omap_sdrc_init(h8mbx00u0mer0em_sdrc_params, | ||
127 | h8mbx00u0mer0em_sdrc_params); | ||
128 | |||
132 | zoom_display_init(); | 129 | zoom_display_init(); |
133 | } | 130 | } |
134 | 131 | ||
@@ -136,7 +133,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") | |||
136 | .boot_params = 0x80000100, | 133 | .boot_params = 0x80000100, |
137 | .reserve = omap_reserve, | 134 | .reserve = omap_reserve, |
138 | .map_io = omap3_map_io, | 135 | .map_io = omap3_map_io, |
139 | .init_early = omap_zoom_init_early, | 136 | .init_early = omap3430_init_early, |
140 | .init_irq = omap3_init_irq, | 137 | .init_irq = omap3_init_irq, |
141 | .init_machine = omap_zoom_init, | 138 | .init_machine = omap_zoom_init, |
142 | .timer = &omap3_timer, | 139 | .timer = &omap3_timer, |
@@ -146,7 +143,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") | |||
146 | .boot_params = 0x80000100, | 143 | .boot_params = 0x80000100, |
147 | .reserve = omap_reserve, | 144 | .reserve = omap_reserve, |
148 | .map_io = omap3_map_io, | 145 | .map_io = omap3_map_io, |
149 | .init_early = omap_zoom_init_early, | 146 | .init_early = omap3630_init_early, |
150 | .init_irq = omap3_init_irq, | 147 | .init_irq = omap3_init_irq, |
151 | .init_machine = omap_zoom_init, | 148 | .init_machine = omap_zoom_init, |
152 | .timer = &omap3_timer, | 149 | .timer = &omap3_timer, |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index ffd55b1c4396..dadb8c6c0115 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -3078,6 +3078,7 @@ static struct clk gpt12_fck = { | |||
3078 | .name = "gpt12_fck", | 3078 | .name = "gpt12_fck", |
3079 | .ops = &clkops_null, | 3079 | .ops = &clkops_null, |
3080 | .parent = &secure_32k_fck, | 3080 | .parent = &secure_32k_fck, |
3081 | .clkdm_name = "wkup_clkdm", | ||
3081 | .recalc = &followparent_recalc, | 3082 | .recalc = &followparent_recalc, |
3082 | }; | 3083 | }; |
3083 | 3084 | ||
@@ -3085,6 +3086,7 @@ static struct clk wdt1_fck = { | |||
3085 | .name = "wdt1_fck", | 3086 | .name = "wdt1_fck", |
3086 | .ops = &clkops_null, | 3087 | .ops = &clkops_null, |
3087 | .parent = &secure_32k_fck, | 3088 | .parent = &secure_32k_fck, |
3089 | .clkdm_name = "wkup_clkdm", | ||
3088 | .recalc = &followparent_recalc, | 3090 | .recalc = &followparent_recalc, |
3089 | }; | 3091 | }; |
3090 | 3092 | ||
@@ -3470,7 +3472,16 @@ int __init omap3xxx_clk_init(void) | |||
3470 | struct omap_clk *c; | 3472 | struct omap_clk *c; |
3471 | u32 cpu_clkflg = 0; | 3473 | u32 cpu_clkflg = 0; |
3472 | 3474 | ||
3473 | if (cpu_is_omap3517()) { | 3475 | /* |
3476 | * 3505 must be tested before 3517, since 3517 returns true | ||
3477 | * for both AM3517 chips and AM3517 family chips, which | ||
3478 | * includes 3505. Unfortunately there's no obvious family | ||
3479 | * test for 3517/3505 :-( | ||
3480 | */ | ||
3481 | if (cpu_is_omap3505()) { | ||
3482 | cpu_mask = RATE_IN_34XX; | ||
3483 | cpu_clkflg = CK_3505; | ||
3484 | } else if (cpu_is_omap3517()) { | ||
3474 | cpu_mask = RATE_IN_34XX; | 3485 | cpu_mask = RATE_IN_34XX; |
3475 | cpu_clkflg = CK_3517; | 3486 | cpu_clkflg = CK_3517; |
3476 | } else if (cpu_is_omap3505()) { | 3487 | } else if (cpu_is_omap3505()) { |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 2af0e3f00ce1..c0b6fbda3408 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -3376,10 +3376,18 @@ int __init omap4xxx_clk_init(void) | |||
3376 | } else if (cpu_is_omap446x()) { | 3376 | } else if (cpu_is_omap446x()) { |
3377 | cpu_mask = RATE_IN_4460; | 3377 | cpu_mask = RATE_IN_4460; |
3378 | cpu_clkflg = CK_446X; | 3378 | cpu_clkflg = CK_446X; |
3379 | } else { | ||
3380 | return 0; | ||
3379 | } | 3381 | } |
3380 | 3382 | ||
3381 | clk_init(&omap2_clk_functions); | 3383 | clk_init(&omap2_clk_functions); |
3382 | omap2_clk_disable_clkdm_control(); | 3384 | |
3385 | /* | ||
3386 | * Must stay commented until all OMAP SoC drivers are | ||
3387 | * converted to runtime PM, or drivers may start crashing | ||
3388 | * | ||
3389 | * omap2_clk_disable_clkdm_control(); | ||
3390 | */ | ||
3383 | 3391 | ||
3384 | for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks); | 3392 | for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks); |
3385 | c++) | 3393 | c++) |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index ab7db083f97f..8480ee4344ea 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -73,9 +73,6 @@ static int _clkdm_register(struct clockdomain *clkdm) | |||
73 | if (!clkdm || !clkdm->name) | 73 | if (!clkdm || !clkdm->name) |
74 | return -EINVAL; | 74 | return -EINVAL; |
75 | 75 | ||
76 | if (!omap_chip_is(clkdm->omap_chip)) | ||
77 | return -EINVAL; | ||
78 | |||
79 | pwrdm = pwrdm_lookup(clkdm->pwrdm.name); | 76 | pwrdm = pwrdm_lookup(clkdm->pwrdm.name); |
80 | if (!pwrdm) { | 77 | if (!pwrdm) { |
81 | pr_err("clockdomain: %s: powerdomain %s does not exist\n", | 78 | pr_err("clockdomain: %s: powerdomain %s does not exist\n", |
@@ -105,13 +102,10 @@ static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm, | |||
105 | { | 102 | { |
106 | struct clkdm_dep *cd; | 103 | struct clkdm_dep *cd; |
107 | 104 | ||
108 | if (!clkdm || !deps || !omap_chip_is(clkdm->omap_chip)) | 105 | if (!clkdm || !deps) |
109 | return ERR_PTR(-EINVAL); | 106 | return ERR_PTR(-EINVAL); |
110 | 107 | ||
111 | for (cd = deps; cd->clkdm_name; cd++) { | 108 | for (cd = deps; cd->clkdm_name; cd++) { |
112 | if (!omap_chip_is(cd->omap_chip)) | ||
113 | continue; | ||
114 | |||
115 | if (!cd->clkdm && cd->clkdm_name) | 109 | if (!cd->clkdm && cd->clkdm_name) |
116 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); | 110 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); |
117 | 111 | ||
@@ -148,9 +142,6 @@ static void _autodep_lookup(struct clkdm_autodep *autodep) | |||
148 | if (!autodep) | 142 | if (!autodep) |
149 | return; | 143 | return; |
150 | 144 | ||
151 | if (!omap_chip_is(autodep->omap_chip)) | ||
152 | return; | ||
153 | |||
154 | clkdm = clkdm_lookup(autodep->clkdm.name); | 145 | clkdm = clkdm_lookup(autodep->clkdm.name); |
155 | if (!clkdm) { | 146 | if (!clkdm) { |
156 | pr_err("clockdomain: autodeps: clockdomain %s does not exist\n", | 147 | pr_err("clockdomain: autodeps: clockdomain %s does not exist\n", |
@@ -182,9 +173,6 @@ void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
182 | if (IS_ERR(autodep->clkdm.ptr)) | 173 | if (IS_ERR(autodep->clkdm.ptr)) |
183 | continue; | 174 | continue; |
184 | 175 | ||
185 | if (!omap_chip_is(autodep->omap_chip)) | ||
186 | continue; | ||
187 | |||
188 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " | 176 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " |
189 | "clkdm %s\n", autodep->clkdm.ptr->name, | 177 | "clkdm %s\n", autodep->clkdm.ptr->name, |
190 | clkdm->name); | 178 | clkdm->name); |
@@ -216,9 +204,6 @@ void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
216 | if (IS_ERR(autodep->clkdm.ptr)) | 204 | if (IS_ERR(autodep->clkdm.ptr)) |
217 | continue; | 205 | continue; |
218 | 206 | ||
219 | if (!omap_chip_is(autodep->omap_chip)) | ||
220 | continue; | ||
221 | |||
222 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " | 207 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " |
223 | "clkdm %s\n", autodep->clkdm.ptr->name, | 208 | "clkdm %s\n", autodep->clkdm.ptr->name, |
224 | clkdm->name); | 209 | clkdm->name); |
@@ -243,8 +228,6 @@ static void _resolve_clkdm_deps(struct clockdomain *clkdm, | |||
243 | struct clkdm_dep *cd; | 228 | struct clkdm_dep *cd; |
244 | 229 | ||
245 | for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) { | 230 | for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) { |
246 | if (!omap_chip_is(cd->omap_chip)) | ||
247 | continue; | ||
248 | if (cd->clkdm) | 231 | if (cd->clkdm) |
249 | continue; | 232 | continue; |
250 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); | 233 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); |
@@ -257,43 +240,113 @@ static void _resolve_clkdm_deps(struct clockdomain *clkdm, | |||
257 | /* Public functions */ | 240 | /* Public functions */ |
258 | 241 | ||
259 | /** | 242 | /** |
260 | * clkdm_init - set up the clockdomain layer | 243 | * clkdm_register_platform_funcs - register clockdomain implementation fns |
261 | * @clkdms: optional pointer to an array of clockdomains to register | 244 | * @co: func pointers for arch specific implementations |
262 | * @init_autodeps: optional pointer to an array of autodeps to register | 245 | * |
263 | * @custom_funcs: func pointers for arch specific implementations | 246 | * Register the list of function pointers used to implement the |
264 | * | 247 | * clockdomain functions on different OMAP SoCs. Should be called |
265 | * Set up internal state. If a pointer to an array of clockdomains | 248 | * before any other clkdm_register*() function. Returns -EINVAL if |
266 | * @clkdms was supplied, loop through the list of clockdomains, | 249 | * @co is null, -EEXIST if platform functions have already been |
267 | * register all that are available on the current platform. Similarly, | 250 | * registered, or 0 upon success. |
268 | * if a pointer to an array of clockdomain autodependencies | 251 | */ |
269 | * @init_autodeps was provided, register those. No return value. | 252 | int clkdm_register_platform_funcs(struct clkdm_ops *co) |
253 | { | ||
254 | if (!co) | ||
255 | return -EINVAL; | ||
256 | |||
257 | if (arch_clkdm) | ||
258 | return -EEXIST; | ||
259 | |||
260 | arch_clkdm = co; | ||
261 | |||
262 | return 0; | ||
263 | }; | ||
264 | |||
265 | /** | ||
266 | * clkdm_register_clkdms - register SoC clockdomains | ||
267 | * @cs: pointer to an array of struct clockdomain to register | ||
268 | * | ||
269 | * Register the clockdomains available on a particular OMAP SoC. Must | ||
270 | * be called after clkdm_register_platform_funcs(). May be called | ||
271 | * multiple times. Returns -EACCES if called before | ||
272 | * clkdm_register_platform_funcs(); -EINVAL if the argument @cs is | ||
273 | * null; or 0 upon success. | ||
270 | */ | 274 | */ |
271 | void clkdm_init(struct clockdomain **clkdms, | 275 | int clkdm_register_clkdms(struct clockdomain **cs) |
272 | struct clkdm_autodep *init_autodeps, | ||
273 | struct clkdm_ops *custom_funcs) | ||
274 | { | 276 | { |
275 | struct clockdomain **c = NULL; | 277 | struct clockdomain **c = NULL; |
276 | struct clockdomain *clkdm; | ||
277 | struct clkdm_autodep *autodep = NULL; | ||
278 | 278 | ||
279 | if (!custom_funcs) | 279 | if (!arch_clkdm) |
280 | WARN(1, "No custom clkdm functions registered\n"); | 280 | return -EACCES; |
281 | else | 281 | |
282 | arch_clkdm = custom_funcs; | 282 | if (!cs) |
283 | return -EINVAL; | ||
284 | |||
285 | for (c = cs; *c; c++) | ||
286 | _clkdm_register(*c); | ||
287 | |||
288 | return 0; | ||
289 | } | ||
290 | |||
291 | /** | ||
292 | * clkdm_register_autodeps - register autodeps (if required) | ||
293 | * @ia: pointer to a static array of struct clkdm_autodep to register | ||
294 | * | ||
295 | * Register clockdomain "automatic dependencies." These are | ||
296 | * clockdomain wakeup and sleep dependencies that are automatically | ||
297 | * added whenever the first clock inside a clockdomain is enabled, and | ||
298 | * removed whenever the last clock inside a clockdomain is disabled. | ||
299 | * These are currently only used on OMAP3 devices, and are deprecated, | ||
300 | * since they waste energy. However, until the OMAP2/3 IP block | ||
301 | * enable/disable sequence can be converted to match the OMAP4 | ||
302 | * sequence, they are needed. | ||
303 | * | ||
304 | * Must be called only after all of the SoC clockdomains are | ||
305 | * registered, since the function will resolve autodep clockdomain | ||
306 | * names into clockdomain pointers. | ||
307 | * | ||
308 | * The struct clkdm_autodep @ia array must be static, as this function | ||
309 | * does not copy the array elements. | ||
310 | * | ||
311 | * Returns -EACCES if called before any clockdomains have been | ||
312 | * registered, -EINVAL if called with a null @ia argument, -EEXIST if | ||
313 | * autodeps have already been registered, or 0 upon success. | ||
314 | */ | ||
315 | int clkdm_register_autodeps(struct clkdm_autodep *ia) | ||
316 | { | ||
317 | struct clkdm_autodep *a = NULL; | ||
283 | 318 | ||
284 | if (clkdms) | 319 | if (list_empty(&clkdm_list)) |
285 | for (c = clkdms; *c; c++) | 320 | return -EACCES; |
286 | _clkdm_register(*c); | 321 | |
322 | if (!ia) | ||
323 | return -EINVAL; | ||
287 | 324 | ||
288 | autodeps = init_autodeps; | ||
289 | if (autodeps) | 325 | if (autodeps) |
290 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) | 326 | return -EEXIST; |
291 | _autodep_lookup(autodep); | 327 | |
328 | autodeps = ia; | ||
329 | for (a = autodeps; a->clkdm.ptr; a++) | ||
330 | _autodep_lookup(a); | ||
331 | |||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * clkdm_complete_init - set up the clockdomain layer | ||
337 | * | ||
338 | * Put all clockdomains into software-supervised mode; PM code should | ||
339 | * later enable hardware-supervised mode as appropriate. Must be | ||
340 | * called after clkdm_register_clkdms(). Returns -EACCES if called | ||
341 | * before clkdm_register_clkdms(), or 0 upon success. | ||
342 | */ | ||
343 | int clkdm_complete_init(void) | ||
344 | { | ||
345 | struct clockdomain *clkdm; | ||
346 | |||
347 | if (list_empty(&clkdm_list)) | ||
348 | return -EACCES; | ||
292 | 349 | ||
293 | /* | ||
294 | * Put all clockdomains into software-supervised mode; PM code | ||
295 | * should later enable hardware-supervised mode as appropriate | ||
296 | */ | ||
297 | list_for_each_entry(clkdm, &clkdm_list, node) { | 350 | list_for_each_entry(clkdm, &clkdm_list, node) { |
298 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | 351 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) |
299 | clkdm_wakeup(clkdm); | 352 | clkdm_wakeup(clkdm); |
@@ -306,6 +359,8 @@ void clkdm_init(struct clockdomain **clkdms, | |||
306 | _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs); | 359 | _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs); |
307 | clkdm_clear_all_sleepdeps(clkdm); | 360 | clkdm_clear_all_sleepdeps(clkdm); |
308 | } | 361 | } |
362 | |||
363 | return 0; | ||
309 | } | 364 | } |
310 | 365 | ||
311 | /** | 366 | /** |
@@ -747,6 +802,7 @@ int clkdm_wakeup(struct clockdomain *clkdm) | |||
747 | spin_lock_irqsave(&clkdm->lock, flags); | 802 | spin_lock_irqsave(&clkdm->lock, flags); |
748 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; | 803 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; |
749 | ret = arch_clkdm->clkdm_wakeup(clkdm); | 804 | ret = arch_clkdm->clkdm_wakeup(clkdm); |
805 | ret |= pwrdm_state_switch(clkdm->pwrdm.ptr); | ||
750 | spin_unlock_irqrestore(&clkdm->lock, flags); | 806 | spin_unlock_irqrestore(&clkdm->lock, flags); |
751 | return ret; | 807 | return ret; |
752 | } | 808 | } |
@@ -818,6 +874,7 @@ void clkdm_deny_idle(struct clockdomain *clkdm) | |||
818 | spin_lock_irqsave(&clkdm->lock, flags); | 874 | spin_lock_irqsave(&clkdm->lock, flags); |
819 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; | 875 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; |
820 | arch_clkdm->clkdm_deny_idle(clkdm); | 876 | arch_clkdm->clkdm_deny_idle(clkdm); |
877 | pwrdm_state_switch(clkdm->pwrdm.ptr); | ||
821 | spin_unlock_irqrestore(&clkdm->lock, flags); | 878 | spin_unlock_irqrestore(&clkdm->lock, flags); |
822 | } | 879 | } |
823 | 880 | ||
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index 1e50c88b8a07..f7b58609bad8 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h | |||
@@ -45,7 +45,6 @@ | |||
45 | /** | 45 | /** |
46 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode | 46 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode |
47 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only | 47 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only |
48 | * @omap_chip: OMAP chip types that this autodep is valid on | ||
49 | * | 48 | * |
50 | * A clockdomain that should have wkdeps and sleepdeps added when a | 49 | * A clockdomain that should have wkdeps and sleepdeps added when a |
51 | * clockdomain should stay active in hwsup mode; and conversely, | 50 | * clockdomain should stay active in hwsup mode; and conversely, |
@@ -60,14 +59,12 @@ struct clkdm_autodep { | |||
60 | const char *name; | 59 | const char *name; |
61 | struct clockdomain *ptr; | 60 | struct clockdomain *ptr; |
62 | } clkdm; | 61 | } clkdm; |
63 | const struct omap_chip_id omap_chip; | ||
64 | }; | 62 | }; |
65 | 63 | ||
66 | /** | 64 | /** |
67 | * struct clkdm_dep - encode dependencies between clockdomains | 65 | * struct clkdm_dep - encode dependencies between clockdomains |
68 | * @clkdm_name: clockdomain name | 66 | * @clkdm_name: clockdomain name |
69 | * @clkdm: pointer to the struct clockdomain of @clkdm_name | 67 | * @clkdm: pointer to the struct clockdomain of @clkdm_name |
70 | * @omap_chip: OMAP chip types that this dependency is valid on | ||
71 | * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake | 68 | * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake |
72 | * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle | 69 | * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle |
73 | * | 70 | * |
@@ -81,7 +78,6 @@ struct clkdm_dep { | |||
81 | struct clockdomain *clkdm; | 78 | struct clockdomain *clkdm; |
82 | atomic_t wkdep_usecount; | 79 | atomic_t wkdep_usecount; |
83 | atomic_t sleepdep_usecount; | 80 | atomic_t sleepdep_usecount; |
84 | const struct omap_chip_id omap_chip; | ||
85 | }; | 81 | }; |
86 | 82 | ||
87 | /* Possible flags for struct clockdomain._flags */ | 83 | /* Possible flags for struct clockdomain._flags */ |
@@ -101,7 +97,6 @@ struct clkdm_dep { | |||
101 | * @clkdm_offs: (OMAP4 only) CM clockdomain register offset | 97 | * @clkdm_offs: (OMAP4 only) CM clockdomain register offset |
102 | * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up | 98 | * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up |
103 | * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact | 99 | * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact |
104 | * @omap_chip: OMAP chip types that this clockdomain is valid on | ||
105 | * @usecount: Usecount tracking | 100 | * @usecount: Usecount tracking |
106 | * @node: list_head to link all clockdomains together | 101 | * @node: list_head to link all clockdomains together |
107 | * | 102 | * |
@@ -126,7 +121,6 @@ struct clockdomain { | |||
126 | const u16 clkdm_offs; | 121 | const u16 clkdm_offs; |
127 | struct clkdm_dep *wkdep_srcs; | 122 | struct clkdm_dep *wkdep_srcs; |
128 | struct clkdm_dep *sleepdep_srcs; | 123 | struct clkdm_dep *sleepdep_srcs; |
129 | const struct omap_chip_id omap_chip; | ||
130 | atomic_t usecount; | 124 | atomic_t usecount; |
131 | struct list_head node; | 125 | struct list_head node; |
132 | spinlock_t lock; | 126 | spinlock_t lock; |
@@ -166,8 +160,11 @@ struct clkdm_ops { | |||
166 | int (*clkdm_clk_disable)(struct clockdomain *clkdm); | 160 | int (*clkdm_clk_disable)(struct clockdomain *clkdm); |
167 | }; | 161 | }; |
168 | 162 | ||
169 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps, | 163 | int clkdm_register_platform_funcs(struct clkdm_ops *co); |
170 | struct clkdm_ops *custom_funcs); | 164 | int clkdm_register_autodeps(struct clkdm_autodep *ia); |
165 | int clkdm_register_clkdms(struct clockdomain **c); | ||
166 | int clkdm_complete_init(void); | ||
167 | |||
171 | struct clockdomain *clkdm_lookup(const char *name); | 168 | struct clockdomain *clkdm_lookup(const char *name); |
172 | 169 | ||
173 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), | 170 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), |
@@ -195,7 +192,8 @@ int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); | |||
195 | int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh); | 192 | int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh); |
196 | int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh); | 193 | int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh); |
197 | 194 | ||
198 | extern void __init omap2xxx_clockdomains_init(void); | 195 | extern void __init omap242x_clockdomains_init(void); |
196 | extern void __init omap243x_clockdomains_init(void); | ||
199 | extern void __init omap3xxx_clockdomains_init(void); | 197 | extern void __init omap3xxx_clockdomains_init(void); |
200 | extern void __init omap44xx_clockdomains_init(void); | 198 | extern void __init omap44xx_clockdomains_init(void); |
201 | extern void _clkdm_add_autodeps(struct clockdomain *clkdm); | 199 | extern void _clkdm_add_autodeps(struct clockdomain *clkdm); |
@@ -205,4 +203,10 @@ extern struct clkdm_ops omap2_clkdm_operations; | |||
205 | extern struct clkdm_ops omap3_clkdm_operations; | 203 | extern struct clkdm_ops omap3_clkdm_operations; |
206 | extern struct clkdm_ops omap4_clkdm_operations; | 204 | extern struct clkdm_ops omap4_clkdm_operations; |
207 | 205 | ||
206 | extern struct clkdm_dep gfx_24xx_wkdeps[]; | ||
207 | extern struct clkdm_dep dsp_24xx_wkdeps[]; | ||
208 | extern struct clockdomain wkup_common_clkdm; | ||
209 | extern struct clockdomain prm_common_clkdm; | ||
210 | extern struct clockdomain cm_common_clkdm; | ||
211 | |||
208 | #endif | 212 | #endif |
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c index f740edb111f4..a0d68dbecfa3 100644 --- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | |||
@@ -52,8 +52,6 @@ static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm) | |||
52 | u32 mask = 0; | 52 | u32 mask = 0; |
53 | 53 | ||
54 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | 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) | 55 | if (!cd->clkdm) |
58 | continue; /* only happens if data is erroneous */ | 56 | continue; /* only happens if data is erroneous */ |
59 | 57 | ||
@@ -98,8 +96,6 @@ static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | |||
98 | u32 mask = 0; | 96 | u32 mask = 0; |
99 | 97 | ||
100 | for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { | 98 | for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { |
101 | if (!omap_chip_is(cd->omap_chip)) | ||
102 | continue; | ||
103 | if (!cd->clkdm) | 99 | if (!cd->clkdm) |
104 | continue; /* only happens if data is erroneous */ | 100 | continue; /* only happens if data is erroneous */ |
105 | 101 | ||
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c index b43706aa08bd..935c7f03dab9 100644 --- a/arch/arm/mach-omap2/clockdomain44xx.c +++ b/arch/arm/mach-omap2/clockdomain44xx.c | |||
@@ -52,8 +52,6 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) | |||
52 | u32 mask = 0; | 52 | u32 mask = 0; |
53 | 53 | ||
54 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | 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) | 55 | if (!cd->clkdm) |
58 | continue; /* only happens if data is erroneous */ | 56 | continue; /* only happens if data is erroneous */ |
59 | 57 | ||
diff --git a/arch/arm/mach-omap2/clockdomains2420_data.c b/arch/arm/mach-omap2/clockdomains2420_data.c new file mode 100644 index 000000000000..0ab8e46d5b2b --- /dev/null +++ b/arch/arm/mach-omap2/clockdomains2420_data.c | |||
@@ -0,0 +1,154 @@ | |||
1 | /* | ||
2 | * OMAP2420 clockdomains | ||
3 | * | ||
4 | * Copyright (C) 2008-2011 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2008-2010 Nokia Corporation | ||
6 | * | ||
7 | * Paul Walmsley, Jouni Högander | ||
8 | * | ||
9 | * This file contains clockdomains and clockdomain wakeup dependencies | ||
10 | * for OMAP2420 chips. Some notes: | ||
11 | * | ||
12 | * A useful validation rule for struct clockdomain: Any clockdomain | ||
13 | * referenced by a wkdep_srcs must have a dep_bit assigned. So | ||
14 | * wkdep_srcs are really just software-controllable dependencies. | ||
15 | * Non-software-controllable dependencies do exist, but they are not | ||
16 | * encoded below (yet). | ||
17 | * | ||
18 | * 24xx does not support programmable sleep dependencies (SLEEPDEP) | ||
19 | * | ||
20 | * The overly-specific dep_bit names are due to a bit name collision | ||
21 | * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift | ||
22 | * value are the same for all powerdomains: 2 | ||
23 | * | ||
24 | * XXX should dep_bit be a mask, so we can test to see if it is 0 as a | ||
25 | * sanity check? | ||
26 | * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE | ||
27 | */ | ||
28 | |||
29 | /* | ||
30 | * To-Do List | ||
31 | * -> Port the Sleep/Wakeup dependencies for the domains | ||
32 | * from the Power domain framework | ||
33 | */ | ||
34 | |||
35 | #include <linux/kernel.h> | ||
36 | #include <linux/io.h> | ||
37 | |||
38 | #include "clockdomain.h" | ||
39 | #include "prm2xxx_3xxx.h" | ||
40 | #include "cm2xxx_3xxx.h" | ||
41 | #include "cm-regbits-24xx.h" | ||
42 | #include "prm-regbits-24xx.h" | ||
43 | |||
44 | /* | ||
45 | * Clockdomain dependencies for wkdeps | ||
46 | * | ||
47 | * XXX Hardware dependencies (e.g., dependencies that cannot be | ||
48 | * changed in software) are not included here yet, but should be. | ||
49 | */ | ||
50 | |||
51 | /* Wakeup dependency source arrays */ | ||
52 | |||
53 | /* 2420-specific possible wakeup dependencies */ | ||
54 | |||
55 | /* 2420 PM_WKDEP_MPU: CORE, DSP, WKUP */ | ||
56 | static struct clkdm_dep mpu_2420_wkdeps[] = { | ||
57 | { .clkdm_name = "core_l3_clkdm" }, | ||
58 | { .clkdm_name = "core_l4_clkdm" }, | ||
59 | { .clkdm_name = "dsp_clkdm" }, | ||
60 | { .clkdm_name = "wkup_clkdm" }, | ||
61 | { NULL }, | ||
62 | }; | ||
63 | |||
64 | /* 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP */ | ||
65 | static struct clkdm_dep core_2420_wkdeps[] = { | ||
66 | { .clkdm_name = "dsp_clkdm" }, | ||
67 | { .clkdm_name = "gfx_clkdm" }, | ||
68 | { .clkdm_name = "mpu_clkdm" }, | ||
69 | { .clkdm_name = "wkup_clkdm" }, | ||
70 | { NULL }, | ||
71 | }; | ||
72 | |||
73 | /* | ||
74 | * 2420-only clockdomains | ||
75 | */ | ||
76 | |||
77 | static struct clockdomain mpu_2420_clkdm = { | ||
78 | .name = "mpu_clkdm", | ||
79 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
80 | .flags = CLKDM_CAN_HWSUP, | ||
81 | .wkdep_srcs = mpu_2420_wkdeps, | ||
82 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | ||
83 | }; | ||
84 | |||
85 | static struct clockdomain iva1_2420_clkdm = { | ||
86 | .name = "iva1_clkdm", | ||
87 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
88 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
89 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | ||
90 | .wkdep_srcs = dsp_24xx_wkdeps, | ||
91 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, | ||
92 | }; | ||
93 | |||
94 | static struct clockdomain dsp_2420_clkdm = { | ||
95 | .name = "dsp_clkdm", | ||
96 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
97 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
98 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | ||
99 | }; | ||
100 | |||
101 | static struct clockdomain gfx_2420_clkdm = { | ||
102 | .name = "gfx_clkdm", | ||
103 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
104 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
105 | .wkdep_srcs = gfx_24xx_wkdeps, | ||
106 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | ||
107 | }; | ||
108 | |||
109 | static struct clockdomain core_l3_2420_clkdm = { | ||
110 | .name = "core_l3_clkdm", | ||
111 | .pwrdm = { .name = "core_pwrdm" }, | ||
112 | .flags = CLKDM_CAN_HWSUP, | ||
113 | .wkdep_srcs = core_2420_wkdeps, | ||
114 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | ||
115 | }; | ||
116 | |||
117 | static struct clockdomain core_l4_2420_clkdm = { | ||
118 | .name = "core_l4_clkdm", | ||
119 | .pwrdm = { .name = "core_pwrdm" }, | ||
120 | .flags = CLKDM_CAN_HWSUP, | ||
121 | .wkdep_srcs = core_2420_wkdeps, | ||
122 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | ||
123 | }; | ||
124 | |||
125 | static struct clockdomain dss_2420_clkdm = { | ||
126 | .name = "dss_clkdm", | ||
127 | .pwrdm = { .name = "core_pwrdm" }, | ||
128 | .flags = CLKDM_CAN_HWSUP, | ||
129 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | ||
130 | }; | ||
131 | |||
132 | static struct clockdomain *clockdomains_omap242x[] __initdata = { | ||
133 | &wkup_common_clkdm, | ||
134 | &cm_common_clkdm, | ||
135 | &prm_common_clkdm, | ||
136 | &mpu_2420_clkdm, | ||
137 | &iva1_2420_clkdm, | ||
138 | &dsp_2420_clkdm, | ||
139 | &gfx_2420_clkdm, | ||
140 | &core_l3_2420_clkdm, | ||
141 | &core_l4_2420_clkdm, | ||
142 | &dss_2420_clkdm, | ||
143 | NULL, | ||
144 | }; | ||
145 | |||
146 | void __init omap242x_clockdomains_init(void) | ||
147 | { | ||
148 | if (!cpu_is_omap242x()) | ||
149 | return; | ||
150 | |||
151 | clkdm_register_platform_funcs(&omap2_clkdm_operations); | ||
152 | clkdm_register_clkdms(clockdomains_omap242x); | ||
153 | clkdm_complete_init(); | ||
154 | } | ||
diff --git a/arch/arm/mach-omap2/clockdomains2430_data.c b/arch/arm/mach-omap2/clockdomains2430_data.c new file mode 100644 index 000000000000..3645ed044890 --- /dev/null +++ b/arch/arm/mach-omap2/clockdomains2430_data.c | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * OMAP2xxx clockdomains | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2008-2010 Nokia Corporation | ||
6 | * | ||
7 | * Paul Walmsley, Jouni Högander | ||
8 | * | ||
9 | * This file contains clockdomains and clockdomain wakeup dependencies | ||
10 | * for OMAP2xxx chips. Some notes: | ||
11 | * | ||
12 | * A useful validation rule for struct clockdomain: Any clockdomain | ||
13 | * referenced by a wkdep_srcs must have a dep_bit assigned. So | ||
14 | * wkdep_srcs are really just software-controllable dependencies. | ||
15 | * Non-software-controllable dependencies do exist, but they are not | ||
16 | * encoded below (yet). | ||
17 | * | ||
18 | * 24xx does not support programmable sleep dependencies (SLEEPDEP) | ||
19 | * | ||
20 | * The overly-specific dep_bit names are due to a bit name collision | ||
21 | * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift | ||
22 | * value are the same for all powerdomains: 2 | ||
23 | * | ||
24 | * XXX should dep_bit be a mask, so we can test to see if it is 0 as a | ||
25 | * sanity check? | ||
26 | * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE | ||
27 | */ | ||
28 | |||
29 | /* | ||
30 | * To-Do List | ||
31 | * -> Port the Sleep/Wakeup dependencies for the domains | ||
32 | * from the Power domain framework | ||
33 | */ | ||
34 | |||
35 | #include <linux/kernel.h> | ||
36 | #include <linux/io.h> | ||
37 | |||
38 | #include "clockdomain.h" | ||
39 | #include "prm2xxx_3xxx.h" | ||
40 | #include "cm2xxx_3xxx.h" | ||
41 | #include "cm-regbits-24xx.h" | ||
42 | #include "prm-regbits-24xx.h" | ||
43 | |||
44 | /* | ||
45 | * Clockdomain dependencies for wkdeps | ||
46 | * | ||
47 | * XXX Hardware dependencies (e.g., dependencies that cannot be | ||
48 | * changed in software) are not included here yet, but should be. | ||
49 | */ | ||
50 | |||
51 | /* Wakeup dependency source arrays */ | ||
52 | |||
53 | /* 2430-specific possible wakeup dependencies */ | ||
54 | |||
55 | /* 2430 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP, MDM */ | ||
56 | static struct clkdm_dep core_2430_wkdeps[] = { | ||
57 | { .clkdm_name = "dsp_clkdm" }, | ||
58 | { .clkdm_name = "gfx_clkdm" }, | ||
59 | { .clkdm_name = "mpu_clkdm" }, | ||
60 | { .clkdm_name = "wkup_clkdm" }, | ||
61 | { .clkdm_name = "mdm_clkdm" }, | ||
62 | { NULL }, | ||
63 | }; | ||
64 | |||
65 | /* 2430 PM_WKDEP_MPU: CORE, DSP, WKUP, MDM */ | ||
66 | static struct clkdm_dep mpu_2430_wkdeps[] = { | ||
67 | { .clkdm_name = "core_l3_clkdm" }, | ||
68 | { .clkdm_name = "core_l4_clkdm" }, | ||
69 | { .clkdm_name = "dsp_clkdm" }, | ||
70 | { .clkdm_name = "wkup_clkdm" }, | ||
71 | { .clkdm_name = "mdm_clkdm" }, | ||
72 | { NULL }, | ||
73 | }; | ||
74 | |||
75 | /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ | ||
76 | static struct clkdm_dep mdm_2430_wkdeps[] = { | ||
77 | { .clkdm_name = "core_l3_clkdm" }, | ||
78 | { .clkdm_name = "core_l4_clkdm" }, | ||
79 | { .clkdm_name = "mpu_clkdm" }, | ||
80 | { .clkdm_name = "wkup_clkdm" }, | ||
81 | { NULL }, | ||
82 | }; | ||
83 | |||
84 | /* | ||
85 | * 2430-only clockdomains | ||
86 | */ | ||
87 | |||
88 | static struct clockdomain mpu_2430_clkdm = { | ||
89 | .name = "mpu_clkdm", | ||
90 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
91 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
92 | .wkdep_srcs = mpu_2430_wkdeps, | ||
93 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | ||
94 | }; | ||
95 | |||
96 | /* Another case of bit name collisions between several registers: EN_MDM */ | ||
97 | static struct clockdomain mdm_clkdm = { | ||
98 | .name = "mdm_clkdm", | ||
99 | .pwrdm = { .name = "mdm_pwrdm" }, | ||
100 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
101 | .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, | ||
102 | .wkdep_srcs = mdm_2430_wkdeps, | ||
103 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, | ||
104 | }; | ||
105 | |||
106 | static struct clockdomain dsp_2430_clkdm = { | ||
107 | .name = "dsp_clkdm", | ||
108 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
109 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
110 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | ||
111 | .wkdep_srcs = dsp_24xx_wkdeps, | ||
112 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | ||
113 | }; | ||
114 | |||
115 | static struct clockdomain gfx_2430_clkdm = { | ||
116 | .name = "gfx_clkdm", | ||
117 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
118 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
119 | .wkdep_srcs = gfx_24xx_wkdeps, | ||
120 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | ||
121 | }; | ||
122 | |||
123 | /* | ||
124 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
125 | * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm | ||
126 | * could cause trouble | ||
127 | */ | ||
128 | static struct clockdomain core_l3_2430_clkdm = { | ||
129 | .name = "core_l3_clkdm", | ||
130 | .pwrdm = { .name = "core_pwrdm" }, | ||
131 | .flags = CLKDM_CAN_HWSUP, | ||
132 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
133 | .wkdep_srcs = core_2430_wkdeps, | ||
134 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | ||
135 | }; | ||
136 | |||
137 | /* | ||
138 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
139 | * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm | ||
140 | * could cause trouble | ||
141 | */ | ||
142 | static struct clockdomain core_l4_2430_clkdm = { | ||
143 | .name = "core_l4_clkdm", | ||
144 | .pwrdm = { .name = "core_pwrdm" }, | ||
145 | .flags = CLKDM_CAN_HWSUP, | ||
146 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
147 | .wkdep_srcs = core_2430_wkdeps, | ||
148 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | ||
149 | }; | ||
150 | |||
151 | static struct clockdomain dss_2430_clkdm = { | ||
152 | .name = "dss_clkdm", | ||
153 | .pwrdm = { .name = "core_pwrdm" }, | ||
154 | .flags = CLKDM_CAN_HWSUP, | ||
155 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | ||
156 | }; | ||
157 | |||
158 | static struct clockdomain *clockdomains_omap243x[] __initdata = { | ||
159 | &wkup_common_clkdm, | ||
160 | &cm_common_clkdm, | ||
161 | &prm_common_clkdm, | ||
162 | &mpu_2430_clkdm, | ||
163 | &mdm_clkdm, | ||
164 | &dsp_2430_clkdm, | ||
165 | &gfx_2430_clkdm, | ||
166 | &core_l3_2430_clkdm, | ||
167 | &core_l4_2430_clkdm, | ||
168 | &dss_2430_clkdm, | ||
169 | NULL, | ||
170 | }; | ||
171 | |||
172 | void __init omap243x_clockdomains_init(void) | ||
173 | { | ||
174 | if (!cpu_is_omap243x()) | ||
175 | return; | ||
176 | |||
177 | clkdm_register_platform_funcs(&omap2_clkdm_operations); | ||
178 | clkdm_register_clkdms(clockdomains_omap243x); | ||
179 | clkdm_complete_init(); | ||
180 | } | ||
181 | |||
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c index 13bde95b6790..0a6a04897d89 100644 --- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2/3 clockdomains | 2 | * OMAP2/3 clockdomain common data |
3 | * | 3 | * |
4 | * Copyright (C) 2008-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2008-2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2008-2010 Nokia Corporation | 5 | * Copyright (C) 2008-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
@@ -51,374 +51,28 @@ | |||
51 | * changed in software) are not included here yet, but should be. | 51 | * changed in software) are not included here yet, but should be. |
52 | */ | 52 | */ |
53 | 53 | ||
54 | /* OMAP2/3-common wakeup dependencies */ | ||
55 | |||
56 | /* | ||
57 | * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP | ||
58 | * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE | ||
59 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE | ||
60 | * These can share data since they will never be present simultaneously | ||
61 | * on the same device. | ||
62 | */ | ||
63 | static struct clkdm_dep gfx_sgx_wkdeps[] = { | ||
64 | { | ||
65 | .clkdm_name = "core_l3_clkdm", | ||
66 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
67 | }, | ||
68 | { | ||
69 | .clkdm_name = "core_l4_clkdm", | ||
70 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
71 | }, | ||
72 | { | ||
73 | .clkdm_name = "iva2_clkdm", | ||
74 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
75 | }, | ||
76 | { | ||
77 | .clkdm_name = "mpu_clkdm", | ||
78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
79 | CHIP_IS_OMAP3430) | ||
80 | }, | ||
81 | { | ||
82 | .clkdm_name = "wkup_clkdm", | ||
83 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
84 | CHIP_IS_OMAP3430) | ||
85 | }, | ||
86 | { NULL }, | ||
87 | }; | ||
88 | |||
89 | |||
90 | /* 24XX-specific possible dependencies */ | ||
91 | |||
92 | #ifdef CONFIG_ARCH_OMAP2 | ||
93 | |||
94 | /* Wakeup dependency source arrays */ | 54 | /* Wakeup dependency source arrays */ |
95 | 55 | ||
96 | /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ | 56 | /* 2xxx-specific possible dependencies */ |
97 | static struct clkdm_dep dsp_24xx_wkdeps[] = { | ||
98 | { | ||
99 | .clkdm_name = "core_l3_clkdm", | ||
100 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
101 | }, | ||
102 | { | ||
103 | .clkdm_name = "core_l4_clkdm", | ||
104 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
105 | }, | ||
106 | { | ||
107 | .clkdm_name = "mpu_clkdm", | ||
108 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
109 | }, | ||
110 | { | ||
111 | .clkdm_name = "wkup_clkdm", | ||
112 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
113 | }, | ||
114 | { NULL }, | ||
115 | }; | ||
116 | |||
117 | /* | ||
118 | * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP | ||
119 | * 2430 adds MDM | ||
120 | */ | ||
121 | static struct clkdm_dep mpu_24xx_wkdeps[] = { | ||
122 | { | ||
123 | .clkdm_name = "core_l3_clkdm", | ||
124 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
125 | }, | ||
126 | { | ||
127 | .clkdm_name = "core_l4_clkdm", | ||
128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
129 | }, | ||
130 | { | ||
131 | .clkdm_name = "dsp_clkdm", | ||
132 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
133 | }, | ||
134 | { | ||
135 | .clkdm_name = "wkup_clkdm", | ||
136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
137 | }, | ||
138 | { | ||
139 | .clkdm_name = "mdm_clkdm", | ||
140 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
141 | }, | ||
142 | { NULL }, | ||
143 | }; | ||
144 | |||
145 | /* | ||
146 | * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP | ||
147 | * 2430 adds MDM | ||
148 | */ | ||
149 | static struct clkdm_dep core_24xx_wkdeps[] = { | ||
150 | { | ||
151 | .clkdm_name = "dsp_clkdm", | ||
152 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
153 | }, | ||
154 | { | ||
155 | .clkdm_name = "gfx_clkdm", | ||
156 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
157 | }, | ||
158 | { | ||
159 | .clkdm_name = "mpu_clkdm", | ||
160 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
161 | }, | ||
162 | { | ||
163 | .clkdm_name = "wkup_clkdm", | ||
164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
165 | }, | ||
166 | { | ||
167 | .clkdm_name = "mdm_clkdm", | ||
168 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
169 | }, | ||
170 | { NULL }, | ||
171 | }; | ||
172 | |||
173 | #endif /* CONFIG_ARCH_OMAP2 */ | ||
174 | |||
175 | /* 2430-specific possible wakeup dependencies */ | ||
176 | 57 | ||
177 | #ifdef CONFIG_SOC_OMAP2430 | 58 | /* 2xxx PM_WKDEP_GFX: CORE, MPU, WKUP */ |
178 | 59 | struct clkdm_dep gfx_24xx_wkdeps[] = { | |
179 | /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ | 60 | { .clkdm_name = "core_l3_clkdm" }, |
180 | static struct clkdm_dep mdm_2430_wkdeps[] = { | 61 | { .clkdm_name = "core_l4_clkdm" }, |
181 | { | 62 | { .clkdm_name = "mpu_clkdm" }, |
182 | .clkdm_name = "core_l3_clkdm", | 63 | { .clkdm_name = "wkup_clkdm" }, |
183 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
184 | }, | ||
185 | { | ||
186 | .clkdm_name = "core_l4_clkdm", | ||
187 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
188 | }, | ||
189 | { | ||
190 | .clkdm_name = "mpu_clkdm", | ||
191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
192 | }, | ||
193 | { | ||
194 | .clkdm_name = "wkup_clkdm", | ||
195 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
196 | }, | ||
197 | { NULL }, | ||
198 | }; | ||
199 | |||
200 | #endif /* CONFIG_SOC_OMAP2430 */ | ||
201 | |||
202 | |||
203 | /* OMAP3-specific possible dependencies */ | ||
204 | |||
205 | #ifdef CONFIG_ARCH_OMAP3 | ||
206 | |||
207 | /* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */ | ||
208 | static struct clkdm_dep per_wkdeps[] = { | ||
209 | { | ||
210 | .clkdm_name = "core_l3_clkdm", | ||
211 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
212 | }, | ||
213 | { | ||
214 | .clkdm_name = "core_l4_clkdm", | ||
215 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
216 | }, | ||
217 | { | ||
218 | .clkdm_name = "iva2_clkdm", | ||
219 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
220 | }, | ||
221 | { | ||
222 | .clkdm_name = "mpu_clkdm", | ||
223 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
224 | }, | ||
225 | { | ||
226 | .clkdm_name = "wkup_clkdm", | ||
227 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
228 | }, | ||
229 | { NULL }, | ||
230 | }; | ||
231 | |||
232 | /* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */ | ||
233 | static struct clkdm_dep usbhost_wkdeps[] = { | ||
234 | { | ||
235 | .clkdm_name = "core_l3_clkdm", | ||
236 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
237 | }, | ||
238 | { | ||
239 | .clkdm_name = "core_l4_clkdm", | ||
240 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
241 | }, | ||
242 | { | ||
243 | .clkdm_name = "iva2_clkdm", | ||
244 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
245 | }, | ||
246 | { | ||
247 | .clkdm_name = "mpu_clkdm", | ||
248 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
249 | }, | ||
250 | { | ||
251 | .clkdm_name = "wkup_clkdm", | ||
252 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
253 | }, | ||
254 | { NULL }, | 64 | { NULL }, |
255 | }; | 65 | }; |
256 | 66 | ||
257 | /* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */ | 67 | /* 2xxx PM_WKDEP_DSP: CORE, MPU, WKUP */ |
258 | static struct clkdm_dep mpu_3xxx_wkdeps[] = { | 68 | struct clkdm_dep dsp_24xx_wkdeps[] = { |
259 | { | 69 | { .clkdm_name = "core_l3_clkdm" }, |
260 | .clkdm_name = "core_l3_clkdm", | 70 | { .clkdm_name = "core_l4_clkdm" }, |
261 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 71 | { .clkdm_name = "mpu_clkdm" }, |
262 | }, | 72 | { .clkdm_name = "wkup_clkdm" }, |
263 | { | ||
264 | .clkdm_name = "core_l4_clkdm", | ||
265 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
266 | }, | ||
267 | { | ||
268 | .clkdm_name = "iva2_clkdm", | ||
269 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
270 | }, | ||
271 | { | ||
272 | .clkdm_name = "dss_clkdm", | ||
273 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
274 | }, | ||
275 | { | ||
276 | .clkdm_name = "per_clkdm", | ||
277 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
278 | }, | ||
279 | { NULL }, | 73 | { NULL }, |
280 | }; | 74 | }; |
281 | 75 | ||
282 | /* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */ | ||
283 | static struct clkdm_dep iva2_wkdeps[] = { | ||
284 | { | ||
285 | .clkdm_name = "core_l3_clkdm", | ||
286 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
287 | }, | ||
288 | { | ||
289 | .clkdm_name = "core_l4_clkdm", | ||
290 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
291 | }, | ||
292 | { | ||
293 | .clkdm_name = "mpu_clkdm", | ||
294 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
295 | }, | ||
296 | { | ||
297 | .clkdm_name = "wkup_clkdm", | ||
298 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
299 | }, | ||
300 | { | ||
301 | .clkdm_name = "dss_clkdm", | ||
302 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
303 | }, | ||
304 | { | ||
305 | .clkdm_name = "per_clkdm", | ||
306 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
307 | }, | ||
308 | { NULL }, | ||
309 | }; | ||
310 | |||
311 | |||
312 | /* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */ | ||
313 | static struct clkdm_dep cam_wkdeps[] = { | ||
314 | { | ||
315 | .clkdm_name = "iva2_clkdm", | ||
316 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
317 | }, | ||
318 | { | ||
319 | .clkdm_name = "mpu_clkdm", | ||
320 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
321 | }, | ||
322 | { | ||
323 | .clkdm_name = "wkup_clkdm", | ||
324 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
325 | }, | ||
326 | { NULL }, | ||
327 | }; | ||
328 | |||
329 | /* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */ | ||
330 | static struct clkdm_dep dss_wkdeps[] = { | ||
331 | { | ||
332 | .clkdm_name = "iva2_clkdm", | ||
333 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
334 | }, | ||
335 | { | ||
336 | .clkdm_name = "mpu_clkdm", | ||
337 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
338 | }, | ||
339 | { | ||
340 | .clkdm_name = "wkup_clkdm", | ||
341 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
342 | }, | ||
343 | { NULL }, | ||
344 | }; | ||
345 | |||
346 | /* 3430: PM_WKDEP_NEON: MPU */ | ||
347 | static struct clkdm_dep neon_wkdeps[] = { | ||
348 | { | ||
349 | .clkdm_name = "mpu_clkdm", | ||
350 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
351 | }, | ||
352 | { NULL }, | ||
353 | }; | ||
354 | |||
355 | |||
356 | /* Sleep dependency source arrays for OMAP3-specific clkdms */ | ||
357 | |||
358 | /* 3430: CM_SLEEPDEP_DSS: MPU, IVA */ | ||
359 | static struct clkdm_dep dss_sleepdeps[] = { | ||
360 | { | ||
361 | .clkdm_name = "mpu_clkdm", | ||
362 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
363 | }, | ||
364 | { | ||
365 | .clkdm_name = "iva2_clkdm", | ||
366 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
367 | }, | ||
368 | { NULL }, | ||
369 | }; | ||
370 | |||
371 | /* 3430: CM_SLEEPDEP_PER: MPU, IVA */ | ||
372 | static struct clkdm_dep per_sleepdeps[] = { | ||
373 | { | ||
374 | .clkdm_name = "mpu_clkdm", | ||
375 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
376 | }, | ||
377 | { | ||
378 | .clkdm_name = "iva2_clkdm", | ||
379 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
380 | }, | ||
381 | { NULL }, | ||
382 | }; | ||
383 | |||
384 | /* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */ | ||
385 | static struct clkdm_dep usbhost_sleepdeps[] = { | ||
386 | { | ||
387 | .clkdm_name = "mpu_clkdm", | ||
388 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
389 | }, | ||
390 | { | ||
391 | .clkdm_name = "iva2_clkdm", | ||
392 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
393 | }, | ||
394 | { NULL }, | ||
395 | }; | ||
396 | |||
397 | /* 3430: CM_SLEEPDEP_CAM: MPU */ | ||
398 | static struct clkdm_dep cam_sleepdeps[] = { | ||
399 | { | ||
400 | .clkdm_name = "mpu_clkdm", | ||
401 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
402 | }, | ||
403 | { NULL }, | ||
404 | }; | ||
405 | |||
406 | /* | ||
407 | * 3430ES1: CM_SLEEPDEP_GFX: MPU | ||
408 | * 3430ES2: CM_SLEEPDEP_SGX: MPU | ||
409 | * These can share data since they will never be present simultaneously | ||
410 | * on the same device. | ||
411 | */ | ||
412 | static struct clkdm_dep gfx_sgx_sleepdeps[] = { | ||
413 | { | ||
414 | .clkdm_name = "mpu_clkdm", | ||
415 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
416 | }, | ||
417 | { NULL }, | ||
418 | }; | ||
419 | |||
420 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
421 | |||
422 | 76 | ||
423 | /* | 77 | /* |
424 | * OMAP2/3-common clockdomains | 78 | * OMAP2/3-common clockdomains |
@@ -430,439 +84,18 @@ static struct clkdm_dep gfx_sgx_sleepdeps[] = { | |||
430 | */ | 84 | */ |
431 | 85 | ||
432 | /* This is an implicit clockdomain - it is never defined as such in TRM */ | 86 | /* This is an implicit clockdomain - it is never defined as such in TRM */ |
433 | static struct clockdomain wkup_clkdm = { | 87 | struct clockdomain wkup_common_clkdm = { |
434 | .name = "wkup_clkdm", | 88 | .name = "wkup_clkdm", |
435 | .pwrdm = { .name = "wkup_pwrdm" }, | 89 | .pwrdm = { .name = "wkup_pwrdm" }, |
436 | .dep_bit = OMAP_EN_WKUP_SHIFT, | 90 | .dep_bit = OMAP_EN_WKUP_SHIFT, |
437 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
438 | }; | 91 | }; |
439 | 92 | ||
440 | static struct clockdomain prm_clkdm = { | 93 | struct clockdomain prm_common_clkdm = { |
441 | .name = "prm_clkdm", | 94 | .name = "prm_clkdm", |
442 | .pwrdm = { .name = "wkup_pwrdm" }, | 95 | .pwrdm = { .name = "wkup_pwrdm" }, |
443 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
444 | }; | 96 | }; |
445 | 97 | ||
446 | static struct clockdomain cm_clkdm = { | 98 | struct clockdomain cm_common_clkdm = { |
447 | .name = "cm_clkdm", | 99 | .name = "cm_clkdm", |
448 | .pwrdm = { .name = "core_pwrdm" }, | 100 | .pwrdm = { .name = "core_pwrdm" }, |
449 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
450 | }; | 101 | }; |
451 | |||
452 | /* | ||
453 | * 2420-only clockdomains | ||
454 | */ | ||
455 | |||
456 | #if defined(CONFIG_SOC_OMAP2420) | ||
457 | |||
458 | static struct clockdomain mpu_2420_clkdm = { | ||
459 | .name = "mpu_clkdm", | ||
460 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
461 | .flags = CLKDM_CAN_HWSUP, | ||
462 | .wkdep_srcs = mpu_24xx_wkdeps, | ||
463 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | ||
464 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
465 | }; | ||
466 | |||
467 | static struct clockdomain iva1_2420_clkdm = { | ||
468 | .name = "iva1_clkdm", | ||
469 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
470 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
471 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | ||
472 | .wkdep_srcs = dsp_24xx_wkdeps, | ||
473 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, | ||
474 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
475 | }; | ||
476 | |||
477 | static struct clockdomain dsp_2420_clkdm = { | ||
478 | .name = "dsp_clkdm", | ||
479 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
480 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
481 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | ||
482 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
483 | }; | ||
484 | |||
485 | static struct clockdomain gfx_2420_clkdm = { | ||
486 | .name = "gfx_clkdm", | ||
487 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
488 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
489 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
490 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | ||
491 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
492 | }; | ||
493 | |||
494 | static struct clockdomain core_l3_2420_clkdm = { | ||
495 | .name = "core_l3_clkdm", | ||
496 | .pwrdm = { .name = "core_pwrdm" }, | ||
497 | .flags = CLKDM_CAN_HWSUP, | ||
498 | .wkdep_srcs = core_24xx_wkdeps, | ||
499 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | ||
500 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
501 | }; | ||
502 | |||
503 | static struct clockdomain core_l4_2420_clkdm = { | ||
504 | .name = "core_l4_clkdm", | ||
505 | .pwrdm = { .name = "core_pwrdm" }, | ||
506 | .flags = CLKDM_CAN_HWSUP, | ||
507 | .wkdep_srcs = core_24xx_wkdeps, | ||
508 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | ||
509 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
510 | }; | ||
511 | |||
512 | static struct clockdomain dss_2420_clkdm = { | ||
513 | .name = "dss_clkdm", | ||
514 | .pwrdm = { .name = "core_pwrdm" }, | ||
515 | .flags = CLKDM_CAN_HWSUP, | ||
516 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | ||
517 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
518 | }; | ||
519 | |||
520 | #endif /* CONFIG_SOC_OMAP2420 */ | ||
521 | |||
522 | |||
523 | /* | ||
524 | * 2430-only clockdomains | ||
525 | */ | ||
526 | |||
527 | #if defined(CONFIG_SOC_OMAP2430) | ||
528 | |||
529 | static struct clockdomain mpu_2430_clkdm = { | ||
530 | .name = "mpu_clkdm", | ||
531 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
532 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
533 | .wkdep_srcs = mpu_24xx_wkdeps, | ||
534 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | ||
535 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
536 | }; | ||
537 | |||
538 | /* Another case of bit name collisions between several registers: EN_MDM */ | ||
539 | static struct clockdomain mdm_clkdm = { | ||
540 | .name = "mdm_clkdm", | ||
541 | .pwrdm = { .name = "mdm_pwrdm" }, | ||
542 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
543 | .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, | ||
544 | .wkdep_srcs = mdm_2430_wkdeps, | ||
545 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, | ||
546 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
547 | }; | ||
548 | |||
549 | static struct clockdomain dsp_2430_clkdm = { | ||
550 | .name = "dsp_clkdm", | ||
551 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
552 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
553 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | ||
554 | .wkdep_srcs = dsp_24xx_wkdeps, | ||
555 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | ||
556 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
557 | }; | ||
558 | |||
559 | static struct clockdomain gfx_2430_clkdm = { | ||
560 | .name = "gfx_clkdm", | ||
561 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
562 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
563 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
564 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | ||
565 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
566 | }; | ||
567 | |||
568 | /* | ||
569 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
570 | * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm | ||
571 | * could cause trouble | ||
572 | */ | ||
573 | static struct clockdomain core_l3_2430_clkdm = { | ||
574 | .name = "core_l3_clkdm", | ||
575 | .pwrdm = { .name = "core_pwrdm" }, | ||
576 | .flags = CLKDM_CAN_HWSUP, | ||
577 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
578 | .wkdep_srcs = core_24xx_wkdeps, | ||
579 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | ||
580 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
581 | }; | ||
582 | |||
583 | /* | ||
584 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
585 | * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm | ||
586 | * could cause trouble | ||
587 | */ | ||
588 | static struct clockdomain core_l4_2430_clkdm = { | ||
589 | .name = "core_l4_clkdm", | ||
590 | .pwrdm = { .name = "core_pwrdm" }, | ||
591 | .flags = CLKDM_CAN_HWSUP, | ||
592 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
593 | .wkdep_srcs = core_24xx_wkdeps, | ||
594 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | ||
595 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
596 | }; | ||
597 | |||
598 | static struct clockdomain dss_2430_clkdm = { | ||
599 | .name = "dss_clkdm", | ||
600 | .pwrdm = { .name = "core_pwrdm" }, | ||
601 | .flags = CLKDM_CAN_HWSUP, | ||
602 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | ||
603 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
604 | }; | ||
605 | |||
606 | #endif /* CONFIG_SOC_OMAP2430 */ | ||
607 | |||
608 | |||
609 | /* | ||
610 | * OMAP3 clockdomains | ||
611 | */ | ||
612 | |||
613 | #if defined(CONFIG_ARCH_OMAP3) | ||
614 | |||
615 | static struct clockdomain mpu_3xxx_clkdm = { | ||
616 | .name = "mpu_clkdm", | ||
617 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
618 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, | ||
619 | .dep_bit = OMAP3430_EN_MPU_SHIFT, | ||
620 | .wkdep_srcs = mpu_3xxx_wkdeps, | ||
621 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, | ||
622 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
623 | }; | ||
624 | |||
625 | static struct clockdomain neon_clkdm = { | ||
626 | .name = "neon_clkdm", | ||
627 | .pwrdm = { .name = "neon_pwrdm" }, | ||
628 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
629 | .wkdep_srcs = neon_wkdeps, | ||
630 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, | ||
631 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
632 | }; | ||
633 | |||
634 | static struct clockdomain iva2_clkdm = { | ||
635 | .name = "iva2_clkdm", | ||
636 | .pwrdm = { .name = "iva2_pwrdm" }, | ||
637 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
638 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, | ||
639 | .wkdep_srcs = iva2_wkdeps, | ||
640 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, | ||
641 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
642 | }; | ||
643 | |||
644 | static struct clockdomain gfx_3430es1_clkdm = { | ||
645 | .name = "gfx_clkdm", | ||
646 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
647 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
648 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
649 | .sleepdep_srcs = gfx_sgx_sleepdeps, | ||
650 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, | ||
651 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), | ||
652 | }; | ||
653 | |||
654 | static struct clockdomain sgx_clkdm = { | ||
655 | .name = "sgx_clkdm", | ||
656 | .pwrdm = { .name = "sgx_pwrdm" }, | ||
657 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
658 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
659 | .sleepdep_srcs = gfx_sgx_sleepdeps, | ||
660 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, | ||
661 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
662 | }; | ||
663 | |||
664 | /* | ||
665 | * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but | ||
666 | * then that information was removed from the 34xx ES2+ TRM. It is | ||
667 | * unclear whether the core is still there, but the clockdomain logic | ||
668 | * is there, and must be programmed to an appropriate state if the | ||
669 | * CORE clockdomain is to become inactive. | ||
670 | */ | ||
671 | static struct clockdomain d2d_clkdm = { | ||
672 | .name = "d2d_clkdm", | ||
673 | .pwrdm = { .name = "core_pwrdm" }, | ||
674 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
675 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, | ||
676 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
677 | }; | ||
678 | |||
679 | /* | ||
680 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
681 | * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm | ||
682 | * could cause trouble | ||
683 | */ | ||
684 | static struct clockdomain core_l3_3xxx_clkdm = { | ||
685 | .name = "core_l3_clkdm", | ||
686 | .pwrdm = { .name = "core_pwrdm" }, | ||
687 | .flags = CLKDM_CAN_HWSUP, | ||
688 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
689 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, | ||
690 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
691 | }; | ||
692 | |||
693 | /* | ||
694 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
695 | * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm | ||
696 | * could cause trouble | ||
697 | */ | ||
698 | static struct clockdomain core_l4_3xxx_clkdm = { | ||
699 | .name = "core_l4_clkdm", | ||
700 | .pwrdm = { .name = "core_pwrdm" }, | ||
701 | .flags = CLKDM_CAN_HWSUP, | ||
702 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
703 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, | ||
704 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
705 | }; | ||
706 | |||
707 | /* Another case of bit name collisions between several registers: EN_DSS */ | ||
708 | static struct clockdomain dss_3xxx_clkdm = { | ||
709 | .name = "dss_clkdm", | ||
710 | .pwrdm = { .name = "dss_pwrdm" }, | ||
711 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
712 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, | ||
713 | .wkdep_srcs = dss_wkdeps, | ||
714 | .sleepdep_srcs = dss_sleepdeps, | ||
715 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, | ||
716 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
717 | }; | ||
718 | |||
719 | static struct clockdomain cam_clkdm = { | ||
720 | .name = "cam_clkdm", | ||
721 | .pwrdm = { .name = "cam_pwrdm" }, | ||
722 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
723 | .wkdep_srcs = cam_wkdeps, | ||
724 | .sleepdep_srcs = cam_sleepdeps, | ||
725 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, | ||
726 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
727 | }; | ||
728 | |||
729 | static struct clockdomain usbhost_clkdm = { | ||
730 | .name = "usbhost_clkdm", | ||
731 | .pwrdm = { .name = "usbhost_pwrdm" }, | ||
732 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
733 | .wkdep_srcs = usbhost_wkdeps, | ||
734 | .sleepdep_srcs = usbhost_sleepdeps, | ||
735 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, | ||
736 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
737 | }; | ||
738 | |||
739 | static struct clockdomain per_clkdm = { | ||
740 | .name = "per_clkdm", | ||
741 | .pwrdm = { .name = "per_pwrdm" }, | ||
742 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
743 | .dep_bit = OMAP3430_EN_PER_SHIFT, | ||
744 | .wkdep_srcs = per_wkdeps, | ||
745 | .sleepdep_srcs = per_sleepdeps, | ||
746 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, | ||
747 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
748 | }; | ||
749 | |||
750 | /* | ||
751 | * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is | ||
752 | * switched of even if sdti is in use | ||
753 | */ | ||
754 | static struct clockdomain emu_clkdm = { | ||
755 | .name = "emu_clkdm", | ||
756 | .pwrdm = { .name = "emu_pwrdm" }, | ||
757 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, | ||
758 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, | ||
759 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
760 | }; | ||
761 | |||
762 | static struct clockdomain dpll1_clkdm = { | ||
763 | .name = "dpll1_clkdm", | ||
764 | .pwrdm = { .name = "dpll1_pwrdm" }, | ||
765 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
766 | }; | ||
767 | |||
768 | static struct clockdomain dpll2_clkdm = { | ||
769 | .name = "dpll2_clkdm", | ||
770 | .pwrdm = { .name = "dpll2_pwrdm" }, | ||
771 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
772 | }; | ||
773 | |||
774 | static struct clockdomain dpll3_clkdm = { | ||
775 | .name = "dpll3_clkdm", | ||
776 | .pwrdm = { .name = "dpll3_pwrdm" }, | ||
777 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
778 | }; | ||
779 | |||
780 | static struct clockdomain dpll4_clkdm = { | ||
781 | .name = "dpll4_clkdm", | ||
782 | .pwrdm = { .name = "dpll4_pwrdm" }, | ||
783 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
784 | }; | ||
785 | |||
786 | static struct clockdomain dpll5_clkdm = { | ||
787 | .name = "dpll5_clkdm", | ||
788 | .pwrdm = { .name = "dpll5_pwrdm" }, | ||
789 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
790 | }; | ||
791 | |||
792 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
793 | |||
794 | /* | ||
795 | * Clockdomain hwsup dependencies (OMAP3 only) | ||
796 | */ | ||
797 | |||
798 | static struct clkdm_autodep clkdm_autodeps[] = { | ||
799 | { | ||
800 | .clkdm = { .name = "mpu_clkdm" }, | ||
801 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
802 | }, | ||
803 | { | ||
804 | .clkdm = { .name = "iva2_clkdm" }, | ||
805 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
806 | }, | ||
807 | { | ||
808 | .clkdm = { .name = NULL }, | ||
809 | } | ||
810 | }; | ||
811 | |||
812 | static struct clockdomain *clockdomains_omap2[] __initdata = { | ||
813 | &wkup_clkdm, | ||
814 | &cm_clkdm, | ||
815 | &prm_clkdm, | ||
816 | |||
817 | #ifdef CONFIG_SOC_OMAP2420 | ||
818 | &mpu_2420_clkdm, | ||
819 | &iva1_2420_clkdm, | ||
820 | &dsp_2420_clkdm, | ||
821 | &gfx_2420_clkdm, | ||
822 | &core_l3_2420_clkdm, | ||
823 | &core_l4_2420_clkdm, | ||
824 | &dss_2420_clkdm, | ||
825 | #endif | ||
826 | |||
827 | #ifdef CONFIG_SOC_OMAP2430 | ||
828 | &mpu_2430_clkdm, | ||
829 | &mdm_clkdm, | ||
830 | &dsp_2430_clkdm, | ||
831 | &gfx_2430_clkdm, | ||
832 | &core_l3_2430_clkdm, | ||
833 | &core_l4_2430_clkdm, | ||
834 | &dss_2430_clkdm, | ||
835 | #endif | ||
836 | |||
837 | #ifdef CONFIG_ARCH_OMAP3 | ||
838 | &mpu_3xxx_clkdm, | ||
839 | &neon_clkdm, | ||
840 | &iva2_clkdm, | ||
841 | &gfx_3430es1_clkdm, | ||
842 | &sgx_clkdm, | ||
843 | &d2d_clkdm, | ||
844 | &core_l3_3xxx_clkdm, | ||
845 | &core_l4_3xxx_clkdm, | ||
846 | &dss_3xxx_clkdm, | ||
847 | &cam_clkdm, | ||
848 | &usbhost_clkdm, | ||
849 | &per_clkdm, | ||
850 | &emu_clkdm, | ||
851 | &dpll1_clkdm, | ||
852 | &dpll2_clkdm, | ||
853 | &dpll3_clkdm, | ||
854 | &dpll4_clkdm, | ||
855 | &dpll5_clkdm, | ||
856 | #endif | ||
857 | NULL, | ||
858 | }; | ||
859 | |||
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) | ||
866 | { | ||
867 | clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap3_clkdm_operations); | ||
868 | } | ||
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c new file mode 100644 index 000000000000..b84e138d99c8 --- /dev/null +++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c | |||
@@ -0,0 +1,398 @@ | |||
1 | /* | ||
2 | * OMAP3xxx clockdomains | ||
3 | * | ||
4 | * Copyright (C) 2008-2011 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2008-2010 Nokia Corporation | ||
6 | * | ||
7 | * Paul Walmsley, Jouni Högander | ||
8 | * | ||
9 | * This file contains clockdomains and clockdomain wakeup/sleep | ||
10 | * dependencies for the OMAP3xxx chips. Some notes: | ||
11 | * | ||
12 | * A useful validation rule for struct clockdomain: Any clockdomain | ||
13 | * referenced by a wkdep_srcs or sleepdep_srcs array must have a | ||
14 | * dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really just | ||
15 | * software-controllable dependencies. Non-software-controllable | ||
16 | * dependencies do exist, but they are not encoded below (yet). | ||
17 | * | ||
18 | * The overly-specific dep_bit names are due to a bit name collision | ||
19 | * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift | ||
20 | * value are the same for all powerdomains: 2 | ||
21 | * | ||
22 | * XXX should dep_bit be a mask, so we can test to see if it is 0 as a | ||
23 | * sanity check? | ||
24 | * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | * To-Do List | ||
29 | * -> Port the Sleep/Wakeup dependencies for the domains | ||
30 | * from the Power domain framework | ||
31 | */ | ||
32 | |||
33 | #include <linux/kernel.h> | ||
34 | #include <linux/io.h> | ||
35 | |||
36 | #include "clockdomain.h" | ||
37 | #include "prm2xxx_3xxx.h" | ||
38 | #include "cm2xxx_3xxx.h" | ||
39 | #include "cm-regbits-34xx.h" | ||
40 | #include "prm-regbits-34xx.h" | ||
41 | |||
42 | /* | ||
43 | * Clockdomain dependencies for wkdeps/sleepdeps | ||
44 | * | ||
45 | * XXX Hardware dependencies (e.g., dependencies that cannot be | ||
46 | * changed in software) are not included here yet, but should be. | ||
47 | */ | ||
48 | |||
49 | /* OMAP3-specific possible dependencies */ | ||
50 | |||
51 | /* | ||
52 | * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE | ||
53 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE | ||
54 | */ | ||
55 | static struct clkdm_dep gfx_sgx_3xxx_wkdeps[] = { | ||
56 | { .clkdm_name = "iva2_clkdm", }, | ||
57 | { .clkdm_name = "mpu_clkdm", }, | ||
58 | { .clkdm_name = "wkup_clkdm", }, | ||
59 | { NULL }, | ||
60 | }; | ||
61 | |||
62 | /* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */ | ||
63 | static struct clkdm_dep per_wkdeps[] = { | ||
64 | { .clkdm_name = "core_l3_clkdm" }, | ||
65 | { .clkdm_name = "core_l4_clkdm" }, | ||
66 | { .clkdm_name = "iva2_clkdm" }, | ||
67 | { .clkdm_name = "mpu_clkdm" }, | ||
68 | { .clkdm_name = "wkup_clkdm" }, | ||
69 | { NULL }, | ||
70 | }; | ||
71 | |||
72 | /* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */ | ||
73 | static struct clkdm_dep usbhost_wkdeps[] = { | ||
74 | { .clkdm_name = "core_l3_clkdm" }, | ||
75 | { .clkdm_name = "core_l4_clkdm" }, | ||
76 | { .clkdm_name = "iva2_clkdm" }, | ||
77 | { .clkdm_name = "mpu_clkdm" }, | ||
78 | { .clkdm_name = "wkup_clkdm" }, | ||
79 | { NULL }, | ||
80 | }; | ||
81 | |||
82 | /* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */ | ||
83 | static struct clkdm_dep mpu_3xxx_wkdeps[] = { | ||
84 | { .clkdm_name = "core_l3_clkdm" }, | ||
85 | { .clkdm_name = "core_l4_clkdm" }, | ||
86 | { .clkdm_name = "iva2_clkdm" }, | ||
87 | { .clkdm_name = "dss_clkdm" }, | ||
88 | { .clkdm_name = "per_clkdm" }, | ||
89 | { NULL }, | ||
90 | }; | ||
91 | |||
92 | /* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */ | ||
93 | static struct clkdm_dep iva2_wkdeps[] = { | ||
94 | { .clkdm_name = "core_l3_clkdm" }, | ||
95 | { .clkdm_name = "core_l4_clkdm" }, | ||
96 | { .clkdm_name = "mpu_clkdm" }, | ||
97 | { .clkdm_name = "wkup_clkdm" }, | ||
98 | { .clkdm_name = "dss_clkdm" }, | ||
99 | { .clkdm_name = "per_clkdm" }, | ||
100 | { NULL }, | ||
101 | }; | ||
102 | |||
103 | /* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */ | ||
104 | static struct clkdm_dep cam_wkdeps[] = { | ||
105 | { .clkdm_name = "iva2_clkdm" }, | ||
106 | { .clkdm_name = "mpu_clkdm" }, | ||
107 | { .clkdm_name = "wkup_clkdm" }, | ||
108 | { NULL }, | ||
109 | }; | ||
110 | |||
111 | /* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */ | ||
112 | static struct clkdm_dep dss_wkdeps[] = { | ||
113 | { .clkdm_name = "iva2_clkdm" }, | ||
114 | { .clkdm_name = "mpu_clkdm" }, | ||
115 | { .clkdm_name = "wkup_clkdm" }, | ||
116 | { NULL }, | ||
117 | }; | ||
118 | |||
119 | /* 3430: PM_WKDEP_NEON: MPU */ | ||
120 | static struct clkdm_dep neon_wkdeps[] = { | ||
121 | { .clkdm_name = "mpu_clkdm" }, | ||
122 | { NULL }, | ||
123 | }; | ||
124 | |||
125 | /* Sleep dependency source arrays for OMAP3-specific clkdms */ | ||
126 | |||
127 | /* 3430: CM_SLEEPDEP_DSS: MPU, IVA */ | ||
128 | static struct clkdm_dep dss_sleepdeps[] = { | ||
129 | { .clkdm_name = "mpu_clkdm" }, | ||
130 | { .clkdm_name = "iva2_clkdm" }, | ||
131 | { NULL }, | ||
132 | }; | ||
133 | |||
134 | /* 3430: CM_SLEEPDEP_PER: MPU, IVA */ | ||
135 | static struct clkdm_dep per_sleepdeps[] = { | ||
136 | { .clkdm_name = "mpu_clkdm" }, | ||
137 | { .clkdm_name = "iva2_clkdm" }, | ||
138 | { NULL }, | ||
139 | }; | ||
140 | |||
141 | /* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */ | ||
142 | static struct clkdm_dep usbhost_sleepdeps[] = { | ||
143 | { .clkdm_name = "mpu_clkdm" }, | ||
144 | { .clkdm_name = "iva2_clkdm" }, | ||
145 | { NULL }, | ||
146 | }; | ||
147 | |||
148 | /* 3430: CM_SLEEPDEP_CAM: MPU */ | ||
149 | static struct clkdm_dep cam_sleepdeps[] = { | ||
150 | { .clkdm_name = "mpu_clkdm" }, | ||
151 | { NULL }, | ||
152 | }; | ||
153 | |||
154 | /* | ||
155 | * 3430ES1: CM_SLEEPDEP_GFX: MPU | ||
156 | * 3430ES2: CM_SLEEPDEP_SGX: MPU | ||
157 | * These can share data since they will never be present simultaneously | ||
158 | * on the same device. | ||
159 | */ | ||
160 | static struct clkdm_dep gfx_sgx_sleepdeps[] = { | ||
161 | { .clkdm_name = "mpu_clkdm" }, | ||
162 | { NULL }, | ||
163 | }; | ||
164 | |||
165 | /* | ||
166 | * OMAP3 clockdomains | ||
167 | */ | ||
168 | |||
169 | static struct clockdomain mpu_3xxx_clkdm = { | ||
170 | .name = "mpu_clkdm", | ||
171 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
172 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, | ||
173 | .dep_bit = OMAP3430_EN_MPU_SHIFT, | ||
174 | .wkdep_srcs = mpu_3xxx_wkdeps, | ||
175 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, | ||
176 | }; | ||
177 | |||
178 | static struct clockdomain neon_clkdm = { | ||
179 | .name = "neon_clkdm", | ||
180 | .pwrdm = { .name = "neon_pwrdm" }, | ||
181 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
182 | .wkdep_srcs = neon_wkdeps, | ||
183 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, | ||
184 | }; | ||
185 | |||
186 | static struct clockdomain iva2_clkdm = { | ||
187 | .name = "iva2_clkdm", | ||
188 | .pwrdm = { .name = "iva2_pwrdm" }, | ||
189 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
190 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, | ||
191 | .wkdep_srcs = iva2_wkdeps, | ||
192 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, | ||
193 | }; | ||
194 | |||
195 | static struct clockdomain gfx_3430es1_clkdm = { | ||
196 | .name = "gfx_clkdm", | ||
197 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
198 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
199 | .wkdep_srcs = gfx_sgx_3xxx_wkdeps, | ||
200 | .sleepdep_srcs = gfx_sgx_sleepdeps, | ||
201 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, | ||
202 | }; | ||
203 | |||
204 | static struct clockdomain sgx_clkdm = { | ||
205 | .name = "sgx_clkdm", | ||
206 | .pwrdm = { .name = "sgx_pwrdm" }, | ||
207 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
208 | .wkdep_srcs = gfx_sgx_3xxx_wkdeps, | ||
209 | .sleepdep_srcs = gfx_sgx_sleepdeps, | ||
210 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, | ||
211 | }; | ||
212 | |||
213 | /* | ||
214 | * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but | ||
215 | * then that information was removed from the 34xx ES2+ TRM. It is | ||
216 | * unclear whether the core is still there, but the clockdomain logic | ||
217 | * is there, and must be programmed to an appropriate state if the | ||
218 | * CORE clockdomain is to become inactive. | ||
219 | */ | ||
220 | static struct clockdomain d2d_clkdm = { | ||
221 | .name = "d2d_clkdm", | ||
222 | .pwrdm = { .name = "core_pwrdm" }, | ||
223 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
224 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, | ||
225 | }; | ||
226 | |||
227 | /* | ||
228 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
229 | * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm | ||
230 | * could cause trouble | ||
231 | */ | ||
232 | static struct clockdomain core_l3_3xxx_clkdm = { | ||
233 | .name = "core_l3_clkdm", | ||
234 | .pwrdm = { .name = "core_pwrdm" }, | ||
235 | .flags = CLKDM_CAN_HWSUP, | ||
236 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
237 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, | ||
238 | }; | ||
239 | |||
240 | /* | ||
241 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
242 | * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm | ||
243 | * could cause trouble | ||
244 | */ | ||
245 | static struct clockdomain core_l4_3xxx_clkdm = { | ||
246 | .name = "core_l4_clkdm", | ||
247 | .pwrdm = { .name = "core_pwrdm" }, | ||
248 | .flags = CLKDM_CAN_HWSUP, | ||
249 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
250 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, | ||
251 | }; | ||
252 | |||
253 | /* Another case of bit name collisions between several registers: EN_DSS */ | ||
254 | static struct clockdomain dss_3xxx_clkdm = { | ||
255 | .name = "dss_clkdm", | ||
256 | .pwrdm = { .name = "dss_pwrdm" }, | ||
257 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
258 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, | ||
259 | .wkdep_srcs = dss_wkdeps, | ||
260 | .sleepdep_srcs = dss_sleepdeps, | ||
261 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, | ||
262 | }; | ||
263 | |||
264 | static struct clockdomain cam_clkdm = { | ||
265 | .name = "cam_clkdm", | ||
266 | .pwrdm = { .name = "cam_pwrdm" }, | ||
267 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
268 | .wkdep_srcs = cam_wkdeps, | ||
269 | .sleepdep_srcs = cam_sleepdeps, | ||
270 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, | ||
271 | }; | ||
272 | |||
273 | static struct clockdomain usbhost_clkdm = { | ||
274 | .name = "usbhost_clkdm", | ||
275 | .pwrdm = { .name = "usbhost_pwrdm" }, | ||
276 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
277 | .wkdep_srcs = usbhost_wkdeps, | ||
278 | .sleepdep_srcs = usbhost_sleepdeps, | ||
279 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, | ||
280 | }; | ||
281 | |||
282 | static struct clockdomain per_clkdm = { | ||
283 | .name = "per_clkdm", | ||
284 | .pwrdm = { .name = "per_pwrdm" }, | ||
285 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
286 | .dep_bit = OMAP3430_EN_PER_SHIFT, | ||
287 | .wkdep_srcs = per_wkdeps, | ||
288 | .sleepdep_srcs = per_sleepdeps, | ||
289 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, | ||
290 | }; | ||
291 | |||
292 | /* | ||
293 | * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is | ||
294 | * switched of even if sdti is in use | ||
295 | */ | ||
296 | static struct clockdomain emu_clkdm = { | ||
297 | .name = "emu_clkdm", | ||
298 | .pwrdm = { .name = "emu_pwrdm" }, | ||
299 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, | ||
300 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, | ||
301 | }; | ||
302 | |||
303 | static struct clockdomain dpll1_clkdm = { | ||
304 | .name = "dpll1_clkdm", | ||
305 | .pwrdm = { .name = "dpll1_pwrdm" }, | ||
306 | }; | ||
307 | |||
308 | static struct clockdomain dpll2_clkdm = { | ||
309 | .name = "dpll2_clkdm", | ||
310 | .pwrdm = { .name = "dpll2_pwrdm" }, | ||
311 | }; | ||
312 | |||
313 | static struct clockdomain dpll3_clkdm = { | ||
314 | .name = "dpll3_clkdm", | ||
315 | .pwrdm = { .name = "dpll3_pwrdm" }, | ||
316 | }; | ||
317 | |||
318 | static struct clockdomain dpll4_clkdm = { | ||
319 | .name = "dpll4_clkdm", | ||
320 | .pwrdm = { .name = "dpll4_pwrdm" }, | ||
321 | }; | ||
322 | |||
323 | static struct clockdomain dpll5_clkdm = { | ||
324 | .name = "dpll5_clkdm", | ||
325 | .pwrdm = { .name = "dpll5_pwrdm" }, | ||
326 | }; | ||
327 | |||
328 | /* | ||
329 | * Clockdomain hwsup dependencies | ||
330 | */ | ||
331 | |||
332 | static struct clkdm_autodep clkdm_autodeps[] = { | ||
333 | { | ||
334 | .clkdm = { .name = "mpu_clkdm" }, | ||
335 | }, | ||
336 | { | ||
337 | .clkdm = { .name = "iva2_clkdm" }, | ||
338 | }, | ||
339 | { | ||
340 | .clkdm = { .name = NULL }, | ||
341 | } | ||
342 | }; | ||
343 | |||
344 | /* | ||
345 | * | ||
346 | */ | ||
347 | |||
348 | static struct clockdomain *clockdomains_omap3430_common[] __initdata = { | ||
349 | &wkup_common_clkdm, | ||
350 | &cm_common_clkdm, | ||
351 | &prm_common_clkdm, | ||
352 | &mpu_3xxx_clkdm, | ||
353 | &neon_clkdm, | ||
354 | &iva2_clkdm, | ||
355 | &d2d_clkdm, | ||
356 | &core_l3_3xxx_clkdm, | ||
357 | &core_l4_3xxx_clkdm, | ||
358 | &dss_3xxx_clkdm, | ||
359 | &cam_clkdm, | ||
360 | &per_clkdm, | ||
361 | &emu_clkdm, | ||
362 | &dpll1_clkdm, | ||
363 | &dpll2_clkdm, | ||
364 | &dpll3_clkdm, | ||
365 | &dpll4_clkdm, | ||
366 | NULL | ||
367 | }; | ||
368 | |||
369 | static struct clockdomain *clockdomains_omap3430es1[] __initdata = { | ||
370 | &gfx_3430es1_clkdm, | ||
371 | NULL, | ||
372 | }; | ||
373 | |||
374 | static struct clockdomain *clockdomains_omap3430es2plus[] __initdata = { | ||
375 | &sgx_clkdm, | ||
376 | &dpll5_clkdm, | ||
377 | &usbhost_clkdm, | ||
378 | NULL, | ||
379 | }; | ||
380 | |||
381 | void __init omap3xxx_clockdomains_init(void) | ||
382 | { | ||
383 | struct clockdomain **sc; | ||
384 | |||
385 | if (!cpu_is_omap34xx()) | ||
386 | return; | ||
387 | |||
388 | clkdm_register_platform_funcs(&omap3_clkdm_operations); | ||
389 | clkdm_register_clkdms(clockdomains_omap3430_common); | ||
390 | |||
391 | sc = (omap_rev() == OMAP3430_REV_ES1_0) ? clockdomains_omap3430es1 : | ||
392 | clockdomains_omap3430es2plus; | ||
393 | |||
394 | clkdm_register_clkdms(sc); | ||
395 | |||
396 | clkdm_register_autodeps(clkdm_autodeps); | ||
397 | clkdm_complete_init(); | ||
398 | } | ||
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index dccc651fa0d0..9299ac291d28 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -34,350 +34,122 @@ | |||
34 | /* Static Dependencies for OMAP4 Clock Domains */ | 34 | /* Static Dependencies for OMAP4 Clock Domains */ |
35 | 35 | ||
36 | static struct clkdm_dep d2d_wkup_sleep_deps[] = { | 36 | static struct clkdm_dep d2d_wkup_sleep_deps[] = { |
37 | { | 37 | { .clkdm_name = "abe_clkdm" }, |
38 | .clkdm_name = "abe_clkdm", | 38 | { .clkdm_name = "ivahd_clkdm" }, |
39 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 39 | { .clkdm_name = "l3_1_clkdm" }, |
40 | }, | 40 | { .clkdm_name = "l3_2_clkdm" }, |
41 | { | 41 | { .clkdm_name = "l3_emif_clkdm" }, |
42 | .clkdm_name = "ivahd_clkdm", | 42 | { .clkdm_name = "l3_init_clkdm" }, |
43 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 43 | { .clkdm_name = "l4_cfg_clkdm" }, |
44 | }, | 44 | { .clkdm_name = "l4_per_clkdm" }, |
45 | { | ||
46 | .clkdm_name = "l3_1_clkdm", | ||
47 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
48 | }, | ||
49 | { | ||
50 | .clkdm_name = "l3_2_clkdm", | ||
51 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
52 | }, | ||
53 | { | ||
54 | .clkdm_name = "l3_emif_clkdm", | ||
55 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
56 | }, | ||
57 | { | ||
58 | .clkdm_name = "l3_init_clkdm", | ||
59 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
60 | }, | ||
61 | { | ||
62 | .clkdm_name = "l4_cfg_clkdm", | ||
63 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
64 | }, | ||
65 | { | ||
66 | .clkdm_name = "l4_per_clkdm", | ||
67 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
68 | }, | ||
69 | { NULL }, | 45 | { NULL }, |
70 | }; | 46 | }; |
71 | 47 | ||
72 | static struct clkdm_dep ducati_wkup_sleep_deps[] = { | 48 | static struct clkdm_dep ducati_wkup_sleep_deps[] = { |
73 | { | 49 | { .clkdm_name = "abe_clkdm" }, |
74 | .clkdm_name = "abe_clkdm", | 50 | { .clkdm_name = "ivahd_clkdm" }, |
75 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 51 | { .clkdm_name = "l3_1_clkdm" }, |
76 | }, | 52 | { .clkdm_name = "l3_2_clkdm" }, |
77 | { | 53 | { .clkdm_name = "l3_dss_clkdm" }, |
78 | .clkdm_name = "ivahd_clkdm", | 54 | { .clkdm_name = "l3_emif_clkdm" }, |
79 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 55 | { .clkdm_name = "l3_gfx_clkdm" }, |
80 | }, | 56 | { .clkdm_name = "l3_init_clkdm" }, |
81 | { | 57 | { .clkdm_name = "l4_cfg_clkdm" }, |
82 | .clkdm_name = "l3_1_clkdm", | 58 | { .clkdm_name = "l4_per_clkdm" }, |
83 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 59 | { .clkdm_name = "l4_secure_clkdm" }, |
84 | }, | 60 | { .clkdm_name = "l4_wkup_clkdm" }, |
85 | { | 61 | { .clkdm_name = "tesla_clkdm" }, |
86 | .clkdm_name = "l3_2_clkdm", | ||
87 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
88 | }, | ||
89 | { | ||
90 | .clkdm_name = "l3_dss_clkdm", | ||
91 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
92 | }, | ||
93 | { | ||
94 | .clkdm_name = "l3_emif_clkdm", | ||
95 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
96 | }, | ||
97 | { | ||
98 | .clkdm_name = "l3_gfx_clkdm", | ||
99 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
100 | }, | ||
101 | { | ||
102 | .clkdm_name = "l3_init_clkdm", | ||
103 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
104 | }, | ||
105 | { | ||
106 | .clkdm_name = "l4_cfg_clkdm", | ||
107 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
108 | }, | ||
109 | { | ||
110 | .clkdm_name = "l4_per_clkdm", | ||
111 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
112 | }, | ||
113 | { | ||
114 | .clkdm_name = "l4_secure_clkdm", | ||
115 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
116 | }, | ||
117 | { | ||
118 | .clkdm_name = "l4_wkup_clkdm", | ||
119 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
120 | }, | ||
121 | { | ||
122 | .clkdm_name = "tesla_clkdm", | ||
123 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
124 | }, | ||
125 | { NULL }, | 62 | { NULL }, |
126 | }; | 63 | }; |
127 | 64 | ||
128 | static struct clkdm_dep iss_wkup_sleep_deps[] = { | 65 | static struct clkdm_dep iss_wkup_sleep_deps[] = { |
129 | { | 66 | { .clkdm_name = "ivahd_clkdm" }, |
130 | .clkdm_name = "ivahd_clkdm", | 67 | { .clkdm_name = "l3_1_clkdm" }, |
131 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 68 | { .clkdm_name = "l3_emif_clkdm" }, |
132 | }, | ||
133 | { | ||
134 | .clkdm_name = "l3_1_clkdm", | ||
135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
136 | }, | ||
137 | { | ||
138 | .clkdm_name = "l3_emif_clkdm", | ||
139 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
140 | }, | ||
141 | { NULL }, | 69 | { NULL }, |
142 | }; | 70 | }; |
143 | 71 | ||
144 | static struct clkdm_dep ivahd_wkup_sleep_deps[] = { | 72 | static struct clkdm_dep ivahd_wkup_sleep_deps[] = { |
145 | { | 73 | { .clkdm_name = "l3_1_clkdm" }, |
146 | .clkdm_name = "l3_1_clkdm", | 74 | { .clkdm_name = "l3_emif_clkdm" }, |
147 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
148 | }, | ||
149 | { | ||
150 | .clkdm_name = "l3_emif_clkdm", | ||
151 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
152 | }, | ||
153 | { NULL }, | 75 | { NULL }, |
154 | }; | 76 | }; |
155 | 77 | ||
156 | static struct clkdm_dep l3_dma_wkup_sleep_deps[] = { | 78 | static struct clkdm_dep l3_dma_wkup_sleep_deps[] = { |
157 | { | 79 | { .clkdm_name = "abe_clkdm" }, |
158 | .clkdm_name = "abe_clkdm", | 80 | { .clkdm_name = "ducati_clkdm" }, |
159 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 81 | { .clkdm_name = "ivahd_clkdm" }, |
160 | }, | 82 | { .clkdm_name = "l3_1_clkdm" }, |
161 | { | 83 | { .clkdm_name = "l3_dss_clkdm" }, |
162 | .clkdm_name = "ducati_clkdm", | 84 | { .clkdm_name = "l3_emif_clkdm" }, |
163 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 85 | { .clkdm_name = "l3_init_clkdm" }, |
164 | }, | 86 | { .clkdm_name = "l4_cfg_clkdm" }, |
165 | { | 87 | { .clkdm_name = "l4_per_clkdm" }, |
166 | .clkdm_name = "ivahd_clkdm", | 88 | { .clkdm_name = "l4_secure_clkdm" }, |
167 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 89 | { .clkdm_name = "l4_wkup_clkdm" }, |
168 | }, | ||
169 | { | ||
170 | .clkdm_name = "l3_1_clkdm", | ||
171 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
172 | }, | ||
173 | { | ||
174 | .clkdm_name = "l3_dss_clkdm", | ||
175 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
176 | }, | ||
177 | { | ||
178 | .clkdm_name = "l3_emif_clkdm", | ||
179 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
180 | }, | ||
181 | { | ||
182 | .clkdm_name = "l3_init_clkdm", | ||
183 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
184 | }, | ||
185 | { | ||
186 | .clkdm_name = "l4_cfg_clkdm", | ||
187 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
188 | }, | ||
189 | { | ||
190 | .clkdm_name = "l4_per_clkdm", | ||
191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
192 | }, | ||
193 | { | ||
194 | .clkdm_name = "l4_secure_clkdm", | ||
195 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
196 | }, | ||
197 | { | ||
198 | .clkdm_name = "l4_wkup_clkdm", | ||
199 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
200 | }, | ||
201 | { NULL }, | 90 | { NULL }, |
202 | }; | 91 | }; |
203 | 92 | ||
204 | static struct clkdm_dep l3_dss_wkup_sleep_deps[] = { | 93 | static struct clkdm_dep l3_dss_wkup_sleep_deps[] = { |
205 | { | 94 | { .clkdm_name = "ivahd_clkdm" }, |
206 | .clkdm_name = "ivahd_clkdm", | 95 | { .clkdm_name = "l3_2_clkdm" }, |
207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 96 | { .clkdm_name = "l3_emif_clkdm" }, |
208 | }, | ||
209 | { | ||
210 | .clkdm_name = "l3_2_clkdm", | ||
211 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
212 | }, | ||
213 | { | ||
214 | .clkdm_name = "l3_emif_clkdm", | ||
215 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
216 | }, | ||
217 | { NULL }, | 97 | { NULL }, |
218 | }; | 98 | }; |
219 | 99 | ||
220 | static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = { | 100 | static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = { |
221 | { | 101 | { .clkdm_name = "ivahd_clkdm" }, |
222 | .clkdm_name = "ivahd_clkdm", | 102 | { .clkdm_name = "l3_1_clkdm" }, |
223 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 103 | { .clkdm_name = "l3_emif_clkdm" }, |
224 | }, | ||
225 | { | ||
226 | .clkdm_name = "l3_1_clkdm", | ||
227 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
228 | }, | ||
229 | { | ||
230 | .clkdm_name = "l3_emif_clkdm", | ||
231 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
232 | }, | ||
233 | { NULL }, | 104 | { NULL }, |
234 | }; | 105 | }; |
235 | 106 | ||
236 | static struct clkdm_dep l3_init_wkup_sleep_deps[] = { | 107 | static struct clkdm_dep l3_init_wkup_sleep_deps[] = { |
237 | { | 108 | { .clkdm_name = "abe_clkdm" }, |
238 | .clkdm_name = "abe_clkdm", | 109 | { .clkdm_name = "ivahd_clkdm" }, |
239 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 110 | { .clkdm_name = "l3_emif_clkdm" }, |
240 | }, | 111 | { .clkdm_name = "l4_cfg_clkdm" }, |
241 | { | 112 | { .clkdm_name = "l4_per_clkdm" }, |
242 | .clkdm_name = "ivahd_clkdm", | 113 | { .clkdm_name = "l4_secure_clkdm" }, |
243 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 114 | { .clkdm_name = "l4_wkup_clkdm" }, |
244 | }, | ||
245 | { | ||
246 | .clkdm_name = "l3_emif_clkdm", | ||
247 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
248 | }, | ||
249 | { | ||
250 | .clkdm_name = "l4_cfg_clkdm", | ||
251 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
252 | }, | ||
253 | { | ||
254 | .clkdm_name = "l4_per_clkdm", | ||
255 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
256 | }, | ||
257 | { | ||
258 | .clkdm_name = "l4_secure_clkdm", | ||
259 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
260 | }, | ||
261 | { | ||
262 | .clkdm_name = "l4_wkup_clkdm", | ||
263 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
264 | }, | ||
265 | { NULL }, | 115 | { NULL }, |
266 | }; | 116 | }; |
267 | 117 | ||
268 | static struct clkdm_dep l4_secure_wkup_sleep_deps[] = { | 118 | static struct clkdm_dep l4_secure_wkup_sleep_deps[] = { |
269 | { | 119 | { .clkdm_name = "l3_1_clkdm" }, |
270 | .clkdm_name = "l3_1_clkdm", | 120 | { .clkdm_name = "l3_emif_clkdm" }, |
271 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 121 | { .clkdm_name = "l4_per_clkdm" }, |
272 | }, | ||
273 | { | ||
274 | .clkdm_name = "l3_emif_clkdm", | ||
275 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
276 | }, | ||
277 | { | ||
278 | .clkdm_name = "l4_per_clkdm", | ||
279 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
280 | }, | ||
281 | { NULL }, | 122 | { NULL }, |
282 | }; | 123 | }; |
283 | 124 | ||
284 | static struct clkdm_dep mpu_wkup_sleep_deps[] = { | 125 | static struct clkdm_dep mpu_wkup_sleep_deps[] = { |
285 | { | 126 | { .clkdm_name = "abe_clkdm" }, |
286 | .clkdm_name = "abe_clkdm", | 127 | { .clkdm_name = "ducati_clkdm" }, |
287 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 128 | { .clkdm_name = "ivahd_clkdm" }, |
288 | }, | 129 | { .clkdm_name = "l3_1_clkdm" }, |
289 | { | 130 | { .clkdm_name = "l3_2_clkdm" }, |
290 | .clkdm_name = "ducati_clkdm", | 131 | { .clkdm_name = "l3_dss_clkdm" }, |
291 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 132 | { .clkdm_name = "l3_emif_clkdm" }, |
292 | }, | 133 | { .clkdm_name = "l3_gfx_clkdm" }, |
293 | { | 134 | { .clkdm_name = "l3_init_clkdm" }, |
294 | .clkdm_name = "ivahd_clkdm", | 135 | { .clkdm_name = "l4_cfg_clkdm" }, |
295 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 136 | { .clkdm_name = "l4_per_clkdm" }, |
296 | }, | 137 | { .clkdm_name = "l4_secure_clkdm" }, |
297 | { | 138 | { .clkdm_name = "l4_wkup_clkdm" }, |
298 | .clkdm_name = "l3_1_clkdm", | 139 | { .clkdm_name = "tesla_clkdm" }, |
299 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
300 | }, | ||
301 | { | ||
302 | .clkdm_name = "l3_2_clkdm", | ||
303 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
304 | }, | ||
305 | { | ||
306 | .clkdm_name = "l3_dss_clkdm", | ||
307 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
308 | }, | ||
309 | { | ||
310 | .clkdm_name = "l3_emif_clkdm", | ||
311 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
312 | }, | ||
313 | { | ||
314 | .clkdm_name = "l3_gfx_clkdm", | ||
315 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
316 | }, | ||
317 | { | ||
318 | .clkdm_name = "l3_init_clkdm", | ||
319 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
320 | }, | ||
321 | { | ||
322 | .clkdm_name = "l4_cfg_clkdm", | ||
323 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
324 | }, | ||
325 | { | ||
326 | .clkdm_name = "l4_per_clkdm", | ||
327 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
328 | }, | ||
329 | { | ||
330 | .clkdm_name = "l4_secure_clkdm", | ||
331 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
332 | }, | ||
333 | { | ||
334 | .clkdm_name = "l4_wkup_clkdm", | ||
335 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
336 | }, | ||
337 | { | ||
338 | .clkdm_name = "tesla_clkdm", | ||
339 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
340 | }, | ||
341 | { NULL }, | 140 | { NULL }, |
342 | }; | 141 | }; |
343 | 142 | ||
344 | static struct clkdm_dep tesla_wkup_sleep_deps[] = { | 143 | static struct clkdm_dep tesla_wkup_sleep_deps[] = { |
345 | { | 144 | { .clkdm_name = "abe_clkdm" }, |
346 | .clkdm_name = "abe_clkdm", | 145 | { .clkdm_name = "ivahd_clkdm" }, |
347 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 146 | { .clkdm_name = "l3_1_clkdm" }, |
348 | }, | 147 | { .clkdm_name = "l3_2_clkdm" }, |
349 | { | 148 | { .clkdm_name = "l3_emif_clkdm" }, |
350 | .clkdm_name = "ivahd_clkdm", | 149 | { .clkdm_name = "l3_init_clkdm" }, |
351 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | 150 | { .clkdm_name = "l4_cfg_clkdm" }, |
352 | }, | 151 | { .clkdm_name = "l4_per_clkdm" }, |
353 | { | 152 | { .clkdm_name = "l4_wkup_clkdm" }, |
354 | .clkdm_name = "l3_1_clkdm", | ||
355 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
356 | }, | ||
357 | { | ||
358 | .clkdm_name = "l3_2_clkdm", | ||
359 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
360 | }, | ||
361 | { | ||
362 | .clkdm_name = "l3_emif_clkdm", | ||
363 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
364 | }, | ||
365 | { | ||
366 | .clkdm_name = "l3_init_clkdm", | ||
367 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
368 | }, | ||
369 | { | ||
370 | .clkdm_name = "l4_cfg_clkdm", | ||
371 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
372 | }, | ||
373 | { | ||
374 | .clkdm_name = "l4_per_clkdm", | ||
375 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
376 | }, | ||
377 | { | ||
378 | .clkdm_name = "l4_wkup_clkdm", | ||
379 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) | ||
380 | }, | ||
381 | { NULL }, | 153 | { NULL }, |
382 | }; | 154 | }; |
383 | 155 | ||
@@ -388,7 +160,6 @@ static struct clockdomain l4_cefuse_44xx_clkdm = { | |||
388 | .cm_inst = OMAP4430_CM2_CEFUSE_INST, | 160 | .cm_inst = OMAP4430_CM2_CEFUSE_INST, |
389 | .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS, | 161 | .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS, |
390 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 162 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
391 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
392 | }; | 163 | }; |
393 | 164 | ||
394 | static struct clockdomain l4_cfg_44xx_clkdm = { | 165 | static struct clockdomain l4_cfg_44xx_clkdm = { |
@@ -399,7 +170,6 @@ static struct clockdomain l4_cfg_44xx_clkdm = { | |||
399 | .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, | 170 | .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, |
400 | .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT, | 171 | .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT, |
401 | .flags = CLKDM_CAN_HWSUP, | 172 | .flags = CLKDM_CAN_HWSUP, |
402 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
403 | }; | 173 | }; |
404 | 174 | ||
405 | static struct clockdomain tesla_44xx_clkdm = { | 175 | static struct clockdomain tesla_44xx_clkdm = { |
@@ -412,7 +182,6 @@ static struct clockdomain tesla_44xx_clkdm = { | |||
412 | .wkdep_srcs = tesla_wkup_sleep_deps, | 182 | .wkdep_srcs = tesla_wkup_sleep_deps, |
413 | .sleepdep_srcs = tesla_wkup_sleep_deps, | 183 | .sleepdep_srcs = tesla_wkup_sleep_deps, |
414 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 184 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
415 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
416 | }; | 185 | }; |
417 | 186 | ||
418 | static struct clockdomain l3_gfx_44xx_clkdm = { | 187 | static struct clockdomain l3_gfx_44xx_clkdm = { |
@@ -425,7 +194,6 @@ static struct clockdomain l3_gfx_44xx_clkdm = { | |||
425 | .wkdep_srcs = l3_gfx_wkup_sleep_deps, | 194 | .wkdep_srcs = l3_gfx_wkup_sleep_deps, |
426 | .sleepdep_srcs = l3_gfx_wkup_sleep_deps, | 195 | .sleepdep_srcs = l3_gfx_wkup_sleep_deps, |
427 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 196 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
428 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
429 | }; | 197 | }; |
430 | 198 | ||
431 | static struct clockdomain ivahd_44xx_clkdm = { | 199 | static struct clockdomain ivahd_44xx_clkdm = { |
@@ -438,7 +206,6 @@ static struct clockdomain ivahd_44xx_clkdm = { | |||
438 | .wkdep_srcs = ivahd_wkup_sleep_deps, | 206 | .wkdep_srcs = ivahd_wkup_sleep_deps, |
439 | .sleepdep_srcs = ivahd_wkup_sleep_deps, | 207 | .sleepdep_srcs = ivahd_wkup_sleep_deps, |
440 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 208 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
441 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
442 | }; | 209 | }; |
443 | 210 | ||
444 | static struct clockdomain l4_secure_44xx_clkdm = { | 211 | static struct clockdomain l4_secure_44xx_clkdm = { |
@@ -451,7 +218,6 @@ static struct clockdomain l4_secure_44xx_clkdm = { | |||
451 | .wkdep_srcs = l4_secure_wkup_sleep_deps, | 218 | .wkdep_srcs = l4_secure_wkup_sleep_deps, |
452 | .sleepdep_srcs = l4_secure_wkup_sleep_deps, | 219 | .sleepdep_srcs = l4_secure_wkup_sleep_deps, |
453 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 220 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
454 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
455 | }; | 221 | }; |
456 | 222 | ||
457 | static struct clockdomain l4_per_44xx_clkdm = { | 223 | static struct clockdomain l4_per_44xx_clkdm = { |
@@ -462,7 +228,6 @@ static struct clockdomain l4_per_44xx_clkdm = { | |||
462 | .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, | 228 | .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, |
463 | .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT, | 229 | .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT, |
464 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 230 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
465 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
466 | }; | 231 | }; |
467 | 232 | ||
468 | static struct clockdomain abe_44xx_clkdm = { | 233 | static struct clockdomain abe_44xx_clkdm = { |
@@ -473,7 +238,6 @@ static struct clockdomain abe_44xx_clkdm = { | |||
473 | .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, | 238 | .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, |
474 | .dep_bit = OMAP4430_ABE_STATDEP_SHIFT, | 239 | .dep_bit = OMAP4430_ABE_STATDEP_SHIFT, |
475 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 240 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
476 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
477 | }; | 241 | }; |
478 | 242 | ||
479 | static struct clockdomain l3_instr_44xx_clkdm = { | 243 | static struct clockdomain l3_instr_44xx_clkdm = { |
@@ -482,7 +246,6 @@ static struct clockdomain l3_instr_44xx_clkdm = { | |||
482 | .prcm_partition = OMAP4430_CM2_PARTITION, | 246 | .prcm_partition = OMAP4430_CM2_PARTITION, |
483 | .cm_inst = OMAP4430_CM2_CORE_INST, | 247 | .cm_inst = OMAP4430_CM2_CORE_INST, |
484 | .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS, | 248 | .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS, |
485 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
486 | }; | 249 | }; |
487 | 250 | ||
488 | static struct clockdomain l3_init_44xx_clkdm = { | 251 | static struct clockdomain l3_init_44xx_clkdm = { |
@@ -495,7 +258,6 @@ static struct clockdomain l3_init_44xx_clkdm = { | |||
495 | .wkdep_srcs = l3_init_wkup_sleep_deps, | 258 | .wkdep_srcs = l3_init_wkup_sleep_deps, |
496 | .sleepdep_srcs = l3_init_wkup_sleep_deps, | 259 | .sleepdep_srcs = l3_init_wkup_sleep_deps, |
497 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 260 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
498 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
499 | }; | 261 | }; |
500 | 262 | ||
501 | static struct clockdomain d2d_44xx_clkdm = { | 263 | static struct clockdomain d2d_44xx_clkdm = { |
@@ -507,7 +269,6 @@ static struct clockdomain d2d_44xx_clkdm = { | |||
507 | .wkdep_srcs = d2d_wkup_sleep_deps, | 269 | .wkdep_srcs = d2d_wkup_sleep_deps, |
508 | .sleepdep_srcs = d2d_wkup_sleep_deps, | 270 | .sleepdep_srcs = d2d_wkup_sleep_deps, |
509 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 271 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
510 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
511 | }; | 272 | }; |
512 | 273 | ||
513 | static struct clockdomain mpu0_44xx_clkdm = { | 274 | static struct clockdomain mpu0_44xx_clkdm = { |
@@ -517,7 +278,6 @@ static struct clockdomain mpu0_44xx_clkdm = { | |||
517 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, | 278 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, |
518 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS, | 279 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS, |
519 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 280 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
520 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
521 | }; | 281 | }; |
522 | 282 | ||
523 | static struct clockdomain mpu1_44xx_clkdm = { | 283 | static struct clockdomain mpu1_44xx_clkdm = { |
@@ -527,7 +287,6 @@ static struct clockdomain mpu1_44xx_clkdm = { | |||
527 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, | 287 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, |
528 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS, | 288 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS, |
529 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 289 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
530 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
531 | }; | 290 | }; |
532 | 291 | ||
533 | static struct clockdomain l3_emif_44xx_clkdm = { | 292 | static struct clockdomain l3_emif_44xx_clkdm = { |
@@ -538,7 +297,6 @@ static struct clockdomain l3_emif_44xx_clkdm = { | |||
538 | .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, | 297 | .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, |
539 | .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT, | 298 | .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT, |
540 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 299 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
541 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
542 | }; | 300 | }; |
543 | 301 | ||
544 | static struct clockdomain l4_ao_44xx_clkdm = { | 302 | static struct clockdomain l4_ao_44xx_clkdm = { |
@@ -548,7 +306,6 @@ static struct clockdomain l4_ao_44xx_clkdm = { | |||
548 | .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST, | 306 | .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST, |
549 | .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS, | 307 | .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS, |
550 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 308 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
551 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
552 | }; | 309 | }; |
553 | 310 | ||
554 | static struct clockdomain ducati_44xx_clkdm = { | 311 | static struct clockdomain ducati_44xx_clkdm = { |
@@ -561,7 +318,6 @@ static struct clockdomain ducati_44xx_clkdm = { | |||
561 | .wkdep_srcs = ducati_wkup_sleep_deps, | 318 | .wkdep_srcs = ducati_wkup_sleep_deps, |
562 | .sleepdep_srcs = ducati_wkup_sleep_deps, | 319 | .sleepdep_srcs = ducati_wkup_sleep_deps, |
563 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 320 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
564 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
565 | }; | 321 | }; |
566 | 322 | ||
567 | static struct clockdomain mpu_44xx_clkdm = { | 323 | static struct clockdomain mpu_44xx_clkdm = { |
@@ -573,7 +329,6 @@ static struct clockdomain mpu_44xx_clkdm = { | |||
573 | .wkdep_srcs = mpu_wkup_sleep_deps, | 329 | .wkdep_srcs = mpu_wkup_sleep_deps, |
574 | .sleepdep_srcs = mpu_wkup_sleep_deps, | 330 | .sleepdep_srcs = mpu_wkup_sleep_deps, |
575 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 331 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
576 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
577 | }; | 332 | }; |
578 | 333 | ||
579 | static struct clockdomain l3_2_44xx_clkdm = { | 334 | static struct clockdomain l3_2_44xx_clkdm = { |
@@ -584,7 +339,6 @@ static struct clockdomain l3_2_44xx_clkdm = { | |||
584 | .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, | 339 | .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, |
585 | .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT, | 340 | .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT, |
586 | .flags = CLKDM_CAN_HWSUP, | 341 | .flags = CLKDM_CAN_HWSUP, |
587 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
588 | }; | 342 | }; |
589 | 343 | ||
590 | static struct clockdomain l3_1_44xx_clkdm = { | 344 | static struct clockdomain l3_1_44xx_clkdm = { |
@@ -595,7 +349,6 @@ static struct clockdomain l3_1_44xx_clkdm = { | |||
595 | .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, | 349 | .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, |
596 | .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT, | 350 | .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT, |
597 | .flags = CLKDM_CAN_HWSUP, | 351 | .flags = CLKDM_CAN_HWSUP, |
598 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
599 | }; | 352 | }; |
600 | 353 | ||
601 | static struct clockdomain iss_44xx_clkdm = { | 354 | static struct clockdomain iss_44xx_clkdm = { |
@@ -607,7 +360,6 @@ static struct clockdomain iss_44xx_clkdm = { | |||
607 | .wkdep_srcs = iss_wkup_sleep_deps, | 360 | .wkdep_srcs = iss_wkup_sleep_deps, |
608 | .sleepdep_srcs = iss_wkup_sleep_deps, | 361 | .sleepdep_srcs = iss_wkup_sleep_deps, |
609 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 362 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
610 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
611 | }; | 363 | }; |
612 | 364 | ||
613 | static struct clockdomain l3_dss_44xx_clkdm = { | 365 | static struct clockdomain l3_dss_44xx_clkdm = { |
@@ -620,7 +372,6 @@ static struct clockdomain l3_dss_44xx_clkdm = { | |||
620 | .wkdep_srcs = l3_dss_wkup_sleep_deps, | 372 | .wkdep_srcs = l3_dss_wkup_sleep_deps, |
621 | .sleepdep_srcs = l3_dss_wkup_sleep_deps, | 373 | .sleepdep_srcs = l3_dss_wkup_sleep_deps, |
622 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 374 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
623 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
624 | }; | 375 | }; |
625 | 376 | ||
626 | static struct clockdomain l4_wkup_44xx_clkdm = { | 377 | static struct clockdomain l4_wkup_44xx_clkdm = { |
@@ -631,7 +382,6 @@ static struct clockdomain l4_wkup_44xx_clkdm = { | |||
631 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, | 382 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, |
632 | .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, | 383 | .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, |
633 | .flags = CLKDM_CAN_HWSUP, | 384 | .flags = CLKDM_CAN_HWSUP, |
634 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
635 | }; | 385 | }; |
636 | 386 | ||
637 | static struct clockdomain emu_sys_44xx_clkdm = { | 387 | static struct clockdomain emu_sys_44xx_clkdm = { |
@@ -641,7 +391,6 @@ static struct clockdomain emu_sys_44xx_clkdm = { | |||
641 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, | 391 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, |
642 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, | 392 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, |
643 | .flags = CLKDM_CAN_HWSUP, | 393 | .flags = CLKDM_CAN_HWSUP, |
644 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
645 | }; | 394 | }; |
646 | 395 | ||
647 | static struct clockdomain l3_dma_44xx_clkdm = { | 396 | static struct clockdomain l3_dma_44xx_clkdm = { |
@@ -653,7 +402,6 @@ static struct clockdomain l3_dma_44xx_clkdm = { | |||
653 | .wkdep_srcs = l3_dma_wkup_sleep_deps, | 402 | .wkdep_srcs = l3_dma_wkup_sleep_deps, |
654 | .sleepdep_srcs = l3_dma_wkup_sleep_deps, | 403 | .sleepdep_srcs = l3_dma_wkup_sleep_deps, |
655 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 404 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
656 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
657 | }; | 405 | }; |
658 | 406 | ||
659 | /* As clockdomains are added or removed above, this list must also be changed */ | 407 | /* As clockdomains are added or removed above, this list must also be changed */ |
@@ -685,7 +433,10 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = { | |||
685 | NULL | 433 | NULL |
686 | }; | 434 | }; |
687 | 435 | ||
436 | |||
688 | void __init omap44xx_clockdomains_init(void) | 437 | void __init omap44xx_clockdomains_init(void) |
689 | { | 438 | { |
690 | clkdm_init(clockdomains_omap44xx, NULL, &omap4_clkdm_operations); | 439 | clkdm_register_platform_funcs(&omap4_clkdm_operations); |
440 | clkdm_register_clkdms(clockdomains_omap44xx); | ||
441 | clkdm_complete_init(); | ||
691 | } | 442 | } |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 37efb8696927..d27daf921c7e 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include "control.h" | 29 | #include "control.h" |
30 | 30 | ||
31 | static struct omap_chip_id omap_chip; | ||
32 | static unsigned int omap_revision; | 31 | static unsigned int omap_revision; |
33 | 32 | ||
34 | u32 omap_features; | 33 | u32 omap_features; |
@@ -39,19 +38,6 @@ unsigned int omap_rev(void) | |||
39 | } | 38 | } |
40 | EXPORT_SYMBOL(omap_rev); | 39 | EXPORT_SYMBOL(omap_rev); |
41 | 40 | ||
42 | /** | ||
43 | * omap_chip_is - test whether currently running OMAP matches a chip type | ||
44 | * @oc: omap_chip_t to test against | ||
45 | * | ||
46 | * Test whether the currently-running OMAP chip matches the supplied | ||
47 | * chip type 'oc'. Returns 1 upon a match; 0 upon failure. | ||
48 | */ | ||
49 | int omap_chip_is(struct omap_chip_id oci) | ||
50 | { | ||
51 | return (oci.oc & omap_chip.oc) ? 1 : 0; | ||
52 | } | ||
53 | EXPORT_SYMBOL(omap_chip_is); | ||
54 | |||
55 | int omap_type(void) | 41 | int omap_type(void) |
56 | { | 42 | { |
57 | u32 val = 0; | 43 | u32 val = 0; |
@@ -242,14 +228,12 @@ static void __init ti816x_check_features(void) | |||
242 | omap_features = OMAP3_HAS_NEON; | 228 | omap_features = OMAP3_HAS_NEON; |
243 | } | 229 | } |
244 | 230 | ||
245 | static void __init omap3_check_revision(void) | 231 | static void __init omap3_check_revision(const char **cpu_rev) |
246 | { | 232 | { |
247 | u32 cpuid, idcode; | 233 | u32 cpuid, idcode; |
248 | u16 hawkeye; | 234 | u16 hawkeye; |
249 | u8 rev; | 235 | u8 rev; |
250 | 236 | ||
251 | omap_chip.oc = CHIP_IS_OMAP3430; | ||
252 | |||
253 | /* | 237 | /* |
254 | * We cannot access revision registers on ES1.0. | 238 | * We cannot access revision registers on ES1.0. |
255 | * If the processor type is Cortex-A8 and the revision is 0x0 | 239 | * If the processor type is Cortex-A8 and the revision is 0x0 |
@@ -258,7 +242,7 @@ static void __init omap3_check_revision(void) | |||
258 | cpuid = read_cpuid(CPUID_ID); | 242 | cpuid = read_cpuid(CPUID_ID); |
259 | if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { | 243 | if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { |
260 | omap_revision = OMAP3430_REV_ES1_0; | 244 | omap_revision = OMAP3430_REV_ES1_0; |
261 | omap_chip.oc |= CHIP_IS_OMAP3430ES1; | 245 | *cpu_rev = "1.0"; |
262 | return; | 246 | return; |
263 | } | 247 | } |
264 | 248 | ||
@@ -279,77 +263,85 @@ static void __init omap3_check_revision(void) | |||
279 | case 0: /* Take care of early samples */ | 263 | case 0: /* Take care of early samples */ |
280 | case 1: | 264 | case 1: |
281 | omap_revision = OMAP3430_REV_ES2_0; | 265 | omap_revision = OMAP3430_REV_ES2_0; |
282 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; | 266 | *cpu_rev = "2.0"; |
283 | break; | 267 | break; |
284 | case 2: | 268 | case 2: |
285 | omap_revision = OMAP3430_REV_ES2_1; | 269 | omap_revision = OMAP3430_REV_ES2_1; |
286 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; | 270 | *cpu_rev = "2.1"; |
287 | break; | 271 | break; |
288 | case 3: | 272 | case 3: |
289 | omap_revision = OMAP3430_REV_ES3_0; | 273 | omap_revision = OMAP3430_REV_ES3_0; |
290 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_0; | 274 | *cpu_rev = "3.0"; |
291 | break; | 275 | break; |
292 | case 4: | 276 | case 4: |
293 | omap_revision = OMAP3430_REV_ES3_1; | 277 | omap_revision = OMAP3430_REV_ES3_1; |
294 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | 278 | *cpu_rev = "3.1"; |
295 | break; | 279 | break; |
296 | case 7: | 280 | case 7: |
297 | /* FALLTHROUGH */ | 281 | /* FALLTHROUGH */ |
298 | default: | 282 | default: |
299 | /* Use the latest known revision as default */ | 283 | /* Use the latest known revision as default */ |
300 | omap_revision = OMAP3430_REV_ES3_1_2; | 284 | omap_revision = OMAP3430_REV_ES3_1_2; |
301 | 285 | *cpu_rev = "3.1.2"; | |
302 | /* REVISIT: Add CHIP_IS_OMAP3430ES3_1_2? */ | ||
303 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | ||
304 | } | 286 | } |
305 | break; | 287 | break; |
306 | case 0xb868: | 288 | case 0xb868: |
307 | /* Handle OMAP35xx/AM35xx devices | 289 | /* |
290 | * Handle OMAP/AM 3505/3517 devices | ||
308 | * | 291 | * |
309 | * Set the device to be OMAP3505 here. Actual device | 292 | * Set the device to be OMAP3517 here. Actual device |
310 | * is identified later based on the features. | 293 | * is identified later based on the features. |
311 | * | ||
312 | * REVISIT: AM3505/AM3517 should have their own CHIP_IS | ||
313 | */ | 294 | */ |
314 | omap_revision = OMAP3505_REV(rev); | 295 | switch (rev) { |
315 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | 296 | case 0: |
297 | omap_revision = OMAP3517_REV_ES1_0; | ||
298 | *cpu_rev = "1.0"; | ||
299 | break; | ||
300 | case 1: | ||
301 | /* FALLTHROUGH */ | ||
302 | default: | ||
303 | omap_revision = OMAP3517_REV_ES1_1; | ||
304 | *cpu_rev = "1.1"; | ||
305 | } | ||
316 | break; | 306 | break; |
317 | case 0xb891: | 307 | case 0xb891: |
318 | /* Handle 36xx devices */ | 308 | /* Handle 36xx devices */ |
319 | omap_chip.oc |= CHIP_IS_OMAP3630ES1; | ||
320 | 309 | ||
321 | switch(rev) { | 310 | switch(rev) { |
322 | case 0: /* Take care of early samples */ | 311 | case 0: /* Take care of early samples */ |
323 | omap_revision = OMAP3630_REV_ES1_0; | 312 | omap_revision = OMAP3630_REV_ES1_0; |
313 | *cpu_rev = "1.0"; | ||
324 | break; | 314 | break; |
325 | case 1: | 315 | case 1: |
326 | omap_revision = OMAP3630_REV_ES1_1; | 316 | omap_revision = OMAP3630_REV_ES1_1; |
327 | omap_chip.oc |= CHIP_IS_OMAP3630ES1_1; | 317 | *cpu_rev = "1.1"; |
328 | break; | 318 | break; |
329 | case 2: | 319 | case 2: |
320 | /* FALLTHROUGH */ | ||
330 | default: | 321 | default: |
331 | omap_revision = OMAP3630_REV_ES1_2; | 322 | omap_revision = OMAP3630_REV_ES1_2; |
332 | omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; | 323 | *cpu_rev = "1.2"; |
333 | } | 324 | } |
334 | break; | 325 | break; |
335 | case 0xb81e: | 326 | case 0xb81e: |
336 | omap_chip.oc = CHIP_IS_TI816X; | ||
337 | |||
338 | switch (rev) { | 327 | switch (rev) { |
339 | case 0: | 328 | case 0: |
340 | omap_revision = TI8168_REV_ES1_0; | 329 | omap_revision = TI8168_REV_ES1_0; |
330 | *cpu_rev = "1.0"; | ||
341 | break; | 331 | break; |
342 | case 1: | 332 | case 1: |
333 | /* FALLTHROUGH */ | ||
334 | default: | ||
343 | omap_revision = TI8168_REV_ES1_1; | 335 | omap_revision = TI8168_REV_ES1_1; |
336 | *cpu_rev = "1.1"; | ||
344 | break; | 337 | break; |
345 | default: | ||
346 | omap_revision = TI8168_REV_ES1_1; | ||
347 | } | 338 | } |
348 | break; | 339 | break; |
349 | default: | 340 | default: |
350 | /* Unknown default to latest silicon rev as default*/ | 341 | /* Unknown default to latest silicon rev as default */ |
351 | omap_revision = OMAP3630_REV_ES1_2; | 342 | omap_revision = OMAP3630_REV_ES1_2; |
352 | omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; | 343 | *cpu_rev = "1.2"; |
344 | pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n"); | ||
353 | } | 345 | } |
354 | } | 346 | } |
355 | 347 | ||
@@ -382,24 +374,20 @@ static void __init omap4_check_revision(void) | |||
382 | switch (rev) { | 374 | switch (rev) { |
383 | case 0: | 375 | case 0: |
384 | omap_revision = OMAP4430_REV_ES1_0; | 376 | omap_revision = OMAP4430_REV_ES1_0; |
385 | omap_chip.oc |= CHIP_IS_OMAP4430ES1; | ||
386 | break; | 377 | break; |
387 | case 1: | 378 | case 1: |
388 | default: | 379 | default: |
389 | omap_revision = OMAP4430_REV_ES2_0; | 380 | omap_revision = OMAP4430_REV_ES2_0; |
390 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | ||
391 | } | 381 | } |
392 | break; | 382 | break; |
393 | case 0xb95c: | 383 | case 0xb95c: |
394 | switch (rev) { | 384 | switch (rev) { |
395 | case 3: | 385 | case 3: |
396 | omap_revision = OMAP4430_REV_ES2_1; | 386 | omap_revision = OMAP4430_REV_ES2_1; |
397 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_1; | ||
398 | break; | 387 | break; |
399 | case 4: | 388 | case 4: |
400 | default: | 389 | default: |
401 | omap_revision = OMAP4430_REV_ES2_2; | 390 | omap_revision = OMAP4430_REV_ES2_2; |
402 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_2; | ||
403 | } | 391 | } |
404 | break; | 392 | break; |
405 | case 0xb94e: | 393 | case 0xb94e: |
@@ -407,14 +395,12 @@ static void __init omap4_check_revision(void) | |||
407 | case 0: | 395 | case 0: |
408 | default: | 396 | default: |
409 | omap_revision = OMAP4460_REV_ES1_0; | 397 | omap_revision = OMAP4460_REV_ES1_0; |
410 | omap_chip.oc |= CHIP_IS_OMAP4460ES1_0; | ||
411 | break; | 398 | break; |
412 | } | 399 | } |
413 | break; | 400 | break; |
414 | default: | 401 | default: |
415 | /* Unknown default to latest silicon rev as default */ | 402 | /* Unknown default to latest silicon rev as default */ |
416 | omap_revision = OMAP4430_REV_ES2_2; | 403 | omap_revision = OMAP4430_REV_ES2_2; |
417 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_2; | ||
418 | } | 404 | } |
419 | 405 | ||
420 | pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, | 406 | pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, |
@@ -425,94 +411,33 @@ static void __init omap4_check_revision(void) | |||
425 | if (omap3_has_ ##feat()) \ | 411 | if (omap3_has_ ##feat()) \ |
426 | printk(#feat" "); | 412 | printk(#feat" "); |
427 | 413 | ||
428 | static void __init omap3_cpuinfo(void) | 414 | static void __init omap3_cpuinfo(const char *cpu_rev) |
429 | { | 415 | { |
430 | u8 rev = GET_OMAP_REVISION(); | 416 | const char *cpu_name; |
431 | char cpu_name[16], cpu_rev[16]; | ||
432 | 417 | ||
433 | /* OMAP3430 and OMAP3530 are assumed to be same. | 418 | /* |
419 | * OMAP3430 and OMAP3530 are assumed to be same. | ||
434 | * | 420 | * |
435 | * OMAP3525, OMAP3515 and OMAP3503 can be detected only based | 421 | * OMAP3525, OMAP3515 and OMAP3503 can be detected only based |
436 | * on available features. Upon detection, update the CPU id | 422 | * on available features. Upon detection, update the CPU id |
437 | * and CPU class bits. | 423 | * and CPU class bits. |
438 | */ | 424 | */ |
439 | if (cpu_is_omap3630()) { | 425 | if (cpu_is_omap3630()) { |
440 | strcpy(cpu_name, "OMAP3630"); | 426 | cpu_name = "OMAP3630"; |
441 | } else if (cpu_is_omap3505()) { | 427 | } else if (cpu_is_omap3517()) { |
442 | /* | 428 | /* AM35xx devices */ |
443 | * AM35xx devices | 429 | cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505"; |
444 | */ | ||
445 | if (omap3_has_sgx()) { | ||
446 | omap_revision = OMAP3517_REV(rev); | ||
447 | strcpy(cpu_name, "AM3517"); | ||
448 | } else { | ||
449 | /* Already set in omap3_check_revision() */ | ||
450 | strcpy(cpu_name, "AM3505"); | ||
451 | } | ||
452 | } else if (cpu_is_ti816x()) { | 430 | } else if (cpu_is_ti816x()) { |
453 | strcpy(cpu_name, "TI816X"); | 431 | cpu_name = "TI816X"; |
454 | } else if (omap3_has_iva() && omap3_has_sgx()) { | 432 | } else if (omap3_has_iva() && omap3_has_sgx()) { |
455 | /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ | 433 | /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ |
456 | strcpy(cpu_name, "OMAP3430/3530"); | 434 | cpu_name = "OMAP3430/3530"; |
457 | } else if (omap3_has_iva()) { | 435 | } else if (omap3_has_iva()) { |
458 | omap_revision = OMAP3525_REV(rev); | 436 | cpu_name = "OMAP3525"; |
459 | strcpy(cpu_name, "OMAP3525"); | ||
460 | } else if (omap3_has_sgx()) { | 437 | } else if (omap3_has_sgx()) { |
461 | omap_revision = OMAP3515_REV(rev); | 438 | cpu_name = "OMAP3515"; |
462 | strcpy(cpu_name, "OMAP3515"); | ||
463 | } else { | 439 | } else { |
464 | omap_revision = OMAP3503_REV(rev); | 440 | cpu_name = "OMAP3503"; |
465 | strcpy(cpu_name, "OMAP3503"); | ||
466 | } | ||
467 | |||
468 | if (cpu_is_omap3630() || cpu_is_ti816x()) { | ||
469 | switch (rev) { | ||
470 | case OMAP_REVBITS_00: | ||
471 | strcpy(cpu_rev, "1.0"); | ||
472 | break; | ||
473 | case OMAP_REVBITS_01: | ||
474 | strcpy(cpu_rev, "1.1"); | ||
475 | break; | ||
476 | case OMAP_REVBITS_02: | ||
477 | /* FALLTHROUGH */ | ||
478 | default: | ||
479 | /* Use the latest known revision as default */ | ||
480 | strcpy(cpu_rev, "1.2"); | ||
481 | } | ||
482 | } else if (cpu_is_omap3505() || cpu_is_omap3517()) { | ||
483 | switch (rev) { | ||
484 | case OMAP_REVBITS_00: | ||
485 | strcpy(cpu_rev, "1.0"); | ||
486 | break; | ||
487 | case OMAP_REVBITS_01: | ||
488 | /* FALLTHROUGH */ | ||
489 | default: | ||
490 | /* Use the latest known revision as default */ | ||
491 | strcpy(cpu_rev, "1.1"); | ||
492 | } | ||
493 | } else { | ||
494 | switch (rev) { | ||
495 | case OMAP_REVBITS_00: | ||
496 | strcpy(cpu_rev, "1.0"); | ||
497 | break; | ||
498 | case OMAP_REVBITS_01: | ||
499 | strcpy(cpu_rev, "2.0"); | ||
500 | break; | ||
501 | case OMAP_REVBITS_02: | ||
502 | strcpy(cpu_rev, "2.1"); | ||
503 | break; | ||
504 | case OMAP_REVBITS_03: | ||
505 | strcpy(cpu_rev, "3.0"); | ||
506 | break; | ||
507 | case OMAP_REVBITS_04: | ||
508 | strcpy(cpu_rev, "3.1"); | ||
509 | break; | ||
510 | case OMAP_REVBITS_05: | ||
511 | /* FALLTHROUGH */ | ||
512 | default: | ||
513 | /* Use the latest known revision as default */ | ||
514 | strcpy(cpu_rev, "3.1.2"); | ||
515 | } | ||
516 | } | 441 | } |
517 | 442 | ||
518 | /* Print verbose information */ | 443 | /* Print verbose information */ |
@@ -533,6 +458,8 @@ static void __init omap3_cpuinfo(void) | |||
533 | */ | 458 | */ |
534 | void __init omap2_check_revision(void) | 459 | void __init omap2_check_revision(void) |
535 | { | 460 | { |
461 | const char *cpu_rev; | ||
462 | |||
536 | /* | 463 | /* |
537 | * At this point we have an idea about the processor revision set | 464 | * At this point we have an idea about the processor revision set |
538 | * earlier with omap2_set_globals_tap(). | 465 | * earlier with omap2_set_globals_tap(). |
@@ -540,7 +467,7 @@ void __init omap2_check_revision(void) | |||
540 | if (cpu_is_omap24xx()) { | 467 | if (cpu_is_omap24xx()) { |
541 | omap24xx_check_revision(); | 468 | omap24xx_check_revision(); |
542 | } else if (cpu_is_omap34xx()) { | 469 | } else if (cpu_is_omap34xx()) { |
543 | omap3_check_revision(); | 470 | omap3_check_revision(&cpu_rev); |
544 | 471 | ||
545 | /* TI816X doesn't have feature register */ | 472 | /* TI816X doesn't have feature register */ |
546 | if (!cpu_is_ti816x()) | 473 | if (!cpu_is_ti816x()) |
@@ -548,7 +475,7 @@ void __init omap2_check_revision(void) | |||
548 | else | 475 | else |
549 | ti816x_check_features(); | 476 | ti816x_check_features(); |
550 | 477 | ||
551 | omap3_cpuinfo(); | 478 | omap3_cpuinfo(cpu_rev); |
552 | return; | 479 | return; |
553 | } else if (cpu_is_omap44xx()) { | 480 | } else if (cpu_is_omap44xx()) { |
554 | omap4_check_revision(); | 481 | omap4_check_revision(); |
@@ -557,22 +484,6 @@ void __init omap2_check_revision(void) | |||
557 | } else { | 484 | } else { |
558 | pr_err("OMAP revision unknown, please fix!\n"); | 485 | pr_err("OMAP revision unknown, please fix!\n"); |
559 | } | 486 | } |
560 | |||
561 | /* | ||
562 | * OK, now we know the exact revision. Initialize omap_chip bits | ||
563 | * for powerdowmain and clockdomain code. | ||
564 | */ | ||
565 | if (cpu_is_omap243x()) { | ||
566 | /* Currently only supports 2430ES2.1 and 2430-all */ | ||
567 | omap_chip.oc |= CHIP_IS_OMAP2430; | ||
568 | return; | ||
569 | } else if (cpu_is_omap242x()) { | ||
570 | /* Currently only supports 2420ES2.1.1 and 2420-all */ | ||
571 | omap_chip.oc |= CHIP_IS_OMAP2420; | ||
572 | return; | ||
573 | } | ||
574 | |||
575 | pr_err("Uninitialized omap_chip, please fix!\n"); | ||
576 | } | 487 | } |
577 | 488 | ||
578 | /* | 489 | /* |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 2ce1ce6fb4db..15f91c42be66 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "io.h" | 38 | #include "io.h" |
39 | 39 | ||
40 | #include <plat/omap-pm.h> | 40 | #include <plat/omap-pm.h> |
41 | #include "voltage.h" | ||
41 | #include "powerdomain.h" | 42 | #include "powerdomain.h" |
42 | 43 | ||
43 | #include "clockdomain.h" | 44 | #include "clockdomain.h" |
@@ -341,18 +342,22 @@ void __init omap2_init_common_infrastructure(void) | |||
341 | u8 postsetup_state; | 342 | u8 postsetup_state; |
342 | 343 | ||
343 | if (cpu_is_omap242x()) { | 344 | if (cpu_is_omap242x()) { |
344 | omap2xxx_powerdomains_init(); | 345 | omap2xxx_voltagedomains_init(); |
345 | omap2xxx_clockdomains_init(); | 346 | omap242x_powerdomains_init(); |
347 | omap242x_clockdomains_init(); | ||
346 | omap2420_hwmod_init(); | 348 | omap2420_hwmod_init(); |
347 | } else if (cpu_is_omap243x()) { | 349 | } else if (cpu_is_omap243x()) { |
348 | omap2xxx_powerdomains_init(); | 350 | omap2xxx_voltagedomains_init(); |
349 | omap2xxx_clockdomains_init(); | 351 | omap243x_powerdomains_init(); |
352 | omap243x_clockdomains_init(); | ||
350 | omap2430_hwmod_init(); | 353 | omap2430_hwmod_init(); |
351 | } else if (cpu_is_omap34xx()) { | 354 | } else if (cpu_is_omap34xx()) { |
355 | omap3xxx_voltagedomains_init(); | ||
352 | omap3xxx_powerdomains_init(); | 356 | omap3xxx_powerdomains_init(); |
353 | omap3xxx_clockdomains_init(); | 357 | omap3xxx_clockdomains_init(); |
354 | omap3xxx_hwmod_init(); | 358 | omap3xxx_hwmod_init(); |
355 | } else if (cpu_is_omap44xx()) { | 359 | } else if (cpu_is_omap44xx()) { |
360 | omap44xx_voltagedomains_init(); | ||
356 | omap44xx_powerdomains_init(); | 361 | omap44xx_powerdomains_init(); |
357 | omap44xx_clockdomains_init(); | 362 | omap44xx_clockdomains_init(); |
358 | omap44xx_hwmod_init(); | 363 | omap44xx_hwmod_init(); |
@@ -376,7 +381,7 @@ void __init omap2_init_common_infrastructure(void) | |||
376 | * omap_hwmod_late_init(), so boards that desire full watchdog | 381 | * omap_hwmod_late_init(), so boards that desire full watchdog |
377 | * coverage of kernel initialization can reprogram the | 382 | * coverage of kernel initialization can reprogram the |
378 | * postsetup_state between the calls to | 383 | * postsetup_state between the calls to |
379 | * omap2_init_common_infra() and omap2_init_common_devices(). | 384 | * omap2_init_common_infra() and omap_sdrc_init(). |
380 | * | 385 | * |
381 | * XXX ideally we could detect whether the MPU WDT was currently | 386 | * XXX ideally we could detect whether the MPU WDT was currently |
382 | * enabled here and make this conditional | 387 | * enabled here and make this conditional |
@@ -400,7 +405,47 @@ void __init omap2_init_common_infrastructure(void) | |||
400 | pr_err("Could not init clock framework - unknown SoC\n"); | 405 | pr_err("Could not init clock framework - unknown SoC\n"); |
401 | } | 406 | } |
402 | 407 | ||
403 | void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, | 408 | void __init omap2420_init_early(void) |
409 | { | ||
410 | omap2_init_common_infrastructure(); | ||
411 | } | ||
412 | |||
413 | void __init omap2430_init_early(void) | ||
414 | { | ||
415 | omap2_init_common_infrastructure(); | ||
416 | } | ||
417 | |||
418 | void __init omap3430_init_early(void) | ||
419 | { | ||
420 | omap2_init_common_infrastructure(); | ||
421 | } | ||
422 | |||
423 | void __init omap35xx_init_early(void) | ||
424 | { | ||
425 | omap2_init_common_infrastructure(); | ||
426 | } | ||
427 | |||
428 | void __init omap3630_init_early(void) | ||
429 | { | ||
430 | omap2_init_common_infrastructure(); | ||
431 | } | ||
432 | |||
433 | void __init am35xx_init_early(void) | ||
434 | { | ||
435 | omap2_init_common_infrastructure(); | ||
436 | } | ||
437 | |||
438 | void __init ti816x_init_early(void) | ||
439 | { | ||
440 | omap2_init_common_infrastructure(); | ||
441 | } | ||
442 | |||
443 | void __init omap4430_init_early(void) | ||
444 | { | ||
445 | omap2_init_common_infrastructure(); | ||
446 | } | ||
447 | |||
448 | void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | ||
404 | struct omap_sdrc_params *sdrc_cs1) | 449 | struct omap_sdrc_params *sdrc_cs1) |
405 | { | 450 | { |
406 | if (cpu_is_omap24xx() || omap3_has_sdrc()) { | 451 | if (cpu_is_omap24xx() || omap3_has_sdrc()) { |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 84cc0bdda3ae..d71380705080 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1954,9 +1954,6 @@ int __init omap_hwmod_register(struct omap_hwmod **ohs) | |||
1954 | 1954 | ||
1955 | i = 0; | 1955 | i = 0; |
1956 | do { | 1956 | do { |
1957 | if (!omap_chip_is(ohs[i]->omap_chip)) | ||
1958 | continue; | ||
1959 | |||
1960 | r = _register(ohs[i]); | 1957 | r = _register(ohs[i]); |
1961 | WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, | 1958 | WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, |
1962 | r); | 1959 | r); |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index a015c69068f6..b6ea69a5c2f8 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
@@ -100,7 +100,6 @@ static struct omap_hwmod omap2420_l3_main_hwmod = { | |||
100 | .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters), | 100 | .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters), |
101 | .slaves = omap2420_l3_main_slaves, | 101 | .slaves = omap2420_l3_main_slaves, |
102 | .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves), | 102 | .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves), |
103 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
104 | .flags = HWMOD_NO_IDLEST, | 103 | .flags = HWMOD_NO_IDLEST, |
105 | }; | 104 | }; |
106 | 105 | ||
@@ -206,7 +205,6 @@ static struct omap_hwmod omap2420_l4_core_hwmod = { | |||
206 | .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), | 205 | .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), |
207 | .slaves = omap2420_l4_core_slaves, | 206 | .slaves = omap2420_l4_core_slaves, |
208 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves), | 207 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves), |
209 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
210 | .flags = HWMOD_NO_IDLEST, | 208 | .flags = HWMOD_NO_IDLEST, |
211 | }; | 209 | }; |
212 | 210 | ||
@@ -227,7 +225,6 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod = { | |||
227 | .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), | 225 | .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), |
228 | .slaves = omap2420_l4_wkup_slaves, | 226 | .slaves = omap2420_l4_wkup_slaves, |
229 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves), | 227 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves), |
230 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
231 | .flags = HWMOD_NO_IDLEST, | 228 | .flags = HWMOD_NO_IDLEST, |
232 | }; | 229 | }; |
233 | 230 | ||
@@ -243,7 +240,6 @@ static struct omap_hwmod omap2420_mpu_hwmod = { | |||
243 | .main_clk = "mpu_ck", | 240 | .main_clk = "mpu_ck", |
244 | .masters = omap2420_mpu_masters, | 241 | .masters = omap2420_mpu_masters, |
245 | .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters), | 242 | .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters), |
246 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
247 | }; | 243 | }; |
248 | 244 | ||
249 | /* | 245 | /* |
@@ -271,7 +267,6 @@ static struct omap_hwmod omap2420_iva_hwmod = { | |||
271 | .class = &iva_hwmod_class, | 267 | .class = &iva_hwmod_class, |
272 | .masters = omap2420_iva_masters, | 268 | .masters = omap2420_iva_masters, |
273 | .masters_cnt = ARRAY_SIZE(omap2420_iva_masters), | 269 | .masters_cnt = ARRAY_SIZE(omap2420_iva_masters), |
274 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
275 | }; | 270 | }; |
276 | 271 | ||
277 | /* timer1 */ | 272 | /* timer1 */ |
@@ -317,7 +312,6 @@ static struct omap_hwmod omap2420_timer1_hwmod = { | |||
317 | .slaves = omap2420_timer1_slaves, | 312 | .slaves = omap2420_timer1_slaves, |
318 | .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves), | 313 | .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves), |
319 | .class = &omap2xxx_timer_hwmod_class, | 314 | .class = &omap2xxx_timer_hwmod_class, |
320 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
321 | }; | 315 | }; |
322 | 316 | ||
323 | /* timer2 */ | 317 | /* timer2 */ |
@@ -354,7 +348,6 @@ static struct omap_hwmod omap2420_timer2_hwmod = { | |||
354 | .slaves = omap2420_timer2_slaves, | 348 | .slaves = omap2420_timer2_slaves, |
355 | .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves), | 349 | .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves), |
356 | .class = &omap2xxx_timer_hwmod_class, | 350 | .class = &omap2xxx_timer_hwmod_class, |
357 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
358 | }; | 351 | }; |
359 | 352 | ||
360 | /* timer3 */ | 353 | /* timer3 */ |
@@ -391,7 +384,6 @@ static struct omap_hwmod omap2420_timer3_hwmod = { | |||
391 | .slaves = omap2420_timer3_slaves, | 384 | .slaves = omap2420_timer3_slaves, |
392 | .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves), | 385 | .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves), |
393 | .class = &omap2xxx_timer_hwmod_class, | 386 | .class = &omap2xxx_timer_hwmod_class, |
394 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
395 | }; | 387 | }; |
396 | 388 | ||
397 | /* timer4 */ | 389 | /* timer4 */ |
@@ -428,7 +420,6 @@ static struct omap_hwmod omap2420_timer4_hwmod = { | |||
428 | .slaves = omap2420_timer4_slaves, | 420 | .slaves = omap2420_timer4_slaves, |
429 | .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves), | 421 | .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves), |
430 | .class = &omap2xxx_timer_hwmod_class, | 422 | .class = &omap2xxx_timer_hwmod_class, |
431 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
432 | }; | 423 | }; |
433 | 424 | ||
434 | /* timer5 */ | 425 | /* timer5 */ |
@@ -465,7 +456,6 @@ static struct omap_hwmod omap2420_timer5_hwmod = { | |||
465 | .slaves = omap2420_timer5_slaves, | 456 | .slaves = omap2420_timer5_slaves, |
466 | .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves), | 457 | .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves), |
467 | .class = &omap2xxx_timer_hwmod_class, | 458 | .class = &omap2xxx_timer_hwmod_class, |
468 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
469 | }; | 459 | }; |
470 | 460 | ||
471 | 461 | ||
@@ -503,7 +493,6 @@ static struct omap_hwmod omap2420_timer6_hwmod = { | |||
503 | .slaves = omap2420_timer6_slaves, | 493 | .slaves = omap2420_timer6_slaves, |
504 | .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves), | 494 | .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves), |
505 | .class = &omap2xxx_timer_hwmod_class, | 495 | .class = &omap2xxx_timer_hwmod_class, |
506 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
507 | }; | 496 | }; |
508 | 497 | ||
509 | /* timer7 */ | 498 | /* timer7 */ |
@@ -540,7 +529,6 @@ static struct omap_hwmod omap2420_timer7_hwmod = { | |||
540 | .slaves = omap2420_timer7_slaves, | 529 | .slaves = omap2420_timer7_slaves, |
541 | .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves), | 530 | .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves), |
542 | .class = &omap2xxx_timer_hwmod_class, | 531 | .class = &omap2xxx_timer_hwmod_class, |
543 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
544 | }; | 532 | }; |
545 | 533 | ||
546 | /* timer8 */ | 534 | /* timer8 */ |
@@ -577,7 +565,6 @@ static struct omap_hwmod omap2420_timer8_hwmod = { | |||
577 | .slaves = omap2420_timer8_slaves, | 565 | .slaves = omap2420_timer8_slaves, |
578 | .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves), | 566 | .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves), |
579 | .class = &omap2xxx_timer_hwmod_class, | 567 | .class = &omap2xxx_timer_hwmod_class, |
580 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
581 | }; | 568 | }; |
582 | 569 | ||
583 | /* timer9 */ | 570 | /* timer9 */ |
@@ -614,7 +601,6 @@ static struct omap_hwmod omap2420_timer9_hwmod = { | |||
614 | .slaves = omap2420_timer9_slaves, | 601 | .slaves = omap2420_timer9_slaves, |
615 | .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves), | 602 | .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves), |
616 | .class = &omap2xxx_timer_hwmod_class, | 603 | .class = &omap2xxx_timer_hwmod_class, |
617 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
618 | }; | 604 | }; |
619 | 605 | ||
620 | /* timer10 */ | 606 | /* timer10 */ |
@@ -651,7 +637,6 @@ static struct omap_hwmod omap2420_timer10_hwmod = { | |||
651 | .slaves = omap2420_timer10_slaves, | 637 | .slaves = omap2420_timer10_slaves, |
652 | .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves), | 638 | .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves), |
653 | .class = &omap2xxx_timer_hwmod_class, | 639 | .class = &omap2xxx_timer_hwmod_class, |
654 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
655 | }; | 640 | }; |
656 | 641 | ||
657 | /* timer11 */ | 642 | /* timer11 */ |
@@ -688,7 +673,6 @@ static struct omap_hwmod omap2420_timer11_hwmod = { | |||
688 | .slaves = omap2420_timer11_slaves, | 673 | .slaves = omap2420_timer11_slaves, |
689 | .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves), | 674 | .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves), |
690 | .class = &omap2xxx_timer_hwmod_class, | 675 | .class = &omap2xxx_timer_hwmod_class, |
691 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
692 | }; | 676 | }; |
693 | 677 | ||
694 | /* timer12 */ | 678 | /* timer12 */ |
@@ -725,7 +709,6 @@ static struct omap_hwmod omap2420_timer12_hwmod = { | |||
725 | .slaves = omap2420_timer12_slaves, | 709 | .slaves = omap2420_timer12_slaves, |
726 | .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves), | 710 | .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves), |
727 | .class = &omap2xxx_timer_hwmod_class, | 711 | .class = &omap2xxx_timer_hwmod_class, |
728 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
729 | }; | 712 | }; |
730 | 713 | ||
731 | /* l4_wkup -> wd_timer2 */ | 714 | /* l4_wkup -> wd_timer2 */ |
@@ -766,7 +749,6 @@ static struct omap_hwmod omap2420_wd_timer2_hwmod = { | |||
766 | }, | 749 | }, |
767 | .slaves = omap2420_wd_timer2_slaves, | 750 | .slaves = omap2420_wd_timer2_slaves, |
768 | .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves), | 751 | .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves), |
769 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
770 | }; | 752 | }; |
771 | 753 | ||
772 | /* UART1 */ | 754 | /* UART1 */ |
@@ -792,7 +774,6 @@ static struct omap_hwmod omap2420_uart1_hwmod = { | |||
792 | .slaves = omap2420_uart1_slaves, | 774 | .slaves = omap2420_uart1_slaves, |
793 | .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves), | 775 | .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves), |
794 | .class = &omap2_uart_class, | 776 | .class = &omap2_uart_class, |
795 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
796 | }; | 777 | }; |
797 | 778 | ||
798 | /* UART2 */ | 779 | /* UART2 */ |
@@ -818,7 +799,6 @@ static struct omap_hwmod omap2420_uart2_hwmod = { | |||
818 | .slaves = omap2420_uart2_slaves, | 799 | .slaves = omap2420_uart2_slaves, |
819 | .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves), | 800 | .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves), |
820 | .class = &omap2_uart_class, | 801 | .class = &omap2_uart_class, |
821 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
822 | }; | 802 | }; |
823 | 803 | ||
824 | /* UART3 */ | 804 | /* UART3 */ |
@@ -844,7 +824,6 @@ static struct omap_hwmod omap2420_uart3_hwmod = { | |||
844 | .slaves = omap2420_uart3_slaves, | 824 | .slaves = omap2420_uart3_slaves, |
845 | .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves), | 825 | .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves), |
846 | .class = &omap2_uart_class, | 826 | .class = &omap2_uart_class, |
847 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
848 | }; | 827 | }; |
849 | 828 | ||
850 | /* dss */ | 829 | /* dss */ |
@@ -898,7 +877,6 @@ static struct omap_hwmod omap2420_dss_core_hwmod = { | |||
898 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves), | 877 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves), |
899 | .masters = omap2420_dss_masters, | 878 | .masters = omap2420_dss_masters, |
900 | .masters_cnt = ARRAY_SIZE(omap2420_dss_masters), | 879 | .masters_cnt = ARRAY_SIZE(omap2420_dss_masters), |
901 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
902 | .flags = HWMOD_NO_IDLEST, | 880 | .flags = HWMOD_NO_IDLEST, |
903 | }; | 881 | }; |
904 | 882 | ||
@@ -938,7 +916,6 @@ static struct omap_hwmod omap2420_dss_dispc_hwmod = { | |||
938 | }, | 916 | }, |
939 | .slaves = omap2420_dss_dispc_slaves, | 917 | .slaves = omap2420_dss_dispc_slaves, |
940 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves), | 918 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves), |
941 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
942 | .flags = HWMOD_NO_IDLEST, | 919 | .flags = HWMOD_NO_IDLEST, |
943 | }; | 920 | }; |
944 | 921 | ||
@@ -975,7 +952,6 @@ static struct omap_hwmod omap2420_dss_rfbi_hwmod = { | |||
975 | }, | 952 | }, |
976 | .slaves = omap2420_dss_rfbi_slaves, | 953 | .slaves = omap2420_dss_rfbi_slaves, |
977 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves), | 954 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves), |
978 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
979 | .flags = HWMOD_NO_IDLEST, | 955 | .flags = HWMOD_NO_IDLEST, |
980 | }; | 956 | }; |
981 | 957 | ||
@@ -1013,7 +989,6 @@ static struct omap_hwmod omap2420_dss_venc_hwmod = { | |||
1013 | }, | 989 | }, |
1014 | .slaves = omap2420_dss_venc_slaves, | 990 | .slaves = omap2420_dss_venc_slaves, |
1015 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves), | 991 | .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves), |
1016 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1017 | .flags = HWMOD_NO_IDLEST, | 992 | .flags = HWMOD_NO_IDLEST, |
1018 | }; | 993 | }; |
1019 | 994 | ||
@@ -1064,7 +1039,6 @@ static struct omap_hwmod omap2420_i2c1_hwmod = { | |||
1064 | .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves), | 1039 | .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves), |
1065 | .class = &i2c_class, | 1040 | .class = &i2c_class, |
1066 | .dev_attr = &i2c_dev_attr, | 1041 | .dev_attr = &i2c_dev_attr, |
1067 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1068 | .flags = HWMOD_16BIT_REG, | 1042 | .flags = HWMOD_16BIT_REG, |
1069 | }; | 1043 | }; |
1070 | 1044 | ||
@@ -1092,7 +1066,6 @@ static struct omap_hwmod omap2420_i2c2_hwmod = { | |||
1092 | .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves), | 1066 | .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves), |
1093 | .class = &i2c_class, | 1067 | .class = &i2c_class, |
1094 | .dev_attr = &i2c_dev_attr, | 1068 | .dev_attr = &i2c_dev_attr, |
1095 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1096 | .flags = HWMOD_16BIT_REG, | 1069 | .flags = HWMOD_16BIT_REG, |
1097 | }; | 1070 | }; |
1098 | 1071 | ||
@@ -1197,7 +1170,6 @@ static struct omap_hwmod omap2420_gpio1_hwmod = { | |||
1197 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves), | 1170 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves), |
1198 | .class = &omap2xxx_gpio_hwmod_class, | 1171 | .class = &omap2xxx_gpio_hwmod_class, |
1199 | .dev_attr = &gpio_dev_attr, | 1172 | .dev_attr = &gpio_dev_attr, |
1200 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1201 | }; | 1173 | }; |
1202 | 1174 | ||
1203 | /* gpio2 */ | 1175 | /* gpio2 */ |
@@ -1223,7 +1195,6 @@ static struct omap_hwmod omap2420_gpio2_hwmod = { | |||
1223 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves), | 1195 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves), |
1224 | .class = &omap2xxx_gpio_hwmod_class, | 1196 | .class = &omap2xxx_gpio_hwmod_class, |
1225 | .dev_attr = &gpio_dev_attr, | 1197 | .dev_attr = &gpio_dev_attr, |
1226 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1227 | }; | 1198 | }; |
1228 | 1199 | ||
1229 | /* gpio3 */ | 1200 | /* gpio3 */ |
@@ -1249,7 +1220,6 @@ static struct omap_hwmod omap2420_gpio3_hwmod = { | |||
1249 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves), | 1220 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves), |
1250 | .class = &omap2xxx_gpio_hwmod_class, | 1221 | .class = &omap2xxx_gpio_hwmod_class, |
1251 | .dev_attr = &gpio_dev_attr, | 1222 | .dev_attr = &gpio_dev_attr, |
1252 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1253 | }; | 1223 | }; |
1254 | 1224 | ||
1255 | /* gpio4 */ | 1225 | /* gpio4 */ |
@@ -1275,7 +1245,6 @@ static struct omap_hwmod omap2420_gpio4_hwmod = { | |||
1275 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves), | 1245 | .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves), |
1276 | .class = &omap2xxx_gpio_hwmod_class, | 1246 | .class = &omap2xxx_gpio_hwmod_class, |
1277 | .dev_attr = &gpio_dev_attr, | 1247 | .dev_attr = &gpio_dev_attr, |
1278 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1279 | }; | 1248 | }; |
1280 | 1249 | ||
1281 | /* dma attributes */ | 1250 | /* dma attributes */ |
@@ -1322,7 +1291,6 @@ static struct omap_hwmod omap2420_dma_system_hwmod = { | |||
1322 | .masters = omap2420_dma_system_masters, | 1291 | .masters = omap2420_dma_system_masters, |
1323 | .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters), | 1292 | .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters), |
1324 | .dev_attr = &dma_dev_attr, | 1293 | .dev_attr = &dma_dev_attr, |
1325 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1326 | .flags = HWMOD_NO_IDLEST, | 1294 | .flags = HWMOD_NO_IDLEST, |
1327 | }; | 1295 | }; |
1328 | 1296 | ||
@@ -1363,7 +1331,6 @@ static struct omap_hwmod omap2420_mailbox_hwmod = { | |||
1363 | }, | 1331 | }, |
1364 | .slaves = omap2420_mailbox_slaves, | 1332 | .slaves = omap2420_mailbox_slaves, |
1365 | .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves), | 1333 | .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves), |
1366 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1367 | }; | 1334 | }; |
1368 | 1335 | ||
1369 | /* mcspi1 */ | 1336 | /* mcspi1 */ |
@@ -1393,7 +1360,6 @@ static struct omap_hwmod omap2420_mcspi1_hwmod = { | |||
1393 | .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves), | 1360 | .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves), |
1394 | .class = &omap2xxx_mcspi_class, | 1361 | .class = &omap2xxx_mcspi_class, |
1395 | .dev_attr = &omap_mcspi1_dev_attr, | 1362 | .dev_attr = &omap_mcspi1_dev_attr, |
1396 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1397 | }; | 1363 | }; |
1398 | 1364 | ||
1399 | /* mcspi2 */ | 1365 | /* mcspi2 */ |
@@ -1423,7 +1389,6 @@ static struct omap_hwmod omap2420_mcspi2_hwmod = { | |||
1423 | .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves), | 1389 | .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves), |
1424 | .class = &omap2xxx_mcspi_class, | 1390 | .class = &omap2xxx_mcspi_class, |
1425 | .dev_attr = &omap_mcspi2_dev_attr, | 1391 | .dev_attr = &omap_mcspi2_dev_attr, |
1426 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1427 | }; | 1392 | }; |
1428 | 1393 | ||
1429 | /* | 1394 | /* |
@@ -1473,7 +1438,6 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = { | |||
1473 | }, | 1438 | }, |
1474 | .slaves = omap2420_mcbsp1_slaves, | 1439 | .slaves = omap2420_mcbsp1_slaves, |
1475 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves), | 1440 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves), |
1476 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1477 | }; | 1441 | }; |
1478 | 1442 | ||
1479 | /* mcbsp2 */ | 1443 | /* mcbsp2 */ |
@@ -1514,7 +1478,6 @@ static struct omap_hwmod omap2420_mcbsp2_hwmod = { | |||
1514 | }, | 1478 | }, |
1515 | .slaves = omap2420_mcbsp2_slaves, | 1479 | .slaves = omap2420_mcbsp2_slaves, |
1516 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves), | 1480 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves), |
1517 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
1518 | }; | 1481 | }; |
1519 | 1482 | ||
1520 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { | 1483 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 16743c7d6e8e..56de8d616313 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -110,7 +110,6 @@ static struct omap_hwmod omap2430_l3_main_hwmod = { | |||
110 | .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters), | 110 | .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters), |
111 | .slaves = omap2430_l3_main_slaves, | 111 | .slaves = omap2430_l3_main_slaves, |
112 | .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves), | 112 | .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves), |
113 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
114 | .flags = HWMOD_NO_IDLEST, | 113 | .flags = HWMOD_NO_IDLEST, |
115 | }; | 114 | }; |
116 | 115 | ||
@@ -192,6 +191,7 @@ static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = { | |||
192 | .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, | 191 | .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, |
193 | .flags = ADDR_TYPE_RT | 192 | .flags = ADDR_TYPE_RT |
194 | }, | 193 | }, |
194 | { } | ||
195 | }; | 195 | }; |
196 | 196 | ||
197 | /* l4_core ->usbhsotg interface */ | 197 | /* l4_core ->usbhsotg interface */ |
@@ -249,7 +249,6 @@ static struct omap_hwmod omap2430_l4_core_hwmod = { | |||
249 | .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), | 249 | .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), |
250 | .slaves = omap2430_l4_core_slaves, | 250 | .slaves = omap2430_l4_core_slaves, |
251 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves), | 251 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves), |
252 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
253 | .flags = HWMOD_NO_IDLEST, | 252 | .flags = HWMOD_NO_IDLEST, |
254 | }; | 253 | }; |
255 | 254 | ||
@@ -300,7 +299,6 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod = { | |||
300 | .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), | 299 | .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), |
301 | .slaves = omap2430_l4_wkup_slaves, | 300 | .slaves = omap2430_l4_wkup_slaves, |
302 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves), | 301 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves), |
303 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
304 | .flags = HWMOD_NO_IDLEST, | 302 | .flags = HWMOD_NO_IDLEST, |
305 | }; | 303 | }; |
306 | 304 | ||
@@ -316,7 +314,6 @@ static struct omap_hwmod omap2430_mpu_hwmod = { | |||
316 | .main_clk = "mpu_ck", | 314 | .main_clk = "mpu_ck", |
317 | .masters = omap2430_mpu_masters, | 315 | .masters = omap2430_mpu_masters, |
318 | .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters), | 316 | .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters), |
319 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
320 | }; | 317 | }; |
321 | 318 | ||
322 | /* | 319 | /* |
@@ -344,7 +341,6 @@ static struct omap_hwmod omap2430_iva_hwmod = { | |||
344 | .class = &iva_hwmod_class, | 341 | .class = &iva_hwmod_class, |
345 | .masters = omap2430_iva_masters, | 342 | .masters = omap2430_iva_masters, |
346 | .masters_cnt = ARRAY_SIZE(omap2430_iva_masters), | 343 | .masters_cnt = ARRAY_SIZE(omap2430_iva_masters), |
347 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
348 | }; | 344 | }; |
349 | 345 | ||
350 | /* timer1 */ | 346 | /* timer1 */ |
@@ -390,7 +386,6 @@ static struct omap_hwmod omap2430_timer1_hwmod = { | |||
390 | .slaves = omap2430_timer1_slaves, | 386 | .slaves = omap2430_timer1_slaves, |
391 | .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves), | 387 | .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves), |
392 | .class = &omap2xxx_timer_hwmod_class, | 388 | .class = &omap2xxx_timer_hwmod_class, |
393 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
394 | }; | 389 | }; |
395 | 390 | ||
396 | /* timer2 */ | 391 | /* timer2 */ |
@@ -427,7 +422,6 @@ static struct omap_hwmod omap2430_timer2_hwmod = { | |||
427 | .slaves = omap2430_timer2_slaves, | 422 | .slaves = omap2430_timer2_slaves, |
428 | .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves), | 423 | .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves), |
429 | .class = &omap2xxx_timer_hwmod_class, | 424 | .class = &omap2xxx_timer_hwmod_class, |
430 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
431 | }; | 425 | }; |
432 | 426 | ||
433 | /* timer3 */ | 427 | /* timer3 */ |
@@ -464,7 +458,6 @@ static struct omap_hwmod omap2430_timer3_hwmod = { | |||
464 | .slaves = omap2430_timer3_slaves, | 458 | .slaves = omap2430_timer3_slaves, |
465 | .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves), | 459 | .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves), |
466 | .class = &omap2xxx_timer_hwmod_class, | 460 | .class = &omap2xxx_timer_hwmod_class, |
467 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
468 | }; | 461 | }; |
469 | 462 | ||
470 | /* timer4 */ | 463 | /* timer4 */ |
@@ -501,7 +494,6 @@ static struct omap_hwmod omap2430_timer4_hwmod = { | |||
501 | .slaves = omap2430_timer4_slaves, | 494 | .slaves = omap2430_timer4_slaves, |
502 | .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves), | 495 | .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves), |
503 | .class = &omap2xxx_timer_hwmod_class, | 496 | .class = &omap2xxx_timer_hwmod_class, |
504 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
505 | }; | 497 | }; |
506 | 498 | ||
507 | /* timer5 */ | 499 | /* timer5 */ |
@@ -538,7 +530,6 @@ static struct omap_hwmod omap2430_timer5_hwmod = { | |||
538 | .slaves = omap2430_timer5_slaves, | 530 | .slaves = omap2430_timer5_slaves, |
539 | .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves), | 531 | .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves), |
540 | .class = &omap2xxx_timer_hwmod_class, | 532 | .class = &omap2xxx_timer_hwmod_class, |
541 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
542 | }; | 533 | }; |
543 | 534 | ||
544 | /* timer6 */ | 535 | /* timer6 */ |
@@ -575,7 +566,6 @@ static struct omap_hwmod omap2430_timer6_hwmod = { | |||
575 | .slaves = omap2430_timer6_slaves, | 566 | .slaves = omap2430_timer6_slaves, |
576 | .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves), | 567 | .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves), |
577 | .class = &omap2xxx_timer_hwmod_class, | 568 | .class = &omap2xxx_timer_hwmod_class, |
578 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
579 | }; | 569 | }; |
580 | 570 | ||
581 | /* timer7 */ | 571 | /* timer7 */ |
@@ -612,7 +602,6 @@ static struct omap_hwmod omap2430_timer7_hwmod = { | |||
612 | .slaves = omap2430_timer7_slaves, | 602 | .slaves = omap2430_timer7_slaves, |
613 | .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves), | 603 | .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves), |
614 | .class = &omap2xxx_timer_hwmod_class, | 604 | .class = &omap2xxx_timer_hwmod_class, |
615 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
616 | }; | 605 | }; |
617 | 606 | ||
618 | /* timer8 */ | 607 | /* timer8 */ |
@@ -649,7 +638,6 @@ static struct omap_hwmod omap2430_timer8_hwmod = { | |||
649 | .slaves = omap2430_timer8_slaves, | 638 | .slaves = omap2430_timer8_slaves, |
650 | .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves), | 639 | .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves), |
651 | .class = &omap2xxx_timer_hwmod_class, | 640 | .class = &omap2xxx_timer_hwmod_class, |
652 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
653 | }; | 641 | }; |
654 | 642 | ||
655 | /* timer9 */ | 643 | /* timer9 */ |
@@ -686,7 +674,6 @@ static struct omap_hwmod omap2430_timer9_hwmod = { | |||
686 | .slaves = omap2430_timer9_slaves, | 674 | .slaves = omap2430_timer9_slaves, |
687 | .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves), | 675 | .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves), |
688 | .class = &omap2xxx_timer_hwmod_class, | 676 | .class = &omap2xxx_timer_hwmod_class, |
689 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
690 | }; | 677 | }; |
691 | 678 | ||
692 | /* timer10 */ | 679 | /* timer10 */ |
@@ -723,7 +710,6 @@ static struct omap_hwmod omap2430_timer10_hwmod = { | |||
723 | .slaves = omap2430_timer10_slaves, | 710 | .slaves = omap2430_timer10_slaves, |
724 | .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves), | 711 | .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves), |
725 | .class = &omap2xxx_timer_hwmod_class, | 712 | .class = &omap2xxx_timer_hwmod_class, |
726 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
727 | }; | 713 | }; |
728 | 714 | ||
729 | /* timer11 */ | 715 | /* timer11 */ |
@@ -760,7 +746,6 @@ static struct omap_hwmod omap2430_timer11_hwmod = { | |||
760 | .slaves = omap2430_timer11_slaves, | 746 | .slaves = omap2430_timer11_slaves, |
761 | .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves), | 747 | .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves), |
762 | .class = &omap2xxx_timer_hwmod_class, | 748 | .class = &omap2xxx_timer_hwmod_class, |
763 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
764 | }; | 749 | }; |
765 | 750 | ||
766 | /* timer12 */ | 751 | /* timer12 */ |
@@ -797,7 +782,6 @@ static struct omap_hwmod omap2430_timer12_hwmod = { | |||
797 | .slaves = omap2430_timer12_slaves, | 782 | .slaves = omap2430_timer12_slaves, |
798 | .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves), | 783 | .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves), |
799 | .class = &omap2xxx_timer_hwmod_class, | 784 | .class = &omap2xxx_timer_hwmod_class, |
800 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
801 | }; | 785 | }; |
802 | 786 | ||
803 | /* l4_wkup -> wd_timer2 */ | 787 | /* l4_wkup -> wd_timer2 */ |
@@ -838,7 +822,6 @@ static struct omap_hwmod omap2430_wd_timer2_hwmod = { | |||
838 | }, | 822 | }, |
839 | .slaves = omap2430_wd_timer2_slaves, | 823 | .slaves = omap2430_wd_timer2_slaves, |
840 | .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves), | 824 | .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves), |
841 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
842 | }; | 825 | }; |
843 | 826 | ||
844 | /* UART1 */ | 827 | /* UART1 */ |
@@ -864,7 +847,6 @@ static struct omap_hwmod omap2430_uart1_hwmod = { | |||
864 | .slaves = omap2430_uart1_slaves, | 847 | .slaves = omap2430_uart1_slaves, |
865 | .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves), | 848 | .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves), |
866 | .class = &omap2_uart_class, | 849 | .class = &omap2_uart_class, |
867 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
868 | }; | 850 | }; |
869 | 851 | ||
870 | /* UART2 */ | 852 | /* UART2 */ |
@@ -890,7 +872,6 @@ static struct omap_hwmod omap2430_uart2_hwmod = { | |||
890 | .slaves = omap2430_uart2_slaves, | 872 | .slaves = omap2430_uart2_slaves, |
891 | .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves), | 873 | .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves), |
892 | .class = &omap2_uart_class, | 874 | .class = &omap2_uart_class, |
893 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
894 | }; | 875 | }; |
895 | 876 | ||
896 | /* UART3 */ | 877 | /* UART3 */ |
@@ -916,7 +897,6 @@ static struct omap_hwmod omap2430_uart3_hwmod = { | |||
916 | .slaves = omap2430_uart3_slaves, | 897 | .slaves = omap2430_uart3_slaves, |
917 | .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves), | 898 | .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves), |
918 | .class = &omap2_uart_class, | 899 | .class = &omap2_uart_class, |
919 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
920 | }; | 900 | }; |
921 | 901 | ||
922 | /* dss */ | 902 | /* dss */ |
@@ -964,7 +944,6 @@ static struct omap_hwmod omap2430_dss_core_hwmod = { | |||
964 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves), | 944 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves), |
965 | .masters = omap2430_dss_masters, | 945 | .masters = omap2430_dss_masters, |
966 | .masters_cnt = ARRAY_SIZE(omap2430_dss_masters), | 946 | .masters_cnt = ARRAY_SIZE(omap2430_dss_masters), |
967 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
968 | .flags = HWMOD_NO_IDLEST, | 947 | .flags = HWMOD_NO_IDLEST, |
969 | }; | 948 | }; |
970 | 949 | ||
@@ -998,7 +977,6 @@ static struct omap_hwmod omap2430_dss_dispc_hwmod = { | |||
998 | }, | 977 | }, |
999 | .slaves = omap2430_dss_dispc_slaves, | 978 | .slaves = omap2430_dss_dispc_slaves, |
1000 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves), | 979 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves), |
1001 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1002 | .flags = HWMOD_NO_IDLEST, | 980 | .flags = HWMOD_NO_IDLEST, |
1003 | }; | 981 | }; |
1004 | 982 | ||
@@ -1029,7 +1007,6 @@ static struct omap_hwmod omap2430_dss_rfbi_hwmod = { | |||
1029 | }, | 1007 | }, |
1030 | .slaves = omap2430_dss_rfbi_slaves, | 1008 | .slaves = omap2430_dss_rfbi_slaves, |
1031 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves), | 1009 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves), |
1032 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1033 | .flags = HWMOD_NO_IDLEST, | 1010 | .flags = HWMOD_NO_IDLEST, |
1034 | }; | 1011 | }; |
1035 | 1012 | ||
@@ -1061,7 +1038,6 @@ static struct omap_hwmod omap2430_dss_venc_hwmod = { | |||
1061 | }, | 1038 | }, |
1062 | .slaves = omap2430_dss_venc_slaves, | 1039 | .slaves = omap2430_dss_venc_slaves, |
1063 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves), | 1040 | .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves), |
1064 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1065 | .flags = HWMOD_NO_IDLEST, | 1041 | .flags = HWMOD_NO_IDLEST, |
1066 | }; | 1042 | }; |
1067 | 1043 | ||
@@ -1122,7 +1098,6 @@ static struct omap_hwmod omap2430_i2c1_hwmod = { | |||
1122 | .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves), | 1098 | .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves), |
1123 | .class = &i2c_class, | 1099 | .class = &i2c_class, |
1124 | .dev_attr = &i2c_dev_attr, | 1100 | .dev_attr = &i2c_dev_attr, |
1125 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1126 | }; | 1101 | }; |
1127 | 1102 | ||
1128 | /* I2C2 */ | 1103 | /* I2C2 */ |
@@ -1150,7 +1125,6 @@ static struct omap_hwmod omap2430_i2c2_hwmod = { | |||
1150 | .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves), | 1125 | .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves), |
1151 | .class = &i2c_class, | 1126 | .class = &i2c_class, |
1152 | .dev_attr = &i2c_dev_attr, | 1127 | .dev_attr = &i2c_dev_attr, |
1153 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1154 | }; | 1128 | }; |
1155 | 1129 | ||
1156 | /* l4_wkup -> gpio1 */ | 1130 | /* l4_wkup -> gpio1 */ |
@@ -1272,7 +1246,6 @@ static struct omap_hwmod omap2430_gpio1_hwmod = { | |||
1272 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves), | 1246 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves), |
1273 | .class = &omap2xxx_gpio_hwmod_class, | 1247 | .class = &omap2xxx_gpio_hwmod_class, |
1274 | .dev_attr = &gpio_dev_attr, | 1248 | .dev_attr = &gpio_dev_attr, |
1275 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1276 | }; | 1249 | }; |
1277 | 1250 | ||
1278 | /* gpio2 */ | 1251 | /* gpio2 */ |
@@ -1298,7 +1271,6 @@ static struct omap_hwmod omap2430_gpio2_hwmod = { | |||
1298 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves), | 1271 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves), |
1299 | .class = &omap2xxx_gpio_hwmod_class, | 1272 | .class = &omap2xxx_gpio_hwmod_class, |
1300 | .dev_attr = &gpio_dev_attr, | 1273 | .dev_attr = &gpio_dev_attr, |
1301 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1302 | }; | 1274 | }; |
1303 | 1275 | ||
1304 | /* gpio3 */ | 1276 | /* gpio3 */ |
@@ -1324,7 +1296,6 @@ static struct omap_hwmod omap2430_gpio3_hwmod = { | |||
1324 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves), | 1296 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves), |
1325 | .class = &omap2xxx_gpio_hwmod_class, | 1297 | .class = &omap2xxx_gpio_hwmod_class, |
1326 | .dev_attr = &gpio_dev_attr, | 1298 | .dev_attr = &gpio_dev_attr, |
1327 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1328 | }; | 1299 | }; |
1329 | 1300 | ||
1330 | /* gpio4 */ | 1301 | /* gpio4 */ |
@@ -1350,7 +1321,6 @@ static struct omap_hwmod omap2430_gpio4_hwmod = { | |||
1350 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves), | 1321 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves), |
1351 | .class = &omap2xxx_gpio_hwmod_class, | 1322 | .class = &omap2xxx_gpio_hwmod_class, |
1352 | .dev_attr = &gpio_dev_attr, | 1323 | .dev_attr = &gpio_dev_attr, |
1353 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1354 | }; | 1324 | }; |
1355 | 1325 | ||
1356 | /* gpio5 */ | 1326 | /* gpio5 */ |
@@ -1381,7 +1351,6 @@ static struct omap_hwmod omap2430_gpio5_hwmod = { | |||
1381 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves), | 1351 | .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves), |
1382 | .class = &omap2xxx_gpio_hwmod_class, | 1352 | .class = &omap2xxx_gpio_hwmod_class, |
1383 | .dev_attr = &gpio_dev_attr, | 1353 | .dev_attr = &gpio_dev_attr, |
1384 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1385 | }; | 1354 | }; |
1386 | 1355 | ||
1387 | /* dma attributes */ | 1356 | /* dma attributes */ |
@@ -1428,7 +1397,6 @@ static struct omap_hwmod omap2430_dma_system_hwmod = { | |||
1428 | .masters = omap2430_dma_system_masters, | 1397 | .masters = omap2430_dma_system_masters, |
1429 | .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters), | 1398 | .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters), |
1430 | .dev_attr = &dma_dev_attr, | 1399 | .dev_attr = &dma_dev_attr, |
1431 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1432 | .flags = HWMOD_NO_IDLEST, | 1400 | .flags = HWMOD_NO_IDLEST, |
1433 | }; | 1401 | }; |
1434 | 1402 | ||
@@ -1468,7 +1436,6 @@ static struct omap_hwmod omap2430_mailbox_hwmod = { | |||
1468 | }, | 1436 | }, |
1469 | .slaves = omap2430_mailbox_slaves, | 1437 | .slaves = omap2430_mailbox_slaves, |
1470 | .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves), | 1438 | .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves), |
1471 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1472 | }; | 1439 | }; |
1473 | 1440 | ||
1474 | /* mcspi1 */ | 1441 | /* mcspi1 */ |
@@ -1498,7 +1465,6 @@ static struct omap_hwmod omap2430_mcspi1_hwmod = { | |||
1498 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves), | 1465 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves), |
1499 | .class = &omap2xxx_mcspi_class, | 1466 | .class = &omap2xxx_mcspi_class, |
1500 | .dev_attr = &omap_mcspi1_dev_attr, | 1467 | .dev_attr = &omap_mcspi1_dev_attr, |
1501 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1502 | }; | 1468 | }; |
1503 | 1469 | ||
1504 | /* mcspi2 */ | 1470 | /* mcspi2 */ |
@@ -1528,7 +1494,6 @@ static struct omap_hwmod omap2430_mcspi2_hwmod = { | |||
1528 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves), | 1494 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves), |
1529 | .class = &omap2xxx_mcspi_class, | 1495 | .class = &omap2xxx_mcspi_class, |
1530 | .dev_attr = &omap_mcspi2_dev_attr, | 1496 | .dev_attr = &omap_mcspi2_dev_attr, |
1531 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1532 | }; | 1497 | }; |
1533 | 1498 | ||
1534 | /* mcspi3 */ | 1499 | /* mcspi3 */ |
@@ -1571,7 +1536,6 @@ static struct omap_hwmod omap2430_mcspi3_hwmod = { | |||
1571 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves), | 1536 | .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves), |
1572 | .class = &omap2xxx_mcspi_class, | 1537 | .class = &omap2xxx_mcspi_class, |
1573 | .dev_attr = &omap_mcspi3_dev_attr, | 1538 | .dev_attr = &omap_mcspi3_dev_attr, |
1574 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1575 | }; | 1539 | }; |
1576 | 1540 | ||
1577 | /* | 1541 | /* |
@@ -1627,7 +1591,6 @@ static struct omap_hwmod omap2430_usbhsotg_hwmod = { | |||
1627 | */ | 1591 | */ |
1628 | .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE | 1592 | .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE |
1629 | | HWMOD_SWSUP_MSTANDBY, | 1593 | | HWMOD_SWSUP_MSTANDBY, |
1630 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
1631 | }; | 1594 | }; |
1632 | 1595 | ||
1633 | /* | 1596 | /* |
@@ -1688,7 +1651,6 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = { | |||
1688 | }, | 1651 | }, |
1689 | .slaves = omap2430_mcbsp1_slaves, | 1652 | .slaves = omap2430_mcbsp1_slaves, |
1690 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves), | 1653 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves), |
1691 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1692 | }; | 1654 | }; |
1693 | 1655 | ||
1694 | /* mcbsp2 */ | 1656 | /* mcbsp2 */ |
@@ -1730,7 +1692,6 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = { | |||
1730 | }, | 1692 | }, |
1731 | .slaves = omap2430_mcbsp2_slaves, | 1693 | .slaves = omap2430_mcbsp2_slaves, |
1732 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves), | 1694 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves), |
1733 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1734 | }; | 1695 | }; |
1735 | 1696 | ||
1736 | /* mcbsp3 */ | 1697 | /* mcbsp3 */ |
@@ -1782,7 +1743,6 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = { | |||
1782 | }, | 1743 | }, |
1783 | .slaves = omap2430_mcbsp3_slaves, | 1744 | .slaves = omap2430_mcbsp3_slaves, |
1784 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves), | 1745 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves), |
1785 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1786 | }; | 1746 | }; |
1787 | 1747 | ||
1788 | /* mcbsp4 */ | 1748 | /* mcbsp4 */ |
@@ -1840,7 +1800,6 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = { | |||
1840 | }, | 1800 | }, |
1841 | .slaves = omap2430_mcbsp4_slaves, | 1801 | .slaves = omap2430_mcbsp4_slaves, |
1842 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves), | 1802 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves), |
1843 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1844 | }; | 1803 | }; |
1845 | 1804 | ||
1846 | /* mcbsp5 */ | 1805 | /* mcbsp5 */ |
@@ -1898,7 +1857,6 @@ static struct omap_hwmod omap2430_mcbsp5_hwmod = { | |||
1898 | }, | 1857 | }, |
1899 | .slaves = omap2430_mcbsp5_slaves, | 1858 | .slaves = omap2430_mcbsp5_slaves, |
1900 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves), | 1859 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves), |
1901 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1902 | }; | 1860 | }; |
1903 | 1861 | ||
1904 | /* MMC/SD/SDIO common */ | 1862 | /* MMC/SD/SDIO common */ |
@@ -1965,7 +1923,6 @@ static struct omap_hwmod omap2430_mmc1_hwmod = { | |||
1965 | .slaves = omap2430_mmc1_slaves, | 1923 | .slaves = omap2430_mmc1_slaves, |
1966 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves), | 1924 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves), |
1967 | .class = &omap2430_mmc_class, | 1925 | .class = &omap2430_mmc_class, |
1968 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
1969 | }; | 1926 | }; |
1970 | 1927 | ||
1971 | /* MMC/SD/SDIO2 */ | 1928 | /* MMC/SD/SDIO2 */ |
@@ -2009,7 +1966,6 @@ static struct omap_hwmod omap2430_mmc2_hwmod = { | |||
2009 | .slaves = omap2430_mmc2_slaves, | 1966 | .slaves = omap2430_mmc2_slaves, |
2010 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves), | 1967 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves), |
2011 | .class = &omap2430_mmc_class, | 1968 | .class = &omap2430_mmc_class, |
2012 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
2013 | }; | 1969 | }; |
2014 | 1970 | ||
2015 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { | 1971 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 25bf43b5a4ec..e787731cf3dc 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -156,7 +156,6 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod = { | |||
156 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), | 156 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), |
157 | .slaves = omap3xxx_l3_main_slaves, | 157 | .slaves = omap3xxx_l3_main_slaves, |
158 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_main_slaves), | 158 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_main_slaves), |
159 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
160 | .flags = HWMOD_NO_IDLEST, | 159 | .flags = HWMOD_NO_IDLEST, |
161 | }; | 160 | }; |
162 | 161 | ||
@@ -459,7 +458,6 @@ static struct omap_hwmod omap3xxx_l4_core_hwmod = { | |||
459 | .class = &l4_hwmod_class, | 458 | .class = &l4_hwmod_class, |
460 | .slaves = omap3xxx_l4_core_slaves, | 459 | .slaves = omap3xxx_l4_core_slaves, |
461 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), | 460 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), |
462 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
463 | .flags = HWMOD_NO_IDLEST, | 461 | .flags = HWMOD_NO_IDLEST, |
464 | }; | 462 | }; |
465 | 463 | ||
@@ -474,7 +472,6 @@ static struct omap_hwmod omap3xxx_l4_per_hwmod = { | |||
474 | .class = &l4_hwmod_class, | 472 | .class = &l4_hwmod_class, |
475 | .slaves = omap3xxx_l4_per_slaves, | 473 | .slaves = omap3xxx_l4_per_slaves, |
476 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), | 474 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), |
477 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
478 | .flags = HWMOD_NO_IDLEST, | 475 | .flags = HWMOD_NO_IDLEST, |
479 | }; | 476 | }; |
480 | 477 | ||
@@ -489,7 +486,6 @@ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { | |||
489 | .class = &l4_hwmod_class, | 486 | .class = &l4_hwmod_class, |
490 | .slaves = omap3xxx_l4_wkup_slaves, | 487 | .slaves = omap3xxx_l4_wkup_slaves, |
491 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), | 488 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), |
492 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
493 | .flags = HWMOD_NO_IDLEST, | 489 | .flags = HWMOD_NO_IDLEST, |
494 | }; | 490 | }; |
495 | 491 | ||
@@ -505,7 +501,6 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = { | |||
505 | .main_clk = "arm_fck", | 501 | .main_clk = "arm_fck", |
506 | .masters = omap3xxx_mpu_masters, | 502 | .masters = omap3xxx_mpu_masters, |
507 | .masters_cnt = ARRAY_SIZE(omap3xxx_mpu_masters), | 503 | .masters_cnt = ARRAY_SIZE(omap3xxx_mpu_masters), |
508 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
509 | }; | 504 | }; |
510 | 505 | ||
511 | /* | 506 | /* |
@@ -533,7 +528,6 @@ static struct omap_hwmod omap3xxx_iva_hwmod = { | |||
533 | .class = &iva_hwmod_class, | 528 | .class = &iva_hwmod_class, |
534 | .masters = omap3xxx_iva_masters, | 529 | .masters = omap3xxx_iva_masters, |
535 | .masters_cnt = ARRAY_SIZE(omap3xxx_iva_masters), | 530 | .masters_cnt = ARRAY_SIZE(omap3xxx_iva_masters), |
536 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
537 | }; | 531 | }; |
538 | 532 | ||
539 | /* timer class */ | 533 | /* timer class */ |
@@ -613,7 +607,6 @@ static struct omap_hwmod omap3xxx_timer1_hwmod = { | |||
613 | .slaves = omap3xxx_timer1_slaves, | 607 | .slaves = omap3xxx_timer1_slaves, |
614 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves), | 608 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves), |
615 | .class = &omap3xxx_timer_1ms_hwmod_class, | 609 | .class = &omap3xxx_timer_1ms_hwmod_class, |
616 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
617 | }; | 610 | }; |
618 | 611 | ||
619 | /* timer2 */ | 612 | /* timer2 */ |
@@ -659,7 +652,6 @@ static struct omap_hwmod omap3xxx_timer2_hwmod = { | |||
659 | .slaves = omap3xxx_timer2_slaves, | 652 | .slaves = omap3xxx_timer2_slaves, |
660 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves), | 653 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves), |
661 | .class = &omap3xxx_timer_1ms_hwmod_class, | 654 | .class = &omap3xxx_timer_1ms_hwmod_class, |
662 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
663 | }; | 655 | }; |
664 | 656 | ||
665 | /* timer3 */ | 657 | /* timer3 */ |
@@ -705,7 +697,6 @@ static struct omap_hwmod omap3xxx_timer3_hwmod = { | |||
705 | .slaves = omap3xxx_timer3_slaves, | 697 | .slaves = omap3xxx_timer3_slaves, |
706 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves), | 698 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves), |
707 | .class = &omap3xxx_timer_hwmod_class, | 699 | .class = &omap3xxx_timer_hwmod_class, |
708 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
709 | }; | 700 | }; |
710 | 701 | ||
711 | /* timer4 */ | 702 | /* timer4 */ |
@@ -751,7 +742,6 @@ static struct omap_hwmod omap3xxx_timer4_hwmod = { | |||
751 | .slaves = omap3xxx_timer4_slaves, | 742 | .slaves = omap3xxx_timer4_slaves, |
752 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves), | 743 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves), |
753 | .class = &omap3xxx_timer_hwmod_class, | 744 | .class = &omap3xxx_timer_hwmod_class, |
754 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
755 | }; | 745 | }; |
756 | 746 | ||
757 | /* timer5 */ | 747 | /* timer5 */ |
@@ -797,7 +787,6 @@ static struct omap_hwmod omap3xxx_timer5_hwmod = { | |||
797 | .slaves = omap3xxx_timer5_slaves, | 787 | .slaves = omap3xxx_timer5_slaves, |
798 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves), | 788 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves), |
799 | .class = &omap3xxx_timer_hwmod_class, | 789 | .class = &omap3xxx_timer_hwmod_class, |
800 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
801 | }; | 790 | }; |
802 | 791 | ||
803 | /* timer6 */ | 792 | /* timer6 */ |
@@ -843,7 +832,6 @@ static struct omap_hwmod omap3xxx_timer6_hwmod = { | |||
843 | .slaves = omap3xxx_timer6_slaves, | 832 | .slaves = omap3xxx_timer6_slaves, |
844 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves), | 833 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves), |
845 | .class = &omap3xxx_timer_hwmod_class, | 834 | .class = &omap3xxx_timer_hwmod_class, |
846 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
847 | }; | 835 | }; |
848 | 836 | ||
849 | /* timer7 */ | 837 | /* timer7 */ |
@@ -889,7 +877,6 @@ static struct omap_hwmod omap3xxx_timer7_hwmod = { | |||
889 | .slaves = omap3xxx_timer7_slaves, | 877 | .slaves = omap3xxx_timer7_slaves, |
890 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves), | 878 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves), |
891 | .class = &omap3xxx_timer_hwmod_class, | 879 | .class = &omap3xxx_timer_hwmod_class, |
892 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
893 | }; | 880 | }; |
894 | 881 | ||
895 | /* timer8 */ | 882 | /* timer8 */ |
@@ -935,7 +922,6 @@ static struct omap_hwmod omap3xxx_timer8_hwmod = { | |||
935 | .slaves = omap3xxx_timer8_slaves, | 922 | .slaves = omap3xxx_timer8_slaves, |
936 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves), | 923 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves), |
937 | .class = &omap3xxx_timer_hwmod_class, | 924 | .class = &omap3xxx_timer_hwmod_class, |
938 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
939 | }; | 925 | }; |
940 | 926 | ||
941 | /* timer9 */ | 927 | /* timer9 */ |
@@ -981,7 +967,6 @@ static struct omap_hwmod omap3xxx_timer9_hwmod = { | |||
981 | .slaves = omap3xxx_timer9_slaves, | 967 | .slaves = omap3xxx_timer9_slaves, |
982 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves), | 968 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves), |
983 | .class = &omap3xxx_timer_hwmod_class, | 969 | .class = &omap3xxx_timer_hwmod_class, |
984 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
985 | }; | 970 | }; |
986 | 971 | ||
987 | /* timer10 */ | 972 | /* timer10 */ |
@@ -1018,7 +1003,6 @@ static struct omap_hwmod omap3xxx_timer10_hwmod = { | |||
1018 | .slaves = omap3xxx_timer10_slaves, | 1003 | .slaves = omap3xxx_timer10_slaves, |
1019 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves), | 1004 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves), |
1020 | .class = &omap3xxx_timer_1ms_hwmod_class, | 1005 | .class = &omap3xxx_timer_1ms_hwmod_class, |
1021 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1022 | }; | 1006 | }; |
1023 | 1007 | ||
1024 | /* timer11 */ | 1008 | /* timer11 */ |
@@ -1055,7 +1039,6 @@ static struct omap_hwmod omap3xxx_timer11_hwmod = { | |||
1055 | .slaves = omap3xxx_timer11_slaves, | 1039 | .slaves = omap3xxx_timer11_slaves, |
1056 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves), | 1040 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves), |
1057 | .class = &omap3xxx_timer_hwmod_class, | 1041 | .class = &omap3xxx_timer_hwmod_class, |
1058 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1059 | }; | 1042 | }; |
1060 | 1043 | ||
1061 | /* timer12*/ | 1044 | /* timer12*/ |
@@ -1105,7 +1088,6 @@ static struct omap_hwmod omap3xxx_timer12_hwmod = { | |||
1105 | .slaves = omap3xxx_timer12_slaves, | 1088 | .slaves = omap3xxx_timer12_slaves, |
1106 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves), | 1089 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves), |
1107 | .class = &omap3xxx_timer_hwmod_class, | 1090 | .class = &omap3xxx_timer_hwmod_class, |
1108 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
1109 | }; | 1091 | }; |
1110 | 1092 | ||
1111 | /* l4_wkup -> wd_timer2 */ | 1093 | /* l4_wkup -> wd_timer2 */ |
@@ -1182,7 +1164,6 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = { | |||
1182 | }, | 1164 | }, |
1183 | .slaves = omap3xxx_wd_timer2_slaves, | 1165 | .slaves = omap3xxx_wd_timer2_slaves, |
1184 | .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), | 1166 | .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), |
1185 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1186 | /* | 1167 | /* |
1187 | * XXX: Use software supervised mode, HW supervised smartidle seems to | 1168 | * XXX: Use software supervised mode, HW supervised smartidle seems to |
1188 | * block CORE power domain idle transitions. Maybe a HW bug in wdt2? | 1169 | * block CORE power domain idle transitions. Maybe a HW bug in wdt2? |
@@ -1213,7 +1194,6 @@ static struct omap_hwmod omap3xxx_uart1_hwmod = { | |||
1213 | .slaves = omap3xxx_uart1_slaves, | 1194 | .slaves = omap3xxx_uart1_slaves, |
1214 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart1_slaves), | 1195 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart1_slaves), |
1215 | .class = &omap2_uart_class, | 1196 | .class = &omap2_uart_class, |
1216 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1217 | }; | 1197 | }; |
1218 | 1198 | ||
1219 | /* UART2 */ | 1199 | /* UART2 */ |
@@ -1239,7 +1219,6 @@ static struct omap_hwmod omap3xxx_uart2_hwmod = { | |||
1239 | .slaves = omap3xxx_uart2_slaves, | 1219 | .slaves = omap3xxx_uart2_slaves, |
1240 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart2_slaves), | 1220 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart2_slaves), |
1241 | .class = &omap2_uart_class, | 1221 | .class = &omap2_uart_class, |
1242 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1243 | }; | 1222 | }; |
1244 | 1223 | ||
1245 | /* UART3 */ | 1224 | /* UART3 */ |
@@ -1265,7 +1244,6 @@ static struct omap_hwmod omap3xxx_uart3_hwmod = { | |||
1265 | .slaves = omap3xxx_uart3_slaves, | 1244 | .slaves = omap3xxx_uart3_slaves, |
1266 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart3_slaves), | 1245 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart3_slaves), |
1267 | .class = &omap2_uart_class, | 1246 | .class = &omap2_uart_class, |
1268 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1269 | }; | 1247 | }; |
1270 | 1248 | ||
1271 | /* UART4 */ | 1249 | /* UART4 */ |
@@ -1302,7 +1280,6 @@ static struct omap_hwmod omap3xxx_uart4_hwmod = { | |||
1302 | .slaves = omap3xxx_uart4_slaves, | 1280 | .slaves = omap3xxx_uart4_slaves, |
1303 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart4_slaves), | 1281 | .slaves_cnt = ARRAY_SIZE(omap3xxx_uart4_slaves), |
1304 | .class = &omap2_uart_class, | 1282 | .class = &omap2_uart_class, |
1305 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), | ||
1306 | }; | 1283 | }; |
1307 | 1284 | ||
1308 | static struct omap_hwmod_class i2c_class = { | 1285 | static struct omap_hwmod_class i2c_class = { |
@@ -1390,7 +1367,6 @@ static struct omap_hwmod omap3430es1_dss_core_hwmod = { | |||
1390 | .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves), | 1367 | .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves), |
1391 | .masters = omap3xxx_dss_masters, | 1368 | .masters = omap3xxx_dss_masters, |
1392 | .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), | 1369 | .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), |
1393 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), | ||
1394 | .flags = HWMOD_NO_IDLEST, | 1370 | .flags = HWMOD_NO_IDLEST, |
1395 | }; | 1371 | }; |
1396 | 1372 | ||
@@ -1415,8 +1391,6 @@ static struct omap_hwmod omap3xxx_dss_core_hwmod = { | |||
1415 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves), | 1391 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves), |
1416 | .masters = omap3xxx_dss_masters, | 1392 | .masters = omap3xxx_dss_masters, |
1417 | .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), | 1393 | .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), |
1418 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2 | | ||
1419 | CHIP_IS_OMAP3630ES1 | CHIP_GE_OMAP3630ES1_1), | ||
1420 | }; | 1394 | }; |
1421 | 1395 | ||
1422 | /* l4_core -> dss_dispc */ | 1396 | /* l4_core -> dss_dispc */ |
@@ -1454,9 +1428,6 @@ static struct omap_hwmod omap3xxx_dss_dispc_hwmod = { | |||
1454 | }, | 1428 | }, |
1455 | .slaves = omap3xxx_dss_dispc_slaves, | 1429 | .slaves = omap3xxx_dss_dispc_slaves, |
1456 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves), | 1430 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves), |
1457 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1458 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1459 | CHIP_GE_OMAP3630ES1_1), | ||
1460 | .flags = HWMOD_NO_IDLEST, | 1431 | .flags = HWMOD_NO_IDLEST, |
1461 | }; | 1432 | }; |
1462 | 1433 | ||
@@ -1518,9 +1489,6 @@ static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = { | |||
1518 | }, | 1489 | }, |
1519 | .slaves = omap3xxx_dss_dsi1_slaves, | 1490 | .slaves = omap3xxx_dss_dsi1_slaves, |
1520 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves), | 1491 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves), |
1521 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1522 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1523 | CHIP_GE_OMAP3630ES1_1), | ||
1524 | .flags = HWMOD_NO_IDLEST, | 1492 | .flags = HWMOD_NO_IDLEST, |
1525 | }; | 1493 | }; |
1526 | 1494 | ||
@@ -1558,9 +1526,6 @@ static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = { | |||
1558 | }, | 1526 | }, |
1559 | .slaves = omap3xxx_dss_rfbi_slaves, | 1527 | .slaves = omap3xxx_dss_rfbi_slaves, |
1560 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves), | 1528 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves), |
1561 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1562 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1563 | CHIP_GE_OMAP3630ES1_1), | ||
1564 | .flags = HWMOD_NO_IDLEST, | 1529 | .flags = HWMOD_NO_IDLEST, |
1565 | }; | 1530 | }; |
1566 | 1531 | ||
@@ -1599,9 +1564,6 @@ static struct omap_hwmod omap3xxx_dss_venc_hwmod = { | |||
1599 | }, | 1564 | }, |
1600 | .slaves = omap3xxx_dss_venc_slaves, | 1565 | .slaves = omap3xxx_dss_venc_slaves, |
1601 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves), | 1566 | .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves), |
1602 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
1603 | CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 | | ||
1604 | CHIP_GE_OMAP3630ES1_1), | ||
1605 | .flags = HWMOD_NO_IDLEST, | 1567 | .flags = HWMOD_NO_IDLEST, |
1606 | }; | 1568 | }; |
1607 | 1569 | ||
@@ -1637,7 +1599,6 @@ static struct omap_hwmod omap3xxx_i2c1_hwmod = { | |||
1637 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c1_slaves), | 1599 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c1_slaves), |
1638 | .class = &i2c_class, | 1600 | .class = &i2c_class, |
1639 | .dev_attr = &i2c1_dev_attr, | 1601 | .dev_attr = &i2c1_dev_attr, |
1640 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1641 | }; | 1602 | }; |
1642 | 1603 | ||
1643 | /* I2C2 */ | 1604 | /* I2C2 */ |
@@ -1672,7 +1633,6 @@ static struct omap_hwmod omap3xxx_i2c2_hwmod = { | |||
1672 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c2_slaves), | 1633 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c2_slaves), |
1673 | .class = &i2c_class, | 1634 | .class = &i2c_class, |
1674 | .dev_attr = &i2c2_dev_attr, | 1635 | .dev_attr = &i2c2_dev_attr, |
1675 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1676 | }; | 1636 | }; |
1677 | 1637 | ||
1678 | /* I2C3 */ | 1638 | /* I2C3 */ |
@@ -1718,7 +1678,6 @@ static struct omap_hwmod omap3xxx_i2c3_hwmod = { | |||
1718 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c3_slaves), | 1678 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c3_slaves), |
1719 | .class = &i2c_class, | 1679 | .class = &i2c_class, |
1720 | .dev_attr = &i2c3_dev_attr, | 1680 | .dev_attr = &i2c3_dev_attr, |
1721 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1722 | }; | 1681 | }; |
1723 | 1682 | ||
1724 | /* l4_wkup -> gpio1 */ | 1683 | /* l4_wkup -> gpio1 */ |
@@ -1880,7 +1839,6 @@ static struct omap_hwmod omap3xxx_gpio1_hwmod = { | |||
1880 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio1_slaves), | 1839 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio1_slaves), |
1881 | .class = &omap3xxx_gpio_hwmod_class, | 1840 | .class = &omap3xxx_gpio_hwmod_class, |
1882 | .dev_attr = &gpio_dev_attr, | 1841 | .dev_attr = &gpio_dev_attr, |
1883 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1884 | }; | 1842 | }; |
1885 | 1843 | ||
1886 | /* gpio2 */ | 1844 | /* gpio2 */ |
@@ -1912,7 +1870,6 @@ static struct omap_hwmod omap3xxx_gpio2_hwmod = { | |||
1912 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio2_slaves), | 1870 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio2_slaves), |
1913 | .class = &omap3xxx_gpio_hwmod_class, | 1871 | .class = &omap3xxx_gpio_hwmod_class, |
1914 | .dev_attr = &gpio_dev_attr, | 1872 | .dev_attr = &gpio_dev_attr, |
1915 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1916 | }; | 1873 | }; |
1917 | 1874 | ||
1918 | /* gpio3 */ | 1875 | /* gpio3 */ |
@@ -1944,7 +1901,6 @@ static struct omap_hwmod omap3xxx_gpio3_hwmod = { | |||
1944 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio3_slaves), | 1901 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio3_slaves), |
1945 | .class = &omap3xxx_gpio_hwmod_class, | 1902 | .class = &omap3xxx_gpio_hwmod_class, |
1946 | .dev_attr = &gpio_dev_attr, | 1903 | .dev_attr = &gpio_dev_attr, |
1947 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1948 | }; | 1904 | }; |
1949 | 1905 | ||
1950 | /* gpio4 */ | 1906 | /* gpio4 */ |
@@ -1976,7 +1932,6 @@ static struct omap_hwmod omap3xxx_gpio4_hwmod = { | |||
1976 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio4_slaves), | 1932 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio4_slaves), |
1977 | .class = &omap3xxx_gpio_hwmod_class, | 1933 | .class = &omap3xxx_gpio_hwmod_class, |
1978 | .dev_attr = &gpio_dev_attr, | 1934 | .dev_attr = &gpio_dev_attr, |
1979 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
1980 | }; | 1935 | }; |
1981 | 1936 | ||
1982 | /* gpio5 */ | 1937 | /* gpio5 */ |
@@ -2013,7 +1968,6 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod = { | |||
2013 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio5_slaves), | 1968 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio5_slaves), |
2014 | .class = &omap3xxx_gpio_hwmod_class, | 1969 | .class = &omap3xxx_gpio_hwmod_class, |
2015 | .dev_attr = &gpio_dev_attr, | 1970 | .dev_attr = &gpio_dev_attr, |
2016 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2017 | }; | 1971 | }; |
2018 | 1972 | ||
2019 | /* gpio6 */ | 1973 | /* gpio6 */ |
@@ -2050,7 +2004,6 @@ static struct omap_hwmod omap3xxx_gpio6_hwmod = { | |||
2050 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio6_slaves), | 2004 | .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio6_slaves), |
2051 | .class = &omap3xxx_gpio_hwmod_class, | 2005 | .class = &omap3xxx_gpio_hwmod_class, |
2052 | .dev_attr = &gpio_dev_attr, | 2006 | .dev_attr = &gpio_dev_attr, |
2053 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2054 | }; | 2007 | }; |
2055 | 2008 | ||
2056 | /* dma_system -> L3 */ | 2009 | /* dma_system -> L3 */ |
@@ -2134,7 +2087,6 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = { | |||
2134 | .masters = omap3xxx_dma_system_masters, | 2087 | .masters = omap3xxx_dma_system_masters, |
2135 | .masters_cnt = ARRAY_SIZE(omap3xxx_dma_system_masters), | 2088 | .masters_cnt = ARRAY_SIZE(omap3xxx_dma_system_masters), |
2136 | .dev_attr = &dma_dev_attr, | 2089 | .dev_attr = &dma_dev_attr, |
2137 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2138 | .flags = HWMOD_NO_IDLEST, | 2090 | .flags = HWMOD_NO_IDLEST, |
2139 | }; | 2091 | }; |
2140 | 2092 | ||
@@ -2207,7 +2159,6 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { | |||
2207 | }, | 2159 | }, |
2208 | .slaves = omap3xxx_mcbsp1_slaves, | 2160 | .slaves = omap3xxx_mcbsp1_slaves, |
2209 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves), | 2161 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves), |
2210 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2211 | }; | 2162 | }; |
2212 | 2163 | ||
2213 | /* mcbsp2 */ | 2164 | /* mcbsp2 */ |
@@ -2264,7 +2215,6 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { | |||
2264 | .slaves = omap3xxx_mcbsp2_slaves, | 2215 | .slaves = omap3xxx_mcbsp2_slaves, |
2265 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves), | 2216 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves), |
2266 | .dev_attr = &omap34xx_mcbsp2_dev_attr, | 2217 | .dev_attr = &omap34xx_mcbsp2_dev_attr, |
2267 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2268 | }; | 2218 | }; |
2269 | 2219 | ||
2270 | /* mcbsp3 */ | 2220 | /* mcbsp3 */ |
@@ -2321,7 +2271,6 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { | |||
2321 | .slaves = omap3xxx_mcbsp3_slaves, | 2271 | .slaves = omap3xxx_mcbsp3_slaves, |
2322 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves), | 2272 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves), |
2323 | .dev_attr = &omap34xx_mcbsp3_dev_attr, | 2273 | .dev_attr = &omap34xx_mcbsp3_dev_attr, |
2324 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2325 | }; | 2274 | }; |
2326 | 2275 | ||
2327 | /* mcbsp4 */ | 2276 | /* mcbsp4 */ |
@@ -2379,7 +2328,6 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { | |||
2379 | }, | 2328 | }, |
2380 | .slaves = omap3xxx_mcbsp4_slaves, | 2329 | .slaves = omap3xxx_mcbsp4_slaves, |
2381 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves), | 2330 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves), |
2382 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2383 | }; | 2331 | }; |
2384 | 2332 | ||
2385 | /* mcbsp5 */ | 2333 | /* mcbsp5 */ |
@@ -2437,7 +2385,6 @@ static struct omap_hwmod omap3xxx_mcbsp5_hwmod = { | |||
2437 | }, | 2385 | }, |
2438 | .slaves = omap3xxx_mcbsp5_slaves, | 2386 | .slaves = omap3xxx_mcbsp5_slaves, |
2439 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves), | 2387 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves), |
2440 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2441 | }; | 2388 | }; |
2442 | /* 'mcbsp sidetone' class */ | 2389 | /* 'mcbsp sidetone' class */ |
2443 | 2390 | ||
@@ -2498,7 +2445,6 @@ static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { | |||
2498 | }, | 2445 | }, |
2499 | .slaves = omap3xxx_mcbsp2_sidetone_slaves, | 2446 | .slaves = omap3xxx_mcbsp2_sidetone_slaves, |
2500 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves), | 2447 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves), |
2501 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2502 | }; | 2448 | }; |
2503 | 2449 | ||
2504 | /* mcbsp3_sidetone */ | 2450 | /* mcbsp3_sidetone */ |
@@ -2547,7 +2493,6 @@ static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { | |||
2547 | }, | 2493 | }, |
2548 | .slaves = omap3xxx_mcbsp3_sidetone_slaves, | 2494 | .slaves = omap3xxx_mcbsp3_sidetone_slaves, |
2549 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves), | 2495 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves), |
2550 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2551 | }; | 2496 | }; |
2552 | 2497 | ||
2553 | 2498 | ||
@@ -2597,7 +2542,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = { | |||
2597 | .name = "sr1_hwmod", | 2542 | .name = "sr1_hwmod", |
2598 | .class = &omap34xx_smartreflex_hwmod_class, | 2543 | .class = &omap34xx_smartreflex_hwmod_class, |
2599 | .main_clk = "sr1_fck", | 2544 | .main_clk = "sr1_fck", |
2600 | .vdd_name = "mpu", | 2545 | .vdd_name = "mpu_iva", |
2601 | .prcm = { | 2546 | .prcm = { |
2602 | .omap2 = { | 2547 | .omap2 = { |
2603 | .prcm_reg_id = 1, | 2548 | .prcm_reg_id = 1, |
@@ -2609,9 +2554,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = { | |||
2609 | }, | 2554 | }, |
2610 | .slaves = omap3_sr1_slaves, | 2555 | .slaves = omap3_sr1_slaves, |
2611 | .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), | 2556 | .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), |
2612 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | | ||
2613 | CHIP_IS_OMAP3430ES3_0 | | ||
2614 | CHIP_IS_OMAP3430ES3_1), | ||
2615 | .flags = HWMOD_SET_DEFAULT_CLOCKACT, | 2557 | .flags = HWMOD_SET_DEFAULT_CLOCKACT, |
2616 | }; | 2558 | }; |
2617 | 2559 | ||
@@ -2619,7 +2561,7 @@ static struct omap_hwmod omap36xx_sr1_hwmod = { | |||
2619 | .name = "sr1_hwmod", | 2561 | .name = "sr1_hwmod", |
2620 | .class = &omap36xx_smartreflex_hwmod_class, | 2562 | .class = &omap36xx_smartreflex_hwmod_class, |
2621 | .main_clk = "sr1_fck", | 2563 | .main_clk = "sr1_fck", |
2622 | .vdd_name = "mpu", | 2564 | .vdd_name = "mpu_iva", |
2623 | .prcm = { | 2565 | .prcm = { |
2624 | .omap2 = { | 2566 | .omap2 = { |
2625 | .prcm_reg_id = 1, | 2567 | .prcm_reg_id = 1, |
@@ -2631,7 +2573,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = { | |||
2631 | }, | 2573 | }, |
2632 | .slaves = omap3_sr1_slaves, | 2574 | .slaves = omap3_sr1_slaves, |
2633 | .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), | 2575 | .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), |
2634 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), | ||
2635 | }; | 2576 | }; |
2636 | 2577 | ||
2637 | /* SR2 */ | 2578 | /* SR2 */ |
@@ -2655,9 +2596,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = { | |||
2655 | }, | 2596 | }, |
2656 | .slaves = omap3_sr2_slaves, | 2597 | .slaves = omap3_sr2_slaves, |
2657 | .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), | 2598 | .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), |
2658 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | | ||
2659 | CHIP_IS_OMAP3430ES3_0 | | ||
2660 | CHIP_IS_OMAP3430ES3_1), | ||
2661 | .flags = HWMOD_SET_DEFAULT_CLOCKACT, | 2599 | .flags = HWMOD_SET_DEFAULT_CLOCKACT, |
2662 | }; | 2600 | }; |
2663 | 2601 | ||
@@ -2677,7 +2615,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = { | |||
2677 | }, | 2615 | }, |
2678 | .slaves = omap3_sr2_slaves, | 2616 | .slaves = omap3_sr2_slaves, |
2679 | .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), | 2617 | .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), |
2680 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), | ||
2681 | }; | 2618 | }; |
2682 | 2619 | ||
2683 | /* | 2620 | /* |
@@ -2745,7 +2682,6 @@ static struct omap_hwmod omap3xxx_mailbox_hwmod = { | |||
2745 | }, | 2682 | }, |
2746 | .slaves = omap3xxx_mailbox_slaves, | 2683 | .slaves = omap3xxx_mailbox_slaves, |
2747 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves), | 2684 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves), |
2748 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2749 | }; | 2685 | }; |
2750 | 2686 | ||
2751 | /* l4 core -> mcspi1 interface */ | 2687 | /* l4 core -> mcspi1 interface */ |
@@ -2843,7 +2779,6 @@ static struct omap_hwmod omap34xx_mcspi1 = { | |||
2843 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves), | 2779 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves), |
2844 | .class = &omap34xx_mcspi_class, | 2780 | .class = &omap34xx_mcspi_class, |
2845 | .dev_attr = &omap_mcspi1_dev_attr, | 2781 | .dev_attr = &omap_mcspi1_dev_attr, |
2846 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2847 | }; | 2782 | }; |
2848 | 2783 | ||
2849 | /* mcspi2 */ | 2784 | /* mcspi2 */ |
@@ -2873,7 +2808,6 @@ static struct omap_hwmod omap34xx_mcspi2 = { | |||
2873 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves), | 2808 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves), |
2874 | .class = &omap34xx_mcspi_class, | 2809 | .class = &omap34xx_mcspi_class, |
2875 | .dev_attr = &omap_mcspi2_dev_attr, | 2810 | .dev_attr = &omap_mcspi2_dev_attr, |
2876 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2877 | }; | 2811 | }; |
2878 | 2812 | ||
2879 | /* mcspi3 */ | 2813 | /* mcspi3 */ |
@@ -2916,7 +2850,6 @@ static struct omap_hwmod omap34xx_mcspi3 = { | |||
2916 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves), | 2850 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves), |
2917 | .class = &omap34xx_mcspi_class, | 2851 | .class = &omap34xx_mcspi_class, |
2918 | .dev_attr = &omap_mcspi3_dev_attr, | 2852 | .dev_attr = &omap_mcspi3_dev_attr, |
2919 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2920 | }; | 2853 | }; |
2921 | 2854 | ||
2922 | /* SPI4 */ | 2855 | /* SPI4 */ |
@@ -2957,7 +2890,6 @@ static struct omap_hwmod omap34xx_mcspi4 = { | |||
2957 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves), | 2890 | .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves), |
2958 | .class = &omap34xx_mcspi_class, | 2891 | .class = &omap34xx_mcspi_class, |
2959 | .dev_attr = &omap_mcspi4_dev_attr, | 2892 | .dev_attr = &omap_mcspi4_dev_attr, |
2960 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
2961 | }; | 2893 | }; |
2962 | 2894 | ||
2963 | /* | 2895 | /* |
@@ -3014,7 +2946,6 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { | |||
3014 | */ | 2946 | */ |
3015 | .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE | 2947 | .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE |
3016 | | HWMOD_SWSUP_MSTANDBY, | 2948 | | HWMOD_SWSUP_MSTANDBY, |
3017 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
3018 | }; | 2949 | }; |
3019 | 2950 | ||
3020 | /* usb_otg_hs */ | 2951 | /* usb_otg_hs */ |
@@ -3042,7 +2973,6 @@ static struct omap_hwmod am35xx_usbhsotg_hwmod = { | |||
3042 | .slaves = am35xx_usbhsotg_slaves, | 2973 | .slaves = am35xx_usbhsotg_slaves, |
3043 | .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves), | 2974 | .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves), |
3044 | .class = &am35xx_usbotg_class, | 2975 | .class = &am35xx_usbotg_class, |
3045 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1) | ||
3046 | }; | 2976 | }; |
3047 | 2977 | ||
3048 | /* MMC/SD/SDIO common */ | 2978 | /* MMC/SD/SDIO common */ |
@@ -3108,7 +3038,6 @@ static struct omap_hwmod omap3xxx_mmc1_hwmod = { | |||
3108 | .slaves = omap3xxx_mmc1_slaves, | 3038 | .slaves = omap3xxx_mmc1_slaves, |
3109 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves), | 3039 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves), |
3110 | .class = &omap34xx_mmc_class, | 3040 | .class = &omap34xx_mmc_class, |
3111 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3112 | }; | 3041 | }; |
3113 | 3042 | ||
3114 | /* MMC/SD/SDIO2 */ | 3043 | /* MMC/SD/SDIO2 */ |
@@ -3151,7 +3080,6 @@ static struct omap_hwmod omap3xxx_mmc2_hwmod = { | |||
3151 | .slaves = omap3xxx_mmc2_slaves, | 3080 | .slaves = omap3xxx_mmc2_slaves, |
3152 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves), | 3081 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves), |
3153 | .class = &omap34xx_mmc_class, | 3082 | .class = &omap34xx_mmc_class, |
3154 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3155 | }; | 3083 | }; |
3156 | 3084 | ||
3157 | /* MMC/SD/SDIO3 */ | 3085 | /* MMC/SD/SDIO3 */ |
@@ -3193,7 +3121,6 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = { | |||
3193 | .slaves = omap3xxx_mmc3_slaves, | 3121 | .slaves = omap3xxx_mmc3_slaves, |
3194 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves), | 3122 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves), |
3195 | .class = &omap34xx_mmc_class, | 3123 | .class = &omap34xx_mmc_class, |
3196 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
3197 | }; | 3124 | }; |
3198 | 3125 | ||
3199 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 3126 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { |
@@ -3224,10 +3151,7 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
3224 | &omap3xxx_uart1_hwmod, | 3151 | &omap3xxx_uart1_hwmod, |
3225 | &omap3xxx_uart2_hwmod, | 3152 | &omap3xxx_uart2_hwmod, |
3226 | &omap3xxx_uart3_hwmod, | 3153 | &omap3xxx_uart3_hwmod, |
3227 | &omap3xxx_uart4_hwmod, | ||
3228 | /* dss class */ | 3154 | /* dss class */ |
3229 | &omap3430es1_dss_core_hwmod, | ||
3230 | &omap3xxx_dss_core_hwmod, | ||
3231 | &omap3xxx_dss_dispc_hwmod, | 3155 | &omap3xxx_dss_dispc_hwmod, |
3232 | &omap3xxx_dss_dsi1_hwmod, | 3156 | &omap3xxx_dss_dsi1_hwmod, |
3233 | &omap3xxx_dss_rfbi_hwmod, | 3157 | &omap3xxx_dss_rfbi_hwmod, |
@@ -3239,9 +3163,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
3239 | &omap3xxx_i2c3_hwmod, | 3163 | &omap3xxx_i2c3_hwmod, |
3240 | &omap34xx_sr1_hwmod, | 3164 | &omap34xx_sr1_hwmod, |
3241 | &omap34xx_sr2_hwmod, | 3165 | &omap34xx_sr2_hwmod, |
3242 | &omap36xx_sr1_hwmod, | ||
3243 | &omap36xx_sr2_hwmod, | ||
3244 | |||
3245 | 3166 | ||
3246 | /* gpio class */ | 3167 | /* gpio class */ |
3247 | &omap3xxx_gpio1_hwmod, | 3168 | &omap3xxx_gpio1_hwmod, |
@@ -3272,16 +3193,96 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
3272 | &omap34xx_mcspi3, | 3193 | &omap34xx_mcspi3, |
3273 | &omap34xx_mcspi4, | 3194 | &omap34xx_mcspi4, |
3274 | 3195 | ||
3275 | /* usbotg class */ | 3196 | NULL, |
3197 | }; | ||
3198 | |||
3199 | /* 3430ES1-only hwmods */ | ||
3200 | static __initdata struct omap_hwmod *omap3430es1_hwmods[] = { | ||
3201 | &omap3430es1_dss_core_hwmod, | ||
3202 | NULL | ||
3203 | }; | ||
3204 | |||
3205 | /* 3430ES2+-only hwmods */ | ||
3206 | static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = { | ||
3207 | &omap3xxx_dss_core_hwmod, | ||
3276 | &omap3xxx_usbhsotg_hwmod, | 3208 | &omap3xxx_usbhsotg_hwmod, |
3209 | NULL | ||
3210 | }; | ||
3277 | 3211 | ||
3278 | /* usbotg for am35x */ | 3212 | /* 34xx-only hwmods (all ES revisions) */ |
3279 | &am35xx_usbhsotg_hwmod, | 3213 | static __initdata struct omap_hwmod *omap34xx_hwmods[] = { |
3214 | &omap34xx_sr1_hwmod, | ||
3215 | &omap34xx_sr2_hwmod, | ||
3216 | NULL | ||
3217 | }; | ||
3280 | 3218 | ||
3281 | NULL, | 3219 | /* 36xx-only hwmods (all ES revisions) */ |
3220 | static __initdata struct omap_hwmod *omap36xx_hwmods[] = { | ||
3221 | &omap3xxx_uart4_hwmod, | ||
3222 | &omap3xxx_dss_core_hwmod, | ||
3223 | &omap36xx_sr1_hwmod, | ||
3224 | &omap36xx_sr2_hwmod, | ||
3225 | &omap3xxx_usbhsotg_hwmod, | ||
3226 | NULL | ||
3227 | }; | ||
3228 | |||
3229 | static __initdata struct omap_hwmod *am35xx_hwmods[] = { | ||
3230 | &omap3xxx_dss_core_hwmod, /* XXX ??? */ | ||
3231 | &am35xx_usbhsotg_hwmod, | ||
3232 | NULL | ||
3282 | }; | 3233 | }; |
3283 | 3234 | ||
3284 | int __init omap3xxx_hwmod_init(void) | 3235 | int __init omap3xxx_hwmod_init(void) |
3285 | { | 3236 | { |
3286 | return omap_hwmod_register(omap3xxx_hwmods); | 3237 | int r; |
3238 | struct omap_hwmod **h = NULL; | ||
3239 | unsigned int rev; | ||
3240 | |||
3241 | /* Register hwmods common to all OMAP3 */ | ||
3242 | r = omap_hwmod_register(omap3xxx_hwmods); | ||
3243 | if (!r) | ||
3244 | return r; | ||
3245 | |||
3246 | rev = omap_rev(); | ||
3247 | |||
3248 | /* | ||
3249 | * Register hwmods common to individual OMAP3 families, all | ||
3250 | * silicon revisions (e.g., 34xx, or AM3505/3517, or 36xx) | ||
3251 | * All possible revisions should be included in this conditional. | ||
3252 | */ | ||
3253 | if (rev == OMAP3430_REV_ES1_0 || rev == OMAP3430_REV_ES2_0 || | ||
3254 | rev == OMAP3430_REV_ES2_1 || rev == OMAP3430_REV_ES3_0 || | ||
3255 | rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) { | ||
3256 | h = omap34xx_hwmods; | ||
3257 | } else if (rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1) { | ||
3258 | h = am35xx_hwmods; | ||
3259 | } else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 || | ||
3260 | rev == OMAP3630_REV_ES1_2) { | ||
3261 | h = omap36xx_hwmods; | ||
3262 | } else { | ||
3263 | WARN(1, "OMAP3 hwmod family init: unknown chip type\n"); | ||
3264 | return -EINVAL; | ||
3265 | }; | ||
3266 | |||
3267 | r = omap_hwmod_register(h); | ||
3268 | if (!r) | ||
3269 | return r; | ||
3270 | |||
3271 | /* | ||
3272 | * Register hwmods specific to certain ES levels of a | ||
3273 | * particular family of silicon (e.g., 34xx ES1.0) | ||
3274 | */ | ||
3275 | h = NULL; | ||
3276 | if (rev == OMAP3430_REV_ES1_0) { | ||
3277 | h = omap3430es1_hwmods; | ||
3278 | } else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 || | ||
3279 | rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 || | ||
3280 | rev == OMAP3430_REV_ES3_1_2) { | ||
3281 | h = omap3430es2plus_hwmods; | ||
3282 | }; | ||
3283 | |||
3284 | if (h) | ||
3285 | r = omap_hwmod_register(h); | ||
3286 | |||
3287 | return r; | ||
3287 | } | 3288 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 6201422c0606..caaf40911dd4 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -133,7 +133,6 @@ static struct omap_hwmod omap44xx_dmm_hwmod = { | |||
133 | .slaves = omap44xx_dmm_slaves, | 133 | .slaves = omap44xx_dmm_slaves, |
134 | .slaves_cnt = ARRAY_SIZE(omap44xx_dmm_slaves), | 134 | .slaves_cnt = ARRAY_SIZE(omap44xx_dmm_slaves), |
135 | .mpu_irqs = omap44xx_dmm_irqs, | 135 | .mpu_irqs = omap44xx_dmm_irqs, |
136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
137 | }; | 136 | }; |
138 | 137 | ||
139 | /* | 138 | /* |
@@ -189,7 +188,6 @@ static struct omap_hwmod omap44xx_emif_fw_hwmod = { | |||
189 | }, | 188 | }, |
190 | .slaves = omap44xx_emif_fw_slaves, | 189 | .slaves = omap44xx_emif_fw_slaves, |
191 | .slaves_cnt = ARRAY_SIZE(omap44xx_emif_fw_slaves), | 190 | .slaves_cnt = ARRAY_SIZE(omap44xx_emif_fw_slaves), |
192 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
193 | }; | 191 | }; |
194 | 192 | ||
195 | /* | 193 | /* |
@@ -236,7 +234,6 @@ static struct omap_hwmod omap44xx_l3_instr_hwmod = { | |||
236 | }, | 234 | }, |
237 | .slaves = omap44xx_l3_instr_slaves, | 235 | .slaves = omap44xx_l3_instr_slaves, |
238 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_instr_slaves), | 236 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_instr_slaves), |
239 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
240 | }; | 237 | }; |
241 | 238 | ||
242 | /* l3_main_1 */ | 239 | /* l3_main_1 */ |
@@ -336,7 +333,6 @@ static struct omap_hwmod omap44xx_l3_main_1_hwmod = { | |||
336 | }, | 333 | }, |
337 | .slaves = omap44xx_l3_main_1_slaves, | 334 | .slaves = omap44xx_l3_main_1_slaves, |
338 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), | 335 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), |
339 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
340 | }; | 336 | }; |
341 | 337 | ||
342 | /* l3_main_2 */ | 338 | /* l3_main_2 */ |
@@ -438,7 +434,6 @@ static struct omap_hwmod omap44xx_l3_main_2_hwmod = { | |||
438 | }, | 434 | }, |
439 | .slaves = omap44xx_l3_main_2_slaves, | 435 | .slaves = omap44xx_l3_main_2_slaves, |
440 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_2_slaves), | 436 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_2_slaves), |
441 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
442 | }; | 437 | }; |
443 | 438 | ||
444 | /* l3_main_3 */ | 439 | /* l3_main_3 */ |
@@ -496,7 +491,6 @@ static struct omap_hwmod omap44xx_l3_main_3_hwmod = { | |||
496 | }, | 491 | }, |
497 | .slaves = omap44xx_l3_main_3_slaves, | 492 | .slaves = omap44xx_l3_main_3_slaves, |
498 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_3_slaves), | 493 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_3_slaves), |
499 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
500 | }; | 494 | }; |
501 | 495 | ||
502 | /* | 496 | /* |
@@ -559,7 +553,6 @@ static struct omap_hwmod omap44xx_l4_abe_hwmod = { | |||
559 | }, | 553 | }, |
560 | .slaves = omap44xx_l4_abe_slaves, | 554 | .slaves = omap44xx_l4_abe_slaves, |
561 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_abe_slaves), | 555 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_abe_slaves), |
562 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
563 | }; | 556 | }; |
564 | 557 | ||
565 | /* l4_cfg */ | 558 | /* l4_cfg */ |
@@ -588,7 +581,6 @@ static struct omap_hwmod omap44xx_l4_cfg_hwmod = { | |||
588 | }, | 581 | }, |
589 | .slaves = omap44xx_l4_cfg_slaves, | 582 | .slaves = omap44xx_l4_cfg_slaves, |
590 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_cfg_slaves), | 583 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_cfg_slaves), |
591 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
592 | }; | 584 | }; |
593 | 585 | ||
594 | /* l4_per */ | 586 | /* l4_per */ |
@@ -617,7 +609,6 @@ static struct omap_hwmod omap44xx_l4_per_hwmod = { | |||
617 | }, | 609 | }, |
618 | .slaves = omap44xx_l4_per_slaves, | 610 | .slaves = omap44xx_l4_per_slaves, |
619 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_per_slaves), | 611 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_per_slaves), |
620 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
621 | }; | 612 | }; |
622 | 613 | ||
623 | /* l4_wkup */ | 614 | /* l4_wkup */ |
@@ -646,7 +637,6 @@ static struct omap_hwmod omap44xx_l4_wkup_hwmod = { | |||
646 | }, | 637 | }, |
647 | .slaves = omap44xx_l4_wkup_slaves, | 638 | .slaves = omap44xx_l4_wkup_slaves, |
648 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_wkup_slaves), | 639 | .slaves_cnt = ARRAY_SIZE(omap44xx_l4_wkup_slaves), |
649 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
650 | }; | 640 | }; |
651 | 641 | ||
652 | /* | 642 | /* |
@@ -677,7 +667,6 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = { | |||
677 | .clkdm_name = "mpuss_clkdm", | 667 | .clkdm_name = "mpuss_clkdm", |
678 | .slaves = omap44xx_mpu_private_slaves, | 668 | .slaves = omap44xx_mpu_private_slaves, |
679 | .slaves_cnt = ARRAY_SIZE(omap44xx_mpu_private_slaves), | 669 | .slaves_cnt = ARRAY_SIZE(omap44xx_mpu_private_slaves), |
680 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
681 | }; | 670 | }; |
682 | 671 | ||
683 | /* | 672 | /* |
@@ -828,7 +817,6 @@ static struct omap_hwmod omap44xx_aess_hwmod = { | |||
828 | .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves), | 817 | .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves), |
829 | .masters = omap44xx_aess_masters, | 818 | .masters = omap44xx_aess_masters, |
830 | .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters), | 819 | .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters), |
831 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
832 | }; | 820 | }; |
833 | 821 | ||
834 | /* | 822 | /* |
@@ -856,7 +844,6 @@ static struct omap_hwmod omap44xx_bandgap_hwmod = { | |||
856 | }, | 844 | }, |
857 | .opt_clks = bandgap_opt_clks, | 845 | .opt_clks = bandgap_opt_clks, |
858 | .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks), | 846 | .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks), |
859 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
860 | }; | 847 | }; |
861 | 848 | ||
862 | /* | 849 | /* |
@@ -917,7 +904,6 @@ static struct omap_hwmod omap44xx_counter_32k_hwmod = { | |||
917 | }, | 904 | }, |
918 | .slaves = omap44xx_counter_32k_slaves, | 905 | .slaves = omap44xx_counter_32k_slaves, |
919 | .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves), | 906 | .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves), |
920 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
921 | }; | 907 | }; |
922 | 908 | ||
923 | /* | 909 | /* |
@@ -1005,7 +991,6 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = { | |||
1005 | .slaves_cnt = ARRAY_SIZE(omap44xx_dma_system_slaves), | 991 | .slaves_cnt = ARRAY_SIZE(omap44xx_dma_system_slaves), |
1006 | .masters = omap44xx_dma_system_masters, | 992 | .masters = omap44xx_dma_system_masters, |
1007 | .masters_cnt = ARRAY_SIZE(omap44xx_dma_system_masters), | 993 | .masters_cnt = ARRAY_SIZE(omap44xx_dma_system_masters), |
1008 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1009 | }; | 994 | }; |
1010 | 995 | ||
1011 | /* | 996 | /* |
@@ -1098,7 +1083,6 @@ static struct omap_hwmod omap44xx_dmic_hwmod = { | |||
1098 | }, | 1083 | }, |
1099 | .slaves = omap44xx_dmic_slaves, | 1084 | .slaves = omap44xx_dmic_slaves, |
1100 | .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves), | 1085 | .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves), |
1101 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1102 | }; | 1086 | }; |
1103 | 1087 | ||
1104 | /* | 1088 | /* |
@@ -1164,7 +1148,6 @@ static struct omap_hwmod omap44xx_dsp_c0_hwmod = { | |||
1164 | .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET, | 1148 | .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET, |
1165 | }, | 1149 | }, |
1166 | }, | 1150 | }, |
1167 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1168 | }; | 1151 | }; |
1169 | 1152 | ||
1170 | static struct omap_hwmod omap44xx_dsp_hwmod = { | 1153 | static struct omap_hwmod omap44xx_dsp_hwmod = { |
@@ -1187,7 +1170,6 @@ static struct omap_hwmod omap44xx_dsp_hwmod = { | |||
1187 | .slaves_cnt = ARRAY_SIZE(omap44xx_dsp_slaves), | 1170 | .slaves_cnt = ARRAY_SIZE(omap44xx_dsp_slaves), |
1188 | .masters = omap44xx_dsp_masters, | 1171 | .masters = omap44xx_dsp_masters, |
1189 | .masters_cnt = ARRAY_SIZE(omap44xx_dsp_masters), | 1172 | .masters_cnt = ARRAY_SIZE(omap44xx_dsp_masters), |
1190 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1191 | }; | 1173 | }; |
1192 | 1174 | ||
1193 | /* | 1175 | /* |
@@ -1278,7 +1260,6 @@ static struct omap_hwmod omap44xx_dss_hwmod = { | |||
1278 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves), | 1260 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves), |
1279 | .masters = omap44xx_dss_masters, | 1261 | .masters = omap44xx_dss_masters, |
1280 | .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters), | 1262 | .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters), |
1281 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1282 | }; | 1263 | }; |
1283 | 1264 | ||
1284 | /* | 1265 | /* |
@@ -1381,7 +1362,6 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = { | |||
1381 | .opt_clks_cnt = ARRAY_SIZE(dss_dispc_opt_clks), | 1362 | .opt_clks_cnt = ARRAY_SIZE(dss_dispc_opt_clks), |
1382 | .slaves = omap44xx_dss_dispc_slaves, | 1363 | .slaves = omap44xx_dss_dispc_slaves, |
1383 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves), | 1364 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves), |
1384 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1385 | }; | 1365 | }; |
1386 | 1366 | ||
1387 | /* | 1367 | /* |
@@ -1480,7 +1460,6 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = { | |||
1480 | .opt_clks_cnt = ARRAY_SIZE(dss_dsi1_opt_clks), | 1460 | .opt_clks_cnt = ARRAY_SIZE(dss_dsi1_opt_clks), |
1481 | .slaves = omap44xx_dss_dsi1_slaves, | 1461 | .slaves = omap44xx_dss_dsi1_slaves, |
1482 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves), | 1462 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves), |
1483 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1484 | }; | 1463 | }; |
1485 | 1464 | ||
1486 | /* dss_dsi2 */ | 1465 | /* dss_dsi2 */ |
@@ -1558,7 +1537,6 @@ static struct omap_hwmod omap44xx_dss_dsi2_hwmod = { | |||
1558 | .opt_clks_cnt = ARRAY_SIZE(dss_dsi2_opt_clks), | 1537 | .opt_clks_cnt = ARRAY_SIZE(dss_dsi2_opt_clks), |
1559 | .slaves = omap44xx_dss_dsi2_slaves, | 1538 | .slaves = omap44xx_dss_dsi2_slaves, |
1560 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves), | 1539 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves), |
1561 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1562 | }; | 1540 | }; |
1563 | 1541 | ||
1564 | /* | 1542 | /* |
@@ -1656,7 +1634,6 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = { | |||
1656 | .opt_clks_cnt = ARRAY_SIZE(dss_hdmi_opt_clks), | 1634 | .opt_clks_cnt = ARRAY_SIZE(dss_hdmi_opt_clks), |
1657 | .slaves = omap44xx_dss_hdmi_slaves, | 1635 | .slaves = omap44xx_dss_hdmi_slaves, |
1658 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves), | 1636 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves), |
1659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1660 | }; | 1637 | }; |
1661 | 1638 | ||
1662 | /* | 1639 | /* |
@@ -1748,7 +1725,6 @@ static struct omap_hwmod omap44xx_dss_rfbi_hwmod = { | |||
1748 | .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks), | 1725 | .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks), |
1749 | .slaves = omap44xx_dss_rfbi_slaves, | 1726 | .slaves = omap44xx_dss_rfbi_slaves, |
1750 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves), | 1727 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves), |
1751 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1752 | }; | 1728 | }; |
1753 | 1729 | ||
1754 | /* | 1730 | /* |
@@ -1817,7 +1793,6 @@ static struct omap_hwmod omap44xx_dss_venc_hwmod = { | |||
1817 | }, | 1793 | }, |
1818 | .slaves = omap44xx_dss_venc_slaves, | 1794 | .slaves = omap44xx_dss_venc_slaves, |
1819 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves), | 1795 | .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves), |
1820 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1821 | }; | 1796 | }; |
1822 | 1797 | ||
1823 | /* | 1798 | /* |
@@ -1901,7 +1876,6 @@ static struct omap_hwmod omap44xx_gpio1_hwmod = { | |||
1901 | .dev_attr = &gpio_dev_attr, | 1876 | .dev_attr = &gpio_dev_attr, |
1902 | .slaves = omap44xx_gpio1_slaves, | 1877 | .slaves = omap44xx_gpio1_slaves, |
1903 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves), | 1878 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves), |
1904 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1905 | }; | 1879 | }; |
1906 | 1880 | ||
1907 | /* gpio2 */ | 1881 | /* gpio2 */ |
@@ -1957,7 +1931,6 @@ static struct omap_hwmod omap44xx_gpio2_hwmod = { | |||
1957 | .dev_attr = &gpio_dev_attr, | 1931 | .dev_attr = &gpio_dev_attr, |
1958 | .slaves = omap44xx_gpio2_slaves, | 1932 | .slaves = omap44xx_gpio2_slaves, |
1959 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves), | 1933 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves), |
1960 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
1961 | }; | 1934 | }; |
1962 | 1935 | ||
1963 | /* gpio3 */ | 1936 | /* gpio3 */ |
@@ -2013,7 +1986,6 @@ static struct omap_hwmod omap44xx_gpio3_hwmod = { | |||
2013 | .dev_attr = &gpio_dev_attr, | 1986 | .dev_attr = &gpio_dev_attr, |
2014 | .slaves = omap44xx_gpio3_slaves, | 1987 | .slaves = omap44xx_gpio3_slaves, |
2015 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves), | 1988 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves), |
2016 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2017 | }; | 1989 | }; |
2018 | 1990 | ||
2019 | /* gpio4 */ | 1991 | /* gpio4 */ |
@@ -2069,7 +2041,6 @@ static struct omap_hwmod omap44xx_gpio4_hwmod = { | |||
2069 | .dev_attr = &gpio_dev_attr, | 2041 | .dev_attr = &gpio_dev_attr, |
2070 | .slaves = omap44xx_gpio4_slaves, | 2042 | .slaves = omap44xx_gpio4_slaves, |
2071 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves), | 2043 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves), |
2072 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2073 | }; | 2044 | }; |
2074 | 2045 | ||
2075 | /* gpio5 */ | 2046 | /* gpio5 */ |
@@ -2125,7 +2096,6 @@ static struct omap_hwmod omap44xx_gpio5_hwmod = { | |||
2125 | .dev_attr = &gpio_dev_attr, | 2096 | .dev_attr = &gpio_dev_attr, |
2126 | .slaves = omap44xx_gpio5_slaves, | 2097 | .slaves = omap44xx_gpio5_slaves, |
2127 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves), | 2098 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves), |
2128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2129 | }; | 2099 | }; |
2130 | 2100 | ||
2131 | /* gpio6 */ | 2101 | /* gpio6 */ |
@@ -2181,7 +2151,6 @@ static struct omap_hwmod omap44xx_gpio6_hwmod = { | |||
2181 | .dev_attr = &gpio_dev_attr, | 2151 | .dev_attr = &gpio_dev_attr, |
2182 | .slaves = omap44xx_gpio6_slaves, | 2152 | .slaves = omap44xx_gpio6_slaves, |
2183 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves), | 2153 | .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves), |
2184 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2185 | }; | 2154 | }; |
2186 | 2155 | ||
2187 | /* | 2156 | /* |
@@ -2261,7 +2230,6 @@ static struct omap_hwmod omap44xx_hsi_hwmod = { | |||
2261 | .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves), | 2230 | .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves), |
2262 | .masters = omap44xx_hsi_masters, | 2231 | .masters = omap44xx_hsi_masters, |
2263 | .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters), | 2232 | .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters), |
2264 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2265 | }; | 2233 | }; |
2266 | 2234 | ||
2267 | /* | 2235 | /* |
@@ -2345,7 +2313,6 @@ static struct omap_hwmod omap44xx_i2c1_hwmod = { | |||
2345 | .slaves = omap44xx_i2c1_slaves, | 2313 | .slaves = omap44xx_i2c1_slaves, |
2346 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c1_slaves), | 2314 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c1_slaves), |
2347 | .dev_attr = &i2c_dev_attr, | 2315 | .dev_attr = &i2c_dev_attr, |
2348 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2349 | }; | 2316 | }; |
2350 | 2317 | ||
2351 | /* i2c2 */ | 2318 | /* i2c2 */ |
@@ -2402,7 +2369,6 @@ static struct omap_hwmod omap44xx_i2c2_hwmod = { | |||
2402 | .slaves = omap44xx_i2c2_slaves, | 2369 | .slaves = omap44xx_i2c2_slaves, |
2403 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c2_slaves), | 2370 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c2_slaves), |
2404 | .dev_attr = &i2c_dev_attr, | 2371 | .dev_attr = &i2c_dev_attr, |
2405 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2406 | }; | 2372 | }; |
2407 | 2373 | ||
2408 | /* i2c3 */ | 2374 | /* i2c3 */ |
@@ -2459,7 +2425,6 @@ static struct omap_hwmod omap44xx_i2c3_hwmod = { | |||
2459 | .slaves = omap44xx_i2c3_slaves, | 2425 | .slaves = omap44xx_i2c3_slaves, |
2460 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c3_slaves), | 2426 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c3_slaves), |
2461 | .dev_attr = &i2c_dev_attr, | 2427 | .dev_attr = &i2c_dev_attr, |
2462 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2463 | }; | 2428 | }; |
2464 | 2429 | ||
2465 | /* i2c4 */ | 2430 | /* i2c4 */ |
@@ -2516,7 +2481,6 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = { | |||
2516 | .slaves = omap44xx_i2c4_slaves, | 2481 | .slaves = omap44xx_i2c4_slaves, |
2517 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c4_slaves), | 2482 | .slaves_cnt = ARRAY_SIZE(omap44xx_i2c4_slaves), |
2518 | .dev_attr = &i2c_dev_attr, | 2483 | .dev_attr = &i2c_dev_attr, |
2519 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2520 | }; | 2484 | }; |
2521 | 2485 | ||
2522 | /* | 2486 | /* |
@@ -2577,7 +2541,6 @@ static struct omap_hwmod omap44xx_ipu_c0_hwmod = { | |||
2577 | .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET, | 2541 | .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET, |
2578 | }, | 2542 | }, |
2579 | }, | 2543 | }, |
2580 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2581 | }; | 2544 | }; |
2582 | 2545 | ||
2583 | /* Pseudo hwmod for reset control purpose only */ | 2546 | /* Pseudo hwmod for reset control purpose only */ |
@@ -2593,7 +2556,6 @@ static struct omap_hwmod omap44xx_ipu_c1_hwmod = { | |||
2593 | .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET, | 2556 | .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET, |
2594 | }, | 2557 | }, |
2595 | }, | 2558 | }, |
2596 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2597 | }; | 2559 | }; |
2598 | 2560 | ||
2599 | static struct omap_hwmod omap44xx_ipu_hwmod = { | 2561 | static struct omap_hwmod omap44xx_ipu_hwmod = { |
@@ -2616,7 +2578,6 @@ static struct omap_hwmod omap44xx_ipu_hwmod = { | |||
2616 | .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves), | 2578 | .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves), |
2617 | .masters = omap44xx_ipu_masters, | 2579 | .masters = omap44xx_ipu_masters, |
2618 | .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters), | 2580 | .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters), |
2619 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2620 | }; | 2581 | }; |
2621 | 2582 | ||
2622 | /* | 2583 | /* |
@@ -2706,7 +2667,6 @@ static struct omap_hwmod omap44xx_iss_hwmod = { | |||
2706 | .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves), | 2667 | .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves), |
2707 | .masters = omap44xx_iss_masters, | 2668 | .masters = omap44xx_iss_masters, |
2708 | .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters), | 2669 | .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters), |
2709 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2710 | }; | 2670 | }; |
2711 | 2671 | ||
2712 | /* | 2672 | /* |
@@ -2781,7 +2741,6 @@ static struct omap_hwmod omap44xx_iva_seq0_hwmod = { | |||
2781 | .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET, | 2741 | .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET, |
2782 | }, | 2742 | }, |
2783 | }, | 2743 | }, |
2784 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2785 | }; | 2744 | }; |
2786 | 2745 | ||
2787 | /* Pseudo hwmod for reset control purpose only */ | 2746 | /* Pseudo hwmod for reset control purpose only */ |
@@ -2797,7 +2756,6 @@ static struct omap_hwmod omap44xx_iva_seq1_hwmod = { | |||
2797 | .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET, | 2756 | .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET, |
2798 | }, | 2757 | }, |
2799 | }, | 2758 | }, |
2800 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2801 | }; | 2759 | }; |
2802 | 2760 | ||
2803 | static struct omap_hwmod omap44xx_iva_hwmod = { | 2761 | static struct omap_hwmod omap44xx_iva_hwmod = { |
@@ -2820,7 +2778,6 @@ static struct omap_hwmod omap44xx_iva_hwmod = { | |||
2820 | .slaves_cnt = ARRAY_SIZE(omap44xx_iva_slaves), | 2778 | .slaves_cnt = ARRAY_SIZE(omap44xx_iva_slaves), |
2821 | .masters = omap44xx_iva_masters, | 2779 | .masters = omap44xx_iva_masters, |
2822 | .masters_cnt = ARRAY_SIZE(omap44xx_iva_masters), | 2780 | .masters_cnt = ARRAY_SIZE(omap44xx_iva_masters), |
2823 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2824 | }; | 2781 | }; |
2825 | 2782 | ||
2826 | /* | 2783 | /* |
@@ -2890,7 +2847,6 @@ static struct omap_hwmod omap44xx_kbd_hwmod = { | |||
2890 | }, | 2847 | }, |
2891 | .slaves = omap44xx_kbd_slaves, | 2848 | .slaves = omap44xx_kbd_slaves, |
2892 | .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves), | 2849 | .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves), |
2893 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2894 | }; | 2850 | }; |
2895 | 2851 | ||
2896 | /* | 2852 | /* |
@@ -2956,7 +2912,6 @@ static struct omap_hwmod omap44xx_mailbox_hwmod = { | |||
2956 | }, | 2912 | }, |
2957 | .slaves = omap44xx_mailbox_slaves, | 2913 | .slaves = omap44xx_mailbox_slaves, |
2958 | .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves), | 2914 | .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves), |
2959 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
2960 | }; | 2915 | }; |
2961 | 2916 | ||
2962 | /* | 2917 | /* |
@@ -3051,7 +3006,6 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = { | |||
3051 | }, | 3006 | }, |
3052 | .slaves = omap44xx_mcbsp1_slaves, | 3007 | .slaves = omap44xx_mcbsp1_slaves, |
3053 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), | 3008 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), |
3054 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3055 | }; | 3009 | }; |
3056 | 3010 | ||
3057 | /* mcbsp2 */ | 3011 | /* mcbsp2 */ |
@@ -3127,7 +3081,6 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = { | |||
3127 | }, | 3081 | }, |
3128 | .slaves = omap44xx_mcbsp2_slaves, | 3082 | .slaves = omap44xx_mcbsp2_slaves, |
3129 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), | 3083 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), |
3130 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3131 | }; | 3084 | }; |
3132 | 3085 | ||
3133 | /* mcbsp3 */ | 3086 | /* mcbsp3 */ |
@@ -3203,7 +3156,6 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = { | |||
3203 | }, | 3156 | }, |
3204 | .slaves = omap44xx_mcbsp3_slaves, | 3157 | .slaves = omap44xx_mcbsp3_slaves, |
3205 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), | 3158 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), |
3206 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3207 | }; | 3159 | }; |
3208 | 3160 | ||
3209 | /* mcbsp4 */ | 3161 | /* mcbsp4 */ |
@@ -3258,7 +3210,6 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = { | |||
3258 | }, | 3210 | }, |
3259 | .slaves = omap44xx_mcbsp4_slaves, | 3211 | .slaves = omap44xx_mcbsp4_slaves, |
3260 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), | 3212 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), |
3261 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3262 | }; | 3213 | }; |
3263 | 3214 | ||
3264 | /* | 3215 | /* |
@@ -3353,7 +3304,6 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = { | |||
3353 | }, | 3304 | }, |
3354 | .slaves = omap44xx_mcpdm_slaves, | 3305 | .slaves = omap44xx_mcpdm_slaves, |
3355 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves), | 3306 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves), |
3356 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3357 | }; | 3307 | }; |
3358 | 3308 | ||
3359 | /* | 3309 | /* |
@@ -3442,7 +3392,6 @@ static struct omap_hwmod omap44xx_mcspi1_hwmod = { | |||
3442 | .dev_attr = &mcspi1_dev_attr, | 3392 | .dev_attr = &mcspi1_dev_attr, |
3443 | .slaves = omap44xx_mcspi1_slaves, | 3393 | .slaves = omap44xx_mcspi1_slaves, |
3444 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves), | 3394 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves), |
3445 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3446 | }; | 3395 | }; |
3447 | 3396 | ||
3448 | /* mcspi2 */ | 3397 | /* mcspi2 */ |
@@ -3505,7 +3454,6 @@ static struct omap_hwmod omap44xx_mcspi2_hwmod = { | |||
3505 | .dev_attr = &mcspi2_dev_attr, | 3454 | .dev_attr = &mcspi2_dev_attr, |
3506 | .slaves = omap44xx_mcspi2_slaves, | 3455 | .slaves = omap44xx_mcspi2_slaves, |
3507 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves), | 3456 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves), |
3508 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3509 | }; | 3457 | }; |
3510 | 3458 | ||
3511 | /* mcspi3 */ | 3459 | /* mcspi3 */ |
@@ -3568,7 +3516,6 @@ static struct omap_hwmod omap44xx_mcspi3_hwmod = { | |||
3568 | .dev_attr = &mcspi3_dev_attr, | 3516 | .dev_attr = &mcspi3_dev_attr, |
3569 | .slaves = omap44xx_mcspi3_slaves, | 3517 | .slaves = omap44xx_mcspi3_slaves, |
3570 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves), | 3518 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves), |
3571 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3572 | }; | 3519 | }; |
3573 | 3520 | ||
3574 | /* mcspi4 */ | 3521 | /* mcspi4 */ |
@@ -3629,7 +3576,6 @@ static struct omap_hwmod omap44xx_mcspi4_hwmod = { | |||
3629 | .dev_attr = &mcspi4_dev_attr, | 3576 | .dev_attr = &mcspi4_dev_attr, |
3630 | .slaves = omap44xx_mcspi4_slaves, | 3577 | .slaves = omap44xx_mcspi4_slaves, |
3631 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves), | 3578 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves), |
3632 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3633 | }; | 3579 | }; |
3634 | 3580 | ||
3635 | /* | 3581 | /* |
@@ -3718,7 +3664,6 @@ static struct omap_hwmod omap44xx_mmc1_hwmod = { | |||
3718 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves), | 3664 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves), |
3719 | .masters = omap44xx_mmc1_masters, | 3665 | .masters = omap44xx_mmc1_masters, |
3720 | .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters), | 3666 | .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters), |
3721 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3722 | }; | 3667 | }; |
3723 | 3668 | ||
3724 | /* mmc2 */ | 3669 | /* mmc2 */ |
@@ -3779,7 +3724,6 @@ static struct omap_hwmod omap44xx_mmc2_hwmod = { | |||
3779 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves), | 3724 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves), |
3780 | .masters = omap44xx_mmc2_masters, | 3725 | .masters = omap44xx_mmc2_masters, |
3781 | .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters), | 3726 | .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters), |
3782 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3783 | }; | 3727 | }; |
3784 | 3728 | ||
3785 | /* mmc3 */ | 3729 | /* mmc3 */ |
@@ -3834,7 +3778,6 @@ static struct omap_hwmod omap44xx_mmc3_hwmod = { | |||
3834 | }, | 3778 | }, |
3835 | .slaves = omap44xx_mmc3_slaves, | 3779 | .slaves = omap44xx_mmc3_slaves, |
3836 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves), | 3780 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves), |
3837 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3838 | }; | 3781 | }; |
3839 | 3782 | ||
3840 | /* mmc4 */ | 3783 | /* mmc4 */ |
@@ -3890,7 +3833,6 @@ static struct omap_hwmod omap44xx_mmc4_hwmod = { | |||
3890 | }, | 3833 | }, |
3891 | .slaves = omap44xx_mmc4_slaves, | 3834 | .slaves = omap44xx_mmc4_slaves, |
3892 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves), | 3835 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves), |
3893 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3894 | }; | 3836 | }; |
3895 | 3837 | ||
3896 | /* mmc5 */ | 3838 | /* mmc5 */ |
@@ -3945,7 +3887,6 @@ static struct omap_hwmod omap44xx_mmc5_hwmod = { | |||
3945 | }, | 3887 | }, |
3946 | .slaves = omap44xx_mmc5_slaves, | 3888 | .slaves = omap44xx_mmc5_slaves, |
3947 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves), | 3889 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves), |
3948 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3949 | }; | 3890 | }; |
3950 | 3891 | ||
3951 | /* | 3892 | /* |
@@ -3987,7 +3928,6 @@ static struct omap_hwmod omap44xx_mpu_hwmod = { | |||
3987 | }, | 3928 | }, |
3988 | .masters = omap44xx_mpu_masters, | 3929 | .masters = omap44xx_mpu_masters, |
3989 | .masters_cnt = ARRAY_SIZE(omap44xx_mpu_masters), | 3930 | .masters_cnt = ARRAY_SIZE(omap44xx_mpu_masters), |
3990 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
3991 | }; | 3931 | }; |
3992 | 3932 | ||
3993 | /* | 3933 | /* |
@@ -4063,7 +4003,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { | |||
4063 | }, | 4003 | }, |
4064 | .slaves = omap44xx_smartreflex_core_slaves, | 4004 | .slaves = omap44xx_smartreflex_core_slaves, |
4065 | .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves), | 4005 | .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves), |
4066 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4067 | }; | 4006 | }; |
4068 | 4007 | ||
4069 | /* smartreflex_iva */ | 4008 | /* smartreflex_iva */ |
@@ -4112,7 +4051,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { | |||
4112 | }, | 4051 | }, |
4113 | .slaves = omap44xx_smartreflex_iva_slaves, | 4052 | .slaves = omap44xx_smartreflex_iva_slaves, |
4114 | .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves), | 4053 | .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves), |
4115 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4116 | }; | 4054 | }; |
4117 | 4055 | ||
4118 | /* smartreflex_mpu */ | 4056 | /* smartreflex_mpu */ |
@@ -4161,7 +4099,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { | |||
4161 | }, | 4099 | }, |
4162 | .slaves = omap44xx_smartreflex_mpu_slaves, | 4100 | .slaves = omap44xx_smartreflex_mpu_slaves, |
4163 | .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves), | 4101 | .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves), |
4164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4165 | }; | 4102 | }; |
4166 | 4103 | ||
4167 | /* | 4104 | /* |
@@ -4224,7 +4161,6 @@ static struct omap_hwmod omap44xx_spinlock_hwmod = { | |||
4224 | }, | 4161 | }, |
4225 | .slaves = omap44xx_spinlock_slaves, | 4162 | .slaves = omap44xx_spinlock_slaves, |
4226 | .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves), | 4163 | .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves), |
4227 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4228 | }; | 4164 | }; |
4229 | 4165 | ||
4230 | /* | 4166 | /* |
@@ -4310,7 +4246,6 @@ static struct omap_hwmod omap44xx_timer1_hwmod = { | |||
4310 | }, | 4246 | }, |
4311 | .slaves = omap44xx_timer1_slaves, | 4247 | .slaves = omap44xx_timer1_slaves, |
4312 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves), | 4248 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves), |
4313 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4314 | }; | 4249 | }; |
4315 | 4250 | ||
4316 | /* timer2 */ | 4251 | /* timer2 */ |
@@ -4358,7 +4293,6 @@ static struct omap_hwmod omap44xx_timer2_hwmod = { | |||
4358 | }, | 4293 | }, |
4359 | .slaves = omap44xx_timer2_slaves, | 4294 | .slaves = omap44xx_timer2_slaves, |
4360 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves), | 4295 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves), |
4361 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4362 | }; | 4296 | }; |
4363 | 4297 | ||
4364 | /* timer3 */ | 4298 | /* timer3 */ |
@@ -4406,7 +4340,6 @@ static struct omap_hwmod omap44xx_timer3_hwmod = { | |||
4406 | }, | 4340 | }, |
4407 | .slaves = omap44xx_timer3_slaves, | 4341 | .slaves = omap44xx_timer3_slaves, |
4408 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves), | 4342 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves), |
4409 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4410 | }; | 4343 | }; |
4411 | 4344 | ||
4412 | /* timer4 */ | 4345 | /* timer4 */ |
@@ -4454,7 +4387,6 @@ static struct omap_hwmod omap44xx_timer4_hwmod = { | |||
4454 | }, | 4387 | }, |
4455 | .slaves = omap44xx_timer4_slaves, | 4388 | .slaves = omap44xx_timer4_slaves, |
4456 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves), | 4389 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves), |
4457 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4458 | }; | 4390 | }; |
4459 | 4391 | ||
4460 | /* timer5 */ | 4392 | /* timer5 */ |
@@ -4521,7 +4453,6 @@ static struct omap_hwmod omap44xx_timer5_hwmod = { | |||
4521 | }, | 4453 | }, |
4522 | .slaves = omap44xx_timer5_slaves, | 4454 | .slaves = omap44xx_timer5_slaves, |
4523 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves), | 4455 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves), |
4524 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4525 | }; | 4456 | }; |
4526 | 4457 | ||
4527 | /* timer6 */ | 4458 | /* timer6 */ |
@@ -4589,7 +4520,6 @@ static struct omap_hwmod omap44xx_timer6_hwmod = { | |||
4589 | }, | 4520 | }, |
4590 | .slaves = omap44xx_timer6_slaves, | 4521 | .slaves = omap44xx_timer6_slaves, |
4591 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves), | 4522 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves), |
4592 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4593 | }; | 4523 | }; |
4594 | 4524 | ||
4595 | /* timer7 */ | 4525 | /* timer7 */ |
@@ -4656,7 +4586,6 @@ static struct omap_hwmod omap44xx_timer7_hwmod = { | |||
4656 | }, | 4586 | }, |
4657 | .slaves = omap44xx_timer7_slaves, | 4587 | .slaves = omap44xx_timer7_slaves, |
4658 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves), | 4588 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves), |
4659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4660 | }; | 4589 | }; |
4661 | 4590 | ||
4662 | /* timer8 */ | 4591 | /* timer8 */ |
@@ -4723,7 +4652,6 @@ static struct omap_hwmod omap44xx_timer8_hwmod = { | |||
4723 | }, | 4652 | }, |
4724 | .slaves = omap44xx_timer8_slaves, | 4653 | .slaves = omap44xx_timer8_slaves, |
4725 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves), | 4654 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves), |
4726 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4727 | }; | 4655 | }; |
4728 | 4656 | ||
4729 | /* timer9 */ | 4657 | /* timer9 */ |
@@ -4771,7 +4699,6 @@ static struct omap_hwmod omap44xx_timer9_hwmod = { | |||
4771 | }, | 4699 | }, |
4772 | .slaves = omap44xx_timer9_slaves, | 4700 | .slaves = omap44xx_timer9_slaves, |
4773 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves), | 4701 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves), |
4774 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4775 | }; | 4702 | }; |
4776 | 4703 | ||
4777 | /* timer10 */ | 4704 | /* timer10 */ |
@@ -4819,7 +4746,6 @@ static struct omap_hwmod omap44xx_timer10_hwmod = { | |||
4819 | }, | 4746 | }, |
4820 | .slaves = omap44xx_timer10_slaves, | 4747 | .slaves = omap44xx_timer10_slaves, |
4821 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves), | 4748 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves), |
4822 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4823 | }; | 4749 | }; |
4824 | 4750 | ||
4825 | /* timer11 */ | 4751 | /* timer11 */ |
@@ -4867,7 +4793,6 @@ static struct omap_hwmod omap44xx_timer11_hwmod = { | |||
4867 | }, | 4793 | }, |
4868 | .slaves = omap44xx_timer11_slaves, | 4794 | .slaves = omap44xx_timer11_slaves, |
4869 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves), | 4795 | .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves), |
4870 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4871 | }; | 4796 | }; |
4872 | 4797 | ||
4873 | /* | 4798 | /* |
@@ -4944,7 +4869,6 @@ static struct omap_hwmod omap44xx_uart1_hwmod = { | |||
4944 | }, | 4869 | }, |
4945 | .slaves = omap44xx_uart1_slaves, | 4870 | .slaves = omap44xx_uart1_slaves, |
4946 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart1_slaves), | 4871 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart1_slaves), |
4947 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
4948 | }; | 4872 | }; |
4949 | 4873 | ||
4950 | /* uart2 */ | 4874 | /* uart2 */ |
@@ -4999,7 +4923,6 @@ static struct omap_hwmod omap44xx_uart2_hwmod = { | |||
4999 | }, | 4923 | }, |
5000 | .slaves = omap44xx_uart2_slaves, | 4924 | .slaves = omap44xx_uart2_slaves, |
5001 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart2_slaves), | 4925 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart2_slaves), |
5002 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
5003 | }; | 4926 | }; |
5004 | 4927 | ||
5005 | /* uart3 */ | 4928 | /* uart3 */ |
@@ -5055,7 +4978,6 @@ static struct omap_hwmod omap44xx_uart3_hwmod = { | |||
5055 | }, | 4978 | }, |
5056 | .slaves = omap44xx_uart3_slaves, | 4979 | .slaves = omap44xx_uart3_slaves, |
5057 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart3_slaves), | 4980 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart3_slaves), |
5058 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
5059 | }; | 4981 | }; |
5060 | 4982 | ||
5061 | /* uart4 */ | 4983 | /* uart4 */ |
@@ -5110,7 +5032,6 @@ static struct omap_hwmod omap44xx_uart4_hwmod = { | |||
5110 | }, | 5032 | }, |
5111 | .slaves = omap44xx_uart4_slaves, | 5033 | .slaves = omap44xx_uart4_slaves, |
5112 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart4_slaves), | 5034 | .slaves_cnt = ARRAY_SIZE(omap44xx_uart4_slaves), |
5113 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
5114 | }; | 5035 | }; |
5115 | 5036 | ||
5116 | /* | 5037 | /* |
@@ -5195,7 +5116,6 @@ static struct omap_hwmod omap44xx_usb_otg_hs_hwmod = { | |||
5195 | .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves), | 5116 | .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves), |
5196 | .masters = omap44xx_usb_otg_hs_masters, | 5117 | .masters = omap44xx_usb_otg_hs_masters, |
5197 | .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters), | 5118 | .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters), |
5198 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
5199 | }; | 5119 | }; |
5200 | 5120 | ||
5201 | /* | 5121 | /* |
@@ -5266,7 +5186,6 @@ static struct omap_hwmod omap44xx_wd_timer2_hwmod = { | |||
5266 | }, | 5186 | }, |
5267 | .slaves = omap44xx_wd_timer2_slaves, | 5187 | .slaves = omap44xx_wd_timer2_slaves, |
5268 | .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves), | 5188 | .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves), |
5269 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
5270 | }; | 5189 | }; |
5271 | 5190 | ||
5272 | /* wd_timer3 */ | 5191 | /* wd_timer3 */ |
@@ -5333,7 +5252,6 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = { | |||
5333 | }, | 5252 | }, |
5334 | .slaves = omap44xx_wd_timer3_slaves, | 5253 | .slaves = omap44xx_wd_timer3_slaves, |
5335 | .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves), | 5254 | .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves), |
5336 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
5337 | }; | 5255 | }; |
5338 | 5256 | ||
5339 | static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | 5257 | static __initdata struct omap_hwmod *omap44xx_hwmods[] = { |
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index 07d6140baa9d..f515a1a056d5 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c | |||
@@ -42,8 +42,11 @@ | |||
42 | 42 | ||
43 | #define OMAP4_SRI2C_SLAVE_ADDR 0x12 | 43 | #define OMAP4_SRI2C_SLAVE_ADDR 0x12 |
44 | #define OMAP4_VDD_MPU_SR_VOLT_REG 0x55 | 44 | #define OMAP4_VDD_MPU_SR_VOLT_REG 0x55 |
45 | #define OMAP4_VDD_MPU_SR_CMD_REG 0x56 | ||
45 | #define OMAP4_VDD_IVA_SR_VOLT_REG 0x5B | 46 | #define OMAP4_VDD_IVA_SR_VOLT_REG 0x5B |
47 | #define OMAP4_VDD_IVA_SR_CMD_REG 0x5C | ||
46 | #define OMAP4_VDD_CORE_SR_VOLT_REG 0x61 | 48 | #define OMAP4_VDD_CORE_SR_VOLT_REG 0x61 |
49 | #define OMAP4_VDD_CORE_SR_CMD_REG 0x62 | ||
47 | 50 | ||
48 | #define OMAP4_VP_CONFIG_ERROROFFSET 0x00 | 51 | #define OMAP4_VP_CONFIG_ERROROFFSET 0x00 |
49 | #define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01 | 52 | #define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01 |
@@ -95,6 +98,8 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel) | |||
95 | is_offset_valid = true; | 98 | is_offset_valid = true; |
96 | } | 99 | } |
97 | 100 | ||
101 | if (!vsel) | ||
102 | return 0; | ||
98 | /* | 103 | /* |
99 | * There is no specific formula for voltage to vsel | 104 | * There is no specific formula for voltage to vsel |
100 | * conversion above 1.3V. There are special hardcoded | 105 | * conversion above 1.3V. There are special hardcoded |
@@ -106,9 +111,9 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel) | |||
106 | return 1350000; | 111 | return 1350000; |
107 | 112 | ||
108 | if (smps_offset & 0x8) | 113 | if (smps_offset & 0x8) |
109 | return ((((vsel - 1) * 125) + 7000)) * 100; | 114 | return ((((vsel - 1) * 1266) + 70900)) * 10; |
110 | else | 115 | else |
111 | return ((((vsel - 1) * 125) + 6000)) * 100; | 116 | return ((((vsel - 1) * 1266) + 60770)) * 10; |
112 | } | 117 | } |
113 | 118 | ||
114 | static u8 twl6030_uv_to_vsel(unsigned long uv) | 119 | static u8 twl6030_uv_to_vsel(unsigned long uv) |
@@ -127,6 +132,8 @@ static u8 twl6030_uv_to_vsel(unsigned long uv) | |||
127 | is_offset_valid = true; | 132 | is_offset_valid = true; |
128 | } | 133 | } |
129 | 134 | ||
135 | if (!uv) | ||
136 | return 0x00; | ||
130 | /* | 137 | /* |
131 | * There is no specific formula for voltage to vsel | 138 | * There is no specific formula for voltage to vsel |
132 | * conversion above 1.3V. There are special hardcoded | 139 | * conversion above 1.3V. There are special hardcoded |
@@ -134,16 +141,21 @@ static u8 twl6030_uv_to_vsel(unsigned long uv) | |||
134 | * hardcoding only for 1.35 V which is used for 1GH OPP for | 141 | * hardcoding only for 1.35 V which is used for 1GH OPP for |
135 | * OMAP4430. | 142 | * OMAP4430. |
136 | */ | 143 | */ |
137 | if (uv == 1350000) | 144 | if (uv > twl6030_vsel_to_uv(0x39)) { |
145 | if (uv == 1350000) | ||
146 | return 0x3A; | ||
147 | pr_err("%s:OUT OF RANGE! non mapped vsel for %ld Vs max %ld\n", | ||
148 | __func__, uv, twl6030_vsel_to_uv(0x39)); | ||
138 | return 0x3A; | 149 | return 0x3A; |
150 | } | ||
139 | 151 | ||
140 | if (smps_offset & 0x8) | 152 | if (smps_offset & 0x8) |
141 | return DIV_ROUND_UP(uv - 700000, 12500) + 1; | 153 | return DIV_ROUND_UP(uv - 709000, 12660) + 1; |
142 | else | 154 | else |
143 | return DIV_ROUND_UP(uv - 600000, 12500) + 1; | 155 | return DIV_ROUND_UP(uv - 607700, 12660) + 1; |
144 | } | 156 | } |
145 | 157 | ||
146 | static struct omap_volt_pmic_info omap3_mpu_volt_info = { | 158 | static struct omap_voltdm_pmic omap3_mpu_pmic = { |
147 | .slew_rate = 4000, | 159 | .slew_rate = 4000, |
148 | .step_size = 12500, | 160 | .step_size = 12500, |
149 | .on_volt = 1200000, | 161 | .on_volt = 1200000, |
@@ -158,12 +170,13 @@ static struct omap_volt_pmic_info omap3_mpu_volt_info = { | |||
158 | .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX, | 170 | .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX, |
159 | .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, | 171 | .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, |
160 | .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, | 172 | .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, |
161 | .pmic_reg = OMAP3_VDD_MPU_SR_CONTROL_REG, | 173 | .volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG, |
174 | .i2c_high_speed = true, | ||
162 | .vsel_to_uv = twl4030_vsel_to_uv, | 175 | .vsel_to_uv = twl4030_vsel_to_uv, |
163 | .uv_to_vsel = twl4030_uv_to_vsel, | 176 | .uv_to_vsel = twl4030_uv_to_vsel, |
164 | }; | 177 | }; |
165 | 178 | ||
166 | static struct omap_volt_pmic_info omap3_core_volt_info = { | 179 | static struct omap_voltdm_pmic omap3_core_pmic = { |
167 | .slew_rate = 4000, | 180 | .slew_rate = 4000, |
168 | .step_size = 12500, | 181 | .step_size = 12500, |
169 | .on_volt = 1200000, | 182 | .on_volt = 1200000, |
@@ -178,18 +191,19 @@ static struct omap_volt_pmic_info omap3_core_volt_info = { | |||
178 | .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX, | 191 | .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX, |
179 | .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, | 192 | .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, |
180 | .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, | 193 | .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, |
181 | .pmic_reg = OMAP3_VDD_CORE_SR_CONTROL_REG, | 194 | .volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG, |
195 | .i2c_high_speed = true, | ||
182 | .vsel_to_uv = twl4030_vsel_to_uv, | 196 | .vsel_to_uv = twl4030_vsel_to_uv, |
183 | .uv_to_vsel = twl4030_uv_to_vsel, | 197 | .uv_to_vsel = twl4030_uv_to_vsel, |
184 | }; | 198 | }; |
185 | 199 | ||
186 | static struct omap_volt_pmic_info omap4_mpu_volt_info = { | 200 | static struct omap_voltdm_pmic omap4_mpu_pmic = { |
187 | .slew_rate = 4000, | 201 | .slew_rate = 4000, |
188 | .step_size = 12500, | 202 | .step_size = 12660, |
189 | .on_volt = 1350000, | 203 | .on_volt = 1375000, |
190 | .onlp_volt = 1350000, | 204 | .onlp_volt = 1375000, |
191 | .ret_volt = 837500, | 205 | .ret_volt = 830000, |
192 | .off_volt = 600000, | 206 | .off_volt = 0, |
193 | .volt_setup_time = 0, | 207 | .volt_setup_time = 0, |
194 | .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, | 208 | .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, |
195 | .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, | 209 | .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, |
@@ -198,18 +212,20 @@ static struct omap_volt_pmic_info omap4_mpu_volt_info = { | |||
198 | .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX, | 212 | .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX, |
199 | .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, | 213 | .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, |
200 | .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, | 214 | .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, |
201 | .pmic_reg = OMAP4_VDD_MPU_SR_VOLT_REG, | 215 | .volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG, |
216 | .cmd_reg_addr = OMAP4_VDD_MPU_SR_CMD_REG, | ||
217 | .i2c_high_speed = true, | ||
202 | .vsel_to_uv = twl6030_vsel_to_uv, | 218 | .vsel_to_uv = twl6030_vsel_to_uv, |
203 | .uv_to_vsel = twl6030_uv_to_vsel, | 219 | .uv_to_vsel = twl6030_uv_to_vsel, |
204 | }; | 220 | }; |
205 | 221 | ||
206 | static struct omap_volt_pmic_info omap4_iva_volt_info = { | 222 | static struct omap_voltdm_pmic omap4_iva_pmic = { |
207 | .slew_rate = 4000, | 223 | .slew_rate = 4000, |
208 | .step_size = 12500, | 224 | .step_size = 12660, |
209 | .on_volt = 1100000, | 225 | .on_volt = 1188000, |
210 | .onlp_volt = 1100000, | 226 | .onlp_volt = 1188000, |
211 | .ret_volt = 837500, | 227 | .ret_volt = 830000, |
212 | .off_volt = 600000, | 228 | .off_volt = 0, |
213 | .volt_setup_time = 0, | 229 | .volt_setup_time = 0, |
214 | .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, | 230 | .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, |
215 | .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, | 231 | .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, |
@@ -218,18 +234,20 @@ static struct omap_volt_pmic_info omap4_iva_volt_info = { | |||
218 | .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX, | 234 | .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX, |
219 | .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, | 235 | .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, |
220 | .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, | 236 | .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, |
221 | .pmic_reg = OMAP4_VDD_IVA_SR_VOLT_REG, | 237 | .volt_reg_addr = OMAP4_VDD_IVA_SR_VOLT_REG, |
238 | .cmd_reg_addr = OMAP4_VDD_IVA_SR_CMD_REG, | ||
239 | .i2c_high_speed = true, | ||
222 | .vsel_to_uv = twl6030_vsel_to_uv, | 240 | .vsel_to_uv = twl6030_vsel_to_uv, |
223 | .uv_to_vsel = twl6030_uv_to_vsel, | 241 | .uv_to_vsel = twl6030_uv_to_vsel, |
224 | }; | 242 | }; |
225 | 243 | ||
226 | static struct omap_volt_pmic_info omap4_core_volt_info = { | 244 | static struct omap_voltdm_pmic omap4_core_pmic = { |
227 | .slew_rate = 4000, | 245 | .slew_rate = 4000, |
228 | .step_size = 12500, | 246 | .step_size = 12660, |
229 | .on_volt = 1100000, | 247 | .on_volt = 1200000, |
230 | .onlp_volt = 1100000, | 248 | .onlp_volt = 1200000, |
231 | .ret_volt = 837500, | 249 | .ret_volt = 830000, |
232 | .off_volt = 600000, | 250 | .off_volt = 0, |
233 | .volt_setup_time = 0, | 251 | .volt_setup_time = 0, |
234 | .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, | 252 | .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, |
235 | .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, | 253 | .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, |
@@ -238,7 +256,8 @@ static struct omap_volt_pmic_info omap4_core_volt_info = { | |||
238 | .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, | 256 | .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, |
239 | .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, | 257 | .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, |
240 | .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, | 258 | .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, |
241 | .pmic_reg = OMAP4_VDD_CORE_SR_VOLT_REG, | 259 | .volt_reg_addr = OMAP4_VDD_CORE_SR_VOLT_REG, |
260 | .cmd_reg_addr = OMAP4_VDD_CORE_SR_CMD_REG, | ||
242 | .vsel_to_uv = twl6030_vsel_to_uv, | 261 | .vsel_to_uv = twl6030_vsel_to_uv, |
243 | .uv_to_vsel = twl6030_uv_to_vsel, | 262 | .uv_to_vsel = twl6030_uv_to_vsel, |
244 | }; | 263 | }; |
@@ -250,14 +269,14 @@ int __init omap4_twl_init(void) | |||
250 | if (!cpu_is_omap44xx()) | 269 | if (!cpu_is_omap44xx()) |
251 | return -ENODEV; | 270 | return -ENODEV; |
252 | 271 | ||
253 | voltdm = omap_voltage_domain_lookup("mpu"); | 272 | voltdm = voltdm_lookup("mpu"); |
254 | omap_voltage_register_pmic(voltdm, &omap4_mpu_volt_info); | 273 | omap_voltage_register_pmic(voltdm, &omap4_mpu_pmic); |
255 | 274 | ||
256 | voltdm = omap_voltage_domain_lookup("iva"); | 275 | voltdm = voltdm_lookup("iva"); |
257 | omap_voltage_register_pmic(voltdm, &omap4_iva_volt_info); | 276 | omap_voltage_register_pmic(voltdm, &omap4_iva_pmic); |
258 | 277 | ||
259 | voltdm = omap_voltage_domain_lookup("core"); | 278 | voltdm = voltdm_lookup("core"); |
260 | omap_voltage_register_pmic(voltdm, &omap4_core_volt_info); | 279 | omap_voltage_register_pmic(voltdm, &omap4_core_pmic); |
261 | 280 | ||
262 | return 0; | 281 | return 0; |
263 | } | 282 | } |
@@ -270,10 +289,10 @@ int __init omap3_twl_init(void) | |||
270 | return -ENODEV; | 289 | return -ENODEV; |
271 | 290 | ||
272 | if (cpu_is_omap3630()) { | 291 | if (cpu_is_omap3630()) { |
273 | omap3_mpu_volt_info.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN; | 292 | omap3_mpu_pmic.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN; |
274 | omap3_mpu_volt_info.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX; | 293 | omap3_mpu_pmic.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX; |
275 | omap3_core_volt_info.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN; | 294 | omap3_core_pmic.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN; |
276 | omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; | 295 | omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; |
277 | } | 296 | } |
278 | 297 | ||
279 | /* | 298 | /* |
@@ -288,11 +307,11 @@ int __init omap3_twl_init(void) | |||
288 | if (!twl_sr_enable_autoinit) | 307 | if (!twl_sr_enable_autoinit) |
289 | omap3_twl_set_sr_bit(true); | 308 | omap3_twl_set_sr_bit(true); |
290 | 309 | ||
291 | voltdm = omap_voltage_domain_lookup("mpu"); | 310 | voltdm = voltdm_lookup("mpu_iva"); |
292 | omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info); | 311 | omap_voltage_register_pmic(voltdm, &omap3_mpu_pmic); |
293 | 312 | ||
294 | voltdm = omap_voltage_domain_lookup("core"); | 313 | voltdm = voltdm_lookup("core"); |
295 | omap_voltage_register_pmic(voltdm, &omap3_core_volt_info); | 314 | omap_voltage_register_pmic(voltdm, &omap3_core_pmic); |
296 | 315 | ||
297 | return 0; | 316 | return 0; |
298 | } | 317 | } |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 3feb35911a32..d34fc5206b4a 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -130,7 +130,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
130 | } else { | 130 | } else { |
131 | hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]); | 131 | hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]); |
132 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); | 132 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); |
133 | pwrdm_wait_transition(pwrdm); | ||
134 | sleep_switch = FORCEWAKEUP_SWITCH; | 133 | sleep_switch = FORCEWAKEUP_SWITCH; |
135 | } | 134 | } |
136 | } | 135 | } |
@@ -156,7 +155,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
156 | return ret; | 155 | return ret; |
157 | } | 156 | } |
158 | 157 | ||
159 | pwrdm_wait_transition(pwrdm); | ||
160 | pwrdm_state_switch(pwrdm); | 158 | pwrdm_state_switch(pwrdm); |
161 | err: | 159 | err: |
162 | return ret; | 160 | return ret; |
@@ -183,7 +181,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, | |||
183 | goto exit; | 181 | goto exit; |
184 | } | 182 | } |
185 | 183 | ||
186 | voltdm = omap_voltage_domain_lookup(vdd_name); | 184 | voltdm = voltdm_lookup(vdd_name); |
187 | if (IS_ERR(voltdm)) { | 185 | if (IS_ERR(voltdm)) { |
188 | printk(KERN_ERR "%s: Unable to get vdd pointer for vdd_%s\n", | 186 | printk(KERN_ERR "%s: Unable to get vdd pointer for vdd_%s\n", |
189 | __func__, vdd_name); | 187 | __func__, vdd_name); |
@@ -214,7 +212,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, | |||
214 | goto exit; | 212 | goto exit; |
215 | } | 213 | } |
216 | 214 | ||
217 | omap_voltage_scale_vdd(voltdm, bootup_volt); | 215 | voltdm_scale(voltdm, bootup_volt); |
218 | return 0; | 216 | return 0; |
219 | 217 | ||
220 | exit: | 218 | exit: |
@@ -228,7 +226,7 @@ static void __init omap3_init_voltages(void) | |||
228 | if (!cpu_is_omap34xx()) | 226 | if (!cpu_is_omap34xx()) |
229 | return; | 227 | return; |
230 | 228 | ||
231 | omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev); | 229 | omap2_set_init_voltage("mpu_iva", "dpll1_ck", mpu_dev); |
232 | omap2_set_init_voltage("core", "l3_ick", l3_dev); | 230 | omap2_set_init_voltage("core", "l3_ick", l3_dev); |
233 | } | 231 | } |
234 | 232 | ||
diff --git a/arch/arm/mach-omap2/powerdomain-common.c b/arch/arm/mach-omap2/powerdomain-common.c index 171fccd208c7..f97afff68d6d 100644 --- a/arch/arm/mach-omap2/powerdomain-common.c +++ b/arch/arm/mach-omap2/powerdomain-common.c | |||
@@ -1,9 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/powerdomain-common.c | 2 | * Common powerdomain framework functions |
3 | * Contains common powerdomain framework functions | ||
4 | * | 3 | * |
5 | * Copyright (C) 2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2010-2011 Texas Instruments, Inc. |
6 | * Copyright (C) 2010 Nokia Corporation | 5 | * Copyright (C) 2010 Nokia Corporation |
7 | * | 6 | * |
8 | * Derived from mach-omap2/powerdomain.c written by Paul Walmsley | 7 | * Derived from mach-omap2/powerdomain.c written by Paul Walmsley |
9 | * | 8 | * |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 9af08473bf10..5164d587ef52 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP powerdomain control | 2 | * OMAP powerdomain control |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2011 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
@@ -77,13 +77,11 @@ static struct powerdomain *_pwrdm_lookup(const char *name) | |||
77 | static int _pwrdm_register(struct powerdomain *pwrdm) | 77 | static int _pwrdm_register(struct powerdomain *pwrdm) |
78 | { | 78 | { |
79 | int i; | 79 | int i; |
80 | struct voltagedomain *voltdm; | ||
80 | 81 | ||
81 | if (!pwrdm || !pwrdm->name) | 82 | if (!pwrdm || !pwrdm->name) |
82 | return -EINVAL; | 83 | return -EINVAL; |
83 | 84 | ||
84 | if (!omap_chip_is(pwrdm->omap_chip)) | ||
85 | return -EINVAL; | ||
86 | |||
87 | if (cpu_is_omap44xx() && | 85 | if (cpu_is_omap44xx() && |
88 | pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) { | 86 | pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) { |
89 | pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n", | 87 | pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n", |
@@ -94,6 +92,16 @@ static int _pwrdm_register(struct powerdomain *pwrdm) | |||
94 | if (_pwrdm_lookup(pwrdm->name)) | 92 | if (_pwrdm_lookup(pwrdm->name)) |
95 | return -EEXIST; | 93 | return -EEXIST; |
96 | 94 | ||
95 | voltdm = voltdm_lookup(pwrdm->voltdm.name); | ||
96 | if (!voltdm) { | ||
97 | pr_err("powerdomain: %s: voltagedomain %s does not exist\n", | ||
98 | pwrdm->name, pwrdm->voltdm.name); | ||
99 | return -EINVAL; | ||
100 | } | ||
101 | pwrdm->voltdm.ptr = voltdm; | ||
102 | INIT_LIST_HEAD(&pwrdm->voltdm_node); | ||
103 | voltdm_add_pwrdm(voltdm, pwrdm); | ||
104 | |||
97 | list_add(&pwrdm->node, &pwrdm_list); | 105 | list_add(&pwrdm->node, &pwrdm_list); |
98 | 106 | ||
99 | /* Initialize the powerdomain's state counter */ | 107 | /* Initialize the powerdomain's state counter */ |
@@ -194,29 +202,76 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) | |||
194 | /* Public functions */ | 202 | /* Public functions */ |
195 | 203 | ||
196 | /** | 204 | /** |
197 | * pwrdm_init - set up the powerdomain layer | 205 | * pwrdm_register_platform_funcs - register powerdomain implementation fns |
198 | * @pwrdm_list: array of struct powerdomain pointers to register | 206 | * @po: func pointers for arch specific implementations |
199 | * @custom_funcs: func pointers for arch specific implementations | 207 | * |
208 | * Register the list of function pointers used to implement the | ||
209 | * powerdomain functions on different OMAP SoCs. Should be called | ||
210 | * before any other pwrdm_register*() function. Returns -EINVAL if | ||
211 | * @po is null, -EEXIST if platform functions have already been | ||
212 | * registered, or 0 upon success. | ||
213 | */ | ||
214 | int pwrdm_register_platform_funcs(struct pwrdm_ops *po) | ||
215 | { | ||
216 | if (!po) | ||
217 | return -EINVAL; | ||
218 | |||
219 | if (arch_pwrdm) | ||
220 | return -EEXIST; | ||
221 | |||
222 | arch_pwrdm = po; | ||
223 | |||
224 | return 0; | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * pwrdm_register_pwrdms - register SoC powerdomains | ||
229 | * @ps: pointer to an array of struct powerdomain to register | ||
200 | * | 230 | * |
201 | * Loop through the array of powerdomains @pwrdm_list, registering all | 231 | * Register the powerdomains available on a particular OMAP SoC. Must |
202 | * that are available on the current CPU. If pwrdm_list is supplied | 232 | * be called after pwrdm_register_platform_funcs(). May be called |
203 | * and not null, all of the referenced powerdomains will be | 233 | * multiple times. Returns -EACCES if called before |
204 | * registered. No return value. XXX pwrdm_list is not really a | 234 | * pwrdm_register_platform_funcs(); -EINVAL if the argument @ps is |
205 | * "list"; it is an array. Rename appropriately. | 235 | * null; or 0 upon success. |
206 | */ | 236 | */ |
207 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs) | 237 | int pwrdm_register_pwrdms(struct powerdomain **ps) |
208 | { | 238 | { |
209 | struct powerdomain **p = NULL; | 239 | struct powerdomain **p = NULL; |
210 | 240 | ||
211 | if (!custom_funcs) | 241 | if (!arch_pwrdm) |
212 | WARN(1, "powerdomain: No custom pwrdm functions registered\n"); | 242 | return -EEXIST; |
213 | else | ||
214 | arch_pwrdm = custom_funcs; | ||
215 | 243 | ||
216 | if (pwrdm_list) { | 244 | if (!ps) |
217 | for (p = pwrdm_list; *p; p++) | 245 | return -EINVAL; |
218 | _pwrdm_register(*p); | 246 | |
219 | } | 247 | for (p = ps; *p; p++) |
248 | _pwrdm_register(*p); | ||
249 | |||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | /** | ||
254 | * pwrdm_complete_init - set up the powerdomain layer | ||
255 | * | ||
256 | * Do whatever is necessary to initialize registered powerdomains and | ||
257 | * powerdomain code. Currently, this programs the next power state | ||
258 | * for each powerdomain to ON. This prevents powerdomains from | ||
259 | * unexpectedly losing context or entering high wakeup latency modes | ||
260 | * with non-power-management-enabled kernels. Must be called after | ||
261 | * pwrdm_register_pwrdms(). Returns -EACCES if called before | ||
262 | * pwrdm_register_pwrdms(), or 0 upon success. | ||
263 | */ | ||
264 | int pwrdm_complete_init(void) | ||
265 | { | ||
266 | struct powerdomain *temp_p; | ||
267 | |||
268 | if (list_empty(&pwrdm_list)) | ||
269 | return -EACCES; | ||
270 | |||
271 | list_for_each_entry(temp_p, &pwrdm_list, node) | ||
272 | pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON); | ||
273 | |||
274 | return 0; | ||
220 | } | 275 | } |
221 | 276 | ||
222 | /** | 277 | /** |
@@ -383,6 +438,18 @@ int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, | |||
383 | } | 438 | } |
384 | 439 | ||
385 | /** | 440 | /** |
441 | * pwrdm_get_voltdm - return a ptr to the voltdm that this pwrdm resides in | ||
442 | * @pwrdm: struct powerdomain * | ||
443 | * | ||
444 | * Return a pointer to the struct voltageomain that the specified powerdomain | ||
445 | * @pwrdm exists in. | ||
446 | */ | ||
447 | struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm) | ||
448 | { | ||
449 | return pwrdm->voltdm.ptr; | ||
450 | } | ||
451 | |||
452 | /** | ||
386 | * pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain | 453 | * pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain |
387 | * @pwrdm: struct powerdomain * | 454 | * @pwrdm: struct powerdomain * |
388 | * | 455 | * |
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index d23d979b9c34..42e6dd8f2a78 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <plat/cpu.h> | 25 | #include <plat/cpu.h> |
26 | 26 | ||
27 | #include "voltage.h" | ||
28 | |||
27 | /* Powerdomain basic power states */ | 29 | /* Powerdomain basic power states */ |
28 | #define PWRDM_POWER_OFF 0x0 | 30 | #define PWRDM_POWER_OFF 0x0 |
29 | #define PWRDM_POWER_RET 0x1 | 31 | #define PWRDM_POWER_RET 0x1 |
@@ -78,7 +80,7 @@ struct powerdomain; | |||
78 | /** | 80 | /** |
79 | * struct powerdomain - OMAP powerdomain | 81 | * struct powerdomain - OMAP powerdomain |
80 | * @name: Powerdomain name | 82 | * @name: Powerdomain name |
81 | * @omap_chip: represents the OMAP chip types containing this pwrdm | 83 | * @voltdm: voltagedomain containing this powerdomain |
82 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE | 84 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE |
83 | * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs | 85 | * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs |
84 | * @pwrsts: Possible powerdomain power states | 86 | * @pwrsts: Possible powerdomain power states |
@@ -89,6 +91,7 @@ struct powerdomain; | |||
89 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON | 91 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON |
90 | * @pwrdm_clkdms: Clockdomains in this powerdomain | 92 | * @pwrdm_clkdms: Clockdomains in this powerdomain |
91 | * @node: list_head linking all powerdomains | 93 | * @node: list_head linking all powerdomains |
94 | * @voltdm_node: list_head linking all powerdomains in a voltagedomain | ||
92 | * @state: | 95 | * @state: |
93 | * @state_counter: | 96 | * @state_counter: |
94 | * @timer: | 97 | * @timer: |
@@ -98,7 +101,10 @@ struct powerdomain; | |||
98 | */ | 101 | */ |
99 | struct powerdomain { | 102 | struct powerdomain { |
100 | const char *name; | 103 | const char *name; |
101 | const struct omap_chip_id omap_chip; | 104 | union { |
105 | const char *name; | ||
106 | struct voltagedomain *ptr; | ||
107 | } voltdm; | ||
102 | const s16 prcm_offs; | 108 | const s16 prcm_offs; |
103 | const u8 pwrsts; | 109 | const u8 pwrsts; |
104 | const u8 pwrsts_logic_ret; | 110 | const u8 pwrsts_logic_ret; |
@@ -109,6 +115,7 @@ struct powerdomain { | |||
109 | const u8 prcm_partition; | 115 | const u8 prcm_partition; |
110 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; | 116 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; |
111 | struct list_head node; | 117 | struct list_head node; |
118 | struct list_head voltdm_node; | ||
112 | int state; | 119 | int state; |
113 | unsigned state_counter[PWRDM_MAX_PWRSTS]; | 120 | unsigned state_counter[PWRDM_MAX_PWRSTS]; |
114 | unsigned ret_logic_off_counter; | 121 | unsigned ret_logic_off_counter; |
@@ -162,7 +169,9 @@ struct pwrdm_ops { | |||
162 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); | 169 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); |
163 | }; | 170 | }; |
164 | 171 | ||
165 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); | 172 | int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs); |
173 | int pwrdm_register_pwrdms(struct powerdomain **pwrdm_list); | ||
174 | int pwrdm_complete_init(void); | ||
166 | 175 | ||
167 | struct powerdomain *pwrdm_lookup(const char *name); | 176 | struct powerdomain *pwrdm_lookup(const char *name); |
168 | 177 | ||
@@ -176,6 +185,7 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); | |||
176 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, | 185 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, |
177 | int (*fn)(struct powerdomain *pwrdm, | 186 | int (*fn)(struct powerdomain *pwrdm, |
178 | struct clockdomain *clkdm)); | 187 | struct clockdomain *clkdm)); |
188 | struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm); | ||
179 | 189 | ||
180 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); | 190 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); |
181 | 191 | ||
@@ -210,7 +220,8 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); | |||
210 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); | 220 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); |
211 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); | 221 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); |
212 | 222 | ||
213 | extern void omap2xxx_powerdomains_init(void); | 223 | extern void omap242x_powerdomains_init(void); |
224 | extern void omap243x_powerdomains_init(void); | ||
214 | extern void omap3xxx_powerdomains_init(void); | 225 | extern void omap3xxx_powerdomains_init(void); |
215 | extern void omap44xx_powerdomains_init(void); | 226 | extern void omap44xx_powerdomains_init(void); |
216 | 227 | ||
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c index cf600e22bf8e..6a17e4ca1d79 100644 --- a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2 and OMAP3 powerdomain control | 2 | * OMAP2 and OMAP3 powerdomain control |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2009 Nokia Corporation | 5 | * Copyright (C) 2007-2009 Nokia Corporation |
6 | * | 6 | * |
7 | * Derived from mach-omap2/powerdomain.c written by Paul Walmsley | 7 | * Derived from mach-omap2/powerdomain.c written by Paul Walmsley |
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c index 4210c3399769..d3a5399091ad 100644 --- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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, 2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2011 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
@@ -12,20 +12,6 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * To Do List | ||
16 | * -> Move the Sleep/Wakeup dependencies from Power Domain framework to | ||
17 | * Clock Domain Framework | ||
18 | */ | ||
19 | |||
20 | /* | ||
21 | * This file contains all of the powerdomains that have some element | ||
22 | * of software control for the OMAP24xx and OMAP34xx chips. | ||
23 | * | ||
24 | * This is not an exhaustive listing of powerdomains on the chips; only | ||
25 | * powerdomains that can be controlled in software. | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | * The names for the DSP/IVA2 powerdomains are confusing. | 15 | * The names for the DSP/IVA2 powerdomains are confusing. |
30 | * | 16 | * |
31 | * Most OMAP chips have an on-board DSP. | 17 | * Most OMAP chips have an on-board DSP. |
@@ -59,8 +45,6 @@ | |||
59 | struct powerdomain gfx_omap2_pwrdm = { | 45 | struct powerdomain gfx_omap2_pwrdm = { |
60 | .name = "gfx_pwrdm", | 46 | .name = "gfx_pwrdm", |
61 | .prcm_offs = GFX_MOD, | 47 | .prcm_offs = GFX_MOD, |
62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
63 | CHIP_IS_OMAP3430ES1), | ||
64 | .pwrsts = PWRSTS_OFF_RET_ON, | 48 | .pwrsts = PWRSTS_OFF_RET_ON, |
65 | .pwrsts_logic_ret = PWRSTS_RET, | 49 | .pwrsts_logic_ret = PWRSTS_RET, |
66 | .banks = 1, | 50 | .banks = 1, |
@@ -70,11 +54,12 @@ struct powerdomain gfx_omap2_pwrdm = { | |||
70 | .pwrsts_mem_on = { | 54 | .pwrsts_mem_on = { |
71 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 55 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
72 | }, | 56 | }, |
57 | .voltdm = { .name = "core" }, | ||
73 | }; | 58 | }; |
74 | 59 | ||
75 | struct powerdomain wkup_omap2_pwrdm = { | 60 | struct powerdomain wkup_omap2_pwrdm = { |
76 | .name = "wkup_pwrdm", | 61 | .name = "wkup_pwrdm", |
77 | .prcm_offs = WKUP_MOD, | 62 | .prcm_offs = WKUP_MOD, |
78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
79 | .pwrsts = PWRSTS_ON, | 63 | .pwrsts = PWRSTS_ON, |
64 | .voltdm = { .name = "wakeup" }, | ||
80 | }; | 65 | }; |
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c index cc389fb2005d..2385c1f009ee 100644 --- a/arch/arm/mach-omap2/powerdomains2xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2XXX powerdomain definitions | 2 | * OMAP2XXX powerdomain definitions |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2011 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
@@ -28,7 +28,6 @@ | |||
28 | static struct powerdomain dsp_pwrdm = { | 28 | static struct powerdomain dsp_pwrdm = { |
29 | .name = "dsp_pwrdm", | 29 | .name = "dsp_pwrdm", |
30 | .prcm_offs = OMAP24XX_DSP_MOD, | 30 | .prcm_offs = OMAP24XX_DSP_MOD, |
31 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | ||
32 | .pwrsts = PWRSTS_OFF_RET_ON, | 31 | .pwrsts = PWRSTS_OFF_RET_ON, |
33 | .pwrsts_logic_ret = PWRSTS_RET, | 32 | .pwrsts_logic_ret = PWRSTS_RET, |
34 | .banks = 1, | 33 | .banks = 1, |
@@ -38,12 +37,12 @@ static struct powerdomain dsp_pwrdm = { | |||
38 | .pwrsts_mem_on = { | 37 | .pwrsts_mem_on = { |
39 | [0] = PWRSTS_ON, | 38 | [0] = PWRSTS_ON, |
40 | }, | 39 | }, |
40 | .voltdm = { .name = "core" }, | ||
41 | }; | 41 | }; |
42 | 42 | ||
43 | static struct powerdomain mpu_24xx_pwrdm = { | 43 | static struct powerdomain mpu_24xx_pwrdm = { |
44 | .name = "mpu_pwrdm", | 44 | .name = "mpu_pwrdm", |
45 | .prcm_offs = MPU_MOD, | 45 | .prcm_offs = MPU_MOD, |
46 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | ||
47 | .pwrsts = PWRSTS_OFF_RET_ON, | 46 | .pwrsts = PWRSTS_OFF_RET_ON, |
48 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 47 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
49 | .banks = 1, | 48 | .banks = 1, |
@@ -53,12 +52,12 @@ static struct powerdomain mpu_24xx_pwrdm = { | |||
53 | .pwrsts_mem_on = { | 52 | .pwrsts_mem_on = { |
54 | [0] = PWRSTS_ON, | 53 | [0] = PWRSTS_ON, |
55 | }, | 54 | }, |
55 | .voltdm = { .name = "core" }, | ||
56 | }; | 56 | }; |
57 | 57 | ||
58 | static struct powerdomain core_24xx_pwrdm = { | 58 | static struct powerdomain core_24xx_pwrdm = { |
59 | .name = "core_pwrdm", | 59 | .name = "core_pwrdm", |
60 | .prcm_offs = CORE_MOD, | 60 | .prcm_offs = CORE_MOD, |
61 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | ||
62 | .pwrsts = PWRSTS_OFF_RET_ON, | 61 | .pwrsts = PWRSTS_OFF_RET_ON, |
63 | .banks = 3, | 62 | .banks = 3, |
64 | .pwrsts_mem_ret = { | 63 | .pwrsts_mem_ret = { |
@@ -71,6 +70,7 @@ static struct powerdomain core_24xx_pwrdm = { | |||
71 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ | 70 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ |
72 | [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ | 71 | [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ |
73 | }, | 72 | }, |
73 | .voltdm = { .name = "core" }, | ||
74 | }; | 74 | }; |
75 | 75 | ||
76 | 76 | ||
@@ -78,14 +78,11 @@ static struct powerdomain core_24xx_pwrdm = { | |||
78 | * 2430-specific powerdomains | 78 | * 2430-specific powerdomains |
79 | */ | 79 | */ |
80 | 80 | ||
81 | #ifdef CONFIG_SOC_OMAP2430 | ||
82 | |||
83 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ | 81 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
84 | 82 | ||
85 | static struct powerdomain mdm_pwrdm = { | 83 | static struct powerdomain mdm_pwrdm = { |
86 | .name = "mdm_pwrdm", | 84 | .name = "mdm_pwrdm", |
87 | .prcm_offs = OMAP2430_MDM_MOD, | 85 | .prcm_offs = OMAP2430_MDM_MOD, |
88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
89 | .pwrsts = PWRSTS_OFF_RET_ON, | 86 | .pwrsts = PWRSTS_OFF_RET_ON, |
90 | .pwrsts_logic_ret = PWRSTS_RET, | 87 | .pwrsts_logic_ret = PWRSTS_RET, |
91 | .banks = 1, | 88 | .banks = 1, |
@@ -95,29 +92,44 @@ static struct powerdomain mdm_pwrdm = { | |||
95 | .pwrsts_mem_on = { | 92 | .pwrsts_mem_on = { |
96 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 93 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
97 | }, | 94 | }, |
95 | .voltdm = { .name = "core" }, | ||
98 | }; | 96 | }; |
99 | 97 | ||
100 | #endif /* CONFIG_SOC_OMAP2430 */ | 98 | /* |
101 | 99 | * | |
102 | /* As powerdomains are added or removed above, this list must also be changed */ | 100 | */ |
103 | static struct powerdomain *powerdomains_omap2xxx[] __initdata = { | ||
104 | 101 | ||
102 | static struct powerdomain *powerdomains_omap24xx[] __initdata = { | ||
105 | &wkup_omap2_pwrdm, | 103 | &wkup_omap2_pwrdm, |
106 | &gfx_omap2_pwrdm, | 104 | &gfx_omap2_pwrdm, |
107 | |||
108 | #ifdef CONFIG_ARCH_OMAP2 | ||
109 | &dsp_pwrdm, | 105 | &dsp_pwrdm, |
110 | &mpu_24xx_pwrdm, | 106 | &mpu_24xx_pwrdm, |
111 | &core_24xx_pwrdm, | 107 | &core_24xx_pwrdm, |
112 | #endif | 108 | NULL |
109 | }; | ||
113 | 110 | ||
114 | #ifdef CONFIG_SOC_OMAP2430 | 111 | static struct powerdomain *powerdomains_omap2430[] __initdata = { |
115 | &mdm_pwrdm, | 112 | &mdm_pwrdm, |
116 | #endif | ||
117 | NULL | 113 | NULL |
118 | }; | 114 | }; |
119 | 115 | ||
120 | void __init omap2xxx_powerdomains_init(void) | 116 | void __init omap242x_powerdomains_init(void) |
117 | { | ||
118 | if (!cpu_is_omap2420()) | ||
119 | return; | ||
120 | |||
121 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); | ||
122 | pwrdm_register_pwrdms(powerdomains_omap24xx); | ||
123 | pwrdm_complete_init(); | ||
124 | } | ||
125 | |||
126 | void __init omap243x_powerdomains_init(void) | ||
121 | { | 127 | { |
122 | pwrdm_init(powerdomains_omap2xxx, &omap2_pwrdm_operations); | 128 | if (!cpu_is_omap2430()) |
129 | return; | ||
130 | |||
131 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); | ||
132 | pwrdm_register_pwrdms(powerdomains_omap24xx); | ||
133 | pwrdm_register_pwrdms(powerdomains_omap2430); | ||
134 | pwrdm_complete_init(); | ||
123 | } | 135 | } |
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c index 469a920a74dc..8ef26daeed68 100644 --- a/arch/arm/mach-omap2/powerdomains3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP3 powerdomain definitions | 2 | * OMAP3 powerdomain definitions |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2011 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | 16 | ||
17 | #include <plat/cpu.h> | ||
18 | |||
17 | #include "powerdomain.h" | 19 | #include "powerdomain.h" |
18 | #include "powerdomains2xxx_3xxx_data.h" | 20 | #include "powerdomains2xxx_3xxx_data.h" |
19 | 21 | ||
@@ -27,8 +29,6 @@ | |||
27 | * 34XX-specific powerdomains, dependencies | 29 | * 34XX-specific powerdomains, dependencies |
28 | */ | 30 | */ |
29 | 31 | ||
30 | #ifdef CONFIG_ARCH_OMAP3 | ||
31 | |||
32 | /* | 32 | /* |
33 | * Powerdomains | 33 | * Powerdomains |
34 | */ | 34 | */ |
@@ -36,7 +36,6 @@ | |||
36 | static struct powerdomain iva2_pwrdm = { | 36 | static struct powerdomain iva2_pwrdm = { |
37 | .name = "iva2_pwrdm", | 37 | .name = "iva2_pwrdm", |
38 | .prcm_offs = OMAP3430_IVA2_MOD, | 38 | .prcm_offs = OMAP3430_IVA2_MOD, |
39 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
40 | .pwrsts = PWRSTS_OFF_RET_ON, | 39 | .pwrsts = PWRSTS_OFF_RET_ON, |
41 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
42 | .banks = 4, | 41 | .banks = 4, |
@@ -52,12 +51,12 @@ static struct powerdomain iva2_pwrdm = { | |||
52 | [2] = PWRSTS_OFF_ON, | 51 | [2] = PWRSTS_OFF_ON, |
53 | [3] = PWRSTS_ON, | 52 | [3] = PWRSTS_ON, |
54 | }, | 53 | }, |
54 | .voltdm = { .name = "mpu_iva" }, | ||
55 | }; | 55 | }; |
56 | 56 | ||
57 | static struct powerdomain mpu_3xxx_pwrdm = { | 57 | static struct powerdomain mpu_3xxx_pwrdm = { |
58 | .name = "mpu_pwrdm", | 58 | .name = "mpu_pwrdm", |
59 | .prcm_offs = MPU_MOD, | 59 | .prcm_offs = MPU_MOD, |
60 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
61 | .pwrsts = PWRSTS_OFF_RET_ON, | 60 | .pwrsts = PWRSTS_OFF_RET_ON, |
62 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 61 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
63 | .flags = PWRDM_HAS_MPU_QUIRK, | 62 | .flags = PWRDM_HAS_MPU_QUIRK, |
@@ -68,6 +67,7 @@ static struct powerdomain mpu_3xxx_pwrdm = { | |||
68 | .pwrsts_mem_on = { | 67 | .pwrsts_mem_on = { |
69 | [0] = PWRSTS_OFF_ON, | 68 | [0] = PWRSTS_OFF_ON, |
70 | }, | 69 | }, |
70 | .voltdm = { .name = "mpu_iva" }, | ||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /* | 73 | /* |
@@ -83,10 +83,6 @@ static struct powerdomain mpu_3xxx_pwrdm = { | |||
83 | static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { | 83 | static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { |
84 | .name = "core_pwrdm", | 84 | .name = "core_pwrdm", |
85 | .prcm_offs = CORE_MOD, | 85 | .prcm_offs = CORE_MOD, |
86 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | ||
87 | CHIP_IS_OMAP3430ES2 | | ||
88 | CHIP_IS_OMAP3430ES3_0 | | ||
89 | CHIP_IS_OMAP3630ES1), | ||
90 | .pwrsts = PWRSTS_OFF_RET_ON, | 86 | .pwrsts = PWRSTS_OFF_RET_ON, |
91 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 87 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
92 | .banks = 2, | 88 | .banks = 2, |
@@ -98,13 +94,12 @@ static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { | |||
98 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ | 94 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ |
99 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ | 95 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ |
100 | }, | 96 | }, |
97 | .voltdm = { .name = "core" }, | ||
101 | }; | 98 | }; |
102 | 99 | ||
103 | static struct powerdomain core_3xxx_es3_1_pwrdm = { | 100 | static struct powerdomain core_3xxx_es3_1_pwrdm = { |
104 | .name = "core_pwrdm", | 101 | .name = "core_pwrdm", |
105 | .prcm_offs = CORE_MOD, | 102 | .prcm_offs = CORE_MOD, |
106 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 | | ||
107 | CHIP_GE_OMAP3630ES1_1), | ||
108 | .pwrsts = PWRSTS_OFF_RET_ON, | 103 | .pwrsts = PWRSTS_OFF_RET_ON, |
109 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 104 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
110 | /* | 105 | /* |
@@ -121,11 +116,11 @@ static struct powerdomain core_3xxx_es3_1_pwrdm = { | |||
121 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ | 116 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ |
122 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ | 117 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ |
123 | }, | 118 | }, |
119 | .voltdm = { .name = "core" }, | ||
124 | }; | 120 | }; |
125 | 121 | ||
126 | static struct powerdomain dss_pwrdm = { | 122 | static struct powerdomain dss_pwrdm = { |
127 | .name = "dss_pwrdm", | 123 | .name = "dss_pwrdm", |
128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
129 | .prcm_offs = OMAP3430_DSS_MOD, | 124 | .prcm_offs = OMAP3430_DSS_MOD, |
130 | .pwrsts = PWRSTS_OFF_RET_ON, | 125 | .pwrsts = PWRSTS_OFF_RET_ON, |
131 | .pwrsts_logic_ret = PWRSTS_RET, | 126 | .pwrsts_logic_ret = PWRSTS_RET, |
@@ -136,6 +131,7 @@ static struct powerdomain dss_pwrdm = { | |||
136 | .pwrsts_mem_on = { | 131 | .pwrsts_mem_on = { |
137 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 132 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
138 | }, | 133 | }, |
134 | .voltdm = { .name = "core" }, | ||
139 | }; | 135 | }; |
140 | 136 | ||
141 | /* | 137 | /* |
@@ -146,7 +142,6 @@ static struct powerdomain dss_pwrdm = { | |||
146 | static struct powerdomain sgx_pwrdm = { | 142 | static struct powerdomain sgx_pwrdm = { |
147 | .name = "sgx_pwrdm", | 143 | .name = "sgx_pwrdm", |
148 | .prcm_offs = OMAP3430ES2_SGX_MOD, | 144 | .prcm_offs = OMAP3430ES2_SGX_MOD, |
149 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
150 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ | 145 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ |
151 | .pwrsts = PWRSTS_OFF_ON, | 146 | .pwrsts = PWRSTS_OFF_ON, |
152 | .pwrsts_logic_ret = PWRSTS_RET, | 147 | .pwrsts_logic_ret = PWRSTS_RET, |
@@ -157,11 +152,11 @@ static struct powerdomain sgx_pwrdm = { | |||
157 | .pwrsts_mem_on = { | 152 | .pwrsts_mem_on = { |
158 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 153 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
159 | }, | 154 | }, |
155 | .voltdm = { .name = "core" }, | ||
160 | }; | 156 | }; |
161 | 157 | ||
162 | static struct powerdomain cam_pwrdm = { | 158 | static struct powerdomain cam_pwrdm = { |
163 | .name = "cam_pwrdm", | 159 | .name = "cam_pwrdm", |
164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
165 | .prcm_offs = OMAP3430_CAM_MOD, | 160 | .prcm_offs = OMAP3430_CAM_MOD, |
166 | .pwrsts = PWRSTS_OFF_RET_ON, | 161 | .pwrsts = PWRSTS_OFF_RET_ON, |
167 | .pwrsts_logic_ret = PWRSTS_RET, | 162 | .pwrsts_logic_ret = PWRSTS_RET, |
@@ -172,12 +167,12 @@ static struct powerdomain cam_pwrdm = { | |||
172 | .pwrsts_mem_on = { | 167 | .pwrsts_mem_on = { |
173 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 168 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
174 | }, | 169 | }, |
170 | .voltdm = { .name = "core" }, | ||
175 | }; | 171 | }; |
176 | 172 | ||
177 | static struct powerdomain per_pwrdm = { | 173 | static struct powerdomain per_pwrdm = { |
178 | .name = "per_pwrdm", | 174 | .name = "per_pwrdm", |
179 | .prcm_offs = OMAP3430_PER_MOD, | 175 | .prcm_offs = OMAP3430_PER_MOD, |
180 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
181 | .pwrsts = PWRSTS_OFF_RET_ON, | 176 | .pwrsts = PWRSTS_OFF_RET_ON, |
182 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 177 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
183 | .banks = 1, | 178 | .banks = 1, |
@@ -187,26 +182,26 @@ static struct powerdomain per_pwrdm = { | |||
187 | .pwrsts_mem_on = { | 182 | .pwrsts_mem_on = { |
188 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 183 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
189 | }, | 184 | }, |
185 | .voltdm = { .name = "core" }, | ||
190 | }; | 186 | }; |
191 | 187 | ||
192 | static struct powerdomain emu_pwrdm = { | 188 | static struct powerdomain emu_pwrdm = { |
193 | .name = "emu_pwrdm", | 189 | .name = "emu_pwrdm", |
194 | .prcm_offs = OMAP3430_EMU_MOD, | 190 | .prcm_offs = OMAP3430_EMU_MOD, |
195 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 191 | .voltdm = { .name = "core" }, |
196 | }; | 192 | }; |
197 | 193 | ||
198 | static struct powerdomain neon_pwrdm = { | 194 | static struct powerdomain neon_pwrdm = { |
199 | .name = "neon_pwrdm", | 195 | .name = "neon_pwrdm", |
200 | .prcm_offs = OMAP3430_NEON_MOD, | 196 | .prcm_offs = OMAP3430_NEON_MOD, |
201 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
202 | .pwrsts = PWRSTS_OFF_RET_ON, | 197 | .pwrsts = PWRSTS_OFF_RET_ON, |
203 | .pwrsts_logic_ret = PWRSTS_RET, | 198 | .pwrsts_logic_ret = PWRSTS_RET, |
199 | .voltdm = { .name = "mpu_iva" }, | ||
204 | }; | 200 | }; |
205 | 201 | ||
206 | static struct powerdomain usbhost_pwrdm = { | 202 | static struct powerdomain usbhost_pwrdm = { |
207 | .name = "usbhost_pwrdm", | 203 | .name = "usbhost_pwrdm", |
208 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, | 204 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, |
209 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
210 | .pwrsts = PWRSTS_OFF_RET_ON, | 205 | .pwrsts = PWRSTS_OFF_RET_ON, |
211 | .pwrsts_logic_ret = PWRSTS_RET, | 206 | .pwrsts_logic_ret = PWRSTS_RET, |
212 | /* | 207 | /* |
@@ -223,65 +218,103 @@ static struct powerdomain usbhost_pwrdm = { | |||
223 | .pwrsts_mem_on = { | 218 | .pwrsts_mem_on = { |
224 | [0] = PWRSTS_ON, /* MEMONSTATE */ | 219 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
225 | }, | 220 | }, |
221 | .voltdm = { .name = "core" }, | ||
226 | }; | 222 | }; |
227 | 223 | ||
228 | static struct powerdomain dpll1_pwrdm = { | 224 | static struct powerdomain dpll1_pwrdm = { |
229 | .name = "dpll1_pwrdm", | 225 | .name = "dpll1_pwrdm", |
230 | .prcm_offs = MPU_MOD, | 226 | .prcm_offs = MPU_MOD, |
231 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 227 | .voltdm = { .name = "mpu_iva" }, |
232 | }; | 228 | }; |
233 | 229 | ||
234 | static struct powerdomain dpll2_pwrdm = { | 230 | static struct powerdomain dpll2_pwrdm = { |
235 | .name = "dpll2_pwrdm", | 231 | .name = "dpll2_pwrdm", |
236 | .prcm_offs = OMAP3430_IVA2_MOD, | 232 | .prcm_offs = OMAP3430_IVA2_MOD, |
237 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 233 | .voltdm = { .name = "mpu_iva" }, |
238 | }; | 234 | }; |
239 | 235 | ||
240 | static struct powerdomain dpll3_pwrdm = { | 236 | static struct powerdomain dpll3_pwrdm = { |
241 | .name = "dpll3_pwrdm", | 237 | .name = "dpll3_pwrdm", |
242 | .prcm_offs = PLL_MOD, | 238 | .prcm_offs = PLL_MOD, |
243 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 239 | .voltdm = { .name = "core" }, |
244 | }; | 240 | }; |
245 | 241 | ||
246 | static struct powerdomain dpll4_pwrdm = { | 242 | static struct powerdomain dpll4_pwrdm = { |
247 | .name = "dpll4_pwrdm", | 243 | .name = "dpll4_pwrdm", |
248 | .prcm_offs = PLL_MOD, | 244 | .prcm_offs = PLL_MOD, |
249 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 245 | .voltdm = { .name = "core" }, |
250 | }; | 246 | }; |
251 | 247 | ||
252 | static struct powerdomain dpll5_pwrdm = { | 248 | static struct powerdomain dpll5_pwrdm = { |
253 | .name = "dpll5_pwrdm", | 249 | .name = "dpll5_pwrdm", |
254 | .prcm_offs = PLL_MOD, | 250 | .prcm_offs = PLL_MOD, |
255 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 251 | .voltdm = { .name = "core" }, |
256 | }; | 252 | }; |
257 | 253 | ||
258 | /* As powerdomains are added or removed above, this list must also be changed */ | 254 | /* As powerdomains are added or removed above, this list must also be changed */ |
259 | static struct powerdomain *powerdomains_omap3xxx[] __initdata = { | 255 | static struct powerdomain *powerdomains_omap3430_common[] __initdata = { |
260 | |||
261 | &wkup_omap2_pwrdm, | 256 | &wkup_omap2_pwrdm, |
262 | &gfx_omap2_pwrdm, | ||
263 | &iva2_pwrdm, | 257 | &iva2_pwrdm, |
264 | &mpu_3xxx_pwrdm, | 258 | &mpu_3xxx_pwrdm, |
265 | &neon_pwrdm, | 259 | &neon_pwrdm, |
266 | &core_3xxx_pre_es3_1_pwrdm, | ||
267 | &core_3xxx_es3_1_pwrdm, | ||
268 | &cam_pwrdm, | 260 | &cam_pwrdm, |
269 | &dss_pwrdm, | 261 | &dss_pwrdm, |
270 | &per_pwrdm, | 262 | &per_pwrdm, |
271 | &emu_pwrdm, | 263 | &emu_pwrdm, |
272 | &sgx_pwrdm, | ||
273 | &usbhost_pwrdm, | ||
274 | &dpll1_pwrdm, | 264 | &dpll1_pwrdm, |
275 | &dpll2_pwrdm, | 265 | &dpll2_pwrdm, |
276 | &dpll3_pwrdm, | 266 | &dpll3_pwrdm, |
277 | &dpll4_pwrdm, | 267 | &dpll4_pwrdm, |
268 | NULL | ||
269 | }; | ||
270 | |||
271 | static struct powerdomain *powerdomains_omap3430es1[] __initdata = { | ||
272 | &gfx_omap2_pwrdm, | ||
273 | &core_3xxx_pre_es3_1_pwrdm, | ||
274 | NULL | ||
275 | }; | ||
276 | |||
277 | /* also includes 3630ES1.0 */ | ||
278 | static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = { | ||
279 | &core_3xxx_pre_es3_1_pwrdm, | ||
280 | &sgx_pwrdm, | ||
281 | &usbhost_pwrdm, | ||
278 | &dpll5_pwrdm, | 282 | &dpll5_pwrdm, |
279 | #endif | ||
280 | NULL | 283 | NULL |
281 | }; | 284 | }; |
282 | 285 | ||
286 | /* also includes 3630ES1.1+ */ | ||
287 | static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = { | ||
288 | &core_3xxx_es3_1_pwrdm, | ||
289 | &sgx_pwrdm, | ||
290 | &usbhost_pwrdm, | ||
291 | &dpll5_pwrdm, | ||
292 | NULL | ||
293 | }; | ||
283 | 294 | ||
284 | void __init omap3xxx_powerdomains_init(void) | 295 | void __init omap3xxx_powerdomains_init(void) |
285 | { | 296 | { |
286 | pwrdm_init(powerdomains_omap3xxx, &omap3_pwrdm_operations); | 297 | unsigned int rev; |
298 | |||
299 | if (!cpu_is_omap34xx()) | ||
300 | return; | ||
301 | |||
302 | pwrdm_register_platform_funcs(&omap3_pwrdm_operations); | ||
303 | pwrdm_register_pwrdms(powerdomains_omap3430_common); | ||
304 | |||
305 | rev = omap_rev(); | ||
306 | |||
307 | if (rev == OMAP3430_REV_ES1_0) | ||
308 | pwrdm_register_pwrdms(powerdomains_omap3430es1); | ||
309 | else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 || | ||
310 | rev == OMAP3430_REV_ES3_0 || rev == OMAP3630_REV_ES1_0) | ||
311 | pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0); | ||
312 | else if (rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2 || | ||
313 | rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1 || | ||
314 | rev == OMAP3630_REV_ES1_1 || rev == OMAP3630_REV_ES1_2) | ||
315 | pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus); | ||
316 | else | ||
317 | WARN(1, "OMAP3 powerdomain init: unknown chip type\n"); | ||
318 | |||
319 | pwrdm_complete_init(); | ||
287 | } | 320 | } |
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c index 247e79495115..704664c0e259 100644 --- a/arch/arm/mach-omap2/powerdomains44xx_data.c +++ b/arch/arm/mach-omap2/powerdomains44xx_data.c | |||
@@ -33,9 +33,9 @@ | |||
33 | /* core_44xx_pwrdm: CORE power domain */ | 33 | /* core_44xx_pwrdm: CORE power domain */ |
34 | static struct powerdomain core_44xx_pwrdm = { | 34 | static struct powerdomain core_44xx_pwrdm = { |
35 | .name = "core_pwrdm", | 35 | .name = "core_pwrdm", |
36 | .voltdm = { .name = "core" }, | ||
36 | .prcm_offs = OMAP4430_PRM_CORE_INST, | 37 | .prcm_offs = OMAP4430_PRM_CORE_INST, |
37 | .prcm_partition = OMAP4430_PRM_PARTITION, | 38 | .prcm_partition = OMAP4430_PRM_PARTITION, |
38 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
39 | .pwrsts = PWRSTS_RET_ON, | 39 | .pwrsts = PWRSTS_RET_ON, |
40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
41 | .banks = 5, | 41 | .banks = 5, |
@@ -59,9 +59,9 @@ static struct powerdomain core_44xx_pwrdm = { | |||
59 | /* gfx_44xx_pwrdm: 3D accelerator power domain */ | 59 | /* gfx_44xx_pwrdm: 3D accelerator power domain */ |
60 | static struct powerdomain gfx_44xx_pwrdm = { | 60 | static struct powerdomain gfx_44xx_pwrdm = { |
61 | .name = "gfx_pwrdm", | 61 | .name = "gfx_pwrdm", |
62 | .voltdm = { .name = "core" }, | ||
62 | .prcm_offs = OMAP4430_PRM_GFX_INST, | 63 | .prcm_offs = OMAP4430_PRM_GFX_INST, |
63 | .prcm_partition = OMAP4430_PRM_PARTITION, | 64 | .prcm_partition = OMAP4430_PRM_PARTITION, |
64 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
65 | .pwrsts = PWRSTS_OFF_ON, | 65 | .pwrsts = PWRSTS_OFF_ON, |
66 | .banks = 1, | 66 | .banks = 1, |
67 | .pwrsts_mem_ret = { | 67 | .pwrsts_mem_ret = { |
@@ -76,9 +76,9 @@ static struct powerdomain gfx_44xx_pwrdm = { | |||
76 | /* abe_44xx_pwrdm: Audio back end power domain */ | 76 | /* abe_44xx_pwrdm: Audio back end power domain */ |
77 | static struct powerdomain abe_44xx_pwrdm = { | 77 | static struct powerdomain abe_44xx_pwrdm = { |
78 | .name = "abe_pwrdm", | 78 | .name = "abe_pwrdm", |
79 | .voltdm = { .name = "iva" }, | ||
79 | .prcm_offs = OMAP4430_PRM_ABE_INST, | 80 | .prcm_offs = OMAP4430_PRM_ABE_INST, |
80 | .prcm_partition = OMAP4430_PRM_PARTITION, | 81 | .prcm_partition = OMAP4430_PRM_PARTITION, |
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 = PWRSTS_OFF, | 83 | .pwrsts_logic_ret = PWRSTS_OFF, |
84 | .banks = 2, | 84 | .banks = 2, |
@@ -96,9 +96,9 @@ static struct powerdomain abe_44xx_pwrdm = { | |||
96 | /* dss_44xx_pwrdm: Display subsystem power domain */ | 96 | /* dss_44xx_pwrdm: Display subsystem power domain */ |
97 | static struct powerdomain dss_44xx_pwrdm = { | 97 | static struct powerdomain dss_44xx_pwrdm = { |
98 | .name = "dss_pwrdm", | 98 | .name = "dss_pwrdm", |
99 | .voltdm = { .name = "core" }, | ||
99 | .prcm_offs = OMAP4430_PRM_DSS_INST, | 100 | .prcm_offs = OMAP4430_PRM_DSS_INST, |
100 | .prcm_partition = OMAP4430_PRM_PARTITION, | 101 | .prcm_partition = OMAP4430_PRM_PARTITION, |
101 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
102 | .pwrsts = PWRSTS_OFF_RET_ON, | 102 | .pwrsts = PWRSTS_OFF_RET_ON, |
103 | .pwrsts_logic_ret = PWRSTS_OFF, | 103 | .pwrsts_logic_ret = PWRSTS_OFF, |
104 | .banks = 1, | 104 | .banks = 1, |
@@ -114,9 +114,9 @@ static struct powerdomain dss_44xx_pwrdm = { | |||
114 | /* tesla_44xx_pwrdm: Tesla processor power domain */ | 114 | /* tesla_44xx_pwrdm: Tesla processor power domain */ |
115 | static struct powerdomain tesla_44xx_pwrdm = { | 115 | static struct powerdomain tesla_44xx_pwrdm = { |
116 | .name = "tesla_pwrdm", | 116 | .name = "tesla_pwrdm", |
117 | .voltdm = { .name = "iva" }, | ||
117 | .prcm_offs = OMAP4430_PRM_TESLA_INST, | 118 | .prcm_offs = OMAP4430_PRM_TESLA_INST, |
118 | .prcm_partition = OMAP4430_PRM_PARTITION, | 119 | .prcm_partition = OMAP4430_PRM_PARTITION, |
119 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
120 | .pwrsts = PWRSTS_OFF_RET_ON, | 120 | .pwrsts = PWRSTS_OFF_RET_ON, |
121 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 121 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
122 | .banks = 3, | 122 | .banks = 3, |
@@ -136,9 +136,9 @@ static struct powerdomain tesla_44xx_pwrdm = { | |||
136 | /* wkup_44xx_pwrdm: Wake-up power domain */ | 136 | /* wkup_44xx_pwrdm: Wake-up power domain */ |
137 | static struct powerdomain wkup_44xx_pwrdm = { | 137 | static struct powerdomain wkup_44xx_pwrdm = { |
138 | .name = "wkup_pwrdm", | 138 | .name = "wkup_pwrdm", |
139 | .voltdm = { .name = "wakeup" }, | ||
139 | .prcm_offs = OMAP4430_PRM_WKUP_INST, | 140 | .prcm_offs = OMAP4430_PRM_WKUP_INST, |
140 | .prcm_partition = OMAP4430_PRM_PARTITION, | 141 | .prcm_partition = OMAP4430_PRM_PARTITION, |
141 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
142 | .pwrsts = PWRSTS_ON, | 142 | .pwrsts = PWRSTS_ON, |
143 | .banks = 1, | 143 | .banks = 1, |
144 | .pwrsts_mem_ret = { | 144 | .pwrsts_mem_ret = { |
@@ -152,9 +152,9 @@ static struct powerdomain wkup_44xx_pwrdm = { | |||
152 | /* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */ | 152 | /* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */ |
153 | static struct powerdomain cpu0_44xx_pwrdm = { | 153 | static struct powerdomain cpu0_44xx_pwrdm = { |
154 | .name = "cpu0_pwrdm", | 154 | .name = "cpu0_pwrdm", |
155 | .voltdm = { .name = "mpu" }, | ||
155 | .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST, | 156 | .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST, |
156 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, | 157 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
157 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
158 | .pwrsts = PWRSTS_OFF_RET_ON, | 158 | .pwrsts = PWRSTS_OFF_RET_ON, |
159 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 159 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
160 | .banks = 1, | 160 | .banks = 1, |
@@ -169,9 +169,9 @@ static struct powerdomain cpu0_44xx_pwrdm = { | |||
169 | /* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */ | 169 | /* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */ |
170 | static struct powerdomain cpu1_44xx_pwrdm = { | 170 | static struct powerdomain cpu1_44xx_pwrdm = { |
171 | .name = "cpu1_pwrdm", | 171 | .name = "cpu1_pwrdm", |
172 | .voltdm = { .name = "mpu" }, | ||
172 | .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST, | 173 | .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST, |
173 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, | 174 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
174 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
175 | .pwrsts = PWRSTS_OFF_RET_ON, | 175 | .pwrsts = PWRSTS_OFF_RET_ON, |
176 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 176 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
177 | .banks = 1, | 177 | .banks = 1, |
@@ -186,9 +186,9 @@ static struct powerdomain cpu1_44xx_pwrdm = { | |||
186 | /* emu_44xx_pwrdm: Emulation power domain */ | 186 | /* emu_44xx_pwrdm: Emulation power domain */ |
187 | static struct powerdomain emu_44xx_pwrdm = { | 187 | static struct powerdomain emu_44xx_pwrdm = { |
188 | .name = "emu_pwrdm", | 188 | .name = "emu_pwrdm", |
189 | .voltdm = { .name = "wakeup" }, | ||
189 | .prcm_offs = OMAP4430_PRM_EMU_INST, | 190 | .prcm_offs = OMAP4430_PRM_EMU_INST, |
190 | .prcm_partition = OMAP4430_PRM_PARTITION, | 191 | .prcm_partition = OMAP4430_PRM_PARTITION, |
191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
192 | .pwrsts = PWRSTS_OFF_ON, | 192 | .pwrsts = PWRSTS_OFF_ON, |
193 | .banks = 1, | 193 | .banks = 1, |
194 | .pwrsts_mem_ret = { | 194 | .pwrsts_mem_ret = { |
@@ -202,9 +202,9 @@ static struct powerdomain emu_44xx_pwrdm = { | |||
202 | /* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */ | 202 | /* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */ |
203 | static struct powerdomain mpu_44xx_pwrdm = { | 203 | static struct powerdomain mpu_44xx_pwrdm = { |
204 | .name = "mpu_pwrdm", | 204 | .name = "mpu_pwrdm", |
205 | .voltdm = { .name = "mpu" }, | ||
205 | .prcm_offs = OMAP4430_PRM_MPU_INST, | 206 | .prcm_offs = OMAP4430_PRM_MPU_INST, |
206 | .prcm_partition = OMAP4430_PRM_PARTITION, | 207 | .prcm_partition = OMAP4430_PRM_PARTITION, |
207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
208 | .pwrsts = PWRSTS_RET_ON, | 208 | .pwrsts = PWRSTS_RET_ON, |
209 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 209 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
210 | .banks = 3, | 210 | .banks = 3, |
@@ -223,9 +223,9 @@ static struct powerdomain mpu_44xx_pwrdm = { | |||
223 | /* ivahd_44xx_pwrdm: IVA-HD power domain */ | 223 | /* ivahd_44xx_pwrdm: IVA-HD power domain */ |
224 | static struct powerdomain ivahd_44xx_pwrdm = { | 224 | static struct powerdomain ivahd_44xx_pwrdm = { |
225 | .name = "ivahd_pwrdm", | 225 | .name = "ivahd_pwrdm", |
226 | .voltdm = { .name = "iva" }, | ||
226 | .prcm_offs = OMAP4430_PRM_IVAHD_INST, | 227 | .prcm_offs = OMAP4430_PRM_IVAHD_INST, |
227 | .prcm_partition = OMAP4430_PRM_PARTITION, | 228 | .prcm_partition = OMAP4430_PRM_PARTITION, |
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 = PWRSTS_OFF, | 230 | .pwrsts_logic_ret = PWRSTS_OFF, |
231 | .banks = 4, | 231 | .banks = 4, |
@@ -247,9 +247,9 @@ static struct powerdomain ivahd_44xx_pwrdm = { | |||
247 | /* cam_44xx_pwrdm: Camera subsystem power domain */ | 247 | /* cam_44xx_pwrdm: Camera subsystem power domain */ |
248 | static struct powerdomain cam_44xx_pwrdm = { | 248 | static struct powerdomain cam_44xx_pwrdm = { |
249 | .name = "cam_pwrdm", | 249 | .name = "cam_pwrdm", |
250 | .voltdm = { .name = "core" }, | ||
250 | .prcm_offs = OMAP4430_PRM_CAM_INST, | 251 | .prcm_offs = OMAP4430_PRM_CAM_INST, |
251 | .prcm_partition = OMAP4430_PRM_PARTITION, | 252 | .prcm_partition = OMAP4430_PRM_PARTITION, |
252 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
253 | .pwrsts = PWRSTS_OFF_ON, | 253 | .pwrsts = PWRSTS_OFF_ON, |
254 | .banks = 1, | 254 | .banks = 1, |
255 | .pwrsts_mem_ret = { | 255 | .pwrsts_mem_ret = { |
@@ -264,9 +264,9 @@ static struct powerdomain cam_44xx_pwrdm = { | |||
264 | /* l3init_44xx_pwrdm: L3 initators pheripherals power domain */ | 264 | /* l3init_44xx_pwrdm: L3 initators pheripherals power domain */ |
265 | static struct powerdomain l3init_44xx_pwrdm = { | 265 | static struct powerdomain l3init_44xx_pwrdm = { |
266 | .name = "l3init_pwrdm", | 266 | .name = "l3init_pwrdm", |
267 | .voltdm = { .name = "core" }, | ||
267 | .prcm_offs = OMAP4430_PRM_L3INIT_INST, | 268 | .prcm_offs = OMAP4430_PRM_L3INIT_INST, |
268 | .prcm_partition = OMAP4430_PRM_PARTITION, | 269 | .prcm_partition = OMAP4430_PRM_PARTITION, |
269 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
270 | .pwrsts = PWRSTS_RET_ON, | 270 | .pwrsts = PWRSTS_RET_ON, |
271 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 271 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
272 | .banks = 1, | 272 | .banks = 1, |
@@ -282,9 +282,9 @@ static struct powerdomain l3init_44xx_pwrdm = { | |||
282 | /* l4per_44xx_pwrdm: Target peripherals power domain */ | 282 | /* l4per_44xx_pwrdm: Target peripherals power domain */ |
283 | static struct powerdomain l4per_44xx_pwrdm = { | 283 | static struct powerdomain l4per_44xx_pwrdm = { |
284 | .name = "l4per_pwrdm", | 284 | .name = "l4per_pwrdm", |
285 | .voltdm = { .name = "core" }, | ||
285 | .prcm_offs = OMAP4430_PRM_L4PER_INST, | 286 | .prcm_offs = OMAP4430_PRM_L4PER_INST, |
286 | .prcm_partition = OMAP4430_PRM_PARTITION, | 287 | .prcm_partition = OMAP4430_PRM_PARTITION, |
287 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
288 | .pwrsts = PWRSTS_RET_ON, | 288 | .pwrsts = PWRSTS_RET_ON, |
289 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 289 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
290 | .banks = 2, | 290 | .banks = 2, |
@@ -305,18 +305,18 @@ static struct powerdomain l4per_44xx_pwrdm = { | |||
305 | */ | 305 | */ |
306 | static struct powerdomain always_on_core_44xx_pwrdm = { | 306 | static struct powerdomain always_on_core_44xx_pwrdm = { |
307 | .name = "always_on_core_pwrdm", | 307 | .name = "always_on_core_pwrdm", |
308 | .voltdm = { .name = "core" }, | ||
308 | .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST, | 309 | .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST, |
309 | .prcm_partition = OMAP4430_PRM_PARTITION, | 310 | .prcm_partition = OMAP4430_PRM_PARTITION, |
310 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
311 | .pwrsts = PWRSTS_ON, | 311 | .pwrsts = PWRSTS_ON, |
312 | }; | 312 | }; |
313 | 313 | ||
314 | /* cefuse_44xx_pwrdm: Customer efuse controller power domain */ | 314 | /* cefuse_44xx_pwrdm: Customer efuse controller power domain */ |
315 | static struct powerdomain cefuse_44xx_pwrdm = { | 315 | static struct powerdomain cefuse_44xx_pwrdm = { |
316 | .name = "cefuse_pwrdm", | 316 | .name = "cefuse_pwrdm", |
317 | .voltdm = { .name = "core" }, | ||
317 | .prcm_offs = OMAP4430_PRM_CEFUSE_INST, | 318 | .prcm_offs = OMAP4430_PRM_CEFUSE_INST, |
318 | .prcm_partition = OMAP4430_PRM_PARTITION, | 319 | .prcm_partition = OMAP4430_PRM_PARTITION, |
319 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
320 | .pwrsts = PWRSTS_OFF_ON, | 320 | .pwrsts = PWRSTS_OFF_ON, |
321 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 321 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
322 | }; | 322 | }; |
@@ -352,5 +352,7 @@ static struct powerdomain *powerdomains_omap44xx[] __initdata = { | |||
352 | 352 | ||
353 | void __init omap44xx_powerdomains_init(void) | 353 | void __init omap44xx_powerdomains_init(void) |
354 | { | 354 | { |
355 | pwrdm_init(powerdomains_omap44xx, &omap4_pwrdm_operations); | 355 | pwrdm_register_platform_funcs(&omap4_pwrdm_operations); |
356 | pwrdm_register_pwrdms(powerdomains_omap44xx); | ||
357 | pwrdm_complete_init(); | ||
356 | } | 358 | } |
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index 051213fbc346..f02d87f68e54 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <plat/cpu.h> | 20 | #include <plat/cpu.h> |
21 | #include <plat/prcm.h> | 21 | #include <plat/prcm.h> |
22 | 22 | ||
23 | #include "vp.h" | ||
24 | |||
23 | #include "prm2xxx_3xxx.h" | 25 | #include "prm2xxx_3xxx.h" |
24 | #include "cm2xxx_3xxx.h" | 26 | #include "cm2xxx_3xxx.h" |
25 | #include "prm-regbits-24xx.h" | 27 | #include "prm-regbits-24xx.h" |
@@ -156,3 +158,57 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift) | |||
156 | 158 | ||
157 | return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; | 159 | return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; |
158 | } | 160 | } |
161 | |||
162 | /* PRM VP */ | ||
163 | |||
164 | /* | ||
165 | * struct omap3_vp - OMAP3 VP register access description. | ||
166 | * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg | ||
167 | */ | ||
168 | struct omap3_vp { | ||
169 | u32 tranxdone_status; | ||
170 | }; | ||
171 | |||
172 | static struct omap3_vp omap3_vp[] = { | ||
173 | [OMAP3_VP_VDD_MPU_ID] = { | ||
174 | .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, | ||
175 | }, | ||
176 | [OMAP3_VP_VDD_CORE_ID] = { | ||
177 | .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK, | ||
178 | }, | ||
179 | }; | ||
180 | |||
181 | #define MAX_VP_ID ARRAY_SIZE(omap3_vp); | ||
182 | |||
183 | u32 omap3_prm_vp_check_txdone(u8 vp_id) | ||
184 | { | ||
185 | struct omap3_vp *vp = &omap3_vp[vp_id]; | ||
186 | u32 irqstatus; | ||
187 | |||
188 | irqstatus = omap2_prm_read_mod_reg(OCP_MOD, | ||
189 | OMAP3_PRM_IRQSTATUS_MPU_OFFSET); | ||
190 | return irqstatus & vp->tranxdone_status; | ||
191 | } | ||
192 | |||
193 | void omap3_prm_vp_clear_txdone(u8 vp_id) | ||
194 | { | ||
195 | struct omap3_vp *vp = &omap3_vp[vp_id]; | ||
196 | |||
197 | omap2_prm_write_mod_reg(vp->tranxdone_status, | ||
198 | OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); | ||
199 | } | ||
200 | |||
201 | u32 omap3_prm_vcvp_read(u8 offset) | ||
202 | { | ||
203 | return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset); | ||
204 | } | ||
205 | |||
206 | void omap3_prm_vcvp_write(u32 val, u8 offset) | ||
207 | { | ||
208 | omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset); | ||
209 | } | ||
210 | |||
211 | u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset) | ||
212 | { | ||
213 | return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset); | ||
214 | } | ||
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h index a1fc62a39dbb..cef533df0861 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h | |||
@@ -303,7 +303,19 @@ extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); | |||
303 | extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); | 303 | extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); |
304 | extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift); | 304 | extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift); |
305 | 305 | ||
306 | /* OMAP3-specific VP functions */ | ||
307 | u32 omap3_prm_vp_check_txdone(u8 vp_id); | ||
308 | void omap3_prm_vp_clear_txdone(u8 vp_id); | ||
309 | |||
310 | /* | ||
311 | * OMAP3 access functions for voltage controller (VC) and | ||
312 | * voltage proccessor (VP) in the PRM. | ||
313 | */ | ||
314 | extern u32 omap3_prm_vcvp_read(u8 offset); | ||
315 | extern void omap3_prm_vcvp_write(u32 val, u8 offset); | ||
316 | extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | ||
306 | #endif /* CONFIG_ARCH_OMAP4 */ | 317 | #endif /* CONFIG_ARCH_OMAP4 */ |
318 | |||
307 | #endif | 319 | #endif |
308 | 320 | ||
309 | /* | 321 | /* |
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 00165558fc4d..495a31a7e8a7 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -21,8 +21,11 @@ | |||
21 | #include <plat/cpu.h> | 21 | #include <plat/cpu.h> |
22 | #include <plat/prcm.h> | 22 | #include <plat/prcm.h> |
23 | 23 | ||
24 | #include "vp.h" | ||
24 | #include "prm44xx.h" | 25 | #include "prm44xx.h" |
25 | #include "prm-regbits-44xx.h" | 26 | #include "prm-regbits-44xx.h" |
27 | #include "prcm44xx.h" | ||
28 | #include "prminst44xx.h" | ||
26 | 29 | ||
27 | /* PRM low-level functions */ | 30 | /* PRM low-level functions */ |
28 | 31 | ||
@@ -50,3 +53,71 @@ u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg) | |||
50 | 53 | ||
51 | return v; | 54 | return v; |
52 | } | 55 | } |
56 | |||
57 | /* PRM VP */ | ||
58 | |||
59 | /* | ||
60 | * struct omap4_vp - OMAP4 VP register access description. | ||
61 | * @irqstatus_mpu: offset to IRQSTATUS_MPU register for VP | ||
62 | * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg | ||
63 | */ | ||
64 | struct omap4_vp { | ||
65 | u32 irqstatus_mpu; | ||
66 | u32 tranxdone_status; | ||
67 | }; | ||
68 | |||
69 | static struct omap4_vp omap4_vp[] = { | ||
70 | [OMAP4_VP_VDD_MPU_ID] = { | ||
71 | .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET, | ||
72 | .tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK, | ||
73 | }, | ||
74 | [OMAP4_VP_VDD_IVA_ID] = { | ||
75 | .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, | ||
76 | .tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK, | ||
77 | }, | ||
78 | [OMAP4_VP_VDD_CORE_ID] = { | ||
79 | .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, | ||
80 | .tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | u32 omap4_prm_vp_check_txdone(u8 vp_id) | ||
85 | { | ||
86 | struct omap4_vp *vp = &omap4_vp[vp_id]; | ||
87 | u32 irqstatus; | ||
88 | |||
89 | irqstatus = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, | ||
90 | OMAP4430_PRM_OCP_SOCKET_INST, | ||
91 | vp->irqstatus_mpu); | ||
92 | return irqstatus & vp->tranxdone_status; | ||
93 | } | ||
94 | |||
95 | void omap4_prm_vp_clear_txdone(u8 vp_id) | ||
96 | { | ||
97 | struct omap4_vp *vp = &omap4_vp[vp_id]; | ||
98 | |||
99 | omap4_prminst_write_inst_reg(vp->tranxdone_status, | ||
100 | OMAP4430_PRM_PARTITION, | ||
101 | OMAP4430_PRM_OCP_SOCKET_INST, | ||
102 | vp->irqstatus_mpu); | ||
103 | }; | ||
104 | |||
105 | u32 omap4_prm_vcvp_read(u8 offset) | ||
106 | { | ||
107 | return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, | ||
108 | OMAP4430_PRM_DEVICE_INST, offset); | ||
109 | } | ||
110 | |||
111 | void omap4_prm_vcvp_write(u32 val, u8 offset) | ||
112 | { | ||
113 | omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, | ||
114 | OMAP4430_PRM_DEVICE_INST, offset); | ||
115 | } | ||
116 | |||
117 | u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset) | ||
118 | { | ||
119 | return omap4_prminst_rmw_inst_reg_bits(mask, bits, | ||
120 | OMAP4430_PRM_PARTITION, | ||
121 | OMAP4430_PRM_DEVICE_INST, | ||
122 | offset); | ||
123 | } | ||
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h index 7dfa379b625d..3d66ccd849d2 100644 --- a/arch/arm/mach-omap2/prm44xx.h +++ b/arch/arm/mach-omap2/prm44xx.h | |||
@@ -751,6 +751,18 @@ extern u32 omap4_prm_read_inst_reg(s16 inst, u16 idx); | |||
751 | extern void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 idx); | 751 | extern void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 idx); |
752 | extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); | 752 | extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); |
753 | 753 | ||
754 | /* OMAP4-specific VP functions */ | ||
755 | u32 omap4_prm_vp_check_txdone(u8 vp_id); | ||
756 | void omap4_prm_vp_clear_txdone(u8 vp_id); | ||
757 | |||
758 | /* | ||
759 | * OMAP4 access functions for voltage controller (VC) and | ||
760 | * voltage proccessor (VP) in the PRM. | ||
761 | */ | ||
762 | extern u32 omap4_prm_vcvp_read(u8 offset); | ||
763 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); | ||
764 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | ||
765 | |||
754 | # endif | 766 | # endif |
755 | 767 | ||
756 | #endif | 768 | #endif |
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c index f438cf4d847b..53d9d0a5b39d 100644 --- a/arch/arm/mach-omap2/smartreflex-class3.c +++ b/arch/arm/mach-omap2/smartreflex-class3.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | static int sr_class3_enable(struct voltagedomain *voltdm) | 16 | static int sr_class3_enable(struct voltagedomain *voltdm) |
17 | { | 17 | { |
18 | unsigned long volt = omap_voltage_get_nom_volt(voltdm); | 18 | unsigned long volt = voltdm_get_voltage(voltdm); |
19 | 19 | ||
20 | if (!volt) { | 20 | if (!volt) { |
21 | pr_warning("%s: Curr voltage unknown. Cannot enable sr_%s\n", | 21 | pr_warning("%s: Curr voltage unknown. Cannot enable sr_%s\n", |
@@ -32,7 +32,7 @@ static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset) | |||
32 | omap_vp_disable(voltdm); | 32 | omap_vp_disable(voltdm); |
33 | sr_disable(voltdm); | 33 | sr_disable(voltdm); |
34 | if (is_volt_reset) | 34 | if (is_volt_reset) |
35 | omap_voltage_reset(voltdm); | 35 | voltdm_reset(voltdm); |
36 | 36 | ||
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 34c01a7de810..bb606c9709b2 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
@@ -62,6 +62,7 @@ static LIST_HEAD(sr_list); | |||
62 | 62 | ||
63 | static struct omap_sr_class_data *sr_class; | 63 | static struct omap_sr_class_data *sr_class; |
64 | static struct omap_sr_pmic_data *sr_pmic_data; | 64 | static struct omap_sr_pmic_data *sr_pmic_data; |
65 | static struct dentry *sr_dbg_dir; | ||
65 | 66 | ||
66 | static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) | 67 | static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) |
67 | { | 68 | { |
@@ -826,9 +827,10 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
826 | struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); | 827 | struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); |
827 | struct omap_sr_data *pdata = pdev->dev.platform_data; | 828 | struct omap_sr_data *pdata = pdev->dev.platform_data; |
828 | struct resource *mem, *irq; | 829 | struct resource *mem, *irq; |
829 | struct dentry *vdd_dbg_dir, *nvalue_dir; | 830 | struct dentry *nvalue_dir; |
830 | struct omap_volt_data *volt_data; | 831 | struct omap_volt_data *volt_data; |
831 | int i, ret = 0; | 832 | int i, ret = 0; |
833 | char *name; | ||
832 | 834 | ||
833 | if (!sr_info) { | 835 | if (!sr_info) { |
834 | dev_err(&pdev->dev, "%s: unable to allocate sr_info\n", | 836 | dev_err(&pdev->dev, "%s: unable to allocate sr_info\n", |
@@ -899,18 +901,25 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
899 | } | 901 | } |
900 | 902 | ||
901 | dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__); | 903 | dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__); |
904 | if (!sr_dbg_dir) { | ||
905 | sr_dbg_dir = debugfs_create_dir("smartreflex", NULL); | ||
906 | if (!sr_dbg_dir) { | ||
907 | ret = PTR_ERR(sr_dbg_dir); | ||
908 | pr_err("%s:sr debugfs dir creation failed(%d)\n", | ||
909 | __func__, ret); | ||
910 | goto err_iounmap; | ||
911 | } | ||
912 | } | ||
902 | 913 | ||
903 | /* | 914 | name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name); |
904 | * If the voltage domain debugfs directory is not created, do | 915 | if (!name) { |
905 | * not try to create rest of the debugfs entries. | 916 | dev_err(&pdev->dev, "%s: Unable to alloc debugfs name\n", |
906 | */ | 917 | __func__); |
907 | vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); | 918 | ret = -ENOMEM; |
908 | if (!vdd_dbg_dir) { | ||
909 | ret = -EINVAL; | ||
910 | goto err_iounmap; | 919 | goto err_iounmap; |
911 | } | 920 | } |
912 | 921 | sr_info->dbg_dir = debugfs_create_dir(name, sr_dbg_dir); | |
913 | sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); | 922 | kfree(name); |
914 | if (IS_ERR(sr_info->dbg_dir)) { | 923 | if (IS_ERR(sr_info->dbg_dir)) { |
915 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", | 924 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", |
916 | __func__); | 925 | __func__); |
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index 10d3c5ee8018..2782d3f604ca 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c | |||
@@ -102,7 +102,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) | |||
102 | sr_data->senn_mod = 0x1; | 102 | sr_data->senn_mod = 0x1; |
103 | sr_data->senp_mod = 0x1; | 103 | sr_data->senp_mod = 0x1; |
104 | 104 | ||
105 | sr_data->voltdm = omap_voltage_domain_lookup(oh->vdd_name); | 105 | sr_data->voltdm = voltdm_lookup(oh->vdd_name); |
106 | if (IS_ERR(sr_data->voltdm)) { | 106 | if (IS_ERR(sr_data->voltdm)) { |
107 | pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", | 107 | pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", |
108 | __func__, oh->vdd_name); | 108 | __func__, oh->vdd_name); |
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c new file mode 100644 index 000000000000..031d116fbf10 --- /dev/null +++ b/arch/arm/mach-omap2/vc.c | |||
@@ -0,0 +1,367 @@ | |||
1 | /* | ||
2 | * OMAP Voltage Controller (VC) interface | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/delay.h> | ||
12 | #include <linux/init.h> | ||
13 | |||
14 | #include <plat/cpu.h> | ||
15 | |||
16 | #include "voltage.h" | ||
17 | #include "vc.h" | ||
18 | #include "prm-regbits-34xx.h" | ||
19 | #include "prm-regbits-44xx.h" | ||
20 | #include "prm44xx.h" | ||
21 | |||
22 | /** | ||
23 | * struct omap_vc_channel_cfg - describe the cfg_channel bitfield | ||
24 | * @sa: bit for slave address | ||
25 | * @rav: bit for voltage configuration register | ||
26 | * @rac: bit for command configuration register | ||
27 | * @racen: enable bit for RAC | ||
28 | * @cmd: bit for command value set selection | ||
29 | * | ||
30 | * Channel configuration bits, common for OMAP3+ | ||
31 | * OMAP3 register: PRM_VC_CH_CONF | ||
32 | * OMAP4 register: PRM_VC_CFG_CHANNEL | ||
33 | * OMAP5 register: PRM_VC_SMPS_<voltdm>_CONFIG | ||
34 | */ | ||
35 | struct omap_vc_channel_cfg { | ||
36 | u8 sa; | ||
37 | u8 rav; | ||
38 | u8 rac; | ||
39 | u8 racen; | ||
40 | u8 cmd; | ||
41 | }; | ||
42 | |||
43 | static struct omap_vc_channel_cfg vc_default_channel_cfg = { | ||
44 | .sa = BIT(0), | ||
45 | .rav = BIT(1), | ||
46 | .rac = BIT(2), | ||
47 | .racen = BIT(3), | ||
48 | .cmd = BIT(4), | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * On OMAP3+, all VC channels have the above default bitfield | ||
53 | * configuration, except the OMAP4 MPU channel. This appears | ||
54 | * to be a freak accident as every other VC channel has the | ||
55 | * default configuration, thus creating a mutant channel config. | ||
56 | */ | ||
57 | static struct omap_vc_channel_cfg vc_mutant_channel_cfg = { | ||
58 | .sa = BIT(0), | ||
59 | .rav = BIT(2), | ||
60 | .rac = BIT(3), | ||
61 | .racen = BIT(4), | ||
62 | .cmd = BIT(1), | ||
63 | }; | ||
64 | |||
65 | static struct omap_vc_channel_cfg *vc_cfg_bits; | ||
66 | #define CFG_CHANNEL_MASK 0x1f | ||
67 | |||
68 | /** | ||
69 | * omap_vc_config_channel - configure VC channel to PMIC mappings | ||
70 | * @voltdm: pointer to voltagdomain defining the desired VC channel | ||
71 | * | ||
72 | * Configures the VC channel to PMIC mappings for the following | ||
73 | * PMIC settings | ||
74 | * - i2c slave address (SA) | ||
75 | * - voltage configuration address (RAV) | ||
76 | * - command configuration address (RAC) and enable bit (RACEN) | ||
77 | * - command values for ON, ONLP, RET and OFF (CMD) | ||
78 | * | ||
79 | * This function currently only allows flexible configuration of the | ||
80 | * non-default channel. Starting with OMAP4, there are more than 2 | ||
81 | * channels, with one defined as the default (on OMAP4, it's MPU.) | ||
82 | * Only the non-default channel can be configured. | ||
83 | */ | ||
84 | static int omap_vc_config_channel(struct voltagedomain *voltdm) | ||
85 | { | ||
86 | struct omap_vc_channel *vc = voltdm->vc; | ||
87 | |||
88 | /* | ||
89 | * For default channel, the only configurable bit is RACEN. | ||
90 | * All others must stay at zero (see function comment above.) | ||
91 | */ | ||
92 | if (vc->flags & OMAP_VC_CHANNEL_DEFAULT) | ||
93 | vc->cfg_channel &= vc_cfg_bits->racen; | ||
94 | |||
95 | voltdm->rmw(CFG_CHANNEL_MASK << vc->cfg_channel_sa_shift, | ||
96 | vc->cfg_channel << vc->cfg_channel_sa_shift, | ||
97 | vc->cfg_channel_reg); | ||
98 | |||
99 | return 0; | ||
100 | } | ||
101 | |||
102 | /* Voltage scale and accessory APIs */ | ||
103 | int omap_vc_pre_scale(struct voltagedomain *voltdm, | ||
104 | unsigned long target_volt, | ||
105 | u8 *target_vsel, u8 *current_vsel) | ||
106 | { | ||
107 | struct omap_vc_channel *vc = voltdm->vc; | ||
108 | u32 vc_cmdval; | ||
109 | |||
110 | /* Check if sufficient pmic info is available for this vdd */ | ||
111 | if (!voltdm->pmic) { | ||
112 | pr_err("%s: Insufficient pmic info to scale the vdd_%s\n", | ||
113 | __func__, voltdm->name); | ||
114 | return -EINVAL; | ||
115 | } | ||
116 | |||
117 | if (!voltdm->pmic->uv_to_vsel) { | ||
118 | pr_err("%s: PMIC function to convert voltage in uV to" | ||
119 | "vsel not registered. Hence unable to scale voltage" | ||
120 | "for vdd_%s\n", __func__, voltdm->name); | ||
121 | return -ENODATA; | ||
122 | } | ||
123 | |||
124 | if (!voltdm->read || !voltdm->write) { | ||
125 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
126 | __func__, voltdm->name); | ||
127 | return -EINVAL; | ||
128 | } | ||
129 | |||
130 | *target_vsel = voltdm->pmic->uv_to_vsel(target_volt); | ||
131 | *current_vsel = voltdm->pmic->uv_to_vsel(voltdm->nominal_volt); | ||
132 | |||
133 | /* Setting the ON voltage to the new target voltage */ | ||
134 | vc_cmdval = voltdm->read(vc->cmdval_reg); | ||
135 | vc_cmdval &= ~vc->common->cmd_on_mask; | ||
136 | vc_cmdval |= (*target_vsel << vc->common->cmd_on_shift); | ||
137 | voltdm->write(vc_cmdval, vc->cmdval_reg); | ||
138 | |||
139 | omap_vp_update_errorgain(voltdm, target_volt); | ||
140 | |||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | void omap_vc_post_scale(struct voltagedomain *voltdm, | ||
145 | unsigned long target_volt, | ||
146 | u8 target_vsel, u8 current_vsel) | ||
147 | { | ||
148 | u32 smps_steps = 0, smps_delay = 0; | ||
149 | |||
150 | smps_steps = abs(target_vsel - current_vsel); | ||
151 | /* SMPS slew rate / step size. 2us added as buffer. */ | ||
152 | smps_delay = ((smps_steps * voltdm->pmic->step_size) / | ||
153 | voltdm->pmic->slew_rate) + 2; | ||
154 | udelay(smps_delay); | ||
155 | } | ||
156 | |||
157 | /* vc_bypass_scale - VC bypass method of voltage scaling */ | ||
158 | int omap_vc_bypass_scale(struct voltagedomain *voltdm, | ||
159 | unsigned long target_volt) | ||
160 | { | ||
161 | struct omap_vc_channel *vc = voltdm->vc; | ||
162 | u32 loop_cnt = 0, retries_cnt = 0; | ||
163 | u32 vc_valid, vc_bypass_val_reg, vc_bypass_value; | ||
164 | u8 target_vsel, current_vsel; | ||
165 | int ret; | ||
166 | |||
167 | ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, ¤t_vsel); | ||
168 | if (ret) | ||
169 | return ret; | ||
170 | |||
171 | vc_valid = vc->common->valid; | ||
172 | vc_bypass_val_reg = vc->common->bypass_val_reg; | ||
173 | vc_bypass_value = (target_vsel << vc->common->data_shift) | | ||
174 | (vc->volt_reg_addr << vc->common->regaddr_shift) | | ||
175 | (vc->i2c_slave_addr << vc->common->slaveaddr_shift); | ||
176 | |||
177 | voltdm->write(vc_bypass_value, vc_bypass_val_reg); | ||
178 | voltdm->write(vc_bypass_value | vc_valid, vc_bypass_val_reg); | ||
179 | |||
180 | vc_bypass_value = voltdm->read(vc_bypass_val_reg); | ||
181 | /* | ||
182 | * Loop till the bypass command is acknowledged from the SMPS. | ||
183 | * NOTE: This is legacy code. The loop count and retry count needs | ||
184 | * to be revisited. | ||
185 | */ | ||
186 | while (!(vc_bypass_value & vc_valid)) { | ||
187 | loop_cnt++; | ||
188 | |||
189 | if (retries_cnt > 10) { | ||
190 | pr_warning("%s: Retry count exceeded\n", __func__); | ||
191 | return -ETIMEDOUT; | ||
192 | } | ||
193 | |||
194 | if (loop_cnt > 50) { | ||
195 | retries_cnt++; | ||
196 | loop_cnt = 0; | ||
197 | udelay(10); | ||
198 | } | ||
199 | vc_bypass_value = voltdm->read(vc_bypass_val_reg); | ||
200 | } | ||
201 | |||
202 | omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); | ||
203 | return 0; | ||
204 | } | ||
205 | |||
206 | static void __init omap3_vfsm_init(struct voltagedomain *voltdm) | ||
207 | { | ||
208 | /* | ||
209 | * Voltage Manager FSM parameters init | ||
210 | * XXX This data should be passed in from the board file | ||
211 | */ | ||
212 | voltdm->write(OMAP3_CLKSETUP, OMAP3_PRM_CLKSETUP_OFFSET); | ||
213 | voltdm->write(OMAP3_VOLTOFFSET, OMAP3_PRM_VOLTOFFSET_OFFSET); | ||
214 | voltdm->write(OMAP3_VOLTSETUP2, OMAP3_PRM_VOLTSETUP2_OFFSET); | ||
215 | } | ||
216 | |||
217 | static void __init omap3_vc_init_channel(struct voltagedomain *voltdm) | ||
218 | { | ||
219 | static bool is_initialized; | ||
220 | |||
221 | if (is_initialized) | ||
222 | return; | ||
223 | |||
224 | omap3_vfsm_init(voltdm); | ||
225 | |||
226 | is_initialized = true; | ||
227 | } | ||
228 | |||
229 | |||
230 | /* OMAP4 specific voltage init functions */ | ||
231 | static void __init omap4_vc_init_channel(struct voltagedomain *voltdm) | ||
232 | { | ||
233 | static bool is_initialized; | ||
234 | u32 vc_val; | ||
235 | |||
236 | if (is_initialized) | ||
237 | return; | ||
238 | |||
239 | /* XXX These are magic numbers and do not belong! */ | ||
240 | vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT); | ||
241 | voltdm->write(vc_val, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET); | ||
242 | |||
243 | is_initialized = true; | ||
244 | } | ||
245 | |||
246 | /** | ||
247 | * omap_vc_i2c_init - initialize I2C interface to PMIC | ||
248 | * @voltdm: voltage domain containing VC data | ||
249 | * | ||
250 | * Use PMIC supplied seetings for I2C high-speed mode and | ||
251 | * master code (if set) and program the VC I2C configuration | ||
252 | * register. | ||
253 | * | ||
254 | * The VC I2C configuration is common to all VC channels, | ||
255 | * so this function only configures I2C for the first VC | ||
256 | * channel registers. All other VC channels will use the | ||
257 | * same configuration. | ||
258 | */ | ||
259 | static void __init omap_vc_i2c_init(struct voltagedomain *voltdm) | ||
260 | { | ||
261 | struct omap_vc_channel *vc = voltdm->vc; | ||
262 | static bool initialized; | ||
263 | static bool i2c_high_speed; | ||
264 | u8 mcode; | ||
265 | |||
266 | if (initialized) { | ||
267 | if (voltdm->pmic->i2c_high_speed != i2c_high_speed) | ||
268 | pr_warn("%s: I2C config for all channels must match.", | ||
269 | __func__); | ||
270 | return; | ||
271 | } | ||
272 | |||
273 | i2c_high_speed = voltdm->pmic->i2c_high_speed; | ||
274 | if (i2c_high_speed) | ||
275 | voltdm->rmw(vc->common->i2c_cfg_hsen_mask, | ||
276 | vc->common->i2c_cfg_hsen_mask, | ||
277 | vc->common->i2c_cfg_reg); | ||
278 | |||
279 | mcode = voltdm->pmic->i2c_mcode; | ||
280 | if (mcode) | ||
281 | voltdm->rmw(vc->common->i2c_mcode_mask, | ||
282 | mcode << __ffs(vc->common->i2c_mcode_mask), | ||
283 | vc->common->i2c_cfg_reg); | ||
284 | |||
285 | initialized = true; | ||
286 | } | ||
287 | |||
288 | void __init omap_vc_init_channel(struct voltagedomain *voltdm) | ||
289 | { | ||
290 | struct omap_vc_channel *vc = voltdm->vc; | ||
291 | u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; | ||
292 | u32 val; | ||
293 | |||
294 | if (!voltdm->pmic || !voltdm->pmic->uv_to_vsel) { | ||
295 | pr_err("%s: PMIC info requried to configure vc for" | ||
296 | "vdd_%s not populated.Hence cannot initialize vc\n", | ||
297 | __func__, voltdm->name); | ||
298 | return; | ||
299 | } | ||
300 | |||
301 | if (!voltdm->read || !voltdm->write) { | ||
302 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
303 | __func__, voltdm->name); | ||
304 | return; | ||
305 | } | ||
306 | |||
307 | vc->cfg_channel = 0; | ||
308 | if (vc->flags & OMAP_VC_CHANNEL_CFG_MUTANT) | ||
309 | vc_cfg_bits = &vc_mutant_channel_cfg; | ||
310 | else | ||
311 | vc_cfg_bits = &vc_default_channel_cfg; | ||
312 | |||
313 | /* get PMIC/board specific settings */ | ||
314 | vc->i2c_slave_addr = voltdm->pmic->i2c_slave_addr; | ||
315 | vc->volt_reg_addr = voltdm->pmic->volt_reg_addr; | ||
316 | vc->cmd_reg_addr = voltdm->pmic->cmd_reg_addr; | ||
317 | vc->setup_time = voltdm->pmic->volt_setup_time; | ||
318 | |||
319 | /* Configure the i2c slave address for this VC */ | ||
320 | voltdm->rmw(vc->smps_sa_mask, | ||
321 | vc->i2c_slave_addr << __ffs(vc->smps_sa_mask), | ||
322 | vc->smps_sa_reg); | ||
323 | vc->cfg_channel |= vc_cfg_bits->sa; | ||
324 | |||
325 | /* | ||
326 | * Configure the PMIC register addresses. | ||
327 | */ | ||
328 | voltdm->rmw(vc->smps_volra_mask, | ||
329 | vc->volt_reg_addr << __ffs(vc->smps_volra_mask), | ||
330 | vc->smps_volra_reg); | ||
331 | vc->cfg_channel |= vc_cfg_bits->rav; | ||
332 | |||
333 | if (vc->cmd_reg_addr) { | ||
334 | voltdm->rmw(vc->smps_cmdra_mask, | ||
335 | vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask), | ||
336 | vc->smps_cmdra_reg); | ||
337 | vc->cfg_channel |= vc_cfg_bits->rac | vc_cfg_bits->racen; | ||
338 | } | ||
339 | |||
340 | /* Set up the on, inactive, retention and off voltage */ | ||
341 | on_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->on_volt); | ||
342 | onlp_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->onlp_volt); | ||
343 | ret_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->ret_volt); | ||
344 | off_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->off_volt); | ||
345 | val = ((on_vsel << vc->common->cmd_on_shift) | | ||
346 | (onlp_vsel << vc->common->cmd_onlp_shift) | | ||
347 | (ret_vsel << vc->common->cmd_ret_shift) | | ||
348 | (off_vsel << vc->common->cmd_off_shift)); | ||
349 | voltdm->write(val, vc->cmdval_reg); | ||
350 | vc->cfg_channel |= vc_cfg_bits->cmd; | ||
351 | |||
352 | /* Channel configuration */ | ||
353 | omap_vc_config_channel(voltdm); | ||
354 | |||
355 | /* Configure the setup times */ | ||
356 | voltdm->rmw(voltdm->vfsm->voltsetup_mask, | ||
357 | vc->setup_time << __ffs(voltdm->vfsm->voltsetup_mask), | ||
358 | voltdm->vfsm->voltsetup_reg); | ||
359 | |||
360 | omap_vc_i2c_init(voltdm); | ||
361 | |||
362 | if (cpu_is_omap34xx()) | ||
363 | omap3_vc_init_channel(voltdm); | ||
364 | else if (cpu_is_omap44xx()) | ||
365 | omap4_vc_init_channel(voltdm); | ||
366 | } | ||
367 | |||
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h index e7767771de49..478bf6b432c4 100644 --- a/arch/arm/mach-omap2/vc.h +++ b/arch/arm/mach-omap2/vc.h | |||
@@ -19,12 +19,12 @@ | |||
19 | 19 | ||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | 21 | ||
22 | struct voltagedomain; | ||
23 | |||
22 | /** | 24 | /** |
23 | * struct omap_vc_common_data - per-VC register/bitfield data | 25 | * struct omap_vc_common - per-VC register/bitfield data |
24 | * @cmd_on_mask: ON bitmask in PRM_VC_CMD_VAL* register | 26 | * @cmd_on_mask: ON bitmask in PRM_VC_CMD_VAL* register |
25 | * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register | 27 | * @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 | 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 | 29 | * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register |
30 | * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register | 30 | * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register |
@@ -33,15 +33,16 @@ | |||
33 | * @cmd_onlp_shift: ONLP 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 | 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 | 35 | * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register |
36 | * @i2c_cfg_reg: I2C configuration register offset | ||
37 | * @i2c_cfg_hsen_mask: high-speed mode bit field mask in I2C config register | ||
38 | * @i2c_mcode_mask: MCODE field mask for I2C config register | ||
36 | * | 39 | * |
37 | * XXX One of cmd_on_mask and cmd_on_shift are not needed | 40 | * XXX One of cmd_on_mask and cmd_on_shift are not needed |
38 | * XXX VALID should probably be a shift, not a mask | 41 | * XXX VALID should probably be a shift, not a mask |
39 | */ | 42 | */ |
40 | struct omap_vc_common_data { | 43 | struct omap_vc_common { |
41 | u32 cmd_on_mask; | 44 | u32 cmd_on_mask; |
42 | u32 valid; | 45 | u32 valid; |
43 | u8 smps_sa_reg; | ||
44 | u8 smps_volra_reg; | ||
45 | u8 bypass_val_reg; | 46 | u8 bypass_val_reg; |
46 | u8 data_shift; | 47 | u8 data_shift; |
47 | u8 slaveaddr_shift; | 48 | u8 slaveaddr_shift; |
@@ -50,34 +51,75 @@ struct omap_vc_common_data { | |||
50 | u8 cmd_onlp_shift; | 51 | u8 cmd_onlp_shift; |
51 | u8 cmd_ret_shift; | 52 | u8 cmd_ret_shift; |
52 | u8 cmd_off_shift; | 53 | u8 cmd_off_shift; |
54 | u8 i2c_cfg_reg; | ||
55 | u8 i2c_cfg_hsen_mask; | ||
56 | u8 i2c_mcode_mask; | ||
53 | }; | 57 | }; |
54 | 58 | ||
59 | /* omap_vc_channel.flags values */ | ||
60 | #define OMAP_VC_CHANNEL_DEFAULT BIT(0) | ||
61 | #define OMAP_VC_CHANNEL_CFG_MUTANT BIT(1) | ||
62 | |||
55 | /** | 63 | /** |
56 | * struct omap_vc_instance_data - VC per-instance data | 64 | * struct omap_vc_channel - VC per-instance data |
57 | * @vc_common: pointer to VC common data for this platform | 65 | * @i2c_slave_addr: I2C slave address of PMIC for this VC channel |
58 | * @smps_sa_mask: SA* bitmask in the PRM_VC_SMPS_SA register | 66 | * @volt_reg_addr: voltage configuration register address |
59 | * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register | 67 | * @cmd_reg_addr: command configuration register address |
60 | * @smps_sa_shift: SA* field shift in the PRM_VC_SMPS_SA register | 68 | * @setup_time: setup time (in sys_clk cycles) of regulator for this channel |
61 | * @smps_volra_shift: VOLRA* field shift in the PRM_VC_VOL_RA register | 69 | * @cfg_channel: current value of VC channel configuration register |
70 | * @i2c_high_speed: whether or not to use I2C high-speed mode | ||
62 | * | 71 | * |
63 | * XXX It is not necessary to have both a *_mask and a *_shift - | 72 | * @common: pointer to VC common data for this platform |
64 | * remove one | 73 | * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register |
74 | * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register | ||
75 | * @smps_cmdra_mask: CMDRA* bitmask in the PRM_VC_CMD_RA register | ||
76 | * @cmdval_reg: register for on/ret/off voltage level values for this channel | ||
77 | * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start | ||
78 | * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start | ||
79 | * @smps_cmdra_reg: Offset of PRM_VC_SMPS_CMD_RA reg from PRM start | ||
80 | * @cfg_channel_reg: VC channel configuration register | ||
81 | * @cfg_channel_sa_shift: bit shift for slave address cfg_channel register | ||
82 | * @flags: VC channel-specific flags (optional) | ||
65 | */ | 83 | */ |
66 | struct omap_vc_instance_data { | 84 | struct omap_vc_channel { |
67 | const struct omap_vc_common_data *vc_common; | 85 | /* channel state */ |
86 | u16 i2c_slave_addr; | ||
87 | u16 volt_reg_addr; | ||
88 | u16 cmd_reg_addr; | ||
89 | u16 setup_time; | ||
90 | u8 cfg_channel; | ||
91 | bool i2c_high_speed; | ||
92 | |||
93 | /* register access data */ | ||
94 | const struct omap_vc_common *common; | ||
68 | u32 smps_sa_mask; | 95 | u32 smps_sa_mask; |
69 | u32 smps_volra_mask; | 96 | u32 smps_volra_mask; |
97 | u32 smps_cmdra_mask; | ||
70 | u8 cmdval_reg; | 98 | u8 cmdval_reg; |
71 | u8 smps_sa_shift; | 99 | u8 smps_sa_reg; |
72 | u8 smps_volra_shift; | 100 | u8 smps_volra_reg; |
101 | u8 smps_cmdra_reg; | ||
102 | u8 cfg_channel_reg; | ||
103 | u8 cfg_channel_sa_shift; | ||
104 | u8 flags; | ||
73 | }; | 105 | }; |
74 | 106 | ||
75 | extern struct omap_vc_instance_data omap3_vc1_data; | 107 | extern struct omap_vc_channel omap3_vc_mpu; |
76 | extern struct omap_vc_instance_data omap3_vc2_data; | 108 | extern struct omap_vc_channel omap3_vc_core; |
109 | |||
110 | extern struct omap_vc_channel omap4_vc_mpu; | ||
111 | extern struct omap_vc_channel omap4_vc_iva; | ||
112 | extern struct omap_vc_channel omap4_vc_core; | ||
77 | 113 | ||
78 | extern struct omap_vc_instance_data omap4_vc_mpu_data; | 114 | void omap_vc_init_channel(struct voltagedomain *voltdm); |
79 | extern struct omap_vc_instance_data omap4_vc_iva_data; | 115 | int omap_vc_pre_scale(struct voltagedomain *voltdm, |
80 | extern struct omap_vc_instance_data omap4_vc_core_data; | 116 | unsigned long target_volt, |
117 | u8 *target_vsel, u8 *current_vsel); | ||
118 | void omap_vc_post_scale(struct voltagedomain *voltdm, | ||
119 | unsigned long target_volt, | ||
120 | u8 target_vsel, u8 current_vsel); | ||
121 | int omap_vc_bypass_scale(struct voltagedomain *voltdm, | ||
122 | unsigned long target_volt); | ||
81 | 123 | ||
82 | #endif | 124 | #endif |
83 | 125 | ||
diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c index f37dc4bc379a..cfe348e1af0e 100644 --- a/arch/arm/mach-omap2/vc3xxx_data.c +++ b/arch/arm/mach-omap2/vc3xxx_data.c | |||
@@ -29,9 +29,7 @@ | |||
29 | * VC data common to 34xx/36xx chips | 29 | * VC data common to 34xx/36xx chips |
30 | * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. | 30 | * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. |
31 | */ | 31 | */ |
32 | static struct omap_vc_common_data omap3_vc_common = { | 32 | static struct omap_vc_common 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, | 33 | .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET, |
36 | .data_shift = OMAP3430_DATA_SHIFT, | 34 | .data_shift = OMAP3430_DATA_SHIFT, |
37 | .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT, | 35 | .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT, |
@@ -42,22 +40,33 @@ static struct omap_vc_common_data omap3_vc_common = { | |||
42 | .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT, | 40 | .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT, |
43 | .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT, | 41 | .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT, |
44 | .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT, | 42 | .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT, |
43 | .i2c_cfg_hsen_mask = OMAP3430_HSEN_MASK, | ||
44 | .i2c_cfg_reg = OMAP3_PRM_VC_I2C_CFG_OFFSET, | ||
45 | .i2c_mcode_mask = OMAP3430_MCODE_MASK, | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | struct omap_vc_instance_data omap3_vc1_data = { | 48 | struct omap_vc_channel omap3_vc_mpu = { |
48 | .vc_common = &omap3_vc_common, | 49 | .common = &omap3_vc_common, |
50 | .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET, | ||
51 | .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET, | ||
52 | .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET, | ||
53 | .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET, | ||
49 | .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET, | 54 | .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, | 55 | .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK, |
52 | .smps_volra_shift = OMAP3430_VOLRA0_SHIFT, | ||
53 | .smps_volra_mask = OMAP3430_VOLRA0_MASK, | 56 | .smps_volra_mask = OMAP3430_VOLRA0_MASK, |
57 | .smps_cmdra_mask = OMAP3430_CMDRA0_MASK, | ||
58 | .cfg_channel_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT, | ||
54 | }; | 59 | }; |
55 | 60 | ||
56 | struct omap_vc_instance_data omap3_vc2_data = { | 61 | struct omap_vc_channel omap3_vc_core = { |
57 | .vc_common = &omap3_vc_common, | 62 | .common = &omap3_vc_common, |
63 | .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET, | ||
64 | .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET, | ||
65 | .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET, | ||
66 | .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET, | ||
58 | .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET, | 67 | .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, | 68 | .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK, |
61 | .smps_volra_shift = OMAP3430_VOLRA1_SHIFT, | ||
62 | .smps_volra_mask = OMAP3430_VOLRA1_MASK, | 69 | .smps_volra_mask = OMAP3430_VOLRA1_MASK, |
70 | .smps_cmdra_mask = OMAP3430_CMDRA1_MASK, | ||
71 | .cfg_channel_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT, | ||
63 | }; | 72 | }; |
diff --git a/arch/arm/mach-omap2/vc44xx_data.c b/arch/arm/mach-omap2/vc44xx_data.c index a98da8ddec52..2740a968145e 100644 --- a/arch/arm/mach-omap2/vc44xx_data.c +++ b/arch/arm/mach-omap2/vc44xx_data.c | |||
@@ -30,9 +30,7 @@ | |||
30 | * VC data common to 44xx chips | 30 | * VC data common to 44xx chips |
31 | * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. | 31 | * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. |
32 | */ | 32 | */ |
33 | static const struct omap_vc_common_data omap4_vc_common = { | 33 | static const struct omap_vc_common 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, | 34 | .bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET, |
37 | .data_shift = OMAP4430_DATA_SHIFT, | 35 | .data_shift = OMAP4430_DATA_SHIFT, |
38 | .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT, | 36 | .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT, |
@@ -43,33 +41,49 @@ static const struct omap_vc_common_data omap4_vc_common = { | |||
43 | .cmd_onlp_shift = OMAP4430_ONLP_SHIFT, | 41 | .cmd_onlp_shift = OMAP4430_ONLP_SHIFT, |
44 | .cmd_ret_shift = OMAP4430_RET_SHIFT, | 42 | .cmd_ret_shift = OMAP4430_RET_SHIFT, |
45 | .cmd_off_shift = OMAP4430_OFF_SHIFT, | 43 | .cmd_off_shift = OMAP4430_OFF_SHIFT, |
44 | .i2c_cfg_reg = OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET, | ||
45 | .i2c_cfg_hsen_mask = OMAP4430_HSMODEEN_MASK, | ||
46 | .i2c_mcode_mask = OMAP4430_HSMCODE_MASK, | ||
46 | }; | 47 | }; |
47 | 48 | ||
48 | /* VC instance data for each controllable voltage line */ | 49 | /* VC instance data for each controllable voltage line */ |
49 | struct omap_vc_instance_data omap4_vc_mpu_data = { | 50 | struct omap_vc_channel omap4_vc_mpu = { |
50 | .vc_common = &omap4_vc_common, | 51 | .flags = OMAP_VC_CHANNEL_DEFAULT | OMAP_VC_CHANNEL_CFG_MUTANT, |
52 | .common = &omap4_vc_common, | ||
53 | .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET, | ||
54 | .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET, | ||
55 | .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET, | ||
56 | .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET, | ||
51 | .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET, | 57 | .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, | 58 | .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, | 59 | .smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK, |
60 | .smps_cmdra_mask = OMAP4430_CMDRA_VDD_MPU_L_MASK, | ||
61 | .cfg_channel_sa_shift = OMAP4430_SA_VDD_MPU_L_SHIFT, | ||
56 | }; | 62 | }; |
57 | 63 | ||
58 | struct omap_vc_instance_data omap4_vc_iva_data = { | 64 | struct omap_vc_channel omap4_vc_iva = { |
59 | .vc_common = &omap4_vc_common, | 65 | .common = &omap4_vc_common, |
66 | .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET, | ||
67 | .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET, | ||
68 | .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET, | ||
69 | .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET, | ||
60 | .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET, | 70 | .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, | 71 | .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, | 72 | .smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK, |
73 | .smps_cmdra_mask = OMAP4430_CMDRA_VDD_IVA_L_MASK, | ||
74 | .cfg_channel_sa_shift = OMAP4430_SA_VDD_IVA_L_SHIFT, | ||
65 | }; | 75 | }; |
66 | 76 | ||
67 | struct omap_vc_instance_data omap4_vc_core_data = { | 77 | struct omap_vc_channel omap4_vc_core = { |
68 | .vc_common = &omap4_vc_common, | 78 | .common = &omap4_vc_common, |
79 | .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET, | ||
80 | .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET, | ||
81 | .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET, | ||
82 | .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET, | ||
69 | .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET, | 83 | .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, | 84 | .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, | 85 | .smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK, |
86 | .smps_cmdra_mask = OMAP4430_CMDRA_VDD_CORE_L_MASK, | ||
87 | .cfg_channel_sa_shift = OMAP4430_SA_VDD_CORE_L_SHIFT, | ||
74 | }; | 88 | }; |
75 | 89 | ||
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 9ef3789ded4b..64070ac1e761 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c | |||
@@ -21,10 +21,10 @@ | |||
21 | 21 | ||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clk.h> | ||
25 | #include <linux/err.h> | 24 | #include <linux/err.h> |
26 | #include <linux/debugfs.h> | 25 | #include <linux/debugfs.h> |
27 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/clk.h> | ||
28 | 28 | ||
29 | #include <plat/common.h> | 29 | #include <plat/common.h> |
30 | 30 | ||
@@ -36,839 +36,88 @@ | |||
36 | #include "control.h" | 36 | #include "control.h" |
37 | 37 | ||
38 | #include "voltage.h" | 38 | #include "voltage.h" |
39 | #include "powerdomain.h" | ||
39 | 40 | ||
40 | #include "vc.h" | 41 | #include "vc.h" |
41 | #include "vp.h" | 42 | #include "vp.h" |
42 | 43 | ||
43 | #define VOLTAGE_DIR_SIZE 16 | 44 | static LIST_HEAD(voltdm_list); |
44 | |||
45 | |||
46 | static struct omap_vdd_info **vdd_info; | ||
47 | |||
48 | /* | ||
49 | * Number of scalable voltage domains. | ||
50 | */ | ||
51 | static int nr_scalable_vdd; | ||
52 | |||
53 | /* XXX document */ | ||
54 | static s16 prm_mod_offs; | ||
55 | static s16 prm_irqst_ocp_mod_offs; | ||
56 | |||
57 | static struct dentry *voltage_dir; | ||
58 | |||
59 | /* Init function pointers */ | ||
60 | static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | ||
61 | unsigned long target_volt); | ||
62 | |||
63 | static u32 omap3_voltage_read_reg(u16 mod, u8 offset) | ||
64 | { | ||
65 | return omap2_prm_read_mod_reg(mod, offset); | ||
66 | } | ||
67 | |||
68 | static void omap3_voltage_write_reg(u32 val, u16 mod, u8 offset) | ||
69 | { | ||
70 | omap2_prm_write_mod_reg(val, mod, offset); | ||
71 | } | ||
72 | |||
73 | static u32 omap4_voltage_read_reg(u16 mod, u8 offset) | ||
74 | { | ||
75 | return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, | ||
76 | mod, offset); | ||
77 | } | ||
78 | |||
79 | static void omap4_voltage_write_reg(u32 val, u16 mod, u8 offset) | ||
80 | { | ||
81 | omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, mod, offset); | ||
82 | } | ||
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->volt_scale = vp_forceupdate_scale_voltage; | ||
118 | vdd->vp_enabled = false; | ||
119 | |||
120 | vdd->vp_rt_data.vpconfig_erroroffset = | ||
121 | (vdd->pmic_info->vp_erroroffset << | ||
122 | vdd->vp_data->vp_common->vpconfig_erroroffset_shift); | ||
123 | |||
124 | timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000; | ||
125 | vdd->vp_rt_data.vlimitto_timeout = timeout_val; | ||
126 | vdd->vp_rt_data.vlimitto_vddmin = vdd->pmic_info->vp_vddmin; | ||
127 | vdd->vp_rt_data.vlimitto_vddmax = vdd->pmic_info->vp_vddmax; | ||
128 | |||
129 | waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) * | ||
130 | sys_clk_speed) / 1000; | ||
131 | vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime; | ||
132 | vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime; | ||
133 | vdd->vp_rt_data.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin; | ||
134 | vdd->vp_rt_data.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax; | ||
135 | |||
136 | return 0; | ||
137 | } | ||
138 | |||
139 | /* Voltage debugfs support */ | ||
140 | static int vp_volt_debug_get(void *data, u64 *val) | ||
141 | { | ||
142 | struct omap_vdd_info *vdd = (struct omap_vdd_info *) data; | ||
143 | u8 vsel; | ||
144 | |||
145 | if (!vdd) { | ||
146 | pr_warning("Wrong paramater passed\n"); | ||
147 | return -EINVAL; | ||
148 | } | ||
149 | |||
150 | vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage); | ||
151 | |||
152 | if (!vdd->pmic_info->vsel_to_uv) { | ||
153 | pr_warning("PMIC function to convert vsel to voltage" | ||
154 | "in uV not registerd\n"); | ||
155 | return -EINVAL; | ||
156 | } | ||
157 | |||
158 | *val = vdd->pmic_info->vsel_to_uv(vsel); | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static int nom_volt_debug_get(void *data, u64 *val) | ||
163 | { | ||
164 | struct omap_vdd_info *vdd = (struct omap_vdd_info *) data; | ||
165 | |||
166 | if (!vdd) { | ||
167 | pr_warning("Wrong paramater passed\n"); | ||
168 | return -EINVAL; | ||
169 | } | ||
170 | |||
171 | *val = omap_voltage_get_nom_volt(&vdd->voltdm); | ||
172 | |||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | DEFINE_SIMPLE_ATTRIBUTE(vp_volt_debug_fops, vp_volt_debug_get, NULL, "%llu\n"); | ||
177 | DEFINE_SIMPLE_ATTRIBUTE(nom_volt_debug_fops, nom_volt_debug_get, NULL, | ||
178 | "%llu\n"); | ||
179 | static void vp_latch_vsel(struct omap_vdd_info *vdd) | ||
180 | { | ||
181 | u32 vpconfig; | ||
182 | unsigned long uvdc; | ||
183 | char vsel; | ||
184 | |||
185 | uvdc = omap_voltage_get_nom_volt(&vdd->voltdm); | ||
186 | if (!uvdc) { | ||
187 | pr_warning("%s: unable to find current voltage for vdd_%s\n", | ||
188 | __func__, vdd->voltdm.name); | ||
189 | return; | ||
190 | } | ||
191 | |||
192 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { | ||
193 | pr_warning("%s: PMIC function to convert voltage in uV to" | ||
194 | " vsel not registered\n", __func__); | ||
195 | return; | ||
196 | } | ||
197 | |||
198 | vsel = vdd->pmic_info->uv_to_vsel(uvdc); | ||
199 | |||
200 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); | ||
201 | vpconfig &= ~(vdd->vp_data->vp_common->vpconfig_initvoltage_mask | | ||
202 | vdd->vp_data->vp_common->vpconfig_initvdd); | ||
203 | vpconfig |= vsel << vdd->vp_data->vp_common->vpconfig_initvoltage_shift; | ||
204 | |||
205 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
206 | |||
207 | /* Trigger initVDD value copy to voltage processor */ | ||
208 | vdd->write_reg((vpconfig | vdd->vp_data->vp_common->vpconfig_initvdd), | ||
209 | prm_mod_offs, vdd->vp_data->vpconfig); | ||
210 | |||
211 | /* Clear initVDD copy trigger bit */ | ||
212 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
213 | } | ||
214 | |||
215 | /* Generic voltage init functions */ | ||
216 | static void __init vp_init(struct omap_vdd_info *vdd) | ||
217 | { | ||
218 | u32 vp_val; | ||
219 | |||
220 | if (!vdd->read_reg || !vdd->write_reg) { | ||
221 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
222 | __func__, vdd->voltdm.name); | ||
223 | return; | ||
224 | } | ||
225 | |||
226 | vp_val = vdd->vp_rt_data.vpconfig_erroroffset | | ||
227 | (vdd->vp_rt_data.vpconfig_errorgain << | ||
228 | vdd->vp_data->vp_common->vpconfig_errorgain_shift) | | ||
229 | vdd->vp_data->vp_common->vpconfig_timeouten; | ||
230 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vpconfig); | ||
231 | |||
232 | vp_val = ((vdd->vp_rt_data.vstepmin_smpswaittimemin << | ||
233 | vdd->vp_data->vp_common->vstepmin_smpswaittimemin_shift) | | ||
234 | (vdd->vp_rt_data.vstepmin_stepmin << | ||
235 | vdd->vp_data->vp_common->vstepmin_stepmin_shift)); | ||
236 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vstepmin); | ||
237 | |||
238 | vp_val = ((vdd->vp_rt_data.vstepmax_smpswaittimemax << | ||
239 | vdd->vp_data->vp_common->vstepmax_smpswaittimemax_shift) | | ||
240 | (vdd->vp_rt_data.vstepmax_stepmax << | ||
241 | vdd->vp_data->vp_common->vstepmax_stepmax_shift)); | ||
242 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vstepmax); | ||
243 | |||
244 | vp_val = ((vdd->vp_rt_data.vlimitto_vddmax << | ||
245 | vdd->vp_data->vp_common->vlimitto_vddmax_shift) | | ||
246 | (vdd->vp_rt_data.vlimitto_vddmin << | ||
247 | vdd->vp_data->vp_common->vlimitto_vddmin_shift) | | ||
248 | (vdd->vp_rt_data.vlimitto_timeout << | ||
249 | vdd->vp_data->vp_common->vlimitto_timeout_shift)); | ||
250 | vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vlimitto); | ||
251 | } | ||
252 | |||
253 | static void __init vdd_debugfs_init(struct omap_vdd_info *vdd) | ||
254 | { | ||
255 | char *name; | ||
256 | |||
257 | name = kzalloc(VOLTAGE_DIR_SIZE, GFP_KERNEL); | ||
258 | if (!name) { | ||
259 | pr_warning("%s: Unable to allocate memory for debugfs" | ||
260 | " directory name for vdd_%s", | ||
261 | __func__, vdd->voltdm.name); | ||
262 | return; | ||
263 | } | ||
264 | strcpy(name, "vdd_"); | ||
265 | strcat(name, vdd->voltdm.name); | ||
266 | |||
267 | vdd->debug_dir = debugfs_create_dir(name, voltage_dir); | ||
268 | kfree(name); | ||
269 | if (IS_ERR(vdd->debug_dir)) { | ||
270 | pr_warning("%s: Unable to create debugfs directory for" | ||
271 | " vdd_%s\n", __func__, vdd->voltdm.name); | ||
272 | vdd->debug_dir = NULL; | ||
273 | return; | ||
274 | } | ||
275 | |||
276 | (void) debugfs_create_x16("vp_errorgain", S_IRUGO, vdd->debug_dir, | ||
277 | &(vdd->vp_rt_data.vpconfig_errorgain)); | ||
278 | (void) debugfs_create_x16("vp_smpswaittimemin", S_IRUGO, | ||
279 | vdd->debug_dir, | ||
280 | &(vdd->vp_rt_data.vstepmin_smpswaittimemin)); | ||
281 | (void) debugfs_create_x8("vp_stepmin", S_IRUGO, vdd->debug_dir, | ||
282 | &(vdd->vp_rt_data.vstepmin_stepmin)); | ||
283 | (void) debugfs_create_x16("vp_smpswaittimemax", S_IRUGO, | ||
284 | vdd->debug_dir, | ||
285 | &(vdd->vp_rt_data.vstepmax_smpswaittimemax)); | ||
286 | (void) debugfs_create_x8("vp_stepmax", S_IRUGO, vdd->debug_dir, | ||
287 | &(vdd->vp_rt_data.vstepmax_stepmax)); | ||
288 | (void) debugfs_create_x8("vp_vddmax", S_IRUGO, vdd->debug_dir, | ||
289 | &(vdd->vp_rt_data.vlimitto_vddmax)); | ||
290 | (void) debugfs_create_x8("vp_vddmin", S_IRUGO, vdd->debug_dir, | ||
291 | &(vdd->vp_rt_data.vlimitto_vddmin)); | ||
292 | (void) debugfs_create_x16("vp_timeout", S_IRUGO, vdd->debug_dir, | ||
293 | &(vdd->vp_rt_data.vlimitto_timeout)); | ||
294 | (void) debugfs_create_file("curr_vp_volt", S_IRUGO, vdd->debug_dir, | ||
295 | (void *) vdd, &vp_volt_debug_fops); | ||
296 | (void) debugfs_create_file("curr_nominal_volt", S_IRUGO, | ||
297 | vdd->debug_dir, (void *) vdd, | ||
298 | &nom_volt_debug_fops); | ||
299 | } | ||
300 | |||
301 | /* Voltage scale and accessory APIs */ | ||
302 | static int _pre_volt_scale(struct omap_vdd_info *vdd, | ||
303 | unsigned long target_volt, u8 *target_vsel, u8 *current_vsel) | ||
304 | { | ||
305 | struct omap_volt_data *volt_data; | ||
306 | const struct omap_vc_common_data *vc_common; | ||
307 | const struct omap_vp_common_data *vp_common; | ||
308 | u32 vc_cmdval, vp_errgain_val; | ||
309 | |||
310 | vc_common = vdd->vc_data->vc_common; | ||
311 | vp_common = vdd->vp_data->vp_common; | ||
312 | |||
313 | /* Check if suffiecient pmic info is available for this vdd */ | ||
314 | if (!vdd->pmic_info) { | ||
315 | pr_err("%s: Insufficient pmic info to scale the vdd_%s\n", | ||
316 | __func__, vdd->voltdm.name); | ||
317 | return -EINVAL; | ||
318 | } | ||
319 | |||
320 | if (!vdd->pmic_info->uv_to_vsel) { | ||
321 | pr_err("%s: PMIC function to convert voltage in uV to" | ||
322 | "vsel not registered. Hence unable to scale voltage" | ||
323 | "for vdd_%s\n", __func__, vdd->voltdm.name); | ||
324 | return -ENODATA; | ||
325 | } | ||
326 | |||
327 | if (!vdd->read_reg || !vdd->write_reg) { | ||
328 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
329 | __func__, vdd->voltdm.name); | ||
330 | return -EINVAL; | ||
331 | } | ||
332 | |||
333 | /* Get volt_data corresponding to target_volt */ | ||
334 | volt_data = omap_voltage_get_voltdata(&vdd->voltdm, target_volt); | ||
335 | if (IS_ERR(volt_data)) | ||
336 | volt_data = NULL; | ||
337 | |||
338 | *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt); | ||
339 | *current_vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage); | ||
340 | |||
341 | /* Setting the ON voltage to the new target voltage */ | ||
342 | vc_cmdval = vdd->read_reg(prm_mod_offs, vdd->vc_data->cmdval_reg); | ||
343 | vc_cmdval &= ~vc_common->cmd_on_mask; | ||
344 | vc_cmdval |= (*target_vsel << vc_common->cmd_on_shift); | ||
345 | vdd->write_reg(vc_cmdval, prm_mod_offs, vdd->vc_data->cmdval_reg); | ||
346 | |||
347 | /* Setting vp errorgain based on the voltage */ | ||
348 | if (volt_data) { | ||
349 | vp_errgain_val = vdd->read_reg(prm_mod_offs, | ||
350 | vdd->vp_data->vpconfig); | ||
351 | vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain; | ||
352 | vp_errgain_val &= ~vp_common->vpconfig_errorgain_mask; | ||
353 | vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain << | ||
354 | vp_common->vpconfig_errorgain_shift; | ||
355 | vdd->write_reg(vp_errgain_val, prm_mod_offs, | ||
356 | vdd->vp_data->vpconfig); | ||
357 | } | ||
358 | |||
359 | return 0; | ||
360 | } | ||
361 | |||
362 | static void _post_volt_scale(struct omap_vdd_info *vdd, | ||
363 | unsigned long target_volt, u8 target_vsel, u8 current_vsel) | ||
364 | { | ||
365 | u32 smps_steps = 0, smps_delay = 0; | ||
366 | |||
367 | smps_steps = abs(target_vsel - current_vsel); | ||
368 | /* SMPS slew rate / step size. 2us added as buffer. */ | ||
369 | smps_delay = ((smps_steps * vdd->pmic_info->step_size) / | ||
370 | vdd->pmic_info->slew_rate) + 2; | ||
371 | udelay(smps_delay); | ||
372 | |||
373 | vdd->curr_volt = target_volt; | ||
374 | } | ||
375 | |||
376 | /* vc_bypass_scale_voltage - VC bypass method of voltage scaling */ | ||
377 | static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd, | ||
378 | unsigned long target_volt) | ||
379 | { | ||
380 | u32 loop_cnt = 0, retries_cnt = 0; | ||
381 | u32 vc_valid, vc_bypass_val_reg, vc_bypass_value; | ||
382 | u8 target_vsel, current_vsel; | ||
383 | int ret; | ||
384 | |||
385 | ret = _pre_volt_scale(vdd, target_volt, &target_vsel, ¤t_vsel); | ||
386 | if (ret) | ||
387 | return ret; | ||
388 | |||
389 | vc_valid = vdd->vc_data->vc_common->valid; | ||
390 | vc_bypass_val_reg = vdd->vc_data->vc_common->bypass_val_reg; | ||
391 | vc_bypass_value = (target_vsel << vdd->vc_data->vc_common->data_shift) | | ||
392 | (vdd->pmic_info->pmic_reg << | ||
393 | vdd->vc_data->vc_common->regaddr_shift) | | ||
394 | (vdd->pmic_info->i2c_slave_addr << | ||
395 | vdd->vc_data->vc_common->slaveaddr_shift); | ||
396 | |||
397 | vdd->write_reg(vc_bypass_value, prm_mod_offs, vc_bypass_val_reg); | ||
398 | vdd->write_reg(vc_bypass_value | vc_valid, prm_mod_offs, | ||
399 | vc_bypass_val_reg); | ||
400 | |||
401 | vc_bypass_value = vdd->read_reg(prm_mod_offs, vc_bypass_val_reg); | ||
402 | /* | ||
403 | * Loop till the bypass command is acknowledged from the SMPS. | ||
404 | * NOTE: This is legacy code. The loop count and retry count needs | ||
405 | * to be revisited. | ||
406 | */ | ||
407 | while (!(vc_bypass_value & vc_valid)) { | ||
408 | loop_cnt++; | ||
409 | |||
410 | if (retries_cnt > 10) { | ||
411 | pr_warning("%s: Retry count exceeded\n", __func__); | ||
412 | return -ETIMEDOUT; | ||
413 | } | ||
414 | |||
415 | if (loop_cnt > 50) { | ||
416 | retries_cnt++; | ||
417 | loop_cnt = 0; | ||
418 | udelay(10); | ||
419 | } | ||
420 | vc_bypass_value = vdd->read_reg(prm_mod_offs, | ||
421 | vc_bypass_val_reg); | ||
422 | } | ||
423 | |||
424 | _post_volt_scale(vdd, target_volt, target_vsel, current_vsel); | ||
425 | return 0; | ||
426 | } | ||
427 | |||
428 | /* VP force update method of voltage scaling */ | ||
429 | static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd, | ||
430 | unsigned long target_volt) | ||
431 | { | ||
432 | u32 vpconfig; | ||
433 | u8 target_vsel, current_vsel, prm_irqst_reg; | ||
434 | int ret, timeout = 0; | ||
435 | |||
436 | ret = _pre_volt_scale(vdd, target_volt, &target_vsel, ¤t_vsel); | ||
437 | if (ret) | ||
438 | return ret; | ||
439 | |||
440 | prm_irqst_reg = vdd->vp_data->prm_irqst_data->prm_irqst_reg; | ||
441 | |||
442 | /* | ||
443 | * Clear all pending TransactionDone interrupt/status. Typical latency | ||
444 | * is <3us | ||
445 | */ | ||
446 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { | ||
447 | vdd->write_reg(vdd->vp_data->prm_irqst_data->tranxdone_status, | ||
448 | prm_irqst_ocp_mod_offs, prm_irqst_reg); | ||
449 | if (!(vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) & | ||
450 | vdd->vp_data->prm_irqst_data->tranxdone_status)) | ||
451 | break; | ||
452 | udelay(1); | ||
453 | } | ||
454 | if (timeout >= VP_TRANXDONE_TIMEOUT) { | ||
455 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded." | ||
456 | "Voltage change aborted", __func__, vdd->voltdm.name); | ||
457 | return -ETIMEDOUT; | ||
458 | } | ||
459 | |||
460 | /* Configure for VP-Force Update */ | ||
461 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); | ||
462 | vpconfig &= ~(vdd->vp_data->vp_common->vpconfig_initvdd | | ||
463 | vdd->vp_data->vp_common->vpconfig_forceupdate | | ||
464 | vdd->vp_data->vp_common->vpconfig_initvoltage_mask); | ||
465 | vpconfig |= ((target_vsel << | ||
466 | vdd->vp_data->vp_common->vpconfig_initvoltage_shift)); | ||
467 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
468 | |||
469 | /* Trigger initVDD value copy to voltage processor */ | ||
470 | vpconfig |= vdd->vp_data->vp_common->vpconfig_initvdd; | ||
471 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
472 | |||
473 | /* Force update of voltage */ | ||
474 | vpconfig |= vdd->vp_data->vp_common->vpconfig_forceupdate; | ||
475 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
476 | |||
477 | /* | ||
478 | * Wait for TransactionDone. Typical latency is <200us. | ||
479 | * Depends on SMPSWAITTIMEMIN/MAX and voltage change | ||
480 | */ | ||
481 | timeout = 0; | ||
482 | omap_test_timeout((vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) & | ||
483 | vdd->vp_data->prm_irqst_data->tranxdone_status), | ||
484 | VP_TRANXDONE_TIMEOUT, timeout); | ||
485 | if (timeout >= VP_TRANXDONE_TIMEOUT) | ||
486 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded." | ||
487 | "TRANXDONE never got set after the voltage update\n", | ||
488 | __func__, vdd->voltdm.name); | ||
489 | |||
490 | _post_volt_scale(vdd, target_volt, target_vsel, current_vsel); | ||
491 | |||
492 | /* | ||
493 | * Disable TransactionDone interrupt , clear all status, clear | ||
494 | * control registers | ||
495 | */ | ||
496 | timeout = 0; | ||
497 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { | ||
498 | vdd->write_reg(vdd->vp_data->prm_irqst_data->tranxdone_status, | ||
499 | prm_irqst_ocp_mod_offs, prm_irqst_reg); | ||
500 | if (!(vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) & | ||
501 | vdd->vp_data->prm_irqst_data->tranxdone_status)) | ||
502 | break; | ||
503 | udelay(1); | ||
504 | } | ||
505 | |||
506 | if (timeout >= VP_TRANXDONE_TIMEOUT) | ||
507 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded while trying" | ||
508 | "to clear the TRANXDONE status\n", | ||
509 | __func__, vdd->voltdm.name); | ||
510 | |||
511 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); | ||
512 | /* Clear initVDD copy trigger bit */ | ||
513 | vpconfig &= ~vdd->vp_data->vp_common->vpconfig_initvdd; | ||
514 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
515 | /* Clear force bit */ | ||
516 | vpconfig &= ~vdd->vp_data->vp_common->vpconfig_forceupdate; | ||
517 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
518 | |||
519 | return 0; | ||
520 | } | ||
521 | |||
522 | static void __init omap3_vfsm_init(struct omap_vdd_info *vdd) | ||
523 | { | ||
524 | /* | ||
525 | * Voltage Manager FSM parameters init | ||
526 | * XXX This data should be passed in from the board file | ||
527 | */ | ||
528 | vdd->write_reg(OMAP3_CLKSETUP, prm_mod_offs, OMAP3_PRM_CLKSETUP_OFFSET); | ||
529 | vdd->write_reg(OMAP3_VOLTOFFSET, prm_mod_offs, | ||
530 | OMAP3_PRM_VOLTOFFSET_OFFSET); | ||
531 | vdd->write_reg(OMAP3_VOLTSETUP2, prm_mod_offs, | ||
532 | OMAP3_PRM_VOLTSETUP2_OFFSET); | ||
533 | } | ||
534 | |||
535 | static void __init omap3_vc_init(struct omap_vdd_info *vdd) | ||
536 | { | ||
537 | static bool is_initialized; | ||
538 | u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; | ||
539 | u32 vc_val; | ||
540 | |||
541 | if (is_initialized) | ||
542 | return; | ||
543 | |||
544 | /* Set up the on, inactive, retention and off voltage */ | ||
545 | on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); | ||
546 | onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); | ||
547 | ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); | ||
548 | off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); | ||
549 | vc_val = ((on_vsel << vdd->vc_data->vc_common->cmd_on_shift) | | ||
550 | (onlp_vsel << vdd->vc_data->vc_common->cmd_onlp_shift) | | ||
551 | (ret_vsel << vdd->vc_data->vc_common->cmd_ret_shift) | | ||
552 | (off_vsel << vdd->vc_data->vc_common->cmd_off_shift)); | ||
553 | vdd->write_reg(vc_val, prm_mod_offs, vdd->vc_data->cmdval_reg); | ||
554 | |||
555 | /* | ||
556 | * Generic VC parameters init | ||
557 | * XXX This data should be abstracted out | ||
558 | */ | ||
559 | vdd->write_reg(OMAP3430_CMD1_MASK | OMAP3430_RAV1_MASK, prm_mod_offs, | ||
560 | OMAP3_PRM_VC_CH_CONF_OFFSET); | ||
561 | vdd->write_reg(OMAP3430_MCODE_SHIFT | OMAP3430_HSEN_MASK, prm_mod_offs, | ||
562 | OMAP3_PRM_VC_I2C_CFG_OFFSET); | ||
563 | |||
564 | omap3_vfsm_init(vdd); | ||
565 | |||
566 | is_initialized = true; | ||
567 | } | ||
568 | |||
569 | |||
570 | /* OMAP4 specific voltage init functions */ | ||
571 | static void __init omap4_vc_init(struct omap_vdd_info *vdd) | ||
572 | { | ||
573 | static bool is_initialized; | ||
574 | u32 vc_val; | ||
575 | |||
576 | if (is_initialized) | ||
577 | return; | ||
578 | |||
579 | /* TODO: Configure setup times and CMD_VAL values*/ | ||
580 | |||
581 | /* | ||
582 | * Generic VC parameters init | ||
583 | * XXX This data should be abstracted out | ||
584 | */ | ||
585 | vc_val = (OMAP4430_RAV_VDD_MPU_L_MASK | OMAP4430_CMD_VDD_MPU_L_MASK | | ||
586 | OMAP4430_RAV_VDD_IVA_L_MASK | OMAP4430_CMD_VDD_IVA_L_MASK | | ||
587 | OMAP4430_RAV_VDD_CORE_L_MASK | OMAP4430_CMD_VDD_CORE_L_MASK); | ||
588 | vdd->write_reg(vc_val, prm_mod_offs, OMAP4_PRM_VC_CFG_CHANNEL_OFFSET); | ||
589 | |||
590 | /* XXX These are magic numbers and do not belong! */ | ||
591 | vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT); | ||
592 | vdd->write_reg(vc_val, prm_mod_offs, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET); | ||
593 | |||
594 | is_initialized = true; | ||
595 | } | ||
596 | |||
597 | static void __init omap_vc_init(struct omap_vdd_info *vdd) | ||
598 | { | ||
599 | u32 vc_val; | ||
600 | |||
601 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { | ||
602 | pr_err("%s: PMIC info requried to configure vc for" | ||
603 | "vdd_%s not populated.Hence cannot initialize vc\n", | ||
604 | __func__, vdd->voltdm.name); | ||
605 | return; | ||
606 | } | ||
607 | |||
608 | if (!vdd->read_reg || !vdd->write_reg) { | ||
609 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
610 | __func__, vdd->voltdm.name); | ||
611 | return; | ||
612 | } | ||
613 | |||
614 | /* Set up the SMPS_SA(i2c slave address in VC */ | ||
615 | vc_val = vdd->read_reg(prm_mod_offs, | ||
616 | vdd->vc_data->vc_common->smps_sa_reg); | ||
617 | vc_val &= ~vdd->vc_data->smps_sa_mask; | ||
618 | vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_data->smps_sa_shift; | ||
619 | vdd->write_reg(vc_val, prm_mod_offs, | ||
620 | vdd->vc_data->vc_common->smps_sa_reg); | ||
621 | |||
622 | /* Setup the VOLRA(pmic reg addr) in VC */ | ||
623 | vc_val = vdd->read_reg(prm_mod_offs, | ||
624 | vdd->vc_data->vc_common->smps_volra_reg); | ||
625 | vc_val &= ~vdd->vc_data->smps_volra_mask; | ||
626 | vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_data->smps_volra_shift; | ||
627 | vdd->write_reg(vc_val, prm_mod_offs, | ||
628 | vdd->vc_data->vc_common->smps_volra_reg); | ||
629 | |||
630 | /* Configure the setup times */ | ||
631 | vc_val = vdd->read_reg(prm_mod_offs, vdd->vfsm->voltsetup_reg); | ||
632 | vc_val &= ~vdd->vfsm->voltsetup_mask; | ||
633 | vc_val |= vdd->pmic_info->volt_setup_time << | ||
634 | vdd->vfsm->voltsetup_shift; | ||
635 | vdd->write_reg(vc_val, prm_mod_offs, vdd->vfsm->voltsetup_reg); | ||
636 | |||
637 | if (cpu_is_omap34xx()) | ||
638 | omap3_vc_init(vdd); | ||
639 | else if (cpu_is_omap44xx()) | ||
640 | omap4_vc_init(vdd); | ||
641 | } | ||
642 | |||
643 | static int __init omap_vdd_data_configure(struct omap_vdd_info *vdd) | ||
644 | { | ||
645 | int ret = -EINVAL; | ||
646 | |||
647 | if (!vdd->pmic_info) { | ||
648 | pr_err("%s: PMIC info requried to configure vdd_%s not" | ||
649 | "populated.Hence cannot initialize vdd_%s\n", | ||
650 | __func__, vdd->voltdm.name, vdd->voltdm.name); | ||
651 | goto ovdc_out; | ||
652 | } | ||
653 | |||
654 | if (IS_ERR_VALUE(_config_common_vdd_data(vdd))) | ||
655 | goto ovdc_out; | ||
656 | |||
657 | if (cpu_is_omap34xx()) { | ||
658 | vdd->read_reg = omap3_voltage_read_reg; | ||
659 | vdd->write_reg = omap3_voltage_write_reg; | ||
660 | ret = 0; | ||
661 | } else if (cpu_is_omap44xx()) { | ||
662 | vdd->read_reg = omap4_voltage_read_reg; | ||
663 | vdd->write_reg = omap4_voltage_write_reg; | ||
664 | ret = 0; | ||
665 | } | ||
666 | |||
667 | ovdc_out: | ||
668 | return ret; | ||
669 | } | ||
670 | 45 | ||
671 | /* Public functions */ | 46 | /* Public functions */ |
672 | /** | 47 | /** |
673 | * omap_voltage_get_nom_volt() - Gets the current non-auto-compensated voltage | 48 | * voltdm_get_voltage() - Gets the current non-auto-compensated voltage |
674 | * @voltdm: pointer to the VDD for which current voltage info is needed | 49 | * @voltdm: pointer to the voltdm for which current voltage info is needed |
675 | * | 50 | * |
676 | * API to get the current non-auto-compensated voltage for a VDD. | 51 | * API to get the current non-auto-compensated voltage for a voltage domain. |
677 | * Returns 0 in case of error else returns the current voltage for the VDD. | 52 | * Returns 0 in case of error else returns the current voltage. |
678 | */ | 53 | */ |
679 | unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm) | 54 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm) |
680 | { | 55 | { |
681 | struct omap_vdd_info *vdd; | ||
682 | |||
683 | if (!voltdm || IS_ERR(voltdm)) { | 56 | if (!voltdm || IS_ERR(voltdm)) { |
684 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 57 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
685 | return 0; | 58 | return 0; |
686 | } | 59 | } |
687 | 60 | ||
688 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | 61 | return voltdm->nominal_volt; |
689 | |||
690 | return vdd->curr_volt; | ||
691 | } | 62 | } |
692 | 63 | ||
693 | /** | 64 | /** |
694 | * omap_vp_get_curr_volt() - API to get the current vp voltage. | 65 | * voltdm_scale() - API to scale voltage of a particular voltage domain. |
695 | * @voltdm: pointer to the VDD. | 66 | * @voltdm: pointer to the voltage domain which is to be scaled. |
696 | * | 67 | * @target_volt: The target voltage of the voltage domain |
697 | * This API returns the current voltage for the specified voltage processor | ||
698 | */ | ||
699 | unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm) | ||
700 | { | ||
701 | struct omap_vdd_info *vdd; | ||
702 | u8 curr_vsel; | ||
703 | |||
704 | if (!voltdm || IS_ERR(voltdm)) { | ||
705 | pr_warning("%s: VDD specified does not exist!\n", __func__); | ||
706 | return 0; | ||
707 | } | ||
708 | |||
709 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | ||
710 | if (!vdd->read_reg) { | ||
711 | pr_err("%s: No read API for reading vdd_%s regs\n", | ||
712 | __func__, voltdm->name); | ||
713 | return 0; | ||
714 | } | ||
715 | |||
716 | curr_vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage); | ||
717 | |||
718 | if (!vdd->pmic_info || !vdd->pmic_info->vsel_to_uv) { | ||
719 | pr_warning("%s: PMIC function to convert vsel to voltage" | ||
720 | "in uV not registerd\n", __func__); | ||
721 | return 0; | ||
722 | } | ||
723 | |||
724 | return vdd->pmic_info->vsel_to_uv(curr_vsel); | ||
725 | } | ||
726 | |||
727 | /** | ||
728 | * omap_vp_enable() - API to enable a particular VP | ||
729 | * @voltdm: pointer to the VDD whose VP is to be enabled. | ||
730 | * | ||
731 | * This API enables a particular voltage processor. Needed by the smartreflex | ||
732 | * class drivers. | ||
733 | */ | ||
734 | void omap_vp_enable(struct voltagedomain *voltdm) | ||
735 | { | ||
736 | struct omap_vdd_info *vdd; | ||
737 | u32 vpconfig; | ||
738 | |||
739 | if (!voltdm || IS_ERR(voltdm)) { | ||
740 | pr_warning("%s: VDD specified does not exist!\n", __func__); | ||
741 | return; | ||
742 | } | ||
743 | |||
744 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | ||
745 | if (!vdd->read_reg || !vdd->write_reg) { | ||
746 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
747 | __func__, voltdm->name); | ||
748 | return; | ||
749 | } | ||
750 | |||
751 | /* If VP is already enabled, do nothing. Return */ | ||
752 | if (vdd->vp_enabled) | ||
753 | return; | ||
754 | |||
755 | vp_latch_vsel(vdd); | ||
756 | |||
757 | /* Enable VP */ | ||
758 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); | ||
759 | vpconfig |= vdd->vp_data->vp_common->vpconfig_vpenable; | ||
760 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
761 | vdd->vp_enabled = true; | ||
762 | } | ||
763 | |||
764 | /** | ||
765 | * omap_vp_disable() - API to disable a particular VP | ||
766 | * @voltdm: pointer to the VDD whose VP is to be disabled. | ||
767 | * | ||
768 | * This API disables a particular voltage processor. Needed by the smartreflex | ||
769 | * class drivers. | ||
770 | */ | ||
771 | void omap_vp_disable(struct voltagedomain *voltdm) | ||
772 | { | ||
773 | struct omap_vdd_info *vdd; | ||
774 | u32 vpconfig; | ||
775 | int timeout; | ||
776 | |||
777 | if (!voltdm || IS_ERR(voltdm)) { | ||
778 | pr_warning("%s: VDD specified does not exist!\n", __func__); | ||
779 | return; | ||
780 | } | ||
781 | |||
782 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | ||
783 | if (!vdd->read_reg || !vdd->write_reg) { | ||
784 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
785 | __func__, voltdm->name); | ||
786 | return; | ||
787 | } | ||
788 | |||
789 | /* If VP is already disabled, do nothing. Return */ | ||
790 | if (!vdd->vp_enabled) { | ||
791 | pr_warning("%s: Trying to disable VP for vdd_%s when" | ||
792 | "it is already disabled\n", __func__, voltdm->name); | ||
793 | return; | ||
794 | } | ||
795 | |||
796 | /* Disable VP */ | ||
797 | vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig); | ||
798 | vpconfig &= ~vdd->vp_data->vp_common->vpconfig_vpenable; | ||
799 | vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig); | ||
800 | |||
801 | /* | ||
802 | * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us | ||
803 | */ | ||
804 | omap_test_timeout((vdd->read_reg(prm_mod_offs, vdd->vp_data->vstatus)), | ||
805 | VP_IDLE_TIMEOUT, timeout); | ||
806 | |||
807 | if (timeout >= VP_IDLE_TIMEOUT) | ||
808 | pr_warning("%s: vdd_%s idle timedout\n", | ||
809 | __func__, voltdm->name); | ||
810 | |||
811 | vdd->vp_enabled = false; | ||
812 | |||
813 | return; | ||
814 | } | ||
815 | |||
816 | /** | ||
817 | * omap_voltage_scale_vdd() - API to scale voltage of a particular | ||
818 | * voltage domain. | ||
819 | * @voltdm: pointer to the VDD which is to be scaled. | ||
820 | * @target_volt: The target voltage of the voltage domain | ||
821 | * | 68 | * |
822 | * This API should be called by the kernel to do the voltage scaling | 69 | * This API should be called by the kernel to do the voltage scaling |
823 | * for a particular voltage domain during dvfs or any other situation. | 70 | * for a particular voltage domain during DVFS. |
824 | */ | 71 | */ |
825 | int omap_voltage_scale_vdd(struct voltagedomain *voltdm, | 72 | int voltdm_scale(struct voltagedomain *voltdm, |
826 | unsigned long target_volt) | 73 | unsigned long target_volt) |
827 | { | 74 | { |
828 | struct omap_vdd_info *vdd; | 75 | int ret; |
829 | 76 | ||
830 | if (!voltdm || IS_ERR(voltdm)) { | 77 | if (!voltdm || IS_ERR(voltdm)) { |
831 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 78 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
832 | return -EINVAL; | 79 | return -EINVAL; |
833 | } | 80 | } |
834 | 81 | ||
835 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | 82 | if (!voltdm->scale) { |
836 | |||
837 | if (!vdd->volt_scale) { | ||
838 | pr_err("%s: No voltage scale API registered for vdd_%s\n", | 83 | pr_err("%s: No voltage scale API registered for vdd_%s\n", |
839 | __func__, voltdm->name); | 84 | __func__, voltdm->name); |
840 | return -ENODATA; | 85 | return -ENODATA; |
841 | } | 86 | } |
842 | 87 | ||
843 | return vdd->volt_scale(vdd, target_volt); | 88 | ret = voltdm->scale(voltdm, target_volt); |
89 | if (!ret) | ||
90 | voltdm->nominal_volt = target_volt; | ||
91 | |||
92 | return ret; | ||
844 | } | 93 | } |
845 | 94 | ||
846 | /** | 95 | /** |
847 | * omap_voltage_reset() - Resets the voltage of a particular voltage domain | 96 | * voltdm_reset() - Resets the voltage of a particular voltage domain |
848 | * to that of the current OPP. | 97 | * to that of the current OPP. |
849 | * @voltdm: pointer to the VDD whose voltage is to be reset. | 98 | * @voltdm: pointer to the voltage domain whose voltage is to be reset. |
850 | * | 99 | * |
851 | * This API finds out the correct voltage the voltage domain is supposed | 100 | * This API finds out the correct voltage the voltage domain is supposed |
852 | * to be at and resets the voltage to that level. Should be used especially | 101 | * to be at and resets the voltage to that level. Should be used especially |
853 | * while disabling any voltage compensation modules. | 102 | * while disabling any voltage compensation modules. |
854 | */ | 103 | */ |
855 | void omap_voltage_reset(struct voltagedomain *voltdm) | 104 | void voltdm_reset(struct voltagedomain *voltdm) |
856 | { | 105 | { |
857 | unsigned long target_uvdc; | 106 | unsigned long target_volt; |
858 | 107 | ||
859 | if (!voltdm || IS_ERR(voltdm)) { | 108 | if (!voltdm || IS_ERR(voltdm)) { |
860 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 109 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
861 | return; | 110 | return; |
862 | } | 111 | } |
863 | 112 | ||
864 | target_uvdc = omap_voltage_get_nom_volt(voltdm); | 113 | target_volt = voltdm_get_voltage(voltdm); |
865 | if (!target_uvdc) { | 114 | if (!target_volt) { |
866 | pr_err("%s: unable to find current voltage for vdd_%s\n", | 115 | pr_err("%s: unable to find current voltage for vdd_%s\n", |
867 | __func__, voltdm->name); | 116 | __func__, voltdm->name); |
868 | return; | 117 | return; |
869 | } | 118 | } |
870 | 119 | ||
871 | omap_voltage_scale_vdd(voltdm, target_uvdc); | 120 | voltdm_scale(voltdm, target_volt); |
872 | } | 121 | } |
873 | 122 | ||
874 | /** | 123 | /** |
@@ -884,18 +133,14 @@ void omap_voltage_reset(struct voltagedomain *voltdm) | |||
884 | * | 133 | * |
885 | */ | 134 | */ |
886 | void omap_voltage_get_volttable(struct voltagedomain *voltdm, | 135 | void omap_voltage_get_volttable(struct voltagedomain *voltdm, |
887 | struct omap_volt_data **volt_data) | 136 | struct omap_volt_data **volt_data) |
888 | { | 137 | { |
889 | struct omap_vdd_info *vdd; | ||
890 | |||
891 | if (!voltdm || IS_ERR(voltdm)) { | 138 | if (!voltdm || IS_ERR(voltdm)) { |
892 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 139 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
893 | return; | 140 | return; |
894 | } | 141 | } |
895 | 142 | ||
896 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | 143 | *volt_data = voltdm->volt_data; |
897 | |||
898 | *volt_data = vdd->volt_data; | ||
899 | } | 144 | } |
900 | 145 | ||
901 | /** | 146 | /** |
@@ -914,9 +159,8 @@ void omap_voltage_get_volttable(struct voltagedomain *voltdm, | |||
914 | * domain or if there is no matching entry. | 159 | * domain or if there is no matching entry. |
915 | */ | 160 | */ |
916 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | 161 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, |
917 | unsigned long volt) | 162 | unsigned long volt) |
918 | { | 163 | { |
919 | struct omap_vdd_info *vdd; | ||
920 | int i; | 164 | int i; |
921 | 165 | ||
922 | if (!voltdm || IS_ERR(voltdm)) { | 166 | if (!voltdm || IS_ERR(voltdm)) { |
@@ -924,17 +168,15 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | |||
924 | return ERR_PTR(-EINVAL); | 168 | return ERR_PTR(-EINVAL); |
925 | } | 169 | } |
926 | 170 | ||
927 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | 171 | if (!voltdm->volt_data) { |
928 | |||
929 | if (!vdd->volt_data) { | ||
930 | pr_warning("%s: voltage table does not exist for vdd_%s\n", | 172 | pr_warning("%s: voltage table does not exist for vdd_%s\n", |
931 | __func__, voltdm->name); | 173 | __func__, voltdm->name); |
932 | return ERR_PTR(-ENODATA); | 174 | return ERR_PTR(-ENODATA); |
933 | } | 175 | } |
934 | 176 | ||
935 | for (i = 0; vdd->volt_data[i].volt_nominal != 0; i++) { | 177 | for (i = 0; voltdm->volt_data[i].volt_nominal != 0; i++) { |
936 | if (vdd->volt_data[i].volt_nominal == volt) | 178 | if (voltdm->volt_data[i].volt_nominal == volt) |
937 | return &vdd->volt_data[i]; | 179 | return &voltdm->volt_data[i]; |
938 | } | 180 | } |
939 | 181 | ||
940 | pr_notice("%s: Unable to match the current voltage with the voltage" | 182 | pr_notice("%s: Unable to match the current voltage with the voltage" |
@@ -947,54 +189,25 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | |||
947 | * omap_voltage_register_pmic() - API to register PMIC specific data | 189 | * omap_voltage_register_pmic() - API to register PMIC specific data |
948 | * @voltdm: pointer to the VDD for which the PMIC specific data is | 190 | * @voltdm: pointer to the VDD for which the PMIC specific data is |
949 | * to be registered | 191 | * to be registered |
950 | * @pmic_info: the structure containing pmic info | 192 | * @pmic: the structure containing pmic info |
951 | * | 193 | * |
952 | * This API is to be called by the SOC/PMIC file to specify the | 194 | * This API is to be called by the SOC/PMIC file to specify the |
953 | * pmic specific info as present in omap_volt_pmic_info structure. | 195 | * pmic specific info as present in omap_voltdm_pmic structure. |
954 | */ | 196 | */ |
955 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, | 197 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, |
956 | struct omap_volt_pmic_info *pmic_info) | 198 | struct omap_voltdm_pmic *pmic) |
957 | { | 199 | { |
958 | struct omap_vdd_info *vdd; | ||
959 | |||
960 | if (!voltdm || IS_ERR(voltdm)) { | 200 | if (!voltdm || IS_ERR(voltdm)) { |
961 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 201 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
962 | return -EINVAL; | 202 | return -EINVAL; |
963 | } | 203 | } |
964 | 204 | ||
965 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | 205 | voltdm->pmic = pmic; |
966 | |||
967 | vdd->pmic_info = pmic_info; | ||
968 | 206 | ||
969 | return 0; | 207 | return 0; |
970 | } | 208 | } |
971 | 209 | ||
972 | /** | 210 | /** |
973 | * omap_voltage_get_dbgdir() - API to get pointer to the debugfs directory | ||
974 | * corresponding to a voltage domain. | ||
975 | * | ||
976 | * @voltdm: pointer to the VDD whose debug directory is required. | ||
977 | * | ||
978 | * This API returns pointer to the debugfs directory corresponding | ||
979 | * to the voltage domain. Should be used by drivers requiring to | ||
980 | * add any debug entry for a particular voltage domain. Returns NULL | ||
981 | * in case of error. | ||
982 | */ | ||
983 | struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm) | ||
984 | { | ||
985 | struct omap_vdd_info *vdd; | ||
986 | |||
987 | if (!voltdm || IS_ERR(voltdm)) { | ||
988 | pr_warning("%s: VDD specified does not exist!\n", __func__); | ||
989 | return NULL; | ||
990 | } | ||
991 | |||
992 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | ||
993 | |||
994 | return vdd->debug_dir; | ||
995 | } | ||
996 | |||
997 | /** | ||
998 | * omap_change_voltscale_method() - API to change the voltage scaling method. | 211 | * omap_change_voltscale_method() - API to change the voltage scaling method. |
999 | * @voltdm: pointer to the VDD whose voltage scaling method | 212 | * @voltdm: pointer to the VDD whose voltage scaling method |
1000 | * has to be changed. | 213 | * has to be changed. |
@@ -1005,23 +218,19 @@ struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm) | |||
1005 | * defined in voltage.h | 218 | * defined in voltage.h |
1006 | */ | 219 | */ |
1007 | void omap_change_voltscale_method(struct voltagedomain *voltdm, | 220 | void omap_change_voltscale_method(struct voltagedomain *voltdm, |
1008 | int voltscale_method) | 221 | int voltscale_method) |
1009 | { | 222 | { |
1010 | struct omap_vdd_info *vdd; | ||
1011 | |||
1012 | if (!voltdm || IS_ERR(voltdm)) { | 223 | if (!voltdm || IS_ERR(voltdm)) { |
1013 | pr_warning("%s: VDD specified does not exist!\n", __func__); | 224 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
1014 | return; | 225 | return; |
1015 | } | 226 | } |
1016 | 227 | ||
1017 | vdd = container_of(voltdm, struct omap_vdd_info, voltdm); | ||
1018 | |||
1019 | switch (voltscale_method) { | 228 | switch (voltscale_method) { |
1020 | case VOLTSCALE_VPFORCEUPDATE: | 229 | case VOLTSCALE_VPFORCEUPDATE: |
1021 | vdd->volt_scale = vp_forceupdate_scale_voltage; | 230 | voltdm->scale = omap_vp_forceupdate_scale; |
1022 | return; | 231 | return; |
1023 | case VOLTSCALE_VCBYPASS: | 232 | case VOLTSCALE_VCBYPASS: |
1024 | vdd->volt_scale = vc_bypass_scale_voltage; | 233 | voltdm->scale = omap_vc_bypass_scale; |
1025 | return; | 234 | return; |
1026 | default: | 235 | default: |
1027 | pr_warning("%s: Trying to change the method of voltage scaling" | 236 | pr_warning("%s: Trying to change the method of voltage scaling" |
@@ -1030,77 +239,192 @@ void omap_change_voltscale_method(struct voltagedomain *voltdm, | |||
1030 | } | 239 | } |
1031 | 240 | ||
1032 | /** | 241 | /** |
1033 | * omap_voltage_domain_lookup() - API to get the voltage domain pointer | 242 | * omap_voltage_late_init() - Init the various voltage parameters |
1034 | * @name: Name of the voltage domain | ||
1035 | * | 243 | * |
1036 | * This API looks up in the global vdd_info struct for the | 244 | * This API is to be called in the later stages of the |
1037 | * existence of voltage domain <name>. If it exists, the API returns | 245 | * system boot to init the voltage controller and |
1038 | * a pointer to the voltage domain structure corresponding to the | 246 | * voltage processors. |
1039 | * VDD<name>. Else retuns error pointer. | ||
1040 | */ | 247 | */ |
1041 | struct voltagedomain *omap_voltage_domain_lookup(char *name) | 248 | int __init omap_voltage_late_init(void) |
1042 | { | 249 | { |
1043 | int i; | 250 | struct voltagedomain *voltdm; |
1044 | 251 | ||
1045 | if (!vdd_info) { | 252 | if (list_empty(&voltdm_list)) { |
1046 | pr_err("%s: Voltage driver init not yet happened.Faulting!\n", | 253 | pr_err("%s: Voltage driver support not added\n", |
1047 | __func__); | 254 | __func__); |
1048 | return ERR_PTR(-EINVAL); | 255 | return -EINVAL; |
1049 | } | 256 | } |
1050 | 257 | ||
1051 | if (!name) { | 258 | list_for_each_entry(voltdm, &voltdm_list, node) { |
1052 | pr_err("%s: No name to get the votage domain!\n", __func__); | 259 | struct clk *sys_ck; |
1053 | return ERR_PTR(-EINVAL); | 260 | |
261 | if (!voltdm->scalable) | ||
262 | continue; | ||
263 | |||
264 | sys_ck = clk_get(NULL, voltdm->sys_clk.name); | ||
265 | if (IS_ERR(sys_ck)) { | ||
266 | pr_warning("%s: Could not get sys clk.\n", __func__); | ||
267 | return -EINVAL; | ||
268 | } | ||
269 | voltdm->sys_clk.rate = clk_get_rate(sys_ck); | ||
270 | WARN_ON(!voltdm->sys_clk.rate); | ||
271 | clk_put(sys_ck); | ||
272 | |||
273 | if (voltdm->vc) { | ||
274 | voltdm->scale = omap_vc_bypass_scale; | ||
275 | omap_vc_init_channel(voltdm); | ||
276 | } | ||
277 | |||
278 | if (voltdm->vp) { | ||
279 | voltdm->scale = omap_vp_forceupdate_scale; | ||
280 | omap_vp_init(voltdm); | ||
281 | } | ||
1054 | } | 282 | } |
1055 | 283 | ||
1056 | for (i = 0; i < nr_scalable_vdd; i++) { | 284 | return 0; |
1057 | if (!(strcmp(name, vdd_info[i]->voltdm.name))) | 285 | } |
1058 | return &vdd_info[i]->voltdm; | 286 | |
287 | static struct voltagedomain *_voltdm_lookup(const char *name) | ||
288 | { | ||
289 | struct voltagedomain *voltdm, *temp_voltdm; | ||
290 | |||
291 | voltdm = NULL; | ||
292 | |||
293 | list_for_each_entry(temp_voltdm, &voltdm_list, node) { | ||
294 | if (!strcmp(name, temp_voltdm->name)) { | ||
295 | voltdm = temp_voltdm; | ||
296 | break; | ||
297 | } | ||
1059 | } | 298 | } |
1060 | 299 | ||
1061 | return ERR_PTR(-EINVAL); | 300 | return voltdm; |
1062 | } | 301 | } |
1063 | 302 | ||
1064 | /** | 303 | /** |
1065 | * omap_voltage_late_init() - Init the various voltage parameters | 304 | * voltdm_add_pwrdm - add a powerdomain to a voltagedomain |
305 | * @voltdm: struct voltagedomain * to add the powerdomain to | ||
306 | * @pwrdm: struct powerdomain * to associate with a voltagedomain | ||
1066 | * | 307 | * |
1067 | * This API is to be called in the later stages of the | 308 | * Associate the powerdomain @pwrdm with a voltagedomain @voltdm. This |
1068 | * system boot to init the voltage controller and | 309 | * enables the use of voltdm_for_each_pwrdm(). Returns -EINVAL if |
1069 | * voltage processors. | 310 | * presented with invalid pointers; -ENOMEM if memory could not be allocated; |
311 | * or 0 upon success. | ||
1070 | */ | 312 | */ |
1071 | int __init omap_voltage_late_init(void) | 313 | int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm) |
1072 | { | 314 | { |
1073 | int i; | 315 | if (!voltdm || !pwrdm) |
316 | return -EINVAL; | ||
1074 | 317 | ||
1075 | if (!vdd_info) { | 318 | pr_debug("voltagedomain: associating powerdomain %s with voltagedomain " |
1076 | pr_err("%s: Voltage driver support not added\n", | 319 | "%s\n", pwrdm->name, voltdm->name); |
1077 | __func__); | 320 | |
321 | list_add(&pwrdm->voltdm_node, &voltdm->pwrdm_list); | ||
322 | |||
323 | return 0; | ||
324 | } | ||
325 | |||
326 | /** | ||
327 | * voltdm_for_each_pwrdm - call function for each pwrdm in a voltdm | ||
328 | * @voltdm: struct voltagedomain * to iterate over | ||
329 | * @fn: callback function * | ||
330 | * | ||
331 | * Call the supplied function @fn for each powerdomain in the | ||
332 | * voltagedomain @voltdm. Returns -EINVAL if presented with invalid | ||
333 | * pointers; or passes along the last return value of the callback | ||
334 | * function, which should be 0 for success or anything else to | ||
335 | * indicate failure. | ||
336 | */ | ||
337 | int voltdm_for_each_pwrdm(struct voltagedomain *voltdm, | ||
338 | int (*fn)(struct voltagedomain *voltdm, | ||
339 | struct powerdomain *pwrdm)) | ||
340 | { | ||
341 | struct powerdomain *pwrdm; | ||
342 | int ret = 0; | ||
343 | |||
344 | if (!fn) | ||
1078 | return -EINVAL; | 345 | return -EINVAL; |
1079 | } | ||
1080 | 346 | ||
1081 | voltage_dir = debugfs_create_dir("voltage", NULL); | 347 | list_for_each_entry(pwrdm, &voltdm->pwrdm_list, voltdm_node) |
1082 | if (IS_ERR(voltage_dir)) | 348 | ret = (*fn)(voltdm, pwrdm); |
1083 | pr_err("%s: Unable to create voltage debugfs main dir\n", | 349 | |
1084 | __func__); | 350 | return ret; |
1085 | for (i = 0; i < nr_scalable_vdd; i++) { | 351 | } |
1086 | if (omap_vdd_data_configure(vdd_info[i])) | 352 | |
1087 | continue; | 353 | /** |
1088 | omap_vc_init(vdd_info[i]); | 354 | * voltdm_for_each - call function on each registered voltagedomain |
1089 | vp_init(vdd_info[i]); | 355 | * @fn: callback function * |
1090 | vdd_debugfs_init(vdd_info[i]); | 356 | * |
357 | * Call the supplied function @fn for each registered voltagedomain. | ||
358 | * The callback function @fn can return anything but 0 to bail out | ||
359 | * early from the iterator. Returns the last return value of the | ||
360 | * callback function, which should be 0 for success or anything else | ||
361 | * to indicate failure; or -EINVAL if the function pointer is null. | ||
362 | */ | ||
363 | int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user), | ||
364 | void *user) | ||
365 | { | ||
366 | struct voltagedomain *temp_voltdm; | ||
367 | int ret = 0; | ||
368 | |||
369 | if (!fn) | ||
370 | return -EINVAL; | ||
371 | |||
372 | list_for_each_entry(temp_voltdm, &voltdm_list, node) { | ||
373 | ret = (*fn)(temp_voltdm, user); | ||
374 | if (ret) | ||
375 | break; | ||
1091 | } | 376 | } |
1092 | 377 | ||
1093 | return 0; | 378 | return ret; |
1094 | } | 379 | } |
1095 | 380 | ||
1096 | /* XXX document */ | 381 | static int _voltdm_register(struct voltagedomain *voltdm) |
1097 | int __init omap_voltage_early_init(s16 prm_mod, s16 prm_irqst_ocp_mod, | ||
1098 | struct omap_vdd_info *omap_vdd_array[], | ||
1099 | u8 omap_vdd_count) | ||
1100 | { | 382 | { |
1101 | prm_mod_offs = prm_mod; | 383 | if (!voltdm || !voltdm->name) |
1102 | prm_irqst_ocp_mod_offs = prm_irqst_ocp_mod; | 384 | return -EINVAL; |
1103 | vdd_info = omap_vdd_array; | 385 | |
1104 | nr_scalable_vdd = omap_vdd_count; | 386 | INIT_LIST_HEAD(&voltdm->pwrdm_list); |
387 | list_add(&voltdm->node, &voltdm_list); | ||
388 | |||
389 | pr_debug("voltagedomain: registered %s\n", voltdm->name); | ||
390 | |||
1105 | return 0; | 391 | return 0; |
1106 | } | 392 | } |
393 | |||
394 | /** | ||
395 | * voltdm_lookup - look up a voltagedomain by name, return a pointer | ||
396 | * @name: name of voltagedomain | ||
397 | * | ||
398 | * Find a registered voltagedomain by its name @name. Returns a pointer | ||
399 | * to the struct voltagedomain if found, or NULL otherwise. | ||
400 | */ | ||
401 | struct voltagedomain *voltdm_lookup(const char *name) | ||
402 | { | ||
403 | struct voltagedomain *voltdm ; | ||
404 | |||
405 | if (!name) | ||
406 | return NULL; | ||
407 | |||
408 | voltdm = _voltdm_lookup(name); | ||
409 | |||
410 | return voltdm; | ||
411 | } | ||
412 | |||
413 | /** | ||
414 | * voltdm_init - set up the voltagedomain layer | ||
415 | * @voltdm_list: array of struct voltagedomain pointers to register | ||
416 | * | ||
417 | * Loop through the array of voltagedomains @voltdm_list, registering all | ||
418 | * that are available on the current CPU. If voltdm_list is supplied | ||
419 | * and not null, all of the referenced voltagedomains will be | ||
420 | * registered. No return value. | ||
421 | */ | ||
422 | void voltdm_init(struct voltagedomain **voltdms) | ||
423 | { | ||
424 | struct voltagedomain **v; | ||
425 | |||
426 | if (voltdms) { | ||
427 | for (v = voltdms; *v; v++) | ||
428 | _voltdm_register(*v); | ||
429 | } | ||
430 | } | ||
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index e9f5408244e0..16a1b092cf36 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #include "vc.h" | 19 | #include "vc.h" |
20 | #include "vp.h" | 20 | #include "vp.h" |
21 | 21 | ||
22 | struct powerdomain; | ||
23 | |||
22 | /* XXX document */ | 24 | /* XXX document */ |
23 | #define VOLTSCALE_VPFORCEUPDATE 1 | 25 | #define VOLTSCALE_VPFORCEUPDATE 1 |
24 | #define VOLTSCALE_VCBYPASS 2 | 26 | #define VOLTSCALE_VCBYPASS 2 |
@@ -32,29 +34,60 @@ | |||
32 | #define OMAP3_VOLTSETUP2 0xff | 34 | #define OMAP3_VOLTSETUP2 0xff |
33 | 35 | ||
34 | /** | 36 | /** |
35 | * struct omap_vfsm_instance_data - per-voltage manager FSM register/bitfield | 37 | * struct omap_vfsm_instance - per-voltage manager FSM register/bitfield |
36 | * data | 38 | * data |
37 | * @voltsetup_mask: SETUP_TIME* bitmask in the PRM_VOLTSETUP* register | 39 | * @voltsetup_mask: SETUP_TIME* bitmask in the PRM_VOLTSETUP* register |
38 | * @voltsetup_reg: register offset of PRM_VOLTSETUP from PRM base | 40 | * @voltsetup_reg: register offset of PRM_VOLTSETUP from PRM base |
39 | * @voltsetup_shift: SETUP_TIME* field shift in the PRM_VOLTSETUP* register | ||
40 | * | 41 | * |
41 | * XXX What about VOLTOFFSET/VOLTCTRL? | 42 | * 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 | */ | 43 | */ |
45 | struct omap_vfsm_instance_data { | 44 | struct omap_vfsm_instance { |
46 | u32 voltsetup_mask; | 45 | u32 voltsetup_mask; |
47 | u8 voltsetup_reg; | 46 | u8 voltsetup_reg; |
48 | u8 voltsetup_shift; | ||
49 | }; | 47 | }; |
50 | 48 | ||
51 | /** | 49 | /** |
52 | * struct voltagedomain - omap voltage domain global structure. | 50 | * struct voltagedomain - omap voltage domain global structure. |
53 | * @name: Name of the voltage domain which can be used as a unique | 51 | * @name: Name of the voltage domain which can be used as a unique identifier. |
54 | * identifier. | 52 | * @scalable: Whether or not this voltage domain is scalable |
53 | * @node: list_head linking all voltage domains | ||
54 | * @pwrdm_list: list_head linking all powerdomains in this voltagedomain | ||
55 | * @vc: pointer to VC channel associated with this voltagedomain | ||
56 | * @vp: pointer to VP associated with this voltagedomain | ||
57 | * @read: read a VC/VP register | ||
58 | * @write: write a VC/VP register | ||
59 | * @read: read-modify-write a VC/VP register | ||
60 | * @sys_clk: system clock name/frequency, used for various timing calculations | ||
61 | * @scale: function used to scale the voltage of the voltagedomain | ||
62 | * @nominal_volt: current nominal voltage for this voltage domain | ||
63 | * @volt_data: voltage table having the distinct voltages supported | ||
64 | * by the domain and other associated per voltage data. | ||
55 | */ | 65 | */ |
56 | struct voltagedomain { | 66 | struct voltagedomain { |
57 | char *name; | 67 | char *name; |
68 | bool scalable; | ||
69 | struct list_head node; | ||
70 | struct list_head pwrdm_list; | ||
71 | struct omap_vc_channel *vc; | ||
72 | const struct omap_vfsm_instance *vfsm; | ||
73 | struct omap_vp_instance *vp; | ||
74 | struct omap_voltdm_pmic *pmic; | ||
75 | |||
76 | /* VC/VP register access functions: SoC specific */ | ||
77 | u32 (*read) (u8 offset); | ||
78 | void (*write) (u32 val, u8 offset); | ||
79 | u32 (*rmw)(u32 mask, u32 bits, u8 offset); | ||
80 | |||
81 | union { | ||
82 | const char *name; | ||
83 | u32 rate; | ||
84 | } sys_clk; | ||
85 | |||
86 | int (*scale) (struct voltagedomain *voltdm, | ||
87 | unsigned long target_volt); | ||
88 | |||
89 | u32 nominal_volt; | ||
90 | struct omap_volt_data *volt_data; | ||
58 | }; | 91 | }; |
59 | 92 | ||
60 | /** | 93 | /** |
@@ -77,13 +110,18 @@ struct omap_volt_data { | |||
77 | }; | 110 | }; |
78 | 111 | ||
79 | /** | 112 | /** |
80 | * struct omap_volt_pmic_info - PMIC specific data required by voltage driver. | 113 | * struct omap_voltdm_pmic - PMIC specific data required by voltage driver. |
81 | * @slew_rate: PMIC slew rate (in uv/us) | 114 | * @slew_rate: PMIC slew rate (in uv/us) |
82 | * @step_size: PMIC voltage step size (in uv) | 115 | * @step_size: PMIC voltage step size (in uv) |
116 | * @i2c_slave_addr: I2C slave address of PMIC | ||
117 | * @volt_reg_addr: voltage configuration register address | ||
118 | * @cmd_reg_addr: command (on, on-LP, ret, off) configuration register address | ||
119 | * @i2c_high_speed: whether VC uses I2C high-speed mode to PMIC | ||
120 | * @i2c_mcode: master code value for I2C high-speed preamble transmission | ||
83 | * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV. | 121 | * @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. | 122 | * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value. |
85 | */ | 123 | */ |
86 | struct omap_volt_pmic_info { | 124 | struct omap_voltdm_pmic { |
87 | int slew_rate; | 125 | int slew_rate; |
88 | int step_size; | 126 | int step_size; |
89 | u32 on_volt; | 127 | u32 on_volt; |
@@ -91,94 +129,44 @@ struct omap_volt_pmic_info { | |||
91 | u32 ret_volt; | 129 | u32 ret_volt; |
92 | u32 off_volt; | 130 | u32 off_volt; |
93 | u16 volt_setup_time; | 131 | u16 volt_setup_time; |
132 | u16 i2c_slave_addr; | ||
133 | u16 volt_reg_addr; | ||
134 | u16 cmd_reg_addr; | ||
94 | u8 vp_erroroffset; | 135 | u8 vp_erroroffset; |
95 | u8 vp_vstepmin; | 136 | u8 vp_vstepmin; |
96 | u8 vp_vstepmax; | 137 | u8 vp_vstepmax; |
97 | u8 vp_vddmin; | 138 | u8 vp_vddmin; |
98 | u8 vp_vddmax; | 139 | u8 vp_vddmax; |
99 | u8 vp_timeout_us; | 140 | u8 vp_timeout_us; |
100 | u8 i2c_slave_addr; | 141 | bool i2c_high_speed; |
101 | u8 pmic_reg; | 142 | u8 i2c_mcode; |
102 | unsigned long (*vsel_to_uv) (const u8 vsel); | 143 | unsigned long (*vsel_to_uv) (const u8 vsel); |
103 | u8 (*uv_to_vsel) (unsigned long uV); | 144 | u8 (*uv_to_vsel) (unsigned long uV); |
104 | }; | 145 | }; |
105 | 146 | ||
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, | 147 | void omap_voltage_get_volttable(struct voltagedomain *voltdm, |
149 | struct omap_volt_data **volt_data); | 148 | struct omap_volt_data **volt_data); |
150 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | 149 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, |
151 | unsigned long volt); | 150 | 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, | 151 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, |
159 | struct omap_volt_pmic_info *pmic_info); | 152 | struct omap_voltdm_pmic *pmic); |
160 | void omap_change_voltscale_method(struct voltagedomain *voltdm, | 153 | void omap_change_voltscale_method(struct voltagedomain *voltdm, |
161 | int voltscale_method); | 154 | 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); | 155 | 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 | 156 | ||
157 | extern void omap2xxx_voltagedomains_init(void); | ||
158 | extern void omap3xxx_voltagedomains_init(void); | ||
159 | extern void omap44xx_voltagedomains_init(void); | ||
160 | |||
161 | struct voltagedomain *voltdm_lookup(const char *name); | ||
162 | void voltdm_init(struct voltagedomain **voltdm_list); | ||
163 | int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm); | ||
164 | int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user), | ||
165 | void *user); | ||
166 | int voltdm_for_each_pwrdm(struct voltagedomain *voltdm, | ||
167 | int (*fn)(struct voltagedomain *voltdm, | ||
168 | struct powerdomain *pwrdm)); | ||
169 | int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); | ||
170 | void voltdm_reset(struct voltagedomain *voltdm); | ||
171 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); | ||
184 | #endif | 172 | #endif |
diff --git a/arch/arm/mach-omap2/voltagedomains2xxx_data.c b/arch/arm/mach-omap2/voltagedomains2xxx_data.c new file mode 100644 index 000000000000..7a41349981e5 --- /dev/null +++ b/arch/arm/mach-omap2/voltagedomains2xxx_data.c | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * OMAP3 voltage domain data | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include "voltage.h" | ||
14 | |||
15 | static struct voltagedomain omap2_voltdm_core = { | ||
16 | .name = "core", | ||
17 | }; | ||
18 | |||
19 | static struct voltagedomain omap2_voltdm_wkup = { | ||
20 | .name = "wakeup", | ||
21 | }; | ||
22 | |||
23 | static struct voltagedomain *voltagedomains_omap2[] __initdata = { | ||
24 | &omap2_voltdm_core, | ||
25 | &omap2_voltdm_wkup, | ||
26 | NULL, | ||
27 | }; | ||
28 | |||
29 | void __init omap2xxx_voltagedomains_init(void) | ||
30 | { | ||
31 | voltdm_init(voltagedomains_omap2); | ||
32 | } | ||
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c index def230fd2fde..071101debbbc 100644 --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c | |||
@@ -31,65 +31,70 @@ | |||
31 | * VDD data | 31 | * VDD data |
32 | */ | 32 | */ |
33 | 33 | ||
34 | static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = { | 34 | static const struct omap_vfsm_instance omap3_vdd1_vfsm = { |
35 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, | 35 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, |
36 | .voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT, | ||
37 | .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK, | 36 | .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK, |
38 | }; | 37 | }; |
39 | 38 | ||
40 | static struct omap_vdd_info omap3_vdd1_info = { | 39 | static const struct omap_vfsm_instance omap3_vdd2_vfsm = { |
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, | 40 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, |
51 | .voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT, | ||
52 | .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK, | 41 | .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK, |
53 | }; | 42 | }; |
54 | 43 | ||
55 | static struct omap_vdd_info omap3_vdd2_info = { | 44 | static struct voltagedomain omap3_voltdm_mpu = { |
56 | .vp_data = &omap3_vp2_data, | 45 | .name = "mpu_iva", |
57 | .vc_data = &omap3_vc2_data, | 46 | .scalable = true, |
58 | .vfsm = &omap3_vdd2_vfsm_data, | 47 | .read = omap3_prm_vcvp_read, |
59 | .voltdm = { | 48 | .write = omap3_prm_vcvp_write, |
60 | .name = "core", | 49 | .rmw = omap3_prm_vcvp_rmw, |
61 | }, | 50 | .vc = &omap3_vc_mpu, |
51 | .vfsm = &omap3_vdd1_vfsm, | ||
52 | .vp = &omap3_vp_mpu, | ||
62 | }; | 53 | }; |
63 | 54 | ||
64 | /* OMAP3 VDD structures */ | 55 | static struct voltagedomain omap3_voltdm_core = { |
65 | static struct omap_vdd_info *omap3_vdd_info[] = { | 56 | .name = "core", |
66 | &omap3_vdd1_info, | 57 | .scalable = true, |
67 | &omap3_vdd2_info, | 58 | .read = omap3_prm_vcvp_read, |
59 | .write = omap3_prm_vcvp_write, | ||
60 | .rmw = omap3_prm_vcvp_rmw, | ||
61 | .vc = &omap3_vc_core, | ||
62 | .vfsm = &omap3_vdd2_vfsm, | ||
63 | .vp = &omap3_vp_core, | ||
68 | }; | 64 | }; |
69 | 65 | ||
70 | /* OMAP3 specific voltage init functions */ | 66 | static struct voltagedomain omap3_voltdm_wkup = { |
71 | static int __init omap3xxx_voltage_early_init(void) | 67 | .name = "wakeup", |
72 | { | 68 | }; |
73 | s16 prm_mod = OMAP3430_GR_MOD; | ||
74 | s16 prm_irqst_ocp_mod = OCP_MOD; | ||
75 | 69 | ||
76 | if (!cpu_is_omap34xx()) | 70 | static struct voltagedomain *voltagedomains_omap3[] __initdata = { |
77 | return 0; | 71 | &omap3_voltdm_mpu, |
72 | &omap3_voltdm_core, | ||
73 | &omap3_voltdm_wkup, | ||
74 | NULL, | ||
75 | }; | ||
76 | |||
77 | static const char *sys_clk_name __initdata = "sys_ck"; | ||
78 | |||
79 | void __init omap3xxx_voltagedomains_init(void) | ||
80 | { | ||
81 | struct voltagedomain *voltdm; | ||
82 | int i; | ||
78 | 83 | ||
79 | /* | 84 | /* |
80 | * XXX Will depend on the process, validation, and binning | 85 | * XXX Will depend on the process, validation, and binning |
81 | * for the currently-running IC | 86 | * for the currently-running IC |
82 | */ | 87 | */ |
83 | if (cpu_is_omap3630()) { | 88 | if (cpu_is_omap3630()) { |
84 | omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data; | 89 | omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data; |
85 | omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data; | 90 | omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data; |
86 | } else { | 91 | } else { |
87 | omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data; | 92 | omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data; |
88 | omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data; | 93 | omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data; |
89 | } | 94 | } |
90 | 95 | ||
91 | return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod, | 96 | for (i = 0; voltdm = voltagedomains_omap3[i], voltdm; i++) |
92 | omap3_vdd_info, | 97 | voltdm->sys_clk.name = sys_clk_name; |
93 | ARRAY_SIZE(omap3_vdd_info)); | 98 | |
99 | voltdm_init(voltagedomains_omap3); | ||
94 | }; | 100 | }; |
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 index cb64996de0e1..c4584e9ac717 100644 --- a/arch/arm/mach-omap2/voltagedomains44xx_data.c +++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c | |||
@@ -32,71 +32,80 @@ | |||
32 | #include "vc.h" | 32 | #include "vc.h" |
33 | #include "vp.h" | 33 | #include "vp.h" |
34 | 34 | ||
35 | static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = { | 35 | static const struct omap_vfsm_instance omap4_vdd_mpu_vfsm = { |
36 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET, | 36 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static struct omap_vdd_info omap4_vdd_mpu_info = { | 39 | static const struct omap_vfsm_instance omap4_vdd_iva_vfsm = { |
40 | .vp_data = &omap4_vp_mpu_data, | 40 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET, |
41 | .vc_data = &omap4_vc_mpu_data, | ||
42 | .vfsm = &omap4_vdd_mpu_vfsm_data, | ||
43 | .voltdm = { | ||
44 | .name = "mpu", | ||
45 | }, | ||
46 | }; | 41 | }; |
47 | 42 | ||
48 | static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = { | 43 | static const struct omap_vfsm_instance omap4_vdd_core_vfsm = { |
49 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET, | 44 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET, |
50 | }; | 45 | }; |
51 | 46 | ||
52 | static struct omap_vdd_info omap4_vdd_iva_info = { | 47 | static struct voltagedomain omap4_voltdm_mpu = { |
53 | .vp_data = &omap4_vp_iva_data, | 48 | .name = "mpu", |
54 | .vc_data = &omap4_vc_iva_data, | 49 | .scalable = true, |
55 | .vfsm = &omap4_vdd_iva_vfsm_data, | 50 | .read = omap4_prm_vcvp_read, |
56 | .voltdm = { | 51 | .write = omap4_prm_vcvp_write, |
57 | .name = "iva", | 52 | .rmw = omap4_prm_vcvp_rmw, |
58 | }, | 53 | .vc = &omap4_vc_mpu, |
54 | .vfsm = &omap4_vdd_mpu_vfsm, | ||
55 | .vp = &omap4_vp_mpu, | ||
59 | }; | 56 | }; |
60 | 57 | ||
61 | static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = { | 58 | static struct voltagedomain omap4_voltdm_iva = { |
62 | .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET, | 59 | .name = "iva", |
60 | .scalable = true, | ||
61 | .read = omap4_prm_vcvp_read, | ||
62 | .write = omap4_prm_vcvp_write, | ||
63 | .rmw = omap4_prm_vcvp_rmw, | ||
64 | .vc = &omap4_vc_iva, | ||
65 | .vfsm = &omap4_vdd_iva_vfsm, | ||
66 | .vp = &omap4_vp_iva, | ||
63 | }; | 67 | }; |
64 | 68 | ||
65 | static struct omap_vdd_info omap4_vdd_core_info = { | 69 | static struct voltagedomain omap4_voltdm_core = { |
66 | .vp_data = &omap4_vp_core_data, | 70 | .name = "core", |
67 | .vc_data = &omap4_vc_core_data, | 71 | .scalable = true, |
68 | .vfsm = &omap4_vdd_core_vfsm_data, | 72 | .read = omap4_prm_vcvp_read, |
69 | .voltdm = { | 73 | .write = omap4_prm_vcvp_write, |
70 | .name = "core", | 74 | .rmw = omap4_prm_vcvp_rmw, |
71 | }, | 75 | .vc = &omap4_vc_core, |
76 | .vfsm = &omap4_vdd_core_vfsm, | ||
77 | .vp = &omap4_vp_core, | ||
72 | }; | 78 | }; |
73 | 79 | ||
74 | /* OMAP4 VDD structures */ | 80 | static struct voltagedomain omap4_voltdm_wkup = { |
75 | static struct omap_vdd_info *omap4_vdd_info[] = { | 81 | .name = "wakeup", |
76 | &omap4_vdd_mpu_info, | ||
77 | &omap4_vdd_iva_info, | ||
78 | &omap4_vdd_core_info, | ||
79 | }; | 82 | }; |
80 | 83 | ||
81 | /* OMAP4 specific voltage init functions */ | 84 | static struct voltagedomain *voltagedomains_omap4[] __initdata = { |
82 | static int __init omap44xx_voltage_early_init(void) | 85 | &omap4_voltdm_mpu, |
83 | { | 86 | &omap4_voltdm_iva, |
84 | s16 prm_mod = OMAP4430_PRM_DEVICE_INST; | 87 | &omap4_voltdm_core, |
85 | s16 prm_irqst_ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST; | 88 | &omap4_voltdm_wkup, |
89 | NULL, | ||
90 | }; | ||
91 | |||
92 | static const char *sys_clk_name __initdata = "sys_clkin_ck"; | ||
86 | 93 | ||
87 | if (!cpu_is_omap44xx()) | 94 | void __init omap44xx_voltagedomains_init(void) |
88 | return 0; | 95 | { |
96 | struct voltagedomain *voltdm; | ||
97 | int i; | ||
89 | 98 | ||
90 | /* | 99 | /* |
91 | * XXX Will depend on the process, validation, and binning | 100 | * XXX Will depend on the process, validation, and binning |
92 | * for the currently-running IC | 101 | * for the currently-running IC |
93 | */ | 102 | */ |
94 | omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data; | 103 | omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data; |
95 | omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data; | 104 | omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data; |
96 | omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data; | 105 | omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data; |
106 | |||
107 | for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++) | ||
108 | voltdm->sys_clk.name = sys_clk_name; | ||
97 | 109 | ||
98 | return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod, | 110 | voltdm_init(voltagedomains_omap4); |
99 | omap4_vdd_info, | ||
100 | ARRAY_SIZE(omap4_vdd_info)); | ||
101 | }; | 111 | }; |
102 | core_initcall(omap44xx_voltage_early_init); | ||
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c new file mode 100644 index 000000000000..66bd700a2b98 --- /dev/null +++ b/arch/arm/mach-omap2/vp.c | |||
@@ -0,0 +1,278 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/init.h> | ||
3 | |||
4 | #include <plat/common.h> | ||
5 | |||
6 | #include "voltage.h" | ||
7 | #include "vp.h" | ||
8 | #include "prm-regbits-34xx.h" | ||
9 | #include "prm-regbits-44xx.h" | ||
10 | #include "prm44xx.h" | ||
11 | |||
12 | static u32 _vp_set_init_voltage(struct voltagedomain *voltdm, u32 volt) | ||
13 | { | ||
14 | struct omap_vp_instance *vp = voltdm->vp; | ||
15 | u32 vpconfig; | ||
16 | char vsel; | ||
17 | |||
18 | vsel = voltdm->pmic->uv_to_vsel(volt); | ||
19 | |||
20 | vpconfig = voltdm->read(vp->vpconfig); | ||
21 | vpconfig &= ~(vp->common->vpconfig_initvoltage_mask | | ||
22 | vp->common->vpconfig_forceupdate | | ||
23 | vp->common->vpconfig_initvdd); | ||
24 | vpconfig |= vsel << __ffs(vp->common->vpconfig_initvoltage_mask); | ||
25 | voltdm->write(vpconfig, vp->vpconfig); | ||
26 | |||
27 | /* Trigger initVDD value copy to voltage processor */ | ||
28 | voltdm->write((vpconfig | vp->common->vpconfig_initvdd), | ||
29 | vp->vpconfig); | ||
30 | |||
31 | /* Clear initVDD copy trigger bit */ | ||
32 | voltdm->write(vpconfig, vp->vpconfig); | ||
33 | |||
34 | return vpconfig; | ||
35 | } | ||
36 | |||
37 | /* Generic voltage init functions */ | ||
38 | void __init omap_vp_init(struct voltagedomain *voltdm) | ||
39 | { | ||
40 | struct omap_vp_instance *vp = voltdm->vp; | ||
41 | u32 val, sys_clk_rate, timeout, waittime; | ||
42 | u32 vddmin, vddmax, vstepmin, vstepmax; | ||
43 | |||
44 | if (!voltdm->read || !voltdm->write) { | ||
45 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
46 | __func__, voltdm->name); | ||
47 | return; | ||
48 | } | ||
49 | |||
50 | vp->enabled = false; | ||
51 | |||
52 | /* Divide to avoid overflow */ | ||
53 | sys_clk_rate = voltdm->sys_clk.rate / 1000; | ||
54 | |||
55 | timeout = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000; | ||
56 | vddmin = voltdm->pmic->vp_vddmin; | ||
57 | vddmax = voltdm->pmic->vp_vddmax; | ||
58 | |||
59 | waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) * | ||
60 | sys_clk_rate) / 1000; | ||
61 | vstepmin = voltdm->pmic->vp_vstepmin; | ||
62 | vstepmax = voltdm->pmic->vp_vstepmax; | ||
63 | |||
64 | /* | ||
65 | * VP_CONFIG: error gain is not set here, it will be updated | ||
66 | * on each scale, based on OPP. | ||
67 | */ | ||
68 | val = (voltdm->pmic->vp_erroroffset << | ||
69 | __ffs(voltdm->vp->common->vpconfig_erroroffset_mask)) | | ||
70 | vp->common->vpconfig_timeouten; | ||
71 | voltdm->write(val, vp->vpconfig); | ||
72 | |||
73 | /* VSTEPMIN */ | ||
74 | val = (waittime << vp->common->vstepmin_smpswaittimemin_shift) | | ||
75 | (vstepmin << vp->common->vstepmin_stepmin_shift); | ||
76 | voltdm->write(val, vp->vstepmin); | ||
77 | |||
78 | /* VSTEPMAX */ | ||
79 | val = (vstepmax << vp->common->vstepmax_stepmax_shift) | | ||
80 | (waittime << vp->common->vstepmax_smpswaittimemax_shift); | ||
81 | voltdm->write(val, vp->vstepmax); | ||
82 | |||
83 | /* VLIMITTO */ | ||
84 | val = (vddmax << vp->common->vlimitto_vddmax_shift) | | ||
85 | (vddmin << vp->common->vlimitto_vddmin_shift) | | ||
86 | (timeout << vp->common->vlimitto_timeout_shift); | ||
87 | voltdm->write(val, vp->vlimitto); | ||
88 | } | ||
89 | |||
90 | int omap_vp_update_errorgain(struct voltagedomain *voltdm, | ||
91 | unsigned long target_volt) | ||
92 | { | ||
93 | struct omap_volt_data *volt_data; | ||
94 | |||
95 | if (!voltdm->vp) | ||
96 | return -EINVAL; | ||
97 | |||
98 | /* Get volt_data corresponding to target_volt */ | ||
99 | volt_data = omap_voltage_get_voltdata(voltdm, target_volt); | ||
100 | if (IS_ERR(volt_data)) | ||
101 | return -EINVAL; | ||
102 | |||
103 | /* Setting vp errorgain based on the voltage */ | ||
104 | voltdm->rmw(voltdm->vp->common->vpconfig_errorgain_mask, | ||
105 | volt_data->vp_errgain << | ||
106 | __ffs(voltdm->vp->common->vpconfig_errorgain_mask), | ||
107 | voltdm->vp->vpconfig); | ||
108 | |||
109 | return 0; | ||
110 | } | ||
111 | |||
112 | /* VP force update method of voltage scaling */ | ||
113 | int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, | ||
114 | unsigned long target_volt) | ||
115 | { | ||
116 | struct omap_vp_instance *vp = voltdm->vp; | ||
117 | u32 vpconfig; | ||
118 | u8 target_vsel, current_vsel; | ||
119 | int ret, timeout = 0; | ||
120 | |||
121 | ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, ¤t_vsel); | ||
122 | if (ret) | ||
123 | return ret; | ||
124 | |||
125 | /* | ||
126 | * Clear all pending TransactionDone interrupt/status. Typical latency | ||
127 | * is <3us | ||
128 | */ | ||
129 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { | ||
130 | vp->common->ops->clear_txdone(vp->id); | ||
131 | if (!vp->common->ops->check_txdone(vp->id)) | ||
132 | break; | ||
133 | udelay(1); | ||
134 | } | ||
135 | if (timeout >= VP_TRANXDONE_TIMEOUT) { | ||
136 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded." | ||
137 | "Voltage change aborted", __func__, voltdm->name); | ||
138 | return -ETIMEDOUT; | ||
139 | } | ||
140 | |||
141 | vpconfig = _vp_set_init_voltage(voltdm, target_volt); | ||
142 | |||
143 | /* Force update of voltage */ | ||
144 | voltdm->write(vpconfig | vp->common->vpconfig_forceupdate, | ||
145 | voltdm->vp->vpconfig); | ||
146 | |||
147 | /* | ||
148 | * Wait for TransactionDone. Typical latency is <200us. | ||
149 | * Depends on SMPSWAITTIMEMIN/MAX and voltage change | ||
150 | */ | ||
151 | timeout = 0; | ||
152 | omap_test_timeout(vp->common->ops->check_txdone(vp->id), | ||
153 | VP_TRANXDONE_TIMEOUT, timeout); | ||
154 | if (timeout >= VP_TRANXDONE_TIMEOUT) | ||
155 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded." | ||
156 | "TRANXDONE never got set after the voltage update\n", | ||
157 | __func__, voltdm->name); | ||
158 | |||
159 | omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); | ||
160 | |||
161 | /* | ||
162 | * Disable TransactionDone interrupt , clear all status, clear | ||
163 | * control registers | ||
164 | */ | ||
165 | timeout = 0; | ||
166 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { | ||
167 | vp->common->ops->clear_txdone(vp->id); | ||
168 | if (!vp->common->ops->check_txdone(vp->id)) | ||
169 | break; | ||
170 | udelay(1); | ||
171 | } | ||
172 | |||
173 | if (timeout >= VP_TRANXDONE_TIMEOUT) | ||
174 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded while trying" | ||
175 | "to clear the TRANXDONE status\n", | ||
176 | __func__, voltdm->name); | ||
177 | |||
178 | /* Clear force bit */ | ||
179 | voltdm->write(vpconfig, vp->vpconfig); | ||
180 | |||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | /** | ||
185 | * omap_vp_enable() - API to enable a particular VP | ||
186 | * @voltdm: pointer to the VDD whose VP is to be enabled. | ||
187 | * | ||
188 | * This API enables a particular voltage processor. Needed by the smartreflex | ||
189 | * class drivers. | ||
190 | */ | ||
191 | void omap_vp_enable(struct voltagedomain *voltdm) | ||
192 | { | ||
193 | struct omap_vp_instance *vp; | ||
194 | u32 vpconfig, volt; | ||
195 | |||
196 | if (!voltdm || IS_ERR(voltdm)) { | ||
197 | pr_warning("%s: VDD specified does not exist!\n", __func__); | ||
198 | return; | ||
199 | } | ||
200 | |||
201 | vp = voltdm->vp; | ||
202 | if (!voltdm->read || !voltdm->write) { | ||
203 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
204 | __func__, voltdm->name); | ||
205 | return; | ||
206 | } | ||
207 | |||
208 | /* If VP is already enabled, do nothing. Return */ | ||
209 | if (vp->enabled) | ||
210 | return; | ||
211 | |||
212 | volt = voltdm_get_voltage(voltdm); | ||
213 | if (!volt) { | ||
214 | pr_warning("%s: unable to find current voltage for %s\n", | ||
215 | __func__, voltdm->name); | ||
216 | return; | ||
217 | } | ||
218 | |||
219 | vpconfig = _vp_set_init_voltage(voltdm, volt); | ||
220 | |||
221 | /* Enable VP */ | ||
222 | vpconfig |= vp->common->vpconfig_vpenable; | ||
223 | voltdm->write(vpconfig, vp->vpconfig); | ||
224 | |||
225 | vp->enabled = true; | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * omap_vp_disable() - API to disable a particular VP | ||
230 | * @voltdm: pointer to the VDD whose VP is to be disabled. | ||
231 | * | ||
232 | * This API disables a particular voltage processor. Needed by the smartreflex | ||
233 | * class drivers. | ||
234 | */ | ||
235 | void omap_vp_disable(struct voltagedomain *voltdm) | ||
236 | { | ||
237 | struct omap_vp_instance *vp; | ||
238 | u32 vpconfig; | ||
239 | int timeout; | ||
240 | |||
241 | if (!voltdm || IS_ERR(voltdm)) { | ||
242 | pr_warning("%s: VDD specified does not exist!\n", __func__); | ||
243 | return; | ||
244 | } | ||
245 | |||
246 | vp = voltdm->vp; | ||
247 | if (!voltdm->read || !voltdm->write) { | ||
248 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", | ||
249 | __func__, voltdm->name); | ||
250 | return; | ||
251 | } | ||
252 | |||
253 | /* If VP is already disabled, do nothing. Return */ | ||
254 | if (!vp->enabled) { | ||
255 | pr_warning("%s: Trying to disable VP for vdd_%s when" | ||
256 | "it is already disabled\n", __func__, voltdm->name); | ||
257 | return; | ||
258 | } | ||
259 | |||
260 | /* Disable VP */ | ||
261 | vpconfig = voltdm->read(vp->vpconfig); | ||
262 | vpconfig &= ~vp->common->vpconfig_vpenable; | ||
263 | voltdm->write(vpconfig, vp->vpconfig); | ||
264 | |||
265 | /* | ||
266 | * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us | ||
267 | */ | ||
268 | omap_test_timeout((voltdm->read(vp->vstatus)), | ||
269 | VP_IDLE_TIMEOUT, timeout); | ||
270 | |||
271 | if (timeout >= VP_IDLE_TIMEOUT) | ||
272 | pr_warning("%s: vdd_%s idle timedout\n", | ||
273 | __func__, voltdm->name); | ||
274 | |||
275 | vp->enabled = false; | ||
276 | |||
277 | return; | ||
278 | } | ||
diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h index 7ce134f7de79..7c155d248aa3 100644 --- a/arch/arm/mach-omap2/vp.h +++ b/arch/arm/mach-omap2/vp.h | |||
@@ -19,44 +19,60 @@ | |||
19 | 19 | ||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | 21 | ||
22 | struct voltagedomain; | ||
23 | |||
24 | /* | ||
25 | * Voltage Processor (VP) identifiers | ||
26 | */ | ||
27 | #define OMAP3_VP_VDD_MPU_ID 0 | ||
28 | #define OMAP3_VP_VDD_CORE_ID 1 | ||
29 | #define OMAP4_VP_VDD_CORE_ID 0 | ||
30 | #define OMAP4_VP_VDD_IVA_ID 1 | ||
31 | #define OMAP4_VP_VDD_MPU_ID 2 | ||
32 | |||
22 | /* XXX document */ | 33 | /* XXX document */ |
23 | #define VP_IDLE_TIMEOUT 200 | 34 | #define VP_IDLE_TIMEOUT 200 |
24 | #define VP_TRANXDONE_TIMEOUT 300 | 35 | #define VP_TRANXDONE_TIMEOUT 300 |
25 | 36 | ||
37 | /** | ||
38 | * struct omap_vp_ops - per-VP operations | ||
39 | * @check_txdone: check for VP transaction done | ||
40 | * @clear_txdone: clear VP transaction done status | ||
41 | */ | ||
42 | struct omap_vp_ops { | ||
43 | u32 (*check_txdone)(u8 vp_id); | ||
44 | void (*clear_txdone)(u8 vp_id); | ||
45 | }; | ||
26 | 46 | ||
27 | /** | 47 | /** |
28 | * struct omap_vp_common_data - register data common to all VDDs | 48 | * struct omap_vp_common - register data common to all VDDs |
49 | * @vpconfig_erroroffset_mask: ERROROFFSET bitmask in the PRM_VP*_CONFIG reg | ||
29 | * @vpconfig_errorgain_mask: ERRORGAIN bitmask in the PRM_VP*_CONFIG reg | 50 | * @vpconfig_errorgain_mask: ERRORGAIN bitmask in the PRM_VP*_CONFIG reg |
30 | * @vpconfig_initvoltage_mask: INITVOLTAGE bitmask in the PRM_VP*_CONFIG reg | 51 | * @vpconfig_initvoltage_mask: INITVOLTAGE bitmask in the PRM_VP*_CONFIG reg |
31 | * @vpconfig_timeouten_mask: TIMEOUT bitmask in the PRM_VP*_CONFIG reg | 52 | * @vpconfig_timeouten: TIMEOUT bitmask in the PRM_VP*_CONFIG reg |
32 | * @vpconfig_initvdd: INITVDD bitmask in the PRM_VP*_CONFIG reg | 53 | * @vpconfig_initvdd: INITVDD bitmask in the PRM_VP*_CONFIG reg |
33 | * @vpconfig_forceupdate: FORCEUPDATE bitmask in the PRM_VP*_CONFIG reg | 54 | * @vpconfig_forceupdate: FORCEUPDATE bitmask in the PRM_VP*_CONFIG reg |
34 | * @vpconfig_vpenable: VPENABLE bitmask in the PRM_VP*_CONFIG reg | 55 | * @vpconfig_vpenable: VPENABLE bitmask in the PRM_VP*_CONFIG reg |
35 | * @vpconfig_erroroffset_shift: ERROROFFSET field shift in PRM_VP*_CONFIG reg | 56 | * @vpconfig_erroroffset_shift: ERROROFFSET field shift in PRM_VP*_CONFIG reg |
36 | * @vpconfig_errorgain_shift: ERRORGAIN field shift in PRM_VP*_CONFIG reg | 57 | * @vpconfig_errorgain_shift: ERRORGAIN field shift in PRM_VP*_CONFIG reg |
37 | * @vpconfig_initvoltage_shift: INITVOLTAGE field shift in PRM_VP*_CONFIG reg | 58 | * @vpconfig_initvoltage_shift: INITVOLTAGE field shift in PRM_VP*_CONFIG reg |
38 | * @vpconfig_stepmin_shift: VSTEPMIN field shift in the PRM_VP*_VSTEPMIN reg | 59 | * @vstepmin_stepmin_shift: VSTEPMIN field shift in the PRM_VP*_VSTEPMIN reg |
39 | * @vpconfig_smpswaittimemin_shift: SMPSWAITTIMEMIN field shift in PRM_VP*_VSTEPMIN reg | 60 | * @vstepmin_smpswaittimemin_shift: SMPSWAITTIMEMIN field shift in PRM_VP*_VSTEPMIN reg |
40 | * @vpconfig_stepmax_shift: VSTEPMAX field shift in the PRM_VP*_VSTEPMAX reg | 61 | * @vstepmax_stepmax_shift: VSTEPMAX field shift in the PRM_VP*_VSTEPMAX reg |
41 | * @vpconfig_smpswaittimemax_shift: SMPSWAITTIMEMAX field shift in PRM_VP*_VSTEPMAX reg | 62 | * @vstepmax_smpswaittimemax_shift: SMPSWAITTIMEMAX field shift in PRM_VP*_VSTEPMAX reg |
42 | * @vpconfig_vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg | 63 | * @vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg |
43 | * @vpconfig_vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg | 64 | * @vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg |
44 | * @vpconfig_vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg | 65 | * @vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg |
45 | * | 66 | * @vpvoltage_mask: VPVOLTAGE field mask in PRM_VP*_VOLTAGE reg |
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 | */ | 67 | */ |
50 | struct omap_vp_common_data { | 68 | struct omap_vp_common { |
69 | u32 vpconfig_erroroffset_mask; | ||
51 | u32 vpconfig_errorgain_mask; | 70 | u32 vpconfig_errorgain_mask; |
52 | u32 vpconfig_initvoltage_mask; | 71 | u32 vpconfig_initvoltage_mask; |
53 | u32 vpconfig_timeouten; | 72 | u8 vpconfig_timeouten; |
54 | u32 vpconfig_initvdd; | 73 | u8 vpconfig_initvdd; |
55 | u32 vpconfig_forceupdate; | 74 | u8 vpconfig_forceupdate; |
56 | u32 vpconfig_vpenable; | 75 | u8 vpconfig_vpenable; |
57 | u8 vpconfig_erroroffset_shift; | ||
58 | u8 vpconfig_errorgain_shift; | ||
59 | u8 vpconfig_initvoltage_shift; | ||
60 | u8 vstepmin_stepmin_shift; | 76 | u8 vstepmin_stepmin_shift; |
61 | u8 vstepmin_smpswaittimemin_shift; | 77 | u8 vstepmin_smpswaittimemin_shift; |
62 | u8 vstepmax_stepmax_shift; | 78 | u8 vstepmax_stepmax_shift; |
@@ -64,80 +80,49 @@ struct omap_vp_common_data { | |||
64 | u8 vlimitto_vddmin_shift; | 80 | u8 vlimitto_vddmin_shift; |
65 | u8 vlimitto_vddmax_shift; | 81 | u8 vlimitto_vddmax_shift; |
66 | u8 vlimitto_timeout_shift; | 82 | u8 vlimitto_timeout_shift; |
67 | }; | 83 | u8 vpvoltage_mask; |
68 | 84 | ||
69 | /** | 85 | const struct omap_vp_ops *ops; |
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 | }; | 86 | }; |
83 | 87 | ||
84 | /** | 88 | /** |
85 | * struct omap_vp_instance_data - VP register offsets (per-VDD) | 89 | * struct omap_vp_instance - VP register offsets (per-VDD) |
86 | * @vp_common: pointer to struct omap_vp_common_data * for this SoC | 90 | * @common: pointer to struct omap_vp_common * 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 | 91 | * @vpconfig: PRM_VP*_CONFIG reg offset from PRM start |
89 | * @vstepmin: PRM_VP*_VSTEPMIN reg offset from PRM start | 92 | * @vstepmin: PRM_VP*_VSTEPMIN reg offset from PRM start |
90 | * @vlimitto: PRM_VP*_VLIMITTO reg offset from PRM start | 93 | * @vlimitto: PRM_VP*_VLIMITTO reg offset from PRM start |
91 | * @vstatus: PRM_VP*_VSTATUS reg offset from PRM start | 94 | * @vstatus: PRM_VP*_VSTATUS reg offset from PRM start |
92 | * @voltage: PRM_VP*_VOLTAGE reg offset from PRM start | 95 | * @voltage: PRM_VP*_VOLTAGE reg offset from PRM start |
96 | * @id: Unique identifier for VP instance. | ||
97 | * @enabled: flag to keep track of whether vp is enabled or not | ||
93 | * | 98 | * |
94 | * XXX vp_common is probably not needed since it is per-SoC | 99 | * XXX vp_common is probably not needed since it is per-SoC |
95 | */ | 100 | */ |
96 | struct omap_vp_instance_data { | 101 | struct omap_vp_instance { |
97 | const struct omap_vp_common_data *vp_common; | 102 | const struct omap_vp_common *common; |
98 | const struct omap_vp_prm_irqst_data *prm_irqst_data; | ||
99 | u8 vpconfig; | 103 | u8 vpconfig; |
100 | u8 vstepmin; | 104 | u8 vstepmin; |
101 | u8 vstepmax; | 105 | u8 vstepmax; |
102 | u8 vlimitto; | 106 | u8 vlimitto; |
103 | u8 vstatus; | 107 | u8 vstatus; |
104 | u8 voltage; | 108 | u8 voltage; |
109 | u8 id; | ||
110 | bool enabled; | ||
105 | }; | 111 | }; |
106 | 112 | ||
107 | /** | 113 | extern struct omap_vp_instance omap3_vp_mpu; |
108 | * struct omap_vp_runtime_data - VP data populated at runtime by code | 114 | extern struct omap_vp_instance omap3_vp_core; |
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 | 115 | ||
136 | extern struct omap_vp_instance_data omap3_vp1_data; | 116 | extern struct omap_vp_instance omap4_vp_mpu; |
137 | extern struct omap_vp_instance_data omap3_vp2_data; | 117 | extern struct omap_vp_instance omap4_vp_iva; |
118 | extern struct omap_vp_instance omap4_vp_core; | ||
138 | 119 | ||
139 | extern struct omap_vp_instance_data omap4_vp_mpu_data; | 120 | void omap_vp_init(struct voltagedomain *voltdm); |
140 | extern struct omap_vp_instance_data omap4_vp_iva_data; | 121 | void omap_vp_enable(struct voltagedomain *voltdm); |
141 | extern struct omap_vp_instance_data omap4_vp_core_data; | 122 | void omap_vp_disable(struct voltagedomain *voltdm); |
123 | int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, | ||
124 | unsigned long target_volt); | ||
125 | int omap_vp_update_errorgain(struct voltagedomain *voltdm, | ||
126 | unsigned long target_volt); | ||
142 | 127 | ||
143 | #endif | 128 | #endif |
diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c index 645217094e51..260c554b1547 100644 --- a/arch/arm/mach-omap2/vp3xxx_data.c +++ b/arch/arm/mach-omap2/vp3xxx_data.c | |||
@@ -25,16 +25,20 @@ | |||
25 | #include "voltage.h" | 25 | #include "voltage.h" |
26 | 26 | ||
27 | #include "vp.h" | 27 | #include "vp.h" |
28 | #include "prm2xxx_3xxx.h" | ||
29 | |||
30 | static const struct omap_vp_ops omap3_vp_ops = { | ||
31 | .check_txdone = omap3_prm_vp_check_txdone, | ||
32 | .clear_txdone = omap3_prm_vp_clear_txdone, | ||
33 | }; | ||
28 | 34 | ||
29 | /* | 35 | /* |
30 | * VP data common to 34xx/36xx chips | 36 | * VP data common to 34xx/36xx chips |
31 | * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file. | 37 | * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file. |
32 | */ | 38 | */ |
33 | static const struct omap_vp_common_data omap3_vp_common = { | 39 | static const struct omap_vp_common omap3_vp_common = { |
34 | .vpconfig_erroroffset_shift = OMAP3430_ERROROFFSET_SHIFT, | 40 | .vpconfig_erroroffset_mask = OMAP3430_ERROROFFSET_MASK, |
35 | .vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK, | 41 | .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, | 42 | .vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK, |
39 | .vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK, | 43 | .vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK, |
40 | .vpconfig_initvdd = OMAP3430_INITVDD_MASK, | 44 | .vpconfig_initvdd = OMAP3430_INITVDD_MASK, |
@@ -47,36 +51,29 @@ static const struct omap_vp_common_data omap3_vp_common = { | |||
47 | .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, | 51 | .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, |
48 | .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, | 52 | .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, |
49 | .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, | 53 | .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, |
50 | }; | 54 | .vpvoltage_mask = OMAP3430_VPVOLTAGE_MASK, |
51 | 55 | ||
52 | static const struct omap_vp_prm_irqst_data omap3_vp1_prm_irqst_data = { | 56 | .ops = &omap3_vp_ops, |
53 | .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET, | ||
54 | .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, | ||
55 | }; | 57 | }; |
56 | 58 | ||
57 | struct omap_vp_instance_data omap3_vp1_data = { | 59 | struct omap_vp_instance omap3_vp_mpu = { |
58 | .vp_common = &omap3_vp_common, | 60 | .id = OMAP3_VP_VDD_MPU_ID, |
61 | .common = &omap3_vp_common, | ||
59 | .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET, | 62 | .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET, |
60 | .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET, | 63 | .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET, |
61 | .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET, | 64 | .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET, |
62 | .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET, | 65 | .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET, |
63 | .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET, | 66 | .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET, |
64 | .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET, | 67 | .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 | }; | 68 | }; |
72 | 69 | ||
73 | struct omap_vp_instance_data omap3_vp2_data = { | 70 | struct omap_vp_instance omap3_vp_core = { |
74 | .vp_common = &omap3_vp_common, | 71 | .id = OMAP3_VP_VDD_CORE_ID, |
72 | .common = &omap3_vp_common, | ||
75 | .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET, | 73 | .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET, |
76 | .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET, | 74 | .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET, |
77 | .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET, | 75 | .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET, |
78 | .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET, | 76 | .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET, |
79 | .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET, | 77 | .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET, |
80 | .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET, | 78 | .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET, |
81 | .prm_irqst_data = &omap3_vp2_prm_irqst_data, | ||
82 | }; | 79 | }; |
diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c index 65d1ad63800a..b4e77044891e 100644 --- a/arch/arm/mach-omap2/vp44xx_data.c +++ b/arch/arm/mach-omap2/vp44xx_data.c | |||
@@ -27,15 +27,18 @@ | |||
27 | 27 | ||
28 | #include "vp.h" | 28 | #include "vp.h" |
29 | 29 | ||
30 | static const struct omap_vp_ops omap4_vp_ops = { | ||
31 | .check_txdone = omap4_prm_vp_check_txdone, | ||
32 | .clear_txdone = omap4_prm_vp_clear_txdone, | ||
33 | }; | ||
34 | |||
30 | /* | 35 | /* |
31 | * VP data common to 44xx chips | 36 | * VP data common to 44xx chips |
32 | * XXX This stuff presumably belongs in the vp44xx.c or vp.c file. | 37 | * XXX This stuff presumably belongs in the vp44xx.c or vp.c file. |
33 | */ | 38 | */ |
34 | static const struct omap_vp_common_data omap4_vp_common = { | 39 | static const struct omap_vp_common omap4_vp_common = { |
35 | .vpconfig_erroroffset_shift = OMAP4430_ERROROFFSET_SHIFT, | 40 | .vpconfig_erroroffset_mask = OMAP4430_ERROROFFSET_MASK, |
36 | .vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK, | 41 | .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, | 42 | .vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK, |
40 | .vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK, | 43 | .vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK, |
41 | .vpconfig_initvdd = OMAP4430_INITVDD_MASK, | 44 | .vpconfig_initvdd = OMAP4430_INITVDD_MASK, |
@@ -48,53 +51,39 @@ static const struct omap_vp_common_data omap4_vp_common = { | |||
48 | .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT, | 51 | .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT, |
49 | .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT, | 52 | .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT, |
50 | .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT, | 53 | .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT, |
54 | .vpvoltage_mask = OMAP4430_VPVOLTAGE_MASK, | ||
55 | .ops = &omap4_vp_ops, | ||
51 | }; | 56 | }; |
52 | 57 | ||
53 | static const struct omap_vp_prm_irqst_data omap4_vp_mpu_prm_irqst_data = { | 58 | struct omap_vp_instance omap4_vp_mpu = { |
54 | .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET, | 59 | .id = OMAP4_VP_VDD_MPU_ID, |
55 | .tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK, | 60 | .common = &omap4_vp_common, |
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 | .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET, |
61 | .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET, | 62 | .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET, |
62 | .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET, | 63 | .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET, |
63 | .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET, | 64 | .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET, |
64 | .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET, | 65 | .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET, |
65 | .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET, | 66 | .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET, |
66 | .prm_irqst_data = &omap4_vp_mpu_prm_irqst_data, | ||
67 | }; | 67 | }; |
68 | 68 | ||
69 | static const struct omap_vp_prm_irqst_data omap4_vp_iva_prm_irqst_data = { | 69 | struct omap_vp_instance omap4_vp_iva = { |
70 | .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, | 70 | .id = OMAP4_VP_VDD_IVA_ID, |
71 | .tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK, | 71 | .common = &omap4_vp_common, |
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, | 72 | .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET, |
77 | .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET, | 73 | .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET, |
78 | .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET, | 74 | .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET, |
79 | .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET, | 75 | .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET, |
80 | .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET, | 76 | .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET, |
81 | .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET, | 77 | .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 | }; | 78 | }; |
89 | 79 | ||
90 | struct omap_vp_instance_data omap4_vp_core_data = { | 80 | struct omap_vp_instance omap4_vp_core = { |
91 | .vp_common = &omap4_vp_common, | 81 | .id = OMAP4_VP_VDD_CORE_ID, |
82 | .common = &omap4_vp_common, | ||
92 | .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET, | 83 | .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET, |
93 | .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET, | 84 | .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET, |
94 | .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET, | 85 | .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET, |
95 | .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET, | 86 | .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET, |
96 | .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET, | 87 | .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET, |
97 | .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET, | 88 | .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET, |
98 | .prm_irqst_data = &omap4_vp_core_prm_irqst_data, | ||
99 | }; | 89 | }; |
100 | |||
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h index df4b9683f17f..197ca03c3f7d 100644 --- a/arch/arm/plat-omap/include/plat/clock.h +++ b/arch/arm/plat-omap/include/plat/clock.h | |||
@@ -80,8 +80,6 @@ struct clkops { | |||
80 | * | 80 | * |
81 | * @div is the divisor that should be applied to the parent clock's rate | 81 | * @div is the divisor that should be applied to the parent clock's rate |
82 | * to produce the current clock's rate. | 82 | * to produce the current clock's rate. |
83 | * | ||
84 | * XXX @flags probably should be replaced with an struct omap_chip. | ||
85 | */ | 83 | */ |
86 | struct clksel_rate { | 84 | struct clksel_rate { |
87 | u32 val; | 85 | u32 val; |
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index 4564cc697d7f..5cac97e36079 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h | |||
@@ -45,6 +45,15 @@ extern unsigned long long notrace omap_32k_sched_clock(void); | |||
45 | 45 | ||
46 | extern void omap_reserve(void); | 46 | extern void omap_reserve(void); |
47 | 47 | ||
48 | void omap2420_init_early(void); | ||
49 | void omap2430_init_early(void); | ||
50 | void omap3430_init_early(void); | ||
51 | void omap35xx_init_early(void); | ||
52 | void omap3630_init_early(void); | ||
53 | void am35xx_init_early(void); | ||
54 | void ti816x_init_early(void); | ||
55 | void omap4430_init_early(void); | ||
56 | |||
48 | /* | 57 | /* |
49 | * IO bases for various OMAP processors | 58 | * IO bases for various OMAP processors |
50 | * Except the tap base, rest all the io bases | 59 | * Except the tap base, rest all the io bases |
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 67b3d75884cd..2f9026942229 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -44,13 +44,6 @@ | |||
44 | 44 | ||
45 | int omap_type(void); | 45 | int omap_type(void); |
46 | 46 | ||
47 | struct omap_chip_id { | ||
48 | u16 oc; | ||
49 | u8 type; | ||
50 | }; | ||
51 | |||
52 | #define OMAP_CHIP_INIT(x) { .oc = x } | ||
53 | |||
54 | /* | 47 | /* |
55 | * omap_rev bits: | 48 | * omap_rev bits: |
56 | * CPU id bits (0730, 1510, 1710, 2422...) [31:16] | 49 | * CPU id bits (0730, 1510, 1710, 2422...) [31:16] |
@@ -60,19 +53,6 @@ struct omap_chip_id { | |||
60 | unsigned int omap_rev(void); | 53 | unsigned int omap_rev(void); |
61 | 54 | ||
62 | /* | 55 | /* |
63 | * Define CPU revision bits | ||
64 | * | ||
65 | * Verbose meaning of the revision bits may be different for a silicon | ||
66 | * family. This difference can be handled separately. | ||
67 | */ | ||
68 | #define OMAP_REVBITS_00 0x00 | ||
69 | #define OMAP_REVBITS_01 0x01 | ||
70 | #define OMAP_REVBITS_02 0x02 | ||
71 | #define OMAP_REVBITS_03 0x03 | ||
72 | #define OMAP_REVBITS_04 0x04 | ||
73 | #define OMAP_REVBITS_05 0x05 | ||
74 | |||
75 | /* | ||
76 | * Get the CPU revision for OMAP devices | 56 | * Get the CPU revision for OMAP devices |
77 | */ | 57 | */ |
78 | #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) | 58 | #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) |
@@ -262,7 +242,7 @@ IS_OMAP_TYPE(2422, 0x2422) | |||
262 | IS_OMAP_TYPE(2423, 0x2423) | 242 | IS_OMAP_TYPE(2423, 0x2423) |
263 | IS_OMAP_TYPE(2430, 0x2430) | 243 | IS_OMAP_TYPE(2430, 0x2430) |
264 | IS_OMAP_TYPE(3430, 0x3430) | 244 | IS_OMAP_TYPE(3430, 0x3430) |
265 | IS_OMAP_TYPE(3505, 0x3505) | 245 | IS_OMAP_TYPE(3505, 0x3517) |
266 | IS_OMAP_TYPE(3517, 0x3517) | 246 | IS_OMAP_TYPE(3517, 0x3517) |
267 | 247 | ||
268 | #define cpu_is_omap310() 0 | 248 | #define cpu_is_omap310() 0 |
@@ -354,8 +334,9 @@ IS_OMAP_TYPE(3517, 0x3517) | |||
354 | (!omap3_has_sgx()) && \ | 334 | (!omap3_has_sgx()) && \ |
355 | (omap3_has_iva())) | 335 | (omap3_has_iva())) |
356 | # define cpu_is_omap3530() (cpu_is_omap3430()) | 336 | # define cpu_is_omap3530() (cpu_is_omap3430()) |
357 | # define cpu_is_omap3505() is_omap3505() | ||
358 | # define cpu_is_omap3517() is_omap3517() | 337 | # define cpu_is_omap3517() is_omap3517() |
338 | # define cpu_is_omap3505() (cpu_is_omap3517() && \ | ||
339 | !omap3_has_sgx()) | ||
359 | # undef cpu_is_omap3630 | 340 | # undef cpu_is_omap3630 |
360 | # define cpu_is_omap3630() is_omap363x() | 341 | # define cpu_is_omap3630() is_omap363x() |
361 | # define cpu_is_ti816x() is_ti816x() | 342 | # define cpu_is_ti816x() is_ti816x() |
@@ -379,35 +360,31 @@ IS_OMAP_TYPE(3517, 0x3517) | |||
379 | /* Various silicon revisions for omap2 */ | 360 | /* Various silicon revisions for omap2 */ |
380 | #define OMAP242X_CLASS 0x24200024 | 361 | #define OMAP242X_CLASS 0x24200024 |
381 | #define OMAP2420_REV_ES1_0 OMAP242X_CLASS | 362 | #define OMAP2420_REV_ES1_0 OMAP242X_CLASS |
382 | #define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (OMAP_REVBITS_01 << 8)) | 363 | #define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8)) |
383 | 364 | ||
384 | #define OMAP243X_CLASS 0x24300024 | 365 | #define OMAP243X_CLASS 0x24300024 |
385 | #define OMAP2430_REV_ES1_0 OMAP243X_CLASS | 366 | #define OMAP2430_REV_ES1_0 OMAP243X_CLASS |
386 | 367 | ||
387 | #define OMAP343X_CLASS 0x34300034 | 368 | #define OMAP343X_CLASS 0x34300034 |
388 | #define OMAP3430_REV_ES1_0 OMAP343X_CLASS | 369 | #define OMAP3430_REV_ES1_0 OMAP343X_CLASS |
389 | #define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (OMAP_REVBITS_01 << 8)) | 370 | #define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8)) |
390 | #define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (OMAP_REVBITS_02 << 8)) | 371 | #define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8)) |
391 | #define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (OMAP_REVBITS_03 << 8)) | 372 | #define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8)) |
392 | #define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (OMAP_REVBITS_04 << 8)) | 373 | #define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8)) |
393 | #define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (OMAP_REVBITS_05 << 8)) | 374 | #define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8)) |
394 | 375 | ||
395 | #define OMAP363X_CLASS 0x36300034 | 376 | #define OMAP363X_CLASS 0x36300034 |
396 | #define OMAP3630_REV_ES1_0 OMAP363X_CLASS | 377 | #define OMAP3630_REV_ES1_0 OMAP363X_CLASS |
397 | #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (OMAP_REVBITS_01 << 8)) | 378 | #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8)) |
398 | #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (OMAP_REVBITS_02 << 8)) | 379 | #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8)) |
399 | 380 | ||
400 | #define OMAP35XX_CLASS 0x35000034 | 381 | #define OMAP3517_CLASS 0x35170034 |
401 | #define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8)) | 382 | #define OMAP3517_REV_ES1_0 OMAP3517_CLASS |
402 | #define OMAP3515_REV(v) (OMAP35XX_CLASS | (0x3515 << 16) | (v << 8)) | 383 | #define OMAP3517_REV_ES1_1 (OMAP3517_CLASS | (0x1 << 8)) |
403 | #define OMAP3525_REV(v) (OMAP35XX_CLASS | (0x3525 << 16) | (v << 8)) | ||
404 | #define OMAP3530_REV(v) (OMAP35XX_CLASS | (0x3530 << 16) | (v << 8)) | ||
405 | #define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8)) | ||
406 | #define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8)) | ||
407 | 384 | ||
408 | #define TI816X_CLASS 0x81600034 | 385 | #define TI816X_CLASS 0x81600034 |
409 | #define TI8168_REV_ES1_0 TI816X_CLASS | 386 | #define TI8168_REV_ES1_0 TI816X_CLASS |
410 | #define TI8168_REV_ES1_1 (TI816X_CLASS | (OMAP_REVBITS_01 << 8)) | 387 | #define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8)) |
411 | 388 | ||
412 | #define OMAP443X_CLASS 0x44300044 | 389 | #define OMAP443X_CLASS 0x44300044 |
413 | #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) | 390 | #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) |
@@ -418,61 +395,6 @@ IS_OMAP_TYPE(3517, 0x3517) | |||
418 | #define OMAP446X_CLASS 0x44600044 | 395 | #define OMAP446X_CLASS 0x44600044 |
419 | #define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8)) | 396 | #define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8)) |
420 | 397 | ||
421 | /* | ||
422 | * omap_chip bits | ||
423 | * | ||
424 | * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is | ||
425 | * valid on all chips of that type. CHIP_IS_OMAP3430ES{1,2} indicates | ||
426 | * something that is only valid on that particular ES revision. | ||
427 | * | ||
428 | * These bits may be ORed together to indicate structures that are | ||
429 | * available on multiple chip types. | ||
430 | * | ||
431 | * To test whether a particular structure matches the current OMAP chip type, | ||
432 | * use omap_chip_is(). | ||
433 | * | ||
434 | */ | ||
435 | #define CHIP_IS_OMAP2420 (1 << 0) | ||
436 | #define CHIP_IS_OMAP2430 (1 << 1) | ||
437 | #define CHIP_IS_OMAP3430 (1 << 2) | ||
438 | #define CHIP_IS_OMAP3430ES1 (1 << 3) | ||
439 | #define CHIP_IS_OMAP3430ES2 (1 << 4) | ||
440 | #define CHIP_IS_OMAP3430ES3_0 (1 << 5) | ||
441 | #define CHIP_IS_OMAP3430ES3_1 (1 << 6) | ||
442 | #define CHIP_IS_OMAP3630ES1 (1 << 7) | ||
443 | #define CHIP_IS_OMAP4430ES1 (1 << 8) | ||
444 | #define CHIP_IS_OMAP3630ES1_1 (1 << 9) | ||
445 | #define CHIP_IS_OMAP3630ES1_2 (1 << 10) | ||
446 | #define CHIP_IS_OMAP4430ES2 (1 << 11) | ||
447 | #define CHIP_IS_OMAP4430ES2_1 (1 << 12) | ||
448 | #define CHIP_IS_OMAP4430ES2_2 (1 << 13) | ||
449 | #define CHIP_IS_TI816X (1 << 14) | ||
450 | #define CHIP_IS_OMAP4460ES1_0 (1 << 15) | ||
451 | |||
452 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) | ||
453 | |||
454 | #define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \ | ||
455 | CHIP_IS_OMAP4430ES2 | \ | ||
456 | CHIP_IS_OMAP4430ES2_1 | \ | ||
457 | CHIP_IS_OMAP4430ES2_2 | \ | ||
458 | CHIP_IS_OMAP4460ES1_0) | ||
459 | |||
460 | /* | ||
461 | * "GE" here represents "greater than or equal to" in terms of ES | ||
462 | * levels. So CHIP_GE_OMAP3430ES2 is intended to match all OMAP3430 | ||
463 | * chips at ES2 and beyond, but not, for example, any OMAP lines after | ||
464 | * OMAP3. | ||
465 | */ | ||
466 | #define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ | ||
467 | CHIP_IS_OMAP3430ES3_0 | \ | ||
468 | CHIP_GE_OMAP3430ES3_1) | ||
469 | #define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \ | ||
470 | CHIP_IS_OMAP3630ES1 | \ | ||
471 | CHIP_GE_OMAP3630ES1_1) | ||
472 | #define CHIP_GE_OMAP3630ES1_1 (CHIP_IS_OMAP3630ES1_1 | \ | ||
473 | CHIP_IS_OMAP3630ES1_2) | ||
474 | |||
475 | int omap_chip_is(struct omap_chip_id oci); | ||
476 | void omap2_check_revision(void); | 398 | void omap2_check_revision(void); |
477 | 399 | ||
478 | /* | 400 | /* |
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index d72ec85c97e6..75311fc9c018 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h | |||
@@ -300,7 +300,7 @@ static inline void omap44xx_map_common_io(void) | |||
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | extern void omap2_init_common_infrastructure(void); | 302 | extern void omap2_init_common_infrastructure(void); |
303 | extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, | 303 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, |
304 | struct omap_sdrc_params *sdrc_cs1); | 304 | struct omap_sdrc_params *sdrc_cs1); |
305 | 305 | ||
306 | #define __arch_ioremap omap_ioremap | 306 | #define __arch_ioremap omap_ioremap |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 0e329ca88a70..5419f1a2aaa4 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -496,7 +496,6 @@ struct omap_hwmod_class { | |||
496 | * @_state: internal-use hwmod state | 496 | * @_state: internal-use hwmod state |
497 | * @_postsetup_state: internal-use state to leave the hwmod in after _setup() | 497 | * @_postsetup_state: internal-use state to leave the hwmod in after _setup() |
498 | * @flags: hwmod flags (documented below) | 498 | * @flags: hwmod flags (documented below) |
499 | * @omap_chip: OMAP chips this hwmod is present on | ||
500 | * @_lock: spinlock serializing operations on this hwmod | 499 | * @_lock: spinlock serializing operations on this hwmod |
501 | * @node: list node for hwmod list (internal use) | 500 | * @node: list node for hwmod list (internal use) |
502 | * | 501 | * |
@@ -526,7 +525,6 @@ struct omap_hwmod { | |||
526 | char *clkdm_name; | 525 | char *clkdm_name; |
527 | struct clockdomain *clkdm; | 526 | struct clockdomain *clkdm; |
528 | char *vdd_name; | 527 | char *vdd_name; |
529 | struct voltagedomain *voltdm; | ||
530 | struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ | 528 | struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ |
531 | struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ | 529 | struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ |
532 | void *dev_attr; | 530 | void *dev_attr; |
@@ -545,7 +543,6 @@ struct omap_hwmod { | |||
545 | u8 _int_flags; | 543 | u8 _int_flags; |
546 | u8 _state; | 544 | u8 _state; |
547 | u8 _postsetup_state; | 545 | u8 _postsetup_state; |
548 | const struct omap_chip_id omap_chip; | ||
549 | }; | 546 | }; |
550 | 547 | ||
551 | int omap_hwmod_register(struct omap_hwmod **ohs); | 548 | int omap_hwmod_register(struct omap_hwmod **ohs); |
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/plat-omap/include/plat/voltage.h new file mode 100644 index 000000000000..0a6a482ec014 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/voltage.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * OMAP Voltage Management Routines | ||
3 | * | ||
4 | * Copyright (C) 2011, Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ARCH_ARM_OMAP_VOLTAGE_H | ||
12 | #define __ARCH_ARM_OMAP_VOLTAGE_H | ||
13 | |||
14 | struct voltagedomain; | ||
15 | |||
16 | struct voltagedomain *voltdm_lookup(const char *name); | ||
17 | int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); | ||
18 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); | ||
19 | |||
20 | #endif | ||