diff options
author | Simon Glass <sjg@chromium.org> | 2020-10-03 11:31:41 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-10-29 14:42:59 -0600 |
commit | cb43ac184f71f0ba696d0effcd39a746a6f3a456 (patch) | |
tree | d5b5f9b1eaa240b004ac1fd77ddc1bfe5323d1e1 /tools | |
parent | 4e28a259fd3a2025f42ad005b375aea2912c81de (diff) | |
download | u-boot-cb43ac184f71f0ba696d0effcd39a746a6f3a456.tar.gz |
dm: Don't allow U_BOOT_DEVICE() when of-platdata is used
With of-platdata, the devicetree is supposed to specify all the devices
in the system. So far this hasn't really mattered since of-platdata still
works correctly.
However, new of-platdata features rely on numbering the devices in a
particular order so that they can be referenced by a single integer. It is
tricky to implement this efficiently when other devices are present in the
build.
To address this, disable use of U_BOOT_DEVICE() when of-platdata is
enabled. This seems acceptable as it is not supposed to be used at all,
except in SPL/TPL, where of-platdata is the recommended approach.
This breaks one non-compliant boards at present: mx6cuboxi
Signed-off-by: Simon Glass <sjg@chromium.org>
(disable CONFIG_IMX_THERMAL for mx6cuboxi to avoid a build error)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dtoc/dtb_platdata.py | 3 | ||||
-rwxr-xr-x | tools/dtoc/test_dtoc.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 2be11fff6c..9b27aecc14 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -673,6 +673,9 @@ class DtbPlatdata(object): information. """ self.out_header() + self.out('/* Allow use of U_BOOT_DEVICE() in this file */\n') + self.out('#define DT_PLATDATA_C\n') + self.out('\n') self.out('#include <common.h>\n') self.out('#include <dm.h>\n') self.out('#include <dt-structs.h>\n') diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index 8e16dc0f0f..a5836e04b7 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -44,6 +44,9 @@ C_HEADER = '''/* * This file was generated by dtoc from a .dtb (device tree binary) file. */ +/* Allow use of U_BOOT_DEVICE() in this file */ +#define DT_PLATDATA_C + #include <common.h> #include <dm.h> #include <dt-structs.h> |