summaryrefslogtreecommitdiffstats
path: root/include/npu2.h
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2019-04-05 16:32:58 +0200
committerStewart Smith <stewart@linux.ibm.com>2019-04-09 10:50:55 +1000
commitb3bc840c1d85f49cfec27d1d612460d12c2360a8 (patch)
tree221fa4f59c94be7f677afe37574fe7c7d0016b83 /include/npu2.h
parent73cd109ecd8f6b64f67f62538674b76e1af946a1 (diff)
downloadblackbird-skiboot-b3bc840c1d85f49cfec27d1d612460d12c2360a8.tar.gz
blackbird-skiboot-b3bc840c1d85f49cfec27d1d612460d12c2360a8.zip
hw/npu2: Fix OpenCAPI PE assignment
When we support mixing NVLink and OpenCAPI devices on the same NPU, we're going to have to share the same range of 16 PE numbers between NVLink and OpenCAPI PHBs. For OpenCAPI devices, PE assignment is only significant for determining which System Interrupt Log register is used for a particular brick - unlike NVLink, it doesn't play any role in determining how links are fenced. Split the PE range into a lower half which is used for NVLink, and an upper half that is used for OpenCAPI, with a fixed PE number assigned per brick. As the PE assignment for OpenCAPI devices is fixed, set the PE once during device init and then ignore calls to the set_pe() operation. Suggested-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include/npu2.h')
-rw-r--r--include/npu2.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/npu2.h b/include/npu2.h
index a2bcc450..86a449eb 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -46,9 +46,24 @@
dev->npu->chip_id, dev->brick_index, ## a)
-/* Number of PEs supported */
-#define NPU2_MAX_PE_NUM 16
-#define NPU2_RESERVED_PE_NUM 15
+/*
+ * Number of PEs supported
+ *
+ * The NPU supports PE numbers from 0-15. At present, we only assign a maximum
+ * of 1 PE per brick.
+ *
+ * NVLink devices are currently exposed to Linux underneath a single virtual
+ * PHB. Therefore, we give NVLink half the available PEs, which is enough for
+ * 6 bricks plus 1 reserved PE.
+ *
+ * For OpenCAPI, the BDF-to-PE registers are used exclusively for mapping
+ * bricks to System Interrupt Log registers (the BDF component of those
+ * registers is ignored). Currently, we allocate a fixed PE based on the brick
+ * index in the upper half of the PE namespace.
+ */
+#define NPU2_MAX_PE_NUM 8
+#define NPU2_RESERVED_PE_NUM 7
+#define NPU2_OCAPI_PE(ndev) ((ndev)->brick_index + NPU2_MAX_PE_NUM)
#define NPU2_LINKS_PER_CHIP 6
OpenPOWER on IntegriCloud