diff options
| author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2003-02-17 19:41:12 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-17 19:41:12 -0800 |
| commit | e04b25796483d5a6786879a14072b4403ff6ffed (patch) | |
| tree | afb63373b7e2320cd82e4d72e3583e3abc7f0570 | |
| parent | 7944c22081d50c19a7386db8d61a364d5edada9d (diff) | |
[PATCH] ide resync
Ok this first piece eliminates some of the use of ide_ioreg_t, which
actually only works as a ulong anyway. Its a dysfunctional abstraction.
We also need the ide pci stuff if we have IDE PCI not if we have PCI but
only legacy mode IDE support
| -rw-r--r-- | include/asm-i386/ide.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index a4f8e17ea2de..45b830d0c74c 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h @@ -16,14 +16,14 @@ #include <linux/config.h> #ifndef MAX_HWIFS -# ifdef CONFIG_PCI +# ifdef CONFIG_BLK_DEV_IDEPCI #define MAX_HWIFS 10 # else #define MAX_HWIFS 6 # endif #endif -static __inline__ int ide_default_irq(ide_ioreg_t base) +static __inline__ int ide_default_irq(unsigned long base) { switch (base) { case 0x1f0: return 14; @@ -37,16 +37,24 @@ static __inline__ int ide_default_irq(ide_ioreg_t base) } } -static __inline__ ide_ioreg_t ide_default_io_base(int index) +static __inline__ unsigned long ide_default_io_base(int index) { - static unsigned long ata_io_base[MAX_HWIFS] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 }; - - return ata_io_base[index]; + switch (index) { + case 0: return 0x1f0; + case 1: return 0x170; + case 2: return 0x1e8; + case 3: return 0x168; + case 4: return 0x1e0; + case 5: return 0x160; + default: + return 0; + } } -static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) +static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, + unsigned long ctrl_port, int *irq) { - ide_ioreg_t reg = data_port; + unsigned long reg = data_port; int i; for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { @@ -65,7 +73,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, static __inline__ void ide_init_default_hwifs(void) { -#ifndef CONFIG_PCI +#ifndef CONFIG_BLK_DEV_IDEPCI hw_regs_t hw; int index; @@ -75,9 +83,11 @@ static __inline__ void ide_init_default_hwifs(void) hw.irq = ide_default_irq(ide_default_io_base(index)); ide_register_hw(&hw, NULL); } -#endif +#endif /* CONFIG_BLK_DEV_IDEPCI */ } +#include <asm-generic/ide_iops.h> + #endif /* __KERNEL__ */ #endif /* __ASMi386_IDE_H */ |
