From 6ca6901ca91deaa083cbc1d8d9dc7d679c88962c Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 7 Aug 2007 17:18:28 +0100 Subject: [PATCH] --- yaml --- r: 64495 b: refs/heads/master c: b5438582090406e2ccb4169d9b2df7c9939ae42b h: refs/heads/master i: 64493: 4572075c685149699b37a25fd223acbc96807c2e 64491: 8d2c1a1054bf4b24f72bc2c5a28a97de1af5c49c 64487: 74d9e2bdacc104b25dd3da62aad92ffe358ec550 64479: 299b725e762207fbf7e35f5ea80fff67a3e52230 v: v3 --- [refs] | 2 +- trunk/include/asm-mips/mach-generic/ide.h | 76 ++++++++--------------- 2 files changed, 26 insertions(+), 52 deletions(-) diff --git a/[refs] b/[refs] index e5148ef26fdb..de6549880bda 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: de4b21474053513d9ad41994c95dade3e6b3362f +refs/heads/master: b5438582090406e2ccb4169d9b2df7c9939ae42b diff --git a/trunk/include/asm-mips/mach-generic/ide.h b/trunk/include/asm-mips/mach-generic/ide.h index 6eba2e576aaa..2b928577be5d 100644 --- a/trunk/include/asm-mips/mach-generic/ide.h +++ b/trunk/include/asm-mips/mach-generic/ide.h @@ -29,68 +29,42 @@ #define IDE_ARCH_OBSOLETE_DEFAULTS -static __inline__ int ide_probe_legacy(void) -{ -#ifdef CONFIG_PCI - struct pci_dev *dev; - if ((dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL)) != NULL || - (dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL)) != NULL) { - pci_dev_put(dev); - - return 1; - } - return 0; -#elif defined(CONFIG_EISA) || defined(CONFIG_ISA) - return 1; -#else - return 0; -#endif -} - static __inline__ int ide_default_irq(unsigned long base) { - if (ide_probe_legacy()) - switch (base) { - case 0x1f0: - return 14; - case 0x170: - return 15; - case 0x1e8: - return 11; - case 0x168: - return 10; - case 0x1e0: - return 8; - case 0x160: - return 12; + switch (base) { + case 0x1f0: return 14; + case 0x170: return 15; + case 0x1e8: return 11; + case 0x168: return 10; + case 0x1e0: return 8; + case 0x160: return 12; default: return 0; - } - else - return 0; + } } static __inline__ unsigned long ide_default_io_base(int index) { - if (ide_probe_legacy()) + /* + * If PCI is present then it is not safe to poke around + * the other legacy IDE ports. Only 0x1f0 and 0x170 are + * defined compatibility mode ports for PCI. A user can + * override this using ide= but we must default safe. + */ + if (no_pci_devices()) { switch (index) { - case 0: - return 0x1f0; - case 1: - return 0x170; - case 2: - return 0x1e8; - case 3: - return 0x168; - case 4: - return 0x1e0; - case 5: - return 0x160; - default: - return 0; + case 2: return 0x1e8; + case 3: return 0x168; + case 4: return 0x1e0; + case 5: return 0x160; } - else + } + switch (index) { + case 0: return 0x1f0; + case 1: return 0x170; + default: return 0; + } } #define IDE_ARCH_OBSOLETE_INIT