aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c31
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
227static 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
235void 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
245u8 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};