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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B0F9C433EF for ; Wed, 27 Oct 2021 13:49:40 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26E9F60F38 for ; Wed, 27 Oct 2021 13:49:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 26E9F60F38 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 17F1B835A2; Wed, 27 Oct 2021 15:49:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="joV9Qp32"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A5330835BA; Wed, 27 Oct 2021 15:48:10 +0200 (CEST) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 66C0582C53 for ; Wed, 27 Oct 2021 15:48:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52a.google.com with SMTP id g8so10970892edb.2 for ; Wed, 27 Oct 2021 06:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=/Ug4REtRrHP4v7dj5cYh2hlvHLOy5ui/JjH7zWpUD8c=; b=joV9Qp329sewcEFvbpeW8QZUZ8LeMJL3hQhhiL8T9W90eZY21U+qLpxXGdpWRhZCYY 8F88jvCPHOf0zFNOLkKzYNrtRiM194hxhGwXFVMgH19TlKcgKLPw4ALjFtwT/wxbbKX+ Lj4cugw0y9sHcAOvUz/5pq+CxhXA2Udfr6xYMqsElkN2o3CUrApoarFnwqtucDdNBU7U Whb7dEUm3hBU/sB1nKDMhEw0rzu0o7m8/AY8y1hfwYlXI9fAVWFY1KLfAc+hBwYMadnF 4jPaYpps3HMWroW2xtLOAm80wLJ8j5LvCwOmtvScvqAR7OX0htfbgd2Gv67tbJoOBGu6 HpWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=/Ug4REtRrHP4v7dj5cYh2hlvHLOy5ui/JjH7zWpUD8c=; b=TlES51XnhNW8bpDXFfzM74jw2Do35cyhFb8h2AN04zM+j2DbfokXHwLWKl8NDpOGV2 FZ0trvBvA0pGX2KZbWn4bmtJtwRG/VPPfs5vebMG+rYfNHgB1UlTouLNdFWPJx8L4XjL JF+HyHYKwGvfDmOVicw1BksJ6JGhZfXGNQ6q5PYZPkmdUpBN5vDVllihjFzX4TBDrXxK k0Q6V/cuEIcGgnLxvkDyuw13UYW8uJ+haUHV/x1elqKVqN9Q9mX0LvNUrCD7W+lZeJAX vVqvvPwz5Z8XpGka5HcNQ2n7Xp1EimBLkCi5zzeJi+18E9/RF3ppt7pXQpl35th6szB8 lqBg== X-Gm-Message-State: AOAM533XR9S1WhsskZOhfl//F/JsIxhTjFlRsWpxf9bU9g4SmfpLa+7P 1OMqKu6rpJgdP02wZCrVX7B0yw== X-Google-Smtp-Source: ABdhPJxpstneNeGqPoBwWE4VpxMm84CJyRQKeCWr2RuBBavWoEzFbQNSQ6B91sP7Lsh9FtNcQiJ0ng== X-Received: by 2002:a05:6402:1d49:: with SMTP id dz9mr43715764edb.55.1635342481247; Wed, 27 Oct 2021 06:48:01 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-13.home.otenet.gr. [94.66.220.13]) by smtp.gmail.com with ESMTPSA id b19sm10734028ejc.107.2021.10.27.06.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 06:48:00 -0700 (PDT) Date: Wed, 27 Oct 2021 16:47:55 +0300 From: Ilias Apalodimas To: Tom Rini Cc: =?iso-8859-1?Q?Fran=E7ois?= Ozog , Simon Glass , Aaron Williams , Albert Aribaud , Alexander Graf , Anastasiia Lukianenko , Andre Przywara , Ashok Reddy Soma , Atish Patra , Bin Meng , Bin Meng , Christian Hewitt , David Abdurachmanov , Dimitri John Ledkov , Fabio Estevam , Green Wan , Heiko Schocher , Heinrich Schuchardt , Heinrich Schuchardt , Jagan Teki , Jerry Van Baren , Kever Yang , Leo , Linus Walleij , Liviu Dudau , Marek =?iso-8859-1?Q?Beh=FAn?= , Matthias Brugger , Michal Simek , Michal Simek , Neil Armstrong , Niel Fourie , Oleksandr Andrushchenko , Padmarao Begari , Pali =?iso-8859-1?Q?Roh=E1r?= , Peter Robinson , Priyanka Jain , Rainer Boschung , Ramon Fried , Rick Chen , Sean Anderson , Sinan Akman , Stefan Roese , Stephen Warren , Stephen Warren , T Karthik Reddy , Tero Kristo , Thomas Fitzsimmons , Tianrui Wei , Tim Harvey , Tuomas Tynkkynen , U-Boot Mailing List , Valentin Longchamp , Vladimir Oltean , Wolfgang Denk , Zong Li , "qemu-devel@nongnu.org Developers" Subject: Re: [PATCH 00/16] fdt: Make OF_BOARD a boolean option Message-ID: References: <20211014145626.GC7964@bill-the-cat> <20211014152801.GF7964@bill-the-cat> <20211027125916.GS8284@bill-the-cat> <20211027133840.GV8284@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211027133840.GV8284@bill-the-cat> X-Mailman-Approved-At: Wed, 27 Oct 2021 15:49:37 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi trying to reply to all at the same time! On Wed, Oct 27, 2021 at 09:38:40AM -0400, Tom Rini wrote: > On Wed, Oct 27, 2021 at 03:30:18PM +0200, François Ozog wrote: > > Hi Tom, > > > > On Wed, 27 Oct 2021 at 14:59, Tom Rini wrote: > > > > > On Tue, Oct 26, 2021 at 09:46:38AM +0300, Ilias Apalodimas wrote: > > > > Hi Simon, > > > > > > > > A bit late to the party, sorry! > > > > > > > > [...] > > > > > > > > > > > > > > > > I really want to see what the binary case looks like since we could > > > then > > > > > > kill off rpi_{3,3_b,4}_defconfig and I would need to see if we could > > > > > > then also do a rpi_arm32_defconfig too. > > > > > > > > > > > > I want to see less device trees in U-Boot sources, if they can come > > > > > > functionally correct from the hardware/our caller. > > > > > > > > > > > > And I'm not seeing how we make use of "U-Boot /config" if we also > > > don't > > > > > > use the device tree from build time at run time, ignoring the device > > > > > > tree provided to us at run time by the caller. > > > > > > > > > > Firstly I should say that I find building firmware very messy and > > > > > confusing these days. Lots of things to build and it's hard to find > > > > > the instructions. It doesn't have to be that way, but if we carry on > > > > > as we are, it will continue to be messy and in five years you will > > > > > need a Ph.D and a lucky charm to boot on any modern board. My > > > > > objective here is to simplify things, bringing some consistency to the > > > > > different components. Binman was one effort there. I feel that putting > > > > > at least the U-Boot house in order, in my role as devicetree > > > > > maintainer (and as author of devicetree support in U-Boot back in > > > > > 2011), is the next step. > > > > > > > > > > If we set things up correctly and agree on the bindings, devicetree > > > > > can be the unifying configuration mechanism through the whole of > > > > > firmware (except for very early bits) and into the OS, this will set > > > > > us up very well to deal with the complexity that is coming. > > > > > > > > > > Anyway, here are the mental steps that I've gone through over the past > > > > > two months: > > > > > > > > > > Step 1: At present, some people think U-Boot is not even allowed to > > > > > have its own nodes/properties in the DT. It is an abuse of the > > > > > devicetree standard, like the /chosen node but with less history. We > > > > > should sacrifice efficiency, expedience and expandability on the altar > > > > > of 'devicetree is a hardware description'. How do we get over that > > > > > one? Wel, I just think we need to accept that U-Boot uses devicetree > > > > > for its own purposes, as well as for booting the OS. I am not saying > > > > > it always has to have those properties, but with existing features > > > > > like verified boot, SPL as well as complex firmware images where > > > > > U-Boot needs to be able to find things in the image, it is essential. > > > > > So let's just assume that we need this everywhere, since we certainly > > > > > need it in at least some places. > > > > > > > > > > (stop reading here if you disagree, because nothing below will make > > > > > any sense...you can still use U-Boot v2011.06 which doesn't have > > > > > OF_CONTROL :-) > > > > > > > > Having U-Boot keep it's *internal* config state in DTs is fine. Adding > > > > that to the DTs that are copied over from linux isn't imho. There are > > > > various reasons for that. First of all syncing device trees is a huge > > > pain > > > > and that's probably one of the main reasons our DTs are out of sync for a > > > > large number of boards. > > > > > > This re-sync is only a pain because: > > > 1. Some platforms have been modifying the core dts files LIKE THEY ARE > > > NOT SUPPOSED TO. > > > 2. DTS files are getting closer to being the super stable API that has > > > been promised now that there's validation tools. Agree on both, but still this is the reality we have to deal with right now > > > > > > Some SoCs, like stm32 are doing an amazing job and keeping things in > > > sync, every release. Others like NXP are violating rule #1. > > > > With NXP commitment to SystemReady on some IMX8 boards, I think this is > > changing, > > at least for the SystemReady boards. > > I'd really like to see some progress (as would the other non-NXP folks > working on NXP SoCs) in that regard. > > > > Still > > > others like some TI platforms get bit by #2 (I solved one of these, and > > > need to cycle back to the one you and I talked about on IRC a while > > > back, I bet it's another node name dash changed to underbar). > > > > > > > The point is this was fine in 2011 were we had SPL only, but the reality > > > > today is completely different. There's previous stage boot loaders (and > > > > enough cases were vendors prefer those over SPL). If that bootloader > > > needs > > > > to use it's own device tree for whatever reason, imposing restrictions > > > on > > > > it wrt to the device tree it has to include, and require them to have > > > > knowledge of U-Boot and it's internal config mechanism makes no sense not > > > > to mention it doesn't scale at all. > > > > > > If you are passing the full device tree around, a few more > > > nodes/properties aren't going to make the situation worse. If we're > > > talking about a 60 kilobyte blob one more kilobyte isn't where we call > > > the line, especially since if we wait another 6 months it'll be a 62 > > > kilobyte file coming in from Linux instead. > > > > This is not about size but about firmware supply chain organization. > > That's great since it means we just need the bindings reviewed then > everyone can pass whatever everyone else needs. > Size here is not my concern. If the bindings u-boot expects gets upstreamed I am obviously fine with the previous stage bootloader passing them over. What I strongly disagree, is *demand* the previous stage boot loader have knowledge about them if they are not in upstream. > > > > Step 2: Assume U-Boot has its own nodes/properties. How do they get > > > > > there? Well, we have u-boot.dtsi files for that (the 2016 patch > > > > > "6d427c6b1fa binman: Automatically include a U-Boot .dtsi file"), we > > > > > have binman definitions, etc. So we need a way to overlay those things > > > > > into the DT. We already support this for in-tree DTs, so IMO this is > > > > > easy. Just require every board to have an in-tree DT. It helps with > > > > > discoverability and documentation, anyway. That is this series. > > > > > > > > Again, the board might decide for it's own reason to provide it's own > > > DT. > > > > IMHO U-Boot must be able to cope with that and asking DTs to be included > > > in > > > > U-Boot source is not the right way to do that, not to mention cases were > > > > that's completely unrealistic (e.g QEMU or a board that reads the DTB > > > from > > > > it's flash). > > > > > > > > > (I think most of us are at the beginning of step 2, unsure about it > > > > > and worried about step 3) > > > > > > > > > > Step 3: Ah, but there are flows (i.e. boards that use a particular > > > > > flow only, or boards that sometimes use a flow) which need the DT to > > > > > come from a prior stage. How to handle that? IMO that is only going to > > > > > grow as every man and his dog get into the write-a-bootloader > > > > > business. > > > > > > > > And that's exactly why we have to come up with something that scales, > > > without > > > > having to add a bunch of unusable DTs in U-Boot. > > > > > > Both of these are solved by having our bindings reviewed and upstreamed > > > and then what we need included in the authoritative dts files. > > > yes > > There shall be authoritative System Device Trees as vendors are working on. > > Those System Device Trees cover all aspects of a board, not just the > > Cortex-A part that U-Boot cares about. > > Out of those system device trees, a tool (lopper) is going to carve out the > > "authoritative dts for the cortex-A". > > Essentially, that carve out will correspond to what would come out of Linux. > > s/Linux/software/ > > > This scheme will not be generalized, just adopted by vendors on some > > boards. > > DT for those board become part of the OS ABI (meaning, the driver > > developper is constrained). > > OK? And is going to pick and choose which valid bindings to implement? > Or is it going to provide half a node for Linux? No? I assume no. So > it will also provide whatever bindings we've upstreamed and say need to > be passed. > > -- > Tom Regards /Ilias