cong yang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74341 )
Change subject: soc/mediatek: Add support for regulator VIO18 ......................................................................
soc/mediatek: Add support for regulator VIO18
To provide power to MIPI panel STA_HIMAX83102_J02, add support for regulator VIO18.
BUG=b:272425116 TEST=test firmware display pass for STA_HIMAX83102_J02 on Starmie.
Change-Id: I3c3aa105e648b87fc39f881d762002f67b4422b5 Signed-off-by: Cong Yang yangcong5@huaqin.corp-partner.google.com --- M src/soc/mediatek/common/include/soc/regulator.h M src/soc/mediatek/mt8186/include/soc/mt6366.h M src/soc/mediatek/mt8186/mt6366.c 3 files changed, 36 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/74341/1
diff --git a/src/soc/mediatek/common/include/soc/regulator.h b/src/soc/mediatek/common/include/soc/regulator.h index e2b9251..3cec8f0 100644 --- a/src/soc/mediatek/common/include/soc/regulator.h +++ b/src/soc/mediatek/common/include/soc/regulator.h @@ -23,6 +23,7 @@ MTK_REGULATOR_VRF12, MTK_REGULATOR_VCN33, MTK_REGULATOR_VDD18, + MTK_REGULATOR_VIO18, MTK_REGULATOR_NUM, };
diff --git a/src/soc/mediatek/mt8186/include/soc/mt6366.h b/src/soc/mediatek/mt8186/include/soc/mt6366.h index 2315a24..b64cd8a 100644 --- a/src/soc/mediatek/mt8186/include/soc/mt6366.h +++ b/src/soc/mediatek/mt8186/include/soc/mt6366.h @@ -39,6 +39,7 @@ PMIC_VDRAM1_DBG0 = 0x161e, PMIC_VDRAM1_VOSEL = 0x1626, PMIC_SMPS_ANA_CON0 = 0x1808, + PMIC_LDO_VIO18_CON0 = 0x1aec, PMIC_VDDQ_OP_EN = 0x1b16, PMIC_VSRAM_PROC12_OP_EN = 0x1b90, PMIC_VSRAM_PROC12_DBG0 = 0x1ba2, @@ -67,6 +68,7 @@ MT6366_VSRAM_PROC12, MT6366_VRF12, MT6366_VCN33, + MT6366_VIO18, MT6366_REGULATOR_NUM, };
diff --git a/src/soc/mediatek/mt8186/mt6366.c b/src/soc/mediatek/mt8186/mt6366.c index 7ef8c24..04f0444 100644 --- a/src/soc/mediatek/mt8186/mt6366.c +++ b/src/soc/mediatek/mt8186/mt6366.c @@ -787,6 +787,16 @@ pwrap_write_field(PMIC_LDO_VCN33_CON0_0, 1, 0x1, 0); }
+static u32 pmic_get_vio18_vol(void) +{ + return pwrap_read_field(PMIC_LDO_VIO18_CON0, 0x1, 0) ? 1800000 : 0; +} + +static void pmic_enable_vio18(void) +{ + pwrap_write_field(PMIC_LDO_VIO18_CON0, 1, 0x1, 0); +} + static void pmic_wdt_set(void) { /* [5]=1, RG_WDTRSTB_DEB */ @@ -914,6 +924,9 @@ case MT6366_VCN33: pmic_set_vcn33_vol(voltage_uv); break; + case MT6366_VIO18: + pmic_enable_vio18(); + break; default: printk(BIOS_ERR, "%s: PMIC %d is not supported\n", __func__, id); break; @@ -941,6 +954,9 @@ return pmic_get_vrf12_vol(); case MT6366_VCN33: return pmic_get_vcn33_vol(); + case MT6366_VIO18: + return pmic_get_vio18_vol(); + break; default: printk(BIOS_ERR, "%s: PMIC %d is not supported\n", __func__, id); break;