[PATCH][RFC] more naca cleanups
Stephen Rothwell
sfr at canb.auug.org.au
Fri Dec 10 15:15:47 EST 2004
Hi all,
This patch moves interrupt_controller out of the naca. It applies on top
of the other two. It builds on iSeries, pSeries and pmac and has been test
booted on a pSeries (44P 270).
--
Cheers,
Stephen Rothwell sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/irq.c linus-bk-naca.3a/arch/ppc64/kernel/irq.c
--- linus-bk-naca.2a/arch/ppc64/kernel/irq.c 2004-10-21 07:17:18.000000000 +1000
+++ linus-bk-naca.3a/arch/ppc64/kernel/irq.c 2004-12-09 02:50:34.000000000 +1100
@@ -65,6 +65,7 @@
int __irq_offset_value;
int ppc_spurious_interrupts;
unsigned long lpevent_count;
+u64 ppc64_interrupt_controller;
int show_interrupts(struct seq_file *p, void *v)
{
@@ -360,7 +361,7 @@
unsigned int virq, first_virq;
static int warned;
- if (naca->interrupt_controller == IC_OPEN_PIC)
+ if (ppc64_interrupt_controller == IC_OPEN_PIC)
return real_irq; /* no mapping for openpic (for now) */
/* don't map interrupts < MIN_VIRT_IRQ */
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/maple_setup.c linus-bk-naca.3a/arch/ppc64/kernel/maple_setup.c
--- linus-bk-naca.2a/arch/ppc64/kernel/maple_setup.c 2004-10-30 08:33:22.000000000 +1000
+++ linus-bk-naca.3a/arch/ppc64/kernel/maple_setup.c 2004-12-10 12:02:32.000000000 +1100
@@ -155,7 +155,7 @@
}
/* Setup interrupt mapping options */
- naca->interrupt_controller = IC_OPEN_PIC;
+ ppc64_interrupt_controller = IC_OPEN_PIC;
DBG(" <- maple_init_early\n");
}
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/pSeries_pci.c linus-bk-naca.3a/arch/ppc64/kernel/pSeries_pci.c
--- linus-bk-naca.2a/arch/ppc64/kernel/pSeries_pci.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-naca.3a/arch/ppc64/kernel/pSeries_pci.c 2004-12-09 02:58:40.000000000 +1100
@@ -353,7 +353,7 @@
unsigned int *opprop = NULL;
struct device_node *root = of_find_node_by_path("/");
- if (naca->interrupt_controller == IC_OPEN_PIC) {
+ if (ppc64_interrupt_controller == IC_OPEN_PIC) {
opprop = (unsigned int *)get_property(root,
"platform-open-pic", NULL);
}
@@ -375,7 +375,7 @@
pci_process_bridge_OF_ranges(phb, node);
pci_setup_phb_io(phb, index == 0);
- if (naca->interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
+ if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
int addr = root_size_cells * (index + 2) - 1;
mpic_assign_isu(pSeries_mpic, index, opprop[addr]);
}
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/pSeries_setup.c linus-bk-naca.3a/arch/ppc64/kernel/pSeries_setup.c
--- linus-bk-naca.2a/arch/ppc64/kernel/pSeries_setup.c 2004-10-26 16:06:41.000000000 +1000
+++ linus-bk-naca.3a/arch/ppc64/kernel/pSeries_setup.c 2004-12-10 12:11:14.000000000 +1100
@@ -196,7 +196,7 @@
static void __init pSeries_setup_arch(void)
{
/* Fixup ppc_md depending on the type of interrupt controller */
- if (naca->interrupt_controller == IC_OPEN_PIC) {
+ if (ppc64_interrupt_controller == IC_OPEN_PIC) {
ppc_md.init_IRQ = pSeries_init_mpic;
ppc_md.get_irq = mpic_get_irq;
/* Allocate the mpic now, so that find_and_init_phbs() can
@@ -305,13 +305,13 @@
* to properly parse the OF interrupt tree & do the virtual irq mapping
*/
__irq_offset_value = NUM_ISA_INTERRUPTS;
- naca->interrupt_controller = IC_INVALID;
+ ppc64_interrupt_controller = IC_INVALID;
for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) {
typep = (char *)get_property(np, "compatible", NULL);
if (strstr(typep, "open-pic"))
- naca->interrupt_controller = IC_OPEN_PIC;
+ ppc64_interrupt_controller = IC_OPEN_PIC;
else if (strstr(typep, "ppc-xicp"))
- naca->interrupt_controller = IC_PPC_XIC;
+ ppc64_interrupt_controller = IC_PPC_XIC;
else
printk("initialize_naca: failed to recognize"
" interrupt-controller\n");
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/pSeries_smp.c linus-bk-naca.3a/arch/ppc64/kernel/pSeries_smp.c
--- linus-bk-naca.2a/arch/ppc64/kernel/pSeries_smp.c 2004-11-12 09:09:48.000000000 +1100
+++ linus-bk-naca.3a/arch/ppc64/kernel/pSeries_smp.c 2004-12-09 03:01:03.000000000 +1100
@@ -358,7 +358,7 @@
DBG(" -> smp_init_pSeries()\n");
- if (naca->interrupt_controller == IC_OPEN_PIC)
+ if (ppc64_interrupt_controller == IC_OPEN_PIC)
smp_ops = &pSeries_mpic_smp_ops;
else
smp_ops = &pSeries_xics_smp_ops;
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/pmac_setup.c linus-bk-naca.3a/arch/ppc64/kernel/pmac_setup.c
--- linus-bk-naca.2a/arch/ppc64/kernel/pmac_setup.c 2004-12-09 15:24:10.000000000 +1100
+++ linus-bk-naca.3a/arch/ppc64/kernel/pmac_setup.c 2004-12-10 12:00:55.000000000 +1100
@@ -70,7 +70,6 @@
#include <asm/time.h>
#include <asm/of_device.h>
#include <asm/lmb.h>
-#include <asm/naca.h>
#include "pmac.h"
#include "mpic.h"
@@ -316,7 +315,7 @@
}
/* Setup interrupt mapping options */
- naca->interrupt_controller = IC_OPEN_PIC;
+ ppc64_interrupt_controller = IC_OPEN_PIC;
DBG(" <- pmac_init_early\n");
}
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/prom.c linus-bk-naca.3a/arch/ppc64/kernel/prom.c
--- linus-bk-naca.2a/arch/ppc64/kernel/prom.c 2004-12-09 17:08:06.000000000 +1100
+++ linus-bk-naca.3a/arch/ppc64/kernel/prom.c 2004-12-10 12:04:58.000000000 +1100
@@ -44,7 +44,6 @@
#include <asm/system.h>
#include <asm/mmu.h>
#include <asm/pgtable.h>
-#include <asm/naca.h>
#include <asm/pci.h>
#include <asm/iommu.h>
#include <asm/bootinfo.h>
@@ -557,7 +556,7 @@
DBG(" -> finish_device_tree\n");
- if (naca->interrupt_controller == IC_INVALID) {
+ if (ppc64_interrupt_controller == IC_INVALID) {
DBG("failed to configure interrupt controller type\n");
panic("failed to configure interrupt controller type\n");
}
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/setup.c linus-bk-naca.3a/arch/ppc64/kernel/setup.c
--- linus-bk-naca.2a/arch/ppc64/kernel/setup.c 2004-12-09 17:17:14.000000000 +1100
+++ linus-bk-naca.3a/arch/ppc64/kernel/setup.c 2004-12-10 12:06:07.000000000 +1100
@@ -664,7 +664,7 @@
printk("naca = 0x%p\n", naca);
printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
printk("naca->debug_switch = 0x%lx\n", naca->debug_switch);
- printk("naca->interrupt_controller = 0x%ld\n", naca->interrupt_controller);
+ printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
printk("systemcfg = 0x%p\n", systemcfg);
printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount);
diff -ruN linus-bk-naca.2a/arch/ppc64/kernel/xics.c linus-bk-naca.3a/arch/ppc64/kernel/xics.c
--- linus-bk-naca.2a/arch/ppc64/kernel/xics.c 2004-10-27 07:32:57.000000000 +1000
+++ linus-bk-naca.3a/arch/ppc64/kernel/xics.c 2004-12-10 12:06:57.000000000 +1100
@@ -24,7 +24,6 @@
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/smp.h>
-#include <asm/naca.h>
#include <asm/rtas.h>
#include <asm/xics.h>
#include <asm/hvcall.h>
@@ -575,7 +574,7 @@
*/
static int __init xics_setup_i8259(void)
{
- if (naca->interrupt_controller == IC_PPC_XIC &&
+ if (ppc64_interrupt_controller == IC_PPC_XIC &&
xics_irq_8259_cascade != -1) {
if (request_irq(irq_offset_up(xics_irq_8259_cascade),
no_action, 0, "8259 cascade", NULL))
diff -ruN linus-bk-naca.2a/include/asm-ppc64/naca.h linus-bk-naca.3a/include/asm-ppc64/naca.h
--- linus-bk-naca.2a/include/asm-ppc64/naca.h 2004-12-09 17:25:40.000000000 +1100
+++ linus-bk-naca.3a/include/asm-ppc64/naca.h 2004-12-10 12:07:56.000000000 +1100
@@ -25,7 +25,6 @@
u64 banner; /* Ptr to banner string 0x28 */
u64 log; /* Ptr to log buffer 0x30 */
u64 serialPortAddr; /* Phy addr of serial port 0x38 */
- u64 interrupt_controller; /* Type of int controller 0x40 */
};
extern struct naca_struct *naca;
diff -ruN linus-bk-naca.2a/include/asm-ppc64/processor.h linus-bk-naca.3a/include/asm-ppc64/processor.h
--- linus-bk-naca.2a/include/asm-ppc64/processor.h 2004-12-09 15:21:04.000000000 +1100
+++ linus-bk-naca.3a/include/asm-ppc64/processor.h 2004-12-10 12:08:33.000000000 +1100
@@ -484,6 +484,7 @@
#ifdef __KERNEL__
extern int have_of;
+extern u64 ppc64_interrupt_controller;
struct task_struct;
void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20041210/f68b87b6/attachment.pgp
More information about the Linuxppc64-dev
mailing list