Skip to content

Commit 621fd65

Browse files
sjg20nathanchance
authored andcommitted
scripts/make_fit: Speed up operation
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> Reviewed-by: Nicolas Schier <nsc@kernel.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20260106162738.2605574-2-sjg@chromium.org Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent f2445d6 commit 621fd65

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/make_fit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def setup_fit(fsw, name):
9898
fsw (libfdt.FdtSw): Object to use for writing
9999
name (str): Name of kernel image
100100
"""
101-
fsw.INC_SIZE = 65536
101+
fsw.INC_SIZE = 16 << 20
102102
fsw.finish_reservemap()
103103
fsw.begin_node('')
104104
fsw.property_string('description', f'{name} with devicetree set')
@@ -299,7 +299,9 @@ def build_fit(args):
299299
finish_fit(fsw, entries)
300300

301301
# Include the kernel itself in the returned file count
302-
return fsw.as_fdt().as_bytearray(), seq + 1, size
302+
fdt = fsw.as_fdt()
303+
fdt.pack()
304+
return fdt.as_bytearray(), seq + 1, size
303305

304306

305307
def run_make_fit():

0 commit comments

Comments
 (0)