All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Casanova <detlev.casanova@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org, f.fainelli@gmail.com,
	frowand.list@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org, masahiroy@kernel.org,
	michal.lkml@markovi.net, ndesaulniers@google.com,
	nsaenz@kernel.org, olof@lixom.net, rjui@broadcom.com,
	robh+dt@kernel.org, sbranden@broadcom.com, soc@kernel.org,
	stefan.wahren@i2se.com,
	Detlev Casanova <detlev.casanova@collabora.com>
Subject: [RFC PATCH v2 2/3] of: Add support for -@ when compiling overlays
Date: Wed, 27 Apr 2022 14:52:42 -0400	[thread overview]
Message-ID: <20220427185243.173594-3-detlev.casanova@collabora.com> (raw)
In-Reply-To: <20220427185243.173594-1-detlev.casanova@collabora.com>

This commit adds an option to compile all device trees with -@ to add the
symbol table to the Device Tree Blobs.

It prepares the introduction of device tree overlays that are
not applied on device trees at compile time (dtbo files.)

These device tree overlays will be used by either a bootloader or a
linux userspace tool to extend the base device tree.

This is used e.g. for drivers that need device tree nodes for optional
non plug and play devices, like an external DSI touchscreen panel that
embeds different i2c devices to control it.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
 drivers/of/Kconfig   | 8 ++++++++
 scripts/Makefile.lib | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 80b5fd44ab1c..28cf8d18ac45 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -76,11 +76,19 @@ config OF_RESERVED_MEM
 config OF_RESOLVE
 	bool
 
+config OF_SYMBOLS
+	bool "Include device tree symbols"
+	help
+	  Loading a device tree overlay dynamically can require the base
+	  device tree symbols to be present.
+	  If this is enabled, the device tree blobs will be bigger.
+
 config OF_OVERLAY
 	bool "Device Tree overlays"
 	select OF_DYNAMIC
 	select OF_FLATTREE
 	select OF_RESOLVE
+	select OF_SYMBOLS
 	help
 	  Overlays are a method to dynamically modify part of the kernel's
 	  device tree with dynamically loaded data.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 79be57fdd32a..4c330e565297 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -319,8 +319,13 @@ endif
 
 DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
 
-# Set -@ if the target is a base DTB that overlay is applied onto
-DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
+ifeq ($(CONFIG_OF_SYMBOLS),y)
+	# Add symbols in all devicetrees
+	DTC_FLAGS += -@
+else
+	# Set -@ if the target is a base DTB that overlay is applied onto
+	DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
+endif
 
 # Generate an assembly file to wrap the output of the device tree compiler
 quiet_cmd_dt_S_dtb= DTB     $@
-- 
2.36.0


WARNING: multiple messages have this Message-ID (diff)
From: Detlev Casanova <detlev.casanova@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org, f.fainelli@gmail.com,
	frowand.list@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org, masahiroy@kernel.org,
	michal.lkml@markovi.net, ndesaulniers@google.com,
	nsaenz@kernel.org, olof@lixom.net, rjui@broadcom.com,
	robh+dt@kernel.org, sbranden@broadcom.com, soc@kernel.org,
	stefan.wahren@i2se.com,
	Detlev Casanova <detlev.casanova@collabora.com>
Subject: [RFC PATCH v2 2/3] of: Add support for -@ when compiling overlays
Date: Wed, 27 Apr 2022 14:52:42 -0400	[thread overview]
Message-ID: <20220427185243.173594-3-detlev.casanova@collabora.com> (raw)
In-Reply-To: <20220427185243.173594-1-detlev.casanova@collabora.com>

This commit adds an option to compile all device trees with -@ to add the
symbol table to the Device Tree Blobs.

It prepares the introduction of device tree overlays that are
not applied on device trees at compile time (dtbo files.)

These device tree overlays will be used by either a bootloader or a
linux userspace tool to extend the base device tree.

This is used e.g. for drivers that need device tree nodes for optional
non plug and play devices, like an external DSI touchscreen panel that
embeds different i2c devices to control it.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
 drivers/of/Kconfig   | 8 ++++++++
 scripts/Makefile.lib | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 80b5fd44ab1c..28cf8d18ac45 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -76,11 +76,19 @@ config OF_RESERVED_MEM
 config OF_RESOLVE
 	bool
 
+config OF_SYMBOLS
+	bool "Include device tree symbols"
+	help
+	  Loading a device tree overlay dynamically can require the base
+	  device tree symbols to be present.
+	  If this is enabled, the device tree blobs will be bigger.
+
 config OF_OVERLAY
 	bool "Device Tree overlays"
 	select OF_DYNAMIC
 	select OF_FLATTREE
 	select OF_RESOLVE
+	select OF_SYMBOLS
 	help
 	  Overlays are a method to dynamically modify part of the kernel's
 	  device tree with dynamically loaded data.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 79be57fdd32a..4c330e565297 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -319,8 +319,13 @@ endif
 
 DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
 
-# Set -@ if the target is a base DTB that overlay is applied onto
-DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
+ifeq ($(CONFIG_OF_SYMBOLS),y)
+	# Add symbols in all devicetrees
+	DTC_FLAGS += -@
+else
+	# Set -@ if the target is a base DTB that overlay is applied onto
+	DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
+endif
 
 # Generate an assembly file to wrap the output of the device tree compiler
 quiet_cmd_dt_S_dtb= DTB     $@
-- 
2.36.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-04-27 19:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 18:52 [RFC PATCH v2 0/3] ARM: dts: Support official Raspberry Pi 7inch touchscreen Detlev Casanova
2022-04-27 18:52 ` Detlev Casanova
2022-04-27 18:52 ` [RFC PATCH v2 1/3] ARM: dts: bcm2*: Demux i2c0 with a pinctrl Detlev Casanova
2022-04-27 18:52   ` Detlev Casanova
2022-04-27 18:52 ` Detlev Casanova [this message]
2022-04-27 18:52   ` [RFC PATCH v2 2/3] of: Add support for -@ when compiling overlays Detlev Casanova
2022-04-27 21:24   ` Rob Herring
2022-04-27 21:24     ` Rob Herring
2022-04-28  0:01     ` Florian Fainelli
2022-04-28  0:01       ` Florian Fainelli
2022-04-27 18:52 ` [RFC PATCH v2 3/3] ARM: dto: Add bcm2711-rpi-7-inches-ts.dts overlay Detlev Casanova
2022-04-27 18:52   ` Detlev Casanova
2022-04-27 21:16   ` Rob Herring
2022-04-27 21:16     ` Rob Herring
2022-04-28  6:44     ` Geert Uytterhoeven
2022-04-28  6:44       ` Geert Uytterhoeven
2022-04-28 14:26       ` Rob Herring
2022-04-28 14:26         ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2022-02-21 14:01 [RFC PATCH v2 0/3] ARM: dts: Support official Raspberry Pi 7inch touchscreen Detlev Casanova
2022-02-21 14:01 ` [RFC PATCH v2 2/3] of: Add support for -@ when compiling overlays Detlev Casanova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220427185243.173594-3-detlev.casanova@collabora.com \
    --to=detlev.casanova@collabora.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=nsaenz@kernel.org \
    --cc=olof@lixom.net \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=soc@kernel.org \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.