From e46cd138ffad3bff6d6a68831c9c65b62e857ce6 Mon Sep 17 00:00:00 2001 From: Ryan Chuang Date: Thu, 8 Jul 2021 17:22:31 +0800 Subject: 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 Change-Id: I39342aea902a87cdc2c5b862e5d1a889fcc822c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56106 Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c | 1 - src/vendorcode/mediatek/mt8195/dramc/dramc_top.c | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/vendorcode/mediatek/mt8195') diff --git a/src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c b/src/vendorcode/mediatek/mt8195/dramc/dramc_pi_main.c index b76147395536..b5de592c2bbb 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 570c9763e931..56624129f4b3 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(®_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) -- cgit v1.2.3