Failing to patch u-boot .dts

Jonas Vautherin


I am using u-boot on a pocketbeagle which, according to "Default Device Tree for DT control" in `bitbake -c menuconfig u-boot`, uses am335x-evm, which I understand is the file in ./build/tmp/work/pocketbeagle-poky-linux-gnueabi/u-boot/1_2020.07-r0/git/arch/arm/dts/am335x-evm.dts. 

My issue is that this file ends up setting usb1 as `dr_mode = "host"` and usb0 as `dr_mode = "otg"`. I would like to use fastboot on my pocketbeagle, and therefore set them to `dr_mode = "peripheral"`.

In order to do that, I wrote a .bbappend that does the following:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://am335x-evm.dts.patch"
SRC_URI += "file://logging.cfg"

The patch sets both usb0 and usb1 to `dr_mode = "peripheral"`, while the cfg enables logging in u-boot. Because logging is effectively enabled, I get that my .bbappend is used. And I can confirm that ./build/tmp/work/pocketbeagle-poky-linux-gnueabi/u-boot/1_2020.07-r0/git/arch/arm/dts/am335x-evm.dts is patched indeed.

However, whatever I do, I can't seem to get that modification in my u-boot device tree at runtime, as usb0 always ends up as "otg" and usb1 as "host". I have even tried a full clean build where I removed build/tmp and cache_sstate.

I cannot really tell if my patched file is actually used or not. For instance, if I `bitbake -c cleansstate u-boot`, then `bitbake -c do_patch u-boot`, then `rm -rf ./build/tmp/work/pocketbeagle-poky-linux-gnueabi/u-boot/1_2020.07-r0/git/arch/arm/dts` and finally `bitbake u-boot`, it does not complain at all about a missing dts file.

What am I missing, and how could I make sure that my patched am335x-evm.dts is the device tree being used by my u-boot install?

Best Regards,

Join to automatically receive all group messages.