Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp397380rdb; Thu, 30 Nov 2023 07:39:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG88+hEGkb/HE/j64evat2WBM8iV1W9Dr0U5Sqc6f+vqMlZJ/8wvZMx6l1k+7GAb0JmMKK+ X-Received: by 2002:a17:90b:3804:b0:285:cca0:df7f with SMTP id mq4-20020a17090b380400b00285cca0df7fmr14866757pjb.36.1701358765919; Thu, 30 Nov 2023 07:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701358765; cv=none; d=google.com; s=arc-20160816; b=lDjpa4XwPlMR+Ilmnt76q/8FjbmN9uaaK5e5CyuJLVcjBEwUeNB+U2mrTzZu+ReNXD rW663HIwHZK2Cp+SCG4bksp8I1gizIL3SzqpG8FMWy0QQID8oVa8K08oyR1So0PWxtO1 OZIZi2wnj8g4ECXzyxtZkAAlVORQfyn0jiCRv3VTHe6msHJABDcV2OZwrAVXkm9hcqDg Du+9Nbilg9+w77a2PNXhMcZgSZUynhvnjOvCdVvX7MPy/g5p9cQKRr0x+rvsiadJqGTX dAzIiczJupqXukqKeh5bAknSzz9ohqwHfKqniFF9Fdfw9EcniIYKoqnZ89bu9piuTLcF e7Tg== 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=5010wNrbdCmUYIGPXkFE+NdfWyqJH7oy6VzCYMAQ7wo=; fh=yTzSEUF0F6rqZbfzhmdlaXFpkQd+w3TdzEV66GJbaCk=; b=IZdfSGnR79YkNdt+PqAkJQfsO0NwrgNKAUPogD24x85aVv2vqYWF2LlGEcsnqlIDcD rqrw65swm/uE1si6u+znCy2isR+RbhSAsE6/ZhNKP7GrKxv7MF/2Kkyt7joCNml2+Nyz Z7yZ2+Mqi4+A5IKO4Upjnh0xIlmBKlGUeJqYzDNsNGMC0a4U+09Pq1zO9ldyGmvRtI7S 8vBP0wZ7Y3y8GY+VX0XwO9l4Kocg7uWaATID6bKH5kzleWnu/svGKpT9ED8folNnNAc2 ZKf6xu5JirocWyhJ9QhQApbA2zdw0jrvZwt+YWG0bFYsxBMjVtyKul0MrOd4kqMpOQ9s FmuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DlnyvfF6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id ss11-20020a17090b2ecb00b002860a91eba1si1734877pjb.117.2023.11.30.07.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:39:25 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DlnyvfF6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CA82482C403E; Thu, 30 Nov 2023 07:39:22 -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 S1346377AbjK3PjE (ORCPT + 99 others); Thu, 30 Nov 2023 10:39:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346365AbjK3PjD (ORCPT ); Thu, 30 Nov 2023 10:39:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D60F110DF for ; Thu, 30 Nov 2023 07:39:09 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DFBEC433C7; Thu, 30 Nov 2023 15:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701358749; bh=Wh8M9AbYS0w9KCv3VF1Tv2DWqWthaRO2rj6ZmBsIJsI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DlnyvfF6CmJRhAtNk/H7ubOi63Inp3I+Ndnrkns2azVUSILIJ6L51Woc55qdQ1V2S 7xDPx3+GdB30XkV7qSTYrPAQ91ymS1AA1IvfaLeIuS2ctP0fPLRHLrw8UnVH52vO95 PFhri+dSD36p/paXayQsP4cVYT/P4F3s+BR/kX/45OymE46CL23HDdNZYxxJkXo7Ro qm4y845YGEaCj5FRcP8ICWxI7uKxTyBNpAlCutSSSTSNQoYczvLjkg+pGGlBSs8sZ6 ILFHmpp53BBbUPs/TifmHy6BI+bVxPHK1IZUQk+qhoSZESMZfsqzbTbEC+1rzBzVmG yX23srCYuEYUQ== Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-1fa20395185so493476fac.3; Thu, 30 Nov 2023 07:39:09 -0800 (PST) X-Gm-Message-State: AOJu0YywyrUFXchG6rZKCnq9ueXWtRX50JSkvst1NrvfOadiPJGYfXCA aOAXc+p9KgayFKMpfxpUuJ93RZLSZko20QYf14Y= X-Received: by 2002:a05:6871:58a1:b0:1f9:e123:4fb with SMTP id ok33-20020a05687158a100b001f9e12304fbmr25407502oac.55.1701358748892; Thu, 30 Nov 2023 07:39:08 -0800 (PST) MIME-Version: 1.0 References: <20231129172200.430674-1-sjg@chromium.org> <20231129172200.430674-3-sjg@chromium.org> In-Reply-To: <20231129172200.430674-3-sjg@chromium.org> From: Masahiro Yamada Date: Fri, 1 Dec 2023 00:38:32 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 2/2] arm64: boot: Support Flat Image Tree To: Simon Glass Cc: linux-arm-kernel@lists.infradead.org, Tom Rini , lkml , U-Boot Mailing List , Catalin Marinas , Nathan Chancellor , Nick Terrell , Nicolas Schier , Will Deacon , linux-kbuild@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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]); Thu, 30 Nov 2023 07:39:23 -0800 (PST) On Thu, Nov 30, 2023 at 2:22=E2=80=AFAM Simon Glass wrot= e: > > 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. > > 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. > > Signed-off-by: Simon Glass > --- > > Changes in v7: > - Add Image as a dependency of image.fit > - Drop kbuild tag > - Add dependency on dtbs > - Drop unnecessary path separator for dtbs > - Rebase to -next > > Changes in v5: > - Drop patch previously applied > - Correct compression rule which was broken in v4 > > Changes in v4: > - Use single quotes for UIMAGE_NAME > > Changes in v3: > - Drop temporary file image.itk > - Drop patch 'Use double quotes for image name' > - Drop double quotes in use of UIMAGE_NAME > - Drop unnecessary CONFIG_EFI_ZBOOT condition for help > - Avoid hard-coding "arm64" for the DT architecture > > Changes in v2: > - Drop patch previously applied > - Add .gitignore file > - Move fit rule to Makefile.lib using an intermediate file > - Drop dependency on CONFIG_EFI_ZBOOT > - Pick up .dtb files separately from the kernel > - Correct pylint too-many-args warning for write_kernel() > - Include the kernel image in the file count > - Add a pointer to the FIT spec and mention of its wide industry usage > - Mention the kernel version in the FIT description > > MAINTAINERS | 7 + > arch/arm64/Makefile | 9 +- > arch/arm64/boot/.gitignore | 1 + > arch/arm64/boot/Makefile | 6 +- > scripts/Makefile.lib | 13 ++ > scripts/make_fit.py | 289 +++++++++++++++++++++++++++++++++++++ > 6 files changed, 322 insertions(+), 3 deletions(-) > create mode 100755 scripts/make_fit.py > > diff --git a/MAINTAINERS b/MAINTAINERS > index 14587be87a33..d609f0e8deb3 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1585,6 +1585,13 @@ F: Documentation/process/maintainer-soc*.rst > F: arch/arm/boot/dts/Makefile > F: arch/arm64/boot/dts/Makefile > > +ARM64 FIT SUPPORT > +M: Simon Glass > +L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribe= rs) > +S: Maintained > +F: arch/arm64/boot/Makefile > +F: scripts/make_fit.py > + > ARM ARCHITECTED TIMER DRIVER > M: Mark Rutland > M: Marc Zyngier > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 1bd4fae6e806..18e092de7cdb 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -36,6 +36,8 @@ ifeq ($(CONFIG_BROKEN_GAS_INST),y) > $(warning Detected assembler with broken .inst; disassembly will be unre= liable) > endif > > +KBUILD_DTBS :=3D dtbs Please remove this, and hard-code image.fit: dtbs > > $(obj)/Image: vmlinux FORCE > $(call if_changed,objcopy) > @@ -39,6 +40,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE > $(obj)/Image.zst: $(obj)/Image FORCE > $(call if_changed,zstd) > > +$(obj)/image.fit: $(obj)/Image FORCE > + $(call cmd,fit,gzip) The gzip parameter is not used. Please do $(call cmd,fit) In the python script, functions are separated with two blank lines, but there is only one blank line between parse_args() and setup_fit(). I do not mind either way because it does not contain any class, but please keep consistency. -- Best Regards Masahiro Yamada