vboot: Extract firmware id handling code into separate file

Instead of checking firmware index based on vdat in different places,
add firmware_id.c file which provides helper functions to get id and
size of firmware based on either of the following:
1) firmware index in vdat
2) particular type of firmware (ro, rwa, rwb)
3) currently active firmware

These helper functions can also be re-used by boards to get firmware
id for other purposes e.g. fastboot getvar version-bootloader. This
change makes the fmap_*_fw_* functions redundant. Thus, remove all
those functions from fmap.c.

BUG=chrome-os-partner:35861
BRANCH=None
TEST=fastboot getvar version-bootloader displays correct id. Also,
compiles successfully for samus.

Change-Id: I8c809b32c57a40fa4ffee28f0f9842801d666d0b
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/251474
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
8 files changed