Closed radoslavp closed 4 months ago
Ok, figured the binman issue out (had to also create a patch to add stm32mp157a-board-u-boot.dtsi which defines binman node).
But still would appreciate some comments on whether the way i went is a good one. Thank you.
Hi @radoslavp, thanks for your appreciation!
Using your own device tree for U-Boot should be easier than how you are doing it now.
First you can write a very simple recipe that builds your device tree, which is very easy using the devicetree bbclass. The class also ensures your recipe provides the virtual/dtb
virtual package.
Then you can have your U-Boot recipe depend on virtual/dtb
and ask the U-Boot Makefile to use your own DTB file using the EXT_DTB environment variable. See the U-Boot documentation for more details.
Actually we have a plan to add all of this to meta-kiss. Stay tuned on #3 to see when it will be done.
Thanks. Sorry for late reply - got sidetracked. Tried this out and it was pretty easy. For anybody interested, short howto (writing it from top of my head, so hope it's complete - anybody feel free to correct me):
SUMMARY = "<Some summary>"
DESCRIPTION = "<Some description>"
SECTION = "bsp"
LICENSE = "
inherit devicetree
PROVIDES = "virtual/dtb"
COMPATIBLE_MACHINE:
* create subdirectory recipes-bsp/device-tree/files
* put your dts/dtsi files to recipes-bsp/device-tree/files
* in conf/machine/<machine-name>.conf change line `UBOOT_MAKE_TARGET:append = " DEVICE_TREE=<device tree name>"` to `UBOOT_MAKE_TARGET:append = " EXT_DTB=boot/devicetree/<device tree name>.dtb"`
* build
I used this recipe file as a template: https://github.com/nathanrossi/meta-xilinx/blob/nrossi/devicetree-classify/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb
Well, the previous post seems to be premature. The device-tree recipe seems to build correctly, but after clean u-boot rebuild it fails on:
Device Tree Source (boot/device_tree_name.dtb) is not correctly specified.
| Please define 'CONFIG_DEFAULT_DEVICE_TREE'
| or build with 'DEVICE_TREE=<device_tree>' argument
Originally, i had something like this in my machine conf: UBOOT_MAKE_TARGET:append = " EXT_DTB=boot/devicetree/device_tree_name.dtb" - i don't know where i got the 'boot/devicetree' path :), but even when changing it to just boot/device_tree_name.dtb (as it is in the link to u-boot documentation, you provided), it still fails. I'm not sure what path should i use.
The other thing i'm not sure about is what having 'U-Boot recipe depend on virtual/dtb' actually means - is it adding DEPENDS:append:stm32mp1 = "virtual/dtb" to u-boot recipe? Cause that didn't help.
In case, you're working on this and there is gonna be a commit adding this in the near future, i'll wait. If not, i'll be grateful for any help regarding this. Thank you.
Just na update in case, somebody needs it. The correct path in EXT_DTB seems to be ../recipe-sysroot/boot/devicetree/device-tree-name.dtb" - at least that's what worked for me.
But then, there popped up another problem - u-boot Makefile somehow automatically includes
Thanks for creating this! Seems to be really promising for our purposes. But still, i'm bit unsure how to use it properly, or rather how to create new board definition using meta-kiss as a reference.
This is what i did:
Is this correct way to do it? Thank you.