core/pci: Fix FSP platforms to favor slot-location-codes over labels
diff mbox series

Message ID 20200209014946.30280-1-klaus@linux.vnet.ibm.com
State New
Headers show
Series
  • core/pci: Fix FSP platforms to favor slot-location-codes over labels
Related show

Commit Message

Klaus Kiwi Feb. 9, 2020, 1:49 a.m. UTC
FSP Systems will favor fully-qualified "ibm,slot-location-codes" (e.g.
"UOPWR.001.XYZ0000-P1-C2" over "ibm,slot-label" (e.g. "C2") for it's
"ibm,loc-code" property on pci devices.

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
---
 core/pci.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 core/pci.c

Comments

Klaus Kiwi Feb. 9, 2020, 1:59 a.m. UTC | #1
On 2/8/2020 10:49 PM, Klaus Heinrich Kiwi wrote:
>   1 file changed, 8 insertions(+), 4 deletions(-)
>   mode change 100644 => 100755 core/pci.c

Just noted the spurious mode change, will send a v2

-Klaus

Patch
diff mbox series

diff --git a/core/pci.c b/core/pci.c
old mode 100644
new mode 100755
index 8b52fc10..b2703d3b
--- a/core/pci.c
+++ b/core/pci.c
@@ -1393,10 +1393,14 @@  static void pci_add_loc_code(struct dt_node *np, struct pci_device *pd)
 	uint8_t pos, len;
 
 	while (p) {
-		/* if we have a slot label (i.e. openpower) use that */
-		blcode = dt_prop_get_def(p, "ibm,slot-label", NULL);
-		if (blcode)
-			break;
+		/* BMC platforms will favor slot-label, while FSP platforms will
+		 * prefer slot-location-code
+		 */
+		if (platform.bmc) {
+			blcode = dt_prop_get_def(p, "ibm,slot-label", NULL);
+			if (blcode)
+				break;
+		}
 
 		/* otherwise use the fully qualified location code */
 		blcode = dt_prop_get_def(p, "ibm,slot-location-code", NULL);