diff options
author | Frederic Barrat <fbarrat@linux.ibm.com> | 2020-02-06 14:22:43 +0100 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2020-02-12 15:56:24 +1100 |
commit | 9de4f2284c54433f7f4ff3dc3d13a39c657e2c19 (patch) | |
tree | 4de2eb20557c61b22d57b6a57236073f73532669 /hw/npu2-opencapi.c | |
parent | 53408440edb30de7ad18f12db285f15a0863fbc3 (diff) | |
download | skiboot-9de4f2284c54433f7f4ff3dc3d13a39c657e2c19.zip skiboot-9de4f2284c54433f7f4ff3dc3d13a39c657e2c19.tar.gz skiboot-9de4f2284c54433f7f4ff3dc3d13a39c657e2c19.tar.bz2 |
npu2-opencapi: Allow platforms to identify physical slots
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>
Diffstat (limited to 'hw/npu2-opencapi.c')
-rw-r--r-- | hw/npu2-opencapi.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c index 4d15240..f0d245c 100644 --- a/hw/npu2-opencapi.c +++ b/hw/npu2-opencapi.c @@ -1342,7 +1342,9 @@ static int64_t npu2_opencapi_hreset(struct pci_slot *slot __unused) static void make_slot_hotpluggable(struct pci_slot *slot, struct phb *phb) { - char label[40]; + struct npu2_dev *dev = phb_to_npu2_dev_ocapi(phb); + char name[40]; + const char *label = NULL; /* * Add a few definitions to the DT so that the linux PCI @@ -1353,8 +1355,16 @@ static void make_slot_hotpluggable(struct pci_slot *slot, struct phb *phb) */ slot->pluggable = 1; pci_slot_add_dt_properties(slot, phb->dt_node); - snprintf(label, sizeof(label), "OPENCAPI-%04x", - (int)PCI_SLOT_PHB_INDEX(slot->id)); + + if (platform.ocapi->ocapi_slot_label) + label = platform.ocapi->ocapi_slot_label(dev->npu->chip_id, + dev->brick_index); + + if (!label) { + snprintf(name, sizeof(name), "OPENCAPI-%04x", + (int)PCI_SLOT_PHB_INDEX(slot->id)); + label = name; + } dt_add_property_string(phb->dt_node, "ibm,slot-label", label); } |