From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hawkins Date: Fri, 02 May 2008 09:52:37 -0700 Subject: [U-Boot-Users] Configuring U-Boot for MPC8349E in little endian mode In-Reply-To: <481B265B.8060601@freescale.com> References: <47230CE166B64744B0120173E4C2161E04D531CF@BLR-EC-MBX01.wipro.com> <47230CE166B64744B0120173E4C2161E04D5352E@BLR-EC-MBX01.wipro.com> <481B265B.8060601@freescale.com> Message-ID: <481B46D5.6050605@ovro.caltech.edu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Vivek, Just to clarify these comments: > It would be a lot easier if you modified the application to work on big-endian > and little-endian. Just look through the code in places where the endian > matters, and add cpu_to_be32() and be32_to_cpu() (or similar functions). 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. > The only time this will be real problem is with DMA, since on 83xx you cannot > modify the data during a DMA transfer. > DMA would be used to move a block of data, not to manipulate a register. If encode/decode functions are used to move blocks of data, then the data is in byte-stream format, which does not change when the endian-order of the processor changes. Each byte occurs in the same order. You mention you are trying to re-use an existing code base. Keep in mind that just because the old code works, doesn't mean it is good code. If the code was not written to be endian-neutral, then it wasn't portable in the first place, so should be corrected. Cheers, Dave