aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-10-11 14:07:44 -0400
committerTony Lindgren <tony@atomide.com>2013-10-11 14:07:44 -0400
commited8436d2b38254d5a8b490c481c54d4fbec9ffc0 (patch)
tree944e02b7dd2494e45b52efd81c6cbc29afb64c91
parentd0e639c9e06d44e713170031fe05fb60ebe680af (diff)
parentace1e3ec4a2540c783e65884bb7be9cd45a0a295 (diff)
Merge tag 'for-v3.13/hwmod' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.13/hwmod
Some OMAP hwmod changes for 3.13. Significant changes here include: - support for moving some of the hwmod flags to DT data - support for the SSI, hardware spinlock, USB host/TLL, and RNG IP blocks for various OMAPs - a fix that again decouples hwmod data changes from unrelated DT data patchsets Basic test logs are available at: http://www.pwsan.com/omap/testlogs/prcm_fixes_v3.13/20131009094936/ The summary reports that the 4460varsomom boots are failing, but this looks incorrect - it's probably a bug in the validation scripts here.
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c49
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c67
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c48
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_54xx_data.c185
5 files changed, 325 insertions, 30 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index d9ee0ff094d4..1c217e89deb9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2357,25 +2357,29 @@ static struct device_node *of_dev_hwmod_lookup(struct device_node *np,
2357/** 2357/**
2358 * _init_mpu_rt_base - populate the virtual address for a hwmod 2358 * _init_mpu_rt_base - populate the virtual address for a hwmod
2359 * @oh: struct omap_hwmod * to locate the virtual address 2359 * @oh: struct omap_hwmod * to locate the virtual address
2360 * @data: (unused, caller should pass NULL)
2361 * @np: struct device_node * of the IP block's device node in the DT data
2360 * 2362 *
2361 * Cache the virtual address used by the MPU to access this IP block's 2363 * Cache the virtual address used by the MPU to access this IP block's
2362 * registers. This address is needed early so the OCP registers that 2364 * registers. This address is needed early so the OCP registers that
2363 * are part of the device's address space can be ioremapped properly. 2365 * are part of the device's address space can be ioremapped properly.
2364 * No return value. 2366 *
2367 * Returns 0 on success, -EINVAL if an invalid hwmod is passed, and
2368 * -ENXIO on absent or invalid register target address space.
2365 */ 2369 */
2366static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data) 2370static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
2371 struct device_node *np)
2367{ 2372{
2368 struct omap_hwmod_addr_space *mem; 2373 struct omap_hwmod_addr_space *mem;
2369 void __iomem *va_start = NULL; 2374 void __iomem *va_start = NULL;
2370 struct device_node *np;
2371 2375
2372 if (!oh) 2376 if (!oh)
2373 return; 2377 return -EINVAL;
2374 2378
2375 _save_mpu_port_index(oh); 2379 _save_mpu_port_index(oh);
2376 2380
2377 if (oh->_int_flags & _HWMOD_NO_MPU_PORT) 2381 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
2378 return; 2382 return -ENXIO;
2379 2383
2380 mem = _find_mpu_rt_addr_space(oh); 2384 mem = _find_mpu_rt_addr_space(oh);
2381 if (!mem) { 2385 if (!mem) {
@@ -2383,25 +2387,24 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
2383 oh->name); 2387 oh->name);
2384 2388
2385 /* Extract the IO space from device tree blob */ 2389 /* Extract the IO space from device tree blob */
2386 if (!of_have_populated_dt()) 2390 if (!np)
2387 return; 2391 return -ENXIO;
2388 2392
2389 np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh); 2393 va_start = of_iomap(np, oh->mpu_rt_idx);
2390 if (np)
2391 va_start = of_iomap(np, oh->mpu_rt_idx);
2392 } else { 2394 } else {
2393 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); 2395 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
2394 } 2396 }
2395 2397
2396 if (!va_start) { 2398 if (!va_start) {
2397 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); 2399 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
2398 return; 2400 return -ENXIO;
2399 } 2401 }
2400 2402
2401 pr_debug("omap_hwmod: %s: MPU register target at va %p\n", 2403 pr_debug("omap_hwmod: %s: MPU register target at va %p\n",
2402 oh->name, va_start); 2404 oh->name, va_start);
2403 2405
2404 oh->_mpu_rt_va = va_start; 2406 oh->_mpu_rt_va = va_start;
2407 return 0;
2405} 2408}
2406 2409
2407/** 2410/**
@@ -2414,18 +2417,28 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
2414 * registered at this point. This is the first of two phases for 2417 * registered at this point. This is the first of two phases for
2415 * hwmod initialization. Code called here does not touch any hardware 2418 * hwmod initialization. Code called here does not touch any hardware
2416 * registers, it simply prepares internal data structures. Returns 0 2419 * registers, it simply prepares internal data structures. Returns 0
2417 * upon success or if the hwmod isn't registered, or -EINVAL upon 2420 * upon success or if the hwmod isn't registered or if the hwmod's
2418 * failure. 2421 * address space is not defined, or -EINVAL upon failure.
2419 */ 2422 */
2420static int __init _init(struct omap_hwmod *oh, void *data) 2423static int __init _init(struct omap_hwmod *oh, void *data)
2421{ 2424{
2422 int r; 2425 int r;
2426 struct device_node *np = NULL;
2423 2427
2424 if (oh->_state != _HWMOD_STATE_REGISTERED) 2428 if (oh->_state != _HWMOD_STATE_REGISTERED)
2425 return 0; 2429 return 0;
2426 2430
2427 if (oh->class->sysc) 2431 if (of_have_populated_dt())
2428 _init_mpu_rt_base(oh, NULL); 2432 np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
2433
2434 if (oh->class->sysc) {
2435 r = _init_mpu_rt_base(oh, NULL, np);
2436 if (r < 0) {
2437 WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n",
2438 oh->name);
2439 return 0;
2440 }
2441 }
2429 2442
2430 r = _init_clocks(oh, NULL); 2443 r = _init_clocks(oh, NULL);
2431 if (r < 0) { 2444 if (r < 0) {
@@ -2433,6 +2446,12 @@ static int __init _init(struct omap_hwmod *oh, void *data)
2433 return -EINVAL; 2446 return -EINVAL;
2434 } 2447 }
2435 2448
2449 if (np)
2450 if (of_find_property(np, "ti,no-reset-on-init", NULL))
2451 oh->flags |= HWMOD_INIT_NO_RESET;
2452 if (of_find_property(np, "ti,no-idle-on-init", NULL))
2453 oh->flags |= HWMOD_INIT_NO_IDLE;
2454
2436 oh->_state = _HWMOD_STATE_INITIALIZED; 2455 oh->_state = _HWMOD_STATE_INITIALIZED;
2437 2456
2438 return 0; 2457 return 0;
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 215894f8910d..a166e5394113 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -52,7 +52,7 @@ static struct omap_hwmod am33xx_emif_hwmod = {
52 .name = "emif", 52 .name = "emif",
53 .class = &am33xx_emif_hwmod_class, 53 .class = &am33xx_emif_hwmod_class,
54 .clkdm_name = "l3_clkdm", 54 .clkdm_name = "l3_clkdm",
55 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 55 .flags = HWMOD_INIT_NO_IDLE,
56 .main_clk = "dpll_ddr_m2_div2_ck", 56 .main_clk = "dpll_ddr_m2_div2_ck",
57 .prcm = { 57 .prcm = {
58 .omap4 = { 58 .omap4 = {
@@ -74,7 +74,7 @@ static struct omap_hwmod am33xx_l3_main_hwmod = {
74 .name = "l3_main", 74 .name = "l3_main",
75 .class = &am33xx_l3_hwmod_class, 75 .class = &am33xx_l3_hwmod_class,
76 .clkdm_name = "l3_clkdm", 76 .clkdm_name = "l3_clkdm",
77 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 77 .flags = HWMOD_INIT_NO_IDLE,
78 .main_clk = "l3_gclk", 78 .main_clk = "l3_gclk",
79 .prcm = { 79 .prcm = {
80 .omap4 = { 80 .omap4 = {
@@ -96,7 +96,7 @@ static struct omap_hwmod am33xx_l3_instr_hwmod = {
96 .name = "l3_instr", 96 .name = "l3_instr",
97 .class = &am33xx_l3_hwmod_class, 97 .class = &am33xx_l3_hwmod_class,
98 .clkdm_name = "l3_clkdm", 98 .clkdm_name = "l3_clkdm",
99 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 99 .flags = HWMOD_INIT_NO_IDLE,
100 .main_clk = "l3_gclk", 100 .main_clk = "l3_gclk",
101 .prcm = { 101 .prcm = {
102 .omap4 = { 102 .omap4 = {
@@ -119,7 +119,7 @@ static struct omap_hwmod am33xx_l4_ls_hwmod = {
119 .name = "l4_ls", 119 .name = "l4_ls",
120 .class = &am33xx_l4_hwmod_class, 120 .class = &am33xx_l4_hwmod_class,
121 .clkdm_name = "l4ls_clkdm", 121 .clkdm_name = "l4ls_clkdm",
122 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 122 .flags = HWMOD_INIT_NO_IDLE,
123 .main_clk = "l4ls_gclk", 123 .main_clk = "l4ls_gclk",
124 .prcm = { 124 .prcm = {
125 .omap4 = { 125 .omap4 = {
@@ -134,7 +134,7 @@ static struct omap_hwmod am33xx_l4_hs_hwmod = {
134 .name = "l4_hs", 134 .name = "l4_hs",
135 .class = &am33xx_l4_hwmod_class, 135 .class = &am33xx_l4_hwmod_class,
136 .clkdm_name = "l4hs_clkdm", 136 .clkdm_name = "l4hs_clkdm",
137 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 137 .flags = HWMOD_INIT_NO_IDLE,
138 .main_clk = "l4hs_gclk", 138 .main_clk = "l4hs_gclk",
139 .prcm = { 139 .prcm = {
140 .omap4 = { 140 .omap4 = {
@@ -150,7 +150,7 @@ static struct omap_hwmod am33xx_l4_wkup_hwmod = {
150 .name = "l4_wkup", 150 .name = "l4_wkup",
151 .class = &am33xx_l4_hwmod_class, 151 .class = &am33xx_l4_hwmod_class,
152 .clkdm_name = "l4_wkup_clkdm", 152 .clkdm_name = "l4_wkup_clkdm",
153 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 153 .flags = HWMOD_INIT_NO_IDLE,
154 .prcm = { 154 .prcm = {
155 .omap4 = { 155 .omap4 = {
156 .clkctrl_offs = AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET, 156 .clkctrl_offs = AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET,
@@ -170,7 +170,7 @@ static struct omap_hwmod am33xx_mpu_hwmod = {
170 .name = "mpu", 170 .name = "mpu",
171 .class = &am33xx_mpu_hwmod_class, 171 .class = &am33xx_mpu_hwmod_class,
172 .clkdm_name = "mpu_clkdm", 172 .clkdm_name = "mpu_clkdm",
173 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 173 .flags = HWMOD_INIT_NO_IDLE,
174 .main_clk = "dpll_mpu_m2_ck", 174 .main_clk = "dpll_mpu_m2_ck",
175 .prcm = { 175 .prcm = {
176 .omap4 = { 176 .omap4 = {
@@ -450,7 +450,7 @@ static struct omap_hwmod am33xx_ocmcram_hwmod = {
450 .name = "ocmcram", 450 .name = "ocmcram",
451 .class = &am33xx_ocmcram_hwmod_class, 451 .class = &am33xx_ocmcram_hwmod_class,
452 .clkdm_name = "l3_clkdm", 452 .clkdm_name = "l3_clkdm",
453 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 453 .flags = HWMOD_INIT_NO_IDLE,
454 .main_clk = "l3_gclk", 454 .main_clk = "l3_gclk",
455 .prcm = { 455 .prcm = {
456 .omap4 = { 456 .omap4 = {
@@ -532,7 +532,7 @@ static struct omap_hwmod am33xx_control_hwmod = {
532 .name = "control", 532 .name = "control",
533 .class = &am33xx_control_hwmod_class, 533 .class = &am33xx_control_hwmod_class,
534 .clkdm_name = "l4_wkup_clkdm", 534 .clkdm_name = "l4_wkup_clkdm",
535 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET), 535 .flags = HWMOD_INIT_NO_IDLE,
536 .main_clk = "dpll_core_m4_div2_ck", 536 .main_clk = "dpll_core_m4_div2_ck",
537 .prcm = { 537 .prcm = {
538 .omap4 = { 538 .omap4 = {
@@ -1278,8 +1278,21 @@ static struct omap_hwmod am33xx_spi1_hwmod = {
1278 * spinlock provides hardware assistance for synchronizing the 1278 * spinlock provides hardware assistance for synchronizing the
1279 * processes running on multiple processors 1279 * processes running on multiple processors
1280 */ 1280 */
1281
1282static struct omap_hwmod_class_sysconfig am33xx_spinlock_sysc = {
1283 .rev_offs = 0x0000,
1284 .sysc_offs = 0x0010,
1285 .syss_offs = 0x0014,
1286 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1287 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1288 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1289 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1290 .sysc_fields = &omap_hwmod_sysc_type1,
1291};
1292
1281static struct omap_hwmod_class am33xx_spinlock_hwmod_class = { 1293static struct omap_hwmod_class am33xx_spinlock_hwmod_class = {
1282 .name = "spinlock", 1294 .name = "spinlock",
1295 .sysc = &am33xx_spinlock_sysc,
1283}; 1296};
1284 1297
1285static struct omap_hwmod am33xx_spinlock_hwmod = { 1298static struct omap_hwmod am33xx_spinlock_hwmod = {
@@ -2480,6 +2493,41 @@ static struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = {
2480 .user = OCP_USER_MPU | OCP_USER_SDMA, 2493 .user = OCP_USER_MPU | OCP_USER_SDMA,
2481}; 2494};
2482 2495
2496/* rng */
2497static struct omap_hwmod_class_sysconfig am33xx_rng_sysc = {
2498 .rev_offs = 0x1fe0,
2499 .sysc_offs = 0x1fe4,
2500 .sysc_flags = SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE,
2501 .idlemodes = SIDLE_FORCE | SIDLE_NO,
2502 .sysc_fields = &omap_hwmod_sysc_type1,
2503};
2504
2505static struct omap_hwmod_class am33xx_rng_hwmod_class = {
2506 .name = "rng",
2507 .sysc = &am33xx_rng_sysc,
2508};
2509
2510static struct omap_hwmod am33xx_rng_hwmod = {
2511 .name = "rng",
2512 .class = &am33xx_rng_hwmod_class,
2513 .clkdm_name = "l4ls_clkdm",
2514 .flags = HWMOD_SWSUP_SIDLE,
2515 .main_clk = "rng_fck",
2516 .prcm = {
2517 .omap4 = {
2518 .clkctrl_offs = AM33XX_CM_PER_RNG_CLKCTRL_OFFSET,
2519 .modulemode = MODULEMODE_SWCTRL,
2520 },
2521 },
2522};
2523
2524static struct omap_hwmod_ocp_if am33xx_l4_per__rng = {
2525 .master = &am33xx_l4_ls_hwmod,
2526 .slave = &am33xx_rng_hwmod,
2527 .clk = "rng_fck",
2528 .user = OCP_USER_MPU,
2529};
2530
2483static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { 2531static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
2484 &am33xx_l3_main__emif, 2532 &am33xx_l3_main__emif,
2485 &am33xx_mpu__l3_main, 2533 &am33xx_mpu__l3_main,
@@ -2559,6 +2607,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
2559 &am33xx_cpgmac0__mdio, 2607 &am33xx_cpgmac0__mdio,
2560 &am33xx_l3_main__sha0, 2608 &am33xx_l3_main__sha0,
2561 &am33xx_l3_main__aes0, 2609 &am33xx_l3_main__aes0,
2610 &am33xx_l4_per__rng,
2562 NULL, 2611 NULL,
2563}; 2612};
2564 2613
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 0c3a427da544..9e56fabd7fa3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3693,6 +3693,53 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__aes = {
3693 .user = OCP_USER_MPU | OCP_USER_SDMA, 3693 .user = OCP_USER_MPU | OCP_USER_SDMA,
3694}; 3694};
3695 3695
3696/*
3697 * 'ssi' class
3698 * synchronous serial interface (multichannel and full-duplex serial if)
3699 */
3700
3701static struct omap_hwmod_class_sysconfig omap34xx_ssi_sysc = {
3702 .rev_offs = 0x0000,
3703 .sysc_offs = 0x0010,
3704 .syss_offs = 0x0014,
3705 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE |
3706 SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
3707 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
3708 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3709 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
3710 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
3711 .sysc_fields = &omap_hwmod_sysc_type1,
3712};
3713
3714static struct omap_hwmod_class omap34xx_ssi_hwmod_class = {
3715 .name = "ssi",
3716 .sysc = &omap34xx_ssi_sysc,
3717};
3718
3719static struct omap_hwmod omap34xx_ssi_hwmod = {
3720 .name = "ssi",
3721 .class = &omap34xx_ssi_hwmod_class,
3722 .clkdm_name = "core_l4_clkdm",
3723 .main_clk = "ssi_ssr_fck",
3724 .prcm = {
3725 .omap2 = {
3726 .prcm_reg_id = 1,
3727 .module_bit = OMAP3430_EN_SSI_SHIFT,
3728 .module_offs = CORE_MOD,
3729 .idlest_reg_id = 1,
3730 .idlest_idle_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT,
3731 },
3732 },
3733};
3734
3735/* L4 CORE -> SSI */
3736static struct omap_hwmod_ocp_if omap34xx_l4_core__ssi = {
3737 .master = &omap3xxx_l4_core_hwmod,
3738 .slave = &omap34xx_ssi_hwmod,
3739 .clk = "ssi_ick",
3740 .user = OCP_USER_MPU | OCP_USER_SDMA,
3741};
3742
3696static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = { 3743static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
3697 &omap3xxx_l3_main__l4_core, 3744 &omap3xxx_l3_main__l4_core,
3698 &omap3xxx_l3_main__l4_per, 3745 &omap3xxx_l3_main__l4_per,
@@ -3818,6 +3865,7 @@ static struct omap_hwmod_ocp_if *omap34xx_hwmod_ocp_ifs[] __initdata = {
3818#ifdef CONFIG_OMAP_IOMMU_IVA2 3865#ifdef CONFIG_OMAP_IOMMU_IVA2
3819 &omap3xxx_l3_main__mmu_iva, 3866 &omap3xxx_l3_main__mmu_iva,
3820#endif 3867#endif
3868 &omap34xx_l4_core__ssi,
3821 NULL 3869 NULL
3822}; 3870};
3823 3871
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 9c3b504477d7..1e5b12cb8246 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -914,7 +914,7 @@ static struct omap_hwmod omap44xx_emif1_hwmod = {
914 .name = "emif1", 914 .name = "emif1",
915 .class = &omap44xx_emif_hwmod_class, 915 .class = &omap44xx_emif_hwmod_class,
916 .clkdm_name = "l3_emif_clkdm", 916 .clkdm_name = "l3_emif_clkdm",
917 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 917 .flags = HWMOD_INIT_NO_IDLE,
918 .main_clk = "ddrphy_ck", 918 .main_clk = "ddrphy_ck",
919 .prcm = { 919 .prcm = {
920 .omap4 = { 920 .omap4 = {
@@ -930,7 +930,7 @@ static struct omap_hwmod omap44xx_emif2_hwmod = {
930 .name = "emif2", 930 .name = "emif2",
931 .class = &omap44xx_emif_hwmod_class, 931 .class = &omap44xx_emif_hwmod_class,
932 .clkdm_name = "l3_emif_clkdm", 932 .clkdm_name = "l3_emif_clkdm",
933 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 933 .flags = HWMOD_INIT_NO_IDLE,
934 .main_clk = "ddrphy_ck", 934 .main_clk = "ddrphy_ck",
935 .prcm = { 935 .prcm = {
936 .omap4 = { 936 .omap4 = {
@@ -2193,7 +2193,7 @@ static struct omap_hwmod omap44xx_mpu_hwmod = {
2193 .name = "mpu", 2193 .name = "mpu",
2194 .class = &omap44xx_mpu_hwmod_class, 2194 .class = &omap44xx_mpu_hwmod_class,
2195 .clkdm_name = "mpuss_clkdm", 2195 .clkdm_name = "mpuss_clkdm",
2196 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 2196 .flags = HWMOD_INIT_NO_IDLE,
2197 .main_clk = "dpll_mpu_m2_ck", 2197 .main_clk = "dpll_mpu_m2_ck",
2198 .prcm = { 2198 .prcm = {
2199 .omap4 = { 2199 .omap4 = {
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index cde415570e04..68a78ef1cbf3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -352,7 +352,7 @@ static struct omap_hwmod omap54xx_emif1_hwmod = {
352 .name = "emif1", 352 .name = "emif1",
353 .class = &omap54xx_emif_hwmod_class, 353 .class = &omap54xx_emif_hwmod_class,
354 .clkdm_name = "emif_clkdm", 354 .clkdm_name = "emif_clkdm",
355 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 355 .flags = HWMOD_INIT_NO_IDLE,
356 .main_clk = "dpll_core_h11x2_ck", 356 .main_clk = "dpll_core_h11x2_ck",
357 .prcm = { 357 .prcm = {
358 .omap4 = { 358 .omap4 = {
@@ -368,7 +368,7 @@ static struct omap_hwmod omap54xx_emif2_hwmod = {
368 .name = "emif2", 368 .name = "emif2",
369 .class = &omap54xx_emif_hwmod_class, 369 .class = &omap54xx_emif_hwmod_class,
370 .clkdm_name = "emif_clkdm", 370 .clkdm_name = "emif_clkdm",
371 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 371 .flags = HWMOD_INIT_NO_IDLE,
372 .main_clk = "dpll_core_h11x2_ck", 372 .main_clk = "dpll_core_h11x2_ck",
373 .prcm = { 373 .prcm = {
374 .omap4 = { 374 .omap4 = {
@@ -1135,7 +1135,7 @@ static struct omap_hwmod omap54xx_mpu_hwmod = {
1135 .name = "mpu", 1135 .name = "mpu",
1136 .class = &omap54xx_mpu_hwmod_class, 1136 .class = &omap54xx_mpu_hwmod_class,
1137 .clkdm_name = "mpu_clkdm", 1137 .clkdm_name = "mpu_clkdm",
1138 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 1138 .flags = HWMOD_INIT_NO_IDLE,
1139 .main_clk = "dpll_mpu_m2_ck", 1139 .main_clk = "dpll_mpu_m2_ck",
1140 .prcm = { 1140 .prcm = {
1141 .omap4 = { 1141 .omap4 = {
@@ -1146,6 +1146,41 @@ static struct omap_hwmod omap54xx_mpu_hwmod = {
1146}; 1146};
1147 1147
1148/* 1148/*
1149 * 'spinlock' class
1150 * spinlock provides hardware assistance for synchronizing the processes
1151 * running on multiple processors
1152 */
1153
1154static struct omap_hwmod_class_sysconfig omap54xx_spinlock_sysc = {
1155 .rev_offs = 0x0000,
1156 .sysc_offs = 0x0010,
1157 .syss_offs = 0x0014,
1158 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1159 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1160 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1161 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1162 .sysc_fields = &omap_hwmod_sysc_type1,
1163};
1164
1165static struct omap_hwmod_class omap54xx_spinlock_hwmod_class = {
1166 .name = "spinlock",
1167 .sysc = &omap54xx_spinlock_sysc,
1168};
1169
1170/* spinlock */
1171static struct omap_hwmod omap54xx_spinlock_hwmod = {
1172 .name = "spinlock",
1173 .class = &omap54xx_spinlock_hwmod_class,
1174 .clkdm_name = "l4cfg_clkdm",
1175 .prcm = {
1176 .omap4 = {
1177 .clkctrl_offs = OMAP54XX_CM_L4CFG_SPINLOCK_CLKCTRL_OFFSET,
1178 .context_offs = OMAP54XX_RM_L4CFG_SPINLOCK_CONTEXT_OFFSET,
1179 },
1180 },
1181};
1182
1183/*
1149 * 'timer' class 1184 * 'timer' class
1150 * general purpose timer module with accurate 1ms tick 1185 * general purpose timer module with accurate 1ms tick
1151 * This class contains several variants: ['timer_1ms', 'timer'] 1186 * This class contains several variants: ['timer_1ms', 'timer']
@@ -1465,6 +1500,123 @@ static struct omap_hwmod omap54xx_uart6_hwmod = {
1465}; 1500};
1466 1501
1467/* 1502/*
1503 * 'usb_host_hs' class
1504 * high-speed multi-port usb host controller
1505 */
1506
1507static struct omap_hwmod_class_sysconfig omap54xx_usb_host_hs_sysc = {
1508 .rev_offs = 0x0000,
1509 .sysc_offs = 0x0010,
1510 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
1511 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
1512 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1513 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
1514 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
1515 .sysc_fields = &omap_hwmod_sysc_type2,
1516};
1517
1518static struct omap_hwmod_class omap54xx_usb_host_hs_hwmod_class = {
1519 .name = "usb_host_hs",
1520 .sysc = &omap54xx_usb_host_hs_sysc,
1521};
1522
1523static struct omap_hwmod omap54xx_usb_host_hs_hwmod = {
1524 .name = "usb_host_hs",
1525 .class = &omap54xx_usb_host_hs_hwmod_class,
1526 .clkdm_name = "l3init_clkdm",
1527 /*
1528 * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
1529 * id: i660
1530 *
1531 * Description:
1532 * In the following configuration :
1533 * - USBHOST module is set to smart-idle mode
1534 * - PRCM asserts idle_req to the USBHOST module ( This typically
1535 * happens when the system is going to a low power mode : all ports
1536 * have been suspended, the master part of the USBHOST module has
1537 * entered the standby state, and SW has cut the functional clocks)
1538 * - an USBHOST interrupt occurs before the module is able to answer
1539 * idle_ack, typically a remote wakeup IRQ.
1540 * Then the USB HOST module will enter a deadlock situation where it
1541 * is no more accessible nor functional.
1542 *
1543 * Workaround:
1544 * Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE
1545 */
1546
1547 /*
1548 * Errata: USB host EHCI may stall when entering smart-standby mode
1549 * Id: i571
1550 *
1551 * Description:
1552 * When the USBHOST module is set to smart-standby mode, and when it is
1553 * ready to enter the standby state (i.e. all ports are suspended and
1554 * all attached devices are in suspend mode), then it can wrongly assert
1555 * the Mstandby signal too early while there are still some residual OCP
1556 * transactions ongoing. If this condition occurs, the internal state
1557 * machine may go to an undefined state and the USB link may be stuck
1558 * upon the next resume.
1559 *
1560 * Workaround:
1561 * Don't use smart standby; use only force standby,
1562 * hence HWMOD_SWSUP_MSTANDBY
1563 */
1564
1565 /*
1566 * During system boot; If the hwmod framework resets the module
1567 * the module will have smart idle settings; which can lead to deadlock
1568 * (above Errata Id:i660); so, dont reset the module during boot;
1569 * Use HWMOD_INIT_NO_RESET.
1570 */
1571
1572 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
1573 HWMOD_INIT_NO_RESET,
1574 .main_clk = "l3init_60m_fclk",
1575 .prcm = {
1576 .omap4 = {
1577 .clkctrl_offs = OMAP54XX_CM_L3INIT_USB_HOST_HS_CLKCTRL_OFFSET,
1578 .context_offs = OMAP54XX_RM_L3INIT_USB_HOST_HS_CONTEXT_OFFSET,
1579 .modulemode = MODULEMODE_SWCTRL,
1580 },
1581 },
1582};
1583
1584/*
1585 * 'usb_tll_hs' class
1586 * usb_tll_hs module is the adapter on the usb_host_hs ports
1587 */
1588
1589static struct omap_hwmod_class_sysconfig omap54xx_usb_tll_hs_sysc = {
1590 .rev_offs = 0x0000,
1591 .sysc_offs = 0x0010,
1592 .syss_offs = 0x0014,
1593 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1594 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1595 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1596 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1597 .sysc_fields = &omap_hwmod_sysc_type1,
1598};
1599
1600static struct omap_hwmod_class omap54xx_usb_tll_hs_hwmod_class = {
1601 .name = "usb_tll_hs",
1602 .sysc = &omap54xx_usb_tll_hs_sysc,
1603};
1604
1605static struct omap_hwmod omap54xx_usb_tll_hs_hwmod = {
1606 .name = "usb_tll_hs",
1607 .class = &omap54xx_usb_tll_hs_hwmod_class,
1608 .clkdm_name = "l3init_clkdm",
1609 .main_clk = "l4_root_clk_div",
1610 .prcm = {
1611 .omap4 = {
1612 .clkctrl_offs = OMAP54XX_CM_L3INIT_USB_TLL_HS_CLKCTRL_OFFSET,
1613 .context_offs = OMAP54XX_RM_L3INIT_USB_TLL_HS_CONTEXT_OFFSET,
1614 .modulemode = MODULEMODE_HWCTRL,
1615 },
1616 },
1617};
1618
1619/*
1468 * 'usb_otg_ss' class 1620 * 'usb_otg_ss' class
1469 * 2.0 super speed (usb_otg_ss) controller 1621 * 2.0 super speed (usb_otg_ss) controller
1470 */ 1622 */
@@ -1960,6 +2112,14 @@ static struct omap_hwmod_ocp_if omap54xx_l4_cfg__mpu = {
1960 .user = OCP_USER_MPU | OCP_USER_SDMA, 2112 .user = OCP_USER_MPU | OCP_USER_SDMA,
1961}; 2113};
1962 2114
2115/* l4_cfg -> spinlock */
2116static struct omap_hwmod_ocp_if omap54xx_l4_cfg__spinlock = {
2117 .master = &omap54xx_l4_cfg_hwmod,
2118 .slave = &omap54xx_spinlock_hwmod,
2119 .clk = "l4_root_clk_div",
2120 .user = OCP_USER_MPU | OCP_USER_SDMA,
2121};
2122
1963/* l4_wkup -> timer1 */ 2123/* l4_wkup -> timer1 */
1964static struct omap_hwmod_ocp_if omap54xx_l4_wkup__timer1 = { 2124static struct omap_hwmod_ocp_if omap54xx_l4_wkup__timer1 = {
1965 .master = &omap54xx_l4_wkup_hwmod, 2125 .master = &omap54xx_l4_wkup_hwmod,
@@ -2096,6 +2256,22 @@ static struct omap_hwmod_ocp_if omap54xx_l4_per__uart6 = {
2096 .user = OCP_USER_MPU | OCP_USER_SDMA, 2256 .user = OCP_USER_MPU | OCP_USER_SDMA,
2097}; 2257};
2098 2258
2259/* l4_cfg -> usb_host_hs */
2260static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_host_hs = {
2261 .master = &omap54xx_l4_cfg_hwmod,
2262 .slave = &omap54xx_usb_host_hs_hwmod,
2263 .clk = "l3_iclk_div",
2264 .user = OCP_USER_MPU | OCP_USER_SDMA,
2265};
2266
2267/* l4_cfg -> usb_tll_hs */
2268static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_tll_hs = {
2269 .master = &omap54xx_l4_cfg_hwmod,
2270 .slave = &omap54xx_usb_tll_hs_hwmod,
2271 .clk = "l4_root_clk_div",
2272 .user = OCP_USER_MPU | OCP_USER_SDMA,
2273};
2274
2099/* l4_cfg -> usb_otg_ss */ 2275/* l4_cfg -> usb_otg_ss */
2100static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_otg_ss = { 2276static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_otg_ss = {
2101 .master = &omap54xx_l4_cfg_hwmod, 2277 .master = &omap54xx_l4_cfg_hwmod,
@@ -2163,6 +2339,7 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2163 &omap54xx_l4_per__mmc4, 2339 &omap54xx_l4_per__mmc4,
2164 &omap54xx_l4_per__mmc5, 2340 &omap54xx_l4_per__mmc5,
2165 &omap54xx_l4_cfg__mpu, 2341 &omap54xx_l4_cfg__mpu,
2342 &omap54xx_l4_cfg__spinlock,
2166 &omap54xx_l4_wkup__timer1, 2343 &omap54xx_l4_wkup__timer1,
2167 &omap54xx_l4_per__timer2, 2344 &omap54xx_l4_per__timer2,
2168 &omap54xx_l4_per__timer3, 2345 &omap54xx_l4_per__timer3,
@@ -2180,6 +2357,8 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2180 &omap54xx_l4_per__uart4, 2357 &omap54xx_l4_per__uart4,
2181 &omap54xx_l4_per__uart5, 2358 &omap54xx_l4_per__uart5,
2182 &omap54xx_l4_per__uart6, 2359 &omap54xx_l4_per__uart6,
2360 &omap54xx_l4_cfg__usb_host_hs,
2361 &omap54xx_l4_cfg__usb_tll_hs,
2183 &omap54xx_l4_cfg__usb_otg_ss, 2362 &omap54xx_l4_cfg__usb_otg_ss,
2184 &omap54xx_l4_wkup__wd_timer2, 2363 &omap54xx_l4_wkup__wd_timer2,
2185 NULL, 2364 NULL,