util/ipqheader: Add utility to create uber-SBL for IPQ8064

With the Storm image layout reworked, the very first blob read out of
NOR SPI flash by the IPQ8064 maskrom is supposed to be a concatenation
of three binaries: one to run on RPM, another one to run on AP, and
the third one - the actual coreboot bootblock.

This layout allows to greatly reduce the size and complexity of the
two first blobs, as they do not need to include the SPI driver.

The first binary in the input file list starts with the combined
header, describing the rest of the blob. This utility copies the first
input file into output, updating the combined header with the total
size of the concatenated binaries.

The second and third binaries in the combined image are required to be
aligned at 256 byte offsets in the file as counted from the end of
the combined header. The new utility allows to concatenate two or
three files, always expecting the first file to be prepended by the
combined header.

For further reference below is the utility's help message:

  mbncat.py: [-v] [-h] [-o Output MBN] sbl1 sbl2 [bootblock]

  Concatenates up to three mbn files: two SBLs and a coreboot bootblock
    -h This message
    -v verbose
    -o Output file name, (default: sbl-ro.mbn)

TEST=run the new utility and compare the result with the output of
     the vendor provided tool. The output files are exactly the same.

Change-Id: I1d3b3634ecc3f46ea88adb9b6c4fbfc017cc06ac
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Original-Commit-Id: 94008340bc5eaf19d286b3feaa4091e5c5e285aa
Original-Change-Id: I00724f7c75703fc90d7971c3cb337c33ca96f2b5
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/232047
Original-Reviewed-by: Manoj Juneja <mjuneja@qti.qualcomm.com>
Original-Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/9572
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
1 file changed