diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2018-04-20 14:40:41 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-04-23 00:06:59 -0500 |
commit | f1957815872011f8fe905891406c0f95d14de329 (patch) | |
tree | 16248a06e65544488d84b5a11f0b1aff056f42cb /hw/npu2.c | |
parent | ac11641f1d70817bc746bedc139363ad41047f53 (diff) | |
download | blackbird-skiboot-f1957815872011f8fe905891406c0f95d14de329.tar.gz blackbird-skiboot-f1957815872011f8fe905891406c0f95d14de329.zip |
npu2: Use ibm, loc-code rather than ibm, slot-label
The ibm,slot-label property is to name the slot that appears under a
PCIe bridge. In the past we (ab)used the slot tables to attach names
to GPU devices and their corresponding NVLinks which resulted in npu2.c
using slot-label as a location code rather than as a way to name slots.
Fix this up since it's confusing.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/npu2.c')
-rw-r--r-- | hw/npu2.c | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -392,13 +392,13 @@ static int __npu2_dev_bind_pci_dev(struct phb *phb __unused, /* Find the PCI device's slot location */ for (pci_dt_node = pd->dn; - pci_dt_node && !dt_find_property(pci_dt_node, "ibm,slot-label"); + pci_dt_node && !dt_find_property(pci_dt_node, "ibm,loc-code"); pci_dt_node = pci_dt_node->parent); if (!pci_dt_node) return 0; - pcislot = (char *)dt_prop_get(pci_dt_node, "ibm,slot-label"); + pcislot = (char *)dt_prop_get(pci_dt_node, "ibm,loc-code"); NPU2DEVDBG(dev, "Comparing GPU '%s' and NPU2 '%s'\n", pcislot, dev->nvlink.slot_label); @@ -639,18 +639,11 @@ static int npu2_dn_fixup(struct phb *phb, dt_add_property_cells(pd->dn, "ibm,nvlink-speed", speed); /* - * NPU2 devices require a slot location to associate with GPUs. - * This can be added via the slot table matching, otherwise we - * read it from the link node. + * NPU2 devices have a slot label that indicates which GPU slot + * this NPU is connected to. Add a location code to the NVlink + * device node based on the slot label. */ - label = dt_prop_get_def(pd->dn, "ibm,slot-label", NULL); - - if (!label) { - label = dt_prop_get_def(dev->dt_node, "ibm,slot-label", NULL); - if (label) - dt_add_property_string(pd->dn, "ibm,slot-label", label); - } - + label = dt_prop_get_def(dev->dt_node, "ibm,slot-label", NULL); if (!label) { /** * @fwts-label NPUNoPHBSlotLabel @@ -660,6 +653,7 @@ static int npu2_dn_fixup(struct phb *phb, prlog(PR_ERR, "NPU2: Cannot find GPU slot information\n"); return 0; } + dt_add_property_string(pd->dn, "ibm,loc-code", label); dev->nvlink.slot_label = label; |