diff mbox

[U-Boot,1/2] OMAP4: clocks-common: prevent USB DPLL from being stuck in running state

Message ID 1340280130.2059.43.camel@sokoban
State Not Applicable
Delegated to: Tom Rini
Headers show

Commit Message

Tero Kristo June 21, 2012, 12:02 p.m. UTC
On Thu, 2012-06-21 at 14:18 +0300, Roger Quadros wrote:
> On 06/21/2012 01:51 PM, R, Sricharan wrote:
> > Hi Roger,
> > 
> >>>> If board config does not select CONFIG_USB_EHCI_OMAP (e.g. omap4_sdp4430_config)
> >>>> then the USB DPLL is stuck in running state and it prevents the system from
> >>>> entering OFF mode (i.e. l3init domain is kept ON).
> >>>>
> >>>> With this patch we unconditionally configure the USB DPLL so it functions
> >>>> properly even on boards not using CONFIG_USB_EHCI_OMAP
> >>>>
> >>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
> >>>> ---
> >>>>  arch/arm/cpu/armv7/omap-common/clocks-common.c |    4 ----
> >>>>  1 files changed, 0 insertions(+), 4 deletions(-)
> >>>>
> >>>> diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
> >>>> index 10d286a..206f0ab 100644
> >>>> --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
> >>>> +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
> >>>> @@ -256,7 +256,6 @@ void configure_mpu_dpll(void)
> >>>>        debug("MPU DPLL locked\n");
> >>>>  }
> >>>>
> >>>> -#ifdef CONFIG_USB_EHCI_OMAP
> >>>>  static void setup_usb_dpll(void)
> >>>>  {
> >>>>        const struct dpll_params *params;
> >>>> @@ -283,7 +282,6 @@ static void setup_usb_dpll(void)
> >>>>        /* Now setup the dpll with the regular function */
> >>>>        do_setup_dpll(&prcm->cm_clkmode_dpll_usb, params, DPLL_LOCK, "usb");
> >>>>  }
> >>>> -#endif
> >>>>
> >>>>  static void setup_dplls(void)
> >>>>  {
> >>>> @@ -317,9 +315,7 @@ static void setup_dplls(void)
> >>>>        /* MPU dpll */
> >>>>        configure_mpu_dpll();
> >>>>
> >>>> -#ifdef CONFIG_USB_EHCI_OMAP
> >>>>        setup_usb_dpll();
> >>>> -#endif
> >>>>  }
> >>>    I remember that this change was introduced recently to configure the USB dpll
> >>>    only when host functionality is used at u-boot level.
> >>>    Now in our case why is kernel dependent upon the boot loader settings ?.
> >>>
> >>
> >> I'm not sure.
> >>
> >> How was it earlier? Was the USB DPLL always configured or never configured?
> > 
> >   Previously all dplls, clocks, mux was configured by u-boot, but that
> > should not be the
> >  case any more.
> > 
> >   The point is u-boot should configure only things required for its
> > functionality
> >   and to start the kernel boot, but nothing more than that.
> >
> 
> I agree with you that kernel should not depend on what the bootloader
> did or not.
> 
> With respect to this USB DPLL problem, i'm not sure what must be done.
> 
> Are we missing something in the kernel? Tero, what do you think?

I just crafted a quick and dirty patch for the kernel which fixes the
issue on that side. I'll add some version of this patch to my next
version of retention support set, however attached here for you to try
out and see if it helps you.

-Tero
diff mbox

Patch

From 5e8e96c557317b0d57790479f013ad1c01df6794 Mon Sep 17 00:00:00 2001
From: Tero Kristo <t-kristo@ti.com>
Date: Thu, 21 Jun 2012 14:56:40 +0300
Subject: [PATCH] ARM: OMAP4: clock: setup USB DPLL during init

The reset setup for USB DPLL does not allow idle, thus the kernel must
program it during init. This puts the USB DPLL in locked mode, autoidle
for it is enabled automatically later during the boot sequence.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/mach-omap2/clock44xx_data.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index e2b701e..e28950a 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3413,6 +3413,7 @@  int __init omap4xxx_clk_init(void)
 {
 	struct omap_clk *c;
 	u32 cpu_clkflg;
+	struct clk *dpll_usb;
 
 	if (cpu_is_omap443x()) {
 		cpu_mask = RATE_IN_4430;
@@ -3456,5 +3457,12 @@  int __init omap4xxx_clk_init(void)
 	 */
 	clk_enable_init_clocks();
 
+	/*
+	 * Setup USB DPLL
+	 */
+	dpll_usb = clk_get(NULL, "dpll_usb_ck");
+
+	clk_set_rate(dpll_usb, 960000000);
+
 	return 0;
 }
-- 
1.7.4.1