devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH RFC v2 2/2] Documentation: arm: define DT C-states bindings
@ 2014-01-27 15:59 Dave Martin
  2014-01-29 12:33 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 22+ messages in thread
From: Dave Martin @ 2014-01-27 15:59 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Vincent Guittot, Mark Rutland, devicetree@vger.kernel.org,
	Daniel Lezcano, Kevin Hilman, linux-pm@vger.kernel.org,
	Peter De Schrijver, Nicolas Pitre, Stephen Boyd, Antti Miettinen,
	Amit Kucheria, Tomasz Figa, Rob Herring, Santosh Shilimkar,
	Hanjun Guo, Mark Hambleton, Sudeep Holla, grant.likely@linaro.org,
	Kumar Gala, LAK, Charles Garcia-Tobin <Charles.Garcia-Tobin@

On Fri, Jan 24, 2014 at 05:58:07PM +0000, Lorenzo Pieralisi wrote:
> Hi Vincent,
> 
> On Fri, Jan 24, 2014 at 08:40:40AM +0000, Vincent Guittot wrote:
> 
> [...]
> 
> > Hi Lorenzo,
> > 
> > Sorry for the late reply,
> > 
> > 
> > > 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):
> > 
> > We can't use a simple boolean state (on/off) for defining the
> > powerdomain state associated to a c-state so your proposal of being
> > able to add a parameter that will define the power domain state is
> > interesting.
> > 
> > >
> > > 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>;
> > 
> > Normally, power-domains describes a list of power domain specifiers
> > that are necessary for the l1-cache to at least retain its state so
> > i'm not sure understand your example above
> 
> > 
> > If we take the example of system that support running, retention and
> > powerdown state described as state 0, 1 and 2 for the power domain, i
> > would have set the l1-cache like:
> >        power-domains =<&foo_power_controller 0 1>;
> > 
> > for saying that the state is retained up to state 1
> > 
> > Please look below, i have modified the rest of your example accordingly
> > 
> > >
> > > }:
> > >
> > > 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>;
> > 
> > for retention state we need to set the power domain in state 1
> >         power-domain =<&foo_power_controller 0 1>;

The name "power-domain" probably needs changing if the specifier contains
state information too.

Instead, we could call it "power-state" or similar.


Key issues I see:

1) How to describe platforms where there is no "power controller" as such,
   just a bunch of clocks and regulators that Linux has to poke directly.

2) Two devices might have the same power controller (in terms of IP and
   revision), but integrated in different ways.  So, maybe thinking of
   the referenced thing as a power controller is not correct.  We can
   thing in terms of referring to individual power domains, or maybe
   to a "power model" for the SoC.

   The power domain or model becomes a container for power (domains and)
   states, and refers to the IP blocks (power controllers, regulators,
   clocks, clamps, whatever) required to implement it.

   This change of abstraction might map more naturally onto "bunch
   of clocks and regulators" situations: the power model or domain
   binding can make symbolic references to clocks and regulators etc.,
   so that the binding becomes less dependent on the exact content of
   the rest of the DT.

3) We need to be very clear that the power state specifier needs to be
   defined in terms of the actual hardware effects in the relevant SoC-
   specific binding -- at the "what" level, rather than "how".

   There's a fair chance of people getting lazy: they'll just stuff
   indices in the DT which map to random LUTs in the Linux driver.  In
   that case, the DT would be describing the Linux driver, not the
   hardware -- that's not what we want.

   Delegating the job of defining power states to the SoC documentation
   seems acceptable, though.


Cheers
---Dave

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH RFC v2 0/2] ARM: defining power states DT bindings
@ 2014-01-20 17:47 Lorenzo Pieralisi
  2014-01-20 17:47 ` [PATCH RFC v2 2/2] Documentation: arm: define DT C-states bindings Lorenzo Pieralisi
  0 siblings, 1 reply; 22+ messages in thread
From: Lorenzo Pieralisi @ 2014-01-20 17:47 UTC (permalink / raw)
  To: devicetree
  Cc: linux-arm-kernel, linux-pm, Lorenzo Pieralisi, Dave Martin,
	Mark Rutland, Sudeep Holla, Charles Garcia Tobin, Nicolas Pitre,
	Rob Herring, Peter De Schrijver, Grant Likely, Kumar Gala,
	Santosh Shilimkar, Mark Hambleton, Hanjun Guo, Daniel Lezcano,
	Amit Kucheria, Vincent Guittot, Antti Miettinen, Stephen Boyd,
	Tomasz Figa, Kevin Hilman

This is v2 of a previous posting:

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-December/215544.html

This patchset depends on the following bindings to be approved and augmented
to cater for hierarchical power domains in DT:

http://lists.infradead.org/pipermail/linux-arm-kernel/2014-January/224928.html

Changes in v2:

- Updated cache bindings according to review
- Added power domain phandle to cache bindings
- Added power domains to C-states bindings
- Removed useless reg property from C-states bindings
- Removed cpu-map references from C-states bindings
- Added dependency on OPP in C-states parameters
- Added C-state state hierarchy

ARM based systems embed power management HW that allows SW to enter
low-power states according to run-time criteria based on parameters (eg
power state entry/exit latency) that define how a power state has to be
managed and its respective properties. ARM partners implement HW power
management schemes through custom HW, with power controllers and relative
control mechanisms differing on both HW implementations and the way SW can
control them. This differentiation forces PM software in the kernel to cope
with states differences in power management drivers, which cause code
fragmentation and duplication of functionality.

Most of the power control scheme HW parameters are not probeable on ARM
platforms from a SW point of view, hence, in order to tackle the drivers
fragmentation problem, this patch series defines device tree bindings to
describe power states parameters on ARM platforms.

Device tree bindings for power states also require the introduction of device
tree bindings for processor caches, since power states entry/exit require
SW cache maintainance; in some ARM systems, where firmware does not
support power down interfaces, cache maintainance must be carried out in the
OS power management layer, which then requires a description of the cache
topology through device tree nodes.

The power states on ARM are described as "C-states" in this patchset,
borrowing the nomenclature from ACPI power states bindings which have by now
been widely adopted on both x86 and ARM world as power states names.

C-states device tree standardization shares most of the concepts and
definitions with the ongoing ACPI ARM C-state bindings proposal so that
both standards can contain a coherent set of parameters, simplifying the
way SW will have to handle the respective device drivers.

Lorenzo Pieralisi (2):
  Documentation: arm: add cache DT bindings
  Documentation: arm: define DT C-states bindings

 Documentation/devicetree/bindings/arm/c-states.txt | 774 +++++++++++++++++++++
 Documentation/devicetree/bindings/arm/cache.txt    | 187 +++++
 Documentation/devicetree/bindings/arm/cpus.txt     |  10 +
 3 files changed, 971 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/c-states.txt
 create mode 100644 Documentation/devicetree/bindings/arm/cache.txt

-- 
1.8.4



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-01-29 12:42 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 15:59 [PATCH RFC v2 2/2] Documentation: arm: define DT C-states bindings Dave Martin
2014-01-29 12:33 ` Lorenzo Pieralisi
  -- strict thread matches above, loose matches on Subject: below --
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 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
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

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).