[Skiboot] [PATCH v4 2/5] hdat: Add 'primary' property to master chip xscom node

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Tue Apr 18 18:53:29 AEST 2017


Needed for SBE communication as some of the SBE MBOX commands
has to be sent to master chip SBE only.

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

diff --git a/hdata/spira.c b/hdata/spira.c
index 3340a09..a7689cb 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -401,6 +401,20 @@ static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid)
 	}
 }
 
+static void add_xscom_primary_property(const struct HDIF_common_hdr *hdif,
+				       struct dt_node *xscom)
+{
+	uint32_t size = 0;
+	const void *pnor;
+
+	pnor = HDIF_get_idata(hdif, SPPCRD_IDATA_PNOR_INFO, &size);
+	/* PNOR is attached to master chip only */
+	if (pnor && size != 0) {
+		dt_add_property(xscom, "primary", NULL, 0);
+		prlog(PR_DEBUG, "XSCOM: Found primary chip ID\n");
+	}
+}
+
 static bool add_xscom_sppcrd(uint64_t xscom_base)
 {
 	const struct HDIF_common_hdr *hdif;
@@ -471,6 +485,7 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
 		if (proc_gen >= proc_gen_p9) {
 			add_xive_node(np);
 			parse_i2c_devs(hdif, SPPCRD_IDATA_HOST_I2C, np);
+			add_xscom_primary_property(hdif, np);
 		}
 	}
 
-- 
2.9.3



More information about the Skiboot mailing list