[Skiboot] [PATCH 42/61] xive/p10: Configure XIVE for fused cores

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Jul 19 23:19:53 AEST 2021


From: Cédric Le Goater <clg at kaod.org>

Signed-off-by: Cédric Le Goater <clg at kaod.org>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/xive2.c           | 17 ++++++++++++++++-
 include/xive2-regs.h | 12 ++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/hw/xive2.c b/hw/xive2.c
index 77fe34753..4b97dae74 100644
--- a/hw/xive2.c
+++ b/hw/xive2.c
@@ -1599,6 +1599,19 @@ static bool xive_has_cap(struct xive *x, uint64_t cap)
 
 #define XIVE_CAN_STORE_EOI(x) xive_has_cap(x, CQ_XIVE_CAP_STORE_EOI)
 
+static void xive_config_fused_core(struct xive *x)
+{
+	uint64_t val = xive_regr(x, TCTXT_CFG);
+
+	if (this_cpu()->is_fused_core) {
+		val |= TCTXT_CFG_FUSE_CORE_EN;
+		xive_dbg(x, "configured for fused cores. "
+			 "PC_TCTXT_CFG=%016llx\n", val);
+	} else
+		val &= ~TCTXT_CFG_FUSE_CORE_EN;
+	xive_regw(x, TCTXT_CFG, val);
+}
+
 static void xive_config_reduced_priorities_fixup(struct xive *x)
 {
 	if (xive_cfg_vp_prio_shift(x) < CQ_XIVE_CFG_INT_PRIO_8 &&
@@ -1691,6 +1704,8 @@ static bool xive_config_init(struct xive *x)
 	xive_dbg(x, "store EOI is %savailable\n",
 		 XIVE_CAN_STORE_EOI(x) ? "" : "not ");
 
+	xive_config_fused_core(x);
+
 	xive_config_reduced_priorities_fixup(x);
 
 	return true;
@@ -3012,7 +3027,7 @@ static void xive_init_cpu(struct cpu_thread *c)
 	 * of a pair is present we just do the setup for each of them, which
 	 * is harmless.
 	 */
-	if (cpu_is_thread0(c))
+	if (cpu_is_thread0(c) || cpu_is_core_chiplet_primary(c))
 		xive_configure_ex_special_bar(x, c);
 
 	/* Initialize the state structure */
diff --git a/include/xive2-regs.h b/include/xive2-regs.h
index 79c36ebca..6295dd191 100644
--- a/include/xive2-regs.h
+++ b/include/xive2-regs.h
@@ -392,6 +392,18 @@
 #define X_TCTXT_EN1_RESET			0x307
 #define TCTXT_EN1_RESET				0x038
 
+/* TCTXT Config register */
+#define X_TCTXT_CFG                            0x328
+#define TCTXT_CFG                              0x140
+#define  TCTXT_CFG_FUSE_CORE_EN                        PPC_BIT(0)
+#define  TCTXT_CFG_PHYP_CORE_MODE              PPC_BIT(1) /* O:Linux 1:pHyp */
+#define  TCTXT_CFG_GEN1_HYP_TARGET_DIS         PPC_BIT(4)
+#define  TCTXT_CFG_GEN1_OS_ST_ACK              PPC_BIT(5)
+#define  TCTXT_CFG_GEN1_OGEN_FINE              PPC_BIT(6)
+#define  TCTXT_CFG_INT_MSGSND_DIS              PPC_BIT(17)
+#define  TCTXT_CFG_HOSTBOOT_MODE               PPC_BIT(20)
+#define  TCTXT_CFG_COMPLEX_STORE_DIS           PPC_BITMASK(25, 27)
+
 /*
  * VSD Tables
  */
-- 
2.31.1



More information about the Skiboot mailing list