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>
This commit is contained in:
Tim Chu 2021-03-31 02:14:41 -07:00 committed by Werner Zeh
parent 736c94f361
commit 96088bf089
2 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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