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-am6754-phyboard-rigel.dts. 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):

sh-uboot:~# ls mmc 1:1
            EFI/
 23069184   Image
     2346   boot.scr.uimg
     3562   k3-am6754-phyboard-rigel-dsi-lcd282.dtbo
     1613   k3-am6754-phyboard-rigel-gpio-fan.dtbo
     3047   k3-am6754-phyboard-rigel-m2-cc3351.dtbo
     1704   k3-am6754-phyboard-rigel-mcu-mcans.dtbo
     5265   k3-am6754-phyboard-rigel-oldi-lcd185.dtbo
     1959   k3-am6754-phyboard-rigel-vm016-mipi-csi0.dtbo
     1959   k3-am6754-phyboard-rigel-vm016-mipi-csi1.dtbo
     1959   k3-am6754-phyboard-rigel-vm016-mipi-csi2.dtbo
     1959   k3-am6754-phyboard-rigel-vm016-mipi-csi3.dtbo
    78652   k3-am6754-phyboard-rigel.dtb
    78652   oftree
       37   overlays.txt
  3775151   ti-boot-container.img
   317430   tiboot3.bin
  1067043   tispl.bin
  1153711   u-boot.img
  • We can check which file is the active device tree like so:

    sh-uboot:~# printenv fdtfile
    
  • Change the default device tree.

    sh-uboot:~# setenv fdtfile <dtb name>
    sh-uboot:~# saveenv
    sh-uboot:~# boot
    

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. Table Linux Device Tree Summary in the BSP-Yocto-Ampliphy-AM67x-PD25.1.0 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:

sh-uboot:~# setenv overlays k3-am6754-phyboard-rigel-dsi-lcd282.dtbo
sh-uboot:~# saveenv
sh-uboot:~# boot
  • Moreover, it’s possible to enable multiple overlays by separating them with a space.

sh-uboot:~# setenv overlays k3-am6754-phyboard-rigel-vm016-mipi-csi0.dtbo k3-am6754-phyboard-rigel-m2-cc3351.dtbo
sh-uboot:~# saveenv
sh-uboot:~# 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:

sh-uboot:~# env default -f -a
sh-uboot:~# saveenv
sh-uboot:~# boot

Note

When booting from the SD card, if you have saved changes to the environment using saveenv, the changes may persist across flashes of the SD card. It is a good idea to default your environment after flashing.