mb/google/skywalker: Implement sku_id()
Retrieve the SKU ID for Skywalker via CBI interface. BUG=b:395551181 BRANCH=none TEST=check boot log Signed-off-by: Wentao Qin <qinwentao@huaqin.corp-partner.google.com> Change-Id: I6f1343f127537f97bfa4e1f2cfef7db5d46fab67 Reviewed-on: https://review.coreboot.org/c/coreboot/+/87359 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Yidi Lin <yidilin@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
be675e5369
commit
aaf373c253
3 changed files with 26 additions and 0 deletions
|
|
@ -26,6 +26,8 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
select EC_GOOGLE_CHROMEEC
|
||||
select EC_GOOGLE_CHROMEEC_BOARDID
|
||||
select EC_GOOGLE_CHROMEEC_SPI
|
||||
select FW_CONFIG
|
||||
select FW_CONFIG_SOURCE_CHROMEEC_CBI
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
|||
|
|
@ -8,4 +8,5 @@ bootblock-y += bootblock.c
|
|||
|
||||
romstage-y += romstage.c
|
||||
|
||||
ramstage-y += boardid.c
|
||||
ramstage-y += mainboard.c
|
||||
|
|
|
|||
23
src/mainboard/google/skywalker/boardid.c
Normal file
23
src/mainboard/google/skywalker/boardid.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <boardid.h>
|
||||
#include <console/console.h>
|
||||
#include <ec/google/chromeec/ec.h>
|
||||
|
||||
uint32_t sku_id(void)
|
||||
{
|
||||
static uint32_t cached_sku_code = BOARD_ID_INIT;
|
||||
|
||||
if (cached_sku_code == BOARD_ID_INIT) {
|
||||
cached_sku_code = google_chromeec_get_board_sku();
|
||||
|
||||
if (cached_sku_code == CROS_SKU_UNKNOWN ||
|
||||
cached_sku_code == CROS_SKU_UNPROVISIONED) {
|
||||
printk(BIOS_WARNING, "Failed to get SKU code from EC\n");
|
||||
cached_sku_code = CROS_SKU_UNPROVISIONED;
|
||||
}
|
||||
printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code);
|
||||
}
|
||||
|
||||
return cached_sku_code;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue