Specifications
fdt addr <addr> [<length>] - Set the fdt location to <addr>
fdt move <fdt> <newaddr> <length> - Copy the fdt to <addr> and make it active
fdt resize - Resize fdt to size + padding to 4k addr
fdt print <path> [<prop>] - Recursive print starting at <path>
fdt list <path> [<prop>] - Print one level starting at <path>
fdt set <path> <prop> [<val>] - Set <property> [to <val>]
fdt mknode <path> <node> - Create a new node after <path>
fdt rm <path> [<prop>] - Delete the node or <property>
fdt header - Display header info
fdt bootcpu <id> - Set boot cpuid
fdt memory <addr> <size> - Add/Update memory node
fdt rsvmem print - Show current mem reserves
fdt rsvmem add <addr> <size> - Add a mem reserve
fdt rsvmem delete <index> - Delete a mem reserves
fdt chosen [<start> <end>] - Add/update the /chosen branch in the tree
<start>/<end> - initrd start/end addr
NOTE: Dereference aliases by omiting the leading '/', e.g. fdt print ethernet0.
=>
5.9.7.1. fdt addr - select FDT to work on
First, the blob that is to be operated on should be stored in memory, and U-Boot has to be informed about its
location by the fdt addr command. Once this command has been issued, all subsequent fdt handling
commands will use the blob stored at the given address. This address can be changed later on by issuing fdt
addr or fdt move command. Here's how to load the blob into memory and tell U-Boot its location:
=> print fdt_addr_r
fdt_addr_r=0x41000000
=> print fdt_file
fdt_file=/tftpboot/duts/m28/imx28-m28evk.dtb
=> tftp ${fdt_addr_r} ${fdt_file}
Using FEC0 device
TFTP from server 192.168.1.1; our IP address is 192.168.20.33
Filename '/tftpboot/duts/m28/imx28-m28evk.dtb'.
Load address: 0x41000000
Loading: ##
done
Bytes transferred = 16547 (40a3 hex)
=> fdt addr ${fdt_addr_r}
=>
5.9.7.2. fdt list - print one level
Having selected the device tree stored in the blob just loaded, we can inspect its contents. As an FDT usually
is quite extensive, it is easier to get information about the structure by looking at selected levels rather than
full hierarchies. fdt list allows us to do exactly this. Let's have a look at the hierarchy one level below the
cpus node:
=> fdt list /cpus
cpus {
cpu@0 {
};
};
=>
5.9.7.3. fdt print - recursive print
To print a complete subtree we use fdt print. In comparison to the previous example it is obvious that the
whole subtree is printed:
5.9.7.1. fdt addr - select FDT to work on 67