linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wenst@chromium.org>
To: Simon Glass <sjg@chromium.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas@fjasle.eu>
Cc: Chen-Yu Tsai <wenst@chromium.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: [PATCH 2/2] scripts/make_fit: Add option to disable compression for DTBs
Date: Tue, 21 May 2024 14:51:05 +0800	[thread overview]
Message-ID: <20240521065107.30371-3-wenst@chromium.org> (raw)
In-Reply-To: <20240521065107.30371-1-wenst@chromium.org>

Old bootloaders found on RK3399 and MT8173 based Chromebooks only
support compression for the kernel image in the FIT image, and not the
DTBs. While compression could be disabled, aforementioned bootloaders
also limit the kernel image size to 32 MiB, making compression necessary
for any practical setup.

Add an option to disable DTB compression to support this case.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
 scripts/Makefile.lib |  1 +
 scripts/make_fit.py  | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 9f06f6aaf7fc..84d9b0166cc0 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -522,6 +522,7 @@ quiet_cmd_fit = FIT     $@
       cmd_fit = $(MAKE_FIT) -o $@ --arch $(UIMAGE_ARCH) --os linux \
 		--name '$(UIMAGE_NAME)' \
 		$(if $(findstring 1,$(KBUILD_VERBOSE)),-v) \
+		$(if $(FIT_DISABLE_DTB_COMPRESSION),--no-dtb-compression) \
 		--compress $(FIT_COMPRESSION) -k $< @$(word 2,$^)
 
 # XZ
diff --git a/scripts/make_fit.py b/scripts/make_fit.py
index 263147df80a4..626cf3422079 100755
--- a/scripts/make_fit.py
+++ b/scripts/make_fit.py
@@ -22,6 +22,10 @@ the entire FIT.
 Use -c to compress the data, using bzip2, gzip, lz4, lzma, lzo and
 zstd algorithms.
 
+Use -C to disable compression for DTBs regardless of the setting of '-c'.
+This is intended for old bootloaders that support compression of the
+kernel image but not the devicetree blobs.
+
 The resulting FIT can be booted by bootloaders which support FIT, such
 as U-Boot, Linuxboot, Tianocore, etc.
 
@@ -64,6 +68,8 @@ def parse_args():
           help='Specifies the architecture')
     parser.add_argument('-c', '--compress', type=str, default='none',
           help='Specifies the compression')
+    parser.add_argument('-C', '--no-dtb-compression', action='store_true',
+                        help='Disables compression for included DTBs')
     parser.add_argument('-E', '--external', action='store_true',
           help='Convert the FIT to use external data')
     parser.add_argument('-n', '--name', type=str, required=True,
@@ -247,7 +253,10 @@ def build_fit(args):
         if os.path.splitext(fname)[1] == '.dtb':
             seq += 1
             size += os.path.getsize(fname)
-            model, compat = output_dtb(fsw, seq, fname, args.arch, args.compress)
+            compress = args.compress
+            if args.no_dtb_compression:
+                compress = 'none'
+            model, compat = output_dtb(fsw, seq, fname, args.arch, compress)
             entries.append([model, compat])
 
     finish_fit(fsw, entries)
-- 
2.45.0.215.g3402c0e53f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2024-05-21  6:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21  6:51 [PATCH 0/2] scripts/make_fit fix and disabled compression for DTBs Chen-Yu Tsai
2024-05-21  6:51 ` [PATCH 1/2] scripts/make_fit: Drop fdt image entry compatible string Chen-Yu Tsai
2024-05-23 17:19   ` Simon Glass
2024-05-23 17:30     ` Chen-Yu Tsai
2024-05-23 17:38       ` Simon Glass
2024-05-24  6:29         ` Chen-Yu Tsai
2024-05-24 13:01           ` Simon Glass
2024-05-28  8:31             ` Chen-Yu Tsai
2024-05-28 14:14               ` Simon Glass
2024-05-21  6:51 ` Chen-Yu Tsai [this message]
2024-05-22 13:08 ` [PATCH 0/2] scripts/make_fit fix and disabled compression for DTBs Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240521065107.30371-3-wenst@chromium.org \
    --to=wenst@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=sjg@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).