Netboot Mailing List (by thread)

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

Macronix 98715 patches



I'd like to release 4.2.11 this weekend and include the MX98715 changes
contributed by Nick Lopez.  Could people interested in using the Macronix
98715 Tulip clone please test this set of patches so that there are no
major booboos? It's against 4.2.10.  mx98715.lzrom and mx98715.rom are
created by a make. It includes the main.c patch I posted yesterday, so
if you already applied that, patch may ask you if you want to reverse it,
to which you say no.

	Thanks, Ken

diff -ur ../../etherboot-4.2.10/src/3c90x.c ./3c90x.c
--- ../../etherboot-4.2.10/src/3c90x.c	Sat Oct  2 21:15:29 1999
+++ ./3c90x.c	Wed Nov 24 12:02:27 1999
@@ -36,7 +36,9 @@
 
 #include "etherboot.h"
 #include "nic.h"
+#ifndef __FreeBSD__
 #include <linux/pci.h>
+#endif
 
 #define	TIME_OUT	60000
 #define	XCVR_MAGIC	(0x5A00)
diff -ur ../../etherboot-4.2.10/src/Makefile ./Makefile
--- ../../etherboot-4.2.10/src/Makefile	Tue Nov 16 23:44:56 1999
+++ ./Makefile	Thu Nov 25 14:01:11 1999
@@ -149,7 +149,7 @@
 BINS+=  $(shell if [ -f epic100.c ] ; then echo epic100.lzrom epic100.rom ; fi)
 BINS+=  $(shell if [ -f rtl8139.c ] ; then echo rtl8139.lzrom rtl8139.rom smc1211.lzrom smc1211.rom ; fi)  
 BINS+=  $(shell if [ -f pci.c ] ; then echo nepci.lzrom nepci.rom lancepci.lzrom lancepci.rom; fi)
-BINS+=  $(shell if [ -f tulip.c ] ; then echo tulip.lzrom tulip.rom ; fi)  
+BINS+=  $(shell if [ -f tulip.c ] ; then echo tulip.lzrom tulip.rom mx98715.lzrom mx98715.rom ; fi)  
 CLEANFILES=	$(START) $(BOBJS) $(DOBJS) $(TOBJS)
 CLEANFILES+=	$(BLIB) $(DLIB) config-*.o $(UTILS)
 CLEANFILES+=	*.rom *.lzrom *.tmp *.tst *.bin *.huf
@@ -261,6 +261,13 @@
 # to also make a ROM for a Tulip clone with a different id pair, uncomment the
 # previous two lines and edit the vendor and device ids
 
+# special case because we need to set the VENDOR and DEVICE IDs
+mx98715.rom:	config-tulip.o $(PRLOADER) $(STDDEPS)
+	$(LD) $(LDFLAGS) -o $*.tmp $(START) config-tulip.o $(BLIB) $(DLIB) $(LIBS)
+	$(OBJCOPY) $*.tmp $*.bin
+	cat $(PRLOADER) $*.bin > $@ 
+	./makerom -p 0x10d9,0x0531 -i$(IDENT) $@
+
 cs89x0.rom:	config-cs89x0.o $(RLOADER) $(STDDEPS)
 
 ne2100.rom:	config-ne2100.o $(RLOADER) $(STDDEPS)
@@ -367,6 +374,14 @@
 # to also make a ROM for a Tulip clone with a different id pair, uncomment the
 # previous two lines and edit the vendor and device ids
 
+# special case because we need to set the VENDOR and DEVICE IDs
+mx98715.lzrom:	config-tulip.o $(PRZLOADER) $(STDDEPS)
+	$(LD) $(LDFLAGS) -o $*.tmp $(START) config-tulip.o $(BLIB) $(DLIB) $(LIBS)
+	$(OBJCOPY) $*.tmp $*.bin
+	./lzhuf e $*.bin $*.huf
+	cat $(PRZLOADER) $*.huf > $@
+	./makerom -p 0x10d9,0x0531 -i$(IDENT) $@
+
 cs89x0.lzrom:	config-cs89x0.o $(RZLOADER) $(STDDEPS)
 
 ne2100.lzrom:	config-ne2100.o $(RZLOADER) $(STDDEPS)
@@ -426,6 +441,8 @@
 smc1211.fd0:	smc1211.rom $(FLOPPYLOAD)
 
 tulip.fd0:	tulip.rom $(FLOPPYLOAD)
+
+mx98715.fd0:	mx98715.rom $(FLOPPYLOAD)
 
 tulipclone.fd0:	tulipclone.rom $(FLOPPYLOAD)
 
diff -ur ../../etherboot-4.2.10/src/config.c ./config.c
--- ../../etherboot-4.2.10/src/config.c	Thu Oct  7 21:10:31 1999
+++ ./config.c	Thu Nov 25 13:59:09 1999
@@ -79,6 +79,8 @@
 		"Digital Tulip+", 0, 0, 0},
 	{ PCI_VENDOR_ID_DEC,		PCI_DEVICE_ID_DEC_21142,
 		"Digital Tulip 21142", 0, 0, 0},
+	{ PCI_VENDOR_ID_MACRONIX,	PCI_DEVICE_ID_MX987x5,
+		"Macronix MX987x5", 0, 0, 0},
 #endif
 /* other PCI NICs go here */
 	{0,}
diff -ur ../../etherboot-4.2.10/src/main.c ./main.c
--- ../../etherboot-4.2.10/src/main.c	Mon Nov 15 23:16:48 1999
+++ ./main.c	Wed Nov 24 10:26:27 1999
@@ -850,7 +850,7 @@
 				return(0); /* no RFC 1533 header found */
 			p += 4;
 			len -= 4; }
-		if (extend + len <= ((unsigned char *)BOOTP_DATA_ADDR)+1) {
+		if (extend + len <= (unsigned char *)&(BOOTP_DATA_ADDR->bootp_extension[MAX_BOOTP_EXTLEN])) {
 			bcopy(p, extend, len);
 			extend += len;
 		} else {
diff -ur ../../etherboot-4.2.10/src/pci.h ./pci.h
--- ../../etherboot-4.2.10/src/pci.h	Sat Oct  2 21:14:55 1999
+++ ./pci.h	Wed Nov 24 12:03:27 1999
@@ -114,6 +114,8 @@
 #ifndef PCI_DEVICE_ID_SMC_EPIC100
 # define PCI_DEVICE_ID_SMC_EPIC100	0x0005
 #endif
+#define PCI_VENDOR_ID_MACRONIX		0x10d9
+#define PCI_DEVICE_ID_MX987x5		0x0531
 
 struct pci_device {
 	unsigned short	vendor, dev_id;
diff -ur ../../etherboot-4.2.10/src/tulip.c ./tulip.c
--- ../../etherboot-4.2.10/src/tulip.c	Mon Jan 18 19:58:32 1999
+++ ./tulip.c	Thu Nov 25 13:57:06 1999
@@ -27,6 +27,7 @@
 #include "pci.h"
 #include "tulip.h"
 
+static unsigned short vendor, dev_id;
 static unsigned short ioaddr;
 static unsigned int *membase;
 static unsigned long devfn;    
@@ -71,7 +72,7 @@
 /* with minor alterations to make it work here.  the Linux code is */
 /* better but this was easier to use */
 
-void delay_300ns()
+static void delay_300ns()
 {
     int idx;
     for (idx = (300 / 33) + 1; idx > 0; idx--)
@@ -162,12 +163,12 @@
 	/* for some reason the media selection does not take
            the first time se it is repeated.  */
 
-        while(cnt--) {  
+        while(cnt--) {
         /* stop TX,RX processes */
         if (cnt == 1)
-        outl(0x32404000, ioaddr + CSR6);
+		outl(0x32404000, ioaddr + CSR6);
         else
-        outl(0x32000040, ioaddr + CSR6);
+		outl(0x32000040, ioaddr + CSR6);
 
         /* XXX - media selection is vendor specific and hard coded right
            here.  This should be fixed to use the hints in the SROM and
@@ -191,6 +192,13 @@
 
         /* end  set to 10Mbps half-duplex */
 
+	if (vendor == PCI_VENDOR_ID_MACRONIX && dev_id == PCI_DEVICE_ID_MX987x5) {
+		/* do stuff for MX98715 */
+		outl(0x01a80000, ioaddr + CSR6);
+		outl(0xFFFFFFFF, ioaddr + CSR14);
+		outl(0x00001000, ioaddr + CSR12);
+	}
+							
         outl(0x0, ioaddr + CSR7);       /* disable interrupts */
 
         /* construct setup packet which is used by the 21143 to
@@ -340,6 +348,8 @@
 
 	if (io_addrs == 0 || *io_addrs == 0)
 		return (0);
+	vendor = pci->vendor;
+	dev_id = pci->dev_id;
 	ioaddr = *io_addrs;
 	membase = (unsigned int *)pci->membase;
 


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