[Skiboot] [PATCH v6 1/9] Define helpers to extract P9 node/chip ids

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Thu May 25 15:02:08 AEST 2017


VAS needs the node and chip ids to compute the "paste address" of a
window.

Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
 include/chip.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/chip.h b/include/chip.h
index b957e45..2322755 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -98,6 +98,10 @@
 
 #define P9_PIR2THREADID(pir) ((pir) & 0x3)
 
+#define P9_GCID2NODEID(gcid)	(((gcid) >> 3) & 0xf)
+
+#define P9_GCID2CHIPID(gcid) ((gcid) & 0x7)
+
 /* P9 specific ones mostly used by XIVE */
 #define P9_PIR2LOCALCPU(pir) ((pir) & 0xff)
 #define P9_PIRFROMLOCALCPU(chip, cpu)	(((chip) << 8) | (cpu))
-- 
2.7.4



More information about the Skiboot mailing list