Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4826449rdh; Wed, 29 Nov 2023 11:44:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwwdp3VMeVATb9iIM06HhnykEvxGpt9l720KD8StvdJ+H6autoNG9VQAi3VAdkUkf3f1qJ X-Received: by 2002:a05:6a20:1228:b0:18b:acc8:a5ed with SMTP id v40-20020a056a20122800b0018bacc8a5edmr25040797pzf.8.1701287094157; Wed, 29 Nov 2023 11:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701287094; cv=none; d=google.com; s=arc-20160816; b=CG8rjKSmwQq1gNsRaj0QE+iLNFxvUZmqUshgqi6DLhqHCKlbWPpRZmNDqzudWFu3Cc flx4rgWGUMUufUgkkyJGiPlFW1V6CUIRR44CkCzA8Vr5U85xFLygspkaJm5dnIthMiGg ZerZ2yomtWVMibG/qN+hMTWV1YjqHgQEIWCKM5qurRQgr4gYxWtaMVl/f2Ncp6qMY6Fe VTST9ucNfu+5js9ep1vsnNwRYD0bNPE3HSCXZN3ajNiLKxT8IWFN2A35TnZOECvyjTYV gzNJJ7L+poruF5ImQTTMEOnx06YVn7rrWPdnoguBdixdbBWuXuERNpYW+cABGVXW+ZnK R72w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qnqDzHz4INacq1KvdtyKE0oHpbQHSFD4sKrps3p8dnw=; fh=hE818ivoe0UZgus+AMQyIn64tEUoOmlIpLc/j3V+Ylg=; b=Gc715delPcGYIWArgUxFWhds4Dn6gsF9ID15jbKN0yXQRxppneM3SWHAJucT0Et/T+ cA9s6KozK6jNGujjOGZhYjIwss22rv6wRwH9SRfAdLzQiCEVr19rPd0aDIRaT4DZ8Ayx Hzt8IoxBTG/Yewh5FlQUC1NlKWdB+Aq/pjfByEL+kLPR/fcEN7HRCALDS1wPFJx1nKU0 HUqdFUaUzx8VGYUS0Ll3aO7QK9s1fu68RR1mfC8D9hnD2hLaWt/T2wdLHb8ejSB+ZBZS jQqXUMuZIq9I3ChtcwFy+nSO2bK1sk3eyyzZdRPmAE5t3Wz4rAiGlk5PLFKzBVs/LXlX Er6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=klBCYmmt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u21-20020a632355000000b005bd66bfc235si14841911pgm.413.2023.11.29.11.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 11:44:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=klBCYmmt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9C4CC803F7BF; Wed, 29 Nov 2023 11:44:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233062AbjK2Toi (ORCPT + 99 others); Wed, 29 Nov 2023 14:44:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbjK2Toh (ORCPT ); Wed, 29 Nov 2023 14:44:37 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33526E6 for ; Wed, 29 Nov 2023 11:44:43 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a185fb3aa18so401566b.1 for ; Wed, 29 Nov 2023 11:44:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701287081; x=1701891881; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qnqDzHz4INacq1KvdtyKE0oHpbQHSFD4sKrps3p8dnw=; b=klBCYmmttvMbB7FzFto8DDcJB0W3AFoMOyRDjLkyqMMPCAcmUj/PCiDKX+rR7brFXo tWpWxDqv0qmLRc8z0YbQ/CBze9Cyuz3laR1utPtpRbRcTCLTq1UyIhAdsnLxXg+c8b2Y ffvXfvMn59Py8rkIpgT/RNjrwWRSxrQVJKFKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701287081; x=1701891881; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qnqDzHz4INacq1KvdtyKE0oHpbQHSFD4sKrps3p8dnw=; b=RC6xYouDdw8P0kfTkStWhDrGDrUQIBT/WbKmnlFs54MxPMWcxJ69WPQDDlIgnpAz3S bRuDIUncyQuWVi+ZtdRKb6s+NoVEIBPZGrG2DP0+GBqkJpPwARLUibBgndQ4hNYxkTI5 raGjm8vjcHZ3k1U6WwJ+fSPToydAHCUXlx452CtCcqPu95R7VRdCOvh+gBKieIqrGPgC D+zlDMEdaSJmjZu/8sd0lejInP/EQ4HNGXGsiJ6L+dWg1A2OyfEeLcqtckViRU4KK4Ts nCcOtKik0TBwj9iySyDBNPzqIpvwfave5P4z8hcv5dzi+kJY4UJ28uPuLKIfCKp23EIv xvTw== X-Gm-Message-State: AOJu0YxFePj3e50hQzucaQE48ole+oiAP3TKt7cCF0MtK0ueQw0kqm+d UZvVZYgQ/79wt0u70ucrrYV51DZ+LzrtikFfGNJUSg== X-Received: by 2002:a17:906:105c:b0:9ae:659f:4d2f with SMTP id j28-20020a170906105c00b009ae659f4d2fmr18732284ejj.26.1701287081372; Wed, 29 Nov 2023 11:44:41 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <06281f7c-e0f2-405c-95a9-0f7e9e84a7f6@pengutronix.de> From: Simon Glass Date: Wed, 29 Nov 2023 12:44:25 -0700 Message-ID: Subject: Re: [PATCH v7 2/2] arm64: boot: Support Flat Image Tree To: Ahmad Fatoum 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 11:44:51 -0800 (PST) Hi Ahmad, 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(). > > > >>>>> + 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? It allows seeing the compatible stringlist without having to read the FDT itself. I don't believe it is necessary though, so long as we are scanning the configurations and not the FDT nodes. Regards, Simon