fdt.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. fdt command
  3. ===========
  4. Synopis
  5. -------
  6. ::
  7. fdt addr [-cq] [addr [len]]
  8. Description
  9. -----------
  10. The fdt command provides access to flat device tree blobs in memory. It has
  11. many subcommands, some of which are not documented here.
  12. Flags:
  13. -c
  14. Select the control FDT (otherwise the working FDT is used).
  15. -q
  16. Don't display errors
  17. The control FDT is the one used by U-Boot itself to control various features,
  18. including driver model. This should only be changed if you really know what you
  19. are doing, since once U-Boot starts it maintains pointers into the FDT from the
  20. various driver model data structures.
  21. The working FDT is the one passed to the Operating System when booting. This
  22. can be freely modified, so far as U-Boot is concerned, since it does not affect
  23. U-Boot's operation.
  24. fdt addr
  25. ~~~~~~~~
  26. With no arguments, this shows the address of the current working or control
  27. FDT.
  28. If the `addr` argument is provided, then this sets the address of the working or
  29. control FDT to the provided address.
  30. If the `len` argument is provided, then the device tree is expanded to that
  31. size. This can be used to make space for more nodes and properties. It is
  32. assumed that there is enough space in memory for this expansion.
  33. Example
  34. -------
  35. Get the control address and copy that FDT to free memory::
  36. => fdt addr -c
  37. Control fdt: 0aff9fd0
  38. => cp.b 0aff9fd0 10000 10000
  39. => md 10000 4
  40. 00010000: edfe0dd0 5b3d0000 78000000 7c270000 ......=[...x..'|
  41. The second word shows the size of the FDT. Now set the working FDT to that
  42. address and expand it to 0xf000 in size::
  43. => fdt addr 10000 f000
  44. Working FDT set to 10000
  45. => md 10000 4
  46. 00010000: edfe0dd0 00f00000 78000000 7c270000 ...........x..'|
  47. Return value
  48. ------------
  49. The return value $? indicates whether the command succeeded.