[U-Boot] [PATCH] arm: socfpga: stratix10: Fix SPI flash ENV_SECT_SIZE

Ley Foon Tan lftan.linux at gmail.com
Wed May 8 02:42:56 UTC 2019


On Tue, May 7, 2019 at 9:04 PM Marek Vasut <marex at denx.de> wrote:
>
> On 5/7/19 8:01 AM, Ley Foon Tan wrote:
> > Fix SPI flash environment erase size error.
> >
> > Erase size of flash mt25qu02g on Stratix 10 should be 64KB.
> >
> > SOCFPGA_STRATIX10 # saveenv
> > Saving Environment to SPI Flash...
> > SF: Detected mt25qu02g with page size 256 Bytes, erase size 64 KiB, total 256 MiB
> > Erasing SPI flash...SF: Erase offset/length not multiple of erase size
> > Failed (-22)
> >
> > Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
> > ---
> >  include/configs/socfpga_stratix10_socdk.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/configs/socfpga_stratix10_socdk.h b/include/configs/socfpga_stratix10_socdk.h
> > index 12e77c0a90..16cd918cd3 100644
> > --- a/include/configs/socfpga_stratix10_socdk.h
> > +++ b/include/configs/socfpga_stratix10_socdk.h
> > @@ -66,8 +66,8 @@
> >  #undef CONFIG_ENV_OFFSET
> >  #undef CONFIG_ENV_SIZE
> >  #define CONFIG_ENV_OFFSET            0x710000
> > -#define CONFIG_ENV_SIZE                      (4 * 1024)
> > -#define CONFIG_ENV_SECT_SIZE         (4 * 1024)
> > +#define CONFIG_ENV_SIZE                      (64 * 1024)
> > +#define CONFIG_ENV_SECT_SIZE         (64 * 1024)
> >  #endif /* CONFIG_ENV_IS_IN_SPI_FLASH */
> >
> >  #ifndef CONFIG_SPL_BUILD
> >
> Can CONFIG_SPI_FLASH_USE_4K_SECTORS help instead ?
You are right, CONFIG_SPI_FLASH_USE_4K_SECTORS can fix this error too.
Will drop this patch and send another patch to enable
CONFIG_SPI_FLASH_USE_4K_SECTORS.

Thanks.

Regards
Ley Foon


More information about the U-Boot mailing list