Subject: Re: bge on big endian anyone?
To: Garrett D'Amore <>
From: Neil Ludban <>
List: current-users
Date: 11/22/2005 15:41:12
Garrett D'Amore wrote:
> I'm trying to get bge working on a big-endian host (MIPS core).  I am
> not having luck.  Changing the core to little endian makes it work
> fine.  Is anyone else out there using it with -current on a big endian
> (or even better yet, big-endian MIPS) host?
> Interestingly enough, ath and wi both work fine in the same slots in
> both big and little endian modes.
> This is a 3.3V slot, and I don't have any other 3.3V PCI cards to test
> with right now, which is why this is frustrating.  (I'm trying to prove
> that my PCI code works.)
> I have been suspecting a problem with my code, but maybe the problem is
> in the bge driver?  Any help/advice is appreciated.
> The symptoms look like packets are never getting thru, as I can
> configure the interface just fine (and it reports correct PHY, MAC
> address, etc.)  I've been suspicious of the DMA code, but ath works fine
> (so I think DMA works, though ath might be explicity checking endianness
> and correcting for it.)

The ath hardware can be programmed to byte swap IO and DMA, which I found
out the hard way when implementing PCI support for a PowerPC board (back
when NetBSD's atheros support was only for i386).  Same symptoms of the
interface being configurable, but no packets getting sent or received.
ISTR that NetBSD assumed all PCI is little endian, but then the driver was
doing byte swapping as well.  I think I caught the byte swapped addresses
on the PCI bus with a logic analyzer.  Check with your PCI bridge, it may
be capable of capturing bad cycles.  IIRC, the standard PCI device header
has some error flags, too.