Skip to content

Commit 4fd8ae9

Browse files
jernejskmripard
authored andcommitted
clk: sunxi-ng: h3: h5: Add minimal rate for video PLL
Although user manuals for H3 and H5 SoCs state that minimal rate supported by video PLL is around 30 MHz, it seems that in reality minimal rate is around 192 MHz. Experiments showed that any rate below 96 MHz doesn't produce any video output at all. Even at this frequency, stable output depends on right factors. For example, when N = 4 and M = 1, output is stable and when N = 8 and M = 2, it's not. BSP clock driver suggest that minimum stable frequency is 192 MHz. That would also be in line with A64 SoC, which has similar periphery. Set minimal video PLL rate for H3/H5 to 192 MHz. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]>
1 parent 2d2b61c commit 4fd8ae9

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

drivers/clk/sunxi-ng/ccu-sun8i-h3.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,18 @@ static SUNXI_CCU_NM_WITH_SDM_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
6969
BIT(28), /* lock */
7070
CLK_SET_RATE_UNGATE);
7171

72-
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video_clk, "pll-video",
73-
"osc24M", 0x0010,
74-
8, 7, /* N */
75-
0, 4, /* M */
76-
BIT(24), /* frac enable */
77-
BIT(25), /* frac select */
78-
270000000, /* frac rate 0 */
79-
297000000, /* frac rate 1 */
80-
BIT(31), /* gate */
81-
BIT(28), /* lock */
82-
CLK_SET_RATE_UNGATE);
72+
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video_clk, "pll-video",
73+
"osc24M", 0x0010,
74+
192000000, /* Minimum rate */
75+
8, 7, /* N */
76+
0, 4, /* M */
77+
BIT(24), /* frac enable */
78+
BIT(25), /* frac select */
79+
270000000, /* frac rate 0 */
80+
297000000, /* frac rate 1 */
81+
BIT(31), /* gate */
82+
BIT(28), /* lock */
83+
CLK_SET_RATE_UNGATE);
8384

8485
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
8586
"osc24M", 0x0018,

0 commit comments

Comments
 (0)