3 # SPDX-License-Identifier: BSD-3-Clause
6 This utility computes and fills Exynos ROM checksum (for BL1 or BL2).
7 (Algorithm from U-Boot: tools/mkexynosspl.c)
13 Checksum header added to IN and written to OUT.
14 Header: uint32_t size, checksum, reserved[2].
22 exit('usage: %s IN OUT' % argv
[0])
24 in_name
, out_name
= argv
[1:3]
25 header_format
= "<IIII"
26 with
open(in_name
, "rb") as in_file
, open(out_name
, "wb") as out_file
:
28 header
= struct
.pack(header_format
,
29 struct
.calcsize(header_format
) + len(data
),
32 out_file
.write(header
+ data
)
35 if __name__
== '__main__':