From 70f1f1d97154c262da1ae8ee877b280f362704a0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 24 May 2000 15:55:00 +0000 Subject: [PATCH] Initial DEC 21143 support from Stephan Wilms . Comments follow: This support is (for now) only available for the __i386 target, because that's the only testing platform I have. It should to my best knowledge work in the same way for the "__PPC" target, but someone should test this first before it's put into the code. Thanks go to Andrew Klossner who provided the vital information about the Intel 21143 chip. (FWIW: my network card is a Kingston KNE100TX with 21143PD chip) --- c/src/libchip/network/dec21140.c | 34 +++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/c/src/libchip/network/dec21140.c b/c/src/libchip/network/dec21140.c index 1799c1dec1..f6d6b0c996 100644 --- a/c/src/libchip/network/dec21140.c +++ b/c/src/libchip/network/dec21140.c @@ -8,6 +8,22 @@ * http://www.OARcorp.com/rtems/license.html. * * $Id$ + * + * ------------------------------------------------------------------------ + * [22.05.2000,StWi/CWA] added support for the DEC/Intel 21143 chip + * + * This support is (for now) only available for the __i386 target, because + * that's the only testing platform I have. It should to my best knowledge + * work in the same way for the "__PPC" target, but someone should test + * this first before it's put into the code. Thanks go to Andrew Klossner + * who provided the vital information about the Intel 21143 chip. + * + * (FWIW: my network card is a Kingston KNE100TX with 21143PD chip) + * + * The 21143 support is enabled by defining the macro + * "ENABLE_21143_VARIANT" (see the "#if defined(__i386)" section right + * below, just add or remove comments as needed) + * ------------------------------------------------------------------------ */ #include @@ -19,11 +35,12 @@ */ #if defined(__i386) -#define DEC21140_SUPPORTED + #define DEC21140_SUPPORTED + #define ENABLE_21143_VARIANT #endif #if defined(__PPC) && (defined(mpc604) || defined(mpc750)) -#define DEC21140_SUPPORTED + #define DEC21140_SUPPORTED #endif #if defined(DEC21140_SUPPORTED) @@ -72,7 +89,11 @@ #define PCI_INVALID_VENDORDEVICEID 0xffffffff #define PCI_VENDOR_ID_DEC 0x1011 -#define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0009 +#if defined(ENABLE_21143_VARIANT) + #define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0019 +#else + #define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0009 +#endif #define IO_MASK 0x3 #define MEM_MASK 0xF @@ -830,6 +851,12 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config) * Process options */ #if defined(__i386) + +#if defined(ENABLE_21143_VARIANT) + /* the 21143 chip must be enabled before it can be accessed */ + pcib_conf_write32( signature, 0x40, 0 ); +#endif + pcib_conf_read32(signature, 16, &value); sc->port = value & ~IO_MASK; @@ -922,6 +949,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config) if_attach (ifp); ether_ifattach (ifp); + printk( "DEC21140 : driver has been attached\n" ); return 1; }; #endif /* DEC21140_SUPPORTED */