From patchwork Wed Apr 27 18:52:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 12829365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5361C433EF for ; Wed, 27 Apr 2022 18:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MsTfFqvRdzsjhqpM+YfBE0Ojr+A34aqXZgP6io23xB0=; b=fHZvYhq67fLMAX jrheC9Dmk5xZ2cmW9S8iMIsdpwyXH8m5L+cqmRHDjkcXEsJSoQB3o4/RfilzvKAPeoxBSmJNmjE1F 6Z7Pl728mUK62my5//5NlO6yVxbcePpddjofS8X/x/qs6QZ8ASSUjdHAzTkkDBB3d1s6u+JSx+kby TGivwUmDHxCDbAjC8XTcOxR1YgNsdZOpmkdo5qzIsWpASmOEHO7rMNDIH+hGlqb2ICzMqyED8VPu5 4ZNdMJbIfkEf/AabTNLc+yqujAwjxIvocHhle86O7A/Tp37Bo71jzT00U31rUL971udbNSQhZFf3H oFYeGuYaF3nkvzKzGPbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njmn8-0039sd-JQ; Wed, 27 Apr 2022 18:53:34 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njmmo-0039mE-RH; Wed, 27 Apr 2022 18:53:16 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: detlev) with ESMTPSA id 7E0CF1F44C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1651085593; bh=8vjtK1UfLIB91ege1gKuJlUretQNYk9Byb8qSHjd5g4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NhAkP6uyhRJ4v5WhCw8JWL+LAjgyXnc+JlM6riExVJGIPUyFsnm/LwDosb9lRaFZd OkHdx6rZkTg4icDQ1U+K9ELRLcS7X4ZhQseEDMsuN0nAfYMLAeZaUuAd8DMhTK9YZv jRhEANnLzzQ4bApObZTxTFKMrNxc6cUZW4J2A4geRuWJSY9xTznd/k+8XDrC9fKjaQ uJhPZnEiZEkxpNSPZec/75xvoakHcgVPG+sYHvHB4E9r8i9ROPioWFgmCz0y+DsNB0 ly4VDnhlNI2wAYvBDxj5MvetotNfjn5LpmGJCiYdA4iQKNfkbFtl6gTbj1m7dw9hlK Z1ddu3h+LIb/Q== From: Detlev Casanova 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 Subject: [RFC PATCH v2 2/3] of: Add support for -@ when compiling overlays Date: Wed, 27 Apr 2022 14:52:42 -0400 Message-Id: <20220427185243.173594-3-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220427185243.173594-1-detlev.casanova@collabora.com> References: <20220427185243.173594-1-detlev.casanova@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220427_115315_122725_35983B75 X-CRM114-Status: GOOD ( 15.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 $@