[U-Boot] [PATCH] Change CFG_ENV_SIZE to CFG_ENV_SECT_SIZE for SPI sector erase

Wolfgang Denk wd at denx.de
Tue Aug 12 22:04:43 CEST 2008


Dear Tsi-Chung Liew,

In message <1218547123-18663-1-git-send-email-Tsi-Chung.Liew at freescale.com> you wrote:
> From: TsiChung Liew <Tsi-Chung.Liew at freescale.com>
> 
> The CFG_ENV_SIZE is not suitable used for SPI flash erase
> sector size.
> 
> Signed-off-by: TsiChung Liew <Tsi-Chung.Liew at freescale.com>
> ---
>  common/env_sf.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/env_sf.c b/common/env_sf.c
> index d641a9a..0a0626e 100644
> --- a/common/env_sf.c
> +++ b/common/env_sf.c
> @@ -69,7 +69,7 @@ int saveenv(void)
>  	}
>  
>  	puts("Erasing SPI flash...");
> -	if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE))
> +	if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SECT_SIZE))

Is it always guaranteed that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE ?

Otherwise several sectors might need to be erased...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Due to lack of disk space, this fortune database has been discontinued.



More information about the U-Boot mailing list