diff options
author | Simon Glass <sjg@chromium.org> | 2021-02-03 06:01:13 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-22 19:23:27 +1300 |
commit | 5a1b25c2011e88e44626202f3cde05e65209c1e4 (patch) | |
tree | 2801507264a338025303893238203943adbb39ad | |
parent | 4a092350d18d1aea637de6be8802a9de0cca194f (diff) | |
download | u-boot-5a1b25c2011e88e44626202f3cde05e65209c1e4.zip u-boot-5a1b25c2011e88e44626202f3cde05e65209c1e4.tar.gz u-boot-5a1b25c2011e88e44626202f3cde05e65209c1e4.tar.bz2 |
dm: of-platadata: Add option for device instantiation
Add Kconfig options to support build-time device instantiation. When
fully implemented, this will allow dtoc to create U-Boot devices (i.e.
struct udevice records) at build time, thus reducing code space in
SPL.
For now this defaults to off, but will be enabled when the rest of
the implementation is in place.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | dts/Kconfig | 23 | ||||
-rw-r--r-- | scripts/Makefile.spl | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/dts/Kconfig b/dts/Kconfig index 00ac29a..c39cc36 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -355,15 +355,24 @@ config SPL_OF_PLATDATA compatible string, then adding platform data and U_BOOT_DRVINFO declarations for each node. See of-plat.txt for more information. +if SPL_OF_PLATDATA + config SPL_OF_PLATDATA_PARENT bool "Support parent information in devices" - depends on SPL_OF_PLATDATA default y help Generally it is useful to be able to access the parent of a device with of-platdata. To save space this can be disabled, but in that case dev_get_parent() will always return NULL; +config SPL_OF_PLATDATA_INST + bool "Declare devices at build time" + help + Declare devices as udevice instances so that they do not need to be + bound when U-Boot starts. This can save time and code space. + +endif + config TPL_OF_PLATDATA bool "Generate platform data for use in TPL" depends on TPL_OF_CONTROL @@ -385,13 +394,23 @@ config TPL_OF_PLATDATA compatible string, then adding platform data and U_BOOT_DRVINFO declarations for each node. See of-plat.txt for more information. +if TPL_OF_PLATDATA + config TPL_OF_PLATDATA_PARENT bool "Support parent information in devices" - depends on TPL_OF_PLATDATA default y help Generally it is useful to be able to access the parent of a device with of-platdata. To save space this can be disabled, but in that case dev_get_parent() will always return NULL; +config TPL_OF_PLATDATA_INST + bool "Declare devices at build time" + + help + Declare devices as udevice instances so that they do not need to be + bound when U-Boot starts. This can save time and code space. + +endif + endmenu diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index bfae9a4..f3bb793 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -313,6 +313,10 @@ pythonpath = PYTHONPATH=scripts/dtc/pylibfdt DTOC_ARGS := $(pythonpath) $(srctree)/tools/dtoc/dtoc \ -d $(obj)/$(SPL_BIN).dtb -p $(SPL_NAME) +ifneq ($(CONFIG_$(SPL_TPL_)OF_PLATDATA_INST),) +DTOC_ARGS += -i +endif + quiet_cmd_dtoc = DTOC $@ cmd_dtoc = $(DTOC_ARGS) -c $(obj)/dts -C include/generated all |