TechNexion / meta-tn-imx-bsp

TechNexion BSP Layer for i.MX Yocto Project
MIT License
6 stars 11 forks source link

ALT_FDTNAME does not work #17

Closed ondrejhennel closed 1 year ago

ondrejhennel commented 1 year ago

On kirkstone_5.15.52-2.1.0-stable, specifying a custom fdtfile using ALT_FDTNAME is not working as expected. When using the variable, these two lines are added to uEnv.txt:

alt_fdtname=<content_of_ALT_FDTNAME>
uenvcmd=setenv has_fdt 1; setenv fdtname ${alt_fdtname}; setenv fdtfile ${alt_fdtname}.dtb; run bootcmd_mmc;

fdtfile variable is set correctly, but it is later overwritten when setfdt is run from mmcboot, which is run from bootcmd_mmc.

bootcmd_mmc=run loadimage;run mmcboot;
mmcboot=echo Booting from mmc ...; run m4boot; run searchbootdev; run mmcargs; echo baseboard is ${baseboard}; run setfdt; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then echo WARN: Cannot load the DT; echo fall back to load the default DT; setenv baseboard ${default_baseboard}; run setfdt; run loadfdt; bootz ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
setfdt=if test -n ${wifi_module} && test ${wifi_module} = qca; then setenv fdtfile ${som}-${form}-${baseboard}-${wifi_module}${mcu}.dtb; else setenv fdtfile ${som}-${form}-${baseboard}

has_fdt is set in uenvcmd and I assume it is supposed to be a flag that tells the other commands not to overwrite fdtfile. This is, however, not checked and fdtfile is always overwritten.

ray-chang commented 1 year ago

Hi @Ondrej1

Thanks for your feedback.

We have fixed this issue to branch of kirkstone_5.15.52-2.1.0-next. Please use the next branch for now, as the stable branch is not scheduled to be updated until 2023Q2.

BR, Ray