Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp585924rdb; Thu, 30 Nov 2023 12:31:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTZ51eAYX1pnWreWh1iusI9aXvvf7HOinbhfPGEj00S8WjdmREixhjJK+r1ji5c7bOpuzy X-Received: by 2002:a5e:c317:0:b0:7b3:ecad:32ed with SMTP id a23-20020a5ec317000000b007b3ecad32edmr6972699iok.8.1701376289250; Thu, 30 Nov 2023 12:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701376289; cv=none; d=google.com; s=arc-20160816; b=A5WGz3qp8bz8Gd3xenQs5hhTTLilvbJGDBN/nv0lmpLtlDV7Sa32Jq/2woUJt7Az8b ecOWCdhI7902UtV6/phrR/8bg0hE6xdBl36yRmtnJUpiVBoq5t3JBrTrqHcQvB+adONn hwzfH0FNQLL7Vtnz8nC89wG+JJRmcvngk07Z1FRzS9OWevUsB2JSRyNDzqc0YjahX84i N4Xq/LX/k12xHyHxUMf4+QAeirZzi0BvMbrpK6czbNBssMEqI0LxpuCCyVhN+opIpfGd hKc/zOsBQ8k/UNeiR0JUSPO016cA9WTC+R0jNw8T7Wh0OfVGuoXjjbZL/12OIAyOeTLX 1AUQ== 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=0ze3g+KbzqGj36cXK4KXcn2SJ1PO+nJAvkG+kKo7vKI=; fh=hE818ivoe0UZgus+AMQyIn64tEUoOmlIpLc/j3V+Ylg=; b=F4+RhwURKWRMsTJJxij3VD5itii4mVlXhyZ4AW74hmIpBKbshUnvTo3PhR9Rnqu5rG FekwrqgvDCeGYeAOdOYomB+WIPqoArWaV2LPoMcgLzqbIa0HKDHv/rJjBn69FQOPKi1F Unl/G5b5kAz+sSEFuZeKoTv6swYfEa8vL6YRdBlGPYXjQu3Z6Sd4wcj2m8vZKMYfKh/j MaY98uRspz4bIIdJBSZjcYrlhOnQP1VVZsrESIT34JA45vBTOVWC6Z2nLlbMGG5ZOnlz CBzRwFCODPRZoitKqrKadOvHEwCon6bNVgzHKx3v00EztSmaG23xRcQh34/Ik+VDqHD2 1UoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="jC6H/6so"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b7-20020a655cc7000000b005b958401e4fsi2042518pgt.418.2023.11.30.12.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:31: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; dkim=pass header.i=@chromium.org header.s=google header.b="jC6H/6so"; 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; 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 groat.vger.email (Postfix) with ESMTP id D3B15801D789; Thu, 30 Nov 2023 12:30:56 -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 S232464AbjK3Uah (ORCPT + 99 others); Thu, 30 Nov 2023 15:30:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232148AbjK3Uae (ORCPT ); Thu, 30 Nov 2023 15:30:34 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B19A11708 for ; Thu, 30 Nov 2023 12:30:40 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a18ebac19efso150412766b.0 for ; Thu, 30 Nov 2023 12:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701376239; x=1701981039; 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=0ze3g+KbzqGj36cXK4KXcn2SJ1PO+nJAvkG+kKo7vKI=; b=jC6H/6so6qOVA6bgYqPjfJLzj+Aim0sr8Y5sFupXQetgmB2t8qhLKb0l3KtiKZ1w+H 86COOvOmOGG8tT1IyEcl7GBcfxVNH/4YJVW6neK4m8BPuF6bGegrpAtGv0b1SD4gbea2 sdn+aazvx3Hgm3AVZlwBYFTeyCVoigJS2XIDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701376239; x=1701981039; 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=0ze3g+KbzqGj36cXK4KXcn2SJ1PO+nJAvkG+kKo7vKI=; b=ottzmyYwZcLdGN4nF444Jhh5uYfolmBHjhttbWoAE9fhhv5mCJXo7a7pdgPzJMTjSx ye9zfbAygp1pblsjyn3wLdxYWIGkuiSG9FZC29hVE/5vEqtYyd31psJZmf25q7B+zM5o 4JSrWrM9CiTkkzhSBQeUl4+IlYSZ6rZVTl/B0vaHtXEQBYjlI9TLnWfUOYtwVFcw5JS5 weNc0D+5Imj9Rnb2iIa9EIUAfGnPw15fKJqAiBLhkOYi3kxhk9raS54hB3JAnhoF+aa0 5aFVaMZ0pwW5iWJhXWHKPOQ4J1lHtBGXzJd0GvJ7f1ifD4EJXOpVoLU8QqngskINMdP8 TA3A== X-Gm-Message-State: AOJu0Yz6UETAgsYmsGaZxPbypuQgLOJ2y5ar8A+L15lJL7sgHT9/8X6C HkM8YXXDPojUgBopQc6f8tqep/ZrIAeSS2SyyXLCNg== X-Received: by 2002:a17:906:20d7:b0:a19:a409:37e3 with SMTP id c23-20020a17090620d700b00a19a40937e3mr151524ejc.60.1701376238996; Thu, 30 Nov 2023 12:30:38 -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> <8fbc81b1-31ab-46b0-87f4-b8bd8e8e2b47@pengutronix.de> In-Reply-To: <8fbc81b1-31ab-46b0-87f4-b8bd8e8e2b47@pengutronix.de> From: Simon Glass Date: Thu, 30 Nov 2023 13:30:21 -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 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 12:30:57 -0800 (PST) Hi Ahmad, On Wed, 29 Nov 2023 at 12:54, Ahmad Fatoum wrote: > > Hello Simon, > > On 29.11.23 20:44, Simon Glass wrote: > > 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(). > > 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. > > >> 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. > > I think it's better to drop this if it has no use. OK. I cannot think of a use for it. Regards, Simon