Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp740129rdb; Thu, 30 Nov 2023 18:04:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWVigkFYykaBAykOwz+9xKSQx9BL45aGZmijTkZiM6PKopeFowGdi1v8mHoxFUIWF3UzT1 X-Received: by 2002:a17:90b:38d2:b0:285:b99a:a932 with SMTP id nn18-20020a17090b38d200b00285b99aa932mr19382892pjb.17.1701396269858; Thu, 30 Nov 2023 18:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701396269; cv=none; d=google.com; s=arc-20160816; b=EpIgWfyAPx995MGJLhwwJyXHogh6ufZb8z1OUMO9qYVnbo3vT0BE04ZuucH91uRahH GTDs58BZEyrzdFtIP9KuS3tzklN92qx14EH20o/+rVcw21II93bhjsTKqUyFtb93xEzz Vrmbu7NTl/A1pUlCwujOPRuZ8j0DS75s6Zrr5J+JB6a9HZXdpXJRQ/k8eZ3EcmekWkn6 H53jd9VFVzuNlr3MX5b6z71sOEOAFdvBj9AkTBfH1cVHk9n3NQdff3/K/S4JNIMk6eMZ NhSb1Jq8iwtZBAEZWUu/y5EjrisPmplVTt7zdtNw3RaCkv6re9FlJj32Unlqf9Rg+gRU z0wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=fnRWIlQQJ+fiz8izCiSDHStJO0I/Bg8j0dOMidnSElY=; fh=58mvxDYp+91DFuCFSacis+b2Z1raZvSUVIFbm2i9FyM=; b=H9YfIV70wattqpTHeRIDfUZagU3cWFqXJz5pPPO+4hHg2Su8/rpYv/SJoUAPDaaAk1 Xz96jdETMdEsD3OIu/JhK6gJZ1wGL6AbCnwHk9EZV+A4xZqRw/gspM5UlS/S9P3Epwal mRyd8oo3DtJzwHkyMj8LTGsy8RpQnk70mbeProBuBtwGA721LbxDZL2KhJMdHhJJQE31 iNkakxW2FX8Ythjanr8jBzZnLKKiNM5ncD8me58OkWsFjdss5NeRB5EaDp1PO/QPbOES r3kcfjvpRnIq8coRlpLDLasmy7ouolM8w8jD3hgDzEMWmHPp4VlSMQw5zapunRDMUM/x zrSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id p3-20020a17090a930300b002864c15489dsi1336106pjo.173.2023.11.30.18.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 18:04:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1FF438093F44; Thu, 30 Nov 2023 18:04:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbjLACEH (ORCPT + 99 others); Thu, 30 Nov 2023 21:04:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjLACEH (ORCPT ); Thu, 30 Nov 2023 21:04:07 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DC9F4 for ; Thu, 30 Nov 2023 18:04:12 -0800 (PST) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1r8ssr-0002h2-N1; Fri, 01 Dec 2023 03:04:01 +0100 Message-ID: <5e8f42f8-2b03-4033-b6d2-9b3139f081d5@pengutronix.de> Date: Fri, 1 Dec 2023 03:03:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 2/2] arm64: boot: Support Flat Image Tree Content-Language: en-US To: Simon Glass Cc: linux-arm-kernel@lists.infradead.org, Masahiro Yamada , Tom Rini , lkml , U-Boot Mailing List , Catalin Marinas , Nathan Chancellor , Nick Terrell , Nicolas Schier , Will Deacon , linux-kbuild@vger.kernel.org, Pengutronix Kernel Team References: <20231129172200.430674-1-sjg@chromium.org> <20231129172200.430674-3-sjg@chromium.org> <30f32467-51ea-47de-a272-38e074f4060b@pengutronix.de> <875f0dbc-1d78-4901-91b2-6ad152bcea5a@pengutronix.de> <06281f7c-e0f2-405c-95a9-0f7e9e84a7f6@pengutronix.de> <8fbc81b1-31ab-46b0-87f4-b8bd8e8e2b47@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 30 Nov 2023 18:04:26 -0800 (PST) Hello Simon, On 30.11.23 21:30, Simon Glass wrote: > On Wed, 29 Nov 2023 at 12:54, Ahmad Fatoum wrote: >> On 29.11.23 20:44, Simon Glass wrote: >>> On Wed, 29 Nov 2023 at 12:33, Ahmad Fatoum wrote: >>>> >>>> On 29.11.23 20:27, Simon Glass wrote: >>>>> On Wed, 29 Nov 2023 at 12:15, Ahmad Fatoum wrote: >>>>>> On 29.11.23 20:02, Simon Glass wrote: >>>>>>> On Wed, 29 Nov 2023 at 11:59, Ahmad Fatoum wrote: >>>>>>>> The specification says that this is the root U-Boot compatible, >>>>>>>> which I presume to mean the top-level compatible, which makes sense to me. >>>>>>>> >>>>>>>> The code here though adds all compatible strings from the device tree though, >>>>>>>> is this intended? >>>>>>> >>>>>>> Yes, since it saves needing to read in each DT just to get the >>>>>>> compatible stringlist. >>>>>> >>>>>> The spec reads as if only one string (root) is supposed to be in the list. >>>>>> The script adds all compatibles though. This is not really useful as a bootloader >>>>>> that's compatible with e.g. fsl,imx8mm would just take the first device tree >>>>>> with that SoC, which is most likely to be wrong. It would be better to just >>>>>> specify the top-level compatible, so the bootloader fails instead of taking >>>>>> the first DT it finds. >>>>> >>>>> We do need to have a list, since we have to support different board revs, etc. >>>> >>>> Can you give me an example? The way I see it, a bootloader with >>>> compatible "vendor,board" and a FIT with configuration with compatibles: >>>> >>>> "vendor,board-rev-a", "vendor,board" >>>> "vendor,board-rev-b", "vendor,board" >>>> >>>> would just result in the bootloader booting the first configuration, even if >>>> the device is actually rev-b. >>> >>> You need to find the best match, not just any match. This is >>> documented in the function comment for fit_conf_find_compat(). >> >> In my above example, both configuration are equally good. >> Can you give me an example where it makes sense to have multiple >> compatibles automatically extracted from the device tree compatible? >> >> The way I see it having more than one compatible here just has >> downsides. > > I don't have an example to hand, but this is the required mechanism of > FIT. This feature has been in place for many years and is used by > ChromeOS, at least. I see the utility of a FIT configuration with compatible = "vendor,board-rev-a", "vendor,board-rev-b"; I fail to see a utility for a configuration with compatible = "vendor,board", "vendor,SoM", "vendor,SoC"; Any configuration that ends up being booted because "vendor,SoC" was matched is most likely doomed to fail. Therefore, I would suggest that only the top level configuration is written into the FIT configurations automatically. Cheers, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |