How-to


Load / Change / Save the Device Tree under U-Boot


Devicetree can be edit with the fdt commands under U-Boot.

For testing purpose only. For bigger changes, please compile the Devicetree.
Therefore you can have a look at the following tutorial.

Tested with TQMa7x BSP Rev.0101

1) At first the fdt file has to be loaded from the current boot medium (mmc) into RAM.

=> run loadfdt

2) Next step is to set the predefined U-Boot environment variable fdt_addr through the fdt addr command.

=> fdt addr $fdt_addr

3) Afterwards the size of the fdt has to be increased (to the next 4K divider) in order to have some space for modifications. This is simply done by entering:

=> fdt resize 

4) List device in the tree you want to change to have a look at the default settings.

Example

5) To modify a value of a propertie use the fdt set command.

=> fdt set <path> <property> <value> 

Example

6) Optional: If you want to save your modified Devicetree back to mmc you'll have to run the following command:

=> fatwrite mmc $mmcdev:$firmwarepart $fdt_addr $fdt_file <totalsize>

You can find out <totalsize> of the modified fdt by entering the command fdt header

Otherwise you can boot your module with the changed Devicetree right after the modification.