This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[OMAP-L138: UBOOT] How to make sense of the environment variable defines in DA850EVM.h

Hi,

We are using U-Boot-2009-11-psp03.20.00.13 in our custom board.

However, instead of using M25P64 SPI flash chip on our board we use M25P128.

We verified that U-boot supports M25P128 but the sector size (1024bytes) is different with the M25P64 (256bytes).

How I'd like to update the #define in da850evm.h to reflect this change but I can't make sense of how the defines are configured.

Below are the default defines:

#ifdef CONFIG_USE_SPIFLASH
#undef CONFIG_ENV_IS_IN_FLASH
#undef CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_SIZE            (64 << 10)
#define CONFIG_ENV_OFFSET        (256 << 10)
#define CONFIG_ENV_SECT_SIZE        (64 << 10)   
#define CONFIG_SYS_NO_FLASH
#endif

 

Can you please advise us how to configure CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, and CONFIG_ENV_SECT_SIZE for the M25P128? I am assuming that these are currently configured for the M25P64.

  • I figured it out.

    CONFIG_ENV_SIZE: Configure to sector size
    CONFIG_ENV_OFFSET: Configure to 256K or (U-boot last sector + (1*sector size)) since the U-boot image stored a magic number on the next sector that will invalidate the U-boot image if corrupted
    CONFIG_ENV_SECT_SIZE: Configure to sector size