Skip to main content.
Navigation:
DENX
>
DULG
>
UBootCmdFDT
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=UBootCmdFDT}% Flattened Device Tree support U-Boot is capable of quite comprehensive handling of the flattened device tree blob, implemented by the =fdt= family of commands: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdHelp}% %SECTION1{name=UBootCmdFDTAddr}% 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: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdAddr}% %SECTION1{name=UBootCmdFDTPrint}% 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: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdList}% %SECTION1{name=UBootCmdFDTPrint}% 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: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdPrint}% %SECTION1{name=UBootCmdFDTCreateNode}% fdt mknode - create new nodes =fdt mknode= can be used to attach a new node to the tree. We will use the =fdt list= command to verify that the new node has been created and that it is empty: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdCreateNode}% %SECTION1{name=UBootCmdFDTCmdCreateProperty}% fdt set - set node properties Now, let's create a property at the newly created node; again we'll use =fdt list= for verification: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdCreateProperty}% %SECTION1{name=UBootCmdFDTCmdRemove}% fdt rm - remove nodes or properties The =fdt rm= command is used to remove nodes and properties. Let's delete the test property created in the previous paragraph and verify the results: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdRemove}% %SECTION1{name=UBootCmdFDTCmdMove}% fdt move - move FDT blob to new address To move the blob from one memory location to another we will use the =fdt move= command. Besides moving the blob, it makes the new address the "active" one - similar to =fdt addr=: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdMove}% %SECTION1{name=UBootCmdFDTCmdChosen}% fdt chosen - fixup dynamic info One of the modifications made by U-Boot to the blob before passing it to the kernel is the addition of the =/chosen= node. Linux 2.6 Documentation/powerpc/booting-without-of.txt says that this node is used to store "some variable environment information, like the arguments, or the default input/output devices." To force U-Boot to add the =/chosen= node to the current blob, =fdt chosen= command can be used. Let's now verify its operation: %INCLUDE{DULGData_%BOARD%.UBootFDTCmdChosen}% Note: =fdt boardsetup= performs board-specific blob updates, most commonly setting clock frequencies, etc. Discovering its operation is left as an excercise for the reader.
5.9.6. Environment Variables Commands
1. Abstract
5.9.8. Special Commands
Prev
Home
Next