On Fri, Oct 11, 2024 at 06:58:27PM +0800, Peng Fan (OSS) wrote:

> From: Peng Fan <peng....@nxp.com>
> 
> U-Boot device tree is padded just after U-Boot proper. After the whole
> stuff loaded to DRAM space, the device tree area is conflict with BSS
> region before U-Boot relocation. So any write to BSS area before
> reloc_fdt will corrupt the device tree. Without the fix, there is
> issue that “binman_init failed:-2” on i.MX8MP-EVK board.
> 
> Move the variable to data section to fix the issue
> 
> Signed-off-by: Peng Fan <peng....@nxp.com>
> ---
>  drivers/cpu/imx8_cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c
> index 6c0a8c0cbe4..19c65c7ce47 100644
> --- a/drivers/cpu/imx8_cpu.c
> +++ b/drivers/cpu/imx8_cpu.c
> @@ -71,7 +71,7 @@ static const char *get_imx_type_str(u32 imxtype)
>  
>  static const char *get_imx_rev_str(u32 rev)
>  {
> -     static char revision[4];
> +     static char revision[4] __section(".data");
>  
>       if (IS_ENABLED(CONFIG_IMX8)) {
>               switch (rev) {

Why isn't this padding and alignment with the BSS being taken care of in
either the linker script or the binman dts?

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to