cros_bundle_firmware: Add configurable load address and SPI offset
At present, SPL always loads U-Boot to a fixed address (the text base) and
always from a fixed offset in SPI flash.
For early-firmware-selection, we want to allow changing these. The RO SPL
needs to read U-Boot into IRAM and the RW SPL needs to read U-Boot into
SDRAM. Each needs to reads from a different SPI flash offset.
Add support for a new U-Boot SPL machine params for SPI offset and load
address. This will allow us to support early-firmware-selection.
Use the early-firmware-selection switch to tell us whether to use IRAM for
the 'ro-boot' or not. Use a new 'payload' property in the flashmap SPL
region to tell us which section that region will be loading. This means
that SPL can now load any region in flash, not just a hard-coded offset.
U-Boot will now have two build variants. This is unavoidable for the moment
as we need the RO U-Boot to be as small as possible to fit into IRAM, but
the RW U-Boot needs to support LCD display (using 2MB of RAM) and other
features. So we define 'ro-boot' as the new RO U-Boot and keep 'boot' to
mean the normal U-Boot as now.
Add compatibility features so that the existing U-Boot flashmap is still
valid - a default payload and default addresses for IRAM, BL1, etc.
This is a rather large change. When I tried splitting it out it just added
confusion since all the pieces are related anyway.
BUG=chrome-os-partner:21115
TEST=FEATURES=test sudo -E emerge cros-devutils
With U-Boot changes, early-firmware-selection works as expected.
Change-Id: I38ad3b4b17ddf0e95e5c76cc1e42b035a8302eaa
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63042
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index fe6ded4..aedfe17 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -105,6 +105,7 @@
'read-only' : True,
'filename' : "bl2.bin",
'type' : "blob exynos-bl2 boot,dtb",
+ 'payload' : '/flash/ro-boot',
'required' : True,
}, {
'path' : '/flash/ro-boot',
@@ -165,6 +166,7 @@
'read-only' : True,
'filename' : "bl2.bin",
'type' : "blob exynos-bl2 boot,dtb",
+ 'payload' : '/flash/ro-boot',
'required' : True,
}, {
'path' : '/flash/ro-boot',
@@ -935,6 +937,8 @@
fdt.PutInteger('/flash/rw-b-vblock', 'preamble-flags', 0)
if self._force_efs:
fdt.PutInteger('/chromeos-config', 'early-firmware-selection', 1)
+ pack.use_efs = fdt.GetInt('/chromeos-config', 'early-firmware-selection',
+ 0)
if not fdt.GetProp('/flash', 'reg', ''):
fdt.InsertNodes(default_flashmap)