Skip to content

Commit

Permalink
occ: Fix Pstate ordering for P9
Browse files Browse the repository at this point in the history
In P9 the pstate values are positive. They are continuous set of
unsigned integers [0 to +N] where Pmax is 0 and Pmin is N. The
linear ordering of pstates for P9 has changed compared to P8.
P8 has neagtive pstate values advertised as [0 to -N] where Pmax
is 0 and Pmin is -N. This patch adds helper routines to abstract
pstate comparison with pmax and adds sanity pstate limit checks.
This patch also fixes pstate arithmetic by using labs().

Suggested-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
shilpasri authored and stewartsmith committed May 31, 2017
1 parent 41bb3e7 commit 7213b8a
Show file tree
Hide file tree
Showing 3 changed files with 552 additions and 178 deletions.
20 changes: 10 additions & 10 deletions doc/device-tree/ibm,opal/power-mgt.rst
Expand Up @@ -41,8 +41,6 @@ Example:
ibm,cpu-idle-state-flags = <0x11000 0x81003 0x47003>;
ibm,cpu-idle-state-names = "nap", "fastsleep_", "winkle";
ibm,cpu-idle-state-pmicr = <0x0 0x0 0x20 0x0 0x0 0x0>;
ibm,pstate-vdds = <0x5758595a 0x5a5b5c5d 0x5e5e5f60 0x61626263 0x64656566 0x66676768 0x6869696a 0x6a6b6b6c 0x6c6d6d6e 0x6e6f6f70 0x70717272>;
ibm,pstate-vcss = <0x4d4e4f4f 0x50505152 0x52535354 0x55555657 0x57585859 0x59595a5a 0x5a5b5b5c 0x5c5c5d5d 0x5d5e5e5f 0x5f5f6060 0x60616162>;
ibm,pstate-nominal = <0xffffffef>;
ibm,cpu-idle-state-residency-ns = <0x186a0 0x11e1a300 0x3b9aca00>;
ibm,cpu-idle-state-pmicr-mask = <0x0 0x0 0x30 0x0 0x0 0x0>;
Expand Down Expand Up @@ -104,20 +102,22 @@ ibm,pstate-max ibm,pstate-min ibm,pstate-nominal
These properties give the maximum, minimum and nominal pstate values, as an id
specified in the ibm,pstate-ids file.


ibm,pstate-vcss ibm,pstate-vdds
-------------------------------

These properties list a voltage-identifier of each of the pstates listed in
ibm,pstate-ids for the Vcs and Vdd values used for that pstate. Each VID is a
single byte.

ibm,pstate-ultra-turbo ibm,pstate-turbo
---------------------------------------

These properties are added when ultra-turbo(WOF) is enabled. These properties
give the max turbo and max ultra-turbo pstate.

Example:

.. code-block:: dts
power-mgt {
ibm,pstate-core-max = <0x0 0x0 0x0 0x0 0x0 0x0 0x0>;
ibm,pstate-turbo = <0xfffffffb>
ibm,pstate-ultra-turbo = <0x0>;
};
ibm,pstate-core-max
-------------------

Expand Down
38 changes: 38 additions & 0 deletions doc/device-tree/ibm,opal/power-mgt/occ.rst
@@ -0,0 +1,38 @@
ibm,opal/power-mgt/occ device tree entries
==========================================

This node exports the per-chip pstate table properties to kernel.

Example:

.. code-block:: dts
occ@7ffddf8000 {
ibm,pstate-vdds = [45 45 46 46 46 47 48 49 4a 4b 4c 4d 4f 50 51 52 53 54 55 57 58 59 5a 5b 5c 5d 5e 5f 5f 60 61 62 63 64 65 65 66 67 68 69 6a 6a 6b 6c 6d 6e 6f 70 70 71];
ibm,chip-id = <0x1>;
phandle = <0x100003b8>;
ibm,pstate-vcss = [3b 3d 3f 41 42 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 50 51 52 53 54 55 56 56 57 57 58 58 59 59 5a 5a 5b 5b 5c 5c 5d 5d 5e 5e 5f 5f 60 60 61 61 62 62];
reg = <0x7f 0xfddf8000 0xb98>;
};

ibm,chip-id
-----------

This property denotes the ID of chip to which OCC belongs to.

reg
---

This tuple gives the statring address of the OPAL data in HOMER and
the size of the OPAL data.

The top-level /ibm,opal/power-mgt contains :
#size-cells = <1>
#address-cells = <2>

ibm,pstate-vcss ibm,pstate-vdds
-------------------------------

These properties list a voltage-identifier of each of the pstates listed in
ibm,pstate-ids for the Vcs and Vdd values used for that pstate in that chip.
Each VID is a single byte.

0 comments on commit 7213b8a

Please sign in to comment.