[Skiboot] [PATCH 18/21] xive: Override the hard coded chip ID with allocated block ID

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Nov 14 13:06:18 AEDT 2016


We allocate a block ID for each chip which may not be the same
as the chip ID, we need to configure that properly.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xive.c      |  7 +++++--
 include/xive.h | 12 ++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/hw/xive.c b/hw/xive.c
index a8cc2fc..1abe5b7 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -947,11 +947,14 @@ static bool xive_config_init(struct xive *x)
 	xive_regw(x, PC_GLOBAL_CONFIG, val);
 #endif
 
-#ifdef USE_BLOCK_GROUP_MODE
 	val = xive_regr(x, PC_TCTXT_CFG);
+#ifdef USE_BLOCK_GROUP_MODE
 	val |= PC_TCTXT_CFG_BLKGRP_EN | PC_TCTXT_CFG_HARD_CHIPID_BLK;
-	xive_regw(x, PC_TCTXT_CFG, val);
 #endif
+	val |= PC_TCTXT_CHIPID_OVERRIDE;
+	val = SETFIELD(PC_TCTXT_CHIPID, val, x->block_id);
+	xive_regw(x, PC_TCTXT_CFG, val);
+
 	return true;
 }
 
diff --git a/include/xive.h b/include/xive.h
index 065aa69..98666fa 100644
--- a/include/xive.h
+++ b/include/xive.h
@@ -74,6 +74,18 @@
 #define PC_TCTXT_CFG		0x400
 #define  PC_TCTXT_CFG_BLKGRP_EN		PPC_BIT(0)
 #define  PC_TCTXT_CFG_HARD_CHIPID_BLK	PPC_BIT(8)
+#define  PC_TCTXT_CHIPID_OVERRIDE	PPC_BIT(9)
+#define  PC_TCTXT_CHIPID		PPC_BITMASK(12,15)
+#define X_PC_TCTXT_INDIR0	0x104
+#define PC_TCTXT_INDIR0		0x420
+#define  PC_TCTXT_INDIR_VALID		PPC_BIT(0)
+#define  PC_TCTXT_INDIR_THRDID		PPC_BITMASK(9,15)
+#define X_PC_TCTXT_INDIR1	0x105
+#define PC_TCTXT_INDIR1		0x428
+#define X_PC_TCTXT_INDIR2	0x106
+#define PC_TCTXT_INDIR2		0x430
+#define X_PC_TCTXT_INDIR3	0x107
+#define PC_TCTXT_INDIR3		0x438
 #define X_PC_THREAD_EN_REG0	0x108
 #define PC_THREAD_EN_REG0	0x440
 #define X_PC_THREAD_EN_REG0_SET	0x109
-- 
2.7.4



More information about the Skiboot mailing list