[U-Boot-Users] Little endian

Leon KUKOVEC leon.kukovec at ultra.si
Thu Nov 27 09:34:23 CET 2003

Hey Ed,

On Wed, 26 Nov 2003, Ed Okerson wrote:

> Yes it has, but the current workaround requires byteswapping the entire CF
> card on the PC platform before it can be used by the AU1500.  This will be
> very inconvenient for my application.  I want to correct that so the CF
> card can be moved between the PC and AU1500 with standard partitions and
> filesystems.  In looking at the code I only saw where the little-endian
> issue was addressed for only one function and I didn't know if that was
> really the only place it needed to be addressed.  My initial experiments
> seem to suggest that at least the input_data_shorts() function also needs
> to handle things differently for little-endian, at least on the AU1500.
> Making it swap bytes makes the AU1500 able to read at least the partition
> table on a CF card without the bytes being swapped.  This led me to wonder
> if anyone else was having these problems in little-endian mode or if it
> was just me.

I recently added PCMCIA support for PXA/WEPEP250 and have successfully used
CompactFlash on it.

I don't know AU1500 processor, but the comment in cmd_ide.c says that
processor swaps something automaticaly.

/* We only need to swap data if we are running on a big endian cpu. */
/* But Au1x00 cpu:s already swaps data in big endian mode! */
#if defined(__LITTLE_ENDIAN) || defined(CONFIG_AU1X00)
#define input_swap_data(x,y,z) input_data(x,y,z)
End of Paste

You will prolly know what has to be swapped and what not for AU1500.

Our PXA runs in little endian mode and all I had to tweak was the following:

Convert PCMCIA Firmware Revision and Model Number into little endian because
they are big endian strings and take care of lba_capacity which is little
endian but has been swapped, which worked fine on big endian CPU's but on
little endian, gave wrong number of sectors.

Everything else seemed to work fine.

PS: I have verified it by using the same CompactFlash card on a PC and it

Hope that helps.


Best Regards,

More information about the U-Boot mailing list