mainboard/google/volteer: Migrate onto SKU ID helpers
Leverage the common sku id space helper encoders. volteer uses the non-legacy SKU ID space. BUG=b:149348474 BRANCH=none TEST=only tested on hatch Change-Id: Ic66908afb7abb34527b4177cfd07f03ad718317c Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39037 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
6d295ac950
commit
2f55726609
|
@ -6,6 +6,7 @@ config BOARD_GOOGLE_BASEBOARD_VOLTEER
|
||||||
select DRIVERS_SPI_ACPI
|
select DRIVERS_SPI_ACPI
|
||||||
select EC_GOOGLE_CHROMEEC
|
select EC_GOOGLE_CHROMEEC
|
||||||
select EC_GOOGLE_CHROMEEC_BOARDID
|
select EC_GOOGLE_CHROMEEC_BOARDID
|
||||||
|
select EC_GOOGLE_CHROMEEC_SKUID
|
||||||
select EC_GOOGLE_CHROMEEC_LPC
|
select EC_GOOGLE_CHROMEEC_LPC
|
||||||
select HAVE_ACPI_RESUME
|
select HAVE_ACPI_RESUME
|
||||||
select HAVE_ACPI_TABLES
|
select HAVE_ACPI_TABLES
|
||||||
|
|
|
@ -17,36 +17,9 @@
|
||||||
#include <vendorcode/google/chromeos/chromeos.h>
|
#include <vendorcode/google/chromeos/chromeos.h>
|
||||||
#include <variant/gpio.h>
|
#include <variant/gpio.h>
|
||||||
|
|
||||||
#define SKU_UNKNOWN 0xFFFFFFFF
|
|
||||||
#define SKU_MAX 0x7FFFFFFF
|
|
||||||
|
|
||||||
static uint32_t get_board_sku(void)
|
|
||||||
{
|
|
||||||
static uint32_t sku_id = SKU_UNKNOWN;
|
|
||||||
|
|
||||||
if (sku_id != SKU_UNKNOWN)
|
|
||||||
return sku_id;
|
|
||||||
|
|
||||||
if (google_chromeec_cbi_get_sku_id(&sku_id))
|
|
||||||
sku_id = SKU_UNKNOWN;
|
|
||||||
|
|
||||||
return sku_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *smbios_system_sku(void)
|
const char *smbios_system_sku(void)
|
||||||
{
|
{
|
||||||
static char sku_str[14]; /* sku{0..2147483647} */
|
return google_chromeec_smbios_system_sku();
|
||||||
uint32_t sku_id = get_board_sku();
|
|
||||||
|
|
||||||
if ((sku_id == SKU_UNKNOWN) || (sku_id > SKU_MAX)) {
|
|
||||||
printk(BIOS_ERR, "%s: Unexpected SKU ID %u\n",
|
|
||||||
__func__, sku_id);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id);
|
|
||||||
|
|
||||||
return sku_str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mainboard_init(struct device *dev)
|
static void mainboard_init(struct device *dev)
|
||||||
|
|
Loading…
Reference in New Issue