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

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sun Jul 23 21:30:47 AEST 2017


Needed for SBE communication as some of the SBE MBOX commands
has to be sent to SBE on master chip 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 d09dbfe..e6fbf0e 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)
+{
+	const void *pnor;
+	uint32_t size = 0;
+
+	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