From patchwork Tue Aug 15 21:15:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 9902551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CAE16028A for ; Tue, 15 Aug 2017 21:15:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 568C528429 for ; Tue, 15 Aug 2017 21:15:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3867F2892E; Tue, 15 Aug 2017 21:15:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 913AA28429 for ; Tue, 15 Aug 2017 21:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751569AbdHOVPl (ORCPT ); Tue, 15 Aug 2017 17:15:41 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:34688 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbdHOVPk (ORCPT ); Tue, 15 Aug 2017 17:15:40 -0400 Received: by mail-yw0-f195.google.com with SMTP id t139so1219778ywg.1; Tue, 15 Aug 2017 14:15:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jKpwf+VUNCdipfQMHDO8rg1JdCmPaFsHFJkCBEBXLBg=; b=HFDPrefY029gYS5xVXL8Am3isYE1ZwJB2zLEa05PeohWDbkpehxyOk6tQjc/BA9ti/ wbUd8LFzfs4FtwsB0pvzLBbs8nDjPpcSen2fQILTd3EpRE9tUVitDJb4C3aivYIOwywM K5MiDSTK0YmBuBYk2xTNnYH+I+pgRFvvIcjbHS8f7ph/XeF9/GMAMeTwci6gAAwuCUIc wKWIih2e9CG2ymDA8Waagcbx3E3l8Gf3d00YWTjFW95TQMaJ1mLcILuLBmTNdm6+WyAb 71Hzwk+iFVt7l8b/rJfhGSd4kFLWxMtY7bmbm41/Nbjcles014gOp/cEmZ59uHYQfZ8w lklg== X-Gm-Message-State: AHYfb5hddI4OGfUxL/e1mvMAqwcj78+WowI/YL/wsA0fxEqpG6IgTdnW DKpA19jodwnsEwQ8 X-Received: by 10.129.153.86 with SMTP id q83mr25399702ywg.277.1502831739211; Tue, 15 Aug 2017 14:15:39 -0700 (PDT) Received: from localhost.localdomain (cpe-174-106-0-58.ec.res.rr.com. [174.106.0.58]) by smtp.gmail.com with ESMTPSA id y8sm3975100ywg.102.2017.08.15.14.15.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Aug 2017 14:15:38 -0700 (PDT) From: Tom Rini To: devicetree@vger.kernel.org Cc: Tero Kristo , Nishanth Menon , Tomi Valkeinen , Sekhar Nori , Rob Herring , Frank Rowand , Masahiro Yamada , Michal Marek , Pantelis Antoniou , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH] devicetree: Enable generation of __symbols__ in all dtb files Date: Tue, 15 Aug 2017 17:15:36 -0400 Message-Id: <1502831736-28282-1-git-send-email-trini@konsulko.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With support for stacked overlays being part of libfdt it is now possible and likely that overlays which require __symbols__ will be applied to the dtb files generated by the kernel. This is done by passing -@ to dtc. This does increase the filesize (and resident memory usage) based on the number of __symbol__ entries added to match the contents of the dts. Cc: Rob Herring Cc: Frank Rowand Cc: Masahiro Yamada Cc: Michal Marek Cc: Pantelis Antoniou Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org CC: linux-kbuild@vger.kernel.org Signed-off-by: Tom Rini --- In order for a dtb file to be useful with all types of overlays, it needs to be generated with the -@ flag passed to dtc so that __symbols__ are generated. This however is not free, and increases the resulting dtb file by up to approximately 50% today. In the current worst case this is moving from 88KiB to 133KiB. In talking with Frank about this, he outlined 3 possible ways (with the 4th option of something else entirely). 1. Make passing -@ to dtc be dependent upon some CONFIG symbol. 2. In the kernel, if the kernel does not have overlay support, discard the __symbols__ information that we've been passed. 3. Have the bootloader pass in, or not, __symbols__ information. This patch is an attempt to implement something between the 3rd option and a different, 4th option. Frank was thinking that we might introduce a new symbol to control generation of __symbol__ information for option 1. I think this gets the usage backwards and will lead to confusion among users and developers. My proposal is that we do not want __symbols__ existence to be dependent on some part of the kernel configuration for a number of reasons. First, this is out of step with the rest of how dtbs are created today and more importantly, thought about. Today, all dtb content is independent of CONFIG options. If you build a dtb from a given kernel tree, everyone will agree on the result. This is part of the "contract" on passing old kernels and new dtb files even. Second, I think this is out of step with how a lot of overlay usage will occur. My thinking is that with maximally useful overlays being available in mainline, lots of use-cases that we have today that result in a number of DTS files being included can become just overlays. This is true in terms of not only evaluation kits but also when these systems are turned into custom hardware. This is even more true for SoM based systems where a physical widget would be a SoM + carrier overlay + custom parts overlay. These cases are going to be resolved with overlays being applied outside of the kernel. Signed-off-by: Tom Rini --- drivers/of/unittest-data/Makefile | 5 ----- scripts/Makefile.lib | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index 6e00a9c69e58..70731cfe8900 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -11,8 +11,3 @@ targets += overlay_base.dtb overlay_base.dtb.S .PRECIOUS: \ $(obj)/%.dtb.S \ $(obj)/%.dtb - -# enable creation of __symbols__ node -DTC_FLAGS_overlay := -@ -DTC_FLAGS_overlay_bad_phandle := -@ -DTC_FLAGS_overlay_base := -@ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 58c05e5d9870..a1f4a6b29d75 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -293,6 +293,9 @@ DTC_FLAGS += -Wnode_name_chars_strict \ -Wproperty_name_chars_strict endif +# enable creation of __symbols__ node +DTC_FLAGS += -@ + DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) # Generate an assembly file to wrap the output of the device tree compiler