[PATCH 10/19] ppc64: Make some generic irq code compile for iSeries

Michael Ellerman michael at ellerman.id.au
Tue Jul 26 18:58:41 EST 2005


In order to call finish_device_tree() on iSeries we need
virt_irq_create_mapping() linked. We also need to set
ppc64_interrupt_controller set to !0. If we want to do interrupt setup via
the device tree this code will need some serious work, but it's harmless to
have it there as long as the iSeries device tree doesn't invoke it.

---

 arch/ppc64/kernel/iSeries_irq.c   |    2 +-
 arch/ppc64/kernel/iSeries_setup.c |    2 ++
 arch/ppc64/kernel/irq.c           |    5 ++++-
 include/asm-ppc64/processor.h     |    1 +
 4 files changed, 8 insertions(+), 2 deletions(-)

Index: work/arch/ppc64/kernel/iSeries_irq.c
===================================================================
--- work.orig/arch/ppc64/kernel/iSeries_irq.c
+++ work/arch/ppc64/kernel/iSeries_irq.c
@@ -43,7 +43,7 @@
 #include <asm/iSeries/iSeries_irq.h>
 
 /* This maps virtual irq numbers to real irqs */
-unsigned int virt_irq_to_real_map[NR_IRQS];
+extern unsigned int virt_irq_to_real_map[NR_IRQS];
 
 /* The next available virtual irq number */
 /* Note: the pcnet32 driver assumes irq numbers < 2 aren't valid. :( */
Index: work/arch/ppc64/kernel/irq.c
===================================================================
--- work.orig/arch/ppc64/kernel/irq.c
+++ work/arch/ppc64/kernel/irq.c
@@ -353,7 +353,6 @@ void __init init_IRQ(void)
 	irq_ctx_init();
 }
 
-#ifndef CONFIG_PPC_ISERIES
 /*
  * Virtual IRQ mapping code, used on systems with XICS interrupt controllers.
  */
@@ -389,6 +388,9 @@ int virt_irq_create_mapping(unsigned int
 	unsigned int virq, first_virq;
 	static int warned;
 
+	if (ppc64_interrupt_controller == IC_ISERIES)
+		return real_irq;	/* XXX this is broken for real work */
+
 	if (ppc64_interrupt_controller == IC_OPEN_PIC)
 		return real_irq;	/* no mapping for openpic (for now) */
 
@@ -430,6 +432,7 @@ int virt_irq_create_mapping(unsigned int
 	return NO_IRQ;
 }
 
+#ifndef CONFIG_PPC_ISERIES
 /*
  * In most cases will get a hit on the very first slot checked in the
  * virt_irq_to_real_map.  Only when there are a large number of
Index: work/arch/ppc64/kernel/iSeries_setup.c
===================================================================
--- work.orig/arch/ppc64/kernel/iSeries_setup.c
+++ work/arch/ppc64/kernel/iSeries_setup.c
@@ -318,6 +318,8 @@ static void __init iSeries_init_early(vo
 
 	ppcdbg_initialize();
 
+	ppc64_interrupt_controller = IC_ISERIES;
+
 #if defined(CONFIG_BLK_DEV_INITRD)
 	/*
 	 * If the init RAM disk has been configured and there is
Index: work/include/asm-ppc64/processor.h
===================================================================
--- work.orig/include/asm-ppc64/processor.h
+++ work/include/asm-ppc64/processor.h
@@ -290,6 +290,7 @@
 #define IC_OPEN_PIC   1
 #define IC_PPC_XIC    2
 #define IC_BPA_IIC    3
+#define IC_ISERIES    4
 
 #define XGLUE(a,b) a##b
 #define GLUE(a,b) XGLUE(a,b)



More information about the Linuxppc64-dev mailing list