diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:24 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:24 -0400 |
commit | 4465461ece2b9249d6c0cf57bc0002100823e361 (patch) | |
tree | 763bd52d82ee519dedf3c8c496e60ed27f3428a5 /drivers/ide | |
parent | 52913ab2c6f760c2af9f9396765ce8fa1a2baf17 (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')
-rw-r--r-- | drivers/ide/Kconfig | 8 | ||||
-rw-r--r-- | drivers/ide/Makefile | 2 | ||||
-rw-r--r-- | drivers/ide/ide-generic.c | 18 | ||||
-rw-r--r-- | drivers/ide/ide_arm.c | 53 |
4 files changed, 15 insertions, 66 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 640c99207242..896424445f65 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -222,7 +222,8 @@ comment "IDE chipset support/bugfixes" | |||
222 | 222 | ||
223 | config IDE_GENERIC | 223 | config IDE_GENERIC |
224 | tristate "generic/default IDE chipset support" | 224 | tristate "generic/default IDE chipset support" |
225 | depends on ALPHA || X86 || IA64 || M32R || MIPS | 225 | depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC || ARCH_SHARK |
226 | default ARM && (ARCH_RPC || ARCH_SHARK) | ||
226 | help | 227 | help |
227 | This is the generic IDE driver. This driver attaches to the | 228 | This is the generic IDE driver. This driver attaches to the |
228 | fixed legacy ports (e.g. on PCs 0x1f0/0x170, 0x1e8/0x168 and | 229 | fixed legacy ports (e.g. on PCs 0x1f0/0x170, 0x1e8/0x168 and |
@@ -731,11 +732,6 @@ config BLK_DEV_IDE_AT91 | |||
731 | depends on ARM && ARCH_AT91 && !ARCH_AT91RM9200 && !ARCH_AT91X40 | 732 | depends on ARM && ARCH_AT91 && !ARCH_AT91RM9200 && !ARCH_AT91X40 |
732 | select IDE_TIMINGS | 733 | select IDE_TIMINGS |
733 | 734 | ||
734 | config IDE_ARM | ||
735 | tristate "ARM IDE support" | ||
736 | depends on ARM && (ARCH_RPC || ARCH_SHARK) | ||
737 | default y | ||
738 | |||
739 | config BLK_DEV_IDE_ICSIDE | 735 | config BLK_DEV_IDE_ICSIDE |
740 | tristate "ICS IDE interface support" | 736 | tristate "ICS IDE interface support" |
741 | depends on ARM && ARCH_ACORN | 737 | depends on ARM && ARCH_ACORN |
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index 9b4bbe1cdc1a..81df925f0e8b 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile | |||
@@ -21,8 +21,6 @@ ide-core-$(CONFIG_IDE_LEGACY) += ide-legacy.o | |||
21 | 21 | ||
22 | obj-$(CONFIG_IDE) += ide-core.o | 22 | obj-$(CONFIG_IDE) += ide-core.o |
23 | 23 | ||
24 | obj-$(CONFIG_IDE_ARM) += ide_arm.o | ||
25 | |||
26 | obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o | 24 | obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o |
27 | obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o | 25 | obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o |
28 | obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o | 26 | obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o |
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 | ||
diff --git a/drivers/ide/ide_arm.c b/drivers/ide/ide_arm.c deleted file mode 100644 index cf6385446ece..000000000000 --- a/drivers/ide/ide_arm.c +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * ARM default IDE host driver | ||
3 | * | ||
4 | * Copyright (C) 2004 Bartlomiej Zolnierkiewicz | ||
5 | * Based on code by: Russell King, Ian Molton and Alexander Schulz. | ||
6 | * | ||
7 | * May be copied or modified under the terms of the GNU General Public License. | ||
8 | */ | ||
9 | |||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/ide.h> | ||
13 | |||
14 | #include <asm/irq.h> | ||
15 | |||
16 | #define DRV_NAME "ide_arm" | ||
17 | |||
18 | #define IDE_ARM_IO 0x1f0 | ||
19 | #define IDE_ARM_IRQ IRQ_HARDDISK | ||
20 | |||
21 | static const struct ide_port_info ide_arm_port_info = { | ||
22 | .host_flags = IDE_HFLAG_NO_DMA, | ||
23 | }; | ||
24 | |||
25 | static int __init ide_arm_init(void) | ||
26 | { | ||
27 | unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206; | ||
28 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | ||
29 | |||
30 | if (!request_region(base, 8, DRV_NAME)) { | ||
31 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", | ||
32 | DRV_NAME, base, base + 7); | ||
33 | return -EBUSY; | ||
34 | } | ||
35 | |||
36 | if (!request_region(ctl, 1, DRV_NAME)) { | ||
37 | printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n", | ||
38 | DRV_NAME, ctl); | ||
39 | release_region(base, 8); | ||
40 | return -EBUSY; | ||
41 | } | ||
42 | |||
43 | memset(&hw, 0, sizeof(hw)); | ||
44 | ide_std_init_ports(&hw, base, ctl); | ||
45 | hw.irq = IDE_ARM_IRQ; | ||
46 | hw.chipset = ide_generic; | ||
47 | |||
48 | return ide_host_add(&ide_arm_port_info, hws, NULL); | ||
49 | } | ||
50 | |||
51 | module_init(ide_arm_init); | ||
52 | |||
53 | MODULE_LICENSE("GPL"); | ||