[U-Boot] [PATCH] arm: socfpga: Fix bootcounter located at the end of internal SRAM

Stefan Roese sr at denx.de
Tue Oct 30 11:28:30 UTC 2018


On 30.10.18 12:17, Simon Goldschmidt wrote:

<snip>

>          >     diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
>          >     index 2330143cf1..bd8f5c8c41 100644
>          >     --- a/include/configs/socfpga_common.h
>          >     +++ b/include/configs/socfpga_common.h
>          >     @@ -31,8 +31,21 @@
>          >       #define CONFIG_SYS_INIT_RAM_ADDR       0xFFE00000
>          >       #define CONFIG_SYS_INIT_RAM_SIZE       0x40000 /* 256KB */
>          >       #endif
>          >     +
>          >     +/*
>          >     + * Some boards (e.g. socfpga_sr1500) use 8 bytes at the end of the internal
>          >     + * SRAM as bootcounter storage. Make sure to not put the stack directly
>          >     + * at this address to not overwrite the bootcounter by checking, if the
>          >     + * bootcounter address is located in the internal SRAM.
>          >     + */
>          >     +#if ((CONFIG_SYS_BOOTCOUNT_ADDR > CONFIG_SYS_INIT_RAM_ADDR) && \
>          >     +     (CONFIG_SYS_BOOTCOUNT_ADDR < (CONFIG_SYS_INIT_RAM_ADDR +  \
>          >     +                                  CONFIG_SYS_INIT_RAM_SIZE)))
>          >     +#define CONFIG_SYS_INIT_SP_ADDR                CONFIG_SYS_BOOTCOUNT_ADDR
>          >     +#else
>          >       #define CONFIG_SYS_INIT_SP_ADDR                        \
>          >              (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
>          >     +#endif
> 
> 
> Can we have this check on CONFIG_INIT_RAM_SIZE instead of the
> initial stack pointer?
> 
> That would ensure the SPL size checks stay intact.

I'm not really sure what you mean with this. Could you please
explain in more detail?

Thanks,
Stefan


More information about the U-Boot mailing list