aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/85xx/corenet_ds.c9
-rw-r--r--arch/powerpc/platforms/85xx/ksi8560.c9
-rw-r--r--arch/powerpc/platforms/85xx/mpc8536_ds.c9
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c9
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c9
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c11
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c9
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_rdb.c11
-rw-r--r--arch/powerpc/platforms/85xx/p1010rdb.c9
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c9
-rw-r--r--arch/powerpc/platforms/85xx/p1023_rds.c9
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c9
-rw-r--r--arch/powerpc/platforms/85xx/sbc8560.c9
-rw-r--r--arch/powerpc/platforms/85xx/socrates.c9
-rw-r--r--arch/powerpc/platforms/85xx/stx_gp3.c9
-rw-r--r--arch/powerpc/platforms/85xx/tqm85xx.c9
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c9
-rw-r--r--arch/powerpc/platforms/86xx/pic.c4
-rw-r--r--arch/powerpc/platforms/powermac/pic.c8
-rw-r--r--arch/powerpc/sysdev/mpic.c61
20 files changed, 55 insertions, 175 deletions
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index 30528219b27..5b1c577199b 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -36,7 +36,6 @@
36void __init corenet_ds_pic_init(void) 36void __init corenet_ds_pic_init(void)
37{ 37{
38 struct mpic *mpic; 38 struct mpic *mpic;
39 struct resource r;
40 struct device_node *np = NULL; 39 struct device_node *np = NULL;
41 unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN | 40 unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN |
42 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; 41 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU;
@@ -48,16 +47,10 @@ void __init corenet_ds_pic_init(void)
48 return; 47 return;
49 } 48 }
50 49
51 if (of_address_to_resource(np, 0, &r)) {
52 printk(KERN_ERR "Failed to map mpic register space\n");
53 of_node_put(np);
54 return;
55 }
56
57 if (ppc_md.get_irq == mpic_get_coreint_irq) 50 if (ppc_md.get_irq == mpic_get_coreint_irq)
58 flags |= MPIC_ENABLE_COREINT; 51 flags |= MPIC_ENABLE_COREINT;
59 52
60 mpic = mpic_alloc(np, r.start, flags, 0, 256, " OpenPIC "); 53 mpic = mpic_alloc(np, 0, flags, 0, 256, " OpenPIC ");
61 BUG_ON(mpic == NULL); 54 BUG_ON(mpic == NULL);
62 55
63 mpic_init(mpic); 56 mpic_init(mpic);
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index 0f3e6883265..3403b0e0143 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -58,7 +58,6 @@ static void machine_restart(char *cmd)
58static void __init ksi8560_pic_init(void) 58static void __init ksi8560_pic_init(void)
59{ 59{
60 struct mpic *mpic; 60 struct mpic *mpic;
61 struct resource r;
62 struct device_node *np; 61 struct device_node *np;
63 62
64 np = of_find_node_by_type(NULL, "open-pic"); 63 np = of_find_node_by_type(NULL, "open-pic");
@@ -68,13 +67,7 @@ static void __init ksi8560_pic_init(void)
68 return; 67 return;
69 } 68 }
70 69
71 if (of_address_to_resource(np, 0, &r)) { 70 mpic = mpic_alloc(np, 0,
72 printk(KERN_ERR "Could not map mpic register space\n");
73 of_node_put(np);
74 return;
75 }
76
77 mpic = mpic_alloc(np, r.start,
78 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 71 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
79 0, 256, " OpenPIC "); 72 0, 256, " OpenPIC ");
80 BUG_ON(mpic == NULL); 73 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index 9ee6455c2f1..5c20b28568b 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -37,7 +37,6 @@
37void __init mpc8536_ds_pic_init(void) 37void __init mpc8536_ds_pic_init(void)
38{ 38{
39 struct mpic *mpic; 39 struct mpic *mpic;
40 struct resource r;
41 struct device_node *np; 40 struct device_node *np;
42 41
43 np = of_find_node_by_type(NULL, "open-pic"); 42 np = of_find_node_by_type(NULL, "open-pic");
@@ -46,13 +45,7 @@ void __init mpc8536_ds_pic_init(void)
46 return; 45 return;
47 } 46 }
48 47
49 if (of_address_to_resource(np, 0, &r)) { 48 mpic = mpic_alloc(np, 0,
50 printk(KERN_ERR "Failed to map mpic register space\n");
51 of_node_put(np);
52 return;
53 }
54
55 mpic = mpic_alloc(np, r.start,
56 MPIC_PRIMARY | MPIC_WANTS_RESET | 49 MPIC_PRIMARY | MPIC_WANTS_RESET |
57 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, 50 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
58 0, 256, " OpenPIC "); 51 0, 256, " OpenPIC ");
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 986554b74d3..4c1e9b67ac5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -51,7 +51,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
51static void __init mpc85xx_ads_pic_init(void) 51static void __init mpc85xx_ads_pic_init(void)
52{ 52{
53 struct mpic *mpic; 53 struct mpic *mpic;
54 struct resource r;
55 struct device_node *np = NULL; 54 struct device_node *np = NULL;
56 55
57 np = of_find_node_by_type(np, "open-pic"); 56 np = of_find_node_by_type(np, "open-pic");
@@ -60,13 +59,7 @@ static void __init mpc85xx_ads_pic_init(void)
60 return; 59 return;
61 } 60 }
62 61
63 if (of_address_to_resource(np, 0, &r)) { 62 mpic = mpic_alloc(np, 0,
64 printk(KERN_ERR "Could not map mpic register space\n");
65 of_node_put(np);
66 return;
67 }
68
69 mpic = mpic_alloc(np, r.start,
70 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 63 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
71 0, 256, " OpenPIC "); 64 0, 256, " OpenPIC ");
72 BUG_ON(mpic == NULL); 65 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index d993b66f1ab..62b90c35969 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -188,7 +188,6 @@ static struct irqaction mpc85xxcds_8259_irqaction = {
188static void __init mpc85xx_cds_pic_init(void) 188static void __init mpc85xx_cds_pic_init(void)
189{ 189{
190 struct mpic *mpic; 190 struct mpic *mpic;
191 struct resource r;
192 struct device_node *np = NULL; 191 struct device_node *np = NULL;
193 192
194 np = of_find_node_by_type(np, "open-pic"); 193 np = of_find_node_by_type(np, "open-pic");
@@ -198,13 +197,7 @@ static void __init mpc85xx_cds_pic_init(void)
198 return; 197 return;
199 } 198 }
200 199
201 if (of_address_to_resource(np, 0, &r)) { 200 mpic = mpic_alloc(np, 0,
202 printk(KERN_ERR "Failed to map mpic register space\n");
203 of_node_put(np);
204 return;
205 }
206
207 mpic = mpic_alloc(np, r.start,
208 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 201 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
209 0, 256, " OpenPIC "); 202 0, 256, " OpenPIC ");
210 BUG_ON(mpic == NULL); 203 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 3f66631103c..4fc6b801c55 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -63,7 +63,6 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
63void __init mpc85xx_ds_pic_init(void) 63void __init mpc85xx_ds_pic_init(void)
64{ 64{
65 struct mpic *mpic; 65 struct mpic *mpic;
66 struct resource r;
67 struct device_node *np; 66 struct device_node *np;
68#ifdef CONFIG_PPC_I8259 67#ifdef CONFIG_PPC_I8259
69 struct device_node *cascade_node = NULL; 68 struct device_node *cascade_node = NULL;
@@ -77,20 +76,14 @@ void __init mpc85xx_ds_pic_init(void)
77 return; 76 return;
78 } 77 }
79 78
80 if (of_address_to_resource(np, 0, &r)) {
81 printk(KERN_ERR "Failed to map mpic register space\n");
82 of_node_put(np);
83 return;
84 }
85
86 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { 79 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) {
87 mpic = mpic_alloc(np, r.start, 80 mpic = mpic_alloc(np, 0,
88 MPIC_PRIMARY | 81 MPIC_PRIMARY |
89 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 82 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
90 MPIC_SINGLE_DEST_CPU, 83 MPIC_SINGLE_DEST_CPU,
91 0, 256, " OpenPIC "); 84 0, 256, " OpenPIC ");
92 } else { 85 } else {
93 mpic = mpic_alloc(np, r.start, 86 mpic = mpic_alloc(np, 0,
94 MPIC_PRIMARY | MPIC_WANTS_RESET | 87 MPIC_PRIMARY | MPIC_WANTS_RESET |
95 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 88 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
96 MPIC_SINGLE_DEST_CPU, 89 MPIC_SINGLE_DEST_CPU,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 813b5d3a435..74b6da2e087 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -435,20 +435,13 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier);
435static void __init mpc85xx_mds_pic_init(void) 435static void __init mpc85xx_mds_pic_init(void)
436{ 436{
437 struct mpic *mpic; 437 struct mpic *mpic;
438 struct resource r;
439 struct device_node *np = NULL; 438 struct device_node *np = NULL;
440 439
441 np = of_find_node_by_type(NULL, "open-pic"); 440 np = of_find_node_by_type(NULL, "open-pic");
442 if (!np) 441 if (!np)
443 return; 442 return;
444 443
445 if (of_address_to_resource(np, 0, &r)) { 444 mpic = mpic_alloc(np, 0,
446 printk(KERN_ERR "Failed to map mpic register space\n");
447 of_node_put(np);
448 return;
449 }
450
451 mpic = mpic_alloc(np, r.start,
452 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | 445 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
453 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, 446 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
454 0, 256, " OpenPIC "); 447 0, 256, " OpenPIC ");
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index b1ca429a515..2b299eba367 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -45,7 +45,6 @@
45void __init mpc85xx_rdb_pic_init(void) 45void __init mpc85xx_rdb_pic_init(void)
46{ 46{
47 struct mpic *mpic; 47 struct mpic *mpic;
48 struct resource r;
49 struct device_node *np; 48 struct device_node *np;
50 unsigned long root = of_get_flat_dt_root(); 49 unsigned long root = of_get_flat_dt_root();
51 50
@@ -55,20 +54,14 @@ void __init mpc85xx_rdb_pic_init(void)
55 return; 54 return;
56 } 55 }
57 56
58 if (of_address_to_resource(np, 0, &r)) {
59 printk(KERN_ERR "Failed to map mpic register space\n");
60 of_node_put(np);
61 return;
62 }
63
64 if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { 57 if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
65 mpic = mpic_alloc(np, r.start, 58 mpic = mpic_alloc(np, 0,
66 MPIC_PRIMARY | 59 MPIC_PRIMARY |
67 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 60 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
68 MPIC_SINGLE_DEST_CPU, 61 MPIC_SINGLE_DEST_CPU,
69 0, 256, " OpenPIC "); 62 0, 256, " OpenPIC ");
70 } else { 63 } else {
71 mpic = mpic_alloc(np, r.start, 64 mpic = mpic_alloc(np, 0,
72 MPIC_PRIMARY | MPIC_WANTS_RESET | 65 MPIC_PRIMARY | MPIC_WANTS_RESET |
73 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 66 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
74 MPIC_SINGLE_DEST_CPU, 67 MPIC_SINGLE_DEST_CPU,
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index 2f479f88c1a..dff49e83ba6 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -33,7 +33,6 @@
33void __init p1010_rdb_pic_init(void) 33void __init p1010_rdb_pic_init(void)
34{ 34{
35 struct mpic *mpic; 35 struct mpic *mpic;
36 struct resource r;
37 struct device_node *np; 36 struct device_node *np;
38 37
39 np = of_find_node_by_type(NULL, "open-pic"); 38 np = of_find_node_by_type(NULL, "open-pic");
@@ -42,13 +41,7 @@ void __init p1010_rdb_pic_init(void)
42 return; 41 return;
43 } 42 }
44 43
45 if (of_address_to_resource(np, 0, &r)) { 44 mpic = mpic_alloc(np, 0, MPIC_PRIMARY | MPIC_WANTS_RESET |
46 printk(KERN_ERR "Failed to map mpic register space\n");
47 of_node_put(np);
48 return;
49 }
50
51 mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET |
52 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, 45 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
53 0, 256, " OpenPIC "); 46 0, 256, " OpenPIC ");
54 47
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 8d5c22bfdd2..6d684c2979a 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -242,7 +242,6 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port)
242void __init p1022_ds_pic_init(void) 242void __init p1022_ds_pic_init(void)
243{ 243{
244 struct mpic *mpic; 244 struct mpic *mpic;
245 struct resource r;
246 struct device_node *np; 245 struct device_node *np;
247 246
248 np = of_find_node_by_type(NULL, "open-pic"); 247 np = of_find_node_by_type(NULL, "open-pic");
@@ -251,13 +250,7 @@ void __init p1022_ds_pic_init(void)
251 return; 250 return;
252 } 251 }
253 252
254 if (of_address_to_resource(np, 0, &r)) { 253 mpic = mpic_alloc(np, 0,
255 pr_err("Failed to map mpic register space\n");
256 of_node_put(np);
257 return;
258 }
259
260 mpic = mpic_alloc(np, r.start,
261 MPIC_PRIMARY | MPIC_WANTS_RESET | 254 MPIC_PRIMARY | MPIC_WANTS_RESET |
262 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 255 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
263 MPIC_SINGLE_DEST_CPU, 256 MPIC_SINGLE_DEST_CPU,
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 57c3e0f32e9..df7ccf68821 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -94,7 +94,6 @@ machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
94static void __init mpc85xx_rds_pic_init(void) 94static void __init mpc85xx_rds_pic_init(void)
95{ 95{
96 struct mpic *mpic; 96 struct mpic *mpic;
97 struct resource r;
98 struct device_node *np = NULL; 97 struct device_node *np = NULL;
99 98
100 np = of_find_node_by_type(NULL, "open-pic"); 99 np = of_find_node_by_type(NULL, "open-pic");
@@ -103,13 +102,7 @@ static void __init mpc85xx_rds_pic_init(void)
103 return; 102 return;
104 } 103 }
105 104
106 if (of_address_to_resource(np, 0, &r)) { 105 mpic = mpic_alloc(np, 0,
107 printk(KERN_ERR "Failed to map mpic register space\n");
108 of_node_put(np);
109 return;
110 }
111
112 mpic = mpic_alloc(np, r.start,
113 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | 106 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
114 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, 107 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
115 0, 256, " OpenPIC "); 108 0, 256, " OpenPIC ");
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 845ed3b8946..5e16025a755 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -55,7 +55,6 @@ static int sbc_rev;
55static void __init sbc8548_pic_init(void) 55static void __init sbc8548_pic_init(void)
56{ 56{
57 struct mpic *mpic; 57 struct mpic *mpic;
58 struct resource r;
59 struct device_node *np = NULL; 58 struct device_node *np = NULL;
60 59
61 np = of_find_node_by_type(np, "open-pic"); 60 np = of_find_node_by_type(np, "open-pic");
@@ -65,13 +64,7 @@ static void __init sbc8548_pic_init(void)
65 return; 64 return;
66 } 65 }
67 66
68 if (of_address_to_resource(np, 0, &r)) { 67 mpic = mpic_alloc(np, 0,
69 printk(KERN_ERR "Failed to map mpic register space\n");
70 of_node_put(np);
71 return;
72 }
73
74 mpic = mpic_alloc(np, r.start,
75 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 68 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
76 0, 256, " OpenPIC "); 69 0, 256, " OpenPIC ");
77 BUG_ON(mpic == NULL); 70 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index e9a7ed228d7..97f00dec0d9 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -42,7 +42,6 @@
42static void __init sbc8560_pic_init(void) 42static void __init sbc8560_pic_init(void)
43{ 43{
44 struct mpic *mpic; 44 struct mpic *mpic;
45 struct resource r;
46 struct device_node *np = NULL; 45 struct device_node *np = NULL;
47 46
48 np = of_find_node_by_type(np, "open-pic"); 47 np = of_find_node_by_type(np, "open-pic");
@@ -51,13 +50,7 @@ static void __init sbc8560_pic_init(void)
51 return; 50 return;
52 } 51 }
53 52
54 if (of_address_to_resource(np, 0, &r)) { 53 mpic = mpic_alloc(np, 0,
55 printk(KERN_ERR "Could not map mpic register space\n");
56 of_node_put(np);
57 return;
58 }
59
60 mpic = mpic_alloc(np, r.start,
61 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 54 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
62 0, 256, " OpenPIC "); 55 0, 256, " OpenPIC ");
63 BUG_ON(mpic == NULL); 56 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index fec496ad79c..e87e75cdb94 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -47,7 +47,6 @@
47static void __init socrates_pic_init(void) 47static void __init socrates_pic_init(void)
48{ 48{
49 struct mpic *mpic; 49 struct mpic *mpic;
50 struct resource r;
51 struct device_node *np; 50 struct device_node *np;
52 51
53 np = of_find_node_by_type(NULL, "open-pic"); 52 np = of_find_node_by_type(NULL, "open-pic");
@@ -56,13 +55,7 @@ static void __init socrates_pic_init(void)
56 return; 55 return;
57 } 56 }
58 57
59 if (of_address_to_resource(np, 0, &r)) { 58 mpic = mpic_alloc(np, 0,
60 printk(KERN_ERR "Could not map mpic register space\n");
61 of_node_put(np);
62 return;
63 }
64
65 mpic = mpic_alloc(np, r.start,
66 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 59 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
67 0, 256, " OpenPIC "); 60 0, 256, " OpenPIC ");
68 BUG_ON(mpic == NULL); 61 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index b44c936c265..060d5148075 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -49,7 +49,6 @@
49static void __init stx_gp3_pic_init(void) 49static void __init stx_gp3_pic_init(void)
50{ 50{
51 struct mpic *mpic; 51 struct mpic *mpic;
52 struct resource r;
53 struct device_node *np; 52 struct device_node *np;
54 53
55 np = of_find_node_by_type(NULL, "open-pic"); 54 np = of_find_node_by_type(NULL, "open-pic");
@@ -58,13 +57,7 @@ static void __init stx_gp3_pic_init(void)
58 return; 57 return;
59 } 58 }
60 59
61 if (of_address_to_resource(np, 0, &r)) { 60 mpic = mpic_alloc(np, 0,
62 printk(KERN_ERR "Could not map mpic register space\n");
63 of_node_put(np);
64 return;
65 }
66
67 mpic = mpic_alloc(np, r.start,
68 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 61 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
69 0, 256, " OpenPIC "); 62 0, 256, " OpenPIC ");
70 BUG_ON(mpic == NULL); 63 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 2418bf8d074..a46b9fc6620 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -47,7 +47,6 @@
47static void __init tqm85xx_pic_init(void) 47static void __init tqm85xx_pic_init(void)
48{ 48{
49 struct mpic *mpic; 49 struct mpic *mpic;
50 struct resource r;
51 struct device_node *np; 50 struct device_node *np;
52 51
53 np = of_find_node_by_type(NULL, "open-pic"); 52 np = of_find_node_by_type(NULL, "open-pic");
@@ -56,13 +55,7 @@ static void __init tqm85xx_pic_init(void)
56 return; 55 return;
57 } 56 }
58 57
59 if (of_address_to_resource(np, 0, &r)) { 58 mpic = mpic_alloc(np, 0,
60 printk(KERN_ERR "Could not map mpic register space\n");
61 of_node_put(np);
62 return;
63 }
64
65 mpic = mpic_alloc(np, r.start,
66 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 59 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
67 0, 256, " OpenPIC "); 60 0, 256, " OpenPIC ");
68 BUG_ON(mpic == NULL); 61 BUG_ON(mpic == NULL);
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index daf9bef63de..2be5e4de188 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -44,7 +44,6 @@
44void __init xes_mpc85xx_pic_init(void) 44void __init xes_mpc85xx_pic_init(void)
45{ 45{
46 struct mpic *mpic; 46 struct mpic *mpic;
47 struct resource r;
48 struct device_node *np; 47 struct device_node *np;
49 48
50 np = of_find_node_by_type(NULL, "open-pic"); 49 np = of_find_node_by_type(NULL, "open-pic");
@@ -53,13 +52,7 @@ void __init xes_mpc85xx_pic_init(void)
53 return; 52 return;
54 } 53 }
55 54
56 if (of_address_to_resource(np, 0, &r)) { 55 mpic = mpic_alloc(np, 0,
57 printk(KERN_ERR "Failed to map mpic register space\n");
58 of_node_put(np);
59 return;
60 }
61
62 mpic = mpic_alloc(np, r.start,
63 MPIC_PRIMARY | MPIC_WANTS_RESET | 56 MPIC_PRIMARY | MPIC_WANTS_RESET |
64 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, 57 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
65 0, 256, " OpenPIC "); 58 0, 256, " OpenPIC ");
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c
index 8ef8960abda..f85c8f0aa96 100644
--- a/arch/powerpc/platforms/86xx/pic.c
+++ b/arch/powerpc/platforms/86xx/pic.c
@@ -33,7 +33,6 @@ void __init mpc86xx_init_irq(void)
33{ 33{
34 struct mpic *mpic; 34 struct mpic *mpic;
35 struct device_node *np; 35 struct device_node *np;
36 struct resource res;
37#ifdef CONFIG_PPC_I8259 36#ifdef CONFIG_PPC_I8259
38 struct device_node *cascade_node = NULL; 37 struct device_node *cascade_node = NULL;
39 int cascade_irq; 38 int cascade_irq;
@@ -43,9 +42,8 @@ void __init mpc86xx_init_irq(void)
43 np = of_find_node_by_type(NULL, "open-pic"); 42 np = of_find_node_by_type(NULL, "open-pic");
44 if (np == NULL) 43 if (np == NULL)
45 return; 44 return;
46 of_address_to_resource(np, 0, &res);
47 45
48 mpic = mpic_alloc(np, res.start, 46 mpic = mpic_alloc(np, 0,
49 MPIC_PRIMARY | MPIC_WANTS_RESET | 47 MPIC_PRIMARY | MPIC_WANTS_RESET |
50 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 48 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
51 MPIC_SINGLE_DEST_CPU, 49 MPIC_SINGLE_DEST_CPU,
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 901bfbddc3d..78456fd4416 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -498,14 +498,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
498 int master) 498 int master)
499{ 499{
500 const char *name = master ? " MPIC 1 " : " MPIC 2 "; 500 const char *name = master ? " MPIC 1 " : " MPIC 2 ";
501 struct resource r;
502 struct mpic *mpic; 501 struct mpic *mpic;
503 unsigned int flags = master ? MPIC_PRIMARY : 0; 502 unsigned int flags = master ? MPIC_PRIMARY : 0;
504 int rc;
505
506 rc = of_address_to_resource(np, 0, &r);
507 if (rc)
508 return NULL;
509 503
510 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); 504 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0);
511 505
@@ -519,7 +513,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
519 if (master && (flags & MPIC_BIG_ENDIAN)) 513 if (master && (flags & MPIC_BIG_ENDIAN))
520 flags |= MPIC_U3_HT_IRQS; 514 flags |= MPIC_U3_HT_IRQS;
521 515
522 mpic = mpic_alloc(np, r.start, flags, 0, 0, name); 516 mpic = mpic_alloc(np, 0, flags, 0, 0, name);
523 if (mpic == NULL) 517 if (mpic == NULL)
524 return NULL; 518 return NULL;
525 519
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index b3fa3d7d4ab..8f24c6e8f53 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1142,7 +1142,24 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1142 const char *vers; 1142 const char *vers;
1143 int i; 1143 int i;
1144 int intvec_top; 1144 int intvec_top;
1145 u64 paddr = phys_addr; 1145
1146 /*
1147 * If no phyiscal address was specified then all of the phyiscal
1148 * addressing parameters must come from the device-tree.
1149 */
1150 if (!phys_addr) {
1151 BUG_ON(!node);
1152
1153 /* Check if it is DCR-based */
1154 if (of_get_property(node, "dcr-reg", NULL)) {
1155 flags |= MPIC_USES_DCR;
1156 } else {
1157 struct resource r;
1158 if (of_address_to_resource(node, 0, &r))
1159 return NULL;
1160 phys_addr = r.start;
1161 }
1162 }
1146 1163
1147 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL); 1164 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL);
1148 if (mpic == NULL) 1165 if (mpic == NULL)
@@ -1224,35 +1241,25 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1224#endif 1241#endif
1225 1242
1226 /* default register type */ 1243 /* default register type */
1227 mpic->reg_type = (flags & MPIC_BIG_ENDIAN) ? 1244 if (flags & MPIC_BIG_ENDIAN)
1228 mpic_access_mmio_be : mpic_access_mmio_le; 1245 mpic->reg_type = mpic_access_mmio_be;
1229 1246 else
1230 /* If no physical address is passed in, a device-node is mandatory */ 1247 mpic->reg_type = mpic_access_mmio_le;
1231 BUG_ON(paddr == 0 && node == NULL);
1232 1248
1233 /* If no physical address passed in, check if it's dcr based */ 1249 /*
1234 if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) { 1250 * An MPIC with a "dcr-reg" property must be accessed that way, but
1251 * only if the kernel includes DCR support.
1252 */
1235#ifdef CONFIG_PPC_DCR 1253#ifdef CONFIG_PPC_DCR
1236 mpic->flags |= MPIC_USES_DCR; 1254 if (flags & MPIC_USES_DCR)
1237 mpic->reg_type = mpic_access_dcr; 1255 mpic->reg_type = mpic_access_dcr;
1238#else 1256#else
1239 BUG(); 1257 BUG_ON(flags & MPIC_USES_DCR);
1240#endif /* CONFIG_PPC_DCR */ 1258#endif
1241 }
1242
1243 /* If the MPIC is not DCR based, and no physical address was passed
1244 * in, try to obtain one
1245 */
1246 if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
1247 const u32 *reg = of_get_property(node, "reg", NULL);
1248 BUG_ON(reg == NULL);
1249 paddr = of_translate_address(node, reg);
1250 BUG_ON(paddr == OF_BAD_ADDR);
1251 }
1252 1259
1253 /* Map the global registers */ 1260 /* Map the global registers */
1254 mpic_map(mpic, node, paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000); 1261 mpic_map(mpic, node, phys_addr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000);
1255 mpic_map(mpic, node, paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000); 1262 mpic_map(mpic, node, phys_addr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000);
1256 1263
1257 /* Reset */ 1264 /* Reset */
1258 1265
@@ -1307,7 +1314,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1307 for_each_possible_cpu(i) { 1314 for_each_possible_cpu(i) {
1308 unsigned int cpu = get_hard_smp_processor_id(i); 1315 unsigned int cpu = get_hard_smp_processor_id(i);
1309 1316
1310 mpic_map(mpic, node, paddr, &mpic->cpuregs[cpu], 1317 mpic_map(mpic, node, phys_addr, &mpic->cpuregs[cpu],
1311 MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE), 1318 MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE),
1312 0x1000); 1319 0x1000);
1313 } 1320 }
@@ -1315,7 +1322,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1315 /* Initialize main ISU if none provided */ 1322 /* Initialize main ISU if none provided */
1316 if (mpic->isu_size == 0) { 1323 if (mpic->isu_size == 0) {
1317 mpic->isu_size = mpic->num_sources; 1324 mpic->isu_size = mpic->num_sources;
1318 mpic_map(mpic, node, paddr, &mpic->isus[0], 1325 mpic_map(mpic, node, phys_addr, &mpic->isus[0],
1319 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1326 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1320 } 1327 }
1321 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); 1328 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1);
@@ -1347,7 +1354,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1347 } 1354 }
1348 printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx," 1355 printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx,"
1349 " max %d CPUs\n", 1356 " max %d CPUs\n",
1350 name, vers, (unsigned long long)paddr, num_possible_cpus()); 1357 name, vers, (unsigned long long)phys_addr, num_possible_cpus());
1351 printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n", 1358 printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n",
1352 mpic->isu_size, mpic->isu_shift, mpic->isu_mask); 1359 mpic->isu_size, mpic->isu_shift, mpic->isu_mask);
1353 1360