Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch to ntulip.c





The following patch to ntulip.c from Etherboot-4.4.2 is the result of
several days pouring over DEC 21143 and SROM manuals and implements
the automatic selection of the MII interface on cards using the Intel/
DEC 21143 reference design, in particular, the TRENDnet TE100-PCIA NIC.

I can't see how the "standard" ntulip driver can support 100BaseTx
on any DEC tulip board - it seems to insist on using the internal
10BaseT-only interface. Can anyone confirm or deny this?

Can Marty and/or Ken include this patch into the next Etherboot release?

Thanks,

Bob Edwards


--- ntulip.old  Sat Feb  5 00:14:49 2000
+++ ntulip.c    Sat Feb  5 00:17:01 2000
@@ -77,6 +77,10 @@
   CSR12=0x60, CSR13=0x68, CSR14=0x70, CSR15=0x78, CSR16=0x80, CSR20=0xA0 
 };
 
+#define DEC_21142_CSR6_TTM     0x00400000      /* Transmit Threshold Mode */
+#define DEC_21142_CSR6_HBD     0x00080000      /* Heartbeat Disable */
+#define DEC_21142_CSR6_PS      0x00040000      /* Port Select */
+
 /* EEPROM Address width definitions */
 #define EEPROM_ADDRLEN 6
 #define EEPROM_SIZE    128              /* 2 << EEPROM_ADDRLEN */
@@ -423,6 +427,19 @@
     csr6 = 0x814C0000;
     outl(0x00000001, ioaddr + CSR15);
 
+  } else if (vendor == PCI_VENDOR_ID_DEC && dev_id ==
PCI_DEVICE_ID_DEC_21142) {
+       /* check SROM for evidence of an MII interface */
+       /* get Controller_0 Info Leaf Offset from SROM - assume already in
ee_data */
+       int offset = ee_data [27] + (ee_data [28] << 8);
+
+       /* check offset range and if we have an extended type 3 Info Block */
+       if ((offset >= 30) && (offset < 120) && (ee_data [offset + 3] > 128)
&&
+                                       (ee_data [offset + 4] == 3)) {
+
+               /* must have an MII interface - disable heartbeat, select port
etc. */
+               csr6 |= (DEC_21142_CSR6_HBD | DEC_21142_CSR6_PS);
+               csr6 &= ~(DEC_21142_CSR6_TTM);
+       }
   }
 
   /* Start the chip's Tx to process setup frame. */
@@ -558,10 +575,6 @@
       nic->node_addr[i*2]     = (u8)((value >> 8) & 0xff);
       nic->node_addr[i*2 + 1] = (u8)( value       & 0xff);
     }
-    printf("NTulip %b:%b:%b:%b:%b:%b at ioaddr 0x%x\n",
-          
nic->node_addr[0],nic->node_addr[1],nic->node_addr[2],nic->node_addr[3],
-           nic->node_addr[4],nic->node_addr[5],ioaddr);
-
   } else {
 
     /* read EEPROM data */
@@ -572,11 +585,11 @@
     /* extract MAC address from EEPROM buffer */
     for (i=0; i<6; i++)
       nic->node_addr[i] = ee_data[20+i];
+  }
 
     printf("NTulip %b:%b:%b:%b:%b:%b at ioaddr 0x%x\n",
           
nic->node_addr[0],nic->node_addr[1],nic->node_addr[2],nic->node_addr[3],
            nic->node_addr[4],nic->node_addr[5],ioaddr);
-  }
 
   /* initialize device */
   ntulip_reset(nic);
===========================================================================
This Mail was sent to netboot mailing list by:
Bob Edwards <Robert.Edwards@anu.edu.au>
To get help about this list, send a mail with 'help' as the only string in
it's body to majordomo@baghira.han.de. If you have problems with this list,
send a mail to netboot-owner@baghira.han.de.



For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.