cros_bundle_firmware: Write section content positions into fdt
Now that flash sections can contain multiple binaries, we need to be
able to find them. Write a directory into each section which has more
than one binary. The directory will contain the name, offset and size
of each binary.
BUG=chromium-os:32034
TEST=manual
$ FEATURES=test emerge-daisy cros-devutils
Use U-Boot with new flashmap with a blob with 3 binaries: 'blob,dtb,ecbin'
$ emerge-daisy chromeos-bootimage
$ Use fdtdump to manually inspect the resulting fdt file and see that the
three sections appear and the data look sane:
rw-b-boot {
#size-cells = <0x00000001>;
#address-cells = <0x00000001>;
label = "fw-main-b";
reg = <0x00302000 0x000edf00>;
type = "blob boot,dtb,ecbin";
boot {
reg = <0x00000000 0x00061adc>;
};
dtb {
reg = <0x00061adc 0x00004a33>;
};
ecbin {
reg = <0x00066510 0x00020000>;
};
};
Change-Id: I9a6c6d4d05bc946ae84a8f78c3ecd76383a17107
Reviewed-on: https://gerrit.chromium.org/gerrit/25863
Commit-Ready: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index fa3a8be..4bff9e8 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -793,6 +793,10 @@
pack.AddProperty('keydir', self._keydir)
pack.CheckProperties()
+
+ # Record position and size of all blob members in the FDT
+ pack.UpdateBlobPositions(fdt)
+
image = os.path.join(self._tools.outdir, 'image.bin')
pack.PackImage(self._tools.outdir, image)
pack.AddProperty('image', image)