diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/google/hatch/variants/helios/memory.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mainboard/google/hatch/variants/helios/memory.c b/src/mainboard/google/hatch/variants/helios/memory.c index 64b4cac8d0..a3cd813f09 100644 --- a/src/mainboard/google/hatch/variants/helios/memory.c +++ b/src/mainboard/google/hatch/variants/helios/memory.c @@ -15,8 +15,11 @@ #include <baseboard/variants.h> #include <baseboard/gpio.h> +#include <boardid.h> +#include <gpio.h> #include <soc/cnl_memcfg_init.h> #include <string.h> +#include <variant/gpio.h> static const struct cnl_mb_cfg baseboard_memcfg = { /* @@ -66,3 +69,34 @@ void variant_memory_params(struct cnl_mb_cfg *bcfg) { memcpy(bcfg, &baseboard_memcfg, sizeof(baseboard_memcfg)); } + +int variant_memory_sku(void) +{ + const gpio_t spd_gpios[] = { + GPIO_MEM_CONFIG_0, + GPIO_MEM_CONFIG_1, + GPIO_MEM_CONFIG_2, + GPIO_MEM_CONFIG_3, + }; + + int val = gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)); + + if ((board_id() != 0) && (board_id() != BOARD_ID_UNKNOWN)) + return val; + + /* + * For boards with id 0 or unknown, memory straps 3 and 4 are + * incorrectly stuffed in hardware. This is a workaround for these + * boards to override memory strap 3 to 0 and 4 to 1. + */ + switch (val) { + case 3: + val = 0; + break; + case 4: + val = 1; + break; + } + + return val; +} |