Author: laurent Date: 2009-01-15 03:17:00 +0100 (Thu, 15 Jan 2009) New Revision: 409
Modified: openbios-devel/drivers/ide.c openbios-devel/drivers/ide.h Log: ide: improve support of MMIO ide controller
Modified: openbios-devel/drivers/ide.c =================================================================== --- openbios-devel/drivers/ide.c 2009-01-14 23:30:09 UTC (rev 408) +++ openbios-devel/drivers/ide.c 2009-01-15 02:17:00 UTC (rev 409) @@ -89,27 +89,29 @@ * old style io port operations */ static unsigned char -ob_ide_inb(unsigned long port) +ob_ide_inb(struct ide_channel *chan, unsigned int port) { - return inb(port); + return inb(chan->io_regs[port]); }
static void -ob_ide_outb(unsigned char data, unsigned long port) +ob_ide_outb(struct ide_channel *chan, unsigned char data, unsigned int port) { - outb(data, port); + outb(data, chan->io_regs[port]); }
static void -ob_ide_insw(unsigned long port, unsigned char *addr, unsigned int count) +ob_ide_insw(struct ide_channel *chan, + unsigned int port, unsigned char *addr, unsigned int count) { - insw(port, addr, count); + insw(chan->io_regs[port], addr, count); }
static void -ob_ide_outsw(unsigned long port, unsigned char *addr, unsigned int count) +ob_ide_outsw(struct ide_channel *chan, + unsigned int port, unsigned char *addr, unsigned int count) { - outsw(port, addr, count); + outsw(chan->io_regs[port], addr, count); }
static inline unsigned char @@ -117,7 +119,7 @@ { struct ide_channel *chan = drive->channel;
- return chan->obide_inb(chan->io_regs[offset]); + return chan->obide_inb(chan, offset); }
static inline void @@ -126,7 +128,7 @@ { struct ide_channel *chan = drive->channel;
- chan->obide_outb(data, chan->io_regs[offset]); + chan->obide_outb(chan, data, offset); }
static inline void @@ -140,7 +142,7 @@ return; }
- chan->obide_insw(chan->io_regs[offset], addr, len / 2); + chan->obide_insw(chan, offset, addr, len / 2); }
static inline void @@ -154,7 +156,7 @@ return; }
- chan->obide_outsw(chan->io_regs[offset], addr, len / 2); + chan->obide_outsw(chan, offset, addr, len / 2); }
static void
Modified: openbios-devel/drivers/ide.h =================================================================== --- openbios-devel/drivers/ide.h 2009-01-14 23:30:09 UTC (rev 408) +++ openbios-devel/drivers/ide.h 2009-01-15 02:17:00 UTC (rev 409) @@ -169,16 +169,22 @@ /* * either mmio or io_regs is set to indicate mmio or not */ - int mmio; + unsigned long mmio; int io_regs[10];
/* * can be set to a mmio hook, default it legacy outb/inb */ - void (*obide_outb)(unsigned char addr, unsigned long port); - unsigned char (*obide_inb)(unsigned long port); - void (*obide_insw)(unsigned long port, unsigned char *addr, unsigned int count); - void (*obide_outsw)(unsigned long port, unsigned char *addr, unsigned int count); + void (*obide_outb)(struct ide_channel *chan, + unsigned char addr, unsigned int port); + unsigned char (*obide_inb)(struct ide_channel *chan, + unsigned int port); + void (*obide_insw)(struct ide_channel *chan, + unsigned int port, unsigned char *addr, + unsigned int count); + void (*obide_outsw)(struct ide_channel *chan, + unsigned int port, unsigned char *addr, + unsigned int count);
struct ide_drive drives[2]; char selected;