diff -Naurp linux-2.6.16-rc4.orig/arch/mips/configs/cobalt_defconfig linux-2.6.16-rc4/arch/mips/configs/cobalt_defconfig --- linux-2.6.16-rc4.orig/arch/mips/configs/cobalt_defconfig 2006-02-25 14:42:44.000000000 -0500 +++ linux-2.6.16-rc4/arch/mips/configs/cobalt_defconfig 2006-02-25 15:30:18.000000000 -0500 @@ -156,7 +156,8 @@ CONFIG_INITRAMFS_SOURCE="" CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_HOTPLUG=y +# CONFIG_HOTPLUG is not set +# CONFIG_KOBJECT_UEVENT is not set CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y @@ -176,7 +177,13 @@ CONFIG_BASE_SMALL=0 # # Loadable module support # -# CONFIG_MODULES is not set +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y # # Block layer @@ -188,8 +195,8 @@ CONFIG_BASE_SMALL=0 # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set CONFIG_DEFAULT_AS=y # CONFIG_DEFAULT_DEADLINE is not set # CONFIG_DEFAULT_CFQ is not set @@ -230,24 +237,23 @@ CONFIG_NET=y # Networking options # CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set +CONFIG_PACKET_MMAP=y CONFIG_UNIX=y -CONFIG_XFRM=y -CONFIG_XFRM_USER=y -CONFIG_NET_KEY=y +# CONFIG_NET_KEY is not set CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set +CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_FIB_HASH=y # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set -CONFIG_INET_TUNNEL=y +# CONFIG_INET_TUNNEL is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set @@ -294,10 +300,7 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -CONFIG_IEEE80211=y -# CONFIG_IEEE80211_DEBUG is not set -CONFIG_IEEE80211_CRYPT_WEP=y -CONFIG_IEEE80211_CRYPT_CCMP=y +# CONFIG_IEEE80211 is not set # # Device Drivers @@ -308,13 +311,12 @@ CONFIG_IEEE80211_CRYPT_CCMP=y # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=y +# CONFIG_FW_LOADER is not set # # Connector - unified userspace <-> kernelspace linker # -CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y +# CONFIG_CONNECTOR is not set # # Memory Technology Devices (MTD) @@ -338,16 +340,13 @@ CONFIG_PROC_EVENTS=y # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_CDROM_PKTCDVD=y -CONFIG_CDROM_PKTCDVD_BUFFERS=8 -# CONFIG_CDROM_PKTCDVD_WCACHE is not set -CONFIG_ATA_OVER_ETH=y +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -360,7 +359,7 @@ CONFIG_BLK_DEV_IDE=y # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y -# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set @@ -448,16 +447,7 @@ CONFIG_NETDEVICES=y # # PHY device support # -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -CONFIG_MARVELL_PHY=y -CONFIG_DAVICOM_PHY=y -CONFIG_QSEMI_PHY=y -CONFIG_LXT_PHY=y -CONFIG_CICADA_PHY=y +# CONFIG_PHYLIB is not set # # Ethernet (10 or 100Mbit) @@ -546,46 +536,18 @@ CONFIG_TULIP=y # # Input device support # -CONFIG_INPUT=y - -# -# Userland interfaces -# -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -# CONFIG_INPUT_EVDEV is not set -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set +# CONFIG_INPUT is not set # # Hardware I/O ports # -CONFIG_SERIO=y -# CONFIG_SERIO_I8042 is not set -CONFIG_SERIO_SERPORT=y -# CONFIG_SERIO_PCIPS2 is not set -# CONFIG_SERIO_LIBPS2 is not set -CONFIG_SERIO_RAW=y +# CONFIG_SERIO is not set # CONFIG_GAMEPORT is not set # # Character devices # -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y +# CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set # @@ -679,12 +641,6 @@ CONFIG_COBALT_LCD=y # CONFIG_FB is not set # -# Console display driver support -# -# CONFIG_VGA_CONSOLE is not set -CONFIG_DUMMY_CONSOLE=y - -# # Sound # # CONFIG_SOUND is not set @@ -788,16 +744,8 @@ CONFIG_RELAYFS_FS=y # # Network File Systems # -CONFIG_NFS_FS=y -# CONFIG_NFS_V3 is not set -# CONFIG_NFS_V4 is not set -# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFS_FS is not set # CONFIG_NFSD is not set -CONFIG_LOCKD=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -# CONFIG_RPCSEC_GSS_KRB5 is not set -# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -814,7 +762,46 @@ CONFIG_MSDOS_PARTITION=y # # Native Language Support # -# CONFIG_NLS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set # # Profiling support @@ -828,44 +815,19 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 -CONFIG_CROSSCOMPILE=y +# CONFIG_CROSSCOMPILE is not set CONFIG_CMDLINE="" # # Security options # -CONFIG_KEYS=y -CONFIG_KEYS_DEBUG_PROC_KEYS=y +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # -CONFIG_CRYPTO=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_WP512=y -CONFIG_CRYPTO_TGR192=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_BLOWFISH=y -CONFIG_CRYPTO_TWOFISH=y -CONFIG_CRYPTO_SERPENT=y -CONFIG_CRYPTO_AES=y -CONFIG_CRYPTO_CAST5=y -CONFIG_CRYPTO_CAST6=y -CONFIG_CRYPTO_TEA=y -CONFIG_CRYPTO_ARC4=y -CONFIG_CRYPTO_KHAZAD=y -CONFIG_CRYPTO_ANUBIS=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_MICHAEL_MIC=y -CONFIG_CRYPTO_CRC32C=y -# CONFIG_CRYPTO_TEST is not set +# CONFIG_CRYPTO is not set # # Hardware crypto devices @@ -875,8 +837,6 @@ CONFIG_CRYPTO_CRC32C=y # Library routines # # CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y +# CONFIG_CRC16 is not set CONFIG_CRC32=y -CONFIG_LIBCRC32C=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y +# CONFIG_LIBCRC32C is not set diff -Naurp linux-2.6.16-rc4.orig/drivers/net/tulip/21142.c linux-2.6.16-rc4/drivers/net/tulip/21142.c --- linux-2.6.16-rc4.orig/drivers/net/tulip/21142.c 2006-01-02 22:21:10.000000000 -0500 +++ linux-2.6.16-rc4/drivers/net/tulip/21142.c 2006-02-25 15:27:54.000000000 -0500 @@ -172,7 +172,7 @@ void t21142_lnk_change(struct net_device int i; for (i = 0; i < tp->mtable->leafcount; i++) if (tp->mtable->mleaf[i].media == dev->if_port) { - int startup = ! ((tp->chip_id == DC21143 && (tp->revision == 48 || tp->revision == 65))); + int startup = ! ((tp->chip_id == DC21143 && tp->revision == 65)); tp->cur_index = i; tulip_select_media(dev, startup); setup_done = 1; diff -Naurp linux-2.6.16-rc4.orig/drivers/net/tulip/Kconfig linux-2.6.16-rc4/drivers/net/tulip/Kconfig --- linux-2.6.16-rc4.orig/drivers/net/tulip/Kconfig 2006-01-02 22:21:10.000000000 -0500 +++ linux-2.6.16-rc4/drivers/net/tulip/Kconfig 2006-02-25 15:27:54.000000000 -0500 @@ -57,6 +57,16 @@ config TULIP_MWI If unsure, say N. +config TULIP_MWI_DC21143 + bool "Enable MWI workaround on dc21143 controllers" + depends on TULIP_MWI + help + This enables a workaround for MWI ("New bus configuration") on DC21143 + controllers. Normally MWI is disabled on these chips because of + hardware errata. + + If unsure, say N. + config TULIP_MMIO bool "Use PCI shared mem for NIC registers" depends on TULIP diff -Naurp linux-2.6.16-rc4.orig/drivers/net/tulip/media.c linux-2.6.16-rc4/drivers/net/tulip/media.c --- linux-2.6.16-rc4.orig/drivers/net/tulip/media.c 2006-01-02 22:21:10.000000000 -0500 +++ linux-2.6.16-rc4/drivers/net/tulip/media.c 2006-02-25 15:27:54.000000000 -0500 @@ -44,8 +44,10 @@ static const unsigned char comet_miireg2 /* MII transceiver control section. Read and write the MII registers using software-generated serial - MDIO protocol. See the MII specifications or DP83840A data sheet - for details. */ + MDIO protocol. + See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions") + or DP83840A data sheet for more details. + */ int tulip_mdio_read(struct net_device *dev, int phy_id, int location) { @@ -261,24 +263,56 @@ void tulip_select_media(struct net_devic u16 *reset_sequence = &((u16*)(p+3))[init_length]; int reset_length = p[2 + init_length*2]; misc_info = reset_sequence + reset_length; - if (startup) + if (startup) { + int timeout = 10; /* max 1 ms */ for (i = 0; i < reset_length; i++) iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15); + + /* flush posted writes */ + ioread32(ioaddr + CSR15); + + /* Sect 3.10.3 in DP83840A.pdf (p39) */ + udelay(500); + + /* Section 4.2 in DP83840A.pdf (p43) */ + /* and IEEE 802.3 "22.2.4.1.1 Reset" */ + while (timeout-- && + (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET)) + udelay(100); + } for (i = 0; i < init_length; i++) iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15); + + ioread32(ioaddr + CSR15); /* flush posted writes */ } else { u8 *init_sequence = p + 2; u8 *reset_sequence = p + 3 + init_length; int reset_length = p[2 + init_length]; misc_info = (u16*)(reset_sequence + reset_length); if (startup) { + int timeout = 10; /* max 1 ms */ iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); for (i = 0; i < reset_length; i++) iowrite32(reset_sequence[i], ioaddr + CSR12); + + /* flush posted writes */ + ioread32(ioaddr + CSR12); + + /* Sect 3.10.3 in DP83840A.pdf (p39) */ + udelay(500); + + /* Section 4.2 in DP83840A.pdf (p43) */ + /* and IEEE 802.3 "22.2.4.1.1 Reset" */ + while (timeout-- && + (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET)) + udelay(100); } for (i = 0; i < init_length; i++) iowrite32(init_sequence[i], ioaddr + CSR12); + + ioread32(ioaddr + CSR12); /* flush posted writes */ } + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -Naurp linux-2.6.16-rc4.orig/drivers/net/tulip/tulip.h linux-2.6.16-rc4/drivers/net/tulip/tulip.h --- linux-2.6.16-rc4.orig/drivers/net/tulip/tulip.h 2006-01-02 22:21:10.000000000 -0500 +++ linux-2.6.16-rc4/drivers/net/tulip/tulip.h 2006-02-25 15:27:54.000000000 -0500 @@ -262,7 +262,15 @@ enum t21143_csr6_bits { #define RX_RING_SIZE 128 #define MEDIA_MASK 31 -#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ +/* MWI can fail on 21143 rev 65 if the receive buffer ends + on a cache line boundary. Ensure it doesn't ... +*/ + +#ifdef CONFIG_TULIP_MWI_DC21143 +#define PKT_BUF_SZ (1536 + 4) /* Size of each temporary Rx buffer. */ +#else +#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ +#endif #define TULIP_MIN_CACHE_LINE 8 /* in units of 32-bit words */ @@ -474,8 +482,11 @@ static inline void tulip_stop_rxtx(struc udelay(10); if (!i) - printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n", - pci_name(tp->pdev)); + printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed" + " (CSR5 0x%x CSR6 0x%x)\n", + pci_name(tp->pdev), + ioread32(ioaddr + CSR5), + ioread32(ioaddr + CSR6)); } } diff -Naurp linux-2.6.16-rc4.orig/drivers/net/tulip/tulip_core.c linux-2.6.16-rc4/drivers/net/tulip/tulip_core.c --- linux-2.6.16-rc4.orig/drivers/net/tulip/tulip_core.c 2006-02-25 14:42:44.000000000 -0500 +++ linux-2.6.16-rc4/drivers/net/tulip/tulip_core.c 2006-02-25 15:27:54.000000000 -0500 @@ -22,7 +22,7 @@ #else #define DRV_VERSION "1.1.13" #endif -#define DRV_RELDATE "May 11, 2002" +#define DRV_RELDATE "December 15, 2004" #include @@ -148,7 +148,7 @@ struct tulip_chip_table tulip_tbl[] = { HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI, tulip_timer }, /* DC21142, DC21143 */ - { "Digital DS21143 Tulip", 128, 0x0801fbff, + { "Digital DS21142/DS21143 Tulip", 128, 0x0801fbff, HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY | HAS_INTR_MITIGATION | HAS_PCI_MWI, t21142_timer }, @@ -294,6 +294,8 @@ static void tulip_up(struct net_device * if (tp->mii_cnt || (tp->mtable && tp->mtable->has_mii)) iowrite32(0x00040000, ioaddr + CSR6); + printk(KERN_DEBUG "%s: CSR0 %08x\n", dev->name, tp->csr0); + /* Reset the chip, holding bit 0 set at least 50 PCI cycles. */ iowrite32(0x00000001, ioaddr + CSR0); udelay(100); @@ -1155,8 +1157,10 @@ static void __devinit tulip_mwi_config ( /* if we have any cache line size at all, we can do MRM */ csr0 |= MRM; +#ifndef CONFIG_TULIP_MWI_DC21143 /* ...and barring hardware bugs, MWI */ if (!(tp->chip_id == DC21143 && tp->revision == 65)) +#endif csr0 |= MWI; /* set or disable MWI in the standard PCI command bit. @@ -1182,7 +1186,7 @@ static void __devinit tulip_mwi_config ( */ switch (cache) { case 8: - csr0 |= MRL | (1 << CALShift) | (16 << BurstLenShift); + csr0 |= MRL | (1 << CALShift) | (8 << BurstLenShift); break; case 16: csr0 |= MRL | (2 << CALShift) | (16 << BurstLenShift); diff -Naurp linux-2.6.16-rc4.orig/include/asm-mips/cobalt/cpu-feature-overrides.h linux-2.6.16-rc4/include/asm-mips/cobalt/cpu-feature-overrides.h --- linux-2.6.16-rc4.orig/include/asm-mips/cobalt/cpu-feature-overrides.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.6.16-rc4/include/asm-mips/cobalt/cpu-feature-overrides.h 2006-02-25 15:27:54.000000000 -0500 @@ -0,0 +1,47 @@ +#ifndef __ASM_MACH_COBALT_CPU_FEATURE_OVERRIDES_H +#define __ASM_MACH_COBALT_CPU_FEATURE_OVERRIDES_H + +/* + * R5000 has an interesting "restriction": ll(d)/sc(d) + * instructions to XKPHYS region simply do uncached bus + * requests. This breaks all the atomic bitops functions. + * so, for 64bit kernel we just don't use ll/sc. + * This does not affect luserland. + */ +#if defined(CONFIG_CPU_NEVADA) && defined(CONFIG_64BIT) +#define cpu_has_llsc 0 +#else +#define cpu_has_llsc 1 +#endif + +#define cpu_has_watch 1 +#define cpu_has_mips16 0 +#define cpu_has_divec 1 +#define cpu_has_vce 0 +#define cpu_has_cache_cdex_p 0 +#define cpu_has_cache_cdex_s 0 +#define cpu_has_prefetch 1 +#define cpu_has_mcheck 0 +#define cpu_has_ejtag 0 + +#define cpu_has_vtag_icache 0 +#define cpu_has_dc_aliases 1 +#define cpu_has_ic_fills_f_dc 0 + +#define cpu_has_nofpuex 0 +#define cpu_has_64bits 1 + +#define cpu_has_4kex 1 +#define cpu_has_4k_cache 1 + +#define cpu_has_subset_pcaches 0 + +#define cpu_dcache_line_size() 32 +#define cpu_icache_line_size() 64 +#define cpu_scache_line_size() 0 + +#define cpu_icache_snoops_remote_store 1 + +#endif + + diff -Naurp linux-2.6.16-rc4.orig/include/asm-mips/mach-generic/ide.h linux-2.6.16-rc4/include/asm-mips/mach-generic/ide.h --- linux-2.6.16-rc4.orig/include/asm-mips/mach-generic/ide.h 2006-01-02 22:21:10.000000000 -0500 +++ linux-2.6.16-rc4/include/asm-mips/mach-generic/ide.h 2006-02-25 15:27:54.000000000 -0500 @@ -30,7 +30,7 @@ #define IDE_ARCH_OBSOLETE_DEFAULTS -static __inline__ int ide_probe_legacy(void) +static __inline__ int ide_legacy_ports(void) { #ifdef CONFIG_PCI struct pci_dev *dev; @@ -38,11 +38,11 @@ static __inline__ int ide_probe_legacy(v (dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL)) != NULL) { pci_dev_put(dev); - return 1; + return 2; } return 0; #elif defined(CONFIG_EISA) || defined(CONFIG_ISA) - return 1; + return 6; #else return 0; #endif @@ -50,30 +50,26 @@ static __inline__ int ide_probe_legacy(v 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; - default: - return 0; - } - else - return 0; + 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; + } + return 0; } static __inline__ unsigned long ide_default_io_base(int index) { - if (ide_probe_legacy()) + if (index < ide_legacy_ports()) switch (index) { case 0: return 0x1f0; @@ -87,11 +83,8 @@ static __inline__ unsigned long ide_defa return 0x1e0; case 5: return 0x160; - default: - return 0; - } - else - return 0; + } + return 0; } #define IDE_ARCH_OBSOLETE_INIT