summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8183
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/mt8183')
-rw-r--r--src/soc/mediatek/mt8183/emi.c2
-rw-r--r--src/soc/mediatek/mt8183/include/soc/dramc_param.h3
-rw-r--r--src/soc/mediatek/mt8183/memory.c4
3 files changed, 7 insertions, 2 deletions
diff --git a/src/soc/mediatek/mt8183/emi.c b/src/soc/mediatek/mt8183/emi.c
index 93e92aceef..7cd631ca0b 100644
--- a/src/soc/mediatek/mt8183/emi.c
+++ b/src/soc/mediatek/mt8183/emi.c
@@ -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;
diff --git a/src/soc/mediatek/mt8183/include/soc/dramc_param.h b/src/soc/mediatek/mt8183/include/soc/dramc_param.h
index 564b43df9d..1f4148bc8d 100644
--- a/src/soc/mediatek/mt8183/include/soc/dramc_param.h
+++ b/src/soc/mediatek/mt8183/include/soc/dramc_param.h
@@ -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 {
diff --git a/src/soc/mediatek/mt8183/memory.c b/src/soc/mediatek/mt8183/memory.c
index b9ed619a8e..13c3d9ad36 100644
--- a/src/soc/mediatek/mt8183/memory.c
+++ b/src/soc/mediatek/mt8183/memory.c
@@ -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");