aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-07-27 06:59:55 -0400
committerTom Rini <trini@konsulko.com>2022-07-27 06:59:55 -0400
commit7277c4bddceb6b8a59ba47b8b111ab070d86919f (patch)
tree0bd1db6551763d178d25e80a350be458150c9e8e /doc
parent81e712a91729950fbd8fb38a6f729cb9847b0adb (diff)
parentdce4322c0e1940e11ef9ff086890b8c474707317 (diff)
downloadu-boot-7277c4bddceb6b8a59ba47b8b111ab070d86919f.zip
u-boot-7277c4bddceb6b8a59ba47b8b111ab070d86919f.tar.gz
u-boot-7277c4bddceb6b8a59ba47b8b111ab070d86919f.tar.bz2
Merge tag 'dm-pull-26jul22' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git
minor dm- and fdt-related fixes start of test for fdt command
Diffstat (limited to 'doc')
-rw-r--r--doc/develop/logging.rst19
-rw-r--r--doc/usage/cmd/fdt.rst69
-rw-r--r--doc/usage/index.rst1
3 files changed, 77 insertions, 12 deletions
diff --git a/doc/develop/logging.rst b/doc/develop/logging.rst
index 51095b0..704a6bf 100644
--- a/doc/develop/logging.rst
+++ b/doc/develop/logging.rst
@@ -66,26 +66,21 @@ Sometimes it is useful to turn on logging just in one file. You can use this
#define LOG_DEBUG
to enable building in of all logging statements in a single file. Put it at
-the top of the file, before any #includes.
-
-To actually get U-Boot to output this you need to also set the default logging
-level - e.g. set CONFIG_LOG_DEFAULT_LEVEL to 7 (:c:data:`LOGL_DEBUG`) or more.
-Otherwise debug output is suppressed and will not be generated.
+the top of the file, before any #includes and any message in the file will be
+written, regardless of the value of CONFIG_LOG_DEFAULT_LEVEL.
Using DEBUG
-----------
U-Boot has traditionally used a #define called DEBUG to enable debugging on a
-file-by-file basis. The debug() macro compiles to a printf() statement if
-DEBUG is enabled, and an empty statement if not.
+file-by-file basis but LOG_DEBUG are intended to replace it with the logging
+facilities; DEBUG is activated when LOG_DEBUG is activated.
With logging enabled, debug() statements are interpreted as logging output
-with a level of LOGL_DEBUG and a category of LOGC_NONE.
+with a level of LOGL_DEBUG and a category of LOG_CATEGORY.
-The logging facilities are intended to replace DEBUG, but if DEBUG is defined
-at the top of a file, then it takes precedence. This means that debug()
-statements will result in output to the console and this output will not be
-logged.
+With logging disabled, the debug() macro compiles to a printf() statement
+if DEBUG is enabled and to an empty statement if not.
Logging statements
------------------
diff --git a/doc/usage/cmd/fdt.rst b/doc/usage/cmd/fdt.rst
new file mode 100644
index 0000000..07fed73
--- /dev/null
+++ b/doc/usage/cmd/fdt.rst
@@ -0,0 +1,69 @@
+.. 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
+ => md 10000 4
+ 00010000: edfe0dd0 00f00000 78000000 7c270000 ...........x..'|
+
+Return value
+------------
+
+The return value $? indicates whether the command succeeded.
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index 8b98629..16a3db5 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -43,6 +43,7 @@ Shell commands
cmd/false
cmd/fatinfo
cmd/fatload
+ cmd/fdt
cmd/for
cmd/load
cmd/loadm