Subject: MIPS/linux compatible PCI network cards

From: Michael Shmulevich <[email-masked]>
Date: Fri, 26 Jan 2001 00:06:14 +0200

Hello all,

I would like to ask if someone knows some more or less widely available 
PCI network card that is compatible with MIPS/Linux.

I have heard of Tulip and AMD's PCnet. I wonder if you heard of others.

Thanks in advance,
Sorry if this mail bothered you...

Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D 
email: [email-masked]
web: http://www.jungo.com
Phone: 1-877-514-0537(USA)  +972-9-8859365(Worldwide) ext. 233
Fax:   1-877-514-0538(USA)  +972-9-8859366(Worldwide)

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 25 Jan 2001 14:16:32 -0800

On Fri, Jan 26, 2001 at 12:06:14AM +0200, Michael Shmulevich wrote:
> Date:   Fri, 26 Jan 2001 00:06:14 +0200
> From: Michael Shmulevich <[email-masked]>
> To: "[email-masked]" <[email-masked]>
> Subject: MIPS/linux compatible PCI network cards
> 
> Hello all,
> 

These all have already been used with Linux/MIPS.  I don't have any reports
on the current status of these drivers.  If they don't work they should
be reasonably easy to fix.

  Ralf

---

From: Pete Popov <[email-masked]>
Date: Thu, 25 Jan 2001 14:22:16 -0800

> Sorry if this mail bothered you...

Another one is the RTL8139.  It's quite cheap (I think less than $20).

Pete

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 25 Jan 2001 14:29:26 -0800

> Another one is the RTL8139.  It's quite cheap (I think less than $20).

In the dark past I had great success with the NE2k's.  They PIO, so no
driver hacking necessary at all.

  Ralf

---

From: Carsten Langgaard <[email-masked]>
Date: Fri, 26 Jan 2001 08:42:10 +0100

> be reasonably easy to fix.

The tulip driver worked fine at least in the past. The AMD PCnet driver works
just fine, we are using it on our reference boards.

--
_    _ ____  ___   Carsten Langgaard   Mailto:[email-masked]
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 25 Jan 2001 23:43:03 -0800

> just fine, we are using it on our reference boards.

The biggest grief I had was that about every embedded system I ever had
uses violates the common standard for what is supposed to be in the
EEPROMs of the Tulip or simply doesn't have one at all ...

  Ralf

---

From: Michael Shmulevich <[email-masked]>
Date: Fri, 26 Jan 2001 09:56:00 +0200

> Another one is the RTL8139.  It's quite cheap (I think less than $20).

Surprisingly enough, Realtek's driver is quite x86-oriented. It uses
some ugly outb() functtions without any ioremap()'ping.

We tried to modify it to work for MIPS, but failed. There are some
hard-to-detect situations, when driver just cannot talk to the hardware,
probably due to transmit/receive buffer synchronization. But after some
period the connection is restored (reset?). 

Michael Shmulevich

---

From: "Kevin D. Kissell" <[email-masked]>
Date: Fri, 26 Jan 2001 12:45:45 +0100

> just fine, we are using it on our reference boards.

Note, however, that the Tulip driver that was part of the
standard 2.2/2.3 repository at oss.sgi.com was both
downrev with regard to the author's own web site and
subobtimal if not outright buggy in it's cache management.
The AMD PCnet driver as we found it was clean and efficient
but had no MIPS cache hooks.   I had to put those in.
So unless Ralf or someone at SGI that the versions
on oss.sgi.com are the versions I cleaned up for MIPS,
I would recommend pulling them off the MIPS site.

            Regards,

            Kevin K.

---

From: Carsten Langgaard <[email-masked]>
Date: Fri, 26 Jan 2001 12:47:26 +0100

> I would recommend pulling them off the MIPS site.

The AMD PCnet driver should be OK in the CVS from oss.sgi.com

---

From: Carsten Langgaard <[email-masked]>
Date: Fri, 26 Jan 2001 12:49:13 +0100

> The AMD PCnet driver should be OK in the CVS from oss.sgi.com

At least in the 2.4.0 version.

---

From: Pete Popov <[email-masked]>
Date: Fri, 26 Jan 2001 10:17:27 -0800

> period the connection is restored (reset?).

The 8139 driver (at least the latest one) has an "ifdef" option to use
I/O or memory mapping. I've tried both and both work fine without any
modifications.  The I/O works fine, provided that you've set things up
correctly.

The inb()/outb() functions are part of just about every driver,
unfortunately.  I really don't like this x86 emulation, but if you want
to be able to use drivers without having to modify every one of them,
you'll have to do this.

To get the realtek driver to work, all you need to do is to set
mips_io_port_base to KSEG1.  Let's assume that the ethernet card has
been assigned i/o space at 0x14000000.  The driver will pick that up as
the ioaddr and use the 0x1400000 as the "port". The inb()/outb() macros
add mips_io_port_base to the "port" value and now you have 0xB4000000,
so you can access the card.  

Pete

---

From: Jun Sun <[email-masked]>
Date: Fri, 26 Jan 2001 11:53:10 -0800

> Sorry if this mail bothered you...

Intel eepro100 works on mips too.  What I had to modify is to
1) take care of the non-standard EEPROM
2) set rx_copybreak to 1518 to avoid some cache problem.
3) remove a buggy cpu_to_le32() coversion

I sent a patch to the author.  Hopefully next release it will be
ready for MIPS.

Jun

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 26 Jan 2001 13:00:44 -0800

> I would recommend pulling them off the MIPS site.

Linux 2.4 has a new DMA API which is documented in
Documentation/DMA-mapping.txt.  So today drivers which don't work out of
the box on a MIPS system should be considered broken.

  Ralf

---

From: Michael Shmulevich <[email-masked]>
Date: Sat, 27 Jan 2001 10:58:54 +0200

> so you can access the card.

The KSEG1() is indeed what I did, however the driver, as I tried to
describe, starts to loose synchronization on buffer at some point and
just waits quietly... Even with all the DEBUG and mental effort switched
on I can't get the reason why this happens...

By the way, which version of the driver are you talking about? Mine
doesn't have any ifdef on anything... besides MODULE of course:-)

Mine is:

static const char *version =
"rtl8139.c:v1.07 5/6/99 Donald Becker
http://cesdis.gsfc.nasa.gov/linux/drivers/"

---

From: Pete Popov <[email-masked]>
Date: Sat, 27 Jan 2001 13:31:44 -0800

> http://cesdis.gsfc.nasa.gov/linux/drivers/"

Hmmm, the above looks like the header for the 8129 driver, except that
it says rtl8139.  Make sure you're using drivers/net/8139too.c   I see
this in the driver:   #define RTL8139_VERSION "0.9.10". I'm using test9
kernel, I doubt that you're driver is out of date -- it seems you're
perhaps using the wrong driver.

Regarding the I/O vs MEM accesses, look for this:

/* define to 1 to enable PIO instead of MMIO */
#undef USE_IO_OPS

Pete

---

From: Ralf Baechle <[email-masked]>
Date: Sat, 27 Jan 2001 11:25:56 -0800

> 2) set rx_copybreak to 1518 to avoid some cache problem.

Now I wonder changing rx_copybreak is supposed to fix a cache problem?
This sounds broken ...

  Ralf

---

From: Ralf Baechle <[email-masked]>
Date: Sat, 27 Jan 2001 11:22:04 -0800

On Fri, Jan 26, 2001 at 09:56:00AM +0200, Michael Shmulevich wrote:
> Date:   Fri, 26 Jan 2001 09:56:00 +0200
> CC: "[email-masked]" <[email-masked]>
> Subject: Re: MIPS/linux compatible PCI network cards
> To: unlisted-recipients:; (no To-header on input)
> 
> Pete Popov wrote:
> > 
> > 

inb() and friends are for what Inhell calls I/O space.  Ioremap is for
memory mapped I/O.  So you usually don't find both of them in the same
driver.

  Ralf

---

From: Michael Shmulevich <[email-masked]>
Date: Sun, 28 Jan 2001 12:11:06 +0200

> memory mapped I/O.  So you usually don't find both of them in the same

I guess I will not. But at least hoped to see some io_port_base (?)
reference somewhere. neither ioremap, nor io_port_base is found in
rtl8139.c... I have tried to add some, but the results are still quite
disencouraging. 

Newer version of rtl8139.c (from the Scyld) have pci-scan dependency
which is not compatible with 2.2.14...

Sincerely yours,
Michael Shmulevich

---

From: Michael Shmulevich <[email-masked]>
Date: Sun, 28 Jan 2001 12:20:43 +0200

> /* define to 1 to enable PIO instead of MMIO */

I have checked the Scyld web page, this is where D. Becker currently
work on the driver (http://www.scyld.com/network/rtl8139.html)

Newer driver indeed seem to be more multi-platform aware, though
out-of-box compilation still crashed the kernel (access to 0x18000051
instead of 0xb8000051, KSEG1 stuff again). Corrected. Still no luck,
driver seems not to find where the card is. Switched cards to another
manufacturer [compatible, of course :-)] -- same result.

Sincerely yours,
Michael Shmulevich