[Skiboot] [PATCH v2] core/opal: Fix reg format for flash at 0 node in DT

Maxim Polyakov m.polyakov at yadro.com
Tue Oct 22 20:24:26 AEDT 2019


Since the "ibm,opal" node doesn`t refer to any "bus",
the "#address-cells" and "#size-cells" being zero is correct.
However, in this case, the “reg” property that determines the
size of the flash memory in the child node “flash at 0” has an
invalid format. For this reason, the FWTS on the Linux host
displays the following warning:

   /ibm,opal/flash at 0:reg: property has invalid length (8
   bytes) (#address-cells == 0, #size-cells == 0)

The "#address-cells" and "#size-cells" are set to 1 to fix
this problem temporarily. However, in the future, need to
add some property that contains the size of the flash device
instead of "reg".

Resolve: https://github.com/open-power/skiboot/issues/47
Signed-off-by: Maxim Polyakov <m.polyakov at yadro.com>
---
 core/opal.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/core/opal.c b/core/opal.c
index da746e8..35b876a 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -392,8 +392,25 @@ void add_opal_node(void)
 		(uint64_t)(cpu_max_pir + 1) * STACK_SIZE) - SKIBOOT_BASE;
 
 	opal_node = dt_new_check(dt_root, "ibm,opal");
-	dt_add_property_cells(opal_node, "#address-cells", 0);
-	dt_add_property_cells(opal_node, "#size-cells", 0);
+	/*
+	 * Since the "ibm,opal" node doesn`t refer to any "bus",
+	 * the "#address-cells" and "#size-cells" being zero is correct.
+	 * However, in this case, the “reg” property that determines the
+	 * size of the flash memory in the child node “flash at 0” has an
+	 * invalid format. For this reason, the FWTS on the Linux host
+	 * displays the following warning:
+	 *
+	 *    /ibm,opal/flash at 0:reg: property has invalid length (8
+	 *    bytes) (#address-cells == 0, #size-cells == 0)
+	 *
+	 * The "#address-cells" and "#size-cells" are set to 1 to fix
+	 * this problem temporarily.
+	 *
+	 * TODO: need to add some property that contains the size of
+	 * the flash device instead of "reg"
+	 */
+	dt_add_property_cells(opal_node, "#address-cells", 1);
+	dt_add_property_cells(opal_node, "#size-cells", 1);
 
 	if (proc_gen < proc_gen_p9)
 		dt_add_property_strings(opal_node, "compatible", "ibm,opal-v2",
-- 
2.7.4



More information about the Skiboot mailing list