[PATCH] dts: Make it easier to enable __symbols__ generation in dtb files

From: Tom Rini
Date: Wed Aug 16 2017 - 20:35:11 EST


This introduces the variabe DTC_EXTRA_FLAGS to allow for additional
flags to be passed to dtc. While this can have many uses (such as
easier testing of new warning flags) the use case I wish to spell out
here is passing of -@ to enable __symbols__ to be included in the
resulting dtb and thus 'stacked' overlays to be able to be used.

When passing in -@ this will increase the size of the dtb (and resident
memory usage) in exchange for allowing more types of overlays to be
applied to the dtb file prior to passing it to Linux and additional
functionality within the kernel when OF_OVERLAY is enabled and in tools
outside of the kernel.

Cc: Jason Kridner <jkridner@xxxxxxxxxxxxxxx>
Cc: Drew Fustini <drew@xxxxxxxxxxxxxxx>
Cc: Robert Nelson <robertcnelson@xxxxxxxxx>
Cc: Lokesh Vutla <lokeshvutla@xxxxxx>
Cc: Frank Rowand <frowand.list@xxxxxxxxx>
Cc: Rob Herring <robh+dt@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Russell King <linux@xxxxxxxxxxxxxxx>
Cc: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Cc: Michal Marek <mmarek@xxxxxxxx>
CC: linux-kbuild@xxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Tom Rini <trini@xxxxxxxxxxxx>
---
This would be v3 of my attempt to enable __symbols__ more widely (v2,
for people not on the CC, enabled it always, but for some boards).

To be clear, this version of the patch is more flexible in that it
allows for arbitrary flags to be passed to dtc, which can have other
uses. But, I'm still spelling out -@ being the motivation behind this
for clarity. Both Frank and Rob were uncomfortable with v2, and Frank
suggested this approach to make it easier for users / distributions /
etc to opt-in to this functionality. For clarity, Frank was suggesting
(at least at first) perhaps also a tie-in CONFIG option, which I have
not done here as I feel that's adding extra hurdles to something that
must already be opt-in. Given that today many of the immediate uses are
for "pre-boot" application of overlays (SoM + carrier + add-ons or EVM +
LCD for example), I believe this is an acceptable trade-off to make
currently.
---
scripts/Makefile.lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 58c05e5d9870..04434ffe3370 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -293,7 +293,7 @@ DTC_FLAGS += -Wnode_name_chars_strict \
-Wproperty_name_chars_strict
endif

-DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
+DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) $(DTC_EXTRA_FLAGS)

# Generate an assembly file to wrap the output of the device tree compiler
quiet_cmd_dt_S_dtb= DTB $@
--
1.9.1