[Skiboot] [PATCH 06/15] OPAL: Validate before creating opal device tree node

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Fri Mar 20 23:08:14 AEDT 2015


On FSP based machine, attention LED location code is passed to OPAL
via HDAT. We want to populate this information in device tree under
led node, so that LED driver can use this information.

Presently we are creating '/ibm,opal' node after parsing hdata
information. This patch validates '/ibm,opal' node before creating.
So on FSP based machine we can create this node in hdata itself
without breaking.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 core/opal.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/core/opal.c b/core/opal.c
index 5e96e0a..6047879 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -144,7 +144,11 @@ void add_opal_node(void)
 	size = (CPU_STACKS_BASE +
 		(cpu_max_pir + 1) * STACK_SIZE) - SKIBOOT_BASE;
 
-	opal_node = dt_new(dt_root, "ibm,opal");
+	if (!opal_node) {
+		opal_node = dt_new(dt_root, "ibm,opal");
+		assert(opal_node);
+	}
+
 	dt_add_property_cells(opal_node, "#address-cells", 0);
 	dt_add_property_cells(opal_node, "#size-cells", 0);
 	dt_add_property_strings(opal_node, "compatible", "ibm,opal-v2",



More information about the Skiboot mailing list