Freescale / u-boot-fslc

U-Boot tree to host pending fixes and improvements
135 stars 178 forks source link

CONFIG_IMX_HAB with SPL is broken on i.mx6 #54

Closed freebendy closed 1 year ago

freebendy commented 1 year ago

CONFIG_IMX_HAB requires mxc_ocotp.c to work. Due to commit https://github.com/Freescale/u-boot-fslc/commit/8a1ab5e81126c6ccedaa76376e7206f5c8583aa3, SPL_MXC_OCOTP has dependency on SPL_MISC thus also depending on SPL_DM. This dependency chain change requires to enable DM for HAB in SPL, which leads to error SPL exceeding its maximum size on i.mx6. It seems that the mxc_ocotp.c does not require DM to work, it should depend on SPL as before instead of SPL_MISC.

otavio commented 1 year ago

Have you tried 2023.04?

freebendy commented 1 year ago

@otavio Yes, I tried 2023.04 with "CONFIG_SPL_DRIVERS_MISC=y" and "CONFIG_IMX_HAB=y", I still got the error: arch/arm/mach-imx/hab.c:876: undefined reference to `fuse_read'

fabioestevam commented 1 year ago

@freebendy

I have tested the following change against U-Boot mainline:

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index 2770b12598d9..8c29d4bbe835 100644 --- a/configs/mx6sabresd_defconfig +++ b/configs/mx6sabresd_defconfig @@ -127,3 +127,5 @@ CONFIG_IMX_HDMI=y CONFIG_SPLASH_SCREEN=y CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_BMP_16BPP=y +CONFIG_IMX_HAB=y +CONFIG_SPL_DRIVERS_MISC=y

It builds without issues here.

Tested the same on v2023.04 and the build error happens as you reported.

So there was a fix in mainline that is not present in v2023.04, but I haven't investigated.

fabioestevam commented 1 year ago

Ok, I investigated and after applying this commit: https://source.denx.de/u-boot/u-boot/-/commit/251a3053b1e68de3421e2c5536e58b9632f9c770 into v2023.04 this problem is solved.

Please submit this patch to u-boot-fslc so that this issue can be fixed.

freebendy commented 1 year ago

@fabioestevam Thanks for the info. Not sure the last statement is for me or a member in the repo, I create a PR for a cherry-pick. I will remove it if it is not the right approach.

fabioestevam commented 1 year ago

@freebendy This looks good. @otavio will probably apply your pull request soon.

freebendy commented 1 year ago

Fixed by #55.