[tulip] try again - patch for Intel AnyPoint (21145 HomePNA)

Brian Rogers w006552@airmail.net
Thu, 22 Feb 2001 01:40:49 -0600


This is a multi-part message in MIME format.
--------------060902030006010307040709
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Let me try that again:

Attached is a patch that allows the tulip driver to work with Intel AnyPoint
1Mbps HomePNA cards.  I suppose it should work with any Intel 21145 HomePNA
card, but I only have the one.  

It is not well integrated with the rest of the code but, since I don't really
understand the rest of the code very well, I figure it is probably safer like
it is.

In order to use it, specify "options=18" as a module parameter in the
/etc/conf.modules file or when using insmod.  I have the following two lines
in my /etc/conf.modules file:

        alias eth0 tulip
        options eth0 options=18

To write this patch, I used Intel's hardware reference for the 21145 chip,
available from http://www.intel.com/design/network/manuals/

-- 
/* Brian Rogers, professional geek, coffee achiever */

--------------060902030006010307040709
Content-Type: text/plain;
 name="tulip-anypoint.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="tulip-anypoint.diff"

--- tulip.c.old	Wed Feb 21 22:15:28 2001
+++ tulip.c	Thu Feb 22 00:20:21 2001
@@ -1640,6 +1640,36 @@
 	u32 new_csr6;
 	int i;
 
+	if (tp->chip_id == I21145 && tp->medialock && dev->if_port == 18) {
+		/* 	Intel 21145 HomePNA port selection
+
+			To use Intel AnyPoint HomePNA 1Mbps PCI card, load the tulip module
+			with the "options=18" parameter.
+			
+			FIXME: Integrate this into the rest of the code to eliminate the
+				   mandatory options=18.  
+			
+			The code below is based on information in Appendix C of Intel's
+			21145 hardware reference manual, available at
+			http://www.intel.com/design/network/manuals/
+		*/
+		if (tulip_debug)
+			printk(KERN_DEBUG "%s:  Intel 21145 HomePNA.\n",
+			       dev->name);
+		/* CSR6<18> = 0, CSR6<19> = 1
+		   CSR13<31:0> = 00000000H
+		   CSR14<31:0> = 00000505H 
+		   CSR15<4> = 1 
+		   CSR13<31:0> = 30480009H
+		*/
+		outl(((inl(ioaddr + CSR6) & (~(1 << 18))) | (1 << 19)), ioaddr + CSR6);
+		outl(0x00000000, ioaddr + CSR13);
+		outl(0x00000505, ioaddr + CSR14);
+		outl(inl(ioaddr + CSR15) | 0x10, ioaddr + CSR15);
+		outl(0x30480009, ioaddr + CSR13);
+		return;
+	}
+
 	if (mtable) {
 		struct medialeaf *mleaf = &mtable->mleaf[tp->cur_index];
 		unsigned char *p = mleaf->leafdata;

--------------060902030006010307040709--