diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod_3xxx_data.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 188 |
1 files changed, 162 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index b26d3c9bca16..c9e38200216b 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * | 14 | * |
15 | * XXX these should be marked initdata for multi-OMAP kernels | 15 | * XXX these should be marked initdata for multi-OMAP kernels |
16 | */ | 16 | */ |
17 | #include <linux/power/smartreflex.h> | ||
18 | |||
17 | #include <plat/omap_hwmod.h> | 19 | #include <plat/omap_hwmod.h> |
18 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
19 | #include <plat/cpu.h> | 21 | #include <plat/cpu.h> |
@@ -29,8 +31,6 @@ | |||
29 | #include <plat/dmtimer.h> | 31 | #include <plat/dmtimer.h> |
30 | 32 | ||
31 | #include "omap_hwmod_common_data.h" | 33 | #include "omap_hwmod_common_data.h" |
32 | |||
33 | #include "smartreflex.h" | ||
34 | #include "prm-regbits-34xx.h" | 34 | #include "prm-regbits-34xx.h" |
35 | #include "cm-regbits-34xx.h" | 35 | #include "cm-regbits-34xx.h" |
36 | #include "wd_timer.h" | 36 | #include "wd_timer.h" |
@@ -129,7 +129,6 @@ static struct omap_hwmod_class_sysconfig omap3xxx_timer_1ms_sysc = { | |||
129 | static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = { | 129 | static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = { |
130 | .name = "timer", | 130 | .name = "timer", |
131 | .sysc = &omap3xxx_timer_1ms_sysc, | 131 | .sysc = &omap3xxx_timer_1ms_sysc, |
132 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
133 | }; | 132 | }; |
134 | 133 | ||
135 | static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = { | 134 | static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = { |
@@ -145,12 +144,11 @@ static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = { | |||
145 | static struct omap_hwmod_class omap3xxx_timer_hwmod_class = { | 144 | static struct omap_hwmod_class omap3xxx_timer_hwmod_class = { |
146 | .name = "timer", | 145 | .name = "timer", |
147 | .sysc = &omap3xxx_timer_sysc, | 146 | .sysc = &omap3xxx_timer_sysc, |
148 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
149 | }; | 147 | }; |
150 | 148 | ||
151 | /* secure timers dev attribute */ | 149 | /* secure timers dev attribute */ |
152 | static struct omap_timer_capability_dev_attr capability_secure_dev_attr = { | 150 | static struct omap_timer_capability_dev_attr capability_secure_dev_attr = { |
153 | .timer_capability = OMAP_TIMER_SECURE, | 151 | .timer_capability = OMAP_TIMER_ALWON | OMAP_TIMER_SECURE, |
154 | }; | 152 | }; |
155 | 153 | ||
156 | /* always-on timers dev attribute */ | 154 | /* always-on timers dev attribute */ |
@@ -195,7 +193,6 @@ static struct omap_hwmod omap3xxx_timer2_hwmod = { | |||
195 | .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT, | 193 | .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT, |
196 | }, | 194 | }, |
197 | }, | 195 | }, |
198 | .dev_attr = &capability_alwon_dev_attr, | ||
199 | .class = &omap3xxx_timer_1ms_hwmod_class, | 196 | .class = &omap3xxx_timer_1ms_hwmod_class, |
200 | }; | 197 | }; |
201 | 198 | ||
@@ -213,7 +210,6 @@ static struct omap_hwmod omap3xxx_timer3_hwmod = { | |||
213 | .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT, | 210 | .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT, |
214 | }, | 211 | }, |
215 | }, | 212 | }, |
216 | .dev_attr = &capability_alwon_dev_attr, | ||
217 | .class = &omap3xxx_timer_hwmod_class, | 213 | .class = &omap3xxx_timer_hwmod_class, |
218 | }; | 214 | }; |
219 | 215 | ||
@@ -231,7 +227,6 @@ static struct omap_hwmod omap3xxx_timer4_hwmod = { | |||
231 | .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT, | 227 | .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT, |
232 | }, | 228 | }, |
233 | }, | 229 | }, |
234 | .dev_attr = &capability_alwon_dev_attr, | ||
235 | .class = &omap3xxx_timer_hwmod_class, | 230 | .class = &omap3xxx_timer_hwmod_class, |
236 | }; | 231 | }; |
237 | 232 | ||
@@ -249,7 +244,6 @@ static struct omap_hwmod omap3xxx_timer5_hwmod = { | |||
249 | .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, | 244 | .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, |
250 | }, | 245 | }, |
251 | }, | 246 | }, |
252 | .dev_attr = &capability_alwon_dev_attr, | ||
253 | .class = &omap3xxx_timer_hwmod_class, | 247 | .class = &omap3xxx_timer_hwmod_class, |
254 | }; | 248 | }; |
255 | 249 | ||
@@ -267,7 +261,6 @@ static struct omap_hwmod omap3xxx_timer6_hwmod = { | |||
267 | .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, | 261 | .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, |
268 | }, | 262 | }, |
269 | }, | 263 | }, |
270 | .dev_attr = &capability_alwon_dev_attr, | ||
271 | .class = &omap3xxx_timer_hwmod_class, | 264 | .class = &omap3xxx_timer_hwmod_class, |
272 | }; | 265 | }; |
273 | 266 | ||
@@ -285,7 +278,6 @@ static struct omap_hwmod omap3xxx_timer7_hwmod = { | |||
285 | .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, | 278 | .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, |
286 | }, | 279 | }, |
287 | }, | 280 | }, |
288 | .dev_attr = &capability_alwon_dev_attr, | ||
289 | .class = &omap3xxx_timer_hwmod_class, | 281 | .class = &omap3xxx_timer_hwmod_class, |
290 | }; | 282 | }; |
291 | 283 | ||
@@ -527,11 +519,27 @@ static struct omap_hwmod omap36xx_uart4_hwmod = { | |||
527 | 519 | ||
528 | static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = { | 520 | static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = { |
529 | { .irq = INT_35XX_UART4_IRQ, }, | 521 | { .irq = INT_35XX_UART4_IRQ, }, |
522 | { .irq = -1 } | ||
530 | }; | 523 | }; |
531 | 524 | ||
532 | static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = { | 525 | static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = { |
533 | { .name = "rx", .dma_req = AM35XX_DMA_UART4_RX, }, | 526 | { .name = "rx", .dma_req = AM35XX_DMA_UART4_RX, }, |
534 | { .name = "tx", .dma_req = AM35XX_DMA_UART4_TX, }, | 527 | { .name = "tx", .dma_req = AM35XX_DMA_UART4_TX, }, |
528 | { .dma_req = -1 } | ||
529 | }; | ||
530 | |||
531 | /* | ||
532 | * XXX AM35xx UART4 cannot complete its softreset without uart1_fck or | ||
533 | * uart2_fck being enabled. So we add uart1_fck as an optional clock, | ||
534 | * below, and set the HWMOD_CONTROL_OPT_CLKS_IN_RESET. This really | ||
535 | * should not be needed. The functional clock structure of the AM35xx | ||
536 | * UART4 is extremely unclear and opaque; it is unclear what the role | ||
537 | * of uart1/2_fck is for the UART4. Any clarification from either | ||
538 | * empirical testing or the AM3505/3517 hardware designers would be | ||
539 | * most welcome. | ||
540 | */ | ||
541 | static struct omap_hwmod_opt_clk am35xx_uart4_opt_clks[] = { | ||
542 | { .role = "softreset_uart1_fck", .clk = "uart1_fck" }, | ||
535 | }; | 543 | }; |
536 | 544 | ||
537 | static struct omap_hwmod am35xx_uart4_hwmod = { | 545 | static struct omap_hwmod am35xx_uart4_hwmod = { |
@@ -543,11 +551,14 @@ static struct omap_hwmod am35xx_uart4_hwmod = { | |||
543 | .omap2 = { | 551 | .omap2 = { |
544 | .module_offs = CORE_MOD, | 552 | .module_offs = CORE_MOD, |
545 | .prcm_reg_id = 1, | 553 | .prcm_reg_id = 1, |
546 | .module_bit = OMAP3430_EN_UART4_SHIFT, | 554 | .module_bit = AM35XX_EN_UART4_SHIFT, |
547 | .idlest_reg_id = 1, | 555 | .idlest_reg_id = 1, |
548 | .idlest_idle_bit = OMAP3430_EN_UART4_SHIFT, | 556 | .idlest_idle_bit = AM35XX_ST_UART4_SHIFT, |
549 | }, | 557 | }, |
550 | }, | 558 | }, |
559 | .opt_clks = am35xx_uart4_opt_clks, | ||
560 | .opt_clks_cnt = ARRAY_SIZE(am35xx_uart4_opt_clks), | ||
561 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | ||
551 | .class = &omap2_uart_class, | 562 | .class = &omap2_uart_class, |
552 | }; | 563 | }; |
553 | 564 | ||
@@ -1074,6 +1085,17 @@ static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = { | |||
1074 | .rev = MCBSP_CONFIG_TYPE3, | 1085 | .rev = MCBSP_CONFIG_TYPE3, |
1075 | }; | 1086 | }; |
1076 | 1087 | ||
1088 | /* McBSP functional clock mapping */ | ||
1089 | static struct omap_hwmod_opt_clk mcbsp15_opt_clks[] = { | ||
1090 | { .role = "pad_fck", .clk = "mcbsp_clks" }, | ||
1091 | { .role = "prcm_fck", .clk = "core_96m_fck" }, | ||
1092 | }; | ||
1093 | |||
1094 | static struct omap_hwmod_opt_clk mcbsp234_opt_clks[] = { | ||
1095 | { .role = "pad_fck", .clk = "mcbsp_clks" }, | ||
1096 | { .role = "prcm_fck", .clk = "per_96m_fck" }, | ||
1097 | }; | ||
1098 | |||
1077 | /* mcbsp1 */ | 1099 | /* mcbsp1 */ |
1078 | static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { | 1100 | static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { |
1079 | { .name = "common", .irq = 16 }, | 1101 | { .name = "common", .irq = 16 }, |
@@ -1097,6 +1119,8 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { | |||
1097 | .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT, | 1119 | .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT, |
1098 | }, | 1120 | }, |
1099 | }, | 1121 | }, |
1122 | .opt_clks = mcbsp15_opt_clks, | ||
1123 | .opt_clks_cnt = ARRAY_SIZE(mcbsp15_opt_clks), | ||
1100 | }; | 1124 | }; |
1101 | 1125 | ||
1102 | /* mcbsp2 */ | 1126 | /* mcbsp2 */ |
@@ -1126,6 +1150,8 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { | |||
1126 | .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, | 1150 | .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, |
1127 | }, | 1151 | }, |
1128 | }, | 1152 | }, |
1153 | .opt_clks = mcbsp234_opt_clks, | ||
1154 | .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks), | ||
1129 | .dev_attr = &omap34xx_mcbsp2_dev_attr, | 1155 | .dev_attr = &omap34xx_mcbsp2_dev_attr, |
1130 | }; | 1156 | }; |
1131 | 1157 | ||
@@ -1156,6 +1182,8 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { | |||
1156 | .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, | 1182 | .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, |
1157 | }, | 1183 | }, |
1158 | }, | 1184 | }, |
1185 | .opt_clks = mcbsp234_opt_clks, | ||
1186 | .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks), | ||
1159 | .dev_attr = &omap34xx_mcbsp3_dev_attr, | 1187 | .dev_attr = &omap34xx_mcbsp3_dev_attr, |
1160 | }; | 1188 | }; |
1161 | 1189 | ||
@@ -1188,6 +1216,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { | |||
1188 | .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT, | 1216 | .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT, |
1189 | }, | 1217 | }, |
1190 | }, | 1218 | }, |
1219 | .opt_clks = mcbsp234_opt_clks, | ||
1220 | .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks), | ||
1191 | }; | 1221 | }; |
1192 | 1222 | ||
1193 | /* mcbsp5 */ | 1223 | /* mcbsp5 */ |
@@ -1219,6 +1249,8 @@ static struct omap_hwmod omap3xxx_mcbsp5_hwmod = { | |||
1219 | .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT, | 1249 | .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT, |
1220 | }, | 1250 | }, |
1221 | }, | 1251 | }, |
1252 | .opt_clks = mcbsp15_opt_clks, | ||
1253 | .opt_clks_cnt = ARRAY_SIZE(mcbsp15_opt_clks), | ||
1222 | }; | 1254 | }; |
1223 | 1255 | ||
1224 | /* 'mcbsp sidetone' class */ | 1256 | /* 'mcbsp sidetone' class */ |
@@ -1325,7 +1357,7 @@ static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = { | |||
1325 | }; | 1357 | }; |
1326 | 1358 | ||
1327 | static struct omap_hwmod omap34xx_sr1_hwmod = { | 1359 | static struct omap_hwmod omap34xx_sr1_hwmod = { |
1328 | .name = "sr1", | 1360 | .name = "smartreflex_mpu_iva", |
1329 | .class = &omap34xx_smartreflex_hwmod_class, | 1361 | .class = &omap34xx_smartreflex_hwmod_class, |
1330 | .main_clk = "sr1_fck", | 1362 | .main_clk = "sr1_fck", |
1331 | .prcm = { | 1363 | .prcm = { |
@@ -1343,7 +1375,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = { | |||
1343 | }; | 1375 | }; |
1344 | 1376 | ||
1345 | static struct omap_hwmod omap36xx_sr1_hwmod = { | 1377 | static struct omap_hwmod omap36xx_sr1_hwmod = { |
1346 | .name = "sr1", | 1378 | .name = "smartreflex_mpu_iva", |
1347 | .class = &omap36xx_smartreflex_hwmod_class, | 1379 | .class = &omap36xx_smartreflex_hwmod_class, |
1348 | .main_clk = "sr1_fck", | 1380 | .main_clk = "sr1_fck", |
1349 | .prcm = { | 1381 | .prcm = { |
@@ -1370,7 +1402,7 @@ static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = { | |||
1370 | }; | 1402 | }; |
1371 | 1403 | ||
1372 | static struct omap_hwmod omap34xx_sr2_hwmod = { | 1404 | static struct omap_hwmod omap34xx_sr2_hwmod = { |
1373 | .name = "sr2", | 1405 | .name = "smartreflex_core", |
1374 | .class = &omap34xx_smartreflex_hwmod_class, | 1406 | .class = &omap34xx_smartreflex_hwmod_class, |
1375 | .main_clk = "sr2_fck", | 1407 | .main_clk = "sr2_fck", |
1376 | .prcm = { | 1408 | .prcm = { |
@@ -1388,7 +1420,7 @@ static struct omap_hwmod omap34xx_sr2_hwmod = { | |||
1388 | }; | 1420 | }; |
1389 | 1421 | ||
1390 | static struct omap_hwmod omap36xx_sr2_hwmod = { | 1422 | static struct omap_hwmod omap36xx_sr2_hwmod = { |
1391 | .name = "sr2", | 1423 | .name = "smartreflex_core", |
1392 | .class = &omap36xx_smartreflex_hwmod_class, | 1424 | .class = &omap36xx_smartreflex_hwmod_class, |
1393 | .main_clk = "sr2_fck", | 1425 | .main_clk = "sr2_fck", |
1394 | .prcm = { | 1426 | .prcm = { |
@@ -1638,25 +1670,20 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { | |||
1638 | 1670 | ||
1639 | /* usb_otg_hs */ | 1671 | /* usb_otg_hs */ |
1640 | static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = { | 1672 | static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = { |
1641 | |||
1642 | { .name = "mc", .irq = 71 }, | 1673 | { .name = "mc", .irq = 71 }, |
1643 | { .irq = -1 } | 1674 | { .irq = -1 } |
1644 | }; | 1675 | }; |
1645 | 1676 | ||
1646 | static struct omap_hwmod_class am35xx_usbotg_class = { | 1677 | static struct omap_hwmod_class am35xx_usbotg_class = { |
1647 | .name = "am35xx_usbotg", | 1678 | .name = "am35xx_usbotg", |
1648 | .sysc = NULL, | ||
1649 | }; | 1679 | }; |
1650 | 1680 | ||
1651 | static struct omap_hwmod am35xx_usbhsotg_hwmod = { | 1681 | static struct omap_hwmod am35xx_usbhsotg_hwmod = { |
1652 | .name = "am35x_otg_hs", | 1682 | .name = "am35x_otg_hs", |
1653 | .mpu_irqs = am35xx_usbhsotg_mpu_irqs, | 1683 | .mpu_irqs = am35xx_usbhsotg_mpu_irqs, |
1654 | .main_clk = NULL, | 1684 | .main_clk = "hsotgusb_fck", |
1655 | .prcm = { | ||
1656 | .omap2 = { | ||
1657 | }, | ||
1658 | }, | ||
1659 | .class = &am35xx_usbotg_class, | 1685 | .class = &am35xx_usbotg_class, |
1686 | .flags = HWMOD_NO_IDLEST, | ||
1660 | }; | 1687 | }; |
1661 | 1688 | ||
1662 | /* MMC/SD/SDIO common */ | 1689 | /* MMC/SD/SDIO common */ |
@@ -2097,9 +2124,10 @@ static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = { | |||
2097 | static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = { | 2124 | static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = { |
2098 | .master = &am35xx_usbhsotg_hwmod, | 2125 | .master = &am35xx_usbhsotg_hwmod, |
2099 | .slave = &omap3xxx_l3_main_hwmod, | 2126 | .slave = &omap3xxx_l3_main_hwmod, |
2100 | .clk = "core_l3_ick", | 2127 | .clk = "hsotgusb_ick", |
2101 | .user = OCP_USER_MPU, | 2128 | .user = OCP_USER_MPU, |
2102 | }; | 2129 | }; |
2130 | |||
2103 | /* L4_CORE -> L4_WKUP interface */ | 2131 | /* L4_CORE -> L4_WKUP interface */ |
2104 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { | 2132 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { |
2105 | .master = &omap3xxx_l4_core_hwmod, | 2133 | .master = &omap3xxx_l4_core_hwmod, |
@@ -2243,6 +2271,7 @@ static struct omap_hwmod_addr_space am35xx_uart4_addr_space[] = { | |||
2243 | .pa_end = OMAP3_UART4_AM35XX_BASE + SZ_1K - 1, | 2271 | .pa_end = OMAP3_UART4_AM35XX_BASE + SZ_1K - 1, |
2244 | .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, | 2272 | .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, |
2245 | }, | 2273 | }, |
2274 | { } | ||
2246 | }; | 2275 | }; |
2247 | 2276 | ||
2248 | static struct omap_hwmod_ocp_if am35xx_l4_core__uart4 = { | 2277 | static struct omap_hwmod_ocp_if am35xx_l4_core__uart4 = { |
@@ -2393,7 +2422,7 @@ static struct omap_hwmod_addr_space am35xx_usbhsotg_addrs[] = { | |||
2393 | static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = { | 2422 | static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = { |
2394 | .master = &omap3xxx_l4_core_hwmod, | 2423 | .master = &omap3xxx_l4_core_hwmod, |
2395 | .slave = &am35xx_usbhsotg_hwmod, | 2424 | .slave = &am35xx_usbhsotg_hwmod, |
2396 | .clk = "l4_ick", | 2425 | .clk = "hsotgusb_ick", |
2397 | .addr = am35xx_usbhsotg_addrs, | 2426 | .addr = am35xx_usbhsotg_addrs, |
2398 | .user = OCP_USER_MPU, | 2427 | .user = OCP_USER_MPU, |
2399 | }; | 2428 | }; |
@@ -3138,6 +3167,107 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__counter_32k = { | |||
3138 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 3167 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
3139 | }; | 3168 | }; |
3140 | 3169 | ||
3170 | /* am35xx has Davinci MDIO & EMAC */ | ||
3171 | static struct omap_hwmod_class am35xx_mdio_class = { | ||
3172 | .name = "davinci_mdio", | ||
3173 | }; | ||
3174 | |||
3175 | static struct omap_hwmod am35xx_mdio_hwmod = { | ||
3176 | .name = "davinci_mdio", | ||
3177 | .class = &am35xx_mdio_class, | ||
3178 | .flags = HWMOD_NO_IDLEST, | ||
3179 | }; | ||
3180 | |||
3181 | /* | ||
3182 | * XXX Should be connected to an IPSS hwmod, not the L3 directly; | ||
3183 | * but this will probably require some additional hwmod core support, | ||
3184 | * so is left as a future to-do item. | ||
3185 | */ | ||
3186 | static struct omap_hwmod_ocp_if am35xx_mdio__l3 = { | ||
3187 | .master = &am35xx_mdio_hwmod, | ||
3188 | .slave = &omap3xxx_l3_main_hwmod, | ||
3189 | .clk = "emac_fck", | ||
3190 | .user = OCP_USER_MPU, | ||
3191 | }; | ||
3192 | |||
3193 | static struct omap_hwmod_addr_space am35xx_mdio_addrs[] = { | ||
3194 | { | ||
3195 | .pa_start = AM35XX_IPSS_MDIO_BASE, | ||
3196 | .pa_end = AM35XX_IPSS_MDIO_BASE + SZ_4K - 1, | ||
3197 | .flags = ADDR_TYPE_RT, | ||
3198 | }, | ||
3199 | { } | ||
3200 | }; | ||
3201 | |||
3202 | /* l4_core -> davinci mdio */ | ||
3203 | /* | ||
3204 | * XXX Should be connected to an IPSS hwmod, not the L4_CORE directly; | ||
3205 | * but this will probably require some additional hwmod core support, | ||
3206 | * so is left as a future to-do item. | ||
3207 | */ | ||
3208 | static struct omap_hwmod_ocp_if am35xx_l4_core__mdio = { | ||
3209 | .master = &omap3xxx_l4_core_hwmod, | ||
3210 | .slave = &am35xx_mdio_hwmod, | ||
3211 | .clk = "emac_fck", | ||
3212 | .addr = am35xx_mdio_addrs, | ||
3213 | .user = OCP_USER_MPU, | ||
3214 | }; | ||
3215 | |||
3216 | static struct omap_hwmod_irq_info am35xx_emac_mpu_irqs[] = { | ||
3217 | { .name = "rxthresh", .irq = INT_35XX_EMAC_C0_RXTHRESH_IRQ }, | ||
3218 | { .name = "rx_pulse", .irq = INT_35XX_EMAC_C0_RX_PULSE_IRQ }, | ||
3219 | { .name = "tx_pulse", .irq = INT_35XX_EMAC_C0_TX_PULSE_IRQ }, | ||
3220 | { .name = "misc_pulse", .irq = INT_35XX_EMAC_C0_MISC_PULSE_IRQ }, | ||
3221 | { .irq = -1 } | ||
3222 | }; | ||
3223 | |||
3224 | static struct omap_hwmod_class am35xx_emac_class = { | ||
3225 | .name = "davinci_emac", | ||
3226 | }; | ||
3227 | |||
3228 | static struct omap_hwmod am35xx_emac_hwmod = { | ||
3229 | .name = "davinci_emac", | ||
3230 | .mpu_irqs = am35xx_emac_mpu_irqs, | ||
3231 | .class = &am35xx_emac_class, | ||
3232 | .flags = HWMOD_NO_IDLEST, | ||
3233 | }; | ||
3234 | |||
3235 | /* l3_core -> davinci emac interface */ | ||
3236 | /* | ||
3237 | * XXX Should be connected to an IPSS hwmod, not the L3 directly; | ||
3238 | * but this will probably require some additional hwmod core support, | ||
3239 | * so is left as a future to-do item. | ||
3240 | */ | ||
3241 | static struct omap_hwmod_ocp_if am35xx_emac__l3 = { | ||
3242 | .master = &am35xx_emac_hwmod, | ||
3243 | .slave = &omap3xxx_l3_main_hwmod, | ||
3244 | .clk = "emac_ick", | ||
3245 | .user = OCP_USER_MPU, | ||
3246 | }; | ||
3247 | |||
3248 | static struct omap_hwmod_addr_space am35xx_emac_addrs[] = { | ||
3249 | { | ||
3250 | .pa_start = AM35XX_IPSS_EMAC_BASE, | ||
3251 | .pa_end = AM35XX_IPSS_EMAC_BASE + 0x30000 - 1, | ||
3252 | .flags = ADDR_TYPE_RT, | ||
3253 | }, | ||
3254 | { } | ||
3255 | }; | ||
3256 | |||
3257 | /* l4_core -> davinci emac */ | ||
3258 | /* | ||
3259 | * XXX Should be connected to an IPSS hwmod, not the L4_CORE directly; | ||
3260 | * but this will probably require some additional hwmod core support, | ||
3261 | * so is left as a future to-do item. | ||
3262 | */ | ||
3263 | static struct omap_hwmod_ocp_if am35xx_l4_core__emac = { | ||
3264 | .master = &omap3xxx_l4_core_hwmod, | ||
3265 | .slave = &am35xx_emac_hwmod, | ||
3266 | .clk = "emac_ick", | ||
3267 | .addr = am35xx_emac_addrs, | ||
3268 | .user = OCP_USER_MPU, | ||
3269 | }; | ||
3270 | |||
3141 | static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = { | 3271 | static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = { |
3142 | &omap3xxx_l3_main__l4_core, | 3272 | &omap3xxx_l3_main__l4_core, |
3143 | &omap3xxx_l3_main__l4_per, | 3273 | &omap3xxx_l3_main__l4_per, |
@@ -3266,6 +3396,10 @@ static struct omap_hwmod_ocp_if *am35xx_hwmod_ocp_ifs[] __initdata = { | |||
3266 | &omap3xxx_l4_core__usb_tll_hs, | 3396 | &omap3xxx_l4_core__usb_tll_hs, |
3267 | &omap3xxx_l4_core__es3plus_mmc1, | 3397 | &omap3xxx_l4_core__es3plus_mmc1, |
3268 | &omap3xxx_l4_core__es3plus_mmc2, | 3398 | &omap3xxx_l4_core__es3plus_mmc2, |
3399 | &am35xx_mdio__l3, | ||
3400 | &am35xx_l4_core__mdio, | ||
3401 | &am35xx_emac__l3, | ||
3402 | &am35xx_l4_core__emac, | ||
3269 | NULL | 3403 | NULL |
3270 | }; | 3404 | }; |
3271 | 3405 | ||
@@ -3283,6 +3417,8 @@ int __init omap3xxx_hwmod_init(void) | |||
3283 | struct omap_hwmod_ocp_if **h = NULL; | 3417 | struct omap_hwmod_ocp_if **h = NULL; |
3284 | unsigned int rev; | 3418 | unsigned int rev; |
3285 | 3419 | ||
3420 | omap_hwmod_init(); | ||
3421 | |||
3286 | /* Register hwmod links common to all OMAP3 */ | 3422 | /* Register hwmod links common to all OMAP3 */ |
3287 | r = omap_hwmod_register_links(omap3xxx_hwmod_ocp_ifs); | 3423 | r = omap_hwmod_register_links(omap3xxx_hwmod_ocp_ifs); |
3288 | if (r < 0) | 3424 | if (r < 0) |