soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode

Currently full calibration with DVFS (which implies tripling memory
training time for multiple frequencies) will be run in recovery mode,
which takes up to 30 seconds with serial console enabled.

However, in recovery mode the system should be running only the recovery
programs with minimal services. DVFS should be not needed.

In order to improve stability and system boot time, we want to disable
DVFS training in recovery mode.

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

Change-Id: I4f1b1b020eba9bfce21655169bcb31b98d54b010
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36456
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Yu-Ping Wu 2019-10-29 16:20:35 +08:00 committed by Patrick Georgi
parent 7d9d63b79f
commit 02d9071a0b
3 changed files with 7 additions and 2 deletions

View File

@ -531,7 +531,7 @@ int mt_set_emi(const struct dramc_param *dparam)
bool first_run = true;
set_vdram1_vddq_voltage();
if (CONFIG(MT8183_DRAM_DVFS)) {
if (dparam->header.config & DRAMC_CONFIG_DVFS) {
if (run_calib(dparam, &shared, DRAM_DFS_SHUFFLE_3,
&first_run) != 0)
return -1;

View File

@ -23,7 +23,7 @@
enum {
DRAMC_PARAM_HEADER_MAGIC = 0x44524d4b,
DRAMC_PARAM_HEADER_VERSION = 1,
DRAMC_PARAM_HEADER_VERSION = 2,
};
enum DRAMC_PARAM_STATUS_CODES {
@ -43,6 +43,7 @@ enum DRAMC_PARAM_STATUS_CODES {
/* Bit flags */
enum DRAMC_PARAM_CONFIG {
DRAMC_CONFIG_EMCP = 0x0001,
DRAMC_CONFIG_DVFS = 0x0002,
};
enum DRAMC_PARAM_FLAGS {

View File

@ -166,6 +166,10 @@ void mt_mem_init(struct dramc_param_ops *dparam_ops)
const bool recovery_mode = vboot_recovery_mode_enabled();
/* DRAM DVFS is disabled in recovery mode */
if (CONFIG(MT8183_DRAM_DVFS) && !recovery_mode)
config |= DRAMC_CONFIG_DVFS;
/* Load calibration params from flash and run fast calibration */
if (recovery_mode) {
printk(BIOS_WARNING, "Skip loading cached calibration data\n");