soc/mediatek: Add assert for regulator VRF12
Add assert for MT6366_VRF12, define a constant macro for 1200000. BUG=none TEST=build board starmie with mt8186. Change-Id: I6d6a969ae993afcda0596a19928e8f98f343d589 Signed-off-by: Cong Yang <yangcong5@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74394 Reviewed-by: Yidi Lin <yidilin@google.com> Reviewed-by: Ruihai Zhou <zhouruihai@huaqin.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
@ -725,14 +725,17 @@ static void pmic_set_vmc_vol(u32 vmc_uv)
|
|||||||
pwrap_write_field(PMIC_LDO_VMC_CON0, 1, 0xFF, 0);
|
pwrap_write_field(PMIC_LDO_VMC_CON0, 1, 0xFF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define VRF12_VOLTAGE_UV 1200000
|
||||||
|
|
||||||
static u32 pmic_get_vrf12_vol(void)
|
static u32 pmic_get_vrf12_vol(void)
|
||||||
{
|
{
|
||||||
return (pwrap_read_field(PMIC_LDO_VRF12_CON0, 0x3, 0) &
|
return (pwrap_read_field(PMIC_LDO_VRF12_CON0, 0x3, 0) &
|
||||||
pwrap_read_field(PMIC_LDO_VRF12_OP_EN, 0x3, 0)) ? 1200000 : 0;
|
pwrap_read_field(PMIC_LDO_VRF12_OP_EN, 0x3, 0)) ? VRF12_VOLTAGE_UV : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pmic_enable_vrf12(void)
|
static void pmic_set_vrf12_vol(u32 vrf12_uv)
|
||||||
{
|
{
|
||||||
|
assert(vrf12_uv == VRF12_VOLTAGE_UV);
|
||||||
pwrap_write_field(PMIC_LDO_VRF12_CON0, 1, 0x3, 0);
|
pwrap_write_field(PMIC_LDO_VRF12_CON0, 1, 0x3, 0);
|
||||||
pwrap_write_field(PMIC_LDO_VRF12_OP_EN, 1, 0x3, 0);
|
pwrap_write_field(PMIC_LDO_VRF12_OP_EN, 1, 0x3, 0);
|
||||||
}
|
}
|
||||||
@ -921,8 +924,7 @@ void mt6366_set_voltage(enum mt6366_regulator_id id, u32 voltage_uv)
|
|||||||
pmic_set_vsram_proc12_vol(voltage_uv);
|
pmic_set_vsram_proc12_vol(voltage_uv);
|
||||||
break;
|
break;
|
||||||
case MT6366_VRF12:
|
case MT6366_VRF12:
|
||||||
/* VRF12 only provides 1.2V, so we just need to enable it */
|
pmic_set_vrf12_vol(voltage_uv);
|
||||||
pmic_enable_vrf12();
|
|
||||||
break;
|
break;
|
||||||
case MT6366_VCN33:
|
case MT6366_VCN33:
|
||||||
pmic_set_vcn33_vol(voltage_uv);
|
pmic_set_vcn33_vol(voltage_uv);
|
||||||
|
Reference in New Issue
Block a user