Commit 48b1bf86 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt

Merge branch 'mpic' into next

parents 4666ca2a 09dc34a9
...@@ -251,6 +251,9 @@ struct mpic_irq_save { ...@@ -251,6 +251,9 @@ struct mpic_irq_save {
/* The instance data of a given MPIC */ /* The instance data of a given MPIC */
struct mpic struct mpic
{ {
/* The OpenFirmware dt node for this MPIC */
struct device_node *node;
/* The remapper for this MPIC */ /* The remapper for this MPIC */
struct irq_host *irqhost; struct irq_host *irqhost;
...@@ -293,6 +296,9 @@ struct mpic ...@@ -293,6 +296,9 @@ struct mpic
/* Register access method */ /* Register access method */
enum mpic_reg_type reg_type; enum mpic_reg_type reg_type;
/* The physical base address of the MPIC */
phys_addr_t paddr;
/* The various ioremap'ed bases */ /* The various ioremap'ed bases */
struct mpic_reg_bank gregs; struct mpic_reg_bank gregs;
struct mpic_reg_bank tmregs; struct mpic_reg_bank tmregs;
...@@ -331,11 +337,11 @@ struct mpic ...@@ -331,11 +337,11 @@ struct mpic
* Note setting any ID (leaving those bits to 0) means standard MPIC * Note setting any ID (leaving those bits to 0) means standard MPIC
*/ */
/* This is the primary controller, only that one has IPIs and /*
* has afinity control. A non-primary MPIC always uses CPU0 * This is a secondary ("chained") controller; it only uses the CPU0
* registers only * registers. Primary controllers have IPIs and affinity control.
*/ */
#define MPIC_PRIMARY 0x00000001 #define MPIC_SECONDARY 0x00000001
/* Set this for a big-endian MPIC */ /* Set this for a big-endian MPIC */
#define MPIC_BIG_ENDIAN 0x00000002 #define MPIC_BIG_ENDIAN 0x00000002
......
...@@ -71,7 +71,7 @@ static void __init iss4xx_init_irq(void) ...@@ -71,7 +71,7 @@ static void __init iss4xx_init_irq(void)
/* The MPIC driver will get everything it needs from the /* The MPIC driver will get everything it needs from the
* device-tree, just pass 0 to all arguments * device-tree, just pass 0 to all arguments
*/ */
struct mpic *mpic = mpic_alloc(np, 0, MPIC_PRIMARY, 0, 0, struct mpic *mpic = mpic_alloc(np, 0, 0, 0, 0,
" MPIC "); " MPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
mpic_init(mpic); mpic_init(mpic);
......
...@@ -31,32 +31,18 @@ ...@@ -31,32 +31,18 @@
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
#include "smp.h"
void __init corenet_ds_pic_init(void) void __init corenet_ds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic;
struct resource r; unsigned int flags = MPIC_BIG_ENDIAN |
struct device_node *np = NULL;
unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN |
MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU;
np = of_find_node_by_type(np, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
if (ppc_md.get_irq == mpic_get_coreint_irq) if (ppc_md.get_irq == mpic_get_coreint_irq)
flags |= MPIC_ENABLE_COREINT; flags |= MPIC_ENABLE_COREINT;
mpic = mpic_alloc(np, r.start, flags, 0, 256, " OpenPIC "); mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
mpic_init(mpic); mpic_init(mpic);
...@@ -65,10 +51,6 @@ void __init corenet_ds_pic_init(void) ...@@ -65,10 +51,6 @@ void __init corenet_ds_pic_init(void)
/* /*
* Setup the architecture * Setup the architecture
*/ */
#ifdef CONFIG_SMP
void __init mpc85xx_smp_init(void);
#endif
void __init corenet_ds_setup_arch(void) void __init corenet_ds_setup_arch(void)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -77,9 +59,7 @@ void __init corenet_ds_setup_arch(void) ...@@ -77,9 +59,7 @@ void __init corenet_ds_setup_arch(void)
#endif #endif
dma_addr_t max = 0xffffffff; dma_addr_t max = 0xffffffff;
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
for_each_node_by_type(np, "pci") { for_each_node_by_type(np, "pci") {
......
...@@ -57,29 +57,10 @@ static void machine_restart(char *cmd) ...@@ -57,29 +57,10 @@ static void machine_restart(char *cmd)
static void __init ksi8560_pic_init(void) static void __init ksi8560_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
mpc85xx_cpm2_pic_init(); mpc85xx_cpm2_pic_init();
......
...@@ -36,29 +36,11 @@ ...@@ -36,29 +36,11 @@
void __init mpc8536_ds_pic_init(void) void __init mpc8536_ds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET |
struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
} }
......
...@@ -50,28 +50,10 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, ...@@ -50,28 +50,10 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
static void __init mpc85xx_ads_pic_init(void) static void __init mpc85xx_ads_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
struct device_node *np = NULL;
np = of_find_node_by_type(np, "open-pic");
if (!np) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
mpc85xx_cpm2_pic_init(); mpc85xx_cpm2_pic_init();
......
...@@ -188,30 +188,10 @@ static struct irqaction mpc85xxcds_8259_irqaction = { ...@@ -188,30 +188,10 @@ static struct irqaction mpc85xxcds_8259_irqaction = {
static void __init mpc85xx_cds_pic_init(void) static void __init mpc85xx_cds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic;
struct resource r; mpic = mpic_alloc(NULL, 0,
struct device_node *np = NULL; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
np = of_find_node_by_type(np, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
/* Return the mpic node */
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
#include "smp.h"
#include "mpc85xx.h" #include "mpc85xx.h"
...@@ -62,43 +63,27 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc) ...@@ -62,43 +63,27 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
void __init mpc85xx_ds_pic_init(void) void __init mpc85xx_ds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic;
struct resource r;
struct device_node *np;
#ifdef CONFIG_PPC_I8259 #ifdef CONFIG_PPC_I8259
struct device_node *np;
struct device_node *cascade_node = NULL; struct device_node *cascade_node = NULL;
int cascade_irq; int cascade_irq;
#endif #endif
unsigned long root = of_get_flat_dt_root(); unsigned long root = of_get_flat_dt_root();
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) {
mpic = mpic_alloc(np, r.start, mpic = mpic_alloc(NULL, 0,
MPIC_PRIMARY |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU, MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
} else { } else {
mpic = mpic_alloc(np, r.start, mpic = mpic_alloc(NULL, 0,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU, MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
} }
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
#ifdef CONFIG_PPC_I8259 #ifdef CONFIG_PPC_I8259
...@@ -154,9 +139,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, ...@@ -154,9 +139,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
/* /*
* Setup the architecture * Setup the architecture
*/ */
#ifdef CONFIG_SMP
extern void __init mpc85xx_smp_init(void);
#endif
static void __init mpc85xx_ds_setup_arch(void) static void __init mpc85xx_ds_setup_arch(void)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -189,9 +171,7 @@ static void __init mpc85xx_ds_setup_arch(void) ...@@ -189,9 +171,7 @@ static void __init mpc85xx_ds_setup_arch(void)
ppc_md.pci_exclude_device = mpc85xx_exclude_device; ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif #endif
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if (memblock_end_of_DRAM() > max) {
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <asm/qe_ic.h> #include <asm/qe_ic.h>
#include <asm/mpic.h> #include <asm/mpic.h>
#include <asm/swiotlb.h> #include <asm/swiotlb.h>
#include "smp.h"
#include "mpc85xx.h" #include "mpc85xx.h"
...@@ -155,10 +156,6 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev) ...@@ -155,10 +156,6 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev)
* Setup the architecture * Setup the architecture
* *
*/ */
#ifdef CONFIG_SMP
extern void __init mpc85xx_smp_init(void);
#endif
#ifdef CONFIG_QUICC_ENGINE #ifdef CONFIG_QUICC_ENGINE
static void __init mpc85xx_mds_reset_ucc_phys(void) static void __init mpc85xx_mds_reset_ucc_phys(void)
{ {
...@@ -363,9 +360,7 @@ static void __init mpc85xx_mds_setup_arch(void) ...@@ -363,9 +360,7 @@ static void __init mpc85xx_mds_setup_arch(void)
} }
#endif #endif
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
mpc85xx_mds_qe_init(); mpc85xx_mds_qe_init();
...@@ -439,26 +434,11 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); ...@@ -439,26 +434,11 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier);
static void __init mpc85xx_mds_pic_init(void) static void __init mpc85xx_mds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
struct device_node *np = NULL;
np = of_find_node_by_type(NULL, "open-pic");
if (!np)
return;
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
mpc85xx_mds_qeic_init(); mpc85xx_mds_qeic_init();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
#include "smp.h"
#include "mpc85xx.h" #include "mpc85xx.h"
...@@ -44,49 +45,28 @@ ...@@ -44,49 +45,28 @@
void __init mpc85xx_rdb_pic_init(void) void __init mpc85xx_rdb_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic;
struct resource r;
struct device_node *np;
unsigned long root = of_get_flat_dt_root(); unsigned long root = of_get_flat_dt_root();
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
mpic = mpic_alloc(np, r.start, mpic = mpic_alloc(NULL, 0,
MPIC_PRIMARY |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU, MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
} else { } else {
mpic = mpic_alloc(np, r.start, mpic = mpic_alloc(NULL, 0,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU, MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
} }
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
} }
/* /*
* Setup the architecture * Setup the architecture
*/ */
#ifdef CONFIG_SMP
extern void __init mpc85xx_smp_init(void);
#endif
static void __init mpc85xx_rdb_setup_arch(void) static void __init mpc85xx_rdb_setup_arch(void)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -104,10 +84,7 @@ static void __init mpc85xx_rdb_setup_arch(void) ...@@ -104,10 +84,7 @@ static void __init mpc85xx_rdb_setup_arch(void)
#endif #endif
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
} }
......
...@@ -32,24 +32,9 @@ ...@@ -32,24 +32,9 @@
void __init p1010_rdb_pic_init(void) void __init p1010_rdb_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
struct device_node *np; MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
#include <asm/fsl_guts.h> #include <asm/fsl_guts.h>
#include "smp.h"
#include "mpc85xx.h" #include "mpc85xx.h"
...@@ -240,38 +241,15 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port) ...@@ -240,38 +241,15 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port)
void __init p1022_ds_pic_init(void) void __init p1022_ds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET |
struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic");
if (!np) {
pr_err("Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
pr_err("Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU, MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
} }
#ifdef CONFIG_SMP
void __init mpc85xx_smp_init(void);
#endif
/* /*
* Setup the architecture * Setup the architecture
*/ */
...@@ -311,9 +289,7 @@ static void __init p1022_ds_setup_arch(void) ...@@ -311,9 +289,7 @@ static void __init p1022_ds_setup_arch(void)
diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; diu_ops.valid_monitor_port = p1022ds_valid_monitor_port;
#endif #endif
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if (memblock_end_of_DRAM() > max) {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/udbg.h> #include <asm/udbg.h>
#include <asm/mpic.h> #include <asm/mpic.h>
#include "smp.h"
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
...@@ -41,10 +42,6 @@ ...@@ -41,10 +42,6 @@
* Setup the architecture * Setup the architecture
* *
*/ */
#ifdef CONFIG_SMP
void __init mpc85xx_smp_init(void);
#endif
static void __init mpc85xx_rds_setup_arch(void) static void __init mpc85xx_rds_setup_arch(void)
{ {
struct device_node *np; struct device_node *np;
...@@ -89,33 +86,15 @@ static void __init mpc85xx_rds_setup_arch(void) ...@@ -89,33 +86,15 @@ static void __init mpc85xx_rds_setup_arch(void)
fsl_add_bridge(np, 0); fsl_add_bridge(np, 0);
#endif #endif
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
} }
machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices); machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
static void __init mpc85xx_rds_pic_init(void) static void __init mpc85xx_rds_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
struct device_node *np = NULL;
np = of_find_node_by_type(NULL, "open-pic");
if (!np) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
......
...@@ -54,31 +54,10 @@ static int sbc_rev; ...@@ -54,31 +54,10 @@ static int sbc_rev;
static void __init sbc8548_pic_init(void) static void __init sbc8548_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
struct device_node *np = NULL;
np = of_find_node_by_type(np, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
/* Return the mpic node */
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
} }
......
...@@ -41,28 +41,10 @@ ...@@ -41,28 +41,10 @@
static void __init sbc8560_pic_init(void) static void __init sbc8560_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
struct device_node *np = NULL;
np = of_find_node_by_type(np, "open-pic");
if (!np) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
mpc85xx_cpm2_pic_init(); mpc85xx_cpm2_pic_init();
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/mpic.h> #include <sysdev/mpic.h>
#include "smp.h"
extern void __early_start(void); extern void __early_start(void);
......
#ifndef POWERPC_85XX_SMP_H_
#define POWERPC_85XX_SMP_H_ 1
#include <linux/init.h>
#ifdef CONFIG_SMP
void __init mpc85xx_smp_init(void);
#else
static inline void mpc85xx_smp_init(void)
{
/* Nothing to do */
}
#endif
#endif /* not POWERPC_85XX_SMP_H_ */
...@@ -46,28 +46,12 @@ ...@@ -46,28 +46,12 @@
static void __init socrates_pic_init(void) static void __init socrates_pic_init(void)
{ {
struct mpic *mpic;
struct resource r;
struct device_node *np; struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic"); struct mpic *mpic = mpic_alloc(NULL, 0,
if (!np) { MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic"); np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
......
...@@ -48,28 +48,10 @@ ...@@ -48,28 +48,10 @@
static void __init stx_gp3_pic_init(void) static void __init stx_gp3_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic");
if (!np) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
mpc85xx_cpm2_pic_init(); mpc85xx_cpm2_pic_init();
......
...@@ -46,28 +46,10 @@ ...@@ -46,28 +46,10 @@
static void __init tqm85xx_pic_init(void) static void __init tqm85xx_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic");
if (!np) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
mpc85xx_cpm2_pic_init(); mpc85xx_cpm2_pic_init();
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
#include "smp.h"
#include "mpc85xx.h" #include "mpc85xx.h"
...@@ -42,29 +43,11 @@ ...@@ -42,29 +43,11 @@
void __init xes_mpc85xx_pic_init(void) void __init xes_mpc85xx_pic_init(void)
{ {
struct mpic *mpic; struct mpic *mpic = mpic_alloc(NULL, 0,
struct resource r; MPIC_WANTS_RESET |
struct device_node *np;
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Failed to map mpic register space\n");
of_node_put(np);
return;
}
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
0, 256, " OpenPIC "); 0, 256, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
of_node_put(np);
mpic_init(mpic); mpic_init(mpic);
} }
...@@ -138,9 +121,6 @@ static int primary_phb_addr; ...@@ -138,9 +121,6 @@ static int primary_phb_addr;
/* /*
* Setup the architecture * Setup the architecture
*/ */
#ifdef CONFIG_SMP
extern void __init mpc85xx_smp_init(void);
#endif
static void __init xes_mpc85xx_setup_arch(void) static void __init xes_mpc85xx_setup_arch(void)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -174,9 +154,7 @@ static void __init xes_mpc85xx_setup_arch(void) ...@@ -174,9 +154,7 @@ static void __init xes_mpc85xx_setup_arch(void)
} }
#endif #endif
#ifdef CONFIG_SMP
mpc85xx_smp_init(); mpc85xx_smp_init();
#endif
} }
machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices); machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
......
...@@ -31,26 +31,16 @@ static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc) ...@@ -31,26 +31,16 @@ static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
void __init mpc86xx_init_irq(void) void __init mpc86xx_init_irq(void)
{ {
struct mpic *mpic;
struct device_node *np;
struct resource res;
#ifdef CONFIG_PPC_I8259 #ifdef CONFIG_PPC_I8259
struct device_node *np;
struct device_node *cascade_node = NULL; struct device_node *cascade_node = NULL;
int cascade_irq; int cascade_irq;
#endif #endif
/* Determine PIC address. */ struct mpic *mpic = mpic_alloc(NULL, 0,
np = of_find_node_by_type(NULL, "open-pic"); MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
if (np == NULL) MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
return;
of_address_to_resource(np, 0, &res);
mpic = mpic_alloc(np, res.start,
MPIC_PRIMARY | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU,
0, 256, " MPIC "); 0, 256, " MPIC ");
of_node_put(np);
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
mpic_init(mpic); mpic_init(mpic);
......
...@@ -184,24 +184,10 @@ static int __init cell_publish_devices(void) ...@@ -184,24 +184,10 @@ static int __init cell_publish_devices(void)
} }
machine_subsys_initcall(cell, cell_publish_devices); machine_subsys_initcall(cell, cell_publish_devices);
static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
{
struct irq_chip *chip = irq_desc_get_chip(desc);
struct mpic *mpic = irq_desc_get_handler_data(desc);
unsigned int virq;
virq = mpic_get_one_irq(mpic);
if (virq != NO_IRQ)
generic_handle_irq(virq);
chip->irq_eoi(&desc->irq_data);
}
static void __init mpic_init_IRQ(void) static void __init mpic_init_IRQ(void)
{ {
struct device_node *dn; struct device_node *dn;
struct mpic *mpic; struct mpic *mpic;
unsigned int virq;
for (dn = NULL; for (dn = NULL;
(dn = of_find_node_by_name(dn, "interrupt-controller"));) { (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
...@@ -211,19 +197,10 @@ static void __init mpic_init_IRQ(void) ...@@ -211,19 +197,10 @@ static void __init mpic_init_IRQ(void)
/* The MPIC driver will get everything it needs from the /* The MPIC driver will get everything it needs from the
* device-tree, just pass 0 to all arguments * device-tree, just pass 0 to all arguments
*/ */
mpic = mpic_alloc(dn, 0, 0, 0, 0, " MPIC "); mpic = mpic_alloc(dn, 0, MPIC_SECONDARY, 0, 0, " MPIC ");
if (mpic == NULL) if (mpic == NULL)
continue; continue;
mpic_init(mpic); mpic_init(mpic);
virq = irq_of_parse_and_map(dn, 0);
if (virq == NO_IRQ)
continue;
printk(KERN_INFO "%s : hooking up to IRQ %d\n",
dn->full_name, virq);
irq_set_handler_data(virq, mpic);
irq_set_chained_handler(virq, cell_mpic_cascade);
} }
} }
......
...@@ -435,8 +435,7 @@ static void __init chrp_find_openpic(void) ...@@ -435,8 +435,7 @@ static void __init chrp_find_openpic(void)
if (len > 1) if (len > 1)
isu_size = iranges[3]; isu_size = iranges[3];
chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY, chrp_mpic = mpic_alloc(np, opaddr, 0, isu_size, 0, " MPIC ");
isu_size, 0, " MPIC ");
if (chrp_mpic == NULL) { if (chrp_mpic == NULL) {
printk(KERN_ERR "Failed to allocate MPIC structure\n"); printk(KERN_ERR "Failed to allocate MPIC structure\n");
goto bail; goto bail;
......
...@@ -148,30 +148,14 @@ static void __init holly_setup_arch(void) ...@@ -148,30 +148,14 @@ static void __init holly_setup_arch(void)
static void __init holly_init_IRQ(void) static void __init holly_init_IRQ(void)
{ {
struct mpic *mpic; struct mpic *mpic;
phys_addr_t mpic_paddr = 0;
struct device_node *tsi_pic;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
unsigned int cascade_pci_irq; unsigned int cascade_pci_irq;
struct device_node *tsi_pci; struct device_node *tsi_pci;
struct device_node *cascade_node = NULL; struct device_node *cascade_node = NULL;
#endif #endif
tsi_pic = of_find_node_by_type(NULL, "open-pic"); mpic = mpic_alloc(NULL, 0,
if (tsi_pic) { MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
unsigned int size;
const void *prop = of_get_property(tsi_pic, "reg", &size);
mpic_paddr = of_translate_address(tsi_pic, prop);
}
if (mpic_paddr == 0) {
printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__);
return;
}
pr_debug("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr);
mpic = mpic_alloc(tsi_pic, mpic_paddr,
MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
24, 24,
NR_IRQS-4, /* num_sources used */ NR_IRQS-4, /* num_sources used */
...@@ -179,7 +163,7 @@ static void __init holly_init_IRQ(void) ...@@ -179,7 +163,7 @@ static void __init holly_init_IRQ(void)
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); mpic_assign_isu(mpic, 0, mpic->paddr + 0x100);
mpic_init(mpic); mpic_init(mpic);
...@@ -204,7 +188,6 @@ static void __init holly_init_IRQ(void) ...@@ -204,7 +188,6 @@ static void __init holly_init_IRQ(void)
#endif #endif
/* Configure MPIC outputs to CPU0 */ /* Configure MPIC outputs to CPU0 */
tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0); tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
of_node_put(tsi_pic);
} }
void holly_show_cpuinfo(struct seq_file *m) void holly_show_cpuinfo(struct seq_file *m)
......
...@@ -81,29 +81,19 @@ static void __init linkstation_setup_arch(void) ...@@ -81,29 +81,19 @@ static void __init linkstation_setup_arch(void)
static void __init linkstation_init_IRQ(void) static void __init linkstation_init_IRQ(void)
{ {
struct mpic *mpic; struct mpic *mpic;
struct device_node *dnp;
const u32 *prop;
int size;
phys_addr_t paddr;
dnp = of_find_node_by_type(NULL, "open-pic"); mpic = mpic_alloc(NULL, 0, MPIC_WANTS_RESET,
if (dnp == NULL) 4, 32, " EPIC ");
return;
prop = of_get_property(dnp, "reg", &size);
paddr = (phys_addr_t)of_translate_address(dnp, prop);
mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
/* PCI IRQs */ /* PCI IRQs */
mpic_assign_isu(mpic, 0, paddr + 0x10200); mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
/* I2C */ /* I2C */
mpic_assign_isu(mpic, 1, paddr + 0x11000); mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
/* ttyS0, ttyS1 */ /* ttyS0, ttyS1 */
mpic_assign_isu(mpic, 2, paddr + 0x11100); mpic_assign_isu(mpic, 2, mpic->paddr + 0x11100);
mpic_init(mpic); mpic_init(mpic);
} }
......
...@@ -102,31 +102,14 @@ static void __init mpc7448_hpc2_setup_arch(void) ...@@ -102,31 +102,14 @@ static void __init mpc7448_hpc2_setup_arch(void)
static void __init mpc7448_hpc2_init_IRQ(void) static void __init mpc7448_hpc2_init_IRQ(void)
{ {
struct mpic *mpic; struct mpic *mpic;
phys_addr_t mpic_paddr = 0;
struct device_node *tsi_pic;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
unsigned int cascade_pci_irq; unsigned int cascade_pci_irq;
struct device_node *tsi_pci; struct device_node *tsi_pci;
struct device_node *cascade_node = NULL; struct device_node *cascade_node = NULL;
#endif #endif
tsi_pic = of_find_node_by_type(NULL, "open-pic"); mpic = mpic_alloc(NULL, 0,
if (tsi_pic) { MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
unsigned int size;
const void *prop = of_get_property(tsi_pic, "reg", &size);
mpic_paddr = of_translate_address(tsi_pic, prop);
}
if (mpic_paddr == 0) {
printk("%s: No tsi108 PIC found !\n", __func__);
return;
}
DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__,
(u32) mpic_paddr);
mpic = mpic_alloc(tsi_pic, mpic_paddr,
MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
24, 24,
NR_IRQS-4, /* num_sources used */ NR_IRQS-4, /* num_sources used */
...@@ -134,7 +117,7 @@ static void __init mpc7448_hpc2_init_IRQ(void) ...@@ -134,7 +117,7 @@ static void __init mpc7448_hpc2_init_IRQ(void)
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); mpic_assign_isu(mpic, 0, mpic->paddr + 0x100);
mpic_init(mpic); mpic_init(mpic);
...@@ -159,7 +142,6 @@ static void __init mpc7448_hpc2_init_IRQ(void) ...@@ -159,7 +142,6 @@ static void __init mpc7448_hpc2_init_IRQ(void)
#endif #endif
/* Configure MPIC outputs to CPU0 */ /* Configure MPIC outputs to CPU0 */
tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0); tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
of_node_put(tsi_pic);
} }
void mpc7448_hpc2_show_cpuinfo(struct seq_file *m) void mpc7448_hpc2_show_cpuinfo(struct seq_file *m)
......
...@@ -83,35 +83,17 @@ static void __init storcenter_setup_arch(void) ...@@ -83,35 +83,17 @@ static void __init storcenter_setup_arch(void)
static void __init storcenter_init_IRQ(void) static void __init storcenter_init_IRQ(void)
{ {
struct mpic *mpic; struct mpic *mpic;
struct device_node *dnp;
const void *prop;
int size;
phys_addr_t paddr;
dnp = of_find_node_by_type(NULL, "open-pic");
if (dnp == NULL)
return;
prop = of_get_property(dnp, "reg", &size);
if (prop == NULL) {
of_node_put(dnp);
return;
}
paddr = (phys_addr_t)of_translate_address(dnp, prop);
mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
16, 32, " OpenPIC ");
of_node_put(dnp);
mpic = mpic_alloc(NULL, 0, MPIC_WANTS_RESET,
16, 32, " OpenPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
/* /*
* 16 Serial Interrupts followed by 16 Internal Interrupts. * 16 Serial Interrupts followed by 16 Internal Interrupts.
* I2C is the second internal, so it is at 17, 0x11020. * I2C is the second internal, so it is at 17, 0x11020.
*/ */
mpic_assign_isu(mpic, 0, paddr + 0x10200); mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
mpic_assign_isu(mpic, 1, paddr + 0x11000); mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
mpic_init(mpic); mpic_init(mpic);
} }
......
...@@ -221,7 +221,7 @@ static void __init maple_init_IRQ(void) ...@@ -221,7 +221,7 @@ static void __init maple_init_IRQ(void)
unsigned long openpic_addr = 0; unsigned long openpic_addr = 0;
int naddr, n, i, opplen, has_isus = 0; int naddr, n, i, opplen, has_isus = 0;
struct mpic *mpic; struct mpic *mpic;
unsigned int flags = MPIC_PRIMARY; unsigned int flags = 0;
/* Locate MPIC in the device-tree. Note that there is a bug /* Locate MPIC in the device-tree. Note that there is a bug
* in Maple device-tree where the type of the controller is * in Maple device-tree where the type of the controller is
......
...@@ -224,7 +224,7 @@ static __init void pas_init_IRQ(void) ...@@ -224,7 +224,7 @@ static __init void pas_init_IRQ(void)
openpic_addr = of_read_number(opprop, naddr); openpic_addr = of_read_number(opprop, naddr);
printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS; mpic_flags = MPIC_LARGE_VECTORS | MPIC_NO_BIAS;
nmiprop = of_get_property(mpic_node, "nmi-source", NULL); nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
if (nmiprop) if (nmiprop)
...@@ -234,7 +234,7 @@ static __init void pas_init_IRQ(void) ...@@ -234,7 +234,7 @@ static __init void pas_init_IRQ(void)
mpic_flags, 0, 0, "PASEMI-OPIC"); mpic_flags, 0, 0, "PASEMI-OPIC");
BUG_ON(!mpic); BUG_ON(!mpic);
mpic_assign_isu(mpic, 0, openpic_addr + 0x10000); mpic_assign_isu(mpic, 0, mpic->paddr + 0x10000);
mpic_init(mpic); mpic_init(mpic);
/* The NMI/MCK source needs to be prio 15 */ /* The NMI/MCK source needs to be prio 15 */
if (nmiprop) { if (nmiprop) {
......
...@@ -464,18 +464,6 @@ int of_irq_map_oldworld(struct device_node *device, int index, ...@@ -464,18 +464,6 @@ int of_irq_map_oldworld(struct device_node *device, int index,
} }
#endif /* CONFIG_PPC32 */ #endif /* CONFIG_PPC32 */
static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc)
{
struct irq_chip *chip = irq_desc_get_chip(desc);
struct mpic *mpic = irq_desc_get_handler_data(desc);
unsigned int cascade_irq = mpic_get_one_irq(mpic);
if (cascade_irq != NO_IRQ)
generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data);
}
static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
{ {
#if defined(CONFIG_XMON) && defined(CONFIG_PPC32) #if defined(CONFIG_XMON) && defined(CONFIG_PPC32)
...@@ -498,14 +486,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, ...@@ -498,14 +486,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
int master) int master)
{ {
const char *name = master ? " MPIC 1 " : " MPIC 2 "; const char *name = master ? " MPIC 1 " : " MPIC 2 ";
struct resource r;
struct mpic *mpic; struct mpic *mpic;
unsigned int flags = master ? MPIC_PRIMARY : 0; unsigned int flags = master ? 0 : MPIC_SECONDARY;
int rc;
rc = of_address_to_resource(np, 0, &r);
if (rc)
return NULL;
pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0);
...@@ -519,7 +501,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, ...@@ -519,7 +501,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
if (master && (flags & MPIC_BIG_ENDIAN)) if (master && (flags & MPIC_BIG_ENDIAN))
flags |= MPIC_U3_HT_IRQS; flags |= MPIC_U3_HT_IRQS;
mpic = mpic_alloc(np, r.start, flags, 0, 0, name); mpic = mpic_alloc(np, 0, flags, 0, 0, name);
if (mpic == NULL) if (mpic == NULL)
return NULL; return NULL;
...@@ -532,7 +514,6 @@ static int __init pmac_pic_probe_mpic(void) ...@@ -532,7 +514,6 @@ static int __init pmac_pic_probe_mpic(void)
{ {
struct mpic *mpic1, *mpic2; struct mpic *mpic1, *mpic2;
struct device_node *np, *master = NULL, *slave = NULL; struct device_node *np, *master = NULL, *slave = NULL;
unsigned int cascade;
/* We can have up to 2 MPICs cascaded */ /* We can have up to 2 MPICs cascaded */
for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) for (np = NULL; (np = of_find_node_by_type(np, "open-pic"))
...@@ -568,27 +549,14 @@ static int __init pmac_pic_probe_mpic(void) ...@@ -568,27 +549,14 @@ static int __init pmac_pic_probe_mpic(void)
of_node_put(master); of_node_put(master);
/* No slave, let's go out */ /* Set up a cascaded controller, if present */
if (slave == NULL) if (slave) {
return 0; mpic2 = pmac_setup_one_mpic(slave, 0);
if (mpic2 == NULL)
/* Get/Map slave interrupt */ printk(KERN_ERR "Failed to setup slave MPIC\n");
cascade = irq_of_parse_and_map(slave, 0);
if (cascade == NO_IRQ) {
printk(KERN_ERR "Failed to map cascade IRQ\n");
return 0;
}
mpic2 = pmac_setup_one_mpic(slave, 0);
if (mpic2 == NULL) {
printk(KERN_ERR "Failed to setup slave MPIC\n");
of_node_put(slave); of_node_put(slave);
return 0;
} }
irq_set_handler_data(cascade, mpic2);
irq_set_chained_handler(cascade, pmac_u3_cascade);
of_node_put(slave);
return 0; return 0;
} }
......
...@@ -192,8 +192,7 @@ static void __init pseries_mpic_init_IRQ(void) ...@@ -192,8 +192,7 @@ static void __init pseries_mpic_init_IRQ(void)
BUG_ON(openpic_addr == 0); BUG_ON(openpic_addr == 0);
/* Setup the openpic driver */ /* Setup the openpic driver */
mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, 0,
MPIC_PRIMARY,
16, 250, /* isu size, irq count */ 16, 250, /* isu size, irq count */
" MPIC "); " MPIC ");
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
......
This diff is collapsed.
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