Hung-Te Lin submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved Rex-BC Chen: Looks good to me, but someone else must approve
soc/mediatek/common: add mt6359p vcore support

Add mt6359p vcore set/get support.
To adjust frequency of little core, we need to adjust voltage of vcore.

Signed-off-by: James Lo <james.lo@mediatek.corp-partner.google.com>
Change-Id: Ibf49390ba78870b834c6d0b64e3f0f30f3494f18
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56843
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
---
M src/soc/mediatek/common/include/soc/mt6359p.h
M src/soc/mediatek/common/mt6359p.c
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/soc/mediatek/common/include/soc/mt6359p.h b/src/soc/mediatek/common/include/soc/mt6359p.h
index 996d2e8..5afac9f 100644
--- a/src/soc/mediatek/common/include/soc/mt6359p.h
+++ b/src/soc/mediatek/common/include/soc/mt6359p.h
@@ -18,6 +18,8 @@
PMIC_OTP_CON12 = 0x03a2,
PMIC_OTP_CON13 = 0x03a4,
PMIC_PWRHOLD = 0x0a08,
+ PMIC_VCORE_DBG0 = 0x1526,
+ PMIC_VCORE_ELR0 = 0x152c,
PMIC_VGPU11_DBG0 = 0x15a6,
PMIC_VGPU11_ELR0 = 0x15b4,
PMIC_VS2_VOTER = 0x18aa,
@@ -50,6 +52,7 @@
MT6359P_GPU11 = 0,
MT6359P_SRAM_PROC1,
MT6359P_SRAM_PROC2,
+ MT6359P_CORE,
MT6359P_MAX,
};

diff --git a/src/soc/mediatek/common/mt6359p.c b/src/soc/mediatek/common/mt6359p.c
index 8ebcfc6..5a87c0d 100644
--- a/src/soc/mediatek/common/mt6359p.c
+++ b/src/soc/mediatek/common/mt6359p.c
@@ -177,6 +177,10 @@
vol_offset = 500000;
vol_reg = PMIC_VSRAM_PROC2_ELR;
break;
+ case MT6359P_CORE:
+ vol_offset = 506250;
+ vol_reg = PMIC_VCORE_ELR0;
+ break;
default:
die("ERROR: Unknown buck_id %u", buck_id);
return;
@@ -209,6 +213,11 @@
vol_offset = 500000;
vol_reg = PMIC_VSRAM_PROC2_VOSEL1;
break;
+ case MT6359P_CORE:
+ vol_shift = 0;
+ vol_offset = 506250;
+ vol_reg = PMIC_VCORE_DBG0;
+ break;
default:
die("ERROR: Unknown buck_id %u", buck_id);
return 0;

To view, visit change 56843. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibf49390ba78870b834c6d0b64e3f0f30f3494f18
Gerrit-Change-Number: 56843
Gerrit-PatchSet: 3
Gerrit-Owner: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte@chromium.org>
Gerrit-Reviewer: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged