diff options
Diffstat (limited to 'drivers/ide/ide-generic.c')
-rw-r--r-- | drivers/ide/ide-generic.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 567fd843c7ff..8fe8b5b9cf7d 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c | |||
@@ -20,6 +20,11 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/ide.h> | 21 | #include <linux/ide.h> |
22 | 22 | ||
23 | /* FIXME: convert m32r to use ide_platform host driver */ | ||
24 | #ifdef CONFIG_M32R | ||
25 | #include <asm/m32r.h> | ||
26 | #endif | ||
27 | |||
23 | #define DRV_NAME "ide_generic" | 28 | #define DRV_NAME "ide_generic" |
24 | 29 | ||
25 | static int probe_mask = 0x03; | 30 | static int probe_mask = 0x03; |
@@ -80,6 +85,21 @@ static int __init ide_generic_sysfs_init(void) | |||
80 | return 0; | 85 | return 0; |
81 | } | 86 | } |
82 | 87 | ||
88 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ | ||
89 | || defined(CONFIG_PLAT_OPSPUT) | ||
90 | static const u16 legacy_bases[] = { 0x1f0 }; | ||
91 | static const int legacy_irqs[] = { PLD_IRQ_CFIREQ }; | ||
92 | #elif defined(CONFIG_PLAT_MAPPI3) | ||
93 | static const u16 legacy_bases[] = { 0x1f0, 0x170 }; | ||
94 | static const int legacy_irqs[] = { PLD_IRQ_CFIREQ, PLD_IRQ_IDEIREQ }; | ||
95 | #elif defined(CONFIG_ALPHA) | ||
96 | static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 }; | ||
97 | static const int legacy_irqs[] = { 14, 15, 11, 10 }; | ||
98 | #else | ||
99 | static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 }; | ||
100 | static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 }; | ||
101 | #endif | ||
102 | |||
83 | static int __init ide_generic_init(void) | 103 | static int __init ide_generic_init(void) |
84 | { | 104 | { |
85 | hw_regs_t hw[MAX_HWIFS], *hws[MAX_HWIFS]; | 105 | hw_regs_t hw[MAX_HWIFS], *hws[MAX_HWIFS]; |
@@ -94,8 +114,10 @@ static int __init ide_generic_init(void) | |||
94 | printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " | 114 | printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " |
95 | "parameter for probing all legacy ISA IDE ports\n"); | 115 | "parameter for probing all legacy ISA IDE ports\n"); |
96 | 116 | ||
97 | for (i = 0; i < MAX_HWIFS; i++) { | 117 | memset(hws, 0, sizeof(hw_regs_t *) * MAX_HWIFS); |
98 | io_addr = ide_default_io_base(i); | 118 | |
119 | for (i = 0; i < ARRAY_SIZE(legacy_bases); i++) { | ||
120 | io_addr = legacy_bases[i]; | ||
99 | 121 | ||
100 | hws[i] = NULL; | 122 | hws[i] = NULL; |
101 | 123 | ||
@@ -117,7 +139,11 @@ static int __init ide_generic_init(void) | |||
117 | 139 | ||
118 | memset(&hw[i], 0, sizeof(hw[i])); | 140 | memset(&hw[i], 0, sizeof(hw[i])); |
119 | ide_std_init_ports(&hw[i], io_addr, io_addr + 0x206); | 141 | ide_std_init_ports(&hw[i], io_addr, io_addr + 0x206); |
120 | hw[i].irq = ide_default_irq(io_addr); | 142 | #ifdef CONFIG_IA64 |
143 | hw[i].irq = isa_irq_to_vector(legacy_irqs[i]); | ||
144 | #else | ||
145 | hw[i].irq = legacy_irqs[i]; | ||
146 | #endif | ||
121 | hw[i].chipset = ide_generic; | 147 | hw[i].chipset = ide_generic; |
122 | 148 | ||
123 | hws[i] = &hw[i]; | 149 | hws[i] = &hw[i]; |