[parisc-linux-cvs] HSC PCI tulip updates.

Ryan Bradetich rbradetich@uswest.net
29 Aug 2002 15:02:24 -0600


This patch fixes some of the quirks in the HSC-PCI tulip
cards.

Grant and I are working with Jeff Garzik to get the parisc 
specific changes merged into the official tulip driver.

This change + a ccio resource patch that I have sitting in
my local tree allows the dual HSC tulip cards to be used
in my K-460.   I am not going to commit the ccio resource   
patch yet because this patch exposes an additional problem
that willy is pondering on how to solve.  If anyone wants
the ccio resource patch I have, email me and I'll give you
a copy of the patch.

Thanks,

- Ryan

Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.341
diff -u -p -r1.341 Makefile
--- Makefile	26 Aug 2002 03:27:10 -0000	1.341
+++ Makefile	29 Aug 2002 20:50:53 -0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 19
-EXTRAVERSION = -pa6
+EXTRAVERSION = -pa7
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: drivers/net/tulip/eeprom.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/eeprom.c,v
retrieving revision 1.13
diff -u -p -r1.13 eeprom.c
--- drivers/net/tulip/eeprom.c	13 Dec 2001 22:37:14 -0000	1.13
+++ drivers/net/tulip/eeprom.c	29 Aug 2002 20:50:53 -0000
@@ -142,8 +142,10 @@ subsequent_board:
 		 * but we need to setup a fake mediatable
 		 * for a correct csr12 setup and mii handling
 		 */
-		if (ee_data[0] == 0x3c && ee_data[1] == 0x10 &&  /* sub vendor id */
-		    ee_data[2] == 0x63 && ee_data[3] == 0x10) {  /* sub device id */
+		if (ee_data[0] == 0x3c && ee_data[1] == 0x10   && /* sub vendor id */
+		    (ee_data[2] == 0x63 || ee_data[2] == 0x61) && /* sub device id */
+		     ee_data[3] == 0x10) { 
+
 			static unsigned char leafdata[] =
 			        { 0x01,       /* phy number */
 				  0x02,       /* gpr setup sequence length */
Index: drivers/net/tulip/tulip_core.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/tulip_core.c,v
retrieving revision 1.23
diff -u -p -r1.23 tulip_core.c
--- drivers/net/tulip/tulip_core.c	4 Aug 2002 22:58:40 -0000	1.23
+++ drivers/net/tulip/tulip_core.c	29 Aug 2002 20:50:54 -0000
@@ -1578,6 +1578,24 @@ static int __devinit tulip_init_one (str
                        tp->flags &= ~HAS_MEDIA_TABLE;
                }
 #endif
+#ifdef __hppa__
+		/* Check to see if we have a broken srom */
+		if(ee_data[0] == 0x61 && ee_data[1] == 0x10) {
+			/* subsys_vendor and subsys_id are swapped */
+			ee_data[0] = ee_data[2];
+			ee_data[1] = ee_data[3];
+			ee_data[2] = 0x61;
+			ee_data[3] = 0x10;
+
+			/* HSC-PCI boards need to be byte-swaped and shifted
+			**   up 1 word. 
+			*/
+			for(i = 4; i >= 0; i -= 2) {
+				ee_data[17 + i + 3] = ee_data[17 + i];
+				ee_data[16 + i + 5] = ee_data[16 + i];
+			}
+		}
+#endif
 		for (i = 0; i < 6; i ++) {
 			dev->dev_addr[i] = ee_data[i + sa_offset];
 			sum += ee_data[i + sa_offset];