[Skiboot] [PATCH] hdata: Fix /vpd dtc warnings

Oliver O'Halloran oohall at gmail.com
Fri Sep 8 10:46:05 AEST 2017


When dealing with HDAT generated device-trees dtc will complain loudly
about the missing reg, #size-cells and #address-cells properties of the
nodes in the /vpd hierarchy. This patch fixes these so we get a bit more
signal and less noise from the dtc warnings.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hdata/spira.c | 3 +++
 hdata/vpd.c   | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/hdata/spira.c b/hdata/spira.c
index 95e1a016642e..291365e82c81 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1181,7 +1181,10 @@ static void dt_init_vpd_node(void)
 
 	dt_vpd = dt_new(dt_root, "vpd");
 	assert(dt_vpd);
+
 	dt_add_property_string(dt_vpd, "compatible", "ibm,opal-v3-vpd");
+	dt_add_property_cells(dt_vpd, "#address-cells", 1);
+	dt_add_property_cells(dt_vpd, "#size-cells", 0);
 }
 
 static void hostservices_parse(void)
diff --git a/hdata/vpd.c b/hdata/vpd.c
index d7d57cdad67c..9f3fe010c3e8 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -405,6 +405,14 @@ static struct dt_node *dt_create_vpd_node(struct dt_node *parent,
 		return NULL;
 	}
 
+	/*
+	 * no one is sure what this is or what it means, we're adding it here
+	 * to stop dtc from complaining about it.
+	 */
+	dt_add_property_cells(node, "reg", addr);
+	dt_add_property_cells(node, "#address-cells", 1);
+	dt_add_property_cells(node, "#size-cells", 0);
+
 	/* Add location code */
 	slca_vpd_add_loc_code(node, be16_to_cpu(entry->my_index));
 	/* Add FRU label */
-- 
2.9.5



More information about the Skiboot mailing list