summaryrefslogtreecommitdiffstats
path: root/hdata
diff options
context:
space:
mode:
Diffstat (limited to 'hdata')
-rw-r--r--hdata/iohub.c16
-rw-r--r--hdata/spira.c8
2 files changed, 22 insertions, 2 deletions
diff --git a/hdata/iohub.c b/hdata/iohub.c
index 2260f600..1630d2a8 100644
--- a/hdata/iohub.c
+++ b/hdata/iohub.c
@@ -757,9 +757,23 @@ static void parse_one_slot(const struct slot_map_entry *entry,
dt_add_property_cells(node, "lanes-reversed",
be16_to_cpu(entry->lane_reverse));
- if (strnlen(entry->name, sizeof(entry->name)))
+ if (strnlen(entry->name, sizeof(entry->name))) {
+ /*
+ * HACK: On some platforms (witherspoon) the slot label is
+ * applied to the device rather than the pcie downstream port
+ * that has the slot under it. Hack around this by moving the
+ * slot label up if the parent port doesn't have one.
+ */
+ if (dt_node_is_compatible(node->parent, "ibm,pcie-port") &&
+ !dt_find_property(node->parent, "ibm,slot-label")) {
+ dt_add_property_nstr(node->parent, "ibm,slot-label",
+ entry->name, sizeof(entry->name));
+ }
+
dt_add_property_nstr(node, "ibm,slot-label",
entry->name, sizeof(entry->name));
+ }
+
if (entry->type == st_slot || entry->type == st_rc_slot)
dt_add_property(node, "ibm,pluggable", NULL, 0);
diff --git a/hdata/spira.c b/hdata/spira.c
index 360b7c77..5f98a834 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1529,7 +1529,13 @@ static void add_npu(struct dt_node *xscom, const struct HDIF_array_hdr *links,
continue;
}
- name = dt_prop_get_def(slot, "ibm,slot-label",
+ /*
+ * The slot_id points to a node that indicates that
+ * this GPU should appear under the slot. Grab the
+ * slot-label from the parent node that represents
+ * the actual slot.
+ */
+ name = dt_prop_get_def(slot->parent, "ibm,slot-label",
(char *)"<SLOT NAME MISSING>");
prlog(PR_DEBUG, "NPU: %04x:%d: Target slot %s\n",
OpenPOWER on IntegriCloud