Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp835047lqh; Thu, 28 Mar 2024 19:47:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVKX8ZL7GcDbI7DCueApV8VSinbqqc/kFtwB+nWMCTJe/tVEvdbBM+oiiFMMC3TJbEvOjPIKdIsq37958LiE/ENoStF/Hq8MRPHsTz+w== X-Google-Smtp-Source: AGHT+IGagq1VHD6wbV8eNMN/KF2oPttqaxEziYD5jsxCEpHOT0iidJicLUP+6k6H54dxhXSRHg1z X-Received: by 2002:a17:906:a190:b0:a47:1911:51d9 with SMTP id s16-20020a170906a19000b00a47191151d9mr522815ejy.73.1711680430207; Thu, 28 Mar 2024 19:47:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711680430; cv=pass; d=google.com; s=arc-20160816; b=mpY91yj+snrOA2fHPn05yRPj8eO8cp/+llmGkFvS9CWhGx5mt3//nQzfYjU9A9nQJk Bf55eyMl65Gy3o2D6fsQIuQvzEomDPV/d7cJ7UYlYZoh6jYkM386YXqV86vfxUBun7SN CEFi9Nj0lOfGMOJ09QMEo8JceBu96jCoKXDzCbq0K7rpNcc6W0cfDvSUJlMAZfAQYSHL tIenhu7JtJD5j4y8t2hvqiCzudUeAGDIKLiEeMfCifsaIJ+rRBjbBeshv+Xbc+CUaqXj uTj0C2/43109qn0r1pDBiyY6zwtC82lwzMeboTkJa1TJ96LzCbjdNoQndnUkmP0jCm1x 72vQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=srQfKT/BzMmZwEI+1YQrBRXDf12Tn35MF+VDUldciyU=; fh=A+bX7BOqn9RvJLQryv1uh5e/Dz7xgBl6R/y7l6yPHKQ=; b=O3jhFNSYpl8/o4Lh4su9ufnLRFYBFDjGsCoCH303pobOWnBpWJ9GonGu/Fux9xXEHC wqqBBDqvr3G38l1pcAXDS5MRY6laIcjtI1m5StVPScI+F+sjNdzpk4Oefa8FisHkz07r WaMpS9JCyo4u/c9RVhNefL8gUtXxNAUV7uHSwup19VXmpXRsxuYvKhB0n2Jts8IKjvE4 aC51Pja6yhsEjFOpaUPQkGq39+oCDpoKe8cwynp3uMhw7xkWEmKdqsgs98W45SxEkqhR 7lUQh1e7+S4EaTIXewc/qmOrXyHPvr3hmblWCYpsd5fnGqBCYGuIbccDIG403DEO1rAH /iZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gH8uu2E+; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-124067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z4-20020a170906714400b00a4663450061si1313114ejj.273.2024.03.28.19.47.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 19:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gH8uu2E+; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-124067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AD5141F226E7 for ; Fri, 29 Mar 2024 02:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CECC36AF9; Fri, 29 Mar 2024 02:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gH8uu2E+" Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 041AE2261F for ; Fri, 29 Mar 2024 02:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711680420; cv=none; b=gEZxsZXN/eH3Okc5GGy/BwBfSzcAFAZmT5HIUCinDKCDVfrlj/6oVquGrXvXjLX0rNDaBp+KSgi/B69dzN3jh98mavFC//QouWk+TvFw5PA2pZZkHh3poynIIN9bSto4vS0xs6qbfPMpkvgF6wUJjSaX3x6O/oRDPcLVDWwi3VQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711680420; c=relaxed/simple; bh=eWfj+aGYOh7tjs+jt01tO7AIQL8yDYNEfz5E//jamXM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TXUrPI8MolPzapKqb1sNEcR/ITeVkhxLhYFC4VdV3jhQYT8fgt7gV066YcfJzt1cOccp2H6gzRV2lmFeE0guAx6HD3aD/xkNApChNxIPm+Cp7EocwYaZFfJmcZ/09rdkNY1FK3k8JAr7sVjxAhzdasay/K/XH3svkGHPHqChcEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gH8uu2E+; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6963c0c507eso16475916d6.1 for ; Thu, 28 Mar 2024 19:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1711680417; x=1712285217; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=srQfKT/BzMmZwEI+1YQrBRXDf12Tn35MF+VDUldciyU=; b=gH8uu2E+GKyyfIdZIjO9loj6nR0PmoPTt9O3ESBSvYWSYAacy2N48ApLV1zlytahOz b++sr17FGUBbBJpU5CAn3KIcPX6OJEH+DkejZzyYZO9fN6/uulSuYOMjdVTeWL32mdPk JSjoC5QKk2FR/WAwjeIZceoelpgN72SkR45ZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711680417; x=1712285217; h=content-transfer-encoding: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=srQfKT/BzMmZwEI+1YQrBRXDf12Tn35MF+VDUldciyU=; b=tFhFZW0QlEdxDCOnVXlVkCsU7SSmXS+HDMeel6giW+AN2wa1TK5ztCD4pLr97dx5mI pBL/Qj0W1lZEhUQ2M9+OBN1EJcpex+iPbiYoUhactarR90mkDY7pMBOQ4+sFGXElsQnZ 01uSWi/Tx1aegHrSBPOC5BwVysnlS8RQwIRvKCEQSDpT0revQqSMBss5UrZS+eE0vBwP zkymMiN/pkAj1r5GEik1AUEY3pkV1aj2Bi2NG6hw8qSmSHHyameZ3IXRsOFIvvMPTcAR 6/ArHFKEsO4G0u2rdy+0dgDwvd01PTyqGN6TIK7xIv6BzH3ngbCtbM6EVQT3DRpAy/Px qbHA== X-Forwarded-Encrypted: i=1; AJvYcCX6PmxXvAoQE4xCvGQc2Pacem66fIvmsDZzwYXyqIvnKSjcxs7mvPt+r7yP7Dw3p21TWEe+bSt3FwrV+iZfQLHR2cSHmJ/romI9Wldq X-Gm-Message-State: AOJu0YycIMldhxbqzQlmYl2vQi9COMgufZ1ugUozQyctTfCQtykWpk+k WMDjW5qLBLiXkWgQtY0So1ba4eozZCNAl3SrkBeJvh8PYpoE9aiUOr8laEKf0OpsAFCBVdab4e/ ni3LFNBU526mD1F1oT0iK/ibEwBwYAr3jVnku X-Received: by 2002:a0c:e948:0:b0:696:a309:1095 with SMTP id n8-20020a0ce948000000b00696a3091095mr6508219qvo.17.1711680416994; Thu, 28 Mar 2024 19:46:56 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240314042659.232142-1-sjg@chromium.org> <20240314042659.232142-3-sjg@chromium.org> In-Reply-To: From: Simon Glass Date: Fri, 29 Mar 2024 15:46:45 +1300 Message-ID: Subject: Re: [PATCH v11 2/2] arm64: boot: Support Flat Image Tree To: Masahiro Yamada Cc: linux-arm-kernel@lists.infradead.org, Ahmad Fatoum , Nicolas Schier , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Masahiro, On Wed, 27 Mar 2024 at 03:39, Masahiro Yamada wrote: > > On Thu, Mar 14, 2024 at 1:28=E2=80=AFPM Simon Glass wr= ote: > > > > 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 uses the 'dtbs-list' file but processes only .dtb files, ignoring > > the overlay .dtbo files. > > > > 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. Use > > FIT_COMPRESSION to select an algorithm other than gzip. > > > > 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 v11: > > - Use dtbslist file in image.fit rule > > - Update cmd_fit rule as per Masahiro > > - Don't mention ignoring files without a .dtb prefix > > - Use argparse fromfile_prefix_chars feature > > - Add a -v option and use it for output (with make V=3D1) > > - rename srcdir to dtbs > > - Use -o for the output file instead of -f > > > > > > > > --- a/scripts/Makefile.lib > > +++ b/scripts/Makefile.lib > > @@ -504,6 +504,21 @@ quiet_cmd_uimage =3D UIMAGE $@ > > -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ > > -n '$(UIMAGE_NAME)' -d $< $@ > > > > +# Flat Image Tree (FIT) > > +# This allows for packaging of a kernel and all devicetrees files, usi= ng > > +# compression. > > +# --------------------------------------------------------------------= ------- > > + > > +MAKE_FIT :=3D $(srctree)/scripts/make_fit.py > > + > > +# Use this to override the compression algorithm > > +FIT_COMPRESSION ?=3D gzip > > + > > +quiet_cmd_fit =3D FIT $@ > > + cmd_fit =3D $(MAKE_FIT) -o $@ --arch $(UIMAGE_ARCH) --os linux \ > > + --name '$(UIMAGE_NAME)' $(if $(V),-v) \ > > + --compress $(FIT_COMPRESSION) -k $< @$(word 2,$^) > > + > > > > > A nit in your new code. > > > $(if $(V),-v) does not work for KBUILD_VERBOSE env variable. > > > It should be > > $(if $(findstring 1,$(KBUILD_VERBOSE)),-v) OK, thank you. I was assuming that V=3D0 would not be passed, but this is better. I will send v12. Regards, Simon