lib/spd_cache: add spd_cache common code

This patch adds some spd_cache functions. They are for implementing the
spd_cache. It's for reducing the SPD fetch time when device uses SODIMMs.
The MRC cache also includes SPD data, but there is no public header file
available to decode the struct of MRC. So SPD cache is another solution.

BUG=b:146457985
BRANCH=None
TEST=Build puff successfully and verified below two items.
     one DIMM save the boot time : 158ms
     two DIMM save the boot time : 265ms

Change-Id: Ia48aa022fabf8949960a50597185c9d821399522
Signed-off-by: Jamie Chen <jamie.chen@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40797
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 1fed543..b6d318e 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -345,3 +345,5 @@
 endif
 
 ramstage-y += uuid.c
+
+romstage-$(CONFIG_ROMSTAGE_SPD_SMBUS) += spd_cache.c