Skip to content

Commit 13ff3bd

Browse files
petegriffinkrzk
authored andcommitted
clk: samsung: clk-pll: Add support for pll_{0516,0517,518}
These plls are found in the Tensor gs101 SoC found in the Pixel 6. pll0516x: Integer PLL with high frequency pll0517x: Integer PLL with middle frequency pll0518x: Integer PLL with low frequency PLL0516x FOUT = (MDIV * 2 * FIN)/PDIV * 2^SDIV) PLL0517x and PLL0518x FOUT = (MDIV * FIN)/PDIV*2^SDIV) The PLLs are similar enough to pll_0822x that the same code can handle both. The main difference is the change in the fout formula for the high frequency 0516 pll. Locktime for 516,517 & 518 is 150 the same as the pll_0822x lock factor. MDIV, SDIV PDIV masks and bit shifts are also the same as 0822x. When defining the PLL the "con" parameter should be set to CON3 register, like this PLL(pll_0517x, CLK_FOUT_SHARED0_PLL, "fout_shared0_pll", "oscclk", PLL_LOCKTIME_PLL_SHARED0, PLL_CON3_PLL_SHARED0, NULL), Acked-by: Chanwoo Choi <[email protected]> Tested-by: Will McVicker <[email protected]> Reviewed-by: Sam Protsenko <[email protected]> Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 803b60b commit 13ff3bd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/clk/samsung/clk-pll.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ static unsigned long samsung_pll0822x_recalc_rate(struct clk_hw *hw,
443443
sdiv = (pll_con3 >> PLL0822X_SDIV_SHIFT) & PLL0822X_SDIV_MASK;
444444

445445
fvco *= mdiv;
446+
if (pll->type == pll_0516x)
447+
fvco *= 2;
448+
446449
do_div(fvco, (pdiv << sdiv));
447450

448451
return (unsigned long)fvco;
@@ -1316,6 +1319,9 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,
13161319
case pll_1417x:
13171320
case pll_0818x:
13181321
case pll_0822x:
1322+
case pll_0516x:
1323+
case pll_0517x:
1324+
case pll_0518x:
13191325
pll->enable_offs = PLL0822X_ENABLE_SHIFT;
13201326
pll->lock_offs = PLL0822X_LOCK_STAT_SHIFT;
13211327
if (!pll->rate_table)

drivers/clk/samsung/clk-pll.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ enum samsung_pll_type {
3838
pll_0822x,
3939
pll_0831x,
4040
pll_142xx,
41+
pll_0516x,
42+
pll_0517x,
43+
pll_0518x,
4144
};
4245

4346
#define PLL_RATE(_fin, _m, _p, _s, _k, _ks) \

0 commit comments

Comments
 (0)