#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-3-Clause """ This utility computes and fills Exynos ROM checksum (for BL1 or BL2). (Algorithm from U-Boot: tools/mkexynosspl.c) Input: IN OUT DATA_SIZE Output: IN padded out to DATA_SIZE, checksum at the end, written to OUT. """ import struct import sys def main(argv): if len(argv) != 4: exit('usage: %s IN OUT DATA_SIZE' % argv[0]) in_name, out_name = argv[1:3] size = int(argv[3], 0) checksum_format = "