Skip to content

Commit d736f64

Browse files
committed
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/
2 parents a937536 + 92702df commit d736f64

File tree

6 files changed

+45
-16
lines changed

6 files changed

+45
-16
lines changed

arch/arm/mach-omap1/clock_data.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,6 @@ static struct clk usb_hhc_ck16xx = {
538538
};
539539

540540
static struct clk usb_dc_ck = {
541-
.name= "usb_dc_ck",
542-
.ops= &clkops_generic,
543-
/* Direct from ULPD, no parent */
544-
.rate= 48000000,
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 = {
550541
.name= "usb_dc_ck",
551542
.ops= &clkops_generic,
552543
/* Direct from ULPD, no parent */
@@ -727,8 +718,7 @@ static struct omap_clk omap_clks[] = {
727718
CLK(NULL,"usb_clko",&usb_clko,CK_16XX | CK_1510 | CK_310),
728719
CLK(NULL,"usb_hhc_ck",&usb_hhc_ck1510, CK_1510 | CK_310),
729720
CLK(NULL,"usb_hhc_ck",&usb_hhc_ck16xx, CK_16XX),
730-
CLK(NULL,"usb_dc_ck",&usb_dc_ck,CK_16XX),
731-
CLK(NULL,"usb_dc_ck",&usb_dc_ck7xx,CK_7XX),
721+
CLK(NULL,"usb_dc_ck",&usb_dc_ck,CK_16XX | CK_7XX),
732722
CLK(NULL,"mclk",&mclk_1510,CK_1510 | CK_310),
733723
CLK(NULL,"mclk",&mclk_16xx,CK_16XX),
734724
CLK(NULL,"bclk",&bclk_1510,CK_1510 | CK_310),

arch/arm/mach-omap2/cclock44xx_data.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
*/
5353
#define OMAP4_DPLL_ABE_DEFFREQ98304000
5454

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_DEFFREQ960000000
61+
5562
/* Root clocks */
5663

5764
DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
@@ -1011,6 +1018,10 @@ DEFINE_CLK_OMAP_MUX(hsmmc2_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
10111018
OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
10121019
hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
10131020

1021+
DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,
1022+
OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1023+
OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);
1024+
10141025
DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
10151026
OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
10161027
OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
@@ -1538,6 +1549,7 @@ static struct omap_clk omap44xx_clks[] = {
15381549
CLK(NULL,"per_mcbsp4_gfclk",&per_mcbsp4_gfclk,CK_443X),
15391550
CLK(NULL,"hsmmc1_fclk",&hsmmc1_fclk,CK_443X),
15401551
CLK(NULL,"hsmmc2_fclk",&hsmmc2_fclk,CK_443X),
1552+
CLK(NULL,"ocp2scp_usb_phy_phy_48m",&ocp2scp_usb_phy_phy_48m,CK_443X),
15411553
CLK(NULL,"sha2md5_fck",&sha2md5_fck,CK_443X),
15421554
CLK(NULL,"slimbus1_fclk_1",&slimbus1_fclk_1,CK_443X),
15431555
CLK(NULL,"slimbus1_fclk_0",&slimbus1_fclk_0,CK_443X),
@@ -1705,5 +1717,13 @@ int __init omap4xxx_clk_init(void)
17051717
if (rc)
17061718
pr_err("%s: failed to configure ABE DPLL!\n", __func__);
17071719

1720+
/*
1721+
* Lock USB DPLL on OMAP4 devices so that the L3INIT power
1722+
* domain can transition to retention state when not in use.
1723+
*/
1724+
rc = clk_set_rate(&dpll_usb_ck, OMAP4_DPLL_USB_DEFFREQ);
1725+
if (rc)
1726+
pr_err("%s: failed to configure USB DPLL!\n", __func__);
1727+
17081728
return 0;
17091729
}

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,9 @@ static void _enable_sysc(struct omap_hwmod *oh)
13681368
}
13691369

13701370
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) {
13721374
idlemode = HWMOD_IDLEMODE_NO;
13731375
} else {
13741376
if (sf & SYSC_HAS_ENAWAKEUP)
@@ -1440,7 +1442,8 @@ static void _idle_sysc(struct omap_hwmod *oh)
14401442
}
14411443

14421444
if (sf & SYSC_HAS_MIDLEMODE) {
1443-
if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
1445+
if ((oh->flags & HWMOD_SWSUP_MSTANDBY) ||
1446+
(oh->flags & HWMOD_FORCE_MSTANDBY)) {
14441447
idlemode = HWMOD_IDLEMODE_FORCE;
14451448
} else {
14461449
if (sf & SYSC_HAS_ENAWAKEUP)

arch/arm/mach-omap2/omap_hwmod.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ struct omap_hwmod_omap4_prcm {
427427
*
428428
* HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
429429
* 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
432432
* HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
433433
* SDRAM controller, etc. XXX probably belongs outside the main hwmod file
434434
* XXX Should be HWMOD_SETUP_NO_RESET
@@ -459,6 +459,10 @@ struct omap_hwmod_omap4_prcm {
459459
* correctly, or this is being abused to deal with some PM latency
460460
* issues -- but we're currently suffering from a shortage of
461461
* 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.
462466
*/
463467
#define HWMOD_SWSUP_SIDLE(1 << 0)
464468
#define HWMOD_SWSUP_MSTANDBY(1 << 1)
@@ -471,6 +475,7 @@ struct omap_hwmod_omap4_prcm {
471475
#define HWMOD_16BIT_REG(1 << 8)
472476
#define HWMOD_EXT_OPT_MAIN_CLK(1 << 9)
473477
#define HWMOD_BLOCK_WFI(1 << 10)
478+
#define HWMOD_FORCE_MSTANDBY(1 << 11)
474479

475480
/*
476481
* omap_hwmod._int_flags definitions

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,9 +1707,14 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
17071707
* Erratum ID: i479 idle_req / idle_ack mechanism potentially
17081708
* broken when autoidle is enabled
17091709
* 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.
17101715
*/
17111716
.flags= HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
1712-
| HWMOD_SWSUP_MSTANDBY,
1717+
| HWMOD_FORCE_MSTANDBY,
17131718
};
17141719

17151720
/* usb_otg_hs */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,6 +2714,10 @@ static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = {
27142714
{ }
27152715
};
27162716

2717+
static struct omap_hwmod_opt_clk ocp2scp_usb_phy_opt_clks[] = {
2718+
{ .role = "48mhz", .clk = "ocp2scp_usb_phy_phy_48m" },
2719+
};
2720+
27172721
/* ocp2scp_usb_phy */
27182722
static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
27192723
.name= "ocp2scp_usb_phy",
@@ -2728,6 +2732,8 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
27282732
},
27292733
},
27302734
.dev_attr= ocp2scp_dev_attr,
2735+
.opt_clks= ocp2scp_usb_phy_opt_clks,
2736+
.opt_clks_cnt= ARRAY_SIZE(ocp2scp_usb_phy_opt_clks),
27312737
};
27322738

27332739
/*

0 commit comments

Comments
 (0)