@@ -636,6 +636,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 */
@@ -1506,7 +1506,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") {
@@ -1633,8 +1634,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();
@@ -654,6 +654,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 &&