Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp586149rdb; Thu, 30 Nov 2023 12:31:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxla3n+SMO8btMTeY/LS7gLxCYXg8XbhsmIl1btsciXhRtsQxQ2CbFBkg0O5kIa3hSW991 X-Received: by 2002:a05:6a00:1382:b0:6c3:6ce2:46b0 with SMTP id t2-20020a056a00138200b006c36ce246b0mr28503645pfg.16.1701376316084; Thu, 30 Nov 2023 12:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701376316; cv=none; d=google.com; s=arc-20160816; b=RpTy4GPMNrQOQzwszhlUvENfCIHf9HbZ3adOjaBVnwKx/W0u/M0YHOZvCnYJq5Yp3w Co72op9ppyG0256YFGrYJTLAsSDIb4I6rpBfza+ApTbjUC3QQbkBrFrleo4+NVEwiVDj YsiaC/b8gtuobBH1CBHslrVx5U5ucDXMmfreOYNRpA8FugZlxEjiVmdigAO47MfqiUtO PAtwv8VN8OeGNAKTimSf+IP99M9CVdMV1ElzBHOHURjssFJwt5KRFy1sRn4Knr6nm+8j 0VIcdy+S1zrfkXJBA3uzB7XjnkEQYUnA87vfXka3KNFiuLceY27xy04WcEIQ7HGMAFzq wHOQ== 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=j1kEoDVz8FmA118BIct7BasaUqEKiq39maAWu6XgfrY=; fh=hE818ivoe0UZgus+AMQyIn64tEUoOmlIpLc/j3V+Ylg=; b=I2dCXOm42MmpV9KfManutUT6L5egfFq9WbW0qRaXqbVTNWrdO3y8OdSSTViWlfkK9G Y8DRyd+LfvcmHOX8ArJthVBBydvBgTBANPdiub3g9N5PqgJdWI7iy61QYaIO1ThWPsML KNrdKeKm17zYOHG1lgm5oA/NYOry1Sx3nXVusFLNLz3m14hTwESVReIyYlOiDMy8BNZx hxS+ThhnGOqaJcSPistxMj3NLOyxhwd96KfHZ3o3SPzUoZQV7DlDYnXwTyVEpp3+iM9e VkBq4WeB6qnL6RictNqz2hFbrwJt+4x0q3uZTwx7mRpI45b4ZSq49qLQBuzaBn6C2p+4 +UXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CpFPyt1F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c16-20020a056a000ad000b006cb686c08f4si1989188pfl.211.2023.11.30.12.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:31:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CpFPyt1F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 4735F80615FE; Thu, 30 Nov 2023 12:31:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376740AbjK3Uak (ORCPT + 99 others); Thu, 30 Nov 2023 15:30:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbjK3Uae (ORCPT ); Thu, 30 Nov 2023 15:30:34 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA9A51711 for ; Thu, 30 Nov 2023 12:30:40 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a00cbb83c82so199830666b.2 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=j1kEoDVz8FmA118BIct7BasaUqEKiq39maAWu6XgfrY=; b=CpFPyt1F1w6ken91peQku/clTFntwKIYj+QVeApvEoQ6+tEb3EDrUekIXWkRCkI1oi MKNUdA1sQxc6q1SFJ8KSbi+K6g0GM3oh60Iy+N25It8Z+Hw4mrxPmH/b91sWXW3jTwGq yOmC3ROPLfQWGMOPU7z9FGDzZ9Gb4qotV3fXo= 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=j1kEoDVz8FmA118BIct7BasaUqEKiq39maAWu6XgfrY=; b=f4ozGIxLkOxd8xEW02iH7DP7Qw5dIMcGUEmHuTGBsry12KdH9sedDHnbqW0B/IWc4c aJphCwNcYPBpgVjXXx74saUd1Rbx1jc6ETuVInmPSdx+bwMFEV+5xi/NmjlbS7XlUWvu bbAsOQhfsHkqQ0aO0FW0s3y4XbcTolT+Lz76+o/jXnV4qekapXzkIyCB6Qun0N9oU5hO hOewOtTp8vZfjPQsAxc2PiDYVyOVo8KdOXzLjwc9LT//nSdNv3khRdTPBH99XWIsfGyb YOncuVyCmCjOBvjuDxuWcSS7Vzh6ZAsDu4xPoaj92hVi0fTYxP7swA6J/GHeGTKQW9R2 nS4A== X-Gm-Message-State: AOJu0Yz0HOZcSYjuAgtStqk/sggD7Tyo7nt3Tv3xw8XaExNItQJVwc5D SvvSNyAOl4nJisFNlpyPCUQxo4eff6vhw4pY2TZu6z9cAN6/smXrJZE= X-Received: by 2002:a17:907:509d:b0:a0d:31:b455 with SMTP id fv29-20020a170907509d00b00a0d0031b455mr69707ejc.20.1701376238985; 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> <03595817-4698-46d3-b2d8-3bc40c7e723e@pengutronix.de> In-Reply-To: <03595817-4698-46d3-b2d8-3bc40c7e723e@pengutronix.de> From: Simon Glass Date: Thu, 30 Nov 2023 13:30:25 -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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 12:31:02 -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? I missed this comment earlier. I believe Image is intended to refer to a raw image, with the other extensions being compressed versions of these. So I believe it would be confusing for the FIT version to have a capital I. > > > 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? > > Please Cc me on subsequent revisions. I am interested in testing that this works for barebox > too. I have added you. Regards, Simon