Yu-Ping Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36456 )
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode
In order to decrease the boot time, DRAM DVFS will not be supported in recovery mode.
BRANCH=kukui BUG=b:142358843 TEST=emerge-kukui coreboot
Change-Id: I4f1b1b020eba9bfce21655169bcb31b98d54b010 Signed-off-by: Yu-Ping Wu yupingso@chromium.org --- M src/soc/mediatek/mt8183/emi.c M src/soc/mediatek/mt8183/include/soc/dramc_param.h M src/soc/mediatek/mt8183/memory.c 3 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/36456/1
diff --git a/src/soc/mediatek/mt8183/emi.c b/src/soc/mediatek/mt8183/emi.c index 93e92ac..7cd631c 100644 --- a/src/soc/mediatek/mt8183/emi.c +++ b/src/soc/mediatek/mt8183/emi.c @@ -531,7 +531,7 @@ 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 564b43d..1f4148b 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 @@ /* 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 b9ed619..17bf33b 100644 --- a/src/soc/mediatek/mt8183/memory.c +++ b/src/soc/mediatek/mt8183/memory.c @@ -166,6 +166,10 @@
const bool recovery_mode = vboot_recovery_mode_enabled();
+ /* DRAM DVFS is not supported 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");
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36456 )
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36456/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36456/1//COMMIT_MSG@9 PS1, Line 9: In order to decrease the boot time, DRAM DVFS will not be supported in : recovery mode. Currently in recovery mode we will always run full-k with DVFS (which implies tripling memory training time for multiple frequencies) and that takes a lot of time.
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.
https://review.coreboot.org/c/coreboot/+/36456/1/src/soc/mediatek/mt8183/mem... File src/soc/mediatek/mt8183/memory.c:
https://review.coreboot.org/c/coreboot/+/36456/1/src/soc/mediatek/mt8183/mem... PS1, Line 169: DRAM DVFS is not supported in recovery mode We can support that, so this should be 'DRAM DVFS is disabled in recovery mode.'
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36456 )
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
Patch Set 1:
can you also provide the number of boot time reduced by this change in commit message?
Hello Julius Werner, Hung-Te Lin, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36456
to look at the new patch set (#2).
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
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 --- M src/soc/mediatek/mt8183/emi.c M src/soc/mediatek/mt8183/include/soc/dramc_param.h M src/soc/mediatek/mt8183/memory.c 3 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/36456/2
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36456 )
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36456/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36456/1//COMMIT_MSG@9 PS1, Line 9: In order to decrease the boot time, DRAM DVFS will not be supported in : recovery mode.
Currently in recovery mode we will always run full-k with DVFS (which implies tripling memory traini […]
Done
https://review.coreboot.org/c/coreboot/+/36456/1/src/soc/mediatek/mt8183/mem... File src/soc/mediatek/mt8183/memory.c:
https://review.coreboot.org/c/coreboot/+/36456/1/src/soc/mediatek/mt8183/mem... PS1, Line 169: DRAM DVFS is not supported in recovery mode
We can support that, so this should be 'DRAM DVFS is disabled in recovery mode. […]
Done
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36456 )
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36456 )
Change subject: soc/mediatek/mt8183: Disable DRAM DVFS in recovery mode ......................................................................
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 --- M src/soc/mediatek/mt8183/emi.c M src/soc/mediatek/mt8183/include/soc/dramc_param.h M src/soc/mediatek/mt8183/memory.c 3 files changed, 7 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Hung-Te Lin: Looks good to me, approved
diff --git a/src/soc/mediatek/mt8183/emi.c b/src/soc/mediatek/mt8183/emi.c index 93e92ac..7cd631c 100644 --- a/src/soc/mediatek/mt8183/emi.c +++ b/src/soc/mediatek/mt8183/emi.c @@ -531,7 +531,7 @@ 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 564b43d..1f4148b 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 @@ /* 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 b9ed619..13c3d9a 100644 --- a/src/soc/mediatek/mt8183/memory.c +++ b/src/soc/mediatek/mt8183/memory.c @@ -166,6 +166,10 @@
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");