From: mostrows@watson.ibm.com
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 5/8] Avoid use of ppc64_interrupt_controller.
Date: Mon, 29 May 2006 16:42:06 -0400 [thread overview]
Message-ID: <1148935326201-git-send-email-mostrows@watson.ibm.com> (raw)
In-Reply-To: <1148935262.25048.31.camel@brick>
smp_init_pSeries() will use an XICS, unless it is told to explicitly
use an MPIC.
Checking for built-in support of the detect PIC is now consolidated in
pSeries_setup_arch. (Eventually it should be possible to avoid building
code for a PIC if support for it has not been enabled.)
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/platforms/pseries/setup.c | 28 +++++++++++++++++++++-------
arch/powerpc/platforms/pseries/smp.c | 15 +++------------
include/asm-powerpc/smp.h | 6 +++++-
3 files changed, 29 insertions(+), 20 deletions(-)
c294c06d77fbe3be12a705595ecd95f93054943e
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 33ae521..38bf976 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -153,6 +153,9 @@ static void __init pSeries_setup_mpic(vo
struct device_node *root;
int irq_count;
+ ppc_md.init_IRQ = pSeries_init_mpic;
+ ppc_md.get_irq = mpic_get_irq;
+
/* Find the Open PIC if present */
root = of_find_node_by_path("/");
opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL);
@@ -199,21 +202,32 @@ static void __init pSeries_setup_arch(vo
int int_ctrl = pSeries_discover_pic();
ppc64_interrupt_controller = int_ctrl;
+
/* Fixup ppc_md depending on the type of interrupt controller */
- if (int_ctrl == IC_OPEN_PIC) {
- ppc_md.init_IRQ = pSeries_init_mpic;
- ppc_md.get_irq = mpic_get_irq;
+ switch (int_ctrl) {
+ case IC_OPEN_PIC:
+#ifndef CONFIG_MPIC
+ panic("Kernel not configured for MPIC interrupt controller.");
+#else
/* Allocate the mpic now, so that find_and_init_phbs() can
* fill the ISUs */
pSeries_setup_mpic();
- } else {
+ smp_init_pSeries(1);
+#endif
+ break;
+ case IC_PPC_XIC:
+#ifndef CONFIG_XICS
+ panic("Kernel not configured for XICS interrupt controller.");
+#else
ppc_md.init_IRQ = xics_init_IRQ;
ppc_md.get_irq = xics_get_irq;
+ smp_init_pSeries(0);
+#endif
+ break;
+ default:
+ panic("Invalid interrupt controller");
}
-#ifdef CONFIG_SMP
- smp_init_pSeries();
-#endif
/* openpic global configuration register (64-bit format). */
/* openpic Interrupt Source Unit pointer (64-bit format). */
/* python0 facility area (mmio) (64-bit format) REAL address. */
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 3cf78a6..ef8676f 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -417,25 +417,16 @@ static struct smp_ops_t pSeries_xics_smp
#endif
/* This is called very early */
-void __init smp_init_pSeries(void)
+void __init smp_init_pSeries(int uses_mpic)
{
int i;
DBG(" -> smp_init_pSeries()\n");
- switch (ppc64_interrupt_controller) {
-#ifdef CONFIG_MPIC
- case IC_OPEN_PIC:
+ if (uses_mpic) {
smp_ops = &pSeries_mpic_smp_ops;
- break;
-#endif
-#ifdef CONFIG_XICS
- case IC_PPC_XIC:
+ } else {
smp_ops = &pSeries_xics_smp_ops;
- break;
-#endif
- default:
- panic("Invalid interrupt controller");
}
#ifdef CONFIG_HOTPLUG_CPU
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 4a716f7..11f1830 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -75,7 +75,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS
#define PPC_MSG_DEBUGGER_BREAK 3
void smp_init_iSeries(void);
-void smp_init_pSeries(void);
+void smp_init_pSeries(int uses_mpic);
void smp_init_cell(void);
void smp_setup_cpu_maps(void);
@@ -86,6 +86,10 @@ extern void __cpu_die(unsigned int cpu);
/* for UP */
#define smp_setup_cpu_maps()
+#define smp_init_pSeries(uses_mpic) do {} while(0)
+#define smp_init_iSeries() do {} while(0)
+#define smp_init_cell() do {} while(0)
+
#endif /* CONFIG_SMP */
#ifdef CONFIG_PPC64
--
1.1.4.g0b63-dirty
next prev parent reply other threads:[~2006-05-29 20:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-29 20:41 [RFC/PATCH 0/8] Overhaul of virt IRQ configuration. / Kill ppc64_interrupt_controller Michal Ostrowski
2006-05-29 20:42 ` [PATCH 2/8] PIC discovery re-organization mostrows
2006-05-29 20:42 ` [PATCH 1/8] Formalize virtual-IRQ remapping configuration mostrows
2006-05-29 20:42 ` [PATCH 4/8] Avoid use of ppc64_interrupt_controller mostrows
2006-05-29 20:42 ` [PATCH 3/8] " mostrows
2006-05-29 20:42 ` [PATCH 7/8] Cleaner checks for MPIC on pSeries mostrows
2006-05-29 20:50 ` Olof Johansson
2006-05-29 20:42 ` [PATCH 6/8] Avoid use of ppc64_interrupt_controller mostrows
2006-05-29 20:42 ` [PATCH 8/8] Kill the ppc64_interrupt_controller global symbol mostrows
2006-05-29 20:42 ` mostrows [this message]
2006-05-29 21:28 ` [RFC/PATCH 0/8] Overhaul of virt IRQ configuration. / Kill ppc64_interrupt_controller Benjamin Herrenschmidt
2006-05-29 23:08 ` Michal Ostrowski
2006-05-30 13:54 ` Michal Ostrowski
2006-05-30 22:13 ` Benjamin Herrenschmidt
2006-05-30 22:53 ` Michal Ostrowski
2006-05-30 23:10 ` Benjamin Herrenschmidt
2006-05-29 21:56 ` Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1148935326201-git-send-email-mostrows@watson.ibm.com \
--to=mostrows@watson.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.