soc/mediatek/mt8183: Force DRAM retraining if hotkey pressed

Similar to MRC cache on x86 platforms, when a hotkey is pressed during
boot, the calibration data cache saved in the flash will be cleared,
consequently triggering DRAM retraining (full calibration) in the next
boot.

BRANCH=kukui
BUG=b:139099592
TEST=emerge-kukui coreboot

Change-Id: I2f9225f359e1fe5733e8e1c48b396aaeeb9a58ab
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36090
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
This commit is contained in:
Yu-Ping Wu 2019-10-17 13:38:32 +08:00 committed by Patrick Georgi
parent 998a3cc0da
commit 46009ea4cc
1 changed files with 6 additions and 0 deletions

View File

@ -169,6 +169,12 @@ void mt_mem_init(struct dramc_param_ops *dparam_ops)
/* Load calibration params from flash and run fast calibration */
if (recovery_mode) {
printk(BIOS_WARNING, "Skip loading cached calibration data\n");
if (vboot_recovery_mode_memory_retrain()) {
printk(BIOS_WARNING, "Retrain memory in next boot\n");
/* Use 0xFF as erased flash data. */
memset(dparam, 0xff, sizeof(*dparam));
dparam_ops->write_to_flash(dparam);
}
} else if (dparam_ops->read_from_flash(dparam)) {
printk(BIOS_INFO, "DRAM-K: Fast Calibration\n");
if (dram_run_fast_calibration(dparam, config) == 0) {