summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Chu <Tim.Chu@quantatw.com>2021-03-31 02:14:41 -0700
committerWerner Zeh <werner.zeh@siemens.com>2021-06-09 04:02:18 +0000
commit96088bf08913b80a2293c9ab184bb1b6ac8143ac (patch)
tree4188ec117ef7209141d15b49d56be05c62eb932e /src
parent736c94f3618468d56f763398295e7a2bc90170b8 (diff)
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 <Tim.Chu@quantatw.com> Change-Id: I53a923b51b36f9f5db491ef142109f58f9a4611d Reviewed-on: https://review.coreboot.org/c/coreboot/+/51972 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/ocp/deltalake/romstage.c10
-rw-r--r--src/mainboard/ocp/deltalake/vpd.h3
2 files changed, 13 insertions, 0 deletions
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