Move flash search code into a separate file

At present we have an algorithm which searches through the flash looking
for an FMAP signature. We want to use it to search for other things also,
such as an FDTMAP.

Move this useful algorithm into its own module, and adjust the API so that
callers can repeatedly call it and it will return a new offset to check,
each time. Then adjust the fmap code to use this new function.

BUG=chromium-os:38794
BRANCH=none
TEST=Manual:
sudo emerge flashrom; emerge-daisy flashrom; emerge-link flashrom
Also test flashrom on snow (flashrom -i gbb -r test.bin, to make sure it
can access sections)

Change-Id: I3c8b84a45c05719cc9536f43e324e9f82542181e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44579
Reviewed-by: David Hendricks <dhendrix@chromium.org>
6 files changed