Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3839420ybl; Tue, 21 Jan 2020 08:01:07 -0800 (PST) X-Google-Smtp-Source: APXvYqx7g3gep9TiUA5uDrqPr9BVfFii280SFYuH2qU51LJLC1Xh964VBjEaT849DsDlYoqbMDgI X-Received: by 2002:a9d:6745:: with SMTP id w5mr4140429otm.52.1579622467077; Tue, 21 Jan 2020 08:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579622467; cv=none; d=google.com; s=arc-20160816; b=0WmzKEfbjgNSgO2FFHeoTCs4vo+lnuQQvj62uf7d4hxjy6iuEfTuYngGljupUkMrf0 +w2x1mom0AUmcBNr9Q54ez7/8eg9uRafIkmVTXWcywKz0qY6+ae6aYs32GnvSAmNxDY1 jWZAEC3P+Voz+MGuPCvIoAu17WpBobROjSXrv46vG2vr+JqcO0V0MfXQbXLNDGJHYj6q JyRArZAAkd8Zkb75VyV+x5nixITOscmsFoPzOsuBOuFBbk8DTDmxMFnoztuiPIBwqJWp oBO99EvJX15DorAXttIJOPnOjxFn6gmzUy0zQuAXILORlqjSuKlydwqULi4V4cNbW4k+ WVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0OA/PN0WMBjKy3dKbM9vhOgwSMENFpISJrJHZ/LYrk0=; b=xJCW2St/1ktmNiblsymtugke+BK0yX/jcCYN+ktfVGFeEhrmCsV1+xdiNN1qzXwxHJ FP/gtamcXkUIYrz6sWCqnUrdrjKStDwZnQIc2F3ajIjTq+PTSizE1YxWGGbQQxX0/OVK zptYtW1yGTkGzRQDSmf412M7zE+u1gdB3L0onH2V4zgZuqZA57+PVP0Zp0S6sxOQ2zNC 7vNEVrny4mFr47QEOp/RcnKa5Z4j+T4/7Z+5CSfsArpmCfzWb0lAX/Y8KNOK2+GIIMIX r5yFd40jOABChQ1tMfCwZM+Mhzd1mXyGw3KVk75K1g4ByRHf3LztmJaItkK7GK9YDmoE 8Wzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EhsEHuxD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si20986592otl.60.2020.01.21.08.00.53; Tue, 21 Jan 2020 08:01:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EhsEHuxD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729184AbgAUP77 (ORCPT + 99 others); Tue, 21 Jan 2020 10:59:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:40928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728852AbgAUP77 (ORCPT ); Tue, 21 Jan 2020 10:59:59 -0500 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADE6B21569; Tue, 21 Jan 2020 15:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579622397; bh=ryf1s+gQkLfUmVXGBywSimmGcdpJgK+HxZZJfSBIFhA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EhsEHuxDhVOLCiO1c7kh12A+l2iwiN/13+hO4LTeGIvXKRDRuaxsOicJ6oOPUFfDb Glz7zIZlaURfw/ONUFMCKP7zO2FoHAQCimn+hedNDRiHqGoQWze21cK/nOR8vFdKAN Rhg8ITcOa+hLH7VCYmc7rARBIcyb3veYEq5gycIA= Received: by mail-qt1-f172.google.com with SMTP id c24so3002255qtp.5; Tue, 21 Jan 2020 07:59:57 -0800 (PST) X-Gm-Message-State: APjAAAV3NSd3hGwoIkkfpmk9ubk9fpbIfmKn96JivlCPEpZFkvfWxAQz 2jSeT7p2f1zJfQoi58LB8shVYWx9Cu6tZzMoyw== X-Received: by 2002:ac8:1415:: with SMTP id k21mr5218660qtj.300.1579622396814; Tue, 21 Jan 2020 07:59:56 -0800 (PST) MIME-Version: 1.0 References: <20200113181625.3130-1-alexandre.torgue@st.com> <20200113181625.3130-2-alexandre.torgue@st.com> <20200116005741.GB54439@umbus> <20200117090937.GU54439@umbus> <20200119063916.GD54439@umbus> In-Reply-To: <20200119063916.GD54439@umbus> From: Rob Herring Date: Tue, 21 Jan 2020 09:59:44 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/3] dtc: Add dtb build information option To: David Gibson Cc: Alexandre Torgue , Frank Rowand , Masahiro Yamada , Michal Marek , Simon Glass , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Linux Kbuild mailing list , Devicetree Compiler , Steve McIntyre Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 19, 2020 at 12:41 AM David Gibson wrote: > > On Fri, Jan 17, 2020 at 08:43:23AM -0600, Rob Herring wrote: > > On Fri, Jan 17, 2020 at 6:26 AM David Gibson > > wrote: > > > > > > On Thu, Jan 16, 2020 at 09:58:23AM +0100, Alexandre Torgue wrote: > > > > Hi David > > > > > > > > On 1/16/20 1:57 AM, David Gibson wrote: > > > > > On Mon, Jan 13, 2020 at 07:16:23PM +0100, Alexandre Torgue wrote: > > > > > > This commit adds the possibility to add build information for a DTB. > > > > > > Build information can be: build date, DTS version, "who built the DTB" > > > > > > (same kind of information that we get in Linux with the Linux banner). > > > > > > > > > > > > To do this, an extra option "-B" using an information file as argument > > > > > > has been added. If this option is used, input device tree is appended with > > > > > > a new string property "Build-info". This property is built with information > > > > > > found in information file given as argument. This file has to be generated > > > > > > by user and shouldn't exceed 256 bytes. > > > > > > > > > > > > Signed-off-by: Alexandre Torgue > > > > > > > > > > At the very least, this patch of the series will need to be sent to > > > > > upstream dtc first. > > > > > > > > Ok sorry. I thought that sending all the series would give more > > > > information. > > > > > > That's fair enough, but in order to merge, you'll need to post against > > > upstream dtc. > > > > > > > > I'm also not terribly clear on what you're trying to accomplish here, > > > > > and why it's useful. > > > > > > > > Let's take Kernel boot at example (but could be extend to other DTB "users" > > > > like U-Boot). When Linux kernel booting we get a log that gives useful > > > > information about kernel image: source version, build date, people who built > > > > the kernel image, compiler version. This information is useful for debug and > > > > support. The aim is to get same kind of information but for the DTB. > > > > > > > > > Since you're doing this specifically for use with dtbs built in the > > > > > kernel build, could you just use a: > > > > > Build-info = /incbin/ "build-info.txt"; > > > > > in each of the in-kernel .dts files? > > > > > > > > My first idea was to not modify all existing .dts files. Adding an extra > > > > option in dtc is (for me) the softer way to do it. I mean, compile > > > > information should come through compiler without modify .dts files outside > > > > from dtc. In this way it will be easy to everybody using dtc (inside our > > > > outside Linux tree) to add dtb build info (even if they don't how to write a > > > > dts file). > > > > > > But you're not really having this information coming from the > > > compiler. Instead you're adding a compiler option that just force > > > includes another file into the generated tree, and it's up to your > > > build scripts to put something useful into that file. > > > > > > I don't really see that as preferable to modifying the .dts files. > > > > > > I also dislike the fact that the option as proposed is much more > > > general than the name suggests, but also very similar too, but much > > > more specific than the existing /incbin/ option. > > > > > > What might be better would be to have a dtc option which force appends > > > an extra .dts to the mail .dts compiled. You can then put an overlay > > > template in that file, something like: > > > > > > &{/} { > > > linux,build-info = /incbin/ "build-info.txt; > > > } > > > > I like this suggestion either as an include another dts file or an > > overlay. > > Sorry, to be clear what I'm talking about here is just including > another dts file, and using the compile-type overlay syntax. This is > not the same as .dtbo style runtime overlays (though the final result > is about the same in this case). Ah, okay. That's probably easier to implement. > > The latter could be useful as a way to maintain current dtb > > files while splitting the source files into base and overlay dts > > files. > > > > But no, let's not prepend this with 'linux'. It's not a property > > specific for Linux to consume. > > It's not really about who consumes it. It's about defining a > namespace for the new property to exist in, since it's not part of a > relevant standard (if we wanted to make it such, we should pin down > what goes in there with much more precision). I can't think of any cases of the 'linux' prefix not being about who consumes it. And we often end up dropping 'linux' because it turns out to not be Linux specific. I don't care to see u-boot,build-info, freebsd,build-info, etc. when a given dtb can only have 1 of those. My intent is this property name is added to the DT spec, but I don't agree we should define what's in it beyond a string. It is information that is useful for humans identifying what the dtb was built from. Rob