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

Benjamin Herrenschmidt
2004-09-23T22:56:44Z

On Fri, 2004-09-24 at 01:25, Petr Vandrovec wrote:

>
> 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?

I don't know exactly what X.org does ...

In general, on a PCI bus, we expect MMIO to be little endian. Some cards
try to be "smart" and have an endian swap facility for MMIO (like nvidia,
and I think matrox) but I tend to consider that useless since it force us
to have different IO accessors or to add an "un-byteswap" macro. The PPC
is very good at doing byteswapped accesses with one instruction so it
isn't really a waste to do all MMIOs littel endian anyway.

For the framebuffer, it's common practice to have it in big endian format
(and using the proper byteswap register for the access bit depth)

Ben.