Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9DE0C433F5 for ; Thu, 9 Sep 2021 21:22:20 +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 98A73610C8 for ; Thu, 9 Sep 2021 21:22:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 98A73610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xs4all.nl 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 C831283577; Thu, 9 Sep 2021 23:22:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 766E183578; Thu, 9 Sep 2021 23:22:14 +0200 (CEST) Received: from sibelius.xs4all.nl (sibelius.xs4all.nl [83.163.83.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 814588354D for ; Thu, 9 Sep 2021 23:22:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=mark.kettenis@xs4all.nl Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id 5729d299; Thu, 9 Sep 2021 23:22:08 +0200 (CEST) Date: Thu, 9 Sep 2021 23:22:08 +0200 (CEST) From: Mark Kettenis To: Simon Glass Cc: trini@konsulko.com, xypron.glpk@gmx.de, u-boot@lists.denx.de, agraf@csgraf.de, masahisa.kojima@linaro.org, ilias.apalodimas@linaro.org, takahiro.akashi@linaro.org In-Reply-To: (message from Simon Glass on Thu, 9 Sep 2021 14:08:24 -0600) Subject: Re: Pull request for efi-2021-10-rc4 References: <61e2e1cc-b474-84dd-eceb-bb86a59972be@gmx.de> <20210904130111.GA12964@bill-the-cat> <20210904143722.GD12964@bill-the-cat> <46CAD3CD-41FA-43B9-9099-225711B754E1@gmx.de> <20210904173949.GI12964@bill-the-cat> <8FD4F99B-E1A5-4842-8BB8-EA2749E4761B@gmx.de> <146342ea-08a3-ec4a-535c-5bcecd54675a@gmx.de> <20210909120808.GY12964@bill-the-cat> Message-ID: <56144ce05709c110@bloch.sibelius.xs4all.nl> 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 > From: Simon Glass > Date: Thu, 9 Sep 2021 14:08:24 -0600 Hi Simon, > Hi Tom, > > On Thu, 9 Sept 2021 at 06:08, Tom Rini wrote: > > > > On Thu, Sep 09, 2021 at 12:52:52PM +0200, Heinrich Schuchardt wrote: > > > > > > > > > On 9/9/21 10:56 AM, Simon Glass wrote: > > > > Hi Heinrich, > > > > > > > > On Sat, 4 Sept 2021 at 12:08, Heinrich Schuchardt wrote: > > > > > > > > > > It is Simon's concept of blobs in devicetrees that is borked in that it ignores QEMU and any board that gets the DT from a prior boot stage. > > > > > > > > That's because I was completely unaware of this strange back-door > > > > approach. It would have helped a lot if someone had bothered to create > > > > > > CONFIG_OF_PRIOR_STAGE is not a backdoor. And you are the DM maintainer. > > > > > > > some documentation for the design. Then I would have seen the problem > > > > immediately. > > > > > > > > Anyway, it is now covered by the above series. The use of devicetree > > > > in U-Boot is very clear, I think. > > > > > > I see neither a design by you nor a series that covers > > > CONFIG_OF_PRIOR_STAGE. I have suggested that if you really want to move > > > this blob to a devicetree you could apply an overlay tree including > > > U-Boot specific fields to the devicetree of the prior stage. Did you yet > > > respond to this? > > > > Given that I feel like "u-boot,dm-spl" and "u-boot,dm-pre-reloc" are > > unlikely to survive upstream review, I would like to hear what you think > > about applying overlays, at least in general, Simon. > > I would be pretty disappointed if vendor,propname could not survive > upstream review, given that it is in the DT spec explicitly, and that > linux, is used in Linux. Well, the Linux DT maintainers tend to be pretty thorough in their review and will resist crappy ideas ;). I think there is merit in the way we currently do things by augmenting the standard Linux device tree with these properties. At least on platforms where U-Boot is the first bit of firmware that runs (apart from ROM code). But I suspect there would be some resistence if we proposed to add these properties directly to the upstream Linux DTs instead. On the other hand I don't see why maintainers of firmware that runs before U-Boot that provides a DT to U-Boot through a CONFIG_OF_PRIOR_STAGE mechanism would never add "u-boot," properties to their device trees if they use U-Boot as a 2nd stage loader. I'm sure the device trees providied by m1n1 for the Apple M1 could contain additional nodes and "u-boot," properties if necessary. > To answer your question, I think it is a terrible idea and would lead > to much pain and misery and eventually the failure of U-Boot to > function as a useful and efficient bootloader . It moves something > that I think can be easily accomplished (from a technical POV anyway) > at built-time into the run-time domain. Leaving aside that devicetree > overlays are arguably not supported/implemented so far as the DT spec > is concerned, it adds overhead to SPL and U-Boot (particularly > pre-reloc) that is likely to make the whole thing infeasible. I still think that U-Boot TPL/SPL isn't an issue for platforms that use CONFIG_OF_PRIOR_STAGE. The QEMU example that was given is a bit artificial in that it is a configuration specifically designed for testing U-Boot SPL. Folks using a QEMU-based virtualization solution don't care about that configuration and will only use U-Boot proper. > Also, somewhat off-topic, this is the first I have ever heard of the > idea of U-Boot needing to put its properties in a separate place. I > tried to cover this in 'Why not have two devicetrees?' here: > > https://patchwork.ozlabs.org/project/uboot/patch/20210828164630.81050-4-sjg@chromium.org/ > > How hard do we really want to make this? If a DT is provided to > U-Boot, it needs to be suitable for U-Boot. But U-Boot must not make unreasonable demands. > The whole idea is driven from a misconception that U-Boot is just > borrowing a devicetree from Linux or qemu or TF-A. I diasagree that's a misconception. I've already explained why it isn't practical for U-Boot to have hardwired device trees for things like QEMU, Raspberry Pi or Apple M1. I also don't see what specific U-Boot cofiguration is needed for those platforms. Currently U-Boot functions just fine with on these platforms without having any "u-boot," properties in the DT they provide to U-Boot. Granted, I'm not trying to do any sort of verified/secure boot on those platforms. But any meaningful verified/secure boot implementation needs a high degree of agreement between the integrated firmware components anyway. > So to the extent that this implies that U-Boot cannot have its own > properties and nodes in the devicetree; > > No. > > No. > > No. > > U-Boot uses the devicetree for its configuration and it must be > supplied based on U-Boot's requirements. I will try to send another > version of the devicetree doc series. I really think this needs to be judged on a case-by-case basis. Using this as a leading principle is fine, but ruling out binary data linked into the u-boot binary itself out of principle if embedding that data into the device tree isn't practical seems counterproductive to me. Cheers, Mark