diff options
author | Keshava Munegowda <keshava_mgowda@ti.com> | 2011-12-16 01:14:44 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-12-16 03:34:45 -0500 |
commit | de231388cb80a8ef3e779bbfa0564ba0157b7377 (patch) | |
tree | 210e3755f26e089a0a8bf8624d0b786244f42a8e | |
parent | 4bf90f6573d04845917dc0ac38170746f84c533c (diff) |
ARM: OMAP: USB: EHCI and OHCI hwmod structures for OMAP3
Following 2 hwmod structures are added
1. usb_host_hs
The hwmod of usbhs with uhh, ehci and ohci base addresses
functional clock and ehci, ohci irqs
2. usb_tll_hs
hwmod of usbhs with the TLL base address and irq.
Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Reviewed-by: Partha Basak <parthab@india.ti.com>
[paul@pwsan.com: fixed whitespace; removed nonexistent TLL->L3 interface;
added master & slave for L4 CORE->TLL interface; skip registration on
3430ES1; fixed multiline comment style; updated to apply on Tony's cleanup
branch; rebased]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 3be90feca77..905fc44ae90 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod; | |||
84 | static struct omap_hwmod omap3xxx_mcbsp5_hwmod; | 84 | static struct omap_hwmod omap3xxx_mcbsp5_hwmod; |
85 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod; | 85 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod; |
86 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod; | 86 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod; |
87 | static struct omap_hwmod omap3xxx_usb_host_hs_hwmod; | ||
88 | static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod; | ||
87 | 89 | ||
88 | /* L3 -> L4_CORE interface */ | 90 | /* L3 -> L4_CORE interface */ |
89 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { | 91 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { |
@@ -3228,6 +3230,218 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = { | |||
3228 | .class = &omap34xx_mmc_class, | 3230 | .class = &omap34xx_mmc_class, |
3229 | }; | 3231 | }; |
3230 | 3232 | ||
3233 | /* | ||
3234 | * 'usb_host_hs' class | ||
3235 | * high-speed multi-port usb host controller | ||
3236 | */ | ||
3237 | static struct omap_hwmod_ocp_if omap3xxx_usb_host_hs__l3_main_2 = { | ||
3238 | .master = &omap3xxx_usb_host_hs_hwmod, | ||
3239 | .slave = &omap3xxx_l3_main_hwmod, | ||
3240 | .clk = "core_l3_ick", | ||
3241 | .user = OCP_USER_MPU, | ||
3242 | }; | ||
3243 | |||
3244 | static struct omap_hwmod_class_sysconfig omap3xxx_usb_host_hs_sysc = { | ||
3245 | .rev_offs = 0x0000, | ||
3246 | .sysc_offs = 0x0010, | ||
3247 | .syss_offs = 0x0014, | ||
3248 | .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
3249 | SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | | ||
3250 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
3251 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
3252 | MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), | ||
3253 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3254 | }; | ||
3255 | |||
3256 | static struct omap_hwmod_class omap3xxx_usb_host_hs_hwmod_class = { | ||
3257 | .name = "usb_host_hs", | ||
3258 | .sysc = &omap3xxx_usb_host_hs_sysc, | ||
3259 | }; | ||
3260 | |||
3261 | static struct omap_hwmod_ocp_if *omap3xxx_usb_host_hs_masters[] = { | ||
3262 | &omap3xxx_usb_host_hs__l3_main_2, | ||
3263 | }; | ||
3264 | |||
3265 | static struct omap_hwmod_addr_space omap3xxx_usb_host_hs_addrs[] = { | ||
3266 | { | ||
3267 | .name = "uhh", | ||
3268 | .pa_start = 0x48064000, | ||
3269 | .pa_end = 0x480643ff, | ||
3270 | .flags = ADDR_TYPE_RT | ||
3271 | }, | ||
3272 | { | ||
3273 | .name = "ohci", | ||
3274 | .pa_start = 0x48064400, | ||
3275 | .pa_end = 0x480647ff, | ||
3276 | }, | ||
3277 | { | ||
3278 | .name = "ehci", | ||
3279 | .pa_start = 0x48064800, | ||
3280 | .pa_end = 0x48064cff, | ||
3281 | }, | ||
3282 | {} | ||
3283 | }; | ||
3284 | |||
3285 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__usb_host_hs = { | ||
3286 | .master = &omap3xxx_l4_core_hwmod, | ||
3287 | .slave = &omap3xxx_usb_host_hs_hwmod, | ||
3288 | .clk = "usbhost_ick", | ||
3289 | .addr = omap3xxx_usb_host_hs_addrs, | ||
3290 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3291 | }; | ||
3292 | |||
3293 | static struct omap_hwmod_ocp_if *omap3xxx_usb_host_hs_slaves[] = { | ||
3294 | &omap3xxx_l4_core__usb_host_hs, | ||
3295 | }; | ||
3296 | |||
3297 | static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = { | ||
3298 | { .role = "ehci_logic_fck", .clk = "usbhost_120m_fck", }, | ||
3299 | }; | ||
3300 | |||
3301 | static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = { | ||
3302 | { .name = "ohci-irq", .irq = 76 }, | ||
3303 | { .name = "ehci-irq", .irq = 77 }, | ||
3304 | { .irq = -1 } | ||
3305 | }; | ||
3306 | |||
3307 | static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { | ||
3308 | .name = "usb_host_hs", | ||
3309 | .class = &omap3xxx_usb_host_hs_hwmod_class, | ||
3310 | .clkdm_name = "l3_init_clkdm", | ||
3311 | .mpu_irqs = omap3xxx_usb_host_hs_irqs, | ||
3312 | .main_clk = "usbhost_48m_fck", | ||
3313 | .prcm = { | ||
3314 | .omap2 = { | ||
3315 | .module_offs = OMAP3430ES2_USBHOST_MOD, | ||
3316 | .prcm_reg_id = 1, | ||
3317 | .module_bit = OMAP3430ES2_EN_USBHOST1_SHIFT, | ||
3318 | .idlest_reg_id = 1, | ||
3319 | .idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT, | ||
3320 | .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT, | ||
3321 | }, | ||
3322 | }, | ||
3323 | .opt_clks = omap3xxx_usb_host_hs_opt_clks, | ||
3324 | .opt_clks_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_opt_clks), | ||
3325 | .slaves = omap3xxx_usb_host_hs_slaves, | ||
3326 | .slaves_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_slaves), | ||
3327 | .masters = omap3xxx_usb_host_hs_masters, | ||
3328 | .masters_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_masters), | ||
3329 | |||
3330 | /* | ||
3331 | * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock | ||
3332 | * id: i660 | ||
3333 | * | ||
3334 | * Description: | ||
3335 | * In the following configuration : | ||
3336 | * - USBHOST module is set to smart-idle mode | ||
3337 | * - PRCM asserts idle_req to the USBHOST module ( This typically | ||
3338 | * happens when the system is going to a low power mode : all ports | ||
3339 | * have been suspended, the master part of the USBHOST module has | ||
3340 | * entered the standby state, and SW has cut the functional clocks) | ||
3341 | * - an USBHOST interrupt occurs before the module is able to answer | ||
3342 | * idle_ack, typically a remote wakeup IRQ. | ||
3343 | * Then the USB HOST module will enter a deadlock situation where it | ||
3344 | * is no more accessible nor functional. | ||
3345 | * | ||
3346 | * Workaround: | ||
3347 | * Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE | ||
3348 | */ | ||
3349 | |||
3350 | /* | ||
3351 | * Errata: USB host EHCI may stall when entering smart-standby mode | ||
3352 | * Id: i571 | ||
3353 | * | ||
3354 | * Description: | ||
3355 | * When the USBHOST module is set to smart-standby mode, and when it is | ||
3356 | * ready to enter the standby state (i.e. all ports are suspended and | ||
3357 | * all attached devices are in suspend mode), then it can wrongly assert | ||
3358 | * the Mstandby signal too early while there are still some residual OCP | ||
3359 | * transactions ongoing. If this condition occurs, the internal state | ||
3360 | * machine may go to an undefined state and the USB link may be stuck | ||
3361 | * upon the next resume. | ||
3362 | * | ||
3363 | * Workaround: | ||
3364 | * Don't use smart standby; use only force standby, | ||
3365 | * hence HWMOD_SWSUP_MSTANDBY | ||
3366 | */ | ||
3367 | |||
3368 | /* | ||
3369 | * During system boot; If the hwmod framework resets the module | ||
3370 | * the module will have smart idle settings; which can lead to deadlock | ||
3371 | * (above Errata Id:i660); so, dont reset the module during boot; | ||
3372 | * Use HWMOD_INIT_NO_RESET. | ||
3373 | */ | ||
3374 | |||
3375 | .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY | | ||
3376 | HWMOD_INIT_NO_RESET, | ||
3377 | }; | ||
3378 | |||
3379 | /* | ||
3380 | * 'usb_tll_hs' class | ||
3381 | * usb_tll_hs module is the adapter on the usb_host_hs ports | ||
3382 | */ | ||
3383 | static struct omap_hwmod_class_sysconfig omap3xxx_usb_tll_hs_sysc = { | ||
3384 | .rev_offs = 0x0000, | ||
3385 | .sysc_offs = 0x0010, | ||
3386 | .syss_offs = 0x0014, | ||
3387 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
3388 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
3389 | SYSC_HAS_AUTOIDLE), | ||
3390 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
3391 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
3392 | }; | ||
3393 | |||
3394 | static struct omap_hwmod_class omap3xxx_usb_tll_hs_hwmod_class = { | ||
3395 | .name = "usb_tll_hs", | ||
3396 | .sysc = &omap3xxx_usb_tll_hs_sysc, | ||
3397 | }; | ||
3398 | |||
3399 | static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = { | ||
3400 | { .name = "tll-irq", .irq = 78 }, | ||
3401 | { .irq = -1 } | ||
3402 | }; | ||
3403 | |||
3404 | static struct omap_hwmod_addr_space omap3xxx_usb_tll_hs_addrs[] = { | ||
3405 | { | ||
3406 | .name = "tll", | ||
3407 | .pa_start = 0x48062000, | ||
3408 | .pa_end = 0x48062fff, | ||
3409 | .flags = ADDR_TYPE_RT | ||
3410 | }, | ||
3411 | {} | ||
3412 | }; | ||
3413 | |||
3414 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__usb_tll_hs = { | ||
3415 | .master = &omap3xxx_l4_core_hwmod, | ||
3416 | .slave = &omap3xxx_usb_tll_hs_hwmod, | ||
3417 | .clk = "usbtll_ick", | ||
3418 | .addr = omap3xxx_usb_tll_hs_addrs, | ||
3419 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
3420 | }; | ||
3421 | |||
3422 | static struct omap_hwmod_ocp_if *omap3xxx_usb_tll_hs_slaves[] = { | ||
3423 | &omap3xxx_l4_core__usb_tll_hs, | ||
3424 | }; | ||
3425 | |||
3426 | static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { | ||
3427 | .name = "usb_tll_hs", | ||
3428 | .class = &omap3xxx_usb_tll_hs_hwmod_class, | ||
3429 | .clkdm_name = "l3_init_clkdm", | ||
3430 | .mpu_irqs = omap3xxx_usb_tll_hs_irqs, | ||
3431 | .main_clk = "usbtll_fck", | ||
3432 | .prcm = { | ||
3433 | .omap2 = { | ||
3434 | .module_offs = CORE_MOD, | ||
3435 | .prcm_reg_id = 3, | ||
3436 | .module_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | ||
3437 | .idlest_reg_id = 3, | ||
3438 | .idlest_idle_bit = OMAP3430ES2_ST_USBTLL_SHIFT, | ||
3439 | }, | ||
3440 | }, | ||
3441 | .slaves = omap3xxx_usb_tll_hs_slaves, | ||
3442 | .slaves_cnt = ARRAY_SIZE(omap3xxx_usb_tll_hs_slaves), | ||
3443 | }; | ||
3444 | |||
3231 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 3445 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { |
3232 | &omap3xxx_l3_main_hwmod, | 3446 | &omap3xxx_l3_main_hwmod, |
3233 | &omap3xxx_l4_core_hwmod, | 3447 | &omap3xxx_l4_core_hwmod, |
@@ -3254,6 +3468,7 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
3254 | &omap3xxx_uart1_hwmod, | 3468 | &omap3xxx_uart1_hwmod, |
3255 | &omap3xxx_uart2_hwmod, | 3469 | &omap3xxx_uart2_hwmod, |
3256 | &omap3xxx_uart3_hwmod, | 3470 | &omap3xxx_uart3_hwmod, |
3471 | |||
3257 | /* dss class */ | 3472 | /* dss class */ |
3258 | &omap3xxx_dss_dispc_hwmod, | 3473 | &omap3xxx_dss_dispc_hwmod, |
3259 | &omap3xxx_dss_dsi1_hwmod, | 3474 | &omap3xxx_dss_dsi1_hwmod, |
@@ -3311,6 +3526,8 @@ static __initdata struct omap_hwmod *omap3430es1_hwmods[] = { | |||
3311 | static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = { | 3526 | static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = { |
3312 | &omap3xxx_dss_core_hwmod, | 3527 | &omap3xxx_dss_core_hwmod, |
3313 | &omap3xxx_usbhsotg_hwmod, | 3528 | &omap3xxx_usbhsotg_hwmod, |
3529 | &omap3xxx_usb_host_hs_hwmod, | ||
3530 | &omap3xxx_usb_tll_hs_hwmod, | ||
3314 | NULL | 3531 | NULL |
3315 | }; | 3532 | }; |
3316 | 3533 | ||
@@ -3332,6 +3549,8 @@ static __initdata struct omap_hwmod *omap36xx_hwmods[] = { | |||
3332 | &omap36xx_sr2_hwmod, | 3549 | &omap36xx_sr2_hwmod, |
3333 | &omap3xxx_usbhsotg_hwmod, | 3550 | &omap3xxx_usbhsotg_hwmod, |
3334 | &omap3xxx_mailbox_hwmod, | 3551 | &omap3xxx_mailbox_hwmod, |
3552 | &omap3xxx_usb_host_hs_hwmod, | ||
3553 | &omap3xxx_usb_tll_hs_hwmod, | ||
3335 | NULL | 3554 | NULL |
3336 | }; | 3555 | }; |
3337 | 3556 | ||
@@ -3339,6 +3558,8 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = { | |||
3339 | &omap3xxx_dss_core_hwmod, /* XXX ??? */ | 3558 | &omap3xxx_dss_core_hwmod, /* XXX ??? */ |
3340 | &am35xx_usbhsotg_hwmod, | 3559 | &am35xx_usbhsotg_hwmod, |
3341 | &am35xx_uart4_hwmod, | 3560 | &am35xx_uart4_hwmod, |
3561 | &omap3xxx_usb_host_hs_hwmod, | ||
3562 | &omap3xxx_usb_tll_hs_hwmod, | ||
3342 | NULL | 3563 | NULL |
3343 | }; | 3564 | }; |
3344 | 3565 | ||