From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
LAK <linux-arm-kernel@lists.infradead.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Dave P Martin <Dave.Martin@arm.com>,
Mark Rutland <Mark.Rutland@arm.com>,
Sudeep Holla <Sudeep.Holla@arm.com>,
Charles Garcia-Tobin <Charles.Garcia-Tobin@arm.com>,
Nicolas Pitre <nico@linaro.org>, Rob Herring <robh+dt@kernel.org>,
Peter De Schrijver <pdeschrijver@nvidia.com>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
Kumar Gala <galak@codeaurora.org>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Mark Hambleton <mark.hambleton@broadcom.com>,
Hanjun Guo <hanjun.guo@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Amit Kucheria <amit.kucheria@linaro.org>,
Antti Miettinen <ananaza@iki.fi>,
Stephen Boyd <sboyd@codeaurora.org>,
Tomasz Figa <t.figa@samsung.com>,
Kevin Hilman <khilman@linaro.org>
Subject: Re: [PATCH RFC v2 2/2] Documentation: arm: define DT C-states bindings
Date: Wed, 22 Jan 2014 19:20:42 +0000 [thread overview]
Message-ID: <20140122192041.GA3709@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAKfTPtAbYXuis1bfyDLiHRaYwosre3RAG+iNQSz-y+cWfc3uQA@mail.gmail.com>
Hi Vincent,
On Tue, Jan 21, 2014 at 11:16:46AM +0000, Vincent Guittot wrote:
> Hi Lorenzo,
>
> On 20 January 2014 18:47, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> wrote:
> > ARM based platforms implement a variety of power management schemes that
> > allow processors to enter at run-time low-power states, aka C-states
> > in ACPI jargon. The parameters defining these C-states vary on a per-platform
> > basis forcing the OS to hardcode the state parameters in platform
> > specific static tables whose size grows as the number of platforms supported
> > in the kernel increases and hampers device drivers standardization.
> >
> > Therefore, this patch aims at standardizing C-state device tree bindings for
> > ARM platforms. Bindings define C-state parameters inclusive of entry methods
> > and state latencies, to allow operating systems to retrieve the
> > configuration entries from the device tree and initialize the related
> > power management drivers, paving the way for common code in the kernel
> > to deal with power states and removing the need for static data in current
> > and previous kernel versions.
> >
> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > ---
> > Documentation/devicetree/bindings/arm/c-states.txt | 774 +++++++++++++++++++++
> > Documentation/devicetree/bindings/arm/cpus.txt | 10 +
> > 2 files changed, 784 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/arm/c-states.txt
> >
> > diff --git a/Documentation/devicetree/bindings/arm/c-states.txt b/Documentation/devicetree/bindings/arm/c-states.txt
> > new file mode 100644
> > index 0000000..0b5617b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/arm/c-states.txt
> > @@ -0,0 +1,774 @@
> > +==========================================
> > +ARM C-states binding description
> > +==========================================
> > +
> > +==========================================
> > +1 - Introduction
> > +==========================================
> > +
> > +ARM systems contain HW capable of managing power consumption dynamically,
> > +where cores can be put in different low-power states (ranging from simple
> > +wfi to power gating) according to OSPM policies. Borrowing concepts
> > +from the ACPI specification[1], the CPU states representing the range of
> > +dynamic states that a processor can enter at run-time, aka C-state, can be
> > +specified through device tree bindings representing the parameters required to
> > +enter/exit specific C-states on a given processor.
> > +
> > +The state an ARM CPU can be put into is loosely identified by one of the
> > +following operating modes:
> > +
> > +- Running:
> > + # Processor core is executing instructions
> > +
> > +- Wait for Interrupt:
> > + # An ARM processor enters wait for interrupt (WFI) low power
> > + state by executing a wfi instruction. When a processor enters
> > + wfi state it disables most of the clocks while keeping the processor
> > + powered up. This state is standard on all ARM processors and it is
> > + defined as C1 in the remainder of this document.
> > +
>
> > +- Dormant:
> > + # Dormant mode is entered by executing wfi instructions and by sending
> > + platform specific commands to the platform power controller (coupled
> > + with processor specific SW/HW control sequences).
> > + In dormant mode, most of the processor control and debug logic is
> > + powered up but cache RAM can be put in retention state, providing
>
> Base on your description, it's not clear for me what is on, what is
> lost and what is power down ?
> My understand of the dormant mode that you described above is : the
> cache is preserved (and especially the cache RAM) but the processor
> state is lost (registers ...). Do I understand correctly ?
>
> What about retention mode where the contents of processor and cache
> are preserved but the power consumption is reduced ? it can be seen as
> a special wfi mode which need specific SW/HW control sequences but i'm
> not sure to understand how to describe such state with your proposal.
I had an idea. To simplify things, I think that one possibility is to
add a parameter to the power domain specifier (platform specific, see
Tomasz bindings):
Documentation/devicetree/bindings/power/power_domain.txt
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-January/224928.html
to represent, when that state is entered the behavior of the power
controller (ie cache RAM retention or cache shutdown or in general any
substate within a power domain). Since it is platform specific, and since
we are able to link caches to the power domain, the power controller will
actually define what happens to the cache when that state is entered
(basically we use the power domain specifier additional parameter to define
a "substate" in that power domain e.g.:
Example:
foo_power_controller {
[...]
/*
* first cell is register index, second one is the state index
* that in turn implies the state behavior - eg cache lost or
* retained
*/
#power-domain-cells = <2>;
};
l1-cache {
[...]
/*
* syntax: power-domains = list of power domain specifiers
<[&power_domain_phandle register-index state],[&power_domain_phandle register-index state]>;
The syntax is defined by the power controller du jour
as described by Tomasz bindings
*/
power-domains =<&foo_power_controller 0 0 &foo_power_controller 0 1>;
}:
and then
state0 {
index = <2>;
compatible = "arm,cpu-power-state";
latency = <...>;
/*
* This means that when the state is entered, the power
* controller should use register index 0 and state 0,
* whose meaning is power controller specific. Since we
* know all components affected (for every component
* we declare its power domain(s) and states so we
* know what components are affected by the state entry.
* Given the cache node above and this phandle, the state
* implies that the cache is retained, register index == 0 state == 0
/*
power-domain =<&foo_power_controller 0 0>;
};
state1 {
index = <3>;
compatible = "arm,cpu-power-state";
latency = <...>;
/*
* This means that when the state is entered, the power
* controller should use register index 0 and state 1,
* whose meaning is power controller specific. Since we
* know all components affected (for every component
* we declare its power domain(s) and states so we
* know what components are affected by the state entry.
* Given the cache node above and this phandle, the state
* implies that the cache is lost, register index == 0 state == 1
/*
power-domain =<&foo_power_controller 0 1>;
};
It is complex but it is probably the cleanest way. And it leaves complexity
to power controller implementations (if managed in the kernel....), which
actually makes sense because it is up to power controller to define the
behavior of certain states.
All in all it is just an idea, feel free to scotch it, it is complex but
we have to sort it out, one way or another.
Vincent, Tomasz, anyone, thoughts ?
Lorenzo
next prev parent reply other threads:[~2014-01-22 19:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-20 17:47 [PATCH RFC v2 0/2] ARM: defining power states DT bindings Lorenzo Pieralisi
2014-01-20 17:47 ` [PATCH RFC v2 1/2] Documentation: arm: add cache " Lorenzo Pieralisi
2014-01-21 11:49 ` Dave Martin
2014-01-21 14:47 ` Lorenzo Pieralisi
[not found] ` <20140121114845.GA2598-M5GwZQ6tE7x5pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2014-01-27 12:58 ` Russell King - ARM Linux
2014-01-27 18:10 ` Lorenzo Pieralisi
2014-01-20 17:47 ` [PATCH RFC v2 2/2] Documentation: arm: define DT C-states bindings Lorenzo Pieralisi
2014-01-21 11:16 ` Vincent Guittot
2014-01-21 13:31 ` Lorenzo Pieralisi
2014-01-21 14:35 ` Amit Kucheria
2014-01-21 15:23 ` Lorenzo Pieralisi
2014-01-22 11:52 ` Mark Brown
2014-01-22 16:23 ` Lorenzo Pieralisi
2014-01-22 18:17 ` Mark Brown
2014-01-22 11:42 ` Mark Brown
2014-01-22 16:33 ` Lorenzo Pieralisi
2014-01-22 18:11 ` Mark Brown
2014-01-22 19:20 ` Lorenzo Pieralisi [this message]
2014-01-24 8:40 ` Vincent Guittot
2014-01-24 17:58 ` Lorenzo Pieralisi
2014-01-28 8:24 ` Vincent Guittot
2014-01-29 12:42 ` Lorenzo Pieralisi
2014-01-25 8:15 ` Antti P Miettinen
2014-01-27 11:41 ` Lorenzo Pieralisi
2014-01-27 12:48 ` Antti P Miettinen
2014-01-27 18:22 ` Lorenzo Pieralisi
-- strict thread matches above, loose matches on Subject: below --
2014-01-27 15:59 Dave Martin
2014-01-29 12:33 ` Lorenzo Pieralisi
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=20140122192041.GA3709@e102568-lin.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.com \
--cc=Charles.Garcia-Tobin@arm.com \
--cc=Dave.Martin@arm.com \
--cc=Mark.Rutland@arm.com \
--cc=Sudeep.Holla@arm.com \
--cc=amit.kucheria@linaro.org \
--cc=ananaza@iki.fi \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=hanjun.guo@linaro.org \
--cc=khilman@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.hambleton@broadcom.com \
--cc=nico@linaro.org \
--cc=pdeschrijver@nvidia.com \
--cc=robh+dt@kernel.org \
--cc=santosh.shilimkar@ti.com \
--cc=sboyd@codeaurora.org \
--cc=t.figa@samsung.com \
--cc=vincent.guittot@linaro.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).