cros_bundle_firmware: Support creation of IFD images

If we have an IFD (Intel Firmware Descriptor) region in the map, then we
create a skeleton image, and add the rest of the image to it. This is a
bit strange, so here is a more detailed explation:

As part of the PackFirmware process, we create, say, an 8MB image with
all the regions in it. Let's say the first 2MB are the Intel ME (Management
Engine) code, and the section type of this first 2MB section is "ifd".

When we see this ifd region, we remember it for later. Later, when we have
the full image, we pull off the first 2MB and use ifdtool to add the
remaining 6MB of the image to a provided 8MB skeleton image. We will end
up with an 8MB image, but now it is one that contains an IFD and has been
built by ifdtool. It is suitable for loading into a machine with ME.

BUG=chrome-os-partner:7969
TEST=manual
Modify link flash map to include an ifd section type for the ME section.
Take out the mangling of the image in chromeos-bootimage
$ cros_bundle_firmware -b link -d <device tree file>
Boot the image on link, see that it works ok

Change-Id: I402ecbf407226ff4f249aa1e52db4e94692daa19
Reviewed-on: https://gerrit.chromium.org/gerrit/25406
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
1 file changed