summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Chuang <ryan.chuang@mediatek.corp-partner.google.com>2021-07-08 17:22:31 +0800
committerHung-Te Lin <hungte@chromium.org>2021-07-12 02:54:23 +0000
commite46cd138ffad3bff6d6a68831c9c65b62e857ce6 (patch)
tree15dc50ef3862705c8d5e6f62c65d5ecf0871d5cb
parent2555bd410b104407ba137955abecf38cc89f53df (diff)
vc/mediatek/mt8195: Enable DRAM Vcore DVFS settings
Add the implementation for vcore voltage control. Also remove the reporting of vio18 because it is fixed during DRAM init, and we won't provide drivers for reading or writing it. Signed-off-by: Ryan Chuang <ryan.chuang@mediatek.corp-partner.google.com> Change-Id: I39342aea902a87cdc2c5b862e5d1a889fcc822c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56106 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c1
-rw-r--r--src/vendorcode/mediatek/mt8195/dramc/dramc_top.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c b/src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c
index b761473955..b5de592c2b 100644
--- a/src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c
+++ b/src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c
@@ -272,7 +272,6 @@ void vSetVcoreByFreq(DRAMC_CTX_T *p)
#ifndef DDR_INIT_TIME_PROFILING
print("Read voltage for %d, %d\n", p->frequency, vGet_Current_SRAMIdx(p));
- print("Vio18 = %d\n", dramc_get_vio18_voltage());
print("Vcore = %d\n", dramc_get_vcore_voltage());
print("Vdram = %d\n", dramc_get_vmdd_voltage(p->dram_type));
print("Vddq = %d\n", dramc_get_vmddq_voltage(p->dram_type));
diff --git a/src/vendorcode/mediatek/mt8195/dramc/dramc_top.c b/src/vendorcode/mediatek/mt8195/dramc/dramc_top.c
index 570c9763e9..56624129f4 100644
--- a/src/vendorcode/mediatek/mt8195/dramc/dramc_top.c
+++ b/src/vendorcode/mediatek/mt8195/dramc/dramc_top.c
@@ -352,8 +352,13 @@ unsigned int dramc_set_vcore_voltage(unsigned int vcore)
{
#ifdef MTK_PMIC_MT6359
return mtk_regulator_set_voltage(&reg_vcore, vcore, MAX_VCORE);
-#endif
+#elif defined(FOR_COREBOOT)
+ dramc_debug("%s set vcore to %u\n", __func__, vcore);
+ mainboard_set_regulator_vol(MTK_REGULATOR_VCORE, vcore);
return 0;
+#else
+ return 0;
+#endif
}
unsigned int dramc_get_vcore_voltage(void)