cache result of SPI probe functions

This implements a simple means of caching probe results from REMS
and RDID (3 and 4-byte versions) commands. This makes probing of
SPI ROMs slightly faster (~10-50ms) depending on which
programmer is being used.

This also factors out some common code used for RDID3/4 and REMS
functions.

BRANCH=none
BUG=chromium-os:34601
TEST=Tested on Lumpy host firmware ROM with and without the delay
     loop, IDs shown in verbose output were identical

Change-Id: I71cd2b0c8c6017760a1ed52237e203076092cd9e
Reviewed-on: https://gerrit.chromium.org/gerrit/35376
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
Commit-Ready: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
1 file changed