RE: Endianness versus too many byte swaps??

2 messages, 2 authors, 2007-03-05 · open the first message on its own page

RE: Endianness versus too many byte swaps??

From: Charles Krinke <hidden>
Date: 2007-03-05 15:02:45


You do understand that readl is in fact a call to in_le32() on ppc
(cf. include/asm-ppc/io.h).
=20
The question now is, what endianness you would like in that register?

Regards
--=20
Stephane

Dear Stephane:

Your point is well made. I can see that readl is in fact a call to
in_le32. Maybe there is a more basic problem here.=20

If I change the call to readl to a call to in_be32, things make sense
again. So, maybe I don't quite understand the endianness setup of this
Linux project.

I am told that we are running this ppc in big endian, so would this mean
that readl & writel should actually be resolving to in_be32/out_be32
respectively? Is there some other setup that may be wrong?


Charles

Re: Endianness versus too many byte swaps??

From: Kumar Gala <hidden>
Date: 2007-03-05 15:10:28

On Mar 5, 2007, at 9:02 AM, Charles Krinke wrote:

You do understand that readl is in fact a call to in_le32() on ppc
(cf. include/asm-ppc/io.h).

The question now is, what endianness you would like in that register?

Regards
--  
Stephane

Dear Stephane:

Your point is well made. I can see that readl is in fact a call to
in_le32. Maybe there is a more basic problem here.

If I change the call to readl to a call to in_be32, things make sense
again. So, maybe I don't quite understand the endianness setup of this
Linux project.
readl/writel are for PCI bus accesses.  PCI is inherently little endian.
I am told that we are running this ppc in big endian, so would this  
mean
that readl & writel should actually be resolving to in_be32/out_be32
respectively? Is there some other setup that may be wrong?
Nope, readl/writel are doing the write thing, they will ALWAYS be  
little endian.

You truly want in_be*/out_be* when accessing 85xx CCSR registers  
since all of them are big endian.

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help