mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH v3 8/8] dtc: optionally add add __symbols__ to build-in devicetree
Date: Fri, 13 Sep 2019 15:14:46 +0200	[thread overview]
Message-ID: <20190913131446.8202-9-m.tretter@pengutronix.de> (raw)
In-Reply-To: <20190913131446.8202-1-m.tretter@pengutronix.de>

The devicetree overlay driver requires the __symbols__ node to resolve
phandles to the base devicetree. If Barebox has to apply the overlay to
the live devicetree, the build-in devicetree must be built with the
__symbols__ node.

It is configurable, because adding __symbols__ significantly increases
the size of the devicetree binary. When configuring Barebox, a developer
should be able to enable or disable devicetree overlay support and as
this only affects the build-in devicetree, which is linked to the image
anyway, use a Kconfig item for configuring the __symbols__.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

---
Changelog:

v2->v3:
- make __symbols__ configurable

v1->v2: none
---
 drivers/of/Kconfig   | 17 +++++++++++++++++
 scripts/Makefile.lib |  4 ++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 1bb6639c5a..fd820b26f5 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -59,3 +59,20 @@ config OF_OVERLAY
 	  not patch the live devicetree, but applies the overlays as fixup to
 	  the devicetree. Furthermore, overlays cannot be removed after they
 	  have been applied.
+
+config OF_OVERLAY_LIVE
+	depends on OF_OVERLAY
+	default n
+	bool "Support devicetree overlays on live devicetree"
+	help
+	  This option allows to use devicetree overlays with the live
+	  devicetree. It is not required to apply overlays to any other
+	  devicetree.
+
+	  This builds the build-in devicetree with __symbols__, which
+	  significantly increases the size of the dtb file.
+
+	  Enable this option only if you actually need the live devicetree
+	  while applying in the devicetree overlay. This is usually the case if
+	  applying the overlay has other side effects than changing the
+	  devicetree.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index c4d307ae30..ad0484de3a 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -292,6 +292,10 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
 	 -Wno-unique_unit_address \
 	 -Wno-pci_device_reg
 
+ifeq ($(CONFIG_OF_OVERLAY_LIVE), 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 = $(srctree)/scripts/gen-dtb-s $(subst -,_,$(*F)) $< $(CONFIG_IMD) > $@
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-09-13 13:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 13:14 [PATCH v3 0/8] Device Tree Overlay Support Michael Tretter
2019-09-13 13:14 ` [PATCH v3 1/8] of: add support for devicetree overlays Michael Tretter
2019-09-13 13:14 ` [PATCH v3 2/8] blspec: " Michael Tretter
2019-09-13 13:14 ` [PATCH v3 3/8] of: add iterator for overlays Michael Tretter
2019-09-13 13:14 ` [PATCH v3 4/8] firmware: add function to find firmware by devicetree node Michael Tretter
2019-09-13 13:14 ` [PATCH v3 5/8] firmware: add support to load firmware from dt overlay Michael Tretter
2019-09-13 13:14 ` [PATCH v3 6/8] blspec: load firmware if specified in " Michael Tretter
2019-09-13 13:14 ` [PATCH v3 7/8] commands: add of_overlay command for device tree overlays Michael Tretter
2019-09-13 13:14 ` Michael Tretter [this message]
2019-09-16  7:07 ` [PATCH v3 0/8] Device Tree Overlay Support Sascha Hauer

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=20190913131446.8202-9-m.tretter@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox