From 3e9fddfc4f146f3a64c935024f5e1918790d2777 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 1 Aug 2021 18:57:10 -0600 Subject: doc: Move devicetree control doc to rST Move this to rST format, largely unchanged to start with. Add an index for this topic, as well as an empty intro. Note this patch does not include updates! Is it just a conversion to the new format. See the next patch. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchart --- doc/develop/devicetree/intro.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/develop/devicetree/intro.rst (limited to 'doc/develop/devicetree/intro.rst') diff --git a/doc/develop/devicetree/intro.rst b/doc/develop/devicetree/intro.rst new file mode 100644 index 00000000000..344851327c7 --- /dev/null +++ b/doc/develop/devicetree/intro.rst @@ -0,0 +1,4 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Devicetree Introduction +======================= -- cgit v1.2.3 From 6a055c0f91418b78949b901147a63f2a4e26c9ab Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 1 Aug 2021 18:57:12 -0600 Subject: doc: Add a note about why devicetree is used This question comes up every now and then with people coming from Linux. Add some notes about it so we can point to it in the mailing list. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- doc/develop/devicetree/intro.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'doc/develop/devicetree/intro.rst') diff --git a/doc/develop/devicetree/intro.rst b/doc/develop/devicetree/intro.rst index 344851327c7..36e8cc0d440 100644 --- a/doc/develop/devicetree/intro.rst +++ b/doc/develop/devicetree/intro.rst @@ -2,3 +2,43 @@ Devicetree Introduction ======================= + +U-Boot uses a devicetree for configuration. This includes the devices used by +the board, the format of the image created with binman, which UART to use for +the console, public keys used for secure boot and many other things. + +See :doc:`control` for more information. + +Why does U-Boot put in the devicetree? +---------------------------------------------- + +This question comes up a lot with people new to U-Boot, particular those coming +from Linux who are used to quite strict rules about what can go into the +devicetree. + +U-Boot uses the same devicetree as Linux but adds more things necessary for the +bootloader environment (see :ref:`dttweaks`). + +U-Boot does not have a user space to provide policy and configuration. It cannot +do what Linux does and run programs and look up filesystems to figure out how to +boot. So configuration and runtime information goes into the devicetree in +U-Boot. + +Of course it is possible to: + +- add tables into the rodata section of the U-Boot binary +- append some info to the end of U-Boot in a different format +- modify the linker script to bring in a file with some info in it +- put things in ACPI tables +- link in a UEFI hand-off block structure and put things in there + +but *please don't*. In general, devicetree is the sane place to hold U-Boot's +configuration. + +So, please, do NOT ask why U-Boot puts in the devicetree. It is the only +place it can go. It is a highly suitable data structure for just about anything +that U-Boot needs to know at runtime. + +Note, it is possible to use platdata directly so drivers avoid devicetreee in +SPL. But of-platdata is the modern way of avoiding devicetree overhead, so +please use that instead. -- cgit v1.2.3