[yocto] Specifying location of DTB file

Nikolay Dimitrov picmaster at mail.bg
Tue Aug 11 08:00:30 PDT 2015


Hi Adam,

On 08/11/2015 04:31 PM, Adam Rossi wrote:
> Howdy folks. I have had a devil of a time creating my own machine.conf
> and getting it to boot, so I went back to using the stock
> beaglebone.conf machine. I need to modify the DTB file that my
> prototype loads, so I decompiled the yocto am335x-boneblack.dtb, added
> some special sauce to the dts, and added the following to a
> linux-yocto_3.19.bbappend recipe:
>
> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> SRC_URI +="file://touchscreen.cfg \
>   file://special-am335x-boneblack.dts"
>
> do_install_prepend() {
>          cp ${WORKDIR}/special-am335x-boneblack.dts ${S}/arch/${ARCH}/boot/dts/
> }
> KERNEL_DEVICETREE_beaglebone =  "special-am335x-boneblack.dtb"
>
> This works, I get a special-am335x-boneblack.dtb in my image. However,
> on booting the files on my beagle bone, I get an error that the system
> cannot find the boot/am335x-boneblack.dtb file. Creating a symlink to
> my special-am335x-boneblack.dtb solves the problem.
>
> Where does the system configure the directions to look for
> "am335x-boneblack.dtb"? I suspect this is because the stock
> beaglebone.conf file also has a
> KERNEL_DEVICETREE="am335x-boneblack.dtb". Perhaps my kernel recipe is
> only partly overriding this?
>
> Thanks for your continuing help. Regards, Adam

The only component responsible for looking the DTB during boot is the
bootloader (usually U-Boot). If you break the boot sequence and type
"printenv", you can look at the contents of "bootcmd" variable and see
which other scripts/vars it uses, in order to see how the bootloader
tries to load the DT.

If/when you do some modifications to the default U-Boot environment,
you can generate a patch to your U-Boot source code and add this patch
to your machine-specific U-Boot, so you can have the changes integrated
in your next system build.

Regards,
Nikolay



More information about the yocto mailing list