I’m trying to understand how to overlay the device tree. My understanding of the device tree and it’s syntax are limited but I believe I understand the process of doing through the bootloader using various fdt and load commands.
from this link [Using Device Tree Overlays, example on BeagleBone Cape add-on boards - BeagleBoard](https://Beaglebone overlay instructions) I learned to halt the boot sequence at the bootloader and run these commands:
load mmc 0:1 0x820000000 am335x-boneblack-uboot.dtb
fdt addr 0x82000000
load mmc 0:1 0x83000000 overlays/BBORG_RELAY-00A2.dtbo
fdt resize 8192
fdt apply 0x83000000
So that’s what I attempted to do. Here is my overlay file (pinmux-overlay.dtso)
/*
- TBD
*//dts-v1/;
/plugin/;&am33xx_pinmux {
pinctrl-names = “default”;
pinctrl-0 = <&testpins>;testpins: testpins { pinctrl-single,pins = < 0x044 0xf /* P9_41: gpmc_a0.gpio0_20 */ >; };
};
The first thing I did was to create pinmux-overlay.dtsb via the device tree compiler and the command below.
tmp/work/beaglebone_yocto-poky-linux-gnueabi/linux-yocto/5.15.150+gitAUTOINC+567f0adb9d_4fca0c4373-r0/linux-beaglebone_yocto-standard-build/scripts/dtc/dtc -@ -I dts -O dtb -o …/…/pinmux-overlay.dtsb …/…/pinmux-overlay.dtso
The next thing I did was start my bbb and stop in u-boot. Once doing so I ran the following commands:
- start usb
Press SPACE to abort autoboot in 2 seconds
=> usb start
starting USB…
USB0: scanning bus 0 for devices… 1 USB Device(s) found
scanning usb for storage devices… 1 Storage Device(s) found
- check what files are in mmc. I see the am335x-boneblack.dtb file… so that’s good
=> fatls mmc 0:1
107932 MLO
63110 am335x-bone.dtb
66576 am335x-boneblack.dtb
63374 am335x-bonegreen.dtb
extlinux/
1224900 u-boot.img
7888336 zImage
6 file(s), 1 dir(s)
- check which files are on my usb. I see my pinmux-overlay.dtsb file. so that’s good.
=> fatls usb 0:1
System Volume Information/
510 pinmux-overlay.dtsb
11 TestFile.txt2 file(s), 1 dir(s)
- load the base am335x-boneblack.dtb file to ram address 0x880000000
=> load mmc 0:1 0x880000000 am335x-boneblack.dtb
66576 bytes read in 7 ms (9.1 MiB/s)
- Set the device tree base file to ram address 0x80000000
=> fdt addr 0x880000000
- load the overlay file pinmux-overlay.dtsb file to ram address 0x890000000
=> load usb 0:1 0x890000000 pinmux-overlay.dtsb
510 bytes read in 50 ms (9.8 KiB/s)
- resize fdt. Not really sure of the point of this. I assume to fit the overlay. Mostly I’m following the example.
=> fdt resize 8192
- Apply the overlay file to the base device tree file
=> fdt apply 0x890000000
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
base fdt does did not have a /symbols node
make sure you’ve compiled with -@
=>
You can see I receive FDT_ERR_NOTFOUND. I believe it’s because of the am33xx_pinmux symbol I have in my device tree overlay file… Assuming I’m correct, I think my question is, how do I overlay am33xx_pinmux symbol. Do I even need to?