aboutsummaryrefslogtreecommitdiff
path: root/platforms/astbmc
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2020-02-06 14:22:43 +0100
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2020-03-12 10:32:39 +0530
commit7cfa22eb54b83a91ffe8ee4b21e9dd405b70541b (patch)
tree518f9a60b0a8bdb9d8f1c8ef901dbfacd2f52dd3 /platforms/astbmc
parent4a166db990dba98d4c41ef242ae863f6f20e3ea6 (diff)
downloadskiboot-7cfa22eb54b83a91ffe8ee4b21e9dd405b70541b.zip
skiboot-7cfa22eb54b83a91ffe8ee4b21e9dd405b70541b.tar.gz
skiboot-7cfa22eb54b83a91ffe8ee4b21e9dd405b70541b.tar.bz2
npu2-opencapi: Allow platforms to identify physical slots
[ Upstream commit 9de4f2284c54433f7f4ff3dc3d13a39c657e2c19 ] This patch lets each platform define the name of the opencapi slots. It makes it easier to identify which physical card is generating errors or messages in the linux or skiboot log files. The patch provides slot names for mihawk and witherspoon. If the platform doesn't define any, then we default to 'OPENCAPI-xxxx' There are various ways to find out about the slot names: skiboot log lspci command (if the PCI hotplug driver pnv-php is loaded) lshw checking the device tree and probably others.... Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'platforms/astbmc')
-rw-r--r--platforms/astbmc/mihawk.c20
-rw-r--r--platforms/astbmc/witherspoon.c20
2 files changed, 40 insertions, 0 deletions
diff --git a/platforms/astbmc/mihawk.c b/platforms/astbmc/mihawk.c
index 6816acc..d33d16b 100644
--- a/platforms/astbmc/mihawk.c
+++ b/platforms/astbmc/mihawk.c
@@ -55,6 +55,25 @@ static void mihawk_get_slot_info(struct phb *phb, struct pci_device *pd)
slot_table_get_slot_info(phb, pd);
}
+static const char *mihawk_ocapi_slot_label(uint32_t chip_id,
+ uint32_t brick_index)
+{
+ const char *name = NULL;
+
+ if (chip_id == 0) {
+ if (brick_index == 2)
+ name = "JP90NVB1";
+ else
+ name = "JP90NVT1";
+ } else {
+ if (brick_index == 2)
+ name = "JP91NVB1";
+ else
+ name = "JP91NVT1";
+ }
+ return name;
+}
+
static const struct platform_ocapi mihawk_ocapi = {
.i2c_engine = 1,
.i2c_port = 4,
@@ -69,6 +88,7 @@ static const struct platform_ocapi mihawk_ocapi = {
.i2c_presence_brick4 = 0, /* unused */
.i2c_presence_brick5 = 0, /* unused */
.odl_phy_swap = true,
+ .ocapi_slot_label = mihawk_ocapi_slot_label,
};
static const struct slot_table_entry P1E1A_x8_PLX8748_down[] = {
diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c
index 8aaed97..e9527bf 100644
--- a/platforms/astbmc/witherspoon.c
+++ b/platforms/astbmc/witherspoon.c
@@ -325,6 +325,25 @@ i2c_failed:
return;
}
+static const char *witherspoon_ocapi_slot_label(uint32_t chip_id,
+ uint32_t brick_index)
+{
+ const char *name = NULL;
+
+ if (chip_id == 0) {
+ if (brick_index == 3)
+ name = "OPENCAPI-GPU0";
+ else if (brick_index == 4)
+ name = "OPENCAPI-GPU1";
+ } else {
+ if (brick_index == 3)
+ name = "OPENCAPI-GPU3";
+ else if (brick_index == 4)
+ name = "OPENCAPI-GPU4";
+ }
+ return name;
+}
+
const struct platform_ocapi witherspoon_ocapi = {
.i2c_engine = 1,
.i2c_port = 4,
@@ -348,6 +367,7 @@ const struct platform_ocapi witherspoon_ocapi = {
.i2c_presence_brick3 = 0,
.i2c_presence_brick4 = 0,
.i2c_presence_brick5 = 0,
+ .ocapi_slot_label = witherspoon_ocapi_slot_label,
};
static int gpu_slot_to_num(const char *slot)