Skip to content

Commit

Permalink
Merge branch 'mpic' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Herrenschmidt committed Dec 7, 2011
2 parents 4666ca2 + 09dc34a commit 48b1bf8
Show file tree
Hide file tree
Showing 33 changed files with 225 additions and 621 deletions.
14 changes: 10 additions & 4 deletions arch/powerpc/include/asm/mpic.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ struct mpic_irq_save {
/* The instance data of a given MPIC */
struct mpic
{
/* The OpenFirmware dt node for this MPIC */
struct device_node *node;

/* The remapper for this MPIC */
struct irq_host *irqhost;

Expand Down Expand Up @@ -293,6 +296,9 @@ struct mpic
/* Register access method */
enum mpic_reg_type reg_type;

/* The physical base address of the MPIC */
phys_addr_t paddr;

/* The various ioremap'ed bases */
struct mpic_reg_bank gregs;
struct mpic_reg_bank tmregs;
Expand Down Expand Up @@ -331,11 +337,11 @@ struct 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
* registers only
/*
* This is a secondary ("chained") controller; it only uses the CPU0
* registers. Primary controllers have IPIs and affinity control.
*/
#define MPIC_PRIMARY 0x00000001
#define MPIC_SECONDARY 0x00000001

/* Set this for a big-endian MPIC */
#define MPIC_BIG_ENDIAN 0x00000002
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/44x/iss4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void __init iss4xx_init_irq(void)
/* The MPIC driver will get everything it needs from the
* 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 ");
BUG_ON(mpic == NULL);
mpic_init(mpic);
Expand Down
26 changes: 3 additions & 23 deletions arch/powerpc/platforms/85xx/corenet_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,18 @@
#include <linux/of_platform.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "smp.h"

void __init corenet_ds_pic_init(void)
{
struct mpic *mpic;
struct resource r;
struct device_node *np = NULL;
unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN |
unsigned int flags = MPIC_BIG_ENDIAN |
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)
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);

mpic_init(mpic);
Expand All @@ -65,10 +51,6 @@ void __init corenet_ds_pic_init(void)
/*
* Setup the architecture
*/
#ifdef CONFIG_SMP
void __init mpc85xx_smp_init(void);
#endif

void __init corenet_ds_setup_arch(void)
{
#ifdef CONFIG_PCI
Expand All @@ -77,9 +59,7 @@ void __init corenet_ds_setup_arch(void)
#endif
dma_addr_t max = 0xffffffff;

#ifdef CONFIG_SMP
mpc85xx_smp_init();
#endif

#ifdef CONFIG_PCI
for_each_node_by_type(np, "pci") {
Expand Down
23 changes: 2 additions & 21 deletions arch/powerpc/platforms/85xx/ksi8560.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,10 @@ static void machine_restart(char *cmd)

static void __init ksi8560_pic_init(void)
{
struct mpic *mpic;
struct resource r;
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,
struct mpic *mpic = mpic_alloc(NULL, 0,
MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
of_node_put(np);

mpic_init(mpic);

mpc85xx_cpm2_pic_init();
Expand Down
22 changes: 2 additions & 20 deletions arch/powerpc/platforms/85xx/mpc8536_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,11 @@

void __init mpc8536_ds_pic_init(void)
{
struct mpic *mpic;
struct resource r;
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 |
struct mpic *mpic = mpic_alloc(NULL, 0,
MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
of_node_put(np);

mpic_init(mpic);
}

Expand Down
22 changes: 2 additions & 20 deletions arch/powerpc/platforms/85xx/mpc85xx_ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,10 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,

static void __init mpc85xx_ads_pic_init(void)
{
struct mpic *mpic;
struct resource r;
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,
struct mpic *mpic = mpic_alloc(NULL, 0,
MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
of_node_put(np);

mpic_init(mpic);

mpc85xx_cpm2_pic_init();
Expand Down
24 changes: 2 additions & 22 deletions arch/powerpc/platforms/85xx/mpc85xx_cds.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,30 +188,10 @@ static struct irqaction mpc85xxcds_8259_irqaction = {
static void __init mpc85xx_cds_pic_init(void)
{
struct mpic *mpic;
struct resource r;
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,
mpic = mpic_alloc(NULL, 0,
MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);

/* Return the mpic node */
of_node_put(np);

mpic_init(mpic);
}

Expand Down
30 changes: 5 additions & 25 deletions arch/powerpc/platforms/85xx/mpc85xx_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "smp.h"

#include "mpc85xx.h"

Expand Down Expand Up @@ -62,43 +63,27 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
void __init mpc85xx_ds_pic_init(void)
{
struct mpic *mpic;
struct resource r;
struct device_node *np;
#ifdef CONFIG_PPC_I8259
struct device_node *np;
struct device_node *cascade_node = NULL;
int cascade_irq;
#endif
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")) {
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY |
mpic = mpic_alloc(NULL, 0,
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC ");
} else {
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET |
mpic = mpic_alloc(NULL, 0,
MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC ");
}

BUG_ON(mpic == NULL);
of_node_put(np);

mpic_init(mpic);

#ifdef CONFIG_PPC_I8259
Expand Down Expand Up @@ -154,9 +139,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
/*
* Setup the architecture
*/
#ifdef CONFIG_SMP
extern void __init mpc85xx_smp_init(void);
#endif
static void __init mpc85xx_ds_setup_arch(void)
{
#ifdef CONFIG_PCI
Expand Down Expand Up @@ -189,9 +171,7 @@ static void __init mpc85xx_ds_setup_arch(void)
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif

#ifdef CONFIG_SMP
mpc85xx_smp_init();
#endif

#ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) {
Expand Down
26 changes: 3 additions & 23 deletions arch/powerpc/platforms/85xx/mpc85xx_mds.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <asm/qe_ic.h>
#include <asm/mpic.h>
#include <asm/swiotlb.h>
#include "smp.h"

#include "mpc85xx.h"

Expand Down Expand Up @@ -155,10 +156,6 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev)
* Setup the architecture
*
*/
#ifdef CONFIG_SMP
extern void __init mpc85xx_smp_init(void);
#endif

#ifdef CONFIG_QUICC_ENGINE
static void __init mpc85xx_mds_reset_ucc_phys(void)
{
Expand Down Expand Up @@ -363,9 +360,7 @@ static void __init mpc85xx_mds_setup_arch(void)
}
#endif

#ifdef CONFIG_SMP
mpc85xx_smp_init();
#endif

mpc85xx_mds_qe_init();

Expand Down Expand Up @@ -439,26 +434,11 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier);

static void __init mpc85xx_mds_pic_init(void)
{
struct mpic *mpic;
struct resource r;
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 |
struct mpic *mpic = mpic_alloc(NULL, 0,
MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
of_node_put(np);

mpic_init(mpic);
mpc85xx_mds_qeic_init();
Expand Down
Loading

0 comments on commit 48b1bf8

Please sign in to comment.