X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fide%2Fide-generic.c;h=8fe8b5b9cf7d7a1e6c7b70e60ed293d2178d57d2;hb=8d768e14fc57160b35ac13e797a81163baab34d2;hp=31d98fec775f32e1732d13970a304fa7012a7e95;hpb=5554b35933245e95710d709175e14c02cbc956a4;p=linux-2.6-omap-h63xx.git diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 31d98fec775..8fe8b5b9cf7 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -20,6 +20,11 @@ #include #include +/* FIXME: convert m32r to use ide_platform host driver */ +#ifdef CONFIG_M32R +#include +#endif + #define DRV_NAME "ide_generic" static int probe_mask = 0x03; @@ -80,6 +85,21 @@ static int __init ide_generic_sysfs_init(void) return 0; } +#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ + || defined(CONFIG_PLAT_OPSPUT) +static const u16 legacy_bases[] = { 0x1f0 }; +static const int legacy_irqs[] = { PLD_IRQ_CFIREQ }; +#elif defined(CONFIG_PLAT_MAPPI3) +static const u16 legacy_bases[] = { 0x1f0, 0x170 }; +static const int legacy_irqs[] = { PLD_IRQ_CFIREQ, PLD_IRQ_IDEIREQ }; +#elif defined(CONFIG_ALPHA) +static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 }; +static const int legacy_irqs[] = { 14, 15, 11, 10 }; +#else +static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 }; +static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 }; +#endif + static int __init ide_generic_init(void) { hw_regs_t hw[MAX_HWIFS], *hws[MAX_HWIFS]; @@ -87,11 +107,17 @@ static int __init ide_generic_init(void) unsigned long io_addr; int i, rc; +#ifdef CONFIG_MIPS + if (!ide_probe_legacy()) + return -ENODEV; +#endif printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " "parameter for probing all legacy ISA IDE ports\n"); - for (i = 0; i < MAX_HWIFS; i++) { - io_addr = ide_default_io_base(i); + memset(hws, 0, sizeof(hw_regs_t *) * MAX_HWIFS); + + for (i = 0; i < ARRAY_SIZE(legacy_bases); i++) { + io_addr = legacy_bases[i]; hws[i] = NULL; @@ -113,7 +139,11 @@ static int __init ide_generic_init(void) memset(&hw[i], 0, sizeof(hw[i])); ide_std_init_ports(&hw[i], io_addr, io_addr + 0x206); - hw[i].irq = ide_default_irq(io_addr); +#ifdef CONFIG_IA64 + hw[i].irq = isa_irq_to_vector(legacy_irqs[i]); +#else + hw[i].irq = legacy_irqs[i]; +#endif hw[i].chipset = ide_generic; hws[i] = &hw[i];