aboutsummaryrefslogtreecommitdiff
path: root/core/platform.c
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 /core/platform.c
parent68415d5e38ef04e647ad36d59f90c008a0414f56 (diff)
downloadskiboot-b6cc82cb39c4d891799f4d7a9f8e76fdf8a16125.zip
skiboot-b6cc82cb39c4d891799f4d7a9f8e76fdf8a16125.tar.gz
skiboot-b6cc82cb39c4d891799f4d7a9f8e76fdf8a16125.tar.bz2
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 'core/platform.c')
-rw-r--r--core/platform.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/platform.c b/core/platform.c
index b32cbf5..4b3eaa4 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -25,6 +25,7 @@
#include <errorlog.h>
#include <bt.h>
#include <nvram.h>
+#include <npu2.h>
#include <platforms/astbmc/astbmc.h>
bool manufacturing_mode = false;
@@ -204,6 +205,7 @@ static struct platform generic_platform = {
.start_preload_resource = generic_start_preload_resource,
.resource_loaded = generic_resource_loaded,
.ocapi = &generic_ocapi,
+ .npu2_device_detect = npu2_i2c_presence_detect, /* Assumes ZZ */
};
const struct bmc_platform *bmc_platform = &generic_bmc;