Commit 0411a5e2 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[POWERPC] Update mpic to use dcr_host_t.base

Now that dcr_host_t contains the base address, we can use that in the mpic
code, rather than storing it separately.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 0b94a1ee
...@@ -156,8 +156,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type, ...@@ -156,8 +156,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type,
switch(type) { switch(type) {
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
case mpic_access_dcr: case mpic_access_dcr:
return dcr_read(rb->dhost, return dcr_read(rb->dhost, rb->dhost.base + reg);
rb->dbase + reg + rb->doff);
#endif #endif
case mpic_access_mmio_be: case mpic_access_mmio_be:
return in_be32(rb->base + (reg >> 2)); return in_be32(rb->base + (reg >> 2));
...@@ -174,8 +173,7 @@ static inline void _mpic_write(enum mpic_reg_type type, ...@@ -174,8 +173,7 @@ static inline void _mpic_write(enum mpic_reg_type type,
switch(type) { switch(type) {
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
case mpic_access_dcr: case mpic_access_dcr:
return dcr_write(rb->dhost, return dcr_write(rb->dhost, rb->dhost.base + reg, value);
rb->dbase + reg + rb->doff, value);
#endif #endif
case mpic_access_mmio_be: case mpic_access_mmio_be:
return out_be32(rb->base + (reg >> 2), value); return out_be32(rb->base + (reg >> 2), value);
...@@ -279,9 +277,11 @@ static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr, ...@@ -279,9 +277,11 @@ static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr,
static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb, static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb,
unsigned int offset, unsigned int size) unsigned int offset, unsigned int size)
{ {
rb->dbase = mpic->dcr_base; const u32 *dbasep;
rb->doff = offset;
rb->dhost = dcr_map(mpic->irqhost->of_node, rb->dbase + rb->doff, size); dbasep = of_get_property(mpic->irqhost->of_node, "dcr-reg", NULL);
rb->dhost = dcr_map(mpic->irqhost->of_node, *dbasep + offset, size);
BUG_ON(!DCR_MAP_OK(rb->dhost)); BUG_ON(!DCR_MAP_OK(rb->dhost));
} }
...@@ -1075,20 +1075,14 @@ struct mpic * __init mpic_alloc(struct device_node *node, ...@@ -1075,20 +1075,14 @@ struct mpic * __init mpic_alloc(struct device_node *node,
BUG_ON(paddr == 0 && node == NULL); BUG_ON(paddr == 0 && node == NULL);
/* If no physical address passed in, check if it's dcr based */ /* If no physical address passed in, check if it's dcr based */
if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) {
mpic->flags |= MPIC_USES_DCR;
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
if (mpic->flags & MPIC_USES_DCR) { mpic->flags |= MPIC_USES_DCR;
const u32 *dbasep;
dbasep = of_get_property(node, "dcr-reg", NULL);
BUG_ON(dbasep == NULL);
mpic->dcr_base = *dbasep;
mpic->reg_type = mpic_access_dcr; mpic->reg_type = mpic_access_dcr;
}
#else #else
BUG_ON (mpic->flags & MPIC_USES_DCR); BUG();
#endif /* CONFIG_PPC_DCR */ #endif /* CONFIG_PPC_DCR */
}
/* If the MPIC is not DCR based, and no physical address was passed /* If the MPIC is not DCR based, and no physical address was passed
* in, try to obtain one * in, try to obtain one
......
...@@ -224,8 +224,6 @@ struct mpic_reg_bank { ...@@ -224,8 +224,6 @@ struct mpic_reg_bank {
u32 __iomem *base; u32 __iomem *base;
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
dcr_host_t dhost; dcr_host_t dhost;
unsigned int dbase;
unsigned int doff;
#endif /* CONFIG_PPC_DCR */ #endif /* CONFIG_PPC_DCR */
}; };
...@@ -289,10 +287,6 @@ struct mpic ...@@ -289,10 +287,6 @@ struct mpic
struct mpic_reg_bank cpuregs[MPIC_MAX_CPUS]; struct mpic_reg_bank cpuregs[MPIC_MAX_CPUS];
struct mpic_reg_bank isus[MPIC_MAX_ISU]; struct mpic_reg_bank isus[MPIC_MAX_ISU];
#ifdef CONFIG_PPC_DCR
unsigned int dcr_base;
#endif
/* Protected sources */ /* Protected sources */
unsigned long *protected; unsigned long *protected;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment