Lines Matching refs:cru
60 static uint32_t rkclk_pll_get_rate(struct rv1108_cru *cru, in rkclk_pll_get_rate() argument
66 struct rv1108_pll *pll = &cru->pll[pll_id]; in rkclk_pll_get_rate()
86 static int rv1108_mac_set_clk(struct rv1108_cru *cru, ulong rate) in rv1108_mac_set_clk() argument
88 uint32_t con = readl(&cru->clksel_con[24]); in rv1108_mac_set_clk()
93 pll_rate = rkclk_pll_get_rate(cru, CLK_GENERAL); in rv1108_mac_set_clk()
95 pll_rate = rkclk_pll_get_rate(cru, CLK_ARM); in rv1108_mac_set_clk()
103 rk_clrsetreg(&cru->clksel_con[24], MAC_CLK_DIV_MASK, in rv1108_mac_set_clk()
111 static int rv1108_sfc_set_clk(struct rv1108_cru *cru, uint rate) in rv1108_sfc_set_clk() argument
113 u32 con = readl(&cru->clksel_con[27]); in rv1108_sfc_set_clk()
118 pll_rate = rkclk_pll_get_rate(cru, CLK_GENERAL); in rv1108_sfc_set_clk()
120 pll_rate = rkclk_pll_get_rate(cru, CLK_DDR); in rv1108_sfc_set_clk()
124 rk_clrsetreg(&cru->clksel_con[27], SFC_CLK_DIV_MASK, in rv1108_sfc_set_clk()
132 static ulong rv1108_saradc_get_clk(struct rv1108_cru *cru) in rv1108_saradc_get_clk() argument
136 val = readl(&cru->clksel_con[22]); in rv1108_saradc_get_clk()
143 static ulong rv1108_saradc_set_clk(struct rv1108_cru *cru, uint hz) in rv1108_saradc_set_clk() argument
150 rk_clrsetreg(&cru->clksel_con[22], in rv1108_saradc_set_clk()
154 return rv1108_saradc_get_clk(cru); in rv1108_saradc_set_clk()
163 return rkclk_pll_get_rate(priv->cru, clk->id); in rv1108_clk_get_rate()
165 return rv1108_saradc_get_clk(priv->cru); in rv1108_clk_get_rate()
178 new_rate = rv1108_mac_set_clk(priv->cru, rate); in rv1108_clk_set_rate()
181 new_rate = rv1108_sfc_set_clk(priv->cru, rate); in rv1108_clk_set_rate()
184 new_rate = rv1108_saradc_set_clk(priv->cru, rate); in rv1108_clk_set_rate()
198 static void rkclk_init(struct rv1108_cru *cru) in rkclk_init() argument
200 unsigned int apll = rkclk_pll_get_rate(cru, CLK_ARM); in rkclk_init()
201 unsigned int dpll = rkclk_pll_get_rate(cru, CLK_DDR); in rkclk_init()
202 unsigned int gpll = rkclk_pll_get_rate(cru, CLK_GENERAL); in rkclk_init()
204 rk_clrsetreg(&cru->clksel_con[0], CORE_CLK_DIV_MASK, in rkclk_init()
214 priv->cru = dev_read_addr_ptr(dev); in rv1108_clk_ofdata_to_platdata()
223 rkclk_init(priv->cru); in rv1108_clk_probe()