diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-02 01:17:19 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-11-02 01:17:19 -0400 |
commit | b5751e2e00cb88b34ac1ebfa9ec4496db4dee098 (patch) | |
tree | 14c2450aadaaa2d76d901664c0c2e904ffbe698a /arch/sh | |
parent | f38c5a696a1e775c70d8764b1b9c1a4e267448d3 (diff) |
sh: Fix up r7780rp highlander CF access size.
R7780RP can't do byte-sized accesses to CF, so needs to do word
sized access with low-byte masking. This same problem exists
on older versions of the R2D, with the same workaround having
been implemented in 43f4b8c7578b928892b6f01d374346ae14e5eb70
there. Follow that change for the highlander boards.
This does not impact R7780MP or SH7785 based Highlander modules.
If you're unfortunate enough to be stuck with an R7780RP, this
patch is for you!
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/setup.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c index 2a9ac6bcd8d6..0fdc0bc19145 100644 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ b/arch/sh/boards/renesas/r7780rp/setup.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/pata_platform.h> | 18 | #include <linux/pata_platform.h> |
19 | #include <linux/types.h> | ||
19 | #include <net/ax88796.h> | 20 | #include <net/ax88796.h> |
20 | #include <asm/machvec.h> | 21 | #include <asm/machvec.h> |
21 | #include <asm/r7780rp.h> | 22 | #include <asm/r7780rp.h> |
@@ -223,6 +224,34 @@ static void r7780rp_power_off(void) | |||
223 | ctrl_outw(0x0001, PA_POFF); | 224 | ctrl_outw(0x0001, PA_POFF); |
224 | } | 225 | } |
225 | 226 | ||
227 | static inline unsigned char is_ide_ioaddr(unsigned long addr) | ||
228 | { | ||
229 | return ((cf_ide_resources[0].start <= addr && | ||
230 | addr <= cf_ide_resources[0].end) || | ||
231 | (cf_ide_resources[1].start <= addr && | ||
232 | addr <= cf_ide_resources[1].end)); | ||
233 | } | ||
234 | |||
235 | void highlander_writeb(u8 b, void __iomem *addr) | ||
236 | { | ||
237 | unsigned long tmp = (unsigned long __force)addr; | ||
238 | |||
239 | if (is_ide_ioaddr(tmp)) | ||
240 | ctrl_outw((u16)b, tmp); | ||
241 | else | ||
242 | ctrl_outb(b, tmp); | ||
243 | } | ||
244 | |||
245 | u8 highlander_readb(void __iomem *addr) | ||
246 | { | ||
247 | unsigned long tmp = (unsigned long __force)addr; | ||
248 | |||
249 | if (is_ide_ioaddr(tmp)) | ||
250 | return ctrl_inw(tmp) & 0xff; | ||
251 | else | ||
252 | return ctrl_inb(tmp); | ||
253 | } | ||
254 | |||
226 | /* | 255 | /* |
227 | * Initialize the board | 256 | * Initialize the board |
228 | */ | 257 | */ |
@@ -307,4 +336,6 @@ static struct sh_machine_vector mv_highlander __initmv = { | |||
307 | .mv_setup = highlander_setup, | 336 | .mv_setup = highlander_setup, |
308 | .mv_init_irq = highlander_init_irq, | 337 | .mv_init_irq = highlander_init_irq, |
309 | .mv_irq_demux = highlander_irq_demux, | 338 | .mv_irq_demux = highlander_irq_demux, |
339 | .mv_readb = highlander_readb, | ||
340 | .mv_writeb = highlander_writeb, | ||
310 | }; | 341 | }; |