Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp428659rdb; Tue, 5 Dec 2023 09:08:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IENbiiEOG3OHTjOkCEnuVo1yWUQ2Afnaxtx42DM/51cIvLmcVvQuka20OsfU9SV/S/35djQ X-Received: by 2002:a05:6358:224c:b0:170:17eb:9c53 with SMTP id i12-20020a056358224c00b0017017eb9c53mr7879378rwc.52.1701796081115; Tue, 05 Dec 2023 09:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701796081; cv=none; d=google.com; s=arc-20160816; b=trxtYTQDmyL6Dc9qpiyYPqa0QX8eNoxlAZ5R667qk6IluUHElbFs9QugXOC30Bk/kt n395eQUhlLSXBp2698MmpBoGUZeWLFKyqw1FQ3o5GwTh8J14picAGGiEb2WZ/3KdVSO/ HxLViEhMUBBNcwH3cvlSVPCCiawZQ51aHtma4MUCxITUW3Rnk7NLg5alYwarXH41mvM7 QJxY5yrqXxy0ZmQ0nQbQJiOFqZPxm4SrO+X774w5pYoBdApxIH9PKqZOPsbr57ZKOiVZ 7532nRu7B7KjQrfxZMhteH1TFQ/BkxfhAhhZJ2LJuEejzxhBl22FbJKcOpH9X4fWxKdv 9lGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GogvKYbQyGOCRhiy1zkw59fx2NhkM53PaJQFqQ8453o=; fh=kQFEzF8xm+QBpKtsrS3/1mVOl5awEbtzTA4IBSpf7RU=; b=rc7YphaukKzOqoZOnQdf7C91Rx2opHizA1vC0/TlaWsjA7bCJ4cUGJ3f9qjmNRAsEM 3I25nOULznVV3tJbM96k1rRLWDwaHHwHBtqXDrW6pSAag2g9TMGYOWgyFhSuUJuKM6oH 00jCn6Pjq/dGgIxOxhuBRgPvDKv5SEvgEP6HUxWZokdbtSOvsZMNwYhFJfOW9IcT4RfD iPSlISNL74tk6chIByKsZkNfzx47rMuqxKhTgw67CJsrPVyUMjlXOw61Cd8+KHLnQzvX Pttizs5RuQC05+vgnLy9DmF0KQIazmB+btX00D833FpIEq3458+VxtjLmHzgx4xtV+o0 tX/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="kSR/qX8e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d12-20020a056a00198c00b006ce6518530dsi2132512pfl.366.2023.12.05.09.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:08:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="kSR/qX8e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id D89478090FB7; Tue, 5 Dec 2023 09:06:57 -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 S1345137AbjLERGr (ORCPT + 99 others); Tue, 5 Dec 2023 12:06:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjLERGq (ORCPT ); Tue, 5 Dec 2023 12:06:46 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E3A2A9 for ; Tue, 5 Dec 2023 09:06:52 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-54c846da5e9so2997795a12.3 for ; Tue, 05 Dec 2023 09:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701796009; x=1702400809; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GogvKYbQyGOCRhiy1zkw59fx2NhkM53PaJQFqQ8453o=; b=kSR/qX8eSF/kna670KWp9gv6ltkBzfhmX6J7Kwmwo9s2L6Oea/3P5meD8dVZv8v5KP PRFUiXr9owQi5djmXOVq2ILL68HHzJ0nXMs5hMhYz7y+IC6Hso72N+hJoVN0dlUJCuSH N/sJRuyegqgFYi2PdkZL2CrjLPl3/40GRk5s4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701796009; x=1702400809; h=content-transfer-encoding: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=GogvKYbQyGOCRhiy1zkw59fx2NhkM53PaJQFqQ8453o=; b=dTDewjm6iBQUrcGL0t7kTta6+1fY/WxgG45xYBDieSqsCeRkLhAB1wQrTqm+H+lgAy MpAHTKnSNswxr4EC544HX0f9TMdy3tKai9+bt2WNTy6787jqP/wrWvbotCGGYXcyjlxp Dni324u7QqtBAmFIztGa5EsSktRZ6k1kbs1pyjhvmRDY4i2Mq7MzfNNf2+mxG4yVJoEg QbyS6HxNVyN+iAKuEUJM9aPwuveyfUAcvNWrwXJk19liNaVNhq4DCSkS+R+V9itsVc1i P1/7h5Fi/W2V2AshgEnTsehzgSHhReUoQ+1rqg4AEt+66kspujsImqlqzWxHuvI1RJAs B9ZQ== X-Gm-Message-State: AOJu0YxYujj88cfrpL9EW0dj/L/bqsRN2pbyN3JHJoTOqqF7NOp+wCTM 9V08ohy8yhg8Ht2wcmZcAhdoCZeRleSc416d74AD9dTI X-Received: by 2002:a17:906:87:b0:a1c:9719:d9b with SMTP id 7-20020a170906008700b00a1c97190d9bmr715074ejc.12.1701796008198; Tue, 05 Dec 2023 09:06:48 -0800 (PST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com. [209.85.128.41]) by smtp.gmail.com with ESMTPSA id h18-20020a170906111200b00a0d02cfa48bsm6983791eja.213.2023.12.05.09.06.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Dec 2023 09:06:47 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40b422a274dso87135e9.0 for ; Tue, 05 Dec 2023 09:06:47 -0800 (PST) X-Received: by 2002:a05:600c:54e7:b0:3f7:3e85:36a with SMTP id jb7-20020a05600c54e700b003f73e85036amr548585wmb.7.1701796006690; Tue, 05 Dec 2023 09:06:46 -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> <5e8f42f8-2b03-4033-b6d2-9b3139f081d5@pengutronix.de> <653b592b-bd6a-48f8-acca-c617c5c8c1a3@pengutronix.de> In-Reply-To: <653b592b-bd6a-48f8-acca-c617c5c8c1a3@pengutronix.de> From: Doug Anderson Date: Tue, 5 Dec 2023 09:06:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 2/2] arm64: boot: Support Flat Image Tree To: Ahmad Fatoum Cc: Simon Glass , 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" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 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]); Tue, 05 Dec 2023 09:06:58 -0800 (PST) Hi, On Tue, Dec 5, 2023 at 3:16=E2=80=AFAM Ahmad Fatoum wrote: > > Hello, > > On 04.12.23 18:52, Doug Anderson wrote:> On Sat, Dec 2, 2023 at 8:37=E2= =80=AFAM Simon Glass wrote: > >> On Thu, 30 Nov 2023 at 19:04, Ahmad Fatoum w= rote: > >>> 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: > >>>> 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 =3D "vendor,board-rev-a", "vendor,board-rev-b"; > >>> > >>> I fail to see a utility for a configuration with > >>> > >>> compatible =3D "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. > >> > >> Firstly, I am not an expert on this. > >> > >> Say you have a board with variants. The compatible string in U-Boot > >> may be something like: > >> > >> "google,veyron-brain-rev1", "google,veyron-brain", "google,veyron", > >> "rockchip,rk3288"; > >> > >> If you then have several FIT configurations, they may be something lik= e: > >> > >> "google,veyron-brain-rev0", "google,veyron-brain", "google,veyron", > >> "rockchip,rk3288"; > >> "google,veyron-brain-rev1", "google,veyron-brain", "google,veyron", > >> "rockchip,rk3288"; > >> "google,veyron-brain-rev2", "google,veyron-brain", "google,veyron", > >> "rockchip,rk3288"; > >> > >> You want to choose the second one, since it is a better match than the= others. > > Now imagine, you are building a kernel that has no DT support for the Vey= ron, > but instead has support for the Phytec RK3288 PCM-947: > > phytec,rk3288-pcm-947", "phytec,rk3288-phycore-som", "rockchip,rk3288 > > As far as I understand U-Boot code, A veyron U-Boot would boot the Phytec= DT > if CONFIG_FIT_BEST_MATCH is set, although it's a bad match and a boot fai= lure > should rather have occurred. On depthcharge the bootloader never matches on just a SoC name. > >> +Doug Anderson who knows a lot more about this than me. > > > > Hopefully this is all explained by: > > > > https://docs.kernel.org/arch/arm/google/chromebook-boot-flow.html > > Thanks Doug, this was helpful. The missing information to me was that > depthcharge only compares the top-level board compatible in addition > to runtime generated board compatibles, unlike what U-Boot seems to do. > > barebox only compares its top-level compatible against the FIT configurat= ion > compatibles, so adding a full compatible list to the configuration nodes = as done > by this series should be ok there as well. I think U-Boot could run into > issues though as described above. > > Out of curiosity: I only heard about Depthcharge before as exploitation t= oolkit > for U-Boot. Can you point me at some documentation on what the Depthcharg= e bootloader > does what U-Boot (which was presumably used before?) doesn't? I can only assume that the depthcharge you're talking about is different. The one used by Chromebooks is basically: https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/he= ads/main I assume you're asking: why are we using depthcharge in ChromeOS instead of U-Boot? There was much discussion about this back in the day. From what I recall, part of the reason was that folks wanted the boot flow to be a bit more standard between x86 Chromebooks and ARM Chromebooks. x86 Chromebooks were using coreboot for the initial hardware booting and then needed a 2nd stage to actually load Linux and ended up creating depthcharge. ...and then we switched to the same model for ARM boards. I didn't personally make that decision and I'm also not on the firmware team, so that's about all I'll say on the topic. ;-) Oh, hmmm. Searching found me: https://www.chromium.org/chromium-os/developer-information-for-chrome-os-de= vices/custom-firmware/ ...which pointed at: https://www.chromium.org/chromium-os/2014-firmware-summit/ChromeOS%20firmwa= re%20summit%20-%20Depthcharge.pdf -Doug