2 * linux/drivers/ide/q40ide.c -- Q40 I/O port IDE Driver
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
13 #include <linux/types.h>
15 #include <linux/interrupt.h>
16 #include <linux/blkdev.h>
17 #include <linux/hdreg.h>
19 #include <linux/ide.h>
22 * Bases of the IDE interfaces
25 #define Q40IDE_NUM_HWIFS 2
27 #define PCIDE_BASE1 0x1f0
28 #define PCIDE_BASE2 0x170
29 #define PCIDE_BASE3 0x1e8
30 #define PCIDE_BASE4 0x168
31 #define PCIDE_BASE5 0x1e0
32 #define PCIDE_BASE6 0x160
34 static const q40ide_ioreg_t pcide_bases[Q40IDE_NUM_HWIFS] = {
35 PCIDE_BASE1, PCIDE_BASE2, /* PCIDE_BASE3, PCIDE_BASE4 , PCIDE_BASE5,
41 * Offsets from one of the above bases
45 /* HD_DATA was redefined in asm-m68k/ide.h */
50 #define PCIDE_REG(x) ((q40ide_ioreg_t)(HD_##x-PCIDE_BASE1))
52 static const int pcide_offsets[IDE_NR_PORTS] = {
53 PCIDE_REG(DATA), PCIDE_REG(ERROR), PCIDE_REG(NSECTOR), PCIDE_REG(SECTOR),
54 PCIDE_REG(LCYL), PCIDE_REG(HCYL), PCIDE_REG(CURRENT), PCIDE_REG(STATUS),
58 static int q40ide_default_irq(q40ide_ioreg_t base)
61 case 0x1f0: return 14;
62 case 0x170: return 15;
63 case 0x1e8: return 11;
72 * Probe for Q40 IDE interfaces
75 void q40ide_init(void)
82 for (i = 0; i < Q40IDE_NUM_HWIFS; i++) {
85 ide_setup_ports(&hw,(ide_ioreg_t) pcide_bases[i], (int *)pcide_offsets,
89 q40ide_default_irq(pcide_bases[i]));
90 ide_register_hw(&hw, NULL);