Add revision table to the SPL blob

It is becoming necessary to communicate the revision table to the SPL
blob so that it can decide what memory size to expect on the target.

The machine parameters structure allows only fixed size (32 bits)
elements. Let's add to the structure the offset of the array of bytes
representing the revision table.

The offset of the table is based on the address of the machine
parameter structure. The size of the table implicitly is defined as (3
^ NUM_GPIOS * 2) bytes, as each GPIO is a tertiary number, and for
each revision read from GPIOs the table includes two byte values:
revision and subrevision.

The size field of the variable size SPL blob header needs to be
updated to reflect the addition.

Instead of adding another elif case to the huge statement handling the
machine parameter names, this change introduces a dictionary for
routing processing based on the machine parameter name.

The fact that the blob could be resized by parameter processing
functions posed a challenge, as the blob is represented by a binary
string, and changing it in the function does not affect the caller.
The solution is to make the blob on of the ExynosBL2 class'
properties. This results in a larger change, but simplifies footprints
of many methods of this class.

For the purposes of checksum verification the BL1 expects the SPL size
to be divisible by 4, adding padding as necessary.

	. built and booted pit with the SPL machine param structure
	  including the new field, 't'. Noticed the increased size of
	  the SPL blob in the preserved output files directory.

        . analyzed header sizes before and after bundling:

	$ FEATURES=noclean emerge-peach_pit chromeos-u-boot chromeos-bootimage
	$ od -Ax -t x1 -v  /build/peach_pit/tmp/portage/sys-boot/chromeos-u-boot-9999/work/build/spl/smdk5420-spl.bin  '^000000 ' | head -1
	000000 80 40 00 00 35 66 17 00 00 00 00 00 00 00 00 00
	$ od -Ax -t x1 -v /build/peach_pit/firmware/image-peach-pit.bin |grep '002000 '
	002000 24 41 00 00 23 68 17 00 00 00 00 00 00 00 00 00

        Note that 0x4124 - 0x4080 = 164, which is 81 double bytes plus
        padding to keep the blob size divisible by 4

Change-Id: I4f0b005f53d4bc437780432fb59fb3c9088f4ec7
Signed-off-by: Vadim Bendebury <>
Reviewed-by: Doug Anderson <>
1 file changed