* Sparc, dma mapping and endianness
@ 2011-07-31 8:36 Roland Vossen
2011-07-31 9:07 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Roland Vossen @ 2011-07-31 8:36 UTC (permalink / raw)
To: sparclinux
Hello David,
I have got a DMA capable PCI device that writes its data into host
memory. The CPU reads that data. For little endian processor this works
fine, but for big endian processors the data has to be endianness
swapped before interpretation.
The broadcom BCM47XX (MIPS) series has a hardware provision for this:
its memory controller defines a 'SDRAM swap window'.
I read that the Sparc-V9 64 bit architecture also supports endianness
swapping of pages. I wonder if it is easy to make use of this
functionality in Linux.
Also I wonder if Linux supports an arch agnostic API to accomplish this.
I did read Documentation/DMA-mapping.txt but that did not provide more
information on this subject to me.
Thanks, Roland.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Sparc, dma mapping and endianness
2011-07-31 8:36 Sparc, dma mapping and endianness Roland Vossen
@ 2011-07-31 9:07 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-07-31 9:07 UTC (permalink / raw)
To: sparclinux
From: "Roland Vossen" <rvossen@broadcom.com>
Date: Sun, 31 Jul 2011 10:36:40 +0200
> I read that the Sparc-V9 64 bit architecture also supports endianness
> swapping of pages. I wonder if it is easy to make use of this
> functionality in Linux.
Not really.
You'll need to use le32_to_cpu() and friends on the data when
interpreting it. Or even better, le32_to_cpup() which works
on pointers and emits little-endian loads on sparc v9.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-31 9:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-31 8:36 Sparc, dma mapping and endianness Roland Vossen
2011-07-31 9:07 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.