aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReza Arbab <arbab@linux.ibm.com>2019-07-17 15:44:24 -0500
committerOliver O'Halloran <oohall@gmail.com>2019-07-26 15:30:21 +1000
commitd9b06b855e8b858976491c19ab9bd792e3a4c3e5 (patch)
tree408509b682fc6fe19adc70f4edb99e160314c7e9
parentd9ecf61c330f5b8d0e2ff66af4e29a999dfd111b (diff)
downloadskiboot-d9b06b855e8b858976491c19ab9bd792e3a4c3e5.zip
skiboot-d9b06b855e8b858976491c19ab9bd792e3a4c3e5.tar.gz
skiboot-d9b06b855e8b858976491c19ab9bd792e3a4c3e5.tar.bz2
npu2: Add checks to npu2-only codepaths
To prepare for npu3, add a few checks in codepaths that are only for npu2. Compare against PVR_TYPE_P9, as npu3 will be in systems of PVR_TYPE_P9P (or greater). Alternatively, check for dt compatibility with "ibm,power9-npu" because npu3 will use "ibm,power9-npu3". Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r--core/hmi.c4
-rw-r--r--hdata/spira.c6
-rw-r--r--hw/npu2-common.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/core/hmi.c b/core/hmi.c
index 90640c9..cb158c0 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -627,6 +627,10 @@ static void find_npu2_checkstop_reason(int flat_chip_id,
int total_errors = 0;
const char *loc;
+ /* NPU2 only */
+ if (PVR_TYPE(mfspr(SPR_PVR)) != PVR_TYPE_P9)
+ return;
+
/* Find the NPU on the chip associated with the HMI. */
for_each_phb(phb) {
/* NOTE: if a chip ever has >1 NPU this will need adjusting */
diff --git a/hdata/spira.c b/hdata/spira.c
index b34a1a2..f6003ea 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1507,7 +1507,8 @@ static void add_npus(void)
int phb_index = 7; /* Start counting from 7, for no reason */
int npu_index = 0;
- if (proc_gen < proc_gen_p9)
+ /* Only consult HDAT for npu2 */
+ if (cpu_type != PVR_TYPE_P9)
return;
dt_for_each_compatible(dt_root, xscom, "ibm,xscom") {
@@ -1634,8 +1635,7 @@ int parse_hdat(bool is_opal)
io_parse();
/* Add NPU nodes */
- if (proc_gen >= proc_gen_p9)
- add_npus();
+ add_npus();
/* Parse VPD */
vpd_parse();
diff --git a/hw/npu2-common.c b/hw/npu2-common.c
index 4043769..6d5c35a 100644
--- a/hw/npu2-common.c
+++ b/hw/npu2-common.c
@@ -641,6 +641,10 @@ void probe_npu2(void)
struct dt_node *np;
const char *zcal;
+ /* npu2 only */
+ if (!dt_find_compatible_node(dt_root, NULL, "ibm,power9-npu"))
+ return;
+
/* Abort if we're running on POWER9C DD1 (P9N DD1 is not supported) */
if (chip &&
chip->type == PROC_CHIP_P9_CUMULUS &&