Allows telling dtc to emit the __symbols__ section in produced Device Tree Blobs, which in turn allows using overlay Device Tree Blobs which reference nodes from the base Device Tree using such symbols. This does not presume of what will apply the overlay (bootloader, kernel, fdtoverlay...). Signed-off-by: Vincent Pelletier <plr.vincent@xxxxxxxxx> --- drivers/of/Kconfig | 8 ++++++++ scripts/Makefile.lib | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 18450437d5d5..2f3db2241561 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -93,6 +93,14 @@ config OF_OVERLAY While this option is selected automatically when needed, you can enable it manually to improve device tree unit test coverage. +config OF_SYMBOLS + bool "Include symbols in generated Device Tree Blobs" + help + This option tells the Device Tree compiler to generate __symbols__ + sections in all produced Device Tree Blobs. + Useful for Device Tree overlays, be they applied by the kernel or by + a bootloader, at a slight increase in file size. + config OF_NUMA bool diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 213677a5ed33..402c2a5158db 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -299,6 +299,10 @@ endif DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) +ifeq ($(CONFIG_OF_SYMBOLS),y) +DTC_FLAGS += -@ +endif + # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_dt_S_dtb= DTB $@ cmd_dt_S_dtb= \ -- 2.30.0