[Skiboot] [PATCH v5 1/7] Define helpers to extract P9 node/chip ids

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Thu Jan 26 12:32:27 AEDT 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 61b413c..f16f00b 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