linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ccross@google.com (Colin Cross)
To: linux-arm-kernel@lists.infradead.org
Subject: Common clock and dvfs
Date: Fri, 22 Apr 2011 11:15:34 -0700	[thread overview]
Message-ID: <BANLkTimVXbp1pFsGPcs-RPY+PTOF6ZRyoQ@mail.gmail.com> (raw)

Now that we are approaching a common clock management implementation,
I was thinking it might be the right place to put a common dvfs
implementation as well.

It is very common for SoC manufacturers to provide a table of the
minimum voltage required on a voltage rail for a clock to run at a
given frequency.  There may be multiple clocks in a voltage rail that
each can specify their own minimum voltage, and one clock may affect
multiple voltage rails.  I have seen two ways to handle keeping the
clocks and voltages within spec:

The Tegra way is to put everything dvfs related under the clock
framework.  Enabling (or preparing, in the new clock world) or raising
the frequency calls dvfs_set_rate before touching the clock, which
looks up the required voltage on a voltage rail, aggregates it with
the other voltage requests, and passes the minimum voltage required to
the regulator api.  Disabling or unpreparing, or lowering the
frequency changes the clock first, and then calls dvfs_set_rate.  For
a generic implementation, an SoC would provide the clock/dvfs
framework with a list of clocks, the voltages required for each
frequency step on the clock, and the regulator name to change.  The
frequency/voltage tables are similar to OPP, except that OPP gets
voltages for a device instead of a clock.  In a few odd cases (Tegra
always has a few odd cases), a clock that is internal to a device and
not exposed to the clock framework (pclk output on the display, for
example) has a voltage requirement, which requires some devices to
manually call dvfs_set_rate directly, but with a common clock
framework it would probably be possible for the display driver to
export pclk as a real clock.

The proposed OMAP4 way (I believe, correct me if I am wrong) is to
create a new api outside the clock api that calls into both the clock
api and the regulator api in the correct order for each operation,
using OPP to determine the voltage.  This has a few disadvantages
(obviously, I am biased, having written the Tegra code) - clocks and
voltages are tied to a device, which is not always the case for
platforms outside of OMAP, and drivers must know if their hardware
requires voltage scaling.  The clock api becomes unsafe to use on any
device that requires dvfs, as it could change the frequency higher
than the supported voltage.

Is the clock api the right place to do dvfs, or should the clock api
be kept simple, and more complicated operations like dvfs be kept
outside?

             reply	other threads:[~2011-04-22 18:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 18:15 Colin Cross [this message]
2011-04-22 19:37 ` Common clock and dvfs Thomas Gleixner
2011-04-23  1:21   ` Saravana Kannan
2011-04-23  1:35     ` Saravana Kannan
2011-04-23 13:14     ` Thomas Gleixner
2011-04-22 19:40 ` Mark Brown
2011-04-22 19:48   ` Colin Cross
2011-04-22 20:35     ` Mark Brown
2011-04-22 21:18       ` Colin Cross
2011-04-25 11:03         ` Mark Brown
2011-04-25  8:33 ` Paul Walmsley
2011-04-25 18:26   ` Turquette, Mike
     [not found] <4DC07F10.6010305@ti.com>
2011-05-05  5:08 ` Cousson, Benoit
2011-05-05  6:11   ` Colin Cross
2011-05-05  6:35     ` Paul Walmsley
2011-05-05  6:50       ` Colin Cross
2011-05-05 13:59         ` Mark Brown
2011-05-05 21:08     ` Cousson, Benoit
2011-05-05 23:15       ` Colin Cross
2011-05-06 17:36         ` Paul Walmsley
2011-05-06  8:13       ` MyungJoo Ham
2011-05-05  6:25   ` Paul Walmsley

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=BANLkTimVXbp1pFsGPcs-RPY+PTOF6ZRyoQ@mail.gmail.com \
    --to=ccross@google.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).