interrupts: Do not advertise XICS support on P10

We only support the XIVE interface.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
diff --git a/core/interrupts.c b/core/interrupts.c
index 0a617d3..5d2d04d 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 @@
 
 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 @@
 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@0")) {
diff --git a/hw/xive2.c b/hw/xive2.c
index d0094e9..810ab91 100644
--- a/hw/xive2.c
+++ b/hw/xive2.c
@@ -1975,6 +1975,11 @@
 
 }
 
+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;
diff --git a/include/xive.h b/include/xive.h
index 1a8a2e0..0c8041e 100644
--- a/include/xive.h
+++ b/include/xive.h
@@ -79,6 +79,7 @@
 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);