summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2018-06-20 13:49:37 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-06-27 17:19:01 +1000
commit9b394a32c8ea45c56db62ddddb322b45ffef9fd0 (patch)
tree4986a84e7ce5460bc3fbc6beab09771a0f9aaf24 /hw
parentef623f91e5c4719e65784fa976f9227a6926939d (diff)
downloadblackbird-skiboot-9b394a32c8ea45c56db62ddddb322b45ffef9fd0.tar.gz
blackbird-skiboot-9b394a32c8ea45c56db62ddddb322b45ffef9fd0.zip
occ: Add support for GPU presence detection
On the Witherspoon platform, we need to distinguish between NVLink GPUs and OpenCAPI accelerators. In order to do this, we first need to find out whether the SXM2 socket is populated. On Witherspoon, the SXM2 socket's presence detection pin is only visible via I2C from the APSS, and thus can only be exposed to the host via the OCC. The OCC, per OCC Firmware Interface Specification for POWER9 version 0.22, now exposes this to skiboot through a field in the dynamic data shared memory. Add the necessary dynamic data changes required to read the version and GPU presence fields. Add a function, occ_get_gpu_presence(), that can be used to check GPU presence. If the OCC isn't reporting presence (old OCC firmware, or some other reason), we default to assuming there is a device present and wait until link training to fail. This will be used in later patches to fix up the NPU2 probe path for OpenCAPI support on Witherspoon. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/occ.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/hw/occ.c b/hw/occ.c
index fc95d392..10b2de07 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -229,10 +229,10 @@ struct occ_response_buffer {
*/
struct occ_dynamic_data {
u8 occ_state;
+ u8 major_version;
+ u8 minor_version;
+ u8 gpus_present;
u8 spare1;
- u8 spare2;
- u8 spare3;
- u8 spare4;
u8 cpu_throttle;
u8 mem_throttle;
u8 quick_pwr_drop;
@@ -1230,6 +1230,23 @@ exit:
unlock(&chip->queue_lock);
}
+bool occ_get_gpu_presence(struct proc_chip *chip, int gpu_num)
+{
+ struct occ_dynamic_data *ddata;
+
+ assert(gpu_num <= 2);
+
+ ddata = get_occ_dynamic_data(chip);
+
+ if (ddata->major_version != 0 || ddata->minor_version < 1) {
+ prlog(PR_INFO, "OCC: OCC not reporting GPU slot presence, "
+ "assuming device is present\n");
+ return true;
+ }
+
+ return (bool)(ddata->gpus_present & 1 << gpu_num);
+}
+
static void occ_add_powercap_sensors(struct dt_node *power_mgt);
static void occ_add_psr_sensors(struct dt_node *power_mgt);
OpenPOWER on IntegriCloud