soc/mediatek: Unify PLL function names

For consistency with the PLL function naming:
- Rename edp_mux_set_sel() to mt_pll_edp_mux_set_sel().
- Rename mux_set_sel() to pll_mux_set_sel().

BUG=none
TEST=build pass.
BRANCH=corsola

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: Ifc7b14bf0db5a5461037e2fbf41756d1542ca945
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68622
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Rex-BC Chen 2022-10-18 18:59:41 +08:00 committed by Felix Held
parent 08248c0ce8
commit a6cd1bd6a8
9 changed files with 19 additions and 16 deletions

View File

@ -64,14 +64,17 @@ DEFINE_BITFIELD(PLL_POWER_ISO_ENABLE, 1, 0)
DEFINE_BITFIELD(PLL_CON1, 31, 0)
/* PLL internal interface */
void pll_set_pcw_change(const struct pll *pll);
void mux_set_sel(const struct mux *mux, u32 sel);
void pll_mux_set_sel(const struct mux *mux, u32 sel);
int pll_set_rate(const struct pll *pll, u32 rate);
/* PLL internal interface */
void mt_pll_init(void);
void mt_pll_raise_little_cpu_freq(u32 freq);
void mt_pll_raise_cci_freq(u32 freq);
void mt_pll_set_tvd_pll1_freq(u32 freq);
void edp_mux_set_sel(u32 sel);
void mt_pll_edp_mux_set_sel(u32 sel);
void mt_pll_spmi_mux_select(void);
void mt_pll_set_usb_clock(void);

View File

@ -5,7 +5,7 @@
#include <soc/pll.h>
#include <types.h>
void mux_set_sel(const struct mux *mux, u32 sel)
void pll_mux_set_sel(const struct mux *mux, u32 sel)
{
u32 mask = GENMASK(mux->mux_width - 1, 0);
u32 val = read32(mux->reg);

View File

@ -347,7 +347,7 @@ void mt_pll_init(void)
* TOP CLKMUX -- DO NOT CHANGE WITHOUT ADJUSTING <soc/pll.h> CONSTANTS!
*************/
for (i = 0; i < ARRAY_SIZE(mux_sels); i++)
mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
pll_mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
/* enable scpsys clock off control */
write32(&mtk_topckgen->clk_scp_cfg_0,
@ -445,5 +445,5 @@ void mt_mem_pll_config_post(void)
void mt_mem_pll_mux(void)
{
/* CLK_CFG_0 */
mux_set_sel(&muxes[TOP_MEM_SEL], 1); /* 1: dmpll_ck */
pll_mux_set_sel(&muxes[TOP_MEM_SEL], 1); /* 1: dmpll_ck */
}

View File

@ -344,7 +344,7 @@ void mt_pll_init(void)
* TOP CLKMUX -- DO NOT CHANGE WITHOUT ADJUSTING <soc/pll.h> CONSTANTS!
*/
for (i = 0; i < ARRAY_SIZE(mux_sels); i++)
mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
pll_mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
/* enable [14] dramc_pll104m_ck */
setbits32(&mtk_topckgen->clk_misc_cfg_0, 1 << 14);

View File

@ -468,7 +468,7 @@ void mt_pll_init(void)
INFRACFG_AO_PERI_BUS_REG0_2, 1);
for (i = 0; i < ARRAY_SIZE(mux_sels); i++)
mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
pll_mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
/* [4] SCP_CORE_CK_CG, [5] SEJ_CG */
write32(&mt8186_infracfg_ao->module_sw_cg_0_clr, 0x00000030);
@ -528,7 +528,7 @@ void mt_pll_set_usb_clock(void)
void mt_pll_spmi_mux_select(void)
{
/* 4: ulposc1_d10 */
mux_set_sel(&muxes[TOP_SPMI_MST_SEL], 4);
pll_mux_set_sel(&muxes[TOP_SPMI_MST_SEL], 4);
}
u32 mt_fmeter_get_freq_khz(enum fmeter_type type, u32 id)

View File

@ -573,7 +573,7 @@ void mt_pll_init(void)
* TOP CLKMUX -- DO NOT CHANGE WITHOUT ADJUSTING <soc/pll.h> CONSTANTS!
*/
for (i = 0; i < ARRAY_SIZE(mux_sels); i++)
mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
pll_mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
/* turn off unused clock in infra_ao */
write32(&mt8188_infracfg_ao->module_sw_cg_1_set, 0x00004000);
@ -633,9 +633,9 @@ void mt_pll_set_tvd_pll1_freq(u32 freq)
udelay(PLL_EN_DELAY);
}
void edp_mux_set_sel(u32 sel)
void mt_pll_edp_mux_set_sel(u32 sel)
{
mux_set_sel(&muxes[TOP_EDP_SEL], sel);
pll_mux_set_sel(&muxes[TOP_EDP_SEL], sel);
}
void mt_pll_set_usb_clock(void)

View File

@ -464,7 +464,7 @@ void mt_pll_init(void)
* TOP CLKMUX -- DO NOT CHANGE WITHOUT ADJUSTING <soc/pll.h> CONSTANTS!
*/
for (i = 0; i < ARRAY_SIZE(mux_sels); i++)
mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
pll_mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
/* enable [14] dramc_pll104m_ck */
setbits32(&mtk_topckgen->clk_misc_cfg_0, 1 << 14);

View File

@ -221,7 +221,7 @@ static int mtk_dpintf_power_on(struct mtk_dpintf *dpintf, const struct edid *edi
pll_rate = edid->mode.pixel_clock * 1000 * (1 << ((clksrc + 1) / 2));
mt_pll_set_tvd_pll1_freq(pll_rate / 4);
edp_mux_set_sel(clksrc);
mt_pll_edp_mux_set_sel(clksrc);
mtk_dpintf_enable(dpintf);

View File

@ -755,7 +755,7 @@ void mt_pll_init(void)
* TOP CLKMUX -- DO NOT CHANGE WITHOUT ADJUSTING <soc/pll.h> CONSTANTS!
*/
for (i = 0; i < ARRAY_SIZE(mux_sels); i++)
mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
pll_mux_set_sel(&muxes[mux_sels[i].id], mux_sels[i].sel);
/* switch sram control to bypass mode for PCIE_MAC_P0 */
setbits32(&mtk_spm->ap_mdsrc_req, 0x1);
@ -827,9 +827,9 @@ void mt_pll_set_tvd_pll1_freq(u32 freq)
udelay(PLL_EN_DELAY);
}
void edp_mux_set_sel(u32 sel)
void mt_pll_edp_mux_set_sel(u32 sel)
{
mux_set_sel(&muxes[TOP_EDP_SEL], sel);
pll_mux_set_sel(&muxes[TOP_EDP_SEL], sel);
}
u32 mt_fmeter_get_freq_khz(enum fmeter_type type, u32 id)