[U-Boot-Users] [RFC] CFI Driver Little-Endian write Issue

Yuli Barcohen yuli at arabellasw.com
Tue Aug 8 13:25:34 CEST 2006


>>>>> Li Yang writes:

    Li> +#if defined(__LITTLE_ENDIAN) && !defined(CFG_FLASH_CFI_SWAP)
    Li> +#define CFG_FLASH_CFI_SWAP
    Li> +#endif
    Li> + [snip]
    Li> -#if defined(__LITTLE_ENDIAN)
    Li> +#if defined(CFG_FLASH_CFI_SWAP)

    Li> Why use CFG_FLASH_CFI_SWAP instead of __LITTLE_ENDIAN.  It seems
    Li> that they are equivalent.

No, they aren't. First of all, on big-endian systems __LITTLE_ENDIAN is
never defined and on little-endian systems it's always defined
automatically while CFG_FLASH_CFI_SWAP must be defined manually if your
board has such a flash. On little-endian systems, the driver should work
without the need to define CFG_FLASH_CFI_SWAP. Also, there are places in
the code for __LITTLE_ENDIAN only, not for CFG_FLASH_CFI_SWAP.

-- 
========================================================================
 Yuli Barcohen       | Phone +972-9-765-1788 |  Software Project Leader
 yuli at arabellasw.com | Fax   +972-9-765-7494 | Arabella Software, Israel
========================================================================




More information about the U-Boot mailing list