Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4820736rdh; Wed, 29 Nov 2023 11:34:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+ufodMHDDqtCK4fs9SYaNiFBvktDvBzigOYNtv+5zbkaOj+b3VKX8pBjJf1ODpAu7FFMy X-Received: by 2002:a17:903:22cf:b0:1d0:1c97:120 with SMTP id y15-20020a17090322cf00b001d01c970120mr2298757plg.35.1701286443001; Wed, 29 Nov 2023 11:34:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701286442; cv=none; d=google.com; s=arc-20160816; b=XPF/Ld+rML/zejeJ85GUa+sMVIJ6CxFo2NQc6DfKs1Uv6vfy099Xaxv94c+A4UUZAQ MH+MBm4v64LV0EhzpiCsBnyn5r+TOENVZ6z4l3Ry4NTPxUcfcHqVa6Hm+rN0yCAqKWJX 7ArmXLgyDyR9qCrHSLzgZSKofJ+P4k5grhLZcVEHd54hb1IenMgLpmr1CMtaWcQmq75l IBlsckwMyB9AtBcM1Pbcbkjl+6UiblBvx3ZjsDAvnEfk/kjoa2u2KO+6ggQ8JK95KU57 vidWV/dzINWL2T0+To/b6KWqDY3mDuet/o39fs18xspOdlA7QkGQjnD/YPxy8EZ5WWQ0 ATYg== 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=FuyBD2ElIawPsGUq/tczl1S6T8VBaVr04UpQPq84c+8=; fh=58mvxDYp+91DFuCFSacis+b2Z1raZvSUVIFbm2i9FyM=; b=xiTMCoaGISAv3PcOu61V8kVyqr1Y8DvhD2hf4bikq/mj2oQV/FFYaiMl0kl1G6xewm IzSI1H1z33OdcE0UEXnAz1+m06+OLgSkaOellNC9OWSclhvm0MLwe/2WdOM8cCndbh2P srpWc12McQIlP/8AxpdoFbexbjB6gEgqgrhKhgxWIiIMlqwHy4m+NT+ndpAlqiOrC5qE tOs38Rb0fWhy1ALIecZ01rUKXcsaE2ZEUJnoruNWb49tHeXibtT0+mTtPAsGvYGGqZE4 kgFGiNWQkBhDafip6joaD8p2BgsdXjF+rZljCdkuxiWBSNtfKZjZluI5rAVvgzlm7/ZD bQTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ix13-20020a170902f80d00b001cfb29b9c0bsi10228577plb.161.2023.11.29.11.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 11:34:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id B43D780AC5BF; Wed, 29 Nov 2023 11:34:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbjK2Tdv (ORCPT + 99 others); Wed, 29 Nov 2023 14:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjK2Tdu (ORCPT ); Wed, 29 Nov 2023 14:33:50 -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 BCAAEA2 for ; Wed, 29 Nov 2023 11:33:56 -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 1r8QJj-0006Uf-P7; Wed, 29 Nov 2023 20:33:51 +0100 Message-ID: <06281f7c-e0f2-405c-95a9-0f7e9e84a7f6@pengutronix.de> Date: Wed, 29 Nov 2023 20:33:48 +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> 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 11:34:01 -0800 (PST) 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. >>>>> + fsw.property_string('description', model) >>>>> + fsw.property_string('type', 'flat_dt') >>>>> + fsw.property_string('arch', arch) >>>>> + fsw.property_string('compression', compress) >>>>> + fsw.property('compatible', bytes(compat)) >>>> >>>> I think I've never seen a compatible for a fdt node before. >>>> What use does this serve? >>> >>> It indicates the machine that the DT is for. >> >> Who makes use of this information? > > U-Boot uses it, I believe. There is an optimisation to use this > instead of reading the DT itself. The configuration already has a compatible entry. What extra use is the compatible entry in the FDT node? Thanks, Ahmad > > Regards, > Simon > -- 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 |