David Hawkins wrote: > When you are dealing with a driver, register accesses need to be > in a specific format. The MPC8349EA has some of its registers > in big-endian format, and others in little-endian format. > Regardless of the mode you operate your processor, you will > *have* to use the correct byte-swap functions.
That's why we use cpu_to_be32() to write to big-endian registers. On a big-endian processor, this macro doesn't modify the parameter. So, *p = be32_to_cpu(12); will be compiled to *p = 12; On a little-endian process, the macro will do a byte-swap. This macro, and others like it, eliminates the need to have two different versions of the code. > DMA would be used to move a block of data, not to manipulate > a register. I can see you've never written an audio driver before. The data itself has endianness, and the register may require the data to appear in one endian or another. If -- Timur Tabi Linux kernel developer at Freescale ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users