[Skiboot] [PATCH 3/3] interrupts: Do not advertise XICS support on P10

Cédric Le Goater clg at kaod.org
Sat Aug 7 17:38:21 AEST 2021


We only support the XIVE interface.

Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 include/xive.h    |  1 +
 core/interrupts.c | 12 +++++++++++-
 hw/xive2.c        |  5 +++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/xive.h b/include/xive.h
index 1a8a2e02714b..0c8041efc07e 100644
--- a/include/xive.h
+++ b/include/xive.h
@@ -79,6 +79,7 @@ bool xive2_cap_phb_pq_disable(void);
 bool xive2_cap_phb_abt(void);
 bool xive2_cap_store_eoi(void);
 int64_t xive2_reset(void);
+uint32_t xive2_get_phandle(void);
 
 uint32_t xive2_alloc_hw_irqs(uint32_t chip_id, uint32_t count, uint32_t align);
 uint32_t xive2_alloc_ipi_irqs(uint32_t chip_id, uint32_t count, uint32_t align);
diff --git a/core/interrupts.c b/core/interrupts.c
index 0a617d385aee..5d2d04db589e 100644
--- a/core/interrupts.c
+++ b/core/interrupts.c
@@ -18,6 +18,7 @@
 #include <timer.h>
 #include <sbe-p8.h>
 #include <sbe-p9.h>
+#include <xive.h>
 
 /* ICP registers */
 #define ICP_XIRR		0x4	/* 32-bit access */
@@ -157,9 +158,14 @@ uint32_t get_psi_interrupt(uint32_t chip_id)
 
 struct dt_node *add_ics_node(void)
 {
-	struct dt_node *ics = dt_new_addr(dt_root, "interrupt-controller", 0);
+	struct dt_node *ics;
 	bool has_xive;
+	bool has_xive_only = proc_gen >= proc_gen_p10;
 
+	if (has_xive_only)
+		return NULL;
+
+	ics = dt_new_addr(dt_root, "interrupt-controller", 0);
 	if (!ics)
 		return NULL;
 
@@ -181,6 +187,10 @@ struct dt_node *add_ics_node(void)
 uint32_t get_ics_phandle(void)
 {
 	struct dt_node *i;
+	bool has_xive_only = proc_gen >= proc_gen_p10;
+
+	if (has_xive_only)
+		return xive2_get_phandle();
 
 	for (i = dt_first(dt_root); i; i = dt_next(dt_root, i)) {
 		if (streq(i->name, "interrupt-controller at 0")) {
diff --git a/hw/xive2.c b/hw/xive2.c
index d0094e9bad99..810ab91d8e0b 100644
--- a/hw/xive2.c
+++ b/hw/xive2.c
@@ -1975,6 +1975,11 @@ static void xive_create_mmio_dt_node(struct xive *x)
 
 }
 
+uint32_t xive2_get_phandle(void)
+{
+	return xive_dt_node->phandle;
+}
+
 static void xive_setup_forward_ports(struct xive *x, struct proc_chip *remote_chip)
 {
 	struct xive *remote_xive = remote_chip->xive;
-- 
2.31.1



More information about the Skiboot mailing list