* asm/io.h; why does writel() write an le32 on ppc?
@ 2001-03-06 23:15 Brad Parker
2001-03-06 23:23 ` Gabriel Paubert
2001-03-06 23:30 ` Jeff Garzik
0 siblings, 2 replies; 5+ messages in thread
From: Brad Parker @ 2001-03-06 23:15 UTC (permalink / raw)
To: linuxppc-dev
Sorry to be daft, but why does writel() write an le32 on the ppc?
in asm/io.h it uses out_le32, unless the machine is an APUS, in which
case it just writes big endian...
(is PCI defined as little endian?)
-brad
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: asm/io.h; why does writel() write an le32 on ppc?
2001-03-06 23:15 asm/io.h; why does writel() write an le32 on ppc? Brad Parker
@ 2001-03-06 23:23 ` Gabriel Paubert
2001-03-06 23:28 ` Brad Parker
2001-03-06 23:30 ` Jeff Garzik
1 sibling, 1 reply; 5+ messages in thread
From: Gabriel Paubert @ 2001-03-06 23:23 UTC (permalink / raw)
To: Brad Parker; +Cc: linuxppc-dev
On Tue, 6 Mar 2001, Brad Parker wrote:
>
> Sorry to be daft, but why does writel() write an le32 on the ppc?
>
> in asm/io.h it uses out_le32, unless the machine is an APUS, in which
> case it just writes big endian...
>
> (is PCI defined as little endian?)
Sadly, yes.
Gabriel.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: asm/io.h; why does writel() write an le32 on ppc?
2001-03-06 23:23 ` Gabriel Paubert
@ 2001-03-06 23:28 ` Brad Parker
2001-03-07 1:15 ` Gabriel Paubert
0 siblings, 1 reply; 5+ messages in thread
From: Brad Parker @ 2001-03-06 23:28 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: linuxppc-dev
Gabriel Paubert wrote:
>On Tue, 6 Mar 2001, Brad Parker wrote:
...
>> in asm/io.h it uses out_le32, unless the machine is an APUS, in which
>> case it just writes big endian...
>>
>> (is PCI defined as little endian?)
>
>Sadly, yes.
Ok, so the APUS pci bridge must be doing byte swapping. I assume the
ppc macintosh pci bridges do not byte swap...
I see it now. Thanks!
-brad
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: asm/io.h; why does writel() write an le32 on ppc?
2001-03-06 23:28 ` Brad Parker
@ 2001-03-07 1:15 ` Gabriel Paubert
0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Paubert @ 2001-03-07 1:15 UTC (permalink / raw)
To: Brad Parker; +Cc: linuxppc-dev
On Tue, 6 Mar 2001, Brad Parker wrote:
>
> Gabriel Paubert wrote:
> >On Tue, 6 Mar 2001, Brad Parker wrote:
> ...
> >> in asm/io.h it uses out_le32, unless the machine is an APUS, in which
> >> case it just writes big endian...
> >>
> >> (is PCI defined as little endian?)
> >
> >Sadly, yes.
>
> Ok, so the APUS pci bridge must be doing byte swapping. I assume the
> ppc macintosh pci bridges do not byte swap...
Nor any other PPC bridge that I know (unless you put it in little-endian
mode because of the address munging that the processor does, but the
munging is not dependant on the size of the transfer). Byte
swapping bridges are painful to handle when you try to move structures as
a block across the bridges (the way the byte lanes are connected between
both sides of the bridges changes depending on the size of the transfer).
I prefer very much byte address preserving bridges, like PMAC/PreP/CHRP.
Regards,
Gabriel.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: asm/io.h; why does writel() write an le32 on ppc?
2001-03-06 23:15 asm/io.h; why does writel() write an le32 on ppc? Brad Parker
2001-03-06 23:23 ` Gabriel Paubert
@ 2001-03-06 23:30 ` Jeff Garzik
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2001-03-06 23:30 UTC (permalink / raw)
To: Brad Parker; +Cc: linuxppc-dev
Brad Parker wrote:
> Sorry to be daft, but why does writel() write an le32 on the ppc?
> (is PCI defined as little endian?)
Yes. But there is always __raw_{read,write}[bwl]. That is part of the
API too.
Caveat programmer, though: IIRC there are other differences besides
endian when using __raw_xxx. I think there might be a lack of flushing,
etc., too.
--
Jeff Garzik | "You see, in this world there's two kinds of
Building 1024 | people, my friend: Those with loaded guns
MandrakeSoft | and those who dig. You dig." --Blondie
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-03-07 1:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-06 23:15 asm/io.h; why does writel() write an le32 on ppc? Brad Parker
2001-03-06 23:23 ` Gabriel Paubert
2001-03-06 23:28 ` Brad Parker
2001-03-07 1:15 ` Gabriel Paubert
2001-03-06 23:30 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).