diff options
Diffstat (limited to 'src/mainboard/google/poppy/variants/nami')
-rw-r--r-- | src/mainboard/google/poppy/variants/nami/gpio.c | 31 | ||||
-rw-r--r-- | src/mainboard/google/poppy/variants/nami/include/variant/sku.h | 24 | ||||
-rw-r--r-- | src/mainboard/google/poppy/variants/nami/mainboard.c | 12 |
3 files changed, 57 insertions, 10 deletions
diff --git a/src/mainboard/google/poppy/variants/nami/gpio.c b/src/mainboard/google/poppy/variants/nami/gpio.c index 71e4cf7423..061c3115c3 100644 --- a/src/mainboard/google/poppy/variants/nami/gpio.c +++ b/src/mainboard/google/poppy/variants/nami/gpio.c @@ -16,6 +16,7 @@ #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <commonlib/helpers.h> +#include <variant/sku.h> /* Pad configuration in ramstage */ /* Leave eSPI pins untouched from default settings */ @@ -194,8 +195,6 @@ static const struct pad_config gpio_table[] = { PAD_CFG_NC(GPP_D15), /* D16 : ISH_UART0_CTS# ==> NC */ PAD_CFG_NC(GPP_D16), - /* D17 : DMIC_CLK1 ==> SOC_DMIC_CLK1 */ - PAD_CFG_NF(GPP_D17, NONE, DEEP, NF1), /* D18 : DMIC_DATA1 ==> SOC_DMIC_DATA1 */ PAD_CFG_NF(GPP_D18, NONE, DEEP, NF1), /* D19 : DMIC_CLK0 ==> SOC_DMIC_CLK0 */ @@ -386,3 +385,31 @@ const struct pad_config *variant_early_gpio_table(size_t *num) *num = ARRAY_SIZE(early_gpio_table); return early_gpio_table; } + +static const struct pad_config nami_default_sku_gpio_table[] = { + /* D17 : DMIC_CLK1 ==> SOC_DMIC_CLK1 */ + PAD_CFG_NF(GPP_D17, NONE, DEEP, NF1), +}; + +static const struct pad_config vayne_sku_gpio_table[] = { + /* D17 : DMIC_CLK1 ==> NC */ + PAD_CFG_NC(GPP_D17), +}; + +const struct pad_config *variant_sku_gpio_table(size_t *num) +{ + uint16_t sku_id = variant_board_sku(); + const struct pad_config *board_gpio_tables; + switch (sku_id) { + case SKU_1_VAYNE: + case SKU_2_VAYNE: + *num = ARRAY_SIZE(vayne_sku_gpio_table); + board_gpio_tables = vayne_sku_gpio_table; + break; + default: + *num = ARRAY_SIZE(nami_default_sku_gpio_table); + board_gpio_tables = nami_default_sku_gpio_table; + break; + } + return board_gpio_tables; +} diff --git a/src/mainboard/google/poppy/variants/nami/include/variant/sku.h b/src/mainboard/google/poppy/variants/nami/include/variant/sku.h new file mode 100644 index 0000000000..b72f3497fe --- /dev/null +++ b/src/mainboard/google/poppy/variants/nami/include/variant/sku.h @@ -0,0 +1,24 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __MAINBOARD_SKU_H__ +#define __MAINBOARD_SKU_H__ + +#define SKU_UNKNOWN 0xFFFF +#define SKU_0_NAMI 0x3A7B +#define SKU_1_VAYNE 0x3A63 +#define SKU_2_VAYNE 0x3A7F + +#endif /* __MAINBOARD_SKU_H__ */ diff --git a/src/mainboard/google/poppy/variants/nami/mainboard.c b/src/mainboard/google/poppy/variants/nami/mainboard.c index e2bc8958a3..f166088a8e 100644 --- a/src/mainboard/google/poppy/variants/nami/mainboard.c +++ b/src/mainboard/google/poppy/variants/nami/mainboard.c @@ -22,13 +22,9 @@ #include <smbios.h> #include <soc/ramstage.h> #include <string.h> +#include <variant/sku.h> -#define SKU_UNKNOWN 0xFFFF -#define SKU_0_NAMI 0x3A7B -#define SKU_1_VAYNE 0x3A63 -#define SKU_2_VAYNE 0x3A7F - -static uint16_t board_sku_id(void) +uint16_t variant_board_sku(void) { static int sku_id = -1; uint32_t id; @@ -43,7 +39,7 @@ static uint16_t board_sku_id(void) void variant_devtree_update(void) { /* Override dev tree settings per board */ - uint16_t sku_id = board_sku_id(); + uint16_t sku_id = variant_board_sku(); device_t root = SA_DEV_ROOT; config_t *cfg = root->chip_info; switch (sku_id) { @@ -59,7 +55,7 @@ const char *smbios_mainboard_sku(void) { static char sku_str[9]; /* sku{0..65535} (basically up to FFFF) */ - snprintf(sku_str, sizeof(sku_str), "sku%d", board_sku_id()); + snprintf(sku_str, sizeof(sku_str), "sku%d", variant_board_sku()); return sku_str; } |