bootlin / buildroot-external-st

External Buildroot tree for STMicroelectronics boards configurations
48 stars 26 forks source link

Solution for U-Boot build of DTBs is not correct #9

Closed tpetazzoni closed 2 years ago

tpetazzoni commented 2 years ago

https://github.com/bootlin/buildroot/commit/5c632714c065243894d735ce8b69d83beb8cf542 will not work, as it tries to apply a patch regardless of the version of U-Boot being used. This simply cannot work, as people can use any arbitrary U-Boot version.

We need to find a different solution.

kmaincent commented 2 years ago

Removed the commit from bootlin/buildroot repository. Managed the U-boot patch in the BR2_EXTERNAL using the config BR2_TARGET_UBOOT_PATCH.

tpetazzoni commented 2 years ago

Can't we find a better solution than this patch ? Indeed, the goal was that users should be able to use Buildroot itself, without this BR2_EXTERNAL. With this U-Boot patch, we violate this promise.

tpetazzoni commented 2 years ago

Also, for patches we should use BR2_GLOBAL_PATCH_DIR instead.

kmaincent commented 2 years ago

Can't we find a better solution than this patch ? Indeed, the goal was that users should be able to use Buildroot itself, without this BR2_EXTERNAL. With this U-Boot patch, we violate this promise.

The other solution may be to build the device tree manually by BR and not by U-boot own Makefile, but I am not sure it is suitable. The user can copy the patch to his own Buildroot, is it violating the promise?

tpetazzoni commented 2 years ago

The approach of the patch would be OK if the patch was accepted upstream, but unless I'm wrong, it has not been reviewed nor accepted?

kmaincent commented 2 years ago

According to Christophe from ST it won't be accepted. The U-boot community has decided to not support external devicetree.

tpetazzoni commented 2 years ago

Then we need a different solution. A solution that requires a patch that we have to maintain on top of U-Boot forever is not workable.

kmaincent commented 2 years ago

Then using host-dtc to build device tree in the u-boot package could be the solution?

tpetazzoni commented 2 years ago

I don't have a good view on what the problem is, so I'm not sure what solutions we have. The other option is to automatically tweak the U-Boot Makefiles to build the DTB ?

kmaincent commented 2 years ago

yes

kmaincent commented 2 years ago

solve with "dtb-y=devicetreename" in uboot make parameter

tpetazzoni commented 2 years ago

Please update the documentation where the contents of the defconfigs are explained, because this is quite tricky, and probably the documentation about the STM32CubeMX integration.