RE: [PATCH v3 06/14 RESEND] clk: samsung: clk-pll: Add support for pll_4313
From: Alim Akhtar
Date: Wed Nov 18 2026 - 22:52:58 EST
Thanks Peter for review
> -----Original Message-----
> From: Peter Griffin <peter.griffin@xxxxxxxxxx>
> Sent: Friday, November 13, 2026 5:58 PM
> To: Raghav Sharma <raghav.s@xxxxxxxxxxx>
> Cc: krzk@xxxxxxxxxx; s.nawrocki@xxxxxxxxxxx; cw00.choi@xxxxxxxxxxx;
> alim.akhtar@xxxxxxxxxxx; sboyd@xxxxxxxxxx; bmasney+clk@xxxxxxxxxx;
> jbrunet+clk@xxxxxxxxxxxx; robh@xxxxxxxxxx; conor+dt@xxxxxxxxxx; linux-
> samsung-soc@xxxxxxxxxxxxxxx; linux-clk@xxxxxxxxxxxxxxx;
> devicetree@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; is.gandhi@xxxxxxxxxxx; ts.amit@xxxxxxxxxxx;
> pokala.reddy@xxxxxxxxxxx
> Subject: Re: [PATCH v3 06/14 RESEND] clk: samsung: clk-pll: Add support for
> pll_4313
>
> Hi Raghav,
>
> On Fri, 13 Nov 2026 at 10:53, Raghav Sharma <raghav.s@xxxxxxxxxxx>
> wrote:
> >
> > From: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>
> >
> > PLLs 4313 are found in the Exynos8855 SoC and it is similar to
> > pll_531x except for CON8 offset, so re-using code for
> > pll_4313
> >
> > Signed-off-by: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>
> > Signed-off-by: Raghav Sharma <raghav.s@xxxxxxxxxxx>
> > ---
> > drivers/clk/samsung/clk-pll.c | 11 ++++++++++-
> > drivers/clk/samsung/clk-pll.h | 1 +
> > 2 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/samsung/clk-pll.c
> > b/drivers/clk/samsung/clk-pll.c index 3d837bd74355..7b0756127306
> > 100644
> > --- a/drivers/clk/samsung/clk-pll.c
> > +++ b/drivers/clk/samsung/clk-pll.c
> > @@ -1306,7 +1306,15 @@ static unsigned long
> samsung_pll531x_recalc_rate(struct clk_hw *hw,
> > u64 mdiv, fout = parent_rate;
> >
> > pll_con0 = readl_relaxed(pll->con_reg);
> > - pll_con8 = readl_relaxed(pll->con_reg + 20);
> > + if (pll->type == pll_4313) {
> > + /* Offset for PLL_CON8 which hold FDIV different for PLL_4313
> > + * which is PLL_LOCKTIME_OFFSET - 0x4
> > + */
> > + pll_con8 = readl_relaxed(pll->lock_reg - 4);
> > + } else {
> > + pll_con8 = readl_relaxed(pll->con_reg + 20);
> > + }
> > +
>
> This starts to feel a bit hacky (pll_con8 register being referenced as an offset
> from lock_reg). Is the register really called pll_con8 on 8855? Or is it called
> something else, but happens to contain fdiv?
>
Yes, it is named as PLL_CON8_* on 8855, and contain fdiv bit.
> I think something like this would look cleaner:
>
> u32 fdiv_reg;
Historically SFR name was used to match with databook naming convention.
Few lines below it does indicate indeed pll_con8 contains fdiv.
fdiv = (pll_con8 & PLL531X_FDIV_MASK);
I am ok with taking this suggestion.
Only thing is should we change pll_con0 as well together, or in a separate top-up patch?
>
> if (pll->type == pll_4313) {
> /* fdiv in <insert name> register
> fdiv_reg = readl_relaxed(pll->lock_reg - 4);
> } else {
> /* fdiv in pll_con8 register */
> fdiv_reg = readl_relaxed(pll->con_reg + 20);
> }
>
> regards,
>
> Peter