From: Simon Glass <sjg@chromium.org>
To: linux-arm-kernel@lists.infradead.org
Cc: "Chen-Yu Tsai" <wenst@chromium.org>,
"J . Neuschäfer" <j.ne@posteo.net>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Tom Rini" <trini@konsulko.com>,
"Nicolas Schier" <nicolas@fjasle.eu>,
"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
"Simon Glass" <sjg@chromium.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] scripts/make_fit: Speed up operation
Date: Fri, 19 Sep 2025 15:09:58 -0600 [thread overview]
Message-ID: <20250919211000.1045267-2-sjg@chromium.org> (raw)
In-Reply-To: <20250919211000.1045267-1-sjg@chromium.org>
The kernel is likely at least 16MB so we may as well use that as a step
size when reallocating space for the FIT in memory. Pack the FIT at the
end, so there is no wasted space.
This reduces the time to pack by an order of magnitude, or so.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
scripts/make_fit.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/make_fit.py b/scripts/make_fit.py
index c43fd9d60809..a8ea41fdaf08 100755
--- a/scripts/make_fit.py
+++ b/scripts/make_fit.py
@@ -100,7 +100,7 @@ def setup_fit(fsw, name):
fsw (libfdt.FdtSw): Object to use for writing
name (str): Name of kernel image
"""
- fsw.INC_SIZE = 65536
+ fsw.INC_SIZE = 16 << 20
fsw.finish_reservemap()
fsw.begin_node('')
fsw.property_string('description', f'{name} with devicetree set')
@@ -331,10 +331,12 @@ def build_fit(args):
entries.append([model, compat, files_seq])
- finish_fit(fsw, entries)
+ finish_fit(fsw, entries, bool(args.ramdisk))
# Include the kernel itself in the returned file count
- return fsw.as_fdt().as_bytearray(), seq + 1, size
+ fdt = fsw.as_fdt()
+ fdt.pack()
+ return fdt.as_bytearray(), seq + 1, size
def run_make_fit():
--
2.43.0
base-commit: 846bd2225ec3cfa8be046655e02b9457ed41973e
branch: fit
next prev parent reply other threads:[~2025-09-19 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 21:09 [PATCH 1/2] scripts/make_fit: Support an initial ramdisk Simon Glass
2025-09-19 21:09 ` Simon Glass [this message]
2025-09-22 7:14 ` Ahmad Fatoum
2025-09-22 13:58 ` Tom Rini
2025-09-22 22:49 ` Simon Glass
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=20250919211000.1045267-2-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=a.fatoum@pengutronix.de \
--cc=j.ne@posteo.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=trini@konsulko.com \
--cc=wenst@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