2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * This file contains the MIPS architecture specific IDE code.
8 * Copyright (C) 1994-1996 Linus Torvalds & authors
12 * This file contains the MIPS architecture specific IDE code.
20 #include <linux/config.h>
24 # ifdef CONFIG_BLK_DEV_IDEPCI
32 int (*ide_default_irq)(ide_ioreg_t base);
33 ide_ioreg_t (*ide_default_io_base)(int index);
34 void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port,
35 ide_ioreg_t ctrl_port, int *irq);
38 extern struct ide_ops *ide_ops;
40 static __inline__ int ide_default_irq(ide_ioreg_t base)
42 return ide_ops->ide_default_irq(base);
45 static __inline__ ide_ioreg_t ide_default_io_base(int index)
47 return ide_ops->ide_default_io_base(index);
50 static inline void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
51 ide_ioreg_t ctrl_port, int *irq)
53 ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, irq);
56 static __inline__ void ide_init_default_hwifs(void)
58 #ifndef CONFIG_BLK_DEV_IDEPCI
62 for(index = 0; index < MAX_HWIFS; index++) {
63 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
64 hw.irq = ide_default_irq(ide_default_io_base(index));
65 ide_register_hw(&hw, NULL);
67 #endif /* CONFIG_BLK_DEV_IDEPCI */
70 #if defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__)
87 unsigned short *ptr = (unsigned short *)(a); \
88 unsigned int i = (c); \
94 unsigned long *ptr = (unsigned long *)(a); \
95 unsigned int i = (c); \
99 #define outsw(p,a,c) \
101 unsigned short *ptr = (unsigned short *)(a); \
102 unsigned int i = (c); \
106 #define outsl(p,a,c) { \
107 unsigned long *ptr = (unsigned long *)(a); \
108 unsigned int i = (c); \
113 #endif /* defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__) */
115 #endif /* __KERNEL__ */
117 #endif /* __ASM_IDE_H */