I am working with a P3041 processor. We have a PCI board that DMA data in little endian format. What Linux function can I call to set these pages to be accessed in little endian format? I know the MAS2 register has a bit for this. Does Linux have support to set this bit?
Thanks.
Solved! Go to Solution.
Linux does not support this. You can use byte-swapping instructions (e.g. lwbrx, stwbrx).
If this is a kernel driver, use swapping functions like cpu_to_be32() and be32_to_cpu(). If it's a powerpc-specific kernel driver, functions such as ld_le32() and st_le32() are available to use the byte-swapping instructions, but these do not appear to be supported on any other architecture.
Linux does not support this. You can use byte-swapping instructions (e.g. lwbrx, stwbrx).
If this is a kernel driver, use swapping functions like cpu_to_be32() and be32_to_cpu(). If it's a powerpc-specific kernel driver, functions such as ld_le32() and st_le32() are available to use the byte-swapping instructions, but these do not appear to be supported on any other architecture.