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

Message ID 1485394353-30319-2-git-send-email-sukadev@linux.vnet.ibm.com
State Under Review
Headers show

Commit Message

Sukadev Bhattiprolu Jan. 26, 2017, 1:32 a.m.
VAS needs the node and chip ids to compute the "paste address" of a
window.

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

Patch

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))