dump_fmap: Find correct FMAP structure by checking version.

Firmware images reading its own FMAP structure may have FMAP signature in code
and cause dump_fmap to parse incorrectly. Since currently there is only one
major version for FMAP (and the structure defined in fmap.h also applies only to
current version), we can improve that by checking major version number to skip
signatures in firmware code.

BUG=chromium:236347
TEST=emerge vboot_reference; dump_fmap /build/daisy/firmware/image.bin # success
BRANCH=none

Change-Id: I1d8f49bb88357e7a3a945fbdba9d9a7c4e177ac4
Reviewed-on: https://gerrit.chromium.org/gerrit/59362
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2 files changed