[Skiboot] [PATCH 06/33] chip: Add more P9 accessors for converting to/from PIR

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Jun 25 08:47:29 AEST 2016


To access a local CPU number within a chip essentially, will be
used by XIVE

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 include/chip.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/chip.h b/include/chip.h
index 463cce3..0038814 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -87,7 +87,10 @@
  * |               |           |
  * |___|___|___|___|___|___|___|
  *
- * Bit 56 is unused according to the manual by we add it to the coreid here.
+ * Bit 56 is unused according to the manual by we add it to the coreid here,
+ * thus we have a 6-bit core number.
+ *
+ * Note: XIVE Only supports 4-bit chip numbers ...
  */
 #define P9_PIR2GCID(pir) (((pir) >> 8) & 0x7f)
 
@@ -95,6 +98,11 @@
 
 #define P9_PIR2THREADID(pir) ((pir) & 0x3)
 
+/* P9 specific ones mostly used by XIVE */
+#define P9_PIR2LOCALCPU(pir) ((pir) & 0xff)
+#define P9_PIRFROMLOCALCPU(chip, cpu)	(((chip) << 8) | (cpu))
+
+
 struct dt_node;
 struct centaur_chip;
 struct mfsi;
-- 
2.7.4



More information about the Skiboot mailing list