Unverified Commit 621fd65a authored by Simon Glass's avatar Simon Glass Committed by Nathan Chancellor
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarNicolas Schier <nsc@kernel.org>
Reviewed-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Tested-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20260106162738.2605574-2-sjg@chromium.org


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
parent f2445d6f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -98,7 +98,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')
@@ -299,7 +299,9 @@ def build_fit(args):
    finish_fit(fsw, entries)

    # 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():