[Skiboot] [PATCH] hdat/spira.c: Add device-tree bindings for nest mmu

Alistair Popple alistair at popple.id.au
Fri Apr 28 16:07:03 AEST 2017


The kernel will only initialise the nest mmu if the associated
device-tree entries exit so they need to be added during hdat parsing.

Signed-off-by: Alistair Popple <alistair at popple.id.au>
---
 hdata/spira.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/hdata/spira.c b/hdata/spira.c
index 3340a09..9c6a9d2 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -791,6 +791,22 @@ static void add_nx(void)
 	}
 }
 
+static void add_nmmu(void)
+{
+	struct dt_node *xscom, *nmmu;
+	char namebuf[13];
+
+	/* Nest MMU only exists on POWER9 */
+	if (proc_gen != proc_gen_p9)
+		return;
+
+	dt_for_each_compatible(dt_root, xscom, "ibm,xscom") {
+		snprintf(namebuf, sizeof(namebuf), "nmmu@%x", 0x5012C40);
+		nmmu = dt_new(xscom, namebuf);
+		dt_add_property_strings(nmmu, "compatible", "ibm,power9-nest-mmu");
+		dt_add_property_cells(nmmu, "reg", 0x5012c40, 0x20);
+	}
+}
 
 static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
 {
@@ -1265,6 +1281,9 @@ int parse_hdat(bool is_opal)
 	/* Add NX */
 	add_nx();
 
+	/* Add nest mmu */
+	add_nmmu();
+
 	/* Add IO HUBs and/or PHBs */
 	io_parse();
 
-- 
2.1.4



More information about the Skiboot mailing list