diff options
-rw-r--r-- | arch/powerpc/include/asm/mpic.h | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/holly.c | 15 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/linkstation.c | 14 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/storcenter.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 11 |
7 files changed, 23 insertions, 54 deletions
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index e6fae49e0b74..ba0b2046106e 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h | |||
@@ -293,6 +293,9 @@ struct mpic | |||
293 | /* Register access method */ | 293 | /* Register access method */ |
294 | enum mpic_reg_type reg_type; | 294 | enum mpic_reg_type reg_type; |
295 | 295 | ||
296 | /* The physical base address of the MPIC */ | ||
297 | phys_addr_t paddr; | ||
298 | |||
296 | /* The various ioremap'ed bases */ | 299 | /* The various ioremap'ed bases */ |
297 | struct mpic_reg_bank gregs; | 300 | struct mpic_reg_bank gregs; |
298 | struct mpic_reg_bank tmregs; | 301 | struct mpic_reg_bank tmregs; |
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c index 2e9bcf6444c8..d4fb41e29c35 100644 --- a/arch/powerpc/platforms/embedded6xx/holly.c +++ b/arch/powerpc/platforms/embedded6xx/holly.c | |||
@@ -148,7 +148,6 @@ static void __init holly_setup_arch(void) | |||
148 | static void __init holly_init_IRQ(void) | 148 | static void __init holly_init_IRQ(void) |
149 | { | 149 | { |
150 | struct mpic *mpic; | 150 | struct mpic *mpic; |
151 | phys_addr_t mpic_paddr = 0; | ||
152 | struct device_node *tsi_pic; | 151 | struct device_node *tsi_pic; |
153 | #ifdef CONFIG_PCI | 152 | #ifdef CONFIG_PCI |
154 | unsigned int cascade_pci_irq; | 153 | unsigned int cascade_pci_irq; |
@@ -157,20 +156,12 @@ static void __init holly_init_IRQ(void) | |||
157 | #endif | 156 | #endif |
158 | 157 | ||
159 | tsi_pic = of_find_node_by_type(NULL, "open-pic"); | 158 | tsi_pic = of_find_node_by_type(NULL, "open-pic"); |
160 | if (tsi_pic) { | 159 | if (!tsi_pic) { |
161 | unsigned int size; | ||
162 | const void *prop = of_get_property(tsi_pic, "reg", &size); | ||
163 | mpic_paddr = of_translate_address(tsi_pic, prop); | ||
164 | } | ||
165 | |||
166 | if (mpic_paddr == 0) { | ||
167 | printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__); | 160 | printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__); |
168 | return; | 161 | return; |
169 | } | 162 | } |
170 | 163 | ||
171 | pr_debug("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr); | 164 | mpic = mpic_alloc(tsi_pic, 0, |
172 | |||
173 | mpic = mpic_alloc(tsi_pic, mpic_paddr, | ||
174 | MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | | 165 | MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | |
175 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, | 166 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, |
176 | 24, | 167 | 24, |
@@ -179,7 +170,7 @@ static void __init holly_init_IRQ(void) | |||
179 | 170 | ||
180 | BUG_ON(mpic == NULL); | 171 | BUG_ON(mpic == NULL); |
181 | 172 | ||
182 | mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); | 173 | mpic_assign_isu(mpic, 0, mpic->paddr + 0x100); |
183 | 174 | ||
184 | mpic_init(mpic); | 175 | mpic_init(mpic); |
185 | 176 | ||
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c index 244f997de791..72b36850c5e3 100644 --- a/arch/powerpc/platforms/embedded6xx/linkstation.c +++ b/arch/powerpc/platforms/embedded6xx/linkstation.c | |||
@@ -82,28 +82,22 @@ static void __init linkstation_init_IRQ(void) | |||
82 | { | 82 | { |
83 | struct mpic *mpic; | 83 | struct mpic *mpic; |
84 | struct device_node *dnp; | 84 | struct device_node *dnp; |
85 | const u32 *prop; | ||
86 | int size; | ||
87 | phys_addr_t paddr; | ||
88 | 85 | ||
89 | dnp = of_find_node_by_type(NULL, "open-pic"); | 86 | dnp = of_find_node_by_type(NULL, "open-pic"); |
90 | if (dnp == NULL) | 87 | if (dnp == NULL) |
91 | return; | 88 | return; |
92 | 89 | ||
93 | prop = of_get_property(dnp, "reg", &size); | 90 | mpic = mpic_alloc(dnp, 0, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC "); |
94 | paddr = (phys_addr_t)of_translate_address(dnp, prop); | ||
95 | |||
96 | mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC "); | ||
97 | BUG_ON(mpic == NULL); | 91 | BUG_ON(mpic == NULL); |
98 | 92 | ||
99 | /* PCI IRQs */ | 93 | /* PCI IRQs */ |
100 | mpic_assign_isu(mpic, 0, paddr + 0x10200); | 94 | mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200); |
101 | 95 | ||
102 | /* I2C */ | 96 | /* I2C */ |
103 | mpic_assign_isu(mpic, 1, paddr + 0x11000); | 97 | mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000); |
104 | 98 | ||
105 | /* ttyS0, ttyS1 */ | 99 | /* ttyS0, ttyS1 */ |
106 | mpic_assign_isu(mpic, 2, paddr + 0x11100); | 100 | mpic_assign_isu(mpic, 2, mpic->paddr + 0x11100); |
107 | 101 | ||
108 | mpic_init(mpic); | 102 | mpic_init(mpic); |
109 | } | 103 | } |
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c index f8f33e16c6b6..c8ce204abd2d 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | |||
@@ -102,7 +102,6 @@ static void __init mpc7448_hpc2_setup_arch(void) | |||
102 | static void __init mpc7448_hpc2_init_IRQ(void) | 102 | static void __init mpc7448_hpc2_init_IRQ(void) |
103 | { | 103 | { |
104 | struct mpic *mpic; | 104 | struct mpic *mpic; |
105 | phys_addr_t mpic_paddr = 0; | ||
106 | struct device_node *tsi_pic; | 105 | struct device_node *tsi_pic; |
107 | #ifdef CONFIG_PCI | 106 | #ifdef CONFIG_PCI |
108 | unsigned int cascade_pci_irq; | 107 | unsigned int cascade_pci_irq; |
@@ -111,21 +110,12 @@ static void __init mpc7448_hpc2_init_IRQ(void) | |||
111 | #endif | 110 | #endif |
112 | 111 | ||
113 | tsi_pic = of_find_node_by_type(NULL, "open-pic"); | 112 | tsi_pic = of_find_node_by_type(NULL, "open-pic"); |
114 | if (tsi_pic) { | 113 | if (!tsi_pic) { |
115 | unsigned int size; | ||
116 | const void *prop = of_get_property(tsi_pic, "reg", &size); | ||
117 | mpic_paddr = of_translate_address(tsi_pic, prop); | ||
118 | } | ||
119 | |||
120 | if (mpic_paddr == 0) { | ||
121 | printk("%s: No tsi108 PIC found !\n", __func__); | 114 | printk("%s: No tsi108 PIC found !\n", __func__); |
122 | return; | 115 | return; |
123 | } | 116 | } |
124 | 117 | ||
125 | DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__, | 118 | mpic = mpic_alloc(tsi_pic, 0, |
126 | (u32) mpic_paddr); | ||
127 | |||
128 | mpic = mpic_alloc(tsi_pic, mpic_paddr, | ||
129 | MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | | 119 | MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | |
130 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, | 120 | MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, |
131 | 24, | 121 | 24, |
@@ -134,7 +124,7 @@ static void __init mpc7448_hpc2_init_IRQ(void) | |||
134 | 124 | ||
135 | BUG_ON(mpic == NULL); | 125 | BUG_ON(mpic == NULL); |
136 | 126 | ||
137 | mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); | 127 | mpic_assign_isu(mpic, 0, mpic->paddr + 0x100); |
138 | 128 | ||
139 | mpic_init(mpic); | 129 | mpic_init(mpic); |
140 | 130 | ||
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c index f1eebcae9bf0..084f0fc706b7 100644 --- a/arch/powerpc/platforms/embedded6xx/storcenter.c +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c | |||
@@ -84,22 +84,12 @@ static void __init storcenter_init_IRQ(void) | |||
84 | { | 84 | { |
85 | struct mpic *mpic; | 85 | struct mpic *mpic; |
86 | struct device_node *dnp; | 86 | struct device_node *dnp; |
87 | const void *prop; | ||
88 | int size; | ||
89 | phys_addr_t paddr; | ||
90 | 87 | ||
91 | dnp = of_find_node_by_type(NULL, "open-pic"); | 88 | dnp = of_find_node_by_type(NULL, "open-pic"); |
92 | if (dnp == NULL) | 89 | if (dnp == NULL) |
93 | return; | 90 | return; |
94 | 91 | ||
95 | prop = of_get_property(dnp, "reg", &size); | 92 | mpic = mpic_alloc(dnp, 0, MPIC_PRIMARY | MPIC_WANTS_RESET, |
96 | if (prop == NULL) { | ||
97 | of_node_put(dnp); | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | paddr = (phys_addr_t)of_translate_address(dnp, prop); | ||
102 | mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, | ||
103 | 16, 32, " OpenPIC "); | 93 | 16, 32, " OpenPIC "); |
104 | 94 | ||
105 | of_node_put(dnp); | 95 | of_node_put(dnp); |
@@ -110,8 +100,8 @@ static void __init storcenter_init_IRQ(void) | |||
110 | * 16 Serial Interrupts followed by 16 Internal Interrupts. | 100 | * 16 Serial Interrupts followed by 16 Internal Interrupts. |
111 | * I2C is the second internal, so it is at 17, 0x11020. | 101 | * I2C is the second internal, so it is at 17, 0x11020. |
112 | */ | 102 | */ |
113 | mpic_assign_isu(mpic, 0, paddr + 0x10200); | 103 | mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200); |
114 | mpic_assign_isu(mpic, 1, paddr + 0x11000); | 104 | mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000); |
115 | 105 | ||
116 | mpic_init(mpic); | 106 | mpic_init(mpic); |
117 | } | 107 | } |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 6f3558210554..baf20a913827 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -234,7 +234,7 @@ static __init void pas_init_IRQ(void) | |||
234 | mpic_flags, 0, 0, "PASEMI-OPIC"); | 234 | mpic_flags, 0, 0, "PASEMI-OPIC"); |
235 | BUG_ON(!mpic); | 235 | BUG_ON(!mpic); |
236 | 236 | ||
237 | mpic_assign_isu(mpic, 0, openpic_addr + 0x10000); | 237 | mpic_assign_isu(mpic, 0, mpic->paddr + 0x10000); |
238 | mpic_init(mpic); | 238 | mpic_init(mpic); |
239 | /* The NMI/MCK source needs to be prio 15 */ | 239 | /* The NMI/MCK source needs to be prio 15 */ |
240 | if (nmiprop) { | 240 | if (nmiprop) { |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 59564dcaab14..ef721c30f479 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1164,6 +1164,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1164 | return NULL; | 1164 | return NULL; |
1165 | 1165 | ||
1166 | mpic->name = name; | 1166 | mpic->name = name; |
1167 | mpic->paddr = phys_addr; | ||
1167 | 1168 | ||
1168 | mpic->hc_irq = mpic_irq_chip; | 1169 | mpic->hc_irq = mpic_irq_chip; |
1169 | mpic->hc_irq.name = name; | 1170 | mpic->hc_irq.name = name; |
@@ -1250,8 +1251,8 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1250 | #endif | 1251 | #endif |
1251 | 1252 | ||
1252 | /* Map the global registers */ | 1253 | /* Map the global registers */ |
1253 | mpic_map(mpic, node, phys_addr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000); | 1254 | mpic_map(mpic, node, mpic->paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000); |
1254 | mpic_map(mpic, node, phys_addr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000); | 1255 | mpic_map(mpic, node, mpic->paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000); |
1255 | 1256 | ||
1256 | /* Reset */ | 1257 | /* Reset */ |
1257 | 1258 | ||
@@ -1306,7 +1307,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1306 | for_each_possible_cpu(i) { | 1307 | for_each_possible_cpu(i) { |
1307 | unsigned int cpu = get_hard_smp_processor_id(i); | 1308 | unsigned int cpu = get_hard_smp_processor_id(i); |
1308 | 1309 | ||
1309 | mpic_map(mpic, node, phys_addr, &mpic->cpuregs[cpu], | 1310 | mpic_map(mpic, node, mpic->paddr, &mpic->cpuregs[cpu], |
1310 | MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE), | 1311 | MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE), |
1311 | 0x1000); | 1312 | 0x1000); |
1312 | } | 1313 | } |
@@ -1314,7 +1315,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1314 | /* Initialize main ISU if none provided */ | 1315 | /* Initialize main ISU if none provided */ |
1315 | if (mpic->isu_size == 0) { | 1316 | if (mpic->isu_size == 0) { |
1316 | mpic->isu_size = mpic->num_sources; | 1317 | mpic->isu_size = mpic->num_sources; |
1317 | mpic_map(mpic, node, phys_addr, &mpic->isus[0], | 1318 | mpic_map(mpic, node, mpic->paddr, &mpic->isus[0], |
1318 | MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); | 1319 | MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); |
1319 | } | 1320 | } |
1320 | mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); | 1321 | mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); |
@@ -1346,7 +1347,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1346 | } | 1347 | } |
1347 | printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx," | 1348 | printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx," |
1348 | " max %d CPUs\n", | 1349 | " max %d CPUs\n", |
1349 | name, vers, (unsigned long long)phys_addr, num_possible_cpus()); | 1350 | name, vers, (unsigned long long)mpic->paddr, num_possible_cpus()); |
1350 | printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n", | 1351 | printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n", |
1351 | mpic->isu_size, mpic->isu_shift, mpic->isu_mask); | 1352 | mpic->isu_size, mpic->isu_shift, mpic->isu_mask); |
1352 | 1353 | ||