summaryrefslogtreecommitdiff
path: root/src/mainboard/google/auron/variants/lulu
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-06-23 13:55:56 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-08-27 16:03:32 +0000
commit19f1e9104a5ae08d031b108a9640bf0f61f61b79 (patch)
treeacd363b8be339593845f2c2b76a06a86daeea85a /src/mainboard/google/auron/variants/lulu
parent3533808a6dbe335fa76bc82869fb6e9719b250ab (diff)
mb/google/auron: Refactor memory-down SPD handling
Variants only need to provide the SPD index and whether said index corresponds to a dual-channel configuration, which can be achieved without using `pei_data`. Add two functions that return the values and use them in `spd.c` at mainboard level. Change-Id: I9bc4527057d4a771883c8cc60da2501516d6fb94 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55803 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'src/mainboard/google/auron/variants/lulu')
-rw-r--r--src/mainboard/google/auron/variants/lulu/spd/spd.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/mainboard/google/auron/variants/lulu/spd/spd.c b/src/mainboard/google/auron/variants/lulu/spd/spd.c
index a54fe4a7fb..33e8c9b55d 100644
--- a/src/mainboard/google/auron/variants/lulu/spd/spd.c
+++ b/src/mainboard/google/auron/variants/lulu/spd/spd.c
@@ -1,13 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <endian.h>
-#include <string.h>
-#include <southbridge/intel/lynxpoint/lp_gpio.h>
-#include <soc/pei_data.h>
-#include <soc/romstage.h>
-#include <ec/google/chromeec/ec.h>
-#include <mainboard/google/auron/ec.h>
#include <mainboard/google/auron/variant.h>
+#include <southbridge/intel/lynxpoint/lp_gpio.h>
/* Lulu board memory configuration GPIOs */
#define SPD_GPIO_BIT0 13
@@ -15,8 +9,7 @@
#define SPD_GPIO_BIT2 47
#define SPD_GPIO_BIT3 8
-/* Copy SPD data for on-board memory */
-void mainboard_fill_spd_data(struct pei_data *pei_data)
+unsigned int variant_get_spd_index(void)
{
const int gpio_vector[] = {
SPD_GPIO_BIT0,
@@ -25,17 +18,11 @@ void mainboard_fill_spd_data(struct pei_data *pei_data)
SPD_GPIO_BIT3,
-1,
};
+ return get_gpios(gpio_vector);
+}
- const unsigned int spd_index = get_gpios(gpio_vector);
-
- /* CH0 */
- fill_spd_for_index(pei_data->spd_data[0][0], spd_index);
-
+bool variant_is_dual_channel(const unsigned int spd_index)
+{
/* CH1 not used in 2GB configurations */
- if (!((spd_index == 0b0000) || (spd_index == 0b0011) ||
- (spd_index == 0b1010))) {
- memcpy(pei_data->spd_data[1][0], pei_data->spd_data[0][0], SPD_LEN);
- } else {
- pei_data->dimm_channel1_disabled = 3;
- }
+ return !((spd_index == 0b0000) || (spd_index == 0b0011) || (spd_index == 0b1010));
}