Skip to content

Commit

Permalink
ide: merge ide_arm and ide_generic host drivers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Mar 31, 2009
1 parent 52913ab commit 4465461
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 66 deletions.
8 changes: 2 additions & 6 deletions drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ comment "IDE chipset support/bugfixes"

config IDE_GENERIC
tristate "generic/default IDE chipset support"
depends on ALPHA || X86 || IA64 || M32R || MIPS
depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC || ARCH_SHARK
default ARM && (ARCH_RPC || ARCH_SHARK)
help
This is the generic IDE driver. This driver attaches to the
fixed legacy ports (e.g. on PCs 0x1f0/0x170, 0x1e8/0x168 and
Expand Down Expand Up @@ -731,11 +732,6 @@ config BLK_DEV_IDE_AT91
depends on ARM && ARCH_AT91 && !ARCH_AT91RM9200 && !ARCH_AT91X40
select IDE_TIMINGS

config IDE_ARM
tristate "ARM IDE support"
depends on ARM && (ARCH_RPC || ARCH_SHARK)
default y

config BLK_DEV_IDE_ICSIDE
tristate "ICS IDE interface support"
depends on ARM && ARCH_ACORN
Expand Down
2 changes: 0 additions & 2 deletions drivers/ide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ ide-core-$(CONFIG_IDE_LEGACY) += ide-legacy.o

obj-$(CONFIG_IDE) += ide-core.o

obj-$(CONFIG_IDE_ARM) += ide_arm.o

obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o
obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o
obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o
Expand Down
18 changes: 13 additions & 5 deletions drivers/ide/ide-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#include <linux/ide.h>
#include <linux/pci_ids.h>

/* FIXME: convert m32r to use ide_platform host driver */
/* FIXME: convert arm and m32r to use ide_platform host driver */
#ifdef CONFIG_ARM
#include <asm/irq.h>
#endif
#ifdef CONFIG_M32R
#include <asm/m32r.h>
#endif
Expand All @@ -28,8 +31,11 @@ static const struct ide_port_info ide_generic_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
};

#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
|| defined(CONFIG_PLAT_OPSPUT)
#ifdef CONFIG_ARM
static const u16 legacy_bases[] = { 0x1f0 };
static const int legacy_irqs[] = { IRQ_HARDDISK };
#elif 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)
Expand All @@ -45,11 +51,11 @@ static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 };

static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary)
{
#ifdef CONFIG_PCI
struct pci_dev *p = NULL;
u16 val;

for_each_pci_dev(p) {

if (pci_resource_start(p, 0) == 0x1f0)
*primary = 1;
if (pci_resource_start(p, 2) == 0x170)
Expand All @@ -64,7 +70,6 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary)
/* Intel MPIIX - PIO ATA on non PCI side of bridge */
if (p->vendor == PCI_VENDOR_ID_INTEL &&
p->device == PCI_DEVICE_ID_INTEL_82371MX) {

pci_read_config_word(p, 0x6C, &val);
if (val & 0x8000) {
/* ATA port enabled */
Expand All @@ -75,6 +80,7 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary)
}
}
}
#endif
}

static int __init ide_generic_init(void)
Expand Down Expand Up @@ -106,6 +112,7 @@ static int __init ide_generic_init(void)
printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX "
"not free.\n",
DRV_NAME, io_addr, io_addr + 7);
rc = -EBUSY;
continue;
}

Expand All @@ -114,6 +121,7 @@ static int __init ide_generic_init(void)
"not free.\n",
DRV_NAME, io_addr + 0x206);
release_region(io_addr, 8);
rc = -EBUSY;
continue;
}

Expand Down
53 changes: 0 additions & 53 deletions drivers/ide/ide_arm.c

This file was deleted.

0 comments on commit 4465461

Please sign in to comment.