aboutsummaryrefslogtreecommitdiff
path: root/hdata/iohub.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2018-04-20 14:40:40 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-04-23 00:06:59 -0500
commitac11641f1d70817bc746bedc139363ad41047f53 (patch)
treeaa7f7cf8a6b2a1627f12b27aa3ea9f6f8780aaa6 /hdata/iohub.c
parent6878b806682fd41b6560b40b7f0f198d6c90357c (diff)
downloadskiboot-ac11641f1d70817bc746bedc139363ad41047f53.zip
skiboot-ac11641f1d70817bc746bedc139363ad41047f53.tar.gz
skiboot-ac11641f1d70817bc746bedc139363ad41047f53.tar.bz2
hdata/slots: Apply slot label to the parent slot
Slot names only really make sense when applied to an actual slot rather than a device. On witherspoon the GPU devices have a name associated with the device rather than the slot for the GPUs. Add a hack that moves the slot label to the parent slot rather than on the device itself. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hdata/iohub.c')
-rw-r--r--hdata/iohub.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/hdata/iohub.c b/hdata/iohub.c
index 2260f60..1630d2a 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);