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):

    Target (U-Boot)
    ls mmc 1:1
    Example Output
    => ls mmc 1:1
    19083776   Image
        1719   k3-am64-phyboard-electra-rdk-pcie-usb2.dtbo
        5934   k3-am64-phyboard-electra-rpmsg.dtbo
        1263   k3-am64-phyboard-electra-x27-uart3-spi1.dtbo
       55691   k3-am642-phyboard-electra-rdk.dtb
       55691   oftree
      500042   tiboot3.bin
      818520   tispl.bin
     1012016   u-boot.img
               System Volume Information/
    9 file(s), 1 dir(s)
  • We can check which file is the active device tree like so:

    Target (U-Boot)
    printenv fdtfile
  • Change the default device tree.

    Target (U-Boot)
    setenv fdtfile <dtb name>

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 following list shows an overview of all available overlays:

  • k3-am64-phyboard-electra-rdk-pcie-usb2.dtbo (Enables PCIe, but disables super-speed modes on the USB hub)

  • k3-am64-phyboard-electra-rpmsg.dtbo (Enables reserved memory regions required for co-processor functionality, ie Cortex-M4F and Cortex-R5F)

  • k3-am64-phyboard-electra-x27-uart3-spi1.dtbo (Enables UART3 and SPI1 interfaces)

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:

    Target (U-boot)
    setenv overlays k3-am64-phyboard-electra-rdk-pcie-usb2.dtbo
  • Moreover, it’s possible to enable multiple overlays with space separation.

    Target (U-boot)
    setenv overlays k3-am64-phyboard-electra-rdk-pcie-usb2.dtbo k3-am64-phyboard-electra-rpmsg.dtbo

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:

    Target (U-boot)
    env default -f -a