Port-powerpc archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: i82544EI ethernet driver
Allen Briggs wrote:
> On Mon, Nov 15, 2004 at 02:28:48PM -0500, Kate Feng wrote:
> > I am porting it to a big-endian PowerPC. Thus,
> > 1) for data buffer, I think I should add :
> >
> > sc->sc_ctrl |= CTRL_BEM;
> >
> > prio to
> >
> > /* Write the control registers. */
> > CSR_WRITE(WMREG_CTRL, sc->sc_ctrl);
> >
> >
> > 2) for the descriptor, I should keep the original
> > codes htole32/le32toh, and le16toh....
> > Meanwhile, I should do
> >
> > #define BYTE_ORDER BIG_ENDIAN
> >
> >
> > Is that right ?
>
> I would try to get it working as-is first.
You mentioned the code was tested for both big-endian and
little-endian. It must be somewhere I have to do
#define BYTE_ORDER BIG_ENDIAN
Does that make sense ?
Thanks,
Kate
> You should not need to
> modify the driver to get it to work. Your bus_space routines for
> the bus should take care of any CPU->PCI byte swapping and since
> the chip is, by default, using little-endian, it will expect the
> descriptors in memory to be little-endian (so you need to write
> them with htole32 and friends, then read them with le32toh and
> friends). Does that make sense?
>
> -allen
>
> --
> Use NetBSD! http://www.netbsd.org/
Home |
Main Index |
Thread Index |
Old Index