Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73085
b: refs/heads/master
c: b5751e2
h: refs/heads/master
i:
  73083: 9f04310
v: v3
  • Loading branch information
Paul Mundt committed Nov 2, 2007
1 parent cce3948 commit dd26452
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f38c5a696a1e775c70d8764b1b9c1a4e267448d3
refs/heads/master: b5751e2e00cb88b34ac1ebfa9ec4496db4dee098
31 changes: 31 additions & 0 deletions trunk/arch/sh/boards/renesas/r7780rp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/pata_platform.h>
#include <linux/types.h>
#include <net/ax88796.h>
#include <asm/machvec.h>
#include <asm/r7780rp.h>
Expand Down Expand Up @@ -223,6 +224,34 @@ static void r7780rp_power_off(void)
ctrl_outw(0x0001, PA_POFF);
}

static inline unsigned char is_ide_ioaddr(unsigned long addr)
{
return ((cf_ide_resources[0].start <= addr &&
addr <= cf_ide_resources[0].end) ||
(cf_ide_resources[1].start <= addr &&
addr <= cf_ide_resources[1].end));
}

void highlander_writeb(u8 b, void __iomem *addr)
{
unsigned long tmp = (unsigned long __force)addr;

if (is_ide_ioaddr(tmp))
ctrl_outw((u16)b, tmp);
else
ctrl_outb(b, tmp);
}

u8 highlander_readb(void __iomem *addr)
{
unsigned long tmp = (unsigned long __force)addr;

if (is_ide_ioaddr(tmp))
return ctrl_inw(tmp) & 0xff;
else
return ctrl_inb(tmp);
}

/*
* Initialize the board
*/
Expand Down Expand Up @@ -307,4 +336,6 @@ static struct sh_machine_vector mv_highlander __initmv = {
.mv_setup = highlander_setup,
.mv_init_irq = highlander_init_irq,
.mv_irq_demux = highlander_irq_demux,
.mv_readb = highlander_readb,
.mv_writeb = highlander_writeb,
};

0 comments on commit dd26452

Please sign in to comment.