diff options
Diffstat (limited to 'drivers/ide/ide-generic.c')
| -rw-r--r-- | drivers/ide/ide-generic.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 3a93e4c41bf7..7812ca0be13b 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c | |||
| @@ -13,7 +13,10 @@ | |||
| 13 | #include <linux/ide.h> | 13 | #include <linux/ide.h> |
| 14 | #include <linux/pci_ids.h> | 14 | #include <linux/pci_ids.h> |
| 15 | 15 | ||
| 16 | /* FIXME: convert m32r to use ide_platform host driver */ | 16 | /* FIXME: convert arm and m32r to use ide_platform host driver */ |
| 17 | #ifdef CONFIG_ARM | ||
| 18 | #include <asm/irq.h> | ||
| 19 | #endif | ||
| 17 | #ifdef CONFIG_M32R | 20 | #ifdef CONFIG_M32R |
| 18 | #include <asm/m32r.h> | 21 | #include <asm/m32r.h> |
| 19 | #endif | 22 | #endif |
| @@ -28,8 +31,11 @@ static const struct ide_port_info ide_generic_port_info = { | |||
| 28 | .host_flags = IDE_HFLAG_NO_DMA, | 31 | .host_flags = IDE_HFLAG_NO_DMA, |
| 29 | }; | 32 | }; |
| 30 | 33 | ||
| 31 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ | 34 | #ifdef CONFIG_ARM |
| 32 | || defined(CONFIG_PLAT_OPSPUT) | 35 | static const u16 legacy_bases[] = { 0x1f0 }; |
| 36 | static const int legacy_irqs[] = { IRQ_HARDDISK }; | ||
| 37 | #elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || \ | ||
| 38 | defined(CONFIG_PLAT_OPSPUT) | ||
| 33 | static const u16 legacy_bases[] = { 0x1f0 }; | 39 | static const u16 legacy_bases[] = { 0x1f0 }; |
| 34 | static const int legacy_irqs[] = { PLD_IRQ_CFIREQ }; | 40 | static const int legacy_irqs[] = { PLD_IRQ_CFIREQ }; |
| 35 | #elif defined(CONFIG_PLAT_MAPPI3) | 41 | #elif defined(CONFIG_PLAT_MAPPI3) |
| @@ -45,11 +51,11 @@ static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 }; | |||
| 45 | 51 | ||
| 46 | static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary) | 52 | static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary) |
| 47 | { | 53 | { |
| 54 | #ifdef CONFIG_PCI | ||
| 48 | struct pci_dev *p = NULL; | 55 | struct pci_dev *p = NULL; |
| 49 | u16 val; | 56 | u16 val; |
| 50 | 57 | ||
| 51 | for_each_pci_dev(p) { | 58 | for_each_pci_dev(p) { |
| 52 | |||
| 53 | if (pci_resource_start(p, 0) == 0x1f0) | 59 | if (pci_resource_start(p, 0) == 0x1f0) |
| 54 | *primary = 1; | 60 | *primary = 1; |
| 55 | if (pci_resource_start(p, 2) == 0x170) | 61 | if (pci_resource_start(p, 2) == 0x170) |
| @@ -64,7 +70,6 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary) | |||
| 64 | /* Intel MPIIX - PIO ATA on non PCI side of bridge */ | 70 | /* Intel MPIIX - PIO ATA on non PCI side of bridge */ |
| 65 | if (p->vendor == PCI_VENDOR_ID_INTEL && | 71 | if (p->vendor == PCI_VENDOR_ID_INTEL && |
| 66 | p->device == PCI_DEVICE_ID_INTEL_82371MX) { | 72 | p->device == PCI_DEVICE_ID_INTEL_82371MX) { |
| 67 | |||
| 68 | pci_read_config_word(p, 0x6C, &val); | 73 | pci_read_config_word(p, 0x6C, &val); |
| 69 | if (val & 0x8000) { | 74 | if (val & 0x8000) { |
| 70 | /* ATA port enabled */ | 75 | /* ATA port enabled */ |
| @@ -75,6 +80,7 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary) | |||
| 75 | } | 80 | } |
| 76 | } | 81 | } |
| 77 | } | 82 | } |
| 83 | #endif | ||
| 78 | } | 84 | } |
| 79 | 85 | ||
| 80 | static int __init ide_generic_init(void) | 86 | static int __init ide_generic_init(void) |
| @@ -106,6 +112,7 @@ static int __init ide_generic_init(void) | |||
| 106 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX " | 112 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX " |
| 107 | "not free.\n", | 113 | "not free.\n", |
| 108 | DRV_NAME, io_addr, io_addr + 7); | 114 | DRV_NAME, io_addr, io_addr + 7); |
| 115 | rc = -EBUSY; | ||
| 109 | continue; | 116 | continue; |
| 110 | } | 117 | } |
| 111 | 118 | ||
| @@ -114,6 +121,7 @@ static int __init ide_generic_init(void) | |||
| 114 | "not free.\n", | 121 | "not free.\n", |
| 115 | DRV_NAME, io_addr + 0x206); | 122 | DRV_NAME, io_addr + 0x206); |
| 116 | release_region(io_addr, 8); | 123 | release_region(io_addr, 8); |
| 124 | rc = -EBUSY; | ||
| 117 | continue; | 125 | continue; |
| 118 | } | 126 | } |
| 119 | 127 | ||
