Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4802703rdh; Wed, 29 Nov 2023 11:02:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdnRJt79PcV9Kb5RvSRvhQkjH7hjfOTYR86VCoPwjvqjFAos8qHavoj32Jj28wwMQ4+rCZ X-Received: by 2002:a05:6870:aa86:b0:1f0:b31:9b7 with SMTP id gr6-20020a056870aa8600b001f00b3109b7mr23216039oab.43.1701284568620; Wed, 29 Nov 2023 11:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701284568; cv=none; d=google.com; s=arc-20160816; b=jn+GbOuxQ4WZzvLEwJK7ZmHLu7cWyIt/p6eo/2LpDOGh5RoSyXTH2HCsR3ofk/7TVD 4vwJWT+uZbBTvjJAtea2zLrsBYRqpJcuqVvBYAUW3yGE4NIjoDf2J39jVddOz3qZMlJH IIERoFb9rb4MOEZJHXQzGdC6tPshHdYIi3lrVSinmj8hFVpqoGtPu4ZXBCZsMFHOPzr6 9NcCnjiPgtgVcdp30m9LnXNeALmem8Fem/lfr2FjH35ov/oA5a0aZ0/liolW9glnupcT bqUo2ZsYSzhr5l3Fb7g51h/YbUvnK11hFR4D1RHbrGMJ86pd6IdSZ9cif4iTidK9Vapa z4IA== 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=zeJS0+YXgcV8K2msfYPrZc7s+u+FFHEg7gVWXomud/s=; fh=hE818ivoe0UZgus+AMQyIn64tEUoOmlIpLc/j3V+Ylg=; b=dlIzUvl60Pa1w+f+F5svRB1XnTc2uX6lv3nt0V234duCpD4YcTy/TZHN/zDrqrCkqZ Sqx3/0NGZCPyO0IAJvCt/FRYxHCTaDvXa65uCTixfAWAKDXcKM9rwBiZnMD7Y7yPHvA/ vVu+iCUa9M+wN170RO0C1gbYIFeTtfhH00e8MZNRUozBIOwC91TcLcr9BvnC8cWslZxm I8+DF/dlm/aT598kfrUzhHY0GJ3EZnKlwawQ0KxbDNSJ2cBsYa7bOi10Ugdpm90TDpQn Lqw1HFKVzZR3rydcqhUq+TnIkzVllecBWozzSFalDWNkeEAc8iTXO8880S3HbsEagviF MWEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OD3XxVK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id an28-20020a056871b19c00b001dd6f0fe1bcsi5255109oac.282.2023.11.29.11.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 11:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OD3XxVK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 7FF878076D28; Wed, 29 Nov 2023 11:02:45 -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 S234517AbjK2TCb (ORCPT + 99 others); Wed, 29 Nov 2023 14:02:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233522AbjK2TCS (ORCPT ); Wed, 29 Nov 2023 14:02:18 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1E7211C for ; Wed, 29 Nov 2023 11:01:20 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a00a9c6f283so15679666b.0 for ; Wed, 29 Nov 2023 11:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701284479; x=1701889279; 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=zeJS0+YXgcV8K2msfYPrZc7s+u+FFHEg7gVWXomud/s=; b=OD3XxVK33Jk4FAMbrbrcD5SIos1Wq3jYnO+UrQYXjUGimH9LEBs0EmZo8HKwDvjkWo 7xMY5cvOo9ObxvdZ0WHJoqylxbhCzfXz4fqpD5Rd+6Ha0G0fd2fzCAY4+ycoJT4YsNFn f7x8+YUyDOyWcL9cT0vhxsElQge7hR3RhX99E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701284479; x=1701889279; 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=zeJS0+YXgcV8K2msfYPrZc7s+u+FFHEg7gVWXomud/s=; b=Z+bdHfSTtfDU+CP8enAh02zzwpdW5EEOH7NenJ2IpIF6+eFOGF+9XBE5Qh5AvGm5Af 3gALDMBMVBEv8YUkvXZFgT6ZESkR8cQmh3pGMiN4oA/VuEVdlD6NaBZWYZG5qSyxlt09 QD2fibOrZkrieKllQQfhVDjaWp/C12qBZM2ilzCjgcg4jDbSqq7vB+NBPlb8vSxZrXLW 8njaLBV4SrF9axf+uxDKQInE8Bv/9rI1X3Bz5k/MDX2/Gt54RALuZklSwvEMJB7+jumD szyVjEUPWBKd2g2++NTP4TDhwvJrEJguuj0Esp5tFf2MMrkDg6VqMZfXaah0z4/fYsCX 2bAw== X-Gm-Message-State: AOJu0YxlAFpeLJQOvmVMoVp6OAbyukOs3w/vpcJ2q9wHu34bdU/p9ir3 ZCmXhkb7K/NYY3KRDit81eZpxch3Cgofx59mdJfZLQ== X-Received: by 2002:a17:906:7245:b0:a01:e916:3584 with SMTP id n5-20020a170906724500b00a01e9163584mr12542566ejk.54.1701284479022; Wed, 29 Nov 2023 11:01:19 -0800 (PST) MIME-Version: 1.0 References: <20231129172200.430674-1-sjg@chromium.org> <20231129172200.430674-3-sjg@chromium.org> <03595817-4698-46d3-b2d8-3bc40c7e723e@pengutronix.de> In-Reply-To: <03595817-4698-46d3-b2d8-3bc40c7e723e@pengutronix.de> From: Simon Glass Date: Wed, 29 Nov 2023 12:00:59 -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_PDS_OTHER_BAD_TLD, 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]); Wed, 29 Nov 2023 11:02:45 -0800 (PST) Hi Ahmad, On Wed, 29 Nov 2023 at 11:35, Ahmad Fatoum wrote: > > Hello Simon, > > On 29.11.23 18:21, 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. > > Thanks for working on this. I think it's useful to have the kernel > generate a FIT image out of the box. More complex use cases are always > free to call mkimage with a custom ITS. > > > > 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. > > not that it matters much, but should this maybe called Image.fit > as the other Image types are capitalized too? > > > EFI_ZBOOT_PAYLOAD := Image > > EFI_ZBOOT_BFD_TARGET := elf64-littleaarch64 > > EFI_ZBOOT_MACH_TYPE := ARM64 > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > index 1a965fe68e01..e1c06ca3c847 100644 > > --- a/scripts/Makefile.lib > > +++ b/scripts/Makefile.lib > > @@ -496,6 +496,19 @@ quiet_cmd_uimage = UIMAGE $@ > > -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ > > -n '$(UIMAGE_NAME)' -d $< $@ > > Doesn't hardcoding a load address and entry address here defeat the point > of having FIT as generic portable image format? > > At least barebox will try to place the kernel image at physical address 0 and > will exit with an error message if no SDRAM is located at that address. > The recommendation in that case is to omit load and entry address altogether > to have barebox find a suitable location, but I see now that the FIT specification > requires a load and entry address. What would happen if U-Boot tries to load this > FIT image on a board that has no DRAM at address 0? The 'kernel_noload' type indicates that the load/exec address are ignored. > > Please Cc me on subsequent revisions. I am interested in testing that this works for barebox > too. There has been some discussion about this recently in U-Boot too, along with a series [1] which you could try if you like. The FIT spec[2] does not provide enough detail on exactly what kernel_noload means and we should improve this at some point. Regards, Simon [1] https://patchwork.ozlabs.org/project/uboot/list/?series=382849 [2] https://github.com/open-source-firmware/flat-image-tree > > 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 | >