summaryrefslogtreecommitdiffstats
path: root/include/asm-mips64/ide.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-16 23:00:36 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-16 23:00:36 +0000
commit14dd2ec093cfabda3ae7efeeaf0e23c66ebaccc0 (patch)
tree9a9ce5cff6ef92faa6e07a82785b9a6d6838f7e4 /include/asm-mips64/ide.h
parent847290510f811c572cc2aa80c1f02a04721410b1 (diff)
Merge with 2.4.0-test1.
Diffstat (limited to 'include/asm-mips64/ide.h')
-rw-r--r--include/asm-mips64/ide.h72
1 files changed, 38 insertions, 34 deletions
diff --git a/include/asm-mips64/ide.h b/include/asm-mips64/ide.h
index bb3a32200..ed20997b1 100644
--- a/include/asm-mips64/ide.h
+++ b/include/asm-mips64/ide.h
@@ -1,16 +1,19 @@
-/* $Id: ide.h,v 1.1 1999/08/21 22:19:17 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * This file contains the MIPS architecture specific IDE code.
+ * This file contains the MIPS architecture specific IDE code.
*
* Copyright (C) 1994-1996 Linus Torvalds & authors
*/
-#ifndef _ASM_IDE_H
-#define _ASM_IDE_H
+/*
+ * This file contains the MIPS architecture specific IDE code.
+ */
+
+#ifndef __ASM_IDE_H
+#define __ASM_IDE_H
#ifdef __KERNEL__
@@ -43,39 +46,44 @@ struct ide_ops {
extern struct ide_ops *ide_ops;
-static inline int
-ide_default_irq(ide_ioreg_t base)
+static __inline__ int ide_default_irq(ide_ioreg_t base)
{
return ide_ops->ide_default_irq(base);
}
-static inline ide_ioreg_t
-ide_default_io_base(int index)
+static __inline__ ide_ioreg_t ide_default_io_base(int index)
{
return ide_ops->ide_default_io_base(index);
}
-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, ide_ioreg_t data_port,
+ ide_ioreg_t ctrl_port, int *irq)
{
- ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, &hw->irq);
+ ide_ioreg_t reg = data_port;
+ int i;
- hw->irq = ide_ops->ide_default_irq(data_port);
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ if (ctrl_port) {
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+ } else {
+ hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
+ }
+ if (irq != NULL)
+ *irq = 0;
+ hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
-static inline void ide_init_default_hwifs(void)
+static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_BLK_DEV_IDEPCI
hw_regs_t hw;
int index;
- for (index = 0; index < MAX_HWIFS; index++) {
- ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, 0);
+ for(index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
@@ -93,34 +101,30 @@ typedef union {
} b;
} select_t;
-static inline int
-ide_request_irq(unsigned int irq,
- void (*handler)(int,void *, struct pt_regs *),
- unsigned long flags, const char *device, void *dev_id)
+static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *),
+ unsigned long flags, const char *device, void *dev_id)
{
return ide_ops->ide_request_irq(irq, handler, flags, device, dev_id);
}
-static inline void
-ide_free_irq(unsigned int irq, void *dev_id)
+static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
{
ide_ops->ide_free_irq(irq, dev_id);
}
-static inline int
-ide_check_region(ide_ioreg_t from, unsigned int extent)
+static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
return ide_ops->ide_check_region(from, extent);
}
-static inline void
-ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name)
+static __inline__ void ide_request_region(ide_ioreg_t from,
+ unsigned int extent, const char *name)
{
ide_ops->ide_request_region(from, extent, name);
}
-static inline void
-ide_release_region(ide_ioreg_t from, unsigned int extent)
+static __inline__ void ide_release_region(ide_ioreg_t from,
+ unsigned int extent)
{
ide_ops->ide_release_region(from, extent);
}
@@ -135,4 +139,4 @@ ide_release_region(ide_ioreg_t from, unsigned int extent)
#endif /* __KERNEL__ */
-#endif /* _ASM_IDE_H */
+#endif /* __ASM_IDE_H */