I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods
Amazon Honor System Click Here to Pay Learn More
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / Other I-Appliances / WebPal
linux: Cirrus CS8900 NIC working
patchfile(s) to get CS8900 NICs working under linux

New Messagelinux: Cirrus CS8900 NIC working (modified 0 times) TomW0001
Profile | Email
I have gotten the cs8900 ethernet chip working under linux for an ISA board I designed for the WebPal. The board has: 2.5" IDE, Compact Flash, Quad serial port (two RS232 + two RS485) and a Cirrus CS8900A ethernet chip. The ethernet doesn't use a EEPROM, but the patch shouldn't affect the use of commercially available NICs (just comment out "#define NO_EEPROM"). I am not sure how usefull this may be to others as I really don't know if the CS8900 was used on anything but embedded systems...

Essentially, there was no definition in the cs89x0.c file for a CONFIG_ARCH_WEBPAL and only standard PC i/o addresses & interrupts would have been scanned. Also, the cs89x0.h file did not allow the use of INT_ISA (INT_9). Here are the patches:

--- linux.orig/drivers/net/cs89x0.c 2003-08-29 09:20:36.000000000 -0400
+++ linux/drivers/net/cs89x0.c 2003-08-29 09:39:49.000000000 -0400
@@ -153,14 +153,21 @@
/* The cs8900 has 4 IRQ pins, software selectable. cs8900_irq_map maps
them to system IRQ numbers. This mapping is card specific and is set to
the configuration of the Cirrus Eval board for this chip. */
+
#ifdef CONFIG_ARCH_CLPS7500
-static unsigned int netcard_portlist[] __initdata =
- { 0x80090303, 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
-static unsigned int cs8900_irq_map[] = {12,0,0,0};
+ static unsigned int netcard_portlist[] __initdata = { 0x80090303, 0};
+ static unsigned int cs8900_irq_map[] = {12,0,0,0};
#else
-static unsigned int netcard_portlist[] __initdata =
- { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
-static unsigned int cs8900_irq_map[] = {10,11,12,5};
+ #ifdef CONFIG_ARCH_WEBPAL
+ #define NO_EEPROM
+ static unsigned int netcard_portlist[] __initdata = { 0x80400300, 0 };
+ static unsigned int cs8900_irq_map[] = {9,0,0,0};
+ static unsigned char WebPalMAC [6] = { 0x00, 0x10, 0x8b, 0xf1, 0xda, 0x01 };
+ #else
+ static unsigned int netcard_portlist[] __initdata =
+ { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
+ static unsigned int cs8900_irq_map[] = {10,11,12,5};
+ #endif
#endif

#if DEBUGGING
@@ -221,8 +228,10 @@
static int net_close(struct net_device *dev);
static struct net_device_stats *net_get_stats(struct net_device *dev);
static void reset_chip(struct net_device *dev);
+#ifndef NO_EEPROM
static int get_eeprom_data(struct net_device *dev, int off, int len, int *buffer);
static int get_eeprom_cksum(int off, int len, int *buffer);
+#endif
static int set_mac_address(struct net_device *dev, void *addr);
static void count_rx_errors(int status, struct net_local *lp);
#if ALLOW_DMA
@@ -267,10 +276,13 @@
if (net_debug)
printk("cs89x0:cs89x0_probe(0x%x)
", base_addr);

- if (base_addr > 0x1ff) /* Check a single specified location. */
+ /* Check a single specified location. */
+ if (base_addr > 0x1ff || (base_addr & 0xff000000) == 0x80000000)
return cs89x0_probe1(dev, base_addr);
- else if (base_addr != 0) /* Don't probe at all. */
+ else if (base_addr != 0) { /* Don't probe at all. */
+ printk("cs89x0:cs89x0_probe Bad I/O address
");
return -ENXIO;
+ }

for (i = 0; netcard_portlist; i++) {
if (cs89x0_probe1(dev, netcard_portlist) == 0)
@@ -306,6 +318,7 @@
outw(value, dev->base_addr + portno);
}

+#ifndef NO_EEPROM
static int __init
wait_eeprom_ready(struct net_device *dev)
{
@@ -350,6 +363,7 @@
return 0;
return -1;
}
+#endif /* NO_EEPROM */

/* This is the real probe routine. Linux has a history of friendly device
probes on the ISA bus. A good device probes avoids doing writes, and
@@ -449,6 +463,7 @@

reset_chip(dev);

+#ifndef NO_EEPROM
/* Here we read the current configuration of the chip. If there
is no Extended EEPROM then the idea is to not disturb the chip
configuration, it should have been correctly setup by automatic
@@ -542,6 +557,18 @@
dev->name, lp->adapter_cnf);
}

+#else
+ #ifdef CONFIG_ARCH_WEBPAL
+ /* fill WebPalMAC in with your own MAC Address. */
+ for (i=0; i<6; i++) dev->dev_addr = WebPalMAC ;
+ set_mac_address (dev, dev->dev_addr);
+ #endif
+ printk("
");
+ /* Fill this in, we don't have an EEPROM */
+ lp->adapter_cnf = A_CNF_10B_T | A_CNF_MEDIA_10B_T;
+ lp->auto_neg_cnf = EE_AUTO_NEG_ENABLE | IMM_BIT;
+#endif /* NO_EEPROM */
+
/* allow them to force multiple transceivers. If they force multiple, autosense */
{
int count = 0;
@@ -572,6 +599,7 @@

lp->irq_map = 0xffff;

+#ifndef CONFIG_ARCH_WEBPAL
/* If this is a CS8900 then no pnp soft */
if (lp->chip_type != CS8900 &&
/* Check if the ISA IRQ has been set */
@@ -602,6 +630,7 @@
if (!dev->irq)
dev->irq = i;
}
+#endif /* CONFIG_ARCH_WEBPAL */

--- linux.orig/drivers/net/cs89x0.h 2000-03-03 15:56:13.000000000 -0500
+++ linux/drivers/net/cs89x0.h 2003-08-29 09:23:06.000000000 -0400
@@ -437,7 +437,7 @@
#define IRQ_MAP_EEPROM_DATA 0x0046 /* Offset into eeprom for the IRQ map */
#define IRQ_MAP_LEN 0x0004 /* No of bytes to read for the IRQ map */
#define PNP_IRQ_FRMT 0x0022 /* PNP small item IRQ format */
-#define CS8900_IRQ_MAP 0x1c20 /* This IRQ map is fixed */
+#define CS8900_IRQ_MAP 0x1e20 /* This IRQ map is fixed */

#define CS8920_NO_INTS 0x0F /* Max CS8920 interrupt select # */

Hope this helps someone else.

TomW
(see: http://www.openhardware.net/webpal/)

08-29-2003 07:59:04

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3