Re: [PATCH] ppc64: Fix __raw_* IO accessors

Petr Vandrovec
2004-09-23T15:25:53Z

On Thu, Sep 23, 2004 at 10:49:00AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2004-09-23 at 04:58, Petr Vandrovec wrote:
>
> > > I'd rather have matroxfb use writel with an explicit swap, or better, the
> > > driver could maybe disable big endian register access and switch the card
> > > to little endian, provided it can do that while keeping the frame buffer
> > > itself set to BE (which is necessary most of the time).
> >
> > It is due to compatibility with XFree (or at least I was told) - they want
> > both framebuffer and accelerator in big-endian mode, so there is really no
> > choice (other than not supporting ppc...).
>
> Hrm... having a quick look at mga driver in current Xorg tree, it uses
> the MMIO_IN/OUT macros directly, those are not byteswapping ?
>
> It also does this at one point (ugh !) :
>
> #if X_BYTE_ORDER == X_BIG_ENDIAN
> /* Disable byte-swapping for big-endian architectures - the XFree
> driver seems to like a little-endian framebuffer -ReneR */
> /* pReg->Option |= 0x80000000; */
> pReg->Option &= ~0x80000000;
> #endif
>
> Weird... I think the X driver just lacks any "knowledge" of what's going
> on with endianness...

Ok. Can somebody tell me what byte order should be used for framebuffer
and for MMIO on PPC/PPC64 then? From cfb* it seems that framebuffer
have to be in big-endian mode, and from Xorg code it seems that MMIO should
be always in little-endian. Yes?

Petr Vandrovec