aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-generic.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:24 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:24 -0400
commit4465461ece2b9249d6c0cf57bc0002100823e361 (patch)
tree763bd52d82ee519dedf3c8c496e60ed27f3428a5 /drivers/ide/ide-generic.c
parent52913ab2c6f760c2af9f9396765ce8fa1a2baf17 (diff)
ide: merge ide_arm and ide_generic host drivers
There is no need for a separate ide_arm host driver nowadays so merge it into ide_generic one. While at it: - return -EBUSY from ide_generic_init() if I/O resources are busy - scale down ide_generic_check_pci_legacy_iobases() for CONFIG_PCI=n Cc: Russell King <rmk@arm.linux.org.uk> Cc: Alexander Schulz <alex@shark-linux.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-generic.c')
-rw-r--r--drivers/ide/ide-generic.c18
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) 35static const u16 legacy_bases[] = { 0x1f0 };
36static const int legacy_irqs[] = { IRQ_HARDDISK };
37#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || \
38 defined(CONFIG_PLAT_OPSPUT)
33static const u16 legacy_bases[] = { 0x1f0 }; 39static const u16 legacy_bases[] = { 0x1f0 };
34static const int legacy_irqs[] = { PLD_IRQ_CFIREQ }; 40static 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
46static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary) 52static 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
80static int __init ide_generic_init(void) 86static 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