summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h2
-rw-r--r--src/mainboard/google/poppy/variants/nami/gpio.c2
-rw-r--r--src/mainboard/google/poppy/variants/nami/include/variant/sku.h2
-rw-r--r--src/mainboard/google/poppy/variants/nami/mainboard.c14
4 files changed, 11 insertions, 9 deletions
diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
index e8a9b47ad1..97cb0fef2e 100644
--- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
@@ -53,7 +53,7 @@ struct memory_params {
void variant_memory_params(struct memory_params *p);
int variant_memory_sku(void);
void variant_devtree_update(void);
-uint16_t variant_board_sku(void);
+uint32_t variant_board_sku(void);
struct nhlt;
void variant_nhlt_init(struct nhlt *nhlt);
diff --git a/src/mainboard/google/poppy/variants/nami/gpio.c b/src/mainboard/google/poppy/variants/nami/gpio.c
index 061c3115c3..37a9420ba7 100644
--- a/src/mainboard/google/poppy/variants/nami/gpio.c
+++ b/src/mainboard/google/poppy/variants/nami/gpio.c
@@ -398,7 +398,7 @@ static const struct pad_config vayne_sku_gpio_table[] = {
const struct pad_config *variant_sku_gpio_table(size_t *num)
{
- uint16_t sku_id = variant_board_sku();
+ uint32_t sku_id = variant_board_sku();
const struct pad_config *board_gpio_tables;
switch (sku_id) {
case SKU_1_VAYNE:
diff --git a/src/mainboard/google/poppy/variants/nami/include/variant/sku.h b/src/mainboard/google/poppy/variants/nami/include/variant/sku.h
index b72f3497fe..3b67b56ad7 100644
--- a/src/mainboard/google/poppy/variants/nami/include/variant/sku.h
+++ b/src/mainboard/google/poppy/variants/nami/include/variant/sku.h
@@ -16,7 +16,7 @@
#ifndef __MAINBOARD_SKU_H__
#define __MAINBOARD_SKU_H__
-#define SKU_UNKNOWN 0xFFFF
+#define SKU_UNKNOWN 0xFFFFFFFF
#define SKU_0_NAMI 0x3A7B
#define SKU_1_VAYNE 0x3A63
#define SKU_2_VAYNE 0x3A7F
diff --git a/src/mainboard/google/poppy/variants/nami/mainboard.c b/src/mainboard/google/poppy/variants/nami/mainboard.c
index f166088a8e..4fc3d885cf 100644
--- a/src/mainboard/google/poppy/variants/nami/mainboard.c
+++ b/src/mainboard/google/poppy/variants/nami/mainboard.c
@@ -24,22 +24,24 @@
#include <string.h>
#include <variant/sku.h>
-uint16_t variant_board_sku(void)
+uint32_t variant_board_sku(void)
{
- static int sku_id = -1;
+ static uint32_t sku_id = SKU_UNKNOWN;
uint32_t id;
- if (sku_id >= 0)
+
+ if (sku_id != SKU_UNKNOWN)
return sku_id;
if (google_chromeec_cbi_get_sku_id(&id))
return SKU_UNKNOWN;
sku_id = id;
+
return sku_id;
}
void variant_devtree_update(void)
{
/* Override dev tree settings per board */
- uint16_t sku_id = variant_board_sku();
+ uint32_t sku_id = variant_board_sku();
device_t root = SA_DEV_ROOT;
config_t *cfg = root->chip_info;
switch (sku_id) {
@@ -53,9 +55,9 @@ void variant_devtree_update(void)
const char *smbios_mainboard_sku(void)
{
- static char sku_str[9]; /* sku{0..65535} (basically up to FFFF) */
+ static char sku_str[14]; /* sku{0..4294967295} */
- snprintf(sku_str, sizeof(sku_str), "sku%d", variant_board_sku());
+ snprintf(sku_str, sizeof(sku_str), "sku%u", variant_board_sku());
return sku_str;
}