Subject: Re: bge on big endian anyone?
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: current-users
Date: 11/24/2005 08:01:48
I'm not surprised.  I went and picked up a bunch of different 3.3V PCI
cards to test with, and nearly all of them have DMA failures in
big-endian mode.  One of the cards I picked up was a tulip clone,
primarily because I'm quite familiar with that chipset (it doesn't have
hardware endian selection), and the card works fine in a big-endian
SPARC, but fails in my machine if it is big-endian.

I think the problem is that the Au15XX processors want to endian swap
all DMA target accesses.  There's a bit that you can clear that should
turn off the endian swapping, but experience shows that this makes
things *worse*.  Its almost like it screwes up memory addressing somehow.

I don't fully understand why I can't make the hardware behave correctly,
and I have a call into AMD about it.  In the meantime, I'll just run the
processor little endian.

    -- Garrett

Izumi Tsutsui wrote:

>In article <051123071130.M0105882@mirage.ceres.dti.ne.jp>
>I wrote:
>
>  
>
>>Hmm, more bswap ops are needed (for all members in struct bge_ring_data)?
>>    
>>
>
>Ok, I receive a report that says TX on bge is working without patch,
>so bge has a big endian mode and it handles byteswap against
>DMA descriptors properly. The problem is an extra byteswap
>which is not needed, and he says the attached patch make
>bge work at least on macppc.
>---
>Izumi Tsutsui
>
>*** ORIG/if_bgereg.h	Sat Nov 19 08:58:47 2005
>--- if_bgereg.h	Thu Nov 24 02:56:18 2005
>***************
>*** 1769,1775 ****
>  	u_int32_t		bge_nicaddr;
>  };
>  
>! #if BYTE_ORDER == BIG_ENDIAN
>  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((flags) << 16 | (maxlen))
>  #else
>  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((maxlen) << 16 | (flags))
>--- 1769,1775 ----
>  	u_int32_t		bge_nicaddr;
>  };
>  
>! #if 0 /*BYTE_ORDER == BIG_ENDIAN*/
>  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((flags) << 16 | (maxlen))
>  #else
>  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((maxlen) << 16 | (flags))
>  
>


-- 
Garrett D'Amore                          http://www.tadpolecomputer.com/
Sr. Staff Engineer          Extending the Power of 64-bit UNIX Computing
Tadpole Computer, Inc.                             Phone: (951) 325-2134