[Skiboot] [PATCH v2 1/6] hdata: Add location code property to xscom node

Mahesh J Salgaonkar mahesh at linux.vnet.ibm.com
Wed Dec 13 16:23:56 AEDT 2017


From: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>

This patch adds chip location code property to xscom node.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
---
Change in v2:
  - Fixed test cases
---
 hdata/spira.c                |    5 +++++
 hdata/test/p8-840-spira.dts  |    2 ++
 hdata/test/p81-811.spira.dts |    4 ++++
 3 files changed, 11 insertions(+)

diff --git a/hdata/spira.c b/hdata/spira.c
index 2cf7613..57b1d41 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -505,6 +505,7 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
 	for_each_ntuple_idx(&spira.ntuples.proc_chip, hdif, i,
 			    SPPCRD_HDIF_SIG) {
 		const struct sppcrd_chip_info *cinfo;
+		const struct spira_fru_id *fru_id = NULL;
 		unsigned int csize;
 		u32 ve, version;
 
@@ -548,6 +549,10 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
 			dt_add_property_cells(vpd_node, "ibm,chip-id",
 					      be32_to_cpu(cinfo->xscom_id));
 
+		fru_id = HDIF_get_idata(hdif, SPPCRD_IDATA_FRU_ID, NULL);
+		if (fru_id)
+			slca_vpd_add_loc_code(np, be16_to_cpu(fru_id->slca_index));
+
 		/* Add module VPD on version A and later */
 		if (version >= 0x000a) {
 			vpd = HDIF_get_idata(hdif, SPPCRD_IDATA_MODULE_VPD,
diff --git a/hdata/test/p8-840-spira.dts b/hdata/test/p8-840-spira.dts
index a384434..3e6bf6e 100644
--- a/hdata/test/p8-840-spira.dts
+++ b/hdata/test/p8-840-spira.dts
@@ -875,6 +875,7 @@
 		bus-frequency = <0x0 0x1dcd6500>;
 		ibm,dbob-id = <0x0>;
 		ibm,occ-functional-state = <0x1>;
+		ibm,loc-code = "U78C9.001.WZS0CWX-P1-C32";
 		ibm,module-vpd = <0xcafebeef 0x10000 0xa502aa2f>;
 		ibm,ccm-node-id = <0x0>;
 		ibm,hw-card-id = <0x0>;
@@ -937,6 +938,7 @@
 		bus-frequency = <0x0 0x1dcd6500>;
 		ibm,dbob-id = <0x0>;
 		ibm,occ-functional-state = <0x1>;
+		ibm,loc-code = "U78C9.001.WZS0CWX-P1-C32";
 		ibm,module-vpd = <0xcafebeef 0x10000 0x9f87fa41>;
 		ibm,ccm-node-id = <0x0>;
 		ibm,hw-card-id = <0x0>;
diff --git a/hdata/test/p81-811.spira.dts b/hdata/test/p81-811.spira.dts
index c0976e6..d354ad5 100644
--- a/hdata/test/p81-811.spira.dts
+++ b/hdata/test/p81-811.spira.dts
@@ -2070,6 +2070,7 @@
 		bus-frequency = <0x0 0x1dcd6500>;
 		ibm,dbob-id = <0x0>;
 		ibm,occ-functional-state = <0x1>;
+		ibm,loc-code = "U78CB.001.WZS00AL-P1-C32";
 		ibm,module-vpd = <0xcafebeef 0x10000 0x3e067c18>;
 		ibm,ccm-node-id = <0x0>;
 		ibm,hw-card-id = <0x0>;
@@ -2132,6 +2133,7 @@
 		bus-frequency = <0x0 0x1dcd6500>;
 		ibm,dbob-id = <0x0>;
 		ibm,occ-functional-state = <0x1>;
+		ibm,loc-code = "U78CB.001.WZS00AL-P1-C32";
 		ibm,module-vpd = <0xcafebeef 0x10000 0x1b85218f>;
 		ibm,ccm-node-id = <0x0>;
 		ibm,hw-card-id = <0x0>;
@@ -2191,6 +2193,7 @@
 		bus-frequency = <0x0 0x1dcd6500>;
 		ibm,dbob-id = <0x0>;
 		ibm,occ-functional-state = <0x1>;
+		ibm,loc-code = "U78CB.001.WZS00AL-P1-C33";
 		ibm,module-vpd = <0xcafebeef 0x10000 0x36f99ead>;
 		ibm,ccm-node-id = <0x0>;
 		ibm,hw-card-id = <0x0>;
@@ -2241,6 +2244,7 @@
 		bus-frequency = <0x0 0x1dcd6500>;
 		ibm,dbob-id = <0x0>;
 		ibm,occ-functional-state = <0x1>;
+		ibm,loc-code = "U78CB.001.WZS00AL-P1-C33";
 		ibm,module-vpd = <0xcafebeef 0x10000 0x65fe8f66>;
 		ibm,ccm-node-id = <0x0>;
 		ibm,hw-card-id = <0x0>;



More information about the Skiboot mailing list