From 96088bf08913b80a2293c9ab184bb1b6ac8143ac Mon Sep 17 00:00:00 2001 From: Tim Chu Date: Wed, 31 Mar 2021 02:14:41 -0700 Subject: mb/ocp/deltalake: Add VPD option to force memory training Add function to force memory training and add VPD variable to operate this function. Tested=On OCP Delta Lake, memory training can be forced via VPD. Signed-off-by: Tim Chu Change-Id: I53a923b51b36f9f5db491ef142109f58f9a4611d Reviewed-on: https://review.coreboot.org/c/coreboot/+/51972 Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Zhang --- src/mainboard/ocp/deltalake/romstage.c | 10 ++++++++++ src/mainboard/ocp/deltalake/vpd.h | 3 +++ 2 files changed, 13 insertions(+) (limited to 'src/mainboard/ocp') diff --git a/src/mainboard/ocp/deltalake/romstage.c b/src/mainboard/ocp/deltalake/romstage.c index 9227508771..75e9ec9e2f 100644 --- a/src/mainboard/ocp/deltalake/romstage.c +++ b/src/mainboard/ocp/deltalake/romstage.c @@ -183,6 +183,8 @@ static void mainboard_config_iio(FSPM_UPD *mupd) void mainboard_memory_init_params(FSPM_UPD *mupd) { + uint8_t val; + /* Since it's the first IPMI command, it's better to run get BMC selftest result first */ if (ipmi_kcs_premem_init(CONFIG_BMC_KCS_BASE, 0) == CB_SUCCESS) { @@ -190,6 +192,14 @@ void mainboard_memory_init_params(FSPM_UPD *mupd) init_frb2_wdt(); } + /* Enable force memory training */ + if (vpd_get_bool(MEM_TRAIN_FORCE, VPD_RW_THEN_RO, &val)) { + if (mupd->FspmArchUpd.NvsBufferPtr && val) { + mupd->FspmArchUpd.NvsBufferPtr = 0; + printk(BIOS_DEBUG, "Force Memory Training...Start\n"); + } + } + mainboard_config_gpios(mupd); mainboard_config_iio(mupd); mainboard_config_upd(mupd); diff --git a/src/mainboard/ocp/deltalake/vpd.h b/src/mainboard/ocp/deltalake/vpd.h index e50f5701be..fb33ef26f5 100644 --- a/src/mainboard/ocp/deltalake/vpd.h +++ b/src/mainboard/ocp/deltalake/vpd.h @@ -50,4 +50,7 @@ #define SKIP_INTEL_TXT_LOCKDOWN "skip_intel_txt_lockdown" #define SKIP_INTEL_TXT_LOCKDOWN_DEFAULT 0 +/* Force memory training: 0 = Disable, 1 = Enable, Default setting is 0 */ +#define MEM_TRAIN_FORCE "mem_train_force_enable" + #endif -- cgit v1.2.3