cros_bundle_firmware: Allow a different Exynos SPL for each flashmap section
At present we expect to have only one SPL in an image - it is used to load
the read-only U-Boot.
With early-firmware-selection we are going to need to support an SPL for each
of the RW U-Boots also, since that is where SDRAM initialization will happen.
Adjust the code to remember the relationship between an SPL and the particular
flashmap section that created it, so we can have muiltiple SPLs and each can
be configured by the parameters in that flashmap section.
Also move the Exynos SPL/BL2 code into exynos.py, since this code belongs
there rather than in bundle_firmware.
The previously used GetBlobParams() is still present, so add a comment
clarifying that this can only get the parameters for a blob which is the same
every time it is used. For example, the U-Boot binary is inserted without
modification anywhere where the 'boot' blob is called for.
This prepares the way for adding hash support to SPL in a future commit.
BUG=chrome-os-partner:21115
TEST=FEATURES=test sudo -E emerge cros-devutils
'crosfw -b peach_pit -V' on pit and see that it still builds and boots.
Change-Id: I6d985f89a98c53a7579ab89773aaafabd8ec9ea6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62740
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index 27f2d02..998039e 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -871,30 +871,9 @@
data = re.sub('__FMAP__', '__fMAP__', data)
self._tools.WriteFile(updated_ecro, data)
pack.AddProperty(blob_type, updated_ecro)
- elif blob_type == 'exynos-bl2':
- spl_payload = pack.GetBlobParams(blob_type)
-
- # TODO(sjg@chromium): Remove this later, when we remove boot+dtb
- # from all flash map files.
- if not spl_payload:
- spl_load_size = os.stat(pack.GetProperty('boot+dtb')).st_size
- prop_list = 'boot+dtb'
-
- # Do this later, when we remove boot+dtb.
- # raise CmdError("No parameters provided for blob type '%s'" %
- # blob_type)
- else:
- prop_list = spl_payload[0].split(',')
- compress = fdt.GetString('/flash/ro-boot', 'compress', 'none')
- if compress == 'none':
- compress = None
- spl_load_size = len(pack.ConcatPropContents(prop_list, compress,
- False)[0])
- self._out.Info("BL2/SPL contains '%s', size is %d / %#x" %
- (', '.join(prop_list), spl_load_size, spl_load_size))
- bl2 = ExynosBl2(self._tools, self._out)
- pack.AddProperty(blob_type, bl2.Configure(fdt, spl_load_size,
- self.exynos_bl2))
+ elif blob_type.startswith('exynos-bl2'):
+ # We need to configure this per node, so do it later
+ pass
elif pack.GetProperty(blob_type):
pass
elif blob_type in self.blobs:
@@ -959,6 +938,13 @@
pack.AddProperty('gbb', gbb)
pack.AddProperty('keydir', self._keydir)
+ # Some blobs need to be configured according to the node they are in.
+ for blob in pack.GetMissingBlobs():
+ if blob.key.startswith('exynos-bl2'):
+ bl2 = ExynosBl2(self._tools, self._out)
+ pack.AddProperty(blob.key, bl2.MakeSpl(pack, fdt, blob,
+ self.exynos_bl2))
+
pack.CheckProperties()
# Record position and size of all blob members in the FDT