[Skiboot] [PATCH] hdata/spira: POWER9 NX isn't software compatible with P7/P8 NX, don't claim so

Stewart Smith stewart at linux.vnet.ibm.com
Thu Aug 10 13:16:31 AEST 2017


Fixes: 2512953c7c6dc3b479d159d9bce8206219951164
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 hdata/spira.c | 18 ++++++++++--------
 hw/nx.c       | 14 +++++++++++---
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/hdata/spira.c b/hdata/spira.c
index 58afb9396261..d5e6984e12d1 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -741,7 +741,6 @@ static bool add_chiptod_new(void)
 static void add_nx_node(u32 gcid)
 {
 	struct dt_node *nx;
-	const char *cp_str;
 	u32 addr;
 	u32 size;
 	struct dt_node *xscom;
@@ -761,25 +760,28 @@ static void add_nx_node(u32 gcid)
 	addr = 0x2010000;
 	size = 0x0004000;
 
+	nx = dt_new_addr(xscom, "nx", addr);
+	if (!nx)
+		return;
+
 	switch (proc_gen) {
 	case proc_gen_p7:
-		cp_str = "ibm,power7-nx";
+		dt_add_property_strings(nx, "compatible", "ibm,power-nx",
+					"ibm,power7-nx");
 		break;
 	case proc_gen_p8:
-		cp_str = "ibm,power8-nx";
+		dt_add_property_strings(nx, "compatible", "ibm,power-nx",
+					"ibm,power8-nx");
 		break;
 	case proc_gen_p9:
-		cp_str = "ibm,power9-nx";
+		/* POWER9 NX is not software compatible with P7/P8 NX */
+		dt_add_property_strings(nx, "compatible", "ibm,power9-nx");
 		break;
 	default:
 		return;
 	}
-	nx = dt_new_addr(xscom, "nx", addr);
-	if (!nx)
-		return;
 
 	dt_add_property_cells(nx, "reg", addr, size);
-	dt_add_property_strings(nx, "compatible", "ibm,power-nx", cp_str);
 }
 
 static void add_nx(void)
diff --git a/hw/nx.c b/hw/nx.c
index 18e6be79d584..64ac793c0ca5 100644
--- a/hw/nx.c
+++ b/hw/nx.c
@@ -69,6 +69,12 @@ void nx_p9_rng_init(void)
 	}
 }
 
+static void nx_init_one(struct dt_node *node)
+{
+	nx_create_rng_node(node);
+	nx_create_crypto_node(node);
+	nx_create_compress_node(node);
+}
 
 void nx_init(void)
 {
@@ -77,8 +83,10 @@ void nx_init(void)
 	nx_p9_rng_init();
 
 	dt_for_each_compatible(dt_root, node, "ibm,power-nx") {
-		nx_create_rng_node(node);
-		nx_create_crypto_node(node);
-		nx_create_compress_node(node);
+		nx_init_one(node);
+	}
+
+	dt_for_each_compatible(dt_root, node, "ibm,power9-nx") {
+		nx_init_one(node);
 	}
 }
-- 
2.13.4



More information about the Skiboot mailing list