I want to change the device tree and also add support for a different real time clock than that used by the Toradex Aster carrier board. For this I have to modify and compile the device tree and Linux kernel, so I’ve followed the tutorial Build U-Boot and Linux Kernel from Source Code.
I’ve modified the device tree by manually changing the lines of interest and the kernel by using the graphical interface ( nconfig
).
Now I have a new device tree output binary (DTB) file and a newly compiled kernel and it is not clear to me how to include them in the Yocto build.
I’ve read the tutorial Custom meta layers, recipes and images in Yocto Project, and have the following questions:
-
How to include the DTB file?
The tutorial shows how to include a DTS (not DTB) file. I don’t know if I can apply this method because my modifications are made in the imx6ull-colibri-aster.dtsi file, which is not the top level file. As I understand, I need to include the top level file (imx6ull-colibri-aster.dts) or a DTS file that contains the entire device tree.
-
How to include the kernel/kernel modifications in the Yocto build? The modifications were made using nconfig
, but I have no idea how to include them in Yocto. The Toradex Yocto webinar mentions about using the command bitbake -c menuconfig virtual/kernel
to graphically edit the kernel, but recommends this method only for testing.
Thank you!
Hi. Please correct me if I misunderstood:
-
I can include the DTB file by adding it to linux-toradex_%.bbappend
, by replacing the CUSTOM_DEVICETREE
line with, e.g., CUSTOM_DEVICETREE = "my-custom-devicetree-file.dtb"
. The KERNEL_DEVICETREE_append
flag remains the same.
-
I can replace the recipes-kernel/linux/linux-toradex/defconfig
(according to the tutorial) with the defconfig file generated by the command bitbake -c savedefconfig virtual/kernel
, in order to include it in the build.
Hi @CristianM,
1 You saw that the reference bbappend for this is copying the CUSTOM_DEVICETREE to the kernel sources, right?
Please make notice that you’ll also have to change the recipes-bsp/u-boot with an addition of a bbappend to replace the FDT_FILE reference in your bootloader, otherwise it will not be used during boot.
2 Yes… But in complement to that, I recommend this pattern from the Yocto documentation.
Best regards,
André Curvello
Thank you. Maybe you can detail these steps in your tutorial for others that may have the same questions as I have.
Hi @CristianM,
Yes! I’ll do that.
Thanks for your feedback in our Huddle session.
And, did you managed to get this to work in your environment?
Please let me know.
Best regards,
André Curvello
Hi @CristianM,
Sorry for the delay in answering you.
About your topics:
- How to include the DTB file?
See, the DTB is the Compiled DTS. So, when the Custom meta layers, recipes and images in Yocto Project talks about including the DTS, it’s talking about the DTB.
See that in the end of this article it’s presented the KERNEL_DEVICETREE_append flag in the machine-extra.conf configuration file, expressing the additional device-tree as DTB.
So, again, the dts is the source. The dtb is the binary format, and it’s what the system “builds”.
- I think that the point of “testing” is until you reach the desired “defconfig”. Then after using
bitbake -c menuconfig virtual/kernel
you can use bitbake -c savedefconfig virtual/kernel
. It will provide you the final defconfig that you can use on your own kernel bbappend for customization.
Please let me know if that helped.
Best regards,
André Curvello
Thanks. I hadn’t had the time to test, because I am currently mounting the components on my prototype custom carrier board and performing tests.
Hi Cristian,
I had similar difficulties during January with iMX8MM SOM. Those were covered in this thread: BSP5 device tree overlay file modification with Yocto build - Technical Support - Toradex Community
My solution was to patch .dtsi file to have support for custom carrier board, create own machine type and modify kernel with bbappend recipe…
Later I have noticed the .dtsi, in my case imx8mm-verdin.dtsi, have been modified heavily which forced me to renew the patch file several times when I have updated my work area from Toradex to get latest code.
I was also missing good and up to date tutorial related to this topic.
Hi @CristianM,
Ok! No worries.
As soon as you be able to test it, please let me know if everything is OK.
Best regards,
André Curvello
Hi @veskola,
As the iMX8 modules are going through changes over the iterative evolutions of BSP 5, these changes are expected on dtsi.
In your case, I’d recommend having your own dtsi, instead of patching ours, or… Using Device Tree Overlays.
Best regards,
André Curvello
Yes, I understand this and I have also considered option to use own version or overlay, but I would also like to have updates to keep code synch with latest which finally will be first LTS release.
Is there any ETA when BSP5 and iMX8MM is expected to get first the LTS release ?
Hi @veskola,
Unfortunately, there is no ETA for the LTS state of BSP5.
Best regards,
André Curvello