summaryrefslogtreecommitdiff
path: root/doc/develop
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-09-22 14:54:21 -0400
committerTom Rini <[email protected]>2021-09-22 14:54:21 -0400
commit63823da4b9e25d2f6a81f1e9adb06391837055cb (patch)
tree3ee694f9c5342307b1bbb4123276a5eeff77d57f /doc/develop
parent44131caa4025455a659e958281f0e337bdf83f89 (diff)
parent121a165c51cd281e61c9d45c3919608af42ca9cd (diff)
Merge branch '2021-09-22-general-updates' into next
- Some sandbox improvements - Make cleanups related to the overusage of the exact build time variable.
Diffstat (limited to 'doc/develop')
-rw-r--r--doc/develop/driver-model/of-plat.rst92
-rw-r--r--doc/develop/version.rst21
2 files changed, 100 insertions, 13 deletions
diff --git a/doc/develop/driver-model/of-plat.rst b/doc/develop/driver-model/of-plat.rst
index 8a8eaed4c11..0bd978759c7 100644
--- a/doc/develop/driver-model/of-plat.rst
+++ b/doc/develop/driver-model/of-plat.rst
@@ -600,6 +600,11 @@ as a macro included in the driver definition::
Problems
--------
+This section shows some common problems and how to fix them.
+
+Driver not found
+~~~~~~~~~~~~~~~~
+
In some cases you will you see something like this::
WARNING: the driver rockchip_rk3188_grf was not found in the driver list
@@ -633,6 +638,9 @@ the devicetree. For example, if the devicetree has::
then dtoc looks at the first compatible string ("rockchip,rk3188-grf"),
converts that to a C identifier (rockchip_rk3188_grf) and then looks for that.
+Missing .compatible or Missing .id
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
Various things can cause dtoc to fail to find the driver and it tries to
warn about these. For example:
@@ -649,6 +657,82 @@ Checks are also made to confirm that the referenced driver has a .compatible
member and a .id member. The first provides the array of compatible strings and
the second provides the uclass ID.
+Missing parent
+~~~~~~~~~~~~~~
+
+When a device is used, its parent must be present as well. If you see an error
+like::
+
+ Node '/i2c@0/emul/emul0' requires parent node '/i2c@0/emul' but it is not in
+ the valid list
+
+it indicates that you are using a node whose parent is not present in the
+devicetree. In this example, if you look at the device tree output
+(e.g. fdtdump tpl/u-boot-tpl.dtb in your build directory), you may see something
+like this::
+
+ emul {
+ emul0 {
+ compatible = "sandbox,i2c-rtc-emul";
+ #emul-cells = <0x00000000>;
+ phandle = <0x00000003>;
+ };
+ };
+
+In this example, 'emul0' exists but its parent 'emul' has no properties. These
+have been dropped by fdtgrep in an effort to reduce the devicetree size. This
+indicates that the two nodes have different phase settings. Looking at the
+source .dts::
+
+ i2c_emul: emul {
+ u-boot,dm-spl;
+ reg = <0xff>;
+ compatible = "sandbox,i2c-emul-parent";
+ emul0: emul0 {
+ u-boot,dm-pre-reloc;
+ compatible = "sandbox,i2c-rtc-emul";
+ #emul-cells = <0>;
+ };
+ };
+
+you can see that the child node 'emul0' usees 'u-boot,dm-pre-reloc', indicating
+that the node is present in all SPL builds, but its parent uses 'u-boot,dm-spl'
+indicating it is only present in SPL, not TPL. For a TPL build, this will fail
+with the above message. The fix is to change 'emul0' to use the same
+'u-boot,dm-spl' condition, so that it is not present in TPL, like its parent.
+
+Link errors / undefined reference
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sometimes dtoc does not find the problem for you, but something is wrong and
+you get a link error, e.g.::
+
+ :(.u_boot_list_2_udevice_2_spl_test5+0x0): undefined reference to
+ `_u_boot_list_2_driver_2_sandbox_spl_test'
+ /usr/bin/ld: dts/dt-uclass.o:(.u_boot_list_2_uclass_2_misc+0x8):
+ undefined reference to `_u_boot_list_2_uclass_driver_2_misc'
+
+The first one indicates that the device cannot find its driver. This means that
+there is a driver 'sandbox_spl_test' but it is not compiled into the build.
+Check your Kconfig settings to make sure it is. If you don't want that in the
+build, adjust your phase settings, e.g. by using 'u-boot,dm-spl' in the node
+to exclude it from the TPL build::
+
+ spl-test5 {
+ u-boot,dm-tpl;
+ compatible = "sandbox,spl-test";
+ stringarray = "tpl";
+ };
+
+We can drop the 'u-boot,dm-tpl' line so this node won't appear in the TPL
+devicetree and thus the driver won't be needed.
+
+The second error above indicates that the MISC uclass is needed by the driver
+(since it is in the MISC uclass) but that uclass is not compiled in the build.
+The fix above would fix this error too. But if you do want this uclass in the
+build, check your Kconfig settings to make sure the uclass is being built
+(CONFIG_MISC in this case).
+
Caveats
-------
@@ -697,7 +781,7 @@ Internals
---------
Generated files
-```````````````
+~~~~~~~~~~~~~~~
When enabled, dtoc generates the following five files:
@@ -738,7 +822,7 @@ spl/dt-plat.c.
CONFIG options
-``````````````
+~~~~~~~~~~~~~~
Several CONFIG options are used to control the behaviour of of-platdata, all
available for both SPL and TPL:
@@ -793,7 +877,7 @@ READ_ONLY
the nodes cannot be updated, OF_PLATDATA_NO_BIND is enabled.
Data structures
-```````````````
+~~~~~~~~~~~~~~~
A few extra data structures are used with of-platdata:
@@ -821,7 +905,7 @@ A few extra data structures are used with of-platdata:
`device_get_by_ofplat_idx()`.
Other changes
-`````````````
+~~~~~~~~~~~~~
Some other changes are made with of-platdata:
diff --git a/doc/develop/version.rst b/doc/develop/version.rst
index 066901bcd2d..8f3231b7611 100644
--- a/doc/develop/version.rst
+++ b/doc/develop/version.rst
@@ -60,15 +60,6 @@ The following are available:
This is used as part of the banner string when U-Boot starts.
- U_BOOT_VERSION_STRING (string #define)
- U_BOOT_VERSION followed by build-time information
- and CONFIG_IDENT_STRING.
-
- Examples::
-
- U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
- U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
-
U_BOOT_VERSION_NUM (integer #define)
Release year, e.g. 2021 for release 2021.01. Note
this is an integer, not a string.
@@ -77,6 +68,18 @@ The following are available:
Patch number, e.g. 1 for release 2020.01. Note
this is an integer, not a string.
+Human readable U-Boot version string is available in header file
+include/version_string.h in following variable:
+
+ version_string (const char[])
+ U_BOOT_VERSION followed by build-time information
+ and CONFIG_IDENT_STRING.
+
+ Examples::
+
+ U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
+ U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
+
Build date/time is also included. See the generated file
include/generated/timestamp_autogenerated.h for the available
fields. For example::