summaryrefslogtreecommitdiffstats
path: root/platforms
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2018-09-14 13:46:25 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-09-17 21:39:01 -0500
commitb6cc82cb39c4d891799f4d7a9f8e76fdf8a16125 (patch)
treec4d041ba07a43591e72eebcbaecd02fca217717e /platforms
parent68415d5e38ef04e647ad36d59f90c008a0414f56 (diff)
downloadtalos-skiboot-b6cc82cb39c4d891799f4d7a9f8e76fdf8a16125.tar.gz
talos-skiboot-b6cc82cb39c4d891799f4d7a9f8e76fdf8a16125.zip
hw/npu2, platform: Add NPU2 platform device detection callback
There is no standardised way to determine the presence and type of devices connected to an NPU on POWER9. Currently, we hardcode device types based on platform type (as no platform currently supports both OpenCAPI and NVLink), and for OpenCAPI platforms we use I2C to detect presence. Witherspoon (and potentially other platforms later on) supports both NVLink and OpenCAPI, and additionally uses SXM2 connectors which can carry more than one link, rather than the SlimSAS connectors used for OpenCAPI on Zaius and ZZ. This necessitates some special handling. Add a platform callback for NPU device detection. In a later patch, we will use this to implement Witherspoon-specific device detection. For now, add a Witherspoon stub that sets all links to NVLink (i.e. current behaviour). Move the existing I2C-based presence detection for OpenCAPI devices on Zaius/ZZ into common code, which we use by default for platforms which do not define a callback. Clean up the use of the ibm,npu-link-type property, which will now be exposed solely for debugging and not consumed internally. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/astbmc/witherspoon.c10
-rw-r--r--platforms/astbmc/zaius.c3
-rw-r--r--platforms/ibm-fsp/zz.c2
3 files changed, 14 insertions, 1 deletions
diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c
index d663709f..ce83ff97 100644
--- a/platforms/astbmc/witherspoon.c
+++ b/platforms/astbmc/witherspoon.c
@@ -27,6 +27,7 @@
#include <pci.h>
#include <pci-slot.h>
#include <phb4.h>
+#include <npu2.h>
#include "astbmc.h"
#include "ast.h"
@@ -153,6 +154,14 @@ static void witherspoon_pre_pci_fixup(void)
phb4_pre_pci_fixup_witherspoon();
}
+static void witherspoon_npu2_device_detect(struct npu2 *npu)
+{
+ /* Stub until we implement real device detection */
+ for (int i = 0; i < npu->total_devices; i++) {
+ npu->devices[i].type = NPU2_DEV_TYPE_NVLINK;
+ }
+}
+
/* The only difference between these is the PCI slot handling */
DECLARE_PLATFORM(witherspoon) = {
@@ -170,4 +179,5 @@ DECLARE_PLATFORM(witherspoon) = {
.terminate = ipmi_terminate,
.pci_get_slot_info = dt_slot_get_slot_info,
+ .npu2_device_detect = witherspoon_npu2_device_detect,
};
diff --git a/platforms/astbmc/zaius.c b/platforms/astbmc/zaius.c
index e07bced5..4d93e61b 100644
--- a/platforms/astbmc/zaius.c
+++ b/platforms/astbmc/zaius.c
@@ -21,6 +21,7 @@
#include <ipmi.h>
#include <psi.h>
#include <npu-regs.h>
+#include <npu2.h>
#include <pci.h>
#include <pci-cfg.h>
@@ -141,7 +142,6 @@ static void create_link(struct dt_node *npu, int group, int index)
link = dt_new(npu, namebuf);
dt_add_property_string(link, "compatible", "ibm,npu-link");
- dt_add_property_string(link, "ibm,npu-link-type", "opencapi");
dt_add_property_cells(link, "ibm,npu-link-index", index);
switch (index) {
@@ -245,4 +245,5 @@ DECLARE_PLATFORM(zaius) = {
.exit = ipmi_wdt_final_reset,
.terminate = ipmi_terminate,
.ocapi = &zaius_ocapi,
+ .npu2_device_detect = npu2_i2c_presence_detect,
};
diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
index dc48768b..7c717d3c 100644
--- a/platforms/ibm-fsp/zz.c
+++ b/platforms/ibm-fsp/zz.c
@@ -23,6 +23,7 @@
#include <i2c.h>
#include <timebase.h>
#include <hostservices.h>
+#include <npu2.h>
#include "ibm-fsp.h"
#include "lxvpd.h"
@@ -90,4 +91,5 @@ DECLARE_PLATFORM(zz) = {
.sensor_read = ibm_fsp_sensor_read,
.terminate = ibm_fsp_terminate,
.ocapi = &zz_ocapi,
+ .npu2_device_detect = npu2_i2c_presence_detect,
};
OpenPOWER on IntegriCloud