cros_bundle_firmware: configure exynos flasher BL2

When creating a flasher image, ExynosFlashImage is passed the SPL binary
directly built with U-Boot to use as BL2, which has not had its machine
parameters configured.  By using this BL2 directly, the default values
in the machine parameters will be used, rather than the appropriate
configured values.

The default memory manufacturer for daisy is not correct for daisy_spring,
resulting in a flasher image that hangs in the memory initialization in
SPL.

When passed BL2, run it through the Exynos BL2 configuration to ensure the
machine parameters are updated.

BUG=none
BRANCH=none
TEST=`crosfw --board daisy_spring -VF` successfully flashes spring
`crosfw --board daisy -VF` successfully boots flasher on snow

Change-Id: I815b17aecbcc56fb62b462e0cb009d6e084fdcb8
Signed-off-by: Michael Pratt <mpratt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61681
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/write_firmware.py b/host/lib/write_firmware.py
index 5ed00df..d2d1b7d 100644
--- a/host/lib/write_firmware.py
+++ b/host/lib/write_firmware.py
@@ -559,6 +559,13 @@
       if not bl2 or not os.path.exists(tools.Filename(bl2)):
         self._out.Warning('Extracting BL2 from payload')
         bl2 = payload_bl2
+      else:
+        # Update BL2 machine parameters, as
+        # the BL2 passed in may not be updated
+        spl_load_size = os.stat(tools.Filename(bl2)).st_size
+        bl2_handler = ExynosBl2(tools, self._out)
+        bl2 = bl2_handler.Configure(self._fdt, spl_load_size,
+                                    bl2, 'flasher', True)
       image = self._PrepareFlasher(flash_uboot, payload, flash_dest, '1:0')
     else:
       bl1, bl2, image = payload_bl1, payload_bl2, payload_image