Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp692002ybl; Thu, 23 Jan 2020 06:08:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwKUEv75icpaqhSJ2hXpunVCT2bEgmQ9kYVtwota2SIf34kCqkcAwgohZI+R427oGQffarE X-Received: by 2002:aca:4183:: with SMTP id o125mr10128663oia.125.1579788527032; Thu, 23 Jan 2020 06:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579788527; cv=none; d=google.com; s=arc-20160816; b=I+2NsT+x+bHiBXcOc08//9yVqnr/HkuDbyBIMrV7fQQjIo8LSXqLv1WStKVNNVC0Oj 8dOE7hVkUxHNlSzqdoUBBt4ST6uufC50PoMZyTH4sOdRIXqCxcJ6jesnAPWcP200j7MG zpyzZe+tUrDYY4SfXm7kxsQkCfknoZtK2GSYxtHbddFVWfoeQ0BREJv+Vl2P9+hiWJ0L Tub8hs0Jt8qNR3YrByIer4s4b2v7c6wZlsHv+kqXipeiZyn1kM0JF65taiJV7QzSkzMh 4KYnRtrxLRZpfQSYdWStGLeVlKJU5Bfe1qRDVCvDkWMzrtJDMAAy1eprxiPaEPEUPJso /Z2w== 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=ktT6xxgtu/L+CyxP2fIaXc/OaSvfyCQRiexIl+XJJ/w=; b=d/+yFBSyR7JcKtc3Is8f/EwBbWrzlLqeI/bTlcWPEb8MDXtvVZmNCMNkzsU0Fv3sMI qjMCQsR9AjzlWg8n1v0zfzcuAOcd75hbMcU8ZXHXB7n3QUMYuUAKv5+9llX3P8xUsQ1T /Cje0EEjVIiJmkYHoURN3SLAypimsKWrXMiQjNuy2bbErNhIuYT7dnT098sVX2YLXgXx Kmnpp0CvH7mThEjt6NL3BBt2RIHQqkhUXz0pJHFVyRYFOaq34nt/tQN3747WHma7Y5Yh 6drlrK/7PTwGxWvmapBSa1uR9KArWHGUN/3Ff4htSUk6JWTSiQ2sG1czrALB4fRlOhzG l45A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uRkqZxdB; 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 r6si1160791otq.95.2020.01.23.06.08.30; Thu, 23 Jan 2020 06:08:47 -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=uRkqZxdB; 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 S1729436AbgAWOFy (ORCPT + 99 others); Thu, 23 Jan 2020 09:05:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:47318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbgAWOFx (ORCPT ); Thu, 23 Jan 2020 09:05:53 -0500 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 C54ED24688; Thu, 23 Jan 2020 14:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579788351; bh=yMFNzJNF/4sW2nNaZae8U/wjx+DbUIIZD8qAaJgXcsY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uRkqZxdBXBEkgIt91s8TWAdA86vIwrmSrefM2fbHb54R7W5qHtz++inZLWHlTFpVr 6sEoQYCi5v5oIbi8BnrB+77FeZYC/Mu6NZV9Brf9Htu95pNOP/XSCaB5S8AbDFaL1h 4Vp0mgXUvFbQu+xlZiH5QApaHLuacqb8oDC2lNhU= Received: by mail-qk1-f174.google.com with SMTP id q15so3474465qke.9; Thu, 23 Jan 2020 06:05:51 -0800 (PST) X-Gm-Message-State: APjAAAU8HvG7iwdJuEmcikUZqhUBB5StyaGR2iOxq9cw68agf1RaUysu 5N43hWN7gsFFX0wAf9HJ5rDryMbc1T83Ga90HQ== X-Received: by 2002:a05:620a:135b:: with SMTP id c27mr14930647qkl.119.1579788350906; Thu, 23 Jan 2020 06:05:50 -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> <20200123051316.GP2347@umbus.fritz.box> In-Reply-To: <20200123051316.GP2347@umbus.fritz.box> From: Rob Herring Date: Thu, 23 Jan 2020 08:05:39 -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 Wed, Jan 22, 2020 at 11:13 PM David Gibson wrote: > > On Tue, Jan 21, 2020 at 09:59:44AM -0600, Rob Herring wrote: > > 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. > > But all other vendor prefixes are about who generated or specified the > information, not who consumes it, e.g. "ibm,XXX", "fsl,YYY", etc. I'd say those are both typically. Those are consumed by IBM and FSL specific drivers. But I think the better argument is what Frank said. If the firmware/bootloader provides the dtb that it built, we'd still want the information printed. Rob