[Skiboot] [PATCH 2/3] Set occ functional field only when ibm, occ-functional-state property exist.

ppaidipe at linux.vnet.ibm.com ppaidipe at linux.vnet.ibm.com
Mon Nov 14 15:53:26 AEDT 2016

From: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>

Currently chip->occ_functional data field set's to true always whether
ibm,occ-functional-state property exists or not.

ibm,occ-functional-state property of xscom node's are populated only in
ibm,fsp systems by detecting the OCC state in OPAL/SPIRA. In non-fsp(i.e OpenPower)
systems this property is not populating. But OPAL set's chip->occ_functional
field incorrectly to true without acually knowing the occ state.

So this patch set's chip->occ_functional data field to true only when property exist.
By this way this field is set to false on simulation environments(where occ is
not there) and BMC systems(where ibm,occ-functional-state property not exists).

OCC Spec says:
When OCC is told to go active it will populate OCC-OPAL shared memory interface
with ‘valid’ and all Pstate data.

So incase of OpenPower systems OPAL can add DT property ibm,occ-functional-state
and set the chip->occ_functional data field to true in hw/occ.c when OPAL find's the
valid homer region and corresponding occ_valid byte is set to 0x1

Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
 core/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/chip.c b/core/chip.c
index ea775ef..56b5063 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -119,7 +119,7 @@ void init_chips(void)
 		chip->pcid = dt_prop_get_u32_def(xn, "ibm,proc-chip-id",
-		if (dt_prop_get_u32_def(xn, "ibm,occ-functional-state", 1))
+		if (dt_prop_get_u32_def(xn, "ibm,occ-functional-state", 0))
 			chip->occ_functional = true;
 			chip->occ_functional = false;

More information about the Skiboot mailing list