aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/sysdev/mpic.c28
-rw-r--r--include/asm-powerpc/mpic.h6
2 files changed, 11 insertions, 23 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 22600fd23958..893e65439e85 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -156,8 +156,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type,
156 switch(type) { 156 switch(type) {
157#ifdef CONFIG_PPC_DCR 157#ifdef CONFIG_PPC_DCR
158 case mpic_access_dcr: 158 case mpic_access_dcr:
159 return dcr_read(rb->dhost, 159 return dcr_read(rb->dhost, rb->dhost.base + reg);
160 rb->dbase + reg + rb->doff);
161#endif 160#endif
162 case mpic_access_mmio_be: 161 case mpic_access_mmio_be:
163 return in_be32(rb->base + (reg >> 2)); 162 return in_be32(rb->base + (reg >> 2));
@@ -174,8 +173,7 @@ static inline void _mpic_write(enum mpic_reg_type type,
174 switch(type) { 173 switch(type) {
175#ifdef CONFIG_PPC_DCR 174#ifdef CONFIG_PPC_DCR
176 case mpic_access_dcr: 175 case mpic_access_dcr:
177 return dcr_write(rb->dhost, 176 return dcr_write(rb->dhost, rb->dhost.base + reg, value);
178 rb->dbase + reg + rb->doff, value);
179#endif 177#endif
180 case mpic_access_mmio_be: 178 case mpic_access_mmio_be:
181 return out_be32(rb->base + (reg >> 2), value); 179 return out_be32(rb->base + (reg >> 2), value);
@@ -279,9 +277,11 @@ static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr,
279static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb, 277static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb,
280 unsigned int offset, unsigned int size) 278 unsigned int offset, unsigned int size)
281{ 279{
282 rb->dbase = mpic->dcr_base; 280 const u32 *dbasep;
283 rb->doff = offset; 281
284 rb->dhost = dcr_map(mpic->irqhost->of_node, rb->dbase + rb->doff, size); 282 dbasep = of_get_property(mpic->irqhost->of_node, "dcr-reg", NULL);
283
284 rb->dhost = dcr_map(mpic->irqhost->of_node, *dbasep + offset, size);
285 BUG_ON(!DCR_MAP_OK(rb->dhost)); 285 BUG_ON(!DCR_MAP_OK(rb->dhost));
286} 286}
287 287
@@ -1075,20 +1075,14 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1075 BUG_ON(paddr == 0 && node == NULL); 1075 BUG_ON(paddr == 0 && node == NULL);
1076 1076
1077 /* If no physical address passed in, check if it's dcr based */ 1077 /* If no physical address passed in, check if it's dcr based */
1078 if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) 1078 if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) {
1079 mpic->flags |= MPIC_USES_DCR;
1080
1081#ifdef CONFIG_PPC_DCR 1079#ifdef CONFIG_PPC_DCR
1082 if (mpic->flags & MPIC_USES_DCR) { 1080 mpic->flags |= MPIC_USES_DCR;
1083 const u32 *dbasep;
1084 dbasep = of_get_property(node, "dcr-reg", NULL);
1085 BUG_ON(dbasep == NULL);
1086 mpic->dcr_base = *dbasep;
1087 mpic->reg_type = mpic_access_dcr; 1081 mpic->reg_type = mpic_access_dcr;
1088 }
1089#else 1082#else
1090 BUG_ON (mpic->flags & MPIC_USES_DCR); 1083 BUG();
1091#endif /* CONFIG_PPC_DCR */ 1084#endif /* CONFIG_PPC_DCR */
1085 }
1092 1086
1093 /* If the MPIC is not DCR based, and no physical address was passed 1087 /* If the MPIC is not DCR based, and no physical address was passed
1094 * in, try to obtain one 1088 * in, try to obtain one
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index edb4a7c84506..ae84dde3bc7f 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -224,8 +224,6 @@ struct mpic_reg_bank {
224 u32 __iomem *base; 224 u32 __iomem *base;
225#ifdef CONFIG_PPC_DCR 225#ifdef CONFIG_PPC_DCR
226 dcr_host_t dhost; 226 dcr_host_t dhost;
227 unsigned int dbase;
228 unsigned int doff;
229#endif /* CONFIG_PPC_DCR */ 227#endif /* CONFIG_PPC_DCR */
230}; 228};
231 229
@@ -289,10 +287,6 @@ struct mpic
289 struct mpic_reg_bank cpuregs[MPIC_MAX_CPUS]; 287 struct mpic_reg_bank cpuregs[MPIC_MAX_CPUS];
290 struct mpic_reg_bank isus[MPIC_MAX_ISU]; 288 struct mpic_reg_bank isus[MPIC_MAX_ISU];
291 289
292#ifdef CONFIG_PPC_DCR
293 unsigned int dcr_base;
294#endif
295
296 /* Protected sources */ 290 /* Protected sources */
297 unsigned long *protected; 291 unsigned long *protected;
298 292