summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-10-23 14:20:53 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-10-24 07:45:55 +0000
commit285975dbba8c7f3bbb9f9950e79a30bb983d5123 (patch)
tree3ab0a82e2e0ee3a9e65d38711c1493d0cdc2cc80 /src/soc
parent7f1da07849c025982cda0e973588dc6305616cbe (diff)
downloadcoreboot-285975dbba8c7f3bbb9f9950e79a30bb983d5123.tar.xz
soc/mediatek/mt8183: Force retraining memory if requested
To allow retraining memory without hotkey (for example in manufacturing process), we want to enforce re-training when the recovery reason is set to VB2_RECOVERY_TRAIN_AND_REBOOT (which can be done by running "crossystem recovery_request=0xc4"). The special reason was created for X86 MRC cache, for ensuring RO calibration data is filled (the underlying implementation was in vboot, not coreboot); and on MT8183 we have only RW calibration, but it seems totally fine to extend that for RW. BRANCH=kukui BUG=None TEST=boots; crossystem recovery_reason=0xc4; reboot Change-Id: Iaa5275f0e0eb90f6ab3a7d4579977a6655d59bd9 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36251 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/mediatek/mt8183/memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/mediatek/mt8183/memory.c b/src/soc/mediatek/mt8183/memory.c
index 2a4ebbdd1f..b9ed619a8e 100644
--- a/src/soc/mediatek/mt8183/memory.c
+++ b/src/soc/mediatek/mt8183/memory.c
@@ -169,7 +169,8 @@ 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()) {
+ if (vboot_recovery_mode_memory_retrain() ||
+ vboot_check_recovery_request() == VB2_RECOVERY_TRAIN_AND_REBOOT) {
printk(BIOS_WARNING, "Retrain memory in next boot\n");
/* Use 0xFF as erased flash data. */
memset(dparam, 0xff, sizeof(*dparam));