aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-10-15 05:34:36 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 14:29:49 -0400
commit83f34df4e7c8794a5a81ede663fe184f4201308a (patch)
treec109c113ee02c5d656cd1b211ba2bc67d5dfd270 /arch/powerpc
parent0f18e719dc0d36ad91fe94b0b3dd08fdcdd2faa2 (diff)
Add dcr_host_t.base in dcr_read()/dcr_write()
Now that all users of dcr_read()/dcr_write() add the dcr_host_t.base, we can save them the trouble and do it in dcr_read()/dcr_write(). As some background to why we just went through all this jiggery-pokery, benh sayeth: Initially the goal of the dcr_read/dcr_write routines was to operate like mfdcr/mtdcr which take absolute DCR numbers. The reason is that on 4xx hardware, indirect DCR access is a pain (goes through a table of instructions) and it's useful to have the compiler resolve an absolute DCR inline. We decided that wasn't worth the API bastardisation since most places where absolute DCR values are used are low level 4xx-only code which may as well continue using mfdcr/mtdcr, while the new API is designed for device "instances" that can exist on 4xx and Axon type platforms and may be located at variable DCR offsets. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 1245b2f517b..aca15007a01 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -77,12 +77,12 @@ static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
77{ 77{
78 pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n); 78 pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n);
79 79
80 dcr_write(msic->dcr_host, msic->dcr_host.base + dcr_n, val); 80 dcr_write(msic->dcr_host, dcr_n, val);
81} 81}
82 82
83static u32 msic_dcr_read(struct axon_msic *msic, unsigned int dcr_n) 83static u32 msic_dcr_read(struct axon_msic *msic, unsigned int dcr_n)
84{ 84{
85 return dcr_read(msic->dcr_host, msic->dcr_host.base + dcr_n); 85 return dcr_read(msic->dcr_host, dcr_n);
86} 86}
87 87
88static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) 88static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 893e65439e8..e47938899a9 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -156,7 +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, rb->dhost.base + reg); 159 return dcr_read(rb->dhost, reg);
160#endif 160#endif
161 case mpic_access_mmio_be: 161 case mpic_access_mmio_be:
162 return in_be32(rb->base + (reg >> 2)); 162 return in_be32(rb->base + (reg >> 2));
@@ -173,7 +173,7 @@ static inline void _mpic_write(enum mpic_reg_type type,
173 switch(type) { 173 switch(type) {
174#ifdef CONFIG_PPC_DCR 174#ifdef CONFIG_PPC_DCR
175 case mpic_access_dcr: 175 case mpic_access_dcr:
176 return dcr_write(rb->dhost, rb->dhost.base + reg, value); 176 return dcr_write(rb->dhost, reg, value);
177#endif 177#endif
178 case mpic_access_mmio_be: 178 case mpic_access_mmio_be:
179 return out_be32(rb->base + (reg >> 2), value); 179 return out_be32(rb->base + (reg >> 2), value);