arm64: rockchip: rl3399: Remove the ability to put the PLL in normal mode at boot
RK3399 PLLs have three modes : - Normal, where they behave normally and their freq is calculated based on the registers values. - Slow, where the PLL freq is 24Mhz (well, the external oscillator). - Deep Slow, used for suspend where the freq is 32Khz. We used to put every CPU related PLL in normal mode but it can cause problem if the firmware didn't setup the clocks register correctly. And even if it did but left the pll in slow or deep slow mode that might be because the PMIC suppling voltage for the CPU haven't been configured yet and we cannot do that at this point. So remove the ability to set PLLs to normal mode at boot to avoid any problems.
This commit is contained in:
parent
47887527c0
commit
5422fbcf56
@ -692,7 +692,7 @@ static struct rk_clk_armclk_rates rk3399_cpu_b_rates[] = {
|
|||||||
|
|
||||||
|
|
||||||
/* Standard PLL. */
|
/* Standard PLL. */
|
||||||
#define PLL(_id, _name, _base, _nm) \
|
#define PLL(_id, _name, _base) \
|
||||||
{ \
|
{ \
|
||||||
.type = RK3399_CLK_PLL, \
|
.type = RK3399_CLK_PLL, \
|
||||||
.clk.pll = &(struct rk_clk_pll_def) { \
|
.clk.pll = &(struct rk_clk_pll_def) { \
|
||||||
@ -703,7 +703,6 @@ static struct rk_clk_armclk_rates rk3399_cpu_b_rates[] = {
|
|||||||
.clkdef.flags = CLK_NODE_STATIC_STRINGS, \
|
.clkdef.flags = CLK_NODE_STATIC_STRINGS, \
|
||||||
.base_offset = _base, \
|
.base_offset = _base, \
|
||||||
.rates = rk3399_pll_rates, \
|
.rates = rk3399_pll_rates, \
|
||||||
.normal_mode = _nm \
|
|
||||||
}, \
|
}, \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,13 +795,13 @@ static struct rk_clk rk3399_clks[] = {
|
|||||||
FFACT(0, "clk_ddrc_div2", "clk_ddrc", 1, 2),
|
FFACT(0, "clk_ddrc_div2", "clk_ddrc", 1, 2),
|
||||||
|
|
||||||
/* PLLs */
|
/* PLLs */
|
||||||
PLL(PLL_APLLL, "lpll", 0x00, false),
|
PLL(PLL_APLLL, "lpll", 0x00),
|
||||||
PLL(PLL_APLLB, "bpll", 0x20, true),
|
PLL(PLL_APLLB, "bpll", 0x20),
|
||||||
PLL(PLL_DPLL, "dpll", 0x40, false),
|
PLL(PLL_DPLL, "dpll", 0x40),
|
||||||
PLL(PLL_CPLL, "cpll", 0x60, false),
|
PLL(PLL_CPLL, "cpll", 0x60),
|
||||||
PLL(PLL_GPLL, "gpll", 0x80, false),
|
PLL(PLL_GPLL, "gpll", 0x80),
|
||||||
PLL(PLL_NPLL, "npll", 0xA0, false),
|
PLL(PLL_NPLL, "npll", 0xA0),
|
||||||
PLL(PLL_VPLL, "vpll", 0xC0, false),
|
PLL(PLL_VPLL, "vpll", 0xC0),
|
||||||
|
|
||||||
/* CRU_CLKSEL_CON0 */
|
/* CRU_CLKSEL_CON0 */
|
||||||
CDIV(0, "aclkm_core_l_c", "armclkl", 0,
|
CDIV(0, "aclkm_core_l_c", "armclkl", 0,
|
||||||
|
@ -54,8 +54,6 @@ struct rk_clk_pll_sc {
|
|||||||
|
|
||||||
struct rk_clk_pll_rate *rates;
|
struct rk_clk_pll_rate *rates;
|
||||||
struct rk_clk_pll_rate *frac_rates;
|
struct rk_clk_pll_rate *frac_rates;
|
||||||
|
|
||||||
bool normal_mode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define WRITE4(_clk, off, val) \
|
#define WRITE4(_clk, off, val) \
|
||||||
@ -346,18 +344,8 @@ static int
|
|||||||
rk3399_clk_pll_init(struct clknode *clk, device_t dev)
|
rk3399_clk_pll_init(struct clknode *clk, device_t dev)
|
||||||
{
|
{
|
||||||
struct rk_clk_pll_sc *sc;
|
struct rk_clk_pll_sc *sc;
|
||||||
uint32_t reg;
|
|
||||||
|
|
||||||
sc = clknode_get_softc(clk);
|
sc = clknode_get_softc(clk);
|
||||||
|
|
||||||
if (sc->normal_mode) {
|
|
||||||
/* Setting to normal mode */
|
|
||||||
reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT;
|
|
||||||
reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT;
|
|
||||||
WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET,
|
|
||||||
reg | RK3399_CLK_PLL_WRITE_MASK);
|
|
||||||
}
|
|
||||||
|
|
||||||
clknode_init_parent_idx(clk, 0);
|
clknode_init_parent_idx(clk, 0);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -549,7 +537,6 @@ rk3399_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef)
|
|||||||
sc->flags = clkdef->flags;
|
sc->flags = clkdef->flags;
|
||||||
sc->rates = clkdef->rates;
|
sc->rates = clkdef->rates;
|
||||||
sc->frac_rates = clkdef->frac_rates;
|
sc->frac_rates = clkdef->frac_rates;
|
||||||
sc->normal_mode = clkdef->normal_mode;
|
|
||||||
|
|
||||||
clknode_register(clkdom, clk);
|
clknode_register(clkdom, clk);
|
||||||
|
|
||||||
|
@ -57,8 +57,6 @@ struct rk_clk_pll_def {
|
|||||||
|
|
||||||
struct rk_clk_pll_rate *rates;
|
struct rk_clk_pll_rate *rates;
|
||||||
struct rk_clk_pll_rate *frac_rates;
|
struct rk_clk_pll_rate *frac_rates;
|
||||||
|
|
||||||
bool normal_mode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RK_CLK_PLL_HAVE_GATE 0x1
|
#define RK_CLK_PLL_HAVE_GATE 0x1
|
||||||
|
Loading…
Reference in New Issue
Block a user