pack_firmware: Calculate offset and size of bios section for ifdtool

Currently, the assumptions while creating final image for Intel systems
with IFD region are:
1. DTS region size equals the non-BIOS region size in the descriptor.
2. The image contains non-BIOS region(IFD) at the start followed by
BIOS region till the end of the image.

These assumptions are not true for Apollolake platform since it
contains non-BIOS region both at the start as well as at the end of
the image. Thus, ProduceFinalImage in pack_firmware needs to calculate
the correct size of BIOS region being passed into the ifdtool from the
descriptor and not from the dts file.

CQ-DEPEND=CL:347986
BUG=chrome-os-partner:53689
BRANCH=None
TEST="emerge-reef chromeos-bootimage" succeeds. "cbfstool print
image.bin" prints out components correctly.

Change-Id: Id2e8fc8ca425c24ee63f2baf4d0f66ebf6a7b29b
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/348020
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
1 file changed