npu2: Add a function to detect POWER9 DD1
Provide a convenience we'll use quite a bit to preserve backwards
compatibility with DD1.
Acked-by: Alistair Popple
Cc: Frederic Barrat
#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)
