aboutsummaryrefslogtreecommitdiff
path: root/hw/occ.c
diff options
context:
space:
mode:
authorPridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>2016-11-14 10:23:26 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-12-21 15:54:32 +1100
commit3cd459766a01c1cb8334f18e93a1c8eddfc6829c (patch)
tree8eb3a40529b25de7169961ea5933da753373dc46 /hw/occ.c
parent4c2f2fc8792478ca66fe21a4abc1d5b626fe203c (diff)
downloadskiboot-3cd459766a01c1cb8334f18e93a1c8eddfc6829c.zip
skiboot-3cd459766a01c1cb8334f18e93a1c8eddfc6829c.tar.gz
skiboot-3cd459766a01c1cb8334f18e93a1c8eddfc6829c.tar.bz2
Always set ibm,occ-functional-state correctly
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 sets chip->occ_functional field incorrectly to true without acually knowing the occ state. 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 when OPAL finds the valid homer region and corresponding occ_valid byte is set to 0x1. Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: squash commits, tweak commit message] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/occ.c')
-rw-r--r--hw/occ.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/hw/occ.c b/hw/occ.c
index d5c590b..ee76be6 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -88,6 +88,7 @@ DEFINE_LOG_ENTRY(OPAL_RC_OCC_TIMEOUT, OPAL_PLATFORM_ERR_EVT, OPAL_OCC,
static bool wait_for_all_occ_init(void)
{
struct proc_chip *chip;
+ struct dt_node *xn;
uint64_t occ_data_area;
struct occ_pstate_table *occ_data;
int tries;
@@ -115,12 +116,6 @@ static bool wait_for_all_occ_init(void)
return false;
}
- if (!chip->occ_functional) {
- prlog(PR_WARNING, "OCC: Chip: %x occ not functional\n",
- chip->id);
- continue;
- }
-
/* Get PState table address */
occ_data_area = chip->homer_base + P8_HOMER_SAPPHIRE_DATA_OFFSET;
occ_data = (struct occ_pstate_table *)occ_data_area;
@@ -149,6 +144,10 @@ static bool wait_for_all_occ_init(void)
chip->id);
return false;
}
+
+ if (!chip->occ_functional)
+ chip->occ_functional = true;
+
prlog(PR_DEBUG, "OCC: Chip %02x Data (%016llx) = %016llx\n",
chip->id, occ_data_area,
*(uint64_t *)occ_data_area);
@@ -156,6 +155,14 @@ static bool wait_for_all_occ_init(void)
end_time = mftb();
prlog(PR_NOTICE, "OCC: All Chip Rdy after %lu ms\n",
tb_to_msecs(end_time - start_time));
+
+ dt_for_each_compatible(dt_root, xn, "ibm,xscom") {
+ const struct dt_property *p;
+ p = dt_find_property(xn, "ibm,occ-functional-state");
+ if (!p)
+ dt_add_property_cells(xn, "ibm,occ-functional-state",
+ 0x1);
+ }
return true;
}