All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
To: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
Cc: Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 4/5 V2] ARM: tegra: paz00: add clocks required for usb operation
Date: Tue, 9 Aug 2011 12:24:35 -0700	[thread overview]
Message-ID: <CAOesGMgGJM5v5dOruOAJLqNg8Geu-BtvSoyBSdgnZU-nu94aDQ@mail.gmail.com> (raw)
In-Reply-To: <201108092118.43724.marvin24-Mmb7MZpHnFY@public.gmane.org>

On Tue, Aug 9, 2011 at 12:18 PM, Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote:
> Hi Olof,
>
> On Tuesday 09 August 2011 20:30:47 Olof Johansson wrote:
>> On Tue, Aug 9, 2011 at 11:29 AM, Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote:
>> >
>> > These clocks are required for usb operation.
>> > ---
>> >  arch/arm/mach-tegra/board-paz00.c |    6 ++++++
>> >  1 files changed, 6 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-
> paz00.c
>> > index 45111f6..89a3dda 100644
>> > --- a/arch/arm/mach-tegra/board-paz00.c
>> > +++ b/arch/arm/mach-tegra/board-paz00.c
>> > @@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_table
> paz00_clk_init_table[] = {
>> >        /* name         parent          rate            enabled */
>> >        { "uarta",      "pll_p",        216000000,      true },
>> >        { "uartd",      "pll_p",        216000000,      true },
>> > +
>> > +       { "pll_p_out4", "pll_p",        24000000,       true },
>> > +       { "usbd",       "clk_m",        12000000,       true },
>> > +       { "usb2",       "clk_m",        12000000,       true },
>> > +       { "usb3",       "clk_m",        12000000,       true },
>>
>> Do they all have to be enabled here? Setting the parent and rate makes
>> sense, but you shouldn't have to enable them.
>
> usb also works with all three usb* clocks set to disabled (they are even not
> required to be listed there at all). Honestly, the whole clock setup is a little
> obscure to me.
>
> Can these clocks be safly disabled in the clock table and hope that the ehci
> host driver will enable them if required? Also independent to what the
> bootloader does, which I don't know? I'm asking because we may switch from the
> proprietary bootloader (fastboot?) to u-boot in the near future.


In general, the platform code needs to setup the parent/child
relationships, and in most cases the clock rates. But the individual
drivers will disable and enable clocks as needed. If you set them to
'true' in the table, that last enable will never be disabled, so the
clock will never be off. That might be suboptimal from a power
consumption point of view for your platform.

Unfortunately, u-boot does very little clock setup so the kernel has
to be able to do most of it. Fastboot is better at it, in some sense
of the word. We used to have some very large clock setup tables in the
chromeos board files, but we have recently pruned out most of it and
cut back to the bare minimum.

Note that you might have some issues with autosuspend and detecting
hotplugs, we have a chromeos patch for it that I should post sometime
soon.


-Olof

WARNING: multiple messages have this Message-ID (diff)
From: olof@lixom.net (Olof Johansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5 V2] ARM: tegra: paz00: add clocks required for usb operation
Date: Tue, 9 Aug 2011 12:24:35 -0700	[thread overview]
Message-ID: <CAOesGMgGJM5v5dOruOAJLqNg8Geu-BtvSoyBSdgnZU-nu94aDQ@mail.gmail.com> (raw)
In-Reply-To: <201108092118.43724.marvin24@gmx.de>

On Tue, Aug 9, 2011 at 12:18 PM, Marc Dietrich <marvin24@gmx.de> wrote:
> Hi Olof,
>
> On Tuesday 09 August 2011 20:30:47 Olof Johansson wrote:
>> On Tue, Aug 9, 2011 at 11:29 AM, Marc Dietrich <marvin24@gmx.de> wrote:
>> >
>> > These clocks are required for usb operation.
>> > ---
>> > ?arch/arm/mach-tegra/board-paz00.c | ? ?6 ++++++
>> > ?1 files changed, 6 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-
> paz00.c
>> > index 45111f6..89a3dda 100644
>> > --- a/arch/arm/mach-tegra/board-paz00.c
>> > +++ b/arch/arm/mach-tegra/board-paz00.c
>> > @@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_table
> paz00_clk_init_table[] = {
>> > ? ? ? ?/* name ? ? ? ? parent ? ? ? ? ?rate ? ? ? ? ? ?enabled */
>> > ? ? ? ?{ "uarta", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true },
>> > ? ? ? ?{ "uartd", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true },
>> > +
>> > + ? ? ? { "pll_p_out4", "pll_p", ? ? ? ?24000000, ? ? ? true },
>> > + ? ? ? { "usbd", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
>> > + ? ? ? { "usb2", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
>> > + ? ? ? { "usb3", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
>>
>> Do they all have to be enabled here? Setting the parent and rate makes
>> sense, but you shouldn't have to enable them.
>
> usb also works with all three usb* clocks set to disabled (they are even not
> required to be listed there at all). Honestly, the whole clock setup is a little
> obscure to me.
>
> Can these clocks be safly disabled in the clock table and hope that the ehci
> host driver will enable them if required? Also independent to what the
> bootloader does, which I don't know? I'm asking because we may switch from the
> proprietary bootloader (fastboot?) to u-boot in the near future.


In general, the platform code needs to setup the parent/child
relationships, and in most cases the clock rates. But the individual
drivers will disable and enable clocks as needed. If you set them to
'true' in the table, that last enable will never be disabled, so the
clock will never be off. That might be suboptimal from a power
consumption point of view for your platform.

Unfortunately, u-boot does very little clock setup so the kernel has
to be able to do most of it. Fastboot is better at it, in some sense
of the word. We used to have some very large clock setup tables in the
chromeos board files, but we have recently pruned out most of it and
cut back to the bare minimum.

Note that you might have some issues with autosuspend and detecting
hotplugs, we have a chromeos patch for it that I should post sometime
soon.


-Olof

  parent reply	other threads:[~2011-08-09 19:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-07 19:00 [PATCH 0/5] ARM: tegra: paz00: updates for "for-next" Marc Dietrich
2011-08-07 19:00 ` Marc Dietrich
     [not found] ` <cover.1312742856.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
     [not found]   ` <cover.1312735430.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
2011-08-07 19:00     ` [PATCH 1/5] ARM: tegra: paz00: add support serial port on JP1 Marc Dietrich
2011-08-07 19:00       ` Marc Dietrich
2011-08-07 19:00     ` [PATCH 2/5] ARM: tegra: paz00: enable rfkill for internal wifi card Marc Dietrich
2011-08-07 19:00       ` Marc Dietrich
2011-08-07 19:00     ` [PATCH 3/5] ARM: tegra: paz00: enable wifi led Marc Dietrich
2011-08-07 19:00       ` Marc Dietrich
2011-08-07 19:00     ` [PATCH 4/5] ARM: tegra: paz00: add clocks required for usb operation Marc Dietrich
2011-08-07 19:00       ` Marc Dietrich
     [not found]       ` <76f31183766f1edce1230a925ced1c986dbdf028.1312742856.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
2011-08-08 16:57         ` Stephen Warren
2011-08-08 16:57           ` Stephen Warren
2011-08-08 17:18           ` [PATCH 4/5] ARM: tegra: paz00: add clocks required for usboperation Marc Dietrich
2011-08-08 17:18             ` Marc Dietrich
     [not found]             ` <201108081919.07647.marc.dietrich-wkdnK3oF/XPYtB+G+YtuwQgYPMzSbZxj@public.gmane.org>
2011-08-08 17:38               ` Stephen Warren
2011-08-08 17:38                 ` Stephen Warren
     [not found]                 ` <74CDBE0F657A3D45AFBB94109FB122FF049F1721DE-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-08-08 21:15                   ` [PATCH 4/5] ARM: tegra: paz00: add clocks required forusboperation Marc Dietrich
2011-08-08 21:15                     ` Marc Dietrich
2011-08-09 18:29         ` [PATCH 4/5 V2] ARM: tegra: paz00: add clocks required for usb operation Marc Dietrich
2011-08-09 18:29           ` Marc Dietrich
     [not found]           ` <201108092029.17546.marvin24-Mmb7MZpHnFY@public.gmane.org>
2011-08-09 18:30             ` Olof Johansson
2011-08-09 18:30               ` Olof Johansson
     [not found]               ` <CAOesGMiV-jrcGFUXBf=5H__-gXvwgxUias7WGouYTvAy+k=oMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-09 19:18                 ` Marc Dietrich
2011-08-09 19:18                   ` Marc Dietrich
     [not found]                   ` <201108092118.43724.marvin24-Mmb7MZpHnFY@public.gmane.org>
2011-08-09 19:24                     ` Olof Johansson [this message]
2011-08-09 19:24                       ` Olof Johansson
2011-08-09 18:35             ` Stephen Warren
2011-08-09 18:35               ` Stephen Warren
2011-08-07 19:00     ` [PATCH 5/5] ARM: tegra: paz00: reorder the SDHCI channel init Marc Dietrich
2011-08-07 19:00       ` Marc Dietrich
2011-08-09 19:35     ` [PATCH 0/5] ARM: tegra: paz00: updates for "for-next" Olof Johansson
2011-08-09 19:35       ` Olof Johansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOesGMgGJM5v5dOruOAJLqNg8Geu-BtvSoyBSdgnZU-nu94aDQ@mail.gmail.com \
    --to=olof-nzht3qvonbneowh0uzbu5w@public.gmane.org \
    --cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marvin24-Mmb7MZpHnFY@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.