~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 36b8230877cc1d0be97d8cb91980be7213f23551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.. SPDX-License-Identifier: GPL-2.0+

fdt command
===========

Synopis
-------

::

    fdt addr [-cq] [addr [len]]

Description
-----------

The fdt command provides access to flat device tree blobs in memory. It has
many subcommands, some of which are not documented here.

Flags:

-c
    Select the control FDT (otherwise the working FDT is used).
-q
    Don't display errors

The control FDT is the one used by U-Boot itself to control various features,
including driver model. This should only be changed if you really know what you
are doing, since once U-Boot starts it maintains pointers into the FDT from the
various driver model data structures.

The working FDT is the one passed to the Operating System when booting. This
can be freely modified, so far as U-Boot is concerned, since it does not affect
U-Boot's operation.

fdt addr
~~~~~~~~

With no arguments, this shows the address of the current working or control
FDT.

If the `addr` argument is provided, then this sets the address of the working or
control FDT to the provided address.

If the `len` argument is provided, then the device tree is expanded to that
size. This can be used to make space for more nodes and properties. It is
assumed that there is enough space in memory for this expansion.

Example
-------

Get the control address and copy that FDT to free memory::

    => fdt addr -c
    Control fdt: 0aff9fd0
    => cp.b 0aff9fd0 10000 10000
    => md 10000 4
    00010000: edfe0dd0 5b3d0000 78000000 7c270000  ......=[...x..'|

The second word shows the size of the FDT. Now set the working FDT to that
address and expand it to 0xf000 in size::

    => fdt addr 10000 f000
    Working FDT set to 10000
    => md 10000 4
    00010000: edfe0dd0 00f00000 78000000 7c270000  ...........x..'|

Return value
------------

The return value $? indicates whether the command succeeded.