Message ID | cover.1697600121.git.quic_varada@quicinc.com |
---|---|
Headers | show |
Series | Enable cpufreq for IPQ5332 & IPQ9574 | expand |
On 10/18/23 11:29, Varadarajan Narayanan wrote: > IPQ95xx SoCs have different OPPs available for the CPU based on > SoC variant. This can be determined from an eFuse register > present in the silicon. > > Add support to read the eFuse and populate the OPPs based on it. > > Frequency 1.2GHz 1.8GHz 1.5GHz No opp-supported-hw > Limit > ------------------------------------------------------------ > 936000000 1 1 1 1 0xf > 1104000000 1 1 1 1 0xf > 1200000000 1 1 1 1 0xf > 1416000000 0 1 1 1 0x7 > 1488000000 0 1 1 1 0x7 > 1800000000 0 1 0 1 0x5 > 2208000000 0 0 0 1 0x1 > ----------------------------------------------------------- > > Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > --- > v2: cpu_speed_bin -> cpu-speed-bin in node name > Move comment to commit log > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad
Quoting Varadarajan Narayanan (2023-10-18 02:29:14) > diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c > index 4edbf77..f839a31 100644 > --- a/drivers/clk/qcom/clk-alpha-pll.c > +++ b/drivers/clk/qcom/clk-alpha-pll.c > @@ -2508,3 +2508,60 @@ const struct clk_ops clk_alpha_pll_stromer_ops = { > .set_rate = clk_alpha_pll_stromer_set_rate, > }; > EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_ops); > + > +static int clk_alpha_pll_stromer_plus_set_rate(struct clk_hw *hw, > + unsigned long rate, > + unsigned long prate) > +{ > + struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); > + u32 l, alpha_width = pll_alpha_width(pll); > + int ret; > + u64 a; > + > + rate = alpha_pll_round_rate(rate, prate, &l, &a, alpha_width); > + > + regmap_write(pll->clkr.regmap, PLL_MODE(pll), 0); It still assumes the clk is always enabled. Please read back the register value and make sure the PLL was already enabled before restoring the enable state of the clk. > + > + /* Delay of 2 output clock ticks required until output is disabled */ > + udelay(1);
Quoting Varadarajan Narayanan (2023-10-18 02:29:16) > The earlier 'l' value of 0x3e is for 1.5GHz. Not all SKUs support > this frequency. Hence set it to 0x2d to get 1.1GHz which is > supported in all SKUs. Maybe also add the detail to the commit text that the frequency can still increase above this initial configuration made here when the cpufreq driver picks a different OPP. > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > Fixes: c7ef7fbb1ccf ("clk: qcom: apss-ipq-pll: add support for IPQ5332") > Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>