mb/google/mensa: Implement SKU ID retrieval

Implement the sku_id() function for the Mensa mainboard to replace
the existing placeholder.

The SKU ID is retrieved from the Chrome EC using the common
google_chromeec_get_board_sku() interface. To optimize performance and
avoid redundant SPI transactions to the EC, the value is cached
after the initial read.

BUG=b:496650089
TEST=Build and boot on Mensa; verify SKU ID is correctly reported in
cbmem logs.

Change-Id: Ibaef20913e8043a02b2468d1157ac1a4a2087fc6
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91906
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2026-03-28 07:22:39 +00:00
commit ba3b83e51e

View file

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <boardid.h>
#include <ec/google/chromeec/ec.h>
uint32_t board_id(void)
{
@ -12,6 +13,11 @@ uint32_t board_id(void)
uint32_t sku_id(void)
{
static uint32_t id = UNDEFINED_STRAPPING_ID;
/* Placeholder */
if (id != UNDEFINED_STRAPPING_ID)
return id;
if (CONFIG(EC_GOOGLE_CHROMEEC))
id = google_chromeec_get_board_sku();
return id;
}