[Skiboot] [PATCH] move nx-842 ct and ci nodes into main nx node

Dan Streetman ddstreet at ieee.org
Thu Mar 12 16:08:21 AEDT 2015


We don't actually need to use a separate node for the nx-842
details, so move its information nodes (for CT and CI) under
each main nx node for each coprocessor.

Part of the reason for this is the kernel driver will need to
read/write xscom registers, for coprocessor monitoring and
error recovery, and locating the CT and CI nodes under the
main nx node allows the nx-842 driver to easily get more
information about the coprocessor, like its base xscom
address, and the processor version (p7, p8, etc).

Signed-off-by: Dan Streetman <ddstreet at ieee.org>
---
 doc/device-tree/nx.txt | 42 ++++++++++++++++++++----------------------
 hw/nx-842.c            | 13 ++-----------
 2 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/doc/device-tree/nx.txt b/doc/device-tree/nx.txt
index 6c48956..84c97ac 100644
--- a/doc/device-tree/nx.txt
+++ b/doc/device-tree/nx.txt
@@ -8,9 +8,25 @@ xscom node, as:
 /xscom@<xscom_addr>/nx@<nx_addr>
 
 With unique xscom and nx addresses.  Their compatible node contains
-"ibm,power-nx".  There is nothing that the OS should directly do with the
-NX nodes, instead the specific coprocessor nodes should be used, as
-described below.
+"ibm,power-nx".
+
+
+NX 842 Coprocessor
+------------------
+
+This is the memory compression coprocessor, which uses the IBM proprietary
+842 compression algorithm and format.  Each nx node contains an 842 engine.
+
+ibm,842-coprocessor-type	: CT value common to all 842 coprocessors
+ibm,842-coprocessor-instance	: CI value unique to all 842 coprocessors
+
+Access to the coprocessor requires using the ICSWX instruction, which uses
+a specific format including a Coprocessor Type (CT) and Coprocessor Instance
+(CI) value to address each request to the right coprocessor.  The driver should
+use the CT and CI values for a particular node to communicate with it.  For
+all 842 coprocessors in the system, the CT value will (should) be the same,
+while each will have a different CI value.  The driver can use CI 0 to allow
+the hardware to automatically select which coprocessor instance to use.
 
 
 NX RNG Coprocessor
@@ -18,7 +34,7 @@ NX RNG Coprocessor
 
 This is the Random Number Generator (RNG) coprocessor, which is a part
 of each NX coprocessor.  Each node represents a unique RNG coprocessor.
-The nodes are located at:
+Its nodes are not under the main nx node, they are located at:
 
 /hwrng@<addr>		: RNG at address <addr>
 ibm,chip-id		: chip id where the RNG is
@@ -27,21 +43,3 @@ reg			: address of the register to read from
 Each read from the RNG register will provide a new random number.
 
 
-NX 842 Coprocessor
-------------------
-
-This is the memory compression coprocessor, which uses the IBM proprietary
-842 compression algorithm and format.  Each node represents a unique 842
-coprocessor.  The nodes are located at:
-
-/ibm,nx842-powernv#<chip-id>	: 842 coprocessor on chip <chip-id>
-ibm,chip-id			: chip id where the 842 is
-ibm,coprocessor-type		: CT value common to all 842 coprocessors
-ibm,coprocessor-instance	: CI value unique to all 842 coprocessors
-
-Access to the coprocessor requires using the ICSWX instruction, which uses
-a specific format including a Coprocessor Type (CT) and Coprocessor Instance (CI)
-value to address each request to the right coprocessor.  The system should
-use the CT and CI values for a particular node to communicate with it.  For
-all 842 coprocessors in the system, the CT value will (should) be the same,
-while each will have a different CI value.
diff --git a/hw/nx-842.c b/hw/nx-842.c
index 1cf2e12..0c456a9 100644
--- a/hw/nx-842.c
+++ b/hw/nx-842.c
@@ -164,9 +164,7 @@ void nx_create_842_node(struct dt_node *node)
 	u32 pb_base;
 	u64 cfg_dma, cfg_842, cfg_ee;
 	u64 instance;
-	struct dt_node *dt_842;
 	int rc, pnum;
-	char node_name[32];
 
 	gcid = dt_get_chip_id(node);
 	pb_base = dt_get_address(node, 0, NULL);
@@ -203,13 +201,6 @@ void nx_create_842_node(struct dt_node *node)
 
 	prlog(PR_INFO, "NX%d: 842 Coprocessor Enabled\n", gcid);
 
-	snprintf(node_name, sizeof(node_name), "ibm,nx842-powernv#%d", gcid);
-	dt_842 = dt_new(dt_root, node_name);
-	if (!dt_842)
-		return;
-
-	dt_add_property_strings(dt_842, "compatible", "ibm,nx842-powernv");
-	dt_add_property_cells(dt_842, "ibm,chip-id", gcid);
-	dt_add_property_cells(dt_842, "ibm,coprocessor-type", NX_CT_842);
-	dt_add_property_cells(dt_842, "ibm,coprocessor-instance", instance);
+	dt_add_property_cells(node, "ibm,842-coprocessor-type", NX_CT_842);
+	dt_add_property_cells(node, "ibm,842-coprocessor-instance", instance);
 }
-- 
2.1.0



More information about the Skiboot mailing list