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

Alistair Popple alistair at popple.id.au
Fri Apr 28 18:01:15 AEST 2017


The nest mmu will only get initialised by opal_nmmu_set_ptcr() if the
appropriate device-tree entries exist. Add them during hdata parsing.

Signed-off-by: Alistair Popple <alistair at popple.id.au>
Acked-by: Oliver O'Halloran <oohall at gmail.com>
---

Changes from v2:
	- simplified the dt node creation
	- reworded commit message

hdata/spira.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/hdata/spira.c b/hdata/spira.c
index 3340a09..46dd1ab 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -791,6 +791,20 @@ static void add_nx(void)
 	}
 }

+static void add_nmmu(void)
+{
+	struct dt_node *xscom, *nmmu;
+
+	/* Nest MMU only exists on POWER9 */
+	if (proc_gen != proc_gen_p9)
+		return;
+
+	dt_for_each_compatible(dt_root, xscom, "ibm,xscom") {
+		nmmu = dt_new_addr(xscom, "nmmu", 0x5012c40);
+		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 +1279,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