[Skiboot] [PATCH] hdata: Ensure the prd-label hbrt-code-image is prefixed

Oliver O'Halloran oohall at gmail.com
Fri Jul 17 14:09:03 AEST 2020


Older versions of opal-prd (i.e. most of them shipped by distros)
expect the HBRT image to have the PRD label of "ibm,hbrt-code-image".
Commit c3bfa3209559 ("hdata: Fix reserved node label search") made
opal-prd check for both strings, but since opal-prd itself is the only
component interested in locating the hbrt-code-image we might as well
just add the prefix in firmware.

Cc: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hdata/memory.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hdata/memory.c b/hdata/memory.c
index 5b1a05d23371..0d9486b92ac2 100755
--- a/hdata/memory.c
+++ b/hdata/memory.c
@@ -827,6 +827,15 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
 		dt_add_property_cells(node, "ibm,prd-instance",
 			(be32_to_cpu(hb_resv_mem->type_instance) & 0xffffff));
 
+		/*
+		 * Most reservations are used by HBRT itself so we should leave
+		 * the label as-is. The exception is hbrt-code-image which is
+		 * used by opal-prd to locate the HBRT image. Older versions
+		 * of opal-prd expect this to be "ibm,hbrt-code-image" so make
+		 * sure the prefix is there.
+		 */
+		if (!strcmp(label, "hbrt-code-image"))
+			strcpy(label, "ibm,hbrt-code-image");
 		dt_add_property_string(node, "ibm,prd-label", label);
 	}
 }
-- 
2.26.2



More information about the Skiboot mailing list