diff mbox

[1/5] powerpc/pseries: Drop support for MPIC in pseries

Message ID 1464589095-442-1-git-send-email-rashmicy@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Rashmica Gupta May 30, 2016, 6:18 a.m. UTC
MPIC was only used by Power3 which is now unsupported, so drop support
for MPIC. XICS is now the only supported interrupt controller for
pSeries so make the XICS functions generic.

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
---
 arch/powerpc/platforms/pseries/setup.c | 77 +++-------------------------------
 1 file changed, 5 insertions(+), 72 deletions(-)

Comments

Benjamin Herrenschmidt May 30, 2016, 7:32 a.m. UTC | #1
On Mon, 2016-05-30 at 16:18 +1000, Rashmica Gupta wrote:
> MPIC was only used by Power3 which is now unsupported, so drop support
> for MPIC. XICS is now the only supported interrupt controller for
> pSeries so make the XICS functions generic.

The second half I'm not sure ... XIVE is around the corner...

Cheers,
Ben.
Rashmica Gupta May 31, 2016, 1:34 a.m. UTC | #2
On 30/05/16 17:32, Benjamin Herrenschmidt wrote:
> On Mon, 2016-05-30 at 16:18 +1000, Rashmica Gupta wrote:
>> MPIC was only used by Power3 which is now unsupported, so drop support
>> for MPIC. XICS is now the only supported interrupt controller for
>> pSeries so make the XICS functions generic.
> The second half I'm not sure ... XIVE is around the corner...
>
> Cheers,
> Ben.
>
I thought XIVE was replacing XICS? And so then we can just simply 
replace all the specific XICS code such as xics_init() and 
xics_smp_probe() with the relevant XIVE functions?

By "make the XICS functions generic" I meant that if there is only one 
interrupt controller for pseries then we don't need to have both static 
void __init pseries_xics_init_IRQ(void) and static void __init 
pSeries_init_IRQ(void), etc.
Rashmica Gupta May 31, 2016, 2:48 a.m. UTC | #3
On 31/05/16 11:34, Rashmica wrote:
>
>
> On 30/05/16 17:32, Benjamin Herrenschmidt wrote:
>> On Mon, 2016-05-30 at 16:18 +1000, Rashmica Gupta wrote:
>>> MPIC was only used by Power3 which is now unsupported, so drop support
>>> for MPIC. XICS is now the only supported interrupt controller for
>>> pSeries so make the XICS functions generic.
>> The second half I'm not sure ... XIVE is around the corner...
>>
>> Cheers,
>> Ben.
>>
> I thought XIVE was replacing XICS? And so then we can just simply 
> replace all the specific XICS code such as xics_init() and 
> xics_smp_probe() with the relevant XIVE functions?
>
> By "make the XICS functions generic" I meant that if there is only one 
> interrupt controller for pseries then we don't need to have both 
> static void __init pseries_xics_init_IRQ(void) and static void __init 
> pSeries_init_IRQ(void), etc.

Oliver just informed me that it is only replacing XICS for p9. Should I 
leave this for the person adding in the XIVE code?
Benjamin Herrenschmidt May 31, 2016, 3 a.m. UTC | #4
On Tue, 2016-05-31 at 11:34 +1000, Rashmica wrote:
> 
> On 30/05/16 17:32, Benjamin Herrenschmidt wrote:
> > 
> > On Mon, 2016-05-30 at 16:18 +1000, Rashmica Gupta wrote:
> > > 
> > > MPIC was only used by Power3 which is now unsupported, so drop support
> > > for MPIC. XICS is now the only supported interrupt controller for
> > > pSeries so make the XICS functions generic.
> > The second half I'm not sure ... XIVE is around the corner...
> > 
> > Cheers,
> > Ben.
> > 
> I thought XIVE was replacing XICS? And so then we can just simply 
> replace all the specific XICS code such as xics_init() and 
> xics_smp_probe() with the relevant XIVE functions?

We still need to boot on P8 that doesn't have XIVE, so we need to
support both. IE, the same way we had to chose at runtime between MPIC
and XICS, we'll now have to chose between XICS and XIVE.

> By "make the XICS functions generic" I meant that if there is only one 
> interrupt controller for pseries then we don't need to have both static 
> void __init pseries_xics_init_IRQ(void) and static void __init 
> pSeries_init_IRQ(void), etc.

There will be two.

Cheers,
Ben.
Benjamin Herrenschmidt May 31, 2016, 4:52 a.m. UTC | #5
On Tue, 2016-05-31 at 12:48 +1000, Rashmica wrote:
> 
> Oliver just informed me that it is only replacing XICS for p9. Should
> I leave this for the person adding in the XIVE code?

That would be me ;-) It will cost you a beer !

Cheers,
Ben.
Michael Ellerman May 31, 2016, 5:04 a.m. UTC | #6
On Tue, 2016-05-31 at 12:48 +1000, Rashmica wrote:
> On 31/05/16 11:34, Rashmica wrote:
> > On 30/05/16 17:32, Benjamin Herrenschmidt wrote:
> > > On Mon, 2016-05-30 at 16:18 +1000, Rashmica Gupta wrote:
> > > > MPIC was only used by Power3 which is now unsupported, so drop support
> > > > for MPIC. XICS is now the only supported interrupt controller for
> > > > pSeries so make the XICS functions generic.
> > > The second half I'm not sure ... XIVE is around the corner...
> > > 
> > I thought XIVE was replacing XICS? And so then we can just simply 
> > replace all the specific XICS code such as xics_init() and 
> > xics_smp_probe() with the relevant XIVE functions?
> > 
> > By "make the XICS functions generic" I meant that if there is only one 
> > interrupt controller for pseries then we don't need to have both 
> > static void __init pseries_xics_init_IRQ(void) and static void __init 
> > pSeries_init_IRQ(void), etc.
> 
> Oliver just informed me that it is only replacing XICS for p9. Should I 
> leave this for the person adding in the XIVE code?

I haven't heard of this "XIVE" thing but anyway ..

I would hope we can come up with a better abstraction than this for XICS/XIVE,
so I'm inclined to merge this anyway. Worst case we end up putting some of it
back.

cheers
Benjamin Herrenschmidt May 31, 2016, 5:30 a.m. UTC | #7
On Tue, 2016-05-31 at 15:04 +1000, Michael Ellerman wrote:
> I haven't heard of this "XIVE" thing but anyway ..
> 
> I would hope we can come up with a better abstraction than this for XICS/XIVE,
> so I'm inclined to merge this anyway. Worst case we end up putting some of it
> back.

Just merge it, I'll sort it out. If you haven't heard from XIVE, you
have better noise cancelling headphones than I thought ;-)

Cheers,
Ben.
Michael Ellerman June 15, 2016, 12:39 p.m. UTC | #8
On Mon, 2016-30-05 at 06:18:11 UTC, Rashmica Gupta wrote:
> MPIC was only used by Power3 which is now unsupported, so drop support
> for MPIC. XICS is now the only supported interrupt controller for
> pSeries so make the XICS functions generic.
> 
> Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/e7da5dac4e9067a526136db2f2

cheers
diff mbox

Patch

diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 9883bc7ea007..f83ac9be7f34 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -57,7 +57,6 @@ 
 #include <asm/time.h>
 #include <asm/nvram.h>
 #include <asm/pmc.h>
-#include <asm/mpic.h>
 #include <asm/xics.h>
 #include <asm/ppc-pci.h>
 #include <asm/i8259.h>
@@ -77,8 +76,6 @@  EXPORT_SYMBOL(CMO_PageSize);
 
 int fwnmi_active;  /* TRUE if an FWNMI handler is present */
 
-static struct device_node *pSeries_mpic_node;
-
 static void pSeries_show_cpuinfo(struct seq_file *m)
 {
 	struct device_node *root;
@@ -172,48 +169,7 @@  static void __init pseries_setup_i8259_cascade(void)
 	irq_set_chained_handler(cascade, pseries_8259_cascade);
 }
 
-static void __init pseries_mpic_init_IRQ(void)
-{
-	struct device_node *np;
-	const unsigned int *opprop;
-	unsigned long openpic_addr = 0;
-	int naddr, n, i, opplen;
-	struct mpic *mpic;
-
-	np = of_find_node_by_path("/");
-	naddr = of_n_addr_cells(np);
-	opprop = of_get_property(np, "platform-open-pic", &opplen);
-	if (opprop != NULL) {
-		openpic_addr = of_read_number(opprop, naddr);
-		printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
-	}
-	of_node_put(np);
-
-	BUG_ON(openpic_addr == 0);
-
-	/* Setup the openpic driver */
-	mpic = mpic_alloc(pSeries_mpic_node, openpic_addr,
-			MPIC_NO_RESET, 16, 0, " MPIC     ");
-	BUG_ON(mpic == NULL);
-
-	/* Add ISUs */
-	opplen /= sizeof(u32);
-	for (n = 0, i = naddr; i < opplen; i += naddr, n++) {
-		unsigned long isuaddr = of_read_number(opprop + i, naddr);
-		mpic_assign_isu(mpic, n, isuaddr);
-	}
-
-	/* Setup top-level get_irq */
-	ppc_md.get_irq = mpic_get_irq;
-
-	/* All ISUs are setup, complete initialization */
-	mpic_init(mpic);
-
-	/* Look for cascade */
-	pseries_setup_i8259_cascade();
-}
-
-static void __init pseries_xics_init_IRQ(void)
+static void __init pSeries_init_IRQ(void)
 {
 	xics_init();
 	pseries_setup_i8259_cascade();
@@ -228,32 +184,6 @@  static void pseries_lpar_enable_pmcs(void)
 	plpar_hcall_norets(H_PERFMON, set, reset);
 }
 
-static void __init pseries_discover_pic(void)
-{
-	struct device_node *np;
-	const char *typep;
-
-	for_each_node_by_name(np, "interrupt-controller") {
-		typep = of_get_property(np, "compatible", NULL);
-		if (!typep)
-			continue;
-		if (strstr(typep, "open-pic")) {
-			pSeries_mpic_node = of_node_get(np);
-			ppc_md.init_IRQ       = pseries_mpic_init_IRQ;
-			setup_kexec_cpu_down_mpic();
-			smp_init_pseries_mpic();
-			return;
-		} else if (strstr(typep, "ppc-xicp")) {
-			ppc_md.init_IRQ       = pseries_xics_init_IRQ;
-			setup_kexec_cpu_down_xics();
-			smp_init_pseries_xics();
-			return;
-		}
-	}
-	printk(KERN_ERR "pSeries_discover_pic: failed to recognize"
-	       " interrupt-controller\n");
-}
-
 static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *data)
 {
 	struct of_reconfig_data *rd = data;
@@ -506,7 +436,9 @@  static void __init pSeries_setup_arch(void)
 	set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
 
 	/* Discover PIC type and setup ppc_md accordingly */
-	pseries_discover_pic();
+	setup_kexec_cpu_down_xics();
+	smp_init_pseries_xics();
+
 
 	/* openpic global configuration register (64-bit format). */
 	/* openpic Interrupt Source Unit pointer (64-bit format). */
@@ -838,6 +770,7 @@  define_machine(pseries) {
 	.probe			= pSeries_probe,
 	.setup_arch		= pSeries_setup_arch,
 	.init_early		= pSeries_init_early,
+	.init_IRQ		= pSeries_init_IRQ,
 	.show_cpuinfo		= pSeries_show_cpuinfo,
 	.log_error		= pSeries_log_error,
 	.pcibios_fixup		= pSeries_final_fixup,