From ab1b83d5a4aa7775154ef53782f68314610b53d5 Mon Sep 17 00:00:00 2001 From: Tristan Shieh Date: Thu, 1 Nov 2018 18:01:50 +0800 Subject: mediatek: Refactor PMIC wrapper code among similar SoCs Refactor PMIC wrapper code which will be reused among similar SoCs. Move reusable code into the common folder. BUG=b:80501386 BRANCH=none TEST=emerge-elm coreboot Change-Id: I25acb6da49e72748d856804ef4f97e9ec3bef72d Signed-off-by: Tristan Shieh Reviewed-on: https://review.coreboot.org/29420 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/soc/mediatek/mt8173/emi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/soc/mediatek/mt8173/emi.c') diff --git a/src/soc/mediatek/mt8173/emi.c b/src/soc/mediatek/mt8173/emi.c index 872ed6cf11..072edee872 100644 --- a/src/soc/mediatek/mt8173/emi.c +++ b/src/soc/mediatek/mt8173/emi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -33,15 +34,15 @@ struct emi_regs *emi_regs = (void *)EMI_BASE; static void dram_vcore_adjust(void) { /* options: Vcore_HV_LPPDR3/Vcore_NV_LPPDR3/Vcore_LV_LPPDR3 */ - mt6391_write(PMIC_RG_VCORE_CON9, Vcore_NV_LPPDR3, 0x7F, 0); - mt6391_write(PMIC_RG_VCORE_CON10, Vcore_NV_LPPDR3, 0x7F, 0); + pwrap_write_field(PMIC_RG_VCORE_CON9, Vcore_NV_LPPDR3, 0x7F, 0); + pwrap_write_field(PMIC_RG_VCORE_CON10, Vcore_NV_LPPDR3, 0x7F, 0); } static void dram_vmem_adjust(void) { /* options: Vmem_HV_LPPDR3/Vmem_NV_LPPDR3/Vmem_LV_LPPDR3 */ - mt6391_write(PMIC_RG_VDRM_CON9, Vmem_NV_LPDDR3, 0x7F, 0); - mt6391_write(PMIC_RG_VDRM_CON10, Vmem_NV_LPDDR3, 0x7F, 0); + pwrap_write_field(PMIC_RG_VDRM_CON9, Vmem_NV_LPDDR3, 0x7F, 0); + pwrap_write_field(PMIC_RG_VDRM_CON10, Vmem_NV_LPDDR3, 0x7F, 0); } static void emi_init(const struct mt8173_sdram_params *sdram_params) -- cgit v1.2.3