Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3005907rdb; Sat, 9 Dec 2023 07:31:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0r2mkQTZb7MhqUONcqpOXK6+X6GLXZxB5psXqAZwfereAzUJLxbs+ZYXoA5KniLtzxeHD X-Received: by 2002:a17:90a:c251:b0:286:e8c9:44ec with SMTP id d17-20020a17090ac25100b00286e8c944ecmr979988pjx.80.1702135864657; Sat, 09 Dec 2023 07:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702135864; cv=none; d=google.com; s=arc-20160816; b=lGEco9hS57fCz8Sv2kI7GufZld98CxTZbFSykpqcpO0DttA7AWt7ox4TLdSntmT6a1 EctQMKOUkWhKnnc8g+aaZuFxL8/YScijm/w8DiRGR9FrUVvYorlapMLIM36FFW4A0DlA C1PX4wzdxlouxYhYls3thGy24ypflhHnprdC0tc4q+NcexmzdhbBgbKoopFChOGTj3pC 5KIzJM/8pE+pchzO/xie5vZIpJpeOqcEwMuGnn+iyNgWv727cLhnKu3j0EmIfDZRQOkQ OQ6qNAgaCEC5JvVkP12MhrR740tMvItkAOzVF59bzb26nh/0w5GzWd3ceuSMWrfmWFGt 8/tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0N3TcOIM23XTcI6dUzKtqGI6rEPSstWwAe181QdD3ak=; fh=YXXkiFYwkrNttIlHyOLnWSrG0i0DpfJGuML4QS8Cb7Y=; b=mOfVX3OlIIcQjj3mwVYqmJRE2DMJdR4Vxlcuw4XKcw6uZQgYCIlzjPLYJ+qnrVTP5S yvpF9opGdA2V8Bv2JooR5yvK//BBlK/+yPQrPpkcDAfJrtGEXhL1SK9StIW0jBJkteui L0nqmxQb1Q2PCAA6LgnfmrPZUtlTjhuc7q1JA4BJb9Nmt3r5UxpDZz9rZ/gOsOLekmge MBye3cKEzgFVAuiAvwhRhz0i5pKlQyRoOUxZpk3s94ASHh8cpvM5NkYHY4dxnGztSj/u q+m6SkcMCxB3dQEWhVXUB8XMREYPK8LNy5r6GD9UsOXmcSEtmZulRWlgsnvuFqNab2wC 3goA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=FHFbiXTn; 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 ch9-20020a17090af40900b002886d6c7ea2si3273645pjb.177.2023.12.09.07.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 07:31:04 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=FHFbiXTn; 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 DC07680755D8; Sat, 9 Dec 2023 07:30:12 -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 S232140AbjLIP3l (ORCPT + 99 others); Sat, 9 Dec 2023 10:29:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232006AbjLIP3h (ORCPT ); Sat, 9 Dec 2023 10:29:37 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2811A11D; Sat, 9 Dec 2023 07:29:43 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 15A7E25A; Sat, 9 Dec 2023 16:28:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1702135738; bh=6hFFvOxTW1/3aaX8jGizMoDG6E623DXFkvEtdM2wg6k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FHFbiXTn7OCz6eGZWAAKCsnzsdPUOmgiE2RC/qUzjEe8w6I54K6l92xZq2dSsjKBI B9CQDVr+RhQJ+qN7XOLzN3ZqdzOcisy+LTxGZlOTUMQOgpywLKyQRlgInt0vyjxRQd 0uUPyZ8UFTDQjVtBV2adaVy0tEIlRybFmoW2Sag0= Date: Sat, 9 Dec 2023 17:29:46 +0200 From: Laurent Pinchart To: Chen-Yu Tsai Cc: Simon Glass , linux-arm-kernel@lists.infradead.org, Masahiro Yamada , Ahmad Fatoum , U-Boot Mailing List , Nicolas Schier , Tom Rini , Catalin Marinas , Jonathan Corbet , Nathan Chancellor , Nick Terrell , Will Deacon , linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, workflows@vger.kernel.org Subject: Re: [PATCH v9 2/2] arm64: boot: Support Flat Image Tree Message-ID: <20231209152946.GC13421@pendragon.ideasonboard.com> References: <20231202035511.487946-1-sjg@chromium.org> <20231202035511.487946-3-sjg@chromium.org> <20231203153401.GV8402@pendragon.ideasonboard.com> <20231207142723.GA3187877@google.com> <20231207143814.GD15521@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,PDS_OTHER_BAD_TLD,SPF_HELO_PASS, 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]); Sat, 09 Dec 2023 07:30:13 -0800 (PST) On Sat, Dec 09, 2023 at 10:13:59PM +0900, Chen-Yu Tsai wrote: > On Thu, Dec 7, 2023 at 11:38 PM Laurent Pinchart > wrote: > > > > On Thu, Dec 07, 2023 at 10:27:23PM +0800, Chen-Yu Tsai wrote: > > > On Sun, Dec 03, 2023 at 05:34:01PM +0200, Laurent Pinchart wrote: > > > > Hi Simon, > > > > > > > > Thank you for the patch. > > > > > > > > On Fri, Dec 01, 2023 at 08:54:42PM -0700, Simon Glass wrote: > > > > > Add a script which produces a Flat Image Tree (FIT), a single file > > > > > containing the built kernel and associated devicetree files. > > > > > Compression defaults to gzip which gives a good balance of size and > > > > > performance. > > > > > > > > > > The files compress from about 86MB to 24MB using this approach. > > > > > > > > > > The FIT can be used by bootloaders which support it, such as U-Boot > > > > > and Linuxboot. It permits automatic selection of the correct > > > > > devicetree, matching the compatible string of the running board with > > > > > the closest compatible string in the FIT. There is no need for > > > > > filenames or other workarounds. > > > > > > > > > > Add a 'make image.fit' build target for arm64, as well. Use > > > > > FIT_COMPRESSION to select a different algorithm. > > > > > > > > > > The FIT can be examined using 'dumpimage -l'. > > > > > > > > > > This features requires pylibfdt (use 'pip install libfdt'). It also > > > > > requires compression utilities for the algorithm being used. Supported > > > > > compression options are the same as the Image.xxx files. For now there > > > > > is no way to change the compression other than by editing the rule for > > > > > $(obj)/image.fit > > > > > > > > > > While FIT supports a ramdisk / initrd, no attempt is made to support > > > > > this here, since it must be built separately from the Linux build. > > > > > > > > FIT images are very useful, so I think this is a very welcome addition > > > > to the kernel build system. It can get tricky though: given the > > > > versatile nature of FIT images, there can't be any > > > > one-size-fits-them-all solution to build them, and striking the right > > > > balance between what makes sense for the kernel and the features that > > > > users may request will probably lead to bikeshedding. As we all love > > > > bikeshedding, I thought I would start selfishly, with a personal use > > > > case :-) This isn't a yak-shaving request though, I don't see any reason > > > > to delay merging this series. > > > > > > > > Have you envisioned building FIT images with a subset of DTBs, or adding > > > > DTBOs ? Both would be fairly trivial extensions to this script by > > > > extending the supported command line arguments. It would perhaps be more > > > > difficult to integrate in the kernel build system though. This leads me > > > > to a second question: would you consider merging extensions to this > > > > script if they are not used by the kernel build system, but meant for > > > > users who manually invoke the script ? More generally, is the script > > > > > > We'd also be interested in some customization, though in a different way. > > > We imagine having a rule file that says X compatible string should map > > > to A base DTB, plus B and C DTBO for the configuration section. The base > > > DTB would carry all common elements of some device, while the DTBOs > > > carry all the possible second source components, like different display > > > panels or MIPI cameras for instance. This could drastically reduce the > > > size of FIT images in ChromeOS by deduplicating all the common stuff. > > > > Do you envision the "mapping" compatible string mapping to a config > > section in the FIT image, that would bundle the base DTB and the DTBOs ? > > That's exactly the idea. The mapping compatible string could be untied > from the base board's compatible string if needed (which we probably do). > > So something like: > > config { > config-1 { > compatible = "google,krane-sku0"; > fdt = "krane-baseboard", "krane-sku0-overlay"; > }; > }; > > With "krane-sku0-overlay" being an overlay that holds the differences > between the SKUs, in this case the display panel and MIPI camera (not > upstreamed) that applies to SKU0 in particular. The kernel DT makefiles already contain information on what overlays to apply to what base boards, in order to test the overlays and produce "full" DTBs. Maybe that information could be leveraged to create the configurations in the FIT image ? > Sorry for not giving a more concrete idea. > > > > > meant to be used stand-alone as well, in which case its command line > > > > arguments need to remain backward-compatible, or do you see it as being > > > > internal to the kernel ? > > > > > > [...] -- Regards, Laurent Pinchart