Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp206684rdb; Tue, 5 Dec 2023 03:16:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFStcXdYcDCGWj40rwt1aX+TrQ6c+FozFG5s/W2rwYtIHbktOLdO9s2ixDmNkz2sfviKfCu X-Received: by 2002:a17:90a:dc14:b0:286:7609:5145 with SMTP id i20-20020a17090adc1400b0028676095145mr684684pjv.62.1701774988516; Tue, 05 Dec 2023 03:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701774988; cv=none; d=google.com; s=arc-20160816; b=pH0uulC7qSA7WvLg0CtPx28wJUyJElO8pbarjizrZt+4nS+b8ADJngO7BmfDbX8L+B HOpL1rh4MX+ybLQSEv1HrCiSqJJWg8qAsEWiWS7pqdXgnAsqwIhrfcsKwI3m6QOpKlf+ y/jCrcM520p9u35KrOJ7yHmACOMdbBpp8ckXX3/N+3SXByOUz+PJlPKdgXZVYS5tI3tj rnT05en3KVQw7ZDQOQ10bAlnYGMeBQ8uUvscXV/DJA0UHvFsW82k8O31HUwAx0A4LtXH j8SJzCgF9ZV5RziaUZTRAx0bsenH7KipEThPjBQE8is3KlcY/dH6Wrv9nFg9ZspoHYBZ pltw== 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=VOFmS7vHlwav+JU0YaN3H0Z0PElMJ4gelZCWMRra/t0=; fh=4o2HQWYDT+ZQRYSkDSq5Vqr/7z7WIV6cBuHj7DW5Ye0=; b=ifIjDevWo2PZi6yNRHDRUXhWiTColDm8lKY4WDMyIaLN8F9EmsNL0nhy3p9Jd8VlKE 6b1iE6UslbYRXrnKq3b9f2qEOS9iVhLfeYKWcBC49E7AfY0gN/PdU+r+nTnvclRcthEX kWpXlqbKJpE1A5Ti7lpc8VcYeQie9Wd3ZJN1StbIlX8enso2uxxC/LxUEv9fnlSCiasM 7FJVFgi36Xk3c4dC3LL1C82GBGzBCnVRtzCqpeL1HShWjI2n2I9NZ3Ad5HkAo2kYwXCC XBB9Nd4ondVmUehGo8pNl2XrL4k6ttWhkpj6VtJc2GE3IwTwCn1N80wQNlcH8mVreN+4 iquQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id mq12-20020a17090b380c00b00285cc4f0e09si10057217pjb.185.2023.12.05.03.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:16:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id F1253812E036; Tue, 5 Dec 2023 03:16:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345052AbjLELQI (ORCPT + 99 others); Tue, 5 Dec 2023 06:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376995AbjLELQF (ORCPT ); Tue, 5 Dec 2023 06:16:05 -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 A2BDA116 for ; Tue, 5 Dec 2023 03:16:11 -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 1rATPF-0002Xs-96; Tue, 05 Dec 2023 12:16:01 +0100 Message-ID: <653b592b-bd6a-48f8-acca-c617c5c8c1a3@pengutronix.de> Date: Tue, 5 Dec 2023 12:15: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: Doug Anderson , 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> <5e8f42f8-2b03-4033-b6d2-9b3139f081d5@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:16:25 -0800 (PST) Hello, On 04.12.23 18:52, Doug Anderson wrote:> On Sat, Dec 2, 2023 at 8:37 AM Simon Glass wrote: >> On Thu, 30 Nov 2023 at 19:04, Ahmad Fatoum wrote: >>> 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 = "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. >> >> 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 like: >> >> "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 Veyron, 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 failure should rather have occurred. >> +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 configuration 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 toolkit for U-Boot. Can you point me at some documentation on what the Depthcharge bootloader does what U-Boot (which was presumably used before?) doesn't? Thanks, 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 |