From 53b8a82e72b74e7598c5344597e014cd5c6fb49e Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 28 Sep 2017 17:59:18 +0200 Subject: mb/google/reef: Cache EC's SKU ID on Coral Change-Id: I1925f51d63290b8d08366b622d5df3aab3a7484e Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/21737 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Sumeet R Pawnikar --- src/mainboard/google/reef/variants/coral/mainboard.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/reef/variants/coral/mainboard.c b/src/mainboard/google/reef/variants/coral/mainboard.c index c60c083eac..f2fa30c8fa 100644 --- a/src/mainboard/google/reef/variants/coral/mainboard.c +++ b/src/mainboard/google/reef/variants/coral/mainboard.c @@ -26,8 +26,12 @@ enum { uint8_t variant_board_sku(void) { - // we know that the values are in 0..255 - return google_chromeec_get_sku_id(); + static int sku = -1; + + if (sku == -1) + sku = google_chromeec_get_sku_id(); + + return sku; } void variant_nhlt_oem_overrides(const char **oem_id, -- cgit v1.2.3