[Skiboot] [PATCH v3 01/10] npu2: Add a function to detect POWER9 DD1

Reza Arbab arbab at linux.vnet.ibm.com
Tue Aug 1 12:36:57 AEST 2017


Provide a convenience we'll use quite a bit to preserve backwards
compatibility with DD1.

Signed-off-by: Reza Arbab <arbab at linux.vnet.ibm.com>
Acked-by: Alistair Popple <alistair at popple.id.au>
Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
Cc: Frederic Barrat <fbarrat at linux.vnet.ibm.com>
---
 hw/npu2.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/npu2.c b/hw/npu2.c
index 83451c3..a986652 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -58,6 +58,16 @@
 
 #define VENDOR_CAP_PCI_DEV_OFFSET 0x0d
 
+static bool is_p9dd1(void)
+{
+	struct proc_chip *chip = next_chip(NULL);
+
+	return chip &&
+	       (chip->type == PROC_CHIP_P9_NIMBUS ||
+		chip->type == PROC_CHIP_P9_CUMULUS) &&
+	       (chip->ec_level & 0xf0) == 0x10;
+}
+
 /*
  * We use the indirect method because it uses the same addresses as
  * the MMIO offsets (NPU RING)
-- 
1.8.3.1



More information about the Skiboot mailing list