Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'omap-fixes-a-for-3.9-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.9-rc3/fixes

Miscellaneous OMAP fixes for v3.9-rc. These primarily deal with OMAP2+ power
management regressions. There's also a fix for the OMAP1 OHCI controller.

Basic build, boot, and PM test logs are at:

http://www.pwsan.com/omap/testlogs/fixes_a_3.9-rc/20130314101856/

+45 -16
+1 -11
arch/arm/mach-omap1/clock_data.c
··· 543 543 /* Direct from ULPD, no parent */ 544 544 .rate = 48000000, 545 545 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG), 546 - .enable_bit = USB_REQ_EN_SHIFT, 547 - }; 548 - 549 - static struct clk usb_dc_ck7xx = { 550 - .name = "usb_dc_ck", 551 - .ops = &clkops_generic, 552 - /* Direct from ULPD, no parent */ 553 - .rate = 48000000, 554 - .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG), 555 546 .enable_bit = SOFT_USB_OTG_DPLL_REQ_SHIFT, 556 547 }; 557 548 ··· 718 727 CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310), 719 728 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310), 720 729 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX), 721 - CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX), 722 - CLK(NULL, "usb_dc_ck", &usb_dc_ck7xx, CK_7XX), 730 + CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX | CK_7XX), 723 731 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310), 724 732 CLK(NULL, "mclk", &mclk_16xx, CK_16XX), 725 733 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310),
+20
arch/arm/mach-omap2/cclock44xx_data.c
··· 52 52 */ 53 53 #define OMAP4_DPLL_ABE_DEFFREQ 98304000 54 54 55 + /* 56 + * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section 57 + * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred 58 + * locked frequency for the USB DPLL is 960MHz. 59 + */ 60 + #define OMAP4_DPLL_USB_DEFFREQ 960000000 61 + 55 62 /* Root clocks */ 56 63 57 64 DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0); ··· 1018 1011 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK, 1019 1012 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops); 1020 1013 1014 + DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0, 1015 + OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, 1016 + OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL); 1017 + 1021 1018 DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0, 1022 1019 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL, 1023 1020 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); ··· 1549 1538 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk, CK_443X), 1550 1539 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk, CK_443X), 1551 1540 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk, CK_443X), 1541 + CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), 1552 1542 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X), 1553 1543 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X), 1554 1544 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X), ··· 1716 1704 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ); 1717 1705 if (rc) 1718 1706 pr_err("%s: failed to configure ABE DPLL!\n", __func__); 1707 + 1708 + /* 1709 + * Lock USB DPLL on OMAP4 devices so that the L3INIT power 1710 + * domain can transition to retention state when not in use. 1711 + */ 1712 + rc = clk_set_rate(&dpll_usb_ck, OMAP4_DPLL_USB_DEFFREQ); 1713 + if (rc) 1714 + pr_err("%s: failed to configure USB DPLL!\n", __func__); 1719 1715 1720 1716 return 0; 1721 1717 }
+5 -2
arch/arm/mach-omap2/omap_hwmod.c
··· 1368 1368 } 1369 1369 1370 1370 if (sf & SYSC_HAS_MIDLEMODE) { 1371 - if (oh->flags & HWMOD_SWSUP_MSTANDBY) { 1371 + if (oh->flags & HWMOD_FORCE_MSTANDBY) { 1372 + idlemode = HWMOD_IDLEMODE_FORCE; 1373 + } else if (oh->flags & HWMOD_SWSUP_MSTANDBY) { 1372 1374 idlemode = HWMOD_IDLEMODE_NO; 1373 1375 } else { 1374 1376 if (sf & SYSC_HAS_ENAWAKEUP) ··· 1442 1440 } 1443 1441 1444 1442 if (sf & SYSC_HAS_MIDLEMODE) { 1445 - if (oh->flags & HWMOD_SWSUP_MSTANDBY) { 1443 + if ((oh->flags & HWMOD_SWSUP_MSTANDBY) || 1444 + (oh->flags & HWMOD_FORCE_MSTANDBY)) { 1446 1445 idlemode = HWMOD_IDLEMODE_FORCE; 1447 1446 } else { 1448 1447 if (sf & SYSC_HAS_ENAWAKEUP)
+7 -2
arch/arm/mach-omap2/omap_hwmod.h
··· 427 427 * 428 428 * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out 429 429 * of idle, rather than relying on module smart-idle 430 - * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out 431 - * of standby, rather than relying on module smart-standby 430 + * HWMOD_SWSUP_MSTANDBY: omap_hwmod code should manually bring module in and 431 + * out of standby, rather than relying on module smart-standby 432 432 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 433 433 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file 434 434 * XXX Should be HWMOD_SETUP_NO_RESET ··· 459 459 * correctly, or this is being abused to deal with some PM latency 460 460 * issues -- but we're currently suffering from a shortage of 461 461 * folks who are able to track these issues down properly. 462 + * HWMOD_FORCE_MSTANDBY: Always keep MIDLEMODE bits cleared so that device 463 + * is kept in force-standby mode. Failing to do so causes PM problems 464 + * with musb on OMAP3630 at least. Note that musb has a dedicated register 465 + * to control MSTANDBY signal when MIDLEMODE is set to force-standby. 462 466 */ 463 467 #define HWMOD_SWSUP_SIDLE (1 << 0) 464 468 #define HWMOD_SWSUP_MSTANDBY (1 << 1) ··· 475 471 #define HWMOD_16BIT_REG (1 << 8) 476 472 #define HWMOD_EXT_OPT_MAIN_CLK (1 << 9) 477 473 #define HWMOD_BLOCK_WFI (1 << 10) 474 + #define HWMOD_FORCE_MSTANDBY (1 << 11) 478 475 479 476 /* 480 477 * omap_hwmod._int_flags definitions
+6 -1
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 1707 1707 * Erratum ID: i479 idle_req / idle_ack mechanism potentially 1708 1708 * broken when autoidle is enabled 1709 1709 * workaround is to disable the autoidle bit at module level. 1710 + * 1711 + * Enabling the device in any other MIDLEMODE setting but force-idle 1712 + * causes core_pwrdm not enter idle states at least on OMAP3630. 1713 + * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY 1714 + * signal when MIDLEMODE is set to force-idle. 1710 1715 */ 1711 1716 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE 1712 - | HWMOD_SWSUP_MSTANDBY, 1717 + | HWMOD_FORCE_MSTANDBY, 1713 1718 }; 1714 1719 1715 1720 /* usb_otg_hs */
+6
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 2714 2714 { } 2715 2715 }; 2716 2716 2717 + static struct omap_hwmod_opt_clk ocp2scp_usb_phy_opt_clks[] = { 2718 + { .role = "48mhz", .clk = "ocp2scp_usb_phy_phy_48m" }, 2719 + }; 2720 + 2717 2721 /* ocp2scp_usb_phy */ 2718 2722 static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { 2719 2723 .name = "ocp2scp_usb_phy", ··· 2732 2728 }, 2733 2729 }, 2734 2730 .dev_attr = ocp2scp_dev_attr, 2731 + .opt_clks = ocp2scp_usb_phy_opt_clks, 2732 + .opt_clks_cnt = ARRAY_SIZE(ocp2scp_usb_phy_opt_clks), 2735 2733 }; 2736 2734 2737 2735 /*