Configuring the Bootloader
Change the Device Tree
By default, U-boot loads a device tree binary (dtb) file named oftree during boot. The oftree file is a copy of k3-am642-phyboard-electra-rdk.dtb. This portion of the guide will instruct how to change U-boot to load different device trees.
Power on the board and press any key to stop autoboot when prompted by the Bootloader.
Use the following command to list the available file’s within the boot media’s Boot partition (this is typically where binaries used for boot are stored):
ls mmc 1:1
=> ls mmc 1:1 20935168 Image 361 k3-am6-phycore-disable-eth-phy.dtbo 234 k3-am6-phycore-disable-rtc.dtbo 235 k3-am6-phycore-disable-spi-nor.dtbo 1627 k3-am64-phyboard-electra-gpio-fan.dtbo 1715 k3-am64-phyboard-electra-pcie-usb2.dtbo 1224 k3-am64-phyboard-electra-x27-uart3-spi1.dtbo 60447 k3-am642-phyboard-electra-rdk.dtb 60447 oftree 496698 tiboot3.bin 829315 tispl.bin 924779 u-boot.img System Volume Information/
We can check which file is the active device tree like so:
printenv fdtfile
Change the default device tree.
setenv fdtfile <dtb name> saveenv reset
U-boot will now load the dtb file named ‘<dtb name>’ automatically during subsequent boots (just replace it with the appropriate file name when you run the command).
Working with Overlays
The PHYTEC BSP also comes with some device tree overlays to help evaluate certain interfaces and accessory hardware. The table “Linux Device Tree Summary” in the Release Notes shows an overview of all available overlays.
Enable an Overlay
U-boot has an extra environment variable called “overlays” to apply device tree overlay files. We can enable device tree overlays with it like so:
setenv overlays k3-am64-phyboard-electra-rdk-pcie-usb2.dtbo saveenv boot
Moreover, it’s possible to enable multiple overlays with space separation.
setenv overlays k3-am64-phyboard-electra-rdk-pcie-usb2.dtbo k3-am64-phyboard-electra-rpmsg.dtbo saveenv boot
The saveenv
command stores the boot environment to non-volatile memory. If you would like temporarily adjust the boot environment, you can omit the saveenv
command and the boot environment will go back to the previously saved settings on the next boot.
Reset the U-boot Environment to Default Settings
In order to revert the U-boot environment back to its original settings, run the following:
env default -f -a saveenv boot