fdt命令的使用


官方参考:https://www.denx.de/wiki/DULG/UBootCmdFDT

U_BOOT_CMD(
	fdt,	255,	0,	do_fdt,
	"flattened device tree utility commands",
	    "addr    []        - Set the fdt location to \n"
#ifdef CONFIG_OF_BOARD_SETUP
	"fdt boardsetup                      - Do board-specific set up\n"
#endif
	"fdt move      - Copy the fdt to  and make it active\n"
	"fdt resize                          - Resize fdt to size + padding to 4k addr\n"
	"fdt print   []          - Recursive print starting at \n"
	"fdt list    []          - Print one level starting at \n"
	"fdt set      []    - Set  [to ]\n"
	"fdt mknode              - Create a new node after \n"
	"fdt rm      []          - Delete the node or \n"
	"fdt header                          - Display header info\n"
	"fdt bootcpu                     - Set boot cpuid\n"
	"fdt memory              - Add/Update memory node\n"
	"fdt rsvmem print                    - Show current mem reserves\n"
	"fdt rsvmem add          - Add a mem reserve\n"
	"fdt rsvmem delete            - Delete a mem reserves\n"
	"fdt chosen [ ]          - Add/update the /chosen branch in the tree\n"
	"                                        / - initrd start/end addr\n"
	"NOTE: Dereference aliases by omiting the leading '/', "
		"e.g. fdt print ethernet0."
);


示例:

1. 首先将dtb文件上传

tftpboot 0x84000000 board.dtb


2.设置fdt的地址

fdt addr 0x84000000


3. 打印header信息

fdt header


4.打印/

fdt print /


你可能感兴趣的:(OpenWrt,Linux)