Commit ca786ecd authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] ppc64: remove interrupt_controller from naca

This patch just moves the interrupt_controller field of the naca into a
global variable.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7adf3c35
......@@ -65,6 +65,7 @@ extern irq_desc_t irq_desc[NR_IRQS];
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 @@ int virt_irq_create_mapping(unsigned int real_irq)
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 */
......
......@@ -155,7 +155,7 @@ static void __init maple_init_early(void)
}
/* Setup interrupt mapping options */
naca->interrupt_controller = IC_OPEN_PIC;
ppc64_interrupt_controller = IC_OPEN_PIC;
DBG(" <- maple_init_early\n");
}
......
......@@ -353,7 +353,7 @@ unsigned long __init find_and_init_phbs(void)
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 @@ unsigned long __init find_and_init_phbs(void)
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]);
}
......
......@@ -197,7 +197,7 @@ static void __init pSeries_setup_mpic(void)
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
......@@ -309,13 +309,13 @@ static void __init pSeries_discover_pic(void)
* 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");
......
......@@ -348,7 +348,7 @@ void __init smp_init_pSeries(void)
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;
......
......@@ -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 @@ void __init pmac_init_early(void)
}
/* Setup interrupt mapping options */
naca->interrupt_controller = IC_OPEN_PIC;
ppc64_interrupt_controller = IC_OPEN_PIC;
DBG(" <- pmac_init_early\n");
}
......
......@@ -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 @@ void __init finish_device_tree(void)
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");
}
......
......@@ -664,7 +664,7 @@ void __init setup_system(void)
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);
......
......@@ -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 @@ void xics_init_IRQ(void)
*/
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))
......
......@@ -25,7 +25,6 @@ struct naca_struct {
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;
......
......@@ -484,6 +484,7 @@ static inline void set_tb(unsigned int upper, unsigned int lower)
#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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment