diff options
author | Kyle Moffett <Kyle.D.Moffett@boeing.com> | 2011-12-02 01:28:03 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-12-06 21:43:08 -0500 |
commit | be8bec56dfac0574c4c08a50cd37e09bea941e3f (patch) | |
tree | 2c31c63a1b56f8cd79a49c358be9b6020118e7c8 | |
parent | 996983b75cebb1bc1c2c545f20336f24ebfa17af (diff) |
powerpc/mpic: Invert the meaning of MPIC_PRIMARY
It turns out that there are only 2 in-tree platforms which use MPICs
which are not "primary": IBM Cell and PowerMac. To reduce the
complexity of the typical board setup code, invert the MPIC_PRIMARY bit
into MPIC_SECONDARY.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
31 files changed, 42 insertions, 47 deletions
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index ba0b2046106e..b9d2c0fb0492 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h | |||
@@ -334,11 +334,11 @@ struct mpic | |||
334 | * Note setting any ID (leaving those bits to 0) means standard MPIC | 334 | * Note setting any ID (leaving those bits to 0) means standard MPIC |
335 | */ | 335 | */ |
336 | 336 | ||
337 | /* This is the primary controller, only that one has IPIs and | 337 | /* |
338 | * has afinity control. A non-primary MPIC always uses CPU0 | 338 | * This is a secondary ("chained") controller; it only uses the CPU0 |
339 | * registers only | 339 | * registers. Primary controllers have IPIs and affinity control. |
340 | */ | 340 | */ |
341 | #define MPIC_PRIMARY 0x00000001 | 341 | #define MPIC_SECONDARY 0x00000001 |
342 | 342 | ||
343 | /* Set this for a big-endian MPIC */ | 343 | /* Set this for a big-endian MPIC */ |
344 | #define MPIC_BIG_ENDIAN 0x00000002 | 344 | #define MPIC_BIG_ENDIAN 0x00000002 |
diff --git a/arch/powerpc/platforms/44x/iss4xx.c b/arch/powerpc/platforms/44x/iss4xx.c index 19395f18b1db..5b8cdbb82f80 100644 --- a/arch/powerpc/platforms/44x/iss4xx.c +++ b/arch/powerpc/platforms/44x/iss4xx.c | |||
@@ -71,7 +71,7 @@ static void __init iss4xx_init_irq(void) | |||
71 | /* The MPIC driver will get everything it needs from the | 71 | /* The MPIC driver will get everything it needs from the |
72 | * device-tree, just pass 0 to all arguments | 72 | * device-tree, just pass 0 to all arguments |
73 | */ | 73 | */ |
74 | struct mpic *mpic = mpic_alloc(np, 0, MPIC_PRIMARY, 0, 0, | 74 | struct mpic *mpic = mpic_alloc(np, 0, 0, 0, 0, |
75 | " MPIC "); | 75 | " MPIC "); |
76 | BUG_ON(mpic == NULL); | 76 | BUG_ON(mpic == NULL); |
77 | mpic_init(mpic); | 77 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c index cfa4bada7eb2..07e3e6c47371 100644 --- a/arch/powerpc/platforms/85xx/corenet_ds.c +++ b/arch/powerpc/platforms/85xx/corenet_ds.c | |||
@@ -36,7 +36,7 @@ | |||
36 | void __init corenet_ds_pic_init(void) | 36 | void __init corenet_ds_pic_init(void) |
37 | { | 37 | { |
38 | struct mpic *mpic; | 38 | struct mpic *mpic; |
39 | unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN | | 39 | unsigned int flags = MPIC_BIG_ENDIAN | |
40 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; | 40 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; |
41 | 41 | ||
42 | if (ppc_md.get_irq == mpic_get_coreint_irq) | 42 | if (ppc_md.get_irq == mpic_get_coreint_irq) |
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c index 1620fa87cd96..20f75d7819c6 100644 --- a/arch/powerpc/platforms/85xx/ksi8560.c +++ b/arch/powerpc/platforms/85xx/ksi8560.c | |||
@@ -58,7 +58,7 @@ static void machine_restart(char *cmd) | |||
58 | static void __init ksi8560_pic_init(void) | 58 | static void __init ksi8560_pic_init(void) |
59 | { | 59 | { |
60 | struct mpic *mpic = mpic_alloc(NULL, 0, | 60 | struct mpic *mpic = mpic_alloc(NULL, 0, |
61 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 61 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
62 | 0, 256, " OpenPIC "); | 62 | 0, 256, " OpenPIC "); |
63 | BUG_ON(mpic == NULL); | 63 | BUG_ON(mpic == NULL); |
64 | mpic_init(mpic); | 64 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c index 07916d6e4999..cf266826682e 100644 --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -37,7 +37,7 @@ | |||
37 | void __init mpc8536_ds_pic_init(void) | 37 | void __init mpc8536_ds_pic_init(void) |
38 | { | 38 | { |
39 | struct mpic *mpic = mpic_alloc(NULL, 0, | 39 | struct mpic *mpic = mpic_alloc(NULL, 0, |
40 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 40 | MPIC_WANTS_RESET | |
41 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 41 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, |
42 | 0, 256, " OpenPIC "); | 42 | 0, 256, " OpenPIC "); |
43 | BUG_ON(mpic == NULL); | 43 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 17c6f06e2d41..3bebb5173bfc 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -51,7 +51,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, | |||
51 | static void __init mpc85xx_ads_pic_init(void) | 51 | static void __init mpc85xx_ads_pic_init(void) |
52 | { | 52 | { |
53 | struct mpic *mpic = mpic_alloc(NULL, 0, | 53 | struct mpic *mpic = mpic_alloc(NULL, 0, |
54 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 54 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
55 | 0, 256, " OpenPIC "); | 55 | 0, 256, " OpenPIC "); |
56 | BUG_ON(mpic == NULL); | 56 | BUG_ON(mpic == NULL); |
57 | mpic_init(mpic); | 57 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index cf209b3df7b9..40f03da616a9 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -189,7 +189,7 @@ static void __init mpc85xx_cds_pic_init(void) | |||
189 | { | 189 | { |
190 | struct mpic *mpic; | 190 | struct mpic *mpic; |
191 | mpic = mpic_alloc(NULL, 0, | 191 | mpic = mpic_alloc(NULL, 0, |
192 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 192 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
193 | 0, 256, " OpenPIC "); | 193 | 0, 256, " OpenPIC "); |
194 | BUG_ON(mpic == NULL); | 194 | BUG_ON(mpic == NULL); |
195 | mpic_init(mpic); | 195 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 104a09b9f6d3..eefbb91e1d61 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -72,13 +72,12 @@ void __init mpc85xx_ds_pic_init(void) | |||
72 | 72 | ||
73 | if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { | 73 | if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { |
74 | mpic = mpic_alloc(NULL, 0, | 74 | mpic = mpic_alloc(NULL, 0, |
75 | MPIC_PRIMARY | | ||
76 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 75 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
77 | MPIC_SINGLE_DEST_CPU, | 76 | MPIC_SINGLE_DEST_CPU, |
78 | 0, 256, " OpenPIC "); | 77 | 0, 256, " OpenPIC "); |
79 | } else { | 78 | } else { |
80 | mpic = mpic_alloc(NULL, 0, | 79 | mpic = mpic_alloc(NULL, 0, |
81 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 80 | MPIC_WANTS_RESET | |
82 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 81 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
83 | MPIC_SINGLE_DEST_CPU, | 82 | MPIC_SINGLE_DEST_CPU, |
84 | 0, 256, " OpenPIC "); | 83 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 4e5431ad9d13..1d15a0cd2c82 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -435,7 +435,7 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); | |||
435 | static void __init mpc85xx_mds_pic_init(void) | 435 | static void __init mpc85xx_mds_pic_init(void) |
436 | { | 436 | { |
437 | struct mpic *mpic = mpic_alloc(NULL, 0, | 437 | struct mpic *mpic = mpic_alloc(NULL, 0, |
438 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | 438 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
439 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 439 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
440 | 0, 256, " OpenPIC "); | 440 | 0, 256, " OpenPIC "); |
441 | BUG_ON(mpic == NULL); | 441 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index a68d92271c44..ccf520e890be 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -49,13 +49,12 @@ void __init mpc85xx_rdb_pic_init(void) | |||
49 | 49 | ||
50 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { | 50 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { |
51 | mpic = mpic_alloc(NULL, 0, | 51 | mpic = mpic_alloc(NULL, 0, |
52 | MPIC_PRIMARY | | ||
53 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 52 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
54 | MPIC_SINGLE_DEST_CPU, | 53 | MPIC_SINGLE_DEST_CPU, |
55 | 0, 256, " OpenPIC "); | 54 | 0, 256, " OpenPIC "); |
56 | } else { | 55 | } else { |
57 | mpic = mpic_alloc(NULL, 0, | 56 | mpic = mpic_alloc(NULL, 0, |
58 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 57 | MPIC_WANTS_RESET | |
59 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 58 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
60 | MPIC_SINGLE_DEST_CPU, | 59 | MPIC_SINGLE_DEST_CPU, |
61 | 0, 256, " OpenPIC "); | 60 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c index 25f7375e092f..894f1e84fef8 100644 --- a/arch/powerpc/platforms/85xx/p1010rdb.c +++ b/arch/powerpc/platforms/85xx/p1010rdb.c | |||
@@ -33,8 +33,8 @@ | |||
33 | void __init p1010_rdb_pic_init(void) | 33 | void __init p1010_rdb_pic_init(void) |
34 | { | 34 | { |
35 | struct mpic *mpic = mpic_alloc(NULL, 0, | 35 | struct mpic *mpic = mpic_alloc(NULL, 0, |
36 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 36 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
37 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 37 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
38 | 0, 256, " OpenPIC "); | 38 | 0, 256, " OpenPIC "); |
39 | 39 | ||
40 | BUG_ON(mpic == NULL); | 40 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 6af5502b0898..bb3d84f4046f 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -242,7 +242,7 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port) | |||
242 | void __init p1022_ds_pic_init(void) | 242 | void __init p1022_ds_pic_init(void) |
243 | { | 243 | { |
244 | struct mpic *mpic = mpic_alloc(NULL, 0, | 244 | struct mpic *mpic = mpic_alloc(NULL, 0, |
245 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 245 | MPIC_WANTS_RESET | |
246 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 246 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
247 | MPIC_SINGLE_DEST_CPU, | 247 | MPIC_SINGLE_DEST_CPU, |
248 | 0, 256, " OpenPIC "); | 248 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c index b3c78fe07110..e92a714d2f36 100644 --- a/arch/powerpc/platforms/85xx/p1023_rds.c +++ b/arch/powerpc/platforms/85xx/p1023_rds.c | |||
@@ -94,7 +94,7 @@ machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices); | |||
94 | static void __init mpc85xx_rds_pic_init(void) | 94 | static void __init mpc85xx_rds_pic_init(void) |
95 | { | 95 | { |
96 | struct mpic *mpic = mpic_alloc(NULL, 0, | 96 | struct mpic *mpic = mpic_alloc(NULL, 0, |
97 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | 97 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
98 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 98 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
99 | 0, 256, " OpenPIC "); | 99 | 0, 256, " OpenPIC "); |
100 | 100 | ||
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c index 38d6945382b8..184a50784617 100644 --- a/arch/powerpc/platforms/85xx/sbc8548.c +++ b/arch/powerpc/platforms/85xx/sbc8548.c | |||
@@ -55,7 +55,7 @@ static int sbc_rev; | |||
55 | static void __init sbc8548_pic_init(void) | 55 | static void __init sbc8548_pic_init(void) |
56 | { | 56 | { |
57 | struct mpic *mpic = mpic_alloc(NULL, 0, | 57 | struct mpic *mpic = mpic_alloc(NULL, 0, |
58 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 58 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
59 | 0, 256, " OpenPIC "); | 59 | 0, 256, " OpenPIC "); |
60 | BUG_ON(mpic == NULL); | 60 | BUG_ON(mpic == NULL); |
61 | mpic_init(mpic); | 61 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c index 7e6d7e5b8a41..940752e93051 100644 --- a/arch/powerpc/platforms/85xx/sbc8560.c +++ b/arch/powerpc/platforms/85xx/sbc8560.c | |||
@@ -42,7 +42,7 @@ | |||
42 | static void __init sbc8560_pic_init(void) | 42 | static void __init sbc8560_pic_init(void) |
43 | { | 43 | { |
44 | struct mpic *mpic = mpic_alloc(NULL, 0, | 44 | struct mpic *mpic = mpic_alloc(NULL, 0, |
45 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 45 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
46 | 0, 256, " OpenPIC "); | 46 | 0, 256, " OpenPIC "); |
47 | BUG_ON(mpic == NULL); | 47 | BUG_ON(mpic == NULL); |
48 | mpic_init(mpic); | 48 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c index 8175f0a5e5f0..18f635906b27 100644 --- a/arch/powerpc/platforms/85xx/socrates.c +++ b/arch/powerpc/platforms/85xx/socrates.c | |||
@@ -49,7 +49,7 @@ static void __init socrates_pic_init(void) | |||
49 | struct device_node *np; | 49 | struct device_node *np; |
50 | 50 | ||
51 | struct mpic *mpic = mpic_alloc(NULL, 0, | 51 | struct mpic *mpic = mpic_alloc(NULL, 0, |
52 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 52 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
53 | 0, 256, " OpenPIC "); | 53 | 0, 256, " OpenPIC "); |
54 | BUG_ON(mpic == NULL); | 54 | BUG_ON(mpic == NULL); |
55 | mpic_init(mpic); | 55 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c index 8ca1e61488df..e9e5234b4e76 100644 --- a/arch/powerpc/platforms/85xx/stx_gp3.c +++ b/arch/powerpc/platforms/85xx/stx_gp3.c | |||
@@ -49,7 +49,7 @@ | |||
49 | static void __init stx_gp3_pic_init(void) | 49 | static void __init stx_gp3_pic_init(void) |
50 | { | 50 | { |
51 | struct mpic *mpic = mpic_alloc(NULL, 0, | 51 | struct mpic *mpic = mpic_alloc(NULL, 0, |
52 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 52 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
53 | 0, 256, " OpenPIC "); | 53 | 0, 256, " OpenPIC "); |
54 | BUG_ON(mpic == NULL); | 54 | BUG_ON(mpic == NULL); |
55 | mpic_init(mpic); | 55 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c index 6e7a8351e8f9..bf7c89fb75bb 100644 --- a/arch/powerpc/platforms/85xx/tqm85xx.c +++ b/arch/powerpc/platforms/85xx/tqm85xx.c | |||
@@ -47,7 +47,7 @@ | |||
47 | static void __init tqm85xx_pic_init(void) | 47 | static void __init tqm85xx_pic_init(void) |
48 | { | 48 | { |
49 | struct mpic *mpic = mpic_alloc(NULL, 0, | 49 | struct mpic *mpic = mpic_alloc(NULL, 0, |
50 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 50 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
51 | 0, 256, " OpenPIC "); | 51 | 0, 256, " OpenPIC "); |
52 | BUG_ON(mpic == NULL); | 52 | BUG_ON(mpic == NULL); |
53 | mpic_init(mpic); | 53 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c index f94c60868496..3a69f8b77de6 100644 --- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c +++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c | |||
@@ -44,7 +44,7 @@ | |||
44 | void __init xes_mpc85xx_pic_init(void) | 44 | void __init xes_mpc85xx_pic_init(void) |
45 | { | 45 | { |
46 | struct mpic *mpic = mpic_alloc(NULL, 0, | 46 | struct mpic *mpic = mpic_alloc(NULL, 0, |
47 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 47 | MPIC_WANTS_RESET | |
48 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 48 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, |
49 | 0, 256, " OpenPIC "); | 49 | 0, 256, " OpenPIC "); |
50 | BUG_ON(mpic == NULL); | 50 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c index ed85b3c8ed18..52bbfa031531 100644 --- a/arch/powerpc/platforms/86xx/pic.c +++ b/arch/powerpc/platforms/86xx/pic.c | |||
@@ -38,9 +38,8 @@ void __init mpc86xx_init_irq(void) | |||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | struct mpic *mpic = mpic_alloc(NULL, 0, | 40 | struct mpic *mpic = mpic_alloc(NULL, 0, |
41 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 41 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
42 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 42 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
43 | MPIC_SINGLE_DEST_CPU, | ||
44 | 0, 256, " MPIC "); | 43 | 0, 256, " MPIC "); |
45 | BUG_ON(mpic == NULL); | 44 | BUG_ON(mpic == NULL); |
46 | 45 | ||
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 0fc9b7256126..cd00ca856038 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -211,7 +211,7 @@ static void __init mpic_init_IRQ(void) | |||
211 | /* The MPIC driver will get everything it needs from the | 211 | /* The MPIC driver will get everything it needs from the |
212 | * device-tree, just pass 0 to all arguments | 212 | * device-tree, just pass 0 to all arguments |
213 | */ | 213 | */ |
214 | mpic = mpic_alloc(dn, 0, 0, 0, 0, " MPIC "); | 214 | mpic = mpic_alloc(dn, 0, MPIC_SECONDARY, 0, 0, " MPIC "); |
215 | if (mpic == NULL) | 215 | if (mpic == NULL) |
216 | continue; | 216 | continue; |
217 | mpic_init(mpic); | 217 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 122786498419..f1f17bb2c33c 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -435,8 +435,7 @@ static void __init chrp_find_openpic(void) | |||
435 | if (len > 1) | 435 | if (len > 1) |
436 | isu_size = iranges[3]; | 436 | isu_size = iranges[3]; |
437 | 437 | ||
438 | chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY, | 438 | chrp_mpic = mpic_alloc(np, opaddr, 0, isu_size, 0, " MPIC "); |
439 | isu_size, 0, " MPIC "); | ||
440 | if (chrp_mpic == NULL) { | 439 | if (chrp_mpic == NULL) { |
441 | printk(KERN_ERR "Failed to allocate MPIC structure\n"); | 440 | printk(KERN_ERR "Failed to allocate MPIC structure\n"); |
442 | goto bail; | 441 | goto bail; |
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c index 5ed00a70a864..9cfcf20c0560 100644 --- a/arch/powerpc/platforms/embedded6xx/holly.c +++ b/arch/powerpc/platforms/embedded6xx/holly.c | |||
@@ -155,7 +155,7 @@ static void __init holly_init_IRQ(void) | |||
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | mpic = mpic_alloc(NULL, 0, | 157 | mpic = mpic_alloc(NULL, 0, |
158 | MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | | 158 | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | |
159 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, | 159 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, |
160 | 24, | 160 | 24, |
161 | NR_IRQS-4, /* num_sources used */ | 161 | NR_IRQS-4, /* num_sources used */ |
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c index 502ff60db968..bcfad92c9cec 100644 --- a/arch/powerpc/platforms/embedded6xx/linkstation.c +++ b/arch/powerpc/platforms/embedded6xx/linkstation.c | |||
@@ -82,7 +82,7 @@ static void __init linkstation_init_IRQ(void) | |||
82 | { | 82 | { |
83 | struct mpic *mpic; | 83 | struct mpic *mpic; |
84 | 84 | ||
85 | mpic = mpic_alloc(NULL, 0, MPIC_PRIMARY | MPIC_WANTS_RESET, | 85 | mpic = mpic_alloc(NULL, 0, MPIC_WANTS_RESET, |
86 | 4, 32, " EPIC "); | 86 | 4, 32, " EPIC "); |
87 | BUG_ON(mpic == NULL); | 87 | BUG_ON(mpic == NULL); |
88 | 88 | ||
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c index e0f112790397..f3350d786f5b 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | |||
@@ -109,7 +109,7 @@ static void __init mpc7448_hpc2_init_IRQ(void) | |||
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | mpic = mpic_alloc(NULL, 0, | 111 | mpic = mpic_alloc(NULL, 0, |
112 | MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | | 112 | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | |
113 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, | 113 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, |
114 | 24, | 114 | 24, |
115 | NR_IRQS-4, /* num_sources used */ | 115 | NR_IRQS-4, /* num_sources used */ |
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c index 9bd15dfea579..afa638834965 100644 --- a/arch/powerpc/platforms/embedded6xx/storcenter.c +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c | |||
@@ -84,7 +84,7 @@ static void __init storcenter_init_IRQ(void) | |||
84 | { | 84 | { |
85 | struct mpic *mpic; | 85 | struct mpic *mpic; |
86 | 86 | ||
87 | mpic = mpic_alloc(NULL, 0, MPIC_PRIMARY | MPIC_WANTS_RESET, | 87 | mpic = mpic_alloc(NULL, 0, MPIC_WANTS_RESET, |
88 | 16, 32, " OpenPIC "); | 88 | 16, 32, " OpenPIC "); |
89 | BUG_ON(mpic == NULL); | 89 | BUG_ON(mpic == NULL); |
90 | 90 | ||
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 4c372047c94e..0bcbfe7b2c55 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -221,7 +221,7 @@ static void __init maple_init_IRQ(void) | |||
221 | unsigned long openpic_addr = 0; | 221 | unsigned long openpic_addr = 0; |
222 | int naddr, n, i, opplen, has_isus = 0; | 222 | int naddr, n, i, opplen, has_isus = 0; |
223 | struct mpic *mpic; | 223 | struct mpic *mpic; |
224 | unsigned int flags = MPIC_PRIMARY; | 224 | unsigned int flags = 0; |
225 | 225 | ||
226 | /* Locate MPIC in the device-tree. Note that there is a bug | 226 | /* Locate MPIC in the device-tree. Note that there is a bug |
227 | * in Maple device-tree where the type of the controller is | 227 | * in Maple device-tree where the type of the controller is |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index baf20a913827..98b7a7c13176 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -224,7 +224,7 @@ static __init void pas_init_IRQ(void) | |||
224 | openpic_addr = of_read_number(opprop, naddr); | 224 | openpic_addr = of_read_number(opprop, naddr); |
225 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); | 225 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); |
226 | 226 | ||
227 | mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS; | 227 | mpic_flags = MPIC_LARGE_VECTORS | MPIC_NO_BIAS; |
228 | 228 | ||
229 | nmiprop = of_get_property(mpic_node, "nmi-source", NULL); | 229 | nmiprop = of_get_property(mpic_node, "nmi-source", NULL); |
230 | if (nmiprop) | 230 | if (nmiprop) |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 78456fd4416e..b962101744e5 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -499,7 +499,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, | |||
499 | { | 499 | { |
500 | const char *name = master ? " MPIC 1 " : " MPIC 2 "; | 500 | const char *name = master ? " MPIC 1 " : " MPIC 2 "; |
501 | struct mpic *mpic; | 501 | struct mpic *mpic; |
502 | unsigned int flags = master ? MPIC_PRIMARY : 0; | 502 | unsigned int flags = master ? 0 : MPIC_SECONDARY; |
503 | 503 | ||
504 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); | 504 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); |
505 | 505 | ||
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index c3408ca8855e..01df08dbc43c 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -192,8 +192,7 @@ static void __init pseries_mpic_init_IRQ(void) | |||
192 | BUG_ON(openpic_addr == 0); | 192 | BUG_ON(openpic_addr == 0); |
193 | 193 | ||
194 | /* Setup the openpic driver */ | 194 | /* Setup the openpic driver */ |
195 | mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, | 195 | mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, 0, |
196 | MPIC_PRIMARY, | ||
197 | 16, 250, /* isu size, irq count */ | 196 | 16, 250, /* isu size, irq count */ |
198 | " MPIC "); | 197 | " MPIC "); |
199 | BUG_ON(mpic == NULL); | 198 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index bb72a6266480..6d42ad1491a9 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -154,7 +154,7 @@ static inline unsigned int mpic_processor_id(struct mpic *mpic) | |||
154 | { | 154 | { |
155 | unsigned int cpu = 0; | 155 | unsigned int cpu = 0; |
156 | 156 | ||
157 | if (mpic->flags & MPIC_PRIMARY) | 157 | if (!(mpic->flags & MPIC_SECONDARY)) |
158 | cpu = hard_smp_processor_id(); | 158 | cpu = hard_smp_processor_id(); |
159 | 159 | ||
160 | return cpu; | 160 | return cpu; |
@@ -990,7 +990,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, | |||
990 | 990 | ||
991 | #ifdef CONFIG_SMP | 991 | #ifdef CONFIG_SMP |
992 | else if (hw >= mpic->ipi_vecs[0]) { | 992 | else if (hw >= mpic->ipi_vecs[0]) { |
993 | WARN_ON(!(mpic->flags & MPIC_PRIMARY)); | 993 | WARN_ON(mpic->flags & MPIC_SECONDARY); |
994 | 994 | ||
995 | DBG("mpic: mapping as IPI\n"); | 995 | DBG("mpic: mapping as IPI\n"); |
996 | irq_set_chip_data(virq, mpic); | 996 | irq_set_chip_data(virq, mpic); |
@@ -1001,7 +1001,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, | |||
1001 | #endif /* CONFIG_SMP */ | 1001 | #endif /* CONFIG_SMP */ |
1002 | 1002 | ||
1003 | if (hw >= mpic->timer_vecs[0] && hw <= mpic->timer_vecs[7]) { | 1003 | if (hw >= mpic->timer_vecs[0] && hw <= mpic->timer_vecs[7]) { |
1004 | WARN_ON(!(mpic->flags & MPIC_PRIMARY)); | 1004 | WARN_ON(mpic->flags & MPIC_SECONDARY); |
1005 | 1005 | ||
1006 | DBG("mpic: mapping as timer\n"); | 1006 | DBG("mpic: mapping as timer\n"); |
1007 | irq_set_chip_data(virq, mpic); | 1007 | irq_set_chip_data(virq, mpic); |
@@ -1184,12 +1184,12 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1184 | 1184 | ||
1185 | mpic->hc_irq = mpic_irq_chip; | 1185 | mpic->hc_irq = mpic_irq_chip; |
1186 | mpic->hc_irq.name = name; | 1186 | mpic->hc_irq.name = name; |
1187 | if (flags & MPIC_PRIMARY) | 1187 | if (!(flags & MPIC_SECONDARY)) |
1188 | mpic->hc_irq.irq_set_affinity = mpic_set_affinity; | 1188 | mpic->hc_irq.irq_set_affinity = mpic_set_affinity; |
1189 | #ifdef CONFIG_MPIC_U3_HT_IRQS | 1189 | #ifdef CONFIG_MPIC_U3_HT_IRQS |
1190 | mpic->hc_ht_irq = mpic_irq_ht_chip; | 1190 | mpic->hc_ht_irq = mpic_irq_ht_chip; |
1191 | mpic->hc_ht_irq.name = name; | 1191 | mpic->hc_ht_irq.name = name; |
1192 | if (flags & MPIC_PRIMARY) | 1192 | if (!(flags & MPIC_SECONDARY)) |
1193 | mpic->hc_ht_irq.irq_set_affinity = mpic_set_affinity; | 1193 | mpic->hc_ht_irq.irq_set_affinity = mpic_set_affinity; |
1194 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ | 1194 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ |
1195 | 1195 | ||
@@ -1375,7 +1375,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1375 | mpic->next = mpics; | 1375 | mpic->next = mpics; |
1376 | mpics = mpic; | 1376 | mpics = mpic; |
1377 | 1377 | ||
1378 | if (flags & MPIC_PRIMARY) { | 1378 | if (!(flags & MPIC_SECONDARY)) { |
1379 | mpic_primary = mpic; | 1379 | mpic_primary = mpic; |
1380 | irq_set_default_host(mpic->irqhost); | 1380 | irq_set_default_host(mpic->irqhost); |
1381 | } | 1381 | } |
@@ -1450,7 +1450,7 @@ void __init mpic_init(struct mpic *mpic) | |||
1450 | 1450 | ||
1451 | /* Do the HT PIC fixups on U3 broken mpic */ | 1451 | /* Do the HT PIC fixups on U3 broken mpic */ |
1452 | DBG("MPIC flags: %x\n", mpic->flags); | 1452 | DBG("MPIC flags: %x\n", mpic->flags); |
1453 | if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY)) { | 1453 | if ((mpic->flags & MPIC_U3_HT_IRQS) && !(mpic->flags & MPIC_SECONDARY)) { |
1454 | mpic_scan_ht_pics(mpic); | 1454 | mpic_scan_ht_pics(mpic); |
1455 | mpic_u3msi_init(mpic); | 1455 | mpic_u3msi_init(mpic); |
1456 | } | 1456 | } |