diff mbox series

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

Message ID 151297025164.31824.18083700473334227770.stgit@jupiter.in.ibm.com
State Superseded
Headers show
Series opal/hmi: Improve HMI log messages | expand

Commit Message

Mahesh J Salgaonkar Dec. 11, 2017, 5:30 a.m. UTC
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

This patch adds chip location code property to xscom node.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
 hdata/spira.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Vasant Hegde Dec. 11, 2017, 5:51 a.m. UTC | #1
On 12/11/2017 11:00 AM, Mahesh J Salgaonkar wrote:
> From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>
> This patch adds chip location code property to xscom node.

Hmmm. This breaks hdata test cases. Lets fix that in v2.

-Vasant
diff mbox series

Patch

diff --git a/hdata/spira.c b/hdata/spira.c
index 11d3ade..66493c8 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,