From 471e24e9875bcafb46ebb33c7db63fd0ed808bc8 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 21 Jul 2022 07:48:13 +0000 Subject: [PATCH] mb/google/rex: Add memory configuration board straps This patch reads various memory configuration GPIOs to fill in below details: 1. variant_memory_sku() 2. variant_is_half_populated() BUG=b:224325352 TEST=Able to build Google/Rex. Signed-off-by: Subrata Banik Change-Id: I23bad8c78523cb56008e6d67e7776e57e42fbeb9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66041 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- .../variants/baseboard/rex/include/baseboard/gpio.h | 6 ++++++ .../google/rex/variants/baseboard/rex/memory.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/rex/variants/baseboard/rex/include/baseboard/gpio.h b/src/mainboard/google/rex/variants/baseboard/rex/include/baseboard/gpio.h index ce389fe7d7..52a33667cb 100644 --- a/src/mainboard/google/rex/variants/baseboard/rex/include/baseboard/gpio.h +++ b/src/mainboard/google/rex/variants/baseboard/rex/include/baseboard/gpio.h @@ -17,5 +17,11 @@ #define EC_SCI_GPI GPE0_ESPI /* EC wake is LAN_WAKE# which is a special DeepSX wake pin */ #define GPE_EC_WAKE GPE0_LAN_WAK +/* Memory configuration board straps */ +#define GPIO_MEM_CONFIG_0 GPP_E11 +#define GPIO_MEM_CONFIG_1 GPP_E02 +#define GPIO_MEM_CONFIG_2 GPP_E01 +#define GPIO_MEM_CONFIG_3 GPP_E12 +#define GPIO_MEM_CH_SEL GPP_E13 #endif /* __BASEBOARD_GPIO_H__ */ diff --git a/src/mainboard/google/rex/variants/baseboard/rex/memory.c b/src/mainboard/google/rex/variants/baseboard/rex/memory.c index 0fb80e94af..a8f65155e5 100644 --- a/src/mainboard/google/rex/variants/baseboard/rex/memory.c +++ b/src/mainboard/google/rex/variants/baseboard/rex/memory.c @@ -17,12 +17,19 @@ const struct mb_cfg *__weak variant_memory_params(void) int __weak variant_memory_sku(void) { - return 0; + gpio_t spd_gpios[] = { + GPIO_MEM_CONFIG_0, + GPIO_MEM_CONFIG_1, + GPIO_MEM_CONFIG_2, + GPIO_MEM_CONFIG_3, + }; + + return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)); } bool __weak variant_is_half_populated(void) { - return 0; + return gpio_get(GPIO_MEM_CH_SEL); } void __weak variant_get_spd_info(struct mem_spd *spd_info)